decocms 3.99.3 → 3.100.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 (239) hide show
  1. package/dist/client/assets/{AlertCircle-Bgopcarv.js → AlertCircle-qsmFLzIS.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-7XR-z7Ge.js → ArrowUpRight-yJehGCq_.js} +1 -1
  3. package/dist/client/assets/{CheckCircle-DsdDhP4L.js → CheckCircle-B6MW1yw_.js} +1 -1
  4. package/dist/client/assets/{ChevronDown-CpzTl0cf.js → ChevronDown-C6GKFdlz.js} +1 -1
  5. package/dist/client/assets/{ChevronLeft-BuOnLJw9.js → ChevronLeft-B_g3Odoj.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-DqDeYsel.js → ChevronRight-_T91Ki1i.js} +1 -1
  7. package/dist/client/assets/{ChevronUp-Cr2g1GDa.js → ChevronUp-C73sdCjg.js} +1 -1
  8. package/dist/client/assets/{DotsVertical-BGprjE03.js → DotsVertical-BOTJmIm_.js} +1 -1
  9. package/dist/client/assets/{Eye-B9uHZVsM.js → Eye-CmIsbgje.js} +1 -1
  10. package/dist/client/assets/{FilterLines-DgCFEQWk.js → FilterLines-Br0k3Gt9.js} +1 -1
  11. package/dist/client/assets/{Globe01-H40eMg8D.js → Globe01-jb99gJfY.js} +1 -1
  12. package/dist/client/assets/{Globe04-BNaAcUBp.js → Globe04-BoJpZpky.js} +1 -1
  13. package/dist/client/assets/{HardDrive-l0WQMFU9.js → HardDrive-tK8cadSs.js} +1 -1
  14. package/dist/client/assets/{Key01-BDd1iQS4.js → Key01--rf2r0q7.js} +1 -1
  15. package/dist/client/assets/{LayoutLeft-DQOl0C9j.js → LayoutLeft-Dpq1l3Cs.js} +1 -1
  16. package/dist/client/assets/{LinkExternal01-BAME6PCB.js → LinkExternal01-DgKre-XN.js} +1 -1
  17. package/dist/client/assets/{Monitor01-CaJkUXyc.js → Monitor01-DLOF_NPZ.js} +1 -1
  18. package/dist/client/assets/{Palette-C1u1Sxuh.js → Palette-B13aA9KG.js} +1 -1
  19. package/dist/client/assets/{Play-DSjj50Z1.js → Play-CAoWwsoA.js} +1 -1
  20. package/dist/client/assets/{Plus-rHk0VScG.js → Plus-DaRhyqSH.js} +1 -1
  21. package/dist/client/assets/SearchLg-C7PlcyS-.js +1 -0
  22. package/dist/client/assets/{SearchMd-Bc8RVvtx.js → SearchMd-TIrNRuOw.js} +1 -1
  23. package/dist/client/assets/{Settings02-bfgJ4jKJ.js → Settings02-B1ys_QsX.js} +1 -1
  24. package/dist/client/assets/{Shield01-C0erkp7L.js → Shield01-cnNeKMKA.js} +1 -1
  25. package/dist/client/assets/{Star01-DnRxcrb2.js → Star01-DPd1XEvi.js} +1 -1
  26. package/dist/client/assets/{Stars01-DN0i_OuW.js → Stars01-CFQgPhA5.js} +1 -1
  27. package/dist/client/assets/{Stars02-DXKYKZ_y.js → Stars02-BBfjmRkO.js} +1 -1
  28. package/dist/client/assets/{Sun-BvgQbAIe.js → Sun-D1BAkaT6.js} +1 -1
  29. package/dist/client/assets/{SwitchHorizontal01-CTCDUfta.js → SwitchHorizontal01-BPwURr_K.js} +1 -1
  30. package/dist/client/assets/{Tool01-Dvmkyh1g.js → Tool01-UFRB7Gn8.js} +1 -1
  31. package/dist/client/assets/{Trash01-BrvLbqQk.js → Trash01-2mnBLeel.js} +1 -1
  32. package/dist/client/assets/{Upload01-Cghimx9V.js → Upload01-BxxwdIAZ.js} +1 -1
  33. package/dist/client/assets/{User01-BPjc8LiD.js → User01-D61Pj0Jp.js} +1 -1
  34. package/dist/client/assets/{Users01-DKr-dGyn.js → Users01-enhuFvLY.js} +1 -1
  35. package/dist/client/assets/{Users03-CBNK0aq-.js → Users03-CsRyhHB5.js} +1 -1
  36. package/dist/client/assets/{X-BZf8Ua-f.js → X-D_jt_5zi.js} +1 -1
  37. package/dist/client/assets/{XCircle-CxfDN97v.js → XCircle-Cr_Uaxeq.js} +1 -1
  38. package/dist/client/assets/{XClose-Ca4NBXw9.js → XClose-C6a8uvfS.js} +1 -1
  39. package/dist/client/assets/{Zap-D8ndRUQT.js → Zap-CkUSEY1J.js} +1 -1
  40. package/dist/client/assets/{ZapSquare-BY_c_0SN.js → ZapSquare-CwzduoBx.js} +1 -1
  41. package/dist/client/assets/{ZoomOut-C9_8nvys.js → ZoomOut-N-7VqfhT.js} +1 -1
  42. package/dist/client/assets/{access-gate-CCm9ALRG.js → access-gate-CKBNVhhp.js} +1 -1
  43. package/dist/client/assets/{add-section-modal-BsBYigCm.js → add-section-modal-DCuBNkTr.js} +1 -1
  44. package/dist/client/assets/agent-icon-CDWUrKO6.js +1 -0
  45. package/dist/client/assets/agents-list-ulDX0H44.js +1 -0
  46. package/dist/client/assets/{ai-providers-P6gTuznf.js → ai-providers-DEa83FLl.js} +1 -1
  47. package/dist/client/assets/{alert-DpnpKBfm.js → alert-DXQz40c2.js} +1 -1
  48. package/dist/client/assets/{alert-dialog-CWTgvZp_.js → alert-dialog-DwrOZyIa.js} +1 -1
  49. package/dist/client/assets/app-editor-tXdvtxk6.js +1 -0
  50. package/dist/client/assets/{auth-DtR4b91D.js → auth-DnFlop4R.js} +1 -1
  51. package/dist/client/assets/{auth-catchall-BfgSkxA3.js → auth-catchall-CLwyMXPx.js} +1 -1
  52. package/dist/client/assets/{auth-entry-DiMotG9E.js → auth-entry-DxRJaJWz.js} +1 -1
  53. package/dist/client/assets/{auth-split-layout-Bithe63j.js → auth-split-layout-CrmHdTXS.js} +1 -1
  54. package/dist/client/assets/{authenticate-and-persist-oauth-BYDKbSTj.js → authenticate-and-persist-oauth-7MZHsMGS.js} +1 -1
  55. package/dist/client/assets/{automation-list-row-DmMT-Lmk.js → automation-list-row-D88Ulzbg.js} +1 -1
  56. package/dist/client/assets/{automation-runs-CglgtIyd.js → automation-runs-BJ__6yJz.js} +1 -1
  57. package/dist/client/assets/automations-DrzVSDDD.js +1 -0
  58. package/dist/client/assets/{avatar-DosbYSVo.js → avatar-C765fdJ7.js} +1 -1
  59. package/dist/client/assets/{badge-7eW-Y90w.js → badge-CgUoAb0G.js} +1 -1
  60. package/dist/client/assets/{block-document-CU1UWO2l.js → block-document-DMH0RbkS.js} +1 -1
  61. package/dist/client/assets/{brand-context-Bc4eOtey.js → brand-context-CE1MWp0U.js} +1 -1
  62. package/dist/client/assets/{buckets-C0c0s9n9.js → buckets-DoNYdWNk.js} +1 -1
  63. package/dist/client/assets/{capability-load-error-BQe9cGJ_.js → capability-load-error-Cr5M8jid.js} +1 -1
  64. package/dist/client/assets/{card-ChgC15JC.js → card-CYYTvdp-.js} +1 -1
  65. package/dist/client/assets/category-editor-Cz0M4CjQ.js +1 -0
  66. package/dist/client/assets/{chat-context-C7e3nmPB.js → chat-context-CcIPgTva.js} +1 -1
  67. package/dist/client/assets/{checkbox-D1J6-HGS.js → checkbox-D9k8y94F.js} +1 -1
  68. package/dist/client/assets/{cli-auth-success-Biv357Zc.js → cli-auth-success-BEhGmeMb.js} +1 -1
  69. package/dist/client/assets/collection-detail-DwEhzsQm.js +1 -0
  70. package/dist/client/assets/{collection-display-button-zkui4HfF.js → collection-display-button-D-VHSw0A.js} +1 -1
  71. package/dist/client/assets/{collection-search-SCB2wfQm.js → collection-search-OPVOwF6w.js} +1 -1
  72. package/dist/client/assets/{collection-tabs-CasRXW3s.js → collection-tabs-CRf8Ijmq.js} +1 -1
  73. package/dist/client/assets/{command-BP2NK5GV.js → command-gl-L1UMo.js} +1 -1
  74. package/dist/client/assets/commerce-onboarding-D-kTt4mI.js +1 -0
  75. package/dist/client/assets/{connect-desktop-dialog-CUoIMZ9P.js → connect-desktop-dialog-C95eK0uT.js} +1 -1
  76. package/dist/client/assets/{connection-card-Cw-v3-1B.js → connection-card-DQuoMZlF.js} +1 -1
  77. package/dist/client/assets/connection-detail-BTmjhXSR.js +1 -0
  78. package/dist/client/assets/{connection-form-helpers-BE_9JHz-.js → connection-form-helpers-Bjlqqa5J.js} +1 -1
  79. package/dist/client/assets/connections-kvdl_r4C.js +1 -0
  80. package/dist/client/assets/{context-menu-Cbyc6J5M.js → context-menu-DqNcAhnr.js} +1 -1
  81. package/dist/client/assets/{decopilot-D1XiRpB_.js → decopilot-CdQeVtVh.js} +1 -1
  82. package/dist/client/assets/{decopilot-sse-pool-DsG4E7i_.js → decopilot-sse-pool-BxlWS7lz.js} +1 -1
  83. package/dist/client/assets/{dialog-DKiQlf0Y.js → dialog-Hh5ovGLY.js} +1 -1
  84. package/dist/client/assets/{domain-settings-DZg105GS.js → domain-settings-D0sFUhGm.js} +1 -1
  85. package/dist/client/assets/{drawer-UishvVn_.js → drawer-SgGGijSm.js} +1 -1
  86. package/dist/client/assets/{dropdown-menu-B_TYOovI.js → dropdown-menu-CVNL6sbF.js} +1 -1
  87. package/dist/client/assets/{empty-state-BVh7wBPS.js → empty-state-C5ufqcxL.js} +1 -1
  88. package/dist/client/assets/{extract-connection-data-C9MdxGy0.js → extract-connection-data-Dl7BC58q.js} +1 -1
  89. package/dist/client/assets/file-explorer-DBztAiIo.js +2 -0
  90. package/dist/client/assets/{file-type-icon-DouhlgA1.js → file-type-icon-b6CTHv4I.js} +1 -1
  91. package/dist/client/assets/{files-pYWmrODj.js → files-vqgO8Hmh.js} +1 -1
  92. package/dist/client/assets/{form-B4g755Hl.js → form-vkZSNPAt.js} +1 -1
  93. package/dist/client/assets/{general-5Yc9vnsv.js → general-VCh3bTjA.js} +1 -1
  94. package/dist/client/assets/github-repo-picker-DjgoP8zv.js +1 -0
  95. package/dist/client/assets/{hooks-DWc2KmvK.js → hooks-Cm8G1vlN.js} +1 -1
  96. package/dist/client/assets/{import-from-deco-dialog-Bih2Fm5A.js → import-from-deco-dialog-lvJBG1l4.js} +1 -1
  97. package/dist/client/assets/{index-BSPCA2yy.js → index-5EogW27n.js} +1 -1
  98. package/dist/client/assets/{index-BgnTiSnU.js → index-BA1nWkqk.js} +1 -1
  99. package/dist/client/assets/{index-tHbNbVHJ.js → index-BEjmlKPl.js} +4 -4
  100. package/dist/client/assets/index-BQrms0i2.js +1 -0
  101. package/dist/client/assets/index-BgeHuUkH.js +169 -0
  102. package/dist/client/assets/{index-GbBrtIUx.js → index-C5C-UKU4.js} +1 -1
  103. package/dist/client/assets/{index-Blw_ez7B.js → index-CYNIQ2LP.js} +1 -1
  104. package/dist/client/assets/{index-DJGRW9ro.js → index-DMwgNM3s.js} +1 -1
  105. package/dist/client/assets/{index-DZqx_Cnp.js → index-DVWXva_V.js} +1 -1
  106. package/dist/client/assets/index-DcwF1_eH.js +1 -0
  107. package/dist/client/assets/{index-V36Mlak_.js → index-Dg4__lD-.js} +2 -2
  108. package/dist/client/assets/{index-CQ5sDlCR.js → index-b3uLeNQ7.js} +1 -1
  109. package/dist/client/assets/index-h9qXUa58.css +1 -0
  110. package/dist/client/assets/{index-87hVDe9f.js → index-kmrmjjsI.js} +1 -1
  111. package/dist/client/assets/{index-redirect-DwYyA5dK.js → index-redirect-BgY_k9Gz.js} +1 -1
  112. package/dist/client/assets/index-xtrjWgZh.js +503 -0
  113. package/dist/client/assets/{input-C1uF2dQ1.js → input-Csk5e2yH.js} +1 -1
  114. package/dist/client/assets/{integration-icon-DOeD9Yy1.js → integration-icon-BubYo_JB.js} +1 -1
  115. package/dist/client/assets/{label-Bg0TZhOq.js → label-P9D2uSqZ.js} +1 -1
  116. package/dist/client/assets/{login-C4tPjUdy.js → login-Cl-Vlxwz.js} +1 -1
  117. package/dist/client/assets/{mcp-oauth-DxJiJ187.js → mcp-oauth-C9EbOVQM.js} +1 -1
  118. package/dist/client/assets/{members-DwE4NR-t.js → members-TxM32jPh.js} +1 -1
  119. package/dist/client/assets/{monaco-editor-C6tm250p.js → monaco-editor-Bk0ouh6L.js} +1 -1
  120. package/dist/client/assets/{monitoring-stats-row-BF3MVgko.js → monitoring-stats-row-ytgPYn-j.js} +1 -1
  121. package/dist/client/assets/{oauth-callback-DDvAz-C3.js → oauth-callback-D6v0ajK5.js} +1 -1
  122. package/dist/client/assets/{oauth-callback-ai-provider-PWS5W0qh.js → oauth-callback-ai-provider-CDDtW8tk.js} +1 -1
  123. package/dist/client/assets/{onboarding-BfXFCDPk.js → onboarding-J4ivY9wp.js} +1 -1
  124. package/dist/client/assets/{org-install-CRksScXH.js → org-install-R5bN1TE2.js} +1 -1
  125. package/dist/client/assets/{org-layout-D3Fm0DP7.js → org-layout-PPkGFokn.js} +1 -1
  126. package/dist/client/assets/{organization-choice-D0-tUZZw.js → organization-choice-CD_4VGlb.js} +1 -1
  127. package/dist/client/assets/{page-seo-form-BvkRv9HV.js → page-seo-form-B2_5Qimo.js} +1 -1
  128. package/dist/client/assets/page-seo-sheet-DDlWrFZb.js +1 -0
  129. package/dist/client/assets/{popover-eHXpDYJ1.js → popover-CXYDmYeq.js} +1 -1
  130. package/dist/client/assets/post-editor-B1H7keyM.js +1 -0
  131. package/dist/client/assets/preview-dialog-DPmt4gXJ.js +5 -0
  132. package/dist/client/assets/{primitives-CkRAfBR-.js → primitives-FsBU_d9l.js} +1 -1
  133. package/dist/client/assets/{profile-CEx7RbYh.js → profile-Bb6W32P_.js} +1 -1
  134. package/dist/client/assets/project-app-view-9qSeXqiM.js +1 -0
  135. package/dist/client/assets/record-editor-CeITAW1G.js +1 -0
  136. package/dist/client/assets/registry-BjqN-pIh.js +2 -0
  137. package/dist/client/assets/{registry-layout-BlqjOMOH.js → registry-layout-CgN5p_12.js} +1 -1
  138. package/dist/client/assets/{require-capability-BOr4zKTd.js → require-capability-BaWVSsgq.js} +1 -1
  139. package/dist/client/assets/{required-auth-layout-DCkraGAX.js → required-auth-layout-BfuMObCG.js} +1 -1
  140. package/dist/client/assets/{reset-password-BJpJyj5W.js → reset-password-DGoLN-pp.js} +1 -1
  141. package/dist/client/assets/roles-BLgs8rry.js +1 -0
  142. package/dist/client/assets/{scroll-area-IfNZ394n.js → scroll-area-DCf9FU8S.js} +1 -1
  143. package/dist/client/assets/{search-input-DWWTgewM.js → search-input-Cec8OPCx.js} +1 -1
  144. package/dist/client/assets/{secrets-BKFEeATT.js → secrets-D78lmb-N.js} +1 -1
  145. package/dist/client/assets/{sections-editor-uQUAGEex.js → sections-editor-CVFa_v55.js} +2 -2
  146. package/dist/client/assets/{select-Ufh1328y.js → select-f-UK5_IH.js} +1 -1
  147. package/dist/client/assets/{select-model-CQ-f9ftL.js → select-model-DXfyq6oG.js} +1 -1
  148. package/dist/client/assets/seo-editor-8EgzsFKu.js +1 -0
  149. package/dist/client/assets/settings-layout-D8fkj6t7.js +1 -0
  150. package/dist/client/assets/{settings-section-B4a4SAqB.js → settings-section-LAhWYbh9.js} +1 -1
  151. package/dist/client/assets/{sheet-DW12PvFQ.js → sheet-Dz5C6OGo.js} +1 -1
  152. package/dist/client/assets/{shell-controls-xlIGzcZ3.js → shell-controls-CEhcbJHE.js} +1 -1
  153. package/dist/client/assets/shell-layout-R4zDjERM.js +1 -0
  154. package/dist/client/assets/{shell-route-loading-B_CHvxTG.js → shell-route-loading-DHNvhkbM.js} +1 -1
  155. package/dist/client/assets/{sidebar-Cy5GVw74.js → sidebar-CFbvOGM6.js} +1 -1
  156. package/dist/client/assets/{skeleton-CpSca80L.js → skeleton-DLjQYeS_.js} +1 -1
  157. package/dist/client/assets/{sortable.esm-CoB59DXJ.js → sortable.esm-DHABQEKH.js} +1 -1
  158. package/dist/client/assets/{sso-DMV0Y_YX.js → sso-lZztM25h.js} +1 -1
  159. package/dist/client/assets/{store-B6JtITOy.js → store-CY1YTiO_.js} +1 -1
  160. package/dist/client/assets/store-registry-Cq3I32Lc.js +2 -0
  161. package/dist/client/assets/{studio-tools-Dd7dXWQL.js → studio-tools-E6eV6Arx.js} +1 -1
  162. package/dist/client/assets/{switch-CuKs1fR0.js → switch-CIDHMPBy.js} +1 -1
  163. package/dist/client/assets/{table-BfyoFEgz.js → table-FWIaAi69.js} +1 -1
  164. package/dist/client/assets/{tabs-C3buIvx_.js → tabs-DCWgt9U2.js} +1 -1
  165. package/dist/client/assets/{task-status-DXhUoFwL.js → task-status-CBSgsj9C.js} +1 -1
  166. package/dist/client/assets/{textarea-BiYr__3G.js → textarea-cMx1Sjw5.js} +1 -1
  167. package/dist/client/assets/{toggle-group-DFSFo_vP.js → toggle-group-DqYtGmOf.js} +1 -1
  168. package/dist/client/assets/{toolbar-DMYgRw5l.js → toolbar-C5mHjU06.js} +1 -1
  169. package/dist/client/assets/{tooltip-DW1HpudV.js → tooltip-vrtDbf-F.js} +1 -1
  170. package/dist/client/assets/{types-BpY6lzqy.js → types-Cpxi5nja.js} +1 -1
  171. package/dist/client/assets/{use-ai-providers-DS_7m4pz.js → use-ai-providers-SEySB86N.js} +1 -1
  172. package/dist/client/assets/{use-automations-BOSdn9Us.js → use-automations-BWMuOB-g.js} +1 -1
  173. package/dist/client/assets/{use-capability-CeF0OpPy.js → use-capability-BF81OxAF.js} +1 -1
  174. package/dist/client/assets/{use-clock-tick-DLGdZmyk.js → use-clock-tick-v8inwCL3.js} +1 -1
  175. package/dist/client/assets/{use-collections-GNpTGYUv.js → use-collections-DkNJNG6n.js} +1 -1
  176. package/dist/client/assets/{use-connection-B65sInnd.js → use-connection-DUBWvt9B.js} +1 -1
  177. package/dist/client/assets/{use-copy-I4sZTiJp.js → use-copy-BGZ8Ttn0.js} +1 -1
  178. package/dist/client/assets/{use-create-virtual-mcp-mtRixRQv.js → use-create-virtual-mcp-hBSqW_CF.js} +1 -1
  179. package/dist/client/assets/{use-debounced-autosave-Hw4VW15I.js → use-debounced-autosave-BwLKL-15.js} +1 -1
  180. package/dist/client/assets/use-debounced-value-BMcX8uyD.js +1 -0
  181. package/dist/client/assets/{use-delete-connection-DV4DJUaY.js → use-delete-connection-oIOCPNow.js} +1 -1
  182. package/dist/client/assets/{use-file-configs-DObQhPxD.js → use-file-configs-BLZ83KSj.js} +1 -1
  183. package/dist/client/assets/{use-infinite-scroll-Bk__8TxT.js → use-infinite-scroll-DUbloeNA.js} +1 -1
  184. package/dist/client/assets/{use-join-requests-D-QyHVW_.js → use-join-requests-DABqJWZf.js} +1 -1
  185. package/dist/client/assets/{use-mcp-client-0BRd9S75.js → use-mcp-client-DdEyuuWo.js} +1 -1
  186. package/dist/client/assets/{use-mcp-prompts-D4ll_rda.js → use-mcp-prompts-DqUyy9S8.js} +1 -1
  187. package/dist/client/assets/{use-mcp-tools-UJVs9gTs.js → use-mcp-tools-CgsqmnJG.js} +1 -1
  188. package/dist/client/assets/{use-members-BAva2zEC.js → use-members-BhBptkRX.js} +1 -1
  189. package/dist/client/assets/{use-mobile-BD2-gXK-.js → use-mobile-C7loFyQ0.js} +1 -1
  190. package/dist/client/assets/{use-navigate-to-agent-CFNRRTVg.js → use-navigate-to-agent-C3I5i4Gg.js} +1 -1
  191. package/dist/client/assets/{use-org-auth-client-7sV0tnvK.js → use-org-auth-client-B9guhhqA.js} +1 -1
  192. package/dist/client/assets/{use-org-sso-CWJ7VJxn.js → use-org-sso-SRgmMZqR.js} +1 -1
  193. package/dist/client/assets/{use-organization-roles-GhUkwr8O.js → use-organization-roles-Aw74Iw_d.js} +1 -1
  194. package/dist/client/assets/{use-organization-settings-CLeV359D.js → use-organization-settings-CyhRZcil.js} +1 -1
  195. package/dist/client/assets/{use-registry-connections-D7ZBIfwl.js → use-registry-connections-JP-nn714.js} +1 -1
  196. package/dist/client/assets/{use-secrets-_avq30K6.js → use-secrets-f-qJA1xx.js} +1 -1
  197. package/dist/client/assets/{use-status-sounds-DAUtYLJA.js → use-status-sounds-D8xk5cTm.js} +1 -1
  198. package/dist/client/assets/{use-view-mode-DROl2yq4.js → use-view-mode-CsrgTSxk.js} +1 -1
  199. package/dist/client/assets/{use-virtual-mcp-CI9qouIO.js → use-virtual-mcp-CytuWVRm.js} +1 -1
  200. package/dist/client/assets/useInfiniteQuery-Cm9C_gzI.js +1 -0
  201. package/dist/client/assets/useSuspenseInfiniteQuery-Dl9xywRE.js +1 -0
  202. package/dist/client/assets/{useSuspenseQueries-DuDQjlvx.js → useSuspenseQueries-CGmxp5yX.js} +1 -1
  203. package/dist/client/assets/variant-calendar-cvUhqu-8.js +1 -0
  204. package/dist/client/assets/{view-mode-toggle-Del-VZlp.js → view-mode-toggle-B0C659uf.js} +1 -1
  205. package/dist/client/index.html +2 -2
  206. package/dist/server/cli.js +439 -429
  207. package/dist/server/server.js +268 -268
  208. package/package.json +1 -1
  209. package/dist/client/assets/agent-icon-BbjKuSxW.js +0 -1
  210. package/dist/client/assets/agents-list-g0HlqLD8.js +0 -1
  211. package/dist/client/assets/app-editor-CJVdYBr2.js +0 -1
  212. package/dist/client/assets/automations-DfhbzTi8.js +0 -1
  213. package/dist/client/assets/category-editor-BWGJADot.js +0 -1
  214. package/dist/client/assets/collection-detail-B-FYgzNz.js +0 -1
  215. package/dist/client/assets/commerce-onboarding-CCTWN0Dv.js +0 -1
  216. package/dist/client/assets/connection-detail-D66t6r8n.js +0 -1
  217. package/dist/client/assets/connections-B7dKDvRD.js +0 -1
  218. package/dist/client/assets/file-explorer-Dvmu_Dcb.js +0 -2
  219. package/dist/client/assets/github-repo-picker-DDcB4OPT.js +0 -1
  220. package/dist/client/assets/index-BQjoq239.js +0 -1
  221. package/dist/client/assets/index-C0RjSTYg.js +0 -169
  222. package/dist/client/assets/index-CkflryUu.js +0 -503
  223. package/dist/client/assets/index-Cl3nu1dQ.js +0 -1
  224. package/dist/client/assets/index-NVhaWgyE.css +0 -1
  225. package/dist/client/assets/page-seo-sheet-DTF7F_WK.js +0 -1
  226. package/dist/client/assets/post-editor-DOULNreh.js +0 -1
  227. package/dist/client/assets/preview-dialog-QbgIb_4T.js +0 -5
  228. package/dist/client/assets/project-app-view-DHWSkD1u.js +0 -1
  229. package/dist/client/assets/record-editor-Dq4SLOu9.js +0 -1
  230. package/dist/client/assets/registry-fpLTXF0f.js +0 -2
  231. package/dist/client/assets/roles-C6kCiv-A.js +0 -1
  232. package/dist/client/assets/save-status-DVA4IHRx.js +0 -1
  233. package/dist/client/assets/seo-editor-BuTMaAaQ.js +0 -1
  234. package/dist/client/assets/settings-layout-DZdRUGWz.js +0 -1
  235. package/dist/client/assets/shell-layout-C09jnc4C.js +0 -1
  236. package/dist/client/assets/store-registry-BoPJCgP8.js +0 -2
  237. package/dist/client/assets/useInfiniteQuery-jWCtindg.js +0 -1
  238. package/dist/client/assets/useSuspenseInfiniteQuery-CwejNwQJ.js +0 -1
  239. package/dist/client/assets/variant-calendar-2pJ_kR62.js +0 -1
@@ -1 +1 @@
1
- import{c as p,j as t,E as P,r as j,ag as w,B as S,t as y}from"./index-tHbNbVHJ.js";import{i as k}from"./AlertCircle-Bgopcarv.js";import{s as z}from"./Plus-rHk0VScG.js";import{s as E}from"./User01-BPjc8LiD.js";import{t as F}from"./Users01-DKr-dGyn.js";import{a as $,b as I,c as O,d as A,e as R,D as T}from"./dialog-DKiQlf0Y.js";import{I as N}from"./input-C1uF2dQ1.js";import{L as g}from"./label-Bg0TZhOq.js";import{d as B,b as V,c as L,S as q,a as C}from"./select-Ufh1328y.js";import{S as H}from"./skeleton-CpSca80L.js";import{T as K}from"./textarea-BiYr__3G.js";import{P as b}from"./index-87hVDe9f.js";import{c as W}from"./settings-section-B4a4SAqB.js";import{u as Y,a as G}from"./use-secrets-_avq30K6.js";import{R as J}from"./require-capability-BOr4zKTd.js";import"./X-BZf8Ua-f.js";import"./tooltip-DW1HpudV.js";import"./ChevronUp-Cr2g1GDa.js";import"./ChevronDown-CpzTl0cf.js";import"./sidebar-Cy5GVw74.js";import"./LayoutLeft-DQOl0C9j.js";import"./use-mobile-BD2-gXK-.js";import"./sheet-DW12PvFQ.js";import"./card-ChgC15JC.js";import"./ArrowUpRight-7XR-z7Ge.js";import"./studio-tools-Dd7dXWQL.js";import"./use-capability-CeF0OpPy.js";import"./access-gate-CCm9ALRG.js";import"./capability-load-error-BQe9cGJ_.js";function M(s){const e=p.c(3),{error:r}=s;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(k,{size:16}),e[0]=c):c=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:[c,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=p.c(5),{scope:r}=s,c=r==="user"?E:F,n=r==="user"?"Private":"Organization";let i;e[0]!==c?(i=t.jsx(c,{size:12}),e[0]=c,e[1]=i):i=e[1];let a;return e[2]!==n||e[3]!==i?(a=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]=a):a=e[4],a}function D(s){const e=p.c(20),{secret:r}=s;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=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]=c):c=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 a;e[5]!==n||e[6]!==i?(a=t.jsxs("div",{className:"flex items-center gap-2",children:[n,i]}),e[5]=n,e[6]=i,e[7]=a):a=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]!==a||e[11]!==d?(u=t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[c,t.jsxs("div",{className:"min-w-0",children:[a,d]})]}),e[10]=a,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 o;e[15]!==l?(o=t.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:l}),e[15]=l,e[16]=o):o=e[16];let x;return e[17]!==u||e[18]!==o?(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,o]}),e[17]=u,e[18]=o,e[19]=x):x=e[19],x}function U(s){const e=p.c(5),{onCreate:r}=s;let c,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=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]=c,e[1]=n):(c=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 a;return e[3]!==r?(a=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:[c,n,t.jsxs(S,{onClick:r,size:"sm",className:"mt-2",children:[i,"New secret"]})]}),e[3]=r,e[4]=a):a=e[4],a}function _({open:s,onOpenChange:e}){const[r,c]=j.useState("organization"),[n,i]=j.useState(""),[a,d]=j.useState(""),[u,l]=j.useState(""),o=G();function x(){c("organization"),i(""),d(""),l("")}function f(){x(),e(!1)}async function h(m){if(m.preventDefault(),!(!n.trim()||!a))try{await o.mutateAsync({scope:r,name:n.trim(),value:a,description:u.trim()||void 0}),y.success(`Secret "${n.trim()}" created`),f()}catch(v){y.error(v instanceof Error?v.message:"Failed to create secret")}}return t.jsx($,{open:s,onOpenChange:m=>{m?e(m):f()},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=>c(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:a,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:f,disabled:o.isPending,children:"Cancel"}),t.jsx(S,{type:"submit",disabled:o.isPending||!n.trim()||!a,children:o.isPending?"Creating…":"Create secret"})]})]})]})})}function X(){const s=p.c(21),e=Y(),[r,c]=j.useState(!1);if(e.length===0){let l;s[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(U,{onCreate:()=>c(!0)}),s[0]=l):l=s[0];let o;return s[1]!==r?(o=t.jsxs(t.Fragment,{children:[l,t.jsx(_,{open:r,onOpenChange:c})]}),s[1]=r,s[2]=o):o=s[2],o}let n,i,a;if(s[3]!==e){const l=e.filter(se),o=e.filter(te),x=e.length===1?"":"s";let f;s[7]!==e.length||s[8]!==x?(f=t.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.length," secret",x," stored"]}),s[7]=e.length,s[8]=x,s[9]=f):f=s[9];let h;s[10]===Symbol.for("react.memo_cache_sentinel")?(h=()=>c(!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]!==f?(n=t.jsxs("div",{className:"flex items-center justify-between",children:[f,m]}),s[12]=f,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,a=o.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:o.map(Z)})]}):null,s[3]=e,s[4]=n,s[5]=i,s[6]=a}else n=s[4],i=s[5],a=s[6];let d;s[14]!==r?(d=t.jsx(_,{open:r,onOpenChange:c}),s[14]=r,s[15]=d):d=s[15];let u;return s[16]!==n||s[17]!==i||s[18]!==a||s[19]!==d?(u=t.jsxs(t.Fragment,{children:[n,i,a,d]}),s[16]=n,s[17]=i,s[18]=a,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=p.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 Ie(){const s=p.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{Ie as default};
1
+ import{c as p,j as t,E as P,r as j,ag as w,B as S,t as y}from"./index-BEjmlKPl.js";import{i as k}from"./AlertCircle-qsmFLzIS.js";import{s as z}from"./Plus-DaRhyqSH.js";import{s as E}from"./User01-D61Pj0Jp.js";import{t as F}from"./Users01-enhuFvLY.js";import{a as $,b as I,c as O,d as A,e as R,D as T}from"./dialog-Hh5ovGLY.js";import{I as N}from"./input-Csk5e2yH.js";import{L as g}from"./label-P9D2uSqZ.js";import{d as B,b as V,c as L,S as q,a as C}from"./select-f-UK5_IH.js";import{S as H}from"./skeleton-DLjQYeS_.js";import{T as K}from"./textarea-cMx1Sjw5.js";import{P as b}from"./index-kmrmjjsI.js";import{c as W}from"./settings-section-LAhWYbh9.js";import{u as Y,a as G}from"./use-secrets-f-qJA1xx.js";import{R as J}from"./require-capability-BaWVSsgq.js";import"./X-D_jt_5zi.js";import"./tooltip-vrtDbf-F.js";import"./ChevronUp-C73sdCjg.js";import"./ChevronDown-C6GKFdlz.js";import"./sidebar-CFbvOGM6.js";import"./LayoutLeft-Dpq1l3Cs.js";import"./use-mobile-C7loFyQ0.js";import"./sheet-Dz5C6OGo.js";import"./card-CYYTvdp-.js";import"./ArrowUpRight-yJehGCq_.js";import"./studio-tools-E6eV6Arx.js";import"./use-capability-BF81OxAF.js";import"./access-gate-CKBNVhhp.js";import"./capability-load-error-Cr5M8jid.js";function M(s){const e=p.c(3),{error:r}=s;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(k,{size:16}),e[0]=c):c=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:[c,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=p.c(5),{scope:r}=s,c=r==="user"?E:F,n=r==="user"?"Private":"Organization";let i;e[0]!==c?(i=t.jsx(c,{size:12}),e[0]=c,e[1]=i):i=e[1];let a;return e[2]!==n||e[3]!==i?(a=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]=a):a=e[4],a}function D(s){const e=p.c(20),{secret:r}=s;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=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]=c):c=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 a;e[5]!==n||e[6]!==i?(a=t.jsxs("div",{className:"flex items-center gap-2",children:[n,i]}),e[5]=n,e[6]=i,e[7]=a):a=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]!==a||e[11]!==d?(u=t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[c,t.jsxs("div",{className:"min-w-0",children:[a,d]})]}),e[10]=a,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 o;e[15]!==l?(o=t.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:l}),e[15]=l,e[16]=o):o=e[16];let x;return e[17]!==u||e[18]!==o?(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,o]}),e[17]=u,e[18]=o,e[19]=x):x=e[19],x}function U(s){const e=p.c(5),{onCreate:r}=s;let c,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=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]=c,e[1]=n):(c=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 a;return e[3]!==r?(a=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:[c,n,t.jsxs(S,{onClick:r,size:"sm",className:"mt-2",children:[i,"New secret"]})]}),e[3]=r,e[4]=a):a=e[4],a}function _({open:s,onOpenChange:e}){const[r,c]=j.useState("organization"),[n,i]=j.useState(""),[a,d]=j.useState(""),[u,l]=j.useState(""),o=G();function x(){c("organization"),i(""),d(""),l("")}function f(){x(),e(!1)}async function h(m){if(m.preventDefault(),!(!n.trim()||!a))try{await o.mutateAsync({scope:r,name:n.trim(),value:a,description:u.trim()||void 0}),y.success(`Secret "${n.trim()}" created`),f()}catch(v){y.error(v instanceof Error?v.message:"Failed to create secret")}}return t.jsx($,{open:s,onOpenChange:m=>{m?e(m):f()},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=>c(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:a,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:f,disabled:o.isPending,children:"Cancel"}),t.jsx(S,{type:"submit",disabled:o.isPending||!n.trim()||!a,children:o.isPending?"Creating…":"Create secret"})]})]})]})})}function X(){const s=p.c(21),e=Y(),[r,c]=j.useState(!1);if(e.length===0){let l;s[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(U,{onCreate:()=>c(!0)}),s[0]=l):l=s[0];let o;return s[1]!==r?(o=t.jsxs(t.Fragment,{children:[l,t.jsx(_,{open:r,onOpenChange:c})]}),s[1]=r,s[2]=o):o=s[2],o}let n,i,a;if(s[3]!==e){const l=e.filter(se),o=e.filter(te),x=e.length===1?"":"s";let f;s[7]!==e.length||s[8]!==x?(f=t.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.length," secret",x," stored"]}),s[7]=e.length,s[8]=x,s[9]=f):f=s[9];let h;s[10]===Symbol.for("react.memo_cache_sentinel")?(h=()=>c(!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]!==f?(n=t.jsxs("div",{className:"flex items-center justify-between",children:[f,m]}),s[12]=f,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,a=o.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:o.map(Z)})]}):null,s[3]=e,s[4]=n,s[5]=i,s[6]=a}else n=s[4],i=s[5],a=s[6];let d;s[14]!==r?(d=t.jsx(_,{open:r,onOpenChange:c}),s[14]=r,s[15]=d):d=s[15];let u;return s[16]!==n||s[17]!==i||s[18]!==a||s[19]!==d?(u=t.jsxs(t.Fragment,{children:[n,i,a,d]}),s[16]=n,s[17]=i,s[18]=a,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=p.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 Ie(){const s=p.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{Ie as default};
@@ -1,2 +1,2 @@
1
- import{c as Ie,r as w,l as Re,j as n,B as Ue,i as Dn,m as Qs,t as pe,K as Xs}from"./index-tHbNbVHJ.js";import{r as Zs,a as Gs,s as ea,i as Tn,c as ta,b as na,G as sa,V as aa,d as ra,e as jt,f as oa,g as ia,h as la,j as ca,k as ua,l as da,m as ma,n as fa,o as pa,p as xt,q as bt,t as ha,v as tt,w as Bt,x as ga,y as Xe,z as gn,S as va,M as vn,A as nt,B as Sn,C as Sa,D as xn,P as xa,E as Ft,F as ba,H as ya,I as ja,J as _a,K as ka,L as wa,N as Na,O as dt,Q as Ra,R as Ca,T as Da,U as Ta,W as Pa,X as Va,Y as Aa,Z as Ma,_ as bn,$ as zt,a0 as Ea,a1 as $a,a2 as It,a3 as Ka,a4 as yn,a5 as Oa,a6 as La,a7 as Ba,a8 as Ht,a9 as Fa,aa as za,ab as Pn,ac as jn,ad as Ia}from"./index-CkflryUu.js";import{t as Ha}from"./ChevronDown-CpzTl0cf.js";import{n as Ua}from"./ChevronLeft-BuOnLJw9.js";import{i as Vn}from"./ChevronRight-DqDeYsel.js";import{n as Wa}from"./ChevronUp-Cr2g1GDa.js";import{K as Wt,D as An,W as Mn,l as qa,L as Ya,M as Ja}from"./agent-icon-BbjKuSxW.js";import{i as Qa}from"./Globe01-H40eMg8D.js";import{S as yt}from"./scroll-area-IfNZ394n.js";import{T as st,a as at,b as rt}from"./tooltip-DW1HpudV.js";import{d as Xa,c as Za,e as Ga,D as er,b as tr,a as nr}from"./dialog-DKiQlf0Y.js";import{I as sr}from"./input-C1uF2dQ1.js";import{s as ar,a as En}from"./Eye-B9uHZVsM.js";import{d as rr}from"./ZoomOut-C9_8nvys.js";import{i as or}from"./Settings02-bfgJ4jKJ.js";import{s as qt}from"./Plus-rHk0VScG.js";import{s as $n}from"./Trash01-BrvLbqQk.js";import{i as ir}from"./Zap-D8ndRUQT.js";import{c as Ze,a as Kn,D as On,b as Ln,g as lr}from"./dropdown-menu-B_TYOovI.js";import{b as Bn,c as _t,K as Fn,P as zn,e as In,C as Hn,s as Un,l as mt,D as Wn,d as qn,S as Yn,v as cr,k as Jn,p as ur}from"./sortable.esm-CoB59DXJ.js";import{r as _n,u as dr,d as mr,a as fr,i as pr,f as hr,P as gr,b as vr,S as Sr}from"./page-seo-form-BvkRv9HV.js";import{b as xr}from"./Tool01-Dvmkyh1g.js";import{A as br}from"./add-section-modal-BsBYigCm.js";import"./index-DJGRW9ro.js";import"./chat-context-C7e3nmPB.js";import"./hooks-DWc2KmvK.js";import"./use-mcp-client-0BRd9S75.js";import"./auth-DtR4b91D.js";import"./decopilot-sse-pool-DsG4E7i_.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-CI9qouIO.js";import"./use-collections-GNpTGYUv.js";import"./use-ai-providers-DS_7m4pz.js";import"./studio-tools-Dd7dXWQL.js";import"./tab-id-BptcWVWa.js";import"./use-organization-settings-CLeV359D.js";import"./drawer-UishvVn_.js";import"./collection-search-SCB2wfQm.js";import"./SearchMd-Bc8RVvtx.js";import"./use-mobile-BD2-gXK-.js";import"./use-mcp-prompts-D4ll_rda.js";import"./X-BZf8Ua-f.js";import"./shell-layout-C09jnc4C.js";import"./avatar-DosbYSVo.js";import"./User01-BPjc8LiD.js";import"./Users03-CBNK0aq-.js";import"./Stars02-DXKYKZ_y.js";import"./XClose-Ca4NBXw9.js";import"./CheckCircle-DsdDhP4L.js";import"./FilterLines-DgCFEQWk.js";import"./required-auth-layout-DCkraGAX.js";import"./use-org-sso-CWJ7VJxn.js";import"./SwitchHorizontal01-CTCDUfta.js";import"./ZapSquare-BY_c_0SN.js";import"./Star01-DnRxcrb2.js";import"./Upload01-Cghimx9V.js";import"./AlertCircle-Bgopcarv.js";import"./form-B4g755Hl.js";import"./label-Bg0TZhOq.js";import"./select-Ufh1328y.js";import"./XCircle-CxfDN97v.js";import"./tabs-C3buIvx_.js";import"./toggle-group-DFSFo_vP.js";import"./Monitor01-CaJkUXyc.js";import"./connect-desktop-dialog-CUoIMZ9P.js";import"./decopilot-D1XiRpB_.js";import"./checkbox-D1J6-HGS.js";import"./skeleton-CpSca80L.js";import"./Key01-BDd1iQS4.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-B4a4SAqB.js";import"./card-ChgC15JC.js";import"./ArrowUpRight-7XR-z7Ge.js";import"./Stars01-DN0i_OuW.js";import"./popover-eHXpDYJ1.js";import"./command-BP2NK5GV.js";import"./index-CQ5sDlCR.js";import"./useInfiniteQuery-jWCtindg.js";import"./use-infinite-scroll-Bk__8TxT.js";import"./question-004-sINsf4GQ.js";import"./integration-icon-DOeD9Yy1.js";import"./use-status-sounds-DAUtYLJA.js";import"./empty-state-BVh7wBPS.js";import"./toolbar-DMYgRw5l.js";import"./preview-dialog-QbgIb_4T.js";import"./LinkExternal01-BAME6PCB.js";import"./index-BSPCA2yy.js";import"./file-type-icon-DouhlgA1.js";import"./LayoutLeft-DQOl0C9j.js";import"./use-connection-B65sInnd.js";import"./use-mcp-tools-UJVs9gTs.js";import"./types-BpY6lzqy.js";import"./use-capability-CeF0OpPy.js";import"./textarea-BiYr__3G.js";import"./shell-route-loading-B_CHvxTG.js";import"./extract-connection-data-C9MdxGy0.js";import"./index-BgnTiSnU.js";import"./mcp-oauth-DxJiJ187.js";import"./badge-7eW-Y90w.js";import"./connection-slug-eyAPH6o3.js";import"./alert-dialog-CWTgvZp_.js";import"./switch-CuKs1fR0.js";import"./Play-DSjj50Z1.js";import"./use-debounced-autosave-Hw4VW15I.js";import"./index-87hVDe9f.js";import"./sidebar-Cy5GVw74.js";import"./sheet-DW12PvFQ.js";import"./search-input-DWWTgewM.js";import"./collection-tabs-CasRXW3s.js";import"./github-repo-picker-DDcB4OPT.js";import"./authenticate-and-persist-oauth-BYDKbSTj.js";import"./use-navigate-to-agent-CFNRRTVg.js";import"./Users01-DKr-dGyn.js";import"./use-secrets-_avq30K6.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./view-mode-toggle-Del-VZlp.js";import"./DotsVertical-BGprjE03.js";import"./automation-runs-CglgtIyd.js";import"./table-BfyoFEgz.js";import"./use-members-BAva2zEC.js";import"./use-org-auth-client-7sV0tnvK.js";import"./task-status-DXhUoFwL.js";import"./use-automations-BOSdn9Us.js";import"./useSuspenseInfiniteQuery-CwejNwQJ.js";import"./use-file-configs-DObQhPxD.js";import"./monaco-editor-C6tm250p.js";import"./select-model-CQ-f9ftL.js";import"./automation-list-row-DmMT-Lmk.js";import"./Globe04-BNaAcUBp.js";import"./HardDrive-l0WQMFU9.js";import"./Sun-BvgQbAIe.js";import"./Palette-C1u1Sxuh.js";import"./Shield01-C0erkp7L.js";import"./use-clock-tick-DLGdZmyk.js";import"./use-copy-I4sZTiJp.js";import"./content-blocks-o63cs2vh.js";import"./connection-card-Cw-v3-1B.js";import"./use-registry-connections-D7ZBIfwl.js";import"./connection-form-helpers-BE_9JHz-.js";function yr(m){return m.schema?.definitions??m.schema?.$defs??{}}function jr(m,e){const r=yr(e),c=r[btoa(m)];if(!c)return;let d=typeof c.image=="string"?c.image:void 0;if(!d&&Array.isArray(c.allOf)){const h=c.allOf.find(v=>typeof v.$ref=="string")?.$ref;if(typeof h=="string"){const v=h.replace("#/definitions/",""),f=r[v];d=typeof f?.image=="string"?f.image:void 0}}if(d?.includes("{{{"))return d}function _r(m,e){if(!e)return;const r=Zs(m);if(!r)return;const c=jr(r.resolveType,e);if(!c)return;const d=Gs(c,r.data);if(d)return ea(d)}const kr="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",wr="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 kn(m){return Array.from({length:m},(e,r)=>({id:crypto.randomUUID(),index:r}))}function Qn(m){return m.map((e,r)=>({...e,index:r}))}function Nr(m,e){if(e===m.length)return m;if(e<m.length)return Qn(m.slice(0,e));const r=Array.from({length:e-m.length},(c,d)=>({id:crypto.randomUUID(),index:m.length+d}));return[...m,...r]}function Xn(m){const e=Ie.c(20),{section:r,raw:c,meta:d}=m,h=r.isSavedBlock===!0,v=r.isMultivariate===!0;let f;e[0]!==d||e[1]!==c?(f=c&&d?_r(c,d):void 0,e[0]=d,e[1]=c,e[2]=f):f=e[2];const g=f;let S;e[3]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx(rr,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[3]=S):S=e[3];let x;e[4]!==g?(x=g&&n.jsx("img",{src:g,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[4]=g,e[5]=x):x=e[5];let D;e[6]!==v||e[7]!==h?(D=h?{color:sa}:v?{color:"oklch(0.65 0.15 160)"}:void 0,e[6]=v,e[7]=h,e[8]=D):D=e[8];let N;e[9]!==D?(N=n.jsx(Wt,{className:"h-4 w-4 shrink-0",style:D}),e[9]=D,e[10]=N):N=e[10];const j=r.isHidden&&"line-through opacity-50";let C;e[11]!==j?(C=Re("min-w-0 flex-1 truncate text-sm font-medium",j),e[11]=j,e[12]=C):C=e[12];let o;e[13]!==r.label||e[14]!==C?(o=n.jsx("span",{className:C,children:r.label}),e[13]=r.label,e[14]=C,e[15]=o):o=e[15];let k;return e[16]!==x||e[17]!==N||e[18]!==o?(k=n.jsxs(n.Fragment,{children:[S,x,N,o]}),e[16]=x,e[17]=N,e[18]=o,e[19]=k):k=e[19],k}function Zn(m,e){const r=m.isSavedBlock===!0,c=m.isMultivariate===!0;return Re("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":r?kr:c?"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 Rr(m){const e=Ie.c(64),{section:r,raw:c,meta:d,sortableId:h,selected:v,onSelect:f,onDelete:g,onDuplicate:S,onMakeReusable:x,onToggleHidden:D,onToggleLazy:N,onAddVariant:j,onDetach:C}=m,o=c?Tn(c.__resolveType??""):!1;let k;e[0]!==r?(k=ta(r),e[0]=r,e[1]=k):k=e[1];const u=k;let Q;e[2]!==h?(Q={id:h,animateLayoutChanges:Vr},e[2]=h,e[3]=Q):Q=e[3];const{attributes:W,listeners:O,setNodeRef:l,transform:T,isDragging:ae}=In(Q);let P;e[4]!==T?(P=Hn.Transform.toString(T?{...T,x:0}:null),e[4]=T,e[5]=P):P=e[5];const de=ae?0:void 0;let A;e[6]!==P||e[7]!==de?(A={transform:P,opacity:de},e[6]=P,e[7]=de,e[8]=A):A=e[8];const le=A;let M;e[9]!==r?(M=na(r),e[9]=r,e[10]=M):M=e[10];const se=M,oe="button",Se=0;let I;e[11]!==f?(I=E=>{(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),f())},e[11]=f,e[12]=I):I=e[12];const te=ae?"cursor-grabbing":"cursor-pointer";let q;e[13]!==r||e[14]!==v||e[15]!==te?(q=Re("touch-none transition-colors",te,Zn(r,v)),e[13]=r,e[14]=v,e[15]=te,e[16]=q):q=e[16];let ie;e[17]!==d||e[18]!==c||e[19]!==r?(ie=n.jsx(Xn,{section:r,raw:c,meta:d}),e[17]=d,e[18]=c,e[19]=r,e[20]=ie):ie=e[20];const V=!r.isMultivariate&&n.jsxs(st,{children:[n.jsx(at,{asChild:!0,children:n.jsx(Ue,{type:"button",variant:"ghost",size:"icon","aria-label":o?"Disable async render":"Enable async render",className:Re("h-7 w-7 shrink-0",o?"":"opacity-0 group-hover:opacity-100"),onClick:E=>{E.stopPropagation(),N()},onPointerDown:Pr,children:n.jsx(ir,{className:Re("h-3.5 w-3.5",o&&"text-yellow-500")})})}),n.jsx(rt,{side:"bottom",children:o?"Disable async render":"Enable async render"})]});let he;e[21]!==D||e[22]!==r.isHidden||e[23]!==r.isMultivariate?(he=!r.isMultivariate&&n.jsxs(st,{children:[n.jsx(at,{asChild:!0,children:n.jsx(Ue,{type:"button",variant:"ghost",size:"icon","aria-label":r.isHidden?"Show section":"Hide section",className:Re("h-7 w-7 shrink-0",r.isHidden?"opacity-100":"opacity-0 group-hover:opacity-100"),onClick:E=>{E.stopPropagation(),D()},onPointerDown:Tr,children:r.isHidden?n.jsx(or,{className:"h-3.5 w-3.5"}):n.jsx(ar,{className:"h-3.5 w-3.5"})})}),n.jsx(rt,{side:"bottom",children:r.isHidden?"Show section":"Hide section"})]}),e[21]=D,e[22]=r.isHidden,e[23]=r.isMultivariate,e[24]=he):he=e[24];let K;e[25]===Symbol.for("react.memo_cache_sentinel")?(K=n.jsx(Kn,{asChild:!0,children:n.jsx(Ue,{type:"button",variant:"ghost",size:"icon","aria-label":"Section actions",className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100",onClick:Dr,onPointerDown:Cr,children:n.jsx(An,{className:"h-3.5 w-3.5"})})}),e[25]=K):K=e[25];let ce;e[26]!==S?(ce=E=>{E.stopPropagation(),S()},e[26]=S,e[27]=ce):ce=e[27];let X;e[28]===Symbol.for("react.memo_cache_sentinel")?(X=n.jsx(En,{className:"h-4 w-4"}),e[28]=X):X=e[28];let Y;e[29]!==ce?(Y=n.jsxs(Ze,{onClick:ce,children:[X,"Duplicate"]}),e[29]=ce,e[30]=Y):Y=e[30];let L;e[31]!==u||e[32]!==j?(L=u&&n.jsxs(Ze,{className:aa,onClick:E=>{E.stopPropagation(),j()},children:[n.jsx(Mn,{className:"h-4 w-4"}),"Add variant"]}),e[31]=u,e[32]=j,e[33]=L):L=e[33];let B;e[34]!==se||e[35]!==x?(B=se&&n.jsxs(Ze,{className:wr,onClick:E=>{E.stopPropagation(),x()},children:[n.jsx(Wt,{className:"h-4 w-4"}),"Make reusable"]}),e[34]=se,e[35]=x,e[36]=B):B=e[36];let Z;e[37]!==C||e[38]!==r.isMultivariate||e[39]!==r.isSavedBlock?(Z=r.isSavedBlock===!0&&!r.isMultivariate&&n.jsxs(Ze,{onClick:E=>{E.stopPropagation(),C()},children:[n.jsx(Wt,{className:"h-4 w-4"}),"Detach"]}),e[37]=C,e[38]=r.isMultivariate,e[39]=r.isSavedBlock,e[40]=Z):Z=e[40];let G;e[41]!==g?(G=E=>{E.stopPropagation(),g()},e[41]=g,e[42]=G):G=e[42];let ee;e[43]===Symbol.for("react.memo_cache_sentinel")?(ee=n.jsx($n,{className:"h-4 w-4"}),e[43]=ee):ee=e[43];let ne;e[44]!==G?(ne=n.jsxs(Ze,{className:"text-destructive focus:text-destructive",onClick:G,children:[ee,"Delete"]}),e[44]=G,e[45]=ne):ne=e[45];let me;e[46]!==Y||e[47]!==L||e[48]!==B||e[49]!==Z||e[50]!==ne?(me=n.jsxs(On,{children:[K,n.jsxs(Ln,{align:"end",className:"w-44",children:[Y,L,B,Z,ne]})]}),e[46]=Y,e[47]=L,e[48]=B,e[49]=Z,e[50]=ne,e[51]=me):me=e[51];let F;return e[52]!==W||e[53]!==O||e[54]!==f||e[55]!==l||e[56]!==le||e[57]!==q||e[58]!==ie||e[59]!==V||e[60]!==he||e[61]!==me||e[62]!==I?(F=n.jsxs("div",{ref:l,style:le,...W,...O,role:oe,tabIndex:Se,onClick:f,onKeyDown:I,className:q,children:[ie,V,he,me]}),e[52]=W,e[53]=O,e[54]=f,e[55]=l,e[56]=le,e[57]=q,e[58]=ie,e[59]=V,e[60]=he,e[61]=me,e[62]=I,e[63]=F):F=e[63],F}function Cr(m){return m.stopPropagation()}function Dr(m){return m.stopPropagation()}function Tr(m){return m.stopPropagation()}function Pr(m){return m.stopPropagation()}function Vr(){return!1}function Ar(m){const e=Ie.c(90),{listKey:r,rawSections:c,sections:d,meta:h,selectedIndex:v,onSelect:f,onReorder:g,onDelete:S,onDuplicate:x,onMakeReusable:D,onToggleHidden:N,onToggleLazy:j,onAddVariant:C,onDetach:o,onAddSection:k,canAddSection:u}=m,Q=u===void 0?!0:u;let W;e[0]!==d.length?(W=()=>kn(d.length),e[0]=d.length,e[1]=W):W=e[1];const[O,l]=w.useState(W),[T,ae]=w.useState(null),[P,de]=w.useState(r),[A,le]=w.useState(d.length),M=w.useRef(!1);P!==r?(de(r),le(d.length),l(kn(d.length))):A!==d.length&&(le(d.length),l(z=>Nr(z,d.length)));let se;e[2]===Symbol.for("react.memo_cache_sentinel")?(se={activationConstraint:{distance:8}},e[2]=se):se=e[2];let oe;e[3]===Symbol.for("react.memo_cache_sentinel")?(oe={coordinateGetter:Un},e[3]=oe):oe=e[3];const Se=Bn(_t(zn,se),_t(Fn,oe));let I;e[4]!==O?(I=O.map(Mr),e[4]=O,e[5]=I):I=e[5];const te=I;let q;e[6]===Symbol.for("react.memo_cache_sentinel")?(q=z=>{ae(String(z.active.id))},e[6]=q):q=e[6];const ie=q;let V;e[7]!==te||e[8]!==g?(V=z=>{ae(null);const{active:_,over:H}=z;if(!H||_.id===H.id)return;const Le=te.indexOf(String(_.id)),Be=te.indexOf(String(H.id));Le===-1||Be===-1||(l(We=>Qn(mt([...We],Le,Be))),M.current=!0,requestAnimationFrame(()=>{M.current=!1}),g?.(Le,Be))},e[7]=te,e[8]=g,e[9]=V):V=e[9];const he=V;let K;e[10]===Symbol.for("react.memo_cache_sentinel")?(K=()=>{ae(null)},e[10]=K):K=e[10];const ce=K;let X,Y,L,B,Z,G,ee,ne,me,F,E,De,_e,Me,ke;if(e[11]!==T||e[12]!==Q||e[13]!==O||e[14]!==te||e[15]!==he||e[16]!==h||e[17]!==k||e[18]!==C||e[19]!==S||e[20]!==o||e[21]!==x||e[22]!==D||e[23]!==f||e[24]!==N||e[25]!==j||e[26]!==c||e[27]!==d||e[28]!==v||e[29]!==Se){Me=Symbol.for("react.early_return_sentinel");e:{const z=_=>{M.current||f(_)};if(e[45]!==T||e[46]!==Q||e[47]!==O||e[48]!==k||e[49]!==c||e[50]!==d){const _=T?O.find(H=>H.id===T):null;if(B=_!=null?d[_.index]:null,L=_!=null?c[_.index]:void 0,O.length===0){let H;e[54]===Symbol.for("react.memo_cache_sentinel")?(H=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:"No sections in this page."}),e[54]=H):H=e[54];const Le=!Q;let Be;e[55]===Symbol.for("react.memo_cache_sentinel")?(Be=n.jsx(qt,{size:14}),e[55]=Be):Be=e[55];let We;e[56]!==k||e[57]!==Le?(We=n.jsxs("div",{className:"space-y-2",children:[H,n.jsxs(Ue,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Le,onClick:k,children:[Be,"Add section"]})]}),e[56]=k,e[57]=Le,e[58]=We):We=e[58],Me=We;break e}_e=Re(_&&"cursor-grabbing"),e[45]=T,e[46]=Q,e[47]=O,e[48]=k,e[49]=c,e[50]=d,e[51]=L,e[52]=B,e[53]=_e}else L=e[51],B=e[52],_e=e[53];Y=Wn,ne=Se,me=qn,F=ie,E=he,De=ce,X=Yn,G=te,ee=cr,ke="space-y-1",Z=O.map(_=>{const H=d[_.index];return H?n.jsx(Rr,{sortableId:_.id,section:H,raw:c[_.index],meta:h,selected:v===_.index,onSelect:()=>z(_.index),onDelete:()=>S(_.index),onDuplicate:()=>x(_.index),onMakeReusable:()=>D(_.index),onToggleHidden:()=>N(_.index),onToggleLazy:()=>j(_.index),onAddVariant:()=>C(_.index),onDetach:()=>o(_.index)},_.id):null})}e[11]=T,e[12]=Q,e[13]=O,e[14]=te,e[15]=he,e[16]=h,e[17]=k,e[18]=C,e[19]=S,e[20]=o,e[21]=x,e[22]=D,e[23]=f,e[24]=N,e[25]=j,e[26]=c,e[27]=d,e[28]=v,e[29]=Se,e[30]=X,e[31]=Y,e[32]=L,e[33]=B,e[34]=Z,e[35]=G,e[36]=ee,e[37]=ne,e[38]=me,e[39]=F,e[40]=E,e[41]=De,e[42]=_e,e[43]=Me,e[44]=ke}else X=e[30],Y=e[31],L=e[32],B=e[33],Z=e[34],G=e[35],ee=e[36],ne=e[37],me=e[38],F=e[39],E=e[40],De=e[41],_e=e[42],Me=e[43],ke=e[44];if(Me!==Symbol.for("react.early_return_sentinel"))return Me;let Te;e[59]!==Z||e[60]!==ke?(Te=n.jsx("div",{className:ke,children:Z}),e[59]=Z,e[60]=ke,e[61]=Te):Te=e[61];let Ce;e[62]!==X||e[63]!==G||e[64]!==ee||e[65]!==Te?(Ce=n.jsx(X,{items:G,strategy:ee,children:Te}),e[62]=X,e[63]=G,e[64]=ee,e[65]=Te,e[66]=Ce):Ce=e[66];let Ke;e[67]!==L||e[68]!==B||e[69]!==h?(Ke=B?n.jsx("div",{className:Re("cursor-grabbing shadow-lg ring-1 ring-border/60",Zn(B,!1)),children:n.jsx(Xn,{section:B,raw:L,meta:h})}):null,e[67]=L,e[68]=B,e[69]=h,e[70]=Ke):Ke=e[70];let we;e[71]!==Ke?(we=n.jsx(Jn,{dropAnimation:null,children:Ke}),e[71]=Ke,e[72]=we):we=e[72];let Ee;e[73]!==Y||e[74]!==ne||e[75]!==me||e[76]!==F||e[77]!==E||e[78]!==De||e[79]!==Ce||e[80]!==we?(Ee=n.jsxs(Y,{sensors:ne,collisionDetection:me,onDragStart:F,onDragEnd:E,onDragCancel:De,children:[Ce,we]}),e[73]=Y,e[74]=ne,e[75]=me,e[76]=F,e[77]=E,e[78]=De,e[79]=Ce,e[80]=we,e[81]=Ee):Ee=e[81];const Oe=!Q;let re;e[82]===Symbol.for("react.memo_cache_sentinel")?(re=n.jsx(qt,{size:14}),e[82]=re):re=e[82];let ue;e[83]!==k||e[84]!==Oe?(ue=n.jsxs(Ue,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:Oe,onClick:k,children:[re,"Add section"]}),e[83]=k,e[84]=Oe,e[85]=ue):ue=e[85];let $e;return e[86]!==_e||e[87]!==Ee||e[88]!==ue?($e=n.jsxs("div",{className:_e,children:[Ee,ue]}),e[86]=_e,e[87]=Ee,e[88]=ue,e[89]=$e):$e=e[89],$e}function Mr(m){return m.id}function Er(m){const e=Ie.c(38),{open:r,initialName:c,autoLabel:d,isPending:h,onSubmit:v,onOpenChange:f}=m,g=h===void 0?!1:h,[S,x]=w.useState(c),[D,N]=w.useState(r);r!==D&&(N(r),r&&x(c));let j;e[0]!==g||e[1]!==f?(j=oe=>{!oe&&!g&&f(!1)},e[0]=g,e[1]=f,e[2]=j):j=e[2];const C=j;let o;e[3]!==g||e[4]!==S||e[5]!==v?(o=async oe=>{oe.preventDefault(),!g&&await v(S.trim())},e[3]=g,e[4]=S,e[5]=v,e[6]=o):o=e[6];const k=o;let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Xa,{children:"Rename variant"}),e[7]=u):u=e[7];const Q=d||"the rule";let W;e[8]!==Q?(W=n.jsxs(Za,{children:[u,n.jsxs(Ga,{children:["Save this matcher as a global block with a custom label. Leave empty to inline the matcher again and fall back to"," ",n.jsx("span",{className:"font-medium",children:Q}),"."]})]}),e[8]=Q,e[9]=W):W=e[9];let O;e[10]===Symbol.for("react.memo_cache_sentinel")?(O=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[10]=O):O=e[10];let l;e[11]===Symbol.for("react.memo_cache_sentinel")?(l=oe=>x(oe.target.value),e[11]=l):l=e[11];let T;e[12]!==d||e[13]!==g||e[14]!==S?(T=n.jsxs("div",{className:"space-y-1.5 py-4",children:[O,n.jsx(sr,{id:"variant-rename-name",value:S,onChange:l,placeholder:d,autoFocus:!0,disabled:g})]}),e[12]=d,e[13]=g,e[14]=S,e[15]=T):T=e[15];let ae;e[16]!==f?(ae=()=>f(!1),e[16]=f,e[17]=ae):ae=e[17];let P;e[18]!==g||e[19]!==ae?(P=n.jsx(Ue,{type:"button",variant:"outline",onClick:ae,disabled:g,children:"Cancel"}),e[18]=g,e[19]=ae,e[20]=P):P=e[20];let de;e[21]!==g?(de=g?n.jsxs(n.Fragment,{children:[n.jsx(Dn,{size:14,className:"animate-spin"}),"Saving…"]}):"Save",e[21]=g,e[22]=de):de=e[22];let A;e[23]!==g||e[24]!==de?(A=n.jsx(Ue,{type:"submit",disabled:g,children:de}),e[23]=g,e[24]=de,e[25]=A):A=e[25];let le;e[26]!==P||e[27]!==A?(le=n.jsxs(er,{children:[P,A]}),e[26]=P,e[27]=A,e[28]=le):le=e[28];let M;e[29]!==k||e[30]!==le||e[31]!==W||e[32]!==T?(M=n.jsx(tr,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:k,children:[W,T,le]})}),e[29]=k,e[30]=le,e[31]=W,e[32]=T,e[33]=M):M=e[33];let se;return e[34]!==C||e[35]!==r||e[36]!==M?(se=n.jsx(nr,{open:r,onOpenChange:C,children:M}),e[34]=C,e[35]=r,e[36]=M,e[37]=se):se=e[37],se}const $r="oklch(0.65 0.15 160)",Gn="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 Yt(m){const e=Ie.c(5),{rule:r,matchers:c}=m,d=r?.__resolveType??"";let h;if(e[0]!==c||e[1]!==d){const S=c.find(x=>x.resolveType===d)?.iconName??ra(d);h=qa(S),e[0]=c,e[1]=d,e[2]=h}else h=e[2];const v=h;if(!v)return null;let f;return e[3]!==v?(f=n.jsx(v,{size:14,className:"shrink-0"}),e[3]=v,e[4]=f):f=e[4],f}function wn(m){return m.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
2
- `)}function Ut(m){return m.map((e,r)=>({id:crypto.randomUUID(),index:r,variant:e}))}function Kr(m){return m.map((e,r)=>({...e,index:r}))}function Or(m){const e=Ie.c(55),{entry:r,sortableId:c,isActive:d,canDelete:h,decofile:v,meta:f,matchers:g,onSelect:S,onRename:x,onDuplicate:D,onDelete:N}=m;let j;e[0]!==c?(j={id:c,animateLayoutChanges:Fr},e[0]=c,e[1]=j):j=e[1];const{attributes:C,listeners:o,setNodeRef:k,transform:u,isDragging:Q}=In(j);let W;e[2]!==u?(W=Hn.Transform.toString(u?{...u,y:0}:null),e[2]=u,e[3]=W):W=e[3];const O=Q?0:void 0;let l;e[4]!==W||e[5]!==O?(l={transform:W,opacity:O},e[4]=W,e[5]=O,e[6]=l):l=e[6];const T=l,ae=f??void 0;let P;e[7]!==v||e[8]!==r.variant.rule||e[9]!==ae?(P=jt(r.variant.rule,v,ae),e[7]=v,e[8]=r.variant.rule,e[9]=ae,e[10]=P):P=e[10];const de=P,A=d?Gn:"text-muted-foreground hover:bg-muted hover:text-foreground",le=Q?"cursor-grabbing":"cursor-grab";let M;e[11]!==A||e[12]!==le?(M=Re("group shrink-0 inline-flex items-center rounded-md transition-colors touch-none",A,le),e[11]=A,e[12]=le,e[13]=M):M=e[13];let se;e[14]!==de||e[15]!==g?(se=n.jsx(Yt,{rule:de,matchers:g}),e[14]=de,e[15]=g,e[16]=se):se=e[16];let oe;e[17]!==r.variant.label?(oe=n.jsx("span",{className:"truncate",children:r.variant.label}),e[17]=r.variant.label,e[18]=oe):oe=e[18];let Se;e[19]!==C||e[20]!==o||e[21]!==S||e[22]!==se||e[23]!==oe?(Se=n.jsxs("button",{type:"button",...C,...o,onClick:S,className:"inline-flex items-center gap-1.5 h-8 pl-3 pr-1.5 text-sm font-medium cursor-[inherit]",children:[se,oe]}),e[19]=C,e[20]=o,e[21]=S,e[22]=se,e[23]=oe,e[24]=Se):Se=e[24];const I=`Actions for ${r.variant.label}`,te=d&&"opacity-100";let q;e[25]!==te?(q=Re("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",te),e[25]=te,e[26]=q):q=e[26];let ie;e[27]===Symbol.for("react.memo_cache_sentinel")?(ie=n.jsx(An,{size:12}),e[27]=ie):ie=e[27];let V;e[28]!==I||e[29]!==q?(V=n.jsx(Kn,{asChild:!0,children:n.jsx("button",{type:"button","aria-label":I,onClick:Br,onPointerDown:Lr,className:q,children:ie})}),e[28]=I,e[29]=q,e[30]=V):V=e[30];let he;e[31]===Symbol.for("react.memo_cache_sentinel")?(he=n.jsx(xr,{size:14}),e[31]=he):he=e[31];let K;e[32]!==x?(K=n.jsxs(Ze,{onClick:x,children:[he,"Rename"]}),e[32]=x,e[33]=K):K=e[33];let ce;e[34]===Symbol.for("react.memo_cache_sentinel")?(ce=n.jsx(En,{size:14}),e[34]=ce):ce=e[34];let X;e[35]!==D?(X=n.jsxs(Ze,{onClick:D,children:[ce,"Duplicate"]}),e[35]=D,e[36]=X):X=e[36];let Y;e[37]===Symbol.for("react.memo_cache_sentinel")?(Y=n.jsx(lr,{}),e[37]=Y):Y=e[37];const L=!h;let B;e[38]===Symbol.for("react.memo_cache_sentinel")?(B=n.jsx($n,{size:14}),e[38]=B):B=e[38];let Z;e[39]!==N||e[40]!==L?(Z=n.jsxs(Ze,{variant:"destructive",disabled:L,onClick:N,children:[B,"Delete"]}),e[39]=N,e[40]=L,e[41]=Z):Z=e[41];let G;e[42]!==K||e[43]!==X||e[44]!==Z?(G=n.jsxs(Ln,{align:"start",className:"w-36",children:[K,X,Y,Z]}),e[42]=K,e[43]=X,e[44]=Z,e[45]=G):G=e[45];let ee;e[46]!==V||e[47]!==G?(ee=n.jsxs(On,{children:[V,G]}),e[46]=V,e[47]=G,e[48]=ee):ee=e[48];let ne;return e[49]!==k||e[50]!==T||e[51]!==Se||e[52]!==ee||e[53]!==M?(ne=n.jsxs("div",{ref:k,style:T,className:M,children:[Se,ee]}),e[49]=k,e[50]=T,e[51]=Se,e[52]=ee,e[53]=M,e[54]=ne):ne=e[54],ne}function Lr(m){return m.stopPropagation()}function Br(m){return m.stopPropagation()}function Fr(){return!1}function zr(m){const e=Ie.c(13),{variant:r,decofile:c,meta:d,matchers:h}=m,v=d??void 0;let f;e[0]!==c||e[1]!==v||e[2]!==r.rule?(f=jt(r.rule,c,v),e[0]=c,e[1]=v,e[2]=r.rule,e[3]=f):f=e[3];const g=f;let S;e[4]===Symbol.for("react.memo_cache_sentinel")?(S=Re("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",Gn),e[4]=S):S=e[4];let x;e[5]!==g||e[6]!==h?(x=n.jsx(Yt,{rule:g,matchers:h}),e[5]=g,e[6]=h,e[7]=x):x=e[7];let D;e[8]!==r.label?(D=n.jsx("span",{className:"truncate",children:r.label}),e[8]=r.label,e[9]=D):D=e[9];let N;return e[10]!==x||e[11]!==D?(N=n.jsxs("div",{className:S,children:[x,D]}),e[10]=x,e[11]=D,e[12]=N):N=e[12],N}function Ir(m){const e=Ie.c(78),{listKey:r,variants:c,activeIndex:d,decofile:h,meta:v,matchers:f,onSelect:g,onReorder:S,onRename:x,onDuplicate:D,onDelete:N,onAdd:j}=m;let C;e[0]!==c?(C=()=>Ut(c),e[0]=c,e[1]=C):C=e[1];const[o,k]=w.useState(C),[u,Q]=w.useState(null),[W,O]=w.useState(r),[l,T]=w.useState(c.length);let ae;e[2]!==c?(ae=()=>wn(c),e[2]=c,e[3]=ae):ae=e[3];const[P,de]=w.useState(ae),A=w.useRef(!1),le=wn(c);W!==r?(O(r),T(c.length),de(le),k(Ut(c))):l!==c.length?(T(c.length),de(le),k(Ut(c))):P!==le&&(de(le),k($e=>c.map((z,_)=>({id:$e[_]?.id??crypto.randomUUID(),index:_,variant:z}))));let M;e[4]===Symbol.for("react.memo_cache_sentinel")?(M={activationConstraint:{distance:8}},e[4]=M):M=e[4];let se;e[5]===Symbol.for("react.memo_cache_sentinel")?(se={coordinateGetter:Un},e[5]=se):se=e[5];const oe=Bn(_t(zn,M),_t(Fn,se));let Se;e[6]!==o?(Se=o.map(Hr),e[6]=o,e[7]=Se):Se=e[7];const I=Se,te=c.length>1;let q;e[8]!==o?(q=$e=>{const z=String($e.active.id);Q(o.find(_=>_.id===z)??null)},e[8]=o,e[9]=q):q=e[9];const ie=q;let V;e[10]!==I||e[11]!==S?(V=$e=>{Q(null);const{active:z,over:_}=$e;if(!_||z.id===_.id)return;const H=I.indexOf(String(z.id)),Le=I.indexOf(String(_.id));H===-1||Le===-1||(k(Be=>Kr(mt([...Be],H,Le))),A.current=!0,requestAnimationFrame(()=>{A.current=!1}),S(H,Le))},e[10]=I,e[11]=S,e[12]=V):V=e[12];const he=V;let K;e[13]===Symbol.for("react.memo_cache_sentinel")?(K=()=>{Q(null)},e[13]=K):K=e[13];const ce=K;let X,Y,L,B,Z,G,ee,ne,me,F,E,De;if(e[14]!==u||e[15]!==d||e[16]!==te||e[17]!==h||e[18]!==o||e[19]!==I||e[20]!==he||e[21]!==ie||e[22]!==f||e[23]!==v||e[24]!==N||e[25]!==D||e[26]!==x||e[27]!==g||e[28]!==oe){const $e=_=>{A.current||g(_)};E="flex items-center border-b shrink-0";const z=u&&"cursor-grabbing";e[41]!==z?(F=Re("flex flex-1 min-w-0 items-center gap-1.5 pl-3 pr-2 py-2 overflow-x-auto",z),e[41]=z,e[42]=F):F=e[42],Y=Wn,Z=oe,G=qn,ee=ie,ne=he,me=ce,X=Yn,De=I,L=ur,B=o.map(_=>n.jsx(Or,{sortableId:_.id,entry:_,isActive:_.index===d,canDelete:te,decofile:h,meta:v,matchers:f,onSelect:()=>$e(_.index),onRename:()=>x(_.index),onDuplicate:()=>D(_.index),onDelete:()=>N(_.index)},_.id)),e[14]=u,e[15]=d,e[16]=te,e[17]=h,e[18]=o,e[19]=I,e[20]=he,e[21]=ie,e[22]=f,e[23]=v,e[24]=N,e[25]=D,e[26]=x,e[27]=g,e[28]=oe,e[29]=X,e[30]=Y,e[31]=L,e[32]=B,e[33]=Z,e[34]=G,e[35]=ee,e[36]=ne,e[37]=me,e[38]=F,e[39]=E,e[40]=De}else X=e[29],Y=e[30],L=e[31],B=e[32],Z=e[33],G=e[34],ee=e[35],ne=e[36],me=e[37],F=e[38],E=e[39],De=e[40];let _e;e[43]!==X||e[44]!==L||e[45]!==B||e[46]!==De?(_e=n.jsx(X,{items:De,strategy:L,children:B}),e[43]=X,e[44]=L,e[45]=B,e[46]=De,e[47]=_e):_e=e[47];let Me;e[48]!==u||e[49]!==h||e[50]!==f||e[51]!==v?(Me=u?n.jsx(zr,{variant:u.variant,decofile:h,meta:v,matchers:f}):null,e[48]=u,e[49]=h,e[50]=f,e[51]=v,e[52]=Me):Me=e[52];let ke;e[53]!==Me?(ke=n.jsx(Jn,{dropAnimation:null,children:Me}),e[53]=Me,e[54]=ke):ke=e[54];let Te;e[55]!==Y||e[56]!==Z||e[57]!==G||e[58]!==ee||e[59]!==ne||e[60]!==me||e[61]!==_e||e[62]!==ke?(Te=n.jsxs(Y,{sensors:Z,collisionDetection:G,onDragStart:ee,onDragEnd:ne,onDragCancel:me,children:[_e,ke]}),e[55]=Y,e[56]=Z,e[57]=G,e[58]=ee,e[59]=ne,e[60]=me,e[61]=_e,e[62]=ke,e[63]=Te):Te=e[63];let Ce;e[64]!==F||e[65]!==Te?(Ce=n.jsx("div",{className:F,children:Te}),e[64]=F,e[65]=Te,e[66]=Ce):Ce=e[66];let Ke;e[67]===Symbol.for("react.memo_cache_sentinel")?(Ke={color:$r},e[67]=Ke):Ke=e[67];let we;e[68]===Symbol.for("react.memo_cache_sentinel")?(we=n.jsx(qt,{size:14}),e[68]=we):we=e[68];let Ee;e[69]!==j?(Ee=n.jsx(at,{asChild:!0,children:n.jsx(Ue,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-8 shrink-0 cursor-pointer",style:Ke,onClick:j,children:we})}),e[69]=j,e[70]=Ee):Ee=e[70];let Oe;e[71]===Symbol.for("react.memo_cache_sentinel")?(Oe=n.jsx(rt,{side:"bottom",children:"Add variant"}),e[71]=Oe):Oe=e[71];let re;e[72]!==Ee?(re=n.jsx("div",{className:"shrink-0 pr-3 pl-1 py-2",children:n.jsxs(st,{children:[Ee,Oe]})}),e[72]=Ee,e[73]=re):re=e[73];let ue;return e[74]!==E||e[75]!==Ce||e[76]!==re?(ue=n.jsxs("div",{className:E,children:[Ce,re]}),e[74]=E,e[75]=Ce,e[76]=re,e[77]=ue):ue=e[77],ue}function Hr(m){return m.id}function Nn(m){const e=Ie.c(15),{schema:r,value:c,onChange:d,meta:h,decofile:v,onSaveReferencedBlock:f,sandbox:g}=m;let S;e[0]===Symbol.for("react.memo_cache_sentinel")?(S=[],e[0]=S):S=e[0];const[x,D]=w.useState(S);let N;e[1]!==x?(N=x.length>0&&n.jsxs("nav",{"aria-label":"Variant rule breadcrumb",className:"flex min-w-0 items-center gap-1 overflow-hidden text-xs",children:[n.jsx("button",{type:"button",onClick:()=>D([]),className:"flex shrink-0 items-center gap-0.5 rounded-md px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",title:"Back to rule",children:n.jsx(Ua,{className:"size-3.5"})}),x.map((o,k)=>{const u=k===x.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[k>0&&n.jsx(Vn,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>D(x.slice(0,k+1)),title:o,className:Re("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",u?"font-medium text-foreground":"text-muted-foreground"),children:o})]},`${o}-${k}`)})]}),e[1]=x,e[2]=N):N=e[2];let j;e[3]!==x||e[4]!==v||e[5]!==h||e[6]!==d||e[7]!==f||e[8]!==g||e[9]!==r||e[10]!==c?(j=n.jsx(Pn,{schema:r,value:c,onChange:d,basePath:"",breadcrumbPath:x,onBreadcrumbChange:D,meta:h,decofile:v,onSaveReferencedBlock:f,sandbox:g}),e[3]=x,e[4]=v,e[5]=h,e[6]=d,e[7]=f,e[8]=g,e[9]=r,e[10]=c,e[11]=j):j=e[11];let C;return e[12]!==N||e[13]!==j?(C=n.jsxs("div",{className:"space-y-2",children:[N,j]}),e[12]=N,e[13]=j,e[14]=C):C=e[14],C}function Rn(m){const e=Ie.c(21),{activeSchema:r,formValue:c,formResetKey:d,onFormChange:h,onBreadcrumbChange:v,breadcrumbPath:f,emptyMessage:g,beforeForm:S,seoResolveType:x,siteDefaultSeo:D,meta:N,decofile:j,onSaveReferencedBlock:C,sandbox:o}=m;let k;e[0]!==f?(k=f===void 0?[]:f,e[0]=f,e[1]=k):k=e[1];const u=k;let Q;e[2]!==r||e[3]!==u||e[4]!==j||e[5]!==d||e[6]!==c||e[7]!==N||e[8]!==v||e[9]!==h||e[10]!==C||e[11]!==o||e[12]!==x||e[13]!==D?(Q=r&&c?x?n.jsx(Sr,{schema:r,resolveType:x,value:c,formResetKey:d,onChange:h,onBreadcrumbChange:v,siteDefaultSeo:D}):n.jsx(Pn,{schema:r,value:c,onChange:h,basePath:"",breadcrumbPath:u,onBreadcrumbChange:v,meta:N,decofile:j,onSaveReferencedBlock:C,sandbox:o},d):null,e[2]=r,e[3]=u,e[4]=j,e[5]=d,e[6]=c,e[7]=N,e[8]=v,e[9]=h,e[10]=C,e[11]=o,e[12]=x,e[13]=D,e[14]=Q):Q=e[14];const W=Q;let O;e[15]!==g||e[16]!==W?(O=W??n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:g}),e[15]=g,e[16]=W,e[17]=O):O=e[17];let l;return e[18]!==S||e[19]!==O?(l=n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsxs("div",{className:"mx-auto max-w-2xl",children:[S,O]})}),e[18]=S,e[19]=O,e[20]=l):l=e[20],l}const Ur="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 Wr(m,e){return ba(m,e,nt)}function qr(m){const e=Ie.c(13),{pageKey:r,initialName:c,initialPath:d,onFieldChange:h}=m,[v,f]=w.useState(c),[g,S]=w.useState(d),[x,D]=w.useState(r);x!==r&&(D(r),f(c),S(d));let N;e[0]!==h?(N=u=>{f(u.target.value),h("name",u.target.value)},e[0]=h,e[1]=N):N=e[1];let j;e[2]!==v||e[3]!==N?(j=n.jsx("input",{type:"text",value:v,onChange:N,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]=v,e[3]=N,e[4]=j):j=e[4];let C;e[5]!==h?(C=u=>{S(u.target.value),h("path",u.target.value)},e[5]=h,e[6]=C):C=e[6];let o;e[7]!==g||e[8]!==C?(o=n.jsx("input",{type:"text",value:g,onChange:C,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]=g,e[8]=C,e[9]=o):o=e[9];let k;return e[10]!==j||e[11]!==o?(k=n.jsxs("div",{className:"space-y-1",children:[j,o]}),e[10]=j,e[11]=o,e[12]=k):k=e[12],k}function Cn(m){const e=Ie.c(6),{onClick:r}=m;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(Mn,{size:14}),e[0]=c):c=e[0];let d;e[1]!==r?(d=n.jsx(at,{asChild:!0,children:n.jsx(Ue,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-7 shrink-0 text-[oklch(0.65_0.15_160)]",onClick:r,children:c})}),e[1]=r,e[2]=d):d=e[2];let h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(rt,{side:"bottom",children:"Add variant"}),e[3]=h):h=e[3];let v;return e[4]!==d?(v=n.jsxs(st,{children:[d,h]}),e[4]=d,e[5]=v):v=e[5],v}function Cl({orgSlug:m,virtualMcpId:e,branch:r,previewReady:c=!0,previewUrl:d,currentPath:h,activePageBlockKey:v=null,activeGlobalBlockKey:f=null,externalSelectedIndex:g,onSaved:S,initialEditSeo:x=!1,onExitSeo:D,onViewJsonFile:N,onVariantPreviewOverride:j}){const C=c?{orgSlug:m,virtualMcpId:e,branch:r,previewUrl:d}:null,{data:o,isLoading:k}=oa(C),{data:u,isLoading:Q}=ia(C),W=la(),O=W?.entity?.id===e?W.entity.metadata?.siteSlug??null:null,[l,T]=w.useState(null),[ae,P]=w.useState(null),[de,A]=w.useState(null),[le,M]=w.useState(0),[se,oe]=w.useState(void 0),[Se,I]=w.useState(null),[te,q]=w.useState(null),[ie,V]=w.useState([]),[he,K]=w.useState(0),[ce,X]=w.useState(null),[Y,L]=w.useState(null),[B,Z]=w.useState(!0),[G,ee]=w.useState(!1),[ne,me]=w.useState(!1),[F,E]=w.useState(x),[De,_e]=w.useState(x);x&&!De&&(_e(!0),E(!0),T(null),P(null),A(null),V([])),!x&&De&&_e(!1);const[Me,ke]=w.useState(null),[Te,Ce]=w.useState(void 0),[Ke,we]=w.useState([]),[Ee,Oe]=w.useState(0),[re,ue]=w.useState(0),[$e,z]=w.useState(null),[_,H]=w.useState(null),[Le,Be]=w.useState(null),We=Qs(),es=`${m}/${e}/${r}`,kt=ca({orgSlug:m,virtualMcpId:e,branch:r}),[ts,ns]=w.useState(h),[ss,as]=w.useState(v),[rs,os]=w.useState(f);(ts!==h||ss!==v||rs!==f)&&(queueMicrotask(()=>kt.flush()),ns(h),as(v),os(f),T(null),P(null),A(null),M(0),I(null),q(null),ue(0),z(null),H(null),V([]),K(t=>t+1),E(!1),ke(null),Ce(void 0),we([]),Oe(t=>t+1));const Pe=ua({orgSlug:m,virtualMcpId:e,branch:r}),ft=Ta((t,s)=>{Pe.mutate({blockKey:t,data:s},{onSuccess:()=>S?.(),onError:a=>pe.error(`Save failed: ${a.message}`)})}),Jt=da({orgSlug:m,virtualMcpId:e,branch:r}),[wt,Qt]=w.useState(!1),Nt=w.useRef(null),ot=w.useRef(null),it=w.useRef(null),Rt=w.useRef({}),qe=w.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!c||k||Q)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(Dn,{size:20,className:"animate-spin text-muted-foreground"})});if(!o||!u)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:"Could not load site data."});const is=ma(o),ve=!!f,Fe=ve?null:fa(is,h,v),b=ve?f:Fe?.key??null,Ct=ve&&f?o[f]:void 0,Xt=ve&&f&&Ct?pa(f,Ct):ve&&f?f:"",pt=!ve&&b&&o[b]?o[b]:null,Dt=F&&o&&u&&b&&Fe?_n(o,{kind:"page",pageKey:b,pageName:String(Fe.name??""),path:String(Fe.path??"")},u):null,ls=F?pt?.seo:void 0,Tt=Te!==void 0?Te:ls,cs=F?dr(Tt):void 0,us=Dt?.seoTypeOptions??[],ds=F&&u?mr(u):"",Zt=Me??cs??{},Pt=F&&Dt?fr(Zt,Dt):null,ms=F&&Pt&&pr(Tt)?xt(Pt,u):null,fs=F?hr(o,u)?.seoData:void 0,Ve=ve?[{label:"Default",sections:[{__resolveType:f}]}]:Wr(pt?.sections,o??{}),ht=Ve.length>1,je=Math.min(le,Ve.length-1),Ge=Ve[je],U=Ge?.sections??[],Ne=bt(U,o),Gt=!ve&&ha(pt?.sections);if(ve&&f&&Le!==f){Be(f);const t=U[0],s=Ne[0];if(t&&s){T(0),ue(0),V([]);const a=tt(t,s,o);a&&(P(a.data),A(a.resolveType),H(null),z(null))}}!ve&&Le!==null&&Be(null),qe.current={rawSections:U,parsedSections:Ne,decofile:o??{},activePageKey:b,pageVariants:Ve,variantIndex:je,sectionVariantIndex:re,selectedSectionIndex:l};const ps=()=>({multivariate:Gt,index:je,variants:Ve.map(t=>({rule:t.rule}))}),en=(t,s)=>{if(!j)return;if(!b||!Gt||t.length<=1){j(null);return}const a=yn(b,{multivariate:!0,index:s,variants:t},o,u);j(a.length>0?a:null)},lt=(t,s,a)=>{if(!j)return;if(!b){j(null);return}const i=ps(),p=yn(b,i,o,u);if(!t||s<0){j(p.length>0?p:null);return}const R=Oa({pageKey:b,page:i,sectionIndex:s,sectionLazy:Ne[s]?.isLazy??!1,mvObj:t,selectedVariantIndex:a,decofile:o,meta:u}),y=[...p,...R];j(y.length>0?y:null)},Ye=(t,s,a,i=l??-1,p=!1)=>{const R=Xe(t,s);if(!R){P(null),A(null),H(null),z(null),p&&lt(null,i,a);return}const $=gn(R,nt)[a];if(!$){P(null),A(null),H(null),z(null),p&&lt(null,i,a);return}const ge=ya($.value,o);P(ge?.data??null),A(ge?.resolveType??null);const{resolveType:J,formValue:fe}=Bt($.rule,o,u??void 0);H(J),z(fe),p&&lt(R,i,a)};if(g!==void 0&&g!==se&&(oe(g??null),typeof g=="number")){const t=U[g],s=Ne[g];if(t&&s)if(T(g),ue(0),V([]),K(a=>a+1),s.isMultivariate)Ye(t,s,0,g);else{const a=tt(t,s,o);a?(P(a.data),A(a.resolveType)):(P(null),A(null)),H(null),z(null)}}const gt={orgSlug:m,virtualMcpId:e,branch:r,previewUrl:d??void 0,siteSlug:O},Vt=de&&u?xt(de,u):null,ze=(t,s)=>{if(!b)return;const a=zt(o,b,t,je,Ve);Pe.mutate({blockKey:b,data:a},{onSuccess:()=>s?.onSuccess?.()??S?.(),onError:i=>pe.error(`Save failed: ${i.message}`)})},ct=()=>{T(null),P(null),A(null),ue(0),z(null),H(null),V([]),K(t=>t+1)},hs=(t,s)=>{Nt.current&&clearTimeout(Nt.current);const a=qe.current.sectionVariantIndex;Nt.current=setTimeout(()=>{const{rawSections:i,parsedSections:p,decofile:R,activePageKey:y,pageVariants:$,variantIndex:ge}=qe.current,J=i[s];if(!J)return;const fe=p[s];if(!fe)return;if(fe.isSavedBlock){const be=fe.isLazy?J.section?.__resolveType??J.__resolveType:J.__resolveType;Pe.mutate({blockKey:be,data:t},{onSuccess:()=>S?.(),onError:ye=>pe.error(`Save failed: ${ye.message}`)});return}if(!y)return;const xe={...R[y]},Ae=[...i];if(fe.isMultivariate){const be=Xe(J,fe);if(!be||!y)return;const ye=Fa(be,a,t);Ae[s]=dt(J,fe,ye)}else if(fe.isHidden){const be=Tn(J.__resolveType),ye=be?{...J.section}:{...J},He=Array.isArray(ye.variants)?[...ye.variants]:[];He[0]&&(He[0]={...He[0],value:t}),ye.variants=He,be?Ae[s]={...J,section:ye}:Ae[s]=ye}else fe.isLazy?Ae[s]={...J,section:t}:Ae[s]=t;if($.length>1){const be=xe.sections,ye=[...be?.variants??[]];ye[ge]&&(ye[ge]={...ye[ge],value:Ae}),xe.sections={...be,variants:ye}}else xe.sections=Ae;Pe.mutate({blockKey:y,data:xe},{onSuccess:()=>S?.(),onError:be=>pe.error(`Save failed: ${be.message}`)})},Ht)},gs=t=>{T(t),ue(0),V([]),K(p=>p+1);const s=U[t],a=Ne[t];if(!s||!a)return;if(a.isMultivariate){Ye(s,a,0,t);return}const i=tt(s,a,o);if(!i){P(null),A(null),H(null),z(null),lt(null,t,0);return}P(i.data),A(i.resolveType),H(null),z(null),lt(null,t,0)},tn=t=>{const s=t;P(s),l!==null&&hs(s,l)},At=t=>{if(!b||!o||!u||!Fe)return;const s={kind:"page",pageKey:b,pageName:String(Fe.name??""),path:String(Fe.path??"")},a=_n(o,s,u);a&&kt.save(b,()=>{const i=We.getQueryData(Xs.decofile(es))?.[b];if(!i||typeof i!="object"||i===null||Array.isArray(i))return null;const p={...i,...Rt.current};return Rt.current={},t?.raw!==void 0?{...p,seo:t.raw}:t?.inner!==void 0?vr(s,a,p,t.inner):p})},vs=(t,s)=>{b&&(Rt.current[t]=s,At())},Ss=(t,s)=>{if(!b)return;const a=mt([...U],t,s);l!==null&&(l===t?T(s):t<l&&s>=l?T(l-1):t>l&&s<=l&&T(l+1)),ze(a)},xs=t=>{if(!b)return;const s=U.filter((a,i)=>i!==t);l===t?ct():l!==null&&l>t&&T(l-1),ze(s)},bs=t=>{if(!b)return;const s=U[t];if(!s)return;const a=[...U];a.splice(t+1,0,Ma(s)),l!==null&&l>t&&T(l+1),ze(a)},ys=t=>{if(!b)return;const s=U[t],a=Ne[t];if(!s||!a||a.isMultivariate)return;const i=a.isHidden?Va(s):Aa(s);if(!i)return;const p=[...U];p[t]=i,l===t&&ct(),ze(p)},js=t=>{if(!b)return;const s=U[t],a=Ne[t];if(!s||!a||a.isMultivariate)return;const i=Pa(s);if(!i)return;const p=[...U];p[t]=i,l===t&&ct(),ze(p)},_s=t=>{if(!b)return;const s=U[t],a=Ne[t];if(!s||!a?.isSavedBlock)return;const i=tt(s,a,o);if(!i?.data)return;const{name:p,...R}=i.data,y=[...U];a.isLazy?y[t]={...s,section:R}:y[t]=R,l===t&&ct(),ze(y)},ks=t=>{if(!b)return;const s=[...U,{__resolveType:t.resolveType}],a=s.length-1;ze(s,{onSuccess:()=>{ee(!1),T(a),ue(0),V([]),K(y=>y+1);const i=s[a],p=bt(s,o)[a];if(!i||!p)return;if(p.isMultivariate){Ye(i,p,0);return}const R=tt(i,p,o);if(!R){P(null),A(null),H(null),z(null);return}P(R.data),A(R.resolveType),H(null),z(null)}})},ws=t=>{if(l===null)return;const s=U[l],a=Ne[l];!s||!a?.isMultivariate||(ue(t),V([]),K(i=>i+1),Ye(s,a,t,l,!0))},Ns=t=>{if(l===null||!b)return;const s=U[l],a=Ne[l];if(!s||!a?.isMultivariate)return;const i=Xe(s,a);if(!i)return;const p=Ca(i,t);if(!p){pe.error("Cannot delete the only variant.");return}const R=[...U];R[l]=dt(s,a,p);const y=p.variants;let $=re;t===re?$=Math.min(t,y.length-1):t<re&&($=re-1),ue($),V([]),K(ge=>ge+1),Ye(R[l],a,$),ze(R)},Rs=t=>{if(l===null||!b)return;const s=U[l],a=Ne[l];if(!s||!a?.isMultivariate)return;const i=Xe(s,a);if(!i)return;const p=Da(i,t),R=[...U];R[l]=dt(s,a,p);const y=t+1;ue(y),V([]),K($=>$+1),Ye(R[l],a,y),ze(R)},Cs=(t,s)=>{if(l===null||!b||t===s)return;const a=U[l],i=Ne[l];if(!a||!i?.isMultivariate)return;const p=Xe(a,i);if(!p)return;const R=Na(p,t,s),y=[...U];y[l]=dt(a,i,R);let $=re;re===t?$=s:t<re&&s>=re?$=re-1:t>re&&s<=re&&($=re+1),ue($),Ye(y[l],i,$),ze(y)},Mt=t=>{const s=t??l;if(s===null||!b)return;const a=U[s],i=Ne[s];if(!a||!i)return;const p=ja(a,i);if(!p){pe.error("This section cannot have variants.");return}const R=[...U];R[s]=p.section;const y=bt(R,o)[s];if(!y?.isMultivariate){pe.error("Could not add variant.");return}T(s),ue(p.newVariantIndex),V([]),K($=>$+1),Ye(p.section,y,p.newVariantIndex,s),ze(R)},Ds=()=>{if(l===null||!b)return;const t=U[l],s=Ne[l];if(!t||!s?.isMultivariate)return;const a=Xe(t,s);if(!a)return;const i=Ra(t,s,a);if(!i){pe.error("Could not remove variants.");return}const p=[...U];p[l]=i;const R=bt(p,o)[l];if(!R)return;ue(0),H(null),z(null),V([]),K($=>$+1);const y=tt(i,R,o);y?(P(y.data),A(y.resolveType)):(P(null),A(null)),lt(null,l,0),ze(p)},Ts=async t=>{if(ce===null||!b)return;const s=bn(t,o);if(s){pe.error(s);return}const a=U[ce],i=Ne[ce];if(!a||!i)return;const p=tt(a,i,o);if(!p){pe.error("This section cannot be saved as global.");return}const R={...p.data,name:t};try{await Pe.mutateAsync({blockKey:t,data:R});const y=[...U];y[ce]={__resolveType:t},await Pe.mutateAsync({blockKey:b,data:zt(o,b,y,je,Ve)}),l===ce&&ct(),X(null),pe.success(`Saved global block "${t}"`),S?.()}catch(y){pe.error(y instanceof Error?y.message:"Failed to save global block")}},nn=Ge?.rule;if(ht&&l===null&&te===null&&nn){const{resolveType:t,formValue:s}=Bt(nn,o??{},u??void 0);q(t),I(s)}const vt=u?ga(u):[],Ps=!ve&&!!(d&&u&&o),sn=te&&u?xt(te,u):null,Vs=()=>{ot.current&&(clearTimeout(ot.current),ot.current=null),it.current&&(clearTimeout(it.current),it.current=null)},an=async(t,s)=>{if(!(za(s,t,u)>0))try{await Jt.mutateAsync({blockKey:t})}catch(a){pe.error(a instanceof Error?a.message:"Could not delete matcher block")}},rn=t=>{ot.current&&clearTimeout(ot.current),ot.current=setTimeout(()=>{const{activePageKey:s,decofile:a,variantIndex:i}=qe.current;if(!s)return;const p={...a[s]},R={...p.sections},y=[...R.variants??[]],$=y[i],ge=$?.rule;if(Ft(ge,a,u)){const J=ge?.__resolveType??"",fe=a[J],xe=typeof fe?.name=="string"?fe.name:J,{__resolveType:Ae,...be}=t;Pe.mutate({blockKey:J,data:It(Ae??"",be,xe)},{onSuccess:()=>S?.(),onError:ye=>pe.error(`Save failed: ${ye.message}`)});return}$&&(y[i]={...$,rule:t}),p.sections={...R,variants:y},Pe.mutate({blockKey:s,data:p},{onSuccess:()=>S?.(),onError:J=>pe.error(`Save failed: ${J.message}`)})},Ht)},As=t=>{q(t);const s=t?{__resolveType:t}:{__resolveType:jn};I({}),rn(s)},Ms=t=>{const s=t;I(s);const a=te?{__resolveType:te,...s}:{...s};rn(a)},on=t=>{it.current&&clearTimeout(it.current);const{selectedSectionIndex:s,sectionVariantIndex:a}=qe.current;s!==null&&(it.current=setTimeout(()=>{const{rawSections:i,parsedSections:p,decofile:R,activePageKey:y,pageVariants:$,variantIndex:ge}=qe.current;if(!y)return;const J=i[s],fe=p[s];if(!J||!fe?.isMultivariate)return;const xe=Xe(J,fe);if(!xe)return;const Ae=Ba(xe,a,t),be=[...i];be[s]=dt(J,fe,Ae);const ye=zt(R,y,be,ge,$);Pe.mutate({blockKey:y,data:ye},{onSuccess:()=>S?.(),onError:He=>pe.error(`Save failed: ${He.message}`)})},Ht))},Es=t=>{H(t),z({}),on(t?{__resolveType:t}:{__resolveType:jn})},$s=t=>{const s=t;z(s);const a=_?{__resolveType:_,...s}:{...s};on(a)};if(!ve&&!Fe)return n.jsxs("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:["No page found for ",h]});if(ve&&!Ct)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:"Global block not found"});const Je=l!==null?Ne[l]??null:null,ln=l!==null?U[l]:null,cn=ln&&Je?.isMultivariate?Xe(ln,Je):null,St=cn?gn(cn,nt):[],Et=Math.min(re,Math.max(St.length-1,0)),$t=St[Et]??null,et=Je?.isMultivariate===!0,un=l!==null&&Je!==null,ut=un&&(et||!!(Vt&&ae)),Ks=ut&&!ve&&Je?.isSavedBlock===!0,Qe=ve||Ks,Os=ve?Xt:Je?.label??"",dn=_&&u?xt(_,u):null,Kt=ut&&(!ve||ie.length>0)?ve?[Xt,...ie]:[Fe.name,Je.label,...et&&$t?[$t.label]:[],...ie]:[],Ls=F&&Fe?[Fe.name,"SEO",...Ke]:[],mn=F?Ls:Qe?Kt.length>0?Kt:[Os]:Kt,fn=()=>{if(!b)return;const t=o[b],s=_a(t.sections,U);if(!s)return;const a=ka(s);Pe.mutate({blockKey:b,data:{...t,sections:s}},{onSuccess:()=>{M(a),T(null),P(null),A(null),V([]),I(null),q(null)},onError:i=>pe.error(`Save failed: ${i.message}`)})},Ot=(t,s,a)=>{if(!b)return;const i=o[b],p=i.sections;if(!p||typeof p!="object"||Array.isArray(p))return;const R=p;if(!Array.isArray(R.variants))return;const y=t([...R.variants]);if(!y)return;const $=La(R,y),ge={...o,[b]:{...i,sections:$}};Pe.mutate({blockKey:b,data:ge[b]},{onSuccess:()=>{s?.(),a&&an(a,ge)},onError:J=>pe.error(`Save failed: ${J.message}`)})},Bs=t=>{L(null),M(t),T(null),P(null),A(null),V([]);const s=Ve[t]?.rule,{resolveType:a,formValue:i}=Bt(s,o??{},u??void 0);q(a),I(i),en(Ve.map(p=>({rule:p.rule})),t)},Fs=(t,s)=>{if(t===s)return;let a=je;je===t?a=s:t<je&&s>=je?a=je-1:t>je&&s<=je&&(a=je+1),M(a);const i=mt(Ve.map(p=>({rule:p.rule})),t,s);en(i,a),Ot(p=>mt(p,t,s))},zs=t=>{const s=Ve[t]?.rule,a=wa(s,o??{},u??void 0);Ot(i=>i.length<=1?null:(i.splice(t,1),i),()=>{Ve.length-1===1?M(0):t<je?M(je-1):t===je&&M(Math.max(0,t-1)),T(null),P(null),A(null),V([]),I(null),q(null)},a)},Is=t=>{Ot(s=>Ia(s,t),()=>{M(t+1),T(null),P(null),A(null),V([]),I(null),q(null)})},Hs=async(t,s)=>{Vs();const a=qe.current.activePageKey,i=qe.current.decofile;if(!a)return;const p=i[a],R=p.sections;if(!R||typeof R!="object"||Array.isArray(R))return;const y=R;if(!Array.isArray(y.variants))return;const $=[...y.variants],ge=$[t];if(!ge?.rule||typeof ge.rule!="object"){pe.error("This variant has no matcher rule to rename.");return}const J=ge.rule,fe=s.trim();Qt(!0);try{if(!fe){if(!Ft(J,i,u)){L(null);return}const Lt=J.__resolveType??"";$[t]={...ge,rule:Ea(J,i,u)};const hn={...i,[a]:{...p,sections:{...y,variants:$}}};await Pe.mutateAsync({blockKey:a,data:hn[a]}),await an(Lt,hn),L(null),S?.();return}const xe=$a(J,i,u);if(!xe){pe.error("Could not read this variant's matcher rule.");return}if(xe.blockKey){await Pe.mutateAsync({blockKey:xe.blockKey,data:It(xe.resolveType,xe.data,fe)}),L(null),S?.();return}const Ae=xn(fe),be=bn(Ae,i);if(be){pe.error(be);return}const ye=It(xe.resolveType,xe.data,fe);let He=null;try{await Pe.mutateAsync({blockKey:Ae,data:ye}),He=Ae,$[t]={...ge,rule:Ka(Ae)},await Pe.mutateAsync({blockKey:a,data:{...p,sections:{...y,variants:$}}}),He=null}catch(Lt){throw He&&await Jt.mutateAsync({blockKey:He}).catch(()=>{}),Lt}L(null),pe.success(`Saved matcher as global block "${fe}"`),S?.()}catch(xe){pe.error(xe instanceof Error?xe.message:"Failed to rename variant")}finally{Qt(!1)}},pn=()=>{ct()},Us=t=>{ke(t),At({inner:t})},Ws=t=>{Ce(t),At({raw:t})},qs=()=>{ke(null),we([])},Ys=()=>Oe(t=>t+1),Js=t=>{if(F){if(t===0){kt.flush(),E(!1),ke(null),Ce(void 0),we([]),Oe(a=>a+1),D?.();return}if(t===1){we([]),Oe(a=>a+1);return}we(Ke.slice(0,t-1)),Oe(a=>a+1);return}if(ve){V(ie.slice(0,t)),K(a=>a+1);return}if(t===0){pn();return}if(t===1){V([]),K(a=>a+1);return}if(et&&t===2){V([]),K(a=>a+1);return}const s=et?2:1;V(ie.slice(0,t-s))};return n.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[n.jsx("div",{className:"shrink-0",children:Qe||ut||F?n.jsxs("div",{className:Re("border-b px-3 py-2.5",Qe&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[!ve&&ht&&Ge&&n.jsxs("button",{type:"button",onClick:pn,title:`Editing in variant: ${Ge.label}`,className:Re("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",Ur),children:[n.jsx(Yt,{rule:jt(Ge.rule,o??{},u??void 0),matchers:vt}),n.jsx("span",{className:"max-w-[160px] truncate",children:Ge.label})]}),n.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:mn.map((t,s)=>{const a=s===mn.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[s>0&&n.jsx(Vn,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>Js(s),title:t,className:Re("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",a?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:t})]},`${t}-${s}`)})}),Qe&&n.jsxs(st,{children:[n.jsx(at,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(Qa,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.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."})]}),un&&!et&&!Je?.isHidden&&b&&n.jsx(Cn,{onClick:()=>Mt()})]}),Qe&&n.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."})]}):n.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(qr,{pageKey:b,initialName:Fe.name,initialPath:Fe.path,onFieldChange:vs})}),n.jsxs(st,{children:[n.jsx(at,{asChild:!0,children:n.jsx(Ue,{type:"button",variant:"ghost",size:"icon","aria-label":"Edit SEO",className:"size-7 shrink-0",onClick:()=>E(!0),children:n.jsx(Ya,{size:14})})}),n.jsx(rt,{side:"bottom",children:"Edit SEO"})]}),n.jsxs(st,{children:[n.jsx(at,{asChild:!0,children:n.jsx(Ue,{type:"button",variant:"ghost",size:"icon","aria-label":"View JSON",className:"size-7 shrink-0",onClick:()=>N&&b?N(b):me(!0),children:n.jsx(Ja,{size:14})})}),n.jsx(rt,{side:"bottom",children:"View JSON"})]}),n.jsx(Cn,{onClick:fn})]})}),ht&&!ut&&!F&&b&&n.jsx(Ir,{listKey:b,variants:Ve,activeIndex:je,decofile:o??{},meta:u,matchers:vt,onSelect:Bs,onReorder:Fs,onRename:L,onDuplicate:Is,onDelete:zs,onAdd:fn}),F?n.jsx(yt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:pt&&b?n.jsx(gr,{rawSeo:Tt,innerSeo:Zt,defaultResolveType:ds,seoSchema:ms,activeResolveType:Pt,seoTypeOptions:us,formResetKey:Ee,siteDefaultSeo:fs,onBreadcrumbChange:we,onPersistRaw:Ws,onInnerChange:Us,onClearForm:qs,onBumpFormKey:Ys}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"SEO schema not found for this site."})})})}):ut?n.jsxs(yt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[et&&St.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(va,{listKey:`${b??""}:${l??""}`,variants:St.map((t,s)=>({index:s,label:t.label})),selectedIndex:Et,onSelect:ws,onDuplicate:Rs,onDelete:Ns,onRemoveAll:Ds,onReorder:Cs,onAdd:()=>Mt()}),et&&n.jsxs("div",{className:"px-3 py-3 border-b space-y-2",children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variant rule"}),n.jsx(vn,{currentRt:_??"",currentLabel:nt($t?.rule),matchers:vt,onSelect:Es}),dn&&$e&&n.jsx("div",{className:"pt-1",children:n.jsx(Nn,{schema:dn,value:$e,onChange:$s,meta:u??void 0,decofile:o,onSaveReferencedBlock:ft,sandbox:gt},`${l??"none"}:${Et}:${_??""}`)})]})]}),n.jsx(Rn,{activeSchema:Vt,formValue:ae,formResetKey:he,onFormChange:tn,onBreadcrumbChange:V,breadcrumbPath:ie,emptyMessage:"No editable fields for this variant.",meta:u,decofile:o,onSaveReferencedBlock:ft,sandbox:gt})]}):ve?n.jsx(yt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(Rn,{activeSchema:Vt,formValue:ae,formResetKey:he,onFormChange:tn,onBreadcrumbChange:V,breadcrumbPath:ie,emptyMessage:"No editable fields for this global block.",meta:u,decofile:o,onSaveReferencedBlock:ft,sandbox:gt})}):n.jsxs(yt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[ht&&te!==null&&n.jsxs("div",{className:Re("px-3 border-b",B?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>Z(t=>!t),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":B,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variant rule"}),B?n.jsx(Wa,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(Ha,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),B&&n.jsxs("div",{className:Re("space-y-3",wt&&"pointer-events-none opacity-50"),children:[n.jsx(vn,{currentRt:te,currentLabel:Sn(Ge?.rule,o??{},nt,u??void 0),matchers:vt,onSelect:As}),sn&&Se&&n.jsx("div",{className:"space-y-3",children:n.jsx(Nn,{schema:sn,value:Se,onChange:Ms,meta:u??void 0,decofile:o,onSaveReferencedBlock:ft,sandbox:gt},`${je}:${te??""}`)})]})]}),n.jsx("div",{className:"p-2 pt-3",children:n.jsx(Ar,{listKey:`${b??""}-${je}`,rawSections:U,sections:Ne,meta:u,selectedIndex:l,onSelect:gs,onReorder:Ss,onDelete:xs,onDuplicate:bs,onMakeReusable:X,onToggleHidden:ys,onToggleLazy:js,onAddVariant:Mt,onDetach:_s,onAddSection:()=>ee(!0),canAddSection:Ps})})]}),n.jsx(Sa,{open:ce!==null,onOpenChange:t=>{t||X(null)},defaultBlockId:ce!==null?xn(Ne[ce]?.label??""):"",isPending:Pe.isPending,onSubmit:Ts}),d&&n.jsx(br,{open:G,onOpenChange:ee,meta:u,decofile:o,previewBaseUrl:d,onSelect:ks}),ne&&b&&o&&n.jsx(xa,{open:ne,onOpenChange:me,pageKey:b,decofile:o}),Y!==null&&n.jsx(Er,{open:!0,initialName:Ft(Ve[Y]?.rule,o??{},u??void 0)?Sn(Ve[Y]?.rule,o??{},nt,u??void 0):"",autoLabel:nt(jt(Ve[Y]?.rule,o??{},u??void 0)),isPending:wt,onSubmit:async t=>{await Hs(Y,t)},onOpenChange:t=>{!t&&!wt&&L(null)}})]})}export{Cl as SectionsEditor};
1
+ import{c as Ie,r as w,l as Re,j as n,B as Ue,i as Dn,m as Qs,t as pe,K as Xs}from"./index-BEjmlKPl.js";import{r as Zs,a as Gs,s as ea,i as Tn,c as ta,b as na,G as sa,V as aa,d as ra,e as jt,f as oa,g as ia,h as la,j as ca,k as ua,l as da,m as ma,n as fa,o as pa,p as xt,q as bt,t as ha,v as tt,w as Bt,x as ga,y as Xe,z as gn,S as va,M as vn,A as nt,B as Sn,C as Sa,D as xn,P as xa,E as Ft,F as ba,H as ya,I as ja,J as _a,K as ka,L as wa,N as Na,O as dt,Q as Ra,R as Ca,T as Da,U as Ta,W as Pa,X as Va,Y as Aa,Z as Ma,_ as bn,$ as zt,a0 as Ea,a1 as $a,a2 as It,a3 as Ka,a4 as yn,a5 as Oa,a6 as La,a7 as Ba,a8 as Ht,a9 as Fa,aa as za,ab as Pn,ac as jn,ad as Ia}from"./index-xtrjWgZh.js";import{t as Ha}from"./ChevronDown-C6GKFdlz.js";import{n as Ua}from"./ChevronLeft-B_g3Odoj.js";import{i as Vn}from"./ChevronRight-_T91Ki1i.js";import{n as Wa}from"./ChevronUp-C73sdCjg.js";import{K as Wt,D as An,W as Mn,l as qa,L as Ya,M as Ja}from"./agent-icon-CDWUrKO6.js";import{i as Qa}from"./Globe01-jb99gJfY.js";import{S as yt}from"./scroll-area-DCf9FU8S.js";import{T as st,a as at,b as rt}from"./tooltip-vrtDbf-F.js";import{d as Xa,c as Za,e as Ga,D as er,b as tr,a as nr}from"./dialog-Hh5ovGLY.js";import{I as sr}from"./input-Csk5e2yH.js";import{s as ar,a as En}from"./Eye-CmIsbgje.js";import{d as rr}from"./ZoomOut-N-7VqfhT.js";import{i as or}from"./Settings02-B1ys_QsX.js";import{s as qt}from"./Plus-DaRhyqSH.js";import{s as $n}from"./Trash01-2mnBLeel.js";import{i as ir}from"./Zap-CkUSEY1J.js";import{c as Ze,a as Kn,D as On,b as Ln,g as lr}from"./dropdown-menu-CVNL6sbF.js";import{b as Bn,c as _t,K as Fn,P as zn,e as In,C as Hn,s as Un,l as mt,D as Wn,d as qn,S as Yn,v as cr,k as Jn,p as ur}from"./sortable.esm-DHABQEKH.js";import{r as _n,u as dr,d as mr,a as fr,i as pr,f as hr,P as gr,b as vr,S as Sr}from"./page-seo-form-B2_5Qimo.js";import{b as xr}from"./Tool01-UFRB7Gn8.js";import{A as br}from"./add-section-modal-DCuBNkTr.js";import"./index-DMwgNM3s.js";import"./chat-context-CcIPgTva.js";import"./hooks-Cm8G1vlN.js";import"./use-mcp-client-DdEyuuWo.js";import"./auth-DnFlop4R.js";import"./decopilot-sse-pool-BxlWS7lz.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-CytuWVRm.js";import"./use-collections-DkNJNG6n.js";import"./use-ai-providers-SEySB86N.js";import"./studio-tools-E6eV6Arx.js";import"./tab-id-BptcWVWa.js";import"./use-organization-settings-CyhRZcil.js";import"./drawer-SgGGijSm.js";import"./collection-search-OPVOwF6w.js";import"./SearchMd-TIrNRuOw.js";import"./use-mobile-C7loFyQ0.js";import"./use-mcp-prompts-DqUyy9S8.js";import"./X-D_jt_5zi.js";import"./shell-layout-R4zDjERM.js";import"./avatar-C765fdJ7.js";import"./User01-D61Pj0Jp.js";import"./Users03-CsRyhHB5.js";import"./SearchLg-C7PlcyS-.js";import"./Stars02-BBfjmRkO.js";import"./XClose-C6a8uvfS.js";import"./CheckCircle-B6MW1yw_.js";import"./FilterLines-Br0k3Gt9.js";import"./required-auth-layout-BfuMObCG.js";import"./use-org-sso-SRgmMZqR.js";import"./SwitchHorizontal01-BPwURr_K.js";import"./ZapSquare-CwzduoBx.js";import"./Star01-DPd1XEvi.js";import"./Upload01-BxxwdIAZ.js";import"./AlertCircle-qsmFLzIS.js";import"./form-vkZSNPAt.js";import"./label-P9D2uSqZ.js";import"./select-f-UK5_IH.js";import"./XCircle-Cr_Uaxeq.js";import"./tabs-DCWgt9U2.js";import"./toggle-group-DqYtGmOf.js";import"./Monitor01-DLOF_NPZ.js";import"./connect-desktop-dialog-C95eK0uT.js";import"./decopilot-CdQeVtVh.js";import"./checkbox-D9k8y94F.js";import"./skeleton-DLjQYeS_.js";import"./Key01--rf2r0q7.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-LAhWYbh9.js";import"./card-CYYTvdp-.js";import"./ArrowUpRight-yJehGCq_.js";import"./Stars01-CFQgPhA5.js";import"./popover-CXYDmYeq.js";import"./command-gl-L1UMo.js";import"./index-b3uLeNQ7.js";import"./useInfiniteQuery-Cm9C_gzI.js";import"./use-infinite-scroll-DUbloeNA.js";import"./question-004-sINsf4GQ.js";import"./integration-icon-BubYo_JB.js";import"./use-status-sounds-D8xk5cTm.js";import"./empty-state-C5ufqcxL.js";import"./toolbar-C5mHjU06.js";import"./preview-dialog-DPmt4gXJ.js";import"./LinkExternal01-DgKre-XN.js";import"./index-5EogW27n.js";import"./file-type-icon-b6CTHv4I.js";import"./LayoutLeft-Dpq1l3Cs.js";import"./use-connection-DUBWvt9B.js";import"./use-mcp-tools-CgsqmnJG.js";import"./types-Cpxi5nja.js";import"./use-capability-BF81OxAF.js";import"./textarea-cMx1Sjw5.js";import"./shell-route-loading-DHNvhkbM.js";import"./extract-connection-data-Dl7BC58q.js";import"./index-BA1nWkqk.js";import"./mcp-oauth-C9EbOVQM.js";import"./badge-CgUoAb0G.js";import"./connection-slug-eyAPH6o3.js";import"./alert-dialog-DwrOZyIa.js";import"./switch-CIDHMPBy.js";import"./Play-CAoWwsoA.js";import"./use-debounced-autosave-BwLKL-15.js";import"./index-kmrmjjsI.js";import"./sidebar-CFbvOGM6.js";import"./sheet-Dz5C6OGo.js";import"./search-input-Cec8OPCx.js";import"./collection-tabs-CRf8Ijmq.js";import"./github-repo-picker-DjgoP8zv.js";import"./use-debounced-value-BMcX8uyD.js";import"./authenticate-and-persist-oauth-7MZHsMGS.js";import"./use-navigate-to-agent-C3I5i4Gg.js";import"./Users01-enhuFvLY.js";import"./use-secrets-f-qJA1xx.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./view-mode-toggle-B0C659uf.js";import"./DotsVertical-BOTJmIm_.js";import"./automation-runs-BJ__6yJz.js";import"./table-FWIaAi69.js";import"./use-members-BhBptkRX.js";import"./use-org-auth-client-B9guhhqA.js";import"./task-status-CBSgsj9C.js";import"./use-automations-BWMuOB-g.js";import"./useSuspenseInfiniteQuery-Dl9xywRE.js";import"./use-file-configs-BLZ83KSj.js";import"./monaco-editor-Bk0ouh6L.js";import"./select-model-DXfyq6oG.js";import"./automation-list-row-D88Ulzbg.js";import"./Globe04-BoJpZpky.js";import"./HardDrive-tK8cadSs.js";import"./Sun-D1BAkaT6.js";import"./Palette-B13aA9KG.js";import"./Shield01-cnNeKMKA.js";import"./use-clock-tick-v8inwCL3.js";import"./use-copy-BGZ8Ttn0.js";import"./content-blocks-o63cs2vh.js";import"./connection-card-DQuoMZlF.js";import"./use-registry-connections-JP-nn714.js";import"./connection-form-helpers-Bjlqqa5J.js";function yr(m){return m.schema?.definitions??m.schema?.$defs??{}}function jr(m,e){const r=yr(e),c=r[btoa(m)];if(!c)return;let d=typeof c.image=="string"?c.image:void 0;if(!d&&Array.isArray(c.allOf)){const h=c.allOf.find(v=>typeof v.$ref=="string")?.$ref;if(typeof h=="string"){const v=h.replace("#/definitions/",""),f=r[v];d=typeof f?.image=="string"?f.image:void 0}}if(d?.includes("{{{"))return d}function _r(m,e){if(!e)return;const r=Zs(m);if(!r)return;const c=jr(r.resolveType,e);if(!c)return;const d=Gs(c,r.data);if(d)return ea(d)}const kr="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",wr="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 kn(m){return Array.from({length:m},(e,r)=>({id:crypto.randomUUID(),index:r}))}function Qn(m){return m.map((e,r)=>({...e,index:r}))}function Nr(m,e){if(e===m.length)return m;if(e<m.length)return Qn(m.slice(0,e));const r=Array.from({length:e-m.length},(c,d)=>({id:crypto.randomUUID(),index:m.length+d}));return[...m,...r]}function Xn(m){const e=Ie.c(20),{section:r,raw:c,meta:d}=m,h=r.isSavedBlock===!0,v=r.isMultivariate===!0;let f;e[0]!==d||e[1]!==c?(f=c&&d?_r(c,d):void 0,e[0]=d,e[1]=c,e[2]=f):f=e[2];const g=f;let S;e[3]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx(rr,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[3]=S):S=e[3];let x;e[4]!==g?(x=g&&n.jsx("img",{src:g,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[4]=g,e[5]=x):x=e[5];let D;e[6]!==v||e[7]!==h?(D=h?{color:sa}:v?{color:"oklch(0.65 0.15 160)"}:void 0,e[6]=v,e[7]=h,e[8]=D):D=e[8];let N;e[9]!==D?(N=n.jsx(Wt,{className:"h-4 w-4 shrink-0",style:D}),e[9]=D,e[10]=N):N=e[10];const j=r.isHidden&&"line-through opacity-50";let C;e[11]!==j?(C=Re("min-w-0 flex-1 truncate text-sm font-medium",j),e[11]=j,e[12]=C):C=e[12];let o;e[13]!==r.label||e[14]!==C?(o=n.jsx("span",{className:C,children:r.label}),e[13]=r.label,e[14]=C,e[15]=o):o=e[15];let k;return e[16]!==x||e[17]!==N||e[18]!==o?(k=n.jsxs(n.Fragment,{children:[S,x,N,o]}),e[16]=x,e[17]=N,e[18]=o,e[19]=k):k=e[19],k}function Zn(m,e){const r=m.isSavedBlock===!0,c=m.isMultivariate===!0;return Re("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":r?kr:c?"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 Rr(m){const e=Ie.c(64),{section:r,raw:c,meta:d,sortableId:h,selected:v,onSelect:f,onDelete:g,onDuplicate:S,onMakeReusable:x,onToggleHidden:D,onToggleLazy:N,onAddVariant:j,onDetach:C}=m,o=c?Tn(c.__resolveType??""):!1;let k;e[0]!==r?(k=ta(r),e[0]=r,e[1]=k):k=e[1];const u=k;let Q;e[2]!==h?(Q={id:h,animateLayoutChanges:Vr},e[2]=h,e[3]=Q):Q=e[3];const{attributes:W,listeners:O,setNodeRef:l,transform:T,isDragging:ae}=In(Q);let P;e[4]!==T?(P=Hn.Transform.toString(T?{...T,x:0}:null),e[4]=T,e[5]=P):P=e[5];const de=ae?0:void 0;let A;e[6]!==P||e[7]!==de?(A={transform:P,opacity:de},e[6]=P,e[7]=de,e[8]=A):A=e[8];const le=A;let M;e[9]!==r?(M=na(r),e[9]=r,e[10]=M):M=e[10];const se=M,oe="button",Se=0;let I;e[11]!==f?(I=E=>{(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),f())},e[11]=f,e[12]=I):I=e[12];const te=ae?"cursor-grabbing":"cursor-pointer";let q;e[13]!==r||e[14]!==v||e[15]!==te?(q=Re("touch-none transition-colors",te,Zn(r,v)),e[13]=r,e[14]=v,e[15]=te,e[16]=q):q=e[16];let ie;e[17]!==d||e[18]!==c||e[19]!==r?(ie=n.jsx(Xn,{section:r,raw:c,meta:d}),e[17]=d,e[18]=c,e[19]=r,e[20]=ie):ie=e[20];const V=!r.isMultivariate&&n.jsxs(st,{children:[n.jsx(at,{asChild:!0,children:n.jsx(Ue,{type:"button",variant:"ghost",size:"icon","aria-label":o?"Disable async render":"Enable async render",className:Re("h-7 w-7 shrink-0",o?"":"opacity-0 group-hover:opacity-100"),onClick:E=>{E.stopPropagation(),N()},onPointerDown:Pr,children:n.jsx(ir,{className:Re("h-3.5 w-3.5",o&&"text-yellow-500")})})}),n.jsx(rt,{side:"bottom",children:o?"Disable async render":"Enable async render"})]});let he;e[21]!==D||e[22]!==r.isHidden||e[23]!==r.isMultivariate?(he=!r.isMultivariate&&n.jsxs(st,{children:[n.jsx(at,{asChild:!0,children:n.jsx(Ue,{type:"button",variant:"ghost",size:"icon","aria-label":r.isHidden?"Show section":"Hide section",className:Re("h-7 w-7 shrink-0",r.isHidden?"opacity-100":"opacity-0 group-hover:opacity-100"),onClick:E=>{E.stopPropagation(),D()},onPointerDown:Tr,children:r.isHidden?n.jsx(or,{className:"h-3.5 w-3.5"}):n.jsx(ar,{className:"h-3.5 w-3.5"})})}),n.jsx(rt,{side:"bottom",children:r.isHidden?"Show section":"Hide section"})]}),e[21]=D,e[22]=r.isHidden,e[23]=r.isMultivariate,e[24]=he):he=e[24];let K;e[25]===Symbol.for("react.memo_cache_sentinel")?(K=n.jsx(Kn,{asChild:!0,children:n.jsx(Ue,{type:"button",variant:"ghost",size:"icon","aria-label":"Section actions",className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100",onClick:Dr,onPointerDown:Cr,children:n.jsx(An,{className:"h-3.5 w-3.5"})})}),e[25]=K):K=e[25];let ce;e[26]!==S?(ce=E=>{E.stopPropagation(),S()},e[26]=S,e[27]=ce):ce=e[27];let X;e[28]===Symbol.for("react.memo_cache_sentinel")?(X=n.jsx(En,{className:"h-4 w-4"}),e[28]=X):X=e[28];let Y;e[29]!==ce?(Y=n.jsxs(Ze,{onClick:ce,children:[X,"Duplicate"]}),e[29]=ce,e[30]=Y):Y=e[30];let L;e[31]!==u||e[32]!==j?(L=u&&n.jsxs(Ze,{className:aa,onClick:E=>{E.stopPropagation(),j()},children:[n.jsx(Mn,{className:"h-4 w-4"}),"Add variant"]}),e[31]=u,e[32]=j,e[33]=L):L=e[33];let B;e[34]!==se||e[35]!==x?(B=se&&n.jsxs(Ze,{className:wr,onClick:E=>{E.stopPropagation(),x()},children:[n.jsx(Wt,{className:"h-4 w-4"}),"Make reusable"]}),e[34]=se,e[35]=x,e[36]=B):B=e[36];let Z;e[37]!==C||e[38]!==r.isMultivariate||e[39]!==r.isSavedBlock?(Z=r.isSavedBlock===!0&&!r.isMultivariate&&n.jsxs(Ze,{onClick:E=>{E.stopPropagation(),C()},children:[n.jsx(Wt,{className:"h-4 w-4"}),"Detach"]}),e[37]=C,e[38]=r.isMultivariate,e[39]=r.isSavedBlock,e[40]=Z):Z=e[40];let G;e[41]!==g?(G=E=>{E.stopPropagation(),g()},e[41]=g,e[42]=G):G=e[42];let ee;e[43]===Symbol.for("react.memo_cache_sentinel")?(ee=n.jsx($n,{className:"h-4 w-4"}),e[43]=ee):ee=e[43];let ne;e[44]!==G?(ne=n.jsxs(Ze,{className:"text-destructive focus:text-destructive",onClick:G,children:[ee,"Delete"]}),e[44]=G,e[45]=ne):ne=e[45];let me;e[46]!==Y||e[47]!==L||e[48]!==B||e[49]!==Z||e[50]!==ne?(me=n.jsxs(On,{children:[K,n.jsxs(Ln,{align:"end",className:"w-44",children:[Y,L,B,Z,ne]})]}),e[46]=Y,e[47]=L,e[48]=B,e[49]=Z,e[50]=ne,e[51]=me):me=e[51];let F;return e[52]!==W||e[53]!==O||e[54]!==f||e[55]!==l||e[56]!==le||e[57]!==q||e[58]!==ie||e[59]!==V||e[60]!==he||e[61]!==me||e[62]!==I?(F=n.jsxs("div",{ref:l,style:le,...W,...O,role:oe,tabIndex:Se,onClick:f,onKeyDown:I,className:q,children:[ie,V,he,me]}),e[52]=W,e[53]=O,e[54]=f,e[55]=l,e[56]=le,e[57]=q,e[58]=ie,e[59]=V,e[60]=he,e[61]=me,e[62]=I,e[63]=F):F=e[63],F}function Cr(m){return m.stopPropagation()}function Dr(m){return m.stopPropagation()}function Tr(m){return m.stopPropagation()}function Pr(m){return m.stopPropagation()}function Vr(){return!1}function Ar(m){const e=Ie.c(90),{listKey:r,rawSections:c,sections:d,meta:h,selectedIndex:v,onSelect:f,onReorder:g,onDelete:S,onDuplicate:x,onMakeReusable:D,onToggleHidden:N,onToggleLazy:j,onAddVariant:C,onDetach:o,onAddSection:k,canAddSection:u}=m,Q=u===void 0?!0:u;let W;e[0]!==d.length?(W=()=>kn(d.length),e[0]=d.length,e[1]=W):W=e[1];const[O,l]=w.useState(W),[T,ae]=w.useState(null),[P,de]=w.useState(r),[A,le]=w.useState(d.length),M=w.useRef(!1);P!==r?(de(r),le(d.length),l(kn(d.length))):A!==d.length&&(le(d.length),l(z=>Nr(z,d.length)));let se;e[2]===Symbol.for("react.memo_cache_sentinel")?(se={activationConstraint:{distance:8}},e[2]=se):se=e[2];let oe;e[3]===Symbol.for("react.memo_cache_sentinel")?(oe={coordinateGetter:Un},e[3]=oe):oe=e[3];const Se=Bn(_t(zn,se),_t(Fn,oe));let I;e[4]!==O?(I=O.map(Mr),e[4]=O,e[5]=I):I=e[5];const te=I;let q;e[6]===Symbol.for("react.memo_cache_sentinel")?(q=z=>{ae(String(z.active.id))},e[6]=q):q=e[6];const ie=q;let V;e[7]!==te||e[8]!==g?(V=z=>{ae(null);const{active:_,over:H}=z;if(!H||_.id===H.id)return;const Le=te.indexOf(String(_.id)),Be=te.indexOf(String(H.id));Le===-1||Be===-1||(l(We=>Qn(mt([...We],Le,Be))),M.current=!0,requestAnimationFrame(()=>{M.current=!1}),g?.(Le,Be))},e[7]=te,e[8]=g,e[9]=V):V=e[9];const he=V;let K;e[10]===Symbol.for("react.memo_cache_sentinel")?(K=()=>{ae(null)},e[10]=K):K=e[10];const ce=K;let X,Y,L,B,Z,G,ee,ne,me,F,E,De,_e,Me,ke;if(e[11]!==T||e[12]!==Q||e[13]!==O||e[14]!==te||e[15]!==he||e[16]!==h||e[17]!==k||e[18]!==C||e[19]!==S||e[20]!==o||e[21]!==x||e[22]!==D||e[23]!==f||e[24]!==N||e[25]!==j||e[26]!==c||e[27]!==d||e[28]!==v||e[29]!==Se){Me=Symbol.for("react.early_return_sentinel");e:{const z=_=>{M.current||f(_)};if(e[45]!==T||e[46]!==Q||e[47]!==O||e[48]!==k||e[49]!==c||e[50]!==d){const _=T?O.find(H=>H.id===T):null;if(B=_!=null?d[_.index]:null,L=_!=null?c[_.index]:void 0,O.length===0){let H;e[54]===Symbol.for("react.memo_cache_sentinel")?(H=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:"No sections in this page."}),e[54]=H):H=e[54];const Le=!Q;let Be;e[55]===Symbol.for("react.memo_cache_sentinel")?(Be=n.jsx(qt,{size:14}),e[55]=Be):Be=e[55];let We;e[56]!==k||e[57]!==Le?(We=n.jsxs("div",{className:"space-y-2",children:[H,n.jsxs(Ue,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Le,onClick:k,children:[Be,"Add section"]})]}),e[56]=k,e[57]=Le,e[58]=We):We=e[58],Me=We;break e}_e=Re(_&&"cursor-grabbing"),e[45]=T,e[46]=Q,e[47]=O,e[48]=k,e[49]=c,e[50]=d,e[51]=L,e[52]=B,e[53]=_e}else L=e[51],B=e[52],_e=e[53];Y=Wn,ne=Se,me=qn,F=ie,E=he,De=ce,X=Yn,G=te,ee=cr,ke="space-y-1",Z=O.map(_=>{const H=d[_.index];return H?n.jsx(Rr,{sortableId:_.id,section:H,raw:c[_.index],meta:h,selected:v===_.index,onSelect:()=>z(_.index),onDelete:()=>S(_.index),onDuplicate:()=>x(_.index),onMakeReusable:()=>D(_.index),onToggleHidden:()=>N(_.index),onToggleLazy:()=>j(_.index),onAddVariant:()=>C(_.index),onDetach:()=>o(_.index)},_.id):null})}e[11]=T,e[12]=Q,e[13]=O,e[14]=te,e[15]=he,e[16]=h,e[17]=k,e[18]=C,e[19]=S,e[20]=o,e[21]=x,e[22]=D,e[23]=f,e[24]=N,e[25]=j,e[26]=c,e[27]=d,e[28]=v,e[29]=Se,e[30]=X,e[31]=Y,e[32]=L,e[33]=B,e[34]=Z,e[35]=G,e[36]=ee,e[37]=ne,e[38]=me,e[39]=F,e[40]=E,e[41]=De,e[42]=_e,e[43]=Me,e[44]=ke}else X=e[30],Y=e[31],L=e[32],B=e[33],Z=e[34],G=e[35],ee=e[36],ne=e[37],me=e[38],F=e[39],E=e[40],De=e[41],_e=e[42],Me=e[43],ke=e[44];if(Me!==Symbol.for("react.early_return_sentinel"))return Me;let Te;e[59]!==Z||e[60]!==ke?(Te=n.jsx("div",{className:ke,children:Z}),e[59]=Z,e[60]=ke,e[61]=Te):Te=e[61];let Ce;e[62]!==X||e[63]!==G||e[64]!==ee||e[65]!==Te?(Ce=n.jsx(X,{items:G,strategy:ee,children:Te}),e[62]=X,e[63]=G,e[64]=ee,e[65]=Te,e[66]=Ce):Ce=e[66];let Ke;e[67]!==L||e[68]!==B||e[69]!==h?(Ke=B?n.jsx("div",{className:Re("cursor-grabbing shadow-lg ring-1 ring-border/60",Zn(B,!1)),children:n.jsx(Xn,{section:B,raw:L,meta:h})}):null,e[67]=L,e[68]=B,e[69]=h,e[70]=Ke):Ke=e[70];let we;e[71]!==Ke?(we=n.jsx(Jn,{dropAnimation:null,children:Ke}),e[71]=Ke,e[72]=we):we=e[72];let Ee;e[73]!==Y||e[74]!==ne||e[75]!==me||e[76]!==F||e[77]!==E||e[78]!==De||e[79]!==Ce||e[80]!==we?(Ee=n.jsxs(Y,{sensors:ne,collisionDetection:me,onDragStart:F,onDragEnd:E,onDragCancel:De,children:[Ce,we]}),e[73]=Y,e[74]=ne,e[75]=me,e[76]=F,e[77]=E,e[78]=De,e[79]=Ce,e[80]=we,e[81]=Ee):Ee=e[81];const Oe=!Q;let re;e[82]===Symbol.for("react.memo_cache_sentinel")?(re=n.jsx(qt,{size:14}),e[82]=re):re=e[82];let ue;e[83]!==k||e[84]!==Oe?(ue=n.jsxs(Ue,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:Oe,onClick:k,children:[re,"Add section"]}),e[83]=k,e[84]=Oe,e[85]=ue):ue=e[85];let $e;return e[86]!==_e||e[87]!==Ee||e[88]!==ue?($e=n.jsxs("div",{className:_e,children:[Ee,ue]}),e[86]=_e,e[87]=Ee,e[88]=ue,e[89]=$e):$e=e[89],$e}function Mr(m){return m.id}function Er(m){const e=Ie.c(38),{open:r,initialName:c,autoLabel:d,isPending:h,onSubmit:v,onOpenChange:f}=m,g=h===void 0?!1:h,[S,x]=w.useState(c),[D,N]=w.useState(r);r!==D&&(N(r),r&&x(c));let j;e[0]!==g||e[1]!==f?(j=oe=>{!oe&&!g&&f(!1)},e[0]=g,e[1]=f,e[2]=j):j=e[2];const C=j;let o;e[3]!==g||e[4]!==S||e[5]!==v?(o=async oe=>{oe.preventDefault(),!g&&await v(S.trim())},e[3]=g,e[4]=S,e[5]=v,e[6]=o):o=e[6];const k=o;let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Xa,{children:"Rename variant"}),e[7]=u):u=e[7];const Q=d||"the rule";let W;e[8]!==Q?(W=n.jsxs(Za,{children:[u,n.jsxs(Ga,{children:["Save this matcher as a global block with a custom label. Leave empty to inline the matcher again and fall back to"," ",n.jsx("span",{className:"font-medium",children:Q}),"."]})]}),e[8]=Q,e[9]=W):W=e[9];let O;e[10]===Symbol.for("react.memo_cache_sentinel")?(O=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[10]=O):O=e[10];let l;e[11]===Symbol.for("react.memo_cache_sentinel")?(l=oe=>x(oe.target.value),e[11]=l):l=e[11];let T;e[12]!==d||e[13]!==g||e[14]!==S?(T=n.jsxs("div",{className:"space-y-1.5 py-4",children:[O,n.jsx(sr,{id:"variant-rename-name",value:S,onChange:l,placeholder:d,autoFocus:!0,disabled:g})]}),e[12]=d,e[13]=g,e[14]=S,e[15]=T):T=e[15];let ae;e[16]!==f?(ae=()=>f(!1),e[16]=f,e[17]=ae):ae=e[17];let P;e[18]!==g||e[19]!==ae?(P=n.jsx(Ue,{type:"button",variant:"outline",onClick:ae,disabled:g,children:"Cancel"}),e[18]=g,e[19]=ae,e[20]=P):P=e[20];let de;e[21]!==g?(de=g?n.jsxs(n.Fragment,{children:[n.jsx(Dn,{size:14,className:"animate-spin"}),"Saving…"]}):"Save",e[21]=g,e[22]=de):de=e[22];let A;e[23]!==g||e[24]!==de?(A=n.jsx(Ue,{type:"submit",disabled:g,children:de}),e[23]=g,e[24]=de,e[25]=A):A=e[25];let le;e[26]!==P||e[27]!==A?(le=n.jsxs(er,{children:[P,A]}),e[26]=P,e[27]=A,e[28]=le):le=e[28];let M;e[29]!==k||e[30]!==le||e[31]!==W||e[32]!==T?(M=n.jsx(tr,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:k,children:[W,T,le]})}),e[29]=k,e[30]=le,e[31]=W,e[32]=T,e[33]=M):M=e[33];let se;return e[34]!==C||e[35]!==r||e[36]!==M?(se=n.jsx(nr,{open:r,onOpenChange:C,children:M}),e[34]=C,e[35]=r,e[36]=M,e[37]=se):se=e[37],se}const $r="oklch(0.65 0.15 160)",Gn="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 Yt(m){const e=Ie.c(5),{rule:r,matchers:c}=m,d=r?.__resolveType??"";let h;if(e[0]!==c||e[1]!==d){const S=c.find(x=>x.resolveType===d)?.iconName??ra(d);h=qa(S),e[0]=c,e[1]=d,e[2]=h}else h=e[2];const v=h;if(!v)return null;let f;return e[3]!==v?(f=n.jsx(v,{size:14,className:"shrink-0"}),e[3]=v,e[4]=f):f=e[4],f}function wn(m){return m.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
2
+ `)}function Ut(m){return m.map((e,r)=>({id:crypto.randomUUID(),index:r,variant:e}))}function Kr(m){return m.map((e,r)=>({...e,index:r}))}function Or(m){const e=Ie.c(55),{entry:r,sortableId:c,isActive:d,canDelete:h,decofile:v,meta:f,matchers:g,onSelect:S,onRename:x,onDuplicate:D,onDelete:N}=m;let j;e[0]!==c?(j={id:c,animateLayoutChanges:Fr},e[0]=c,e[1]=j):j=e[1];const{attributes:C,listeners:o,setNodeRef:k,transform:u,isDragging:Q}=In(j);let W;e[2]!==u?(W=Hn.Transform.toString(u?{...u,y:0}:null),e[2]=u,e[3]=W):W=e[3];const O=Q?0:void 0;let l;e[4]!==W||e[5]!==O?(l={transform:W,opacity:O},e[4]=W,e[5]=O,e[6]=l):l=e[6];const T=l,ae=f??void 0;let P;e[7]!==v||e[8]!==r.variant.rule||e[9]!==ae?(P=jt(r.variant.rule,v,ae),e[7]=v,e[8]=r.variant.rule,e[9]=ae,e[10]=P):P=e[10];const de=P,A=d?Gn:"text-muted-foreground hover:bg-muted hover:text-foreground",le=Q?"cursor-grabbing":"cursor-grab";let M;e[11]!==A||e[12]!==le?(M=Re("group shrink-0 inline-flex items-center rounded-md transition-colors touch-none",A,le),e[11]=A,e[12]=le,e[13]=M):M=e[13];let se;e[14]!==de||e[15]!==g?(se=n.jsx(Yt,{rule:de,matchers:g}),e[14]=de,e[15]=g,e[16]=se):se=e[16];let oe;e[17]!==r.variant.label?(oe=n.jsx("span",{className:"truncate",children:r.variant.label}),e[17]=r.variant.label,e[18]=oe):oe=e[18];let Se;e[19]!==C||e[20]!==o||e[21]!==S||e[22]!==se||e[23]!==oe?(Se=n.jsxs("button",{type:"button",...C,...o,onClick:S,className:"inline-flex items-center gap-1.5 h-8 pl-3 pr-1.5 text-sm font-medium cursor-[inherit]",children:[se,oe]}),e[19]=C,e[20]=o,e[21]=S,e[22]=se,e[23]=oe,e[24]=Se):Se=e[24];const I=`Actions for ${r.variant.label}`,te=d&&"opacity-100";let q;e[25]!==te?(q=Re("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",te),e[25]=te,e[26]=q):q=e[26];let ie;e[27]===Symbol.for("react.memo_cache_sentinel")?(ie=n.jsx(An,{size:12}),e[27]=ie):ie=e[27];let V;e[28]!==I||e[29]!==q?(V=n.jsx(Kn,{asChild:!0,children:n.jsx("button",{type:"button","aria-label":I,onClick:Br,onPointerDown:Lr,className:q,children:ie})}),e[28]=I,e[29]=q,e[30]=V):V=e[30];let he;e[31]===Symbol.for("react.memo_cache_sentinel")?(he=n.jsx(xr,{size:14}),e[31]=he):he=e[31];let K;e[32]!==x?(K=n.jsxs(Ze,{onClick:x,children:[he,"Rename"]}),e[32]=x,e[33]=K):K=e[33];let ce;e[34]===Symbol.for("react.memo_cache_sentinel")?(ce=n.jsx(En,{size:14}),e[34]=ce):ce=e[34];let X;e[35]!==D?(X=n.jsxs(Ze,{onClick:D,children:[ce,"Duplicate"]}),e[35]=D,e[36]=X):X=e[36];let Y;e[37]===Symbol.for("react.memo_cache_sentinel")?(Y=n.jsx(lr,{}),e[37]=Y):Y=e[37];const L=!h;let B;e[38]===Symbol.for("react.memo_cache_sentinel")?(B=n.jsx($n,{size:14}),e[38]=B):B=e[38];let Z;e[39]!==N||e[40]!==L?(Z=n.jsxs(Ze,{variant:"destructive",disabled:L,onClick:N,children:[B,"Delete"]}),e[39]=N,e[40]=L,e[41]=Z):Z=e[41];let G;e[42]!==K||e[43]!==X||e[44]!==Z?(G=n.jsxs(Ln,{align:"start",className:"w-36",children:[K,X,Y,Z]}),e[42]=K,e[43]=X,e[44]=Z,e[45]=G):G=e[45];let ee;e[46]!==V||e[47]!==G?(ee=n.jsxs(On,{children:[V,G]}),e[46]=V,e[47]=G,e[48]=ee):ee=e[48];let ne;return e[49]!==k||e[50]!==T||e[51]!==Se||e[52]!==ee||e[53]!==M?(ne=n.jsxs("div",{ref:k,style:T,className:M,children:[Se,ee]}),e[49]=k,e[50]=T,e[51]=Se,e[52]=ee,e[53]=M,e[54]=ne):ne=e[54],ne}function Lr(m){return m.stopPropagation()}function Br(m){return m.stopPropagation()}function Fr(){return!1}function zr(m){const e=Ie.c(13),{variant:r,decofile:c,meta:d,matchers:h}=m,v=d??void 0;let f;e[0]!==c||e[1]!==v||e[2]!==r.rule?(f=jt(r.rule,c,v),e[0]=c,e[1]=v,e[2]=r.rule,e[3]=f):f=e[3];const g=f;let S;e[4]===Symbol.for("react.memo_cache_sentinel")?(S=Re("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",Gn),e[4]=S):S=e[4];let x;e[5]!==g||e[6]!==h?(x=n.jsx(Yt,{rule:g,matchers:h}),e[5]=g,e[6]=h,e[7]=x):x=e[7];let D;e[8]!==r.label?(D=n.jsx("span",{className:"truncate",children:r.label}),e[8]=r.label,e[9]=D):D=e[9];let N;return e[10]!==x||e[11]!==D?(N=n.jsxs("div",{className:S,children:[x,D]}),e[10]=x,e[11]=D,e[12]=N):N=e[12],N}function Ir(m){const e=Ie.c(78),{listKey:r,variants:c,activeIndex:d,decofile:h,meta:v,matchers:f,onSelect:g,onReorder:S,onRename:x,onDuplicate:D,onDelete:N,onAdd:j}=m;let C;e[0]!==c?(C=()=>Ut(c),e[0]=c,e[1]=C):C=e[1];const[o,k]=w.useState(C),[u,Q]=w.useState(null),[W,O]=w.useState(r),[l,T]=w.useState(c.length);let ae;e[2]!==c?(ae=()=>wn(c),e[2]=c,e[3]=ae):ae=e[3];const[P,de]=w.useState(ae),A=w.useRef(!1),le=wn(c);W!==r?(O(r),T(c.length),de(le),k(Ut(c))):l!==c.length?(T(c.length),de(le),k(Ut(c))):P!==le&&(de(le),k($e=>c.map((z,_)=>({id:$e[_]?.id??crypto.randomUUID(),index:_,variant:z}))));let M;e[4]===Symbol.for("react.memo_cache_sentinel")?(M={activationConstraint:{distance:8}},e[4]=M):M=e[4];let se;e[5]===Symbol.for("react.memo_cache_sentinel")?(se={coordinateGetter:Un},e[5]=se):se=e[5];const oe=Bn(_t(zn,M),_t(Fn,se));let Se;e[6]!==o?(Se=o.map(Hr),e[6]=o,e[7]=Se):Se=e[7];const I=Se,te=c.length>1;let q;e[8]!==o?(q=$e=>{const z=String($e.active.id);Q(o.find(_=>_.id===z)??null)},e[8]=o,e[9]=q):q=e[9];const ie=q;let V;e[10]!==I||e[11]!==S?(V=$e=>{Q(null);const{active:z,over:_}=$e;if(!_||z.id===_.id)return;const H=I.indexOf(String(z.id)),Le=I.indexOf(String(_.id));H===-1||Le===-1||(k(Be=>Kr(mt([...Be],H,Le))),A.current=!0,requestAnimationFrame(()=>{A.current=!1}),S(H,Le))},e[10]=I,e[11]=S,e[12]=V):V=e[12];const he=V;let K;e[13]===Symbol.for("react.memo_cache_sentinel")?(K=()=>{Q(null)},e[13]=K):K=e[13];const ce=K;let X,Y,L,B,Z,G,ee,ne,me,F,E,De;if(e[14]!==u||e[15]!==d||e[16]!==te||e[17]!==h||e[18]!==o||e[19]!==I||e[20]!==he||e[21]!==ie||e[22]!==f||e[23]!==v||e[24]!==N||e[25]!==D||e[26]!==x||e[27]!==g||e[28]!==oe){const $e=_=>{A.current||g(_)};E="flex items-center border-b shrink-0";const z=u&&"cursor-grabbing";e[41]!==z?(F=Re("flex flex-1 min-w-0 items-center gap-1.5 pl-3 pr-2 py-2 overflow-x-auto",z),e[41]=z,e[42]=F):F=e[42],Y=Wn,Z=oe,G=qn,ee=ie,ne=he,me=ce,X=Yn,De=I,L=ur,B=o.map(_=>n.jsx(Or,{sortableId:_.id,entry:_,isActive:_.index===d,canDelete:te,decofile:h,meta:v,matchers:f,onSelect:()=>$e(_.index),onRename:()=>x(_.index),onDuplicate:()=>D(_.index),onDelete:()=>N(_.index)},_.id)),e[14]=u,e[15]=d,e[16]=te,e[17]=h,e[18]=o,e[19]=I,e[20]=he,e[21]=ie,e[22]=f,e[23]=v,e[24]=N,e[25]=D,e[26]=x,e[27]=g,e[28]=oe,e[29]=X,e[30]=Y,e[31]=L,e[32]=B,e[33]=Z,e[34]=G,e[35]=ee,e[36]=ne,e[37]=me,e[38]=F,e[39]=E,e[40]=De}else X=e[29],Y=e[30],L=e[31],B=e[32],Z=e[33],G=e[34],ee=e[35],ne=e[36],me=e[37],F=e[38],E=e[39],De=e[40];let _e;e[43]!==X||e[44]!==L||e[45]!==B||e[46]!==De?(_e=n.jsx(X,{items:De,strategy:L,children:B}),e[43]=X,e[44]=L,e[45]=B,e[46]=De,e[47]=_e):_e=e[47];let Me;e[48]!==u||e[49]!==h||e[50]!==f||e[51]!==v?(Me=u?n.jsx(zr,{variant:u.variant,decofile:h,meta:v,matchers:f}):null,e[48]=u,e[49]=h,e[50]=f,e[51]=v,e[52]=Me):Me=e[52];let ke;e[53]!==Me?(ke=n.jsx(Jn,{dropAnimation:null,children:Me}),e[53]=Me,e[54]=ke):ke=e[54];let Te;e[55]!==Y||e[56]!==Z||e[57]!==G||e[58]!==ee||e[59]!==ne||e[60]!==me||e[61]!==_e||e[62]!==ke?(Te=n.jsxs(Y,{sensors:Z,collisionDetection:G,onDragStart:ee,onDragEnd:ne,onDragCancel:me,children:[_e,ke]}),e[55]=Y,e[56]=Z,e[57]=G,e[58]=ee,e[59]=ne,e[60]=me,e[61]=_e,e[62]=ke,e[63]=Te):Te=e[63];let Ce;e[64]!==F||e[65]!==Te?(Ce=n.jsx("div",{className:F,children:Te}),e[64]=F,e[65]=Te,e[66]=Ce):Ce=e[66];let Ke;e[67]===Symbol.for("react.memo_cache_sentinel")?(Ke={color:$r},e[67]=Ke):Ke=e[67];let we;e[68]===Symbol.for("react.memo_cache_sentinel")?(we=n.jsx(qt,{size:14}),e[68]=we):we=e[68];let Ee;e[69]!==j?(Ee=n.jsx(at,{asChild:!0,children:n.jsx(Ue,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-8 shrink-0 cursor-pointer",style:Ke,onClick:j,children:we})}),e[69]=j,e[70]=Ee):Ee=e[70];let Oe;e[71]===Symbol.for("react.memo_cache_sentinel")?(Oe=n.jsx(rt,{side:"bottom",children:"Add variant"}),e[71]=Oe):Oe=e[71];let re;e[72]!==Ee?(re=n.jsx("div",{className:"shrink-0 pr-3 pl-1 py-2",children:n.jsxs(st,{children:[Ee,Oe]})}),e[72]=Ee,e[73]=re):re=e[73];let ue;return e[74]!==E||e[75]!==Ce||e[76]!==re?(ue=n.jsxs("div",{className:E,children:[Ce,re]}),e[74]=E,e[75]=Ce,e[76]=re,e[77]=ue):ue=e[77],ue}function Hr(m){return m.id}function Nn(m){const e=Ie.c(15),{schema:r,value:c,onChange:d,meta:h,decofile:v,onSaveReferencedBlock:f,sandbox:g}=m;let S;e[0]===Symbol.for("react.memo_cache_sentinel")?(S=[],e[0]=S):S=e[0];const[x,D]=w.useState(S);let N;e[1]!==x?(N=x.length>0&&n.jsxs("nav",{"aria-label":"Variant rule breadcrumb",className:"flex min-w-0 items-center gap-1 overflow-hidden text-xs",children:[n.jsx("button",{type:"button",onClick:()=>D([]),className:"flex shrink-0 items-center gap-0.5 rounded-md px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",title:"Back to rule",children:n.jsx(Ua,{className:"size-3.5"})}),x.map((o,k)=>{const u=k===x.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[k>0&&n.jsx(Vn,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>D(x.slice(0,k+1)),title:o,className:Re("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",u?"font-medium text-foreground":"text-muted-foreground"),children:o})]},`${o}-${k}`)})]}),e[1]=x,e[2]=N):N=e[2];let j;e[3]!==x||e[4]!==v||e[5]!==h||e[6]!==d||e[7]!==f||e[8]!==g||e[9]!==r||e[10]!==c?(j=n.jsx(Pn,{schema:r,value:c,onChange:d,basePath:"",breadcrumbPath:x,onBreadcrumbChange:D,meta:h,decofile:v,onSaveReferencedBlock:f,sandbox:g}),e[3]=x,e[4]=v,e[5]=h,e[6]=d,e[7]=f,e[8]=g,e[9]=r,e[10]=c,e[11]=j):j=e[11];let C;return e[12]!==N||e[13]!==j?(C=n.jsxs("div",{className:"space-y-2",children:[N,j]}),e[12]=N,e[13]=j,e[14]=C):C=e[14],C}function Rn(m){const e=Ie.c(21),{activeSchema:r,formValue:c,formResetKey:d,onFormChange:h,onBreadcrumbChange:v,breadcrumbPath:f,emptyMessage:g,beforeForm:S,seoResolveType:x,siteDefaultSeo:D,meta:N,decofile:j,onSaveReferencedBlock:C,sandbox:o}=m;let k;e[0]!==f?(k=f===void 0?[]:f,e[0]=f,e[1]=k):k=e[1];const u=k;let Q;e[2]!==r||e[3]!==u||e[4]!==j||e[5]!==d||e[6]!==c||e[7]!==N||e[8]!==v||e[9]!==h||e[10]!==C||e[11]!==o||e[12]!==x||e[13]!==D?(Q=r&&c?x?n.jsx(Sr,{schema:r,resolveType:x,value:c,formResetKey:d,onChange:h,onBreadcrumbChange:v,siteDefaultSeo:D}):n.jsx(Pn,{schema:r,value:c,onChange:h,basePath:"",breadcrumbPath:u,onBreadcrumbChange:v,meta:N,decofile:j,onSaveReferencedBlock:C,sandbox:o},d):null,e[2]=r,e[3]=u,e[4]=j,e[5]=d,e[6]=c,e[7]=N,e[8]=v,e[9]=h,e[10]=C,e[11]=o,e[12]=x,e[13]=D,e[14]=Q):Q=e[14];const W=Q;let O;e[15]!==g||e[16]!==W?(O=W??n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:g}),e[15]=g,e[16]=W,e[17]=O):O=e[17];let l;return e[18]!==S||e[19]!==O?(l=n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsxs("div",{className:"mx-auto max-w-2xl",children:[S,O]})}),e[18]=S,e[19]=O,e[20]=l):l=e[20],l}const Ur="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 Wr(m,e){return ba(m,e,nt)}function qr(m){const e=Ie.c(13),{pageKey:r,initialName:c,initialPath:d,onFieldChange:h}=m,[v,f]=w.useState(c),[g,S]=w.useState(d),[x,D]=w.useState(r);x!==r&&(D(r),f(c),S(d));let N;e[0]!==h?(N=u=>{f(u.target.value),h("name",u.target.value)},e[0]=h,e[1]=N):N=e[1];let j;e[2]!==v||e[3]!==N?(j=n.jsx("input",{type:"text",value:v,onChange:N,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]=v,e[3]=N,e[4]=j):j=e[4];let C;e[5]!==h?(C=u=>{S(u.target.value),h("path",u.target.value)},e[5]=h,e[6]=C):C=e[6];let o;e[7]!==g||e[8]!==C?(o=n.jsx("input",{type:"text",value:g,onChange:C,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]=g,e[8]=C,e[9]=o):o=e[9];let k;return e[10]!==j||e[11]!==o?(k=n.jsxs("div",{className:"space-y-1",children:[j,o]}),e[10]=j,e[11]=o,e[12]=k):k=e[12],k}function Cn(m){const e=Ie.c(6),{onClick:r}=m;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(Mn,{size:14}),e[0]=c):c=e[0];let d;e[1]!==r?(d=n.jsx(at,{asChild:!0,children:n.jsx(Ue,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-7 shrink-0 text-[oklch(0.65_0.15_160)]",onClick:r,children:c})}),e[1]=r,e[2]=d):d=e[2];let h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(rt,{side:"bottom",children:"Add variant"}),e[3]=h):h=e[3];let v;return e[4]!==d?(v=n.jsxs(st,{children:[d,h]}),e[4]=d,e[5]=v):v=e[5],v}function Tl({orgSlug:m,virtualMcpId:e,branch:r,previewReady:c=!0,previewUrl:d,currentPath:h,activePageBlockKey:v=null,activeGlobalBlockKey:f=null,externalSelectedIndex:g,onSaved:S,initialEditSeo:x=!1,onExitSeo:D,onViewJsonFile:N,onVariantPreviewOverride:j}){const C=c?{orgSlug:m,virtualMcpId:e,branch:r,previewUrl:d}:null,{data:o,isLoading:k}=oa(C),{data:u,isLoading:Q}=ia(C),W=la(),O=W?.entity?.id===e?W.entity.metadata?.siteSlug??null:null,[l,T]=w.useState(null),[ae,P]=w.useState(null),[de,A]=w.useState(null),[le,M]=w.useState(0),[se,oe]=w.useState(void 0),[Se,I]=w.useState(null),[te,q]=w.useState(null),[ie,V]=w.useState([]),[he,K]=w.useState(0),[ce,X]=w.useState(null),[Y,L]=w.useState(null),[B,Z]=w.useState(!0),[G,ee]=w.useState(!1),[ne,me]=w.useState(!1),[F,E]=w.useState(x),[De,_e]=w.useState(x);x&&!De&&(_e(!0),E(!0),T(null),P(null),A(null),V([])),!x&&De&&_e(!1);const[Me,ke]=w.useState(null),[Te,Ce]=w.useState(void 0),[Ke,we]=w.useState([]),[Ee,Oe]=w.useState(0),[re,ue]=w.useState(0),[$e,z]=w.useState(null),[_,H]=w.useState(null),[Le,Be]=w.useState(null),We=Qs(),es=`${m}/${e}/${r}`,kt=ca({orgSlug:m,virtualMcpId:e,branch:r}),[ts,ns]=w.useState(h),[ss,as]=w.useState(v),[rs,os]=w.useState(f);(ts!==h||ss!==v||rs!==f)&&(queueMicrotask(()=>kt.flush()),ns(h),as(v),os(f),T(null),P(null),A(null),M(0),I(null),q(null),ue(0),z(null),H(null),V([]),K(t=>t+1),E(!1),ke(null),Ce(void 0),we([]),Oe(t=>t+1));const Pe=ua({orgSlug:m,virtualMcpId:e,branch:r}),ft=Ta((t,s)=>{Pe.mutate({blockKey:t,data:s},{onSuccess:()=>S?.(),onError:a=>pe.error(`Save failed: ${a.message}`)})}),Jt=da({orgSlug:m,virtualMcpId:e,branch:r}),[wt,Qt]=w.useState(!1),Nt=w.useRef(null),ot=w.useRef(null),it=w.useRef(null),Rt=w.useRef({}),qe=w.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!c||k||Q)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(Dn,{size:20,className:"animate-spin text-muted-foreground"})});if(!o||!u)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:"Could not load site data."});const is=ma(o),ve=!!f,Fe=ve?null:fa(is,h,v),b=ve?f:Fe?.key??null,Ct=ve&&f?o[f]:void 0,Xt=ve&&f&&Ct?pa(f,Ct):ve&&f?f:"",pt=!ve&&b&&o[b]?o[b]:null,Dt=F&&o&&u&&b&&Fe?_n(o,{kind:"page",pageKey:b,pageName:String(Fe.name??""),path:String(Fe.path??"")},u):null,ls=F?pt?.seo:void 0,Tt=Te!==void 0?Te:ls,cs=F?dr(Tt):void 0,us=Dt?.seoTypeOptions??[],ds=F&&u?mr(u):"",Zt=Me??cs??{},Pt=F&&Dt?fr(Zt,Dt):null,ms=F&&Pt&&pr(Tt)?xt(Pt,u):null,fs=F?hr(o,u)?.seoData:void 0,Ve=ve?[{label:"Default",sections:[{__resolveType:f}]}]:Wr(pt?.sections,o??{}),ht=Ve.length>1,je=Math.min(le,Ve.length-1),Ge=Ve[je],U=Ge?.sections??[],Ne=bt(U,o),Gt=!ve&&ha(pt?.sections);if(ve&&f&&Le!==f){Be(f);const t=U[0],s=Ne[0];if(t&&s){T(0),ue(0),V([]);const a=tt(t,s,o);a&&(P(a.data),A(a.resolveType),H(null),z(null))}}!ve&&Le!==null&&Be(null),qe.current={rawSections:U,parsedSections:Ne,decofile:o??{},activePageKey:b,pageVariants:Ve,variantIndex:je,sectionVariantIndex:re,selectedSectionIndex:l};const ps=()=>({multivariate:Gt,index:je,variants:Ve.map(t=>({rule:t.rule}))}),en=(t,s)=>{if(!j)return;if(!b||!Gt||t.length<=1){j(null);return}const a=yn(b,{multivariate:!0,index:s,variants:t},o,u);j(a.length>0?a:null)},lt=(t,s,a)=>{if(!j)return;if(!b){j(null);return}const i=ps(),p=yn(b,i,o,u);if(!t||s<0){j(p.length>0?p:null);return}const R=Oa({pageKey:b,page:i,sectionIndex:s,sectionLazy:Ne[s]?.isLazy??!1,mvObj:t,selectedVariantIndex:a,decofile:o,meta:u}),y=[...p,...R];j(y.length>0?y:null)},Ye=(t,s,a,i=l??-1,p=!1)=>{const R=Xe(t,s);if(!R){P(null),A(null),H(null),z(null),p&&lt(null,i,a);return}const $=gn(R,nt)[a];if(!$){P(null),A(null),H(null),z(null),p&&lt(null,i,a);return}const ge=ya($.value,o);P(ge?.data??null),A(ge?.resolveType??null);const{resolveType:J,formValue:fe}=Bt($.rule,o,u??void 0);H(J),z(fe),p&&lt(R,i,a)};if(g!==void 0&&g!==se&&(oe(g??null),typeof g=="number")){const t=U[g],s=Ne[g];if(t&&s)if(T(g),ue(0),V([]),K(a=>a+1),s.isMultivariate)Ye(t,s,0,g);else{const a=tt(t,s,o);a?(P(a.data),A(a.resolveType)):(P(null),A(null)),H(null),z(null)}}const gt={orgSlug:m,virtualMcpId:e,branch:r,previewUrl:d??void 0,siteSlug:O},Vt=de&&u?xt(de,u):null,ze=(t,s)=>{if(!b)return;const a=zt(o,b,t,je,Ve);Pe.mutate({blockKey:b,data:a},{onSuccess:()=>s?.onSuccess?.()??S?.(),onError:i=>pe.error(`Save failed: ${i.message}`)})},ct=()=>{T(null),P(null),A(null),ue(0),z(null),H(null),V([]),K(t=>t+1)},hs=(t,s)=>{Nt.current&&clearTimeout(Nt.current);const a=qe.current.sectionVariantIndex;Nt.current=setTimeout(()=>{const{rawSections:i,parsedSections:p,decofile:R,activePageKey:y,pageVariants:$,variantIndex:ge}=qe.current,J=i[s];if(!J)return;const fe=p[s];if(!fe)return;if(fe.isSavedBlock){const be=fe.isLazy?J.section?.__resolveType??J.__resolveType:J.__resolveType;Pe.mutate({blockKey:be,data:t},{onSuccess:()=>S?.(),onError:ye=>pe.error(`Save failed: ${ye.message}`)});return}if(!y)return;const xe={...R[y]},Ae=[...i];if(fe.isMultivariate){const be=Xe(J,fe);if(!be||!y)return;const ye=Fa(be,a,t);Ae[s]=dt(J,fe,ye)}else if(fe.isHidden){const be=Tn(J.__resolveType),ye=be?{...J.section}:{...J},He=Array.isArray(ye.variants)?[...ye.variants]:[];He[0]&&(He[0]={...He[0],value:t}),ye.variants=He,be?Ae[s]={...J,section:ye}:Ae[s]=ye}else fe.isLazy?Ae[s]={...J,section:t}:Ae[s]=t;if($.length>1){const be=xe.sections,ye=[...be?.variants??[]];ye[ge]&&(ye[ge]={...ye[ge],value:Ae}),xe.sections={...be,variants:ye}}else xe.sections=Ae;Pe.mutate({blockKey:y,data:xe},{onSuccess:()=>S?.(),onError:be=>pe.error(`Save failed: ${be.message}`)})},Ht)},gs=t=>{T(t),ue(0),V([]),K(p=>p+1);const s=U[t],a=Ne[t];if(!s||!a)return;if(a.isMultivariate){Ye(s,a,0,t);return}const i=tt(s,a,o);if(!i){P(null),A(null),H(null),z(null),lt(null,t,0);return}P(i.data),A(i.resolveType),H(null),z(null),lt(null,t,0)},tn=t=>{const s=t;P(s),l!==null&&hs(s,l)},At=t=>{if(!b||!o||!u||!Fe)return;const s={kind:"page",pageKey:b,pageName:String(Fe.name??""),path:String(Fe.path??"")},a=_n(o,s,u);a&&kt.save(b,()=>{const i=We.getQueryData(Xs.decofile(es))?.[b];if(!i||typeof i!="object"||i===null||Array.isArray(i))return null;const p={...i,...Rt.current};return Rt.current={},t?.raw!==void 0?{...p,seo:t.raw}:t?.inner!==void 0?vr(s,a,p,t.inner):p})},vs=(t,s)=>{b&&(Rt.current[t]=s,At())},Ss=(t,s)=>{if(!b)return;const a=mt([...U],t,s);l!==null&&(l===t?T(s):t<l&&s>=l?T(l-1):t>l&&s<=l&&T(l+1)),ze(a)},xs=t=>{if(!b)return;const s=U.filter((a,i)=>i!==t);l===t?ct():l!==null&&l>t&&T(l-1),ze(s)},bs=t=>{if(!b)return;const s=U[t];if(!s)return;const a=[...U];a.splice(t+1,0,Ma(s)),l!==null&&l>t&&T(l+1),ze(a)},ys=t=>{if(!b)return;const s=U[t],a=Ne[t];if(!s||!a||a.isMultivariate)return;const i=a.isHidden?Va(s):Aa(s);if(!i)return;const p=[...U];p[t]=i,l===t&&ct(),ze(p)},js=t=>{if(!b)return;const s=U[t],a=Ne[t];if(!s||!a||a.isMultivariate)return;const i=Pa(s);if(!i)return;const p=[...U];p[t]=i,l===t&&ct(),ze(p)},_s=t=>{if(!b)return;const s=U[t],a=Ne[t];if(!s||!a?.isSavedBlock)return;const i=tt(s,a,o);if(!i?.data)return;const{name:p,...R}=i.data,y=[...U];a.isLazy?y[t]={...s,section:R}:y[t]=R,l===t&&ct(),ze(y)},ks=t=>{if(!b)return;const s=[...U,{__resolveType:t.resolveType}],a=s.length-1;ze(s,{onSuccess:()=>{ee(!1),T(a),ue(0),V([]),K(y=>y+1);const i=s[a],p=bt(s,o)[a];if(!i||!p)return;if(p.isMultivariate){Ye(i,p,0);return}const R=tt(i,p,o);if(!R){P(null),A(null),H(null),z(null);return}P(R.data),A(R.resolveType),H(null),z(null)}})},ws=t=>{if(l===null)return;const s=U[l],a=Ne[l];!s||!a?.isMultivariate||(ue(t),V([]),K(i=>i+1),Ye(s,a,t,l,!0))},Ns=t=>{if(l===null||!b)return;const s=U[l],a=Ne[l];if(!s||!a?.isMultivariate)return;const i=Xe(s,a);if(!i)return;const p=Ca(i,t);if(!p){pe.error("Cannot delete the only variant.");return}const R=[...U];R[l]=dt(s,a,p);const y=p.variants;let $=re;t===re?$=Math.min(t,y.length-1):t<re&&($=re-1),ue($),V([]),K(ge=>ge+1),Ye(R[l],a,$),ze(R)},Rs=t=>{if(l===null||!b)return;const s=U[l],a=Ne[l];if(!s||!a?.isMultivariate)return;const i=Xe(s,a);if(!i)return;const p=Da(i,t),R=[...U];R[l]=dt(s,a,p);const y=t+1;ue(y),V([]),K($=>$+1),Ye(R[l],a,y),ze(R)},Cs=(t,s)=>{if(l===null||!b||t===s)return;const a=U[l],i=Ne[l];if(!a||!i?.isMultivariate)return;const p=Xe(a,i);if(!p)return;const R=Na(p,t,s),y=[...U];y[l]=dt(a,i,R);let $=re;re===t?$=s:t<re&&s>=re?$=re-1:t>re&&s<=re&&($=re+1),ue($),Ye(y[l],i,$),ze(y)},Mt=t=>{const s=t??l;if(s===null||!b)return;const a=U[s],i=Ne[s];if(!a||!i)return;const p=ja(a,i);if(!p){pe.error("This section cannot have variants.");return}const R=[...U];R[s]=p.section;const y=bt(R,o)[s];if(!y?.isMultivariate){pe.error("Could not add variant.");return}T(s),ue(p.newVariantIndex),V([]),K($=>$+1),Ye(p.section,y,p.newVariantIndex,s),ze(R)},Ds=()=>{if(l===null||!b)return;const t=U[l],s=Ne[l];if(!t||!s?.isMultivariate)return;const a=Xe(t,s);if(!a)return;const i=Ra(t,s,a);if(!i){pe.error("Could not remove variants.");return}const p=[...U];p[l]=i;const R=bt(p,o)[l];if(!R)return;ue(0),H(null),z(null),V([]),K($=>$+1);const y=tt(i,R,o);y?(P(y.data),A(y.resolveType)):(P(null),A(null)),lt(null,l,0),ze(p)},Ts=async t=>{if(ce===null||!b)return;const s=bn(t,o);if(s){pe.error(s);return}const a=U[ce],i=Ne[ce];if(!a||!i)return;const p=tt(a,i,o);if(!p){pe.error("This section cannot be saved as global.");return}const R={...p.data,name:t};try{await Pe.mutateAsync({blockKey:t,data:R});const y=[...U];y[ce]={__resolveType:t},await Pe.mutateAsync({blockKey:b,data:zt(o,b,y,je,Ve)}),l===ce&&ct(),X(null),pe.success(`Saved global block "${t}"`),S?.()}catch(y){pe.error(y instanceof Error?y.message:"Failed to save global block")}},nn=Ge?.rule;if(ht&&l===null&&te===null&&nn){const{resolveType:t,formValue:s}=Bt(nn,o??{},u??void 0);q(t),I(s)}const vt=u?ga(u):[],Ps=!ve&&!!(d&&u&&o),sn=te&&u?xt(te,u):null,Vs=()=>{ot.current&&(clearTimeout(ot.current),ot.current=null),it.current&&(clearTimeout(it.current),it.current=null)},an=async(t,s)=>{if(!(za(s,t,u)>0))try{await Jt.mutateAsync({blockKey:t})}catch(a){pe.error(a instanceof Error?a.message:"Could not delete matcher block")}},rn=t=>{ot.current&&clearTimeout(ot.current),ot.current=setTimeout(()=>{const{activePageKey:s,decofile:a,variantIndex:i}=qe.current;if(!s)return;const p={...a[s]},R={...p.sections},y=[...R.variants??[]],$=y[i],ge=$?.rule;if(Ft(ge,a,u)){const J=ge?.__resolveType??"",fe=a[J],xe=typeof fe?.name=="string"?fe.name:J,{__resolveType:Ae,...be}=t;Pe.mutate({blockKey:J,data:It(Ae??"",be,xe)},{onSuccess:()=>S?.(),onError:ye=>pe.error(`Save failed: ${ye.message}`)});return}$&&(y[i]={...$,rule:t}),p.sections={...R,variants:y},Pe.mutate({blockKey:s,data:p},{onSuccess:()=>S?.(),onError:J=>pe.error(`Save failed: ${J.message}`)})},Ht)},As=t=>{q(t);const s=t?{__resolveType:t}:{__resolveType:jn};I({}),rn(s)},Ms=t=>{const s=t;I(s);const a=te?{__resolveType:te,...s}:{...s};rn(a)},on=t=>{it.current&&clearTimeout(it.current);const{selectedSectionIndex:s,sectionVariantIndex:a}=qe.current;s!==null&&(it.current=setTimeout(()=>{const{rawSections:i,parsedSections:p,decofile:R,activePageKey:y,pageVariants:$,variantIndex:ge}=qe.current;if(!y)return;const J=i[s],fe=p[s];if(!J||!fe?.isMultivariate)return;const xe=Xe(J,fe);if(!xe)return;const Ae=Ba(xe,a,t),be=[...i];be[s]=dt(J,fe,Ae);const ye=zt(R,y,be,ge,$);Pe.mutate({blockKey:y,data:ye},{onSuccess:()=>S?.(),onError:He=>pe.error(`Save failed: ${He.message}`)})},Ht))},Es=t=>{H(t),z({}),on(t?{__resolveType:t}:{__resolveType:jn})},$s=t=>{const s=t;z(s);const a=_?{__resolveType:_,...s}:{...s};on(a)};if(!ve&&!Fe)return n.jsxs("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:["No page found for ",h]});if(ve&&!Ct)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:"Global block not found"});const Je=l!==null?Ne[l]??null:null,ln=l!==null?U[l]:null,cn=ln&&Je?.isMultivariate?Xe(ln,Je):null,St=cn?gn(cn,nt):[],Et=Math.min(re,Math.max(St.length-1,0)),$t=St[Et]??null,et=Je?.isMultivariate===!0,un=l!==null&&Je!==null,ut=un&&(et||!!(Vt&&ae)),Ks=ut&&!ve&&Je?.isSavedBlock===!0,Qe=ve||Ks,Os=ve?Xt:Je?.label??"",dn=_&&u?xt(_,u):null,Kt=ut&&(!ve||ie.length>0)?ve?[Xt,...ie]:[Fe.name,Je.label,...et&&$t?[$t.label]:[],...ie]:[],Ls=F&&Fe?[Fe.name,"SEO",...Ke]:[],mn=F?Ls:Qe?Kt.length>0?Kt:[Os]:Kt,fn=()=>{if(!b)return;const t=o[b],s=_a(t.sections,U);if(!s)return;const a=ka(s);Pe.mutate({blockKey:b,data:{...t,sections:s}},{onSuccess:()=>{M(a),T(null),P(null),A(null),V([]),I(null),q(null)},onError:i=>pe.error(`Save failed: ${i.message}`)})},Ot=(t,s,a)=>{if(!b)return;const i=o[b],p=i.sections;if(!p||typeof p!="object"||Array.isArray(p))return;const R=p;if(!Array.isArray(R.variants))return;const y=t([...R.variants]);if(!y)return;const $=La(R,y),ge={...o,[b]:{...i,sections:$}};Pe.mutate({blockKey:b,data:ge[b]},{onSuccess:()=>{s?.(),a&&an(a,ge)},onError:J=>pe.error(`Save failed: ${J.message}`)})},Bs=t=>{L(null),M(t),T(null),P(null),A(null),V([]);const s=Ve[t]?.rule,{resolveType:a,formValue:i}=Bt(s,o??{},u??void 0);q(a),I(i),en(Ve.map(p=>({rule:p.rule})),t)},Fs=(t,s)=>{if(t===s)return;let a=je;je===t?a=s:t<je&&s>=je?a=je-1:t>je&&s<=je&&(a=je+1),M(a);const i=mt(Ve.map(p=>({rule:p.rule})),t,s);en(i,a),Ot(p=>mt(p,t,s))},zs=t=>{const s=Ve[t]?.rule,a=wa(s,o??{},u??void 0);Ot(i=>i.length<=1?null:(i.splice(t,1),i),()=>{Ve.length-1===1?M(0):t<je?M(je-1):t===je&&M(Math.max(0,t-1)),T(null),P(null),A(null),V([]),I(null),q(null)},a)},Is=t=>{Ot(s=>Ia(s,t),()=>{M(t+1),T(null),P(null),A(null),V([]),I(null),q(null)})},Hs=async(t,s)=>{Vs();const a=qe.current.activePageKey,i=qe.current.decofile;if(!a)return;const p=i[a],R=p.sections;if(!R||typeof R!="object"||Array.isArray(R))return;const y=R;if(!Array.isArray(y.variants))return;const $=[...y.variants],ge=$[t];if(!ge?.rule||typeof ge.rule!="object"){pe.error("This variant has no matcher rule to rename.");return}const J=ge.rule,fe=s.trim();Qt(!0);try{if(!fe){if(!Ft(J,i,u)){L(null);return}const Lt=J.__resolveType??"";$[t]={...ge,rule:Ea(J,i,u)};const hn={...i,[a]:{...p,sections:{...y,variants:$}}};await Pe.mutateAsync({blockKey:a,data:hn[a]}),await an(Lt,hn),L(null),S?.();return}const xe=$a(J,i,u);if(!xe){pe.error("Could not read this variant's matcher rule.");return}if(xe.blockKey){await Pe.mutateAsync({blockKey:xe.blockKey,data:It(xe.resolveType,xe.data,fe)}),L(null),S?.();return}const Ae=xn(fe),be=bn(Ae,i);if(be){pe.error(be);return}const ye=It(xe.resolveType,xe.data,fe);let He=null;try{await Pe.mutateAsync({blockKey:Ae,data:ye}),He=Ae,$[t]={...ge,rule:Ka(Ae)},await Pe.mutateAsync({blockKey:a,data:{...p,sections:{...y,variants:$}}}),He=null}catch(Lt){throw He&&await Jt.mutateAsync({blockKey:He}).catch(()=>{}),Lt}L(null),pe.success(`Saved matcher as global block "${fe}"`),S?.()}catch(xe){pe.error(xe instanceof Error?xe.message:"Failed to rename variant")}finally{Qt(!1)}},pn=()=>{ct()},Us=t=>{ke(t),At({inner:t})},Ws=t=>{Ce(t),At({raw:t})},qs=()=>{ke(null),we([])},Ys=()=>Oe(t=>t+1),Js=t=>{if(F){if(t===0){kt.flush(),E(!1),ke(null),Ce(void 0),we([]),Oe(a=>a+1),D?.();return}if(t===1){we([]),Oe(a=>a+1);return}we(Ke.slice(0,t-1)),Oe(a=>a+1);return}if(ve){V(ie.slice(0,t)),K(a=>a+1);return}if(t===0){pn();return}if(t===1){V([]),K(a=>a+1);return}if(et&&t===2){V([]),K(a=>a+1);return}const s=et?2:1;V(ie.slice(0,t-s))};return n.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[n.jsx("div",{className:"shrink-0",children:Qe||ut||F?n.jsxs("div",{className:Re("border-b px-3 py-2.5",Qe&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[!ve&&ht&&Ge&&n.jsxs("button",{type:"button",onClick:pn,title:`Editing in variant: ${Ge.label}`,className:Re("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",Ur),children:[n.jsx(Yt,{rule:jt(Ge.rule,o??{},u??void 0),matchers:vt}),n.jsx("span",{className:"max-w-[160px] truncate",children:Ge.label})]}),n.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:mn.map((t,s)=>{const a=s===mn.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[s>0&&n.jsx(Vn,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>Js(s),title:t,className:Re("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",a?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:t})]},`${t}-${s}`)})}),Qe&&n.jsxs(st,{children:[n.jsx(at,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(Qa,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.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."})]}),un&&!et&&!Je?.isHidden&&b&&n.jsx(Cn,{onClick:()=>Mt()})]}),Qe&&n.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."})]}):n.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(qr,{pageKey:b,initialName:Fe.name,initialPath:Fe.path,onFieldChange:vs})}),n.jsxs(st,{children:[n.jsx(at,{asChild:!0,children:n.jsx(Ue,{type:"button",variant:"ghost",size:"icon","aria-label":"Edit SEO",className:"size-7 shrink-0",onClick:()=>E(!0),children:n.jsx(Ya,{size:14})})}),n.jsx(rt,{side:"bottom",children:"Edit SEO"})]}),n.jsxs(st,{children:[n.jsx(at,{asChild:!0,children:n.jsx(Ue,{type:"button",variant:"ghost",size:"icon","aria-label":"View JSON",className:"size-7 shrink-0",onClick:()=>N&&b?N(b):me(!0),children:n.jsx(Ja,{size:14})})}),n.jsx(rt,{side:"bottom",children:"View JSON"})]}),n.jsx(Cn,{onClick:fn})]})}),ht&&!ut&&!F&&b&&n.jsx(Ir,{listKey:b,variants:Ve,activeIndex:je,decofile:o??{},meta:u,matchers:vt,onSelect:Bs,onReorder:Fs,onRename:L,onDuplicate:Is,onDelete:zs,onAdd:fn}),F?n.jsx(yt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:pt&&b?n.jsx(gr,{rawSeo:Tt,innerSeo:Zt,defaultResolveType:ds,seoSchema:ms,activeResolveType:Pt,seoTypeOptions:us,formResetKey:Ee,siteDefaultSeo:fs,onBreadcrumbChange:we,onPersistRaw:Ws,onInnerChange:Us,onClearForm:qs,onBumpFormKey:Ys}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"SEO schema not found for this site."})})})}):ut?n.jsxs(yt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[et&&St.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(va,{listKey:`${b??""}:${l??""}`,variants:St.map((t,s)=>({index:s,label:t.label})),selectedIndex:Et,onSelect:ws,onDuplicate:Rs,onDelete:Ns,onRemoveAll:Ds,onReorder:Cs,onAdd:()=>Mt()}),et&&n.jsxs("div",{className:"px-3 py-3 border-b space-y-2",children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variant rule"}),n.jsx(vn,{currentRt:_??"",currentLabel:nt($t?.rule),matchers:vt,onSelect:Es}),dn&&$e&&n.jsx("div",{className:"pt-1",children:n.jsx(Nn,{schema:dn,value:$e,onChange:$s,meta:u??void 0,decofile:o,onSaveReferencedBlock:ft,sandbox:gt},`${l??"none"}:${Et}:${_??""}`)})]})]}),n.jsx(Rn,{activeSchema:Vt,formValue:ae,formResetKey:he,onFormChange:tn,onBreadcrumbChange:V,breadcrumbPath:ie,emptyMessage:"No editable fields for this variant.",meta:u,decofile:o,onSaveReferencedBlock:ft,sandbox:gt})]}):ve?n.jsx(yt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(Rn,{activeSchema:Vt,formValue:ae,formResetKey:he,onFormChange:tn,onBreadcrumbChange:V,breadcrumbPath:ie,emptyMessage:"No editable fields for this global block.",meta:u,decofile:o,onSaveReferencedBlock:ft,sandbox:gt})}):n.jsxs(yt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[ht&&te!==null&&n.jsxs("div",{className:Re("px-3 border-b",B?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>Z(t=>!t),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":B,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variant rule"}),B?n.jsx(Wa,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(Ha,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),B&&n.jsxs("div",{className:Re("space-y-3",wt&&"pointer-events-none opacity-50"),children:[n.jsx(vn,{currentRt:te,currentLabel:Sn(Ge?.rule,o??{},nt,u??void 0),matchers:vt,onSelect:As}),sn&&Se&&n.jsx("div",{className:"space-y-3",children:n.jsx(Nn,{schema:sn,value:Se,onChange:Ms,meta:u??void 0,decofile:o,onSaveReferencedBlock:ft,sandbox:gt},`${je}:${te??""}`)})]})]}),n.jsx("div",{className:"p-2 pt-3",children:n.jsx(Ar,{listKey:`${b??""}-${je}`,rawSections:U,sections:Ne,meta:u,selectedIndex:l,onSelect:gs,onReorder:Ss,onDelete:xs,onDuplicate:bs,onMakeReusable:X,onToggleHidden:ys,onToggleLazy:js,onAddVariant:Mt,onDetach:_s,onAddSection:()=>ee(!0),canAddSection:Ps})})]}),n.jsx(Sa,{open:ce!==null,onOpenChange:t=>{t||X(null)},defaultBlockId:ce!==null?xn(Ne[ce]?.label??""):"",isPending:Pe.isPending,onSubmit:Ts}),d&&n.jsx(br,{open:G,onOpenChange:ee,meta:u,decofile:o,previewBaseUrl:d,onSelect:ks}),ne&&b&&o&&n.jsx(xa,{open:ne,onOpenChange:me,pageKey:b,decofile:o}),Y!==null&&n.jsx(Er,{open:!0,initialName:Ft(Ve[Y]?.rule,o??{},u??void 0)?Sn(Ve[Y]?.rule,o??{},nt,u??void 0):"",autoLabel:nt(jt(Ve[Y]?.rule,o??{},u??void 0)),isPending:wt,onSubmit:async t=>{await Hs(Y,t)},onOpenChange:t=>{!t&&!wt&&L(null)}})]})}export{Tl as SectionsEditor};
@@ -1 +1 @@
1
- import{r as c,aj as nt,a3 as Pe,j as d,a4 as rt,ak as be,_ as k,U as st,V as j,W as _,bP as $,a2 as lt,aQ as Ne,X as Ee,ai as at,bK as it,bR as ct,dz as dt,dC as ut,dA as pt,dD as ft,$ as mt,Y as ht,dB as vt,a0 as gt,a1 as xt,c as ee,l as oe}from"./index-tHbNbVHJ.js";import{V as St}from"./tooltip-DW1HpudV.js";import{i as wt,n as Ct}from"./ChevronUp-Cr2g1GDa.js";import{t as Re}from"./ChevronDown-CpzTl0cf.js";function _e(r,[e,t]){return Math.min(t,Math.max(e,r))}var yt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],Q="Select",[de,ue,bt]=at(Q),[ne]=ht(Q,[bt,Ee]),pe=Ee(),[Tt,G]=ne(Q),[Pt,_t]=ne(Q),je=r=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:i,value:s,defaultValue:l,onValueChange:a,dir:u,name:h,autoComplete:g,disabled:b,required:w,form:S}=r,p=pe(e),[v,C]=c.useState(null),[m,x]=c.useState(null),[U,M]=c.useState(!1),re=nt(u),[N,O]=Pe({prop:o,defaultProp:n??!1,onChange:i,caller:Q}),[F,q]=Pe({prop:s,defaultProp:l,onChange:a,caller:Q}),L=c.useRef(null),B=v?S||!!v.closest("form"):!0,[W,V]=c.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return d.jsx(rt,{...p,children:d.jsxs(Tt,{required:w,scope:e,trigger:v,onTriggerChange:C,valueNode:m,onValueNodeChange:x,valueNodeHasChildren:U,onValueNodeHasChildrenChange:M,contentId:be(),value:F,onValueChange:q,open:N,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:b,children:[d.jsx(de.Provider,{scope:e,children:d.jsx(Pt,{scope:r.__scopeSelect,onNativeOptionAdd:c.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:c.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?d.jsxs(Je,{"aria-hidden":!0,required:w,tabIndex:-1,name:h,autoComplete:g,value:F,onChange:E=>q(E.target.value),disabled:b,form:S,children:[F===void 0?d.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};je.displayName=Q;var Me="SelectTrigger",Ae=c.forwardRef((r,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=r,i=pe(t),s=G(Me,t),l=s.disabled||o,a=k(e,s.onTriggerChange),u=ue(t),h=c.useRef("touch"),[g,b,w]=tt(p=>{const v=u().filter(x=>!x.disabled),C=v.find(x=>x.value===s.value),m=ot(v,p,C);m!==void 0&&s.onValueChange(m.value)}),S=p=>{l||(s.onOpenChange(!0),w()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return d.jsx(st,{asChild:!0,...i,children:d.jsx(j.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":et(s.value)?"":void 0,...n,ref:a,onClick:_(n.onClick,p=>{p.currentTarget.focus(),h.current!=="mouse"&&S(p)}),onPointerDown:_(n.onPointerDown,p=>{h.current=p.pointerType;const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:_(n.onKeyDown,p=>{const v=g.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&b(p.key),!(v&&p.key===" ")&&yt.includes(p.key)&&(S(),p.preventDefault())})})})});Ae.displayName=Me;var Oe="SelectValue",De=c.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,children:i,placeholder:s="",...l}=r,a=G(Oe,t),{onValueNodeHasChildrenChange:u}=a,h=i!==void 0,g=k(e,a.onValueNodeChange);return $(()=>{u(h)},[u,h]),d.jsx(j.span,{...l,ref:g,style:{pointerEvents:"none"},children:et(a.value)?d.jsx(d.Fragment,{children:s}):i})});De.displayName=Oe;var Nt="SelectIcon",ke=c.forwardRef((r,e)=>{const{__scopeSelect:t,children:o,...n}=r;return d.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});ke.displayName=Nt;var Et="SelectPortal",Le=r=>d.jsx(lt,{asChild:!0,...r});Le.displayName=Et;var J="SelectContent",Be=c.forwardRef((r,e)=>{const t=G(J,r.__scopeSelect),[o,n]=c.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const i=o;return i?Ne.createPortal(d.jsx(Ve,{scope:r.__scopeSelect,children:d.jsx(de.Slot,{scope:r.__scopeSelect,children:d.jsx("div",{children:r.children})})}),i):null}return d.jsx(He,{...r,ref:e})});Be.displayName=J;var A=10,[Ve,Y]=ne(J),Rt="SelectContentImpl",jt=vt("SelectContent.RemoveScroll"),He=c.forwardRef((r,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:i,onPointerDownOutside:s,side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v,...C}=r,m=G(J,t),[x,U]=c.useState(null),[M,re]=c.useState(null),N=k(e,f=>U(f)),[O,F]=c.useState(null),[q,L]=c.useState(null),B=ue(t),[W,V]=c.useState(!1),H=c.useRef(!1);c.useEffect(()=>{if(x)return dt(x)},[x]),ut();const E=c.useCallback(f=>{const[T,...R]=B().map(P=>P.ref.current),[y]=R.slice(-1),I=document.activeElement;for(const P of f)if(P===I||(P?.scrollIntoView({block:"nearest"}),P===T&&M&&(M.scrollTop=0),P===y&&M&&(M.scrollTop=M.scrollHeight),P?.focus(),document.activeElement!==I))return},[B,M]),D=c.useCallback(()=>E([O,x]),[E,O,x]);c.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=m;c.useEffect(()=>{if(x){let f={x:0,y:0};const T=y=>{f={x:Math.abs(Math.round(y.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(y.pageY)-(K.current?.y??0))}},R=y=>{f.x<=10&&f.y<=10?y.preventDefault():x.contains(y.target)||z(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,z,K]),c.useEffect(()=>{const f=()=>z(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[z]);const[fe,ae]=tt(f=>{const T=B().filter(I=>!I.disabled),R=T.find(I=>I.ref.current===document.activeElement),y=ot(T,f,R);y&&setTimeout(()=>y.ref.current.focus())}),me=c.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&(F(f),y&&(H.current=!0))},[m.value]),he=c.useCallback(()=>x?.focus(),[x]),te=c.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&L(f)},[m.value]),ie=o==="popper"?Se:ze,se=ie===Se?{side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v}:{};return d.jsx(Ve,{scope:t,content:x,viewport:M,onViewportChange:re,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:d.jsx(pt,{as:jt,allowPinchZoom:!0,children:d.jsx(ft,{asChild:!0,trapped:m.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:_(n,f=>{m.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:d.jsx(mt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:d.jsx(ie,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:f=>f.preventDefault(),...C,...se,onPlaced:()=>V(!0),ref:N,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:_(C.onKeyDown,f=>{const T=f.ctrlKey||f.altKey||f.metaKey;if(f.key==="Tab"&&f.preventDefault(),!T&&f.key.length===1&&ae(f.key),["ArrowUp","ArrowDown","Home","End"].includes(f.key)){let y=B().filter(I=>!I.disabled).map(I=>I.ref.current);if(["ArrowUp","End"].includes(f.key)&&(y=y.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const I=f.target,P=y.indexOf(I);y=y.slice(P+1)}setTimeout(()=>E(y)),f.preventDefault()}})})})})})})});He.displayName=Rt;var Mt="SelectItemAlignedPosition",ze=c.forwardRef((r,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=r,i=G(J,t),s=Y(J,t),[l,a]=c.useState(null),[u,h]=c.useState(null),g=k(e,N=>h(N)),b=ue(t),w=c.useRef(!1),S=c.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:C,focusSelectedItem:m}=s,x=c.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&u&&p&&v&&C){const N=i.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),F=i.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(i.dir!=="rtl"){const I=q.left-O.left,P=F.left-I,X=N.left-P,Z=N.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=_e(P,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.left=xe+"px"}else{const I=O.right-q.right,P=window.innerWidth-F.right-I,X=window.innerWidth-N.right-P,Z=N.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=_e(P,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.right=xe+"px"}const L=b(),B=window.innerHeight-A*2,W=p.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),z=parseInt(V.paddingBottom,10),K=H+E+W+z+D,fe=Math.min(v.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=N.top+N.height/2-A,ie=B-te,se=v.offsetHeight/2,f=v.offsetTop+se,T=H+E+f,R=K-T;if(T<=te){const I=L.length>0&&v===L[L.length-1].ref.current;l.style.bottom="0px";const P=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ie,se+(I?he:0)+P+D),Z=T+X;l.style.height=Z+"px"}else{const I=L.length>0&&v===L[0].ref.current;l.style.top="0px";const X=Math.max(te,H+p.offsetTop+(I?me:0)+se)+R;l.style.height=X+"px",p.scrollTop=T-te+p.offsetTop}l.style.margin=`${A}px 0`,l.style.minHeight=fe+"px",l.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>w.current=!0)}},[b,i.trigger,i.valueNode,l,u,p,v,C,i.dir,o]);$(()=>x(),[x]);const[U,M]=c.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=c.useCallback(N=>{N&&S.current===!0&&(x(),m?.(),S.current=!1)},[x,m]);return d.jsx(Ot,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:w,onScrollButtonChange:re,children:d.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:U},children:d.jsx(j.div,{...n,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});ze.displayName=Mt;var At="SelectPopperPosition",Se=c.forwardRef((r,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...i}=r,s=pe(t);return d.jsx(gt,{...s,...i,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=At;var[Ot,Te]=ne(J,{}),we="SelectViewport",Ue=c.forwardRef((r,e)=>{const{__scopeSelect:t,nonce:o,...n}=r,i=Y(we,t),s=Te(we,t),l=k(e,i.onViewportChange),a=c.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),d.jsx(de.Slot,{scope:t,children:d.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:_(n.onScroll,u=>{const h=u.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:b}=s;if(b?.current&&g){const w=Math.abs(a.current-h.scrollTop);if(w>0){const S=window.innerHeight-A*2,p=parseFloat(g.style.minHeight),v=parseFloat(g.style.height),C=Math.max(p,v);if(C<S){const m=C+w,x=Math.min(S,m),U=m-x;g.style.height=x+"px",g.style.bottom==="0px"&&(h.scrollTop=U>0?U:0,g.style.justifyContent="flex-end")}}}a.current=h.scrollTop})})})]})});Ue.displayName=we;var Fe="SelectGroup",[Dt,kt]=ne(Fe),Lt=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=be();return d.jsx(Dt,{scope:t,id:n,children:d.jsx(j.div,{role:"group","aria-labelledby":n,...o,ref:e})})});Lt.displayName=Fe;var We="SelectLabel",Bt=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=kt(We,t);return d.jsx(j.div,{id:n.id,...o,ref:e})});Bt.displayName=We;var ce="SelectItem",[Vt,Ke]=ne(ce),$e=c.forwardRef((r,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:i,...s}=r,l=G(ce,t),a=Y(ce,t),u=l.value===o,[h,g]=c.useState(i??""),[b,w]=c.useState(!1),S=k(e,m=>a.itemRefCallback?.(m,o,n)),p=be(),v=c.useRef("touch"),C=()=>{n||(l.onValueChange(o),l.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(Vt,{scope:t,value:o,disabled:n,textId:p,isSelected:u,onItemTextChange:c.useCallback(m=>{g(x=>x||(m?.textContent??"").trim())},[]),children:d.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:h,children:d.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":b?"":void 0,"aria-selected":u&&b,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...s,ref:S,onFocus:_(s.onFocus,()=>w(!0)),onBlur:_(s.onBlur,()=>w(!1)),onClick:_(s.onClick,()=>{v.current!=="mouse"&&C()}),onPointerUp:_(s.onPointerUp,()=>{v.current==="mouse"&&C()}),onPointerDown:_(s.onPointerDown,m=>{v.current=m.pointerType}),onPointerMove:_(s.onPointerMove,m=>{v.current=m.pointerType,n?a.onItemLeave?.():v.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:_(s.onPointerLeave,m=>{m.currentTarget===document.activeElement&&a.onItemLeave?.()}),onKeyDown:_(s.onKeyDown,m=>{a.searchRef?.current!==""&&m.key===" "||(It.includes(m.key)&&C(),m.key===" "&&m.preventDefault())})})})})});$e.displayName=ce;var le="SelectItemText",Ge=c.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,...i}=r,s=G(le,t),l=Y(le,t),a=Ke(le,t),u=_t(le,t),[h,g]=c.useState(null),b=k(e,C=>g(C),a.onItemTextChange,C=>l.itemTextRefCallback?.(C,a.value,a.disabled)),w=h?.textContent,S=c.useMemo(()=>d.jsx("option",{value:a.value,disabled:a.disabled,children:w},a.value),[a.disabled,a.value,w]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=u;return $(()=>(p(S),()=>v(S)),[p,v,S]),d.jsxs(d.Fragment,{children:[d.jsx(j.span,{id:a.textId,...i,ref:b}),a.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Ne.createPortal(i.children,s.valueNode):null]})});Ge.displayName=le;var Ye="SelectItemIndicator",qe=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return Ke(Ye,t).isSelected?d.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});qe.displayName=Ye;var Ce="SelectScrollUpButton",Xe=c.forwardRef((r,e)=>{const t=Y(Ce,r.__scopeSelect),o=Te(Ce,r.__scopeSelect),[n,i]=c.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollTop>0;i(u)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Qe,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop-a.offsetHeight)}}):null});Xe.displayName=Ce;var ye="SelectScrollDownButton",Ze=c.forwardRef((r,e)=>{const t=Y(ye,r.__scopeSelect),o=Te(ye,r.__scopeSelect),[n,i]=c.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollHeight-a.clientHeight,h=Math.ceil(a.scrollTop)<u;i(h)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Qe,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop+a.offsetHeight)}}):null});Ze.displayName=ye;var Qe=c.forwardRef((r,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=r,i=Y("SelectScrollButton",t),s=c.useRef(null),l=ue(t),a=c.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return c.useEffect(()=>()=>a(),[a]),$(()=>{l().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),d.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:_(n.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:_(n.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:_(n.onPointerLeave,()=>{a()})})}),Ht="SelectSeparator",zt=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return d.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});zt.displayName=Ht;var Ie="SelectArrow",Ut=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=pe(t),i=G(Ie,t),s=Y(Ie,t);return i.open&&s.position==="popper"?d.jsx(xt,{...n,...o,ref:e}):null});Ut.displayName=Ie;var Ft="SelectBubbleInput",Je=c.forwardRef(({__scopeSelect:r,value:e,...t},o)=>{const n=c.useRef(null),i=k(o,n),s=it(e);return c.useEffect(()=>{const l=n.current;if(!l)return;const a=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(a,"value").set;if(s!==e&&h){const g=new Event("change",{bubbles:!0});h.call(l,e),l.dispatchEvent(g)}},[s,e]),d.jsx(j.select,{...t,style:{...St,...t.style},ref:i,defaultValue:e})});Je.displayName=Ft;function et(r){return r===""||r===void 0}function tt(r){const e=ct(r),t=c.useRef(""),o=c.useRef(0),n=c.useCallback(s=>{const l=t.current+s;e(l),(function a(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>a(""),1e3))})(l)},[e]),i=c.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return c.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,i]}function ot(r,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,i=t?r.indexOf(t):-1;let s=Wt(r,Math.max(i,0));n.length===1&&(s=s.filter(u=>u!==t));const a=s.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return a!==t?a:void 0}function Wt(r,e){return r.map((t,o)=>r[(e+o)%r.length])}var Kt=je,$t=Ae,Gt=De,Yt=ke,qt=Le,Xt=Be,Zt=Ue,Qt=$e,Jt=Ge,eo=qe,to=Xe,oo=Ze;function co(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Kt,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function uo(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Gt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(r){const e=ee.c(13);let t,o,n,i;e[0]!==r?({className:o,size:i,children:t,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=i):(t=e[1],o=e[2],n=e[3],i=e[4]);const s=i===void 0?"default":i;let l;e[5]!==o?(l=oe("data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-lg bg-background px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[2px] card-shadow disabled:opacity-50 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=xs]:h-6 data-[size=xs]:px-2.5 data-[size=xs]:py-1.5 data-[size=xs]:rounded-lg *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=d.jsx(Yt,{asChild:!0,children:d.jsx(Re,{className:"size-4 opacity-50"})}),e[7]=a):a=e[7];let u;return e[8]!==t||e[9]!==n||e[10]!==s||e[11]!==l?(u=d.jsxs($t,{"data-slot":"select-trigger","data-size":s,className:l,...n,children:[t,a]}),e[8]=t,e[9]=n,e[10]=s,e[11]=l,e[12]=u):u=e[12],u}function fo(r){const e=ee.c(25);let t,o,n,i,s;e[0]!==r?({className:o,children:t,position:i,hideScrollButtons:s,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=i,e[5]=s):(t=e[1],o=e[2],n=e[3],i=e[4],s=e[5]);const l=i===void 0?"popper":i,a=s===void 0?!1:s,u=l==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let h;e[6]!==o||e[7]!==u?(h=oe("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=h):h=e[8];let g;e[9]!==a?(g=!a&&d.jsx(no,{}),e[9]=a,e[10]=g):g=e[10];const b=l==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let w;e[11]!==b?(w=oe("p-1",b),e[11]=b,e[12]=w):w=e[12];let S;e[13]!==t||e[14]!==w?(S=d.jsx(Zt,{className:w,children:t}),e[13]=t,e[14]=w,e[15]=S):S=e[15];let p;e[16]!==a?(p=!a&&d.jsx(ro,{}),e[16]=a,e[17]=p):p=e[17];let v;return e[18]!==l||e[19]!==n||e[20]!==h||e[21]!==g||e[22]!==S||e[23]!==p?(v=d.jsx(qt,{children:d.jsxs(Xt,{"data-slot":"select-content",className:h,position:l,...n,children:[g,S,p]})}),e[18]=l,e[19]=n,e[20]=h,e[21]=g,e[22]=S,e[23]=p,e[24]=v):v=e[24],v}function mo(r){const e=ee.c(16);let t,o,n,i;e[0]!==r?({className:o,children:t,hideCheck:i,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=i):(t=e[1],o=e[2],n=e[3],i=e[4]);const s=i===void 0?!1:i;let l;e[5]!==o?(l=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]!==s?(a=!s&&d.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:d.jsx(eo,{children:d.jsx(wt,{className:"size-4"})})}),e[7]=s,e[8]=a):a=e[8];let u;e[9]!==t?(u=d.jsx(Jt,{children:t}),e[9]=t,e[10]=u):u=e[10];let h;return e[11]!==n||e[12]!==l||e[13]!==a||e[14]!==u?(h=d.jsxs(Qt,{"data-slot":"select-item",className:l,...n,children:[a,u]}),e[11]=n,e[12]=l,e[13]=a,e[14]=u,e[15]=h):h=e[15],h}function no(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(Ct,{className:"size-4"}),e[5]=i):i=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(to,{"data-slot":"select-scroll-up-button",className:n,...o,children:i}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}function ro(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(Re,{className:"size-4"}),e[5]=i):i=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(oo,{"data-slot":"select-scroll-down-button",className:n,...o,children:i}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}export{fo as S,mo as a,po as b,uo as c,co as d,_e as e};
1
+ import{r as c,aj as nt,a3 as Pe,j as d,a4 as rt,ak as be,_ as k,U as st,V as j,W as _,bP as $,a2 as lt,aQ as Ne,X as Ee,ai as at,bK as it,bR as ct,dz as dt,dC as ut,dA as pt,dD as ft,$ as mt,Y as ht,dB as vt,a0 as gt,a1 as xt,c as ee,l as oe}from"./index-BEjmlKPl.js";import{V as St}from"./tooltip-vrtDbf-F.js";import{i as wt,n as Ct}from"./ChevronUp-C73sdCjg.js";import{t as Re}from"./ChevronDown-C6GKFdlz.js";function _e(r,[e,t]){return Math.min(t,Math.max(e,r))}var yt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],Q="Select",[de,ue,bt]=at(Q),[ne]=ht(Q,[bt,Ee]),pe=Ee(),[Tt,G]=ne(Q),[Pt,_t]=ne(Q),je=r=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:i,value:s,defaultValue:l,onValueChange:a,dir:u,name:h,autoComplete:g,disabled:b,required:w,form:S}=r,p=pe(e),[v,C]=c.useState(null),[m,x]=c.useState(null),[U,M]=c.useState(!1),re=nt(u),[N,O]=Pe({prop:o,defaultProp:n??!1,onChange:i,caller:Q}),[F,q]=Pe({prop:s,defaultProp:l,onChange:a,caller:Q}),L=c.useRef(null),B=v?S||!!v.closest("form"):!0,[W,V]=c.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return d.jsx(rt,{...p,children:d.jsxs(Tt,{required:w,scope:e,trigger:v,onTriggerChange:C,valueNode:m,onValueNodeChange:x,valueNodeHasChildren:U,onValueNodeHasChildrenChange:M,contentId:be(),value:F,onValueChange:q,open:N,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:b,children:[d.jsx(de.Provider,{scope:e,children:d.jsx(Pt,{scope:r.__scopeSelect,onNativeOptionAdd:c.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:c.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?d.jsxs(Je,{"aria-hidden":!0,required:w,tabIndex:-1,name:h,autoComplete:g,value:F,onChange:E=>q(E.target.value),disabled:b,form:S,children:[F===void 0?d.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};je.displayName=Q;var Me="SelectTrigger",Ae=c.forwardRef((r,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=r,i=pe(t),s=G(Me,t),l=s.disabled||o,a=k(e,s.onTriggerChange),u=ue(t),h=c.useRef("touch"),[g,b,w]=tt(p=>{const v=u().filter(x=>!x.disabled),C=v.find(x=>x.value===s.value),m=ot(v,p,C);m!==void 0&&s.onValueChange(m.value)}),S=p=>{l||(s.onOpenChange(!0),w()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return d.jsx(st,{asChild:!0,...i,children:d.jsx(j.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":et(s.value)?"":void 0,...n,ref:a,onClick:_(n.onClick,p=>{p.currentTarget.focus(),h.current!=="mouse"&&S(p)}),onPointerDown:_(n.onPointerDown,p=>{h.current=p.pointerType;const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:_(n.onKeyDown,p=>{const v=g.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&b(p.key),!(v&&p.key===" ")&&yt.includes(p.key)&&(S(),p.preventDefault())})})})});Ae.displayName=Me;var Oe="SelectValue",De=c.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,children:i,placeholder:s="",...l}=r,a=G(Oe,t),{onValueNodeHasChildrenChange:u}=a,h=i!==void 0,g=k(e,a.onValueNodeChange);return $(()=>{u(h)},[u,h]),d.jsx(j.span,{...l,ref:g,style:{pointerEvents:"none"},children:et(a.value)?d.jsx(d.Fragment,{children:s}):i})});De.displayName=Oe;var Nt="SelectIcon",ke=c.forwardRef((r,e)=>{const{__scopeSelect:t,children:o,...n}=r;return d.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});ke.displayName=Nt;var Et="SelectPortal",Le=r=>d.jsx(lt,{asChild:!0,...r});Le.displayName=Et;var J="SelectContent",Be=c.forwardRef((r,e)=>{const t=G(J,r.__scopeSelect),[o,n]=c.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const i=o;return i?Ne.createPortal(d.jsx(Ve,{scope:r.__scopeSelect,children:d.jsx(de.Slot,{scope:r.__scopeSelect,children:d.jsx("div",{children:r.children})})}),i):null}return d.jsx(He,{...r,ref:e})});Be.displayName=J;var A=10,[Ve,Y]=ne(J),Rt="SelectContentImpl",jt=vt("SelectContent.RemoveScroll"),He=c.forwardRef((r,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:i,onPointerDownOutside:s,side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v,...C}=r,m=G(J,t),[x,U]=c.useState(null),[M,re]=c.useState(null),N=k(e,f=>U(f)),[O,F]=c.useState(null),[q,L]=c.useState(null),B=ue(t),[W,V]=c.useState(!1),H=c.useRef(!1);c.useEffect(()=>{if(x)return dt(x)},[x]),ut();const E=c.useCallback(f=>{const[T,...R]=B().map(P=>P.ref.current),[y]=R.slice(-1),I=document.activeElement;for(const P of f)if(P===I||(P?.scrollIntoView({block:"nearest"}),P===T&&M&&(M.scrollTop=0),P===y&&M&&(M.scrollTop=M.scrollHeight),P?.focus(),document.activeElement!==I))return},[B,M]),D=c.useCallback(()=>E([O,x]),[E,O,x]);c.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=m;c.useEffect(()=>{if(x){let f={x:0,y:0};const T=y=>{f={x:Math.abs(Math.round(y.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(y.pageY)-(K.current?.y??0))}},R=y=>{f.x<=10&&f.y<=10?y.preventDefault():x.contains(y.target)||z(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,z,K]),c.useEffect(()=>{const f=()=>z(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[z]);const[fe,ae]=tt(f=>{const T=B().filter(I=>!I.disabled),R=T.find(I=>I.ref.current===document.activeElement),y=ot(T,f,R);y&&setTimeout(()=>y.ref.current.focus())}),me=c.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&(F(f),y&&(H.current=!0))},[m.value]),he=c.useCallback(()=>x?.focus(),[x]),te=c.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&L(f)},[m.value]),ie=o==="popper"?Se:ze,se=ie===Se?{side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v}:{};return d.jsx(Ve,{scope:t,content:x,viewport:M,onViewportChange:re,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:d.jsx(pt,{as:jt,allowPinchZoom:!0,children:d.jsx(ft,{asChild:!0,trapped:m.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:_(n,f=>{m.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:d.jsx(mt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:d.jsx(ie,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:f=>f.preventDefault(),...C,...se,onPlaced:()=>V(!0),ref:N,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:_(C.onKeyDown,f=>{const T=f.ctrlKey||f.altKey||f.metaKey;if(f.key==="Tab"&&f.preventDefault(),!T&&f.key.length===1&&ae(f.key),["ArrowUp","ArrowDown","Home","End"].includes(f.key)){let y=B().filter(I=>!I.disabled).map(I=>I.ref.current);if(["ArrowUp","End"].includes(f.key)&&(y=y.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const I=f.target,P=y.indexOf(I);y=y.slice(P+1)}setTimeout(()=>E(y)),f.preventDefault()}})})})})})})});He.displayName=Rt;var Mt="SelectItemAlignedPosition",ze=c.forwardRef((r,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=r,i=G(J,t),s=Y(J,t),[l,a]=c.useState(null),[u,h]=c.useState(null),g=k(e,N=>h(N)),b=ue(t),w=c.useRef(!1),S=c.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:C,focusSelectedItem:m}=s,x=c.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&u&&p&&v&&C){const N=i.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),F=i.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(i.dir!=="rtl"){const I=q.left-O.left,P=F.left-I,X=N.left-P,Z=N.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=_e(P,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.left=xe+"px"}else{const I=O.right-q.right,P=window.innerWidth-F.right-I,X=window.innerWidth-N.right-P,Z=N.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=_e(P,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.right=xe+"px"}const L=b(),B=window.innerHeight-A*2,W=p.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),z=parseInt(V.paddingBottom,10),K=H+E+W+z+D,fe=Math.min(v.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=N.top+N.height/2-A,ie=B-te,se=v.offsetHeight/2,f=v.offsetTop+se,T=H+E+f,R=K-T;if(T<=te){const I=L.length>0&&v===L[L.length-1].ref.current;l.style.bottom="0px";const P=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ie,se+(I?he:0)+P+D),Z=T+X;l.style.height=Z+"px"}else{const I=L.length>0&&v===L[0].ref.current;l.style.top="0px";const X=Math.max(te,H+p.offsetTop+(I?me:0)+se)+R;l.style.height=X+"px",p.scrollTop=T-te+p.offsetTop}l.style.margin=`${A}px 0`,l.style.minHeight=fe+"px",l.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>w.current=!0)}},[b,i.trigger,i.valueNode,l,u,p,v,C,i.dir,o]);$(()=>x(),[x]);const[U,M]=c.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=c.useCallback(N=>{N&&S.current===!0&&(x(),m?.(),S.current=!1)},[x,m]);return d.jsx(Ot,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:w,onScrollButtonChange:re,children:d.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:U},children:d.jsx(j.div,{...n,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});ze.displayName=Mt;var At="SelectPopperPosition",Se=c.forwardRef((r,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...i}=r,s=pe(t);return d.jsx(gt,{...s,...i,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=At;var[Ot,Te]=ne(J,{}),we="SelectViewport",Ue=c.forwardRef((r,e)=>{const{__scopeSelect:t,nonce:o,...n}=r,i=Y(we,t),s=Te(we,t),l=k(e,i.onViewportChange),a=c.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),d.jsx(de.Slot,{scope:t,children:d.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:_(n.onScroll,u=>{const h=u.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:b}=s;if(b?.current&&g){const w=Math.abs(a.current-h.scrollTop);if(w>0){const S=window.innerHeight-A*2,p=parseFloat(g.style.minHeight),v=parseFloat(g.style.height),C=Math.max(p,v);if(C<S){const m=C+w,x=Math.min(S,m),U=m-x;g.style.height=x+"px",g.style.bottom==="0px"&&(h.scrollTop=U>0?U:0,g.style.justifyContent="flex-end")}}}a.current=h.scrollTop})})})]})});Ue.displayName=we;var Fe="SelectGroup",[Dt,kt]=ne(Fe),Lt=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=be();return d.jsx(Dt,{scope:t,id:n,children:d.jsx(j.div,{role:"group","aria-labelledby":n,...o,ref:e})})});Lt.displayName=Fe;var We="SelectLabel",Bt=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=kt(We,t);return d.jsx(j.div,{id:n.id,...o,ref:e})});Bt.displayName=We;var ce="SelectItem",[Vt,Ke]=ne(ce),$e=c.forwardRef((r,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:i,...s}=r,l=G(ce,t),a=Y(ce,t),u=l.value===o,[h,g]=c.useState(i??""),[b,w]=c.useState(!1),S=k(e,m=>a.itemRefCallback?.(m,o,n)),p=be(),v=c.useRef("touch"),C=()=>{n||(l.onValueChange(o),l.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(Vt,{scope:t,value:o,disabled:n,textId:p,isSelected:u,onItemTextChange:c.useCallback(m=>{g(x=>x||(m?.textContent??"").trim())},[]),children:d.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:h,children:d.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":b?"":void 0,"aria-selected":u&&b,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...s,ref:S,onFocus:_(s.onFocus,()=>w(!0)),onBlur:_(s.onBlur,()=>w(!1)),onClick:_(s.onClick,()=>{v.current!=="mouse"&&C()}),onPointerUp:_(s.onPointerUp,()=>{v.current==="mouse"&&C()}),onPointerDown:_(s.onPointerDown,m=>{v.current=m.pointerType}),onPointerMove:_(s.onPointerMove,m=>{v.current=m.pointerType,n?a.onItemLeave?.():v.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:_(s.onPointerLeave,m=>{m.currentTarget===document.activeElement&&a.onItemLeave?.()}),onKeyDown:_(s.onKeyDown,m=>{a.searchRef?.current!==""&&m.key===" "||(It.includes(m.key)&&C(),m.key===" "&&m.preventDefault())})})})})});$e.displayName=ce;var le="SelectItemText",Ge=c.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,...i}=r,s=G(le,t),l=Y(le,t),a=Ke(le,t),u=_t(le,t),[h,g]=c.useState(null),b=k(e,C=>g(C),a.onItemTextChange,C=>l.itemTextRefCallback?.(C,a.value,a.disabled)),w=h?.textContent,S=c.useMemo(()=>d.jsx("option",{value:a.value,disabled:a.disabled,children:w},a.value),[a.disabled,a.value,w]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=u;return $(()=>(p(S),()=>v(S)),[p,v,S]),d.jsxs(d.Fragment,{children:[d.jsx(j.span,{id:a.textId,...i,ref:b}),a.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Ne.createPortal(i.children,s.valueNode):null]})});Ge.displayName=le;var Ye="SelectItemIndicator",qe=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return Ke(Ye,t).isSelected?d.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});qe.displayName=Ye;var Ce="SelectScrollUpButton",Xe=c.forwardRef((r,e)=>{const t=Y(Ce,r.__scopeSelect),o=Te(Ce,r.__scopeSelect),[n,i]=c.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollTop>0;i(u)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Qe,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop-a.offsetHeight)}}):null});Xe.displayName=Ce;var ye="SelectScrollDownButton",Ze=c.forwardRef((r,e)=>{const t=Y(ye,r.__scopeSelect),o=Te(ye,r.__scopeSelect),[n,i]=c.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollHeight-a.clientHeight,h=Math.ceil(a.scrollTop)<u;i(h)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Qe,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop+a.offsetHeight)}}):null});Ze.displayName=ye;var Qe=c.forwardRef((r,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=r,i=Y("SelectScrollButton",t),s=c.useRef(null),l=ue(t),a=c.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return c.useEffect(()=>()=>a(),[a]),$(()=>{l().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),d.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:_(n.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:_(n.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:_(n.onPointerLeave,()=>{a()})})}),Ht="SelectSeparator",zt=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return d.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});zt.displayName=Ht;var Ie="SelectArrow",Ut=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=pe(t),i=G(Ie,t),s=Y(Ie,t);return i.open&&s.position==="popper"?d.jsx(xt,{...n,...o,ref:e}):null});Ut.displayName=Ie;var Ft="SelectBubbleInput",Je=c.forwardRef(({__scopeSelect:r,value:e,...t},o)=>{const n=c.useRef(null),i=k(o,n),s=it(e);return c.useEffect(()=>{const l=n.current;if(!l)return;const a=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(a,"value").set;if(s!==e&&h){const g=new Event("change",{bubbles:!0});h.call(l,e),l.dispatchEvent(g)}},[s,e]),d.jsx(j.select,{...t,style:{...St,...t.style},ref:i,defaultValue:e})});Je.displayName=Ft;function et(r){return r===""||r===void 0}function tt(r){const e=ct(r),t=c.useRef(""),o=c.useRef(0),n=c.useCallback(s=>{const l=t.current+s;e(l),(function a(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>a(""),1e3))})(l)},[e]),i=c.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return c.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,i]}function ot(r,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,i=t?r.indexOf(t):-1;let s=Wt(r,Math.max(i,0));n.length===1&&(s=s.filter(u=>u!==t));const a=s.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return a!==t?a:void 0}function Wt(r,e){return r.map((t,o)=>r[(e+o)%r.length])}var Kt=je,$t=Ae,Gt=De,Yt=ke,qt=Le,Xt=Be,Zt=Ue,Qt=$e,Jt=Ge,eo=qe,to=Xe,oo=Ze;function co(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Kt,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function uo(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Gt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(r){const e=ee.c(13);let t,o,n,i;e[0]!==r?({className:o,size:i,children:t,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=i):(t=e[1],o=e[2],n=e[3],i=e[4]);const s=i===void 0?"default":i;let l;e[5]!==o?(l=oe("data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-lg bg-background px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[2px] card-shadow disabled:opacity-50 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=xs]:h-6 data-[size=xs]:px-2.5 data-[size=xs]:py-1.5 data-[size=xs]:rounded-lg *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=d.jsx(Yt,{asChild:!0,children:d.jsx(Re,{className:"size-4 opacity-50"})}),e[7]=a):a=e[7];let u;return e[8]!==t||e[9]!==n||e[10]!==s||e[11]!==l?(u=d.jsxs($t,{"data-slot":"select-trigger","data-size":s,className:l,...n,children:[t,a]}),e[8]=t,e[9]=n,e[10]=s,e[11]=l,e[12]=u):u=e[12],u}function fo(r){const e=ee.c(25);let t,o,n,i,s;e[0]!==r?({className:o,children:t,position:i,hideScrollButtons:s,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=i,e[5]=s):(t=e[1],o=e[2],n=e[3],i=e[4],s=e[5]);const l=i===void 0?"popper":i,a=s===void 0?!1:s,u=l==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let h;e[6]!==o||e[7]!==u?(h=oe("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=h):h=e[8];let g;e[9]!==a?(g=!a&&d.jsx(no,{}),e[9]=a,e[10]=g):g=e[10];const b=l==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let w;e[11]!==b?(w=oe("p-1",b),e[11]=b,e[12]=w):w=e[12];let S;e[13]!==t||e[14]!==w?(S=d.jsx(Zt,{className:w,children:t}),e[13]=t,e[14]=w,e[15]=S):S=e[15];let p;e[16]!==a?(p=!a&&d.jsx(ro,{}),e[16]=a,e[17]=p):p=e[17];let v;return e[18]!==l||e[19]!==n||e[20]!==h||e[21]!==g||e[22]!==S||e[23]!==p?(v=d.jsx(qt,{children:d.jsxs(Xt,{"data-slot":"select-content",className:h,position:l,...n,children:[g,S,p]})}),e[18]=l,e[19]=n,e[20]=h,e[21]=g,e[22]=S,e[23]=p,e[24]=v):v=e[24],v}function mo(r){const e=ee.c(16);let t,o,n,i;e[0]!==r?({className:o,children:t,hideCheck:i,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=i):(t=e[1],o=e[2],n=e[3],i=e[4]);const s=i===void 0?!1:i;let l;e[5]!==o?(l=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]!==s?(a=!s&&d.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:d.jsx(eo,{children:d.jsx(wt,{className:"size-4"})})}),e[7]=s,e[8]=a):a=e[8];let u;e[9]!==t?(u=d.jsx(Jt,{children:t}),e[9]=t,e[10]=u):u=e[10];let h;return e[11]!==n||e[12]!==l||e[13]!==a||e[14]!==u?(h=d.jsxs(Qt,{"data-slot":"select-item",className:l,...n,children:[a,u]}),e[11]=n,e[12]=l,e[13]=a,e[14]=u,e[15]=h):h=e[15],h}function no(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(Ct,{className:"size-4"}),e[5]=i):i=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(to,{"data-slot":"select-scroll-up-button",className:n,...o,children:i}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}function ro(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(Re,{className:"size-4"}),e[5]=i):i=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(oo,{"data-slot":"select-scroll-down-button",className:n,...o,children:i}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}export{fo as S,mo as a,po as b,uo as c,co as d,_e as e};
@@ -1 +1 @@
1
- import{c as D,j as o,l as R,r as $,B as H}from"./index-tHbNbVHJ.js";import{i as Q,d as W,b as J,a as K}from"./dialog-DKiQlf0Y.js";import{g as V,b as Y,a as Z,D as ee}from"./drawer-UishvVn_.js";import{u as oe}from"./use-mobile-BD2-gXK-.js";import{b as A}from"./chat-context-C7e3nmPB.js";import{D as te,b as le,S as U,M as se}from"./decopilot-D1XiRpB_.js";import{a as G,b as z}from"./connect-desktop-dialog-CUoIMZ9P.js";const ie=[{tier:"fast",description:"Quicker responses"},{tier:"smart",description:"Balanced quality"},{tier:"thinking",description:"Deeper reasoning"}];function X(r){const e=D.c(10),{modelSet:t,selectedModelId:s,onSelect:i}=r;let l,c;if(e[0]!==t.logo||e[1]!==t.models||e[2]!==t.tiers||e[3]!==i||e[4]!==s){const a=Object.fromEntries(t.models.map(ne));l="flex flex-col p-2 w-[320px]",c=ie.map(d=>{const{tier:p,description:m}=d,u=t.tiers[p];if(!u.modelId)return null;const x=a[u.modelId];if(!x)return null;const f=s===u.modelId;return o.jsxs("button",{type:"button",onClick:()=>i(x),className:R("flex items-center gap-3 px-3 py-2.5 rounded-lg text-left hover:bg-accent",f&&"bg-accent/50"),children:[o.jsx("img",{src:t.logo,alt:u.label,className:"size-5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px"}),o.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[o.jsx("span",{className:"text-sm text-foreground leading-tight truncate",children:u.label}),o.jsx("span",{className:"text-xs text-muted-foreground leading-tight",children:m})]})]},p)}),e[0]=t.logo,e[1]=t.models,e[2]=t.tiers,e[3]=i,e[4]=s,e[5]=l,e[6]=c}else l=e[5],c=e[6];let n;return e[7]!==l||e[8]!==c?(n=o.jsx("div",{className:l,children:c}),e[7]=l,e[8]=c,e[9]=n):n=e[9],n}function ne(r){return[r.modelId,r]}const de=[{providerId:"claude-code",modelId:"claude-code:haiku",title:"Claude Code Haiku",description:"Fast and lightweight",capabilities:["text"],limits:null,costs:null},{providerId:"claude-code",modelId:"claude-code:sonnet",title:"Claude Code Sonnet 5",description:"Balanced performance",capabilities:["text","reasoning"],limits:null,costs:null},{providerId:"claude-code",modelId:"claude-code:opus",title:"Claude Code Opus",description:"Most capable",capabilities:["text","reasoning"],limits:null,costs:null},{providerId:"claude-code",modelId:"claude-code:opus-1m",title:"Claude Code Opus 4.8 1M",description:"Most capable, 1M context window",capabilities:["text","reasoning"],limits:{contextWindow:1e6,maxOutputTokens:null},costs:null}],L="https://assets.decocache.com/decocms/6ac44f1c-c0cf-4480-84b5-2ae6fe742d0b/codex-app.png.png",ce=[{providerId:"codex",modelId:"codex:gpt-5.5",title:"GPT-5.5",description:"Frontier model for complex coding, research, and real-world work",capabilities:["text","reasoning"],logo:L,limits:null,costs:null},{providerId:"codex",modelId:"codex:gpt-5.4",title:"GPT-5.4",description:"Strong model for everyday coding",capabilities:["text","reasoning"],logo:L,limits:null,costs:null},{providerId:"codex",modelId:"codex:gpt-5.4-mini",title:"GPT-5.4 Mini",description:"Small, fast, and cost-efficient model for simpler coding tasks",capabilities:["text","reasoning"],logo:L,limits:null,costs:null},{providerId:"codex",modelId:"codex:gpt-5.3-codex-spark",title:"GPT-5.3 Codex Spark",description:"Ultra-fast coding model",capabilities:["text","reasoning"],logo:L,limits:null,costs:null}],re="https://decoims.com/decocms/93e4059c-e598-412b-87eb-54d72a946ec8/claude-stroke-rounded.svg",ae="https://decoims.com/decocms/9170ffd4-b9cc-4661-ad8f-ae2eea019e00/codex.svg",me={fast:{modelId:"claude-code:haiku",label:"Haiku 4.5",description:"Quicker responses",iconNode:o.jsx(G,{size:16})},smart:{modelId:"claude-code:sonnet",label:"Sonnet 5",description:"Balanced quality",iconNode:o.jsx(G,{size:16})},thinking:{modelId:"claude-code:opus-1m",label:"Opus 4.8 1M",description:"Deeper reasoning",iconNode:o.jsx(G,{size:16})}},pe={fast:{modelId:"codex:gpt-5.4-mini",label:"GPT-5.4 Mini",description:"Quicker responses",iconNode:o.jsx(z,{size:16})},smart:{modelId:"codex:gpt-5.4",label:"GPT-5.4",description:"Balanced quality",iconNode:o.jsx(z,{size:16})},thinking:{modelId:"codex:gpt-5.5",label:"GPT-5.5",description:"Deeper reasoning",iconNode:o.jsx(z,{size:16})}};function q(r){return r==="claude-code"?{logo:re,tiers:me,models:de}:r==="codex"?{logo:ae,tiers:pe,models:ce}:null}function ue(r){const e=D.c(11),{onClose:t,agent:s}=r,i=A(),l=s??i.pendingHarnessId??"decopilot";let c;e[0]!==l?(c=q(l),e[0]=l,e[1]=c):c=e[1];const n=c;if(!n){let m;return e[2]!==t?(m=o.jsx(le,{onClose:t}),e[2]=t,e[3]=m):m=e[3],m}const a=i.selectedModel?.modelId??n.tiers[i.simpleModeTier].modelId;let d;e[4]!==t||e[5]!==i?(d=m=>{i.setModel({...m,keyId:void 0}),t()},e[4]=t,e[5]=i,e[6]=d):d=e[6];let p;return e[7]!==n||e[8]!==a||e[9]!==d?(p=o.jsx(X,{modelSet:n,selectedModelId:a,onSelect:d}),e[7]=n,e[8]=a,e[9]=d,e[10]=p):p=e[10],p}function fe(r){const e=D.c(13);let t,s;e[0]!==r?({agent:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let i;e[3]!==t?(i=t?q(t):null,e[3]=t,e[4]=i):i=e[4];const l=i;if(!l){let d;return e[5]!==s?(d=o.jsx(te,{...s}),e[5]=s,e[6]=d):d=e[6],d}const c=s.selectedModel?.modelId??l.tiers.smart.modelId;let n;e[7]!==s?(n=d=>{s.onModelChange(d),s.onClose()},e[7]=s,e[8]=n):n=e[8];let a;return e[9]!==l||e[10]!==c||e[11]!==n?(a=o.jsx(X,{modelSet:l,selectedModelId:c,onSelect:n}),e[9]=l,e[10]=c,e[11]=n,e[12]=a):a=e[12],a}function ve(r){const e=D.c(39),{variant:t,className:s,placeholder:i,model:l,isLoading:c,credentialId:n,onCredentialChange:a,onModelChange:d,filterModels:p,agent:m}=r,u=t===void 0?"borderless":t,x=i===void 0?"Select model":i,[f,k]=$.useState(!1),g=d!==void 0,F=oe(),B=u==="borderless"?"ghost":"outline",P=u==="borderless"&&"md:border-none";let h;e[0]!==s||e[1]!==P?(h=R("text-sm hover:bg-accent rounded-lg py-0.5 px-1 gap-1 shadow-none cursor-pointer border-0 group focus-visible:ring-0 focus-visible:ring-offset-0 min-w-0 shrink justify-start overflow-hidden",P,s),e[0]=s,e[1]=P,e[2]=h):h=e[2];let b;e[3]!==c||e[4]!==l||e[5]!==x||e[6]!==g?(b=g?o.jsx(U,{model:l??null,placeholder:x,isLoading:c}):o.jsx(ge,{placeholder:x}),e[3]=c,e[4]=l,e[5]=x,e[6]=g,e[7]=b):b=e[7];let O;e[8]!==B||e[9]!==h||e[10]!==b?(O=o.jsx(H,{variant:B,size:"sm",className:h,children:b}),e[8]=B,e[9]=h,e[10]=b,e[11]=O):O=e[11];const C=O;let w;e[12]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx(se,{}),e[12]=w):w=e[12];let y;e[13]!==m||e[14]!==n||e[15]!==p||e[16]!==l||e[17]!==a||e[18]!==d||e[19]!==g?(y=o.jsx($.Suspense,{fallback:w,children:g?o.jsx(fe,{onClose:()=>k(!1),agent:m,credentialId:n??null,onCredentialChange:a??xe,selectedModel:l??null,onModelChange:d,filterModels:p}):o.jsx(ue,{onClose:()=>k(!1),agent:m})}),e[13]=m,e[14]=n,e[15]=p,e[16]=l,e[17]=a,e[18]=d,e[19]=g,e[20]=y):y=e[20];const I=y;if(F){let M;e[21]!==C?(M=o.jsx(V,{asChild:!0,children:C}),e[21]=C,e[22]=M):M=e[22];let _;e[23]===Symbol.for("react.memo_cache_sentinel")?(_=o.jsx(Y,{className:"sr-only",children:"Select model"}),e[23]=_):_=e[23];let v;e[24]!==I?(v=o.jsxs(Z,{className:"p-0 flex flex-col max-h-[95vh]",children:[_,o.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:I})]}),e[24]=I,e[25]=v):v=e[25];let T;return e[26]!==f||e[27]!==M||e[28]!==v?(T=o.jsxs(ee,{open:f,onOpenChange:k,children:[M,v]}),e[26]=f,e[27]=M,e[28]=v,e[29]=T):T=e[29],T}let S;e[30]!==C?(S=o.jsx(Q,{asChild:!0,children:C}),e[30]=C,e[31]=S):S=e[31];let N;e[32]===Symbol.for("react.memo_cache_sentinel")?(N=o.jsx(W,{className:"sr-only",children:"Select model"}),e[32]=N):N=e[32];let j;e[33]!==I?(j=o.jsxs(J,{className:"p-0 gap-0 sm:max-w-fit overflow-hidden h-[100dvh] sm:h-auto max-h-[100dvh] sm:max-h-[85vh] w-full max-w-full sm:max-w-fit rounded-none sm:rounded-xl border-0 sm:border",closeButtonClassName:"top-3.5 right-3.5 z-20",children:[N,I]}),e[33]=I,e[34]=j):j=e[34];let E;return e[35]!==f||e[36]!==S||e[37]!==j?(E=o.jsxs(K,{open:f,onOpenChange:k,children:[S,j]}),e[35]=f,e[36]=S,e[37]=j,e[38]=E):E=e[38],E}function xe(){}function ge(r){const e=D.c(4),{placeholder:t}=r,{selectedModel:s,isModelsLoading:i}=A();let l;return e[0]!==i||e[1]!==s||e[2]!==t?(l=o.jsx(U,{model:s,placeholder:t,isLoading:i}),e[0]=i,e[1]=s,e[2]=t,e[3]=l):l=e[3],l}export{ve as M};
1
+ import{c as D,j as o,l as R,r as $,B as H}from"./index-BEjmlKPl.js";import{i as Q,d as W,b as J,a as K}from"./dialog-Hh5ovGLY.js";import{g as V,b as Y,a as Z,D as ee}from"./drawer-SgGGijSm.js";import{u as oe}from"./use-mobile-C7loFyQ0.js";import{b as A}from"./chat-context-CcIPgTva.js";import{D as te,b as le,S as U,M as se}from"./decopilot-CdQeVtVh.js";import{a as G,b as z}from"./connect-desktop-dialog-C95eK0uT.js";const ie=[{tier:"fast",description:"Quicker responses"},{tier:"smart",description:"Balanced quality"},{tier:"thinking",description:"Deeper reasoning"}];function X(r){const e=D.c(10),{modelSet:t,selectedModelId:s,onSelect:i}=r;let l,c;if(e[0]!==t.logo||e[1]!==t.models||e[2]!==t.tiers||e[3]!==i||e[4]!==s){const a=Object.fromEntries(t.models.map(ne));l="flex flex-col p-2 w-[320px]",c=ie.map(d=>{const{tier:p,description:m}=d,u=t.tiers[p];if(!u.modelId)return null;const x=a[u.modelId];if(!x)return null;const f=s===u.modelId;return o.jsxs("button",{type:"button",onClick:()=>i(x),className:R("flex items-center gap-3 px-3 py-2.5 rounded-lg text-left hover:bg-accent",f&&"bg-accent/50"),children:[o.jsx("img",{src:t.logo,alt:u.label,className:"size-5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px"}),o.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[o.jsx("span",{className:"text-sm text-foreground leading-tight truncate",children:u.label}),o.jsx("span",{className:"text-xs text-muted-foreground leading-tight",children:m})]})]},p)}),e[0]=t.logo,e[1]=t.models,e[2]=t.tiers,e[3]=i,e[4]=s,e[5]=l,e[6]=c}else l=e[5],c=e[6];let n;return e[7]!==l||e[8]!==c?(n=o.jsx("div",{className:l,children:c}),e[7]=l,e[8]=c,e[9]=n):n=e[9],n}function ne(r){return[r.modelId,r]}const de=[{providerId:"claude-code",modelId:"claude-code:haiku",title:"Claude Code Haiku",description:"Fast and lightweight",capabilities:["text"],limits:null,costs:null},{providerId:"claude-code",modelId:"claude-code:sonnet",title:"Claude Code Sonnet 5",description:"Balanced performance",capabilities:["text","reasoning"],limits:null,costs:null},{providerId:"claude-code",modelId:"claude-code:opus",title:"Claude Code Opus",description:"Most capable",capabilities:["text","reasoning"],limits:null,costs:null},{providerId:"claude-code",modelId:"claude-code:opus-1m",title:"Claude Code Opus 4.8 1M",description:"Most capable, 1M context window",capabilities:["text","reasoning"],limits:{contextWindow:1e6,maxOutputTokens:null},costs:null}],L="https://assets.decocache.com/decocms/6ac44f1c-c0cf-4480-84b5-2ae6fe742d0b/codex-app.png.png",ce=[{providerId:"codex",modelId:"codex:gpt-5.5",title:"GPT-5.5",description:"Frontier model for complex coding, research, and real-world work",capabilities:["text","reasoning"],logo:L,limits:null,costs:null},{providerId:"codex",modelId:"codex:gpt-5.4",title:"GPT-5.4",description:"Strong model for everyday coding",capabilities:["text","reasoning"],logo:L,limits:null,costs:null},{providerId:"codex",modelId:"codex:gpt-5.4-mini",title:"GPT-5.4 Mini",description:"Small, fast, and cost-efficient model for simpler coding tasks",capabilities:["text","reasoning"],logo:L,limits:null,costs:null},{providerId:"codex",modelId:"codex:gpt-5.3-codex-spark",title:"GPT-5.3 Codex Spark",description:"Ultra-fast coding model",capabilities:["text","reasoning"],logo:L,limits:null,costs:null}],re="https://decoims.com/decocms/93e4059c-e598-412b-87eb-54d72a946ec8/claude-stroke-rounded.svg",ae="https://decoims.com/decocms/9170ffd4-b9cc-4661-ad8f-ae2eea019e00/codex.svg",me={fast:{modelId:"claude-code:haiku",label:"Haiku 4.5",description:"Quicker responses",iconNode:o.jsx(G,{size:16})},smart:{modelId:"claude-code:sonnet",label:"Sonnet 5",description:"Balanced quality",iconNode:o.jsx(G,{size:16})},thinking:{modelId:"claude-code:opus-1m",label:"Opus 4.8 1M",description:"Deeper reasoning",iconNode:o.jsx(G,{size:16})}},pe={fast:{modelId:"codex:gpt-5.4-mini",label:"GPT-5.4 Mini",description:"Quicker responses",iconNode:o.jsx(z,{size:16})},smart:{modelId:"codex:gpt-5.4",label:"GPT-5.4",description:"Balanced quality",iconNode:o.jsx(z,{size:16})},thinking:{modelId:"codex:gpt-5.5",label:"GPT-5.5",description:"Deeper reasoning",iconNode:o.jsx(z,{size:16})}};function q(r){return r==="claude-code"?{logo:re,tiers:me,models:de}:r==="codex"?{logo:ae,tiers:pe,models:ce}:null}function ue(r){const e=D.c(11),{onClose:t,agent:s}=r,i=A(),l=s??i.pendingHarnessId??"decopilot";let c;e[0]!==l?(c=q(l),e[0]=l,e[1]=c):c=e[1];const n=c;if(!n){let m;return e[2]!==t?(m=o.jsx(le,{onClose:t}),e[2]=t,e[3]=m):m=e[3],m}const a=i.selectedModel?.modelId??n.tiers[i.simpleModeTier].modelId;let d;e[4]!==t||e[5]!==i?(d=m=>{i.setModel({...m,keyId:void 0}),t()},e[4]=t,e[5]=i,e[6]=d):d=e[6];let p;return e[7]!==n||e[8]!==a||e[9]!==d?(p=o.jsx(X,{modelSet:n,selectedModelId:a,onSelect:d}),e[7]=n,e[8]=a,e[9]=d,e[10]=p):p=e[10],p}function fe(r){const e=D.c(13);let t,s;e[0]!==r?({agent:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let i;e[3]!==t?(i=t?q(t):null,e[3]=t,e[4]=i):i=e[4];const l=i;if(!l){let d;return e[5]!==s?(d=o.jsx(te,{...s}),e[5]=s,e[6]=d):d=e[6],d}const c=s.selectedModel?.modelId??l.tiers.smart.modelId;let n;e[7]!==s?(n=d=>{s.onModelChange(d),s.onClose()},e[7]=s,e[8]=n):n=e[8];let a;return e[9]!==l||e[10]!==c||e[11]!==n?(a=o.jsx(X,{modelSet:l,selectedModelId:c,onSelect:n}),e[9]=l,e[10]=c,e[11]=n,e[12]=a):a=e[12],a}function ve(r){const e=D.c(39),{variant:t,className:s,placeholder:i,model:l,isLoading:c,credentialId:n,onCredentialChange:a,onModelChange:d,filterModels:p,agent:m}=r,u=t===void 0?"borderless":t,x=i===void 0?"Select model":i,[f,k]=$.useState(!1),g=d!==void 0,F=oe(),B=u==="borderless"?"ghost":"outline",P=u==="borderless"&&"md:border-none";let h;e[0]!==s||e[1]!==P?(h=R("text-sm hover:bg-accent rounded-lg py-0.5 px-1 gap-1 shadow-none cursor-pointer border-0 group focus-visible:ring-0 focus-visible:ring-offset-0 min-w-0 shrink justify-start overflow-hidden",P,s),e[0]=s,e[1]=P,e[2]=h):h=e[2];let b;e[3]!==c||e[4]!==l||e[5]!==x||e[6]!==g?(b=g?o.jsx(U,{model:l??null,placeholder:x,isLoading:c}):o.jsx(ge,{placeholder:x}),e[3]=c,e[4]=l,e[5]=x,e[6]=g,e[7]=b):b=e[7];let O;e[8]!==B||e[9]!==h||e[10]!==b?(O=o.jsx(H,{variant:B,size:"sm",className:h,children:b}),e[8]=B,e[9]=h,e[10]=b,e[11]=O):O=e[11];const C=O;let w;e[12]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx(se,{}),e[12]=w):w=e[12];let y;e[13]!==m||e[14]!==n||e[15]!==p||e[16]!==l||e[17]!==a||e[18]!==d||e[19]!==g?(y=o.jsx($.Suspense,{fallback:w,children:g?o.jsx(fe,{onClose:()=>k(!1),agent:m,credentialId:n??null,onCredentialChange:a??xe,selectedModel:l??null,onModelChange:d,filterModels:p}):o.jsx(ue,{onClose:()=>k(!1),agent:m})}),e[13]=m,e[14]=n,e[15]=p,e[16]=l,e[17]=a,e[18]=d,e[19]=g,e[20]=y):y=e[20];const I=y;if(F){let M;e[21]!==C?(M=o.jsx(V,{asChild:!0,children:C}),e[21]=C,e[22]=M):M=e[22];let _;e[23]===Symbol.for("react.memo_cache_sentinel")?(_=o.jsx(Y,{className:"sr-only",children:"Select model"}),e[23]=_):_=e[23];let v;e[24]!==I?(v=o.jsxs(Z,{className:"p-0 flex flex-col max-h-[95vh]",children:[_,o.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:I})]}),e[24]=I,e[25]=v):v=e[25];let T;return e[26]!==f||e[27]!==M||e[28]!==v?(T=o.jsxs(ee,{open:f,onOpenChange:k,children:[M,v]}),e[26]=f,e[27]=M,e[28]=v,e[29]=T):T=e[29],T}let S;e[30]!==C?(S=o.jsx(Q,{asChild:!0,children:C}),e[30]=C,e[31]=S):S=e[31];let N;e[32]===Symbol.for("react.memo_cache_sentinel")?(N=o.jsx(W,{className:"sr-only",children:"Select model"}),e[32]=N):N=e[32];let j;e[33]!==I?(j=o.jsxs(J,{className:"p-0 gap-0 sm:max-w-fit overflow-hidden h-[100dvh] sm:h-auto max-h-[100dvh] sm:max-h-[85vh] w-full max-w-full sm:max-w-fit rounded-none sm:rounded-xl border-0 sm:border",closeButtonClassName:"top-3.5 right-3.5 z-20",children:[N,I]}),e[33]=I,e[34]=j):j=e[34];let E;return e[35]!==f||e[36]!==S||e[37]!==j?(E=o.jsxs(K,{open:f,onOpenChange:k,children:[S,j]}),e[35]=f,e[36]=S,e[37]=j,e[38]=E):E=e[38],E}function xe(){}function ge(r){const e=D.c(4),{placeholder:t}=r,{selectedModel:s,isModelsLoading:i}=A();let l;return e[0]!==i||e[1]!==s||e[2]!==t?(l=o.jsx(U,{model:s,placeholder:t,isLoading:i}),e[0]=i,e[1]=s,e[2]=t,e[3]=l):l=e[3],l}export{ve as M};
@@ -0,0 +1 @@
1
+ import{c as T,j as t,r as Q,B as je,i as Se}from"./index-BEjmlKPl.js";import{i as be}from"./ChevronRight-_T91Ki1i.js";import{L as fe}from"./agent-icon-CDWUrKO6.js";import{S as ue}from"./scroll-area-DCf9FU8S.js";import{r as Ne,c as ke,u as _e,a as we,i as Ce,d as Te,f as Fe,P as Re,S as Ee}from"./page-seo-form-B2_5Qimo.js";import{s as xe,p as ze}from"./index-xtrjWgZh.js";import{a as ge}from"./Tool01-UFRB7Gn8.js";import"./AlertCircle-qsmFLzIS.js";import"./SwitchHorizontal01-BPwURr_K.js";import"./Settings02-B1ys_QsX.js";import"./XCircle-Cr_Uaxeq.js";import"./ArrowUpRight-yJehGCq_.js";import"./ZapSquare-CwzduoBx.js";import"./Users03-CsRyhHB5.js";import"./CheckCircle-B6MW1yw_.js";import"./ChevronUp-C73sdCjg.js";import"./ChevronDown-C6GKFdlz.js";import"./ChevronLeft-B_g3Odoj.js";import"./DotsVertical-BOTJmIm_.js";import"./Stars02-BBfjmRkO.js";import"./Eye-CmIsbgje.js";import"./ZoomOut-N-7VqfhT.js";import"./Globe01-jb99gJfY.js";import"./FilterLines-Br0k3Gt9.js";import"./Star01-DPd1XEvi.js";import"./Globe04-BoJpZpky.js";import"./HardDrive-tK8cadSs.js";import"./Key01--rf2r0q7.js";import"./LayoutLeft-Dpq1l3Cs.js";import"./LinkExternal01-DgKre-XN.js";import"./Monitor01-DLOF_NPZ.js";import"./Sun-D1BAkaT6.js";import"./Palette-B13aA9KG.js";import"./Play-CAoWwsoA.js";import"./Plus-DaRhyqSH.js";import"./SearchLg-C7PlcyS-.js";import"./SearchMd-TIrNRuOw.js";import"./Shield01-cnNeKMKA.js";import"./Stars01-CFQgPhA5.js";import"./Trash01-2mnBLeel.js";import"./Upload01-BxxwdIAZ.js";import"./User01-D61Pj0Jp.js";import"./Users01-enhuFvLY.js";import"./XClose-C6a8uvfS.js";import"./X-D_jt_5zi.js";import"./Zap-CkUSEY1J.js";import"./use-clock-tick-v8inwCL3.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BGZ8Ttn0.js";import"./tooltip-vrtDbf-F.js";import"./file-type-icon-b6CTHv4I.js";import"./dialog-Hh5ovGLY.js";import"./use-mobile-C7loFyQ0.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-Cpxi5nja.js";import"./use-mcp-client-DdEyuuWo.js";import"./auth-DnFlop4R.js";import"./chat-context-CcIPgTva.js";import"./hooks-Cm8G1vlN.js";import"./decopilot-sse-pool-BxlWS7lz.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-CytuWVRm.js";import"./use-collections-DkNJNG6n.js";import"./use-ai-providers-SEySB86N.js";import"./studio-tools-E6eV6Arx.js";import"./use-organization-settings-CyhRZcil.js";import"./shell-layout-R4zDjERM.js";import"./avatar-C765fdJ7.js";import"./required-auth-layout-BfuMObCG.js";import"./use-org-sso-SRgmMZqR.js";import"./sheet-Dz5C6OGo.js";import"./integration-icon-BubYo_JB.js";import"./use-navigate-to-agent-C3I5i4Gg.js";import"./use-connection-DUBWvt9B.js";import"./use-mcp-prompts-DqUyy9S8.js";import"./form-vkZSNPAt.js";import"./label-P9D2uSqZ.js";import"./input-Csk5e2yH.js";import"./select-f-UK5_IH.js";import"./switch-CIDHMPBy.js";import"./index-DMwgNM3s.js";import"./drawer-SgGGijSm.js";import"./collection-search-OPVOwF6w.js";import"./tabs-DCWgt9U2.js";import"./toggle-group-DqYtGmOf.js";import"./sortable.esm-DHABQEKH.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DQuoMZlF.js";import"./use-registry-connections-JP-nn714.js";import"./useInfiniteQuery-Cm9C_gzI.js";import"./use-infinite-scroll-DUbloeNA.js";import"./extract-connection-data-Dl7BC58q.js";import"./card-CYYTvdp-.js";import"./collection-tabs-CRf8Ijmq.js";import"./badge-CgUoAb0G.js";import"./textarea-cMx1Sjw5.js";import"./connection-form-helpers-Bjlqqa5J.js";import"./authenticate-and-persist-oauth-7MZHsMGS.js";import"./mcp-oauth-C9EbOVQM.js";import"./useSuspenseInfiniteQuery-Dl9xywRE.js";import"./connect-desktop-dialog-C95eK0uT.js";import"./decopilot-CdQeVtVh.js";import"./checkbox-D9k8y94F.js";import"./skeleton-DLjQYeS_.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-LAhWYbh9.js";import"./popover-CXYDmYeq.js";import"./command-gl-L1UMo.js";import"./index-b3uLeNQ7.js";import"./dropdown-menu-CVNL6sbF.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-D8xk5cTm.js";import"./empty-state-C5ufqcxL.js";import"./toolbar-C5mHjU06.js";import"./preview-dialog-DPmt4gXJ.js";import"./index-5EogW27n.js";import"./use-mcp-tools-CgsqmnJG.js";import"./use-capability-BF81OxAF.js";import"./shell-route-loading-DHNvhkbM.js";import"./index-BA1nWkqk.js";import"./alert-dialog-DwrOZyIa.js";import"./use-debounced-autosave-BwLKL-15.js";import"./index-kmrmjjsI.js";import"./sidebar-CFbvOGM6.js";import"./search-input-Cec8OPCx.js";import"./github-repo-picker-DjgoP8zv.js";import"./use-debounced-value-BMcX8uyD.js";import"./use-secrets-f-qJA1xx.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-B0C659uf.js";import"./automation-runs-BJ__6yJz.js";import"./table-FWIaAi69.js";import"./use-members-BhBptkRX.js";import"./use-org-auth-client-B9guhhqA.js";import"./task-status-CBSgsj9C.js";import"./use-automations-BWMuOB-g.js";import"./use-file-configs-BLZ83KSj.js";import"./monaco-editor-Bk0ouh6L.js";import"./select-model-DXfyq6oG.js";import"./automation-list-row-D88Ulzbg.js";function U(n){return typeof n=="string"&&n.trim()?n:void 0}function he(n,e){if(n){if(e)try{const i=new URL(n,e).href;return xe(i)}catch{return}return xe(n)}}function Pe(n){if(!n)return{};const e=U(n.title),i=U(n.titleTemplate);return{title:e&&i?.includes("%s")?i.replace(/%s/g,e):e,description:U(n.description),image:U(n.image),favicon:U(n.favicon)}}function Oe(n){if(!n)return"example.com";try{return new URL(n).host}catch{return"example.com"}}const Z="Your page title",ee="Your meta description will appear here.",Le=[{id:"google",label:"Google",color:"#4285F4",layout:"search"},{id:"facebook",label:"Facebook",color:"#1877F2",layout:"card"},{id:"twitter",label:"X (Twitter)",color:"#0f1419",layout:"card"},{id:"linkedin",label:"LinkedIn",color:"#0A66C2",layout:"card"},{id:"whatsapp",label:"WhatsApp",color:"#25D366",layout:"chat"},{id:"telegram",label:"Telegram",color:"#229ED9",layout:"chat"},{id:"slack",label:"Slack",color:"#611f69",layout:"attachment"},{id:"discord",label:"Discord",color:"#5865F2",layout:"attachment"}];function pe(n){const e=T.c(10),{src:i,className:r,iconSize:h}=n,a=h===void 0?20:h;if(i){let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={objectFit:"cover"},e[0]=m):m=e[0];let p;return e[1]!==r||e[2]!==i?(p=t.jsx("img",{src:i,alt:"",referrerPolicy:"no-referrer",className:r,style:m}),e[1]=r,e[2]=i,e[3]=p):p=e[3],p}let s;e[4]===Symbol.for("react.memo_cache_sentinel")?(s={display:"flex",alignItems:"center",justifyContent:"center",background:"#e5e7eb",color:"#9ca3af"},e[4]=s):s=e[4];let o;e[5]!==a?(o=t.jsx(ge,{size:a}),e[5]=a,e[6]=o):o=e[6];let l;return e[7]!==r||e[8]!==o?(l=t.jsx("div",{className:r,style:s,children:o}),e[7]=r,e[8]=o,e[9]=l):l=e[9],l}function $e(n){const e=T.c(27),{seo:i,host:r,path:h}=n;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={background:"#fff",border:"1px solid #dadce0"},e[0]=a):a=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s={background:"#f1f3f4"},e[1]=s):s=e[1];let o;e[2]!==i.favicon?(o=t.jsx("div",{className:"flex size-6 shrink-0 items-center justify-center overflow-hidden rounded-full",style:s,children:i.favicon?t.jsx("img",{src:i.favicon,alt:"",className:"size-full object-cover"}):t.jsx(ge,{size:12,color:"#9aa0a6"})}),e[2]=i.favicon,e[3]=o):o=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l={color:"#202124"},e[4]=l):l=e[4];let m;e[5]!==r?(m=t.jsx("div",{className:"truncate text-[13px] leading-tight",style:l,children:r}),e[5]=r,e[6]=m):m=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p={color:"#4d5156"},e[7]=p):p=e[7];let d;e[8]!==r||e[9]!==h?(d=t.jsxs("div",{className:"truncate text-[12px] leading-tight",style:p,children:[r,h]}),e[8]=r,e[9]=h,e[10]=d):d=e[10];let c;e[11]!==m||e[12]!==d?(c=t.jsxs("div",{className:"min-w-0",children:[m,d]}),e[11]=m,e[12]=d,e[13]=c):c=e[13];let g;e[14]!==o||e[15]!==c?(g=t.jsxs("div",{className:"flex items-center gap-2",children:[o,c]}),e[14]=o,e[15]=c,e[16]=g):g=e[16];let f;e[17]===Symbol.for("react.memo_cache_sentinel")?(f={color:"#1a0dab"},e[17]=f):f=e[17];const x=i.title??Z;let u;e[18]!==x?(u=t.jsx("div",{className:"mt-1.5 truncate text-[18px] leading-snug",style:f,children:x}),e[18]=x,e[19]=u):u=e[19];let j;e[20]===Symbol.for("react.memo_cache_sentinel")?(j={color:"#4d5156"},e[20]=j):j=e[20];const v=i.description??ee;let y;e[21]!==v?(y=t.jsx("div",{className:"mt-0.5 line-clamp-2 text-[13px] leading-snug",style:j,children:v}),e[21]=v,e[22]=y):y=e[22];let S;return e[23]!==u||e[24]!==y||e[25]!==g?(S=t.jsxs("div",{className:"rounded-lg p-3 text-left",style:a,children:[g,u,y]}),e[23]=u,e[24]=y,e[25]=g,e[26]=S):S=e[26],S}function De(n){const e=T.c(20),{seo:i,host:r}=n;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={background:"#fff",border:"1px solid #e2e8f0"},e[0]=h):h=e[0];let a;e[1]!==i.image?(a=t.jsx(pe,{src:i.image,className:"h-40 w-full"}),e[1]=i.image,e[2]=a):a=e[2];let s;e[3]===Symbol.for("react.memo_cache_sentinel")?(s={borderTop:"1px solid #e2e8f0"},e[3]=s):s=e[3];let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o={color:"#8a9099"},e[4]=o):o=e[4];let l;e[5]!==r?(l=t.jsx("div",{className:"truncate text-[11px]",style:o,children:r}),e[5]=r,e[6]=l):l=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m={color:"#1c2024"},e[7]=m):m=e[7];const p=i.title??Z;let d;e[8]!==p?(d=t.jsx("div",{className:"line-clamp-1 text-[14px] font-semibold",style:m,children:p}),e[8]=p,e[9]=d):d=e[9];let c;e[10]===Symbol.for("react.memo_cache_sentinel")?(c={color:"#60666c"},e[10]=c):c=e[10];const g=i.description??ee;let f;e[11]!==g?(f=t.jsx("div",{className:"line-clamp-2 text-[12px]",style:c,children:g}),e[11]=g,e[12]=f):f=e[12];let x;e[13]!==f||e[14]!==l||e[15]!==d?(x=t.jsxs("div",{className:"px-3 py-2",style:s,children:[l,d,f]}),e[13]=f,e[14]=l,e[15]=d,e[16]=x):x=e[16];let u;return e[17]!==x||e[18]!==a?(u=t.jsxs("div",{className:"overflow-hidden rounded-lg text-left",style:h,children:[a,x]}),e[17]=x,e[18]=a,e[19]=u):u=e[19],u}function Ie(n){const e=T.c(23),{seo:i,host:r,accent:h}=n;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={background:"#f0f2f5"},e[0]=a):a=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("p",{className:"px-1 pb-1.5 text-[12px]",style:{color:"#3b4045"},children:"Here's a post you might write with the link of your website:"}),e[1]=s):s=e[1];const o=`3px solid ${h}`;let l;e[2]!==o?(l={background:"#fff",borderLeft:o},e[2]=o,e[3]=l):l=e[3];let m;e[4]!==i.image?(m=t.jsx(pe,{src:i.image,className:"h-28 w-full",iconSize:18}),e[4]=i.image,e[5]=m):m=e[5];let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p={color:"#1c2024"},e[6]=p):p=e[6];const d=i.title??Z;let c;e[7]!==d?(c=t.jsx("div",{className:"line-clamp-1 text-[12px] font-semibold",style:p,children:d}),e[7]=d,e[8]=c):c=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g={color:"#60666c"},e[9]=g):g=e[9];const f=i.description??ee;let x;e[10]!==f?(x=t.jsx("div",{className:"line-clamp-2 text-[11px]",style:g,children:f}),e[10]=f,e[11]=x):x=e[11];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u={color:"#8a9099"},e[12]=u):u=e[12];let j;e[13]!==r?(j=t.jsx("div",{className:"mt-0.5 text-[10px]",style:u,children:r}),e[13]=r,e[14]=j):j=e[14];let v;e[15]!==x||e[16]!==j||e[17]!==c?(v=t.jsxs("div",{className:"px-2.5 py-1.5",children:[c,x,j]}),e[15]=x,e[16]=j,e[17]=c,e[18]=v):v=e[18];let y;return e[19]!==v||e[20]!==l||e[21]!==m?(y=t.jsxs("div",{className:"rounded-lg p-2 text-left",style:a,children:[s,t.jsxs("div",{className:"overflow-hidden rounded-md",style:l,children:[m,v]})]}),e[19]=v,e[20]=l,e[21]=m,e[22]=y):y=e[22],y}function Ae(n){const e=T.c(33),{seo:i,host:r,accent:h,dark:a}=n,s=a?"#2b2d31":"#fff",o=a?"#00a8fc":"#1264a3",l=a?"#dbdee1":"#3b4045",m=a?"#949ba4":"#8a9099",p=a?"none":"1px solid #e2e8f0";let d;e[0]!==s||e[1]!==p?(d={background:s,border:p},e[0]=s,e[1]=p,e[2]=d):d=e[2];const c=`3px solid ${h}`;let g;e[3]!==c?(g={borderLeft:c,borderRadius:2},e[3]=c,e[4]=g):g=e[4];let f;e[5]!==m?(f={color:m},e[5]=m,e[6]=f):f=e[6];let x;e[7]!==r||e[8]!==f?(x=t.jsx("div",{className:"text-[10px]",style:f,children:r}),e[7]=r,e[8]=f,e[9]=x):x=e[9];let u;e[10]!==o?(u={color:o},e[10]=o,e[11]=u):u=e[11];const j=i.title??Z;let v;e[12]!==u||e[13]!==j?(v=t.jsx("div",{className:"line-clamp-1 text-[13px] font-semibold",style:u,children:j}),e[12]=u,e[13]=j,e[14]=v):v=e[14];let y;e[15]!==l?(y={color:l},e[15]=l,e[16]=y):y=e[16];const S=i.description??ee;let _;e[17]!==y||e[18]!==S?(_=t.jsx("div",{className:"line-clamp-2 text-[12px]",style:y,children:S}),e[17]=y,e[18]=S,e[19]=_):_=e[19];let N;e[20]!==_||e[21]!==x||e[22]!==v?(N=t.jsxs("div",{className:"min-w-0 flex-1",children:[x,v,_]}),e[20]=_,e[21]=x,e[22]=v,e[23]=N):N=e[23];let b;e[24]!==i.image?(b=t.jsx(pe,{src:i.image,className:"size-14 shrink-0 rounded",iconSize:16}),e[24]=i.image,e[25]=b):b=e[25];let k;e[26]!==N||e[27]!==b||e[28]!==g?(k=t.jsxs("div",{className:"flex gap-2.5 pl-2.5",style:g,children:[N,b]}),e[26]=N,e[27]=b,e[28]=g,e[29]=k):k=e[29];let C;return e[30]!==k||e[31]!==d?(C=t.jsx("div",{className:"rounded-lg p-2.5 text-left",style:d,children:k}),e[30]=k,e[31]=d,e[32]=C):C=e[32],C}function Be(n){const e=T.c(17),{platform:i,seo:r,host:h,path:a}=n;let s;e[0]!==h||e[1]!==a||e[2]!==i.color||e[3]!==i.id||e[4]!==i.layout||e[5]!==r?(s=i.layout==="search"?t.jsx($e,{seo:r,host:h,path:a}):i.layout==="card"?t.jsx(De,{seo:r,host:h,path:a}):i.layout==="chat"?t.jsx(Ie,{seo:r,host:h,path:a,accent:i.color}):t.jsx(Ae,{seo:r,host:h,path:a,accent:i.color,dark:i.id==="discord"}),e[0]=h,e[1]=a,e[2]=i.color,e[3]=i.id,e[4]=i.layout,e[5]=r,e[6]=s):s=e[6];const o=s;let l;e[7]!==i.color?(l=t.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{background:i.color}}),e[7]=i.color,e[8]=l):l=e[8];let m;e[9]!==i.label?(m=t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:i.label}),e[9]=i.label,e[10]=m):m=e[10];let p;e[11]!==l||e[12]!==m?(p=t.jsxs("div",{className:"mb-1.5 flex items-center gap-1.5",children:[l,m]}),e[11]=l,e[12]=m,e[13]=p):p=e[13];let d;return e[14]!==o||e[15]!==p?(d=t.jsxs("div",{children:[p,o]}),e[14]=o,e[15]=p,e[16]=d):d=e[16],d}function Ue(n){const e=T.c(17),{seo:i,url:r,path:h}=n,a=h===void 0?"/":h;let s,o,l;if(e[0]!==i||e[1]!==r){const u=Pe(i);s=u,o=he(u.image,r),l=he(u.favicon,r),e[0]=i,e[1]=r,e[2]=s,e[3]=o,e[4]=l}else s=e[2],o=e[3],l=e[4];let m;e[5]!==s||e[6]!==o||e[7]!==l?(m={...s,image:o,favicon:l},e[5]=s,e[6]=o,e[7]=l,e[8]=m):m=e[8];const p=m;let d;e[9]!==r?(d=Oe(r),e[9]=r,e[10]=d):d=e[10];const c=d,g=a==="/"?"":a;let f;e[11]!==g||e[12]!==c||e[13]!==p?(f=Le.map(u=>t.jsx(Be,{platform:u,seo:p,host:c,path:g},u.id)),e[11]=g,e[12]=c,e[13]=p,e[14]=f):f=e[14];let x;return e[15]!==f?(x=t.jsx("div",{className:"grid grid-cols-1 gap-4 @2xl:grid-cols-2",children:f}),e[15]=f,e[16]=x):x=e[16],x}function Ci(n){const e=T.c(63),{orgSlug:i,virtualMcpId:r,branch:h,decofile:a,meta:s,target:o,previewBaseUrl:l,onSaved:m,onEditDefaultSeo:p,onBack:d}=n,c=Ne(a,o,s),g=c?.seoData,f=o.kind==="site"?"site":o.pageKey,[x,u]=Q.useState(f),[j,v]=Q.useState(null),[y,S]=Q.useState(0),[_,N]=Q.useState(void 0);x!==f&&(u(f),v(null),N(void 0),S(Me));const{persistSeo:b,persistRawSeo:k,flush:C,isPending:te}=ke({orgSlug:i,virtualMcpId:r,branch:h,target:o,resolved:c,onSaved:m}),K=o.kind==="page",ve=K?c?.rawSeoData:void 0,B=_!==void 0?_:ve,ye=K?_e(B)??void 0:void 0,w=j??ye??g??{},F=c?we(w,c):null,z=F&&(!K||Ce(B))?ze(F,s):null;let M;e[0]!==s?(M=Te(s),e[0]=s,e[1]=M):M=e[1];const oe=M;let R,G;e[2]!==a||e[3]!==w||e[4]!==s||e[5]!==o.kind?(R=o.kind==="page"?Fe(a,s)?.seoData??{}:{},G=o.kind==="page"?Ve(R,w):w,e[2]=a,e[3]=w,e[4]=s,e[5]=o.kind,e[6]=R,e[7]=G):(R=e[6],G=e[7]);const ie=G;let V;e[8]!==b||e[9]!==c||e[10]!==v?(V=E=>{if(!c)return;const de=E;v(de),b(de)},e[8]=b,e[9]=c,e[10]=v,e[11]=V):V=e[11];const se=V;let Y;e[12]!==v?(Y=()=>v(null),e[12]=v,e[13]=Y):Y=e[13];const le=Y;let H;e[14]!==S?(H=()=>S(Ke),e[14]=S,e[15]=H):H=e[15];const re=H;let W;e[16]!==C||e[17]!==d?(W=()=>{C(),d?.()},e[16]=C,e[17]=d,e[18]=W):W=e[18];const ae=W,P=o.kind==="page"?o.path:"/";let X;e[19]!==P||e[20]!==l||e[21]!==o.kind?(X=o.kind==="page"&&l?Ge(P,l):l??null,e[19]=P,e[20]=l,e[21]=o.kind,e[22]=X):X=e[22];const ne=X,ce=o.kind==="site"?"No site-level SEO block found.":c?"SEO schema not found for this page.":"Could not load page SEO.",q=K&&c,me=o.kind==="site"&&c&&z;let O;e[23]!==ae||e[24]!==o.kind||e[25]!==o.pageName?(O=o.kind==="page"?t.jsxs("nav",{className:"flex min-w-0 items-center gap-1 text-sm",children:[t.jsx("button",{type:"button",onClick:ae,title:o.pageName,className:"min-w-0 truncate rounded-md px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",children:o.pageName}),t.jsx(be,{className:"size-3 shrink-0 text-muted-foreground/60"}),t.jsx("span",{className:"px-1 py-0.5 font-medium text-foreground",children:"SEO"})]}):t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(fe,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("span",{className:"text-sm font-medium",children:"Default SEO"}),t.jsx("span",{className:"hidden truncate text-xs text-muted-foreground sm:inline",children:"· applied to every page unless overridden"})]}),e[23]=ae,e[24]=o.kind,e[25]=o.pageName,e[26]=O):O=e[26];let L;e[27]!==te?(L=te&&t.jsx(Se,{size:14,className:"animate-spin text-muted-foreground"}),e[27]=te,e[28]=L):L=e[28];let $;e[29]!==p||e[30]!==o.kind?($=o.kind==="page"&&p&&t.jsxs(je,{type:"button",variant:"outline",size:"sm",onClick:p,children:[t.jsx(fe,{size:14}),"Edit default SEO"]}),e[29]=p,e[30]=o.kind,e[31]=$):$=e[31];let D;e[32]!==$||e[33]!==L?(D=t.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[L,$]}),e[32]=$,e[33]=L,e[34]=D):D=e[34];let I;e[35]!==D||e[36]!==O?(I=t.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2 border-b px-4",children:[O,D]}),e[35]=D,e[36]=O,e[37]=I):I=e[37];let A;e[38]!==F||e[39]!==re||e[40]!==le||e[41]!==oe||e[42]!==B||e[43]!==w||e[44]!==ce||e[45]!==y||e[46]!==se||e[47]!==P||e[48]!==k||e[49]!==b||e[50]!==ie||e[51]!==ne||e[52]!==c||e[53]!==z||e[54]!==v||e[55]!==N||e[56]!==q||e[57]!==me||e[58]!==R?(A=!c||!q&&!me?t.jsx("div",{className:"flex flex-1 items-center justify-center px-6 text-center text-sm text-muted-foreground",children:ce}):t.jsxs("div",{className:"flex min-h-0 flex-1",children:[t.jsx(ue,{className:"w-full max-w-md shrink-0 border-r [&_[data-slot=scroll-area-viewport]>div]:!block",children:t.jsx("div",{className:"px-5 py-4",children:q?t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"mb-3 text-xs text-muted-foreground",children:"Empty fields inherit the default SEO. The preview shows the resolved result."}),t.jsx(Re,{rawSeo:B,innerSeo:w,defaultResolveType:oe,seoSchema:z,activeResolveType:F,seoTypeOptions:c.seoTypeOptions,formResetKey:y,siteDefaultSeo:R,onPersistRaw:E=>{N(E),k(E)},onInnerChange:E=>{v(E),b(E)},onClearForm:le,onBumpFormKey:re})]}):z&&F&&t.jsx(Ee,{schema:z,resolveType:F,value:w,formResetKey:y,onChange:se})})}),t.jsx(ue,{className:"min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:t.jsx("div",{className:"@container px-5 py-4",children:t.jsx(Ue,{seo:ie,url:ne,path:P})})})]}),e[38]=F,e[39]=re,e[40]=le,e[41]=oe,e[42]=B,e[43]=w,e[44]=ce,e[45]=y,e[46]=se,e[47]=P,e[48]=k,e[49]=b,e[50]=ie,e[51]=ne,e[52]=c,e[53]=z,e[54]=v,e[55]=N,e[56]=q,e[57]=me,e[58]=R,e[59]=A):A=e[59];let J;return e[60]!==I||e[61]!==A?(J=t.jsxs("div",{className:"flex h-full w-full flex-col",children:[I,A]}),e[60]=I,e[61]=A,e[62]=J):J=e[62],J}function Ke(n){return n+1}function Me(n){return n+1}function Ge(n,e){try{return new URL(n,e).href}catch{return e}}function Ve(n,e){const i=e.__resolveType,r=n.__resolveType;if(typeof i=="string"&&typeof r=="string"&&i!==r)return{...e};const h={...n};for(const[a,s]of Object.entries(e))a!=="__resolveType"&&s!=null&&(typeof s=="string"&&s.trim()===""||(h[a]=s));return h}export{Ci as SeoEditor};