dorkos 0.128.0 → 0.130.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 (375) hide show
  1. package/dist/bin/cli.js +766 -517
  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-CmQERFxo.js → AboutPage-B2CzVj5W.js} +1 -1
  5. package/dist/client/assets/{ActivityErrorState-Dw231W2w.js → ActivityErrorState-Dl-P-e0R.js} +1 -1
  6. package/dist/client/assets/{ActivityPage-DVfeyA9u.js → ActivityPage-CW7tqLHb.js} +1 -1
  7. package/dist/client/assets/ActivityRow-Vy4aXWk-.js +1 -0
  8. package/dist/client/assets/{AdapterIcon-NqCDzgCI.js → AdapterIcon-aabKVZmM.js} +1 -1
  9. package/dist/client/assets/AdapterSetupWizard-C5Hs0xkG.js +2 -0
  10. package/dist/client/assets/{AgentOptionRow-BRJfZo2y.js → AgentOptionRow-CqIMxq9S.js} +1 -1
  11. package/dist/client/assets/{AgentPicker-B7upjYRk.js → AgentPicker-C6mbTDJJ.js} +1 -1
  12. package/dist/client/assets/{AgentRequestCard-DXJnLk6q.js → AgentRequestCard-C8GV5Sxn.js} +4 -4
  13. package/dist/client/assets/AppearancePage-C0JKrHsO.js +1 -0
  14. package/dist/client/assets/{ApplyToOverridesDialog-C_QQhNIf.js → ApplyToOverridesDialog-DWEi0MNt.js} +1 -1
  15. package/dist/client/assets/AttentionSignalRow-Cpu0lKYg.js +1 -0
  16. package/dist/client/assets/{BaseTanStackRouterDevtoolsPanel-B-iktbLX-G7vrCqeA.js → BaseTanStackRouterDevtoolsPanel-B-iktbLX-_zVrHu5s.js} +3 -3
  17. package/dist/client/assets/BindingDialog-4UeaJfUu.js +1 -0
  18. package/dist/client/assets/BlintzCanvas-DCXIQZM_.js +1231 -0
  19. package/dist/client/assets/{CanvasCsvContent-CtLpZnTs.js → CanvasCsvContent-D-0TuvVs.js} +4 -4
  20. package/dist/client/assets/CanvasFileContent-DqSx7lz9.js +2 -0
  21. package/dist/client/assets/CanvasModel3dContent-zTx660yQ.js +2 -0
  22. package/dist/client/assets/ChannelComposer-D4TYVkvO.js +45 -0
  23. package/dist/client/assets/{ChatAppsOff-CCZUzDIH.js → ChatAppsOff-BzfyQc55.js} +2 -2
  24. package/dist/client/assets/{CodeMirrorDiff-BCpYdhgZ.js → CodeMirrorDiff-BLWBYGLp.js} +1 -1
  25. package/dist/client/assets/{CodeMirrorEditor-BeCubxHV.js → CodeMirrorEditor-D0q3ETxK.js} +1 -1
  26. package/dist/client/assets/{CommitmentList-BZtfTnwg.js → CommitmentList-BoMiLsRe.js} +1 -1
  27. package/dist/client/assets/{CommitmentsPage-DmurDgxV.js → CommitmentsPage-_7mNJVUZ.js} +1 -1
  28. package/dist/client/assets/{ComputerResourceView-Bik6GLKp.js → ComputerResourceView-Bo2LaCJf.js} +1 -1
  29. package/dist/client/assets/{ComputerViewer-CksBDqdu.js → ComputerViewer-a4VSdAw_.js} +1 -1
  30. package/dist/client/assets/ConnectionAccessLists-Dvv0YO31.js +1 -0
  31. package/dist/client/assets/{ConnectionsPage-Cgg36gDY.js → ConnectionsPage-oO8pNgbc.js} +2 -2
  32. package/dist/client/assets/{ConventionPage-CNhpF6Z1.js → ConventionPage-CFJjwhBd.js} +2 -2
  33. package/dist/client/assets/{ExtensionPageRoute-C2zue_Pw.js → ExtensionPageRoute-BqZN9q7M.js} +2 -2
  34. package/dist/client/assets/{FloatingTanStackRouterDevtools-CqogiFob-3v1TfY1P.js → FloatingTanStackRouterDevtools-CqogiFob-CnSp2ZEM.js} +1 -1
  35. package/dist/client/assets/{ForwardConsentHost-Mbo0D-zk.js → ForwardConsentHost-4LhRvCdu.js} +1 -1
  36. package/dist/client/assets/HandlePage-BjoYPqme.js +1 -0
  37. package/dist/client/assets/HeartbeatPage-rJzICayy.js +1 -0
  38. package/dist/client/assets/{KeyEntry-C43vkwpA.js → KeyEntry-BTTuXleL.js} +1 -1
  39. package/dist/client/assets/{LexicalField-iAHcvRmI.js → LexicalField-Dk_SDrjk.js} +1 -1
  40. package/dist/client/assets/{ManagesPage-BUIJvLmv.js → ManagesPage-Cvu3CQDn.js} +1 -1
  41. package/dist/client/assets/Marketplace-DPjPPlZz.js +36 -0
  42. package/dist/client/assets/{MarketplaceSourcesView-BZODwhxu.js → MarketplaceSourcesView-ChCys0on.js} +1 -1
  43. package/dist/client/assets/{McpAppFrame-D15nxVaI.js → McpAppFrame-DNamtzOp.js} +2 -2
  44. package/dist/client/assets/{McpSigninBody-DmBxqgxN.js → McpSigninBody-DLw3ZdZE.js} +1 -1
  45. package/dist/client/assets/{Model3dViewer-RGXeJd6a.js → Model3dViewer-IwCBCPZ2.js} +1 -1
  46. package/dist/client/assets/NamePage-FY_D0eA2.js +1 -0
  47. package/dist/client/assets/NewDirectMessageMenu-BB0gvClR.js +1 -0
  48. package/dist/client/assets/{NotificationsPage-NRfyiinS.js → NotificationsPage-aCF0AtqL.js} +1 -1
  49. package/dist/client/assets/{OpenMeshSwitch-CgQ6uefo.js → OpenMeshSwitch-DjCWF2Vy.js} +2 -2
  50. package/dist/client/assets/OperatorIdentityForm-Bcveds6f.js +1 -0
  51. package/dist/client/assets/{PermissionHistory-DPEPq8D9.js → PermissionHistory-CYsxFYmV.js} +1 -1
  52. package/dist/client/assets/{PermissionsPage--k-xutbJ.js → PermissionsPage-sxHkY92V.js} +1 -1
  53. package/dist/client/assets/{PersonalityPopover-DMMptmPS.js → PersonalityPopover-BZ20JTnJ.js} +1 -1
  54. package/dist/client/assets/PhotoPage-KBzkb0sT.js +1 -0
  55. package/dist/client/assets/PreviewRefusedNotice-BFQPYcUG.js +1 -0
  56. package/dist/client/assets/{ProfileFields-DbPJ7fvN.js → ProfileFields-sp17IFo8.js} +1 -1
  57. package/dist/client/assets/{ProfilePanelContainer-CzwhrIlw.js → ProfilePanelContainer-mA44jh5A.js} +1 -1
  58. package/dist/client/assets/{ProfileRolePicker-CZEXvlJm.js → ProfileRolePicker-Chh4_ZMB.js} +1 -1
  59. package/dist/client/assets/PromptSuggestionChips-CEi_-fHF.js +1 -0
  60. package/dist/client/assets/{ReportsToPopover-YOwGLJy5.js → ReportsToPopover-D1uknwnk.js} +1 -1
  61. package/dist/client/assets/RoomSurface-Clf1yLrr.js +1 -0
  62. package/dist/client/assets/{RoomsPage-CoXjZMWL.js → RoomsPage-BtCNzvhQ.js} +1 -1
  63. package/dist/client/assets/RunsOnPopover-LCvBpe9J.js +1 -0
  64. package/dist/client/assets/RuntimeConnectFlow-C5UDeHUC.js +1 -0
  65. package/dist/client/assets/RuntimeSetupDialog-Bqh67Vqb.js +1 -0
  66. package/dist/client/assets/{SeenDevices-Bh2yh-PW.js → SeenDevices-DvCfdeDo.js} +3 -3
  67. package/dist/client/assets/{SessionsPage-CFvkbT9X.js → SessionsPage-DLByE-re.js} +1 -1
  68. package/dist/client/assets/SettingsDialog-Co-Oxtyw.js +12 -0
  69. package/dist/client/assets/SkillsPage-Cc79IstM.js +1 -0
  70. package/dist/client/assets/TaskDialogWrapper-DuYV7Zch.js +1 -0
  71. package/dist/client/assets/TasksEmptyState-CfmPtBra.js +3 -0
  72. package/dist/client/assets/{TasksPage-D0Zi6Mve.js → TasksPage-DGk0zUhO.js} +1 -1
  73. package/dist/client/assets/{TeamComputerEntry-CY9eLVad.js → TeamComputerEntry-CLHbeX5i.js} +1 -1
  74. package/dist/client/assets/{ToolsPage-0_vx5P-F.js → ToolsPage-CSkDE7rZ.js} +2 -2
  75. package/dist/client/assets/{TopologyGraph-DUZLZZrB.js → TopologyGraph-pBC37k5P.js} +14 -14
  76. package/dist/client/assets/TourHost-CS9RsLj_.js +1 -0
  77. package/dist/client/assets/{UnlinkDialog-ptZy3IN4.js → UnlinkDialog-CelhOUZ0.js} +1 -1
  78. package/dist/client/assets/{UnreadDivider-Ckey1IWn.js → UnreadDivider-B_OMR0mQ.js} +1 -1
  79. package/dist/client/assets/WidgetErrorCard-CsMqCyCb.js +108 -0
  80. package/dist/client/assets/{WithheldExtensionsNotice-7Vu1Jctn.js → WithheldExtensionsNotice-GiKb0iQu.js} +1 -1
  81. package/dist/client/assets/WorkQueuePage-Cu721KyM.js +1 -0
  82. package/dist/client/assets/WorkView-CpWEaxMr.js +51 -0
  83. package/dist/client/assets/_shell-CmGG8Ysk.js +80 -0
  84. package/dist/client/assets/{_shell._home-BRIXhYLg.js → _shell._home-BnKkAeSp.js} +1 -1
  85. package/dist/client/assets/_shell._home.activity-DaaLJbvO.js +1 -0
  86. package/dist/client/assets/_shell._home.index-CNPasFxP.js +3 -0
  87. package/dist/client/assets/_shell._home.tasks-DXEOJ5Nq.js +1 -0
  88. package/dist/client/assets/_shell._home.workspaces-UeSvmquR.js +1 -0
  89. package/dist/client/assets/{_shell.channels-Bx6q9xVH.js → _shell.channels-NUbf5mcb.js} +4 -4
  90. package/dist/client/assets/_shell.connections-BEns4DKb.js +1 -0
  91. package/dist/client/assets/{_shell.feedback-requests-DFznTGbN.js → _shell.feedback-requests-NyjHNdnj.js} +2 -2
  92. package/dist/client/assets/_shell.marketplace-BEYqsDKe.js +1 -0
  93. package/dist/client/assets/_shell.marketplace_.sources-D6Ls30FY.js +1 -0
  94. package/dist/client/assets/_shell.session-CVc6i3eN.js +1 -0
  95. package/dist/client/assets/{_shell.team-DmA09abY.js → _shell.team-CXeOt4XD.js} +6 -6
  96. package/dist/client/assets/_shell.threads-BYdN1UtZ.js +1 -0
  97. package/dist/client/assets/_shell.x._extensionId-DtJYSfvG.js +1 -0
  98. package/dist/client/assets/_shell.x._extensionId_._-DtJYSfvG.js +1 -0
  99. package/dist/client/assets/{abnfDiagram-WEYOIA3C-DxgtVd9I.js → abnfDiagram-WEYOIA3C-BLCVDt6M.js} +1 -1
  100. package/dist/client/assets/{access-copy-Dqct36mi.js → access-copy-BSQ3QECN.js} +1 -1
  101. package/dist/client/assets/{arc-C-67Ef0p.js → arc-t4OhsI5R.js} +1 -1
  102. package/dist/client/assets/{architectureDiagram-ZHVYKT53-B7TjdT-_.js → architectureDiagram-ZHVYKT53-BcIfbGZR.js} +1 -1
  103. package/dist/client/assets/{banner-C9qTs6-C.js → banner-B6xfuDA7.js} +2 -2
  104. package/dist/client/assets/{blockDiagram-RJAE7QA3-DNqxJ3Ww.js → blockDiagram-RJAE7QA3-DTOlrcEZ.js} +1 -1
  105. package/dist/client/assets/{c4Diagram-XDPPPE54-D3jNLV0j.js → c4Diagram-XDPPPE54-CHGqwaxa.js} +1 -1
  106. package/dist/client/assets/channel-CSk6LhO2.js +1 -0
  107. package/dist/client/assets/{chunk-2E7WHVMD-C6OKx0ty.js → chunk-2E7WHVMD-Bh4L_7yX.js} +1 -1
  108. package/dist/client/assets/{chunk-2Q5K7J3B-Dr_6hHrZ.js → chunk-2Q5K7J3B-BmouLl8r.js} +1 -1
  109. package/dist/client/assets/{chunk-4EMNKR2T-CSrZVDEt.js → chunk-4EMNKR2T-BVhtiAdG.js} +1 -1
  110. package/dist/client/assets/{chunk-55XCU76K-CIazeRXO.js → chunk-55XCU76K-BdbLnE56.js} +1 -1
  111. package/dist/client/assets/{chunk-5VM5RSS4-C8IJ3zTR.js → chunk-5VM5RSS4-Qg9lQpPO.js} +1 -1
  112. package/dist/client/assets/{chunk-JWPE2WC7-D9DGXb79.js → chunk-JWPE2WC7-CfIrQaMW.js} +1 -1
  113. package/dist/client/assets/{chunk-VQ5W62QI-B0LNYdif.js → chunk-VQ5W62QI-BP9oQzc0.js} +1 -1
  114. package/dist/client/assets/{chunk-XXDRQBXY-C7IAIbvZ.js → chunk-XXDRQBXY-DKzIjnsB.js} +1 -1
  115. package/dist/client/assets/{chunk-ZCHMQSOR-C79hvjlu.js → chunk-ZCHMQSOR-DsvG6BGY.js} +2 -2
  116. package/dist/client/assets/{classDiagram-v2-4MYWR3UA-0Di1C2ZB.js → classDiagram-v2-4MYWR3UA-BSiSmGgP.js} +1 -1
  117. package/dist/client/assets/{command-BVQb6I3_.js → command-B_FPXirc.js} +1 -1
  118. package/dist/client/assets/copy-button-Bp75zBSh.js +1 -0
  119. package/dist/client/assets/{cose-bilkent-JH36ORCC-rZumaV4b.js → cose-bilkent-JH36ORCC-CXgyrZix.js} +1 -1
  120. package/dist/client/assets/{cpu-DeRuDMl4.js → cpu-DpkNIYeK.js} +1 -1
  121. package/dist/client/assets/{cynefin-EF2NZ3EQ-CI9l9xhM.js → cynefin-EF2NZ3EQ-DkmPO3hK.js} +1 -1
  122. package/dist/client/assets/{cynefinDiagram-WF24UDRP-C8CdorJJ.js → cynefinDiagram-WF24UDRP-BDknJT17.js} +1 -1
  123. package/dist/client/assets/{dagre-NK4GIZVX-AHpsTq1O.js → dagre-NK4GIZVX-BR4J5E3b.js} +1 -1
  124. package/dist/client/assets/detail-row-C8zz6mAC.js +1 -0
  125. package/dist/client/assets/{diagram-CBK3MWTC-BpPLL30n.js → diagram-CBK3MWTC-CvLKqPry.js} +1 -1
  126. package/dist/client/assets/{diagram-I5XIIV2D-D6loMn3G.js → diagram-I5XIIV2D-CVtE60X9.js} +1 -1
  127. package/dist/client/assets/{diagram-ODIL2UCW-BaGNd5eN.js → diagram-ODIL2UCW-B--CpfLk.js} +1 -1
  128. package/dist/client/assets/{diagram-PFBEJUXE-BnDdKu_g.js → diagram-PFBEJUXE-08gch1t1.js} +1 -1
  129. package/dist/client/assets/{diagram-RJA3I4VV-UXagB0_c.js → diagram-RJA3I4VV-C2e-ubaD.js} +1 -1
  130. package/dist/client/assets/{diagram-TYUNFSNR-C-whBP-S.js → diagram-TYUNFSNR-DcpK4OXX.js} +1 -1
  131. package/dist/client/assets/{ebnfDiagram-V4P3TTPT-BbG481iS.js → ebnfDiagram-V4P3TTPT-DM44BkBt.js} +1 -1
  132. package/dist/client/assets/{elk-QONTBCTQ-FtssIxOc.js → elk-QONTBCTQ-maYS1Zzm.js} +1 -1
  133. package/dist/client/assets/{empty-state-CACt-76q.js → empty-state-HtOTBAoq.js} +1 -1
  134. package/dist/client/assets/{erDiagram-KYQIGQAA-PpFgUf4C.js → erDiagram-KYQIGQAA-BR7z9r2M.js} +1 -1
  135. package/dist/client/assets/{execution-config-CGL73sRn.js → execution-config-DYYeJyJh.js} +1 -1
  136. package/dist/client/assets/{file-D80JE_L0.js → file-VtGYNr9E.js} +1 -1
  137. package/dist/client/assets/{file-exclamation-point-CcJ_e4_m.js → file-exclamation-point-eBlQssyW.js} +1 -1
  138. package/dist/client/assets/{file-text-Ds9edaTZ.js → file-text-DvNAxTGZ.js} +1 -1
  139. package/dist/client/assets/{find-latest-widget-fence-BtqFMP_f.js → find-latest-widget-fence-C2qXvASs.js} +5 -5
  140. package/dist/client/assets/{flowDiagram-IUGLLWBU-BIva66g9.js → flowDiagram-IUGLLWBU-DiuMtMbj.js} +1 -1
  141. package/dist/client/assets/form-CGIIzr1u.js +1 -0
  142. package/dist/client/assets/{format-cron-BpGrgPLu.js → format-cron-BzJ6ekoo.js} +1 -1
  143. package/dist/client/assets/format-tokens-DymkROvy.js +1 -0
  144. package/dist/client/assets/{ganttDiagram-R7GPNTJY-CZqips_4.js → ganttDiagram-R7GPNTJY-Cf_z8Ri1.js} +1 -1
  145. package/dist/client/assets/{git-branch-B8JNwQ6q.js → git-branch-BVzjBPW-.js} +1 -1
  146. package/dist/client/assets/{gitGraphDiagram-PDYL7XHY-DoIc3lda.js → gitGraphDiagram-PDYL7XHY-RZXACCBr.js} +1 -1
  147. package/dist/client/assets/{graph-yizM0vwL.js → graph-DfAV_ObD.js} +1 -1
  148. package/dist/client/assets/{heart-BavUIV45.js → heart-BMOCYMFT.js} +1 -1
  149. package/dist/client/assets/{highlighted-body-KPVGNVTW-CGr3AgaU.js → highlighted-body-KPVGNVTW-DrrsaKBc.js} +1 -1
  150. package/dist/client/assets/image-lightbox-tAwBNBhm.js +1 -0
  151. package/dist/client/assets/{image-off-C1uTDs9-.js → image-off-BpagBHk1.js} +1 -1
  152. package/dist/client/assets/{index-CrTmY12y.js → index-0uCJUW_h.js} +2 -2
  153. package/dist/client/assets/index-0y0K3rYv.js +1 -0
  154. package/dist/client/assets/{index-CJXMgnYp.js → index-2GjydAcS.js} +1 -1
  155. package/dist/client/assets/index-6dsaPQ7-.js +1 -0
  156. package/dist/client/assets/{index-X282DRZf.js → index-7-yzdcAx.js} +3 -3
  157. package/dist/client/assets/{index-C8ZpJXTQ.js → index-A7HgzxSw.js} +1 -1
  158. package/dist/client/assets/{index-DW4KUPHp.js → index-BEqKTiCR.js} +1 -1
  159. package/dist/client/assets/{index-56EOd-zy.js → index-BIN0yv4s.js} +1 -1
  160. package/dist/client/assets/{index-FhWMRBQP.js → index-BL5Vmq62.js} +1 -1
  161. package/dist/client/assets/index-BOvFXsF_.js +1 -0
  162. package/dist/client/assets/index-BbcfxnHC.js +1 -0
  163. package/dist/client/assets/{index-DqkFtcGQ.js → index-BdKIijqB.js} +1 -1
  164. package/dist/client/assets/{index-BOEPL6hN.js → index-BfAymWoj.js} +1 -1
  165. package/dist/client/assets/{index-BKWJiERs.js → index-Bgts5its.js} +1 -1
  166. package/dist/client/assets/{index-n_pnc-CO.js → index-BiL3chP7.js} +1 -1
  167. package/dist/client/assets/{index-FI_y_dND.js → index-Bu3PEVA_.js} +1 -1
  168. package/dist/client/assets/{index-BOhSPP-6.js → index-C6DTV4h3.js} +1 -1
  169. package/dist/client/assets/{index-Cdod8zEY.js → index-CCH9c-nB.js} +1 -1
  170. package/dist/client/assets/{index-BkJlIXqM.js → index-CH4NJ8dD.js} +1 -1
  171. package/dist/client/assets/{index-CiGYtR9O.js → index-CKGJp3Cm.js} +1 -1
  172. package/dist/client/assets/{index-DEiSJbvu.js → index-CeqI4FFw.js} +1 -1
  173. package/dist/client/assets/{index-C4t0UTU-.js → index-Cj9-XXKl.js} +1 -1
  174. package/dist/client/assets/{index-ZR5f82z2.js → index-Cu8tnfM_.js} +1 -1
  175. package/dist/client/assets/{index-Dcd4NqFB.js → index-D4OWRMsG.js} +1 -1
  176. package/dist/client/assets/{index-Br6xDNvu.js → index-D8SP73Xw.js} +1 -1
  177. package/dist/client/assets/{index-CoNMlH37.js → index-DEJXVqcY.js} +1 -1
  178. package/dist/client/assets/{index-CoKNU2F9.js → index-DEMZynQt.js} +1 -1
  179. package/dist/client/assets/index-DGzMwE1Z.js +1 -0
  180. package/dist/client/assets/{index-1QfQImuJ.js → index-DIJdZqg2.js} +3 -3
  181. package/dist/client/assets/{index-YSHcMqHa.js → index-DIRqrOEK.js} +1 -1
  182. package/dist/client/assets/{index-CeDn1Ak1.js → index-DNbdGvs9.js} +1 -1
  183. package/dist/client/assets/{index-7XeZCCDI.js → index-DOBjxRe9.js} +1 -1
  184. package/dist/client/assets/{index-BJEt9R_G.js → index-DcBlHsnC.js} +1 -1
  185. package/dist/client/assets/index-DdsaTuqO.js +1 -0
  186. package/dist/client/assets/index-Dt4H9Tms.js +17 -0
  187. package/dist/client/assets/{index-DYEmUa5t.js → index-HXC63Ry8.js} +1 -1
  188. package/dist/client/assets/index-MHIn2TC9.js +1063 -0
  189. package/dist/client/assets/{index-tgbcsB6H.js → index-OjJ_8uMM.js} +1 -1
  190. package/dist/client/assets/index-P4Wos1Gi.css +1 -0
  191. package/dist/client/assets/{index-QSXJR98z.js → index-U5jTIqzv.js} +1 -1
  192. package/dist/client/assets/{index-CXBYgGja.js → index-ZzPr9GUI.js} +1 -1
  193. package/dist/client/assets/index-d9cqTUAj.js +1 -0
  194. package/dist/client/assets/{index-LwL5BpE4.js → index-fcfCRITA.js} +1 -1
  195. package/dist/client/assets/{index-SOKlO1zZ.js → index-onQlu3UR.js} +1 -1
  196. package/dist/client/assets/{index.esm-CAeUe7uQ.js → index.esm-DSKTDEoH.js} +1 -1
  197. package/dist/client/assets/{infoDiagram-MVDRKAX5-DweUdYSy.js → infoDiagram-MVDRKAX5-B8dulOBe.js} +1 -1
  198. package/dist/client/assets/{inline-code-SYHTKcle.js → inline-code-B3qpjdZ2.js} +1 -1
  199. package/dist/client/assets/{ishikawaDiagram-HPEHV2GE-DKNQIv7P.js → ishikawaDiagram-HPEHV2GE-Cy8aIg0O.js} +1 -1
  200. package/dist/client/assets/{journeyDiagram-BOSHW7O7-DPD7F4VO.js → journeyDiagram-BOSHW7O7-BZAlejG3.js} +1 -1
  201. package/dist/client/assets/{kanban-definition-FNSA4HC5-B_uPSwxC.js → kanban-definition-FNSA4HC5-BxS1edpe.js} +1 -1
  202. package/dist/client/assets/{layers-F4mvrI2l.js → layers-ByCM7XO5.js} +1 -1
  203. package/dist/client/assets/{lightbulb-a6nNsrzy.js → lightbulb-KjW8YTXH.js} +1 -1
  204. package/dist/client/assets/{link-2-yI2Tlm7Q.js → link-2-CtFfuMO5.js} +1 -1
  205. package/dist/client/assets/{list-runtime-types-CsGil5te.js → list-runtime-types-DrzHejZo.js} +1 -1
  206. package/dist/client/assets/{markdown-content-Cjhsscbn.js → markdown-content-DgiSdNwz.js} +1 -1
  207. package/dist/client/assets/mention-pill-CHPHlu-U.js +1 -0
  208. package/dist/client/assets/{mermaid.core-9PwG-9fN.js → mermaid.core-ovqlC4PC.js} +4 -4
  209. package/dist/client/assets/{message-square-off-aV4NMCjd.js → message-square-off-CEOyy4Pq.js} +1 -1
  210. package/dist/client/assets/{mindmap-definition-6OY57UG3-BRbWmQkj.js → mindmap-definition-6OY57UG3-CsngqLzI.js} +1 -1
  211. package/dist/client/assets/{more-details-CRLU2HN4.js → more-details-BW9mauVT.js} +1 -1
  212. package/dist/client/assets/{owner-notice-CTJbhUak.js → owner-notice-BRUVafHC.js} +1 -1
  213. package/dist/client/assets/{package-sPggO7Dr.js → package-Bbs99yqi.js} +1 -1
  214. package/dist/client/assets/{page-container-CnfDuiDC.js → page-container-BVfGgaaJ.js} +1 -1
  215. package/dist/client/assets/{pane-resize-handle-63OC5vfI.js → pane-resize-handle-BL7Meu5R.js} +1 -1
  216. package/dist/client/assets/{paperclip-WhPo3_WD.js → paperclip-QOWXs8-5.js} +1 -1
  217. package/dist/client/assets/path-input-BDRHmgzW.js +1 -0
  218. package/dist/client/assets/{pegDiagram-ECIUJNBX-Ct9Li_PA.js → pegDiagram-ECIUJNBX-DPsWmWqw.js} +1 -1
  219. package/dist/client/assets/{pieDiagram-GNMPY74T-BAB5RA5v.js → pieDiagram-GNMPY74T-BdOIDv4F.js} +1 -1
  220. package/dist/client/assets/{plug-_q5iqunq.js → plug-BrsPyUhu.js} +1 -1
  221. package/dist/client/assets/primer-trigger-C97fRm1v.js +3 -0
  222. package/dist/client/assets/{profile-errors-COcBx7w5.js → profile-errors-nPLX60ha.js} +1 -1
  223. package/dist/client/assets/{progress-77FCPL2y.js → progress-C9TALtIa.js} +1 -1
  224. package/dist/client/assets/{quadrantDiagram-D57K4MC3-BqPJVmMS.js → quadrantDiagram-D57K4MC3-MzMEunU7.js} +1 -1
  225. package/dist/client/assets/{query-error-state-5236P3z0.js → query-error-state-BJjgx-WC.js} +1 -1
  226. package/dist/client/assets/{radio-C8xmfoqO.js → radio-Biql29-B.js} +1 -1
  227. package/dist/client/assets/{railroadDiagram-Y72NRBL7-B8U11nT6.js → railroadDiagram-Y72NRBL7-Dzx_PYVW.js} +1 -1
  228. package/dist/client/assets/registry-B0HgbN69.js +1 -0
  229. package/dist/client/assets/registry-fiUD5cv6.js +39 -0
  230. package/dist/client/assets/{relay-trace-schemas-B80E4EUn.js → relay-trace-schemas-BJ4MfChd.js} +2 -2
  231. package/dist/client/assets/{repeat-CHmB_vD7.js → repeat-CKufDGoQ.js} +1 -1
  232. package/dist/client/assets/{requirementDiagram-EQYSW5RA-CzJ1gzTh.js → requirementDiagram-EQYSW5RA-J0pg6FEt.js} +1 -1
  233. package/dist/client/assets/{room-files-source-B0gc97Ri.js → room-files-source-iaYdshKo.js} +2 -2
  234. package/dist/client/assets/{rotate-ccw-clock-CCU6SVnv.js → rotate-ccw-clock-CnARSw5V.js} +1 -1
  235. package/dist/client/assets/{rotate-cw-B8WQa8O-.js → rotate-cw-BAn_5-Gq.js} +1 -1
  236. package/dist/client/assets/{sankeyDiagram-SY24JHO5-D4vQwyve.js → sankeyDiagram-SY24JHO5-6V_uy-zQ.js} +1 -1
  237. package/dist/client/assets/scroll-area-XDq7yL_d.js +1 -0
  238. package/dist/client/assets/{sequenceDiagram-BLEHNHQU-BVnIsPQe.js → sequenceDiagram-BLEHNHQU-C4jZi3N4.js} +1 -1
  239. package/dist/client/assets/{shield-x-ijIbRppV.js → shield-x-CpiXuMbN.js} +1 -1
  240. package/dist/client/assets/signed-in-Rv3Sjk8n.js +1 -0
  241. package/dist/client/assets/{sizeCapture-INFHLROL-DGb1rAJL.js → sizeCapture-INFHLROL-B7nxFreb.js} +1 -1
  242. package/dist/client/assets/{soul-file-CXgYs25S.js → soul-file-BQz4TtHo.js} +1 -1
  243. package/dist/client/assets/{stateDiagram-v2-A6IESKWZ-DeX3IKTm.js → stateDiagram-v2-A6IESKWZ-B5rvc4n2.js} +1 -1
  244. package/dist/client/assets/{swimlanes-B3ENRKFQ-DN5ljYhG.js → swimlanes-B3ENRKFQ-DnElusDo.js} +1 -1
  245. package/dist/client/assets/swimlanesDiagram-AYQRV4AK-DLpKz5fF.js +8 -0
  246. package/dist/client/assets/{table-D9ww_3Ij.js → table-NGiWzPO4.js} +1 -1
  247. package/dist/client/assets/{timeline-definition-JXYKGLGB-DpRthC3r.js → timeline-definition-JXYKGLGB-DMgyn3XX.js} +1 -1
  248. package/dist/client/assets/{trust-posture-Dn2ciEE0.js → trust-posture-BArJ9H4j.js} +1 -1
  249. package/dist/client/assets/{unplug-BZ8zSvfB.js → unplug-MSjeZ0tJ.js} +1 -1
  250. package/dist/client/assets/{unverified-catalog-notice-CGy05tAO.js → unverified-catalog-notice-DA96H8Df.js} +1 -1
  251. package/dist/client/assets/{use-bindings-BLAWQRpe.js → use-bindings-BojBqRJS.js} +1 -1
  252. package/dist/client/assets/{use-composer-prefs-ICOpilWK.js → use-composer-prefs-BDl8aMme.js} +1 -1
  253. package/dist/client/assets/{use-connector-management-DEMGZy9N.js → use-connector-management-FONU6FK8.js} +1 -1
  254. package/dist/client/assets/{use-deep-link-scroll-DxGYrks3.js → use-deep-link-scroll-CtbBPBgi.js} +1 -1
  255. package/dist/client/assets/{use-delete-binding-Bnv3J5Fu.js → use-delete-binding-COhBv6X3.js} +1 -1
  256. package/dist/client/assets/{use-dev-links-BOcktLiE.js → use-dev-links-Dh0MCiGY.js} +1 -1
  257. package/dist/client/assets/{use-direct-message-panel-D38tSozW.js → use-direct-message-panel-CYnWunqk.js} +1 -1
  258. package/dist/client/assets/{use-external-adapter-catalog-9qiNBqpc.js → use-external-adapter-catalog-RTDOW8Yi.js} +1 -1
  259. package/dist/client/assets/use-filter-state-CSFTDx7z.js +6 -0
  260. package/dist/client/assets/use-full-activity-feed-DlY_ZbRZ.js +1 -0
  261. package/dist/client/assets/use-is-below-desktop-ClzGXlRb.js +1 -0
  262. package/dist/client/assets/{use-local-browser-B1huJhdg.js → use-local-browser-WwZd-FOP.js} +1 -1
  263. package/dist/client/assets/{use-mesh-topology-BTYAy6zc.js → use-mesh-topology-WnFkjq41.js} +1 -1
  264. package/dist/client/assets/{use-mounted-ref-CaPc6Prv.js → use-mounted-ref-Dz1h70pz.js} +1 -1
  265. package/dist/client/assets/{use-notification-prefs-u76DPoP0.js → use-notification-prefs-IrF5_cko.js} +1 -1
  266. package/dist/client/assets/use-pending-read-CnAnzOt_.js +1 -0
  267. package/dist/client/assets/use-personality-commit-C4hYkSPy.js +1 -0
  268. package/dist/client/assets/use-promo-activation-CPVANFBh.js +6 -0
  269. package/dist/client/assets/{use-promo-dismissals-CO7-qhEl.js → use-promo-dismissals-B9m0HT6L.js} +1 -1
  270. package/dist/client/assets/{use-pulse-freshness-D07Mv-Sa.js → use-pulse-freshness-DMySxN8D.js} +1 -1
  271. package/dist/client/assets/{use-room-follow-claim-DRQBuAIe.js → use-room-follow-claim-ByaYVY0o.js} +1 -1
  272. package/dist/client/assets/{use-room-sessions-Bzk7rM40.js → use-room-sessions-DPB29acU.js} +1 -1
  273. package/dist/client/assets/{use-roving-tab-list-CcznVldj.js → use-roving-tab-list-BO8kbs-w.js} +1 -1
  274. package/dist/client/assets/{use-session-canvas-CpgE7tFb.js → use-session-canvas-Cunag2K7.js} +9 -9
  275. package/dist/client/assets/use-status-budget-jt-9aQR0.js +21 -0
  276. package/dist/client/assets/{use-transform-ByJGn3hq.js → use-transform-ydtuYUNp.js} +1 -1
  277. package/dist/client/assets/{use-unclaimed-chats-C-z5fstJ.js → use-unclaimed-chats-ClBWJgNm.js} +1 -1
  278. package/dist/client/assets/use-update-config-ZHtOtve0.js +1 -0
  279. package/dist/client/assets/{useMutationState-BF1EFtIZ.js → useMutationState-B8ArIqeH.js} +1 -1
  280. package/dist/client/assets/{usecaseDiagram-WPOLBNNX-efVKbRIX.js → usecaseDiagram-WPOLBNNX-C5JdAkG9.js} +1 -1
  281. package/dist/client/assets/{vennDiagram-Q3Y3IDCW-Bravmwce.js → vennDiagram-Q3Y3IDCW-CqLCy7LU.js} +1 -1
  282. package/dist/client/assets/{wardleyDiagram-IVAIDKWA-fR77zByv.js → wardleyDiagram-IVAIDKWA-C9FlHLTd.js} +1 -1
  283. package/dist/client/assets/{xychartDiagram-4URNHDU4-BphORSLh.js → xychartDiagram-4URNHDU4-BIm-RUWd.js} +1 -1
  284. package/dist/client/index.html +2 -2
  285. package/dist/drizzle/20261031012841_dor3309_file_turn_on_offer.sql +2 -0
  286. package/dist/drizzle/20261101122330_schedule_declined_content_key.sql +1 -0
  287. package/dist/drizzle/20261101195529_work_queue.sql +38 -0
  288. package/dist/drizzle/20261101233656_dor3644_session_launched_by.sql +1 -0
  289. package/dist/drizzle/20261102041558_dor3070_marketplace_summary.sql +2 -0
  290. package/dist/drizzle/20261102051715_dor3440_clear_origin_holds.sql +10 -0
  291. package/dist/drizzle/20261102135442_agent_browser_profiles.sql +15 -0
  292. package/dist/drizzle/meta/20261031012841_snapshot.json +14116 -0
  293. package/dist/drizzle/meta/20261101122330_snapshot.json +14123 -0
  294. package/dist/drizzle/meta/20261101195529_snapshot.json +14363 -0
  295. package/dist/drizzle/meta/20261101233656_snapshot.json +14370 -0
  296. package/dist/drizzle/meta/20261102041558_snapshot.json +14384 -0
  297. package/dist/drizzle/meta/20261102051715_snapshot.json +14384 -0
  298. package/dist/drizzle/meta/20261102135442_snapshot.json +14483 -0
  299. package/dist/drizzle/meta/_journal.json +49 -0
  300. package/dist/server/extension-child.cjs +1147 -572
  301. package/dist/server/index.js +45678 -38894
  302. package/dist/server/index.js.map +2 -2
  303. package/package.json +5 -5
  304. package/dist/client/assets/ActivityRow-DIBH4v9c.js +0 -1
  305. package/dist/client/assets/AdapterSetupWizard-Dle_b9qc.js +0 -2
  306. package/dist/client/assets/AppearancePage-DXbhUt2e.js +0 -1
  307. package/dist/client/assets/AttentionSignalRow-5E7TkG98.js +0 -1
  308. package/dist/client/assets/BindingDialog-q--8SDJF.js +0 -1
  309. package/dist/client/assets/BlintzCanvas-DruVZcDU.js +0 -1231
  310. package/dist/client/assets/CanvasFileContent-BThy5fjD.js +0 -2
  311. package/dist/client/assets/CanvasModel3dContent-BbgR73jh.js +0 -2
  312. package/dist/client/assets/ChannelComposer-qhk0KtW7.js +0 -44
  313. package/dist/client/assets/ConnectionAccessLists-DRwO1v0V.js +0 -1
  314. package/dist/client/assets/HandlePage-B4qbFi40.js +0 -1
  315. package/dist/client/assets/HeartbeatPage-BnNbQLCW.js +0 -1
  316. package/dist/client/assets/Marketplace-DbdLWz0-.js +0 -36
  317. package/dist/client/assets/NamePage-fhxyWDDY.js +0 -1
  318. package/dist/client/assets/NewDirectMessageMenu-DBAdvv5p.js +0 -1
  319. package/dist/client/assets/OperatorIdentityForm-Bls5Vo_u.js +0 -1
  320. package/dist/client/assets/PhotoPage-CNHcXbz4.js +0 -1
  321. package/dist/client/assets/PreviewRefusedNotice-Ds4IO32o.js +0 -1
  322. package/dist/client/assets/PromptSuggestionChips-BXxC799Q.js +0 -1
  323. package/dist/client/assets/RoomSurface-DgH3a_Fv.js +0 -1
  324. package/dist/client/assets/RunsOnPopover-CEkkjrGg.js +0 -1
  325. package/dist/client/assets/RuntimeConnectFlow-DXWGgvCW.js +0 -1
  326. package/dist/client/assets/RuntimeSetupDialog-D6L1QhMF.js +0 -1
  327. package/dist/client/assets/SettingsDialog-BOOqWKcj.js +0 -12
  328. package/dist/client/assets/SkillsPage-ntCEhUIM.js +0 -1
  329. package/dist/client/assets/TaskDialogWrapper-vBWAWwTY.js +0 -1
  330. package/dist/client/assets/TasksEmptyState-C_3UkAbA.js +0 -3
  331. package/dist/client/assets/TourHost-B69XAKpE.js +0 -1
  332. package/dist/client/assets/WidgetErrorCard-BlqaIsPK.js +0 -108
  333. package/dist/client/assets/WorkView-BekLkR4O.js +0 -51
  334. package/dist/client/assets/_shell-Du0F-5fK.js +0 -80
  335. package/dist/client/assets/_shell._home.activity-5rihXoYF.js +0 -1
  336. package/dist/client/assets/_shell._home.index-BsLNqt4f.js +0 -3
  337. package/dist/client/assets/_shell._home.tasks-Cxs5tLWA.js +0 -1
  338. package/dist/client/assets/_shell._home.workspaces-CEHDdfbP.js +0 -1
  339. package/dist/client/assets/_shell.connections-Bm0WmgXH.js +0 -1
  340. package/dist/client/assets/_shell.marketplace-CsQ60Mlc.js +0 -1
  341. package/dist/client/assets/_shell.marketplace_.sources-DNyShS1x.js +0 -1
  342. package/dist/client/assets/_shell.session-BN42bV3w.js +0 -1
  343. package/dist/client/assets/_shell.threads-HH4EvufJ.js +0 -1
  344. package/dist/client/assets/_shell.x._extensionId-3ZlJV1iu.js +0 -1
  345. package/dist/client/assets/_shell.x._extensionId_._-3ZlJV1iu.js +0 -1
  346. package/dist/client/assets/card-DUmTNXJJ.js +0 -1
  347. package/dist/client/assets/channel-B7zgJbnU.js +0 -1
  348. package/dist/client/assets/form-D93N5lrK.js +0 -1
  349. package/dist/client/assets/image-lightbox-vgPEvSCc.js +0 -1
  350. package/dist/client/assets/index-B36osK_S.js +0 -17
  351. package/dist/client/assets/index-B446r3dL.js +0 -1
  352. package/dist/client/assets/index-BGo1YiUE.js +0 -1
  353. package/dist/client/assets/index-BO3yPJt-.js +0 -1
  354. package/dist/client/assets/index-DE6uOpn4.js +0 -1
  355. package/dist/client/assets/index-Dag1qeZI.js +0 -1
  356. package/dist/client/assets/index-Dm0Tav7v.js +0 -1
  357. package/dist/client/assets/index-Dry_agqN.css +0 -1
  358. package/dist/client/assets/index-OQuvRZTD.js +0 -1058
  359. package/dist/client/assets/index-eVrGefuq.js +0 -1
  360. package/dist/client/assets/mention-pill-BsOeTJ2f.js +0 -1
  361. package/dist/client/assets/path-input-C2KIXdON.js +0 -1
  362. package/dist/client/assets/primer-trigger-B2tjuHBx.js +0 -3
  363. package/dist/client/assets/registry-BzXBOE9h.js +0 -34
  364. package/dist/client/assets/registry-sfhDu9q2.js +0 -1
  365. package/dist/client/assets/scroll-area-FwZwM74Q.js +0 -1
  366. package/dist/client/assets/search-x-Q18Wm-C5.js +0 -6
  367. package/dist/client/assets/signed-in-DEOMBWVX.js +0 -1
  368. package/dist/client/assets/swimlanesDiagram-AYQRV4AK-D8kHFWtL.js +0 -8
  369. package/dist/client/assets/use-full-activity-feed-CtQquOBW.js +0 -1
  370. package/dist/client/assets/use-is-below-desktop-CAGEAsCC.js +0 -1
  371. package/dist/client/assets/use-pending-read-D0y6i7G9.js +0 -1
  372. package/dist/client/assets/use-personality-commit-C3h8upDo.js +0 -1
  373. package/dist/client/assets/use-promo-activation-5HG08FlB.js +0 -11
  374. package/dist/client/assets/use-status-budget-Xn2sIeM1.js +0 -16
  375. package/dist/client/assets/use-update-config-L5NCTj3t.js +0 -1
@@ -1 +0,0 @@
1
- import{a1 as S,a2 as z,ib as h,ic as g,a3 as w,a4 as A,dD as M,an as I,j as e,r as d,U as O,G as N,B as j,a0 as q,e7 as y,bH as K,bI as U,bJ as W,bK as Q,bL as G,bM as J,bN as Y,bP as X,h as H,l as E,en as V,$ as Z,e as $,eq as ee,id as se,gX as R,_ as L}from"./index-OQuvRZTD.js";import{B as P}from"./banner-C9qTs6-C.js";import{I as C}from"./inline-code-SYHTKcle.js";import{P as _}from"./package-sPggO7Dr.js";function D(s){const t=S();return z({queryKey:h.status(s),queryFn:()=>t.getHarnessStatus(s),staleTime:3e4,refetchOnMount:"always"})}const te={native:"reads it",projected:"shared",drifted:"out of date",dropped:"can’t see it",warned:"may not work",conflict:"blocked","pending-approval":"needs your OK"},ne={native:"neutral",projected:"neutral",drifted:"info",dropped:"muted",warned:"warning",conflict:"warning","pending-approval":"warning"},b="\0",ae=new Set(["native","projected"]);function T(s){return`${s.scope??"project"}${b}${s.artifact}${b}${s.source??""}${b}${s.name}`}function re(s,t){return`${g[s]} ${te[t]}`}function ie(s){return s.reason??s.target}function B(s,t){return t.flatMap(n=>{const a=s.cells[n];return a===void 0?[]:[{harness:n,cell:a}]})}function le(s,t){if(t.length===0)return!1;const n=B(s,t);return n.length===t.length&&n.every(({cell:a})=>{var r;return ae.has(a.state)&&!((r=a.warnings)!=null&&r.length)})}function k(s){return`${s} ${s===1?"file":"files"}`}function oe(s){return s===1?"One package is waiting for your approval.":`${s} packages are waiting for your approval.`}function ce(s){return`Shared with all ${s}`}function de(s){return s===1?"1 agent file":`${s} agent files`}function ue(s){return`Agent files ${s} can’t see: skills, rules, commands and more.`}function xe(s){return s===1?"1 entry":`${s} entries`}function fe(s,t){return t.flatMap(n=>{const a=s.flatMap(r=>{const i=r.cells[n];return i===void 0||i.state!=="dropped"?[]:[{key:T(r),artifact:r.artifact,name:r.name,...i.reason===void 0?{}:{reason:i.reason}}]});return a.length===0?[]:[{harness:n,label:g[n],entries:a}]})}const me={drop:"Not shared",warning:"Couldn’t read",write:"Will be written",notice:"Notice"};function pe(s){return`${me[s.kind]} · ${s.artifact} ${s.name}`}function he(s){const t=S(),n=w();return A({mutationFn:()=>t.syncHarness(s),meta:{errorLabel:"Couldn’t share your agent files"},onSuccess:a=>{n.setQueryData(h.status(s),a.status),M.success("Agent files updated.")}})}function ge(s){const t=w();I("approval_resolved",()=>{t.invalidateQueries({queryKey:h.status(s)})})}function je({result:s,onDismiss:t}){const{applied:n,removals:a,askedAbout:r}=s;return e.jsx(P,{variant:"neutral",onDismiss:t,dismissLabel:"Dismiss what changed","data-slot":"harness-sync-summary",children:e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("p",{children:[e.jsx("span",{className:"font-medium",children:"Agent files updated."}),n>0&&e.jsxs(e.Fragment,{children:[" ",k(n)," written."]})]}),a.length>0&&e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs("p",{className:"font-medium",children:["Removed ",k(a.length)," DorkOS put here:"]}),e.jsx("ul",{className:"flex flex-col gap-0.5",children:a.map(({path:i,reason:c})=>e.jsxs("li",{className:"text-3xs flex flex-col",children:[e.jsx("code",{className:"font-mono",children:i}),e.jsx("span",{className:"opacity-80",children:c})]},i))})]}),r.length>0&&e.jsx("p",{children:oe(r.length)})]})})}function ve(s){const{counts:t,sweepPreview:n}=s;return t.drifted>0||n.length>0?{message:"Some agent files are out of date.",variant:n.length>0?"warning":"info",actionable:!0}:t.conflicts>0?{message:"DorkOS can’t update some files. Something blocks them.",variant:"warning",actionable:!1}:t.adoptable>0?{message:"Some skills only reach a few of your agents.",variant:"info",actionable:!1}:null}function Ne({projectPath:s}){return ge(s),null}function ye({projectPath:s}){const{data:t}=D(s),n=he(s),[a,r]=d.useState(!1),[i,c]=d.useState(!1);if(t===void 0||t.state!=="ready")return null;const u=e.jsx(Ne,{projectPath:s});if(n.data!==void 0&&!i)return e.jsxs(e.Fragment,{children:[u,e.jsx(je,{result:n.data,onDismiss:()=>c(!0)})]});const o=ve(t);if(o===null)return u;const{removals:x,sweepPreview:m}=t,l=m.length;return e.jsxs(e.Fragment,{children:[u,e.jsx(P,{variant:o.variant,"data-slot":"harness-drift-banner",detailsOpen:a,details:l===0?void 0:e.jsx("ul",{className:"flex flex-col gap-0.5",children:x.map(({path:f,reason:v})=>e.jsxs("li",{className:"text-3xs flex flex-col",children:[e.jsx("code",{className:"font-mono",children:f}),e.jsx("span",{className:"opacity-80",children:v})]},f))}),actions:o.actionable?e.jsx(j,{size:"sm",variant:"outline",className:"h-6 text-xs",disabled:n.isPending,onClick:()=>{c(!1),n.mutate()},children:n.isPending?"Syncing…":"Sync now"}):void 0,children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("p",{children:o.message}),l>0&&e.jsxs("button",{type:"button","aria-expanded":a,onClick:()=>r(f=>!f),className:"text-3xs flex w-fit items-center gap-1 underline underline-offset-2 opacity-90 hover:opacity-100",children:["Syncing also removes ",k(l)," DorkOS put here",e.jsx(O,{"aria-hidden":!0,className:N("size-3 transition-transform",a&&"rotate-180")})]})]})})]})}function be(s){const t=S(),n=w();return A({mutationFn:a=>t.adoptHarness(s,a),meta:{errorLabel:"Couldn’t move that skill"},onSuccess:a=>{n.setQueryData(h.status(s),a.status),n.setQueriesData({queryKey:h.all,predicate:r=>{var i;return((i=r.state.data)==null?void 0:i.projectPath)===a.status.projectPath}},a.status)}})}const ke={neutral:y.neutral,info:y.info,warning:y.warning,muted:"border border-dashed border-border text-muted-foreground"};function Se({harness:s,cell:t}){var i;const n=re(s,t.state),a=ie(t),r=(i=t.warnings)!=null&&i.length?t.warnings.join(" · "):void 0;return e.jsxs("li",{"aria-label":n,...a===void 0?{}:{title:a},className:N("text-3xs inline-flex items-center gap-1 rounded-full px-2 py-0.5 leading-tight",ke[ne[t.state]]),children:[n,r!==void 0&&e.jsx("span",{role:"img","aria-label":"May not work",title:r,className:"inline-flex",children:e.jsx(q,{"aria-hidden":!0,className:"text-status-warning-fg size-2.5"})})]})}function we(s){const t=s===void 0?-1:s.lastIndexOf("/"),n=t>0?s==null?void 0:s.slice(0,t):void 0;return n===void 0?"Only some agents can see it. Move it to .agents/skills to share it.":`Lives in ${n}. Move it to .agents/skills to share it.`}function Ce(s,t){return`dorkos harness adopt ${s} --project ${t}`}const De="Share with every agent";function $e(s,t,n){const a=`It moves from ${t} to .agents/skills/${s}`;return n?`${a}. A link stays behind for Claude Code.`:`${a}, where every agent reads it.`}const Ae="for all your projects";function Oe({row:s,enabled:t,projectPath:n,showEveryHarness:a}){var v;const[r,i]=d.useState(!1),[c,u]=d.useState(!1),o=be(n),x=B(s,t),m=le(s,t)&&!a,l=m&&!r,f=(v=o.data)==null?void 0:v.refusals[0];return e.jsxs("div",{role:"group","aria-label":s.name,className:"flex flex-col gap-1 py-1.5",children:[e.jsxs("div",{className:"flex min-w-0 items-baseline gap-2",children:[e.jsx("span",{className:"min-w-0 shrink truncate text-xs font-medium",children:s.name}),s.scope==="global"&&e.jsx("span",{className:"text-muted-foreground text-3xs shrink-0",children:Ae}),s.source!==void 0&&e.jsx("span",{dir:"rtl",title:s.source,className:"text-muted-foreground text-3xs ml-auto min-w-0 truncate text-left font-mono",children:e.jsx("bdi",{dir:"ltr",children:s.source})})]}),e.jsxs("ul",{"aria-label":"Agent tools",className:"flex flex-wrap items-center gap-1",children:[m&&e.jsx("li",{children:e.jsxs("button",{type:"button","aria-expanded":!l,title:x.map(({harness:p})=>g[p]).join(" · "),onClick:()=>i(p=>!p),className:"bg-muted text-muted-foreground hover:bg-accent hover:text-accent-foreground text-3xs focus-visible:ring-ring inline-flex items-center gap-1 rounded-full px-2 py-0.5 leading-tight transition-colors focus-visible:ring-2 focus-visible:outline-none",children:[ce(x.length),e.jsx(O,{"aria-hidden":!0,className:N("size-2.5 transition-transform",l&&"-rotate-90")})]})}),!l&&x.map(({harness:p,cell:F})=>e.jsx(Se,{harness:p,cell:F},p))]}),s.adoptable&&e.jsxs(e.Fragment,{children:[e.jsx("p",{role:"status","aria-live":"polite",className:"text-muted-foreground text-3xs",children:(f==null?void 0:f.reason)||we(s.source)}),e.jsxs("p",{className:"text-muted-foreground text-3xs",children:["Run: ",e.jsx(C,{children:Ce(s.name,n)})]}),e.jsx("div",{children:e.jsx(j,{size:"sm",variant:"outline",className:"h-6 text-xs",disabled:o.isPending,onClick:()=>u(!0),children:De})}),e.jsx(K,{open:c,onOpenChange:u,children:e.jsxs(U,{children:[e.jsxs(W,{children:[e.jsxs(Q,{children:["Move ",s.name," so every agent can read it?"]}),e.jsx(G,{children:$e(s.name,s.source??"",t.includes("claude-code"))})]}),e.jsxs(J,{children:[e.jsx(Y,{children:"Cancel"}),e.jsx(X,{onClick:()=>o.mutate(s.name),children:"Move it"})]})]})})]})]})}const He=se("/guides/cli-usage#agent-files");function Ee(){return e.jsxs(e.Fragment,{children:[e.jsx("span",{role:"status",className:"sr-only",children:"Loading skills…"}),e.jsx("div",{"aria-hidden":!0,className:"flex flex-col gap-3 py-1",children:[0,1,2].map(s=>e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx($,{className:"h-3 w-32"}),e.jsx($,{className:"h-3 w-48"})]},s))})]})}function Re({projectPath:s,showBrowseLink:t=!0}){const{data:n,isPending:a,error:r,refetch:i}=D(s),[c,u]=d.useState(!1),o=d.useId(),x=H();if(a)return e.jsx(Ee,{});if(r)return e.jsxs("div",{className:"flex items-center gap-2 py-2",children:[e.jsx("p",{className:"text-destructive text-xs",children:"Couldn’t load skills."}),e.jsx(j,{variant:"ghost",size:"sm",className:"h-6 text-xs",onClick:()=>void i(),children:"Retry"})]});if(n.state!=="ready")return e.jsx(Le,{status:n});const m=n.rows.filter(l=>l.artifact==="skill");return m.length===0?e.jsxs("div",{className:"flex flex-col items-start gap-1 py-2",children:[e.jsx("p",{className:"text-muted-foreground text-xs",children:"No skills here yet."}),t&&x&&e.jsxs(j,{variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-foreground h-6 px-1 text-xs",onClick:()=>void x({...E.marketplace(),search:{type:"skill-pack"}}),children:[e.jsx(_,{"aria-hidden":!0,className:"mr-1.5 size-3.5"}),"Browse skill-packs"]})]}):e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 pb-1",children:[e.jsx(V,{htmlFor:o,className:"text-muted-foreground text-3xs",children:"Show every agent tool"}),e.jsx(Z,{id:o,size:"sm",checked:c,onCheckedChange:u})]}),e.jsx("div",{className:"divide-border divide-y",children:m.map(l=>e.jsx(Oe,{row:l,enabled:n.enabled,projectPath:n.projectPath,showEveryHarness:c},T(l)))})]})}function Le({status:s}){return s.state==="not-set-up"?e.jsxs("div",{className:"flex flex-col gap-1 py-2",children:[e.jsx("p",{className:"text-muted-foreground text-xs",children:"DorkOS isn’t sharing agent files for this folder yet."}),e.jsxs("p",{className:"text-muted-foreground text-3xs",children:["Run ",e.jsx(C,{children:"dorkos harness sync --fix"})," in this folder to set it up."]}),e.jsx(ee,{href:He,className:"text-3xs text-muted-foreground hover:text-foreground underline underline-offset-2",children:"How agent file sharing works"})]}):s.state==="unreadable"?e.jsxs("div",{className:"flex flex-col gap-1 py-2",children:[e.jsx("p",{className:"text-muted-foreground text-xs",children:"DorkOS can’t read this folder’s agent file settings."}),s.detail!==void 0&&e.jsx("p",{className:"text-muted-foreground text-3xs",children:s.detail})]}):e.jsx("p",{className:"text-muted-foreground py-2 text-xs",children:"Agent file sharing runs in the DorkOS app."})}function Pe({group:s}){const[t,n]=d.useState(!1);return e.jsxs(R,{open:t,onOpenChange:n,trigger:e.jsxs("span",{className:"text-xs",children:["Not shared with ",s.label]}),badge:e.jsx(L,{variant:"secondary",size:"xs",className:"whitespace-nowrap",children:de(s.entries.length)}),children:[e.jsx("p",{className:"text-muted-foreground text-3xs px-4 pt-3",children:ue(s.label)}),e.jsx("ul",{className:"space-y-2 px-4 pt-2 pb-3",children:s.entries.map(a=>e.jsxs("li",{className:"flex flex-col gap-0.5",children:[e.jsxs("span",{className:"text-3xs font-medium",children:[a.artifact," ",a.name]}),a.reason!==void 0&&e.jsx("span",{className:"text-muted-foreground text-3xs",children:a.reason})]},a.key))})]})}function _e({rows:s,enabled:t}){const n=fe(s,t);return n.length===0?null:e.jsx("div",{className:"flex flex-col gap-1.5",children:n.map(a=>e.jsx(Pe,{group:a},a.harness))})}function Te({entries:s}){const[t,n]=d.useState(!1);return s.length===0?null:e.jsx(R,{open:t,onOpenChange:n,trigger:e.jsx("span",{className:"text-xs",children:"Project-level notices"}),badge:e.jsx(L,{variant:"secondary",size:"xs",className:"whitespace-nowrap",children:xe(s.length)}),children:e.jsx("ul",{className:"space-y-2 px-4 pb-3",children:s.map(a=>e.jsxs("li",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:N("text-3xs font-medium",a.kind==="notice"&&"text-muted-foreground font-normal"),children:pe(a)}),e.jsx("span",{className:"text-muted-foreground text-3xs",children:a.reason})]},`${a.kind} ${a.artifact} ${a.source??""} ${a.name}`))})})}function Be({command:s}){return e.jsx(C,{className:"break-normal",children:s.split(" ").map((t,n)=>e.jsxs(d.Fragment,{children:[n>0&&" ",e.jsx("span",{className:"whitespace-nowrap",children:t})]},`${n}-${t}`))})}function Fe({notEnabled:s}){return s.length===0?null:e.jsx("div",{className:"flex flex-col gap-1.5 py-1",children:s.map(({harness:t,why:n,signal:a})=>e.jsxs("div",{title:a,className:"flex flex-col gap-0.5",children:[e.jsx("p",{className:"text-xs font-medium",children:n==="dorkos-runtime"?`DorkOS runs ${g[t]} here, but isn’t sharing to it.`:`${g[t]} files are here, but DorkOS isn’t sharing to it.`}),e.jsxs("p",{className:"text-muted-foreground text-3xs",children:["Run ",e.jsx(Be,{command:`dorkos harness sync --fix --enable ${t}`})," in this folder to turn it on."]})]},t))})}function ze({projectPath:s}){const t=H(),{data:n}=D(s),a=(n==null?void 0:n.state)==="ready"?n:null;return e.jsxs("div",{className:"flex flex-col gap-2","data-slot":"profile-skills",children:[e.jsx(ye,{projectPath:s}),a&&e.jsx(Fe,{notEnabled:a.notEnabled}),e.jsx(Re,{projectPath:s,showBrowseLink:!1}),a&&e.jsx(_e,{rows:a.rows,enabled:a.enabled}),a&&e.jsx(Te,{entries:a.projectLevel}),t&&e.jsxs(j,{variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-foreground w-full",onClick:()=>void t({...E.marketplace(),search:{type:"skill-pack"}}),children:[e.jsx(_,{"aria-hidden":!0,className:"mr-1.5 size-3.5"}),"Browse skill-packs"]})]})}function Ue({member:s}){var n;const t=((n=s.agent)==null?void 0:n.projectPath)??null;return t===null?e.jsx("p",{className:"text-muted-foreground text-sm",children:"This agent’s folder isn’t known here."}):e.jsx(ze,{projectPath:t})}export{Ue as SkillsPage};
@@ -1 +0,0 @@
1
- import{bd as I,aZ as F,r as i,aW as c,cZ as R,b0 as P,j as e,bw as O,ap as W,c_ as B,c$ as M,d0 as L,d1 as Z,d2 as z,d3 as H,d4 as _,d5 as $}from"./index-OQuvRZTD.js";import{F as q,T as G,C as S}from"./TasksEmptyState-C_3UkAbA.js";import{i as J}from"./registry-sfhDu9q2.js";import"./inline-code-SYHTKcle.js";import"./form-D93N5lrK.js";import"./command-BVQb6I3_.js";import"./AgentPicker-B7upjYRk.js";import"./AgentOptionRow-BRJfZo2y.js";import"./execution-config-CGL73sRn.js";import"./settings-for-runtime-BoOa-ZFG.js";import"./list-runtime-types-CsGil5te.js";import"./format-cron-BpGrgPLu.js";function K(){const l=I(),{data:n=[],isLoading:m}=F(l),[h,a]=i.useState(!1),[g,r]=i.useState(),[f,w]=i.useState(null),[v,u]=i.useState(null),t=c(s=>s.tasksAgentFilter),j=c(s=>s.setTasksAgentFilter),p=c(s=>s.tasksEditScheduleId),b=c(s=>s.setTasksEditScheduleId),N=t?n.filter(s=>s.agentId===t):n,E=n.some(s=>s.agentId),{data:o}=R(void 0,E),x=i.useMemo(()=>{const s=new Map;for(const d of(o==null?void 0:o.agents)??[])s.set(d.id,d);return s},[o]);i.useEffect(()=>{if(!p||m)return;const s=n.find(d=>d.id===p);s&&(r(s),a(!0)),b(null)},[p,n,m,b]);const k=i.useMemo(()=>{var s;return t?((s=x.get(t))==null?void 0:s.name)??t:null},[t,x]),{externalTrigger:y}=P();i.useEffect(()=>{y&&(r(void 0),a(!0))},[y]);const A=s=>{u(s),r(void 0),a(!0)},T=()=>{u(null),r(void 0),a(!0)},D=s=>{a(s),s||u(null)};return l?m?e.jsx("div",{className:"space-y-2 p-4",children:[1,2,3].map(s=>e.jsx("div",{className:"rounded-lg border p-3",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"bg-muted animate-breath size-2 rounded-full"}),e.jsxs("div",{className:"flex-1 space-y-1.5",children:[e.jsx("div",{className:"bg-muted animate-breath h-4 w-32 rounded"}),e.jsx("div",{className:"bg-muted animate-breath h-3 w-48 rounded"})]})]})},s))}):N.length===0?e.jsxs(e.Fragment,{children:[t?e.jsxs("div",{className:"flex flex-col items-center gap-3 p-8",children:[e.jsx(C,{name:k,onClear:()=>j(null)}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"No schedules for this agent."}),e.jsx("button",{onClick:T,className:"border-input hover:bg-accent hover:text-accent-foreground inline-flex items-center rounded-md border bg-transparent px-3 py-1.5 text-sm font-medium shadow-xs transition-colors",children:"New schedule"})]}):e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-6 pt-6",children:e.jsx(G,{onCreateWithPreset:A,onCreateBlank:T})}),e.jsx(S,{open:h,onOpenChange:D,editTask:g,initialPreset:v,initialAgentId:t??void 0})]}):e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[e.jsx("div",{className:"space-y-2 p-4",children:e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:"text-muted-foreground text-sm font-medium",children:"Schedules"}),t&&e.jsx(C,{name:k,onClear:()=>j(null)})]}),e.jsx("button",{onClick:()=>{r(void 0),a(!0)},className:"border-input hover:bg-accent hover:text-accent-foreground inline-flex items-center rounded-md border bg-transparent px-3 py-1.5 text-sm font-medium shadow-xs transition-colors",children:"New schedule"})]})}),e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-4 pb-4",children:e.jsx(O,{initial:!1,children:N.map(s=>e.jsx(W.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8},transition:{duration:.2,ease:[0,0,.2,1]},className:"mb-2",children:e.jsx(B,{task:s,agent:s.agentId?x.get(s.agentId)??null:null,expanded:f===s.id,onToggleExpand:()=>w(f===s.id?null:s.id),onEdit:()=>{r(s),a(!0)}})},s.id))})}),e.jsx(S,{open:h,onOpenChange:a,editTask:g,initialPreset:v,initialAgentId:t??void 0})]}):e.jsx(q,{icon:J.tasks,name:"Scheduling",description:"Scheduled tasks let your agents work on a timer, even when you’re not here.",command:"dorkos --tasks"})}function C({name:l,onClear:n}){return e.jsx(M,{onRemove:n,removeLabel:"Clear agent filter",children:l??"Agent"})}function re({open:l,onOpenChange:n}){return e.jsx(L,{open:l,onOpenChange:n,children:e.jsxs(Z,{className:"h-[85vh] max-w-2xl gap-0 p-0",children:[e.jsx(z,{}),e.jsxs(H,{className:"border-b px-4 py-3",children:[e.jsx(_,{className:"text-sm font-medium",children:"Scheduled tasks"}),e.jsx($,{className:"sr-only",children:"See and change your scheduled tasks"})]}),e.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:e.jsx(K,{})})]})})}export{re as TasksDialogWrapper};
@@ -1,3 +0,0 @@
1
- import{j as e,ij as Ve,G as V,r as m,e3 as Be,$ as fe,I as We,eg as q,eh as U,ei as G,ej as K,ek as L,bw as le,ap as ce,ik as de,il as ue,fu as Re,aj as qe,J as me,en as R,e as ge,ag as Ue,ah as Ge,ai as Ke,im as Ye,a1 as He,e9 as xe,a2 as Qe,io as Xe,ee as ne,ef as Ze,ip as Je,a0 as et,iq as Ee,ir as Oe,is as tt,B as Z,it as st,gX as je,_ as ve,gW as nt,gY as rt,gV as at,dN as ot,fh as it,iu as lt,iv as ct,bY as dt,aL as ut,y as mt,g_ as ht,g$ as ft,aZ as xt,b0 as pt,d0 as gt,d1 as jt,d3 as vt,e6 as bt,d4 as yt,d5 as Nt,gQ as wt,fi as Ct,fj as St,fk as kt,fl as Rt,fm as Et,fn as Ot}from"./index-OQuvRZTD.js";import{I as Mt}from"./inline-code-SYHTKcle.js";import{a as Ft,u as At}from"./form-D93N5lrK.js";import{C as Dt,a as $t,b as Lt,c as It,d as be,e as he}from"./command-BVQb6I3_.js";import{A as zt}from"./AgentPicker-B7upjYRk.js";import{d as Tt,k as _t,e as ye}from"./execution-config-CGL73sRn.js";import{s as Pt}from"./settings-for-runtime-BoOa-ZFG.js";import{l as Vt}from"./list-runtime-types-CsGil5te.js";import{f as Bt,u as Wt}from"./format-cron-BpGrgPLu.js";function Cs({icon:t,name:n,description:s,command:o,commandHint:a="Restart DorkOS from your terminal with:",className:l,...c}){return e.jsxs("div",{"data-slot":"feature-disabled-state",className:V("flex flex-col items-center justify-center gap-3 p-8 text-center",l),...c,children:[e.jsx(t,{className:"text-muted-foreground/50 size-8"}),e.jsxs("div",{children:[e.jsxs("p",{className:"font-medium",children:[n," is off"]}),e.jsx("p",{className:"text-muted-foreground mt-1 text-sm",children:s})]}),e.jsx("p",{className:"text-muted-foreground mt-1 text-xs",children:a}),e.jsxs("div",{className:"flex max-w-full items-center gap-1.5",children:[e.jsx(Mt,{className:"min-w-0 px-3 py-1.5 text-sm break-all",children:o}),e.jsx(Ve,{value:o,label:`Copy the command for ${n}`})]})]})}const z=(t,n=o=>o,s)=>Ft(t,n,{compare:s});function qt(){const[t,n]=m.useState({x:0,y:0}),[s,o]=m.useState(!1),a=Be(),l=typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(hover: none)").matches,c=a||l,d=m.useCallback(x=>{if(c)return;const j=x.currentTarget.getBoundingClientRect();n({x:x.clientX-j.left,y:x.clientY-j.top}),o(!0)},[c]),h=m.useCallback(()=>{o(!1)},[]),v=!c&&s?{background:`radial-gradient(350px circle at ${t.x}px ${t.y}px, rgba(59,130,246,0.06), transparent 80%)`}:void 0;return{position:t,isActive:s,onMouseMove:d,onMouseLeave:h,spotlightStyle:v}}function Ut({preset:t,variant:n,checked:s,onCheckedChange:o,onSelect:a,selected:l=!1,className:c}){const{onMouseMove:d,onMouseLeave:h,spotlightStyle:v}=qt(),x=()=>{n==="toggle"?o==null||o(!s):a==null||a(t)};return e.jsxs("button",{type:"button",onClick:x,onMouseMove:d,onMouseLeave:h,"aria-label":`${t.name}: ${t.description}`,className:V("relative flex w-full items-start gap-4 rounded-lg border p-4 text-left transition","hover:bg-accent/50 focus-ring","min-h-11",n==="toggle"&&s&&"border-primary/40 bg-accent/30",n==="selectable"&&l&&"border-primary ring-primary bg-accent/30 ring-1",c),children:[v&&e.jsx("div",{className:"pointer-events-none absolute inset-0 rounded-lg",style:v}),n==="toggle"&&e.jsx("div",{className:"flex size-11 shrink-0 items-center justify-center",children:e.jsx(fe,{checked:s??!1,onCheckedChange:o,"aria-label":`Enable ${t.name}`,onClick:j=>j.stopPropagation()})}),e.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[e.jsx("div",{className:"font-medium",children:t.name}),e.jsx("p",{className:"text-muted-foreground text-sm",children:t.description}),e.jsx("p",{"aria-hidden":"true",className:"text-muted-foreground text-xs",children:Bt(t.cron)}),e.jsx("p",{"aria-hidden":"true",className:"text-muted-foreground/80 line-clamp-2 text-sm",children:t.prompt})]})]})}function Me({onSelect:t,selectedId:n,className:s}){const{data:o,isLoading:a,isError:l}=Wt();return a?e.jsx("div",{className:V("grid grid-cols-2 gap-3",s),children:[0,1,2,3].map(c=>e.jsx("div",{className:"bg-muted animate-breath h-28 rounded-lg border"},c))}):l?e.jsx("p",{className:"text-destructive text-sm",children:"Couldn’t load ready-made tasks. Start from scratch instead."}):!o||o.length===0?e.jsx("p",{className:"text-muted-foreground text-sm",children:"No ready-made tasks yet."}):e.jsx("div",{className:V("grid grid-cols-2 gap-3",s),children:o.map(c=>e.jsx(Ut,{preset:c,variant:"selectable",selected:c.id===n,onSelect:t},c.id))})}const W={frequency:"daily",hour:9,days:[1,2,3,4,5],dayOfMonth:1},Gt=[{value:"15m",label:"Every 15 minutes"},{value:"hourly",label:"Every hour"},{value:"daily",label:"Every day"},{value:"weekly",label:"Every week"},{value:"monthly",label:"Every month"}],Kt=[{value:1,label:"Mon"},{value:2,label:"Tue"},{value:3,label:"Wed"},{value:4,label:"Thu"},{value:5,label:"Fri"},{value:6,label:"Sat"},{value:0,label:"Sun"}],Yt=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Ht=[1,2,3,4,5],Qt=[0,6];function Ne(t){const n=t.trim();if(!n)return null;const s=n.split(/\s+/);if(s.length!==5)return null;const[o,a,l,c,d]=s;if(c!=="*")return null;if(o==="*/15"&&a==="*"&&l==="*"&&d==="*")return{...W,frequency:"15m"};if(o!=="0")return null;if(a==="*"&&l==="*"&&d==="*")return{...W,frequency:"hourly"};const h=Number(a);if(!Number.isInteger(h)||h<0||h>23)return null;if(l!=="*"&&d==="*"){const v=Number(l);return!Number.isInteger(v)||v<1||v>31?null:{...W,frequency:"monthly",hour:h,dayOfMonth:v}}if(l==="*"&&d==="*")return{...W,frequency:"daily",hour:h};if(l==="*"&&d!=="*"){const v=Xt(d);return v?{...W,frequency:"weekly",hour:h,days:v}:null}return null}function Xt(t){const n=[];for(const s of t.split(",")){const o=s.match(/^(\d)-(\d)$/);if(o){const a=Number(o[1]),l=Number(o[2]);if(a>6||l>6||a>l)return null;for(let c=a;c<=l;c++)n.push(c)}else{const a=Number(s);if(!Number.isInteger(a)||a<0||a>6)return null;n.push(a)}}return n.length>0?n.sort((s,o)=>s-o):null}function we(t){switch(t.frequency){case"15m":return"*/15 * * * *";case"hourly":return"0 * * * *";case"daily":return`0 ${t.hour} * * *`;case"weekly":return`0 ${t.hour} * * ${t.days.join(",")}`;case"monthly":return`0 ${t.hour} ${t.dayOfMonth} * *`}}function Fe(t){const n=t<12?"AM":"PM";return`${t%12||12}:00 ${n}`}function Ae(t){const n=t%100;if(n>=11&&n<=13)return`${t}th`;const s=t%10;return s===1?`${t}st`:s===2?`${t}nd`:s===3?`${t}rd`:`${t}th`}function Ce(t,n){return t.length===n.length&&t.every((s,o)=>s===n[o])}function Zt(t){const n=Fe(t.hour);switch(t.frequency){case"15m":return"Runs every 15 minutes";case"hourly":return"Runs every hour, on the hour";case"daily":return`Runs every day at ${n}`;case"weekly":{const s=[...t.days].sort((c,d)=>c-d);if(Ce(s,Ht))return`Runs every weekday at ${n}`;if(Ce(s,Qt))return`Runs every Saturday and Sunday at ${n}`;const a=s.filter(c=>c!==0).concat(s.includes(0)?[0]:[]).map(c=>Yt[c]);if(a.length===1)return`Runs every ${a[0]} at ${n}`;if(a.length===2)return`Runs every ${a[0]} and ${a[1]} at ${n}`;const l=a.pop();return`Runs every ${a.join(", ")}, and ${l} at ${n}`}case"monthly":return`Runs on the ${Ae(t.dayOfMonth)} of every month at ${n}`}}const Jt="Can’t read this timing. Check the format.";function oe(t){const n=t.trim();if(!n)return!0;try{return Re.toString(n),!0}catch{return!1}}function es(t){const n=t.trim();return n?oe(n)?Re.toString(n):Jt:""}function ts({value:t,onChange:n}){const s=Ne(t),[o,a]=m.useState(s?"simple":t.trim()?"cron":"simple"),[l,c]=m.useState(s??W),d=m.useRef(t);m.useEffect(()=>{if(t===d.current)return;d.current=t;const i=Ne(t);i?(a("simple"),c(i)):t.trim()&&a("cron")},[t]);function h(i){c(i);const g=we(i);d.current=g,n(g)}function v(i){h({...l,frequency:i})}function x(i){h({...l,hour:Number(i)})}function j(i){const g=l.days.includes(i);if(g&&l.days.length<=1)return;const w=g?l.days.filter(S=>S!==i):[...l.days,i].sort((S,N)=>S-N);h({...l,days:w})}function p(i){h({...l,dayOfMonth:Number(i)})}function k(){a("cron")}function C(){a("simple");const i=we(l);d.current=i,n(i)}const u=l.frequency!=="15m"&&l.frequency!=="hourly";return o==="cron"?e.jsxs("div",{className:"space-y-2",children:[e.jsx("button",{type:"button",onClick:C,className:"text-muted-foreground hover:text-foreground text-xs underline-offset-4 hover:underline",children:"Back to simple schedule"}),e.jsx(We,{className:"font-mono",value:t,onChange:i=>n(i.target.value),placeholder:"0 9 * * 1-5"}),t.trim()&&e.jsx("p",{className:V("text-xs",oe(t)?"text-muted-foreground":"text-destructive"),children:es(t)}),e.jsx("a",{href:"https://crontab.guru",target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground block text-xs hover:underline",children:"Learn about cron expressions"})]}):e.jsxs("div",{className:"space-y-3",children:[e.jsxs(q,{value:l.frequency,onValueChange:v,children:[e.jsx(U,{"aria-label":"Frequency",children:e.jsx(G,{})}),e.jsx(K,{children:Gt.map(i=>e.jsx(L,{value:i.value,children:i.label},i.value))})]}),e.jsx(le,{initial:!1,mode:"wait",children:u&&e.jsx(ce.div,{variants:ue,initial:"initial",animate:"animate",exit:"exit",transition:de,className:"overflow-hidden",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-muted-foreground text-sm",children:"at"}),e.jsxs(q,{value:String(l.hour),onValueChange:x,children:[e.jsx(U,{className:"w-32","aria-label":"Time",children:e.jsx(G,{})}),e.jsx(K,{children:Array.from({length:24},(i,g)=>e.jsx(L,{value:String(g),children:Fe(g)},g))})]})]})},"time")}),e.jsx(le,{initial:!1,children:l.frequency==="weekly"&&e.jsx(ce.div,{variants:ue,initial:"initial",animate:"animate",exit:"exit",transition:de,className:"overflow-hidden",children:e.jsx("div",{className:"flex flex-wrap gap-1.5",children:Kt.map(i=>{const g=l.days.includes(i.value);return e.jsx("button",{type:"button","aria-label":i.label,"aria-pressed":g,className:V("inline-flex min-h-11 items-center justify-center rounded-md border px-2.5 py-1 text-xs font-medium transition-colors md:min-h-0",g?"border-primary bg-primary/10 text-primary":"border-input text-muted-foreground hover:bg-accent hover:text-accent-foreground"),onClick:()=>j(i.value),children:i.label},i.value)})})},"days")}),e.jsx(le,{initial:!1,children:l.frequency==="monthly"&&e.jsx(ce.div,{variants:ue,initial:"initial",animate:"animate",exit:"exit",transition:de,className:"overflow-hidden",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-muted-foreground text-sm",children:"on day"}),e.jsxs(q,{value:String(l.dayOfMonth),onValueChange:p,children:[e.jsx(U,{className:"w-20","aria-label":"Day of month",children:e.jsx(G,{})}),e.jsx(K,{children:Array.from({length:31},(i,g)=>e.jsx(L,{value:String(g+1),children:Ae(g+1)},g+1))})]})]})},"dom")}),e.jsx("p",{className:"text-muted-foreground text-xs",children:Zt(l)}),e.jsx("button",{type:"button",onClick:k,className:"text-muted-foreground hover:text-foreground text-xs underline-offset-4 hover:underline",children:"Use a cron expression"})]})}function ss(t){const n=new Map;for(const s of t){const[o]=s.split("/");n.has(o)||n.set(o,[]),n.get(o).push(s)}return n}function ns({value:t,onChange:n}){const[s,o]=m.useState(!1),a=m.useRef(null),l=m.useMemo(()=>{try{return Intl.supportedValuesOf("timeZone")}catch{return[]}},[]),c=m.useMemo(()=>ss(l),[l]),d=m.useMemo(()=>Intl.DateTimeFormat().resolvedOptions().timeZone,[]);m.useEffect(()=>{if(!s)return;function x(j){a.current&&!a.current.contains(j.target)&&o(!1)}return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[s]);const h=t||"System default";function v(x){n(x),o(!1)}return e.jsxs("div",{ref:a,className:"relative w-full",children:[e.jsxs("button",{type:"button","aria-expanded":s,"aria-haspopup":"listbox",className:V("border-input ring-offset-background flex h-9 w-full items-center justify-between rounded-md border bg-transparent px-3 py-2 text-sm shadow-xs transition-colors","focus-visible:ring-ring focus-visible:ring-1 focus-visible:outline-none","hover:bg-accent/50"),onClick:()=>o(x=>!x),children:[e.jsx("span",{className:"truncate",children:h}),e.jsx(qe,{className:"ml-2 size-4 shrink-0 opacity-50"})]}),s&&e.jsx("div",{className:"bg-popover text-popover-foreground absolute top-full left-0 z-50 mt-1 w-full rounded-md border shadow-md",children:e.jsxs(Dt,{children:[e.jsx($t,{placeholder:"Search timezone…"}),e.jsxs(Lt,{className:"max-h-60",children:[e.jsx(It,{children:"No timezone found."}),e.jsxs(be,{heading:"Default",children:[e.jsxs(he,{value:"system-default",onSelect:()=>v(""),children:[e.jsx("span",{children:"System default"}),t===""&&e.jsx(me,{className:"ml-auto size-4"})]}),d&&e.jsxs(he,{value:`${d}-detected`,onSelect:()=>v(d),children:[e.jsxs("span",{children:[d," (detected)"]}),t===d&&e.jsx(me,{className:"ml-auto size-4"})]})]}),[...c.entries()].map(([x,j])=>e.jsx(be,{heading:x,children:j.map(p=>e.jsxs(he,{value:p,onSelect:()=>v(p),children:[e.jsx("span",{children:p.replace(`${x}/`,"").replace(/_/g," ")}),p===t&&e.jsx(me,{className:"ml-auto size-4"})]},p))},x))]})]})})]})}function rs({roster:t,value:n}){const s="flex h-9 w-full items-center gap-2 text-sm";if(!n)return e.jsx("p",{"data-testid":"settled-agent",className:`${s} text-muted-foreground`,children:"No agent"});if(t.unreadable)return e.jsx("p",{"data-testid":"settled-agent",className:`${s} text-muted-foreground`,children:"Couldn’t load your agents to show this one."});if(!t.answered)return e.jsxs("div",{"data-testid":"settled-agent-loading",className:s,"aria-hidden":!0,children:[e.jsx(ge,{className:"size-5 rounded-full"}),e.jsx(ge,{className:"h-4 w-32"})]});const o=t.agents.find(l=>l.id===n);if(!o)return e.jsx("p",{"data-testid":"settled-agent",className:`${s} text-muted-foreground`,children:"This agent isn’t registered any more."});const a=Ue(o);return e.jsxs("p",{"data-testid":"settled-agent",className:s,children:[e.jsx(Ge,{color:a.color,emoji:a.emoji,size:"xs"}),e.jsx("span",{className:"truncate",children:Ke(o)})]})}function as({roster:t,value:n,locked:s,onChange:o}){return e.jsxs("div",{className:"space-y-2",children:[e.jsx(R,{children:"Agent"}),s?e.jsxs(e.Fragment,{children:[e.jsx(rs,{roster:t,value:n}),e.jsx("p",{"data-testid":"agent-locked-note",className:"text-muted-foreground text-xs leading-relaxed",children:"The agent is set once. For another agent, make a new task."})]}):e.jsx(zt,{agents:t.agents,value:n||void 0,onValueChange:a=>o(a??"")})]})}function De(t,n){var c,d;const s=t.map(h=>h.projectPath).join(`
2
- `),o=m.useMemo(()=>s?s.split(`
3
- `):[],[s]),{data:a}=Ye(o),l=n?(c=t.find(h=>h.id===n))==null?void 0:c.projectPath:void 0;return l?((d=a==null?void 0:a[l])==null?void 0:d.runtime)??null:null}const $="__inherit__";function os(t){var _;const{runtime:n,model:s,effort:o,agentRuntime:a}=t,l=He(),{data:c}=xe(),d=c?Object.keys(c.capabilities):void 0,h=(c==null?void 0:c.defaultRuntime)??null,x=(b=>b!==null&&d!==void 0&&d.includes(b))(a),j=x?a:h,p=n||j,k=p??void 0,C=k!==void 0&&d!==void 0&&d.includes(k),{data:u}=Qe({...Xe(l,k?{runtime:k}:{}),enabled:C,retry:!1}),i=s?u==null?void 0:u.find(b=>b.value===s):void 0,g=(_=Pt(c,p))==null?void 0:_.supportsEffort,w=p?Tt({agent:{runtime:p,model:s||null,effort:o||null},defaultRuntime:p,knownRuntimes:d,knownModels:_t(u),modelSupportsEffort:i?i.supportsEffort??!1:void 0,runtimeSupportsEffort:g,runtimeLabel:b=>ne(b).label}):null,S=b=>{var y;return((y=w==null?void 0:w.breakages.find(M=>b.includes(M.kind)))==null?void 0:y.message)??null},N=d==null?void 0:d.join(","),T=m.useMemo(()=>{const b=N===void 0?[]:N.split(",").filter(Boolean),y=Vt(b).filter(M=>b.includes(M));return n&&!y.includes(n)&&y.push(n),y.map(M=>({value:M,label:ne(M).label}))},[N,n]),A=m.useMemo(()=>{const b=(u??[]).map(y=>({value:y.value,label:y.displayName}));return s&&!b.some(y=>y.value===s)&&b.push({value:s,label:s}),b},[u,s]),Y=m.useMemo(()=>{const b=Ze.filter(y=>!(i!=null&&i.supportedEffortLevels)||i.supportedEffortLevels.includes(y)).map(y=>({value:y,label:ye(y)}));return o&&!b.some(y=>y.value===o)&&b.push({value:o,label:ye(o)}),b},[i,o]),D=j===null?"Same as agent":x?`Same as agent (${ne(j).label})`:`Server default (${ne(j).label})`;return{effectiveRuntime:p,runtimeOptions:T,inheritRuntimeLabel:D,modelOptions:A,supportsEffort:g===!0,effortOptions:Y,runtimeWarning:S(["runtime-not-connected"]),modelWarning:S(["model-unavailable"]),effortWarning:S(["effort-unsupported-runtime","effort-unsupported-model"])}}const re="text-xs text-status-warning-fg";function is({runtime:t,model:n,effort:s,execution:o,onRuntimeChange:a,onModelChange:l,onEffortChange:c}){const{runtimeOptions:d,inheritRuntimeLabel:h,modelOptions:v,supportsEffort:x,effortOptions:j,runtimeWarning:p,modelWarning:k,effortWarning:C}=o;return e.jsxs("fieldset",{className:"space-y-3",children:[e.jsx("legend",{className:"mb-1.5 text-sm font-medium",children:"Runs on"}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(R,{htmlFor:"schedule-runtime",children:"Runs on"}),e.jsxs(q,{value:t||$,onValueChange:u=>a(u===$?"":u),children:[e.jsx(U,{id:"schedule-runtime",responsive:!1,className:"text-sm","data-testid":"task-runtime-select",children:e.jsx(G,{})}),e.jsxs(K,{children:[e.jsx(L,{value:$,children:h}),d.map(u=>e.jsx(L,{value:u.value,children:u.label},u.value))]})]}),p&&e.jsx("p",{"data-testid":"task-runtime-warning",className:re,children:p})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(R,{htmlFor:"schedule-model",children:"Model"}),e.jsxs(q,{value:n||$,onValueChange:u=>l(u===$?"":u),children:[e.jsx(U,{id:"schedule-model",responsive:!1,className:"text-sm","data-testid":"task-model-select",children:e.jsx(G,{})}),e.jsxs(K,{children:[e.jsx(L,{value:$,children:"Agent default"}),v.map(u=>e.jsx(L,{value:u.value,children:u.label},u.value))]})]}),k&&e.jsx("p",{"data-testid":"task-model-warning",className:re,children:k})]}),x?e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(R,{htmlFor:"schedule-effort",children:"Effort"}),e.jsxs(q,{value:s||$,onValueChange:u=>c(u===$?"":u),children:[e.jsx(U,{id:"schedule-effort",responsive:!1,className:"text-sm","data-testid":"task-effort-select",children:e.jsx(G,{})}),e.jsxs(K,{children:[e.jsx(L,{value:$,children:"Agent default"}),j.map(u=>e.jsx(L,{value:u.value,children:u.label},u.value))]})]}),C&&e.jsx("p",{"data-testid":"task-effort-warning",className:re,children:C})]}):s&&e.jsxs("div",{className:"space-y-1.5","data-testid":"task-effort-stranded",children:[e.jsx(R,{children:"Effort"}),e.jsx("p",{className:re,children:C??"No effort setting here, so this does nothing."}),e.jsx("button",{type:"button",onClick:()=>c(""),className:"focus-ring text-status-warning-fg rounded-sm text-xs underline-offset-2 hover:underline","data-testid":"task-effort-clear",children:"Clear it"})]})]})}function ls(t){return t.asks!=="never"&&t.id!==Je}function cs(){return e.jsxs("div",{role:"note","data-testid":"task-unattended-warning",className:"bg-status-warning-bg border-status-warning-border text-status-warning-fg flex gap-2 rounded-md border px-2.5 py-2 text-xs leading-relaxed",children:[e.jsx(et,{className:"mt-0.5 size-5 shrink-0 sm:size-3.5","aria-hidden":!0}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"font-medium",children:"Nobody is there to approve asks on a scheduled run."}),e.jsx("p",{children:"Each ask is refused, so the run will need attention."}),e.jsx("p",{children:"Use Never ask with an allow list for the commands it needs."}),e.jsx("p",{children:"“Run now” still asks you."})]})]})}const ae="10m";function ds(t){return`${Math.round(t/6e4)}m`}function P(t,n,s,o="acceptEdits"){return t?{name:t.name,description:t.description??"",prompt:t.prompt,cron:t.cron??"",agentId:t.agentId??"",timezone:t.timezone??"",permissionMode:t.permissionMode,maxRuntime:t.maxRuntime?ds(t.maxRuntime):ae,sticky:t.sticky,runtime:t.runtime??"",model:t.model??"",effort:t.effort??""}:n?{name:n.name,description:n.description,prompt:n.prompt,cron:n.cron,agentId:s??"",timezone:n.timezone??"",permissionMode:o,maxRuntime:ae,sticky:!1,runtime:"",model:"",effort:""}:{name:"",description:"",prompt:"",cron:"",agentId:s??"",timezone:"",permissionMode:o,maxRuntime:ae,sticky:!1,runtime:"",model:"",effort:""}}function Se(t){const n=t.cron.trim();return{name:t.name.trim(),description:t.description.trim(),prompt:t.prompt.trim(),cron:n||null,...n&&t.timezone?{timezone:t.timezone}:{},permissionMode:t.permissionMode,maxRuntime:t.maxRuntime.trim()||void 0,sticky:t.sticky,runtime:t.runtime||null,model:t.model||null,effort:t.effort||null}}function us(t,n){const s=Se(t),o=Se(n);return Object.fromEntries(Object.entries(o).filter(([a,l])=>l!==s[a]))}const $e=100;function ms(t,n=[]){const s=new Set([...n].map(a=>a.toLowerCase())),o=t.name.trim();for(let a=1;;a++){const l=a===1?"-copy":`-copy-${a}`,c=`${o.slice(0,$e-l.length)}${l}`;if(!s.has(c.toLowerCase()))return{...t,name:c}}}const hs={record:["This schedule came with a package. Only the package can change what it does.","You can still turn it on or off, or change when it runs."],legacy:["This schedule came with a package from an older DorkOS.","DorkOS can’t yet tell its files from yours.","You can still turn it on or off, or change when it runs.","To edit the rest, choose Check files on its package in Marketplace › Installed."]};function ke(t){var s;const n=t;return(n==null?void 0:n.code)!==lt?null:{message:n.message,ownedBy:((s=n.body)==null?void 0:s.ownedBy)==="legacy"?"legacy":"record"}}function fs({defaultValues:t,roster:n,editTask:s,onSubmitSuccess:o,onCancel:a,onDeleteClick:l,isPending:c,onMakeCopy:d,leading:h}){var ee,te;const v=Ee(),x=m.useRef(!0);m.useEffect(()=>(x.current=!0,()=>{x.current=!1}),[]);const j=Oe({isShownInline:r=>x.current&&ke(r)!==null}),p=s?ke(j.error):null,k=(s==null?void 0:s.packageOwned)??null,C=k??(p==null?void 0:p.ownedBy)??null,u=k!==null,i=At({defaultValues:t,onSubmit:({value:r})=>{const f=r.agentId.trim()||void 0,F=r.cron.trim();if(s){const O=us(t,r);if(Object.keys(O).length===0){o();return}j.mutate({id:s.id,...O},{onSuccess:o})}else{const O=f??"global",se={name:r.name.trim(),description:r.description.trim()||r.name.trim(),prompt:r.prompt.trim(),target:O,cron:F||void 0,...F&&r.timezone?{timezone:r.timezone}:{},permissionMode:r.permissionMode,maxRuntime:r.maxRuntime.trim()||void 0,...r.sticky?{sticky:!0}:{},...r.runtime?{runtime:r.runtime}:{},...r.model?{model:r.model}:{},...r.effort?{effort:r.effort}:{}};v.mutate(se,{onSuccess:o})}}}),g=z(i.store,r=>r.values.agentId),w=z(i.store,r=>r.values.runtime),S=z(i.store,r=>r.values.model),N=z(i.store,r=>r.values.effort),T=z(i.store,r=>r.values.permissionMode),A=z(i.store,r=>r.values.cron),[Y,D]=m.useState(!!t.cron),[_,b]=m.useState(!1),y=z(i.store,r=>r.values.maxRuntime),M=z(i.store,r=>r.values.sticky),I=[w!=="",S!=="",N!=="",y!==ae,M,tt(T)].filter(Boolean).length,J=De(n.agents,g),B=os({runtime:w,model:S,effort:N,agentRuntime:J}),{data:H}=xe(),Q=(B.effectiveRuntime?(te=(ee=H==null?void 0:H.capabilities[B.effectiveRuntime])==null?void 0:ee.permissionModes)==null?void 0:te.values:void 0)??[];return e.jsxs(i.AppForm,{children:[e.jsx("form",{onSubmit:r=>{r.preventDefault(),i.handleSubmit()},id:"schedule-form",className:"min-h-0 flex-1 overflow-y-auto",children:e.jsxs("div",{className:"space-y-5 px-4 py-5",children:[C!==null&&e.jsxs("div",{role:"status","data-slot":"package-owned-notice",className:"bg-muted/40 space-y-2 rounded-md border px-3 py-2 text-xs",children:[p?e.jsx("p",{children:p.message}):hs[C].map(r=>e.jsx("p",{children:r},r)),C==="record"&&d&&e.jsxs(Z,{type:"button",variant:"outline",size:"xs",onClick:()=>d(i.state.values),children:[e.jsx(st,{}),"Make a copy"]})]}),h,e.jsx(as,{roster:n,value:g,locked:s!==void 0,onChange:r=>i.setFieldValue("agentId",r)}),e.jsxs("fieldset",{disabled:u,className:"min-w-0 space-y-5",children:[e.jsx(i.AppField,{name:"name",children:r=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(R,{htmlFor:"schedule-name",children:"Name *"}),e.jsx("input",{id:"schedule-name",className:"border-input focus-visible:ring-ring disabled:bg-muted/40 w-full rounded-md border bg-transparent px-3 py-2 text-sm shadow-xs focus-visible:ring-1 focus-visible:outline-none disabled:cursor-default",value:r.state.value,onChange:f=>r.handleChange(f.target.value),onBlur:r.handleBlur,maxLength:$e,placeholder:"Daily code review"}),r.state.meta.isTouched&&r.state.meta.errors.length>0&&e.jsx("p",{className:"text-destructive text-xs",children:String(r.state.meta.errors[0])})]})}),e.jsx(i.AppField,{name:"description",children:r=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(R,{htmlFor:"schedule-description",children:"Description *"}),e.jsx("input",{id:"schedule-description",className:"border-input focus-visible:ring-ring disabled:bg-muted/40 w-full rounded-md border bg-transparent px-3 py-2 text-sm shadow-xs focus-visible:ring-1 focus-visible:outline-none disabled:cursor-default",value:r.state.value,onChange:f=>r.handleChange(f.target.value),onBlur:r.handleBlur,placeholder:"A short description of this schedule"}),r.state.meta.isTouched&&r.state.meta.errors.length>0&&e.jsx("p",{className:"text-destructive text-xs",children:String(r.state.meta.errors[0])})]})}),e.jsx(i.AppField,{name:"prompt",children:r=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(R,{htmlFor:"schedule-prompt",children:"Prompt *"}),e.jsx("textarea",{id:"schedule-prompt",className:"border-input focus-visible:ring-ring disabled:bg-muted/40 w-full rounded-md border bg-transparent px-3 py-2 text-sm shadow-xs focus-visible:ring-1 focus-visible:outline-none disabled:cursor-default",value:r.state.value,onChange:f=>r.handleChange(f.target.value),onBlur:r.handleBlur,rows:4,placeholder:"Review all pending PRs and summarize findings…"}),r.state.meta.isTouched&&r.state.meta.errors.length>0&&e.jsx("p",{className:"text-destructive text-xs",children:String(r.state.meta.errors[0])})]})})]}),e.jsx(je,{open:Y,onOpenChange:D,trigger:"Schedule",badge:e.jsx(ve,{variant:"secondary",className:"text-xs",children:A?"On a schedule":"Optional"}),children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(i.AppField,{name:"cron",children:r=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(R,{children:"When it runs"}),e.jsx(ts,{value:r.state.value,onChange:f=>r.handleChange(f)})]})}),e.jsx(i.AppField,{name:"timezone",children:r=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(R,{children:"Timezone"}),e.jsx(ns,{value:r.state.value,onChange:f=>r.handleChange(f)})]})})]})}),e.jsx(i.Subscribe,{selector:r=>!oe(r.values.cron),children:r=>r?e.jsx("p",{role:"alert","data-testid":"cron-blocks-save",className:"text-destructive text-xs",children:"Fix the timing under Schedule before saving."}):null}),e.jsx(je,{open:_,onOpenChange:b,trigger:"Advanced settings",badge:I>0?e.jsxs(ve,{variant:"secondary",className:"text-xs",children:[I," changed"]}):void 0,children:e.jsxs("fieldset",{disabled:u,className:"min-w-0 space-y-4",children:[e.jsx(is,{runtime:w,model:S,effort:N,execution:B,onRuntimeChange:r=>i.setFieldValue("runtime",r),onModelChange:r=>i.setFieldValue("model",r),onEffortChange:r=>i.setFieldValue("effort",r)}),e.jsx(i.AppField,{name:"permissionMode",children:r=>{const f=Q.find(O=>O.id===r.state.value),F=(f==null?void 0:f.label)??nt(r.state.value);return Q.length===0?e.jsxs("fieldset",{className:"space-y-2",children:[e.jsx("legend",{className:"mb-1.5 text-sm font-medium",children:"Permissions"}),e.jsxs("p",{"data-testid":"trust-dial-unavailable",className:"text-muted-foreground px-1 text-xs leading-relaxed",children:["Set to “",F,"”. No other options to choose yet. Saving keeps it."]})]}):e.jsxs("fieldset",{className:"space-y-2",children:[e.jsx("legend",{className:"mb-1.5 text-sm font-medium",children:"Permissions"}),e.jsx(rt,{mode:r.state.value,descriptors:Q,onChangeMode:O=>r.handleChange(O),strandsWorkingMode:!0,strandedNote:e.jsxs(e.Fragment,{children:["Set to “",F,"”, which isn’t listed. Saving keeps it. Pick a stop to change it."]})}),f!==void 0&&ls(f)&&e.jsx(cs,{}),e.jsx(at,{mode:r.state.value,...f?{descriptor:f}:{},className:"px-1"})]})}}),e.jsx(i.AppField,{name:"maxRuntime",children:r=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(R,{htmlFor:"schedule-max-runtime",children:"Stop after"}),e.jsx("p",{className:"text-muted-foreground text-xs leading-relaxed",children:"Ends the run if it takes longer."}),e.jsx("input",{id:"schedule-max-runtime",className:"border-input focus-visible:ring-ring disabled:bg-muted/40 w-24 rounded-md border bg-transparent px-3 py-2 text-sm shadow-xs focus-visible:ring-1 focus-visible:outline-none disabled:cursor-default",value:r.state.value,onChange:f=>r.handleChange(f.target.value),onBlur:r.handleBlur,placeholder:"10m"})]})}),e.jsx(i.AppField,{name:"sticky",children:r=>e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(R,{htmlFor:"schedule-sticky",children:"Remember the last run"}),e.jsx("p",{className:"text-muted-foreground text-xs leading-relaxed",children:"Pick up where the last run left off. Off starts fresh each time."})]}),e.jsx(fe,{id:"schedule-sticky",checked:r.state.value,onCheckedChange:f=>r.handleChange(f)})]})})]})})]})}),e.jsxs(ot,{className:"shrink-0 border-t px-4 py-3",children:[s&&e.jsxs(Z,{type:"button",variant:"ghost",size:"sm",className:"text-destructive hover:text-destructive mr-auto",onClick:l,children:[e.jsx(it,{className:"mr-1.5 size-4"}),"Delete"]}),e.jsx(Z,{variant:"ghost",size:"sm",onClick:a,children:"Cancel"}),e.jsx(i.Subscribe,{selector:r=>r.values.name.trim()!==""&&r.values.prompt.trim()!==""&&oe(r.values.cron),children:r=>e.jsx(Z,{type:"submit",size:"sm",form:"schedule-form",disabled:!r||c,children:c?"Saving…":s?"Save":"Create task"})})]})]})}function Ss({open:t,onOpenChange:n,editTask:s,initialPreset:o,initialAgentId:a}){var pe;const l=ct(),c=Oe(),d=Ee(),{data:h,isError:v}=dt(),x={agents:(h==null?void 0:h.agents)??[],answered:h!==void 0,unreadable:v},{data:j}=xe(),p=De(x.agents,a),C=p!==null&&j!==void 0&&Object.hasOwn(j.capabilities,p)?p:(j==null?void 0:j.defaultRuntime)??null,{data:u}=ut(),i=mt(C),g=ht(C?ft(u==null?void 0:u.executionDefaults,C):null,((pe=i==null?void 0:i.permissionModes)==null?void 0:pe.values)??[]),w=m.useRef(g);m.useLayoutEffect(()=>{w.current=g},[g]);const[S,N]=m.useState(()=>s?"form":"preset-picker"),[T,A]=m.useState(null),[Y,D]=m.useState(!1),[_,b]=m.useState((s==null?void 0:s.enabled)??!0),[y,M]=m.useState(!1),I=y?void 0:s,[J,B]=m.useState(!0),{data:H}=xt(),[Q,ee]=m.useState(()=>P(s,void 0,a,g)),[te,r]=m.useState(0);function f(E,ie=!1){ee(E),r(X=>X+1),M(ie)}m.useEffect(()=>{if(!t){f(P(s,void 0,a,w.current)),A(null),D(!1),N(s?"form":"preset-picker");return}s?(f(P(s)),b(s.enabled),N("form")):o?(f(P(void 0,o,a,w.current)),A(o),N("form")):(f(P(void 0,void 0,a,w.current)),N("preset-picker"))},[s,t,o,a]);const{pendingTemplate:F,externalTrigger:O,clear:se}=pt();m.useEffect(()=>{O&&F&&(f(P(void 0,F,a,w.current)),A(F),N("form"),se())},[O,F,se,a]);function Le(E){f(P(void 0,E,a,w.current)),A(E),N("form")}function Ie(E){const ie=(H??[]).filter(X=>(X.agentId??"")===E.agentId).map(X=>X.name);B(!0),f(ms(E,ie),!0)}function ze(){y&&J&&s&&c.mutate({id:s.id,enabled:!1}),n(!1)}function Te(){s&&l.mutate(s.id,{onSuccess:()=>{D(!1),n(!1)}})}function _e(E){s&&(b(E),c.mutate({id:s.id,enabled:E},{onError:()=>b(s.enabled)}))}const Pe=d.isPending||c.isPending;return e.jsxs(gt,{open:t,onOpenChange:n,children:[e.jsxs(jt,{className:"flex max-h-[85vh] max-w-lg flex-col gap-0 p-0",children:[e.jsxs(vt,{className:"shrink-0 border-b px-4 py-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[S==="form"&&!I&&!y&&e.jsxs("button",{type:"button",onClick:()=>N("preset-picker"),className:"text-muted-foreground hover:text-foreground flex items-center gap-1 text-sm","aria-label":"Back to preset picker",children:[e.jsx(bt,{className:"size-4"}),"Back"]}),e.jsx(yt,{children:I?"Edit schedule":"New schedule"}),I&&e.jsx(fe,{className:"ml-auto",checked:_,onCheckedChange:_e,disabled:c.isPending,"aria-label":_?"Disable schedule":"Enable schedule"})]}),e.jsx(Nt,{className:"sr-only",children:I?"Edit an existing schedule":"Create a new schedule"})]}),S==="preset-picker"&&e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:e.jsxs("div",{className:"space-y-4 px-4 py-5",children:[e.jsx("p",{className:"text-muted-foreground text-sm",children:"Start from a template"}),e.jsx(Me,{onSelect:Le,selectedId:T==null?void 0:T.id}),e.jsx("button",{type:"button",onClick:()=>{A(null),N("form")},className:"text-muted-foreground hover:text-foreground w-full text-center text-sm transition-colors",children:"Start from scratch"})]})}),S==="form"&&e.jsx(fs,{defaultValues:Q,roster:x,editTask:I,onSubmitSuccess:ze,onCancel:()=>n(!1),onDeleteClick:()=>D(!0),isPending:Pe,onMakeCopy:Ie,leading:y&&s?e.jsxs("div",{className:"flex items-start gap-2 rounded-md border px-3 py-2",children:[e.jsx(wt,{id:"copy-switch-off-original",checked:J,onCheckedChange:E=>B(E===!0)}),e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(R,{htmlFor:"copy-switch-off-original",className:"text-sm font-normal",children:"Switch off the package’s schedule"}),e.jsxs("p",{className:"text-muted-foreground text-xs",children:["So “",s.name,"” and your copy don’t both run."]})]})]}):void 0},te)]}),s&&e.jsx(Ct,{open:Y,onOpenChange:D,children:e.jsxs(St,{children:[e.jsxs(kt,{children:[e.jsxs(Rt,{children:["Delete “",s.name,"”?"]}),e.jsx(Et,{children:"Its run history is deleted too. This can’t be undone."})]}),e.jsxs(Ot,{children:[e.jsx("button",{onClick:()=>D(!1),className:"border-input hover:bg-accent hover:text-accent-foreground inline-flex items-center rounded-md border bg-transparent px-3 py-1.5 text-sm font-medium shadow-xs transition-colors",children:"Cancel"}),e.jsx("button",{onClick:Te,disabled:l.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90 dark:bg-destructive/60 inline-flex items-center rounded-md px-3 py-1.5 text-sm font-medium shadow-sm transition-colors",children:l.isPending?"Deleting…":"Delete task"})]})]})})]})}function ks({onCreateWithPreset:t,onCreateBlank:n}){return e.jsxs("div",{className:"flex flex-col items-center pb-8 md:pb-12",children:[e.jsx("h3",{className:"mb-2 text-lg font-medium",children:"No schedules yet"}),e.jsx("p",{className:"text-muted-foreground mb-6 max-w-sm text-center text-sm",children:"Put a skill on a timer and it runs without you."}),e.jsx("div",{className:"w-full max-w-lg",children:e.jsx(Me,{onSelect:t})}),e.jsx(Z,{variant:"ghost",className:"mt-4",onClick:n,children:"New custom schedule"})]})}export{Ss as C,Cs as F,ks as T};
@@ -1 +0,0 @@
1
- import{r as d,R as b,j as L,B as ve,G as Ze,i_ as Ce,ab as Ue,es as Xe,f2 as Z,l as Q,i$ as Qe,a1 as Je,a3 as et,a2 as tt,aG as me,a4 as nt,eF as rt,eS as ot,gc as it,bd as st,aZ as at,cZ as lt,cs as ct,f5 as ut,aW as ge}from"./index-OQuvRZTD.js";import{D as z}from"./dorkbot-templates-8Yu9POWJ.js";import{u as ft}from"./use-external-adapter-catalog-9qiNBqpc.js";var dt={attributes:!0,characterData:!0,subtree:!0,childList:!0};function ht(e,t,n=dt){d.useEffect(()=>{if(e.current){const r=new MutationObserver(t);return r.observe(e.current,n),()=>{r.disconnect()}}},[t,n])}var Le=(function(){if(typeof Map<"u")return Map;function e(t,n){var r=-1;return t.some(function(o,s){return o[0]===n?(r=s,!0):!1}),r}return(function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var r=e(this.__entries__,n),o=this.__entries__[r];return o&&o[1]},t.prototype.set=function(n,r){var o=e(this.__entries__,n);~o?this.__entries__[o][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,o=e(r,n);~o&&r.splice(o,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var o=0,s=this.__entries__;o<s.length;o++){var i=s[o];n.call(r,i[1],i[0])}},t})()})(),ue=typeof window<"u"&&typeof document<"u"&&window.document===document,te=(function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()})(),pt=(function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(te):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}})(),vt=2;function mt(e,t){var n=!1,r=!1,o=0;function s(){n&&(n=!1,e()),r&&a()}function i(){pt(s)}function a(){var c=Date.now();if(n){if(c-o<vt)return;r=!0}else n=!0,r=!1,setTimeout(i,t);o=c}return a}var gt=20,bt=["top","right","bottom","left","width","height","size","weight"],yt=typeof MutationObserver<"u",wt=(function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=mt(this.refresh.bind(this),gt)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var n=this.observers_,r=n.indexOf(t);~r&&n.splice(r,1),!n.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return t.forEach(function(n){return n.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!ue||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),yt?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!ue||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,o=bt.some(function(s){return!!~r.indexOf(s)});o&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e})(),Me=(function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];Object.defineProperty(e,o,{value:t[o],enumerable:!1,writable:!1,configurable:!0})}return e}),q=(function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||te}),Te=ie(0,0,0,0);function ne(e){return parseFloat(e)||0}function be(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(r,o){var s=e["border-"+o+"-width"];return r+ne(s)},0)}function _t(e){for(var t=["top","right","bottom","left"],n={},r=0,o=t;r<o.length;r++){var s=o[r],i=e["padding-"+s];n[s]=ne(i)}return n}function Et(e){var t=e.getBBox();return ie(0,0,t.width,t.height)}function Ot(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return Te;var r=q(e).getComputedStyle(e),o=_t(r),s=o.left+o.right,i=o.top+o.bottom,a=ne(r.width),c=ne(r.height);if(r.boxSizing==="border-box"&&(Math.round(a+s)!==t&&(a-=be(r,"left","right")+s),Math.round(c+i)!==n&&(c-=be(r,"top","bottom")+i)),!Rt(e)){var u=Math.round(a+s)-t,l=Math.round(c+i)-n;Math.abs(u)!==1&&(a-=u),Math.abs(l)!==1&&(c-=l)}return ie(o.left,o.top,a,c)}var xt=(function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof q(e).SVGGraphicsElement}:function(e){return e instanceof q(e).SVGElement&&typeof e.getBBox=="function"}})();function Rt(e){return e===q(e).document.documentElement}function St(e){return ue?xt(e)?Et(e):Ot(e):Te}function kt(e){var t=e.x,n=e.y,r=e.width,o=e.height,s=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,i=Object.create(s.prototype);return Me(i,{x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:o+n,left:t}),i}function ie(e,t,n,r){return{x:e,y:t,width:n,height:r}}var Ct=(function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=ie(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=St(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e})(),Lt=(function(){function e(t,n){var r=kt(n);Me(this,{target:t,contentRect:r})}return e})(),Mt=(function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new Le,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=n,this.callbackCtx_=r}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof q(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new Ct(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof q(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new Lt(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e})(),Ae=typeof WeakMap<"u"?new WeakMap:new Le,Ie=(function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=wt.getInstance(),r=new Mt(t,n,this);Ae.set(this,r)}return e})();["observe","unobserve","disconnect"].forEach(function(e){Ie.prototype[e]=function(){var t;return(t=Ae.get(this))[e].apply(t,arguments)}});var Tt=(function(){return typeof te.ResizeObserver<"u"?te.ResizeObserver:Ie})(),At=({mutationObservables:e,resizeObservables:t,refresh:n})=>{const[r,o]=d.useState(0),s=d.useRef(document.documentElement||document.body);function i(c){const u=Array.from(c);for(const l of u)if(e){if(!l.attributes)continue;e.find(v=>l.matches(v))&&n(!0)}}function a(c){const u=Array.from(c);for(const l of u)if(t){if(!l.attributes)continue;t.find(v=>l.matches(v))&&o(r+1)}}return ht(s,c=>{for(const u of c)u.addedNodes.length!==0&&(i(u.addedNodes),a(u.addedNodes)),u.removedNodes.length!==0&&(i(u.removedNodes),a(u.removedNodes))},{childList:!0,subtree:!0}),d.useEffect(()=>{if(!t)return;const c=new Tt(()=>{n()});for(const u of t){const l=document.querySelector(u);l&&c.observe(l)}return()=>{c.disconnect()}},[t,r]),null},It=At;function ee(e){let t=Pe;return e&&(t=e.getBoundingClientRect()),t}function Pt(e,t){const[n,r]=d.useState(Pe),o=d.useCallback(()=>{e!=null&&e.current&&r(ee(e==null?void 0:e.current))},[e==null?void 0:e.current]);return d.useEffect(()=>(o(),window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)),[e==null?void 0:e.current,t]),n}var Pe={bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0};function Dt(e,t){return new Promise(n=>{if(!(e instanceof Element))throw new TypeError("Argument 1 must be an Element");let r=0,o=null;const s=Object.assign({behavior:"smooth"},t);e.scrollIntoView(s),requestAnimationFrame(i);function i(){const a=e==null?void 0:e.getBoundingClientRect().top;if(a===o){if(r++>2)return n(null)}else r=0,o=a;requestAnimationFrame(i)}})}function J(e){return e<0?0:e}function Ht(e){return typeof e=="object"&&e!==null?{thresholdX:e.x||0,thresholdY:e.y||0}:{thresholdX:e||0,thresholdY:e||0}}function se(){const e=Math.max(document.documentElement.clientWidth,window.innerWidth||0),t=Math.max(document.documentElement.clientHeight,window.innerHeight||0);return{w:e,h:t}}function Nt({top:e,right:t,bottom:n,left:r,threshold:o}){const{w:s,h:i}=se(),{thresholdX:a,thresholdY:c}=Ht(o);return e<0&&n-e>i?!0:e>=0+c&&r>=0+a&&n<=i-c&&t<=s-a}var ye=(e,t)=>e>t,we=(e,t)=>e>t;function jt(e,t=[]){const n=(r,o)=>t.includes(r)?1:t.includes(o)?-1:0;return Object.keys(e).map(r=>({position:r,value:e[r]})).sort((r,o)=>o.value-r.value).sort((r,o)=>n(r.position,o.position)).filter(r=>r.value>0).map(r=>r.position)}var ce=10;function fe(e=ce){return Array.isArray(e)?e.length===1?[e[0],e[0],e[0],e[0]]:e.length===2?[e[1],e[0],e[1],e[0]]:e.length===3?[e[0],e[1],e[2],e[1]]:e.length>3?[e[0],e[1],e[2],e[3]]:[ce,ce]:[e,e,e,e]}var $t={maskWrapper:()=>({opacity:.7,left:0,top:0,position:"fixed",zIndex:99999,pointerEvents:"none",color:"#000"}),svgWrapper:({windowWidth:e,windowHeight:t,wpt:n,wpl:r})=>({width:e,height:t,left:Number(r),top:Number(n),position:"fixed"}),maskArea:({x:e,y:t,width:n,height:r})=>({x:e,y:t,width:n,height:r,fill:"black",rx:0}),maskRect:({windowWidth:e,windowHeight:t,maskID:n})=>({x:0,y:0,width:e,height:t,fill:"currentColor",mask:`url(#${n})`}),clickArea:({windowWidth:e,windowHeight:t,clipID:n})=>({x:0,y:0,width:e,height:t,fill:"currentcolor",pointerEvents:"auto",clipPath:`url(#${n})`}),highlightedArea:({x:e,y:t,width:n,height:r})=>({x:e,y:t,width:n,height:r,pointerEvents:"auto",fill:"transparent",display:"none"})};function zt(e){return(t,n)=>{const r=$t[t](n),o=e[t];return o?o(r,n):r}}var Ft=({padding:e=10,wrapperPadding:t=0,onClick:n,onClickHighlighted:r,styles:o={},sizes:s,className:i,highlightedAreaClassName:a,maskId:c,clipId:u})=>{const l=c||_e("mask__"),f=u||_e("clip__"),v=zt(o),[g,_,O,y]=fe(e),[p,E,x,k]=fe(t),{w:h,h:T}=se(),M=J((s==null?void 0:s.width)+y+_),C=J((s==null?void 0:s.height)+g+O),w=J((s==null?void 0:s.top)-g-p),R=J((s==null?void 0:s.left)-y-k),A=h-k-E,S=T-p-x,j=v("maskArea",{x:R,y:w,width:M,height:C}),$=v("highlightedArea",{x:R,y:w,width:M,height:C});return b.createElement("div",{style:v("maskWrapper",{}),onClick:n,className:i},b.createElement("svg",{width:A,height:S,xmlns:"http://www.w3.org/2000/svg",style:v("svgWrapper",{windowWidth:A,windowHeight:S,wpt:p,wpl:k})},b.createElement("defs",null,b.createElement("mask",{id:l},b.createElement("rect",{x:0,y:0,width:A,height:S,fill:"white"}),b.createElement("rect",{style:j,rx:j.rx?1:void 0})),b.createElement("clipPath",{id:f},b.createElement("polygon",{points:`0 0, 0 ${S}, ${R} ${S}, ${R} ${w}, ${R+M} ${w}, ${R+M} ${w+C}, ${R} ${w+C}, ${R} ${S}, ${A} ${S}, ${A} 0`}))),b.createElement("rect",{style:v("maskRect",{windowWidth:A,windowHeight:S,maskID:l})}),b.createElement("rect",{style:v("clickArea",{windowWidth:A,windowHeight:S,top:w,left:R,width:M,height:C,clipID:f})}),b.createElement("rect",{style:$,className:a,onClick:r,rx:$.rx?1:void 0})))},Wt=Ft;function _e(e){return e+Math.random().toString(36).substring(2,16)}var Vt=Object.defineProperty,re=Object.getOwnPropertySymbols,De=Object.prototype.hasOwnProperty,He=Object.prototype.propertyIsEnumerable,Ee=(e,t,n)=>t in e?Vt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Oe=(e,t)=>{for(var n in t||(t={}))De.call(t,n)&&Ee(e,n,t[n]);if(re)for(var n of re(t))He.call(t,n)&&Ee(e,n,t[n]);return e},qt=(e,t)=>{var n={};for(var r in e)De.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&re)for(var r of re(e))t.indexOf(r)<0&&He.call(e,r)&&(n[r]=e[r]);return n},Bt={popover:()=>({position:"fixed",maxWidth:353,backgroundColor:"#fff",padding:"24px 30px",boxShadow:"0 0.5em 3em rgba(0, 0, 0, 0.3)",color:"inherit",zIndex:1e5,transition:"transform 0.3s",top:0,left:0})};function Gt(e){return(t,n)=>{const r=Bt[t](n),o=e[t];return o?o(r,n):r}}var Kt=e=>{var t=e,{children:n,position:r="bottom",padding:o=10,styles:s={},sizes:i,refresher:a}=t,c=qt(t,["children","position","padding","styles","sizes","refresher"]);const u=d.useRef(null),l=d.useRef(""),f=d.useRef(""),v=d.useRef(""),{w:g,h:_}=se(),O=Gt(s),y=Pt(u,a),{width:p,height:E}=y,[x,k,h,T]=fe(o),M=(i==null?void 0:i.left)-T,C=(i==null?void 0:i.top)-x,w=(i==null?void 0:i.right)+k,R=(i==null?void 0:i.bottom)+h,A=r&&typeof r=="function"?r({width:p,height:E,windowWidth:g,windowHeight:_,top:C,left:M,right:w,bottom:R,x:i.x,y:i.y},y):r,S={left:M,right:g-w,top:C,bottom:_-R},j=(I,D,H)=>{switch(I){case"top":return S.top>E+h;case"right":return D?!1:S.right>p+T;case"bottom":return H?!1:S.bottom>E+x;case"left":return S.left>p+k;default:return!1}},$=(I,D,H)=>{const m=jt(S,H?["right","left"]:D?["top","bottom"]:[]);for(let N=0;N<m.length;N++)if(j(m[N],D,H))return l.current=m[N],I[m[N]];return l.current="center",I.center},G=(I=>{if(Array.isArray(I)){const W=ye(I[0],g),le=we(I[1],_);return l.current="custom",[W?g/2-p/2:I[0],le?_/2-E/2:I[1]]}const D=ye(M+p,g),H=we(R+E,_),m=D?Math.min(M,g-p):Math.max(M,0),N=H?E>S.bottom?Math.max(R-E,0):Math.max(C,0):C;H&&E>S.bottom?f.current="bottom":f.current="top",D?v.current="left":v.current="right";const K={top:[m-T,C-E-h],right:[w+T,N-x],bottom:[m-T,R+x],left:[M-p-k,N-x],center:[g/2-p/2,_/2-E/2]};return I==="center"||j(I,D,H)&&!D&&!H?(l.current=I,K[I]):$(K,D,H)})(A);return b.createElement("div",Oe({className:"reactour__popover",style:Oe({transform:`translate(${Math.round(G[0])}px, ${Math.round(G[1])}px)`},O("popover",{position:l.current,verticalAlign:f.current,horizontalAlign:v.current,helperRect:y,targetRect:i})),ref:u},c),n)},Yt=Kt,Zt=Object.defineProperty,Ut=Object.defineProperties,Xt=Object.getOwnPropertyDescriptors,oe=Object.getOwnPropertySymbols,Ne=Object.prototype.hasOwnProperty,je=Object.prototype.propertyIsEnumerable,xe=(e,t,n)=>t in e?Zt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,P=(e,t)=>{for(var n in t||(t={}))Ne.call(t,n)&&xe(e,n,t[n]);if(oe)for(var n of oe(t))je.call(t,n)&&xe(e,n,t[n]);return e},he=(e,t)=>Ut(e,Xt(t)),U=(e,t)=>{var n={};for(var r in e)Ne.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&oe)for(var r of oe(e))t.indexOf(r)<0&&je.call(e,r)&&(n[r]=e[r]);return n},Qt={bottom:0,height:0,left:0,right:0,top:0,width:0,windowWidth:0,windowHeight:0,x:0,y:0};function Jt(e,t={block:"center",behavior:"smooth",inViewThreshold:0}){const[n,r]=d.useState(!1),[o,s]=d.useState(!1),[i,a]=d.useState(!1),[c,u]=d.useState(null),[l,f]=d.useState(Qt),v=(e==null?void 0:e.selector)instanceof Element?e==null?void 0:e.selector:document.querySelector(e==null?void 0:e.selector),g=d.useCallback(()=>{const O=Re(v,e==null?void 0:e.highlightedSelectors,e==null?void 0:e.bypassElem),{hasHighligtedElems:y}=O,p=U(O,["hasHighligtedElems"]);Object.entries(l).some(([E,x])=>p[E]!==x)&&f(p)},[v,e==null?void 0:e.highlightedSelectors,l]);d.useEffect(()=>(g(),window.addEventListener("resize",g),()=>window.removeEventListener("resize",g)),[v,e==null?void 0:e.highlightedSelectors,c]),d.useEffect(()=>{!Nt(he(P({},l),{threshold:t.inViewThreshold}))&&v&&(r(!0),Dt(v,t).then(()=>{o||u(Date.now())}).finally(()=>{r(!1)}))},[l]);const _=d.useCallback(()=>{s(!0);const O=Re(v,e==null?void 0:e.highlightedSelectors,e==null?void 0:e.bypassElem),{hasHighligtedElems:y}=O,p=U(O,["hasHighligtedElems"]);a(y),f(p),s(!1)},[v,e==null?void 0:e.highlightedSelectors,l]);return{sizes:l,transition:n,target:v,observableRefresher:_,isHighlightingObserved:i}}function Re(e,t=[],n=!0){let r=!1;const{w:o,h:s}=se();if(!t)return he(P({},ee(e)),{windowWidth:o,windowHeight:s,hasHighligtedElems:!1});let i=ee(e),a={bottom:0,height:0,left:o,right:0,top:s,width:0};for(const u of t){const l=document.querySelector(u);if(!l||l.style.display==="none"||l.style.visibility==="hidden")continue;const f=ee(l);r=!0,n||!e?(f.top<a.top&&(a.top=f.top),f.right>a.right&&(a.right=f.right),f.bottom>a.bottom&&(a.bottom=f.bottom),f.left<a.left&&(a.left=f.left),a.width=a.right-a.left,a.height=a.bottom-a.top):(f.top<i.top&&(i.top=f.top),f.right>i.right&&(i.right=f.right),f.bottom>i.bottom&&(i.bottom=f.bottom),f.left<i.left&&(i.left=f.left),i.width=i.right-i.left,i.height=i.bottom-i.top)}const c=n||!e?a.width>0&&a.height>0:!1;return{left:(c?a:i).left,top:(c?a:i).top,right:(c?a:i).right,bottom:(c?a:i).bottom,width:(c?a:i).width,height:(c?a:i).height,windowWidth:o,windowHeight:s,hasHighligtedElems:r,x:i.x,y:i.y}}var en=({disableKeyboardNavigation:e,setCurrentStep:t,currentStep:n,setIsOpen:r,stepsLength:o,disable:s,rtl:i,clickProps:a,keyboardHandler:c})=>{function u(l){if(l.stopPropagation(),e===!0||s)return;let f,v,g;e&&(f=e.includes("esc"),v=e.includes("right"),g=e.includes("left"));function _(){t(Math.min(n+1,o-1))}function O(){t(Math.max(n-1,0))}c&&typeof c=="function"?c(l,a,{isEscDisabled:f,isRightDisabled:v,isLeftDisabled:g}):(l.keyCode===27&&!f&&(l.preventDefault(),r(!1)),l.keyCode===39&&!v&&(l.preventDefault(),i?O():_()),l.keyCode===37&&!g&&(l.preventDefault(),i?_():O()))}return d.useEffect(()=>(window.addEventListener("keydown",u,!1),()=>{window.removeEventListener("keydown",u)}),[s,t,n]),null},tn=en,nn={badge:()=>({position:"absolute",fontFamily:"monospace",background:"var(--reactour-accent,#007aff)",height:"1.875em",lineHeight:2,paddingLeft:"0.8125em",paddingRight:"0.8125em",fontSize:"1em",borderRadius:"1.625em",color:"white",textAlign:"center",boxShadow:"0 0.25em 0.5em rgba(0, 0, 0, 0.3)",top:"-0.8125em",left:"-0.8125em"}),controls:()=>({display:"flex",marginTop:24,alignItems:"center",justifyContent:"space-between"}),navigation:()=>({counterReset:"dot",display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap"}),button:({disabled:e})=>({display:"block",padding:0,border:0,background:"none",cursor:e?"not-allowed":"pointer"}),arrow:({disabled:e})=>({color:e?"#caccce":"#646464",width:16,height:12,flex:"0 0 16px"}),dot:({current:e,disabled:t,showNumber:n})=>({counterIncrement:"dot",width:8,height:8,border:e?"0":"1px solid #caccce",borderRadius:"100%",padding:0,display:"block",margin:4,transition:"opacity 0.3s, transform 0.3s",cursor:t?"not-allowed":"pointer",transform:`scale(${e?1.25:1})`,color:e?"var(--reactour-accent, #007aff)":"#caccce",background:e?"var(--reactour-accent, #007aff)":"none"}),close:({disabled:e})=>({position:"absolute",top:22,right:22,width:9,height:9,"--rt-close-btn":e?"#caccce":"#5e5e5e","--rt-close-btn-disabled":e?"#caccce":"#000"}),svg:()=>({display:"block"})};function ae(e){return(t,n)=>{const r=nn[t](n),o=e[t];return o?o(r,n):r}}var rn=({styles:e={},children:t})=>{const n=ae(e);return b.createElement("span",{style:n("badge",{})},t)},on=rn,sn=e=>{var t=e,{styles:n={},onClick:r,disabled:o}=t,s=U(t,["styles","onClick","disabled"]);const i=ae(n);return b.createElement("button",P({className:"reactour__close-button",style:P(P({},i("button",{})),i("close",{disabled:o})),onClick:r},s),b.createElement("svg",{viewBox:"0 0 9.1 9.1","aria-hidden":!0,role:"presentation",style:P({},i("svg",{}))},b.createElement("path",{fill:"currentColor",d:"M5.9 4.5l2.8-2.8c.4-.4.4-1 0-1.4-.4-.4-1-.4-1.4 0L4.5 3.1 1.7.3C1.3-.1.7-.1.3.3c-.4.4-.4 1 0 1.4l2.8 2.8L.3 7.4c-.4.4-.4 1 0 1.4.2.2.4.3.7.3s.5-.1.7-.3L4.5 6l2.8 2.8c.3.2.5.3.8.3s.5-.1.7-.3c.4-.4.4-1 0-1.4L5.9 4.5z"})))},an=sn,ln=({content:e,setCurrentStep:t,transition:n,isHighlightingObserved:r,currentStep:o,setIsOpen:s})=>typeof e=="function"?e({setCurrentStep:t,transition:n,isHighlightingObserved:r,currentStep:o,setIsOpen:s}):e,cn=ln,un=({styles:e={},steps:t,setCurrentStep:n,currentStep:r,setIsOpen:o,nextButton:s,prevButton:i,disableDots:a,hideDots:c,hideButtons:u,disableAll:l,rtl:f,Arrow:v=$e})=>{const g=t.length,_=ae(e),O=({onClick:y,kind:p="next",children:E,hideArrow:x})=>{function k(){l||(y&&typeof y=="function"?y():n(p==="next"?Math.min(r+1,g-1):Math.max(r-1,0)))}return b.createElement("button",{style:_("button",{kind:p,disabled:l||(p==="next"?g-1===r:r===0)}),onClick:k,"aria-label":`Go to ${p} step`},x?null:b.createElement(v,{styles:e,inverted:f?p==="prev":p==="next",disabled:l||(p==="next"?g-1===r:r===0)}),E)};return b.createElement("div",{style:_("controls",{}),dir:f?"rtl":"ltr"},u?null:i&&typeof i=="function"?i({Button:O,setCurrentStep:n,currentStep:r,stepsLength:g,setIsOpen:o,steps:t}):b.createElement(O,{kind:"prev"}),c?null:b.createElement("div",{style:_("navigation",{})},Array.from({length:g},(y,p)=>p).map(y=>{var p;return b.createElement("button",{style:_("dot",{current:y===r,disabled:a||l}),onClick:()=>{!a&&!l&&n(y)},key:`navigation_dot_${y}`,"aria-label":((p=t[y])==null?void 0:p.navDotAriaLabel)||`Go to step ${y+1}`})})),u?null:s&&typeof s=="function"?s({Button:O,setCurrentStep:n,currentStep:r,stepsLength:g,setIsOpen:o,steps:t}):b.createElement(O,null))},fn=un,$e=({styles:e={},inverted:t=!1,disabled:n})=>{const r=ae(e);return b.createElement("svg",{viewBox:"0 0 18.4 14.4",style:r("arrow",{inverted:t,disabled:n})},b.createElement("path",{d:t?"M17 7.2H1M10.8 1L17 7.2l-6.2 6.2":"M1.4 7.2h16M7.6 1L1.4 7.2l6.2 6.2",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeMiterlimit:"10"}))},dn={Badge:on,Close:an,Content:cn,Navigation:fn,Arrow:$e},hn=e=>P(P({},dn),e),pn=({styles:e,components:t={},badgeContent:n,accessibilityOptions:r,disabledActions:o,onClickClose:s,steps:i,setCurrentStep:a,currentStep:c,transition:u,isHighlightingObserved:l,setIsOpen:f,nextButton:v,prevButton:g,disableDotsNavigation:_,rtl:O,showPrevNextButtons:y=!0,showCloseButton:p=!0,showNavigation:E=!0,showBadge:x=!0,showDots:k=!0,meta:h,setMeta:T,setSteps:M})=>{const C=i[c],{Badge:w,Close:R,Content:A,Navigation:S,Arrow:j}=hn(t),$=n&&typeof n=="function"?n({currentStep:c,totalSteps:i.length,transition:u}):c+1;function B(){o||(s&&typeof s=="function"?s({setCurrentStep:a,setIsOpen:f,currentStep:c,steps:i,meta:h,setMeta:T,setSteps:M}):f(!1))}return b.createElement(b.Fragment,null,x?b.createElement(w,{styles:e},$):null,p?b.createElement(R,{styles:e,"aria-label":r==null?void 0:r.closeButtonAriaLabel,disabled:o,onClick:B}):null,b.createElement(A,{content:C==null?void 0:C.content,setCurrentStep:a,currentStep:c,transition:u,isHighlightingObserved:l,setIsOpen:f}),E?b.createElement(S,{setCurrentStep:a,currentStep:c,setIsOpen:f,steps:i,styles:e,"aria-hidden":!(r!=null&&r.showNavigationScreenReaders),nextButton:v,prevButton:g,disableDots:_,hideButtons:!y,hideDots:!k,disableAll:o,rtl:O,Arrow:j}):null)},vn=pn,mn=e=>{var t=e,{currentStep:n,setCurrentStep:r,setIsOpen:o,steps:s=[],setSteps:i,styles:a={},scrollSmooth:c,afterOpen:u,beforeClose:l,padding:f=10,position:v,onClickMask:g,onClickHighlighted:_,keyboardHandler:O,className:y="reactour__popover",maskClassName:p="reactour__mask",highlightedMaskClassName:E,clipId:x,maskId:k,disableInteraction:h,disableKeyboardNavigation:T,inViewThreshold:M,disabledActions:C,setDisabledActions:w,disableWhenSelectorFalsy:R,rtl:A,accessibilityOptions:S={closeButtonAriaLabel:"Close Tour",showNavigationScreenReaders:!0},ContentComponent:j,Wrapper:$,meta:B,setMeta:G,onTransition:I=()=>"center"}=t,D=U(t,["currentStep","setCurrentStep","setIsOpen","steps","setSteps","styles","scrollSmooth","afterOpen","beforeClose","padding","position","onClickMask","onClickHighlighted","keyboardHandler","className","maskClassName","highlightedMaskClassName","clipId","maskId","disableInteraction","disableKeyboardNavigation","inViewThreshold","disabledActions","setDisabledActions","disableWhenSelectorFalsy","rtl","accessibilityOptions","ContentComponent","Wrapper","meta","setMeta","onTransition"]),H;const m=s[n],N=P(P({},a),m==null?void 0:m.styles),{sizes:K,transition:W,observableRefresher:le,isHighlightingObserved:pe,target:V}=Jt(m,{block:"center",behavior:c?"smooth":"auto",inViewThreshold:M});d.useEffect(()=>(u&&typeof u=="function"&&u(V),()=>{l&&typeof l=="function"&&l(V)}),[]);const{maskPadding:We,popoverPadding:Ve,wrapperPadding:qe}=bn((H=m==null?void 0:m.padding)!=null?H:f),X={setCurrentStep:r,setIsOpen:o,currentStep:n,setSteps:i,steps:s,setMeta:G,meta:B};function Be(){C||(g&&typeof g=="function"?g(X):o(!1))}const Ge=typeof(m==null?void 0:m.stepInteraction)=="boolean"?!(m!=null&&m.stepInteraction):h?typeof h=="boolean"?h:h(X):!1;d.useEffect(()=>(m!=null&&m.action&&typeof(m==null?void 0:m.action)=="function"&&(m==null||m.action(V)),(m==null?void 0:m.disableActions)!==void 0&&w(m==null?void 0:m.disableActions),()=>{m!=null&&m.actionAfter&&typeof(m==null?void 0:m.actionAfter)=="function"&&(m==null||m.actionAfter(V))}),[m]);const Ke=W?I:m!=null&&m.position?m==null?void 0:m.position:v,Ye=$||b.Fragment;return m?b.createElement(Ye,null,b.createElement(It,{mutationObservables:m==null?void 0:m.mutationObservables,resizeObservables:m==null?void 0:m.resizeObservables,refresh:le}),b.createElement(tn,{setCurrentStep:r,currentStep:n,setIsOpen:o,stepsLength:s.length,disableKeyboardNavigation:T,disable:C,rtl:A,clickProps:X,keyboardHandler:O}),(!R||V)&&b.createElement(Wt,{sizes:W?yn:K,onClick:Be,styles:P({highlightedArea:Y=>he(P({},Y),{display:Ge?"block":"none"})},N),padding:W?0:We,highlightedAreaClassName:E,className:p,onClickHighlighted:Y=>{Y.preventDefault(),Y.stopPropagation(),_&&_(Y,X)},wrapperPadding:qe,clipId:x,maskId:k}),(!R||V)&&b.createElement(Yt,{sizes:K,styles:N,position:Ke,padding:Ve,"aria-labelledby":S==null?void 0:S.ariaLabelledBy,className:y,refresher:n},j?b.createElement(j,P({styles:N,setCurrentStep:r,currentStep:n,setIsOpen:o,steps:s,accessibilityOptions:S,disabledActions:C,transition:W,isHighlightingObserved:pe,rtl:A},D)):b.createElement(vn,P({styles:N,setCurrentStep:r,currentStep:n,setIsOpen:o,steps:s,setSteps:i,accessibilityOptions:S,disabledActions:C,transition:W,isHighlightingObserved:pe,rtl:A,meta:B,setMeta:G},D)))):null},gn=mn;function bn(e){return typeof e=="object"&&e!==null?{maskPadding:e.mask,popoverPadding:e.popover,wrapperPadding:e.wrapper}:{maskPadding:e,popoverPadding:e,wrapperPadding:0}}var yn={bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0},wn={isOpen:!1,setIsOpen:()=>!1,currentStep:0,setCurrentStep:()=>0,steps:[],setSteps:()=>[],setMeta:()=>"",disabledActions:!1,setDisabledActions:()=>!1,components:{}},_n=b.createContext(wn),En=e=>{var t=e,{children:n,defaultOpen:r=!1,startAt:o=0,steps:s,setCurrentStep:i,currentStep:a}=t,c=U(t,["children","defaultOpen","startAt","steps","setCurrentStep","currentStep"]);const[u,l]=d.useState(r),[f,v]=d.useState(o),[g,_]=d.useState(s),[O,y]=d.useState(""),[p,E]=d.useState(!1),x=P({isOpen:u,setIsOpen:l,currentStep:a||f,setCurrentStep:i&&typeof i=="function"?i:v,steps:g,setSteps:_,disabledActions:p,setDisabledActions:E,meta:O,setMeta:y},c);return b.createElement(_n.Provider,{value:x},n,u?b.createElement(gn,P({},x)):null)};const On={default:"#1A1A1A",white:"#FFFFFF",orange:"#CE2021",current:"currentColor"};function Se({variant:e="default",size:t=40,className:n,style:r}){const o=On[e],s=t*(799/2325);return L.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:s,viewBox:"0 0 2325 799",fill:"none",className:n,style:r,"aria-hidden":"true",children:[L.jsx("rect",{x:"50",y:"50",width:"2225",height:"699",stroke:o,strokeWidth:"100"}),L.jsx("path",{d:"M492.333 199.627L599.833 295.627L600 295.776V491.707L492.207 599.5H199.5V199.5H492.19L492.333 199.627ZM334 347.5V448.5H435V347.5H334Z",fill:o}),L.jsx("path",{d:"M1108.5 497.715L1108.34 497.862L1001.34 599.362L1001.2 599.5H699V296.283L699.158 296.135L802.158 199.635L802.303 199.5H1108.5V497.715ZM855 347.5V448.5H956V347.5H855Z",fill:o}),L.jsx("path",{d:"M1616.94 200.24L1510.07 395.005L1616.94 598.768L1617.64 600.103L1616.28 599.451L1409 500.056L1208.22 599.448L1207.5 599.806V199.5H1617.34L1616.94 200.24ZM1332 337.5V439.207L1433.71 337.5H1332Z",fill:o}),L.jsx("path",{d:"M1716.5 599V200L1841 291.5L2125 200L2017.5 400L2125 599L1841 501L1716.5 599Z",fill:o,stroke:o})]})}function xn({caption:e,chipLabel:t,isLast:n,onAdvance:r,onEnd:o}){const s=t??(n?"Got it":"Next");return L.jsxs("div",{className:Ze("flex max-w-[min(20rem,calc(100vw-2rem))] flex-col gap-3 rounded-lg border","bg-popover text-popover-foreground shadow-floating p-4"),children:[L.jsxs("div",{className:"flex items-start gap-3",children:[L.jsxs("span",{className:"mt-0.5 shrink-0",children:[L.jsx(Se,{size:28,className:"dark:hidden"}),L.jsx(Se,{variant:"white",size:28,className:"hidden dark:block"})]}),L.jsx("p",{className:"text-sm leading-relaxed",children:e})]}),L.jsxs("div",{className:"flex items-center justify-end gap-2",children:[L.jsx(ve,{variant:"ghost",size:"sm",onClick:o,children:"Done"}),L.jsx(ve,{variant:"default",size:"sm",onClick:r,children:s})]})]})}const Rn=4e3,Sn=100;function kn(e){const[t,n]=d.useState({element:null,status:"resolving",anchor:e}),[r,o]=d.useState(e);return e!==r&&(o(e),n({element:null,status:"resolving",anchor:e})),d.useEffect(()=>{if(e===null)return;const s=Ce(e);let i=null,a=!1;const c=Date.now()+Rn,u=()=>{const f=document.querySelector(s);return f?(f!==i&&(f.scrollIntoView({block:"center",inline:"center"}),i=f,a=!0,n({element:f,status:"found",anchor:e})),!1):a?!1:Date.now()>=c?(n({element:null,status:"timeout",anchor:e}),!0):!1},l=setInterval(()=>{u()&&clearInterval(l)},Sn);return()=>clearInterval(l)},[e]),t}const Cn=".reactour__popover",Ln=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(", ");function ke(e){return Array.from(e.querySelectorAll(Ln))}function Mn(e,t){d.useEffect(()=>{var o;if(!e)return;const n=document.querySelector(Cn);if(!n)return;(o=ke(n)[0])==null||o.focus();const r=s=>{if(s.key!=="Tab")return;const i=ke(n);if(i.length===0)return;const a=i[0],c=i[i.length-1],u=document.activeElement;n.contains(u)?s.shiftKey&&u===a?(s.preventDefault(),c.focus()):!s.shiftKey&&u===c&&(s.preventDefault(),a.focus()):(s.preventDefault(),a.focus())};return document.addEventListener("keydown",r,!0),()=>document.removeEventListener("keydown",r,!0)},[e,t])}const ze="(prefers-reduced-motion: reduce)";function Tn(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia(ze).matches}function An(){const[e,t]=d.useState(Tn);return d.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const n=window.matchMedia(ze),r=o=>t(o.matches);return n.addEventListener("change",r),()=>n.removeEventListener("change",r)},[]),e}const In="dork-tour-mask--reduced-motion",Pn={mask:8,popover:10},Dn="x 280ms ease, y 280ms ease, width 280ms ease, height 280ms ease";function Hn({steps:e,activeIndex:t,onAdvance:n,onEnd:r}){const o=e[t],s=t>=e.length-1,i=Ue(),a=An(),c=kn((o==null?void 0:o.anchor)??null),[u,l]=d.useState(null);c.status==="found"&&c.element!==null&&c.anchor===(o==null?void 0:o.anchor)&&u!==t?l(t):!o&&u!==null&&l(null);const f=u!==null,v=u!==null?e[u]:void 0,g=d.useCallback(()=>{s?r():n()},[s,r,n]),_=d.useRef(g);d.useEffect(()=>{_.current=g},[g]),d.useEffect(()=>{c.status==="timeout"&&_.current()},[c.status]);const O=d.useRef(n),y=d.useRef(r);d.useEffect(()=>{O.current=n,y.current=r},[n,r]);const p=d.useRef(!1);d.useEffect(()=>{p.current=u===t},[u,t]);const[E,x]=d.useState(!1);d.useEffect(()=>{if(f&&!E){const w=requestAnimationFrame(()=>x(!0));return()=>cancelAnimationFrame(w)}},[f,E]),d.useEffect(()=>{if(!f)return;const w=document.getElementById("root");if(w)return w.inert=!0,()=>{w.inert=!1}},[f]),Mn(f,u??-1);const k=d.useMemo(()=>w=>{const R={...w,backgroundColor:"transparent",padding:0,boxShadow:"none",maxWidth:"none",color:"inherit"};return i?{...R,position:"fixed",top:"auto",left:0,right:0,bottom:0,transform:"none",display:"flex",justifyContent:"center",padding:"0 1rem 1rem"}:R},[i]),h=d.useCallback(w=>E?{...w,transition:Dn}:w,[E]),T=d.useMemo(()=>({popover:k,maskArea:h}),[k,h]),M=d.useMemo(()=>e.map((w,R)=>{const A=R===e.length-1;return{selector:Ce(w.anchor),stepInteraction:!1,content:L.jsx(xn,{caption:w.caption,chipLabel:w.chipLabel,isLast:A,onAdvance:()=>A?y.current():O.current(),onEnd:()=>y.current()})}}),[e]),C=d.useMemo(()=>e.map(w=>w.anchor).join("|"),[e]);return o?Xe.createPortal(L.jsxs(L.Fragment,{children:[L.jsx("div",{role:"status","aria-live":"polite","aria-atomic":"true",className:"sr-only",children:f?(v==null?void 0:v.caption)??"":""}),f&&L.jsx(En,{steps:M,currentStep:u??0,defaultOpen:!0,showNavigation:!1,showPrevNextButtons:!1,showCloseButton:!1,showBadge:!1,showDots:!1,disableInteraction:!0,padding:Pn,styles:T,maskClassName:a?In:void 0,onClickMask:()=>r(),keyboardHandler:w=>{w.key==="Escape"?(w.preventDefault(),y.current()):w.key==="ArrowRight"&&p.current&&_.current()},children:L.jsx("span",{className:"hidden","aria-hidden":!0})},C)]}),document.body):null}const de={general:{id:"general",deepLink:{kind:"route",...Q.home()},steps:[{anchor:Z.homeComposer,caption:z.general.composer,chipLabel:"Next"},{anchor:Z.homeTabs,caption:z.general.homeTabs,chipLabel:"Got it"}]},tasks:{id:"tasks",occasion:"tasks",offerLine:z.offers.tasks,deepLink:{kind:"route",...Q.tasks()},steps:[{anchor:Z.tasksList,caption:z.tasks.tasksList,chipLabel:"Got it"}]},relay:{id:"relay",occasion:"relay",offerLine:z.offers.relay,deepLink:{kind:"route",...Q.connections()},steps:[{anchor:Z.relayIntegrations,caption:z.relay.relayIntegrations,chipLabel:"Got it"}]},mesh:{id:"mesh",occasion:"mesh",offerLine:z.offers.mesh,deepLink:{kind:"route",...Q.team()},steps:[{anchor:Z.teamRoster,caption:z.mesh.teamRoster,chipLabel:"Got it"}]}},F=Qe()(e=>({runningTourId:null,activeIndex:0,pendingOfferId:null,startTour:t=>e({runningTourId:t,activeIndex:0,pendingOfferId:null}),advanceStep:()=>e(t=>({activeIndex:t.activeIndex+1})),endTour:()=>e({runningTourId:null,activeIndex:0}),setPendingOffer:t=>e({pendingOfferId:t}),clearPendingOffer:()=>e({pendingOfferId:null})}));function Fe(){var x,k;const e=Je(),t=et(),{data:n}=tt({queryKey:me.current(),queryFn:()=>e.getConfig(),staleTime:rt}),r=((x=n==null?void 0:n.tours)==null?void 0:x.seen)??[],o=((k=n==null?void 0:n.tours)==null?void 0:k.declined)??[],s=F(h=>h.runningTourId),i=F(h=>h.activeIndex),a=F(h=>h.pendingOfferId),c=F(h=>h.startTour),u=F(h=>h.advanceStep),l=F(h=>h.endTour),f=F(h=>h.setPendingOffer),v=F(h=>h.clearPendingOffer),g=nt({mutationFn:h=>e.updateConfig({tours:h}),onSuccess:()=>t.invalidateQueries({queryKey:me.all}),meta:{errorLabel:"Couldn’t save your tour progress"}});function _(h){r.includes(h)||g.mutate({seen:[...r,h]})}function O(h){o.includes(h)||g.mutate({declined:[...o,h]})}function y(h){return r.includes(h)||o.includes(h)}function p(h){_(h),c(h)}function E(h){O(h),v()}return{seen:r,declined:o,isSuppressed:y,runningDefinition:s?de[s]:null,activeIndex:i,pendingOffer:a?de[a]:null,pendingOfferId:a,runTour:c,acceptOffer:p,declineOffer:E,setPendingOffer:f,advanceStep:u,endTour:l}}const Nn=1,jn=1,$n=2;function zn(){const{isSuppressed:e,setPendingOffer:t,pendingOfferId:n,runningDefinition:r}=Fe(),o=ot(y=>Object.values(y.statuses).some(p=>p.lifecycle==="streaming")),s=it(),i=st(),{data:a}=at(i),{data:c}=ft(s),{data:u}=lt(),l=a==null?void 0:a.length,f=s&&c?c.reduce((y,p)=>y+p.instances.length,0):void 0,v=u==null?void 0:u.agents.length,g=d.useRef(void 0),_=d.useRef(void 0),O=d.useRef(void 0);d.useEffect(()=>{const y=(E,x,k,h,T)=>{if(x===void 0)return T;const M=h.current;return M===void 0||!(M<k&&x>=k)?(h.current=x,T):o||T||(h.current=x,e(E))?T:(t(E),!0)};let p=n!==null||r!==null;p=y("tasks",l,Nn,g,p),p=y("relay",f,jn,_,p),y("mesh",v,$n,O,p)},[l,f,v,o,n,r,e,t])}function qn(){zn();const{runningDefinition:e,activeIndex:t,advanceStep:n,endTour:r,runTour:o}=Fe(),s=ct(),i=ut({select:l=>l.location.pathname}),a=ge(l=>l.requestedTour),c=ge(l=>l.clearRequestedTour),u=(e==null?void 0:e.id)??null;return d.useEffect(()=>{if(a!==null){if(!(a in de)){c();return}if(u===a){c();return}o(a)}},[a,u,o,c]),d.useEffect(()=>{if(!e)return;const{to:l}=e.deepLink;i!==l&&s({to:l})},[e,i,s]),e?L.jsx(Hn,{steps:e.steps,activeIndex:t,onAdvance:n,onEnd:r}):null}export{Se as D,de as T,qn as a,zn as b,Fe as u};
@@ -1,108 +0,0 @@
1
- import{O as A,r as x,fH as g,fI as f,fS as k,fG as F,fP as st,fR as ln,nW as dn,lb as Te,fQ as ye,nX as E,nY as Z,nZ as un,n_ as pn,n$ as mn,fO as Ee,fK as he,o0 as fn,fL as $,fJ as ee,o1 as hn,o2 as xn,o3 as gn,jv as yn,a1 as bn,o4 as Ne,o5 as vn,o6 as at,aW as jn,jz as kn,j as t,fz as Nn,fA as wn,e3 as Sn,o7 as Cn,dI as _n,ia as rt,m8 as In,m7 as An,ap as y,G as N,cv as $n,fg as Se,aQ as Mn,cB as Tn,bU as En,fh as Ln,o8 as Dn,jT as On,kk as it,dE as Rn,dU as zn,g7 as Wn,fC as Pn,o9 as Bn,b8 as Fn,oa as Un,bv as Gn,ig as Hn,el as Kn,b7 as Yn,J as Le,ob as Vn,ie as qn,n7 as Qn,a0 as ot,bV as Xn,B as ct,en as De,eg as Jn,eh as Zn,ei as es,ej as ts,ek as ns,I as ss,x as as,h8 as lt,dj as dt,dk as ut,dl as pt,oc as mt,dD as ft,gQ as rs,X as is,od as os,C as cs}from"./index-OQuvRZTD.js";import{a as ls}from"./index-CoKNU2F9.js";import{C as ht,a as ds,b as us,c as ps,d as ms,e as fs}from"./card-DUmTNXJJ.js";import{P as hs,S as xs}from"./progress-77FCPL2y.js";import{M as gs}from"./markdown-content-Cjhsscbn.js";import{T as xt,d as gt,b as be,e as Ce,c as _e,a as yt}from"./table-D9ww_3Ij.js";import{P as ys}from"./package-sPggO7Dr.js";import{H as bs}from"./heart-BavUIV45.js";import{G as vs}from"./git-branch-B8JNwQ6q.js";import{F as js}from"./file-text-Ds9edaTZ.js";import{F as ks}from"./file-D80JE_L0.js";/**
2
- * @license lucide-react v1.48.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const bt={name:"bookmark",size:24,node:[["path",{d:"M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z",key:"oz39mx"}]]};bt.node;const Ns=A(bt);/**
7
- * @license lucide-react v1.48.0 - ISC
8
- *
9
- * This source code is licensed under the ISC license.
10
- * See the LICENSE file in the root directory of this source tree.
11
- */const vt={name:"circle-check-big",size:24,node:[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],aliases:["check-circle"]};vt.node;const ws=A(vt);/**
12
- * @license lucide-react v1.48.0 - ISC
13
- *
14
- * This source code is licensed under the ISC license.
15
- * See the LICENSE file in the root directory of this source tree.
16
- */const jt={name:"cloud",size:24,node:[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]};jt.node;const Ss=A(jt);/**
17
- * @license lucide-react v1.48.0 - ISC
18
- *
19
- * This source code is licensed under the ISC license.
20
- * See the LICENSE file in the root directory of this source tree.
21
- */const kt={name:"code",size:24,node:[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]};kt.node;const Cs=A(kt);/**
22
- * @license lucide-react v1.48.0 - ISC
23
- *
24
- * This source code is licensed under the ISC license.
25
- * See the LICENSE file in the root directory of this source tree.
26
- */const Nt={name:"cog",size:24,node:[["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["circle",{cx:"12",cy:"12",r:"8",key:"46899m"}]]};Nt.node;const _s=A(Nt);/**
27
- * @license lucide-react v1.48.0 - ISC
28
- *
29
- * This source code is licensed under the ISC license.
30
- * See the LICENSE file in the root directory of this source tree.
31
- */const wt={name:"coins",size:24,node:[["path",{d:"M13.744 17.736a6 6 0 1 1-7.48-7.48",key:"bq4yh3"}],["path",{d:"M15 6h1v4",key:"11y1tn"}],["path",{d:"m6.134 14.768.866-.5 2 3.464",key:"17snzx"}],["circle",{cx:"16",cy:"8",r:"6",key:"14bfc9"}]]};wt.node;const Is=A(wt);/**
32
- * @license lucide-react v1.48.0 - ISC
33
- *
34
- * This source code is licensed under the ISC license.
35
- * See the LICENSE file in the root directory of this source tree.
36
- */const St={name:"database",size:24,node:[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]};St.node;const As=A(St);/**
37
- * @license lucide-react v1.48.0 - ISC
38
- *
39
- * This source code is licensed under the ISC license.
40
- * See the LICENSE file in the root directory of this source tree.
41
- */const Ct={name:"dice-1",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["path",{d:"M12 12h.01",key:"1mp3jc"}]]};Ct.node;const $s=A(Ct);/**
42
- * @license lucide-react v1.48.0 - ISC
43
- *
44
- * This source code is licensed under the ISC license.
45
- * See the LICENSE file in the root directory of this source tree.
46
- */const _t={name:"dice-2",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["path",{d:"M15 9h.01",key:"x1ddxp"}],["path",{d:"M9 15h.01",key:"fzyn71"}]]};_t.node;const Ms=A(_t);/**
47
- * @license lucide-react v1.48.0 - ISC
48
- *
49
- * This source code is licensed under the ISC license.
50
- * See the LICENSE file in the root directory of this source tree.
51
- */const It={name:"dice-3",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["path",{d:"M16 8h.01",key:"cr5u4v"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]};It.node;const Ts=A(It);/**
52
- * @license lucide-react v1.48.0 - ISC
53
- *
54
- * This source code is licensed under the ISC license.
55
- * See the LICENSE file in the root directory of this source tree.
56
- */const At={name:"dice-4",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["path",{d:"M16 8h.01",key:"cr5u4v"}],["path",{d:"M8 8h.01",key:"1e4136"}],["path",{d:"M8 16h.01",key:"18s6g9"}],["path",{d:"M16 16h.01",key:"1f9h7w"}]]};At.node;const Es=A(At);/**
57
- * @license lucide-react v1.48.0 - ISC
58
- *
59
- * This source code is licensed under the ISC license.
60
- * See the LICENSE file in the root directory of this source tree.
61
- */const $t={name:"dice-5",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["path",{d:"M16 8h.01",key:"cr5u4v"}],["path",{d:"M8 8h.01",key:"1e4136"}],["path",{d:"M8 16h.01",key:"18s6g9"}],["path",{d:"M16 16h.01",key:"1f9h7w"}],["path",{d:"M12 12h.01",key:"1mp3jc"}]]};$t.node;const Ls=A($t);/**
62
- * @license lucide-react v1.48.0 - ISC
63
- *
64
- * This source code is licensed under the ISC license.
65
- * See the LICENSE file in the root directory of this source tree.
66
- */const Mt={name:"dice-6",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["path",{d:"M16 8h.01",key:"cr5u4v"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M16 16h.01",key:"1f9h7w"}],["path",{d:"M8 8h.01",key:"1e4136"}],["path",{d:"M8 12h.01",key:"czm47f"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]};Mt.node;const Ds=A(Mt);/**
67
- * @license lucide-react v1.48.0 - ISC
68
- *
69
- * This source code is licensed under the ISC license.
70
- * See the LICENSE file in the root directory of this source tree.
71
- */const Tt={name:"dices",size:24,node:[["rect",{width:"12",height:"12",x:"2",y:"10",rx:"2",ry:"2",key:"6agr2n"}],["path",{d:"m17.92 14 3.5-3.5a2.24 2.24 0 0 0 0-3l-5-4.92a2.24 2.24 0 0 0-3 0L10 6",key:"1o487t"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"M10 14h.01",key:"ssrbsk"}],["path",{d:"M15 6h.01",key:"cblpky"}],["path",{d:"M18 9h.01",key:"2061c0"}]]};Tt.node;const Os=A(Tt);/**
72
- * @license lucide-react v1.48.0 - ISC
73
- *
74
- * This source code is licensed under the ISC license.
75
- * See the LICENSE file in the root directory of this source tree.
76
- */const Et={name:"flag",size:24,node:[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]]};Et.node;const Rs=A(Et);/**
77
- * @license lucide-react v1.48.0 - ISC
78
- *
79
- * This source code is licensed under the ISC license.
80
- * See the LICENSE file in the root directory of this source tree.
81
- */const Lt={name:"house",size:24,node:[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],aliases:["home"]};Lt.node;const zs=A(Lt);/**
82
- * @license lucide-react v1.48.0 - ISC
83
- *
84
- * This source code is licensed under the ISC license.
85
- * See the LICENSE file in the root directory of this source tree.
86
- */const Dt={name:"map-pin",size:24,node:[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]};Dt.node;const Ws=A(Dt);/**
87
- * @license lucide-react v1.48.0 - ISC
88
- *
89
- * This source code is licensed under the ISC license.
90
- * See the LICENSE file in the root directory of this source tree.
91
- */const Ot={name:"rocket",size:24,node:[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]]};Ot.node;const Ps=A(Ot);/**
92
- * @license lucide-react v1.48.0 - ISC
93
- *
94
- * This source code is licensed under the ISC license.
95
- * See the LICENSE file in the root directory of this source tree.
96
- */const Rt={name:"tag",size:24,node:[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]};Rt.node;const Bs=A(Rt);/**
97
- * @license lucide-react v1.48.0 - ISC
98
- *
99
- * This source code is licensed under the ISC license.
100
- * See the LICENSE file in the root directory of this source tree.
101
- */const zt={name:"trending-down",size:24,node:[["path",{d:"M16 17h6v-6",key:"t6n2it"}],["path",{d:"m22 17-8.5-8.5-5 5L2 7",key:"x473p"}]]};zt.node;const Fs=A(zt);/**
102
- * @license lucide-react v1.48.0 - ISC
103
- *
104
- * This source code is licensed under the ISC license.
105
- * See the LICENSE file in the root directory of this source tree.
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 Us=A(Wt),Pt=x.createContext(void 0),Gs=Pt.Provider;function Hs(){return x.useContext(Pt)}const Ks=/[\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(Ks," ").trim(),n)}const te="ui_action";function Ys(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
- ${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 Vs=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]),Ie=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 Qs(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 Xs=E(Qs,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"}),Vs),Js=E(q({vertical:"vertical",vert:"vertical",column:"vertical",col:"vertical",stack:"vertical",horizontal:"horizontal",horiz:"horizontal",row:"horizontal",inline:"horizontal"}),F(["vertical","horizontal"])),Zs=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"])),ea=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"])),ta=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"])),na=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)])),sa=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:ta.default("flat")})),aa=E(e=>typeof e=="string"?{text:e}:e,g({text:f(),tone:Oe.optional()})),ra=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()),ia=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"])),oa=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"])),ca=E(e=>typeof e=="number"?String(e):e,f()),He=12;function la(e){return typeof e!="string"?e:e.trim()===""?{}:{glyph:e}}const da=f().max(8).optional().transform(e=>{const n=e==null?void 0:e.trim();return n||void 0}),ua=E(la,g({glyph:da,icon:f().optional(),tone:Oe.optional(),action:Ie.optional()})),pa=E(e=>Array.isArray(e)?e.slice(0,He).map(n=>Array.isArray(n)?n.slice(0,He):n):e,$($(ua))),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:Js,gap:Xs.optional(),children:$(ie)}),g({type:k("card"),title:f().optional(),description:f().optional(),children:$(ie),footer:$(ie).optional()}),g({type:k("divider")}),g({type:k("heading"),text:f(),level:na.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:sa.optional(),hint:f().optional(),trend:$(ee().finite()).max(50).optional()}),g({type:k("keyValue"),items:$(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:$(g({key:f(),label:f(),align:F(["left","center","right"]).optional()})),rows:$(st(f(),Fe))}),g({type:k("list"),items:$(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:aa.optional(),actions:$(Ie).optional()}))}),g({type:k("chart"),bind:X.chart.optional(),kind:ea,data:$(g({label:f(),value:ee().finite().min(0)})),height:ee().finite().positive().optional()}),g({type:k("button"),label:f(),variant:Zs.optional(),action:Ie}),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:$(g({label:f(),value:f()}))}),g({type:k("form"),children:$(ie),submit:g({label:f(),action:Be})}),g({type:k("timeline"),items:$(g({time:f().optional(),title:f(),subtitle:f().optional(),icon:f().optional(),status:ra.optional()})).min(1)}),g({type:k("checklist"),items:$(g({label:f(),checked:Ge.optional(),note:f().optional()})),action:Be.optional(),submitLabel:f().optional()}),g({type:k("compare"),options:$(g({name:f(),recommended:Ge.optional()})).min(1),rows:$(g({label:f(),values:$(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:ia,message:f().optional()}),g({type:k("board"),rows:pa,label:f().optional()}),g({type:k("reveal"),kind:oa,result:ca,label:f().optional()})]))),ma=g({version:k(1),title:f().optional(),root:ie});function Ae(e){return e.some(n=>gn(n,"widget.action"))}const fa=100,ha=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 xa(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 I=l=>[...r.current.values()].some(d=>d.value.controlId===l&&!d.retired&&["sending","retry","review"].includes(d.value.phase)),M=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())},ha),!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||Ae(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)||I(d))return;const T=l.kind==="agent";if(T&&!Ae(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||I(d))return;if(r.current.size>=fa){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||I(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 M(K)},pending:I,records:s,retry:l=>{const d=r.current.get(l);return d&&d.uncertain&&(d.value.phase==="retry"||d.value.phase==="sending")?M(d,!0):Promise.resolve()}}}const Ht=x.createContext("root"),ga=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 ya({children:e,channel:n,sessionId:s,widgetTitle:a,isLatestMessage:r=!0}){const{setTheme:i}=yn(),o=bn(),c=xa(n,a),[p,u]=x.useState(null),[m,h]=x.useState(null),j=x.useRef(!1),w=x.useCallback(async(b,I)=>{if(b.kind==="emit"||n&&b.kind==="agent"){await c.dispatch(b,(I==null?void 0:I.controlId)??"root");return}switch(b.kind){case"ui":{if(!s&&!at(b.command))return;const M={getStore:jn.getState,setTheme:i,supportsTerminal:o.supportsTerminal,celebrationOrigin:I==null?void 0:I.origin,sessionId:s};kn(M,b.command,"user");return}case"url":u(b.href);return;case"agent":{if(!s||j.current)return;j.current=!0;const M={actionId:b.id,payload:b.payload,widgetTitle:a},C=Ne.getState();C.setOptimisticUserMessage(s,{id:crypto.randomUUID(),content:Ys(M)}),C.setTriggerPending(s,!0);const S=Kt(b);h({key:S,status:"pending"});try{await o.sendUiAction(s,M),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"&&!Ae(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={type:"spring",stiffness:400,damping:32,mass:.8},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!Sn()}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=ls(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"]),ba={text:["text"],stat:["value"],progress:["value","label"],table:["rows"],chart:["data"]},va=100,Ye=50,ja=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 ka(e,n){if(!ne(e)||!Cn.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=ja){return typeof e=="string"&&e.length<=n}function fe(e){return typeof e=="number"&&Number.isFinite(e)}function Na(e){return e===null||typeof e=="boolean"||fe(e)||oe(e)}function wa(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>va)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(!Na(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 Sa(e,n){if(!("bind"in e)||e.bind===void 0)return{node:e};const s=ba[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=wa(e,o,ka(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),Ca=Xt.Provider;function Jt(){return x.useContext(Xt)}const _a={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 _a[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 Aa(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 Ma({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 Ta({node:e}){return t.jsx(gs,{content:e.text,className:"text-sm"})}function Ea({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 La(){return t.jsx($n,{})}const Da={up:An,down:In,flat:rt},Oa={up:"text-status-success",down:"text-status-error",flat:"text-muted-foreground"};function Ra({node:e}){const n=L(),s=Ia(e.value),a=qt((s==null?void 0:s.value)??0,n&&s!==null),r=s?Aa(s,a):String(e.value),i=e.delta?Da[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",Oa[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(za,{values:e.trend})]}),e.hint&&t.jsx("span",{className:"text-muted-foreground text-xs",children:e.hint})]})}function za({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 Wa({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 Pa({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 Ba({node:e}){return t.jsxs("figure",{className:"flex flex-col gap-1",children:[t.jsx(_n,{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 Fa=y.create(yt),Ua=y.create(be),Ve={left:"text-left",center:"text-center",right:"text-right"};function Ga(e){return e===null?"—":typeof e=="boolean"?e?"Yes":"No":String(e)}function Ha({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(Fa,{variants:n?ve:void 0,initial:n?"hidden":!1,animate:n?"visible":!1,children:e.rows.map((s,a)=>t.jsx(Ua,{variants:n?de:void 0,children:e.columns.map(r=>t.jsx(_e,{className:N("tabular-nums",r.align&&Ve[r.align]),children:Ga(s[r.key]??null)},r.key))},a))})]})})}const Ka={"alert-circle":Xn,"alert-triangle":ot,archive:Qn,"arrow-right":rt,bell:qn,bookmark:Ns,calendar:Vn,check:Le,"check-circle":ws,circle:Se,clock:Yn,cloud:Ss,code:Cs,cog:_s,database:As,file:ks,"file-text":js,flag:Rs,folder:Kn,"git-branch":vs,globe:Hn,heart:bs,home:zs,info:Gn,link:Un,lock:Fn,mail:Bn,"map-pin":Ws,"message-square":Pn,package:ys,play:Wn,rocket:Ps,search:zn,server:xs,settings:Rn,star:it,tag:Bs,terminal:On,"thumbs-up":Dn,trash:Ln,"trending-down":Fs,"trending-up":Us,user:En,users:Tn,zap:Mn};function We(e){if(!e)return Se;const n=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/\s+/g,"-").toLowerCase();return Ka[n]??Se}function Ya(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}: `:"",Ya(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,I=j&&h.interactive,M=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:M,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})]})}):!I&&!m?S:t.jsx(y.div,{className:N("inline-flex",a&&"w-full"),whileHover:{scale:1.02},transition:U,children:S})}function Va({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 Qa({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 Xa({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":Ja(o)},c))})]},r)})})}function Ja(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))"],Za=180,er=.15;function tr({node:e}){const n=e.height??Za,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(sr,{data:e.data,height:n,label:s}):e.kind==="pie"?t.jsx(ir,{data:e.data,height:n,label:s}):t.jsx(ar,{data:e.data,height:n,area:e.kind==="area",label:s})}const nr=18;function sr({data:e,height:n,label:s}){const a=L(),r=Math.max(...e.map(o=>o.value),0)||1,i=Math.max(0,n-nr);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 ar({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:er}),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 rr=359.99;function ir({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>=rr;return{d:o,full:h,path:h?"":or(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 or(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 cr={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 lr({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",cr[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 dr({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 ur=y.create(yt),pr=y.create(be);function mr({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 fr({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(ur,{variants:n?ve:void 0,initial:n?"hidden":!1,animate:n?"visible":!1,children:e.rows.map((s,a)=>t.jsxs(pr,{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(mr,{value:s.values[i]??null})},i))]},a))})]})})}const $e=5,hr=Array.from({length:$e});function Qe({className:e}){return t.jsx("div",{className:"flex","aria-hidden":!0,children:hr.map((n,s)=>t.jsx(it,{className:N("size-4",e)},s))})}function xr({node:e}){const n=L(),s=e.value/$e*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 ${$e}`,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 gr=7.4,yr=[1,.1,1,1,.1,1,.1,1,1],br=[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:yr.map(u=>u*p)}:{scaleY:p}}:void 0,transition:o?{scale:{type:"spring",stiffness:500,damping:15},...c?{scaleY:{duration:gr,times:br,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 vr({motionOn:e}){return t.jsx(tn,{x:47,y:13,motionOn:e,duration:3.4,repeatDelay:2.6})}function jr({motionOn:e}){return t.jsx(tn,{x:24,y:30,motionOn:e,duration:3.6,repeatDelay:3.2})}function kr({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 Nr({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 wr({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 Sr(){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 Cr({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(vr,{motionOn:e}),t.jsx("path",{d:"M23 42 Q27.5 39.5 32 42 T41 42",...re,strokeWidth:2.5})]})}function _r({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(kr,{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 Ar({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(jr,{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 Mr({emotion:e,motionOn:n}){switch(e){case"happy":return t.jsx(Nr,{motionOn:n});case"thinking":return t.jsx(wr,{motionOn:n});case"celebrating":return t.jsx(Sr,{});case"sheepish":return t.jsx(Cr,{motionOn:n});case"determined":return t.jsx(_r,{motionOn:n});case"surprised":return t.jsx(Ir,{motionOn:n});case"sad":return t.jsx(Ar,{motionOn:n});case"love":return t.jsx($r,{motionOn:n})}}const Tr={initial:{opacity:0,scale:.5},animate:{opacity:1,scale:1},transition:{type:"spring",stiffness:380,damping:16,mass:.9}},Er={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"}}},Lr={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 Dr({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=Er[e.emotion]??Tr,i=Lr[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(Mr,{emotion:e.emotion,motionOn:n})})})}),e.emotion==="thinking"&&t.jsx(Or,{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 Or({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 Rr=2,zr=5;function et(e){var s;const n=(s=e==null?void 0:e.glyph)==null?void 0:s.trim();return n||null}function Wr(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 Pr(e){const n=e.length;if(n<Rr||n>zr||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=Wr(e,a);if(r)return{glyph:r,cells:a}}return null}function Br(e,n,s){return e!==null&&e.cells.some(a=>a.row===n&&a.col===s)}const Fr=new Set(["."," ","-","_"]),nn=".";function Ur(e,n){const s=i=>i.map(o=>Fr.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 Gr(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=Ur(s[r],n[r].length);if(!i)return null;a.push(i)}return a}function Hr(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 Kr(e,n){const s=new Map;for(const r of e){const i=Gr(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 Yr(e){const n=Hr(e);if(n.length===0)return e;const s=Kr(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,Vr=.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 Me={className:"stroke-current",fill:"none",strokeWidth:2.75,strokeLinecap:"round"};function Qr({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,{...Me,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,{...Me,d:"M17 7 L7 17",initial:e?{pathLength:0}:!1,animate:e?{pathLength:1}:!1,transition:e?s(tt):void 0})]})}function Xr({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,{...Me,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:Vr,ease:ae}:void 0})})}function Jr({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(Jr,{motionOn:n});const a=an(e);return a==="x"?t.jsx(Qr,{motionOn:n,colorClass:s}):a==="o"?t.jsx(Xr,{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 Zr({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 ei({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."})})},I=(()=>{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 M=null;h.superseded?M="This board is from an earlier turn. Play on the newest one.":h.unavailable?M=m?"This document action is not available or needs approval.":"Interactions aren’t available here":h.latched&&(M="Move sent. Waiting for the agent’s reply");const C=t.jsxs(y.button,{type:"button","aria-label":I,"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(ti,{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:M?t.jsx(lt,{children:t.jsxs(dt,{children:[t.jsx(ut,{asChild:!0,children:C}),t.jsx(pt,{children:M})]})}):C})}function ti({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 ni(e){return e.cell.action?t.jsx(ei,{...e,cell:e.cell}):t.jsx(Zr,{...e})}const nt=.28,si=.3,ai=.12,ri=.8;function me(e,n,s){return e*(n+s)+n/2}function ii({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*ai,strokeOpacity:ri,strokeLinecap:"round",initial:i?{pathLength:0,opacity:0}:!1,animate:i?{pathLength:1,opacity:1}:!1,transition:i?{pathLength:{duration:si,ease:ae,delay:nt},opacity:{duration:.12,delay:nt}}:void 0})})}const oi={},ci=.02,li={hidden:{},visible:{transition:{staggerChildren:ci}}};function di(e,n,s,a){return e?Br(e,n,s)?"winner":a.glyph?"loser":"none":"none"}const ui=4,pi=3.25,mi=2.5,fi=.25,hi={default:"text-status-success",success:"text-status-success",warning:"text-status-warning",error:"text-status-error",info:"text-status-info"};function xi({node:e}){var w,_;const n=L(),{latched:s,superseded:a,channel:r}=le(),i=Q(),o=Yr(e.rows),c=Math.max(1,...o.map(b=>b.length)),p=c<=ui?pi:mi,u=Pr(o),m=u?((_=(w=o[u.cells[0].row])==null?void 0:w[u.cells[0].col])==null?void 0:_.tone)??"default":"default",h=hi[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?li:void 0,initial:n?"hidden":!1,animate:n?"visible":!1,children:o.map((b,I)=>t.jsx("div",{role:"row",className:"contents",children:Array.from({length:c},(M,C)=>{const S=b[C]??oi,l=!S.glyph&&S.icon?We(S.icon):null,d=di(u,I,C,S);return t.jsx(ni,{cell:S,icon:l,motionOn:n,row:I,col:C,winRole:d},`${I}-${C}`)})},I))}),u&&t.jsx(ii,{win:u,size:c,cellUnit:p,gapUnit:fi,colorClass:h,motionOn:n})]}),t.jsx(Zt,{controlId:i,descendants:!0})]})}const gi=1.2,yi={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"},bi=[$s,Ms,Ts,Es,Ls,Ds];function vi(e){const n={duration:gi,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 ji({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?bi[s-1]:Os;return t.jsx(a,{className:"size-7","aria-hidden":!0})}}}function ki({node:e}){const n=L(),[s,a]=x.useState(0),[r,i]=x.useState(!n),{animate:o,transition:c}=vi(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",yi[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(ji,{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 Ni={sm:"gap-2",md:"gap-3",lg:"gap-5"};function ce({node:e,path:n="root"}){return t.jsx(ga,{value:n,children:t.jsx(wi,{node:e})})}function wi({node:e}){const n=Hs();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=Sa(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(Si,{node:a});case"card":return t.jsx(Ci,{node:a});case"form":return t.jsx(_i,{node:a});case"divider":return t.jsx(La,{});case"heading":return t.jsx(Ma,{node:a});case"text":return t.jsx(Ta,{node:a});case"badge":return t.jsx(Ea,{node:a});case"stat":return t.jsx(Ra,{node:a});case"keyValue":return t.jsx(Wa,{node:a});case"progress":return t.jsx(Pa,{node:a});case"image":return t.jsx(Ba,{node:a});case"table":return t.jsx(Ha,{node:a});case"list":return t.jsx(Xa,{node:a});case"chart":return t.jsx(tr,{node:a});case"timeline":return t.jsx(lr,{node:a});case"checklist":return t.jsx(dr,{node:a});case"compare":return t.jsx(fr,{node:a});case"rating":return t.jsx(xr,{node:a});case"mood":return t.jsx(Dr,{node:a});case"board":return t.jsx(xi,{node:a});case"reveal":return t.jsx(ki,{node:a});case"button":return t.jsx(Va,{node:a});case"input":return t.jsx(qa,{node:a});case"select":return t.jsx(Qa,{node:a});default:return t.jsx(Ii,{nodeType:a.type})}}function Si({node:e}){const n=Q();return t.jsx("div",{className:N("flex",e.direction==="horizontal"?"flex-row flex-wrap items-start":"flex-col",Ni[e.gap??"md"]),children:e.children.map((s,a)=>t.jsx(ce,{path:`${n}.children.${a}`,node:s},a))})}function Ci({node:e}){const n=Q(),s=!!(e.title||e.description);return t.jsxs(ht,{className:"shadow-soft",children:[s&&t.jsxs(ds,{children:[e.title&&t.jsx(us,{children:e.title}),e.description&&t.jsx(ps,{children:e.description})]}),t.jsx(ms,{children:e.children.map((a,r)=>t.jsx(ce,{path:`${n}.children.${r}`,node:a},r))}),e.footer&&e.footer.length>0&&t.jsx(fs,{children:e.footer.map((a,r)=>t.jsx(ce,{path:`${n}.footer.${r}`,node:a},r))})]})}function _i({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(Ca,{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 Fi({document:e,sessionId:n,isLatestMessage:s,channel:a}){const r=L();return t.jsx(ya,{channel:a,sessionId:n,widgetTitle:e.title,isLatestMessage:s,children:t.jsx(Gs,{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 Ai(e,n){const s=ma.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 Ui(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 Ai(n,e)}function $i(e){try{return JSON.stringify(e,null,2)??String(e)}catch{return String(e)}}function Gi({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(cs,{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{Gi as W,Fi as a,U as b,Ui as p,L as u,Ai as v};