decocms 3.23.0 → 3.23.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (229) hide show
  1. package/dist/client/assets/{AlertCircle-Cie6Yisc.js → AlertCircle-Dpuql2tA.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-Bup5q9aR.js → ArrowUpRight-CH6mYZOO.js} +1 -1
  3. package/dist/client/assets/{Check-CWWWjir3.js → Check-BjI-EvpJ.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-Uw6Si4Uu.js → CheckCircle-D5ai157J.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-DPCmMamP.js → ChevronDown-CCxO1iHC.js} +1 -1
  6. package/dist/client/assets/{ChevronLeft-BFKiUL-g.js → ChevronLeft-Ct25Cl65.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-BPW30xu2.js → ChevronRight-lhfqyrWN.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-Bj0jQsTk.js → ChevronUp-CLwjbWR2.js} +1 -1
  9. package/dist/client/assets/{Container-CPU0lOb2.js → Container-CGpfG9bG.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-BnsTBCnN.js → DotsVertical-WqA4HYBY.js} +1 -1
  11. package/dist/client/assets/{Eye-Dj0PXl1o.js → Eye-DszKjAh_.js} +1 -1
  12. package/dist/client/assets/{FilterLines-D8oi1Sof.js → FilterLines-CrUN88cw.js} +1 -1
  13. package/dist/client/assets/{Globe01-D6rc4c2I.js → Globe01-zBlKP_6-.js} +1 -1
  14. package/dist/client/assets/{HardDrive-BsP_WnUS.js → HardDrive-By3Rrte_.js} +1 -1
  15. package/dist/client/assets/{Key01-ZzkGvXus.js → Key01-Cu3bg6yn.js} +1 -1
  16. package/dist/client/assets/{LayoutLeft-BrLgpS4_.js → LayoutLeft-DOceuRg7.js} +1 -1
  17. package/dist/client/assets/{LinkExternal01-CYjY9tw_.js → LinkExternal01-Bk_Gx_-D.js} +1 -1
  18. package/dist/client/assets/{Monitor01-Co7esQF_.js → Monitor01-5tYO2Ekc.js} +1 -1
  19. package/dist/client/assets/{Palette-C633yKaN.js → Palette-COi8V8YL.js} +1 -1
  20. package/dist/client/assets/{Play-DOVnYSwF.js → Play-BH-zpYdk.js} +1 -1
  21. package/dist/client/assets/{Plus-G5Gw5kPM.js → Plus-BtdUV_kH.js} +1 -1
  22. package/dist/client/assets/{RefreshCcw01-C5jOy04q.js → RefreshCcw01-CAoB9uWy.js} +1 -1
  23. package/dist/client/assets/{SearchMd-DM0EjhEJ.js → SearchMd-BNBDuE-K.js} +1 -1
  24. package/dist/client/assets/{Settings02-CtCQn3Yf.js → Settings02-BxDgDSaB.js} +1 -1
  25. package/dist/client/assets/{Shield01-DlzHY_dC.js → Shield01-D9VCjdEs.js} +1 -1
  26. package/dist/client/assets/{Star01-39vpRLS0.js → Star01-C55T9Xua.js} +1 -1
  27. package/dist/client/assets/{Stars01-D40cNl8a.js → Stars01-Dd6qdACt.js} +1 -1
  28. package/dist/client/assets/{Stars02-LHx1LC9_.js → Stars02-B4BHhb0w.js} +1 -1
  29. package/dist/client/assets/{Sun-D5VbC5bQ.js → Sun-C1ZnnlCm.js} +1 -1
  30. package/dist/client/assets/{SwitchHorizontal01-Sw4pGPNn.js → SwitchHorizontal01-fpn5Tlqs.js} +1 -1
  31. package/dist/client/assets/{Tool01-WQP4RZxz.js → Tool01-CkAXErK4.js} +1 -1
  32. package/dist/client/assets/{Trash01-cARQt3ei.js → Trash01-BNDy5NA1.js} +1 -1
  33. package/dist/client/assets/{Upload01-Dmm1X5SO.js → Upload01-BO7_Z4bn.js} +1 -1
  34. package/dist/client/assets/{User01-CqHZqKxf.js → User01-DeMZ-XKs.js} +1 -1
  35. package/dist/client/assets/{Users01-Dsn_tDG5.js → Users01-stOb3vXo.js} +1 -1
  36. package/dist/client/assets/{Users03-hkJxAqIG.js → Users03-Jto5sphL.js} +1 -1
  37. package/dist/client/assets/{X-D7vVBDXl.js → X-lJKMgTG7.js} +1 -1
  38. package/dist/client/assets/{XCircle-CGKRZUbS.js → XCircle-HoAITbvP.js} +1 -1
  39. package/dist/client/assets/{XClose-MKIx3xLp.js → XClose-BPQwEKx4.js} +1 -1
  40. package/dist/client/assets/{Zap-jV52NH8a.js → Zap-i9mqV9CQ.js} +1 -1
  41. package/dist/client/assets/{ZapSquare-DVdUXxhF.js → ZapSquare-Cc-mw2AV.js} +1 -1
  42. package/dist/client/assets/{ZoomOut-0Ur-V1Tn.js → ZoomOut-D6zQtuQG.js} +1 -1
  43. package/dist/client/assets/{access-gate-roIhjIJn.js → access-gate-DLKGN_M-.js} +1 -1
  44. package/dist/client/assets/{accordion-C0j3DHtl.js → accordion-EsSKzC-q.js} +1 -1
  45. package/dist/client/assets/{add-section-modal-CRKAmuUu.js → add-section-modal-B2fBeRMl.js} +1 -1
  46. package/dist/client/assets/{agent-capabilities-BWvW99VB.js → agent-capabilities-wznK9BHI.js} +1 -1
  47. package/dist/client/assets/{agent-icon-B_ENO9HH.js → agent-icon-wPujIUBK.js} +1 -1
  48. package/dist/client/assets/{agent-icons-CpkNElG-.js → agent-icons-CwE4Nvhh.js} +1 -1
  49. package/dist/client/assets/{agents-list-CQWA2zjQ.js → agents-list-t3MIIq_M.js} +1 -1
  50. package/dist/client/assets/{ai-providers-BH3PHgWL.js → ai-providers-CYMKa-o-.js} +1 -1
  51. package/dist/client/assets/{alert-kjgZx1ez.js → alert-Y2k801mi.js} +1 -1
  52. package/dist/client/assets/{alert-dialog-BGwOQ-hv.js → alert-dialog-CpmevCyT.js} +1 -1
  53. package/dist/client/assets/app-editor-BGmNaO2t.js +1 -0
  54. package/dist/client/assets/{auth-catchall-DA8u5lih.js → auth-catchall-CUqJLcJ-.js} +1 -1
  55. package/dist/client/assets/{auth-split-layout-to9tM4yy.js → auth-split-layout-BcfB5ab4.js} +1 -1
  56. package/dist/client/assets/{automation-list-row-BNAgjK8x.js → automation-list-row-BuO1c5RQ.js} +1 -1
  57. package/dist/client/assets/{automation-runs-C92-yFsO.js → automation-runs-Ca1xKsFX.js} +1 -1
  58. package/dist/client/assets/{automations-DYeroRPO.js → automations-Dxt-70eP.js} +1 -1
  59. package/dist/client/assets/{avatar-B3Bw52dv.js → avatar-O07fEtT9.js} +1 -1
  60. package/dist/client/assets/{badge-5MzROStc.js → badge-CK4KLPyS.js} +1 -1
  61. package/dist/client/assets/{brand-context-qldfN3Pe.js → brand-context-DB-LeUPj.js} +1 -1
  62. package/dist/client/assets/{buckets-BVaOFRcL.js → buckets-BZ_QPiJA.js} +1 -1
  63. package/dist/client/assets/{calendar-DOA8Nces.js → calendar-Dm6Vzggf.js} +1 -1
  64. package/dist/client/assets/{capability-load-error-DPd39UC9.js → capability-load-error-Ce5R9GAQ.js} +1 -1
  65. package/dist/client/assets/{card-B4WowcKq.js → card-D8DKqFpf.js} +1 -1
  66. package/dist/client/assets/{chat-context-BqvG5V6J.js → chat-context-BdLaNmxp.js} +1 -1
  67. package/dist/client/assets/{checkbox-DHuCa6fF.js → checkbox-8ry6F5Z_.js} +1 -1
  68. package/dist/client/assets/{cli-auth-success-DnDM0bD5.js → cli-auth-success-Cuh-O0sz.js} +1 -1
  69. package/dist/client/assets/{collection-detail-DczB6N_Y.js → collection-detail-A3KJPBg7.js} +1 -1
  70. package/dist/client/assets/{collection-display-button-xjCpr5m2.js → collection-display-button-FeJMcA55.js} +1 -1
  71. package/dist/client/assets/{collection-search-C3AEVd7W.js → collection-search-CqhY9IcC.js} +1 -1
  72. package/dist/client/assets/{collection-table-wrapper-fHqcoUDz.js → collection-table-wrapper-DZaZYuT0.js} +1 -1
  73. package/dist/client/assets/{collection-tabs-azv2LaTo.js → collection-tabs-D_p2N7sX.js} +1 -1
  74. package/dist/client/assets/{collections-B9PQucdo.js → collections-DmMaNw0X.js} +1 -1
  75. package/dist/client/assets/{command-BSLuC415.js → command-BZnSJmqd.js} +1 -1
  76. package/dist/client/assets/{connect-desktop-dialog-DNq0ek1i.js → connect-desktop-dialog-DJbv98pa.js} +1 -1
  77. package/dist/client/assets/{connection-card-DJ5vpD6m.js → connection-card-BKTCOn1-.js} +1 -1
  78. package/dist/client/assets/{connection-detail-C1eDlvQw.js → connection-detail-DGCae3kF.js} +1 -1
  79. package/dist/client/assets/{connection-form-helpers-Ck21v4Z3.js → connection-form-helpers-SItL7ynJ.js} +1 -1
  80. package/dist/client/assets/{connections-CNeRQvwK.js → connections-CiqLuOLh.js} +1 -1
  81. package/dist/client/assets/{decopilot-sse-pool-koFlJuH3.js → decopilot-sse-pool-Dy3Ybf1a.js} +1 -1
  82. package/dist/client/assets/{dialog-qWglm5p2.js → dialog-BM-B6vYl.js} +1 -1
  83. package/dist/client/assets/{domain-settings-_1OAKDWb.js → domain-settings-BOVpQkAB.js} +1 -1
  84. package/dist/client/assets/{drawer-C6RzB17v.js → drawer-JQlRpQyF.js} +1 -1
  85. package/dist/client/assets/{dropdown-menu-Vxh4zyXD.js → dropdown-menu-C19ZNWpd.js} +1 -1
  86. package/dist/client/assets/{dynamic-plugin-layout-tPcjYD_K.js → dynamic-plugin-layout-9Iodhi3I.js} +1 -1
  87. package/dist/client/assets/{empty-state-BKbPqk3T.js → empty-state-Bx-d9K90.js} +1 -1
  88. package/dist/client/assets/{empty-state-vFbdMLGr.js → empty-state-CylrC2-p.js} +1 -1
  89. package/dist/client/assets/{extract-connection-data-yJgJfD7f.js → extract-connection-data-DqXrg6J1.js} +1 -1
  90. package/dist/client/assets/{features-Bhw07HYI.js → features-D-mz8JgM.js} +1 -1
  91. package/dist/client/assets/{file-explorer-BJqHY4-p.js → file-explorer-BOV5IDPx.js} +1 -1
  92. package/dist/client/assets/{file-type-icon-BilQa1o9.js → file-type-icon-DmnLszYq.js} +1 -1
  93. package/dist/client/assets/{files-DSh9h1Hm.js → files-CBc3BDP1.js} +1 -1
  94. package/dist/client/assets/{form-gGZaN2er.js → form-DBjBm7IQ.js} +1 -1
  95. package/dist/client/assets/{general-BxrPlmF2.js → general-2zY3z96B.js} +1 -1
  96. package/dist/client/assets/{generate-id-1zLHnSNC.js → generate-id-BxQ0AjQm.js} +1 -1
  97. package/dist/client/assets/{github-repo-picker-CtaqsXDt.js → github-repo-picker-Bnhy53x0.js} +1 -1
  98. package/dist/client/assets/{header-tab-button-2KdmhnCN.js → header-tab-button-CxqCWXDs.js} +1 -1
  99. package/dist/client/assets/{hover-card-BmPYfkmQ.js → hover-card-Dnzc18eH.js} +1 -1
  100. package/dist/client/assets/{image-field-BAOOv2VL.js → image-field-n6y2RcnV.js} +1 -1
  101. package/dist/client/assets/{index-CXpnZeu8.js → index-39JbR6rj.js} +1 -1
  102. package/dist/client/assets/{index-B8DD41FV.js → index-B8yMuHv9.js} +1 -1
  103. package/dist/client/assets/{index-3lvkMmcU.js → index-BdGmFa2i.js} +4 -4
  104. package/dist/client/assets/{index-qlEv8kim.js → index-BehDPZwF.js} +1 -1
  105. package/dist/client/assets/{index-DpDZUDEm.js → index-CK-5BebV.js} +1 -1
  106. package/dist/client/assets/{index-BsdusiDa.js → index-CM9R_tIp.js} +1 -1
  107. package/dist/client/assets/{index-ChYUSQjJ.js → index-D3avDGSl.js} +3 -3
  108. package/dist/client/assets/{index-BZfWDol4.js → index-DpuX2nh2.js} +1 -1
  109. package/dist/client/assets/{index-DFvrEDgo.js → index-Dv4PwDBs.js} +1 -1
  110. package/dist/client/assets/{index-FaQ0ocaw.js → index-ETAbiU_v.js} +1 -1
  111. package/dist/client/assets/{index-C-Ei6mai.js → index-Eg0pRtTT.js} +1 -1
  112. package/dist/client/assets/{index-27pfCAzj.js → index-NrPbJy0c.js} +1 -1
  113. package/dist/client/assets/{index-Dk3pxVwF.js → index-b_hlBJ5h.js} +1 -1
  114. package/dist/client/assets/{index-qXKJFTio.js → index-ddLepuAa.js} +1 -1
  115. package/dist/client/assets/{index-CCLk37y2.js → index-eC13TT_N.js} +1 -1
  116. package/dist/client/assets/{index-redirect-CXll09VO.js → index-redirect-CmQk8pwt.js} +1 -1
  117. package/dist/client/assets/{infiniteQueryObserver-CwLfraWt.js → infiniteQueryObserver-IkM6No7c.js} +1 -1
  118. package/dist/client/assets/{input-Cm-_5NLx.js → input-B_SdLJQK.js} +1 -1
  119. package/dist/client/assets/{integration-icon-CjuSu3xL.js → integration-icon-CgYiY5Wq.js} +1 -1
  120. package/dist/client/assets/{label-CyHrJvd7.js → label-aUygS1cE.js} +1 -1
  121. package/dist/client/assets/{layout-kTyPnw7s.js → layout-BJehn_qV.js} +1 -1
  122. package/dist/client/assets/{login-5UgWIAg7.js → login-CNQQC5NH.js} +1 -1
  123. package/dist/client/assets/{members-hzfBOAY3.js → members-CUebOViC.js} +1 -1
  124. package/dist/client/assets/{monaco-editor-DpalAqoH.js → monaco-editor-d1joxmu_.js} +1 -1
  125. package/dist/client/assets/{monitoring-stats-row-elDMWfR-.js → monitoring-stats-row-DY3frH3g.js} +1 -1
  126. package/dist/client/assets/{oauth-callback-DFmkESZu.js → oauth-callback-CysCWlpA.js} +1 -1
  127. package/dist/client/assets/{oauth-callback-ai-provider-CkFUU1_z.js → oauth-callback-ai-provider-DKeudg_c.js} +1 -1
  128. package/dist/client/assets/{onboarding-3PzLCg0J.js → onboarding-Bs9__2KZ.js} +1 -1
  129. package/dist/client/assets/{org-install-DnqbGePU.js → org-install-CYT8BI-x.js} +1 -1
  130. package/dist/client/assets/{org-layout-C3XnS-Cd.js → org-layout-BdTrvLYI.js} +1 -1
  131. package/dist/client/assets/{org-plugin-layout-XMmCXebK.js → org-plugin-layout-CY4LfxW8.js} +1 -1
  132. package/dist/client/assets/{page-seo-form-Bd0DSnoH.js → page-seo-form-Df3uSm-C.js} +1 -1
  133. package/dist/client/assets/page-seo-sheet-CsrOaRGa.js +1 -0
  134. package/dist/client/assets/{pair-CrxtZLmo.js → pair-KxJNYeiQ.js} +1 -1
  135. package/dist/client/assets/{plugin-empty-state-DVk1q1TN.js → plugin-empty-state-Djb6F3Xk.js} +1 -1
  136. package/dist/client/assets/{plugin-header-BrF2G38h.js → plugin-header-6WefxSCP.js} +1 -1
  137. package/dist/client/assets/{plugin-layout-CKTbFu5I.js → plugin-layout-DAwCSgrK.js} +1 -1
  138. package/dist/client/assets/{popover-DmAofN68.js → popover-DL8D0-VW.js} +1 -1
  139. package/dist/client/assets/{post-editor-M-6yKdac.js → post-editor-DlG3ppMg.js} +1 -1
  140. package/dist/client/assets/{primitives-DypFIPbl.js → primitives-DwUOg-4i.js} +1 -1
  141. package/dist/client/assets/{profile-4Qps65XF.js → profile-BTXVFmsd.js} +1 -1
  142. package/dist/client/assets/{project-app-view-B86ITaCE.js → project-app-view-D6MO58Q2.js} +1 -1
  143. package/dist/client/assets/record-editor-BHlyVDlK.js +1 -0
  144. package/dist/client/assets/registry-D8nlJLMN.js +2 -0
  145. package/dist/client/assets/{registry-layout-BbCvfAb2.js → registry-layout-xP2RElop.js} +1 -1
  146. package/dist/client/assets/{require-capability-D5WFhc1C.js → require-capability-SwOsWHIR.js} +1 -1
  147. package/dist/client/assets/{required-auth-layout-MFF8-ZJT.js → required-auth-layout-COL8jak8.js} +1 -1
  148. package/dist/client/assets/{reset-password-Cej2r1ig.js → reset-password-B1ULn5vm.js} +1 -1
  149. package/dist/client/assets/{resizable-Dvc6mjD2.js → resizable-0S2u7bsu.js} +1 -1
  150. package/dist/client/assets/{roles-C3KCV148.js → roles-DwXM_yUH.js} +1 -1
  151. package/dist/client/assets/save-referenced-block-BjWrJFGb.js +1 -0
  152. package/dist/client/assets/{save-status-BNra3mAM.js → save-status-Db57rzSJ.js} +1 -1
  153. package/dist/client/assets/{schema-form-B08gOdyg.js → schema-form-B_4HLYio.js} +1 -1
  154. package/dist/client/assets/{scroll-area-BdohAM0t.js → scroll-area-Bx3m3yDU.js} +1 -1
  155. package/dist/client/assets/{search-input-BOsI1GRw.js → search-input-DSZAkjiG.js} +1 -1
  156. package/dist/client/assets/{secrets-DX0AnBxx.js → secrets-4u1EsHJ7.js} +1 -1
  157. package/dist/client/assets/{sections-editor-BRdCJB8j.js → sections-editor-dH4VHA8h.js} +1 -1
  158. package/dist/client/assets/{select-2pE_Mne6.js → select-DiYyNvmX.js} +1 -1
  159. package/dist/client/assets/{select-model-CrWeciHf.js → select-model-nnb41puG.js} +1 -1
  160. package/dist/client/assets/{seo-editor-DGLH1irm.js → seo-editor-Chqrhb0h.js} +1 -1
  161. package/dist/client/assets/{settings-layout-DEjJewKl.js → settings-layout-C7T-oca_.js} +1 -1
  162. package/dist/client/assets/{settings-section-BZqGjpLm.js → settings-section-Cwe7xf9d.js} +1 -1
  163. package/dist/client/assets/{sheet-BhIiqWhI.js → sheet-B9j6H-QD.js} +1 -1
  164. package/dist/client/assets/{shell-controls-Drtt8Eg1.js → shell-controls-BrSbUy-I.js} +1 -1
  165. package/dist/client/assets/{shell-layout-DIvP19WX.js → shell-layout-eWp4Nk5r.js} +1 -1
  166. package/dist/client/assets/{shell-route-loading-C61C46w4.js → shell-route-loading-Bp9B1GvP.js} +1 -1
  167. package/dist/client/assets/{sidebar-ujCPJCBV.js → sidebar-BHpe-htn.js} +1 -1
  168. package/dist/client/assets/{skeleton-DekfpK4t.js → skeleton-BDmWNgO1.js} +1 -1
  169. package/dist/client/assets/{sortable.esm-Cra7DBkd.js → sortable.esm-YvQHAMTR.js} +1 -1
  170. package/dist/client/assets/{spinner-ukxdHUOu.js → spinner-Dr0dOdTp.js} +1 -1
  171. package/dist/client/assets/{sso-BWArPYWD.js → sso-Ob2wjz4E.js} +1 -1
  172. package/dist/client/assets/{store-DSNAhE0j.js → store-BDcUjCOb.js} +1 -1
  173. package/dist/client/assets/store-registry-BiDsaRGN.js +2 -0
  174. package/dist/client/assets/{switch-DgVVL7zp.js → switch-BLWYQLl7.js} +1 -1
  175. package/dist/client/assets/{tab-id-C7RjxJTr.js → tab-id-DvPfRgA6.js} +1 -1
  176. package/dist/client/assets/{table-C2KXmc6v.js → table-CnJ9o1EX.js} +1 -1
  177. package/dist/client/assets/{tabs-2u_8k4RO.js → tabs-B2Lp9_Rb.js} +1 -1
  178. package/dist/client/assets/{task-status-CRWfjMb2.js → task-status-BOtiOo19.js} +1 -1
  179. package/dist/client/assets/{textarea-C_bdHrQP.js → textarea-DH43ASwp.js} +1 -1
  180. package/dist/client/assets/{toggle-group-C4fnmDnN.js → toggle-group-BWRV5ufK.js} +1 -1
  181. package/dist/client/assets/{toolbar-C8PVd7Ds.js → toolbar-CTl3d0UA.js} +1 -1
  182. package/dist/client/assets/{tools-list-Cr63qS_c.js → tools-list-DcTdEMeO.js} +1 -1
  183. package/dist/client/assets/{tooltip-ByLiX5Mq.js → tooltip-CLYxliPH.js} +1 -1
  184. package/dist/client/assets/{types-Durgfewm.js → types-IfUTSINC.js} +1 -1
  185. package/dist/client/assets/{use-ai-providers-DsKRr79k.js → use-ai-providers-gSn6Y0dv.js} +1 -1
  186. package/dist/client/assets/{use-automations-Dr8lwymn.js → use-automations-xuRn6Qvs.js} +1 -1
  187. package/dist/client/assets/{use-capability-xJktXQ3I.js → use-capability-CVm9Y_d_.js} +1 -1
  188. package/dist/client/assets/{use-collections-DXI321_l.js → use-collections-C9JiLCv0.js} +1 -1
  189. package/dist/client/assets/{use-connection-DDWrr0D8.js → use-connection-OZtQLVj4.js} +1 -1
  190. package/dist/client/assets/{use-copy-B87517Y1.js → use-copy-C-O6xHWZ.js} +1 -1
  191. package/dist/client/assets/{use-create-virtual-mcp-CVaGBSXp.js → use-create-virtual-mcp-CbPrcMEl.js} +1 -1
  192. package/dist/client/assets/{use-debounced-autosave-X1JA0Sjb.js → use-debounced-autosave-CeLjrHSX.js} +1 -1
  193. package/dist/client/assets/{use-delete-connection-BYg0Yl1J.js → use-delete-connection-Bz6O91w6.js} +1 -1
  194. package/dist/client/assets/{use-file-configs-acebBZy-.js → use-file-configs-D_jhf5KI.js} +1 -1
  195. package/dist/client/assets/{use-infinite-scroll-vpAXlalO.js → use-infinite-scroll-1ITAnm1X.js} +1 -1
  196. package/dist/client/assets/{use-list-state-DMUJOpFJ.js → use-list-state-C-DYJNN_.js} +1 -1
  197. package/dist/client/assets/{use-mcp-client-B-JRPXnN.js → use-mcp-client-BAkI6-zz.js} +1 -1
  198. package/dist/client/assets/{use-mcp-prompts-OczkXrmo.js → use-mcp-prompts-CKe6n-6G.js} +1 -1
  199. package/dist/client/assets/{use-mcp-tools-WWdORF6E.js → use-mcp-tools-CbSeRsSR.js} +1 -1
  200. package/dist/client/assets/{use-members-DEAGj5M0.js → use-members-Biy7ZRor.js} +1 -1
  201. package/dist/client/assets/{use-navigate-to-agent-j8txYt39.js → use-navigate-to-agent-MrfRJ6_R.js} +1 -1
  202. package/dist/client/assets/{use-org-auth-client-ziR2xP7Z.js → use-org-auth-client-CW071Ufg.js} +1 -1
  203. package/dist/client/assets/{use-org-sso-DMSjHU5t.js → use-org-sso-CQgcU4GU.js} +1 -1
  204. package/dist/client/assets/{use-organization-roles-DvPau1Zi.js → use-organization-roles-luHSv1Vx.js} +1 -1
  205. package/dist/client/assets/{use-organization-settings-Cncb08kX.js → use-organization-settings-C6tKL2ZP.js} +1 -1
  206. package/dist/client/assets/{use-registry-connections-bHwMGkYH.js → use-registry-connections-utBaLUfZ.js} +1 -1
  207. package/dist/client/assets/{use-secrets-6j_GId-n.js → use-secrets-BnqZjmY-.js} +1 -1
  208. package/dist/client/assets/{use-status-sounds-jRgdHM6o.js → use-status-sounds-D7Yisfh_.js} +1 -1
  209. package/dist/client/assets/{use-view-mode-oY0gTmDF.js → use-view-mode-BHTiUjoP.js} +1 -1
  210. package/dist/client/assets/{use-virtual-mcp-fBHJQJIQ.js → use-virtual-mcp-C5zuL_E7.js} +1 -1
  211. package/dist/client/assets/useInfiniteQuery-C705CZaG.js +1 -0
  212. package/dist/client/assets/{useRouterState-CQ_dlcxM.js → useRouterState-DH4alGao.js} +1 -1
  213. package/dist/client/assets/useSuspenseInfiniteQuery-t8UmhcjT.js +1 -0
  214. package/dist/client/assets/{user-5EdNnZWa.js → user-DstdXklV.js} +1 -1
  215. package/dist/client/assets/{view-mode-toggle-Df0p0wvc.js → view-mode-toggle-CAEobvEk.js} +1 -1
  216. package/dist/client/assets/{workflow-D175Z8ad.js → workflow-EFYMjEGY.js} +1 -1
  217. package/dist/client/assets/workflow-detail-CFYdEPJc.js +1 -0
  218. package/dist/client/index.html +1 -1
  219. package/dist/server/cli.js +1 -1
  220. package/package.json +4 -1
  221. package/dist/client/assets/app-editor-n5gUpE-7.js +0 -1
  222. package/dist/client/assets/page-seo-sheet-BY0ZczJ9.js +0 -1
  223. package/dist/client/assets/record-editor-DOYxf9X2.js +0 -1
  224. package/dist/client/assets/registry-DEATlg_a.js +0 -2
  225. package/dist/client/assets/save-referenced-block-DfCtlYLI.js +0 -1
  226. package/dist/client/assets/store-registry-BJU2S8Bb.js +0 -2
  227. package/dist/client/assets/useInfiniteQuery-toVymGgv.js +0 -1
  228. package/dist/client/assets/useSuspenseInfiniteQuery-BbMvRYcb.js +0 -1
  229. package/dist/client/assets/workflow-detail-zWNrlggW.js +0 -1
@@ -1,4 +1,4 @@
1
- import{r as w,dE as $l,bF as ju,j as O,aU as Hu,b5 as St,dF as Wu,a7 as it,a8 as Qe,bk as On,bh as Uu,bi as qu,bx as Mt,dy as Fl,ag as _l,bg as Ku,ad as ut,e as Vl,c as jl}from"./index-ChYUSQjJ.js";import{e as Ju}from"./select-2pE_Mne6.js";function Q(n){this.content=n}Q.prototype={constructor:Q,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,s=r.find(n),i=r.content.slice();return s==-1?i.push(t||n,e):(i[s+1]=e,t&&(i[s]=t)),new Q(i)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new Q(t)},addToStart:function(n,e){return new Q([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new Q(t)},addBefore:function(n,e,t){var r=this.remove(e),s=r.content.slice(),i=r.find(n);return s.splice(i==-1?s.length:i,0,e,t),new Q(s)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=Q.from(n),n.size?new Q(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=Q.from(n),n.size?new Q(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=Q.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}};Q.from=function(n){if(n instanceof Q)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new Q(e)};function Hl(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let s=n.child(r),i=e.child(r);if(s==i){t+=s.nodeSize;continue}if(!s.sameMarkup(i))return t;if(s.isText&&s.text!=i.text){for(let o=0;s.text[o]==i.text[o];o++)t++;return t}if(s.content.size||i.content.size){let o=Hl(s.content,i.content,t+1);if(o!=null)return o}t+=s.nodeSize}}function Wl(n,e,t,r){for(let s=n.childCount,i=e.childCount;;){if(s==0||i==0)return s==i?null:{a:t,b:r};let o=n.child(--s),l=e.child(--i),a=o.nodeSize;if(o==l){t-=a,r-=a;continue}if(!o.sameMarkup(l))return{a:t,b:r};if(o.isText&&o.text!=l.text){let c=0,u=Math.min(o.text.length,l.text.length);for(;c<u&&o.text[o.text.length-c-1]==l.text[l.text.length-c-1];)c++,t--,r--;return{a:t,b:r}}if(o.content.size||l.content.size){let c=Wl(o.content,l.content,t-1,r-1);if(c)return c}t-=a,r-=a}}class k{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,s=0,i){for(let o=0,l=0;l<t;o++){let a=this.content[o],c=l+a.nodeSize;if(c>e&&r(a,s+l,i||null,o)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,t-u),r,s+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,s){let i="",o=!0;return this.nodesBetween(e,t,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?s?typeof s=="function"?s(l):s:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(o?o=!1:i+=r),i+=c},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,s=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(r)&&(s[s.length-1]=t.withText(t.text+r.text),i=1);i<e.content.length;i++)s.push(e.content[i]);return new k(s,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],s=0;if(t>e)for(let i=0,o=0;o<t;i++){let l=this.content[i],a=o+l.nodeSize;a>e&&((o<e||a>t)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,t-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,t-o-1))),r.push(l),s+=l.nodeSize),o=a}return new k(r,s)}cutByIndex(e,t){return e==t?k.empty:e==0&&t==this.content.length?this:new k(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let s=this.content.slice(),i=this.size+t.nodeSize-r.nodeSize;return s[e]=t,new k(s,i)}addToStart(e){return new k([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new k(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let s=this.content[t];e(s,r,t),r+=s.nodeSize}}findDiffStart(e,t=0){return Hl(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return Wl(this,e,t,r)}findIndex(e){if(e==0)return Ln(0,e);if(e==this.size)return Ln(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,r=0;;t++){let s=this.child(t),i=r+s.nodeSize;if(i>=e)return i==e?Ln(t+1,i):Ln(t,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return k.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new k(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return k.empty;let t,r=0;for(let s=0;s<e.length;s++){let i=e[s];r+=i.nodeSize,s&&i.isText&&e[s-1].sameMarkup(i)?(t||(t=e.slice(0,s)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new k(t||e,r)}static from(e){if(!e)return k.empty;if(e instanceof k)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new k([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}k.empty=new k([],0);const ls={index:0,offset:0};function Ln(n,e){return ls.index=n,ls.offset=e,ls}function Qn(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!Qn(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!Qn(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let z=class Ps{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let s=0;s<e.length;s++){let i=e[s];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,s));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,s)),t.push(this),r=!0),t&&t.push(i)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Qn(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);let s=r.create(t.attrs);return r.checkAttrs(s.attrs),s}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Ps.none;if(e instanceof Ps)return[e];let t=e.slice();return t.sort((r,s)=>r.type.rank-s.type.rank),t}};z.none=[];class Zn extends Error{}class v{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=ql(this.content,e+this.openStart,t);return r&&new v(r,this.openStart,this.openEnd)}removeBetween(e,t){return new v(Ul(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return v.empty;let r=t.openStart||0,s=t.openEnd||0;if(typeof r!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new v(k.fromJSON(e,t.content),r,s)}static maxOpen(e,t=!0){let r=0,s=0;for(let i=e.firstChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.lastChild)s++;return new v(e,r,s)}}v.empty=new v(k.empty,0,0);function Ul(n,e,t){let{index:r,offset:s}=n.findIndex(e),i=n.maybeChild(r),{index:o,offset:l}=n.findIndex(t);if(s==e||i.isText){if(l!=t&&!n.child(o).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=o)throw new RangeError("Removing non-flat range");return n.replaceChild(r,i.copy(Ul(i.content,e-s-1,t-s-1)))}function ql(n,e,t,r){let{index:s,offset:i}=n.findIndex(e),o=n.maybeChild(s);if(i==e||o.isText)return r&&!r.canReplace(s,s,t)?null:n.cut(0,e).append(t).append(n.cut(e));let l=ql(o.content,e-i-1,t,o);return l&&n.replaceChild(s,o.copy(l))}function Gu(n,e,t){if(t.openStart>n.depth)throw new Zn("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new Zn("Inconsistent open depths");return Kl(n,e,t,0)}function Kl(n,e,t,r){let s=n.index(r),i=n.node(r);if(s==e.index(r)&&r<n.depth-t.openStart){let o=Kl(n,e,t,r+1);return i.copy(i.content.replaceChild(s,o))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let o=n.parent,l=o.content;return yt(o,l.cut(0,n.parentOffset).append(t.content).append(l.cut(e.parentOffset)))}else{let{start:o,end:l}=Yu(t,n);return yt(i,Gl(n,o,l,e,r))}else return yt(i,er(n,e,r))}function Jl(n,e){if(!e.type.compatibleContent(n.type))throw new Zn("Cannot join "+e.type.name+" onto "+n.type.name)}function Ls(n,e,t){let r=n.node(t);return Jl(r,e.node(t)),r}function gt(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function an(n,e,t,r){let s=(e||n).node(t),i=0,o=e?e.index(t):s.childCount;n&&(i=n.index(t),n.depth>t?i++:n.textOffset&&(gt(n.nodeAfter,r),i++));for(let l=i;l<o;l++)gt(s.child(l),r);e&&e.depth==t&&e.textOffset&&gt(e.nodeBefore,r)}function yt(n,e){return n.type.checkContent(e),n.copy(e)}function Gl(n,e,t,r,s){let i=n.depth>s&&Ls(n,e,s+1),o=r.depth>s&&Ls(t,r,s+1),l=[];return an(null,n,s,l),i&&o&&e.index(s)==t.index(s)?(Jl(i,o),gt(yt(i,Gl(n,e,t,r,s+1)),l)):(i&&gt(yt(i,er(n,e,s+1)),l),an(e,t,s,l),o&&gt(yt(o,er(t,r,s+1)),l)),an(r,null,s,l),new k(l)}function er(n,e,t){let r=[];if(an(null,n,t,r),n.depth>t){let s=Ls(n,e,t+1);gt(yt(s,er(n,e,t+1)),r)}return an(e,null,t,r),new k(r)}function Yu(n,e){let t=e.depth-n.openStart,s=e.node(t).copy(n.content);for(let i=t-1;i>=0;i--)s=e.node(i).copy(k.from(s));return{start:s.resolveNoCache(n.openStart+t),end:s.resolveNoCache(s.content.size-n.openEnd-t)}}class kn{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],s=e.child(t);return r?e.child(t).cut(r):s}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],s=t==0?0:this.path[t*3-1]+1;for(let i=0;i<e;i++)s+=r.child(i).nodeSize;return s}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return z.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),s=e.maybeChild(t);if(!r){let l=r;r=s,s=l}let i=r.marks;for(var o=0;o<i.length;o++)i[o].type.spec.inclusive===!1&&(!s||!i[o].isInSet(s.marks))&&(i=i[o--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,s=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!s||!r[i].isInSet(s.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new tr(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],s=0,i=t;for(let o=e;;){let{index:l,offset:a}=o.content.findIndex(i),c=i-a;if(r.push(o,l,s+a),!c||(o=o.child(l),o.isText))break;i=c-1,s+=a+1}return new kn(t,r,i)}static resolveCached(e,t){let r=so.get(e);if(r)for(let i=0;i<r.elts.length;i++){let o=r.elts[i];if(o.pos==t)return o}else so.set(e,r=new Xu);let s=r.elts[r.i]=kn.resolve(e,t);return r.i=(r.i+1)%Qu,s}}class Xu{constructor(){this.elts=[],this.i=0}}const Qu=12,so=new WeakMap;class tr{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Zu=Object.create(null);class Ee{constructor(e,t,r,s=z.none){this.type=e,this.attrs=t,this.marks=s,this.content=r||k.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,s=0){this.content.nodesBetween(e,t,r,s,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,s){return this.content.textBetween(e,t,r,s)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&Qn(this.attrs,t||e.defaultAttrs||Zu)&&z.sameSet(this.marks,r||z.none)}copy(e=null){return e==this.content?this:new Ee(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Ee(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return v.empty;let s=this.resolve(e),i=this.resolve(t),o=r?0:s.sharedDepth(t),l=s.start(o),c=s.node(o).content.cut(s.pos-l,i.pos-l);return new v(c,s.depth-o,i.depth-o)}replace(e,t,r){return Gu(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:s}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(s==e||t.isText)return t;e-=s+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let s=this.content.child(t-1);return{node:s,index:t-1,offset:r-s.nodeSize}}resolve(e){return kn.resolveCached(this,e)}resolveNoCache(e){return kn.resolve(this,e)}rangeHasMark(e,t,r){let s=!1;return t>e&&this.nodesBetween(e,t,i=>(r.isInSet(i.marks)&&(s=!0),!s)),s}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Yl(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=k.empty,s=0,i=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,s,i),l=o&&o.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=s;a<i;a++)if(!this.type.allowsMarks(r.child(a).marks))return!1;return!0}canReplaceWith(e,t,r,s){if(s&&!this.type.allowsMarks(s))return!1;let i=this.contentMatchAt(e).matchType(r),o=i&&i.matchFragment(this.content,t);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=z.none;for(let t=0;t<this.marks.length;t++){let r=this.marks[t];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!z.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let s=k.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,s,r);return i.type.checkAttrs(i.attrs),i}}Ee.prototype.text=void 0;class nr extends Ee{constructor(e,t,r,s){if(super(e,t,null,s),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Yl(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new nr(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new nr(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Yl(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class wt{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new ed(e,t);if(r.next==null)return wt.empty;let s=Xl(r);r.next&&r.err("Unexpected trailing text");let i=ld(od(s));return ad(i,r),i}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let s=this;for(let i=t;s&&i<r;i++)s=s.matchType(e.child(i).type);return s}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let s=[this];function i(o,l){let a=o.matchFragment(e,r);if(a&&(!t||a.validEnd))return k.from(l.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:u,next:d}=o.next[c];if(!(u.isText||u.hasRequiredAttrs())&&s.indexOf(d)==-1){s.push(d);let f=i(d,l.concat(u));if(f)return f}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let s=r.shift(),i=s.match;if(i.matchType(e)){let o=[];for(let l=s;l.type;l=l.via)o.push(l.type);return o.reverse()}for(let o=0;o<i.next.length;o++){let{type:l,next:a}=i.next[o];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in t)&&(!s.type||a.validEnd)&&(r.push({match:l.contentMatch,type:l,via:s}),t[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let s=0;s<r.next.length;s++)e.indexOf(r.next[s].next)==-1&&t(r.next[s].next)}return t(this),e.map((r,s)=>{let i=s+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)i+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return i}).join(`
1
+ import{r as w,dE as $l,bF as ju,j as O,aU as Hu,b5 as St,dF as Wu,a7 as it,a8 as Qe,bk as On,bh as Uu,bi as qu,bx as Mt,dy as Fl,ag as _l,bg as Ku,ad as ut,e as Vl,c as jl}from"./index-D3avDGSl.js";import{e as Ju}from"./select-DiYyNvmX.js";function Q(n){this.content=n}Q.prototype={constructor:Q,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,s=r.find(n),i=r.content.slice();return s==-1?i.push(t||n,e):(i[s+1]=e,t&&(i[s]=t)),new Q(i)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new Q(t)},addToStart:function(n,e){return new Q([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new Q(t)},addBefore:function(n,e,t){var r=this.remove(e),s=r.content.slice(),i=r.find(n);return s.splice(i==-1?s.length:i,0,e,t),new Q(s)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=Q.from(n),n.size?new Q(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=Q.from(n),n.size?new Q(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=Q.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}};Q.from=function(n){if(n instanceof Q)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new Q(e)};function Hl(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let s=n.child(r),i=e.child(r);if(s==i){t+=s.nodeSize;continue}if(!s.sameMarkup(i))return t;if(s.isText&&s.text!=i.text){for(let o=0;s.text[o]==i.text[o];o++)t++;return t}if(s.content.size||i.content.size){let o=Hl(s.content,i.content,t+1);if(o!=null)return o}t+=s.nodeSize}}function Wl(n,e,t,r){for(let s=n.childCount,i=e.childCount;;){if(s==0||i==0)return s==i?null:{a:t,b:r};let o=n.child(--s),l=e.child(--i),a=o.nodeSize;if(o==l){t-=a,r-=a;continue}if(!o.sameMarkup(l))return{a:t,b:r};if(o.isText&&o.text!=l.text){let c=0,u=Math.min(o.text.length,l.text.length);for(;c<u&&o.text[o.text.length-c-1]==l.text[l.text.length-c-1];)c++,t--,r--;return{a:t,b:r}}if(o.content.size||l.content.size){let c=Wl(o.content,l.content,t-1,r-1);if(c)return c}t-=a,r-=a}}class k{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,s=0,i){for(let o=0,l=0;l<t;o++){let a=this.content[o],c=l+a.nodeSize;if(c>e&&r(a,s+l,i||null,o)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,t-u),r,s+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,s){let i="",o=!0;return this.nodesBetween(e,t,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?s?typeof s=="function"?s(l):s:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(o?o=!1:i+=r),i+=c},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,s=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(r)&&(s[s.length-1]=t.withText(t.text+r.text),i=1);i<e.content.length;i++)s.push(e.content[i]);return new k(s,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],s=0;if(t>e)for(let i=0,o=0;o<t;i++){let l=this.content[i],a=o+l.nodeSize;a>e&&((o<e||a>t)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,t-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,t-o-1))),r.push(l),s+=l.nodeSize),o=a}return new k(r,s)}cutByIndex(e,t){return e==t?k.empty:e==0&&t==this.content.length?this:new k(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let s=this.content.slice(),i=this.size+t.nodeSize-r.nodeSize;return s[e]=t,new k(s,i)}addToStart(e){return new k([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new k(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let s=this.content[t];e(s,r,t),r+=s.nodeSize}}findDiffStart(e,t=0){return Hl(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return Wl(this,e,t,r)}findIndex(e){if(e==0)return Ln(0,e);if(e==this.size)return Ln(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,r=0;;t++){let s=this.child(t),i=r+s.nodeSize;if(i>=e)return i==e?Ln(t+1,i):Ln(t,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return k.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new k(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return k.empty;let t,r=0;for(let s=0;s<e.length;s++){let i=e[s];r+=i.nodeSize,s&&i.isText&&e[s-1].sameMarkup(i)?(t||(t=e.slice(0,s)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new k(t||e,r)}static from(e){if(!e)return k.empty;if(e instanceof k)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new k([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}k.empty=new k([],0);const ls={index:0,offset:0};function Ln(n,e){return ls.index=n,ls.offset=e,ls}function Qn(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!Qn(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!Qn(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let z=class Ps{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let s=0;s<e.length;s++){let i=e[s];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,s));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,s)),t.push(this),r=!0),t&&t.push(i)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Qn(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);let s=r.create(t.attrs);return r.checkAttrs(s.attrs),s}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Ps.none;if(e instanceof Ps)return[e];let t=e.slice();return t.sort((r,s)=>r.type.rank-s.type.rank),t}};z.none=[];class Zn extends Error{}class v{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=ql(this.content,e+this.openStart,t);return r&&new v(r,this.openStart,this.openEnd)}removeBetween(e,t){return new v(Ul(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return v.empty;let r=t.openStart||0,s=t.openEnd||0;if(typeof r!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new v(k.fromJSON(e,t.content),r,s)}static maxOpen(e,t=!0){let r=0,s=0;for(let i=e.firstChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.lastChild)s++;return new v(e,r,s)}}v.empty=new v(k.empty,0,0);function Ul(n,e,t){let{index:r,offset:s}=n.findIndex(e),i=n.maybeChild(r),{index:o,offset:l}=n.findIndex(t);if(s==e||i.isText){if(l!=t&&!n.child(o).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=o)throw new RangeError("Removing non-flat range");return n.replaceChild(r,i.copy(Ul(i.content,e-s-1,t-s-1)))}function ql(n,e,t,r){let{index:s,offset:i}=n.findIndex(e),o=n.maybeChild(s);if(i==e||o.isText)return r&&!r.canReplace(s,s,t)?null:n.cut(0,e).append(t).append(n.cut(e));let l=ql(o.content,e-i-1,t,o);return l&&n.replaceChild(s,o.copy(l))}function Gu(n,e,t){if(t.openStart>n.depth)throw new Zn("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new Zn("Inconsistent open depths");return Kl(n,e,t,0)}function Kl(n,e,t,r){let s=n.index(r),i=n.node(r);if(s==e.index(r)&&r<n.depth-t.openStart){let o=Kl(n,e,t,r+1);return i.copy(i.content.replaceChild(s,o))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let o=n.parent,l=o.content;return yt(o,l.cut(0,n.parentOffset).append(t.content).append(l.cut(e.parentOffset)))}else{let{start:o,end:l}=Yu(t,n);return yt(i,Gl(n,o,l,e,r))}else return yt(i,er(n,e,r))}function Jl(n,e){if(!e.type.compatibleContent(n.type))throw new Zn("Cannot join "+e.type.name+" onto "+n.type.name)}function Ls(n,e,t){let r=n.node(t);return Jl(r,e.node(t)),r}function gt(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function an(n,e,t,r){let s=(e||n).node(t),i=0,o=e?e.index(t):s.childCount;n&&(i=n.index(t),n.depth>t?i++:n.textOffset&&(gt(n.nodeAfter,r),i++));for(let l=i;l<o;l++)gt(s.child(l),r);e&&e.depth==t&&e.textOffset&&gt(e.nodeBefore,r)}function yt(n,e){return n.type.checkContent(e),n.copy(e)}function Gl(n,e,t,r,s){let i=n.depth>s&&Ls(n,e,s+1),o=r.depth>s&&Ls(t,r,s+1),l=[];return an(null,n,s,l),i&&o&&e.index(s)==t.index(s)?(Jl(i,o),gt(yt(i,Gl(n,e,t,r,s+1)),l)):(i&&gt(yt(i,er(n,e,s+1)),l),an(e,t,s,l),o&&gt(yt(o,er(t,r,s+1)),l)),an(r,null,s,l),new k(l)}function er(n,e,t){let r=[];if(an(null,n,t,r),n.depth>t){let s=Ls(n,e,t+1);gt(yt(s,er(n,e,t+1)),r)}return an(e,null,t,r),new k(r)}function Yu(n,e){let t=e.depth-n.openStart,s=e.node(t).copy(n.content);for(let i=t-1;i>=0;i--)s=e.node(i).copy(k.from(s));return{start:s.resolveNoCache(n.openStart+t),end:s.resolveNoCache(s.content.size-n.openEnd-t)}}class kn{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],s=e.child(t);return r?e.child(t).cut(r):s}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],s=t==0?0:this.path[t*3-1]+1;for(let i=0;i<e;i++)s+=r.child(i).nodeSize;return s}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return z.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),s=e.maybeChild(t);if(!r){let l=r;r=s,s=l}let i=r.marks;for(var o=0;o<i.length;o++)i[o].type.spec.inclusive===!1&&(!s||!i[o].isInSet(s.marks))&&(i=i[o--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,s=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!s||!r[i].isInSet(s.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new tr(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],s=0,i=t;for(let o=e;;){let{index:l,offset:a}=o.content.findIndex(i),c=i-a;if(r.push(o,l,s+a),!c||(o=o.child(l),o.isText))break;i=c-1,s+=a+1}return new kn(t,r,i)}static resolveCached(e,t){let r=so.get(e);if(r)for(let i=0;i<r.elts.length;i++){let o=r.elts[i];if(o.pos==t)return o}else so.set(e,r=new Xu);let s=r.elts[r.i]=kn.resolve(e,t);return r.i=(r.i+1)%Qu,s}}class Xu{constructor(){this.elts=[],this.i=0}}const Qu=12,so=new WeakMap;class tr{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Zu=Object.create(null);class Ee{constructor(e,t,r,s=z.none){this.type=e,this.attrs=t,this.marks=s,this.content=r||k.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,s=0){this.content.nodesBetween(e,t,r,s,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,s){return this.content.textBetween(e,t,r,s)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&Qn(this.attrs,t||e.defaultAttrs||Zu)&&z.sameSet(this.marks,r||z.none)}copy(e=null){return e==this.content?this:new Ee(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Ee(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return v.empty;let s=this.resolve(e),i=this.resolve(t),o=r?0:s.sharedDepth(t),l=s.start(o),c=s.node(o).content.cut(s.pos-l,i.pos-l);return new v(c,s.depth-o,i.depth-o)}replace(e,t,r){return Gu(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:s}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(s==e||t.isText)return t;e-=s+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let s=this.content.child(t-1);return{node:s,index:t-1,offset:r-s.nodeSize}}resolve(e){return kn.resolveCached(this,e)}resolveNoCache(e){return kn.resolve(this,e)}rangeHasMark(e,t,r){let s=!1;return t>e&&this.nodesBetween(e,t,i=>(r.isInSet(i.marks)&&(s=!0),!s)),s}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Yl(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=k.empty,s=0,i=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,s,i),l=o&&o.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=s;a<i;a++)if(!this.type.allowsMarks(r.child(a).marks))return!1;return!0}canReplaceWith(e,t,r,s){if(s&&!this.type.allowsMarks(s))return!1;let i=this.contentMatchAt(e).matchType(r),o=i&&i.matchFragment(this.content,t);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=z.none;for(let t=0;t<this.marks.length;t++){let r=this.marks[t];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!z.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let s=k.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,s,r);return i.type.checkAttrs(i.attrs),i}}Ee.prototype.text=void 0;class nr extends Ee{constructor(e,t,r,s){if(super(e,t,null,s),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Yl(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new nr(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new nr(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Yl(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class wt{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new ed(e,t);if(r.next==null)return wt.empty;let s=Xl(r);r.next&&r.err("Unexpected trailing text");let i=ld(od(s));return ad(i,r),i}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let s=this;for(let i=t;s&&i<r;i++)s=s.matchType(e.child(i).type);return s}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let s=[this];function i(o,l){let a=o.matchFragment(e,r);if(a&&(!t||a.validEnd))return k.from(l.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:u,next:d}=o.next[c];if(!(u.isText||u.hasRequiredAttrs())&&s.indexOf(d)==-1){s.push(d);let f=i(d,l.concat(u));if(f)return f}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let s=r.shift(),i=s.match;if(i.matchType(e)){let o=[];for(let l=s;l.type;l=l.via)o.push(l.type);return o.reverse()}for(let o=0;o<i.next.length;o++){let{type:l,next:a}=i.next[o];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in t)&&(!s.type||a.validEnd)&&(r.push({match:l.contentMatch,type:l,via:s}),t[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let s=0;s<r.next.length;s++)e.indexOf(r.next[s].next)==-1&&t(r.next[s].next)}return t(this),e.map((r,s)=>{let i=s+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)i+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return i}).join(`
2
2
  `)}}wt.empty=new wt(!0);class ed{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Xl(n){let e=[];do e.push(td(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function td(n){let e=[];do e.push(nd(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function nd(n){let e=id(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=rd(n,e);else break;return e}function io(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function rd(n,e){let t=io(n),r=t;return n.eat(",")&&(n.next!="}"?r=io(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function sd(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let s=[];for(let i in t){let o=t[i];o.isInGroup(e)&&s.push(o)}return s.length==0&&n.err("No node type or group '"+e+"' found"),s}function id(n){if(n.eat("(")){let e=Xl(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=sd(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function od(n){let e=[[]];return s(i(n,0),t()),e;function t(){return e.push([])-1}function r(o,l,a){let c={term:a,to:l};return e[o].push(c),c}function s(o,l){o.forEach(a=>a.to=l)}function i(o,l){if(o.type=="choice")return o.exprs.reduce((a,c)=>a.concat(i(c,l)),[]);if(o.type=="seq")for(let a=0;;a++){let c=i(o.exprs[a],l);if(a==o.exprs.length-1)return c;s(c,l=t())}else if(o.type=="star"){let a=t();return r(l,a),s(i(o.expr,a),a),[r(a)]}else if(o.type=="plus"){let a=t();return s(i(o.expr,l),a),s(i(o.expr,a),a),[r(a)]}else{if(o.type=="opt")return[r(l)].concat(i(o.expr,l));if(o.type=="range"){let a=l;for(let c=0;c<o.min;c++){let u=t();s(i(o.expr,a),u),a=u}if(o.max==-1)s(i(o.expr,a),a);else for(let c=o.min;c<o.max;c++){let u=t();r(a,u),s(i(o.expr,a),u),a=u}return[r(a)]}else{if(o.type=="name")return[r(l,void 0,o.value)];throw new Error("Unknown expr type")}}}}function Ql(n,e){return e-n}function oo(n,e){let t=[];return r(e),t.sort(Ql);function r(s){let i=n[s];if(i.length==1&&!i[0].term)return r(i[0].to);t.push(s);for(let o=0;o<i.length;o++){let{term:l,to:a}=i[o];!l&&t.indexOf(a)==-1&&r(a)}}}function ld(n){let e=Object.create(null);return t(oo(n,0));function t(r){let s=[];r.forEach(o=>{n[o].forEach(({term:l,to:a})=>{if(!l)return;let c;for(let u=0;u<s.length;u++)s[u][0]==l&&(c=s[u][1]);oo(n,a).forEach(u=>{c||s.push([l,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let i=e[r.join(",")]=new wt(r.indexOf(n.length-1)>-1);for(let o=0;o<s.length;o++){let l=s[o][1].sort(Ql);i.next.push({type:s[o][0],next:e[l.join(",")]||t(l)})}return i}}function ad(n,e){for(let t=0,r=[n];t<r.length;t++){let s=r[t],i=!s.validEnd,o=[];for(let l=0;l<s.next.length;l++){let{type:a,next:c}=s.next[l];o.push(a.name),i&&!(a.isText||a.hasRequiredAttrs())&&(i=!1),r.indexOf(c)==-1&&r.push(c)}i&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Zl(n){let e=Object.create(null);for(let t in n){let r=n[t];if(!r.hasDefault)return null;e[t]=r.default}return e}function ea(n,e){let t=Object.create(null);for(let r in n){let s=e&&e[r];if(s===void 0){let i=n[r];if(i.hasDefault)s=i.default;else throw new RangeError("No value supplied for attribute "+r)}t[r]=s}return t}function ta(n,e,t,r){for(let s in e)if(!(s in n))throw new RangeError(`Unsupported attribute ${s} for ${t} of type ${s}`);for(let s in n){let i=n[s];i.validate&&i.validate(e[s])}}function na(n,e){let t=Object.create(null);if(e)for(let r in e)t[r]=new ud(n,r,e[r]);return t}let lo=class ra{constructor(e,t,r){this.name=e,this.schema=t,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=na(e,r.attrs),this.defaultAttrs=Zl(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==wt.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:ea(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Ee(this,this.computeAttrs(e),k.from(t),z.setFrom(r))}createChecked(e=null,t,r){return t=k.from(t),this.checkContent(t),new Ee(this,this.computeAttrs(e),t,z.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=k.from(t),t.size){let o=this.contentMatch.fillBefore(t);if(!o)return null;t=o.append(t)}let s=this.contentMatch.matchFragment(t),i=s&&s.fillBefore(k.empty,!0);return i?new Ee(this,e,t.append(i),z.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){ta(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?t&&t.push(e[r]):t||(t=e.slice(0,r));return t?t.length?t:z.none:e}static compile(e,t){let r=Object.create(null);e.forEach((i,o)=>r[i]=new ra(i,t,o));let s=t.spec.topNode||"doc";if(!r[s])throw new RangeError("Schema is missing its top node type ('"+s+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function cd(n,e,t){let r=t.split("|");return s=>{let i=s===null?"null":typeof s;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${n}, got ${i}`)}}class ud{constructor(e,t,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?cd(e,t,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class jr{constructor(e,t,r,s){this.name=e,this.rank=t,this.schema=r,this.spec=s,this.attrs=na(e,s.attrs),this.excluded=null;let i=Zl(this.attrs);this.instance=i?new z(this,i):null}create(e=null){return!e&&this.instance?this.instance:new z(this,ea(this.attrs,e))}static compile(e,t){let r=Object.create(null),s=0;return e.forEach((i,o)=>r[i]=new jr(i,s++,t,o)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){ta(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class sa{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let s in e)t[s]=e[s];t.nodes=Q.from(e.nodes),t.marks=Q.from(e.marks||{}),this.nodes=lo.compile(this.spec.nodes,this),this.marks=jr.compile(this.spec.marks,this);let r=Object.create(null);for(let s in this.nodes){if(s in this.marks)throw new RangeError(s+" can not be both a node and a mark");let i=this.nodes[s],o=i.spec.content||"",l=i.spec.marks;if(i.contentMatch=r[o]||(r[o]=wt.parse(o,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=l=="_"?null:l?ao(this,l.split(" ")):l==""||!i.inlineContent?[]:null}for(let s in this.marks){let i=this.marks[s],o=i.spec.excludes;i.excluded=o==null?[i]:o==""?[]:ao(this,o.split(" "))}this.nodeFromJSON=s=>Ee.fromJSON(this,s),this.markFromJSON=s=>z.fromJSON(this,s),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,r,s){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof lo){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,r,s)}text(e,t){let r=this.nodes.text;return new nr(r,r.defaultAttrs,e,z.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function ao(n,e){let t=[];for(let r=0;r<e.length;r++){let s=e[r],i=n.marks[s],o=i;if(i)t.push(i);else for(let l in n.marks){let a=n.marks[l];(s=="_"||a.spec.group&&a.spec.group.split(" ").indexOf(s)>-1)&&t.push(o=a)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}function dd(n){return n.tag!=null}function fd(n){return n.style!=null}class Ze{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let r=this.matchedStyles=[];t.forEach(s=>{if(dd(s))this.tags.push(s);else if(fd(s)){let i=/[^=]*/.exec(s.style)[0];r.indexOf(i)<0&&r.push(i),this.styles.push(s)}}),this.normalizeLists=!this.tags.some(s=>{if(!/^(ul|ol)\b/.test(s.tag)||!s.node)return!1;let i=e.nodes[s.node];return i.contentMatch.matchType(i)})}parse(e,t={}){let r=new uo(this,t,!1);return r.addAll(e,z.none,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new uo(this,t,!0);return r.addAll(e,z.none,t.from,t.to),v.maxOpen(r.finish())}matchTag(e,t,r){for(let s=r?this.tags.indexOf(r)+1:0;s<this.tags.length;s++){let i=this.tags[s];if(md(e,i.tag)&&(i.namespace===void 0||e.namespaceURI==i.namespace)&&(!i.context||t.matchesContext(i.context))){if(i.getAttrs){let o=i.getAttrs(e);if(o===!1)continue;i.attrs=o||void 0}return i}}}matchStyle(e,t,r,s){for(let i=s?this.styles.indexOf(s)+1:0;i<this.styles.length;i++){let o=this.styles[i],l=o.style;if(!(l.indexOf(e)!=0||o.context&&!r.matchesContext(o.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=t))){if(o.getAttrs){let a=o.getAttrs(t);if(a===!1)continue;o.attrs=a||void 0}return o}}}static schemaRules(e){let t=[];function r(s){let i=s.priority==null?50:s.priority,o=0;for(;o<t.length;o++){let l=t[o];if((l.priority==null?50:l.priority)<i)break}t.splice(o,0,s)}for(let s in e.marks){let i=e.marks[s].spec.parseDOM;i&&i.forEach(o=>{r(o=fo(o)),o.mark||o.ignore||o.clearMark||(o.mark=s)})}for(let s in e.nodes){let i=e.nodes[s].spec.parseDOM;i&&i.forEach(o=>{r(o=fo(o)),o.node||o.ignore||o.mark||(o.node=s)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Ze(e,Ze.schemaRules(e)))}}const ia={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},hd={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},oa={ol:!0,ul:!0},xn=1,Bs=2,cn=4;function co(n,e,t){return e!=null?(e?xn:0)|(e==="full"?Bs:0):n&&n.whitespace=="pre"?xn|Bs:t&~cn}class Bn{constructor(e,t,r,s,i,o){this.type=e,this.attrs=t,this.marks=r,this.solid=s,this.options=o,this.content=[],this.activeMarks=z.none,this.match=i||(o&cn?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(k.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let r=this.type.contentMatch,s;return(s=r.findWrapping(e.type))?(this.match=r,s):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&xn)){let r=this.content[this.content.length-1],s;if(r&&r.isText&&(s=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==s[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-s[0].length))}}let t=k.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(k.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!ia.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class uo{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let s=t.topNode,i,o=co(null,t.preserveWhitespace,0)|(r?cn:0);s?i=new Bn(s.type,s.attrs,z.none,!0,t.topMatch||s.type.contentMatch,o):r?i=new Bn(null,null,z.none,!0,null,o):i=new Bn(e.schema.topNodeType,null,z.none,!0,null,o),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let r=e.nodeValue,s=this.top,i=s.options&Bs?"full":this.localPreserveWS||(s.options&xn)>0,{schema:o}=this.parser;if(i==="full"||s.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(i)if(i==="full")r=r.replace(/\r\n?/g,`
3
3
  `);else if(o.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(o.linebreakReplacement.create())){let l=r.split(/\r?\n|\r/);for(let a=0;a<l.length;a++)a&&this.insertNode(o.linebreakReplacement.create(),t,!0),l[a]&&this.insertNode(o.text(l[a]),t,!/\S/.test(l[a]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let l=s.content[s.content.length-1],a=e.previousSibling;(!l||a&&a.nodeName=="BR"||l.isText&&/[ \t\r\n\u000c]$/.test(l.text))&&(r=r.slice(1))}r&&this.insertNode(o.text(r),t,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,t,r){let s=this.localPreserveWS,i=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),l;oa.hasOwnProperty(o)&&this.parser.normalizeLists&&pd(e);let a=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,r));e:if(a?a.ignore:hd.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,t);else if(!a||a.skip||a.closeParent){a&&a.closeParent?this.open=Math.max(0,this.open-1):a&&a.skip.nodeType&&(e=a.skip);let c,u=this.needsBlock;if(ia.hasOwnProperty(o))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),c=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let d=a&&a.skip?t:this.readStyles(e,t);d&&this.addAll(e,d),c&&this.sync(i),this.needsBlock=u}else{let c=this.readStyles(e,t);c&&this.addElementByRule(e,a,c,a.consuming===!1?l:void 0)}this.localPreserveWS=s}leafFallback(e,t){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
4
4
  `),t)}ignoreFallback(e,t){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let r=e.style;if(r&&r.length)for(let s=0;s<this.parser.matchedStyles.length;s++){let i=this.parser.matchedStyles[s],o=r.getPropertyValue(i);if(o)for(let l=void 0;;){let a=this.parser.matchStyle(i,o,this,l);if(!a)break;if(a.ignore)return null;if(a.clearMark?t=t.filter(c=>!a.clearMark(c)):t=t.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return t}addElementByRule(e,t,r,s){let i,o;if(t.node)if(o=this.parser.schema.nodes[t.node],o.isLeaf)this.insertNode(o.create(t.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let a=this.enter(o,t.attrs||null,r,t.preserveWhitespace);a&&(i=!0,r=a)}else{let a=this.parser.schema.marks[t.mark];r=r.concat(a.create(t.attrs))}let l=this.top;if(o&&o.isLeaf)this.findInside(e);else if(s)this.addElement(e,r,s);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a,r,!1));else{let a=e;typeof t.contentElement=="string"?a=e.querySelector(t.contentElement):typeof t.contentElement=="function"?a=t.contentElement(e):t.contentElement&&(a=t.contentElement),this.findAround(e,a,!0),this.addAll(a,r),this.findAround(e,a,!1)}i&&this.sync(l)&&this.open--}addAll(e,t,r,s){let i=r||0;for(let o=r?e.childNodes[r]:e.firstChild,l=s==null?null:e.childNodes[s];o!=l;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o,t);this.findAtPoint(e,i)}findPlace(e,t,r){let s,i;for(let o=this.open,l=0;o>=0;o--){let a=this.nodes[o],c=a.findWrapping(e);if(c&&(!s||s.length>c.length+l)&&(s=c,i=a,!c.length))break;if(a.solid){if(r)break;l+=2}}if(!s)return null;this.sync(i);for(let o=0;o<s.length;o++)t=this.enterInner(s[o],null,t,!1);return t}insertNode(e,t,r){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(t=this.enterInner(i,null,t))}let s=this.findPlace(e,t,r);if(s){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let o=z.none;for(let l of s.concat(e.marks))(i.type?i.type.allowsMarkType(l.type):ho(l.type,e.type))&&(o=l.addToSet(o));return i.content.push(e.mark(o)),!0}return!1}enter(e,t,r,s){let i=this.findPlace(e.create(t),r,!1);return i&&(i=this.enterInner(e,t,r,!0,s)),i}enterInner(e,t,r,s=!1,i){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let l=co(e,i,o.options);o.options&cn&&o.content.length==0&&(l|=cn);let a=z.none;return r=r.filter(c=>(o.type?o.type.allowsMarkType(c.type):ho(c.type,e))?(a=c.addToSet(a),!1):!0),this.nodes.push(new Bn(e,t,a,s,null,l)),this.open++,r}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=xn)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let s=r.length-1;s>=0;s--)e+=r[s].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==t&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,r){if(e!=t&&this.find)for(let s=0;s<this.find.length;s++)this.find[s].pos==null&&e.nodeType==1&&e.contains(this.find[s].node)&&t.compareDocumentPosition(this.find[s].node)&(r?2:4)&&(this.find[s].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),r=this.options.context,s=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(s?0:1),o=(l,a)=>{for(;l>=0;l--){let c=t[l];if(c==""){if(l==t.length-1||l==0)continue;for(;a>=i;a--)if(o(l-1,a))return!0;return!1}else{let u=a>0||a==0&&s?this.nodes[a].type:r&&a>=i?r.node(a-i).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;a--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}}function pd(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&oa.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function md(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function fo(n){let e={};for(let t in n)e[t]=n[t];return e}function ho(n,e){let t=e.schema.nodes;for(let r in t){let s=t[r];if(!s.allowsMarkType(n))continue;let i=[],o=l=>{i.push(l);for(let a=0;a<l.edgeCount;a++){let{type:c,next:u}=l.edge(a);if(c==e||i.indexOf(u)<0&&o(u))return!0}};if(o(s.contentMatch))return!0}}class At{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=as(t).createDocumentFragment());let s=r,i=[];return e.forEach(o=>{if(i.length||o.marks.length){let l=0,a=0;for(;l<i.length&&a<o.marks.length;){let c=o.marks[a];if(!this.marks[c.type.name]){a++;continue}if(!c.eq(i[l][0])||c.type.spec.spanning===!1)break;l++,a++}for(;l<i.length;)s=i.pop()[1];for(;a<o.marks.length;){let c=o.marks[a++],u=this.serializeMark(c,o.isInline,t);u&&(i.push([c,s]),s.appendChild(u.dom),s=u.contentDOM||u.dom)}}s.appendChild(this.serializeNodeInner(o,t))}),r}serializeNodeInner(e,t){let{dom:r,contentDOM:s}=Kn(as(t),this.nodes[e.type.name](e),null,e.attrs);if(s){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,s)}return r}serializeNode(e,t={}){let r=this.serializeNodeInner(e,t);for(let s=e.marks.length-1;s>=0;s--){let i=this.serializeMark(e.marks[s],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(e,t,r={}){let s=this.marks[e.type.name];return s&&Kn(as(r),s(e,t),null,e.attrs)}static renderSpec(e,t,r=null,s){return Kn(e,t,r,s)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new At(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=po(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return po(e.marks)}}function po(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function as(n){return n.document||window.document}const mo=new WeakMap;function gd(n){let e=mo.get(n);return e===void 0&&mo.set(n,e=yd(n)),e}function yd(n){let e=null;function t(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let s=0;s<r.length;s++)t(r[s]);else for(let s in r)t(r[s])}return t(n),e}function Kn(n,e,t,r){if(typeof e=="string")return{dom:n.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let s=e[0],i;if(typeof s!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(i=gd(r))&&i.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=s.indexOf(" ");o>0&&(t=s.slice(0,o),s=s.slice(o+1));let l,a=t?n.createElementNS(t,s):n.createElement(s),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let d in c)if(c[d]!=null){let f=d.indexOf(" ");f>0?a.setAttributeNS(d.slice(0,f),d.slice(f+1),c[d]):d=="style"&&a.style?a.style.cssText=c[d]:a.setAttribute(d,c[d])}}for(let d=u;d<e.length;d++){let f=e[d];if(f===0){if(d<e.length-1||d>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:h,contentDOM:p}=Kn(n,f,t,r);if(a.appendChild(h),p){if(l)throw new RangeError("Multiple content holes");l=p}}}return{dom:a,contentDOM:l}}const la=65535,aa=Math.pow(2,16);function bd(n,e){return n+e*aa}function go(n){return n&la}function kd(n){return(n-(n&la))/aa}const ca=1,ua=2,Jn=4,da=8;class zs{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&da)>0}get deletedBefore(){return(this.delInfo&(ca|Jn))>0}get deletedAfter(){return(this.delInfo&(ua|Jn))>0}get deletedAcross(){return(this.delInfo&Jn)>0}}class fe{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&fe.empty)return fe.empty}recover(e){let t=0,r=go(e);if(!this.inverted)for(let s=0;s<r;s++)t+=this.ranges[s*3+2]-this.ranges[s*3+1];return this.ranges[r*3]+t+kd(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let s=0,i=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?s:0);if(a>e)break;let c=this.ranges[l+i],u=this.ranges[l+o],d=a+c;if(e<=d){let f=c?e==a?-1:e==d?1:t:t,h=a+s+(f<0?0:u);if(r)return h;let p=e==(t<0?a:d)?null:bd(l/3,e-a),m=e==a?ua:e==d?ca:Jn;return(t<0?e!=a:e!=d)&&(m|=da),new zs(h,m,p)}s+=u-c}return r?e+s:new zs(e+s,0,null)}touches(e,t){let r=0,s=go(t),i=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?r:0);if(a>e)break;let c=this.ranges[l+i],u=a+c;if(e<=u&&l==s*3)return!0;r+=this.ranges[l+o]-c}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let s=0,i=0;s<this.ranges.length;s+=3){let o=this.ranges[s],l=o-(this.inverted?i:0),a=o+(this.inverted?0:i),c=this.ranges[s+t],u=this.ranges[s+r];e(l,l+c,a,a+u),i+=u-c}}invert(){return new fe(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?fe.empty:new fe(e<0?[0,-e,0]:[0,0,e])}}fe.empty=new fe([]);class Sn{constructor(e,t,r=0,s=e?e.length:0){this.mirror=t,this.from=r,this.to=s,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new Sn(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,r=this._maps.length;t<e._maps.length;t++){let s=e.getMirror(t);this.appendMap(e._maps[t],s!=null&&s<t?r+s:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,r=this._maps.length+e._maps.length;t>=0;t--){let s=e.getMirror(t);this.appendMap(e._maps[t].invert(),s!=null&&s>t?r-s-1:void 0)}}invert(){let e=new Sn;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let s=0;for(let i=this.from;i<this.to;i++){let o=this._maps[i],l=o.mapResult(e,t);if(l.recover!=null){let a=this.getMirror(i);if(a!=null&&a>i&&a<this.to){i=a,e=this._maps[a].recover(l.recover);continue}}s|=l.delInfo,e=l.pos}return r?e:new zs(e,s,null)}}const cs=Object.create(null);class se{getMap(){return fe.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=cs[t.stepType];if(!r)throw new RangeError(`No step type ${t.stepType} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in cs)throw new RangeError("Duplicate use of step JSON ID "+e);return cs[e]=t,t.prototype.jsonID=e,t}}class q{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new q(e,null)}static fail(e){return new q(null,e)}static fromReplace(e,t,r,s){try{return q.ok(e.replace(t,r,s))}catch(i){if(i instanceof Zn)return q.fail(i.message);throw i}}}function di(n,e,t){let r=[];for(let s=0;s<n.childCount;s++){let i=n.child(s);i.content.size&&(i=i.copy(di(i.content,e,i))),i.isInline&&(i=e(i,t,s)),r.push(i)}return k.fromArray(r)}class Ge extends se{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),s=r.node(r.sharedDepth(this.to)),i=new v(di(t.content,(o,l)=>!o.isAtom||!l.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),s),t.openStart,t.openEnd);return q.fromReplace(e,this.from,this.to,i)}invert(){return new ve(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Ge(t.pos,r.pos,this.mark)}merge(e){return e instanceof Ge&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ge(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Ge(t.from,t.to,e.markFromJSON(t.mark))}}se.jsonID("addMark",Ge);class ve extends se{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new v(di(t.content,s=>s.mark(this.mark.removeFromSet(s.marks)),e),t.openStart,t.openEnd);return q.fromReplace(e,this.from,this.to,r)}invert(){return new Ge(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new ve(t.pos,r.pos,this.mark)}merge(e){return e instanceof ve&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ve(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new ve(t.from,t.to,e.markFromJSON(t.mark))}}se.jsonID("removeMark",ve);class Ye extends se{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return q.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return q.fromReplace(e,this.pos,this.pos+1,new v(k.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let s=0;s<t.marks.length;s++)if(!t.marks[s].isInSet(r))return new Ye(this.pos,t.marks[s]);return new Ye(this.pos,this.mark)}}return new Ct(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Ye(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Ye(t.pos,e.markFromJSON(t.mark))}}se.jsonID("addNodeMark",Ye);class Ct extends se{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return q.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return q.fromReplace(e,this.pos,this.pos+1,new v(k.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Ye(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Ct(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Ct(t.pos,e.markFromJSON(t.mark))}}se.jsonID("removeNodeMark",Ct);class U extends se{constructor(e,t,r,s=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=s}apply(e){return this.structure&&$s(e,this.from,this.to)?q.fail("Structure replace would overwrite content"):q.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new fe([this.from,this.to-this.from,this.slice.size])}invert(e){return new U(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.to,-1),r=this.from==this.to&&U.MAP_BIAS<0?t:e.mapResult(this.from,1);return r.deletedAcross&&t.deletedAcross?null:new U(r.pos,Math.max(r.pos,t.pos),this.slice,this.structure)}merge(e){if(!(e instanceof U)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?v.empty:new v(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new U(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?v.empty:new v(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new U(e.from,this.to,t,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new U(t.from,t.to,v.fromJSON(e,t.slice),!!t.structure)}}U.MAP_BIAS=1;se.jsonID("replace",U);class Y extends se{constructor(e,t,r,s,i,o,l=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=s,this.slice=i,this.insert=o,this.structure=l}apply(e){if(this.structure&&($s(e,this.from,this.gapFrom)||$s(e,this.gapTo,this.to)))return q.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return q.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?q.fromReplace(e,this.from,this.to,r):q.fail("Content does not fit in gap")}getMap(){return new fe([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new Y(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),s=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||s<t.pos||i>r.pos?null:new Y(t.pos,r.pos,s,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Y(t.from,t.to,t.gapFrom,t.gapTo,v.fromJSON(e,t.slice),t.insert,!!t.structure)}}se.jsonID("replaceAround",Y);function $s(n,e,t){let r=n.resolve(e),s=t-e,i=r.depth;for(;s>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,s--;if(s>0){let o=r.node(i).maybeChild(r.indexAfter(i));for(;s>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,s--}}return!1}function xd(n,e,t,r){let s=[],i=[],o,l;n.doc.nodesBetween(e,t,(a,c,u)=>{if(!a.isInline)return;let d=a.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let f=Math.max(c,e),h=Math.min(c+a.nodeSize,t),p=r.addToSet(d);for(let m=0;m<d.length;m++)d[m].isInSet(p)||(o&&o.to==f&&o.mark.eq(d[m])?o.to=h:s.push(o=new ve(f,h,d[m])));l&&l.to==f?l.to=h:i.push(l=new Ge(f,h,r))}}),s.forEach(a=>n.step(a)),i.forEach(a=>n.step(a))}function Sd(n,e,t,r){let s=[],i=0;n.doc.nodesBetween(e,t,(o,l)=>{if(!o.isInline)return;i++;let a=null;if(r instanceof jr){let c=o.marks,u;for(;u=r.isInSet(c);)(a||(a=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(o.marks)&&(a=[r]):a=o.marks;if(a&&a.length){let c=Math.min(l+o.nodeSize,t);for(let u=0;u<a.length;u++){let d=a[u],f;for(let h=0;h<s.length;h++){let p=s[h];p.step==i-1&&d.eq(s[h].style)&&(f=p)}f?(f.to=c,f.step=i):s.push({style:d,from:Math.max(l,e),to:c,step:i})}}}),s.forEach(o=>n.step(new ve(o.from,o.to,o.style)))}function fi(n,e,t,r=t.contentMatch,s=!0){let i=n.doc.nodeAt(e),o=[],l=e+1;for(let a=0;a<i.childCount;a++){let c=i.child(a),u=l+c.nodeSize,d=r.matchType(c.type);if(!d)o.push(new U(l,u,v.empty));else{r=d;for(let f=0;f<c.marks.length;f++)t.allowsMarkType(c.marks[f].type)||n.step(new ve(l,u,c.marks[f]));if(s&&c.isText&&t.whitespace!="pre"){let f,h=/\r?\n|\r/g,p;for(;f=h.exec(c.text);)p||(p=new v(k.from(t.schema.text(" ",t.allowedMarks(c.marks))),0,0)),o.push(new U(l+f.index,l+f.index+f[0].length,p))}}l=u}if(!r.validEnd){let a=r.fillBefore(k.empty,!0);n.replace(l,l,new v(a,0,0))}for(let a=o.length-1;a>=0;a--)n.step(o[a])}function wd(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function Yt(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth,s=0,i=0;;--r){let o=n.$from.node(r),l=n.$from.index(r)+s,a=n.$to.indexAfter(r)-i;if(r<n.depth&&o.canReplace(l,a,t))return r;if(r==0||o.type.spec.isolating||!wd(o,l,a))break;l&&(s=1),a<o.childCount&&(i=1)}return null}function Cd(n,e,t){let{$from:r,$to:s,depth:i}=e,o=r.before(i+1),l=s.after(i+1),a=o,c=l,u=k.empty,d=0;for(let p=i,m=!1;p>t;p--)m||r.index(p)>0?(m=!0,u=k.from(r.node(p).copy(u)),d++):a--;let f=k.empty,h=0;for(let p=i,m=!1;p>t;p--)m||s.after(p+1)<s.end(p)?(m=!0,f=k.from(s.node(p).copy(f)),h++):c++;n.step(new Y(a,c,o,l,new v(u.append(f),d,h),u.size-d,!0))}function hi(n,e,t=null,r=n){let s=vd(n,e),i=s&&Ed(r,e);return i?s.map(yo).concat({type:e,attrs:t}).concat(i.map(yo)):null}function yo(n){return{type:n,attrs:null}}function vd(n,e){let{parent:t,startIndex:r,endIndex:s}=n,i=t.contentMatchAt(r).findWrapping(e);if(!i)return null;let o=i.length?i[0]:e;return t.canReplaceWith(r,s,o)?i:null}function Ed(n,e){let{parent:t,startIndex:r,endIndex:s}=n,i=t.child(r),o=e.contentMatch.findWrapping(i.type);if(!o)return null;let a=(o.length?o[o.length-1]:e).contentMatch;for(let c=r;a&&c<s;c++)a=a.matchType(t.child(c).type);return!a||!a.validEnd?null:o}function Td(n,e,t){let r=k.empty;for(let o=t.length-1;o>=0;o--){if(r.size){let l=t[o].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=k.from(t[o].type.create(t[o].attrs,r))}let s=e.start,i=e.end;n.step(new Y(s,i,s,i,new v(r,0,0),t.length,!0))}function Md(n,e,t,r,s){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=n.steps.length;n.doc.nodesBetween(e,t,(o,l)=>{let a=typeof s=="function"?s(o):s;if(o.isTextblock&&!o.hasMarkup(r,a)&&Ad(n.doc,n.mapping.slice(i).map(l),r)){let c=null;if(r.schema.linebreakReplacement){let h=r.whitespace=="pre",p=!!r.contentMatch.matchType(r.schema.linebreakReplacement);h&&!p?c=!1:!h&&p&&(c=!0)}c===!1&&ha(n,o,l,i),fi(n,n.mapping.slice(i).map(l,1),r,void 0,c===null);let u=n.mapping.slice(i),d=u.map(l,1),f=u.map(l+o.nodeSize,1);return n.step(new Y(d,f,d+1,f-1,new v(k.from(r.create(a,null,o.marks)),0,0),1,!0)),c===!0&&fa(n,o,l,i),!1}})}function fa(n,e,t,r){e.forEach((s,i)=>{if(s.isText){let o,l=/\r?\n|\r/g;for(;o=l.exec(s.text);){let a=n.mapping.slice(r).map(t+1+i+o.index);n.replaceWith(a,a+1,e.type.schema.linebreakReplacement.create())}}})}function ha(n,e,t,r){e.forEach((s,i)=>{if(s.type==s.type.schema.linebreakReplacement){let o=n.mapping.slice(r).map(t+1+i);n.replaceWith(o,o+1,e.type.schema.text(`
@@ -1 +1 @@
1
- import{e as b,c as w,j as a,l as j}from"./index-ChYUSQjJ.js";import{i as N}from"./SearchMd-DM0EjhEJ.js";function S(f){const e=b.c(17),{value:l,onChange:c,placeholder:g,onKeyDown:d,className:u,isSearching:p,disabled:i}=f,m=g===void 0?"Search...":g,x=i&&"pointer-events-none opacity-50";let t;e[0]!==u||e[1]!==x?(t=w("flex items-center gap-4 rounded-lg bg-background dark:bg-input/30 px-3 h-8 card-shadow","focus-within:border-ring focus-within:ring-ring/20 focus-within:ring-[2px]","transition-[color,box-shadow]",x,u),e[0]=u,e[1]=x,e[2]=t):t=e[2];let n;e[3]!==p?(n=p?a.jsx(j,{size:16,className:"animate-spin text-muted-foreground/75 shrink-0"}):a.jsx(N,{size:16,className:"text-muted-foreground/75 shrink-0"}),e[3]=p,e[4]=n):n=e[4];let s;e[5]!==c?(s=h=>c(h.target.value),e[5]=c,e[6]=s):s=e[6];let o;e[7]!==i||e[8]!==d||e[9]!==m||e[10]!==s||e[11]!==l?(o=a.jsx("input",{type:"text",value:l,onChange:s,onKeyDown:d,placeholder:m,disabled:i,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[7]=i,e[8]=d,e[9]=m,e[10]=s,e[11]=l,e[12]=o):o=e[12];let r;return e[13]!==t||e[14]!==n||e[15]!==o?(r=a.jsxs("label",{className:t,children:[n,o]}),e[13]=t,e[14]=n,e[15]=o,e[16]=r):r=e[16],r}export{S};
1
+ import{e as b,c as w,j as a,l as j}from"./index-D3avDGSl.js";import{i as N}from"./SearchMd-BNBDuE-K.js";function S(f){const e=b.c(17),{value:l,onChange:c,placeholder:g,onKeyDown:d,className:u,isSearching:p,disabled:i}=f,m=g===void 0?"Search...":g,x=i&&"pointer-events-none opacity-50";let t;e[0]!==u||e[1]!==x?(t=w("flex items-center gap-4 rounded-lg bg-background dark:bg-input/30 px-3 h-8 card-shadow","focus-within:border-ring focus-within:ring-ring/20 focus-within:ring-[2px]","transition-[color,box-shadow]",x,u),e[0]=u,e[1]=x,e[2]=t):t=e[2];let n;e[3]!==p?(n=p?a.jsx(j,{size:16,className:"animate-spin text-muted-foreground/75 shrink-0"}):a.jsx(N,{size:16,className:"text-muted-foreground/75 shrink-0"}),e[3]=p,e[4]=n):n=e[4];let s;e[5]!==c?(s=h=>c(h.target.value),e[5]=c,e[6]=s):s=e[6];let o;e[7]!==i||e[8]!==d||e[9]!==m||e[10]!==s||e[11]!==l?(o=a.jsx("input",{type:"text",value:l,onChange:s,onKeyDown:d,placeholder:m,disabled:i,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[7]=i,e[8]=d,e[9]=m,e[10]=s,e[11]=l,e[12]=o):o=e[12];let r;return e[13]!==t||e[14]!==n||e[15]!==o?(r=a.jsxs("label",{className:t,children:[n,o]}),e[13]=t,e[14]=n,e[15]=o,e[16]=r):r=e[16],r}export{S};
@@ -1 +1 @@
1
- import{e as f,j as t,E as P,r as j,F as w,B as S,o as y}from"./index-ChYUSQjJ.js";import{i as k}from"./AlertCircle-Cie6Yisc.js";import{s as z}from"./Plus-G5Gw5kPM.js";import{s as F}from"./User01-CqHZqKxf.js";import{t as E}from"./Users01-Dsn_tDG5.js";import{D as $,a as I,b as O,c as A,e as R,d as T}from"./dialog-qWglm5p2.js";import{I as N}from"./input-Cm-_5NLx.js";import{L as g}from"./label-CyHrJvd7.js";import{d as B,S as V,a as L,b as q,c as C}from"./select-2pE_Mne6.js";import{S as H}from"./skeleton-DekfpK4t.js";import{T as K}from"./textarea-C_bdHrQP.js";import{P as b}from"./index-qXKJFTio.js";import{c as W}from"./settings-section-BZqGjpLm.js";import{u as Y,a as G}from"./use-secrets-6j_GId-n.js";import{R as J}from"./require-capability-D5WFhc1C.js";import"./X-D7vVBDXl.js";import"./tooltip-ByLiX5Mq.js";import"./Check-CWWWjir3.js";import"./ChevronDown-DPCmMamP.js";import"./ChevronUp-Bj0jQsTk.js";import"./sidebar-ujCPJCBV.js";import"./LayoutLeft-BrLgpS4_.js";import"./sheet-BhIiqWhI.js";import"./card-B4WowcKq.js";import"./ArrowUpRight-Bup5q9aR.js";import"./use-mcp-client-B-JRPXnN.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./use-capability-xJktXQ3I.js";import"./access-gate-roIhjIJn.js";import"./capability-load-error-DPd39UC9.js";function M(s){const e=f.c(3),{error:r}=s;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(k,{size:16}),e[0]=a):a=e[0];let n;return e[1]!==r.message?(n=t.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[a,t.jsxs("span",{className:"text-sm font-medium",children:["Failed to load secrets: ",r.message]})]}),e[1]=r.message,e[2]=n):n=e[2],n}function Q(s){const e=f.c(5),{scope:r}=s,a=r==="user"?F:E,n=r==="user"?"Private":"Organization";let i;e[0]!==a?(i=t.jsx(a,{size:12}),e[0]=a,e[1]=i):i=e[1];let o;return e[2]!==n||e[3]!==i?(o=t.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-muted text-muted-foreground text-xs",children:[i,n]}),e[2]=n,e[3]=i,e[4]=o):o=e[4],o}function D(s){const e=f.c(20),{secret:r}=s;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:t.jsx(w,{size:16,className:"text-muted-foreground"})}),e[0]=a):a=e[0];let n;e[1]!==r.name?(n=t.jsx("span",{className:"font-medium text-sm truncate",children:r.name}),e[1]=r.name,e[2]=n):n=e[2];let i;e[3]!==r.scope?(i=t.jsx(Q,{scope:r.scope}),e[3]=r.scope,e[4]=i):i=e[4];let o;e[5]!==n||e[6]!==i?(o=t.jsxs("div",{className:"flex items-center gap-2",children:[n,i]}),e[5]=n,e[6]=i,e[7]=o):o=e[7];let d;e[8]!==r.description?(d=r.description?t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:r.description}):null,e[8]=r.description,e[9]=d):d=e[9];let u;e[10]!==o||e[11]!==d?(u=t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[a,t.jsxs("div",{className:"min-w-0",children:[o,d]})]}),e[10]=o,e[11]=d,e[12]=u):u=e[12];let l;e[13]!==r.createdAt?(l=new Date(r.createdAt).toLocaleDateString(),e[13]=r.createdAt,e[14]=l):l=e[14];let c;e[15]!==l?(c=t.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:l}),e[15]=l,e[16]=c):c=e[16];let x;return e[17]!==u||e[18]!==c?(x=t.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[u,c]}),e[17]=u,e[18]=c,e[19]=x):x=e[19],x}function U(s){const e=f.c(5),{onCreate:r}=s;let a,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:t.jsx(w,{size:20,className:"text-muted-foreground"})}),n=t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-sm",children:"No secrets yet"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:"Store API keys, tokens, and other sensitive values. Values are encrypted at rest and never returned over the API."})]}),e[0]=a,e[1]=n):(a=e[0],n=e[1]);let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(z,{size:14}),e[2]=i):i=e[2];let o;return e[3]!==r?(o=t.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[a,n,t.jsxs(S,{onClick:r,size:"sm",className:"mt-2",children:[i,"New secret"]})]}),e[3]=r,e[4]=o):o=e[4],o}function _({open:s,onOpenChange:e}){const[r,a]=j.useState("organization"),[n,i]=j.useState(""),[o,d]=j.useState(""),[u,l]=j.useState(""),c=G();function x(){a("organization"),i(""),d(""),l("")}function p(){x(),e(!1)}async function h(m){if(m.preventDefault(),!(!n.trim()||!o))try{await c.mutateAsync({scope:r,name:n.trim(),value:o,description:u.trim()||void 0}),y.success(`Secret "${n.trim()}" created`),p()}catch(v){y.error(v instanceof Error?v.message:"Failed to create secret")}}return t.jsx($,{open:s,onOpenChange:m=>{m?e(m):p()},children:t.jsxs(I,{className:"sm:max-w-lg",children:[t.jsxs(O,{children:[t.jsx(A,{children:"New secret"}),t.jsx(R,{children:"Stored encrypted in the credential vault. Choose who can read it."})]}),t.jsxs("form",{onSubmit:h,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-scope",children:"Scope"}),t.jsxs(B,{value:r,onValueChange:m=>a(m),children:[t.jsx(V,{id:"secret-scope",children:t.jsx(L,{})}),t.jsxs(q,{children:[t.jsx(C,{value:"organization",children:"Organization — visible to all members"}),t.jsx(C,{value:"user",children:"Private — only visible to me"})]})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-name",children:"Name"}),t.jsx(N,{id:"secret-name",value:n,onChange:m=>i(m.target.value),placeholder:"STRIPE_API_KEY",autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Letters, digits, underscore, dot, hyphen. Case-insensitive within its scope."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-value",children:"Value"}),t.jsx(N,{id:"secret-value",type:"password",value:o,onChange:m=>d(m.target.value),autoComplete:"new-password",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-description",children:"Description (optional)"}),t.jsx(K,{id:"secret-description",value:u,onChange:m=>l(m.target.value),rows:2,placeholder:"What is this secret used for?"})]}),t.jsxs(T,{children:[t.jsx(S,{type:"button",variant:"outline",onClick:p,disabled:c.isPending,children:"Cancel"}),t.jsx(S,{type:"submit",disabled:c.isPending||!n.trim()||!o,children:c.isPending?"Creating…":"Create secret"})]})]})]})})}function X(){const s=f.c(21),e=Y(),[r,a]=j.useState(!1);if(e.length===0){let l;s[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(U,{onCreate:()=>a(!0)}),s[0]=l):l=s[0];let c;return s[1]!==r?(c=t.jsxs(t.Fragment,{children:[l,t.jsx(_,{open:r,onOpenChange:a})]}),s[1]=r,s[2]=c):c=s[2],c}let n,i,o;if(s[3]!==e){const l=e.filter(se),c=e.filter(te),x=e.length===1?"":"s";let p;s[7]!==e.length||s[8]!==x?(p=t.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.length," secret",x," stored"]}),s[7]=e.length,s[8]=x,s[9]=p):p=s[9];let h;s[10]===Symbol.for("react.memo_cache_sentinel")?(h=()=>a(!0),s[10]=h):h=s[10];let m;s[11]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs(S,{onClick:h,size:"sm",children:[t.jsx(z,{size:14}),"New secret"]}),s[11]=m):m=s[11],s[12]!==p?(n=t.jsxs("div",{className:"flex items-center justify-between",children:[p,m]}),s[12]=p,s[13]=n):n=s[13],i=l.length>0?t.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[t.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Organization"}),t.jsx("div",{children:l.map(ee)})]}):null,o=c.length>0?t.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[t.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Private to me"}),t.jsx("div",{children:c.map(Z)})]}):null,s[3]=e,s[4]=n,s[5]=i,s[6]=o}else n=s[4],i=s[5],o=s[6];let d;s[14]!==r?(d=t.jsx(_,{open:r,onOpenChange:a}),s[14]=r,s[15]=d):d=s[15];let u;return s[16]!==n||s[17]!==i||s[18]!==o||s[19]!==d?(u=t.jsxs(t.Fragment,{children:[n,i,o,d]}),s[16]=n,s[17]=i,s[18]=o,s[19]=d,s[20]=u):u=s[20],u}function Z(s){return t.jsx(D,{secret:s},s.id)}function ee(s){return t.jsx(D,{secret:s},s.id)}function te(s){return s.scope==="user"}function se(s){return s.scope==="organization"}function re(){const s=f.c(2);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(b.Title,{children:"Secrets"}),s[0]=e):e=s[0];let r;return s[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(b,{children:t.jsx(b.Content,{children:t.jsx(b.Body,{children:t.jsxs(W,{children:[e,t.jsx(P,{fallback:ne,children:t.jsx(j.Suspense,{fallback:t.jsx(H,{className:"h-32 w-full"}),children:t.jsx(X,{})})})]})})})}),s[1]=r):r=s[1],r}function ne(s){const{error:e}=s;return t.jsx(M,{error:e??new Error("Failed to load secrets")})}function Oe(){const s=f.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(J,{capability:"secrets:manage",area:"secrets",children:t.jsx(re,{})}),s[0]=e):e=s[0],e}export{Oe as default};
1
+ import{e as f,j as t,E as P,r as j,F as w,B as S,o as y}from"./index-D3avDGSl.js";import{i as k}from"./AlertCircle-Dpuql2tA.js";import{s as z}from"./Plus-BtdUV_kH.js";import{s as F}from"./User01-DeMZ-XKs.js";import{t as E}from"./Users01-stOb3vXo.js";import{D as $,a as I,b as O,c as A,e as R,d as T}from"./dialog-BM-B6vYl.js";import{I as N}from"./input-B_SdLJQK.js";import{L as g}from"./label-aUygS1cE.js";import{d as B,S as V,a as L,b as q,c as C}from"./select-DiYyNvmX.js";import{S as H}from"./skeleton-BDmWNgO1.js";import{T as K}from"./textarea-DH43ASwp.js";import{P as b}from"./index-ddLepuAa.js";import{c as W}from"./settings-section-Cwe7xf9d.js";import{u as Y,a as G}from"./use-secrets-BnqZjmY-.js";import{R as J}from"./require-capability-SwOsWHIR.js";import"./X-lJKMgTG7.js";import"./tooltip-CLYxliPH.js";import"./Check-BjI-EvpJ.js";import"./ChevronDown-CCxO1iHC.js";import"./ChevronUp-CLwjbWR2.js";import"./sidebar-BHpe-htn.js";import"./LayoutLeft-DOceuRg7.js";import"./sheet-B9j6H-QD.js";import"./card-D8DKqFpf.js";import"./ArrowUpRight-CH6mYZOO.js";import"./use-mcp-client-BAkI6-zz.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./use-capability-CVm9Y_d_.js";import"./access-gate-DLKGN_M-.js";import"./capability-load-error-Ce5R9GAQ.js";function M(s){const e=f.c(3),{error:r}=s;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(k,{size:16}),e[0]=a):a=e[0];let n;return e[1]!==r.message?(n=t.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[a,t.jsxs("span",{className:"text-sm font-medium",children:["Failed to load secrets: ",r.message]})]}),e[1]=r.message,e[2]=n):n=e[2],n}function Q(s){const e=f.c(5),{scope:r}=s,a=r==="user"?F:E,n=r==="user"?"Private":"Organization";let i;e[0]!==a?(i=t.jsx(a,{size:12}),e[0]=a,e[1]=i):i=e[1];let o;return e[2]!==n||e[3]!==i?(o=t.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-muted text-muted-foreground text-xs",children:[i,n]}),e[2]=n,e[3]=i,e[4]=o):o=e[4],o}function D(s){const e=f.c(20),{secret:r}=s;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:t.jsx(w,{size:16,className:"text-muted-foreground"})}),e[0]=a):a=e[0];let n;e[1]!==r.name?(n=t.jsx("span",{className:"font-medium text-sm truncate",children:r.name}),e[1]=r.name,e[2]=n):n=e[2];let i;e[3]!==r.scope?(i=t.jsx(Q,{scope:r.scope}),e[3]=r.scope,e[4]=i):i=e[4];let o;e[5]!==n||e[6]!==i?(o=t.jsxs("div",{className:"flex items-center gap-2",children:[n,i]}),e[5]=n,e[6]=i,e[7]=o):o=e[7];let d;e[8]!==r.description?(d=r.description?t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:r.description}):null,e[8]=r.description,e[9]=d):d=e[9];let u;e[10]!==o||e[11]!==d?(u=t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[a,t.jsxs("div",{className:"min-w-0",children:[o,d]})]}),e[10]=o,e[11]=d,e[12]=u):u=e[12];let l;e[13]!==r.createdAt?(l=new Date(r.createdAt).toLocaleDateString(),e[13]=r.createdAt,e[14]=l):l=e[14];let c;e[15]!==l?(c=t.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:l}),e[15]=l,e[16]=c):c=e[16];let x;return e[17]!==u||e[18]!==c?(x=t.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[u,c]}),e[17]=u,e[18]=c,e[19]=x):x=e[19],x}function U(s){const e=f.c(5),{onCreate:r}=s;let a,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:t.jsx(w,{size:20,className:"text-muted-foreground"})}),n=t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-sm",children:"No secrets yet"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:"Store API keys, tokens, and other sensitive values. Values are encrypted at rest and never returned over the API."})]}),e[0]=a,e[1]=n):(a=e[0],n=e[1]);let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(z,{size:14}),e[2]=i):i=e[2];let o;return e[3]!==r?(o=t.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[a,n,t.jsxs(S,{onClick:r,size:"sm",className:"mt-2",children:[i,"New secret"]})]}),e[3]=r,e[4]=o):o=e[4],o}function _({open:s,onOpenChange:e}){const[r,a]=j.useState("organization"),[n,i]=j.useState(""),[o,d]=j.useState(""),[u,l]=j.useState(""),c=G();function x(){a("organization"),i(""),d(""),l("")}function p(){x(),e(!1)}async function h(m){if(m.preventDefault(),!(!n.trim()||!o))try{await c.mutateAsync({scope:r,name:n.trim(),value:o,description:u.trim()||void 0}),y.success(`Secret "${n.trim()}" created`),p()}catch(v){y.error(v instanceof Error?v.message:"Failed to create secret")}}return t.jsx($,{open:s,onOpenChange:m=>{m?e(m):p()},children:t.jsxs(I,{className:"sm:max-w-lg",children:[t.jsxs(O,{children:[t.jsx(A,{children:"New secret"}),t.jsx(R,{children:"Stored encrypted in the credential vault. Choose who can read it."})]}),t.jsxs("form",{onSubmit:h,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-scope",children:"Scope"}),t.jsxs(B,{value:r,onValueChange:m=>a(m),children:[t.jsx(V,{id:"secret-scope",children:t.jsx(L,{})}),t.jsxs(q,{children:[t.jsx(C,{value:"organization",children:"Organization — visible to all members"}),t.jsx(C,{value:"user",children:"Private — only visible to me"})]})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-name",children:"Name"}),t.jsx(N,{id:"secret-name",value:n,onChange:m=>i(m.target.value),placeholder:"STRIPE_API_KEY",autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Letters, digits, underscore, dot, hyphen. Case-insensitive within its scope."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-value",children:"Value"}),t.jsx(N,{id:"secret-value",type:"password",value:o,onChange:m=>d(m.target.value),autoComplete:"new-password",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-description",children:"Description (optional)"}),t.jsx(K,{id:"secret-description",value:u,onChange:m=>l(m.target.value),rows:2,placeholder:"What is this secret used for?"})]}),t.jsxs(T,{children:[t.jsx(S,{type:"button",variant:"outline",onClick:p,disabled:c.isPending,children:"Cancel"}),t.jsx(S,{type:"submit",disabled:c.isPending||!n.trim()||!o,children:c.isPending?"Creating…":"Create secret"})]})]})]})})}function X(){const s=f.c(21),e=Y(),[r,a]=j.useState(!1);if(e.length===0){let l;s[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(U,{onCreate:()=>a(!0)}),s[0]=l):l=s[0];let c;return s[1]!==r?(c=t.jsxs(t.Fragment,{children:[l,t.jsx(_,{open:r,onOpenChange:a})]}),s[1]=r,s[2]=c):c=s[2],c}let n,i,o;if(s[3]!==e){const l=e.filter(se),c=e.filter(te),x=e.length===1?"":"s";let p;s[7]!==e.length||s[8]!==x?(p=t.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.length," secret",x," stored"]}),s[7]=e.length,s[8]=x,s[9]=p):p=s[9];let h;s[10]===Symbol.for("react.memo_cache_sentinel")?(h=()=>a(!0),s[10]=h):h=s[10];let m;s[11]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs(S,{onClick:h,size:"sm",children:[t.jsx(z,{size:14}),"New secret"]}),s[11]=m):m=s[11],s[12]!==p?(n=t.jsxs("div",{className:"flex items-center justify-between",children:[p,m]}),s[12]=p,s[13]=n):n=s[13],i=l.length>0?t.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[t.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Organization"}),t.jsx("div",{children:l.map(ee)})]}):null,o=c.length>0?t.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[t.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Private to me"}),t.jsx("div",{children:c.map(Z)})]}):null,s[3]=e,s[4]=n,s[5]=i,s[6]=o}else n=s[4],i=s[5],o=s[6];let d;s[14]!==r?(d=t.jsx(_,{open:r,onOpenChange:a}),s[14]=r,s[15]=d):d=s[15];let u;return s[16]!==n||s[17]!==i||s[18]!==o||s[19]!==d?(u=t.jsxs(t.Fragment,{children:[n,i,o,d]}),s[16]=n,s[17]=i,s[18]=o,s[19]=d,s[20]=u):u=s[20],u}function Z(s){return t.jsx(D,{secret:s},s.id)}function ee(s){return t.jsx(D,{secret:s},s.id)}function te(s){return s.scope==="user"}function se(s){return s.scope==="organization"}function re(){const s=f.c(2);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(b.Title,{children:"Secrets"}),s[0]=e):e=s[0];let r;return s[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(b,{children:t.jsx(b.Content,{children:t.jsx(b.Body,{children:t.jsxs(W,{children:[e,t.jsx(P,{fallback:ne,children:t.jsx(j.Suspense,{fallback:t.jsx(H,{className:"h-32 w-full"}),children:t.jsx(X,{})})})]})})})}),s[1]=r):r=s[1],r}function ne(s){const{error:e}=s;return t.jsx(M,{error:e??new Error("Failed to load secrets")})}function Oe(){const s=f.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(J,{capability:"secrets:manage",area:"secrets",children:t.jsx(re,{})}),s[0]=e):e=s[0],e}export{Oe as default};
@@ -1,2 +1,2 @@
1
- import{e as $e,r as T,j as t,B as Ve,l as Ut,c as me,G as Wn,o as de,K as Gn}from"./index-ChYUSQjJ.js";import{t as As}from"./ChevronDown-DPCmMamP.js";import{i as Jn}from"./ChevronRight-BPW30xu2.js";import{n as Zn}from"./ChevronUp-Bj0jQsTk.js";import{D as Yt,u as qt,g as bt,E as Qn,F as Xn,J as ea}from"./agent-icon-B_ENO9HH.js";import{i as ta}from"./Globe01-D6rc4c2I.js";import{S as mt}from"./scroll-area-BdohAM0t.js";import{T as at,a as rt,b as ot}from"./tooltip-ByLiX5Mq.js";import{c as Es,b as Ms,e as Vs,d as $s,a as Os,D as Ls}from"./dialog-qWglm5p2.js";import{I as Is}from"./input-Cm-_5NLx.js";import{r as sa,i as ht,P as na,S as aa,N as ra,l as Ke,G as oa,a as ia,b as gt,u as la,c as ca,d as ua,e as da,f as ma,g as fa,h as pa,j as ha,k as ft,m as Vt,n as Ze,p as bs,o as ys,q as ga,s as $t,t as va,v as xa,w as ba,x as ya,y as Sa,z as _a,A as ja,B as pt,C as ka,D as wa,E as Na,F as Ca,H as Ta,I as Ra,J as Ot,K as Da,L as Pa,M as Aa,O as Lt,Q as Ea,R as Ma,T as Ss}from"./index-3lvkMmcU.js";import{s as Va,a as zs}from"./Eye-Dj0PXl1o.js";import{d as $a}from"./ZoomOut-0Ur-V1Tn.js";import{a as Oa}from"./RefreshCcw01-C5jOy04q.js";import{s as Kt}from"./Plus-G5Gw5kPM.js";import{s as yt}from"./Trash01-cARQt3ei.js";import{i as La}from"./Zap-jV52NH8a.js";import{a as Wt,c as Qe,D as Gt,b as Jt,d as Ia}from"./dropdown-menu-Vxh4zyXD.js";import{u as Fs,a as vt,K as Bs,P as Ks,b as Hs,C as Us,s as Ys,d as xt,D as qs,c as Ws,S as Gs,v as za,e as Js,h as Fa}from"./sortable.esm-Cra7DBkd.js";import{r as Ba,s as Ka,u as nt,S as Ht}from"./schema-form-B08gOdyg.js";import{r as _s,u as Ha,d as Ua,a as Ya,i as qa,f as Wa,P as Ga,b as Ja,S as Za}from"./page-seo-form-Bd0DSnoH.js";import{c as Qa,C as Xa,e as js,d as er,a as tr,g as sr}from"./command-BSLuC415.js";import{i as nr}from"./FilterLines-D8oi1Sof.js";import{i as ar}from"./Tool01-WQP4RZxz.js";import{AddSectionModal as rr}from"./add-section-modal-CRKAmuUu.js";import{c as or}from"./save-referenced-block-DfCtlYLI.js";import"./AlertCircle-Cie6Yisc.js";import"./SwitchHorizontal01-Sw4pGPNn.js";import"./XCircle-CGKRZUbS.js";import"./ArrowUpRight-Bup5q9aR.js";import"./ZapSquare-DVdUXxhF.js";import"./Users03-hkJxAqIG.js";import"./CheckCircle-Uw6Si4Uu.js";import"./Check-CWWWjir3.js";import"./ChevronLeft-BFKiUL-g.js";import"./DotsVertical-BnsTBCnN.js";import"./Container-CPU0lOb2.js";import"./Star01-39vpRLS0.js";import"./Palette-C633yKaN.js";import"./HardDrive-BsP_WnUS.js";import"./Stars02-LHx1LC9_.js";import"./Key01-ZzkGvXus.js";import"./LayoutLeft-BrLgpS4_.js";import"./LinkExternal01-CYjY9tw_.js";import"./Monitor01-Co7esQF_.js";import"./Sun-D5VbC5bQ.js";import"./Play-DOVnYSwF.js";import"./SearchMd-DM0EjhEJ.js";import"./Settings02-CtCQn3Yf.js";import"./Shield01-DlzHY_dC.js";import"./Stars01-D40cNl8a.js";import"./Upload01-Dmm1X5SO.js";import"./User01-CqHZqKxf.js";import"./Users01-Dsn_tDG5.js";import"./XClose-MKIx3xLp.js";import"./X-D7vVBDXl.js";import"./select-2pE_Mne6.js";import"./agent-capabilities-BWvW99VB.js";import"./chat-context-BqvG5V6J.js";import"./tab-id-C7RjxJTr.js";import"./use-mcp-client-B-JRPXnN.js";import"./decopilot-sse-pool-koFlJuH3.js";import"./create-sse-subscription-BS5983N4.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./use-virtual-mcp-fBHJQJIQ.js";import"./use-collections-DXI321_l.js";import"./use-ai-providers-DsKRr79k.js";import"./use-organization-settings-Cncb08kX.js";import"./pair-CrxtZLmo.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-B87517Y1.js";import"./file-type-icon-BilQa1o9.js";import"./content-blocks-o63cs2vh.js";import"./types-Durgfewm.js";import"./shell-layout-DIvP19WX.js";import"./avatar-B3Bw52dv.js";import"./required-auth-layout-MFF8-ZJT.js";import"./useRouterState-CQ_dlcxM.js";import"./use-org-sso-DMSjHU5t.js";import"./integration-icon-CjuSu3xL.js";import"./use-navigate-to-agent-j8txYt39.js";import"./use-connection-DDWrr0D8.js";import"./use-mcp-prompts-OczkXrmo.js";import"./form-gGZaN2er.js";import"./label-CyHrJvd7.js";import"./spinner-ukxdHUOu.js";import"./drawer-C6RzB17v.js";import"./collection-search-C3AEVd7W.js";import"./tabs-2u_8k4RO.js";import"./toggle-group-C4fnmDnN.js";import"./connect-desktop-dialog-DNq0ek1i.js";import"./agent-icons-CpkNElG-.js";import"./checkbox-DHuCa6fF.js";import"./skeleton-DekfpK4t.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-BZqGjpLm.js";import"./card-B4WowcKq.js";import"./popover-DmAofN68.js";import"./useInfiniteQuery-toVymGgv.js";import"./infiniteQueryObserver-CwLfraWt.js";import"./index-CXpnZeu8.js";import"./question-004-sINsf4GQ.js";import"./shell-route-loading-C61C46w4.js";import"./sidebar-ujCPJCBV.js";import"./sheet-BhIiqWhI.js";import"./toolbar-C8PVd7Ds.js";import"./use-create-virtual-mcp-CVaGBSXp.js";import"./github-repo-picker-CtaqsXDt.js";import"./use-mcp-tools-WWdORF6E.js";import"./extract-connection-data-yJgJfD7f.js";import"./generate-id-1zLHnSNC.js";import"./collections-B9PQucdo.js";import"./alert-dialog-BGwOQ-hv.js";import"./index-Dk3pxVwF.js";import"./use-org-auth-client-ziR2xP7Z.js";import"./hover-card-BmPYfkmQ.js";import"./task-status-CRWfjMb2.js";import"./use-status-sounds-jRgdHM6o.js";import"./empty-state-vFbdMLGr.js";import"./resizable-Dvc6mjD2.js";import"./use-capability-xJktXQ3I.js";import"./header-tab-button-2KdmhnCN.js";import"./index-C-Ei6mai.js";import"./textarea-C_bdHrQP.js";import"./user-5EdNnZWa.js";import"./tools-list-Cr63qS_c.js";import"./badge-5MzROStc.js";import"./connection-slug-eyAPH6o3.js";import"./switch-DgVVL7zp.js";import"./use-debounced-autosave-X1JA0Sjb.js";import"./index-qXKJFTio.js";import"./search-input-BOsI1GRw.js";import"./collection-tabs-azv2LaTo.js";import"./use-secrets-6j_GId-n.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./accordion-C0j3DHtl.js";import"./view-mode-toggle-Df0p0wvc.js";import"./select-model-CrWeciHf.js";import"./use-automations-Dr8lwymn.js";import"./monaco-editor-DpalAqoH.js";import"./automation-runs-C92-yFsO.js";import"./table-C2KXmc6v.js";import"./use-infinite-scroll-vpAXlalO.js";import"./use-members-DEAGj5M0.js";import"./useSuspenseInfiniteQuery-BbMvRYcb.js";import"./automation-list-row-BNAgjK8x.js";import"./connection-card-DJ5vpD6m.js";import"./use-registry-connections-bHwMGkYH.js";import"./connection-form-helpers-Ck21v4Z3.js";import"./calendar-DOA8Nces.js";import"./image-field-BAOOv2VL.js";import"./use-file-configs-acebBZy-.js";import"./index-BsdusiDa.js";function ir(r){const e=$e.c(38),{open:n,initialName:a,autoLabel:c,isPending:u,onSubmit:h,onOpenChange:d}=r,i=u===void 0?!1:u,[g,v]=T.useState(a),[x,y]=T.useState(n);n!==x&&(y(n),n&&v(a));let _;e[0]!==i||e[1]!==d?(_=R=>{!R&&!i&&d(!1)},e[0]=i,e[1]=d,e[2]=_):_=e[2];const o=_;let S;e[3]!==i||e[4]!==g||e[5]!==h?(S=async R=>{R.preventDefault(),!i&&await h(g.trim())},e[3]=i,e[4]=g,e[5]=h,e[6]=S):S=e[6];const p=S;let N;e[7]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(Es,{children:"Rename variant"}),e[7]=N):N=e[7];const f=c||"the rule";let j;e[8]!==f?(j=t.jsxs(Ms,{children:[N,t.jsxs(Vs,{children:["Save this matcher as a global block with a custom label. Leave empty to inline the matcher again and fall back to"," ",t.jsx("span",{className:"font-medium",children:f}),"."]})]}),e[8]=f,e[9]=j):j=e[9];let C;e[10]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[10]=C):C=e[10];let k;e[11]===Symbol.for("react.memo_cache_sentinel")?(k=R=>v(R.target.value),e[11]=k):k=e[11];let V;e[12]!==c||e[13]!==i||e[14]!==g?(V=t.jsxs("div",{className:"space-y-1.5 py-4",children:[C,t.jsx(Is,{id:"variant-rename-name",value:g,onChange:k,placeholder:c,autoFocus:!0,disabled:i})]}),e[12]=c,e[13]=i,e[14]=g,e[15]=V):V=e[15];let w;e[16]!==d?(w=()=>d(!1),e[16]=d,e[17]=w):w=e[17];let $;e[18]!==i||e[19]!==w?($=t.jsx(Ve,{type:"button",variant:"outline",onClick:w,disabled:i,children:"Cancel"}),e[18]=i,e[19]=w,e[20]=$):$=e[20];let D;e[21]!==i?(D=i?t.jsxs(t.Fragment,{children:[t.jsx(Ut,{size:14,className:"animate-spin"}),"Saving…"]}):"Save",e[21]=i,e[22]=D):D=e[22];let P;e[23]!==i||e[24]!==D?(P=t.jsx(Ve,{type:"submit",disabled:i,children:D}),e[23]=i,e[24]=D,e[25]=P):P=e[25];let I;e[26]!==$||e[27]!==P?(I=t.jsxs($s,{children:[$,P]}),e[26]=$,e[27]=P,e[28]=I):I=e[28];let O;e[29]!==p||e[30]!==I||e[31]!==j||e[32]!==V?(O=t.jsx(Os,{className:"sm:max-w-md",children:t.jsxs("form",{onSubmit:p,children:[j,V,I]})}),e[29]=p,e[30]=I,e[31]=j,e[32]=V,e[33]=O):O=e[33];let M;return e[34]!==o||e[35]!==n||e[36]!==O?(M=t.jsx(Ls,{open:n,onOpenChange:o,children:O}),e[34]=o,e[35]=n,e[36]=O,e[37]=M):M=e[37],M}function It(r,e,n,a,c){const u={...r[e]};if(c.length>1){const h=u.sections,d=[...h?.variants??[]];d[a]&&(d[a]={...d[a],value:n}),u.sections={...h,variants:d}}else u.sections=n;return u}function lr(r){return structuredClone(r)}function cr(r){return!r.isSavedBlock&&!r.isMultivariate}function ks(r){const e=r.replace(/[^A-Za-z0-9_-]/g,"");return/^[A-Za-z]/.test(e)?e:e?`Block${e}`:""}function ws(r,e){const n=r.trim();return n?n.includes("/")?"Block name cannot contain slashes.":Object.hasOwn(e,n)?"A block with this name already exists.":/^[A-Za-z][A-Za-z0-9_-]*$/.test(n)?null:"Use letters, numbers, hyphens, or underscores. Must start with a letter.":"Block name is required."}function ur(r){return r.schema?.definitions??r.schema?.$defs??{}}function dr(r,e){const n=ur(e),a=n[btoa(r)];if(!a)return;let c=typeof a.image=="string"?a.image:void 0;if(!c&&Array.isArray(a.allOf)){const u=a.allOf.find(h=>typeof h.$ref=="string")?.$ref;if(typeof u=="string"){const h=u.replace("#/definitions/",""),d=n[h];c=typeof d?.image=="string"?d.image:void 0}}if(c?.includes("{{{"))return c}function mr(r,e){if(!e)return;const n=sa(r);if(!n)return;const a=dr(n.resolveType,e);if(!a)return;const c=Ba(a,n.data);if(c)return Ka(c)}function zt(r,e){return r.map((n,a)=>{const c=n.__resolveType??"",u=ht(c);if(!u&&c!==""&&!c.includes("/")&&c in e){const g=e[c],v=typeof g?.name=="string"&&g.name||c.replace(/[-_]/g," ").replace(/\b\w/g,x=>x.toUpperCase())||`Section ${a+1}`;return{index:a,resolveType:c,label:v,isLazy:!1,isSavedBlock:!0}}const h=u?n.section:void 0,d=u?h?.__resolveType??"":c;if(d===na||d===aa){const g=u?h:n,v=Array.isArray(g?.variants)?g.variants:[];if(v.length===1&&(v[0]?.rule?.__resolveType??"")===ra){const _=v[0]?.value??{};let o=_.__resolveType??"";const S=ht(o);return S&&(o=_.section?.__resolveType??o),{index:a,resolveType:c,label:Ke(o)||`Section ${a+1}`,isHidden:!0,isLazy:S}}const x=v[0]?.value?.__resolveType,y=x?Ke(x):"Section";return{index:a,resolveType:c,label:`Variants of ${y}`,isMultivariate:!0,isLazy:u}}const i=u?n.section?.__resolveType??c:c;if(u&&i!==""&&!i.includes("/")&&i in e){const g=e[i],v=typeof g?.name=="string"&&g.name||i.replace(/[-_]/g," ").replace(/\b\w/g,x=>x.toUpperCase())||`Section ${a+1}`;return{index:a,resolveType:c,label:v,isLazy:!0,isSavedBlock:!0}}return{index:a,resolveType:c,label:Ke(i)||`Section ${a+1}`,isLazy:u}})}const fr="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",pr="text-global-section-fg focus:bg-global-section/12 focus:text-global-section-fg dark:text-global-section-fg-dark dark:focus:bg-global-section/15 dark:focus:text-global-section-fg-dark [&_svg]:!text-global-section";function Ns(r){return Array.from({length:r},(e,n)=>({id:crypto.randomUUID(),index:n}))}function Zs(r){return r.map((e,n)=>({...e,index:n}))}function hr(r,e){if(e===r.length)return r;if(e<r.length)return Zs(r.slice(0,e));const n=Array.from({length:e-r.length},(a,c)=>({id:crypto.randomUUID(),index:r.length+c}));return[...r,...n]}function Qs(r){const e=$e.c(20),{section:n,raw:a,meta:c}=r,u=n.isSavedBlock===!0,h=n.isMultivariate===!0;let d;e[0]!==c||e[1]!==a?(d=a&&c?mr(a,c):void 0,e[0]=c,e[1]=a,e[2]=d):d=e[2];const i=d;let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx($a,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[3]=g):g=e[3];let v;e[4]!==i?(v=i&&t.jsx("img",{src:i,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[4]=i,e[5]=v):v=e[5];let x;e[6]!==h||e[7]!==u?(x=u?{color:oa}:h?{color:"oklch(0.65 0.15 160)"}:void 0,e[6]=h,e[7]=u,e[8]=x):x=e[8];let y;e[9]!==x?(y=t.jsx(Yt,{className:"h-4 w-4 shrink-0",style:x}),e[9]=x,e[10]=y):y=e[10];const _=n.isHidden&&"line-through opacity-50";let o;e[11]!==_?(o=me("min-w-0 flex-1 truncate text-sm font-medium",_),e[11]=_,e[12]=o):o=e[12];let S;e[13]!==n.label||e[14]!==o?(S=t.jsx("span",{className:o,children:n.label}),e[13]=n.label,e[14]=o,e[15]=S):S=e[15];let p;return e[16]!==v||e[17]!==y||e[18]!==S?(p=t.jsxs(t.Fragment,{children:[g,v,y,S]}),e[16]=v,e[17]=y,e[18]=S,e[19]=p):p=e[19],p}function Xs(r,e){const n=r.isSavedBlock===!0,a=r.isMultivariate===!0;return me("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":n?fr:a?"text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]":"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function gr(r){const e=$e.c(53),{section:n,raw:a,meta:c,sortableId:u,selected:h,onSelect:d,onDelete:i,onDuplicate:g,onMakeReusable:v,onToggleHidden:x,onToggleLazy:y}=r,_=a?ht(a.__resolveType??""):!1;let o;e[0]!==u?(o={id:u,animateLayoutChanges:Sr},e[0]=u,e[1]=o):o=e[1];const{attributes:S,listeners:p,setNodeRef:N,transform:f,isDragging:j}=Hs(o);let C;e[2]!==f?(C=Us.Transform.toString(f?{...f,x:0}:null),e[2]=f,e[3]=C):C=e[3];const k=j?0:void 0;let V;e[4]!==C||e[5]!==k?(V={transform:C,opacity:k},e[4]=C,e[5]=k,e[6]=V):V=e[6];const w=V;let $;e[7]!==n?($=cr(n),e[7]=n,e[8]=$):$=e[8];const D=$,P="button",I=0;let O;e[9]!==d?(O=H=>{(H.key==="Enter"||H.key===" ")&&(H.preventDefault(),d())},e[9]=d,e[10]=O):O=e[10];const M=j?"cursor-grabbing":"cursor-pointer";let R;e[11]!==n||e[12]!==h||e[13]!==M?(R=me("touch-none transition-colors",M,Xs(n,h)),e[11]=n,e[12]=h,e[13]=M,e[14]=R):R=e[14];let Y;e[15]!==c||e[16]!==a||e[17]!==n?(Y=t.jsx(Qs,{section:n,raw:a,meta:c}),e[15]=c,e[16]=a,e[17]=n,e[18]=Y):Y=e[18];const ae=!n.isMultivariate&&t.jsx(Ve,{type:"button",variant:"ghost",size:"icon","aria-label":_?"Disable async render":"Enable async render",className:me("h-7 w-7 shrink-0",_?"":"opacity-0 group-hover:opacity-100"),onClick:H=>{H.stopPropagation(),y()},onPointerDown:yr,children:t.jsx(La,{className:me("h-3.5 w-3.5",_&&"text-yellow-500")})});let z;e[19]!==x||e[20]!==n.isHidden||e[21]!==n.isMultivariate?(z=!n.isMultivariate&&t.jsx(Ve,{type:"button",variant:"ghost",size:"icon","aria-label":n.isHidden?"Show section":"Hide section",className:me("h-7 w-7 shrink-0",n.isHidden?"opacity-100":"opacity-0 group-hover:opacity-100"),onClick:H=>{H.stopPropagation(),x()},onPointerDown:br,children:n.isHidden?t.jsx(Oa,{className:"h-3.5 w-3.5"}):t.jsx(Va,{className:"h-3.5 w-3.5"})}),e[19]=x,e[20]=n.isHidden,e[21]=n.isMultivariate,e[22]=z):z=e[22];let ie;e[23]===Symbol.for("react.memo_cache_sentinel")?(ie=t.jsx(Wt,{asChild:!0,children:t.jsx(Ve,{type:"button",variant:"ghost",size:"icon","aria-label":"Section actions",className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100",onClick:xr,onPointerDown:vr,children:t.jsx(qt,{className:"h-3.5 w-3.5"})})}),e[23]=ie):ie=e[23];let K;e[24]!==g?(K=H=>{H.stopPropagation(),g()},e[24]=g,e[25]=K):K=e[25];let X;e[26]===Symbol.for("react.memo_cache_sentinel")?(X=t.jsx(zs,{className:"h-4 w-4"}),e[26]=X):X=e[26];let re;e[27]!==K?(re=t.jsxs(Qe,{onClick:K,children:[X,"Duplicate"]}),e[27]=K,e[28]=re):re=e[28];let te;e[29]!==D||e[30]!==v?(te=D&&t.jsxs(Qe,{className:pr,onClick:H=>{H.stopPropagation(),v()},children:[t.jsx(Yt,{className:"h-4 w-4"}),"Make reusable"]}),e[29]=D,e[30]=v,e[31]=te):te=e[31];let W;e[32]!==i?(W=H=>{H.stopPropagation(),i()},e[32]=i,e[33]=W):W=e[33];let G;e[34]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx(yt,{className:"h-4 w-4"}),e[34]=G):G=e[34];let q;e[35]!==W?(q=t.jsxs(Qe,{className:"text-destructive focus:text-destructive",onClick:W,children:[G,"Delete"]}),e[35]=W,e[36]=q):q=e[36];let J;e[37]!==re||e[38]!==te||e[39]!==q?(J=t.jsxs(Gt,{children:[ie,t.jsxs(Jt,{align:"end",className:"w-44",children:[re,te,q]})]}),e[37]=re,e[38]=te,e[39]=q,e[40]=J):J=e[40];let Z;return e[41]!==S||e[42]!==p||e[43]!==d||e[44]!==N||e[45]!==w||e[46]!==R||e[47]!==Y||e[48]!==ae||e[49]!==z||e[50]!==J||e[51]!==O?(Z=t.jsxs("div",{ref:N,style:w,...S,...p,role:P,tabIndex:I,onClick:d,onKeyDown:O,className:R,children:[Y,ae,z,J]}),e[41]=S,e[42]=p,e[43]=d,e[44]=N,e[45]=w,e[46]=R,e[47]=Y,e[48]=ae,e[49]=z,e[50]=J,e[51]=O,e[52]=Z):Z=e[52],Z}function vr(r){return r.stopPropagation()}function xr(r){return r.stopPropagation()}function br(r){return r.stopPropagation()}function yr(r){return r.stopPropagation()}function Sr(){return!1}function _r(r){const e=$e.c(88),{listKey:n,rawSections:a,sections:c,meta:u,selectedIndex:h,onSelect:d,onReorder:i,onDelete:g,onDuplicate:v,onMakeReusable:x,onToggleHidden:y,onToggleLazy:_,onAddSection:o,canAddSection:S}=r,p=S===void 0?!0:S;let N;e[0]!==c.length?(N=()=>Ns(c.length),e[0]=c.length,e[1]=N):N=e[1];const[f,j]=T.useState(N),[C,k]=T.useState(null),[V,w]=T.useState(n),[$,D]=T.useState(c.length),P=T.useRef(!1);V!==n?(w(n),D(c.length),j(Ns(c.length))):$!==c.length&&(D(c.length),j(le=>hr(le,c.length)));let I;e[2]===Symbol.for("react.memo_cache_sentinel")?(I={activationConstraint:{distance:8}},e[2]=I):I=e[2];let O;e[3]===Symbol.for("react.memo_cache_sentinel")?(O={coordinateGetter:Ys},e[3]=O):O=e[3];const M=Fs(vt(Ks,I),vt(Bs,O));let R;e[4]!==f?(R=f.map(jr),e[4]=f,e[5]=R):R=e[5];const Y=R;let ae;e[6]===Symbol.for("react.memo_cache_sentinel")?(ae=le=>{k(String(le.active.id))},e[6]=ae):ae=e[6];const z=ae;let ie;e[7]!==Y||e[8]!==i?(ie=le=>{k(null);const{active:A,over:U}=le;if(!U||A.id===U.id)return;const Me=Y.indexOf(String(A.id)),Oe=Y.indexOf(String(U.id));Me===-1||Oe===-1||(j(He=>Zs(xt([...He],Me,Oe))),P.current=!0,requestAnimationFrame(()=>{P.current=!1}),i?.(Me,Oe))},e[7]=Y,e[8]=i,e[9]=ie):ie=e[9];const K=ie;let X;e[10]===Symbol.for("react.memo_cache_sentinel")?(X=()=>{k(null)},e[10]=X):X=e[10];const re=X;let te,W,G,q,J,Z,H,Ne,ee,be,ye,Ce,_e,Se,Te;if(e[11]!==C||e[12]!==p||e[13]!==f||e[14]!==Y||e[15]!==K||e[16]!==u||e[17]!==o||e[18]!==g||e[19]!==v||e[20]!==x||e[21]!==d||e[22]!==y||e[23]!==_||e[24]!==a||e[25]!==c||e[26]!==h||e[27]!==M){Se=Symbol.for("react.early_return_sentinel");e:{const le=A=>{P.current||d(A)};if(e[43]!==C||e[44]!==p||e[45]!==f||e[46]!==o||e[47]!==a||e[48]!==c){const A=C?f.find(U=>U.id===C):null;if(q=A!=null?c[A.index]:null,G=A!=null?a[A.index]:void 0,f.length===0){let U;e[52]===Symbol.for("react.memo_cache_sentinel")?(U=t.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:"No sections in this page."}),e[52]=U):U=e[52];const Me=!p;let Oe;e[53]===Symbol.for("react.memo_cache_sentinel")?(Oe=t.jsx(Kt,{size:14}),e[53]=Oe):Oe=e[53];let He;e[54]!==o||e[55]!==Me?(He=t.jsxs("div",{className:"space-y-2",children:[U,t.jsxs(Ve,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Me,onClick:o,children:[Oe,"Add section"]})]}),e[54]=o,e[55]=Me,e[56]=He):He=e[56],Se=He;break e}_e=me(A&&"cursor-grabbing"),e[43]=C,e[44]=p,e[45]=f,e[46]=o,e[47]=a,e[48]=c,e[49]=G,e[50]=q,e[51]=_e}else G=e[49],q=e[50],_e=e[51];W=qs,Ne=M,ee=Ws,be=z,ye=K,Ce=re,te=Gs,Z=Y,H=za,Te="space-y-1",J=f.map(A=>{const U=c[A.index];return U?t.jsx(gr,{sortableId:A.id,section:U,raw:a[A.index],meta:u,selected:h===A.index,onSelect:()=>le(A.index),onDelete:()=>g(A.index),onDuplicate:()=>v(A.index),onMakeReusable:()=>x(A.index),onToggleHidden:()=>y(A.index),onToggleLazy:()=>_(A.index)},A.id):null})}e[11]=C,e[12]=p,e[13]=f,e[14]=Y,e[15]=K,e[16]=u,e[17]=o,e[18]=g,e[19]=v,e[20]=x,e[21]=d,e[22]=y,e[23]=_,e[24]=a,e[25]=c,e[26]=h,e[27]=M,e[28]=te,e[29]=W,e[30]=G,e[31]=q,e[32]=J,e[33]=Z,e[34]=H,e[35]=Ne,e[36]=ee,e[37]=be,e[38]=ye,e[39]=Ce,e[40]=_e,e[41]=Se,e[42]=Te}else te=e[28],W=e[29],G=e[30],q=e[31],J=e[32],Z=e[33],H=e[34],Ne=e[35],ee=e[36],be=e[37],ye=e[38],Ce=e[39],_e=e[40],Se=e[41],Te=e[42];if(Se!==Symbol.for("react.early_return_sentinel"))return Se;let je;e[57]!==J||e[58]!==Te?(je=t.jsx("div",{className:Te,children:J}),e[57]=J,e[58]=Te,e[59]=je):je=e[59];let Re;e[60]!==te||e[61]!==Z||e[62]!==H||e[63]!==je?(Re=t.jsx(te,{items:Z,strategy:H,children:je}),e[60]=te,e[61]=Z,e[62]=H,e[63]=je,e[64]=Re):Re=e[64];let fe;e[65]!==G||e[66]!==q||e[67]!==u?(fe=q?t.jsx("div",{className:me("cursor-grabbing shadow-lg ring-1 ring-border/60",Xs(q,!1)),children:t.jsx(Qs,{section:q,raw:G,meta:u})}):null,e[65]=G,e[66]=q,e[67]=u,e[68]=fe):fe=e[68];let Ie;e[69]!==fe?(Ie=t.jsx(Js,{dropAnimation:null,children:fe}),e[69]=fe,e[70]=Ie):Ie=e[70];let ke;e[71]!==W||e[72]!==Ne||e[73]!==ee||e[74]!==be||e[75]!==ye||e[76]!==Ce||e[77]!==Re||e[78]!==Ie?(ke=t.jsxs(W,{sensors:Ne,collisionDetection:ee,onDragStart:be,onDragEnd:ye,onDragCancel:Ce,children:[Re,Ie]}),e[71]=W,e[72]=Ne,e[73]=ee,e[74]=be,e[75]=ye,e[76]=Ce,e[77]=Re,e[78]=Ie,e[79]=ke):ke=e[79];const we=!p;let pe;e[80]===Symbol.for("react.memo_cache_sentinel")?(pe=t.jsx(Kt,{size:14}),e[80]=pe):pe=e[80];let De;e[81]!==o||e[82]!==we?(De=t.jsxs(Ve,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:we,onClick:o,children:[pe,"Add section"]}),e[81]=o,e[82]=we,e[83]=De):De=e[83];let oe;return e[84]!==_e||e[85]!==ke||e[86]!==De?(oe=t.jsxs("div",{className:_e,children:[ke,De]}),e[84]=_e,e[85]=ke,e[86]=De,e[87]=oe):oe=e[87],oe}function jr(r){return r.id}const kr=[[/always|matchalways/i,"Users03"],[/device|matchdevice/i,"Phone02"],[/date|matchdate/i,"Calendar"],[/random|matchrandom/i,"Shuffle01"],[/host|matchhost/i,"Globe02"],[/location|matchlocation/i,"MarkerPin01"],[/pathname/i,"Link03"],[/cron|matchcron/i,"Clock"],[/multi|matchmulti/i,"FilterLines"],[/never|matchnever/i,"EyeOff"],[/environment|matchenvironment/i,"Cloud01"],[/eq\.ts|\/eq$/i,"Brackets"],[/user|requser|isdecouser/i,"User01"],[/site|template/i,"LayoutAlt01"]],wr={"device-mobile":"Phone02","device-desktop":"Monitor01","device-tablet":"Tablet01","calendar-event":"Calendar","calendar-month":"Calendar",clock:"Clock","current-location":"MarkerPin01","map-2":"MarkerPin01","world-search":"Globe02",shuffle:"Shuffle01",filter:"FilterLines","eye-off":"EyeOff",flask:"Beaker02",link:"Link03","git-merge":"GitBranch01",users:"Users03",flag:"Flag01","cloud-storm":"Cloud01",campaign:"Announcement01",experiment:"Beaker02",language:"Globe02","hand-click":"CursorClick01"};function Ft(r){return bt(r)!==void 0}function Zt(r,e){if(e){if(Ft(e))return e;const n=wr[e];if(n&&Ft(n))return n}for(const[n,a]of kr)if(n.test(r)&&Ft(a))return a;return"FilterLines"}function Nr(r){return bt(r)??nr}function Cs(r){const e=$e.c(11),{iconName:n,size:a,className:c}=r,u=a===void 0?"md":a;let h;e[0]!==n?(h=Nr(n),e[0]=n,e[1]=h):h=e[1];const d=h,i=u==="sm"?"size-7":"size-9",g=u==="sm"?16:18;let v;e[2]!==i||e[3]!==c?(v=me("flex shrink-0 items-center justify-center rounded-full bg-muted",i,c),e[2]=i,e[3]=c,e[4]=v):v=e[4];let x;e[5]!==d||e[6]!==g?(x=t.jsx(d,{size:g,className:"text-muted-foreground"}),e[5]=d,e[6]=g,e[7]=x):x=e[7];let y;return e[8]!==v||e[9]!==x?(y=t.jsx("div",{className:v,children:x}),e[8]=v,e[9]=x,e[10]=y):y=e[10],y}const en="Users03";function Cr(r){const e=r.manifest?.blocks??{},n=[];for(const[a,c]of Object.entries(e))if(a.includes("matchers"))for(const u of Object.keys(c)){if(u.includes("always"))continue;const h=ia(u,r);n.push({resolveType:u,title:h.title??Ke(u),description:h.description,iconName:Zt(u,h.icon)})}return n}function Tr(r,e){if(!r)return en;const n=e.find(a=>a.resolveType===r);return n?n.iconName:Zt(r)}function Ts(r){const e=$e.c(41),{currentRt:n,currentLabel:a,matchers:c,onSelect:u}=r,[h,d]=T.useState(!1);let i;if(e[0]!==n||e[1]!==c){const M=Tr(n,c);i=bt(M),e[0]=n,e[1]=c,e[2]=i}else i=e[2];const g=i;let v;e[3]!==u?(v=M=>{u(M),d(!1)},e[3]=u,e[4]=v):v=e[4];const x=v;let y;e[5]===Symbol.for("react.memo_cache_sentinel")?(y=()=>d(!0),e[5]=y):y=e[5];let _;e[6]!==g?(_=g&&t.jsx(g,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),e[6]=g,e[7]=_):_=e[7];let o;e[8]!==a?(o=t.jsx("span",{className:"flex-1 truncate",children:a}),e[8]=a,e[9]=o):o=e[9];let S;e[10]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(As,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),e[10]=S):S=e[10];let p;e[11]!==_||e[12]!==o?(p=t.jsxs("button",{type:"button",onClick:y,className:"flex h-10 w-full items-center gap-2 rounded-md border border-input bg-transparent px-3 text-left text-sm shadow-xs transition-colors hover:bg-accent/40 cursor-pointer",children:[_,o,S]}),e[11]=_,e[12]=o,e[13]=p):p=e[13];let N;e[14]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(Qa,{placeholder:"Search rules..."}),e[14]=N):N=e[14];let f;e[15]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Xa,{children:"No rules found."}),e[15]=f):f=e[15];let j;e[16]!==x?(j=()=>x(""),e[16]=x,e[17]=j):j=e[17];const C=!n&&"bg-accent/60";let k;e[18]!==C?(k=me("gap-2.5",C),e[18]=C,e[19]=k):k=e[19];let V;e[20]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx(Cs,{iconName:en,size:"sm"}),e[20]=V):V=e[20];let w;e[21]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[t.jsx("span",{className:"text-sm",children:"Always"}),t.jsx("span",{className:"text-xs text-muted-foreground",children:"Target all users"})]}),e[21]=w):w=e[21];let $;e[22]!==j||e[23]!==k?($=t.jsxs(js,{value:"always Target all users",onSelect:j,className:k,children:[V,w]}),e[22]=j,e[23]=k,e[24]=$):$=e[24];let D;if(e[25]!==n||e[26]!==x||e[27]!==c){let M;e[29]!==n||e[30]!==x?(M=R=>t.jsxs(js,{value:`${R.title} ${R.resolveType} ${R.description??""}`,onSelect:()=>x(R.resolveType),className:me("gap-2.5",n===R.resolveType&&"bg-accent/60"),children:[t.jsx(Cs,{iconName:R.iconName,size:"sm"}),t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[t.jsx("span",{className:"text-sm",children:R.title}),R.description&&t.jsx("span",{className:"truncate text-xs text-muted-foreground",children:R.description})]})]},R.resolveType),e[29]=n,e[30]=x,e[31]=M):M=e[31],D=c.map(M),e[25]=n,e[26]=x,e[27]=c,e[28]=D}else D=e[28];let P;e[32]!==$||e[33]!==D?(P=t.jsxs(er,{children:[f,t.jsxs(tr,{children:[$,D]})]}),e[32]=$,e[33]=D,e[34]=P):P=e[34];let I;e[35]!==h||e[36]!==P?(I=t.jsxs(sr,{open:h,onOpenChange:d,title:"Choose a rule",description:"Pick how to target users for this variant",className:"sm:max-w-lg",children:[N,P]}),e[35]=h,e[36]=P,e[37]=I):I=e[37];let O;return e[38]!==I||e[39]!==p?(O=t.jsxs(t.Fragment,{children:[p,I]}),e[38]=I,e[39]=p,e[40]=O):O=e[40],O}const Rr="oklch(0.65 0.15 160)",tn="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.22)]";function Qt(r){const e=$e.c(5),{rule:n,matchers:a}=r,c=n?.__resolveType??"";let u;if(e[0]!==a||e[1]!==c){const g=a.find(v=>v.resolveType===c)?.iconName??Zt(c);u=bt(g),e[0]=a,e[1]=c,e[2]=u}else u=e[2];const h=u;if(!h)return null;let d;return e[3]!==h?(d=t.jsx(h,{size:14,className:"shrink-0"}),e[3]=h,e[4]=d):d=e[4],d}function Rs(r){return r.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
1
+ import{e as $e,r as T,j as t,B as Ve,l as Ut,c as me,G as Wn,o as de,K as Gn}from"./index-D3avDGSl.js";import{t as As}from"./ChevronDown-CCxO1iHC.js";import{i as Jn}from"./ChevronRight-lhfqyrWN.js";import{n as Zn}from"./ChevronUp-CLwjbWR2.js";import{D as Yt,u as qt,g as bt,E as Qn,F as Xn,J as ea}from"./agent-icon-wPujIUBK.js";import{i as ta}from"./Globe01-zBlKP_6-.js";import{S as mt}from"./scroll-area-Bx3m3yDU.js";import{T as at,a as rt,b as ot}from"./tooltip-CLYxliPH.js";import{c as Es,b as Ms,e as Vs,d as $s,a as Os,D as Ls}from"./dialog-BM-B6vYl.js";import{I as Is}from"./input-B_SdLJQK.js";import{r as sa,i as ht,P as na,S as aa,N as ra,l as Ke,G as oa,a as ia,b as gt,u as la,c as ca,d as ua,e as da,f as ma,g as fa,h as pa,j as ha,k as ft,m as Vt,n as Ze,p as bs,o as ys,q as ga,s as $t,t as va,v as xa,w as ba,x as ya,y as Sa,z as _a,A as ja,B as pt,C as ka,D as wa,E as Na,F as Ca,H as Ta,I as Ra,J as Ot,K as Da,L as Pa,M as Aa,O as Lt,Q as Ea,R as Ma,T as Ss}from"./index-BdGmFa2i.js";import{s as Va,a as zs}from"./Eye-DszKjAh_.js";import{d as $a}from"./ZoomOut-D6zQtuQG.js";import{a as Oa}from"./RefreshCcw01-CAoB9uWy.js";import{s as Kt}from"./Plus-BtdUV_kH.js";import{s as yt}from"./Trash01-BNDy5NA1.js";import{i as La}from"./Zap-i9mqV9CQ.js";import{a as Wt,c as Qe,D as Gt,b as Jt,d as Ia}from"./dropdown-menu-C19ZNWpd.js";import{u as Fs,a as vt,K as Bs,P as Ks,b as Hs,C as Us,s as Ys,d as xt,D as qs,c as Ws,S as Gs,v as za,e as Js,h as Fa}from"./sortable.esm-YvQHAMTR.js";import{r as Ba,s as Ka,u as nt,S as Ht}from"./schema-form-B_4HLYio.js";import{r as _s,u as Ha,d as Ua,a as Ya,i as qa,f as Wa,P as Ga,b as Ja,S as Za}from"./page-seo-form-Df3uSm-C.js";import{c as Qa,C as Xa,e as js,d as er,a as tr,g as sr}from"./command-BZnSJmqd.js";import{i as nr}from"./FilterLines-CrUN88cw.js";import{i as ar}from"./Tool01-CkAXErK4.js";import{AddSectionModal as rr}from"./add-section-modal-B2fBeRMl.js";import{c as or}from"./save-referenced-block-BjWrJFGb.js";import"./AlertCircle-Dpuql2tA.js";import"./SwitchHorizontal01-fpn5Tlqs.js";import"./XCircle-HoAITbvP.js";import"./ArrowUpRight-CH6mYZOO.js";import"./ZapSquare-Cc-mw2AV.js";import"./Users03-Jto5sphL.js";import"./CheckCircle-D5ai157J.js";import"./Check-BjI-EvpJ.js";import"./ChevronLeft-Ct25Cl65.js";import"./DotsVertical-WqA4HYBY.js";import"./Container-CGpfG9bG.js";import"./Star01-C55T9Xua.js";import"./Palette-COi8V8YL.js";import"./HardDrive-By3Rrte_.js";import"./Stars02-B4BHhb0w.js";import"./Key01-Cu3bg6yn.js";import"./LayoutLeft-DOceuRg7.js";import"./LinkExternal01-Bk_Gx_-D.js";import"./Monitor01-5tYO2Ekc.js";import"./Sun-C1ZnnlCm.js";import"./Play-BH-zpYdk.js";import"./SearchMd-BNBDuE-K.js";import"./Settings02-BxDgDSaB.js";import"./Shield01-D9VCjdEs.js";import"./Stars01-Dd6qdACt.js";import"./Upload01-BO7_Z4bn.js";import"./User01-DeMZ-XKs.js";import"./Users01-stOb3vXo.js";import"./XClose-BPQwEKx4.js";import"./X-lJKMgTG7.js";import"./select-DiYyNvmX.js";import"./agent-capabilities-wznK9BHI.js";import"./chat-context-BdLaNmxp.js";import"./tab-id-DvPfRgA6.js";import"./use-mcp-client-BAkI6-zz.js";import"./decopilot-sse-pool-Dy3Ybf1a.js";import"./create-sse-subscription-BS5983N4.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./use-virtual-mcp-C5zuL_E7.js";import"./use-collections-C9JiLCv0.js";import"./use-ai-providers-gSn6Y0dv.js";import"./use-organization-settings-C6tKL2ZP.js";import"./pair-KxJNYeiQ.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-C-O6xHWZ.js";import"./file-type-icon-DmnLszYq.js";import"./content-blocks-o63cs2vh.js";import"./types-IfUTSINC.js";import"./shell-layout-eWp4Nk5r.js";import"./avatar-O07fEtT9.js";import"./required-auth-layout-COL8jak8.js";import"./useRouterState-DH4alGao.js";import"./use-org-sso-CQgcU4GU.js";import"./integration-icon-CgYiY5Wq.js";import"./use-navigate-to-agent-MrfRJ6_R.js";import"./use-connection-OZtQLVj4.js";import"./use-mcp-prompts-CKe6n-6G.js";import"./form-DBjBm7IQ.js";import"./label-aUygS1cE.js";import"./spinner-Dr0dOdTp.js";import"./drawer-JQlRpQyF.js";import"./collection-search-CqhY9IcC.js";import"./tabs-B2Lp9_Rb.js";import"./toggle-group-BWRV5ufK.js";import"./connect-desktop-dialog-DJbv98pa.js";import"./agent-icons-CwE4Nvhh.js";import"./checkbox-8ry6F5Z_.js";import"./skeleton-BDmWNgO1.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-Cwe7xf9d.js";import"./card-D8DKqFpf.js";import"./popover-DL8D0-VW.js";import"./useInfiniteQuery-C705CZaG.js";import"./infiniteQueryObserver-IkM6No7c.js";import"./index-39JbR6rj.js";import"./question-004-sINsf4GQ.js";import"./shell-route-loading-Bp9B1GvP.js";import"./sidebar-BHpe-htn.js";import"./sheet-B9j6H-QD.js";import"./toolbar-CTl3d0UA.js";import"./use-create-virtual-mcp-CbPrcMEl.js";import"./github-repo-picker-Bnhy53x0.js";import"./use-mcp-tools-CbSeRsSR.js";import"./extract-connection-data-DqXrg6J1.js";import"./generate-id-BxQ0AjQm.js";import"./collections-DmMaNw0X.js";import"./alert-dialog-CpmevCyT.js";import"./index-b_hlBJ5h.js";import"./use-org-auth-client-CW071Ufg.js";import"./hover-card-Dnzc18eH.js";import"./task-status-BOtiOo19.js";import"./use-status-sounds-D7Yisfh_.js";import"./empty-state-CylrC2-p.js";import"./resizable-0S2u7bsu.js";import"./use-capability-CVm9Y_d_.js";import"./header-tab-button-CxqCWXDs.js";import"./index-Eg0pRtTT.js";import"./textarea-DH43ASwp.js";import"./user-DstdXklV.js";import"./tools-list-DcTdEMeO.js";import"./badge-CK4KLPyS.js";import"./connection-slug-eyAPH6o3.js";import"./switch-BLWYQLl7.js";import"./use-debounced-autosave-CeLjrHSX.js";import"./index-ddLepuAa.js";import"./search-input-DSZAkjiG.js";import"./collection-tabs-D_p2N7sX.js";import"./use-secrets-BnqZjmY-.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./accordion-EsSKzC-q.js";import"./view-mode-toggle-CAEobvEk.js";import"./select-model-nnb41puG.js";import"./use-automations-xuRn6Qvs.js";import"./monaco-editor-d1joxmu_.js";import"./automation-runs-Ca1xKsFX.js";import"./table-CnJ9o1EX.js";import"./use-infinite-scroll-1ITAnm1X.js";import"./use-members-Biy7ZRor.js";import"./useSuspenseInfiniteQuery-t8UmhcjT.js";import"./automation-list-row-BuO1c5RQ.js";import"./connection-card-BKTCOn1-.js";import"./use-registry-connections-utBaLUfZ.js";import"./connection-form-helpers-SItL7ynJ.js";import"./calendar-Dm6Vzggf.js";import"./image-field-n6y2RcnV.js";import"./use-file-configs-D_jhf5KI.js";import"./index-CM9R_tIp.js";function ir(r){const e=$e.c(38),{open:n,initialName:a,autoLabel:c,isPending:u,onSubmit:h,onOpenChange:d}=r,i=u===void 0?!1:u,[g,v]=T.useState(a),[x,y]=T.useState(n);n!==x&&(y(n),n&&v(a));let _;e[0]!==i||e[1]!==d?(_=R=>{!R&&!i&&d(!1)},e[0]=i,e[1]=d,e[2]=_):_=e[2];const o=_;let S;e[3]!==i||e[4]!==g||e[5]!==h?(S=async R=>{R.preventDefault(),!i&&await h(g.trim())},e[3]=i,e[4]=g,e[5]=h,e[6]=S):S=e[6];const p=S;let N;e[7]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(Es,{children:"Rename variant"}),e[7]=N):N=e[7];const f=c||"the rule";let j;e[8]!==f?(j=t.jsxs(Ms,{children:[N,t.jsxs(Vs,{children:["Save this matcher as a global block with a custom label. Leave empty to inline the matcher again and fall back to"," ",t.jsx("span",{className:"font-medium",children:f}),"."]})]}),e[8]=f,e[9]=j):j=e[9];let C;e[10]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[10]=C):C=e[10];let k;e[11]===Symbol.for("react.memo_cache_sentinel")?(k=R=>v(R.target.value),e[11]=k):k=e[11];let V;e[12]!==c||e[13]!==i||e[14]!==g?(V=t.jsxs("div",{className:"space-y-1.5 py-4",children:[C,t.jsx(Is,{id:"variant-rename-name",value:g,onChange:k,placeholder:c,autoFocus:!0,disabled:i})]}),e[12]=c,e[13]=i,e[14]=g,e[15]=V):V=e[15];let w;e[16]!==d?(w=()=>d(!1),e[16]=d,e[17]=w):w=e[17];let $;e[18]!==i||e[19]!==w?($=t.jsx(Ve,{type:"button",variant:"outline",onClick:w,disabled:i,children:"Cancel"}),e[18]=i,e[19]=w,e[20]=$):$=e[20];let D;e[21]!==i?(D=i?t.jsxs(t.Fragment,{children:[t.jsx(Ut,{size:14,className:"animate-spin"}),"Saving…"]}):"Save",e[21]=i,e[22]=D):D=e[22];let P;e[23]!==i||e[24]!==D?(P=t.jsx(Ve,{type:"submit",disabled:i,children:D}),e[23]=i,e[24]=D,e[25]=P):P=e[25];let I;e[26]!==$||e[27]!==P?(I=t.jsxs($s,{children:[$,P]}),e[26]=$,e[27]=P,e[28]=I):I=e[28];let O;e[29]!==p||e[30]!==I||e[31]!==j||e[32]!==V?(O=t.jsx(Os,{className:"sm:max-w-md",children:t.jsxs("form",{onSubmit:p,children:[j,V,I]})}),e[29]=p,e[30]=I,e[31]=j,e[32]=V,e[33]=O):O=e[33];let M;return e[34]!==o||e[35]!==n||e[36]!==O?(M=t.jsx(Ls,{open:n,onOpenChange:o,children:O}),e[34]=o,e[35]=n,e[36]=O,e[37]=M):M=e[37],M}function It(r,e,n,a,c){const u={...r[e]};if(c.length>1){const h=u.sections,d=[...h?.variants??[]];d[a]&&(d[a]={...d[a],value:n}),u.sections={...h,variants:d}}else u.sections=n;return u}function lr(r){return structuredClone(r)}function cr(r){return!r.isSavedBlock&&!r.isMultivariate}function ks(r){const e=r.replace(/[^A-Za-z0-9_-]/g,"");return/^[A-Za-z]/.test(e)?e:e?`Block${e}`:""}function ws(r,e){const n=r.trim();return n?n.includes("/")?"Block name cannot contain slashes.":Object.hasOwn(e,n)?"A block with this name already exists.":/^[A-Za-z][A-Za-z0-9_-]*$/.test(n)?null:"Use letters, numbers, hyphens, or underscores. Must start with a letter.":"Block name is required."}function ur(r){return r.schema?.definitions??r.schema?.$defs??{}}function dr(r,e){const n=ur(e),a=n[btoa(r)];if(!a)return;let c=typeof a.image=="string"?a.image:void 0;if(!c&&Array.isArray(a.allOf)){const u=a.allOf.find(h=>typeof h.$ref=="string")?.$ref;if(typeof u=="string"){const h=u.replace("#/definitions/",""),d=n[h];c=typeof d?.image=="string"?d.image:void 0}}if(c?.includes("{{{"))return c}function mr(r,e){if(!e)return;const n=sa(r);if(!n)return;const a=dr(n.resolveType,e);if(!a)return;const c=Ba(a,n.data);if(c)return Ka(c)}function zt(r,e){return r.map((n,a)=>{const c=n.__resolveType??"",u=ht(c);if(!u&&c!==""&&!c.includes("/")&&c in e){const g=e[c],v=typeof g?.name=="string"&&g.name||c.replace(/[-_]/g," ").replace(/\b\w/g,x=>x.toUpperCase())||`Section ${a+1}`;return{index:a,resolveType:c,label:v,isLazy:!1,isSavedBlock:!0}}const h=u?n.section:void 0,d=u?h?.__resolveType??"":c;if(d===na||d===aa){const g=u?h:n,v=Array.isArray(g?.variants)?g.variants:[];if(v.length===1&&(v[0]?.rule?.__resolveType??"")===ra){const _=v[0]?.value??{};let o=_.__resolveType??"";const S=ht(o);return S&&(o=_.section?.__resolveType??o),{index:a,resolveType:c,label:Ke(o)||`Section ${a+1}`,isHidden:!0,isLazy:S}}const x=v[0]?.value?.__resolveType,y=x?Ke(x):"Section";return{index:a,resolveType:c,label:`Variants of ${y}`,isMultivariate:!0,isLazy:u}}const i=u?n.section?.__resolveType??c:c;if(u&&i!==""&&!i.includes("/")&&i in e){const g=e[i],v=typeof g?.name=="string"&&g.name||i.replace(/[-_]/g," ").replace(/\b\w/g,x=>x.toUpperCase())||`Section ${a+1}`;return{index:a,resolveType:c,label:v,isLazy:!0,isSavedBlock:!0}}return{index:a,resolveType:c,label:Ke(i)||`Section ${a+1}`,isLazy:u}})}const fr="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",pr="text-global-section-fg focus:bg-global-section/12 focus:text-global-section-fg dark:text-global-section-fg-dark dark:focus:bg-global-section/15 dark:focus:text-global-section-fg-dark [&_svg]:!text-global-section";function Ns(r){return Array.from({length:r},(e,n)=>({id:crypto.randomUUID(),index:n}))}function Zs(r){return r.map((e,n)=>({...e,index:n}))}function hr(r,e){if(e===r.length)return r;if(e<r.length)return Zs(r.slice(0,e));const n=Array.from({length:e-r.length},(a,c)=>({id:crypto.randomUUID(),index:r.length+c}));return[...r,...n]}function Qs(r){const e=$e.c(20),{section:n,raw:a,meta:c}=r,u=n.isSavedBlock===!0,h=n.isMultivariate===!0;let d;e[0]!==c||e[1]!==a?(d=a&&c?mr(a,c):void 0,e[0]=c,e[1]=a,e[2]=d):d=e[2];const i=d;let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx($a,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[3]=g):g=e[3];let v;e[4]!==i?(v=i&&t.jsx("img",{src:i,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[4]=i,e[5]=v):v=e[5];let x;e[6]!==h||e[7]!==u?(x=u?{color:oa}:h?{color:"oklch(0.65 0.15 160)"}:void 0,e[6]=h,e[7]=u,e[8]=x):x=e[8];let y;e[9]!==x?(y=t.jsx(Yt,{className:"h-4 w-4 shrink-0",style:x}),e[9]=x,e[10]=y):y=e[10];const _=n.isHidden&&"line-through opacity-50";let o;e[11]!==_?(o=me("min-w-0 flex-1 truncate text-sm font-medium",_),e[11]=_,e[12]=o):o=e[12];let S;e[13]!==n.label||e[14]!==o?(S=t.jsx("span",{className:o,children:n.label}),e[13]=n.label,e[14]=o,e[15]=S):S=e[15];let p;return e[16]!==v||e[17]!==y||e[18]!==S?(p=t.jsxs(t.Fragment,{children:[g,v,y,S]}),e[16]=v,e[17]=y,e[18]=S,e[19]=p):p=e[19],p}function Xs(r,e){const n=r.isSavedBlock===!0,a=r.isMultivariate===!0;return me("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":n?fr:a?"text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]":"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function gr(r){const e=$e.c(53),{section:n,raw:a,meta:c,sortableId:u,selected:h,onSelect:d,onDelete:i,onDuplicate:g,onMakeReusable:v,onToggleHidden:x,onToggleLazy:y}=r,_=a?ht(a.__resolveType??""):!1;let o;e[0]!==u?(o={id:u,animateLayoutChanges:Sr},e[0]=u,e[1]=o):o=e[1];const{attributes:S,listeners:p,setNodeRef:N,transform:f,isDragging:j}=Hs(o);let C;e[2]!==f?(C=Us.Transform.toString(f?{...f,x:0}:null),e[2]=f,e[3]=C):C=e[3];const k=j?0:void 0;let V;e[4]!==C||e[5]!==k?(V={transform:C,opacity:k},e[4]=C,e[5]=k,e[6]=V):V=e[6];const w=V;let $;e[7]!==n?($=cr(n),e[7]=n,e[8]=$):$=e[8];const D=$,P="button",I=0;let O;e[9]!==d?(O=H=>{(H.key==="Enter"||H.key===" ")&&(H.preventDefault(),d())},e[9]=d,e[10]=O):O=e[10];const M=j?"cursor-grabbing":"cursor-pointer";let R;e[11]!==n||e[12]!==h||e[13]!==M?(R=me("touch-none transition-colors",M,Xs(n,h)),e[11]=n,e[12]=h,e[13]=M,e[14]=R):R=e[14];let Y;e[15]!==c||e[16]!==a||e[17]!==n?(Y=t.jsx(Qs,{section:n,raw:a,meta:c}),e[15]=c,e[16]=a,e[17]=n,e[18]=Y):Y=e[18];const ae=!n.isMultivariate&&t.jsx(Ve,{type:"button",variant:"ghost",size:"icon","aria-label":_?"Disable async render":"Enable async render",className:me("h-7 w-7 shrink-0",_?"":"opacity-0 group-hover:opacity-100"),onClick:H=>{H.stopPropagation(),y()},onPointerDown:yr,children:t.jsx(La,{className:me("h-3.5 w-3.5",_&&"text-yellow-500")})});let z;e[19]!==x||e[20]!==n.isHidden||e[21]!==n.isMultivariate?(z=!n.isMultivariate&&t.jsx(Ve,{type:"button",variant:"ghost",size:"icon","aria-label":n.isHidden?"Show section":"Hide section",className:me("h-7 w-7 shrink-0",n.isHidden?"opacity-100":"opacity-0 group-hover:opacity-100"),onClick:H=>{H.stopPropagation(),x()},onPointerDown:br,children:n.isHidden?t.jsx(Oa,{className:"h-3.5 w-3.5"}):t.jsx(Va,{className:"h-3.5 w-3.5"})}),e[19]=x,e[20]=n.isHidden,e[21]=n.isMultivariate,e[22]=z):z=e[22];let ie;e[23]===Symbol.for("react.memo_cache_sentinel")?(ie=t.jsx(Wt,{asChild:!0,children:t.jsx(Ve,{type:"button",variant:"ghost",size:"icon","aria-label":"Section actions",className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100",onClick:xr,onPointerDown:vr,children:t.jsx(qt,{className:"h-3.5 w-3.5"})})}),e[23]=ie):ie=e[23];let K;e[24]!==g?(K=H=>{H.stopPropagation(),g()},e[24]=g,e[25]=K):K=e[25];let X;e[26]===Symbol.for("react.memo_cache_sentinel")?(X=t.jsx(zs,{className:"h-4 w-4"}),e[26]=X):X=e[26];let re;e[27]!==K?(re=t.jsxs(Qe,{onClick:K,children:[X,"Duplicate"]}),e[27]=K,e[28]=re):re=e[28];let te;e[29]!==D||e[30]!==v?(te=D&&t.jsxs(Qe,{className:pr,onClick:H=>{H.stopPropagation(),v()},children:[t.jsx(Yt,{className:"h-4 w-4"}),"Make reusable"]}),e[29]=D,e[30]=v,e[31]=te):te=e[31];let W;e[32]!==i?(W=H=>{H.stopPropagation(),i()},e[32]=i,e[33]=W):W=e[33];let G;e[34]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx(yt,{className:"h-4 w-4"}),e[34]=G):G=e[34];let q;e[35]!==W?(q=t.jsxs(Qe,{className:"text-destructive focus:text-destructive",onClick:W,children:[G,"Delete"]}),e[35]=W,e[36]=q):q=e[36];let J;e[37]!==re||e[38]!==te||e[39]!==q?(J=t.jsxs(Gt,{children:[ie,t.jsxs(Jt,{align:"end",className:"w-44",children:[re,te,q]})]}),e[37]=re,e[38]=te,e[39]=q,e[40]=J):J=e[40];let Z;return e[41]!==S||e[42]!==p||e[43]!==d||e[44]!==N||e[45]!==w||e[46]!==R||e[47]!==Y||e[48]!==ae||e[49]!==z||e[50]!==J||e[51]!==O?(Z=t.jsxs("div",{ref:N,style:w,...S,...p,role:P,tabIndex:I,onClick:d,onKeyDown:O,className:R,children:[Y,ae,z,J]}),e[41]=S,e[42]=p,e[43]=d,e[44]=N,e[45]=w,e[46]=R,e[47]=Y,e[48]=ae,e[49]=z,e[50]=J,e[51]=O,e[52]=Z):Z=e[52],Z}function vr(r){return r.stopPropagation()}function xr(r){return r.stopPropagation()}function br(r){return r.stopPropagation()}function yr(r){return r.stopPropagation()}function Sr(){return!1}function _r(r){const e=$e.c(88),{listKey:n,rawSections:a,sections:c,meta:u,selectedIndex:h,onSelect:d,onReorder:i,onDelete:g,onDuplicate:v,onMakeReusable:x,onToggleHidden:y,onToggleLazy:_,onAddSection:o,canAddSection:S}=r,p=S===void 0?!0:S;let N;e[0]!==c.length?(N=()=>Ns(c.length),e[0]=c.length,e[1]=N):N=e[1];const[f,j]=T.useState(N),[C,k]=T.useState(null),[V,w]=T.useState(n),[$,D]=T.useState(c.length),P=T.useRef(!1);V!==n?(w(n),D(c.length),j(Ns(c.length))):$!==c.length&&(D(c.length),j(le=>hr(le,c.length)));let I;e[2]===Symbol.for("react.memo_cache_sentinel")?(I={activationConstraint:{distance:8}},e[2]=I):I=e[2];let O;e[3]===Symbol.for("react.memo_cache_sentinel")?(O={coordinateGetter:Ys},e[3]=O):O=e[3];const M=Fs(vt(Ks,I),vt(Bs,O));let R;e[4]!==f?(R=f.map(jr),e[4]=f,e[5]=R):R=e[5];const Y=R;let ae;e[6]===Symbol.for("react.memo_cache_sentinel")?(ae=le=>{k(String(le.active.id))},e[6]=ae):ae=e[6];const z=ae;let ie;e[7]!==Y||e[8]!==i?(ie=le=>{k(null);const{active:A,over:U}=le;if(!U||A.id===U.id)return;const Me=Y.indexOf(String(A.id)),Oe=Y.indexOf(String(U.id));Me===-1||Oe===-1||(j(He=>Zs(xt([...He],Me,Oe))),P.current=!0,requestAnimationFrame(()=>{P.current=!1}),i?.(Me,Oe))},e[7]=Y,e[8]=i,e[9]=ie):ie=e[9];const K=ie;let X;e[10]===Symbol.for("react.memo_cache_sentinel")?(X=()=>{k(null)},e[10]=X):X=e[10];const re=X;let te,W,G,q,J,Z,H,Ne,ee,be,ye,Ce,_e,Se,Te;if(e[11]!==C||e[12]!==p||e[13]!==f||e[14]!==Y||e[15]!==K||e[16]!==u||e[17]!==o||e[18]!==g||e[19]!==v||e[20]!==x||e[21]!==d||e[22]!==y||e[23]!==_||e[24]!==a||e[25]!==c||e[26]!==h||e[27]!==M){Se=Symbol.for("react.early_return_sentinel");e:{const le=A=>{P.current||d(A)};if(e[43]!==C||e[44]!==p||e[45]!==f||e[46]!==o||e[47]!==a||e[48]!==c){const A=C?f.find(U=>U.id===C):null;if(q=A!=null?c[A.index]:null,G=A!=null?a[A.index]:void 0,f.length===0){let U;e[52]===Symbol.for("react.memo_cache_sentinel")?(U=t.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:"No sections in this page."}),e[52]=U):U=e[52];const Me=!p;let Oe;e[53]===Symbol.for("react.memo_cache_sentinel")?(Oe=t.jsx(Kt,{size:14}),e[53]=Oe):Oe=e[53];let He;e[54]!==o||e[55]!==Me?(He=t.jsxs("div",{className:"space-y-2",children:[U,t.jsxs(Ve,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Me,onClick:o,children:[Oe,"Add section"]})]}),e[54]=o,e[55]=Me,e[56]=He):He=e[56],Se=He;break e}_e=me(A&&"cursor-grabbing"),e[43]=C,e[44]=p,e[45]=f,e[46]=o,e[47]=a,e[48]=c,e[49]=G,e[50]=q,e[51]=_e}else G=e[49],q=e[50],_e=e[51];W=qs,Ne=M,ee=Ws,be=z,ye=K,Ce=re,te=Gs,Z=Y,H=za,Te="space-y-1",J=f.map(A=>{const U=c[A.index];return U?t.jsx(gr,{sortableId:A.id,section:U,raw:a[A.index],meta:u,selected:h===A.index,onSelect:()=>le(A.index),onDelete:()=>g(A.index),onDuplicate:()=>v(A.index),onMakeReusable:()=>x(A.index),onToggleHidden:()=>y(A.index),onToggleLazy:()=>_(A.index)},A.id):null})}e[11]=C,e[12]=p,e[13]=f,e[14]=Y,e[15]=K,e[16]=u,e[17]=o,e[18]=g,e[19]=v,e[20]=x,e[21]=d,e[22]=y,e[23]=_,e[24]=a,e[25]=c,e[26]=h,e[27]=M,e[28]=te,e[29]=W,e[30]=G,e[31]=q,e[32]=J,e[33]=Z,e[34]=H,e[35]=Ne,e[36]=ee,e[37]=be,e[38]=ye,e[39]=Ce,e[40]=_e,e[41]=Se,e[42]=Te}else te=e[28],W=e[29],G=e[30],q=e[31],J=e[32],Z=e[33],H=e[34],Ne=e[35],ee=e[36],be=e[37],ye=e[38],Ce=e[39],_e=e[40],Se=e[41],Te=e[42];if(Se!==Symbol.for("react.early_return_sentinel"))return Se;let je;e[57]!==J||e[58]!==Te?(je=t.jsx("div",{className:Te,children:J}),e[57]=J,e[58]=Te,e[59]=je):je=e[59];let Re;e[60]!==te||e[61]!==Z||e[62]!==H||e[63]!==je?(Re=t.jsx(te,{items:Z,strategy:H,children:je}),e[60]=te,e[61]=Z,e[62]=H,e[63]=je,e[64]=Re):Re=e[64];let fe;e[65]!==G||e[66]!==q||e[67]!==u?(fe=q?t.jsx("div",{className:me("cursor-grabbing shadow-lg ring-1 ring-border/60",Xs(q,!1)),children:t.jsx(Qs,{section:q,raw:G,meta:u})}):null,e[65]=G,e[66]=q,e[67]=u,e[68]=fe):fe=e[68];let Ie;e[69]!==fe?(Ie=t.jsx(Js,{dropAnimation:null,children:fe}),e[69]=fe,e[70]=Ie):Ie=e[70];let ke;e[71]!==W||e[72]!==Ne||e[73]!==ee||e[74]!==be||e[75]!==ye||e[76]!==Ce||e[77]!==Re||e[78]!==Ie?(ke=t.jsxs(W,{sensors:Ne,collisionDetection:ee,onDragStart:be,onDragEnd:ye,onDragCancel:Ce,children:[Re,Ie]}),e[71]=W,e[72]=Ne,e[73]=ee,e[74]=be,e[75]=ye,e[76]=Ce,e[77]=Re,e[78]=Ie,e[79]=ke):ke=e[79];const we=!p;let pe;e[80]===Symbol.for("react.memo_cache_sentinel")?(pe=t.jsx(Kt,{size:14}),e[80]=pe):pe=e[80];let De;e[81]!==o||e[82]!==we?(De=t.jsxs(Ve,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:we,onClick:o,children:[pe,"Add section"]}),e[81]=o,e[82]=we,e[83]=De):De=e[83];let oe;return e[84]!==_e||e[85]!==ke||e[86]!==De?(oe=t.jsxs("div",{className:_e,children:[ke,De]}),e[84]=_e,e[85]=ke,e[86]=De,e[87]=oe):oe=e[87],oe}function jr(r){return r.id}const kr=[[/always|matchalways/i,"Users03"],[/device|matchdevice/i,"Phone02"],[/date|matchdate/i,"Calendar"],[/random|matchrandom/i,"Shuffle01"],[/host|matchhost/i,"Globe02"],[/location|matchlocation/i,"MarkerPin01"],[/pathname/i,"Link03"],[/cron|matchcron/i,"Clock"],[/multi|matchmulti/i,"FilterLines"],[/never|matchnever/i,"EyeOff"],[/environment|matchenvironment/i,"Cloud01"],[/eq\.ts|\/eq$/i,"Brackets"],[/user|requser|isdecouser/i,"User01"],[/site|template/i,"LayoutAlt01"]],wr={"device-mobile":"Phone02","device-desktop":"Monitor01","device-tablet":"Tablet01","calendar-event":"Calendar","calendar-month":"Calendar",clock:"Clock","current-location":"MarkerPin01","map-2":"MarkerPin01","world-search":"Globe02",shuffle:"Shuffle01",filter:"FilterLines","eye-off":"EyeOff",flask:"Beaker02",link:"Link03","git-merge":"GitBranch01",users:"Users03",flag:"Flag01","cloud-storm":"Cloud01",campaign:"Announcement01",experiment:"Beaker02",language:"Globe02","hand-click":"CursorClick01"};function Ft(r){return bt(r)!==void 0}function Zt(r,e){if(e){if(Ft(e))return e;const n=wr[e];if(n&&Ft(n))return n}for(const[n,a]of kr)if(n.test(r)&&Ft(a))return a;return"FilterLines"}function Nr(r){return bt(r)??nr}function Cs(r){const e=$e.c(11),{iconName:n,size:a,className:c}=r,u=a===void 0?"md":a;let h;e[0]!==n?(h=Nr(n),e[0]=n,e[1]=h):h=e[1];const d=h,i=u==="sm"?"size-7":"size-9",g=u==="sm"?16:18;let v;e[2]!==i||e[3]!==c?(v=me("flex shrink-0 items-center justify-center rounded-full bg-muted",i,c),e[2]=i,e[3]=c,e[4]=v):v=e[4];let x;e[5]!==d||e[6]!==g?(x=t.jsx(d,{size:g,className:"text-muted-foreground"}),e[5]=d,e[6]=g,e[7]=x):x=e[7];let y;return e[8]!==v||e[9]!==x?(y=t.jsx("div",{className:v,children:x}),e[8]=v,e[9]=x,e[10]=y):y=e[10],y}const en="Users03";function Cr(r){const e=r.manifest?.blocks??{},n=[];for(const[a,c]of Object.entries(e))if(a.includes("matchers"))for(const u of Object.keys(c)){if(u.includes("always"))continue;const h=ia(u,r);n.push({resolveType:u,title:h.title??Ke(u),description:h.description,iconName:Zt(u,h.icon)})}return n}function Tr(r,e){if(!r)return en;const n=e.find(a=>a.resolveType===r);return n?n.iconName:Zt(r)}function Ts(r){const e=$e.c(41),{currentRt:n,currentLabel:a,matchers:c,onSelect:u}=r,[h,d]=T.useState(!1);let i;if(e[0]!==n||e[1]!==c){const M=Tr(n,c);i=bt(M),e[0]=n,e[1]=c,e[2]=i}else i=e[2];const g=i;let v;e[3]!==u?(v=M=>{u(M),d(!1)},e[3]=u,e[4]=v):v=e[4];const x=v;let y;e[5]===Symbol.for("react.memo_cache_sentinel")?(y=()=>d(!0),e[5]=y):y=e[5];let _;e[6]!==g?(_=g&&t.jsx(g,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),e[6]=g,e[7]=_):_=e[7];let o;e[8]!==a?(o=t.jsx("span",{className:"flex-1 truncate",children:a}),e[8]=a,e[9]=o):o=e[9];let S;e[10]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(As,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),e[10]=S):S=e[10];let p;e[11]!==_||e[12]!==o?(p=t.jsxs("button",{type:"button",onClick:y,className:"flex h-10 w-full items-center gap-2 rounded-md border border-input bg-transparent px-3 text-left text-sm shadow-xs transition-colors hover:bg-accent/40 cursor-pointer",children:[_,o,S]}),e[11]=_,e[12]=o,e[13]=p):p=e[13];let N;e[14]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(Qa,{placeholder:"Search rules..."}),e[14]=N):N=e[14];let f;e[15]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Xa,{children:"No rules found."}),e[15]=f):f=e[15];let j;e[16]!==x?(j=()=>x(""),e[16]=x,e[17]=j):j=e[17];const C=!n&&"bg-accent/60";let k;e[18]!==C?(k=me("gap-2.5",C),e[18]=C,e[19]=k):k=e[19];let V;e[20]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx(Cs,{iconName:en,size:"sm"}),e[20]=V):V=e[20];let w;e[21]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[t.jsx("span",{className:"text-sm",children:"Always"}),t.jsx("span",{className:"text-xs text-muted-foreground",children:"Target all users"})]}),e[21]=w):w=e[21];let $;e[22]!==j||e[23]!==k?($=t.jsxs(js,{value:"always Target all users",onSelect:j,className:k,children:[V,w]}),e[22]=j,e[23]=k,e[24]=$):$=e[24];let D;if(e[25]!==n||e[26]!==x||e[27]!==c){let M;e[29]!==n||e[30]!==x?(M=R=>t.jsxs(js,{value:`${R.title} ${R.resolveType} ${R.description??""}`,onSelect:()=>x(R.resolveType),className:me("gap-2.5",n===R.resolveType&&"bg-accent/60"),children:[t.jsx(Cs,{iconName:R.iconName,size:"sm"}),t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[t.jsx("span",{className:"text-sm",children:R.title}),R.description&&t.jsx("span",{className:"truncate text-xs text-muted-foreground",children:R.description})]})]},R.resolveType),e[29]=n,e[30]=x,e[31]=M):M=e[31],D=c.map(M),e[25]=n,e[26]=x,e[27]=c,e[28]=D}else D=e[28];let P;e[32]!==$||e[33]!==D?(P=t.jsxs(er,{children:[f,t.jsxs(tr,{children:[$,D]})]}),e[32]=$,e[33]=D,e[34]=P):P=e[34];let I;e[35]!==h||e[36]!==P?(I=t.jsxs(sr,{open:h,onOpenChange:d,title:"Choose a rule",description:"Pick how to target users for this variant",className:"sm:max-w-lg",children:[N,P]}),e[35]=h,e[36]=P,e[37]=I):I=e[37];let O;return e[38]!==I||e[39]!==p?(O=t.jsxs(t.Fragment,{children:[p,I]}),e[38]=I,e[39]=p,e[40]=O):O=e[40],O}const Rr="oklch(0.65 0.15 160)",tn="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.22)]";function Qt(r){const e=$e.c(5),{rule:n,matchers:a}=r,c=n?.__resolveType??"";let u;if(e[0]!==a||e[1]!==c){const g=a.find(v=>v.resolveType===c)?.iconName??Zt(c);u=bt(g),e[0]=a,e[1]=c,e[2]=u}else u=e[2];const h=u;if(!h)return null;let d;return e[3]!==h?(d=t.jsx(h,{size:14,className:"shrink-0"}),e[3]=h,e[4]=d):d=e[4],d}function Rs(r){return r.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
2
2
  `)}function Bt(r){return r.map((e,n)=>({id:crypto.randomUUID(),index:n,variant:e}))}function Dr(r){return r.map((e,n)=>({...e,index:n}))}function Pr(r){const e=$e.c(51),{entry:n,sortableId:a,isActive:c,canDelete:u,decofile:h,meta:d,matchers:i,onSelect:g,onRename:v,onDelete:x}=r;let y;e[0]!==a?(y={id:a,animateLayoutChanges:Mr},e[0]=a,e[1]=y):y=e[1];const{attributes:_,listeners:o,setNodeRef:S,transform:p,isDragging:N}=Hs(y);let f;e[2]!==p?(f=Us.Transform.toString(p?{...p,y:0}:null),e[2]=p,e[3]=f):f=e[3];const j=N?0:void 0;let C;e[4]!==f||e[5]!==j?(C={transform:f,opacity:j},e[4]=f,e[5]=j,e[6]=C):C=e[6];const k=C,V=d??void 0;let w;e[7]!==h||e[8]!==n.variant.rule||e[9]!==V?(w=gt(n.variant.rule,h,V),e[7]=h,e[8]=n.variant.rule,e[9]=V,e[10]=w):w=e[10];const $=w,D=c?tn:"text-muted-foreground hover:bg-muted hover:text-foreground",P=N?"cursor-grabbing":"cursor-grab";let I;e[11]!==D||e[12]!==P?(I=me("group shrink-0 inline-flex items-center rounded-md transition-colors touch-none",D,P),e[11]=D,e[12]=P,e[13]=I):I=e[13];let O;e[14]!==$||e[15]!==i?(O=t.jsx(Qt,{rule:$,matchers:i}),e[14]=$,e[15]=i,e[16]=O):O=e[16];let M;e[17]!==n.variant.label?(M=t.jsx("span",{className:"truncate",children:n.variant.label}),e[17]=n.variant.label,e[18]=M):M=e[18];let R;e[19]!==_||e[20]!==o||e[21]!==g||e[22]!==O||e[23]!==M?(R=t.jsxs("button",{type:"button",..._,...o,onClick:g,className:"inline-flex items-center gap-1.5 h-8 pl-3 pr-1.5 text-sm font-medium cursor-[inherit]",children:[O,M]}),e[19]=_,e[20]=o,e[21]=g,e[22]=O,e[23]=M,e[24]=R):R=e[24];const Y=`Actions for ${n.variant.label}`,ae=c&&"opacity-100";let z;e[25]!==ae?(z=me("inline-flex h-8 w-6 items-center justify-center pr-1 cursor-pointer transition-opacity","opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100",ae),e[25]=ae,e[26]=z):z=e[26];let ie;e[27]===Symbol.for("react.memo_cache_sentinel")?(ie=t.jsx(qt,{size:12}),e[27]=ie):ie=e[27];let K;e[28]!==Y||e[29]!==z?(K=t.jsx(Wt,{asChild:!0,children:t.jsx("button",{type:"button","aria-label":Y,onClick:Er,onPointerDown:Ar,className:z,children:ie})}),e[28]=Y,e[29]=z,e[30]=K):K=e[30];let X;e[31]===Symbol.for("react.memo_cache_sentinel")?(X=t.jsx(ar,{size:14}),e[31]=X):X=e[31];let re;e[32]!==v?(re=t.jsxs(Qe,{onClick:v,children:[X,"Rename"]}),e[32]=v,e[33]=re):re=e[33];let te;e[34]===Symbol.for("react.memo_cache_sentinel")?(te=t.jsx(Ia,{}),e[34]=te):te=e[34];const W=!u;let G;e[35]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx(yt,{size:14}),e[35]=G):G=e[35];let q;e[36]!==x||e[37]!==W?(q=t.jsxs(Qe,{variant:"destructive",disabled:W,onClick:x,children:[G,"Delete"]}),e[36]=x,e[37]=W,e[38]=q):q=e[38];let J;e[39]!==re||e[40]!==q?(J=t.jsxs(Jt,{align:"start",className:"w-36",children:[re,te,q]}),e[39]=re,e[40]=q,e[41]=J):J=e[41];let Z;e[42]!==K||e[43]!==J?(Z=t.jsxs(Gt,{children:[K,J]}),e[42]=K,e[43]=J,e[44]=Z):Z=e[44];let H;return e[45]!==S||e[46]!==k||e[47]!==R||e[48]!==Z||e[49]!==I?(H=t.jsxs("div",{ref:S,style:k,className:I,children:[R,Z]}),e[45]=S,e[46]=k,e[47]=R,e[48]=Z,e[49]=I,e[50]=H):H=e[50],H}function Ar(r){return r.stopPropagation()}function Er(r){return r.stopPropagation()}function Mr(){return!1}function Vr(r){const e=$e.c(13),{variant:n,decofile:a,meta:c,matchers:u}=r,h=c??void 0;let d;e[0]!==a||e[1]!==h||e[2]!==n.rule?(d=gt(n.rule,a,h),e[0]=a,e[1]=h,e[2]=n.rule,e[3]=d):d=e[3];const i=d;let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=me("inline-flex items-center gap-1.5 h-8 pl-3 pr-3 text-sm font-medium rounded-md shadow-lg ring-1 ring-border/60 cursor-grabbing",tn),e[4]=g):g=e[4];let v;e[5]!==i||e[6]!==u?(v=t.jsx(Qt,{rule:i,matchers:u}),e[5]=i,e[6]=u,e[7]=v):v=e[7];let x;e[8]!==n.label?(x=t.jsx("span",{className:"truncate",children:n.label}),e[8]=n.label,e[9]=x):x=e[9];let y;return e[10]!==v||e[11]!==x?(y=t.jsxs("div",{className:g,children:[v,x]}),e[10]=v,e[11]=x,e[12]=y):y=e[12],y}function $r(r){const e=$e.c(77),{listKey:n,variants:a,activeIndex:c,decofile:u,meta:h,matchers:d,onSelect:i,onReorder:g,onRename:v,onDelete:x,onAdd:y}=r;let _;e[0]!==a?(_=()=>Bt(a),e[0]=a,e[1]=_):_=e[1];const[o,S]=T.useState(_),[p,N]=T.useState(null),[f,j]=T.useState(n),[C,k]=T.useState(a.length);let V;e[2]!==a?(V=()=>Rs(a),e[2]=a,e[3]=V):V=e[3];const[w,$]=T.useState(V),D=T.useRef(!1),P=Rs(a);f!==n?(j(n),k(a.length),$(P),S(Bt(a))):C!==a.length?(k(a.length),$(P),S(Bt(a))):w!==P&&($(P),S(le=>a.map((A,U)=>({id:le[U]?.id??crypto.randomUUID(),index:U,variant:A}))));let I;e[4]===Symbol.for("react.memo_cache_sentinel")?(I={activationConstraint:{distance:8}},e[4]=I):I=e[4];let O;e[5]===Symbol.for("react.memo_cache_sentinel")?(O={coordinateGetter:Ys},e[5]=O):O=e[5];const M=Fs(vt(Ks,I),vt(Bs,O));let R;e[6]!==o?(R=o.map(Or),e[6]=o,e[7]=R):R=e[7];const Y=R,ae=a.length>1;let z;e[8]!==o?(z=le=>{const A=String(le.active.id);N(o.find(U=>U.id===A)??null)},e[8]=o,e[9]=z):z=e[9];const ie=z;let K;e[10]!==Y||e[11]!==g?(K=le=>{N(null);const{active:A,over:U}=le;if(!U||A.id===U.id)return;const Me=Y.indexOf(String(A.id)),Oe=Y.indexOf(String(U.id));Me===-1||Oe===-1||(S(He=>Dr(xt([...He],Me,Oe))),D.current=!0,requestAnimationFrame(()=>{D.current=!1}),g(Me,Oe))},e[10]=Y,e[11]=g,e[12]=K):K=e[12];const X=K;let re;e[13]===Symbol.for("react.memo_cache_sentinel")?(re=()=>{N(null)},e[13]=re):re=e[13];const te=re;let W,G,q,J,Z,H,Ne,ee,be,ye,Ce,_e;if(e[14]!==p||e[15]!==c||e[16]!==ae||e[17]!==u||e[18]!==o||e[19]!==Y||e[20]!==X||e[21]!==ie||e[22]!==d||e[23]!==h||e[24]!==x||e[25]!==v||e[26]!==i||e[27]!==M){const le=U=>{D.current||i(U)};Ce="flex items-center border-b shrink-0";const A=p&&"cursor-grabbing";e[40]!==A?(ye=me("flex flex-1 min-w-0 items-center gap-1.5 pl-3 pr-2 py-2 overflow-x-auto",A),e[40]=A,e[41]=ye):ye=e[41],G=qs,Z=M,H=Ws,Ne=ie,ee=X,be=te,W=Gs,_e=Y,q=Fa,J=o.map(U=>t.jsx(Pr,{sortableId:U.id,entry:U,isActive:U.index===c,canDelete:ae,decofile:u,meta:h,matchers:d,onSelect:()=>le(U.index),onRename:()=>v(U.index),onDelete:()=>x(U.index)},U.id)),e[14]=p,e[15]=c,e[16]=ae,e[17]=u,e[18]=o,e[19]=Y,e[20]=X,e[21]=ie,e[22]=d,e[23]=h,e[24]=x,e[25]=v,e[26]=i,e[27]=M,e[28]=W,e[29]=G,e[30]=q,e[31]=J,e[32]=Z,e[33]=H,e[34]=Ne,e[35]=ee,e[36]=be,e[37]=ye,e[38]=Ce,e[39]=_e}else W=e[28],G=e[29],q=e[30],J=e[31],Z=e[32],H=e[33],Ne=e[34],ee=e[35],be=e[36],ye=e[37],Ce=e[38],_e=e[39];let Se;e[42]!==W||e[43]!==q||e[44]!==J||e[45]!==_e?(Se=t.jsx(W,{items:_e,strategy:q,children:J}),e[42]=W,e[43]=q,e[44]=J,e[45]=_e,e[46]=Se):Se=e[46];let Te;e[47]!==p||e[48]!==u||e[49]!==d||e[50]!==h?(Te=p?t.jsx(Vr,{variant:p.variant,decofile:u,meta:h,matchers:d}):null,e[47]=p,e[48]=u,e[49]=d,e[50]=h,e[51]=Te):Te=e[51];let je;e[52]!==Te?(je=t.jsx(Js,{dropAnimation:null,children:Te}),e[52]=Te,e[53]=je):je=e[53];let Re;e[54]!==G||e[55]!==Z||e[56]!==H||e[57]!==Ne||e[58]!==ee||e[59]!==be||e[60]!==Se||e[61]!==je?(Re=t.jsxs(G,{sensors:Z,collisionDetection:H,onDragStart:Ne,onDragEnd:ee,onDragCancel:be,children:[Se,je]}),e[54]=G,e[55]=Z,e[56]=H,e[57]=Ne,e[58]=ee,e[59]=be,e[60]=Se,e[61]=je,e[62]=Re):Re=e[62];let fe;e[63]!==ye||e[64]!==Re?(fe=t.jsx("div",{className:ye,children:Re}),e[63]=ye,e[64]=Re,e[65]=fe):fe=e[65];let Ie;e[66]===Symbol.for("react.memo_cache_sentinel")?(Ie={color:Rr},e[66]=Ie):Ie=e[66];let ke;e[67]===Symbol.for("react.memo_cache_sentinel")?(ke=t.jsx(Kt,{size:14}),e[67]=ke):ke=e[67];let we;e[68]!==y?(we=t.jsx(at,{asChild:!0,children:t.jsx(Ve,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-8 shrink-0 cursor-pointer",style:Ie,onClick:y,children:ke})}),e[68]=y,e[69]=we):we=e[69];let pe;e[70]===Symbol.for("react.memo_cache_sentinel")?(pe=t.jsx(rt,{side:"bottom",children:"Add variant"}),e[70]=pe):pe=e[70];let De;e[71]!==we?(De=t.jsx("div",{className:"shrink-0 pr-3 pl-1 py-2",children:t.jsxs(ot,{children:[we,pe]})}),e[71]=we,e[72]=De):De=e[72];let oe;return e[73]!==Ce||e[74]!==fe||e[75]!==De?(oe=t.jsxs("div",{className:Ce,children:[fe,De]}),e[73]=Ce,e[74]=fe,e[75]=De,e[76]=oe):oe=e[76],oe}function Or(r){return r.id}function Lr(r){const e=$e.c(37),{open:n,onOpenChange:a,defaultBlockId:c,isPending:u,onSubmit:h}=r,d=c===void 0?"":c,i=u===void 0?!1:u,[g,v]=T.useState(d),[x,y]=T.useState(n);n!==x&&(y(n),n&&v(d));let _;e[0]!==i||e[1]!==a?(_=M=>{!M&&!i&&a(!1)},e[0]=i,e[1]=a,e[2]=_):_=e[2];const o=_;let S;e[3]!==g||e[4]!==i||e[5]!==h?(S=async M=>{M.preventDefault();const R=g.trim();!R||i||await h(R)},e[3]=g,e[4]=i,e[5]=h,e[6]=S):S=e[6];const p=S;let N;e[7]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsxs(Ms,{children:[t.jsx(Es,{children:"Save as global"}),t.jsx(Vs,{children:"Save this section as a global block so it can be reused on other pages."})]}),e[7]=N):N=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("label",{htmlFor:"block-id",className:"text-sm font-medium",children:"Block name"}),e[8]=f):f=e[8];let j;e[9]===Symbol.for("react.memo_cache_sentinel")?(j=M=>v(M.target.value),e[9]=j):j=e[9];let C;e[10]!==g||e[11]!==i?(C=t.jsxs("div",{className:"py-4 space-y-2",children:[f,t.jsx(Is,{id:"block-id",value:g,onChange:j,placeholder:"MyNewBlock",autoFocus:!0,disabled:i})]}),e[10]=g,e[11]=i,e[12]=C):C=e[12];let k;e[13]!==a?(k=()=>a(!1),e[13]=a,e[14]=k):k=e[14];let V;e[15]!==i||e[16]!==k?(V=t.jsx(Ve,{type:"button",variant:"outline",onClick:k,disabled:i,children:"Cancel"}),e[15]=i,e[16]=k,e[17]=V):V=e[17];let w;e[18]!==g||e[19]!==i?(w=!g.trim()||i,e[18]=g,e[19]=i,e[20]=w):w=e[20];let $;e[21]!==i?($=i?t.jsxs(t.Fragment,{children:[t.jsx(Ut,{size:14,className:"animate-spin"}),"Saving…"]}):"Save",e[21]=i,e[22]=$):$=e[22];let D;e[23]!==w||e[24]!==$?(D=t.jsx(Ve,{type:"submit",disabled:w,children:$}),e[23]=w,e[24]=$,e[25]=D):D=e[25];let P;e[26]!==V||e[27]!==D?(P=t.jsxs($s,{children:[V,D]}),e[26]=V,e[27]=D,e[28]=P):P=e[28];let I;e[29]!==p||e[30]!==P||e[31]!==C?(I=t.jsx(Os,{className:"sm:max-w-md",children:t.jsxs("form",{onSubmit:p,children:[N,C,P]})}),e[29]=p,e[30]=P,e[31]=C,e[32]=I):I=e[32];let O;return e[33]!==o||e[34]!==n||e[35]!==I?(O=t.jsx(Ls,{open:n,onOpenChange:o,children:I}),e[33]=o,e[34]=n,e[35]=I,e[36]=O):O=e[36],O}const Ir="oklch(0.65 0.15 160)",zr="text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]",Fr="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.2)]";function Br(r){const e=$e.c(33),{variant:n,selected:a,canDelete:c,onSelect:u,onDuplicate:h,onDelete:d}=r;let i;e[0]!==u?(i=P=>{P.target===P.currentTarget&&(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),u())},e[0]=u,e[1]=i):i=e[1];const g=a?Fr:zr;let v;e[2]!==g?(v=me("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors cursor-pointer",g),e[2]=g,e[3]=v):v=e[3];let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(Yt,{className:"h-4 w-4 shrink-0",style:{color:Ir}}),e[4]=x):x=e[4];let y;e[5]!==n.label?(y=t.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:n.label}),e[5]=n.label,e[6]=y):y=e[6];const _=`Open actions for ${n.label}`;let o;e[7]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(qt,{size:14}),e[7]=o):o=e[7];let S;e[8]!==_?(S=t.jsx(Wt,{asChild:!0,children:t.jsx(Ve,{type:"button",variant:"ghost",size:"icon","aria-label":_,className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:Hr,onPointerDown:Kr,children:o})}),e[8]=_,e[9]=S):S=e[9];let p;e[10]!==h?(p=P=>{P.stopPropagation(),h()},e[10]=h,e[11]=p):p=e[11];let N;e[12]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(zs,{size:14}),e[12]=N):N=e[12];let f;e[13]!==p?(f=t.jsxs(Qe,{onClick:p,children:[N,"Duplicate"]}),e[13]=p,e[14]=f):f=e[14];const j=!c;let C;e[15]!==d?(C=P=>{P.stopPropagation(),d()},e[15]=d,e[16]=C):C=e[16];let k;e[17]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(yt,{size:14}),e[17]=k):k=e[17];let V;e[18]!==j||e[19]!==C?(V=t.jsxs(Qe,{variant:"destructive",disabled:j,onClick:C,children:[k,"Delete"]}),e[18]=j,e[19]=C,e[20]=V):V=e[20];let w;e[21]!==f||e[22]!==V?(w=t.jsxs(Jt,{align:"end",children:[f,V]}),e[21]=f,e[22]=V,e[23]=w):w=e[23];let $;e[24]!==w||e[25]!==S?($=t.jsxs(Gt,{children:[S,w]}),e[24]=w,e[25]=S,e[26]=$):$=e[26];let D;return e[27]!==u||e[28]!==i||e[29]!==$||e[30]!==v||e[31]!==y?(D=t.jsxs("div",{role:"button",tabIndex:0,onClick:u,onKeyDown:i,className:v,children:[x,y,$]}),e[27]=u,e[28]=i,e[29]=$,e[30]=v,e[31]=y,e[32]=D):D=e[32],D}function Kr(r){return r.stopPropagation()}function Hr(r){return r.stopPropagation()}function Ur(r){const e=$e.c(25),{variants:n,selectedIndex:a,onSelect:c,onDuplicate:u,onDelete:h,onRemoveAll:d}=r,i=n.length>1;let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variants"}),e[0]=g):g=e[0];let v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(yt,{size:14}),e[1]=v):v=e[1];let x;e[2]!==d?(x=t.jsx(at,{asChild:!0,children:t.jsx(Ve,{type:"button",variant:"ghost",size:"icon","aria-label":"Remove all variants",className:"size-6 text-muted-foreground hover:text-destructive",onClick:d,children:v})}),e[2]=d,e[3]=x):x=e[3];let y;e[4]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(rt,{children:"Remove all variants"}),e[4]=y):y=e[4];let _;e[5]!==x?(_=t.jsxs("div",{className:"flex items-center justify-between",children:[g,t.jsxs(ot,{children:[x,y]})]}),e[5]=x,e[6]=_):_=e[6];let o;if(e[7]!==i||e[8]!==h||e[9]!==u||e[10]!==c||e[11]!==a||e[12]!==n){let N;e[14]!==i||e[15]!==h||e[16]!==u||e[17]!==c||e[18]!==a?(N=f=>t.jsx(Br,{variant:f,selected:f.index===a,canDelete:i,onSelect:()=>c(f.index),onDuplicate:()=>u(f.index),onDelete:()=>h(f.index)},`${f.label}-${f.index}`),e[14]=i,e[15]=h,e[16]=u,e[17]=c,e[18]=a,e[19]=N):N=e[19],o=n.map(N),e[7]=i,e[8]=h,e[9]=u,e[10]=c,e[11]=a,e[12]=n,e[13]=o}else o=e[13];let S;e[20]!==o?(S=t.jsx("div",{className:"space-y-0.5",children:o}),e[20]=o,e[21]=S):S=e[21];let p;return e[22]!==_||e[23]!==S?(p=t.jsxs("div",{className:"space-y-1 border-b p-2",children:[_,S]}),e[22]=_,e[23]=S,e[24]=p):p=e[24],p}function Ds(r){const e=$e.c(20),{activeSchema:n,formValue:a,formResetKey:c,onFormChange:u,onBreadcrumbChange:h,breadcrumbPath:d,emptyMessage:i,beforeForm:g,seoResolveType:v,siteDefaultSeo:x,meta:y,decofile:_,onSaveReferencedBlock:o}=r;let S;e[0]!==d?(S=d===void 0?[]:d,e[0]=d,e[1]=S):S=e[1];const p=S;let N;e[2]!==n||e[3]!==p||e[4]!==_||e[5]!==c||e[6]!==a||e[7]!==y||e[8]!==h||e[9]!==u||e[10]!==o||e[11]!==v||e[12]!==x?(N=n&&a?v?t.jsx(Za,{schema:n,resolveType:v,value:a,formResetKey:c,onChange:u,onBreadcrumbChange:h,siteDefaultSeo:x}):t.jsx(Ht,{schema:n,value:a,onChange:u,basePath:"",breadcrumbPath:p,onBreadcrumbChange:h,meta:y,decofile:_,onSaveReferencedBlock:o},c):null,e[2]=n,e[3]=p,e[4]=_,e[5]=c,e[6]=a,e[7]=y,e[8]=h,e[9]=u,e[10]=o,e[11]=v,e[12]=x,e[13]=N):N=e[13];const f=N;let j;e[14]!==i||e[15]!==f?(j=f??t.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:i}),e[14]=i,e[15]=f,e[16]=j):j=e[16];let C;return e[17]!==g||e[18]!==j?(C=t.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:t.jsxs("div",{className:"mx-auto max-w-2xl",children:[g,j]})}),e[17]=g,e[18]=j,e[19]=C):C=e[19],C}const Yr="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.22)]",qr=r=>r.charAt(0).toUpperCase()+r.slice(1).toLowerCase();function Ps(r){const{start:e,end:n}=r,a=typeof e=="string"?e:"",c=typeof n=="string"?n:"";if(!a&&!c)return null;const u=new Intl.DateTimeFormat("en",{dateStyle:"medium",timeStyle:"short"}),h=g=>{if(!g)return null;const v=new Date(g);return Number.isNaN(v.getTime())?null:u.format(v)},d=h(a),i=h(c);return d&&i?`${d} → ${i}`:d?`From ${d}`:i?`Until ${i}`:null}function We(r){if(!r)return"Default";const e=r.__resolveType??"";if(["website/matchers/always.ts","$live/matchers/MatchAlways.ts"].includes(e)||e==="")return"Default";switch(e){case"website/matchers/never.ts":return"Hidden";case"website/matchers/device.ts":case"$live/matchers/MatchDevice.ts":{const{mobile:a,tablet:c,desktop:u,devices:h=[]}=r,d=[...h];return a&&d.push("Mobile"),c&&d.push("Tablet"),u&&d.push("Desktop"),d.length>0?d.map(qr).join(" & "):Ke(e)}case"website/matchers/date.ts":case"$live/matchers/MatchDate.ts":return Ps(r)??Ke(e);case"website/matchers/random.ts":case"$live/matchers/MatchRandom.ts":{const{traffic:a}=r;return typeof a=="number"?`${Math.ceil(a*100)}% of sessions`:Ke(e)}case"website/matchers/host.ts":case"$live/matchers/MatchHost.ts":{const{includes:a,match:c}=r,u=[];return a&&u.push(a),c&&u.push(c),u.length>0?u.join(" - "):Ke(e)}case"website/matchers/pathname.ts":{const a=r.case,{type:c,pathname:u}=a??{};return c&&u?`Pathname ${c} ${u}`:Ke(e)}case"website/matchers/location.ts":case"$live/matchers/MatchLocation.ts":{const{includeLocations:a,excludeLocations:c}=r,u=i=>[i.city,i.regionCode,i.country].filter(Boolean).join(" - "),h=a?.[0];if(h){const i=(a?.length??0)-1;return`${u(h)}${i>0?` +${i}`:""}`}const d=c?.[0];if(d){const i=(c?.length??0)-1;return`Except ${u(d)}${i>0?` +${i}`:""}`}return"Any location"}case"website/matchers/multi.ts":case"$live/matchers/MatchMulti.ts":{const{matchers:a,op:c="AND"}=r;return a&&a.length>0?a.map(We).join(` ${c} `):Ke(e)}default:{const a=Ps(r);return a||Ke(e)||"Default"}}}function Wr(r,e){return va(r,e,We)}function Gr(r){const e=$e.c(13),{pageKey:n,initialName:a,initialPath:c,onFieldChange:u}=r,[h,d]=T.useState(a),[i,g]=T.useState(c),[v,x]=T.useState(n);v!==n&&(x(n),d(a),g(c));let y;e[0]!==u?(y=N=>{d(N.target.value),u("name",N.target.value)},e[0]=u,e[1]=y):y=e[1];let _;e[2]!==h||e[3]!==y?(_=t.jsx("input",{type:"text",value:h,onChange:y,className:"w-full bg-transparent text-sm font-semibold truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:"Page name"}),e[2]=h,e[3]=y,e[4]=_):_=e[4];let o;e[5]!==u?(o=N=>{g(N.target.value),u("path",N.target.value)},e[5]=u,e[6]=o):o=e[6];let S;e[7]!==i||e[8]!==o?(S=t.jsx("input",{type:"text",value:i,onChange:o,className:"w-full bg-transparent text-xs text-muted-foreground truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:"/path"}),e[7]=i,e[8]=o,e[9]=S):S=e[9];let p;return e[10]!==_||e[11]!==S?(p=t.jsxs("div",{className:"space-y-1",children:[_,S]}),e[10]=_,e[11]=S,e[12]=p):p=e[12],p}function Hl({orgSlug:r,virtualMcpId:e,branch:n,previewReady:a=!0,previewUrl:c,currentPath:u,activePageBlockKey:h=null,activeGlobalBlockKey:d=null,externalSelectedIndex:i,onSaved:g,initialEditSeo:v=!1,onExitSeo:x,onViewJsonFile:y}){const _=a?{orgSlug:r,virtualMcpId:e,branch:n}:null,{data:o,isLoading:S}=la(_),{data:p,isLoading:N}=ca(_),[f,j]=T.useState(null),[C,k]=T.useState(null),[V,w]=T.useState(null),[$,D]=T.useState(0),[P,I]=T.useState(void 0),[O,M]=T.useState(null),[R,Y]=T.useState(null),[ae,z]=T.useState([]),[ie,K]=T.useState(0),[X,re]=T.useState(null),[te,W]=T.useState(null),[G,q]=T.useState(!0),[J,Z]=T.useState(!1),[H,Ne]=T.useState(!1),[ee,be]=T.useState(v),[ye,Ce]=T.useState(v);v&&!ye&&(Ce(!0),be(!0),j(null),k(null),w(null),z([])),!v&&ye&&Ce(!1);const[_e,Se]=T.useState(null),[Te,je]=T.useState(void 0),[Re,fe]=T.useState([]),[Ie,ke]=T.useState(0),[we,pe]=T.useState(0),[De,oe]=T.useState(null),[le,A]=T.useState(null),[U,Me]=T.useState(null),Oe=Wn(),He=`${r}/${e}/${n}`,St=ua({orgSlug:r,virtualMcpId:e,branch:n}),[sn,nn]=T.useState(u),[an,rn]=T.useState(h),[on,ln]=T.useState(d);(sn!==u||an!==h||on!==d)&&(queueMicrotask(()=>St.flush()),nn(u),rn(h),ln(d),j(null),k(null),w(null),D(0),M(null),Y(null),pe(0),oe(null),A(null),z([]),K(s=>s+1),be(!1),Se(null),je(void 0),fe([]),ke(s=>s+1));const Pe=da({orgSlug:r,virtualMcpId:e,branch:n}),Xt=or((s,l)=>{Pe.mutate({blockKey:s,data:l},{onSuccess:()=>g?.(),onError:m=>de.error(`Save failed: ${m.message}`)})}),es=ma({orgSlug:r,virtualMcpId:e,branch:n}),[_t,ts]=T.useState(!1),jt=T.useRef(null),Xe=T.useRef(null),et=T.useRef(null),kt=T.useRef({}),Ye=T.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!a||S||N)return t.jsx("div",{className:"h-full w-full flex items-center justify-center",children:t.jsx(Ut,{size:20,className:"animate-spin text-muted-foreground"})});if(!o||!p)return t.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:"Could not load site data."});const cn=fa(o),he=!!d,ze=he?null:pa(cn,u,h),L=he?d:ze?.key??null,wt=he&&d?o[d]:void 0,ss=he&&d&&wt?ha(d,wt):he&&d?d:"",Nt=!he&&L&&o[L]?o[L]:null,Ct=ee&&o&&p&&L&&ze?_s(o,{kind:"page",pageKey:L,pageName:String(ze.name??""),path:String(ze.path??"")},p):null,un=ee?Nt?.seo:void 0,Tt=Te!==void 0?Te:un,dn=ee?Ha(Tt):void 0,mn=Ct?.seoTypeOptions??[],fn=ee&&p?Ua(p):"",ns=_e??dn??{},Rt=ee&&Ct?Ya(ns,Ct):null,pn=ee&&Rt&&qa(Tt)?ft(Rt,p):null,hn=ee?Wa(o,p)?.seoData:void 0,Fe=he?[{label:"Default",sections:[{__resolveType:d}]}]:Wr(Nt?.sections,o??{}),ct=Fe.length>1,Ae=Math.min($,Fe.length-1),Ge=Fe[Ae],se=Ge?.sections??[],Le=zt(se,o);if(he&&d&&U!==d){Me(d);const s=se[0],l=Le[0];if(s&&l){j(0),pe(0),z([]);const m=nt(s,l,o);m&&(k(m.data),w(m.resolveType),A(null),oe(null))}}!he&&U!==null&&Me(null),Ye.current={rawSections:se,parsedSections:Le,decofile:o??{},activePageKey:L,pageVariants:Fe,variantIndex:Ae,sectionVariantIndex:we,selectedSectionIndex:f};const tt=(s,l,m)=>{const b=Ze(s,l);if(!b){k(null),w(null),A(null),oe(null);return}const B=bs(b,We)[m];if(!B){k(null),w(null),A(null),oe(null);return}const F=xa(B.value,o);k(F?.data??null),w(F?.resolveType??null);const{resolveType:ne,formValue:ce}=Vt(B.rule,o,p??void 0);A(ne),oe(ce)};if(i!==void 0&&i!==P&&(I(i??null),typeof i=="number")){const s=se[i],l=Le[i];if(s&&l)if(j(i),pe(0),z([]),K(m=>m+1),l.isMultivariate)tt(s,l,0);else{const m=nt(s,l,o);m?(k(m.data),w(m.resolveType)):(k(null),w(null)),A(null),oe(null)}}const Dt=V&&p?ft(V,p):null,Ue=(s,l)=>{if(!L)return;const m=It(o,L,s,Ae,Fe);Pe.mutate({blockKey:L,data:m},{onSuccess:()=>l?.onSuccess?.()??g?.(),onError:b=>de.error(`Save failed: ${b.message}`)})},it=()=>{j(null),k(null),w(null),pe(0),oe(null),A(null),z([]),K(s=>s+1)},gn=(s,l)=>{jt.current&&clearTimeout(jt.current);const m=Ye.current.sectionVariantIndex;jt.current=setTimeout(()=>{const{rawSections:b,parsedSections:E,decofile:B,activePageKey:F,pageVariants:ne,variantIndex:ce}=Ye.current,Q=b[l];if(!Q)return;const ue=E[l];if(!ue)return;if(ue.isSavedBlock){const ve=ue.isLazy?Q.section?.__resolveType??Q.__resolveType:Q.__resolveType;Pe.mutate({blockKey:ve,data:s},{onSuccess:()=>g?.(),onError:xe=>de.error(`Save failed: ${xe.message}`)});return}if(!F)return;const ge={...B[F]},Ee=[...b];if(ue.isMultivariate){const ve=Ze(Q,ue);if(!ve||!F)return;const xe=Ea(ve,m,s);Ee[l]=pt(Q,ue,xe)}else if(ue.isHidden){const ve=ht(Q.__resolveType),xe=ve?{...Q.section}:{...Q},Be=Array.isArray(xe.variants)?[...xe.variants]:[];Be[0]&&(Be[0]={...Be[0],value:s}),xe.variants=Be,ve?Ee[l]={...Q,section:xe}:Ee[l]=xe}else ue.isLazy?Ee[l]={...Q,section:s}:Ee[l]=s;if(ne.length>1){const ve=ge.sections,xe=[...ve?.variants??[]];xe[ce]&&(xe[ce]={...xe[ce],value:Ee}),ge.sections={...ve,variants:xe}}else ge.sections=Ee;Pe.mutate({blockKey:F,data:ge},{onSuccess:()=>g?.(),onError:ve=>de.error(`Save failed: ${ve.message}`)})},Lt)},vn=s=>{j(s),pe(0),z([]),K(E=>E+1);const l=se[s],m=Le[s];if(!l||!m)return;if(m.isMultivariate){tt(l,m,0);return}const b=nt(l,m,o);if(!b){k(null),w(null),A(null),oe(null);return}k(b.data),w(b.resolveType),A(null),oe(null)},as=s=>{const l=s;k(l),f!==null&&gn(l,f)},Pt=s=>{if(!L||!o||!p||!ze)return;const l={kind:"page",pageKey:L,pageName:String(ze.name??""),path:String(ze.path??"")},m=_s(o,l,p);m&&St.save(L,()=>{const b=Oe.getQueryData(Gn.decofile(He))?.[L];if(!b||typeof b!="object"||b===null||Array.isArray(b))return null;const E={...b,...kt.current};return kt.current={},s?.raw!==void 0?{...E,seo:s.raw}:s?.inner!==void 0?Ja(l,m,E,s.inner):E})},xn=(s,l)=>{L&&(kt.current[s]=l,Pt())},bn=(s,l)=>{if(!L)return;const m=xt([...se],s,l);f!==null&&(f===s?j(l):s<f&&l>=f?j(f-1):s>f&&l<=f&&j(f+1)),Ue(m)},yn=s=>{if(!L)return;const l=se.filter((m,b)=>b!==s);f===s?it():f!==null&&f>s&&j(f-1),Ue(l)},Sn=s=>{if(!L)return;const l=se[s];if(!l)return;const m=[...se];m.splice(s+1,0,lr(l)),f!==null&&f>s&&j(f+1),Ue(m)},_n=s=>{if(!L)return;const l=se[s],m=Le[s];if(!l||!m||m.isMultivariate)return;const b=m.isHidden?Na(l):Ca(l);if(!b)return;const E=[...se];E[s]=b,f===s&&it(),Ue(E)},jn=s=>{if(!L)return;const l=se[s],m=Le[s];if(!l||!m||m.isMultivariate)return;const b=wa(l);if(!b)return;const E=[...se];E[s]=b,f===s&&it(),Ue(E)},kn=s=>{if(!L)return;const l=[...se,{__resolveType:s.resolveType}],m=l.length-1;Ue(l,{onSuccess:()=>{Z(!1),j(m),pe(0),z([]),K(F=>F+1);const b=l[m],E=zt(l,o)[m];if(!b||!E)return;if(E.isMultivariate){tt(b,E,0);return}const B=nt(b,E,o);if(!B){k(null),w(null),A(null),oe(null);return}k(B.data),w(B.resolveType),A(null),oe(null)}})},wn=s=>{if(f===null)return;const l=se[f],m=Le[f];!l||!m?.isMultivariate||(pe(s),z([]),K(b=>b+1),tt(l,m,s))},Nn=s=>{if(f===null||!L)return;const l=se[f],m=Le[f];if(!l||!m?.isMultivariate)return;const b=Ze(l,m);if(!b)return;const E=ja(b,s);if(!E){de.error("Cannot delete the only variant.");return}const B=[...se];B[f]=pt(l,m,E);const F=E.variants;let ne=we;s===we?ne=Math.min(s,F.length-1):s<we&&(ne=we-1),pe(ne),z([]),K(ce=>ce+1),tt(B[f],m,ne),Ue(B)},Cn=s=>{if(f===null||!L)return;const l=se[f],m=Le[f];if(!l||!m?.isMultivariate)return;const b=Ze(l,m);if(!b)return;const E=ka(b,s),B=[...se];B[f]=pt(l,m,E);const F=s+1;pe(F),z([]),K(ne=>ne+1),tt(B[f],m,F),Ue(B)},Tn=()=>{if(f===null||!L)return;const s=se[f],l=Le[f];if(!s||!l?.isMultivariate)return;const m=Ze(s,l);if(!m)return;const b=_a(s,l,m);if(!b){de.error("Could not remove variants.");return}const E=[...se];E[f]=b;const B=zt(E,o)[f];if(!B)return;pe(0),A(null),oe(null),z([]),K(ne=>ne+1);const F=nt(b,B,o);F?(k(F.data),w(F.resolveType)):(k(null),w(null)),Ue(E)},Rn=async s=>{if(X===null||!L)return;const l=ws(s,o);if(l){de.error(l);return}const m=se[X],b=Le[X];if(!m||!b)return;const E=nt(m,b,o);if(!E){de.error("This section cannot be saved as global.");return}const B={...E.data,name:s};try{await Pe.mutateAsync({blockKey:s,data:B});const F=[...se];F[X]={__resolveType:s},await Pe.mutateAsync({blockKey:L,data:It(o,L,F,Ae,Fe)}),f===X&&it(),re(null),de.success(`Saved global block "${s}"`),g?.()}catch(F){de.error(F instanceof Error?F.message:"Failed to save global block")}},rs=Ge?.rule;if(ct&&f===null&&R===null&&rs){const{resolveType:s,formValue:l}=Vt(rs,o??{},p??void 0);Y(s),M(l)}const ut=p?Cr(p):[],Dn=!he&&!!(c&&p&&o),os=R&&p?ft(R,p):null,Pn=()=>{Xe.current&&(clearTimeout(Xe.current),Xe.current=null),et.current&&(clearTimeout(et.current),et.current=null)},is=async(s,l)=>{if(!(Ma(l,s,p)>0))try{await es.mutateAsync({blockKey:s})}catch(m){de.error(m instanceof Error?m.message:"Could not delete matcher block")}},ls=s=>{Xe.current&&clearTimeout(Xe.current),Xe.current=setTimeout(()=>{const{activePageKey:l,decofile:m,variantIndex:b}=Ye.current;if(!l)return;const E={...m[l]},B={...E.sections},F=[...B.variants??[]],ne=F[b],ce=ne?.rule;if($t(ce,m,p)){const Q=ce?.__resolveType??"",ue=m[Q],ge=typeof ue?.name=="string"?ue.name:Q,{__resolveType:Ee,...ve}=s;Pe.mutate({blockKey:Q,data:Ot(Ee??"",ve,ge)},{onSuccess:()=>g?.(),onError:xe=>de.error(`Save failed: ${xe.message}`)});return}ne&&(F[b]={...ne,rule:s}),E.sections={...B,variants:F},Pe.mutate({blockKey:l,data:E},{onSuccess:()=>g?.(),onError:Q=>de.error(`Save failed: ${Q.message}`)})},Lt)},An=s=>{Y(s);const l=s?{__resolveType:s}:{__resolveType:Ss};M({}),ls(l)},En=s=>{const l=s;M(l);const m=R?{__resolveType:R,...l}:{...l};ls(m)},cs=s=>{et.current&&clearTimeout(et.current);const{selectedSectionIndex:l,sectionVariantIndex:m}=Ye.current;l!==null&&(et.current=setTimeout(()=>{const{rawSections:b,parsedSections:E,decofile:B,activePageKey:F,pageVariants:ne,variantIndex:ce}=Ye.current;if(!F)return;const Q=b[l],ue=E[l];if(!Q||!ue?.isMultivariate)return;const ge=Ze(Q,ue);if(!ge)return;const Ee=Aa(ge,m,s),ve=[...b];ve[l]=pt(Q,ue,Ee);const xe=It(B,F,ve,ce,ne);Pe.mutate({blockKey:F,data:xe},{onSuccess:()=>g?.(),onError:Be=>de.error(`Save failed: ${Be.message}`)})},Lt))},Mn=s=>{A(s),oe({}),cs(s?{__resolveType:s}:{__resolveType:Ss})},Vn=s=>{const l=s;oe(l);const m=le?{__resolveType:le,...l}:{...l};cs(m)};if(!he&&!ze)return t.jsxs("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:["No page found for ",u]});if(he&&!wt)return t.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:"Global block not found"});const Je=f!==null?Le[f]??null:null,us=f!==null?se[f]:null,ds=us&&Je?.isMultivariate?Ze(us,Je):null,dt=ds?bs(ds,We):[],ms=Math.min(we,Math.max(dt.length-1,0)),At=dt[ms]??null,st=Je?.isMultivariate===!0,lt=f!==null&&Je!==null&&(st||!!(Dt&&C)),$n=lt&&!he&&Je?.isSavedBlock===!0,qe=he||$n,On=he?ss:Je?.label??"",fs=le&&p?ft(le,p):null,Et=lt&&(!he||ae.length>0)?he?[ss,...ae]:[ze.name,Je.label,...st&&At?[At.label]:[],...ae]:[],Ln=ee&&ze?[ze.name,"SEO",...Re]:[],ps=ee?Ln:qe?Et.length>0?Et:[On]:Et,hs=()=>{if(!L)return;const s=o[L],l=ba(s.sections,se);if(!l)return;const m=ya(l);Pe.mutate({blockKey:L,data:{...s,sections:l}},{onSuccess:()=>{D(m),j(null),k(null),w(null),z([]),M(null),Y(null)},onError:b=>de.error(`Save failed: ${b.message}`)})},gs=(s,l,m)=>{if(!L)return;const b=o[L],E=b.sections;if(!E||typeof E!="object"||Array.isArray(E))return;const B=E;if(!Array.isArray(B.variants))return;const F=s([...B.variants]);if(!F)return;const ne=Pa(B,F),ce={...o,[L]:{...b,sections:ne}};Pe.mutate({blockKey:L,data:ce[L]},{onSuccess:()=>{l?.(),m&&is(m,ce)},onError:Q=>de.error(`Save failed: ${Q.message}`)})},In=s=>{W(null),D(s),j(null),k(null),w(null),z([]);const l=Fe[s]?.rule,{resolveType:m,formValue:b}=Vt(l,o??{},p??void 0);Y(m),M(b)},zn=(s,l)=>{s!==l&&(Ae===s?D(l):s<Ae&&l>=Ae?D(Ae-1):s>Ae&&l<=Ae&&D(Ae+1),gs(m=>xt(m,s,l)))},Fn=s=>{const l=Fe[s]?.rule,m=Sa(l,o??{},p??void 0);gs(b=>b.length<=1?null:(b.splice(s,1),b),()=>{Fe.length-1===1?D(0):s<Ae?D(Ae-1):s===Ae&&D(Math.max(0,s-1)),j(null),k(null),w(null),z([]),M(null),Y(null)},m)},Bn=async(s,l)=>{Pn();const m=Ye.current.activePageKey,b=Ye.current.decofile;if(!m)return;const E=b[m],B=E.sections;if(!B||typeof B!="object"||Array.isArray(B))return;const F=B;if(!Array.isArray(F.variants))return;const ne=[...F.variants],ce=ne[s];if(!ce?.rule||typeof ce.rule!="object"){de.error("This variant has no matcher rule to rename.");return}const Q=ce.rule,ue=l.trim();ts(!0);try{if(!ue){if(!$t(Q,b,p)){W(null);return}const Mt=Q.__resolveType??"";ne[s]={...ce,rule:Ta(Q,b,p)};const xs={...b,[m]:{...E,sections:{...F,variants:ne}}};await Pe.mutateAsync({blockKey:m,data:xs[m]}),await is(Mt,xs),W(null),g?.();return}const ge=Ra(Q,b,p);if(!ge){de.error("Could not read this variant's matcher rule.");return}if(ge.blockKey){await Pe.mutateAsync({blockKey:ge.blockKey,data:Ot(ge.resolveType,ge.data,ue)}),W(null),g?.();return}const Ee=ks(ue),ve=ws(Ee,b);if(ve){de.error(ve);return}const xe=Ot(ge.resolveType,ge.data,ue);let Be=null;try{await Pe.mutateAsync({blockKey:Ee,data:xe}),Be=Ee,ne[s]={...ce,rule:Da(Ee)},await Pe.mutateAsync({blockKey:m,data:{...E,sections:{...F,variants:ne}}}),Be=null}catch(Mt){throw Be&&await es.mutateAsync({blockKey:Be}).catch(()=>{}),Mt}W(null),de.success(`Saved matcher as global block "${ue}"`),g?.()}catch(ge){de.error(ge instanceof Error?ge.message:"Failed to rename variant")}finally{ts(!1)}},vs=()=>{it()},Kn=s=>{Se(s),Pt({inner:s})},Hn=s=>{je(s),Pt({raw:s})},Un=()=>{Se(null),fe([])},Yn=()=>ke(s=>s+1),qn=s=>{if(ee){if(s===0){St.flush(),be(!1),Se(null),je(void 0),fe([]),ke(m=>m+1),x?.();return}if(s===1){fe([]),ke(m=>m+1);return}fe(Re.slice(0,s-1)),ke(m=>m+1);return}if(he){z(ae.slice(0,s)),K(m=>m+1);return}if(s===0){vs();return}if(s===1){z([]),K(m=>m+1);return}if(st&&s===2){z([]),K(m=>m+1);return}const l=st?2:1;z(ae.slice(0,s-l))};return t.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[t.jsx("div",{className:"shrink-0",children:qe||lt||ee?t.jsxs("div",{className:me("border-b px-3 py-2.5",qe&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[!he&&ct&&Ge&&t.jsxs("button",{type:"button",onClick:vs,title:`Editing in variant: ${Ge.label}`,className:me("shrink-0 inline-flex items-center gap-1 rounded-md h-6 px-1.5 text-xs font-medium cursor-pointer transition-opacity hover:opacity-80",Yr),children:[t.jsx(Qt,{rule:gt(Ge.rule,o??{},p??void 0),matchers:ut}),t.jsx("span",{className:"max-w-[160px] truncate",children:Ge.label})]}),t.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:ps.map((s,l)=>{const m=l===ps.length-1;return t.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[l>0&&t.jsx(Jn,{className:"size-3 shrink-0 text-muted-foreground/60"}),t.jsx("button",{type:"button",onClick:()=>qn(l),title:s,className:me("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",m?qe?"font-semibold text-global-section-fg dark:text-global-section-fg-dark":"font-medium text-foreground":qe?"text-foreground/80":"text-muted-foreground",qe?"hover:bg-global-section/15":"hover:bg-accent hover:text-accent-foreground"),children:s})]},`${s}-${l}`)})}),qe&&t.jsxs(ot,{children:[t.jsx(at,{asChild:!0,children:t.jsx("span",{className:"shrink-0 cursor-help",children:t.jsx(ta,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),t.jsx(rt,{side:"bottom",className:"max-w-[260px]",children:"A global section is a reusable block shared across your site. Editing it here updates it everywhere it's used."})]})]}),qe&&t.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:"This is a global section. Changes apply everywhere this section is used across your site."})]}):t.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx(Gr,{pageKey:L,initialName:ze.name,initialPath:ze.path,onFieldChange:xn})}),t.jsxs(ot,{children:[t.jsx(at,{asChild:!0,children:t.jsx(Ve,{type:"button",variant:"ghost",size:"icon","aria-label":"Edit SEO",className:"size-7 shrink-0",onClick:()=>be(!0),children:t.jsx(Qn,{size:14})})}),t.jsx(rt,{side:"bottom",children:"Edit SEO"})]}),t.jsxs(ot,{children:[t.jsx(at,{asChild:!0,children:t.jsx(Ve,{type:"button",variant:"ghost",size:"icon","aria-label":"View JSON",className:"size-7 shrink-0",onClick:()=>y&&L?y(L):Ne(!0),children:t.jsx(Xn,{size:14})})}),t.jsx(rt,{side:"bottom",children:"View JSON"})]}),t.jsxs(ot,{children:[t.jsx(at,{asChild:!0,children:t.jsx(Ve,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-7 shrink-0",style:{color:"oklch(0.65 0.15 160)"},onClick:hs,children:t.jsx(ea,{size:14})})}),t.jsx(rt,{side:"bottom",children:"Add variant"})]})]})}),ct&&!lt&&!ee&&L&&t.jsx($r,{listKey:L,variants:Fe,activeIndex:Ae,decofile:o??{},meta:p,matchers:ut,onSelect:In,onReorder:zn,onRename:W,onDelete:Fn,onAdd:hs}),ee?t.jsx(mt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:t.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:t.jsx("div",{className:"mx-auto max-w-2xl",children:Nt&&L?t.jsx(Ga,{rawSeo:Tt,innerSeo:ns,defaultResolveType:fn,seoSchema:pn,activeResolveType:Rt,seoTypeOptions:mn,formResetKey:Ie,siteDefaultSeo:hn,onBreadcrumbChange:fe,onPersistRaw:Hn,onInnerChange:Kn,onClearForm:Un,onBumpFormKey:Yn}):t.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"SEO schema not found for this site."})})})}):lt?t.jsxs(mt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[st&&dt.length>0&&t.jsxs(t.Fragment,{children:[t.jsx(Ur,{variants:dt.map((s,l)=>({index:l,label:s.label})),selectedIndex:ms,onSelect:wn,onDuplicate:Cn,onDelete:Nn,onRemoveAll:Tn}),st&&t.jsxs("div",{className:"px-3 py-3 border-b space-y-2",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variant rule"}),t.jsx(Ts,{currentRt:le??"",currentLabel:We(At?.rule),matchers:ut,onSelect:Mn}),fs&&De&&t.jsx("div",{className:"pt-1",children:t.jsx(Ht,{schema:fs,value:De,onChange:Vn,basePath:""})})]})]}),t.jsx(Ds,{activeSchema:Dt,formValue:C,formResetKey:ie,onFormChange:as,onBreadcrumbChange:z,breadcrumbPath:ae,emptyMessage:"No editable fields for this variant.",meta:p,decofile:o,onSaveReferencedBlock:Xt})]}):he?t.jsx(mt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:t.jsx(Ds,{activeSchema:Dt,formValue:C,formResetKey:ie,onFormChange:as,onBreadcrumbChange:z,breadcrumbPath:ae,emptyMessage:"No editable fields for this global block.",meta:p,decofile:o,onSaveReferencedBlock:Xt})}):t.jsxs(mt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[ct&&R!==null&&t.jsxs("div",{className:me("px-3 border-b",G?"pt-3 pb-5 space-y-3":"py-2"),children:[t.jsxs("button",{type:"button",onClick:()=>q(s=>!s),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer rounded-sm py-0.5 hover:bg-muted/40","aria-expanded":G,children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variant rule"}),G?t.jsx(Zn,{className:"size-3.5 shrink-0 text-muted-foreground"}):t.jsx(As,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),G&&t.jsxs("div",{className:me("space-y-3",_t&&"pointer-events-none opacity-50"),children:[t.jsx(Ts,{currentRt:R,currentLabel:ys(Ge?.rule,o??{},We,p??void 0),matchers:ut,onSelect:An}),os&&O&&t.jsx("div",{className:"space-y-3",children:t.jsx(Ht,{schema:os,value:O,onChange:En,basePath:""})})]})]}),t.jsx("div",{className:"p-2 pt-3",children:t.jsx(_r,{listKey:`${L??""}-${Ae}`,rawSections:se,sections:Le,meta:p,selectedIndex:f,onSelect:vn,onReorder:bn,onDelete:yn,onDuplicate:Sn,onMakeReusable:re,onToggleHidden:_n,onToggleLazy:jn,onAddSection:()=>Z(!0),canAddSection:Dn})})]}),t.jsx(Lr,{open:X!==null,onOpenChange:s=>{s||re(null)},defaultBlockId:X!==null?ks(Le[X]?.label??""):"",isPending:Pe.isPending,onSubmit:Rn}),c&&t.jsx(rr,{open:J,onOpenChange:Z,meta:p,decofile:o,previewBaseUrl:c,onSelect:kn}),H&&L&&o&&t.jsx(ga,{open:H,onOpenChange:Ne,pageKey:L,decofile:o}),te!==null&&t.jsx(ir,{open:!0,initialName:$t(Fe[te]?.rule,o??{},p??void 0)?ys(Fe[te]?.rule,o??{},We,p??void 0):"",autoLabel:We(gt(Fe[te]?.rule,o??{},p??void 0)),isPending:_t,onSubmit:async s=>{await Bn(te,s)},onOpenChange:s=>{!s&&!_t&&W(null)}})]})}export{Hl as SectionsEditor};