decocms 4.568.1 → 4.569.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (395) hide show
  1. package/dist/client/assets/{AlertCircle-2S4m6Uee.js → AlertCircle-C8lUSNa8.js} +1 -1
  2. package/dist/client/assets/{AreaChart-DzDvwx79.js → AreaChart-Co4_GDFk.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-CljOyrIP.js → ArrowLeft-BW0QTKlw.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-Bk8mxo48.js → ArrowUp-DjenQeZQ.js} +1 -1
  5. package/dist/client/assets/{CartesianChart-DEGLB-d5.js → CartesianChart-KHpxFlDw.js} +1 -1
  6. package/dist/client/assets/{CategoricalChart-BulNcxIZ.js → CategoricalChart-DCWzRRkG.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-f2YXXhCp.js → CheckCircle-CBLXbFFB.js} +1 -1
  8. package/dist/client/assets/{ChevronSelectorVertical-DlyDkNpb.js → ChevronSelectorVertical-ofVA6B_w.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-BQPjne-n.js → ChevronUp-Dg02PCVC.js} +1 -1
  10. package/dist/client/assets/{CreditCard01-B4eSBulM.js → CreditCard01-F1q7cqMP.js} +1 -1
  11. package/dist/client/assets/{Globe04-CdD9x2xM.js → Globe04-B7JSn39b.js} +1 -1
  12. package/dist/client/assets/{Key01-DtPiSC33.js → Key01-DPrG8yA6.js} +1 -1
  13. package/dist/client/assets/{LinkBroken01-CctT2suC.js → LinkBroken01-DfOqWtEB.js} +1 -1
  14. package/dist/client/assets/{Minus-xsukVIT2.js → Minus-CtT-IgpU.js} +1 -1
  15. package/dist/client/assets/{Monitor01-DiSF-kjz.js → Monitor01-CY6I-T_v.js} +1 -1
  16. package/dist/client/assets/{Play-ChTUD8rH.js → Play-Cb465MQD.js} +1 -1
  17. package/dist/client/assets/{Plus-CFb7oJrI.js → Plus-EDJqelyG.js} +1 -1
  18. package/dist/client/assets/ReferenceLine-M7tH9_wm.js +1 -0
  19. package/dist/client/assets/{SearchMd-DBFjE3ta.js → SearchMd-BM1-RWQF.js} +1 -1
  20. package/dist/client/assets/{ShoppingBag01-Ce0oZ7tq.js → ShoppingBag01-BsFRFwoQ.js} +1 -1
  21. package/dist/client/assets/{Sun-CNo1YpD-.js → Sun-BPyrKfqp.js} +1 -1
  22. package/dist/client/assets/{SwitchHorizontal01-sZUZBsf0.js → SwitchHorizontal01-CMdcXPwO.js} +1 -1
  23. package/dist/client/assets/{Tool01-CEctUV2j.js → Tool01-CuDHSO34.js} +1 -1
  24. package/dist/client/assets/{Tooltip-Dw-CUg_6.js → Tooltip-BY8JGJJH.js} +1 -1
  25. package/dist/client/assets/{Trash01-D1V404v-.js → Trash01-Bif7g_Tq.js} +1 -1
  26. package/dist/client/assets/{Upload01-c3loaqre.js → Upload01-Drv81LKH.js} +1 -1
  27. package/dist/client/assets/{UserSquare-D1FSX2q6.js → UserSquare-DqOeWgs_.js} +1 -1
  28. package/dist/client/assets/{Users01-DZ_8WK0j.js → Users01-DSPCiWrI.js} +1 -1
  29. package/dist/client/assets/{XClose-CUWsLE89.js → XClose-CFLo0iwC.js} +1 -1
  30. package/dist/client/assets/{Zap-D4Hgh2tO.js → Zap-TzUnnTO5.js} +1 -1
  31. package/dist/client/assets/{access-gate-DlxNXK1w.js → access-gate-BZysXSEP.js} +1 -1
  32. package/dist/client/assets/{add-connection-dialog-CgKOW9SX.js → add-connection-dialog-Bj8rQn7t.js} +1 -1
  33. package/dist/client/assets/agent-app-B0ADSPIl.js +1 -0
  34. package/dist/client/assets/{agent-assets-Ce1P8u97.js → agent-assets-de3dSSE0.js} +1 -1
  35. package/dist/client/assets/{agent-automation-BRp-dxYO.js → agent-automation-Eoz9llO0.js} +1 -1
  36. package/dist/client/assets/{agent-automations-DH6-Bwa9.js → agent-automations-YrodALnn.js} +1 -1
  37. package/dist/client/assets/{agent-calendar-CsyPj6t3.js → agent-calendar-BaQX5CRD.js} +1 -1
  38. package/dist/client/assets/{agent-capabilities-XEaBuaCG.js → agent-capabilities-Z6OO2Jnk.js} +1 -1
  39. package/dist/client/assets/{agent-connect-sources-DmdlUmUE.js → agent-connect-sources-C9AyKvNN.js} +1 -1
  40. package/dist/client/assets/agent-deck-FWdv6Cpu.js +1 -0
  41. package/dist/client/assets/{agent-e2e-Dl84TG-q.js → agent-e2e-7RobNFIi.js} +1 -1
  42. package/dist/client/assets/agent-experiments-zhmtYFsP.js +1 -0
  43. package/dist/client/assets/{agent-file-BJlF5HM_.js → agent-file-Dbl-JFZv.js} +1 -1
  44. package/dist/client/assets/{agent-hosting-RUQdsE0U.js → agent-hosting-CqO-A-Yx.js} +1 -1
  45. package/dist/client/assets/{agent-icon-DCW_KqWB.js → agent-icon-CRaK_2eb.js} +1 -1
  46. package/dist/client/assets/agent-library-C9bPwpZT.js +1 -0
  47. package/dist/client/assets/agent-library-file-CJqPNg_v.js +1 -0
  48. package/dist/client/assets/agent-overview-DIZADCxs.js +1 -0
  49. package/dist/client/assets/{agent-releases-DrG4uQ2L.js → agent-releases-DELNaOnx.js} +1 -1
  50. package/dist/client/assets/agent-settings-BXotmRnL.js +1 -0
  51. package/dist/client/assets/{agent-site-editor-BWGxnBFw.js → agent-site-editor-CZ_aX5w6.js} +1 -1
  52. package/dist/client/assets/agent-site-editor-code-Bd4DxsVE.js +2 -0
  53. package/dist/client/assets/agent-site-editor-content-BOAu460T.js +1 -0
  54. package/dist/client/assets/agent-site-editor-preview-DIPhJI1V.js +1 -0
  55. package/dist/client/assets/agent-view-CQ1k8Ncp.js +1 -0
  56. package/dist/client/assets/{agent-view-guard-B51lKDrE.js → agent-view-guard-DQbhiGaj.js} +1 -1
  57. package/dist/client/assets/{ai-providers-DesoVO6n.js → ai-providers-ByQv34ay.js} +1 -1
  58. package/dist/client/assets/{alert-CNUnViSc.js → alert-D9FiKroy.js} +1 -1
  59. package/dist/client/assets/{analytics-sections-DZ6bSrej.js → analytics-sections-BmDNYduw.js} +1 -1
  60. package/dist/client/assets/api-keys-4E58id83.js +1 -0
  61. package/dist/client/assets/{api-keys-DMJ1ggJe.js → api-keys-BfsLg2vA.js} +1 -1
  62. package/dist/client/assets/{app-editor-CYKwEWzW.js → app-editor-B45vF8Mg.js} +1 -1
  63. package/dist/client/assets/{asset-utils-csHzYcpa.js → asset-utils-BxC41cma.js} +1 -1
  64. package/dist/client/assets/{auth-B2w9HRxQ.js → auth-Ds2S-lbe.js} +1 -1
  65. package/dist/client/assets/{auth-catchall-B3ScoKqp.js → auth-catchall-C-6FZGi0.js} +1 -1
  66. package/dist/client/assets/{auth-entry-ffUGVaD5.js → auth-entry-CyO_cwvd.js} +1 -1
  67. package/dist/client/assets/{auth-split-layout-cxR5U8N-.js → auth-split-layout-m3Tiw0uy.js} +1 -1
  68. package/dist/client/assets/{authenticate-and-persist-oauth-CJC-QeJ8.js → authenticate-and-persist-oauth-D8AvdBCW.js} +1 -1
  69. package/dist/client/assets/{automation-list-row-6cISNX0K.js → automation-list-row-C9ktMtT0.js} +1 -1
  70. package/dist/client/assets/{automation-runs-vjsNSmlS.js → automation-runs-BOw5cx8_.js} +1 -1
  71. package/dist/client/assets/automations-B7fWZ0Vh.js +1 -0
  72. package/dist/client/assets/{autosend-tnLQ3hUB.js → autosend-DDd9ei6A.js} +1 -1
  73. package/dist/client/assets/{badge-Ksu8KJbs.js → badge-BpuDiibz.js} +1 -1
  74. package/dist/client/assets/{block-document-BcO7ziS9.js → block-document-0xSm2fiy.js} +1 -1
  75. package/dist/client/assets/{blocks-preview-workspace-context-BCVvfbLh.js → blocks-preview-workspace-context-BKKCrT_T.js} +1 -1
  76. package/dist/client/assets/{blocks-tab-states-DA0koo91.js → blocks-tab-states-D0oTw6gu.js} +1 -1
  77. package/dist/client/assets/{blog-schema-ChjeQAln.js → blog-schema-BppY95gR.js} +1 -1
  78. package/dist/client/assets/{buckets-Bv0Gqv_3.js → buckets-CqGWJLKP.js} +1 -1
  79. package/dist/client/assets/{build-improve-prompt-doc-JnzVJ3fg.js → build-improve-prompt-doc-BGIBlPP6.js} +1 -1
  80. package/dist/client/assets/{calendar-CNFfehjI.js → calendar-DuGzMi3S.js} +1 -1
  81. package/dist/client/assets/{capability-load-error-C3U-ZhDb.js → capability-load-error-DIv2eZlz.js} +1 -1
  82. package/dist/client/assets/{category-editor-GEMaUqfv.js → category-editor-DHDmibyv.js} +1 -1
  83. package/dist/client/assets/{chart-BEnYUkVg.js → chart-BcizaXxw.js} +1 -1
  84. package/dist/client/assets/{chat-context-B1zyw_h1.js → chat-context-O7Uim5zw.js} +1 -1
  85. package/dist/client/assets/{chat-draft-DRes0F_S.js → chat-draft-CP7W66gO.js} +1 -1
  86. package/dist/client/assets/{checkbox-tAVwTDof.js → checkbox-Dj1_p-oY.js} +1 -1
  87. package/dist/client/assets/{choose-editor-DlLnUDKe.js → choose-editor-FgTuu-ql.js} +1 -1
  88. package/dist/client/assets/{cli-auth-success-CwqWdQXx.js → cli-auth-success-CNmrqva7.js} +1 -1
  89. package/dist/client/assets/{client-icons-o-FN7f8P.js → client-icons-BF-arSHb.js} +1 -1
  90. package/dist/client/assets/{cms-settings-editor-Ca3p-t4F.js → cms-settings-editor-BOyoDLZX.js} +1 -1
  91. package/dist/client/assets/cms-store-drafts-DiBAZwre.js +1 -0
  92. package/dist/client/assets/{collapsible-5yAdMS_P.js → collapsible-Bp1-V-Fv.js} +1 -1
  93. package/dist/client/assets/{collection-detail-CVpfPE8q.js → collection-detail-DBSAOtJN.js} +1 -1
  94. package/dist/client/assets/{collection-display-button-qWeIMlr2.js → collection-display-button-C5ml6MSP.js} +1 -1
  95. package/dist/client/assets/{collection-search-9RSy1xeA.js → collection-search-AauU22W8.js} +1 -1
  96. package/dist/client/assets/{collection-table-wrapper-C_YIQpgC.js → collection-table-wrapper-qRDLH-yA.js} +1 -1
  97. package/dist/client/assets/{collection-tabs-Bnk-eCpC.js → collection-tabs-DO7nBfoY.js} +1 -1
  98. package/dist/client/assets/{combobox-r5XUdipE.js → combobox-dI6mnh2K.js} +1 -1
  99. package/dist/client/assets/{command-xe4xl69E.js → command-BO5QH15f.js} +1 -1
  100. package/dist/client/assets/{companion-mcps-section-DzyY7ngn.js → companion-mcps-section-CbUF3EiL.js} +1 -1
  101. package/dist/client/assets/{config-DpPtGg1B.js → config-w5HL15RE.js} +1 -1
  102. package/dist/client/assets/{connect-BpD7GFw-.js → connect-Dv7_pdgv.js} +3 -3
  103. package/dist/client/assets/{connect-layout-DidM4s1D.js → connect-layout-DIUYH7zZ.js} +1 -1
  104. package/dist/client/assets/{connect-source-dialog-CVMKd01i.js → connect-source-dialog-5pyz_gqC.js} +1 -1
  105. package/dist/client/assets/{connection-BG0LCkS_.js → connection-BmfrUVUF.js} +1 -1
  106. package/dist/client/assets/{connection-card-CC-UP_Iv.js → connection-card-Dyl9jamP.js} +1 -1
  107. package/dist/client/assets/{connection-detail-DQS-1IZw.js → connection-detail-trf1a8ud.js} +1 -1
  108. package/dist/client/assets/{connection-form-helpers-DwaYI15n.js → connection-form-helpers-DkXWTd-5.js} +1 -1
  109. package/dist/client/assets/{connection-slug-BAlEhVgz.js → connection-slug-D9QF6JTj.js} +1 -1
  110. package/dist/client/assets/{connections-jotualBC.js → connections-DBn4X-FO.js} +1 -1
  111. package/dist/client/assets/{content-tab-C72v9K4t.js → content-tab-eUiPWbq7.js} +3 -3
  112. package/dist/client/assets/{context-BKrbirxJ.js → context-Dm1vgWac.js} +1 -1
  113. package/dist/client/assets/{context-menu-BXrkB7rz.js → context-menu-BG18ePnL.js} +1 -1
  114. package/dist/client/assets/{context-shell-DojPqPCt.js → context-shell-CJdcogAj.js} +3 -3
  115. package/dist/client/assets/{core.esm-BOqq6di7.js → core.esm-CiyyLnsG.js} +1 -1
  116. package/dist/client/assets/{create-organization-dialog-D2ePlI_m.js → create-organization-dialog-DeokYGJM.js} +1 -1
  117. package/dist/client/assets/{device-hint-nQyGyXyE.js → device-hint-Z9_uJm09.js} +1 -1
  118. package/dist/client/assets/{discover-URIcA-sL.js → discover-BJzOKOeT.js} +1 -1
  119. package/dist/client/assets/{domain-settings-BmNyQb_H.js → domain-settings-k6_UVS3e.js} +1 -1
  120. package/dist/client/assets/{drawer-BXpgrjgO.js → drawer-DMRnFsxc.js} +1 -1
  121. package/dist/client/assets/{editor-BNio8R7L.js → editor-BTYObZ3D.js} +1 -1
  122. package/dist/client/assets/{editor-classes-D_gybp_M.js → editor-classes-DIdZ5SUW.js} +1 -1
  123. package/dist/client/assets/{empty-state-KdDqwAjO.js → empty-state-B44K4GDI.js} +1 -1
  124. package/dist/client/assets/{empty-state-D1kuCCvh.js → empty-state-BTVsC7xK.js} +1 -1
  125. package/dist/client/assets/{experiments-tab-choice-Dasf4HtL.js → experiments-tab-choice-CzcNWwIa.js} +1 -1
  126. package/dist/client/assets/{extract-connection-data-ByBB6fTN.js → extract-connection-data-BAO6488m.js} +1 -1
  127. package/dist/client/assets/{feature-gate-N64tj0DX.js → feature-gate-D17dqUhL.js} +1 -1
  128. package/dist/client/assets/{feature-paywall-C6hwn5S0.js → feature-paywall-BAqosyy1.js} +1 -1
  129. package/dist/client/assets/{feedback-Bn9737Cr.js → feedback-BCnQQwEu.js} +1 -1
  130. package/dist/client/assets/{file-explorer-C3LrfGir.js → file-explorer-DpZFO-Yb.js} +1 -1
  131. package/dist/client/assets/{file-preview-DhfzScDD.js → file-preview-C7xeW7Ns.js} +1 -1
  132. package/dist/client/assets/{file-share-button-IDXjXg-A.js → file-share-button-Cj2TiEru.js} +1 -1
  133. package/dist/client/assets/{file-type-icon-jrw7H8zE.js → file-type-icon-BgvZ7mJ5.js} +1 -1
  134. package/dist/client/assets/{folder-icon-DUOwLJoM.js → folder-icon-CC-uKBN4.js} +1 -1
  135. package/dist/client/assets/{form-iPBnt3oj.js → form-CQzCiA7m.js} +1 -1
  136. package/dist/client/assets/{general-B4zzx7IE.js → general-WB7AI2JV.js} +1 -1
  137. package/dist/client/assets/{github-icon-B3lAwfsm.js → github-icon-Dq39pEMT.js} +1 -1
  138. package/dist/client/assets/{home-B9w8E6oP.js → home-DNtWj6y4.js} +1 -1
  139. package/dist/client/assets/{home-overview-D7ApqTOh.js → home-overview-KMaj_IXE.js} +1 -1
  140. package/dist/client/assets/{hosted-reconcile-BhSM-qbd.js → hosted-reconcile-C-OJGDnV.js} +1 -1
  141. package/dist/client/assets/{icon-button-qr7hW5Fe.js → icon-button-BxjZlrnJ.js} +1 -1
  142. package/dist/client/assets/{index-BM6V4GkN.js → index-0imbfLx3.js} +1 -1
  143. package/dist/client/assets/{index-D43W3NwR.js → index-B541Z8pm.js} +1 -1
  144. package/dist/client/assets/{index-8vlZdtjm.js → index-BK7nI4x8.js} +1 -1
  145. package/dist/client/assets/{index-Bs4HBbkZ.js → index-BZnluLX8.js} +1 -1
  146. package/dist/client/assets/{index-Zhz3FEfg.js → index-CGYr3Izo.js} +1 -1
  147. package/dist/client/assets/{index-BkV0ePYZ.js → index-CJj8VLTq.js} +1 -1
  148. package/dist/client/assets/{index-CkUeEi5S.js → index-CMI5yx1h.js} +1 -1
  149. package/dist/client/assets/{index-B6uyloRF.js → index-CZmp59DI.js} +1 -1
  150. package/dist/client/assets/{index-ThHlPkA1.js → index-Cm-moWa5.js} +4 -4
  151. package/dist/client/assets/{index-b28YA5pM.js → index-D8rwwuoa.js} +1 -1
  152. package/dist/client/assets/{index-BQIeGgfw.js → index-DBE1cmuY.js} +1 -1
  153. package/dist/client/assets/{index-gIaywX47.js → index-DDHS6uH4.js} +1 -1
  154. package/dist/client/assets/{index-BlGy9Bb5.js → index-DfAh0E81.js} +1 -1
  155. package/dist/client/assets/{index-CS1qwofw.js → index-DhSgpwmt.js} +1 -1
  156. package/dist/client/assets/{index-BFEychws.js → index-O8I8IW_m.js} +1 -1
  157. package/dist/client/assets/{index-BdDgw28T.js → index-pMcMdeCf.js} +1 -1
  158. package/dist/client/assets/{index-redirect-DN8vGzbZ.js → index-redirect-DzUS6M4j.js} +1 -1
  159. package/dist/client/assets/{infiniteQueryObserver-DO5Ifm28.js → infiniteQueryObserver-D6uRpwx5.js} +1 -1
  160. package/dist/client/assets/{infra-billing-CEMSfDL_.js → infra-billing-DuXLPrYd.js} +1 -1
  161. package/dist/client/assets/{input-BSU_Rb1v.js → input-Blfx4aW7.js} +1 -1
  162. package/dist/client/assets/{input-Dv1RwHqe.js → input-DhrW1toc.js} +3 -3
  163. package/dist/client/assets/{integration-icon-Cm0oa98P.js → integration-icon-CDajRnkl.js} +1 -1
  164. package/dist/client/assets/{jira-icon-ZW0Sv1e5.js → jira-icon-BjvaFHGW.js} +1 -1
  165. package/dist/client/assets/{label-BRcQIH7Z.js → label-BwDzqaMo.js} +1 -1
  166. package/dist/client/assets/{layout-Bys7Eped.js → layout-BFtQxqvc.js} +1 -1
  167. package/dist/client/assets/{legacy-agents-deep-CpsXYlRM.js → legacy-agents-deep-ClovinDV.js} +1 -1
  168. package/dist/client/assets/{legacy-main-redirect-r6B1R3al.js → legacy-main-redirect-CXwADpls.js} +1 -1
  169. package/dist/client/assets/library-BWyOfhBW.js +1 -0
  170. package/dist/client/assets/{library-tab-SsaPyFyy.js → library-tab-D9aFdK2S.js} +1 -1
  171. package/dist/client/assets/{login-Dk7eEOiP.js → login-BKJiNyyp.js} +1 -1
  172. package/dist/client/assets/{markdown-DJi-9CBK.js → markdown-BukU_dP8.js} +1 -1
  173. package/dist/client/assets/{mcp-app-renderer-CckffJyx.js → mcp-app-renderer-C-v6StvL.js} +1 -1
  174. package/dist/client/assets/{mcp-oauth-Cug27Wy_.js → mcp-oauth-CY66kpRN.js} +1 -1
  175. package/dist/client/assets/{mcp-oauth-DKJ4B9sm.js → mcp-oauth-CxEXOBcT.js} +1 -1
  176. package/dist/client/assets/{members-COCISWR-.js → members-CF-gnn8J.js} +1 -1
  177. package/dist/client/assets/{memory-CjdJ31Mj.js → memory-CdLLa3Kl.js} +1 -1
  178. package/dist/client/assets/{mock-board-Cwj6vTmL.js → mock-board-DElhppkh.js} +3 -3
  179. package/dist/client/assets/{monaco-editor-D-tIIKfx.js → monaco-editor-BNkAcsUY.js} +1 -1
  180. package/dist/client/assets/{monitoring-C8zAkl9o.js → monitoring-C-ycc-h_.js} +1 -1
  181. package/dist/client/assets/{monitoring-stats-row-HLfK5nXn.js → monitoring-stats-row-B0tic5F9.js} +1 -1
  182. package/dist/client/assets/{multi-select-Dmw2FHdE.js → multi-select-FgNDnuDo.js} +1 -1
  183. package/dist/client/assets/{mustache-C_dugd4c.js → mustache-CIeVDhQo.js} +1 -1
  184. package/dist/client/assets/{named-rule-view-B2Cmocns.js → named-rule-view-9PjPoj8p.js} +1 -1
  185. package/dist/client/assets/{new-project-dialog-NNiGQZ9q.js → new-project-dialog-DHaEULY3.js} +1 -1
  186. package/dist/client/assets/{oauth-callback-DiSnZu8_.js → oauth-callback-B3eu4Ach.js} +1 -1
  187. package/dist/client/assets/{oauth-callback-ai-provider-C0PCpWFG.js → oauth-callback-ai-provider-CqUI9sqZ.js} +1 -1
  188. package/dist/client/assets/{oauth-consent-DSznDB5g.js → oauth-consent-r8Ehs0lB.js} +1 -1
  189. package/dist/client/assets/{onboarding-BVi3tEPn.js → onboarding-BTBq2ggs.js} +1 -1
  190. package/dist/client/assets/{openai-conversation-BFUVr9Gk.js → openai-conversation-p1k1gWxX.js} +1 -1
  191. package/dist/client/assets/{optimistic-project-sidebar-views-DTcSwY9T.js → optimistic-project-sidebar-views-DWWGhnPv.js} +1 -1
  192. package/dist/client/assets/{order-monitor-day-DJBGaIxr.js → order-monitor-day-CChR5TYK.js} +1 -1
  193. package/dist/client/assets/{organization-choice-C-gzKMX0.js → organization-choice-Cw7nqarH.js} +1 -1
  194. package/dist/client/assets/{orgs-BIO2wd0h.js → orgs-Do-VFG6Q.js} +1 -1
  195. package/dist/client/assets/{own-accounts-section-DVG2PaGF.js → own-accounts-section-CfrXQu2D.js} +1 -1
  196. package/dist/client/assets/{pair-DsssEbw0.js → pair-CQCTPbi0.js} +1 -1
  197. package/dist/client/assets/{parse-sections-Du7KAexn.js → parse-sections-DfTZ3uiV.js} +3 -3
  198. package/dist/client/assets/{plan-CvJcMsFW.js → plan-DD5HWH6n.js} +1 -1
  199. package/dist/client/assets/{plan-ladder-BUzJX8lf.js → plan-ladder-DPpGlKZx.js} +1 -1
  200. package/dist/client/assets/{plan-usage-card-Cj34MSfd.js → plan-usage-card-DWpMRf7u.js} +2 -2
  201. package/dist/client/assets/{popover-BKyGlArJ.js → popover-DLErjFx_.js} +1 -1
  202. package/dist/client/assets/{post-calendar-C85ccmZv.js → post-calendar-CK1SMoTM.js} +1 -1
  203. package/dist/client/assets/{post-editor-BILiJR0b.js → post-editor-DisluBT5.js} +1 -1
  204. package/dist/client/assets/{preview-content-DxU1lFaM.js → preview-content-DnVFo2zs.js} +1 -1
  205. package/dist/client/assets/{preview-dialog-DUF3utt_.js → preview-dialog-DUS21naY.js} +1 -1
  206. package/dist/client/assets/{preview-panel-CDP6cBjX.js → preview-panel-D7uUNbcL.js} +1 -1
  207. package/dist/client/assets/{preview-tab-D0WJzTBj.js → preview-tab-Ahs-yhYv.js} +3 -3
  208. package/dist/client/assets/{product-picker-dialog-BlOnxTDw.js → product-picker-dialog-C2vgULGa.js} +1 -1
  209. package/dist/client/assets/{profile-BN8Spa_O.js → profile-DDNj47eG.js} +1 -1
  210. package/dist/client/assets/project-app-view-CuA06XiE.js +1 -0
  211. package/dist/client/assets/{project-apps-DEEaqSDI.js → project-apps-DWbss0KI.js} +1 -1
  212. package/dist/client/assets/{project-icon-CwIKfNXv.js → project-icon-BUFanmLS.js} +1 -1
  213. package/dist/client/assets/{project-index-ykrov_ra.js → project-index-7p2eseSo.js} +1 -1
  214. package/dist/client/assets/project-reports-DvoGEV_S.js +1 -0
  215. package/dist/client/assets/{project-sidebar-views-fTZB7Z_k.js → project-sidebar-views-pH1XKMU9.js} +1 -1
  216. package/dist/client/assets/project-tasks-3w3MRdO3.js +1 -0
  217. package/dist/client/assets/{projects-CVzMOpxL.js → projects-DLcZ2EUB.js} +1 -1
  218. package/dist/client/assets/{projects-empty-state-6Kka4G3W.js → projects-empty-state-5N5mL8dT.js} +1 -1
  219. package/dist/client/assets/{prompts-CVdkm21t.js → prompts-D_luUyMG.js} +1 -1
  220. package/dist/client/assets/record-editor-CuEUlJ7c.js +1 -0
  221. package/dist/client/assets/{redirect-editor-B-nqVvUE.js → redirect-editor-CFnitpju.js} +1 -1
  222. package/dist/client/assets/{reports-_wFENoO-.js → reports-BORTq3kl.js} +1 -1
  223. package/dist/client/assets/reports-BllquOlr.js +1 -0
  224. package/dist/client/assets/{reports-onboarding-BN9xyNeS.js → reports-onboarding-BWbcZ2GX.js} +1 -1
  225. package/dist/client/assets/{reports-tab-Ca8ZNDWh.js → reports-tab-B-Hn1LIV.js} +2 -2
  226. package/dist/client/assets/repositories-B1CtO4Nn.js +1 -0
  227. package/dist/client/assets/{repositories-BRLQ6722.js → repositories-BVZQH-sB.js} +1 -1
  228. package/dist/client/assets/{repository-binding-kEo67YAA.js → repository-binding-B7kVJGqt.js} +1 -1
  229. package/dist/client/assets/{repository-picker-DtUL_pmI.js → repository-picker-CjOhm0Ey.js} +1 -1
  230. package/dist/client/assets/{require-capability-Zb9L0UB5.js → require-capability-CJKpnzPC.js} +1 -1
  231. package/dist/client/assets/{required-auth-layout-a7ktq9mi.js → required-auth-layout-Cv1Or1o2.js} +1 -1
  232. package/dist/client/assets/{reset-password-DRN2uuu1.js → reset-password-DW52Np0r.js} +1 -1
  233. package/dist/client/assets/{resizable-K-LVkIyE.js → resizable-DyfDlaKB.js} +1 -1
  234. package/dist/client/assets/{resolve-tab-icon-CoWGlUuO.js → resolve-tab-icon-BA6C6Jfy.js} +1 -1
  235. package/dist/client/assets/{review-settings-Ddi1WLdb.js → review-settings-DV90EMNs.js} +1 -1
  236. package/dist/client/assets/{role-color-BctdkWBx.js → role-color-BCYUEsYA.js} +1 -1
  237. package/dist/client/assets/{roles-DrAmbc9_.js → roles-BuwDNuGG.js} +1 -1
  238. package/dist/client/assets/route-6u2HC7D0.js +1 -0
  239. package/dist/client/assets/{route-BKCGrPKZ.js → route-CVmwmVAO.js} +1 -1
  240. package/dist/client/assets/{route-CrqRe4gQ.js → route-kdlreTx0.js} +1 -1
  241. package/dist/client/assets/{sandbox-lifecycle-context-Dk4p8Va5.js → sandbox-lifecycle-context-CNzI4oJx.js} +1 -1
  242. package/dist/client/assets/{schema-DI0DUCq8.js → schema-BJHp07rJ.js} +1 -1
  243. package/dist/client/assets/{schema-iAJ4pGqb.js → schema-iQl5fqzx.js} +1 -1
  244. package/dist/client/assets/{scroll-area-jaG-waNH.js → scroll-area-ASqVshf_.js} +1 -1
  245. package/dist/client/assets/{search-input-DotNkIYu.js → search-input-CpR7MF4a.js} +1 -1
  246. package/dist/client/assets/{search-toggle-BEuCPCyS.js → search-toggle-Y8EXpMEc.js} +1 -1
  247. package/dist/client/assets/{secret-picker-DD55lNbu.js → secret-picker-Br5fCyJR.js} +1 -1
  248. package/dist/client/assets/{secrets-CpTTyplo.js → secrets-B5CgD_04.js} +1 -1
  249. package/dist/client/assets/{section-array-field-q3hyC_SJ.js → section-array-field-DVc_SUaS.js} +1 -1
  250. package/dist/client/assets/{sections-editor-IZCF9AF5.js → sections-editor-lkKcQFno.js} +1 -1
  251. package/dist/client/assets/{sections-TT75Kv4G.js → sections-zGZh6wSh.js} +1 -1
  252. package/dist/client/assets/{select-CCYd2TPQ.js → select-Bc6SUkDB.js} +1 -1
  253. package/dist/client/assets/{select-model-CKv54PS4.js → select-model-DoenYnGG.js} +1 -1
  254. package/dist/client/assets/{seo-editor-C0m4E77v.js → seo-editor-_aB2qgvo.js} +1 -1
  255. package/dist/client/assets/{separator-DeBRxF5d.js → separator-sTUHAoAe.js} +1 -1
  256. package/dist/client/assets/settings-tab-DhF3HWFp.js +1 -0
  257. package/dist/client/assets/{sheet-BSgpG-DI.js → sheet-DplVXaxG.js} +1 -1
  258. package/dist/client/assets/{shell-layout-BYhWS3vs.js → shell-layout-n8ud5acT.js} +1 -1
  259. package/dist/client/assets/{site-draft-actions-C_Fp0n5R.js → site-draft-actions-D6MDFwbu.js} +1 -1
  260. package/dist/client/assets/{site-draft-view-apRQq9-Y.js → site-draft-view-KDIF-X3e.js} +1 -1
  261. package/dist/client/assets/site-editor-By4hUbCH.js +1 -0
  262. package/dist/client/assets/site-editor-toast-C6zgUX0e.js +1 -0
  263. package/dist/client/assets/{skills-Cf6NSvOp.js → skills-C0c78VRl.js} +1 -1
  264. package/dist/client/assets/{slider-DkWue6jL.js → slider-GSuedGm_.js} +1 -1
  265. package/dist/client/assets/{sortable.esm-B9jCn7Jf.js → sortable.esm-BIp1gAsr.js} +1 -1
  266. package/dist/client/assets/{sso-CVKKJgrT.js → sso-CYU8G0dx.js} +1 -1
  267. package/dist/client/assets/{suggestion-BZ3yYe8g.js → suggestion-CyNVbkov.js} +1 -1
  268. package/dist/client/assets/{switch-CT_-wvDo.js → switch-Ddk_-Adw.js} +1 -1
  269. package/dist/client/assets/{synced-repos-iMCXg49s.js → synced-repos-BoVbsdN8.js} +1 -1
  270. package/dist/client/assets/{tab-icon-glyph-C69zFBTl.js → tab-icon-glyph-Bib8sDT3.js} +1 -1
  271. package/dist/client/assets/{table-B2yq1HU_.js → table-CDpozwVb.js} +1 -1
  272. package/dist/client/assets/{tabs-tnJgzRLS.js → tabs-BBBKV7Oj.js} +1 -1
  273. package/dist/client/assets/{task-board-DDcqJlpm.js → task-board-CIxtWADL.js} +1 -1
  274. package/dist/client/assets/{task-route-BCTxfyfM.js → task-route-nL6YBqpT.js} +1 -1
  275. package/dist/client/assets/{task-status-BEHN2G02.js → task-status-BdHIH5wb.js} +1 -1
  276. package/dist/client/assets/{taskboard-analytics-Buy1SOLE.js → taskboard-analytics-WYvo8iIi.js} +1 -1
  277. package/dist/client/assets/tasks-Cdzrrdaz.js +1 -0
  278. package/dist/client/assets/{tasks-CE0DiwPA.js → tasks-gq6y7TQx.js} +1 -1
  279. package/dist/client/assets/{textarea-yOWP9JYC.js → textarea-kPu_uJPE.js} +1 -1
  280. package/dist/client/assets/{thread-analytics-tbdaEPzR.js → thread-analytics-D6Pq3tuN.js} +1 -1
  281. package/dist/client/assets/{thread-intent-nQKoAtIt.js → thread-intent-H43pIrGm.js} +1 -1
  282. package/dist/client/assets/{thread-route-D3RMPPhn.js → thread-route-D5BZJ8B8.js} +1 -1
  283. package/dist/client/assets/{thread-route-CaTSdvjC.js → thread-route-DAi-GZ9V.js} +1 -1
  284. package/dist/client/assets/{thread-sheet-body-DWlZ0AuE.js → thread-sheet-body-G_9F28Tw.js} +1 -1
  285. package/dist/client/assets/{time-range-picker-DW4m3Fj7.js → time-range-picker-DE66qw6Q.js} +1 -1
  286. package/dist/client/assets/{toggle-group-ChdMftEA.js → toggle-group-C6-doG0i.js} +1 -1
  287. package/dist/client/assets/{tool-namespace-BZTsC2dJ.js → tool-namespace-B7QKcZjk.js} +1 -1
  288. package/dist/client/assets/{tool-set-selector-BQzr6TGk.js → tool-set-selector-BQ0Oxag8.js} +1 -1
  289. package/dist/client/assets/{toolbar-icon-button-BX9f9dfy.js → toolbar-icon-button-CcKPaKCW.js} +1 -1
  290. package/dist/client/assets/{tooltip-DgFw0k5f.js → tooltip-DkKVKER8.js} +1 -1
  291. package/dist/client/assets/{tooltipContext-DWz55G6n.js → tooltipContext-B3txDLR-.js} +1 -1
  292. package/dist/client/assets/{track-vG379Xgy.js → track-BIP36_Uh.js} +1 -1
  293. package/dist/client/assets/{types-C4p5J4i3.js → types-DADZ5j7m.js} +1 -1
  294. package/dist/client/assets/{url-slug-Cn4QUCu9.js → url-slug-ChYq0W60.js} +1 -1
  295. package/dist/client/assets/{usage-stats-QxuZaLxO.js → usage-stats-32tsZUXd.js} +1 -1
  296. package/dist/client/assets/{use-ai-providers-BlqN6sFc.js → use-ai-providers-CoMFtqYl.js} +1 -1
  297. package/dist/client/assets/{use-apply-named-rule-Dl2Ggjjn.js → use-apply-named-rule-BQlrOJWU.js} +1 -1
  298. package/dist/client/assets/use-ask-in-chat-hvqpSKkf.js +1 -0
  299. package/dist/client/assets/{use-automations-CU4k5FoP.js → use-automations-D6Y5V5w7.js} +1 -1
  300. package/dist/client/assets/{use-autosave-AwrL44So.js → use-autosave-Bhnkuzh5.js} +1 -1
  301. package/dist/client/assets/use-blocks-v8-project-DhlWbUca.js +1 -0
  302. package/dist/client/assets/{use-chat-layout-state-DL_MZ1dS.js → use-chat-layout-state-D7aW6a0C.js} +1 -1
  303. package/dist/client/assets/{use-cms-publish-actions-wj8dD2ct.js → use-cms-publish-actions-DXLjbxwu.js} +1 -1
  304. package/dist/client/assets/{use-connect-companion-DPKbGRzH.js → use-connect-companion-C7vylwX0.js} +1 -1
  305. package/dist/client/assets/{use-connection-DPOM6dGj.js → use-connection-lpdRo-uP.js} +1 -1
  306. package/dist/client/assets/{use-content-sync-DbirYUIB.js → use-content-sync-CoMrJcv7.js} +1 -1
  307. package/dist/client/assets/{use-copy-Bn2_BzAq.js → use-copy-DNHp83li.js} +1 -1
  308. package/dist/client/assets/{use-date-fns-locale-C6ew7srm.js → use-date-fns-locale-CjJNXfvB.js} +1 -1
  309. package/dist/client/assets/{use-debounced-autosave-CxdIMhCd.js → use-debounced-autosave-CocwDpD-.js} +1 -1
  310. package/dist/client/assets/{use-debounced-value-WdYCpwhX.js → use-debounced-value-DklROaCE.js} +1 -1
  311. package/dist/client/assets/{use-deco-credits-C82siBHu.js → use-deco-credits-ev_UnwK6.js} +1 -1
  312. package/dist/client/assets/{use-decopilot-events-BV_lXdgc.js → use-decopilot-events-DsbeE0fY.js} +1 -1
  313. package/dist/client/assets/{use-delete-connection-CXdEQvu3.js → use-delete-connection-D9EOjdNd.js} +1 -1
  314. package/dist/client/assets/{use-deployment-admin-DaUkmiAb.js → use-deployment-admin-BD_xFjSG.js} +1 -1
  315. package/dist/client/assets/{use-entitlements-D-Q_nl4X.js → use-entitlements-CEKmKdX0.js} +1 -1
  316. package/dist/client/assets/{use-fast-preview-draft-url-WItEabV5.js → use-fast-preview-draft-url-BfmpOxim.js} +1 -1
  317. package/dist/client/assets/{use-file-configs-Crafuymh.js → use-file-configs-CGC2NdjT.js} +1 -1
  318. package/dist/client/assets/{use-id-selection-BIJ8AX1K.js → use-id-selection-DL9yj-Hm.js} +1 -1
  319. package/dist/client/assets/{use-inbox-feed-D-ssKZpB.js → use-inbox-feed-BIp7PHrk.js} +1 -1
  320. package/dist/client/assets/{use-infinite-scroll-fIo7cuNC.js → use-infinite-scroll-Cd1N4jMv.js} +1 -1
  321. package/dist/client/assets/{use-join-requests-Cr7MSHze.js → use-join-requests-dwGw3ubc.js} +1 -1
  322. package/dist/client/assets/use-main-panel-tabs-DBPTQANw.js +1 -0
  323. package/dist/client/assets/{use-mcp-auth-status-B2DJG7bc.js → use-mcp-auth-status-D0tSzrht.js} +1 -1
  324. package/dist/client/assets/{use-mcp-client-D5PLD4qt.js → use-mcp-client-BkZUf1G1.js} +1 -1
  325. package/dist/client/assets/{use-mcp-prompts-D9F_AaJG.js → use-mcp-prompts-ogj31Wyv.js} +1 -1
  326. package/dist/client/assets/{use-mcp-tools-BMLxikig.js → use-mcp-tools-CRGCgSi0.js} +1 -1
  327. package/dist/client/assets/{use-mobile-DRrjjVo-.js → use-mobile-Brbs-D5v.js} +1 -1
  328. package/dist/client/assets/{use-move-blocks-DRRRafPk.js → use-move-blocks-X2wSIdhe.js} +1 -1
  329. package/dist/client/assets/{use-navigate-to-agent-rsGycZF7.js → use-navigate-to-agent-De0vzDZt.js} +1 -1
  330. package/dist/client/assets/{use-org-fs-Dwn0EOt5.js → use-org-fs-DSsFMzTw.js} +1 -1
  331. package/dist/client/assets/{use-org-repo-syncs-D8rrVqZZ.js → use-org-repo-syncs-DEF2HBAf.js} +1 -1
  332. package/dist/client/assets/{use-org-sso-ChcM6ORm.js → use-org-sso-DatsrvZR.js} +1 -1
  333. package/dist/client/assets/{use-organization-settings-DGtBK5Oe.js → use-organization-settings-CyexoMCC.js} +1 -1
  334. package/dist/client/assets/{use-project-scope-CiDCxjqm.js → use-project-scope-BIVViTXo.js} +1 -1
  335. package/dist/client/assets/{use-recent-apps-XmK10nlo.js → use-recent-apps-CYuwpxqr.js} +1 -1
  336. package/dist/client/assets/use-reports-diagnostic-CAzZagV3.js +1 -0
  337. package/dist/client/assets/{use-sandbox-events-Bq9A93g4.js → use-sandbox-events-DxPsGHpR.js} +1 -1
  338. package/dist/client/assets/{use-secrets-Dkprxq3w.js → use-secrets-CpdnK-89.js} +1 -1
  339. package/dist/client/assets/{use-section-preview-base-DM-846AX.js → use-section-preview-base-9hC7oJo0.js} +1 -1
  340. package/dist/client/assets/{use-sidebar-collapsed-ODbl6tJi.js → use-sidebar-collapsed-BbD-3i3N.js} +1 -1
  341. package/dist/client/assets/{use-tags-C9uawszR.js → use-tags-Bt88S1Fh.js} +1 -1
  342. package/dist/client/assets/{use-task-board-analytics-923fGIFt.js → use-task-board-analytics-BTkEPZTH.js} +1 -1
  343. package/dist/client/assets/{use-task-board-events-8V_2rJ4q.js → use-task-board-events-C_Du1Z0W.js} +1 -1
  344. package/dist/client/assets/{use-task-board-item-prs-7hUD8mce.js → use-task-board-item-prs-vSYpxSpr.js} +1 -1
  345. package/dist/client/assets/{use-task-board-items-CJKrgsc2.js → use-task-board-items-D8dDcoyT.js} +1 -1
  346. package/dist/client/assets/{use-task-board-prompts-VxpkhWca.js → use-task-board-prompts-BSaKlopF.js} +1 -1
  347. package/dist/client/assets/{use-task-metadata-DWgHyEF3.js → use-task-metadata-BF4el6FI.js} +1 -1
  348. package/dist/client/assets/{use-thread-outputs-BwXyGaNo.js → use-thread-outputs-CzwE74V7.js} +1 -1
  349. package/dist/client/assets/{use-voice-input-uD40DPmP.js → use-voice-input-Ct26_ckB.js} +1 -1
  350. package/dist/client/assets/useInfiniteQuery-BNB4wMo9.js +1 -0
  351. package/dist/client/assets/{useQueries-BPVhq8ix.js → useQueries-D0Ic2OLL.js} +1 -1
  352. package/dist/client/assets/useSuspenseInfiniteQuery-DUZAeMjh.js +1 -0
  353. package/dist/client/assets/{users-Chcd5Rxh.js → users-CcZNVW1C.js} +1 -1
  354. package/dist/client/assets/{utils-BIFmS1TT.js → utils-CVwSOtNq.js} +1 -1
  355. package/dist/client/assets/{variant-calendar-7ZR-M1ix.js → variant-calendar-bvYuncUl.js} +1 -1
  356. package/dist/client/assets/{variant-matcher-override-LwZc-3hp.js → variant-matcher-override-JfQvd5m1.js} +1 -1
  357. package/dist/client/assets/{view-header-BQHcyKnO.js → view-header-3XIW6_JX.js} +1 -1
  358. package/dist/client/assets/{virtual-mcp-U5XZzfSG.js → virtual-mcp-Ba39VAch.js} +1 -1
  359. package/dist/client/assets/{watch-sse-pool-CMjB6F6-.js → watch-sse-pool-CcLpshxd.js} +1 -1
  360. package/dist/client/index.html +1 -1
  361. package/dist/server/server.js +778 -727
  362. package/package.json +1 -1
  363. package/dist/client/assets/ReferenceLine-BWJSu1DO.js +0 -1
  364. package/dist/client/assets/agent-app-BgTND6J2.js +0 -1
  365. package/dist/client/assets/agent-deck-D4mWjyc2.js +0 -1
  366. package/dist/client/assets/agent-experiments-Cie0yKpB.js +0 -1
  367. package/dist/client/assets/agent-library-BGAtPAnF.js +0 -1
  368. package/dist/client/assets/agent-library-file-BiIBcHvG.js +0 -1
  369. package/dist/client/assets/agent-overview-CR-dCL6h.js +0 -1
  370. package/dist/client/assets/agent-settings-CfxZCODh.js +0 -1
  371. package/dist/client/assets/agent-site-editor-code-CkFLAR_7.js +0 -2
  372. package/dist/client/assets/agent-site-editor-content-B9iT0QSE.js +0 -1
  373. package/dist/client/assets/agent-site-editor-preview-CaYM7sgM.js +0 -1
  374. package/dist/client/assets/agent-view-Cd0hZBcv.js +0 -1
  375. package/dist/client/assets/api-keys-cBMCz_xx.js +0 -1
  376. package/dist/client/assets/automations-DvlDC4kP.js +0 -1
  377. package/dist/client/assets/cms-store-drafts-VJAKdhLe.js +0 -1
  378. package/dist/client/assets/library-BL7Y0RCS.js +0 -1
  379. package/dist/client/assets/project-app-view-CFbUaLRI.js +0 -1
  380. package/dist/client/assets/project-reports-dGxWnXSL.js +0 -1
  381. package/dist/client/assets/project-tasks-D9abvA2D.js +0 -1
  382. package/dist/client/assets/record-editor-Co1jxiVZ.js +0 -1
  383. package/dist/client/assets/reports-mX_6jbjb.js +0 -1
  384. package/dist/client/assets/repositories-BZes21ms.js +0 -1
  385. package/dist/client/assets/route-C7yj3pAQ.js +0 -1
  386. package/dist/client/assets/settings-tab-C6VFnmgD.js +0 -1
  387. package/dist/client/assets/site-editor-DaTnC4GN.js +0 -1
  388. package/dist/client/assets/site-editor-toast-BNwhrRf9.js +0 -1
  389. package/dist/client/assets/tasks-BWwZ8vjL.js +0 -1
  390. package/dist/client/assets/use-ask-in-chat-B83kUKgj.js +0 -1
  391. package/dist/client/assets/use-blocks-v8-project-DW3Lf4gT.js +0 -1
  392. package/dist/client/assets/use-main-panel-tabs-BriP2KR6.js +0 -1
  393. package/dist/client/assets/use-reports-diagnostic-DOgSx3yJ.js +0 -1
  394. package/dist/client/assets/useInfiniteQuery-f_imkp8-.js +0 -1
  395. package/dist/client/assets/useSuspenseInfiniteQuery-C9R0dxHf.js +0 -1
@@ -0,0 +1 @@
1
+ import{c as u,r as g,j as n,J as G,a0 as F,a as E,l as O,b as P,n as y,L as H}from"./index-Cm-moWa5.js";import{C as M}from"./chat-context-O7Uim5zw.js";import{C as x}from"./index-CJj8VLTq.js";import{L}from"./index-O8I8IW_m.js";import{B as V}from"./blocks-preview-workspace-context-BKKCrT_T.js";import{e as T,p as J,s as K,a as W,r as U,T as $,u as R,b as z}from"./site-editor-toast-C6zgUX0e.js";import{u as q,L as B,P as Q,S as X}from"./preview-tab-Ahs-yhYv.js";import{C as Y}from"./content-tab-eUiPWbq7.js";import{T as Z}from"./tab-icon-glyph-Bib8sDT3.js";import{r as tt}from"./resolve-tab-icon-BA6C6Jfy.js";import et from"./agent-site-editor-CZ_aX5w6.js";import"./autosend-DDd9ei6A.js";import"./thread-route-D5BZJ8B8.js";import"./use-project-scope-BIVViTXo.js";import"./repository-binding-B7kVJGqt.js";import"./use-mcp-client-BkZUf1G1.js";import"./auth-Ds2S-lbe.js";import"./thread-intent-H43pIrGm.js";import"./delay-CnY5UFtP.js";import"./watch-sse-pool-CcLpshxd.js";import"./task-board-CIxtWADL.js";import"./schema-iQl5fqzx.js";import"./use-entitlements-CEKmKdX0.js";import"./use-ai-providers-CoMFtqYl.js";import"./use-decopilot-events-DsbeE0fY.js";import"./use-organization-settings-CyexoMCC.js";import"./use-mobile-Brbs-D5v.js";import"./use-sidebar-collapsed-BbD-3i3N.js";import"./use-chat-layout-state-D7aW6a0C.js";import"./agent-icon-CRaK_2eb.js";import"./AlertCircle-C8lUSNa8.js";import"./Tool01-CuDHSO34.js";import"./ArrowUp-DjenQeZQ.js";import"./ArrowLeft-BW0QTKlw.js";import"./LinkBroken01-DfOqWtEB.js";import"./ShoppingBag01-BsFRFwoQ.js";import"./Globe04-B7JSn39b.js";import"./CheckCircle-CBLXbFFB.js";import"./ChevronUp-Dg02PCVC.js";import"./ChevronSelectorVertical-ofVA6B_w.js";import"./UserSquare-DqOeWgs_.js";import"./CreditCard01-F1q7cqMP.js";import"./SwitchHorizontal01-CMdcXPwO.js";import"./Key01-DPrG8yA6.js";import"./Minus-CtT-IgpU.js";import"./Monitor01-CY6I-T_v.js";import"./Sun-BPyrKfqp.js";import"./Play-Cb465MQD.js";import"./Plus-EDJqelyG.js";import"./SearchMd-BM1-RWQF.js";import"./Trash01-Bif7g_Tq.js";import"./Upload01-Drv81LKH.js";import"./Users01-DSPCiWrI.js";import"./XClose-CFLo0iwC.js";import"./Zap-TzUnnTO5.js";import"./tooltip-DkKVKER8.js";import"./index-CZmp59DI.js";import"./toolbar-icon-button-CcKPaKCW.js";import"./shell-layout-n8ud5acT.js";import"./use-deployment-admin-BD_xFjSG.js";import"./admin-fetch-BhTJlAsX.js";import"./command-BO5QH15f.js";import"./index-BZnluLX8.js";import"./integration-icon-CDajRnkl.js";import"./project-icon-BUFanmLS.js";import"./use-navigate-to-agent-De0vzDZt.js";import"./new-project-dialog-DHaEULY3.js";import"./label-BwDzqaMo.js";import"./repository-picker-CjOhm0Ey.js";import"./github-icon-Dq39pEMT.js";import"./useInfiniteQuery-BNB4wMo9.js";import"./infiniteQueryObserver-D6uRpwx5.js";import"./collection-search-AauU22W8.js";import"./use-debounced-value-DklROaCE.js";import"./required-auth-layout-Cv1Or1o2.js";import"./use-org-sso-DatsrvZR.js";import"./sheet-DplVXaxG.js";import"./resizable-DyfDlaKB.js";import"./core.esm-CiyyLnsG.js";import"./sortable.esm-BIp1gAsr.js";import"./context-menu-BG18ePnL.js";import"./create-organization-dialog-DeokYGJM.js";import"./form-CQzCiA7m.js";import"./project-apps-DWbss0KI.js";import"./use-recent-apps-CYuwpxqr.js";import"./use-voice-input-Ct26_ckB.js";import"./popover-DLErjFx_.js";import"./drawer-DMRnFsxc.js";import"./index-DDHS6uH4.js";import"./checkbox-Dj1_p-oY.js";import"./select-Bc6SUkDB.js";import"./index-BdQq_4o_.js";import"./ai-providers-logos-DD3qZ33J.js";import"./openai-compatible-presets-BKGfVqEx.js";import"./use-blocks-v8-project-DhlWbUca.js";import"./sandbox-url-D3mC8qhT.js";import"./utils-CVwSOtNq.js";import"./use-sandbox-events-DxPsGHpR.js";import"./sandbox-git-api-DcqI6XE4.js";import"./parse-sections-DfTZ3uiV.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-CQCTPbi0.js";import"./collapsible-Bp1-V-Fv.js";import"./use-copy-DNHp83li.js";import"./usage-stats-32tsZUXd.js";import"./tool-namespace-B7QKcZjk.js";import"./utils-CVEq3hMx.js";import"./markdown-BukU_dP8.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-C-v6StvL.js";import"./types-DADZ5j7m.js";import"./omit-server-managed-metadata-L5IhjRZB.js";import"./use-connection-lpdRo-uP.js";import"./use-mcp-prompts-ogj31Wyv.js";import"./use-thread-outputs-CzwE74V7.js";import"./file-type-icon-BgvZ7mJ5.js";import"./section-array-field-DVc_SUaS.js";import"./blocks-tab-states-D0oTw6gu.js";import"./empty-state-B44K4GDI.js";import"./hosted-reconcile-C-OJGDnV.js";import"./slider-GSuedGm_.js";import"./index-B541Z8pm.js";import"./tooltipContext-B3txDLR-.js";import"./CategoricalChart-DCWzRRkG.js";import"./index-DfAh0E81.js";import"./switch-Ddk_-Adw.js";import"./textarea-kPu_uJPE.js";import"./scroll-area-ASqVshf_.js";import"./monaco-editor-BNkAcsUY.js";import"./editor-BTYObZ3D.js";import"./calendar-DuGzMi3S.js";import"./editor-classes-DIdZ5SUW.js";import"./toggle-group-C6-doG0i.js";import"./active-indicator-CCMhAsc_.js";import"./combobox-dI6mnh2K.js";import"./search-input-CpR7MF4a.js";import"./tabs-BBBKV7Oj.js";import"./use-file-configs-CGC2NdjT.js";import"./asset-utils-BxC41cma.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./sandbox-lifecycle-context-CNzI4oJx.js";import"./variant-matcher-override-JfQvd5m1.js";import"./use-fast-preview-draft-url-BfmpOxim.js";import"./useQueries-D0Ic2OLL.js";import"./device-hint-Z9_uJm09.js";import"./alert-D9FiKroy.js";import"./virtual-mcp-Ba39VAch.js";import"./url-slug-ChYq0W60.js";import"./app-preview-url-9Od4s8Sz.js";import"./agent-capabilities-Z6OO2Jnk.js";import"./preview-source-BsRLGWUP.js";import"./use-task-metadata-BF4el6FI.js";import"./view-header-3XIW6_JX.js";import"./use-cms-publish-actions-DXLjbxwu.js";import"./use-content-sync-CoMrJcv7.js";import"./mustache-CIeVDhQo.js";import"./date-utils-CrvIKg-s.js";import"./use-move-blocks-X2wSIdhe.js";import"./badge-BpuDiibz.js";import"./empty-state-BTVsC7xK.js";import"./collection-table-wrapper-qRDLH-yA.js";import"./table-CDpozwVb.js";import"./site-draft-actions-D6MDFwbu.js";import"./separator-sTUHAoAe.js";import"./cms-store-drafts-DiBAZwre.js";import"./serial-task-queue-CGOeQgpr.js";import"./index-D8rwwuoa.js";import"./input-DhrW1toc.js";import"./icon-button-BxjZlrnJ.js";import"./chat-draft-CP7W66gO.js";import"./use-deco-credits-ev_UnwK6.js";import"./input-Blfx4aW7.js";import"./suggestion-CyNVbkov.js";import"./use-org-fs-DSsFMzTw.js";import"./question-004-sINsf4GQ.js";import"./feature-paywall-BAqosyy1.js";import"./plan-ladder-DPpGlKZx.js";import"./add-connection-dialog-Bj8rQn7t.js";import"./extract-connection-data-BAO6488m.js";import"./metadata-D72DunRR.js";import"./connection-BmfrUVUF.js";import"./connection-card-Dyl9jamP.js";import"./connection-slug-D9QF6JTj.js";import"./schema-BJHp07rJ.js";import"./connection-form-helpers-DkXWTd-5.js";import"./authenticate-and-persist-oauth-D8AvdBCW.js";import"./mcp-oauth-CxEXOBcT.js";import"./mcp-oauth-CY66kpRN.js";import"./collection-tabs-DO7nBfoY.js";import"./use-infinite-scroll-Cd1N4jMv.js";import"./useSuspenseInfiniteQuery-DUZAeMjh.js";import"./use-task-board-events-C_Du1Z0W.js";import"./save-changes-debug-nBi-n9eV.js";import"./site-draft-view-KDIF-X3e.js";function I(e){return e.kind==="unavailable"&&e.source==="local"&&(e.problem?.reason??"not-answering")==="not-answering"}const ot=e=>e;function it(e){const t=u.c(10),{candidates:o,invalidLink:c,shell:m,editor:i}=e,r=c===void 0?!1:c,s=m===void 0?ot:m,[p,l]=g.useState(null);if(p){let f;t[0]===Symbol.for("react.memo_cache_sentinel")?(f=()=>l(null),t[0]=f):f=t[0];let h;return t[1]!==p||t[2]!==i?(h=i(p,f),t[1]=p,t[2]=i,t[3]=h):h=t[3],h}let a;t[4]!==o||t[5]!==r?(a=n.jsx(rt,{candidates:o,invalidLink:r,onConnect:l}),t[4]=o,t[5]=r,t[6]=a):a=t[6];let d;return t[7]!==s||t[8]!==a?(d=s(a),t[7]=s,t[8]=a,t[9]=d):d=t[9],d}function rt(e){const t=u.c(17),{candidates:o,invalidLink:c,onConnect:m}=e,i=c===void 0?!1:c,[r]=G(),{language:s}=r;let p;t[0]!==m?(p=N=>m({endpoint:N}),t[0]=m,t[1]=p):p=t[1];let l;t[2]!==o||t[3]!==p?(l={candidates:o,onFound:p},t[2]=o,t[3]=p,t[4]=l):l=t[4];const a=q(l),{state:d,access:f,needsGesture:h}=a;let k;t[5]!==o||t[6]!==s?(k=new Intl.ListFormat(s,{style:"long",type:"conjunction"}).format(o.map(T)),t[5]=o,t[6]=s,t[7]=k):k=t[7];const C=k;let S;t[8]!==f||t[9]!==a.start||t[10]!==h||t[11]!==d?(S=f==="denied"?{kind:"denied"}:h?{kind:"needs-gesture",onStart:a.start}:d.problem?{kind:"problem",problem:d.problem,host:T(d.problem.endpoint)}:{kind:"looking",paused:d.status==="paused"},t[8]=f,t[9]=a.start,t[10]=h,t[11]=d,t[12]=S):S=t[12];const _=S;let j;return t[13]!==C||t[14]!==i||t[15]!==_?(j=n.jsx(B,{wait:_,hosts:C,invalidLink:i}),t[13]=C,t[14]=i,t[15]=_,t[16]=j):j=t[16],j}const v="deco-serve",w="working-tree",nt={id:"",slug:"",name:"",logo:null},st={id:v,slug:v},mt={virtualMcpId:v,taskId:null,openTask:()=>{},createTask:()=>"",createTaskWithMessage:()=>{},activeTask:null,isThreadLocked:!1,lockedHarness:null,lockedBranch:null,currentBranch:w,setCurrentTaskBranch:()=>{}};function pt(){const e=window.location.hash,t=new URLSearchParams(e.replace(/^#/,"")).has("endpoint"),o=t?J(e):null;return t&&window.history.replaceState(null,"",window.location.pathname+window.location.search),o&&K(o),{candidates:W(o,U()),invalidLink:t&&!o}}const at=[{id:"site-editor",to:"/site-editor",label:"preview"},{id:"content",to:"/site-editor/content",label:"content"}];function ct(){const e=u.c(6),t=P();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={select:lt},e[0]=o):o=e[0];const c=O(o);let m;e[1]!==t||e[2]!==c?(m=at.map(r=>n.jsx(y.Tab,{asChild:!0,active:c==="content"==(r.id==="content"),children:n.jsxs(H,{to:r.to,activeOptions:{exact:!0},children:[n.jsx("span",{"aria-hidden":"true",className:"flex size-4 shrink-0 items-center justify-center",children:n.jsx(Z,{icon:tt({tabId:r.id,kind:"system",connections:[]})})}),t(`common.mainPanelTabs.${r.label}`)]})},r.id)),e[1]=t,e[2]=c,e[3]=m):m=e[3];let i;return e[4]!==m?(i=n.jsx(y.Tabs,{children:m}),e[4]=m,e[5]=i):i=e[5],i}function lt(e){return e.matches.at(-1)?.staticData.siteEditorView}function A(e){const t=u.c(14),{children:o}=e,c=P(),{connection:m}=z(v),i=R(v,w);let r,s;if(t[0]!==i||t[1]!==o||t[2]!==m||t[3]!==c){s=Symbol.for("react.early_return_sentinel");t:{if(r=m?T(m.endpoint):"",i.kind==="protocol"){s=o;break t}if(i.kind!=="unavailable"||I(i)){s=n.jsx(X,{headingLevel:2,waiting:!0,title:c("decoServe.connect.reaching",{host:r})});break t}}t[0]=i,t[1]=o,t[2]=m,t[3]=c,t[4]=r,t[5]=s}else r=t[4],s=t[5];if(s!==Symbol.for("react.early_return_sentinel"))return s;let p;t[6]!==i.problem?(p=i.problem??{reason:"not-answering"},t[6]=i.problem,t[7]=p):p=t[7];let l;t[8]!==r||t[9]!==p?(l={kind:"problem",problem:p,host:r},t[8]=r,t[9]=p,t[10]=l):l=t[10];let a;return t[11]!==r||t[12]!==l?(a=n.jsx(B,{wait:l,hosts:r}),t[11]=r,t[12]=l,t[13]=a):a=t[13],a}function dt(e){const t=u.c(6),{onLost:o}=e,c=R(v,w);let m;t[0]!==c?(m=I(c),t[0]=c,t[1]=m):m=t[1];const i=m;let r,s;return t[2]!==i||t[3]!==o?(r=()=>{i&&o()},s=[i,o],t[2]=i,t[3]=o,t[4]=r,t[5]=s):(r=t[4],s=t[5]),g.useEffect(r,s),null}const D={threadOpen:!1,contentOpen:!0,threadVisibilityExplicit:!1,toggleThread:()=>{},toggleContent:()=>{}};function ut(){const e=u.c(11),{data:t}=E.useSession();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={select:ft},e[0]=o):o=e[0];const c=O(o),m=!!t?.user;let i;e[1]!==m?(i={rail:m},e[1]=m,e[2]=i):i=e[2];const r=c??"preview";let s,p,l;e[3]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(ct,{}),p=n.jsx(x.Thread,{children:null}),l=n.jsx(et,{}),e[3]=s,e[4]=p,e[5]=l):(s=e[3],p=e[4],l=e[5]);let a;e[6]!==r?(a=n.jsx(L.Content,{children:n.jsxs(x,{...D,threadless:!0,contentKey:r,contentNavigation:s,children:[p,l]})}),e[6]=r,e[7]=a):a=e[7];let d;return e[8]!==i||e[9]!==a?(d=n.jsx(L,{outsideOrg:i,children:a}),e[8]=i,e[9]=a,e[10]=d):d=e[10],d}function ft(e){return e.matches.at(-1)?.staticData.siteEditorView}function ht(e){const t=u.c(8),{children:o}=e,{data:c}=E.useSession(),m=!!c?.user;let i;t[0]!==m?(i={rail:m},t[0]=m,t[1]=i):i=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(x.Thread,{children:null}),t[2]=r):r=t[2];let s;t[3]!==o?(s=n.jsx(L.Content,{children:n.jsxs(x,{...D,threadless:!0,contentKey:"guide",children:[r,n.jsx(x.Content,{children:o})]})}),t[3]=o,t[4]=s):s=t[4];let p;return t[5]!==i||t[6]!==s?(p=n.jsx(L,{outsideOrg:i,children:s}),t[5]=i,t[6]=s,t[7]=p):p=t[7],p}const b=()=>{},vt={connection:null,set:b,clear:b};function Yi(){const e=u.c(3),[t]=g.useState(pt);let o;return e[0]!==t.candidates||e[1]!==t.invalidLink?(o=n.jsx(F,{org:nt,project:st,children:n.jsx(it,{candidates:t.candidates,invalidLink:t.invalidLink,shell:kt,editor:xt})}),e[0]=t.candidates,e[1]=t.invalidLink,e[2]=o):o=e[2],o}function xt(e,t){return n.jsxs($.Provider,{value:{connection:e,set:b,clear:b},children:[n.jsx(dt,{onLost:t}),n.jsx(M,{value:mt,children:n.jsx(V,{children:n.jsx(ut,{})})})]})}function kt(e){return n.jsx($.Provider,{value:vt,children:n.jsx(ht,{children:e})})}function Zi(){const e=u.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(A,{children:n.jsx(Q,{virtualMcpId:v})}),e[0]=t):t=e[0],t}function tr(){const e=u.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(A,{children:n.jsx(Y,{virtualMcpId:v})}),e[0]=t):t=e[0],t}export{tr as SiteEditorContent,Zi as SiteEditorPreview,Yi as default};
@@ -0,0 +1 @@
1
+ import{eP as P,eQ as y,c as R,q as Z,i as F,K as g,eR as Ae,aB as mn,aF as Sn,aG as yn,r as M,a as En,at as _e,a5 as On,by as yt,eS as Dn,eT as kn,eU as Et,ar as In,bo as Ot,bh as B,eV as _n,eW as Tn,eX as q,eY as Pn,eZ as Rn,e_ as ee,e$ as xn,f0 as Dt,f1 as $n,f2 as kt,f3 as Nn,f4 as jn,a3 as Cn,f5 as An,t as te,j as Y}from"./index-Cm-moWa5.js";import{u as It}from"./use-voice-input-Ct26_ckB.js";import{s as nt}from"./thread-intent-H43pIrGm.js";import{u as Le}from"./use-blocks-v8-project-DhlWbUca.js";import{b as me}from"./sandbox-url-D3mC8qhT.js";import{s as Ln}from"./utils-CVwSOtNq.js";import{u as Ue}from"./repository-binding-B7kVJGqt.js";import{u as Un}from"./chat-context-O7Uim5zw.js";import{i as Mn,u as Fn}from"./use-sandbox-events-DxPsGHpR.js";import{a as Qn}from"./sandbox-git-api-DcqI6XE4.js";const K="deco-content",Te={major:1},_t=1;async function Vn(e){let t=new Uint8Array(await e.arrayBuffer());if(t[0]===31&&t[1]===139){const n=new Blob([t]).stream().pipeThrough(new DecompressionStream("gzip"));t=new Uint8Array(await new Response(n).arrayBuffer())}return JSON.parse(new TextDecoder().decode(t))}const Pe={major:Te.major,minor:_t},Tt=`the endpoint speaks an older ${K} than this client needs (${Pe.major}.${Pe.minor} or newer): update @decocms/blocks in the site (8.2.0 or newer) and start deco serve again`;function ae(e,t,n){const o={reason:t,required:{...Pe}};if(n){o.actual={protocol:n.protocol,major:n.version?.major,minor:n.version?.minor};const r=n.server;typeof r?.name=="string"&&typeof r.version=="string"&&(o.server={name:r.name,version:r.version})}return new P(y.Unsupported,e,o)}function Pt(e){const t=e??{},{protocol:n,version:o}=t;if(n!==K)throw ae(`the endpoint speaks ${JSON.stringify(n)}, not ${K}`,"protocol",t);if(o?.major!==Te.major)throw ae(`the endpoint speaks ${K} ${String(o?.major)}.x; this client speaks ${Te.major}.x`,"major",t);if(typeof o.minor!="number"||o.minor<_t)throw ae(Tt,"outdated",t);return e}function ot(e,t){return t.code===y.MethodNotFound&&e.startsWith("changes.")?ae(Tt,"outdated"):P.from(t)}function Me(e){const t=e.fetch??(s=>fetch(s));let n=1;async function o(s){const i={"content-type":"application/json",accept:"application/json",...e.headers},a=await t(new Request(e.endpoint,{method:"POST",headers:i,body:JSON.stringify(s)}));let l;try{l=await Vn(a)}catch{throw new P(y.Unavailable,`the endpoint answered HTTP ${a.status} without a JSON-RPC body`)}if(!a.ok||!Array.isArray(l)&&l?.id===null){const c=l?.error;throw c?P.from(c):new P(y.Unavailable,`the endpoint answered HTTP ${a.status}`)}return l}const r=async(s,i)=>{const a=n++,l=await o({jsonrpc:"2.0",id:a,method:s,params:i??{}});if(l.error)throw ot(s,l.error);return l.result};return{call:r,describe:async()=>Pt(await r("describe")),schemaGet:s=>r("schema.get",s),blocksList:s=>r("blocks.list",s),blocksApply:s=>r("blocks.apply",s),changesList:s=>r("changes.list",s),changesGet:s=>r("changes.get",s),changesDiscard:s=>r("changes.discard",s),async batch(s){const i=s.map(()=>n++),a=await o(s.map((c,f)=>({jsonrpc:"2.0",id:i[f],method:c.method,params:c.params??{}}))),l=new Map(a.map(c=>[c.id,c]));return i.map((c,f)=>{const u=l.get(c);return u?u.error?{ok:!1,error:ot(s[f].method,u.error)}:{ok:!0,result:u.result}:{ok:!1,error:new P(y.InternalError,"no response for this call")}})}}}function Fe(e){return e&&!e.edited?{ifNoneMatch:e.revision}:{}}const rt=20,st=5,it=500;function Qe(e){return e instanceof P?e.code===y.MethodNotFound?!0:e.code===y.Unsupported&&e.data?.reason==="outdated":!1}function he(e,t){return t.notModified?e?{...e,base:t.base}:null:{revision:t.revision,base:t.base,changes:t.changes}}async function Bn(e,t,n){const o=g.contentChanges(n),r=e.getQueryData(o),s=await t.changesList(Fe(r)),i=he(r,s);if(i)return i;const a=await t.changesList({});return he(void 0,a)}async function Rt(e,t){const n=[];for(let s=0;s<t.length;s+=rt)n.push(t.slice(s,s+rt));const o=Object.create(null),r=[];for(let s=0;s<n.length;s+=st){const i=await e.batch(n.slice(s,s+st).map(a=>({method:"changes.get",params:{names:a}})));for(const a of i){if(!a.ok)throw a.error;const l=a.result;Object.assign(o,l.entries),r.push(...l.diagnostics)}}return{entries:o,diagnostics:r}}async function Hr(e,t){let n={revision:"",versions:{}};for(let o=0;o<t.length;o+=it){const r=t.slice(o,o+it),s=await e.changesDiscard({names:r.map(i=>i.name),ifMatch:Object.fromEntries(r.map(i=>[i.name,i.version]))});n={revision:s.revision,versions:{...n.versions,...s.versions}}}return n}function Jr(e){return e instanceof P&&e.code===y.Conflict}function Ve(e){return e?.kind==="protocol"?e:null}function Wr(e,t,n){const o=R.c(14);let r;o[0]!==n?(r={},o[0]=n,o[1]=r):r=o[1];const s=r,i=Z();let a;o[2]!==e?(a=Ve(e),o[2]=e,o[3]=a):a=o[3];const l=a,c=!!l&&!!t&&s.enabled!==!1;let f;o[4]!==t?(f=g.contentChanges(t??""),o[4]=t,o[5]=f):f=o[5];let u;o[6]!==t||o[7]!==c||o[8]!==l||o[9]!==i?(u=c?()=>Bn(i,l.client,t):Ae,o[6]=t,o[7]=c,o[8]=l,o[9]=i,o[10]=u):u=o[10];let d;return o[11]!==f||o[12]!==u?(d={queryKey:f,queryFn:u,staleTime:0},o[11]=f,o[12]=u,o[13]=d):d=o[13],F(d)}function Gr(e,t,n){const o=R.c(14);let r;o[0]!==e?(r=Ve(e),o[0]=e,o[1]=r):r=o[1];const s=r;let i;o[2]!==n?(i=n?Object.keys(n.changes):[],o[2]=n,o[3]=i):i=o[3];const a=i,l=!!s&&!!t&&!!n&&a.length>0;let c;o[4]!==t||o[5]!==n?.revision?(c=g.contentChangeSides(t??"",n?.revision??""),o[4]=t,o[5]=n?.revision,o[6]=c):c=o[6];let f;o[7]!==l||o[8]!==a||o[9]!==s?(f=l?()=>Rt(s.client,a):Ae,o[7]=l,o[8]=a,o[9]=s,o[10]=f):f=o[10];let u;return o[11]!==c||o[12]!==f?(u={queryKey:c,queryFn:f,staleTime:Number.POSITIVE_INFINITY},o[11]=c,o[12]=f,o[13]=u):u=o[13],F(u)}function Yr(e,t,n){const o=R.c(16);let r;o[0]!==e?(r=Ve(e),o[0]=e,o[1]=r):r=o[1];const s=r;let i,a,l,c;if(o[2]!==t||o[3]!==n?.changes||o[4]!==s){const d=Object.entries(n?.changes??{}).filter(Yn).map(Gn).sort(Wn);a=d.map(Jn);const h=JSON.stringify(d.map(Hn));i=!!s&&!!t&&a.length>0,c=F,l=g.contentDeletedCopies(t??"",h),o[2]=t,o[3]=n?.changes,o[4]=s,o[5]=i,o[6]=a,o[7]=l,o[8]=c}else i=o[5],a=o[6],l=o[7],c=o[8];let f;o[9]!==i||o[10]!==a||o[11]!==s?(f=i?async()=>{const d=await Rt(s.client,a),h=Object.create(null);for(const[b,v]of Object.entries(d.entries))h[b]=v.before&&typeof v.before=="object"?v.before:null;return h}:Ae,o[9]=i,o[10]=a,o[11]=s,o[12]=f):f=o[12];let u;return o[13]!==l||o[14]!==f?(u={queryKey:l,queryFn:f,staleTime:Number.POSITIVE_INFINITY,placeholderData:mn},o[13]=l,o[14]=f,o[15]=u):u=o[15],c(u)}function Hn(e){return[e.name,e.base]}function Jn(e){return e.name}function Wn(e,t){return e.name<t.name?-1:e.name>t.name?1:0}function Gn(e){const[t,n]=e;return{name:t,base:n.baseVersion??""}}function Yn(e){const[,t]=e;return t.kind==="delete"}function xt(e){try{const t=new URL(e);if(t.protocol!=="http:"&&t.protocol!=="https:")return!1;const n=t.hostname.toLowerCase();return n==="127.0.0.1"||n==="[::1]"||n==="localhost"}catch{return!1}}function ge(e){try{const t=new URL(e);return(t.hostname==="127.0.0.1"||t.hostname==="[::1]")&&(t.hostname="localhost"),t.href}catch{return e}}const $t=Sn({endpoint:yn().max(2048).refine(e=>xt(e)&&new URL(e).pathname==="/rpc").transform(ge)});function zr(e){const t=new URLSearchParams(e.replace(/^#/,"")),n=$t.safeParse({endpoint:t.get("endpoint")??""});return n.success?n.data:null}function Nt(e){const t=$t.safeParse(e);return t.success?t.data:null}const jt="studio:deco-serve-last";function Xr(e){try{localStorage.setItem(jt,JSON.stringify(e))}catch{}}function Zr(){try{const e=localStorage.getItem(jt);return e?Nt(JSON.parse(e)):null}catch{return null}}function qr(e){try{return new URL(ge(e)).host}catch{return e}}function zn(e,t=1e4){return Math.min(1e3*2**Math.max(0,e-1),t)}const Xn="http://localhost:4545/rpc";class Be extends Error{constructor(t="the endpoint isn't deco serve"){super(t),this.name="NotDecoServeError"}}function Zn(e){if(e instanceof Be)return{reason:"not-deco-serve"};if(!(e instanceof P))return{reason:"not-answering"};switch(e.code){case y.Unauthorized:case y.MethodNotFound:return{reason:"outdated"};case y.Unsupported:return Qe(e)?{reason:"outdated"}:{reason:"version-mismatch"};case y.Unavailable:return/^the endpoint answered HTTP/.test(e.message)?{reason:"not-deco-serve"}:{reason:"error",detail:e.message};default:return{reason:"error",detail:e.message}}}function Kr(e,t){if(e)return[ge(e.endpoint)];const n=[t?.endpoint,Xn].filter(o=>!!o).map(ge);return[...new Set(n)]}const Ct=M.createContext(null);function qn(e){const t=R.c(24),n=M.useContext(Ct),o=Le(n?null:e),{data:r}=En.useSession(),s=r?.user?.id??"",i=!!e&&!!s;let a;t[0]!==i||t[1]!==s||t[2]!==e?(a=i?_e.decoServeConnection(s,e):null,t[0]=i,t[1]=s,t[2]=e,t[3]=a):a=t[3];const[l,c]=ct(a);let f;t[4]!==i||t[5]!==s||t[6]!==e?(f=i?_e.decoServeEndpoint(s,e):null,t[4]=i,t[5]=s,t[6]=e,t[7]=f):f=t[7];const[u,d]=ct(f);if(n)return n;let h;t[8]!==l||t[9]!==i||t[10]!==o?(h=i&&o?Nt(l):null,t[8]=l,t[9]=i,t[10]=o,t[11]=h):h=t[11];const b=h,v=i&&o&&typeof u=="string"?u:null;let m;t[12]!==d||t[13]!==c||t[14]!==i?(m=x=>{i&&(c(x),d(x.endpoint))},t[12]=d,t[13]=c,t[14]=i,t[15]=m):m=t[15];let E;t[16]!==c||t[17]!==i?(E=()=>{i&&c(null)},t[16]=c,t[17]=i,t[18]=E):E=t[18];let S;return t[19]!==b||t[20]!==v||t[21]!==m||t[22]!==E?(S={connection:b,lastEndpoint:v,set:m,clear:E},t[19]=b,t[20]=v,t[21]=m,t[22]=E,t[23]=S):S=t[23],S}function at(e){try{const t=localStorage.getItem(e);return t===null?null:JSON.parse(t)}catch{return null}}function ct(e){const t=R.c(17),n=Z(),o=e??"";let r;t[0]!==o?(r=["localStorage",o],t[0]=o,t[1]=r):r=t[1];const s=r;let i,a;t[2]!==e?(i=()=>e?at(e):null,a=()=>e?at(e):null,t[2]=e,t[3]=i,t[4]=a):(i=t[3],a=t[4]);const l=!!e;let c;t[5]!==s||t[6]!==i||t[7]!==a||t[8]!==l?(c={queryKey:s,queryFn:i,initialData:a,enabled:l,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY},t[5]=s,t[6]=i,t[7]=a,t[8]=l,t[9]=c):c=t[9];const{data:f}=F(c);let u;t[10]!==e||t[11]!==n||t[12]!==s?(u=v=>{if(e){try{v===null?localStorage.removeItem(e):localStorage.setItem(e,JSON.stringify(v))}catch{}n.setQueryData(s,v)}},t[10]=e,t[11]=n,t[12]=s,t[13]=u):u=t[13];const d=u,h=e?f??null:null;let b;return t[14]!==d||t[15]!==h?(b=[h,d],t[14]=d,t[15]=h,t[16]=b):b=t[16],b}function es(e){return e.kind==="protocol"||e.kind==="unavailable"}function ts(e){const t=e.hasOrg?e.orgFlag:!1,{backend:n}=e;return n===null||n==="legacy"?t:!0}function ns(e,t,n){return t!=="github"||!n?!1:e.kind==="pending"?!0:e.kind==="unavailable"&&e.siteNotOwned?!1:(e.kind==="protocol"||e.kind==="unavailable")&&e.source==="github"}function os(e){if(e.kind!=="protocol"||e.source!=="local")return null;const t=e.describe.preview?.url;return t&&xt(t)?t:null}function rs(e,t){return e.kind!=="protocol"||e.source!=="local"||!e.describe.assets||!t?null:new URL(t.endpoint).origin}function At(e){return e.hasServeConnection?"local":e.runtime==="sandbox"?"sandbox":"github"}function Kn(e){if(!e.hasProject)return"legacy";const t=At(e);if(t==="local")return"protocol-local";if(!e.v8)return"legacy";if(t==="sandbox"){const o=e.sandboxSite;return o==="ready"?"protocol-sandbox":o==="error"?"retrying-sandbox":"pending"}const n=e.githubSite;return n==="ready"?"protocol-github":n==="not-owned"?"site-not-owned-github":n==="error"?"unavailable-github":"pending"}function eo(e){return{github:e.v8&&e.mode==="github",sandbox:e.v8&&e.mode==="sandbox"&&e.workingTreeReady}}function lt(e){return e.isError||e.errorUpdateCount>0}function to(e,t,n){if(!t||n.size===0)return e;const o={...e};for(const r of n)Object.hasOwn(t,r)?o[r]=t[r]:delete o[r];return o}function no(e){if(!e||typeof e!="object")return[];const t=e,n=[];return typeof t.blockKey=="string"&&n.push(t.blockKey),t.writes&&typeof t.writes=="object"&&n.push(...Object.keys(t.writes)),Array.isArray(t.deletes)&&n.push(...t.deletes.filter(o=>typeof o=="string")),n}const Lt="__noSchema";function Ut(){return{manifest:{blocks:{}},schema:{definitions:{},root:{}},[Lt]:!0}}function ss(e){return!!e&&e[Lt]===!0}function He(e){if(!e.ok)return e.error.code===y.NotFound;const t=e.result;return t.notModified===!1&&t.schema===null}function oo(e,t){return(typeof t.name=="string"?t.name.trim():"")||e}const ro=(e,t)=>e.label.localeCompare(t.label)||e.key.localeCompare(t.key);function is(e){const t=new Map;for(const[n,o]of Object.entries(e)){const r=o&&typeof o=="object"&&!Array.isArray(o)?o:{},s=typeof r.__resolveType=="string"?r.__resolveType:null,i=t.get(s)??[];i.push({key:n,label:oo(n,r)}),t.set(s,i)}return[...t.entries()].map(([n,o])=>({resolveType:n,blocks:o.sort(ro)})).sort((n,o)=>n.resolveType===null?1:o.resolveType===null?-1:ut(n.resolveType).localeCompare(ut(o.resolveType))||n.resolveType.localeCompare(o.resolveType))}function ut(e){return(e.split("/").filter(Boolean).at(-1)??e).replace(/\.(tsx?|jsx?)$/,"")||e}function ft(e,t,n){if(t.length===0)return n;const[o,...r]=t;if(Array.isArray(e)&&typeof o=="number"){const s=e.slice();return s[o]=ft(e[o],r,n),s}if(e&&typeof e=="object"&&typeof o=="string"){const s=e,i={};for(const a of Object.keys(s))i[a]=a===o?ft(s[a],r,n):s[a];return i}return e}function as(e){if(e.trim()==="")return null;const t=Number(e);return Number.isFinite(t)?t:null}class dt extends Error{}const Je="site-not-owned";async function so(e){return e.status!==409?!1:(await e.clone().json().catch(()=>null))?.code==="site_not_owned"}async function io(e,t=n=>fetch(n)){const n=Me({endpoint:e,fetch:async o=>{const r=await t(o);if(await so(r))throw new dt;return r}});try{return await Ge(n)}catch(o){if(o instanceof dt)return Je;throw o}}async function ao(e,t,n){await t();const o=await io(e,n);return o===Je?o:{...o,hosted:Dn(e,n)}}const We=5e3;function co(e){if(!e.site)throw new Error("this project names no site");return kn(e.site,e.branch)}function lo(e){return new URL(me(e,"rpc"),window.location.origin).href}async function Ge(e){const[t,n]=await e.batch([{method:"describe"},{method:"schema.get"}]);if(!t?.ok)throw t?.error??new Error("no describe");if(t.result?.protocol!==K)throw new Be;const r=Pt(t.result);if(!n)throw new Error("no schema.get");if(He(n))return{client:e,describe:r,hasSchema:!1};if(n.ok)return{client:e,describe:r,hasSchema:!0};throw n.error}function uo(e,t=n=>fetch(n)){return Ge(Me({endpoint:e,fetch:t}))}function re(e,t){const n=R.c(50),{org:o}=On(),{connection:r}=qn(e),{runtime:s}=It(e),i=M.useContext(Ct),a=Le(e),l=yt(Ue(e)?.metadata),c=At({hasServeConnection:!!r,runtime:s}),f=Un()?.taskId??null,u=Mn(Fn().lifecycle.phase),d=Z(),h=eo({mode:c,v8:a,workingTreeReady:u}),b=h.github&&!!o.slug&&!!e&&!!t,v=F({queryKey:g.contentBackend(o.slug,e??"",t??"","github"),queryFn:()=>ao(co({orgSlug:o.slug,site:l,branch:t}),()=>Et(l,t)),enabled:b,staleTime:Number.POSITIVE_INFINITY,...ht}),m=h.sandbox&&!!o.slug&&!!e&&!!t;let E;n[0]!==t||n[1]!==o.slug||n[2]!==f||n[3]!==e?(E=()=>uo(lo({orgSlug:o.slug,virtualMcpId:e,branch:t,threadId:f})),n[0]=t,n[1]=o.slug,n[2]=f,n[3]=e,n[4]=E):E=n[4];const S=F({queryKey:g.contentBackend(o.slug,e??"",t??"","sandbox",f??""),queryFn:E,enabled:m,staleTime:Number.POSITIVE_INFINITY,...ht}),x=!!r;let _;n[5]!==r?.endpoint||n[6]!==o.slug||n[7]!==e?(_=g.contentBackend(o.slug,e??"","local",r?.endpoint??""),n[5]=r?.endpoint,n[6]=o.slug,n[7]=e,n[8]=_):_=n[8];let N;n[9]!==r?(N=()=>Ge(Me({endpoint:r.endpoint})),n[9]=r,n[10]=N):N=n[10];let $;n[11]!==x||n[12]!==_||n[13]!==N?($={queryKey:_,queryFn:N,enabled:x,staleTime:Number.POSITIVE_INFINITY,retry:go,retryDelay:ho,refetchInterval:fo},n[11]=x,n[12]=_,n[13]=N,n[14]=$):$=n[14];const w=F($);let L;n[15]!==r?.endpoint||n[16]!==o.slug||n[17]!==e?(L=g.contentBackend(o.slug,e??"","local",r?.endpoint??""),n[15]=r?.endpoint,n[16]=o.slug,n[17]=e,n[18]=L):L=n[18];const k=L;let T;n[19]!==r?.endpoint||n[20]!==o.slug||n[21]!==e?(T=g.contentBackend(o.slug,e??"","local-describe",r?.endpoint??""),n[19]=r?.endpoint,n[20]=o.slug,n[21]=e,n[22]=T):T=n[22];let j;n[23]!==w.data||n[24]!==k||n[25]!==d?(j=async()=>{try{return await w.data.client.describe()}catch(p){const J=p;throw d.invalidateQueries({queryKey:k,exact:!0},{cancelRefetch:!1}),J}},n[23]=w.data,n[24]=k,n[25]=d,n[26]=j):j=n[26];const C=!!w.data&&!i;let D;n[27]!==T||n[28]!==j||n[29]!==C?(D={queryKey:T,queryFn:j,enabled:C,refetchInterval:We,retry:!1},n[27]=T,n[28]=j,n[29]=C,n[30]=D):D=n[30];const A=F(D).data??w.data?.describe,I=Kn({hasProject:!!e,hasServeConnection:!!r,runtime:s,v8:a,githubSite:v.data===Je?"not-owned":v.data?"ready":lt(v)?"error":"loading",sandboxSite:vo({data:S.data,isError:lt(S),workingTreeReady:u})});if(I==="pending"){let p;return n[31]===Symbol.for("react.memo_cache_sentinel")?(p={kind:"pending"},n[31]=p):p=n[31],p}if(I==="retrying-sandbox"){let p;return n[32]===Symbol.for("react.memo_cache_sentinel")?(p={kind:"pending",retrying:"sandbox"},n[32]=p):p=n[32],p}if(I==="legacy"){let p;return n[33]===Symbol.for("react.memo_cache_sentinel")?(p={kind:"legacy"},n[33]=p):p=n[33],p}if(I==="protocol-github"){const p=v.data;let J;n[34]!==p?(J=Re("github",p,""),n[34]=p,n[35]=J):J=n[35];let se;return n[36]!==l||n[37]!==J?(se={...J,site:l},n[36]=l,n[37]=J,n[38]=se):se=n[38],se}if(I==="site-not-owned-github"){let p;return n[39]===Symbol.for("react.memo_cache_sentinel")?(p={kind:"unavailable",source:"github",siteNotOwned:!0},n[39]=p):p=n[39],p}if(I==="protocol-sandbox"){let p;return n[40]!==S.data?(p=Re("sandbox",S.data,":sandbox"),n[40]=S.data,n[41]=p):p=n[41],p}if(I==="unavailable-github"){let p;return n[42]===Symbol.for("react.memo_cache_sentinel")?(p={kind:"unavailable",source:"github"},n[42]=p):p=n[42],p}const Q=w.error??w.failureReason,O=r?.endpoint??"";let V;return n[43]!==A||n[44]!==w.data||n[45]!==w.failureCount||n[46]!==w.isError||n[47]!==O||n[48]!==Q?(V=wo({probed:w.data,isError:w.isError,failureCount:w.failureCount,failure:Q,describe:A,endpoint:O}),n[43]=A,n[44]=w.data,n[45]=w.failureCount,n[46]=w.isError,n[47]=O,n[48]=Q,n[49]=V):V=n[49],V}function fo(e){return e.state.status==="error"||e.state.data?.hasSchema===!1?We:!1}function ho(e){return zn(e+1)}function go(e,t){return!(t instanceof P)&&!(t instanceof Be)}function vo(e){return e.data!==void 0?"ready":e.workingTreeReady?e.isError?"error":"loading":"unavailable"}const bo=3;function wo(e){const t=e.probed?Re("local",{...e.probed,describe:e.describe??e.probed.describe},`:serve:${e.endpoint}`):null;return e.isError||e.failureCount>0?t?.kind==="protocol"&&!e.isError&&e.failureCount<bo?t:{kind:"unavailable",source:"local",problem:Zn(e.failure)}:t??{kind:"pending"}}const ht={retry:2,refetchInterval:e=>e.state.status==="error"?We:!1};function Re(e,t,n){return{kind:"protocol",source:e,client:t.client,describe:t.describe,cacheKeySuffix:n,hasSchema:t.hasSchema,...t.hosted?{hosted:t.hosted}:{}}}function Mt(e){const t=R.c(12);let n;t[0]!==e?(n=_e.localPreviewUrl(e??""),t[0]=e,t[1]=n):n=t[1];const o=n,[r,s]=In(o,null),i=Le(e);let a;t[2]!==r||t[3]!==e?(a=e?nt(r):null,t[2]=r,t[3]=e,t[4]=a):a=t[4];const c=i?null:a;let f,u;t[5]!==s?(f=h=>s(nt(h)),u=()=>s(null),t[5]=s,t[6]=f,t[7]=u):(f=t[6],u=t[7]);let d;return t[8]!==c||t[9]!==f||t[10]!==u?(d={url:c,setUrl:f,clear:u},t[8]=c,t[9]=f,t[10]=u,t[11]=d):d=t[11],d}function po(e,t){const n=(e??"").trim().replace(/^[/\\]+|[/\\]+$/g,"");return n?`${n}/${t}`:t}function gt(e){let t;try{t=JSON.parse(e)}catch{return null}return typeof t!="object"||t===null||Array.isArray(t)?null:t}function Se(e,t,n){return["decofile-write",e,t,n]}function mo(e,t,n){return{id:Se(e,t,n).join(":")}}class Ye extends Error{constructor(t,n,o=[],r=!1){super(n),this.blocks=t,this.fields=o,this.carriedStored=r,this.name="BlockConflictError"}blocks;fields;carriedStored}function ze(e){return`${e.orgSlug}/${e.virtualMcpId}/${e.branch}`}function Xe(e){return`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}`}async function So(e,t){const n=await e.json().catch(()=>({}));throw new Error(n.error??`${t} failed (${e.status})`)}function yo(e,t,n){e.setQueryData(g.decofileDraft(ze(t)),n)}function Eo(e,t){return e.getQueryData(g.decofileDraft(ze(t)))??null}async function Oo(e,t){return(await fetch(Xe(e),{cache:"no-store",headers:{"if-none-match":`"${t}"`}}).catch(()=>null))?.status===200}function cs(e){const t=R.c(4);let n;t[0]!==e?(n=g.decofileDraft(e?ze(e):""),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={queryKey:n,enabled:!1,queryFn:Do,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:r}=F(o);return r??null}async function Do(){throw new Error("decofileDraft is populated by reads/writes, not fetched")}async function ko(e,t){const n=await fetch(Xe(t),{cache:"no-store"});if(!n.ok){const r=new Error(`Failed to fetch decofile: ${n.status}`);throw r.status=n.status,r}const o=await n.json();return o.token&&yo(e,t,{version:o.version,token:o.token,apiHost:o.apiHost??window.location.host}),o.decofile}async function ls(e,t){const n=await fetch(Xe(e),{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(n.status===409){const r=await n.json().catch(()=>({}));throw r.code==="block-conflict"?new Ye(r.blocks??[],r.error??"Block changed"):new Error(r.error??`Save failed (${n.status})`)}if(!n.ok)return So(n,"Save");const o=await n.json();return{...o,apiHost:o.apiHost??window.location.host}}const Ft=3e3,Io=15e3,_o=2*6e4,Qt={now:()=>Date.now(),setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),hidden:()=>typeof document<"u"&&document.visibilityState==="hidden"};function To(e){return e<_o?Ft:Io}function Po(e,t=Qt){const n=t.now();let o=!1,r=!1,s=null;const i=()=>{o||(s=t.setTimeout(a,To(t.now()-n)))},a=()=>{if(s=null,o)return;const{read:l,skip:c}=e();if(r||t.hidden()||c?.()){i();return}r=!0;let f;try{f=l()}catch{f=void 0}Promise.resolve(f).catch(()=>{}).finally(()=>{r=!1}),i()};return i(),()=>{o=!0,s!==null&&t.clearTimeout(s)}}const vt=()=>0;function Ro(e,t,n=Qt){const o=M.useRef(t);o.current=t;const[r]=M.useState(()=>({polling:()=>Po(()=>o.current,n),idle:()=>()=>{}}));M.useSyncExternalStore(e?r.polling:r.idle,vt,vt)}function Vt(e,t){return me(e,t)}function xo(e,t){return me(e,"preview-fetch",{path:t})}function us(e){return Vt(e,"preview-invoke")}function fs(e){return Vt(e,"catalog-invoke")}function Bt(e){try{const{hostname:t}=new URL(e);return t==="localhost"||t.endsWith(".localhost")||t==="127.0.0.1"||t==="::1"}catch{return!1}}function $o(){if(typeof document>"u")return null;const e=Array.from(document.querySelectorAll("iframe"));for(const t of e){const n=t.getAttribute("src");if(n&&Bt(n))return n}return null}function No(e,t){const n=e.previewUrl??e.getFallbackPreviewUrl?.()??$o();return n&&Bt(n)?new URL(t,n).toString():xo(e,t)}function jo(e){return No(e,"/.decofile")}function Co(e){return e===400?"absent":e===404?"unavailable":e>=200&&e<300?"ok":"error"}function bt(e){return e.liveOk||e.committedAbsent?404:e.liveStatus??502}async function Ao(e,t){const n=me(e,"read"),o=await fetch(n,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:t,full:!0})}),r=Co(o.status);if(r==="absent")return{kind:"absent"};if(r==="unavailable")return{kind:"unavailable"};if(r==="error"){const i=new Error(`Failed to read ${t}: ${o.status}`);throw i.status=o.status,i}const s=await o.json();return typeof s.content!="string"?{kind:"unavailable"}:{kind:"data",data:Ln(s.content)}}async function Lo(e,t){const n=await Ao(e,t);if(n.kind!=="data")return n;try{return{kind:"data",data:JSON.parse(n.data)}}catch{return{kind:"unavailable"}}}async function ds(e){const t=`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}/meta`,n=await fetch(t,{cache:"no-store"});if(n.status===404)return{kind:"absent"};if(!n.ok){const o=new Error(`Failed to read committed meta: ${n.status}`);throw o.status=n.status,o}try{return{kind:"data",data:await n.json()}}catch{return{kind:"unavailable"}}}function Uo(e){return Ue(e)?.metadata?.runtime?.path??null}class Ht extends Error{constructor(t){super(t instanceof Error?t.message:String(t),{cause:t}),this.name="ServeLostError"}}function hs(e){return e instanceof P&&e.code===y.Conflict}function Jt(e){const t=e.data?.violations;return!Array.isArray(t)||t.length===0?e.message:t.slice(0,3).map(n=>n.message).join("; ")}class Ze extends Error{constructor(){super("The draft's changes couldn't be read"),this.name="HostedDraftUnreadError"}}class qe extends Error{constructor(){super("The blocks kept changing while the change was saved"),this.name="HostedKeptChangingError"}}function gs(e,t){return(t instanceof Ze||t instanceof qe)&&(t.message=Wt(e,t,"github")),t}function Wt(e,t,n){if(t instanceof Ze)return e("siteEditor.save.draftUnread");if(t instanceof qe)return e("siteEditor.save.keptChanging");if(t instanceof Ye)return t.message;if(n==="local")return Fo(e,t);if(t instanceof P)switch(t.code){case y.Conflict:return e("siteEditor.save.conflict");case y.ReadOnly:return e("siteEditor.save.readOnly");case y.InvalidBlock:case y.InvalidParams:return e("siteEditor.save.invalid");case y.LimitExceeded:return e("siteEditor.save.tooLarge")}return e("siteEditor.save.failed")}function Mo(e,t){if(t==="local"||e instanceof Ye||e instanceof Ze||e instanceof qe)return null;if(e instanceof P){const n=e.code===y.InvalidBlock||e.code===y.InvalidParams?Jt(e):e.message;return n?`${e.code}: ${n}`:null}return e.message||null}function Fo(e,t){if(t instanceof Ht)return e("decoServe.save.serverGone");if(t instanceof P)switch(t.code){case y.Conflict:return e("decoServe.save.conflict");case y.ReadOnly:return e("decoServe.save.readOnly");case y.InvalidBlock:case y.InvalidParams:return e("decoServe.save.invalid",{detail:Jt(t)});case y.LimitExceeded:return e("decoServe.save.tooLarge")}return e("sectionsEditor.sectionsEditor.saveFailed",{error:t.message})}function Qo(e,t,n){return e===null?0:Math.max(0,n-Math.max(0,t-e))}function Vo(e,t){const[n,o]=M.useState(e),r=M.useRef(null);return e&&!n&&o(!0),M.useEffect(()=>{if(e){r.current??=Date.now();return}if(!n)return;const s=()=>{r.current=null,o(!1)},i=Qo(r.current,Date.now(),t);if(i===0){s();return}const a=setTimeout(s,i);return()=>clearTimeout(a)},[e,n,t]),n}const Bo="decocms:content-writes",xe=new Set;let G;function Gt(){if(G!==void 0)return G;G=null;try{typeof BroadcastChannel=="function"&&(G=new BroadcastChannel(Bo),G.addEventListener("message",e=>{const t=e.data?.cacheKey;if(typeof t=="string")for(const n of[...xe])n(t)}))}catch{G=null}return G}function Ho(e){try{Gt()?.postMessage({cacheKey:e})}catch{}}function Jo(e){return Gt(),xe.add(e),()=>{xe.delete(e)}}const Yt="__at=",zt="__test=",Wo=/^[0-9a-f]{12}-[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;function Go(e){return e.at!==void 0||Object.keys(e.tests??{}).length>0}function X(e){return typeof e=="string"&&Wo.test(e)}function wt(e){return encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)}function Yo(e){const t=e.tests??{};return[...e.at!==void 0?[Yt+wt(e.at)]:[],...Object.keys(t).map(n=>zt+wt(`${n}=${t[n]?"on":"off"}`))]}function pt(e,t){const o=[...e.split("&").filter(r=>r&&!r.startsWith(Yt)&&!r.startsWith(zt)),...t];return o.length>0?`?${o.join("&")}`:""}function ve(e,t){const n=Yo(t),o=e.indexOf("?"),r=o===-1?e:e.slice(0,o);if(X(r))return r+pt(o===-1?"":e.slice(o+1),n);const s=e.lastIndexOf("@");if(s<=0)return e;const i=e.slice(0,s),a=i.indexOf("?"),l=a===-1?i:i.slice(0,a),c=a===-1?"":i.slice(a+1);return`${l}${pt(c,n)}${e.slice(s)}`}function vs(e,t,n){if(!Go(t))return e;try{const o=new URL(e),r=o.searchParams.get("__draft");return r&&r!=="off"?(o.searchParams.set("__draft",ve(r,t)),o.toString()):X(n)?(o.searchParams.set("__draft",ve(n,t)),o.toString()):e}catch{return e}}function bs(e,t,n="/"){if(!e||!X(t))return null;try{const o=new URL(n,e);return o.searchParams.set("__draft",t),o.toString()}catch{return null}}function Xt(e){return btoa(encodeURIComponent(e))}function ws(e,t,n){const o=zo(e,t,n);return o.searchParams.set("__cb",crypto.randomUUID()),o.toString()}function zo(e,t,n){const o=new URL(e).origin,r=new URL(`/live/previews/${encodeURIComponent(t)}`,o);return r.searchParams.set("path","/"),r.searchParams.set("pathTemplate","/"),r.searchParams.set("props",Xt(JSON.stringify({path:"/",sections:[{__resolveType:n}]}))),r}const Xo="__draft";function ps(e){return`${`${e.apiHost}/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}?token=${e.token}`}@${e.version}`}const Zo="off";function qo(e,t){if(!t)return e;const n=new URL(e);return n.searchParams.set(Xo,t),n.toString()}function ms(e){const t=e.pageBlock.__resolveType;if(typeof t!="string"||!t)return null;const n=new URL(e.previewBaseUrl).origin,o=new URL(`/live/previews/${encodeURIComponent(t)}`,n);o.searchParams.set("__decoFBT","0"),o.searchParams.set("__d",""),o.searchParams.set("path",e.path),o.searchParams.set("pathTemplate",e.pathTemplate);const{__resolveType:r,...s}=e.pageBlock,i=JSON.stringify({__props:s,__decofile:e.decofile});return{src:o.toString(),body:i}}function Ss(e,t,n,o){const r=new URL(e).origin,s=new URL(`/live/previews/${encodeURIComponent(t)}`,r);s.searchParams.set("__d","");const i=[{__resolveType:"preview",block:n}];return o&&i.push(o),s.searchParams.set("props",Xt(JSON.stringify({sections:i}))),s.toString()}function ys(e){return e.fastPreviewActive&&e.previewServerUrl?e.previewServerUrl:e.sandboxUrl??null}const mt="__variant=";function Zt(e,t,n){return`${e}@${t}=${n}`}function Es(e,t){return!e||!t.multivariate||t.variants.length<=1?[]:t.index<0||t.index>=t.variants.length?[]:[Zt(e,"sections",t.index)]}function Os(e){const t=Array.isArray(e.mvObj.variants)?e.mvObj.variants:[];if(!e.pageKey||e.sectionIndex<0)return[];if(e.selectedVariantIndex<0||e.selectedVariantIndex>=t.length)return[];const o=`${e.page.multivariate?`sections.variants.${e.page.index}.value${e.page.lazyValues?".value":""}`:"sections"}.${e.sectionIndex}${e.sectionLazy?".section":""}`;return[Zt(e.pageKey,o,e.selectedVariantIndex)]}function Ds(e,t){return[...t,...e]}function Ko(e){return encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)}function Ke(e,t){const n=e.lastIndexOf("@");if(n<=0)return e;const o=e.slice(0,n),r=o.indexOf("?"),s=r===-1?o:o.slice(0,r),a=[...r===-1?[]:o.slice(r+1).split("&").filter(c=>c&&!c.startsWith(mt)),...t.map(c=>mt+Ko(c))],l=a.length>0?`?${a.join("&")}`:"";return`${s}${l}${e.slice(n)}`}function ks(e,t,n=!1){if(t.length===0&&!n)return null;try{const o=new URL(e),r=o.hostname==="[::1]"?`localhost${o.port?`:${o.port}`:""}`:o.host;return Ke(`${r}${o.pathname}@local`,t)}catch{return null}}function Is(e,t){if(t.length===0)return e;try{const n=new URL(e),o=n.searchParams.get("__draft");return!o||o==="off"?e:(n.searchParams.set("__draft",Ke(o,t)),n.toString())}catch{return e}}function er(e){const{pointer:t}=e;if(!t||t===Zo)return null;const n=t.indexOf("?");return X(n===-1?t:t.slice(0,n))||t.lastIndexOf("@")<=0?null:X(e.heldRevision)&&e.forcedVariants.length===0?ve(e.heldRevision,e.previewOptions):ve(Ke(t,e.forcedVariants),e.previewOptions)}function tr(e,t){if(!e||!t)return null;try{return qo(e,t)}catch{return null}}function _s(e,t,n){if(!e||!n)return null;try{return tr(new URL(t,e).toString(),n)}catch{return null}}const be={forcedVariants:[],previewOptions:{}},ce=new Map,le=new Map,$e=new Map;function qt(e){for(const t of $e.get(e)??[])t()}function Kt(e,t){const n=X(t)?t:null;(le.get(e)??null)!==n&&(n?le.set(e,n):le.delete(e),qt(e))}function nr(e){return le.get(e)??null}function or(e,t){return JSON.stringify(e)===JSON.stringify(t)}function Ts(e,t){const n=ce.get(e)??be,o=t??be;or(n,o)||(t?ce.set(e,o):ce.delete(e),qt(e))}function rr(e){return ce.get(e)??be}function en(e,t){let n=$e.get(e);return n||(n=new Set,$e.set(e,n)),n.add(t),()=>{n.delete(t)}}function sr(e){const t=R.c(3);let n,o;return t[0]!==e?(n=r=>en(e,r),o=()=>rr(e),t[0]=e,t[1]=n,t[2]=o):(n=t[1],o=t[2]),M.useSyncExternalStore(n,o,ir)}function ir(){return be}function ar(e){const t=R.c(3);let n,o;return t[0]!==e?(n=r=>e?en(e,r):lr,o=()=>e?nr(e):null,t[0]=e,t[1]=n,t[2]=o):(n=t[1],o=t[2]),M.useSyncExternalStore(n,o,cr)}function cr(){return null}function lr(){}function Ps(e,t){const n=R.c(4),o=sr(e),r=ar(e);let s;return n[0]!==o||n[1]!==r||n[2]!==t?(s=er({pointer:t,heldRevision:r,...o}),n[0]=o,n[1]=r,n[2]=t,n[3]=s):s=n[3],s}const tn={phase:"idle",inFlight:0,reload:{seq:0,navigates:!1},epoch:0},ur=15e3,we=new Map;function z(e,t){return`${e}/${t}`}function H(e){let t=we.get(e);return t||(t={state:tn,listeners:new Set,previews:0,timer:null,discardListeners:new Set},we.set(e,t)),t}function W(e,t){const n=H(e);n.state={...n.state,...t};for(const o of n.listeners)o()}function ye(e){e.timer&&clearTimeout(e.timer),e.timer=null}function et(e){return we.get(e)?.state??tn}function fr(e,t){const n=H(e);return n.listeners.add(t),()=>{n.listeners.delete(t)}}function Rs(e){const t=H(e);return t.previews++,()=>{t.previews--,t.previews===0&&t.state.phase==="reloading"&&(ye(t),W(e,{phase:"idle"}))}}function xs(e){const t=we.get(e);!t||t.state.phase!=="reloading"||(ye(t),W(e,{phase:"idle"}))}function nn(e){const t=H(e);ye(t),W(e,{phase:"saving",inFlight:t.state.inFlight+1})}function ue(e,t){const n=H(e),o=Math.max(0,n.state.inFlight-1);if(o>0){W(e,{inFlight:o});return}if(!t.ok||n.previews===0){W(e,{phase:"idle",inFlight:o});return}on(e,t.navigates,o)}function on(e,t,n=0){const o=H(e);ye(o),o.timer=setTimeout(()=>{o.timer=null,o.state.phase==="reloading"&&W(e,{phase:"idle"})},ur),W(e,{phase:"reloading",inFlight:n,reload:{seq:o.state.reload.seq+1,navigates:t}})}function dr(e){return e?.kind==="protocol"&&e.source==="github"}async function fe(e,t){const{queryClient:n,orgSlug:o,virtualMcpId:r,branch:s,backend:i,cacheKey:a}=e,l=t.kind==="publish"||t.kind==="reapply"?n.invalidateQueries({queryKey:g.hostedReleases(o,r)}):null;if(i?.kind!=="protocol")return await l,{navigates:!1};const c=s?g.protocolDraftRead(o,r,s):null,f=c?JSON.stringify(n.getQueryData(c)??null):null,u=l?[l]:[];if(a&&t.reread&&u.push(n.invalidateQueries({queryKey:g.decofile(a)})),a&&!t.adopted&&u.push(n.invalidateQueries({queryKey:g.contentChanges(a)})),s&&i.source==="sandbox"&&u.push(n.invalidateQueries({queryKey:Qn(o,r,s)})),dr(i)&&c&&!t.adopted&&u.push(n.invalidateQueries({queryKey:c})),await Promise.all(u),t.kind!=="edit"){const b=z(o,r);W(b,{epoch:et(b).epoch+1})}const d=c?JSON.stringify(n.getQueryData(c)??null):null,h=f!==d;return h&&await new Promise(b=>Ot.schedule(b)),{navigates:h}}async function hr(e,t){return nn(z(e.orgSlug,e.virtualMcpId)),rn(e,t)}function St(e){return e.branch?JSON.stringify(e.queryClient.getQueryData(g.protocolDraftRead(e.orgSlug,e.virtualMcpId,e.branch))??null):null}async function rn(e,t){const n=z(e.orgSlug,e.virtualMcpId),o=t.adopted?St(e):null;let r;try{r=await t.write()}catch(i){throw ue(n,{ok:!1,navigates:!1}),t.refreshOnError&&fe(e,{kind:t.kind,reread:!0}).catch(()=>{}),i}if(e.backend?.kind==="protocol"&&e.cacheKey&&Ho(e.cacheKey),Kt(n,t.shownRevision?.(r)??null),t.adopted){const i=St(e)!==o;return i&&await new Promise(a=>Ot.schedule(a)),ue(n,{ok:!0,navigates:i}),t.reread&&fe(e,t).catch(()=>{}),r}let s=!1;try{({navigates:s}=await fe(e,t))}catch{}finally{ue(n,{ok:!0,navigates:s})}return r}function $s(e,t){const{queryClient:n,orgSlug:o,virtualMcpId:r,branch:s}=e,i=z(o,r),a=new Set(t.blockKeys);for(const f of[...H(i).discardListeners])f(a);nn(i);let l=!1;const c=()=>(l=!0,rn(e,{kind:"discard",reread:!0,write:t.write}));return s?n.getMutationCache().build(n,{mutationKey:Se(o,r,s),scope:mo(o,r,s),mutationFn:c}).execute(void 0).catch(f=>{throw l||ue(i,{ok:!1,navigates:!1}),f}):c()}function Ns(e,t,n){const o=R.c(8);let r;o[0]!==e||o[1]!==t?(r=z(e,t),o[0]=e,o[1]=t,o[2]=r):r=o[2];const s=r;let i;o[3]!==n||o[4]!==s?(i=()=>{const l=H(s).discardListeners;return l.add(n),()=>{l.delete(n)}},o[3]=n,o[4]=s,o[5]=i):i=o[5];let a;o[6]!==s?(a=[s],o[6]=s,o[7]=a):a=o[7],M.useEffect(i,a)}function sn(e){const t=z(e.orgSlug,e.virtualMcpId);et(t).inFlight>0||(Kt(t,null),fe(e,{kind:"external"}).then(({navigates:n})=>{const o=H(t);o.previews>0&&o.state.inFlight===0&&on(t,n)}).catch(()=>{}))}function gr(e,t){const n=R.c(7);let o;n[0]!==e||n[1]!==t?(o=z(e,t),n[0]=e,n[1]=t,n[2]=o):o=n[2];const r=o;let s;n[3]!==r?(s=c=>fr(r,c),n[3]=r,n[4]=s):s=n[4];const i=s;let a;n[5]!==r?(a=()=>et(r),n[5]=r,n[6]=a):a=n[6];const l=a;return M.useSyncExternalStore(i,l,l)}const vr=500;function js(e,t){const{phase:n}=gr(e,t);return Vo(n!=="idle",vr)}function br(e){const t=new Error(`${e} unavailable (content server unreachable)`);return t.status=502,t}function an(e,t){return g.liveMeta(e.orgSlug,e.virtualMcpId,e.branch,`protocol${t.cacheKeySuffix}`,"")}function Cs(e,t,n,o){if(o?.source==="github"){const i=e.getQueryData(g.contentIndex(t));return i?Tn(i,n):wr(e,t,n)}const r=e.getQueryData(g.contentVersions(t));if(!r)return;if(Object.hasOwn(r,n))return r[n];const s=e.getQueryData(g.decofile(t));return s&&Object.hasOwn(s,n)?void 0:null}function ne(e,t){if(Object.hasOwn(e.changes,t))return e.changes[t];const n=B(t),o=Object.keys(e.changes).find(r=>B(r)===n);return o===void 0?void 0:e.changes[o]}function wr(e,t,n){const o=e.getQueryData(g.contentChanges(t));if(o)return cn(o,Ee(e,t),n)}function cn(e,t,n){const o=ne(e,n);return o?.kind==="delete"?o.version??ee:o?o.version:t.has(B(n))?ee:null}function As(e,t,n){const o=e.getQueryData(g.contentChanges(t));if(!o)return!1;const r=ne(o,n);return r?r.kind==="set"&&r.baseVersion===null:Ee(e,t).has(B(n))}function Ls(e,t){const n=e.getQueryData(g.decofile(t)),o=e.getQueryData(g.contentChanges(t));if(!n||!o)return null;const r=Ee(e,t);return{blocks:n,versionOf:s=>cn(o,r,s)}}function Ee(e,t){return new Set(e.getQueryData(g.contentDraftTombstones(t)))}function pe(e,t,n,o){const r=B(n),s=Ee(e,t);s.has(r)!==o&&(o?s.add(r):s.delete(r),q(e),e.setQueryData(g.contentDraftTombstones(t),[...s]))}function ln(e,t,n,o){const r=o.revision,s=e.getQueryData(g.contentVersions(n)),i=Object.entries(o.versions??{}).map(([u,d])=>[u,d===ee?null:d]),a=e.getQueryData(g.contentChanges(n)),l=new Set(i.flatMap(([u])=>{const d=a?ne(a,u):void 0;return(d?d.baseVersion:s?.[u]??null)===null?[u]:[]})),c=new Set(i.flatMap(([u,d])=>d===null?[]:[B(u)]));e.setQueryData(g.contentChanges(n),u=>{if(!u)return u;const d={...u.changes};for(const[h,b]of i){const v=ne(u,h),m=v?v.baseVersion:s?.[h]??null;b!==null?d[h]={kind:"set",version:b,baseVersion:m}:m!==null?d[h]={kind:"delete",version:null,baseVersion:m}:delete d[h]}return{...u,changes:d,edited:!0}});for(const[u,d]of i)d!==null?pe(e,n,u,!1):!c.has(B(u))&&l.has(u)&&pe(e,n,u,!0);const f=o.revision;return f&&f!=="none"&&e.setQueryData(g.protocolDraftRead(t.orgSlug,t.virtualMcpId,t.branch),u=>u&&{...u,version:f}),r}function Oe(e,t,n){q(e),e.setQueryData(g.contentVersions(t),o=>{const r={...o};for(const[s,i]of Object.entries(n))i===null?delete r[s]:r[s]=i;return r})}function un(e,t){const n=e.getMutationCache().findAll({mutationKey:Se(t.orgSlug,t.virtualMcpId,t.branch),status:"pending"});return new Set(n.flatMap(o=>no(o.state.variables)))}function Ne(e,t){e.resetQueries({queryKey:g.contentBackend(t.orgSlug,t.virtualMcpId,"local")})}async function oe(e,t,n,o){try{return await o()}catch(r){const s=!(r instanceof P);throw t.source==="local"&&s?(Ne(e,n),new Ht(r)):(t.source==="local"&&Qe(r)&&Ne(e,n),r)}}const de=new Map;function fn(e,t,n,o){const r=de.get(o);if(r)return r;const s=tt(e,t,n,o,!0);return de.set(o,s),s.finally(()=>de.delete(o))}const ke=new Set;function pr(e,t,n){const o=R.c(8),r=Z(),s=t?.orgSlug,i=t?.virtualMcpId,a=t?.branch;let l,c;o[0]!==e||o[1]!==a||o[2]!==n||o[3]!==s||o[4]!==r||o[5]!==i?(l=()=>{if(!e||!s||!i||!a)return;const f={orgSlug:s,virtualMcpId:i,branch:a};return Jo(u=>{u===n&&(ke.has(n)||(ke.add(n),Sr(r,e,f,n).catch(mr).finally(()=>ke.delete(n))))})},c=[r,e,s,i,a,n],o[0]=e,o[1]=a,o[2]=n,o[3]=s,o[4]=r,o[5]=i,o[6]=l,o[7]=c):(l=o[6],c=o[7]),M.useEffect(l,c)}function mr(){}async function Sr(e,t,n,o){const r=de.get(o);return r&&await r.catch(()=>{}),fn(e,t,n,o)}async function tt(e,t,n,o,r){q(e);const s=g.decofile(o),i=an(n,t),a=g.contentRevision(o),l=g.contentVersions(o),c=e.getQueryData(s),f=e.getQueryData(l),d=e.getQueryData(i),h=e.getQueryData(a)??void 0,b=r&&c&&f?h?.revision:void 0,v=r&&d?h?.schemaVersion:void 0,m=g.contentChanges(o),E=e.getQueryData(m);if(t.source==="github"&&t.hosted)return yr(e,t,t.hosted,n,o,{conditional:r,seen:h,currentMeta:d,schemaIfNoneMatch:v,seenChanges:E});const[S,x,_]=await oe(e,t,n,()=>t.client.batch([{method:"blocks.list",params:b?{ifNoneMatch:b}:{}},{method:"schema.get",params:v?{ifNoneMatch:v}:{}},{method:"changes.list",params:Fe(E)}])),N=e.getQueryData(a)?.revision,$=N!==void 0&&N!==h?.revision;if(_?.ok){const D=$?null:he(E,_.result);D&&e.setQueryData(m,D)}else _&&t.source==="local"&&Qe(_.error)&&Ne(e,n);if(!S?.ok)throw S?.error??new Error("no blocks.list");if(!x)throw new Error("no schema.get");const w=S.result,L=He(x),k=x.ok&&!L?x.result:null;if(w.notModified&&(!c||!f)||k?.notModified&&!d)return tt(e,t,n,o,!1);const T=w.notModified?new Set:un(e,n),j=w.notModified?c:to(w.blocks,c,T),C=L?Ut():k?k.notModified?d:k.schema:x.error;if(e.setQueryData(a,{revision:$?N:w.notModified?h?.revision:w.revision,schemaVersion:k?k.notModified?h?.schemaVersion:k.version??void 0:void 0}),e.setQueryData(s,j),!w.notModified){const D=e.getQueryData(l),U={...w.versions};for(const A of T){const I=D?.[A];I!==void 0?U[A]=I:delete U[A]}e.setQueryData(l,U)}return C instanceof P||e.setQueryData(i,C),!$&&!w.notModified&&c&&h?.revision&&w.revision!==h.revision&&sn({queryClient:e,orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch,backend:t,cacheKey:o}),{blocks:j,meta:C}}async function yr(e,t,n,o,r,s){const i=g.decofile(r),a=g.contentIndex(r),l=g.contentRevision(r),c=g.contentVersions(r),f=an(o,t),u=g.contentChanges(r),d=e.getQueryData(a),h=s.conditional&&d?s.seen?.revision:void 0,[b,v,m]=await oe(e,t,o,()=>n.batch([{method:"cms.index",params:h?{ifNoneMatch:h}:{}},{method:"schema.get",params:s.schemaIfNoneMatch?{ifNoneMatch:s.schemaIfNoneMatch}:{}},{method:"changes.list",params:Fe(s.seenChanges)}])),E=e.getQueryData(a)??d,S=e.getQueryData(l)?.revision,x=S!==void 0&&S!==s.seen?.revision;if(m?.ok&&!x){const O=he(s.seenChanges,m.result);O&&e.setQueryData(u,O)}if(!b?.ok)throw b?.error??new Error("no cms.index");if(!v)throw new Error("no schema.get");const _=b.result,N=He(v),$=v.ok&&!N?v.result:null;if(_.notModified&&!d||$?.notModified&&!s.currentMeta)return tt(e,t,o,r,!1);const w=N?Ut():$?$.notModified?s.currentMeta:$.schema:v.error;w instanceof P||e.setQueryData(f,w);const L=$?$.notModified?s.seen?.schemaVersion:$.version??void 0:void 0,k=e.getQueryData(i)??{};if(_.notModified||x)return e.setQueryData(l,{revision:x?S:s.seen?.revision,schemaVersion:L}),e.setQueryData(i,k),{blocks:k,meta:w};const T={revision:_.revision,resolvedRef:_.resolvedRef,sequence:_.sequence,entries:_.entries,draft:_.draft};e.setQueryData(a,T);const j=!!s.seen?.revision&&T.revision!==s.seen.revision&&(!s.seen.revision.startsWith("s-")||!!d&&dn(d.draft,T.draft));j&&e.setQueryData(g.protocolDraftRead(o.orgSlug,o.virtualMcpId,o.branch),O=>O&&{...O,version:T.revision}),e.setQueryData(l,{revision:T.revision,schemaVersion:L});const C=un(e,o),D=e.getQueryData(c)??{},U={},A={},I=[];for(const[O,V]of Object.entries(k)){const p=T.entries[O];!p&&!C.has(O)||(U[O]=V,D[O]!==void 0&&(A[O]=D[O]),p&&!C.has(O)&&D[O]!==p.version&&I.push(O))}return e.setQueryData(i,U),e.setQueryData(c,A),I.length>0&&await xn(e,n,r,I,C),E&&j&&Er(E,T)&&sn({queryClient:e,orgSlug:o.orgSlug,virtualMcpId:o.virtualMcpId,branch:o.branch,backend:t,cacheKey:r}),{blocks:e.getQueryData(i)??U,meta:w}}function Er(e,t){if(dn(e.draft,t.draft))return!0;const n=Object.keys(t.entries);return n.length!==Object.keys(e.entries).length?!0:n.some(o=>!Object.hasOwn(e.entries,o)||e.entries[o]?.version!==t.entries[o]?.version)}function dn(e,t){const n=Object.keys(t);return n.length!==Object.keys(e).length?!0:n.some(o=>!Object.hasOwn(e,o)||e[o]?.version!==t[o]?.version)}function Or(e,t){const n=[...Object.keys(t.set??{}),...t.delete??[]];return Object.fromEntries(n.filter(o=>Object.hasOwn(e,o)).map(o=>[o,e[o]]))}function Ie(e){if(!(e instanceof P)||e.code!==y.Unavailable)return;const t=e.data?.landed;if(!(!t||typeof t!="object"||Array.isArray(t)))return Object.fromEntries(Object.entries(t).filter(n=>typeof n[1]=="string"))}async function Dr(e,t){if(!(e instanceof P)||e.code!==y.Conflict)return;const n=e.data?.entries;if(!n||typeof n!="object")return;const o=Object.entries(n);if(o.length===0)return;const r=t.set??{},s=new Set(t.delete??[]),i={};for(const[a,l]of o){const c=l?.actual;if(typeof c!="string"||(Object.hasOwn(r,a)?await $n(r[a]):s.has(a)?ee:void 0)!==c)return;i[a]=c}return i}function kr(e,t){const n=Object.fromEntries(Object.entries(e.set??{}).filter(([r])=>!Object.hasOwn(t,r))),o=(e.delete??[]).filter(r=>!Object.hasOwn(t,r));return{...Object.keys(n).length>0?{set:n}:{},...o.length>0?{delete:o}:{}}}function ie(e,t,n,o,r){q(e),ln(e,t,n,{revision:e.getQueryData(g.contentRevision(n))?.revision??"",versions:r}),Oe(e,n,Object.fromEntries(Object.entries(r).map(([s,i])=>[s,i===ee?null:i]))),Dt(e,n,r,o.set??{})}async function Us(e,t,n,o,r,s){if(t.source==="github"){const a=[...Object.keys(r.set??{}),...r.delete??[]].filter(c=>!s||!Object.hasOwn(s,c));if(a.length>0)throw new Error(`A hosted save needs a precondition for every block it touches (missing: ${a.join(", ")})`);const l=_n(r.set);if(l.length>0)throw new Error(`A hosted save can't write a block that isn't loaded (${l.join(", ")})`)}return hr({queryClient:e,orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch,backend:t,cacheKey:o},{kind:"edit",adopted:t.source==="github",write:async()=>{const i=(f,u=s)=>oe(e,t,n,()=>t.client.blocksApply({set:f.set,delete:f.delete,...u?{ifMatch:Or(u,f)}:{}}));let a;try{a=await i(r)}catch(f){const u=t.source==="github"?Ie(f):void 0;if(!u)throw f;const d=kr(r,u);Object.keys(u).length>0&&ie(e,n,o,r,u);let h;try{h=await i(d)}catch(b){const v=Ie(b);v&&Object.keys(v).length>0&&ie(e,n,o,d,v);const m=await Dr(b,d);if(!m)throw b;ie(e,n,o,d,m);try{h=await i(d,{...s,...m})}catch(E){const S=Ie(E);throw S&&Object.keys(S).length>0&&ie(e,n,o,d,S),E}}a={...h,versions:{...u,...h.versions}}}q(e);const l=t.source==="github"?ln(e,n,o,a):a.revision;t.source==="github"&&Dt(e,o,a.versions??{},r.set??{}),e.setQueryData(g.contentRevision(o),f=>({...f,revision:l}));const c=a.versions??{};return Oe(e,o,c),{revision:l,versions:c}}})}function hn(e,t){if(!(e instanceof P))return;const n=e.data?.draft;if(!n||typeof n!="object"||!Object.hasOwn(n,t))return;const o=n[t];return o&&typeof o.version=="string"?o:void 0}function gn(e,t,n){if(!(n instanceof P))return;const o=n.data?.draft;if(!(!o||typeof o!="object"))for(const[r,s]of Object.entries(o))s===null&&pe(e,t,r,!1)}function vn(e,t,n,o){q(e),Pn(e,n,o);const r=o.block===null,s=e.getQueryData(g.contentVersions(t)),i=e.getQueryData(g.contentChanges(t)),a=i?ne(i,n):void 0,l=a?a.baseVersion:s?.[n]??null;if(i){const c=B(n),f=Object.fromEntries(Object.entries(i.changes).filter(([u])=>B(u)!==c));r?l!==null&&(f[n]={kind:"delete",version:null,baseVersion:l}):f[n]={kind:"set",version:o.version,baseVersion:l},e.setQueryData(g.contentChanges(t),{...i,changes:f,edited:!0})}pe(e,t,n,r&&l===null),e.setQueryData(g.decofile(t),c=>{const f={...c};return r?delete f[n]:f[n]=o.block,f}),Oe(e,t,{[n]:r?null:o.version}),Rn(e,t,n,o)}function Ms(e,t,n,o){if(t.source!=="github"||!(o instanceof P))return!1;gn(e,n,o);const r=o.data?.draft;if(!r||typeof r!="object")return!1;const s=Object.keys(r),i=s.map(a=>hn(o,a));return s.length===0||i.some(a=>a===void 0)?!1:(e.cancelQueries({queryKey:g.decofile(n)}),s.forEach((a,l)=>{vn(e,n,a,i[l])}),!0)}async function Fs(e,t,n,o,r,s){t.source==="github"&&gn(e,o,s);const i=t.source==="github"?hn(s,r):void 0;if(i)return e.cancelQueries({queryKey:g.decofile(o)}),vn(e,o,r,i),!0;await e.invalidateQueries({queryKey:g.decofile(o)});let a;try{const c=(await oe(e,t,n,()=>t.client.changesGet({names:[r]}))).entries[r];if(c&&c.after===null&&c.version!==null)return!1;a={value:c?.after??null,version:c?.version??null},t.source==="github"&&e.setQueryData(g.contentChanges(o),f=>{if(!f)return f;const u={...f.changes};return c?.kind?u[r]={kind:c.kind,version:c.version,baseVersion:c.baseVersion}:delete u[r],{...f,changes:u,edited:!0}})}catch{const l=await oe(e,t,n,()=>t.client.blocksList({}));if(l.notModified)return!1;a={value:l.blocks[r]??null,version:l.versions[r]??null}}return e.setQueryData(g.decofile(o),l=>{const c={...l};return a.value===null?delete c[r]:c[r]=a.value,c}),Oe(e,o,{[r]:a.version}),!1}function Ir(e){const t=R.c(17),n=Ue(e?.virtualMcpId)?.metadata;let o;t[0]!==n?(o=yt(n),t[0]=n,t[1]=o):o=t[1];const r=o;let s;t[2]!==e?.branch||t[3]!==e?.orgSlug||t[4]!==e?.virtualMcpId?(s=g.protocolDraftRead(e?.orgSlug??"",e?.virtualMcpId??"",e?.branch??""),t[2]=e?.branch,t[3]=e?.orgSlug,t[4]=e?.virtualMcpId,t[5]=s):s=t[5];let i;t[6]!==e||t[7]!==r?(i=async()=>{const v=await Et(r,e.branch),m=v.pointer?.lastIndexOf("@")??-1;return{draft:v.pointer&&m>0?v.pointer.slice(0,m):null,version:v.pointer&&m>0?v.pointer.slice(m+1):v.etag}},t[6]=e,t[7]=r,t[8]=i):i=t[8];const a=!!e&&!!r;let l;t[9]!==s||t[10]!==i||t[11]!==a?(l={queryKey:s,queryFn:i,enabled:a,staleTime:Number.POSITIVE_INFINITY},t[9]=s,t[10]=i,t[11]=a,t[12]=l):l=t[12];const{data:c,isPending:f,isError:u}=F(l),d=!!e&&!!r&&f&&!u;if(!e||!c?.draft||!c.version){let v;return t[13]!==d?(v={pointer:null,pending:d},t[13]=d,t[14]=v):v=t[14],v}const h=`${c.draft}@${c.version}`;let b;return t[15]!==h?(b={pointer:h,pending:!1},t[15]=h,t[16]=b):b=t[16],b}function Qs(e){return Ir(e).pointer}function Vs(e){const t=R.c(4);let n;t[0]!==e?(n=g.contentRevision(e),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={queryKey:n,enabled:!1,queryFn:_r,staleTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:r}=F(o);return r?.revision}async function _r(){throw new Error("content revisions are set by reads and writes")}function je(e){const t=`${e.orgSlug}/${e.virtualMcpId}/${e.branch}`;return e.protocolSuffix?`${t}${e.protocolSuffix}`:e.localPreviewUrl?`${t}:local:${e.localPreviewUrl}`:t}function Bs(e,t){return je({...e,protocolSuffix:t.cacheKeySuffix})}function De(e,t){const n=R.c(6),{url:o}=Mt(e?.virtualMcpId),r=re(e?.virtualMcpId,e?.branch);if(!e)return"";let s;return n[0]!==r.cacheKeySuffix||n[1]!==r.kind||n[2]!==o||n[3]!==t?.tunnel||n[4]!==e?(s=r.kind==="protocol"?je({...e,protocolSuffix:r.cacheKeySuffix}):je({...e,localPreviewUrl:t?.tunnel===!1?null:o}),n[0]=r.cacheKeySuffix,n[1]=r.kind,n[2]=o,n[3]=t?.tunnel,n[4]=e,n[5]=s):s=n[5],s}function Hs(e,t){const n=R.c(46),{url:o}=Mt(e?.virtualMcpId),r=!!o,s=re(e?.virtualMcpId,e?.branch),i=s.kind==="protocol"?s:null,a=De(e),l=t?.fetchEnabled??!0,c=Uo(e?.virtualMcpId),f=It(e?.virtualMcpId).runtime==="cms",u=Z();let d;n[0]!==a?(d=g.decofile(a),n[0]=a,n[1]=d):d=n[1];const h=d;pr(i,i&&e?e:null,a);let b;n[2]!==e||n[3]!==u||n[4]!==h?(b=()=>{if(!e||u.isMutating({mutationKey:Se(e.orgSlug,e.virtualMcpId,e.branch)})>0)return!0;const D=u.getQueryState(h);return D?.fetchStatus==="fetching"||Date.now()-(D?.dataUpdatedAt??0)<Ft/2},n[2]=e,n[3]=u,n[4]=h,n[5]=b):b=n[5];let v;n[6]!==f||n[7]!==r||n[8]!==e||n[9]!==i||n[10]!==u||n[11]!==h?(v=async()=>{if(e){if(!i&&f&&!r){const D=Eo(u,e)?.version;if(D&&!await Oo(e,D))return}await u.refetchQueries({queryKey:h,exact:!0},{cancelRefetch:!1})}},n[6]=f,n[7]=r,n[8]=e,n[9]=i,n[10]=u,n[11]=h,n[12]=v):v=n[12];let m;n[13]!==b||n[14]!==v?(m={skip:b,read:v},n[13]=b,n[14]=v,n[15]=m):m=n[15],Ro(!!t?.pollWhile&&!!e,m);const E=kt(i?.hosted?a:"");let S;n[16]!==s.kind||n[17]!==f||n[18]!==l||n[19]!==a||n[20]!==r||n[21]!==o||n[22]!==c||n[23]!==e||n[24]!==i||n[25]!==u?(S=async()=>{if(i)return(await fn(u,i,e,a)).blocks;if(s.kind==="unavailable")throw br("decofile");if(r){const I=await fetch(new URL("/.decofile",o).toString(),{cache:"no-store"}).catch(Rr),Q=I?.ok?gt(await I.text()):null;if(Q)return Q;const O=new Error("decofile unavailable (local tunnel unreachable)");throw O.status=502,O}if(f)return ko(u,e);const D=()=>Lo(e,po(c,".deco/blocks.gen.json"));if(l){const I=await fetch(jo(e),{cache:"no-store"}).catch(Pr);if(I?.ok){const V=gt(await I.text());if(V)return V}const Q=await D();if(Q.kind==="data")return Q.data;const O=new Error(`Failed to fetch decofile: ${I?.status??"network error"}`);throw O.status=bt({liveOk:!!I?.ok,liveStatus:I?.status,committedAbsent:Q.kind==="absent"}),O}const U=await D();if(U.kind==="data")return U.data;const A=new Error("decofile unavailable (preview down, no committed snapshot)");throw A.status=bt({liveOk:!1,committedAbsent:U.kind==="absent"}),A},n[16]=s.kind,n[17]=f,n[18]=l,n[19]=a,n[20]=r,n[21]=o,n[22]=c,n[23]=e,n[24]=i,n[25]=u,n[26]=S):S=n[26];const x=!!e&&s.kind!=="pending",_=i?0:3e4,N=i?.describe.pollIntervalMs,$=i?"always":void 0;let w;n[27]!==f||n[28]!==r||n[29]!==i?(w=(D,U)=>{if(i||f||r)return D<3;const A=U.status;return A!==502&&A!==404&&D<2},n[27]=f,n[28]=r,n[29]=i,n[30]=w):w=n[30];let L;n[31]!==h||n[32]!==S||n[33]!==x||n[34]!==_||n[35]!==N||n[36]!==$||n[37]!==w?(L={queryKey:h,queryFn:S,enabled:x,staleTime:_,refetchInterval:N,refetchIntervalInBackground:!1,refetchOnWindowFocus:$,retry:w,retryDelay:Tr},n[31]=h,n[32]=S,n[33]=x,n[34]=_,n[35]=N,n[36]=$,n[37]=w,n[38]=L):L=n[38];const k=F(L);let T;n[39]!==E||n[40]!==k?(T=E&&k.data?Nn(E,k.data):void 0,n[39]=E,n[40]=k,n[41]=T):T=n[41];const j=T;let C;return n[42]!==j||n[43]!==i?.hosted||n[44]!==k?(C=i?.hosted&&j?{...k,data:j}:k,n[42]=j,n[43]=i?.hosted,n[44]=k,n[45]=C):C=n[45],C}function Tr(e){return Cn(5e3,1e3,e,2,0)}function Pr(){return null}function Rr(){return null}function Js(e,t,n){const o=re(e?.virtualMcpId,e?.branch),r=De(e),s=o.kind==="protocol"?o.hosted:void 0;return jn(s,r,t,n)}function Ws(e){const t=R.c(4),n=Z(),o=re(e?.virtualMcpId,e?.branch),r=De(e),s=o.kind==="protocol"?o.hosted:void 0;let i;return t[0]!==r||t[1]!==n||t[2]!==s?(i=(a,l)=>An(n,s,r,a,l),t[0]=r,t[1]=n,t[2]=s,t[3]=i):i=t[3],i}function Gs(e,t){const n=R.c(3),o=re(e?.virtualMcpId,e?.branch),r=De(e),s=kt(o.kind==="protocol"&&o.hosted?r:"");let i;return n[0]!==s?.entries||n[1]!==t?(i=Object.entries(s?.entries??{}).filter(a=>{const[,l]=a;return t(l.meta?.type??"")}).map(xr),n[0]=s?.entries,n[1]=t,n[2]=i):i=n[2],i}function xr(e){const[t]=e;return t}const $r="site-editor-save",bn={id:$r,description:void 0,action:void 0,cancel:void 0},Ys="site-editor-undo",Ce="site-editor-publish";function Nr(e){const t=R.c(7),{label:n,detail:o}=e;let r;t[0]!==n?(r=Y.jsx("summary",{className:"cursor-pointer select-none text-muted-foreground",children:n}),t[0]=n,t[1]=r):r=t[1];let s;t[2]!==o?(s=Y.jsx("p",{className:"mt-1 whitespace-pre-wrap break-words font-mono text-muted-foreground",children:o}),t[2]=o,t[3]=s):s=t[3];let i;return t[4]!==r||t[5]!==s?(i=Y.jsxs("details",{className:"mt-1 text-xs",children:[r,s]}),t[4]=r,t[5]=s,t[6]=i):i=t[6],i}function wn(e,t){return t?Y.jsx(Nr,{label:e("siteEditor.details"),detail:t}):void 0}function zs(e,t,n){te.error(Wt(e,t,n),{...bn,description:wn(e,Mo(t,n))})}function Xs(e,t,n=!1){te.info(e(t?"sectionsEditor.reconcile.leftDeleted":"sectionsEditor.reconcile.keptTheirs"),{...bn,description:e(t?n?"sectionsEditor.reconcile.leftDeletedNeverPublishedHint":"sectionsEditor.reconcile.leftDeletedHint":"sectionsEditor.reconcile.keptTheirsHint")})}const pn={action:void 0,duration:void 0};function Zs(e,t){te.success(t?e("siteEditor.publish.publishedOn",{host:t}):e("siteEditor.publish.published"),{...pn,id:Ce,description:void 0})}function qs(e,{headline:t,body:n,detail:o,retry:r,pending:s,tone:i="error"}){const a=wn(e,o??null);te[i](t,{id:Ce,description:n&&a?Y.jsxs(Y.Fragment,{children:[Y.jsx("p",{children:n}),a]}):n??a,action:r?{label:e("siteEditor.tryAgain"),onClick:l=>{l.preventDefault(),te.loading(s??e("thread.publishPopover.publishing"),{...pn,id:Ce,description:void 0}),r()}}:void 0,duration:r?Number.POSITIVE_INFINITY:void 0})}function Ks(e){return e instanceof Error?e.message||null:e==null?null:String(e)}export{So as $,ys as A,Ws as B,js as C,ns as D,Ir as E,Js as F,z as G,ar as H,Ts as I,ks as J,ve as K,Zo as L,qo as M,vs as N,Is as O,ws as P,xs as Q,Rs as R,gr as S,Ct as T,De as U,Vs as V,ms as W,mo as X,Se as Y,hr as Z,Ao as _,Kr as a,Bs as a0,Wr as a1,Yr as a2,Gs as a3,Xs as a4,As as a5,gs as a6,Ye as a7,hs as a8,Sr as a9,qe as aA,Ms as aB,fn as aC,br as aD,ds as aE,Ce as aF,pn as aG,Zs as aH,$s as aI,Hr as aJ,Jr as aK,Qe as aL,cs as aM,Qs as aN,ps as aO,X as aP,bs as aQ,qs as aR,Ys as aS,bn as aT,un as aU,Ss as aV,fs as aW,Es as aX,Os as aY,Ds as aZ,Ze as aa,Us as ab,Fs as ac,zs as ad,Cs as ae,an as af,yo as ag,ls as ah,Ns as ai,Ls as aj,ts as ak,is as al,ut as am,ft as an,as as ao,No as ap,rs as aq,Xn as ar,wn as as,Ks as at,zo as au,Gr as av,Bn as aw,Nr as ax,Ps as ay,_s as az,qn as b,Mt as c,zn as d,qr as e,Zn as f,Ge as g,Me as h,xt as i,us as j,xo as k,Hs as l,es as m,ss as n,Uo as o,zr as p,po as q,Zr as r,Xr as s,er as t,re as u,tr as v,Go as w,Lo as x,At as y,os as z};
@@ -1 +1 @@
1
- import{b as ee,a5 as te,q as ne,r as M,j as t,B as Q,n as F,bB as ae,a6 as ce,aN as me,aM as pe,aJ as de,aH as ue,aI as ge,aL as fe,aK as he,bj as xe,t as C,c6 as je,c as se,m as ke,_ as ve,X as ye,Z as Se,Y as be,K as H,gx as Ce}from"./index-ThHlPkA1.js";import{a as De}from"./SwitchHorizontal01-sZUZBsf0.js";import{M as we}from"./agent-icon-DCW_KqWB.js";import{s as Ne}from"./Trash01-D1V404v-.js";import{i as Pe}from"./Upload01-c3loaqre.js";import{i as ie}from"./Zap-D4Hgh2tO.js";import{S as Ae}from"./search-toggle-BEuCPCyS.js";import{E as Y}from"./empty-state-KdDqwAjO.js";import{C as Me}from"./collection-tabs-Bnk-eCpC.js";import{S as Ee,F as Oe}from"./folder-icon-DUOwLJoM.js";import{j as Te,k as Ie,n as Re}from"./use-org-fs-Dwn0EOt5.js";import{a7 as ze,R as Z,Z as $e}from"./chat-context-B1zyw_h1.js";import{c as _e}from"./context-shell-DojPqPCt.js";import"./AlertCircle-2S4m6Uee.js";import"./Tool01-CEctUV2j.js";import"./ArrowUp-Bk8mxo48.js";import"./ArrowLeft-CljOyrIP.js";import"./LinkBroken01-CctT2suC.js";import"./ShoppingBag01-Ce0oZ7tq.js";import"./Globe04-CdD9x2xM.js";import"./CheckCircle-f2YXXhCp.js";import"./ChevronUp-BQPjne-n.js";import"./ChevronSelectorVertical-DlyDkNpb.js";import"./UserSquare-D1FSX2q6.js";import"./CreditCard01-B4eSBulM.js";import"./Key01-DtPiSC33.js";import"./Minus-xsukVIT2.js";import"./Monitor01-DiSF-kjz.js";import"./Sun-CNo1YpD-.js";import"./Play-ChTUD8rH.js";import"./Plus-CFb7oJrI.js";import"./SearchMd-DBFjE3ta.js";import"./Users01-DZ_8WK0j.js";import"./XClose-CUWsLE89.js";import"./icon-button-qr7hW5Fe.js";import"./tooltip-DgFw0k5f.js";import"./index-B6uyloRF.js";import"./badge-Ksu8KJbs.js";import"./markdown-DJi-9CBK.js";import"./use-copy-Bn2_BzAq.js";import"./use-mobile-DRrjjVo-.js";import"./autosend-tnLQ3hUB.js";import"./thread-route-D3RMPPhn.js";import"./use-project-scope-CiDCxjqm.js";import"./repository-binding-kEo67YAA.js";import"./use-mcp-client-D5PLD4qt.js";import"./auth-B2w9HRxQ.js";import"./task-board-DDcqJlpm.js";import"./schema-iAJ4pGqb.js";import"./file-preview-DhfzScDD.js";import"./utils-BIFmS1TT.js";import"./editor-BNio8R7L.js";import"./file-type-icon-jrw7H8zE.js";import"./useInfiniteQuery-f_imkp8-.js";import"./infiniteQueryObserver-DO5Ifm28.js";import"./thread-intent-nQKoAtIt.js";import"./delay-CnY5UFtP.js";import"./watch-sse-pool-CMjB6F6-.js";import"./use-entitlements-D-Q_nl4X.js";import"./use-ai-providers-BlqN6sFc.js";import"./use-decopilot-events-BV_lXdgc.js";import"./use-organization-settings-DGtBK5Oe.js";import"./require-capability-Zb9L0UB5.js";import"./access-gate-DlxNXK1w.js";import"./capability-load-error-C3U-ZhDb.js";import"./sections-TT75Kv4G.js";import"./textarea-yOWP9JYC.js";import"./use-ask-in-chat-B83kUKgj.js";import"./shell-layout-BYhWS3vs.js";import"./use-deployment-admin-DaUkmiAb.js";import"./admin-fetch-BhTJlAsX.js";import"./command-xe4xl69E.js";import"./index-Bs4HBbkZ.js";import"./integration-icon-Cm0oa98P.js";import"./project-icon-CwIKfNXv.js";import"./use-navigate-to-agent-rsGycZF7.js";import"./new-project-dialog-NNiGQZ9q.js";import"./label-BRcQIH7Z.js";import"./repository-picker-DtUL_pmI.js";import"./github-icon-B3lAwfsm.js";import"./collection-search-9RSy1xeA.js";import"./use-debounced-value-WdYCpwhX.js";import"./required-auth-layout-a7ktq9mi.js";import"./use-org-sso-ChcM6ORm.js";const J=200,Fe=new Set(["node_modules","__pycache__"]);function G(s){const[,...e]=s.webkitRelativePath.split("/");return e.length>0?e.join("/"):s.name}function Le(s){return G(s).split("/").every(e=>!e.startsWith(".")&&!Fe.has(e))}function Be(s){return s.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"skill"}function Ke(s,e){const i=new Map;for(const o of s){const c=G(o).split("/");c.pop();const a=["skills",e,...c].join("/");i.set(a,[...i.get(a)??[],o])}return i}async function qe(s,e){const o=(await Promise.allSettled([...s].map(([c,a])=>e({dir:c,files:a})))).find(c=>c.status==="rejected");if(o)throw o.reason}function He(s,e){const i=_e(e),o=`skills/${s}`;return{id:`home/${o}`,name:i.name??s,description:i.description,disableModelInvocation:i.disableModelInvocation,source:"home",volume:Z,path:o,sandboxPath:`${ze}/${Z}/${o}`}}const L="*";function B(s){return s.volume==="home"}function re(s,e){const i=s.indexOf(":");return i===-1?{label:e,glyph:ie}:{label:s.slice(i+1),glyph:s.startsWith("repo:")?je:we}}function Qe(s){const e=se.c(48),{entry:i,pending:o,onOpen:c,onDelete:a}=s,n=ee(),{org:g}=te();let E;e[0]!==i.source||e[1]!==g.name?(E=re(i.source,g.name),e[0]=i.source,e[1]=g.name,e[2]=E):E=e[2];const{label:O,glyph:I}=E;let D;e[3]!==i?(D=B(i),e[3]=i,e[4]=D):D=e[4];const R=D,w=o?"opacity-60":"hover:bg-accent";let f;e[5]!==w?(f=ke("relative transition-colors group overflow-hidden flex flex-col h-full",w),e[5]=w,e[6]=f):f=e[6];let m;e[7]!==i.name||e[8]!==c||e[9]!==o?(m=!o&&t.jsx("button",{type:"button",onClick:c,className:"absolute inset-0 z-0","aria-label":i.name}),e[7]=i.name,e[8]=c,e[9]=o,e[10]=m):m=e[10];const N=R?"default":"system",z=!R;let h;e[11]!==I||e[12]!==N||e[13]!==z?(h=t.jsx(Oe,{glyph:I,tone:N,readOnly:z,className:"size-8 shrink-0"}),e[11]=I,e[12]=N,e[13]=z,e[14]=h):h=e[14];let x;e[15]!==a||e[16]!==n?(x=a&&t.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:t.jsxs(ve,{children:[t.jsx(ye,{asChild:!0,children:t.jsx(Q,{variant:"ghost",size:"icon",children:t.jsx(De,{size:16})})}),t.jsx(Se,{align:"end",children:t.jsxs(be,{variant:"destructive",onClick:K=>{K.stopPropagation(),a()},children:[t.jsx(Ne,{size:16}),n("settings.skills.deleteButton")]})})]})}),e[15]=a,e[16]=n,e[17]=x):x=e[17];let j;e[18]!==h||e[19]!==x?(j=t.jsxs("div",{className:"flex items-start justify-between",children:[h,x]}),e[18]=h,e[19]=x,e[20]=j):j=e[20];let b;e[21]!==i.name?(b=t.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:i.name}),e[21]=i.name,e[22]=b):b=e[22];let k;e[23]!==i.description||e[24]!==n?(k=i.description||n("settings.skills.noDescription"),e[23]=i.description,e[24]=n,e[25]=k):k=e[25];let p;e[26]!==k?(p=t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:k}),e[26]=k,e[27]=p):p=e[27];let v;e[28]!==b||e[29]!==p?(v=t.jsxs("div",{className:"flex flex-col gap-1",children:[b,p]}),e[28]=b,e[29]=p,e[30]=v):v=e[30];let d;e[31]!==j||e[32]!==v?(d=t.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[j,v]}),e[31]=j,e[32]=v,e[33]=d):d=e[33];let y;e[34]!==O||e[35]!==o||e[36]!==n?(y=o?n("settings.skills.importing"):O,e[34]=O,e[35]=o,e[36]=n,e[37]=y):y=e[37];let u;e[38]!==y?(u=t.jsx("div",{className:"border-t border-border mt-auto",children:t.jsx("div",{className:"h-10 flex items-center px-4.5",children:t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:y})})}),e[38]=y,e[39]=u):u=e[39];let S;e[40]!==d||e[41]!==u?(S=t.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[d,u]}),e[40]=d,e[41]=u,e[42]=S):S=e[42];let T;return e[43]!==o||e[44]!==S||e[45]!==f||e[46]!==m?(T=t.jsxs(Ce,{size:"flush","aria-busy":o,className:f,children:[m,S]}),e[43]=o,e[44]=S,e[45]=f,e[46]=m,e[47]=T):T=e[47],T}function V(s){const e=se.c(2),{children:i}=s;let o;return e[0]!==i?(o=t.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:i}),e[0]=i,e[1]=o):o=e[1],o}function Ss(){const s=ee(),{org:e}=te(),i=Te(),{remove:o,upload:c}=Ie("home"),a=ne(),n=M.useRef(null),[g,E]=M.useState(""),[O,I]=M.useState(L),[D,R]=M.useState(!1),[w,f]=M.useState(null),[m,N]=M.useState(null),[z,h]=M.useState(null),x=()=>{a.invalidateQueries({queryKey:H.slashSkills(e.id)}),a.invalidateQueries({queryKey:H.orgFsSkills(e.id)})},j=r=>a.setQueryData(H.slashSkills(e.id),l=>r(l??[]));async function b(r){const l=[...r??[]];if(n.current&&(n.current.value=""),l.length===0)return;const P=l[0]?.webkitRelativePath??"";if(!P){C.error(s("settings.skills.importNeedsFolder"));return}const q=P.split("/")[0]??"",_=l.filter(Le),U=_.find(A=>G(A)==="SKILL.md");if(!U){C.error(s("settings.skills.importMissingSkillMd"));return}if(_.length>J){C.error(s("settings.skills.importTooManyFiles",{count:String(_.length),max:String(J)}));return}const $=Be(q),X=`skills/${$}`;let W=!1;R(!0);try{if(await Re(e.slug,"home",X)){C.error(s("settings.skills.importSlugTaken",{slug:$}));return}W=!0;const A=He($,await U.text());j(le=>[A,...le]),h(A.id),await qe(Ke(_,$),c.mutateAsync),C.success(s("settings.skills.importSuccess",{name:$}))}catch(A){W&&await o.mutateAsync(X).catch(()=>{}),C.error(A instanceof Error?A.message:s("settings.skills.importError"))}finally{h(null),x(),R(!1)}}const k=g.toLowerCase(),p=(i.data??[]).filter(r=>r.name.toLowerCase().includes(k)||(r.description??"").toLowerCase().includes(k)).sort((r,l)=>Number(B(l))-Number(B(r))||r.name.localeCompare(l.name)),v=new Set((i.data??[]).map(r=>r.source)),d=new Map;for(const r of p)d.set(r.source,(d.get(r.source)??0)+1);const y=[{id:L,label:s("settings.skills.filterAll"),count:p.length},...[...v].map(r=>({id:r,label:re(r,e.name).label,count:d.get(r)??0}))],u=v.has(O)?O:L,S=u===L?p:p.filter(r=>r.source===u),T=r=>f($e(r.volume,r.path)),K=async()=>{if(!m)return;const{id:r,path:l}=m;N(null),j(P=>P.filter(q=>q.id!==r));try{await o.mutateAsync(l),C.success(s("settings.skills.deleteSuccess"))}catch(P){C.error(P instanceof Error?P.message:s("settings.skills.deleteError"))}finally{x()}},oe=t.jsxs(Q,{size:"sm",disabled:D,onClick:()=>n.current?.click(),children:[t.jsx(Pe,{size:14}),s(D?"settings.skills.importing":"settings.skills.importButton")]});return t.jsxs(F,{children:[t.jsx(F.Content,{children:t.jsx(F.Container,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(F.Actions,{secondary:t.jsx(Ae,{value:g,onChange:E,label:s("library.context.search"),placeholder:s("settings.skills.searchPlaceholder"),clearLabel:s("library.library.clearSearch")}),children:oe}),t.jsx("input",{ref:n,type:"file",multiple:!0,webkitdirectory:"",className:"hidden",onChange:r=>{b(r.target.files)}}),y.length>2&&t.jsx(Me,{placement:"page",tabs:y,activeTab:u,onTabChange:I}),i.isPending?t.jsx("div",{className:"@container",children:t.jsx(V,{children:Array.from({length:8},(r,l)=>t.jsx(ae,{className:"h-[168px] rounded-xl"},l))})}):i.isError?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx(Y,{image:t.jsx(ce,{size:48,className:"text-muted-foreground"}),title:s("settings.skills.errorTitle"),description:i.error instanceof Error?i.error.message:s("settings.skills.errorDescription"),actions:t.jsx(Q,{size:"sm",variant:"outline",onClick:()=>{i.refetch()},children:s("settings.skills.retry")})})}):S.length===0?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx(Y,{image:t.jsx(ie,{size:48,className:"text-muted-foreground"}),title:s(g?"settings.skills.noResultsTitle":"settings.skills.emptyTitle"),description:g?s("settings.skills.noResultsDescription",{search:g}):s("settings.skills.emptyDescription"),actions:!1})}):t.jsx("div",{className:"@container",children:t.jsx(V,{children:S.map(r=>{const l=r.id===z;return t.jsx(Qe,{entry:r,pending:l,onOpen:()=>T(r),onDelete:B(r)&&!l?()=>N(r):void 0},r.id)})})})]})})}),w&&t.jsx(Ee,{skillPath:w,onClose:()=>f(null)},w),t.jsx(me,{open:m!==null,onOpenChange:r=>!r&&N(null),children:t.jsxs(pe,{children:[t.jsxs(de,{children:[t.jsx(ue,{children:s("settings.skills.deleteDialogTitle")}),t.jsx(ge,{children:s("settings.skills.deleteDialogDescription",{name:m?.name??""})})]}),t.jsxs(fe,{children:[t.jsx(he,{children:s("settings.skills.cancel")}),t.jsx(xe,{onClick:K,variant:"destructive",children:s("settings.skills.deleteButton")})]})]})})]})}export{Ss as default};
1
+ import{b as ee,a5 as te,q as ne,r as M,j as t,B as Q,n as F,bB as ae,a6 as ce,aN as me,aM as pe,aJ as de,aH as ue,aI as ge,aL as fe,aK as he,bj as xe,t as C,c6 as je,c as se,m as ke,_ as ve,X as ye,Z as Se,Y as be,K as H,gy as Ce}from"./index-Cm-moWa5.js";import{a as De}from"./SwitchHorizontal01-CMdcXPwO.js";import{M as we}from"./agent-icon-CRaK_2eb.js";import{s as Ne}from"./Trash01-Bif7g_Tq.js";import{i as Pe}from"./Upload01-Drv81LKH.js";import{i as ie}from"./Zap-TzUnnTO5.js";import{S as Ae}from"./search-toggle-Y8EXpMEc.js";import{E as Y}from"./empty-state-B44K4GDI.js";import{C as Me}from"./collection-tabs-DO7nBfoY.js";import{S as Ee,F as Oe}from"./folder-icon-CC-uKBN4.js";import{j as Te,k as Ie,n as Re}from"./use-org-fs-DSsFMzTw.js";import{a7 as ze,R as Z,Z as $e}from"./chat-context-O7Uim5zw.js";import{c as _e}from"./context-shell-CJdcogAj.js";import"./AlertCircle-C8lUSNa8.js";import"./Tool01-CuDHSO34.js";import"./ArrowUp-DjenQeZQ.js";import"./ArrowLeft-BW0QTKlw.js";import"./LinkBroken01-DfOqWtEB.js";import"./ShoppingBag01-BsFRFwoQ.js";import"./Globe04-B7JSn39b.js";import"./CheckCircle-CBLXbFFB.js";import"./ChevronUp-Dg02PCVC.js";import"./ChevronSelectorVertical-ofVA6B_w.js";import"./UserSquare-DqOeWgs_.js";import"./CreditCard01-F1q7cqMP.js";import"./Key01-DPrG8yA6.js";import"./Minus-CtT-IgpU.js";import"./Monitor01-CY6I-T_v.js";import"./Sun-BPyrKfqp.js";import"./Play-Cb465MQD.js";import"./Plus-EDJqelyG.js";import"./SearchMd-BM1-RWQF.js";import"./Users01-DSPCiWrI.js";import"./XClose-CFLo0iwC.js";import"./icon-button-BxjZlrnJ.js";import"./tooltip-DkKVKER8.js";import"./index-CZmp59DI.js";import"./badge-BpuDiibz.js";import"./markdown-BukU_dP8.js";import"./use-copy-DNHp83li.js";import"./use-mobile-Brbs-D5v.js";import"./autosend-DDd9ei6A.js";import"./thread-route-D5BZJ8B8.js";import"./use-project-scope-BIVViTXo.js";import"./repository-binding-B7kVJGqt.js";import"./use-mcp-client-BkZUf1G1.js";import"./auth-Ds2S-lbe.js";import"./task-board-CIxtWADL.js";import"./schema-iQl5fqzx.js";import"./file-preview-C7xeW7Ns.js";import"./utils-CVwSOtNq.js";import"./editor-BTYObZ3D.js";import"./file-type-icon-BgvZ7mJ5.js";import"./useInfiniteQuery-BNB4wMo9.js";import"./infiniteQueryObserver-D6uRpwx5.js";import"./thread-intent-H43pIrGm.js";import"./delay-CnY5UFtP.js";import"./watch-sse-pool-CcLpshxd.js";import"./use-entitlements-CEKmKdX0.js";import"./use-ai-providers-CoMFtqYl.js";import"./use-decopilot-events-DsbeE0fY.js";import"./use-organization-settings-CyexoMCC.js";import"./require-capability-CJKpnzPC.js";import"./access-gate-BZysXSEP.js";import"./capability-load-error-DIv2eZlz.js";import"./sections-zGZh6wSh.js";import"./textarea-kPu_uJPE.js";import"./use-ask-in-chat-hvqpSKkf.js";import"./shell-layout-n8ud5acT.js";import"./use-deployment-admin-BD_xFjSG.js";import"./admin-fetch-BhTJlAsX.js";import"./command-BO5QH15f.js";import"./index-BZnluLX8.js";import"./integration-icon-CDajRnkl.js";import"./project-icon-BUFanmLS.js";import"./use-navigate-to-agent-De0vzDZt.js";import"./new-project-dialog-DHaEULY3.js";import"./label-BwDzqaMo.js";import"./repository-picker-CjOhm0Ey.js";import"./github-icon-Dq39pEMT.js";import"./collection-search-AauU22W8.js";import"./use-debounced-value-DklROaCE.js";import"./required-auth-layout-Cv1Or1o2.js";import"./use-org-sso-DatsrvZR.js";const J=200,Fe=new Set(["node_modules","__pycache__"]);function G(s){const[,...e]=s.webkitRelativePath.split("/");return e.length>0?e.join("/"):s.name}function Le(s){return G(s).split("/").every(e=>!e.startsWith(".")&&!Fe.has(e))}function Be(s){return s.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"skill"}function Ke(s,e){const i=new Map;for(const o of s){const c=G(o).split("/");c.pop();const a=["skills",e,...c].join("/");i.set(a,[...i.get(a)??[],o])}return i}async function qe(s,e){const o=(await Promise.allSettled([...s].map(([c,a])=>e({dir:c,files:a})))).find(c=>c.status==="rejected");if(o)throw o.reason}function He(s,e){const i=_e(e),o=`skills/${s}`;return{id:`home/${o}`,name:i.name??s,description:i.description,disableModelInvocation:i.disableModelInvocation,source:"home",volume:Z,path:o,sandboxPath:`${ze}/${Z}/${o}`}}const L="*";function B(s){return s.volume==="home"}function re(s,e){const i=s.indexOf(":");return i===-1?{label:e,glyph:ie}:{label:s.slice(i+1),glyph:s.startsWith("repo:")?je:we}}function Qe(s){const e=se.c(48),{entry:i,pending:o,onOpen:c,onDelete:a}=s,n=ee(),{org:g}=te();let E;e[0]!==i.source||e[1]!==g.name?(E=re(i.source,g.name),e[0]=i.source,e[1]=g.name,e[2]=E):E=e[2];const{label:O,glyph:I}=E;let D;e[3]!==i?(D=B(i),e[3]=i,e[4]=D):D=e[4];const R=D,w=o?"opacity-60":"hover:bg-accent";let f;e[5]!==w?(f=ke("relative transition-colors group overflow-hidden flex flex-col h-full",w),e[5]=w,e[6]=f):f=e[6];let m;e[7]!==i.name||e[8]!==c||e[9]!==o?(m=!o&&t.jsx("button",{type:"button",onClick:c,className:"absolute inset-0 z-0","aria-label":i.name}),e[7]=i.name,e[8]=c,e[9]=o,e[10]=m):m=e[10];const N=R?"default":"system",z=!R;let h;e[11]!==I||e[12]!==N||e[13]!==z?(h=t.jsx(Oe,{glyph:I,tone:N,readOnly:z,className:"size-8 shrink-0"}),e[11]=I,e[12]=N,e[13]=z,e[14]=h):h=e[14];let x;e[15]!==a||e[16]!==n?(x=a&&t.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:t.jsxs(ve,{children:[t.jsx(ye,{asChild:!0,children:t.jsx(Q,{variant:"ghost",size:"icon",children:t.jsx(De,{size:16})})}),t.jsx(Se,{align:"end",children:t.jsxs(be,{variant:"destructive",onClick:K=>{K.stopPropagation(),a()},children:[t.jsx(Ne,{size:16}),n("settings.skills.deleteButton")]})})]})}),e[15]=a,e[16]=n,e[17]=x):x=e[17];let j;e[18]!==h||e[19]!==x?(j=t.jsxs("div",{className:"flex items-start justify-between",children:[h,x]}),e[18]=h,e[19]=x,e[20]=j):j=e[20];let b;e[21]!==i.name?(b=t.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:i.name}),e[21]=i.name,e[22]=b):b=e[22];let k;e[23]!==i.description||e[24]!==n?(k=i.description||n("settings.skills.noDescription"),e[23]=i.description,e[24]=n,e[25]=k):k=e[25];let p;e[26]!==k?(p=t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:k}),e[26]=k,e[27]=p):p=e[27];let v;e[28]!==b||e[29]!==p?(v=t.jsxs("div",{className:"flex flex-col gap-1",children:[b,p]}),e[28]=b,e[29]=p,e[30]=v):v=e[30];let d;e[31]!==j||e[32]!==v?(d=t.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[j,v]}),e[31]=j,e[32]=v,e[33]=d):d=e[33];let y;e[34]!==O||e[35]!==o||e[36]!==n?(y=o?n("settings.skills.importing"):O,e[34]=O,e[35]=o,e[36]=n,e[37]=y):y=e[37];let u;e[38]!==y?(u=t.jsx("div",{className:"border-t border-border mt-auto",children:t.jsx("div",{className:"h-10 flex items-center px-4.5",children:t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:y})})}),e[38]=y,e[39]=u):u=e[39];let S;e[40]!==d||e[41]!==u?(S=t.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[d,u]}),e[40]=d,e[41]=u,e[42]=S):S=e[42];let T;return e[43]!==o||e[44]!==S||e[45]!==f||e[46]!==m?(T=t.jsxs(Ce,{size:"flush","aria-busy":o,className:f,children:[m,S]}),e[43]=o,e[44]=S,e[45]=f,e[46]=m,e[47]=T):T=e[47],T}function V(s){const e=se.c(2),{children:i}=s;let o;return e[0]!==i?(o=t.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:i}),e[0]=i,e[1]=o):o=e[1],o}function Ss(){const s=ee(),{org:e}=te(),i=Te(),{remove:o,upload:c}=Ie("home"),a=ne(),n=M.useRef(null),[g,E]=M.useState(""),[O,I]=M.useState(L),[D,R]=M.useState(!1),[w,f]=M.useState(null),[m,N]=M.useState(null),[z,h]=M.useState(null),x=()=>{a.invalidateQueries({queryKey:H.slashSkills(e.id)}),a.invalidateQueries({queryKey:H.orgFsSkills(e.id)})},j=r=>a.setQueryData(H.slashSkills(e.id),l=>r(l??[]));async function b(r){const l=[...r??[]];if(n.current&&(n.current.value=""),l.length===0)return;const P=l[0]?.webkitRelativePath??"";if(!P){C.error(s("settings.skills.importNeedsFolder"));return}const q=P.split("/")[0]??"",_=l.filter(Le),U=_.find(A=>G(A)==="SKILL.md");if(!U){C.error(s("settings.skills.importMissingSkillMd"));return}if(_.length>J){C.error(s("settings.skills.importTooManyFiles",{count:String(_.length),max:String(J)}));return}const $=Be(q),X=`skills/${$}`;let W=!1;R(!0);try{if(await Re(e.slug,"home",X)){C.error(s("settings.skills.importSlugTaken",{slug:$}));return}W=!0;const A=He($,await U.text());j(le=>[A,...le]),h(A.id),await qe(Ke(_,$),c.mutateAsync),C.success(s("settings.skills.importSuccess",{name:$}))}catch(A){W&&await o.mutateAsync(X).catch(()=>{}),C.error(A instanceof Error?A.message:s("settings.skills.importError"))}finally{h(null),x(),R(!1)}}const k=g.toLowerCase(),p=(i.data??[]).filter(r=>r.name.toLowerCase().includes(k)||(r.description??"").toLowerCase().includes(k)).sort((r,l)=>Number(B(l))-Number(B(r))||r.name.localeCompare(l.name)),v=new Set((i.data??[]).map(r=>r.source)),d=new Map;for(const r of p)d.set(r.source,(d.get(r.source)??0)+1);const y=[{id:L,label:s("settings.skills.filterAll"),count:p.length},...[...v].map(r=>({id:r,label:re(r,e.name).label,count:d.get(r)??0}))],u=v.has(O)?O:L,S=u===L?p:p.filter(r=>r.source===u),T=r=>f($e(r.volume,r.path)),K=async()=>{if(!m)return;const{id:r,path:l}=m;N(null),j(P=>P.filter(q=>q.id!==r));try{await o.mutateAsync(l),C.success(s("settings.skills.deleteSuccess"))}catch(P){C.error(P instanceof Error?P.message:s("settings.skills.deleteError"))}finally{x()}},oe=t.jsxs(Q,{size:"sm",disabled:D,onClick:()=>n.current?.click(),children:[t.jsx(Pe,{size:14}),s(D?"settings.skills.importing":"settings.skills.importButton")]});return t.jsxs(F,{children:[t.jsx(F.Content,{children:t.jsx(F.Container,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(F.Actions,{secondary:t.jsx(Ae,{value:g,onChange:E,label:s("library.context.search"),placeholder:s("settings.skills.searchPlaceholder"),clearLabel:s("library.library.clearSearch")}),children:oe}),t.jsx("input",{ref:n,type:"file",multiple:!0,webkitdirectory:"",className:"hidden",onChange:r=>{b(r.target.files)}}),y.length>2&&t.jsx(Me,{placement:"page",tabs:y,activeTab:u,onTabChange:I}),i.isPending?t.jsx("div",{className:"@container",children:t.jsx(V,{children:Array.from({length:8},(r,l)=>t.jsx(ae,{className:"h-[168px] rounded-xl"},l))})}):i.isError?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx(Y,{image:t.jsx(ce,{size:48,className:"text-muted-foreground"}),title:s("settings.skills.errorTitle"),description:i.error instanceof Error?i.error.message:s("settings.skills.errorDescription"),actions:t.jsx(Q,{size:"sm",variant:"outline",onClick:()=>{i.refetch()},children:s("settings.skills.retry")})})}):S.length===0?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx(Y,{image:t.jsx(ie,{size:48,className:"text-muted-foreground"}),title:s(g?"settings.skills.noResultsTitle":"settings.skills.emptyTitle"),description:g?s("settings.skills.noResultsDescription",{search:g}):s("settings.skills.emptyDescription"),actions:!1})}):t.jsx("div",{className:"@container",children:t.jsx(V,{children:S.map(r=>{const l=r.id===z;return t.jsx(Qe,{entry:r,pending:l,onOpen:()=>T(r),onDelete:B(r)&&!l?()=>N(r):void 0},r.id)})})})]})})}),w&&t.jsx(Ee,{skillPath:w,onClose:()=>f(null)},w),t.jsx(me,{open:m!==null,onOpenChange:r=>!r&&N(null),children:t.jsxs(pe,{children:[t.jsxs(de,{children:[t.jsx(ue,{children:s("settings.skills.deleteDialogTitle")}),t.jsx(ge,{children:s("settings.skills.deleteDialogDescription",{name:m?.name??""})})]}),t.jsxs(fe,{children:[t.jsx(he,{children:s("settings.skills.cancel")}),t.jsx(xe,{onClick:K,variant:"destructive",children:s("settings.skills.deleteButton")})]})]})})]})}export{Ss as default};
@@ -1 +1 @@
1
- import{c as _,m as N,j}from"./index-ThHlPkA1.js";import{T as k,R as z,a as D,b as S}from"./index-D43W3NwR.js";function V(T){const e=_.c(41);let i,t,n,s,c,b,g,o,r,a;e[0]!==T?({className:i,defaultValue:t,value:a,min:b,max:g,onPointerDown:s,onKeyDown:n,thumbLabel:o,thumbValueText:r,...c}=T,e[0]=T,e[1]=i,e[2]=t,e[3]=n,e[4]=s,e[5]=c,e[6]=b,e[7]=g,e[8]=o,e[9]=r,e[10]=a):(i=e[1],t=e[2],n=e[3],s=e[4],c=e[5],b=e[6],g=e[7],o=e[8],r=e[9],a=e[10]);const d=b===void 0?0:b,u=g===void 0?100:g;let p;e[11]!==t||e[12]!==u||e[13]!==d||e[14]!==a?(p=Array.isArray(a)?a:Array.isArray(t)?t:[d,u],e[11]=t,e[12]=u,e[13]=d,e[14]=a,e[15]=p):p=e[15];const A=p;let f;e[16]!==i?(f=N("relative flex w-full touch-none items-center py-2 select-none data-[disabled]:opacity-50 data-[orientation=vertical]:px-2 data-[orientation=vertical]:py-0 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",i),e[16]=i,e[17]=f):f=e[17];let m;e[18]!==s?(m=l=>{l.currentTarget.dataset.pointer="",s?.(l)},e[18]=s,e[19]=m):m=e[19];let h;e[20]!==n?(h=l=>{delete l.currentTarget.dataset.pointer,n?.(l)},e[20]=n,e[21]=h):h=e[21];let x;e[22]===Symbol.for("react.memo_cache_sentinel")?(x=N("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1"),e[22]=x):x=e[22];let w;e[23]===Symbol.for("react.memo_cache_sentinel")?(w=j.jsx(k,{"data-slot":"slider-track",className:x,children:j.jsx(z,{"data-slot":"slider-range",className:N("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),e[23]=w):w=e[23];let v;if(e[24]!==A.length||e[25]!==o||e[26]!==r){let l;e[28]!==o||e[29]!==r?(l=(E,R)=>j.jsx(S,{"data-slot":"slider-thumb",...o!==void 0?{"aria-label":o}:{},...r!==void 0?{"aria-valuetext":r}:{},className:"relative block size-4 shrink-0 cursor-grab rounded-full bg-white shadow-edge transition-transform duration-150 after:absolute after:-inset-3 after:rounded-full after:content-[''] hover:scale-110 focus-ring in-data-pointer:outline-none! active:scale-110 active:cursor-grabbing disabled:pointer-events-none motion-reduce:transition-none"},R),e[28]=o,e[29]=r,e[30]=l):l=e[30],v=Array.from({length:A.length},l),e[24]=A.length,e[25]=o,e[26]=r,e[27]=v}else v=e[27];let y;return e[31]!==t||e[32]!==u||e[33]!==d||e[34]!==c||e[35]!==f||e[36]!==m||e[37]!==h||e[38]!==v||e[39]!==a?(y=j.jsxs(D,{"data-slot":"slider",defaultValue:t,value:a,min:d,max:u,className:f,...c,onPointerDown:m,onKeyDown:h,children:[w,v]}),e[31]=t,e[32]=u,e[33]=d,e[34]=c,e[35]=f,e[36]=m,e[37]=h,e[38]=v,e[39]=a,e[40]=y):y=e[40],y}export{V as S};
1
+ import{c as _,m as N,j}from"./index-Cm-moWa5.js";import{T as k,R as z,a as D,b as S}from"./index-B541Z8pm.js";function V(T){const e=_.c(41);let i,t,n,s,c,b,g,o,r,a;e[0]!==T?({className:i,defaultValue:t,value:a,min:b,max:g,onPointerDown:s,onKeyDown:n,thumbLabel:o,thumbValueText:r,...c}=T,e[0]=T,e[1]=i,e[2]=t,e[3]=n,e[4]=s,e[5]=c,e[6]=b,e[7]=g,e[8]=o,e[9]=r,e[10]=a):(i=e[1],t=e[2],n=e[3],s=e[4],c=e[5],b=e[6],g=e[7],o=e[8],r=e[9],a=e[10]);const d=b===void 0?0:b,u=g===void 0?100:g;let p;e[11]!==t||e[12]!==u||e[13]!==d||e[14]!==a?(p=Array.isArray(a)?a:Array.isArray(t)?t:[d,u],e[11]=t,e[12]=u,e[13]=d,e[14]=a,e[15]=p):p=e[15];const A=p;let f;e[16]!==i?(f=N("relative flex w-full touch-none items-center py-2 select-none data-[disabled]:opacity-50 data-[orientation=vertical]:px-2 data-[orientation=vertical]:py-0 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",i),e[16]=i,e[17]=f):f=e[17];let m;e[18]!==s?(m=l=>{l.currentTarget.dataset.pointer="",s?.(l)},e[18]=s,e[19]=m):m=e[19];let h;e[20]!==n?(h=l=>{delete l.currentTarget.dataset.pointer,n?.(l)},e[20]=n,e[21]=h):h=e[21];let x;e[22]===Symbol.for("react.memo_cache_sentinel")?(x=N("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1"),e[22]=x):x=e[22];let w;e[23]===Symbol.for("react.memo_cache_sentinel")?(w=j.jsx(k,{"data-slot":"slider-track",className:x,children:j.jsx(z,{"data-slot":"slider-range",className:N("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),e[23]=w):w=e[23];let v;if(e[24]!==A.length||e[25]!==o||e[26]!==r){let l;e[28]!==o||e[29]!==r?(l=(E,R)=>j.jsx(S,{"data-slot":"slider-thumb",...o!==void 0?{"aria-label":o}:{},...r!==void 0?{"aria-valuetext":r}:{},className:"relative block size-4 shrink-0 cursor-grab rounded-full bg-white shadow-edge transition-transform duration-150 after:absolute after:-inset-3 after:rounded-full after:content-[''] hover:scale-110 focus-ring in-data-pointer:outline-none! active:scale-110 active:cursor-grabbing disabled:pointer-events-none motion-reduce:transition-none"},R),e[28]=o,e[29]=r,e[30]=l):l=e[30],v=Array.from({length:A.length},l),e[24]=A.length,e[25]=o,e[26]=r,e[27]=v}else v=e[27];let y;return e[31]!==t||e[32]!==u||e[33]!==d||e[34]!==c||e[35]!==f||e[36]!==m||e[37]!==h||e[38]!==v||e[39]!==a?(y=j.jsxs(D,{"data-slot":"slider",defaultValue:t,value:a,min:d,max:u,className:f,...c,onPointerDown:m,onKeyDown:h,children:[w,v]}),e[31]=t,e[32]=u,e[33]=d,e[34]=c,e[35]=f,e[36]=m,e[37]=h,e[38]=v,e[39]=a,e[40]=y):y=e[40],y}export{V as S};
@@ -1 +1 @@
1
- import{r as v,fh as K}from"./index-ThHlPkA1.js";import{d as de,e as fe,f as U,g as ge,h as pe,i as be,j as ve,C as Y,k as he,l as y,m as me,n as xe,o as Ie,s as ye}from"./core.esm-BOqq6di7.js";function q(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Re(e,t){return e.reduce((n,r,s)=>{const a=t.get(r);return a&&(n[s]=a),n},Array(e.length))}function O(e){return e!==null&&e>=0}function Ce(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function we(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const B=e=>{let{rects:t,activeIndex:n,overIndex:r,index:s}=e;const a=q(t,r,n),o=t[s],c=a[s];return!c||!o?null:{x:c.left-o.left,y:c.top-o.top,scaleX:c.width/o.width,scaleY:c.height/o.height}},L={scaleX:1,scaleY:1},Xe=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:s,rects:a,overIndex:o}=e;const c=(t=a[n])!=null?t:r;if(!c)return null;if(s===n){const u=a[o];return u?{x:0,y:n<o?u.top+u.height-(c.top+c.height):u.top-c.top,...L}:null}const f=De(a,s,n);return s>n&&s<=o?{x:0,y:-c.height-f,...L}:s<n&&s>=o?{x:0,y:c.height+f,...L}:{x:0,y:0,...L}};function De(e,t,n){const r=e[t],s=e[t-1],a=e[t+1];return r?n<t?s?r.top-(s.top+s.height):a?a.top-(r.top+r.height):0:a?a.top-(r.top+r.height):s?r.top-(s.top+s.height):0:0}const H="Sortable",V=K.createContext({activeIndex:-1,containerId:H,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:B,disabled:{draggable:!1,droppable:!1}});function _e(e){let{children:t,id:n,items:r,strategy:s=B,disabled:a=!1}=e;const{active:o,dragOverlay:c,droppableRects:f,over:u,measureDroppableContainers:i}=de(),l=fe(H,n),d=c.rect!==null,g=v.useMemo(()=>r.map(I=>typeof I=="object"&&"id"in I?I.id:I),[r]),R=o!=null,C=o?g.indexOf(o.id):-1,h=u?g.indexOf(u.id):-1,w=v.useRef(g),x=!Ce(g,w.current),m=h!==-1&&C===-1||x,b=we(a);U(()=>{x&&R&&i(g)},[x,g,R,i]),v.useEffect(()=>{w.current=g},[g]);const D=v.useMemo(()=>({activeIndex:C,containerId:l,disabled:b,disableTransforms:m,items:g,overIndex:h,useDragOverlay:d,sortedRects:Re(g,f),strategy:s}),[C,l,b.draggable,b.droppable,m,g,h,f,d,s]);return K.createElement(V.Provider,{value:D},t)}const Se=e=>{let{id:t,items:n,activeIndex:r,overIndex:s}=e;return q(n,r,s).indexOf(t)},Ae=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:s,items:a,newIndex:o,previousItems:c,previousContainerId:f,transition:u}=e;return!u||!r||c!==a&&s===o?!1:n?!0:o!==s&&t===f},Te={duration:200,easing:"ease"},J="transform",Ee=Y.Transition.toString({property:J,duration:0,easing:"linear"}),Ne={roleDescription:"sortable"};function Oe(e){let{disabled:t,index:n,node:r,rect:s}=e;const[a,o]=v.useState(null),c=v.useRef(n);return U(()=>{if(!t&&n!==c.current&&r.current){const f=s.current;if(f){const u=he(r.current,{ignoreTransform:!0}),i={x:f.left-u.left,y:f.top-u.top,scaleX:f.width/u.width,scaleY:f.height/u.height};(i.x||i.y)&&o(i)}}n!==c.current&&(c.current=n)},[t,n,r,s]),v.useEffect(()=>{a&&o(null)},[a]),a}function je(e){let{animateLayoutChanges:t=Ae,attributes:n,disabled:r,data:s,getNewIndex:a=Se,id:o,strategy:c,resizeObserverConfig:f,transition:u=Te}=e;const{items:i,containerId:l,activeIndex:d,disabled:g,disableTransforms:R,sortedRects:C,overIndex:h,useDragOverlay:w,strategy:x}=v.useContext(V),m=Le(r,g),b=i.indexOf(o),D=v.useMemo(()=>({sortable:{containerId:l,index:b,items:i},...s}),[l,s,b,i]),I=v.useMemo(()=>i.slice(i.indexOf(o)),[i,o]),{rect:N,node:z,isOver:W,setNodeRef:P}=ge({id:o,data:D,disabled:m.droppable,resizeObserverConfig:{updateMeasurementsFor:I,...f}}),{active:T,activatorEvent:Z,activeNodeRect:ee,attributes:te,setNodeRef:X,listeners:re,isDragging:M,over:ne,setActivatorNodeRef:se,transform:oe}=pe({id:o,data:D,attributes:{...Ne,...n},disabled:m.draggable}),ae=be(P,X),S=!!T,_=S&&!R&&O(d)&&O(h),j=!w&&M,F=j&&_?oe:null,ie=_?F??(c??x)({rects:C,activeNodeRect:ee,activeIndex:d,overIndex:h,index:b}):null,E=O(d)&&O(h)?a({id:o,items:i,activeIndex:d,overIndex:h}):b,A=T?.id,p=v.useRef({activeId:A,items:i,newIndex:E,containerId:l}),ce=i!==p.current.items,G=t({active:T,containerId:l,isDragging:M,isSorting:S,id:o,index:b,items:i,newIndex:p.current.newIndex,previousItems:p.current.items,previousContainerId:p.current.containerId,transition:u,wasDragging:p.current.activeId!=null}),$=Oe({disabled:!G,index:b,node:z,rect:N});return v.useEffect(()=>{S&&p.current.newIndex!==E&&(p.current.newIndex=E),l!==p.current.containerId&&(p.current.containerId=l),i!==p.current.items&&(p.current.items=i)},[S,E,l,i]),v.useEffect(()=>{if(A===p.current.activeId)return;if(A!=null&&p.current.activeId==null){p.current.activeId=A;return}const ue=setTimeout(()=>{p.current.activeId=A},50);return()=>clearTimeout(ue)},[A]),{active:T,activeIndex:d,attributes:te,data:D,rect:N,index:b,newIndex:E,items:i,isOver:W,isSorting:S,isDragging:M,listeners:re,node:z,overIndex:h,over:ne,setNodeRef:ae,setActivatorNodeRef:se,setDroppableNodeRef:P,setDraggableNodeRef:X,transform:$??ie,transition:le()};function le(){if($||ce&&p.current.newIndex===b)return Ee;if(!(j&&!ve(Z)||!u)&&(S||G))return Y.Transition.toString({...u,property:J})}}function Le(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e?.draggable)!=null?n:t.draggable,droppable:(r=e?.droppable)!=null?r:t.droppable}}function k(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const ke=[y.Down,y.Right,y.Up,y.Left],Fe=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:s,droppableContainers:a,over:o,scrollableAncestors:c}}=t;if(ke.includes(e.code)){if(e.preventDefault(),!n||!r)return;const f=[];a.getEnabled().forEach(l=>{if(!l||l!=null&&l.disabled)return;const d=s.get(l.id);if(d)switch(e.code){case y.Down:r.top<d.top&&f.push(l);break;case y.Up:r.top>d.top&&f.push(l);break;case y.Left:r.left>d.left&&f.push(l);break;case y.Right:r.left<d.left&&f.push(l);break}});const u=me({collisionRect:r,droppableRects:s,droppableContainers:f});let i=xe(u,"id");if(i===o?.id&&u.length>1&&(i=u[1].id),i!=null){const l=a.get(n.id),d=a.get(i),g=d?s.get(d.id):null,R=d?.node.current;if(R&&g&&l&&d){const h=Ie(R).some((I,N)=>c[N]!==I),w=Q(l,d),x=Me(l,d),m=h||!w?{x:0,y:0}:{x:x?r.width-g.width:0,y:x?r.height-g.height:0},b={x:g.left,y:g.top};return m.x&&m.y?b:ye(b,m)}}}};function Q(e,t){return!k(e)||!k(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function Me(e,t){return!k(e)||!k(t)||!Q(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}export{_e as S,q as a,B as r,Fe as s,je as u,Xe as v};
1
+ import{r as v,fi as K}from"./index-Cm-moWa5.js";import{d as de,e as fe,f as U,g as ge,h as pe,i as be,j as ve,C as Y,k as he,l as y,m as me,n as xe,o as Ie,s as ye}from"./core.esm-CiyyLnsG.js";function q(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Re(e,t){return e.reduce((n,r,s)=>{const a=t.get(r);return a&&(n[s]=a),n},Array(e.length))}function O(e){return e!==null&&e>=0}function Ce(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function we(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const B=e=>{let{rects:t,activeIndex:n,overIndex:r,index:s}=e;const a=q(t,r,n),o=t[s],c=a[s];return!c||!o?null:{x:c.left-o.left,y:c.top-o.top,scaleX:c.width/o.width,scaleY:c.height/o.height}},L={scaleX:1,scaleY:1},Xe=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:s,rects:a,overIndex:o}=e;const c=(t=a[n])!=null?t:r;if(!c)return null;if(s===n){const u=a[o];return u?{x:0,y:n<o?u.top+u.height-(c.top+c.height):u.top-c.top,...L}:null}const f=De(a,s,n);return s>n&&s<=o?{x:0,y:-c.height-f,...L}:s<n&&s>=o?{x:0,y:c.height+f,...L}:{x:0,y:0,...L}};function De(e,t,n){const r=e[t],s=e[t-1],a=e[t+1];return r?n<t?s?r.top-(s.top+s.height):a?a.top-(r.top+r.height):0:a?a.top-(r.top+r.height):s?r.top-(s.top+s.height):0:0}const H="Sortable",V=K.createContext({activeIndex:-1,containerId:H,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:B,disabled:{draggable:!1,droppable:!1}});function _e(e){let{children:t,id:n,items:r,strategy:s=B,disabled:a=!1}=e;const{active:o,dragOverlay:c,droppableRects:f,over:u,measureDroppableContainers:i}=de(),l=fe(H,n),d=c.rect!==null,g=v.useMemo(()=>r.map(I=>typeof I=="object"&&"id"in I?I.id:I),[r]),R=o!=null,C=o?g.indexOf(o.id):-1,h=u?g.indexOf(u.id):-1,w=v.useRef(g),x=!Ce(g,w.current),m=h!==-1&&C===-1||x,b=we(a);U(()=>{x&&R&&i(g)},[x,g,R,i]),v.useEffect(()=>{w.current=g},[g]);const D=v.useMemo(()=>({activeIndex:C,containerId:l,disabled:b,disableTransforms:m,items:g,overIndex:h,useDragOverlay:d,sortedRects:Re(g,f),strategy:s}),[C,l,b.draggable,b.droppable,m,g,h,f,d,s]);return K.createElement(V.Provider,{value:D},t)}const Se=e=>{let{id:t,items:n,activeIndex:r,overIndex:s}=e;return q(n,r,s).indexOf(t)},Ae=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:s,items:a,newIndex:o,previousItems:c,previousContainerId:f,transition:u}=e;return!u||!r||c!==a&&s===o?!1:n?!0:o!==s&&t===f},Te={duration:200,easing:"ease"},J="transform",Ee=Y.Transition.toString({property:J,duration:0,easing:"linear"}),Ne={roleDescription:"sortable"};function Oe(e){let{disabled:t,index:n,node:r,rect:s}=e;const[a,o]=v.useState(null),c=v.useRef(n);return U(()=>{if(!t&&n!==c.current&&r.current){const f=s.current;if(f){const u=he(r.current,{ignoreTransform:!0}),i={x:f.left-u.left,y:f.top-u.top,scaleX:f.width/u.width,scaleY:f.height/u.height};(i.x||i.y)&&o(i)}}n!==c.current&&(c.current=n)},[t,n,r,s]),v.useEffect(()=>{a&&o(null)},[a]),a}function je(e){let{animateLayoutChanges:t=Ae,attributes:n,disabled:r,data:s,getNewIndex:a=Se,id:o,strategy:c,resizeObserverConfig:f,transition:u=Te}=e;const{items:i,containerId:l,activeIndex:d,disabled:g,disableTransforms:R,sortedRects:C,overIndex:h,useDragOverlay:w,strategy:x}=v.useContext(V),m=Le(r,g),b=i.indexOf(o),D=v.useMemo(()=>({sortable:{containerId:l,index:b,items:i},...s}),[l,s,b,i]),I=v.useMemo(()=>i.slice(i.indexOf(o)),[i,o]),{rect:N,node:z,isOver:W,setNodeRef:P}=ge({id:o,data:D,disabled:m.droppable,resizeObserverConfig:{updateMeasurementsFor:I,...f}}),{active:T,activatorEvent:Z,activeNodeRect:ee,attributes:te,setNodeRef:X,listeners:re,isDragging:M,over:ne,setActivatorNodeRef:se,transform:oe}=pe({id:o,data:D,attributes:{...Ne,...n},disabled:m.draggable}),ae=be(P,X),S=!!T,_=S&&!R&&O(d)&&O(h),j=!w&&M,F=j&&_?oe:null,ie=_?F??(c??x)({rects:C,activeNodeRect:ee,activeIndex:d,overIndex:h,index:b}):null,E=O(d)&&O(h)?a({id:o,items:i,activeIndex:d,overIndex:h}):b,A=T?.id,p=v.useRef({activeId:A,items:i,newIndex:E,containerId:l}),ce=i!==p.current.items,G=t({active:T,containerId:l,isDragging:M,isSorting:S,id:o,index:b,items:i,newIndex:p.current.newIndex,previousItems:p.current.items,previousContainerId:p.current.containerId,transition:u,wasDragging:p.current.activeId!=null}),$=Oe({disabled:!G,index:b,node:z,rect:N});return v.useEffect(()=>{S&&p.current.newIndex!==E&&(p.current.newIndex=E),l!==p.current.containerId&&(p.current.containerId=l),i!==p.current.items&&(p.current.items=i)},[S,E,l,i]),v.useEffect(()=>{if(A===p.current.activeId)return;if(A!=null&&p.current.activeId==null){p.current.activeId=A;return}const ue=setTimeout(()=>{p.current.activeId=A},50);return()=>clearTimeout(ue)},[A]),{active:T,activeIndex:d,attributes:te,data:D,rect:N,index:b,newIndex:E,items:i,isOver:W,isSorting:S,isDragging:M,listeners:re,node:z,overIndex:h,over:ne,setNodeRef:ae,setActivatorNodeRef:se,setDroppableNodeRef:P,setDraggableNodeRef:X,transform:$??ie,transition:le()};function le(){if($||ce&&p.current.newIndex===b)return Ee;if(!(j&&!ve(Z)||!u)&&(S||G))return Y.Transition.toString({...u,property:J})}}function Le(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e?.draggable)!=null?n:t.draggable,droppable:(r=e?.droppable)!=null?r:t.droppable}}function k(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const ke=[y.Down,y.Right,y.Up,y.Left],Fe=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:s,droppableContainers:a,over:o,scrollableAncestors:c}}=t;if(ke.includes(e.code)){if(e.preventDefault(),!n||!r)return;const f=[];a.getEnabled().forEach(l=>{if(!l||l!=null&&l.disabled)return;const d=s.get(l.id);if(d)switch(e.code){case y.Down:r.top<d.top&&f.push(l);break;case y.Up:r.top>d.top&&f.push(l);break;case y.Left:r.left>d.left&&f.push(l);break;case y.Right:r.left<d.left&&f.push(l);break}});const u=me({collisionRect:r,droppableRects:s,droppableContainers:f});let i=xe(u,"id");if(i===o?.id&&u.length>1&&(i=u[1].id),i!=null){const l=a.get(n.id),d=a.get(i),g=d?s.get(d.id):null,R=d?.node.current;if(R&&g&&l&&d){const h=Ie(R).some((I,N)=>c[N]!==I),w=Q(l,d),x=Me(l,d),m=h||!w?{x:0,y:0}:{x:x?r.width-g.width:0,y:x?r.height-g.height:0},b={x:g.left,y:g.top};return m.x&&m.y?b:ye(b,m)}}}};function Q(e,t){return!k(e)||!k(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function Me(e,t){return!k(e)||!k(t)||!Q(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}export{_e as S,q as a,B as r,Fe as s,je as u,Xe as v};
@@ -1 +1 @@
1
- import{b as A,a5 as B,r as v,j as e,n as x,hk as k,gN as b,g2 as y,g3 as a,i1 as D,B as m,I as g,aN as z,aM as T,aJ as O,aH as R,aL as F,aK as M,bj as q,E as C,t as c,c as U}from"./index-ThHlPkA1.js";import{D as H}from"./domain-settings-BmNyQb_H.js";import{S as $}from"./switch-CT_-wvDo.js";import{a as J,b as K,c as G,d as Q}from"./use-org-sso-ChcM6ORm.js";import{s as V}from"./Trash01-D1V404v-.js";import{R as W}from"./require-capability-Zb9L0UB5.js";import"./badge-Ksu8KJbs.js";import"./select-CCYd2TPQ.js";import"./index-BdQq_4o_.js";import"./index-B6uyloRF.js";import"./ChevronUp-BQPjne-n.js";import"./access-gate-DlxNXK1w.js";import"./capability-load-error-C3U-ZhDb.js";function X(){const s=A(),{org:o}=B(),{data:h,isLoading:I}=J(o.id,o.slug),f=K(o.id,o.slug),S=G(o.id,o.slug),E=Q(o.id,o.slug),[i,l]=v.useState({issuer:"",clientId:"",clientSecret:"",discoveryEndpoint:"",domain:"",scopes:"openid email profile"}),[d,p]=v.useState(!1),[P,j]=v.useState(!1),u=h?.configured&&h.config,n=h?.config,N=()=>{n&&l({issuer:n.issuer,clientId:n.clientId,clientSecret:"",discoveryEndpoint:n.discoveryEndpoint??"",domain:n.domain,scopes:n.scopes.join(" ")}),p(!0)},_=async()=>{if(!i.issuer||!i.clientId||!i.domain){c.error(s("settings.orgSso.requiredFieldsError"));return}if(!u&&!i.clientSecret){c.error(s("settings.orgSso.clientSecretRequiredError"));return}try{await f.mutateAsync({issuer:i.issuer,clientId:i.clientId,clientSecret:i.clientSecret,discoveryEndpoint:i.discoveryEndpoint||void 0,scopes:i.scopes.split(/\s+/).filter(Boolean),domain:i.domain,enforced:n?.enforced??!1}),C(u?"sso_config_updated":"sso_configured",{organization_id:o.id,email_domain:i.domain}),c.success(s("settings.orgSso.configurationSavedSuccess")),p(!1)}catch(t){c.error(t instanceof Error?t.message:s("settings.orgSso.saveSsoConfigError"))}},w=async()=>{try{await S.mutateAsync(),C("sso_config_removed",{organization_id:o.id}),c.success(s("settings.orgSso.configurationRemovedSuccess")),p(!1),j(!1)}catch{c.error(s("settings.orgSso.removeSsoConfigError"))}},L=async t=>{try{await E.mutateAsync(t),C("sso_enforcement_toggled",{organization_id:o.id,enforced:t}),c.success(s(t?"settings.orgSso.enforcementEnabledSuccess":"settings.orgSso.enforcementDisabledSuccess"))}catch{c.error(s("settings.orgSso.toggleEnforcementError"))}};return e.jsxs(x,{children:[e.jsx(x.Content,{children:e.jsx(x.Container,{children:e.jsxs(k,{children:[e.jsx(x.Title,{children:s("settings.orgSso.securityTitle")}),e.jsx(H,{}),I?e.jsx("div",{className:"text-sm text-muted-foreground",children:s("settings.orgSso.loading")}):e.jsxs(e.Fragment,{children:[u&&!d&&e.jsx(b,{title:s("settings.orgSso.sectionTitle"),children:e.jsxs(y,{children:[e.jsx(a,{title:s("settings.orgSso.providerLabel"),action:e.jsx("span",{className:"font-medium",children:n.issuer})}),e.jsx(a,{title:s("settings.orgSso.clientIdLabel"),action:e.jsx("span",{className:"font-mono text-xs",children:n.clientId})}),e.jsx(a,{title:s("settings.orgSso.domainLabel"),action:e.jsx("span",{className:"font-medium",children:n.domain})}),e.jsx(a,{title:s("settings.orgSso.scopesLabel"),action:e.jsx("span",{className:"font-mono text-xs",children:n.scopes.join(" ")})}),e.jsx("div",{className:"h-px bg-border mx-5"}),e.jsx(a,{title:s("settings.orgSso.enforceSsoLabel"),description:s("settings.orgSso.enforceSsoDescription"),action:e.jsx($,{checked:n.enforced,onCheckedChange:L,disabled:E.isPending})}),e.jsxs(D,{children:[e.jsxs(m,{variant:"ghost",size:"sm",onClick:()=>j(!0),disabled:S.isPending,className:"text-destructive hover:text-destructive mr-auto",children:[e.jsx(V,{size:14}),s("settings.orgSso.removeButton")]}),e.jsx(m,{variant:"outline",size:"sm",onClick:()=>{window.open(`/api/${o.slug}/sso/authorize`,"_blank")},children:s("settings.orgSso.testSsoButton")}),e.jsx(m,{variant:"outline",size:"sm",onClick:N,children:s("settings.orgSso.editConfigButton")})]})]})}),(!u||d)&&e.jsx(b,{title:s("settings.orgSso.sectionTitle"),children:e.jsxs(y,{children:[e.jsx(a,{title:s("settings.orgSso.issuerUrlLabel"),description:s("settings.orgSso.issuerUrlDescription"),action:e.jsx(g,{id:"sso-issuer",placeholder:s("settings.orgSso.issuerUrlPlaceholder"),value:i.issuer,onChange:t=>l(r=>({...r,issuer:t.target.value})),className:"w-[280px]"})}),e.jsx(a,{title:s("settings.orgSso.clientIdLabel"),action:e.jsx(g,{id:"sso-client-id",placeholder:s("settings.orgSso.clientIdPlaceholder"),value:i.clientId,onChange:t=>l(r=>({...r,clientId:t.target.value})),className:"w-[280px]"})}),e.jsx(a,{title:s("settings.orgSso.clientSecretLabel"),description:d&&u?s("settings.orgSso.clientSecretEditDescription"):void 0,action:e.jsx(g,{id:"sso-client-secret",type:"password",placeholder:s("settings.orgSso.clientSecretPlaceholder"),value:i.clientSecret,onChange:t=>l(r=>({...r,clientSecret:t.target.value})),className:"w-[280px]"})}),e.jsx(a,{title:s("settings.orgSso.emailDomainLabel"),description:s("settings.orgSso.emailDomainDescription"),action:e.jsx(g,{id:"sso-domain",placeholder:s("settings.orgSso.emailDomainPlaceholder"),value:i.domain,onChange:t=>l(r=>({...r,domain:t.target.value})),className:"w-[280px]"})}),e.jsx(a,{title:s("settings.orgSso.scopesLabel"),action:e.jsx(g,{id:"sso-scopes",placeholder:s("settings.orgSso.scopesPlaceholder"),value:i.scopes,onChange:t=>l(r=>({...r,scopes:t.target.value})),className:"w-[280px]"})}),e.jsx(a,{title:s("settings.orgSso.discoveryEndpointLabel"),description:s("settings.orgSso.discoveryEndpointDescription"),action:e.jsx(g,{id:"sso-discovery",placeholder:s("settings.orgSso.discoveryEndpointPlaceholder"),value:i.discoveryEndpoint,onChange:t=>l(r=>({...r,discoveryEndpoint:t.target.value})),className:"w-[280px]"})}),e.jsxs(D,{children:[d&&e.jsx(m,{variant:"outline",size:"sm",onClick:()=>p(!1),children:s("settings.orgSso.cancelButton")}),e.jsx(m,{onClick:_,disabled:f.isPending,size:"sm",children:f.isPending?s("settings.orgSso.savingButton"):s(d?"settings.orgSso.updateButton":"settings.orgSso.configureSsoButton")})]})]})})]})]})})}),e.jsx(z,{open:P,onOpenChange:j,children:e.jsxs(T,{children:[e.jsx(O,{children:e.jsx(R,{children:s("settings.orgSso.removeConfirmation")})}),e.jsxs(F,{children:[e.jsx(M,{disabled:S.isPending,children:s("settings.orgSso.cancelButton")}),e.jsx(q,{onClick:w,disabled:S.isPending,variant:"destructive",children:s("settings.orgSso.removeButton")})]})]})})]})}function de(){const s=U.c(1);let o;return s[0]===Symbol.for("react.memo_cache_sentinel")?(o=e.jsx(W,{capability:"org:manage",area:"security",children:e.jsx(X,{})}),s[0]=o):o=s[0],o}export{de as default};
1
+ import{b as A,a5 as B,r as v,j as e,n as x,hl as k,gO as b,g3 as y,g4 as a,i2 as D,B as m,I as g,aN as z,aM as O,aJ as T,aH as R,aL as F,aK as M,bj as q,E as C,t as c,c as U}from"./index-Cm-moWa5.js";import{D as H}from"./domain-settings-k6_UVS3e.js";import{S as $}from"./switch-Ddk_-Adw.js";import{a as J,b as K,c as G,d as Q}from"./use-org-sso-DatsrvZR.js";import{s as V}from"./Trash01-Bif7g_Tq.js";import{R as W}from"./require-capability-CJKpnzPC.js";import"./badge-BpuDiibz.js";import"./select-Bc6SUkDB.js";import"./index-BdQq_4o_.js";import"./index-CZmp59DI.js";import"./ChevronUp-Dg02PCVC.js";import"./access-gate-BZysXSEP.js";import"./capability-load-error-DIv2eZlz.js";function X(){const s=A(),{org:o}=B(),{data:h,isLoading:I}=J(o.id,o.slug),f=K(o.id,o.slug),S=G(o.id,o.slug),E=Q(o.id,o.slug),[i,l]=v.useState({issuer:"",clientId:"",clientSecret:"",discoveryEndpoint:"",domain:"",scopes:"openid email profile"}),[d,p]=v.useState(!1),[P,j]=v.useState(!1),u=h?.configured&&h.config,n=h?.config,N=()=>{n&&l({issuer:n.issuer,clientId:n.clientId,clientSecret:"",discoveryEndpoint:n.discoveryEndpoint??"",domain:n.domain,scopes:n.scopes.join(" ")}),p(!0)},_=async()=>{if(!i.issuer||!i.clientId||!i.domain){c.error(s("settings.orgSso.requiredFieldsError"));return}if(!u&&!i.clientSecret){c.error(s("settings.orgSso.clientSecretRequiredError"));return}try{await f.mutateAsync({issuer:i.issuer,clientId:i.clientId,clientSecret:i.clientSecret,discoveryEndpoint:i.discoveryEndpoint||void 0,scopes:i.scopes.split(/\s+/).filter(Boolean),domain:i.domain,enforced:n?.enforced??!1}),C(u?"sso_config_updated":"sso_configured",{organization_id:o.id,email_domain:i.domain}),c.success(s("settings.orgSso.configurationSavedSuccess")),p(!1)}catch(t){c.error(t instanceof Error?t.message:s("settings.orgSso.saveSsoConfigError"))}},w=async()=>{try{await S.mutateAsync(),C("sso_config_removed",{organization_id:o.id}),c.success(s("settings.orgSso.configurationRemovedSuccess")),p(!1),j(!1)}catch{c.error(s("settings.orgSso.removeSsoConfigError"))}},L=async t=>{try{await E.mutateAsync(t),C("sso_enforcement_toggled",{organization_id:o.id,enforced:t}),c.success(s(t?"settings.orgSso.enforcementEnabledSuccess":"settings.orgSso.enforcementDisabledSuccess"))}catch{c.error(s("settings.orgSso.toggleEnforcementError"))}};return e.jsxs(x,{children:[e.jsx(x.Content,{children:e.jsx(x.Container,{children:e.jsxs(k,{children:[e.jsx(x.Title,{children:s("settings.orgSso.securityTitle")}),e.jsx(H,{}),I?e.jsx("div",{className:"text-sm text-muted-foreground",children:s("settings.orgSso.loading")}):e.jsxs(e.Fragment,{children:[u&&!d&&e.jsx(b,{title:s("settings.orgSso.sectionTitle"),children:e.jsxs(y,{children:[e.jsx(a,{title:s("settings.orgSso.providerLabel"),action:e.jsx("span",{className:"font-medium",children:n.issuer})}),e.jsx(a,{title:s("settings.orgSso.clientIdLabel"),action:e.jsx("span",{className:"font-mono text-xs",children:n.clientId})}),e.jsx(a,{title:s("settings.orgSso.domainLabel"),action:e.jsx("span",{className:"font-medium",children:n.domain})}),e.jsx(a,{title:s("settings.orgSso.scopesLabel"),action:e.jsx("span",{className:"font-mono text-xs",children:n.scopes.join(" ")})}),e.jsx("div",{className:"h-px bg-border mx-5"}),e.jsx(a,{title:s("settings.orgSso.enforceSsoLabel"),description:s("settings.orgSso.enforceSsoDescription"),action:e.jsx($,{checked:n.enforced,onCheckedChange:L,disabled:E.isPending})}),e.jsxs(D,{children:[e.jsxs(m,{variant:"ghost",size:"sm",onClick:()=>j(!0),disabled:S.isPending,className:"text-destructive hover:text-destructive mr-auto",children:[e.jsx(V,{size:14}),s("settings.orgSso.removeButton")]}),e.jsx(m,{variant:"outline",size:"sm",onClick:()=>{window.open(`/api/${o.slug}/sso/authorize`,"_blank")},children:s("settings.orgSso.testSsoButton")}),e.jsx(m,{variant:"outline",size:"sm",onClick:N,children:s("settings.orgSso.editConfigButton")})]})]})}),(!u||d)&&e.jsx(b,{title:s("settings.orgSso.sectionTitle"),children:e.jsxs(y,{children:[e.jsx(a,{title:s("settings.orgSso.issuerUrlLabel"),description:s("settings.orgSso.issuerUrlDescription"),action:e.jsx(g,{id:"sso-issuer",placeholder:s("settings.orgSso.issuerUrlPlaceholder"),value:i.issuer,onChange:t=>l(r=>({...r,issuer:t.target.value})),className:"w-[280px]"})}),e.jsx(a,{title:s("settings.orgSso.clientIdLabel"),action:e.jsx(g,{id:"sso-client-id",placeholder:s("settings.orgSso.clientIdPlaceholder"),value:i.clientId,onChange:t=>l(r=>({...r,clientId:t.target.value})),className:"w-[280px]"})}),e.jsx(a,{title:s("settings.orgSso.clientSecretLabel"),description:d&&u?s("settings.orgSso.clientSecretEditDescription"):void 0,action:e.jsx(g,{id:"sso-client-secret",type:"password",placeholder:s("settings.orgSso.clientSecretPlaceholder"),value:i.clientSecret,onChange:t=>l(r=>({...r,clientSecret:t.target.value})),className:"w-[280px]"})}),e.jsx(a,{title:s("settings.orgSso.emailDomainLabel"),description:s("settings.orgSso.emailDomainDescription"),action:e.jsx(g,{id:"sso-domain",placeholder:s("settings.orgSso.emailDomainPlaceholder"),value:i.domain,onChange:t=>l(r=>({...r,domain:t.target.value})),className:"w-[280px]"})}),e.jsx(a,{title:s("settings.orgSso.scopesLabel"),action:e.jsx(g,{id:"sso-scopes",placeholder:s("settings.orgSso.scopesPlaceholder"),value:i.scopes,onChange:t=>l(r=>({...r,scopes:t.target.value})),className:"w-[280px]"})}),e.jsx(a,{title:s("settings.orgSso.discoveryEndpointLabel"),description:s("settings.orgSso.discoveryEndpointDescription"),action:e.jsx(g,{id:"sso-discovery",placeholder:s("settings.orgSso.discoveryEndpointPlaceholder"),value:i.discoveryEndpoint,onChange:t=>l(r=>({...r,discoveryEndpoint:t.target.value})),className:"w-[280px]"})}),e.jsxs(D,{children:[d&&e.jsx(m,{variant:"outline",size:"sm",onClick:()=>p(!1),children:s("settings.orgSso.cancelButton")}),e.jsx(m,{onClick:_,disabled:f.isPending,size:"sm",children:f.isPending?s("settings.orgSso.savingButton"):s(d?"settings.orgSso.updateButton":"settings.orgSso.configureSsoButton")})]})]})})]})]})})}),e.jsx(z,{open:P,onOpenChange:j,children:e.jsxs(O,{children:[e.jsx(T,{children:e.jsx(R,{children:s("settings.orgSso.removeConfirmation")})}),e.jsxs(F,{children:[e.jsx(M,{disabled:S.isPending,children:s("settings.orgSso.cancelButton")}),e.jsx(q,{onClick:w,disabled:S.isPending,variant:"destructive",children:s("settings.orgSso.removeButton")})]})]})})]})}function de(){const s=U.c(1);let o;return s[0]===Symbol.for("react.memo_cache_sentinel")?(o=e.jsx(W,{capability:"org:manage",area:"security",children:e.jsx(X,{})}),s[0]=o):o=s[0],o}export{de as default};
@@ -1,2 +1,2 @@
1
- import{t as Ye,n as ie,o as Qe,D as Ge,v as ze,w as Ze}from"./usage-stats-QxuZaLxO.js";import{r as p,gg as Je,g6 as we,gh as et,gi as j,gj as te,j as I,bQ as tt,gk as nt,gl as ne,gm as ot,gn as rt,go as st,gp as it,gq as at,gr as lt,gs as Ce,gt as ct,c as H,V as ut,K as dt,gu as ft,gv as gt,gw as mt,b as pt,m as vt,h as ht}from"./index-ThHlPkA1.js";import{g as bt,d as xt}from"./tool-namespace-BZTsC2dJ.js";import{A as yt}from"./agent-icon-DCW_KqWB.js";var Hn=Ye;var Rt=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],ae=Rt.join(","),Ie=typeof Element>"u",G=Ie?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,J=!Ie&&Element.prototype.getRootNode?function(n){var e;return n==null||(e=n.getRootNode)===null||e===void 0?void 0:e.call(n)}:function(n){return n?.ownerDocument},ee=function(e,t){var o;t===void 0&&(t=!0);var r=e==null||(o=e.getAttribute)===null||o===void 0?void 0:o.call(e,"inert"),s=r===""||r==="true",i=s||t&&e&&(typeof e.closest=="function"?e.closest("[inert]"):ee(e.parentNode));return i},St=function(e){var t,o=e==null||(t=e.getAttribute)===null||t===void 0?void 0:t.call(e,"contenteditable");return o===""||o==="true"},Et=function(e,t,o){if(ee(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(ae));return t&&G.call(e,ae)&&r.unshift(e),r=r.filter(o),r},le=function(e,t,o){for(var r=[],s=Array.from(e);s.length;){var i=s.shift();if(!ee(i,!1))if(i.tagName==="SLOT"){var a=i.assignedElements(),l=a.length?a:i.children,c=le(l,!0,o);o.flatten?r.push.apply(r,c):r.push({scopeParent:i,candidates:c})}else{var d=G.call(i,ae);d&&o.filter(i)&&(t||!e.includes(i))&&r.push(i);var u=i.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(i),g=!ee(u,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(i));if(u&&g){var h=le(u===!0?i.children:u.children,!0,o);o.flatten?r.push.apply(r,h):r.push({scopeParent:i,candidates:h})}else s.unshift.apply(s,i.children)}}return r},Te=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Pe=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||St(e))&&!Te(e)?0:e.tabIndex},wt=function(e,t){var o=Pe(e);return o<0&&t&&!Te(e)?0:o},Ct=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Ae=function(e){return e.tagName==="INPUT"},It=function(e){return Ae(e)&&e.type==="hidden"},Tt=function(e){var t=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(o){return o.tagName==="SUMMARY"});return t},Pt=function(e,t){for(var o=0;o<e.length;o++)if(e[o].checked&&e[o].form===t)return e[o]},At=function(e){if(!e.name)return!0;var t=e.form||J(e),o=function(a){return t.querySelectorAll('input[type="radio"][name="'+a+'"]')},r;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")r=o(window.CSS.escape(e.name));else try{r=o(e.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var s=Pt(r,e.form);return!s||s===e},Nt=function(e){return Ae(e)&&e.type==="radio"},Dt=function(e){return Nt(e)&&!At(e)},Mt=function(e){var t,o=e&&J(e),r=(t=o)===null||t===void 0?void 0:t.host,s=!1;if(o&&o!==e){var i,a,l;for(s=!!((i=r)!==null&&i!==void 0&&(a=i.ownerDocument)!==null&&a!==void 0&&a.contains(r)||e!=null&&(l=e.ownerDocument)!==null&&l!==void 0&&l.contains(e));!s&&r;){var c,d,u;o=J(r),r=(c=o)===null||c===void 0?void 0:c.host,s=!!((d=r)!==null&&d!==void 0&&(u=d.ownerDocument)!==null&&u!==void 0&&u.contains(r))}}return s},ge=function(e){var t=e.getBoundingClientRect(),o=t.width,r=t.height;return o===0&&r===0},Ot=function(e,t){var o=t.displayCheck,r=t.getShadowRoot;if(o==="full-native"&&"checkVisibility"in e){var s=e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(e).visibility==="hidden")return!0;var i=G.call(e,"details>summary:first-of-type"),a=i?e.parentElement:e;if(G.call(a,"details:not([open]) *"))return!0;if(!o||o==="full"||o==="full-native"||o==="legacy-full"){if(typeof r=="function"){for(var l=e;e;){var c=e.parentElement,d=J(e);if(c&&!c.shadowRoot&&r(c)===!0)return ge(e);e.assignedSlot?e=e.assignedSlot:!c&&d!==e.ownerDocument?e=d.host:e=c}e=l}if(Mt(e))return!e.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return ge(e);return!1},Ft=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName==="FIELDSET"&&t.disabled){for(var o=0;o<t.children.length;o++){var r=t.children.item(o);if(r.tagName==="LEGEND")return G.call(t,"fieldset[disabled] *")?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},qt=function(e,t){return!(t.disabled||It(t)||Ot(t,e)||Tt(t)||Ft(t))},me=function(e,t){return!(Dt(t)||Pe(t)<0||!qt(e,t))},$t=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Ne=function(e){var t=[],o=[];return e.forEach(function(r,s){var i=!!r.scopeParent,a=i?r.scopeParent:r,l=wt(a,i),c=i?Ne(r.candidates):a;l===0?i?t.push.apply(t,c):t.push(a):o.push({documentOrder:s,tabIndex:l,item:r,isScope:i,content:c})}),o.sort(Ct).reduce(function(r,s){return s.isScope?r.push.apply(r,s.content):r.push(s.content),r},[]).concat(t)},De=function(e,t){t=t||{};var o;return t.getShadowRoot?o=le([e],t.includeContainer,{filter:me.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:$t}):o=Et(e,t.includeContainer,me.bind(null,t)),Ne(o)};function kt(){return/apple/i.test(navigator.vendor)}const pe="data-floating-ui-focusable";function _t(n){let e=n.activeElement;for(;((t=e)==null||(t=t.shadowRoot)==null?void 0:t.activeElement)!=null;){var t;e=e.shadowRoot.activeElement}return e}function ce(n,e){if(!n||!e)return!1;const t=e.getRootNode==null?void 0:e.getRootNode();if(n.contains(e))return!0;if(t&&Je(t)){let o=e;for(;o;){if(n===o)return!0;o=o.parentNode||o.host}}return!1}function Q(n){return"composedPath"in n?n.composedPath()[0]:n.target}function oe(n,e){if(e==null)return!1;if("composedPath"in n)return n.composedPath().includes(e);const t=n;return t.target!=null&&e.contains(t.target)}function Lt(n){return n.matches("html,body")}function z(n){return n?.ownerDocument||document}function jt(n){return n?n.hasAttribute(pe)?n:n.querySelector("["+pe+"]")||n:null}function Z(n,e,t){return t===void 0&&(t=!0),n.filter(r=>{var s;return r.parentId===e&&(!t||((s=r.context)==null?void 0:s.open))}).flatMap(r=>[r,...Z(n,r.id,t)])}function Kt(n){return"nativeEvent"in n}var Bt=typeof document<"u",Ut=function(){},V=Bt?p.useLayoutEffect:Ut;const Vt={...we},Wt=Vt.useInsertionEffect,Ht=Wt||(n=>n());function W(n){const e=p.useRef(()=>{});return Ht(()=>{e.current=n}),p.useCallback(function(){for(var t=arguments.length,o=new Array(t),r=0;r<t;r++)o[r]=arguments[r];return e.current==null?void 0:e.current(...o)},[])}const Me=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Oe(n,e){const t=De(n,Me()),o=t.length;if(o===0)return;const r=_t(z(n)),s=t.indexOf(r),i=s===-1?e===1?0:o-1:s+e;return t[i]}function Xt(n){return Oe(z(n).body,1)||n}function Yt(n){return Oe(z(n).body,-1)||n}function re(n,e){const t=e||n.currentTarget,o=n.relatedTarget;return!o||!ce(t,o)}function Qt(n){De(n,Me()).forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")})}function ve(n){n.querySelectorAll("[data-tabindex]").forEach(t=>{const o=t.dataset.tabindex;delete t.dataset.tabindex,o?t.setAttribute("tabindex",o):t.removeAttribute("tabindex")})}const Gt="data-floating-ui-focusable",he="active",be="selected",zt={...we};let xe=!1,Zt=0;const ye=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Zt++;function Jt(){const[n,e]=p.useState(()=>xe?ye():void 0);return V(()=>{n==null&&e(ye())},[]),p.useEffect(()=>{xe=!0},[]),n}const en=zt.useId,ue=en||Jt;function tn(){const n=new Map;return{emit(e,t){var o;(o=n.get(e))==null||o.forEach(r=>r(t))},on(e,t){n.has(e)||n.set(e,new Set),n.get(e).add(t)},off(e,t){var o;(o=n.get(e))==null||o.delete(t)}}}const nn=p.createContext(null),on=p.createContext(null),Fe=()=>{var n;return((n=p.useContext(nn))==null?void 0:n.id)||null},qe=()=>p.useContext(on);function de(n){return"data-floating-ui-"+n}const rn={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},Re=p.forwardRef(function(e,t){const[o,r]=p.useState();V(()=>{kt()&&r("button")},[]);const s={ref:t,tabIndex:0,role:o,"aria-hidden":o?void 0:!0,[de("focus-guard")]:"",style:rn};return I.jsx("span",{...e,...s})}),sn={clipPath:"inset(50%)",position:"fixed",top:0,left:0},$e=p.createContext(null),Se=de("portal");function an(n){n===void 0&&(n={});const{id:e,root:t}=n,o=ue(),r=cn(),[s,i]=p.useState(null),a=p.useRef(null);return V(()=>()=>{s?.remove(),queueMicrotask(()=>{a.current=null})},[s]),V(()=>{if(!o||a.current)return;const l=e?document.getElementById(e):null;if(!l)return;const c=document.createElement("div");c.id=o,c.setAttribute(Se,""),l.appendChild(c),a.current=c,i(c)},[e,o]),V(()=>{if(t===null||!o||a.current)return;let l=t||r?.portalNode;l&&!it(l)&&(l=l.current),l=l||document.body;let c=null;e&&(c=document.createElement("div"),c.id=e,l.appendChild(c));const d=document.createElement("div");d.id=o,d.setAttribute(Se,""),l=c||l,l.appendChild(d),a.current=d,i(d)},[e,t,o,r]),s}function ln(n){const{children:e,id:t,root:o,preserveTabOrder:r=!0}=n,s=an({id:t,root:o}),[i,a]=p.useState(null),l=p.useRef(null),c=p.useRef(null),d=p.useRef(null),u=p.useRef(null),g=i?.modal,h=i?.open,y=!!i&&!i.modal&&i.open&&r&&!!(o||s);return p.useEffect(()=>{if(!s||!r||g)return;function m(f){s&&re(f)&&(f.type==="focusin"?ve:Qt)(s)}return s.addEventListener("focusin",m,!0),s.addEventListener("focusout",m,!0),()=>{s.removeEventListener("focusin",m,!0),s.removeEventListener("focusout",m,!0)}},[s,r,g]),p.useEffect(()=>{s&&(h||ve(s))},[h,s]),I.jsxs($e.Provider,{value:p.useMemo(()=>({preserveTabOrder:r,beforeOutsideRef:l,afterOutsideRef:c,beforeInsideRef:d,afterInsideRef:u,portalNode:s,setFocusManagerState:a}),[r,s]),children:[y&&s&&I.jsx(Re,{"data-type":"outside",ref:l,onFocus:m=>{if(re(m,s)){var f;(f=d.current)==null||f.focus()}else{const x=i?i.domReference:null,b=Yt(x);b?.focus()}}}),y&&s&&I.jsx("span",{"aria-owns":s.id,style:sn}),s&&tt.createPortal(e,s),y&&s&&I.jsx(Re,{"data-type":"outside",ref:c,onFocus:m=>{if(re(m,s)){var f;(f=u.current)==null||f.focus()}else{const x=i?i.domReference:null,b=Xt(x);b?.focus(),i?.closeOnFocusOut&&i?.onOpenChange(!1,m.nativeEvent,"focus-out")}}})]})}const cn=()=>p.useContext($e),un={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},dn={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Ee=n=>{var e,t;return{escapeKey:typeof n=="boolean"?n:(e=n?.escapeKey)!=null?e:!1,outsidePress:typeof n=="boolean"?n:(t=n?.outsidePress)!=null?t:!0}};function fn(n,e){e===void 0&&(e={});const{open:t,onOpenChange:o,elements:r,dataRef:s}=n,{enabled:i=!0,escapeKey:a=!0,outsidePress:l=!0,outsidePressEvent:c="pointerdown",referencePress:d=!1,referencePressEvent:u="pointerdown",ancestorScroll:g=!1,bubbles:h,capture:y}=e,m=qe(),f=W(typeof l=="function"?l:()=>!1),x=typeof l=="function"?f:l,b=p.useRef(!1),{escapeKey:R,outsidePress:v}=Ee(h),{escapeKey:D,outsidePress:C}=Ee(y),O=p.useRef(!1),A=W(S=>{var E;if(!t||!i||!a||S.key!=="Escape"||O.current)return;const P=(E=s.current.floatingContext)==null?void 0:E.nodeId,M=m?Z(m.nodesRef.current,P):[];if(!R&&(S.stopPropagation(),M.length>0)){let w=!0;if(M.forEach(N=>{var q;if((q=N.context)!=null&&q.open&&!N.context.dataRef.current.__escapeKeyBubbles){w=!1;return}}),!w)return}o(!1,Kt(S)?S.nativeEvent:S,"escape-key")}),F=W(S=>{var E;const P=()=>{var M;A(S),(M=Q(S))==null||M.removeEventListener("keydown",P)};(E=Q(S))==null||E.addEventListener("keydown",P)}),T=W(S=>{var E;const P=s.current.insideReactTree;s.current.insideReactTree=!1;const M=b.current;if(b.current=!1,c==="click"&&M||P||typeof x=="function"&&!x(S))return;const w=Q(S),N="["+de("inert")+"]",q=z(r.floating).querySelectorAll(N);let L=j(w)?w:null;for(;L&&!ne(L);){const k=ot(L);if(ne(k)||!j(k))break;L=k}if(q.length&&j(w)&&!Lt(w)&&!ce(w,r.floating)&&Array.from(q).every(k=>!ce(L,k)))return;if(rt(w)&&K){const k=ne(w),B=st(w),Y=/auto|scroll/,Ke=k||Y.test(B.overflowX),Be=k||Y.test(B.overflowY),Ue=Ke&&w.clientWidth>0&&w.scrollWidth>w.clientWidth,Ve=Be&&w.clientHeight>0&&w.scrollHeight>w.clientHeight,We=B.direction==="rtl",He=Ve&&(We?S.offsetX<=w.offsetWidth-w.clientWidth:S.offsetX>w.clientWidth),Xe=Ue&&S.offsetY>w.clientHeight;if(He||Xe)return}const U=(E=s.current.floatingContext)==null?void 0:E.nodeId,X=m&&Z(m.nodesRef.current,U).some(k=>{var B;return oe(S,(B=k.context)==null?void 0:B.elements.floating)});if(oe(S,r.floating)||oe(S,r.domReference)||X)return;const fe=m?Z(m.nodesRef.current,U):[];if(fe.length>0){let k=!0;if(fe.forEach(B=>{var Y;if((Y=B.context)!=null&&Y.open&&!B.context.dataRef.current.__outsidePressBubbles){k=!1;return}}),!k)return}o(!1,S,"outside-press")}),$=W(S=>{var E;const P=()=>{var M;T(S),(M=Q(S))==null||M.removeEventListener(c,P)};(E=Q(S))==null||E.addEventListener(c,P)});p.useEffect(()=>{if(!t||!i)return;s.current.__escapeKeyBubbles=R,s.current.__outsidePressBubbles=v;let S=-1;function E(q){o(!1,q,"ancestor-scroll")}function P(){window.clearTimeout(S),O.current=!0}function M(){S=window.setTimeout(()=>{O.current=!1},nt()?5:0)}const w=z(r.floating);a&&(w.addEventListener("keydown",D?F:A,D),w.addEventListener("compositionstart",P),w.addEventListener("compositionend",M)),x&&w.addEventListener(c,C?$:T,C);let N=[];return g&&(j(r.domReference)&&(N=te(r.domReference)),j(r.floating)&&(N=N.concat(te(r.floating))),!j(r.reference)&&r.reference&&r.reference.contextElement&&(N=N.concat(te(r.reference.contextElement)))),N=N.filter(q=>{var L;return q!==((L=w.defaultView)==null?void 0:L.visualViewport)}),N.forEach(q=>{q.addEventListener("scroll",E,{passive:!0})}),()=>{a&&(w.removeEventListener("keydown",D?F:A,D),w.removeEventListener("compositionstart",P),w.removeEventListener("compositionend",M)),x&&w.removeEventListener(c,C?$:T,C),N.forEach(q=>{q.removeEventListener("scroll",E)}),window.clearTimeout(S)}},[s,r,a,x,c,t,o,g,i,R,v,A,D,F,T,C,$]),p.useEffect(()=>{s.current.insideReactTree=!1},[s,x,c]);const _=p.useMemo(()=>({onKeyDown:A,...d&&{[un[u]]:S=>{o(!1,S.nativeEvent,"reference-press")},...u!=="click"&&{onClick(S){o(!1,S.nativeEvent,"reference-press")}}}}),[A,o,d,u]),K=p.useMemo(()=>{function S(E){E.button===0&&(b.current=!0)}return{onKeyDown:A,onMouseDown:S,onMouseUp:S,[dn[c]]:()=>{s.current.insideReactTree=!0}}},[A,c,s]);return p.useMemo(()=>i?{reference:_,floating:K}:{},[i,_,K])}function gn(n){const{open:e=!1,onOpenChange:t,elements:o}=n,r=ue(),s=p.useRef({}),[i]=p.useState(()=>tn()),a=Fe()!=null,[l,c]=p.useState(o.reference),d=W((h,y,m)=>{s.current.openEvent=h?y:void 0,i.emit("openchange",{open:h,event:y,reason:m,nested:a}),t?.(h,y,m)}),u=p.useMemo(()=>({setPositionReference:c}),[]),g=p.useMemo(()=>({reference:l||o.reference||null,floating:o.floating||null,domReference:o.reference}),[l,o.reference,o.floating]);return p.useMemo(()=>({dataRef:s,open:e,onOpenChange:d,elements:g,events:i,floatingId:r,refs:u}),[e,d,g,i,r,u])}function mn(n){n===void 0&&(n={});const{nodeId:e}=n,t=gn({...n,elements:{reference:null,floating:null,...n.elements}}),o=n.rootContext||t,r=o.elements,[s,i]=p.useState(null),[a,l]=p.useState(null),d=r?.domReference||s,u=p.useRef(null),g=qe();V(()=>{d&&(u.current=d)},[d]);const h=et({...n,elements:{...r,...a&&{reference:a}}}),y=p.useCallback(R=>{const v=j(R)?{getBoundingClientRect:()=>R.getBoundingClientRect(),getClientRects:()=>R.getClientRects(),contextElement:R}:R;l(v),h.refs.setReference(v)},[h.refs]),m=p.useCallback(R=>{(j(R)||R===null)&&(u.current=R,i(R)),(j(h.refs.reference.current)||h.refs.reference.current===null||R!==null&&!j(R))&&h.refs.setReference(R)},[h.refs]),f=p.useMemo(()=>({...h.refs,setReference:m,setPositionReference:y,domReference:u}),[h.refs,m,y]),x=p.useMemo(()=>({...h.elements,domReference:d}),[h.elements,d]),b=p.useMemo(()=>({...h,...o,refs:f,elements:x,nodeId:e}),[h,f,x,e,o]);return V(()=>{o.dataRef.current.floatingContext=b;const R=g?.nodesRef.current.find(v=>v.id===e);R&&(R.context=b)}),p.useMemo(()=>({...h,context:b,refs:f,elements:x}),[h,f,x,b])}function se(n,e,t){const o=new Map,r=t==="item";let s=n;if(r&&n){const{[he]:i,[be]:a,...l}=n;s=l}return{...t==="floating"&&{tabIndex:-1,[Gt]:""},...s,...e.map(i=>{const a=i?i[t]:null;return typeof a=="function"?n?a(n):null:a}).concat(n).reduce((i,a)=>(a&&Object.entries(a).forEach(l=>{let[c,d]=l;if(!(r&&[he,be].includes(c)))if(c.indexOf("on")===0){if(o.has(c)||o.set(c,[]),typeof d=="function"){var u;(u=o.get(c))==null||u.push(d),i[c]=function(){for(var g,h=arguments.length,y=new Array(h),m=0;m<h;m++)y[m]=arguments[m];return(g=o.get(c))==null?void 0:g.map(f=>f(...y)).find(f=>f!==void 0)}}}else i[c]=d}),i),{})}}function pn(n){n===void 0&&(n=[]);const e=n.map(a=>a?.reference),t=n.map(a=>a?.floating),o=n.map(a=>a?.item),r=p.useCallback(a=>se(a,n,"reference"),e),s=p.useCallback(a=>se(a,n,"floating"),t),i=p.useCallback(a=>se(a,n,"item"),o);return p.useMemo(()=>({getReferenceProps:r,getFloatingProps:s,getItemProps:i}),[r,s,i])}const vn=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function hn(n,e){var t,o;e===void 0&&(e={});const{open:r,elements:s,floatingId:i}=n,{enabled:a=!0,role:l="dialog"}=e,c=ue(),d=((t=s.domReference)==null?void 0:t.id)||c,u=p.useMemo(()=>{var b;return((b=jt(s.floating))==null?void 0:b.id)||i},[s.floating,i]),g=(o=vn.get(l))!=null?o:l,y=Fe()!=null,m=p.useMemo(()=>g==="tooltip"||l==="label"?{["aria-"+(l==="label"?"labelledby":"describedby")]:r?u:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":g==="alertdialog"?"dialog":g,"aria-controls":r?u:void 0,...g==="listbox"&&{role:"combobox"},...g==="menu"&&{id:d},...g==="menu"&&y&&{role:"menuitem"},...l==="select"&&{"aria-autocomplete":"none"},...l==="combobox"&&{"aria-autocomplete":"list"}},[g,u,y,r,d,l]),f=p.useMemo(()=>{const b={id:u,...g&&{role:g}};return g==="tooltip"||l==="label"?b:{...b,...g==="menu"&&{"aria-labelledby":d}}},[g,u,d,l]),x=p.useCallback(b=>{let{active:R,selected:v}=b;const D={role:"option",...R&&{id:u+"-fui-option"}};switch(l){case"select":case"combobox":return{...D,"aria-selected":v}}return{}},[u,l]);return p.useMemo(()=>a?{reference:m,floating:f,item:x}:{},[a,m,f,x])}function bn(n){var e;const{char:t,allowSpaces:o,allowToIncludeChar:r,allowedPrefixes:s,startOfLine:i,$position:a}=n,l=o&&!r,c=Ze(t),d=new RegExp(`\\s${c}$`),u=i?"^":"",g=r?"":c,h=l?new RegExp(`${u}${c}.*?(?=\\s${g}|$)`,"gm"):new RegExp(`${u}(?:^)?${c}[^\\s${g}]*`,"gm"),y=((e=a.nodeBefore)===null||e===void 0?void 0:e.isText)&&a.nodeBefore.text;if(!y)return null;const m=a.pos-y.length,f=Array.from(y.matchAll(h)).pop();if(!f||f.input===void 0||f.index===void 0)return null;const x=f.input.slice(Math.max(0,f.index-1),f.index),b=new RegExp(`^[${s?.join("")}\0]?$`).test(x);if(s!==null&&!b)return null;const R=m+f.index;let v=R+f[0].length;return l&&d.test(y.slice(v-1,v+1))&&(f[0]+=" ",v+=1),R<a.pos&&v>=a.pos?{range:{from:R,to:v},query:f[0].slice(t.length),text:f[0]}:null}function xn(n){return n.docChanged?n.steps.some(e=>{const t=e.slice;if(!t?.content)return!1;const o=t.content.textBetween(0,t.content.size,`
1
+ import{t as Ye,n as ie,o as Qe,D as Ge,v as ze,w as Ze}from"./usage-stats-32tsZUXd.js";import{r as p,gh as Je,g7 as we,gi as et,gj as j,gk as te,j as I,bQ as tt,gl as nt,gm as ne,gn as ot,go as rt,gp as st,gq as it,gr as at,gs as lt,gt as Ce,gu as ct,c as H,V as ut,K as dt,gv as ft,gw as gt,gx as mt,b as pt,m as vt,h as ht}from"./index-Cm-moWa5.js";import{g as bt,d as xt}from"./tool-namespace-B7QKcZjk.js";import{A as yt}from"./agent-icon-CRaK_2eb.js";var Hn=Ye;var Rt=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],ae=Rt.join(","),Ie=typeof Element>"u",G=Ie?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,J=!Ie&&Element.prototype.getRootNode?function(n){var e;return n==null||(e=n.getRootNode)===null||e===void 0?void 0:e.call(n)}:function(n){return n?.ownerDocument},ee=function(e,t){var o;t===void 0&&(t=!0);var r=e==null||(o=e.getAttribute)===null||o===void 0?void 0:o.call(e,"inert"),s=r===""||r==="true",i=s||t&&e&&(typeof e.closest=="function"?e.closest("[inert]"):ee(e.parentNode));return i},St=function(e){var t,o=e==null||(t=e.getAttribute)===null||t===void 0?void 0:t.call(e,"contenteditable");return o===""||o==="true"},Et=function(e,t,o){if(ee(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(ae));return t&&G.call(e,ae)&&r.unshift(e),r=r.filter(o),r},le=function(e,t,o){for(var r=[],s=Array.from(e);s.length;){var i=s.shift();if(!ee(i,!1))if(i.tagName==="SLOT"){var a=i.assignedElements(),l=a.length?a:i.children,c=le(l,!0,o);o.flatten?r.push.apply(r,c):r.push({scopeParent:i,candidates:c})}else{var d=G.call(i,ae);d&&o.filter(i)&&(t||!e.includes(i))&&r.push(i);var u=i.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(i),g=!ee(u,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(i));if(u&&g){var h=le(u===!0?i.children:u.children,!0,o);o.flatten?r.push.apply(r,h):r.push({scopeParent:i,candidates:h})}else s.unshift.apply(s,i.children)}}return r},Te=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Pe=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||St(e))&&!Te(e)?0:e.tabIndex},wt=function(e,t){var o=Pe(e);return o<0&&t&&!Te(e)?0:o},Ct=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Ae=function(e){return e.tagName==="INPUT"},It=function(e){return Ae(e)&&e.type==="hidden"},Tt=function(e){var t=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(o){return o.tagName==="SUMMARY"});return t},Pt=function(e,t){for(var o=0;o<e.length;o++)if(e[o].checked&&e[o].form===t)return e[o]},At=function(e){if(!e.name)return!0;var t=e.form||J(e),o=function(a){return t.querySelectorAll('input[type="radio"][name="'+a+'"]')},r;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")r=o(window.CSS.escape(e.name));else try{r=o(e.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var s=Pt(r,e.form);return!s||s===e},Nt=function(e){return Ae(e)&&e.type==="radio"},Dt=function(e){return Nt(e)&&!At(e)},Mt=function(e){var t,o=e&&J(e),r=(t=o)===null||t===void 0?void 0:t.host,s=!1;if(o&&o!==e){var i,a,l;for(s=!!((i=r)!==null&&i!==void 0&&(a=i.ownerDocument)!==null&&a!==void 0&&a.contains(r)||e!=null&&(l=e.ownerDocument)!==null&&l!==void 0&&l.contains(e));!s&&r;){var c,d,u;o=J(r),r=(c=o)===null||c===void 0?void 0:c.host,s=!!((d=r)!==null&&d!==void 0&&(u=d.ownerDocument)!==null&&u!==void 0&&u.contains(r))}}return s},ge=function(e){var t=e.getBoundingClientRect(),o=t.width,r=t.height;return o===0&&r===0},Ot=function(e,t){var o=t.displayCheck,r=t.getShadowRoot;if(o==="full-native"&&"checkVisibility"in e){var s=e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(e).visibility==="hidden")return!0;var i=G.call(e,"details>summary:first-of-type"),a=i?e.parentElement:e;if(G.call(a,"details:not([open]) *"))return!0;if(!o||o==="full"||o==="full-native"||o==="legacy-full"){if(typeof r=="function"){for(var l=e;e;){var c=e.parentElement,d=J(e);if(c&&!c.shadowRoot&&r(c)===!0)return ge(e);e.assignedSlot?e=e.assignedSlot:!c&&d!==e.ownerDocument?e=d.host:e=c}e=l}if(Mt(e))return!e.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return ge(e);return!1},Ft=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName==="FIELDSET"&&t.disabled){for(var o=0;o<t.children.length;o++){var r=t.children.item(o);if(r.tagName==="LEGEND")return G.call(t,"fieldset[disabled] *")?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},qt=function(e,t){return!(t.disabled||It(t)||Ot(t,e)||Tt(t)||Ft(t))},me=function(e,t){return!(Dt(t)||Pe(t)<0||!qt(e,t))},$t=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Ne=function(e){var t=[],o=[];return e.forEach(function(r,s){var i=!!r.scopeParent,a=i?r.scopeParent:r,l=wt(a,i),c=i?Ne(r.candidates):a;l===0?i?t.push.apply(t,c):t.push(a):o.push({documentOrder:s,tabIndex:l,item:r,isScope:i,content:c})}),o.sort(Ct).reduce(function(r,s){return s.isScope?r.push.apply(r,s.content):r.push(s.content),r},[]).concat(t)},De=function(e,t){t=t||{};var o;return t.getShadowRoot?o=le([e],t.includeContainer,{filter:me.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:$t}):o=Et(e,t.includeContainer,me.bind(null,t)),Ne(o)};function kt(){return/apple/i.test(navigator.vendor)}const pe="data-floating-ui-focusable";function _t(n){let e=n.activeElement;for(;((t=e)==null||(t=t.shadowRoot)==null?void 0:t.activeElement)!=null;){var t;e=e.shadowRoot.activeElement}return e}function ce(n,e){if(!n||!e)return!1;const t=e.getRootNode==null?void 0:e.getRootNode();if(n.contains(e))return!0;if(t&&Je(t)){let o=e;for(;o;){if(n===o)return!0;o=o.parentNode||o.host}}return!1}function Q(n){return"composedPath"in n?n.composedPath()[0]:n.target}function oe(n,e){if(e==null)return!1;if("composedPath"in n)return n.composedPath().includes(e);const t=n;return t.target!=null&&e.contains(t.target)}function Lt(n){return n.matches("html,body")}function z(n){return n?.ownerDocument||document}function jt(n){return n?n.hasAttribute(pe)?n:n.querySelector("["+pe+"]")||n:null}function Z(n,e,t){return t===void 0&&(t=!0),n.filter(r=>{var s;return r.parentId===e&&(!t||((s=r.context)==null?void 0:s.open))}).flatMap(r=>[r,...Z(n,r.id,t)])}function Kt(n){return"nativeEvent"in n}var Bt=typeof document<"u",Ut=function(){},V=Bt?p.useLayoutEffect:Ut;const Vt={...we},Wt=Vt.useInsertionEffect,Ht=Wt||(n=>n());function W(n){const e=p.useRef(()=>{});return Ht(()=>{e.current=n}),p.useCallback(function(){for(var t=arguments.length,o=new Array(t),r=0;r<t;r++)o[r]=arguments[r];return e.current==null?void 0:e.current(...o)},[])}const Me=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Oe(n,e){const t=De(n,Me()),o=t.length;if(o===0)return;const r=_t(z(n)),s=t.indexOf(r),i=s===-1?e===1?0:o-1:s+e;return t[i]}function Xt(n){return Oe(z(n).body,1)||n}function Yt(n){return Oe(z(n).body,-1)||n}function re(n,e){const t=e||n.currentTarget,o=n.relatedTarget;return!o||!ce(t,o)}function Qt(n){De(n,Me()).forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")})}function ve(n){n.querySelectorAll("[data-tabindex]").forEach(t=>{const o=t.dataset.tabindex;delete t.dataset.tabindex,o?t.setAttribute("tabindex",o):t.removeAttribute("tabindex")})}const Gt="data-floating-ui-focusable",he="active",be="selected",zt={...we};let xe=!1,Zt=0;const ye=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Zt++;function Jt(){const[n,e]=p.useState(()=>xe?ye():void 0);return V(()=>{n==null&&e(ye())},[]),p.useEffect(()=>{xe=!0},[]),n}const en=zt.useId,ue=en||Jt;function tn(){const n=new Map;return{emit(e,t){var o;(o=n.get(e))==null||o.forEach(r=>r(t))},on(e,t){n.has(e)||n.set(e,new Set),n.get(e).add(t)},off(e,t){var o;(o=n.get(e))==null||o.delete(t)}}}const nn=p.createContext(null),on=p.createContext(null),Fe=()=>{var n;return((n=p.useContext(nn))==null?void 0:n.id)||null},qe=()=>p.useContext(on);function de(n){return"data-floating-ui-"+n}const rn={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},Re=p.forwardRef(function(e,t){const[o,r]=p.useState();V(()=>{kt()&&r("button")},[]);const s={ref:t,tabIndex:0,role:o,"aria-hidden":o?void 0:!0,[de("focus-guard")]:"",style:rn};return I.jsx("span",{...e,...s})}),sn={clipPath:"inset(50%)",position:"fixed",top:0,left:0},$e=p.createContext(null),Se=de("portal");function an(n){n===void 0&&(n={});const{id:e,root:t}=n,o=ue(),r=cn(),[s,i]=p.useState(null),a=p.useRef(null);return V(()=>()=>{s?.remove(),queueMicrotask(()=>{a.current=null})},[s]),V(()=>{if(!o||a.current)return;const l=e?document.getElementById(e):null;if(!l)return;const c=document.createElement("div");c.id=o,c.setAttribute(Se,""),l.appendChild(c),a.current=c,i(c)},[e,o]),V(()=>{if(t===null||!o||a.current)return;let l=t||r?.portalNode;l&&!it(l)&&(l=l.current),l=l||document.body;let c=null;e&&(c=document.createElement("div"),c.id=e,l.appendChild(c));const d=document.createElement("div");d.id=o,d.setAttribute(Se,""),l=c||l,l.appendChild(d),a.current=d,i(d)},[e,t,o,r]),s}function ln(n){const{children:e,id:t,root:o,preserveTabOrder:r=!0}=n,s=an({id:t,root:o}),[i,a]=p.useState(null),l=p.useRef(null),c=p.useRef(null),d=p.useRef(null),u=p.useRef(null),g=i?.modal,h=i?.open,y=!!i&&!i.modal&&i.open&&r&&!!(o||s);return p.useEffect(()=>{if(!s||!r||g)return;function m(f){s&&re(f)&&(f.type==="focusin"?ve:Qt)(s)}return s.addEventListener("focusin",m,!0),s.addEventListener("focusout",m,!0),()=>{s.removeEventListener("focusin",m,!0),s.removeEventListener("focusout",m,!0)}},[s,r,g]),p.useEffect(()=>{s&&(h||ve(s))},[h,s]),I.jsxs($e.Provider,{value:p.useMemo(()=>({preserveTabOrder:r,beforeOutsideRef:l,afterOutsideRef:c,beforeInsideRef:d,afterInsideRef:u,portalNode:s,setFocusManagerState:a}),[r,s]),children:[y&&s&&I.jsx(Re,{"data-type":"outside",ref:l,onFocus:m=>{if(re(m,s)){var f;(f=d.current)==null||f.focus()}else{const x=i?i.domReference:null,b=Yt(x);b?.focus()}}}),y&&s&&I.jsx("span",{"aria-owns":s.id,style:sn}),s&&tt.createPortal(e,s),y&&s&&I.jsx(Re,{"data-type":"outside",ref:c,onFocus:m=>{if(re(m,s)){var f;(f=u.current)==null||f.focus()}else{const x=i?i.domReference:null,b=Xt(x);b?.focus(),i?.closeOnFocusOut&&i?.onOpenChange(!1,m.nativeEvent,"focus-out")}}})]})}const cn=()=>p.useContext($e),un={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},dn={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Ee=n=>{var e,t;return{escapeKey:typeof n=="boolean"?n:(e=n?.escapeKey)!=null?e:!1,outsidePress:typeof n=="boolean"?n:(t=n?.outsidePress)!=null?t:!0}};function fn(n,e){e===void 0&&(e={});const{open:t,onOpenChange:o,elements:r,dataRef:s}=n,{enabled:i=!0,escapeKey:a=!0,outsidePress:l=!0,outsidePressEvent:c="pointerdown",referencePress:d=!1,referencePressEvent:u="pointerdown",ancestorScroll:g=!1,bubbles:h,capture:y}=e,m=qe(),f=W(typeof l=="function"?l:()=>!1),x=typeof l=="function"?f:l,b=p.useRef(!1),{escapeKey:R,outsidePress:v}=Ee(h),{escapeKey:D,outsidePress:C}=Ee(y),O=p.useRef(!1),A=W(S=>{var E;if(!t||!i||!a||S.key!=="Escape"||O.current)return;const P=(E=s.current.floatingContext)==null?void 0:E.nodeId,M=m?Z(m.nodesRef.current,P):[];if(!R&&(S.stopPropagation(),M.length>0)){let w=!0;if(M.forEach(N=>{var q;if((q=N.context)!=null&&q.open&&!N.context.dataRef.current.__escapeKeyBubbles){w=!1;return}}),!w)return}o(!1,Kt(S)?S.nativeEvent:S,"escape-key")}),F=W(S=>{var E;const P=()=>{var M;A(S),(M=Q(S))==null||M.removeEventListener("keydown",P)};(E=Q(S))==null||E.addEventListener("keydown",P)}),T=W(S=>{var E;const P=s.current.insideReactTree;s.current.insideReactTree=!1;const M=b.current;if(b.current=!1,c==="click"&&M||P||typeof x=="function"&&!x(S))return;const w=Q(S),N="["+de("inert")+"]",q=z(r.floating).querySelectorAll(N);let L=j(w)?w:null;for(;L&&!ne(L);){const k=ot(L);if(ne(k)||!j(k))break;L=k}if(q.length&&j(w)&&!Lt(w)&&!ce(w,r.floating)&&Array.from(q).every(k=>!ce(L,k)))return;if(rt(w)&&K){const k=ne(w),B=st(w),Y=/auto|scroll/,Ke=k||Y.test(B.overflowX),Be=k||Y.test(B.overflowY),Ue=Ke&&w.clientWidth>0&&w.scrollWidth>w.clientWidth,Ve=Be&&w.clientHeight>0&&w.scrollHeight>w.clientHeight,We=B.direction==="rtl",He=Ve&&(We?S.offsetX<=w.offsetWidth-w.clientWidth:S.offsetX>w.clientWidth),Xe=Ue&&S.offsetY>w.clientHeight;if(He||Xe)return}const U=(E=s.current.floatingContext)==null?void 0:E.nodeId,X=m&&Z(m.nodesRef.current,U).some(k=>{var B;return oe(S,(B=k.context)==null?void 0:B.elements.floating)});if(oe(S,r.floating)||oe(S,r.domReference)||X)return;const fe=m?Z(m.nodesRef.current,U):[];if(fe.length>0){let k=!0;if(fe.forEach(B=>{var Y;if((Y=B.context)!=null&&Y.open&&!B.context.dataRef.current.__outsidePressBubbles){k=!1;return}}),!k)return}o(!1,S,"outside-press")}),$=W(S=>{var E;const P=()=>{var M;T(S),(M=Q(S))==null||M.removeEventListener(c,P)};(E=Q(S))==null||E.addEventListener(c,P)});p.useEffect(()=>{if(!t||!i)return;s.current.__escapeKeyBubbles=R,s.current.__outsidePressBubbles=v;let S=-1;function E(q){o(!1,q,"ancestor-scroll")}function P(){window.clearTimeout(S),O.current=!0}function M(){S=window.setTimeout(()=>{O.current=!1},nt()?5:0)}const w=z(r.floating);a&&(w.addEventListener("keydown",D?F:A,D),w.addEventListener("compositionstart",P),w.addEventListener("compositionend",M)),x&&w.addEventListener(c,C?$:T,C);let N=[];return g&&(j(r.domReference)&&(N=te(r.domReference)),j(r.floating)&&(N=N.concat(te(r.floating))),!j(r.reference)&&r.reference&&r.reference.contextElement&&(N=N.concat(te(r.reference.contextElement)))),N=N.filter(q=>{var L;return q!==((L=w.defaultView)==null?void 0:L.visualViewport)}),N.forEach(q=>{q.addEventListener("scroll",E,{passive:!0})}),()=>{a&&(w.removeEventListener("keydown",D?F:A,D),w.removeEventListener("compositionstart",P),w.removeEventListener("compositionend",M)),x&&w.removeEventListener(c,C?$:T,C),N.forEach(q=>{q.removeEventListener("scroll",E)}),window.clearTimeout(S)}},[s,r,a,x,c,t,o,g,i,R,v,A,D,F,T,C,$]),p.useEffect(()=>{s.current.insideReactTree=!1},[s,x,c]);const _=p.useMemo(()=>({onKeyDown:A,...d&&{[un[u]]:S=>{o(!1,S.nativeEvent,"reference-press")},...u!=="click"&&{onClick(S){o(!1,S.nativeEvent,"reference-press")}}}}),[A,o,d,u]),K=p.useMemo(()=>{function S(E){E.button===0&&(b.current=!0)}return{onKeyDown:A,onMouseDown:S,onMouseUp:S,[dn[c]]:()=>{s.current.insideReactTree=!0}}},[A,c,s]);return p.useMemo(()=>i?{reference:_,floating:K}:{},[i,_,K])}function gn(n){const{open:e=!1,onOpenChange:t,elements:o}=n,r=ue(),s=p.useRef({}),[i]=p.useState(()=>tn()),a=Fe()!=null,[l,c]=p.useState(o.reference),d=W((h,y,m)=>{s.current.openEvent=h?y:void 0,i.emit("openchange",{open:h,event:y,reason:m,nested:a}),t?.(h,y,m)}),u=p.useMemo(()=>({setPositionReference:c}),[]),g=p.useMemo(()=>({reference:l||o.reference||null,floating:o.floating||null,domReference:o.reference}),[l,o.reference,o.floating]);return p.useMemo(()=>({dataRef:s,open:e,onOpenChange:d,elements:g,events:i,floatingId:r,refs:u}),[e,d,g,i,r,u])}function mn(n){n===void 0&&(n={});const{nodeId:e}=n,t=gn({...n,elements:{reference:null,floating:null,...n.elements}}),o=n.rootContext||t,r=o.elements,[s,i]=p.useState(null),[a,l]=p.useState(null),d=r?.domReference||s,u=p.useRef(null),g=qe();V(()=>{d&&(u.current=d)},[d]);const h=et({...n,elements:{...r,...a&&{reference:a}}}),y=p.useCallback(R=>{const v=j(R)?{getBoundingClientRect:()=>R.getBoundingClientRect(),getClientRects:()=>R.getClientRects(),contextElement:R}:R;l(v),h.refs.setReference(v)},[h.refs]),m=p.useCallback(R=>{(j(R)||R===null)&&(u.current=R,i(R)),(j(h.refs.reference.current)||h.refs.reference.current===null||R!==null&&!j(R))&&h.refs.setReference(R)},[h.refs]),f=p.useMemo(()=>({...h.refs,setReference:m,setPositionReference:y,domReference:u}),[h.refs,m,y]),x=p.useMemo(()=>({...h.elements,domReference:d}),[h.elements,d]),b=p.useMemo(()=>({...h,...o,refs:f,elements:x,nodeId:e}),[h,f,x,e,o]);return V(()=>{o.dataRef.current.floatingContext=b;const R=g?.nodesRef.current.find(v=>v.id===e);R&&(R.context=b)}),p.useMemo(()=>({...h,context:b,refs:f,elements:x}),[h,f,x,b])}function se(n,e,t){const o=new Map,r=t==="item";let s=n;if(r&&n){const{[he]:i,[be]:a,...l}=n;s=l}return{...t==="floating"&&{tabIndex:-1,[Gt]:""},...s,...e.map(i=>{const a=i?i[t]:null;return typeof a=="function"?n?a(n):null:a}).concat(n).reduce((i,a)=>(a&&Object.entries(a).forEach(l=>{let[c,d]=l;if(!(r&&[he,be].includes(c)))if(c.indexOf("on")===0){if(o.has(c)||o.set(c,[]),typeof d=="function"){var u;(u=o.get(c))==null||u.push(d),i[c]=function(){for(var g,h=arguments.length,y=new Array(h),m=0;m<h;m++)y[m]=arguments[m];return(g=o.get(c))==null?void 0:g.map(f=>f(...y)).find(f=>f!==void 0)}}}else i[c]=d}),i),{})}}function pn(n){n===void 0&&(n=[]);const e=n.map(a=>a?.reference),t=n.map(a=>a?.floating),o=n.map(a=>a?.item),r=p.useCallback(a=>se(a,n,"reference"),e),s=p.useCallback(a=>se(a,n,"floating"),t),i=p.useCallback(a=>se(a,n,"item"),o);return p.useMemo(()=>({getReferenceProps:r,getFloatingProps:s,getItemProps:i}),[r,s,i])}const vn=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function hn(n,e){var t,o;e===void 0&&(e={});const{open:r,elements:s,floatingId:i}=n,{enabled:a=!0,role:l="dialog"}=e,c=ue(),d=((t=s.domReference)==null?void 0:t.id)||c,u=p.useMemo(()=>{var b;return((b=jt(s.floating))==null?void 0:b.id)||i},[s.floating,i]),g=(o=vn.get(l))!=null?o:l,y=Fe()!=null,m=p.useMemo(()=>g==="tooltip"||l==="label"?{["aria-"+(l==="label"?"labelledby":"describedby")]:r?u:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":g==="alertdialog"?"dialog":g,"aria-controls":r?u:void 0,...g==="listbox"&&{role:"combobox"},...g==="menu"&&{id:d},...g==="menu"&&y&&{role:"menuitem"},...l==="select"&&{"aria-autocomplete":"none"},...l==="combobox"&&{"aria-autocomplete":"list"}},[g,u,y,r,d,l]),f=p.useMemo(()=>{const b={id:u,...g&&{role:g}};return g==="tooltip"||l==="label"?b:{...b,...g==="menu"&&{"aria-labelledby":d}}},[g,u,d,l]),x=p.useCallback(b=>{let{active:R,selected:v}=b;const D={role:"option",...R&&{id:u+"-fui-option"}};switch(l){case"select":case"combobox":return{...D,"aria-selected":v}}return{}},[u,l]);return p.useMemo(()=>a?{reference:m,floating:f,item:x}:{},[a,m,f,x])}function bn(n){var e;const{char:t,allowSpaces:o,allowToIncludeChar:r,allowedPrefixes:s,startOfLine:i,$position:a}=n,l=o&&!r,c=Ze(t),d=new RegExp(`\\s${c}$`),u=i?"^":"",g=r?"":c,h=l?new RegExp(`${u}${c}.*?(?=\\s${g}|$)`,"gm"):new RegExp(`${u}(?:^)?${c}[^\\s${g}]*`,"gm"),y=((e=a.nodeBefore)===null||e===void 0?void 0:e.isText)&&a.nodeBefore.text;if(!y)return null;const m=a.pos-y.length,f=Array.from(y.matchAll(h)).pop();if(!f||f.input===void 0||f.index===void 0)return null;const x=f.input.slice(Math.max(0,f.index-1),f.index),b=new RegExp(`^[${s?.join("")}\0]?$`).test(x);if(s!==null&&!b)return null;const R=m+f.index;let v=R+f[0].length;return l&&d.test(y.slice(v-1,v+1))&&(f[0]+=" ",v+=1),R<a.pos&&v>=a.pos?{range:{from:R,to:v},query:f[0].slice(t.length),text:f[0]}:null}function xn(n){return n.docChanged?n.steps.some(e=>{const t=e.slice;if(!t?.content)return!1;const o=t.content.textBetween(0,t.content.size,`
2
2
  `);return/\s/.test(o)}):!1}function yn(n){return()=>{const e=n.state.selection.$anchor.pos,{top:t,right:o,bottom:r,left:s}=n.view.coordsAtPos(e);try{return new DOMRect(s,t,o-s,r-t)}catch{return null}}}function Rn(n,e,t,o){return t?()=>{const r=o.getState(n.state),s=r?.decorationId,i=e.dom.querySelector(`[data-decoration-id="${s}"]`);return i?.getBoundingClientRect()||null}:yn(n)}function Sn({match:n,dismissedRange:e,state:t,transaction:o,editor:r,shouldResetDismissed:s,effectiveAllowSpaces:i}){return s?.({editor:r,state:t,range:e,match:n,transaction:o,allowSpaces:i})?!1:i?n.range.from===e.from:n.range.from===e.from&&!xn(o)}function En({view:n,pluginKeyRef:e}){const t=n.state.tr.setMeta(e,{exit:!0});n.dispatch(t)}function wn({pluginKey:n,decorationTag:e,decorationClass:t,decorationContent:o,decorationEmptyClass:r,renderer:s,dispatchExit:i}){return{handleKeyDown(a,l){var c;const d=n.getState(a.state);if(!d.active)return!1;if(l.key==="Escape"||l.key==="Esc"){var u;return s==null||(u=s.onKeyDown)===null||u===void 0||u.call(s,{view:a,event:l,range:d.range}),i(a),!0}return(s==null||(c=s.onKeyDown)===null||c===void 0?void 0:c.call(s,{view:a,event:l,range:d.range}))||!1},decorations(a){const{active:l,range:c,decorationId:d,query:u}=n.getState(a);if(!l)return null;const g=!u?.length,h=[t];return g&&h.push(r),Ge.create(a.doc,[ze.inline(c.from,c.to,{nodeName:e,class:h.join(" "),"data-decoration-id":d||void 0,"data-decoration-content":o})])}}}function Cn({editor:n,char:e,effectiveAllowSpaces:t,allowToIncludeChar:o,allowedPrefixes:r,startOfLine:s,findSuggestionMatch:i,allow:a,shouldShow:l,shouldKeepDismissed:c,pluginKey:d}){return{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1,dismissedRange:null}},apply(u,g,h,y){const{isEditable:m}=n,{composing:f}=n.view,{selection:x}=u,{empty:b,from:R}=x,v={...g},D=u.getMeta(d);if(D&&D.exit)return v.active=!1,v.decorationId=null,v.range={from:0,to:0},v.query=null,v.text=null,v.dismissedRange=g.active?{...g.range}:g.dismissedRange,v;if(v.composing=f,u.docChanged&&v.dismissedRange!==null&&(v.dismissedRange={from:u.mapping.map(v.dismissedRange.from),to:u.mapping.map(v.dismissedRange.to)}),m&&(b||n.view.composing)){(R<g.range.from||R>g.range.to)&&!f&&!g.composing&&(v.active=!1);const C=i({char:e,allowSpaces:t,allowToIncludeChar:o,allowedPrefixes:r,startOfLine:s,$position:x.$from}),O=`id_${Math.floor(Math.random()*4294967295)}`;C&&a({editor:n,state:y,range:C.range,isActive:g.active})&&(!l||l({editor:n,range:C.range,query:C.query,text:C.text,transaction:u}))?(v.dismissedRange!==null&&!c({match:C,dismissedRange:v.dismissedRange,state:y,transaction:u})&&(v.dismissedRange=null),v.dismissedRange===null?(v.active=!0,v.decorationId=g.decorationId||O,v.range=C.range,v.query=C.query,v.text=C.text):v.active=!1):(C||(v.dismissedRange=null),v.active=!1)}else v.active=!1;return v.active||(v.decorationId=null,v.range={from:0,to:0},v.query=null,v.text=null),v}}}function In({editor:n,items:e}){let t=null,o=null,r=null;const s=()=>{o!==null&&(clearTimeout(o),o=null),r?.(),r=null},i=c=>new Promise(d=>{r=d,o=setTimeout(()=>{o=null;const u=r;r=null,u?.()},c)}),a=()=>{t?.abort(),s(),t=null};return{abort:a,fetch:async(c,d)=>{a(),t=new AbortController;const u=t;if(d>0&&await i(d),t!==u||u.signal.aborted)return{status:"aborted"};try{const g=await e({editor:n,query:c,signal:u.signal});return t!==u||u.signal.aborted?{status:"aborted"}:{status:"resolved",items:g}}catch{return t!==u||u.signal.aborted?{status:"aborted"}:{status:"error"}}}}}function Tn({placement:n,offset:e,flip:t,floatingUi:o}){var r,s,i,a;const l=[at({mainAxis:(r=e.mainAxis)!==null&&r!==void 0?r:4,crossAxis:(s=e.crossAxis)!==null&&s!==void 0?s:0})];return t&&l.push(lt()),!(o==null||(i=o.middleware)===null||i===void 0)&&i.length&&l.push(...o.middleware),{placement:n,strategy:(a=o?.strategy)!==null&&a!==void 0?a:"absolute",middleware:l}}function Pn(n){if(n instanceof HTMLElement)return n;if(typeof n=="string")try{const e=document.querySelector(n);if(e)return e}catch{return document.body}return document.body}function An({getReferenceRect:n,contextElement:e,config:t,container:o,dismissOnOutsideClick:r,dismiss:s}){return(i,a={})=>{const l={getBoundingClientRect:()=>{var y;return(y=n())!==null&&y!==void 0?y:new DOMRect},contextElement:e};let c=!1;const d=!i.isConnected;d&&Pn(o).appendChild(i),a.onPosition||(i.style.visibility="hidden",i.style.width="max-content");const g=Ce(l,i,()=>{ct(l,i,{placement:t.placement,strategy:t.strategy,middleware:t.middleware}).then(({x:y,y:m,placement:f,strategy:x})=>{if(a.onPosition){a.onPosition({x:y,y:m,placement:f,strategy:x});return}Object.assign(i.style,{position:x,left:`${y}px`,top:`${m}px`}),c||(c=!0,i.style.visibility="")})},a.autoUpdate);let h;return r&&(h=y=>{const m=y.target;!(m instanceof Node)||i.contains(m)||e.contains(m)||s()},document.addEventListener("pointerdown",h,!0)),()=>{g(),h&&document.removeEventListener("pointerdown",h,!0),d&&i.remove()}}}function Nn({editor:n,pluginKey:e,items:t,renderer:o,minQueryLength:r,debounce:s,initialItems:i,placement:a,offset:l,container:c,flip:d,floatingUi:u,dismissOnOutsideClick:g,command:h,clientRectFor:y,dispatchExit:m}){let f;const x=In({editor:n,items:t}),b=Tn({placement:a,offset:l,flip:d,floatingUi:u});function R(v,D){switch(v){case"started":var C;o==null||(C=o.onStart)===null||C===void 0||C.call(o,D);break;case"updated":var O;o==null||(O=o.onUpdate)===null||O===void 0||O.call(o,D);break;case"stopped":var A;o==null||(A=o.onExit)===null||A===void 0||A.call(o,D)}}return{update:async(v,D)=>{var C,O;const A=e.getState(D),F=e.getState(v.state);if(!A||!F)return;let T=null;const $=A.query!==F.query,_=A.text!==F.text,K=A.range.from!==F.range.from||A.range.to!==F.range.to,S=$||_||K;if(!A.active&&F.active)T="started";else if(A.active&&!F.active)T="stopped";else if(F.active&&S)T="updated";else return;const E=T==="stopped"?A:F,P=v.dom.querySelector(`[data-decoration-id="${E.decorationId}"]`),M=y(v,P),w=r===0||(E.query?E.query.length>=r:!1),N=(T==="started"||T==="updated")&&w;if(f={editor:n,range:E.range,query:E.query||"",text:E.text||"",items:i??[],command:U=>h({editor:n,range:E.range,props:U}),decorationNode:P,clientRect:M,loading:N,placement:a,offset:{mainAxis:(C=l.mainAxis)!==null&&C!==void 0?C:4,crossAxis:(O=l.crossAxis)!==null&&O!==void 0?O:0},container:c,flip:d,floatingUi:b,mount:An({getReferenceRect:M,contextElement:v.dom,config:b,container:c,dismissOnOutsideClick:g,dismiss:()=>m(n.view)})},T==="started"){var q;o==null||(q=o.onBeforeStart)===null||q===void 0||q.call(o,f)}if(T==="updated"){var L;o==null||(L=o.onBeforeUpdate)===null||L===void 0||L.call(o,f)}if(T==="started"&&R(T,f),T==="started"||T==="updated")if(!N)x.abort(),f={...f,items:i??[],loading:!1};else{f={...f,items:i??[],loading:!0},T="updated",R(T,f);const U=await x.fetch(E.query||"",s);if(U.status==="aborted")return;const X=e.getState(v.state);if(!X?.active){x.abort();return}f=U.status==="resolved"?{...f,items:U.items,loading:!1}:{...f,loading:!1}}if(T==="stopped"){x.abort(),R(T,f),f=void 0;return}T==="updated"&&R(T,f)},destroy:()=>{var v;x.abort(),f&&(o==null||(v=o.onExit)===null||v===void 0||v.call(o,f))}}}const ke=new ie("suggestion");function _e({pluginKey:n=ke,editor:e,char:t="@",allowSpaces:o=!1,allowToIncludeChar:r=!1,allowedPrefixes:s=[" "],startOfLine:i=!1,decorationTag:a="span",decorationClass:l="suggestion",decorationContent:c="",decorationEmptyClass:d="is-empty",command:u=()=>null,items:g=()=>[],minQueryLength:h=0,debounce:y=0,initialItems:m,placement:f="bottom-start",offset:x={},container:b,flip:R=!0,floatingUi:v,dismissOnOutsideClick:D=!0,render:C=()=>({}),allow:O=()=>!0,findSuggestionMatch:A=bn,shouldShow:F,shouldResetDismissed:T}){const $=C?.(),_=o&&!r,K=(P,M)=>Rn(e,P,M,n);function S(P){return Sn({...P,editor:e,shouldResetDismissed:T,effectiveAllowSpaces:_})}const E=P=>En({view:P,pluginKeyRef:n});return new Qe({key:n,view:()=>Nn({editor:e,pluginKey:n,items:g,renderer:$,minQueryLength:h,debounce:y,initialItems:m,placement:f,offset:x,container:b,flip:R,floatingUi:v,dismissOnOutsideClick:D,command:u,clientRectFor:K,dispatchExit:E}),state:Cn({editor:e,char:t,effectiveAllowSpaces:_,allowToIncludeChar:r,allowedPrefixes:s,startOfLine:i,findSuggestionMatch:A,allow:O,shouldShow:F,shouldKeepDismissed:S,pluginKey:n}),props:wn({pluginKey:n,decorationTag:a,decorationClass:l,decorationContent:c,decorationEmptyClass:d,renderer:$,dispatchExit:E})})}function Xn(n,e=ke){const t=n.state.tr.setMeta(e,{exit:!0});n.dispatch(t)}var Yn=_e;function Dn(n){const e=H.c(17),{editor:t,query:o,items:r,onSelect:s,onClose:i}=n,[a,l]=p.useState(0),c=p.useRef(r),d=p.useRef(a),u=p.useRef(s),g=p.useRef(i),h=p.useDeferredValue(o),[y,m]=p.useState(h);y!==h&&(m(h),l(0)),a>=r.length&&r.length>0&&l(0);let f,x;e[0]!==r?(f=()=>{c.current=r},x=[r],e[0]=r,e[1]=f,e[2]=x):(f=e[1],x=e[2]),p.useEffect(f,x);let b,R;e[3]!==a?(b=()=>{d.current=a},R=[a],e[3]=a,e[4]=b,e[5]=R):(b=e[4],R=e[5]),p.useEffect(b,R);let v,D;e[6]!==s?(v=()=>{u.current=s},D=[s],e[6]=s,e[7]=v,e[8]=D):(v=e[7],D=e[8]),p.useEffect(v,D);let C,O;e[9]!==i?(C=()=>{g.current=i},O=[i],e[9]=i,e[10]=C,e[11]=O):(C=e[10],O=e[11]),p.useEffect(C,O);let A,F;e[12]!==t?(F=()=>{if(t?.isDestroyed)return;let _;try{_=t.view.dom}catch{return}if(!_)return;const K=E=>{const P=c.current;if(!P.length)return!1;const M=()=>l(N=>(N+1)%P.length),w=()=>l(N=>(N-1+P.length)%P.length);switch(E.key){case"ArrowUp":return E.preventDefault(),w(),!0;case"ArrowDown":return E.preventDefault(),M(),!0;case"Tab":return E.preventDefault(),E.shiftKey?w():M(),!0;case"Home":return E.preventDefault(),l(0),!0;case"End":return E.preventDefault(),l(P.length-1),!0;case"Enter":{if(E.isComposing)return!1;E.preventDefault();const N=d.current;return N!==-1&&P[N]&&u.current?.(P[N],N),!0}case"Escape":return E.preventDefault(),g.current?.(),!0;default:return!1}},S=E=>{K(E)};return _.addEventListener("keydown",S,!0),()=>{_?.removeEventListener("keydown",S,!0)}},A=[t],e[12]=t,e[13]=A,e[14]=F):(A=e[13],F=e[14]),p.useEffect(F,A);const T=r.length?a:void 0;let $;return e[15]!==T?($={selectedIndex:T,setSelectedIndex:l},e[15]=T,e[16]=$):$=e[16],$}function Mn(n,e){switch(e.type){case"SET_SELECTED_ITEM":return{...n,selectedItem:e.payload};case"ON_START":return{...n,open:!0,selectedItem:null,element:e.payload.element,query:e.payload.query,range:e.payload.range};case"ON_UPDATE":return{...n,element:e.payload.element,query:e.payload.query,range:e.payload.range};case"ON_EXIT":return{open:!1,element:null,query:"",range:null,selectedItem:null};default:return n}}const Le=p.createContext(void 0);function je(){const n=p.useContext(Le);if(!n)throw new Error("useSuggestionContext must be used within a SuggestionContext.Provider");return n}function On(n){const e=H.c(16),{editor:t,char:o,pluginKey:r,allow:s,onOpenChange:i}=n;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={open:!1,element:null,query:"",range:null,selectedItem:null},e[0]=a):a=e[0];const[l,c]=p.useReducer(Mn,a);let d;e[1]!==i?(d=m=>{i?.(m)},e[1]=i,e[2]=d):d=e[2];const u=p.useEffectEvent(d);let g;e[3]!==o||e[4]!==s||e[5]!==t||e[6]!==u||e[7]!==r?(g=()=>{if(t?.isDestroyed)return;const m=r instanceof ie?r:new ie(r);t.state.plugins.find(b=>b.spec.key===m)&&t.unregisterPlugin(m);const x=_e({pluginKey:m,editor:t,char:o,allow(b){const R=t.state.doc.resolve(b.range.from);for(let v=R.depth;v>0;v--)if(R.node(v).type.name==="image")return!1;return!(s&&!s(b))},command(){},render:()=>({onStart:b=>{c({type:"ON_START",payload:{element:b.decorationNode??null,query:b.query,range:b.range}}),u(!0)},onUpdate:b=>{c({type:"ON_UPDATE",payload:{element:b.decorationNode??null,query:b.query,range:b.range}})},onKeyDown:b=>b.event.key==="Escape"?(c({type:"ON_EXIT"}),!0):!1,onExit:()=>{c({type:"ON_EXIT"}),u(!1)}}),items:Fn});return t.registerPlugin(x),()=>{t?.isDestroyed||t.unregisterPlugin(m)}},e[3]=o,e[4]=s,e[5]=t,e[6]=u,e[7]=r,e[8]=g):g=e[8];let h;e[9]!==o||e[10]!==s||e[11]!==t||e[12]!==r?(h=[t,r,o,c,s],e[9]=o,e[10]=s,e[11]=t,e[12]=r,e[13]=h):h=e[13],p.useEffect(g,h);let y;return e[14]!==l?(y={state:l,dispatch:c},e[14]=l,e[15]=y):y=e[15],y}function Fn(){return[]}function qn({editor:n,queryKey:e,queryFn:t,onSelect:o}){const{state:r,dispatch:s}=je(),i=p.useDeferredValue(r.query),{data:a}=ut({queryKey:dt.suggestionItems(e,r.open,i),queryFn:()=>r.open?t({query:i}):[]}),l=()=>{s({type:"ON_EXIT"})},c=async(u,g)=>{if(!(r.selectedItem!==null||!r.range)){s({type:"SET_SELECTED_ITEM",payload:u});try{const{view:h}=n,m=h.state.selection.$to.nodeAfter?.text?.startsWith(" "),f=r.range?{...r.range}:{from:0,to:0};m&&r.range&&(f.to+=1),await o({range:f,item:u})===!1?s({type:"SET_SELECTED_ITEM",payload:null}):l()}catch{l()}}},{selectedIndex:d}=Dn({editor:n,query:i,items:a,onSelect:c,onClose:l});return{selectedItem:r.selectedItem,items:a,selectedIndex:d,close:l,onSelect:c}}function $n({children:n}){const{state:e,dispatch:t}=je(),{open:o,element:r}=e,s=()=>{t({type:"ON_EXIT"})},{refs:i,floatingStyles:a,context:l}=mn({placement:"bottom-start",open:o,onOpenChange:g=>{g||s()},elements:{reference:r},middleware:[ft(10),gt(),mt()],whileElementsMounted:Ce}),c=fn(l,{outsidePress:g=>!(g.target instanceof Element&&g.target.closest(".ProseMirror"))}),d=hn(l,{role:"listbox"}),{getFloatingProps:u}=pn([c,d]);return o?I.jsx(ln,{children:I.jsx("div",{ref:i.setFloating,style:a,...u(),className:"z-50 w-auto min-w-[360px] max-w-[520px] rounded-lg border bg-popover p-0 text-popover-foreground shadow-soft outline-hidden overflow-hidden",children:n})}):null}const kn=n=>{const e=H.c(17),{item:t,isSelected:o,onSelect:r,isLoading:s,ref:i,renderItem:a}=n;let l;if(e[0]!==t){const x=bt(t._meta);l=t.title||xt(t.name,x),e[0]=t,e[1]=l}else l=e[1];const c=l,d=t.description||null,u=t.icon,g=o&&"bg-accent text-accent-foreground",h=s&&"pointer-events-none opacity-50";let y;e[2]!==g||e[3]!==h?(y=vt("relative flex w-full cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors","hover:bg-accent hover:text-accent-foreground","focus:bg-accent focus:text-accent-foreground",g,h),e[2]=g,e[3]=h,e[4]=y):y=e[4];let m;e[5]!==d||e[6]!==u||e[7]!==s||e[8]!==t||e[9]!==c||e[10]!==a?(m=a?a(t):I.jsxs(I.Fragment,{children:[u!==void 0&&I.jsx(yt,{icon:u,name:c,size:"xs",className:"mr-2"}),I.jsxs("div",{className:"flex flex-col gap-0.5 flex-1 min-w-0",children:[I.jsxs("div",{className:"flex items-center justify-between gap-2",children:[I.jsx("span",{className:"font-medium flex items-center truncate capitalize",children:c}),s&&I.jsx(ht,{size:"xs"})]}),d&&I.jsx("div",{className:"text-xs text-muted-foreground line-clamp-1",children:d})]}),t.drillable&&I.jsx("kbd",{className:"shrink-0 ml-2 px-1.5 py-0.5 text-2xs font-medium text-muted-foreground bg-muted border border-border rounded",children:"↵"})]}),e[5]=d,e[6]=u,e[7]=s,e[8]=t,e[9]=c,e[10]=a,e[11]=m):m=e[11];let f;return e[12]!==r||e[13]!==i||e[14]!==y||e[15]!==m?(f=I.jsx("div",{ref:i,onClick:r,className:y,children:m}),e[12]=r,e[13]=i,e[14]=y,e[15]=m,e[16]=f):f=e[16],f},_n=n=>{const e=H.c(24),{editor:t,queryKey:o,queryFn:r,onSelect:s,renderItem:i,emptyLabel:a}=n,l=pt();let c;e[0]!==t||e[1]!==s||e[2]!==r||e[3]!==o?(c={editor:t,queryKey:o,queryFn:r,onSelect:s},e[0]=t,e[1]=s,e[2]=r,e[3]=o,e[4]=c):c=e[4];const{items:d,selectedIndex:u,onSelect:g,selectedItem:h}=qn(c);if(!d.length){let x;e[5]!==a||e[6]!==l?(x=a??l("chat.mention.noItemsFound"),e[5]=a,e[6]=l,e[7]=x):x=e[7];let b;return e[8]!==x?(b=I.jsx("div",{className:"min-w-[360px] max-w-[520px] bg-popover text-popover-foreground rounded-md border shadow-soft p-3 text-sm",children:x}),e[8]=x,e[9]=b):b=e[9],b}let y;e[10]===Symbol.for("react.memo_cache_sentinel")?(y={maxHeight:"min(320px, var(--radix-popover-content-available-height, 320px))"},e[10]=y):y=e[10];let m;if(e[11]!==g||e[12]!==d||e[13]!==i||e[14]!==u||e[15]!==h?.name){let x;e[17]!==g||e[18]!==i||e[19]!==u||e[20]!==h?.name?(x=(b,R)=>I.jsx(kn,{item:b,isSelected:R===u,ref:R===u?Kn:void 0,onSelect:()=>g(b,R),isLoading:h?.name===b.name,renderItem:i},`${b.kind??"item"}:${b.name}`),e[17]=g,e[18]=i,e[19]=u,e[20]=h?.name,e[21]=x):x=e[21],m=d.map(x),e[11]=g,e[12]=d,e[13]=i,e[14]=u,e[15]=h?.name,e[16]=m}else m=e[16];let f;return e[22]!==m?(f=I.jsx("div",{className:"min-w-[360px] max-w-[520px] bg-popover text-popover-foreground rounded-md overflow-y-auto",style:y,children:I.jsx("div",{className:"p-1",children:m})}),e[22]=m,e[23]=f):f=e[23],f};function Ln(){const n=H.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=I.jsx("div",{className:"p-1",children:[...Array(3)].map(jn)}),n[0]=e):e=n[0],e}function jn(n,e){return I.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1.5 animate-pulse",children:[I.jsx("div",{className:"h-4 w-24 bg-muted rounded"}),I.jsx("div",{className:"h-3 w-32 bg-muted rounded"})]},e)}function Qn(n){const e=H.c(20),{editor:t,char:o,pluginKey:r,queryKey:s,queryFn:i,onSelect:a,allow:l,onOpenChange:c,renderItem:d,emptyLabel:u}=n;let g;e[0]!==l||e[1]!==o||e[2]!==t||e[3]!==c||e[4]!==r?(g={editor:t,char:o,pluginKey:r,allow:l,onOpenChange:c},e[0]=l,e[1]=o,e[2]=t,e[3]=c,e[4]=r,e[5]=g):g=e[5];const{state:h,dispatch:y}=On(g);let m;e[6]!==y||e[7]!==h?(m={state:h,dispatch:y},e[6]=y,e[7]=h,e[8]=m):m=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=I.jsx(Ln,{}),e[9]=f):f=e[9];let x;e[10]!==t||e[11]!==u||e[12]!==a||e[13]!==i||e[14]!==s||e[15]!==d?(x=I.jsx($n,{children:I.jsx(p.Suspense,{fallback:f,children:I.jsx(_n,{editor:t,queryKey:s,queryFn:i,onSelect:a,renderItem:d,emptyLabel:u})})}),e[10]=t,e[11]=u,e[12]=a,e[13]=i,e[14]=s,e[15]=d,e[16]=x):x=e[16];let b;return e[17]!==m||e[18]!==x?(b=I.jsx(Le.Provider,{value:m,children:x}),e[17]=m,e[18]=x,e[19]=b):b=e[19],b}function Kn(n){n&&n.scrollIntoView({block:"center",behavior:"smooth"})}export{Qn as S,Yn as a,Xn as e,Hn as s};
@@ -1 +1 @@
1
- import{r as n,j as i,cB as C,cz as _,cw as T,cC as I,cH as H,cS as M,cO as z,c as A,m as g}from"./index-ThHlPkA1.js";var b="Switch",[O]=z(b),[U,q]=O(b),y=n.forwardRef((o,e)=>{const{__scopeSwitch:t,name:s,checked:r,defaultChecked:c,required:a,disabled:d,value:u="on",onCheckedChange:w,form:l,...k}=o,[p,h]=n.useState(null),S=_(e,m=>h(m)),v=n.useRef(!1),x=p?l||!!p.closest("form"):!0,[f,N]=T({prop:r,defaultProp:c??!1,onChange:w,caller:b});return i.jsxs(U,{scope:t,checked:f,disabled:d,children:[i.jsx(C.button,{type:"button",role:"switch","aria-checked":f,"aria-required":a,"data-state":j(f),"data-disabled":d?"":void 0,disabled:d,value:u,...k,ref:S,onClick:I(o.onClick,m=>{N(B=>!B),x&&(v.current=m.isPropagationStopped(),v.current||m.stopPropagation())})}),x&&i.jsx(R,{control:p,bubbles:!v.current,name:s,value:u,checked:f,required:a,disabled:d,form:l,style:{transform:"translateX(-100%)"}})]})});y.displayName=b;var E="SwitchThumb",P=n.forwardRef((o,e)=>{const{__scopeSwitch:t,...s}=o,r=q(E,t);return i.jsx(C.span,{"data-state":j(r.checked),"data-disabled":r.disabled?"":void 0,...s,ref:e})});P.displayName=E;var L="SwitchBubbleInput",R=n.forwardRef(({__scopeSwitch:o,control:e,checked:t,bubbles:s=!0,...r},c)=>{const a=n.useRef(null),d=_(a,c),u=H(t),w=M(e);return n.useEffect(()=>{const l=a.current;if(!l)return;const k=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(k,"checked").set;if(u!==t&&h){const S=new Event("click",{bubbles:s});h.call(l,t),l.dispatchEvent(S)}},[u,t,s]),i.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:t,...r,tabIndex:-1,ref:d,style:{...r.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});R.displayName=L;function j(o){return o?"checked":"unchecked"}var $=y,D=P;function W(o){const e=A.c(9);let t,s;e[0]!==o?({className:t,...s}=o,e[0]=o,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let r;e[3]!==t?(r=g("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-foreground/15 inline-flex h-[1.125rem] w-8 shrink-0 items-center rounded-full border-2 border-transparent transition-colors outline-none focus-ring disabled:opacity-50",t),e[3]=t,e[4]=r):r=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx(D,{"data-slot":"switch-thumb",className:g("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-3.5 rounded-full shadow-[0_0_0_1px_#0000000f] ring-0 transition-transform data-[state=checked]:translate-x-3.5 data-[state=unchecked]:translate-x-0")}),e[5]=c):c=e[5];let a;return e[6]!==s||e[7]!==r?(a=i.jsx($,{"data-slot":"switch",className:r,...s,children:c}),e[6]=s,e[7]=r,e[8]=a):a=e[8],a}export{W as S};
1
+ import{r as n,j as i,cB as C,cz as _,cw as T,cC as I,cH as H,cS as M,cO as z,c as A,m as g}from"./index-Cm-moWa5.js";var b="Switch",[O]=z(b),[U,q]=O(b),y=n.forwardRef((o,e)=>{const{__scopeSwitch:t,name:s,checked:r,defaultChecked:c,required:a,disabled:d,value:u="on",onCheckedChange:w,form:l,...k}=o,[p,h]=n.useState(null),S=_(e,m=>h(m)),v=n.useRef(!1),x=p?l||!!p.closest("form"):!0,[f,N]=T({prop:r,defaultProp:c??!1,onChange:w,caller:b});return i.jsxs(U,{scope:t,checked:f,disabled:d,children:[i.jsx(C.button,{type:"button",role:"switch","aria-checked":f,"aria-required":a,"data-state":j(f),"data-disabled":d?"":void 0,disabled:d,value:u,...k,ref:S,onClick:I(o.onClick,m=>{N(B=>!B),x&&(v.current=m.isPropagationStopped(),v.current||m.stopPropagation())})}),x&&i.jsx(R,{control:p,bubbles:!v.current,name:s,value:u,checked:f,required:a,disabled:d,form:l,style:{transform:"translateX(-100%)"}})]})});y.displayName=b;var E="SwitchThumb",P=n.forwardRef((o,e)=>{const{__scopeSwitch:t,...s}=o,r=q(E,t);return i.jsx(C.span,{"data-state":j(r.checked),"data-disabled":r.disabled?"":void 0,...s,ref:e})});P.displayName=E;var L="SwitchBubbleInput",R=n.forwardRef(({__scopeSwitch:o,control:e,checked:t,bubbles:s=!0,...r},c)=>{const a=n.useRef(null),d=_(a,c),u=H(t),w=M(e);return n.useEffect(()=>{const l=a.current;if(!l)return;const k=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(k,"checked").set;if(u!==t&&h){const S=new Event("click",{bubbles:s});h.call(l,t),l.dispatchEvent(S)}},[u,t,s]),i.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:t,...r,tabIndex:-1,ref:d,style:{...r.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});R.displayName=L;function j(o){return o?"checked":"unchecked"}var $=y,D=P;function W(o){const e=A.c(9);let t,s;e[0]!==o?({className:t,...s}=o,e[0]=o,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let r;e[3]!==t?(r=g("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-foreground/15 inline-flex h-[1.125rem] w-8 shrink-0 items-center rounded-full border-2 border-transparent transition-colors outline-none focus-ring disabled:opacity-50",t),e[3]=t,e[4]=r):r=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx(D,{"data-slot":"switch-thumb",className:g("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-3.5 rounded-full shadow-[0_0_0_1px_#0000000f] ring-0 transition-transform data-[state=checked]:translate-x-3.5 data-[state=unchecked]:translate-x-0")}),e[5]=c):c=e[5];let a;return e[6]!==s||e[7]!==r?(a=i.jsx($,{"data-slot":"switch",className:r,...s,children:c}),e[6]=s,e[7]=r,e[8]=a):a=e[8],a}export{W as S};
@@ -1 +1 @@
1
- import{c as ee,j as s,hY as he,b as fe,r as oe,B as Z,g2 as pe,c6 as ge,m as xe,g3 as je,hw as Re,t as re,bB as Se,x as ve,aT as be,w as De,I as Ce,y as _e,v as Pe,D as Ae,aH as ke,aI as Ne,aJ as Ee,aK as Ie,bj as Oe,aL as we,aM as ze,aN as Te}from"./index-ThHlPkA1.js";import{s as ue}from"./Plus-CFb7oJrI.js";import{E as $e}from"./empty-state-D1kuCCvh.js";import{u as Fe,G as Be,R as Ge}from"./repository-picker-DtUL_pmI.js";import{u as He,b as Le,c as qe}from"./use-org-repo-syncs-D8rrVqZZ.js";import{R as Je}from"./require-capability-Zb9L0UB5.js";import"./ArrowLeft-CljOyrIP.js";import"./tooltip-DgFw0k5f.js";import"./index-B6uyloRF.js";import"./label-BRcQIH7Z.js";import"./github-icon-B3lAwfsm.js";import"./useInfiniteQuery-f_imkp8-.js";import"./infiniteQueryObserver-DO5Ifm28.js";import"./collection-search-9RSy1xeA.js";import"./SearchMd-DBFjE3ta.js";import"./ShoppingBag01-Ce0oZ7tq.js";import"./use-debounced-value-WdYCpwhX.js";import"./use-organization-settings-DGtBK5Oe.js";import"./schema-iAJ4pGqb.js";import"./task-board-DDcqJlpm.js";import"./access-gate-DlxNXK1w.js";import"./capability-load-error-C3U-ZhDb.js";function Ke(e){return e.toLowerCase().replace(/[^a-z0-9_.-]+/g,"-").replace(/^[.-]+|[.-]+$/g,"").slice(0,128)}function Me(e,t){return e.lastSyncError?{label:e.lastSyncError,error:!0}:e.lastSyncedAt?{label:t("library.syncedRepos.syncedAgo",{ago:Re(e.lastSyncedAt)}),error:!1}:{label:t("library.syncedRepos.waitingFirstSync"),error:!1}}function Ve(e){const t=ee.c(30),{config:n,onRemove:i}=e,c=fe(),d=Me(n,c),m=Fe();let r;t[0]!==n.repositoryId||t[1]!==m.data?(r=m.data?.find(D=>D.id===n.repositoryId),t[0]=n.repositoryId,t[1]=m.data,t[2]=r):r=t[2];const a=r,l=je;let f;t[3]!==a?(f=a?s.jsx(Be,{provider:a.provider,size:16}):s.jsx(ge,{size:16}),t[3]=a,t[4]=f):f=t[4];const j=a?.path??`${n.repoOwner}/${n.repoName}`;let R;t[5]!==j?(R=s.jsx("span",{className:"truncate",children:j}),t[5]=j,t[6]=R):R=t[6];let g;t[7]!==n.ref?(g=s.jsxs("span",{className:"text-xs font-normal text-muted-foreground shrink-0",children:["@",n.ref]}),t[7]=n.ref,t[8]=g):g=t[8];let S;t[9]!==R||t[10]!==g?(S=s.jsxs("span",{className:"flex items-center gap-2",children:[R,g]}),t[9]=R,t[10]=g,t[11]=S):S=t[11];const b=xe(d.error&&"text-destructive");let v;t[12]!==n.volume||t[13]!==c?(v=c("settings.syncedRepos.rowSubtitle",{volume:n.volume}),t[12]=n.volume,t[13]=c,t[14]=v):v=t[14];let u;t[15]!==d.label||t[16]!==b||t[17]!==v?(u=s.jsxs("span",{className:b,children:[v," ·"," ",d.label]}),t[15]=d.label,t[16]=b,t[17]=v,t[18]=u):u=t[18];let y;t[19]!==c?(y=c("settings.syncedRepos.remove"),t[19]=c,t[20]=y):y=t[20];let p;t[21]!==i||t[22]!==y?(p=s.jsx(Z,{variant:"outline",size:"sm",onClick:i,children:y}),t[21]=i,t[22]=y,t[23]=p):p=t[23];let h;return t[24]!==l||t[25]!==p||t[26]!==f||t[27]!==S||t[28]!==u?(h=s.jsx(l,{icon:f,title:S,description:u,action:p}),t[24]=l,t[25]=p,t[26]=f,t[27]=S,t[28]=u,t[29]=h):h=t[29],h}function Ye(e){const t=ee.c(15),{onAdd:n}=e,i=fe();let c;t[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(ge,{}),t[0]=c):c=t[0];let d;t[1]!==i?(d=i("settings.syncedRepos.emptyTitle"),t[1]=i,t[2]=d):d=t[2];let m;t[3]!==i?(m=i("settings.syncedRepos.emptyDescription"),t[3]=i,t[4]=m):m=t[4];let r;t[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(ue,{size:14}),t[5]=r):r=t[5];let a;t[6]!==i?(a=i("settings.syncedRepos.addRepo"),t[6]=i,t[7]=a):a=t[7];let l;t[8]!==n||t[9]!==a?(l=s.jsxs(Z,{onClick:n,size:"sm",children:[r,a]}),t[8]=n,t[9]=a,t[10]=l):l=t[10];let f;return t[11]!==d||t[12]!==m||t[13]!==l?(f=s.jsx(pe,{children:s.jsx($e,{size:"inline",icon:c,title:d,description:m,children:l})}),t[11]=d,t[12]=m,t[13]=l,t[14]=f):f=t[14],f}function Qe(){const e=ee.c(102),t=fe(),n=He(),i=Le(),c=qe(),[d,m]=oe.useState(!1),[r,a]=oe.useState(null),[l,f]=oe.useState(""),[j,R]=oe.useState(null);let g;e[0]!==i||e[1]!==r||e[2]!==t||e[3]!==l?(g=function(){!r||!l.trim()||i.mutate({repositoryId:r.id,volume:l.trim()},{onSuccess:x=>{a(null),re.success(t("settings.syncedRepos.created",{volume:x.volume}))},onError:x=>{re.error(x instanceof Error?x.message:t("settings.syncedRepos.failed"))}})},e[0]=i,e[1]=r,e[2]=t,e[3]=l,e[4]=g):g=e[4];const S=g;let b;e[5]!==j||e[6]!==c||e[7]!==t?(b=function(){j&&c.mutate(j.id,{onSuccess:()=>re.success(t("settings.syncedRepos.removed")),onError:x=>re.error(x instanceof Error?x.message:t("settings.syncedRepos.failed")),onSettled:()=>R(null)})},e[5]=j,e[6]=c,e[7]=t,e[8]=b):b=e[8];const v=b;if(n.isPending){let o;return e[9]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Se,{className:"h-32 w-full"}),e[9]=o):o=e[9],o}let u;e[10]!==n.data?(u=n.data??[],e[10]=n.data,e[11]=u):u=e[11];const y=u;let p;e[12]!==y||e[13]!==t?(p=y.length===0?s.jsx(Ye,{onAdd:()=>m(!0)}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex items-center justify-end",children:s.jsxs(Z,{onClick:()=>m(!0),size:"sm",children:[s.jsx(ue,{size:14}),t("settings.syncedRepos.addRepo")]})}),s.jsx(pe,{children:y.map(o=>s.jsx(Ve,{config:o,onRemove:()=>R(o)},o.id))})]}),e[12]=y,e[13]=t,e[14]=p):p=e[14];let h;e[15]!==t?(h=t("settings.syncedRepos.pickerTitle"),e[15]=t,e[16]=h):h=e[16];let D;e[17]===Symbol.for("react.memo_cache_sentinel")?(D=o=>{const{repository:x}=o;m(!1),a(x),f(Ke(x.path.split("/").at(-1)??x.path))},e[17]=D):D=e[17];let C;e[18]!==d||e[19]!==h?(C=s.jsx(Ge,{open:d,onOpenChange:m,title:h,onPicked:D}),e[18]=d,e[19]=h,e[20]=C):C=e[20];const ae=r!==null;let te;e[21]===Symbol.for("react.memo_cache_sentinel")?(te=o=>{o||a(null)},e[21]=te):te=e[21];let _;e[22]!==t?(_=t("settings.syncedRepos.nameDialogTitle"),e[22]=t,e[23]=_):_=e[23];let P;e[24]!==_?(P=s.jsx(ve,{children:_}),e[24]=_,e[25]=P):P=e[25];const ce=r?r.path:"";let A;e[26]!==t||e[27]!==ce?(A=t("settings.syncedRepos.nameDialogDescription",{repo:ce}),e[26]=t,e[27]=ce,e[28]=A):A=e[28];let k;e[29]!==A?(k=s.jsx(be,{children:A}),e[29]=A,e[30]=k):k=e[30];let N;e[31]!==P||e[32]!==k?(N=s.jsxs(De,{children:[P,k]}),e[31]=P,e[32]=k,e[33]=N):N=e[33];let se;e[34]===Symbol.for("react.memo_cache_sentinel")?(se=o=>f(o.target.value),e[34]=se):se=e[34];let E;e[35]!==t?(E=t("settings.syncedRepos.namePlaceholder"),e[35]=t,e[36]=E):E=e[36];let I;e[37]!==E||e[38]!==l?(I=s.jsx(Ce,{value:l,onChange:se,placeholder:E,autoFocus:!0}),e[37]=E,e[38]=l,e[39]=I):I=e[39];let ie;e[40]===Symbol.for("react.memo_cache_sentinel")?(ie=()=>a(null),e[40]=ie):ie=e[40];const ye=i.isPending;let O;e[41]!==t?(O=t("settings.syncedRepos.cancel"),e[41]=t,e[42]=O):O=e[42];let w;e[43]!==i.isPending||e[44]!==O?(w=s.jsx(Z,{variant:"outline",onClick:ie,disabled:ye,children:O}),e[43]=i.isPending,e[44]=O,e[45]=w):w=e[45];let z;e[46]!==i.isPending||e[47]!==l?(z=!l.trim()||i.isPending,e[46]=i.isPending,e[47]=l,e[48]=z):z=e[48];let T;e[49]!==i.isPending||e[50]!==t?(T=i.isPending?t("settings.syncedRepos.creating"):t("settings.syncedRepos.create"),e[49]=i.isPending,e[50]=t,e[51]=T):T=e[51];let $;e[52]!==S||e[53]!==z||e[54]!==T?($=s.jsx(Z,{disabled:z,onClick:S,children:T}),e[52]=S,e[53]=z,e[54]=T,e[55]=$):$=e[55];let F;e[56]!==w||e[57]!==$?(F=s.jsxs(_e,{children:[w,$]}),e[56]=w,e[57]=$,e[58]=F):F=e[58];let B;e[59]!==N||e[60]!==I||e[61]!==F?(B=s.jsxs(Pe,{className:"sm:max-w-sm",children:[N,I,F]}),e[59]=N,e[60]=I,e[61]=F,e[62]=B):B=e[62];let G;e[63]!==B||e[64]!==ae?(G=s.jsx(Ae,{open:ae,onOpenChange:te,children:B}),e[63]=B,e[64]=ae,e[65]=G):G=e[65];const de=j!==null;let ne;e[66]===Symbol.for("react.memo_cache_sentinel")?(ne=o=>{o||R(null)},e[66]=ne):ne=e[66];const me=j?.volume??"";let H;e[67]!==t||e[68]!==me?(H=t("settings.syncedRepos.removeTitle",{volume:me}),e[67]=t,e[68]=me,e[69]=H):H=e[69];let L;e[70]!==H?(L=s.jsx(ke,{children:H}),e[70]=H,e[71]=L):L=e[71];let q;e[72]!==t?(q=t("settings.syncedRepos.removeDescription"),e[72]=t,e[73]=q):q=e[73];let J;e[74]!==q?(J=s.jsx(Ne,{children:q}),e[74]=q,e[75]=J):J=e[75];let K;e[76]!==L||e[77]!==J?(K=s.jsxs(Ee,{children:[L,J]}),e[76]=L,e[77]=J,e[78]=K):K=e[78];let M;e[79]!==t?(M=t("settings.syncedRepos.cancel"),e[79]=t,e[80]=M):M=e[80];let V;e[81]!==M?(V=s.jsx(Ie,{children:M}),e[81]=M,e[82]=V):V=e[82];let Y;e[83]!==t?(Y=t("settings.syncedRepos.remove"),e[83]=t,e[84]=Y):Y=e[84];let Q;e[85]!==v||e[86]!==Y?(Q=s.jsx(Oe,{onClick:v,children:Y}),e[85]=v,e[86]=Y,e[87]=Q):Q=e[87];let U;e[88]!==V||e[89]!==Q?(U=s.jsxs(we,{children:[V,Q]}),e[88]=V,e[89]=Q,e[90]=U):U=e[90];let W;e[91]!==K||e[92]!==U?(W=s.jsxs(ze,{children:[K,U]}),e[91]=K,e[92]=U,e[93]=W):W=e[93];let X;e[94]!==de||e[95]!==W?(X=s.jsx(Te,{open:de,onOpenChange:ne,children:W}),e[94]=de,e[95]=W,e[96]=X):X=e[96];let le;return e[97]!==G||e[98]!==p||e[99]!==X||e[100]!==C?(le=s.jsxs(s.Fragment,{children:[p,C,G,X]}),e[97]=G,e[98]=p,e[99]=X,e[100]=C,e[101]=le):le=e[101],le}function Ue(){const e=ee.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(he,{group:"storage",children:s.jsx(Qe,{})}),e[0]=t):t=e[0],t}function jt(){const e=ee.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(Je,{capability:"file-configs:manage",area:"files",children:s.jsx(Ue,{})}),e[0]=t):t=e[0],t}export{jt as default};
1
+ import{c as ee,j as s,hZ as he,b as fe,r as oe,B as Y,g3 as pe,c6 as ge,m as xe,g4 as je,hx as Re,t as re,bB as Se,x as ve,aT as be,w as De,I as Ce,y as _e,v as Pe,D as Ae,aH as ke,aI as Ne,aJ as Ee,aK as Ie,bj as Oe,aL as ze,aM as Te,aN as we}from"./index-Cm-moWa5.js";import{s as ue}from"./Plus-EDJqelyG.js";import{E as $e}from"./empty-state-BTVsC7xK.js";import{u as Fe,G as Be,R as Ge}from"./repository-picker-CjOhm0Ey.js";import{u as He,b as Le,c as qe}from"./use-org-repo-syncs-DEF2HBAf.js";import{R as Je}from"./require-capability-CJKpnzPC.js";import"./ArrowLeft-BW0QTKlw.js";import"./tooltip-DkKVKER8.js";import"./index-CZmp59DI.js";import"./label-BwDzqaMo.js";import"./github-icon-Dq39pEMT.js";import"./useInfiniteQuery-BNB4wMo9.js";import"./infiniteQueryObserver-D6uRpwx5.js";import"./collection-search-AauU22W8.js";import"./SearchMd-BM1-RWQF.js";import"./ShoppingBag01-BsFRFwoQ.js";import"./use-debounced-value-DklROaCE.js";import"./use-organization-settings-CyexoMCC.js";import"./schema-iQl5fqzx.js";import"./task-board-CIxtWADL.js";import"./access-gate-BZysXSEP.js";import"./capability-load-error-DIv2eZlz.js";function Ke(e){return e.toLowerCase().replace(/[^a-z0-9_.-]+/g,"-").replace(/^[.-]+|[.-]+$/g,"").slice(0,128)}function Me(e,t){return e.lastSyncError?{label:e.lastSyncError,error:!0}:e.lastSyncedAt?{label:t("library.syncedRepos.syncedAgo",{ago:Re(e.lastSyncedAt)}),error:!1}:{label:t("library.syncedRepos.waitingFirstSync"),error:!1}}function Ve(e){const t=ee.c(30),{config:n,onRemove:i}=e,c=fe(),d=Me(n,c),m=Fe();let r;t[0]!==n.repositoryId||t[1]!==m.data?(r=m.data?.find(D=>D.id===n.repositoryId),t[0]=n.repositoryId,t[1]=m.data,t[2]=r):r=t[2];const a=r,l=je;let f;t[3]!==a?(f=a?s.jsx(Be,{provider:a.provider,size:16}):s.jsx(ge,{size:16}),t[3]=a,t[4]=f):f=t[4];const j=a?.path??`${n.repoOwner}/${n.repoName}`;let R;t[5]!==j?(R=s.jsx("span",{className:"truncate",children:j}),t[5]=j,t[6]=R):R=t[6];let g;t[7]!==n.ref?(g=s.jsxs("span",{className:"text-xs font-normal text-muted-foreground shrink-0",children:["@",n.ref]}),t[7]=n.ref,t[8]=g):g=t[8];let S;t[9]!==R||t[10]!==g?(S=s.jsxs("span",{className:"flex items-center gap-2",children:[R,g]}),t[9]=R,t[10]=g,t[11]=S):S=t[11];const b=xe(d.error&&"text-destructive");let v;t[12]!==n.volume||t[13]!==c?(v=c("settings.syncedRepos.rowSubtitle",{volume:n.volume}),t[12]=n.volume,t[13]=c,t[14]=v):v=t[14];let u;t[15]!==d.label||t[16]!==b||t[17]!==v?(u=s.jsxs("span",{className:b,children:[v," ·"," ",d.label]}),t[15]=d.label,t[16]=b,t[17]=v,t[18]=u):u=t[18];let y;t[19]!==c?(y=c("settings.syncedRepos.remove"),t[19]=c,t[20]=y):y=t[20];let p;t[21]!==i||t[22]!==y?(p=s.jsx(Y,{variant:"outline",size:"sm",onClick:i,children:y}),t[21]=i,t[22]=y,t[23]=p):p=t[23];let h;return t[24]!==l||t[25]!==p||t[26]!==f||t[27]!==S||t[28]!==u?(h=s.jsx(l,{icon:f,title:S,description:u,action:p}),t[24]=l,t[25]=p,t[26]=f,t[27]=S,t[28]=u,t[29]=h):h=t[29],h}function Ze(e){const t=ee.c(15),{onAdd:n}=e,i=fe();let c;t[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(ge,{}),t[0]=c):c=t[0];let d;t[1]!==i?(d=i("settings.syncedRepos.emptyTitle"),t[1]=i,t[2]=d):d=t[2];let m;t[3]!==i?(m=i("settings.syncedRepos.emptyDescription"),t[3]=i,t[4]=m):m=t[4];let r;t[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(ue,{size:14}),t[5]=r):r=t[5];let a;t[6]!==i?(a=i("settings.syncedRepos.addRepo"),t[6]=i,t[7]=a):a=t[7];let l;t[8]!==n||t[9]!==a?(l=s.jsxs(Y,{onClick:n,size:"sm",children:[r,a]}),t[8]=n,t[9]=a,t[10]=l):l=t[10];let f;return t[11]!==d||t[12]!==m||t[13]!==l?(f=s.jsx(pe,{children:s.jsx($e,{size:"inline",icon:c,title:d,description:m,children:l})}),t[11]=d,t[12]=m,t[13]=l,t[14]=f):f=t[14],f}function Qe(){const e=ee.c(102),t=fe(),n=He(),i=Le(),c=qe(),[d,m]=oe.useState(!1),[r,a]=oe.useState(null),[l,f]=oe.useState(""),[j,R]=oe.useState(null);let g;e[0]!==i||e[1]!==r||e[2]!==t||e[3]!==l?(g=function(){!r||!l.trim()||i.mutate({repositoryId:r.id,volume:l.trim()},{onSuccess:x=>{a(null),re.success(t("settings.syncedRepos.created",{volume:x.volume}))},onError:x=>{re.error(x instanceof Error?x.message:t("settings.syncedRepos.failed"))}})},e[0]=i,e[1]=r,e[2]=t,e[3]=l,e[4]=g):g=e[4];const S=g;let b;e[5]!==j||e[6]!==c||e[7]!==t?(b=function(){j&&c.mutate(j.id,{onSuccess:()=>re.success(t("settings.syncedRepos.removed")),onError:x=>re.error(x instanceof Error?x.message:t("settings.syncedRepos.failed")),onSettled:()=>R(null)})},e[5]=j,e[6]=c,e[7]=t,e[8]=b):b=e[8];const v=b;if(n.isPending){let o;return e[9]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Se,{className:"h-32 w-full"}),e[9]=o):o=e[9],o}let u;e[10]!==n.data?(u=n.data??[],e[10]=n.data,e[11]=u):u=e[11];const y=u;let p;e[12]!==y||e[13]!==t?(p=y.length===0?s.jsx(Ze,{onAdd:()=>m(!0)}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex items-center justify-end",children:s.jsxs(Y,{onClick:()=>m(!0),size:"sm",children:[s.jsx(ue,{size:14}),t("settings.syncedRepos.addRepo")]})}),s.jsx(pe,{children:y.map(o=>s.jsx(Ve,{config:o,onRemove:()=>R(o)},o.id))})]}),e[12]=y,e[13]=t,e[14]=p):p=e[14];let h;e[15]!==t?(h=t("settings.syncedRepos.pickerTitle"),e[15]=t,e[16]=h):h=e[16];let D;e[17]===Symbol.for("react.memo_cache_sentinel")?(D=o=>{const{repository:x}=o;m(!1),a(x),f(Ke(x.path.split("/").at(-1)??x.path))},e[17]=D):D=e[17];let C;e[18]!==d||e[19]!==h?(C=s.jsx(Ge,{open:d,onOpenChange:m,title:h,onPicked:D}),e[18]=d,e[19]=h,e[20]=C):C=e[20];const ae=r!==null;let te;e[21]===Symbol.for("react.memo_cache_sentinel")?(te=o=>{o||a(null)},e[21]=te):te=e[21];let _;e[22]!==t?(_=t("settings.syncedRepos.nameDialogTitle"),e[22]=t,e[23]=_):_=e[23];let P;e[24]!==_?(P=s.jsx(ve,{children:_}),e[24]=_,e[25]=P):P=e[25];const ce=r?r.path:"";let A;e[26]!==t||e[27]!==ce?(A=t("settings.syncedRepos.nameDialogDescription",{repo:ce}),e[26]=t,e[27]=ce,e[28]=A):A=e[28];let k;e[29]!==A?(k=s.jsx(be,{children:A}),e[29]=A,e[30]=k):k=e[30];let N;e[31]!==P||e[32]!==k?(N=s.jsxs(De,{children:[P,k]}),e[31]=P,e[32]=k,e[33]=N):N=e[33];let se;e[34]===Symbol.for("react.memo_cache_sentinel")?(se=o=>f(o.target.value),e[34]=se):se=e[34];let E;e[35]!==t?(E=t("settings.syncedRepos.namePlaceholder"),e[35]=t,e[36]=E):E=e[36];let I;e[37]!==E||e[38]!==l?(I=s.jsx(Ce,{value:l,onChange:se,placeholder:E,autoFocus:!0}),e[37]=E,e[38]=l,e[39]=I):I=e[39];let ie;e[40]===Symbol.for("react.memo_cache_sentinel")?(ie=()=>a(null),e[40]=ie):ie=e[40];const ye=i.isPending;let O;e[41]!==t?(O=t("settings.syncedRepos.cancel"),e[41]=t,e[42]=O):O=e[42];let z;e[43]!==i.isPending||e[44]!==O?(z=s.jsx(Y,{variant:"outline",onClick:ie,disabled:ye,children:O}),e[43]=i.isPending,e[44]=O,e[45]=z):z=e[45];let T;e[46]!==i.isPending||e[47]!==l?(T=!l.trim()||i.isPending,e[46]=i.isPending,e[47]=l,e[48]=T):T=e[48];let w;e[49]!==i.isPending||e[50]!==t?(w=i.isPending?t("settings.syncedRepos.creating"):t("settings.syncedRepos.create"),e[49]=i.isPending,e[50]=t,e[51]=w):w=e[51];let $;e[52]!==S||e[53]!==T||e[54]!==w?($=s.jsx(Y,{disabled:T,onClick:S,children:w}),e[52]=S,e[53]=T,e[54]=w,e[55]=$):$=e[55];let F;e[56]!==z||e[57]!==$?(F=s.jsxs(_e,{children:[z,$]}),e[56]=z,e[57]=$,e[58]=F):F=e[58];let B;e[59]!==N||e[60]!==I||e[61]!==F?(B=s.jsxs(Pe,{className:"sm:max-w-sm",children:[N,I,F]}),e[59]=N,e[60]=I,e[61]=F,e[62]=B):B=e[62];let G;e[63]!==B||e[64]!==ae?(G=s.jsx(Ae,{open:ae,onOpenChange:te,children:B}),e[63]=B,e[64]=ae,e[65]=G):G=e[65];const de=j!==null;let ne;e[66]===Symbol.for("react.memo_cache_sentinel")?(ne=o=>{o||R(null)},e[66]=ne):ne=e[66];const me=j?.volume??"";let H;e[67]!==t||e[68]!==me?(H=t("settings.syncedRepos.removeTitle",{volume:me}),e[67]=t,e[68]=me,e[69]=H):H=e[69];let L;e[70]!==H?(L=s.jsx(ke,{children:H}),e[70]=H,e[71]=L):L=e[71];let q;e[72]!==t?(q=t("settings.syncedRepos.removeDescription"),e[72]=t,e[73]=q):q=e[73];let J;e[74]!==q?(J=s.jsx(Ne,{children:q}),e[74]=q,e[75]=J):J=e[75];let K;e[76]!==L||e[77]!==J?(K=s.jsxs(Ee,{children:[L,J]}),e[76]=L,e[77]=J,e[78]=K):K=e[78];let M;e[79]!==t?(M=t("settings.syncedRepos.cancel"),e[79]=t,e[80]=M):M=e[80];let V;e[81]!==M?(V=s.jsx(Ie,{children:M}),e[81]=M,e[82]=V):V=e[82];let Z;e[83]!==t?(Z=t("settings.syncedRepos.remove"),e[83]=t,e[84]=Z):Z=e[84];let Q;e[85]!==v||e[86]!==Z?(Q=s.jsx(Oe,{onClick:v,children:Z}),e[85]=v,e[86]=Z,e[87]=Q):Q=e[87];let U;e[88]!==V||e[89]!==Q?(U=s.jsxs(ze,{children:[V,Q]}),e[88]=V,e[89]=Q,e[90]=U):U=e[90];let W;e[91]!==K||e[92]!==U?(W=s.jsxs(Te,{children:[K,U]}),e[91]=K,e[92]=U,e[93]=W):W=e[93];let X;e[94]!==de||e[95]!==W?(X=s.jsx(we,{open:de,onOpenChange:ne,children:W}),e[94]=de,e[95]=W,e[96]=X):X=e[96];let le;return e[97]!==G||e[98]!==p||e[99]!==X||e[100]!==C?(le=s.jsxs(s.Fragment,{children:[p,C,G,X]}),e[97]=G,e[98]=p,e[99]=X,e[100]=C,e[101]=le):le=e[101],le}function Ue(){const e=ee.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(he,{group:"storage",children:s.jsx(Qe,{})}),e[0]=t):t=e[0],t}function jt(){const e=ee.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(Je,{capability:"file-configs:manage",area:"files",children:s.jsx(Ue,{})}),e[0]=t):t=e[0],t}export{jt as default};
@@ -1 +1 @@
1
- import{c as a,m as f,j as i}from"./index-ThHlPkA1.js";import{M as p}from"./agent-icon-DCW_KqWB.js";function j(m){const s=a.c(10),{icon:o,className:l}=m,e=l===void 0?"size-4":l;if(o.kind==="component"){const{Component:c}=o;let t;return s[0]!==c||s[1]!==e?(t=i.jsx(c,{className:e}),s[0]=c,s[1]=e,s[2]=t):t=s[2],t}if(o.kind==="url"){const c=o.src;let t;s[3]!==e?(t=f(e,"rounded-sm object-cover"),s[3]=e,s[4]=t):t=s[4];let r;return s[5]!==o.src||s[6]!==t?(r=i.jsx("img",{src:c,alt:"",className:t}),s[5]=o.src,s[6]=t,s[7]=r):r=s[7],r}let n;return s[8]!==e?(n=i.jsx(p,{className:e}),s[8]=e,s[9]=n):n=s[9],n}export{j as T};
1
+ import{c as a,m as f,j as i}from"./index-Cm-moWa5.js";import{M as p}from"./agent-icon-CRaK_2eb.js";function j(m){const s=a.c(10),{icon:o,className:l}=m,e=l===void 0?"size-4":l;if(o.kind==="component"){const{Component:c}=o;let t;return s[0]!==c||s[1]!==e?(t=i.jsx(c,{className:e}),s[0]=c,s[1]=e,s[2]=t):t=s[2],t}if(o.kind==="url"){const c=o.src;let t;s[3]!==e?(t=f(e,"rounded-sm object-cover"),s[3]=e,s[4]=t):t=s[4];let r;return s[5]!==o.src||s[6]!==t?(r=i.jsx("img",{src:c,alt:"",className:t}),s[5]=o.src,s[6]=t,s[7]=r):r=s[7],r}let n;return s[8]!==e?(n=i.jsx(p,{className:e}),s[8]=e,s[9]=n):n=s[9],n}export{j as T};