agent-tower 0.7.4-beta.0 → 0.7.4

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 (218) hide show
  1. package/dist/mcp/tools/tasks.js +3 -3
  2. package/dist/mcp/tools/tasks.js.map +1 -1
  3. package/dist/mcp/types.js +2 -2
  4. package/dist/mcp/types.js.map +1 -1
  5. package/dist/prompts/task-handoff.d.ts.map +1 -1
  6. package/dist/prompts/task-handoff.js +2 -1
  7. package/dist/prompts/task-handoff.js.map +1 -1
  8. package/dist/routes/__tests__/sessions-runtime.test.js +2 -0
  9. package/dist/routes/__tests__/sessions-runtime.test.js.map +1 -1
  10. package/dist/routes/__tests__/tasks.test.js +41 -0
  11. package/dist/routes/__tests__/tasks.test.js.map +1 -1
  12. package/dist/routes/__tests__/workspace-history.test.d.ts +2 -0
  13. package/dist/routes/__tests__/workspace-history.test.d.ts.map +1 -0
  14. package/dist/routes/__tests__/workspace-history.test.js +174 -0
  15. package/dist/routes/__tests__/workspace-history.test.js.map +1 -0
  16. package/dist/routes/sessions.d.ts.map +1 -1
  17. package/dist/routes/sessions.js +10 -0
  18. package/dist/routes/sessions.js.map +1 -1
  19. package/dist/routes/tasks.d.ts.map +1 -1
  20. package/dist/routes/tasks.js +8 -0
  21. package/dist/routes/tasks.js.map +1 -1
  22. package/dist/runtime/__tests__/cli-driver-lifecycle.test.js +84 -0
  23. package/dist/runtime/__tests__/cli-driver-lifecycle.test.js.map +1 -1
  24. package/dist/runtime/cli-driver.js +11 -8
  25. package/dist/runtime/cli-driver.js.map +1 -1
  26. package/dist/services/__tests__/task.service.test.js +128 -13
  27. package/dist/services/__tests__/task.service.test.js.map +1 -1
  28. package/dist/services/__tests__/workspace.service.test.js +64 -5
  29. package/dist/services/__tests__/workspace.service.test.js.map +1 -1
  30. package/dist/services/message-delivery.service.d.ts +1 -0
  31. package/dist/services/message-delivery.service.d.ts.map +1 -1
  32. package/dist/services/session-manager.d.ts +4 -0
  33. package/dist/services/session-manager.d.ts.map +1 -1
  34. package/dist/services/session-manager.js +3 -1
  35. package/dist/services/session-manager.js.map +1 -1
  36. package/dist/services/session-resource-cleanup.d.ts +5 -0
  37. package/dist/services/session-resource-cleanup.d.ts.map +1 -1
  38. package/dist/services/session-resource-cleanup.js +7 -0
  39. package/dist/services/session-resource-cleanup.js.map +1 -1
  40. package/dist/services/task-cleanup.service.d.ts +2 -0
  41. package/dist/services/task-cleanup.service.d.ts.map +1 -1
  42. package/dist/services/task-cleanup.service.js +4 -0
  43. package/dist/services/task-cleanup.service.js.map +1 -1
  44. package/dist/services/task-display-state.d.ts +10 -0
  45. package/dist/services/task-display-state.d.ts.map +1 -0
  46. package/dist/services/task-display-state.js +45 -0
  47. package/dist/services/task-display-state.js.map +1 -0
  48. package/dist/services/task.service.d.ts +20 -1
  49. package/dist/services/task.service.d.ts.map +1 -1
  50. package/dist/services/task.service.js +134 -101
  51. package/dist/services/task.service.js.map +1 -1
  52. package/dist/services/workspace.service.d.ts +10 -7
  53. package/dist/services/workspace.service.d.ts.map +1 -1
  54. package/dist/services/workspace.service.js +160 -88
  55. package/dist/services/workspace.service.js.map +1 -1
  56. package/dist/web/assets/{AgentDemoPage-JXetlNBf.js → AgentDemoPage-D9bIiALx.js} +1 -1
  57. package/dist/web/assets/{AgentEnvironmentSettingsPage-CdYyUCwJ.js → AgentEnvironmentSettingsPage-BE0RC6fR.js} +1 -1
  58. package/dist/web/assets/{AttachmentPreview-DMS-PM-1.js → AttachmentPreview-TPd4gdfb.js} +2 -2
  59. package/dist/web/assets/{BranchSelect-BAq4L2ZS.js → BranchSelect-Kv3M1YhZ.js} +1 -1
  60. package/dist/web/assets/{BrandLogo--kWXXJtZ.js → BrandLogo-fR2lCwEo.js} +1 -1
  61. package/dist/web/assets/{ConversationPage-CvC4RyB5.js → ConversationPage-BZiMHI9T.js} +1 -1
  62. package/dist/web/assets/{CreateTaskInput-DjVxCAfc.js → CreateTaskInput-TcZpjBe-.js} +1 -1
  63. package/dist/web/assets/{DemoPage-cDVTGOp8.js → DemoPage-DwpThe16.js} +1 -1
  64. package/dist/web/assets/{DesignSystemPage-BI54IkKi.js → DesignSystemPage-DH9_cygJ.js} +1 -1
  65. package/dist/web/assets/{ExecutionPermissionSelector-f1UYIm1z.js → ExecutionPermissionSelector-C-akTOVg.js} +1 -1
  66. package/dist/web/assets/{GeneralSettingsPage-C0yto6C_.js → GeneralSettingsPage-v2w1eofz.js} +1 -1
  67. package/dist/web/assets/{LoadingPreviewPage-BiJSaHUi.js → LoadingPreviewPage-pgk3PWM9.js} +1 -1
  68. package/dist/web/assets/{McpSettingsPage-BbHwZtyj.js → McpSettingsPage-w1DOlY5V.js} +1 -1
  69. package/dist/web/assets/{MemberAvatar-BLezO3vS.js → MemberAvatar-CJtylxwu.js} +1 -1
  70. package/dist/web/assets/MobileTaskDetail-D5Czlr2O.js +3 -0
  71. package/dist/web/assets/{NotificationSettingsPage-CiKoL2Kv.js → NotificationSettingsPage-CkLg4WvT.js} +1 -1
  72. package/dist/web/assets/{ProfileSettingsPage-DCB48cPS.js → ProfileSettingsPage-B3yzbY1V.js} +1 -1
  73. package/dist/web/assets/ProjectKanbanPage-CuGSLvrU.js +14 -0
  74. package/dist/web/assets/{ProjectSettingsPage-COvIVq1h.js → ProjectSettingsPage-DoklOfna.js} +1 -1
  75. package/dist/web/assets/{ProviderSettingsPage-CPuJcZDg.js → ProviderSettingsPage-Cm0hbX5n.js} +2 -2
  76. package/dist/web/assets/{SettingsMasterDetail-Cv7YaRJB.js → SettingsMasterDetail-CGCUalkW.js} +1 -1
  77. package/dist/web/assets/TaskDetail-BiZbuXcE.js +1 -0
  78. package/dist/web/assets/{TaskHandoffPanel-CxH3Mgyd.js → TaskHandoffPanel-CJahUKNo.js} +24 -24
  79. package/dist/web/assets/{TeamSettingsPage-D-XDefNd.js → TeamSettingsPage-CyppRTaY.js} +1 -1
  80. package/dist/web/assets/{TranslationSettingsPage-BPHI-SZW.js → TranslationSettingsPage-BoQXEZmn.js} +1 -1
  81. package/dist/web/assets/{arc-CC81aLuf.js → arc-5NPBSbiL.js} +1 -1
  82. package/dist/web/assets/{architectureDiagram-3BPJPVTR-DL08XGaN.js → architectureDiagram-3BPJPVTR-CqPT-IsX.js} +1 -1
  83. package/dist/web/assets/{at-sign-DYPIlD6D.js → at-sign-Cf39WHCg.js} +1 -1
  84. package/dist/web/assets/{blockDiagram-GPEHLZMM-B4IW5WxI.js → blockDiagram-GPEHLZMM-BN-1z9KN.js} +1 -1
  85. package/dist/web/assets/{c4Diagram-AAUBKEIU-Cj4d_FqK.js → c4Diagram-AAUBKEIU-CkeLbmQp.js} +1 -1
  86. package/dist/web/assets/channel-CDkuQ_7m.js +1 -0
  87. package/dist/web/assets/check-yNWhPvMH.js +1 -0
  88. package/dist/web/assets/{chevron-down-DNhYsNAt.js → chevron-down-Ct7FZbKm.js} +1 -1
  89. package/dist/web/assets/{chevron-up-CjrLieBR.js → chevron-up-ARFlXMyO.js} +1 -1
  90. package/dist/web/assets/{chip-Cf92J-pQ.js → chip-BV_1-tIb.js} +1 -1
  91. package/dist/web/assets/{chunk-2J33WTMH-DeCj8QSD.js → chunk-2J33WTMH-CWR7tRuT.js} +1 -1
  92. package/dist/web/assets/{chunk-4BX2VUAB-k-6rzQmQ.js → chunk-4BX2VUAB-CAulp4D5.js} +1 -1
  93. package/dist/web/assets/{chunk-55IACEB6-qMTCQ5bX.js → chunk-55IACEB6-DqkKXsbD.js} +1 -1
  94. package/dist/web/assets/{chunk-727SXJPM-CMnu18d1.js → chunk-727SXJPM-B19m45Sq.js} +1 -1
  95. package/dist/web/assets/{chunk-AQP2D5EJ-C0mFbUMn.js → chunk-AQP2D5EJ-CuODwkza.js} +1 -1
  96. package/dist/web/assets/{chunk-FMBD7UC4-u6-_M137.js → chunk-FMBD7UC4-CbUAjtCT.js} +1 -1
  97. package/dist/web/assets/{chunk-ND2GUHAM-DHrIE_8H.js → chunk-ND2GUHAM-C54VxArl.js} +1 -1
  98. package/dist/web/assets/{chunk-QZHKN3VN-aTyC0wZq.js → chunk-QZHKN3VN-D54Uw5fD.js} +1 -1
  99. package/dist/web/assets/classDiagram-4FO5ZUOK-eHY73FGu.js +1 -0
  100. package/dist/web/assets/classDiagram-v2-Q7XG4LA2-eHY73FGu.js +1 -0
  101. package/dist/web/assets/{code-block-OCS4YCEC-CBIOQOMH.js → code-block-OCS4YCEC-CtAySD1h.js} +1 -1
  102. package/dist/web/assets/{confirm-dialog-DWeBZLJW.js → confirm-dialog-CCjHVFTv.js} +1 -1
  103. package/dist/web/assets/{content-JM9E1MeD.js → content-DZozZbBD.js} +2 -2
  104. package/dist/web/assets/{copy-D0gl9kF8.js → copy-C-jvx2et.js} +1 -1
  105. package/dist/web/assets/{cose-bilkent-S5V4N54A-xLyliSgU.js → cose-bilkent-S5V4N54A-BaB2EVcU.js} +1 -1
  106. package/dist/web/assets/{cssMode-DO5UnQ64.js → cssMode-wd7JR1S4.js} +1 -1
  107. package/dist/web/assets/{dagre-BM42HDAG-CbNpoO2d.js → dagre-BM42HDAG-C2j1Y8pO.js} +1 -1
  108. package/dist/web/assets/{diagram-2AECGRRQ-CG3hKxAX.js → diagram-2AECGRRQ-CF-EvpV9.js} +1 -1
  109. package/dist/web/assets/{diagram-5GNKFQAL-mQu9M28s.js → diagram-5GNKFQAL-rBNso835.js} +1 -1
  110. package/dist/web/assets/{diagram-KO2AKTUF-BSeEp_Uw.js → diagram-KO2AKTUF-6NW-oos1.js} +1 -1
  111. package/dist/web/assets/{diagram-LMA3HP47-D6yRdao-.js → diagram-LMA3HP47-DTfRxRLT.js} +1 -1
  112. package/dist/web/assets/{diagram-OG6HWLK6-BUBUW9wD.js → diagram-OG6HWLK6-CS4Ae-hD.js} +1 -1
  113. package/dist/web/assets/{dialog-D1lkhqVL.js → dialog-DV4wfpNU.js} +1 -1
  114. package/dist/web/assets/{erDiagram-TEJ5UH35-BQSZgRqq.js → erDiagram-TEJ5UH35-Dw9QQctN.js} +1 -1
  115. package/dist/web/assets/{file-BijjwxRR.js → file-Btui_I8Z.js} +1 -1
  116. package/dist/web/assets/{flowDiagram-I6XJVG4X-D-eqyr5Y.js → flowDiagram-I6XJVG4X-BGZ9q86S.js} +1 -1
  117. package/dist/web/assets/{folder-picker-Czxm0_S9.js → folder-picker-DiR-8Qdl.js} +1 -1
  118. package/dist/web/assets/{freemarker2-B4RvEa_U.js → freemarker2-yVWXzD3l.js} +1 -1
  119. package/dist/web/assets/{ganttDiagram-6RSMTGT7-BWGkCt_x.js → ganttDiagram-6RSMTGT7-CkGun0no.js} +1 -1
  120. package/dist/web/assets/{gitGraphDiagram-PVQCEYII-DGVc49pR.js → gitGraphDiagram-PVQCEYII-Bz3oiYvi.js} +1 -1
  121. package/dist/web/assets/{globe-Ce01-45x.js → globe-DAFqpAcW.js} +1 -1
  122. package/dist/web/assets/{handlebars-oyT7drqS.js → handlebars-BPf0z6eN.js} +1 -1
  123. package/dist/web/assets/{html-CxxWf2Qk.js → html-HCTCjfUg.js} +1 -1
  124. package/dist/web/assets/{htmlMode-RfAHh5Jj.js → htmlMode-BDkbsknt.js} +1 -1
  125. package/dist/web/assets/index-408ws6FY.css +1 -0
  126. package/dist/web/assets/{index-Dh-tgeaL.js → index-B8xoIIa6.js} +4 -4
  127. package/dist/web/assets/{index-T38iVLEb.js → index-BMcLxIvZ.js} +1 -1
  128. package/dist/web/assets/{index-DWrSDMX2.js → index-BPqjxXmH.js} +1 -1
  129. package/dist/web/assets/index-BszkzNS4.js +122 -0
  130. package/dist/web/assets/{index-DyJfPc4O.js → index-DgUtx9rV.js} +1 -1
  131. package/dist/web/assets/{index-Pt4TsHjm.js → index-DkSPjZm4.js} +1 -1
  132. package/dist/web/assets/{index-hpHE1jXY.js → index-DuM6iAxG.js} +1 -1
  133. package/dist/web/assets/{index-BMZFF1UJ.js → index-GuczxPxb.js} +1 -1
  134. package/dist/web/assets/{index-Disv1kQS.js → index-lZLy5rkr.js} +1 -1
  135. package/dist/web/assets/{infoDiagram-5YYISTIA-DLPs3dV_.js → infoDiagram-5YYISTIA-DYFufUYC.js} +1 -1
  136. package/dist/web/assets/{ishikawaDiagram-YF4QCWOH-d_OrnwDY.js → ishikawaDiagram-YF4QCWOH-IOkrKRwu.js} +1 -1
  137. package/dist/web/assets/javascript-DKmxrNeR.js +1 -0
  138. package/dist/web/assets/{journeyDiagram-JHISSGLW-EtU1st_0.js → journeyDiagram-JHISSGLW-Btl3yxne.js} +1 -1
  139. package/dist/web/assets/{jsonMode-Bqh5vIxx.js → jsonMode-DJPdvFcw.js} +1 -1
  140. package/dist/web/assets/{kanban-definition-UN3LZRKU-ZWzUnsFK.js → kanban-definition-UN3LZRKU-CDryhPbA.js} +1 -1
  141. package/dist/web/assets/{kbd-IjDGsZ2B.js → kbd-8RRRm9jd.js} +1 -1
  142. package/dist/web/assets/{key-round-CbnAuUxp.js → key-round-wojrCrDP.js} +1 -1
  143. package/dist/web/assets/{layers-Pdy9vZ6K.js → layers-BH_LL4b8.js} +1 -1
  144. package/dist/web/assets/{linear-D7n23wcA.js → linear-BLuwKHze.js} +1 -1
  145. package/dist/web/assets/{link-Bl1ZbjFh.js → link-jWQOSQOQ.js} +1 -1
  146. package/dist/web/assets/{liquid-Ds47iVLN.js → liquid-1y-xg637.js} +1 -1
  147. package/dist/web/assets/{lspLanguageFeatures-Dcch3bsp.js → lspLanguageFeatures-cYkILdCn.js} +1 -1
  148. package/dist/web/assets/{mdx-CM7ky-2B.js → mdx-CRg4Q6aP.js} +1 -1
  149. package/dist/web/assets/{menu-DubntFHq.js → menu-CMqbaDni.js} +1 -1
  150. package/dist/web/assets/{mermaid-NOHMQCX5-nBsnjgeU.js → mermaid-NOHMQCX5-CYeAhOl-.js} +4 -4
  151. package/dist/web/assets/{message-square-BE-pW0m_.js → message-square-DykJ2lWP.js} +1 -1
  152. package/dist/web/assets/{mindmap-definition-RKZ34NQL-ClHORNTt.js → mindmap-definition-RKZ34NQL-B5wtw1Rv.js} +1 -1
  153. package/dist/web/assets/{modal-CHLtZWvx.js → modal-BwOwTzij.js} +1 -1
  154. package/dist/web/assets/{monaco-BbAmalE2.js → monaco-CcHqpOKe.js} +3 -3
  155. package/dist/web/assets/{nav-row-DH7rNq1V.js → nav-row-BmtdNLxR.js} +1 -1
  156. package/dist/web/assets/{paperclip-YP3Bk1lI.js → paperclip-C4t49vX2.js} +1 -1
  157. package/dist/web/assets/{pencil-BFDuhbtW.js → pencil-BQ5_raiB.js} +1 -1
  158. package/dist/web/assets/{people-DEeNaaLt.js → people-Dr0v8HK0.js} +1 -1
  159. package/dist/web/assets/{pieDiagram-4H26LBE5-BUOaKIyP.js → pieDiagram-4H26LBE5-BZ3VoaNI.js} +1 -1
  160. package/dist/web/assets/{popover-CUmBEXxL.js → popover-CTqvKqTR.js} +1 -1
  161. package/dist/web/assets/{python-BODTtU6m.js → python-Huq_acyd.js} +1 -1
  162. package/dist/web/assets/{quadrantDiagram-W4KKPZXB-Caezg-U2.js → quadrantDiagram-W4KKPZXB-C6ArHmnG.js} +1 -1
  163. package/dist/web/assets/{razor-CHm8DY1p.js → razor-Clc87Ivb.js} +1 -1
  164. package/dist/web/assets/{requirementDiagram-4Y6WPE33-BtdP3Ka6.js → requirementDiagram-4Y6WPE33-DiLzBRQP.js} +1 -1
  165. package/dist/web/assets/{sankeyDiagram-5OEKKPKP-Bv74oA-n.js → sankeyDiagram-5OEKKPKP-QlYYd7IZ.js} +1 -1
  166. package/dist/web/assets/{search-ClmOQd4H.js → search-CMIAPUEt.js} +1 -1
  167. package/dist/web/assets/{select-CYtYPr-c.js → select-Bg7NI8i0.js} +1 -1
  168. package/dist/web/assets/{select-BB7QG08o.js → select-DqB7YF38.js} +1 -1
  169. package/dist/web/assets/{sequenceDiagram-3UESZ5HK-DuNPl-dg.js → sequenceDiagram-3UESZ5HK-COKEtqc0.js} +1 -1
  170. package/dist/web/assets/{server-bEB_DY55.js → server-D7knl8H9.js} +1 -1
  171. package/dist/web/assets/{stateDiagram-AJRCARHV-B72HAgBJ.js → stateDiagram-AJRCARHV-1RZZZdOe.js} +1 -1
  172. package/dist/web/assets/stateDiagram-v2-BHNVJYJU-CCLmVs34.js +1 -0
  173. package/dist/web/assets/{textarea-BqYPvoO-.js → textarea-BCY2J2ca.js} +1 -1
  174. package/dist/web/assets/{timeline-definition-PNZ67QCA-DTmHUgmQ.js → timeline-definition-PNZ67QCA-IJl1LY6J.js} +1 -1
  175. package/dist/web/assets/{toggles-a5fkwT_D.js → toggles-C4LmZwyo.js} +1 -1
  176. package/dist/web/assets/{tooltip-DuyJMci9.js → tooltip-Cirpotu3.js} +1 -1
  177. package/dist/web/assets/{track-DCjyrv3n.js → track-Cv7h6oaE.js} +1 -1
  178. package/dist/web/assets/{trash-2-CIyBqaVy.js → trash-2-BEOQ1ICJ.js} +1 -1
  179. package/dist/web/assets/{tsMode-C1UXAkMh.js → tsMode-CHIbCBQc.js} +1 -1
  180. package/dist/web/assets/{typescript-Biht2wHb.js → typescript-CScj0bbb.js} +1 -1
  181. package/dist/web/assets/{upload-D05XS5-G.js → upload-tLVD0xMT.js} +1 -1
  182. package/dist/web/assets/{use-profiles-CrWTyz1G.js → use-profiles-TkoP4Yw9.js} +1 -1
  183. package/dist/web/assets/{use-providers-Dv1Nk6s7.js → use-providers-Bz6YNiYj.js} +1 -1
  184. package/dist/web/assets/{use-translation-settings-CcUnipVO.js → use-translation-settings-CCpQNS30.js} +1 -1
  185. package/dist/web/assets/{useNormalizedLogs-D9W1cT4R.js → useNormalizedLogs-Bstb98cF.js} +1 -1
  186. package/dist/web/assets/{useTokenUsage-CZ5mDshD.js → useTokenUsage-D7SEwXb0.js} +1 -1
  187. package/dist/web/assets/{vennDiagram-CIIHVFJN-ByoNydXe.js → vennDiagram-CIIHVFJN-DzVayy4U.js} +1 -1
  188. package/dist/web/assets/{wardley-L42UT6IY-BqdMkOLl.js → wardley-L42UT6IY-CULSKh55.js} +1 -1
  189. package/dist/web/assets/{wardleyDiagram-YWT4CUSO-AO22HrEF.js → wardleyDiagram-YWT4CUSO-C5_h3lAA.js} +1 -1
  190. package/dist/web/assets/{xml-NLGqNFDv.js → xml-XuycSwh6.js} +1 -1
  191. package/dist/web/assets/{xychartDiagram-2RQKCTM6-vzPgjgqW.js → xychartDiagram-2RQKCTM6-F65naXcR.js} +1 -1
  192. package/dist/web/assets/{yaml-AWlGS_Ig.js → yaml-BWm159lw.js} +1 -1
  193. package/dist/web/index.html +2 -2
  194. package/node_modules/@agent-tower/shared/dist/index.d.ts +1 -0
  195. package/node_modules/@agent-tower/shared/dist/index.d.ts.map +1 -1
  196. package/node_modules/@agent-tower/shared/dist/index.js +1 -0
  197. package/node_modules/@agent-tower/shared/dist/index.js.map +1 -1
  198. package/node_modules/@agent-tower/shared/dist/task-hierarchy.d.ts +17 -0
  199. package/node_modules/@agent-tower/shared/dist/task-hierarchy.d.ts.map +1 -0
  200. package/node_modules/@agent-tower/shared/dist/task-hierarchy.js +12 -0
  201. package/node_modules/@agent-tower/shared/dist/task-hierarchy.js.map +1 -0
  202. package/node_modules/@agent-tower/shared/dist/types.d.ts +20 -4
  203. package/node_modules/@agent-tower/shared/dist/types.d.ts.map +1 -1
  204. package/node_modules/@agent-tower/shared/dist/types.js.map +1 -1
  205. package/package.json +1 -1
  206. package/prisma/migrations/20261027000000_preserve_workspace_history/migration.sql +2 -0
  207. package/prisma/schema.prisma +2 -0
  208. package/dist/web/assets/MobileTaskDetail-M_Kke9rL.js +0 -3
  209. package/dist/web/assets/ProjectKanbanPage-soDqevjQ.js +0 -12
  210. package/dist/web/assets/TaskDetail-CqhPxvg3.js +0 -1
  211. package/dist/web/assets/channel-CUa8oyzC.js +0 -1
  212. package/dist/web/assets/check-DaZqOL8l.js +0 -1
  213. package/dist/web/assets/classDiagram-4FO5ZUOK-BAx111NO.js +0 -1
  214. package/dist/web/assets/classDiagram-v2-Q7XG4LA2-BAx111NO.js +0 -1
  215. package/dist/web/assets/index-BN53vGxp.css +0 -1
  216. package/dist/web/assets/index-Cc3qXMhU.js +0 -122
  217. package/dist/web/assets/javascript-BNXtViSL.js +0 -1
  218. package/dist/web/assets/stateDiagram-v2-BHNVJYJU-Bu3l_CgB.js +0 -1
@@ -1 +1 @@
1
- import{c as e}from"./index-Cc3qXMhU.js";const r=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],i=e("server",r);export{i as S};
1
+ import{c as e}from"./index-BszkzNS4.js";const r=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],i=e("server",r);export{i as S};
@@ -1 +1 @@
1
- import{s as R,a as W,S as N}from"./chunk-AQP2D5EJ-C0mFbUMn.js";import{_ as f,c as t,d as H,l as S,e as P,k as z,a9 as _,aa as U,a6 as C,u as F}from"./index-Dh-tgeaL.js";import{G as O}from"./graph--OzhPTMs.js";import{l as J}from"./layout-SsrduOYp.js";import"./chunk-55IACEB6-qMTCQ5bX.js";import"./chunk-2J33WTMH-DeCj8QSD.js";import"./index-Cc3qXMhU.js";var X=f(e=>e.append("circle").attr("class","start-state").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit).attr("cy",t().state.padding+t().state.sizeUnit),"drawStartState"),D=f(e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",t().state.textHeight).attr("class","divider").attr("x2",t().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),Y=f((e,i)=>{const d=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+2*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),c=d.node().getBBox();return e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",c.width+2*t().state.padding).attr("height",c.height+2*t().state.padding).attr("rx",t().state.radius),d},"drawSimpleState"),I=f((e,i)=>{const d=f(function(o,B,y){const v=o.append("tspan").attr("x",2*t().state.padding).text(B);y||v.attr("dy",t().state.textHeight)},"addTspan"),n=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+1.3*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.descriptions[0]).node().getBBox(),l=n.height,p=e.append("text").attr("x",t().state.padding).attr("y",l+t().state.padding*.4+t().state.dividerMargin+t().state.textHeight).attr("class","state-description");let a=!0,s=!0;i.descriptions.forEach(function(o){a||(d(p,o,s),s=!1),a=!1});const m=e.append("line").attr("x1",t().state.padding).attr("y1",t().state.padding+l+t().state.dividerMargin/2).attr("y2",t().state.padding+l+t().state.dividerMargin/2).attr("class","descr-divider"),x=p.node().getBBox(),g=Math.max(x.width,n.width);return m.attr("x2",g+3*t().state.padding),e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",g+2*t().state.padding).attr("height",x.height+l+2*t().state.padding).attr("rx",t().state.radius),e},"drawDescrState"),$=f((e,i,d)=>{const c=t().state.padding,n=2*t().state.padding,l=e.node().getBBox(),p=l.width,a=l.x,s=e.append("text").attr("x",0).attr("y",t().state.titleShift).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),x=s.node().getBBox().width+n;let g=Math.max(x,p);g===p&&(g=g+n);let o;const B=e.node().getBBox();i.doc,o=a-c,x>p&&(o=(p-g)/2+c),Math.abs(a-B.x)<c&&x>p&&(o=a-(x-p)/2);const y=1-t().state.textHeight;return e.insert("rect",":first-child").attr("x",o).attr("y",y).attr("class",d?"alt-composit":"composit").attr("width",g).attr("height",B.height+t().state.textHeight+t().state.titleShift+1).attr("rx","0"),s.attr("x",o+c),x<=p&&s.attr("x",a+(g-n)/2-x/2+c),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",g).attr("height",t().state.textHeight*3).attr("rx",t().state.radius),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",g).attr("height",B.height+3+2*t().state.textHeight).attr("rx",t().state.radius),e},"addTitleAndBox"),q=f(e=>(e.append("circle").attr("class","end-state-outer").attr("r",t().state.sizeUnit+t().state.miniPadding).attr("cx",t().state.padding+t().state.sizeUnit+t().state.miniPadding).attr("cy",t().state.padding+t().state.sizeUnit+t().state.miniPadding),e.append("circle").attr("class","end-state-inner").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit+2).attr("cy",t().state.padding+t().state.sizeUnit+2)),"drawEndState"),Z=f((e,i)=>{let d=t().state.forkWidth,c=t().state.forkHeight;if(i.parentId){let n=d;d=c,c=n}return e.append("rect").style("stroke","black").style("fill","black").attr("width",d).attr("height",c).attr("x",t().state.padding).attr("y",t().state.padding)},"drawForkJoinState"),j=f((e,i,d,c)=>{let n=0;const l=c.append("text");l.style("text-anchor","start"),l.attr("class","noteText");let p=e.replace(/\r\n/g,"<br/>");p=p.replace(/\n/g,"<br/>");const a=p.split(z.lineBreakRegex);let s=1.25*t().state.noteMargin;for(const m of a){const x=m.trim();if(x.length>0){const g=l.append("tspan");if(g.text(x),s===0){const o=g.node().getBBox();s+=o.height}n+=s,g.attr("x",i+t().state.noteMargin),g.attr("y",d+n+1.25*t().state.noteMargin)}}return{textWidth:l.node().getBBox().width,textHeight:n}},"_drawLongText"),K=f((e,i)=>{i.attr("class","state-note");const d=i.append("rect").attr("x",0).attr("y",t().state.padding),c=i.append("g"),{textWidth:n,textHeight:l}=j(e,0,0,c);return d.attr("height",l+2*t().state.noteMargin),d.attr("width",n+t().state.noteMargin*2),d},"drawNote"),L=f(function(e,i){const d=i.id,c={id:d,label:i.id,width:0,height:0},n=e.append("g").attr("id",d).attr("class","stateGroup");i.type==="start"&&X(n),i.type==="end"&&q(n),(i.type==="fork"||i.type==="join")&&Z(n,i),i.type==="note"&&K(i.note.text,n),i.type==="divider"&&D(n),i.type==="default"&&i.descriptions.length===0&&Y(n,i),i.type==="default"&&i.descriptions.length>0&&I(n,i);const l=n.node().getBBox();return c.width=l.width+2*t().state.padding,c.height=l.height+2*t().state.padding,c},"drawState"),G=0,Q=f(function(e,i,d){const c=f(function(s){switch(s){case N.relationType.AGGREGATION:return"aggregation";case N.relationType.EXTENSION:return"extension";case N.relationType.COMPOSITION:return"composition";case N.relationType.DEPENDENCY:return"dependency"}},"getRelationType");i.points=i.points.filter(s=>!Number.isNaN(s.y));const n=i.points,l=_().x(function(s){return s.x}).y(function(s){return s.y}).curve(U),p=e.append("path").attr("d",l(n)).attr("id","edge"+G).attr("class","transition");let a="";if(t().state.arrowMarkerAbsolute&&(a=C(!0)),p.attr("marker-end","url("+a+"#"+c(N.relationType.DEPENDENCY)+"End)"),d.title!==void 0){const s=e.append("g").attr("class","stateLabel"),{x:m,y:x}=F.calcLabelPosition(i.points),g=z.getRows(d.title);let o=0;const B=[];let y=0,v=0;for(let u=0;u<=g.length;u++){const h=s.append("text").attr("text-anchor","middle").text(g[u]).attr("x",m).attr("y",x+o),w=h.node().getBBox();y=Math.max(y,w.width),v=Math.min(v,w.x),S.info(w.x,m,x+o),o===0&&(o=h.node().getBBox().height,S.info("Title height",o,x)),B.push(h)}let k=o*g.length;if(g.length>1){const u=(g.length-1)*o*.5;B.forEach((h,w)=>h.attr("y",x+w*o-u)),k=o*g.length}const r=s.node().getBBox();s.insert("rect",":first-child").attr("class","box").attr("x",m-y/2-t().state.padding/2).attr("y",x-k/2-t().state.padding/2-3.5).attr("width",y+t().state.padding).attr("height",k+t().state.padding),S.info(r)}G++},"drawEdge"),b,T={},V=f(function(){},"setConf"),tt=f(function(e){e.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),et=f(function(e,i,d,c){b=t().state;const n=t().securityLevel;let l;n==="sandbox"&&(l=H("#i"+i));const p=n==="sandbox"?H(l.nodes()[0].contentDocument.body):H("body"),a=n==="sandbox"?l.nodes()[0].contentDocument:document;S.debug("Rendering diagram "+e);const s=p.select(`[id='${i}']`);tt(s);const m=c.db.getRootDoc(),x=s.append("g").attr("id",i+"-root");A(m,x,void 0,!1,p,a,c);const g=b.padding,o=s.node().getBBox(),B=o.width+g*2,y=o.height+g*2,v=B*1.75;P(s,y,v,b.useMaxWidth),s.attr("viewBox",`${o.x-b.padding} ${o.y-b.padding} `+B+" "+y)},"draw"),at=f(e=>e?e.length*b.fontSizeFactor:1,"getLabelWidth"),A=f((e,i,d,c,n,l,p)=>{const a=new O({compound:!0,multigraph:!0});let s,m=!0;for(s=0;s<e.length;s++)if(e[s].stmt==="relation"){m=!1;break}d?a.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:m?1:b.edgeLengthFactor,nodeSep:m?1:50,isMultiGraph:!0}):a.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:m?1:b.edgeLengthFactor,nodeSep:m?1:50,ranker:"tight-tree",isMultiGraph:!0}),a.setDefaultEdgeLabel(function(){return{}});const x=p.db.getStates(),g=p.db.getRelations(),o=Object.keys(x);for(const r of o){const u=x[r];d&&(u.parentId=d);let h;if(u.doc){let w=i.append("g").attr("id",u.id).attr("class","stateGroup");h=A(u.doc,w,u.id,!c,n,l,p);{w=$(w,u,c);let E=w.node().getBBox();h.width=E.width,h.height=E.height+b.padding/2,T[u.id]={y:b.compositTitleSize}}}else h=L(i,u,a);if(u.note){const w={descriptions:[],id:u.id+"-note",note:u.note,type:"note"},E=L(i,w,a);u.note.position==="left of"?(a.setNode(h.id+"-note",E),a.setNode(h.id,h)):(a.setNode(h.id,h),a.setNode(h.id+"-note",E)),a.setParent(h.id,h.id+"-group"),a.setParent(h.id+"-note",h.id+"-group")}else a.setNode(h.id,h)}S.debug("Count=",a.nodeCount(),a);let B=0;g.forEach(function(r){B++,S.debug("Setting edge",r),a.setEdge(r.id1,r.id2,{relation:r,width:at(r.title),height:b.labelHeight*z.getRows(r.title).length,labelpos:"c"},"id"+B)}),J(a),S.debug("Graph after layout",a.nodes());const y=i.node();a.nodes().forEach(function(r){r!==void 0&&a.node(r)!==void 0?(S.warn("Node "+r+": "+JSON.stringify(a.node(r))),n.select("#"+y.id+" #"+r).attr("transform","translate("+(a.node(r).x-a.node(r).width/2)+","+(a.node(r).y+(T[r]?T[r].y:0)-a.node(r).height/2)+" )"),n.select("#"+y.id+" #"+r).attr("data-x-shift",a.node(r).x-a.node(r).width/2),l.querySelectorAll("#"+y.id+" #"+r+" .divider").forEach(h=>{const w=h.parentElement;let E=0,M=0;w&&(w.parentElement&&(E=w.parentElement.getBBox().width),M=parseInt(w.getAttribute("data-x-shift"),10),Number.isNaN(M)&&(M=0)),h.setAttribute("x1",0-M+8),h.setAttribute("x2",E-M-8)})):S.debug("No Node "+r+": "+JSON.stringify(a.node(r)))});let v=y.getBBox();a.edges().forEach(function(r){r!==void 0&&a.edge(r)!==void 0&&(S.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(a.edge(r))),Q(i,a.edge(r),a.edge(r).relation))}),v=y.getBBox();const k={id:d||"root",label:d||"root",width:0,height:0};return k.width=v.width+2*b.padding,k.height=v.height+2*b.padding,S.debug("Doc rendered",k,a),k},"renderDoc"),it={setConf:V,draw:et},lt={parser:W,get db(){return new N(1)},renderer:it,styles:R,init:f(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{lt as diagram};
1
+ import{s as R,a as W,S as N}from"./chunk-AQP2D5EJ-CuODwkza.js";import{_ as f,c as t,d as H,l as S,e as P,k as z,a9 as _,aa as U,a6 as C,u as F}from"./index-B8xoIIa6.js";import{G as O}from"./graph--OzhPTMs.js";import{l as J}from"./layout-SsrduOYp.js";import"./chunk-55IACEB6-DqkKXsbD.js";import"./chunk-2J33WTMH-CWR7tRuT.js";import"./index-BszkzNS4.js";var X=f(e=>e.append("circle").attr("class","start-state").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit).attr("cy",t().state.padding+t().state.sizeUnit),"drawStartState"),D=f(e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",t().state.textHeight).attr("class","divider").attr("x2",t().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),Y=f((e,i)=>{const d=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+2*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),c=d.node().getBBox();return e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",c.width+2*t().state.padding).attr("height",c.height+2*t().state.padding).attr("rx",t().state.radius),d},"drawSimpleState"),I=f((e,i)=>{const d=f(function(o,B,y){const v=o.append("tspan").attr("x",2*t().state.padding).text(B);y||v.attr("dy",t().state.textHeight)},"addTspan"),n=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+1.3*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.descriptions[0]).node().getBBox(),l=n.height,p=e.append("text").attr("x",t().state.padding).attr("y",l+t().state.padding*.4+t().state.dividerMargin+t().state.textHeight).attr("class","state-description");let a=!0,s=!0;i.descriptions.forEach(function(o){a||(d(p,o,s),s=!1),a=!1});const m=e.append("line").attr("x1",t().state.padding).attr("y1",t().state.padding+l+t().state.dividerMargin/2).attr("y2",t().state.padding+l+t().state.dividerMargin/2).attr("class","descr-divider"),x=p.node().getBBox(),g=Math.max(x.width,n.width);return m.attr("x2",g+3*t().state.padding),e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",g+2*t().state.padding).attr("height",x.height+l+2*t().state.padding).attr("rx",t().state.radius),e},"drawDescrState"),$=f((e,i,d)=>{const c=t().state.padding,n=2*t().state.padding,l=e.node().getBBox(),p=l.width,a=l.x,s=e.append("text").attr("x",0).attr("y",t().state.titleShift).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),x=s.node().getBBox().width+n;let g=Math.max(x,p);g===p&&(g=g+n);let o;const B=e.node().getBBox();i.doc,o=a-c,x>p&&(o=(p-g)/2+c),Math.abs(a-B.x)<c&&x>p&&(o=a-(x-p)/2);const y=1-t().state.textHeight;return e.insert("rect",":first-child").attr("x",o).attr("y",y).attr("class",d?"alt-composit":"composit").attr("width",g).attr("height",B.height+t().state.textHeight+t().state.titleShift+1).attr("rx","0"),s.attr("x",o+c),x<=p&&s.attr("x",a+(g-n)/2-x/2+c),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",g).attr("height",t().state.textHeight*3).attr("rx",t().state.radius),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",g).attr("height",B.height+3+2*t().state.textHeight).attr("rx",t().state.radius),e},"addTitleAndBox"),q=f(e=>(e.append("circle").attr("class","end-state-outer").attr("r",t().state.sizeUnit+t().state.miniPadding).attr("cx",t().state.padding+t().state.sizeUnit+t().state.miniPadding).attr("cy",t().state.padding+t().state.sizeUnit+t().state.miniPadding),e.append("circle").attr("class","end-state-inner").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit+2).attr("cy",t().state.padding+t().state.sizeUnit+2)),"drawEndState"),Z=f((e,i)=>{let d=t().state.forkWidth,c=t().state.forkHeight;if(i.parentId){let n=d;d=c,c=n}return e.append("rect").style("stroke","black").style("fill","black").attr("width",d).attr("height",c).attr("x",t().state.padding).attr("y",t().state.padding)},"drawForkJoinState"),j=f((e,i,d,c)=>{let n=0;const l=c.append("text");l.style("text-anchor","start"),l.attr("class","noteText");let p=e.replace(/\r\n/g,"<br/>");p=p.replace(/\n/g,"<br/>");const a=p.split(z.lineBreakRegex);let s=1.25*t().state.noteMargin;for(const m of a){const x=m.trim();if(x.length>0){const g=l.append("tspan");if(g.text(x),s===0){const o=g.node().getBBox();s+=o.height}n+=s,g.attr("x",i+t().state.noteMargin),g.attr("y",d+n+1.25*t().state.noteMargin)}}return{textWidth:l.node().getBBox().width,textHeight:n}},"_drawLongText"),K=f((e,i)=>{i.attr("class","state-note");const d=i.append("rect").attr("x",0).attr("y",t().state.padding),c=i.append("g"),{textWidth:n,textHeight:l}=j(e,0,0,c);return d.attr("height",l+2*t().state.noteMargin),d.attr("width",n+t().state.noteMargin*2),d},"drawNote"),L=f(function(e,i){const d=i.id,c={id:d,label:i.id,width:0,height:0},n=e.append("g").attr("id",d).attr("class","stateGroup");i.type==="start"&&X(n),i.type==="end"&&q(n),(i.type==="fork"||i.type==="join")&&Z(n,i),i.type==="note"&&K(i.note.text,n),i.type==="divider"&&D(n),i.type==="default"&&i.descriptions.length===0&&Y(n,i),i.type==="default"&&i.descriptions.length>0&&I(n,i);const l=n.node().getBBox();return c.width=l.width+2*t().state.padding,c.height=l.height+2*t().state.padding,c},"drawState"),G=0,Q=f(function(e,i,d){const c=f(function(s){switch(s){case N.relationType.AGGREGATION:return"aggregation";case N.relationType.EXTENSION:return"extension";case N.relationType.COMPOSITION:return"composition";case N.relationType.DEPENDENCY:return"dependency"}},"getRelationType");i.points=i.points.filter(s=>!Number.isNaN(s.y));const n=i.points,l=_().x(function(s){return s.x}).y(function(s){return s.y}).curve(U),p=e.append("path").attr("d",l(n)).attr("id","edge"+G).attr("class","transition");let a="";if(t().state.arrowMarkerAbsolute&&(a=C(!0)),p.attr("marker-end","url("+a+"#"+c(N.relationType.DEPENDENCY)+"End)"),d.title!==void 0){const s=e.append("g").attr("class","stateLabel"),{x:m,y:x}=F.calcLabelPosition(i.points),g=z.getRows(d.title);let o=0;const B=[];let y=0,v=0;for(let u=0;u<=g.length;u++){const h=s.append("text").attr("text-anchor","middle").text(g[u]).attr("x",m).attr("y",x+o),w=h.node().getBBox();y=Math.max(y,w.width),v=Math.min(v,w.x),S.info(w.x,m,x+o),o===0&&(o=h.node().getBBox().height,S.info("Title height",o,x)),B.push(h)}let k=o*g.length;if(g.length>1){const u=(g.length-1)*o*.5;B.forEach((h,w)=>h.attr("y",x+w*o-u)),k=o*g.length}const r=s.node().getBBox();s.insert("rect",":first-child").attr("class","box").attr("x",m-y/2-t().state.padding/2).attr("y",x-k/2-t().state.padding/2-3.5).attr("width",y+t().state.padding).attr("height",k+t().state.padding),S.info(r)}G++},"drawEdge"),b,T={},V=f(function(){},"setConf"),tt=f(function(e){e.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),et=f(function(e,i,d,c){b=t().state;const n=t().securityLevel;let l;n==="sandbox"&&(l=H("#i"+i));const p=n==="sandbox"?H(l.nodes()[0].contentDocument.body):H("body"),a=n==="sandbox"?l.nodes()[0].contentDocument:document;S.debug("Rendering diagram "+e);const s=p.select(`[id='${i}']`);tt(s);const m=c.db.getRootDoc(),x=s.append("g").attr("id",i+"-root");A(m,x,void 0,!1,p,a,c);const g=b.padding,o=s.node().getBBox(),B=o.width+g*2,y=o.height+g*2,v=B*1.75;P(s,y,v,b.useMaxWidth),s.attr("viewBox",`${o.x-b.padding} ${o.y-b.padding} `+B+" "+y)},"draw"),at=f(e=>e?e.length*b.fontSizeFactor:1,"getLabelWidth"),A=f((e,i,d,c,n,l,p)=>{const a=new O({compound:!0,multigraph:!0});let s,m=!0;for(s=0;s<e.length;s++)if(e[s].stmt==="relation"){m=!1;break}d?a.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:m?1:b.edgeLengthFactor,nodeSep:m?1:50,isMultiGraph:!0}):a.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:m?1:b.edgeLengthFactor,nodeSep:m?1:50,ranker:"tight-tree",isMultiGraph:!0}),a.setDefaultEdgeLabel(function(){return{}});const x=p.db.getStates(),g=p.db.getRelations(),o=Object.keys(x);for(const r of o){const u=x[r];d&&(u.parentId=d);let h;if(u.doc){let w=i.append("g").attr("id",u.id).attr("class","stateGroup");h=A(u.doc,w,u.id,!c,n,l,p);{w=$(w,u,c);let E=w.node().getBBox();h.width=E.width,h.height=E.height+b.padding/2,T[u.id]={y:b.compositTitleSize}}}else h=L(i,u,a);if(u.note){const w={descriptions:[],id:u.id+"-note",note:u.note,type:"note"},E=L(i,w,a);u.note.position==="left of"?(a.setNode(h.id+"-note",E),a.setNode(h.id,h)):(a.setNode(h.id,h),a.setNode(h.id+"-note",E)),a.setParent(h.id,h.id+"-group"),a.setParent(h.id+"-note",h.id+"-group")}else a.setNode(h.id,h)}S.debug("Count=",a.nodeCount(),a);let B=0;g.forEach(function(r){B++,S.debug("Setting edge",r),a.setEdge(r.id1,r.id2,{relation:r,width:at(r.title),height:b.labelHeight*z.getRows(r.title).length,labelpos:"c"},"id"+B)}),J(a),S.debug("Graph after layout",a.nodes());const y=i.node();a.nodes().forEach(function(r){r!==void 0&&a.node(r)!==void 0?(S.warn("Node "+r+": "+JSON.stringify(a.node(r))),n.select("#"+y.id+" #"+r).attr("transform","translate("+(a.node(r).x-a.node(r).width/2)+","+(a.node(r).y+(T[r]?T[r].y:0)-a.node(r).height/2)+" )"),n.select("#"+y.id+" #"+r).attr("data-x-shift",a.node(r).x-a.node(r).width/2),l.querySelectorAll("#"+y.id+" #"+r+" .divider").forEach(h=>{const w=h.parentElement;let E=0,M=0;w&&(w.parentElement&&(E=w.parentElement.getBBox().width),M=parseInt(w.getAttribute("data-x-shift"),10),Number.isNaN(M)&&(M=0)),h.setAttribute("x1",0-M+8),h.setAttribute("x2",E-M-8)})):S.debug("No Node "+r+": "+JSON.stringify(a.node(r)))});let v=y.getBBox();a.edges().forEach(function(r){r!==void 0&&a.edge(r)!==void 0&&(S.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(a.edge(r))),Q(i,a.edge(r),a.edge(r).relation))}),v=y.getBBox();const k={id:d||"root",label:d||"root",width:0,height:0};return k.width=v.width+2*b.padding,k.height=v.height+2*b.padding,S.debug("Doc rendered",k,a),k},"renderDoc"),it={setConf:V,draw:et},lt={parser:W,get db(){return new N(1)},renderer:it,styles:R,init:f(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{lt as diagram};
@@ -0,0 +1 @@
1
+ import{s as e,b as r,a,S as s}from"./chunk-AQP2D5EJ-CuODwkza.js";import{_ as i}from"./index-B8xoIIa6.js";import"./chunk-55IACEB6-DqkKXsbD.js";import"./chunk-2J33WTMH-CWR7tRuT.js";import"./index-BszkzNS4.js";var p={parser:a,get db(){return new s(2)},renderer:r,styles:e,init:i(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};export{p as diagram};
@@ -1 +1 @@
1
- import{j as o,l as t}from"./index-Cc3qXMhU.js";function a({className:e,...r}){return o.jsx("textarea",{"data-slot":"textarea",className:t("w-full rounded-lg border border-input bg-muted/40 px-3 py-2 text-sm leading-relaxed text-foreground transition-colors","placeholder:text-muted-foreground/70","focus:border-ring focus:bg-background focus:outline-none focus-visible:border-ring","disabled:cursor-not-allowed disabled:bg-muted/50 disabled:text-muted-foreground","aria-invalid:border-destructive",e),...r})}export{a as T};
1
+ import{j as o,l as t}from"./index-BszkzNS4.js";function a({className:e,...r}){return o.jsx("textarea",{"data-slot":"textarea",className:t("w-full rounded-lg border border-input bg-muted/40 px-3 py-2 text-sm leading-relaxed text-foreground transition-colors","placeholder:text-muted-foreground/70","focus:border-ring focus:bg-background focus:outline-none focus-visible:border-ring","disabled:cursor-not-allowed disabled:bg-muted/50 disabled:text-muted-foreground","aria-invalid:border-destructive",e),...r})}export{a as T};
@@ -1,4 +1,4 @@
1
- import{_ as o,D as pt,ac as Ct,ad as Rt,ae as Wt,c as gt,l as E,I as Pt,a4 as Bt,af as ft,d as X,C as Vt,ag as Ft,z as zt}from"./index-Dh-tgeaL.js";import{d as ot}from"./arc-CC81aLuf.js";import"./index-Cc3qXMhU.js";var tt=(function(){var e=o(function(k,s,d,l){for(d=d||{},l=k.length;l--;d[k[l]]=s);return d},"o"),t=[6,11,13,14,15,17,19,20,23,24],n=[1,12],i=[1,13],r=[1,14],h=[1,15],c=[1,16],a=[1,19],f=[1,20],g={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:o(function(s,d,l,p,x,u,S){var v=u.length-1;switch(x){case 1:return u[v-1];case 3:p.setDirection("LR");break;case 4:p.setDirection("TD");break;case 5:this.$=[];break;case 6:u[v-1].push(u[v]),this.$=u[v-1];break;case 7:case 8:this.$=u[v];break;case 9:case 10:this.$=[];break;case 11:p.getCommonDb().setDiagramTitle(u[v].substr(6)),this.$=u[v].substr(6);break;case 12:this.$=u[v].trim(),p.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=u[v].trim(),p.getCommonDb().setAccDescription(this.$);break;case 15:p.addSection(u[v].substr(8)),this.$=u[v].substr(8);break;case 18:p.addTask(u[v],0,""),this.$=u[v];break;case 19:p.addEvent(u[v].substr(2)),this.$=u[v];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},e(t,[2,5],{5:6}),e(t,[2,2]),e(t,[2,3]),e(t,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:n,15:i,17:r,19:h,20:c,21:17,22:18,23:a,24:f},e(t,[2,10],{1:[2,1]}),e(t,[2,6]),{12:21,14:n,15:i,17:r,19:h,20:c,21:17,22:18,23:a,24:f},e(t,[2,8]),e(t,[2,9]),e(t,[2,11]),{16:[1,22]},{18:[1,23]},e(t,[2,14]),e(t,[2,15]),e(t,[2,16]),e(t,[2,17]),e(t,[2,18]),e(t,[2,19]),e(t,[2,7]),e(t,[2,12]),e(t,[2,13])],defaultActions:{},parseError:o(function(s,d){if(d.recoverable)this.trace(s);else{var l=new Error(s);throw l.hash=d,l}},"parseError"),parse:o(function(s){var d=this,l=[0],p=[],x=[null],u=[],S=this.table,v="",I=0,C=0,W=2,O=1,L=u.slice.call(arguments,1),w=Object.create(this.lexer),H={yy:{}};for(var V in this.yy)Object.prototype.hasOwnProperty.call(this.yy,V)&&(H.yy[V]=this.yy[V]);w.setInput(s,H.yy),H.yy.lexer=w,H.yy.parser=this,typeof w.yylloc>"u"&&(w.yylloc={});var F=w.yylloc;u.push(F);var U=w.options&&w.options.ranges;typeof H.yy.parseError=="function"?this.parseError=H.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function N(A){l.length=l.length-2*A,x.length=x.length-A,u.length=u.length-A}o(N,"popStack");function b(){var A;return A=p.pop()||w.lex()||O,typeof A!="number"&&(A instanceof Array&&(p=A,A=p.pop()),A=d.symbols_[A]||A),A}o(b,"lex");for(var _,$,T,P,R={},G,B,Z,j;;){if($=l[l.length-1],this.defaultActions[$]?T=this.defaultActions[$]:((_===null||typeof _>"u")&&(_=b()),T=S[$]&&S[$][_]),typeof T>"u"||!T.length||!T[0]){var Y="";j=[];for(G in S[$])this.terminals_[G]&&G>W&&j.push("'"+this.terminals_[G]+"'");w.showPosition?Y="Parse error on line "+(I+1)+`:
1
+ import{_ as o,D as pt,ac as Ct,ad as Rt,ae as Wt,c as gt,l as E,I as Pt,a4 as Bt,af as ft,d as X,C as Vt,ag as Ft,z as zt}from"./index-B8xoIIa6.js";import{d as ot}from"./arc-5NPBSbiL.js";import"./index-BszkzNS4.js";var tt=(function(){var e=o(function(k,s,d,l){for(d=d||{},l=k.length;l--;d[k[l]]=s);return d},"o"),t=[6,11,13,14,15,17,19,20,23,24],n=[1,12],i=[1,13],r=[1,14],h=[1,15],c=[1,16],a=[1,19],f=[1,20],g={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:o(function(s,d,l,p,x,u,S){var v=u.length-1;switch(x){case 1:return u[v-1];case 3:p.setDirection("LR");break;case 4:p.setDirection("TD");break;case 5:this.$=[];break;case 6:u[v-1].push(u[v]),this.$=u[v-1];break;case 7:case 8:this.$=u[v];break;case 9:case 10:this.$=[];break;case 11:p.getCommonDb().setDiagramTitle(u[v].substr(6)),this.$=u[v].substr(6);break;case 12:this.$=u[v].trim(),p.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=u[v].trim(),p.getCommonDb().setAccDescription(this.$);break;case 15:p.addSection(u[v].substr(8)),this.$=u[v].substr(8);break;case 18:p.addTask(u[v],0,""),this.$=u[v];break;case 19:p.addEvent(u[v].substr(2)),this.$=u[v];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},e(t,[2,5],{5:6}),e(t,[2,2]),e(t,[2,3]),e(t,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:n,15:i,17:r,19:h,20:c,21:17,22:18,23:a,24:f},e(t,[2,10],{1:[2,1]}),e(t,[2,6]),{12:21,14:n,15:i,17:r,19:h,20:c,21:17,22:18,23:a,24:f},e(t,[2,8]),e(t,[2,9]),e(t,[2,11]),{16:[1,22]},{18:[1,23]},e(t,[2,14]),e(t,[2,15]),e(t,[2,16]),e(t,[2,17]),e(t,[2,18]),e(t,[2,19]),e(t,[2,7]),e(t,[2,12]),e(t,[2,13])],defaultActions:{},parseError:o(function(s,d){if(d.recoverable)this.trace(s);else{var l=new Error(s);throw l.hash=d,l}},"parseError"),parse:o(function(s){var d=this,l=[0],p=[],x=[null],u=[],S=this.table,v="",I=0,C=0,W=2,O=1,L=u.slice.call(arguments,1),w=Object.create(this.lexer),H={yy:{}};for(var V in this.yy)Object.prototype.hasOwnProperty.call(this.yy,V)&&(H.yy[V]=this.yy[V]);w.setInput(s,H.yy),H.yy.lexer=w,H.yy.parser=this,typeof w.yylloc>"u"&&(w.yylloc={});var F=w.yylloc;u.push(F);var U=w.options&&w.options.ranges;typeof H.yy.parseError=="function"?this.parseError=H.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function N(A){l.length=l.length-2*A,x.length=x.length-A,u.length=u.length-A}o(N,"popStack");function b(){var A;return A=p.pop()||w.lex()||O,typeof A!="number"&&(A instanceof Array&&(p=A,A=p.pop()),A=d.symbols_[A]||A),A}o(b,"lex");for(var _,$,T,P,R={},G,B,Z,j;;){if($=l[l.length-1],this.defaultActions[$]?T=this.defaultActions[$]:((_===null||typeof _>"u")&&(_=b()),T=S[$]&&S[$][_]),typeof T>"u"||!T.length||!T[0]){var Y="";j=[];for(G in S[$])this.terminals_[G]&&G>W&&j.push("'"+this.terminals_[G]+"'");w.showPosition?Y="Parse error on line "+(I+1)+`:
2
2
  `+w.showPosition()+`
3
3
  Expecting `+j.join(", ")+", got '"+(this.terminals_[_]||_)+"'":Y="Parse error on line "+(I+1)+": Unexpected "+(_==O?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(Y,{text:w.match,token:this.terminals_[_]||_,line:w.yylineno,loc:F,expected:j})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+$+", token: "+_);switch(T[0]){case 1:l.push(_),x.push(w.yytext),u.push(w.yylloc),l.push(T[1]),_=null,C=w.yyleng,v=w.yytext,I=w.yylineno,F=w.yylloc;break;case 2:if(B=this.productions_[T[1]][1],R.$=x[x.length-B],R._$={first_line:u[u.length-(B||1)].first_line,last_line:u[u.length-1].last_line,first_column:u[u.length-(B||1)].first_column,last_column:u[u.length-1].last_column},U&&(R._$.range=[u[u.length-(B||1)].range[0],u[u.length-1].range[1]]),P=this.performAction.apply(R,[v,C,I,H.yy,T[1],x,u].concat(L)),typeof P<"u")return P;B&&(l=l.slice(0,-1*B*2),x=x.slice(0,-1*B),u=u.slice(0,-1*B)),l.push(this.productions_[T[1]][0]),x.push(R.$),u.push(R._$),Z=S[l[l.length-2]][l[l.length-1]],l.push(Z);break;case 3:return!0}}return!0},"parse")},m=(function(){var k={EOF:1,parseError:o(function(d,l){if(this.yy.parser)this.yy.parser.parseError(d,l);else throw new Error(d)},"parseError"),setInput:o(function(s,d){return this.yy=d||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var d=s.match(/(?:\r\n?|\n).*/g);return d?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:o(function(s){var d=s.length,l=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-d),this.offset-=d;var p=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),l.length-1&&(this.yylineno-=l.length-1);var x=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:l?(l.length===p.length?this.yylloc.first_column:0)+p[p.length-l.length].length-l[0].length:this.yylloc.first_column-d},this.options.ranges&&(this.yylloc.range=[x[0],x[0]+this.yyleng-d]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(s){this.unput(this.match.slice(s))},"less"),pastInput:o(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var s=this.pastInput(),d=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
@@ -1 +1 @@
1
- import{r as i,j as a,z as F,P as R,v as A,x as j,y as I,C as E,l as y}from"./index-Cc3qXMhU.js";import{R as pe,I as fe,c as O,M as he}from"./index-hpHE1jXY.js";import{C as me}from"./check-DaZqOL8l.js";import{u as M}from"./index-T38iVLEb.js";import{u as B}from"./index-Disv1kQS.js";import{u as be}from"./index-BMZFF1UJ.js";var N="Checkbox",[xe]=E(N),[ve,G]=xe(N);function ke(t){const{__scopeCheckbox:n,checked:r,children:s,defaultChecked:o,disabled:e,form:c,name:d,onCheckedChange:u,required:b,value:p="on",internal_do_not_use_render:l}=t,[f,h]=A({prop:r,defaultProp:o??!1,onChange:u,caller:N}),[m,v]=i.useState(null),[k,x]=i.useState(null),C=i.useRef(!1),g=m?!!c||!!m.closest("form"):!0,_={checked:f,disabled:e,setChecked:h,control:m,setControl:v,name:d,form:c,value:p,hasConsumerStoppedPropagationRef:C,required:b,defaultChecked:w(o)?!1:o,isFormControl:g,bubbleInput:k,setBubbleInput:x};return a.jsx(ve,{scope:n,..._,children:Ce(l)?l(_):s})}var L="CheckboxTrigger",q=i.forwardRef(({__scopeCheckbox:t,onKeyDown:n,onClick:r,...s},o)=>{const{control:e,value:c,disabled:d,checked:u,required:b,setControl:p,setChecked:l,hasConsumerStoppedPropagationRef:f,isFormControl:h,bubbleInput:m}=G(L,t),v=j(o,p),k=i.useRef(u);return i.useEffect(()=>{const x=e?.form;if(x){const C=()=>l(k.current);return x.addEventListener("reset",C),()=>x.removeEventListener("reset",C)}},[e,l]),a.jsx(R.button,{type:"button",role:"checkbox","aria-checked":w(u)?"mixed":u,"aria-required":b,"data-state":V(u),"data-disabled":d?"":void 0,disabled:d,value:c,...s,ref:v,onKeyDown:I(n,x=>{x.key==="Enter"&&x.preventDefault()}),onClick:I(r,x=>{l(C=>w(C)?!0:!C),m&&h&&(f.current=x.isPropagationStopped(),f.current||x.stopPropagation())})})});q.displayName=L;var $=i.forwardRef((t,n)=>{const{__scopeCheckbox:r,name:s,checked:o,defaultChecked:e,required:c,disabled:d,value:u,onCheckedChange:b,form:p,...l}=t;return a.jsx(ke,{__scopeCheckbox:r,checked:o,defaultChecked:e,disabled:d,required:c,onCheckedChange:b,name:s,form:p,value:u,internal_do_not_use_render:({isFormControl:f})=>a.jsxs(a.Fragment,{children:[a.jsx(q,{...l,ref:n,__scopeCheckbox:r}),f&&a.jsx(K,{__scopeCheckbox:r})]})})});$.displayName=N;var z="CheckboxIndicator",U=i.forwardRef((t,n)=>{const{__scopeCheckbox:r,forceMount:s,...o}=t,e=G(z,r);return a.jsx(F,{present:s||w(e.checked)||e.checked===!0,children:a.jsx(R.span,{"data-state":V(e.checked),"data-disabled":e.disabled?"":void 0,...o,ref:n,style:{pointerEvents:"none",...t.style}})})});U.displayName=z;var H="CheckboxBubbleInput",K=i.forwardRef(({__scopeCheckbox:t,...n},r)=>{const{control:s,hasConsumerStoppedPropagationRef:o,checked:e,defaultChecked:c,required:d,disabled:u,name:b,value:p,form:l,bubbleInput:f,setBubbleInput:h}=G(H,t),m=j(r,h),v=M(e),k=B(s);i.useEffect(()=>{const C=f;if(!C)return;const g=window.HTMLInputElement.prototype,D=Object.getOwnPropertyDescriptor(g,"checked").set,ue=!o.current;if(v!==e&&D){const le=new Event("click",{bubbles:ue});C.indeterminate=w(e),D.call(C,w(e)?!1:e),C.dispatchEvent(le)}},[f,v,e,o]);const x=i.useRef(w(e)?!1:e);return a.jsx(R.input,{type:"checkbox","aria-hidden":!0,defaultChecked:c??x.current,required:d,disabled:u,name:b,value:p,form:l,...n,tabIndex:-1,ref:m,style:{...n.style,...k,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});K.displayName=H;function Ce(t){return typeof t=="function"}function w(t){return t==="indeterminate"}function V(t){return w(t)?"indeterminate":t?"checked":"unchecked"}var T="Radio",[Re,W]=E(T),[ge,ye]=Re(T),X=i.forwardRef((t,n)=>{const{__scopeRadio:r,name:s,checked:o=!1,required:e,disabled:c,value:d="on",onCheck:u,form:b,...p}=t,[l,f]=i.useState(null),h=j(n,k=>f(k)),m=i.useRef(!1),v=l?b||!!l.closest("form"):!0;return a.jsxs(ge,{scope:r,checked:o,disabled:c,children:[a.jsx(R.button,{type:"button",role:"radio","aria-checked":o,"data-state":Z(o),"data-disabled":c?"":void 0,disabled:c,value:d,...p,ref:h,onClick:I(t.onClick,k=>{o||u?.(),v&&(m.current=k.isPropagationStopped(),m.current||k.stopPropagation())})}),v&&a.jsx(Q,{control:l,bubbles:!m.current,name:s,value:d,checked:o,required:e,disabled:c,form:b,style:{transform:"translateX(-100%)"}})]})});X.displayName=T;var Y="RadioIndicator",J=i.forwardRef((t,n)=>{const{__scopeRadio:r,forceMount:s,...o}=t,e=ye(Y,r);return a.jsx(F,{present:s||e.checked,children:a.jsx(R.span,{"data-state":Z(e.checked),"data-disabled":e.disabled?"":void 0,...o,ref:n})})});J.displayName=Y;var we="RadioBubbleInput",Q=i.forwardRef(({__scopeRadio:t,control:n,checked:r,bubbles:s=!0,...o},e)=>{const c=i.useRef(null),d=j(c,e),u=M(r),b=B(n);return i.useEffect(()=>{const p=c.current;if(!p)return;const l=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(l,"checked").set;if(u!==r&&h){const m=new Event("click",{bubbles:s});h.call(p,r),p.dispatchEvent(m)}},[u,r,s]),a.jsx(R.input,{type:"radio","aria-hidden":!0,defaultChecked:r,...o,tabIndex:-1,ref:d,style:{...o.style,...b,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Q.displayName=we;function Z(t){return t?"checked":"unchecked"}var je=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],P="RadioGroup",[Ie]=E(P,[O,W]),ee=O(),te=W(),[_e,Ee]=Ie(P),re=i.forwardRef((t,n)=>{const{__scopeRadioGroup:r,name:s,defaultValue:o,value:e,required:c=!1,disabled:d=!1,orientation:u,dir:b,loop:p=!0,onValueChange:l,...f}=t,h=ee(r),m=be(b),[v,k]=A({prop:e,defaultProp:o??null,onChange:l,caller:P});return a.jsx(_e,{scope:r,name:s,required:c,disabled:d,value:v,onValueChange:k,children:a.jsx(pe,{asChild:!0,...h,orientation:u,dir:m,loop:p,children:a.jsx(R.div,{role:"radiogroup","aria-required":c,"aria-orientation":u,"data-disabled":d?"":void 0,dir:m,...f,ref:n})})})});re.displayName=P;var oe="RadioGroupItem",ae=i.forwardRef((t,n)=>{const{__scopeRadioGroup:r,disabled:s,...o}=t,e=Ee(oe,r),c=e.disabled||s,d=ee(r),u=te(r),b=i.useRef(null),p=j(n,b),l=e.value===o.value,f=i.useRef(!1);return i.useEffect(()=>{const h=v=>{je.includes(v.key)&&(f.current=!0)},m=()=>f.current=!1;return document.addEventListener("keydown",h),document.addEventListener("keyup",m),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",m)}},[]),a.jsx(fe,{asChild:!0,...d,focusable:!c,active:l,children:a.jsx(X,{disabled:c,required:e.required,checked:l,...u,...o,name:e.name,ref:p,onCheck:()=>e.onValueChange(o.value),onKeyDown:I(h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:I(o.onFocus,()=>{f.current&&b.current?.click()})})})});ae.displayName=oe;var Ne="RadioGroupIndicator",Pe=i.forwardRef((t,n)=>{const{__scopeRadioGroup:r,...s}=t,o=te(r);return a.jsx(J,{...o,...s,ref:n})});Pe.displayName=Ne;var Se=re,Ae=ae,S="Switch",[Me]=E(S),[Be,Ge]=Me(S),ne=i.forwardRef((t,n)=>{const{__scopeSwitch:r,name:s,checked:o,defaultChecked:e,required:c,disabled:d,value:u="on",onCheckedChange:b,form:p,...l}=t,[f,h]=i.useState(null),m=j(n,g=>h(g)),v=i.useRef(!1),k=f?p||!!f.closest("form"):!0,[x,C]=A({prop:o,defaultProp:e??!1,onChange:b,caller:S});return a.jsxs(Be,{scope:r,checked:x,disabled:d,children:[a.jsx(R.button,{type:"button",role:"switch","aria-checked":x,"aria-required":c,"data-state":de(x),"data-disabled":d?"":void 0,disabled:d,value:u,...l,ref:m,onClick:I(t.onClick,g=>{C(_=>!_),k&&(v.current=g.isPropagationStopped(),v.current||g.stopPropagation())})}),k&&a.jsx(ie,{control:f,bubbles:!v.current,name:s,value:u,checked:x,required:c,disabled:d,form:p,style:{transform:"translateX(-100%)"}})]})});ne.displayName=S;var se="SwitchThumb",ce=i.forwardRef((t,n)=>{const{__scopeSwitch:r,...s}=t,o=Ge(se,r);return a.jsx(R.span,{"data-state":de(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:n})});ce.displayName=se;var Te="SwitchBubbleInput",ie=i.forwardRef(({__scopeSwitch:t,control:n,checked:r,bubbles:s=!0,...o},e)=>{const c=i.useRef(null),d=j(c,e),u=M(r),b=B(n);return i.useEffect(()=>{const p=c.current;if(!p)return;const l=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(l,"checked").set;if(u!==r&&h){const m=new Event("click",{bubbles:s});h.call(p,r),p.dispatchEvent(m)}},[u,r,s]),a.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...o,tabIndex:-1,ref:d,style:{...o.style,...b,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});ie.displayName=Te;function de(t){return t?"checked":"unchecked"}var De=ne,Fe=ce;function He({size:t="md",className:n,...r}){return a.jsx(De,{className:y("peer relative inline-flex shrink-0 cursor-pointer items-center rounded-full transition-colors duration-150 outline-none","focus-visible:ring-2 focus-visible:ring-ring/60 focus-visible:ring-offset-1 disabled:cursor-not-allowed disabled:opacity-40","bg-foreground/15 data-[state=checked]:bg-primary",t==="md"?"h-5 w-9":"h-4 w-7",n),...r,children:a.jsx(Fe,{className:y("pointer-events-none block rounded-full bg-background shadow-raised transition-transform duration-150 motion-reduce:transition-none",t==="md"?"size-4 translate-x-0.5 data-[state=checked]:translate-x-[18px]":"size-3 translate-x-0.5 data-[state=checked]:translate-x-3.5")})})}function Ke({label:t,description:n,id:r,className:s,...o}){const e=i.useId(),c=r??e,d=a.jsx($,{id:c,className:y("flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-foreground/25 bg-background shadow-raised transition-colors outline-none","focus-visible:ring-2 focus-visible:ring-ring/60 focus-visible:ring-offset-1 disabled:cursor-not-allowed disabled:opacity-40","data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground","data-[state=indeterminate]:border-primary data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground",!t&&s),...o,children:a.jsx(U,{className:"flex items-center justify-center",children:o.checked==="indeterminate"?a.jsx(he,{className:"size-3",strokeWidth:3,"aria-hidden":"true"}):a.jsx(me,{className:"size-3",strokeWidth:3,"aria-hidden":"true"})})});return t?a.jsxs("div",{className:y("flex items-start gap-2.5",s),children:[a.jsx("span",{className:"flex h-5 items-center",children:d}),a.jsxs("label",{htmlFor:c,className:y("cursor-pointer select-none",o.disabled&&"cursor-not-allowed opacity-50"),children:[a.jsx("span",{className:"block text-[13px] leading-5 text-foreground",children:t}),n&&a.jsx("span",{className:"block text-xs leading-relaxed text-muted-foreground",children:n})]})]}):d}function Ve({options:t,orientation:n="vertical",className:r,...s}){const o=i.useId();return a.jsx(Se,{orientation:n,className:y(n==="vertical"?"flex flex-col gap-3":"flex flex-wrap gap-x-5 gap-y-2",r),...s,children:t.map(e=>{const c=`${o}-${e.value}`;return a.jsxs("div",{className:"flex items-start gap-2.5",children:[a.jsx("span",{className:"flex h-5 items-center",children:a.jsx(Ae,{id:c,value:e.value,disabled:e.disabled,className:y("size-4 shrink-0 rounded-full border border-foreground/25 bg-background shadow-raised transition-[border-color,border-width] duration-150 outline-none","focus-visible:ring-2 focus-visible:ring-ring/60 focus-visible:ring-offset-1 disabled:cursor-not-allowed disabled:opacity-40","data-[state=checked]:border-[5px] data-[state=checked]:border-primary")})}),a.jsxs("label",{htmlFor:c,className:y("cursor-pointer select-none",e.disabled&&"cursor-not-allowed opacity-50"),children:[a.jsx("span",{className:"block text-[13px] leading-5 text-foreground",children:e.label}),e.description&&a.jsx("span",{className:"block text-xs leading-relaxed text-muted-foreground",children:e.description})]})]},e.value)})})}export{Ke as C,Ve as R,He as S};
1
+ import{r as i,j as a,z as F,P as R,v as A,x as j,y as I,C as E,l as y}from"./index-BszkzNS4.js";import{R as pe,I as fe,c as O,M as he}from"./index-DuM6iAxG.js";import{C as me}from"./check-yNWhPvMH.js";import{u as M}from"./index-BMcLxIvZ.js";import{u as B}from"./index-lZLy5rkr.js";import{u as be}from"./index-GuczxPxb.js";var N="Checkbox",[xe]=E(N),[ve,G]=xe(N);function ke(t){const{__scopeCheckbox:n,checked:r,children:s,defaultChecked:o,disabled:e,form:c,name:d,onCheckedChange:u,required:b,value:p="on",internal_do_not_use_render:l}=t,[f,h]=A({prop:r,defaultProp:o??!1,onChange:u,caller:N}),[m,v]=i.useState(null),[k,x]=i.useState(null),C=i.useRef(!1),g=m?!!c||!!m.closest("form"):!0,_={checked:f,disabled:e,setChecked:h,control:m,setControl:v,name:d,form:c,value:p,hasConsumerStoppedPropagationRef:C,required:b,defaultChecked:w(o)?!1:o,isFormControl:g,bubbleInput:k,setBubbleInput:x};return a.jsx(ve,{scope:n,..._,children:Ce(l)?l(_):s})}var L="CheckboxTrigger",q=i.forwardRef(({__scopeCheckbox:t,onKeyDown:n,onClick:r,...s},o)=>{const{control:e,value:c,disabled:d,checked:u,required:b,setControl:p,setChecked:l,hasConsumerStoppedPropagationRef:f,isFormControl:h,bubbleInput:m}=G(L,t),v=j(o,p),k=i.useRef(u);return i.useEffect(()=>{const x=e?.form;if(x){const C=()=>l(k.current);return x.addEventListener("reset",C),()=>x.removeEventListener("reset",C)}},[e,l]),a.jsx(R.button,{type:"button",role:"checkbox","aria-checked":w(u)?"mixed":u,"aria-required":b,"data-state":V(u),"data-disabled":d?"":void 0,disabled:d,value:c,...s,ref:v,onKeyDown:I(n,x=>{x.key==="Enter"&&x.preventDefault()}),onClick:I(r,x=>{l(C=>w(C)?!0:!C),m&&h&&(f.current=x.isPropagationStopped(),f.current||x.stopPropagation())})})});q.displayName=L;var $=i.forwardRef((t,n)=>{const{__scopeCheckbox:r,name:s,checked:o,defaultChecked:e,required:c,disabled:d,value:u,onCheckedChange:b,form:p,...l}=t;return a.jsx(ke,{__scopeCheckbox:r,checked:o,defaultChecked:e,disabled:d,required:c,onCheckedChange:b,name:s,form:p,value:u,internal_do_not_use_render:({isFormControl:f})=>a.jsxs(a.Fragment,{children:[a.jsx(q,{...l,ref:n,__scopeCheckbox:r}),f&&a.jsx(K,{__scopeCheckbox:r})]})})});$.displayName=N;var z="CheckboxIndicator",U=i.forwardRef((t,n)=>{const{__scopeCheckbox:r,forceMount:s,...o}=t,e=G(z,r);return a.jsx(F,{present:s||w(e.checked)||e.checked===!0,children:a.jsx(R.span,{"data-state":V(e.checked),"data-disabled":e.disabled?"":void 0,...o,ref:n,style:{pointerEvents:"none",...t.style}})})});U.displayName=z;var H="CheckboxBubbleInput",K=i.forwardRef(({__scopeCheckbox:t,...n},r)=>{const{control:s,hasConsumerStoppedPropagationRef:o,checked:e,defaultChecked:c,required:d,disabled:u,name:b,value:p,form:l,bubbleInput:f,setBubbleInput:h}=G(H,t),m=j(r,h),v=M(e),k=B(s);i.useEffect(()=>{const C=f;if(!C)return;const g=window.HTMLInputElement.prototype,D=Object.getOwnPropertyDescriptor(g,"checked").set,ue=!o.current;if(v!==e&&D){const le=new Event("click",{bubbles:ue});C.indeterminate=w(e),D.call(C,w(e)?!1:e),C.dispatchEvent(le)}},[f,v,e,o]);const x=i.useRef(w(e)?!1:e);return a.jsx(R.input,{type:"checkbox","aria-hidden":!0,defaultChecked:c??x.current,required:d,disabled:u,name:b,value:p,form:l,...n,tabIndex:-1,ref:m,style:{...n.style,...k,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});K.displayName=H;function Ce(t){return typeof t=="function"}function w(t){return t==="indeterminate"}function V(t){return w(t)?"indeterminate":t?"checked":"unchecked"}var T="Radio",[Re,W]=E(T),[ge,ye]=Re(T),X=i.forwardRef((t,n)=>{const{__scopeRadio:r,name:s,checked:o=!1,required:e,disabled:c,value:d="on",onCheck:u,form:b,...p}=t,[l,f]=i.useState(null),h=j(n,k=>f(k)),m=i.useRef(!1),v=l?b||!!l.closest("form"):!0;return a.jsxs(ge,{scope:r,checked:o,disabled:c,children:[a.jsx(R.button,{type:"button",role:"radio","aria-checked":o,"data-state":Z(o),"data-disabled":c?"":void 0,disabled:c,value:d,...p,ref:h,onClick:I(t.onClick,k=>{o||u?.(),v&&(m.current=k.isPropagationStopped(),m.current||k.stopPropagation())})}),v&&a.jsx(Q,{control:l,bubbles:!m.current,name:s,value:d,checked:o,required:e,disabled:c,form:b,style:{transform:"translateX(-100%)"}})]})});X.displayName=T;var Y="RadioIndicator",J=i.forwardRef((t,n)=>{const{__scopeRadio:r,forceMount:s,...o}=t,e=ye(Y,r);return a.jsx(F,{present:s||e.checked,children:a.jsx(R.span,{"data-state":Z(e.checked),"data-disabled":e.disabled?"":void 0,...o,ref:n})})});J.displayName=Y;var we="RadioBubbleInput",Q=i.forwardRef(({__scopeRadio:t,control:n,checked:r,bubbles:s=!0,...o},e)=>{const c=i.useRef(null),d=j(c,e),u=M(r),b=B(n);return i.useEffect(()=>{const p=c.current;if(!p)return;const l=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(l,"checked").set;if(u!==r&&h){const m=new Event("click",{bubbles:s});h.call(p,r),p.dispatchEvent(m)}},[u,r,s]),a.jsx(R.input,{type:"radio","aria-hidden":!0,defaultChecked:r,...o,tabIndex:-1,ref:d,style:{...o.style,...b,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Q.displayName=we;function Z(t){return t?"checked":"unchecked"}var je=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],P="RadioGroup",[Ie]=E(P,[O,W]),ee=O(),te=W(),[_e,Ee]=Ie(P),re=i.forwardRef((t,n)=>{const{__scopeRadioGroup:r,name:s,defaultValue:o,value:e,required:c=!1,disabled:d=!1,orientation:u,dir:b,loop:p=!0,onValueChange:l,...f}=t,h=ee(r),m=be(b),[v,k]=A({prop:e,defaultProp:o??null,onChange:l,caller:P});return a.jsx(_e,{scope:r,name:s,required:c,disabled:d,value:v,onValueChange:k,children:a.jsx(pe,{asChild:!0,...h,orientation:u,dir:m,loop:p,children:a.jsx(R.div,{role:"radiogroup","aria-required":c,"aria-orientation":u,"data-disabled":d?"":void 0,dir:m,...f,ref:n})})})});re.displayName=P;var oe="RadioGroupItem",ae=i.forwardRef((t,n)=>{const{__scopeRadioGroup:r,disabled:s,...o}=t,e=Ee(oe,r),c=e.disabled||s,d=ee(r),u=te(r),b=i.useRef(null),p=j(n,b),l=e.value===o.value,f=i.useRef(!1);return i.useEffect(()=>{const h=v=>{je.includes(v.key)&&(f.current=!0)},m=()=>f.current=!1;return document.addEventListener("keydown",h),document.addEventListener("keyup",m),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",m)}},[]),a.jsx(fe,{asChild:!0,...d,focusable:!c,active:l,children:a.jsx(X,{disabled:c,required:e.required,checked:l,...u,...o,name:e.name,ref:p,onCheck:()=>e.onValueChange(o.value),onKeyDown:I(h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:I(o.onFocus,()=>{f.current&&b.current?.click()})})})});ae.displayName=oe;var Ne="RadioGroupIndicator",Pe=i.forwardRef((t,n)=>{const{__scopeRadioGroup:r,...s}=t,o=te(r);return a.jsx(J,{...o,...s,ref:n})});Pe.displayName=Ne;var Se=re,Ae=ae,S="Switch",[Me]=E(S),[Be,Ge]=Me(S),ne=i.forwardRef((t,n)=>{const{__scopeSwitch:r,name:s,checked:o,defaultChecked:e,required:c,disabled:d,value:u="on",onCheckedChange:b,form:p,...l}=t,[f,h]=i.useState(null),m=j(n,g=>h(g)),v=i.useRef(!1),k=f?p||!!f.closest("form"):!0,[x,C]=A({prop:o,defaultProp:e??!1,onChange:b,caller:S});return a.jsxs(Be,{scope:r,checked:x,disabled:d,children:[a.jsx(R.button,{type:"button",role:"switch","aria-checked":x,"aria-required":c,"data-state":de(x),"data-disabled":d?"":void 0,disabled:d,value:u,...l,ref:m,onClick:I(t.onClick,g=>{C(_=>!_),k&&(v.current=g.isPropagationStopped(),v.current||g.stopPropagation())})}),k&&a.jsx(ie,{control:f,bubbles:!v.current,name:s,value:u,checked:x,required:c,disabled:d,form:p,style:{transform:"translateX(-100%)"}})]})});ne.displayName=S;var se="SwitchThumb",ce=i.forwardRef((t,n)=>{const{__scopeSwitch:r,...s}=t,o=Ge(se,r);return a.jsx(R.span,{"data-state":de(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:n})});ce.displayName=se;var Te="SwitchBubbleInput",ie=i.forwardRef(({__scopeSwitch:t,control:n,checked:r,bubbles:s=!0,...o},e)=>{const c=i.useRef(null),d=j(c,e),u=M(r),b=B(n);return i.useEffect(()=>{const p=c.current;if(!p)return;const l=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(l,"checked").set;if(u!==r&&h){const m=new Event("click",{bubbles:s});h.call(p,r),p.dispatchEvent(m)}},[u,r,s]),a.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...o,tabIndex:-1,ref:d,style:{...o.style,...b,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});ie.displayName=Te;function de(t){return t?"checked":"unchecked"}var De=ne,Fe=ce;function He({size:t="md",className:n,...r}){return a.jsx(De,{className:y("peer relative inline-flex shrink-0 cursor-pointer items-center rounded-full transition-colors duration-150 outline-none","focus-visible:ring-2 focus-visible:ring-ring/60 focus-visible:ring-offset-1 disabled:cursor-not-allowed disabled:opacity-40","bg-foreground/15 data-[state=checked]:bg-primary",t==="md"?"h-5 w-9":"h-4 w-7",n),...r,children:a.jsx(Fe,{className:y("pointer-events-none block rounded-full bg-background shadow-raised transition-transform duration-150 motion-reduce:transition-none",t==="md"?"size-4 translate-x-0.5 data-[state=checked]:translate-x-[18px]":"size-3 translate-x-0.5 data-[state=checked]:translate-x-3.5")})})}function Ke({label:t,description:n,id:r,className:s,...o}){const e=i.useId(),c=r??e,d=a.jsx($,{id:c,className:y("flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-foreground/25 bg-background shadow-raised transition-colors outline-none","focus-visible:ring-2 focus-visible:ring-ring/60 focus-visible:ring-offset-1 disabled:cursor-not-allowed disabled:opacity-40","data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground","data-[state=indeterminate]:border-primary data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground",!t&&s),...o,children:a.jsx(U,{className:"flex items-center justify-center",children:o.checked==="indeterminate"?a.jsx(he,{className:"size-3",strokeWidth:3,"aria-hidden":"true"}):a.jsx(me,{className:"size-3",strokeWidth:3,"aria-hidden":"true"})})});return t?a.jsxs("div",{className:y("flex items-start gap-2.5",s),children:[a.jsx("span",{className:"flex h-5 items-center",children:d}),a.jsxs("label",{htmlFor:c,className:y("cursor-pointer select-none",o.disabled&&"cursor-not-allowed opacity-50"),children:[a.jsx("span",{className:"block text-[13px] leading-5 text-foreground",children:t}),n&&a.jsx("span",{className:"block text-xs leading-relaxed text-muted-foreground",children:n})]})]}):d}function Ve({options:t,orientation:n="vertical",className:r,...s}){const o=i.useId();return a.jsx(Se,{orientation:n,className:y(n==="vertical"?"flex flex-col gap-3":"flex flex-wrap gap-x-5 gap-y-2",r),...s,children:t.map(e=>{const c=`${o}-${e.value}`;return a.jsxs("div",{className:"flex items-start gap-2.5",children:[a.jsx("span",{className:"flex h-5 items-center",children:a.jsx(Ae,{id:c,value:e.value,disabled:e.disabled,className:y("size-4 shrink-0 rounded-full border border-foreground/25 bg-background shadow-raised transition-[border-color,border-width] duration-150 outline-none","focus-visible:ring-2 focus-visible:ring-ring/60 focus-visible:ring-offset-1 disabled:cursor-not-allowed disabled:opacity-40","data-[state=checked]:border-[5px] data-[state=checked]:border-primary")})}),a.jsxs("label",{htmlFor:c,className:y("cursor-pointer select-none",e.disabled&&"cursor-not-allowed opacity-50"),children:[a.jsx("span",{className:"block text-[13px] leading-5 text-foreground",children:e.label}),e.description&&a.jsx("span",{className:"block text-xs leading-relaxed text-muted-foreground",children:e.description})]})]},e.value)})})}export{Ke as C,Ve as R,He as S};
@@ -1 +1 @@
1
- import{c as X,r as s,j as c,w as $,v as W,x as H,P as J,y as C,z as I,C as Q,aS as Z,l as S}from"./index-Cc3qXMhU.js";import{K as ee}from"./kbd-IjDGsZ2B.js";import{P as te,D as oe}from"./index-DWrSDMX2.js";import{R as re,A as ne,c as F,C as se,a as ae}from"./index-Disv1kQS.js";import{R as ie}from"./index-Pt4TsHjm.js";const le=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Ne=X("file-text",le);var[_]=Q("Tooltip",[F]),k=F(),G="TooltipProvider",ce=700,D="tooltip.open",[ue,L]=_(G),z=t=>{const{__scopeTooltip:o,delayDuration:e=ce,skipDelayDuration:r=300,disableHoverableContent:n=!1,children:l}=t,a=s.useRef(!0),p=s.useRef(!1),i=s.useRef(0);return s.useEffect(()=>{const f=i.current;return()=>window.clearTimeout(f)},[]),c.jsx(ue,{scope:o,isOpenDelayedRef:a,delayDuration:e,onOpen:s.useCallback(()=>{window.clearTimeout(i.current),a.current=!1},[]),onClose:s.useCallback(()=>{window.clearTimeout(i.current),i.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:p,onPointerInTransitChange:s.useCallback(f=>{p.current=f},[]),disableHoverableContent:n,children:l})};z.displayName=G;var R="Tooltip",[de,j]=_(R),B=t=>{const{__scopeTooltip:o,children:e,open:r,defaultOpen:n,onOpenChange:l,disableHoverableContent:a,delayDuration:p}=t,i=L(R,t.__scopeTooltip),f=k(o),[u,x]=s.useState(null),v=$(),d=s.useRef(0),h=a??i.disableHoverableContent,y=p??i.delayDuration,g=s.useRef(!1),[T,m]=W({prop:r,defaultProp:n??!1,onChange:N=>{N?(i.onOpen(),document.dispatchEvent(new CustomEvent(D))):i.onClose(),l?.(N)},caller:R}),w=s.useMemo(()=>T?g.current?"delayed-open":"instant-open":"closed",[T]),P=s.useCallback(()=>{window.clearTimeout(d.current),d.current=0,g.current=!1,m(!0)},[m]),E=s.useCallback(()=>{window.clearTimeout(d.current),d.current=0,m(!1)},[m]),M=s.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>{g.current=!0,m(!0),d.current=0},y)},[y,m]);return s.useEffect(()=>()=>{d.current&&(window.clearTimeout(d.current),d.current=0)},[]),c.jsx(re,{...f,children:c.jsx(de,{scope:o,contentId:v,open:T,stateAttribute:w,trigger:u,onTriggerChange:x,onTriggerEnter:s.useCallback(()=>{i.isOpenDelayedRef.current?M():P()},[i.isOpenDelayedRef,M,P]),onTriggerLeave:s.useCallback(()=>{h?E():(window.clearTimeout(d.current),d.current=0)},[E,h]),onOpen:P,onClose:E,disableHoverableContent:h,children:e})})};B.displayName=R;var O="TooltipTrigger",V=s.forwardRef((t,o)=>{const{__scopeTooltip:e,...r}=t,n=j(O,e),l=L(O,e),a=k(e),p=s.useRef(null),i=H(o,p,n.onTriggerChange),f=s.useRef(!1),u=s.useRef(!1),x=s.useCallback(()=>f.current=!1,[]);return s.useEffect(()=>()=>document.removeEventListener("pointerup",x),[x]),c.jsx(ne,{asChild:!0,...a,children:c.jsx(J.button,{"aria-describedby":n.open?n.contentId:void 0,"data-state":n.stateAttribute,...r,ref:i,onPointerMove:C(t.onPointerMove,v=>{v.pointerType!=="touch"&&!u.current&&!l.isPointerInTransitRef.current&&(n.onTriggerEnter(),u.current=!0)}),onPointerLeave:C(t.onPointerLeave,()=>{n.onTriggerLeave(),u.current=!1}),onPointerDown:C(t.onPointerDown,()=>{n.open&&n.onClose(),f.current=!0,document.addEventListener("pointerup",x,{once:!0})}),onFocus:C(t.onFocus,()=>{f.current||n.onOpen()}),onBlur:C(t.onBlur,n.onClose),onClick:C(t.onClick,n.onClose)})})});V.displayName=O;var A="TooltipPortal",[pe,fe]=_(A,{forceMount:void 0}),K=t=>{const{__scopeTooltip:o,forceMount:e,children:r,container:n}=t,l=j(A,o);return c.jsx(pe,{scope:o,forceMount:e,children:c.jsx(I,{present:e||l.open,children:c.jsx(te,{asChild:!0,container:n,children:r})})})};K.displayName=A;var b="TooltipContent",U=s.forwardRef((t,o)=>{const e=fe(b,t.__scopeTooltip),{forceMount:r=e.forceMount,side:n="top",...l}=t,a=j(b,t.__scopeTooltip);return c.jsx(I,{present:r||a.open,children:a.disableHoverableContent?c.jsx(Y,{side:n,...l,ref:o}):c.jsx(xe,{side:n,...l,ref:o})})}),xe=s.forwardRef((t,o)=>{const e=j(b,t.__scopeTooltip),r=L(b,t.__scopeTooltip),n=s.useRef(null),l=H(o,n),[a,p]=s.useState(null),{trigger:i,onClose:f}=e,u=n.current,{onPointerInTransitChange:x}=r,v=s.useCallback(()=>{p(null),x(!1)},[x]),d=s.useCallback((h,y)=>{const g=h.currentTarget,T={x:h.clientX,y:h.clientY},m=me(T,g.getBoundingClientRect()),w=Te(T,m),P=Ce(y.getBoundingClientRect()),E=we([...w,...P]);p(E),x(!0)},[x]);return s.useEffect(()=>()=>v(),[v]),s.useEffect(()=>{if(i&&u){const h=g=>d(g,u),y=g=>d(g,i);return i.addEventListener("pointerleave",h),u.addEventListener("pointerleave",y),()=>{i.removeEventListener("pointerleave",h),u.removeEventListener("pointerleave",y)}}},[i,u,d,v]),s.useEffect(()=>{if(a){const h=y=>{const g=y.target,T={x:y.clientX,y:y.clientY},m=i?.contains(g)||u?.contains(g),w=!be(T,a);m?v():w&&(v(),f())};return document.addEventListener("pointermove",h),()=>document.removeEventListener("pointermove",h)}},[i,u,a,f,v]),c.jsx(Y,{...t,ref:l})}),[ve,he]=_(R,{isInside:!1}),ge=Z("TooltipContent"),Y=s.forwardRef((t,o)=>{const{__scopeTooltip:e,children:r,"aria-label":n,onEscapeKeyDown:l,onPointerDownOutside:a,...p}=t,i=j(b,e),f=k(e),{onClose:u}=i;return s.useEffect(()=>(document.addEventListener(D,u),()=>document.removeEventListener(D,u)),[u]),s.useEffect(()=>{if(i.trigger){const x=v=>{v.target?.contains(i.trigger)&&u()};return window.addEventListener("scroll",x,{capture:!0}),()=>window.removeEventListener("scroll",x,{capture:!0})}},[i.trigger,u]),c.jsx(oe,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:a,onFocusOutside:x=>x.preventDefault(),onDismiss:u,children:c.jsxs(se,{"data-state":i.stateAttribute,...f,...p,ref:o,style:{...p.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[c.jsx(ge,{children:r}),c.jsx(ve,{scope:e,isInside:!0,children:c.jsx(ie,{id:i.contentId,role:"tooltip",children:n||r})})]})})});U.displayName=b;var q="TooltipArrow",ye=s.forwardRef((t,o)=>{const{__scopeTooltip:e,...r}=t,n=k(e);return he(q,e).isInside?null:c.jsx(ae,{...n,...r,ref:o})});ye.displayName=q;function me(t,o){const e=Math.abs(o.top-t.y),r=Math.abs(o.bottom-t.y),n=Math.abs(o.right-t.x),l=Math.abs(o.left-t.x);switch(Math.min(e,r,n,l)){case l:return"left";case n:return"right";case e:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Te(t,o,e=5){const r=[];switch(o){case"top":r.push({x:t.x-e,y:t.y+e},{x:t.x+e,y:t.y+e});break;case"bottom":r.push({x:t.x-e,y:t.y-e},{x:t.x+e,y:t.y-e});break;case"left":r.push({x:t.x+e,y:t.y-e},{x:t.x+e,y:t.y+e});break;case"right":r.push({x:t.x-e,y:t.y-e},{x:t.x-e,y:t.y+e});break}return r}function Ce(t){const{top:o,right:e,bottom:r,left:n}=t;return[{x:n,y:o},{x:e,y:o},{x:e,y:r},{x:n,y:r}]}function be(t,o){const{x:e,y:r}=t;let n=!1;for(let l=0,a=o.length-1;l<o.length;a=l++){const p=o[l],i=o[a],f=p.x,u=p.y,x=i.x,v=i.y;u>r!=v>r&&e<(x-f)*(r-u)/(v-u)+f&&(n=!n)}return n}function we(t){const o=t.slice();return o.sort((e,r)=>e.x<r.x?-1:e.x>r.x?1:e.y<r.y?-1:e.y>r.y?1:0),Pe(o)}function Pe(t){if(t.length<=1)return t.slice();const o=[];for(let r=0;r<t.length;r++){const n=t[r];for(;o.length>=2;){const l=o[o.length-1],a=o[o.length-2];if((l.x-a.x)*(n.y-a.y)>=(l.y-a.y)*(n.x-a.x))o.pop();else break}o.push(n)}o.pop();const e=[];for(let r=t.length-1;r>=0;r--){const n=t[r];for(;e.length>=2;){const l=e[e.length-1],a=e[e.length-2];if((l.x-a.x)*(n.y-a.y)>=(l.y-a.y)*(n.x-a.x))e.pop();else break}e.push(n)}return e.pop(),o.length===1&&e.length===1&&o[0].x===e[0].x&&o[0].y===e[0].y?o:o.concat(e)}var Ee=z,Re=B,je=V,_e=K,ke=U;function He(t){return S("rounded text-foreground underline decoration-foreground/30 underline-offset-[3px] [overflow-wrap:anywhere]","transition-[text-decoration-color] duration-150 hover:decoration-foreground/80","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60",t)}function Ie({content:t,shortcut:o,children:e,side:r="top",align:n="center",delayDuration:l=300,disabled:a=!1,className:p}){return a||!t?c.jsx(c.Fragment,{children:e}):c.jsx(Ee,{delayDuration:l,skipDelayDuration:200,children:c.jsxs(Re,{children:[c.jsx(je,{asChild:!0,children:e}),c.jsx(_e,{children:c.jsxs(ke,{side:r,align:n,sideOffset:6,collisionPadding:8,className:S("z-[100] flex max-w-[260px] items-center gap-2 rounded-lg bg-inverse px-2.5 py-1.5 text-xs leading-relaxed text-inverse-foreground shadow-popover","origin-(--radix-tooltip-content-transform-origin) data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 duration-100",p),children:[c.jsx("span",{className:"min-w-0",children:t}),o&&c.jsx(ee,{keys:o,inverse:!0,className:"shrink-0"})]})})]})})}export{Ne as F,Ie as T,He as t};
1
+ import{c as X,r as s,j as c,w as $,v as W,x as H,P as J,y as C,z as I,C as Q,aT as Z,l as S}from"./index-BszkzNS4.js";import{K as ee}from"./kbd-8RRRm9jd.js";import{P as te,D as oe}from"./index-BPqjxXmH.js";import{R as re,A as ne,c as F,C as se,a as ae}from"./index-lZLy5rkr.js";import{R as ie}from"./index-DkSPjZm4.js";const le=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Ne=X("file-text",le);var[_]=Q("Tooltip",[F]),k=F(),G="TooltipProvider",ce=700,D="tooltip.open",[ue,L]=_(G),z=t=>{const{__scopeTooltip:o,delayDuration:e=ce,skipDelayDuration:r=300,disableHoverableContent:n=!1,children:l}=t,a=s.useRef(!0),p=s.useRef(!1),i=s.useRef(0);return s.useEffect(()=>{const f=i.current;return()=>window.clearTimeout(f)},[]),c.jsx(ue,{scope:o,isOpenDelayedRef:a,delayDuration:e,onOpen:s.useCallback(()=>{window.clearTimeout(i.current),a.current=!1},[]),onClose:s.useCallback(()=>{window.clearTimeout(i.current),i.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:p,onPointerInTransitChange:s.useCallback(f=>{p.current=f},[]),disableHoverableContent:n,children:l})};z.displayName=G;var R="Tooltip",[de,j]=_(R),B=t=>{const{__scopeTooltip:o,children:e,open:r,defaultOpen:n,onOpenChange:l,disableHoverableContent:a,delayDuration:p}=t,i=L(R,t.__scopeTooltip),f=k(o),[u,x]=s.useState(null),v=$(),d=s.useRef(0),h=a??i.disableHoverableContent,y=p??i.delayDuration,g=s.useRef(!1),[m,T]=W({prop:r,defaultProp:n??!1,onChange:N=>{N?(i.onOpen(),document.dispatchEvent(new CustomEvent(D))):i.onClose(),l?.(N)},caller:R}),w=s.useMemo(()=>m?g.current?"delayed-open":"instant-open":"closed",[m]),P=s.useCallback(()=>{window.clearTimeout(d.current),d.current=0,g.current=!1,T(!0)},[T]),E=s.useCallback(()=>{window.clearTimeout(d.current),d.current=0,T(!1)},[T]),M=s.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>{g.current=!0,T(!0),d.current=0},y)},[y,T]);return s.useEffect(()=>()=>{d.current&&(window.clearTimeout(d.current),d.current=0)},[]),c.jsx(re,{...f,children:c.jsx(de,{scope:o,contentId:v,open:m,stateAttribute:w,trigger:u,onTriggerChange:x,onTriggerEnter:s.useCallback(()=>{i.isOpenDelayedRef.current?M():P()},[i.isOpenDelayedRef,M,P]),onTriggerLeave:s.useCallback(()=>{h?E():(window.clearTimeout(d.current),d.current=0)},[E,h]),onOpen:P,onClose:E,disableHoverableContent:h,children:e})})};B.displayName=R;var O="TooltipTrigger",V=s.forwardRef((t,o)=>{const{__scopeTooltip:e,...r}=t,n=j(O,e),l=L(O,e),a=k(e),p=s.useRef(null),i=H(o,p,n.onTriggerChange),f=s.useRef(!1),u=s.useRef(!1),x=s.useCallback(()=>f.current=!1,[]);return s.useEffect(()=>()=>document.removeEventListener("pointerup",x),[x]),c.jsx(ne,{asChild:!0,...a,children:c.jsx(J.button,{"aria-describedby":n.open?n.contentId:void 0,"data-state":n.stateAttribute,...r,ref:i,onPointerMove:C(t.onPointerMove,v=>{v.pointerType!=="touch"&&!u.current&&!l.isPointerInTransitRef.current&&(n.onTriggerEnter(),u.current=!0)}),onPointerLeave:C(t.onPointerLeave,()=>{n.onTriggerLeave(),u.current=!1}),onPointerDown:C(t.onPointerDown,()=>{n.open&&n.onClose(),f.current=!0,document.addEventListener("pointerup",x,{once:!0})}),onFocus:C(t.onFocus,()=>{f.current||n.onOpen()}),onBlur:C(t.onBlur,n.onClose),onClick:C(t.onClick,n.onClose)})})});V.displayName=O;var A="TooltipPortal",[pe,fe]=_(A,{forceMount:void 0}),K=t=>{const{__scopeTooltip:o,forceMount:e,children:r,container:n}=t,l=j(A,o);return c.jsx(pe,{scope:o,forceMount:e,children:c.jsx(I,{present:e||l.open,children:c.jsx(te,{asChild:!0,container:n,children:r})})})};K.displayName=A;var b="TooltipContent",U=s.forwardRef((t,o)=>{const e=fe(b,t.__scopeTooltip),{forceMount:r=e.forceMount,side:n="top",...l}=t,a=j(b,t.__scopeTooltip);return c.jsx(I,{present:r||a.open,children:a.disableHoverableContent?c.jsx(Y,{side:n,...l,ref:o}):c.jsx(xe,{side:n,...l,ref:o})})}),xe=s.forwardRef((t,o)=>{const e=j(b,t.__scopeTooltip),r=L(b,t.__scopeTooltip),n=s.useRef(null),l=H(o,n),[a,p]=s.useState(null),{trigger:i,onClose:f}=e,u=n.current,{onPointerInTransitChange:x}=r,v=s.useCallback(()=>{p(null),x(!1)},[x]),d=s.useCallback((h,y)=>{const g=h.currentTarget,m={x:h.clientX,y:h.clientY},T=Te(m,g.getBoundingClientRect()),w=me(m,T),P=Ce(y.getBoundingClientRect()),E=we([...w,...P]);p(E),x(!0)},[x]);return s.useEffect(()=>()=>v(),[v]),s.useEffect(()=>{if(i&&u){const h=g=>d(g,u),y=g=>d(g,i);return i.addEventListener("pointerleave",h),u.addEventListener("pointerleave",y),()=>{i.removeEventListener("pointerleave",h),u.removeEventListener("pointerleave",y)}}},[i,u,d,v]),s.useEffect(()=>{if(a){const h=y=>{const g=y.target,m={x:y.clientX,y:y.clientY},T=i?.contains(g)||u?.contains(g),w=!be(m,a);T?v():w&&(v(),f())};return document.addEventListener("pointermove",h),()=>document.removeEventListener("pointermove",h)}},[i,u,a,f,v]),c.jsx(Y,{...t,ref:l})}),[ve,he]=_(R,{isInside:!1}),ge=Z("TooltipContent"),Y=s.forwardRef((t,o)=>{const{__scopeTooltip:e,children:r,"aria-label":n,onEscapeKeyDown:l,onPointerDownOutside:a,...p}=t,i=j(b,e),f=k(e),{onClose:u}=i;return s.useEffect(()=>(document.addEventListener(D,u),()=>document.removeEventListener(D,u)),[u]),s.useEffect(()=>{if(i.trigger){const x=v=>{v.target?.contains(i.trigger)&&u()};return window.addEventListener("scroll",x,{capture:!0}),()=>window.removeEventListener("scroll",x,{capture:!0})}},[i.trigger,u]),c.jsx(oe,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:a,onFocusOutside:x=>x.preventDefault(),onDismiss:u,children:c.jsxs(se,{"data-state":i.stateAttribute,...f,...p,ref:o,style:{...p.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[c.jsx(ge,{children:r}),c.jsx(ve,{scope:e,isInside:!0,children:c.jsx(ie,{id:i.contentId,role:"tooltip",children:n||r})})]})})});U.displayName=b;var q="TooltipArrow",ye=s.forwardRef((t,o)=>{const{__scopeTooltip:e,...r}=t,n=k(e);return he(q,e).isInside?null:c.jsx(ae,{...n,...r,ref:o})});ye.displayName=q;function Te(t,o){const e=Math.abs(o.top-t.y),r=Math.abs(o.bottom-t.y),n=Math.abs(o.right-t.x),l=Math.abs(o.left-t.x);switch(Math.min(e,r,n,l)){case l:return"left";case n:return"right";case e:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function me(t,o,e=5){const r=[];switch(o){case"top":r.push({x:t.x-e,y:t.y+e},{x:t.x+e,y:t.y+e});break;case"bottom":r.push({x:t.x-e,y:t.y-e},{x:t.x+e,y:t.y-e});break;case"left":r.push({x:t.x+e,y:t.y-e},{x:t.x+e,y:t.y+e});break;case"right":r.push({x:t.x-e,y:t.y-e},{x:t.x-e,y:t.y+e});break}return r}function Ce(t){const{top:o,right:e,bottom:r,left:n}=t;return[{x:n,y:o},{x:e,y:o},{x:e,y:r},{x:n,y:r}]}function be(t,o){const{x:e,y:r}=t;let n=!1;for(let l=0,a=o.length-1;l<o.length;a=l++){const p=o[l],i=o[a],f=p.x,u=p.y,x=i.x,v=i.y;u>r!=v>r&&e<(x-f)*(r-u)/(v-u)+f&&(n=!n)}return n}function we(t){const o=t.slice();return o.sort((e,r)=>e.x<r.x?-1:e.x>r.x?1:e.y<r.y?-1:e.y>r.y?1:0),Pe(o)}function Pe(t){if(t.length<=1)return t.slice();const o=[];for(let r=0;r<t.length;r++){const n=t[r];for(;o.length>=2;){const l=o[o.length-1],a=o[o.length-2];if((l.x-a.x)*(n.y-a.y)>=(l.y-a.y)*(n.x-a.x))o.pop();else break}o.push(n)}o.pop();const e=[];for(let r=t.length-1;r>=0;r--){const n=t[r];for(;e.length>=2;){const l=e[e.length-1],a=e[e.length-2];if((l.x-a.x)*(n.y-a.y)>=(l.y-a.y)*(n.x-a.x))e.pop();else break}e.push(n)}return e.pop(),o.length===1&&e.length===1&&o[0].x===e[0].x&&o[0].y===e[0].y?o:o.concat(e)}var Ee=z,Re=B,je=V,_e=K,ke=U;function He(t){return S("rounded text-foreground underline decoration-foreground/30 underline-offset-[3px] [overflow-wrap:anywhere]","transition-[text-decoration-color] duration-150 hover:decoration-foreground/80","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60",t)}function Ie({content:t,shortcut:o,children:e,side:r="top",align:n="center",delayDuration:l=300,disabled:a=!1,className:p}){return a||!t?c.jsx(c.Fragment,{children:e}):c.jsx(Ee,{delayDuration:l,skipDelayDuration:200,children:c.jsxs(Re,{children:[c.jsx(je,{asChild:!0,children:e}),c.jsx(_e,{children:c.jsxs(ke,{side:r,align:n,sideOffset:6,collisionPadding:8,className:S("z-[100] flex max-w-[260px] items-center gap-2 rounded-lg bg-inverse px-2.5 py-1.5 text-xs leading-relaxed text-inverse-foreground shadow-popover","origin-(--radix-tooltip-content-transform-origin) data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 duration-100",p),children:[c.jsx("span",{className:"min-w-0",children:t}),o&&c.jsx(ee,{keys:o,inverse:!0,className:"shrink-0"})]})})]})})}export{Ne as F,Ie as T,He as t};
@@ -1 +1 @@
1
- import{j as $,l as g}from"./index-Cc3qXMhU.js";function M(o,t,a){return Math.min(a,Math.max(t,o))}function H(o,t){const[a,r]=o,[s,n]=t,i=r===a?0:(n-s)/(r-a);return c=>s+(c-a)*i}function j(o,t){if(!(o>0)||t<=0)return 1;const a=o/t,r=10**Math.floor(Math.log10(a)),s=a/r;return(s>=7.5?10:s>=3.5?5:s>=1.5?2:1)*r}function m(o,t){const a=Math.max(0,-Math.floor(Math.log10(t)));return Number(o.toFixed(a))}function I(o,{count:t=4,includeZero:a=!0}={}){const r=o.filter(Number.isFinite);let s=r.length?Math.min(...r):0,n=r.length?Math.max(...r):1;a&&(s=Math.min(0,s),n=Math.max(0,n)),s===n&&(n=s+1);const i=j(n-s,t),c=m(Math.floor(s/i)*i,i),l=m(Math.ceil(n/i)*i,i),e=[];for(let u=c;u<=l+i/2;u+=i)e.push(m(u,i));return{min:c,max:l,ticks:e}}function N(o,t,a,{paddingInner:r=.4,paddingOuter:s=.2}={}){const n=Math.max(1,o),i=(a-t)/(n-r+s*2),c=i*(1-r),l=t+i*s;return{step:i,bandwidth:c,x:e=>l+e*i,center:e=>l+e*i+c/2}}function T(o,t,a,r,s=4){if(!(r>0)||!(a>0))return"";const n=Math.min(s,a/2,r);return[`M${o},${t+r}`,`V${t+n}`,`A${n},${n} 0 0 1 ${o+n},${t}`,`H${o+a-n}`,`A${n},${n} 0 0 1 ${o+a},${t+n}`,`V${t+r}`,"Z"].join("")}function L(o,t,a,r,s=4){if(!(r>0)||!(a>0))return"";const n=Math.min(s,r/2,a);return[`M${o},${t}`,`H${o+a-n}`,`A${n},${n} 0 0 1 ${o+a},${t+n}`,`V${t+r-n}`,`A${n},${n} 0 0 1 ${o+a-n},${t+r}`,`H${o}`,"Z"].join("")}function f(o,t,a,r){return[o+a*Math.sin(r),t-a*Math.cos(r)]}function h(o,t,a,r,s,n){const i=n-s;if(i<=0)return"";if(i>=Math.PI*2-1e-6){const d=s+Math.PI;return`${h(o,t,a,r,s,d)}${h(o,t,a,r,d,s+Math.PI*2-1e-6)}`}const c=i>Math.PI?1:0,[l,e]=f(o,t,a,s),[u,b]=f(o,t,a,n),[p,v]=f(o,t,r,n),[x,k]=f(o,t,r,s);return[`M${l},${e}`,`A${a},${a} 0 ${c} 1 ${u},${b}`,`L${p},${v}`,`A${r},${r} 0 ${c} 0 ${x},${k}`,"Z"].join("")}function E(o,t,[a,r]){const s=o.map((e,u)=>({value:e,index:u})).sort((e,u)=>e.value-u.value),n=s.map(e=>e.value),i=()=>{for(let e=1;e<n.length;e++)n[e]=Math.max(n[e],n[e-1]+t)};i();const c=n.length-1;if(c>=0&&n[c]>r){n[c]=r;for(let e=c-1;e>=0;e--)n[e]=Math.min(n[e],n[e+1]-t)}c>=0&&n[0]<a&&(n[0]=a,i());const l=new Array(o.length);return s.forEach((e,u)=>{l[e.index]=n[u]}),l}function F(o,t,a){return!(o>0)||!(t>0)?0:M(Math.ceil(o/t*(a-1)),1,a-1)}const A={ink:"bg-viz-6",neutral:"bg-viz-3",info:"bg-info",success:"bg-success",warning:"bg-warning",danger:"bg-destructive"},w={ink:"bg-viz-0",neutral:"bg-viz-0",info:"bg-info/15",success:"bg-success/15",warning:"bg-warning/15",danger:"bg-destructive/15"},P={xs:"h-1",sm:"h-1.5",md:"h-2"};function R({value:o,max:t=1,expected:a,tone:r="ink",size:s="sm",className:n,...i}){const c=t>0?M(o/t,0,1):0,l=a!==void 0&&t>0?M(a/t,0,1):null;return $.jsxs("div",{role:"progressbar","aria-label":i["aria-label"],"aria-valuemin":0,"aria-valuemax":t,"aria-valuenow":o,className:g("relative w-full rounded-full",P[s],w[r],n),children:[$.jsx("div",{className:g("h-full rounded-full transition-[width] duration-500 ease-enter motion-reduce:transition-none",A[r]),style:{width:c>0?`max(2px, ${c*100}%)`:0}}),l!==null&&$.jsx("span",{"aria-hidden":"true",className:"absolute -top-[3px] -bottom-[3px] w-0.5 -translate-x-1/2 rounded-full bg-foreground/60 ring-2 ring-background",style:{left:`${l*100}%`}})]})}export{R as T,T as a,N as b,M as c,E as d,h as e,L as f,j as g,H as l,I as n,F as q};
1
+ import{j as $,l as g}from"./index-BszkzNS4.js";function M(o,t,a){return Math.min(a,Math.max(t,o))}function H(o,t){const[a,r]=o,[s,n]=t,i=r===a?0:(n-s)/(r-a);return c=>s+(c-a)*i}function j(o,t){if(!(o>0)||t<=0)return 1;const a=o/t,r=10**Math.floor(Math.log10(a)),s=a/r;return(s>=7.5?10:s>=3.5?5:s>=1.5?2:1)*r}function m(o,t){const a=Math.max(0,-Math.floor(Math.log10(t)));return Number(o.toFixed(a))}function I(o,{count:t=4,includeZero:a=!0}={}){const r=o.filter(Number.isFinite);let s=r.length?Math.min(...r):0,n=r.length?Math.max(...r):1;a&&(s=Math.min(0,s),n=Math.max(0,n)),s===n&&(n=s+1);const i=j(n-s,t),c=m(Math.floor(s/i)*i,i),l=m(Math.ceil(n/i)*i,i),e=[];for(let u=c;u<=l+i/2;u+=i)e.push(m(u,i));return{min:c,max:l,ticks:e}}function N(o,t,a,{paddingInner:r=.4,paddingOuter:s=.2}={}){const n=Math.max(1,o),i=(a-t)/(n-r+s*2),c=i*(1-r),l=t+i*s;return{step:i,bandwidth:c,x:e=>l+e*i,center:e=>l+e*i+c/2}}function T(o,t,a,r,s=4){if(!(r>0)||!(a>0))return"";const n=Math.min(s,a/2,r);return[`M${o},${t+r}`,`V${t+n}`,`A${n},${n} 0 0 1 ${o+n},${t}`,`H${o+a-n}`,`A${n},${n} 0 0 1 ${o+a},${t+n}`,`V${t+r}`,"Z"].join("")}function L(o,t,a,r,s=4){if(!(r>0)||!(a>0))return"";const n=Math.min(s,r/2,a);return[`M${o},${t}`,`H${o+a-n}`,`A${n},${n} 0 0 1 ${o+a},${t+n}`,`V${t+r-n}`,`A${n},${n} 0 0 1 ${o+a-n},${t+r}`,`H${o}`,"Z"].join("")}function f(o,t,a,r){return[o+a*Math.sin(r),t-a*Math.cos(r)]}function h(o,t,a,r,s,n){const i=n-s;if(i<=0)return"";if(i>=Math.PI*2-1e-6){const d=s+Math.PI;return`${h(o,t,a,r,s,d)}${h(o,t,a,r,d,s+Math.PI*2-1e-6)}`}const c=i>Math.PI?1:0,[l,e]=f(o,t,a,s),[u,b]=f(o,t,a,n),[p,v]=f(o,t,r,n),[x,k]=f(o,t,r,s);return[`M${l},${e}`,`A${a},${a} 0 ${c} 1 ${u},${b}`,`L${p},${v}`,`A${r},${r} 0 ${c} 0 ${x},${k}`,"Z"].join("")}function E(o,t,[a,r]){const s=o.map((e,u)=>({value:e,index:u})).sort((e,u)=>e.value-u.value),n=s.map(e=>e.value),i=()=>{for(let e=1;e<n.length;e++)n[e]=Math.max(n[e],n[e-1]+t)};i();const c=n.length-1;if(c>=0&&n[c]>r){n[c]=r;for(let e=c-1;e>=0;e--)n[e]=Math.min(n[e],n[e+1]-t)}c>=0&&n[0]<a&&(n[0]=a,i());const l=new Array(o.length);return s.forEach((e,u)=>{l[e.index]=n[u]}),l}function F(o,t,a){return!(o>0)||!(t>0)?0:M(Math.ceil(o/t*(a-1)),1,a-1)}const A={ink:"bg-viz-6",neutral:"bg-viz-3",info:"bg-info",success:"bg-success",warning:"bg-warning",danger:"bg-destructive"},w={ink:"bg-viz-0",neutral:"bg-viz-0",info:"bg-info/15",success:"bg-success/15",warning:"bg-warning/15",danger:"bg-destructive/15"},P={xs:"h-1",sm:"h-1.5",md:"h-2"};function R({value:o,max:t=1,expected:a,tone:r="ink",size:s="sm",className:n,...i}){const c=t>0?M(o/t,0,1):0,l=a!==void 0&&t>0?M(a/t,0,1):null;return $.jsxs("div",{role:"progressbar","aria-label":i["aria-label"],"aria-valuemin":0,"aria-valuemax":t,"aria-valuenow":o,className:g("relative w-full rounded-full",P[s],w[r],n),children:[$.jsx("div",{className:g("h-full rounded-full transition-[width] duration-500 ease-enter motion-reduce:transition-none",A[r]),style:{width:c>0?`max(2px, ${c*100}%)`:0}}),l!==null&&$.jsx("span",{"aria-hidden":"true",className:"absolute -top-[3px] -bottom-[3px] w-0.5 -translate-x-1/2 rounded-full bg-foreground/60 ring-2 ring-background",style:{left:`${l*100}%`}})]})}export{R as T,T as a,N as b,M as c,E as d,h as e,L as f,j as g,H as l,I as n,F as q};
@@ -1 +1 @@
1
- import{c as a}from"./index-Cc3qXMhU.js";const t=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],h=a("plus",t);const e=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],s=a("trash-2",e);export{h as P,s as T};
1
+ import{c as a}from"./index-BszkzNS4.js";const t=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],h=a("plus",t);const e=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],s=a("trash-2",e);export{h as P,s as T};
@@ -1,4 +1,4 @@
1
- import{c as M,e as w,U as F,a as P,M as v,l as f,t as K,R as O}from"./monaco-BbAmalE2.js";import"./TaskHandoffPanel-CxH3Mgyd.js";import"./index-Cc3qXMhU.js";import"./ProjectKanbanPage-soDqevjQ.js";import"./confirm-dialog-DWeBZLJW.js";import"./dialog-D1lkhqVL.js";import"./index-DWrSDMX2.js";import"./BranchSelect-BAq4L2ZS.js";import"./popover-CUmBEXxL.js";import"./kbd-IjDGsZ2B.js";import"./search-ClmOQd4H.js";import"./index-DyJfPc4O.js";import"./index-Disv1kQS.js";import"./menu-styles-DWynpVVz.js";import"./chevron-down-DNhYsNAt.js";import"./check-DaZqOL8l.js";import"./CreateTaskInput-DjVxCAfc.js";import"./AttachmentPreview-DMS-PM-1.js";import"./tooltip-DuyJMci9.js";import"./index-Pt4TsHjm.js";import"./MemberAvatar-BLezO3vS.js";import"./people-DEeNaaLt.js";import"./BrandLogo--kWXXJtZ.js";import"./index-hpHE1jXY.js";import"./index-BMZFF1UJ.js";import"./use-providers-Dv1Nk6s7.js";import"./trash-2-CIyBqaVy.js";import"./ExecutionPermissionSelector-f1UYIm1z.js";import"./paperclip-YP3Bk1lI.js";import"./chip-Cf92J-pQ.js";import"./message-square-BE-pW0m_.js";import"./layers-Pdy9vZ6K.js";import"./copy-D0gl9kF8.js";import"./provider-selection-DSu7SCI7.js";import"./folder-picker-Czxm0_S9.js";import"./modal-CHLtZWvx.js";import"./mermaid-NOHMQCX5-nBsnjgeU.js";import"./use-translation-settings-CcUnipVO.js";import"./chevron-up-CjrLieBR.js";import"./at-sign-DYPIlD6D.js";import"./useTokenUsage-CZ5mDshD.js";import"./menu-DubntFHq.js";import"./select-BB7QG08o.js";import"./select-CYtYPr-c.js";import"./index-T38iVLEb.js";import"./textarea-BqYPvoO-.js";import"./content-JM9E1MeD.js";import"./file-BijjwxRR.js";import"./server-bEB_DY55.js";import"./upload-D05XS5-G.js";import"./globe-Ce01-45x.js";import"./pencil-BFDuhbtW.js";class E{constructor(e,t){this._modeId=e,this._defaults=t,this._worker=null,this._client=null,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker()),this._updateExtraLibsToken=0,this._extraLibsChangeListener=this._defaults.onDidExtraLibsChange(()=>this._updateExtraLibs())}dispose(){this._configChangeListener.dispose(),this._extraLibsChangeListener.dispose(),this._stopWorker()}_stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null}async _updateExtraLibs(){if(!this._worker)return;const e=++this._updateExtraLibsToken,t=await this._worker.getProxy();this._updateExtraLibsToken===e&&t.updateExtraLibs(this._defaults.getExtraLibs())}_getClient(){return this._client||(this._client=(async()=>(this._worker=M({moduleId:"vs/language/typescript/tsWorker",createWorker:()=>new Worker(new URL("/assets/ts.worker-BH9nVgjN.js",import.meta.url),{type:"module"}),label:this._modeId,keepIdleModels:!0,createData:{compilerOptions:this._defaults.getCompilerOptions(),extraLibs:this._defaults.getExtraLibs(),customWorkerPath:this._defaults.workerOptions.customWorkerPath,inlayHintsOptions:this._defaults.inlayHintsOptions}}),this._defaults.getEagerModelSync()?await this._worker.withSyncedResources(w.getModels().filter(e=>e.getLanguageId()===this._modeId).map(e=>e.uri)):await this._worker.getProxy()))()),this._client}async getLanguageServiceWorker(...e){const t=await this._getClient();return this._worker&&await this._worker.withSyncedResources(e),t}}const r={};r["lib.d.ts"]=!0;r["lib.decorators.d.ts"]=!0;r["lib.decorators.legacy.d.ts"]=!0;r["lib.dom.asynciterable.d.ts"]=!0;r["lib.dom.d.ts"]=!0;r["lib.dom.iterable.d.ts"]=!0;r["lib.es2015.collection.d.ts"]=!0;r["lib.es2015.core.d.ts"]=!0;r["lib.es2015.d.ts"]=!0;r["lib.es2015.generator.d.ts"]=!0;r["lib.es2015.iterable.d.ts"]=!0;r["lib.es2015.promise.d.ts"]=!0;r["lib.es2015.proxy.d.ts"]=!0;r["lib.es2015.reflect.d.ts"]=!0;r["lib.es2015.symbol.d.ts"]=!0;r["lib.es2015.symbol.wellknown.d.ts"]=!0;r["lib.es2016.array.include.d.ts"]=!0;r["lib.es2016.d.ts"]=!0;r["lib.es2016.full.d.ts"]=!0;r["lib.es2016.intl.d.ts"]=!0;r["lib.es2017.arraybuffer.d.ts"]=!0;r["lib.es2017.d.ts"]=!0;r["lib.es2017.date.d.ts"]=!0;r["lib.es2017.full.d.ts"]=!0;r["lib.es2017.intl.d.ts"]=!0;r["lib.es2017.object.d.ts"]=!0;r["lib.es2017.sharedmemory.d.ts"]=!0;r["lib.es2017.string.d.ts"]=!0;r["lib.es2017.typedarrays.d.ts"]=!0;r["lib.es2018.asyncgenerator.d.ts"]=!0;r["lib.es2018.asynciterable.d.ts"]=!0;r["lib.es2018.d.ts"]=!0;r["lib.es2018.full.d.ts"]=!0;r["lib.es2018.intl.d.ts"]=!0;r["lib.es2018.promise.d.ts"]=!0;r["lib.es2018.regexp.d.ts"]=!0;r["lib.es2019.array.d.ts"]=!0;r["lib.es2019.d.ts"]=!0;r["lib.es2019.full.d.ts"]=!0;r["lib.es2019.intl.d.ts"]=!0;r["lib.es2019.object.d.ts"]=!0;r["lib.es2019.string.d.ts"]=!0;r["lib.es2019.symbol.d.ts"]=!0;r["lib.es2020.bigint.d.ts"]=!0;r["lib.es2020.d.ts"]=!0;r["lib.es2020.date.d.ts"]=!0;r["lib.es2020.full.d.ts"]=!0;r["lib.es2020.intl.d.ts"]=!0;r["lib.es2020.number.d.ts"]=!0;r["lib.es2020.promise.d.ts"]=!0;r["lib.es2020.sharedmemory.d.ts"]=!0;r["lib.es2020.string.d.ts"]=!0;r["lib.es2020.symbol.wellknown.d.ts"]=!0;r["lib.es2021.d.ts"]=!0;r["lib.es2021.full.d.ts"]=!0;r["lib.es2021.intl.d.ts"]=!0;r["lib.es2021.promise.d.ts"]=!0;r["lib.es2021.string.d.ts"]=!0;r["lib.es2021.weakref.d.ts"]=!0;r["lib.es2022.array.d.ts"]=!0;r["lib.es2022.d.ts"]=!0;r["lib.es2022.error.d.ts"]=!0;r["lib.es2022.full.d.ts"]=!0;r["lib.es2022.intl.d.ts"]=!0;r["lib.es2022.object.d.ts"]=!0;r["lib.es2022.regexp.d.ts"]=!0;r["lib.es2022.string.d.ts"]=!0;r["lib.es2023.array.d.ts"]=!0;r["lib.es2023.collection.d.ts"]=!0;r["lib.es2023.d.ts"]=!0;r["lib.es2023.full.d.ts"]=!0;r["lib.es2023.intl.d.ts"]=!0;r["lib.es2024.arraybuffer.d.ts"]=!0;r["lib.es2024.collection.d.ts"]=!0;r["lib.es2024.d.ts"]=!0;r["lib.es2024.full.d.ts"]=!0;r["lib.es2024.object.d.ts"]=!0;r["lib.es2024.promise.d.ts"]=!0;r["lib.es2024.regexp.d.ts"]=!0;r["lib.es2024.sharedmemory.d.ts"]=!0;r["lib.es2024.string.d.ts"]=!0;r["lib.es5.d.ts"]=!0;r["lib.es6.d.ts"]=!0;r["lib.esnext.array.d.ts"]=!0;r["lib.esnext.collection.d.ts"]=!0;r["lib.esnext.d.ts"]=!0;r["lib.esnext.decorators.d.ts"]=!0;r["lib.esnext.disposable.d.ts"]=!0;r["lib.esnext.error.d.ts"]=!0;r["lib.esnext.float16.d.ts"]=!0;r["lib.esnext.full.d.ts"]=!0;r["lib.esnext.intl.d.ts"]=!0;r["lib.esnext.iterator.d.ts"]=!0;r["lib.esnext.promise.d.ts"]=!0;r["lib.esnext.sharedmemory.d.ts"]=!0;r["lib.scripthost.d.ts"]=!0;r["lib.webworker.asynciterable.d.ts"]=!0;r["lib.webworker.d.ts"]=!0;r["lib.webworker.importscripts.d.ts"]=!0;r["lib.webworker.iterable.d.ts"]=!0;function A(c,e,t=0){if(typeof c=="string")return c;if(c===void 0)return"";let o="";if(t){o+=e;for(let i=0;i<t;i++)o+=" "}if(o+=c.messageText,t++,c.next)for(const i of c.next)o+=A(i,e,t);return o}function _(c){return c?c.map(e=>e.text).join(""):""}class y{constructor(e){this._worker=e}_textSpanToRange(e,t){let o=e.getPositionAt(t.start),i=e.getPositionAt(t.start+t.length),{lineNumber:l,column:p}=o,{lineNumber:n,column:s}=i;return{startLineNumber:l,startColumn:p,endLineNumber:n,endColumn:s}}}class H{constructor(e){this._worker=e,this._libFiles={},this._hasFetchedLibFiles=!1,this._fetchLibFilesPromise=null}isLibFile(e){return e&&e.path.indexOf("/lib.")===0?!!r[e.path.slice(1)]:!1}getOrCreateModel(e){const t=F.parse(e),o=w.getModel(t);if(o)return o;if(this.isLibFile(t)&&this._hasFetchedLibFiles)return w.createModel(this._libFiles[t.path.slice(1)],"typescript",t);const i=K.getExtraLibs()[e];return i?w.createModel(i.content,"typescript",t):null}_containsLibFile(e){for(let t of e)if(this.isLibFile(t))return!0;return!1}async fetchLibFilesIfNecessary(e){this._containsLibFile(e)&&await this._fetchLibFiles()}_fetchLibFiles(){return this._fetchLibFilesPromise||(this._fetchLibFilesPromise=this._worker().then(e=>e.getLibFiles()).then(e=>{this._hasFetchedLibFiles=!0,this._libFiles=e})),this._fetchLibFilesPromise}}class V extends y{constructor(e,t,o,i){super(i),this._libFiles=e,this._defaults=t,this._selector=o,this._disposables=[],this._listener=Object.create(null);const l=s=>{if(s.getLanguageId()!==o)return;const u=()=>{const{onlyVisible:b}=this._defaults.getDiagnosticsOptions();b?s.isAttachedToEditor()&&this._doValidate(s):this._doValidate(s)};let d;const g=s.onDidChangeContent(()=>{clearTimeout(d),d=window.setTimeout(u,500)}),m=s.onDidChangeAttached(()=>{const{onlyVisible:b}=this._defaults.getDiagnosticsOptions();b&&(s.isAttachedToEditor()?u():w.setModelMarkers(s,this._selector,[]))});this._listener[s.uri.toString()]={dispose(){g.dispose(),m.dispose(),clearTimeout(d)}},u()},p=s=>{w.setModelMarkers(s,this._selector,[]);const u=s.uri.toString();this._listener[u]&&(this._listener[u].dispose(),delete this._listener[u])};this._disposables.push(w.onDidCreateModel(s=>l(s))),this._disposables.push(w.onWillDisposeModel(p)),this._disposables.push(w.onDidChangeModelLanguage(s=>{p(s.model),l(s.model)})),this._disposables.push({dispose(){for(const s of w.getModels())p(s)}});const n=()=>{for(const s of w.getModels())p(s),l(s)};this._disposables.push(this._defaults.onDidChange(n)),this._disposables.push(this._defaults.onDidExtraLibsChange(n)),w.getModels().forEach(s=>l(s))}dispose(){this._disposables.forEach(e=>e&&e.dispose()),this._disposables=[]}async _doValidate(e){const t=await this._worker(e.uri);if(e.isDisposed())return;const o=[],{noSyntaxValidation:i,noSemanticValidation:l,noSuggestionDiagnostics:p}=this._defaults.getDiagnosticsOptions();i||o.push(t.getSyntacticDiagnostics(e.uri.toString())),l||o.push(t.getSemanticDiagnostics(e.uri.toString())),p||o.push(t.getSuggestionDiagnostics(e.uri.toString()));const n=await Promise.all(o);if(!n||e.isDisposed())return;const s=n.reduce((d,g)=>g.concat(d),[]).filter(d=>(this._defaults.getDiagnosticsOptions().diagnosticCodesToIgnore||[]).indexOf(d.code)===-1),u=s.map(d=>d.relatedInformation||[]).reduce((d,g)=>g.concat(d),[]).map(d=>d.file?F.parse(d.file.fileName):null);await this._libFiles.fetchLibFilesIfNecessary(u),!e.isDisposed()&&w.setModelMarkers(e,this._selector,s.map(d=>this._convertDiagnostics(e,d)))}_convertDiagnostics(e,t){const o=t.start||0,i=t.length||1,{lineNumber:l,column:p}=e.getPositionAt(o),{lineNumber:n,column:s}=e.getPositionAt(o+i),u=[];return t.reportsUnnecessary&&u.push(P.Unnecessary),t.reportsDeprecated&&u.push(P.Deprecated),{severity:this._tsDiagnosticCategoryToMarkerSeverity(t.category),startLineNumber:l,startColumn:p,endLineNumber:n,endColumn:s,message:A(t.messageText,`
1
+ import{c as M,e as w,U as F,a as P,M as v,l as f,t as K,R as O}from"./monaco-CcHqpOKe.js";import"./TaskHandoffPanel-CJahUKNo.js";import"./index-BszkzNS4.js";import"./ProjectKanbanPage-CuGSLvrU.js";import"./confirm-dialog-CCjHVFTv.js";import"./dialog-DV4wfpNU.js";import"./index-BPqjxXmH.js";import"./BranchSelect-Kv3M1YhZ.js";import"./popover-CTqvKqTR.js";import"./kbd-8RRRm9jd.js";import"./search-CMIAPUEt.js";import"./index-DgUtx9rV.js";import"./index-lZLy5rkr.js";import"./menu-styles-DWynpVVz.js";import"./chevron-down-Ct7FZbKm.js";import"./check-yNWhPvMH.js";import"./CreateTaskInput-TcZpjBe-.js";import"./AttachmentPreview-TPd4gdfb.js";import"./tooltip-Cirpotu3.js";import"./index-DkSPjZm4.js";import"./MemberAvatar-CJtylxwu.js";import"./people-Dr0v8HK0.js";import"./BrandLogo-fR2lCwEo.js";import"./index-DuM6iAxG.js";import"./index-GuczxPxb.js";import"./use-providers-Bz6YNiYj.js";import"./trash-2-BEOQ1ICJ.js";import"./ExecutionPermissionSelector-C-akTOVg.js";import"./paperclip-C4t49vX2.js";import"./chip-BV_1-tIb.js";import"./message-square-DykJ2lWP.js";import"./layers-BH_LL4b8.js";import"./copy-C-jvx2et.js";import"./provider-selection-DSu7SCI7.js";import"./folder-picker-DiR-8Qdl.js";import"./modal-BwOwTzij.js";import"./mermaid-NOHMQCX5-CYeAhOl-.js";import"./use-translation-settings-CCpQNS30.js";import"./chevron-up-ARFlXMyO.js";import"./at-sign-Cf39WHCg.js";import"./useTokenUsage-D7SEwXb0.js";import"./menu-CMqbaDni.js";import"./select-DqB7YF38.js";import"./select-Bg7NI8i0.js";import"./index-BMcLxIvZ.js";import"./textarea-BCY2J2ca.js";import"./content-DZozZbBD.js";import"./file-Btui_I8Z.js";import"./server-D7knl8H9.js";import"./upload-tLVD0xMT.js";import"./globe-DAFqpAcW.js";import"./pencil-BQ5_raiB.js";class E{constructor(e,t){this._modeId=e,this._defaults=t,this._worker=null,this._client=null,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker()),this._updateExtraLibsToken=0,this._extraLibsChangeListener=this._defaults.onDidExtraLibsChange(()=>this._updateExtraLibs())}dispose(){this._configChangeListener.dispose(),this._extraLibsChangeListener.dispose(),this._stopWorker()}_stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null}async _updateExtraLibs(){if(!this._worker)return;const e=++this._updateExtraLibsToken,t=await this._worker.getProxy();this._updateExtraLibsToken===e&&t.updateExtraLibs(this._defaults.getExtraLibs())}_getClient(){return this._client||(this._client=(async()=>(this._worker=M({moduleId:"vs/language/typescript/tsWorker",createWorker:()=>new Worker(new URL("/assets/ts.worker-BH9nVgjN.js",import.meta.url),{type:"module"}),label:this._modeId,keepIdleModels:!0,createData:{compilerOptions:this._defaults.getCompilerOptions(),extraLibs:this._defaults.getExtraLibs(),customWorkerPath:this._defaults.workerOptions.customWorkerPath,inlayHintsOptions:this._defaults.inlayHintsOptions}}),this._defaults.getEagerModelSync()?await this._worker.withSyncedResources(w.getModels().filter(e=>e.getLanguageId()===this._modeId).map(e=>e.uri)):await this._worker.getProxy()))()),this._client}async getLanguageServiceWorker(...e){const t=await this._getClient();return this._worker&&await this._worker.withSyncedResources(e),t}}const r={};r["lib.d.ts"]=!0;r["lib.decorators.d.ts"]=!0;r["lib.decorators.legacy.d.ts"]=!0;r["lib.dom.asynciterable.d.ts"]=!0;r["lib.dom.d.ts"]=!0;r["lib.dom.iterable.d.ts"]=!0;r["lib.es2015.collection.d.ts"]=!0;r["lib.es2015.core.d.ts"]=!0;r["lib.es2015.d.ts"]=!0;r["lib.es2015.generator.d.ts"]=!0;r["lib.es2015.iterable.d.ts"]=!0;r["lib.es2015.promise.d.ts"]=!0;r["lib.es2015.proxy.d.ts"]=!0;r["lib.es2015.reflect.d.ts"]=!0;r["lib.es2015.symbol.d.ts"]=!0;r["lib.es2015.symbol.wellknown.d.ts"]=!0;r["lib.es2016.array.include.d.ts"]=!0;r["lib.es2016.d.ts"]=!0;r["lib.es2016.full.d.ts"]=!0;r["lib.es2016.intl.d.ts"]=!0;r["lib.es2017.arraybuffer.d.ts"]=!0;r["lib.es2017.d.ts"]=!0;r["lib.es2017.date.d.ts"]=!0;r["lib.es2017.full.d.ts"]=!0;r["lib.es2017.intl.d.ts"]=!0;r["lib.es2017.object.d.ts"]=!0;r["lib.es2017.sharedmemory.d.ts"]=!0;r["lib.es2017.string.d.ts"]=!0;r["lib.es2017.typedarrays.d.ts"]=!0;r["lib.es2018.asyncgenerator.d.ts"]=!0;r["lib.es2018.asynciterable.d.ts"]=!0;r["lib.es2018.d.ts"]=!0;r["lib.es2018.full.d.ts"]=!0;r["lib.es2018.intl.d.ts"]=!0;r["lib.es2018.promise.d.ts"]=!0;r["lib.es2018.regexp.d.ts"]=!0;r["lib.es2019.array.d.ts"]=!0;r["lib.es2019.d.ts"]=!0;r["lib.es2019.full.d.ts"]=!0;r["lib.es2019.intl.d.ts"]=!0;r["lib.es2019.object.d.ts"]=!0;r["lib.es2019.string.d.ts"]=!0;r["lib.es2019.symbol.d.ts"]=!0;r["lib.es2020.bigint.d.ts"]=!0;r["lib.es2020.d.ts"]=!0;r["lib.es2020.date.d.ts"]=!0;r["lib.es2020.full.d.ts"]=!0;r["lib.es2020.intl.d.ts"]=!0;r["lib.es2020.number.d.ts"]=!0;r["lib.es2020.promise.d.ts"]=!0;r["lib.es2020.sharedmemory.d.ts"]=!0;r["lib.es2020.string.d.ts"]=!0;r["lib.es2020.symbol.wellknown.d.ts"]=!0;r["lib.es2021.d.ts"]=!0;r["lib.es2021.full.d.ts"]=!0;r["lib.es2021.intl.d.ts"]=!0;r["lib.es2021.promise.d.ts"]=!0;r["lib.es2021.string.d.ts"]=!0;r["lib.es2021.weakref.d.ts"]=!0;r["lib.es2022.array.d.ts"]=!0;r["lib.es2022.d.ts"]=!0;r["lib.es2022.error.d.ts"]=!0;r["lib.es2022.full.d.ts"]=!0;r["lib.es2022.intl.d.ts"]=!0;r["lib.es2022.object.d.ts"]=!0;r["lib.es2022.regexp.d.ts"]=!0;r["lib.es2022.string.d.ts"]=!0;r["lib.es2023.array.d.ts"]=!0;r["lib.es2023.collection.d.ts"]=!0;r["lib.es2023.d.ts"]=!0;r["lib.es2023.full.d.ts"]=!0;r["lib.es2023.intl.d.ts"]=!0;r["lib.es2024.arraybuffer.d.ts"]=!0;r["lib.es2024.collection.d.ts"]=!0;r["lib.es2024.d.ts"]=!0;r["lib.es2024.full.d.ts"]=!0;r["lib.es2024.object.d.ts"]=!0;r["lib.es2024.promise.d.ts"]=!0;r["lib.es2024.regexp.d.ts"]=!0;r["lib.es2024.sharedmemory.d.ts"]=!0;r["lib.es2024.string.d.ts"]=!0;r["lib.es5.d.ts"]=!0;r["lib.es6.d.ts"]=!0;r["lib.esnext.array.d.ts"]=!0;r["lib.esnext.collection.d.ts"]=!0;r["lib.esnext.d.ts"]=!0;r["lib.esnext.decorators.d.ts"]=!0;r["lib.esnext.disposable.d.ts"]=!0;r["lib.esnext.error.d.ts"]=!0;r["lib.esnext.float16.d.ts"]=!0;r["lib.esnext.full.d.ts"]=!0;r["lib.esnext.intl.d.ts"]=!0;r["lib.esnext.iterator.d.ts"]=!0;r["lib.esnext.promise.d.ts"]=!0;r["lib.esnext.sharedmemory.d.ts"]=!0;r["lib.scripthost.d.ts"]=!0;r["lib.webworker.asynciterable.d.ts"]=!0;r["lib.webworker.d.ts"]=!0;r["lib.webworker.importscripts.d.ts"]=!0;r["lib.webworker.iterable.d.ts"]=!0;function A(c,e,t=0){if(typeof c=="string")return c;if(c===void 0)return"";let o="";if(t){o+=e;for(let i=0;i<t;i++)o+=" "}if(o+=c.messageText,t++,c.next)for(const i of c.next)o+=A(i,e,t);return o}function _(c){return c?c.map(e=>e.text).join(""):""}class y{constructor(e){this._worker=e}_textSpanToRange(e,t){let o=e.getPositionAt(t.start),i=e.getPositionAt(t.start+t.length),{lineNumber:l,column:p}=o,{lineNumber:n,column:s}=i;return{startLineNumber:l,startColumn:p,endLineNumber:n,endColumn:s}}}class H{constructor(e){this._worker=e,this._libFiles={},this._hasFetchedLibFiles=!1,this._fetchLibFilesPromise=null}isLibFile(e){return e&&e.path.indexOf("/lib.")===0?!!r[e.path.slice(1)]:!1}getOrCreateModel(e){const t=F.parse(e),o=w.getModel(t);if(o)return o;if(this.isLibFile(t)&&this._hasFetchedLibFiles)return w.createModel(this._libFiles[t.path.slice(1)],"typescript",t);const i=K.getExtraLibs()[e];return i?w.createModel(i.content,"typescript",t):null}_containsLibFile(e){for(let t of e)if(this.isLibFile(t))return!0;return!1}async fetchLibFilesIfNecessary(e){this._containsLibFile(e)&&await this._fetchLibFiles()}_fetchLibFiles(){return this._fetchLibFilesPromise||(this._fetchLibFilesPromise=this._worker().then(e=>e.getLibFiles()).then(e=>{this._hasFetchedLibFiles=!0,this._libFiles=e})),this._fetchLibFilesPromise}}class V extends y{constructor(e,t,o,i){super(i),this._libFiles=e,this._defaults=t,this._selector=o,this._disposables=[],this._listener=Object.create(null);const l=s=>{if(s.getLanguageId()!==o)return;const u=()=>{const{onlyVisible:b}=this._defaults.getDiagnosticsOptions();b?s.isAttachedToEditor()&&this._doValidate(s):this._doValidate(s)};let d;const g=s.onDidChangeContent(()=>{clearTimeout(d),d=window.setTimeout(u,500)}),m=s.onDidChangeAttached(()=>{const{onlyVisible:b}=this._defaults.getDiagnosticsOptions();b&&(s.isAttachedToEditor()?u():w.setModelMarkers(s,this._selector,[]))});this._listener[s.uri.toString()]={dispose(){g.dispose(),m.dispose(),clearTimeout(d)}},u()},p=s=>{w.setModelMarkers(s,this._selector,[]);const u=s.uri.toString();this._listener[u]&&(this._listener[u].dispose(),delete this._listener[u])};this._disposables.push(w.onDidCreateModel(s=>l(s))),this._disposables.push(w.onWillDisposeModel(p)),this._disposables.push(w.onDidChangeModelLanguage(s=>{p(s.model),l(s.model)})),this._disposables.push({dispose(){for(const s of w.getModels())p(s)}});const n=()=>{for(const s of w.getModels())p(s),l(s)};this._disposables.push(this._defaults.onDidChange(n)),this._disposables.push(this._defaults.onDidExtraLibsChange(n)),w.getModels().forEach(s=>l(s))}dispose(){this._disposables.forEach(e=>e&&e.dispose()),this._disposables=[]}async _doValidate(e){const t=await this._worker(e.uri);if(e.isDisposed())return;const o=[],{noSyntaxValidation:i,noSemanticValidation:l,noSuggestionDiagnostics:p}=this._defaults.getDiagnosticsOptions();i||o.push(t.getSyntacticDiagnostics(e.uri.toString())),l||o.push(t.getSemanticDiagnostics(e.uri.toString())),p||o.push(t.getSuggestionDiagnostics(e.uri.toString()));const n=await Promise.all(o);if(!n||e.isDisposed())return;const s=n.reduce((d,g)=>g.concat(d),[]).filter(d=>(this._defaults.getDiagnosticsOptions().diagnosticCodesToIgnore||[]).indexOf(d.code)===-1),u=s.map(d=>d.relatedInformation||[]).reduce((d,g)=>g.concat(d),[]).map(d=>d.file?F.parse(d.file.fileName):null);await this._libFiles.fetchLibFilesIfNecessary(u),!e.isDisposed()&&w.setModelMarkers(e,this._selector,s.map(d=>this._convertDiagnostics(e,d)))}_convertDiagnostics(e,t){const o=t.start||0,i=t.length||1,{lineNumber:l,column:p}=e.getPositionAt(o),{lineNumber:n,column:s}=e.getPositionAt(o+i),u=[];return t.reportsUnnecessary&&u.push(P.Unnecessary),t.reportsDeprecated&&u.push(P.Deprecated),{severity:this._tsDiagnosticCategoryToMarkerSeverity(t.category),startLineNumber:l,startColumn:p,endLineNumber:n,endColumn:s,message:A(t.messageText,`
2
2
  `),code:t.code.toString(),tags:u,relatedInformation:this._convertRelatedInformation(e,t.relatedInformation)}}_convertRelatedInformation(e,t){if(!t)return[];const o=[];return t.forEach(i=>{let l=e;if(i.file&&(l=this._libFiles.getOrCreateModel(i.file.fileName)),!l)return;const p=i.start||0,n=i.length||1,{lineNumber:s,column:u}=l.getPositionAt(p),{lineNumber:d,column:g}=l.getPositionAt(p+n);o.push({resource:l.uri,startLineNumber:s,startColumn:u,endLineNumber:d,endColumn:g,message:A(i.messageText,`
3
3
  `)})}),o}_tsDiagnosticCategoryToMarkerSeverity(e){switch(e){case 1:return v.Error;case 3:return v.Info;case 0:return v.Warning;case 2:return v.Hint}return v.Info}}class C extends y{get triggerCharacters(){return["."]}async provideCompletionItems(e,t,o,i){const l=e.getWordUntilPosition(t),p=new O(t.lineNumber,l.startColumn,t.lineNumber,l.endColumn),n=e.uri,s=e.getOffsetAt(t),u=await this._worker(n);if(e.isDisposed())return;const d=await u.getCompletionsAtPosition(n.toString(),s);return!d||e.isDisposed()?void 0:{suggestions:d.entries.map(m=>{let b=p;if(m.replacementSpan){const x=e.getPositionAt(m.replacementSpan.start),D=e.getPositionAt(m.replacementSpan.start+m.replacementSpan.length);b=new O(x.lineNumber,x.column,D.lineNumber,D.column)}const k=[];return m.kindModifiers!==void 0&&m.kindModifiers.indexOf("deprecated")!==-1&&k.push(f.CompletionItemTag.Deprecated),{uri:n,position:t,offset:s,range:b,label:m.name,insertText:m.name,sortText:m.sortText,kind:C.convertKind(m.kind),tags:k}})}}async resolveCompletionItem(e,t){const o=e,i=o.uri,l=o.position,p=o.offset,s=await(await this._worker(i)).getCompletionEntryDetails(i.toString(),p,o.label);return s?{uri:i,position:l,label:s.name,kind:C.convertKind(s.kind),detail:_(s.displayParts),documentation:{value:C.createDocumentationString(s)}}:o}static convertKind(e){switch(e){case a.primitiveType:case a.keyword:return f.CompletionItemKind.Keyword;case a.variable:case a.localVariable:return f.CompletionItemKind.Variable;case a.memberVariable:case a.memberGetAccessor:case a.memberSetAccessor:return f.CompletionItemKind.Field;case a.function:case a.memberFunction:case a.constructSignature:case a.callSignature:case a.indexSignature:return f.CompletionItemKind.Function;case a.enum:return f.CompletionItemKind.Enum;case a.module:return f.CompletionItemKind.Module;case a.class:return f.CompletionItemKind.Class;case a.interface:return f.CompletionItemKind.Interface;case a.warning:return f.CompletionItemKind.File}return f.CompletionItemKind.Property}static createDocumentationString(e){let t=_(e.documentation);if(e.tags)for(const o of e.tags)t+=`
4
4
 
@@ -1 +1 @@
1
- import{l as e}from"./monaco-BbAmalE2.js";import"./TaskHandoffPanel-CxH3Mgyd.js";import"./index-Cc3qXMhU.js";import"./ProjectKanbanPage-soDqevjQ.js";import"./confirm-dialog-DWeBZLJW.js";import"./dialog-D1lkhqVL.js";import"./index-DWrSDMX2.js";import"./BranchSelect-BAq4L2ZS.js";import"./popover-CUmBEXxL.js";import"./kbd-IjDGsZ2B.js";import"./search-ClmOQd4H.js";import"./index-DyJfPc4O.js";import"./index-Disv1kQS.js";import"./menu-styles-DWynpVVz.js";import"./chevron-down-DNhYsNAt.js";import"./check-DaZqOL8l.js";import"./CreateTaskInput-DjVxCAfc.js";import"./AttachmentPreview-DMS-PM-1.js";import"./tooltip-DuyJMci9.js";import"./index-Pt4TsHjm.js";import"./MemberAvatar-BLezO3vS.js";import"./people-DEeNaaLt.js";import"./BrandLogo--kWXXJtZ.js";import"./index-hpHE1jXY.js";import"./index-BMZFF1UJ.js";import"./use-providers-Dv1Nk6s7.js";import"./trash-2-CIyBqaVy.js";import"./ExecutionPermissionSelector-f1UYIm1z.js";import"./paperclip-YP3Bk1lI.js";import"./chip-Cf92J-pQ.js";import"./message-square-BE-pW0m_.js";import"./layers-Pdy9vZ6K.js";import"./copy-D0gl9kF8.js";import"./provider-selection-DSu7SCI7.js";import"./folder-picker-Czxm0_S9.js";import"./modal-CHLtZWvx.js";import"./mermaid-NOHMQCX5-nBsnjgeU.js";import"./use-translation-settings-CcUnipVO.js";import"./chevron-up-CjrLieBR.js";import"./at-sign-DYPIlD6D.js";import"./useTokenUsage-CZ5mDshD.js";import"./menu-DubntFHq.js";import"./select-BB7QG08o.js";import"./select-CYtYPr-c.js";import"./index-T38iVLEb.js";import"./textarea-BqYPvoO-.js";import"./content-JM9E1MeD.js";import"./file-BijjwxRR.js";import"./server-bEB_DY55.js";import"./upload-D05XS5-G.js";import"./globe-Ce01-45x.js";import"./pencil-BFDuhbtW.js";const Y={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],onEnterRules:[{beforeText:/^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,afterText:/^\s*\*\/$/,action:{indentAction:e.IndentAction.IndentOutdent,appendText:" * "}},{beforeText:/^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,action:{indentAction:e.IndentAction.None,appendText:" * "}},{beforeText:/^(\t|(\ \ ))*\ \*(\ ([^\*]|\*(?!\/))*)?$/,action:{indentAction:e.IndentAction.None,appendText:"* "}},{beforeText:/^(\t|(\ \ ))*\ \*\/\s*$/,action:{indentAction:e.IndentAction.None,removeText:1}}],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string","comment"]},{open:"`",close:"`",notIn:["string","comment"]},{open:"/**",close:" */",notIn:["string"]}],folding:{markers:{start:new RegExp("^\\s*//\\s*#?region\\b"),end:new RegExp("^\\s*//\\s*#?endregion\\b")}}},ee={defaultToken:"invalid",tokenPostfix:".ts",keywords:["abstract","any","as","asserts","bigint","boolean","break","case","catch","class","continue","const","constructor","debugger","declare","default","delete","do","else","enum","export","extends","false","finally","for","from","function","get","if","implements","import","in","infer","instanceof","interface","is","keyof","let","module","namespace","never","new","null","number","object","out","package","private","protected","public","override","readonly","require","global","return","satisfies","set","static","string","super","switch","symbol","this","throw","true","try","type","typeof","undefined","unique","unknown","var","void","while","with","yield","async","await","of"],operators:["<=",">=","==","!=","===","!==","=>","+","-","**","*","/","%","++","--","<<","</",">>",">>>","&","|","^","!","~","&&","||","??","?",":","=","+=","-=","*=","**=","/=","%=","<<=",">>=",">>>=","&=","|=","^=","@"],symbols:/[=><!~?:&|+\-*\/\^%]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,digits:/\d+(_+\d+)*/,octaldigits:/[0-7]+(_+[0-7]+)*/,binarydigits:/[0-1]+(_+[0-1]+)*/,hexdigits:/[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/,regexpctl:/[(){}\[\]\$\^|\-*+?\.]/,regexpesc:/\\(?:[bBdDfnrstvwWn0\\\/]|@regexpctl|c[A-Z]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4})/,tokenizer:{root:[[/[{}]/,"delimiter.bracket"],{include:"common"}],common:[[/#?[a-z_$][\w$]*/,{cases:{"@keywords":"keyword","@default":"identifier"}}],[/[A-Z][\w\$]*/,"type.identifier"],{include:"@whitespace"},[/\/(?=([^\\\/]|\\.)+\/([dgimsuy]*)(\s*)(\.|;|,|\)|\]|\}|$))/,{token:"regexp",bracket:"@open",next:"@regexp"}],[/[()\[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/!(?=([^=]|$))/,"delimiter"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/(@digits)[eE]([\-+]?(@digits))?/,"number.float"],[/(@digits)\.(@digits)([eE][\-+]?(@digits))?/,"number.float"],[/0[xX](@hexdigits)n?/,"number.hex"],[/0[oO]?(@octaldigits)n?/,"number.octal"],[/0[bB](@binarydigits)n?/,"number.binary"],[/(@digits)n?/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string_double"],[/'/,"string","@string_single"],[/`/,"string","@string_backtick"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@jsdoc"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],jsdoc:[[/[^\/*]+/,"comment.doc"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],regexp:[[/(\{)(\d+(?:,\d*)?)(\})/,["regexp.escape.control","regexp.escape.control","regexp.escape.control"]],[/(\[)(\^?)(?=(?:[^\]\\\/]|\\.)+)/,["regexp.escape.control",{token:"regexp.escape.control",next:"@regexrange"}]],[/(\()(\?:|\?=|\?!)/,["regexp.escape.control","regexp.escape.control"]],[/[()]/,"regexp.escape.control"],[/@regexpctl/,"regexp.escape.control"],[/[^\\\/]/,"regexp"],[/@regexpesc/,"regexp.escape"],[/\\\./,"regexp.invalid"],[/(\/)([dgimsuy]*)/,[{token:"regexp",bracket:"@close",next:"@pop"},"keyword.other"]]],regexrange:[[/-/,"regexp.escape.control"],[/\^/,"regexp.invalid"],[/@regexpesc/,"regexp.escape"],[/[^\]]/,"regexp"],[/\]/,{token:"regexp.escape.control",next:"@pop",bracket:"@close"}]],string_double:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],string_single:[[/[^\\']+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/'/,"string","@pop"]],string_backtick:[[/\$\{/,{token:"delimiter.bracket",next:"@bracketCounting"}],[/[^\\`$]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/`/,"string","@pop"]],bracketCounting:[[/\{/,"delimiter.bracket","@bracketCounting"],[/\}/,"delimiter.bracket","@pop"],{include:"common"}]}};export{Y as conf,ee as language};
1
+ import{l as e}from"./monaco-CcHqpOKe.js";import"./TaskHandoffPanel-CJahUKNo.js";import"./index-BszkzNS4.js";import"./ProjectKanbanPage-CuGSLvrU.js";import"./confirm-dialog-CCjHVFTv.js";import"./dialog-DV4wfpNU.js";import"./index-BPqjxXmH.js";import"./BranchSelect-Kv3M1YhZ.js";import"./popover-CTqvKqTR.js";import"./kbd-8RRRm9jd.js";import"./search-CMIAPUEt.js";import"./index-DgUtx9rV.js";import"./index-lZLy5rkr.js";import"./menu-styles-DWynpVVz.js";import"./chevron-down-Ct7FZbKm.js";import"./check-yNWhPvMH.js";import"./CreateTaskInput-TcZpjBe-.js";import"./AttachmentPreview-TPd4gdfb.js";import"./tooltip-Cirpotu3.js";import"./index-DkSPjZm4.js";import"./MemberAvatar-CJtylxwu.js";import"./people-Dr0v8HK0.js";import"./BrandLogo-fR2lCwEo.js";import"./index-DuM6iAxG.js";import"./index-GuczxPxb.js";import"./use-providers-Bz6YNiYj.js";import"./trash-2-BEOQ1ICJ.js";import"./ExecutionPermissionSelector-C-akTOVg.js";import"./paperclip-C4t49vX2.js";import"./chip-BV_1-tIb.js";import"./message-square-DykJ2lWP.js";import"./layers-BH_LL4b8.js";import"./copy-C-jvx2et.js";import"./provider-selection-DSu7SCI7.js";import"./folder-picker-DiR-8Qdl.js";import"./modal-BwOwTzij.js";import"./mermaid-NOHMQCX5-CYeAhOl-.js";import"./use-translation-settings-CCpQNS30.js";import"./chevron-up-ARFlXMyO.js";import"./at-sign-Cf39WHCg.js";import"./useTokenUsage-D7SEwXb0.js";import"./menu-CMqbaDni.js";import"./select-DqB7YF38.js";import"./select-Bg7NI8i0.js";import"./index-BMcLxIvZ.js";import"./textarea-BCY2J2ca.js";import"./content-DZozZbBD.js";import"./file-Btui_I8Z.js";import"./server-D7knl8H9.js";import"./upload-tLVD0xMT.js";import"./globe-DAFqpAcW.js";import"./pencil-BQ5_raiB.js";const Y={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],onEnterRules:[{beforeText:/^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,afterText:/^\s*\*\/$/,action:{indentAction:e.IndentAction.IndentOutdent,appendText:" * "}},{beforeText:/^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,action:{indentAction:e.IndentAction.None,appendText:" * "}},{beforeText:/^(\t|(\ \ ))*\ \*(\ ([^\*]|\*(?!\/))*)?$/,action:{indentAction:e.IndentAction.None,appendText:"* "}},{beforeText:/^(\t|(\ \ ))*\ \*\/\s*$/,action:{indentAction:e.IndentAction.None,removeText:1}}],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string","comment"]},{open:"`",close:"`",notIn:["string","comment"]},{open:"/**",close:" */",notIn:["string"]}],folding:{markers:{start:new RegExp("^\\s*//\\s*#?region\\b"),end:new RegExp("^\\s*//\\s*#?endregion\\b")}}},ee={defaultToken:"invalid",tokenPostfix:".ts",keywords:["abstract","any","as","asserts","bigint","boolean","break","case","catch","class","continue","const","constructor","debugger","declare","default","delete","do","else","enum","export","extends","false","finally","for","from","function","get","if","implements","import","in","infer","instanceof","interface","is","keyof","let","module","namespace","never","new","null","number","object","out","package","private","protected","public","override","readonly","require","global","return","satisfies","set","static","string","super","switch","symbol","this","throw","true","try","type","typeof","undefined","unique","unknown","var","void","while","with","yield","async","await","of"],operators:["<=",">=","==","!=","===","!==","=>","+","-","**","*","/","%","++","--","<<","</",">>",">>>","&","|","^","!","~","&&","||","??","?",":","=","+=","-=","*=","**=","/=","%=","<<=",">>=",">>>=","&=","|=","^=","@"],symbols:/[=><!~?:&|+\-*\/\^%]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,digits:/\d+(_+\d+)*/,octaldigits:/[0-7]+(_+[0-7]+)*/,binarydigits:/[0-1]+(_+[0-1]+)*/,hexdigits:/[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/,regexpctl:/[(){}\[\]\$\^|\-*+?\.]/,regexpesc:/\\(?:[bBdDfnrstvwWn0\\\/]|@regexpctl|c[A-Z]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4})/,tokenizer:{root:[[/[{}]/,"delimiter.bracket"],{include:"common"}],common:[[/#?[a-z_$][\w$]*/,{cases:{"@keywords":"keyword","@default":"identifier"}}],[/[A-Z][\w\$]*/,"type.identifier"],{include:"@whitespace"},[/\/(?=([^\\\/]|\\.)+\/([dgimsuy]*)(\s*)(\.|;|,|\)|\]|\}|$))/,{token:"regexp",bracket:"@open",next:"@regexp"}],[/[()\[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/!(?=([^=]|$))/,"delimiter"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/(@digits)[eE]([\-+]?(@digits))?/,"number.float"],[/(@digits)\.(@digits)([eE][\-+]?(@digits))?/,"number.float"],[/0[xX](@hexdigits)n?/,"number.hex"],[/0[oO]?(@octaldigits)n?/,"number.octal"],[/0[bB](@binarydigits)n?/,"number.binary"],[/(@digits)n?/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string_double"],[/'/,"string","@string_single"],[/`/,"string","@string_backtick"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@jsdoc"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],jsdoc:[[/[^\/*]+/,"comment.doc"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],regexp:[[/(\{)(\d+(?:,\d*)?)(\})/,["regexp.escape.control","regexp.escape.control","regexp.escape.control"]],[/(\[)(\^?)(?=(?:[^\]\\\/]|\\.)+)/,["regexp.escape.control",{token:"regexp.escape.control",next:"@regexrange"}]],[/(\()(\?:|\?=|\?!)/,["regexp.escape.control","regexp.escape.control"]],[/[()]/,"regexp.escape.control"],[/@regexpctl/,"regexp.escape.control"],[/[^\\\/]/,"regexp"],[/@regexpesc/,"regexp.escape"],[/\\\./,"regexp.invalid"],[/(\/)([dgimsuy]*)/,[{token:"regexp",bracket:"@close",next:"@pop"},"keyword.other"]]],regexrange:[[/-/,"regexp.escape.control"],[/\^/,"regexp.invalid"],[/@regexpesc/,"regexp.escape"],[/[^\]]/,"regexp"],[/\]/,{token:"regexp.escape.control",next:"@pop",bracket:"@close"}]],string_double:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],string_single:[[/[^\\']+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/'/,"string","@pop"]],string_backtick:[[/\$\{/,{token:"delimiter.bracket",next:"@bracketCounting"}],[/[^\\`$]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/`/,"string","@pop"]],bracketCounting:[[/\{/,"delimiter.bracket","@bracketCounting"],[/\}/,"delimiter.bracket","@pop"],{include:"common"}]}};export{Y as conf,ee as language};
@@ -1 +1 @@
1
- import{c as a}from"./index-Cc3qXMhU.js";const o=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],t=a("upload",o);export{t as U};
1
+ import{c as a}from"./index-BszkzNS4.js";const o=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],t=a("upload",o);export{t as U};
@@ -1 +1 @@
1
- import{m as n,o as i,n as a,q as s,p as r}from"./index-Cc3qXMhU.js";function f(){return n({queryKey:s.profiles.all,queryFn:()=>r.get("/profiles")})}function y(){return n({queryKey:s.profiles.defaults,queryFn:()=>r.get("/profiles/defaults")})}function c(e){return n({queryKey:s.profiles.agent(e),queryFn:()=>r.get(`/profiles/${e}`),enabled:!!e})}function p(){const e=i();return a({mutationFn:({agentType:u,variant:t,config:l})=>r.put(`/profiles/${u}/${t}`,l),onSuccess:()=>{e.invalidateQueries({queryKey:s.profiles.all})}})}function q(){const e=i();return a({mutationFn:({agentType:u,variant:t})=>r.delete(`/profiles/${u}/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:s.profiles.all})}})}export{y as a,p as b,q as c,c as d,f as u};
1
+ import{m as n,o as i,n as a,q as s,p as r}from"./index-BszkzNS4.js";function f(){return n({queryKey:s.profiles.all,queryFn:()=>r.get("/profiles")})}function y(){return n({queryKey:s.profiles.defaults,queryFn:()=>r.get("/profiles/defaults")})}function c(e){return n({queryKey:s.profiles.agent(e),queryFn:()=>r.get(`/profiles/${e}`),enabled:!!e})}function p(){const e=i();return a({mutationFn:({agentType:u,variant:t,config:l})=>r.put(`/profiles/${u}/${t}`,l),onSuccess:()=>{e.invalidateQueries({queryKey:s.profiles.all})}})}function q(){const e=i();return a({mutationFn:({agentType:u,variant:t})=>r.delete(`/profiles/${u}/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:s.profiles.all})}})}export{y as a,p as b,q as c,c as d,f as u};
@@ -1 +1 @@
1
- import{m as p,n as u,o as a,q as t,p as s}from"./index-Cc3qXMhU.js";function l(){return p({queryKey:t.providers.all,queryFn:()=>s.get("/providers")})}function c(e,r,i){const n=r?.trim()||void 0;return p({queryKey:t.providers.capabilities(e,n,i?.providerId,i?.runtimeType,i?.config,i?.settings),queryFn:()=>{if(i?.config!==void 0)return s.post("/providers/capabilities",{agentType:e,model:n,providerId:i.providerId,runtimeType:i.runtimeType,config:i.config,settings:i.settings});const o=new URLSearchParams;e&&o.set("agentType",e),n&&o.set("model",n),i?.providerId&&o.set("providerId",i.providerId),i?.runtimeType&&o.set("runtimeType",i.runtimeType);const d=o.toString();return s.get(`/providers/capabilities${d?`?${d}`:""}`)},staleTime:300*1e3})}function m(){const e=a();return u({mutationFn:r=>s.post("/providers",r),onSuccess:r=>{e.setQueryData(t.providers.detail(r.id),r),e.invalidateQueries({queryKey:t.providers.all})}})}function y(){const e=a();return u({mutationFn:({id:r,data:i})=>s.put(`/providers/${r}`,i),onSuccess:r=>{e.setQueryData(t.providers.detail(r.id),r),e.invalidateQueries({queryKey:t.providers.all}),e.invalidateQueries({queryKey:t.providers.detail(r.id)})}})}function f(){return u({mutationFn:e=>s.post("/providers/test",e)})}function q(){const e=a();return u({mutationFn:r=>s.delete(`/providers/${r}`),onSuccess:()=>{e.invalidateQueries({queryKey:t.providers.all})}})}function P(){return u({mutationFn:()=>s.get("/providers/backup")})}function g(){return u({mutationFn:e=>s.post("/providers/import/preview",e)})}function F(){const e=a();return u({mutationFn:r=>s.post("/providers/import",r),onSuccess:()=>{e.invalidateQueries({queryKey:t.providers.all})}})}export{f as a,c as b,m as c,y as d,q as e,P as f,g,F as h,l as u};
1
+ import{m as p,n as u,o as a,q as t,p as s}from"./index-BszkzNS4.js";function l(){return p({queryKey:t.providers.all,queryFn:()=>s.get("/providers")})}function c(e,r,i){const n=r?.trim()||void 0;return p({queryKey:t.providers.capabilities(e,n,i?.providerId,i?.runtimeType,i?.config,i?.settings),queryFn:()=>{if(i?.config!==void 0)return s.post("/providers/capabilities",{agentType:e,model:n,providerId:i.providerId,runtimeType:i.runtimeType,config:i.config,settings:i.settings});const o=new URLSearchParams;e&&o.set("agentType",e),n&&o.set("model",n),i?.providerId&&o.set("providerId",i.providerId),i?.runtimeType&&o.set("runtimeType",i.runtimeType);const d=o.toString();return s.get(`/providers/capabilities${d?`?${d}`:""}`)},staleTime:300*1e3})}function m(){const e=a();return u({mutationFn:r=>s.post("/providers",r),onSuccess:r=>{e.setQueryData(t.providers.detail(r.id),r),e.invalidateQueries({queryKey:t.providers.all})}})}function y(){const e=a();return u({mutationFn:({id:r,data:i})=>s.put(`/providers/${r}`,i),onSuccess:r=>{e.setQueryData(t.providers.detail(r.id),r),e.invalidateQueries({queryKey:t.providers.all}),e.invalidateQueries({queryKey:t.providers.detail(r.id)})}})}function f(){return u({mutationFn:e=>s.post("/providers/test",e)})}function q(){const e=a();return u({mutationFn:r=>s.delete(`/providers/${r}`),onSuccess:()=>{e.invalidateQueries({queryKey:t.providers.all})}})}function P(){return u({mutationFn:()=>s.get("/providers/backup")})}function g(){return u({mutationFn:e=>s.post("/providers/import/preview",e)})}function F(){const e=a();return u({mutationFn:r=>s.post("/providers/import",r),onSuccess:()=>{e.invalidateQueries({queryKey:t.providers.all})}})}export{f as a,c as b,m as c,y as d,q as e,P as f,g,F as h,l as u};
@@ -1 +1 @@
1
- import{m as u,J as R,q as h,p as O}from"./index-Cc3qXMhU.js";function y(e){const{id:a,revision:n,enableEpoch:r,credentialRevision:i,keyConfigured:s,enabled:o,apiBaseUrl:l,model:T,sendTargetLanguage:E,displayTargetLanguage:c,promptTemplate:d,maxConcurrency:g}=e;return{id:a,revision:n,enableEpoch:r,credentialRevision:i,keyConfigured:s,enabled:o,apiBaseUrl:l,model:T,sendTargetLanguage:E,displayTargetLanguage:c,promptTemplate:d,maxConcurrency:g}}function A(){return u({queryKey:h.translationSettings.detail,queryFn:async({signal:e})=>y(await O.get("/translation-settings",{signal:e}))})}const t={AUTH_FAILED:"Translation credential was rejected. Check the API key.",MODEL_CONFIG_ERROR:"Check the translation base URL and model.",INVALID_CONFIG:"Complete the translation configuration and credential choice.",INVALID_TEMPLATE:"The template must contain only {{target_language}} and {{text}}, including both variables.",VALIDATION_ERROR:"Check the translation fields and credential choice.",TIMEOUT:"The translation request timed out. Try again.",NETWORK_ERROR:"Could not connect to the translation service.",RATE_LIMITED:"The translation service is busy. Try again later.",QUEUE_FULL:"The translation queue is full. Try again later.",TRANSLATION_CLOSED:"Translation testing is temporarily unavailable.",CANCELLED:"The translation request was cancelled.",PAYLOAD_TOO_LARGE:"The translation text is too large.",PROTECTION_FAILED:"The translation changed protected content. The original is preserved.",EMPTY_RESPONSE:"The translation service returned no usable text.",INVALID_RESPONSE:"The translation service returned no usable text.",TRUNCATED_RESPONSE:"The translation service returned incomplete text.",RESPONSE_TOO_LARGE:"The translation response is too large.",UPSTREAM_ERROR:"The translation service returned an error. Try again later.",INTERNAL_ERROR:"An internal translation error occurred. Try again.",RETRY_BUDGET_EXHAUSTED:"Translation retry limit reached. Try again manually.",CONFIG_CIRCUIT_OPEN:"Translation is paused after a configuration error. Check the API key, base URL and model.",DISABLED:"Translation is disabled. Enable it to retry.",INTERRUPTED:"Translation was interrupted. Try again.",LEASE_EXPIRED:"The translation attempt expired. Try again.",SOURCE_CHANGED:"The original text changed. Retry the current text.",SOURCE_DELETED:"The original message is no longer available.",SOURCE_OR_LEASE_REVOKED:"The original message or translation attempt is no longer valid. Try again."};function p(e){const a=typeof e=="string"?e:e instanceof R?e.details.code:void 0;return typeof a=="string"&&Object.hasOwn(t,a)?t[a]:"Translation request failed. Check the service and try again."}export{y as p,p as t,A as u};
1
+ import{m as u,J as R,q as h,p as O}from"./index-BszkzNS4.js";function y(e){const{id:a,revision:n,enableEpoch:r,credentialRevision:i,keyConfigured:s,enabled:o,apiBaseUrl:l,model:T,sendTargetLanguage:E,displayTargetLanguage:c,promptTemplate:d,maxConcurrency:g}=e;return{id:a,revision:n,enableEpoch:r,credentialRevision:i,keyConfigured:s,enabled:o,apiBaseUrl:l,model:T,sendTargetLanguage:E,displayTargetLanguage:c,promptTemplate:d,maxConcurrency:g}}function A(){return u({queryKey:h.translationSettings.detail,queryFn:async({signal:e})=>y(await O.get("/translation-settings",{signal:e}))})}const t={AUTH_FAILED:"Translation credential was rejected. Check the API key.",MODEL_CONFIG_ERROR:"Check the translation base URL and model.",INVALID_CONFIG:"Complete the translation configuration and credential choice.",INVALID_TEMPLATE:"The template must contain only {{target_language}} and {{text}}, including both variables.",VALIDATION_ERROR:"Check the translation fields and credential choice.",TIMEOUT:"The translation request timed out. Try again.",NETWORK_ERROR:"Could not connect to the translation service.",RATE_LIMITED:"The translation service is busy. Try again later.",QUEUE_FULL:"The translation queue is full. Try again later.",TRANSLATION_CLOSED:"Translation testing is temporarily unavailable.",CANCELLED:"The translation request was cancelled.",PAYLOAD_TOO_LARGE:"The translation text is too large.",PROTECTION_FAILED:"The translation changed protected content. The original is preserved.",EMPTY_RESPONSE:"The translation service returned no usable text.",INVALID_RESPONSE:"The translation service returned no usable text.",TRUNCATED_RESPONSE:"The translation service returned incomplete text.",RESPONSE_TOO_LARGE:"The translation response is too large.",UPSTREAM_ERROR:"The translation service returned an error. Try again later.",INTERNAL_ERROR:"An internal translation error occurred. Try again.",RETRY_BUDGET_EXHAUSTED:"Translation retry limit reached. Try again manually.",CONFIG_CIRCUIT_OPEN:"Translation is paused after a configuration error. Check the API key, base URL and model.",DISABLED:"Translation is disabled. Enable it to retry.",INTERRUPTED:"Translation was interrupted. Try again.",LEASE_EXPIRED:"The translation attempt expired. Try again.",SOURCE_CHANGED:"The original text changed. Retry the current text.",SOURCE_DELETED:"The original message is no longer available.",SOURCE_OR_LEASE_REVOKED:"The original message or translation attempt is no longer valid. Try again."};function p(e){const a=typeof e=="string"?e:e instanceof R?e.details.code:void 0;return typeof a=="string"&&Object.hasOwn(t,a)?t[a]:"Translation request failed. Check the service and try again."}export{y as p,p as t,A as u};
@@ -1 +1 @@
1
- import{u as oe,j as o,ae as Ie,a5 as Ce,au as Oe,l as V,aZ as ke,r,a_ as je,af as L,ap as K,ag as T,ah as _e,a$ as Le,b0 as qe,p as Pe}from"./index-Cc3qXMhU.js";import{T as De}from"./track-DCjyrv3n.js";import{C as Me}from"./chevron-down-DNhYsNAt.js";import{u as q,E as ze,n as $e,b as Be,c as Fe}from"./mermaid-NOHMQCX5-nBsnjgeU.js";function Ye({error:t,onRetry:e,title:n,description:u,className:a}){const{t:c}=oe();return o.jsxs("div",{role:"alert",className:V("flex min-h-0 flex-1 flex-col items-center justify-center gap-3 px-6 py-12 text-center",a),children:[o.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-full border border-destructive/20 bg-destructive/10 text-destructive",children:o.jsx(Ie,{size:18})}),o.jsxs("div",{className:"space-y-1",children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:n??c("Something went wrong")}),o.jsx("p",{className:"max-w-md text-xs text-muted-foreground",children:u??c("This section hit a rendering error and was replaced by this message.")})]}),o.jsx("p",{className:"max-w-xl truncate rounded-md border border-border/60 bg-muted/40 px-2 py-1 font-mono text-xs text-muted-foreground",title:t.message||t.name,children:t.message||t.name}),o.jsx("p",{className:"max-w-md text-xs text-muted-foreground",children:c("Only rendering errors are caught here. Errors from event handlers, async callbacks or observers are not.")}),o.jsxs(Ce,{size:"sm",onClick:e,children:[o.jsx(Oe,{}),c("Retry")]})]})}function tt({children:t}){const{t:e}=oe();return o.jsx(ke,{source:"log-view",fallback:({error:n,reset:u})=>o.jsx(Ye,{title:e("Failed to display logs"),description:e("The log view hit a rendering error. Retry renders the same data again, so it will fail again while the bad data is still there."),error:n,onRetry:u}),children:t})}const ue="agent-tower-todo-panel-open";function Ge(t){const e=(t||"").toLowerCase();return e==="completed"?"done":e==="in_progress"||e==="in-progress"?"doing":e==="cancelled"?"cancelled":"todo"}function st({todos:t,compact:e}){const{t:n}=oe(),[u,a]=r.useState(()=>{if(e)return!1;const f=localStorage.getItem(ue);return f===null?!0:f==="true"});if(r.useEffect(()=>{localStorage.setItem(ue,String(u))},[u]),!t||t.length===0)return null;const c=t.filter(f=>f.status?.toLowerCase()==="completed").length;return o.jsxs("details",{className:"group",open:u,onToggle:f=>a(f.target.open),children:[o.jsx("summary",{className:"list-none cursor-pointer select-none [&::-webkit-details-marker]:hidden",children:o.jsxs("div",{className:V("flex items-center justify-between rounded-lg border border-border/60 bg-muted/50 transition-colors hover:bg-muted",e?"px-3 py-1.5":"px-3 py-2"),children:[o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:n("待办")}),o.jsxs("span",{className:"text-xs tabular-nums text-muted-foreground",children:[c,"/",t.length]}),o.jsx(De,{value:c,max:t.length,size:"xs",className:"w-12"})]}),o.jsx(Me,{"aria-hidden":!0,className:V("text-muted-foreground transition-transform group-open:rotate-180",e?"size-3":"size-3.5")})]})}),o.jsx("div",{className:`pt-1.5 pb-0.5 ${e?"max-h-28 overflow-y-auto px-1":"px-1"}`,children:o.jsx("ul",{className:"space-y-px",role:"list","aria-label":"Agent todo list",children:t.map((f,v)=>{const y=Ge(f.status),$=y==="done"||y==="cancelled";return o.jsxs("li",{className:V("flex items-center gap-1.5 rounded-md px-2",e?"py-0.5":"py-[3px]"),children:[o.jsx(je,{state:y,className:e?"size-3":"size-3.5"}),o.jsx("span",{className:V("truncate text-xs leading-4",$?"text-muted-foreground line-through decoration-foreground/30":"text-foreground/80"),children:f.content})]},`${f.content}-${v}`)})})})]})}function nt(t){return r.useMemo(()=>{let e=[],n=0;for(const a of t)if(a.entryType==="tool_use"&&a.metadata?.action==="todo_management"&&a.metadata.todos&&a.metadata.todos.length>0){const c=a.metadata.todos;c.every(v=>v.content&&v.content.trim().length>0&&v.status)&&a.timestamp>=n&&(e=c,n=a.timestamp)}const u=e.find(a=>{const c=a.status?.toLowerCase();return c==="in_progress"||c==="in-progress"})??null;return{todos:e,inProgressTodo:u}},[t])}const Ue=!1,He=1500,le=[250,1e3,3e3],Ve=1e4;function me(t){return t instanceof DOMException&&t.name==="AbortError"}function Ke(t){if(me(t))return!1;const e=typeof t=="object"&&t!==null&&"status"in t?t.status:void 0;return typeof e!="number"?!0:e===408||e===429||e>=500}function Xe(t,e){return new Promise(n=>{if(e.aborted){n(!1);return}const u=window.setTimeout(()=>{e.removeEventListener("abort",a),n(!0)},t),a=()=>{window.clearTimeout(u),n(!1)};e.addEventListener("abort",a,{once:!0})})}function z(t){return t===K.COMPLETED||t===K.FAILED||t===K.CANCELLED}function We(t){return typeof t?.seq=="number"?t.seq:0}function de(t){return!z(t)}function ge(t){return t.entryType==="user_message"||t.entryType==="user_feedback"}function he(t){return!ge(t)&&t.entryType!=="loading"&&t.entryType!=="token_usage_info"&&t.content.trim()!==""}function re(t,e){let n=e,u,a;for(const c of t)a??=c.timestamp,ge(c)?(n=c.timestamp,u=void 0):he(c)&&(n??=c.timestamp,u=c.timestamp);return{processingStartedAt:n??a,lastOutputAt:u}}function fe(t){if(typeof t=="number")return Number.isFinite(t)?t:void 0;if(typeof t!="string"||t.trim()==="")return;const e=Date.parse(t);return Number.isNaN(e)?void 0:e}function pe(t,e){return t.some(n=>{if(n.op==="remove")return!1;const u=n.path.match(/^\/entries\/(\d+)(?:\/|$)/);if(!u)return!1;const a=e[Number(u[1])];return a?he(a):!1})}function rt(t){const{sessionId:e,sessionStatus:n,sessionStartedAt:u,sessionEndedAt:a,onAgentSessionId:c,onExit:f,onError:v}=t,y=fe(u),$=fe(a),[Se,X]=r.useState(()=>L.isConnected()),[Q,N]=r.useState(!1),[xe,ae]=r.useState(!1),[Ee,ee]=r.useState(null),[ce,I]=r.useState(!1),[Ae,B]=r.useState(()=>!z(n)),[ve,C]=r.useState(()=>$??null),F=q(r.useCallback(s=>s.conversations[e]??ze,[e])),h=r.useRef(!1),P=r.useRef({}),O=r.useRef(null),Y=r.useRef(new Map),G=r.useRef(new Map),R=r.useRef(0),te=r.useRef(y);te.current=y;const k=r.useRef({sessionId:e});k.current.sessionId!==e&&(k.current={sessionId:e});const U=r.useRef(e);U.current=e;const W=r.useRef({onAgentSessionId:c,onExit:f,onError:v});W.current={onAgentSessionId:c,onExit:f,onError:v};const Z=r.useRef(n);Z.current=n,r.useEffect(()=>{z(n)?(B(!1),C($??null)):((n===K.RUNNING||n===K.PENDING)&&B(!0),C(null))},[e,n,$]),r.useEffect(()=>{if(!e)return;const s=L.getSocket(),d=P.current,l=Y.current,g=G.current;X(s.connected);let j=!z(n);const S=()=>{R.current+=1,X(!0),O.current?.()},p=()=>{R.current+=1,X(!1),N(!1),h.current=!1,d[e]=[],l.get(e)?.controller.abort();const i=g.get(e);i!==void 0&&(window.clearTimeout(i),g.delete(e))},ne=i=>{if(i.sessionId!==e)return;if(B(!0),C(null),!h.current){d[e]=[...d[e]??[],i],O.current?.();return}const D=q.getState();if(!D.applyPatch(e,i.patch,i.seq)){h.current=!1,d[e]=[],O.current?.();return}const x=D.getConversation(e)?.entries??[],E=re(x,te.current);k.current.processingStartedAt!==E?.processingStartedAt&&(k.current={sessionId:e,processingStartedAt:E?.processingStartedAt}),pe(i.patch,x)&&(k.current.lastOutputAt=Date.now()),I(!0)},H=i=>{i.sessionId===e&&(ee(i.agentSessionId),W.current.onAgentSessionId?.(i.agentSessionId))},b=i=>{i.sessionId===e&&(j=!1,N(!1),I(!1),B(!1),C(Date.now()),W.current.onExit?.(i.exitCode))},_=i=>{i.sessionId===e&&W.current.onError?.(i.message)};return s.on("connect",S),s.on("disconnect",p),s.on(T.SESSION_PATCH,ne),s.on(T.SESSION_ID,H),s.on(T.SESSION_EXIT,b),s.on(T.SESSION_ERROR,_),X(s.connected),()=>{s.off("connect",S),s.off("disconnect",p),s.off(T.SESSION_PATCH,ne),s.off(T.SESSION_ID,H),s.off(T.SESSION_EXIT,b),s.off(T.SESSION_ERROR,_),R.current+=1,l.get(e)?.controller.abort();const i=g.get(e);i!==void 0&&(window.clearTimeout(i),g.delete(e)),h.current=!1,d[e]=[],ee(null),I(!1),C(null),N(!1),j||q.getState().truncateSession(e)}},[e]);const se=r.useCallback(()=>{if(!e)return Promise.resolve(!1);const s=e,d=R.current,l=()=>U.current===s,g=Y.current.get(s);if(g)return g.epoch!==d&&(g.reloadRequested=!0,g.controller.abort()),g.promise;const j=G.current.get(s);j!==void 0&&(window.clearTimeout(j),G.current.delete(s));const S=new AbortController,p={controller:S,epoch:d,promise:Promise.resolve(!1),reloadRequested:!1},H=(async()=>{const b=q.getState(),_=b.conversations[s];_&&_.entries.length>0&&(b.touchAccess(s),l()&&I(de(Z.current))),l()&&(h.current=!1,N(!1));const i=_&&_.entries.length>0;l()&&ae(!i);for(let D=0;D<=le.length;D+=1){const M=L.getSocket();if(S.signal.aborted||!M.connected||!l()||p.epoch!==R.current)return!1;P.current[s]=[];try{const x=$e(await Pe.get(`/sessions/${s}/logs`,{cache:"no-store",signal:S.signal}));if(S.signal.aborted||!M.connected||!l()||p.epoch!==R.current)return p.reloadRequested=M.connected&&l(),!1;const E=P.current[s]??[];P.current[s]=[];let A=x,w=We(x);for(const m of E){if(typeof m.seq=="number"){if(m.seq<=w)continue;if(m.seq!==w+1)throw new Error(`Buffered patch sequence gap: expected ${w+1}, received ${m.seq}`)}const J=Be(A,m.patch);if(!J.ok)throw new Error(`Buffered conversation patch rejected (${J.kind}): ${J.reason}`);A=J.conversation,typeof m.seq=="number"&&m.seq>w&&(w=m.seq)}A={...A,seq:w,isTruncated:!1};const Te=re(A.entries,te.current);k.current={sessionId:s,processingStartedAt:Te?.processingStartedAt,lastOutputAt:E.some(m=>pe(m.patch,A.entries))?Date.now():void 0};const Ne=b.getConversation(s);if(E.length>0||Fe(Ne,A)?b.setConversation(s,A):b.touchAccess(s),l()){h.current=!0,N(!0);const m=q.getState().getConversation(s);m&&m.entries.length>0&&I(de(Z.current))}return!0}catch(x){if(S.signal.aborted||me(x))return!1;if(!l()||p.epoch!==R.current||!M.connected)return p.reloadRequested=M.connected&&l(),!1;if(console.error("[useNormalizedLogs:loadSnapshot] Failed to reconcile snapshot:",x),P.current[s]=[],h.current=!1,N(!1),I(!1),!Ke(x))return!1;const E=le[D];if(E===void 0){const ie=p.epoch,w=window.setTimeout(()=>{G.current.delete(s),U.current===s&&R.current===ie&&L.getSocket().connected&&O.current?.()},Ve);return G.current.set(s,w),!1}if(!await Xe(E,S.signal))return!1}}return!1})().finally(()=>{Y.current.get(s)===p&&Y.current.delete(s),p.reloadRequested&&U.current===s&&L.getSocket().connected&&queueMicrotask(()=>{O.current?.()}),U.current===s&&ae(!1)});return p.promise=H,Y.current.set(s,p),H},[e]);O.current=se;const ye=r.useCallback(()=>new Promise(s=>{if(!L.getSocket().connected){s(!1);return}if(h.current){const l=q.getState().getConversation(e);if(!(z(Z.current)||l?.isTruncated===!0)){s(!0);return}}se().then(s)}),[e,se]);r.useEffect(()=>{if(!e||!z(n))return;const s=window.setTimeout(()=>{O.current?.()},He);return()=>window.clearTimeout(s)},[e,n]);const Re=r.useCallback(s=>{L.getSocket().emit(_e.INPUT,{sessionId:e,data:s})},[e]),be=r.useCallback(()=>{q.getState().removeSession(e),ee(null),I(!1),B(!1),C(null),N(!1),h.current=!1,P.current[e]=[]},[e]),we=r.useMemo(()=>{const s=Le(F.entries);if(ce&&Q){const d=re(F.entries,y),l=k.current,j=l.sessionId===e&&l.processingStartedAt===d?.processingStartedAt&&l.lastOutputAt?Math.max(l.lastOutputAt,d?.lastOutputAt??0):d?.lastOutputAt;s.push(qe({processingStartedAt:d?.processingStartedAt,lastOutputAt:j}))}return s},[F.entries,ce,Q,e,y]);return{isConnected:Se,isAttached:Q,isLoadingSnapshot:xe&&F.entries.length===0,isOutputActive:Ae,lastExitAt:ve,logs:we,entries:F.entries,agentSessionId:Ee,attach:ye,sendInput:Re,clearLogs:be}}export{tt as L,st as T,nt as a,rt as u};
1
+ import{u as oe,j as o,ae as Ie,a5 as Ce,av as Oe,l as V,a_ as ke,r,a$ as je,af as L,ap as K,ag as T,ah as _e,b0 as Le,b1 as qe,p as Pe}from"./index-BszkzNS4.js";import{T as De}from"./track-Cv7h6oaE.js";import{C as Me}from"./chevron-down-Ct7FZbKm.js";import{u as q,E as ze,n as $e,b as Be,c as Fe}from"./mermaid-NOHMQCX5-CYeAhOl-.js";function Ye({error:t,onRetry:e,title:n,description:u,className:a}){const{t:c}=oe();return o.jsxs("div",{role:"alert",className:V("flex min-h-0 flex-1 flex-col items-center justify-center gap-3 px-6 py-12 text-center",a),children:[o.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-full border border-destructive/20 bg-destructive/10 text-destructive",children:o.jsx(Ie,{size:18})}),o.jsxs("div",{className:"space-y-1",children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:n??c("Something went wrong")}),o.jsx("p",{className:"max-w-md text-xs text-muted-foreground",children:u??c("This section hit a rendering error and was replaced by this message.")})]}),o.jsx("p",{className:"max-w-xl truncate rounded-md border border-border/60 bg-muted/40 px-2 py-1 font-mono text-xs text-muted-foreground",title:t.message||t.name,children:t.message||t.name}),o.jsx("p",{className:"max-w-md text-xs text-muted-foreground",children:c("Only rendering errors are caught here. Errors from event handlers, async callbacks or observers are not.")}),o.jsxs(Ce,{size:"sm",onClick:e,children:[o.jsx(Oe,{}),c("Retry")]})]})}function tt({children:t}){const{t:e}=oe();return o.jsx(ke,{source:"log-view",fallback:({error:n,reset:u})=>o.jsx(Ye,{title:e("Failed to display logs"),description:e("The log view hit a rendering error. Retry renders the same data again, so it will fail again while the bad data is still there."),error:n,onRetry:u}),children:t})}const ue="agent-tower-todo-panel-open";function Ge(t){const e=(t||"").toLowerCase();return e==="completed"?"done":e==="in_progress"||e==="in-progress"?"doing":e==="cancelled"?"cancelled":"todo"}function st({todos:t,compact:e}){const{t:n}=oe(),[u,a]=r.useState(()=>{if(e)return!1;const f=localStorage.getItem(ue);return f===null?!0:f==="true"});if(r.useEffect(()=>{localStorage.setItem(ue,String(u))},[u]),!t||t.length===0)return null;const c=t.filter(f=>f.status?.toLowerCase()==="completed").length;return o.jsxs("details",{className:"group",open:u,onToggle:f=>a(f.target.open),children:[o.jsx("summary",{className:"list-none cursor-pointer select-none [&::-webkit-details-marker]:hidden",children:o.jsxs("div",{className:V("flex items-center justify-between rounded-lg border border-border/60 bg-muted/50 transition-colors hover:bg-muted",e?"px-3 py-1.5":"px-3 py-2"),children:[o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:n("待办")}),o.jsxs("span",{className:"text-xs tabular-nums text-muted-foreground",children:[c,"/",t.length]}),o.jsx(De,{value:c,max:t.length,size:"xs",className:"w-12"})]}),o.jsx(Me,{"aria-hidden":!0,className:V("text-muted-foreground transition-transform group-open:rotate-180",e?"size-3":"size-3.5")})]})}),o.jsx("div",{className:`pt-1.5 pb-0.5 ${e?"max-h-28 overflow-y-auto px-1":"px-1"}`,children:o.jsx("ul",{className:"space-y-px",role:"list","aria-label":"Agent todo list",children:t.map((f,v)=>{const y=Ge(f.status),$=y==="done"||y==="cancelled";return o.jsxs("li",{className:V("flex items-center gap-1.5 rounded-md px-2",e?"py-0.5":"py-[3px]"),children:[o.jsx(je,{state:y,className:e?"size-3":"size-3.5"}),o.jsx("span",{className:V("truncate text-xs leading-4",$?"text-muted-foreground line-through decoration-foreground/30":"text-foreground/80"),children:f.content})]},`${f.content}-${v}`)})})})]})}function nt(t){return r.useMemo(()=>{let e=[],n=0;for(const a of t)if(a.entryType==="tool_use"&&a.metadata?.action==="todo_management"&&a.metadata.todos&&a.metadata.todos.length>0){const c=a.metadata.todos;c.every(v=>v.content&&v.content.trim().length>0&&v.status)&&a.timestamp>=n&&(e=c,n=a.timestamp)}const u=e.find(a=>{const c=a.status?.toLowerCase();return c==="in_progress"||c==="in-progress"})??null;return{todos:e,inProgressTodo:u}},[t])}const Ue=!1,He=1500,le=[250,1e3,3e3],Ve=1e4;function me(t){return t instanceof DOMException&&t.name==="AbortError"}function Ke(t){if(me(t))return!1;const e=typeof t=="object"&&t!==null&&"status"in t?t.status:void 0;return typeof e!="number"?!0:e===408||e===429||e>=500}function Xe(t,e){return new Promise(n=>{if(e.aborted){n(!1);return}const u=window.setTimeout(()=>{e.removeEventListener("abort",a),n(!0)},t),a=()=>{window.clearTimeout(u),n(!1)};e.addEventListener("abort",a,{once:!0})})}function z(t){return t===K.COMPLETED||t===K.FAILED||t===K.CANCELLED}function We(t){return typeof t?.seq=="number"?t.seq:0}function de(t){return!z(t)}function ge(t){return t.entryType==="user_message"||t.entryType==="user_feedback"}function he(t){return!ge(t)&&t.entryType!=="loading"&&t.entryType!=="token_usage_info"&&t.content.trim()!==""}function re(t,e){let n=e,u,a;for(const c of t)a??=c.timestamp,ge(c)?(n=c.timestamp,u=void 0):he(c)&&(n??=c.timestamp,u=c.timestamp);return{processingStartedAt:n??a,lastOutputAt:u}}function fe(t){if(typeof t=="number")return Number.isFinite(t)?t:void 0;if(typeof t!="string"||t.trim()==="")return;const e=Date.parse(t);return Number.isNaN(e)?void 0:e}function pe(t,e){return t.some(n=>{if(n.op==="remove")return!1;const u=n.path.match(/^\/entries\/(\d+)(?:\/|$)/);if(!u)return!1;const a=e[Number(u[1])];return a?he(a):!1})}function rt(t){const{sessionId:e,sessionStatus:n,sessionStartedAt:u,sessionEndedAt:a,onAgentSessionId:c,onExit:f,onError:v}=t,y=fe(u),$=fe(a),[Se,X]=r.useState(()=>L.isConnected()),[Z,N]=r.useState(!1),[xe,ae]=r.useState(!1),[Ee,ee]=r.useState(null),[ce,I]=r.useState(!1),[Ae,B]=r.useState(()=>!z(n)),[ve,C]=r.useState(()=>$??null),F=q(r.useCallback(s=>s.conversations[e]??ze,[e])),h=r.useRef(!1),P=r.useRef({}),O=r.useRef(null),Y=r.useRef(new Map),G=r.useRef(new Map),R=r.useRef(0),te=r.useRef(y);te.current=y;const k=r.useRef({sessionId:e});k.current.sessionId!==e&&(k.current={sessionId:e});const U=r.useRef(e);U.current=e;const W=r.useRef({onAgentSessionId:c,onExit:f,onError:v});W.current={onAgentSessionId:c,onExit:f,onError:v};const J=r.useRef(n);J.current=n,r.useEffect(()=>{z(n)?(B(!1),C($??null)):((n===K.RUNNING||n===K.PENDING)&&B(!0),C(null))},[e,n,$]),r.useEffect(()=>{if(!e)return;const s=L.getSocket(),d=P.current,l=Y.current,g=G.current;X(s.connected);let j=!z(n);const S=()=>{R.current+=1,X(!0),O.current?.()},p=()=>{R.current+=1,X(!1),N(!1),h.current=!1,d[e]=[],l.get(e)?.controller.abort();const i=g.get(e);i!==void 0&&(window.clearTimeout(i),g.delete(e))},ne=i=>{if(i.sessionId!==e)return;if(B(!0),C(null),!h.current){d[e]=[...d[e]??[],i],O.current?.();return}const D=q.getState();if(!D.applyPatch(e,i.patch,i.seq)){h.current=!1,d[e]=[],O.current?.();return}const x=D.getConversation(e)?.entries??[],E=re(x,te.current);k.current.processingStartedAt!==E?.processingStartedAt&&(k.current={sessionId:e,processingStartedAt:E?.processingStartedAt}),pe(i.patch,x)&&(k.current.lastOutputAt=Date.now()),I(!0)},H=i=>{i.sessionId===e&&(ee(i.agentSessionId),W.current.onAgentSessionId?.(i.agentSessionId))},b=i=>{i.sessionId===e&&(j=!1,N(!1),I(!1),B(!1),C(Date.now()),W.current.onExit?.(i.exitCode))},_=i=>{i.sessionId===e&&W.current.onError?.(i.message)};return s.on("connect",S),s.on("disconnect",p),s.on(T.SESSION_PATCH,ne),s.on(T.SESSION_ID,H),s.on(T.SESSION_EXIT,b),s.on(T.SESSION_ERROR,_),X(s.connected),()=>{s.off("connect",S),s.off("disconnect",p),s.off(T.SESSION_PATCH,ne),s.off(T.SESSION_ID,H),s.off(T.SESSION_EXIT,b),s.off(T.SESSION_ERROR,_),R.current+=1,l.get(e)?.controller.abort();const i=g.get(e);i!==void 0&&(window.clearTimeout(i),g.delete(e)),h.current=!1,d[e]=[],ee(null),I(!1),C(null),N(!1),j||q.getState().truncateSession(e)}},[e]);const se=r.useCallback(()=>{if(!e)return Promise.resolve(!1);const s=e,d=R.current,l=()=>U.current===s,g=Y.current.get(s);if(g)return g.epoch!==d&&(g.reloadRequested=!0,g.controller.abort()),g.promise;const j=G.current.get(s);j!==void 0&&(window.clearTimeout(j),G.current.delete(s));const S=new AbortController,p={controller:S,epoch:d,promise:Promise.resolve(!1),reloadRequested:!1},H=(async()=>{const b=q.getState(),_=b.conversations[s];_&&_.entries.length>0&&(b.touchAccess(s),l()&&I(de(J.current))),l()&&(h.current=!1,N(!1));const i=_&&_.entries.length>0;l()&&ae(!i);for(let D=0;D<=le.length;D+=1){const M=L.getSocket();if(S.signal.aborted||!M.connected||!l()||p.epoch!==R.current)return!1;P.current[s]=[];try{const x=$e(await Pe.get(`/sessions/${s}/logs`,{cache:"no-store",signal:S.signal}));if(S.signal.aborted||!M.connected||!l()||p.epoch!==R.current)return p.reloadRequested=M.connected&&l(),!1;const E=P.current[s]??[];P.current[s]=[];let A=x,w=We(x);for(const m of E){if(typeof m.seq=="number"){if(m.seq<=w)continue;if(m.seq!==w+1)throw new Error(`Buffered patch sequence gap: expected ${w+1}, received ${m.seq}`)}const Q=Be(A,m.patch);if(!Q.ok)throw new Error(`Buffered conversation patch rejected (${Q.kind}): ${Q.reason}`);A=Q.conversation,typeof m.seq=="number"&&m.seq>w&&(w=m.seq)}A={...A,seq:w,isTruncated:!1};const Te=re(A.entries,te.current);k.current={sessionId:s,processingStartedAt:Te?.processingStartedAt,lastOutputAt:E.some(m=>pe(m.patch,A.entries))?Date.now():void 0};const Ne=b.getConversation(s);if(E.length>0||Fe(Ne,A)?b.setConversation(s,A):b.touchAccess(s),l()){h.current=!0,N(!0);const m=q.getState().getConversation(s);m&&m.entries.length>0&&I(de(J.current))}return!0}catch(x){if(S.signal.aborted||me(x))return!1;if(!l()||p.epoch!==R.current||!M.connected)return p.reloadRequested=M.connected&&l(),!1;if(console.error("[useNormalizedLogs:loadSnapshot] Failed to reconcile snapshot:",x),P.current[s]=[],h.current=!1,N(!1),I(!1),!Ke(x))return!1;const E=le[D];if(E===void 0){const ie=p.epoch,w=window.setTimeout(()=>{G.current.delete(s),U.current===s&&R.current===ie&&L.getSocket().connected&&O.current?.()},Ve);return G.current.set(s,w),!1}if(!await Xe(E,S.signal))return!1}}return!1})().finally(()=>{Y.current.get(s)===p&&Y.current.delete(s),p.reloadRequested&&U.current===s&&L.getSocket().connected&&queueMicrotask(()=>{O.current?.()}),U.current===s&&ae(!1)});return p.promise=H,Y.current.set(s,p),H},[e]);O.current=se;const ye=r.useCallback(()=>new Promise(s=>{if(!L.getSocket().connected){s(!1);return}if(h.current){const l=q.getState().getConversation(e);if(!(z(J.current)||l?.isTruncated===!0)){s(!0);return}}se().then(s)}),[e,se]);r.useEffect(()=>{if(!e||!z(n))return;const s=window.setTimeout(()=>{O.current?.()},He);return()=>window.clearTimeout(s)},[e,n]);const Re=r.useCallback(s=>{L.getSocket().emit(_e.INPUT,{sessionId:e,data:s})},[e]),be=r.useCallback(()=>{q.getState().removeSession(e),ee(null),I(!1),B(!1),C(null),N(!1),h.current=!1,P.current[e]=[]},[e]),we=r.useMemo(()=>{const s=Le(F.entries);if(ce&&Z){const d=re(F.entries,y),l=k.current,j=l.sessionId===e&&l.processingStartedAt===d?.processingStartedAt&&l.lastOutputAt?Math.max(l.lastOutputAt,d?.lastOutputAt??0):d?.lastOutputAt;s.push(qe({processingStartedAt:d?.processingStartedAt,lastOutputAt:j}))}return s},[F.entries,ce,Z,e,y]);return{isConnected:Se,isAttached:Z,isLoadingSnapshot:xe&&F.entries.length===0,isOutputActive:Ae,lastExitAt:ve,logs:we,entries:F.entries,agentSessionId:Ee,attach:ye,sendInput:Re,clearLogs:be}}export{tt as L,st as T,nt as a,rt as u};
@@ -1 +1 @@
1
- import{c as U,u as z,r as x,j as t,a3 as O,l as L,bc as $,bd as H,b3 as j,be as W,_ as M,bf as G}from"./index-Cc3qXMhU.js";import{h as K,i as V}from"./CreateTaskInput-DjVxCAfc.js";import{T as X}from"./mermaid-NOHMQCX5-nBsnjgeU.js";import{G as J,M as Y,a as Q,b as Z,c as ee,d as te,e as ne}from"./menu-DubntFHq.js";import{g as re,a as B,l as se}from"./ExecutionPermissionSelector-f1UYIm1z.js";import{i as oe}from"./provider-selection-DSu7SCI7.js";import"./AttachmentPreview-DMS-PM-1.js";import{C as ae}from"./chevron-down-DNhYsNAt.js";const ie=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],le=U("shield-alert",ie);function ke({sessionId:r,compact:a=!1}){const{t:i}=z(),{data:s}=K(r),d=V(),m=s?.pendingPermissions[0],v=m?.requestId,g=d.reset;return x.useEffect(()=>{g()},[v,g]),m?t.jsx("div",{className:L("mb-2 border-l-2 border-warning bg-warning/5 px-3 py-2.5",a&&"px-2.5 py-2"),children:t.jsxs("div",{className:"flex min-w-0 items-start gap-2",children:[t.jsx(le,{className:"mt-0.5 h-4 w-4 shrink-0 text-warning","aria-hidden":"true"}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:i("Permission required")}),t.jsx("div",{className:"mt-0.5 break-words text-xs text-muted-foreground",children:m.toolSummary||m.toolName||i("The agent needs approval to continue.")}),m.actionDetails?t.jsx("pre",{className:"mt-2 max-h-48 overflow-auto whitespace-pre-wrap break-all text-xs",children:m.actionDetails}):null,t.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:m.options.map(p=>t.jsxs("button",{type:"button",disabled:d.isPending,onClick:()=>d.mutate({sessionId:r,requestId:m.requestId,optionId:p.optionId}),className:L("inline-flex min-h-8 items-center gap-1.5 border px-3 text-xs font-medium transition-colors disabled:opacity-50",p.kind.startsWith("reject")?"border-destructive/30 text-destructive-ink hover:bg-destructive/10":"border-border bg-background text-foreground hover:bg-muted"),children:[d.isPending&&d.variables?.requestId===m.requestId&&d.variables.optionId===p.optionId?t.jsx(O,{className:"h-3.5 w-3.5 animate-spin motion-reduce:[animation-duration:2.4s]","aria-hidden":"true"}):null,i(p.name)]},p.optionId))}),d.error?t.jsx("div",{className:"mt-1.5 text-xs text-destructive-ink",role:"alert",children:d.error.message}):null]})]})}):null}function y(r){return r>=1e6?`${(r/1e6).toFixed(1)}M`:r>=1e3?`${(r/1e3).toFixed(1)}K`:r.toString()}function ce(r){return r>=.9?"danger":r>=.7?"warning":"neutral"}function we({usage:r,tooltipSide:a="top"}){const{t:i}=z();if(!r)return null;const s=r.modelContextWindow,d=s?r.totalTokens/s:0,m=s?Math.min(Math.round(d*100),100):null,v=s?ce(d):"neutral",g=$[v],p=v==="neutral"?"text-muted-foreground":H[v],f=s?t.jsx("span",{children:i("上下文: {used} / {max} tokens",{used:y(r.totalTokens),max:y(s)})}):t.jsx("span",{children:i("已使用: {used} tokens",{used:y(r.totalTokens)})});return t.jsx(X,{content:f,side:a,children:t.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1.5 text-xs rounded-lg hover:bg-accent transition-colors cursor-default select-none",children:[t.jsx(J,{size:14,className:g}),t.jsxs("span",{className:`tabular-nums ${p}`,children:[y(r.totalTokens),m!==null&&t.jsxs("span",{className:"ml-0.5 text-muted-foreground",children:["/ ",m,"%"]})]})]})})}const ue={damping:.7,stiffness:.05,mass:1.25},de=70,me=1e3/60,fe=350;let E=!1;globalThis.document?.addEventListener("mousedown",()=>{E=!0});globalThis.document?.addEventListener("mouseup",()=>{E=!1});globalThis.document?.addEventListener("click",()=>{E=!1});const Se=(r={})=>{const[a,i]=x.useState(!1),[s,d]=x.useState(r.initial!==!1),[m,v]=x.useState(!1),g=x.useRef(null);g.current=r;const p=x.useCallback(()=>{if(!E)return!1;const n=window.getSelection();if(!n||!n.rangeCount)return!1;const o=n.getRangeAt(0);return o.commonAncestorContainer.contains(l.current)||l.current?.contains(o.commonAncestorContainer)},[]),f=x.useCallback(n=>{e.isAtBottom=n,d(n)},[]),h=x.useCallback(n=>{e.escapedFromLock=n,i(n)},[]),e=x.useMemo(()=>{let n;return{escapedFromLock:a,isAtBottom:s,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return l.current?.scrollTop??0},set scrollTop(o){l.current&&(l.current.scrollTop=o,e.ignoreScrollToTop=l.current.scrollTop)},get targetScrollTop(){return!l.current||!k.current?0:l.current.scrollHeight-1-l.current.clientHeight},get calculatedTargetScrollTop(){if(!l.current||!k.current)return 0;const{targetScrollTop:o}=this;if(!r.targetScrollTop)return o;if(n?.targetScrollTop===o)return n.calculatedScrollTop;const u=Math.max(Math.min(r.targetScrollTop(o,{scrollElement:l.current,contentElement:k.current}),o),0);return n={targetScrollTop:o,calculatedScrollTop:u},requestAnimationFrame(()=>{n=void 0}),u},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=de}}},[]),N=x.useCallback((n={})=>{typeof n=="string"&&(n={animation:n}),n.preserveScrollPosition||f(!0);const o=Date.now()+(Number(n.wait)||0),u=R(g.current,n.animation),{ignoreEscapes:T=!1}=n;let b,w=e.calculatedTargetScrollTop;n.duration instanceof Promise?n.duration.finally(()=>{b=Date.now()}):b=o+(n.duration??0);const S=async()=>{const _=new Promise(requestAnimationFrame).then(()=>{if(!e.isAtBottom)return e.animation=void 0,!1;const{scrollTop:I}=e,P=performance.now(),q=(P-(e.lastTick??P))/me;if(e.animation||(e.animation={behavior:u,promise:_,ignoreEscapes:T}),e.animation.behavior===u&&(e.lastTick=P),p()||o>Date.now())return S();if(I<Math.min(w,e.calculatedTargetScrollTop)){if(e.animation?.behavior===u){if(u==="instant")return e.scrollTop=e.calculatedTargetScrollTop,S();e.velocity=(u.damping*e.velocity+u.stiffness*e.scrollDifference)/u.mass,e.accumulated+=e.velocity*q,e.scrollTop+=e.accumulated,e.scrollTop!==I&&(e.accumulated=0)}return S()}return b>Date.now()?(w=e.calculatedTargetScrollTop,S()):(e.animation=void 0,e.scrollTop<e.calculatedTargetScrollTop?N({animation:R(g.current,g.current.resize),ignoreEscapes:T,duration:Math.max(0,b-Date.now())||void 0}):e.isAtBottom)});return _.then(I=>(requestAnimationFrame(()=>{e.animation||(e.lastTick=void 0,e.velocity=0)}),I))};return n.wait!==!0&&(e.animation=void 0),e.animation?.behavior===u?e.animation.promise:S()},[f,p,e]),A=x.useCallback(()=>{h(!0),f(!1)},[h,f]),c=x.useCallback(({target:n})=>{if(n!==l.current)return;const{scrollTop:o,ignoreScrollToTop:u}=e;let{lastScrollTop:T=o}=e;e.lastScrollTop=o,e.ignoreScrollToTop=void 0,u&&u>o&&(T=u),v(e.isNearBottom),setTimeout(()=>{if(e.resizeDifference||o===u)return;if(p()){h(!0),f(!1);return}const b=o>T,w=o<T;if(e.animation?.ignoreEscapes){e.scrollTop=T;return}w&&(h(!0),f(!1)),b&&h(!1),!e.escapedFromLock&&e.isNearBottom&&f(!0)},1)},[h,f,p,e]),C=x.useCallback(({target:n,deltaY:o})=>{let u=n;for(;!["scroll","auto"].includes(getComputedStyle(u).overflow);){if(!u.parentElement)return;u=u.parentElement}u===l.current&&o<0&&l.current.scrollHeight>l.current.clientHeight&&!e.animation?.ignoreEscapes&&(h(!0),f(!1))},[h,f,e]),l=F(n=>{l.current?.removeEventListener("scroll",c),l.current?.removeEventListener("wheel",C),n?.addEventListener("scroll",c,{passive:!0}),n?.addEventListener("wheel",C,{passive:!0})},[]),k=F(n=>{if(e.resizeObserver?.disconnect(),!n)return;let o;e.resizeObserver=new ResizeObserver(([u])=>{const{height:T}=u.contentRect,b=T-(o??T);if(e.resizeDifference=b,e.scrollTop>e.targetScrollTop&&(e.scrollTop=e.targetScrollTop),v(e.isNearBottom),b>=0){const w=R(g.current,o?g.current.resize:g.current.initial);N({animation:w,wait:!0,preserveScrollPosition:!0,duration:w==="instant"?void 0:fe})}else e.isNearBottom&&(h(!1),f(!0));o=T,requestAnimationFrame(()=>{setTimeout(()=>{e.resizeDifference===b&&(e.resizeDifference=0)},1)})}),e.resizeObserver?.observe(n)},[]);return{contentRef:k,scrollRef:l,scrollToBottom:N,stopScroll:A,isAtBottom:s||m,isNearBottom:m,escapedFromLock:a,state:e}};function F(r,a){const i=x.useCallback(s=>(i.current=s,r(s)),a);return i}const D=new Map;function R(...r){const a={...ue};let i=!1;for(const d of r){if(d==="instant"){i=!0;continue}typeof d=="object"&&(i=!1,a.damping=d.damping??a.damping,a.stiffness=d.stiffness??a.stiffness,a.mass=d.mass??a.mass)}const s=JSON.stringify(a);return D.has(s)||D.set(s,Object.freeze(a)),i?"instant":D.get(s)}function je({providers:r,currentProviderId:a,agentType:i,runtimeType:s,onSelect:d}){const{t:m}=z(),v=x.useId(),g=s===j.ACP?j.ACP:j.CLI,p=r.filter(c=>oe(c)&&String(c.provider.agentType)===i&&(c.provider.runtimeType===j.ACP?j.ACP:j.CLI)===g),f=r.find(c=>c.provider.id===a),h=f?.provider.name?W(f.provider.name,12):i,e=re(r,a),N=e?t.jsx("span",{role:"alert",className:"block break-words text-xs leading-snug text-destructive-ink",children:m(e)}):null;if(p.length===0||p.length===1&&p[0].provider.id===a)return t.jsxs("div",{className:"min-w-[112px] max-w-[min(46vw,240px)] px-2 py-1.5 text-xs text-muted-foreground select-none cursor-default",children:[t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(M,{agentType:f?.provider.agentType??i,className:"size-3.5 shrink-0"}),t.jsx("span",{className:"min-w-0 truncate",children:h})]}),N]});const A=new Set(p.filter(c=>B(c)).map(c=>c.provider.id));return t.jsxs("div",{className:"min-w-[112px] max-w-[min(46vw,240px)]",children:[t.jsxs(Y,{children:[t.jsxs(Q,{className:G({variant:"ghost",size:"sm",className:"group max-w-full gap-1 px-2 text-muted-foreground data-[state=open]:bg-accent data-[state=open]:text-foreground"}),title:`Provider: ${f?.provider.name??i} (click to change)`,children:[t.jsx(M,{agentType:f?.provider.agentType??i,className:"size-3.5"}),t.jsx("span",{className:"min-w-0 truncate",children:h}),t.jsx(ae,{className:"size-3 transition-transform group-data-[state=open]:rotate-180"})]}),t.jsxs(Z,{side:"top",align:"end",className:"max-h-[min(60vh,320px)] max-w-[min(80vw,320px)] overflow-y-auto",children:[t.jsx(ee,{children:m("切换渠道")}),t.jsx(te,{value:a??"",onValueChange:c=>{A.has(c)||d(c)},children:p.map((c,C)=>{const l=B(c),k=l?`${v}-${C}`:void 0;return t.jsxs(ne,{value:c.provider.id,icon:t.jsx(M,{agentType:c.provider.agentType,className:"mt-0.5 size-4"}),"aria-disabled":l?!0:void 0,"aria-describedby":k,onSelect:l?n=>n.preventDefault():void 0,className:L("items-start",l&&"cursor-not-allowed text-muted-foreground data-[highlighted]:text-muted-foreground"),children:[t.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[t.jsx("span",{className:"truncate",children:c.provider.name}),c.provider.isDefault&&t.jsx("span",{className:"shrink-0 text-xs font-normal text-muted-foreground",children:m("(默认)")})]}),c.provider.executionPermission?t.jsx("span",{className:"block text-xs font-normal text-muted-foreground",children:m(se[c.provider.executionPermission])}):null,l?t.jsx("span",{id:k,className:"block w-0 min-w-full whitespace-normal break-words text-xs font-normal text-destructive-ink",children:m(l)}):null]},c.provider.id)})})]})]}),N?t.jsx("div",{className:"px-2",children:N}):null]})}function Ce(r,a){return x.useMemo(()=>{for(let i=r.length-1;i>=0;i--){const s=r[i];if(s.tokenUsage&&typeof s.tokenUsage.totalTokens=="number"&&s.tokenUsage.totalTokens>0)return{totalTokens:s.tokenUsage.totalTokens,modelContextWindow:s.tokenUsage.modelContextWindow}}return a??null},[r,a])}export{je as P,ke as R,we as T,Ce as a,Se as u};
1
+ import{c as U,u as z,r as x,j as t,a3 as O,l as L,bd as $,be as H,b4 as j,bf as W,_ as M,bg as G}from"./index-BszkzNS4.js";import{h as K,i as V}from"./CreateTaskInput-TcZpjBe-.js";import{T as X}from"./mermaid-NOHMQCX5-CYeAhOl-.js";import{G as J,M as Y,a as Q,b as Z,c as ee,d as te,e as ne}from"./menu-CMqbaDni.js";import{g as re,a as B,l as se}from"./ExecutionPermissionSelector-C-akTOVg.js";import{i as oe}from"./provider-selection-DSu7SCI7.js";import"./AttachmentPreview-TPd4gdfb.js";import{C as ae}from"./chevron-down-Ct7FZbKm.js";const ie=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],le=U("shield-alert",ie);function ke({sessionId:r,compact:a=!1}){const{t:i}=z(),{data:s}=K(r),d=V(),m=s?.pendingPermissions[0],v=m?.requestId,g=d.reset;return x.useEffect(()=>{g()},[v,g]),m?t.jsx("div",{className:L("mb-2 border-l-2 border-warning bg-warning/5 px-3 py-2.5",a&&"px-2.5 py-2"),children:t.jsxs("div",{className:"flex min-w-0 items-start gap-2",children:[t.jsx(le,{className:"mt-0.5 h-4 w-4 shrink-0 text-warning","aria-hidden":"true"}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:i("Permission required")}),t.jsx("div",{className:"mt-0.5 break-words text-xs text-muted-foreground",children:m.toolSummary||m.toolName||i("The agent needs approval to continue.")}),m.actionDetails?t.jsx("pre",{className:"mt-2 max-h-48 overflow-auto whitespace-pre-wrap break-all text-xs",children:m.actionDetails}):null,t.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:m.options.map(p=>t.jsxs("button",{type:"button",disabled:d.isPending,onClick:()=>d.mutate({sessionId:r,requestId:m.requestId,optionId:p.optionId}),className:L("inline-flex min-h-8 items-center gap-1.5 border px-3 text-xs font-medium transition-colors disabled:opacity-50",p.kind.startsWith("reject")?"border-destructive/30 text-destructive-ink hover:bg-destructive/10":"border-border bg-background text-foreground hover:bg-muted"),children:[d.isPending&&d.variables?.requestId===m.requestId&&d.variables.optionId===p.optionId?t.jsx(O,{className:"h-3.5 w-3.5 animate-spin motion-reduce:[animation-duration:2.4s]","aria-hidden":"true"}):null,i(p.name)]},p.optionId))}),d.error?t.jsx("div",{className:"mt-1.5 text-xs text-destructive-ink",role:"alert",children:d.error.message}):null]})]})}):null}function y(r){return r>=1e6?`${(r/1e6).toFixed(1)}M`:r>=1e3?`${(r/1e3).toFixed(1)}K`:r.toString()}function ce(r){return r>=.9?"danger":r>=.7?"warning":"neutral"}function we({usage:r,tooltipSide:a="top"}){const{t:i}=z();if(!r)return null;const s=r.modelContextWindow,d=s?r.totalTokens/s:0,m=s?Math.min(Math.round(d*100),100):null,v=s?ce(d):"neutral",g=$[v],p=v==="neutral"?"text-muted-foreground":H[v],f=s?t.jsx("span",{children:i("上下文: {used} / {max} tokens",{used:y(r.totalTokens),max:y(s)})}):t.jsx("span",{children:i("已使用: {used} tokens",{used:y(r.totalTokens)})});return t.jsx(X,{content:f,side:a,children:t.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1.5 text-xs rounded-lg hover:bg-accent transition-colors cursor-default select-none",children:[t.jsx(J,{size:14,className:g}),t.jsxs("span",{className:`tabular-nums ${p}`,children:[y(r.totalTokens),m!==null&&t.jsxs("span",{className:"ml-0.5 text-muted-foreground",children:["/ ",m,"%"]})]})]})})}const ue={damping:.7,stiffness:.05,mass:1.25},de=70,me=1e3/60,fe=350;let E=!1;globalThis.document?.addEventListener("mousedown",()=>{E=!0});globalThis.document?.addEventListener("mouseup",()=>{E=!1});globalThis.document?.addEventListener("click",()=>{E=!1});const Se=(r={})=>{const[a,i]=x.useState(!1),[s,d]=x.useState(r.initial!==!1),[m,v]=x.useState(!1),g=x.useRef(null);g.current=r;const p=x.useCallback(()=>{if(!E)return!1;const n=window.getSelection();if(!n||!n.rangeCount)return!1;const o=n.getRangeAt(0);return o.commonAncestorContainer.contains(l.current)||l.current?.contains(o.commonAncestorContainer)},[]),f=x.useCallback(n=>{e.isAtBottom=n,d(n)},[]),h=x.useCallback(n=>{e.escapedFromLock=n,i(n)},[]),e=x.useMemo(()=>{let n;return{escapedFromLock:a,isAtBottom:s,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return l.current?.scrollTop??0},set scrollTop(o){l.current&&(l.current.scrollTop=o,e.ignoreScrollToTop=l.current.scrollTop)},get targetScrollTop(){return!l.current||!k.current?0:l.current.scrollHeight-1-l.current.clientHeight},get calculatedTargetScrollTop(){if(!l.current||!k.current)return 0;const{targetScrollTop:o}=this;if(!r.targetScrollTop)return o;if(n?.targetScrollTop===o)return n.calculatedScrollTop;const u=Math.max(Math.min(r.targetScrollTop(o,{scrollElement:l.current,contentElement:k.current}),o),0);return n={targetScrollTop:o,calculatedScrollTop:u},requestAnimationFrame(()=>{n=void 0}),u},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=de}}},[]),N=x.useCallback((n={})=>{typeof n=="string"&&(n={animation:n}),n.preserveScrollPosition||f(!0);const o=Date.now()+(Number(n.wait)||0),u=R(g.current,n.animation),{ignoreEscapes:T=!1}=n;let b,w=e.calculatedTargetScrollTop;n.duration instanceof Promise?n.duration.finally(()=>{b=Date.now()}):b=o+(n.duration??0);const S=async()=>{const _=new Promise(requestAnimationFrame).then(()=>{if(!e.isAtBottom)return e.animation=void 0,!1;const{scrollTop:I}=e,P=performance.now(),q=(P-(e.lastTick??P))/me;if(e.animation||(e.animation={behavior:u,promise:_,ignoreEscapes:T}),e.animation.behavior===u&&(e.lastTick=P),p()||o>Date.now())return S();if(I<Math.min(w,e.calculatedTargetScrollTop)){if(e.animation?.behavior===u){if(u==="instant")return e.scrollTop=e.calculatedTargetScrollTop,S();e.velocity=(u.damping*e.velocity+u.stiffness*e.scrollDifference)/u.mass,e.accumulated+=e.velocity*q,e.scrollTop+=e.accumulated,e.scrollTop!==I&&(e.accumulated=0)}return S()}return b>Date.now()?(w=e.calculatedTargetScrollTop,S()):(e.animation=void 0,e.scrollTop<e.calculatedTargetScrollTop?N({animation:R(g.current,g.current.resize),ignoreEscapes:T,duration:Math.max(0,b-Date.now())||void 0}):e.isAtBottom)});return _.then(I=>(requestAnimationFrame(()=>{e.animation||(e.lastTick=void 0,e.velocity=0)}),I))};return n.wait!==!0&&(e.animation=void 0),e.animation?.behavior===u?e.animation.promise:S()},[f,p,e]),A=x.useCallback(()=>{h(!0),f(!1)},[h,f]),c=x.useCallback(({target:n})=>{if(n!==l.current)return;const{scrollTop:o,ignoreScrollToTop:u}=e;let{lastScrollTop:T=o}=e;e.lastScrollTop=o,e.ignoreScrollToTop=void 0,u&&u>o&&(T=u),v(e.isNearBottom),setTimeout(()=>{if(e.resizeDifference||o===u)return;if(p()){h(!0),f(!1);return}const b=o>T,w=o<T;if(e.animation?.ignoreEscapes){e.scrollTop=T;return}w&&(h(!0),f(!1)),b&&h(!1),!e.escapedFromLock&&e.isNearBottom&&f(!0)},1)},[h,f,p,e]),C=x.useCallback(({target:n,deltaY:o})=>{let u=n;for(;!["scroll","auto"].includes(getComputedStyle(u).overflow);){if(!u.parentElement)return;u=u.parentElement}u===l.current&&o<0&&l.current.scrollHeight>l.current.clientHeight&&!e.animation?.ignoreEscapes&&(h(!0),f(!1))},[h,f,e]),l=F(n=>{l.current?.removeEventListener("scroll",c),l.current?.removeEventListener("wheel",C),n?.addEventListener("scroll",c,{passive:!0}),n?.addEventListener("wheel",C,{passive:!0})},[]),k=F(n=>{if(e.resizeObserver?.disconnect(),!n)return;let o;e.resizeObserver=new ResizeObserver(([u])=>{const{height:T}=u.contentRect,b=T-(o??T);if(e.resizeDifference=b,e.scrollTop>e.targetScrollTop&&(e.scrollTop=e.targetScrollTop),v(e.isNearBottom),b>=0){const w=R(g.current,o?g.current.resize:g.current.initial);N({animation:w,wait:!0,preserveScrollPosition:!0,duration:w==="instant"?void 0:fe})}else e.isNearBottom&&(h(!1),f(!0));o=T,requestAnimationFrame(()=>{setTimeout(()=>{e.resizeDifference===b&&(e.resizeDifference=0)},1)})}),e.resizeObserver?.observe(n)},[]);return{contentRef:k,scrollRef:l,scrollToBottom:N,stopScroll:A,isAtBottom:s||m,isNearBottom:m,escapedFromLock:a,state:e}};function F(r,a){const i=x.useCallback(s=>(i.current=s,r(s)),a);return i}const D=new Map;function R(...r){const a={...ue};let i=!1;for(const d of r){if(d==="instant"){i=!0;continue}typeof d=="object"&&(i=!1,a.damping=d.damping??a.damping,a.stiffness=d.stiffness??a.stiffness,a.mass=d.mass??a.mass)}const s=JSON.stringify(a);return D.has(s)||D.set(s,Object.freeze(a)),i?"instant":D.get(s)}function je({providers:r,currentProviderId:a,agentType:i,runtimeType:s,onSelect:d}){const{t:m}=z(),v=x.useId(),g=s===j.ACP?j.ACP:j.CLI,p=r.filter(c=>oe(c)&&String(c.provider.agentType)===i&&(c.provider.runtimeType===j.ACP?j.ACP:j.CLI)===g),f=r.find(c=>c.provider.id===a),h=f?.provider.name?W(f.provider.name,12):i,e=re(r,a),N=e?t.jsx("span",{role:"alert",className:"block break-words text-xs leading-snug text-destructive-ink",children:m(e)}):null;if(p.length===0||p.length===1&&p[0].provider.id===a)return t.jsxs("div",{className:"min-w-[112px] max-w-[min(46vw,240px)] px-2 py-1.5 text-xs text-muted-foreground select-none cursor-default",children:[t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(M,{agentType:f?.provider.agentType??i,className:"size-3.5 shrink-0"}),t.jsx("span",{className:"min-w-0 truncate",children:h})]}),N]});const A=new Set(p.filter(c=>B(c)).map(c=>c.provider.id));return t.jsxs("div",{className:"min-w-[112px] max-w-[min(46vw,240px)]",children:[t.jsxs(Y,{children:[t.jsxs(Q,{className:G({variant:"ghost",size:"sm",className:"group max-w-full gap-1 px-2 text-muted-foreground data-[state=open]:bg-accent data-[state=open]:text-foreground"}),title:`Provider: ${f?.provider.name??i} (click to change)`,children:[t.jsx(M,{agentType:f?.provider.agentType??i,className:"size-3.5"}),t.jsx("span",{className:"min-w-0 truncate",children:h}),t.jsx(ae,{className:"size-3 transition-transform group-data-[state=open]:rotate-180"})]}),t.jsxs(Z,{side:"top",align:"end",className:"max-h-[min(60vh,320px)] max-w-[min(80vw,320px)] overflow-y-auto",children:[t.jsx(ee,{children:m("切换渠道")}),t.jsx(te,{value:a??"",onValueChange:c=>{A.has(c)||d(c)},children:p.map((c,C)=>{const l=B(c),k=l?`${v}-${C}`:void 0;return t.jsxs(ne,{value:c.provider.id,icon:t.jsx(M,{agentType:c.provider.agentType,className:"mt-0.5 size-4"}),"aria-disabled":l?!0:void 0,"aria-describedby":k,onSelect:l?n=>n.preventDefault():void 0,className:L("items-start",l&&"cursor-not-allowed text-muted-foreground data-[highlighted]:text-muted-foreground"),children:[t.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[t.jsx("span",{className:"truncate",children:c.provider.name}),c.provider.isDefault&&t.jsx("span",{className:"shrink-0 text-xs font-normal text-muted-foreground",children:m("(默认)")})]}),c.provider.executionPermission?t.jsx("span",{className:"block text-xs font-normal text-muted-foreground",children:m(se[c.provider.executionPermission])}):null,l?t.jsx("span",{id:k,className:"block w-0 min-w-full whitespace-normal break-words text-xs font-normal text-destructive-ink",children:m(l)}):null]},c.provider.id)})})]})]}),N?t.jsx("div",{className:"px-2",children:N}):null]})}function Ce(r,a){return x.useMemo(()=>{for(let i=r.length-1;i>=0;i--){const s=r[i];if(s.tokenUsage&&typeof s.tokenUsage.totalTokens=="number"&&s.tokenUsage.totalTokens>0)return{totalTokens:s.tokenUsage.totalTokens,modelContextWindow:s.tokenUsage.modelContextWindow}}return a??null},[r,a])}export{je as P,ke as R,we as T,Ce as a,Se as u};