nextclaw 0.49.0 → 0.49.1

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 (473) hide show
  1. package/package.json +18 -18
  2. package/ui-dist/.vite/manifest.json +1298 -993
  3. package/ui-dist/.vite/manifest.json.gz +0 -0
  4. package/ui-dist/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  5. package/ui-dist/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  6. package/ui-dist/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  7. package/ui-dist/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  8. package/ui-dist/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  9. package/ui-dist/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  10. package/ui-dist/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  11. package/ui-dist/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  12. package/ui-dist/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  13. package/ui-dist/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  14. package/ui-dist/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  15. package/ui-dist/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  16. package/ui-dist/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  17. package/ui-dist/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  18. package/ui-dist/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  19. package/ui-dist/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  20. package/ui-dist/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  21. package/ui-dist/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  22. package/ui-dist/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  23. package/ui-dist/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  24. package/ui-dist/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  25. package/ui-dist/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  26. package/ui-dist/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  27. package/ui-dist/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  28. package/ui-dist/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  29. package/ui-dist/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  30. package/ui-dist/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  31. package/ui-dist/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  32. package/ui-dist/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  33. package/ui-dist/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  34. package/ui-dist/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  35. package/ui-dist/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  36. package/ui-dist/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  37. package/ui-dist/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  38. package/ui-dist/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  39. package/ui-dist/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  40. package/ui-dist/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  41. package/ui-dist/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  42. package/ui-dist/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  43. package/ui-dist/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  44. package/ui-dist/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  45. package/ui-dist/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  46. package/ui-dist/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  47. package/ui-dist/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  48. package/ui-dist/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  49. package/ui-dist/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  50. package/ui-dist/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  51. package/ui-dist/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  52. package/ui-dist/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  53. package/ui-dist/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  54. package/ui-dist/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  55. package/ui-dist/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  56. package/ui-dist/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  57. package/ui-dist/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  58. package/ui-dist/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  59. package/ui-dist/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  60. package/ui-dist/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  61. package/ui-dist/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  62. package/ui-dist/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  63. package/ui-dist/assets/{abnfDiagram-VRR7QNED-Kzlh3ZEC.js → abnfDiagram-VRR7QNED-DX_u5BBX.js} +1 -1
  64. package/ui-dist/assets/abnfDiagram-VRR7QNED-DX_u5BBX.js.gz +0 -0
  65. package/ui-dist/assets/{account-panel-UvHFa8Kl.js → account-panel-QhOMbAQP.js} +1 -1
  66. package/ui-dist/assets/account-panel-QhOMbAQP.js.gz +0 -0
  67. package/ui-dist/assets/{aiden0z-pptx-renderer.es-k1xZLzeo.js → aiden0z-pptx-renderer.es-C-E9e5yB.js} +1 -1
  68. package/ui-dist/assets/aiden0z-pptx-renderer.es-C-E9e5yB.js.gz +0 -0
  69. package/ui-dist/assets/{api-Dffeij78.js → api-BWFOIoUm.js} +1 -1
  70. package/ui-dist/assets/api-BWFOIoUm.js.gz +0 -0
  71. package/ui-dist/assets/{app-data-DzaIMy4D.js → app-data-BnrEdmg2.js} +1 -1
  72. package/ui-dist/assets/app-data-BnrEdmg2.js.gz +0 -0
  73. package/ui-dist/assets/app-presenter-provider-CDRBc_lQ.js +115 -0
  74. package/ui-dist/assets/app-presenter-provider-CDRBc_lQ.js.gz +0 -0
  75. package/ui-dist/assets/app-presenter-provider-jNGlmBLe.css +1 -0
  76. package/ui-dist/assets/app-presenter-provider-jNGlmBLe.css.gz +0 -0
  77. package/ui-dist/assets/{appearance-settings-page-D8cWniw-.js → appearance-settings-page-C5z5sOkC.js} +1 -1
  78. package/ui-dist/assets/appearance-settings-page-C5z5sOkC.js.gz +0 -0
  79. package/ui-dist/assets/{arc-CpivM836.js → arc-Cxwa624o.js} +1 -1
  80. package/ui-dist/assets/arc-Cxwa624o.js.gz +0 -0
  81. package/ui-dist/assets/architecture-TIHT7OUA-DEt0Abz9.js +1 -0
  82. package/ui-dist/assets/{architectureDiagram-ZJ3FMSHR-ifjW1qjI.js → architectureDiagram-ZJ3FMSHR-D8mCj0H1.js} +1 -1
  83. package/ui-dist/assets/architectureDiagram-ZJ3FMSHR-D8mCj0H1.js.gz +0 -0
  84. package/ui-dist/assets/{blockDiagram-677ZJIJ3-C_zeJrKF.js → blockDiagram-677ZJIJ3-CbGC1IHl.js} +1 -1
  85. package/ui-dist/assets/{blockDiagram-677ZJIJ3-C_zeJrKF.js.gz → blockDiagram-677ZJIJ3-CbGC1IHl.js.gz} +0 -0
  86. package/ui-dist/assets/{c4Diagram-LMCZKHZV-CpapRftp.js → c4Diagram-LMCZKHZV-BQhGC1Vc.js} +1 -1
  87. package/ui-dist/assets/c4Diagram-LMCZKHZV-BQhGC1Vc.js.gz +0 -0
  88. package/ui-dist/assets/channel-CxQkbwRD.js +1 -0
  89. package/ui-dist/assets/{channels-list-page-B_fYP1Pn.js → channels-list-page-CzXYZZtK.js} +1 -1
  90. package/ui-dist/assets/channels-list-page-CzXYZZtK.js.gz +0 -0
  91. package/ui-dist/assets/chunk-2Q5K7J3B-ClVhziok.js +1 -0
  92. package/ui-dist/assets/{chunk-32BRIVSS-BKBwdmKR.js → chunk-32BRIVSS-B74ZZwYG.js} +1 -1
  93. package/ui-dist/assets/chunk-32BRIVSS-B74ZZwYG.js.gz +0 -0
  94. package/ui-dist/assets/{chunk-52WLFC77-BgZRCpDx.js → chunk-52WLFC77-BvmxW_f_.js} +1 -1
  95. package/ui-dist/assets/chunk-52WLFC77-BvmxW_f_.js.gz +0 -0
  96. package/ui-dist/assets/{chunk-5FCAYU7R-YWfOINJi.js → chunk-5FCAYU7R-DQvBRnwL.js} +1 -1
  97. package/ui-dist/assets/{chunk-5HE753X5-BZ6I07d2.js → chunk-5HE753X5-CDIH0_y3.js} +1 -1
  98. package/ui-dist/assets/{chunk-5JV3BV7I-B7QYgZU5.js → chunk-5JV3BV7I-CcevlKd-.js} +1 -1
  99. package/ui-dist/assets/chunk-5JV3BV7I-CcevlKd-.js.gz +0 -0
  100. package/ui-dist/assets/{chunk-5TONJI2A-DjyQwgL2.js → chunk-5TONJI2A-_3dxVdnY.js} +1 -1
  101. package/ui-dist/assets/chunk-5TONJI2A-_3dxVdnY.js.gz +0 -0
  102. package/ui-dist/assets/{chunk-5VM5RSS4-DheHV7X2.js → chunk-5VM5RSS4-pGO5vvo-.js} +1 -1
  103. package/ui-dist/assets/{chunk-7BUUIJ7U-D6bq2PKF.js → chunk-7BUUIJ7U-DEKF5uAN.js} +1 -1
  104. package/ui-dist/assets/chunk-7BUUIJ7U-DEKF5uAN.js.gz +0 -0
  105. package/ui-dist/assets/{chunk-BIQX33UG-CL9x0ibm.js → chunk-BIQX33UG-CjBFgq2r.js} +1 -1
  106. package/ui-dist/assets/{chunk-C7G6YPKG-8z3B6RUH.js → chunk-C7G6YPKG-e_K9OGTz.js} +1 -1
  107. package/ui-dist/assets/chunk-C7G6YPKG-e_K9OGTz.js.gz +0 -0
  108. package/ui-dist/assets/{chunk-CQNSW5MT-DpHkxY3n.js → chunk-CQNSW5MT-C2IiHyHz.js} +1 -1
  109. package/ui-dist/assets/{chunk-CYSBUYHQ-DIJDLsdJ.js → chunk-CYSBUYHQ-DCC6KmGp.js} +1 -1
  110. package/ui-dist/assets/{chunk-EMLP6XTP-B-LjAyVd.js → chunk-EMLP6XTP-BYGgekQ0.js} +1 -1
  111. package/ui-dist/assets/{chunk-EX3LRPZG-BChuEPvO.js → chunk-EX3LRPZG-FGcwuVsA.js} +1 -1
  112. package/ui-dist/assets/chunk-EX3LRPZG-FGcwuVsA.js.gz +0 -0
  113. package/ui-dist/assets/{chunk-FWX5IMBZ-fBFt0u3f.js → chunk-FWX5IMBZ-CV3Ih_Os.js} +2 -2
  114. package/ui-dist/assets/chunk-FWX5IMBZ-CV3Ih_Os.js.gz +0 -0
  115. package/ui-dist/assets/{chunk-HOUHSVGY-MD0SpW5A.js → chunk-HOUHSVGY-CXpq_hfV.js} +1 -1
  116. package/ui-dist/assets/chunk-HOUHSVGY-CXpq_hfV.js.gz +0 -0
  117. package/ui-dist/assets/{chunk-ICXQ74PX-DvCcw_hz.js → chunk-ICXQ74PX-CZIpjupq.js} +1 -1
  118. package/ui-dist/assets/chunk-ICXQ74PX-CZIpjupq.js.gz +0 -0
  119. package/ui-dist/assets/{chunk-JG7HCLWE-B8zqBnU9.js → chunk-JG7HCLWE-CdgwBpW7.js} +1 -1
  120. package/ui-dist/assets/chunk-JG7HCLWE-CdgwBpW7.js.gz +0 -0
  121. package/ui-dist/assets/{chunk-JWPE2WC7-C9efnkGb.js → chunk-JWPE2WC7-BPjAZpOQ.js} +1 -1
  122. package/ui-dist/assets/{chunk-MOJQB5TN-gXbfqoqq.js → chunk-MOJQB5TN-DbJDm8to.js} +1 -1
  123. package/ui-dist/assets/chunk-MOJQB5TN-DbJDm8to.js.gz +0 -0
  124. package/ui-dist/assets/{chunk-MOZMSUNE-twIwdkqC.js → chunk-MOZMSUNE-BUa1fqKn.js} +1 -1
  125. package/ui-dist/assets/{chunk-OGEWGWER-DdR0_cWK.js → chunk-OGEWGWER-CtnzLgRu.js} +1 -1
  126. package/ui-dist/assets/{chunk-OSBZ3O6U-D7D58Foa.js → chunk-OSBZ3O6U-fUgdpTUM.js} +1 -1
  127. package/ui-dist/assets/{chunk-PUDLZKDR-DPILgOVY.js → chunk-PUDLZKDR-CtDWZT9-.js} +1 -1
  128. package/ui-dist/assets/chunk-PUDLZKDR-CtDWZT9-.js.gz +0 -0
  129. package/ui-dist/assets/{chunk-Q4XR5HBZ-C0JJx7lW.js → chunk-Q4XR5HBZ-BxnK2qxr.js} +1 -1
  130. package/ui-dist/assets/chunk-Q4XR5HBZ-BxnK2qxr.js.gz +0 -0
  131. package/ui-dist/assets/{chunk-QBLGF6JB-Dbsf69ng.js → chunk-QBLGF6JB-CH4UKoCF.js} +1 -1
  132. package/ui-dist/assets/{chunk-R7FJI6CG-Bb8n616-.js → chunk-R7FJI6CG-BxwFoF1v.js} +1 -1
  133. package/ui-dist/assets/chunk-R7FJI6CG-BxwFoF1v.js.gz +0 -0
  134. package/ui-dist/assets/{chunk-RYQCIY6F-1HOsOrSl.js → chunk-RYQCIY6F-DpHAmq7O.js} +1 -1
  135. package/ui-dist/assets/chunk-RYQCIY6F-DpHAmq7O.js.gz +0 -0
  136. package/ui-dist/assets/{chunk-U6XO7XAA-BAFDVb1v.js → chunk-U6XO7XAA-BjH2VUHU.js} +1 -1
  137. package/ui-dist/assets/chunk-U6XO7XAA-BjH2VUHU.js.gz +0 -0
  138. package/ui-dist/assets/{chunk-V7JOEXUC-8-g68lu5.js → chunk-V7JOEXUC-DKJZ3HGj.js} +1 -1
  139. package/ui-dist/assets/chunk-V7JOEXUC-DKJZ3HGj.js.gz +0 -0
  140. package/ui-dist/assets/chunk-VAUOI2AC-DZQxkIsv.js +1 -0
  141. package/ui-dist/assets/{chunk-VR4S4FIN-P6UGmaYd.js → chunk-VR4S4FIN-Cf-o2GtI.js} +1 -1
  142. package/ui-dist/assets/{chunk-WYO6CB5R-6wjFTXNP.js → chunk-WYO6CB5R-zeNXGm20.js} +3 -2
  143. package/ui-dist/assets/chunk-WYO6CB5R-zeNXGm20.js.gz +0 -0
  144. package/ui-dist/assets/chunk-XXDRQBXY-BkExtw5C.js +1 -0
  145. package/ui-dist/assets/{chunk-YOTPTUD7-CLYXVZAi.js → chunk-YOTPTUD7-Ck87Kqxe.js} +1 -1
  146. package/ui-dist/assets/{chunk-ZGVPDNZ5-BRTmSAhp.js → chunk-ZGVPDNZ5-BbfK6Bfd.js} +1 -1
  147. package/ui-dist/assets/chunk-ZGVPDNZ5-BbfK6Bfd.js.gz +0 -0
  148. package/ui-dist/assets/{chunk-ZIRB5QZD-CH_1eoSV.js → chunk-ZIRB5QZD-BDpzh4Yl.js} +1 -1
  149. package/ui-dist/assets/chunk-ZIRB5QZD-BDpzh4Yl.js.gz +0 -0
  150. package/ui-dist/assets/classDiagram-OUVF2IWQ-Bd6apBb-.js +1 -0
  151. package/ui-dist/assets/classDiagram-v2-EOCWNBFH-CYxUZGCI.js +1 -0
  152. package/ui-dist/assets/{config-split-page-6hHiiapl.js → config-split-page-CxLWGwdt.js} +1 -1
  153. package/ui-dist/assets/config-split-page-CxLWGwdt.js.gz +0 -0
  154. package/ui-dist/assets/{confirm-dialog-ClT6iaj8.js → confirm-dialog-BWS7gA_z.js} +1 -1
  155. package/ui-dist/assets/confirm-dialog-BWS7gA_z.js.gz +0 -0
  156. package/ui-dist/assets/{cose-bilkent-JH36ORCC-L7w_qScX.js → cose-bilkent-JH36ORCC-CQfMxKCT.js} +1 -1
  157. package/ui-dist/assets/cose-bilkent-JH36ORCC-CQfMxKCT.js.gz +0 -0
  158. package/ui-dist/assets/cynefin-VYW2F7L2-CV0bFLH9.js +1 -0
  159. package/ui-dist/assets/{cynefinDiagram-TSTJHNR4-Bay7uDSR.js → cynefinDiagram-TSTJHNR4-CxFTiC-p.js} +1 -1
  160. package/ui-dist/assets/cynefinDiagram-TSTJHNR4-CxFTiC-p.js.gz +0 -0
  161. package/ui-dist/assets/{dagre-CJ_hX8xv.js → dagre-CaBNMcB1.js} +1 -1
  162. package/ui-dist/assets/dagre-CaBNMcB1.js.gz +0 -0
  163. package/ui-dist/assets/{dagre-VKFMJZFB-DDhk-2B3.js → dagre-VKFMJZFB-S_7Hc7bI.js} +1 -1
  164. package/ui-dist/assets/dagre-VKFMJZFB-S_7Hc7bI.js.gz +0 -0
  165. package/ui-dist/assets/{desktop-capabilities-page-CB5pniTx.js → desktop-capabilities-page-BJNGkq4q.js} +1 -1
  166. package/ui-dist/assets/desktop-capabilities-page-BJNGkq4q.js.gz +0 -0
  167. package/ui-dist/assets/{desktop-update-config-OuQV73gg.js → desktop-update-config-7tBum3MA.js} +1 -1
  168. package/ui-dist/assets/desktop-update-config-7tBum3MA.js.gz +0 -0
  169. package/ui-dist/assets/{diagram-FQU43EPY-somFq5y8.js → diagram-FQU43EPY-C7zENvFb.js} +1 -1
  170. package/ui-dist/assets/diagram-FQU43EPY-C7zENvFb.js.gz +0 -0
  171. package/ui-dist/assets/{diagram-G47NLZAW-hzgyQsPd.js → diagram-G47NLZAW-DqYTCqZA.js} +1 -1
  172. package/ui-dist/assets/diagram-G47NLZAW-DqYTCqZA.js.gz +0 -0
  173. package/ui-dist/assets/{diagram-NH7WQ7WH-BkJ4gEQJ.js → diagram-NH7WQ7WH-BfSJtXRc.js} +1 -1
  174. package/ui-dist/assets/diagram-NH7WQ7WH-BfSJtXRc.js.gz +0 -0
  175. package/ui-dist/assets/{diagram-OA4YK3LP-CS3ZkK4w.js → diagram-OA4YK3LP-CFO-j67H.js} +1 -1
  176. package/ui-dist/assets/diagram-OA4YK3LP-CFO-j67H.js.gz +0 -0
  177. package/ui-dist/assets/{diagram-WEI45ONY-BApo-JHS.js → diagram-WEI45ONY-DBQDbTaJ.js} +1 -1
  178. package/ui-dist/assets/diagram-WEI45ONY-DBQDbTaJ.js.gz +0 -0
  179. package/ui-dist/assets/{doc-browser-Cu58uiEg.js → doc-browser-BNiqa-zm.js} +1 -1
  180. package/ui-dist/assets/doc-browser-BNiqa-zm.js.gz +0 -0
  181. package/ui-dist/assets/doc-browser-DZDqghNc.js +1 -0
  182. package/ui-dist/assets/{doc-browser-context-CekJxJFm.js → doc-browser-context-Dp0dEMyT.js} +1 -1
  183. package/ui-dist/assets/doc-browser-context-Dp0dEMyT.js.gz +0 -0
  184. package/ui-dist/assets/{docx-preview-ByCKKIVT.js → docx-preview-B4-aDfvO.js} +1 -1
  185. package/ui-dist/assets/docx-preview-B4-aDfvO.js.gz +0 -0
  186. package/ui-dist/assets/{ebnfDiagram-CCIWWBDH-DWjfeEie.js → ebnfDiagram-CCIWWBDH-CfDNIXFN.js} +1 -1
  187. package/ui-dist/assets/ebnfDiagram-CCIWWBDH-CfDNIXFN.js.gz +0 -0
  188. package/ui-dist/assets/{erDiagram-Q63AITRT-DR7vWYHM.js → erDiagram-Q63AITRT-D95rFXMM.js} +1 -1
  189. package/ui-dist/assets/erDiagram-Q63AITRT-D95rFXMM.js.gz +0 -0
  190. package/ui-dist/assets/eventmodeling-45OFAUF4-BzkLWWdP.js +1 -0
  191. package/ui-dist/assets/{extensions-B5r-0jCq.js → extensions-WWEYpaUh.js} +1 -1
  192. package/ui-dist/assets/extensions-WWEYpaUh.js.gz +0 -0
  193. package/ui-dist/assets/flowDiagram-23GEKE2U-ukkCsB0j.js +1 -0
  194. package/ui-dist/assets/{ganttDiagram-NO4QXBWP-E3l9tuaL.js → ganttDiagram-NO4QXBWP-Bawg0P0r.js} +1 -1
  195. package/ui-dist/assets/ganttDiagram-NO4QXBWP-Bawg0P0r.js.gz +0 -0
  196. package/ui-dist/assets/gitGraph-TEB2WS4Q-BYFhT0Q5.js +1 -0
  197. package/ui-dist/assets/{gitGraphDiagram-IHSO6WYX-DiMvbHKf.js → gitGraphDiagram-IHSO6WYX-BbKh9nbL.js} +1 -1
  198. package/ui-dist/assets/gitGraphDiagram-IHSO6WYX-BbKh9nbL.js.gz +0 -0
  199. package/ui-dist/assets/{i18n-CPjq_hQX.js → i18n-ClHx6jwj.js} +2 -2
  200. package/ui-dist/assets/i18n-ClHx6jwj.js.gz +0 -0
  201. package/ui-dist/assets/{i18n-provider-BYO9AhFy.js → i18n-provider-C1NxogO4.js} +1 -1
  202. package/ui-dist/assets/info-DKCQHKI2-CTmlJdcH.js +1 -0
  203. package/ui-dist/assets/{infoDiagram-FWYZ7A6U-BZDL0NDJ.js → infoDiagram-FWYZ7A6U-DPffZXYh.js} +1 -1
  204. package/ui-dist/assets/{ishikawaDiagram-FXEZZL3T-BZ9WvJb2.js → ishikawaDiagram-FXEZZL3T-CBMsLwZ2.js} +1 -1
  205. package/ui-dist/assets/ishikawaDiagram-FXEZZL3T-CBMsLwZ2.js.gz +0 -0
  206. package/ui-dist/assets/{journeyDiagram-5HDEW3XC-C3TZvKM8.js → journeyDiagram-5HDEW3XC-Mz5U4OzU.js} +1 -1
  207. package/ui-dist/assets/journeyDiagram-5HDEW3XC-Mz5U4OzU.js.gz +0 -0
  208. package/ui-dist/assets/{kanban-definition-HUTT4EX6-9FqauDEi.js → kanban-definition-HUTT4EX6-FXZq2k19.js} +1 -1
  209. package/ui-dist/assets/kanban-definition-HUTT4EX6-FXZq2k19.js.gz +0 -0
  210. package/ui-dist/assets/{katex-J8JuvgNl.js → katex-B26hhTOT.js} +15 -15
  211. package/ui-dist/assets/katex-B26hhTOT.js.gz +0 -0
  212. package/ui-dist/assets/katex-DbZC06Q5.js +1 -0
  213. package/ui-dist/assets/{keyboard-shortcuts-settings-page-1efEkGwq.js → keyboard-shortcuts-settings-page-CS9BFOBW.js} +1 -1
  214. package/ui-dist/assets/{line-Ca49mj80.js → line-BZwCgT9K.js} +1 -1
  215. package/ui-dist/assets/{linear-DlCeG66S.js → linear-CTe9mKUw.js} +1 -1
  216. package/ui-dist/assets/linear-CTe9mKUw.js.gz +0 -0
  217. package/ui-dist/assets/{login-page-DBqkVTVD.js → login-page-CL0SrBCf.js} +1 -1
  218. package/ui-dist/assets/login-page-CL0SrBCf.js.gz +0 -0
  219. package/ui-dist/assets/login-page-Dq5nPUCU.js +1 -0
  220. package/ui-dist/assets/{main-CQ6GUYdX.js → main-CvVBCOlN.js} +2 -2
  221. package/ui-dist/assets/main-CvVBCOlN.js.gz +0 -0
  222. package/ui-dist/assets/{main-i18n-catalog.config-QB4DfJRJ.js → main-i18n-catalog.config-D4qFo4OB.js} +1 -1
  223. package/ui-dist/assets/main-i18n-catalog.config-D4qFo4OB.js.gz +0 -0
  224. package/ui-dist/assets/{map-WMnNq9UV.js → map-Ci48ZwAp.js} +1 -1
  225. package/ui-dist/assets/map-Ci48ZwAp.js.gz +0 -0
  226. package/ui-dist/assets/mcp-marketplace-page-CATnpZ2Q.js +1 -0
  227. package/ui-dist/assets/{mcp-marketplace-page-CWAxBNaS.js → mcp-marketplace-page-D75hPmzO.js} +1 -1
  228. package/ui-dist/assets/mcp-marketplace-page-D75hPmzO.js.gz +0 -0
  229. package/ui-dist/assets/{mermaid-parser.core-B8xk4hpS.js → mermaid-parser.core-CzPD3U_z.js} +2 -2
  230. package/ui-dist/assets/mermaid-parser.core-CzPD3U_z.js.gz +0 -0
  231. package/ui-dist/assets/{mermaid.core-CFPiczKH.js → mermaid.core-geIMNPbV.js} +3 -3
  232. package/ui-dist/assets/mermaid.core-geIMNPbV.js.gz +0 -0
  233. package/ui-dist/assets/{mindmap-definition-LN4V7U3C-CnxA52L6.js → mindmap-definition-LN4V7U3C-xqlKxsr_.js} +1 -1
  234. package/ui-dist/assets/mindmap-definition-LN4V7U3C-xqlKxsr_.js.gz +0 -0
  235. package/ui-dist/assets/{model-config-page-DBcuZyRC.js → model-config-page-DFfcV9lu.js} +1 -1
  236. package/ui-dist/assets/model-config-page-DFfcV9lu.js.gz +0 -0
  237. package/ui-dist/assets/{ordinal-PgiFlfBJ.js → ordinal-MxnX8yhv.js} +1 -1
  238. package/ui-dist/assets/ordinal-MxnX8yhv.js.gz +0 -0
  239. package/ui-dist/assets/packet-7NZHBO7P-BbrI0ZlN.js +1 -0
  240. package/ui-dist/assets/panel-app-i18n-catalog.config-oUwmxoE7.js +1 -0
  241. package/ui-dist/assets/{panelStandalone-BGA1s7JG.js → panelStandalone-D2CqTyi_.js} +2 -2
  242. package/ui-dist/assets/panelStandalone-D2CqTyi_.js.gz +0 -0
  243. package/ui-dist/assets/{pegDiagram-2B236MQR-A8oz7dTH.js → pegDiagram-2B236MQR-D50MFTN1.js} +1 -1
  244. package/ui-dist/assets/pegDiagram-2B236MQR-D50MFTN1.js.gz +0 -0
  245. package/ui-dist/assets/pie-RZYD4A2V-B7zE1ZIr.js +1 -0
  246. package/ui-dist/assets/{pieDiagram-ENE6RG2P-mtBnkYY0.js → pieDiagram-ENE6RG2P-CpA13oiC.js} +1 -1
  247. package/ui-dist/assets/pieDiagram-ENE6RG2P-CpA13oiC.js.gz +0 -0
  248. package/ui-dist/assets/{privacy-settings-page-DVC-aq1v.js → privacy-settings-page-CE-xF9bo.js} +1 -1
  249. package/ui-dist/assets/privacy-settings-page-CE-xF9bo.js.gz +0 -0
  250. package/ui-dist/assets/{projects-Cq0E3c7N.js → projects-BF0wpY4X.js} +1 -1
  251. package/ui-dist/assets/projects-BF0wpY4X.js.gz +0 -0
  252. package/ui-dist/assets/{provider-scoped-model-input-BGdZMWWa.js → provider-scoped-model-input-BvZitHkT.js} +1 -1
  253. package/ui-dist/assets/provider-scoped-model-input-BvZitHkT.js.gz +0 -0
  254. package/ui-dist/assets/{providers-config-page-B-IhHl6x.js → providers-config-page-cDeyluVG.js} +1 -1
  255. package/ui-dist/assets/providers-config-page-cDeyluVG.js.gz +0 -0
  256. package/ui-dist/assets/{pwa-C3kR9mdy.js → pwa-dXn0s_lD.js} +1 -1
  257. package/ui-dist/assets/pwa-dXn0s_lD.js.gz +0 -0
  258. package/ui-dist/assets/{quadrantDiagram-ABIIQ3AL-DE1VybGO.js → quadrantDiagram-ABIIQ3AL-CYCgaj4l.js} +1 -1
  259. package/ui-dist/assets/quadrantDiagram-ABIIQ3AL-CYCgaj4l.js.gz +0 -0
  260. package/ui-dist/assets/radar-I7S5WNFK-1X_q11Ed.js +1 -0
  261. package/ui-dist/assets/railroad-3IZDKUUU-CIXnuFyE.js +1 -0
  262. package/ui-dist/assets/railroad-abnf-AHOZXSZD-D6ImKl2r.js +1 -0
  263. package/ui-dist/assets/railroad-ebnf-EBAXGLYW-2j9d3twU.js +1 -0
  264. package/ui-dist/assets/railroad-peg-LSFZ7HO6-DMVaJGbm.js +1 -0
  265. package/ui-dist/assets/{railroadDiagram-RFXS5EU6-u9EMg14B.js → railroadDiagram-RFXS5EU6-4LKDGlXN.js} +1 -1
  266. package/ui-dist/assets/railroadDiagram-RFXS5EU6-4LKDGlXN.js.gz +0 -0
  267. package/ui-dist/assets/remote-CV5wQVVj.js +1 -0
  268. package/ui-dist/assets/{requirementDiagram-TGXJPOKE-BAWHAqEi.js → requirementDiagram-TGXJPOKE-CxNOU0JH.js} +1 -1
  269. package/ui-dist/assets/requirementDiagram-TGXJPOKE-CxNOU0JH.js.gz +0 -0
  270. package/ui-dist/assets/{runtime-config-page-LmrB2q65.js → runtime-config-page-DNo4dzS1.js} +1 -1
  271. package/ui-dist/assets/runtime-config-page-DNo4dzS1.js.gz +0 -0
  272. package/ui-dist/assets/{sankeyDiagram-HTMAVEWB-aDy-jdwF.js → sankeyDiagram-HTMAVEWB-DbCBDe2S.js} +1 -1
  273. package/ui-dist/assets/sankeyDiagram-HTMAVEWB-DbCBDe2S.js.gz +0 -0
  274. package/ui-dist/assets/{search-config-page-BIXmv5FY.js → search-config-page-CA0HxVy0.js} +1 -1
  275. package/ui-dist/assets/search-config-page-CA0HxVy0.js.gz +0 -0
  276. package/ui-dist/assets/{secrets-config-page-DU3fadrq.js → secrets-config-page-iT1wamQp.js} +1 -1
  277. package/ui-dist/assets/secrets-config-page-iT1wamQp.js.gz +0 -0
  278. package/ui-dist/assets/security-config-B38PLI3M.js +1 -0
  279. package/ui-dist/assets/{sequenceDiagram-DBY2YBRQ-DwHC4mbX.js → sequenceDiagram-DBY2YBRQ-DA6W2BS_.js} +1 -1
  280. package/ui-dist/assets/sequenceDiagram-DBY2YBRQ-DA6W2BS_.js.gz +0 -0
  281. package/ui-dist/assets/{service-apps-panel-Bshf3Wmq.js → service-apps-panel-CU0tFrqT.js} +1 -1
  282. package/ui-dist/assets/service-apps-panel-CU0tFrqT.js.gz +0 -0
  283. package/ui-dist/assets/{sizeCapture-X5ZJPWSS-oOMY0Fag.js → sizeCapture-X5ZJPWSS-T_q_d_VW.js} +1 -1
  284. package/ui-dist/assets/{src-CLPoo5iL.js → src-CYpUlx-4.js} +1 -1
  285. package/ui-dist/assets/{src-CLPoo5iL.js.gz → src-CYpUlx-4.js.gz} +0 -0
  286. package/ui-dist/assets/{stateDiagram-2N3HPSRC-B0Epk-VR.js → stateDiagram-2N3HPSRC-mi8z2G0a.js} +1 -1
  287. package/ui-dist/assets/stateDiagram-2N3HPSRC-mi8z2G0a.js.gz +0 -0
  288. package/ui-dist/assets/stateDiagram-v2-6OUMAXLB-OlIMT57r.js +1 -0
  289. package/ui-dist/assets/{swimlanes-5IMT3BWC-T0w-Iuzf.js → swimlanes-5IMT3BWC-DkBEhWE4.js} +2 -2
  290. package/ui-dist/assets/swimlanes-5IMT3BWC-DkBEhWE4.js.gz +0 -0
  291. package/ui-dist/assets/swimlanesDiagram-G3AALYLV-sLThrh07.js +8 -0
  292. package/ui-dist/assets/{tag-chip-gAH1IOsZ.js → tag-chip-CY0Hqk_l.js} +1 -1
  293. package/ui-dist/assets/{theme-provider-DE7m9jvf.js → theme-provider-BvpXGXWH.js} +1 -1
  294. package/ui-dist/assets/theme-provider-BvpXGXWH.js.gz +0 -0
  295. package/ui-dist/assets/{timeline-definition-FHXFAJF6-BEonB5Np.js → timeline-definition-FHXFAJF6-BoFmqBw1.js} +1 -1
  296. package/ui-dist/assets/timeline-definition-FHXFAJF6-BoFmqBw1.js.gz +0 -0
  297. package/ui-dist/assets/treeView-QDETBFTQ-CCFyazDE.js +1 -0
  298. package/ui-dist/assets/treemap-6X3UGDF4-D6wvq1Hz.js +1 -0
  299. package/ui-dist/assets/{use-config-Cyiw06-j.js → use-config-C8ZkQiTc.js} +1 -1
  300. package/ui-dist/assets/use-config-C8ZkQiTc.js.gz +0 -0
  301. package/ui-dist/assets/{use-desktop-capabilities-OKG96v4y.js → use-desktop-capabilities-DR9snbeo.js} +1 -1
  302. package/ui-dist/assets/use-desktop-capabilities-DR9snbeo.js.gz +0 -0
  303. package/ui-dist/assets/{vennDiagram-L72KCM5P-BDvcOCo2.js → vennDiagram-L72KCM5P-BlZ3Or5U.js} +1 -1
  304. package/ui-dist/assets/vennDiagram-L72KCM5P-BlZ3Or5U.js.gz +0 -0
  305. package/ui-dist/assets/wardley-OPB4EBWU-BRzaRyFf.js +1 -0
  306. package/ui-dist/assets/{wardleyDiagram-EHGQE667-jMLMgjzE.js → wardleyDiagram-EHGQE667-yDfr33i3.js} +1 -1
  307. package/ui-dist/assets/wardleyDiagram-EHGQE667-yDfr33i3.js.gz +0 -0
  308. package/ui-dist/assets/{xychartDiagram-FW5EYKEG-pzrpclEv.js → xychartDiagram-FW5EYKEG-mIXwIGAQ.js} +1 -1
  309. package/ui-dist/assets/xychartDiagram-FW5EYKEG-mIXwIGAQ.js.gz +0 -0
  310. package/ui-dist/index.html +23 -22
  311. package/ui-dist/index.html.gz +0 -0
  312. package/ui-dist/panel-standalone.html +6 -6
  313. package/ui-dist/panel-standalone.html.gz +0 -0
  314. package/ui-dist/assets/abnfDiagram-VRR7QNED-Kzlh3ZEC.js.gz +0 -0
  315. package/ui-dist/assets/account-panel-UvHFa8Kl.js.gz +0 -0
  316. package/ui-dist/assets/aiden0z-pptx-renderer.es-k1xZLzeo.js.gz +0 -0
  317. package/ui-dist/assets/api-Dffeij78.js.gz +0 -0
  318. package/ui-dist/assets/app-data-DzaIMy4D.js.gz +0 -0
  319. package/ui-dist/assets/app-presenter-provider-D3BuuOyZ.css +0 -1
  320. package/ui-dist/assets/app-presenter-provider-D3BuuOyZ.css.gz +0 -0
  321. package/ui-dist/assets/app-presenter-provider-O2tUKKGf.js +0 -109
  322. package/ui-dist/assets/app-presenter-provider-O2tUKKGf.js.gz +0 -0
  323. package/ui-dist/assets/appearance-settings-page-D8cWniw-.js.gz +0 -0
  324. package/ui-dist/assets/arc-CpivM836.js.gz +0 -0
  325. package/ui-dist/assets/architecture-TIHT7OUA-CVRF_cYQ.js +0 -1
  326. package/ui-dist/assets/architectureDiagram-ZJ3FMSHR-ifjW1qjI.js.gz +0 -0
  327. package/ui-dist/assets/c4Diagram-LMCZKHZV-CpapRftp.js.gz +0 -0
  328. package/ui-dist/assets/channel-CBrWRr4N.js +0 -1
  329. package/ui-dist/assets/channels-list-page-B_fYP1Pn.js.gz +0 -0
  330. package/ui-dist/assets/chunk-2Q5K7J3B-B8mmRk7d.js +0 -1
  331. package/ui-dist/assets/chunk-32BRIVSS-BKBwdmKR.js.gz +0 -0
  332. package/ui-dist/assets/chunk-52WLFC77-BgZRCpDx.js.gz +0 -0
  333. package/ui-dist/assets/chunk-5JV3BV7I-B7QYgZU5.js.gz +0 -0
  334. package/ui-dist/assets/chunk-5TONJI2A-DjyQwgL2.js.gz +0 -0
  335. package/ui-dist/assets/chunk-7BUUIJ7U-D6bq2PKF.js.gz +0 -0
  336. package/ui-dist/assets/chunk-C7G6YPKG-8z3B6RUH.js.gz +0 -0
  337. package/ui-dist/assets/chunk-EX3LRPZG-BChuEPvO.js.gz +0 -0
  338. package/ui-dist/assets/chunk-FWX5IMBZ-fBFt0u3f.js.gz +0 -0
  339. package/ui-dist/assets/chunk-HOUHSVGY-MD0SpW5A.js.gz +0 -0
  340. package/ui-dist/assets/chunk-ICXQ74PX-DvCcw_hz.js.gz +0 -0
  341. package/ui-dist/assets/chunk-JG7HCLWE-B8zqBnU9.js.gz +0 -0
  342. package/ui-dist/assets/chunk-MOJQB5TN-gXbfqoqq.js.gz +0 -0
  343. package/ui-dist/assets/chunk-PUDLZKDR-DPILgOVY.js.gz +0 -0
  344. package/ui-dist/assets/chunk-Q4XR5HBZ-C0JJx7lW.js.gz +0 -0
  345. package/ui-dist/assets/chunk-R7FJI6CG-Bb8n616-.js.gz +0 -0
  346. package/ui-dist/assets/chunk-RYQCIY6F-1HOsOrSl.js.gz +0 -0
  347. package/ui-dist/assets/chunk-U6XO7XAA-BAFDVb1v.js.gz +0 -0
  348. package/ui-dist/assets/chunk-V7JOEXUC-8-g68lu5.js.gz +0 -0
  349. package/ui-dist/assets/chunk-VAUOI2AC-Cpml0inz.js +0 -1
  350. package/ui-dist/assets/chunk-WYO6CB5R-6wjFTXNP.js.gz +0 -0
  351. package/ui-dist/assets/chunk-XXDRQBXY-nCiqnCpF.js +0 -1
  352. package/ui-dist/assets/chunk-ZGVPDNZ5-BRTmSAhp.js.gz +0 -0
  353. package/ui-dist/assets/chunk-ZIRB5QZD-CH_1eoSV.js.gz +0 -0
  354. package/ui-dist/assets/classDiagram-OUVF2IWQ-C-DRqAaW.js +0 -1
  355. package/ui-dist/assets/classDiagram-v2-EOCWNBFH-DXCcZ42U.js +0 -1
  356. package/ui-dist/assets/config-split-page-6hHiiapl.js.gz +0 -0
  357. package/ui-dist/assets/confirm-dialog-ClT6iaj8.js.gz +0 -0
  358. package/ui-dist/assets/cose-bilkent-JH36ORCC-L7w_qScX.js.gz +0 -0
  359. package/ui-dist/assets/cynefin-VYW2F7L2-2SOTgxxC.js +0 -1
  360. package/ui-dist/assets/cynefinDiagram-TSTJHNR4-Bay7uDSR.js.gz +0 -0
  361. package/ui-dist/assets/dagre-CJ_hX8xv.js.gz +0 -0
  362. package/ui-dist/assets/dagre-VKFMJZFB-DDhk-2B3.js.gz +0 -0
  363. package/ui-dist/assets/desktop-capabilities-page-CB5pniTx.js.gz +0 -0
  364. package/ui-dist/assets/desktop-update-config-OuQV73gg.js.gz +0 -0
  365. package/ui-dist/assets/diagram-FQU43EPY-somFq5y8.js.gz +0 -0
  366. package/ui-dist/assets/diagram-G47NLZAW-hzgyQsPd.js.gz +0 -0
  367. package/ui-dist/assets/diagram-NH7WQ7WH-BkJ4gEQJ.js.gz +0 -0
  368. package/ui-dist/assets/diagram-OA4YK3LP-CS3ZkK4w.js.gz +0 -0
  369. package/ui-dist/assets/diagram-WEI45ONY-BApo-JHS.js.gz +0 -0
  370. package/ui-dist/assets/doc-browser-BFkslEzY.js +0 -1
  371. package/ui-dist/assets/doc-browser-Cu58uiEg.js.gz +0 -0
  372. package/ui-dist/assets/doc-browser-context-CekJxJFm.js.gz +0 -0
  373. package/ui-dist/assets/docx-preview-ByCKKIVT.js.gz +0 -0
  374. package/ui-dist/assets/ebnfDiagram-CCIWWBDH-DWjfeEie.js.gz +0 -0
  375. package/ui-dist/assets/erDiagram-Q63AITRT-DR7vWYHM.js.gz +0 -0
  376. package/ui-dist/assets/eventmodeling-45OFAUF4-CXZNG56U.js +0 -1
  377. package/ui-dist/assets/extensions-B5r-0jCq.js.gz +0 -0
  378. package/ui-dist/assets/flowDiagram-23GEKE2U-2065oyKr.js +0 -1
  379. package/ui-dist/assets/ganttDiagram-NO4QXBWP-E3l9tuaL.js.gz +0 -0
  380. package/ui-dist/assets/gitGraph-TEB2WS4Q-B0Ln3ZuK.js +0 -1
  381. package/ui-dist/assets/gitGraphDiagram-IHSO6WYX-DiMvbHKf.js.gz +0 -0
  382. package/ui-dist/assets/i18n-CPjq_hQX.js.gz +0 -0
  383. package/ui-dist/assets/info-DKCQHKI2-B06uqGM4.js +0 -1
  384. package/ui-dist/assets/ishikawaDiagram-FXEZZL3T-BZ9WvJb2.js.gz +0 -0
  385. package/ui-dist/assets/journeyDiagram-5HDEW3XC-C3TZvKM8.js.gz +0 -0
  386. package/ui-dist/assets/kanban-definition-HUTT4EX6-9FqauDEi.js.gz +0 -0
  387. package/ui-dist/assets/katex-J8JuvgNl.js.gz +0 -0
  388. package/ui-dist/assets/linear-DlCeG66S.js.gz +0 -0
  389. package/ui-dist/assets/login-page-DBqkVTVD.js.gz +0 -0
  390. package/ui-dist/assets/login-page-DjcRQLQe.js +0 -1
  391. package/ui-dist/assets/main-CQ6GUYdX.js.gz +0 -0
  392. package/ui-dist/assets/main-i18n-catalog.config-QB4DfJRJ.js.gz +0 -0
  393. package/ui-dist/assets/map-WMnNq9UV.js.gz +0 -0
  394. package/ui-dist/assets/mcp-marketplace-page-CWAxBNaS.js.gz +0 -0
  395. package/ui-dist/assets/mcp-marketplace-page-Ct090ceA.js +0 -1
  396. package/ui-dist/assets/mermaid-parser.core-B8xk4hpS.js.gz +0 -0
  397. package/ui-dist/assets/mermaid.core-CFPiczKH.js.gz +0 -0
  398. package/ui-dist/assets/mindmap-definition-LN4V7U3C-CnxA52L6.js.gz +0 -0
  399. package/ui-dist/assets/model-config-page-DBcuZyRC.js.gz +0 -0
  400. package/ui-dist/assets/ordinal-PgiFlfBJ.js.gz +0 -0
  401. package/ui-dist/assets/packet-7NZHBO7P-CHx-igbz.js +0 -1
  402. package/ui-dist/assets/panel-app-i18n-catalog.config-CQFujXqt.js +0 -1
  403. package/ui-dist/assets/panelStandalone-BGA1s7JG.js.gz +0 -0
  404. package/ui-dist/assets/pegDiagram-2B236MQR-A8oz7dTH.js.gz +0 -0
  405. package/ui-dist/assets/pie-RZYD4A2V-DOaMc-x9.js +0 -1
  406. package/ui-dist/assets/pieDiagram-ENE6RG2P-mtBnkYY0.js.gz +0 -0
  407. package/ui-dist/assets/privacy-settings-page-DVC-aq1v.js.gz +0 -0
  408. package/ui-dist/assets/projects-Cq0E3c7N.js.gz +0 -0
  409. package/ui-dist/assets/provider-scoped-model-input-BGdZMWWa.js.gz +0 -0
  410. package/ui-dist/assets/providers-config-page-B-IhHl6x.js.gz +0 -0
  411. package/ui-dist/assets/pwa-C3kR9mdy.js.gz +0 -0
  412. package/ui-dist/assets/quadrantDiagram-ABIIQ3AL-DE1VybGO.js.gz +0 -0
  413. package/ui-dist/assets/radar-I7S5WNFK-CXsdndDk.js +0 -1
  414. package/ui-dist/assets/railroad-3IZDKUUU-DxgXdrYP.js +0 -1
  415. package/ui-dist/assets/railroad-abnf-AHOZXSZD-CR1tnyjz.js +0 -1
  416. package/ui-dist/assets/railroad-ebnf-EBAXGLYW-CjjxZR2U.js +0 -1
  417. package/ui-dist/assets/railroad-peg-LSFZ7HO6-DgVGJCHN.js +0 -1
  418. package/ui-dist/assets/railroadDiagram-RFXS5EU6-u9EMg14B.js.gz +0 -0
  419. package/ui-dist/assets/remote-Cnawibbg.js +0 -1
  420. package/ui-dist/assets/requirementDiagram-TGXJPOKE-BAWHAqEi.js.gz +0 -0
  421. package/ui-dist/assets/runtime-config-page-LmrB2q65.js.gz +0 -0
  422. package/ui-dist/assets/sankeyDiagram-HTMAVEWB-aDy-jdwF.js.gz +0 -0
  423. package/ui-dist/assets/search-config-page-BIXmv5FY.js.gz +0 -0
  424. package/ui-dist/assets/secrets-config-page-DU3fadrq.js.gz +0 -0
  425. package/ui-dist/assets/security-config-9s0i0I4N.js +0 -1
  426. package/ui-dist/assets/sequenceDiagram-DBY2YBRQ-DwHC4mbX.js.gz +0 -0
  427. package/ui-dist/assets/service-apps-panel-Bshf3Wmq.js.gz +0 -0
  428. package/ui-dist/assets/stateDiagram-2N3HPSRC-B0Epk-VR.js.gz +0 -0
  429. package/ui-dist/assets/stateDiagram-v2-6OUMAXLB-Ct4zTw8P.js +0 -1
  430. package/ui-dist/assets/swimlanes-5IMT3BWC-T0w-Iuzf.js.gz +0 -0
  431. package/ui-dist/assets/swimlanesDiagram-G3AALYLV-CdmN0PBd.js +0 -8
  432. package/ui-dist/assets/theme-provider-DE7m9jvf.js.gz +0 -0
  433. package/ui-dist/assets/timeline-definition-FHXFAJF6-BEonB5Np.js.gz +0 -0
  434. package/ui-dist/assets/treeView-QDETBFTQ-Dad4_Wc7.js +0 -1
  435. package/ui-dist/assets/treemap-6X3UGDF4-9_GWWZsY.js +0 -1
  436. package/ui-dist/assets/use-config-Cyiw06-j.js.gz +0 -0
  437. package/ui-dist/assets/use-desktop-capabilities-OKG96v4y.js.gz +0 -0
  438. package/ui-dist/assets/vennDiagram-L72KCM5P-BDvcOCo2.js.gz +0 -0
  439. package/ui-dist/assets/wardley-OPB4EBWU-BXpvyee9.js +0 -1
  440. package/ui-dist/assets/wardleyDiagram-EHGQE667-jMLMgjzE.js.gz +0 -0
  441. package/ui-dist/assets/xychartDiagram-FW5EYKEG-pzrpclEv.js.gz +0 -0
  442. /package/ui-dist/assets/{array-BHDgItFN.js → array-D0DyKZdT.js} +0 -0
  443. /package/ui-dist/assets/{card-CS8su2Zh.js → card-BhfAZv5L.js} +0 -0
  444. /package/ui-dist/assets/{card-CS8su2Zh.js.gz → card-BhfAZv5L.js.gz} +0 -0
  445. /package/ui-dist/assets/{chunk-KEIR6QF5-DstBw0Hk.js → chunk-KEIR6QF5-CuZFOa6q.js} +0 -0
  446. /package/ui-dist/assets/{chunk-KEIR6QF5-DstBw0Hk.js.gz → chunk-KEIR6QF5-CuZFOa6q.js.gz} +0 -0
  447. /package/ui-dist/assets/{chunk-Y2CYZVJY-CA3ymQuH.js → chunk-Y2CYZVJY-Frut-1TF.js} +0 -0
  448. /package/ui-dist/assets/{config-hints-CBPHrfYk.js → config-hints-B_C9DAp5.js} +0 -0
  449. /package/ui-dist/assets/{cytoscape.esm-C7xr90o_.js → cytoscape.esm-BibuhnZD.js} +0 -0
  450. /package/ui-dist/assets/{cytoscape.esm-C7xr90o_.js.gz → cytoscape.esm-BibuhnZD.js.gz} +0 -0
  451. /package/ui-dist/assets/{defaultLocale-BG1oDVag.js → defaultLocale-q7sRUXPc.js} +0 -0
  452. /package/ui-dist/assets/{defaultLocale-BG1oDVag.js.gz → defaultLocale-q7sRUXPc.js.gz} +0 -0
  453. /package/ui-dist/assets/{dist-Cnhwure9.js → dist-DhMddrrH.js} +0 -0
  454. /package/ui-dist/assets/{dist-Cnhwure9.js.gz → dist-DhMddrrH.js.gz} +0 -0
  455. /package/ui-dist/assets/{form-actions-AIdXOoCL.js → form-actions-BRESe-m_.js} +0 -0
  456. /package/ui-dist/assets/{graphlib-CNMGfuTb.js → graphlib-BM63WsW3.js} +0 -0
  457. /package/ui-dist/assets/{graphlib-CNMGfuTb.js.gz → graphlib-BM63WsW3.js.gz} +0 -0
  458. /package/ui-dist/assets/{init-wQIZuRSH.js → init-CRMkf9sL.js} +0 -0
  459. /package/ui-dist/assets/{jszip.min-D_AtKL_8.js → jszip.min-6thm2J_a.js} +0 -0
  460. /package/ui-dist/assets/{jszip.min-D_AtKL_8.js.gz → jszip.min-6thm2J_a.js.gz} +0 -0
  461. /package/ui-dist/assets/{panel-app-maumVhbl.js → panel-app-B39rJPj8.js} +0 -0
  462. /package/ui-dist/assets/{panel-app-maumVhbl.js.gz → panel-app-B39rJPj8.js.gz} +0 -0
  463. /package/ui-dist/assets/{path-N-C4MRP0.js → path-BFMmafCM.js} +0 -0
  464. /package/ui-dist/assets/{path-N-C4MRP0.js.gz → path-BFMmafCM.js.gz} +0 -0
  465. /package/ui-dist/assets/{provider-models-5PGHb6mP.js → provider-models-hrHMcHqg.js} +0 -0
  466. /package/ui-dist/assets/{provider-models-5PGHb6mP.js.gz → provider-models-hrHMcHqg.js.gz} +0 -0
  467. /package/ui-dist/assets/{rough.esm-BeWA068d.js → rough.esm-5Tjchx1D.js} +0 -0
  468. /package/ui-dist/assets/{rough.esm-BeWA068d.js.gz → rough.esm-5Tjchx1D.js.gz} +0 -0
  469. /package/ui-dist/assets/{skeleton-BL9h32W7.js → skeleton-Drvn83YW.js} +0 -0
  470. /package/ui-dist/assets/{use-panel-app-scroll-restoration-DsV1IJx-.js → use-panel-app-scroll-restoration-ZnicIfo3.js} +0 -0
  471. /package/ui-dist/assets/{use-panel-app-scroll-restoration-DsV1IJx-.js.gz → use-panel-app-scroll-restoration-ZnicIfo3.js.gz} +0 -0
  472. /package/ui-dist/assets/{xlsx-CwUXNtD3.js → xlsx-BC8ibjXK.js} +0 -0
  473. /package/ui-dist/assets/{xlsx-CwUXNtD3.js.gz → xlsx-BC8ibjXK.js.gz} +0 -0
@@ -1 +1 @@
1
- import{i as e}from"./chunk-DF37yw5_.js";import{A as t,M as n,O as r}from"./utils-CBZPzC_b.js";import{d as i,f as a,n as o}from"./navigation-link-BAQjgx2F.js";import{Gt as s,Lt as c,Yt as l,bn as u,jn as d,vn as f,yn as p}from"./api-Dffeij78.js";import{C as m,a as h,c as g,i as _,n as v,o as y,r as b,s as ee}from"./mcp-marketplace-page-CWAxBNaS.js";import{C as te,H as x,P as S,ct as C,st as ne}from"./app-presenter-provider-O2tUKKGf.js";import{n as w,r as T,s as E,t as D}from"./i18n-CPjq_hQX.js";import{t as O}from"./createLucideIcon-BNKf0_kc.js";import{h as re}from"./app-data-DzaIMy4D.js";import{t as k}from"./chevron-down-BL-yMYcX.js";import{n as ie}from"./ellipsis-C5YXdOUx.js";import{S as ae,a as A,i as j,n as M,r as N,t as P}from"./select-CG5YWnwe.js";import{t as oe}from"./circle-dashed-CU3yApvP.js";import{i as se,n as F,r as ce,t as le}from"./tabs-BuE0qKMh.js";import{t as ue}from"./use-viewport-layout-BS18drMT.js";import{t as de}from"./plus-LA8-jpxP.js";import{t as fe}from"./settings-2-CE3ELQyk.js";import{t as pe}from"./confirm-dialog-ClT6iaj8.js";import{t as I}from"./trash-2-BPPYt2NV.js";import{a as L,i as me,n as R,o as he,r as ge,t as _e}from"./dialog-Xe73hpQz.js";import{a as ve,i as ye,n as be,t as xe}from"./card-CS8su2Zh.js";var Se=O(`CircleX`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),Ce=O(`Circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),we=O(`List`,[[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 18h.01`,key:`1tta3j`}],[`path`,{d:`M3 6h.01`,key:`1rqtza`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 18h13`,key:`1lx6n3`}],[`path`,{d:`M8 6h13`,key:`ik3vkj`}]]),Te=O(`Unlink`,[[`path`,{d:`m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71`,key:`yqzxt4`}],[`path`,{d:`m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71`,key:`4qinb0`}],[`line`,{x1:`8`,x2:`8`,y1:`2`,y2:`5`,key:`1041cp`}],[`line`,{x1:`2`,x2:`5`,y1:`8`,y2:`8`,key:`14m1p5`}],[`line`,{x1:`16`,x2:`16`,y1:`19`,y2:`22`,key:`rzdirn`}],[`line`,{x1:`19`,x2:`22`,y1:`16`,y2:`16`,key:`ox905f`}]]),z=e(n(),1),B=t();function V({title:e,children:t,className:n=``}){return(0,B.jsxs)(xe,{hover:!1,surface:`flat`,className:n,children:[(0,B.jsx)(ye,{className:`p-4 pb-3`,children:(0,B.jsx)(ve,{children:e})}),(0,B.jsx)(be,{className:`p-4 pt-0`,children:t})]})}function H({children:e}){return(0,B.jsx)(`p`,{className:`py-5 text-sm text-muted-foreground`,children:e})}function U({available:e,children:t,className:n,label:r,onOpen:i,path:a}){return e?(0,B.jsx)(`button`,{type:`button`,className:n,title:a,onClick:()=>i(a,r),children:t}):(0,B.jsx)(`div`,{className:n,children:t})}function Ee({agreement:e,isLoading:t,isError:n,onOpenFile:r}){return(0,B.jsxs)(V,{title:E(`projectsAgreementFile`),children:[(0,B.jsx)(`p`,{className:`mb-4 text-sm text-muted-foreground`,children:E(`projectsAgreementDescription`)}),t?(0,B.jsx)(`p`,{className:`py-5 text-sm text-muted-foreground`,children:E(`projectsLoading`)}):n?(0,B.jsx)(`p`,{className:`py-5 text-sm text-destructive`,children:E(`projectsLoadFailed`)}):e?.available?(0,B.jsxs)(U,{available:!0,path:e.path,label:e.path,onOpen:r,className:`block w-full rounded-xl bg-muted/45 p-3 text-left transition-colors enabled:hover:bg-[var(--interaction-hover)] enabled:focus-visible:outline-none enabled:focus-visible:ring-1 enabled:focus-visible:ring-border`,children:[(0,B.jsx)(`span`,{className:`block text-sm font-medium`,children:e.path}),(0,B.jsx)(`span`,{className:`mt-1 block text-xs text-muted-foreground`,children:E(`projectsAgreementOpen`)})]}):(0,B.jsx)(H,{children:E(`projectsNoAgreement`)})]})}var W=e=>[`project-work`,e],G=e=>[`project-work-summary`,e],K=e=>[`project-work-states`,e],q=e=>[`project-work-artifacts`,e],J=(e,t)=>[`project-work-item`,e,t],Y=(e,t)=>[`project-work-activity`,e,t];function De(e,t={}){return m({queryKey:[...W(e??``),t],enabled:!!e,initialPageParam:null,queryFn:async({pageParam:n})=>await c.projects.listWork(e,{...t,...n?{cursor:n}:{}}),getNextPageParam:e=>e.nextCursor})}function Oe(e){return u({queryKey:G(e??``),enabled:!!e,queryFn:async()=>await c.projects.getWorkSummary(e)})}function ke(e){return u({queryKey:K(e??``),enabled:!!e,queryFn:async()=>await c.projects.listWorkStates(e)})}function Ae(e,t={}){return m({queryKey:[...q(e??``),t],enabled:!!e,initialPageParam:null,queryFn:async({pageParam:n})=>await c.projects.listRecentWorkArtifacts(e,{...t,...n?{cursor:n}:{}}),getNextPageParam:e=>e.nextCursor})}function je(e,t){return u({queryKey:J(e??``,t??``),enabled:!!(e&&t),queryFn:async()=>await c.projects.getWorkItem(e,t)})}function Me(e,t){return u({queryKey:Y(e??``,t??``),enabled:!!(e&&t),queryFn:async()=>await c.projects.listWorkItemActivities(e,t,{limit:100})})}function X(e){let t=d(),n=async n=>{await Promise.all([t.invalidateQueries({queryKey:W(e)}),t.invalidateQueries({queryKey:G(e)}),t.invalidateQueries({queryKey:K(e)}),t.invalidateQueries({queryKey:q(e)}),...n?[t.invalidateQueries({queryKey:J(e,n)}),t.invalidateQueries({queryKey:Y(e,n)})]:[]])};return{createItem:p({mutationFn:async t=>await c.projects.createWorkItem(e,t),onSuccess:async e=>await n(e.id)}),updateItem:p({mutationFn:async t=>await c.projects.updateWorkItem(e,t.workItemId,t.patch),onSuccess:async e=>await n(e.id)}),deleteItem:p({mutationFn:async t=>await c.projects.deleteWorkItem(e,t),onSuccess:async e=>await n(e.id)}),restoreItem:p({mutationFn:async t=>await c.projects.restoreWorkItem(e,t),onSuccess:async e=>await n(e.id)}),linkArtifact:p({mutationFn:async t=>await c.projects.linkWorkItemArtifact(e,t.workItemId,{path:t.path,...t.label?{label:t.label}:{}}),onSuccess:async(e,t)=>await n(t.workItemId)}),unlinkArtifact:p({mutationFn:async t=>await c.projects.unlinkWorkItemArtifact(e,t.workItemId,t.artifactLinkId),onSuccess:async(e,t)=>await n(t.workItemId)}),createState:p({mutationFn:async t=>await c.projects.createWorkState(e,t),onSuccess:async()=>await n()}),updateState:p({mutationFn:async t=>await c.projects.updateWorkState(e,t.stateId,t.patch),onSuccess:async()=>await n()}),deleteState:p({mutationFn:async t=>await c.projects.deleteWorkState(e,t.stateId,t.migrateToStateId),onSuccess:async()=>await n()})}}function Z(e){let t=d();(0,z.useEffect)(()=>{if(e)return c.eventBus.on(r.projectWorkChanged,n=>{n.projectId===e&&(t.invalidateQueries({queryKey:W(e)}),t.invalidateQueries({queryKey:G(e)}),t.invalidateQueries({queryKey:K(e)}),t.invalidateQueries({queryKey:q(e)}),n.workItemId&&(t.invalidateQueries({queryKey:J(e,n.workItemId)}),t.invalidateQueries({queryKey:Y(e,n.workItemId)})))})},[e,t])}function Ne(e){return[...e].sort((e,t)=>e.position-t.position||e.name.localeCompare(t.name))}var Pe={started:0,unstarted:1,backlog:2,completed:3,canceled:4};function Fe(e){return[...e].sort((e,t)=>{let n=Pe[e.category]-Pe[t.category];return n===0?e.category===`completed`||e.category===`canceled`?e.position-t.position||e.name.localeCompare(t.name):t.position-e.position||e.name.localeCompare(t.name):n})}function Q(e,t){return`${e}${e.endsWith(`/`)||e.endsWith(`\\`)?``:`/`}${t}`}function Ie(e,t=new Date){if(!e)return`-`;let n=new Date(e),r=t.getTime()-n.getTime();if(Number.isNaN(n.getTime()))return e;if(r<6e4)return E(`projectsTimeJustNow`);let i=Math.floor(r/6e4);if(i<60)return E(`projectsTimeMinutesAgo`).replace(`{count}`,String(i));let a=Math.floor(i/60);if(a<24)return E(`projectsTimeHoursAgo`).replace(`{count}`,String(a));let o=Math.floor(a/24);return o===1?E(`projectsTimeYesterday`):o<7?E(`projectsTimeDaysAgo`).replace(`{count}`,String(o)):D(e)}var Le=20;function Re({projectId:e,onOpenFile:t}){let[n,r]=(0,z.useState)(``),i=Ae(e,{limit:Le,...n.trim()?{query:n.trim()}:{}}),a=i.data?.pages??[],o=a.flatMap(e=>e.artifacts),s=a[0]?.total??0;return i.isLoading?(0,B.jsx)(`p`,{className:`py-5 text-sm text-muted-foreground`,children:E(`projectsLoading`)}):i.isError?(0,B.jsx)(`p`,{className:`py-5 text-sm text-destructive`,children:E(`projectsLoadFailed`)}):(0,B.jsxs)(`section`,{className:`min-w-0`,"aria-label":E(`projectsArtifacts`),children:[(0,B.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center justify-between gap-3`,children:[(0,B.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[T(s),` `,E(`projectsArtifactsCountSuffix`)]}),(0,B.jsx)(`input`,{type:`search`,value:n,className:`h-8 w-full min-w-0 rounded-lg border border-border/60 bg-transparent px-3 text-sm outline-none placeholder:text-muted-foreground sm:w-60`,placeholder:E(`projectsArtifactsSearchPlaceholder`),onChange:e=>r(e.target.value)})]}),o.length?(0,B.jsxs)(`div`,{className:`overflow-hidden rounded-xl border border-border/60`,children:[(0,B.jsx)(`div`,{className:`divide-y divide-border/60`,children:o.map(e=>(0,B.jsxs)(U,{available:e.exists,path:e.path,label:e.label??e.path,onOpen:t,className:`flex w-full min-w-0 items-center gap-3 px-3 py-3 text-left text-sm transition-colors enabled:hover:bg-[var(--interaction-hover)] enabled:focus-visible:outline-none enabled:focus-visible:ring-1 enabled:focus-visible:ring-border`,children:[(0,B.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`span`,{className:`block truncate font-medium`,children:e.label??e.path}),(0,B.jsxs)(`span`,{className:`mt-1 block truncate text-xs text-muted-foreground`,children:[e.path,` · `,e.workItemTitle]})]}),(0,B.jsx)(`time`,{className:`shrink-0 text-xs text-muted-foreground`,dateTime:e.createdAt,title:w(e.createdAt),children:Ie(e.createdAt)}),e.exists?null:(0,B.jsx)(`span`,{className:`shrink-0 text-xs text-destructive`,children:E(`projectsUnavailable`)})]},e.id))}),i.hasNextPage?(0,B.jsx)(`button`,{type:`button`,className:`w-full border-t border-border/60 px-3 py-2.5 text-left text-sm text-muted-foreground transition-colors hover:bg-[var(--interaction-hover)] hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,disabled:i.isFetchingNextPage,onClick:()=>void i.fetchNextPage(),children:i.isFetchingNextPage?E(`projectsLoading`):E(`projectsArtifactsShowMore`)}):null]}):(0,B.jsx)(H,{children:n.trim()?E(`projectsArtifactsNoMatches`):E(`projectsNoArtifacts`)})]})}var ze={Backlog:`projectsWorkState_backlog`,Planned:`projectsWorkState_planned`,"In Progress":`projectsWorkState_inProgress`,"In Review":`projectsWorkState_inReview`,"Awaiting Acceptance":`projectsWorkState_awaitingAcceptance`,Completed:`projectsWorkState_completed`,Canceled:`projectsWorkState_canceled`};function $(e,t){let n=ze[e];return n?t?E(n,t):E(n):e}function Be({projectId:e,onOpenArtifact:t,onOpenWorkItem:n}){Z(e);let r=Oe(e),i=De(e,{limit:5}),a=Ae(e,{limit:5}),o=a.data?.pages[0]?.artifacts??[],s=i.data?.pages.flatMap(e=>e.items).slice(0,5)??[];return(0,B.jsxs)(`div`,{className:`space-y-5`,children:[(0,B.jsx)(`section`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-4`,"aria-label":E(`projectsWorkSummary`),children:r.data?[[`projectsWorkTotal`,r.data.total],[`projectsWorkActive`,r.data.active],[`projectsWorkNeedsAttention`,r.data.attention],[`projectsWorkCompleted`,r.data.completed]].map(([e,t])=>(0,B.jsxs)(`div`,{className:`rounded-xl border border-border/60 bg-card p-4`,children:[(0,B.jsx)(`div`,{className:`text-2xl font-semibold`,children:t}),(0,B.jsx)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:E(e)})]},e)):(0,B.jsx)(`div`,{className:`col-span-full rounded-xl border border-border/60 p-5 text-sm text-muted-foreground`,children:r.isError?E(`projectsLoadFailed`):E(`projectsLoading`)})}),(0,B.jsxs)(`div`,{className:`grid min-w-0 gap-4 lg:grid-cols-2`,children:[(0,B.jsx)(V,{title:E(`projectsWorkRecentlyUpdated`),children:i.isLoading?(0,B.jsx)(`p`,{className:`py-5 text-sm text-muted-foreground`,children:E(`projectsLoading`)}):i.isError?(0,B.jsx)(`p`,{className:`py-5 text-sm text-destructive`,children:E(`projectsLoadFailed`)}):s.length?(0,B.jsx)(`div`,{className:`space-y-2`,children:s.map(e=>(0,B.jsxs)(`button`,{type:`button`,className:`flex w-full items-center justify-between gap-3 rounded-xl bg-muted/45 px-3 py-3 text-left transition-colors hover:bg-[var(--interaction-hover)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,onClick:()=>n(e.id),children:[(0,B.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium`,children:e.title}),(0,B.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:$(e.state.name)})]},e.id))}):(0,B.jsx)(H,{children:E(`projectsWorkEmpty`)})}),(0,B.jsx)(V,{title:E(`projectsRecentArtifacts`),children:a.isLoading?(0,B.jsx)(`p`,{className:`py-5 text-sm text-muted-foreground`,children:E(`projectsLoading`)}):a.isError?(0,B.jsx)(`p`,{className:`py-5 text-sm text-destructive`,children:E(`projectsLoadFailed`)}):o.length?(0,B.jsx)(`div`,{className:`space-y-2`,children:o.map(e=>(0,B.jsxs)(U,{available:e.exists,path:e.path,label:e.label??e.path,onOpen:t,className:`block w-full rounded-xl bg-muted/45 p-3 text-left text-sm transition-colors enabled:hover:bg-[var(--interaction-hover)] enabled:focus-visible:outline-none enabled:focus-visible:ring-1 enabled:focus-visible:ring-border`,children:[(0,B.jsx)(`span`,{className:`block truncate font-medium`,children:e.label??e.path}),(0,B.jsxs)(`span`,{className:`mt-1 block truncate text-xs text-muted-foreground`,children:[e.workItemTitle,(0,B.jsx)(`time`,{dateTime:e.createdAt,title:w(e.createdAt),children:` · ${Ie(e.createdAt)}`}),e.exists?``:` · ${E(`projectsUnavailable`)}`]})]},e.id))}):(0,B.jsx)(H,{children:E(`projectsNoRecentArtifacts`)})})]})]})}function Ve({skills:e,isLoading:t,isError:n,onOpen:r}){return t?(0,B.jsx)(`p`,{className:`py-5 text-sm text-muted-foreground`,children:E(`projectsLoading`)}):n?(0,B.jsx)(`p`,{className:`py-5 text-sm text-destructive`,children:E(`projectsLoadFailed`)}):(0,B.jsxs)(`section`,{className:`min-w-0`,"aria-label":E(`projectsSkills`),children:[(0,B.jsxs)(`p`,{className:`mb-3 text-sm text-muted-foreground`,children:[T(e.length),` `,E(`projectsSkillsCountSuffix`)]}),e.length?(0,B.jsx)(`div`,{className:`grid min-w-0 gap-3 md:grid-cols-2`,children:e.map(e=>(0,B.jsxs)(`button`,{type:`button`,className:`min-w-0 rounded-xl border border-border/60 p-3 text-left transition-colors hover:border-border hover:bg-muted/30 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,onClick:()=>r(e),children:[(0,B.jsx)(`h3`,{className:`text-sm font-medium`,children:e.name}),(0,B.jsx)(`p`,{className:`mt-1 truncate text-xs text-muted-foreground`,title:e.path,children:e.path}),(0,B.jsx)(`p`,{className:`mt-2 line-clamp-2 text-xs text-muted-foreground`,title:e.description??e.ref,children:e.description??e.ref})]},e.ref))}):(0,B.jsx)(H,{children:E(`projectsNoSkills`)})]})}function He({onOpenArtifact:e,onOpenChange:t,projectId:n,projectRoot:r,workItemId:i}){let a=je(n,i),o=Me(n,i);Z(n);let s=ke(n);return(0,B.jsx)(b,{open:!!i,onOpenChange:t,children:(0,B.jsxs)(_,{side:`right`,closeLabel:E(`projectsCloseDetails`),className:`flex h-full w-full flex-col overflow-hidden p-0 sm:max-w-[680px]`,children:[a.isLoading?(0,B.jsx)(`div`,{className:`p-6 text-sm text-muted-foreground`,children:E(`projectsLoading`)}):null,a.isError?(0,B.jsx)(`div`,{className:`p-6 text-sm text-destructive`,children:E(`projectsWorkItemLoadFailed`)}):null,a.data?(0,B.jsx)(Ue,{item:a.data,states:s.data??[],activities:o.data?.activities??[],onOpenArtifact:(t,n)=>e(Q(r,t),n),onClose:()=>t(!1)},`${a.data.id}:${a.data.version}`):null]})})}function Ue({activities:e,item:t,onClose:n,onOpenArtifact:r,states:i}){let a=X(t.projectId),[c,u]=(0,z.useState)(t.title),[d,p]=(0,z.useState)(t.description),[m,_]=(0,z.useState)(t.stateId),[b,te]=(0,z.useState)(t.attention),[x,S]=(0,z.useState)(``),[C,w]=(0,z.useState)(``),[T,D]=(0,z.useState)(!1),O=async(e,t)=>{try{await e(),t?.()}catch(e){f.error(e instanceof Error?e.message:E(`projectsWorkActionFailed`))}},re=async()=>{try{await a.updateItem.mutateAsync({workItemId:t.id,patch:{title:c,description:d,stateId:m,attention:b,expectedVersion:t.version}}),f.success(E(`projectsWorkItemSaved`))}catch(e){f.error(e instanceof Error?e.message:E(`projectsWorkItemSaveFailed`))}},k=async()=>{if(x.trim())try{await a.linkArtifact.mutateAsync({workItemId:t.id,path:x.trim(),...C.trim()?{label:C.trim()}:{}}),S(``),w(``)}catch(e){f.error(e instanceof Error?e.message:E(`projectsWorkArtifactLinkFailed`))}};return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(ee,{className:`shrink-0 border-b border-border/60 px-5 pb-5 pt-6 pr-14 sm:px-7 sm:pt-7`,children:[(0,B.jsx)(g,{children:E(`projectsWorkDetails`)}),(0,B.jsxs)(h,{children:[t.id,` · `,E(`projectsWorkVersion`),` `,t.version]})]}),(0,B.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-6 overflow-y-auto px-5 py-6 sm:px-7`,children:[(0,B.jsxs)(`section`,{className:`space-y-3`,children:[(0,B.jsx)(`label`,{className:`block text-xs font-medium text-muted-foreground`,children:E(`projectsWorkTitle`)}),(0,B.jsx)(s,{value:c,onChange:e=>u(e.target.value)}),(0,B.jsx)(`label`,{className:`block text-xs font-medium text-muted-foreground`,children:E(`projectsWorkDescription`)}),(0,B.jsx)(v,{className:`min-h-28`,value:d,onChange:e=>p(e.target.value)}),(0,B.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`label`,{className:`mb-1 block text-xs font-medium text-muted-foreground`,children:E(`projectsStatus`)}),(0,B.jsxs)(P,{value:m,onValueChange:_,children:[(0,B.jsx)(j,{children:(0,B.jsx)(A,{})}),(0,B.jsx)(M,{children:i.map(e=>(0,B.jsx)(N,{value:e.id,children:$(e.name)},e.id))})]})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`label`,{className:`mb-1 block text-xs font-medium text-muted-foreground`,children:E(`projectsWorkAttention`)}),(0,B.jsxs)(P,{value:b,onValueChange:e=>te(e),children:[(0,B.jsx)(j,{children:(0,B.jsx)(A,{})}),(0,B.jsxs)(M,{children:[(0,B.jsx)(N,{value:`none`,children:E(`projectsWorkAttention_none`)}),(0,B.jsx)(N,{value:`blocked`,children:E(`projectsWorkAttention_blocked`)}),(0,B.jsx)(N,{value:`awaiting-user`,children:E(`projectsWorkAttention_awaiting-user`)})]})]})]})]})]}),(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h3`,{className:`mb-3 text-sm font-semibold`,children:E(`projectsWorkArtifacts`)}),(0,B.jsxs)(`div`,{className:`space-y-2`,children:[t.artifacts.map(e=>(0,B.jsxs)(`div`,{className:`flex items-center gap-2 rounded-xl border border-border/60 p-2`,children:[(0,B.jsxs)(`button`,{type:`button`,className:`min-w-0 flex-1 rounded-lg px-2 py-1 text-left hover:bg-[var(--interaction-hover)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,onClick:()=>r(e.path,e.label??e.path),children:[(0,B.jsxs)(`span`,{className:`flex items-center gap-2 truncate text-sm font-medium`,children:[(0,B.jsx)(o,{className:`h-3.5 w-3.5 shrink-0`}),e.label??e.path]}),(0,B.jsx)(`span`,{className:`block truncate text-xs text-muted-foreground`,children:e.path})]}),(0,B.jsx)(l,{size:`icon`,variant:`ghost`,"aria-label":E(`projectsWorkUnlinkArtifact`),onClick:()=>void O(()=>a.unlinkArtifact.mutateAsync({workItemId:t.id,artifactLinkId:e.id})),children:(0,B.jsx)(Te,{className:`h-4 w-4`})})]},e.id)),t.artifacts.length?null:(0,B.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:E(`projectsWorkNoArtifacts`)})]}),(0,B.jsxs)(`div`,{className:`mt-3 grid gap-2 sm:grid-cols-[1fr_12rem_auto]`,children:[(0,B.jsx)(s,{value:x,onChange:e=>S(e.target.value),placeholder:E(`projectsWorkArtifactPath`)}),(0,B.jsx)(s,{value:C,onChange:e=>w(e.target.value),placeholder:E(`projectsWorkArtifactLabel`)}),(0,B.jsxs)(l,{variant:`outline`,onClick:()=>void k(),disabled:!x.trim()||a.linkArtifact.isPending,children:[(0,B.jsx)(ne,{className:`mr-2 h-4 w-4`}),E(`projectsWorkLinkArtifact`)]})]})]}),(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h3`,{className:`mb-3 text-sm font-semibold`,children:E(`projectsActivity`)}),(0,B.jsx)(`ol`,{className:`space-y-2`,children:e.map(e=>(0,B.jsxs)(`li`,{className:`rounded-xl bg-muted/35 px-3 py-2 text-sm`,children:[(0,B.jsx)(`span`,{className:`font-medium`,children:E(`projectsWorkActivity_${e.type}`)}),(0,B.jsxs)(`span`,{className:`ml-2 text-xs text-muted-foreground`,children:[e.actor.kind,` ·`,` `,new Date(e.createdAt).toLocaleString()]})]},e.id))})]})]}),(0,B.jsxs)(y,{className:`shrink-0 border-t border-border/60 bg-background px-5 py-4 sm:px-7`,children:[t.deletedAt?(0,B.jsx)(l,{variant:`outline`,onClick:()=>void O(()=>a.restoreItem.mutateAsync(t.id)),children:E(`projectsRestore`)}):(0,B.jsxs)(l,{variant:`destructive`,onClick:()=>D(!0),children:[(0,B.jsx)(I,{className:`mr-2 h-4 w-4`}),E(`projectsDelete`)]}),(0,B.jsx)(l,{onClick:()=>void re(),disabled:!c.trim()||a.updateItem.isPending,children:E(`save`)})]}),(0,B.jsx)(pe,{open:T,onOpenChange:D,title:E(`projectsDeleteWorkItem`),description:E(`projectsDeleteWorkItemDescription`),confirmLabel:E(`projectsDelete`),variant:`destructive`,onCancel:()=>D(!1),onConfirm:()=>void O(()=>a.deleteItem.mutateAsync(t.id),n)})]})}var We=[`backlog`,`unstarted`,`started`,`completed`,`canceled`];function Ge({open:e,onOpenChange:t,projectId:n,states:r}){let i=X(n),a=Ne(r),[o,c]=(0,z.useState)(``),[u,d]=(0,z.useState)(`unstarted`),[p,m]=(0,z.useState)(null),[h,g]=(0,z.useState)(``),_=async e=>{try{await e()}catch(e){f.error(e instanceof Error?e.message:E(`projectsWorkActionFailed`))}},v=async()=>{o.trim()&&await _(async()=>{await i.createState.mutateAsync({name:o.trim(),category:u}),c(``)})},y=async(e,t)=>{let n=a[e],r=a[e+t];!n||!r||await _(async()=>{await i.updateState.mutateAsync({stateId:n.id,patch:{position:r.position}}),await i.updateState.mutateAsync({stateId:r.id,patch:{position:n.position}})})};return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(_e,{open:e,onOpenChange:t,children:(0,B.jsxs)(R,{className:`max-h-[85vh] overflow-y-auto sm:max-w-2xl`,children:[(0,B.jsxs)(L,{children:[(0,B.jsx)(he,{children:E(`projectsWorkStateSettings`)}),(0,B.jsx)(ge,{children:E(`projectsWorkStateSettingsDescription`)})]}),(0,B.jsx)(`div`,{className:`space-y-2`,children:a.map((e,t)=>(0,B.jsxs)(`div`,{className:`grid gap-2 rounded-xl border border-border/60 p-3 sm:grid-cols-[1fr_11rem_auto]`,children:[(0,B.jsx)(s,{"aria-label":E(`projectsWorkStateName`),defaultValue:$(e.name),onBlur:t=>{let n=t.currentTarget.value.trim();n&&n!==$(e.name)&&_(()=>i.updateState.mutateAsync({stateId:e.id,patch:{name:n}}))}}),(0,B.jsxs)(P,{value:e.category,onValueChange:t=>void _(()=>i.updateState.mutateAsync({stateId:e.id,patch:{category:t}})),children:[(0,B.jsx)(j,{"aria-label":E(`projectsWorkStateCategory`),children:(0,B.jsx)(A,{})}),(0,B.jsx)(M,{children:We.map(e=>(0,B.jsx)(N,{value:e,children:E(`projectsWorkCategory_${e}`)},e))})]}),(0,B.jsxs)(`div`,{className:`flex items-center justify-end gap-1`,children:[(0,B.jsx)(l,{size:`icon`,variant:`ghost`,"aria-label":E(`projectsMoveUp`),disabled:t===0,onClick:()=>void y(t,-1),children:(0,B.jsx)(ae,{className:`h-4 w-4`})}),(0,B.jsx)(l,{size:`icon`,variant:`ghost`,"aria-label":E(`projectsMoveDown`),disabled:t===a.length-1,onClick:()=>void y(t,1),children:(0,B.jsx)(k,{className:`h-4 w-4`})}),(0,B.jsx)(l,{size:`icon`,variant:`ghost`,"aria-label":E(`projectsDeleteState`),disabled:a.length<=1,onClick:()=>{m(e),g(``)},children:(0,B.jsx)(I,{className:`h-4 w-4`})})]}),(0,B.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-muted-foreground sm:col-span-3`,children:[(0,B.jsx)(`input`,{type:`radio`,name:`default-state`,checked:e.isDefault,onChange:()=>void _(()=>i.updateState.mutateAsync({stateId:e.id,patch:{isDefault:!0}}))}),E(`projectsWorkDefaultState`)]})]},e.id))}),(0,B.jsxs)(`div`,{className:`grid gap-2 border-t border-border/60 pt-4 sm:grid-cols-[1fr_11rem_auto]`,children:[(0,B.jsx)(s,{value:o,onChange:e=>c(e.target.value),placeholder:E(`projectsWorkNewState`)}),(0,B.jsxs)(P,{value:u,onValueChange:e=>d(e),children:[(0,B.jsx)(j,{children:(0,B.jsx)(A,{})}),(0,B.jsx)(M,{children:We.map(e=>(0,B.jsx)(N,{value:e,children:E(`projectsWorkCategory_${e}`)},e))})]}),(0,B.jsxs)(l,{onClick:()=>void v(),disabled:!o.trim()||i.createState.isPending,children:[(0,B.jsx)(de,{className:`mr-2 h-4 w-4`}),E(`projectsAdd`)]})]})]})}),(0,B.jsx)(_e,{open:!!p,onOpenChange:e=>{e||m(null)},children:(0,B.jsxs)(R,{children:[(0,B.jsxs)(L,{children:[(0,B.jsx)(he,{children:E(`projectsDeleteState`)}),(0,B.jsx)(ge,{children:E(`projectsDeleteStateDescription`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`mb-2 text-xs text-muted-foreground`,children:E(`projectsWorkStateMigration`)}),(0,B.jsxs)(P,{value:h,onValueChange:g,children:[(0,B.jsx)(j,{children:(0,B.jsx)(A,{placeholder:E(`projectsWorkStateMigrationOptional`)})}),(0,B.jsx)(M,{children:a.filter(e=>e.id!==p?.id).map(e=>(0,B.jsx)(N,{value:e.id,children:$(e.name)},e.id))})]})]}),(0,B.jsxs)(me,{children:[(0,B.jsx)(l,{variant:`outline`,onClick:()=>m(null),children:E(`cancel`)}),(0,B.jsx)(l,{variant:`destructive`,onClick:()=>{p&&_(async()=>{await i.deleteState.mutateAsync({stateId:p.id,migrateToStateId:h||null}),m(null)})},children:E(`projectsDelete`)})]})]})})]})}function Ke({startedProgress:e,state:t}){if(t.category===`backlog`)return(0,B.jsx)(`span`,{"aria-hidden":`true`,"data-state-visual":`backlog`,className:`inline-flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground/65`,children:(0,B.jsx)(oe,{className:`h-4 w-4`})});if(t.category===`unstarted`)return(0,B.jsx)(`span`,{"aria-hidden":`true`,"data-state-visual":`unstarted`,className:`inline-flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground`,children:(0,B.jsx)(Ce,{className:`h-4 w-4`,strokeWidth:2})});if(t.category===`completed`)return(0,B.jsx)(`span`,{"aria-hidden":`true`,"data-state-visual":`completed`,className:`inline-flex h-4 w-4 shrink-0 items-center justify-center text-emerald-600 dark:text-emerald-400`,children:(0,B.jsx)(re,{className:`h-4 w-4`,strokeWidth:2.25})});if(t.category===`canceled`)return(0,B.jsx)(`span`,{"aria-hidden":`true`,"data-state-visual":`canceled`,className:`inline-flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground/65`,children:(0,B.jsx)(Se,{className:`h-4 w-4`})});let n=Math.round((e??.5)*100),r=n>=67?`text-emerald-600 dark:text-emerald-400`:n>=40?`text-orange-500 dark:text-orange-400`:`text-amber-500 dark:text-amber-400`;return(0,B.jsx)(`span`,{"aria-hidden":`true`,"data-state-visual":`started`,className:`inline-flex h-4 w-4 shrink-0 items-center justify-center ${r}`,children:(0,B.jsxs)(`svg`,{className:`h-4 w-4`,viewBox:`0 0 16 16`,fill:`none`,children:[(0,B.jsx)(`circle`,{cx:`8`,cy:`8`,r:`5.5`,stroke:`currentColor`,strokeWidth:`1.75`,opacity:`0.22`}),(0,B.jsx)(`circle`,{cx:`8`,cy:`8`,r:`5.5`,pathLength:`100`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeDasharray:`${n} ${100-n}`,transform:`rotate(-90 8 8)`})]})})}function qe({item:e,onOpen:t}){return(0,B.jsxs)(`button`,{type:`button`,className:`w-full rounded-xl border border-border/50 bg-card p-3 text-left text-sm shadow-sm transition-colors hover:bg-[var(--interaction-hover)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,onClick:t,children:[(0,B.jsx)(`span`,{className:`block font-medium`,children:e.title}),(0,B.jsxs)(`span`,{className:`mt-1 flex flex-wrap items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,B.jsx)(`span`,{children:$(e.state.name)}),e.attention===`none`?null:(0,B.jsx)(`span`,{className:`rounded-full bg-amber-500/15 px-2 py-0.5 text-amber-700 dark:text-amber-300`,children:E(`projectsWorkAttention_${e.attention}`)}),e.deletedAt?(0,B.jsx)(`span`,{children:E(`projectsDeleted`)}):null]})]})}function Je({hasNextPage:e,isError:t,isFetchingNextPage:n,isLoading:r,items:i,onLoadMore:a,onOpenWorkItem:o}){return r?(0,B.jsx)(`p`,{className:`py-3 text-xs text-muted-foreground`,children:E(`projectsLoading`)}):t?(0,B.jsx)(`p`,{className:`py-3 text-xs text-destructive`,children:E(`projectsLoadFailed`)}):(0,B.jsxs)(B.Fragment,{children:[i.length?i.map(e=>(0,B.jsx)(qe,{item:e,onOpen:()=>o(e.id)},e.id)):(0,B.jsx)(`p`,{className:`py-3 text-xs text-muted-foreground`,children:E(`projectsNoData`)}),e?(0,B.jsx)(l,{type:`button`,variant:`ghost`,size:`sm`,className:`w-full`,disabled:n,onClick:a,children:E(n?`projectsLoading`:`projectsWorkLoadMore`)}):null]})}function Ye({includeDeleted:e,onOpenWorkItem:t,state:n,startedProgress:r,view:i}){let[a,o]=(0,z.useState)(!1),s=De(n.projectId,{stateId:n.id,includeDeleted:e,limit:20}),c=s.data?.pages.flatMap(e=>e.items)??[],l=s.data?.pages[0]?.total;return(0,B.jsxs)(`section`,{className:i===`board`?`flex h-full min-h-0 min-w-0 flex-col overflow-hidden`:`min-w-0`,"aria-label":$(n.name),children:[(0,B.jsxs)(`button`,{type:`button`,className:`flex w-full shrink-0 items-center gap-2 rounded-lg px-1 py-2 text-left transition-colors hover:bg-[var(--interaction-hover)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,"aria-expanded":!a,onClick:()=>o(e=>!e),children:[a?(0,B.jsx)(ie,{className:`h-4 w-4 shrink-0`}):(0,B.jsx)(k,{className:`h-4 w-4 shrink-0`}),(0,B.jsx)(Ke,{state:n,startedProgress:r}),(0,B.jsx)(`span`,{className:`min-w-0 truncate text-sm font-semibold`,children:$(n.name)}),(0,B.jsx)(`span`,{className:`ml-0.5 shrink-0 text-xs font-medium tabular-nums text-muted-foreground`,children:l??`…`})]}),a?null:(0,B.jsx)(`div`,{className:i===`board`?`min-h-0 flex-1 space-y-2 overflow-y-auto overscroll-contain px-1 pb-3`:`space-y-2 px-1 pb-3`,children:(0,B.jsx)(Je,{hasNextPage:s.hasNextPage,isError:s.isError,isFetchingNextPage:s.isFetchingNextPage,isLoading:s.isLoading,items:c,onLoadMore:()=>void s.fetchNextPage(),onOpenWorkItem:t})})]})}function Xe({onOpenWorkItem:e,projectId:t}){let[n,r]=(0,z.useState)(`list`),[i,a]=(0,z.useState)(!1),[o,c]=(0,z.useState)(``),[u,d]=(0,z.useState)(!1);Z(t);let p=ke(t),m=X(t),h=async()=>{if(o.trim())try{let t=await m.createItem.mutateAsync({title:o.trim()});c(``),e(t.id)}catch(e){f.error(e instanceof Error?e.message:E(`projectsWorkItemCreateFailed`))}};if(p.isLoading)return(0,B.jsx)(`div`,{className:`rounded-xl border border-border/60 p-5 text-sm text-muted-foreground`,children:E(`projectsLoading`)});if(p.isError)return(0,B.jsx)(`div`,{className:`rounded-xl border border-destructive/40 p-5 text-sm text-destructive`,children:E(`projectsLoadFailed`)});let g=Ne(p.data??[]),_=Fe(p.data??[]),v=g.filter(e=>e.category===`started`),y=new Map(v.map((e,t)=>[e.id,(t+1)/(v.length+1)]));return(0,B.jsxs)(`section`,{"aria-label":E(`projectsWork`),className:`min-w-0 space-y-4`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,B.jsxs)(`div`,{className:`flex min-w-[16rem] flex-1 gap-2`,children:[(0,B.jsx)(s,{value:o,onChange:e=>c(e.target.value),onKeyDown:e=>{e.key===`Enter`&&h()},placeholder:E(`projectsWorkNewItem`)}),(0,B.jsxs)(l,{onClick:()=>void h(),disabled:!o.trim()||m.createItem.isPending,children:[(0,B.jsx)(de,{className:`mr-2 h-4 w-4`}),E(`projectsCreate`)]})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-1 rounded-xl bg-muted/40 p-1`,role:`group`,"aria-label":E(`projectsWorkViews`),children:[(0,B.jsxs)(l,{size:`sm`,variant:n===`list`?`secondary`:`ghost`,"aria-pressed":n===`list`,onClick:()=>r(`list`),children:[(0,B.jsx)(we,{className:`mr-2 h-4 w-4`}),E(`projectsWorkList`)]}),(0,B.jsxs)(l,{size:`sm`,variant:n===`board`?`secondary`:`ghost`,"aria-pressed":n===`board`,onClick:()=>r(`board`),children:[(0,B.jsx)(C,{className:`mr-2 h-4 w-4`}),E(`projectsWorkBoard`)]})]}),(0,B.jsxs)(l,{variant:`outline`,size:`sm`,onClick:()=>d(!0),children:[(0,B.jsx)(fe,{className:`mr-2 h-4 w-4`}),E(`projectsWorkStateSettings`)]})]}),(0,B.jsxs)(`label`,{className:`flex w-fit items-center gap-2 text-xs text-muted-foreground`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:i,onChange:e=>a(e.target.checked)}),E(`projectsWorkShowDeleted`)]}),n===`list`?(0,B.jsx)(`div`,{className:`space-y-3`,children:_.map(t=>(0,B.jsx)(Ye,{state:t,startedProgress:y.get(t.id)??null,view:n,includeDeleted:i,onOpenWorkItem:e},t.id))}):null,n===`board`?(0,B.jsx)(`div`,{className:`grid h-[calc(100dvh-17rem)] min-h-[28rem] max-h-[52rem] min-w-0 auto-cols-[minmax(18rem,1fr)] grid-flow-col items-stretch gap-3 overflow-x-auto overflow-y-hidden pb-2`,children:g.map(t=>(0,B.jsx)(Ye,{state:t,startedProgress:y.get(t.id)??null,view:n,includeDeleted:i,onOpenWorkItem:e},t.id))}):null,(0,B.jsx)(Ge,{open:u,onOpenChange:d,projectId:t,states:g})]})}var Ze=e=>[`project-agreement`,e],Qe=e=>[`project-skills`,e];function $e(e){return u({queryKey:Ze(e??``),enabled:!!e,queryFn:async()=>await c.projects.getAgreement(e)})}function et(e){return u({queryKey:Qe(e??``),enabled:!!e,queryFn:async()=>await c.projects.listProjectSkills(e)})}function tt(e){return e===`overview`||e===`work`||e===`artifacts`||e===`skills`||e===`agreement`}var nt=[`overview`,`work`,`artifacts`,`skills`,`agreement`];function rt(){let{projectId:e,tab:t}=a(),n=i(),r=x(),{isMobile:o}=ue(),s=S(),[c,l]=(0,z.useState)(null),u=s.data?.projects??[],d=u.find(t=>t.id===e)??null,f=tt(t)?t:null,p=$e(f===`agreement`?d?.id??null:null),m=et(f===`skills`?d?.id??null:null);if(s.isLoading)return(0,B.jsx)(`main`,{className:`flex h-full items-center justify-center p-6 text-sm text-muted-foreground`,children:E(`projectsLoading`)});if(s.isError)return(0,B.jsxs)(`main`,{className:`p-6 text-sm text-destructive`,children:[E(`projectsLoadFailed`),`: `,s.error.message]});if(!u.length)return(0,B.jsx)(`main`,{className:`p-6 text-sm text-muted-foreground`,children:E(`projectsEmpty`)});if(!d||!f)return(0,B.jsx)(`main`,{className:`p-6 text-sm text-muted-foreground`,children:E(`projectsChoose`)});let h=(e,t)=>r.chatThreadManager.openFilePreview({path:e,label:t,viewMode:`preview`,previewViewer:`rendered`});return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`main`,{className:`h-full min-w-0 flex-1 overflow-y-auto p-3 sm:p-4 md:p-6`,children:(0,B.jsxs)(`div`,{className:`mx-auto max-w-6xl space-y-4`,children:[(0,B.jsxs)(`header`,{className:`rounded-2xl border border-border/60 bg-card p-3 sm:p-4`,children:[(0,B.jsx)(`h1`,{className:`text-lg font-semibold`,children:d.name}),(0,B.jsx)(`p`,{className:`mt-1 break-all text-xs text-muted-foreground`,children:d.rootPath})]}),(0,B.jsxs)(le,{value:f,onValueChange:e=>n(`/projects/${encodeURIComponent(d.id)}/${e}`),children:[(0,B.jsx)(`div`,{className:`min-w-0 overflow-x-auto pb-1`,children:(0,B.jsx)(ce,{className:`w-max`,children:nt.map(e=>(0,B.jsx)(se,{value:e,children:E(`projects${e[0].toUpperCase()}${e.slice(1)}`)},e))})}),(0,B.jsx)(F,{value:`overview`,className:`mt-4`,children:(0,B.jsx)(Be,{projectId:d.id,onOpenArtifact:(e,t)=>h(Q(d.rootPath,e),t),onOpenWorkItem:l})}),(0,B.jsx)(F,{value:`work`,className:`mt-4`,children:(0,B.jsx)(Xe,{projectId:d.id,onOpenWorkItem:l})}),(0,B.jsx)(F,{value:`artifacts`,className:`mt-4`,children:(0,B.jsx)(Re,{projectId:d.id,onOpenFile:(e,t)=>h(Q(d.rootPath,e),t)})}),(0,B.jsx)(F,{value:`skills`,className:`mt-4`,children:(0,B.jsx)(Ve,{skills:m.data??[],isLoading:m.isLoading,isError:m.isError,onOpen:e=>h(Q(d.rootPath,e.path),e.name)})}),(0,B.jsx)(F,{value:`agreement`,className:`mt-4`,children:(0,B.jsx)(Ee,{agreement:p.data,isLoading:p.isLoading,isError:p.isError,onOpenFile:(e,t)=>h(Q(d.rootPath,e),t)})})]})]})}),(0,B.jsx)(He,{projectId:d.id,projectRoot:d.rootPath,workItemId:c,onOpenChange:e=>{e||l(null)},onOpenArtifact:h}),(0,B.jsx)(te,{layoutMode:o?`mobile`:`desktop`,sessionKey:null,projectRoot:d.rootPath})]})}export{rt as ProjectsPage};
1
+ import{i as e}from"./chunk-DF37yw5_.js";import{A as t,M as n,O as r}from"./utils-CBZPzC_b.js";import{d as i,f as a,n as o}from"./navigation-link-BAQjgx2F.js";import{Gt as s,Lt as c,Yt as l,bn as u,jn as d,vn as f,yn as p}from"./api-BWFOIoUm.js";import{C as m,a as h,c as g,i as _,n as v,o as y,r as b,s as ee}from"./mcp-marketplace-page-D75hPmzO.js";import{C as te,H as x,P as S,ct as C,st as ne}from"./app-presenter-provider-CDRBc_lQ.js";import{n as w,r as T,s as E,t as D}from"./i18n-ClHx6jwj.js";import{t as O}from"./createLucideIcon-BNKf0_kc.js";import{h as re}from"./app-data-BnrEdmg2.js";import{t as k}from"./chevron-down-BL-yMYcX.js";import{n as ie}from"./ellipsis-C5YXdOUx.js";import{S as ae,a as A,i as j,n as M,r as N,t as P}from"./select-CG5YWnwe.js";import{t as oe}from"./circle-dashed-CU3yApvP.js";import{i as se,n as F,r as ce,t as le}from"./tabs-BuE0qKMh.js";import{t as ue}from"./use-viewport-layout-BS18drMT.js";import{t as de}from"./plus-LA8-jpxP.js";import{t as fe}from"./settings-2-CE3ELQyk.js";import{t as pe}from"./confirm-dialog-BWS7gA_z.js";import{t as I}from"./trash-2-BPPYt2NV.js";import{a as L,i as me,n as R,o as he,r as ge,t as _e}from"./dialog-Xe73hpQz.js";import{a as ve,i as ye,n as be,t as xe}from"./card-BhfAZv5L.js";var Se=O(`CircleX`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),Ce=O(`Circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),we=O(`List`,[[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 18h.01`,key:`1tta3j`}],[`path`,{d:`M3 6h.01`,key:`1rqtza`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 18h13`,key:`1lx6n3`}],[`path`,{d:`M8 6h13`,key:`ik3vkj`}]]),Te=O(`Unlink`,[[`path`,{d:`m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71`,key:`yqzxt4`}],[`path`,{d:`m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71`,key:`4qinb0`}],[`line`,{x1:`8`,x2:`8`,y1:`2`,y2:`5`,key:`1041cp`}],[`line`,{x1:`2`,x2:`5`,y1:`8`,y2:`8`,key:`14m1p5`}],[`line`,{x1:`16`,x2:`16`,y1:`19`,y2:`22`,key:`rzdirn`}],[`line`,{x1:`19`,x2:`22`,y1:`16`,y2:`16`,key:`ox905f`}]]),z=e(n(),1),B=t();function V({title:e,children:t,className:n=``}){return(0,B.jsxs)(xe,{hover:!1,surface:`flat`,className:n,children:[(0,B.jsx)(ye,{className:`p-4 pb-3`,children:(0,B.jsx)(ve,{children:e})}),(0,B.jsx)(be,{className:`p-4 pt-0`,children:t})]})}function H({children:e}){return(0,B.jsx)(`p`,{className:`py-5 text-sm text-muted-foreground`,children:e})}function U({available:e,children:t,className:n,label:r,onOpen:i,path:a}){return e?(0,B.jsx)(`button`,{type:`button`,className:n,title:a,onClick:()=>i(a,r),children:t}):(0,B.jsx)(`div`,{className:n,children:t})}function Ee({agreement:e,isLoading:t,isError:n,onOpenFile:r}){return(0,B.jsxs)(V,{title:E(`projectsAgreementFile`),children:[(0,B.jsx)(`p`,{className:`mb-4 text-sm text-muted-foreground`,children:E(`projectsAgreementDescription`)}),t?(0,B.jsx)(`p`,{className:`py-5 text-sm text-muted-foreground`,children:E(`projectsLoading`)}):n?(0,B.jsx)(`p`,{className:`py-5 text-sm text-destructive`,children:E(`projectsLoadFailed`)}):e?.available?(0,B.jsxs)(U,{available:!0,path:e.path,label:e.path,onOpen:r,className:`block w-full rounded-xl bg-muted/45 p-3 text-left transition-colors enabled:hover:bg-[var(--interaction-hover)] enabled:focus-visible:outline-none enabled:focus-visible:ring-1 enabled:focus-visible:ring-border`,children:[(0,B.jsx)(`span`,{className:`block text-sm font-medium`,children:e.path}),(0,B.jsx)(`span`,{className:`mt-1 block text-xs text-muted-foreground`,children:E(`projectsAgreementOpen`)})]}):(0,B.jsx)(H,{children:E(`projectsNoAgreement`)})]})}var W=e=>[`project-work`,e],G=e=>[`project-work-summary`,e],K=e=>[`project-work-states`,e],q=e=>[`project-work-artifacts`,e],J=(e,t)=>[`project-work-item`,e,t],Y=(e,t)=>[`project-work-activity`,e,t];function De(e,t={}){return m({queryKey:[...W(e??``),t],enabled:!!e,initialPageParam:null,queryFn:async({pageParam:n})=>await c.projects.listWork(e,{...t,...n?{cursor:n}:{}}),getNextPageParam:e=>e.nextCursor})}function Oe(e){return u({queryKey:G(e??``),enabled:!!e,queryFn:async()=>await c.projects.getWorkSummary(e)})}function ke(e){return u({queryKey:K(e??``),enabled:!!e,queryFn:async()=>await c.projects.listWorkStates(e)})}function Ae(e,t={}){return m({queryKey:[...q(e??``),t],enabled:!!e,initialPageParam:null,queryFn:async({pageParam:n})=>await c.projects.listRecentWorkArtifacts(e,{...t,...n?{cursor:n}:{}}),getNextPageParam:e=>e.nextCursor})}function je(e,t){return u({queryKey:J(e??``,t??``),enabled:!!(e&&t),queryFn:async()=>await c.projects.getWorkItem(e,t)})}function Me(e,t){return u({queryKey:Y(e??``,t??``),enabled:!!(e&&t),queryFn:async()=>await c.projects.listWorkItemActivities(e,t,{limit:100})})}function X(e){let t=d(),n=async n=>{await Promise.all([t.invalidateQueries({queryKey:W(e)}),t.invalidateQueries({queryKey:G(e)}),t.invalidateQueries({queryKey:K(e)}),t.invalidateQueries({queryKey:q(e)}),...n?[t.invalidateQueries({queryKey:J(e,n)}),t.invalidateQueries({queryKey:Y(e,n)})]:[]])};return{createItem:p({mutationFn:async t=>await c.projects.createWorkItem(e,t),onSuccess:async e=>await n(e.id)}),updateItem:p({mutationFn:async t=>await c.projects.updateWorkItem(e,t.workItemId,t.patch),onSuccess:async e=>await n(e.id)}),deleteItem:p({mutationFn:async t=>await c.projects.deleteWorkItem(e,t),onSuccess:async e=>await n(e.id)}),restoreItem:p({mutationFn:async t=>await c.projects.restoreWorkItem(e,t),onSuccess:async e=>await n(e.id)}),linkArtifact:p({mutationFn:async t=>await c.projects.linkWorkItemArtifact(e,t.workItemId,{path:t.path,...t.label?{label:t.label}:{}}),onSuccess:async(e,t)=>await n(t.workItemId)}),unlinkArtifact:p({mutationFn:async t=>await c.projects.unlinkWorkItemArtifact(e,t.workItemId,t.artifactLinkId),onSuccess:async(e,t)=>await n(t.workItemId)}),createState:p({mutationFn:async t=>await c.projects.createWorkState(e,t),onSuccess:async()=>await n()}),updateState:p({mutationFn:async t=>await c.projects.updateWorkState(e,t.stateId,t.patch),onSuccess:async()=>await n()}),deleteState:p({mutationFn:async t=>await c.projects.deleteWorkState(e,t.stateId,t.migrateToStateId),onSuccess:async()=>await n()})}}function Z(e){let t=d();(0,z.useEffect)(()=>{if(e)return c.eventBus.on(r.projectWorkChanged,n=>{n.projectId===e&&(t.invalidateQueries({queryKey:W(e)}),t.invalidateQueries({queryKey:G(e)}),t.invalidateQueries({queryKey:K(e)}),t.invalidateQueries({queryKey:q(e)}),n.workItemId&&(t.invalidateQueries({queryKey:J(e,n.workItemId)}),t.invalidateQueries({queryKey:Y(e,n.workItemId)})))})},[e,t])}function Ne(e){return[...e].sort((e,t)=>e.position-t.position||e.name.localeCompare(t.name))}var Pe={started:0,unstarted:1,backlog:2,completed:3,canceled:4};function Fe(e){return[...e].sort((e,t)=>{let n=Pe[e.category]-Pe[t.category];return n===0?e.category===`completed`||e.category===`canceled`?e.position-t.position||e.name.localeCompare(t.name):t.position-e.position||e.name.localeCompare(t.name):n})}function Q(e,t){return`${e}${e.endsWith(`/`)||e.endsWith(`\\`)?``:`/`}${t}`}function Ie(e,t=new Date){if(!e)return`-`;let n=new Date(e),r=t.getTime()-n.getTime();if(Number.isNaN(n.getTime()))return e;if(r<6e4)return E(`projectsTimeJustNow`);let i=Math.floor(r/6e4);if(i<60)return E(`projectsTimeMinutesAgo`).replace(`{count}`,String(i));let a=Math.floor(i/60);if(a<24)return E(`projectsTimeHoursAgo`).replace(`{count}`,String(a));let o=Math.floor(a/24);return o===1?E(`projectsTimeYesterday`):o<7?E(`projectsTimeDaysAgo`).replace(`{count}`,String(o)):D(e)}var Le=20;function Re({projectId:e,onOpenFile:t}){let[n,r]=(0,z.useState)(``),i=Ae(e,{limit:Le,...n.trim()?{query:n.trim()}:{}}),a=i.data?.pages??[],o=a.flatMap(e=>e.artifacts),s=a[0]?.total??0;return i.isLoading?(0,B.jsx)(`p`,{className:`py-5 text-sm text-muted-foreground`,children:E(`projectsLoading`)}):i.isError?(0,B.jsx)(`p`,{className:`py-5 text-sm text-destructive`,children:E(`projectsLoadFailed`)}):(0,B.jsxs)(`section`,{className:`min-w-0`,"aria-label":E(`projectsArtifacts`),children:[(0,B.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center justify-between gap-3`,children:[(0,B.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[T(s),` `,E(`projectsArtifactsCountSuffix`)]}),(0,B.jsx)(`input`,{type:`search`,value:n,className:`h-8 w-full min-w-0 rounded-lg border border-border/60 bg-transparent px-3 text-sm outline-none placeholder:text-muted-foreground sm:w-60`,placeholder:E(`projectsArtifactsSearchPlaceholder`),onChange:e=>r(e.target.value)})]}),o.length?(0,B.jsxs)(`div`,{className:`overflow-hidden rounded-xl border border-border/60`,children:[(0,B.jsx)(`div`,{className:`divide-y divide-border/60`,children:o.map(e=>(0,B.jsxs)(U,{available:e.exists,path:e.path,label:e.label??e.path,onOpen:t,className:`flex w-full min-w-0 items-center gap-3 px-3 py-3 text-left text-sm transition-colors enabled:hover:bg-[var(--interaction-hover)] enabled:focus-visible:outline-none enabled:focus-visible:ring-1 enabled:focus-visible:ring-border`,children:[(0,B.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`span`,{className:`block truncate font-medium`,children:e.label??e.path}),(0,B.jsxs)(`span`,{className:`mt-1 block truncate text-xs text-muted-foreground`,children:[e.path,` · `,e.workItemTitle]})]}),(0,B.jsx)(`time`,{className:`shrink-0 text-xs text-muted-foreground`,dateTime:e.createdAt,title:w(e.createdAt),children:Ie(e.createdAt)}),e.exists?null:(0,B.jsx)(`span`,{className:`shrink-0 text-xs text-destructive`,children:E(`projectsUnavailable`)})]},e.id))}),i.hasNextPage?(0,B.jsx)(`button`,{type:`button`,className:`w-full border-t border-border/60 px-3 py-2.5 text-left text-sm text-muted-foreground transition-colors hover:bg-[var(--interaction-hover)] hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,disabled:i.isFetchingNextPage,onClick:()=>void i.fetchNextPage(),children:i.isFetchingNextPage?E(`projectsLoading`):E(`projectsArtifactsShowMore`)}):null]}):(0,B.jsx)(H,{children:n.trim()?E(`projectsArtifactsNoMatches`):E(`projectsNoArtifacts`)})]})}var ze={Backlog:`projectsWorkState_backlog`,Planned:`projectsWorkState_planned`,"In Progress":`projectsWorkState_inProgress`,"In Review":`projectsWorkState_inReview`,"Awaiting Acceptance":`projectsWorkState_awaitingAcceptance`,Completed:`projectsWorkState_completed`,Canceled:`projectsWorkState_canceled`};function $(e,t){let n=ze[e];return n?t?E(n,t):E(n):e}function Be({projectId:e,onOpenArtifact:t,onOpenWorkItem:n}){Z(e);let r=Oe(e),i=De(e,{limit:5}),a=Ae(e,{limit:5}),o=a.data?.pages[0]?.artifacts??[],s=i.data?.pages.flatMap(e=>e.items).slice(0,5)??[];return(0,B.jsxs)(`div`,{className:`space-y-5`,children:[(0,B.jsx)(`section`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-4`,"aria-label":E(`projectsWorkSummary`),children:r.data?[[`projectsWorkTotal`,r.data.total],[`projectsWorkActive`,r.data.active],[`projectsWorkNeedsAttention`,r.data.attention],[`projectsWorkCompleted`,r.data.completed]].map(([e,t])=>(0,B.jsxs)(`div`,{className:`rounded-xl border border-border/60 bg-card p-4`,children:[(0,B.jsx)(`div`,{className:`text-2xl font-semibold`,children:t}),(0,B.jsx)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:E(e)})]},e)):(0,B.jsx)(`div`,{className:`col-span-full rounded-xl border border-border/60 p-5 text-sm text-muted-foreground`,children:r.isError?E(`projectsLoadFailed`):E(`projectsLoading`)})}),(0,B.jsxs)(`div`,{className:`grid min-w-0 gap-4 lg:grid-cols-2`,children:[(0,B.jsx)(V,{title:E(`projectsWorkRecentlyUpdated`),children:i.isLoading?(0,B.jsx)(`p`,{className:`py-5 text-sm text-muted-foreground`,children:E(`projectsLoading`)}):i.isError?(0,B.jsx)(`p`,{className:`py-5 text-sm text-destructive`,children:E(`projectsLoadFailed`)}):s.length?(0,B.jsx)(`div`,{className:`space-y-2`,children:s.map(e=>(0,B.jsxs)(`button`,{type:`button`,className:`flex w-full items-center justify-between gap-3 rounded-xl bg-muted/45 px-3 py-3 text-left transition-colors hover:bg-[var(--interaction-hover)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,onClick:()=>n(e.id),children:[(0,B.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium`,children:e.title}),(0,B.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:$(e.state.name)})]},e.id))}):(0,B.jsx)(H,{children:E(`projectsWorkEmpty`)})}),(0,B.jsx)(V,{title:E(`projectsRecentArtifacts`),children:a.isLoading?(0,B.jsx)(`p`,{className:`py-5 text-sm text-muted-foreground`,children:E(`projectsLoading`)}):a.isError?(0,B.jsx)(`p`,{className:`py-5 text-sm text-destructive`,children:E(`projectsLoadFailed`)}):o.length?(0,B.jsx)(`div`,{className:`space-y-2`,children:o.map(e=>(0,B.jsxs)(U,{available:e.exists,path:e.path,label:e.label??e.path,onOpen:t,className:`block w-full rounded-xl bg-muted/45 p-3 text-left text-sm transition-colors enabled:hover:bg-[var(--interaction-hover)] enabled:focus-visible:outline-none enabled:focus-visible:ring-1 enabled:focus-visible:ring-border`,children:[(0,B.jsx)(`span`,{className:`block truncate font-medium`,children:e.label??e.path}),(0,B.jsxs)(`span`,{className:`mt-1 block truncate text-xs text-muted-foreground`,children:[e.workItemTitle,(0,B.jsx)(`time`,{dateTime:e.createdAt,title:w(e.createdAt),children:` · ${Ie(e.createdAt)}`}),e.exists?``:` · ${E(`projectsUnavailable`)}`]})]},e.id))}):(0,B.jsx)(H,{children:E(`projectsNoRecentArtifacts`)})})]})]})}function Ve({skills:e,isLoading:t,isError:n,onOpen:r}){return t?(0,B.jsx)(`p`,{className:`py-5 text-sm text-muted-foreground`,children:E(`projectsLoading`)}):n?(0,B.jsx)(`p`,{className:`py-5 text-sm text-destructive`,children:E(`projectsLoadFailed`)}):(0,B.jsxs)(`section`,{className:`min-w-0`,"aria-label":E(`projectsSkills`),children:[(0,B.jsxs)(`p`,{className:`mb-3 text-sm text-muted-foreground`,children:[T(e.length),` `,E(`projectsSkillsCountSuffix`)]}),e.length?(0,B.jsx)(`div`,{className:`grid min-w-0 gap-3 md:grid-cols-2`,children:e.map(e=>(0,B.jsxs)(`button`,{type:`button`,className:`min-w-0 rounded-xl border border-border/60 p-3 text-left transition-colors hover:border-border hover:bg-muted/30 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,onClick:()=>r(e),children:[(0,B.jsx)(`h3`,{className:`text-sm font-medium`,children:e.name}),(0,B.jsx)(`p`,{className:`mt-1 truncate text-xs text-muted-foreground`,title:e.path,children:e.path}),(0,B.jsx)(`p`,{className:`mt-2 line-clamp-2 text-xs text-muted-foreground`,title:e.description??e.ref,children:e.description??e.ref})]},e.ref))}):(0,B.jsx)(H,{children:E(`projectsNoSkills`)})]})}function He({onOpenArtifact:e,onOpenChange:t,projectId:n,projectRoot:r,workItemId:i}){let a=je(n,i),o=Me(n,i);Z(n);let s=ke(n);return(0,B.jsx)(b,{open:!!i,onOpenChange:t,children:(0,B.jsxs)(_,{side:`right`,closeLabel:E(`projectsCloseDetails`),className:`flex h-full w-full flex-col overflow-hidden p-0 sm:max-w-[680px]`,children:[a.isLoading?(0,B.jsx)(`div`,{className:`p-6 text-sm text-muted-foreground`,children:E(`projectsLoading`)}):null,a.isError?(0,B.jsx)(`div`,{className:`p-6 text-sm text-destructive`,children:E(`projectsWorkItemLoadFailed`)}):null,a.data?(0,B.jsx)(Ue,{item:a.data,states:s.data??[],activities:o.data?.activities??[],onOpenArtifact:(t,n)=>e(Q(r,t),n),onClose:()=>t(!1)},`${a.data.id}:${a.data.version}`):null]})})}function Ue({activities:e,item:t,onClose:n,onOpenArtifact:r,states:i}){let a=X(t.projectId),[c,u]=(0,z.useState)(t.title),[d,p]=(0,z.useState)(t.description),[m,_]=(0,z.useState)(t.stateId),[b,te]=(0,z.useState)(t.attention),[x,S]=(0,z.useState)(``),[C,w]=(0,z.useState)(``),[T,D]=(0,z.useState)(!1),O=async(e,t)=>{try{await e(),t?.()}catch(e){f.error(e instanceof Error?e.message:E(`projectsWorkActionFailed`))}},re=async()=>{try{await a.updateItem.mutateAsync({workItemId:t.id,patch:{title:c,description:d,stateId:m,attention:b,expectedVersion:t.version}}),f.success(E(`projectsWorkItemSaved`))}catch(e){f.error(e instanceof Error?e.message:E(`projectsWorkItemSaveFailed`))}},k=async()=>{if(x.trim())try{await a.linkArtifact.mutateAsync({workItemId:t.id,path:x.trim(),...C.trim()?{label:C.trim()}:{}}),S(``),w(``)}catch(e){f.error(e instanceof Error?e.message:E(`projectsWorkArtifactLinkFailed`))}};return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(ee,{className:`shrink-0 border-b border-border/60 px-5 pb-5 pt-6 pr-14 sm:px-7 sm:pt-7`,children:[(0,B.jsx)(g,{children:E(`projectsWorkDetails`)}),(0,B.jsxs)(h,{children:[t.id,` · `,E(`projectsWorkVersion`),` `,t.version]})]}),(0,B.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-6 overflow-y-auto px-5 py-6 sm:px-7`,children:[(0,B.jsxs)(`section`,{className:`space-y-3`,children:[(0,B.jsx)(`label`,{className:`block text-xs font-medium text-muted-foreground`,children:E(`projectsWorkTitle`)}),(0,B.jsx)(s,{value:c,onChange:e=>u(e.target.value)}),(0,B.jsx)(`label`,{className:`block text-xs font-medium text-muted-foreground`,children:E(`projectsWorkDescription`)}),(0,B.jsx)(v,{className:`min-h-28`,value:d,onChange:e=>p(e.target.value)}),(0,B.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`label`,{className:`mb-1 block text-xs font-medium text-muted-foreground`,children:E(`projectsStatus`)}),(0,B.jsxs)(P,{value:m,onValueChange:_,children:[(0,B.jsx)(j,{children:(0,B.jsx)(A,{})}),(0,B.jsx)(M,{children:i.map(e=>(0,B.jsx)(N,{value:e.id,children:$(e.name)},e.id))})]})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`label`,{className:`mb-1 block text-xs font-medium text-muted-foreground`,children:E(`projectsWorkAttention`)}),(0,B.jsxs)(P,{value:b,onValueChange:e=>te(e),children:[(0,B.jsx)(j,{children:(0,B.jsx)(A,{})}),(0,B.jsxs)(M,{children:[(0,B.jsx)(N,{value:`none`,children:E(`projectsWorkAttention_none`)}),(0,B.jsx)(N,{value:`blocked`,children:E(`projectsWorkAttention_blocked`)}),(0,B.jsx)(N,{value:`awaiting-user`,children:E(`projectsWorkAttention_awaiting-user`)})]})]})]})]})]}),(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h3`,{className:`mb-3 text-sm font-semibold`,children:E(`projectsWorkArtifacts`)}),(0,B.jsxs)(`div`,{className:`space-y-2`,children:[t.artifacts.map(e=>(0,B.jsxs)(`div`,{className:`flex items-center gap-2 rounded-xl border border-border/60 p-2`,children:[(0,B.jsxs)(`button`,{type:`button`,className:`min-w-0 flex-1 rounded-lg px-2 py-1 text-left hover:bg-[var(--interaction-hover)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,onClick:()=>r(e.path,e.label??e.path),children:[(0,B.jsxs)(`span`,{className:`flex items-center gap-2 truncate text-sm font-medium`,children:[(0,B.jsx)(o,{className:`h-3.5 w-3.5 shrink-0`}),e.label??e.path]}),(0,B.jsx)(`span`,{className:`block truncate text-xs text-muted-foreground`,children:e.path})]}),(0,B.jsx)(l,{size:`icon`,variant:`ghost`,"aria-label":E(`projectsWorkUnlinkArtifact`),onClick:()=>void O(()=>a.unlinkArtifact.mutateAsync({workItemId:t.id,artifactLinkId:e.id})),children:(0,B.jsx)(Te,{className:`h-4 w-4`})})]},e.id)),t.artifacts.length?null:(0,B.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:E(`projectsWorkNoArtifacts`)})]}),(0,B.jsxs)(`div`,{className:`mt-3 grid gap-2 sm:grid-cols-[1fr_12rem_auto]`,children:[(0,B.jsx)(s,{value:x,onChange:e=>S(e.target.value),placeholder:E(`projectsWorkArtifactPath`)}),(0,B.jsx)(s,{value:C,onChange:e=>w(e.target.value),placeholder:E(`projectsWorkArtifactLabel`)}),(0,B.jsxs)(l,{variant:`outline`,onClick:()=>void k(),disabled:!x.trim()||a.linkArtifact.isPending,children:[(0,B.jsx)(ne,{className:`mr-2 h-4 w-4`}),E(`projectsWorkLinkArtifact`)]})]})]}),(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h3`,{className:`mb-3 text-sm font-semibold`,children:E(`projectsActivity`)}),(0,B.jsx)(`ol`,{className:`space-y-2`,children:e.map(e=>(0,B.jsxs)(`li`,{className:`rounded-xl bg-muted/35 px-3 py-2 text-sm`,children:[(0,B.jsx)(`span`,{className:`font-medium`,children:E(`projectsWorkActivity_${e.type}`)}),(0,B.jsxs)(`span`,{className:`ml-2 text-xs text-muted-foreground`,children:[e.actor.kind,` ·`,` `,new Date(e.createdAt).toLocaleString()]})]},e.id))})]})]}),(0,B.jsxs)(y,{className:`shrink-0 border-t border-border/60 bg-background px-5 py-4 sm:px-7`,children:[t.deletedAt?(0,B.jsx)(l,{variant:`outline`,onClick:()=>void O(()=>a.restoreItem.mutateAsync(t.id)),children:E(`projectsRestore`)}):(0,B.jsxs)(l,{variant:`destructive`,onClick:()=>D(!0),children:[(0,B.jsx)(I,{className:`mr-2 h-4 w-4`}),E(`projectsDelete`)]}),(0,B.jsx)(l,{onClick:()=>void re(),disabled:!c.trim()||a.updateItem.isPending,children:E(`save`)})]}),(0,B.jsx)(pe,{open:T,onOpenChange:D,title:E(`projectsDeleteWorkItem`),description:E(`projectsDeleteWorkItemDescription`),confirmLabel:E(`projectsDelete`),variant:`destructive`,onCancel:()=>D(!1),onConfirm:()=>void O(()=>a.deleteItem.mutateAsync(t.id),n)})]})}var We=[`backlog`,`unstarted`,`started`,`completed`,`canceled`];function Ge({open:e,onOpenChange:t,projectId:n,states:r}){let i=X(n),a=Ne(r),[o,c]=(0,z.useState)(``),[u,d]=(0,z.useState)(`unstarted`),[p,m]=(0,z.useState)(null),[h,g]=(0,z.useState)(``),_=async e=>{try{await e()}catch(e){f.error(e instanceof Error?e.message:E(`projectsWorkActionFailed`))}},v=async()=>{o.trim()&&await _(async()=>{await i.createState.mutateAsync({name:o.trim(),category:u}),c(``)})},y=async(e,t)=>{let n=a[e],r=a[e+t];!n||!r||await _(async()=>{await i.updateState.mutateAsync({stateId:n.id,patch:{position:r.position}}),await i.updateState.mutateAsync({stateId:r.id,patch:{position:n.position}})})};return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(_e,{open:e,onOpenChange:t,children:(0,B.jsxs)(R,{className:`max-h-[85vh] overflow-y-auto sm:max-w-2xl`,children:[(0,B.jsxs)(L,{children:[(0,B.jsx)(he,{children:E(`projectsWorkStateSettings`)}),(0,B.jsx)(ge,{children:E(`projectsWorkStateSettingsDescription`)})]}),(0,B.jsx)(`div`,{className:`space-y-2`,children:a.map((e,t)=>(0,B.jsxs)(`div`,{className:`grid gap-2 rounded-xl border border-border/60 p-3 sm:grid-cols-[1fr_11rem_auto]`,children:[(0,B.jsx)(s,{"aria-label":E(`projectsWorkStateName`),defaultValue:$(e.name),onBlur:t=>{let n=t.currentTarget.value.trim();n&&n!==$(e.name)&&_(()=>i.updateState.mutateAsync({stateId:e.id,patch:{name:n}}))}}),(0,B.jsxs)(P,{value:e.category,onValueChange:t=>void _(()=>i.updateState.mutateAsync({stateId:e.id,patch:{category:t}})),children:[(0,B.jsx)(j,{"aria-label":E(`projectsWorkStateCategory`),children:(0,B.jsx)(A,{})}),(0,B.jsx)(M,{children:We.map(e=>(0,B.jsx)(N,{value:e,children:E(`projectsWorkCategory_${e}`)},e))})]}),(0,B.jsxs)(`div`,{className:`flex items-center justify-end gap-1`,children:[(0,B.jsx)(l,{size:`icon`,variant:`ghost`,"aria-label":E(`projectsMoveUp`),disabled:t===0,onClick:()=>void y(t,-1),children:(0,B.jsx)(ae,{className:`h-4 w-4`})}),(0,B.jsx)(l,{size:`icon`,variant:`ghost`,"aria-label":E(`projectsMoveDown`),disabled:t===a.length-1,onClick:()=>void y(t,1),children:(0,B.jsx)(k,{className:`h-4 w-4`})}),(0,B.jsx)(l,{size:`icon`,variant:`ghost`,"aria-label":E(`projectsDeleteState`),disabled:a.length<=1,onClick:()=>{m(e),g(``)},children:(0,B.jsx)(I,{className:`h-4 w-4`})})]}),(0,B.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-muted-foreground sm:col-span-3`,children:[(0,B.jsx)(`input`,{type:`radio`,name:`default-state`,checked:e.isDefault,onChange:()=>void _(()=>i.updateState.mutateAsync({stateId:e.id,patch:{isDefault:!0}}))}),E(`projectsWorkDefaultState`)]})]},e.id))}),(0,B.jsxs)(`div`,{className:`grid gap-2 border-t border-border/60 pt-4 sm:grid-cols-[1fr_11rem_auto]`,children:[(0,B.jsx)(s,{value:o,onChange:e=>c(e.target.value),placeholder:E(`projectsWorkNewState`)}),(0,B.jsxs)(P,{value:u,onValueChange:e=>d(e),children:[(0,B.jsx)(j,{children:(0,B.jsx)(A,{})}),(0,B.jsx)(M,{children:We.map(e=>(0,B.jsx)(N,{value:e,children:E(`projectsWorkCategory_${e}`)},e))})]}),(0,B.jsxs)(l,{onClick:()=>void v(),disabled:!o.trim()||i.createState.isPending,children:[(0,B.jsx)(de,{className:`mr-2 h-4 w-4`}),E(`projectsAdd`)]})]})]})}),(0,B.jsx)(_e,{open:!!p,onOpenChange:e=>{e||m(null)},children:(0,B.jsxs)(R,{children:[(0,B.jsxs)(L,{children:[(0,B.jsx)(he,{children:E(`projectsDeleteState`)}),(0,B.jsx)(ge,{children:E(`projectsDeleteStateDescription`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`mb-2 text-xs text-muted-foreground`,children:E(`projectsWorkStateMigration`)}),(0,B.jsxs)(P,{value:h,onValueChange:g,children:[(0,B.jsx)(j,{children:(0,B.jsx)(A,{placeholder:E(`projectsWorkStateMigrationOptional`)})}),(0,B.jsx)(M,{children:a.filter(e=>e.id!==p?.id).map(e=>(0,B.jsx)(N,{value:e.id,children:$(e.name)},e.id))})]})]}),(0,B.jsxs)(me,{children:[(0,B.jsx)(l,{variant:`outline`,onClick:()=>m(null),children:E(`cancel`)}),(0,B.jsx)(l,{variant:`destructive`,onClick:()=>{p&&_(async()=>{await i.deleteState.mutateAsync({stateId:p.id,migrateToStateId:h||null}),m(null)})},children:E(`projectsDelete`)})]})]})})]})}function Ke({startedProgress:e,state:t}){if(t.category===`backlog`)return(0,B.jsx)(`span`,{"aria-hidden":`true`,"data-state-visual":`backlog`,className:`inline-flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground/65`,children:(0,B.jsx)(oe,{className:`h-4 w-4`})});if(t.category===`unstarted`)return(0,B.jsx)(`span`,{"aria-hidden":`true`,"data-state-visual":`unstarted`,className:`inline-flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground`,children:(0,B.jsx)(Ce,{className:`h-4 w-4`,strokeWidth:2})});if(t.category===`completed`)return(0,B.jsx)(`span`,{"aria-hidden":`true`,"data-state-visual":`completed`,className:`inline-flex h-4 w-4 shrink-0 items-center justify-center text-emerald-600 dark:text-emerald-400`,children:(0,B.jsx)(re,{className:`h-4 w-4`,strokeWidth:2.25})});if(t.category===`canceled`)return(0,B.jsx)(`span`,{"aria-hidden":`true`,"data-state-visual":`canceled`,className:`inline-flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground/65`,children:(0,B.jsx)(Se,{className:`h-4 w-4`})});let n=Math.round((e??.5)*100),r=n>=67?`text-emerald-600 dark:text-emerald-400`:n>=40?`text-orange-500 dark:text-orange-400`:`text-amber-500 dark:text-amber-400`;return(0,B.jsx)(`span`,{"aria-hidden":`true`,"data-state-visual":`started`,className:`inline-flex h-4 w-4 shrink-0 items-center justify-center ${r}`,children:(0,B.jsxs)(`svg`,{className:`h-4 w-4`,viewBox:`0 0 16 16`,fill:`none`,children:[(0,B.jsx)(`circle`,{cx:`8`,cy:`8`,r:`5.5`,stroke:`currentColor`,strokeWidth:`1.75`,opacity:`0.22`}),(0,B.jsx)(`circle`,{cx:`8`,cy:`8`,r:`5.5`,pathLength:`100`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeDasharray:`${n} ${100-n}`,transform:`rotate(-90 8 8)`})]})})}function qe({item:e,onOpen:t}){return(0,B.jsxs)(`button`,{type:`button`,className:`w-full rounded-xl border border-border/50 bg-card p-3 text-left text-sm shadow-sm transition-colors hover:bg-[var(--interaction-hover)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,onClick:t,children:[(0,B.jsx)(`span`,{className:`block font-medium`,children:e.title}),(0,B.jsxs)(`span`,{className:`mt-1 flex flex-wrap items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,B.jsx)(`span`,{children:$(e.state.name)}),e.attention===`none`?null:(0,B.jsx)(`span`,{className:`rounded-full bg-amber-500/15 px-2 py-0.5 text-amber-700 dark:text-amber-300`,children:E(`projectsWorkAttention_${e.attention}`)}),e.deletedAt?(0,B.jsx)(`span`,{children:E(`projectsDeleted`)}):null]})]})}function Je({hasNextPage:e,isError:t,isFetchingNextPage:n,isLoading:r,items:i,onLoadMore:a,onOpenWorkItem:o}){return r?(0,B.jsx)(`p`,{className:`py-3 text-xs text-muted-foreground`,children:E(`projectsLoading`)}):t?(0,B.jsx)(`p`,{className:`py-3 text-xs text-destructive`,children:E(`projectsLoadFailed`)}):(0,B.jsxs)(B.Fragment,{children:[i.length?i.map(e=>(0,B.jsx)(qe,{item:e,onOpen:()=>o(e.id)},e.id)):(0,B.jsx)(`p`,{className:`py-3 text-xs text-muted-foreground`,children:E(`projectsNoData`)}),e?(0,B.jsx)(l,{type:`button`,variant:`ghost`,size:`sm`,className:`w-full`,disabled:n,onClick:a,children:E(n?`projectsLoading`:`projectsWorkLoadMore`)}):null]})}function Ye({includeDeleted:e,onOpenWorkItem:t,state:n,startedProgress:r,view:i}){let[a,o]=(0,z.useState)(!1),s=De(n.projectId,{stateId:n.id,includeDeleted:e,limit:20}),c=s.data?.pages.flatMap(e=>e.items)??[],l=s.data?.pages[0]?.total;return(0,B.jsxs)(`section`,{className:i===`board`?`flex h-full min-h-0 min-w-0 flex-col overflow-hidden`:`min-w-0`,"aria-label":$(n.name),children:[(0,B.jsxs)(`button`,{type:`button`,className:`flex w-full shrink-0 items-center gap-2 rounded-lg px-1 py-2 text-left transition-colors hover:bg-[var(--interaction-hover)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,"aria-expanded":!a,onClick:()=>o(e=>!e),children:[a?(0,B.jsx)(ie,{className:`h-4 w-4 shrink-0`}):(0,B.jsx)(k,{className:`h-4 w-4 shrink-0`}),(0,B.jsx)(Ke,{state:n,startedProgress:r}),(0,B.jsx)(`span`,{className:`min-w-0 truncate text-sm font-semibold`,children:$(n.name)}),(0,B.jsx)(`span`,{className:`ml-0.5 shrink-0 text-xs font-medium tabular-nums text-muted-foreground`,children:l??`…`})]}),a?null:(0,B.jsx)(`div`,{className:i===`board`?`min-h-0 flex-1 space-y-2 overflow-y-auto overscroll-contain px-1 pb-3`:`space-y-2 px-1 pb-3`,children:(0,B.jsx)(Je,{hasNextPage:s.hasNextPage,isError:s.isError,isFetchingNextPage:s.isFetchingNextPage,isLoading:s.isLoading,items:c,onLoadMore:()=>void s.fetchNextPage(),onOpenWorkItem:t})})]})}function Xe({onOpenWorkItem:e,projectId:t}){let[n,r]=(0,z.useState)(`list`),[i,a]=(0,z.useState)(!1),[o,c]=(0,z.useState)(``),[u,d]=(0,z.useState)(!1);Z(t);let p=ke(t),m=X(t),h=async()=>{if(o.trim())try{let t=await m.createItem.mutateAsync({title:o.trim()});c(``),e(t.id)}catch(e){f.error(e instanceof Error?e.message:E(`projectsWorkItemCreateFailed`))}};if(p.isLoading)return(0,B.jsx)(`div`,{className:`rounded-xl border border-border/60 p-5 text-sm text-muted-foreground`,children:E(`projectsLoading`)});if(p.isError)return(0,B.jsx)(`div`,{className:`rounded-xl border border-destructive/40 p-5 text-sm text-destructive`,children:E(`projectsLoadFailed`)});let g=Ne(p.data??[]),_=Fe(p.data??[]),v=g.filter(e=>e.category===`started`),y=new Map(v.map((e,t)=>[e.id,(t+1)/(v.length+1)]));return(0,B.jsxs)(`section`,{"aria-label":E(`projectsWork`),className:`min-w-0 space-y-4`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,B.jsxs)(`div`,{className:`flex min-w-[16rem] flex-1 gap-2`,children:[(0,B.jsx)(s,{value:o,onChange:e=>c(e.target.value),onKeyDown:e=>{e.key===`Enter`&&h()},placeholder:E(`projectsWorkNewItem`)}),(0,B.jsxs)(l,{onClick:()=>void h(),disabled:!o.trim()||m.createItem.isPending,children:[(0,B.jsx)(de,{className:`mr-2 h-4 w-4`}),E(`projectsCreate`)]})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-1 rounded-xl bg-muted/40 p-1`,role:`group`,"aria-label":E(`projectsWorkViews`),children:[(0,B.jsxs)(l,{size:`sm`,variant:n===`list`?`secondary`:`ghost`,"aria-pressed":n===`list`,onClick:()=>r(`list`),children:[(0,B.jsx)(we,{className:`mr-2 h-4 w-4`}),E(`projectsWorkList`)]}),(0,B.jsxs)(l,{size:`sm`,variant:n===`board`?`secondary`:`ghost`,"aria-pressed":n===`board`,onClick:()=>r(`board`),children:[(0,B.jsx)(C,{className:`mr-2 h-4 w-4`}),E(`projectsWorkBoard`)]})]}),(0,B.jsxs)(l,{variant:`outline`,size:`sm`,onClick:()=>d(!0),children:[(0,B.jsx)(fe,{className:`mr-2 h-4 w-4`}),E(`projectsWorkStateSettings`)]})]}),(0,B.jsxs)(`label`,{className:`flex w-fit items-center gap-2 text-xs text-muted-foreground`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:i,onChange:e=>a(e.target.checked)}),E(`projectsWorkShowDeleted`)]}),n===`list`?(0,B.jsx)(`div`,{className:`space-y-3`,children:_.map(t=>(0,B.jsx)(Ye,{state:t,startedProgress:y.get(t.id)??null,view:n,includeDeleted:i,onOpenWorkItem:e},t.id))}):null,n===`board`?(0,B.jsx)(`div`,{className:`grid h-[calc(100dvh-17rem)] min-h-[28rem] max-h-[52rem] min-w-0 auto-cols-[minmax(18rem,1fr)] grid-flow-col items-stretch gap-3 overflow-x-auto overflow-y-hidden pb-2`,children:g.map(t=>(0,B.jsx)(Ye,{state:t,startedProgress:y.get(t.id)??null,view:n,includeDeleted:i,onOpenWorkItem:e},t.id))}):null,(0,B.jsx)(Ge,{open:u,onOpenChange:d,projectId:t,states:g})]})}var Ze=e=>[`project-agreement`,e],Qe=e=>[`project-skills`,e];function $e(e){return u({queryKey:Ze(e??``),enabled:!!e,queryFn:async()=>await c.projects.getAgreement(e)})}function et(e){return u({queryKey:Qe(e??``),enabled:!!e,queryFn:async()=>await c.projects.listProjectSkills(e)})}function tt(e){return e===`overview`||e===`work`||e===`artifacts`||e===`skills`||e===`agreement`}var nt=[`overview`,`work`,`artifacts`,`skills`,`agreement`];function rt(){let{projectId:e,tab:t}=a(),n=i(),r=x(),{isMobile:o}=ue(),s=S(),[c,l]=(0,z.useState)(null),u=s.data?.projects??[],d=u.find(t=>t.id===e)??null,f=tt(t)?t:null,p=$e(f===`agreement`?d?.id??null:null),m=et(f===`skills`?d?.id??null:null);if(s.isLoading)return(0,B.jsx)(`main`,{className:`flex h-full items-center justify-center p-6 text-sm text-muted-foreground`,children:E(`projectsLoading`)});if(s.isError)return(0,B.jsxs)(`main`,{className:`p-6 text-sm text-destructive`,children:[E(`projectsLoadFailed`),`: `,s.error.message]});if(!u.length)return(0,B.jsx)(`main`,{className:`p-6 text-sm text-muted-foreground`,children:E(`projectsEmpty`)});if(!d||!f)return(0,B.jsx)(`main`,{className:`p-6 text-sm text-muted-foreground`,children:E(`projectsChoose`)});let h=(e,t)=>r.chatThreadManager.openFilePreview({path:e,label:t,viewMode:`preview`,previewViewer:`rendered`});return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`main`,{className:`h-full min-w-0 flex-1 overflow-y-auto p-3 sm:p-4 md:p-6`,children:(0,B.jsxs)(`div`,{className:`mx-auto max-w-6xl space-y-4`,children:[(0,B.jsxs)(`header`,{className:`rounded-2xl border border-border/60 bg-card p-3 sm:p-4`,children:[(0,B.jsx)(`h1`,{className:`text-lg font-semibold`,children:d.name}),(0,B.jsx)(`p`,{className:`mt-1 break-all text-xs text-muted-foreground`,children:d.rootPath})]}),(0,B.jsxs)(le,{value:f,onValueChange:e=>n(`/projects/${encodeURIComponent(d.id)}/${e}`),children:[(0,B.jsx)(`div`,{className:`min-w-0 overflow-x-auto pb-1`,children:(0,B.jsx)(ce,{className:`w-max`,children:nt.map(e=>(0,B.jsx)(se,{value:e,children:E(`projects${e[0].toUpperCase()}${e.slice(1)}`)},e))})}),(0,B.jsx)(F,{value:`overview`,className:`mt-4`,children:(0,B.jsx)(Be,{projectId:d.id,onOpenArtifact:(e,t)=>h(Q(d.rootPath,e),t),onOpenWorkItem:l})}),(0,B.jsx)(F,{value:`work`,className:`mt-4`,children:(0,B.jsx)(Xe,{projectId:d.id,onOpenWorkItem:l})}),(0,B.jsx)(F,{value:`artifacts`,className:`mt-4`,children:(0,B.jsx)(Re,{projectId:d.id,onOpenFile:(e,t)=>h(Q(d.rootPath,e),t)})}),(0,B.jsx)(F,{value:`skills`,className:`mt-4`,children:(0,B.jsx)(Ve,{skills:m.data??[],isLoading:m.isLoading,isError:m.isError,onOpen:e=>h(Q(d.rootPath,e.path),e.name)})}),(0,B.jsx)(F,{value:`agreement`,className:`mt-4`,children:(0,B.jsx)(Ee,{agreement:p.data,isLoading:p.isLoading,isError:p.isError,onOpenFile:(e,t)=>h(Q(d.rootPath,e),t)})})]})]})}),(0,B.jsx)(He,{projectId:d.id,projectRoot:d.rootPath,workItemId:c,onOpenChange:e=>{e||l(null)},onOpenArtifact:h}),(0,B.jsx)(te,{layoutMode:o?`mobile`:`desktop`,sessionKey:null,projectRoot:d.rootPath})]})}export{rt as ProjectsPage};
@@ -1 +1 @@
1
- import{i as e}from"./chunk-DF37yw5_.js";import{A as t,M as n,t as r}from"./utils-CBZPzC_b.js";import{Gt as i}from"./api-Dffeij78.js";import{s as a}from"./i18n-CPjq_hQX.js";import{t as o}from"./createLucideIcon-BNKf0_kc.js";import{n as s}from"./chevron-down-BL-yMYcX.js";import{a as c,i as l,n as u,r as d,t as f}from"./select-CG5YWnwe.js";import{a as p,n as m,r as h,t as g}from"./popover-NkrFlWHp.js";import{f as _,i as v,r as y}from"./provider-models-5PGHb6mP.js";var b=o(`ChevronsUpDown`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),x=e(n(),1),S=t(),C=p(`15rem`);function w(e){return[...new Set(e.map(e=>e.trim()).filter(Boolean))]}function T({id:e,value:t,onChange:n,options:a,disabled:o=!1,placeholder:c,className:l,inputClassName:u,emptyText:d,createText:f,toggleLabel:p,maxItems:_=1/0,onEnter:v}){let[y,T]=(0,x.useState)(!1),E=(0,x.useRef)(null);(0,x.useEffect)(()=>{o&&y&&T(!1)},[o,y]);let D=(0,x.useMemo)(()=>w(a),[a]),O=t.trim().toLowerCase(),k=(0,x.useMemo)(()=>{let e=D.map((e,t)=>({option:e,index:t}));O.length>0&&e.sort((e,t)=>{let n=e.option.toLowerCase(),r=t.option.toLowerCase(),i=n===O?0:n.startsWith(O)?1:n.includes(O)?2:3,a=r===O?0:r.startsWith(O)?1:r.includes(O)?2:3;return i===a?e.index-t.index:i-a});let t=e.map(e=>e.option);return Number.isFinite(_)?t.slice(0,Math.max(1,_)):t},[D,O,_]),A=t.trim().length>0&&D.some(e=>e===t.trim()),j=()=>T(!1);return(0,S.jsxs)(g,{open:y&&!o,onOpenChange:e=>T(!o&&e),children:[(0,S.jsx)(m,{asChild:!0,children:(0,S.jsxs)(`div`,{ref:E,className:r(`relative`,l),children:[(0,S.jsx)(i,{id:e,value:t,disabled:o,onFocus:()=>{o||T(!0)},onChange:e=>{n(e.target.value),!y&&!o&&T(!0)},onKeyDown:e=>{e.key===`Enter`&&(v&&(e.preventDefault(),v()),j())},placeholder:c,className:r(`pr-10`,u)}),(0,S.jsx)(`button`,{type:`button`,onMouseDown:e=>e.preventDefault(),onClick:()=>T(e=>!e),disabled:o,className:r(`absolute inset-y-0 right-0 inline-flex w-10 items-center justify-center`,o?`cursor-not-allowed text-gray-300`:`text-gray-400 hover:text-gray-600`),"aria-label":p,children:(0,S.jsx)(b,{className:`h-4 w-4`})})]})}),(0,S.jsx)(h,{align:`start`,className:`flex w-[var(--radix-popover-trigger-width)] min-w-[12rem] flex-col overflow-hidden rounded-xl border border-gray-200 p-0 shadow-lg`,onInteractOutside:e=>{e.target instanceof Node&&E.current?.contains(e.target)&&e.preventDefault()},onOpenAutoFocus:e=>e.preventDefault(),style:{maxHeight:C},children:(0,S.jsxs)(`div`,{className:`custom-scrollbar min-h-0 flex-1 overflow-y-auto py-1`,children:[!A&&t.trim().length>0&&(0,S.jsxs)(`button`,{type:`button`,onMouseDown:e=>e.preventDefault(),onClick:()=>{n(t.trim()),j()},className:`flex w-full items-center gap-2 px-3 py-2 text-left text-sm hover:bg-gray-50`,children:[(0,S.jsx)(s,{className:`h-4 w-4 text-transparent`}),(0,S.jsx)(`span`,{className:`truncate text-gray-700`,children:f.replace(`{value}`,t.trim())})]}),k.map(e=>(0,S.jsxs)(`button`,{type:`button`,onMouseDown:e=>e.preventDefault(),onClick:()=>{n(e),j()},className:`flex w-full items-center gap-2 px-3 py-2 text-left text-sm hover:bg-gray-50`,children:[(0,S.jsx)(s,{className:r(`h-4 w-4`,e===t.trim()?`text-primary`:`text-transparent`)}),(0,S.jsx)(`span`,{className:`truncate text-gray-700`,children:e})]},e)),k.length===0&&t.trim().length===0&&(0,S.jsx)(`div`,{className:`px-3 py-2 text-sm text-gray-500`,children:d})]})})]})}var E=`provider/model`;function D(e){let t=new Set;for(let n of e){let e=n.trim();e&&t.add(e)}return[...t]}function O({id:e,value:t,onChange:n,providerCatalog:r,disabled:o=!1,providerPlaceholder:s,modelPlaceholder:p,className:m}){let[h,g]=(0,x.useState)(``),[b,C]=(0,x.useState)(``),w=r.length>0,O=p??E,k=(0,x.useMemo)(()=>new Map(r.map(e=>[e.name,e])),[r]),A=k.get(h),j=(0,x.useMemo)(()=>A?.aliases??[],[A]),M=(0,x.useMemo)(()=>D(A?.models??[]),[A]);return(0,x.useEffect)(()=>{let e=t.trim();if(!w){g(``),C(e);return}if(!e){C(``),g(e=>k.has(e)?e:``);return}let n=v(e,r)??``,i=k.get(n)?.aliases??[];g(n),C(n?_(e,i):e)},[w,r,k,t]),w?(0,S.jsxs)(`div`,{className:m,children:[(0,S.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center`,children:[(0,S.jsx)(`div`,{className:`sm:w-[38%] sm:min-w-[170px]`,children:(0,S.jsxs)(f,{value:h,onValueChange:e=>{let t=D(k.get(e)?.models??[])[0]??``;if(g(e),C(t),!t){n(``);return}n(y(k.get(e)?.prefix??e,t))},disabled:o,children:[(0,S.jsx)(l,{className:`h-10 w-full rounded-xl`,children:(0,S.jsx)(c,{placeholder:s??a(`providersSelectPlaceholder`)})}),(0,S.jsx)(u,{children:r.map(e=>(0,S.jsx)(d,{value:e.name,children:e.displayName},e.name))})]})}),(0,S.jsx)(`span`,{className:`hidden h-10 items-center justify-center leading-none text-lg font-semibold text-gray-300 sm:inline-flex`,children:`/`}),(0,S.jsx)(T,{id:e,value:b,onChange:e=>{if(!A){let t=e.trim();C(t),n(t);return}let t=_(e,j);C(t),n(t?y(A.prefix,t):``)},options:M,disabled:o||!h,placeholder:O,className:`sm:flex-1`,inputClassName:`h-10 rounded-xl`,emptyText:a(`modelPickerNoOptions`),createText:a(`modelPickerUseCustom`),toggleLabel:a(`modelPickerToggleOptions`)},h)]}),(0,S.jsx)(`p`,{className:`mt-2 text-xs text-gray-500`,children:a(`modelInputCustomHint`)})]}):(0,S.jsxs)(`div`,{className:m,children:[(0,S.jsxs)(`div`,{className:`rounded-2xl border border-amber-200 bg-amber-50/70 px-4 py-3`,children:[(0,S.jsx)(`p`,{className:`text-sm font-semibold text-amber-950`,children:a(`providersEmptyTitle`)}),(0,S.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-amber-900`,children:a(`providersEmptyDescription`)})]}),(0,S.jsx)(i,{id:e,value:t,disabled:o,onChange:e=>n(e.target.value),placeholder:O,className:`mt-3 h-10 rounded-xl`}),(0,S.jsx)(`p`,{className:`mt-2 text-xs text-gray-500`,children:a(`modelInputCustomHint`)})]})}export{O as t};
1
+ import{i as e}from"./chunk-DF37yw5_.js";import{A as t,M as n,t as r}from"./utils-CBZPzC_b.js";import{Gt as i}from"./api-BWFOIoUm.js";import{s as a}from"./i18n-ClHx6jwj.js";import{t as o}from"./createLucideIcon-BNKf0_kc.js";import{n as s}from"./chevron-down-BL-yMYcX.js";import{a as c,i as l,n as u,r as d,t as f}from"./select-CG5YWnwe.js";import{a as p,n as m,r as h,t as g}from"./popover-NkrFlWHp.js";import{f as _,i as v,r as y}from"./provider-models-hrHMcHqg.js";var b=o(`ChevronsUpDown`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),x=e(n(),1),S=t(),C=p(`15rem`);function w(e){return[...new Set(e.map(e=>e.trim()).filter(Boolean))]}function T({id:e,value:t,onChange:n,options:a,disabled:o=!1,placeholder:c,className:l,inputClassName:u,emptyText:d,createText:f,toggleLabel:p,maxItems:_=1/0,onEnter:v}){let[y,T]=(0,x.useState)(!1),E=(0,x.useRef)(null);(0,x.useEffect)(()=>{o&&y&&T(!1)},[o,y]);let D=(0,x.useMemo)(()=>w(a),[a]),O=t.trim().toLowerCase(),k=(0,x.useMemo)(()=>{let e=D.map((e,t)=>({option:e,index:t}));O.length>0&&e.sort((e,t)=>{let n=e.option.toLowerCase(),r=t.option.toLowerCase(),i=n===O?0:n.startsWith(O)?1:n.includes(O)?2:3,a=r===O?0:r.startsWith(O)?1:r.includes(O)?2:3;return i===a?e.index-t.index:i-a});let t=e.map(e=>e.option);return Number.isFinite(_)?t.slice(0,Math.max(1,_)):t},[D,O,_]),A=t.trim().length>0&&D.some(e=>e===t.trim()),j=()=>T(!1);return(0,S.jsxs)(g,{open:y&&!o,onOpenChange:e=>T(!o&&e),children:[(0,S.jsx)(m,{asChild:!0,children:(0,S.jsxs)(`div`,{ref:E,className:r(`relative`,l),children:[(0,S.jsx)(i,{id:e,value:t,disabled:o,onFocus:()=>{o||T(!0)},onChange:e=>{n(e.target.value),!y&&!o&&T(!0)},onKeyDown:e=>{e.key===`Enter`&&(v&&(e.preventDefault(),v()),j())},placeholder:c,className:r(`pr-10`,u)}),(0,S.jsx)(`button`,{type:`button`,onMouseDown:e=>e.preventDefault(),onClick:()=>T(e=>!e),disabled:o,className:r(`absolute inset-y-0 right-0 inline-flex w-10 items-center justify-center`,o?`cursor-not-allowed text-gray-300`:`text-gray-400 hover:text-gray-600`),"aria-label":p,children:(0,S.jsx)(b,{className:`h-4 w-4`})})]})}),(0,S.jsx)(h,{align:`start`,className:`flex w-[var(--radix-popover-trigger-width)] min-w-[12rem] flex-col overflow-hidden rounded-xl border border-gray-200 p-0 shadow-lg`,onInteractOutside:e=>{e.target instanceof Node&&E.current?.contains(e.target)&&e.preventDefault()},onOpenAutoFocus:e=>e.preventDefault(),style:{maxHeight:C},children:(0,S.jsxs)(`div`,{className:`custom-scrollbar min-h-0 flex-1 overflow-y-auto py-1`,children:[!A&&t.trim().length>0&&(0,S.jsxs)(`button`,{type:`button`,onMouseDown:e=>e.preventDefault(),onClick:()=>{n(t.trim()),j()},className:`flex w-full items-center gap-2 px-3 py-2 text-left text-sm hover:bg-gray-50`,children:[(0,S.jsx)(s,{className:`h-4 w-4 text-transparent`}),(0,S.jsx)(`span`,{className:`truncate text-gray-700`,children:f.replace(`{value}`,t.trim())})]}),k.map(e=>(0,S.jsxs)(`button`,{type:`button`,onMouseDown:e=>e.preventDefault(),onClick:()=>{n(e),j()},className:`flex w-full items-center gap-2 px-3 py-2 text-left text-sm hover:bg-gray-50`,children:[(0,S.jsx)(s,{className:r(`h-4 w-4`,e===t.trim()?`text-primary`:`text-transparent`)}),(0,S.jsx)(`span`,{className:`truncate text-gray-700`,children:e})]},e)),k.length===0&&t.trim().length===0&&(0,S.jsx)(`div`,{className:`px-3 py-2 text-sm text-gray-500`,children:d})]})})]})}var E=`provider/model`;function D(e){let t=new Set;for(let n of e){let e=n.trim();e&&t.add(e)}return[...t]}function O({id:e,value:t,onChange:n,providerCatalog:r,disabled:o=!1,providerPlaceholder:s,modelPlaceholder:p,className:m}){let[h,g]=(0,x.useState)(``),[b,C]=(0,x.useState)(``),w=r.length>0,O=p??E,k=(0,x.useMemo)(()=>new Map(r.map(e=>[e.name,e])),[r]),A=k.get(h),j=(0,x.useMemo)(()=>A?.aliases??[],[A]),M=(0,x.useMemo)(()=>D(A?.models??[]),[A]);return(0,x.useEffect)(()=>{let e=t.trim();if(!w){g(``),C(e);return}if(!e){C(``),g(e=>k.has(e)?e:``);return}let n=v(e,r)??``,i=k.get(n)?.aliases??[];g(n),C(n?_(e,i):e)},[w,r,k,t]),w?(0,S.jsxs)(`div`,{className:m,children:[(0,S.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center`,children:[(0,S.jsx)(`div`,{className:`sm:w-[38%] sm:min-w-[170px]`,children:(0,S.jsxs)(f,{value:h,onValueChange:e=>{let t=D(k.get(e)?.models??[])[0]??``;if(g(e),C(t),!t){n(``);return}n(y(k.get(e)?.prefix??e,t))},disabled:o,children:[(0,S.jsx)(l,{className:`h-10 w-full rounded-xl`,children:(0,S.jsx)(c,{placeholder:s??a(`providersSelectPlaceholder`)})}),(0,S.jsx)(u,{children:r.map(e=>(0,S.jsx)(d,{value:e.name,children:e.displayName},e.name))})]})}),(0,S.jsx)(`span`,{className:`hidden h-10 items-center justify-center leading-none text-lg font-semibold text-gray-300 sm:inline-flex`,children:`/`}),(0,S.jsx)(T,{id:e,value:b,onChange:e=>{if(!A){let t=e.trim();C(t),n(t);return}let t=_(e,j);C(t),n(t?y(A.prefix,t):``)},options:M,disabled:o||!h,placeholder:O,className:`sm:flex-1`,inputClassName:`h-10 rounded-xl`,emptyText:a(`modelPickerNoOptions`),createText:a(`modelPickerUseCustom`),toggleLabel:a(`modelPickerToggleOptions`)},h)]}),(0,S.jsx)(`p`,{className:`mt-2 text-xs text-gray-500`,children:a(`modelInputCustomHint`)})]}):(0,S.jsxs)(`div`,{className:m,children:[(0,S.jsxs)(`div`,{className:`rounded-2xl border border-amber-200 bg-amber-50/70 px-4 py-3`,children:[(0,S.jsx)(`p`,{className:`text-sm font-semibold text-amber-950`,children:a(`providersEmptyTitle`)}),(0,S.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-amber-900`,children:a(`providersEmptyDescription`)})]}),(0,S.jsx)(i,{id:e,value:t,disabled:o,onChange:e=>n(e.target.value),placeholder:O,className:`mt-3 h-10 rounded-xl`}),(0,S.jsx)(`p`,{className:`mt-2 text-xs text-gray-500`,children:a(`modelInputCustomHint`)})]})}export{O as t};
@@ -1 +1 @@
1
- import{i as e}from"./chunk-DF37yw5_.js";import{A as t,M as n,t as r}from"./utils-CBZPzC_b.js";import{Gt as i,Qt as a,Ut as o,Wt as s,Yt as c,hn as l,jn as u,vn as d}from"./api-Dffeij78.js";import{l as f,s as p}from"./i18n-CPjq_hQX.js";import{n as m,t as h}from"./logo-badge-C-5-zim6.js";import{t as g}from"./createLucideIcon-BNKf0_kc.js";import{t as _}from"./search-CUe41wjm.js";import{t as v}from"./chevron-down-BL-yMYcX.js";import{n as y,t as b}from"./ellipsis-C5YXdOUx.js";import{a as x,i as S,n as C,r as w,t as T}from"./select-CG5YWnwe.js";import{t as E}from"./circle-alert-lSa3LRvS.js";import{t as D}from"./eye-C84inPcV.js";import{i as O,t as k}from"./use-viewport-layout-BS18drMT.js";import{t as A}from"./loader-circle-K1BDdHR5.js";import{t as j}from"./plus-LA8-jpxP.js";import{t as M}from"./refresh-cw-h9Xq3LY3.js";import{t as N}from"./settings-2-CE3ELQyk.js";import{n as P,t as F}from"./confirm-dialog-ClT6iaj8.js";import{t as I}from"./trash-2-BPPYt2NV.js";import{t as L}from"./x-DdXOqLnX.js";import{t as R}from"./host-capabilities-B107nwS3.js";import{i as z,r as B,t as V}from"./popover-NkrFlWHp.js";import{a as H,c as ee,l as U,o as W,t as te}from"./provider-models-5PGHb6mP.js";import{a as G,c as K,d as q,f as ne,h as re,i as ie,l as ae,m as oe,o as se,p as ce,r as le,y as ue}from"./use-config-Cyiw06-j.js";import{t as de}from"./form-actions-AIdXOoCL.js";import{t as J}from"./config-hints-CBPHrfYk.js";import{a as fe,c as pe,i as me,l as he,n as ge,o as _e,r as ve,s as ye}from"./config-split-page-6hHiiapl.js";var be=g(`CircleDotDashed`,[[`path`,{d:`M10.1 2.18a9.93 9.93 0 0 1 3.8 0`,key:`1qdqn0`}],[`path`,{d:`M17.6 3.71a9.95 9.95 0 0 1 2.69 2.7`,key:`1bq7p6`}],[`path`,{d:`M21.82 10.1a9.93 9.93 0 0 1 0 3.8`,key:`1rlaqf`}],[`path`,{d:`M20.29 17.6a9.95 9.95 0 0 1-2.7 2.69`,key:`1xk03u`}],[`path`,{d:`M13.9 21.82a9.94 9.94 0 0 1-3.8 0`,key:`l7re25`}],[`path`,{d:`M6.4 20.29a9.95 9.95 0 0 1-2.69-2.7`,key:`1v18p6`}],[`path`,{d:`M2.18 13.9a9.93 9.93 0 0 1 0-3.8`,key:`xdo6bj`}],[`path`,{d:`M3.71 6.4a9.95 9.95 0 0 1 2.7-2.69`,key:`1jjmaz`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}]]),xe=g(`EyeOff`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Y=e(n(),1),Se={providerId:``,providerType:null,isBuiltInType:!1,isCustom:!0,enabled:!0,displayName:``,apiKeySet:!1,apiKeyMasked:void 0,apiBase:null,extraHeaders:null,wireApi:null,models:[],modelConfig:{}};function X(e){if(!e)return null;let t=Object.entries(e).map(([e,t])=>[e.trim(),t]).filter(([e])=>e.length>0);return t.length===0?null:Object.fromEntries(t)}function Ce(e,t){let n=X(e),r=X(t);if(n===null&&r===null)return!0;if(!n||!r)return!1;let i=Object.entries(n).sort(([e],[t])=>e.localeCompare(t)),a=Object.entries(r).sort(([e],[t])=>e.localeCompare(t));return i.length===a.length?i.every(([e,t],n)=>e===a[n][0]&&t===a[n][1]):!1}function Z(e){if(!e||e.length===0)return[];let t=new Set;for(let n of e){let e=n.trim();e&&t.add(e)}return[...t]}function we(e,t){let n=e.trim();if(!n||!t.trim())return n;let r=`${t.trim()}/`;return n.startsWith(r)?n.slice(r.length):n}function Q(e,t){let n=e.trim();if(!n)return``;for(let e of t){let t=e.trim();t&&(n=we(n,t))}return n.trim()}function Te(e,t){return e.length===t.length?e.every((e,n)=>e===t[n]):!1}function Ee(e,t){return Z(t)}function De(e,t){return Z(e).map(e=>{let n=e.trim();return!n||n.startsWith(`${t}/`)?n:`${t}/${n}`})}function Oe(e,t){let n=new Set(t.map(e=>e.trim()).filter(Boolean)),r={};for(let[t,i]of Object.entries(e)){if(!n.has(t))continue;let e={},a=ee(i.thinking?.supported);if(a.length>0){let t=U(i.thinking?.default);e.thinking=t&&a.includes(t)?{supported:a,default:t}:{supported:a}}i.vision===!0&&(e.vision=!0),(e.thinking||e.vision===!0)&&(r[t]=e)}return r}function ke(e,t,n){return{...W(e,n),...W(t,n)}}function Ae(e,t){let n=Object.keys(e).sort(),r=Object.keys(t).sort();if(n.length!==r.length)return!1;for(let i=0;i<n.length;i+=1){let a=n[i];if(a!==r[i])return!1;let o=e[a],s=t[a];if(!o||!s||!Te([...o.thinking?.supported??[]].sort(),[...s.thinking?.supported??[]].sort())||(o.thinking?.default??null)!==(s.thinking?.default??null)||(o.vision??!1)!==(s.vision??!1))return!1}return!0}function je(e){return e.providerName?e.apiKey.trim().length>0||e.apiBase.trim()!==e.currentApiBase.trim()||!Ce(e.extraHeaders,e.currentHeaders)||e.supportsWireApi&&e.wireApi!==e.currentWireApi||!Te(e.models,e.currentEditableModels)||!Ae(e.modelConfig,e.currentModelConfig)||e.providerDisplayName.trim()!==e.effectiveDisplayName:!1}function Me(e){let t={},n=e.apiKey.trim(),r=e.apiBase.trim(),i=X(e.extraHeaders),a=e.providerDisplayName.trim();return a!==e.effectiveDisplayName&&(t.displayName=a.length>0?a:null),n.length>0&&(t.apiKey=n),r!==e.currentApiBase.trim()&&(t.apiBase=r.length>0&&r!==e.defaultApiBase?r:null),Ce(i,e.currentHeaders)||(t.extraHeaders=i),e.supportsWireApi&&e.wireApi!==e.currentWireApi&&(t.wireApi=e.wireApi),Te(e.models,e.currentEditableModels)||(t.models=De(e.models,e.providerName??``)),Ae(e.modelConfig,e.currentModelConfig)||(t.modelConfig=Oe(e.modelConfig,e.models)),t}function Ne(e){let t=Q(e.models.find(e=>e.trim().length>0)??``,e.providerModelAliases),n={...Pe(e),model:t||null};return e.supportsWireApi&&(n.wireApi=e.wireApi),n}function Pe(e){let t={apiBase:e.apiBase.trim(),extraHeaders:X(e.extraHeaders)};return e.apiKey.trim().length>0&&(t.apiKey=e.apiKey.trim()),t}function Fe(e){return p(e===`off`?`chatThinkingLevelOff`:e===`minimal`?`chatThinkingLevelMinimal`:e===`low`?`chatThinkingLevelLow`:e===`medium`?`chatThinkingLevelMedium`:e===`high`?`chatThinkingLevelHigh`:e===`adaptive`?`chatThinkingLevelAdaptive`:`chatThinkingLevelXhigh`)}function Ie(e){let{providerName:t,methods:n,defaultMethodId:r,language:i}=e;if(n.length===0)return``;let a=new Map;for(let e of n){let t=e.id.trim();t&&a.set(t.toLowerCase(),t)}let o=(...e)=>{for(let t of e){let e=a.get(t.toLowerCase());if(e)return e}},s=r?.trim();if(t===`minimax-portal`){if(i===`zh`)return o(`cn`,`china-mainland`)??o(s??``)??n[0]?.id??``;if(i===`en`)return o(`global`,`intl`,`international`)??o(s??``)??n[0]?.id??``}if(s){let e=o(s);if(e)return e}return i===`zh`?o(`cn`)??n[0]?.id??``:i===`en`?o(`global`)??n[0]?.id??``:n[0]?.id??``}function Le(e){let{required:t,hasDefault:n,optionCount:r}=e;return t&&n&&r>1&&r<=3}function Re(e,t,n){let r=Q(t,n);return r?e.includes(r)?{models:e,draft:``}:{models:[...e,r],draft:``}:{models:e,draft:t}}function ze(e,t,n){let r=[...e],i=new Set(e);for(let e of t){let t=Q(e,n);t&&!i.has(t)&&(i.add(t),r.push(t))}return{models:r,addedCount:r.length-e.length}}function Be(e,t,n){return ze(e,t,n).models.slice(e.length)}function Ve(e,t,n){let r={...t};return delete r[n],{models:e.filter(e=>e!==n),modelConfig:r}}function He(e,t,n){let r=e[t],i=r?.thinking?.supported??[],a=i.includes(n)?i.filter(e=>e!==n):te.filter(e=>e===n||i.includes(e)),o=r?.thinking?.default&&a.includes(r.thinking.default)?r.thinking.default:void 0,s={...r,thinking:a.length>0?o?{supported:a,default:o}:{supported:a}:void 0},c={...e};return s.thinking||s.vision===!0?c[t]=s:delete c[t],c}function Ue(e,t,n){let r=e[t],i=r?.thinking;return!i||i.supported.length===0||n&&!i.supported.includes(n)?e:{...e,[t]:{...r,thinking:n?{supported:i.supported,default:n}:{supported:i.supported}}}}function We(e,t,n){let r={...e[t],vision:n?!0:void 0},i={...e};return r.thinking||r.vision===!0?i[t]=r:delete i[t],i}function Ge(e){let{providerName:t,providerSpec:n,language:r}=e,i=n?.auth,a=i?.methods??[];return{providerAuth:i,providerAuthMethodOptions:a.map(e=>({value:e.id,label:e.label?.[r]||e.label?.en||e.id})),providerAuthMethods:a,preferredAuthMethodId:Ie({providerName:n?.providerType??t,methods:a,defaultMethodId:i?.defaultMethodId,language:r}),shouldUseAuthMethodPills:Le({required:i?.kind===`device_code`,hasDefault:!!i?.defaultMethodId?.trim(),optionCount:a.length})}}function Ke(e,t){let n=!!e?.supportsWireApi||t,r=(e?.wireApiOptions||[`auto`,`chat`,`responses`]).map(e=>({value:e,label:p(e===`chat`?`wireApiChat`:e===`responses`?`wireApiResponses`:`wireApiAuto`)}));return{shouldUseWireApiPills:Le({required:n,hasDefault:typeof e?.defaultWireApi==`string`&&e.defaultWireApi.length>0,optionCount:r.length}),supportsWireApi:n,wireApiSelectOptions:r}}function qe(e){let{providerName:t,providersView:n,templatesView:r,schema:i,language:a}=e,o=t?n?.providers[t]:null,s=r?.providerTemplates.find(e=>e.providerType===o?.providerType),c=o??Se,l=i?.uiHints,u=!!o?.isCustom,d=t?J(`providers.${t}.apiKey`,l):void 0,f=t?J(`providers.${t}.apiBase`,l):void 0,m=t?J(`providers.${t}.extraHeaders`,l):void 0,h=t?J(`providers.${t}.wireApi`,l):void 0,g=s?.displayName||o?.displayName||t||``,_=(c.displayName||``).trim()||g,v=c.enabled!==!1,y=u||s?.supportsModelDiscovery===!0,b=Z([s?.modelPrefix||s?.providerType||``,t||``]),x=s?.defaultApiBase||``,S=c.apiBase||x,C=X(c.extraHeaders||null),w=c.wireApi||s?.defaultWireApi||`auto`,T=Ee(Z((s?.defaultModels??[]).map(e=>Q(e,b))),Z((c.models??[]).map(e=>Q(e,b)))),E=Oe(ke(s?.modelConfig,c.modelConfig,b),T),D=s?.apiBaseHelp?.[a]||s?.apiBaseHelp?.en||f?.help||p(`providerApiBaseHelp`),O=Ge({providerName:t,providerSpec:s,language:a}),k=Ke(s,u);return{apiBaseHelpText:D,apiBaseHint:f,apiKeyHint:d,currentApiBase:S,currentEditableModels:T,currentEnabled:v,currentHeaders:C,currentModelConfig:E,currentWireApi:w,defaultApiBase:x,defaultDisplayName:g,effectiveDisplayName:_,extraHeadersHint:m,...O,providerConfig:o,providerModelAliases:b,resolvedProviderConfig:c,supportsModelDiscovery:y,wireApiHint:h,...k}}function Je(e){let{providerName:t,providerAuth:n,resolvedAuthMethodId:r}=e,i=u(),a=oe(),o=ae(),s=K(),[c,l]=(0,Y.useState)(``),[f,m]=(0,Y.useState)(null),[h,g]=(0,Y.useState)(``),_=(0,Y.useRef)(null),v=(0,Y.useCallback)(()=>{_.current!==null&&(window.clearTimeout(_.current),_.current=null)},[]),y=(0,Y.useCallback)((e,n)=>{v(),_.current=window.setTimeout(()=>{(async()=>{if(t)try{let r=await o.mutateAsync({provider:t,data:{sessionId:e}});if(r.status===`pending`){g(p(`providerAuthWaitingBrowser`)),y(e,r.nextPollMs??n);return}if(r.status===`authorized`){m(null),v(),g(p(`providerAuthCompleted`)),d.success(p(`providerAuthCompleted`)),i.invalidateQueries({queryKey:[`config`]}),i.invalidateQueries({queryKey:[`providers`]});return}m(null),v(),g(r.message||`Authorization ${r.status}.`),d.error(r.message||`Authorization ${r.status}.`)}catch(e){m(null),v();let t=e instanceof Error?e.message:String(e);g(t),d.error(`Authorization failed: ${t}`)}})()},Math.max(1e3,n))},[v,o,t,i]),b=(0,Y.useCallback)(async()=>{if(!(!t||n?.kind!==`device_code`))try{l(t),g(``);let e=await a.mutateAsync({provider:t,data:r?{methodId:r}:{}});if(!e.sessionId||!e.verificationUri)throw Error(p(`providerAuthStartFailed`));m(e.sessionId),g(`${p(`providerAuthOpenPrompt`)}${e.userCode}${p(`providerAuthOpenPromptSuffix`)}`),await R.openExternalUrl(e.verificationUri),y(e.sessionId,e.intervalMs)}catch(e){let t=e instanceof Error?e.message:String(e);m(null),v(),g(t),d.error(`${p(`providerAuthStartFailed`)}: ${t}`)}},[v,n?.kind,t,r,y,a]),x=(0,Y.useCallback)(async()=>{if(!(!t||n?.kind!==`device_code`))try{l(t),v(),m(null);let e=await s.mutateAsync({provider:t});g(`${p(`providerAuthImportStatusPrefix`)}${e.expiresAt?` (expires: ${e.expiresAt})`:``}`),d.success(p(`providerAuthImportSuccess`)),i.invalidateQueries({queryKey:[`config`]}),i.invalidateQueries({queryKey:[`providers`]})}catch(e){let t=e instanceof Error?e.message:String(e);g(t),d.error(`${p(`providerAuthImportFailed`)}: ${t}`)}},[v,s,n?.kind,t,i]);return(0,Y.useEffect)(()=>{v()},[v,t]),(0,Y.useEffect)(()=>()=>v(),[v]),{authSessionId:c===t?f:null,authStatusMessage:c===t?h:``,importAuthFromCli:x,importPending:s.isPending,startAuth:b,startPending:a.isPending}}function Ye(e){let{providerName:t,apiKey:n,apiKeyRequired:r,apiKeySet:i,apiBase:a,extraHeaders:o,supportsWireApi:s,wireApi:c,models:u,providerModelAliases:f}=e,m=re(),h=se(),g=(0,Y.useMemo)(()=>JSON.stringify({providerName:t,apiKey:n,apiBase:a,extraHeaders:o}),[a,n,o,t]),[_,v]=(0,Y.useState)(null),y=(0,Y.useCallback)(async()=>{if(t)try{let e=await m.mutateAsync({provider:t,data:Ne({apiKey:n,apiBase:a,extraHeaders:o,supportsWireApi:s,wireApi:c,models:u,providerModelAliases:f})});if(e.success){d.success(`${p(`providerTestConnectionSuccess`)} (${e.latencyMs}ms)`);return}let r=[`provider=${e.provider}`,`latency=${e.latencyMs}ms`];e.model&&r.push(`model=${e.model}`),d.error(`${p(`providerTestConnectionFailed`)}: ${e.message} | ${r.join(` | `)}`)}catch(e){let t=e instanceof Error?e.message:String(e);d.error(`${p(`providerTestConnectionFailed`)}: ${t}`)}},[a,n,o,u,f,t,s,m,c]);return{discoverModels:(0,Y.useCallback)(async()=>{if(!t)return null;if(r&&!n.trim()&&!i)return d.error(p(`providerModelsApiKeyRequired`)),null;try{let e=await h.mutateAsync({provider:t,data:Pe({apiKey:n,apiBase:a,extraHeaders:o})});return v({key:g,models:e.models}),d.success(p(`providerModelsFetchSuccess`)),e.models}catch(e){if(e instanceof l&&(e.details?.upstreamStatus===401||e.details?.upstreamStatus===403))return d.error(p(`providerModelsAuthorizationFailed`)),null;let t=e instanceof Error?e.message:String(e);return d.error(`${p(`providerModelsFetchFailed`)}: ${t}`),null}},[a,n,r,i,h,g,o,t]),fetchedModels:_?.key===g?_.models:[],isDiscoveringModels:h.isPending,isTestPending:m.isPending,testConnection:y}}var $=t();function Xe({value:e,onChange:t,className:n}){let a=e?Object.entries(e):[],o=(e,n,r)=>{let i=[...a];i[e]=[n,r],t(Object.fromEntries(i))},s=()=>{t({...e,"":``})},l=e=>{let n=a.filter((t,n)=>n!==e);t(Object.fromEntries(n))};return(0,$.jsxs)(`div`,{className:r(`space-y-2`,n),children:[a.map(([e,t],n)=>(0,$.jsxs)(`div`,{className:`flex gap-2`,children:[(0,$.jsx)(i,{type:`text`,value:e,onChange:e=>o(n,e.target.value,t),placeholder:p(`headerName`),className:`flex-1`}),(0,$.jsx)(i,{type:`text`,value:t,onChange:t=>o(n,e,t.target.value),placeholder:p(`headerValue`),className:`flex-1`}),(0,$.jsx)(c,{type:`button`,variant:`ghost`,size:`icon`,onClick:()=>l(n),children:(0,$.jsx)(I,{className:`h-4 w-4 text-red-500`})})]},n)),(0,$.jsxs)(c,{type:`button`,variant:`outline`,size:`sm`,onClick:s,children:[(0,$.jsx)(j,{className:`h-4 w-4 mr-2`}),p(`add`)]})]})}function Ze(e){let{value:t,onChange:n,options:r}=e;return(0,$.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:r.map(e=>{let r=e.value===t;return(0,$.jsx)(`button`,{type:`button`,onClick:()=>n(e.value),"aria-pressed":r,className:`rounded-full border px-3 py-1.5 text-xs font-medium transition-colors ${r?`border-foreground/15 bg-foreground text-background`:`border-border/55 bg-muted/50 text-muted-foreground hover:border-border hover:bg-muted hover:text-foreground`}`,children:e.label},e.value)})})}function Qe(e){let{showAdvanced:t,onShowAdvancedChange:n,supportsWireApi:r,wireApiLabel:i,wireApi:a,onWireApiChange:o,shouldUseWireApiPills:c,wireApiSelectOptions:l,extraHeadersLabel:u,extraHeaders:d,onExtraHeadersChange:f}=e;return(0,$.jsxs)(`div`,{className:`border-t border-border/70 pt-4`,children:[(0,$.jsxs)(`button`,{type:`button`,onClick:()=>n(!t),className:`flex w-full items-center justify-between text-sm text-muted-foreground transition-colors hover:text-foreground`,children:[(0,$.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(N,{className:`h-3.5 w-3.5`}),p(`providerAdvancedSettings`)]}),(0,$.jsx)(v,{className:`h-4 w-4 transition-transform ${t?`rotate-180`:``}`})]}),t?(0,$.jsxs)(`div`,{className:`mt-4 space-y-5`,children:[r?(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(s,{htmlFor:`wireApi`,className:`text-sm font-medium text-foreground`,children:i}),c?(0,$.jsx)(Ze,{value:a,onChange:e=>o(e),options:l}):(0,$.jsxs)(T,{value:a,onValueChange:e=>o(e),children:[(0,$.jsx)(S,{className:`rounded-xl`,children:(0,$.jsx)(x,{})}),(0,$.jsx)(C,{children:l.map(e=>(0,$.jsx)(w,{value:e.value,children:e.label},e.value))})]})]}):null,(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(s,{className:`text-sm font-medium text-foreground`,children:u}),(0,$.jsx)(Xe,{value:d,onChange:f}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:p(`providerExtraHeadersHelpShort`)})]})]}):null]})}function $e({isSet:e,className:t,value:n,onChange:a,placeholder:o,...s}){let[l,u]=(0,Y.useState)(!1),[d,f]=(0,Y.useState)(!1),p=typeof n==`string`&&n.length>0;return(0,$.jsxs)(`div`,{className:`relative`,children:[e&&!p&&!d?(0,$.jsx)(`div`,{onClick:()=>f(!0),className:r(`flex h-9 w-full rounded-xl border border-gray-200/80 bg-white px-3.5 py-2 text-sm text-gray-500 cursor-text items-center pr-12`,t),children:`••••••••••••`}):(0,$.jsx)(i,{type:l?`text`:`password`,className:r(`pr-12`,t),value:n,onChange:a,onBlur:()=>{p||f(!1)},placeholder:o,autoFocus:d,...s}),(0,$.jsx)(`div`,{className:`absolute right-2 top-1/2 -translate-y-1/2 flex gap-1`,children:(e||p)&&(0,$.jsx)(c,{type:`button`,variant:`ghost`,size:`icon`,className:`h-7 w-7`,onClick:()=>u(!l),children:l?(0,$.jsx)(xe,{className:`h-4 w-4`}):(0,$.jsx)(D,{className:`h-4 w-4`})})})]})}function et(e){let{apiKey:t,apiKeyRequired:n,apiKeySet:r,apiKeyPlaceholder:i,providerAuth:a,providerAuthNote:o,providerAuthMethodOptions:l,providerAuthMethodsCount:u,selectedAuthMethodHint:d,shouldUseAuthMethodPills:f,resolvedAuthMethodId:m,onAuthMethodChange:h,onStartProviderAuth:g,onImportProviderAuthFromCli:_,startPending:v,importPending:y,authSessionId:b,authStatusMessage:E,onApiKeyChange:D}=e,O=n?(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(s,{htmlFor:`apiKey`,className:`text-sm font-medium text-foreground`,children:p(`apiKey`)}),(0,$.jsx)($e,{id:`apiKey`,value:t,isSet:r,onChange:e=>D(e.target.value),placeholder:i,className:`rounded-xl`}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:p(`leaveBlankToKeepUnchanged`)})]}):null;return a?.kind===`device_code`?(0,$.jsxs)($.Fragment,{children:[O,(0,$.jsxs)(`div`,{className:`space-y-2 rounded-xl bg-muted/45 p-3`,children:[(0,$.jsx)(s,{className:`text-sm font-medium text-foreground`,children:a.displayName||p(`providerAuthSectionTitle`)}),o?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:o}):null,u>1?(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(s,{className:`text-xs font-medium text-foreground`,children:p(`providerAuthMethodLabel`)}),f?(0,$.jsx)(Ze,{value:m,onChange:h,options:l}):(0,$.jsxs)(T,{value:m,onValueChange:h,children:[(0,$.jsx)(S,{className:`h-8 rounded-lg`,children:(0,$.jsx)(x,{placeholder:p(`providerAuthMethodPlaceholder`)})}),(0,$.jsx)(C,{children:l.map(e=>(0,$.jsx)(w,{value:e.value,children:e.label},e.value))})]}),d?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:d}):null]}):null,(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,$.jsx)(c,{type:`button`,variant:`outline`,size:`sm`,onClick:g,disabled:v||!!b,children:p(v?`providerAuthStarting`:b?`providerAuthAuthorizing`:`providerAuthAuthorizeInBrowser`)}),a.supportsCliImport?(0,$.jsx)(c,{type:`button`,variant:`outline`,size:`sm`,onClick:_,disabled:y,children:p(y?`providerAuthImporting`:`providerAuthImportFromCli`)}):null,b?(0,$.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[p(`providerAuthSessionLabel`),`: `,b.slice(0,8),`…`]}):null]}),E?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:E}):null]})]}):O}function tt(e){let{providerName:t,models:n,aliases:r,fetchedModels:i=[],onModelsChange:a}=e,o=q({pollWhileRefreshing:!0,refreshOnMount:!0}),s=t?o.data?.providers[t]:void 0,c=i.length>0?`fetched`:`background`,l=(0,Y.useMemo)(()=>Be(n,c===`fetched`?i:s?.models??[],r),[r,s?.models,i,n,c]);return{addSuggestedModels:(0,Y.useCallback)(e=>{let t=ze(n,e,r);t.addedCount>0&&a(t.models)},[r,n,a]),hasSuggestionError:!!(s?.lastError&&!s.fetchedAt),isCheckingSuggestions:!!(t&&(o.isLoading||o.data?.refreshing&&!s)),suggestedModels:l,suggestionSource:c}}function nt(e){let{models:t,modelConfig:n,onModelsChange:r,onRemoveModel:i,onToggleModelThinkingLevel:a,onSetModelThinkingDefault:c,onSetModelVision:l,thinkingLevels:u,formatThinkingLevelLabel:d}=e,[f,m]=(0,Y.useState)(!1),[h,g]=(0,Y.useState)(()=>new Set),_=(0,Y.useMemo)(()=>t.filter(e=>h.has(e)),[t,h]),v=e=>{g(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},y=()=>{m(!1),g(new Set)};return(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(`div`,{className:`flex min-h-7 flex-wrap items-center justify-end gap-2`,children:f?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`mr-auto text-xs text-muted-foreground`,children:p(`providerModelsSuggestionsSelected`).replace(`{count}`,String(_.length))}),(0,$.jsx)(`button`,{type:`button`,className:`text-xs font-medium text-primary hover:text-primary/80`,onClick:()=>g(_.length===t.length?new Set:new Set(t)),children:p(_.length===t.length?`providerModelsClearSelection`:`providerModelsSelectAll`)}),(0,$.jsx)(`button`,{type:`button`,className:`text-xs font-medium text-muted-foreground hover:text-foreground`,onClick:y,children:p(`cancel`)}),(0,$.jsxs)(`button`,{type:`button`,disabled:_.length===0,className:`inline-flex items-center gap-1 rounded-md bg-destructive/10 px-2 py-1 text-xs font-medium text-destructive transition-colors hover:bg-destructive/15 disabled:cursor-not-allowed disabled:opacity-45`,onClick:()=>{_.length!==0&&(r(t.filter(e=>!h.has(e))),y())},children:[(0,$.jsx)(I,{className:`h-3 w-3`}),p(`providerModelsRemoveSelected`)]})]}):(0,$.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 text-xs font-medium text-muted-foreground hover:text-foreground`,onClick:()=>m(!0),children:[(0,$.jsx)(I,{className:`h-3 w-3`}),p(`providerModelsBulkRemove`)]})}),(0,$.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:t.map(e=>{if(f)return(0,$.jsxs)(`label`,{className:`inline-flex max-w-full cursor-pointer items-center gap-2 rounded-full border border-border/55 bg-muted/45 px-3 py-1.5 hover:bg-muted/70`,children:[(0,$.jsx)(`input`,{type:`checkbox`,checked:h.has(e),onChange:()=>v(e),"aria-label":p(`providerModelsSuggestionSelect`).replace(`{model}`,e),className:`h-3.5 w-3.5 shrink-0 accent-primary`}),(0,$.jsx)(`span`,{className:`max-w-[140px] truncate text-sm text-foreground sm:max-w-[220px]`,children:e})]},e);let t=n[e],r=t?.thinking,m=r?.supported??[],g=r?.default??null,_=t?.vision===!0;return(0,$.jsxs)(`div`,{className:`group inline-flex max-w-full items-center gap-1 rounded-full border border-border/55 bg-muted/45 px-3 py-1.5`,children:[(0,$.jsx)(`span`,{className:`max-w-[140px] truncate text-sm text-foreground sm:max-w-[220px]`,children:e}),(0,$.jsxs)(V,{children:[(0,$.jsx)(z,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,className:`inline-flex h-5 w-5 items-center justify-center rounded-full text-muted-foreground/70 opacity-100 transition-opacity hover:bg-muted hover:text-foreground md:opacity-0 md:group-hover:opacity-100 md:group-focus-within:opacity-100`,"aria-label":p(`providerModelThinkingTitle`),title:p(`providerModelThinkingTitle`),children:(0,$.jsx)(N,{className:`h-3 w-3`})})}),(0,$.jsxs)(B,{className:`w-80 space-y-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-lg bg-muted/50 px-3 py-2`,children:[(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`p`,{className:`text-xs font-semibold text-foreground`,children:p(`providerModelVisionTitle`)}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:p(`providerModelVisionHint`)})]}),(0,$.jsx)(o,{checked:_,onCheckedChange:t=>l(e,t)})]}),(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(`p`,{className:`text-xs font-semibold text-foreground`,children:p(`providerModelThinkingTitle`)}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:p(`providerModelThinkingHint`)})]}),(0,$.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:u.map(t=>(0,$.jsx)(`button`,{type:`button`,onClick:()=>a(e,t),className:`rounded-full border px-2.5 py-1 text-xs font-medium transition-colors ${m.includes(t)?`border-foreground/15 bg-foreground text-background`:`border-border/55 bg-muted/50 text-muted-foreground hover:border-border hover:bg-muted hover:text-foreground`}`,children:d(t)},t))}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(s,{className:`text-xs font-medium text-foreground`,children:p(`providerModelThinkingDefault`)}),(0,$.jsxs)(T,{value:g??`__none__`,onValueChange:t=>c(e,t===`__none__`?null:t),disabled:m.length===0,children:[(0,$.jsx)(S,{className:`h-8 rounded-lg text-xs`,children:(0,$.jsx)(x,{})}),(0,$.jsxs)(C,{children:[(0,$.jsx)(w,{value:`__none__`,children:p(`providerModelThinkingDefaultNone`)}),m.map(e=>(0,$.jsx)(w,{value:e,children:d(e)},e))]})]}),m.length===0?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:p(`providerModelThinkingNoSupported`)}):null]})]})]}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>i(e),className:`inline-flex h-5 w-5 items-center justify-center rounded-full text-muted-foreground/70 opacity-100 transition-opacity hover:bg-muted hover:text-foreground md:opacity-0 md:group-hover:opacity-100 md:group-focus-within:opacity-100`,"aria-label":p(`remove`),children:(0,$.jsx)(L,{className:`h-3 w-3`})})]},e)})}),f?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:p(`providerModelsRemoveSaveHint`)}):null]})}var rt=20,it=50,at=50;function ot(e){let{expanded:t,fetchedTotal:n,models:r,source:a,onExpandedChange:o,onAddModels:s}=e,[c,l]=(0,Y.useState)(``),[u,d]=(0,Y.useState)(()=>new Set),f=(0,Y.useMemo)(()=>{let e=c.trim().toLowerCase();return e?r.filter(t=>t.toLowerCase().includes(e)):r},[r,c]),m=f.slice(0,at),h=(0,Y.useMemo)(()=>r.filter(e=>u.has(e)),[r,u]),g=e=>{d(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},v=e=>{e.length!==0&&(s(e),l(``),d(new Set))},b=a===`fetched`?`providerModelsFetchedSuggestionsSummary`:`providerModelsSuggestionsSummary`;return a===`fetched`&&r.length===0?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 rounded-xl bg-muted/35 px-3 py-2 text-xs text-muted-foreground`,role:`status`,children:[(0,$.jsx)(P,{className:`h-3.5 w-3.5 shrink-0 text-primary`}),(0,$.jsx)(`span`,{children:p(`providerModelsFetchedAllConfigured`).replace(`{count}`,String(n))})]}):(0,$.jsxs)(`div`,{className:`rounded-xl bg-muted/35 p-2`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-1.5`,children:[(0,$.jsxs)(`button`,{type:`button`,"aria-expanded":t,className:`flex min-w-0 flex-1 items-center gap-1.5 rounded-lg px-2 py-1.5 text-left text-xs text-muted-foreground transition-colors hover:bg-muted/70 hover:text-foreground`,onClick:()=>o(!t),children:[(0,$.jsx)(P,{className:`h-3.5 w-3.5 shrink-0 text-primary`}),(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:p(b).replace(`{count}`,String(r.length))}),(0,$.jsx)(y,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${t?`rotate-90`:``}`})]}),r.length<=it?(0,$.jsx)(`button`,{type:`button`,className:`shrink-0 rounded-lg px-2 py-1.5 text-xs font-medium text-primary transition-colors hover:bg-primary/10`,onClick:()=>v(r),children:p(`providerModelsSuggestionsAddAll`)}):null]}),t?(0,$.jsxs)(`div`,{className:`px-1 pb-1`,children:[r.length>rt?(0,$.jsxs)(`div`,{className:`relative px-2 pb-1 pt-1.5`,children:[(0,$.jsx)(_,{className:`pointer-events-none absolute left-4 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground`}),(0,$.jsx)(i,{value:c,onChange:e=>l(e.target.value),placeholder:p(`providerModelsSuggestionsSearchPlaceholder`),className:`h-8 rounded-lg pl-8 text-xs`})]}):null,(0,$.jsxs)(`div`,{className:`custom-scrollbar max-h-44 overflow-y-auto overscroll-contain`,children:[m.map(e=>(0,$.jsxs)(`label`,{className:`grid min-w-0 cursor-pointer grid-cols-[auto_minmax(0,1fr)] items-center gap-2 rounded-lg px-2 py-1.5 hover:bg-muted/70`,children:[(0,$.jsx)(`input`,{type:`checkbox`,checked:u.has(e),onChange:()=>g(e),"aria-label":p(`providerModelsSuggestionSelect`).replace(`{model}`,e),className:`h-3.5 w-3.5 shrink-0 accent-primary`}),(0,$.jsx)(`span`,{className:`block min-w-0 truncate text-xs text-foreground`,title:e,children:e})]},e)),f.length===0?(0,$.jsx)(`p`,{className:`px-2 py-4 text-center text-xs text-muted-foreground`,children:p(`providerModelsSuggestionsSearchEmpty`)}):null]}),f.length>m.length?(0,$.jsx)(`p`,{className:`px-2 pt-1 text-[11px] text-muted-foreground`,children:p(`providerModelsSuggestionsShowing`).replace(`{visible}`,String(m.length)).replace(`{count}`,String(f.length))}):null,(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-2 pt-1.5`,children:[(0,$.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:p(`providerModelsSuggestionsSelected`).replace(`{count}`,String(h.length))}),(0,$.jsx)(`button`,{type:`button`,disabled:h.length===0,className:`shrink-0 rounded-md bg-primary/10 px-2 py-1 text-[11px] font-medium text-primary transition-colors hover:bg-primary/15 disabled:cursor-not-allowed disabled:opacity-45`,onClick:()=>v(h),children:p(`providerModelsSuggestionsAddSelected`)})]}),(0,$.jsx)(`p`,{className:`px-2 pb-1 pt-1 text-[11px] text-muted-foreground`,children:p(`providerModelsSuggestionsSaveHint`)})]}):null]})}function st({hasFetchedCatalog:e,hasSuggestionError:t,supportsModelDiscovery:n}){return!n||!t||e?null:(0,$.jsxs)(`div`,{className:`flex items-start gap-2 rounded-xl bg-destructive/10 px-3 py-2 text-xs text-destructive`,children:[(0,$.jsx)(E,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`}),p(`providerModelsSuggestionsFailed`)]})}function ct(e){let{providerName:t,providerModelAliases:n,models:r,modelConfig:a,modelDraft:o,showModelInput:l,onModelDraftChange:u,onShowModelInputChange:d,onAddModel:f,onModelsChange:m,supportsModelDiscovery:h,onDiscoverModels:g,isDiscoveringModels:_,fetchedModels:v,onRemoveModel:y,onToggleModelThinkingLevel:b,onSetModelThinkingDefault:x,onSetModelVision:S,thinkingLevels:C,formatThinkingLevelLabel:w}=e,[T,E]=(0,Y.useState)(!1),D=(0,Y.useRef)(null),{addSuggestedModels:O,hasSuggestionError:k,isCheckingSuggestions:N,suggestedModels:P,suggestionSource:F}=tt({providerName:t,models:r,aliases:n,fetchedModels:v,onModelsChange:m}),I=async()=>{await g()&&(E(!0),window.requestAnimationFrame(()=>{let e=D.current;e?.scrollIntoView?.({behavior:`smooth`,block:`center`}),e?.focus({preventScroll:!0})}))},R=v.length>0;return(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,$.jsx)(s,{className:`text-sm font-medium text-foreground`,children:p(`providerModelsTitle`)}),(0,$.jsxs)(`div`,{className:`flex items-center gap-3`,children:[h?(0,$.jsxs)(`button`,{type:`button`,onClick:I,disabled:_,className:`flex items-center gap-1 text-xs font-medium text-primary transition-colors hover:text-primary/80 disabled:cursor-wait disabled:opacity-60`,children:[(0,$.jsx)(M,{className:`h-3 w-3 ${_?`animate-spin`:``}`}),p(_?`providerModelsFetching`:`providerModelsFetch`)]}):null,l?null:(0,$.jsxs)(`button`,{type:`button`,onClick:()=>d(!0),className:`flex items-center gap-1 text-xs font-medium text-primary hover:text-primary/80`,children:[(0,$.jsx)(j,{className:`h-3 w-3`}),p(`providerAddModel`)]})]})]}),l?(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(i,{value:o,onChange:e=>u(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),f()),e.key===`Escape`&&(d(!1),u(``))},placeholder:p(`providerModelInputPlaceholder`),className:`flex-1 rounded-xl`,autoFocus:!0}),(0,$.jsx)(c,{type:`button`,size:`sm`,onClick:f,disabled:o.trim().length===0,children:p(`add`)}),(0,$.jsx)(c,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>{d(!1),u(``)},children:(0,$.jsx)(L,{className:`h-4 w-4`})})]}):null,(0,$.jsx)(st,{hasFetchedCatalog:R,hasSuggestionError:k,supportsModelDiscovery:h}),h&&N&&!R?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 rounded-xl bg-muted/35 px-3 py-2 text-xs text-muted-foreground`,children:[(0,$.jsx)(A,{className:`h-3.5 w-3.5 animate-spin`}),p(`providerModelsSuggestionsChecking`)]}):h&&(P.length>0||R)?(0,$.jsx)(`div`,{ref:D,tabIndex:-1,"aria-live":`polite`,className:`scroll-m-4 outline-none`,children:(0,$.jsx)(ot,{expanded:T,fetchedTotal:v.length,models:P,source:F,onExpandedChange:E,onAddModels:O})}):null,r.length===0?(0,$.jsxs)(`div`,{className:`rounded-xl bg-muted/35 px-4 py-6 text-center`,children:[(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:p(`providerModelsEmptyShort`)}),l?null:(0,$.jsx)(`button`,{type:`button`,onClick:()=>d(!0),className:`mt-2 text-sm font-medium text-primary hover:text-primary/80`,children:p(`providerAddFirstModel`)})]}):(0,$.jsx)(nt,{models:r,modelConfig:a,onModelsChange:m,onRemoveModel:y,onToggleModelThinkingLevel:b,onSetModelThinkingDefault:x,onSetModelVision:S,thinkingLevels:C,formatThinkingLevelLabel:w})]})}function lt({apiKeyRequired:e=!0,apiKeySet:t,className:n,enabled:r}){if(!r)return(0,$.jsx)(m,{status:`inactive`,label:p(`disabled`),className:n});let i=!e||t;return(0,$.jsx)(m,{status:i?`ready`:`setup`,label:p(i?`statusReady`:`statusSetup`),className:n})}function ut(e){let{context:t,language:n,providerTitle:r,providerDisplayName:a,apiKey:o,apiBase:l,extraHeaders:u,wireApi:d,models:f,modelConfig:m,modelDraft:h,showAdvanced:g,showModelInput:_,resolvedAuthMethodId:v,authSessionId:y,authStatusMessage:b,hasChanges:x,isDeletePending:S,isUpdatePending:C,connectivity:w,startPending:T,importPending:E,onProviderDisplayNameChange:D,onApiKeyChange:O,onApiBaseChange:k,onAuthMethodChange:A,onStartProviderAuth:j,onImportProviderAuthFromCli:M,onModelDraftChange:N,onShowModelInputChange:P,onAddModel:F,onModelsChange:L,onRemoveModel:R,onToggleModelThinkingLevel:z,onSetModelThinkingDefault:B,onSetModelVision:V,onShowAdvancedChange:H,onWireApiChange:ee,onExtraHeadersChange:U,onDeleteProvider:W,onSubmit:G,onTestConnection:K}=e,q=t.providerAuthMethods.find(e=>e.id===v);return(0,$.jsxs)(ge,{children:[(0,$.jsx)(pe,{className:`px-5 py-4`,children:(0,$.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,$.jsx)(`h3`,{className:`truncate text-lg font-semibold text-foreground`,children:r}),(0,$.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,$.jsx)(`button`,{type:`button`,onClick:W,disabled:S,className:`text-muted-foreground/70 transition-colors hover:text-red-500`,title:p(`providerDelete`),children:(0,$.jsx)(I,{className:`h-4 w-4`})}),(0,$.jsx)(lt,{enabled:t.currentEnabled,apiKeyRequired:t.resolvedProviderConfig.apiKeyRequired,apiKeySet:t.resolvedProviderConfig.apiKeySet})]})]})}),(0,$.jsxs)(`form`,{onSubmit:G,className:`flex min-h-0 flex-1 flex-col`,children:[(0,$.jsxs)(_e,{className:`space-y-4 px-5 py-4`,children:[(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(s,{htmlFor:`providerDisplayName`,className:`text-sm font-medium text-foreground`,children:p(`providerDisplayName`)}),(0,$.jsx)(i,{id:`providerDisplayName`,type:`text`,value:a,onChange:e=>D(e.target.value),placeholder:t.defaultDisplayName||p(`providerDisplayNamePlaceholder`),className:`rounded-xl`}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:p(`providerDisplayNameHelpShort`)})]}),(0,$.jsx)(et,{apiKey:o,apiKeyRequired:t.resolvedProviderConfig.apiKeyRequired!==!1,apiKeySet:t.resolvedProviderConfig.apiKeySet,apiKeyPlaceholder:t.apiKeyHint?.placeholder??p(`enterApiKey`),providerAuth:t.providerAuth,providerAuthNote:t.providerAuth?.note?.[n]||t.providerAuth?.note?.en||t.providerAuth?.displayName||``,providerAuthMethodOptions:t.providerAuthMethodOptions,providerAuthMethodsCount:t.providerAuthMethods.length,selectedAuthMethodHint:q?.hint?.[n]||q?.hint?.en||``,shouldUseAuthMethodPills:t.shouldUseAuthMethodPills,resolvedAuthMethodId:v,onAuthMethodChange:A,onStartProviderAuth:j,onImportProviderAuthFromCli:M,startPending:T,importPending:E,authSessionId:y,authStatusMessage:b,onApiKeyChange:O}),(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(s,{htmlFor:`apiBase`,className:`text-sm font-medium text-foreground`,children:p(`apiBase`)}),(0,$.jsx)(i,{id:`apiBase`,type:`text`,value:l,onChange:e=>k(e.target.value),placeholder:t.defaultApiBase||t.apiBaseHint?.placeholder||`https://api.example.com`,className:`rounded-xl`}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t.apiBaseHelpText})]}),(0,$.jsx)(ct,{providerName:t.providerConfig?.providerId??``,providerModelAliases:t.providerModelAliases,models:f,modelConfig:m,modelDraft:h,showModelInput:_,onModelDraftChange:N,onShowModelInputChange:P,onAddModel:F,onModelsChange:L,supportsModelDiscovery:t.supportsModelDiscovery,onDiscoverModels:w.discoverModels,isDiscoveringModels:w.isDiscoveringModels,fetchedModels:w.fetchedModels,onRemoveModel:R,onToggleModelThinkingLevel:z,onSetModelThinkingDefault:B,onSetModelVision:V,thinkingLevels:te,formatThinkingLevelLabel:Fe},t.providerConfig?.providerId),(0,$.jsx)(Qe,{showAdvanced:g,onShowAdvancedChange:H,supportsWireApi:t.supportsWireApi,wireApiLabel:p(`wireApi`),wireApi:d,onWireApiChange:ee,shouldUseWireApiPills:t.shouldUseWireApiPills,wireApiSelectOptions:t.wireApiSelectOptions,extraHeadersLabel:p(`extraHeaders`),extraHeaders:u,onExtraHeadersChange:U})]}),(0,$.jsx)(ye,{children:(0,$.jsxs)(de,{align:`between`,children:[(0,$.jsxs)(c,{type:`button`,variant:`outline`,size:`sm`,onClick:K,disabled:w.isTestPending,children:[(0,$.jsx)(be,{className:`mr-1.5 h-3.5 w-3.5`}),w.isTestPending?p(`providerTestingConnection`):p(`providerTestConnection`)]}),(0,$.jsx)(c,{type:`submit`,size:`sm`,disabled:C||!x,children:p(C?`saving`:x?`save`:`unchanged`)})]})})]})]})}function dt({providerName:e,onProviderDeleted:t}){let{data:n}=ce(),{data:r}=ne(),{data:i}=le(),a=f(),o=(0,Y.useMemo)(()=>qe({providerName:e,providersView:n,templatesView:r,schema:i,language:a}),[a,e,n,i,r]);if(!e||!o.providerConfig)return(0,$.jsx)(ve,{children:(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h3`,{className:`text-base font-semibold text-foreground`,children:p(`providersSelectTitle`)}),(0,$.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:p(`providersSelectDescription`)})]})});let s=JSON.stringify({providerConfig:o.providerConfig,currentApiBase:o.currentApiBase,currentEditableModels:o.currentEditableModels,currentModelConfig:o.currentModelConfig,currentWireApi:o.currentWireApi,effectiveDisplayName:o.effectiveDisplayName,preferredAuthMethodId:o.preferredAuthMethodId});return(0,$.jsx)(ft,{providerName:e,onProviderDeleted:t,context:o,language:a},s)}function ft({providerName:e,onProviderDeleted:t,context:n,language:r}){let i=ue(),a=G(),{currentApiBase:o,currentEditableModels:s,currentHeaders:c,currentModelConfig:l,currentWireApi:u,defaultApiBase:d,effectiveDisplayName:f,providerAuth:m,providerAuthMethods:h,providerModelAliases:g,resolvedProviderConfig:_,preferredAuthMethodId:v,supportsWireApi:y}=n,[b,x]=(0,Y.useState)(``),[S,C]=(0,Y.useState)(o),[w,T]=(0,Y.useState)(_.extraHeaders||null),[E,D]=(0,Y.useState)(u),[O,k]=(0,Y.useState)(s),[A,j]=(0,Y.useState)(l),[M,N]=(0,Y.useState)(``),[P,F]=(0,Y.useState)(f),[I,L]=(0,Y.useState)(!1),[R,z]=(0,Y.useState)(!1),[B,V]=(0,Y.useState)(v),H=Ye({providerName:e,apiKey:b,apiKeyRequired:_.apiKeyRequired!==!1,apiKeySet:_.apiKeySet,apiBase:S,extraHeaders:w,supportsWireApi:y,wireApi:E,models:O,providerModelAliases:g}),ee=P.trim()||f||e||p(`providersSelectPlaceholder`),U=(0,Y.useMemo)(()=>{if(!h.length)return``;let e=B.trim();return e&&h.some(t=>t.id===e)?e:v||h[0]?.id||``},[B,v,h]),{authSessionId:W,authStatusMessage:te,importAuthFromCli:K,importPending:q,startAuth:ne,startPending:re}=Je({providerName:e,providerAuth:m,resolvedAuthMethodId:U}),ie=(0,Y.useMemo)(()=>je({providerName:e,apiKey:b,apiBase:S,currentApiBase:o,extraHeaders:w,currentHeaders:c,supportsWireApi:y,wireApi:E,currentWireApi:u,models:O,currentEditableModels:s,modelConfig:A,currentModelConfig:l,providerDisplayName:P,effectiveDisplayName:f}),[e,b,S,o,w,c,y,E,u,O,s,A,l,P,f]),ae=e=>{k(e),j(t=>Oe(t,e))};return(0,$.jsx)(ut,{context:n,language:r,providerTitle:ee,providerDisplayName:P,apiKey:b,apiBase:S,extraHeaders:w,wireApi:E,models:O,modelConfig:A,modelDraft:M,showAdvanced:I,showModelInput:R,resolvedAuthMethodId:U,authSessionId:W,authStatusMessage:te,hasChanges:ie,isDeletePending:a.isPending,isUpdatePending:i.isPending,connectivity:H,startPending:re,importPending:q,onProviderDisplayNameChange:F,onApiKeyChange:x,onApiBaseChange:C,onAuthMethodChange:V,onStartProviderAuth:ne,onImportProviderAuthFromCli:K,onModelDraftChange:N,onShowModelInputChange:z,onAddModel:()=>{let e=Re(O,M,g);ae(e.models),N(e.draft)},onModelsChange:ae,onRemoveModel:e=>{let t=Ve(O,A,e);k(t.models),j(t.modelConfig)},onToggleModelThinkingLevel:(e,t)=>{j(n=>He(n,e,t))},onSetModelThinkingDefault:(e,t)=>{j(n=>Ue(n,e,t))},onSetModelVision:(e,t)=>{j(n=>We(n,e,t))},onShowAdvancedChange:L,onWireApiChange:D,onExtraHeadersChange:T,onDeleteProvider:async()=>{if(e&&window.confirm(p(`providerDeleteConfirm`)))try{await a.mutateAsync({provider:e}),t?.(e)}catch{}},onSubmit:t=>{t.preventDefault(),e&&i.mutate({provider:e,data:Me({providerName:e,apiKey:b,apiBase:S,currentApiBase:o,defaultApiBase:d,extraHeaders:w,currentHeaders:c,supportsWireApi:y,wireApi:E,currentWireApi:u,models:O,currentEditableModels:s,modelConfig:A,currentModelConfig:l,providerDisplayName:P,effectiveDisplayName:f})})},onTestConnection:H.testConnection})}function pt(e){if(!e)return null;try{let t=new URL(e);return`${t.host}${t.pathname&&t.pathname!==`/`?t.pathname:``}`}catch{return e.replace(/^https?:\/\//,``)}}function mt(e,t=[]){let n=new Map(t.map((e,t)=>[e,t]));return e.map((e,t)=>({provider:e,index:t})).sort((e,t)=>{let r=n.get(e.provider.providerId),i=n.get(t.provider.providerId);if(r!==void 0||i!==void 0)return(r??2**53-1)-(i??2**53-1);let a=e.provider.providerType===`nextclaw`?1:0,o=t.provider.providerType===`nextclaw`?1:0;return a===o?e.index-t.index:a-o}).map(({provider:e})=>e)}function ht(e){let t=e.findIndex(e=>e.providerType===`zhipu`),n=e.findIndex(e=>e.providerType===`dashscope-coding-plan`);return e.map((e,t)=>({template:e,index:t})).sort((e,r)=>{let i=({template:e,index:r})=>e.providerType===`nextclaw`?2**53-1:e.providerType===`deepseek`&&n>=0?n-.5:e.providerType===`mimo`&&t>=0?t+.5:r;return i(e)-i(r)}).map(({template:e})=>e)}function gt(){let{isMobile:e}=k(),{data:t}=ce(),{data:n}=ne(),s=ie(),l=G(),u=ue(),[d,f]=(0,Y.useState)(null),[g,v]=(0,Y.useState)(null),[y,x]=(0,Y.useState)(!1),[S,C]=(0,Y.useState)([]),[w,T]=(0,Y.useState)(``),E=(0,Y.useMemo)(()=>mt(Object.values(t?.providers??{}),S),[t?.providers,S]),D=(0,Y.useMemo)(()=>n?.providerTemplates??[],[n?.providerTemplates]),A=(0,Y.useMemo)(()=>ht(D),[D]),M=(0,Y.useMemo)(()=>new Map(D.map(e=>[e.providerType,e])),[D]),N=(0,Y.useMemo)(()=>{let e=w.trim().toLowerCase();return E.filter(t=>{if(!e)return!0;let n=t.providerType?M.get(t.providerType):null;return(t.displayName?.trim()||n?.displayName||t.providerId).toLowerCase().includes(e)||t.providerId.toLowerCase().includes(e)})},[E,w,M]),P=(0,Y.useMemo)(()=>d&&N.some(e=>e.providerId===d)?d:e?null:N[0]?.providerId??null,[N,e,d]);return!t||!n?(0,$.jsx)(a,{title:p(`providersPageTitle`),description:p(`providersPageDescription`),layout:`split`,children:(0,$.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:p(`providersLoading`)})}):(0,$.jsxs)(a,{title:p(`providersPageTitle`),description:p(`providersPageDescription`),layout:`split`,children:[(0,$.jsxs)(fe,{className:`md:min-h-0`,compactView:d?`detail`:`list`,onMobileBack:()=>f(null),mobileListLabel:p(`providersPageTitle`),children:[(0,$.jsxs)(he,{children:[(0,$.jsx)(pe,{className:`space-y-3 px-4 pb-3 pt-4`,children:(0,$.jsxs)(V,{open:y,onOpenChange:x,children:[(0,$.jsx)(z,{asChild:!0,children:(0,$.jsxs)(c,{type:`button`,variant:`outline`,className:`w-full justify-center`,disabled:s.isPending,children:[(0,$.jsx)(j,{className:`mr-2 h-4 w-4`}),s.isPending?p(`saving`):p(`providerAdd`)]})}),(0,$.jsxs)(B,{className:`w-[42rem] max-w-[calc(100vw-2rem)] p-3`,align:`start`,children:[(0,$.jsx)(`div`,{className:`mb-2 px-1 text-xs font-semibold text-muted-foreground`,children:p(`providerTemplatePickerTitle`)}),(0,$.jsxs)(`div`,{className:`grid max-h-[24rem] grid-cols-2 gap-2 overflow-y-auto sm:grid-cols-3`,children:[(0,$.jsxs)(`button`,{type:`button`,className:`flex min-h-20 w-full flex-col items-start gap-2 rounded-lg border border-dashed border-border/70 bg-muted/20 px-3 py-2 text-left transition-colors hover:border-border hover:bg-muted/45`,onClick:async()=>{try{let e=await s.mutateAsync({data:{providerType:null}});T(``),f(e.providerId),C(t=>[e.providerId,...t.filter(t=>t!==e.providerId)]),x(!1)}catch{}},children:[(0,$.jsx)(h,{name:`custom`,className:`h-8 w-8 rounded-lg border border-border/60 bg-muted/50`}),(0,$.jsx)(`span`,{className:`line-clamp-2 min-w-0 text-xs font-semibold leading-4 text-foreground`,children:p(`providerAddCustom`)})]}),A.map(e=>(0,$.jsxs)(`button`,{type:`button`,className:`flex min-h-20 w-full flex-col items-start gap-2 rounded-lg border border-border/55 bg-muted/15 px-3 py-2 text-left transition-colors hover:border-border/80 hover:bg-muted/40`,onClick:async()=>{try{let t=await s.mutateAsync({data:{providerType:e.providerType}});T(``),f(t.providerId),C(e=>[t.providerId,...e.filter(e=>e!==t.providerId)]),x(!1)}catch{}},children:[(0,$.jsx)(h,{name:e.providerType,src:e.logo?`/logos/${e.logo}`:null,className:`h-8 w-8 rounded-lg border border-border/55 bg-background`,imgClassName:`h-4 w-4 object-contain`}),(0,$.jsx)(`span`,{className:`line-clamp-2 min-w-0 text-xs font-semibold leading-4 text-foreground`,children:e.displayName||e.providerType})]},e.providerType))]})]})]})}),(0,$.jsx)(`div`,{className:`border-b border-border/70 px-4 py-3`,children:(0,$.jsxs)(`div`,{className:`relative`,children:[(0,$.jsx)(_,{className:`pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground/70`}),(0,$.jsx)(i,{value:w,onChange:e=>T(e.target.value),placeholder:p(`providersFilterPlaceholder`),className:`h-10 rounded-xl pl-9`})]})}),(0,$.jsxs)(_e,{className:`space-y-2 p-3`,children:[N.map(e=>{let t=e.providerType?M.get(e.providerType):null,n=e.enabled!==!1,i=H(e),a=e.displayName?.trim()||t?.displayName||e.providerId,s=pt(e.apiBase||t?.defaultApiBase||``)||p(`providersDefaultDescription`);return(0,$.jsx)(`div`,{onClick:()=>f(e.providerId),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),f(e.providerId))},role:`button`,tabIndex:0,className:r(`group w-full rounded-xl p-2.5 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40`,P===e.providerId?`bg-background/95 text-foreground shadow-sm`:`bg-transparent text-muted-foreground hover:bg-background/65 hover:text-foreground`),children:(0,$.jsxs)(`div`,{className:`relative min-h-10`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3 pr-20`,children:[(0,$.jsx)(h,{name:e.providerType??e.providerId,src:t?.logo?`/logos/${t.logo}`:null,className:`h-10 w-10 rounded-lg bg-background/80`,imgClassName:`h-5 w-5 object-contain`,fallback:(0,$.jsx)(`span`,{className:`text-sm font-semibold uppercase text-muted-foreground`,children:e.providerId[0]})}),(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`p`,{className:`truncate text-sm font-semibold text-foreground`,children:a}),(0,$.jsx)(`p`,{className:`truncate font-mono text-[10px] text-muted-foreground/65`,children:e.providerId}),(0,$.jsxs)(`p`,{className:`line-clamp-1 text-[11px] text-muted-foreground`,children:[s,` · `,e.models?.length??0]})]})]}),(0,$.jsxs)(`div`,{className:`absolute right-0 top-0 flex items-center gap-1.5 opacity-70 transition-opacity group-hover:opacity-100`,children:[(0,$.jsx)(`div`,{onClick:e=>e.stopPropagation(),children:(0,$.jsx)(o,{checked:n,disabled:u.isPending,title:p(n?`disabled`:`enabled`),className:`h-[18px] w-8`,thumbClassName:`h-4 w-4 data-[state=checked]:translate-x-4`,onCheckedChange:t=>{u.mutateAsync({provider:e.providerId,data:{enabled:t},silentSuccess:!0})}})}),(0,$.jsxs)(V,{children:[(0,$.jsx)(z,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,className:`inline-flex h-7 w-7 items-center justify-center rounded-lg text-muted-foreground/70 hover:bg-muted hover:text-foreground`,onClick:e=>e.stopPropagation(),title:p(`more`),children:(0,$.jsx)(b,{className:`h-4 w-4`})})}),(0,$.jsx)(B,{className:`w-40 p-1`,align:`end`,onClick:e=>e.stopPropagation(),children:(0,$.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-2 rounded-md px-2 py-2 text-sm text-red-600 hover:bg-red-50`,onClick:()=>v(e.providerId),children:[(0,$.jsx)(I,{className:`h-4 w-4`}),p(`providerDelete`)]})})]})]}),(0,$.jsx)(m,{status:n?i?`ready`:`setup`:`inactive`,label:p(n?i?`statusReady`:`statusSetup`:`disabled`),className:`absolute bottom-0 right-0 justify-end`})]})},e.providerId)}),N.length===0?(0,$.jsx)(me,{icon:O,title:p(`providersNoMatch`)}):null]})]}),(0,$.jsx)(dt,{providerName:P??void 0,onProviderDeleted:e=>{C(t=>t.filter(t=>t!==e)),e===P&&f(null)}})]}),(0,$.jsx)(F,{open:!!g,onOpenChange:e=>{e||v(null)},title:p(`providerDelete`),description:g??void 0,confirmLabel:p(`delete`),variant:`destructive`,onCancel:()=>v(null),onConfirm:()=>{g&&l.mutateAsync({provider:g}).then(()=>{C(e=>e.filter(e=>e!==g)),g===P&&f(null),v(null)})}})]})}export{gt as ProvidersConfigPage};
1
+ import{i as e}from"./chunk-DF37yw5_.js";import{A as t,M as n,t as r}from"./utils-CBZPzC_b.js";import{Gt as i,Qt as a,Ut as o,Wt as s,Yt as c,hn as l,jn as u,vn as d}from"./api-BWFOIoUm.js";import{l as f,s as p}from"./i18n-ClHx6jwj.js";import{n as m,t as h}from"./logo-badge-C-5-zim6.js";import{t as g}from"./createLucideIcon-BNKf0_kc.js";import{t as _}from"./search-CUe41wjm.js";import{t as v}from"./chevron-down-BL-yMYcX.js";import{n as y,t as b}from"./ellipsis-C5YXdOUx.js";import{a as x,i as S,n as C,r as w,t as T}from"./select-CG5YWnwe.js";import{t as E}from"./circle-alert-lSa3LRvS.js";import{t as D}from"./eye-C84inPcV.js";import{i as O,t as k}from"./use-viewport-layout-BS18drMT.js";import{t as A}from"./loader-circle-K1BDdHR5.js";import{t as j}from"./plus-LA8-jpxP.js";import{t as M}from"./refresh-cw-h9Xq3LY3.js";import{t as N}from"./settings-2-CE3ELQyk.js";import{n as P,t as F}from"./confirm-dialog-BWS7gA_z.js";import{t as I}from"./trash-2-BPPYt2NV.js";import{t as L}from"./x-DdXOqLnX.js";import{t as R}from"./host-capabilities-B107nwS3.js";import{i as z,r as B,t as V}from"./popover-NkrFlWHp.js";import{a as H,c as ee,l as U,o as W,t as te}from"./provider-models-hrHMcHqg.js";import{a as G,c as K,d as q,f as ne,h as re,i as ie,l as ae,m as oe,o as se,p as ce,r as le,y as ue}from"./use-config-C8ZkQiTc.js";import{t as de}from"./form-actions-BRESe-m_.js";import{t as J}from"./config-hints-B_C9DAp5.js";import{a as fe,c as pe,i as me,l as he,n as ge,o as _e,r as ve,s as ye}from"./config-split-page-CxLWGwdt.js";var be=g(`CircleDotDashed`,[[`path`,{d:`M10.1 2.18a9.93 9.93 0 0 1 3.8 0`,key:`1qdqn0`}],[`path`,{d:`M17.6 3.71a9.95 9.95 0 0 1 2.69 2.7`,key:`1bq7p6`}],[`path`,{d:`M21.82 10.1a9.93 9.93 0 0 1 0 3.8`,key:`1rlaqf`}],[`path`,{d:`M20.29 17.6a9.95 9.95 0 0 1-2.7 2.69`,key:`1xk03u`}],[`path`,{d:`M13.9 21.82a9.94 9.94 0 0 1-3.8 0`,key:`l7re25`}],[`path`,{d:`M6.4 20.29a9.95 9.95 0 0 1-2.69-2.7`,key:`1v18p6`}],[`path`,{d:`M2.18 13.9a9.93 9.93 0 0 1 0-3.8`,key:`xdo6bj`}],[`path`,{d:`M3.71 6.4a9.95 9.95 0 0 1 2.7-2.69`,key:`1jjmaz`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}]]),xe=g(`EyeOff`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Y=e(n(),1),Se={providerId:``,providerType:null,isBuiltInType:!1,isCustom:!0,enabled:!0,displayName:``,apiKeySet:!1,apiKeyMasked:void 0,apiBase:null,extraHeaders:null,wireApi:null,models:[],modelConfig:{}};function X(e){if(!e)return null;let t=Object.entries(e).map(([e,t])=>[e.trim(),t]).filter(([e])=>e.length>0);return t.length===0?null:Object.fromEntries(t)}function Ce(e,t){let n=X(e),r=X(t);if(n===null&&r===null)return!0;if(!n||!r)return!1;let i=Object.entries(n).sort(([e],[t])=>e.localeCompare(t)),a=Object.entries(r).sort(([e],[t])=>e.localeCompare(t));return i.length===a.length?i.every(([e,t],n)=>e===a[n][0]&&t===a[n][1]):!1}function Z(e){if(!e||e.length===0)return[];let t=new Set;for(let n of e){let e=n.trim();e&&t.add(e)}return[...t]}function we(e,t){let n=e.trim();if(!n||!t.trim())return n;let r=`${t.trim()}/`;return n.startsWith(r)?n.slice(r.length):n}function Q(e,t){let n=e.trim();if(!n)return``;for(let e of t){let t=e.trim();t&&(n=we(n,t))}return n.trim()}function Te(e,t){return e.length===t.length?e.every((e,n)=>e===t[n]):!1}function Ee(e,t){return Z(t)}function De(e,t){return Z(e).map(e=>{let n=e.trim();return!n||n.startsWith(`${t}/`)?n:`${t}/${n}`})}function Oe(e,t){let n=new Set(t.map(e=>e.trim()).filter(Boolean)),r={};for(let[t,i]of Object.entries(e)){if(!n.has(t))continue;let e={},a=ee(i.thinking?.supported);if(a.length>0){let t=U(i.thinking?.default);e.thinking=t&&a.includes(t)?{supported:a,default:t}:{supported:a}}i.vision===!0&&(e.vision=!0),(e.thinking||e.vision===!0)&&(r[t]=e)}return r}function ke(e,t,n){return{...W(e,n),...W(t,n)}}function Ae(e,t){let n=Object.keys(e).sort(),r=Object.keys(t).sort();if(n.length!==r.length)return!1;for(let i=0;i<n.length;i+=1){let a=n[i];if(a!==r[i])return!1;let o=e[a],s=t[a];if(!o||!s||!Te([...o.thinking?.supported??[]].sort(),[...s.thinking?.supported??[]].sort())||(o.thinking?.default??null)!==(s.thinking?.default??null)||(o.vision??!1)!==(s.vision??!1))return!1}return!0}function je(e){return e.providerName?e.apiKey.trim().length>0||e.apiBase.trim()!==e.currentApiBase.trim()||!Ce(e.extraHeaders,e.currentHeaders)||e.supportsWireApi&&e.wireApi!==e.currentWireApi||!Te(e.models,e.currentEditableModels)||!Ae(e.modelConfig,e.currentModelConfig)||e.providerDisplayName.trim()!==e.effectiveDisplayName:!1}function Me(e){let t={},n=e.apiKey.trim(),r=e.apiBase.trim(),i=X(e.extraHeaders),a=e.providerDisplayName.trim();return a!==e.effectiveDisplayName&&(t.displayName=a.length>0?a:null),n.length>0&&(t.apiKey=n),r!==e.currentApiBase.trim()&&(t.apiBase=r.length>0&&r!==e.defaultApiBase?r:null),Ce(i,e.currentHeaders)||(t.extraHeaders=i),e.supportsWireApi&&e.wireApi!==e.currentWireApi&&(t.wireApi=e.wireApi),Te(e.models,e.currentEditableModels)||(t.models=De(e.models,e.providerName??``)),Ae(e.modelConfig,e.currentModelConfig)||(t.modelConfig=Oe(e.modelConfig,e.models)),t}function Ne(e){let t=Q(e.models.find(e=>e.trim().length>0)??``,e.providerModelAliases),n={...Pe(e),model:t||null};return e.supportsWireApi&&(n.wireApi=e.wireApi),n}function Pe(e){let t={apiBase:e.apiBase.trim(),extraHeaders:X(e.extraHeaders)};return e.apiKey.trim().length>0&&(t.apiKey=e.apiKey.trim()),t}function Fe(e){return p(e===`off`?`chatThinkingLevelOff`:e===`minimal`?`chatThinkingLevelMinimal`:e===`low`?`chatThinkingLevelLow`:e===`medium`?`chatThinkingLevelMedium`:e===`high`?`chatThinkingLevelHigh`:e===`adaptive`?`chatThinkingLevelAdaptive`:`chatThinkingLevelXhigh`)}function Ie(e){let{providerName:t,methods:n,defaultMethodId:r,language:i}=e;if(n.length===0)return``;let a=new Map;for(let e of n){let t=e.id.trim();t&&a.set(t.toLowerCase(),t)}let o=(...e)=>{for(let t of e){let e=a.get(t.toLowerCase());if(e)return e}},s=r?.trim();if(t===`minimax-portal`){if(i===`zh`)return o(`cn`,`china-mainland`)??o(s??``)??n[0]?.id??``;if(i===`en`)return o(`global`,`intl`,`international`)??o(s??``)??n[0]?.id??``}if(s){let e=o(s);if(e)return e}return i===`zh`?o(`cn`)??n[0]?.id??``:i===`en`?o(`global`)??n[0]?.id??``:n[0]?.id??``}function Le(e){let{required:t,hasDefault:n,optionCount:r}=e;return t&&n&&r>1&&r<=3}function Re(e,t,n){let r=Q(t,n);return r?e.includes(r)?{models:e,draft:``}:{models:[...e,r],draft:``}:{models:e,draft:t}}function ze(e,t,n){let r=[...e],i=new Set(e);for(let e of t){let t=Q(e,n);t&&!i.has(t)&&(i.add(t),r.push(t))}return{models:r,addedCount:r.length-e.length}}function Be(e,t,n){return ze(e,t,n).models.slice(e.length)}function Ve(e,t,n){let r={...t};return delete r[n],{models:e.filter(e=>e!==n),modelConfig:r}}function He(e,t,n){let r=e[t],i=r?.thinking?.supported??[],a=i.includes(n)?i.filter(e=>e!==n):te.filter(e=>e===n||i.includes(e)),o=r?.thinking?.default&&a.includes(r.thinking.default)?r.thinking.default:void 0,s={...r,thinking:a.length>0?o?{supported:a,default:o}:{supported:a}:void 0},c={...e};return s.thinking||s.vision===!0?c[t]=s:delete c[t],c}function Ue(e,t,n){let r=e[t],i=r?.thinking;return!i||i.supported.length===0||n&&!i.supported.includes(n)?e:{...e,[t]:{...r,thinking:n?{supported:i.supported,default:n}:{supported:i.supported}}}}function We(e,t,n){let r={...e[t],vision:n?!0:void 0},i={...e};return r.thinking||r.vision===!0?i[t]=r:delete i[t],i}function Ge(e){let{providerName:t,providerSpec:n,language:r}=e,i=n?.auth,a=i?.methods??[];return{providerAuth:i,providerAuthMethodOptions:a.map(e=>({value:e.id,label:e.label?.[r]||e.label?.en||e.id})),providerAuthMethods:a,preferredAuthMethodId:Ie({providerName:n?.providerType??t,methods:a,defaultMethodId:i?.defaultMethodId,language:r}),shouldUseAuthMethodPills:Le({required:i?.kind===`device_code`,hasDefault:!!i?.defaultMethodId?.trim(),optionCount:a.length})}}function Ke(e,t){let n=!!e?.supportsWireApi||t,r=(e?.wireApiOptions||[`auto`,`chat`,`responses`]).map(e=>({value:e,label:p(e===`chat`?`wireApiChat`:e===`responses`?`wireApiResponses`:`wireApiAuto`)}));return{shouldUseWireApiPills:Le({required:n,hasDefault:typeof e?.defaultWireApi==`string`&&e.defaultWireApi.length>0,optionCount:r.length}),supportsWireApi:n,wireApiSelectOptions:r}}function qe(e){let{providerName:t,providersView:n,templatesView:r,schema:i,language:a}=e,o=t?n?.providers[t]:null,s=r?.providerTemplates.find(e=>e.providerType===o?.providerType),c=o??Se,l=i?.uiHints,u=!!o?.isCustom,d=t?J(`providers.${t}.apiKey`,l):void 0,f=t?J(`providers.${t}.apiBase`,l):void 0,m=t?J(`providers.${t}.extraHeaders`,l):void 0,h=t?J(`providers.${t}.wireApi`,l):void 0,g=s?.displayName||o?.displayName||t||``,_=(c.displayName||``).trim()||g,v=c.enabled!==!1,y=u||s?.supportsModelDiscovery===!0,b=Z([s?.modelPrefix||s?.providerType||``,t||``]),x=s?.defaultApiBase||``,S=c.apiBase||x,C=X(c.extraHeaders||null),w=c.wireApi||s?.defaultWireApi||`auto`,T=Ee(Z((s?.defaultModels??[]).map(e=>Q(e,b))),Z((c.models??[]).map(e=>Q(e,b)))),E=Oe(ke(s?.modelConfig,c.modelConfig,b),T),D=s?.apiBaseHelp?.[a]||s?.apiBaseHelp?.en||f?.help||p(`providerApiBaseHelp`),O=Ge({providerName:t,providerSpec:s,language:a}),k=Ke(s,u);return{apiBaseHelpText:D,apiBaseHint:f,apiKeyHint:d,currentApiBase:S,currentEditableModels:T,currentEnabled:v,currentHeaders:C,currentModelConfig:E,currentWireApi:w,defaultApiBase:x,defaultDisplayName:g,effectiveDisplayName:_,extraHeadersHint:m,...O,providerConfig:o,providerModelAliases:b,resolvedProviderConfig:c,supportsModelDiscovery:y,wireApiHint:h,...k}}function Je(e){let{providerName:t,providerAuth:n,resolvedAuthMethodId:r}=e,i=u(),a=oe(),o=ae(),s=K(),[c,l]=(0,Y.useState)(``),[f,m]=(0,Y.useState)(null),[h,g]=(0,Y.useState)(``),_=(0,Y.useRef)(null),v=(0,Y.useCallback)(()=>{_.current!==null&&(window.clearTimeout(_.current),_.current=null)},[]),y=(0,Y.useCallback)((e,n)=>{v(),_.current=window.setTimeout(()=>{(async()=>{if(t)try{let r=await o.mutateAsync({provider:t,data:{sessionId:e}});if(r.status===`pending`){g(p(`providerAuthWaitingBrowser`)),y(e,r.nextPollMs??n);return}if(r.status===`authorized`){m(null),v(),g(p(`providerAuthCompleted`)),d.success(p(`providerAuthCompleted`)),i.invalidateQueries({queryKey:[`config`]}),i.invalidateQueries({queryKey:[`providers`]});return}m(null),v(),g(r.message||`Authorization ${r.status}.`),d.error(r.message||`Authorization ${r.status}.`)}catch(e){m(null),v();let t=e instanceof Error?e.message:String(e);g(t),d.error(`Authorization failed: ${t}`)}})()},Math.max(1e3,n))},[v,o,t,i]),b=(0,Y.useCallback)(async()=>{if(!(!t||n?.kind!==`device_code`))try{l(t),g(``);let e=await a.mutateAsync({provider:t,data:r?{methodId:r}:{}});if(!e.sessionId||!e.verificationUri)throw Error(p(`providerAuthStartFailed`));m(e.sessionId),g(`${p(`providerAuthOpenPrompt`)}${e.userCode}${p(`providerAuthOpenPromptSuffix`)}`),await R.openExternalUrl(e.verificationUri),y(e.sessionId,e.intervalMs)}catch(e){let t=e instanceof Error?e.message:String(e);m(null),v(),g(t),d.error(`${p(`providerAuthStartFailed`)}: ${t}`)}},[v,n?.kind,t,r,y,a]),x=(0,Y.useCallback)(async()=>{if(!(!t||n?.kind!==`device_code`))try{l(t),v(),m(null);let e=await s.mutateAsync({provider:t});g(`${p(`providerAuthImportStatusPrefix`)}${e.expiresAt?` (expires: ${e.expiresAt})`:``}`),d.success(p(`providerAuthImportSuccess`)),i.invalidateQueries({queryKey:[`config`]}),i.invalidateQueries({queryKey:[`providers`]})}catch(e){let t=e instanceof Error?e.message:String(e);g(t),d.error(`${p(`providerAuthImportFailed`)}: ${t}`)}},[v,s,n?.kind,t,i]);return(0,Y.useEffect)(()=>{v()},[v,t]),(0,Y.useEffect)(()=>()=>v(),[v]),{authSessionId:c===t?f:null,authStatusMessage:c===t?h:``,importAuthFromCli:x,importPending:s.isPending,startAuth:b,startPending:a.isPending}}function Ye(e){let{providerName:t,apiKey:n,apiKeyRequired:r,apiKeySet:i,apiBase:a,extraHeaders:o,supportsWireApi:s,wireApi:c,models:u,providerModelAliases:f}=e,m=re(),h=se(),g=(0,Y.useMemo)(()=>JSON.stringify({providerName:t,apiKey:n,apiBase:a,extraHeaders:o}),[a,n,o,t]),[_,v]=(0,Y.useState)(null),y=(0,Y.useCallback)(async()=>{if(t)try{let e=await m.mutateAsync({provider:t,data:Ne({apiKey:n,apiBase:a,extraHeaders:o,supportsWireApi:s,wireApi:c,models:u,providerModelAliases:f})});if(e.success){d.success(`${p(`providerTestConnectionSuccess`)} (${e.latencyMs}ms)`);return}let r=[`provider=${e.provider}`,`latency=${e.latencyMs}ms`];e.model&&r.push(`model=${e.model}`),d.error(`${p(`providerTestConnectionFailed`)}: ${e.message} | ${r.join(` | `)}`)}catch(e){let t=e instanceof Error?e.message:String(e);d.error(`${p(`providerTestConnectionFailed`)}: ${t}`)}},[a,n,o,u,f,t,s,m,c]);return{discoverModels:(0,Y.useCallback)(async()=>{if(!t)return null;if(r&&!n.trim()&&!i)return d.error(p(`providerModelsApiKeyRequired`)),null;try{let e=await h.mutateAsync({provider:t,data:Pe({apiKey:n,apiBase:a,extraHeaders:o})});return v({key:g,models:e.models}),d.success(p(`providerModelsFetchSuccess`)),e.models}catch(e){if(e instanceof l&&(e.details?.upstreamStatus===401||e.details?.upstreamStatus===403))return d.error(p(`providerModelsAuthorizationFailed`)),null;let t=e instanceof Error?e.message:String(e);return d.error(`${p(`providerModelsFetchFailed`)}: ${t}`),null}},[a,n,r,i,h,g,o,t]),fetchedModels:_?.key===g?_.models:[],isDiscoveringModels:h.isPending,isTestPending:m.isPending,testConnection:y}}var $=t();function Xe({value:e,onChange:t,className:n}){let a=e?Object.entries(e):[],o=(e,n,r)=>{let i=[...a];i[e]=[n,r],t(Object.fromEntries(i))},s=()=>{t({...e,"":``})},l=e=>{let n=a.filter((t,n)=>n!==e);t(Object.fromEntries(n))};return(0,$.jsxs)(`div`,{className:r(`space-y-2`,n),children:[a.map(([e,t],n)=>(0,$.jsxs)(`div`,{className:`flex gap-2`,children:[(0,$.jsx)(i,{type:`text`,value:e,onChange:e=>o(n,e.target.value,t),placeholder:p(`headerName`),className:`flex-1`}),(0,$.jsx)(i,{type:`text`,value:t,onChange:t=>o(n,e,t.target.value),placeholder:p(`headerValue`),className:`flex-1`}),(0,$.jsx)(c,{type:`button`,variant:`ghost`,size:`icon`,onClick:()=>l(n),children:(0,$.jsx)(I,{className:`h-4 w-4 text-red-500`})})]},n)),(0,$.jsxs)(c,{type:`button`,variant:`outline`,size:`sm`,onClick:s,children:[(0,$.jsx)(j,{className:`h-4 w-4 mr-2`}),p(`add`)]})]})}function Ze(e){let{value:t,onChange:n,options:r}=e;return(0,$.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:r.map(e=>{let r=e.value===t;return(0,$.jsx)(`button`,{type:`button`,onClick:()=>n(e.value),"aria-pressed":r,className:`rounded-full border px-3 py-1.5 text-xs font-medium transition-colors ${r?`border-foreground/15 bg-foreground text-background`:`border-border/55 bg-muted/50 text-muted-foreground hover:border-border hover:bg-muted hover:text-foreground`}`,children:e.label},e.value)})})}function Qe(e){let{showAdvanced:t,onShowAdvancedChange:n,supportsWireApi:r,wireApiLabel:i,wireApi:a,onWireApiChange:o,shouldUseWireApiPills:c,wireApiSelectOptions:l,extraHeadersLabel:u,extraHeaders:d,onExtraHeadersChange:f}=e;return(0,$.jsxs)(`div`,{className:`border-t border-border/70 pt-4`,children:[(0,$.jsxs)(`button`,{type:`button`,onClick:()=>n(!t),className:`flex w-full items-center justify-between text-sm text-muted-foreground transition-colors hover:text-foreground`,children:[(0,$.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(N,{className:`h-3.5 w-3.5`}),p(`providerAdvancedSettings`)]}),(0,$.jsx)(v,{className:`h-4 w-4 transition-transform ${t?`rotate-180`:``}`})]}),t?(0,$.jsxs)(`div`,{className:`mt-4 space-y-5`,children:[r?(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(s,{htmlFor:`wireApi`,className:`text-sm font-medium text-foreground`,children:i}),c?(0,$.jsx)(Ze,{value:a,onChange:e=>o(e),options:l}):(0,$.jsxs)(T,{value:a,onValueChange:e=>o(e),children:[(0,$.jsx)(S,{className:`rounded-xl`,children:(0,$.jsx)(x,{})}),(0,$.jsx)(C,{children:l.map(e=>(0,$.jsx)(w,{value:e.value,children:e.label},e.value))})]})]}):null,(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(s,{className:`text-sm font-medium text-foreground`,children:u}),(0,$.jsx)(Xe,{value:d,onChange:f}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:p(`providerExtraHeadersHelpShort`)})]})]}):null]})}function $e({isSet:e,className:t,value:n,onChange:a,placeholder:o,...s}){let[l,u]=(0,Y.useState)(!1),[d,f]=(0,Y.useState)(!1),p=typeof n==`string`&&n.length>0;return(0,$.jsxs)(`div`,{className:`relative`,children:[e&&!p&&!d?(0,$.jsx)(`div`,{onClick:()=>f(!0),className:r(`flex h-9 w-full rounded-xl border border-gray-200/80 bg-white px-3.5 py-2 text-sm text-gray-500 cursor-text items-center pr-12`,t),children:`••••••••••••`}):(0,$.jsx)(i,{type:l?`text`:`password`,className:r(`pr-12`,t),value:n,onChange:a,onBlur:()=>{p||f(!1)},placeholder:o,autoFocus:d,...s}),(0,$.jsx)(`div`,{className:`absolute right-2 top-1/2 -translate-y-1/2 flex gap-1`,children:(e||p)&&(0,$.jsx)(c,{type:`button`,variant:`ghost`,size:`icon`,className:`h-7 w-7`,onClick:()=>u(!l),children:l?(0,$.jsx)(xe,{className:`h-4 w-4`}):(0,$.jsx)(D,{className:`h-4 w-4`})})})]})}function et(e){let{apiKey:t,apiKeyRequired:n,apiKeySet:r,apiKeyPlaceholder:i,providerAuth:a,providerAuthNote:o,providerAuthMethodOptions:l,providerAuthMethodsCount:u,selectedAuthMethodHint:d,shouldUseAuthMethodPills:f,resolvedAuthMethodId:m,onAuthMethodChange:h,onStartProviderAuth:g,onImportProviderAuthFromCli:_,startPending:v,importPending:y,authSessionId:b,authStatusMessage:E,onApiKeyChange:D}=e,O=n?(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(s,{htmlFor:`apiKey`,className:`text-sm font-medium text-foreground`,children:p(`apiKey`)}),(0,$.jsx)($e,{id:`apiKey`,value:t,isSet:r,onChange:e=>D(e.target.value),placeholder:i,className:`rounded-xl`}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:p(`leaveBlankToKeepUnchanged`)})]}):null;return a?.kind===`device_code`?(0,$.jsxs)($.Fragment,{children:[O,(0,$.jsxs)(`div`,{className:`space-y-2 rounded-xl bg-muted/45 p-3`,children:[(0,$.jsx)(s,{className:`text-sm font-medium text-foreground`,children:a.displayName||p(`providerAuthSectionTitle`)}),o?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:o}):null,u>1?(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(s,{className:`text-xs font-medium text-foreground`,children:p(`providerAuthMethodLabel`)}),f?(0,$.jsx)(Ze,{value:m,onChange:h,options:l}):(0,$.jsxs)(T,{value:m,onValueChange:h,children:[(0,$.jsx)(S,{className:`h-8 rounded-lg`,children:(0,$.jsx)(x,{placeholder:p(`providerAuthMethodPlaceholder`)})}),(0,$.jsx)(C,{children:l.map(e=>(0,$.jsx)(w,{value:e.value,children:e.label},e.value))})]}),d?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:d}):null]}):null,(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,$.jsx)(c,{type:`button`,variant:`outline`,size:`sm`,onClick:g,disabled:v||!!b,children:p(v?`providerAuthStarting`:b?`providerAuthAuthorizing`:`providerAuthAuthorizeInBrowser`)}),a.supportsCliImport?(0,$.jsx)(c,{type:`button`,variant:`outline`,size:`sm`,onClick:_,disabled:y,children:p(y?`providerAuthImporting`:`providerAuthImportFromCli`)}):null,b?(0,$.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[p(`providerAuthSessionLabel`),`: `,b.slice(0,8),`…`]}):null]}),E?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:E}):null]})]}):O}function tt(e){let{providerName:t,models:n,aliases:r,fetchedModels:i=[],onModelsChange:a}=e,o=q({pollWhileRefreshing:!0,refreshOnMount:!0}),s=t?o.data?.providers[t]:void 0,c=i.length>0?`fetched`:`background`,l=(0,Y.useMemo)(()=>Be(n,c===`fetched`?i:s?.models??[],r),[r,s?.models,i,n,c]);return{addSuggestedModels:(0,Y.useCallback)(e=>{let t=ze(n,e,r);t.addedCount>0&&a(t.models)},[r,n,a]),hasSuggestionError:!!(s?.lastError&&!s.fetchedAt),isCheckingSuggestions:!!(t&&(o.isLoading||o.data?.refreshing&&!s)),suggestedModels:l,suggestionSource:c}}function nt(e){let{models:t,modelConfig:n,onModelsChange:r,onRemoveModel:i,onToggleModelThinkingLevel:a,onSetModelThinkingDefault:c,onSetModelVision:l,thinkingLevels:u,formatThinkingLevelLabel:d}=e,[f,m]=(0,Y.useState)(!1),[h,g]=(0,Y.useState)(()=>new Set),_=(0,Y.useMemo)(()=>t.filter(e=>h.has(e)),[t,h]),v=e=>{g(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},y=()=>{m(!1),g(new Set)};return(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(`div`,{className:`flex min-h-7 flex-wrap items-center justify-end gap-2`,children:f?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`mr-auto text-xs text-muted-foreground`,children:p(`providerModelsSuggestionsSelected`).replace(`{count}`,String(_.length))}),(0,$.jsx)(`button`,{type:`button`,className:`text-xs font-medium text-primary hover:text-primary/80`,onClick:()=>g(_.length===t.length?new Set:new Set(t)),children:p(_.length===t.length?`providerModelsClearSelection`:`providerModelsSelectAll`)}),(0,$.jsx)(`button`,{type:`button`,className:`text-xs font-medium text-muted-foreground hover:text-foreground`,onClick:y,children:p(`cancel`)}),(0,$.jsxs)(`button`,{type:`button`,disabled:_.length===0,className:`inline-flex items-center gap-1 rounded-md bg-destructive/10 px-2 py-1 text-xs font-medium text-destructive transition-colors hover:bg-destructive/15 disabled:cursor-not-allowed disabled:opacity-45`,onClick:()=>{_.length!==0&&(r(t.filter(e=>!h.has(e))),y())},children:[(0,$.jsx)(I,{className:`h-3 w-3`}),p(`providerModelsRemoveSelected`)]})]}):(0,$.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 text-xs font-medium text-muted-foreground hover:text-foreground`,onClick:()=>m(!0),children:[(0,$.jsx)(I,{className:`h-3 w-3`}),p(`providerModelsBulkRemove`)]})}),(0,$.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:t.map(e=>{if(f)return(0,$.jsxs)(`label`,{className:`inline-flex max-w-full cursor-pointer items-center gap-2 rounded-full border border-border/55 bg-muted/45 px-3 py-1.5 hover:bg-muted/70`,children:[(0,$.jsx)(`input`,{type:`checkbox`,checked:h.has(e),onChange:()=>v(e),"aria-label":p(`providerModelsSuggestionSelect`).replace(`{model}`,e),className:`h-3.5 w-3.5 shrink-0 accent-primary`}),(0,$.jsx)(`span`,{className:`max-w-[140px] truncate text-sm text-foreground sm:max-w-[220px]`,children:e})]},e);let t=n[e],r=t?.thinking,m=r?.supported??[],g=r?.default??null,_=t?.vision===!0;return(0,$.jsxs)(`div`,{className:`group inline-flex max-w-full items-center gap-1 rounded-full border border-border/55 bg-muted/45 px-3 py-1.5`,children:[(0,$.jsx)(`span`,{className:`max-w-[140px] truncate text-sm text-foreground sm:max-w-[220px]`,children:e}),(0,$.jsxs)(V,{children:[(0,$.jsx)(z,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,className:`inline-flex h-5 w-5 items-center justify-center rounded-full text-muted-foreground/70 opacity-100 transition-opacity hover:bg-muted hover:text-foreground md:opacity-0 md:group-hover:opacity-100 md:group-focus-within:opacity-100`,"aria-label":p(`providerModelThinkingTitle`),title:p(`providerModelThinkingTitle`),children:(0,$.jsx)(N,{className:`h-3 w-3`})})}),(0,$.jsxs)(B,{className:`w-80 space-y-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-lg bg-muted/50 px-3 py-2`,children:[(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`p`,{className:`text-xs font-semibold text-foreground`,children:p(`providerModelVisionTitle`)}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:p(`providerModelVisionHint`)})]}),(0,$.jsx)(o,{checked:_,onCheckedChange:t=>l(e,t)})]}),(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(`p`,{className:`text-xs font-semibold text-foreground`,children:p(`providerModelThinkingTitle`)}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:p(`providerModelThinkingHint`)})]}),(0,$.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:u.map(t=>(0,$.jsx)(`button`,{type:`button`,onClick:()=>a(e,t),className:`rounded-full border px-2.5 py-1 text-xs font-medium transition-colors ${m.includes(t)?`border-foreground/15 bg-foreground text-background`:`border-border/55 bg-muted/50 text-muted-foreground hover:border-border hover:bg-muted hover:text-foreground`}`,children:d(t)},t))}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(s,{className:`text-xs font-medium text-foreground`,children:p(`providerModelThinkingDefault`)}),(0,$.jsxs)(T,{value:g??`__none__`,onValueChange:t=>c(e,t===`__none__`?null:t),disabled:m.length===0,children:[(0,$.jsx)(S,{className:`h-8 rounded-lg text-xs`,children:(0,$.jsx)(x,{})}),(0,$.jsxs)(C,{children:[(0,$.jsx)(w,{value:`__none__`,children:p(`providerModelThinkingDefaultNone`)}),m.map(e=>(0,$.jsx)(w,{value:e,children:d(e)},e))]})]}),m.length===0?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:p(`providerModelThinkingNoSupported`)}):null]})]})]}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>i(e),className:`inline-flex h-5 w-5 items-center justify-center rounded-full text-muted-foreground/70 opacity-100 transition-opacity hover:bg-muted hover:text-foreground md:opacity-0 md:group-hover:opacity-100 md:group-focus-within:opacity-100`,"aria-label":p(`remove`),children:(0,$.jsx)(L,{className:`h-3 w-3`})})]},e)})}),f?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:p(`providerModelsRemoveSaveHint`)}):null]})}var rt=20,it=50,at=50;function ot(e){let{expanded:t,fetchedTotal:n,models:r,source:a,onExpandedChange:o,onAddModels:s}=e,[c,l]=(0,Y.useState)(``),[u,d]=(0,Y.useState)(()=>new Set),f=(0,Y.useMemo)(()=>{let e=c.trim().toLowerCase();return e?r.filter(t=>t.toLowerCase().includes(e)):r},[r,c]),m=f.slice(0,at),h=(0,Y.useMemo)(()=>r.filter(e=>u.has(e)),[r,u]),g=e=>{d(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},v=e=>{e.length!==0&&(s(e),l(``),d(new Set))},b=a===`fetched`?`providerModelsFetchedSuggestionsSummary`:`providerModelsSuggestionsSummary`;return a===`fetched`&&r.length===0?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 rounded-xl bg-muted/35 px-3 py-2 text-xs text-muted-foreground`,role:`status`,children:[(0,$.jsx)(P,{className:`h-3.5 w-3.5 shrink-0 text-primary`}),(0,$.jsx)(`span`,{children:p(`providerModelsFetchedAllConfigured`).replace(`{count}`,String(n))})]}):(0,$.jsxs)(`div`,{className:`rounded-xl bg-muted/35 p-2`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-1.5`,children:[(0,$.jsxs)(`button`,{type:`button`,"aria-expanded":t,className:`flex min-w-0 flex-1 items-center gap-1.5 rounded-lg px-2 py-1.5 text-left text-xs text-muted-foreground transition-colors hover:bg-muted/70 hover:text-foreground`,onClick:()=>o(!t),children:[(0,$.jsx)(P,{className:`h-3.5 w-3.5 shrink-0 text-primary`}),(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:p(b).replace(`{count}`,String(r.length))}),(0,$.jsx)(y,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${t?`rotate-90`:``}`})]}),r.length<=it?(0,$.jsx)(`button`,{type:`button`,className:`shrink-0 rounded-lg px-2 py-1.5 text-xs font-medium text-primary transition-colors hover:bg-primary/10`,onClick:()=>v(r),children:p(`providerModelsSuggestionsAddAll`)}):null]}),t?(0,$.jsxs)(`div`,{className:`px-1 pb-1`,children:[r.length>rt?(0,$.jsxs)(`div`,{className:`relative px-2 pb-1 pt-1.5`,children:[(0,$.jsx)(_,{className:`pointer-events-none absolute left-4 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground`}),(0,$.jsx)(i,{value:c,onChange:e=>l(e.target.value),placeholder:p(`providerModelsSuggestionsSearchPlaceholder`),className:`h-8 rounded-lg pl-8 text-xs`})]}):null,(0,$.jsxs)(`div`,{className:`custom-scrollbar max-h-44 overflow-y-auto overscroll-contain`,children:[m.map(e=>(0,$.jsxs)(`label`,{className:`grid min-w-0 cursor-pointer grid-cols-[auto_minmax(0,1fr)] items-center gap-2 rounded-lg px-2 py-1.5 hover:bg-muted/70`,children:[(0,$.jsx)(`input`,{type:`checkbox`,checked:u.has(e),onChange:()=>g(e),"aria-label":p(`providerModelsSuggestionSelect`).replace(`{model}`,e),className:`h-3.5 w-3.5 shrink-0 accent-primary`}),(0,$.jsx)(`span`,{className:`block min-w-0 truncate text-xs text-foreground`,title:e,children:e})]},e)),f.length===0?(0,$.jsx)(`p`,{className:`px-2 py-4 text-center text-xs text-muted-foreground`,children:p(`providerModelsSuggestionsSearchEmpty`)}):null]}),f.length>m.length?(0,$.jsx)(`p`,{className:`px-2 pt-1 text-[11px] text-muted-foreground`,children:p(`providerModelsSuggestionsShowing`).replace(`{visible}`,String(m.length)).replace(`{count}`,String(f.length))}):null,(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-2 pt-1.5`,children:[(0,$.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:p(`providerModelsSuggestionsSelected`).replace(`{count}`,String(h.length))}),(0,$.jsx)(`button`,{type:`button`,disabled:h.length===0,className:`shrink-0 rounded-md bg-primary/10 px-2 py-1 text-[11px] font-medium text-primary transition-colors hover:bg-primary/15 disabled:cursor-not-allowed disabled:opacity-45`,onClick:()=>v(h),children:p(`providerModelsSuggestionsAddSelected`)})]}),(0,$.jsx)(`p`,{className:`px-2 pb-1 pt-1 text-[11px] text-muted-foreground`,children:p(`providerModelsSuggestionsSaveHint`)})]}):null]})}function st({hasFetchedCatalog:e,hasSuggestionError:t,supportsModelDiscovery:n}){return!n||!t||e?null:(0,$.jsxs)(`div`,{className:`flex items-start gap-2 rounded-xl bg-destructive/10 px-3 py-2 text-xs text-destructive`,children:[(0,$.jsx)(E,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`}),p(`providerModelsSuggestionsFailed`)]})}function ct(e){let{providerName:t,providerModelAliases:n,models:r,modelConfig:a,modelDraft:o,showModelInput:l,onModelDraftChange:u,onShowModelInputChange:d,onAddModel:f,onModelsChange:m,supportsModelDiscovery:h,onDiscoverModels:g,isDiscoveringModels:_,fetchedModels:v,onRemoveModel:y,onToggleModelThinkingLevel:b,onSetModelThinkingDefault:x,onSetModelVision:S,thinkingLevels:C,formatThinkingLevelLabel:w}=e,[T,E]=(0,Y.useState)(!1),D=(0,Y.useRef)(null),{addSuggestedModels:O,hasSuggestionError:k,isCheckingSuggestions:N,suggestedModels:P,suggestionSource:F}=tt({providerName:t,models:r,aliases:n,fetchedModels:v,onModelsChange:m}),I=async()=>{await g()&&(E(!0),window.requestAnimationFrame(()=>{let e=D.current;e?.scrollIntoView?.({behavior:`smooth`,block:`center`}),e?.focus({preventScroll:!0})}))},R=v.length>0;return(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,$.jsx)(s,{className:`text-sm font-medium text-foreground`,children:p(`providerModelsTitle`)}),(0,$.jsxs)(`div`,{className:`flex items-center gap-3`,children:[h?(0,$.jsxs)(`button`,{type:`button`,onClick:I,disabled:_,className:`flex items-center gap-1 text-xs font-medium text-primary transition-colors hover:text-primary/80 disabled:cursor-wait disabled:opacity-60`,children:[(0,$.jsx)(M,{className:`h-3 w-3 ${_?`animate-spin`:``}`}),p(_?`providerModelsFetching`:`providerModelsFetch`)]}):null,l?null:(0,$.jsxs)(`button`,{type:`button`,onClick:()=>d(!0),className:`flex items-center gap-1 text-xs font-medium text-primary hover:text-primary/80`,children:[(0,$.jsx)(j,{className:`h-3 w-3`}),p(`providerAddModel`)]})]})]}),l?(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(i,{value:o,onChange:e=>u(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),f()),e.key===`Escape`&&(d(!1),u(``))},placeholder:p(`providerModelInputPlaceholder`),className:`flex-1 rounded-xl`,autoFocus:!0}),(0,$.jsx)(c,{type:`button`,size:`sm`,onClick:f,disabled:o.trim().length===0,children:p(`add`)}),(0,$.jsx)(c,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>{d(!1),u(``)},children:(0,$.jsx)(L,{className:`h-4 w-4`})})]}):null,(0,$.jsx)(st,{hasFetchedCatalog:R,hasSuggestionError:k,supportsModelDiscovery:h}),h&&N&&!R?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 rounded-xl bg-muted/35 px-3 py-2 text-xs text-muted-foreground`,children:[(0,$.jsx)(A,{className:`h-3.5 w-3.5 animate-spin`}),p(`providerModelsSuggestionsChecking`)]}):h&&(P.length>0||R)?(0,$.jsx)(`div`,{ref:D,tabIndex:-1,"aria-live":`polite`,className:`scroll-m-4 outline-none`,children:(0,$.jsx)(ot,{expanded:T,fetchedTotal:v.length,models:P,source:F,onExpandedChange:E,onAddModels:O})}):null,r.length===0?(0,$.jsxs)(`div`,{className:`rounded-xl bg-muted/35 px-4 py-6 text-center`,children:[(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:p(`providerModelsEmptyShort`)}),l?null:(0,$.jsx)(`button`,{type:`button`,onClick:()=>d(!0),className:`mt-2 text-sm font-medium text-primary hover:text-primary/80`,children:p(`providerAddFirstModel`)})]}):(0,$.jsx)(nt,{models:r,modelConfig:a,onModelsChange:m,onRemoveModel:y,onToggleModelThinkingLevel:b,onSetModelThinkingDefault:x,onSetModelVision:S,thinkingLevels:C,formatThinkingLevelLabel:w})]})}function lt({apiKeyRequired:e=!0,apiKeySet:t,className:n,enabled:r}){if(!r)return(0,$.jsx)(m,{status:`inactive`,label:p(`disabled`),className:n});let i=!e||t;return(0,$.jsx)(m,{status:i?`ready`:`setup`,label:p(i?`statusReady`:`statusSetup`),className:n})}function ut(e){let{context:t,language:n,providerTitle:r,providerDisplayName:a,apiKey:o,apiBase:l,extraHeaders:u,wireApi:d,models:f,modelConfig:m,modelDraft:h,showAdvanced:g,showModelInput:_,resolvedAuthMethodId:v,authSessionId:y,authStatusMessage:b,hasChanges:x,isDeletePending:S,isUpdatePending:C,connectivity:w,startPending:T,importPending:E,onProviderDisplayNameChange:D,onApiKeyChange:O,onApiBaseChange:k,onAuthMethodChange:A,onStartProviderAuth:j,onImportProviderAuthFromCli:M,onModelDraftChange:N,onShowModelInputChange:P,onAddModel:F,onModelsChange:L,onRemoveModel:R,onToggleModelThinkingLevel:z,onSetModelThinkingDefault:B,onSetModelVision:V,onShowAdvancedChange:H,onWireApiChange:ee,onExtraHeadersChange:U,onDeleteProvider:W,onSubmit:G,onTestConnection:K}=e,q=t.providerAuthMethods.find(e=>e.id===v);return(0,$.jsxs)(ge,{children:[(0,$.jsx)(pe,{className:`px-5 py-4`,children:(0,$.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,$.jsx)(`h3`,{className:`truncate text-lg font-semibold text-foreground`,children:r}),(0,$.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,$.jsx)(`button`,{type:`button`,onClick:W,disabled:S,className:`text-muted-foreground/70 transition-colors hover:text-red-500`,title:p(`providerDelete`),children:(0,$.jsx)(I,{className:`h-4 w-4`})}),(0,$.jsx)(lt,{enabled:t.currentEnabled,apiKeyRequired:t.resolvedProviderConfig.apiKeyRequired,apiKeySet:t.resolvedProviderConfig.apiKeySet})]})]})}),(0,$.jsxs)(`form`,{onSubmit:G,className:`flex min-h-0 flex-1 flex-col`,children:[(0,$.jsxs)(_e,{className:`space-y-4 px-5 py-4`,children:[(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(s,{htmlFor:`providerDisplayName`,className:`text-sm font-medium text-foreground`,children:p(`providerDisplayName`)}),(0,$.jsx)(i,{id:`providerDisplayName`,type:`text`,value:a,onChange:e=>D(e.target.value),placeholder:t.defaultDisplayName||p(`providerDisplayNamePlaceholder`),className:`rounded-xl`}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:p(`providerDisplayNameHelpShort`)})]}),(0,$.jsx)(et,{apiKey:o,apiKeyRequired:t.resolvedProviderConfig.apiKeyRequired!==!1,apiKeySet:t.resolvedProviderConfig.apiKeySet,apiKeyPlaceholder:t.apiKeyHint?.placeholder??p(`enterApiKey`),providerAuth:t.providerAuth,providerAuthNote:t.providerAuth?.note?.[n]||t.providerAuth?.note?.en||t.providerAuth?.displayName||``,providerAuthMethodOptions:t.providerAuthMethodOptions,providerAuthMethodsCount:t.providerAuthMethods.length,selectedAuthMethodHint:q?.hint?.[n]||q?.hint?.en||``,shouldUseAuthMethodPills:t.shouldUseAuthMethodPills,resolvedAuthMethodId:v,onAuthMethodChange:A,onStartProviderAuth:j,onImportProviderAuthFromCli:M,startPending:T,importPending:E,authSessionId:y,authStatusMessage:b,onApiKeyChange:O}),(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(s,{htmlFor:`apiBase`,className:`text-sm font-medium text-foreground`,children:p(`apiBase`)}),(0,$.jsx)(i,{id:`apiBase`,type:`text`,value:l,onChange:e=>k(e.target.value),placeholder:t.defaultApiBase||t.apiBaseHint?.placeholder||`https://api.example.com`,className:`rounded-xl`}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t.apiBaseHelpText})]}),(0,$.jsx)(ct,{providerName:t.providerConfig?.providerId??``,providerModelAliases:t.providerModelAliases,models:f,modelConfig:m,modelDraft:h,showModelInput:_,onModelDraftChange:N,onShowModelInputChange:P,onAddModel:F,onModelsChange:L,supportsModelDiscovery:t.supportsModelDiscovery,onDiscoverModels:w.discoverModels,isDiscoveringModels:w.isDiscoveringModels,fetchedModels:w.fetchedModels,onRemoveModel:R,onToggleModelThinkingLevel:z,onSetModelThinkingDefault:B,onSetModelVision:V,thinkingLevels:te,formatThinkingLevelLabel:Fe},t.providerConfig?.providerId),(0,$.jsx)(Qe,{showAdvanced:g,onShowAdvancedChange:H,supportsWireApi:t.supportsWireApi,wireApiLabel:p(`wireApi`),wireApi:d,onWireApiChange:ee,shouldUseWireApiPills:t.shouldUseWireApiPills,wireApiSelectOptions:t.wireApiSelectOptions,extraHeadersLabel:p(`extraHeaders`),extraHeaders:u,onExtraHeadersChange:U})]}),(0,$.jsx)(ye,{children:(0,$.jsxs)(de,{align:`between`,children:[(0,$.jsxs)(c,{type:`button`,variant:`outline`,size:`sm`,onClick:K,disabled:w.isTestPending,children:[(0,$.jsx)(be,{className:`mr-1.5 h-3.5 w-3.5`}),w.isTestPending?p(`providerTestingConnection`):p(`providerTestConnection`)]}),(0,$.jsx)(c,{type:`submit`,size:`sm`,disabled:C||!x,children:p(C?`saving`:x?`save`:`unchanged`)})]})})]})]})}function dt({providerName:e,onProviderDeleted:t}){let{data:n}=ce(),{data:r}=ne(),{data:i}=le(),a=f(),o=(0,Y.useMemo)(()=>qe({providerName:e,providersView:n,templatesView:r,schema:i,language:a}),[a,e,n,i,r]);if(!e||!o.providerConfig)return(0,$.jsx)(ve,{children:(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h3`,{className:`text-base font-semibold text-foreground`,children:p(`providersSelectTitle`)}),(0,$.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:p(`providersSelectDescription`)})]})});let s=JSON.stringify({providerConfig:o.providerConfig,currentApiBase:o.currentApiBase,currentEditableModels:o.currentEditableModels,currentModelConfig:o.currentModelConfig,currentWireApi:o.currentWireApi,effectiveDisplayName:o.effectiveDisplayName,preferredAuthMethodId:o.preferredAuthMethodId});return(0,$.jsx)(ft,{providerName:e,onProviderDeleted:t,context:o,language:a},s)}function ft({providerName:e,onProviderDeleted:t,context:n,language:r}){let i=ue(),a=G(),{currentApiBase:o,currentEditableModels:s,currentHeaders:c,currentModelConfig:l,currentWireApi:u,defaultApiBase:d,effectiveDisplayName:f,providerAuth:m,providerAuthMethods:h,providerModelAliases:g,resolvedProviderConfig:_,preferredAuthMethodId:v,supportsWireApi:y}=n,[b,x]=(0,Y.useState)(``),[S,C]=(0,Y.useState)(o),[w,T]=(0,Y.useState)(_.extraHeaders||null),[E,D]=(0,Y.useState)(u),[O,k]=(0,Y.useState)(s),[A,j]=(0,Y.useState)(l),[M,N]=(0,Y.useState)(``),[P,F]=(0,Y.useState)(f),[I,L]=(0,Y.useState)(!1),[R,z]=(0,Y.useState)(!1),[B,V]=(0,Y.useState)(v),H=Ye({providerName:e,apiKey:b,apiKeyRequired:_.apiKeyRequired!==!1,apiKeySet:_.apiKeySet,apiBase:S,extraHeaders:w,supportsWireApi:y,wireApi:E,models:O,providerModelAliases:g}),ee=P.trim()||f||e||p(`providersSelectPlaceholder`),U=(0,Y.useMemo)(()=>{if(!h.length)return``;let e=B.trim();return e&&h.some(t=>t.id===e)?e:v||h[0]?.id||``},[B,v,h]),{authSessionId:W,authStatusMessage:te,importAuthFromCli:K,importPending:q,startAuth:ne,startPending:re}=Je({providerName:e,providerAuth:m,resolvedAuthMethodId:U}),ie=(0,Y.useMemo)(()=>je({providerName:e,apiKey:b,apiBase:S,currentApiBase:o,extraHeaders:w,currentHeaders:c,supportsWireApi:y,wireApi:E,currentWireApi:u,models:O,currentEditableModels:s,modelConfig:A,currentModelConfig:l,providerDisplayName:P,effectiveDisplayName:f}),[e,b,S,o,w,c,y,E,u,O,s,A,l,P,f]),ae=e=>{k(e),j(t=>Oe(t,e))};return(0,$.jsx)(ut,{context:n,language:r,providerTitle:ee,providerDisplayName:P,apiKey:b,apiBase:S,extraHeaders:w,wireApi:E,models:O,modelConfig:A,modelDraft:M,showAdvanced:I,showModelInput:R,resolvedAuthMethodId:U,authSessionId:W,authStatusMessage:te,hasChanges:ie,isDeletePending:a.isPending,isUpdatePending:i.isPending,connectivity:H,startPending:re,importPending:q,onProviderDisplayNameChange:F,onApiKeyChange:x,onApiBaseChange:C,onAuthMethodChange:V,onStartProviderAuth:ne,onImportProviderAuthFromCli:K,onModelDraftChange:N,onShowModelInputChange:z,onAddModel:()=>{let e=Re(O,M,g);ae(e.models),N(e.draft)},onModelsChange:ae,onRemoveModel:e=>{let t=Ve(O,A,e);k(t.models),j(t.modelConfig)},onToggleModelThinkingLevel:(e,t)=>{j(n=>He(n,e,t))},onSetModelThinkingDefault:(e,t)=>{j(n=>Ue(n,e,t))},onSetModelVision:(e,t)=>{j(n=>We(n,e,t))},onShowAdvancedChange:L,onWireApiChange:D,onExtraHeadersChange:T,onDeleteProvider:async()=>{if(e&&window.confirm(p(`providerDeleteConfirm`)))try{await a.mutateAsync({provider:e}),t?.(e)}catch{}},onSubmit:t=>{t.preventDefault(),e&&i.mutate({provider:e,data:Me({providerName:e,apiKey:b,apiBase:S,currentApiBase:o,defaultApiBase:d,extraHeaders:w,currentHeaders:c,supportsWireApi:y,wireApi:E,currentWireApi:u,models:O,currentEditableModels:s,modelConfig:A,currentModelConfig:l,providerDisplayName:P,effectiveDisplayName:f})})},onTestConnection:H.testConnection})}function pt(e){if(!e)return null;try{let t=new URL(e);return`${t.host}${t.pathname&&t.pathname!==`/`?t.pathname:``}`}catch{return e.replace(/^https?:\/\//,``)}}function mt(e,t=[]){let n=new Map(t.map((e,t)=>[e,t]));return e.map((e,t)=>({provider:e,index:t})).sort((e,t)=>{let r=n.get(e.provider.providerId),i=n.get(t.provider.providerId);if(r!==void 0||i!==void 0)return(r??2**53-1)-(i??2**53-1);let a=e.provider.providerType===`nextclaw`?1:0,o=t.provider.providerType===`nextclaw`?1:0;return a===o?e.index-t.index:a-o}).map(({provider:e})=>e)}function ht(e){let t=e.findIndex(e=>e.providerType===`zhipu`),n=e.findIndex(e=>e.providerType===`dashscope-coding-plan`);return e.map((e,t)=>({template:e,index:t})).sort((e,r)=>{let i=({template:e,index:r})=>e.providerType===`nextclaw`?2**53-1:e.providerType===`deepseek`&&n>=0?n-.5:e.providerType===`mimo`&&t>=0?t+.5:r;return i(e)-i(r)}).map(({template:e})=>e)}function gt(){let{isMobile:e}=k(),{data:t}=ce(),{data:n}=ne(),s=ie(),l=G(),u=ue(),[d,f]=(0,Y.useState)(null),[g,v]=(0,Y.useState)(null),[y,x]=(0,Y.useState)(!1),[S,C]=(0,Y.useState)([]),[w,T]=(0,Y.useState)(``),E=(0,Y.useMemo)(()=>mt(Object.values(t?.providers??{}),S),[t?.providers,S]),D=(0,Y.useMemo)(()=>n?.providerTemplates??[],[n?.providerTemplates]),A=(0,Y.useMemo)(()=>ht(D),[D]),M=(0,Y.useMemo)(()=>new Map(D.map(e=>[e.providerType,e])),[D]),N=(0,Y.useMemo)(()=>{let e=w.trim().toLowerCase();return E.filter(t=>{if(!e)return!0;let n=t.providerType?M.get(t.providerType):null;return(t.displayName?.trim()||n?.displayName||t.providerId).toLowerCase().includes(e)||t.providerId.toLowerCase().includes(e)})},[E,w,M]),P=(0,Y.useMemo)(()=>d&&N.some(e=>e.providerId===d)?d:e?null:N[0]?.providerId??null,[N,e,d]);return!t||!n?(0,$.jsx)(a,{title:p(`providersPageTitle`),description:p(`providersPageDescription`),layout:`split`,children:(0,$.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:p(`providersLoading`)})}):(0,$.jsxs)(a,{title:p(`providersPageTitle`),description:p(`providersPageDescription`),layout:`split`,children:[(0,$.jsxs)(fe,{className:`md:min-h-0`,compactView:d?`detail`:`list`,onMobileBack:()=>f(null),mobileListLabel:p(`providersPageTitle`),children:[(0,$.jsxs)(he,{children:[(0,$.jsx)(pe,{className:`space-y-3 px-4 pb-3 pt-4`,children:(0,$.jsxs)(V,{open:y,onOpenChange:x,children:[(0,$.jsx)(z,{asChild:!0,children:(0,$.jsxs)(c,{type:`button`,variant:`outline`,className:`w-full justify-center`,disabled:s.isPending,children:[(0,$.jsx)(j,{className:`mr-2 h-4 w-4`}),s.isPending?p(`saving`):p(`providerAdd`)]})}),(0,$.jsxs)(B,{className:`w-[42rem] max-w-[calc(100vw-2rem)] p-3`,align:`start`,children:[(0,$.jsx)(`div`,{className:`mb-2 px-1 text-xs font-semibold text-muted-foreground`,children:p(`providerTemplatePickerTitle`)}),(0,$.jsxs)(`div`,{className:`grid max-h-[24rem] grid-cols-2 gap-2 overflow-y-auto sm:grid-cols-3`,children:[(0,$.jsxs)(`button`,{type:`button`,className:`flex min-h-20 w-full flex-col items-start gap-2 rounded-lg border border-dashed border-border/70 bg-muted/20 px-3 py-2 text-left transition-colors hover:border-border hover:bg-muted/45`,onClick:async()=>{try{let e=await s.mutateAsync({data:{providerType:null}});T(``),f(e.providerId),C(t=>[e.providerId,...t.filter(t=>t!==e.providerId)]),x(!1)}catch{}},children:[(0,$.jsx)(h,{name:`custom`,className:`h-8 w-8 rounded-lg border border-border/60 bg-muted/50`}),(0,$.jsx)(`span`,{className:`line-clamp-2 min-w-0 text-xs font-semibold leading-4 text-foreground`,children:p(`providerAddCustom`)})]}),A.map(e=>(0,$.jsxs)(`button`,{type:`button`,className:`flex min-h-20 w-full flex-col items-start gap-2 rounded-lg border border-border/55 bg-muted/15 px-3 py-2 text-left transition-colors hover:border-border/80 hover:bg-muted/40`,onClick:async()=>{try{let t=await s.mutateAsync({data:{providerType:e.providerType}});T(``),f(t.providerId),C(e=>[t.providerId,...e.filter(e=>e!==t.providerId)]),x(!1)}catch{}},children:[(0,$.jsx)(h,{name:e.providerType,src:e.logo?`/logos/${e.logo}`:null,className:`h-8 w-8 rounded-lg border border-border/55 bg-background`,imgClassName:`h-4 w-4 object-contain`}),(0,$.jsx)(`span`,{className:`line-clamp-2 min-w-0 text-xs font-semibold leading-4 text-foreground`,children:e.displayName||e.providerType})]},e.providerType))]})]})]})}),(0,$.jsx)(`div`,{className:`border-b border-border/70 px-4 py-3`,children:(0,$.jsxs)(`div`,{className:`relative`,children:[(0,$.jsx)(_,{className:`pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground/70`}),(0,$.jsx)(i,{value:w,onChange:e=>T(e.target.value),placeholder:p(`providersFilterPlaceholder`),className:`h-10 rounded-xl pl-9`})]})}),(0,$.jsxs)(_e,{className:`space-y-2 p-3`,children:[N.map(e=>{let t=e.providerType?M.get(e.providerType):null,n=e.enabled!==!1,i=H(e),a=e.displayName?.trim()||t?.displayName||e.providerId,s=pt(e.apiBase||t?.defaultApiBase||``)||p(`providersDefaultDescription`);return(0,$.jsx)(`div`,{onClick:()=>f(e.providerId),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),f(e.providerId))},role:`button`,tabIndex:0,className:r(`group w-full rounded-xl p-2.5 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40`,P===e.providerId?`bg-background/95 text-foreground shadow-sm`:`bg-transparent text-muted-foreground hover:bg-background/65 hover:text-foreground`),children:(0,$.jsxs)(`div`,{className:`relative min-h-10`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3 pr-20`,children:[(0,$.jsx)(h,{name:e.providerType??e.providerId,src:t?.logo?`/logos/${t.logo}`:null,className:`h-10 w-10 rounded-lg bg-background/80`,imgClassName:`h-5 w-5 object-contain`,fallback:(0,$.jsx)(`span`,{className:`text-sm font-semibold uppercase text-muted-foreground`,children:e.providerId[0]})}),(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`p`,{className:`truncate text-sm font-semibold text-foreground`,children:a}),(0,$.jsx)(`p`,{className:`truncate font-mono text-[10px] text-muted-foreground/65`,children:e.providerId}),(0,$.jsxs)(`p`,{className:`line-clamp-1 text-[11px] text-muted-foreground`,children:[s,` · `,e.models?.length??0]})]})]}),(0,$.jsxs)(`div`,{className:`absolute right-0 top-0 flex items-center gap-1.5 opacity-70 transition-opacity group-hover:opacity-100`,children:[(0,$.jsx)(`div`,{onClick:e=>e.stopPropagation(),children:(0,$.jsx)(o,{checked:n,disabled:u.isPending,title:p(n?`disabled`:`enabled`),className:`h-[18px] w-8`,thumbClassName:`h-4 w-4 data-[state=checked]:translate-x-4`,onCheckedChange:t=>{u.mutateAsync({provider:e.providerId,data:{enabled:t},silentSuccess:!0})}})}),(0,$.jsxs)(V,{children:[(0,$.jsx)(z,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,className:`inline-flex h-7 w-7 items-center justify-center rounded-lg text-muted-foreground/70 hover:bg-muted hover:text-foreground`,onClick:e=>e.stopPropagation(),title:p(`more`),children:(0,$.jsx)(b,{className:`h-4 w-4`})})}),(0,$.jsx)(B,{className:`w-40 p-1`,align:`end`,onClick:e=>e.stopPropagation(),children:(0,$.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-2 rounded-md px-2 py-2 text-sm text-red-600 hover:bg-red-50`,onClick:()=>v(e.providerId),children:[(0,$.jsx)(I,{className:`h-4 w-4`}),p(`providerDelete`)]})})]})]}),(0,$.jsx)(m,{status:n?i?`ready`:`setup`:`inactive`,label:p(n?i?`statusReady`:`statusSetup`:`disabled`),className:`absolute bottom-0 right-0 justify-end`})]})},e.providerId)}),N.length===0?(0,$.jsx)(me,{icon:O,title:p(`providersNoMatch`)}):null]})]}),(0,$.jsx)(dt,{providerName:P??void 0,onProviderDeleted:e=>{C(t=>t.filter(t=>t!==e)),e===P&&f(null)}})]}),(0,$.jsx)(F,{open:!!g,onOpenChange:e=>{e||v(null)},title:p(`providerDelete`),description:g??void 0,confirmLabel:p(`delete`),variant:`destructive`,onCancel:()=>v(null),onConfirm:()=>{g&&l.mutateAsync({provider:g}).then(()=>{C(e=>e.filter(e=>e!==g)),g===P&&f(null),v(null)})}})]})}export{gt as ProvidersConfigPage};
@@ -1 +1 @@
1
- import{A as e,i as t,t as n}from"./utils-CBZPzC_b.js";import{Jt as r,Yt as i,qt as a,vn as o}from"./api-Dffeij78.js";import{ut as s}from"./app-presenter-provider-O2tUKKGf.js";import{s as c}from"./i18n-CPjq_hQX.js";import{t as l}from"./createLucideIcon-BNKf0_kc.js";import{a as u,o as d}from"./theme-provider-DE7m9jvf.js";import{t as f}from"./x-DdXOqLnX.js";var p=l(`Smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),m=`nextclaw-pwa-install-banner-dismissed`,h=`nextclaw-pwa-install-banner-dismissed-until`;function g(){let e=y();return e?e.getItem(`nextclaw-pwa-install-banner-dismissed`)===`1`?!0:b(e):!1}function _(){let e=y();e?.setItem(m,`1`),e?.removeItem(h)}function v(){let e=y();e?.removeItem(m),e?.removeItem(h)}function y(){if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function b(e){let t=e.getItem(h);if(!t)return!1;let n=Number.parseInt(t,10);return e.removeItem(h),!Number.isFinite(n)||n<=Date.now()?!1:(e.setItem(m,`1`),!0)}function x(){return{initialized:!1,installability:`unsupported`,installMethod:`none`,blockedReason:`missing-browser-support`,dismissedInstallPrompt:g()}}var S=t(()=>x()),C=new class{constructor(){this.started=!1,this.deferredPrompt=null,this.displayModeMediaQuery=null,this.start=()=>{this.started||typeof window>`u`||(this.started=!0,window.addEventListener(`beforeinstallprompt`,this.handleBeforeInstallPrompt),window.addEventListener(`appinstalled`,this.handleAppInstalled),typeof window.matchMedia==`function`&&(this.displayModeMediaQuery=window.matchMedia(`(display-mode: standalone)`),this.bindDisplayModeListener(this.displayModeMediaQuery,this.handleDisplayModeChanged)),this.refreshState())},this.stop=()=>{!this.started||typeof window>`u`||(window.removeEventListener(`beforeinstallprompt`,this.handleBeforeInstallPrompt),window.removeEventListener(`appinstalled`,this.handleAppInstalled),this.displayModeMediaQuery&&=(this.unbindDisplayModeListener(this.displayModeMediaQuery,this.handleDisplayModeChanged),null),this.deferredPrompt=null,this.started=!1)},this.resetForTests=()=>{this.stop(),S.setState(x())},this.refreshState=()=>{let e=this.resolveInstallability();S.setState(t=>({...t,initialized:!0,installability:e.installability,installMethod:e.installMethod,blockedReason:e.blockedReason,dismissedInstallPrompt:g()}))},this.dismissInstallPrompt=()=>{_(),S.setState({dismissedInstallPrompt:!0})},this.promptInstall=async()=>{let e=this.resolveInstallability();if(e.installability!==`available`)return`unavailable`;if(e.installMethod===`manual`||!this.deferredPrompt)return`manual`;this.deferredPrompt.prompt();let t=await this.deferredPrompt.userChoice;return this.deferredPrompt=null,t.outcome===`accepted`?(v(),this.refreshState(),o.success(c(`pwaInstallAccepted`)),`accepted`):(this.dismissInstallPrompt(),this.refreshState(),`dismissed`)},this.handleBeforeInstallPrompt=e=>{e.preventDefault(),this.deferredPrompt=e,this.refreshState()},this.handleAppInstalled=()=>{this.deferredPrompt=null,v(),S.setState({dismissedInstallPrompt:!0}),o.success(c(`pwaInstalledToast`)),this.refreshState()},this.handleDisplayModeChanged=()=>{this.refreshState()},this.resolveInstallability=()=>this.isDevelopmentServer()?{installability:`unsupported`,installMethod:`none`,blockedReason:`dev-server`}:this.hasDesktopHost()?{installability:`suppressed`,installMethod:`none`,blockedReason:`desktop-host`}:this.isStandalone()?{installability:`installed`,installMethod:`none`,blockedReason:null}:this.hasInstallSurfaceSupport()?this.isEligibleInstallContext()?{installability:`available`,installMethod:this.deferredPrompt?`prompt`:`manual`,blockedReason:null}:{installability:`unsupported`,installMethod:`none`,blockedReason:`insecure-context`}:{installability:`unsupported`,installMethod:`none`,blockedReason:`missing-browser-support`},this.hasDesktopHost=()=>typeof window<`u`&&!!window.nextclawDesktop,this.hasInstallSurfaceSupport=()=>typeof window<`u`&&typeof window.matchMedia==`function`&&`serviceWorker`in navigator,this.isEligibleInstallContext=()=>typeof window>`u`?!1:window.isSecureContext||this.isTrustedLocalhost(window.location.hostname),this.isTrustedLocalhost=e=>e===`localhost`||e===`127.0.0.1`||e===`::1`||e===`[::1]`,this.isDevelopmentServer=()=>typeof window<`u`&&!1,this.isStandalone=()=>{if(typeof window>`u`)return!1;let e=window.navigator;return typeof window.matchMedia==`function`&&window.matchMedia(`(display-mode: standalone)`).matches||e.standalone===!0},this.bindDisplayModeListener=(e,t)=>{if(`addEventListener`in e){e.addEventListener(`change`,t);return}e.addListener?.(t)},this.unbindDisplayModeListener=(e,t)=>{if(`removeEventListener`in e){e.removeEventListener(`change`,t);return}e.removeListener?.(t)}}},w=e();function T(){let e=S(e=>e.installability);return(0,w.jsx)(`span`,{className:n(`inline-flex items-center rounded-full border px-3 py-1 text-xs font-medium`,e===`installed`?`bg-emerald-50 text-emerald-700 border-emerald-200`:e===`available`?`bg-amber-50 text-amber-700 border-amber-200`:`bg-gray-100 text-gray-600 border-gray-200`),children:E(e)})}function E(e){return c(e===`available`?`pwaInstallStatusAvailable`:e===`installed`?`pwaInstallStatusInstalled`:e===`suppressed`?`pwaInstallStatusDesktopHost`:`pwaInstallStatusUnavailable`)}function D(e,t,n){return c(e===`installed`?`pwaInstallCardInstalled`:e===`suppressed`?`pwaInstallCardSuppressed`:e===`available`&&t===`prompt`?`pwaInstallCardPrompt`:e===`available`?`pwaInstallCardManual`:n===`insecure-context`?`pwaInstallCardInsecureContext`:n===`dev-server`?`pwaInstallCardDevServer`:`pwaInstallCardUnsupported`)}function O(){let e=S(e=>e.installability),t=S(e=>e.installMethod),n=S(e=>e.blockedReason);return(0,w.jsx)(r,{title:c(`pwaInstallTitle`),description:c(`pwaInstallDescription`),actions:(0,w.jsx)(T,{}),children:(0,w.jsx)(a,{children:(0,w.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,w.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:D(e,t,n)}),e===`available`&&t===`prompt`?(0,w.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,w.jsxs)(i,{type:`button`,className:`gap-2`,onClick:()=>void C.promptInstall(),children:[(0,w.jsx)(s,{className:`h-4 w-4`}),c(`pwaInstallAction`)]}),(0,w.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:c(`pwaInstallPromptHint`)})]}):null,e===`available`&&t===`manual`?(0,w.jsxs)(`div`,{className:`flex items-start gap-3 rounded-xl bg-background/65 p-4`,children:[(0,w.jsx)(p,{className:`mt-0.5 h-4 w-4 text-muted-foreground`}),(0,w.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:c(`pwaInstallManualHint`)})]}):null]})})})}function k(){let e=S(e=>e.installability),t=S(e=>e.installMethod),n=S(e=>e.dismissedInstallPrompt);return e!==`available`||t!==`prompt`||n?null:(0,w.jsxs)(`div`,{className:`fixed bottom-5 right-5 z-50 w-[min(420px,calc(100vw-2rem))] rounded-[26px] border border-gray-200 bg-white/95 p-5 shadow-2xl backdrop-blur-xl`,children:[(0,w.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,w.jsxs)(`div`,{className:`space-y-1`,children:[(0,w.jsx)(`p`,{className:`text-sm font-semibold text-gray-900`,children:c(`pwaInstallBannerTitle`)}),(0,w.jsx)(`p`,{className:`text-sm leading-6 text-gray-600`,children:c(`pwaInstallBannerDescription`)})]}),(0,w.jsx)(`button`,{type:`button`,"aria-label":c(`pwaInstallDismiss`),className:`rounded-full p-1 text-gray-400 transition hover:bg-gray-100 hover:text-gray-600`,onClick:()=>{C.dismissInstallPrompt()},children:(0,w.jsx)(f,{className:`h-4 w-4`})})]}),(0,w.jsxs)(`div`,{className:`mt-4 flex items-center gap-3`,children:[(0,w.jsxs)(i,{type:`button`,size:`sm`,className:`gap-2`,onClick:()=>{C.promptInstall()},children:[(0,w.jsx)(s,{className:`h-4 w-4`}),c(`pwaInstallAction`)]}),(0,w.jsx)(i,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>{C.dismissInstallPrompt()},children:c(`pwaInstallDismiss`)})]})]})}var A=new class{constructor(){this.started=!1,this.registration=null,this.start=async()=>{if(!(this.started||typeof window>`u`)&&(this.started=!0,!(!(`serviceWorker`in navigator)||!this.isEligibleInstallContext()))){if(this.isDevelopmentServer()){await this.cleanupDevelopmentRegistrations();return}try{this.registration=await navigator.serviceWorker.register(`/sw.js`)}catch{return}}},this.stop=()=>{!this.started||typeof window>`u`||!(`serviceWorker`in navigator)||(this.started=!1,this.registration=null)},this.isEligibleInstallContext=()=>window.isSecureContext||this.isTrustedLocalhost(window.location.hostname),this.isTrustedLocalhost=e=>e===`localhost`||e===`127.0.0.1`||e===`::1`||e===`[::1]`,this.isDevelopmentServer=()=>!1,this.cleanupDevelopmentRegistrations=async()=>{if(typeof navigator.serviceWorker.getRegistrations!=`function`)return;let e=(await navigator.serviceWorker.getRegistrations()).filter(e=>[e.active?.scriptURL,e.installing?.scriptURL,e.waiting?.scriptURL].filter(e=>!!e).some(e=>e.endsWith(`/sw.js`)));await Promise.all(e.map(async e=>await e.unregister())),e.length>0&&await this.clearNextClawCaches()},this.clearNextClawCaches=async()=>{if(typeof window>`u`||!(`caches`in window)||typeof caches.keys!=`function`)return;let e=await caches.keys();await Promise.all(e.filter(e=>e.startsWith(`nextclaw-ui-`)).map(async e=>await caches.delete(e)))}}},j=!1;function M(){j||typeof window>`u`||(j=!0,C.start(),A.start())}var N={natural:`#FAF9F7`,work:`#FFFFFF`,minimal:`#FFFFFF`,warm:`#FAF8F4`,cool:`#F8FAFC`,dawn:`#FAF7F4`,graphite:`#F8F8F7`,night:`#101318`,charcoal:`#1C1C1C`,island:`#FBF8ED`,probe:`#FEFCF6`},P=new class{constructor(){this.syncTheme=e=>{if(typeof document>`u`)return;let t=N[e];this.updateThemeMeta(t),this.updateSurfaceBackgrounds(t),document.documentElement.style.colorScheme=u(e)},this.syncCurrentTheme=()=>{if(typeof document>`u`)return;let e=document.documentElement.getAttribute(`data-theme`);this.syncTheme(d(e)??`work`)},this.updateThemeMeta=e=>{let t=document.querySelector(`meta[name="theme-color"]`);t instanceof HTMLMetaElement&&(t.content=e)},this.updateSurfaceBackgrounds=e=>{document.documentElement.style.backgroundColor=e,document.body.style.backgroundColor=e;let t=document.getElementById(`root`);t&&(t.style.backgroundColor=e)}}};export{O as i,M as n,k as r,P as t};
1
+ import{A as e,i as t,t as n}from"./utils-CBZPzC_b.js";import{Jt as r,Yt as i,qt as a,vn as o}from"./api-BWFOIoUm.js";import{ut as s}from"./app-presenter-provider-CDRBc_lQ.js";import{s as c}from"./i18n-ClHx6jwj.js";import{t as l}from"./createLucideIcon-BNKf0_kc.js";import{a as u,o as d}from"./theme-provider-BvpXGXWH.js";import{t as f}from"./x-DdXOqLnX.js";var p=l(`Smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),m=`nextclaw-pwa-install-banner-dismissed`,h=`nextclaw-pwa-install-banner-dismissed-until`;function g(){let e=y();return e?e.getItem(`nextclaw-pwa-install-banner-dismissed`)===`1`?!0:b(e):!1}function _(){let e=y();e?.setItem(m,`1`),e?.removeItem(h)}function v(){let e=y();e?.removeItem(m),e?.removeItem(h)}function y(){if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function b(e){let t=e.getItem(h);if(!t)return!1;let n=Number.parseInt(t,10);return e.removeItem(h),!Number.isFinite(n)||n<=Date.now()?!1:(e.setItem(m,`1`),!0)}function x(){return{initialized:!1,installability:`unsupported`,installMethod:`none`,blockedReason:`missing-browser-support`,dismissedInstallPrompt:g()}}var S=t(()=>x()),C=new class{constructor(){this.started=!1,this.deferredPrompt=null,this.displayModeMediaQuery=null,this.start=()=>{this.started||typeof window>`u`||(this.started=!0,window.addEventListener(`beforeinstallprompt`,this.handleBeforeInstallPrompt),window.addEventListener(`appinstalled`,this.handleAppInstalled),typeof window.matchMedia==`function`&&(this.displayModeMediaQuery=window.matchMedia(`(display-mode: standalone)`),this.bindDisplayModeListener(this.displayModeMediaQuery,this.handleDisplayModeChanged)),this.refreshState())},this.stop=()=>{!this.started||typeof window>`u`||(window.removeEventListener(`beforeinstallprompt`,this.handleBeforeInstallPrompt),window.removeEventListener(`appinstalled`,this.handleAppInstalled),this.displayModeMediaQuery&&=(this.unbindDisplayModeListener(this.displayModeMediaQuery,this.handleDisplayModeChanged),null),this.deferredPrompt=null,this.started=!1)},this.resetForTests=()=>{this.stop(),S.setState(x())},this.refreshState=()=>{let e=this.resolveInstallability();S.setState(t=>({...t,initialized:!0,installability:e.installability,installMethod:e.installMethod,blockedReason:e.blockedReason,dismissedInstallPrompt:g()}))},this.dismissInstallPrompt=()=>{_(),S.setState({dismissedInstallPrompt:!0})},this.promptInstall=async()=>{let e=this.resolveInstallability();if(e.installability!==`available`)return`unavailable`;if(e.installMethod===`manual`||!this.deferredPrompt)return`manual`;this.deferredPrompt.prompt();let t=await this.deferredPrompt.userChoice;return this.deferredPrompt=null,t.outcome===`accepted`?(v(),this.refreshState(),o.success(c(`pwaInstallAccepted`)),`accepted`):(this.dismissInstallPrompt(),this.refreshState(),`dismissed`)},this.handleBeforeInstallPrompt=e=>{e.preventDefault(),this.deferredPrompt=e,this.refreshState()},this.handleAppInstalled=()=>{this.deferredPrompt=null,v(),S.setState({dismissedInstallPrompt:!0}),o.success(c(`pwaInstalledToast`)),this.refreshState()},this.handleDisplayModeChanged=()=>{this.refreshState()},this.resolveInstallability=()=>this.isDevelopmentServer()?{installability:`unsupported`,installMethod:`none`,blockedReason:`dev-server`}:this.hasDesktopHost()?{installability:`suppressed`,installMethod:`none`,blockedReason:`desktop-host`}:this.isStandalone()?{installability:`installed`,installMethod:`none`,blockedReason:null}:this.hasInstallSurfaceSupport()?this.isEligibleInstallContext()?{installability:`available`,installMethod:this.deferredPrompt?`prompt`:`manual`,blockedReason:null}:{installability:`unsupported`,installMethod:`none`,blockedReason:`insecure-context`}:{installability:`unsupported`,installMethod:`none`,blockedReason:`missing-browser-support`},this.hasDesktopHost=()=>typeof window<`u`&&!!window.nextclawDesktop,this.hasInstallSurfaceSupport=()=>typeof window<`u`&&typeof window.matchMedia==`function`&&`serviceWorker`in navigator,this.isEligibleInstallContext=()=>typeof window>`u`?!1:window.isSecureContext||this.isTrustedLocalhost(window.location.hostname),this.isTrustedLocalhost=e=>e===`localhost`||e===`127.0.0.1`||e===`::1`||e===`[::1]`,this.isDevelopmentServer=()=>typeof window<`u`&&!1,this.isStandalone=()=>{if(typeof window>`u`)return!1;let e=window.navigator;return typeof window.matchMedia==`function`&&window.matchMedia(`(display-mode: standalone)`).matches||e.standalone===!0},this.bindDisplayModeListener=(e,t)=>{if(`addEventListener`in e){e.addEventListener(`change`,t);return}e.addListener?.(t)},this.unbindDisplayModeListener=(e,t)=>{if(`removeEventListener`in e){e.removeEventListener(`change`,t);return}e.removeListener?.(t)}}},w=e();function T(){let e=S(e=>e.installability);return(0,w.jsx)(`span`,{className:n(`inline-flex items-center rounded-full border px-3 py-1 text-xs font-medium`,e===`installed`?`bg-emerald-50 text-emerald-700 border-emerald-200`:e===`available`?`bg-amber-50 text-amber-700 border-amber-200`:`bg-gray-100 text-gray-600 border-gray-200`),children:E(e)})}function E(e){return c(e===`available`?`pwaInstallStatusAvailable`:e===`installed`?`pwaInstallStatusInstalled`:e===`suppressed`?`pwaInstallStatusDesktopHost`:`pwaInstallStatusUnavailable`)}function D(e,t,n){return c(e===`installed`?`pwaInstallCardInstalled`:e===`suppressed`?`pwaInstallCardSuppressed`:e===`available`&&t===`prompt`?`pwaInstallCardPrompt`:e===`available`?`pwaInstallCardManual`:n===`insecure-context`?`pwaInstallCardInsecureContext`:n===`dev-server`?`pwaInstallCardDevServer`:`pwaInstallCardUnsupported`)}function O(){let e=S(e=>e.installability),t=S(e=>e.installMethod),n=S(e=>e.blockedReason);return(0,w.jsx)(r,{title:c(`pwaInstallTitle`),description:c(`pwaInstallDescription`),actions:(0,w.jsx)(T,{}),children:(0,w.jsx)(a,{children:(0,w.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,w.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:D(e,t,n)}),e===`available`&&t===`prompt`?(0,w.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,w.jsxs)(i,{type:`button`,className:`gap-2`,onClick:()=>void C.promptInstall(),children:[(0,w.jsx)(s,{className:`h-4 w-4`}),c(`pwaInstallAction`)]}),(0,w.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:c(`pwaInstallPromptHint`)})]}):null,e===`available`&&t===`manual`?(0,w.jsxs)(`div`,{className:`flex items-start gap-3 rounded-xl bg-background/65 p-4`,children:[(0,w.jsx)(p,{className:`mt-0.5 h-4 w-4 text-muted-foreground`}),(0,w.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:c(`pwaInstallManualHint`)})]}):null]})})})}function k(){let e=S(e=>e.installability),t=S(e=>e.installMethod),n=S(e=>e.dismissedInstallPrompt);return e!==`available`||t!==`prompt`||n?null:(0,w.jsxs)(`div`,{className:`fixed bottom-5 right-5 z-50 w-[min(420px,calc(100vw-2rem))] rounded-[26px] border border-gray-200 bg-white/95 p-5 shadow-2xl backdrop-blur-xl`,children:[(0,w.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,w.jsxs)(`div`,{className:`space-y-1`,children:[(0,w.jsx)(`p`,{className:`text-sm font-semibold text-gray-900`,children:c(`pwaInstallBannerTitle`)}),(0,w.jsx)(`p`,{className:`text-sm leading-6 text-gray-600`,children:c(`pwaInstallBannerDescription`)})]}),(0,w.jsx)(`button`,{type:`button`,"aria-label":c(`pwaInstallDismiss`),className:`rounded-full p-1 text-gray-400 transition hover:bg-gray-100 hover:text-gray-600`,onClick:()=>{C.dismissInstallPrompt()},children:(0,w.jsx)(f,{className:`h-4 w-4`})})]}),(0,w.jsxs)(`div`,{className:`mt-4 flex items-center gap-3`,children:[(0,w.jsxs)(i,{type:`button`,size:`sm`,className:`gap-2`,onClick:()=>{C.promptInstall()},children:[(0,w.jsx)(s,{className:`h-4 w-4`}),c(`pwaInstallAction`)]}),(0,w.jsx)(i,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>{C.dismissInstallPrompt()},children:c(`pwaInstallDismiss`)})]})]})}var A=new class{constructor(){this.started=!1,this.registration=null,this.start=async()=>{if(!(this.started||typeof window>`u`)&&(this.started=!0,!(!(`serviceWorker`in navigator)||!this.isEligibleInstallContext()))){if(this.isDevelopmentServer()){await this.cleanupDevelopmentRegistrations();return}try{this.registration=await navigator.serviceWorker.register(`/sw.js`)}catch{return}}},this.stop=()=>{!this.started||typeof window>`u`||!(`serviceWorker`in navigator)||(this.started=!1,this.registration=null)},this.isEligibleInstallContext=()=>window.isSecureContext||this.isTrustedLocalhost(window.location.hostname),this.isTrustedLocalhost=e=>e===`localhost`||e===`127.0.0.1`||e===`::1`||e===`[::1]`,this.isDevelopmentServer=()=>!1,this.cleanupDevelopmentRegistrations=async()=>{if(typeof navigator.serviceWorker.getRegistrations!=`function`)return;let e=(await navigator.serviceWorker.getRegistrations()).filter(e=>[e.active?.scriptURL,e.installing?.scriptURL,e.waiting?.scriptURL].filter(e=>!!e).some(e=>e.endsWith(`/sw.js`)));await Promise.all(e.map(async e=>await e.unregister())),e.length>0&&await this.clearNextClawCaches()},this.clearNextClawCaches=async()=>{if(typeof window>`u`||!(`caches`in window)||typeof caches.keys!=`function`)return;let e=await caches.keys();await Promise.all(e.filter(e=>e.startsWith(`nextclaw-ui-`)).map(async e=>await caches.delete(e)))}}},j=!1;function M(){j||typeof window>`u`||(j=!0,C.start(),A.start())}var N={natural:`#FAF9F7`,work:`#FFFFFF`,minimal:`#FFFFFF`,warm:`#FAF8F4`,cool:`#F8FAFC`,dawn:`#FAF7F4`,graphite:`#F8F8F7`,night:`#101318`,charcoal:`#1C1C1C`,island:`#FBF8ED`,probe:`#FEFCF6`},P=new class{constructor(){this.syncTheme=e=>{if(typeof document>`u`)return;let t=N[e];this.updateThemeMeta(t),this.updateSurfaceBackgrounds(t),document.documentElement.style.colorScheme=u(e)},this.syncCurrentTheme=()=>{if(typeof document>`u`)return;let e=document.documentElement.getAttribute(`data-theme`);this.syncTheme(d(e)??`work`)},this.updateThemeMeta=e=>{let t=document.querySelector(`meta[name="theme-color"]`);t instanceof HTMLMetaElement&&(t.content=e)},this.updateSurfaceBackgrounds=e=>{document.documentElement.style.backgroundColor=e,document.body.style.backgroundColor=e;let t=document.getElementById(`root`);t&&(t.style.backgroundColor=e)}}};export{O as i,M as n,k as r,P as t};
@@ -1,4 +1,4 @@
1
- import{n as e}from"./chunk-Y2CYZVJY-CA3ymQuH.js";import{m as t,p as n}from"./src-CLPoo5iL.js";import{D as r,H as i,K as a,U as o,a as s,c,f as l,v as u,w as d,x as f,y as p,z as m}from"./chunk-WYO6CB5R-6wjFTXNP.js";import{t as h}from"./linear-DlCeG66S.js";var g=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,3],r=[1,4],i=[1,5],a=[1,6],o=[1,7],s=[1,4,5,10,12,13,14,15,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],c=[1,4,5,10,12,13,14,15,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],l=[55,56,57],u=[2,36],d=[1,37],f=[1,36],p=[1,38],m=[1,35],h=[1,43],g=[1,41],_=[1,45],v=[1,14],y=[1,23],b=[1,18],x=[1,19],S=[1,20],C=[1,21],w=[1,22],T=[1,24],E=[1,25],D=[1,26],O=[1,27],k=[1,28],A=[1,29],j=[1,32],M=[1,33],N=[1,34],P=[1,39],F=[1,40],I=[1,42],L=[1,44],R=[1,63],z=[1,62],B=[4,5,8,10,12,13,14,15,18,44,47,49,55,56,57,63,64,65,66,67],ee=[1,66],te=[1,67],ne=[1,68],re=[1,69],ie=[1,70],ae=[1,71],oe=[1,72],se=[1,73],ce=[1,74],le=[1,75],ue=[1,76],de=[1,77],V=[4,5,6,7,8,9,10,11,12,13,14,15,18],H=[1,91],U=[1,92],W=[1,93],G=[1,100],K=[1,94],q=[1,97],J=[1,95],Y=[1,96],X=[1,98],Z=[1,99],fe=[1,103],pe=[10,55,56,57],Q=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],me={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,idStringToken:3,ALPHA:4,NUM:5,NODE_STRING:6,DOWN:7,MINUS:8,DEFAULT:9,COMMA:10,COLON:11,AMP:12,BRKT:13,MULT:14,UNICODE_TEXT:15,styleComponent:16,UNIT:17,SPACE:18,STYLE:19,PCT:20,idString:21,style:22,stylesOpt:23,classDefStatement:24,CLASSDEF:25,start:26,eol:27,QUADRANT:28,document:29,line:30,statement:31,axisDetails:32,quadrantDetails:33,points:34,title:35,title_value:36,acc_title:37,acc_title_value:38,acc_descr:39,acc_descr_value:40,acc_descr_multiline_value:41,section:42,text:43,point_start:44,point_x:45,point_y:46,class_name:47,"X-AXIS":48,"AXIS-TEXT-DELIMITER":49,"Y-AXIS":50,QUADRANT_1:51,QUADRANT_2:52,QUADRANT_3:53,QUADRANT_4:54,NEWLINE:55,SEMI:56,EOF:57,alphaNumToken:58,textNoTagsToken:59,STR:60,MD_STR:61,alphaNum:62,PUNCTUATION:63,PLUS:64,EQUALS:65,DOT:66,UNDERSCORE:67,$accept:0,$end:1},terminals_:{2:`error`,4:`ALPHA`,5:`NUM`,6:`NODE_STRING`,7:`DOWN`,8:`MINUS`,9:`DEFAULT`,10:`COMMA`,11:`COLON`,12:`AMP`,13:`BRKT`,14:`MULT`,15:`UNICODE_TEXT`,17:`UNIT`,18:`SPACE`,19:`STYLE`,20:`PCT`,25:`CLASSDEF`,28:`QUADRANT`,35:`title`,36:`title_value`,37:`acc_title`,38:`acc_title_value`,39:`acc_descr`,40:`acc_descr_value`,41:`acc_descr_multiline_value`,42:`section`,44:`point_start`,45:`point_x`,46:`point_y`,47:`class_name`,48:`X-AXIS`,49:`AXIS-TEXT-DELIMITER`,50:`Y-AXIS`,51:`QUADRANT_1`,52:`QUADRANT_2`,53:`QUADRANT_3`,54:`QUADRANT_4`,55:`NEWLINE`,56:`SEMI`,57:`EOF`,60:`STR`,61:`MD_STR`,63:`PUNCTUATION`,64:`PLUS`,65:`EQUALS`,66:`DOT`,67:`UNDERSCORE`},productions_:[0,[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[21,1],[21,2],[22,1],[22,2],[23,1],[23,3],[24,5],[26,2],[26,2],[26,2],[29,0],[29,2],[30,2],[31,0],[31,1],[31,2],[31,1],[31,1],[31,1],[31,2],[31,2],[31,2],[31,1],[31,1],[34,4],[34,5],[34,5],[34,6],[32,4],[32,3],[32,2],[32,4],[32,3],[32,2],[33,2],[33,2],[33,2],[33,2],[27,1],[27,1],[27,1],[43,1],[43,2],[43,1],[43,1],[62,1],[62,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[59,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 23:this.$=a[s];break;case 24:this.$=a[s-1]+``+a[s];break;case 26:this.$=a[s-1]+a[s];break;case 27:this.$=[a[s].trim()];break;case 28:a[s-2].push(a[s].trim()),this.$=a[s-2];break;case 29:this.$=a[s-4],r.addClass(a[s-2],a[s]);break;case 37:this.$=[];break;case 42:this.$=a[s].trim(),r.setDiagramTitle(this.$);break;case 43:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 44:case 45:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 46:r.addSection(a[s].substr(8)),this.$=a[s].substr(8);break;case 47:r.addPoint(a[s-3],``,a[s-1],a[s],[]);break;case 48:r.addPoint(a[s-4],a[s-3],a[s-1],a[s],[]);break;case 49:r.addPoint(a[s-4],``,a[s-2],a[s-1],a[s]);break;case 50:r.addPoint(a[s-5],a[s-4],a[s-2],a[s-1],a[s]);break;case 51:r.setXAxisLeftText(a[s-2]),r.setXAxisRightText(a[s]);break;case 52:a[s-1].text+=` ⟶ `,r.setXAxisLeftText(a[s-1]);break;case 53:r.setXAxisLeftText(a[s]);break;case 54:r.setYAxisBottomText(a[s-2]),r.setYAxisTopText(a[s]);break;case 55:a[s-1].text+=` ⟶ `,r.setYAxisBottomText(a[s-1]);break;case 56:r.setYAxisBottomText(a[s]);break;case 57:r.setQuadrant1Text(a[s]);break;case 58:r.setQuadrant2Text(a[s]);break;case 59:r.setQuadrant3Text(a[s]);break;case 60:r.setQuadrant4Text(a[s]);break;case 64:this.$={text:a[s],type:`text`};break;case 65:this.$={text:a[s-1].text+``+a[s],type:a[s-1].type};break;case 66:this.$={text:a[s],type:`text`};break;case 67:this.$={text:a[s],type:`markdown`};break;case 68:this.$=a[s];break;case 69:this.$=a[s-1]+``+a[s];break}},`anonymous`),table:[{18:n,26:1,27:2,28:r,55:i,56:a,57:o},{1:[3]},{18:n,26:8,27:2,28:r,55:i,56:a,57:o},{18:n,26:9,27:2,28:r,55:i,56:a,57:o},t(s,[2,33],{29:10}),t(c,[2,61]),t(c,[2,62]),t(c,[2,63]),{1:[2,30]},{1:[2,31]},t(l,u,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:d,5:f,10:p,12:m,13:h,14:g,15:_,18:v,25:y,35:b,37:x,39:S,41:C,42:w,48:T,50:E,51:D,52:O,53:k,54:A,60:j,61:M,63:N,64:P,65:F,66:I,67:L}),t(s,[2,34]),{27:46,55:i,56:a,57:o},t(l,[2,37]),t(l,u,{24:13,32:15,33:16,34:17,43:30,58:31,31:47,4:d,5:f,10:p,12:m,13:h,14:g,15:_,18:v,25:y,35:b,37:x,39:S,41:C,42:w,48:T,50:E,51:D,52:O,53:k,54:A,60:j,61:M,63:N,64:P,65:F,66:I,67:L}),t(l,[2,39]),t(l,[2,40]),t(l,[2,41]),{36:[1,48]},{38:[1,49]},{40:[1,50]},t(l,[2,45]),t(l,[2,46]),{18:[1,51]},{4:d,5:f,10:p,12:m,13:h,14:g,15:_,43:52,58:31,60:j,61:M,63:N,64:P,65:F,66:I,67:L},{4:d,5:f,10:p,12:m,13:h,14:g,15:_,43:53,58:31,60:j,61:M,63:N,64:P,65:F,66:I,67:L},{4:d,5:f,10:p,12:m,13:h,14:g,15:_,43:54,58:31,60:j,61:M,63:N,64:P,65:F,66:I,67:L},{4:d,5:f,10:p,12:m,13:h,14:g,15:_,43:55,58:31,60:j,61:M,63:N,64:P,65:F,66:I,67:L},{4:d,5:f,10:p,12:m,13:h,14:g,15:_,43:56,58:31,60:j,61:M,63:N,64:P,65:F,66:I,67:L},{4:d,5:f,10:p,12:m,13:h,14:g,15:_,43:57,58:31,60:j,61:M,63:N,64:P,65:F,66:I,67:L},{4:d,5:f,8:R,10:p,12:m,13:h,14:g,15:_,18:z,44:[1,58],47:[1,59],58:61,59:60,63:N,64:P,65:F,66:I,67:L},t(B,[2,64]),t(B,[2,66]),t(B,[2,67]),t(B,[2,70]),t(B,[2,71]),t(B,[2,72]),t(B,[2,73]),t(B,[2,74]),t(B,[2,75]),t(B,[2,76]),t(B,[2,77]),t(B,[2,78]),t(B,[2,79]),t(B,[2,80]),t(B,[2,81]),t(s,[2,35]),t(l,[2,38]),t(l,[2,42]),t(l,[2,43]),t(l,[2,44]),{3:65,4:ee,5:te,6:ne,7:re,8:ie,9:ae,10:oe,11:se,12:ce,13:le,14:ue,15:de,21:64},t(l,[2,53],{59:60,58:61,4:d,5:f,8:R,10:p,12:m,13:h,14:g,15:_,18:z,49:[1,78],63:N,64:P,65:F,66:I,67:L}),t(l,[2,56],{59:60,58:61,4:d,5:f,8:R,10:p,12:m,13:h,14:g,15:_,18:z,49:[1,79],63:N,64:P,65:F,66:I,67:L}),t(l,[2,57],{59:60,58:61,4:d,5:f,8:R,10:p,12:m,13:h,14:g,15:_,18:z,63:N,64:P,65:F,66:I,67:L}),t(l,[2,58],{59:60,58:61,4:d,5:f,8:R,10:p,12:m,13:h,14:g,15:_,18:z,63:N,64:P,65:F,66:I,67:L}),t(l,[2,59],{59:60,58:61,4:d,5:f,8:R,10:p,12:m,13:h,14:g,15:_,18:z,63:N,64:P,65:F,66:I,67:L}),t(l,[2,60],{59:60,58:61,4:d,5:f,8:R,10:p,12:m,13:h,14:g,15:_,18:z,63:N,64:P,65:F,66:I,67:L}),{45:[1,80]},{44:[1,81]},t(B,[2,65]),t(B,[2,82]),t(B,[2,83]),t(B,[2,84]),{3:83,4:ee,5:te,6:ne,7:re,8:ie,9:ae,10:oe,11:se,12:ce,13:le,14:ue,15:de,18:[1,82]},t(V,[2,23]),t(V,[2,1]),t(V,[2,2]),t(V,[2,3]),t(V,[2,4]),t(V,[2,5]),t(V,[2,6]),t(V,[2,7]),t(V,[2,8]),t(V,[2,9]),t(V,[2,10]),t(V,[2,11]),t(V,[2,12]),t(l,[2,52],{58:31,43:84,4:d,5:f,10:p,12:m,13:h,14:g,15:_,60:j,61:M,63:N,64:P,65:F,66:I,67:L}),t(l,[2,55],{58:31,43:85,4:d,5:f,10:p,12:m,13:h,14:g,15:_,60:j,61:M,63:N,64:P,65:F,66:I,67:L}),{46:[1,86]},{45:[1,87]},{4:H,5:U,6:W,8:G,11:K,13:q,16:90,17:J,18:Y,19:X,20:Z,22:89,23:88},t(V,[2,24]),t(l,[2,51],{59:60,58:61,4:d,5:f,8:R,10:p,12:m,13:h,14:g,15:_,18:z,63:N,64:P,65:F,66:I,67:L}),t(l,[2,54],{59:60,58:61,4:d,5:f,8:R,10:p,12:m,13:h,14:g,15:_,18:z,63:N,64:P,65:F,66:I,67:L}),t(l,[2,47],{22:89,16:90,23:101,4:H,5:U,6:W,8:G,11:K,13:q,17:J,18:Y,19:X,20:Z}),{46:[1,102]},t(l,[2,29],{10:fe}),t(pe,[2,27],{16:104,4:H,5:U,6:W,8:G,11:K,13:q,17:J,18:Y,19:X,20:Z}),t(Q,[2,25]),t(Q,[2,13]),t(Q,[2,14]),t(Q,[2,15]),t(Q,[2,16]),t(Q,[2,17]),t(Q,[2,18]),t(Q,[2,19]),t(Q,[2,20]),t(Q,[2,21]),t(Q,[2,22]),t(l,[2,49],{10:fe}),t(l,[2,48],{22:89,16:90,23:105,4:H,5:U,6:W,8:G,11:K,13:q,17:J,18:Y,19:X,20:Z}),{4:H,5:U,6:W,8:G,11:K,13:q,16:90,17:J,18:Y,19:X,20:Z,22:106},t(Q,[2,26]),t(l,[2,50],{10:fe}),t(pe,[2,28],{16:104,4:H,5:U,6:W,8:G,11:K,13:q,17:J,18:Y,19:X,20:Z})],defaultActions:{8:[2,30],9:[2,31]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
1
+ import{n as e}from"./chunk-Y2CYZVJY-Frut-1TF.js";import{m as t,p as n}from"./src-CYpUlx-4.js";import{D as r,H as i,K as a,U as o,a as s,c,f as l,v as u,w as d,x as f,y as p,z as m}from"./chunk-WYO6CB5R-zeNXGm20.js";import{t as h}from"./linear-CTe9mKUw.js";var g=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,3],r=[1,4],i=[1,5],a=[1,6],o=[1,7],s=[1,4,5,10,12,13,14,15,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],c=[1,4,5,10,12,13,14,15,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],l=[55,56,57],u=[2,36],d=[1,37],f=[1,36],p=[1,38],m=[1,35],h=[1,43],g=[1,41],_=[1,45],v=[1,14],y=[1,23],b=[1,18],x=[1,19],S=[1,20],C=[1,21],w=[1,22],T=[1,24],E=[1,25],D=[1,26],O=[1,27],k=[1,28],A=[1,29],j=[1,32],M=[1,33],N=[1,34],P=[1,39],F=[1,40],I=[1,42],L=[1,44],R=[1,63],z=[1,62],B=[4,5,8,10,12,13,14,15,18,44,47,49,55,56,57,63,64,65,66,67],ee=[1,66],te=[1,67],ne=[1,68],re=[1,69],ie=[1,70],ae=[1,71],oe=[1,72],se=[1,73],ce=[1,74],le=[1,75],ue=[1,76],de=[1,77],V=[4,5,6,7,8,9,10,11,12,13,14,15,18],H=[1,91],U=[1,92],W=[1,93],G=[1,100],K=[1,94],q=[1,97],J=[1,95],Y=[1,96],X=[1,98],Z=[1,99],fe=[1,103],pe=[10,55,56,57],Q=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],me={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,idStringToken:3,ALPHA:4,NUM:5,NODE_STRING:6,DOWN:7,MINUS:8,DEFAULT:9,COMMA:10,COLON:11,AMP:12,BRKT:13,MULT:14,UNICODE_TEXT:15,styleComponent:16,UNIT:17,SPACE:18,STYLE:19,PCT:20,idString:21,style:22,stylesOpt:23,classDefStatement:24,CLASSDEF:25,start:26,eol:27,QUADRANT:28,document:29,line:30,statement:31,axisDetails:32,quadrantDetails:33,points:34,title:35,title_value:36,acc_title:37,acc_title_value:38,acc_descr:39,acc_descr_value:40,acc_descr_multiline_value:41,section:42,text:43,point_start:44,point_x:45,point_y:46,class_name:47,"X-AXIS":48,"AXIS-TEXT-DELIMITER":49,"Y-AXIS":50,QUADRANT_1:51,QUADRANT_2:52,QUADRANT_3:53,QUADRANT_4:54,NEWLINE:55,SEMI:56,EOF:57,alphaNumToken:58,textNoTagsToken:59,STR:60,MD_STR:61,alphaNum:62,PUNCTUATION:63,PLUS:64,EQUALS:65,DOT:66,UNDERSCORE:67,$accept:0,$end:1},terminals_:{2:`error`,4:`ALPHA`,5:`NUM`,6:`NODE_STRING`,7:`DOWN`,8:`MINUS`,9:`DEFAULT`,10:`COMMA`,11:`COLON`,12:`AMP`,13:`BRKT`,14:`MULT`,15:`UNICODE_TEXT`,17:`UNIT`,18:`SPACE`,19:`STYLE`,20:`PCT`,25:`CLASSDEF`,28:`QUADRANT`,35:`title`,36:`title_value`,37:`acc_title`,38:`acc_title_value`,39:`acc_descr`,40:`acc_descr_value`,41:`acc_descr_multiline_value`,42:`section`,44:`point_start`,45:`point_x`,46:`point_y`,47:`class_name`,48:`X-AXIS`,49:`AXIS-TEXT-DELIMITER`,50:`Y-AXIS`,51:`QUADRANT_1`,52:`QUADRANT_2`,53:`QUADRANT_3`,54:`QUADRANT_4`,55:`NEWLINE`,56:`SEMI`,57:`EOF`,60:`STR`,61:`MD_STR`,63:`PUNCTUATION`,64:`PLUS`,65:`EQUALS`,66:`DOT`,67:`UNDERSCORE`},productions_:[0,[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[21,1],[21,2],[22,1],[22,2],[23,1],[23,3],[24,5],[26,2],[26,2],[26,2],[29,0],[29,2],[30,2],[31,0],[31,1],[31,2],[31,1],[31,1],[31,1],[31,2],[31,2],[31,2],[31,1],[31,1],[34,4],[34,5],[34,5],[34,6],[32,4],[32,3],[32,2],[32,4],[32,3],[32,2],[33,2],[33,2],[33,2],[33,2],[27,1],[27,1],[27,1],[43,1],[43,2],[43,1],[43,1],[62,1],[62,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[59,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 23:this.$=a[s];break;case 24:this.$=a[s-1]+``+a[s];break;case 26:this.$=a[s-1]+a[s];break;case 27:this.$=[a[s].trim()];break;case 28:a[s-2].push(a[s].trim()),this.$=a[s-2];break;case 29:this.$=a[s-4],r.addClass(a[s-2],a[s]);break;case 37:this.$=[];break;case 42:this.$=a[s].trim(),r.setDiagramTitle(this.$);break;case 43:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 44:case 45:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 46:r.addSection(a[s].substr(8)),this.$=a[s].substr(8);break;case 47:r.addPoint(a[s-3],``,a[s-1],a[s],[]);break;case 48:r.addPoint(a[s-4],a[s-3],a[s-1],a[s],[]);break;case 49:r.addPoint(a[s-4],``,a[s-2],a[s-1],a[s]);break;case 50:r.addPoint(a[s-5],a[s-4],a[s-2],a[s-1],a[s]);break;case 51:r.setXAxisLeftText(a[s-2]),r.setXAxisRightText(a[s]);break;case 52:a[s-1].text+=` ⟶ `,r.setXAxisLeftText(a[s-1]);break;case 53:r.setXAxisLeftText(a[s]);break;case 54:r.setYAxisBottomText(a[s-2]),r.setYAxisTopText(a[s]);break;case 55:a[s-1].text+=` ⟶ `,r.setYAxisBottomText(a[s-1]);break;case 56:r.setYAxisBottomText(a[s]);break;case 57:r.setQuadrant1Text(a[s]);break;case 58:r.setQuadrant2Text(a[s]);break;case 59:r.setQuadrant3Text(a[s]);break;case 60:r.setQuadrant4Text(a[s]);break;case 64:this.$={text:a[s],type:`text`};break;case 65:this.$={text:a[s-1].text+``+a[s],type:a[s-1].type};break;case 66:this.$={text:a[s],type:`text`};break;case 67:this.$={text:a[s],type:`markdown`};break;case 68:this.$=a[s];break;case 69:this.$=a[s-1]+``+a[s];break}},`anonymous`),table:[{18:n,26:1,27:2,28:r,55:i,56:a,57:o},{1:[3]},{18:n,26:8,27:2,28:r,55:i,56:a,57:o},{18:n,26:9,27:2,28:r,55:i,56:a,57:o},t(s,[2,33],{29:10}),t(c,[2,61]),t(c,[2,62]),t(c,[2,63]),{1:[2,30]},{1:[2,31]},t(l,u,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:d,5:f,10:p,12:m,13:h,14:g,15:_,18:v,25:y,35:b,37:x,39:S,41:C,42:w,48:T,50:E,51:D,52:O,53:k,54:A,60:j,61:M,63:N,64:P,65:F,66:I,67:L}),t(s,[2,34]),{27:46,55:i,56:a,57:o},t(l,[2,37]),t(l,u,{24:13,32:15,33:16,34:17,43:30,58:31,31:47,4:d,5:f,10:p,12:m,13:h,14:g,15:_,18:v,25:y,35:b,37:x,39:S,41:C,42:w,48:T,50:E,51:D,52:O,53:k,54:A,60:j,61:M,63:N,64:P,65:F,66:I,67:L}),t(l,[2,39]),t(l,[2,40]),t(l,[2,41]),{36:[1,48]},{38:[1,49]},{40:[1,50]},t(l,[2,45]),t(l,[2,46]),{18:[1,51]},{4:d,5:f,10:p,12:m,13:h,14:g,15:_,43:52,58:31,60:j,61:M,63:N,64:P,65:F,66:I,67:L},{4:d,5:f,10:p,12:m,13:h,14:g,15:_,43:53,58:31,60:j,61:M,63:N,64:P,65:F,66:I,67:L},{4:d,5:f,10:p,12:m,13:h,14:g,15:_,43:54,58:31,60:j,61:M,63:N,64:P,65:F,66:I,67:L},{4:d,5:f,10:p,12:m,13:h,14:g,15:_,43:55,58:31,60:j,61:M,63:N,64:P,65:F,66:I,67:L},{4:d,5:f,10:p,12:m,13:h,14:g,15:_,43:56,58:31,60:j,61:M,63:N,64:P,65:F,66:I,67:L},{4:d,5:f,10:p,12:m,13:h,14:g,15:_,43:57,58:31,60:j,61:M,63:N,64:P,65:F,66:I,67:L},{4:d,5:f,8:R,10:p,12:m,13:h,14:g,15:_,18:z,44:[1,58],47:[1,59],58:61,59:60,63:N,64:P,65:F,66:I,67:L},t(B,[2,64]),t(B,[2,66]),t(B,[2,67]),t(B,[2,70]),t(B,[2,71]),t(B,[2,72]),t(B,[2,73]),t(B,[2,74]),t(B,[2,75]),t(B,[2,76]),t(B,[2,77]),t(B,[2,78]),t(B,[2,79]),t(B,[2,80]),t(B,[2,81]),t(s,[2,35]),t(l,[2,38]),t(l,[2,42]),t(l,[2,43]),t(l,[2,44]),{3:65,4:ee,5:te,6:ne,7:re,8:ie,9:ae,10:oe,11:se,12:ce,13:le,14:ue,15:de,21:64},t(l,[2,53],{59:60,58:61,4:d,5:f,8:R,10:p,12:m,13:h,14:g,15:_,18:z,49:[1,78],63:N,64:P,65:F,66:I,67:L}),t(l,[2,56],{59:60,58:61,4:d,5:f,8:R,10:p,12:m,13:h,14:g,15:_,18:z,49:[1,79],63:N,64:P,65:F,66:I,67:L}),t(l,[2,57],{59:60,58:61,4:d,5:f,8:R,10:p,12:m,13:h,14:g,15:_,18:z,63:N,64:P,65:F,66:I,67:L}),t(l,[2,58],{59:60,58:61,4:d,5:f,8:R,10:p,12:m,13:h,14:g,15:_,18:z,63:N,64:P,65:F,66:I,67:L}),t(l,[2,59],{59:60,58:61,4:d,5:f,8:R,10:p,12:m,13:h,14:g,15:_,18:z,63:N,64:P,65:F,66:I,67:L}),t(l,[2,60],{59:60,58:61,4:d,5:f,8:R,10:p,12:m,13:h,14:g,15:_,18:z,63:N,64:P,65:F,66:I,67:L}),{45:[1,80]},{44:[1,81]},t(B,[2,65]),t(B,[2,82]),t(B,[2,83]),t(B,[2,84]),{3:83,4:ee,5:te,6:ne,7:re,8:ie,9:ae,10:oe,11:se,12:ce,13:le,14:ue,15:de,18:[1,82]},t(V,[2,23]),t(V,[2,1]),t(V,[2,2]),t(V,[2,3]),t(V,[2,4]),t(V,[2,5]),t(V,[2,6]),t(V,[2,7]),t(V,[2,8]),t(V,[2,9]),t(V,[2,10]),t(V,[2,11]),t(V,[2,12]),t(l,[2,52],{58:31,43:84,4:d,5:f,10:p,12:m,13:h,14:g,15:_,60:j,61:M,63:N,64:P,65:F,66:I,67:L}),t(l,[2,55],{58:31,43:85,4:d,5:f,10:p,12:m,13:h,14:g,15:_,60:j,61:M,63:N,64:P,65:F,66:I,67:L}),{46:[1,86]},{45:[1,87]},{4:H,5:U,6:W,8:G,11:K,13:q,16:90,17:J,18:Y,19:X,20:Z,22:89,23:88},t(V,[2,24]),t(l,[2,51],{59:60,58:61,4:d,5:f,8:R,10:p,12:m,13:h,14:g,15:_,18:z,63:N,64:P,65:F,66:I,67:L}),t(l,[2,54],{59:60,58:61,4:d,5:f,8:R,10:p,12:m,13:h,14:g,15:_,18:z,63:N,64:P,65:F,66:I,67:L}),t(l,[2,47],{22:89,16:90,23:101,4:H,5:U,6:W,8:G,11:K,13:q,17:J,18:Y,19:X,20:Z}),{46:[1,102]},t(l,[2,29],{10:fe}),t(pe,[2,27],{16:104,4:H,5:U,6:W,8:G,11:K,13:q,17:J,18:Y,19:X,20:Z}),t(Q,[2,25]),t(Q,[2,13]),t(Q,[2,14]),t(Q,[2,15]),t(Q,[2,16]),t(Q,[2,17]),t(Q,[2,18]),t(Q,[2,19]),t(Q,[2,20]),t(Q,[2,21]),t(Q,[2,22]),t(l,[2,49],{10:fe}),t(l,[2,48],{22:89,16:90,23:105,4:H,5:U,6:W,8:G,11:K,13:q,17:J,18:Y,19:X,20:Z}),{4:H,5:U,6:W,8:G,11:K,13:q,16:90,17:J,18:Y,19:X,20:Z,22:106},t(Q,[2,26]),t(l,[2,50],{10:fe}),t(pe,[2,28],{16:104,4:H,5:U,6:W,8:G,11:K,13:q,17:J,18:Y,19:X,20:Z})],defaultActions:{8:[2,30],9:[2,31]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
2
2
  `+h.showPosition()+`
3
3
  Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};me.lexer=(function(){return{EOF:1,parseError:e(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:e(function(e,t){return this.yy=t||this.yy||{},this._input=e,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:e(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:e(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=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),n.length-1&&(this.yylineno-=n.length-1);var i=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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:e(function(){return this._more=!0,this},`more`),reject:e(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:e(function(e){this.unput(this.match.slice(e))},`less`),pastInput:e(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:e(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:e(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
@@ -0,0 +1 @@
1
+ import"./chunk-KEIR6QF5-CuZFOa6q.js";import{n as e}from"./chunk-QBLGF6JB-CH4UKoCF.js";export{e as createRadarServices};
@@ -0,0 +1 @@
1
+ import"./chunk-KEIR6QF5-CuZFOa6q.js";import{n as e}from"./chunk-5TONJI2A-_3dxVdnY.js";export{e as createRailroadServices};
@@ -0,0 +1 @@
1
+ import"./chunk-KEIR6QF5-CuZFOa6q.js";import{n as e}from"./chunk-5HE753X5-CDIH0_y3.js";export{e as createRailroadAbnfServices};
@@ -0,0 +1 @@
1
+ import"./chunk-KEIR6QF5-CuZFOa6q.js";import{n as e}from"./chunk-U6XO7XAA-BjH2VUHU.js";export{e as createRailroadEbnfServices};
@@ -0,0 +1 @@
1
+ import"./chunk-KEIR6QF5-CuZFOa6q.js";import{n as e}from"./chunk-JG7HCLWE-CdgwBpW7.js";export{e as createRailroadPegServices};