agent-tower 0.7.2-beta.4 → 0.7.2-beta.7

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 (204) hide show
  1. package/dist/runtime/__tests__/cli-driver-lifecycle.test.js +12 -8
  2. package/dist/runtime/__tests__/cli-driver-lifecycle.test.js.map +1 -1
  3. package/dist/runtime/cli-driver.js +15 -9
  4. package/dist/runtime/cli-driver.js.map +1 -1
  5. package/dist/services/__tests__/session-manager.lifecycle.test.js +69 -0
  6. package/dist/services/__tests__/session-manager.lifecycle.test.js.map +1 -1
  7. package/dist/services/__tests__/session-manager.team-run.test.js +3 -1
  8. package/dist/services/__tests__/session-manager.team-run.test.js.map +1 -1
  9. package/dist/services/__tests__/terminal-manager.test.js +70 -0
  10. package/dist/services/__tests__/terminal-manager.test.js.map +1 -1
  11. package/dist/services/session-manager.d.ts.map +1 -1
  12. package/dist/services/session-manager.js +2 -2
  13. package/dist/services/session-manager.js.map +1 -1
  14. package/dist/services/terminal-manager.d.ts.map +1 -1
  15. package/dist/services/terminal-manager.js +9 -4
  16. package/dist/services/terminal-manager.js.map +1 -1
  17. package/dist/web/assets/AgentDemoPage-CaR_Yk9_.js +1 -0
  18. package/dist/web/assets/{AgentEnvironmentSettingsPage-DQjnDr-h.js → AgentEnvironmentSettingsPage-SnxiaHvN.js} +1 -1
  19. package/dist/web/assets/BranchSelect-D-kqavDG.js +1 -0
  20. package/dist/web/assets/BrandLogo-CC1alVsd.js +1 -0
  21. package/dist/web/assets/ConversationPage-RWKLxe1j.js +3 -0
  22. package/dist/web/assets/CreateTaskInput-SHJ1YpRe.js +1 -0
  23. package/dist/web/assets/{DemoPage-BkkueMuL.js → DemoPage-BHbnnZFF.js} +1 -1
  24. package/dist/web/assets/DesignSystemPage-ChCrzeKT.js +12 -0
  25. package/dist/web/assets/EditableTaskTitle-CGVeZUSt.js +70 -0
  26. package/dist/web/assets/{ExecutionPermissionSelector-BX5Xx8ta.js → ExecutionPermissionSelector-DcC4IBOF.js} +10 -10
  27. package/dist/web/assets/GeneralSettingsPage-C_tkwpmF.js +1 -0
  28. package/dist/web/assets/{LoadingPreviewPage-BxjpxLLP.js → LoadingPreviewPage-dE_jyl19.js} +1 -1
  29. package/dist/web/assets/McpSettingsPage-CIuQ4bvy.js +1 -0
  30. package/dist/web/assets/MemberAvatar-BG0VDZKf.js +1 -0
  31. package/dist/web/assets/MobileTaskDetail-DxE6ZDAS.js +5 -0
  32. package/dist/web/assets/NotificationSettingsPage-B-Ot2OMg.js +1 -0
  33. package/dist/web/assets/ProfileSettingsPage-Dn1lrjJr.js +3 -0
  34. package/dist/web/assets/ProjectKanbanPage-jcW8sA7x.js +12 -0
  35. package/dist/web/assets/ProjectSettingsPage-BFPty2eA.js +2 -0
  36. package/dist/web/assets/ProviderSettingsPage-DLq-GBxp.js +67 -0
  37. package/dist/web/assets/SettingsMasterDetail-UfyoKAum.js +1 -0
  38. package/dist/web/assets/TaskDetail-a1jalILy.js +3 -0
  39. package/dist/web/assets/TeamSettingsPage-BxGc4W7K.js +1 -0
  40. package/dist/web/assets/arc-dhk0OSs5.js +1 -0
  41. package/dist/web/assets/{architectureDiagram-3BPJPVTR-DWO_DRgk.js → architectureDiagram-3BPJPVTR-BCNj6ZWE.js} +1 -1
  42. package/dist/web/assets/{at-sign-BFf8Sz8T.js → at-sign-C4VhWike.js} +1 -1
  43. package/dist/web/assets/{blockDiagram-GPEHLZMM-CJPYhE52.js → blockDiagram-GPEHLZMM-D1kmB9gz.js} +1 -1
  44. package/dist/web/assets/{c4Diagram-AAUBKEIU-Cx5IvcjB.js → c4Diagram-AAUBKEIU-DbWKTkSe.js} +1 -1
  45. package/dist/web/assets/channel-K0AG6Tl1.js +1 -0
  46. package/dist/web/assets/check-DYlb0A_N.js +1 -0
  47. package/dist/web/assets/{chevron-up-BwJT7iif.js → chevron-up-DOkDFvIc.js} +1 -1
  48. package/dist/web/assets/{chunk-2J33WTMH-D9cBNYgd.js → chunk-2J33WTMH-B3TA0-LD.js} +1 -1
  49. package/dist/web/assets/{chunk-4BX2VUAB-BY8TNt6E.js → chunk-4BX2VUAB-CvPTiBSV.js} +1 -1
  50. package/dist/web/assets/{chunk-55IACEB6-pT-HP-28.js → chunk-55IACEB6-xGe9Fu9Z.js} +1 -1
  51. package/dist/web/assets/{chunk-727SXJPM-hy95xDLb.js → chunk-727SXJPM-H8pz3amK.js} +2 -2
  52. package/dist/web/assets/{chunk-AQP2D5EJ-DlUN-icr.js → chunk-AQP2D5EJ-BmYYNxcL.js} +1 -1
  53. package/dist/web/assets/{chunk-FMBD7UC4-Dg2iMKZR.js → chunk-FMBD7UC4-BmOEsLTE.js} +1 -1
  54. package/dist/web/assets/{chunk-ND2GUHAM-DMzFIsJ-.js → chunk-ND2GUHAM-C5MfA0xc.js} +1 -1
  55. package/dist/web/assets/{chunk-QZHKN3VN-C6CgmKuM.js → chunk-QZHKN3VN-BcrGYZ7V.js} +1 -1
  56. package/dist/web/assets/classDiagram-4FO5ZUOK-BTJ44hwx.js +1 -0
  57. package/dist/web/assets/classDiagram-v2-Q7XG4LA2-BTJ44hwx.js +1 -0
  58. package/dist/web/assets/code-block-OCS4YCEC-DLPrDBDy.js +2 -0
  59. package/dist/web/assets/confirm-dialog-BRkrtULz.js +1 -0
  60. package/dist/web/assets/content-DPCGELMz.js +2 -0
  61. package/dist/web/assets/{copy-r0aUdsl8.js → copy-CdzVE3kf.js} +1 -1
  62. package/dist/web/assets/{cose-bilkent-S5V4N54A-D-fvmvw-.js → cose-bilkent-S5V4N54A-CLQ-m71G.js} +1 -1
  63. package/dist/web/assets/cssMode-ChMyv9Nj.js +1 -0
  64. package/dist/web/assets/{dagre-BM42HDAG-H0bYI1f3.js → dagre-BM42HDAG-CmDqxOfn.js} +1 -1
  65. package/dist/web/assets/{diagram-2AECGRRQ-DI568fLp.js → diagram-2AECGRRQ-D-fSbEll.js} +1 -1
  66. package/dist/web/assets/{diagram-5GNKFQAL-BLcaBzw2.js → diagram-5GNKFQAL-HPywThAf.js} +1 -1
  67. package/dist/web/assets/{diagram-KO2AKTUF-aL1cvl23.js → diagram-KO2AKTUF-DAzLhllz.js} +1 -1
  68. package/dist/web/assets/{diagram-LMA3HP47-DbOutAfH.js → diagram-LMA3HP47-DXYB9h8L.js} +1 -1
  69. package/dist/web/assets/{diagram-OG6HWLK6-D_cWftAX.js → diagram-OG6HWLK6-vv4kz4Zo.js} +1 -1
  70. package/dist/web/assets/dialog-B_vC5R4B.js +5 -0
  71. package/dist/web/assets/{erDiagram-TEJ5UH35-DRe5V8Dx.js → erDiagram-TEJ5UH35-Cu6aVKAa.js} +1 -1
  72. package/dist/web/assets/{flowDiagram-I6XJVG4X-B5-vg_Nh.js → flowDiagram-I6XJVG4X-BKDe8WSQ.js} +1 -1
  73. package/dist/web/assets/{freemarker2-CXlYb2yX.js → freemarker2-DI2giuAo.js} +2 -2
  74. package/dist/web/assets/{ganttDiagram-6RSMTGT7-B3iBFICN.js → ganttDiagram-6RSMTGT7-DMVLzmAE.js} +1 -1
  75. package/dist/web/assets/{gitGraphDiagram-PVQCEYII-CZ9zsKVw.js → gitGraphDiagram-PVQCEYII-vogzYdKn.js} +1 -1
  76. package/dist/web/assets/{globe-JXfw4MCF.js → globe-Rnn-nKw-.js} +1 -1
  77. package/dist/web/assets/handlebars-B9tmKQPV.js +1 -0
  78. package/dist/web/assets/hooks-DK4m7-FN.js +1 -0
  79. package/dist/web/assets/html-B_E2U0g5.js +1 -0
  80. package/dist/web/assets/htmlMode-DRHM_Cwq.js +1 -0
  81. package/dist/web/assets/icon-button-CuSuXgr_.js +1 -0
  82. package/dist/web/assets/index-B6Lvy5Sr.js +1 -0
  83. package/dist/web/assets/{index-CWEbo6pZ.js → index-B88xAivn.js} +5 -5
  84. package/dist/web/assets/index-BCV57B4O.js +41 -0
  85. package/dist/web/assets/index-CMjLMilU.js +1 -0
  86. package/dist/web/assets/index-CTG-4w90.js +1 -0
  87. package/dist/web/assets/index-Cz73HpYH.js +122 -0
  88. package/dist/web/assets/index-CzvAGoau.css +1 -0
  89. package/dist/web/assets/index-DENY_U7o.js +1 -0
  90. package/dist/web/assets/index-ZO2tqdha.js +1 -0
  91. package/dist/web/assets/{infoDiagram-5YYISTIA-DQU_sN8x.js → infoDiagram-5YYISTIA-CEfSHkNq.js} +1 -1
  92. package/dist/web/assets/{ishikawaDiagram-YF4QCWOH-BVGrNzJa.js → ishikawaDiagram-YF4QCWOH-BXKZuWtD.js} +1 -1
  93. package/dist/web/assets/javascript-ClWqjgn3.js +1 -0
  94. package/dist/web/assets/{journeyDiagram-JHISSGLW-DU4Md1Tq.js → journeyDiagram-JHISSGLW-wsOUYlu7.js} +1 -1
  95. package/dist/web/assets/{jsonMode-BMSvHUHa.js → jsonMode-DVAoDfae.js} +2 -2
  96. package/dist/web/assets/{kanban-definition-UN3LZRKU-DDPgCucq.js → kanban-definition-UN3LZRKU-DNsuvOrU.js} +1 -1
  97. package/dist/web/assets/kbd-B3m64lRd.js +1 -0
  98. package/dist/web/assets/{key-round-BHVp7u3Z.js → key-round-DpYSyeDH.js} +1 -1
  99. package/dist/web/assets/{layers-2tjjhM75.js → layers-CxqMQVmH.js} +1 -1
  100. package/dist/web/assets/{linear-D8yLBTVY.js → linear-BmmCZdOQ.js} +1 -1
  101. package/dist/web/assets/{link-CnunXc7X.js → link-DbSpzB1w.js} +1 -1
  102. package/dist/web/assets/liquid-CZf3xdoq.js +1 -0
  103. package/dist/web/assets/{lspLanguageFeatures-BiYvrSP0.js → lspLanguageFeatures-WhdC7zdf.js} +1 -1
  104. package/dist/web/assets/mdx-xzVEPP01.js +1 -0
  105. package/dist/web/assets/menu-0A0v_lRV.js +1 -0
  106. package/dist/web/assets/menu-styles-DWynpVVz.js +1 -0
  107. package/dist/web/assets/{mermaid-NOHMQCX5-9-DTTfp6.js → mermaid-NOHMQCX5-DmKVQY9m.js} +61 -62
  108. package/dist/web/assets/{message-square-QM0c6Dcv.js → message-square-CfNb-MTd.js} +1 -1
  109. package/dist/web/assets/{mindmap-definition-RKZ34NQL-CCAuuWFZ.js → mindmap-definition-RKZ34NQL-0RzXjZ9G.js} +1 -1
  110. package/dist/web/assets/modal-Kpqn-nDO.js +1 -0
  111. package/dist/web/assets/{monaco-CrBn9oMJ.js → monaco-I1fXAMIt.js} +3 -3
  112. package/dist/web/assets/{paperclip-CC7nHUQ7.js → paperclip-BBrzKZQC.js} +1 -1
  113. package/dist/web/assets/{pencil-DIY0Hu5t.js → pencil-pzVKblxj.js} +1 -1
  114. package/dist/web/assets/people-C6b3eeLq.js +1 -0
  115. package/dist/web/assets/{pieDiagram-4H26LBE5-CXy_N5QX.js → pieDiagram-4H26LBE5-Bcvzb8TW.js} +2 -2
  116. package/dist/web/assets/popover-BYz89aiY.js +1 -0
  117. package/dist/web/assets/python-DL05HvW4.js +1 -0
  118. package/dist/web/assets/{quadrantDiagram-W4KKPZXB-Dt44QsS8.js → quadrantDiagram-W4KKPZXB-DwNhxMxj.js} +1 -1
  119. package/dist/web/assets/razor-BCZ3_uDf.js +1 -0
  120. package/dist/web/assets/{requirementDiagram-4Y6WPE33-BL8D7Np0.js → requirementDiagram-4Y6WPE33-D2wSGYn2.js} +1 -1
  121. package/dist/web/assets/{sankeyDiagram-5OEKKPKP-I5nefO3A.js → sankeyDiagram-5OEKKPKP-l3LLF--T.js} +1 -1
  122. package/dist/web/assets/search-field-B5czD2Pl.js +1 -0
  123. package/dist/web/assets/select-DGwKE4l0.js +1 -0
  124. package/dist/web/assets/select-yem-xN9Z.js +1 -0
  125. package/dist/web/assets/{sequenceDiagram-3UESZ5HK-lbPrhX8g.js → sequenceDiagram-3UESZ5HK-BAGsbTS_.js} +1 -1
  126. package/dist/web/assets/{server-BNBdQGor.js → server-BIPZ9Ka-.js} +1 -1
  127. package/dist/web/assets/{stateDiagram-AJRCARHV-Bw3qtv2M.js → stateDiagram-AJRCARHV-C0BHmXYX.js} +1 -1
  128. package/dist/web/assets/stateDiagram-v2-BHNVJYJU-Be3UCkeQ.js +1 -0
  129. package/dist/web/assets/{textarea-CD82lB0Z.js → textarea-Bnfq7adW.js} +1 -1
  130. package/dist/web/assets/{timeline-definition-PNZ67QCA-Cfg_kgoa.js → timeline-definition-PNZ67QCA-Dt-DcRrG.js} +1 -1
  131. package/dist/web/assets/toggles-DxNDJZsN.js +1 -0
  132. package/dist/web/assets/tooltip-CHOgkFbE.js +1 -0
  133. package/dist/web/assets/track-B_K578io.js +1 -0
  134. package/dist/web/assets/{trash-2-BF_3L-qk.js → trash-2-ALAYDudv.js} +1 -1
  135. package/dist/web/assets/tsMode-kXxq-Lw7.js +11 -0
  136. package/dist/web/assets/typescript-E3_QcT_u.js +1 -0
  137. package/dist/web/assets/{upload-B2AMXrU-.js → upload-D7hKT2VA.js} +1 -1
  138. package/dist/web/assets/use-attachments-CK7y5KsN.js +2 -0
  139. package/dist/web/assets/use-profiles-Ncqxdw7S.js +1 -0
  140. package/dist/web/assets/{use-projects-BYUZwQ-q.js → use-projects-Dwy9AfAG.js} +1 -1
  141. package/dist/web/assets/{use-providers-DdV9gbj1.js → use-providers-BRyZjuBG.js} +1 -1
  142. package/dist/web/assets/use-workspaces-BBbahdwU.js +1 -0
  143. package/dist/web/assets/useNormalizedLogs-CRHRedwp.js +1 -0
  144. package/dist/web/assets/useTokenUsage-YwiF0xnT.js +1 -0
  145. package/dist/web/assets/{vennDiagram-CIIHVFJN-CdEP03CK.js → vennDiagram-CIIHVFJN-Cr55FtiY.js} +1 -1
  146. package/dist/web/assets/{wardley-L42UT6IY-q_Enplrs.js → wardley-L42UT6IY-CtwMk9MJ.js} +1 -1
  147. package/dist/web/assets/{wardleyDiagram-YWT4CUSO-DlL6fsid.js → wardleyDiagram-YWT4CUSO-BeyHmTu3.js} +1 -1
  148. package/dist/web/assets/xml-DxKND8qX.js +1 -0
  149. package/dist/web/assets/{xychartDiagram-2RQKCTM6-B2OGqVKA.js → xychartDiagram-2RQKCTM6-9g34Lq8E.js} +1 -1
  150. package/dist/web/assets/yaml-BqpCqTY6.js +1 -0
  151. package/dist/web/index.html +2 -2
  152. package/package.json +1 -1
  153. package/dist/web/assets/AgentDemoPage-Svq9Baa7.js +0 -1
  154. package/dist/web/assets/AgentLogo-I2etsqym.js +0 -1
  155. package/dist/web/assets/BranchSelect-Eb5UGWWX.js +0 -1
  156. package/dist/web/assets/BrandLogo-BjC1hcgv.js +0 -1
  157. package/dist/web/assets/ConversationPage-jEYUuSPT.js +0 -3
  158. package/dist/web/assets/CreateTaskInput-B_cRDkVq.js +0 -1
  159. package/dist/web/assets/DesignSystemPage-oM16R2Ta.js +0 -16
  160. package/dist/web/assets/GeneralSettingsPage-B0jFlgDl.js +0 -1
  161. package/dist/web/assets/McpSettingsPage-BErvd619.js +0 -1
  162. package/dist/web/assets/MemberAvatar-TVtoxQe8.js +0 -1
  163. package/dist/web/assets/NotificationSettingsPage-BETMBdj1.js +0 -1
  164. package/dist/web/assets/ProfileSettingsPage-C03ZAft-.js +0 -3
  165. package/dist/web/assets/ProjectKanbanPage-DsPxwoVf.js +0 -86
  166. package/dist/web/assets/ProjectSettingsPage-BwNM6VWs.js +0 -2
  167. package/dist/web/assets/ProviderSettingsPage-CeNQPd74.js +0 -67
  168. package/dist/web/assets/SettingsMasterDetail-B_SI2h_k.js +0 -1
  169. package/dist/web/assets/TeamSettingsPage-BfgtMl_n.js +0 -1
  170. package/dist/web/assets/agent-meta-DOylIs2N.js +0 -1
  171. package/dist/web/assets/arc-BlZww3MO.js +0 -1
  172. package/dist/web/assets/channel-D9sA6Wxp.js +0 -1
  173. package/dist/web/assets/check-Cm7Vstpm.js +0 -1
  174. package/dist/web/assets/chevron-down-C6Ta4vyM.js +0 -1
  175. package/dist/web/assets/circle-alert-Dm2Pl-rU.js +0 -1
  176. package/dist/web/assets/classDiagram-4FO5ZUOK-2e2YVo9r.js +0 -1
  177. package/dist/web/assets/classDiagram-v2-Q7XG4LA2-2e2YVo9r.js +0 -1
  178. package/dist/web/assets/code-block-OCS4YCEC-DizntuP_.js +0 -2
  179. package/dist/web/assets/confirm-dialog-DRpyE_qU.js +0 -1
  180. package/dist/web/assets/cssMode-DVorIr82.js +0 -1
  181. package/dist/web/assets/handlebars-BL0prPVZ.js +0 -1
  182. package/dist/web/assets/html-DJWeRkWe.js +0 -1
  183. package/dist/web/assets/htmlMode-D_fekqg9.js +0 -1
  184. package/dist/web/assets/index-CWbMMO6g.js +0 -122
  185. package/dist/web/assets/index-uXglTJ2_.css +0 -1
  186. package/dist/web/assets/javascript-CDfuzdfe.js +0 -1
  187. package/dist/web/assets/liquid-DHrNpv6c.js +0 -1
  188. package/dist/web/assets/mdx-CIEpgUOV.js +0 -1
  189. package/dist/web/assets/modal-BRoNvfhw.js +0 -1
  190. package/dist/web/assets/play-CIZVXiwM.js +0 -1
  191. package/dist/web/assets/python-BIs0pClJ.js +0 -1
  192. package/dist/web/assets/razor-JCx8NEwU.js +0 -1
  193. package/dist/web/assets/select-BmjoUfrV.js +0 -1
  194. package/dist/web/assets/stateDiagram-v2-BHNVJYJU-Xbc4HxDQ.js +0 -1
  195. package/dist/web/assets/switch-CEUHI4gI.js +0 -1
  196. package/dist/web/assets/task-kalEmHDc.js +0 -42
  197. package/dist/web/assets/task-priority-wLXAgVZZ.js +0 -1
  198. package/dist/web/assets/tsMode-DAHSkTAr.js +0 -11
  199. package/dist/web/assets/typescript-CptiLWGr.js +0 -1
  200. package/dist/web/assets/use-profiles-CQ-jIuiI.js +0 -1
  201. package/dist/web/assets/useNormalizedLogs-DdFsf-Z1.js +0 -1
  202. package/dist/web/assets/xml-DbPqkgZW.js +0 -1
  203. package/dist/web/assets/yaml-Deyq6Z5-.js +0 -1
  204. /package/dist/web/assets/{ProjectKanbanPage-DcpNTP1B.css → EditableTaskTitle-DcpNTP1B.css} +0 -0
@@ -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,N as Bt,af as ft,d as X,C as Vt,ag as Ft,z as zt}from"./index-CWEbo6pZ.js";import{d as ot}from"./arc-BlZww3MO.js";import"./index-CWbMMO6g.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,N as Bt,af as ft,d as X,C as Vt,ag as Ft,z as zt}from"./index-B88xAivn.js";import{d as ot}from"./arc-dhk0OSs5.js";import"./index-Cz73HpYH.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()+`
@@ -0,0 +1 @@
1
+ import{r as i,j as a,a8 as F,P as R,a4 as A,a3 as j,a1 as I,a2 as E,n as y}from"./index-Cz73HpYH.js";import{R as pe,I as fe,c as O,M as he}from"./index-DENY_U7o.js";import{C as me}from"./check-DYlb0A_N.js";import{u as M}from"./select-yem-xN9Z.js";import{u as B}from"./index-CTG-4w90.js";import{u as be}from"./index-ZO2tqdha.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 U="CheckboxIndicator",z=i.forwardRef((t,n)=>{const{__scopeCheckbox:r,forceMount:s,...o}=t,e=G(U,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}})})});z.displayName=U;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(z,{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};
@@ -0,0 +1 @@
1
+ import{c as X,r as s,j as c,a0 as $,a4 as W,a3 as H,P as J,a1 as C,a8 as I,a2 as Q,aH as Z,n as S}from"./index-Cz73HpYH.js";import{K as ee}from"./kbd-B3m64lRd.js";import{P as te,D as oe}from"./index-B6Lvy5Sr.js";import{R as re,A as ne,c as F,C as se,a as ae}from"./index-CTG-4w90.js";import{R as ie}from"./index-CMjLMilU.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};
@@ -0,0 +1 @@
1
+ import{j as $,n as g}from"./index-Cz73HpYH.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),u=m(Math.ceil(n/i)*i,i),e=[];for(let l=c;l<=u+i/2;l+=i)e.push(m(l,i));return{min:c,max:u,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),u=t+i*s;return{step:i,bandwidth:c,x:e=>u+e*i,center:e=>u+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,[u,e]=f(o,t,a,s),[l,b]=f(o,t,a,n),[p,v]=f(o,t,r,n),[x,k]=f(o,t,r,s);return[`M${u},${e}`,`A${a},${a} 0 ${c} 1 ${l},${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,l)=>({value:e,index:l})).sort((e,l)=>e.value-l.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 u=new Array(o.length);return s.forEach((e,l)=>{u[e.index]=n[l]}),u}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,u=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}}),u!==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:`${u*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-CWbMMO6g.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-Cz73HpYH.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};
@@ -0,0 +1,11 @@
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-I1fXAMIt.js";import"./EditableTaskTitle-CGVeZUSt.js";import"./index-Cz73HpYH.js";import"./mermaid-NOHMQCX5-DmKVQY9m.js";import"./use-attachments-CK7y5KsN.js";import"./tooltip-CHOgkFbE.js";import"./kbd-B3m64lRd.js";import"./index-B6Lvy5Sr.js";import"./index-CTG-4w90.js";import"./index-CMjLMilU.js";import"./use-providers-BRyZjuBG.js";import"./MemberAvatar-BG0VDZKf.js";import"./people-C6b3eeLq.js";import"./chevron-up-DOkDFvIc.js";import"./at-sign-C4VhWike.js";import"./paperclip-BBrzKZQC.js";import"./check-DYlb0A_N.js";import"./useTokenUsage-YwiF0xnT.js";import"./CreateTaskInput-SHJ1YpRe.js";import"./use-projects-Dwy9AfAG.js";import"./BrandLogo-CC1alVsd.js";import"./hooks-DK4m7-FN.js";import"./index-DENY_U7o.js";import"./index-ZO2tqdha.js";import"./trash-2-ALAYDudv.js";import"./ExecutionPermissionSelector-DcC4IBOF.js";import"./menu-0A0v_lRV.js";import"./menu-styles-DWynpVVz.js";import"./index-BCV57B4O.js";import"./confirm-dialog-BRkrtULz.js";import"./dialog-B_vC5R4B.js";import"./modal-Kpqn-nDO.js";import"./select-DGwKE4l0.js";import"./select-yem-xN9Z.js";import"./layers-CxqMQVmH.js";import"./message-square-CfNb-MTd.js";import"./textarea-Bnfq7adW.js";import"./content-DPCGELMz.js";import"./copy-CdzVE3kf.js";import"./search-field-B5czD2Pl.js";import"./popover-BYz89aiY.js";import"./server-BIPZ9Ka-.js";import"./icon-button-CuSuXgr_.js";import"./use-workspaces-BBbahdwU.js";import"./upload-D7hKT2VA.js";import"./globe-Rnn-nKw-.js";import"./BranchSelect-D-kqavDG.js";import"./pencil-pzVKblxj.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
+ `),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
+ `)})}),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
+
5
+ ${N(o)}`;return t}}function N(c){let e=`*@${c.name}*`;if(c.name==="param"&&c.text){const[t,...o]=c.text;e+=`\`${t.text}\``,o.length>0&&(e+=` — ${o.map(i=>i.text).join(" ")}`)}else Array.isArray(c.text)?e+=` — ${c.text.map(t=>t.text).join(" ")}`:c.text&&(e+=` — ${c.text}`);return e}class I extends y{constructor(){super(...arguments),this.signatureHelpTriggerCharacters=["(",","]}static _toSignatureHelpTriggerReason(e){switch(e.triggerKind){case f.SignatureHelpTriggerKind.TriggerCharacter:return e.triggerCharacter?e.isRetrigger?{kind:"retrigger",triggerCharacter:e.triggerCharacter}:{kind:"characterTyped",triggerCharacter:e.triggerCharacter}:{kind:"invoked"};case f.SignatureHelpTriggerKind.ContentChange:return e.isRetrigger?{kind:"retrigger"}:{kind:"invoked"};case f.SignatureHelpTriggerKind.Invoke:default:return{kind:"invoked"}}}async provideSignatureHelp(e,t,o,i){const l=e.uri,p=e.getOffsetAt(t),n=await this._worker(l);if(e.isDisposed())return;const s=await n.getSignatureHelpItems(l.toString(),p,{triggerReason:I._toSignatureHelpTriggerReason(i)});if(!s||e.isDisposed())return;const u={activeSignature:s.selectedItemIndex,activeParameter:s.argumentIndex,signatures:[]};return s.items.forEach(d=>{const g={label:"",parameters:[]};g.documentation={value:_(d.documentation)},g.label+=_(d.prefixDisplayParts),d.parameters.forEach((m,b,k)=>{const x=_(m.displayParts),D={label:x,documentation:{value:_(m.documentation)}};g.label+=x,g.parameters.push(D),b<k.length-1&&(g.label+=_(d.separatorDisplayParts))}),g.label+=_(d.suffixDisplayParts),u.signatures.push(g)}),{value:u,dispose(){}}}}class W extends y{async provideHover(e,t,o){const i=e.uri,l=e.getOffsetAt(t),p=await this._worker(i);if(e.isDisposed())return;const n=await p.getQuickInfoAtPosition(i.toString(),l);if(!n||e.isDisposed())return;const s=_(n.documentation),u=n.tags?n.tags.map(g=>N(g)).join(`
6
+
7
+ `):"",d=_(n.displayParts);return{range:this._textSpanToRange(e,n.textSpan),contents:[{value:"```typescript\n"+d+"\n```\n"},{value:s+(u?`
8
+
9
+ `+u:"")}]}}}class j extends y{async provideDocumentHighlights(e,t,o){const i=e.uri,l=e.getOffsetAt(t),p=await this._worker(i);if(e.isDisposed())return;const n=await p.getDocumentHighlights(i.toString(),l,[i.toString()]);if(!(!n||e.isDisposed()))return n.flatMap(s=>s.highlightSpans.map(u=>({range:this._textSpanToRange(e,u.textSpan),kind:u.kind==="writtenReference"?f.DocumentHighlightKind.Write:f.DocumentHighlightKind.Text})))}}class B extends y{constructor(e,t){super(t),this._libFiles=e}async provideDefinition(e,t,o){const i=e.uri,l=e.getOffsetAt(t),p=await this._worker(i);if(e.isDisposed())return;const n=await p.getDefinitionAtPosition(i.toString(),l);if(!n||e.isDisposed()||(await this._libFiles.fetchLibFilesIfNecessary(n.map(u=>F.parse(u.fileName))),e.isDisposed()))return;const s=[];for(let u of n){const d=this._libFiles.getOrCreateModel(u.fileName);d&&s.push({uri:d.uri,range:this._textSpanToRange(d,u.textSpan)})}return s}}class U extends y{constructor(e,t){super(t),this._libFiles=e}async provideReferences(e,t,o,i){const l=e.uri,p=e.getOffsetAt(t),n=await this._worker(l);if(e.isDisposed())return;const s=await n.getReferencesAtPosition(l.toString(),p);if(!s||e.isDisposed()||(await this._libFiles.fetchLibFilesIfNecessary(s.map(d=>F.parse(d.fileName))),e.isDisposed()))return;const u=[];for(let d of s){const g=this._libFiles.getOrCreateModel(d.fileName);g&&u.push({uri:g.uri,range:this._textSpanToRange(g,d.textSpan)})}return u}}class $ extends y{async provideDocumentSymbols(e,t){const o=e.uri,i=await this._worker(o);if(e.isDisposed())return;const l=await i.getNavigationTree(o.toString());if(!l||e.isDisposed())return;const p=(s,u)=>({name:s.text,detail:"",kind:h[s.kind]||f.SymbolKind.Variable,range:this._textSpanToRange(e,s.spans[0]),selectionRange:this._textSpanToRange(e,s.spans[0]),tags:[],children:s.childItems?.map(g=>p(g,s.text)),containerName:u});return l.childItems?l.childItems.map(s=>p(s)):[]}}class a{}a.unknown="";a.keyword="keyword";a.script="script";a.module="module";a.class="class";a.interface="interface";a.type="type";a.enum="enum";a.variable="var";a.localVariable="local var";a.function="function";a.localFunction="local function";a.memberFunction="method";a.memberGetAccessor="getter";a.memberSetAccessor="setter";a.memberVariable="property";a.constructorImplementation="constructor";a.callSignature="call";a.indexSignature="index";a.constructSignature="construct";a.parameter="parameter";a.typeParameter="type parameter";a.primitiveType="primitive type";a.label="label";a.alias="alias";a.const="const";a.let="let";a.warning="warning";let h=Object.create(null);h[a.module]=f.SymbolKind.Module;h[a.class]=f.SymbolKind.Class;h[a.enum]=f.SymbolKind.Enum;h[a.interface]=f.SymbolKind.Interface;h[a.memberFunction]=f.SymbolKind.Method;h[a.memberVariable]=f.SymbolKind.Property;h[a.memberGetAccessor]=f.SymbolKind.Property;h[a.memberSetAccessor]=f.SymbolKind.Property;h[a.variable]=f.SymbolKind.Variable;h[a.const]=f.SymbolKind.Variable;h[a.localVariable]=f.SymbolKind.Variable;h[a.variable]=f.SymbolKind.Variable;h[a.function]=f.SymbolKind.Function;h[a.localFunction]=f.SymbolKind.Function;class S extends y{static _convertOptions(e){return{ConvertTabsToSpaces:e.insertSpaces,TabSize:e.tabSize,IndentSize:e.tabSize,IndentStyle:2,NewLineCharacter:`
10
+ `,InsertSpaceAfterCommaDelimiter:!0,InsertSpaceAfterSemicolonInForStatements:!0,InsertSpaceBeforeAndAfterBinaryOperators:!0,InsertSpaceAfterKeywordsInControlFlowStatements:!0,InsertSpaceAfterFunctionKeywordForAnonymousFunctions:!0,InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis:!1,InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets:!1,InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces:!1,PlaceOpenBraceOnNewLineForControlBlocks:!1,PlaceOpenBraceOnNewLineForFunctions:!1}}_convertTextChanges(e,t){return{text:t.newText,range:this._textSpanToRange(e,t.span)}}}class z extends S{constructor(){super(...arguments),this.canFormatMultipleRanges=!1}async provideDocumentRangeFormattingEdits(e,t,o,i){const l=e.uri,p=e.getOffsetAt({lineNumber:t.startLineNumber,column:t.startColumn}),n=e.getOffsetAt({lineNumber:t.endLineNumber,column:t.endColumn}),s=await this._worker(l);if(e.isDisposed())return;const u=await s.getFormattingEditsForRange(l.toString(),p,n,S._convertOptions(o));if(!(!u||e.isDisposed()))return u.map(d=>this._convertTextChanges(e,d))}}class G extends S{get autoFormatTriggerCharacters(){return[";","}",`
11
+ `]}async provideOnTypeFormattingEdits(e,t,o,i,l){const p=e.uri,n=e.getOffsetAt(t),s=await this._worker(p);if(e.isDisposed())return;const u=await s.getFormattingEditsAfterKeystroke(p.toString(),n,o,S._convertOptions(i));if(!(!u||e.isDisposed()))return u.map(d=>this._convertTextChanges(e,d))}}class J extends S{async provideCodeActions(e,t,o,i){const l=e.uri,p=e.getOffsetAt({lineNumber:t.startLineNumber,column:t.startColumn}),n=e.getOffsetAt({lineNumber:t.endLineNumber,column:t.endColumn}),s=S._convertOptions(e.getOptions()),u=o.markers.filter(b=>b.code).map(b=>b.code).map(Number),d=await this._worker(l);if(e.isDisposed())return;const g=await d.getCodeFixesAtPosition(l.toString(),p,n,u,s);return!g||e.isDisposed()?{actions:[],dispose:()=>{}}:{actions:g.filter(b=>b.changes.filter(k=>k.isNewFile).length===0).map(b=>this._tsCodeFixActionToMonacoCodeAction(e,o,b)),dispose:()=>{}}}_tsCodeFixActionToMonacoCodeAction(e,t,o){const i=[];for(const p of o.changes)for(const n of p.textChanges)i.push({resource:e.uri,versionId:void 0,textEdit:{range:this._textSpanToRange(e,n.span),text:n.newText}});return{title:o.description,edit:{edits:i},diagnostics:t.markers,kind:"quickfix"}}}class Q extends y{constructor(e,t){super(t),this._libFiles=e}async provideRenameEdits(e,t,o,i){const l=e.uri,p=l.toString(),n=e.getOffsetAt(t),s=await this._worker(l);if(e.isDisposed())return;const u=await s.getRenameInfo(p,n,{allowRenameOfImportPath:!1});if(u.canRename===!1)return{edits:[],rejectReason:u.localizedErrorMessage};if(u.fileToRename!==void 0)throw new Error("Renaming files is not supported.");const d=await s.findRenameLocations(p,n,!1,!1,!1);if(!d||e.isDisposed())return;const g=[];for(const m of d){const b=this._libFiles.getOrCreateModel(m.fileName);if(b)g.push({resource:b.uri,versionId:void 0,textEdit:{range:this._textSpanToRange(b,m.textSpan),text:o}});else throw new Error(`Unknown file ${m.fileName}.`)}return{edits:g}}}class q extends y{async provideInlayHints(e,t,o){const i=e.uri,l=i.toString(),p=e.getOffsetAt({lineNumber:t.startLineNumber,column:t.startColumn}),n=e.getOffsetAt({lineNumber:t.endLineNumber,column:t.endColumn}),s=await this._worker(i);return e.isDisposed()?null:{hints:(await s.provideInlayHints(l,p,n)).map(g=>({...g,label:g.text,position:e.getPositionAt(g.position),kind:this._convertHintKind(g.kind)})),dispose:()=>{}}}_convertHintKind(e){switch(e){case"Parameter":return f.InlayHintKind.Parameter;case"Type":return f.InlayHintKind.Type;default:return f.InlayHintKind.Type}}}let T,L;function ze(c){L=R(c,"typescript")}function Ge(c){T=R(c,"javascript")}function Je(){return new Promise((c,e)=>{if(!T)return e("JavaScript not registered!");c(T)})}function Qe(){return new Promise((c,e)=>{if(!L)return e("TypeScript not registered!");c(L)})}function R(c,e){const t=[],o=new E(e,c),i=(...n)=>o.getLanguageServiceWorker(...n),l=new H(i);function p(){const{modeConfiguration:n}=c;X(t),n.completionItems&&t.push(f.registerCompletionItemProvider(e,new C(i))),n.signatureHelp&&t.push(f.registerSignatureHelpProvider(e,new I(i))),n.hovers&&t.push(f.registerHoverProvider(e,new W(i))),n.documentHighlights&&t.push(f.registerDocumentHighlightProvider(e,new j(i))),n.definitions&&t.push(f.registerDefinitionProvider(e,new B(l,i))),n.references&&t.push(f.registerReferenceProvider(e,new U(l,i))),n.documentSymbols&&t.push(f.registerDocumentSymbolProvider(e,new $(i))),n.rename&&t.push(f.registerRenameProvider(e,new Q(l,i))),n.documentRangeFormattingEdits&&t.push(f.registerDocumentRangeFormattingEditProvider(e,new z(i))),n.onTypeFormattingEdits&&t.push(f.registerOnTypeFormattingEditProvider(e,new G(i))),n.codeActions&&t.push(f.registerCodeActionProvider(e,new J(i))),n.inlayHints&&t.push(f.registerInlayHintsProvider(e,new q(i))),n.diagnostics&&t.push(new V(l,c,e,i))}return p(),i}function X(c){for(;c.length;)c.pop().dispose()}export{y as Adapter,J as CodeActionAdaptor,B as DefinitionAdapter,V as DiagnosticsAdapter,j as DocumentHighlightAdapter,z as FormatAdapter,S as FormatHelper,G as FormatOnTypeAdapter,q as InlayHintsAdapter,a as Kind,H as LibFiles,$ as OutlineAdapter,W as QuickInfoAdapter,U as ReferenceAdapter,Q as RenameAdapter,I as SignatureHelpAdapter,C as SuggestAdapter,E as WorkerManager,A as flattenDiagnosticMessageText,Je as getJavaScriptWorker,Qe as getTypeScriptWorker,Ge as setupJavaScript,ze as setupTypeScript};
@@ -0,0 +1 @@
1
+ import{l as e}from"./monaco-I1fXAMIt.js";import"./EditableTaskTitle-CGVeZUSt.js";import"./index-Cz73HpYH.js";import"./mermaid-NOHMQCX5-DmKVQY9m.js";import"./use-attachments-CK7y5KsN.js";import"./tooltip-CHOgkFbE.js";import"./kbd-B3m64lRd.js";import"./index-B6Lvy5Sr.js";import"./index-CTG-4w90.js";import"./index-CMjLMilU.js";import"./use-providers-BRyZjuBG.js";import"./MemberAvatar-BG0VDZKf.js";import"./people-C6b3eeLq.js";import"./chevron-up-DOkDFvIc.js";import"./at-sign-C4VhWike.js";import"./paperclip-BBrzKZQC.js";import"./check-DYlb0A_N.js";import"./useTokenUsage-YwiF0xnT.js";import"./CreateTaskInput-SHJ1YpRe.js";import"./use-projects-Dwy9AfAG.js";import"./BrandLogo-CC1alVsd.js";import"./hooks-DK4m7-FN.js";import"./index-DENY_U7o.js";import"./index-ZO2tqdha.js";import"./trash-2-ALAYDudv.js";import"./ExecutionPermissionSelector-DcC4IBOF.js";import"./menu-0A0v_lRV.js";import"./menu-styles-DWynpVVz.js";import"./index-BCV57B4O.js";import"./confirm-dialog-BRkrtULz.js";import"./dialog-B_vC5R4B.js";import"./modal-Kpqn-nDO.js";import"./select-DGwKE4l0.js";import"./select-yem-xN9Z.js";import"./layers-CxqMQVmH.js";import"./message-square-CfNb-MTd.js";import"./textarea-Bnfq7adW.js";import"./content-DPCGELMz.js";import"./copy-CdzVE3kf.js";import"./search-field-B5czD2Pl.js";import"./popover-BYz89aiY.js";import"./server-BIPZ9Ka-.js";import"./icon-button-CuSuXgr_.js";import"./use-workspaces-BBbahdwU.js";import"./upload-D7hKT2VA.js";import"./globe-Rnn-nKw-.js";import"./BranchSelect-D-kqavDG.js";import"./pencil-pzVKblxj.js";const M={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")}}},Q={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{M as conf,Q as language};
@@ -1 +1 @@
1
- import{c as a}from"./index-CWbMMO6g.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-Cz73HpYH.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};
@@ -0,0 +1,2 @@
1
+ import{c as y,j as s,n as f,u as I,E as k,X as w,V as h,r as l,o as N,v as $}from"./index-Cz73HpYH.js";import{T as A,F}from"./tooltip-CHOgkFbE.js";const C=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],E=y("image",C);function R({content:e,children:t,className:n,side:u="top",align:d="center"}){return s.jsx(A,{content:e,side:u,align:d,children:s.jsx("div",{className:f("relative inline-block [&>:disabled]:pointer-events-none",n),children:t})})}const S=h();function z(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/(1024*1024)).toFixed(1)}MB`}function M({files:e,onRemove:t}){return e.length===0?null:s.jsx("div",{"aria-label":"Attachments",className:"flex flex-wrap gap-2 px-4 pt-3 pb-1",children:e.map(n=>s.jsx(B,{item:n,onRemove:t},n.tempId))})}function B({item:e,onRemove:t}){const{t:n}=I(),u=e.file.type.startsWith("image/"),d=e.status==="error",p=e.status==="uploading";return s.jsxs("div",{className:f("relative group flex items-center gap-2 px-3 py-2 rounded-lg border text-xs max-w-[200px]",d?"border-destructive/25 bg-destructive/[0.06] text-destructive-ink":"border-border bg-muted/50 text-foreground/80"),children:[u&&e.status==="done"&&e.attachment?s.jsx("img",{src:`${S}${e.attachment.url}`,alt:e.file.name,className:"w-8 h-8 rounded object-cover flex-shrink-0"}):s.jsx("span",{className:"flex-shrink-0",children:p?s.jsx(k,{size:16,className:"animate-spin motion-reduce:[animation-duration:2.4s] text-muted-foreground"}):u?s.jsx(E,{size:16,className:"text-muted-foreground"}):s.jsx(F,{size:16,className:"text-muted-foreground"})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("div",{className:"truncate font-medium",children:e.file.name}),d?s.jsx("div",{className:"truncate",children:e.error}):s.jsx("div",{className:"text-muted-foreground",children:z(e.file.size)})]}),s.jsx("button",{type:"button",onClick:()=>t(e.tempId),"aria-label":`${n("Remove")} ${e.file.name}`,className:"absolute -top-1.5 -right-1.5 flex size-5 items-center justify-center rounded-full bg-inverse text-inverse-foreground opacity-0 shadow-raised transition-opacity hover:bg-inverse/90 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60 group-hover:opacity-100 pointer-coarse:opacity-100",children:s.jsx(w,{size:10})})]})}const T=h();async function U(e){const t=new FormData;t.append("file",e);const n=await fetch(`${T}/attachments/upload`,{method:"POST",body:t});if(!n.ok){const u=await n.json().catch(()=>({}));throw new Error(u.error||`Upload failed (${n.status})`)}return n.json()}let L=0;function q(){const[e,t]=l.useState([]),n=l.useRef(e);n.current=e;const u=l.useCallback(async a=>{const o=a.map(r=>({tempId:`tmp-${++L}`,file:r,progress:0,status:"uploading"}));t(r=>[...r,...o]),await Promise.allSettled(o.map(async r=>{try{const m=await U(r.file);t(c=>c.map(i=>i.tempId===r.tempId?{...i,status:"done",progress:100,attachment:m}:i))}catch(m){t(c=>c.map(i=>i.tempId===r.tempId?{...i,status:"error",error:m instanceof Error?m.message:"Upload failed"}:i))}}))},[]),d=l.useCallback(()=>n.current.filter(a=>a.status==="done"&&a.attachment).map(a=>a.attachment),[]),p=l.useCallback(a=>{t(o=>o.filter(r=>r.tempId!==a))},[]),g=l.useCallback(()=>{t([])},[]),x=l.useCallback(a=>{a.length!==0&&t(o=>{const r=new Set(o.map(c=>c.attachment?.id??c.tempId)),m=a.filter(c=>{const i=c.attachment?.id??c.tempId;return r.has(i)?!1:(r.add(i),!0)});return m.length>0?[...o,...m]:o})},[]),b=l.useCallback(()=>{const a=d();return a.length===0?"":a.map(o=>`${o.mimeType.startsWith("image/")?"!":""}[${o.originalName}](${o.storagePath})`).join(`
2
+ `)},[d]),v=e.length>0,j=e.some(a=>a.status==="uploading");return{files:e,addFiles:u,removeFile:p,clear:g,restoreFiles:x,buildMarkdownLinks:b,getDoneAttachments:d,hasFiles:v,isUploading:j}}function D(e){const t=l.useMemo(()=>Array.from(new Set(e.filter(Boolean))),[e]);return N({queryKey:["attachments","metadata",t],queryFn:()=>$.get("/attachments/metadata",{params:{ids:t.join(",")}}),enabled:t.length>0,staleTime:300*1e3})}export{M as A,R as T,D as a,q as u};
@@ -0,0 +1 @@
1
+ import{o as n,q as i,p as a,s,v as r}from"./index-Cz73HpYH.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 n,o as s,n as u,q as r,p as a}from"./index-CWbMMO6g.js";function c(e){const t={};return e?.page!=null&&(t.page=String(e.page)),e?.limit!=null&&(t.limit=String(e.limit)),e?.includeArchived&&(t.includeArchived="true"),n({queryKey:r.projects.list(e),queryFn:()=>a.get("/projects",{params:t})})}function o(e){return n({queryKey:r.projects.detail(e),queryFn:()=>a.get(`/projects/${e}`),enabled:!!e})}function y(){const e=s();return u({mutationFn:t=>a.post("/projects",t),onSuccess:()=>{e.invalidateQueries({queryKey:r.projects.all})}})}function d(){const e=s();return u({mutationFn:({id:t,...i})=>a.put(`/projects/${t}`,i),onSuccess:(t,i)=>{e.invalidateQueries({queryKey:r.projects.all}),e.invalidateQueries({queryKey:r.projects.detail(i.id)}),i.mainBranch!==void 0&&(e.invalidateQueries({queryKey:r.workspaces.all}),e.invalidateQueries({queryKey:r.tasks.all}))}})}function p(){const e=s();return u({mutationFn:({id:t,deleteRepo:i})=>a.post(`/projects/${t}/archive`,{deleteRepo:i??!1}),onSuccess:(t,i)=>{e.invalidateQueries({queryKey:r.projects.all}),e.invalidateQueries({queryKey:r.projects.detail(i.id)}),e.invalidateQueries({queryKey:r.tasks.all}),e.invalidateQueries({queryKey:r.workspaces.all})}})}function q(){const e=s();return u({mutationFn:({id:t,repoPath:i})=>a.post(`/projects/${t}/restore`,i?{repoPath:i}:{}),onSuccess:(t,i)=>{e.invalidateQueries({queryKey:r.projects.all}),e.invalidateQueries({queryKey:r.projects.detail(i.id)}),e.invalidateQueries({queryKey:r.tasks.all}),e.invalidateQueries({queryKey:r.workspaces.all})}})}function j(){const e=s();return u({mutationFn:({id:t})=>a.get(`/projects/${t}/git-capability`),onSuccess:(t,i)=>{e.setQueryData(r.projects.gitCapability(i.id),t),e.invalidateQueries({queryKey:r.projects.all}),e.invalidateQueries({queryKey:r.projects.detail(i.id)}),e.invalidateQueries({queryKey:r.tasks.all})}})}export{c as a,p as b,q as c,j as d,o as e,y as f,d as u};
1
+ import{o as n,q as s,p as u,s as r,v as a}from"./index-Cz73HpYH.js";function c(e){const t={};return e?.page!=null&&(t.page=String(e.page)),e?.limit!=null&&(t.limit=String(e.limit)),e?.includeArchived&&(t.includeArchived="true"),n({queryKey:r.projects.list(e),queryFn:()=>a.get("/projects",{params:t})})}function o(e){return n({queryKey:r.projects.detail(e),queryFn:()=>a.get(`/projects/${e}`),enabled:!!e})}function y(){const e=s();return u({mutationFn:t=>a.post("/projects",t),onSuccess:()=>{e.invalidateQueries({queryKey:r.projects.all})}})}function d(){const e=s();return u({mutationFn:({id:t,...i})=>a.put(`/projects/${t}`,i),onSuccess:(t,i)=>{e.invalidateQueries({queryKey:r.projects.all}),e.invalidateQueries({queryKey:r.projects.detail(i.id)}),i.mainBranch!==void 0&&(e.invalidateQueries({queryKey:r.workspaces.all}),e.invalidateQueries({queryKey:r.tasks.all}))}})}function p(){const e=s();return u({mutationFn:({id:t,deleteRepo:i})=>a.post(`/projects/${t}/archive`,{deleteRepo:i??!1}),onSuccess:(t,i)=>{e.invalidateQueries({queryKey:r.projects.all}),e.invalidateQueries({queryKey:r.projects.detail(i.id)}),e.invalidateQueries({queryKey:r.tasks.all}),e.invalidateQueries({queryKey:r.workspaces.all})}})}function q(){const e=s();return u({mutationFn:({id:t,repoPath:i})=>a.post(`/projects/${t}/restore`,i?{repoPath:i}:{}),onSuccess:(t,i)=>{e.invalidateQueries({queryKey:r.projects.all}),e.invalidateQueries({queryKey:r.projects.detail(i.id)}),e.invalidateQueries({queryKey:r.tasks.all}),e.invalidateQueries({queryKey:r.workspaces.all})}})}function j(){const e=s();return u({mutationFn:({id:t})=>a.get(`/projects/${t}/git-capability`),onSuccess:(t,i)=>{e.setQueryData(r.projects.gitCapability(i.id),t),e.invalidateQueries({queryKey:r.projects.all}),e.invalidateQueries({queryKey:r.projects.detail(i.id)}),e.invalidateQueries({queryKey:r.tasks.all})}})}export{c as a,p as b,q as c,j as d,y as e,o as f,d as u};
@@ -1 +1 @@
1
- import{m as p,n as u,o as a,q as t,p as s}from"./index-CWbMMO6g.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{o as p,p as u,q as a,s as t,v as s}from"./index-Cz73HpYH.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};
@@ -0,0 +1 @@
1
+ import{u as Z,r as o,v as l,j as s,aK as _,ay as I,n as j,E as B,_ as V,D as J,ah as X,o as S,ao as M,p as f,q as m,s as i}from"./index-Cz73HpYH.js";import{I as ee,C as se}from"./popover-BYz89aiY.js";import{F as w}from"./hooks-DK4m7-FN.js";import{C as N}from"./check-DYlb0A_N.js";function te(e,r="git"){return r==="directory"||e.isGitRepo?"select-and-browse":"browse"}function de({value:e,onChange:r,validationMode:n="git",placeholder:x}){const{t:h}=Z(),[d,$]=o.useState(""),[C,D]=o.useState([]),[q,T]=o.useState(""),[W,A]=o.useState("/"),[E,L]=o.useState([]),[P,K]=o.useState(!1),[R,Q]=o.useState(null),[v,b]=o.useState(e),[F,p]=o.useState(null),[H,G]=o.useState(!1),z=o.useRef(!1);o.useEffect(()=>{b(e)},[e]);const c=o.useCallback(async t=>{K(!0),Q(null);try{const a={};t&&(a.path=t);const u=await l.get("/filesystem/browse",{params:a});$(u.current),T(u.parent),A(u.sep||"/"),D(u.dirs),u.drives&&L(u.drives)}catch(a){Q(a instanceof Error?a.message:"Failed to browse directory")}finally{K(!1)}},[]);o.useEffect(()=>{z.current||(z.current=!0,c())},[c]);const g=o.useCallback(async t=>{if(b(t),n==="directory"){r(t),p(null);return}G(!0),p(null);try{const a=await l.get("/filesystem/validate",{params:{path:t}});a.valid&&a.isGitRepo!==!1?(r(t),p(null)):p(a.error??"Not a Git repository")}catch(a){p(a instanceof Error?a.message:"Validation failed")}finally{G(!1)}},[r,n]),O=o.useCallback(t=>{te(t,n)==="select-and-browse"?(g(t.path),c(t.path)):(c(t.path),p(null))},[g,c,n]),y=W==="\\",k=o.useMemo(()=>d?d.split(/[\\/]/).filter(Boolean):[],[d]),U=o.useCallback(t=>{const a=k.slice(0,t+1);let u;y?(u=a.join("\\"),a.length===1&&/^[A-Za-z]:$/.test(a[0])&&(u+="\\")):u="/"+a.join("/"),c(u),p(null)},[k,c,y]),Y=o.useCallback(t=>{if(t.key==="Enter"&&!t.nativeEvent.isComposing&&t.nativeEvent.keyCode!==229){t.preventDefault();const a=v.trim();a&&(c(a),g(a))}},[v,c,g]);return s.jsxs("div",{className:"space-y-2",children:[s.jsx("div",{className:"relative",children:s.jsx(ee,{type:"text",value:v,onChange:t=>b(t.target.value),onKeyDown:Y,placeholder:x??"e.g., /Users/me/projects/my-repo",className:"font-mono",suffix:e?n==="git"?s.jsx(_,{"aria-hidden":!0,className:"size-3.5 text-success"}):s.jsx(w,{"aria-hidden":!0,className:"size-3.5 text-success"}):void 0})}),s.jsx("p",{className:"text-xs text-muted-foreground",children:h(n==="git"?"Browse and select a Git repository, or type a path and press Enter":"Browse and select a directory, or type a path and press Enter")}),E.length>0&&s.jsx("div",{className:"flex items-center gap-1 flex-wrap",children:E.map(t=>s.jsx(se,{size:"sm",selected:d.toUpperCase().startsWith(t.toUpperCase()),onClick:()=>{c(t),p(null)},className:"font-mono",children:t.replace("\\","")},t))}),s.jsxs("div",{className:"flex items-center gap-0.5 text-xs text-muted-foreground overflow-x-auto pb-1 scrollbar-none",children:[!y&&s.jsx("button",{type:"button",onClick:()=>c("/"),className:"hover:text-foreground transition-colors flex-shrink-0 px-1 py-0.5 rounded hover:bg-accent",children:"/"}),k.map((t,a)=>s.jsxs("span",{className:"flex items-center gap-0.5 flex-shrink-0",children:[(y?a>0:!0)&&s.jsx(I,{size:10,"aria-hidden":"true",className:"text-muted-foreground/50"}),s.jsx("button",{type:"button",onClick:()=>U(a),className:j("px-1 py-0.5 rounded transition-colors truncate max-w-[120px]",a===k.length-1?"font-medium text-foreground/90":"hover:text-foreground hover:bg-accent"),children:t})]},a))]}),s.jsx("div",{className:"border border-border rounded-lg overflow-hidden",children:s.jsx("div",{className:"max-h-[200px] overflow-y-auto",children:P?s.jsxs("div",{className:"flex items-center justify-center py-8 text-muted-foreground",children:[s.jsx(B,{size:16,className:"animate-spin motion-reduce:[animation-duration:2.4s] mr-2"}),s.jsx("span",{className:"text-xs",children:"Loading..."})]}):R?s.jsxs("div",{className:"flex items-center justify-center py-8 text-destructive-ink gap-2",children:[s.jsx(V,{size:14}),s.jsx("span",{className:"text-xs",children:R})]}):C.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-8 text-muted-foreground",children:[s.jsx("span",{className:"text-xs",children:"No subdirectories"}),n==="directory"&&d&&s.jsxs(J,{size:"sm",variant:d===e?"soft":"secondary","aria-pressed":d===e,onClick:()=>g(d),children:[s.jsx(N,{}),s.jsx("span",{children:h("Select Current")})]})]}):s.jsxs("ul",{className:"divide-y divide-border/60",children:[d!==q&&s.jsx("li",{children:s.jsxs("button",{type:"button",onClick:()=>c(q),className:"w-full flex items-center gap-2.5 px-3 py-2 text-left hover:bg-accent transition-colors group",children:[s.jsx(w,{size:14,className:"text-muted-foreground flex-shrink-0"}),s.jsx("span",{className:"text-xs text-muted-foreground group-hover:text-foreground",children:".."})]})}),C.map(t=>s.jsx("li",{children:s.jsxs("button",{type:"button",onClick:()=>O(t),className:j("w-full flex items-center gap-2.5 px-3 py-2 text-left transition-colors group",t.path===e?"bg-accent":"hover:bg-accent"),children:[t.isGitRepo?s.jsx(_,{size:14,className:"text-foreground/70 flex-shrink-0"}):s.jsx(w,{size:14,className:"text-muted-foreground flex-shrink-0"}),s.jsx("span",{className:j("text-xs truncate",t.path===e?"font-medium text-foreground":"text-foreground/80 group-hover:text-foreground"),children:t.name}),t.isGitRepo&&s.jsx(X,{size:"sm",shape:"tag",className:"ml-auto shrink-0",children:"Git"}),t.isGitRepo&&t.path===e&&s.jsx(N,{size:12,className:"shrink-0 text-foreground"}),!t.isGitRepo&&n!=="directory"&&s.jsx(I,{size:12,className:"ml-auto text-muted-foreground/70 group-hover:text-muted-foreground flex-shrink-0"}),!t.isGitRepo&&n==="directory"&&s.jsx(N,{size:12,className:j("ml-auto flex-shrink-0",t.path===e?"text-foreground":"text-muted-foreground/70 group-hover:text-muted-foreground")})]})},t.path))]})})}),H&&s.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[s.jsx(B,{size:12,className:"animate-spin motion-reduce:[animation-duration:2.4s]"}),s.jsx("span",{children:"Validating..."})]}),F&&s.jsxs("div",{className:"flex items-center gap-2 text-xs text-destructive-ink",children:[s.jsx(V,{size:12}),s.jsx("span",{children:F})]})]})}const re=1500,ae=2e3,ne=5e3;function pe(e,r){return e&&r?.workingDir===e&&r.tab==="changes"?re:!1}function ie(e,r){return e&&r?.workspaceId===e&&r.tab==="changes"?ae:!1}function xe(e,r){return e&&r?.workingDir===e&&r.tab==="history"?ne:!1}function fe(e){return S({queryKey:i.workspaces.projectBranches(e),queryFn:()=>l.get(`/projects/${e}/workspace-branches`),enabled:!!e,staleTime:0})}function me(){const e=m();return f({mutationFn:({id:r,...n})=>l.patch(`/workspaces/${r}/base-branch`,n),onSettled:async()=>{await Promise.all([e.invalidateQueries({queryKey:i.workspaces.all}),e.invalidateQueries({queryKey:i.tasks.all}),e.invalidateQueries({queryKey:i.git.all})])}})}function he(e){return S({queryKey:i.workspaces.list(e),queryFn:()=>l.get(`/tasks/${e}/workspaces`),enabled:!!e})}function ge(e){const r=m();return f({mutationFn:n=>l.post(`/tasks/${e}/workspaces`,n),onSuccess:()=>{r.invalidateQueries({queryKey:i.workspaces.list(e)}),r.invalidateQueries({queryKey:i.tasks.all})}})}function ye(){const e=m();return f({mutationFn:({id:r,commitMessage:n,stopActiveServices:x})=>l.post(`/workspaces/${r}/merge`,{commitMessage:n,stopActiveServices:x}),onSuccess:()=>{e.invalidateQueries({queryKey:i.workspaces.all}),e.invalidateQueries({queryKey:i.tasks.all}),e.invalidateQueries({queryKey:i.git.all}),e.invalidateQueries({queryKey:i.workspaceServices.all})},onError:()=>{e.invalidateQueries({queryKey:i.git.all}),e.invalidateQueries({queryKey:i.workspaceServices.all})}})}function ke(){const e=m();return f({mutationFn:r=>l.post(`/workspaces/${r}/reactivate`),onSuccess:()=>{e.invalidateQueries({queryKey:i.workspaces.all}),e.invalidateQueries({queryKey:i.tasks.all})}})}function je(){return f({mutationFn:({workspaceId:e,editorType:r})=>l.post(`/workspaces/${e}/open-editor`,{editorType:r})})}function ve(e,r={}){const n=M(h=>h.visibleContext),x=ie(e,n);return S({queryKey:i.workspaces.gitStatus(e),queryFn:()=>l.get(`/workspaces/${e}/git-status`),enabled:!!e&&(r.enabled??!0),refetchInterval:x,refetchIntervalInBackground:!1,refetchOnWindowFocus:x?"always":!1,refetchOnReconnect:x?"always":!1})}function be(){const e=m();return f({mutationFn:r=>l.post(`/workspaces/${r}/rebase`),onSuccess:(r,n)=>{e.invalidateQueries({queryKey:i.workspaces.gitStatus(n)}),e.invalidateQueries({queryKey:i.git.all})},onError:(r,n)=>{e.invalidateQueries({queryKey:i.workspaces.gitStatus(n)}),e.invalidateQueries({queryKey:i.git.all})}})}function we(){const e=m();return f({mutationFn:r=>l.post(`/workspaces/${r}/abort-operation`),onSuccess:(r,n)=>{e.invalidateQueries({queryKey:i.workspaces.gitStatus(n)}),e.invalidateQueries({queryKey:i.git.all})}})}export{de as F,he as a,ve as b,je as c,ge as d,ke as e,fe as f,pe as g,me as h,be as i,ye as j,xe as k,we as u};
@@ -0,0 +1 @@
1
+ import{u as oe,j as o,aa as Ie,D as Ce,as as Oe,n as H,aU as ke,r,aV as je,ab as L,an as V,ac as T,ad as _e,aW as Le,aX as qe,v as Pe}from"./index-Cz73HpYH.js";import{T as De}from"./track-B_K578io.js";import{C as Me}from"./index-B6Lvy5Sr.js";import{u as q,E as ze,n as $e,b as Be,c as Fe}from"./mermaid-NOHMQCX5-DmKVQY9m.js";function Ue({error:t,onRetry:e,title:n,description:u,className:a}){const{t:c}=oe();return o.jsxs("div",{role:"alert",className:H("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(Ue,{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 Ye(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:H("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:H("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=Ye(f.status),$=y==="done"||y==="cancelled";return o.jsxs("li",{className:H("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:H("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 Ge=!1,He=1500,le=[250,1e3,3e3],Ve=1e4;function pe(t){return t instanceof DOMException&&t.name==="AbortError"}function Xe(t){if(pe(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 Ke(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===V.COMPLETED||t===V.FAILED||t===V.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 me(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),K=q(r.useCallback(s=>s.conversations[e]??ze,[e])),h=r.useRef(!1),P=r.useRef({}),O=r.useRef(null),F=r.useRef(new Map),U=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 Y=r.useRef(e);Y.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===V.RUNNING||n===V.PENDING)&&B(!0),C(null))},[e,n,$]),r.useEffect(()=>{if(!e)return;const s=L.getSocket(),d=P.current,l=F.current,g=U.current;X(s.connected);let j=!z(n);const S=()=>{R.current+=1,X(!0),O.current?.()},m=()=>{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}),me(i.patch,x)&&(k.current.lastOutputAt=Date.now()),I(!0)},G=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",m),s.on(T.SESSION_PATCH,ne),s.on(T.SESSION_ID,G),s.on(T.SESSION_EXIT,b),s.on(T.SESSION_ERROR,_),X(s.connected),()=>{s.off("connect",S),s.off("disconnect",m),s.off(T.SESSION_PATCH,ne),s.off(T.SESSION_ID,G),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=()=>Y.current===s,g=F.current.get(s);if(g)return g.epoch!==d&&(g.reloadRequested=!0,g.controller.abort()),g.promise;const j=U.current.get(s);j!==void 0&&(window.clearTimeout(j),U.current.delete(s));const S=new AbortController,m={controller:S,epoch:d,promise:Promise.resolve(!1),reloadRequested:!1},G=(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)),!(_&&_.entries.length>0)&&l()&&ae(!0);for(let D=0;D<=le.length;D+=1){const M=L.getSocket();if(S.signal.aborted||!M.connected||!l()||m.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()||m.epoch!==R.current)return m.reloadRequested=M.connected&&l(),!1;const E=P.current[s]??[];P.current[s]=[];let A=x,w=We(x);for(const p of E){if(typeof p.seq=="number"){if(p.seq<=w)continue;if(p.seq!==w+1)throw new Error(`Buffered patch sequence gap: expected ${w+1}, received ${p.seq}`)}const Q=Be(A,p.patch);if(!Q.ok)throw new Error(`Buffered conversation patch rejected (${Q.kind}): ${Q.reason}`);A=Q.conversation,typeof p.seq=="number"&&p.seq>w&&(w=p.seq)}A={...A,seq:w,isTruncated:!1};const Te=re(A.entries,te.current);k.current={sessionId:s,processingStartedAt:Te?.processingStartedAt,lastOutputAt:E.some(p=>me(p.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 p=q.getState().getConversation(s);p&&p.entries.length>0&&I(de(J.current))}return!0}catch(x){if(S.signal.aborted||pe(x))return!1;if(!l()||m.epoch!==R.current||!M.connected)return m.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),!Xe(x))return!1;const E=le[D];if(E===void 0){const ie=m.epoch,w=window.setTimeout(()=>{U.current.delete(s),Y.current===s&&R.current===ie&&L.getSocket().connected&&O.current?.()},Ve);return U.current.set(s,w),!1}if(!await Ke(E,S.signal))return!1}}return!1})().finally(()=>{F.current.get(s)===m&&F.current.delete(s),m.reloadRequested&&Y.current===s&&L.getSocket().connected&&queueMicrotask(()=>{O.current?.()}),Y.current===s&&ae(!1)});return m.promise=G,F.current.set(s,m),G},[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(K.entries);if(ce&&Z){const d=re(K.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},[K.entries,ce,Z,e,y]);return{isConnected:Se,isAttached:Z,isLoadingSnapshot:xe,isOutputActive:Ae,lastExitAt:ve,logs:we,entries:K.entries,agentSessionId:Ee,attach:ye,sendInput:Re,clearLogs:be}}export{tt as L,st as T,nt as a,rt as u};
@@ -0,0 +1 @@
1
+ import{c as U,u as z,r as x,j as t,E as O,n as L,b6 as $,b7 as H,aZ as j,b8 as W,T as P,b as G}from"./index-Cz73HpYH.js";import{f as K,g as V}from"./CreateTaskInput-SHJ1YpRe.js";import{T as X}from"./use-attachments-CK7y5KsN.js";import{G as J,M as Y,a as Z,b as Q,c as ee,d as te,e as ne}from"./menu-0A0v_lRV.js";import"./mermaid-NOHMQCX5-DmKVQY9m.js";import{g as re,a as B,l as se}from"./ExecutionPermissionSelector-DcC4IBOF.js";import{C as oe}from"./index-B6Lvy5Sr.js";const ae=[["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"}]],ie=U("shield-alert",ae);function be({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(ie,{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 le(r){return r>=.9?"danger":r>=.7?"warning":"neutral"}function Ne({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?le(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 ce={damping:.7,stiffness:.05,mass:1.25},ue=70,de=1e3/60,me=350;let E=!1;globalThis.document?.addEventListener("mousedown",()=>{E=!0});globalThis.document?.addEventListener("mouseup",()=>{E=!1});globalThis.document?.addEventListener("click",()=>{E=!1});const ke=(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 c=Math.max(Math.min(r.targetScrollTop(o,{scrollElement:l.current,contentElement:k.current}),o),0);return n={targetScrollTop:o,calculatedScrollTop:c},requestAnimationFrame(()=>{n=void 0}),c},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=ue}}},[]),N=x.useCallback((n={})=>{typeof n=="string"&&(n={animation:n}),n.preserveScrollPosition||f(!0);const o=Date.now()+(Number(n.wait)||0),c=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,M=performance.now(),q=(M-(e.lastTick??M))/de;if(e.animation||(e.animation={behavior:c,promise:_,ignoreEscapes:T}),e.animation.behavior===c&&(e.lastTick=M),p()||o>Date.now())return S();if(I<Math.min(w,e.calculatedTargetScrollTop)){if(e.animation?.behavior===c){if(c==="instant")return e.scrollTop=e.calculatedTargetScrollTop,S();e.velocity=(c.damping*e.velocity+c.stiffness*e.scrollDifference)/c.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===c?e.animation.promise:S()},[f,p,e]),A=x.useCallback(()=>{h(!0),f(!1)},[h,f]),u=x.useCallback(({target:n})=>{if(n!==l.current)return;const{scrollTop:o,ignoreScrollToTop:c}=e;let{lastScrollTop:T=o}=e;e.lastScrollTop=o,e.ignoreScrollToTop=void 0,c&&c>o&&(T=c),v(e.isNearBottom),setTimeout(()=>{if(e.resizeDifference||o===c)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 c=n;for(;!["scroll","auto"].includes(getComputedStyle(c).overflow);){if(!c.parentElement)return;c=c.parentElement}c===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",u),l.current?.removeEventListener("wheel",C),n?.addEventListener("scroll",u,{passive:!0}),n?.addEventListener("wheel",C,{passive:!0})},[]),k=F(n=>{if(e.resizeObserver?.disconnect(),!n)return;let o;e.resizeObserver=new ResizeObserver(([c])=>{const{height:T}=c.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:me})}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={...ce};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 we({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(u=>String(u.provider.agentType)===i&&(u.provider.runtimeType===j.ACP?j.ACP:j.CLI)===g),f=r.find(u=>u.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(P,{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(u=>B(u)).map(u=>u.provider.id));return t.jsxs("div",{className:"min-w-[112px] max-w-[min(46vw,240px)]",children:[t.jsxs(Y,{children:[t.jsxs(Z,{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(P,{agentType:f?.provider.agentType??i,className:"size-3.5"}),t.jsx("span",{className:"min-w-0 truncate",children:h}),t.jsx(oe,{className:"size-3 transition-transform group-data-[state=open]:rotate-180"})]}),t.jsxs(Q,{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:u=>{A.has(u)||d(u)},children:p.map((u,C)=>{const l=B(u),k=l?`${v}-${C}`:void 0;return t.jsxs(ne,{value:u.provider.id,icon:t.jsx(P,{agentType:u.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:u.provider.name}),u.provider.isDefault&&t.jsx("span",{className:"shrink-0 text-xs font-normal text-muted-foreground",children:m("(默认)")})]}),u.provider.executionPermission?t.jsx("span",{className:"block text-xs font-normal text-muted-foreground",children:m(se[u.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]},u.provider.id)})})]})]}),N?t.jsx("div",{className:"px-2",children:N}):null]})}function Se(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{we as P,be as R,Ne as T,Se as a,ke as u};
@@ -1,4 +1,4 @@
1
- import{aU as Gt,s as Wt,g as Kt,q as Ht,p as Yt,a as Xt,b as Zt,_ as w,D as wt,I as Jt,d as ot,al as Qt,ac as $t,ad as te,ae as ee,e as ne,z as se,F as ie,G as oe}from"./index-CWEbo6pZ.js";import"./index-CWbMMO6g.js";const kt=(t,n)=>Gt(t,"a",-n),_t=1e-10;function st(t,n){const s=ae(t),e=s.filter(c=>re(c,t));let i=0,o=0;const a=[];if(e.length>1){const c=Et(e);for(let u=0;u<e.length;++u){const r=e[u];r.angle=Math.atan2(r.x-c.x,r.y-c.y)}e.sort((u,r)=>r.angle-u.angle);let h=e[e.length-1];for(let u=0;u<e.length;++u){const r=e[u];o+=(h.x+r.x)*(r.y-h.y);const y={x:(r.x+h.x)/2,y:(r.y+h.y)/2};let d=null;for(let b=0;b<r.parentIndex.length;++b)if(h.parentIndex.includes(r.parentIndex[b])){const x=t[r.parentIndex[b]],M=Math.atan2(r.x-x.x,r.y-x.y),A=Math.atan2(h.x-x.x,h.y-x.y);let T=A-M;T<0&&(T+=2*Math.PI);const S=A-T/2;let g=q(y,{x:x.x+x.radius*Math.sin(S),y:x.y+x.radius*Math.cos(S)});g>x.radius*2&&(g=x.radius*2),(d==null||d.width>g)&&(d={circle:x,width:g,p1:r,p2:h,large:g>x.radius,sweep:!0})}d!=null&&(a.push(d),i+=lt(d.circle.radius,d.width),h=r)}}else{let c=t[0];for(let u=1;u<t.length;++u)t[u].radius<c.radius&&(c=t[u]);let h=!1;for(let u=0;u<t.length;++u)if(q(t[u],c)>Math.abs(c.radius-t[u].radius)){h=!0;break}h?i=o=0:(i=c.radius*c.radius*Math.PI,a.push({circle:c,p1:{x:c.x,y:c.y+c.radius},p2:{x:c.x-_t,y:c.y+c.radius},width:c.radius*2,large:!0,sweep:!0}))}return o/=2,n&&(n.area=i+o,n.arcArea=i,n.polygonArea=o,n.arcs=a,n.innerPoints=e,n.intersectionPoints=s),i+o}function re(t,n){return n.every(s=>q(t,s)<s.radius+_t)}function ae(t){const n=[];for(let s=0;s<t.length;++s)for(let e=s+1;e<t.length;++e){const i=Tt(t[s],t[e]);for(const o of i)o.parentIndex=[s,e],n.push(o)}return n}function lt(t,n){return t*t*Math.acos(1-n/t)-(t-n)*Math.sqrt(n*(2*t-n))}function q(t,n){return Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y))}function xt(t,n,s){if(s>=t+n)return 0;if(s<=Math.abs(t-n))return Math.PI*Math.min(t,n)*Math.min(t,n);const e=t-(s*s-n*n+t*t)/(2*s),i=n-(s*s-t*t+n*n)/(2*s);return lt(t,e)+lt(n,i)}function Tt(t,n){const s=q(t,n),e=t.radius,i=n.radius;if(s>=e+i||s<=Math.abs(e-i))return[];const o=(e*e-i*i+s*s)/(2*s),a=Math.sqrt(e*e-o*o),c=t.x+o*(n.x-t.x)/s,h=t.y+o*(n.y-t.y)/s,u=-(n.y-t.y)*(a/s),r=-(n.x-t.x)*(a/s);return[{x:c+u,y:h-r},{x:c-u,y:h+r}]}function Et(t){const n={x:0,y:0};for(const s of t)n.x+=s.x,n.y+=s.y;return n.x/=t.length,n.y/=t.length,n}function le(t,n,s,e){e=e||{};const i=e.maxIterations||100,o=e.tolerance||1e-10,a=t(n),c=t(s);let h=s-n;if(a*c>0)throw"Initial bisect points must have opposite signs";if(a===0)return n;if(c===0)return s;for(let u=0;u<i;++u){h/=2;const r=n+h,y=t(r);if(y*a>=0&&(n=r),Math.abs(h)<o||y===0)return r}return n+h}function ct(t){const n=new Array(t);for(let s=0;s<t;++s)n[s]=0;return n}function Mt(t,n){return ct(t).map(()=>ct(n))}function $(t,n){let s=0;for(let e=0;e<t.length;++e)s+=t[e]*n[e];return s}function ut(t){return Math.sqrt($(t,t))}function ft(t,n,s){for(let e=0;e<n.length;++e)t[e]=n[e]*s}function J(t,n,s,e,i){for(let o=0;o<t.length;++o)t[o]=n*s[o]+e*i[o]}function zt(t,n,s){s=s||{};const e=s.maxIterations||n.length*200,i=s.nonZeroDelta||1.05,o=s.zeroDelta||.001,a=s.minErrorDelta||1e-6,c=s.minErrorDelta||1e-5,h=s.rho!==void 0?s.rho:1,u=s.chi!==void 0?s.chi:2,r=s.psi!==void 0?s.psi:-.5,y=s.sigma!==void 0?s.sigma:.5;let d;const b=n.length,x=new Array(b+1);x[0]=n,x[0].fx=t(n),x[0].id=0;for(let v=0;v<b;++v){const l=n.slice();l[v]=l[v]?l[v]*i:o,x[v+1]=l,x[v+1].fx=t(l),x[v+1].id=v+1}function M(v){for(let l=0;l<v.length;l++)x[b][l]=v[l];x[b].fx=v.fx}const A=(v,l)=>v.fx-l.fx,T=n.slice(),S=n.slice(),g=n.slice(),m=n.slice();for(let v=0;v<e;++v){if(x.sort(A),s.history){const p=x.map(f=>{const N=f.slice();return N.fx=f.fx,N.id=f.id,N});p.sort((f,N)=>f.id-N.id),s.history.push({x:x[0].slice(),fx:x[0].fx,simplex:p})}d=0;for(let p=0;p<b;++p)d=Math.max(d,Math.abs(x[0][p]-x[1][p]));if(Math.abs(x[0].fx-x[b].fx)<a&&d<c)break;for(let p=0;p<b;++p){T[p]=0;for(let f=0;f<b;++f)T[p]+=x[f][p];T[p]/=b}const l=x[b];if(J(S,1+h,T,-h,l),S.fx=t(S),S.fx<x[0].fx)J(m,1+u,T,-u,l),m.fx=t(m),m.fx<S.fx?M(m):M(S);else if(S.fx>=x[b-1].fx){let p=!1;if(S.fx>l.fx?(J(g,1+r,T,-r,l),g.fx=t(g),g.fx<l.fx?M(g):p=!0):(J(g,1-r*h,T,r*h,l),g.fx=t(g),g.fx<S.fx?M(g):p=!0),p){if(y>=1)break;for(let f=1;f<x.length;++f)J(x[f],1-y,x[0],y,x[f]),x[f].fx=t(x[f])}}else M(S)}return x.sort(A),{fx:x[0].fx,x:x[0]}}function ce(t,n,s,e,i,o,a){const c=s.fx,h=$(s.fxprime,n);let u=c,r=c,y=h,d=0;i=i||1,o=o||1e-6,a=a||.1;function b(x,M,A){for(let T=0;T<16;++T)if(i=(x+M)/2,J(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=$(e.fxprime,n),u>c+o*i*h||u>=A)M=i;else{if(Math.abs(y)<=-a*h)return i;y*(M-x)>=0&&(M=x),x=i,A=u}return 0}for(let x=0;x<10;++x){if(J(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=$(e.fxprime,n),u>c+o*i*h||x&&u>=r)return b(d,i,r);if(Math.abs(y)<=-a*h)return i;if(y>=0)return b(i,d,u);r=u,d=i,i*=2}return i}function ue(t,n,s){let e={x:n.slice(),fx:0,fxprime:n.slice()},i={x:n.slice(),fx:0,fxprime:n.slice()};const o=n.slice();let a,c,h=1,u;s=s||{},u=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),a=e.fxprime.slice(),ft(a,e.fxprime,-1);for(let r=0;r<u;++r){if(h=ce(t,a,e,i,h),s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:h}),!h)ft(a,e.fxprime,-1);else{J(o,1,i.fxprime,-1,e.fxprime);const y=$(e.fxprime,e.fxprime),d=Math.max(0,$(o,i.fxprime)/y);J(a,d,a,-1,i.fxprime),c=e,e=i,i=c}if(ut(e.fxprime)<=1e-5)break}return s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:h}),e}function At(t,n={}){n.maxIterations=n.maxIterations||500;const s=n.initialLayout||ge,e=n.lossFunction||tt,i=fe(t,n),o=s(i,n),a=Object.keys(o),c=[];for(const r of a)c.push(o[r].x),c.push(o[r].y);const u=zt(r=>{const y={};for(let d=0;d<a.length;++d){const b=a[d];y[b]={x:r[2*d],y:r[2*d+1],radius:o[b].radius}}return e(y,i)},c,n).x;for(let r=0;r<a.length;++r){const y=a[r];o[y].x=u[2*r],o[y].y=u[2*r+1]}return o}const Rt=1e-10;function ht(t,n,s){return Math.min(t,n)*Math.min(t,n)*Math.PI<=s+Rt?Math.abs(t-n):le(e=>xt(t,n,e)-s,0,t+n)}function fe(t,n={}){const s=n.distinct,e=t.map(c=>Object.assign({},c));function i(c){return c.join(";")}if(s){const c=new Map;for(const h of e)for(let u=0;u<h.sets.length;u++){const r=String(h.sets[u]);c.set(r,h.size+(c.get(r)||0));for(let y=u+1;y<h.sets.length;y++){const d=String(h.sets[y]),b=`${r};${d}`,x=`${d};${r}`;c.set(b,h.size+(c.get(b)||0)),c.set(x,h.size+(c.get(x)||0))}}for(const h of e)h.sets.length<3&&(h.size=c.get(i(h.sets)))}const o=[],a=new Set;for(const c of e)if(c.sets.length===1)o.push(c.sets[0]);else if(c.sets.length===2){const h=c.sets[0],u=c.sets[1];a.add(i(c.sets)),a.add(i([u,h]))}o.sort((c,h)=>c===h?0:c<h?-1:1);for(let c=0;c<o.length;++c){const h=o[c];for(let u=c+1;u<o.length;++u){const r=o[u];a.has(i([h,r]))||e.push({sets:[h,r],size:0})}}return e}function he(t,n,s){const e=Mt(n.length,n.length),i=Mt(n.length,n.length);return t.filter(o=>o.sets.length===2).forEach(o=>{const a=s[o.sets[0]],c=s[o.sets[1]],h=Math.sqrt(n[a].size/Math.PI),u=Math.sqrt(n[c].size/Math.PI),r=ht(h,u,o.size);e[a][c]=e[c][a]=r;let y=0;o.size+1e-10>=Math.min(n[a].size,n[c].size)?y=1:o.size<=1e-10&&(y=-1),i[a][c]=i[c][a]=y}),{distances:e,constraints:i}}function de(t,n,s,e){for(let o=0;o<n.length;++o)n[o]=0;let i=0;for(let o=0;o<s.length;++o){const a=t[2*o],c=t[2*o+1];for(let h=o+1;h<s.length;++h){const u=t[2*h],r=t[2*h+1],y=s[o][h],d=e[o][h],b=(u-a)*(u-a)+(r-c)*(r-c),x=Math.sqrt(b),M=b-y*y;d>0&&x<=y||d<0&&x>=y||(i+=2*M*M,n[2*o]+=4*M*(a-u),n[2*o+1]+=4*M*(c-r),n[2*h]+=4*M*(u-a),n[2*h+1]+=4*M*(r-c))}}return i}function ge(t,n={}){let s=ye(t,n);const e=n.lossFunction||tt;if(t.length>=8){const i=xe(t,n),o=e(i,t),a=e(s,t);o+1e-8<a&&(s=i)}return s}function xe(t,n={}){const s=n.restarts||10,e=[],i={};for(const d of t)d.sets.length===1&&(i[d.sets[0]]=e.length,e.push(d));let{distances:o,constraints:a}=he(t,e,i);const c=ut(o.map(ut))/o.length;o=o.map(d=>d.map(b=>b/c));const h=(d,b)=>de(d,b,o,a);let u=null;for(let d=0;d<s;++d){const b=ct(o.length*2).map(Math.random),x=ue(h,b,n);(!u||x.fx<u.fx)&&(u=x)}const r=u.x,y={};for(let d=0;d<e.length;++d){const b=e[d];y[b.sets[0]]={x:r[2*d]*c,y:r[2*d+1]*c,radius:Math.sqrt(b.size/Math.PI)}}if(n.history)for(const d of n.history)ft(d.x,c);return y}function ye(t,n){const s=n&&n.lossFunction?n.lossFunction:tt,e={},i={};for(const y of t)if(y.sets.length===1){const d=y.sets[0];e[d]={x:1e10,y:1e10,rowid:e.length,size:y.size,radius:Math.sqrt(y.size/Math.PI)},i[d]=[]}t=t.filter(y=>y.sets.length===2);for(const y of t){let d=y.weight!=null?y.weight:1;const b=y.sets[0],x=y.sets[1];y.size+Rt>=Math.min(e[b].size,e[x].size)&&(d=0),i[b].push({set:x,size:y.size,weight:d}),i[x].push({set:b,size:y.size,weight:d})}const o=[];Object.keys(i).forEach(y=>{let d=0;for(let b=0;b<i[y].length;++b)d+=i[y][b].size*i[y][b].weight;o.push({set:y,size:d})});function a(y,d){return d.size-y.size}o.sort(a);const c={};function h(y){return y.set in c}function u(y,d){e[d].x=y.x,e[d].y=y.y,c[d]=!0}u({x:0,y:0},o[0].set);for(let y=1;y<o.length;++y){const d=o[y].set,b=i[d].filter(h),x=e[d];if(b.sort(a),b.length===0)throw"ERROR: missing pairwise overlap information";const M=[];for(var r=0;r<b.length;++r){const S=e[b[r].set],g=ht(x.radius,S.radius,b[r].size);M.push({x:S.x+g,y:S.y}),M.push({x:S.x-g,y:S.y}),M.push({y:S.y+g,x:S.x}),M.push({y:S.y-g,x:S.x});for(let m=r+1;m<b.length;++m){const v=e[b[m].set],l=ht(x.radius,v.radius,b[m].size),p=Tt({x:S.x,y:S.y,radius:g},{x:v.x,y:v.y,radius:l});M.push(...p)}}let A=1e50,T=M[0];for(const S of M){e[d].x=S.x,e[d].y=S.y;const g=s(e,t);g<A&&(A=g,T=S)}u(T,d)}return e}function tt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const a=t[e.sets[0]],c=t[e.sets[1]];i=xt(a.radius,c.radius,q(a,c))}else i=st(e.sets.map(a=>t[a]));const o=e.weight!=null?e.weight:1;s+=o*(i-e.size)*(i-e.size)}return s}function Dt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const c=t[e.sets[0]],h=t[e.sets[1]];i=xt(c.radius,h.radius,q(c,h))}else i=st(e.sets.map(c=>t[c]));const o=e.weight!=null?e.weight:1,a=Math.log((i+1)/(e.size+1));s+=o*a*a}return s}function pe(t,n,s){if(s==null?t.sort((i,o)=>o.radius-i.radius):t.sort(s),t.length>0){const i=t[0].x,o=t[0].y;for(const a of t)a.x-=i,a.y-=o}if(t.length===2&&q(t[0],t[1])<Math.abs(t[1].radius-t[0].radius)&&(t[1].x=t[0].x+t[0].radius-t[1].radius-1e-10,t[1].y=t[0].y),t.length>1){const i=Math.atan2(t[1].x,t[1].y)-n,o=Math.cos(i),a=Math.sin(i);for(const c of t){const h=c.x,u=c.y;c.x=o*h-a*u,c.y=a*h+o*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-n;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const o=t[1].y/(1e-10+t[1].x);for(const a of t){var e=(a.x+o*a.y)/(1+o*o);a.x=2*e-a.x,a.y=2*e*o-a.y}}}}function me(t){t.forEach(i=>{i.parent=i});function n(i){return i.parent!==i&&(i.parent=n(i.parent)),i.parent}function s(i,o){const a=n(i),c=n(o);a.parent=c}for(let i=0;i<t.length;++i)for(let o=i+1;o<t.length;++o){const a=t[i].radius+t[o].radius;q(t[i],t[o])+1e-10<a&&s(t[o],t[i])}const e=new Map;for(let i=0;i<t.length;++i){const o=n(t[i]).parent.setid;e.has(o)||e.set(o,[]),e.get(o).push(t[i])}return t.forEach(i=>{delete i.parent}),Array.from(e.values())}function dt(t){const n=s=>{const e=t.reduce((o,a)=>Math.max(o,a[s]+a.radius),Number.NEGATIVE_INFINITY),i=t.reduce((o,a)=>Math.min(o,a[s]-a.radius),Number.POSITIVE_INFINITY);return{max:e,min:i}};return{xRange:n("x"),yRange:n("y")}}function Ct(t,n,s){n==null&&(n=Math.PI/2);let e=Ft(t).map(u=>Object.assign({},u));const i=me(e);for(const u of i){pe(u,n,s);const r=dt(u);u.size=(r.xRange.max-r.xRange.min)*(r.yRange.max-r.yRange.min),u.bounds=r}i.sort((u,r)=>r.size-u.size),e=i[0];let o=e.bounds;const a=(o.xRange.max-o.xRange.min)/50;function c(u,r,y){if(!u)return;const d=u.bounds;let b,x;if(r)b=o.xRange.max-d.xRange.min+a;else{b=o.xRange.max-d.xRange.max;const M=(d.xRange.max-d.xRange.min)/2-(o.xRange.max-o.xRange.min)/2;M<0&&(b+=M)}if(y)x=o.yRange.max-d.yRange.min+a;else{x=o.yRange.max-d.yRange.max;const M=(d.yRange.max-d.yRange.min)/2-(o.yRange.max-o.yRange.min)/2;M<0&&(x+=M)}for(const M of u)M.x+=b,M.y+=x,e.push(M)}let h=1;for(;h<i.length;)c(i[h],!0,!1),c(i[h+1],!1,!0),c(i[h+2],!0,!0),h+=3,o=dt(e);return Ot(e)}function Nt(t,n,s,e,i){const o=Ft(t);n-=2*e,s-=2*e;const{xRange:a,yRange:c}=dt(o);if(a.max===a.min||c.max===c.min)return console.log("not scaling solution: zero size detected"),t;let h,u;if(i){const b=Math.sqrt(i/Math.PI)*2;h=n/b,u=s/b}else h=n/(a.max-a.min),u=s/(c.max-c.min);const r=Math.min(u,h),y=(n-(a.max-a.min)*r)/2,d=(s-(c.max-c.min)*r)/2;return Ot(o.map(b=>({radius:r*b.radius,x:e+y+(b.x-a.min)*r,y:e+d+(b.y-c.min)*r,setid:b.setid})))}function Ot(t){const n={};for(const s of t)n[s.setid]=s;return n}function Ft(t){return Object.keys(t).map(s=>Object.assign(t[s],{setid:s}))}function be(t={}){let n=!1,s=600,e=350,i=15,o=1e3,a=Math.PI/2,c=!0,h=null,u=!0,r=!0,y=null,d=null,b=!1,x=null,M=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,A={},T=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],S=0,g=function(p){if(p in A)return A[p];var f=A[p]=T[S];return S+=1,S>=T.length&&(S=0),f},m=At,v=tt;function l(p){let f=p.datum();const N=new Set;f.forEach(k=>{k.size==0&&k.sets.length==1&&N.add(k.sets[0])}),f=f.filter(k=>!k.sets.some(F=>N.has(F)));let I={},D={};if(f.length>0){let k=m(f,{lossFunction:v,distinct:b});c&&(k=Ct(k,a,d)),I=Nt(k,s,e,i,h),D=jt(I,f,M)}const U={};f.forEach(k=>{k.label&&(U[k.sets]=k.label)});function j(k){if(k.sets in U)return U[k.sets];if(k.sets.length==1)return""+k.sets[0]}p.selectAll("svg").data([I]).enter().append("svg");const E=p.select("svg");n?E.attr("viewBox",`0 0 ${s} ${e}`):E.attr("width",s).attr("height",e);const R={};let _=!1;E.selectAll(".venn-area path").each(function(k){const F=this.getAttribute("d");k.sets.length==1&&F&&!b&&(_=!0,R[k.sets[0]]=ke(F))});function P(k){return F=>{const H=k.sets.map(et=>{let Y=R[et],Z=I[et];return Y||(Y={x:s/2,y:e/2,radius:1}),Z||(Z={x:s/2,y:e/2,radius:1}),{x:Y.x*(1-F)+Z.x*F,y:Y.y*(1-F)+Z.y*F,radius:Y.radius*(1-F)+Z.radius*F}});return St(H,x)}}const V=E.selectAll(".venn-area").data(f,k=>k.sets),O=V.enter().append("g").attr("class",k=>`venn-area venn-${k.sets.length==1?"circle":"intersection"}${k.colour||k.color?" venn-coloured":""}`).attr("data-venn-sets",k=>k.sets.join("_")),B=O.append("path"),W=O.append("text").attr("class","label").text(k=>j(k)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);r&&(B.style("fill-opacity","0").filter(k=>k.sets.length==1).style("fill",k=>k.colour?k.colour:k.color?k.color:g(k.sets)).style("fill-opacity",".25"),W.style("fill",k=>k.colour||k.color?"#FFF":t.textFill?t.textFill:k.sets.length==1?g(k.sets):"#444"));function K(k){return typeof k.transition=="function"?k.transition("venn").duration(o):k}let z=p;_&&typeof z.transition=="function"?(z=K(p),z.selectAll("path").attrTween("d",P)):z.selectAll("path").attr("d",k=>St(k.sets.map(F=>I[F])),x);const L=z.selectAll("text").filter(k=>k.sets in D).text(k=>j(k)).attr("x",k=>Math.floor(D[k.sets].x)).attr("y",k=>Math.floor(D[k.sets].y));u&&(_?"on"in L?L.on("end",rt(I,j)):L.each("end",rt(I,j)):L.each(rt(I,j)));const C=K(V.exit()).remove();typeof V.transition=="function"&&C.selectAll("path").attrTween("d",P);const X=C.selectAll("text").attr("x",s/2).attr("y",e/2);return y!==null&&(W.style("font-size","0px"),L.style("font-size",y),X.style("font-size","0px")),{circles:I,textCentres:D,nodes:V,enter:O,update:z,exit:C}}return l.wrap=function(p){return arguments.length?(u=p,l):u},l.useViewBox=function(){return n=!0,l},l.width=function(p){return arguments.length?(s=p,l):s},l.height=function(p){return arguments.length?(e=p,l):e},l.padding=function(p){return arguments.length?(i=p,l):i},l.distinct=function(p){return arguments.length?(b=p,l):b},l.colours=function(p){return arguments.length?(g=p,l):g},l.colors=function(p){return arguments.length?(g=p,l):g},l.fontSize=function(p){return arguments.length?(y=p,l):y},l.round=function(p){return arguments.length?(x=p,l):x},l.duration=function(p){return arguments.length?(o=p,l):o},l.layoutFunction=function(p){return arguments.length?(m=p,l):m},l.normalize=function(p){return arguments.length?(c=p,l):c},l.scaleToFit=function(p){return arguments.length?(h=p,l):h},l.styled=function(p){return arguments.length?(r=p,l):r},l.orientation=function(p){return arguments.length?(a=p,l):a},l.orientationOrder=function(p){return arguments.length?(d=p,l):d},l.lossFunction=function(p){return arguments.length?(v=p==="default"?tt:p==="logRatio"?Dt:p,l):v},l}function rt(t,n){return function(s){const e=this,i=t[s.sets[0]].radius||50,o=n(s)||"",a=o.split(/\s+/).reverse(),h=(o.length+a.length)/3;let u=a.pop(),r=[u],y=0;const d=1.1;e.textContent=null;const b=[];function x(g){const m=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return m.textContent=g,b.push(m),e.append(m),m}let M=x(u);for(;u=a.pop(),!!u;){r.push(u);const g=r.join(" ");M.textContent=g,g.length>h&&M.getComputedTextLength()>i&&(r.pop(),M.textContent=r.join(" "),r=[u],M=x(u),y++)}const A=.35-y*d/2,T=e.getAttribute("x"),S=e.getAttribute("y");b.forEach((g,m)=>{g.setAttribute("x",T),g.setAttribute("y",S),g.setAttribute("dy",`${A+m*d}em`)})}}function at(t,n,s){let e=n[0].radius-q(n[0],t);for(let i=1;i<n.length;++i){const o=n[i].radius-q(n[i],t);o<=e&&(e=o)}for(let i=0;i<s.length;++i){const o=q(s[i],t)-s[i].radius;o<=e&&(e=o)}return e}function Lt(t,n,s){const e=[];for(const r of t)e.push({x:r.x,y:r.y}),e.push({x:r.x+r.radius/2,y:r.y}),e.push({x:r.x-r.radius/2,y:r.y}),e.push({x:r.x,y:r.y+r.radius/2}),e.push({x:r.x,y:r.y-r.radius/2});let i=e[0],o=at(e[0],t,n);for(let r=1;r<e.length;++r){const y=at(e[r],t,n);y>=o&&(i=e[r],o=y)}const a=zt(r=>-1*at({x:r[0],y:r[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,c={x:s?0:a[0],y:a[1]};let h=!0;for(const r of t)if(q(c,r)>r.radius){h=!1;break}for(const r of n)if(q(c,r)<r.radius){h=!1;break}if(h)return c;if(t.length==1)return{x:t[0].x,y:t[0].y};const u={};return st(t,u),u.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:u.arcs.length==1?{x:u.arcs[0].circle.x,y:u.arcs[0].circle.y}:n.length?Lt(t,[]):Et(u.arcs.map(r=>r.p1))}function ve(t){const n={},s=Object.keys(t);for(const e of s)n[e]=[];for(let e=0;e<s.length;e++){const i=s[e],o=t[i];for(let a=e+1;a<s.length;++a){const c=s[a],h=t[c],u=q(o,h);u+h.radius<=o.radius+1e-10?n[c].push(i):u+o.radius<=h.radius+1e-10&&n[i].push(c)}}return n}function jt(t,n,s){const e={},i=ve(t);for(let o=0;o<n.length;++o){const a=n[o].sets,c={},h={};for(let d=0;d<a.length;++d){c[a[d]]=!0;const b=i[a[d]];for(let x=0;x<b.length;++x)h[b[x]]=!0}const u=[],r=[];for(let d in t)d in c?u.push(t[d]):d in h||r.push(t[d]);const y=Lt(u,r,s);e[a]=y,y.disjoint&&n[o].size>0&&console.log("WARNING: area "+a+" not represented on screen")}return e}function Ie(t,n,s){const e=[];return e.push(`
1
+ import{aU as Gt,s as Wt,g as Kt,q as Ht,p as Yt,a as Xt,b as Zt,_ as w,D as wt,I as Jt,d as ot,al as Qt,ac as $t,ad as te,ae as ee,e as ne,z as se,F as ie,G as oe}from"./index-B88xAivn.js";import"./index-Cz73HpYH.js";const kt=(t,n)=>Gt(t,"a",-n),_t=1e-10;function st(t,n){const s=ae(t),e=s.filter(c=>re(c,t));let i=0,o=0;const a=[];if(e.length>1){const c=Et(e);for(let u=0;u<e.length;++u){const r=e[u];r.angle=Math.atan2(r.x-c.x,r.y-c.y)}e.sort((u,r)=>r.angle-u.angle);let h=e[e.length-1];for(let u=0;u<e.length;++u){const r=e[u];o+=(h.x+r.x)*(r.y-h.y);const y={x:(r.x+h.x)/2,y:(r.y+h.y)/2};let d=null;for(let b=0;b<r.parentIndex.length;++b)if(h.parentIndex.includes(r.parentIndex[b])){const x=t[r.parentIndex[b]],M=Math.atan2(r.x-x.x,r.y-x.y),A=Math.atan2(h.x-x.x,h.y-x.y);let T=A-M;T<0&&(T+=2*Math.PI);const S=A-T/2;let g=q(y,{x:x.x+x.radius*Math.sin(S),y:x.y+x.radius*Math.cos(S)});g>x.radius*2&&(g=x.radius*2),(d==null||d.width>g)&&(d={circle:x,width:g,p1:r,p2:h,large:g>x.radius,sweep:!0})}d!=null&&(a.push(d),i+=lt(d.circle.radius,d.width),h=r)}}else{let c=t[0];for(let u=1;u<t.length;++u)t[u].radius<c.radius&&(c=t[u]);let h=!1;for(let u=0;u<t.length;++u)if(q(t[u],c)>Math.abs(c.radius-t[u].radius)){h=!0;break}h?i=o=0:(i=c.radius*c.radius*Math.PI,a.push({circle:c,p1:{x:c.x,y:c.y+c.radius},p2:{x:c.x-_t,y:c.y+c.radius},width:c.radius*2,large:!0,sweep:!0}))}return o/=2,n&&(n.area=i+o,n.arcArea=i,n.polygonArea=o,n.arcs=a,n.innerPoints=e,n.intersectionPoints=s),i+o}function re(t,n){return n.every(s=>q(t,s)<s.radius+_t)}function ae(t){const n=[];for(let s=0;s<t.length;++s)for(let e=s+1;e<t.length;++e){const i=Tt(t[s],t[e]);for(const o of i)o.parentIndex=[s,e],n.push(o)}return n}function lt(t,n){return t*t*Math.acos(1-n/t)-(t-n)*Math.sqrt(n*(2*t-n))}function q(t,n){return Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y))}function xt(t,n,s){if(s>=t+n)return 0;if(s<=Math.abs(t-n))return Math.PI*Math.min(t,n)*Math.min(t,n);const e=t-(s*s-n*n+t*t)/(2*s),i=n-(s*s-t*t+n*n)/(2*s);return lt(t,e)+lt(n,i)}function Tt(t,n){const s=q(t,n),e=t.radius,i=n.radius;if(s>=e+i||s<=Math.abs(e-i))return[];const o=(e*e-i*i+s*s)/(2*s),a=Math.sqrt(e*e-o*o),c=t.x+o*(n.x-t.x)/s,h=t.y+o*(n.y-t.y)/s,u=-(n.y-t.y)*(a/s),r=-(n.x-t.x)*(a/s);return[{x:c+u,y:h-r},{x:c-u,y:h+r}]}function Et(t){const n={x:0,y:0};for(const s of t)n.x+=s.x,n.y+=s.y;return n.x/=t.length,n.y/=t.length,n}function le(t,n,s,e){e=e||{};const i=e.maxIterations||100,o=e.tolerance||1e-10,a=t(n),c=t(s);let h=s-n;if(a*c>0)throw"Initial bisect points must have opposite signs";if(a===0)return n;if(c===0)return s;for(let u=0;u<i;++u){h/=2;const r=n+h,y=t(r);if(y*a>=0&&(n=r),Math.abs(h)<o||y===0)return r}return n+h}function ct(t){const n=new Array(t);for(let s=0;s<t;++s)n[s]=0;return n}function Mt(t,n){return ct(t).map(()=>ct(n))}function $(t,n){let s=0;for(let e=0;e<t.length;++e)s+=t[e]*n[e];return s}function ut(t){return Math.sqrt($(t,t))}function ft(t,n,s){for(let e=0;e<n.length;++e)t[e]=n[e]*s}function J(t,n,s,e,i){for(let o=0;o<t.length;++o)t[o]=n*s[o]+e*i[o]}function zt(t,n,s){s=s||{};const e=s.maxIterations||n.length*200,i=s.nonZeroDelta||1.05,o=s.zeroDelta||.001,a=s.minErrorDelta||1e-6,c=s.minErrorDelta||1e-5,h=s.rho!==void 0?s.rho:1,u=s.chi!==void 0?s.chi:2,r=s.psi!==void 0?s.psi:-.5,y=s.sigma!==void 0?s.sigma:.5;let d;const b=n.length,x=new Array(b+1);x[0]=n,x[0].fx=t(n),x[0].id=0;for(let v=0;v<b;++v){const l=n.slice();l[v]=l[v]?l[v]*i:o,x[v+1]=l,x[v+1].fx=t(l),x[v+1].id=v+1}function M(v){for(let l=0;l<v.length;l++)x[b][l]=v[l];x[b].fx=v.fx}const A=(v,l)=>v.fx-l.fx,T=n.slice(),S=n.slice(),g=n.slice(),m=n.slice();for(let v=0;v<e;++v){if(x.sort(A),s.history){const p=x.map(f=>{const N=f.slice();return N.fx=f.fx,N.id=f.id,N});p.sort((f,N)=>f.id-N.id),s.history.push({x:x[0].slice(),fx:x[0].fx,simplex:p})}d=0;for(let p=0;p<b;++p)d=Math.max(d,Math.abs(x[0][p]-x[1][p]));if(Math.abs(x[0].fx-x[b].fx)<a&&d<c)break;for(let p=0;p<b;++p){T[p]=0;for(let f=0;f<b;++f)T[p]+=x[f][p];T[p]/=b}const l=x[b];if(J(S,1+h,T,-h,l),S.fx=t(S),S.fx<x[0].fx)J(m,1+u,T,-u,l),m.fx=t(m),m.fx<S.fx?M(m):M(S);else if(S.fx>=x[b-1].fx){let p=!1;if(S.fx>l.fx?(J(g,1+r,T,-r,l),g.fx=t(g),g.fx<l.fx?M(g):p=!0):(J(g,1-r*h,T,r*h,l),g.fx=t(g),g.fx<S.fx?M(g):p=!0),p){if(y>=1)break;for(let f=1;f<x.length;++f)J(x[f],1-y,x[0],y,x[f]),x[f].fx=t(x[f])}}else M(S)}return x.sort(A),{fx:x[0].fx,x:x[0]}}function ce(t,n,s,e,i,o,a){const c=s.fx,h=$(s.fxprime,n);let u=c,r=c,y=h,d=0;i=i||1,o=o||1e-6,a=a||.1;function b(x,M,A){for(let T=0;T<16;++T)if(i=(x+M)/2,J(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=$(e.fxprime,n),u>c+o*i*h||u>=A)M=i;else{if(Math.abs(y)<=-a*h)return i;y*(M-x)>=0&&(M=x),x=i,A=u}return 0}for(let x=0;x<10;++x){if(J(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=$(e.fxprime,n),u>c+o*i*h||x&&u>=r)return b(d,i,r);if(Math.abs(y)<=-a*h)return i;if(y>=0)return b(i,d,u);r=u,d=i,i*=2}return i}function ue(t,n,s){let e={x:n.slice(),fx:0,fxprime:n.slice()},i={x:n.slice(),fx:0,fxprime:n.slice()};const o=n.slice();let a,c,h=1,u;s=s||{},u=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),a=e.fxprime.slice(),ft(a,e.fxprime,-1);for(let r=0;r<u;++r){if(h=ce(t,a,e,i,h),s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:h}),!h)ft(a,e.fxprime,-1);else{J(o,1,i.fxprime,-1,e.fxprime);const y=$(e.fxprime,e.fxprime),d=Math.max(0,$(o,i.fxprime)/y);J(a,d,a,-1,i.fxprime),c=e,e=i,i=c}if(ut(e.fxprime)<=1e-5)break}return s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:h}),e}function At(t,n={}){n.maxIterations=n.maxIterations||500;const s=n.initialLayout||ge,e=n.lossFunction||tt,i=fe(t,n),o=s(i,n),a=Object.keys(o),c=[];for(const r of a)c.push(o[r].x),c.push(o[r].y);const u=zt(r=>{const y={};for(let d=0;d<a.length;++d){const b=a[d];y[b]={x:r[2*d],y:r[2*d+1],radius:o[b].radius}}return e(y,i)},c,n).x;for(let r=0;r<a.length;++r){const y=a[r];o[y].x=u[2*r],o[y].y=u[2*r+1]}return o}const Rt=1e-10;function ht(t,n,s){return Math.min(t,n)*Math.min(t,n)*Math.PI<=s+Rt?Math.abs(t-n):le(e=>xt(t,n,e)-s,0,t+n)}function fe(t,n={}){const s=n.distinct,e=t.map(c=>Object.assign({},c));function i(c){return c.join(";")}if(s){const c=new Map;for(const h of e)for(let u=0;u<h.sets.length;u++){const r=String(h.sets[u]);c.set(r,h.size+(c.get(r)||0));for(let y=u+1;y<h.sets.length;y++){const d=String(h.sets[y]),b=`${r};${d}`,x=`${d};${r}`;c.set(b,h.size+(c.get(b)||0)),c.set(x,h.size+(c.get(x)||0))}}for(const h of e)h.sets.length<3&&(h.size=c.get(i(h.sets)))}const o=[],a=new Set;for(const c of e)if(c.sets.length===1)o.push(c.sets[0]);else if(c.sets.length===2){const h=c.sets[0],u=c.sets[1];a.add(i(c.sets)),a.add(i([u,h]))}o.sort((c,h)=>c===h?0:c<h?-1:1);for(let c=0;c<o.length;++c){const h=o[c];for(let u=c+1;u<o.length;++u){const r=o[u];a.has(i([h,r]))||e.push({sets:[h,r],size:0})}}return e}function he(t,n,s){const e=Mt(n.length,n.length),i=Mt(n.length,n.length);return t.filter(o=>o.sets.length===2).forEach(o=>{const a=s[o.sets[0]],c=s[o.sets[1]],h=Math.sqrt(n[a].size/Math.PI),u=Math.sqrt(n[c].size/Math.PI),r=ht(h,u,o.size);e[a][c]=e[c][a]=r;let y=0;o.size+1e-10>=Math.min(n[a].size,n[c].size)?y=1:o.size<=1e-10&&(y=-1),i[a][c]=i[c][a]=y}),{distances:e,constraints:i}}function de(t,n,s,e){for(let o=0;o<n.length;++o)n[o]=0;let i=0;for(let o=0;o<s.length;++o){const a=t[2*o],c=t[2*o+1];for(let h=o+1;h<s.length;++h){const u=t[2*h],r=t[2*h+1],y=s[o][h],d=e[o][h],b=(u-a)*(u-a)+(r-c)*(r-c),x=Math.sqrt(b),M=b-y*y;d>0&&x<=y||d<0&&x>=y||(i+=2*M*M,n[2*o]+=4*M*(a-u),n[2*o+1]+=4*M*(c-r),n[2*h]+=4*M*(u-a),n[2*h+1]+=4*M*(r-c))}}return i}function ge(t,n={}){let s=ye(t,n);const e=n.lossFunction||tt;if(t.length>=8){const i=xe(t,n),o=e(i,t),a=e(s,t);o+1e-8<a&&(s=i)}return s}function xe(t,n={}){const s=n.restarts||10,e=[],i={};for(const d of t)d.sets.length===1&&(i[d.sets[0]]=e.length,e.push(d));let{distances:o,constraints:a}=he(t,e,i);const c=ut(o.map(ut))/o.length;o=o.map(d=>d.map(b=>b/c));const h=(d,b)=>de(d,b,o,a);let u=null;for(let d=0;d<s;++d){const b=ct(o.length*2).map(Math.random),x=ue(h,b,n);(!u||x.fx<u.fx)&&(u=x)}const r=u.x,y={};for(let d=0;d<e.length;++d){const b=e[d];y[b.sets[0]]={x:r[2*d]*c,y:r[2*d+1]*c,radius:Math.sqrt(b.size/Math.PI)}}if(n.history)for(const d of n.history)ft(d.x,c);return y}function ye(t,n){const s=n&&n.lossFunction?n.lossFunction:tt,e={},i={};for(const y of t)if(y.sets.length===1){const d=y.sets[0];e[d]={x:1e10,y:1e10,rowid:e.length,size:y.size,radius:Math.sqrt(y.size/Math.PI)},i[d]=[]}t=t.filter(y=>y.sets.length===2);for(const y of t){let d=y.weight!=null?y.weight:1;const b=y.sets[0],x=y.sets[1];y.size+Rt>=Math.min(e[b].size,e[x].size)&&(d=0),i[b].push({set:x,size:y.size,weight:d}),i[x].push({set:b,size:y.size,weight:d})}const o=[];Object.keys(i).forEach(y=>{let d=0;for(let b=0;b<i[y].length;++b)d+=i[y][b].size*i[y][b].weight;o.push({set:y,size:d})});function a(y,d){return d.size-y.size}o.sort(a);const c={};function h(y){return y.set in c}function u(y,d){e[d].x=y.x,e[d].y=y.y,c[d]=!0}u({x:0,y:0},o[0].set);for(let y=1;y<o.length;++y){const d=o[y].set,b=i[d].filter(h),x=e[d];if(b.sort(a),b.length===0)throw"ERROR: missing pairwise overlap information";const M=[];for(var r=0;r<b.length;++r){const S=e[b[r].set],g=ht(x.radius,S.radius,b[r].size);M.push({x:S.x+g,y:S.y}),M.push({x:S.x-g,y:S.y}),M.push({y:S.y+g,x:S.x}),M.push({y:S.y-g,x:S.x});for(let m=r+1;m<b.length;++m){const v=e[b[m].set],l=ht(x.radius,v.radius,b[m].size),p=Tt({x:S.x,y:S.y,radius:g},{x:v.x,y:v.y,radius:l});M.push(...p)}}let A=1e50,T=M[0];for(const S of M){e[d].x=S.x,e[d].y=S.y;const g=s(e,t);g<A&&(A=g,T=S)}u(T,d)}return e}function tt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const a=t[e.sets[0]],c=t[e.sets[1]];i=xt(a.radius,c.radius,q(a,c))}else i=st(e.sets.map(a=>t[a]));const o=e.weight!=null?e.weight:1;s+=o*(i-e.size)*(i-e.size)}return s}function Dt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const c=t[e.sets[0]],h=t[e.sets[1]];i=xt(c.radius,h.radius,q(c,h))}else i=st(e.sets.map(c=>t[c]));const o=e.weight!=null?e.weight:1,a=Math.log((i+1)/(e.size+1));s+=o*a*a}return s}function pe(t,n,s){if(s==null?t.sort((i,o)=>o.radius-i.radius):t.sort(s),t.length>0){const i=t[0].x,o=t[0].y;for(const a of t)a.x-=i,a.y-=o}if(t.length===2&&q(t[0],t[1])<Math.abs(t[1].radius-t[0].radius)&&(t[1].x=t[0].x+t[0].radius-t[1].radius-1e-10,t[1].y=t[0].y),t.length>1){const i=Math.atan2(t[1].x,t[1].y)-n,o=Math.cos(i),a=Math.sin(i);for(const c of t){const h=c.x,u=c.y;c.x=o*h-a*u,c.y=a*h+o*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-n;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const o=t[1].y/(1e-10+t[1].x);for(const a of t){var e=(a.x+o*a.y)/(1+o*o);a.x=2*e-a.x,a.y=2*e*o-a.y}}}}function me(t){t.forEach(i=>{i.parent=i});function n(i){return i.parent!==i&&(i.parent=n(i.parent)),i.parent}function s(i,o){const a=n(i),c=n(o);a.parent=c}for(let i=0;i<t.length;++i)for(let o=i+1;o<t.length;++o){const a=t[i].radius+t[o].radius;q(t[i],t[o])+1e-10<a&&s(t[o],t[i])}const e=new Map;for(let i=0;i<t.length;++i){const o=n(t[i]).parent.setid;e.has(o)||e.set(o,[]),e.get(o).push(t[i])}return t.forEach(i=>{delete i.parent}),Array.from(e.values())}function dt(t){const n=s=>{const e=t.reduce((o,a)=>Math.max(o,a[s]+a.radius),Number.NEGATIVE_INFINITY),i=t.reduce((o,a)=>Math.min(o,a[s]-a.radius),Number.POSITIVE_INFINITY);return{max:e,min:i}};return{xRange:n("x"),yRange:n("y")}}function Ct(t,n,s){n==null&&(n=Math.PI/2);let e=Ft(t).map(u=>Object.assign({},u));const i=me(e);for(const u of i){pe(u,n,s);const r=dt(u);u.size=(r.xRange.max-r.xRange.min)*(r.yRange.max-r.yRange.min),u.bounds=r}i.sort((u,r)=>r.size-u.size),e=i[0];let o=e.bounds;const a=(o.xRange.max-o.xRange.min)/50;function c(u,r,y){if(!u)return;const d=u.bounds;let b,x;if(r)b=o.xRange.max-d.xRange.min+a;else{b=o.xRange.max-d.xRange.max;const M=(d.xRange.max-d.xRange.min)/2-(o.xRange.max-o.xRange.min)/2;M<0&&(b+=M)}if(y)x=o.yRange.max-d.yRange.min+a;else{x=o.yRange.max-d.yRange.max;const M=(d.yRange.max-d.yRange.min)/2-(o.yRange.max-o.yRange.min)/2;M<0&&(x+=M)}for(const M of u)M.x+=b,M.y+=x,e.push(M)}let h=1;for(;h<i.length;)c(i[h],!0,!1),c(i[h+1],!1,!0),c(i[h+2],!0,!0),h+=3,o=dt(e);return Ot(e)}function Nt(t,n,s,e,i){const o=Ft(t);n-=2*e,s-=2*e;const{xRange:a,yRange:c}=dt(o);if(a.max===a.min||c.max===c.min)return console.log("not scaling solution: zero size detected"),t;let h,u;if(i){const b=Math.sqrt(i/Math.PI)*2;h=n/b,u=s/b}else h=n/(a.max-a.min),u=s/(c.max-c.min);const r=Math.min(u,h),y=(n-(a.max-a.min)*r)/2,d=(s-(c.max-c.min)*r)/2;return Ot(o.map(b=>({radius:r*b.radius,x:e+y+(b.x-a.min)*r,y:e+d+(b.y-c.min)*r,setid:b.setid})))}function Ot(t){const n={};for(const s of t)n[s.setid]=s;return n}function Ft(t){return Object.keys(t).map(s=>Object.assign(t[s],{setid:s}))}function be(t={}){let n=!1,s=600,e=350,i=15,o=1e3,a=Math.PI/2,c=!0,h=null,u=!0,r=!0,y=null,d=null,b=!1,x=null,M=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,A={},T=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],S=0,g=function(p){if(p in A)return A[p];var f=A[p]=T[S];return S+=1,S>=T.length&&(S=0),f},m=At,v=tt;function l(p){let f=p.datum();const N=new Set;f.forEach(k=>{k.size==0&&k.sets.length==1&&N.add(k.sets[0])}),f=f.filter(k=>!k.sets.some(F=>N.has(F)));let I={},D={};if(f.length>0){let k=m(f,{lossFunction:v,distinct:b});c&&(k=Ct(k,a,d)),I=Nt(k,s,e,i,h),D=jt(I,f,M)}const U={};f.forEach(k=>{k.label&&(U[k.sets]=k.label)});function j(k){if(k.sets in U)return U[k.sets];if(k.sets.length==1)return""+k.sets[0]}p.selectAll("svg").data([I]).enter().append("svg");const E=p.select("svg");n?E.attr("viewBox",`0 0 ${s} ${e}`):E.attr("width",s).attr("height",e);const R={};let _=!1;E.selectAll(".venn-area path").each(function(k){const F=this.getAttribute("d");k.sets.length==1&&F&&!b&&(_=!0,R[k.sets[0]]=ke(F))});function P(k){return F=>{const H=k.sets.map(et=>{let Y=R[et],Z=I[et];return Y||(Y={x:s/2,y:e/2,radius:1}),Z||(Z={x:s/2,y:e/2,radius:1}),{x:Y.x*(1-F)+Z.x*F,y:Y.y*(1-F)+Z.y*F,radius:Y.radius*(1-F)+Z.radius*F}});return St(H,x)}}const V=E.selectAll(".venn-area").data(f,k=>k.sets),O=V.enter().append("g").attr("class",k=>`venn-area venn-${k.sets.length==1?"circle":"intersection"}${k.colour||k.color?" venn-coloured":""}`).attr("data-venn-sets",k=>k.sets.join("_")),B=O.append("path"),W=O.append("text").attr("class","label").text(k=>j(k)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);r&&(B.style("fill-opacity","0").filter(k=>k.sets.length==1).style("fill",k=>k.colour?k.colour:k.color?k.color:g(k.sets)).style("fill-opacity",".25"),W.style("fill",k=>k.colour||k.color?"#FFF":t.textFill?t.textFill:k.sets.length==1?g(k.sets):"#444"));function K(k){return typeof k.transition=="function"?k.transition("venn").duration(o):k}let z=p;_&&typeof z.transition=="function"?(z=K(p),z.selectAll("path").attrTween("d",P)):z.selectAll("path").attr("d",k=>St(k.sets.map(F=>I[F])),x);const L=z.selectAll("text").filter(k=>k.sets in D).text(k=>j(k)).attr("x",k=>Math.floor(D[k.sets].x)).attr("y",k=>Math.floor(D[k.sets].y));u&&(_?"on"in L?L.on("end",rt(I,j)):L.each("end",rt(I,j)):L.each(rt(I,j)));const C=K(V.exit()).remove();typeof V.transition=="function"&&C.selectAll("path").attrTween("d",P);const X=C.selectAll("text").attr("x",s/2).attr("y",e/2);return y!==null&&(W.style("font-size","0px"),L.style("font-size",y),X.style("font-size","0px")),{circles:I,textCentres:D,nodes:V,enter:O,update:z,exit:C}}return l.wrap=function(p){return arguments.length?(u=p,l):u},l.useViewBox=function(){return n=!0,l},l.width=function(p){return arguments.length?(s=p,l):s},l.height=function(p){return arguments.length?(e=p,l):e},l.padding=function(p){return arguments.length?(i=p,l):i},l.distinct=function(p){return arguments.length?(b=p,l):b},l.colours=function(p){return arguments.length?(g=p,l):g},l.colors=function(p){return arguments.length?(g=p,l):g},l.fontSize=function(p){return arguments.length?(y=p,l):y},l.round=function(p){return arguments.length?(x=p,l):x},l.duration=function(p){return arguments.length?(o=p,l):o},l.layoutFunction=function(p){return arguments.length?(m=p,l):m},l.normalize=function(p){return arguments.length?(c=p,l):c},l.scaleToFit=function(p){return arguments.length?(h=p,l):h},l.styled=function(p){return arguments.length?(r=p,l):r},l.orientation=function(p){return arguments.length?(a=p,l):a},l.orientationOrder=function(p){return arguments.length?(d=p,l):d},l.lossFunction=function(p){return arguments.length?(v=p==="default"?tt:p==="logRatio"?Dt:p,l):v},l}function rt(t,n){return function(s){const e=this,i=t[s.sets[0]].radius||50,o=n(s)||"",a=o.split(/\s+/).reverse(),h=(o.length+a.length)/3;let u=a.pop(),r=[u],y=0;const d=1.1;e.textContent=null;const b=[];function x(g){const m=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return m.textContent=g,b.push(m),e.append(m),m}let M=x(u);for(;u=a.pop(),!!u;){r.push(u);const g=r.join(" ");M.textContent=g,g.length>h&&M.getComputedTextLength()>i&&(r.pop(),M.textContent=r.join(" "),r=[u],M=x(u),y++)}const A=.35-y*d/2,T=e.getAttribute("x"),S=e.getAttribute("y");b.forEach((g,m)=>{g.setAttribute("x",T),g.setAttribute("y",S),g.setAttribute("dy",`${A+m*d}em`)})}}function at(t,n,s){let e=n[0].radius-q(n[0],t);for(let i=1;i<n.length;++i){const o=n[i].radius-q(n[i],t);o<=e&&(e=o)}for(let i=0;i<s.length;++i){const o=q(s[i],t)-s[i].radius;o<=e&&(e=o)}return e}function Lt(t,n,s){const e=[];for(const r of t)e.push({x:r.x,y:r.y}),e.push({x:r.x+r.radius/2,y:r.y}),e.push({x:r.x-r.radius/2,y:r.y}),e.push({x:r.x,y:r.y+r.radius/2}),e.push({x:r.x,y:r.y-r.radius/2});let i=e[0],o=at(e[0],t,n);for(let r=1;r<e.length;++r){const y=at(e[r],t,n);y>=o&&(i=e[r],o=y)}const a=zt(r=>-1*at({x:r[0],y:r[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,c={x:s?0:a[0],y:a[1]};let h=!0;for(const r of t)if(q(c,r)>r.radius){h=!1;break}for(const r of n)if(q(c,r)<r.radius){h=!1;break}if(h)return c;if(t.length==1)return{x:t[0].x,y:t[0].y};const u={};return st(t,u),u.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:u.arcs.length==1?{x:u.arcs[0].circle.x,y:u.arcs[0].circle.y}:n.length?Lt(t,[]):Et(u.arcs.map(r=>r.p1))}function ve(t){const n={},s=Object.keys(t);for(const e of s)n[e]=[];for(let e=0;e<s.length;e++){const i=s[e],o=t[i];for(let a=e+1;a<s.length;++a){const c=s[a],h=t[c],u=q(o,h);u+h.radius<=o.radius+1e-10?n[c].push(i):u+o.radius<=h.radius+1e-10&&n[i].push(c)}}return n}function jt(t,n,s){const e={},i=ve(t);for(let o=0;o<n.length;++o){const a=n[o].sets,c={},h={};for(let d=0;d<a.length;++d){c[a[d]]=!0;const b=i[a[d]];for(let x=0;x<b.length;++x)h[b[x]]=!0}const u=[],r=[];for(let d in t)d in c?u.push(t[d]):d in h||r.push(t[d]);const y=Lt(u,r,s);e[a]=y,y.disjoint&&n[o].size>0&&console.log("WARNING: area "+a+" not represented on screen")}return e}function Ie(t,n,s){const e=[];return e.push(`
2
2
  M`,t,n),e.push(`
3
3
  m`,-s,0),e.push(`
4
4
  a`,s,s,0,1,0,s*2,0),e.push(`