decocms 4.374.1 → 4.375.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 (373) hide show
  1. package/dist/client/assets/{AlertCircle-CvB24fpQ.js → AlertCircle-BI1-7G_T.js} +1 -1
  2. package/dist/client/assets/{AreaChart-CC-VldiG.js → AreaChart-DtIBv_u2.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-CuPXwhY9.js → ArrowLeft-C7E68hAX.js} +1 -1
  4. package/dist/client/assets/{ArrowRight-DaeNVQjU.js → ArrowRight-Dvm5zccu.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-CMB2_B55.js → ArrowUp-CeEuKFtz.js} +1 -1
  6. package/dist/client/assets/{CartesianChart-fcGDW8tl.js → CartesianChart-DiSH3Vx4.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-L9rxLy8_.js → CheckCircle-Dhae72wt.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-Dy-cXbOz.js → ChevronUp-DLj1P2Yi.js} +1 -1
  9. package/dist/client/assets/{Copy01-KomJ49aq.js → Copy01-BSU2TbGt.js} +1 -1
  10. package/dist/client/assets/{CreditCard01-DNXTqT2E.js → CreditCard01-rQeWrMiX.js} +1 -1
  11. package/dist/client/assets/{DotsVertical-CycZdUV6.js → DotsVertical-Bpcc3aU6.js} +1 -1
  12. package/dist/client/assets/{Download01-CK_3UsO1.js → Download01-C7Po_zTZ.js} +1 -1
  13. package/dist/client/assets/{ErrorBarContext-C_8xGdFw.js → ErrorBarContext-CFqnzxdu.js} +1 -1
  14. package/dist/client/assets/{Eye-KAte8whD.js → Eye-BMH8bL1o.js} +1 -1
  15. package/dist/client/assets/{Globe01-BmMm30Hp.js → Globe01-B8Fw27to.js} +1 -1
  16. package/dist/client/assets/{Globe04-D2pxwWDa.js → Globe04-DiaT8ud7.js} +1 -1
  17. package/dist/client/assets/{Image01-BHoZzJSj.js → Image01-8GW5hNSe.js} +1 -1
  18. package/dist/client/assets/{Key01-BiLmhCHZ.js → Key01-BlY-YbB_.js} +1 -1
  19. package/dist/client/assets/{LayoutLeft-Dk8cMo-H.js → LayoutLeft-CRUlRVYr.js} +1 -1
  20. package/dist/client/assets/{Line-QF9kobp-.js → Line-wWCkiK5e.js} +1 -1
  21. package/dist/client/assets/{Link01-BSX_7wIu.js → Link01-Cx5QfFm-.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-COMF34Up.js → LinkExternal01-CiW1JxGO.js} +1 -1
  23. package/dist/client/assets/{Monitor01-C25vfwGa.js → Monitor01-D_u2VBNm.js} +1 -1
  24. package/dist/client/assets/{Package-BCflABQ6.js → Package-5wNrOSeZ.js} +1 -1
  25. package/dist/client/assets/{Palette-By8W7B7e.js → Palette-D-JKiEQc.js} +1 -1
  26. package/dist/client/assets/{Play-C6orNG1z.js → Play-C3paeMv9.js} +1 -1
  27. package/dist/client/assets/{Plus-BuCQnPNG.js → Plus-DtW_ZAb1.js} +1 -1
  28. package/dist/client/assets/{SearchLg-VMEsA-e7.js → SearchLg-dxZebJdV.js} +1 -1
  29. package/dist/client/assets/{SearchMd-DnahVlUn.js → SearchMd-CYWyu5N6.js} +1 -1
  30. package/dist/client/assets/{Sector-CzI1MlO5.js → Sector-BG5qLfZm.js} +1 -1
  31. package/dist/client/assets/{Settings02-BZd-qcWS.js → Settings02-BST604Dz.js} +1 -1
  32. package/dist/client/assets/{Share07-tpVfUX9-.js → Share07-D1cfUHPt.js} +1 -1
  33. package/dist/client/assets/{Stars01-BcbLgM7d.js → Stars01-C7tX23wY.js} +1 -1
  34. package/dist/client/assets/{Sun-C6ausIaw.js → Sun-DYyCG7at.js} +1 -1
  35. package/dist/client/assets/{Tool01-BlcXvpRH.js → Tool01-uWjCo1g4.js} +1 -1
  36. package/dist/client/assets/{Tool02-BcSzj1eN.js → Tool02-C01DHNkH.js} +1 -1
  37. package/dist/client/assets/{Trash01-Bt7knSgw.js → Trash01-CuAclZjJ.js} +1 -1
  38. package/dist/client/assets/{TrendUp01-kAJZHj1O.js → TrendUp01-DDcnGTKu.js} +1 -1
  39. package/dist/client/assets/{Upload01-CgS71RUS.js → Upload01-C_WGdZv1.js} +1 -1
  40. package/dist/client/assets/{User01-DKY_ILGI.js → User01-BtTyL8Q1.js} +1 -1
  41. package/dist/client/assets/{UserSquare-DU12tvTU.js → UserSquare-DseugbrQ.js} +1 -1
  42. package/dist/client/assets/{Users01-COWDl5zV.js → Users01-DcFsssIu.js} +1 -1
  43. package/dist/client/assets/{X-DcceC-EQ.js → X-DvXoapdv.js} +1 -1
  44. package/dist/client/assets/{XCircle-BirmII4v.js → XCircle-IF6IhAA6.js} +1 -1
  45. package/dist/client/assets/{XClose-CZo1KF0t.js → XClose-DV3Gf7XO.js} +1 -1
  46. package/dist/client/assets/{Zap-CIXkomUE.js → Zap-3MjslAd_.js} +1 -1
  47. package/dist/client/assets/{ZoomOut-CvMfmw42.js → ZoomOut-CmGFFntk.js} +1 -1
  48. package/dist/client/assets/{access-gate-BkpH0rYV.js → access-gate-BzmM6oxY.js} +1 -1
  49. package/dist/client/assets/{add-connection-dialog-DDFaH4NS.js → add-connection-dialog-D-qRDxvj.js} +1 -1
  50. package/dist/client/assets/{agent-analytics-DI585OA2.js → agent-analytics-smucAkLj.js} +1 -1
  51. package/dist/client/assets/agent-app-x_Rm4WGj.js +1 -0
  52. package/dist/client/assets/agent-assets-CLJ5OX6e.js +1 -0
  53. package/dist/client/assets/{agent-automation-CoXN7oT_.js → agent-automation-CFAGaP8l.js} +1 -1
  54. package/dist/client/assets/{agent-automations-Dh2ldvlj.js → agent-automations-BHCDA4--.js} +1 -1
  55. package/dist/client/assets/{agent-connect-sources-p5uTnj09.js → agent-connect-sources-7wd232rO.js} +1 -1
  56. package/dist/client/assets/agent-deck-C-uXPiCc.js +1 -0
  57. package/dist/client/assets/{agent-e2e-CgjMtxKa.js → agent-e2e-DcyQRI-0.js} +1 -1
  58. package/dist/client/assets/{agent-experiments-Z90gGdDa.js → agent-experiments-B01FeZKr.js} +1 -1
  59. package/dist/client/assets/agent-file-DfTcN9rV.js +1 -0
  60. package/dist/client/assets/{agent-git-8ujBeOTw.js → agent-git-DVbYIVmK.js} +2 -2
  61. package/dist/client/assets/{agent-hosting-Bzvqx7RN.js → agent-hosting-D77MUjq-.js} +1 -1
  62. package/dist/client/assets/{agent-icon-Bbnm30MH.js → agent-icon-CB6qOgGd.js} +1 -1
  63. package/dist/client/assets/agent-library-file-BbSJ9eSF.js +1 -0
  64. package/dist/client/assets/{agent-monitor-pcRQgKqs.js → agent-monitor-DUdJ3jIv.js} +1 -1
  65. package/dist/client/assets/{agent-overview-wBMo3ArI.js → agent-overview-BLq3g-uv.js} +1 -1
  66. package/dist/client/assets/agent-settings-D7S8zdvD.js +1 -0
  67. package/dist/client/assets/{agent-site-editor-B_7293-6.js → agent-site-editor-BsPAglDy.js} +1 -1
  68. package/dist/client/assets/agent-site-editor-code-R25H_qVE.js +2 -0
  69. package/dist/client/assets/agent-site-editor-content-GFspdniw.js +2 -0
  70. package/dist/client/assets/{agent-site-editor-preview-BoUgjuFc.js → agent-site-editor-preview-J-wwVAJd.js} +3 -3
  71. package/dist/client/assets/agent-view-BPulnPyH.js +1 -0
  72. package/dist/client/assets/{agent-view-guard-CE-w87FC.js → agent-view-guard-NkVREFXG.js} +1 -1
  73. package/dist/client/assets/{agents-list-DYu2megT.js → agents-list-CuqRd0XO.js} +1 -1
  74. package/dist/client/assets/{ai-providers-C4xd0vpP.js → ai-providers-C6O4KvR1.js} +2 -2
  75. package/dist/client/assets/{alert-JJIsthFC.js → alert-BqDw83Zr.js} +1 -1
  76. package/dist/client/assets/{alert-dialog-DQ7VA4it.js → alert-dialog-Cwo6u0Rd.js} +1 -1
  77. package/dist/client/assets/{api-keys-Da7XeDcP.js → api-keys-D2_4Kgi1.js} +1 -1
  78. package/dist/client/assets/api-keys-tBRZg_0R.js +1 -0
  79. package/dist/client/assets/app-editor-h2HqcY-W.js +1 -0
  80. package/dist/client/assets/{asset-utils-Ckrgql68.js → asset-utils-DFfJ7SbA.js} +1 -1
  81. package/dist/client/assets/{auth-BAIe_T8g.js → auth-C673ACq9.js} +1 -1
  82. package/dist/client/assets/{auth-catchall-C3HcGo7O.js → auth-catchall-DCl9R8ez.js} +1 -1
  83. package/dist/client/assets/{auth-entry-CXeBQuWy.js → auth-entry-GzlRhrO7.js} +1 -1
  84. package/dist/client/assets/{auth-split-layout-BLHoHl9d.js → auth-split-layout-C04c2KsR.js} +1 -1
  85. package/dist/client/assets/{authenticate-and-persist-oauth-B_2a5Vfr.js → authenticate-and-persist-oauth-D7US-yKl.js} +1 -1
  86. package/dist/client/assets/{automation-list-row-zcGZ57kC.js → automation-list-row-CPHwWy2p.js} +1 -1
  87. package/dist/client/assets/{automation-runs-CO5cfbAL.js → automation-runs-DxfhwHuV.js} +1 -1
  88. package/dist/client/assets/automations-BJ_8vGY-.js +1 -0
  89. package/dist/client/assets/{autosend-DrbiZ7KD.js → autosend-C_B7nqHB.js} +1 -1
  90. package/dist/client/assets/{avatar-DAAVe66-.js → avatar-DeEBt3V6.js} +1 -1
  91. package/dist/client/assets/{badge-Cxdo9MSD.js → badge-CTOzYKcw.js} +1 -1
  92. package/dist/client/assets/{block-document-BmtOSR_U.js → block-document-p1v2niSl.js} +3 -3
  93. package/dist/client/assets/{blocks-preview-workspace-context-B9WGUHQW.js → blocks-preview-workspace-context-cspKlB4e.js} +1 -1
  94. package/dist/client/assets/{breadcrumb-Cl92-rSB.js → breadcrumb-D_dKwwik.js} +1 -1
  95. package/dist/client/assets/{buckets-IfbnGi1h.js → buckets-Bb80omnE.js} +1 -1
  96. package/dist/client/assets/{build-improve-prompt-doc-BjB8yBFt.js → build-improve-prompt-doc-4VuHodwx.js} +1 -1
  97. package/dist/client/assets/{bulk-category-panel-BCXzorgr.js → bulk-category-panel-D0Zx1WOc.js} +1 -1
  98. package/dist/client/assets/{calendar-D29VArmq.js → calendar-Cp1CsC2G.js} +1 -1
  99. package/dist/client/assets/{capability-load-error-BML32Rgk.js → capability-load-error-CPK5gzZD.js} +1 -1
  100. package/dist/client/assets/category-editor-CkLv7gDy.js +1 -0
  101. package/dist/client/assets/{chart-DPH16IOZ.js → chart-C_3KaMyn.js} +1 -1
  102. package/dist/client/assets/{chat-context-BSf3NsZt.js → chat-context-9vL2FEPm.js} +5 -5
  103. package/dist/client/assets/{chat-draft-CYnWSaLo.js → chat-draft-BfGVY5UT.js} +1 -1
  104. package/dist/client/assets/{checkbox-Dabg6CvC.js → checkbox-CzlOjnq8.js} +1 -1
  105. package/dist/client/assets/{choose-editor-Cp-nak_V.js → choose-editor-BKH0c2th.js} +1 -1
  106. package/dist/client/assets/{cli-auth-success-Cn8-SffB.js → cli-auth-success-Bv_-kJFI.js} +1 -1
  107. package/dist/client/assets/{client-icons-I35gtKUf.js → client-icons-DWXRTDgi.js} +1 -1
  108. package/dist/client/assets/{collapsible-Cc5z9cdY.js → collapsible-CbjXckba.js} +1 -1
  109. package/dist/client/assets/{collection-detail-DjBn5zYW.js → collection-detail-DMMWvL23.js} +1 -1
  110. package/dist/client/assets/{collection-display-button-BMj7QQEq.js → collection-display-button-DDOKmMN0.js} +1 -1
  111. package/dist/client/assets/{collection-search-ACimtR3t.js → collection-search-C3Nd4_WF.js} +1 -1
  112. package/dist/client/assets/{collection-table-wrapper-D6uxp16B.js → collection-table-wrapper-B-FFQlMk.js} +1 -1
  113. package/dist/client/assets/{collection-tabs-wZHzLlos.js → collection-tabs-BTNTMmYy.js} +1 -1
  114. package/dist/client/assets/{combobox-CFiHpYi-.js → combobox-DJpsl8XJ.js} +1 -1
  115. package/dist/client/assets/{command-uelHA4Qc.js → command-Cd7TqAMz.js} +1 -1
  116. package/dist/client/assets/{companion-mcps-section-CElJkf6T.js → companion-mcps-section-C51wKLDC.js} +1 -1
  117. package/dist/client/assets/{connect-C1wR3kQS.js → connect-DL2wIZjF.js} +2 -2
  118. package/dist/client/assets/{connect-layout-CEjyLlsQ.js → connect-layout-DlpViE9y.js} +1 -1
  119. package/dist/client/assets/{connection-card-z-DTL8a8.js → connection-card-BC6VQgEM.js} +1 -1
  120. package/dist/client/assets/{connection-detail-DTW_zDz8.js → connection-detail-CUwTeXbu.js} +1 -1
  121. package/dist/client/assets/{connection-form-helpers-w89tRjJb.js → connection-form-helpers-Dhjm3H4V.js} +1 -1
  122. package/dist/client/assets/{connection-CCOtyiTz.js → connection-pRtqDo5s.js} +1 -1
  123. package/dist/client/assets/{connections-BCg7O22V.js → connections-OTQGx-8T.js} +1 -1
  124. package/dist/client/assets/{create-organization-dialog-DgZgs9aG.js → create-organization-dialog-F-F4v3Bl.js} +1 -1
  125. package/dist/client/assets/{decofile-api-BCvZWky6.js → decofile-api-CPSMqNwB.js} +1 -1
  126. package/dist/client/assets/{decopilot-JzsJWa1H.js → decopilot-Byyy6GRB.js} +2 -2
  127. package/dist/client/assets/{dialog-BVRmgEZZ.js → dialog-Djn7c9nl.js} +1 -1
  128. package/dist/client/assets/{discover-CPUegLX9.js → discover-CgHIqstZ.js} +1 -1
  129. package/dist/client/assets/{domain-settings-BL6MiMeP.js → domain-settings-BVYaDlxU.js} +1 -1
  130. package/dist/client/assets/{download-app-dialog-BSQlf9Pn.js → download-app-dialog-CPQDFMO_.js} +1 -1
  131. package/dist/client/assets/{drawer-BwM5wPz_.js → drawer-CcumUZPh.js} +1 -1
  132. package/dist/client/assets/{editor-B9nqdqUb.js → editor-Bq1ZBF8A.js} +1 -1
  133. package/dist/client/assets/{empty-state-CUy_IWGW.js → empty-state-BRQafZPm.js} +1 -1
  134. package/dist/client/assets/{empty-state-CyI2CaLY.js → empty-state-C2oFPF-n.js} +1 -1
  135. package/dist/client/assets/{extract-connection-data-BYtH8M2u.js → extract-connection-data-C8xiH7IM.js} +1 -1
  136. package/dist/client/assets/{feature-gate-Cf4hZv0B.js → feature-gate-_oqPdUHE.js} +1 -1
  137. package/dist/client/assets/{feature-paywall-BSg5h6Wb.js → feature-paywall-Ipi4hKsO.js} +1 -1
  138. package/dist/client/assets/{file-explorer-BaQZtdi0.js → file-explorer-B1pmunvu.js} +1 -1
  139. package/dist/client/assets/{file-preview-C3-dWXmK.js → file-preview-BADsX5FY.js} +1 -1
  140. package/dist/client/assets/{file-share-button-BuCRyD4f.js → file-share-button-CJVW9-2r.js} +1 -1
  141. package/dist/client/assets/{file-type-icon-Dg8sADAf.js → file-type-icon-61vCm4NO.js} +1 -1
  142. package/dist/client/assets/{folder-icon-DA4ZaB45.js → folder-icon-DLuVHdgH.js} +1 -1
  143. package/dist/client/assets/{form-DwCt2SR2.js → form-D-nyx1PA.js} +1 -1
  144. package/dist/client/assets/{gateway-client-D0oBW_qu.js → gateway-client-Dy7XUNem.js} +1 -1
  145. package/dist/client/assets/{general-B9q-xe3O.js → general-CHWPS_9e.js} +1 -1
  146. package/dist/client/assets/{github-icon-C0b5ErP6.js → github-icon-YTcHmNlJ.js} +1 -1
  147. package/dist/client/assets/{home-Dd28TK1r.js → home-DgPPVff1.js} +1 -1
  148. package/dist/client/assets/{hooks-D0h9yhqP.js → hooks-Tk18TRVH.js} +2 -2
  149. package/dist/client/assets/{hooks-DZN1ZKP-.js → hooks-p4Q94DpI.js} +1 -1
  150. package/dist/client/assets/{icon-button-DU-Ln0Ge.js → icon-button-BDccBwxx.js} +1 -1
  151. package/dist/client/assets/{index--5vhPfMl.js → index-BmOHjvYS.js} +1 -1
  152. package/dist/client/assets/{index-BNah-P_g.css → index-CCCwF5vG.css} +1 -1
  153. package/dist/client/assets/{index-BfbICK5t.js → index-CQSV5NNK.js} +1 -1
  154. package/dist/client/assets/{index-AOu8Y3dB.js → index-CVBQnECc.js} +1 -1
  155. package/dist/client/assets/{index-CB_d_Ww9.js → index-CXUyZtYP.js} +1 -1
  156. package/dist/client/assets/index-D5yWNDr1.js +1 -0
  157. package/dist/client/assets/{index-0kHkZucW.js → index-DRlLQrFc.js} +1 -1
  158. package/dist/client/assets/{index-BfTKB7dV.js → index-Di_BAeVO.js} +1 -1
  159. package/dist/client/assets/{index-CjolVbvM.js → index-DopULJi0.js} +1 -1
  160. package/dist/client/assets/{index-ChGB7Srd.js → index-Dvd4Od7g.js} +1 -1
  161. package/dist/client/assets/{index-B4_5ne-m.js → index-ViRfM1Gu.js} +54 -54
  162. package/dist/client/assets/{index-B4Sw3hof.js → index-X2eOQPgI.js} +1 -1
  163. package/dist/client/assets/{index-IS0010-i.js → index-YBhFd3U8.js} +1 -1
  164. package/dist/client/assets/{index-BK4gf4on.js → index-aoyaciW5.js} +1 -1
  165. package/dist/client/assets/{index-redirect-BeZh12s-.js → index-redirect-DAWKfZzt.js} +1 -1
  166. package/dist/client/assets/{index-D_t5RQk4.js → index-uZNfeQt8.js} +1 -1
  167. package/dist/client/assets/{infiniteQueryObserver-CzIaF1BV.js → infiniteQueryObserver-D531v4aA.js} +1 -1
  168. package/dist/client/assets/{infra-billing-DMsr0Q0z.js → infra-billing-C3r6_l-d.js} +1 -1
  169. package/dist/client/assets/{input-D7rTqiZA.js → input-Bw5CcCxY.js} +2 -2
  170. package/dist/client/assets/{input-DhQYTu0H.js → input-CZi9DBsg.js} +1 -1
  171. package/dist/client/assets/{input-DmFaWWaQ.js → input-CanXr3zf.js} +1 -1
  172. package/dist/client/assets/{integration-icon-CT7gtNMF.js → integration-icon-BUiAcjJI.js} +1 -1
  173. package/dist/client/assets/{label-C5dVgFkO.js → label-C0Z8BQK8.js} +1 -1
  174. package/dist/client/assets/{last-preview-page-BbdRTqMd.js → last-preview-page-Bw5iq9BG.js} +1 -1
  175. package/dist/client/assets/{layout-CXaobmoR.js → layout-CLlZ53T9.js} +1 -1
  176. package/dist/client/assets/{legacy-agents-deep-B2dKvF3G.js → legacy-agents-deep-CPHek8zK.js} +1 -1
  177. package/dist/client/assets/{legacy-main-redirect-psdr3_pB.js → legacy-main-redirect-DaK05WFD.js} +1 -1
  178. package/dist/client/assets/library-BOlU1qHF.js +161 -0
  179. package/dist/client/assets/{login-D0perYnq.js → login-zkguOyNC.js} +1 -1
  180. package/dist/client/assets/{markdown-CdMnKnHM.js → markdown-BAxgNtTV.js} +1 -1
  181. package/dist/client/assets/{mcp-app-renderer-kud7EQ1E.js → mcp-app-renderer-s982DJoX.js} +2 -2
  182. package/dist/client/assets/{mcp-oauth-Bqx9uZfn.js → mcp-oauth-CuN2M9eY.js} +1 -1
  183. package/dist/client/assets/{members-BWNEw7IY.js → members-CHg0X5Qv.js} +1 -1
  184. package/dist/client/assets/{message-templates-CwYx_hD_.js → message-templates-DiXmLQv9.js} +1 -1
  185. package/dist/client/assets/{mini-report-page-i9lqZoyF.js → mini-report-page-BP2VfDmW.js} +1 -1
  186. package/dist/client/assets/{mock-board-DDxAYcbL.js → mock-board-CsD-jS_t.js} +7 -7
  187. package/dist/client/assets/{monaco-editor-BM2SBH_J.js → monaco-editor-GTuWbg2n.js} +1 -1
  188. package/dist/client/assets/{monitoring-stats-row-BAfuoPc4.js → monitoring-stats-row-C0txjqQF.js} +1 -1
  189. package/dist/client/assets/{multi-select-Cma9DT-0.js → multi-select-BSBeiPDs.js} +1 -1
  190. package/dist/client/assets/{mustache-DCrtQrVG.js → mustache-CBCEG5qI.js} +1 -1
  191. package/dist/client/assets/{oauth-callback-Bjj2LnDu.js → oauth-callback-BzXzh5YU.js} +1 -1
  192. package/dist/client/assets/{oauth-callback-ai-provider-iJcxShkv.js → oauth-callback-ai-provider-P5-Mdqw7.js} +1 -1
  193. package/dist/client/assets/{onboarding-DdPHiaTb.js → onboarding-Cfx2WJWh.js} +1 -1
  194. package/dist/client/assets/{optimistic-project-sidebar-views-DbUoja1k.js → optimistic-project-sidebar-views-DL2cPEil.js} +1 -1
  195. package/dist/client/assets/org-file-open-context-ClVFPMFS.js +1 -0
  196. package/dist/client/assets/{organization-choice-DSZdyMNl.js → organization-choice-D8YfGT0z.js} +1 -1
  197. package/dist/client/assets/{orgs-EQ3dRKq1.js → orgs-DTy0l6iW.js} +1 -1
  198. package/dist/client/assets/{page-seo-form-BgfALyeP.js → page-seo-form-BDho5kHd.js} +1 -1
  199. package/dist/client/assets/{pair-mgqlVrg4.js → pair-CXtHPu_2.js} +7 -7
  200. package/dist/client/assets/{plan-ladder-DFDsraie.js → plan-ladder-Cz1SRX7G.js} +1 -1
  201. package/dist/client/assets/{popover-BREpugAm.js → popover-D9J3Ecq5.js} +1 -1
  202. package/dist/client/assets/{post-calendar-CnbsL0eo.js → post-calendar-B6HqShTj.js} +1 -1
  203. package/dist/client/assets/{post-editor-9KdgWdvu.js → post-editor-Dub0lnIC.js} +1 -1
  204. package/dist/client/assets/{preview-content-BZq0WigR.js → preview-content-DqZbwIgq.js} +1 -1
  205. package/dist/client/assets/{preview-dialog-h7LoP6ZX.js → preview-dialog-DwsfWiX4.js} +1 -1
  206. package/dist/client/assets/{primitives-zMFwX0Jx.js → primitives-B3jGlz5R.js} +1 -1
  207. package/dist/client/assets/{profile-CstkdBJB.js → profile-DRpLAxpV.js} +1 -1
  208. package/dist/client/assets/{project-app-view-BUXGEIxz.js → project-app-view-CDnyZsfy.js} +1 -1
  209. package/dist/client/assets/{project-feed-B2rjMsm6.js → project-feed-BNODHWCd.js} +1 -1
  210. package/dist/client/assets/{project-icon-BuXyfXr6.js → project-icon-C2aP6VAt.js} +1 -1
  211. package/dist/client/assets/project-reports-pxfEiDuc.js +1 -0
  212. package/dist/client/assets/project-tasks-BHr51N_5.js +1 -0
  213. package/dist/client/assets/{prompts-C8Tw6ift.js → prompts-ChUmDgBe.js} +1 -1
  214. package/dist/client/assets/record-editor-DFMI1izT.js +1 -0
  215. package/dist/client/assets/{redirect-editor-fDaBjJbA.js → redirect-editor-DCDkcBex.js} +1 -1
  216. package/dist/client/assets/registry-DAYpp-LB.js +2 -0
  217. package/dist/client/assets/{registry-layout-CBmayW3a.js → registry-layout-Dj4Ep3NC.js} +1 -1
  218. package/dist/client/assets/reports-Ac74_llD.js +1 -0
  219. package/dist/client/assets/{reports-D3ZxTpvh.js → reports-CX9Egd7g.js} +1 -1
  220. package/dist/client/assets/{reports-onboarding-C-jYNNpv.js → reports-onboarding-Dr7ZP07o.js} +1 -1
  221. package/dist/client/assets/{reports-tab-ClSQGtJf.js → reports-tab-6o6Xq74z.js} +2 -2
  222. package/dist/client/assets/{repositories-VKk9R6NV.js → repositories-DVzvtTGH.js} +1 -1
  223. package/dist/client/assets/{repository-import-picker-Bxit3rwH.js → repository-import-picker-_MvWhsff.js} +1 -1
  224. package/dist/client/assets/{repository-picker-Dtn2F8yh.js → repository-picker-CUSn6z2H.js} +1 -1
  225. package/dist/client/assets/{require-capability-DNPqpx0A.js → require-capability-Co3UWcKm.js} +1 -1
  226. package/dist/client/assets/{required-auth-layout-DbcZh8KB.js → required-auth-layout-CCMTdUQL.js} +1 -1
  227. package/dist/client/assets/{reset-password-H5cLuWq1.js → reset-password-372vF6mz.js} +1 -1
  228. package/dist/client/assets/{resizable-Dw8LR1j8.js → resizable-C1agfd9G.js} +1 -1
  229. package/dist/client/assets/{review-settings-CQBykdsR.js → review-settings-B1JUgDgo.js} +1 -1
  230. package/dist/client/assets/{rich-text-link-control-XbfHUQMq.js → rich-text-link-control-CtGfeDDb.js} +1 -1
  231. package/dist/client/assets/{roles-CoipftcE.js → roles-BsnaB11h.js} +1 -1
  232. package/dist/client/assets/{route-COHKdv7H.js → route-BORVoZ7m.js} +1 -1
  233. package/dist/client/assets/route-CA1mAWwz.js +1 -0
  234. package/dist/client/assets/{route-BKi-EnKl.js → route-D-IJHs-q.js} +1 -1
  235. package/dist/client/assets/route-page-header-B0gCkOLw.js +1 -0
  236. package/dist/client/assets/runnable-block-editor-C3xUpeAq.js +16 -0
  237. package/dist/client/assets/{sandbox-lifecycle-context-HIhyPh-5.js → sandbox-lifecycle-context-CFxv8KuN.js} +1 -1
  238. package/dist/client/assets/{schema-iizf-P2g.js → schema-CblLKjlF.js} +1 -1
  239. package/dist/client/assets/{scroll-area-BcoH4ReJ.js → scroll-area-C4UXe6MK.js} +1 -1
  240. package/dist/client/assets/{search-input-CmWlEMU8.js → search-input-BIO2PIb8.js} +1 -1
  241. package/dist/client/assets/{search-toggle-4qgH_UjE.js → search-toggle-DZJDiHhs.js} +1 -1
  242. package/dist/client/assets/{secrets-Bi8Smqwe.js → secrets-D5ZQ2jkM.js} +1 -1
  243. package/dist/client/assets/sections-editor-B1KSvQYw.js +2 -0
  244. package/dist/client/assets/{select--0Nrx9pz.js → select-CWiwZCZH.js} +1 -1
  245. package/dist/client/assets/{select-model-BKF1kjR-.js → select-model-FJtjM4qQ.js} +1 -1
  246. package/dist/client/assets/seo-editor-R3X5vWTc.js +1 -0
  247. package/dist/client/assets/{separator-CMAG9KMM.js → separator-CvknKP-S.js} +1 -1
  248. package/dist/client/assets/{settings-tab-BrwOMHxn.js → settings-tab-TZNv4ip9.js} +1 -1
  249. package/dist/client/assets/{sheet-KfyT4iJh.js → sheet-Dcv1ruqq.js} +1 -1
  250. package/dist/client/assets/{shell-layout-C7iq_ybu.js → shell-layout-DCySlmes.js} +1 -1
  251. package/dist/client/assets/{sidebar-Ce0KwGyJ.js → sidebar-VKfmQpw1.js} +1 -1
  252. package/dist/client/assets/{skill-preview-DaiAGQ8W.js → skill-preview-DWlT0CSK.js} +1 -1
  253. package/dist/client/assets/{skills-BfYJXdvY.js → skills-B0BBHtWL.js} +1 -1
  254. package/dist/client/assets/{sso-j34bPfk7.js → sso-DtIjqKzq.js} +1 -1
  255. package/dist/client/assets/{store-DjXldX1F.js → store-DcF0sBj5.js} +1 -1
  256. package/dist/client/assets/store-registry-BRzSXXLO.js +2 -0
  257. package/dist/client/assets/{switch-uCmnTmA3.js → switch-jCtPlC36.js} +1 -1
  258. package/dist/client/assets/{synced-repos-C07oiVeE.js → synced-repos-CE0cMzCA.js} +1 -1
  259. package/dist/client/assets/{table-Cx5xJBa9.js → table-DEPBOuqW.js} +1 -1
  260. package/dist/client/assets/{tabs-CMPX7aLH.js → tabs-D5BcvYFg.js} +1 -1
  261. package/dist/client/assets/{task-board-CwfOEd0p.js → task-board-irpkYNP7.js} +1 -1
  262. package/dist/client/assets/{task-route-C0NB5FI3.js → task-route-CCPOLwd0.js} +1 -1
  263. package/dist/client/assets/{task-status-CunX_b1I.js → task-status-6ym4yCkI.js} +1 -1
  264. package/dist/client/assets/{taskboard-analytics-BVZIpmtK.js → taskboard-analytics-DX9L7_MQ.js} +1 -1
  265. package/dist/client/assets/tasks-C18rS0d8.js +1 -0
  266. package/dist/client/assets/{tasks-CKy3IGSO.js → tasks-gWGPTcMJ.js} +2 -2
  267. package/dist/client/assets/{textarea-CNloF_6k.js → textarea-B9gSFrNU.js} +1 -1
  268. package/dist/client/assets/{thread-button-0wpTVhK0.js → thread-button-CRojH2Q6.js} +1 -1
  269. package/dist/client/assets/{thread-intent-BcdlSG8J.js → thread-intent-D7RSnMtr.js} +1 -1
  270. package/dist/client/assets/{thread-route-Bq7TohAn.js → thread-route-B6q872tw.js} +1 -1
  271. package/dist/client/assets/{thread-route-D5lCt0bb.js → thread-route-BvQ3N33X.js} +1 -1
  272. package/dist/client/assets/{thread-sheet-body-CZ7U6WOP.js → thread-sheet-body-4Hdc-P_4.js} +1 -1
  273. package/dist/client/assets/{toggle-group-BPpZ90Kk.js → toggle-group-Cs6LukfB.js} +1 -1
  274. package/dist/client/assets/{toolbar-icon-button-Da8s1pOb.js → toolbar-icon-button-BrvzhCgp.js} +1 -1
  275. package/dist/client/assets/{tooltip-Ch_anXXw.js → tooltip-CJ5hpTtY.js} +1 -1
  276. package/dist/client/assets/{track-B2ai-lhp.js → track-CQmWzPGe.js} +1 -1
  277. package/dist/client/assets/{types-DAtj8pL_.js → types-o4JUcB5t.js} +1 -1
  278. package/dist/client/assets/{usage-stats-DECzmKdw.js → usage-stats-BkyaWsuw.js} +1 -1
  279. package/dist/client/assets/{use-ai-providers-BLQu9X4b.js → use-ai-providers-D7TBn2gf.js} +1 -1
  280. package/dist/client/assets/{use-automations-DGQLDHfM.js → use-automations-BnCVpUqP.js} +1 -1
  281. package/dist/client/assets/{use-autosave-D2GJMvju.js → use-autosave-DyNoS35U.js} +1 -1
  282. package/dist/client/assets/{use-connect-companion-TpX59d2A.js → use-connect-companion-9ZpyI9Fc.js} +1 -1
  283. package/dist/client/assets/{use-connection-DEkZ7Z3y.js → use-connection-CWmCnJzq.js} +1 -1
  284. package/dist/client/assets/{use-copy-BdX2_tpS.js → use-copy-C4Sqw6FJ.js} +1 -1
  285. package/dist/client/assets/{use-create-virtual-mcp-B22agNFs.js → use-create-virtual-mcp-CF6SrwfA.js} +1 -1
  286. package/dist/client/assets/{use-date-fns-locale-DdFVZp6l.js → use-date-fns-locale-FAB4qsTj.js} +1 -1
  287. package/dist/client/assets/{use-debounced-autosave-g0CT53cz.js → use-debounced-autosave-DyrcpQku.js} +1 -1
  288. package/dist/client/assets/{use-debounced-value-CPADjlu8.js → use-debounced-value-CTsArd76.js} +1 -1
  289. package/dist/client/assets/{use-deco-credits-0LI1tSh2.js → use-deco-credits-DX-A_4LZ.js} +1 -1
  290. package/dist/client/assets/{use-decopilot-events-CztvGxbe.js → use-decopilot-events-B_U6akcK.js} +1 -1
  291. package/dist/client/assets/{use-delete-connection-BrxuwVV0.js → use-delete-connection-zGLdQuFY.js} +1 -1
  292. package/dist/client/assets/{use-deployment-admin-BW07NJZx.js → use-deployment-admin-ClPzrInO.js} +1 -1
  293. package/dist/client/assets/{use-entitlements-Cpg4O4cU.js → use-entitlements-zp_dUL_T.js} +1 -1
  294. package/dist/client/assets/{use-fast-preview-draft-url-BS4vDkY8.js → use-fast-preview-draft-url-Cz3sAOXf.js} +1 -1
  295. package/dist/client/assets/{use-file-configs-T83FDKTN.js → use-file-configs-CNHCYE4_.js} +1 -1
  296. package/dist/client/assets/{use-in-settings-CCWZ9EQU.js → use-in-settings-7N-jImN-.js} +1 -1
  297. package/dist/client/assets/{use-infinite-scroll-CQVHxZ2X.js → use-infinite-scroll-tKxzTnAi.js} +1 -1
  298. package/dist/client/assets/{use-join-requests-BM1WOs-R.js → use-join-requests-DsMh_VIg.js} +1 -1
  299. package/dist/client/assets/{use-main-panel-tabs-BGkjNCY6.js → use-main-panel-tabs-osVdCCKw.js} +1 -1
  300. package/dist/client/assets/{use-mcp-auth-status-DPrXZk0m.js → use-mcp-auth-status-BN0fGnjh.js} +1 -1
  301. package/dist/client/assets/{use-mcp-client-Di29uH1Z.js → use-mcp-client-DRrvMA7R.js} +1 -1
  302. package/dist/client/assets/{use-mcp-prompts-pRQvLesG.js → use-mcp-prompts-CFfQkfFk.js} +1 -1
  303. package/dist/client/assets/{use-mcp-tools-BTMKYjmq.js → use-mcp-tools-ZkLjVEAC.js} +1 -1
  304. package/dist/client/assets/{use-members-2-cC5S8b.js → use-members-Dtgbai4E.js} +1 -1
  305. package/dist/client/assets/{use-mobile-Br1FbuT5.js → use-mobile-DlkLKfXJ.js} +1 -1
  306. package/dist/client/assets/{use-navigate-to-agent-BIB5Nkxx.js → use-navigate-to-agent-B7EkWSI-.js} +1 -1
  307. package/dist/client/assets/{use-open-billing-url-DwCvmaT1.js → use-open-billing-url-rAHLvZUq.js} +1 -1
  308. package/dist/client/assets/{use-org-auth-client-BQN7hmW6.js → use-org-auth-client-DRDr1ayU.js} +1 -1
  309. package/dist/client/assets/{use-org-fs-up6Ae3F-.js → use-org-fs-CRcsrb-3.js} +1 -1
  310. package/dist/client/assets/{use-org-repo-syncs-B1-u1Sww.js → use-org-repo-syncs-BDI_NBKG.js} +1 -1
  311. package/dist/client/assets/{use-org-sso-CSb7uzWR.js → use-org-sso-sXA-lCl2.js} +1 -1
  312. package/dist/client/assets/{use-organization-roles-DP4t5Npf.js → use-organization-roles-BGK09C8Z.js} +1 -1
  313. package/dist/client/assets/{use-organization-settings-B7QbhgeU.js → use-organization-settings-BWh5ecK1.js} +1 -1
  314. package/dist/client/assets/{use-panel-navigate-7owLLl5-.js → use-panel-navigate-aNh4qA0w.js} +1 -1
  315. package/dist/client/assets/{use-project-native-view-presence-C6Z-dNAC.js → use-project-native-view-presence-bc-dlOed.js} +1 -1
  316. package/dist/client/assets/{use-project-scope-D7MgPnbk.js → use-project-scope-BWH2x_Fv.js} +1 -1
  317. package/dist/client/assets/{use-registry-connections-CvrvQHoJ.js → use-registry-connections-BEkW1hW1.js} +1 -1
  318. package/dist/client/assets/{use-releases-DYrm3R-D.js → use-releases-BqU5AbHR.js} +1 -1
  319. package/dist/client/assets/{use-reports-diagnostic-B0GD9uDf.js → use-reports-diagnostic-DbkBmwAy.js} +1 -1
  320. package/dist/client/assets/{use-route-default-main--vHXCkHM.js → use-route-default-main-C08nBhva.js} +1 -1
  321. package/dist/client/assets/{use-secrets-DwITZFB8.js → use-secrets-_TBYCToI.js} +1 -1
  322. package/dist/client/assets/use-section-preview-base-CIB9ERj3.js +1 -0
  323. package/dist/client/assets/{use-session-runtime-B1xdg1Mc.js → use-session-runtime-DXJsM3Xo.js} +1 -1
  324. package/dist/client/assets/{use-tags-DXxTmE03.js → use-tags-BtlTltF7.js} +1 -1
  325. package/dist/client/assets/{use-task-board-analytics-5o37lq8z.js → use-task-board-analytics-Bn5ZBvNV.js} +1 -1
  326. package/dist/client/assets/{use-task-metadata-xMti_d98.js → use-task-metadata-n3_Ckq8i.js} +1 -1
  327. package/dist/client/assets/{use-thread-outputs-BwzUBEaq.js → use-thread-outputs-hUD6BIlr.js} +1 -1
  328. package/dist/client/assets/{use-view-mode-DB3Sv4EV.js → use-view-mode-z9PDHpCl.js} +1 -1
  329. package/dist/client/assets/{use-virtual-mcp-CdMkF3Nz.js → use-virtual-mcp-mXTxLOzX.js} +1 -1
  330. package/dist/client/assets/useInfiniteQuery-B8BU5xZL.js +1 -0
  331. package/dist/client/assets/{useQueries-B3o1rvWe.js → useQueries-9_e6uzO5.js} +1 -1
  332. package/dist/client/assets/useSuspenseInfiniteQuery-B0apeUzG.js +1 -0
  333. package/dist/client/assets/{users-DBFRWsia.js → users-cZqUrAVc.js} +1 -1
  334. package/dist/client/assets/{utils-gTOau_mh.js → utils-BCIk8m53.js} +1 -1
  335. package/dist/client/assets/{variant-calendar-DOxG9iwM.js → variant-calendar-B_X3Kgq2.js} +1 -1
  336. package/dist/client/assets/{variant-matcher-override-DPq8EH6t.js → variant-matcher-override-C3r4SJlV.js} +1 -1
  337. package/dist/client/assets/{view-mode-toggle-DYECPSMs.js → view-mode-toggle-DwUTECrP.js} +1 -1
  338. package/dist/client/assets/{virtual-mcp-AqKeX5w8.js → virtual-mcp-B-vJ4hSc.js} +1 -1
  339. package/dist/client/index.html +2 -2
  340. package/dist/server/cli.js +1 -1
  341. package/dist/server/server.js +1 -1
  342. package/package.json +1 -1
  343. package/dist/client/assets/agent-app-Dd4FMRFP.js +0 -1
  344. package/dist/client/assets/agent-assets-ihYul22E.js +0 -1
  345. package/dist/client/assets/agent-deck-BWPlKksS.js +0 -1
  346. package/dist/client/assets/agent-file-BKO35b36.js +0 -1
  347. package/dist/client/assets/agent-library-file-B3_-CXIA.js +0 -1
  348. package/dist/client/assets/agent-settings-BxZaeWUx.js +0 -1
  349. package/dist/client/assets/agent-site-editor-code-B-pWeSRV.js +0 -2
  350. package/dist/client/assets/agent-site-editor-content-BGJ14_Az.js +0 -2
  351. package/dist/client/assets/agent-view-DDrzopEk.js +0 -1
  352. package/dist/client/assets/api-keys-DEkuX1eT.js +0 -1
  353. package/dist/client/assets/app-editor-ChfXMKUs.js +0 -1
  354. package/dist/client/assets/automations-BQHaweWF.js +0 -1
  355. package/dist/client/assets/category-editor-BTonT0GY.js +0 -1
  356. package/dist/client/assets/index-DbfxHNth.js +0 -1
  357. package/dist/client/assets/library-CHpieazL.js +0 -161
  358. package/dist/client/assets/org-file-open-context-DNcgI0Uf.js +0 -1
  359. package/dist/client/assets/project-reports-BCqm5aO0.js +0 -1
  360. package/dist/client/assets/project-tasks-Bka5utN5.js +0 -1
  361. package/dist/client/assets/record-editor-BpAD-e4x.js +0 -1
  362. package/dist/client/assets/registry-CtLO9kjB.js +0 -2
  363. package/dist/client/assets/reports-D2RKwYmT.js +0 -1
  364. package/dist/client/assets/route-C9H7VfVw.js +0 -1
  365. package/dist/client/assets/route-page-header-KctxVQ_e.js +0 -1
  366. package/dist/client/assets/runnable-block-editor-BzVWSPHL.js +0 -16
  367. package/dist/client/assets/sections-editor-Bo5eUKAB.js +0 -2
  368. package/dist/client/assets/seo-editor-D9L3VA5c.js +0 -1
  369. package/dist/client/assets/store-registry-RTogK1X0.js +0 -2
  370. package/dist/client/assets/tasks-DF_oVYA4.js +0 -1
  371. package/dist/client/assets/use-section-preview-base-BFHyMpzJ.js +0 -1
  372. package/dist/client/assets/useInfiniteQuery-DvCOEAKG.js +0 -1
  373. package/dist/client/assets/useSuspenseInfiniteQuery-DMqlAGdI.js +0 -1
@@ -0,0 +1,161 @@
1
+ import{c as T,b as J,j as r,aj as wr,a0 as ge,Z as $e,l as Re,an as kr,aP as ie,o as cr,r as B,B as K,K as te,t as I,d as Sr,u as Nr,n as ze,aH as rr,P as Pr,dR as Cr}from"./index-ViRfM1Gu.js";import{C as Or}from"./index-D5yWNDr1.js";import{s as tr}from"./Eye-BMH8bL1o.js";import{s as sr}from"./Plus-DtW_ZAb1.js";import{i as Dr}from"./SearchLg-dxZebJdV.js";import{i as Ne}from"./Upload01-C_WGdZv1.js";import{s as $r}from"./XClose-DV3Gf7XO.js";import{t as Fr}from"./Stars01-C7tX23wY.js";import{i as Tr}from"./Zap-3MjslAd_.js";import{s as he,H as ue,h as Oe,a as ye,b as q,c as dr,d as mr,p as pr}from"./location-oTTXFrSF.js";import{i as Le,l as Er,m as ur,n as fr,j as zr,o as Ar,c as De,d as Rr,h as Qe}from"./use-org-fs-CRcsrb-3.js";import{u as Br,F as Fe,t as hr,S as Lr,B as Mr,a as Ze,f as Vr,p as Ur,g as Hr,b as Ir,e as Kr,c as qr}from"./use-org-repo-syncs-BDI_NBKG.js";import{u as Qr}from"./use-mobile-DlkLKfXJ.js";import{I as Yr}from"./icon-button-BDccBwxx.js";import{S as Gr}from"./search-toggle-DZJDiHhs.js";import{f as Wr,e as Xr,b as Zr,A as Jr,a as _r,d as et,c as rt,g as tt}from"./alert-dialog-Cwo6u0Rd.js";import{b as Ye,D as Ge,d as We,i as st,c as ar,h as lr,e as nr}from"./dialog-Djn7c9nl.js";import{I as Pe}from"./input-CZi9DBsg.js";import{u as at}from"./use-debounced-value-CTsArd76.js";import{T as lt}from"./textarea-B9gSFrNU.js";import{t as nt,n as it}from"./ChevronUp-DLj1P2Yi.js";import{a as ir}from"./Palette-D-JKiEQc.js";import{b8 as ot}from"./agent-icon-CB6qOgGd.js";import{i as or}from"./X-DvXoapdv.js";import{M as ct}from"./markdown-BAxgNtTV.js";import{S as dt}from"./file-share-button-CJVW9-2r.js";import{L as mt}from"./preview-dialog-DwsfWiX4.js";import{S as br}from"./skill-preview-DWlT0CSK.js";import{a as pt}from"./use-panel-navigate-aNh4qA0w.js";import"./thread-button-CRojH2Q6.js";import"./sidebar-VKfmQpw1.js";import"./LayoutLeft-CRUlRVYr.js";import"./sheet-Dcv1ruqq.js";import"./tooltip-CJ5hpTtY.js";import"./index-aoyaciW5.js";import"./thread-route-BvQ3N33X.js";import"./use-route-default-main-C08nBhva.js";import"./hooks-p4Q94DpI.js";import"./use-mcp-client-DRrvMA7R.js";import"./auth-C673ACq9.js";import"./backoff-8mStPHYB.js";import"./task-board-irpkYNP7.js";import"./schema-CblLKjlF.js";import"./toolbar-icon-button-BrvzhCgp.js";import"./use-in-settings-7N-jImN-.js";import"./shell-layout-DCySlmes.js";import"./avatar-DeEBt3V6.js";import"./User01-BtTyL8Q1.js";import"./Globe04-DiaT8ud7.js";import"./download-app-dialog-CPQDFMO_.js";import"./Copy01-BSU2TbGt.js";import"./Download01-C7Po_zTZ.js";import"./use-project-scope-BWH2x_Fv.js";import"./use-virtual-mcp-mXTxLOzX.js";import"./github-repo-BknN0SVI.js";import"./CheckCircle-Dhae72wt.js";import"./Tool02-C01DHNkH.js";import"./Monitor01-D_u2VBNm.js";import"./Share07-D1cfUHPt.js";import"./Settings02-BST604Dz.js";import"./command-Cd7TqAMz.js";import"./index-BmOHjvYS.js";import"./SearchMd-CYWyu5N6.js";import"./integration-icon-BUiAcjJI.js";import"./project-icon-C2aP6VAt.js";import"./use-is-desktop-app-BNujXJc_.js";import"./required-auth-layout-CCMTdUQL.js";import"./autosend-C_B7nqHB.js";import"./use-organization-settings-BWh5ecK1.js";import"./use-org-sso-sXA-lCl2.js";import"./resizable-C1agfd9G.js";import"./route-page-header-B0gCkOLw.js";import"./DotsVertical-Bpcc3aU6.js";import"./Globe01-B8Fw27to.js";import"./Key01-BlY-YbB_.js";import"./Trash01-CuAclZjJ.js";import"./file-type-icon-61vCm4NO.js";import"./folder-icon-DLuVHdgH.js";import"./skill-md-ChfVs4uF.js";import"./AlertCircle-BI1-7G_T.js";import"./Tool01-uWjCo1g4.js";import"./ArrowUp-CeEuKFtz.js";import"./ArrowLeft-C7E68hAX.js";import"./ArrowRight-Dvm5zccu.js";import"./TrendUp01-DDcnGTKu.js";import"./ZoomOut-CmGFFntk.js";import"./UserSquare-DseugbrQ.js";import"./CreditCard01-rQeWrMiX.js";import"./Image01-8GW5hNSe.js";import"./Link01-Cx5QfFm-.js";import"./LinkExternal01-CiW1JxGO.js";import"./Sun-DYyCG7at.js";import"./Package-5wNrOSeZ.js";import"./Play-C3paeMv9.js";import"./Users01-DcFsssIu.js";import"./XCircle-IF6IhAA6.js";import"./org-file-open-context-ClVFPMFS.js";import"./popover-D9J3Ecq5.js";import"./preview-content-DqZbwIgq.js";import"./file-preview-BADsX5FY.js";import"./utils-BCIk8m53.js";import"./editor-Bq1ZBF8A.js";const ut=new Set(["pdf","doc","docx","odt","rtf","txt","md","markdown","xls","xlsx","ods","csv","tsv","ppt","pptx","odp","key","pages","numbers","html","htm","epub"]),ft=new Set(["png","jpg","jpeg","gif","webp","svg","avif","bmp","tif","tiff","ico","heic","heif","mp4","webm","mov","m4v","avi","mkv","mp3","wav","ogg","oga","m4a","aac","flac"]);function Je(l,e){if(e==="all")return!0;const s=l.slice(l.lastIndexOf("/")+1),t=s.lastIndexOf(".");if(t<=0)return!1;const a=s.slice(t+1).toLowerCase();return(e==="media"?ft:ut).has(a)}function ht(l){const e=T.c(11),{onOpenDir:s}=l,t=J(),a=Br();let n;e[0]!==a.data?(n=a.data??[],e[0]=a.data,e[1]=n):n=e[1];let o;if(e[2]!==s||e[3]!==t||e[4]!==n){let d;e[6]!==s||e[7]!==t?(d=i=>r.jsx(Fe,{name:i.volume,glyph:wr,tone:"system",readOnly:!0,meta:`${i.repoOwner}/${i.repoName}`,subtitle:i.lastSyncError?t("library.syncedRepos.syncFailed"):i.lastSyncedAt?t("library.syncedRepos.syncedAgo",{ago:hr(i.lastSyncedAt)}):t("library.syncedRepos.waitingFirstSync"),onOpen:()=>s(i.volume)},i.id),e[6]=s,e[7]=t,e[8]=d):d=e[8],o=n.map(d),e[2]=s,e[3]=t,e[4]=n,e[5]=o}else o=e[5];let c;return e[9]!==o?(c=r.jsx(r.Fragment,{children:o}),e[9]=o,e[10]=c):c=e[10],c}function _e(l){return`${window.location.origin}${l}`}function Ce(l){if(l.shareMode==="password")return"password";if(l.shareMode==="public"||l.readPublic)return"public";if(l.effectivePublic)return"inherited"}const bt=[ue,"uploads","outputs"],xr=[{volume:"uploads",descriptionKey:"library.libraryViews.volumeUploadsDescription",glyph:Ne},{volume:"outputs",descriptionKey:"library.libraryViews.volumeOutputsDescription",glyph:Fr}],Xe=new Set([...xr.map(l=>l.volume),he("public")]),xt=6;function yr(l,e,s){const t=e.includes("/")?e.slice(0,e.lastIndexOf("/")):"",a=dr(l),n=a?`public/${a}`:l==="home"?Oe(s):l;return t?`${n}/${t}`:n}function Ae(l,e,s){return{onDragStart:t=>{s.onDragStart?.(l),t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("application/x-studio-library-path",l)},onContextMenu:t=>{t.preventDefault(),s.onContextMenu?.(l,e)},onDrop:s.onDrop?t=>{t.preventDefault();const a=t.dataTransfer.getData("application/x-studio-library-path");a&&a!==l&&!l.startsWith(a+"/")&&s.onDrop(a,l)}:void 0}}function oe(l){const e=T.c(2),{children:s}=l;let t;return e[0]!==s?(t=r.jsx("p",{className:"text-[13px] text-foreground",children:s}),e[0]=s,e[1]=t):t=e[1],t}function fe(l){const e=T.c(2),{children:s}=l;let t;return e[0]!==s?(t=r.jsx("div",{className:"@container",children:r.jsx("div",{className:"grid grid-cols-1 gap-3 @[440px]:grid-cols-2 @[660px]:grid-cols-3",children:s})}),e[0]=s,e[1]=t):t=e[1],t}function er(l){const e=T.c(22),{view:s,children:t}=l,a=J();if(!$e()||s==="media"){let h;return e[0]!==t?(h=r.jsx(fe,{children:t}),e[0]=t,e[1]=h):h=e[1],h}let o;e[2]!==a?(o=a("library.library.name"),e[2]=a,e[3]=o):o=e[3];let c;e[4]!==o?(c=r.jsx("span",{className:"min-w-0 flex-1",children:o}),e[4]=o,e[5]=c):c=e[5];let d;e[6]!==a?(d=a("library.library.type"),e[6]=a,e[7]=d):d=e[7];let i;e[8]!==d?(i=r.jsx("span",{className:"hidden w-32 shrink-0 @min-xl/library-files:block",children:d}),e[8]=d,e[9]=i):i=e[9];let m;e[10]!==a?(m=a("library.library.updated"),e[10]=a,e[11]=m):m=e[11];let b;e[12]!==m?(b=r.jsx("span",{className:"w-20 shrink-0 text-right",children:m}),e[12]=m,e[13]=b):b=e[13];let g;e[14]===Symbol.for("react.memo_cache_sentinel")?(g=r.jsx("span",{className:"w-6"}),e[14]=g):g=e[14];let v;e[15]!==c||e[16]!==i||e[17]!==b?(v=r.jsxs("div",{className:"flex items-center gap-3 border-b border-border/60 px-3 pb-2 text-xs text-muted-foreground",children:[c,i,b,g]}),e[15]=c,e[16]=i,e[17]=b,e[18]=v):v=e[18];let x;return e[19]!==t||e[20]!==v?(x=r.jsxs("div",{className:"@container/library-files min-w-0",children:[v,t]}),e[19]=t,e[20]=v,e[21]=x):x=e[21],x}function Me(l){const e=T.c(2),{rows:s}=l,t=s===void 0?1:s;let a;return e[0]!==t?(a=r.jsx(fe,{children:Array.from({length:t*3},yt)}),e[0]=t,e[1]=a):a=e[1],a}function yt(l,e){return r.jsx(ie,{className:"h-16 rounded-2xl"},e)}function Be(l){const e=T.c(2),{children:s}=l;let t;return e[0]!==s?(t=r.jsx("p",{className:"text-sm text-muted-foreground",children:s}),e[0]=s,e[1]=t):t=e[1],t}function gt(l){const e=T.c(12),{volume:s,descriptionKey:t,glyph:a,onOpen:n}=l,o=J(),c=Ar(s);let d;e[0]!==o||e[1]!==c.data?(d=c.data?o("library.libraryViews.filesCount",{count:c.data.files}):void 0,e[0]=o,e[1]=c.data,e[2]=d):d=e[2];let i;e[3]!==t||e[4]!==o?(i=o(t),e[3]=t,e[4]=o,e[5]=i):i=e[5];let m;return e[6]!==a||e[7]!==n||e[8]!==d||e[9]!==i||e[10]!==s?(m=r.jsx(Fe,{name:s,meta:d,subtitle:i,glyph:a,tone:"system",onOpen:n}),e[6]=a,e[7]=n,e[8]=d,e[9]=i,e[10]=s,e[11]=m):m=e[11],m}function vt(l){const e=T.c(12),{onOpenDir:s}=l,t=J(),n=ur().data?.length??0;let o;e[0]!==s?(o=xr.map(m=>r.jsx(gt,{volume:m.volume,descriptionKey:m.descriptionKey,glyph:m.glyph,onOpen:()=>s(m.volume)},m.volume)),e[0]=s,e[1]=o):o=e[1];let c;e[2]!==s||e[3]!==n||e[4]!==t?(c=n>0&&r.jsx(Fe,{name:he("public"),meta:t("library.libraryViews.skillSetsCount",{count:n}),subtitle:t("library.libraryViews.curatedSkillSetsReadOnly"),glyph:Tr,tone:"system",readOnly:!0,onOpen:()=>s("public")}),e[2]=s,e[3]=n,e[4]=t,e[5]=c):c=e[5];let d;e[6]!==s?(d=r.jsx(ht,{onOpenDir:s}),e[6]=s,e[7]=d):d=e[7];let i;return e[8]!==o||e[9]!==c||e[10]!==d?(i=r.jsxs(r.Fragment,{children:[o,c,d]}),e[8]=o,e[9]=c,e[10]=d,e[11]=i):i=e[11],i}function jt(l){const e=T.c(47),{query:s,scope:t,stale:a,fileView:n,onOpenFile:o,onShare:c,onDelete:d}=l,i=$e(),m=J(),{org:b}=ge(),g=Le(),v=Er(s,t);let x;e[0]!==g||e[1]!==c?(x=k=>c({volume:k.volume,path:k.path,kind:"file",shareMode:k.shareMode??"private",effectivePublic:k.effectivePublic??!1,url:_e(g(k.volume,k.path))}),e[0]=g,e[1]=c,e[2]=x):x=e[2];const h=x;if(v.isPending){let k;return e[3]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx(Me,{rows:2}),e[3]=k):k=e[3],k}let j,P,$,F,E,w;if(e[4]!==i||e[5]!==g||e[6]!==n||e[7]!==d||e[8]!==o||e[9]!==b||e[10]!==s||e[11]!==v.data||e[12]!==v.isPlaceholderData||e[13]!==h||e[14]!==a||e[15]!==m){w=Symbol.for("react.early_return_sentinel");e:{let k;e[22]!==n?(k=y=>Je(y.path,n),e[22]=n,e[23]=k):k=e[23];const N=(v.data??[]).filter(k);if(N.length===0){let y;e[24]!==s||e[25]!==m?(y=m("library.libraryViews.noFilesMatch",{query:s}),e[24]=s,e[25]=m,e[26]=y):y=e[26];let z;e[27]!==y?(z=r.jsx(Be,{children:y}),e[27]=y,e[28]=z):z=e[28],w=z;break e}const L=(a||v.isPlaceholderData)&&"opacity-50";e[29]!==L?(F=Re("flex flex-col gap-3",L),e[29]=L,e[30]=F):F=e[30],E=r.jsx(oe,{children:m("library.libraryViews.searchResults",{count:N.length})}),j=er,P=n;let M;e[31]!==i||e[32]!==g||e[33]!==n||e[34]!==d||e[35]!==o||e[36]!==b||e[37]!==h?(M=y=>{const z=dr(y.volume)!==null;return r.jsx(Ze,{layout:i?n==="media"?"media":"row":"card",size:y.size,filename:q(y.path),updatedAt:y.updatedAt,downloadUrl:g(y.volume,y.path),subtitle:yr(y.volume,y.path,b.slug),publicState:Ce(y),onOpen:()=>o(mr(y.volume,y.path)),onShare:z?void 0:()=>h(y),onDelete:z?void 0:()=>d({volume:y.volume,path:y.path,kind:"file"})},`${y.volume}/${y.path}`)},e[31]=i,e[32]=g,e[33]=n,e[34]=d,e[35]=o,e[36]=b,e[37]=h,e[38]=M):M=e[38],$=N.map(M)}e[4]=i,e[5]=g,e[6]=n,e[7]=d,e[8]=o,e[9]=b,e[10]=s,e[11]=v.data,e[12]=v.isPlaceholderData,e[13]=h,e[14]=a,e[15]=m,e[16]=j,e[17]=P,e[18]=$,e[19]=F,e[20]=E,e[21]=w}else j=e[16],P=e[17],$=e[18],F=e[19],E=e[20],w=e[21];if(w!==Symbol.for("react.early_return_sentinel"))return w;let S;e[39]!==j||e[40]!==P||e[41]!==$?(S=r.jsx(j,{view:P,children:$}),e[39]=j,e[40]=P,e[41]=$,e[42]=S):S=e[42];let O;return e[43]!==F||e[44]!==E||e[45]!==S?(O=r.jsxs("div",{className:F,children:[E,S]}),e[43]=F,e[44]=E,e[45]=S,e[46]=O):O=e[46],O}function wt(l){const e=T.c(47),{fileView:s,onOpenFile:t,onShare:a,onDelete:n}=l,o=$e(),c=J(),{org:d}=ge(),i=zr(),m=Le();let b;e[0]!==m||e[1]!==a?(b=w=>a({volume:w.volume,path:w.path,kind:"file",shareMode:w.shareMode??"private",effectivePublic:w.effectivePublic??!1,url:_e(m(w.volume,w.path))}),e[0]=m,e[1]=a,e[2]=b):b=e[2];const g=b;if(i.isPending){let w;e[3]!==c?(w=c("library.libraryViews.recentlyAdded"),e[3]=c,e[4]=w):w=e[4];let S;e[5]!==w?(S=r.jsx(oe,{children:w}),e[5]=w,e[6]=S):S=e[6];let O;e[7]===Symbol.for("react.memo_cache_sentinel")?(O=r.jsx(Me,{}),e[7]=O):O=e[7];let k;return e[8]!==S?(k=r.jsxs("div",{className:"flex flex-col gap-3",children:[S,O]}),e[8]=S,e[9]=k):k=e[9],k}let v,x,h,j,P,$;if(e[10]!==o||e[11]!==m||e[12]!==s||e[13]!==n||e[14]!==t||e[15]!==d||e[16]!==i.data||e[17]!==g||e[18]!==c){$=Symbol.for("react.early_return_sentinel");e:{let w;e[25]!==s?(w=N=>Je(N.path,s),e[25]=s,e[26]=w):w=e[26];const S=(i.data??[]).filter(w).slice(0,xt);if(S.length===0){$=null;break e}j="flex flex-col gap-3";let O;e[27]!==c?(O=c("library.libraryViews.recentlyAdded"),e[27]=c,e[28]=O):O=e[28],e[29]!==O?(P=r.jsx(oe,{children:O}),e[29]=O,e[30]=P):P=e[30],v=er,x=s;let k;e[31]!==o||e[32]!==m||e[33]!==s||e[34]!==n||e[35]!==t||e[36]!==d||e[37]!==g?(k=N=>r.jsx(Ze,{layout:o?s==="media"?"media":"row":"media",filename:q(N.path),updatedAt:N.updatedAt,size:N.size,downloadUrl:m(N.volume,N.path),subtitle:yr(N.volume,N.path,d.slug),publicState:Ce(N),onOpen:()=>t(mr(N.volume,N.path)),onShare:()=>g(N),onDelete:()=>n({volume:N.volume,path:N.path,kind:"file"})},`${N.volume}/${N.path}`),e[31]=o,e[32]=m,e[33]=s,e[34]=n,e[35]=t,e[36]=d,e[37]=g,e[38]=k):k=e[38],h=S.map(k)}e[10]=o,e[11]=m,e[12]=s,e[13]=n,e[14]=t,e[15]=d,e[16]=i.data,e[17]=g,e[18]=c,e[19]=v,e[20]=x,e[21]=h,e[22]=j,e[23]=P,e[24]=$}else v=e[19],x=e[20],h=e[21],j=e[22],P=e[23],$=e[24];if($!==Symbol.for("react.early_return_sentinel"))return $;let F;e[39]!==v||e[40]!==x||e[41]!==h?(F=r.jsx(v,{view:x,children:h}),e[39]=v,e[40]=x,e[41]=h,e[42]=F):F=e[42];let E;return e[43]!==j||e[44]!==P||e[45]!==F?(E=r.jsxs("div",{className:j,children:[P,F]}),e[43]=j,e[44]=P,e[45]=F,e[46]=E):E=e[46],E}function kt(l){const e=T.c(16),{onOpenDir:s}=l,t=J(),a=ur();if(a.isPending){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=r.jsx(Me,{}),e[0]=i):i=e[0],i}let n;e[1]!==a.data?(n=a.data??[],e[1]=a.data,e[2]=n):n=e[2];const o=n;if(o.length===0){let i;e[3]!==t?(i=t("library.libraryViews.noPublicSkillSetsConfigured"),e[3]=t,e[4]=i):i=e[4];let m;return e[5]!==i?(m=r.jsx(Be,{children:i}),e[5]=i,e[6]=m):m=e[6],m}let c;if(e[7]!==s||e[8]!==o||e[9]!==t){let i;e[11]!==s||e[12]!==t?(i=m=>r.jsx(Fe,{name:m,subtitle:t("library.libraryViews.readOnly"),readOnly:!0,onOpen:()=>s(`public/${m}`)},m),e[11]=s,e[12]=t,e[13]=i):i=e[13],c=o.map(i),e[7]=s,e[8]=o,e[9]=t,e[10]=c}else c=e[10];let d;return e[14]!==c?(d=r.jsx(fe,{children:c}),e[14]=c,e[15]=d):d=e[15],d}function St(l){const e=T.c(74),{location:s,onOpenDir:t,fileView:a,onOpenFile:n,onOpenSkill:o,onOpenBrand:c,onShare:d,onDelete:i,onDragStart:m,onContextMenu:b,onMove:g}=l,v=$e(),x=J(),{org:h}=ge(),j=s.volume??"",P=fr(j,s.dirPath),$=Le();let F;e[0]!==s.isHomeRoot||e[1]!==h?(F=C=>s.isHomeRoot&&Xe.has(C.toLowerCase())?`${Oe(h.slug)}/${C}`:void 0,e[0]=s.isHomeRoot,e[1]=h,e[2]=F):F=e[2];const E=F;let w;e[3]!==s.isHomeRoot||e[4]!==t?(w=s.isHomeRoot?r.jsx(vt,{onOpenDir:t}):null,e[3]=s.isHomeRoot,e[4]=t,e[5]=w):w=e[5];const S=w;if(P.isPending){let C;e[6]!==S||e[7]!==x?(C=S&&r.jsxs("div",{className:"flex flex-col gap-3",children:[r.jsx(oe,{children:x("library.libraryViews.folders")}),r.jsx(fe,{children:S})]}),e[6]=S,e[7]=x,e[8]=C):C=e[8];let U;e[9]===Symbol.for("react.memo_cache_sentinel")?(U=r.jsx(Me,{rows:2}),e[9]=U):U=e[9];let Q;return e[10]!==C?(Q=r.jsxs(r.Fragment,{children:[C,U]}),e[10]=C,e[11]=Q):Q=e[11],Q}if(P.isError){let C;e[12]!==P.error||e[13]!==x?(C=P.error instanceof Error?P.error.message:x("library.libraryViews.failedToLoad"),e[12]=P.error,e[13]=x,e[14]=C):C=e[14];let U;return e[15]!==C?(U=r.jsx("p",{className:"text-sm text-destructive",children:C}),e[15]=C,e[16]=U):U=e[16],U}let O,k,N,L,M,y;if(e[17]!==v||e[18]!==E||e[19]!==$||e[20]!==a||e[21]!==P.data||e[22]!==s||e[23]!==b||e[24]!==i||e[25]!==m||e[26]!==g||e[27]!==c||e[28]!==t||e[29]!==n||e[30]!==o||e[31]!==d||e[32]!==S||e[33]!==x||e[34]!==j){y=Symbol.for("react.early_return_sentinel");e:{const C=P.data??[],U=C.filter(Ct),Q=C.filter(Pt),ce=C.filter(Nt);let Y;if(e[41]!==a?(Y=u=>u.kind==="file"&&Je(u.path,a),e[41]=a,e[42]=Y):Y=e[42],O=C.filter(Y),C.length===0&&!s.isHomeRoot){let u;e[43]!==s.readOnly||e[44]!==x?(u=s.readOnly?x("library.libraryViews.emptyReadOnlySet"):x("library.libraryViews.emptyFolder"),e[43]=s.readOnly,e[44]=x,e[45]=u):u=e[45];let R;e[46]!==u?(R=r.jsx(Be,{children:u}),e[46]=u,e[47]=R):R=e[47],y=R;break e}let W;e[48]!==s.readOnly||e[49]!==i||e[50]!==j?(W=u=>s.readOnly?void 0:()=>i({volume:j,path:u.path,kind:u.kind}),e[48]=s.readOnly,e[49]=i,e[50]=j,e[51]=W):W=e[51];const _=W;let ee;e[52]!==$||e[53]!==s.readOnly||e[54]!==d||e[55]!==j?(ee=u=>s.readOnly?void 0:()=>d({volume:j,path:u.path,kind:u.kind,shareMode:u.shareMode??"private",effectivePublic:u.effectivePublic??!1,url:u.kind==="file"?_e($(j,u.path)):void 0}),e[52]=$,e[53]=s.readOnly,e[54]=d,e[55]=j,e[56]=ee):ee=e[56];const V=ee;k=U.length>0&&r.jsxs("div",{className:"flex flex-col gap-3",children:[r.jsx(oe,{children:x("library.libraryViews.skills")}),r.jsx(fe,{children:U.map(u=>r.jsx(Lr,{dirName:q(u.path),updatedAt:u.updatedAt,skillMdUrl:$(j,`${u.path}/SKILL.md`),publicState:Ce(u),onOpen:()=>o(ye(s,u.path)),onBrowse:()=>t(ye(s,u.path)),onShare:V(u),onDelete:_(u),draggable:!s.readOnly,...Ae(u.path,"dir",{onDragStart:m,onContextMenu:b})},u.path))})]}),N=Q.length>0&&r.jsxs("div",{className:"flex flex-col gap-3",children:[r.jsx(oe,{children:x("library.libraryViews.brands")}),r.jsx(fe,{children:Q.map(u=>r.jsx(Mr,{dirName:q(u.path),updatedAt:u.updatedAt,tokensUrl:$(j,`${u.path}/tokens.css`),onOpen:()=>c(ye(s,u.path)),onBrowse:()=>t(ye(s,u.path)),onDelete:_(u),draggable:!s.readOnly,...Ae(u.path,"dir",{onDragStart:m,onContextMenu:b})},u.path))})]}),L=(ce.length>0||S)&&r.jsxs("div",{className:"flex flex-col gap-3",children:[r.jsx(oe,{children:x("library.libraryViews.folders")}),r.jsxs(fe,{children:[S,ce.map(u=>r.jsx(Fe,{name:q(u.path),meta:hr(u.updatedAt),subtitle:E(q(u.path)),readOnly:s.readOnly,publicState:Ce(u),onOpen:()=>t(ye(s,u.path)),onShare:V(u),onDelete:_(u),draggable:!s.readOnly,...Ae(u.path,"dir",{onDragStart:m,onContextMenu:b,onDrop:g})},u.path))]})]}),M=O.length>0&&r.jsxs("div",{className:"flex flex-col gap-3",children:[r.jsx(oe,{children:x("library.libraryViews.files")}),r.jsx(er,{view:a,children:O.map(u=>r.jsx(Ze,{layout:v?a==="media"?"media":"row":"card",size:u.size,filename:q(u.path),updatedAt:u.updatedAt,downloadUrl:$(j,u.path),publicState:Ce(u),onOpen:()=>n(ye(s,u.path)),onShare:V(u),onDelete:_(u),draggable:!s.readOnly,...Ae(u.path,"file",{onDragStart:m,onContextMenu:b})},u.path))})]})}e[17]=v,e[18]=E,e[19]=$,e[20]=a,e[21]=P.data,e[22]=s,e[23]=b,e[24]=i,e[25]=m,e[26]=g,e[27]=c,e[28]=t,e[29]=n,e[30]=o,e[31]=d,e[32]=S,e[33]=x,e[34]=j,e[35]=O,e[36]=k,e[37]=N,e[38]=L,e[39]=M,e[40]=y}else O=e[35],k=e[36],N=e[37],L=e[38],M=e[39],y=e[40];if(y!==Symbol.for("react.early_return_sentinel"))return y;let z;e[57]!==a||e[58]!==O||e[59]!==x?(z=a!=="all"&&O.length===0&&r.jsx(Be,{children:x("library.library.noFilesInView")}),e[57]=a,e[58]=O,e[59]=x,e[60]=z):z=e[60];let X;e[61]!==a||e[62]!==s.isHomeRoot||e[63]!==i||e[64]!==n||e[65]!==d?(X=s.isHomeRoot&&r.jsx(wt,{fileView:a,onOpenFile:n,onShare:d,onDelete:i}),e[61]=a,e[62]=s.isHomeRoot,e[63]=i,e[64]=n,e[65]=d,e[66]=X):X=e[66];let H;return e[67]!==k||e[68]!==N||e[69]!==L||e[70]!==M||e[71]!==z||e[72]!==X?(H=r.jsxs(r.Fragment,{children:[k,N,L,M,z,X]}),e[67]=k,e[68]=N,e[69]=L,e[70]=M,e[71]=z,e[72]=X,e[73]=H):H=e[73],H}function Nt(l){return l.kind==="dir"&&!l.hasSkill&&!l.hasBrand}function Pt(l){return l.kind==="dir"&&l.hasBrand&&!l.hasSkill}function Ct(l){return l.kind==="dir"&&l.hasSkill}function Ot(l){const e=T.c(19),{segments:s,onNavigate:t}=l,{org:a}=ge();let n;e[0]!==s?(n=s[0]===ue?s.slice(1):s,e[0]=s,e[1]=n):n=e[1];const o=n,c=s.length-o.length,d=o.length===0;let i;e[2]!==d||e[3]!==t||e[4]!==a.slug?(i=d?r.jsx("span",{className:"truncate font-medium text-foreground",children:Oe(a.slug)}):r.jsx("button",{type:"button",className:"truncate text-muted-foreground hover:text-foreground hover:underline",onClick:()=>t(ue),children:Oe(a.slug)}),e[2]=d,e[3]=t,e[4]=a.slug,e[5]=i):i=e[5];let m;if(e[6]!==c||e[7]!==t||e[8]!==o||e[9]!==s){let g;e[11]!==c||e[12]!==t||e[13]!==o.length||e[14]!==s?(g=(v,x)=>{const h=s.slice(0,c+x+1).join("/"),j=x===o.length-1;return r.jsxs("span",{className:"flex min-w-0 items-center gap-1",children:[r.jsx(kr,{size:12,className:"shrink-0 text-muted-foreground"}),j?r.jsx("span",{className:"truncate font-medium text-foreground",children:he(v)}):r.jsx("button",{type:"button",className:"truncate text-muted-foreground hover:text-foreground hover:underline",onClick:()=>t(h),children:he(v)})]},h)},e[11]=c,e[12]=t,e[13]=o.length,e[14]=s,e[15]=g):g=e[15],m=o.map(g),e[6]=c,e[7]=t,e[8]=o,e[9]=s,e[10]=m}else m=e[10];let b;return e[16]!==i||e[17]!==m?(b=r.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-1 text-sm",children:[i,m]}),e[16]=i,e[17]=m,e[18]=b):b=e[18],b}function Dt(l){const e=l("library.brandComponentsPreview.title"),s=l("library.brandComponentsPreview.subtitle"),t=l("library.brandComponentsPreview.monthlySavingsLabel"),a=l("library.brandComponentsPreview.primaryButton"),n=l("library.brandComponentsPreview.secondaryButton"),o=l("library.brandComponentsPreview.ghostButton"),c=l("library.brandComponentsPreview.successBadge"),d=l("library.brandComponentsPreview.warningBadge"),i=l("library.brandComponentsPreview.errorBadge"),m=l("library.brandComponentsPreview.infoBadge"),b=l("library.brandComponentsPreview.allChip"),g=l("library.brandComponentsPreview.incomeChip"),v=l("library.brandComponentsPreview.spendingChip"),x=l("library.brandComponentsPreview.emailPlaceholder");return`
2
+ <div class="stack">
3
+ <div>
4
+ <h1>${e}</h1>
5
+ <p class="muted" style="margin:6px 0 0">${s}</p>
6
+ </div>
7
+ <div class="row">
8
+ <button class="btn btn-primary">${a}</button>
9
+ <button class="btn btn-secondary">${n}</button>
10
+ <button class="btn btn-ghost">${o}</button>
11
+ </div>
12
+ <div class="card">
13
+ <p class="muted" style="margin:0 0 6px">${t}</p>
14
+ <div class="kpi">$240</div>
15
+ </div>
16
+ <input class="input" placeholder="${x}" />
17
+ <div class="row">
18
+ <span class="badge badge-success">${c}</span>
19
+ <span class="badge badge-warning">${d}</span>
20
+ <span class="badge badge-error">${i}</span>
21
+ <span class="badge badge-info">${m}</span>
22
+ </div>
23
+ <div class="row">
24
+ <span class="chip chip-active">${b}</span>
25
+ <span class="chip">${g}</span>
26
+ <span class="chip">${v}</span>
27
+ </div>
28
+ </div>
29
+ `}const $t=`
30
+ *{box-sizing:border-box}
31
+ body{margin:0;padding:24px;background:var(--brand-bg,#0b0f1a);color:var(--brand-fg,#f5f7ff);font-family:var(--brand-font-body,system-ui,sans-serif);font-size:14px;line-height:1.5}
32
+ .stack{display:flex;flex-direction:column;gap:18px;max-width:760px}
33
+ .row{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
34
+ h1{font-family:var(--brand-font-display,inherit);font-size:28px;font-weight:700;letter-spacing:-0.02em;margin:0}
35
+ .muted{color:var(--brand-fg-muted,#9fb0c9)}
36
+ .btn{border:0;border-radius:var(--brand-radius,12px);padding:10px 16px;font:inherit;font-weight:600;cursor:pointer}
37
+ .btn-primary{background:var(--brand-primary,#0a84ff);color:#fff}
38
+ .btn-secondary{background:transparent;color:var(--brand-fg,#f5f7ff);border:1.5px solid var(--brand-border-strong,rgba(255,255,255,.22))}
39
+ .btn-ghost{background:transparent;color:var(--brand-fg-muted,#9fb0c9)}
40
+ .card{background:var(--brand-bg-subtle,#121826);border:1px solid var(--brand-border,rgba(255,255,255,.1));border-radius:var(--brand-radius-lg,16px);padding:20px;box-shadow:var(--brand-shadow-md,0 6px 16px rgba(8,12,22,.45))}
41
+ .kpi{font-family:var(--brand-font-display,inherit);font-size:44px;font-weight:700;color:var(--brand-primary,#0a84ff);line-height:1;letter-spacing:-0.02em}
42
+ .input{width:100%;background:var(--brand-bg-elevated,#1a2233);border:1.5px solid var(--brand-border,rgba(255,255,255,.12));border-radius:var(--brand-radius,12px);padding:10px 12px;color:inherit;font:inherit}
43
+ .badge{display:inline-flex;align-items:center;border-radius:999px;padding:4px 10px;font-size:12px;font-weight:600}
44
+ .badge-success{background:var(--brand-success-bg,#e7f6ec);color:var(--brand-success-fg,#0f7a37)}
45
+ .badge-warning{background:var(--brand-warning-bg,#fdf3d6);color:var(--brand-warning-fg,#8a6500)}
46
+ .badge-error{background:var(--brand-error-bg,#fde7e8);color:var(--brand-error-fg,#b01319)}
47
+ .badge-info{background:var(--brand-info-bg,#e8f1ff);color:var(--brand-info-fg,#0b54a8)}
48
+ .chip{border:1.5px solid var(--brand-border-strong,rgba(255,255,255,.22));border-radius:999px;padding:6px 14px;font-size:13px}
49
+ .chip-active{background:var(--brand-primary,#0a84ff);border-color:transparent;color:#fff}
50
+ `;function Ft(l,e){return`<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><style>${l??""}</style><style>${$t}</style></head><body>${e}</body></html>`}function Tt(l){const e=T.c(11),{tokensUrl:s}=l,t=J(),a=De(s??"");if(s&&a.isPending){let m;return e[0]===Symbol.for("react.memo_cache_sentinel")?(m=r.jsx("div",{className:"flex h-full w-full items-center justify-center p-6",children:r.jsx(ie,{className:"h-full w-full rounded-xl"})}),e[0]=m):m=e[0],m}let n;e[1]!==t?(n=t("library.brandComponentsPreview.iframeTitle"),e[1]=t,e[2]=n):n=e[2];const o=n;let c,d;if(e[3]!==o||e[4]!==t||e[5]!==a.data){const m=Dt(t);c=o,d=Ft(a.data??null,m),e[3]=o,e[4]=t,e[5]=a.data,e[6]=c,e[7]=d}else c=e[6],d=e[7];let i;return e[8]!==c||e[9]!==d?(i=r.jsx("iframe",{title:c,srcDoc:d,sandbox:"",className:"block h-full w-full border-0 bg-white"}),e[8]=c,e[9]=d,e[10]=i):i=e[10],i}const Et="Theme preview",zt=[`<section class="slide-center">
51
+ <p class="eyebrow">Brand deck</p>
52
+ <h1 class="deck-h1">Your brand, on every slide</h1>
53
+ <p class="deck-sub">A live preview of each slide layout in your brand style.</p>
54
+ <p class="deck-meta">Theme preview</p>
55
+ </section>`,`<section>
56
+ <p class="eyebrow">Agenda</p>
57
+ <h2 class="deck-h2">What's in this theme</h2>
58
+ <ol class="agenda">
59
+ <li>Title &amp; section dividers</li>
60
+ <li>Bulleted content</li>
61
+ <li>Side-by-side columns</li>
62
+ <li>Metrics &amp; timelines</li>
63
+ <li>Quotes &amp; closing</li>
64
+ </ol>
65
+ </section>`,`<section class="slide-center divider">
66
+ <p class="giant-number">01</p>
67
+ <h2 class="deck-h1">Content layouts</h2>
68
+ <p class="deck-sub">How text-heavy slides look.</p>
69
+ </section>`,`<section>
70
+ <p class="eyebrow">Bullets</p>
71
+ <h2 class="deck-h2">Key points land cleanly</h2>
72
+ <p class="deck-body intro">Short, scannable lines with the brand accent marker.</p>
73
+ <ul class="bullets">
74
+ <li>Each point is one idea</li>
75
+ <li>Accent color draws the eye</li>
76
+ <li>Plenty of breathing room</li>
77
+ </ul>
78
+ </section>`,`<section>
79
+ <p class="eyebrow">Two column</p>
80
+ <h2 class="deck-h2">Compare side by side</h2>
81
+ <div class="cols">
82
+ <div class="card grow">
83
+ <h3 class="col-title">Before</h3>
84
+ <div class="deck-body"><p>Generic slides that ignore your brand.</p></div>
85
+ </div>
86
+ <div class="card grow">
87
+ <h3 class="col-title">After</h3>
88
+ <div class="deck-body"><p>Every deck on-brand, automatically.</p></div>
89
+ </div>
90
+ </div>
91
+ </section>`,`<section>
92
+ <p class="eyebrow">Metrics</p>
93
+ <h2 class="deck-h2">Numbers that matter</h2>
94
+ <div class="cols kpis">
95
+ <div class="card kpi grow">
96
+ <p class="kpi-value">3&times;</p>
97
+ <p class="kpi-label">Faster deck creation</p>
98
+ <p class="kpi-delta">since adopting the theme</p>
99
+ </div>
100
+ <div class="card kpi grow">
101
+ <p class="kpi-value">100%</p>
102
+ <p class="kpi-label">On-brand slides</p>
103
+ <p class="kpi-delta">no manual restyling</p>
104
+ </div>
105
+ <div class="card kpi grow">
106
+ <p class="kpi-value">1</p>
107
+ <p class="kpi-label">Source of truth</p>
108
+ <p class="kpi-delta">tokens.css</p>
109
+ </div>
110
+ </div>
111
+ </section>`,`<section>
112
+ <p class="eyebrow">Timeline</p>
113
+ <h2 class="deck-h2">How it unfolds</h2>
114
+ <div class="cols timeline">
115
+ <div class="step grow">
116
+ <p class="step-label">Step 1</p>
117
+ <h3 class="col-title">Define</h3>
118
+ <p class="deck-body">Set brand tokens once.</p>
119
+ </div>
120
+ <div class="step grow">
121
+ <p class="step-label">Step 2</p>
122
+ <h3 class="col-title">Generate</h3>
123
+ <p class="deck-body">Create decks from data.</p>
124
+ </div>
125
+ <div class="step grow">
126
+ <p class="step-label">Step 3</p>
127
+ <h3 class="col-title">Present</h3>
128
+ <p class="deck-body">Ship, always on-brand.</p>
129
+ </div>
130
+ </div>
131
+ </section>`,`<section>
132
+ <p class="eyebrow">Comparison</p>
133
+ <h2 class="deck-h2">Plans at a glance</h2>
134
+ <div class="cols">
135
+ <div class="card grow">
136
+ <h3 class="col-title">Starter</h3>
137
+ <ul class="bullets compact">
138
+ <li>Core layouts</li>
139
+ <li>Brand colors</li>
140
+ <li>Logo</li>
141
+ </ul>
142
+ </div>
143
+ <div class="card grow">
144
+ <h3 class="col-title">Pro</h3>
145
+ <ul class="bullets compact">
146
+ <li>Everything in Starter</li>
147
+ <li>Custom fonts</li>
148
+ <li>Theme shell</li>
149
+ </ul>
150
+ </div>
151
+ </div>
152
+ </section>`,`<section class="slide-center">
153
+ <blockquote class="deck-quote">&ldquo;Design once, stay on-brand everywhere.&rdquo;</blockquote>
154
+ <p class="attribution">Brand system &middot; Studio</p>
155
+ </section>`,`<section class="slide-center">
156
+ <h2 class="deck-h1">Ready to present</h2>
157
+ <p class="deck-sub">Generate a deck with this theme via the slides skill.</p>
158
+ <p class="cta">slides-create --theme &hellip;</p>
159
+ </section>`].join(`
160
+
161
+ `);function At(l,e){const s=e?`<style>${e}</style>`:"";return l.replaceAll("{{{slides}}}",zt).replaceAll("{{title}}",Et).replace(/(src=")(\/deck-runtime\/)/g,`$1${window.location.origin}$2`).replace("</head>",`${s}</head>`)}function Rt(l){const e=T.c(8),{readUrl:s,title:t,tokensUrl:a}=l,n=De(s),o=De(a??"");if(n.isPending||a&&o.isPending){let m;return e[0]===Symbol.for("react.memo_cache_sentinel")?(m=r.jsx("div",{className:"flex h-full w-full items-center justify-center p-6",children:r.jsx(ie,{className:"aspect-[16/9] w-full max-w-3xl rounded-xl"})}),e[0]=m):m=e[0],m}if(n.isError||!n.data){let m;return e[1]===Symbol.for("react.memo_cache_sentinel")?(m=r.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:"This theme is no longer available."}),e[1]=m):m=e[1],m}const c=o.data??null;let d;e[2]!==c||e[3]!==n.data?(d=At(n.data,c),e[2]=c,e[3]=n.data,e[4]=d):d=e[4];let i;return e[5]!==d||e[6]!==t?(i=r.jsx("iframe",{title:t,srcDoc:d,sandbox:"allow-scripts",className:"block h-full w-full border-0 bg-white"}),e[5]=d,e[6]=t,e[7]=i):i=e[7],i}function Se(l){const e=T.c(2),{children:s}=l;let t;return e[0]!==s?(t=r.jsx("p",{className:"text-sm font-medium text-foreground",children:s}),e[0]=s,e[1]=t):t=e[1],t}function Bt(l){const e=T.c(16),{family:s,tokens:t,editing:a,valueOf:n,onEdit:o}=l;let c;e[0]!==s?(c=r.jsx("span",{className:"text-xs text-muted-foreground",children:s}),e[0]=s,e[1]=c):c=e[1];let d;if(e[2]!==a||e[3]!==o||e[4]!==t||e[5]!==n){let b;e[7]!==a||e[8]!==o||e[9]!==n?(b=g=>{const v=n(g),x=`${g.name.replace(/^--brand-/,"")}: ${v}`;return a&&/^#/.test(v)?r.jsx("input",{type:"color","aria-label":g.name,title:x,value:Kr(v),onChange:h=>o(g.name,h.target.value),className:"size-7 cursor-pointer rounded-md border border-border/60 bg-transparent p-0.5"},g.name):r.jsx("span",{title:x,className:"size-7 rounded-md border border-border/60",style:{backgroundColor:v}},g.name)},e[7]=a,e[8]=o,e[9]=n,e[10]=b):b=e[10],d=t.map(b),e[2]=a,e[3]=o,e[4]=t,e[5]=n,e[6]=d}else d=e[6];let i;e[11]!==d?(i=r.jsx("div",{className:"flex flex-wrap gap-1",children:d}),e[11]=d,e[12]=i):i=e[12];let m;return e[13]!==c||e[14]!==i?(m=r.jsxs("div",{className:"flex flex-col gap-1.5",children:[c,i]}),e[13]=c,e[14]=i,e[15]=m):m=e[15],m}function Lt(l){const e=T.c(9),{token:s,value:t}=l;if(s.kind==="space"){let n;return e[0]!==t?(n=r.jsx("span",{className:"flex h-7 w-16 shrink-0 items-center",children:r.jsx("span",{className:"h-1.5 rounded-full bg-primary",style:{width:t,maxWidth:"100%"}})}),e[0]=t,e[1]=n):n=e[1],n}if(s.kind==="radius"){let n;return e[2]!==t?(n=r.jsx("span",{className:"size-7 shrink-0 border border-border bg-muted/50",style:{borderRadius:t}}),e[2]=t,e[3]=n):n=e[3],n}if(s.kind==="shadow"){let n;return e[4]!==t?(n=r.jsx("span",{className:"size-7 shrink-0 rounded-md bg-background",style:{boxShadow:t}}),e[4]=t,e[5]=n):n=e[5],n}if(s.kind==="type"&&/^--brand-text-/.test(s.name)){const n=`min(${t}, 22px)`;let o;return e[6]!==n?(o=r.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center overflow-hidden leading-none text-foreground",style:{fontSize:n},children:"Ag"}),e[6]=n,e[7]=o):o=e[7],o}let a;return e[8]===Symbol.for("react.memo_cache_sentinel")?(a=r.jsx("span",{className:"size-7 shrink-0"}),e[8]=a):a=e[8],a}function gr(l){const e=T.c(17),{token:s,value:t,editing:a,onEdit:n}=l;let o;e[0]!==s||e[1]!==t?(o=r.jsx(Lt,{token:s,value:t}),e[0]=s,e[1]=t,e[2]=o):o=e[2];let c;if(e[3]!==s.name){let b;e[5]===Symbol.for("react.memo_cache_sentinel")?(b=/^--brand-/,e[5]=b):b=e[5],c=s.name.replace(b,""),e[3]=s.name,e[4]=c}else c=e[4];let d;e[6]!==c?(d=r.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:c}),e[6]=c,e[7]=d):d=e[7];let i;e[8]!==a||e[9]!==n||e[10]!==s.name||e[11]!==t?(i=a?r.jsx(Pe,{value:t,onChange:b=>n(s.name,b.target.value),className:"h-8 w-40 font-mono text-xs"}):r.jsx("span",{className:"shrink-0 font-mono text-xs text-muted-foreground",children:t}),e[8]=a,e[9]=n,e[10]=s.name,e[11]=t,e[12]=i):i=e[12];let m;return e[13]!==o||e[14]!==d||e[15]!==i?(m=r.jsxs("div",{className:"flex items-center gap-3",children:[o,d,i]}),e[13]=o,e[14]=d,e[15]=i,e[16]=m):m=e[16],m}function ke(l){const e=T.c(16),{label:s,tokens:t,editing:a,valueOf:n,onEdit:o}=l;if(t.length===0)return null;let c;e[0]!==s?(c=r.jsx(Se,{children:s}),e[0]=s,e[1]=c):c=e[1];let d;if(e[2]!==a||e[3]!==o||e[4]!==t||e[5]!==n){let b;e[7]!==a||e[8]!==o||e[9]!==n?(b=g=>r.jsx(gr,{token:g,value:n(g),editing:a,onEdit:o},g.name),e[7]=a,e[8]=o,e[9]=n,e[10]=b):b=e[10],d=t.map(b),e[2]=a,e[3]=o,e[4]=t,e[5]=n,e[6]=d}else d=e[6];let i;e[11]!==d?(i=r.jsx("div",{className:"flex flex-col gap-2.5",children:d}),e[11]=d,e[12]=i):i=e[12];let m;return e[13]!==c||e[14]!==i?(m=r.jsxs("div",{className:"flex flex-col gap-3",children:[c,i]}),e[13]=c,e[14]=i,e[15]=m):m=e[15],m}function Mt({brandPath:l,onClose:e,variant:s}){const t=J(),{org:a}=ge(),n=pr(l),o=n.volume??"",c=n.dirPath,d=q(c),i=n.readOnly,m=cr(),b=Le(),g=Rr(o),{upload:v,remove:x}=Qe(o),h=B.useRef(null),j=fr(o,c),P=j.data??[],$=f=>P.some(A=>A.kind==="file"&&q(A.path)===f),F=$("tokens.css"),E=$("brand.md"),w=$("slides-theme.html"),S=Vr(P),O=b(o,`${c}/tokens.css`),k=b(o,`${c}/brand.md`),N=b(o,`${c}/slides-theme.html`),L=De(O,{enabled:F}),M=De(k,{enabled:E}),[y,z]=B.useState(!1),[X,H]=B.useState({}),[C,U]=B.useState(null),[Q,ce]=B.useState(!1),[Y,W]=B.useState(!1),[_,ee]=B.useState("deck"),V=L.data?Ur(L.data):[],u=f=>V.find(A=>A.name===f)?.value,R=f=>X[f.name]??f.value,be=Hr(V),se=V.filter(f=>f.kind==="font"),ae=V.filter(f=>f.kind==="type"),Ve=V.filter(f=>f.kind==="space"),ve=V.filter(f=>f.kind==="radius"),de=V.filter(f=>f.kind==="shadow"),re=V.filter(f=>f.kind==="motion"),le=V.filter(f=>f.kind==="other"),Z=(f,A)=>H(pe=>({...pe,[f]:A})),ne=w&&_==="deck",je=C??M.data??"",xe=Object.entries(X).filter(([f,A])=>u(f)!==A),me=C!==null&&C!==(M.data??""),Te=xe.length>0||me;function Ue(){H({}),U(null),z(!1)}async function He(){ce(!0);try{if(xe.length>0){let f=L.data??"";for(const[A,pe]of xe)f=Ir(f,A,pe);await g.mutateAsync({path:`${c}/tokens.css`,body:f,contentType:"text/css; charset=utf-8"}),m.invalidateQueries({queryKey:te.fileText(O)})}me&&C!==null&&(await g.mutateAsync({path:`${c}/brand.md`,body:C,contentType:"text/markdown; charset=utf-8"}),m.invalidateQueries({queryKey:te.fileText(k)})),m.invalidateQueries({queryKey:te.orgFsVolume(a.id,o)}),m.invalidateQueries({queryKey:te.orgFsRecent(a.id)}),H({}),U(null),z(!1),I.success(t("library.brandPreview.brandSaved"))}catch(f){I.error(f instanceof Error?f.message:t("library.brandPreview.failedSaveBrand"))}finally{ce(!1)}}async function Ie(f){const A=f?.[0];if(!A)return;const Ee=`logo.${(A.name.split(".").pop()??"png").toLowerCase()}`;try{await v.mutateAsync({dir:c,files:[new File([A],Ee,{type:A.type})]}),S&&q(S)!==Ee&&await x.mutateAsync(S),I.success(t("library.brandPreview.logoUpdated"))}catch(we){I.error(we instanceof Error?we.message:t("library.brandPreview.logoUploadFailed"))}finally{h.current&&(h.current.value="")}}const Ke=!j.isPending&&!F&&!E&&!S;return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b border-border px-4 py-3",children:[r.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary",children:r.jsx(ir,{size:18})}),s==="dialog"?r.jsx(We,{className:"flex-1 truncate text-base font-medium text-foreground",children:d}):r.jsx("span",{className:"flex-1 truncate text-base font-medium text-foreground",children:d}),!i&&(y?r.jsxs(r.Fragment,{children:[r.jsx(K,{variant:"ghost",size:"sm",onClick:Ue,disabled:Q,children:t("library.brandPreview.cancel")}),r.jsx(K,{size:"sm",disabled:!Te||Q,onClick:()=>{He()},children:t(Q?"library.brandPreview.saving":"library.brandPreview.save")})]}):r.jsxs(K,{variant:"outline",size:"sm",onClick:()=>z(!0),children:[r.jsx(ot,{size:14}),t("library.brandPreview.edit")]})),s==="dialog"?r.jsx(st,{asChild:!0,children:r.jsx(K,{variant:"ghost",size:"icon",className:"size-8 shrink-0",children:r.jsx(or,{size:16})})}):r.jsx(K,{variant:"ghost",size:"icon",className:"size-8 shrink-0",onClick:e,children:r.jsx(or,{size:16})})]}),r.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:j.isPending?r.jsxs("div",{className:"flex flex-col gap-3 p-6",children:[r.jsx(ie,{className:"h-40 w-full rounded-xl"}),r.jsx(ie,{className:"h-4 w-1/3"}),r.jsx(ie,{className:"h-4 w-2/3"})]}):Ke?r.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:t("library.brandPreview.brandNotAvailable")}):r.jsxs(r.Fragment,{children:[(w||F)&&r.jsxs("div",{className:"shrink-0 border-b border-border",children:[r.jsxs("div",{role:"button",tabIndex:0,"aria-label":t(Y?"library.brandPreview.showPreview":"library.brandPreview.hidePreview"),onClick:()=>W(f=>!f),onKeyDown:f=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),W(A=>!A))},className:"flex cursor-pointer items-center justify-between gap-2 px-4 py-2.5 hover:bg-muted/40",children:[r.jsxs("div",{className:"flex gap-0.5 rounded-lg bg-muted p-0.5 text-xs font-medium",onClick:f=>f.stopPropagation(),children:[w&&r.jsx("button",{type:"button",onClick:()=>{ee("deck"),W(!1)},className:Re("classic:rounded-md compact:rounded-lg px-2.5 py-1",ne?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:t("library.brandPreview.deck")}),r.jsx("button",{type:"button",onClick:()=>{ee("components"),W(!1)},className:Re("classic:rounded-md compact:rounded-lg px-2.5 py-1",ne?"text-muted-foreground hover:text-foreground":"bg-background text-foreground shadow-sm"),children:t("library.brandPreview.components")})]}),Y?r.jsx(nt,{size:16,className:"shrink-0 text-muted-foreground"}):r.jsx(it,{size:16,className:"shrink-0 text-muted-foreground"})]}),!Y&&r.jsx("div",{className:"px-4 pb-4",children:r.jsx("div",{className:Re("w-full overflow-hidden rounded-xl border border-border bg-muted/30",ne?"aspect-[16/9]":"h-96"),children:ne?r.jsx(Rt,{readUrl:N,title:`${d} deck theme`,tokensUrl:O}):r.jsx(Tt,{tokensUrl:O})})})]}),r.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-8 overflow-y-auto p-6",children:[r.jsxs("div",{className:"flex flex-col gap-3",children:[r.jsx(Se,{children:t("library.brandPreview.logo")}),r.jsxs("div",{className:"flex items-center gap-4",children:[r.jsx("div",{className:"flex size-24 items-center justify-center overflow-hidden rounded-xl border border-border bg-muted/30",children:S?r.jsx("img",{src:b(o,S),alt:`${d} logo`,className:"max-h-full max-w-full object-contain"}):r.jsx(ir,{size:28,className:"text-muted-foreground/50"})}),y&&r.jsxs("div",{children:[r.jsxs(K,{variant:"outline",size:"sm",disabled:v.isPending,onClick:()=>h.current?.click(),children:[r.jsx(Ne,{size:14}),t(S?"library.brandPreview.replaceLogo":"library.brandPreview.addLogo")]}),r.jsx("input",{ref:h,type:"file",accept:"image/*",className:"hidden",onChange:f=>{Ie(f.target.files)}})]})]})]}),be.length>0&&r.jsxs("div",{className:"flex flex-col gap-3",children:[r.jsx(Se,{children:t("library.brandPreview.colors")}),be.map(f=>r.jsx(Bt,{family:f.family,tokens:f.tokens,editing:y,valueOf:R,onEdit:Z},f.family))]}),(se.length>0||ae.length>0)&&r.jsxs("div",{className:"flex flex-col gap-3",children:[r.jsx(Se,{children:t("library.brandPreview.typography")}),se.map(f=>r.jsxs("div",{className:"flex flex-col gap-1",children:[r.jsx("span",{className:"text-xs text-muted-foreground",children:f.name.replace(/^--brand-font-?/,"")||t("library.brandPreview.defaultFont")}),y?r.jsx(Pe,{value:R(f),onChange:A=>Z(f.name,A.target.value),className:"h-9"}):r.jsx("span",{className:"truncate text-lg text-foreground",style:{fontFamily:R(f)},children:R(f)})]},f.name)),ae.map(f=>r.jsx(gr,{token:f,value:R(f),editing:y,onEdit:Z},f.name))]}),r.jsx(ke,{label:t("library.brandPreview.spacing"),tokens:Ve,editing:y,valueOf:R,onEdit:Z}),r.jsx(ke,{label:t("library.brandPreview.radius"),tokens:ve,editing:y,valueOf:R,onEdit:Z}),r.jsx(ke,{label:t("library.brandPreview.shadows"),tokens:de,editing:y,valueOf:R,onEdit:Z}),r.jsx(ke,{label:t("library.brandPreview.motion"),tokens:re,editing:y,valueOf:R,onEdit:Z}),r.jsx(ke,{label:t("library.brandPreview.tokens"),tokens:le,editing:y,valueOf:R,onEdit:Z}),r.jsxs("div",{className:"flex flex-col gap-3",children:[r.jsx(Se,{children:t("library.brandPreview.voiceGuidelines")}),y?r.jsx(lt,{value:je,onChange:f=>U(f.target.value),placeholder:t("library.brandPreview.voicePlaceholder"),className:"min-h-48 font-mono text-sm"}):M.isPending&&E?r.jsxs("div",{className:"flex flex-col gap-2",children:[r.jsx(ie,{className:"h-3 w-full"}),r.jsx(ie,{className:"h-3 w-5/6"})]}):je.trim()?r.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none",children:r.jsx(ct,{id:`brand-preview-${l}`,text:je})}):r.jsx("p",{className:"text-sm text-muted-foreground",children:t("library.brandPreview.noVoiceYet")})]})]})]})})]})}function vr(l){const e=T.c(8),{brandPath:s,onClose:t}=l;let a;e[0]!==t?(a=c=>{c||t()},e[0]=t,e[1]=a):a=e[1];let n;e[2]!==s||e[3]!==t?(n=r.jsx(Ye,{className:"flex h-[88vh] w-[94vw] max-w-none! flex-col gap-0 overflow-hidden p-0 sm:max-w-2xl!",closeButtonClassName:"hidden",children:r.jsx(Mt,{brandPath:s,onClose:t,variant:"dialog"})}),e[2]=s,e[3]=t,e[4]=n):n=e[4];let o;return e[5]!==a||e[6]!==n?(o=r.jsx(Ge,{open:!0,onOpenChange:a,children:n}),e[5]=a,e[6]=n,e[7]=o):o=e[7],o}function Vt({onOpenFile:l,onOpenSkill:e,onOpenBrand:s}={}){const t=$e(),a=J(),{org:n}=ge(),o=cr(),c=Sr(),d=Qr(),i=Nr({strict:!1}),m=t?i.fileView??"all":"all",b=p=>c({to:".",search:D=>({...D,fileView:p==="all"?void 0:p})}),g=i.path||ue,v=pr(g),x=qr(),h=v.volume!==null&&x.has(v.volume)?{...v,readOnly:!0}:v,j=(p,D)=>c({to:".",search:G=>({...G,[p]:D||void 0})}),P=p=>j("path",p),$=h.segments[0]===ue?h.segments.slice(1):h.segments,F=h.segments.length-$.length,E=$.map((p,D)=>{const G=h.segments.slice(0,F+D+1).join("/");return{key:`folder:${G}`,label:he(p),onSelect:()=>P(G)}}),w=(p,D)=>c({to:".",search:G=>({...G,preview:void 0,skill:void 0,brand:void 0,[p]:D})}),S=l??(p=>w("preview",p)),O=e??(p=>w("skill",p)),k=s??(p=>w("brand",p)),[N,L]=B.useState(""),M=at(N.trim(),300),y=!h.isHomeRoot&&h.volume!==null?{volume:h.volume,prefix:h.dirPath}:void 0,z=y?a("library.library.searchInPlaceholder",{folder:he(h.segments.at(-1)??"")}):a("library.library.searchPlaceholder"),X=h.isHomeRoot?Oe(n.slug):he(h.segments.at(-1)??""),[H,C]=B.useState(null),[U,Q]=B.useState(null),[ce,Y]=B.useState(!1),[W,_]=B.useState(""),[ee,V]=B.useState(!1),[u,R]=B.useState(null),[be,se]=B.useState(""),ae=B.useRef(null),[Ve,ve]=B.useState(!1),de=B.useRef(0),re=h.readOnly?null:h.volume,{upload:le,mkdir:Z,move:ne}=Qe(re??ue),{remove:je}=Qe(H?.volume??"uploads");async function xe(p){if(!(!re||!p||p.length===0))try{await le.mutateAsync({dir:h.dirPath,files:[...p]}),I.success(p.length===1?a("library.library.uploadedSingle",{filename:p[0]?.name??""}):a("library.library.uploadedMultiple",{count:p.length}))}catch(D){I.error(D instanceof Error?D.message:a("library.library.uploadFailed"))}finally{ae.current&&(ae.current.value="")}}const me=re!==null;function Te(p){return p.dataTransfer.types.includes("Files")}function Ue(p){!me||!Te(p)||(p.preventDefault(),de.current+=1,ve(!0))}function He(p){!me||!Te(p)||p.preventDefault()}function Ie(){me&&(de.current=Math.max(0,de.current-1),de.current===0&&ve(!1))}function Ke(p){me&&(p.preventDefault(),p.stopPropagation(),de.current=0,ve(!1),p.dataTransfer.files.length>0&&xe(p.dataTransfer.files))}async function f(){const p=W.trim();if(!(!re||!p)){if(h.isHomeRoot&&Xe.has(p.toLowerCase())){I.error(a("library.library.folderNameReserved",{name:p}));return}try{const D=h.dirPath;await Z.mutateAsync(D?`${D}/${p}`:p),I.success(a("library.library.folderCreated",{name:p})),Y(!1),_("")}catch(D){I.error(D instanceof Error?D.message:a("library.library.folderCreateFailed"))}}}async function A(){if(!H)return;const p=H;try{await je.mutateAsync(p.path),I.success(a("library.library.deleted",{name:q(p.path)}))}catch(D){I.error(D instanceof Error?D.message:a("library.library.deleteFailed"))}finally{C(null)}}async function pe(){if(!u)return;const p=be.trim();if(!p||p.includes("/")||p.includes("..")||p===q(u.path)){V(!1),R(null),se("");return}if(u.kind==="dir"&&h.isHomeRoot&&Xe.has(p.toLowerCase())){I.error(a("library.library.folderNameReserved",{name:p}));return}try{const D=u.path.includes("/")?u.path.slice(0,u.path.lastIndexOf("/")):"",G=D?`${D}/${p}`:p;await ne.mutateAsync({from:u.path,to:G});const qe=p.replace(/[<>]/g,"");I.success(a("library.library.renamed",{name:qe}))}catch(D){I.error(D instanceof Error?D.message:a("library.library.renameFailed"))}finally{V(!1),R(null),se("")}}async function Ee(p,D){try{const G=q(p),qe=D?`${D}/${G}`:G;await ne.mutateAsync({from:p,to:qe}),I.success(a("library.library.moved",{name:G,destination:D||a("library.library.theLibrary")}))}catch(G){I.error(G instanceof Error?G.message:a("library.library.moveFailed"))}}function we(){for(const p of bt)o.invalidateQueries({queryKey:te.orgFsVolume(n.id,p)});h.volume&&o.invalidateQueries({queryKey:te.orgFsVolume(n.id,h.volume)}),o.invalidateQueries({queryKey:te.orgFsRecent(n.id)}),o.invalidateQueries({queryKey:te.orgFsSearchRoot(n.id)}),o.invalidateQueries({queryKey:te.orgFsPublicSets(n.id)})}function jr(p){p.defaultPrevented||!re||p.target.closest("input, textarea, button, a, [role='button']")||(p.preventDefault(),Y(!0))}return r.jsxs("div",{className:"relative h-full",onDragEnter:Ue,onDragOver:He,onDragLeave:Ie,onDrop:Ke,onContextMenu:jr,children:[Ve&&r.jsx("div",{className:"pointer-events-none absolute inset-0 z-20 flex items-center justify-center bg-background/80 p-6 backdrop-blur-sm",children:r.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-2xl border-2 border-dashed border-primary px-10 py-8 text-center",children:[r.jsx(Ne,{size:28,className:"text-primary"}),r.jsx("p",{className:"text-sm font-medium text-foreground",children:a("library.library.dropToUpload",{location:X})})]})}),r.jsx("input",{ref:ae,type:"file",multiple:!0,className:"hidden",onChange:p=>{xe(p.target.files)}}),t&&r.jsxs(r.Fragment,{children:[r.jsx(ze.Breadcrumbs,{after:"page",parent:{onSelect:()=>P(ue)},items:E}),r.jsx(ze.Actions,{secondary:r.jsxs(r.Fragment,{children:[r.jsx(Gr,{value:N,onChange:L,label:a("library.library.searchPlaceholder"),placeholder:z,clearLabel:a("library.library.clearSearch")}),r.jsx(Yr,{label:a("library.library.refresh"),tooltipSide:"bottom",variant:"secondary",onClick:we,children:r.jsx(rr,{})}),re&&r.jsxs(K,{variant:"secondary",size:"sm",onClick:()=>Y(!0),"aria-label":a("library.library.newFolder"),children:[r.jsx(sr,{size:14}),r.jsx("span",{className:"hidden @lg/panel-header:inline",children:a("library.library.newFolder")})]})]}),children:h.readOnly?r.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[r.jsx(tr,{size:12}),a("library.library.readOnly")]}):r.jsxs(K,{size:"sm",disabled:le.isPending,onClick:()=>ae.current?.click(),"aria-label":le.isPending?a("library.library.uploading"):a("library.library.uploadFile"),children:[r.jsx(Ne,{size:14}),r.jsx("span",{className:"hidden @lg/panel-header:inline",children:le.isPending?a("library.library.uploading"):a("library.library.uploadFile")})]})}),r.jsx(Pr.Toolbar.Left.Portal,{children:r.jsx(ze.Tabs,{children:["all","documents","media"].map(p=>r.jsx(ze.Tab,{active:m===p,onClick:()=>{b(p)},children:a(`library.library.${p}`)},p))})})]}),r.jsx("div",{className:"h-full overflow-y-auto",children:r.jsxs("div",{className:"mx-auto flex w-full flex-col classic:max-w-[900px] classic:gap-10 classic:px-6 classic:py-10 classic:lg:px-10 compact:max-w-[1200px] compact:gap-6 compact:px-4 compact:py-6 compact:md:px-8",children:[!t&&r.jsx(r.Fragment,{children:r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.jsx("div",{className:"min-w-0 flex-1 basis-full sm:basis-auto",children:r.jsx(Ot,{segments:h.segments,onNavigate:P})}),r.jsxs("div",{className:"relative w-full shrink-0 sm:w-56",children:[r.jsx(Dr,{size:16,className:"pointer-events-none absolute top-1/2 left-3 -translate-y-1/2 text-muted-foreground"}),r.jsx(Pe,{value:N,onChange:p=>L(p.target.value),onKeyDown:p=>{p.key==="Escape"&&L("")},placeholder:z,className:"h-9 rounded-xl pr-9 pl-9"}),N&&r.jsx(K,{variant:"ghost",size:"icon",className:"absolute top-1/2 right-1.5 size-7 -translate-y-1/2",onClick:()=>L(""),"aria-label":a("library.library.clearSearch"),children:r.jsx($r,{size:14})})]}),r.jsx(K,{variant:"ghost",size:"icon",onClick:we,"aria-label":a("library.library.refresh"),children:r.jsx(rr,{size:14})}),re&&r.jsxs(K,{variant:"outline",size:"sm",onClick:()=>Y(!0),children:[r.jsx(sr,{size:14}),a("library.library.newFolder")]}),h.readOnly?r.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[r.jsx(tr,{size:12}),a("library.library.readOnly")]}):r.jsxs(K,{size:"sm",disabled:le.isPending,onClick:()=>ae.current?.click(),children:[r.jsx(Ne,{size:14}),le.isPending?a("library.library.uploading"):a("library.library.uploadFile")]})]})}),M?r.jsx(jt,{fileView:m,query:M,scope:y,stale:N.trim()!==M,onOpenFile:S,onShare:Q,onDelete:C}):h.volume===null?r.jsx(kt,{onOpenDir:P}):r.jsx(St,{fileView:m,location:h,onOpenDir:P,onOpenFile:S,onOpenSkill:O,onOpenBrand:k,onShare:Q,onDelete:C,onContextMenu:(p,D)=>{R({path:p,kind:D}),se(q(p)),V(!0)},onMove:Ee},h.volume)]})}),d&&(i.preview?r.jsx(mt,{previewPath:i.preview,onClose:()=>j("preview",null)}):i.skill?r.jsx(br,{skillPath:i.skill,onClose:()=>j("skill",null)},i.skill):i.brand?r.jsx(vr,{brandPath:i.brand,onClose:()=>j("brand",null)},i.brand):null),r.jsx(Ge,{open:ce,onOpenChange:Y,children:r.jsxs(Ye,{children:[r.jsxs(ar,{children:[r.jsx(We,{children:a("library.library.newFolderTitle")}),r.jsx(lr,{children:a("library.library.newFolderDescription",{path:X||a("library.library.theLibrary")})})]}),r.jsx(Pe,{autoFocus:!0,placeholder:a("library.library.folderNamePlaceholder"),value:W,onChange:p=>_(p.target.value),onKeyDown:p=>{p.key==="Enter"&&f()}}),r.jsxs(nr,{children:[r.jsx(K,{variant:"outline",onClick:()=>Y(!1),children:a("library.library.cancel")}),r.jsx(K,{disabled:!W.trim()||Z.isPending,onClick:()=>{f()},children:a("library.library.create")})]})]})}),r.jsx(Ge,{open:ee,onOpenChange:p=>{V(p),p||(R(null),se(""))},children:r.jsxs(Ye,{children:[r.jsxs(ar,{children:[r.jsx(We,{children:u&&a("library.library.renameTitle",{name:q(u.path)})}),r.jsx(lr,{children:a("library.library.renameDescription")})]}),r.jsx(Pe,{autoFocus:!0,value:be,onChange:p=>se(p.target.value),onKeyDown:p=>{p.key==="Enter"&&pe()}}),r.jsxs(nr,{children:[r.jsx(K,{variant:"outline",onClick:()=>V(!1),children:a("library.library.cancel")}),r.jsx(K,{disabled:!be.trim()||ne.isPending,onClick:()=>{pe()},children:a("library.library.rename")})]})]})}),r.jsx(dt,{target:U,onOpenChange:p=>{p||Q(null)}}),r.jsx(Wr,{open:H!==null,onOpenChange:p=>{p||C(null)},children:r.jsxs(Xr,{children:[r.jsxs(Zr,{children:[r.jsx(Jr,{children:a("library.library.deleteTitle",{name:H?q(H.path):""})}),r.jsx(_r,{children:H?.kind==="dir"?a("library.library.deleteDirectoryDescription"):a("library.library.deleteFileDescription")})]}),r.jsxs(et,{children:[r.jsx(rt,{children:a("library.library.cancel")}),r.jsx(tt,{onClick:()=>{A()},children:a("library.library.delete")})]})]})})]})}function Ut(){const l=T.c(10),{openPanel:e}=pt(),[s,t]=B.useState(null),[a,n]=B.useState(null);let o;l[0]!==e?(o=r.jsx(Vt,{onOpenFile:m=>e(Cr(m)),onOpenSkill:t,onOpenBrand:n}),l[0]=e,l[1]=o):o=l[1];let c;l[2]!==s?(c=s&&r.jsx(br,{skillPath:s,onClose:()=>t(null)},s),l[2]=s,l[3]=c):c=l[3];let d;l[4]!==a?(d=a&&r.jsx(vr,{brandPath:a,onClose:()=>n(null)},a),l[4]=a,l[5]=d):d=l[5];let i;return l[6]!==o||l[7]!==c||l[8]!==d?(i=r.jsxs("div",{className:"flex flex-col h-full min-h-0 overflow-hidden",children:[o,c,d]}),l[6]=o,l[7]=c,l[8]=d,l[9]=i):i=l[9],i}function Ra(){const l=T.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=r.jsx(Or.Content,{children:r.jsx(Ut,{})}),l[0]=e):e=l[0],e}export{Ra as default};
@@ -1 +1 @@
1
- import{c as R,a as m,r as _,u as C,j as u,N as y}from"./index-B4_5ne-m.js";import{u as U,A as j,a as k}from"./auth-entry-CXeBQuWy.js";import{A as N}from"./auth-split-layout-BLHoHl9d.js";import"./input-DhQYTu0H.js";import"./use-is-desktop-app-BNujXJc_.js";import"./retry-i8LvYSZg.js";import"./backoff-8mStPHYB.js";function O(){const e=R.c(5),t=U(),o=m.useSession();_.useRef(null);const i=t.status,c=o.data!=null,r=o.isPending;let n,s;e[0]!==c||e[1]!==r||e[2]!==i?(n=()=>{},s=[i,c,r],e[0]=c,e[1]=r,e[2]=i,e[3]=n,e[4]=s):(n=e[3],s=e[4]),_.useEffect(n,s)}const h="studio_signup_ref",a="studio_signup_src",$=720*60*60,f=128;function p(e){const t=document.cookie.match(new RegExp(`(?:^|; )${e}=([^;]*)`));return t?.[1]?decodeURIComponent(t[1]):null}function g(e,t){document.cookie=`${e}=${encodeURIComponent(t)}; path=/; max-age=${$}; samesite=lax`}function b(e){e.ref&&e.ref.length<=f&&!p(h)&&g(h,e.ref),e.src&&e.src.length<=f&&!p(a)&&g(a,e.src)}function w(e){if(!e.client_id||e.response_type!=="code")return null;const t=new URLSearchParams;return e.client_id&&t.set("client_id",e.client_id),e.redirect_uri&&t.set("redirect_uri",e.redirect_uri),e.response_type&&t.set("response_type",e.response_type),e.state&&t.set("state",e.state),e.scope&&t.set("scope",e.scope),e.code_challenge&&t.set("code_challenge",e.code_challenge),e.code_challenge_method&&t.set("code_challenge_method",e.code_challenge_method),`/api/auth/mcp/authorize?${t.toString()}`}function D(){const e=m.useSession();O();const t=C({from:"/login"}),{next:o="/",client_id:i,redirect_uri:c,response_type:r,state:n,scope:s,code_challenge:x,code_challenge_method:A,src:S,ref:E}=t;b({src:S,ref:E});const d=o.startsWith("/")&&!o.startsWith("//")?o:"/",l=w({client_id:i,redirect_uri:c,response_type:r,state:n,scope:s,code_challenge:x,code_challenge_method:A});return e.data?l?(window.location.href=l,u.jsx(j,{})):u.jsx(y,{to:d}):u.jsx(N,{children:u.jsx(k,{callbackUrl:d,redirectUrl:l})})}export{D as default};
1
+ import{c as R,a as m,r as _,u as C,j as u,N as y}from"./index-ViRfM1Gu.js";import{u as U,A as j,a as k}from"./auth-entry-GzlRhrO7.js";import{A as N}from"./auth-split-layout-C04c2KsR.js";import"./input-CZi9DBsg.js";import"./use-is-desktop-app-BNujXJc_.js";import"./retry-i8LvYSZg.js";import"./backoff-8mStPHYB.js";function O(){const e=R.c(5),t=U(),o=m.useSession();_.useRef(null);const i=t.status,c=o.data!=null,r=o.isPending;let n,s;e[0]!==c||e[1]!==r||e[2]!==i?(n=()=>{},s=[i,c,r],e[0]=c,e[1]=r,e[2]=i,e[3]=n,e[4]=s):(n=e[3],s=e[4]),_.useEffect(n,s)}const h="studio_signup_ref",a="studio_signup_src",$=720*60*60,f=128;function p(e){const t=document.cookie.match(new RegExp(`(?:^|; )${e}=([^;]*)`));return t?.[1]?decodeURIComponent(t[1]):null}function g(e,t){document.cookie=`${e}=${encodeURIComponent(t)}; path=/; max-age=${$}; samesite=lax`}function b(e){e.ref&&e.ref.length<=f&&!p(h)&&g(h,e.ref),e.src&&e.src.length<=f&&!p(a)&&g(a,e.src)}function w(e){if(!e.client_id||e.response_type!=="code")return null;const t=new URLSearchParams;return e.client_id&&t.set("client_id",e.client_id),e.redirect_uri&&t.set("redirect_uri",e.redirect_uri),e.response_type&&t.set("response_type",e.response_type),e.state&&t.set("state",e.state),e.scope&&t.set("scope",e.scope),e.code_challenge&&t.set("code_challenge",e.code_challenge),e.code_challenge_method&&t.set("code_challenge_method",e.code_challenge_method),`/api/auth/mcp/authorize?${t.toString()}`}function D(){const e=m.useSession();O();const t=C({from:"/login"}),{next:o="/",client_id:i,redirect_uri:c,response_type:r,state:n,scope:s,code_challenge:x,code_challenge_method:A,src:S,ref:E}=t;b({src:S,ref:E});const d=o.startsWith("/")&&!o.startsWith("//")?o:"/",l=w({client_id:i,redirect_uri:c,response_type:r,state:n,scope:s,code_challenge:x,code_challenge_method:A});return e.data?l?(window.location.href=l,u.jsx(j,{})):u.jsx(y,{to:d}):u.jsx(N,{children:u.jsx(k,{callbackUrl:d,redirectUrl:l})})}export{D as default};
@@ -1,4 +1,4 @@
1
- import{co as Pl,j as D,e7 as He,eM as Kt,c as Le,b as Lt,r as Ce,as as oE,l as ph,a9 as gh,B as fh}from"./index-B4_5ne-m.js";import{a as mh}from"./Copy01-KomJ49aq.js";import{D as sE,g as lE,f as uE,d as cE}from"./dialog-BVRmgEZZ.js";import{n as dE}from"./Download01-CK_3UsO1.js";import{b as pE,n as gE}from"./ZoomOut-CvMfmw42.js";import{a as hh}from"./org-file-open-context-DNcgI0Uf.js";function Ul(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var tt=Ul();function bh(e){tt=e}var Rt={exec:()=>null};function ee(e,t=""){let n=typeof e=="string"?e:e.source;const r={replace:(a,i)=>{let o=typeof i=="string"?i:i.source;return o=o.replace(be.caret,"$1"),n=n.replace(a,o),r},getRegex:()=>new RegExp(n,t)};return r}var be={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},fE=/^(?:[ \t]*(?:\n|$))+/,mE=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,hE=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Dt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,bE=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Bl=/(?:[*+-]|\d{1,9}[.)])/,Eh=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,yh=ee(Eh).replace(/bull/g,Bl).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),EE=ee(Eh).replace(/bull/g,Bl).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),$l=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,yE=/^[^\n]+/,ql=/(?!\s*\])(?:\\.|[^\[\]\\])+/,SE=ee(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ql).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),kE=ee(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Bl).getRegex(),rn="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",zl=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,vE=ee("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",zl).replace("tag",rn).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Sh=ee($l).replace("hr",Dt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",rn).getRegex(),TE=ee(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Sh).getRegex(),Gl={blockquote:TE,code:mE,def:SE,fences:hE,heading:bE,hr:Dt,html:vE,lheading:yh,list:kE,newline:fE,paragraph:Sh,table:Rt,text:yE},wu=ee("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Dt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",rn).getRegex(),wE={...Gl,lheading:EE,table:wu,paragraph:ee($l).replace("hr",Dt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",wu).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",rn).getRegex()},AE={...Gl,html:ee(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",zl).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Rt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ee($l).replace("hr",Dt).replace("heading",` *#{1,6} *[^
1
+ import{cp as Pl,j as D,e8 as He,eN as Kt,c as Le,b as Lt,r as Ce,as as oE,l as ph,a9 as gh,B as fh}from"./index-ViRfM1Gu.js";import{a as mh}from"./Copy01-BSU2TbGt.js";import{D as sE,g as lE,f as uE,d as cE}from"./dialog-Djn7c9nl.js";import{n as dE}from"./Download01-C7Po_zTZ.js";import{b as pE,n as gE}from"./ZoomOut-CmGFFntk.js";import{a as hh}from"./org-file-open-context-ClVFPMFS.js";function Ul(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var tt=Ul();function bh(e){tt=e}var Rt={exec:()=>null};function ee(e,t=""){let n=typeof e=="string"?e:e.source;const r={replace:(a,i)=>{let o=typeof i=="string"?i:i.source;return o=o.replace(be.caret,"$1"),n=n.replace(a,o),r},getRegex:()=>new RegExp(n,t)};return r}var be={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},fE=/^(?:[ \t]*(?:\n|$))+/,mE=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,hE=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Dt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,bE=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Bl=/(?:[*+-]|\d{1,9}[.)])/,Eh=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,yh=ee(Eh).replace(/bull/g,Bl).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),EE=ee(Eh).replace(/bull/g,Bl).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),$l=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,yE=/^[^\n]+/,ql=/(?!\s*\])(?:\\.|[^\[\]\\])+/,SE=ee(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ql).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),kE=ee(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Bl).getRegex(),rn="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",zl=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,vE=ee("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",zl).replace("tag",rn).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Sh=ee($l).replace("hr",Dt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",rn).getRegex(),TE=ee(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Sh).getRegex(),Gl={blockquote:TE,code:mE,def:SE,fences:hE,heading:bE,hr:Dt,html:vE,lheading:yh,list:kE,newline:fE,paragraph:Sh,table:Rt,text:yE},wu=ee("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Dt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",rn).getRegex(),wE={...Gl,lheading:EE,table:wu,paragraph:ee($l).replace("hr",Dt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",wu).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",rn).getRegex()},AE={...Gl,html:ee(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",zl).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Rt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ee($l).replace("hr",Dt).replace("heading",` *#{1,6} *[^
2
2
  ]`).replace("lheading",yh).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},RE=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,_E=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,kh=/^( {2,}|\\)\n(?!\s*$)/,IE=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,an=/[\p{P}\p{S}]/u,Hl=/[\s\p{P}\p{S}]/u,vh=/[^\s\p{P}\p{S}]/u,xE=ee(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Hl).getRegex(),Th=/(?!~)[\p{P}\p{S}]/u,NE=/(?!~)[\s\p{P}\p{S}]/u,CE=/(?:[^\s\p{P}\p{S}]|~)/u,OE=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,wh=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,LE=ee(wh,"u").replace(/punct/g,an).getRegex(),DE=ee(wh,"u").replace(/punct/g,Th).getRegex(),Ah="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",ME=ee(Ah,"gu").replace(/notPunctSpace/g,vh).replace(/punctSpace/g,Hl).replace(/punct/g,an).getRegex(),FE=ee(Ah,"gu").replace(/notPunctSpace/g,CE).replace(/punctSpace/g,NE).replace(/punct/g,Th).getRegex(),PE=ee("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,vh).replace(/punctSpace/g,Hl).replace(/punct/g,an).getRegex(),UE=ee(/\\(punct)/,"gu").replace(/punct/g,an).getRegex(),BE=ee(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),$E=ee(zl).replace("(?:-->|$)","-->").getRegex(),qE=ee("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",$E).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Xt=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,zE=ee(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Xt).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Rh=ee(/^!?\[(label)\]\[(ref)\]/).replace("label",Xt).replace("ref",ql).getRegex(),_h=ee(/^!?\[(ref)\](?:\[\])?/).replace("ref",ql).getRegex(),GE=ee("reflink|nolink(?!\\()","g").replace("reflink",Rh).replace("nolink",_h).getRegex(),jl={_backpedal:Rt,anyPunctuation:UE,autolink:BE,blockSkip:OE,br:kh,code:_E,del:Rt,emStrongLDelim:LE,emStrongRDelimAst:ME,emStrongRDelimUnd:PE,escape:RE,link:zE,nolink:_h,punctuation:xE,reflink:Rh,reflinkSearch:GE,tag:qE,text:IE,url:Rt},HE={...jl,link:ee(/^!?\[(label)\]\((.*?)\)/).replace("label",Xt).getRegex(),reflink:ee(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Xt).getRegex()},El={...jl,emStrongRDelimAst:FE,emStrongLDelim:DE,url:ee(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},jE={...El,br:ee(kh).replace("{2,}","*").getRegex(),text:ee(El.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Bt={normal:Gl,gfm:wE,pedantic:AE},St={normal:jl,gfm:El,breaks:jE,pedantic:HE},VE={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Au=e=>VE[e];function Fe(e,t){if(t){if(be.escapeTest.test(e))return e.replace(be.escapeReplace,Au)}else if(be.escapeTestNoEncode.test(e))return e.replace(be.escapeReplaceNoEncode,Au);return e}function Ru(e){try{e=encodeURI(e).replace(be.percentDecode,"%")}catch{return null}return e}function _u(e,t){const n=e.replace(be.findPipe,(i,o,s)=>{let l=!1,u=o;for(;--u>=0&&s[u]==="\\";)l=!l;return l?"|":" |"}),r=n.split(be.splitPipe);let a=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;a<r.length;a++)r[a]=r[a].trim().replace(be.slashPipe,"|");return r}function kt(e,t,n){const r=e.length;if(r===0)return"";let a=0;for(;a<r&&e.charAt(r-a-1)===t;)a++;return e.slice(0,r-a)}function WE(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function Iu(e,t,n,r,a){const i=t.href,o=t.title||null,s=e[1].replace(a.other.outputLinkReplace,"$1");r.state.inLink=!0;const l={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,l}function YE(e,t,n){const r=e.match(n.other.indentCodeCompensation);if(r===null)return t;const a=r[1];return t.split(`
3
3
  `).map(i=>{const o=i.match(n.other.beginningSpace);if(o===null)return i;const[s]=o;return s.length>=a.length?i.slice(a.length):i}).join(`
4
4
  `)}var Zt=class{options;rules;lexer;constructor(e){this.options=e||tt}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:kt(n,`
@@ -1,4 +1,4 @@
1
- import{r as N,c as H,j as d,eN as K,eO as Q,q as X,x as Y,l as B,h as J}from"./index-B4_5ne-m.js";import{D as ee,E as te,C as ne}from"./types-DAtj8pL_.js";const z=["default-src 'none'","script-src 'unsafe-inline' 'unsafe-eval' 'wasm-unsafe-eval'","style-src 'unsafe-inline'","img-src * data: blob:","media-src * data: blob:","font-src data:","connect-src 'none'","frame-src 'none'","worker-src blob:","form-action 'none'","base-uri 'none'"].join("; ");function oe(o,e={}){const n=`<meta http-equiv="Content-Security-Policy" content="${ie(e)}">`,s=/<head(\s[^>]*)?>|<HEAD(\s[^>]*)?>/i,i=o.match(s);if(i){const l=(i.index??0)+i[0].length;return o.slice(0,l)+`
1
+ import{r as N,c as H,j as d,eO as K,eP as Q,q as X,x as Y,l as B,h as J}from"./index-ViRfM1Gu.js";import{D as ee,E as te,C as ne}from"./types-o4JUcB5t.js";const z=["default-src 'none'","script-src 'unsafe-inline' 'unsafe-eval' 'wasm-unsafe-eval'","style-src 'unsafe-inline'","img-src * data: blob:","media-src * data: blob:","font-src data:","connect-src 'none'","frame-src 'none'","worker-src blob:","form-action 'none'","base-uri 'none'"].join("; ");function oe(o,e={}){const n=`<meta http-equiv="Content-Security-Policy" content="${ie(e)}">`,s=/<head(\s[^>]*)?>|<HEAD(\s[^>]*)?>/i,i=o.match(s);if(i){const l=(i.index??0)+i[0].length;return o.slice(0,l)+`
2
2
  `+n+o.slice(l)}const r=/<html(\s[^>]*)?>|<HTML(\s[^>]*)?>/i,a=o.match(r);if(a){const l=(a.index??0)+a[0].length;return o.slice(0,l)+`
3
3
  <head>
4
4
  `+n+`
@@ -8,4 +8,4 @@ import{r as N,c as H,j as d,eN as K,eO as Q,q as X,x as Y,l as B,h as J}from"./i
8
8
  </head>`+o.slice(l)}return`<head>
9
9
  `+n+`
10
10
  </head>
11
- `+o}const se=/^https?:\/\/(\*\.)?[a-zA-Z0-9._-]+(:\d+)?\/?$/;function j(o){return!o||o.length===0?[]:o.filter(e=>se.test(e))}function ie(o){if(o.csp)return o.csp;const e=o.resourceCsp;if(!e)return z;const t=j(e.resourceDomains),n=j(e.connectDomains),s=j(e.frameDomains),i=j(e.baseUriDomains),r=t.length>0,a=n.length>0,c=s.length>0,u=i.length>0;if(!r&&!a&&!c&&!u)return z;const l=t.join(" ");return["default-src 'none'",r?`script-src 'unsafe-inline' 'unsafe-eval' 'wasm-unsafe-eval' ${l}`:"script-src 'unsafe-inline' 'unsafe-eval' 'wasm-unsafe-eval'",r?`style-src 'unsafe-inline' ${l}`:"style-src 'unsafe-inline'",r?`img-src * data: blob: ${l}`:"img-src * data: blob:",r?`media-src * data: blob: ${l}`:"media-src * data: blob:",r?`font-src data: ${l}`:"font-src data:",a?`connect-src ${n.join(" ")}`:"connect-src 'none'",c?`frame-src ${s.join(" ")}`:"frame-src 'none'","worker-src blob:","form-action 'none'",u?`base-uri ${i.join(" ")}`:"base-uri 'none'"].join("; ")}const re=[["--background","--color-background-primary"],["--muted","--color-background-secondary"],["--accent","--color-background-tertiary"],["--destructive","--color-background-danger"],["--success","--color-background-success"],["--warning","--color-background-warning"],["--foreground","--color-text-primary"],["--muted-foreground","--color-text-secondary"],["--accent-foreground","--color-text-tertiary"],["--destructive-foreground","--color-text-danger"],["--success-foreground","--color-text-success"],["--warning-foreground","--color-text-warning"],["--border","--color-border-primary"],["--input","--color-border-secondary"],["--ring","--color-ring-primary"],["--font-sans","--font-sans"],["--font-mono","--font-mono"],["--font-weight-normal","--font-weight-normal"],["--font-weight-medium","--font-weight-medium"],["--font-weight-semibold","--font-weight-semibold"],["--font-weight-bold","--font-weight-bold"],["--radius","--border-radius-md"],["--default-border-width","--border-width-regular"],["--shadow-sm","--shadow-sm"],["--shadow-md","--shadow-md"],["--shadow-lg","--shadow-lg"]];function ae(){if(typeof document>"u")return{};const o=getComputedStyle(document.documentElement),e={};for(const[t,n]of re){const s=o.getPropertyValue(t).trim();s&&(e[n]=s)}return{variables:e}}const le={name:"Studio",version:"1.0.0"},ce={openLinks:{},serverTools:{},serverResources:{},logging:{},message:{},downloadFile:{},updateModelContext:{text:{}}},ue=15e3;function de(){return typeof navigator>"u"?"en":navigator.language??"en"}function he(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return"UTC"}}function fe(){return typeof navigator>"u"?"web":/Mobi|Android/i.test(navigator.userAgent)?"mobile":"web"}function q(o,e,t,n,s){return{theme:ne(),styles:ae(),displayMode:o,availableDisplayModes:["inline","fullscreen"],locale:s??de(),timeZone:he(),platform:fe(),...e!=null&&{toolInfo:e},...t!=null&&{containerDimensions:{maxHeight:t}},...n!=null&&{orgId:n}}}const F=new Set;let V=!1;function me(){if(V||typeof document>"u")return;V=!0;const o=()=>F.forEach(e=>e());new MutationObserver(o).observe(document.documentElement,{attributes:!0,attributeFilter:["class","data-theme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",o)}function ge(o){return F.add(o),me(),()=>F.delete(o)}class pe{bridge=null;timeout=null;disposed=!1;unsubTheme=null;snapshot;listeners=new Set;config;constructor(e){this.config=e,this.snapshot=Object.freeze({height:e.minHeight,isLoading:!0,error:null})}subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e));getSnapshot=()=>this.snapshot;updateConfig(e){const t=this.config;this.config=e,!(!this.bridge||this.disposed)&&((e.displayMode!==t.displayMode||e.locale!==t.locale)&&this.pushHostContext(),e.toolInput!==t.toolInput&&e.toolInput!=null&&this.bridge.sendToolInput({arguments:e.toolInput}),e.toolResult!==t.toolResult&&e.toolResult!=null&&this.bridge.sendToolResult(e.toolResult))}pushHostContext(){if(!this.bridge||this.disposed)return;const{displayMode:e,maxHeight:t,toolInfo:n,orgId:s,locale:i}=this.config;this.bridge.setHostContext(q(e,n,t,s,i))}set(e){const t=this.snapshot,n={...t,...e};if(!(n.height===t.height&&n.isLoading===t.isLoading&&n.error===t.error)){this.snapshot=Object.freeze(n);for(const s of this.listeners)s()}}teardown(){(this.bridge||this.timeout||this.unsubTheme)&&this.config.onTeardown?.(),this.disposed=!0,this.unsubTheme?.(),this.unsubTheme=null,this.bridge&&(this.bridge.teardownResource({}).catch(()=>{}),this.bridge.close(),this.bridge=null),this.timeout&&(clearTimeout(this.timeout),this.timeout=null)}attach=e=>{if(this.teardown(),this.disposed=!1,this.set({height:this.config.minHeight,isLoading:!0,error:null}),!e)return;e.onerror=()=>{this.disposed||this.set({error:"Failed to load app",isLoading:!1})};let t=!1;e.onload=()=>{if(!this.disposed){if(!t){t=!0;return}this.set({height:this.config.minHeight,isLoading:!0,error:null}),this.connectBridge(e)}},this.connectBridge(e)};connectBridge(e){this.clearTimeout(),this.unsubTheme?.(),this.unsubTheme=null,this.bridge&&(this.bridge.close(),this.bridge=null);try{const{client:t,displayMode:n,maxHeight:s,toolInfo:i,orgId:r,locale:a}=this.config,c=q(n,i,s,r,a),u=new ee(t,le,ce,{hostContext:c});this.bridge=u,this.registerHandlers(u),this.startInitTimeout(),this.registerInitHandler(u),this.connectTransport(u,e),this.unsubTheme=ge(()=>this.pushHostContext())}catch(t){this.clearTimeout(),console.error("Failed to create AppBridge:",t),this.set({error:t instanceof Error?t.message:"Unknown error",isLoading:!1})}}registerHandlers(e){e.onopenlink=async({url:t})=>{let n=null;try{n=new URL(t)}catch{}if(!n||!["http:","https:"].includes(n.protocol))throw new Error("Only http and https URLs are allowed");return window.open(t,"_blank","noopener,noreferrer"),{}},e.onmessage=async t=>(this.config.onMessage?.(t),{}),e.onupdatemodelcontext=async t=>(this.config.onUpdateModelContext?.(t),{}),e.onsizechange=({height:t})=>{if(!this.disposed&&t!=null){const{minHeight:n,maxHeight:s}=this.config;this.set({height:Math.max(n,Math.min(s,t))})}},e.onloggingmessage=({level:t,data:n})=>{console[t==="error"?"error":"debug"](`[MCP App ${this.config.toolInfo?.tool.name??"unknown"}]`,n)},e.onrequestdisplaymode=async({mode:t})=>({mode:this.config.onRequestDisplayMode?await this.config.onRequestDisplayMode(t):this.config.displayMode}),e.ondownloadfile=async({contents:t})=>{for(const n of t)if(n.type==="resource"){const s=n.resource,i="blob"in s?new Blob([Uint8Array.from(atob(s.blob),c=>c.charCodeAt(0))],{type:s.mimeType}):new Blob([s.text??""],{type:s.mimeType}),r=URL.createObjectURL(i),a=document.createElement("a");a.href=r,a.download=s.uri.split("/").pop()??"download",a.click(),URL.revokeObjectURL(r)}else n.type==="resource_link"&&window.open(n.uri,"_blank");return{}}}registerInitHandler(e){e.oninitialized=()=>{if(this.disposed)return;this.clearTimeout(),this.set({isLoading:!1});const{toolInput:t,toolResult:n}=this.config;t!=null&&e.sendToolInput({arguments:t}),n!=null&&e.sendToolResult(n)}}startInitTimeout(){this.timeout=setTimeout(()=>{this.disposed||this.set({error:"App took too long to load",isLoading:!1})},ue)}clearTimeout(){this.timeout&&(globalThis.clearTimeout(this.timeout),this.timeout=null)}connectTransport(e,t){if(!t.contentWindow){console.warn("iframe contentWindow not yet available");return}const n=new te(t.contentWindow,t.contentWindow);e.connect(n).catch(s=>{this.disposed||(this.clearTimeout(),console.error("AppBridge connect failed:",s),this.set({error:s instanceof Error?s.message:"Connection failed",isLoading:!1}))})}}function be(o){const e=N.useRef(new pe(o));N.useEffect(()=>{e.current.updateConfig(o)},[o]);const{height:t,isLoading:n,error:s}=N.useSyncExternalStore(e.current.subscribe,e.current.getSnapshot);return{height:t,isLoading:n,error:s,iframeRef:e.current.attach}}const W=new Set;function we(o){const e=o?.contents?.[0];return!e||!("text"in e)||!e.text?null:oe(e.text,{resourceCsp:e._meta?.ui?.csp})}function Z(o){const e=H.c(40),{html:t,uri:n,orgId:s,toolInfo:i,toolInput:r,toolResult:a,displayMode:c,minHeight:u,maxHeight:l,client:T,onMessage:L,onUpdateModelContext:S,onTeardown:D,onRequestDisplayMode:P,className:f}=o,h=c===void 0?"inline":c,k=u===void 0?150:u,A=l===void 0?600:l;n&&!W.has(n)&&(W.add(n),X("mcp_app_opened",{resource_uri:n,display_mode:h,tool_name:i?.tool?.name??null}));const[E]=Y();let v;e[0]!==T||e[1]!==h||e[2]!==A||e[3]!==k||e[4]!==L||e[5]!==P||e[6]!==D||e[7]!==S||e[8]!==s||e[9]!==E.language||e[10]!==i||e[11]!==r||e[12]!==a?(v={client:T,displayMode:h,minHeight:k,maxHeight:A,orgId:s,locale:E.language,toolInfo:i,toolInput:r,toolResult:a,onMessage:L,onUpdateModelContext:S,onTeardown:D,onRequestDisplayMode:P},e[0]=T,e[1]=h,e[2]=A,e[3]=k,e[4]=L,e[5]=P,e[6]=D,e[7]=S,e[8]=s,e[9]=E.language,e[10]=i,e[11]=r,e[12]=a,e[13]=v):v=e[13];const{height:_,isLoading:M,error:R,iframeRef:U}=be(v);if(!t)return null;if(R){let y;e[14]!==f?(y=B("flex items-center justify-center p-4 text-destructive bg-destructive/10 rounded-lg",f),e[14]=f,e[15]=y):y=e[15];let x;e[16]!==R?(x=d.jsx("span",{className:"text-sm",children:R}),e[16]=R,e[17]=x):x=e[17];let I;return e[18]!==y||e[19]!==x?(I=d.jsx("div",{className:y,children:x}),e[18]=y,e[19]=x,e[20]=I):I=e[20],I}const G=i?.tool.name;let m;e[21]!==f?(m=B("relative w-full overflow-hidden rounded-lg",f),e[21]=f,e[22]=m):m=e[22];let g;e[23]!==h||e[24]!==_?(g=h!=="fullscreen"?{height:`${_}px`}:void 0,e[23]=h,e[24]=_,e[25]=g):g=e[25];let p;e[26]!==M?(p=M&&d.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background z-10",children:d.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[d.jsx(J,{className:"size-4"}),d.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),e[26]=M,e[27]=p):p=e[27];const O=M&&"invisible";let b;e[28]!==O?(b=B("w-full h-full border-0",O),e[28]=O,e[29]=b):b=e[29];const $=`MCP App: ${G??n}`;let w;e[30]!==t||e[31]!==U||e[32]!==$||e[33]!==b?(w=d.jsx("iframe",{ref:U,srcDoc:t,sandbox:"allow-scripts allow-same-origin allow-forms allow-popups allow-downloads",className:b,title:$}),e[30]=t,e[31]=U,e[32]=$,e[33]=b,e[34]=w):w=e[34];let C;return e[35]!==w||e[36]!==m||e[37]!==g||e[38]!==p?(C=d.jsxs("div",{className:m,style:g,children:[p,w]}),e[35]=w,e[36]=m,e[37]=g,e[38]=p,e[39]=C):C=e[39],C}function ye(o){const e=H.c(13);let t,n,s,i;e[0]!==o?({resourceURI:i,orgSlug:s,connectionId:t,...n}=o,e[0]=o,e[1]=t,e[2]=n,e[3]=s,e[4]=i):(t=e[1],n=e[2],s=e[3],i=e[4]);let r;e[5]!==t||e[6]!==s||e[7]!==i?(r={orgSlug:s,connectionId:t,uri:i,staleTime:3e4},e[5]=t,e[6]=s,e[7]=i,e[8]=r):r=e[8];const a=K(r);let c;return e[9]!==n||e[10]!==a.data||e[11]!==i?(c=d.jsx(Z,{html:a.data,uri:i,...n}),e[9]=n,e[10]=a.data,e[11]=i,e[12]=c):c=e[12],c}function xe(o){const e=H.c(10);let t,n;e[0]!==o?({resourceURI:n,...t}=o,e[0]=o,e[1]=t,e[2]=n):(t=e[1],n=e[2]);let s;e[3]!==t.client||e[4]!==n?(s={client:t.client,uri:n,staleTime:3e4},e[3]=t.client,e[4]=n,e[5]=s):s=e[5];const{data:i}=Q(s),r=we(i);let a;return e[6]!==t||e[7]!==r||e[8]!==n?(a=d.jsx(Z,{html:r,uri:n,...t}),e[6]=t,e[7]=r,e[8]=n,e[9]=a):a=e[9],a}function Me(o){const e=H.c(4);if(o.orgSlug&&o.connectionId){let n;return e[0]!==o?(n=d.jsx(ye,{...o,orgSlug:o.orgSlug,connectionId:o.connectionId}),e[0]=o,e[1]=n):n=e[1],n}let t;return e[2]!==o?(t=d.jsx(xe,{...o}),e[2]=o,e[3]=t):t=e[3],t}export{Me as M};
11
+ `+o}const se=/^https?:\/\/(\*\.)?[a-zA-Z0-9._-]+(:\d+)?\/?$/;function j(o){return!o||o.length===0?[]:o.filter(e=>se.test(e))}function ie(o){if(o.csp)return o.csp;const e=o.resourceCsp;if(!e)return z;const t=j(e.resourceDomains),n=j(e.connectDomains),s=j(e.frameDomains),i=j(e.baseUriDomains),r=t.length>0,a=n.length>0,c=s.length>0,u=i.length>0;if(!r&&!a&&!c&&!u)return z;const l=t.join(" ");return["default-src 'none'",r?`script-src 'unsafe-inline' 'unsafe-eval' 'wasm-unsafe-eval' ${l}`:"script-src 'unsafe-inline' 'unsafe-eval' 'wasm-unsafe-eval'",r?`style-src 'unsafe-inline' ${l}`:"style-src 'unsafe-inline'",r?`img-src * data: blob: ${l}`:"img-src * data: blob:",r?`media-src * data: blob: ${l}`:"media-src * data: blob:",r?`font-src data: ${l}`:"font-src data:",a?`connect-src ${n.join(" ")}`:"connect-src 'none'",c?`frame-src ${s.join(" ")}`:"frame-src 'none'","worker-src blob:","form-action 'none'",u?`base-uri ${i.join(" ")}`:"base-uri 'none'"].join("; ")}const re=[["--background","--color-background-primary"],["--muted","--color-background-secondary"],["--accent","--color-background-tertiary"],["--destructive","--color-background-danger"],["--success","--color-background-success"],["--warning","--color-background-warning"],["--foreground","--color-text-primary"],["--muted-foreground","--color-text-secondary"],["--accent-foreground","--color-text-tertiary"],["--destructive-foreground","--color-text-danger"],["--success-foreground","--color-text-success"],["--warning-foreground","--color-text-warning"],["--border","--color-border-primary"],["--input","--color-border-secondary"],["--ring","--color-ring-primary"],["--font-sans","--font-sans"],["--font-mono","--font-mono"],["--font-weight-normal","--font-weight-normal"],["--font-weight-medium","--font-weight-medium"],["--font-weight-semibold","--font-weight-semibold"],["--font-weight-bold","--font-weight-bold"],["--radius","--border-radius-md"],["--default-border-width","--border-width-regular"],["--shadow-sm","--shadow-sm"],["--shadow-md","--shadow-md"],["--shadow-lg","--shadow-lg"]];function ae(){if(typeof document>"u")return{};const o=getComputedStyle(document.documentElement),e={};for(const[t,n]of re){const s=o.getPropertyValue(t).trim();s&&(e[n]=s)}return{variables:e}}const le={name:"Studio",version:"1.0.0"},ce={openLinks:{},serverTools:{},serverResources:{},logging:{},message:{},downloadFile:{},updateModelContext:{text:{}}},ue=15e3;function de(){return typeof navigator>"u"?"en":navigator.language??"en"}function he(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return"UTC"}}function fe(){return typeof navigator>"u"?"web":/Mobi|Android/i.test(navigator.userAgent)?"mobile":"web"}function q(o,e,t,n,s){return{theme:ne(),styles:ae(),displayMode:o,availableDisplayModes:["inline","fullscreen"],locale:s??de(),timeZone:he(),platform:fe(),...e!=null&&{toolInfo:e},...t!=null&&{containerDimensions:{maxHeight:t}},...n!=null&&{orgId:n}}}const F=new Set;let V=!1;function me(){if(V||typeof document>"u")return;V=!0;const o=()=>F.forEach(e=>e());new MutationObserver(o).observe(document.documentElement,{attributes:!0,attributeFilter:["class","data-theme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",o)}function ge(o){return F.add(o),me(),()=>F.delete(o)}class pe{bridge=null;timeout=null;disposed=!1;unsubTheme=null;snapshot;listeners=new Set;config;constructor(e){this.config=e,this.snapshot=Object.freeze({height:e.minHeight,isLoading:!0,error:null})}subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e));getSnapshot=()=>this.snapshot;updateConfig(e){const t=this.config;this.config=e,!(!this.bridge||this.disposed)&&((e.displayMode!==t.displayMode||e.locale!==t.locale)&&this.pushHostContext(),e.toolInput!==t.toolInput&&e.toolInput!=null&&this.bridge.sendToolInput({arguments:e.toolInput}),e.toolResult!==t.toolResult&&e.toolResult!=null&&this.bridge.sendToolResult(e.toolResult))}pushHostContext(){if(!this.bridge||this.disposed)return;const{displayMode:e,maxHeight:t,toolInfo:n,orgId:s,locale:i}=this.config;this.bridge.setHostContext(q(e,n,t,s,i))}set(e){const t=this.snapshot,n={...t,...e};if(!(n.height===t.height&&n.isLoading===t.isLoading&&n.error===t.error)){this.snapshot=Object.freeze(n);for(const s of this.listeners)s()}}teardown(){(this.bridge||this.timeout||this.unsubTheme)&&this.config.onTeardown?.(),this.disposed=!0,this.unsubTheme?.(),this.unsubTheme=null,this.bridge&&(this.bridge.teardownResource({}).catch(()=>{}),this.bridge.close(),this.bridge=null),this.timeout&&(clearTimeout(this.timeout),this.timeout=null)}attach=e=>{if(this.teardown(),this.disposed=!1,this.set({height:this.config.minHeight,isLoading:!0,error:null}),!e)return;e.onerror=()=>{this.disposed||this.set({error:"Failed to load app",isLoading:!1})};let t=!1;e.onload=()=>{if(!this.disposed){if(!t){t=!0;return}this.set({height:this.config.minHeight,isLoading:!0,error:null}),this.connectBridge(e)}},this.connectBridge(e)};connectBridge(e){this.clearTimeout(),this.unsubTheme?.(),this.unsubTheme=null,this.bridge&&(this.bridge.close(),this.bridge=null);try{const{client:t,displayMode:n,maxHeight:s,toolInfo:i,orgId:r,locale:a}=this.config,c=q(n,i,s,r,a),u=new ee(t,le,ce,{hostContext:c});this.bridge=u,this.registerHandlers(u),this.startInitTimeout(),this.registerInitHandler(u),this.connectTransport(u,e),this.unsubTheme=ge(()=>this.pushHostContext())}catch(t){this.clearTimeout(),console.error("Failed to create AppBridge:",t),this.set({error:t instanceof Error?t.message:"Unknown error",isLoading:!1})}}registerHandlers(e){e.onopenlink=async({url:t})=>{let n=null;try{n=new URL(t)}catch{}if(!n||!["http:","https:"].includes(n.protocol))throw new Error("Only http and https URLs are allowed");return window.open(t,"_blank","noopener,noreferrer"),{}},e.onmessage=async t=>(this.config.onMessage?.(t),{}),e.onupdatemodelcontext=async t=>(this.config.onUpdateModelContext?.(t),{}),e.onsizechange=({height:t})=>{if(!this.disposed&&t!=null){const{minHeight:n,maxHeight:s}=this.config;this.set({height:Math.max(n,Math.min(s,t))})}},e.onloggingmessage=({level:t,data:n})=>{console[t==="error"?"error":"debug"](`[MCP App ${this.config.toolInfo?.tool.name??"unknown"}]`,n)},e.onrequestdisplaymode=async({mode:t})=>({mode:this.config.onRequestDisplayMode?await this.config.onRequestDisplayMode(t):this.config.displayMode}),e.ondownloadfile=async({contents:t})=>{for(const n of t)if(n.type==="resource"){const s=n.resource,i="blob"in s?new Blob([Uint8Array.from(atob(s.blob),c=>c.charCodeAt(0))],{type:s.mimeType}):new Blob([s.text??""],{type:s.mimeType}),r=URL.createObjectURL(i),a=document.createElement("a");a.href=r,a.download=s.uri.split("/").pop()??"download",a.click(),URL.revokeObjectURL(r)}else n.type==="resource_link"&&window.open(n.uri,"_blank");return{}}}registerInitHandler(e){e.oninitialized=()=>{if(this.disposed)return;this.clearTimeout(),this.set({isLoading:!1});const{toolInput:t,toolResult:n}=this.config;t!=null&&e.sendToolInput({arguments:t}),n!=null&&e.sendToolResult(n)}}startInitTimeout(){this.timeout=setTimeout(()=>{this.disposed||this.set({error:"App took too long to load",isLoading:!1})},ue)}clearTimeout(){this.timeout&&(globalThis.clearTimeout(this.timeout),this.timeout=null)}connectTransport(e,t){if(!t.contentWindow){console.warn("iframe contentWindow not yet available");return}const n=new te(t.contentWindow,t.contentWindow);e.connect(n).catch(s=>{this.disposed||(this.clearTimeout(),console.error("AppBridge connect failed:",s),this.set({error:s instanceof Error?s.message:"Connection failed",isLoading:!1}))})}}function be(o){const e=N.useRef(new pe(o));N.useEffect(()=>{e.current.updateConfig(o)},[o]);const{height:t,isLoading:n,error:s}=N.useSyncExternalStore(e.current.subscribe,e.current.getSnapshot);return{height:t,isLoading:n,error:s,iframeRef:e.current.attach}}const W=new Set;function we(o){const e=o?.contents?.[0];return!e||!("text"in e)||!e.text?null:oe(e.text,{resourceCsp:e._meta?.ui?.csp})}function Z(o){const e=H.c(40),{html:t,uri:n,orgId:s,toolInfo:i,toolInput:r,toolResult:a,displayMode:c,minHeight:u,maxHeight:l,client:T,onMessage:L,onUpdateModelContext:P,onTeardown:S,onRequestDisplayMode:D,className:f}=o,h=c===void 0?"inline":c,k=u===void 0?150:u,A=l===void 0?600:l;n&&!W.has(n)&&(W.add(n),X("mcp_app_opened",{resource_uri:n,display_mode:h,tool_name:i?.tool?.name??null}));const[E]=Y();let v;e[0]!==T||e[1]!==h||e[2]!==A||e[3]!==k||e[4]!==L||e[5]!==D||e[6]!==S||e[7]!==P||e[8]!==s||e[9]!==E.language||e[10]!==i||e[11]!==r||e[12]!==a?(v={client:T,displayMode:h,minHeight:k,maxHeight:A,orgId:s,locale:E.language,toolInfo:i,toolInput:r,toolResult:a,onMessage:L,onUpdateModelContext:P,onTeardown:S,onRequestDisplayMode:D},e[0]=T,e[1]=h,e[2]=A,e[3]=k,e[4]=L,e[5]=D,e[6]=S,e[7]=P,e[8]=s,e[9]=E.language,e[10]=i,e[11]=r,e[12]=a,e[13]=v):v=e[13];const{height:_,isLoading:M,error:R,iframeRef:U}=be(v);if(!t)return null;if(R){let y;e[14]!==f?(y=B("flex items-center justify-center p-4 text-destructive bg-destructive/10 rounded-lg",f),e[14]=f,e[15]=y):y=e[15];let x;e[16]!==R?(x=d.jsx("span",{className:"text-sm",children:R}),e[16]=R,e[17]=x):x=e[17];let I;return e[18]!==y||e[19]!==x?(I=d.jsx("div",{className:y,children:x}),e[18]=y,e[19]=x,e[20]=I):I=e[20],I}const G=i?.tool.name;let m;e[21]!==f?(m=B("relative w-full overflow-hidden rounded-lg",f),e[21]=f,e[22]=m):m=e[22];let g;e[23]!==h||e[24]!==_?(g=h!=="fullscreen"?{height:`${_}px`}:void 0,e[23]=h,e[24]=_,e[25]=g):g=e[25];let p;e[26]!==M?(p=M&&d.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background z-10",children:d.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[d.jsx(J,{className:"size-4"}),d.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),e[26]=M,e[27]=p):p=e[27];const O=M&&"invisible";let b;e[28]!==O?(b=B("w-full h-full border-0",O),e[28]=O,e[29]=b):b=e[29];const $=`MCP App: ${G??n}`;let w;e[30]!==t||e[31]!==U||e[32]!==$||e[33]!==b?(w=d.jsx("iframe",{ref:U,srcDoc:t,sandbox:"allow-scripts allow-same-origin allow-forms allow-popups allow-downloads",className:b,title:$}),e[30]=t,e[31]=U,e[32]=$,e[33]=b,e[34]=w):w=e[34];let C;return e[35]!==w||e[36]!==m||e[37]!==g||e[38]!==p?(C=d.jsxs("div",{className:m,style:g,children:[p,w]}),e[35]=w,e[36]=m,e[37]=g,e[38]=p,e[39]=C):C=e[39],C}function ye(o){const e=H.c(13);let t,n,s,i;e[0]!==o?({resourceURI:i,orgSlug:s,connectionId:t,...n}=o,e[0]=o,e[1]=t,e[2]=n,e[3]=s,e[4]=i):(t=e[1],n=e[2],s=e[3],i=e[4]);let r;e[5]!==t||e[6]!==s||e[7]!==i?(r={orgSlug:s,connectionId:t,uri:i,staleTime:3e4},e[5]=t,e[6]=s,e[7]=i,e[8]=r):r=e[8];const a=K(r);let c;return e[9]!==n||e[10]!==a.data||e[11]!==i?(c=d.jsx(Z,{html:a.data,uri:i,...n}),e[9]=n,e[10]=a.data,e[11]=i,e[12]=c):c=e[12],c}function xe(o){const e=H.c(10);let t,n;e[0]!==o?({resourceURI:n,...t}=o,e[0]=o,e[1]=t,e[2]=n):(t=e[1],n=e[2]);let s;e[3]!==t.client||e[4]!==n?(s={client:t.client,uri:n,staleTime:3e4},e[3]=t.client,e[4]=n,e[5]=s):s=e[5];const{data:i}=Q(s),r=we(i);let a;return e[6]!==t||e[7]!==r||e[8]!==n?(a=d.jsx(Z,{html:r,uri:n,...t}),e[6]=t,e[7]=r,e[8]=n,e[9]=a):a=e[9],a}function Me(o){const e=H.c(4);if(o.orgSlug&&o.connectionId){let n;return e[0]!==o?(n=d.jsx(ye,{...o,orgSlug:o.orgSlug,connectionId:o.connectionId}),e[0]=o,e[1]=n):n=e[1],n}let t;return e[2]!==o?(t=d.jsx(xe,{...o}),e[2]=o,e[3]=t):t=e[3],t}export{Me as M};
@@ -1 +1 @@
1
- import{d as D,a as H,e as z,b as W}from"./auth-BAIe_T8g.js";import{aW as L}from"./index-B4_5ne-m.js";function J(){return window.location.origin}function R(){try{const e=window.location.hostname;return e==="localhost"||e.endsWith(".localhost")||e==="127.0.0.1"||e==="::1"}catch{return!1}}const P="mcp:oauth:callback:";let O=null;const K=1e3,j=10*6e4,C=15e3;class F{_clientMetadata;_redirectUrl;_windowMode;_state=null;_codeVerifier=null;_clientInfo=null;_tokens=null;constructor(t){this._redirectUrl=t.callbackUrl??O?.redirectUrl??`${J()}/oauth/callback`,this._windowMode=t.windowMode??"popup";const n=t.scope?Array.isArray(t.scope)?t.scope.join(" "):t.scope:void 0;this._clientMetadata={redirect_uris:[this._redirectUrl],token_endpoint_auth_method:"none",grant_types:["authorization_code","refresh_token"],response_types:["code"],client_name:t.clientName??"@decocms/studio MCP client",...n&&{scope:n}}}get redirectUrl(){return this._redirectUrl}get clientMetadata(){return this._clientMetadata}state(){return this._state||(this._state=crypto.randomUUID()),this._state}getStoredState(){return this._state}clientInformation(){return this._clientInfo??void 0}saveClientInformation(t){this._clientInfo=t}tokens(){return this._tokens??void 0}saveTokens(t){this._tokens=t}redirectToAuthorization(t){if(this._windowMode==="tab"){if(!window.open(t.toString(),"_blank"))throw new Error("Tab was blocked")}else{const s=window.screenX+(window.outerWidth-600)/2,o=window.screenY+(window.outerHeight-700)/2;if(!window.open(t.toString(),"mcp-oauth",`width=600,height=700,left=${s},top=${o},popup=yes`)&&!window.open(t.toString(),"_blank"))throw new Error("Popup was blocked")}}saveCodeVerifier(t){this._codeVerifier=t}codeVerifier(){if(!this._codeVerifier)throw new Error("Code verifier not found");return this._codeVerifier}invalidateCredentials(){this._clientInfo=null,this._tokens=null,this._codeVerifier=null,this._state=null}}async function B(e){const t=L(e,window.location.origin),n=e.orgSlug?`/api/${encodeURIComponent(e.orgSlug)}/mcp/${e.connectionId}`:`/mcp/${e.connectionId}`,i=new URL(n,t),s=new F({serverUrl:i.href,clientName:e.clientName,clientUri:e.clientUri,callbackUrl:e.callbackUrl,scope:e.scope,windowMode:e.windowMode}),o={fn:null};try{const r=new Promise((u,d)=>{const y=e.timeout||j;let m,p,E,f=!1;const $=s.state(),S=`${P}${$}`,h=()=>{window.removeEventListener("message",b),window.removeEventListener("storage",U),clearTimeout(m),clearInterval(p),clearInterval(E);try{localStorage.removeItem(S)}catch{}};o.fn=c=>{f||(f=!0,h(),d(c))};const A=async c=>{if(f)return;if(f=!0,!c.success){h(),d(new Error(c.error||"OAuth authentication failed"));return}const{code:k,state:V}=c;if(!k){h(),d(new Error("Missing authorization code"));return}if(s.getStoredState()!==V){h(),d(new Error("OAuth state mismatch - possible CSRF attack"));return}try{const M=(await D(i))?.authorization_servers?.[0]||i,I=await H(M),g=s.clientInformation();if(!g){h(),d(new Error("Client information not found"));return}const N=s.codeVerifier(),x=await z(M,{metadata:I,clientInformation:g,authorizationCode:k,codeVerifier:N,redirectUri:s.redirectUrl,resource:new URL(i)});h(),u({tokens:x,clientId:g.client_id??null,clientSecret:g.client_secret??null,tokenEndpoint:I?.token_endpoint??null,userinfoEndpoint:I?.userinfo_endpoint??null})}catch(v){h(),d(v)}},b=async c=>{!R()&&c.origin!==window.location.origin||c.data?.type==="mcp:oauth:callback"&&await A(c.data)},U=async c=>{if(!(c.key!==S||!c.newValue))try{const k=JSON.parse(c.newValue);await A(k)}catch{}};window.addEventListener("message",b),window.addEventListener("storage",U),E=setInterval(()=>{if(f)return;let c=null;try{c=localStorage.getItem(S)}catch{return}if(c)try{A(JSON.parse(c))}catch{}},K),m=setTimeout(()=>{f||(f=!0,h(),d(new Error("OAuth authentication timeout")))},y)});if(r.catch(()=>{}),await W(s,{serverUrl:i})==="REDIRECT"){const u=await r;return{token:u.tokens.access_token,tokenInfo:{accessToken:u.tokens.access_token,refreshToken:u.tokens.refresh_token??null,expiresIn:u.tokens.expires_in??null,scope:u.tokens.scope??null,clientId:u.clientId,clientSecret:u.clientSecret,tokenEndpoint:u.tokenEndpoint,userinfoEndpoint:u.userinfoEndpoint,idToken:u.tokens.id_token??null},error:null}}const l=s.tokens(),w=s.clientInformation();return{token:l?.access_token||null,tokenInfo:l?{accessToken:l.access_token,refreshToken:l.refresh_token??null,expiresIn:l.expires_in??null,scope:l.scope??null,clientId:w?.client_id??null,clientSecret:w?.client_secret??null,tokenEndpoint:null,userinfoEndpoint:null,idToken:l.id_token??null}:null,error:null}}catch(r){return o.fn&&o.fn(r instanceof Error?r:new Error(String(r))),{token:null,tokenInfo:null,error:r instanceof Error?r.message:String(r)}}}function T(e,t){if(window.opener&&!window.opener.closed){const n=R()?"*":window.location.origin;return window.opener.postMessage(e,n),!0}if(t)try{const n=`${P}${t}`;return localStorage.setItem(n,JSON.stringify(e)),!0}catch{}return!1}async function ee(){const e=new URLSearchParams(window.location.search),t=e.get("code");let n=e.get("state");const i=e.get("error"),s=e.get("error_description");let o=n;if(n)try{const a=atob(n),l=JSON.parse(a);l.clientState&&(o=l.clientState)}catch{}if(i){const a=s||i;return T({type:"mcp:oauth:callback",success:!1,error:a},o),{success:!1,error:a}}if(!t||!n){const a="Missing code or state parameter";return T({type:"mcp:oauth:callback",success:!1,error:a},o),{success:!1,error:a}}return n=o||n,T({type:"mcp:oauth:callback",success:!0,code:t,state:n},n)?{success:!0}:{success:!1,error:"Parent window not available"}}function _(){if(typeof window<"u"&&window.location?.origin)return window.location.origin}function G(e){try{const t=_(),n=t?new URL(e,t):new URL(e),i=n.pathname.match(/^\/api\/[^/]+\/mcp\/([^/]+)/);return i?i[1]??null:n.pathname.match(/^\/mcp\/([^/]+)/)?.[1]??null}catch{return null}}function Y(e){try{const t=_();return(t?new URL(e,t):new URL(e)).pathname.match(/^\/api\/([^/]+)\/mcp\//)?.[1]??null}catch{return null}}async function X(e,t,n){try{const i=`/api/${encodeURIComponent(t)}/connections/${e}/oauth-token/status`,s=n?new URL(i,n).href:i,o=_(),r=!n||new URL(n).origin===o,a=await fetch(s,{credentials:r?"include":"omit"});return a.ok?{hasToken:(await a.json()).hasToken===!0}:{hasToken:!1}}catch{return{hasToken:!1}}}async function te({url:e,token:t,orgId:n,studioUrl:i,meshUrl:s}){try{const o=new Headers;o.set("Content-Type","application/json"),o.set("Accept","application/json, text/event-stream");const r=await fetch(e,{method:"POST",headers:o,body:JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2025-06-18",capabilities:{},clientInfo:{name:"@decocms/studio MCP client",version:"1.0.0"}}}),signal:AbortSignal.timeout(C)}),a=G(e),l=Y(e),w=_(),u=L({studioUrl:i,meshUrl:s},w?new URL(e,w).origin:new URL(e).origin);if(r.ok)return{isAuthenticated:!0,supportsOAuth:!1,hasOAuthToken:(a&&l?await X(a,l,u):{hasToken:!1}).hasToken};let d;try{const p=await r.json();d=p.error||p.message}catch{}return r.status>=500?{isAuthenticated:!1,supportsOAuth:!1,hasOAuthToken:!1,error:d||`HTTP ${r.status}`,isServerError:!0}:{isAuthenticated:!1,supportsOAuth:!!r.headers.get("WWW-Authenticate"),hasOAuthToken:!1,error:d||`HTTP ${r.status}`}}catch(o){return console.error("[isConnectionAuthenticated] Error:",o),{isAuthenticated:!1,supportsOAuth:!1,hasOAuthToken:!1,error:o instanceof Error&&o.name==="TimeoutError"?`Connection check timed out after ${C/1e3}s`:o.message}}}export{B as a,ee as h,te as i};
1
+ import{d as D,a as H,e as z,b as J}from"./auth-C673ACq9.js";import{aX as L}from"./index-ViRfM1Gu.js";function K(){return window.location.origin}function R(){try{const e=window.location.hostname;return e==="localhost"||e.endsWith(".localhost")||e==="127.0.0.1"||e==="::1"}catch{return!1}}const P="mcp:oauth:callback:";let O=null;const W=1e3,j=10*6e4,C=15e3;class F{_clientMetadata;_redirectUrl;_windowMode;_state=null;_codeVerifier=null;_clientInfo=null;_tokens=null;constructor(t){this._redirectUrl=t.callbackUrl??O?.redirectUrl??`${K()}/oauth/callback`,this._windowMode=t.windowMode??"popup";const n=t.scope?Array.isArray(t.scope)?t.scope.join(" "):t.scope:void 0;this._clientMetadata={redirect_uris:[this._redirectUrl],token_endpoint_auth_method:"none",grant_types:["authorization_code","refresh_token"],response_types:["code"],client_name:t.clientName??"@decocms/studio MCP client",...n&&{scope:n}}}get redirectUrl(){return this._redirectUrl}get clientMetadata(){return this._clientMetadata}state(){return this._state||(this._state=crypto.randomUUID()),this._state}getStoredState(){return this._state}clientInformation(){return this._clientInfo??void 0}saveClientInformation(t){this._clientInfo=t}tokens(){return this._tokens??void 0}saveTokens(t){this._tokens=t}redirectToAuthorization(t){if(this._windowMode==="tab"){if(!window.open(t.toString(),"_blank"))throw new Error("Tab was blocked")}else{const s=window.screenX+(window.outerWidth-600)/2,o=window.screenY+(window.outerHeight-700)/2;if(!window.open(t.toString(),"mcp-oauth",`width=600,height=700,left=${s},top=${o},popup=yes`)&&!window.open(t.toString(),"_blank"))throw new Error("Popup was blocked")}}saveCodeVerifier(t){this._codeVerifier=t}codeVerifier(){if(!this._codeVerifier)throw new Error("Code verifier not found");return this._codeVerifier}invalidateCredentials(){this._clientInfo=null,this._tokens=null,this._codeVerifier=null,this._state=null}}async function B(e){const t=L(e,window.location.origin),n=e.orgSlug?`/api/${encodeURIComponent(e.orgSlug)}/mcp/${e.connectionId}`:`/mcp/${e.connectionId}`,i=new URL(n,t),s=new F({serverUrl:i.href,clientName:e.clientName,clientUri:e.clientUri,callbackUrl:e.callbackUrl,scope:e.scope,windowMode:e.windowMode}),o={fn:null};try{const r=new Promise((u,d)=>{const y=e.timeout||j;let m,p,E,f=!1;const $=s.state(),S=`${P}${$}`,h=()=>{window.removeEventListener("message",b),window.removeEventListener("storage",U),clearTimeout(m),clearInterval(p),clearInterval(E);try{localStorage.removeItem(S)}catch{}};o.fn=c=>{f||(f=!0,h(),d(c))};const A=async c=>{if(f)return;if(f=!0,!c.success){h(),d(new Error(c.error||"OAuth authentication failed"));return}const{code:k,state:V}=c;if(!k){h(),d(new Error("Missing authorization code"));return}if(s.getStoredState()!==V){h(),d(new Error("OAuth state mismatch - possible CSRF attack"));return}try{const M=(await D(i))?.authorization_servers?.[0]||i,I=await H(M),g=s.clientInformation();if(!g){h(),d(new Error("Client information not found"));return}const N=s.codeVerifier(),x=await z(M,{metadata:I,clientInformation:g,authorizationCode:k,codeVerifier:N,redirectUri:s.redirectUrl,resource:new URL(i)});h(),u({tokens:x,clientId:g.client_id??null,clientSecret:g.client_secret??null,tokenEndpoint:I?.token_endpoint??null,userinfoEndpoint:I?.userinfo_endpoint??null})}catch(v){h(),d(v)}},b=async c=>{!R()&&c.origin!==window.location.origin||c.data?.type==="mcp:oauth:callback"&&await A(c.data)},U=async c=>{if(!(c.key!==S||!c.newValue))try{const k=JSON.parse(c.newValue);await A(k)}catch{}};window.addEventListener("message",b),window.addEventListener("storage",U),E=setInterval(()=>{if(f)return;let c=null;try{c=localStorage.getItem(S)}catch{return}if(c)try{A(JSON.parse(c))}catch{}},W),m=setTimeout(()=>{f||(f=!0,h(),d(new Error("OAuth authentication timeout")))},y)});if(r.catch(()=>{}),await J(s,{serverUrl:i})==="REDIRECT"){const u=await r;return{token:u.tokens.access_token,tokenInfo:{accessToken:u.tokens.access_token,refreshToken:u.tokens.refresh_token??null,expiresIn:u.tokens.expires_in??null,scope:u.tokens.scope??null,clientId:u.clientId,clientSecret:u.clientSecret,tokenEndpoint:u.tokenEndpoint,userinfoEndpoint:u.userinfoEndpoint,idToken:u.tokens.id_token??null},error:null}}const l=s.tokens(),w=s.clientInformation();return{token:l?.access_token||null,tokenInfo:l?{accessToken:l.access_token,refreshToken:l.refresh_token??null,expiresIn:l.expires_in??null,scope:l.scope??null,clientId:w?.client_id??null,clientSecret:w?.client_secret??null,tokenEndpoint:null,userinfoEndpoint:null,idToken:l.id_token??null}:null,error:null}}catch(r){return o.fn&&o.fn(r instanceof Error?r:new Error(String(r))),{token:null,tokenInfo:null,error:r instanceof Error?r.message:String(r)}}}function T(e,t){if(window.opener&&!window.opener.closed){const n=R()?"*":window.location.origin;return window.opener.postMessage(e,n),!0}if(t)try{const n=`${P}${t}`;return localStorage.setItem(n,JSON.stringify(e)),!0}catch{}return!1}async function ee(){const e=new URLSearchParams(window.location.search),t=e.get("code");let n=e.get("state");const i=e.get("error"),s=e.get("error_description");let o=n;if(n)try{const a=atob(n),l=JSON.parse(a);l.clientState&&(o=l.clientState)}catch{}if(i){const a=s||i;return T({type:"mcp:oauth:callback",success:!1,error:a},o),{success:!1,error:a}}if(!t||!n){const a="Missing code or state parameter";return T({type:"mcp:oauth:callback",success:!1,error:a},o),{success:!1,error:a}}return n=o||n,T({type:"mcp:oauth:callback",success:!0,code:t,state:n},n)?{success:!0}:{success:!1,error:"Parent window not available"}}function _(){if(typeof window<"u"&&window.location?.origin)return window.location.origin}function G(e){try{const t=_(),n=t?new URL(e,t):new URL(e),i=n.pathname.match(/^\/api\/[^/]+\/mcp\/([^/]+)/);return i?i[1]??null:n.pathname.match(/^\/mcp\/([^/]+)/)?.[1]??null}catch{return null}}function X(e){try{const t=_();return(t?new URL(e,t):new URL(e)).pathname.match(/^\/api\/([^/]+)\/mcp\//)?.[1]??null}catch{return null}}async function Y(e,t,n){try{const i=`/api/${encodeURIComponent(t)}/connections/${e}/oauth-token/status`,s=n?new URL(i,n).href:i,o=_(),r=!n||new URL(n).origin===o,a=await fetch(s,{credentials:r?"include":"omit"});return a.ok?{hasToken:(await a.json()).hasToken===!0}:{hasToken:!1}}catch{return{hasToken:!1}}}async function te({url:e,token:t,orgId:n,studioUrl:i,meshUrl:s}){try{const o=new Headers;o.set("Content-Type","application/json"),o.set("Accept","application/json, text/event-stream");const r=await fetch(e,{method:"POST",headers:o,body:JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2025-06-18",capabilities:{},clientInfo:{name:"@decocms/studio MCP client",version:"1.0.0"}}}),signal:AbortSignal.timeout(C)}),a=G(e),l=X(e),w=_(),u=L({studioUrl:i,meshUrl:s},w?new URL(e,w).origin:new URL(e).origin);if(r.ok)return{isAuthenticated:!0,supportsOAuth:!1,hasOAuthToken:(a&&l?await Y(a,l,u):{hasToken:!1}).hasToken};let d;try{const p=await r.json();d=p.error||p.message}catch{}return r.status>=500?{isAuthenticated:!1,supportsOAuth:!1,hasOAuthToken:!1,error:d||`HTTP ${r.status}`,isServerError:!0}:{isAuthenticated:!1,supportsOAuth:!!r.headers.get("WWW-Authenticate"),hasOAuthToken:!1,error:d||`HTTP ${r.status}`}}catch(o){return console.error("[isConnectionAuthenticated] Error:",o),{isAuthenticated:!1,supportsOAuth:!1,hasOAuthToken:!1,error:o instanceof Error&&o.name==="TimeoutError"?`Connection check timed out after ${C/1e3}s`:o.message}}}export{B as a,ee as h,te as i};