decocms 4.92.1 → 4.92.2

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 (234) hide show
  1. package/dist/client/assets/{AlertCircle-Clv-C2np.js → AlertCircle-Cvc_10Uv.js} +1 -1
  2. package/dist/client/assets/{AreaChart-C4-p1gQK.js → AreaChart-D4PMIsMV.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-DCJUk93H.js → ArrowUp-Dq6JgHsq.js} +1 -1
  4. package/dist/client/assets/{ArrowUpRight-DwUunkDC.js → ArrowUpRight-DgI9ki5h.js} +1 -1
  5. package/dist/client/assets/{CheckCircle-BHKn_v25.js → CheckCircle-B5oIKeSF.js} +1 -1
  6. package/dist/client/assets/{ChevronDown-DDT8b8rP.js → ChevronDown-D_W2bIqv.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-HnufFvB9.js → ChevronRight-BnIvJcIZ.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-D-P6SBrW.js → ChevronUp-Ci-XiWb6.js} +1 -1
  9. package/dist/client/assets/{Copy01-CyfFXTKR.js → Copy01-Q4xZmPKp.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-4aFvnFGK.js → DotsVertical-Bcfqjiks.js} +1 -1
  11. package/dist/client/assets/{Eye-DTlsPxh1.js → Eye-BuukW7MV.js} +1 -1
  12. package/dist/client/assets/{FilterLines-CDNj37OS.js → FilterLines-Do4UgzmV.js} +1 -1
  13. package/dist/client/assets/{Globe01-7xljr_EC.js → Globe01-qjaQZUfN.js} +1 -1
  14. package/dist/client/assets/{Globe04-ljGt4Lg6.js → Globe04-CqIGMVDi.js} +1 -1
  15. package/dist/client/assets/{HardDrive-BroB03OF.js → HardDrive-DrLvUMYg.js} +1 -1
  16. package/dist/client/assets/{Image01-CPHpxpf1.js → Image01-BWotytID.js} +1 -1
  17. package/dist/client/assets/{Key01-BMPHkbEG.js → Key01-BPZUhUcV.js} +1 -1
  18. package/dist/client/assets/{LayoutLeft-1eHZDH0T.js → LayoutLeft-COV7zlIC.js} +1 -1
  19. package/dist/client/assets/{LinkExternal01-CNmFDmgO.js → LinkExternal01-CyMOdGfe.js} +1 -1
  20. package/dist/client/assets/{Monitor01-6Irz93Em.js → Monitor01-dLHbd0CB.js} +1 -1
  21. package/dist/client/assets/{Package-Cy8-91a-.js → Package-B7Qii2Tl.js} +1 -1
  22. package/dist/client/assets/{Palette-C1a_XOsl.js → Palette-tVNOj7Ym.js} +1 -1
  23. package/dist/client/assets/{Play-CwA4-KOo.js → Play-BE8nTtBp.js} +1 -1
  24. package/dist/client/assets/{Plus-us-N9JUq.js → Plus-5VWQJEkS.js} +1 -1
  25. package/dist/client/assets/{SearchLg-BUP3ozF2.js → SearchLg-BiyFAMx0.js} +1 -1
  26. package/dist/client/assets/{SearchMd-Dd7ZGI56.js → SearchMd-LbMkvaPD.js} +1 -1
  27. package/dist/client/assets/{Settings02-DrOPo3mj.js → Settings02-CU2rilKq.js} +1 -1
  28. package/dist/client/assets/{Shield01-BI58H8tV.js → Shield01-7KT2UKvg.js} +1 -1
  29. package/dist/client/assets/{Star01-BTYXST43.js → Star01-D4LxiizA.js} +1 -1
  30. package/dist/client/assets/{Stars01-B6N3EY9X.js → Stars01-HAbkffzq.js} +1 -1
  31. package/dist/client/assets/{Stars02-BY1cpg45.js → Stars02-CdgckoDr.js} +1 -1
  32. package/dist/client/assets/{Sun-CeoIcGEC.js → Sun-Ca3eslhz.js} +1 -1
  33. package/dist/client/assets/{SwitchHorizontal01-DSaA1AAh.js → SwitchHorizontal01-DNcPUv7P.js} +1 -1
  34. package/dist/client/assets/{Tool01-Cg68N3nA.js → Tool01-DBXzU6aR.js} +1 -1
  35. package/dist/client/assets/{Tool02-DED34rla.js → Tool02-rl8XhSPG.js} +1 -1
  36. package/dist/client/assets/{Trash01-CKx7yRIc.js → Trash01-DxXosbkh.js} +1 -1
  37. package/dist/client/assets/{TrendUp01-CW6Njakg.js → TrendUp01-BmzCTIbp.js} +1 -1
  38. package/dist/client/assets/{Upload01-BEXZOkzx.js → Upload01-CXsTipbe.js} +1 -1
  39. package/dist/client/assets/{User01-WL7UxAwC.js → User01-CZgThaZQ.js} +1 -1
  40. package/dist/client/assets/{Users01-BVVqJkbL.js → Users01-IdyAszrF.js} +1 -1
  41. package/dist/client/assets/{Users03-kQPt9_XZ.js → Users03-3HXi1aia.js} +1 -1
  42. package/dist/client/assets/{X-B4leRLqf.js → X-CLG08ht8.js} +1 -1
  43. package/dist/client/assets/{XCircle-Di8Uo4pL.js → XCircle-pZ6nD22L.js} +1 -1
  44. package/dist/client/assets/{XClose-DMc7p4CW.js → XClose-BYq2BBpT.js} +1 -1
  45. package/dist/client/assets/{Zap-Zy5e7I3t.js → Zap-C6tkfs5m.js} +1 -1
  46. package/dist/client/assets/{ZapSquare-DiRNwHBE.js → ZapSquare-DdKvM81Z.js} +1 -1
  47. package/dist/client/assets/{ZoomOut-tXRohD9g.js → ZoomOut-DAAhtu2Z.js} +1 -1
  48. package/dist/client/assets/{access-gate-AwksVSKW.js → access-gate-B8spscer.js} +1 -1
  49. package/dist/client/assets/add-section-modal-De0GxBTc.js +1 -0
  50. package/dist/client/assets/agent-icon-BIj6WxKp.js +1 -0
  51. package/dist/client/assets/{agents-list-C5V-ldBY.js → agents-list-Cc-986WT.js} +1 -1
  52. package/dist/client/assets/{ai-providers-D_fbUUoy.js → ai-providers-Ck_-NP1I.js} +1 -1
  53. package/dist/client/assets/{alert-fgtNa48Y.js → alert-CI7flGPF.js} +1 -1
  54. package/dist/client/assets/{alert-dialog-De7Jj0Gd.js → alert-dialog-D2oa47X8.js} +1 -1
  55. package/dist/client/assets/{app-editor-C5o42oU3.js → app-editor-Cn-tT-ug.js} +1 -1
  56. package/dist/client/assets/{auth-Ta6fwTa4.js → auth-Kymy4xkz.js} +1 -1
  57. package/dist/client/assets/{auth-catchall-BINtcQPS.js → auth-catchall-B0gQyYvu.js} +1 -1
  58. package/dist/client/assets/{auth-entry-CMZVqZD1.js → auth-entry-Crrd0hkP.js} +1 -1
  59. package/dist/client/assets/{auth-split-layout-BE16rQGL.js → auth-split-layout-BO4l9cCp.js} +1 -1
  60. package/dist/client/assets/{authenticate-and-persist-oauth-BWqn4KLF.js → authenticate-and-persist-oauth-DAAmwSgR.js} +1 -1
  61. package/dist/client/assets/{automation-list-row-BcxbDbRm.js → automation-list-row-D-cT9rxb.js} +1 -1
  62. package/dist/client/assets/{automation-runs-eB3UxPqQ.js → automation-runs-_XAGR1m2.js} +1 -1
  63. package/dist/client/assets/{automations-BfGGsIrT.js → automations-Bh1OF4xf.js} +1 -1
  64. package/dist/client/assets/{autosend-BhmTfxCS.js → autosend-D-JHJKNK.js} +1 -1
  65. package/dist/client/assets/{avatar-B8_a8C3S.js → avatar-1o2VQKTj.js} +1 -1
  66. package/dist/client/assets/{badge-BZilNB5D.js → badge-dHBIjKyY.js} +1 -1
  67. package/dist/client/assets/{block-document-CU_R1go5.js → block-document-nemKITlN.js} +1 -1
  68. package/dist/client/assets/{brand-context-nl5okTqp.js → brand-context-DSZ7O9_c.js} +1 -1
  69. package/dist/client/assets/{buckets-CWGAX4Op.js → buckets-BDkQllTH.js} +1 -1
  70. package/dist/client/assets/{bulk-category-panel-CgSvwA00.js → bulk-category-panel-Cn58Io0u.js} +1 -1
  71. package/dist/client/assets/{calendar-CM0d8cf3.js → calendar-C9b1I5Xh.js} +1 -1
  72. package/dist/client/assets/{capability-load-error-DyXw79vO.js → capability-load-error-DI4Ww9LY.js} +1 -1
  73. package/dist/client/assets/{card-DNiOb8C_.js → card-CoG27DVs.js} +1 -1
  74. package/dist/client/assets/{category-editor-omUhw8hw.js → category-editor-BmpcIx1s.js} +1 -1
  75. package/dist/client/assets/{chat-context-CaE1IrMD.js → chat-context-glCfFIWX.js} +1 -1
  76. package/dist/client/assets/{checkbox-BiboLXsd.js → checkbox-BOAToSlJ.js} +1 -1
  77. package/dist/client/assets/{cli-auth-success-hGSoasXF.js → cli-auth-success-CqzQrYb8.js} +1 -1
  78. package/dist/client/assets/collection-detail-I0O1ME9a.js +1 -0
  79. package/dist/client/assets/{collection-display-button-CINCvS0U.js → collection-display-button-Bw2bFMNm.js} +1 -1
  80. package/dist/client/assets/{collection-search-DkaBDE88.js → collection-search-DuPY-s4R.js} +1 -1
  81. package/dist/client/assets/{collection-table-wrapper-B31K-mZy.js → collection-table-wrapper-BOKHq7cp.js} +1 -1
  82. package/dist/client/assets/{collection-tabs-CjttU7gV.js → collection-tabs-CcN3J070.js} +1 -1
  83. package/dist/client/assets/{command-DtXbWX2t.js → command-BB6Oir8o.js} +1 -1
  84. package/dist/client/assets/{commerce-onboarding-DSEpOAMV.js → commerce-onboarding-DejhsIyX.js} +1 -1
  85. package/dist/client/assets/{companions-core-DU4JOcgk.js → companions-core-C-kZqiTC.js} +1 -1
  86. package/dist/client/assets/{connect-desktop-dialog-rRtqIhuV.js → connect-desktop-dialog-CUGIAU17.js} +1 -1
  87. package/dist/client/assets/{connection-card-DH9eHpgr.js → connection-card-7gBTmFox.js} +1 -1
  88. package/dist/client/assets/{connection-detail-BPx_l57r.js → connection-detail-BB0rtYjx.js} +1 -1
  89. package/dist/client/assets/{connection-form-helpers-9cIttTn5.js → connection-form-helpers-CJKig9hy.js} +1 -1
  90. package/dist/client/assets/{connections-AVIhTzcp.js → connections-E7mextbc.js} +1 -1
  91. package/dist/client/assets/{decopilot-sse-pool-BD-E8GML.js → decopilot-sse-pool-DEJZ4gJu.js} +1 -1
  92. package/dist/client/assets/{dialog-CEJEmlAZ.js → dialog-ChJw5xnr.js} +1 -1
  93. package/dist/client/assets/{domain-settings-BkzI_Z14.js → domain-settings-B6Co6UtW.js} +1 -1
  94. package/dist/client/assets/{drawer-B16UsJ9z.js → drawer-_WfOhyRU.js} +1 -1
  95. package/dist/client/assets/{dropdown-menu-Bohi0euR.js → dropdown-menu-B7HOgSu8.js} +1 -1
  96. package/dist/client/assets/{empty-state-DAC9lF38.js → empty-state-kSEyPCAz.js} +1 -1
  97. package/dist/client/assets/{extract-connection-data-BOVpLxWL.js → extract-connection-data-oUFnwuwD.js} +1 -1
  98. package/dist/client/assets/{file-explorer-C83rSApL.js → file-explorer-CnTvRnvj.js} +1 -1
  99. package/dist/client/assets/{file-type-icon-CA2uuZ7F.js → file-type-icon-CeQVzqDu.js} +1 -1
  100. package/dist/client/assets/{files-Cgp73tmq.js → files-CCxNqj9u.js} +1 -1
  101. package/dist/client/assets/{form-xwt17q8h.js → form-BUM27CLj.js} +1 -1
  102. package/dist/client/assets/{general-CWptcVqJ.js → general-BjF2DfAd.js} +1 -1
  103. package/dist/client/assets/{github-repo-picker-Ce0749m3.js → github-repo-picker-4TIPzYjR.js} +1 -1
  104. package/dist/client/assets/{hooks-9fTm-ZdN.js → hooks-CJqrF4BQ.js} +1 -1
  105. package/dist/client/assets/{index-CXnbxDhA.js → index-BHqz24vm.js} +1 -1
  106. package/dist/client/assets/{index-BIBRA2uz.js → index-B_qFi_-_.js} +28 -28
  107. package/dist/client/assets/{index-DsTc8yYr.js → index-BderZvBT.js} +1 -1
  108. package/dist/client/assets/{index--Rru8MRb.js → index-Bj_MaVUP.js} +1 -1
  109. package/dist/client/assets/{index-BE6hzuPl.js → index-C8rlFaFO.js} +3 -3
  110. package/dist/client/assets/{index-CdhReIUf.js → index-CHWLrEqX.js} +1 -1
  111. package/dist/client/assets/{index-BqyYrFv3.js → index-CQwS9Ezr.js} +1 -1
  112. package/dist/client/assets/{index-Jz0CuEFl.js → index-CR0rMz7E.js} +1 -1
  113. package/dist/client/assets/{index-CCMPN7OD.js → index-CWGwstEz.js} +1 -1
  114. package/dist/client/assets/{index-DEAM6UpC.js → index-CWlzI7M3.js} +2 -2
  115. package/dist/client/assets/{index-BaUSa1j3.js → index-D6ixbRYa.js} +1 -1
  116. package/dist/client/assets/{index-BQh3gSSP.js → index-DVotD2Sm.js} +1 -1
  117. package/dist/client/assets/{index-C6Xwww_u.js → index-DyXd0E61.js} +1 -1
  118. package/dist/client/assets/{index-DLt5Gc69.js → index-WDnleR3r.js} +1 -1
  119. package/dist/client/assets/{index-redirect-DAbgHTCC.js → index-redirect-CZuVtK8Y.js} +1 -1
  120. package/dist/client/assets/{input-BgHT8C_Y.js → input-CWExGH7j.js} +1 -1
  121. package/dist/client/assets/{integration-icon-GEOjw9nA.js → integration-icon-BXEpLE2r.js} +1 -1
  122. package/dist/client/assets/{invite-member-dialog-Bn-S9yCN.js → invite-member-dialog-Cj35CA_W.js} +1 -1
  123. package/dist/client/assets/{label-BUEwzrLz.js → label-BbLr7wPS.js} +1 -1
  124. package/dist/client/assets/{layout-C6WVIkZ1.js → layout-yKsHfaYu.js} +1 -1
  125. package/dist/client/assets/{login-DxawahhV.js → login-g6Yf2A86.js} +1 -1
  126. package/dist/client/assets/{mcp-oauth-y10dB3OG.js → mcp-oauth-B2KaqQoI.js} +1 -1
  127. package/dist/client/assets/{members-BekqX_Ri.js → members-yX31omZQ.js} +1 -1
  128. package/dist/client/assets/{monaco-editor-Bh8y4XGF.js → monaco-editor-CJKnQM68.js} +1 -1
  129. package/dist/client/assets/{monitoring-stats-row-CmNpuSe3.js → monitoring-stats-row-DTqvYy56.js} +1 -1
  130. package/dist/client/assets/{multi-select-AV0FE5T3.js → multi-select-C9lH7lr4.js} +1 -1
  131. package/dist/client/assets/{oauth-callback-Dsy_qURW.js → oauth-callback-DPu8Jv31.js} +1 -1
  132. package/dist/client/assets/{oauth-callback-ai-provider-DxmqFpZS.js → oauth-callback-ai-provider-DXhgROtl.js} +1 -1
  133. package/dist/client/assets/{onboarding-DZ--Mi0J.js → onboarding-b8UESLyK.js} +1 -1
  134. package/dist/client/assets/{org-install-CLR3-44w.js → org-install-DFTAzRMO.js} +1 -1
  135. package/dist/client/assets/{org-layout-kthKrGx0.js → org-layout-BbjFIQ-M.js} +1 -1
  136. package/dist/client/assets/{organization-choice-BRPibyv7.js → organization-choice-DjVV9MCZ.js} +1 -1
  137. package/dist/client/assets/{orgs-DBHsCjWx.js → orgs-B1jGApXW.js} +1 -1
  138. package/dist/client/assets/{page-seo-form-BytIEBTv.js → page-seo-form-DeD_2a8R.js} +1 -1
  139. package/dist/client/assets/page-seo-sheet-BWnl0tVz.js +1 -0
  140. package/dist/client/assets/{popover-BEGdNmUQ.js → popover-kOy_asOa.js} +1 -1
  141. package/dist/client/assets/{post-editor-CEMsCtDO.js → post-editor-BZQdhdwo.js} +1 -1
  142. package/dist/client/assets/{primitives-DrykBhU_.js → primitives-Cyz_TV23.js} +1 -1
  143. package/dist/client/assets/{profile-DnMb85h-.js → profile-D5HUGTyF.js} +1 -1
  144. package/dist/client/assets/project-app-view-Bsaa-6LK.js +1 -0
  145. package/dist/client/assets/record-editor-Bjgurgfp.js +1 -0
  146. package/dist/client/assets/redirect-editor-DnT7ef0C.js +1 -0
  147. package/dist/client/assets/registry-DHjmo34d.js +2 -0
  148. package/dist/client/assets/{registry-layout-DZNagoau.js → registry-layout-JPmaR-tb.js} +1 -1
  149. package/dist/client/assets/{reports-GLGMCsVS.js → reports-Btc-1oN-.js} +1 -1
  150. package/dist/client/assets/{require-capability-BvIdOAAp.js → require-capability-BBszzyH9.js} +1 -1
  151. package/dist/client/assets/{required-auth-layout-DN9CNJ17.js → required-auth-layout-CR5_YK6W.js} +1 -1
  152. package/dist/client/assets/{reset-password-C1pIm0Iv.js → reset-password-u9Nbv0bS.js} +1 -1
  153. package/dist/client/assets/{roles-DokzsAwQ.js → roles-B7bUsR2h.js} +1 -1
  154. package/dist/client/assets/{search-input-B-DY-xf1.js → search-input-B6akQV4Y.js} +1 -1
  155. package/dist/client/assets/{secrets-BXnB__ih.js → secrets-Dsj3iy5H.js} +1 -1
  156. package/dist/client/assets/{sections-editor-Dpco23Fg.js → sections-editor-CvIj0bPs.js} +2 -2
  157. package/dist/client/assets/{select-_BdZTxPS.js → select-4-vdHbLT.js} +1 -1
  158. package/dist/client/assets/{select-model-CdCA5sAQ.js → select-model-CVcEVUsi.js} +1 -1
  159. package/dist/client/assets/{self-tool-result-DxwgmlEg.js → self-tool-result-Cwdk21K_.js} +1 -1
  160. package/dist/client/assets/{seo-editor-pHkOR1VP.js → seo-editor-B0_qMHl0.js} +1 -1
  161. package/dist/client/assets/{settings-layout-Bay6czqP.js → settings-layout-BURikhtl.js} +1 -1
  162. package/dist/client/assets/{settings-section-WJlRZThP.js → settings-section-DxqR9iml.js} +1 -1
  163. package/dist/client/assets/{shell-controls-BVv8dxtB.js → shell-controls-DYq3DSuV.js} +1 -1
  164. package/dist/client/assets/{shell-layout-BzSeIhlb.js → shell-layout-DvMdeukx.js} +1 -1
  165. package/dist/client/assets/{sidebar-D06GkkF0.js → sidebar-AfeWMY1r.js} +1 -1
  166. package/dist/client/assets/{skeleton-peXMJuH3.js → skeleton-DraYvTQP.js} +1 -1
  167. package/dist/client/assets/{sso-CX3xGBAk.js → sso-DWBNvY6X.js} +1 -1
  168. package/dist/client/assets/{store-Dk-YRB6l.js → store-BFhYLhoT.js} +1 -1
  169. package/dist/client/assets/store-registry-C50_5LUp.js +2 -0
  170. package/dist/client/assets/{studio-tools-BccAxrVu.js → studio-tools-B3FHZXsQ.js} +1 -1
  171. package/dist/client/assets/{switch-DYnCFD5-.js → switch-CyZjNvfZ.js} +1 -1
  172. package/dist/client/assets/{table-BjiI-gaG.js → table-iG6kCmeS.js} +1 -1
  173. package/dist/client/assets/{tabs-Dwdnv16R.js → tabs-C1LpzuaJ.js} +1 -1
  174. package/dist/client/assets/{textarea-BE7D_QqU.js → textarea-B8dhUfp9.js} +1 -1
  175. package/dist/client/assets/{toggle-group-CmVcJdNh.js → toggle-group-c5TjS6xS.js} +1 -1
  176. package/dist/client/assets/{toolbar-kZcoGdr4.js → toolbar-Daz4jqLs.js} +1 -1
  177. package/dist/client/assets/{toolbar-icon-button-CSOZwc8p.js → toolbar-icon-button-Bbbo7hyv.js} +1 -1
  178. package/dist/client/assets/{tooltip-XFj2xRwa.js → tooltip-DE_gqCm3.js} +1 -1
  179. package/dist/client/assets/{use-ai-providers-Bc2W8TAS.js → use-ai-providers-CGzSWtp7.js} +1 -1
  180. package/dist/client/assets/{use-automations-5XmapDED.js → use-automations-Btiu7Z09.js} +1 -1
  181. package/dist/client/assets/{use-autosave-iqnZwi6W.js → use-autosave-DphOvxb9.js} +1 -1
  182. package/dist/client/assets/{use-capability-BMD-Q3c_.js → use-capability-BNcFOggs.js} +1 -1
  183. package/dist/client/assets/{use-clock-tick-Bs8YFyZt.js → use-clock-tick-Dw7sAB29.js} +1 -1
  184. package/dist/client/assets/{use-collections-D0Q6wvcH.js → use-collections-u5tkBX1a.js} +1 -1
  185. package/dist/client/assets/{use-connection-1A7IHNnw.js → use-connection-CcmTBTY-.js} +1 -1
  186. package/dist/client/assets/{use-copy-Ddqaz7gu.js → use-copy-CveeH2p4.js} +1 -1
  187. package/dist/client/assets/{use-create-virtual-mcp-DT1cqpNs.js → use-create-virtual-mcp-jvSmQNTU.js} +1 -1
  188. package/dist/client/assets/{use-debounced-autosave-DA0Wn7VJ.js → use-debounced-autosave-DFle-8Sb.js} +1 -1
  189. package/dist/client/assets/{use-debounced-value-DBDdUa8t.js → use-debounced-value-D1xFGN32.js} +1 -1
  190. package/dist/client/assets/{use-deco-credits-Mofa-D5b.js → use-deco-credits-CV7sw9Em.js} +1 -1
  191. package/dist/client/assets/{use-decopilot-events-XyNhQjC6.js → use-decopilot-events-VInARyiN.js} +1 -1
  192. package/dist/client/assets/{use-delete-connection-CihVR_F9.js → use-delete-connection-DDV7XY4a.js} +1 -1
  193. package/dist/client/assets/{use-deployment-admin-CyJ5Uxw6.js → use-deployment-admin-h9tth1Ey.js} +1 -1
  194. package/dist/client/assets/{use-file-configs-BtA47JHd.js → use-file-configs-BEHJ-b8Q.js} +1 -1
  195. package/dist/client/assets/{use-infinite-scroll-ZPVDShE1.js → use-infinite-scroll-BI8YTyTt.js} +1 -1
  196. package/dist/client/assets/{use-join-requests-CULFkSOG.js → use-join-requests-V5rMqfIc.js} +1 -1
  197. package/dist/client/assets/{use-mcp-auth-status-C9suHuMS.js → use-mcp-auth-status-DINFEYgi.js} +1 -1
  198. package/dist/client/assets/{use-mcp-client-DS0Emn8e.js → use-mcp-client-PcphUWIj.js} +1 -1
  199. package/dist/client/assets/{use-mcp-tools-BAfp0q-e.js → use-mcp-tools-CakNulXp.js} +1 -1
  200. package/dist/client/assets/{use-members-NR_NeOoj.js → use-members-JooO5O_z.js} +1 -1
  201. package/dist/client/assets/{use-mobile-DSBAMYJF.js → use-mobile-C57pT7o9.js} +1 -1
  202. package/dist/client/assets/{use-navigate-to-agent-DvIjbi8Z.js → use-navigate-to-agent-DVHUkqpb.js} +1 -1
  203. package/dist/client/assets/{use-org-auth-client-Brlf7KHt.js → use-org-auth-client-C0qPMRhc.js} +1 -1
  204. package/dist/client/assets/{use-org-sso-D_69Sai0.js → use-org-sso-BaYh30WC.js} +1 -1
  205. package/dist/client/assets/{use-organization-roles-D5oSFijj.js → use-organization-roles-BG6jMK7e.js} +1 -1
  206. package/dist/client/assets/{use-organization-settings-B09wmnaH.js → use-organization-settings-DBhnNnJm.js} +1 -1
  207. package/dist/client/assets/{use-registry-app-lYXnJYv0.js → use-registry-app-Dyfesgrg.js} +1 -1
  208. package/dist/client/assets/{use-registry-connections-CK8Y9s5Q.js → use-registry-connections-CTtHQqlB.js} +1 -1
  209. package/dist/client/assets/{use-secrets-CrZ0-Hfb.js → use-secrets-BYzFSfMf.js} +1 -1
  210. package/dist/client/assets/{use-status-sounds-xXWp62ox.js → use-status-sounds-DJxvpKl9.js} +1 -1
  211. package/dist/client/assets/{use-t-CzC_cXLB.js → use-t-BeHordU2.js} +1 -1
  212. package/dist/client/assets/{use-view-mode-CyGc5cDF.js → use-view-mode-C0yNdLzJ.js} +1 -1
  213. package/dist/client/assets/{use-virtual-mcp-CSfbKXoe.js → use-virtual-mcp-BtFe5DoR.js} +1 -1
  214. package/dist/client/assets/useInfiniteQuery-mNPfD3Pk.js +1 -0
  215. package/dist/client/assets/{useRouterState-Cz3yhvXr.js → useRouterState-C6jzqArr.js} +1 -1
  216. package/dist/client/assets/useSuspenseInfiniteQuery-DIVSilzv.js +1 -0
  217. package/dist/client/assets/{users-VpBU_WzK.js → users-C0dY9LVq.js} +1 -1
  218. package/dist/client/assets/{variant-calendar-Bhk3fwgs.js → variant-calendar-FpbApEV2.js} +1 -1
  219. package/dist/client/assets/{view-mode-toggle-DVDSH_UO.js → view-mode-toggle-DwdmtuKb.js} +1 -1
  220. package/dist/client/index.html +1 -1
  221. package/dist/server/cli.js +2 -2
  222. package/dist/server/server.js +2 -2
  223. package/package.json +1 -1
  224. package/dist/client/assets/add-section-modal-IG-4jW3o.js +0 -1
  225. package/dist/client/assets/agent-icon-n_DJILEj.js +0 -1
  226. package/dist/client/assets/collection-detail-_5X_l9MF.js +0 -1
  227. package/dist/client/assets/page-seo-sheet-mJW0tAP8.js +0 -1
  228. package/dist/client/assets/project-app-view-Cag9gDj3.js +0 -1
  229. package/dist/client/assets/record-editor-BEQrV1d8.js +0 -1
  230. package/dist/client/assets/redirect-editor-Bh-8Ulfx.js +0 -1
  231. package/dist/client/assets/registry-CvS_UwLO.js +0 -2
  232. package/dist/client/assets/store-registry-D31ldEYe.js +0 -2
  233. package/dist/client/assets/useInfiniteQuery-MB3W9wV7.js +0 -1
  234. package/dist/client/assets/useSuspenseInfiniteQuery-D5GJvpsH.js +0 -1
@@ -1,2 +1,2 @@
1
- import{c as ze,r as N,l as Ee,j as n,B as Ge,i as Fn,n as vs,t as G,K as Ss}from"./index-BE6hzuPl.js";import{a1 as xs,a2 as bs,a3 as ys,H as In,J as zt,K as zn,P as Hn,i as Wn,a4 as _s,V as Un,W as Gn,a5 as js,G as ks,a6 as ws,L as qn,M as Rt,Q as Jn,U as Yn,N as Qn,_ as Zn,a7 as Xn,a8 as Rs,a9 as Nt,aa as Ns,S as ea,ab as tt,ac as Ds,ad as Vs,ae as Cs,af as Ps,e as Ts,k as As,ag as Ms,ah as Es,ai as Ks,aj as $s,r as Ot,ak as Bt,al as Os,am as ut,an as jt,ao as Bs,ap as Ls,aq as Ye,ar as Dn,as as Fs,at as kt,au as Lt,av as Is,aw as sn,ax as zs,ay as xt,az as Hs,aA as Ws,aB as Us,aC as Gs,aD as qs,aE as dt,aF as Js,aG as Ys,aH as Qs,m as Zs,aI as Vn,aJ as wt,aK as Xs,aL as er,aM as tr,aN as nr,aO as rn,aP as Cn,aQ as Pn,aR as bt,aS as Ft,aT as Tn,aU as ar,aV as on,aW as sr,aX as rr,aY as or,aZ as An,a_ as ir}from"./index-BIBRA2uz.js";import{t as lr}from"./ChevronDown-DDT8b8rP.js";import{Z as cn,S as ta,D as cr,x as na,_ as ur,$ as dr}from"./agent-icon-n_DJILEj.js";import{i as aa}from"./ChevronRight-HnufFvB9.js";import{n as mr}from"./ChevronUp-D-P6SBrW.js";import{i as fr}from"./Globe01-7xljr_EC.js";import{m as It}from"./automation-runs-eB3UxPqQ.js";import{b as mt,T as ft,a as pt}from"./tooltip-XFj2xRwa.js";import{a as pr,D as hr,h as gr,c as vr,d as Sr,e as xr}from"./dialog-CEJEmlAZ.js";import{I as br}from"./input-BgHT8C_Y.js";import{a as sa}from"./Copy01-CyfFXTKR.js";import{b as yr}from"./ZoomOut-tXRohD9g.js";import{i as _r}from"./Settings02-DrOPo3mj.js";import{s as jr}from"./Eye-DTlsPxh1.js";import{s as ra}from"./TrendUp01-CW6Njakg.js";import{s as un}from"./Plus-us-N9JUq.js";import{s as oa}from"./Trash01-CKx7yRIc.js";import{i as kr}from"./Zap-Zy5e7I3t.js";import{d as it,a as ia,D as la,c as ca,j as wr}from"./dropdown-menu-Bohi0euR.js";import{S as Rr,r as Mn,a as Nr,d as Dr,b as Vr,i as Cr,f as Pr,P as Tr,c as Ar}from"./page-seo-form-BytIEBTv.js";import{b as Mr}from"./Tool01-Cg68N3nA.js";import{A as Er}from"./add-section-modal-IG-4jW3o.js";import"./ArrowUp-DCJUk93H.js";import"./chat-context-CaE1IrMD.js";import"./autosend-BhmTfxCS.js";import"./hooks-9fTm-ZdN.js";import"./use-mcp-client-DS0Emn8e.js";import"./auth-Ta6fwTa4.js";import"./decopilot-sse-pool-BD-E8GML.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-BccAxrVu.js";import"./use-virtual-mcp-CSfbKXoe.js";import"./use-collections-D0Q6wvcH.js";import"./use-ai-providers-Bc2W8TAS.js";import"./location-BpLtHjTZ.js";import"./tab-id-BijBBRwE.js";import"./use-decopilot-events-XyNhQjC6.js";import"./use-organization-settings-B09wmnaH.js";import"./drawer-B16UsJ9z.js";import"./collection-search-DkaBDE88.js";import"./SearchMd-Dd7ZGI56.js";import"./use-mobile-DSBAMYJF.js";import"./AreaChart-C4-p1gQK.js";import"./index-CdhReIUf.js";import"./calendar-CM0d8cf3.js";import"./X-B4leRLqf.js";import"./shell-layout-BzSeIhlb.js";import"./avatar-B8_a8C3S.js";import"./User01-WL7UxAwC.js";import"./Users03-kQPt9_XZ.js";import"./SearchLg-BUP3ozF2.js";import"./Stars02-BY1cpg45.js";import"./XClose-DMc7p4CW.js";import"./CheckCircle-BHKn_v25.js";import"./FilterLines-CDNj37OS.js";import"./use-t-CzC_cXLB.js";import"./required-auth-layout-DN9CNJ17.js";import"./use-org-sso-D_69Sai0.js";import"./index-DEAM6UpC.js";import"./get-initials-D-f_fDFw.js";import"./SwitchHorizontal01-DSaA1AAh.js";import"./use-registry-app-lYXnJYv0.js";import"./use-mcp-tools-BAfp0q-e.js";import"./use-connection-1A7IHNnw.js";import"./github-repo-scope-DjMZbiKa.js";import"./authenticate-and-persist-oauth-BWqn4KLF.js";import"./mcp-oauth-y10dB3OG.js";import"./extract-connection-data-BOVpLxWL.js";import"./use-members-NR_NeOoj.js";import"./use-org-auth-client-Brlf7KHt.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./AlertCircle-Clv-C2np.js";import"./DotsVertical-4aFvnFGK.js";import"./popover-BEGdNmUQ.js";import"./command-DtXbWX2t.js";import"./index-Jz0CuEFl.js";import"./use-copy-Ddqaz7gu.js";import"./LinkExternal01-CNmFDmgO.js";import"./XCircle-Di8Uo4pL.js";import"./companions-core-DU4JOcgk.js";import"./ZapSquare-DiRNwHBE.js";import"./Star01-BTYXST43.js";import"./Image01-CPHpxpf1.js";import"./Upload01-BEXZOkzx.js";import"./form-xwt17q8h.js";import"./label-BUEwzrLz.js";import"./select-_BdZTxPS.js";import"./tabs-Dwdnv16R.js";import"./Tool02-DED34rla.js";import"./toggle-group-CmVcJdNh.js";import"./use-deco-credits-Mofa-D5b.js";import"./connection-card-DH9eHpgr.js";import"./use-registry-connections-CK8Y9s5Q.js";import"./useInfiniteQuery-MB3W9wV7.js";import"./use-infinite-scroll-ZPVDShE1.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./card-DNiOb8C_.js";import"./integration-icon-GEOjw9nA.js";import"./textarea-BE7D_QqU.js";import"./connection-form-helpers-9cIttTn5.js";import"./collection-tabs-CjttU7gV.js";import"./badge-BZilNB5D.js";import"./useSuspenseInfiniteQuery-D5GJvpsH.js";import"./Monitor01-6Irz93Em.js";import"./connect-desktop-dialog-rRtqIhuV.js";import"./select-model-CdCA5sAQ.js";import"./checkbox-BiboLXsd.js";import"./skeleton-peXMJuH3.js";import"./Key01-BMPHkbEG.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-WJlRZThP.js";import"./ArrowUpRight-DwUunkDC.js";import"./Stars01-B6N3EY9X.js";import"./index-CCMPN7OD.js";import"./Palette-C1a_XOsl.js";import"./alert-dialog-De7Jj0Gd.js";import"./file-type-icon-CA2uuZ7F.js";import"./toolbar-kZcoGdr4.js";import"./Package-Cy8-91a-.js";import"./use-debounced-value-DBDdUa8t.js";import"./index-C6Xwww_u.js";import"./LayoutLeft-1eHZDH0T.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-xXWp62ox.js";import"./empty-state-DAC9lF38.js";import"./use-capability-BMD-Q3c_.js";import"./toolbar-icon-button-CSOZwc8p.js";import"./Play-CwA4-KOo.js";import"./use-debounced-autosave-DA0Wn7VJ.js";import"./index--Rru8MRb.js";import"./sidebar-D06GkkF0.js";import"./search-input-B-DY-xf1.js";import"./use-mcp-auth-status-C9suHuMS.js";import"./switch-DYnCFD5-.js";import"./github-repo-picker-Ce0749m3.js";import"./use-navigate-to-agent-DvIjbi8Z.js";import"./reusable-new-chat-CouMjkYR.js";import"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import"./Users01-BVVqJkbL.js";import"./use-secrets-CrZ0-Hfb.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./monaco-editor-Bh8y4XGF.js";import"./use-file-configs-BtA47JHd.js";import"./use-automations-5XmapDED.js";import"./automation-list-row-BcxbDbRm.js";import"./Globe04-ljGt4Lg6.js";import"./HardDrive-BroB03OF.js";import"./Sun-CeoIcGEC.js";import"./Shield01-BI58H8tV.js";import"./table-BjiI-gaG.js";import"./use-clock-tick-Bs8YFyZt.js";function Kr(m){return m.schema?.definitions??m.schema?.$defs??{}}function $r(m,e){const r=Kr(e),c=r[btoa(m)];if(!c)return;let u=typeof c.image=="string"?c.image:void 0;if(!u&&Array.isArray(c.allOf)){const g=c.allOf.find(S=>typeof S.$ref=="string")?.$ref;if(typeof g=="string"){const S=g.replace("#/definitions/",""),f=r[S];u=typeof f?.image=="string"?f.image:void 0}}if(u?.includes("{{{"))return u}function Or(m,e){if(!e)return;const r=xs(m);if(!r)return;const c=$r(r.resolveType,e);if(!c)return;const u=bs(c,r.data);if(u)return ys(u)}const Br="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",Lr="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 En(m){return Array.from({length:m},(e,r)=>({id:crypto.randomUUID(),index:r}))}function ua(m){return m.map((e,r)=>({...e,index:r}))}function Fr(m,e){if(e===m.length)return m;if(e<m.length)return ua(m.slice(0,e));const r=Array.from({length:e-m.length},(c,u)=>({id:crypto.randomUUID(),index:m.length+u}));return[...m,...r]}function da(m){const e=ze.c(20),{section:r,raw:c,meta:u}=m,g=r.isSavedBlock===!0,S=r.isMultivariate===!0;let f;e[0]!==u||e[1]!==c?(f=c&&u?Or(c,u):void 0,e[0]=u,e[1]=c,e[2]=f):f=e[2];const v=f;let h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(yr,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[3]=h):h=e[3];let x;e[4]!==v?(x=v&&n.jsx("img",{src:v,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[4]=v,e[5]=x):x=e[5];let D;e[6]!==S||e[7]!==g?(D=g?{color:ks}:S?{color:"oklch(0.65 0.15 160)"}:void 0,e[6]=S,e[7]=g,e[8]=D):D=e[8];let k;e[9]!==D?(k=n.jsx(cn,{className:"h-4 w-4 shrink-0",style:D}),e[9]=D,e[10]=k):k=e[10];const _=r.isHidden&&"line-through opacity-50";let j;e[11]!==_?(j=Ee("min-w-0 flex-1 truncate text-sm font-medium",_),e[11]=_,e[12]=j):j=e[12];let o;e[13]!==r.label||e[14]!==j?(o=n.jsx("span",{className:j,children:r.label}),e[13]=r.label,e[14]=j,e[15]=o):o=e[15];let w;return e[16]!==x||e[17]!==k||e[18]!==o?(w=n.jsxs(n.Fragment,{children:[h,x,k,o]}),e[16]=x,e[17]=k,e[18]=o,e[19]=w):w=e[19],w}function ma(m,e){const r=m.isSavedBlock===!0,c=m.isMultivariate===!0;return Ee("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":r?Br: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 Ir(m){const e=ze.c(64),{section:r,raw:c,meta:u,sortableId:g,selected:S,onSelect:f,onDelete:v,onDuplicate:h,onMakeReusable:x,onToggleHidden:D,onToggleLazy:k,onAddVariant:_,onDetach:j}=m,o=c?Wn(c.__resolveType??""):!1;let w;e[0]!==r?(w=_s(r),e[0]=r,e[1]=w):w=e[1];const i=w;let K;e[2]!==g?(K={id:g,animateLayoutChanges:Gr},e[2]=g,e[3]=K):K=e[3];const{attributes:E,listeners:M,setNodeRef:d,transform:P,isDragging:ae}=Un(K);let T;e[4]!==P?(T=Gn.Transform.toString(P?{...P,x:0}:null),e[4]=P,e[5]=T):T=e[5];const pe=ae?0:void 0;let V;e[6]!==T||e[7]!==pe?(V={transform:T,opacity:pe},e[6]=T,e[7]=pe,e[8]=V):V=e[8];const ce=V;let F;e[9]!==r?(F=js(r),e[9]=r,e[10]=F):F=e[10];const te=F,oe="button",Te=0;let O;e[11]!==f?(O=B=>{(B.key==="Enter"||B.key===" ")&&(B.preventDefault(),f())},e[11]=f,e[12]=O):O=e[12];const ue=ae?"cursor-grabbing":"cursor-pointer";let ie;e[13]!==r||e[14]!==S||e[15]!==ue?(ie=Ee("touch-none transition-colors",ue,ma(r,S)),e[13]=r,e[14]=S,e[15]=ue,e[16]=ie):ie=e[16];let je;e[17]!==u||e[18]!==c||e[19]!==r?(je=n.jsx(da,{section:r,raw:c,meta:u}),e[17]=u,e[18]=c,e[19]=r,e[20]=je):je=e[20];const $=!r.isMultivariate&&n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":o?"Disable async render":"Enable async render",className:Ee("h-7 w-7 shrink-0",o?"":"opacity-0 group-hover:opacity-100"),onClick:B=>{B.stopPropagation(),k()},onPointerDown:Ur,children:n.jsx(kr,{className:Ee("h-3.5 w-3.5",o&&"text-yellow-500")})})}),n.jsx(pt,{side:"bottom",children:o?"Disable async render":"Enable async render"})]});let Ae;e[21]!==D||e[22]!==r.isHidden||e[23]!==r.isMultivariate?(Ae=!r.isMultivariate&&n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":r.isHidden?"Show section":"Hide section",className:Ee("h-7 w-7 shrink-0",r.isHidden?"opacity-100":"opacity-0 group-hover:opacity-100"),onClick:B=>{B.stopPropagation(),D()},onPointerDown:Wr,children:r.isHidden?n.jsx(_r,{className:"h-3.5 w-3.5"}):n.jsx(jr,{className:"h-3.5 w-3.5"})})}),n.jsx(pt,{side:"bottom",children:r.isHidden?"Show section":"Hide section"})]}),e[21]=D,e[22]=r.isHidden,e[23]=r.isMultivariate,e[24]=Ae):Ae=e[24];let Z;e[25]===Symbol.for("react.memo_cache_sentinel")?(Z=n.jsx(ia,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":"Section actions",className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100",onClick:Hr,onPointerDown:zr,children:n.jsx(ta,{className:"h-3.5 w-3.5"})})}),e[25]=Z):Z=e[25];let De;e[26]!==h?(De=B=>{B.stopPropagation(),h()},e[26]=h,e[27]=De):De=e[27];let ve;e[28]===Symbol.for("react.memo_cache_sentinel")?(ve=n.jsx(sa,{className:"h-4 w-4"}),e[28]=ve):ve=e[28];let se;e[29]!==De?(se=n.jsxs(it,{onClick:De,children:[ve,"Duplicate"]}),e[29]=De,e[30]=se):se=e[30];let q;e[31]!==i||e[32]!==_?(q=i&&n.jsxs(it,{className:ws,onClick:B=>{B.stopPropagation(),_()},children:[n.jsx(ra,{className:"h-4 w-4"}),"Add variant"]}),e[31]=i,e[32]=_,e[33]=q):q=e[33];let J;e[34]!==te||e[35]!==x?(J=te&&n.jsxs(it,{className:Lr,onClick:B=>{B.stopPropagation(),x()},children:[n.jsx(cn,{className:"h-4 w-4"}),"Make reusable"]}),e[34]=te,e[35]=x,e[36]=J):J=e[36];let ne;e[37]!==j||e[38]!==r.isMultivariate||e[39]!==r.isSavedBlock?(ne=r.isSavedBlock===!0&&!r.isMultivariate&&n.jsxs(it,{onClick:B=>{B.stopPropagation(),j()},children:[n.jsx(cn,{className:"h-4 w-4"}),"Detach"]}),e[37]=j,e[38]=r.isMultivariate,e[39]=r.isSavedBlock,e[40]=ne):ne=e[40];let le;e[41]!==v?(le=B=>{B.stopPropagation(),v()},e[41]=v,e[42]=le):le=e[42];let ke;e[43]===Symbol.for("react.memo_cache_sentinel")?(ke=n.jsx(oa,{className:"h-4 w-4"}),e[43]=ke):ke=e[43];let Se;e[44]!==le?(Se=n.jsxs(it,{className:"text-destructive focus:text-destructive",onClick:le,children:[ke,"Delete"]}),e[44]=le,e[45]=Se):Se=e[45];let de;e[46]!==se||e[47]!==q||e[48]!==J||e[49]!==ne||e[50]!==Se?(de=n.jsxs(la,{children:[Z,n.jsxs(ca,{align:"end",className:"w-44",children:[se,q,J,ne,Se]})]}),e[46]=se,e[47]=q,e[48]=J,e[49]=ne,e[50]=Se,e[51]=de):de=e[51];let ye;return e[52]!==E||e[53]!==M||e[54]!==f||e[55]!==d||e[56]!==ce||e[57]!==ie||e[58]!==je||e[59]!==$||e[60]!==Ae||e[61]!==de||e[62]!==O?(ye=n.jsxs("div",{ref:d,style:ce,...E,...M,role:oe,tabIndex:Te,onClick:f,onKeyDown:O,className:ie,children:[je,$,Ae,de]}),e[52]=E,e[53]=M,e[54]=f,e[55]=d,e[56]=ce,e[57]=ie,e[58]=je,e[59]=$,e[60]=Ae,e[61]=de,e[62]=O,e[63]=ye):ye=e[63],ye}function zr(m){return m.stopPropagation()}function Hr(m){return m.stopPropagation()}function Wr(m){return m.stopPropagation()}function Ur(m){return m.stopPropagation()}function Gr(){return!1}function qr(m){const e=ze.c(90),{listKey:r,rawSections:c,sections:u,meta:g,selectedIndex:S,onSelect:f,onReorder:v,onDelete:h,onDuplicate:x,onMakeReusable:D,onToggleHidden:k,onToggleLazy:_,onAddVariant:j,onDetach:o,onAddSection:w,canAddSection:i}=m,K=i===void 0?!0:i;let E;e[0]!==u.length?(E=()=>En(u.length),e[0]=u.length,e[1]=E):E=e[1];const[M,d]=N.useState(E),[P,ae]=N.useState(null),[T,pe]=N.useState(r),[V,ce]=N.useState(u.length),F=N.useRef(!1);T!==r?(pe(r),ce(u.length),d(En(u.length))):V!==u.length&&(ce(u.length),d(I=>Fr(I,u.length)));let te;e[2]===Symbol.for("react.memo_cache_sentinel")?(te={activationConstraint:{distance:8}},e[2]=te):te=e[2];let oe;e[3]===Symbol.for("react.memo_cache_sentinel")?(oe={coordinateGetter:qn},e[3]=oe):oe=e[3];const Te=In(zt(Hn,te),zt(zn,oe));let O;e[4]!==M?(O=M.map(Jr),e[4]=M,e[5]=O):O=e[5];const ue=O;let ie;e[6]===Symbol.for("react.memo_cache_sentinel")?(ie=I=>{ae(String(I.active.id))},e[6]=ie):ie=e[6];const je=ie;let $;e[7]!==ue||e[8]!==v?($=I=>{ae(null);const{active:re,over:Q}=I;if(!Q||re.id===Q.id)return;const Ie=ue.indexOf(String(re.id)),he=ue.indexOf(String(Q.id));Ie===-1||he===-1||(d(Qe=>ua(Rt([...Qe],Ie,he))),F.current=!0,requestAnimationFrame(()=>{F.current=!1}),v?.(Ie,he))},e[7]=ue,e[8]=v,e[9]=$):$=e[9];const Ae=$;let Z;e[10]===Symbol.for("react.memo_cache_sentinel")?(Z=()=>{ae(null)},e[10]=Z):Z=e[10];const De=Z;let ve,se,q,J,ne,le,ke,Se,de,ye,B,X,we,Ke,$e;if(e[11]!==P||e[12]!==K||e[13]!==M||e[14]!==ue||e[15]!==Ae||e[16]!==g||e[17]!==w||e[18]!==j||e[19]!==h||e[20]!==o||e[21]!==x||e[22]!==D||e[23]!==f||e[24]!==k||e[25]!==_||e[26]!==c||e[27]!==u||e[28]!==S||e[29]!==Te){Ke=Symbol.for("react.early_return_sentinel");e:{const I=re=>{F.current||f(re)};if(e[45]!==P||e[46]!==K||e[47]!==M||e[48]!==w||e[49]!==c||e[50]!==u){const re=P?M.find(Q=>Q.id===P):null;if(J=re!=null?u[re.index]:null,q=re!=null?c[re.index]:void 0,M.length===0){let Q;e[54]===Symbol.for("react.memo_cache_sentinel")?(Q=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:"No sections in this page."}),e[54]=Q):Q=e[54];const Ie=!K;let he;e[55]===Symbol.for("react.memo_cache_sentinel")?(he=n.jsx(un,{size:14}),e[55]=he):he=e[55];let Qe;e[56]!==w||e[57]!==Ie?(Qe=n.jsxs("div",{className:"space-y-2",children:[Q,n.jsxs(Ge,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Ie,onClick:w,children:[he,"Add section"]})]}),e[56]=w,e[57]=Ie,e[58]=Qe):Qe=e[58],Ke=Qe;break e}we=Ee(re&&"cursor-grabbing"),e[45]=P,e[46]=K,e[47]=M,e[48]=w,e[49]=c,e[50]=u,e[51]=q,e[52]=J,e[53]=we}else q=e[51],J=e[52],we=e[53];se=Jn,Se=Te,de=Yn,ye=je,B=Ae,X=De,ve=Qn,le=ue,ke=Zn,$e="space-y-1",ne=M.map(re=>{const Q=u[re.index];return Q?n.jsx(Ir,{sortableId:re.id,section:Q,raw:c[re.index],meta:g,selected:S===re.index,onSelect:()=>I(re.index),onDelete:()=>h(re.index),onDuplicate:()=>x(re.index),onMakeReusable:()=>D(re.index),onToggleHidden:()=>k(re.index),onToggleLazy:()=>_(re.index),onAddVariant:()=>j(re.index),onDetach:()=>o(re.index)},re.id):null})}e[11]=P,e[12]=K,e[13]=M,e[14]=ue,e[15]=Ae,e[16]=g,e[17]=w,e[18]=j,e[19]=h,e[20]=o,e[21]=x,e[22]=D,e[23]=f,e[24]=k,e[25]=_,e[26]=c,e[27]=u,e[28]=S,e[29]=Te,e[30]=ve,e[31]=se,e[32]=q,e[33]=J,e[34]=ne,e[35]=le,e[36]=ke,e[37]=Se,e[38]=de,e[39]=ye,e[40]=B,e[41]=X,e[42]=we,e[43]=Ke,e[44]=$e}else ve=e[30],se=e[31],q=e[32],J=e[33],ne=e[34],le=e[35],ke=e[36],Se=e[37],de=e[38],ye=e[39],B=e[40],X=e[41],we=e[42],Ke=e[43],$e=e[44];if(Ke!==Symbol.for("react.early_return_sentinel"))return Ke;let Le;e[59]!==ne||e[60]!==$e?(Le=n.jsx("div",{className:$e,children:ne}),e[59]=ne,e[60]=$e,e[61]=Le):Le=e[61];let Ce;e[62]!==ve||e[63]!==le||e[64]!==ke||e[65]!==Le?(Ce=n.jsx(ve,{items:le,strategy:ke,children:Le}),e[62]=ve,e[63]=le,e[64]=ke,e[65]=Le,e[66]=Ce):Ce=e[66];let Oe;e[67]!==q||e[68]!==J||e[69]!==g?(Oe=J?n.jsx("div",{className:Ee("cursor-grabbing shadow-lg ring-1 ring-border/60",ma(J,!1)),children:n.jsx(da,{section:J,raw:q,meta:g})}):null,e[67]=q,e[68]=J,e[69]=g,e[70]=Oe):Oe=e[70];let Fe;e[71]!==Oe?(Fe=n.jsx(Xn,{dropAnimation:null,children:Oe}),e[71]=Oe,e[72]=Fe):Fe=e[72];let Me;e[73]!==se||e[74]!==Se||e[75]!==de||e[76]!==ye||e[77]!==B||e[78]!==X||e[79]!==Ce||e[80]!==Fe?(Me=n.jsxs(se,{sensors:Se,collisionDetection:de,onDragStart:ye,onDragEnd:B,onDragCancel:X,children:[Ce,Fe]}),e[73]=se,e[74]=Se,e[75]=de,e[76]=ye,e[77]=B,e[78]=X,e[79]=Ce,e[80]=Fe,e[81]=Me):Me=e[81];const xe=!K;let Re;e[82]===Symbol.for("react.memo_cache_sentinel")?(Re=n.jsx(un,{size:14}),e[82]=Re):Re=e[82];let me;e[83]!==w||e[84]!==xe?(me=n.jsxs(Ge,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:xe,onClick:w,children:[Re,"Add section"]}),e[83]=w,e[84]=xe,e[85]=me):me=e[85];let ee;return e[86]!==we||e[87]!==Me||e[88]!==me?(ee=n.jsxs("div",{className:we,children:[Me,me]}),e[86]=we,e[87]=Me,e[88]=me,e[89]=ee):ee=e[89],ee}function Jr(m){return m.id}function Kn(m){const e=ze.c(38),{open:r,initialName:c,autoLabel:u,isPending:g,onSubmit:S,onOpenChange:f}=m,v=g===void 0?!1:g,[h,x]=N.useState(c),[D,k]=N.useState(r);r!==D&&(k(r),r&&x(c));let _;e[0]!==v||e[1]!==f?(_=oe=>{!oe&&!v&&f(!1)},e[0]=v,e[1]=f,e[2]=_):_=e[2];const j=_;let o;e[3]!==v||e[4]!==h||e[5]!==S?(o=async oe=>{oe.preventDefault(),!v&&await S(h.trim())},e[3]=v,e[4]=h,e[5]=S,e[6]=o):o=e[6];const w=o;let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(pr,{children:"Rename variant"}),e[7]=i):i=e[7];const K=u||"the rule";let E;e[8]!==K?(E=n.jsxs(hr,{children:[i,n.jsxs(gr,{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:K}),"."]})]}),e[8]=K,e[9]=E):E=e[9];let M;e[10]===Symbol.for("react.memo_cache_sentinel")?(M=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[10]=M):M=e[10];let d;e[11]===Symbol.for("react.memo_cache_sentinel")?(d=oe=>x(oe.target.value),e[11]=d):d=e[11];let P;e[12]!==u||e[13]!==v||e[14]!==h?(P=n.jsxs("div",{className:"space-y-1.5 py-4",children:[M,n.jsx(br,{id:"variant-rename-name",value:h,onChange:d,placeholder:u,autoFocus:!0,disabled:v})]}),e[12]=u,e[13]=v,e[14]=h,e[15]=P):P=e[15];let ae;e[16]!==f?(ae=()=>f(!1),e[16]=f,e[17]=ae):ae=e[17];let T;e[18]!==v||e[19]!==ae?(T=n.jsx(Ge,{type:"button",variant:"outline",onClick:ae,disabled:v,children:"Cancel"}),e[18]=v,e[19]=ae,e[20]=T):T=e[20];let pe;e[21]!==v?(pe=v?n.jsxs(n.Fragment,{children:[n.jsx(Fn,{size:14,className:"animate-spin"}),"Saving…"]}):"Save",e[21]=v,e[22]=pe):pe=e[22];let V;e[23]!==v||e[24]!==pe?(V=n.jsx(Ge,{type:"submit",disabled:v,children:pe}),e[23]=v,e[24]=pe,e[25]=V):V=e[25];let ce;e[26]!==T||e[27]!==V?(ce=n.jsxs(vr,{children:[T,V]}),e[26]=T,e[27]=V,e[28]=ce):ce=e[28];let F;e[29]!==w||e[30]!==ce||e[31]!==E||e[32]!==P?(F=n.jsx(Sr,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:w,children:[E,P,ce]})}),e[29]=w,e[30]=ce,e[31]=E,e[32]=P,e[33]=F):F=e[33];let te;return e[34]!==j||e[35]!==r||e[36]!==F?(te=n.jsx(xr,{open:r,onOpenChange:j,children:F}),e[34]=j,e[35]=r,e[36]=F,e[37]=te):te=e[37],te}const Yr="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)]",fa="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.2)]";function pa(m){const e=ze.c(5),{rule:r,matchers:c}=m,u=r?.__resolveType??"";let g;if(e[0]!==c||e[1]!==u){const h=c.find(x=>x.resolveType===u)?.iconName??Rs(u);g=cr(h),e[0]=c,e[1]=u,e[2]=g}else g=e[2];const S=g;if(!S)return null;let f;return e[3]!==S?(f=n.jsx(S,{size:14,className:"shrink-0"}),e[3]=S,e[4]=f):f=e[4],f}function $n(m){return m.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
2
- `)}function ln(m){return m.map((e,r)=>({id:crypto.randomUUID(),index:r,variant:e}))}function Qr(m){return m.map((e,r)=>({...e,index:r}))}function ha(m){const e=ze.c(16),{label:r,effectiveRule:c,matchers:u,canDelete:g,dragging:S,onRename:f,onDuplicate:v,onDelete:h}=m;let x;e[0]!==c||e[1]!==u?(x=n.jsx(pa,{rule:c,matchers:u}),e[0]=c,e[1]=u,e[2]=x):x=e[2];let D;e[3]!==r?(D=n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:r}),e[3]=r,e[4]=D):D=e[4];let k;e[5]!==g||e[6]!==S||e[7]!==r||e[8]!==h||e[9]!==v||e[10]!==f?(k=!S&&n.jsxs(la,{children:[n.jsx(ia,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":`Actions for ${r}`,className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:Xr,onPointerDown:Zr,children:n.jsx(ta,{size:14})})}),n.jsxs(ca,{align:"end",className:"w-36",children:[n.jsxs(it,{onClick:j=>{j.stopPropagation(),f?.()},children:[n.jsx(Mr,{size:14}),"Rename"]}),n.jsxs(it,{onClick:j=>{j.stopPropagation(),v?.()},children:[n.jsx(sa,{size:14}),"Duplicate"]}),n.jsx(wr,{}),n.jsxs(it,{variant:"destructive",disabled:!g,onClick:j=>{j.stopPropagation(),h?.()},children:[n.jsx(oa,{size:14}),"Delete"]})]})]}),e[5]=g,e[6]=S,e[7]=r,e[8]=h,e[9]=v,e[10]=f,e[11]=k):k=e[11];let _;return e[12]!==x||e[13]!==D||e[14]!==k?(_=n.jsxs(n.Fragment,{children:[x,D,k]}),e[12]=x,e[13]=D,e[14]=k,e[15]=_):_=e[15],_}function Zr(m){return m.stopPropagation()}function Xr(m){return m.stopPropagation()}function eo(m){const e=ze.c(33),{entry:r,sortableId:c,isActive:u,canDelete:g,decofile:S,meta:f,matchers:v,onSelect:h,onRename:x,onDuplicate:D,onDelete:k}=m;let _;e[0]!==c?(_={id:c,animateLayoutChanges:to},e[0]=c,e[1]=_):_=e[1];const{attributes:j,listeners:o,setNodeRef:w,transform:i,isDragging:K}=Un(_);let E;e[2]!==i?(E=Gn.Transform.toString(i?{...i,x:0}:null),e[2]=i,e[3]=E):E=e[3];const M=K?0:void 0;let d;e[4]!==E||e[5]!==M?(d={transform:E,opacity:M},e[4]=E,e[5]=M,e[6]=d):d=e[6];const P=d,ae=f??void 0;let T;e[7]!==S||e[8]!==r.variant.rule||e[9]!==ae?(T=Nt(r.variant.rule,S,ae),e[7]=S,e[8]=r.variant.rule,e[9]=ae,e[10]=T):T=e[10];const pe=T;let V;e[11]!==h?(V=O=>{O.target===O.currentTarget&&(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),h())},e[11]=h,e[12]=V):V=e[12];const ce=K?"cursor-grabbing":"cursor-pointer active:cursor-grabbing",F=u?fa:Yr;let te;e[13]!==ce||e[14]!==F?(te=Ee("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors touch-none",ce,F),e[13]=ce,e[14]=F,e[15]=te):te=e[15];let oe;e[16]!==g||e[17]!==pe||e[18]!==r.variant.label||e[19]!==v||e[20]!==k||e[21]!==D||e[22]!==x?(oe=n.jsx(ha,{label:r.variant.label,effectiveRule:pe,matchers:v,canDelete:g,onRename:x,onDuplicate:D,onDelete:k}),e[16]=g,e[17]=pe,e[18]=r.variant.label,e[19]=v,e[20]=k,e[21]=D,e[22]=x,e[23]=oe):oe=e[23];let Te;return e[24]!==j||e[25]!==o||e[26]!==h||e[27]!==w||e[28]!==P||e[29]!==te||e[30]!==oe||e[31]!==V?(Te=n.jsx("div",{ref:w,style:P,...j,...o,onClick:h,onKeyDown:V,className:te,children:oe}),e[24]=j,e[25]=o,e[26]=h,e[27]=w,e[28]=P,e[29]=te,e[30]=oe,e[31]=V,e[32]=Te):Te=e[32],Te}function to(){return!1}function no(m){const e=ze.c(9),{variant:r,decofile:c,meta:u,matchers:g}=m,S=u??void 0;let f;e[0]!==c||e[1]!==S||e[2]!==r.rule?(f=Nt(r.rule,c,S),e[0]=c,e[1]=S,e[2]=r.rule,e[3]=f):f=e[3];const v=f;let h;e[4]===Symbol.for("react.memo_cache_sentinel")?(h=Ee("flex items-center gap-2 rounded-md px-2 py-2.5 shadow-lg ring-1 ring-border/60 cursor-grabbing",fa),e[4]=h):h=e[4];let x;return e[5]!==v||e[6]!==g||e[7]!==r.label?(x=n.jsx("div",{className:h,children:n.jsx(ha,{label:r.label,effectiveRule:v,matchers:g,canDelete:!1,dragging:!0})}),e[5]=v,e[6]=g,e[7]=r.label,e[8]=x):x=e[8],x}function ao(m){const e=ze.c(77),{listKey:r,variants:c,activeIndex:u,decofile:g,meta:S,matchers:f,onSelect:v,onReorder:h,onRename:x,onDuplicate:D,onDelete:k,onAdd:_}=m;let j;e[0]!==c?(j=()=>ln(c),e[0]=c,e[1]=j):j=e[1];const[o,w]=N.useState(j),[i,K]=N.useState(null),[E,M]=N.useState(r),[d,P]=N.useState(c.length);let ae;e[2]!==c?(ae=()=>$n(c),e[2]=c,e[3]=ae):ae=e[3];const[T,pe]=N.useState(ae),V=N.useRef(!1),ce=$n(c);E!==r?(M(r),P(c.length),pe(ce),w(ln(c))):d!==c.length?(P(c.length),pe(ce),w(ln(c))):T!==ce&&(pe(ce),w(Me=>c.map((xe,Re)=>({id:Me[Re]?.id??crypto.randomUUID(),index:Re,variant:xe}))));let F;e[4]===Symbol.for("react.memo_cache_sentinel")?(F={activationConstraint:{distance:8}},e[4]=F):F=e[4];let te;e[5]===Symbol.for("react.memo_cache_sentinel")?(te={coordinateGetter:qn},e[5]=te):te=e[5];const oe=In(zt(Hn,F),zt(zn,te));let Te;e[6]!==o?(Te=o.map(so),e[6]=o,e[7]=Te):Te=e[7];const O=Te,ue=c.length>1;let ie;e[8]!==o?(ie=Me=>{const xe=String(Me.active.id);K(o.find(Re=>Re.id===xe)??null)},e[8]=o,e[9]=ie):ie=e[9];const je=ie;let $;e[10]!==O||e[11]!==h?($=Me=>{K(null);const{active:xe,over:Re}=Me;if(!Re||xe.id===Re.id)return;const me=O.indexOf(String(xe.id)),ee=O.indexOf(String(Re.id));me===-1||ee===-1||(w(I=>Qr(Rt([...I],me,ee))),V.current=!0,requestAnimationFrame(()=>{V.current=!1}),h(me,ee))},e[10]=O,e[11]=h,e[12]=$):$=e[12];const Ae=$;let Z;e[13]===Symbol.for("react.memo_cache_sentinel")?(Z=()=>{K(null)},e[13]=Z):Z=e[13];const De=Z;let ve,se,q,J,ne,le,ke,Se,de,ye,B,X,we;if(e[14]!==u||e[15]!==ue||e[16]!==g||e[17]!==o||e[18]!==O||e[19]!==Ae||e[20]!==je||e[21]!==f||e[22]!==S||e[23]!==_||e[24]!==k||e[25]!==D||e[26]!==x||e[27]!==v||e[28]!==oe){const Me=I=>{V.current||v(I)};B="space-y-1 border-b p-2";let xe;e[42]===Symbol.for("react.memo_cache_sentinel")?(xe=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variants"}),e[42]=xe):xe=e[42];let Re;e[43]===Symbol.for("react.memo_cache_sentinel")?(Re=n.jsx(un,{size:14}),e[43]=Re):Re=e[43];let me;e[44]!==_?(me=n.jsx(ft,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-6",onClick:_,children:Re})}),e[44]=_,e[45]=me):me=e[45];let ee;e[46]===Symbol.for("react.memo_cache_sentinel")?(ee=n.jsx(pt,{children:"Add variant"}),e[46]=ee):ee=e[46],e[47]!==me?(X=n.jsxs("div",{className:"flex items-center justify-between",children:[xe,n.jsxs(mt,{children:[me,ee]})]}),e[47]=me,e[48]=X):X=e[48],se=Jn,le=oe,ke=Yn,Se=je,de=Ae,ye=De,ve=Qn,J=O,ne=Zn,we="space-y-0.5",q=o.map(I=>n.jsx(eo,{sortableId:I.id,entry:I,isActive:I.index===u,canDelete:ue,decofile:g,meta:S,matchers:f,onSelect:()=>Me(I.index),onRename:()=>x(I.index),onDuplicate:()=>D(I.index),onDelete:()=>k(I.index)},I.id)),e[14]=u,e[15]=ue,e[16]=g,e[17]=o,e[18]=O,e[19]=Ae,e[20]=je,e[21]=f,e[22]=S,e[23]=_,e[24]=k,e[25]=D,e[26]=x,e[27]=v,e[28]=oe,e[29]=ve,e[30]=se,e[31]=q,e[32]=J,e[33]=ne,e[34]=le,e[35]=ke,e[36]=Se,e[37]=de,e[38]=ye,e[39]=B,e[40]=X,e[41]=we}else ve=e[29],se=e[30],q=e[31],J=e[32],ne=e[33],le=e[34],ke=e[35],Se=e[36],de=e[37],ye=e[38],B=e[39],X=e[40],we=e[41];let Ke;e[49]!==q||e[50]!==we?(Ke=n.jsx("div",{className:we,children:q}),e[49]=q,e[50]=we,e[51]=Ke):Ke=e[51];let $e;e[52]!==ve||e[53]!==J||e[54]!==ne||e[55]!==Ke?($e=n.jsx(ve,{items:J,strategy:ne,children:Ke}),e[52]=ve,e[53]=J,e[54]=ne,e[55]=Ke,e[56]=$e):$e=e[56];let Le;e[57]!==i||e[58]!==g||e[59]!==f||e[60]!==S?(Le=i?n.jsx(no,{variant:i.variant,decofile:g,meta:S,matchers:f}):null,e[57]=i,e[58]=g,e[59]=f,e[60]=S,e[61]=Le):Le=e[61];let Ce;e[62]!==Le?(Ce=n.jsx(Xn,{dropAnimation:null,children:Le}),e[62]=Le,e[63]=Ce):Ce=e[63];let Oe;e[64]!==se||e[65]!==le||e[66]!==ke||e[67]!==Se||e[68]!==de||e[69]!==ye||e[70]!==$e||e[71]!==Ce?(Oe=n.jsxs(se,{sensors:le,collisionDetection:ke,onDragStart:Se,onDragEnd:de,onDragCancel:ye,children:[$e,Ce]}),e[64]=se,e[65]=le,e[66]=ke,e[67]=Se,e[68]=de,e[69]=ye,e[70]=$e,e[71]=Ce,e[72]=Oe):Oe=e[72];let Fe;return e[73]!==B||e[74]!==X||e[75]!==Oe?(Fe=n.jsxs("div",{className:B,children:[X,Oe]}),e[73]=B,e[74]=X,e[75]=Oe,e[76]=Fe):Fe=e[76],Fe}function so(m){return m.id}function ro(m){const e=ze.c(15),{schema:r,value:c,onChange:u,meta:g,decofile:S,onSaveReferencedBlock:f,sandbox:v}=m;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=[],e[0]=h):h=e[0];const[x,D]=N.useState(h);let k;e[1]!==x?(k=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(na,{className:"size-3.5"})}),x.map((o,w)=>{const i=w===x.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[w>0&&n.jsx(aa,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>D(x.slice(0,w+1)),title:o,className:Ee("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",i?"font-medium text-foreground":"text-muted-foreground"),children:o})]},`${o}-${w}`)})]}),e[1]=x,e[2]=k):k=e[2];let _;e[3]!==x||e[4]!==S||e[5]!==g||e[6]!==u||e[7]!==f||e[8]!==v||e[9]!==r||e[10]!==c?(_=n.jsx(ea,{schema:r,value:c,onChange:u,basePath:"",breadcrumbPath:x,onBreadcrumbChange:D,meta:g,decofile:S,onSaveReferencedBlock:f,sandbox:v}),e[3]=x,e[4]=S,e[5]=g,e[6]=u,e[7]=f,e[8]=v,e[9]=r,e[10]=c,e[11]=_):_=e[11];let j;return e[12]!==k||e[13]!==_?(j=n.jsxs("div",{className:"space-y-2",children:[k,_]}),e[12]=k,e[13]=_,e[14]=j):j=e[14],j}function On(m){const e=ze.c(21),{activeSchema:r,formValue:c,formResetKey:u,onFormChange:g,onBreadcrumbChange:S,breadcrumbPath:f,emptyMessage:v,beforeForm:h,seoResolveType:x,siteDefaultSeo:D,meta:k,decofile:_,onSaveReferencedBlock:j,sandbox:o}=m;let w;e[0]!==f?(w=f===void 0?[]:f,e[0]=f,e[1]=w):w=e[1];const i=w;let K;e[2]!==r||e[3]!==i||e[4]!==_||e[5]!==u||e[6]!==c||e[7]!==k||e[8]!==S||e[9]!==g||e[10]!==j||e[11]!==o||e[12]!==x||e[13]!==D?(K=r&&c?x?n.jsx(Rr,{schema:r,resolveType:x,value:c,formResetKey:u,onChange:g,onBreadcrumbChange:S,siteDefaultSeo:D}):n.jsx(ea,{schema:r,value:c,onChange:g,basePath:"",breadcrumbPath:i,onBreadcrumbChange:S,meta:k,decofile:_,onSaveReferencedBlock:j,sandbox:o},u):null,e[2]=r,e[3]=i,e[4]=_,e[5]=u,e[6]=c,e[7]=k,e[8]=S,e[9]=g,e[10]=j,e[11]=o,e[12]=x,e[13]=D,e[14]=K):K=e[14];const E=K;let M;e[15]!==v||e[16]!==E?(M=E??n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:v}),e[15]=v,e[16]=E,e[17]=M):M=e[17];let d;return e[18]!==h||e[19]!==M?(d=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:[h,M]})}),e[18]=h,e[19]=M,e[20]=d):d=e[20],d}const oo="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 io(m,e){return Ns(m,e,tt)}function lo(m){const e=ze.c(13),{pageKey:r,initialName:c,initialPath:u,onFieldChange:g}=m,[S,f]=N.useState(c),[v,h]=N.useState(u),[x,D]=N.useState(r);x!==r&&(D(r),f(c),h(u));let k;e[0]!==g?(k=i=>{f(i.target.value),g("name",i.target.value)},e[0]=g,e[1]=k):k=e[1];let _;e[2]!==S||e[3]!==k?(_=n.jsx("input",{type:"text",value:S,onChange:k,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]=S,e[3]=k,e[4]=_):_=e[4];let j;e[5]!==g?(j=i=>{h(i.target.value),g("path",i.target.value)},e[5]=g,e[6]=j):j=e[6];let o;e[7]!==v||e[8]!==j?(o=n.jsx("input",{type:"text",value:v,onChange:j,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]=v,e[8]=j,e[9]=o):o=e[9];let w;return e[10]!==_||e[11]!==o?(w=n.jsxs("div",{className:"space-y-1",children:[_,o]}),e[10]=_,e[11]=o,e[12]=w):w=e[12],w}function Bn(m){const e=ze.c(6),{onClick:r}=m;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(ra,{size:14}),e[0]=c):c=e[0];let u;e[1]!==r?(u=n.jsx(ft,{asChild:!0,children:n.jsx(Ge,{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]=u):u=e[2];let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(pt,{side:"bottom",children:"Add variant"}),e[3]=g):g=e[3];let S;return e[4]!==u?(S=n.jsxs(mt,{children:[u,g]}),e[4]=u,e[5]=S):S=e[5],S}function Ln(m){const e=ze.c(21),{currentRt:r,currentLabel:c,currentGlobalKey:u,matchers:g,globals:S,onSelect:f,onSelectGlobal:v,schema:h,formValue:x,onChange:D,formKey:k,formWrapperClassName:_,meta:j,decofile:o,onSaveReferencedBlock:w,sandbox:i}=m;let K;e[0]!==u||e[1]!==c||e[2]!==r||e[3]!==S||e[4]!==g||e[5]!==f||e[6]!==v?(K=n.jsx(Ds,{currentRt:r,currentLabel:c,currentGlobalKey:u,matchers:g,globals:S,onSelect:f,onSelectGlobal:v}),e[0]=u,e[1]=c,e[2]=r,e[3]=S,e[4]=g,e[5]=f,e[6]=v,e[7]=K):K=e[7];let E;e[8]!==o||e[9]!==k||e[10]!==x||e[11]!==_||e[12]!==j||e[13]!==D||e[14]!==w||e[15]!==i||e[16]!==h?(E=h&&x&&n.jsx("div",{className:_,children:n.jsx(ro,{schema:h,value:x,onChange:D,meta:j,decofile:o,onSaveReferencedBlock:w,sandbox:i},k)}),e[8]=o,e[9]=k,e[10]=x,e[11]=_,e[12]=j,e[13]=D,e[14]=w,e[15]=i,e[16]=h,e[17]=E):E=e[17];let M;return e[18]!==K||e[19]!==E?(M=n.jsxs(n.Fragment,{children:[K,E]}),e[18]=K,e[19]=E,e[20]=M):M=e[20],M}function ac({orgSlug:m,virtualMcpId:e,branch:r,previewReady:c=!0,previewUrl:u,currentPath:g,activePageBlockKey:S=null,activeGlobalBlockKey:f=null,externalSelectedIndex:v,onSaved:h,initialEditSeo:x=!1,onExitSeo:D,onViewJsonFile:k,onVariantPreviewOverride:_}){const j=c?{orgSlug:m,virtualMcpId:e,branch:r,previewUrl:u}:null,{data:o,isLoading:w}=Vs(j),{data:i,isLoading:K}=Cs(j),E=Ps(),M=E?.entity?.id===e?E.entity.metadata?.siteSlug??null:null,[d,P]=N.useState(null),[ae,T]=N.useState(null),[pe,V]=N.useState(null),[ce,F]=N.useState(0),[te,oe]=N.useState(void 0),[Te,O]=N.useState(null),[ue,ie]=N.useState(null),[je,$]=N.useState([]),[Ae,Z]=N.useState(0),[De,ve]=N.useState(null),[se,q]=N.useState(null),[J,ne]=N.useState(null),[le,ke]=N.useState(!0),[Se,de]=N.useState(!1),[ye,B]=N.useState(!1),[X,we]=N.useState(x),[Ke,$e]=N.useState(x);x&&!Ke&&($e(!0),we(!0),P(null),T(null),V(null),$([])),!x&&Ke&&$e(!1);const[Le,Ce]=N.useState(null),[Oe,Fe]=N.useState(void 0),[Me,xe]=N.useState([]),[Re,me]=N.useState(0),[ee,I]=N.useState(0),[re,Q]=N.useState(null),[Ie,he]=N.useState(null),[Qe,dn]=N.useState(null),ga=vs(),va=`${m}/${e}/${r}`,Ht=Ts({orgSlug:m,virtualMcpId:e,branch:r}),[Sa,xa]=N.useState(g),[ba,ya]=N.useState(S),[_a,ja]=N.useState(f);(Sa!==g||ba!==S||_a!==f)&&(queueMicrotask(()=>Ht.flush()),xa(g),ya(S),ja(f),P(null),T(null),V(null),F(0),O(null),ie(null),I(0),Q(null),he(null),$([]),Z(t=>t+1),we(!1),Ce(null),Fe(void 0),xe([]),me(t=>t+1));const be=As({orgSlug:m,virtualMcpId:e,branch:r}),Dt=Zs((t,a)=>{be.mutate({blockKey:t,data:a},{onSuccess:()=>h?.(),onError:s=>G.error(`Save failed: ${s.message}`)})}),Wt=Ms({orgSlug:m,virtualMcpId:e,branch:r}),[yt,Vt]=N.useState(!1),Ut=N.useRef(null),ht=N.useRef(null),gt=N.useRef(null),Gt=N.useRef({}),qe=N.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!c||w||K)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(Fn,{size:20,className:"animate-spin text-muted-foreground"})});if(!o||!i)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 ka=Es(o),_e=!!f,He=_e?null:Ks(ka,g,S),R=_e?f:He?.key??null,qt=_e&&f?o[f]:void 0,mn=_e&&f&&qt?$s(f,qt):_e&&f?f:"",Ct=!_e&&R&&o[R]?o[R]:null,Jt=X&&o&&i&&R&&He?Mn(o,{kind:"page",pageKey:R,pageName:String(He.name??""),path:String(He.path??"")},i):null,wa=X?Ct?.seo:void 0,Yt=Oe!==void 0?Oe:wa,Ra=X?Nr(Yt):void 0,Na=Jt?.seoTypeOptions??[],Da=X&&i?Dr(i):"",fn=Le??Ra??{},Qt=X&&Jt?Vr(fn,Jt):null,Va=X&&Qt&&Cr(Yt)?Ot(Qt,i):null,Ca=X?Pr(o,i)?.seoData:void 0,Be=_e?[{label:"Default",sections:[{__resolveType:f}]}]:io(Ct?.sections,o??{}),Pt=Be.length>1,Ve=Math.min(ce,Be.length-1),nt=Be[Ve],H=nt?.sections??[],Pe=Bt(H,o),pn=!_e&&Os(Ct?.sections);if(_e&&f&&Qe!==f){dn(f);const t=H[0],a=Pe[0];if(t&&a){P(0),I(0),$([]);const s=ut(t,a,o);s&&(T(s.data),V(s.resolveType),he(null),Q(null))}}!_e&&Qe!==null&&dn(null),qe.current={rawSections:H,parsedSections:Pe,decofile:o??{},activePageKey:R,pageVariants:Be,variantIndex:Ve,sectionVariantIndex:ee,selectedSectionIndex:d};const Pa=()=>({multivariate:pn,index:Ve,variants:Be.map(t=>({rule:t.rule}))}),hn=(t,a)=>{if(!_)return;if(!R||!pn||t.length<=1){_(null);return}const s=Tn(R,{multivariate:!0,index:a,variants:t},o,i);_(s.length>0?s:null)},vt=(t,a,s)=>{if(!_)return;if(!R){_(null);return}const l=Pa(),p=Tn(R,l,o,i);if(!t||a<0){_(p.length>0?p:null);return}const y=ar({pageKey:R,page:l,sectionIndex:a,sectionLazy:Pe[a]?.isLazy??!1,mvObj:t,selectedVariantIndex:s,decofile:o,meta:i}),b=[...p,...y];_(b.length>0?b:null)},at=(t,a,s,l=d??-1,p=!1)=>{const y=Ye(t,a);if(!y){T(null),V(null),he(null),Q(null),p&&vt(null,l,s);return}const C=Dn(y,tt)[s];if(!C){T(null),V(null),he(null),Q(null),p&&vt(null,l,s);return}const Y=Hs(C.value,o);T(Y?.data??null),V(Y?.resolveType??null);const{resolveType:A,formValue:L}=jt(C.rule,o,i??void 0);he(A),Q(L),p&&vt(y,l,s)};if(v!==void 0&&v!==te&&(oe(v??null),typeof v=="number")){const t=H[v],a=Pe[v];if(t&&a)if(P(v),I(0),$([]),Z(s=>s+1),a.isMultivariate)at(t,a,0,v);else{const s=ut(t,a,o);s?(T(s.data),V(s.resolveType)):(T(null),V(null)),he(null),Q(null)}}const Tt={orgSlug:m,virtualMcpId:e,branch:r,previewUrl:u??void 0,siteSlug:M},Zt=pe&&i?Ot(pe,i):null,We=(t,a)=>{if(!R)return;const s=wt(o,R,t,Ve,Be);be.mutate({blockKey:R,data:s},{onSuccess:()=>a?.onSuccess?.()??h?.(),onError:l=>G.error(`Save failed: ${l.message}`)})},St=()=>{P(null),T(null),V(null),I(0),Q(null),he(null),$([]),Z(t=>t+1)},Ta=(t,a)=>{Ut.current&&clearTimeout(Ut.current);const s=qe.current.sectionVariantIndex;Ut.current=setTimeout(()=>{const{rawSections:l,parsedSections:p,decofile:y,activePageKey:b,pageVariants:C,variantIndex:Y}=qe.current,A=l[a];if(!A)return;const L=p[a];if(!L)return;if(L.isSavedBlock){const W=L.isLazy?A.section?.__resolveType??A.__resolveType:A.__resolveType;be.mutate({blockKey:W,data:t},{onSuccess:()=>h?.(),onError:U=>G.error(`Save failed: ${U.message}`)});return}if(!b)return;const z={...y[b]},ge=[...l];if(L.isMultivariate){const W=Ye(A,L);if(!W||!b)return;const U=rr(W,s,t);ge[a]=dt(A,L,U)}else if(L.isHidden){const W=Wn(A.__resolveType),U=W?{...A.section}:{...A},Ne=Array.isArray(U.variants)?[...U.variants]:[];Ne[0]&&(Ne[0]={...Ne[0],value:t}),U.variants=Ne,W?ge[a]={...A,section:U}:ge[a]=U}else L.isLazy?ge[a]={...A,section:t}:ge[a]=t;if(C.length>1){const W=z.sections,U=[...W?.variants??[]];U[Y]&&(U[Y]={...U[Y],value:ge}),z.sections={...W,variants:U}}else z.sections=ge;be.mutate({blockKey:b,data:z},{onSuccess:()=>h?.(),onError:W=>G.error(`Save failed: ${W.message}`)})},on)},Aa=t=>{P(t),I(0),$([]),Z(p=>p+1);const a=H[t],s=Pe[t];if(!a||!s)return;if(s.isMultivariate){at(a,s,0,t);return}const l=ut(a,s,o);if(!l){T(null),V(null),he(null),Q(null),vt(null,t,0);return}T(l.data),V(l.resolveType),he(null),Q(null),vt(null,t,0)},gn=t=>{const a=t;T(a),d!==null&&Ta(a,d)},Xt=t=>{if(!R||!o||!i||!He)return;const a={kind:"page",pageKey:R,pageName:String(He.name??""),path:String(He.path??"")},s=Mn(o,a,i);s&&Ht.save(R,()=>{const l=ga.getQueryData(Ss.decofile(va))?.[R];if(!l||typeof l!="object"||l===null||Array.isArray(l))return null;const p={...l,...Gt.current};return Gt.current={},t?.raw!==void 0?{...p,seo:t.raw}:t?.inner!==void 0?Ar(a,s,p,t.inner):p})},Ma=(t,a)=>{R&&(Gt.current[t]=a,Xt())},Ea=(t,a)=>{if(!R)return;const s=Rt([...H],t,a);d!==null&&(d===t?P(a):t<d&&a>=d?P(d-1):t>d&&a<=d&&P(d+1)),We(s)},Ka=t=>{if(!R)return;const a=H.filter((s,l)=>l!==t);d===t?St():d!==null&&d>t&&P(d-1),We(a)},$a=t=>{if(!R)return;const a=H[t];if(!a)return;const s=[...H];s.splice(t+1,0,nr(a)),d!==null&&d>t&&P(d+1),We(s)},Oa=t=>{if(!R)return;const a=H[t],s=Pe[t];if(!a||!s||s.isMultivariate)return;const l=s.isHidden?er(a):tr(a);if(!l)return;const p=[...H];p[t]=l,d===t&&St(),We(p)},Ba=t=>{if(!R)return;const a=H[t],s=Pe[t];if(!a||!s||s.isMultivariate)return;const l=Xs(a);if(!l)return;const p=[...H];p[t]=l,d===t&&St(),We(p)},La=t=>{if(!R)return;const a=H[t],s=Pe[t];if(!a||!s?.isSavedBlock)return;const l=ut(a,s,o);if(!l?.data)return;const{name:p,...y}=l.data,b=[...H];s.isLazy?b[t]={...a,section:y}:b[t]=y,d===t&&St(),We(b)},Fa=t=>{if(!R)return;const a=[...H,{__resolveType:t.resolveType}],s=a.length-1;We(a,{onSuccess:()=>{de(!1),P(s),I(0),$([]),Z(b=>b+1);const l=a[s],p=Bt(a,o)[s];if(!l||!p)return;if(p.isMultivariate){at(l,p,0);return}const y=ut(l,p,o);if(!y){T(null),V(null),he(null),Q(null);return}T(y.data),V(y.resolveType),he(null),Q(null)}})},Ia=t=>{if(d===null)return;const a=H[d],s=Pe[d];!a||!s?.isMultivariate||(I(t),$([]),Z(l=>l+1),at(a,s,t,d,!0))},za=t=>{if(d===null||!R)return;const a=H[d],s=Pe[d];if(!a||!s?.isMultivariate)return;const l=Ye(a,s);if(!l)return;const p=Ys(l,t);if(!p){G.error("Cannot delete the only variant.");return}const y=[...H];y[d]=dt(a,s,p);const b=p.variants;let C=ee;t===ee?C=Math.min(t,b.length-1):t<ee&&(C=ee-1),I(C),$([]),Z(Y=>Y+1),at(y[d],s,C),We(y)},Ha=t=>{if(d===null||!R)return;const a=H[d],s=Pe[d];if(!a||!s?.isMultivariate)return;const l=Ye(a,s);if(!l)return;const p=Qs(l,t),y=[...H];y[d]=dt(a,s,p);const b=t+1;I(b),$([]),Z(C=>C+1),at(y[d],s,b),We(y)},Wa=(t,a)=>{if(d===null||!R||t===a)return;const s=H[d],l=Pe[d];if(!s||!l?.isMultivariate)return;const p=Ye(s,l);if(!p)return;const y=qs(p,t,a),b=[...H];b[d]=dt(s,l,y);let C=ee;ee===t?C=a:t<ee&&a>=ee?C=ee-1:t>ee&&a<=ee&&(C=ee+1),I(C),at(b[d],l,C),We(b)},en=t=>{const a=t??d;if(a===null||!R)return;const s=H[a],l=Pe[a];if(!s||!l)return;const p=Ws(s,l);if(!p){G.error("This section cannot have variants.");return}const y=[...H];y[a]=p.section;const b=Bt(y,o)[a];if(!b?.isMultivariate){G.error("Could not add variant.");return}P(a),I(p.newVariantIndex),$([]),Z(C=>C+1),at(p.section,b,p.newVariantIndex,a),We(y)},Ua=()=>{if(d===null||!R)return;const t=H[d],a=Pe[d];if(!t||!a?.isMultivariate)return;const s=Ye(t,a);if(!s)return;const l=Js(t,a,s);if(!l){G.error("Could not remove variants.");return}const p=[...H];p[d]=l;const y=Bt(p,o)[d];if(!y)return;I(0),he(null),Q(null),$([]),Z(C=>C+1);const b=ut(l,y,o);b?(T(b.data),V(b.resolveType)):(T(null),V(null)),vt(null,d,0),We(p)},Ga=async t=>{if(De===null||!R)return;const a=rn(t,o);if(a){G.error(a);return}const s=H[De],l=Pe[De];if(!s||!l)return;const p=ut(s,l,o);if(!p){G.error("This section cannot be saved as global.");return}const y={...p.data,name:t};try{await be.mutateAsync({blockKey:t,data:y});const b=[...H];b[De]={__resolveType:t},await be.mutateAsync({blockKey:R,data:wt(o,R,b,Ve,Be)}),d===De&&St(),ve(null),G.success(`Saved global block "${t}"`),h?.()}catch(b){G.error(b instanceof Error?b.message:"Failed to save global block")}},vn=nt?.rule;if(Pt&&d===null&&ue===null&&vn){const{resolveType:t,formValue:a}=jt(vn,o??{},i??void 0);ie(t),O(a)}const At=i?Bs(i):[],Sn=i&&o?Ls(i,o):[],qa=!_e&&!!(u&&i&&o),Ja=ue&&i?Ot(ue,i):null,Mt=()=>{ht.current&&(clearTimeout(ht.current),ht.current=null),gt.current&&(clearTimeout(gt.current),gt.current=null)},_t=async(t,a)=>{if(!(sr(a,t,i)>0))try{await Wt.mutateAsync({blockKey:t})}catch(s){G.error(s instanceof Error?s.message:"Could not delete matcher block")}},xn=t=>{ht.current&&clearTimeout(ht.current),ht.current=setTimeout(()=>{const{activePageKey:a,decofile:s,variantIndex:l}=qe.current;if(!a)return;const p={...s[a]},y={...p.sections},b=[...y.variants??[]],C=b[l],Y=C?.rule;if(xt(Y,s,i)){const A=Y?.__resolveType??"",L=s[A],z=typeof L?.name=="string"?L.name:A,{__resolveType:ge,...W}=t;be.mutate({blockKey:A,data:bt(ge??"",W,z)},{onSuccess:()=>h?.(),onError:U=>G.error(`Save failed: ${U.message}`)});return}C&&(b[l]={...C,rule:t}),p.sections={...y,variants:b},be.mutate({blockKey:a,data:p},{onSuccess:()=>h?.(),onError:A=>G.error(`Save failed: ${A.message}`)})},on)},Ya=t=>{ie(t);const a=t?{__resolveType:t}:{__resolveType:An};O({}),xn(a)},Qa=t=>{const a=t;O(a);const s=ue?{__resolveType:ue,...a}:{...a};xn(s)},Za=async t=>{Mt();const{activePageKey:a,decofile:s,variantIndex:l}=qe.current;if(!a)return;const p=s[a],y=p?.sections;if(!y||typeof y!="object"||Array.isArray(y))return;const b=y;if(!Array.isArray(b.variants))return;const C=[...b.variants],Y=C[l];if(!Y)return;const A=kt(Y.rule,s,i),L=Ft(t);C[l]={...Y,rule:L};const z={...s,[a]:{...p,sections:{...b,variants:C}}},{resolveType:ge,formValue:W}=jt(L,z,i??void 0);ie(ge),O(W);try{await be.mutateAsync({blockKey:a,data:z[a]}),A&&A!==t&&await _t(A,z),h?.()}catch(U){G.error(U instanceof Error?U.message:"Could not apply saved rule")}},bn=t=>{gt.current&&clearTimeout(gt.current);const{selectedSectionIndex:a,sectionVariantIndex:s}=qe.current;a!==null&&(gt.current=setTimeout(()=>{const{rawSections:l,parsedSections:p,decofile:y,activePageKey:b,pageVariants:C,variantIndex:Y}=qe.current;if(!b)return;const A=l[a],L=p[a];if(!A||!L?.isMultivariate)return;const z=Ye(A,L);if(!z)return;const W=(z.variants??[])[s]?.rule;if(xt(W,y,i)){const fe=W?.__resolveType??"",Ue=y[fe],Xe=typeof Ue?.name=="string"?Ue.name:fe,{__resolveType:rt,...et}=t;be.mutate({blockKey:fe,data:bt(rt??"",et,Xe)},{onSuccess:()=>h?.(),onError:ot=>G.error(`Save failed: ${ot.message}`)});return}const U=Vn(z,s,t),Ne=[...l];Ne[a]=dt(A,L,U);const Je=wt(y,b,Ne,Y,C);be.mutate({blockKey:b,data:Je},{onSuccess:()=>h?.(),onError:fe=>G.error(`Save failed: ${fe.message}`)})},on))},Xa=t=>{he(t),Q({}),bn(t?{__resolveType:t}:{__resolveType:An})},es=t=>{const a=t;Q(a);const s=Ie?{__resolveType:Ie,...a}:{...a};bn(s)},ts=async t=>{Mt();const{selectedSectionIndex:a,sectionVariantIndex:s,rawSections:l,parsedSections:p,decofile:y,activePageKey:b,pageVariants:C,variantIndex:Y}=qe.current;if(a===null||!b)return;const A=l[a],L=p[a];if(!A||!L?.isMultivariate)return;const z=Ye(A,L);if(!z)return;const ge=z.variants??[],W=kt(ge[s]?.rule,y,i),U=Ft(t),Ne=Vn(z,s,U),Je=[...l];Je[a]=dt(A,L,Ne);const fe=wt(y,b,Je,Y,C),Ue={...y,[b]:fe},{resolveType:Xe,formValue:rt}=jt(U,Ue,i??void 0);he(Xe),Q(rt);try{await be.mutateAsync({blockKey:b,data:fe}),W&&W!==t&&await _t(W,Ue),h?.()}catch(et){G.error(et instanceof Error?et.message:"Could not apply saved rule")}};if(!_e&&!He)return n.jsxs("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:["No page found for ",g]});if(_e&&!qt)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 st=d!==null?Pe[d]??null:null,yn=d!==null?H[d]:null,_n=yn&&st?.isMultivariate?Ye(yn,st):null,lt=_n?Dn(_n,tt):[],tn=Math.min(ee,Math.max(lt.length-1,0)),Et=lt[tn]??null,ct=st?.isMultivariate===!0,jn=d!==null&&st!==null,Kt=jn&&(ct||!!(Zt&&ae)),ns=Kt&&!_e&&st?.isSavedBlock===!0,Ze=_e||ns,as=_e?mn:st?.label??"",ss=Ie&&i?Ot(Ie,i):null,nn=Kt&&(!_e||je.length>0)?_e?[mn,...je]:[He.name,st.label,...ct&&Et?[Et.label]:[],...je]:[],rs=X&&He?[He.name,"SEO",...Me]:[],$t=X?rs:Ze?nn.length>0?nn:[as]:nn,kn=()=>{if(!R)return;const t=o[R],a=Us(t.sections,H);if(!a)return;const s=Gs(a);be.mutate({blockKey:R,data:{...t,sections:a}},{onSuccess:()=>{F(s),P(null),T(null),V(null),$([]),O(null),ie(null)},onError:l=>G.error(`Save failed: ${l.message}`)})},an=(t,a,s)=>{if(!R)return;const l=o[R],p=l.sections;if(!p||typeof p!="object"||Array.isArray(p))return;const y=p;if(!Array.isArray(y.variants))return;const b=t([...y.variants]);if(!b)return;const C=or(y,b),Y={...o,[R]:{...l,sections:C}};be.mutate({blockKey:R,data:Y[R]},{onSuccess:()=>{a?.(),s&&_t(s,Y)},onError:A=>G.error(`Save failed: ${A.message}`)})},os=t=>{q(null),F(t),P(null),T(null),V(null),$([]);const a=Be[t]?.rule,{resolveType:s,formValue:l}=jt(a,o??{},i??void 0);ie(s),O(l),hn(Be.map(p=>({rule:p.rule})),t)},is=(t,a)=>{if(t===a)return;let s=Ve;Ve===t?s=a:t<Ve&&a>=Ve?s=Ve-1:t>Ve&&a<=Ve&&(s=Ve+1),F(s);const l=Rt(Be.map(p=>({rule:p.rule})),t,a);hn(l,s),an(p=>Rt(p,t,a))},ls=t=>{const a=Be[t]?.rule,s=kt(a,o??{},i??void 0);an(l=>l.length<=1?null:(l.splice(t,1),l),()=>{Be.length-1===1?F(0):t<Ve?F(Ve-1):t===Ve&&F(Math.max(0,t-1)),P(null),T(null),V(null),$([]),O(null),ie(null)},s)},cs=t=>{an(a=>ir(a,t),()=>{F(t+1),P(null),T(null),V(null),$([]),O(null),ie(null)})},us=async(t,a)=>{Mt();const s=qe.current.activePageKey,l=qe.current.decofile;if(!s)return;const p=l[s],y=p.sections;if(!y||typeof y!="object"||Array.isArray(y))return;const b=y;if(!Array.isArray(b.variants))return;const C=[...b.variants],Y=C[t];if(!Y?.rule||typeof Y.rule!="object"){G.error("This variant has no matcher rule to rename.");return}const A=Y.rule,L=a.trim();Vt(!0);try{if(!L){if(!xt(A,l,i)){q(null);return}const Je=A.__resolveType??"";C[t]={...Y,rule:Cn(A,l,i)};const fe={...l,[s]:{...p,sections:{...b,variants:C}}};await be.mutateAsync({blockKey:s,data:fe[s]}),await _t(Je,fe),q(null),h?.();return}const z=Pn(A,l,i);if(!z){G.error("Could not read this variant's matcher rule.");return}if(z.blockKey){await be.mutateAsync({blockKey:z.blockKey,data:bt(z.resolveType,z.data,L)}),q(null),h?.();return}const ge=sn(L),W=rn(ge,l);if(W){G.error(W);return}const U=bt(z.resolveType,z.data,L);let Ne=null;try{await be.mutateAsync({blockKey:ge,data:U}),Ne=ge,C[t]={...Y,rule:Ft(ge)},await be.mutateAsync({blockKey:s,data:{...p,sections:{...b,variants:C}}}),Ne=null}catch(Je){throw Ne&&await Wt.mutateAsync({blockKey:Ne}).catch(()=>{}),Je}q(null),G.success(`Saved matcher as global block "${L}"`),h?.()}catch(z){G.error(z instanceof Error?z.message:"Failed to rename variant")}finally{Vt(!1)}},ds=async(t,a)=>{Mt();const{selectedSectionIndex:s,rawSections:l,parsedSections:p,decofile:y,activePageKey:b,pageVariants:C,variantIndex:Y}=qe.current;if(s===null||!b)return;const A=l[s],L=p[s];if(!A||!L?.isMultivariate)return;const z=Ye(A,L);if(!z)return;const ge=z.variants??[],W=ge[t];if(!W?.rule||typeof W.rule!="object"){G.error("This variant has no matcher rule to rename.");return}const U=W.rule,Ne=a.trim();Vt(!0);const Je=async fe=>{const Ue={...z,variants:fe},Xe=[...l];Xe[s]=dt(A,L,Ue);const rt=wt(y,b,Xe,Y,C);return await be.mutateAsync({blockKey:b,data:rt}),{...y,[b]:rt}};try{if(!Ne){if(!xt(U,y,i)){ne(null);return}const ot=U.__resolveType??"",Nn=[...ge];Nn[t]={...W,rule:Cn(U,y,i)};const gs=await Je(Nn);await _t(ot,gs),ne(null),h?.();return}const fe=Pn(U,y,i);if(!fe){G.error("Could not read this variant's matcher rule.");return}if(fe.blockKey){await be.mutateAsync({blockKey:fe.blockKey,data:bt(fe.resolveType,fe.data,Ne)}),ne(null),h?.();return}const Ue=sn(Ne),Xe=rn(Ue,y);if(Xe){G.error(Xe);return}const rt=bt(fe.resolveType,fe.data,Ne);let et=null;try{await be.mutateAsync({blockKey:Ue,data:rt}),et=Ue;const ot=[...ge];ot[t]={...W,rule:Ft(Ue)},await Je(ot),et=null}catch(ot){throw et&&await Wt.mutateAsync({blockKey:et}).catch(()=>{}),ot}ne(null),G.success(`Saved matcher as global block "${Ne}"`),h?.()}catch(fe){G.error(fe instanceof Error?fe.message:"Failed to rename variant")}finally{Vt(!1)}},wn=()=>{St()},ms=t=>{Ce(t),Xt({inner:t})},fs=t=>{Fe(t),Xt({raw:t})},ps=()=>{Ce(null),xe([])},hs=()=>me(t=>t+1),Rn=t=>{if(X){if(t===0){Ht.flush(),we(!1),Ce(null),Fe(void 0),xe([]),me(s=>s+1),D?.();return}if(t===1){xe([]),me(s=>s+1);return}xe(Me.slice(0,t-1)),me(s=>s+1);return}if(_e){$(je.slice(0,t)),Z(s=>s+1);return}if(t===0){wn();return}if(t===1){$([]),Z(s=>s+1);return}if(ct&&t===2){$([]),Z(s=>s+1);return}const a=ct?2:1;$(je.slice(0,t-a))};return n.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[n.jsx("div",{className:"shrink-0",children:Ze||Kt||X?n.jsxs("div",{className:Ee("border-b px-3 py-2.5",Ze&&"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:[$t.length>1&&n.jsx("button",{type:"button",onClick:()=>Rn($t.length-2),title:"Back","aria-label":"Back",className:Ee("shrink-0 inline-flex size-6 items-center justify-center rounded-md transition-colors",Ze?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:n.jsx(na,{className:"size-4"})}),!_e&&Pt&&nt&&n.jsxs("button",{type:"button",onClick:wn,title:`Editing in variant: ${nt.label}`,className:Ee("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",oo),children:[n.jsx(pa,{rule:Nt(nt.rule,o??{},i??void 0),matchers:At}),n.jsx("span",{className:"max-w-[160px] truncate",children:nt.label})]}),n.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:$t.map((t,a)=>{const s=a===$t.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[a>0&&n.jsx(aa,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>Rn(a),title:t,className:Ee("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",s?Ze?"font-semibold text-global-section-fg dark:text-global-section-fg-dark":"font-medium text-foreground":Ze?"text-foreground/80":"text-muted-foreground",Ze?"hover:bg-global-section/15":"hover:bg-accent hover:text-accent-foreground"),children:t})]},`${t}-${a}`)})}),Ze&&n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(fr,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(pt,{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."})]}),jn&&!ct&&!st?.isHidden&&R&&n.jsx(Bn,{onClick:()=>en()})]}),Ze&&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(lo,{pageKey:R,initialName:He.name,initialPath:He.path,onFieldChange:Ma})}),n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":"Edit SEO",className:"size-7 shrink-0",onClick:()=>we(!0),children:n.jsx(ur,{size:14})})}),n.jsx(pt,{side:"bottom",children:"Edit SEO"})]}),n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":"View JSON",className:"size-7 shrink-0",onClick:()=>k&&R?k(R):B(!0),children:n.jsx(dr,{size:14})})}),n.jsx(pt,{side:"bottom",children:"View JSON"})]}),n.jsx(Bn,{onClick:kn})]})}),X?n.jsx(It,{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:Ct&&R?n.jsx(Tr,{rawSeo:Yt,innerSeo:fn,defaultResolveType:Da,seoSchema:Va,activeResolveType:Qt,seoTypeOptions:Na,formResetKey:Re,siteDefaultSeo:Ca,onBreadcrumbChange:xe,onPersistRaw:fs,onInnerChange:ms,onClearForm:ps,onBumpFormKey:hs}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"SEO schema not found for this site."})})})}):Kt?n.jsxs(It,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[ct&&lt.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(Fs,{listKey:`${R??""}:${d??""}`,variants:lt.map((t,a)=>({index:a,label:t.label})),selectedIndex:tn,onSelect:Ia,onRename:ne,onDuplicate:Ha,onDelete:za,onRemoveAll:Ua,onReorder:Wa,onAdd:()=>en()}),ct&&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(Ln,{currentRt:Ie??"",currentLabel:Lt(Et?.rule,o??{},tt,i??void 0),currentGlobalKey:kt(Et?.rule,o??{},i??void 0)??void 0,matchers:At,globals:Sn,onSelect:Xa,onSelectGlobal:ts,schema:ss,formValue:re,onChange:es,formKey:`${d??"none"}:${tn}:${Ie??""}`,formWrapperClassName:"pt-1",meta:i??void 0,decofile:o,onSaveReferencedBlock:Dt,sandbox:Tt})]})]}),n.jsx(On,{activeSchema:Zt,formValue:ae,formResetKey:Ae,onFormChange:gn,onBreadcrumbChange:$,breadcrumbPath:je,emptyMessage:"No editable fields for this variant.",meta:i,decofile:o,onSaveReferencedBlock:Dt,sandbox:Tt})]}):_e?n.jsx(It,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(On,{activeSchema:Zt,formValue:ae,formResetKey:Ae,onFormChange:gn,onBreadcrumbChange:$,breadcrumbPath:je,emptyMessage:"No editable fields for this global block.",meta:i,decofile:o,onSaveReferencedBlock:Dt,sandbox:Tt})}):n.jsxs(It,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[Pt&&R&&n.jsx(ao,{listKey:R,variants:Be,activeIndex:Ve,decofile:o??{},meta:i,matchers:At,onSelect:os,onReorder:is,onRename:q,onDuplicate:cs,onDelete:ls,onAdd:kn}),Pt&&ue!==null&&n.jsxs("div",{className:Ee("px-3 border-b",le?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>ke(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":le,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variant rule"}),le?n.jsx(mr,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(lr,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),le&&n.jsx("div",{className:Ee("space-y-3",yt&&"pointer-events-none opacity-50"),children:n.jsx(Ln,{currentRt:ue,currentLabel:Lt(nt?.rule,o??{},tt,i??void 0),currentGlobalKey:kt(nt?.rule,o??{},i??void 0)??void 0,matchers:At,globals:Sn,onSelect:Ya,onSelectGlobal:Za,schema:Ja,formValue:Te,onChange:Qa,formKey:`${Ve}:${ue??""}`,formWrapperClassName:"space-y-3",meta:i??void 0,decofile:o,onSaveReferencedBlock:Dt,sandbox:Tt})})]}),n.jsx("div",{className:"p-2 pt-3",children:n.jsx(qr,{listKey:`${R??""}-${Ve}`,rawSections:H,sections:Pe,meta:i,selectedIndex:d,onSelect:Aa,onReorder:Ea,onDelete:Ka,onDuplicate:$a,onMakeReusable:ve,onToggleHidden:Oa,onToggleLazy:Ba,onAddVariant:en,onDetach:La,onAddSection:()=>de(!0),canAddSection:qa})})]}),n.jsx(Is,{open:De!==null,onOpenChange:t=>{t||ve(null)},defaultBlockId:De!==null?sn(Pe[De]?.label??""):"",isPending:be.isPending,onSubmit:Ga}),u&&n.jsx(Er,{open:Se,onOpenChange:de,meta:i,decofile:o,previewBaseUrl:u,onSelect:Fa}),ye&&R&&o&&n.jsx(zs,{open:ye,onOpenChange:B,pageKey:R,decofile:o}),se!==null&&n.jsx(Kn,{open:!0,initialName:xt(Be[se]?.rule,o??{},i??void 0)?Lt(Be[se]?.rule,o??{},tt,i??void 0):"",autoLabel:tt(Nt(Be[se]?.rule,o??{},i??void 0)),isPending:yt,onSubmit:async t=>{await us(se,t)},onOpenChange:t=>{!t&&!yt&&q(null)}}),J!==null&&n.jsx(Kn,{open:!0,initialName:xt(lt[J]?.rule,o??{},i??void 0)?Lt(lt[J]?.rule,o??{},tt,i??void 0):"",autoLabel:tt(Nt(lt[J]?.rule,o??{},i??void 0)),isPending:yt,onSubmit:async t=>{await ds(J,t)},onOpenChange:t=>{!t&&!yt&&ne(null)}})]})}export{ac as SectionsEditor};
1
+ import{c as ze,r as N,l as Ee,j as n,B as Ge,i as Fn,n as vs,t as G,K as Ss}from"./index-C8rlFaFO.js";import{a1 as xs,a2 as bs,a3 as ys,H as In,J as zt,K as zn,P as Hn,i as Wn,a4 as _s,V as Un,W as Gn,a5 as js,G as ks,a6 as ws,L as qn,M as Rt,Q as Jn,U as Yn,N as Qn,_ as Xn,a7 as Zn,a8 as Rs,a9 as Nt,aa as Ns,S as ea,ab as tt,ac as Ds,ad as Vs,ae as Cs,af as Ts,e as Ps,k as As,ag as Ms,ah as Es,ai as Ks,aj as $s,r as Ot,ak as Bt,al as Os,am as ut,an as jt,ao as Bs,ap as Ls,aq as Ye,ar as Dn,as as Fs,at as kt,au as Lt,av as Is,aw as sn,ax as zs,ay as xt,az as Hs,aA as Ws,aB as Us,aC as Gs,aD as qs,aE as dt,aF as Js,aG as Ys,aH as Qs,m as Xs,aI as Vn,aJ as wt,aK as Zs,aL as er,aM as tr,aN as nr,aO as rn,aP as Cn,aQ as Tn,aR as bt,aS as Ft,aT as Pn,aU as ar,aV as on,aW as sr,aX as rr,aY as or,aZ as An,a_ as ir}from"./index-B_qFi_-_.js";import{t as lr}from"./ChevronDown-D_W2bIqv.js";import{_ as cn,T as ta,D as cr,x as na,$ as ur,a0 as dr}from"./agent-icon-BIj6WxKp.js";import{i as aa}from"./ChevronRight-BnIvJcIZ.js";import{n as mr}from"./ChevronUp-Ci-XiWb6.js";import{i as fr}from"./Globe01-qjaQZUfN.js";import{m as It}from"./automation-runs-_XAGR1m2.js";import{b as mt,T as ft,a as pt}from"./tooltip-DE_gqCm3.js";import{a as pr,D as hr,h as gr,c as vr,d as Sr,e as xr}from"./dialog-ChJw5xnr.js";import{I as br}from"./input-CWExGH7j.js";import{a as sa}from"./Copy01-Q4xZmPKp.js";import{b as yr}from"./ZoomOut-DAAhtu2Z.js";import{i as _r}from"./Settings02-CU2rilKq.js";import{s as jr}from"./Eye-BuukW7MV.js";import{s as ra}from"./TrendUp01-BmzCTIbp.js";import{s as un}from"./Plus-5VWQJEkS.js";import{s as oa}from"./Trash01-DxXosbkh.js";import{i as kr}from"./Zap-C6tkfs5m.js";import{d as it,a as ia,D as la,c as ca,j as wr}from"./dropdown-menu-B7HOgSu8.js";import{S as Rr,r as Mn,a as Nr,d as Dr,b as Vr,i as Cr,f as Tr,P as Pr,c as Ar}from"./page-seo-form-DeD_2a8R.js";import{b as Mr}from"./Tool01-DBXzU6aR.js";import{A as Er}from"./add-section-modal-De0GxBTc.js";import"./ArrowUp-Dq6JgHsq.js";import"./chat-context-glCfFIWX.js";import"./autosend-D-JHJKNK.js";import"./hooks-CJqrF4BQ.js";import"./use-mcp-client-PcphUWIj.js";import"./auth-Kymy4xkz.js";import"./decopilot-sse-pool-DEJZ4gJu.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-B3FHZXsQ.js";import"./use-virtual-mcp-BtFe5DoR.js";import"./use-collections-u5tkBX1a.js";import"./use-ai-providers-CGzSWtp7.js";import"./location-BpLtHjTZ.js";import"./tab-id-BijBBRwE.js";import"./use-decopilot-events-VInARyiN.js";import"./use-organization-settings-DBhnNnJm.js";import"./drawer-_WfOhyRU.js";import"./collection-search-DuPY-s4R.js";import"./SearchMd-LbMkvaPD.js";import"./use-mobile-C57pT7o9.js";import"./AreaChart-D4PMIsMV.js";import"./index-CHWLrEqX.js";import"./calendar-C9b1I5Xh.js";import"./X-CLG08ht8.js";import"./shell-layout-DvMdeukx.js";import"./avatar-1o2VQKTj.js";import"./User01-CZgThaZQ.js";import"./Users03-3HXi1aia.js";import"./SearchLg-BiyFAMx0.js";import"./Stars02-CdgckoDr.js";import"./XClose-BYq2BBpT.js";import"./CheckCircle-B5oIKeSF.js";import"./FilterLines-Do4UgzmV.js";import"./use-t-BeHordU2.js";import"./required-auth-layout-CR5_YK6W.js";import"./use-org-sso-BaYh30WC.js";import"./index-CWlzI7M3.js";import"./get-initials-D-f_fDFw.js";import"./SwitchHorizontal01-DNcPUv7P.js";import"./use-registry-app-Dyfesgrg.js";import"./use-mcp-tools-CakNulXp.js";import"./use-connection-CcmTBTY-.js";import"./github-repo-scope-DjMZbiKa.js";import"./authenticate-and-persist-oauth-DAAmwSgR.js";import"./mcp-oauth-B2KaqQoI.js";import"./extract-connection-data-oUFnwuwD.js";import"./use-members-JooO5O_z.js";import"./use-org-auth-client-C0qPMRhc.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./AlertCircle-Cvc_10Uv.js";import"./DotsVertical-Bcfqjiks.js";import"./popover-kOy_asOa.js";import"./command-BB6Oir8o.js";import"./index-CR0rMz7E.js";import"./use-copy-CveeH2p4.js";import"./LinkExternal01-CyMOdGfe.js";import"./XCircle-pZ6nD22L.js";import"./companions-core-C-kZqiTC.js";import"./ZapSquare-DdKvM81Z.js";import"./Star01-D4LxiizA.js";import"./Image01-BWotytID.js";import"./Upload01-CXsTipbe.js";import"./form-BUM27CLj.js";import"./label-BbLr7wPS.js";import"./select-4-vdHbLT.js";import"./tabs-C1LpzuaJ.js";import"./Tool02-rl8XhSPG.js";import"./toggle-group-c5TjS6xS.js";import"./use-deco-credits-CV7sw9Em.js";import"./connection-card-7gBTmFox.js";import"./use-registry-connections-CTtHQqlB.js";import"./useInfiniteQuery-mNPfD3Pk.js";import"./use-infinite-scroll-BI8YTyTt.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./card-CoG27DVs.js";import"./integration-icon-BXEpLE2r.js";import"./textarea-B8dhUfp9.js";import"./connection-form-helpers-CJKig9hy.js";import"./collection-tabs-CcN3J070.js";import"./badge-dHBIjKyY.js";import"./useSuspenseInfiniteQuery-DIVSilzv.js";import"./Monitor01-dLHbd0CB.js";import"./connect-desktop-dialog-CUGIAU17.js";import"./select-model-CVcEVUsi.js";import"./checkbox-BOAToSlJ.js";import"./skeleton-DraYvTQP.js";import"./Key01-BPZUhUcV.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-DxqR9iml.js";import"./ArrowUpRight-DgI9ki5h.js";import"./Stars01-HAbkffzq.js";import"./index-CWGwstEz.js";import"./Palette-tVNOj7Ym.js";import"./alert-dialog-D2oa47X8.js";import"./file-type-icon-CeQVzqDu.js";import"./toolbar-Daz4jqLs.js";import"./Package-B7Qii2Tl.js";import"./use-debounced-value-D1xFGN32.js";import"./index-DyXd0E61.js";import"./LayoutLeft-COV7zlIC.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-DJxvpKl9.js";import"./empty-state-kSEyPCAz.js";import"./use-capability-BNcFOggs.js";import"./toolbar-icon-button-Bbbo7hyv.js";import"./Play-BE8nTtBp.js";import"./use-debounced-autosave-DFle-8Sb.js";import"./index-Bj_MaVUP.js";import"./sidebar-AfeWMY1r.js";import"./search-input-B6akQV4Y.js";import"./use-mcp-auth-status-DINFEYgi.js";import"./switch-CyZjNvfZ.js";import"./github-repo-picker-4TIPzYjR.js";import"./use-navigate-to-agent-DVHUkqpb.js";import"./reusable-new-chat-CouMjkYR.js";import"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import"./Users01-IdyAszrF.js";import"./use-secrets-BYzFSfMf.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./monaco-editor-CJKnQM68.js";import"./use-file-configs-BEHJ-b8Q.js";import"./use-automations-Btiu7Z09.js";import"./automation-list-row-D-cT9rxb.js";import"./Globe04-CqIGMVDi.js";import"./HardDrive-DrLvUMYg.js";import"./Sun-Ca3eslhz.js";import"./Shield01-7KT2UKvg.js";import"./table-iG6kCmeS.js";import"./use-clock-tick-Dw7sAB29.js";function Kr(m){return m.schema?.definitions??m.schema?.$defs??{}}function $r(m,e){const r=Kr(e),c=r[btoa(m)];if(!c)return;let u=typeof c.image=="string"?c.image:void 0;if(!u&&Array.isArray(c.allOf)){const g=c.allOf.find(S=>typeof S.$ref=="string")?.$ref;if(typeof g=="string"){const S=g.replace("#/definitions/",""),f=r[S];u=typeof f?.image=="string"?f.image:void 0}}if(u?.includes("{{{"))return u}function Or(m,e){if(!e)return;const r=xs(m);if(!r)return;const c=$r(r.resolveType,e);if(!c)return;const u=bs(c,r.data);if(u)return ys(u)}const Br="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",Lr="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 En(m){return Array.from({length:m},(e,r)=>({id:crypto.randomUUID(),index:r}))}function ua(m){return m.map((e,r)=>({...e,index:r}))}function Fr(m,e){if(e===m.length)return m;if(e<m.length)return ua(m.slice(0,e));const r=Array.from({length:e-m.length},(c,u)=>({id:crypto.randomUUID(),index:m.length+u}));return[...m,...r]}function da(m){const e=ze.c(20),{section:r,raw:c,meta:u}=m,g=r.isSavedBlock===!0,S=r.isMultivariate===!0;let f;e[0]!==u||e[1]!==c?(f=c&&u?Or(c,u):void 0,e[0]=u,e[1]=c,e[2]=f):f=e[2];const v=f;let h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(yr,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[3]=h):h=e[3];let x;e[4]!==v?(x=v&&n.jsx("img",{src:v,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[4]=v,e[5]=x):x=e[5];let D;e[6]!==S||e[7]!==g?(D=g?{color:ks}:S?{color:"oklch(0.65 0.15 160)"}:void 0,e[6]=S,e[7]=g,e[8]=D):D=e[8];let k;e[9]!==D?(k=n.jsx(cn,{className:"h-4 w-4 shrink-0",style:D}),e[9]=D,e[10]=k):k=e[10];const _=r.isHidden&&"line-through opacity-50";let j;e[11]!==_?(j=Ee("min-w-0 flex-1 truncate text-sm font-medium",_),e[11]=_,e[12]=j):j=e[12];let o;e[13]!==r.label||e[14]!==j?(o=n.jsx("span",{className:j,children:r.label}),e[13]=r.label,e[14]=j,e[15]=o):o=e[15];let w;return e[16]!==x||e[17]!==k||e[18]!==o?(w=n.jsxs(n.Fragment,{children:[h,x,k,o]}),e[16]=x,e[17]=k,e[18]=o,e[19]=w):w=e[19],w}function ma(m,e){const r=m.isSavedBlock===!0,c=m.isMultivariate===!0;return Ee("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":r?Br: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 Ir(m){const e=ze.c(64),{section:r,raw:c,meta:u,sortableId:g,selected:S,onSelect:f,onDelete:v,onDuplicate:h,onMakeReusable:x,onToggleHidden:D,onToggleLazy:k,onAddVariant:_,onDetach:j}=m,o=c?Wn(c.__resolveType??""):!1;let w;e[0]!==r?(w=_s(r),e[0]=r,e[1]=w):w=e[1];const i=w;let K;e[2]!==g?(K={id:g,animateLayoutChanges:Gr},e[2]=g,e[3]=K):K=e[3];const{attributes:E,listeners:M,setNodeRef:d,transform:T,isDragging:ae}=Un(K);let P;e[4]!==T?(P=Gn.Transform.toString(T?{...T,x:0}:null),e[4]=T,e[5]=P):P=e[5];const pe=ae?0:void 0;let V;e[6]!==P||e[7]!==pe?(V={transform:P,opacity:pe},e[6]=P,e[7]=pe,e[8]=V):V=e[8];const ce=V;let F;e[9]!==r?(F=js(r),e[9]=r,e[10]=F):F=e[10];const te=F,oe="button",Pe=0;let O;e[11]!==f?(O=B=>{(B.key==="Enter"||B.key===" ")&&(B.preventDefault(),f())},e[11]=f,e[12]=O):O=e[12];const ue=ae?"cursor-grabbing":"cursor-pointer";let ie;e[13]!==r||e[14]!==S||e[15]!==ue?(ie=Ee("touch-none transition-colors",ue,ma(r,S)),e[13]=r,e[14]=S,e[15]=ue,e[16]=ie):ie=e[16];let je;e[17]!==u||e[18]!==c||e[19]!==r?(je=n.jsx(da,{section:r,raw:c,meta:u}),e[17]=u,e[18]=c,e[19]=r,e[20]=je):je=e[20];const $=!r.isMultivariate&&n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":o?"Disable async render":"Enable async render",className:Ee("h-7 w-7 shrink-0",o?"":"opacity-0 group-hover:opacity-100"),onClick:B=>{B.stopPropagation(),k()},onPointerDown:Ur,children:n.jsx(kr,{className:Ee("h-3.5 w-3.5",o&&"text-yellow-500")})})}),n.jsx(pt,{side:"bottom",children:o?"Disable async render":"Enable async render"})]});let Ae;e[21]!==D||e[22]!==r.isHidden||e[23]!==r.isMultivariate?(Ae=!r.isMultivariate&&n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":r.isHidden?"Show section":"Hide section",className:Ee("h-7 w-7 shrink-0",r.isHidden?"opacity-100":"opacity-0 group-hover:opacity-100"),onClick:B=>{B.stopPropagation(),D()},onPointerDown:Wr,children:r.isHidden?n.jsx(_r,{className:"h-3.5 w-3.5"}):n.jsx(jr,{className:"h-3.5 w-3.5"})})}),n.jsx(pt,{side:"bottom",children:r.isHidden?"Show section":"Hide section"})]}),e[21]=D,e[22]=r.isHidden,e[23]=r.isMultivariate,e[24]=Ae):Ae=e[24];let X;e[25]===Symbol.for("react.memo_cache_sentinel")?(X=n.jsx(ia,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":"Section actions",className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100",onClick:Hr,onPointerDown:zr,children:n.jsx(ta,{className:"h-3.5 w-3.5"})})}),e[25]=X):X=e[25];let De;e[26]!==h?(De=B=>{B.stopPropagation(),h()},e[26]=h,e[27]=De):De=e[27];let ve;e[28]===Symbol.for("react.memo_cache_sentinel")?(ve=n.jsx(sa,{className:"h-4 w-4"}),e[28]=ve):ve=e[28];let se;e[29]!==De?(se=n.jsxs(it,{onClick:De,children:[ve,"Duplicate"]}),e[29]=De,e[30]=se):se=e[30];let q;e[31]!==i||e[32]!==_?(q=i&&n.jsxs(it,{className:ws,onClick:B=>{B.stopPropagation(),_()},children:[n.jsx(ra,{className:"h-4 w-4"}),"Add variant"]}),e[31]=i,e[32]=_,e[33]=q):q=e[33];let J;e[34]!==te||e[35]!==x?(J=te&&n.jsxs(it,{className:Lr,onClick:B=>{B.stopPropagation(),x()},children:[n.jsx(cn,{className:"h-4 w-4"}),"Make reusable"]}),e[34]=te,e[35]=x,e[36]=J):J=e[36];let ne;e[37]!==j||e[38]!==r.isMultivariate||e[39]!==r.isSavedBlock?(ne=r.isSavedBlock===!0&&!r.isMultivariate&&n.jsxs(it,{onClick:B=>{B.stopPropagation(),j()},children:[n.jsx(cn,{className:"h-4 w-4"}),"Detach"]}),e[37]=j,e[38]=r.isMultivariate,e[39]=r.isSavedBlock,e[40]=ne):ne=e[40];let le;e[41]!==v?(le=B=>{B.stopPropagation(),v()},e[41]=v,e[42]=le):le=e[42];let ke;e[43]===Symbol.for("react.memo_cache_sentinel")?(ke=n.jsx(oa,{className:"h-4 w-4"}),e[43]=ke):ke=e[43];let Se;e[44]!==le?(Se=n.jsxs(it,{className:"text-destructive focus:text-destructive",onClick:le,children:[ke,"Delete"]}),e[44]=le,e[45]=Se):Se=e[45];let de;e[46]!==se||e[47]!==q||e[48]!==J||e[49]!==ne||e[50]!==Se?(de=n.jsxs(la,{children:[X,n.jsxs(ca,{align:"end",className:"w-44",children:[se,q,J,ne,Se]})]}),e[46]=se,e[47]=q,e[48]=J,e[49]=ne,e[50]=Se,e[51]=de):de=e[51];let ye;return e[52]!==E||e[53]!==M||e[54]!==f||e[55]!==d||e[56]!==ce||e[57]!==ie||e[58]!==je||e[59]!==$||e[60]!==Ae||e[61]!==de||e[62]!==O?(ye=n.jsxs("div",{ref:d,style:ce,...E,...M,role:oe,tabIndex:Pe,onClick:f,onKeyDown:O,className:ie,children:[je,$,Ae,de]}),e[52]=E,e[53]=M,e[54]=f,e[55]=d,e[56]=ce,e[57]=ie,e[58]=je,e[59]=$,e[60]=Ae,e[61]=de,e[62]=O,e[63]=ye):ye=e[63],ye}function zr(m){return m.stopPropagation()}function Hr(m){return m.stopPropagation()}function Wr(m){return m.stopPropagation()}function Ur(m){return m.stopPropagation()}function Gr(){return!1}function qr(m){const e=ze.c(90),{listKey:r,rawSections:c,sections:u,meta:g,selectedIndex:S,onSelect:f,onReorder:v,onDelete:h,onDuplicate:x,onMakeReusable:D,onToggleHidden:k,onToggleLazy:_,onAddVariant:j,onDetach:o,onAddSection:w,canAddSection:i}=m,K=i===void 0?!0:i;let E;e[0]!==u.length?(E=()=>En(u.length),e[0]=u.length,e[1]=E):E=e[1];const[M,d]=N.useState(E),[T,ae]=N.useState(null),[P,pe]=N.useState(r),[V,ce]=N.useState(u.length),F=N.useRef(!1);P!==r?(pe(r),ce(u.length),d(En(u.length))):V!==u.length&&(ce(u.length),d(I=>Fr(I,u.length)));let te;e[2]===Symbol.for("react.memo_cache_sentinel")?(te={activationConstraint:{distance:8}},e[2]=te):te=e[2];let oe;e[3]===Symbol.for("react.memo_cache_sentinel")?(oe={coordinateGetter:qn},e[3]=oe):oe=e[3];const Pe=In(zt(Hn,te),zt(zn,oe));let O;e[4]!==M?(O=M.map(Jr),e[4]=M,e[5]=O):O=e[5];const ue=O;let ie;e[6]===Symbol.for("react.memo_cache_sentinel")?(ie=I=>{ae(String(I.active.id))},e[6]=ie):ie=e[6];const je=ie;let $;e[7]!==ue||e[8]!==v?($=I=>{ae(null);const{active:re,over:Q}=I;if(!Q||re.id===Q.id)return;const Ie=ue.indexOf(String(re.id)),he=ue.indexOf(String(Q.id));Ie===-1||he===-1||(d(Qe=>ua(Rt([...Qe],Ie,he))),F.current=!0,requestAnimationFrame(()=>{F.current=!1}),v?.(Ie,he))},e[7]=ue,e[8]=v,e[9]=$):$=e[9];const Ae=$;let X;e[10]===Symbol.for("react.memo_cache_sentinel")?(X=()=>{ae(null)},e[10]=X):X=e[10];const De=X;let ve,se,q,J,ne,le,ke,Se,de,ye,B,Z,we,Ke,$e;if(e[11]!==T||e[12]!==K||e[13]!==M||e[14]!==ue||e[15]!==Ae||e[16]!==g||e[17]!==w||e[18]!==j||e[19]!==h||e[20]!==o||e[21]!==x||e[22]!==D||e[23]!==f||e[24]!==k||e[25]!==_||e[26]!==c||e[27]!==u||e[28]!==S||e[29]!==Pe){Ke=Symbol.for("react.early_return_sentinel");e:{const I=re=>{F.current||f(re)};if(e[45]!==T||e[46]!==K||e[47]!==M||e[48]!==w||e[49]!==c||e[50]!==u){const re=T?M.find(Q=>Q.id===T):null;if(J=re!=null?u[re.index]:null,q=re!=null?c[re.index]:void 0,M.length===0){let Q;e[54]===Symbol.for("react.memo_cache_sentinel")?(Q=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:"No sections in this page."}),e[54]=Q):Q=e[54];const Ie=!K;let he;e[55]===Symbol.for("react.memo_cache_sentinel")?(he=n.jsx(un,{size:14}),e[55]=he):he=e[55];let Qe;e[56]!==w||e[57]!==Ie?(Qe=n.jsxs("div",{className:"space-y-2",children:[Q,n.jsxs(Ge,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Ie,onClick:w,children:[he,"Add section"]})]}),e[56]=w,e[57]=Ie,e[58]=Qe):Qe=e[58],Ke=Qe;break e}we=Ee(re&&"cursor-grabbing"),e[45]=T,e[46]=K,e[47]=M,e[48]=w,e[49]=c,e[50]=u,e[51]=q,e[52]=J,e[53]=we}else q=e[51],J=e[52],we=e[53];se=Jn,Se=Pe,de=Yn,ye=je,B=Ae,Z=De,ve=Qn,le=ue,ke=Xn,$e="space-y-1",ne=M.map(re=>{const Q=u[re.index];return Q?n.jsx(Ir,{sortableId:re.id,section:Q,raw:c[re.index],meta:g,selected:S===re.index,onSelect:()=>I(re.index),onDelete:()=>h(re.index),onDuplicate:()=>x(re.index),onMakeReusable:()=>D(re.index),onToggleHidden:()=>k(re.index),onToggleLazy:()=>_(re.index),onAddVariant:()=>j(re.index),onDetach:()=>o(re.index)},re.id):null})}e[11]=T,e[12]=K,e[13]=M,e[14]=ue,e[15]=Ae,e[16]=g,e[17]=w,e[18]=j,e[19]=h,e[20]=o,e[21]=x,e[22]=D,e[23]=f,e[24]=k,e[25]=_,e[26]=c,e[27]=u,e[28]=S,e[29]=Pe,e[30]=ve,e[31]=se,e[32]=q,e[33]=J,e[34]=ne,e[35]=le,e[36]=ke,e[37]=Se,e[38]=de,e[39]=ye,e[40]=B,e[41]=Z,e[42]=we,e[43]=Ke,e[44]=$e}else ve=e[30],se=e[31],q=e[32],J=e[33],ne=e[34],le=e[35],ke=e[36],Se=e[37],de=e[38],ye=e[39],B=e[40],Z=e[41],we=e[42],Ke=e[43],$e=e[44];if(Ke!==Symbol.for("react.early_return_sentinel"))return Ke;let Le;e[59]!==ne||e[60]!==$e?(Le=n.jsx("div",{className:$e,children:ne}),e[59]=ne,e[60]=$e,e[61]=Le):Le=e[61];let Ce;e[62]!==ve||e[63]!==le||e[64]!==ke||e[65]!==Le?(Ce=n.jsx(ve,{items:le,strategy:ke,children:Le}),e[62]=ve,e[63]=le,e[64]=ke,e[65]=Le,e[66]=Ce):Ce=e[66];let Oe;e[67]!==q||e[68]!==J||e[69]!==g?(Oe=J?n.jsx("div",{className:Ee("cursor-grabbing shadow-lg ring-1 ring-border/60",ma(J,!1)),children:n.jsx(da,{section:J,raw:q,meta:g})}):null,e[67]=q,e[68]=J,e[69]=g,e[70]=Oe):Oe=e[70];let Fe;e[71]!==Oe?(Fe=n.jsx(Zn,{dropAnimation:null,children:Oe}),e[71]=Oe,e[72]=Fe):Fe=e[72];let Me;e[73]!==se||e[74]!==Se||e[75]!==de||e[76]!==ye||e[77]!==B||e[78]!==Z||e[79]!==Ce||e[80]!==Fe?(Me=n.jsxs(se,{sensors:Se,collisionDetection:de,onDragStart:ye,onDragEnd:B,onDragCancel:Z,children:[Ce,Fe]}),e[73]=se,e[74]=Se,e[75]=de,e[76]=ye,e[77]=B,e[78]=Z,e[79]=Ce,e[80]=Fe,e[81]=Me):Me=e[81];const xe=!K;let Re;e[82]===Symbol.for("react.memo_cache_sentinel")?(Re=n.jsx(un,{size:14}),e[82]=Re):Re=e[82];let me;e[83]!==w||e[84]!==xe?(me=n.jsxs(Ge,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:xe,onClick:w,children:[Re,"Add section"]}),e[83]=w,e[84]=xe,e[85]=me):me=e[85];let ee;return e[86]!==we||e[87]!==Me||e[88]!==me?(ee=n.jsxs("div",{className:we,children:[Me,me]}),e[86]=we,e[87]=Me,e[88]=me,e[89]=ee):ee=e[89],ee}function Jr(m){return m.id}function Kn(m){const e=ze.c(38),{open:r,initialName:c,autoLabel:u,isPending:g,onSubmit:S,onOpenChange:f}=m,v=g===void 0?!1:g,[h,x]=N.useState(c),[D,k]=N.useState(r);r!==D&&(k(r),r&&x(c));let _;e[0]!==v||e[1]!==f?(_=oe=>{!oe&&!v&&f(!1)},e[0]=v,e[1]=f,e[2]=_):_=e[2];const j=_;let o;e[3]!==v||e[4]!==h||e[5]!==S?(o=async oe=>{oe.preventDefault(),!v&&await S(h.trim())},e[3]=v,e[4]=h,e[5]=S,e[6]=o):o=e[6];const w=o;let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(pr,{children:"Rename variant"}),e[7]=i):i=e[7];const K=u||"the rule";let E;e[8]!==K?(E=n.jsxs(hr,{children:[i,n.jsxs(gr,{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:K}),"."]})]}),e[8]=K,e[9]=E):E=e[9];let M;e[10]===Symbol.for("react.memo_cache_sentinel")?(M=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[10]=M):M=e[10];let d;e[11]===Symbol.for("react.memo_cache_sentinel")?(d=oe=>x(oe.target.value),e[11]=d):d=e[11];let T;e[12]!==u||e[13]!==v||e[14]!==h?(T=n.jsxs("div",{className:"space-y-1.5 py-4",children:[M,n.jsx(br,{id:"variant-rename-name",value:h,onChange:d,placeholder:u,autoFocus:!0,disabled:v})]}),e[12]=u,e[13]=v,e[14]=h,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]!==v||e[19]!==ae?(P=n.jsx(Ge,{type:"button",variant:"outline",onClick:ae,disabled:v,children:"Cancel"}),e[18]=v,e[19]=ae,e[20]=P):P=e[20];let pe;e[21]!==v?(pe=v?n.jsxs(n.Fragment,{children:[n.jsx(Fn,{size:14,className:"animate-spin"}),"Saving…"]}):"Save",e[21]=v,e[22]=pe):pe=e[22];let V;e[23]!==v||e[24]!==pe?(V=n.jsx(Ge,{type:"submit",disabled:v,children:pe}),e[23]=v,e[24]=pe,e[25]=V):V=e[25];let ce;e[26]!==P||e[27]!==V?(ce=n.jsxs(vr,{children:[P,V]}),e[26]=P,e[27]=V,e[28]=ce):ce=e[28];let F;e[29]!==w||e[30]!==ce||e[31]!==E||e[32]!==T?(F=n.jsx(Sr,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:w,children:[E,T,ce]})}),e[29]=w,e[30]=ce,e[31]=E,e[32]=T,e[33]=F):F=e[33];let te;return e[34]!==j||e[35]!==r||e[36]!==F?(te=n.jsx(xr,{open:r,onOpenChange:j,children:F}),e[34]=j,e[35]=r,e[36]=F,e[37]=te):te=e[37],te}const Yr="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)]",fa="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.2)]";function pa(m){const e=ze.c(5),{rule:r,matchers:c}=m,u=r?.__resolveType??"";let g;if(e[0]!==c||e[1]!==u){const h=c.find(x=>x.resolveType===u)?.iconName??Rs(u);g=cr(h),e[0]=c,e[1]=u,e[2]=g}else g=e[2];const S=g;if(!S)return null;let f;return e[3]!==S?(f=n.jsx(S,{size:14,className:"shrink-0"}),e[3]=S,e[4]=f):f=e[4],f}function $n(m){return m.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
2
+ `)}function ln(m){return m.map((e,r)=>({id:crypto.randomUUID(),index:r,variant:e}))}function Qr(m){return m.map((e,r)=>({...e,index:r}))}function ha(m){const e=ze.c(16),{label:r,effectiveRule:c,matchers:u,canDelete:g,dragging:S,onRename:f,onDuplicate:v,onDelete:h}=m;let x;e[0]!==c||e[1]!==u?(x=n.jsx(pa,{rule:c,matchers:u}),e[0]=c,e[1]=u,e[2]=x):x=e[2];let D;e[3]!==r?(D=n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:r}),e[3]=r,e[4]=D):D=e[4];let k;e[5]!==g||e[6]!==S||e[7]!==r||e[8]!==h||e[9]!==v||e[10]!==f?(k=!S&&n.jsxs(la,{children:[n.jsx(ia,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":`Actions for ${r}`,className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:Zr,onPointerDown:Xr,children:n.jsx(ta,{size:14})})}),n.jsxs(ca,{align:"end",className:"w-36",children:[n.jsxs(it,{onClick:j=>{j.stopPropagation(),f?.()},children:[n.jsx(Mr,{size:14}),"Rename"]}),n.jsxs(it,{onClick:j=>{j.stopPropagation(),v?.()},children:[n.jsx(sa,{size:14}),"Duplicate"]}),n.jsx(wr,{}),n.jsxs(it,{variant:"destructive",disabled:!g,onClick:j=>{j.stopPropagation(),h?.()},children:[n.jsx(oa,{size:14}),"Delete"]})]})]}),e[5]=g,e[6]=S,e[7]=r,e[8]=h,e[9]=v,e[10]=f,e[11]=k):k=e[11];let _;return e[12]!==x||e[13]!==D||e[14]!==k?(_=n.jsxs(n.Fragment,{children:[x,D,k]}),e[12]=x,e[13]=D,e[14]=k,e[15]=_):_=e[15],_}function Xr(m){return m.stopPropagation()}function Zr(m){return m.stopPropagation()}function eo(m){const e=ze.c(33),{entry:r,sortableId:c,isActive:u,canDelete:g,decofile:S,meta:f,matchers:v,onSelect:h,onRename:x,onDuplicate:D,onDelete:k}=m;let _;e[0]!==c?(_={id:c,animateLayoutChanges:to},e[0]=c,e[1]=_):_=e[1];const{attributes:j,listeners:o,setNodeRef:w,transform:i,isDragging:K}=Un(_);let E;e[2]!==i?(E=Gn.Transform.toString(i?{...i,x:0}:null),e[2]=i,e[3]=E):E=e[3];const M=K?0:void 0;let d;e[4]!==E||e[5]!==M?(d={transform:E,opacity:M},e[4]=E,e[5]=M,e[6]=d):d=e[6];const T=d,ae=f??void 0;let P;e[7]!==S||e[8]!==r.variant.rule||e[9]!==ae?(P=Nt(r.variant.rule,S,ae),e[7]=S,e[8]=r.variant.rule,e[9]=ae,e[10]=P):P=e[10];const pe=P;let V;e[11]!==h?(V=O=>{O.target===O.currentTarget&&(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),h())},e[11]=h,e[12]=V):V=e[12];const ce=K?"cursor-grabbing":"cursor-pointer active:cursor-grabbing",F=u?fa:Yr;let te;e[13]!==ce||e[14]!==F?(te=Ee("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors touch-none",ce,F),e[13]=ce,e[14]=F,e[15]=te):te=e[15];let oe;e[16]!==g||e[17]!==pe||e[18]!==r.variant.label||e[19]!==v||e[20]!==k||e[21]!==D||e[22]!==x?(oe=n.jsx(ha,{label:r.variant.label,effectiveRule:pe,matchers:v,canDelete:g,onRename:x,onDuplicate:D,onDelete:k}),e[16]=g,e[17]=pe,e[18]=r.variant.label,e[19]=v,e[20]=k,e[21]=D,e[22]=x,e[23]=oe):oe=e[23];let Pe;return e[24]!==j||e[25]!==o||e[26]!==h||e[27]!==w||e[28]!==T||e[29]!==te||e[30]!==oe||e[31]!==V?(Pe=n.jsx("div",{ref:w,style:T,...j,...o,onClick:h,onKeyDown:V,className:te,children:oe}),e[24]=j,e[25]=o,e[26]=h,e[27]=w,e[28]=T,e[29]=te,e[30]=oe,e[31]=V,e[32]=Pe):Pe=e[32],Pe}function to(){return!1}function no(m){const e=ze.c(9),{variant:r,decofile:c,meta:u,matchers:g}=m,S=u??void 0;let f;e[0]!==c||e[1]!==S||e[2]!==r.rule?(f=Nt(r.rule,c,S),e[0]=c,e[1]=S,e[2]=r.rule,e[3]=f):f=e[3];const v=f;let h;e[4]===Symbol.for("react.memo_cache_sentinel")?(h=Ee("flex items-center gap-2 rounded-md px-2 py-2.5 shadow-lg ring-1 ring-border/60 cursor-grabbing",fa),e[4]=h):h=e[4];let x;return e[5]!==v||e[6]!==g||e[7]!==r.label?(x=n.jsx("div",{className:h,children:n.jsx(ha,{label:r.label,effectiveRule:v,matchers:g,canDelete:!1,dragging:!0})}),e[5]=v,e[6]=g,e[7]=r.label,e[8]=x):x=e[8],x}function ao(m){const e=ze.c(77),{listKey:r,variants:c,activeIndex:u,decofile:g,meta:S,matchers:f,onSelect:v,onReorder:h,onRename:x,onDuplicate:D,onDelete:k,onAdd:_}=m;let j;e[0]!==c?(j=()=>ln(c),e[0]=c,e[1]=j):j=e[1];const[o,w]=N.useState(j),[i,K]=N.useState(null),[E,M]=N.useState(r),[d,T]=N.useState(c.length);let ae;e[2]!==c?(ae=()=>$n(c),e[2]=c,e[3]=ae):ae=e[3];const[P,pe]=N.useState(ae),V=N.useRef(!1),ce=$n(c);E!==r?(M(r),T(c.length),pe(ce),w(ln(c))):d!==c.length?(T(c.length),pe(ce),w(ln(c))):P!==ce&&(pe(ce),w(Me=>c.map((xe,Re)=>({id:Me[Re]?.id??crypto.randomUUID(),index:Re,variant:xe}))));let F;e[4]===Symbol.for("react.memo_cache_sentinel")?(F={activationConstraint:{distance:8}},e[4]=F):F=e[4];let te;e[5]===Symbol.for("react.memo_cache_sentinel")?(te={coordinateGetter:qn},e[5]=te):te=e[5];const oe=In(zt(Hn,F),zt(zn,te));let Pe;e[6]!==o?(Pe=o.map(so),e[6]=o,e[7]=Pe):Pe=e[7];const O=Pe,ue=c.length>1;let ie;e[8]!==o?(ie=Me=>{const xe=String(Me.active.id);K(o.find(Re=>Re.id===xe)??null)},e[8]=o,e[9]=ie):ie=e[9];const je=ie;let $;e[10]!==O||e[11]!==h?($=Me=>{K(null);const{active:xe,over:Re}=Me;if(!Re||xe.id===Re.id)return;const me=O.indexOf(String(xe.id)),ee=O.indexOf(String(Re.id));me===-1||ee===-1||(w(I=>Qr(Rt([...I],me,ee))),V.current=!0,requestAnimationFrame(()=>{V.current=!1}),h(me,ee))},e[10]=O,e[11]=h,e[12]=$):$=e[12];const Ae=$;let X;e[13]===Symbol.for("react.memo_cache_sentinel")?(X=()=>{K(null)},e[13]=X):X=e[13];const De=X;let ve,se,q,J,ne,le,ke,Se,de,ye,B,Z,we;if(e[14]!==u||e[15]!==ue||e[16]!==g||e[17]!==o||e[18]!==O||e[19]!==Ae||e[20]!==je||e[21]!==f||e[22]!==S||e[23]!==_||e[24]!==k||e[25]!==D||e[26]!==x||e[27]!==v||e[28]!==oe){const Me=I=>{V.current||v(I)};B="space-y-1 border-b p-2";let xe;e[42]===Symbol.for("react.memo_cache_sentinel")?(xe=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variants"}),e[42]=xe):xe=e[42];let Re;e[43]===Symbol.for("react.memo_cache_sentinel")?(Re=n.jsx(un,{size:14}),e[43]=Re):Re=e[43];let me;e[44]!==_?(me=n.jsx(ft,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-6",onClick:_,children:Re})}),e[44]=_,e[45]=me):me=e[45];let ee;e[46]===Symbol.for("react.memo_cache_sentinel")?(ee=n.jsx(pt,{children:"Add variant"}),e[46]=ee):ee=e[46],e[47]!==me?(Z=n.jsxs("div",{className:"flex items-center justify-between",children:[xe,n.jsxs(mt,{children:[me,ee]})]}),e[47]=me,e[48]=Z):Z=e[48],se=Jn,le=oe,ke=Yn,Se=je,de=Ae,ye=De,ve=Qn,J=O,ne=Xn,we="space-y-0.5",q=o.map(I=>n.jsx(eo,{sortableId:I.id,entry:I,isActive:I.index===u,canDelete:ue,decofile:g,meta:S,matchers:f,onSelect:()=>Me(I.index),onRename:()=>x(I.index),onDuplicate:()=>D(I.index),onDelete:()=>k(I.index)},I.id)),e[14]=u,e[15]=ue,e[16]=g,e[17]=o,e[18]=O,e[19]=Ae,e[20]=je,e[21]=f,e[22]=S,e[23]=_,e[24]=k,e[25]=D,e[26]=x,e[27]=v,e[28]=oe,e[29]=ve,e[30]=se,e[31]=q,e[32]=J,e[33]=ne,e[34]=le,e[35]=ke,e[36]=Se,e[37]=de,e[38]=ye,e[39]=B,e[40]=Z,e[41]=we}else ve=e[29],se=e[30],q=e[31],J=e[32],ne=e[33],le=e[34],ke=e[35],Se=e[36],de=e[37],ye=e[38],B=e[39],Z=e[40],we=e[41];let Ke;e[49]!==q||e[50]!==we?(Ke=n.jsx("div",{className:we,children:q}),e[49]=q,e[50]=we,e[51]=Ke):Ke=e[51];let $e;e[52]!==ve||e[53]!==J||e[54]!==ne||e[55]!==Ke?($e=n.jsx(ve,{items:J,strategy:ne,children:Ke}),e[52]=ve,e[53]=J,e[54]=ne,e[55]=Ke,e[56]=$e):$e=e[56];let Le;e[57]!==i||e[58]!==g||e[59]!==f||e[60]!==S?(Le=i?n.jsx(no,{variant:i.variant,decofile:g,meta:S,matchers:f}):null,e[57]=i,e[58]=g,e[59]=f,e[60]=S,e[61]=Le):Le=e[61];let Ce;e[62]!==Le?(Ce=n.jsx(Zn,{dropAnimation:null,children:Le}),e[62]=Le,e[63]=Ce):Ce=e[63];let Oe;e[64]!==se||e[65]!==le||e[66]!==ke||e[67]!==Se||e[68]!==de||e[69]!==ye||e[70]!==$e||e[71]!==Ce?(Oe=n.jsxs(se,{sensors:le,collisionDetection:ke,onDragStart:Se,onDragEnd:de,onDragCancel:ye,children:[$e,Ce]}),e[64]=se,e[65]=le,e[66]=ke,e[67]=Se,e[68]=de,e[69]=ye,e[70]=$e,e[71]=Ce,e[72]=Oe):Oe=e[72];let Fe;return e[73]!==B||e[74]!==Z||e[75]!==Oe?(Fe=n.jsxs("div",{className:B,children:[Z,Oe]}),e[73]=B,e[74]=Z,e[75]=Oe,e[76]=Fe):Fe=e[76],Fe}function so(m){return m.id}function ro(m){const e=ze.c(15),{schema:r,value:c,onChange:u,meta:g,decofile:S,onSaveReferencedBlock:f,sandbox:v}=m;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=[],e[0]=h):h=e[0];const[x,D]=N.useState(h);let k;e[1]!==x?(k=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(na,{className:"size-3.5"})}),x.map((o,w)=>{const i=w===x.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[w>0&&n.jsx(aa,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>D(x.slice(0,w+1)),title:o,className:Ee("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",i?"font-medium text-foreground":"text-muted-foreground"),children:o})]},`${o}-${w}`)})]}),e[1]=x,e[2]=k):k=e[2];let _;e[3]!==x||e[4]!==S||e[5]!==g||e[6]!==u||e[7]!==f||e[8]!==v||e[9]!==r||e[10]!==c?(_=n.jsx(ea,{schema:r,value:c,onChange:u,basePath:"",breadcrumbPath:x,onBreadcrumbChange:D,meta:g,decofile:S,onSaveReferencedBlock:f,sandbox:v}),e[3]=x,e[4]=S,e[5]=g,e[6]=u,e[7]=f,e[8]=v,e[9]=r,e[10]=c,e[11]=_):_=e[11];let j;return e[12]!==k||e[13]!==_?(j=n.jsxs("div",{className:"space-y-2",children:[k,_]}),e[12]=k,e[13]=_,e[14]=j):j=e[14],j}function On(m){const e=ze.c(21),{activeSchema:r,formValue:c,formResetKey:u,onFormChange:g,onBreadcrumbChange:S,breadcrumbPath:f,emptyMessage:v,beforeForm:h,seoResolveType:x,siteDefaultSeo:D,meta:k,decofile:_,onSaveReferencedBlock:j,sandbox:o}=m;let w;e[0]!==f?(w=f===void 0?[]:f,e[0]=f,e[1]=w):w=e[1];const i=w;let K;e[2]!==r||e[3]!==i||e[4]!==_||e[5]!==u||e[6]!==c||e[7]!==k||e[8]!==S||e[9]!==g||e[10]!==j||e[11]!==o||e[12]!==x||e[13]!==D?(K=r&&c?x?n.jsx(Rr,{schema:r,resolveType:x,value:c,formResetKey:u,onChange:g,onBreadcrumbChange:S,siteDefaultSeo:D}):n.jsx(ea,{schema:r,value:c,onChange:g,basePath:"",breadcrumbPath:i,onBreadcrumbChange:S,meta:k,decofile:_,onSaveReferencedBlock:j,sandbox:o},u):null,e[2]=r,e[3]=i,e[4]=_,e[5]=u,e[6]=c,e[7]=k,e[8]=S,e[9]=g,e[10]=j,e[11]=o,e[12]=x,e[13]=D,e[14]=K):K=e[14];const E=K;let M;e[15]!==v||e[16]!==E?(M=E??n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:v}),e[15]=v,e[16]=E,e[17]=M):M=e[17];let d;return e[18]!==h||e[19]!==M?(d=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:[h,M]})}),e[18]=h,e[19]=M,e[20]=d):d=e[20],d}const oo="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 io(m,e){return Ns(m,e,tt)}function lo(m){const e=ze.c(13),{pageKey:r,initialName:c,initialPath:u,onFieldChange:g}=m,[S,f]=N.useState(c),[v,h]=N.useState(u),[x,D]=N.useState(r);x!==r&&(D(r),f(c),h(u));let k;e[0]!==g?(k=i=>{f(i.target.value),g("name",i.target.value)},e[0]=g,e[1]=k):k=e[1];let _;e[2]!==S||e[3]!==k?(_=n.jsx("input",{type:"text",value:S,onChange:k,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]=S,e[3]=k,e[4]=_):_=e[4];let j;e[5]!==g?(j=i=>{h(i.target.value),g("path",i.target.value)},e[5]=g,e[6]=j):j=e[6];let o;e[7]!==v||e[8]!==j?(o=n.jsx("input",{type:"text",value:v,onChange:j,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]=v,e[8]=j,e[9]=o):o=e[9];let w;return e[10]!==_||e[11]!==o?(w=n.jsxs("div",{className:"space-y-1",children:[_,o]}),e[10]=_,e[11]=o,e[12]=w):w=e[12],w}function Bn(m){const e=ze.c(6),{onClick:r}=m;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(ra,{size:14}),e[0]=c):c=e[0];let u;e[1]!==r?(u=n.jsx(ft,{asChild:!0,children:n.jsx(Ge,{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]=u):u=e[2];let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(pt,{side:"bottom",children:"Add variant"}),e[3]=g):g=e[3];let S;return e[4]!==u?(S=n.jsxs(mt,{children:[u,g]}),e[4]=u,e[5]=S):S=e[5],S}function Ln(m){const e=ze.c(21),{currentRt:r,currentLabel:c,currentGlobalKey:u,matchers:g,globals:S,onSelect:f,onSelectGlobal:v,schema:h,formValue:x,onChange:D,formKey:k,formWrapperClassName:_,meta:j,decofile:o,onSaveReferencedBlock:w,sandbox:i}=m;let K;e[0]!==u||e[1]!==c||e[2]!==r||e[3]!==S||e[4]!==g||e[5]!==f||e[6]!==v?(K=n.jsx(Ds,{currentRt:r,currentLabel:c,currentGlobalKey:u,matchers:g,globals:S,onSelect:f,onSelectGlobal:v}),e[0]=u,e[1]=c,e[2]=r,e[3]=S,e[4]=g,e[5]=f,e[6]=v,e[7]=K):K=e[7];let E;e[8]!==o||e[9]!==k||e[10]!==x||e[11]!==_||e[12]!==j||e[13]!==D||e[14]!==w||e[15]!==i||e[16]!==h?(E=h&&x&&n.jsx("div",{className:_,children:n.jsx(ro,{schema:h,value:x,onChange:D,meta:j,decofile:o,onSaveReferencedBlock:w,sandbox:i},k)}),e[8]=o,e[9]=k,e[10]=x,e[11]=_,e[12]=j,e[13]=D,e[14]=w,e[15]=i,e[16]=h,e[17]=E):E=e[17];let M;return e[18]!==K||e[19]!==E?(M=n.jsxs(n.Fragment,{children:[K,E]}),e[18]=K,e[19]=E,e[20]=M):M=e[20],M}function ac({orgSlug:m,virtualMcpId:e,branch:r,previewReady:c=!0,previewUrl:u,currentPath:g,activePageBlockKey:S=null,activeGlobalBlockKey:f=null,externalSelectedIndex:v,onSaved:h,initialEditSeo:x=!1,onExitSeo:D,onViewJsonFile:k,onVariantPreviewOverride:_}){const j=c?{orgSlug:m,virtualMcpId:e,branch:r,previewUrl:u}:null,{data:o,isLoading:w}=Vs(j),{data:i,isLoading:K}=Cs(j),E=Ts(),M=E?.entity?.id===e?E.entity.metadata?.siteSlug??null:null,[d,T]=N.useState(null),[ae,P]=N.useState(null),[pe,V]=N.useState(null),[ce,F]=N.useState(0),[te,oe]=N.useState(void 0),[Pe,O]=N.useState(null),[ue,ie]=N.useState(null),[je,$]=N.useState([]),[Ae,X]=N.useState(0),[De,ve]=N.useState(null),[se,q]=N.useState(null),[J,ne]=N.useState(null),[le,ke]=N.useState(!0),[Se,de]=N.useState(!1),[ye,B]=N.useState(!1),[Z,we]=N.useState(x),[Ke,$e]=N.useState(x);x&&!Ke&&($e(!0),we(!0),T(null),P(null),V(null),$([])),!x&&Ke&&$e(!1);const[Le,Ce]=N.useState(null),[Oe,Fe]=N.useState(void 0),[Me,xe]=N.useState([]),[Re,me]=N.useState(0),[ee,I]=N.useState(0),[re,Q]=N.useState(null),[Ie,he]=N.useState(null),[Qe,dn]=N.useState(null),ga=vs(),va=`${m}/${e}/${r}`,Ht=Ps({orgSlug:m,virtualMcpId:e,branch:r}),[Sa,xa]=N.useState(g),[ba,ya]=N.useState(S),[_a,ja]=N.useState(f);(Sa!==g||ba!==S||_a!==f)&&(queueMicrotask(()=>Ht.flush()),xa(g),ya(S),ja(f),T(null),P(null),V(null),F(0),O(null),ie(null),I(0),Q(null),he(null),$([]),X(t=>t+1),we(!1),Ce(null),Fe(void 0),xe([]),me(t=>t+1));const be=As({orgSlug:m,virtualMcpId:e,branch:r}),Dt=Xs((t,a)=>{be.mutate({blockKey:t,data:a},{onSuccess:()=>h?.(),onError:s=>G.error(`Save failed: ${s.message}`)})}),Wt=Ms({orgSlug:m,virtualMcpId:e,branch:r}),[yt,Vt]=N.useState(!1),Ut=N.useRef(null),ht=N.useRef(null),gt=N.useRef(null),Gt=N.useRef({}),qe=N.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!c||w||K)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(Fn,{size:20,className:"animate-spin text-muted-foreground"})});if(!o||!i)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 ka=Es(o),_e=!!f,He=_e?null:Ks(ka,g,S),R=_e?f:He?.key??null,qt=_e&&f?o[f]:void 0,mn=_e&&f&&qt?$s(f,qt):_e&&f?f:"",Ct=!_e&&R&&o[R]?o[R]:null,Jt=Z&&o&&i&&R&&He?Mn(o,{kind:"page",pageKey:R,pageName:String(He.name??""),path:String(He.path??"")},i):null,wa=Z?Ct?.seo:void 0,Yt=Oe!==void 0?Oe:wa,Ra=Z?Nr(Yt):void 0,Na=Jt?.seoTypeOptions??[],Da=Z&&i?Dr(i):"",fn=Le??Ra??{},Qt=Z&&Jt?Vr(fn,Jt):null,Va=Z&&Qt&&Cr(Yt)?Ot(Qt,i):null,Ca=Z?Tr(o,i)?.seoData:void 0,Be=_e?[{label:"Default",sections:[{__resolveType:f}]}]:io(Ct?.sections,o??{}),Tt=Be.length>1,Ve=Math.min(ce,Be.length-1),nt=Be[Ve],H=nt?.sections??[],Te=Bt(H,o),pn=!_e&&Os(Ct?.sections);if(_e&&f&&Qe!==f){dn(f);const t=H[0],a=Te[0];if(t&&a){T(0),I(0),$([]);const s=ut(t,a,o);s&&(P(s.data),V(s.resolveType),he(null),Q(null))}}!_e&&Qe!==null&&dn(null),qe.current={rawSections:H,parsedSections:Te,decofile:o??{},activePageKey:R,pageVariants:Be,variantIndex:Ve,sectionVariantIndex:ee,selectedSectionIndex:d};const Ta=()=>({multivariate:pn,index:Ve,variants:Be.map(t=>({rule:t.rule}))}),hn=(t,a)=>{if(!_)return;if(!R||!pn||t.length<=1){_(null);return}const s=Pn(R,{multivariate:!0,index:a,variants:t},o,i);_(s.length>0?s:null)},vt=(t,a,s)=>{if(!_)return;if(!R){_(null);return}const l=Ta(),p=Pn(R,l,o,i);if(!t||a<0){_(p.length>0?p:null);return}const y=ar({pageKey:R,page:l,sectionIndex:a,sectionLazy:Te[a]?.isLazy??!1,mvObj:t,selectedVariantIndex:s,decofile:o,meta:i}),b=[...p,...y];_(b.length>0?b:null)},at=(t,a,s,l=d??-1,p=!1)=>{const y=Ye(t,a);if(!y){P(null),V(null),he(null),Q(null),p&&vt(null,l,s);return}const C=Dn(y,tt)[s];if(!C){P(null),V(null),he(null),Q(null),p&&vt(null,l,s);return}const Y=Hs(C.value,o);P(Y?.data??null),V(Y?.resolveType??null);const{resolveType:A,formValue:L}=jt(C.rule,o,i??void 0);he(A),Q(L),p&&vt(y,l,s)};if(v!==void 0&&v!==te&&(oe(v??null),typeof v=="number")){const t=H[v],a=Te[v];if(t&&a)if(T(v),I(0),$([]),X(s=>s+1),a.isMultivariate)at(t,a,0,v);else{const s=ut(t,a,o);s?(P(s.data),V(s.resolveType)):(P(null),V(null)),he(null),Q(null)}}const Pt={orgSlug:m,virtualMcpId:e,branch:r,previewUrl:u??void 0,siteSlug:M},Xt=pe&&i?Ot(pe,i):null,We=(t,a)=>{if(!R)return;const s=wt(o,R,t,Ve,Be);be.mutate({blockKey:R,data:s},{onSuccess:()=>a?.onSuccess?.()??h?.(),onError:l=>G.error(`Save failed: ${l.message}`)})},St=()=>{T(null),P(null),V(null),I(0),Q(null),he(null),$([]),X(t=>t+1)},Pa=(t,a)=>{Ut.current&&clearTimeout(Ut.current);const s=qe.current.sectionVariantIndex;Ut.current=setTimeout(()=>{const{rawSections:l,parsedSections:p,decofile:y,activePageKey:b,pageVariants:C,variantIndex:Y}=qe.current,A=l[a];if(!A)return;const L=p[a];if(!L)return;if(L.isSavedBlock){const W=L.isLazy?A.section?.__resolveType??A.__resolveType:A.__resolveType;be.mutate({blockKey:W,data:t},{onSuccess:()=>h?.(),onError:U=>G.error(`Save failed: ${U.message}`)});return}if(!b)return;const z={...y[b]},ge=[...l];if(L.isMultivariate){const W=Ye(A,L);if(!W||!b)return;const U=rr(W,s,t);ge[a]=dt(A,L,U)}else if(L.isHidden){const W=Wn(A.__resolveType),U=W?{...A.section}:{...A},Ne=Array.isArray(U.variants)?[...U.variants]:[];Ne[0]&&(Ne[0]={...Ne[0],value:t}),U.variants=Ne,W?ge[a]={...A,section:U}:ge[a]=U}else L.isLazy?ge[a]={...A,section:t}:ge[a]=t;if(C.length>1){const W=z.sections,U=[...W?.variants??[]];U[Y]&&(U[Y]={...U[Y],value:ge}),z.sections={...W,variants:U}}else z.sections=ge;be.mutate({blockKey:b,data:z},{onSuccess:()=>h?.(),onError:W=>G.error(`Save failed: ${W.message}`)})},on)},Aa=t=>{T(t),I(0),$([]),X(p=>p+1);const a=H[t],s=Te[t];if(!a||!s)return;if(s.isMultivariate){at(a,s,0,t);return}const l=ut(a,s,o);if(!l){P(null),V(null),he(null),Q(null),vt(null,t,0);return}P(l.data),V(l.resolveType),he(null),Q(null),vt(null,t,0)},gn=t=>{const a=t;P(a),d!==null&&Pa(a,d)},Zt=t=>{if(!R||!o||!i||!He)return;const a={kind:"page",pageKey:R,pageName:String(He.name??""),path:String(He.path??"")},s=Mn(o,a,i);s&&Ht.save(R,()=>{const l=ga.getQueryData(Ss.decofile(va))?.[R];if(!l||typeof l!="object"||l===null||Array.isArray(l))return null;const p={...l,...Gt.current};return Gt.current={},t?.raw!==void 0?{...p,seo:t.raw}:t?.inner!==void 0?Ar(a,s,p,t.inner):p})},Ma=(t,a)=>{R&&(Gt.current[t]=a,Zt())},Ea=(t,a)=>{if(!R)return;const s=Rt([...H],t,a);d!==null&&(d===t?T(a):t<d&&a>=d?T(d-1):t>d&&a<=d&&T(d+1)),We(s)},Ka=t=>{if(!R)return;const a=H.filter((s,l)=>l!==t);d===t?St():d!==null&&d>t&&T(d-1),We(a)},$a=t=>{if(!R)return;const a=H[t];if(!a)return;const s=[...H];s.splice(t+1,0,nr(a)),d!==null&&d>t&&T(d+1),We(s)},Oa=t=>{if(!R)return;const a=H[t],s=Te[t];if(!a||!s||s.isMultivariate)return;const l=s.isHidden?er(a):tr(a);if(!l)return;const p=[...H];p[t]=l,d===t&&St(),We(p)},Ba=t=>{if(!R)return;const a=H[t],s=Te[t];if(!a||!s||s.isMultivariate)return;const l=Zs(a);if(!l)return;const p=[...H];p[t]=l,d===t&&St(),We(p)},La=t=>{if(!R)return;const a=H[t],s=Te[t];if(!a||!s?.isSavedBlock)return;const l=ut(a,s,o);if(!l?.data)return;const{name:p,...y}=l.data,b=[...H];s.isLazy?b[t]={...a,section:y}:b[t]=y,d===t&&St(),We(b)},Fa=t=>{if(!R)return;const a=[...H,{__resolveType:t.resolveType}],s=a.length-1;We(a,{onSuccess:()=>{de(!1),T(s),I(0),$([]),X(b=>b+1);const l=a[s],p=Bt(a,o)[s];if(!l||!p)return;if(p.isMultivariate){at(l,p,0);return}const y=ut(l,p,o);if(!y){P(null),V(null),he(null),Q(null);return}P(y.data),V(y.resolveType),he(null),Q(null)}})},Ia=t=>{if(d===null)return;const a=H[d],s=Te[d];!a||!s?.isMultivariate||(I(t),$([]),X(l=>l+1),at(a,s,t,d,!0))},za=t=>{if(d===null||!R)return;const a=H[d],s=Te[d];if(!a||!s?.isMultivariate)return;const l=Ye(a,s);if(!l)return;const p=Ys(l,t);if(!p){G.error("Cannot delete the only variant.");return}const y=[...H];y[d]=dt(a,s,p);const b=p.variants;let C=ee;t===ee?C=Math.min(t,b.length-1):t<ee&&(C=ee-1),I(C),$([]),X(Y=>Y+1),at(y[d],s,C),We(y)},Ha=t=>{if(d===null||!R)return;const a=H[d],s=Te[d];if(!a||!s?.isMultivariate)return;const l=Ye(a,s);if(!l)return;const p=Qs(l,t),y=[...H];y[d]=dt(a,s,p);const b=t+1;I(b),$([]),X(C=>C+1),at(y[d],s,b),We(y)},Wa=(t,a)=>{if(d===null||!R||t===a)return;const s=H[d],l=Te[d];if(!s||!l?.isMultivariate)return;const p=Ye(s,l);if(!p)return;const y=qs(p,t,a),b=[...H];b[d]=dt(s,l,y);let C=ee;ee===t?C=a:t<ee&&a>=ee?C=ee-1:t>ee&&a<=ee&&(C=ee+1),I(C),at(b[d],l,C),We(b)},en=t=>{const a=t??d;if(a===null||!R)return;const s=H[a],l=Te[a];if(!s||!l)return;const p=Ws(s,l);if(!p){G.error("This section cannot have variants.");return}const y=[...H];y[a]=p.section;const b=Bt(y,o)[a];if(!b?.isMultivariate){G.error("Could not add variant.");return}T(a),I(p.newVariantIndex),$([]),X(C=>C+1),at(p.section,b,p.newVariantIndex,a),We(y)},Ua=()=>{if(d===null||!R)return;const t=H[d],a=Te[d];if(!t||!a?.isMultivariate)return;const s=Ye(t,a);if(!s)return;const l=Js(t,a,s);if(!l){G.error("Could not remove variants.");return}const p=[...H];p[d]=l;const y=Bt(p,o)[d];if(!y)return;I(0),he(null),Q(null),$([]),X(C=>C+1);const b=ut(l,y,o);b?(P(b.data),V(b.resolveType)):(P(null),V(null)),vt(null,d,0),We(p)},Ga=async t=>{if(De===null||!R)return;const a=rn(t,o);if(a){G.error(a);return}const s=H[De],l=Te[De];if(!s||!l)return;const p=ut(s,l,o);if(!p){G.error("This section cannot be saved as global.");return}const y={...p.data,name:t};try{await be.mutateAsync({blockKey:t,data:y});const b=[...H];b[De]={__resolveType:t},await be.mutateAsync({blockKey:R,data:wt(o,R,b,Ve,Be)}),d===De&&St(),ve(null),G.success(`Saved global block "${t}"`),h?.()}catch(b){G.error(b instanceof Error?b.message:"Failed to save global block")}},vn=nt?.rule;if(Tt&&d===null&&ue===null&&vn){const{resolveType:t,formValue:a}=jt(vn,o??{},i??void 0);ie(t),O(a)}const At=i?Bs(i):[],Sn=i&&o?Ls(i,o):[],qa=!_e&&!!(u&&i&&o),Ja=ue&&i?Ot(ue,i):null,Mt=()=>{ht.current&&(clearTimeout(ht.current),ht.current=null),gt.current&&(clearTimeout(gt.current),gt.current=null)},_t=async(t,a)=>{if(!(sr(a,t,i)>0))try{await Wt.mutateAsync({blockKey:t})}catch(s){G.error(s instanceof Error?s.message:"Could not delete matcher block")}},xn=t=>{ht.current&&clearTimeout(ht.current),ht.current=setTimeout(()=>{const{activePageKey:a,decofile:s,variantIndex:l}=qe.current;if(!a)return;const p={...s[a]},y={...p.sections},b=[...y.variants??[]],C=b[l],Y=C?.rule;if(xt(Y,s,i)){const A=Y?.__resolveType??"",L=s[A],z=typeof L?.name=="string"?L.name:A,{__resolveType:ge,...W}=t;be.mutate({blockKey:A,data:bt(ge??"",W,z)},{onSuccess:()=>h?.(),onError:U=>G.error(`Save failed: ${U.message}`)});return}C&&(b[l]={...C,rule:t}),p.sections={...y,variants:b},be.mutate({blockKey:a,data:p},{onSuccess:()=>h?.(),onError:A=>G.error(`Save failed: ${A.message}`)})},on)},Ya=t=>{ie(t);const a=t?{__resolveType:t}:{__resolveType:An};O({}),xn(a)},Qa=t=>{const a=t;O(a);const s=ue?{__resolveType:ue,...a}:{...a};xn(s)},Xa=async t=>{Mt();const{activePageKey:a,decofile:s,variantIndex:l}=qe.current;if(!a)return;const p=s[a],y=p?.sections;if(!y||typeof y!="object"||Array.isArray(y))return;const b=y;if(!Array.isArray(b.variants))return;const C=[...b.variants],Y=C[l];if(!Y)return;const A=kt(Y.rule,s,i),L=Ft(t);C[l]={...Y,rule:L};const z={...s,[a]:{...p,sections:{...b,variants:C}}},{resolveType:ge,formValue:W}=jt(L,z,i??void 0);ie(ge),O(W);try{await be.mutateAsync({blockKey:a,data:z[a]}),A&&A!==t&&await _t(A,z),h?.()}catch(U){G.error(U instanceof Error?U.message:"Could not apply saved rule")}},bn=t=>{gt.current&&clearTimeout(gt.current);const{selectedSectionIndex:a,sectionVariantIndex:s}=qe.current;a!==null&&(gt.current=setTimeout(()=>{const{rawSections:l,parsedSections:p,decofile:y,activePageKey:b,pageVariants:C,variantIndex:Y}=qe.current;if(!b)return;const A=l[a],L=p[a];if(!A||!L?.isMultivariate)return;const z=Ye(A,L);if(!z)return;const W=(z.variants??[])[s]?.rule;if(xt(W,y,i)){const fe=W?.__resolveType??"",Ue=y[fe],Ze=typeof Ue?.name=="string"?Ue.name:fe,{__resolveType:rt,...et}=t;be.mutate({blockKey:fe,data:bt(rt??"",et,Ze)},{onSuccess:()=>h?.(),onError:ot=>G.error(`Save failed: ${ot.message}`)});return}const U=Vn(z,s,t),Ne=[...l];Ne[a]=dt(A,L,U);const Je=wt(y,b,Ne,Y,C);be.mutate({blockKey:b,data:Je},{onSuccess:()=>h?.(),onError:fe=>G.error(`Save failed: ${fe.message}`)})},on))},Za=t=>{he(t),Q({}),bn(t?{__resolveType:t}:{__resolveType:An})},es=t=>{const a=t;Q(a);const s=Ie?{__resolveType:Ie,...a}:{...a};bn(s)},ts=async t=>{Mt();const{selectedSectionIndex:a,sectionVariantIndex:s,rawSections:l,parsedSections:p,decofile:y,activePageKey:b,pageVariants:C,variantIndex:Y}=qe.current;if(a===null||!b)return;const A=l[a],L=p[a];if(!A||!L?.isMultivariate)return;const z=Ye(A,L);if(!z)return;const ge=z.variants??[],W=kt(ge[s]?.rule,y,i),U=Ft(t),Ne=Vn(z,s,U),Je=[...l];Je[a]=dt(A,L,Ne);const fe=wt(y,b,Je,Y,C),Ue={...y,[b]:fe},{resolveType:Ze,formValue:rt}=jt(U,Ue,i??void 0);he(Ze),Q(rt);try{await be.mutateAsync({blockKey:b,data:fe}),W&&W!==t&&await _t(W,Ue),h?.()}catch(et){G.error(et instanceof Error?et.message:"Could not apply saved rule")}};if(!_e&&!He)return n.jsxs("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:["No page found for ",g]});if(_e&&!qt)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 st=d!==null?Te[d]??null:null,yn=d!==null?H[d]:null,_n=yn&&st?.isMultivariate?Ye(yn,st):null,lt=_n?Dn(_n,tt):[],tn=Math.min(ee,Math.max(lt.length-1,0)),Et=lt[tn]??null,ct=st?.isMultivariate===!0,jn=d!==null&&st!==null,Kt=jn&&(ct||!!(Xt&&ae)),ns=Kt&&!_e&&st?.isSavedBlock===!0,Xe=_e||ns,as=_e?mn:st?.label??"",ss=Ie&&i?Ot(Ie,i):null,nn=Kt&&(!_e||je.length>0)?_e?[mn,...je]:[He.name,st.label,...ct&&Et?[Et.label]:[],...je]:[],rs=Z&&He?[He.name,"SEO",...Me]:[],$t=Z?rs:Xe?nn.length>0?nn:[as]:nn,kn=()=>{if(!R)return;const t=o[R],a=Us(t.sections,H);if(!a)return;const s=Gs(a);be.mutate({blockKey:R,data:{...t,sections:a}},{onSuccess:()=>{F(s),T(null),P(null),V(null),$([]),O(null),ie(null)},onError:l=>G.error(`Save failed: ${l.message}`)})},an=(t,a,s)=>{if(!R)return;const l=o[R],p=l.sections;if(!p||typeof p!="object"||Array.isArray(p))return;const y=p;if(!Array.isArray(y.variants))return;const b=t([...y.variants]);if(!b)return;const C=or(y,b),Y={...o,[R]:{...l,sections:C}};be.mutate({blockKey:R,data:Y[R]},{onSuccess:()=>{a?.(),s&&_t(s,Y)},onError:A=>G.error(`Save failed: ${A.message}`)})},os=t=>{q(null),F(t),T(null),P(null),V(null),$([]);const a=Be[t]?.rule,{resolveType:s,formValue:l}=jt(a,o??{},i??void 0);ie(s),O(l),hn(Be.map(p=>({rule:p.rule})),t)},is=(t,a)=>{if(t===a)return;let s=Ve;Ve===t?s=a:t<Ve&&a>=Ve?s=Ve-1:t>Ve&&a<=Ve&&(s=Ve+1),F(s);const l=Rt(Be.map(p=>({rule:p.rule})),t,a);hn(l,s),an(p=>Rt(p,t,a))},ls=t=>{const a=Be[t]?.rule,s=kt(a,o??{},i??void 0);an(l=>l.length<=1?null:(l.splice(t,1),l),()=>{Be.length-1===1?F(0):t<Ve?F(Ve-1):t===Ve&&F(Math.max(0,t-1)),T(null),P(null),V(null),$([]),O(null),ie(null)},s)},cs=t=>{an(a=>ir(a,t),()=>{F(t+1),T(null),P(null),V(null),$([]),O(null),ie(null)})},us=async(t,a)=>{Mt();const s=qe.current.activePageKey,l=qe.current.decofile;if(!s)return;const p=l[s],y=p.sections;if(!y||typeof y!="object"||Array.isArray(y))return;const b=y;if(!Array.isArray(b.variants))return;const C=[...b.variants],Y=C[t];if(!Y?.rule||typeof Y.rule!="object"){G.error("This variant has no matcher rule to rename.");return}const A=Y.rule,L=a.trim();Vt(!0);try{if(!L){if(!xt(A,l,i)){q(null);return}const Je=A.__resolveType??"";C[t]={...Y,rule:Cn(A,l,i)};const fe={...l,[s]:{...p,sections:{...b,variants:C}}};await be.mutateAsync({blockKey:s,data:fe[s]}),await _t(Je,fe),q(null),h?.();return}const z=Tn(A,l,i);if(!z){G.error("Could not read this variant's matcher rule.");return}if(z.blockKey){await be.mutateAsync({blockKey:z.blockKey,data:bt(z.resolveType,z.data,L)}),q(null),h?.();return}const ge=sn(L),W=rn(ge,l);if(W){G.error(W);return}const U=bt(z.resolveType,z.data,L);let Ne=null;try{await be.mutateAsync({blockKey:ge,data:U}),Ne=ge,C[t]={...Y,rule:Ft(ge)},await be.mutateAsync({blockKey:s,data:{...p,sections:{...b,variants:C}}}),Ne=null}catch(Je){throw Ne&&await Wt.mutateAsync({blockKey:Ne}).catch(()=>{}),Je}q(null),G.success(`Saved matcher as global block "${L}"`),h?.()}catch(z){G.error(z instanceof Error?z.message:"Failed to rename variant")}finally{Vt(!1)}},ds=async(t,a)=>{Mt();const{selectedSectionIndex:s,rawSections:l,parsedSections:p,decofile:y,activePageKey:b,pageVariants:C,variantIndex:Y}=qe.current;if(s===null||!b)return;const A=l[s],L=p[s];if(!A||!L?.isMultivariate)return;const z=Ye(A,L);if(!z)return;const ge=z.variants??[],W=ge[t];if(!W?.rule||typeof W.rule!="object"){G.error("This variant has no matcher rule to rename.");return}const U=W.rule,Ne=a.trim();Vt(!0);const Je=async fe=>{const Ue={...z,variants:fe},Ze=[...l];Ze[s]=dt(A,L,Ue);const rt=wt(y,b,Ze,Y,C);return await be.mutateAsync({blockKey:b,data:rt}),{...y,[b]:rt}};try{if(!Ne){if(!xt(U,y,i)){ne(null);return}const ot=U.__resolveType??"",Nn=[...ge];Nn[t]={...W,rule:Cn(U,y,i)};const gs=await Je(Nn);await _t(ot,gs),ne(null),h?.();return}const fe=Tn(U,y,i);if(!fe){G.error("Could not read this variant's matcher rule.");return}if(fe.blockKey){await be.mutateAsync({blockKey:fe.blockKey,data:bt(fe.resolveType,fe.data,Ne)}),ne(null),h?.();return}const Ue=sn(Ne),Ze=rn(Ue,y);if(Ze){G.error(Ze);return}const rt=bt(fe.resolveType,fe.data,Ne);let et=null;try{await be.mutateAsync({blockKey:Ue,data:rt}),et=Ue;const ot=[...ge];ot[t]={...W,rule:Ft(Ue)},await Je(ot),et=null}catch(ot){throw et&&await Wt.mutateAsync({blockKey:et}).catch(()=>{}),ot}ne(null),G.success(`Saved matcher as global block "${Ne}"`),h?.()}catch(fe){G.error(fe instanceof Error?fe.message:"Failed to rename variant")}finally{Vt(!1)}},wn=()=>{St()},ms=t=>{Ce(t),Zt({inner:t})},fs=t=>{Fe(t),Zt({raw:t})},ps=()=>{Ce(null),xe([])},hs=()=>me(t=>t+1),Rn=t=>{if(Z){if(t===0){Ht.flush(),we(!1),Ce(null),Fe(void 0),xe([]),me(s=>s+1),D?.();return}if(t===1){xe([]),me(s=>s+1);return}xe(Me.slice(0,t-1)),me(s=>s+1);return}if(_e){$(je.slice(0,t)),X(s=>s+1);return}if(t===0){wn();return}if(t===1){$([]),X(s=>s+1);return}if(ct&&t===2){$([]),X(s=>s+1);return}const a=ct?2:1;$(je.slice(0,t-a))};return n.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[n.jsx("div",{className:"shrink-0",children:Xe||Kt||Z?n.jsxs("div",{className:Ee("border-b px-3 py-2.5",Xe&&"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:[$t.length>1&&n.jsx("button",{type:"button",onClick:()=>Rn($t.length-2),title:"Back","aria-label":"Back",className:Ee("shrink-0 inline-flex size-6 items-center justify-center rounded-md transition-colors",Xe?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:n.jsx(na,{className:"size-4"})}),!_e&&Tt&&nt&&n.jsxs("button",{type:"button",onClick:wn,title:`Editing in variant: ${nt.label}`,className:Ee("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",oo),children:[n.jsx(pa,{rule:Nt(nt.rule,o??{},i??void 0),matchers:At}),n.jsx("span",{className:"max-w-[160px] truncate",children:nt.label})]}),n.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:$t.map((t,a)=>{const s=a===$t.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[a>0&&n.jsx(aa,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>Rn(a),title:t,className:Ee("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",s?Xe?"font-semibold text-global-section-fg dark:text-global-section-fg-dark":"font-medium text-foreground":Xe?"text-foreground/80":"text-muted-foreground",Xe?"hover:bg-global-section/15":"hover:bg-accent hover:text-accent-foreground"),children:t})]},`${t}-${a}`)})}),Xe&&n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(fr,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(pt,{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."})]}),jn&&!ct&&!st?.isHidden&&R&&n.jsx(Bn,{onClick:()=>en()})]}),Xe&&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(lo,{pageKey:R,initialName:He.name,initialPath:He.path,onFieldChange:Ma})}),n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":"Edit SEO",className:"size-7 shrink-0",onClick:()=>we(!0),children:n.jsx(ur,{size:14})})}),n.jsx(pt,{side:"bottom",children:"Edit SEO"})]}),n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":"View JSON",className:"size-7 shrink-0",onClick:()=>k&&R?k(R):B(!0),children:n.jsx(dr,{size:14})})}),n.jsx(pt,{side:"bottom",children:"View JSON"})]}),n.jsx(Bn,{onClick:kn})]})}),Z?n.jsx(It,{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:Ct&&R?n.jsx(Pr,{rawSeo:Yt,innerSeo:fn,defaultResolveType:Da,seoSchema:Va,activeResolveType:Qt,seoTypeOptions:Na,formResetKey:Re,siteDefaultSeo:Ca,onBreadcrumbChange:xe,onPersistRaw:fs,onInnerChange:ms,onClearForm:ps,onBumpFormKey:hs}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"SEO schema not found for this site."})})})}):Kt?n.jsxs(It,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[ct&&lt.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(Fs,{listKey:`${R??""}:${d??""}`,variants:lt.map((t,a)=>({index:a,label:t.label})),selectedIndex:tn,onSelect:Ia,onRename:ne,onDuplicate:Ha,onDelete:za,onRemoveAll:Ua,onReorder:Wa,onAdd:()=>en()}),ct&&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(Ln,{currentRt:Ie??"",currentLabel:Lt(Et?.rule,o??{},tt,i??void 0),currentGlobalKey:kt(Et?.rule,o??{},i??void 0)??void 0,matchers:At,globals:Sn,onSelect:Za,onSelectGlobal:ts,schema:ss,formValue:re,onChange:es,formKey:`${d??"none"}:${tn}:${Ie??""}`,formWrapperClassName:"pt-1",meta:i??void 0,decofile:o,onSaveReferencedBlock:Dt,sandbox:Pt})]})]}),n.jsx(On,{activeSchema:Xt,formValue:ae,formResetKey:Ae,onFormChange:gn,onBreadcrumbChange:$,breadcrumbPath:je,emptyMessage:"No editable fields for this variant.",meta:i,decofile:o,onSaveReferencedBlock:Dt,sandbox:Pt})]}):_e?n.jsx(It,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(On,{activeSchema:Xt,formValue:ae,formResetKey:Ae,onFormChange:gn,onBreadcrumbChange:$,breadcrumbPath:je,emptyMessage:"No editable fields for this global block.",meta:i,decofile:o,onSaveReferencedBlock:Dt,sandbox:Pt})}):n.jsxs(It,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[Tt&&R&&n.jsx(ao,{listKey:R,variants:Be,activeIndex:Ve,decofile:o??{},meta:i,matchers:At,onSelect:os,onReorder:is,onRename:q,onDuplicate:cs,onDelete:ls,onAdd:kn}),Tt&&ue!==null&&n.jsxs("div",{className:Ee("px-3 border-b",le?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>ke(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":le,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variant rule"}),le?n.jsx(mr,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(lr,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),le&&n.jsx("div",{className:Ee("space-y-3",yt&&"pointer-events-none opacity-50"),children:n.jsx(Ln,{currentRt:ue,currentLabel:Lt(nt?.rule,o??{},tt,i??void 0),currentGlobalKey:kt(nt?.rule,o??{},i??void 0)??void 0,matchers:At,globals:Sn,onSelect:Ya,onSelectGlobal:Xa,schema:Ja,formValue:Pe,onChange:Qa,formKey:`${Ve}:${ue??""}`,formWrapperClassName:"space-y-3",meta:i??void 0,decofile:o,onSaveReferencedBlock:Dt,sandbox:Pt})})]}),n.jsx("div",{className:"p-2 pt-3",children:n.jsx(qr,{listKey:`${R??""}-${Ve}`,rawSections:H,sections:Te,meta:i,selectedIndex:d,onSelect:Aa,onReorder:Ea,onDelete:Ka,onDuplicate:$a,onMakeReusable:ve,onToggleHidden:Oa,onToggleLazy:Ba,onAddVariant:en,onDetach:La,onAddSection:()=>de(!0),canAddSection:qa})})]}),n.jsx(Is,{open:De!==null,onOpenChange:t=>{t||ve(null)},defaultBlockId:De!==null?sn(Te[De]?.label??""):"",isPending:be.isPending,onSubmit:Ga}),u&&n.jsx(Er,{open:Se,onOpenChange:de,meta:i,decofile:o,previewBaseUrl:u,onSelect:Fa}),ye&&R&&o&&n.jsx(zs,{open:ye,onOpenChange:B,pageKey:R,decofile:o}),se!==null&&n.jsx(Kn,{open:!0,initialName:xt(Be[se]?.rule,o??{},i??void 0)?Lt(Be[se]?.rule,o??{},tt,i??void 0):"",autoLabel:tt(Nt(Be[se]?.rule,o??{},i??void 0)),isPending:yt,onSubmit:async t=>{await us(se,t)},onOpenChange:t=>{!t&&!yt&&q(null)}}),J!==null&&n.jsx(Kn,{open:!0,initialName:xt(lt[J]?.rule,o??{},i??void 0)?Lt(lt[J]?.rule,o??{},tt,i??void 0):"",autoLabel:tt(Nt(lt[J]?.rule,o??{},i??void 0)),isPending:yt,onSubmit:async t=>{await ds(J,t)},onOpenChange:t=>{!t&&!yt&&ne(null)}})]})}export{ac as SectionsEditor};
@@ -1 +1 @@
1
- import{r as i,aT as nt,aR as Pe,j as d,cQ as rt,aV as be,aS as k,cR as st,aO as j,aU as _,bI as $,cS as lt,at as Ne,cT as Ee,aP as at,bH as ct,bK as it,cZ as dt,c_ as ut,c$ as pt,d0 as ft,cU as mt,aQ as ht,d1 as vt,cV as gt,cX as xt,c as ee,l as oe}from"./index-BE6hzuPl.js";import{V as St}from"./tooltip-XFj2xRwa.js";import{i as wt,n as Ct}from"./ChevronUp-D-P6SBrW.js";import{t as Re}from"./ChevronDown-DDT8b8rP.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:c,value:s,defaultValue:l,onValueChange:a,dir:u,name:h,autoComplete:g,disabled:b,required:w,form:S}=r,p=pe(e),[v,C]=i.useState(null),[m,x]=i.useState(null),[U,M]=i.useState(!1),re=nt(u),[N,O]=Pe({prop:o,defaultProp:n??!1,onChange:c,caller:Q}),[F,q]=Pe({prop:s,defaultProp:l,onChange:a,caller:Q}),L=i.useRef(null),B=v?S||!!v.closest("form"):!0,[W,V]=i.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:i.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:i.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=i.forwardRef((r,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=r,c=pe(t),s=G(Me,t),l=s.disabled||o,a=k(e,s.onTriggerChange),u=ue(t),h=i.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,...c,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=i.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,children:c,placeholder:s="",...l}=r,a=G(Oe,t),{onValueNodeHasChildrenChange:u}=a,h=c!==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}):c})});De.displayName=Oe;var Nt="SelectIcon",ke=i.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=i.forwardRef((r,e)=>{const t=G(J,r.__scopeSelect),[o,n]=i.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const c=o;return c?Ne.createPortal(d.jsx(Ve,{scope:r.__scopeSelect,children:d.jsx(de.Slot,{scope:r.__scopeSelect,children:d.jsx("div",{children:r.children})})}),c):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=i.forwardRef((r,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:c,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]=i.useState(null),[M,re]=i.useState(null),N=k(e,f=>U(f)),[O,F]=i.useState(null),[q,L]=i.useState(null),B=ue(t),[W,V]=i.useState(!1),H=i.useRef(!1);i.useEffect(()=>{if(x)return dt(x)},[x]),ut();const E=i.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=i.useCallback(()=>E([O,x]),[E,O,x]);i.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=m;i.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]),i.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=i.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=i.useCallback(()=>x?.focus(),[x]),te=i.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&L(f)},[m.value]),ce=o==="popper"?Se:ze,se=ce===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:c,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:d.jsx(ce,{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=i.forwardRef((r,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=r,c=G(J,t),s=Y(J,t),[l,a]=i.useState(null),[u,h]=i.useState(null),g=k(e,N=>h(N)),b=ue(t),w=i.useRef(!1),S=i.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:C,focusSelectedItem:m}=s,x=i.useCallback(()=>{if(c.trigger&&c.valueNode&&l&&u&&p&&v&&C){const N=c.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),F=c.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(c.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,ce=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(ce,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,c.trigger,c.valueNode,l,u,p,v,C,c.dir,o]);$(()=>x(),[x]);const[U,M]=i.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=i.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=i.forwardRef((r,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...c}=r,s=pe(t);return d.jsx(gt,{...s,...c,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...c.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=i.forwardRef((r,e)=>{const{__scopeSelect:t,nonce:o,...n}=r,c=Y(we,t),s=Te(we,t),l=k(e,c.onViewportChange),a=i.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=i.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=i.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 ie="SelectItem",[Vt,Ke]=ne(ie),$e=i.forwardRef((r,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:c,...s}=r,l=G(ie,t),a=Y(ie,t),u=l.value===o,[h,g]=i.useState(c??""),[b,w]=i.useState(!1),S=k(e,m=>a.itemRefCallback?.(m,o,n)),p=be(),v=i.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:i.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=ie;var le="SelectItemText",Ge=i.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,...c}=r,s=G(le,t),l=Y(le,t),a=Ke(le,t),u=_t(le,t),[h,g]=i.useState(null),b=k(e,C=>g(C),a.onItemTextChange,C=>l.itemTextRefCallback?.(C,a.value,a.disabled)),w=h?.textContent,S=i.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,...c,ref:b}),a.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Ne.createPortal(c.children,s.valueNode):null]})});Ge.displayName=le;var Ye="SelectItemIndicator",qe=i.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=i.forwardRef((r,e)=>{const t=Y(Ce,r.__scopeSelect),o=Te(Ce,r.__scopeSelect),[n,c]=i.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollTop>0;c(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=i.forwardRef((r,e)=>{const t=Y(ye,r.__scopeSelect),o=Te(ye,r.__scopeSelect),[n,c]=i.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;c(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=i.forwardRef((r,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=r,c=Y("SelectScrollButton",t),s=i.useRef(null),l=ue(t),a=i.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return i.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,()=>{c.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:_(n.onPointerLeave,()=>{a()})})}),Ht="SelectSeparator",zt=i.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=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=pe(t),c=G(Ie,t),s=Y(Ie,t);return c.open&&s.position==="popper"?d.jsx(xt,{...n,...o,ref:e}):null});Ut.displayName=Ie;var Ft="SelectBubbleInput",Je=i.forwardRef(({__scopeSelect:r,value:e,...t},o)=>{const n=i.useRef(null),c=k(o,n),s=ct(e);return i.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:c,defaultValue:e})});Je.displayName=Ft;function et(r){return r===""||r===void 0}function tt(r){const e=it(r),t=i.useRef(""),o=i.useRef(0),n=i.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]),c=i.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return i.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,c]}function ot(r,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,c=t?r.indexOf(t):-1;let s=Wt(r,Math.max(c,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 io(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,c;e[0]!==r?({className:o,size:c,children:t,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c):(t=e[1],o=e[2],n=e[3],c=e[4]);const s=c===void 0?"default":c;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,c,s;e[0]!==r?({className:o,children:t,position:c,hideScrollButtons:s,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c,e[5]=s):(t=e[1],o=e[2],n=e[3],c=e[4],s=e[5]);const l=c===void 0?"popper":c,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,c;e[0]!==r?({className:o,children:t,hideCheck:c,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c):(t=e[1],o=e[2],n=e[3],c=e[4]);const s=c===void 0?!1:c;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 c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=d.jsx(Ct,{className:"size-4"}),e[5]=c):c=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:c}),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 c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=d.jsx(Re,{className:"size-4"}),e[5]=c):c=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:c}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}export{io as S,po as a,uo as b,fo as c,mo as d,_e as e};
1
+ import{r as i,aT as nt,aR as Pe,j as d,cQ as rt,aV as be,aS as k,cR as st,aO as j,aU as _,bI as $,cS as lt,at as Ne,cT as Ee,aP as at,bH as ct,bK as it,cZ as dt,c_ as ut,c$ as pt,d0 as ft,cU as mt,aQ as ht,d1 as vt,cV as gt,cX as xt,c as ee,l as oe}from"./index-C8rlFaFO.js";import{V as St}from"./tooltip-DE_gqCm3.js";import{i as wt,n as Ct}from"./ChevronUp-Ci-XiWb6.js";import{t as Re}from"./ChevronDown-D_W2bIqv.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:c,value:s,defaultValue:l,onValueChange:a,dir:u,name:h,autoComplete:g,disabled:b,required:w,form:S}=r,p=pe(e),[v,C]=i.useState(null),[m,x]=i.useState(null),[U,M]=i.useState(!1),re=nt(u),[N,O]=Pe({prop:o,defaultProp:n??!1,onChange:c,caller:Q}),[F,q]=Pe({prop:s,defaultProp:l,onChange:a,caller:Q}),L=i.useRef(null),B=v?S||!!v.closest("form"):!0,[W,V]=i.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:i.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:i.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=i.forwardRef((r,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=r,c=pe(t),s=G(Me,t),l=s.disabled||o,a=k(e,s.onTriggerChange),u=ue(t),h=i.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,...c,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=i.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,children:c,placeholder:s="",...l}=r,a=G(Oe,t),{onValueNodeHasChildrenChange:u}=a,h=c!==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}):c})});De.displayName=Oe;var Nt="SelectIcon",ke=i.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=i.forwardRef((r,e)=>{const t=G(J,r.__scopeSelect),[o,n]=i.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const c=o;return c?Ne.createPortal(d.jsx(Ve,{scope:r.__scopeSelect,children:d.jsx(de.Slot,{scope:r.__scopeSelect,children:d.jsx("div",{children:r.children})})}),c):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=i.forwardRef((r,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:c,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]=i.useState(null),[M,re]=i.useState(null),N=k(e,f=>U(f)),[O,F]=i.useState(null),[q,L]=i.useState(null),B=ue(t),[W,V]=i.useState(!1),H=i.useRef(!1);i.useEffect(()=>{if(x)return dt(x)},[x]),ut();const E=i.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=i.useCallback(()=>E([O,x]),[E,O,x]);i.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=m;i.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]),i.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=i.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=i.useCallback(()=>x?.focus(),[x]),te=i.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&L(f)},[m.value]),ce=o==="popper"?Se:ze,se=ce===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:c,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:d.jsx(ce,{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=i.forwardRef((r,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=r,c=G(J,t),s=Y(J,t),[l,a]=i.useState(null),[u,h]=i.useState(null),g=k(e,N=>h(N)),b=ue(t),w=i.useRef(!1),S=i.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:C,focusSelectedItem:m}=s,x=i.useCallback(()=>{if(c.trigger&&c.valueNode&&l&&u&&p&&v&&C){const N=c.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),F=c.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(c.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,ce=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(ce,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,c.trigger,c.valueNode,l,u,p,v,C,c.dir,o]);$(()=>x(),[x]);const[U,M]=i.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=i.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=i.forwardRef((r,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...c}=r,s=pe(t);return d.jsx(gt,{...s,...c,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...c.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=i.forwardRef((r,e)=>{const{__scopeSelect:t,nonce:o,...n}=r,c=Y(we,t),s=Te(we,t),l=k(e,c.onViewportChange),a=i.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=i.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=i.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 ie="SelectItem",[Vt,Ke]=ne(ie),$e=i.forwardRef((r,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:c,...s}=r,l=G(ie,t),a=Y(ie,t),u=l.value===o,[h,g]=i.useState(c??""),[b,w]=i.useState(!1),S=k(e,m=>a.itemRefCallback?.(m,o,n)),p=be(),v=i.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:i.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=ie;var le="SelectItemText",Ge=i.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,...c}=r,s=G(le,t),l=Y(le,t),a=Ke(le,t),u=_t(le,t),[h,g]=i.useState(null),b=k(e,C=>g(C),a.onItemTextChange,C=>l.itemTextRefCallback?.(C,a.value,a.disabled)),w=h?.textContent,S=i.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,...c,ref:b}),a.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Ne.createPortal(c.children,s.valueNode):null]})});Ge.displayName=le;var Ye="SelectItemIndicator",qe=i.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=i.forwardRef((r,e)=>{const t=Y(Ce,r.__scopeSelect),o=Te(Ce,r.__scopeSelect),[n,c]=i.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollTop>0;c(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=i.forwardRef((r,e)=>{const t=Y(ye,r.__scopeSelect),o=Te(ye,r.__scopeSelect),[n,c]=i.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;c(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=i.forwardRef((r,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=r,c=Y("SelectScrollButton",t),s=i.useRef(null),l=ue(t),a=i.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return i.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,()=>{c.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:_(n.onPointerLeave,()=>{a()})})}),Ht="SelectSeparator",zt=i.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=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=pe(t),c=G(Ie,t),s=Y(Ie,t);return c.open&&s.position==="popper"?d.jsx(xt,{...n,...o,ref:e}):null});Ut.displayName=Ie;var Ft="SelectBubbleInput",Je=i.forwardRef(({__scopeSelect:r,value:e,...t},o)=>{const n=i.useRef(null),c=k(o,n),s=ct(e);return i.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:c,defaultValue:e})});Je.displayName=Ft;function et(r){return r===""||r===void 0}function tt(r){const e=it(r),t=i.useRef(""),o=i.useRef(0),n=i.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]),c=i.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return i.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,c]}function ot(r,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,c=t?r.indexOf(t):-1;let s=Wt(r,Math.max(c,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 io(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,c;e[0]!==r?({className:o,size:c,children:t,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c):(t=e[1],o=e[2],n=e[3],c=e[4]);const s=c===void 0?"default":c;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,c,s;e[0]!==r?({className:o,children:t,position:c,hideScrollButtons:s,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c,e[5]=s):(t=e[1],o=e[2],n=e[3],c=e[4],s=e[5]);const l=c===void 0?"popper":c,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,c;e[0]!==r?({className:o,children:t,hideCheck:c,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c):(t=e[1],o=e[2],n=e[3],c=e[4]);const s=c===void 0?!1:c;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 c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=d.jsx(Ct,{className:"size-4"}),e[5]=c):c=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:c}),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 c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=d.jsx(Re,{className:"size-4"}),e[5]=c):c=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:c}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}export{io as S,po as a,uo as b,fo as c,mo as d,_e as e};