decocms 4.325.1 → 4.325.3

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 (274) hide show
  1. package/dist/client/assets/{AlertCircle-Bs6oknH_.js → AlertCircle-Wbx84J6P.js} +1 -1
  2. package/dist/client/assets/{AreaChart-B4QZuiFF.js → AreaChart-Cld_d890.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-BWSnRuGm.js → ArrowLeft-BJlpl6z3.js} +1 -1
  4. package/dist/client/assets/{ArrowUp--KPYS_Zx.js → ArrowUp-BSj9TnDQ.js} +1 -1
  5. package/dist/client/assets/{Check-tzg1v70M.js → Check-AnkVYvzC.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-8VMJtbLE.js → CheckCircle-DwmOpGug.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-CiQ4250Y.js → ChevronRight-pYTAY0dL.js} +1 -1
  8. package/dist/client/assets/{ChevronSelectorVertical-BoLsghjN.js → ChevronSelectorVertical-BbsmXbxd.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-CdsnYS3o.js → ChevronUp-3g3WN6eT.js} +1 -1
  10. package/dist/client/assets/{Copy01-BMb_uucS.js → Copy01-sos155fT.js} +1 -1
  11. package/dist/client/assets/{CreditCard01-CYcMMyuv.js → CreditCard01-VG7XqKoo.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-Csr6l19K.js → DotsVertical-DuuOH2An.js} +1 -1
  13. package/dist/client/assets/{Download01-DC7Ed5MF.js → Download01-DcuqUkne.js} +1 -1
  14. package/dist/client/assets/{ErrorBarContext-CWInPftf.js → ErrorBarContext-BM4rcvvu.js} +1 -1
  15. package/dist/client/assets/{Eye-D3-C_xXn.js → Eye-UqfDVX8c.js} +1 -1
  16. package/dist/client/assets/{GitBranch01-BBK46z_T.js → GitBranch01-DLsJ2eA8.js} +1 -1
  17. package/dist/client/assets/{Globe01-DZmHtz0b.js → Globe01-g_WhroPz.js} +1 -1
  18. package/dist/client/assets/{HardDrive-C5hOZFs-.js → HardDrive-DZFCo6aQ.js} +1 -1
  19. package/dist/client/assets/{Image01-DwIAdAUT.js → Image01-BZ7eP3sg.js} +1 -1
  20. package/dist/client/assets/{Key01-bUGu_NLF.js → Key01-ladeKbIs.js} +1 -1
  21. package/dist/client/assets/{Link01-CYHfOeCn.js → Link01-Cx-fsoFK.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-ItrpBJnM.js → LinkExternal01-Ct6ls10Y.js} +1 -1
  23. package/dist/client/assets/{Monitor01-B8OxufXb.js → Monitor01-CHYJhnW7.js} +1 -1
  24. package/dist/client/assets/{Package-B1Q6V5jC.js → Package-DlB0zfSe.js} +1 -1
  25. package/dist/client/assets/{Palette-CmDDPB-1.js → Palette-Cwg4Tz5U.js} +1 -1
  26. package/dist/client/assets/{Play-Cebbxrf7.js → Play-CNXxnEyG.js} +1 -1
  27. package/dist/client/assets/{Plus-DluN38us.js → Plus-CjjCgafZ.js} +1 -1
  28. package/dist/client/assets/{SearchMd-Dtd4_W0w.js → SearchMd-CZf0Jno3.js} +1 -1
  29. package/dist/client/assets/{Sector-jDW2HqNy.js → Sector-D6LGQ5el.js} +1 -1
  30. package/dist/client/assets/{Settings02-CdkkNZQs.js → Settings02-DA_70bcH.js} +1 -1
  31. package/dist/client/assets/{Share07-CQi_kYTg.js → Share07-B_yFA1PQ.js} +1 -1
  32. package/dist/client/assets/{Shield01-nF6J5QH3.js → Shield01-P1rLU6cR.js} +1 -1
  33. package/dist/client/assets/{Stars01-BkXOAWkF.js → Stars01-izYFmAbe.js} +1 -1
  34. package/dist/client/assets/{Sun-DqwL2RBY.js → Sun-DwCUi13i.js} +1 -1
  35. package/dist/client/assets/{Tool01-UNDZEmAI.js → Tool01-Z3QYZ79t.js} +1 -1
  36. package/dist/client/assets/{Tool02-DLBy4do6.js → Tool02-BQmdN0LJ.js} +1 -1
  37. package/dist/client/assets/{Trash01-BiGnC-j2.js → Trash01-B8XVvUnv.js} +1 -1
  38. package/dist/client/assets/{TrendUp01-DQn6MXk1.js → TrendUp01-CP0vQywV.js} +1 -1
  39. package/dist/client/assets/{Upload01-CEzfFT4A.js → Upload01-CbAoc2QM.js} +1 -1
  40. package/dist/client/assets/{User01-C7HywlOg.js → User01-Ct0i24vv.js} +1 -1
  41. package/dist/client/assets/{UserSquare-hx_yDjx2.js → UserSquare-BYbdOYH9.js} +1 -1
  42. package/dist/client/assets/{Users01-DSJGRawE.js → Users01-BYaxTYGQ.js} +1 -1
  43. package/dist/client/assets/{Users03-D0VbxK_7.js → Users03-jn24Kly8.js} +1 -1
  44. package/dist/client/assets/{XCircle-DpU-0ryx.js → XCircle-DlF5M8M0.js} +1 -1
  45. package/dist/client/assets/{XClose-BPl5N5wQ.js → XClose-CakjP9Y8.js} +1 -1
  46. package/dist/client/assets/{Zap-9WaWy-XB.js → Zap-Bf8uxQjq.js} +1 -1
  47. package/dist/client/assets/{ZoomOut-JTfIuUYt.js → ZoomOut-fURlNFfr.js} +1 -1
  48. package/dist/client/assets/{access-gate-C43dXf2x.js → access-gate-65i3zTD_.js} +1 -1
  49. package/dist/client/assets/{agent-icon-72FlHM-8.js → agent-icon-Sp3pGLLY.js} +1 -1
  50. package/dist/client/assets/agents-list-BZ7PpN5S.js +1 -0
  51. package/dist/client/assets/ai-providers-DlXNHZZI.js +1 -0
  52. package/dist/client/assets/{alert-DPh9CuwD.js → alert-Covq9TpT.js} +1 -1
  53. package/dist/client/assets/{alert-dialog-DY5pueun.js → alert-dialog-Cj0fNCkE.js} +1 -1
  54. package/dist/client/assets/{analytics-tab-BUjurxUV.js → analytics-tab-BGfMFYes.js} +1 -1
  55. package/dist/client/assets/{api-keys-BfTxJZ5X.js → api-keys-CwoRMmEY.js} +1 -1
  56. package/dist/client/assets/api-keys-Dcjx1Kt1.js +1 -0
  57. package/dist/client/assets/app-editor-BXmBcjlO.js +1 -0
  58. package/dist/client/assets/{auth-CRRmnvXP.js → auth-DzRAXSGB.js} +1 -1
  59. package/dist/client/assets/{auth-catchall-CHovBt0N.js → auth-catchall-C0obfXjs.js} +1 -1
  60. package/dist/client/assets/{auth-entry-BMs-KpEE.js → auth-entry-DpCTb7jI.js} +1 -1
  61. package/dist/client/assets/{auth-split-layout-RvH6q9Np.js → auth-split-layout-TPhGW0ur.js} +1 -1
  62. package/dist/client/assets/{authenticate-and-persist-oauth-D6lfMerI.js → authenticate-and-persist-oauth-B1cWso3x.js} +1 -1
  63. package/dist/client/assets/{automation-list-row-PO_mCBtT.js → automation-list-row-BR_7Wuv2.js} +1 -1
  64. package/dist/client/assets/{automation-runs-CzvbjIvf.js → automation-runs-Bt1_onfP.js} +1 -1
  65. package/dist/client/assets/automations-qhDCv6KW.js +1 -0
  66. package/dist/client/assets/{avatar-Br5BYZeI.js → avatar-B5NKRFBP.js} +1 -1
  67. package/dist/client/assets/{badge-BXMUzYIE.js → badge-BmwbVsh5.js} +1 -1
  68. package/dist/client/assets/{block-document-D1scmISJ.js → block-document-DsxmquN5.js} +1 -1
  69. package/dist/client/assets/{breadcrumb-CXuS6gNw.js → breadcrumb-B_bU6eJc.js} +1 -1
  70. package/dist/client/assets/{buckets-CwnhCBpn.js → buckets-CJXf1hSG.js} +1 -1
  71. package/dist/client/assets/{bulk-category-panel-GXmEs2lp.js → bulk-category-panel-CEbuB3eE.js} +1 -1
  72. package/dist/client/assets/{capability-load-error-ClieXywX.js → capability-load-error-Du-FbaTG.js} +1 -1
  73. package/dist/client/assets/{cards-O9HwAVOg.js → cards-D4AMs5hh.js} +1 -1
  74. package/dist/client/assets/category-editor-Q8mnyuVW.js +1 -0
  75. package/dist/client/assets/{cdn-tab-CX4QEdwN.js → cdn-tab-YI9cEF0c.js} +1 -1
  76. package/dist/client/assets/{chart-B9GbOmAC.js → chart-Dodu1xOc.js} +1 -1
  77. package/dist/client/assets/chat-context-C0gBnrEt.js +35 -0
  78. package/dist/client/assets/{checkbox-HAQ_nhYr.js → checkbox-DnuAdak3.js} +1 -1
  79. package/dist/client/assets/{choose-editor-D3HFCFTx.js → choose-editor-z_RSHVAe.js} +1 -1
  80. package/dist/client/assets/{cli-auth-success-D2QQP4Pz.js → cli-auth-success-B04DqfZh.js} +1 -1
  81. package/dist/client/assets/{client-icons-BaBjOI1p.js → client-icons-DyKPA_If.js} +1 -1
  82. package/dist/client/assets/collection-detail-Bmgm6Xpz.js +1 -0
  83. package/dist/client/assets/{collection-display-button-BY4YA6Dx.js → collection-display-button-BjYcW4FZ.js} +1 -1
  84. package/dist/client/assets/{collection-search-BrUxTz45.js → collection-search-CDZk-ZPx.js} +1 -1
  85. package/dist/client/assets/{collection-table-wrapper-DnbZ0Kcw.js → collection-table-wrapper-CGGQrcHR.js} +1 -1
  86. package/dist/client/assets/{collection-tabs-DsyRDJCm.js → collection-tabs-D1lKbsAt.js} +1 -1
  87. package/dist/client/assets/{command-CdGnJ_4A.js → command-Ci-j3lot.js} +1 -1
  88. package/dist/client/assets/{commerce-onboarding-CWKskFIZ.js → commerce-onboarding-Q76OphjB.js} +1 -1
  89. package/dist/client/assets/{connect-BuKUuVUR.js → connect-CE0PvrLj.js} +1 -1
  90. package/dist/client/assets/{connect-layout-DrkT05cr.js → connect-layout-CmPm31Qh.js} +1 -1
  91. package/dist/client/assets/{connection-card-CB2F5qRw.js → connection-card-Cuu-NGPd.js} +1 -1
  92. package/dist/client/assets/connection-detail-CQJhxj9a.js +1 -0
  93. package/dist/client/assets/{connection-form-helpers-zpf3c404.js → connection-form-helpers-CBOILzhO.js} +1 -1
  94. package/dist/client/assets/{connection-Cdt4e_MW.js → connection-gqBIrJrp.js} +1 -1
  95. package/dist/client/assets/{connections-o8DS2PkE.js → connections-k4235kPb.js} +1 -1
  96. package/dist/client/assets/{create-organization-dialog-CAXMeKuh.js → create-organization-dialog-C3yQmz3P.js} +1 -1
  97. package/dist/client/assets/{decopilot-sse-pool-CU_zK481.js → decopilot-sse-pool-CdJPh08p.js} +1 -1
  98. package/dist/client/assets/{dialog-DMyJgxgJ.js → dialog-CWKQw2WC.js} +1 -1
  99. package/dist/client/assets/{domain-settings-DygUFpUg.js → domain-settings-BSba6mpG.js} +1 -1
  100. package/dist/client/assets/download-app-dialog-BEy2Wnzj.js +1 -0
  101. package/dist/client/assets/{drawer-DYxoRn2r.js → drawer-ClX3akJx.js} +1 -1
  102. package/dist/client/assets/{dropdown-menu-Yn3mK79I.js → dropdown-menu-DUEIZWiX.js} +1 -1
  103. package/dist/client/assets/e2e-tab-DC0rCpOL.js +1 -0
  104. package/dist/client/assets/{editor-B0bws0TS.js → editor-DeUxecc_.js} +1 -1
  105. package/dist/client/assets/{empty-state-DTBt1PEx.js → empty-state-C-9VdPkJ.js} +1 -1
  106. package/dist/client/assets/{empty-state-BxVwjQ2y.js → empty-state-DYE3rkmB.js} +1 -1
  107. package/dist/client/assets/{extract-connection-data-BJMOxVAc.js → extract-connection-data-KaTj8mHV.js} +1 -1
  108. package/dist/client/assets/file-explorer-D4SVt02z.js +2 -0
  109. package/dist/client/assets/{file-type-icon-BYEG4qUb.js → file-type-icon-CB7H_Wiy.js} +1 -1
  110. package/dist/client/assets/{folder-icon-Dhr9f8sV.js → folder-icon-C6cEeAnl.js} +1 -1
  111. package/dist/client/assets/{form-7uhYa81Z.js → form-CUXIC19o.js} +1 -1
  112. package/dist/client/assets/{general-Dfo1MRMx.js → general-DW9bVist.js} +1 -1
  113. package/dist/client/assets/github-repo-picker-9AcEQIzR.js +1 -0
  114. package/dist/client/assets/hooks-DquOZ-Xk.js +15 -0
  115. package/dist/client/assets/{hosting-tab-CPEQL5Zn.js → hosting-tab-fN4y3bIT.js} +1 -1
  116. package/dist/client/assets/{index-Bwv8rTxR.js → index-BRMuylL4.js} +1 -1
  117. package/dist/client/assets/{index-BQSq2G-I.js → index-BfWwYPwx.js} +1 -1
  118. package/dist/client/assets/{index-PqfClboL.js → index-BkawI5he.js} +3 -3
  119. package/dist/client/assets/{index-XRXk-Rxu.js → index-Cdu9R7BQ.js} +1 -1
  120. package/dist/client/assets/index-CiiXjYYX.css +1 -0
  121. package/dist/client/assets/index-CnZuejsK.js +1 -0
  122. package/dist/client/assets/index-D-9OW3Wb.js +823 -0
  123. package/dist/client/assets/{index-POPUMVNy.js → index-D821QKnk.js} +1 -1
  124. package/dist/client/assets/{index-ChsC-xtq.js → index-DGNeXmXN.js} +1 -1
  125. package/dist/client/assets/index-Dpj-HbFs.js +1 -0
  126. package/dist/client/assets/{index-DSfaX8ZJ.js → index-m6p9dAul.js} +2 -2
  127. package/dist/client/assets/{index-redirect-D3VpT043.js → index-redirect-1cfJeTJH.js} +1 -1
  128. package/dist/client/assets/{infra-billing-nit3ydE6.js → infra-billing-H5rZU-k1.js} +1 -1
  129. package/dist/client/assets/{input-D7VtAJjJ.js → input-fTgot4-g.js} +1 -1
  130. package/dist/client/assets/{integration-icon-lLjfXy11.js → integration-icon-BLOQWR7d.js} +1 -1
  131. package/dist/client/assets/{invite-member-dialog-BJIBOFoX.js → invite-member-dialog-BIgrWqr7.js} +1 -1
  132. package/dist/client/assets/{label-QKhMkhs7.js → label-CDt53aWD.js} +1 -1
  133. package/dist/client/assets/{layout-DOq1GsRD.js → layout-C_t6Nu2o.js} +1 -1
  134. package/dist/client/assets/{login-BBnes1GR.js → login-C7qvLy5B.js} +1 -1
  135. package/dist/client/assets/{markdown-Cxpdg1Ih.js → markdown-Dzj7KfMq.js} +1 -1
  136. package/dist/client/assets/{mcp-oauth-EPG_9QaY.js → mcp-oauth-PBuEj92n.js} +1 -1
  137. package/dist/client/assets/{members-BlESIwlU.js → members-D_XPbFzI.js} +1 -1
  138. package/dist/client/assets/{monaco-editor-Dh9B6hNJ.js → monaco-editor-DAtKorVX.js} +1 -1
  139. package/dist/client/assets/{monitoring-stats-row-DywkwDMi.js → monitoring-stats-row-zC9HU0u6.js} +1 -1
  140. package/dist/client/assets/{multi-select-Bz32pXhp.js → multi-select-Dnr7PAJj.js} +1 -1
  141. package/dist/client/assets/{oauth-callback-DhO6sCUj.js → oauth-callback-Cyp9j0ys.js} +1 -1
  142. package/dist/client/assets/{oauth-callback-ai-provider-DulaWBfe.js → oauth-callback-ai-provider-BkDqDLNZ.js} +1 -1
  143. package/dist/client/assets/{onboarding-ByioA-uf.js → onboarding-CvnwGB6M.js} +1 -1
  144. package/dist/client/assets/org-layout-DItAI5Di.js +1 -0
  145. package/dist/client/assets/{organization-choice-BCHO8vJQ.js → organization-choice-Brz54IKk.js} +1 -1
  146. package/dist/client/assets/{orgs-Bvnh03Bo.js → orgs-CcUI9HgJ.js} +1 -1
  147. package/dist/client/assets/{page-seo-form-Bt8Zizqh.js → page-seo-form-OTDku7Z1.js} +1 -1
  148. package/dist/client/assets/{popover-B2EbEKJC.js → popover-DjscXujA.js} +1 -1
  149. package/dist/client/assets/post-calendar-BcunQFOG.js +1 -0
  150. package/dist/client/assets/post-editor-N40xpPkk.js +1 -0
  151. package/dist/client/assets/{primitives-Bo7_tdMO.js → primitives-_Vnzju1y.js} +1 -1
  152. package/dist/client/assets/{profile-DsU0NYMZ.js → profile-B_l90EbD.js} +1 -1
  153. package/dist/client/assets/project-app-view-Dq7iYeXJ.js +1 -0
  154. package/dist/client/assets/{project-icon-B6DBvpFP.js → project-icon-D7jcmH3z.js} +1 -1
  155. package/dist/client/assets/{prompts-a208VJ3D.js → prompts-fLxWWgz-.js} +1 -1
  156. package/dist/client/assets/record-editor-Ci_NDgeT.js +1 -0
  157. package/dist/client/assets/redirect-editor-BePOP1Ph.js +1 -0
  158. package/dist/client/assets/registry-Bh5jhzbl.js +2 -0
  159. package/dist/client/assets/{registry-layout-wVidPSJE.js → registry-layout-CLY27ukG.js} +1 -1
  160. package/dist/client/assets/{reports-D6HjeWJ9.js → reports-CGghkfg_.js} +1 -1
  161. package/dist/client/assets/{require-capability-Dg6MWzmr.js → require-capability-D2jyLdx0.js} +1 -1
  162. package/dist/client/assets/{required-auth-layout-yWBNl8Cx.js → required-auth-layout-ZGcoBsTU.js} +1 -1
  163. package/dist/client/assets/{reset-password-DCP1Kpo3.js → reset-password-Dkrm3cHn.js} +1 -1
  164. package/dist/client/assets/{review-settings-BU6OU9b2.js → review-settings-DLtdjNmr.js} +1 -1
  165. package/dist/client/assets/{roles-DYdC1C9F.js → roles-CcvMkry_.js} +1 -1
  166. package/dist/client/assets/{schema-CExEiY9w.js → schema-C5E0ePqu.js} +1 -1
  167. package/dist/client/assets/{scroll-area-DWesqnEX.js → scroll-area-F200w2mh.js} +1 -1
  168. package/dist/client/assets/{search-input-DzDwGhUj.js → search-input-DJIbu8BB.js} +1 -1
  169. package/dist/client/assets/{secrets-CdlnUVmb.js → secrets-DMZxvEj_.js} +1 -1
  170. package/dist/client/assets/{sections-editor-BeCO13DA.js → sections-editor-DwiAEnZ7.js} +2 -2
  171. package/dist/client/assets/{select-fQpkdmCP.js → select-aD2SqHOW.js} +1 -1
  172. package/dist/client/assets/{select-model-B87liE0s.js → select-model-BAm7L9iK.js} +1 -1
  173. package/dist/client/assets/{self-tool-result-CI9lePBq.js → self-tool-result-j5kSv4ca.js} +1 -1
  174. package/dist/client/assets/seo-editor-Cm_lDZye.js +1 -0
  175. package/dist/client/assets/settings-layout-DLlpPiRj.js +1 -0
  176. package/dist/client/assets/{settings-sidebar-BK0qHuDP.js → settings-sidebar-CFckzuH2.js} +1 -1
  177. package/dist/client/assets/{shell-controls-CjEodxq6.js → shell-controls-B6jpfAPG.js} +1 -1
  178. package/dist/client/assets/shell-layout-BBeCMSA6.js +1 -0
  179. package/dist/client/assets/{skill-preview-JM1C9U_u.js → skill-preview-Crvic_gM.js} +1 -1
  180. package/dist/client/assets/{skills-Df3FjNOT.js → skills-CJys28KJ.js} +1 -1
  181. package/dist/client/assets/{sso-CdbC3Fg8.js → sso-BbCXtvEm.js} +1 -1
  182. package/dist/client/assets/{store-hf3sk0kY.js → store-DxhB5rKM.js} +1 -1
  183. package/dist/client/assets/store-registry-DECUw0kw.js +2 -0
  184. package/dist/client/assets/{switch-CXvibrMM.js → switch-BImv-gvt.js} +1 -1
  185. package/dist/client/assets/synced-repos-Y5DAHAzN.js +1 -0
  186. package/dist/client/assets/{table-kp1XE9dT.js → table-svMfP7N5.js} +1 -1
  187. package/dist/client/assets/{tabs-B3JjqSsa.js → tabs-DX2hIJ3b.js} +1 -1
  188. package/dist/client/assets/{task-board-Cu8abk2x.js → task-board-CU2obT3r.js} +1 -1
  189. package/dist/client/assets/task-route-DCBGrQpz.js +1 -0
  190. package/dist/client/assets/{tasks-N9V2sftX.js → tasks-g-5mQjJo.js} +1 -1
  191. package/dist/client/assets/{textarea-CiJM1au8.js → textarea-DJdAgtmk.js} +1 -1
  192. package/dist/client/assets/{toggle-group-B-2KCs2i.js → toggle-group-BtNaSJHm.js} +1 -1
  193. package/dist/client/assets/{toolbar-icon-button-DsVbEvkI.js → toolbar-icon-button-DI6yIlPy.js} +1 -1
  194. package/dist/client/assets/{toolbar-CUoJwayP.js → toolbar-kq9Y7nNF.js} +1 -1
  195. package/dist/client/assets/{track-DnpAx3e3.js → track-X0YKsDzo.js} +1 -1
  196. package/dist/client/assets/{types-ZeUbZJLS.js → types-BeDjBiKO.js} +1 -1
  197. package/dist/client/assets/{use-ai-providers-d40kZQC-.js → use-ai-providers-AGwxnFdj.js} +1 -1
  198. package/dist/client/assets/{use-automations-_m8whHp0.js → use-automations-CmwM0DEc.js} +1 -1
  199. package/dist/client/assets/{use-autosave-BIsH8JCz.js → use-autosave-lN3i2RtH.js} +1 -1
  200. package/dist/client/assets/{use-connection-amUUqPK2.js → use-connection-CsZlLbEZ.js} +1 -1
  201. package/dist/client/assets/{use-copy-24vRYGpf.js → use-copy-DHyeBoZ8.js} +1 -1
  202. package/dist/client/assets/{use-create-virtual-mcp-CZJOLPMm.js → use-create-virtual-mcp-BOvsC0DW.js} +1 -1
  203. package/dist/client/assets/{use-debounced-autosave-zxAYDFyH.js → use-debounced-autosave-8VnwrEMs.js} +1 -1
  204. package/dist/client/assets/{use-debounced-value-Bp44IQzu.js → use-debounced-value-3IbXIZAk.js} +1 -1
  205. package/dist/client/assets/{use-decopilot-events-2Ng0Wxeb.js → use-decopilot-events-WOaP0SQC.js} +1 -1
  206. package/dist/client/assets/{use-delete-connection-DcTxrCff.js → use-delete-connection-Df_yxWGf.js} +1 -1
  207. package/dist/client/assets/{use-deployment-admin-BiVz722u.js → use-deployment-admin-CMRSZLUJ.js} +1 -1
  208. package/dist/client/assets/{use-destination-route-C9WCN5J4.js → use-destination-route-B2O150Yr.js} +1 -1
  209. package/dist/client/assets/{use-file-configs-DBg-_83I.js → use-file-configs-B45QMkT9.js} +1 -1
  210. package/dist/client/assets/{use-infinite-scroll-BMWJMaLX.js → use-infinite-scroll-PS5OvGme.js} +1 -1
  211. package/dist/client/assets/{use-join-requests-Di5GolzA.js → use-join-requests-DPn5Hwkp.js} +1 -1
  212. package/dist/client/assets/{use-mcp-auth-status-8HlvMX_V.js → use-mcp-auth-status-CaPfR8Sa.js} +1 -1
  213. package/dist/client/assets/{use-mcp-client-DJ1XmaTL.js → use-mcp-client-DxE4Ab64.js} +1 -1
  214. package/dist/client/assets/{use-mcp-prompts-BsTT4HpT.js → use-mcp-prompts-BNrqL_f0.js} +1 -1
  215. package/dist/client/assets/{use-members-CH0-g0gG.js → use-members-Nvqy7Dzy.js} +1 -1
  216. package/dist/client/assets/use-navigate-to-agent-Cf-IaJUb.js +5 -0
  217. package/dist/client/assets/{use-org-auth-client-YfM297vM.js → use-org-auth-client-BR0PCT04.js} +1 -1
  218. package/dist/client/assets/{use-org-sso-BlX-8VL5.js → use-org-sso-CblCPla_.js} +1 -1
  219. package/dist/client/assets/{use-organization-roles-BpyMQI7X.js → use-organization-roles-PibAy9Wd.js} +1 -1
  220. package/dist/client/assets/{use-organization-settings-YKFwQGNn.js → use-organization-settings-BV17wl2V.js} +1 -1
  221. package/dist/client/assets/{use-panel-navigate-CIgiHkeA.js → use-panel-navigate-BG-ooS17.js} +1 -1
  222. package/dist/client/assets/{use-registry-connections-zd4c05Ap.js → use-registry-connections-CdSZH0XX.js} +1 -1
  223. package/dist/client/assets/{use-secrets-BTq66_-S.js → use-secrets-BjE52mie.js} +1 -1
  224. package/dist/client/assets/{use-section-preview-base-DqvXqLZC.js → use-section-preview-base-BmQOZ8go.js} +1 -1
  225. package/dist/client/assets/{use-status-sounds-DgQE41Lh.js → use-status-sounds-tS7pmMWO.js} +1 -1
  226. package/dist/client/assets/{use-tags-DGA6n_kJ.js → use-tags-B-KgG3zC.js} +1 -1
  227. package/dist/client/assets/{use-view-mode-DSzG493O.js → use-view-mode-DRYLjqJC.js} +1 -1
  228. package/dist/client/assets/{use-virtual-mcp-BksmT3bT.js → use-virtual-mcp-DT_fCnuE.js} +1 -1
  229. package/dist/client/assets/useInfiniteQuery-Din4IYlF.js +1 -0
  230. package/dist/client/assets/useSuspenseInfiniteQuery-BeASDmXg.js +1 -0
  231. package/dist/client/assets/{users-BPr-fuIf.js → users-ByFjNqYU.js} +1 -1
  232. package/dist/client/assets/variant-calendar-CJr-jUZm.js +1 -0
  233. package/dist/client/assets/{view-mode-toggle-C67UxAXH.js → view-mode-toggle-DTFhAaHw.js} +1 -1
  234. package/dist/client/index.html +2 -2
  235. package/dist/server/cli.js +1 -1
  236. package/dist/server/server.js +1 -1
  237. package/package.json +1 -1
  238. package/dist/client/assets/agents-list-BUPE60si.js +0 -1
  239. package/dist/client/assets/ai-providers-DmDe6Gty.js +0 -1
  240. package/dist/client/assets/api-keys-Bd9DYtgW.js +0 -1
  241. package/dist/client/assets/app-editor-BJKUCNC6.js +0 -1
  242. package/dist/client/assets/automations-nRglVV0y.js +0 -1
  243. package/dist/client/assets/category-editor-Di1MXTcN.js +0 -1
  244. package/dist/client/assets/chat-context-Cy0rls8c.js +0 -35
  245. package/dist/client/assets/collection-detail-DYHHeZVM.js +0 -1
  246. package/dist/client/assets/connection-detail-DAkCIdQD.js +0 -1
  247. package/dist/client/assets/e2e-tab-BXDm7nmf.js +0 -1
  248. package/dist/client/assets/file-explorer-t_U5CroL.js +0 -2
  249. package/dist/client/assets/github-repo-picker-EcTfqXw_.js +0 -1
  250. package/dist/client/assets/hooks-g1jnmSoE.js +0 -15
  251. package/dist/client/assets/index-jEPflMqW.js +0 -1
  252. package/dist/client/assets/index-qz9ifuG0.js +0 -1
  253. package/dist/client/assets/index-yssuKkag.css +0 -1
  254. package/dist/client/assets/index-z2239Bry.js +0 -827
  255. package/dist/client/assets/org-layout-Dvo2y_Om.js +0 -1
  256. package/dist/client/assets/post-calendar-38SpOhqM.js +0 -1
  257. package/dist/client/assets/post-editor-CVqw01s1.js +0 -1
  258. package/dist/client/assets/project-app-view-U3CUTPtn.js +0 -1
  259. package/dist/client/assets/record-editor-Bu1_BZdU.js +0 -1
  260. package/dist/client/assets/redirect-editor-Cm6r-l-h.js +0 -1
  261. package/dist/client/assets/registry-5rcVxBcm.js +0 -2
  262. package/dist/client/assets/seo-editor-CLInI0zF.js +0 -1
  263. package/dist/client/assets/settings-layout-Cp7g61nX.js +0 -1
  264. package/dist/client/assets/shell-layout-CyEhpljU.js +0 -1
  265. package/dist/client/assets/store-registry-BmzDbcKr.js +0 -2
  266. package/dist/client/assets/synced-repos-CtKGkEKp.js +0 -1
  267. package/dist/client/assets/task-route-DOCtDdvo.js +0 -1
  268. package/dist/client/assets/thread-intent-BXltPzDX.js +0 -1
  269. package/dist/client/assets/thread-route-CqJiATkn.js +0 -1
  270. package/dist/client/assets/use-mcp-tools-DrikIu-o.js +0 -1
  271. package/dist/client/assets/use-navigate-to-agent-C-nz-Qsl.js +0 -1
  272. package/dist/client/assets/useInfiniteQuery-ZaOAcalc.js +0 -1
  273. package/dist/client/assets/useSuspenseInfiniteQuery-Er-flM0P.js +0 -1
  274. package/dist/client/assets/variant-calendar-f0A7QMqN.js +0 -1
@@ -1,2 +1,2 @@
1
- import{c as st,b as Tt,r as _,l as Ne,j as n,aC as ss,a4 as wt,a1 as kt,B as Je,a2 as Dt,h as os,n as Oo,t as Y,K as Ko}from"./index-PqfClboL.js";import{b as Bo}from"./chat-context-Cy0rls8c.js";import{a7 as as,a8 as Io,a9 as Fo,aa as $o,ab as rs,N as is,O as Zt,ac as ls,ad as cs,P as us,Q as ds,ae as ms,af as zo,_ as fs,$ as ps,ag as Ho,ah as Bn,ai as Uo,aj as Go,ak as gs,G as qo,U as hs,V as Ot,Y as vs,Z as Ss,W as bs,a4 as ys,al as Wo,am as Kt,an as xs,ao as Yo,ap as Jo,aq as Qo,ar as Xo,as as Zo,d as ea,e as ta,at as na,au as sa,av as oa,aw as aa,ax as In,ay as ra,az as ia,aA as la,a2 as Wt,aB as ca,aC as ua,aD as Yt,aE as da,aF as bt,aG as At,aH as ma,aI as fa,aJ as nt,aK as Fn,aL as pa,g as ga,aM as $n,aN as ha,aO as va,aP as Ct,aQ as Jt,aR as zn,aS as Sa,aT as pn,aU as ba,aV as ht,aW as Et,aX as ya,aY as xa,aZ as _a,a_ as ja,a$ as Ea,b0 as yt,b1 as Ra,b2 as wa,b3 as ka,i as Da,b4 as Hn,b5 as Mt,b6 as Un,b7 as Gn,b8 as Ta,b9 as Va,ba as Na,bb as Pa,bc as gn,bd as qn,be as Wn,bf as Rt,bg as Qt,bh as Yn,bi as Aa,bj as hn,bk as Ca,bl as Ma,bm as La,bn as Oa,bo as Ka,bp as Ba}from"./index-z2239Bry.js";import{n as Ia,t as Fa}from"./ChevronUp-CdsnYS3o.js";import{$ as vn,ah as Sn,B as $a,F as za,z as Ha,ao as Ua,w as Ga}from"./agent-icon-72FlHM-8.js";import{i as qa}from"./ChevronRight-CiQ4250Y.js";import{i as Wa}from"./Globe01-DZmHtz0b.js";import{S as Xt}from"./scroll-area-DWesqnEX.js";import{d as Ya,h as Ja,c as Qa,e as Xa,b as Za,D as er}from"./dialog-DMyJgxgJ.js";import{I as tr}from"./input-D7VtAJjJ.js";import{P as nr,c as sr}from"./popover-B2EbEKJC.js";import{a as _s}from"./Copy01-BMb_uucS.js";import{i as Jn}from"./Settings02-CdkkNZQs.js";import{s as Qn}from"./Eye-D3-C_xXn.js";import{s as or}from"./TrendUp01-DQn6MXk1.js";import{s as bn}from"./Plus-DluN38us.js";import{s as js}from"./Trash01-BiGnC-j2.js";import{i as ar}from"./Zap-9WaWy-XB.js";import{c as Es,D as Rs,b as ws,a as vt,i as rr}from"./dropdown-menu-Yn3mK79I.js";import{s as ir}from"./safe-image-url-D5z803Ot.js";import{a as lr,P as cr,b as ur}from"./page-seo-form-Bt8Zizqh.js";import{a as dr}from"./Tool01-UNDZEmAI.js";import{u as mr,A as fr}from"./use-section-preview-base-DqvXqLZC.js";import"./use-panel-navigate-CIgiHkeA.js";import"./use-destination-route-C9WCN5J4.js";import"./thread-route-CqJiATkn.js";import"./Check-tzg1v70M.js";import"./Download01-DC7Ed5MF.js";import"./constants-DNuUCxmW.js";import"./thread-intent-BXltPzDX.js";import"./slugify-CEUa2lfQ.js";import"./hooks-g1jnmSoE.js";import"./use-mcp-client-DJ1XmaTL.js";import"./auth-CRRmnvXP.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-CU_zK481.js";import"./task-board-Cu8abk2x.js";import"./schema-CExEiY9w.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-BksmT3bT.js";import"./use-ai-providers-d40kZQC-.js";import"./location-oTTXFrSF.js";import"./use-decopilot-events-2Ng0Wxeb.js";import"./use-organization-settings-YKFwQGNn.js";import"./ArrowUp--KPYS_Zx.js";import"./automation-runs-CzvbjIvf.js";import"./useInfiniteQuery-ZaOAcalc.js";import"./use-infinite-scroll-BMWJMaLX.js";import"./use-connection-amUUqPK2.js";import"./table-kp1XE9dT.js";import"./empty-state-DTBt1PEx.js";import"./use-members-CH0-g0gG.js";import"./use-org-auth-client-YfM297vM.js";import"./AlertCircle-Bs6oknH_.js";import"./CheckCircle-8VMJtbLE.js";import"./DotsVertical-Csr6l19K.js";import"./XCircle-DpU-0ryx.js";import"./use-automations-_m8whHp0.js";import"./useSuspenseInfiniteQuery-Er-flM0P.js";import"./avatar-Br5BYZeI.js";import"./User01-C7HywlOg.js";import"./Tool02-DLBy4do6.js";import"./Stars01-BkXOAWkF.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-24vRYGpf.js";import"./markdown-Cxpdg1Ih.js";import"./ZoomOut-JTfIuUYt.js";import"./monaco-editor-Dh9B6hNJ.js";import"./editor-B0bws0TS.js";import"./types-ZeUbZJLS.js";import"./XClose-BPl5N5wQ.js";import"./Share07-CQi_kYTg.js";import"./SearchMd-Dtd4_W0w.js";import"./shell-layout-CyEhpljU.js";import"./Users03-D0VbxK_7.js";import"./project-icon-B6DBvpFP.js";import"./github-repo-COLY3wWI.js";import"./Monitor01-B8OxufXb.js";import"./command-CdGnJ_4A.js";import"./index-Bwv8rTxR.js";import"./required-auth-layout-yWBNl8Cx.js";import"./use-org-sso-BlX-8VL5.js";import"./Image01-DwIAdAUT.js";import"./LinkExternal01-ItrpBJnM.js";import"./integration-icon-lLjfXy11.js";import"./Palette-CmDDPB-1.js";import"./use-navigate-to-agent-C-nz-Qsl.js";import"./Link01-CYHfOeCn.js";import"./use-mcp-prompts-BsTT4HpT.js";import"./form-7uhYa81Z.js";import"./label-QKhMkhs7.js";import"./file-type-icon-BYEG4qUb.js";import"./drawer-DYxoRn2r.js";import"./collection-search-BrUxTz45.js";import"./use-mcp-tools-DrikIu-o.js";import"./Upload01-CEzfFT4A.js";import"./select-fQpkdmCP.js";import"./ArrowLeft-BWSnRuGm.js";import"./tabs-B3JjqSsa.js";import"./toggle-group-B-2KCs2i.js";import"./task-route-DOCtDdvo.js";import"./toolbar-icon-button-DsVbEvkI.js";import"./github-repo-picker-EcTfqXw_.js";import"./use-debounced-value-Bp44IQzu.js";import"./authenticate-and-persist-oauth-D6lfMerI.js";import"./mcp-oauth-EPG_9QaY.js";import"./extract-connection-data-BJMOxVAc.js";import"./metadata-dUsYcpuu.js";import"./connection-Cdt4e_MW.js";import"./provision-repo-scoped-github-connection-WQFARyHG.js";import"./connection-card-CB2F5qRw.js";import"./use-registry-connections-zd4c05Ap.js";import"./retry-CErkP7V6.js";import"./connection-slug-CITJ0kGN.js";import"./textarea-CiJM1au8.js";import"./UserSquare-hx_yDjx2.js";import"./connection-form-helpers-zpf3c404.js";import"./collection-tabs-DsyRDJCm.js";import"./badge-BXMUzYIE.js";import"./use-file-configs-DBg-_83I.js";import"./site-slug-uya6Wp4-.js";import"./get-initials-D-f_fDFw.js";import"./Shield01-nF6J5QH3.js";import"./select-model-B87liE0s.js";import"./checkbox-HAQ_nhYr.js";import"./ChevronSelectorVertical-BoLsghjN.js";import"./Key01-bUGu_NLF.js";import"./ai-providers-logos-DD3qZ33J.js";import"./folder-icon-Dhr9f8sV.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-DgQE41Lh.js";import"./toolbar-CUoJwayP.js";import"./GitBranch01-BBK46z_T.js";import"./Package-B1Q6V5jC.js";import"./skill-preview-JM1C9U_u.js";import"./pt-BR-CLy76QW2.js";import"./alert-dialog-DY5pueun.js";import"./Play-Cebbxrf7.js";import"./use-debounced-autosave-zxAYDFyH.js";import"./search-input-DzDwGhUj.js";import"./use-mcp-auth-status-8HlvMX_V.js";import"./switch-CXvibrMM.js";import"./Users01-DSJGRawE.js";import"./use-secrets-BTq66_-S.js";import"./client-icons-BaBjOI1p.js";import"./connect-layout-DrkT05cr.js";import"./self-tool-result-CI9lePBq.js";import"./track-DnpAx3e3.js";import"./use-tags-DGA6n_kJ.js";import"./breadcrumb-CXuS6gNw.js";import"./automation-list-row-PO_mCBtT.js";import"./site-error--i37Vnuw.js";import"./cards-O9HwAVOg.js";import"./CreditCard01-CYcMMyuv.js";import"./HardDrive-C5hOZFs-.js";import"./Sun-DqwL2RBY.js";function pr(u){return u.schema?.definitions??u.schema?.$defs??{}}function ks(u,e){const a=pr(e),d=a[btoa(u)];if(!d)return[];const p=[d];if(Array.isArray(d.allOf)){const b=d.allOf.find(x=>typeof x.$ref=="string")?.$ref;if(typeof b=="string"){const x=a[b.replace("#/definitions/","")];x&&p.push(x)}}return p}function gr(u,e){for(const a of ks(u,e)){const d=typeof a.image=="string"?a.image:void 0;if(d?.includes("{{{"))return d}}function hr(u,e){if(!e)return;const a=as(u);if(!a)return;const d=gr(a.resolveType,e);if(!d)return;const p=Io(d,a.data);if(p)return ir(p)}const vr={escape:$o};function Sr(u,e){for(const a of ks(u,e)){const d=typeof a.title=="string"?a.title:void 0;if(d?.includes("{{"))return d}}function br(u,e){if(!e)return;const a=as(u);if(a)try{const d=Sr(a.resolveType,e);return d&&Fo.render(d,a.data,{},vr).trim()||void 0}catch{return}}const yr="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",xr="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 Xn(u){return Array.from({length:u},(e,a)=>({id:crypto.randomUUID(),index:a}))}function Ds(u){return u.map((e,a)=>({...e,index:a}))}function _r(u,e){if(e===u.length)return u;if(e<u.length)return Ds(u.slice(0,e));const a=Array.from({length:e-u.length},(d,p)=>({id:crypto.randomUUID(),index:u.length+p}));return[...u,...a]}function Ts(u){const e=st.c(25),{section:a,raw:d,meta:p}=u,b=a.isSavedBlock===!0,x=a.isMultivariate===!0;let v;e[0]!==p||e[1]!==d?(v=d&&p?hr(d,p):void 0,e[0]=p,e[1]=d,e[2]=v):v=e[2];const y=v;let g;e[3]!==p||e[4]!==x||e[5]!==d||e[6]!==b?(g=d&&p&&!b&&!x?br(d,p):void 0,e[3]=p,e[4]=x,e[5]=d,e[6]=b,e[7]=g):g=e[7];const k=g;let O;e[8]===Symbol.for("react.memo_cache_sentinel")?(O=n.jsx($a,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[8]=O):O=e[8];let M;e[9]!==y?(M=y&&n.jsx("img",{src:y,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[9]=y,e[10]=M):M=e[10];let N;e[11]!==x||e[12]!==b?(N=b?{color:qo}:x?{color:"oklch(0.65 0.15 160)"}:void 0,e[11]=x,e[12]=b,e[13]=N):N=e[13];let c;e[14]!==N?(c=n.jsx(Sn,{className:"h-4 w-4 shrink-0",style:N}),e[14]=N,e[15]=c):c=e[15];const E=a.isHidden&&"line-through opacity-50";let R;e[16]!==E?(R=Ne("min-w-0 flex-1 truncate text-sm font-medium",E),e[16]=E,e[17]=R):R=e[17];const l=k??a.label;let w;e[18]!==R||e[19]!==l?(w=n.jsx("span",{className:R,children:l}),e[18]=R,e[19]=l,e[20]=w):w=e[20];let r;return e[21]!==w||e[22]!==M||e[23]!==c?(r=n.jsxs(n.Fragment,{children:[O,M,c,w]}),e[21]=w,e[22]=M,e[23]=c,e[24]=r):r=e[24],r}const jr="w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]",Er="w-0 -ml-2 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:ml-0 group-hover:w-7 group-hover:opacity-100 group-hover:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms] group-has-[:focus-visible]:ml-0 group-has-[:focus-visible]:w-7 group-has-[:focus-visible]:opacity-100 group-has-[:focus-visible]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]",Rr="w-7 ml-0 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:opacity-100 group-has-[:focus-visible]:opacity-100";function Lt(u,e){return Ne("h-7 shrink-0 overflow-hidden",e?jr:u?Rr:Er)}function Vs(u,e){const a=u.isSavedBlock===!0,d=u.isMultivariate===!0;return Ne("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":a?yr:d?gs:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function wr(u){const e=st.c(43),{section:a,raw:d,meta:p,sortableId:b,selected:x,onSelect:v,onDelete:y,onDuplicate:g,onMakeReusable:k,onToggleHidden:O,onToggleLazy:M,onAddVariant:N,onDetach:c}=u,E=Tt(),R=d?ms(d.__resolveType??""):!1,l=a.isHidden===!0,w=R||l;let r;e[0]!==a?(r=zo(a),e[0]=a,e[1]=r):r=e[1];const le=r,J=rs();let Q;e[2]!==b?(Q={id:b,animateLayoutChanges:Mr},e[2]=b,e[3]=Q):Q=e[3];const{attributes:te,listeners:m,setNodeRef:C,transform:ce,isDragging:P}=fs(Q);let Z;e[4]!==ce?(Z=ps.Transform.toString(ce?{...ce,x:0}:null),e[4]=ce,e[5]=Z):Z=e[5];const D=P?0:void 0;let ne;e[6]!==Z||e[7]!==D?(ne={transform:Z,opacity:D},e[6]=Z,e[7]=D,e[8]=ne):ne=e[8];const K=ne;let me;e[9]!==a?(me=Ho(a),e[9]=a,e[10]=me):me=e[10];const Se=me,be=_.useRef(null),U=_.useRef(!1),[ee,ye]=_.useState(null);let ae;e[11]!==te||e[12]!==m||e[13]!==J||e[14]!==ye?(ae=J?{onPointerDown:T=>{U.current=!1,be.current={x:T.clientX,y:T.clientY}},onPointerMove:T=>{const Pe=be.current;Pe&&Math.hypot(T.clientX-Pe.x,T.clientY-Pe.y)>8&&(be.current=null,U.current=!0,ye({x:T.clientX,y:T.clientY}))},onPointerUp:()=>{be.current=null}}:{...te,...m},e[11]=te,e[12]=m,e[13]=J,e[14]=ye,e[15]=ae):ae=e[15];const L=ae,qe="button",Qe=0;let xe,fe;e[16]!==v?(xe=()=>{if(U.current){U.current=!1;return}v()},fe=T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),v())},e[16]=v,e[17]=xe,e[18]=fe):(xe=e[17],fe=e[18]);const I=P?"cursor-grabbing":"cursor-pointer";let F;e[19]!==a||e[20]!==x||e[21]!==I?(F=Ne("touch-none transition-colors",I,Vs(a,x)),e[19]=a,e[20]=x,e[21]=I,e[22]=F):F=e[22];let ue;e[23]!==p||e[24]!==d||e[25]!==a?(ue=n.jsx(Ts,{section:a,raw:d,meta:p}),e[23]=p,e[24]=d,e[25]=a,e[26]=ue):ue=e[26];const pe=!J&&!a.isMultivariate&&n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx(Je,{type:"button",variant:"ghost",size:"icon","aria-label":E(R?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:Ne(Lt(w,R)),onClick:T=>{T.stopPropagation(),M()},onPointerDown:Cr,children:n.jsx(ar,{className:Ne("h-3.5 w-3.5",R&&"text-yellow-500")})})}),n.jsx(Dt,{side:"bottom",children:E(R?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),re=J?n.jsx(Bn,{children:n.jsx(Je,{type:"button",variant:"ghost",size:"icon","aria-label":E(l?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:Ne(Lt(w,l)),onClick:Ar,onPointerDown:Pr,children:l?n.jsx(Jn,{className:"h-3.5 w-3.5"}):n.jsx(Qn,{className:"h-3.5 w-3.5"})})}):n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx(Je,{type:"button",variant:"ghost",size:"icon","aria-label":E(l?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:Ne(Lt(w,l)),onClick:T=>{T.stopPropagation(),O()},onPointerDown:Nr,children:l?n.jsx(Jn,{className:"h-3.5 w-3.5"}):n.jsx(Qn,{className:"h-3.5 w-3.5"})})}),n.jsx(Dt,{side:"bottom",children:E(l?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),ge=J?n.jsx(Bn,{children:n.jsx(Je,{type:"button",variant:"ghost",size:"icon","aria-label":E("sectionsEditor.sectionList.sectionActionsMenu"),className:Ne(Lt(w,!1)),onClick:Vr,onPointerDown:Tr,children:n.jsx(vn,{className:"h-3.5 w-3.5"})})}):n.jsxs(Es,{children:[n.jsx(Rs,{asChild:!0,children:n.jsx(Je,{type:"button",variant:"ghost",size:"icon","aria-label":E("sectionsEditor.sectionList.sectionActionsMenu"),className:Ne(Lt(w,!1),"data-[state=open]:ml-0 data-[state=open]:w-7 data-[state=open]:opacity-100 data-[state=open]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]"),onClick:Dr,onPointerDown:kr,children:n.jsx(vn,{className:"h-3.5 w-3.5"})})}),n.jsxs(ws,{align:"end",className:"w-44",children:[n.jsxs(vt,{onClick:T=>{T.stopPropagation(),g()},children:[n.jsx(_s,{className:"h-4 w-4"}),E("sectionsEditor.sectionList.duplicateMenuItem")]}),le&&n.jsxs(vt,{className:Uo,onClick:T=>{T.stopPropagation(),N()},children:[n.jsx(or,{className:"h-4 w-4"}),E("sectionsEditor.sectionList.addVariantMenuItem")]}),Se&&n.jsxs(vt,{className:xr,onClick:T=>{T.stopPropagation(),k()},children:[n.jsx(Sn,{className:"h-4 w-4"}),E("sectionsEditor.sectionList.makeReusableMenuItem")]}),a.isSavedBlock===!0&&!a.isMultivariate&&n.jsxs(vt,{onClick:T=>{T.stopPropagation(),c()},children:[n.jsx(Sn,{className:"h-4 w-4"}),E("sectionsEditor.sectionList.detachMenuItem")]}),n.jsxs(vt,{className:"text-destructive focus:text-destructive",onClick:T=>{T.stopPropagation(),y()},children:[n.jsx(js,{className:"h-4 w-4"}),E("sectionsEditor.sectionList.deleteMenuItem")]})]})]});let se;e[27]!==ee||e[28]!==J||e[29]!==ye?(se=J&&n.jsxs(nr,{open:ee!==null,onOpenChange:T=>{T||ye(null)},children:[n.jsx(sr,{asChild:!0,children:n.jsx("div",{className:"pointer-events-none fixed",style:{left:ee?.x??0,top:ee?.y??0}})}),n.jsx(Go,{})]}),e[27]=ee,e[28]=J,e[29]=ye,e[30]=se):se=e[30];let he;return e[31]!==L||e[32]!==C||e[33]!==K||e[34]!==xe||e[35]!==fe||e[36]!==F||e[37]!==ue||e[38]!==pe||e[39]!==re||e[40]!==ge||e[41]!==se?(he=n.jsxs("div",{ref:C,style:K,...L,role:qe,tabIndex:Qe,onClick:xe,onKeyDown:fe,className:F,children:[ue,pe,re,ge,se]}),e[31]=L,e[32]=C,e[33]=K,e[34]=xe,e[35]=fe,e[36]=F,e[37]=ue,e[38]=pe,e[39]=re,e[40]=ge,e[41]=se,e[42]=he):he=e[42],he}function kr(u){return u.stopPropagation()}function Dr(u){return u.stopPropagation()}function Tr(u){return u.stopPropagation()}function Vr(u){return u.stopPropagation()}function Nr(u){return u.stopPropagation()}function Pr(u){return u.stopPropagation()}function Ar(u){return u.stopPropagation()}function Cr(u){return u.stopPropagation()}function Mr(){return!1}function Lr(u){const e=st.c(104),{listKey:a,rawSections:d,sections:p,meta:b,selectedIndex:x,onSelect:v,onReorder:y,onDelete:g,onDuplicate:k,onMakeReusable:O,onToggleHidden:M,onToggleLazy:N,onAddVariant:c,onDetach:E,onAddSection:R,canAddSection:l}=u,w=l===void 0?!0:l,r=Tt(),le=rs();let J;e[0]!==p.length?(J=()=>Xn(p.length),e[0]=p.length,e[1]=J):J=e[1];const[Q,te]=_.useState(J),[m,C]=_.useState(null),[ce,P]=_.useState(a),[Z,D]=_.useState(p.length),ne=_.useRef(!1);ce!==a?(P(a),D(p.length),te(Xn(p.length))):Z!==p.length&&(D(p.length),te(ke=>_r(ke,p.length)));let K;e[2]===Symbol.for("react.memo_cache_sentinel")?(K={activationConstraint:{distance:8}},e[2]=K):K=e[2];let me;e[3]===Symbol.for("react.memo_cache_sentinel")?(me={coordinateGetter:hs},e[3]=me):me=e[3];const Se=is(Zt(ds,K),Zt(us,me));let be;e[4]!==Q?(be=Q.map(Or),e[4]=Q,e[5]=be):be=e[5];const U=be;let ee;e[6]===Symbol.for("react.memo_cache_sentinel")?(ee=ke=>{C(String(ke.active.id))},e[6]=ee):ee=e[6];const ye=ee;let ae;e[7]!==U||e[8]!==y?(ae=ke=>{C(null);const{active:$,over:q}=ke;if(!q||$.id===q.id)return;const ie=U.indexOf(String($.id)),Te=U.indexOf(String(q.id));ie===-1||Te===-1||(te(ct=>Ds(Ot([...ct],ie,Te))),ne.current=!0,requestAnimationFrame(()=>{ne.current=!1}),y?.(ie,Te))},e[7]=U,e[8]=y,e[9]=ae):ae=e[9];const L=ae;let qe;e[10]===Symbol.for("react.memo_cache_sentinel")?(qe=()=>{C(null)},e[10]=qe):qe=e[10];const Qe=qe;let xe,fe,I,F,ue,pe,re,ge,se,he,T,Pe,Re,$e,ze;if(e[11]!==m||e[12]!==w||e[13]!==Q||e[14]!==U||e[15]!==L||e[16]!==b||e[17]!==R||e[18]!==c||e[19]!==g||e[20]!==E||e[21]!==k||e[22]!==O||e[23]!==v||e[24]!==M||e[25]!==N||e[26]!==d||e[27]!==p||e[28]!==x||e[29]!==Se||e[30]!==r){$e=Symbol.for("react.early_return_sentinel");e:{const ke=$=>{ne.current||v($)};if(e[46]!==m||e[47]!==w||e[48]!==Q||e[49]!==R||e[50]!==d||e[51]!==p||e[52]!==r){const $=m?Q.find(q=>q.id===m):null;if(F=$!=null?p[$.index]:null,I=$!=null?d[$.index]:void 0,Q.length===0){let q;e[56]!==r?(q=r("sectionsEditor.sectionList.noSections"),e[56]=r,e[57]=q):q=e[57];let ie;e[58]!==q?(ie=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:q}),e[58]=q,e[59]=ie):ie=e[59];const Te=!w;let ct;e[60]===Symbol.for("react.memo_cache_sentinel")?(ct=n.jsx(bn,{size:14}),e[60]=ct):ct=e[60];let _e;e[61]!==r?(_e=r("sectionsEditor.sectionList.addSectionButton"),e[61]=r,e[62]=_e):_e=e[62];let We;e[63]!==R||e[64]!==Te||e[65]!==_e?(We=n.jsxs(Je,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Te,onClick:R,children:[ct,_e]}),e[63]=R,e[64]=Te,e[65]=_e,e[66]=We):We=e[66];let Ce;e[67]!==ie||e[68]!==We?(Ce=n.jsxs("div",{className:"space-y-2",children:[ie,We]}),e[67]=ie,e[68]=We,e[69]=Ce):Ce=e[69],$e=Ce;break e}Re=Ne($&&"cursor-grabbing"),e[46]=m,e[47]=w,e[48]=Q,e[49]=R,e[50]=d,e[51]=p,e[52]=r,e[53]=I,e[54]=F,e[55]=Re}else I=e[53],F=e[54],Re=e[55];fe=vs,ge=Se,se=Ss,he=ye,T=L,Pe=Qe,xe=bs,pe=U,re=ys,ze="space-y-1",ue=Q.map($=>{const q=p[$.index];return q?n.jsx(wr,{sortableId:$.id,section:q,raw:d[$.index],meta:b,selected:x===$.index,onSelect:()=>ke($.index),onDelete:()=>g($.index),onDuplicate:()=>k($.index),onMakeReusable:()=>O($.index),onToggleHidden:()=>M($.index),onToggleLazy:()=>N($.index),onAddVariant:()=>c($.index),onDetach:()=>E($.index)},$.id):null})}e[11]=m,e[12]=w,e[13]=Q,e[14]=U,e[15]=L,e[16]=b,e[17]=R,e[18]=c,e[19]=g,e[20]=E,e[21]=k,e[22]=O,e[23]=v,e[24]=M,e[25]=N,e[26]=d,e[27]=p,e[28]=x,e[29]=Se,e[30]=r,e[31]=xe,e[32]=fe,e[33]=I,e[34]=F,e[35]=ue,e[36]=pe,e[37]=re,e[38]=ge,e[39]=se,e[40]=he,e[41]=T,e[42]=Pe,e[43]=Re,e[44]=$e,e[45]=ze}else xe=e[31],fe=e[32],I=e[33],F=e[34],ue=e[35],pe=e[36],re=e[37],ge=e[38],se=e[39],he=e[40],T=e[41],Pe=e[42],Re=e[43],$e=e[44],ze=e[45];if($e!==Symbol.for("react.early_return_sentinel"))return $e;let Le;e[70]!==ue||e[71]!==ze?(Le=n.jsx("div",{className:ze,children:ue}),e[70]=ue,e[71]=ze,e[72]=Le):Le=e[72];let oe;e[73]!==xe||e[74]!==pe||e[75]!==re||e[76]!==Le?(oe=n.jsx(xe,{items:pe,strategy:re,children:Le}),e[73]=xe,e[74]=pe,e[75]=re,e[76]=Le,e[77]=oe):oe=e[77];let He;e[78]!==I||e[79]!==F||e[80]!==b?(He=F?n.jsx("div",{className:Ne("cursor-grabbing shadow-lg ring-1 ring-border/60",Vs(F,!1)),children:n.jsx(Ts,{section:F,raw:I,meta:b})}):null,e[78]=I,e[79]=F,e[80]=b,e[81]=He):He=e[81];let Fe;e[82]!==He?(Fe=ss.createPortal(n.jsx(ls,{dropAnimation:cs,children:He}),document.body),e[82]=He,e[83]=Fe):Fe=e[83];let we;e[84]!==fe||e[85]!==ge||e[86]!==se||e[87]!==he||e[88]!==T||e[89]!==Pe||e[90]!==oe||e[91]!==Fe?(we=n.jsxs(fe,{sensors:ge,collisionDetection:se,onDragStart:he,onDragEnd:T,onDragCancel:Pe,children:[oe,Fe]}),e[84]=fe,e[85]=ge,e[86]=se,e[87]=he,e[88]=T,e[89]=Pe,e[90]=oe,e[91]=Fe,e[92]=we):we=e[92];const Oe=le||!w;let De;e[93]===Symbol.for("react.memo_cache_sentinel")?(De=n.jsx(bn,{size:14}),e[93]=De):De=e[93];let Ke;e[94]!==r?(Ke=r("sectionsEditor.sectionList.addSectionButton"),e[94]=r,e[95]=Ke):Ke=e[95];let Ae;e[96]!==R||e[97]!==Oe||e[98]!==Ke?(Ae=n.jsxs(Je,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:Oe,onClick:R,children:[De,Ke]}),e[96]=R,e[97]=Oe,e[98]=Ke,e[99]=Ae):Ae=e[99];let Ge;return e[100]!==Re||e[101]!==we||e[102]!==Ae?(Ge=n.jsxs("div",{className:Re,children:[we,Ae]}),e[100]=Re,e[101]=we,e[102]=Ae,e[103]=Ge):Ge=e[103],Ge}function Or(u){return u.id}function Zn(u){const e=st.c(57),{open:a,initialName:d,autoLabel:p,isPending:b,onSubmit:x,onOpenChange:v}=u,y=b===void 0?!1:b,g=Tt(),[k,O]=_.useState(d),[M,N]=_.useState(a);a!==M&&(N(a),a&&O(d));let c;e[0]!==y||e[1]!==v?(c=ee=>{!ee&&!y&&v(!1)},e[0]=y,e[1]=v,e[2]=c):c=e[2];const E=c;let R;e[3]!==y||e[4]!==k||e[5]!==x?(R=async ee=>{ee.preventDefault(),!y&&await x(k.trim())},e[3]=y,e[4]=k,e[5]=x,e[6]=R):R=e[6];const l=R;let w;e[7]!==g?(w=g("sectionsEditor.variantRenameDialog.title"),e[7]=g,e[8]=w):w=e[8];let r;e[9]!==w?(r=n.jsx(Ya,{children:w}),e[9]=w,e[10]=r):r=e[10];let le;e[11]!==p||e[12]!==g?(le=g("sectionsEditor.variantRenameDialog.description",{fallback:p||g("sectionsEditor.variantRenameDialog.defaultFallback")}),e[11]=p,e[12]=g,e[13]=le):le=e[13];let J;e[14]!==le?(J=n.jsx(Ja,{children:le}),e[14]=le,e[15]=J):J=e[15];let Q;e[16]!==r||e[17]!==J?(Q=n.jsxs(Qa,{children:[r,J]}),e[16]=r,e[17]=J,e[18]=Q):Q=e[18];let te;e[19]!==g?(te=g("sectionsEditor.variantRenameDialog.nameLabel"),e[19]=g,e[20]=te):te=e[20];let m;e[21]!==te?(m=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:te}),e[21]=te,e[22]=m):m=e[22];let C;e[23]===Symbol.for("react.memo_cache_sentinel")?(C=ee=>O(ee.target.value),e[23]=C):C=e[23];let ce;e[24]!==p||e[25]!==y||e[26]!==k?(ce=n.jsx(tr,{id:"variant-rename-name",value:k,onChange:C,placeholder:p,autoFocus:!0,disabled:y}),e[24]=p,e[25]=y,e[26]=k,e[27]=ce):ce=e[27];let P;e[28]!==m||e[29]!==ce?(P=n.jsxs("div",{className:"space-y-1.5 py-4",children:[m,ce]}),e[28]=m,e[29]=ce,e[30]=P):P=e[30];let Z;e[31]!==v?(Z=()=>v(!1),e[31]=v,e[32]=Z):Z=e[32];let D;e[33]!==g?(D=g("sectionsEditor.variantRenameDialog.cancel"),e[33]=g,e[34]=D):D=e[34];let ne;e[35]!==y||e[36]!==Z||e[37]!==D?(ne=n.jsx(Je,{type:"button",variant:"outline",onClick:Z,disabled:y,children:D}),e[35]=y,e[36]=Z,e[37]=D,e[38]=ne):ne=e[38];let K;e[39]!==y||e[40]!==g?(K=y?n.jsxs(n.Fragment,{children:[n.jsx(os,{className:"size-3.5"}),g("sectionsEditor.variantRenameDialog.saving")]}):g("sectionsEditor.variantRenameDialog.save"),e[39]=y,e[40]=g,e[41]=K):K=e[41];let me;e[42]!==y||e[43]!==K?(me=n.jsx(Je,{type:"submit",disabled:y,children:K}),e[42]=y,e[43]=K,e[44]=me):me=e[44];let Se;e[45]!==ne||e[46]!==me?(Se=n.jsxs(Xa,{children:[ne,me]}),e[45]=ne,e[46]=me,e[47]=Se):Se=e[47];let be;e[48]!==l||e[49]!==P||e[50]!==Se||e[51]!==Q?(be=n.jsx(Za,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:l,children:[Q,P,Se]})}),e[48]=l,e[49]=P,e[50]=Se,e[51]=Q,e[52]=be):be=e[52];let U;return e[53]!==E||e[54]!==a||e[55]!==be?(U=n.jsx(er,{open:a,onOpenChange:E,children:be}),e[53]=E,e[54]=a,e[55]=be,e[56]=U):U=e[56],U}function Ns(u){const e=st.c(5),{rule:a,matchers:d}=u,p=a?.__resolveType??"";let b;if(e[0]!==d||e[1]!==p){const g=d.find(k=>k.resolveType===p)?.iconName??Wo(p);b=za(g),e[0]=d,e[1]=p,e[2]=b}else b=e[2];const x=b;if(!x)return null;let v;return e[3]!==x?(v=n.jsx(x,{size:14,className:"shrink-0"}),e[3]=x,e[4]=v):v=e[4],v}function es(u){return u.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
2
- `)}function ts(u){return u.map((e,a)=>({id:crypto.randomUUID(),index:a,variant:e}))}function Kr(u,e){const a=new Map;for(const d of u){const p=a.get(d.variant.label);p?p.push(d):a.set(d.variant.label,[d])}return e.map((d,p)=>({id:a.get(d.label)?.shift()?.id??crypto.randomUUID(),index:p,variant:d}))}function Br(u){return u.map((e,a)=>({...e,index:a}))}function Ps(u){const e=st.c(17),{label:a,effectiveRule:d,matchers:p,canDelete:b,dragging:x,onRename:v,onDuplicate:y,onDelete:g}=u,k=Tt();let O;e[0]!==d||e[1]!==p?(O=n.jsx(Ns,{rule:d,matchers:p}),e[0]=d,e[1]=p,e[2]=O):O=e[2];let M;e[3]!==a?(M=n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:a}),e[3]=a,e[4]=M):M=e[4];let N;e[5]!==b||e[6]!==x||e[7]!==a||e[8]!==g||e[9]!==y||e[10]!==v||e[11]!==k?(N=!x&&n.jsxs(Es,{children:[n.jsx(Rs,{asChild:!0,children:n.jsx(Je,{type:"button",variant:"ghost",size:"icon","aria-label":k("sectionsEditor.pageVariantTabs.actionsAriaLabel",{label:a}),className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:Fr,onPointerDown:Ir,children:n.jsx(vn,{size:14})})}),n.jsxs(ws,{align:"end",className:"w-36",children:[n.jsxs(vt,{onClick:E=>{E.stopPropagation(),v?.()},children:[n.jsx(dr,{size:14}),k("sectionsEditor.pageVariantTabs.renameAction")]}),n.jsxs(vt,{onClick:E=>{E.stopPropagation(),y?.()},children:[n.jsx(_s,{size:14}),k("sectionsEditor.pageVariantTabs.duplicateAction")]}),n.jsx(rr,{}),n.jsxs(vt,{variant:"destructive",disabled:!b,onClick:E=>{E.stopPropagation(),g?.()},children:[n.jsx(js,{size:14}),k("sectionsEditor.pageVariantTabs.deleteAction")]})]})]}),e[5]=b,e[6]=x,e[7]=a,e[8]=g,e[9]=y,e[10]=v,e[11]=k,e[12]=N):N=e[12];let c;return e[13]!==O||e[14]!==M||e[15]!==N?(c=n.jsxs(n.Fragment,{children:[O,M,N]}),e[13]=O,e[14]=M,e[15]=N,e[16]=c):c=e[16],c}function Ir(u){return u.stopPropagation()}function Fr(u){return u.stopPropagation()}function $r(u){const e=st.c(33),{entry:a,isActive:d,canDelete:p,decofile:b,meta:x,matchers:v,onSelect:y,onRename:g,onDuplicate:k,onDelete:O}=u;let M;e[0]!==a.id?(M={id:a.id,animateLayoutChanges:zr},e[0]=a.id,e[1]=M):M=e[1];const{attributes:N,listeners:c,setNodeRef:E,transform:R,isDragging:l}=fs(M);let w;e[2]!==R?(w=ps.Transform.toString(R?{...R,x:0}:null),e[2]=R,e[3]=w):w=e[3];const r=l?0:void 0;let le;e[4]!==w||e[5]!==r?(le={transform:w,opacity:r},e[4]=w,e[5]=r,e[6]=le):le=e[6];const J=le,Q=x??void 0;let te;e[7]!==b||e[8]!==a.variant.rule||e[9]!==Q?(te=Kt(a.variant.rule,b,Q),e[7]=b,e[8]=a.variant.rule,e[9]=Q,e[10]=te):te=e[10];const m=te;let C;e[11]!==y?(C=K=>{K.target===K.currentTarget&&(K.key==="Enter"||K.key===" ")&&(K.preventDefault(),y())},e[11]=y,e[12]=C):C=e[12];const ce=l?"cursor-grabbing":"cursor-pointer active:cursor-grabbing",P=d?xs:gs;let Z;e[13]!==ce||e[14]!==P?(Z=Ne("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors touch-none",ce,P),e[13]=ce,e[14]=P,e[15]=Z):Z=e[15];let D;e[16]!==p||e[17]!==m||e[18]!==a.variant.label||e[19]!==v||e[20]!==O||e[21]!==k||e[22]!==g?(D=n.jsx(Ps,{label:a.variant.label,effectiveRule:m,matchers:v,canDelete:p,onRename:g,onDuplicate:k,onDelete:O}),e[16]=p,e[17]=m,e[18]=a.variant.label,e[19]=v,e[20]=O,e[21]=k,e[22]=g,e[23]=D):D=e[23];let ne;return e[24]!==N||e[25]!==c||e[26]!==y||e[27]!==E||e[28]!==J||e[29]!==Z||e[30]!==D||e[31]!==C?(ne=n.jsx("div",{ref:E,style:J,...N,...c,onClick:y,onKeyDown:C,className:Z,children:D}),e[24]=N,e[25]=c,e[26]=y,e[27]=E,e[28]=J,e[29]=Z,e[30]=D,e[31]=C,e[32]=ne):ne=e[32],ne}function zr(){return!1}function Hr(u){const e=st.c(9),{variant:a,decofile:d,meta:p,matchers:b}=u,x=p??void 0;let v;e[0]!==d||e[1]!==x||e[2]!==a.rule?(v=Kt(a.rule,d,x),e[0]=d,e[1]=x,e[2]=a.rule,e[3]=v):v=e[3];const y=v;let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=Ne("flex items-center gap-2 rounded-md px-2 py-2.5 shadow-lg ring-1 ring-border/60 cursor-grabbing",xs),e[4]=g):g=e[4];let k;return e[5]!==y||e[6]!==b||e[7]!==a.label?(k=n.jsx("div",{className:g,children:n.jsx(Ps,{label:a.label,effectiveRule:y,matchers:b,canDelete:!1,dragging:!0})}),e[5]=y,e[6]=b,e[7]=a.label,e[8]=k):k=e[8],k}function Ur(u){const e=st.c(91),{listKey:a,variants:d,activeIndex:p,decofile:b,meta:x,matchers:v,onSelect:y,onReorder:g,onRename:k,onDuplicate:O,onDelete:M,onAdd:N}=u,c=Tt();let E;e[0]!==d?(E=()=>ts(d),e[0]=d,e[1]=E):E=e[1];const[R,l]=_.useState(E),[w,r]=_.useState(null),[le,J]=_.useState(a),[Q,te]=_.useState(d.length);let m;e[2]!==d?(m=()=>es(d),e[2]=d,e[3]=m):m=e[3];const[C,ce]=_.useState(m),P=_.useRef(!1),Z=es(d);le!==a?(J(a),te(d.length),ce(Z),l(ts(d))):(Q!==d.length||C!==Z)&&(te(d.length),ce(Z),l(Fe=>Kr(Fe,d)));let D;e[4]===Symbol.for("react.memo_cache_sentinel")?(D={activationConstraint:{distance:8}},e[4]=D):D=e[4];let ne;e[5]===Symbol.for("react.memo_cache_sentinel")?(ne={coordinateGetter:hs},e[5]=ne):ne=e[5];const K=is(Zt(ds,D),Zt(us,ne));let me;e[6]!==R?(me=R.map(Gr),e[6]=R,e[7]=me):me=e[7];const Se=me,be=d.length>1;let U;e[8]!==R?(U=Fe=>{const we=String(Fe.active.id);r(R.find(Oe=>Oe.id===we)??null)},e[8]=R,e[9]=U):U=e[9];const ee=U;let ye;e[10]!==Se||e[11]!==g?(ye=Fe=>{r(null);const{active:we,over:Oe}=Fe;if(!Oe||we.id===Oe.id)return;const De=Se.indexOf(String(we.id)),Ke=Se.indexOf(String(Oe.id));De===-1||Ke===-1||(l(Ae=>Br(Ot([...Ae],De,Ke))),P.current=!0,requestAnimationFrame(()=>{P.current=!1}),g(De,Ke))},e[10]=Se,e[11]=g,e[12]=ye):ye=e[12];const ae=ye;let L;e[13]===Symbol.for("react.memo_cache_sentinel")?(L=()=>{r(null)},e[13]=L):L=e[13];const qe=L;let Qe,xe,fe,I,F,ue,pe,re,ge,se,he,T,Pe;if(e[14]!==p||e[15]!==be||e[16]!==b||e[17]!==R||e[18]!==Se||e[19]!==ae||e[20]!==ee||e[21]!==v||e[22]!==x||e[23]!==N||e[24]!==M||e[25]!==O||e[26]!==k||e[27]!==y||e[28]!==K||e[29]!==c){const Fe=q=>{P.current||y(q)};he="space-y-1 border-b p-2";let we;e[43]!==c?(we=c("sectionsEditor.pageVariantTabs.variantsLabel"),e[43]=c,e[44]=we):we=e[44];let Oe;e[45]!==we?(Oe=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:we}),e[45]=we,e[46]=Oe):Oe=e[46];let De;e[47]!==c?(De=c("sectionsEditor.pageVariantTabs.addVariantAriaLabel"),e[47]=c,e[48]=De):De=e[48];let Ke;e[49]===Symbol.for("react.memo_cache_sentinel")?(Ke=n.jsx(bn,{size:14}),e[49]=Ke):Ke=e[49];let Ae;e[50]!==N||e[51]!==De?(Ae=n.jsx(kt,{asChild:!0,children:n.jsx(Je,{type:"button",variant:"ghost",size:"icon","aria-label":De,className:"size-6",onClick:N,children:Ke})}),e[50]=N,e[51]=De,e[52]=Ae):Ae=e[52];let Ge;e[53]!==c?(Ge=c("sectionsEditor.pageVariantTabs.addVariantTooltip"),e[53]=c,e[54]=Ge):Ge=e[54];let ke;e[55]!==Ge?(ke=n.jsx(Dt,{children:Ge}),e[55]=Ge,e[56]=ke):ke=e[56];let $;e[57]!==Ae||e[58]!==ke?($=n.jsxs(wt,{children:[Ae,ke]}),e[57]=Ae,e[58]=ke,e[59]=$):$=e[59],e[60]!==Oe||e[61]!==$?(T=n.jsxs("div",{className:"flex items-center justify-between",children:[Oe,$]}),e[60]=Oe,e[61]=$,e[62]=T):T=e[62],xe=vs,ue=K,pe=Ss,re=ee,ge=ae,se=qe,Qe=bs,I=Se,F=ys,Pe="space-y-0.5",fe=R.map(q=>n.jsx($r,{entry:q,isActive:q.index===p,canDelete:be,decofile:b,meta:x,matchers:v,onSelect:()=>Fe(q.index),onRename:()=>k(q.index),onDuplicate:()=>O(q.index),onDelete:()=>M(q.index)},q.id)),e[14]=p,e[15]=be,e[16]=b,e[17]=R,e[18]=Se,e[19]=ae,e[20]=ee,e[21]=v,e[22]=x,e[23]=N,e[24]=M,e[25]=O,e[26]=k,e[27]=y,e[28]=K,e[29]=c,e[30]=Qe,e[31]=xe,e[32]=fe,e[33]=I,e[34]=F,e[35]=ue,e[36]=pe,e[37]=re,e[38]=ge,e[39]=se,e[40]=he,e[41]=T,e[42]=Pe}else Qe=e[30],xe=e[31],fe=e[32],I=e[33],F=e[34],ue=e[35],pe=e[36],re=e[37],ge=e[38],se=e[39],he=e[40],T=e[41],Pe=e[42];let Re;e[63]!==fe||e[64]!==Pe?(Re=n.jsx("div",{className:Pe,children:fe}),e[63]=fe,e[64]=Pe,e[65]=Re):Re=e[65];let $e;e[66]!==Qe||e[67]!==I||e[68]!==F||e[69]!==Re?($e=n.jsx(Qe,{items:I,strategy:F,children:Re}),e[66]=Qe,e[67]=I,e[68]=F,e[69]=Re,e[70]=$e):$e=e[70];let ze;e[71]!==w||e[72]!==b||e[73]!==v||e[74]!==x?(ze=w?n.jsx(Hr,{variant:w.variant,decofile:b,meta:x,matchers:v}):null,e[71]=w,e[72]=b,e[73]=v,e[74]=x,e[75]=ze):ze=e[75];let Le;e[76]!==ze?(Le=ss.createPortal(n.jsx(ls,{dropAnimation:cs,children:ze}),document.body),e[76]=ze,e[77]=Le):Le=e[77];let oe;e[78]!==xe||e[79]!==ue||e[80]!==pe||e[81]!==re||e[82]!==ge||e[83]!==se||e[84]!==$e||e[85]!==Le?(oe=n.jsxs(xe,{sensors:ue,collisionDetection:pe,onDragStart:re,onDragEnd:ge,onDragCancel:se,children:[$e,Le]}),e[78]=xe,e[79]=ue,e[80]=pe,e[81]=re,e[82]=ge,e[83]=se,e[84]=$e,e[85]=Le,e[86]=oe):oe=e[86];let He;return e[87]!==he||e[88]!==T||e[89]!==oe?(He=n.jsxs("div",{className:he,children:[T,oe]}),e[87]=he,e[88]=T,e[89]=oe,e[90]=He):He=e[90],He}function Gr(u){return u.id}function ns(u){const e=st.c(21),{currentRt:a,currentLabel:d,currentGlobalKey:p,matchers:b,globals:x,onSelect:v,onSelectGlobal:y,schema:g,formValue:k,onChange:O,formKey:M,formWrapperClassName:N,meta:c,decofile:E,onSaveReferencedBlock:R,sandbox:l}=u;let w;e[0]!==p||e[1]!==d||e[2]!==a||e[3]!==x||e[4]!==b||e[5]!==v||e[6]!==y?(w=n.jsx(Yo,{currentRt:a,currentLabel:d,currentGlobalKey:p,matchers:b,globals:x,onSelect:v,onSelectGlobal:y}),e[0]=p,e[1]=d,e[2]=a,e[3]=x,e[4]=b,e[5]=v,e[6]=y,e[7]=w):w=e[7];let r;e[8]!==E||e[9]!==M||e[10]!==k||e[11]!==N||e[12]!==c||e[13]!==O||e[14]!==R||e[15]!==l||e[16]!==g?(r=g&&k&&n.jsx("div",{className:N,children:n.jsx(Jo,{schema:g,value:k,onChange:O,meta:c,decofile:E,onSaveReferencedBlock:R,sandbox:l},M)}),e[8]=E,e[9]=M,e[10]=k,e[11]=N,e[12]=c,e[13]=O,e[14]=R,e[15]=l,e[16]=g,e[17]=r):r=e[17];let le;return e[18]!==w||e[19]!==r?(le=n.jsxs(n.Fragment,{children:[w,r]}),e[18]=w,e[19]=r,e[20]=le):le=e[20],le}function zc({orgSlug:u,virtualMcpId:e,branch:a,previewReady:d=!0,previewUrl:p,currentPath:b,activePageBlockKey:x=null,activeGlobalBlockKey:v=null,externalSelection:y,onSaved:g,initialEditSeo:k=!1,onExitSeo:O,onViewJsonFile:M,onVariantPreviewOverride:N}){const c=Tt(),E=Bo()?.taskId??null,R=d?{orgSlug:u,virtualMcpId:e,branch:a,threadId:E,previewUrl:p}:null,{data:l,isLoading:w}=Qo(R),{data:r,isLoading:le}=Xo(R),J=Zo(),Q=J?.entity?.id===e?J.entity.metadata?.siteSlug??null:null,te=mr({virtualMcpId:e,sandboxUrl:p}),[m,C]=_.useState(null),[ce,P]=_.useState(null),[Z,D]=_.useState(null),[ne,K]=_.useState(0),[me,Se]=_.useState(void 0),[be,U]=_.useState(null),[ee,ye]=_.useState(null),[ae,L]=_.useState([]),qe=_.useRef(null),[Qe,xe]=_.useState(ae.length);Qe!==ae.length&&(xe(ae.length),requestAnimationFrame(()=>{qe.current&&(qe.current.scrollTop=0)}));const[fe,I]=_.useState(0),[F,ue]=_.useState(null),[pe,re]=_.useState(null),[ge,se]=_.useState(null),[he,T]=_.useState(!0),[Pe,Re]=_.useState(!1),[$e,ze]=_.useState(!1),Le=_.useRef(null),[oe,He]=_.useState(k),[Fe,we]=_.useState(k);k&&!Fe&&(we(!0),He(!0),C(null),P(null),D(null),L([])),!k&&Fe&&we(!1);const[Oe,De]=_.useState(null),[Ke,Ae]=_.useState(void 0),[Ge,ke]=_.useState([]),[$,q]=_.useState(0),[ie,Te]=_.useState(0),[ct,_e]=_.useState(null),[We,Ce]=_.useState(null),[yn,xn]=_.useState(null),As=Oo(),Cs=`${u}/${e}/${a}`,en=ea({orgSlug:u,virtualMcpId:e,branch:a}),[Ms,Ls]=_.useState(b),[Os,Ks]=_.useState(x),[Bs,Is]=_.useState(v);(Ms!==b||Os!==x||Bs!==v)&&(queueMicrotask(()=>en.flush()),Ls(b),Ks(x),Is(v),C(null),P(null),D(null),K(0),U(null),ye(null),Te(0),_e(null),Ce(null),L([]),I(t=>t+1),He(!1),De(null),Ae(void 0),ke([]),q(t=>t+1));const je=ta({orgSlug:u,virtualMcpId:e,branch:a}),Bt=Da((t,s)=>{je.mutate({blockKey:t,data:s},{onSuccess:()=>g?.(),onError:o=>Y.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:o.message}))})}),tn=na({orgSlug:u,virtualMcpId:e,branch:a}),[Vt,It]=_.useState(!1),Be=_.useRef(null),ot=_.useRef(null),at=_.useRef(null),nn=_.useRef({}),et=_.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!d||w||le)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(os,{className:"size-5 text-muted-foreground"})});if(!l||!r)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const Fs=sa(l),Ee=!!v,Ye=Ee?null:oa(Fs,b,x),j=Ee?v:Ye?.key??null,sn=Ee&&v?l[v]:void 0,_n=Ee&&v&&sn?aa(v,sn):Ee&&v?v:"",Ft=!Ee&&j&&l[j]?l[j]:null,on=oe&&l&&r&&j&&Ye?In(l,{kind:"page",pageKey:j,pageName:String(Ye.name??""),path:String(Ye.path??"")},r):null,$s=oe?Ft?.seo:void 0,an=Ke!==void 0?Ke:$s,zs=oe?ra(an):void 0,Hs=on?.seoTypeOptions??[],Us=oe&&r?ia(r):"",jn=Oe??zs??{},rn=oe&&on?lr(jn,on):null,Gs=oe&&rn&&la(an)?Wt(rn,r):null,qs=oe?ca(l,r)?.seoData:void 0,Ue=Ee?[{label:"Default",sections:[{__resolveType:v}]}]:ua(Ft?.sections,l??{}),$t=Ue.length>1,Me=Math.min(ne,Ue.length-1),ut=Ue[Me],G=ut?.sections??[],Ie=Yt(G,l),En=!Ee&&da(Ft?.sections);if(Ee&&v&&yn!==v){xn(v);const t=G[0],s=Ie[0];if(t&&s){C(0),Te(0),L([]);const o=bt(t,s,l);o&&(P(o.data),D(o.resolveType),Ce(null),_e(null))}}!Ee&&yn!==null&&xn(null),et.current={rawSections:G,parsedSections:Ie,decofile:l??{},activePageKey:j,pageVariants:Ue,variantIndex:Me,sectionVariantIndex:ie,selectedSectionIndex:m};const Ws=()=>({multivariate:En,index:Me,variants:Ue.map(t=>({rule:t.rule}))}),Rn=(t,s)=>{if(!N)return;if(!j||!En||t.length<=1){N(null);return}const o=Yn(j,{multivariate:!0,index:s,variants:t},l,r);N(o.length>0?o:null)},xt=(t,s,o)=>{if(!N)return;if(!j){N(null);return}const i=Ws(),f=Yn(j,i,l,r);if(!t||s<0){N(f.length>0?f:null);return}const S=Aa({pageKey:j,page:i,sectionIndex:s,sectionLazy:Ie[s]?.isLazy??!1,mvObj:t,selectedVariantIndex:o,decofile:l,meta:r}),h=[...f,...S];N(h.length>0?h:null)},dt=(t,s,o,i=m??-1,f=!1)=>{const S=nt(t,s);if(!S){P(null),D(null),Ce(null),_e(null),f&&xt(null,i,o);return}const V=Fn(S,ht)[o];if(!V){P(null),D(null),Ce(null),_e(null),f&&xt(null,i,o);return}const X=ya(V.value,l);P(X?.data??null),D(X?.resolveType??null);const{resolveType:A,formValue:B}=At(V.rule,l,r??void 0);Ce(A),_e(B),f&&xt(S,i,o)},Nt=y?.index;if(y!==void 0&&(y?.seq??null)!==me&&(Se(y?.seq??null),typeof Nt=="number")){const t=G[Nt],s=Ie[Nt];if(t&&s)if(C(Nt),Te(0),L([]),I(o=>o+1),s.isMultivariate)dt(t,s,0,Nt);else{const o=bt(t,s,l);o?(P(o.data),D(o.resolveType)):(P(null),D(null)),Ce(null),_e(null)}}const zt={orgSlug:u,virtualMcpId:e,branch:a,threadId:E,previewUrl:p??void 0,siteSlug:Q},ln=Z&&r?Wt(Z,r):null,Xe=(t,s)=>{if(!j)return;Be.current&&(clearTimeout(Be.current),Be.current=null),at.current&&(clearTimeout(at.current),at.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null);const o=Mt(l,j,t,Me,Ue);je.mutate({blockKey:j,data:o},{onSuccess:()=>s?.onSuccess?.()??g?.(),onError:i=>Y.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:i.message}))})},_t=()=>{C(null),P(null),D(null),Te(0),_e(null),Ce(null),L([]),I(t=>t+1)},Ys=(t,s)=>{Be.current&&clearTimeout(Be.current);const o=et.current.sectionVariantIndex;Be.current=setTimeout(()=>{const{rawSections:i,parsedSections:f,decofile:S,activePageKey:h,pageVariants:V,variantIndex:X}=et.current,A=i[s];if(!A)return;const B=f[s];if(!B)return;if(B.isSavedBlock){const H=Ma(A,B);if(!H)return;je.mutate({blockKey:H,data:t},{onSuccess:()=>g?.(),onError:W=>Y.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:W.message}))});return}if(!h)return;const z={...S[h]},ve=[...i];if(B.isMultivariate){const H=nt(A,B);if(!H||!h)return;const W=La(H,o,t);ve[s]=yt(A,B,W)}else if(B.isHidden){const H=ms(A.__resolveType),W=H?{...A.section}:{...A},Ve=Array.isArray(W.variants)?[...W.variants]:[];Ve[0]&&(Ve[0]={...Ve[0],value:t}),W.variants=Ve,H?ve[s]={...A,section:W}:ve[s]=W}else B.isLazy?ve[s]={...A,section:t}:ve[s]=t;if(V.length>1){const H=z.sections,W=[...H?.variants??[]];W[X]&&(W[X]={...W[X],value:ve}),z.sections={...H,variants:W}}else z.sections=ve;je.mutate({blockKey:h,data:z},{onSuccess:()=>g?.(),onError:H=>Y.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:H.message}))})},hn)},Js=t=>{C(t),Te(0),L([]),I(f=>f+1);const s=G[t],o=Ie[t];if(!s||!o)return;if(o.isMultivariate){dt(s,o,0,t);return}const i=bt(s,o,l);if(!i){P(null),D(null),Ce(null),_e(null),xt(null,t,0);return}P(i.data),D(i.resolveType),Ce(null),_e(null),xt(null,t,0)},wn=t=>{const s=t;P(s),m!==null&&Ys(s,m)},cn=t=>{if(!j||!l||!r||!Ye)return;const s={kind:"page",pageKey:j,pageName:String(Ye.name??""),path:String(Ye.path??"")},o=In(l,s,r);o&&en.save(j,()=>{const i=As.getQueryData(Ko.decofile(Cs))?.[j];if(!i||typeof i!="object"||i===null||Array.isArray(i))return null;const f={...i,...nn.current};return nn.current={},t?.raw!==void 0?{...f,seo:t.raw}:t?.inner!==void 0?ur(s,o,f,t.inner):f})},Qs=(t,s)=>{j&&(nn.current[t]=s,cn())},Xs=(t,s)=>{if(!j)return;const o=Ot([...G],t,s);m!==null&&(m===t?C(s):t<m&&s>=m?C(m-1):t>m&&s<=m&&C(m+1)),Xe(o)},Zs=t=>{if(!j)return;const s=G.filter((o,i)=>i!==t);m===t?_t():m!==null&&m>t&&C(m-1),Xe(s)},eo=t=>{if(!j)return;const s=G[t];if(!s)return;const o=[...G];o.splice(t+1,0,Pa(s)),m!==null&&m>t&&C(m+1),Xe(o)},to=t=>{if(!j)return;const s=G[t],o=Ie[t];if(!s||!o)return;const i=o.isHidden?Va(s):Na(s);if(!i)return;const f=[...G];f[t]=i,m===t&&_t(),Xe(f)},no=t=>{if(!j)return;const s=G[t],o=Ie[t];if(!s||!o||o.isMultivariate)return;const i=Ta(s);if(!i)return;const f=[...G];f[t]=i,m===t&&_t(),Xe(f)},so=t=>{if(!j)return;const s=G[t],o=Ie[t];if(!s||!o?.isSavedBlock)return;const i=bt(s,o,l);if(!i?.data)return;const{name:f,...S}=i.data,h=[...G];o.isLazy?h[t]={...s,section:S}:h[t]=S,m===t&&_t(),Xe(h)},oo=t=>{if(!j)return;const s=[...G,{__resolveType:t.resolveType}],o=s.length-1;Xe(s,{onSuccess:()=>{Re(!1),C(o),Te(0),L([]),I(h=>h+1);const i=s[o],f=Yt(s,l)[o];if(!i||!f)return;if(f.isMultivariate){dt(i,f,0);return}const S=bt(i,f,l);if(!S){P(null),D(null),Ce(null),_e(null);return}P(S.data),D(S.resolveType),Ce(null),_e(null)}})},kn=t=>{Le.current=t.append,Re(!0)},ao=t=>{const s=Le.current;if(!s){oo(t);return}s({__resolveType:t.resolveType}),Re(!1),Le.current=null},ro=t=>{if(m===null)return;const s=G[m],o=Ie[m];!s||!o?.isMultivariate||(Te(t),L([]),I(i=>i+1),dt(s,o,t,m,!0))},io=t=>{if(m===null||!j)return;const s=G[m],o=Ie[m];if(!s||!o?.isMultivariate)return;const i=nt(s,o);if(!i)return;const f=wa(i,t);if(!f){Y.error(c("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const S=[...G];S[m]=yt(s,o,f);const h=f.variants;let V=ie;t===ie?V=Math.min(t,h.length-1):t<ie&&(V=ie-1),Te(V),L([]),I(X=>X+1),dt(S[m],o,V),Xe(S)},lo=t=>{if(m===null||!j)return;const s=G[m],o=Ie[m];if(!s||!o?.isMultivariate)return;const i=nt(s,o);if(!i)return;const f=ka(i,t),S=[...G];S[m]=yt(s,o,f);const h=t+1;Te(h),L([]),I(V=>V+1),dt(S[m],o,h),Xe(S)},co=(t,s)=>{if(m===null||!j||t===s)return;const o=G[m],i=Ie[m];if(!o||!i?.isMultivariate)return;const f=nt(o,i);if(!f)return;const S=Ea(f,t,s),h=[...G];h[m]=yt(o,i,S);let V=ie;ie===t?V=s:t<ie&&s>=ie?V=ie-1:t>ie&&s<=ie&&(V=ie+1),Te(V),dt(h[m],i,V),Xe(h)},un=t=>{const s=t??m;if(s===null||!j)return;const o=G[s],i=Ie[s];if(!o||!i)return;const f=xa(o,i);if(!f){Y.error(c("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const S=[...G];S[s]=f.section;const h=Yt(S,l)[s];if(!h?.isMultivariate){Y.error(c("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}C(s),Te(f.newVariantIndex),L([]),I(V=>V+1),dt(f.section,h,f.newVariantIndex,s),Xe(S)},uo=()=>{if(m===null||!j)return;const t=G[m],s=Ie[m];if(!t||!s?.isMultivariate)return;const o=nt(t,s);if(!o)return;const i=Ra(t,s,o);if(!i){Y.error(c("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const f=[...G];f[m]=i;const S=Yt(f,l)[m];if(!S)return;Te(0),Ce(null),_e(null),L([]),I(V=>V+1);const h=bt(i,S,l);h?(P(h.data),D(h.resolveType)):(P(null),D(null)),xt(null,m,0),Xe(f)},mo=async t=>{if(F===null||!j)return;const s=gn(t,l);if(s){Y.error(s);return}const o=G[F],i=Ie[F];if(!o||!i)return;const f=bt(o,i,l);if(!f){Y.error(c("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const S={...f.data,name:t};try{await je.mutateAsync({blockKey:t,data:S});const h=[...G];h[F]={__resolveType:t},await je.mutateAsync({blockKey:j,data:Mt(l,j,h,Me,Ue)}),m===F&&_t(),ue(null),Y.success(c("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),g?.()}catch(h){Y.error(h instanceof Error?h.message:c("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"))}},Dn=ut?.rule;if($t&&m===null&&ee===null&&Dn){const{resolveType:t,formValue:s}=At(Dn,l??{},r??void 0);ye(t),U(s)}const Ht=r?ma(r):[],Tn=r&&l?fa(r,l):[],fo=!Ee&&!!(te&&r&&l),po=ee&&r?Wt(ee,r):null,jt=()=>{ot.current&&(clearTimeout(ot.current),ot.current=null),at.current&&(clearTimeout(at.current),at.current=null)},Pt=async(t,s)=>{if(!(Ca(s,t,r)>0))try{await tn.mutateAsync({blockKey:t})}catch(o){Y.error(o instanceof Error?o.message:c("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"))}},Vn=t=>{ot.current&&clearTimeout(ot.current),ot.current=setTimeout(()=>{const{activePageKey:s,decofile:o,variantIndex:i}=et.current;if(!s)return;const f={...o[s]},S={...f.sections},h=[...S.variants??[]],V=h[i],X=V?.rule;if(Et(X,o,r)){const A=X?.__resolveType??"",B=o[A],z=typeof B?.name=="string"?B.name:A,{__resolveType:ve,...H}=t;je.mutate({blockKey:A,data:Rt(ve??"",H,z)},{onSuccess:()=>g?.(),onError:W=>Y.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:W.message}))});return}V&&(h[i]={...V,rule:t}),f.sections={...S,variants:h},je.mutate({blockKey:s,data:f},{onSuccess:()=>g?.(),onError:A=>Y.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:A.message}))})},hn)},go=t=>{ye(t);const s=t?Un(t,r):{__resolveType:Gn};U(t?s:{}),Vn(s)},ho=t=>{const s=t;U(s);const o=ee?{__resolveType:ee,...s}:{...s};Vn(o)},vo=async t=>{jt();const{activePageKey:s,decofile:o,variantIndex:i}=et.current;if(!s)return;const f=o[s],S=f?.sections;if(!S||typeof S!="object"||Array.isArray(S))return;const h=S;if(!Array.isArray(h.variants))return;const V=[...h.variants],X=V[i];if(!X)return;const A=Ct(X.rule,o,r),B=Qt(t);V[i]={...X,rule:B};const z={...o,[s]:{...f,sections:{...h,variants:V}}},{resolveType:ve,formValue:H}=At(B,z,r??void 0);ye(ve),U(H);try{await je.mutateAsync({blockKey:s,data:z[s]}),A&&A!==t&&await Pt(A,z),g?.()}catch(W){Y.error(W instanceof Error?W.message:c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}},Nn=t=>{at.current&&clearTimeout(at.current);const{selectedSectionIndex:s,sectionVariantIndex:o}=et.current;s!==null&&(at.current=setTimeout(()=>{const{rawSections:i,parsedSections:f,decofile:S,activePageKey:h,pageVariants:V,variantIndex:X}=et.current;if(!h)return;const A=i[s],B=f[s];if(!A||!B?.isMultivariate)return;const z=nt(A,B);if(!z)return;const H=(z.variants??[])[o]?.rule;if(Et(H,S,r)){const de=H?.__resolveType??"",Ze=S[de],it=typeof Ze?.name=="string"?Ze.name:de,{__resolveType:pt,...lt}=t;je.mutate({blockKey:de,data:Rt(pt??"",lt,it)},{onSuccess:()=>g?.(),onError:gt=>Y.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:gt.message}))});return}const W=Hn(z,o,t),Ve=[...i];Ve[s]=yt(A,B,W);const tt=Mt(S,h,Ve,X,V);je.mutate({blockKey:h,data:tt},{onSuccess:()=>g?.(),onError:de=>Y.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:de.message}))})},hn))},So=t=>{Ce(t);const s=t?Un(t,r):{__resolveType:Gn};_e(t?s:{}),Nn(s)},bo=t=>{const s=t;_e(s);const o=We?{__resolveType:We,...s}:{...s};Nn(o)},yo=async t=>{jt();const{selectedSectionIndex:s,sectionVariantIndex:o,rawSections:i,parsedSections:f,decofile:S,activePageKey:h,pageVariants:V,variantIndex:X}=et.current;if(s===null||!h)return;const A=i[s],B=f[s];if(!A||!B?.isMultivariate)return;const z=nt(A,B);if(!z)return;const ve=z.variants??[],H=Ct(ve[o]?.rule,S,r),W=Qt(t),Ve=Hn(z,o,W),tt=[...i];tt[s]=yt(A,B,Ve);const de=Mt(S,h,tt,X,V),Ze={...S,[h]:de},{resolveType:it,formValue:pt}=At(W,Ze,r??void 0);Ce(it),_e(pt);try{await je.mutateAsync({blockKey:h,data:de}),H&&H!==t&&await Pt(H,Ze),g?.()}catch(lt){Y.error(lt instanceof Error?lt.message:c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}};if(!Ee&&!Ye)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.noPageFound",{currentPath:b})});if(Ee&&!sn)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.globalBlockNotFound")});const mt=m!==null?Ie[m]??null:null,Pn=m!==null?G[m]:null,An=Pn&&mt?.isMultivariate?nt(Pn,mt):null,St=An?Fn(An,ht):[],dn=Math.min(ie,Math.max(St.length-1,0)),Ut=St[dn]??null,ft=mt?.isMultivariate===!0,Cn=m!==null&&mt!==null,Gt=Cn&&(ft||!!(ln&&ce)),xo=Gt&&!Ee&&mt?.isSavedBlock===!0,rt=Ee||xo,_o=Ee?_n:mt?.label??"",jo=We&&r?Wt(We,r):null,mn=Gt&&(!Ee||ae.length>0)?Ee?[_n,...ae]:[Ye.name,mt.label,...ft&&Ut?[Ut.label]:[],...ae]:[],Eo=oe&&Ye?[Ye.name,"SEO",...Ge]:[],qt=oe?Eo:rt?mn.length>0?mn:[_o]:mn,Ro=!oe&&!Ee&&ft&&ae.length===0,Mn=()=>{if(!j)return;jt(),Be.current&&(clearTimeout(Be.current),Be.current=null);const t=l[j],s=_a(t.sections,G);if(!s)return;const o=ja(s);je.mutate({blockKey:j,data:{...t,sections:s}},{onSuccess:()=>{K(o),C(null),P(null),D(null),L([]),U(null),ye(null)},onError:i=>Y.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:i.message}))})},fn=(t,s,o)=>{if(!j)return;jt(),Be.current&&(clearTimeout(Be.current),Be.current=null);const i=l[j],f=i.sections;if(!f||typeof f!="object"||Array.isArray(f))return;const S=f;if(!Array.isArray(S.variants))return;const h=t([...S.variants]);if(!h)return;const V=Oa(S,h),X={...l,[j]:{...i,sections:V}};je.mutate({blockKey:j,data:X[j]},{onSuccess:()=>{s?.(),o&&Pt(o,X)},onError:A=>Y.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:A.message}))})},wo=t=>{re(null),K(t),C(null),P(null),D(null),L([]);const s=Ue[t]?.rule,{resolveType:o,formValue:i}=At(s,l??{},r??void 0);ye(o),U(i),Rn(Ue.map(f=>({rule:f.rule})),t)},ko=(t,s)=>{if(t===s)return;let o=Me;Me===t?o=s:t<Me&&s>=Me?o=Me-1:t>Me&&s<=Me&&(o=Me+1),K(o);const i=Ot(Ue.map(f=>({rule:f.rule})),t,s);Rn(i,o),fn(f=>Ot(f,t,s))},Do=t=>{const s=Ue[t]?.rule,o=Ct(s,l??{},r??void 0);fn(i=>i.length<=1?null:(i.splice(t,1),i),()=>{Ue.length-1===1?K(0):t<Me?K(Me-1):t===Me&&K(Math.max(0,t-1)),C(null),P(null),D(null),L([]),U(null),ye(null)},o)},To=t=>{fn(s=>Ka(s,t),()=>{K(t+1),C(null),P(null),D(null),L([]),U(null),ye(null)})},Vo=async(t,s)=>{jt(),Be.current&&(clearTimeout(Be.current),Be.current=null);const o=et.current.activePageKey,i=et.current.decofile;if(!o)return;const f=i[o],S=f.sections;if(!S||typeof S!="object"||Array.isArray(S))return;const h=S;if(!Array.isArray(h.variants))return;const V=[...h.variants],X=V[t];if(!X?.rule||typeof X.rule!="object"){Y.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const A=X.rule,B=s.trim();It(!0);try{if(!B){if(!Et(A,i,r)){re(null);return}const tt=A.__resolveType??"";V[t]={...X,rule:qn(A,i,r)};const de={...i,[o]:{...f,sections:{...h,variants:V}}};await je.mutateAsync({blockKey:o,data:de[o]}),await Pt(tt,de),re(null),g?.();return}const z=Wn(A,i,r);if(!z){Y.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(z.blockKey){await je.mutateAsync({blockKey:z.blockKey,data:Rt(z.resolveType,z.data,B)}),re(null),g?.();return}const ve=pn(B),H=gn(ve,i);if(H){Y.error(H);return}const W=Rt(z.resolveType,z.data,B);let Ve=null;try{await je.mutateAsync({blockKey:ve,data:W}),Ve=ve,V[t]={...X,rule:Qt(ve)},await je.mutateAsync({blockKey:o,data:{...f,sections:{...h,variants:V}}}),Ve=null}catch(tt){throw Ve&&await tn.mutateAsync({blockKey:Ve}).catch(()=>{}),tt}re(null),Y.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:B})),g?.()}catch(z){Y.error(z instanceof Error?z.message:c("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{It(!1)}},No=async(t,s)=>{jt(),Be.current&&(clearTimeout(Be.current),Be.current=null);const{selectedSectionIndex:o,rawSections:i,parsedSections:f,decofile:S,activePageKey:h,pageVariants:V,variantIndex:X}=et.current;if(o===null||!h)return;const A=i[o],B=f[o];if(!A||!B?.isMultivariate)return;const z=nt(A,B);if(!z)return;const ve=z.variants??[],H=ve[t];if(!H?.rule||typeof H.rule!="object"){Y.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const W=H.rule,Ve=s.trim();It(!0);const tt=async de=>{const Ze={...z,variants:de},it=[...i];it[o]=yt(A,B,Ze);const pt=Mt(S,h,it,X,V);return await je.mutateAsync({blockKey:h,data:pt}),{...S,[h]:pt}};try{if(!Ve){if(!Et(W,S,r)){se(null);return}const gt=W.__resolveType??"",Kn=[...ve];Kn[t]={...H,rule:qn(W,S,r)};const Lo=await tt(Kn);await Pt(gt,Lo),se(null),g?.();return}const de=Wn(W,S,r);if(!de){Y.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(de.blockKey){await je.mutateAsync({blockKey:de.blockKey,data:Rt(de.resolveType,de.data,Ve)}),se(null),g?.();return}const Ze=pn(Ve),it=gn(Ze,S);if(it){Y.error(it);return}const pt=Rt(de.resolveType,de.data,Ve);let lt=null;try{await je.mutateAsync({blockKey:Ze,data:pt}),lt=Ze;const gt=[...ve];gt[t]={...H,rule:Qt(Ze)},await tt(gt),lt=null}catch(gt){throw lt&&await tn.mutateAsync({blockKey:lt}).catch(()=>{}),gt}se(null),Y.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:Ve})),g?.()}catch(de){Y.error(de instanceof Error?de.message:c("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{It(!1)}},Ln=()=>{_t()},Po=t=>{De(t),cn({inner:t})},Ao=t=>{Ae(t),cn({raw:t})},Co=()=>{De(null),ke([])},Mo=()=>q(t=>t+1),On=t=>{if(oe){if(t===0){en.flush(),He(!1),De(null),Ae(void 0),ke([]),q(o=>o+1),O?.();return}if(t===1){ke([]),q(o=>o+1);return}ke(Ge.slice(0,t-1)),q(o=>o+1);return}if(Ee){L(ae.slice(0,t)),I(o=>o+1);return}if(t===0){Ln();return}if(t===1){L([]),I(o=>o+1);return}if(ft&&t===2){L([]),I(o=>o+1);return}const s=ft?2:1;L(ae.slice(0,t-s))};return n.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[n.jsx("div",{className:"shrink-0",children:rt||Gt||oe?n.jsxs("div",{className:Ne("border-b px-3 py-2.5",rt&&"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:[qt.length>1&&n.jsx("button",{type:"button",onClick:()=>On(Ba(qt.length,{isMultivariateSectionTop:Ro})),title:c("sectionsEditor.sectionsEditor.back"),"aria-label":c("sectionsEditor.sectionsEditor.back"),className:Ne("shrink-0 inline-flex size-6 items-center justify-center rounded-md transition-colors",rt?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:n.jsx(Ha,{className:"size-4"})}),!Ee&&$t&&ut&&n.jsxs("button",{type:"button",onClick:Ln,title:c("sectionsEditor.sectionsEditor.editingInVariant",{variant:ut.label}),className:Ne("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",pa),children:[n.jsx(Ns,{rule:Kt(ut.rule,l??{},r??void 0),matchers:Ht}),n.jsx("span",{className:"max-w-[160px] truncate",children:ut.label})]}),n.jsx("nav",{"aria-label":c("sectionsEditor.sectionsEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:qt.map((t,s)=>{const o=s===qt.length-1,i=ga(t);return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[s>0&&n.jsx(qa,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>On(s),title:i,className:Ne("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",o?rt?"font-semibold text-global-section-fg dark:text-global-section-fg-dark":"font-medium text-foreground":rt?"text-foreground/80":"text-muted-foreground",rt?"hover:bg-global-section/15":"hover:bg-accent hover:text-accent-foreground"),children:i})]},`${i}-${s}`)})}),rt&&n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(Wa,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(Dt,{side:"bottom",className:"max-w-[260px]",children:c("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Cn&&!ft&&!mt?.isHidden&&j&&n.jsx($n,{onClick:()=>un()})]}),rt&&n.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:c("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):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(ha,{pageKey:j,initialName:Ye.name,initialPath:Ye.path,onFieldChange:Qs})}),n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx(Je,{type:"button",variant:"ghost",size:"icon","aria-label":c("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:()=>He(!0),children:n.jsx(Ua,{size:14})})}),n.jsx(Dt,{side:"bottom",children:c("sectionsEditor.sectionsEditor.editSeo")})]}),n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx(Je,{type:"button",variant:"ghost",size:"icon","aria-label":c("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>M&&j?M():ze(!0),children:n.jsx(Ga,{size:14})})}),n.jsx(Dt,{side:"bottom",children:c("sectionsEditor.sectionsEditor.viewJson")})]}),n.jsx($n,{onClick:Mn})]})}),oe?n.jsx(Xt,{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:Ft&&j?n.jsx(cr,{rawSeo:an,innerSeo:jn,defaultResolveType:Us,seoSchema:Gs,activeResolveType:rn,seoTypeOptions:Hs,formResetKey:$,siteDefaultSeo:qs,onBreadcrumbChange:ke,onPersistRaw:Ao,onInnerChange:Po,onClearForm:Co,onBumpFormKey:Mo}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"):Gt?n.jsxs(Xt,{viewportRef:qe,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[ft&&St.length>0&&ae.length===0&&n.jsxs(n.Fragment,{children:[n.jsx(va,{listKey:`${j??""}:${m??""}`,variants:St.map((t,s)=>({index:s,label:t.label})),selectedIndex:dn,onSelect:ro,onRename:se,onDuplicate:lo,onDelete:io,onRemoveAll:uo,onReorder:co,onAdd:()=>un()}),ft&&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:c("sectionsEditor.sectionsEditor.variantRule")}),n.jsx(ns,{currentRt:We??"",currentLabel:Jt(Ut?.rule,l??{},ht,r??void 0),currentGlobalKey:Ct(Ut?.rule,l??{},r??void 0)??void 0,matchers:Ht,globals:Tn,onSelect:So,onSelectGlobal:yo,schema:jo,formValue:ct,onChange:bo,formKey:`${m??"none"}:${dn}:${We??""}`,formWrapperClassName:"pt-1",meta:r??void 0,decofile:l,onSaveReferencedBlock:Bt,sandbox:zt})]})]}),n.jsx(zn,{activeSchema:ln,formValue:ce,formResetKey:fe,onFormChange:wn,onBreadcrumbChange:L,breadcrumbPath:ae,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:r,decofile:l,onSaveReferencedBlock:Bt,sandbox:zt,previewBaseUrl:te,onRequestAddSection:kn})]},"editor-section-form"):Ee?n.jsx(Xt,{viewportRef:qe,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(zn,{activeSchema:ln,formValue:ce,formResetKey:fe,onFormChange:wn,onBreadcrumbChange:L,breadcrumbPath:ae,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:r,decofile:l,onSaveReferencedBlock:Bt,sandbox:zt,previewBaseUrl:te,onRequestAddSection:kn})},"editor-global-block"):n.jsxs(Xt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[$t&&j&&n.jsx(Ur,{listKey:j,variants:Ue,activeIndex:Me,decofile:l??{},meta:r,matchers:Ht,onSelect:wo,onReorder:ko,onRename:re,onDuplicate:To,onDelete:Do,onAdd:Mn}),$t&&ee!==null&&n.jsxs("div",{className:Ne("px-3 border-b",he?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>T(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":he,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c("sectionsEditor.sectionsEditor.variantRule")}),he?n.jsx(Ia,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(Fa,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),he&&n.jsx("div",{className:Ne("space-y-3",Vt&&"pointer-events-none opacity-50"),children:n.jsx(ns,{currentRt:ee,currentLabel:Jt(ut?.rule,l??{},ht,r??void 0),currentGlobalKey:Ct(ut?.rule,l??{},r??void 0)??void 0,matchers:Ht,globals:Tn,onSelect:go,onSelectGlobal:vo,schema:po,formValue:be,onChange:ho,formKey:`${Me}:${ee??""}`,formWrapperClassName:"space-y-3",meta:r??void 0,decofile:l,onSaveReferencedBlock:Bt,sandbox:zt})})]}),n.jsx("div",{className:"p-2 pt-3",children:n.jsx(Lr,{listKey:`${j??""}-${Me}`,rawSections:G,sections:Ie,meta:r,selectedIndex:m,onSelect:Js,onReorder:Xs,onDelete:Zs,onDuplicate:eo,onMakeReusable:ue,onToggleHidden:to,onToggleLazy:no,onAddVariant:un,onDetach:so,onAddSection:()=>Re(!0),canAddSection:fo})})]},"editor-section-list"),n.jsx(Sa,{open:F!==null,onOpenChange:t=>{t||ue(null)},defaultBlockId:F!==null?pn(Ie[F]?.label??""):"",isPending:je.isPending,onSubmit:mo}),te&&n.jsx(fr,{open:Pe,onOpenChange:t=>{Re(t),t||(Le.current=null)},meta:r,decofile:l,previewBaseUrl:te,onSelect:ao}),$e&&j&&l&&n.jsx(ba,{open:$e,onOpenChange:ze,pageKey:j,decofile:l}),pe!==null&&n.jsx(Zn,{open:!0,initialName:Et(Ue[pe]?.rule,l??{},r??void 0)?Jt(Ue[pe]?.rule,l??{},ht,r??void 0):"",autoLabel:ht(Kt(Ue[pe]?.rule,l??{},r??void 0)),isPending:Vt,onSubmit:async t=>{await Vo(pe,t)},onOpenChange:t=>{!t&&!Vt&&re(null)}}),ge!==null&&n.jsx(Zn,{open:!0,initialName:Et(St[ge]?.rule,l??{},r??void 0)?Jt(St[ge]?.rule,l??{},ht,r??void 0):"",autoLabel:ht(Kt(St[ge]?.rule,l??{},r??void 0)),isPending:Vt,onSubmit:async t=>{await No(ge,t)},onOpenChange:t=>{!t&&!Vt&&se(null)}})]})}export{zc as SectionsEditor};
1
+ import{c as st,b as Tt,r as _,l as Ne,j as n,aB as ss,a4 as wt,a1 as kt,B as Je,a2 as Dt,h as os,n as Oo,t as Y,K as Bo}from"./index-BkawI5he.js";import{b as Ko}from"./chat-context-C0gBnrEt.js";import{a7 as as,a8 as Io,a9 as Fo,aa as $o,ab as rs,N as is,O as Zt,ac as ls,ad as cs,P as us,Q as ds,ae as ms,af as zo,_ as fs,$ as ps,ag as Ho,ah as Kn,ai as Uo,aj as Go,ak as gs,G as qo,U as hs,V as Ot,Y as vs,Z as Ss,W as bs,a4 as ys,al as Wo,am as Bt,an as xs,ao as Yo,ap as Jo,aq as Qo,ar as Xo,as as Zo,d as ea,e as ta,at as na,au as sa,av as oa,aw as aa,ax as In,ay as ra,az as ia,aA as la,a2 as Wt,aB as ca,aC as ua,aD as Yt,aE as da,aF as bt,aG as At,aH as ma,aI as fa,aJ as nt,aK as Fn,aL as pa,g as ga,aM as $n,aN as ha,aO as va,aP as Ct,aQ as Jt,aR as zn,aS as Sa,aT as pn,aU as ba,aV as ht,aW as Et,aX as ya,aY as xa,aZ as _a,a_ as ja,a$ as Ea,b0 as yt,b1 as Ra,b2 as wa,b3 as ka,i as Da,b4 as Hn,b5 as Mt,b6 as Un,b7 as Gn,b8 as Ta,b9 as Va,ba as Na,bb as Pa,bc as gn,bd as qn,be as Wn,bf as Rt,bg as Qt,bh as Yn,bi as Aa,bj as hn,bk as Ca,bl as Ma,bm as La,bn as Oa,bo as Ba,bp as Ka}from"./index-D-9OW3Wb.js";import{n as Ia,t as Fa}from"./ChevronUp-3g3WN6eT.js";import{$ as vn,ah as Sn,B as $a,F as za,z as Ha,ao as Ua,w as Ga}from"./agent-icon-Sp3pGLLY.js";import{i as qa}from"./ChevronRight-pYTAY0dL.js";import{i as Wa}from"./Globe01-g_WhroPz.js";import{S as Xt}from"./scroll-area-F200w2mh.js";import{d as Ya,h as Ja,c as Qa,e as Xa,b as Za,D as er}from"./dialog-CWKQw2WC.js";import{I as tr}from"./input-fTgot4-g.js";import{P as nr,c as sr}from"./popover-DjscXujA.js";import{a as _s}from"./Copy01-sos155fT.js";import{i as Jn}from"./Settings02-DA_70bcH.js";import{s as Qn}from"./Eye-UqfDVX8c.js";import{s as or}from"./TrendUp01-CP0vQywV.js";import{s as bn}from"./Plus-CjjCgafZ.js";import{s as js}from"./Trash01-B8XVvUnv.js";import{i as ar}from"./Zap-Bf8uxQjq.js";import{c as Es,D as Rs,b as ws,a as vt,i as rr}from"./dropdown-menu-DUEIZWiX.js";import{s as ir}from"./safe-image-url-D5z803Ot.js";import{a as lr,P as cr,b as ur}from"./page-seo-form-OTDku7Z1.js";import{a as dr}from"./Tool01-Z3QYZ79t.js";import{u as mr,A as fr}from"./use-section-preview-base-BmQOZ8go.js";import"./use-panel-navigate-BG-ooS17.js";import"./use-destination-route-B2O150Yr.js";import"./hooks-DquOZ-Xk.js";import"./constants-DNuUCxmW.js";import"./use-mcp-client-DxE4Ab64.js";import"./auth-DzRAXSGB.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-CdJPh08p.js";import"./task-board-CU2obT3r.js";import"./schema-C5E0ePqu.js";import"./slugify-CEUa2lfQ.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-DT_fCnuE.js";import"./use-ai-providers-AGwxnFdj.js";import"./location-oTTXFrSF.js";import"./use-decopilot-events-WOaP0SQC.js";import"./use-organization-settings-BV17wl2V.js";import"./ArrowUp-BSj9TnDQ.js";import"./automation-runs-Bt1_onfP.js";import"./useInfiniteQuery-Din4IYlF.js";import"./use-infinite-scroll-PS5OvGme.js";import"./use-connection-CsZlLbEZ.js";import"./table-svMfP7N5.js";import"./empty-state-C-9VdPkJ.js";import"./use-members-Nvqy7Dzy.js";import"./use-org-auth-client-BR0PCT04.js";import"./AlertCircle-Wbx84J6P.js";import"./CheckCircle-DwmOpGug.js";import"./DotsVertical-DuuOH2An.js";import"./XCircle-DlF5M8M0.js";import"./use-automations-CmwM0DEc.js";import"./useSuspenseInfiniteQuery-BeASDmXg.js";import"./avatar-B5NKRFBP.js";import"./User01-Ct0i24vv.js";import"./Tool02-BQmdN0LJ.js";import"./Stars01-izYFmAbe.js";import"./Check-AnkVYvzC.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DHyeBoZ8.js";import"./markdown-Dzj7KfMq.js";import"./Download01-DcuqUkne.js";import"./ZoomOut-fURlNFfr.js";import"./monaco-editor-DAtKorVX.js";import"./editor-DeUxecc_.js";import"./types-BeDjBiKO.js";import"./XClose-CakjP9Y8.js";import"./Share07-B_yFA1PQ.js";import"./SearchMd-CZf0Jno3.js";import"./shell-layout-BBeCMSA6.js";import"./Users03-jn24Kly8.js";import"./download-app-dialog-BEy2Wnzj.js";import"./project-icon-D7jcmH3z.js";import"./github-repo-COLY3wWI.js";import"./Monitor01-CHYJhnW7.js";import"./command-Ci-j3lot.js";import"./index-BRMuylL4.js";import"./required-auth-layout-ZGcoBsTU.js";import"./use-org-sso-CblCPla_.js";import"./Image01-BZ7eP3sg.js";import"./LinkExternal01-Ct6ls10Y.js";import"./integration-icon-BLOQWR7d.js";import"./Palette-Cwg4Tz5U.js";import"./use-navigate-to-agent-Cf-IaJUb.js";import"./Link01-Cx-fsoFK.js";import"./use-mcp-prompts-BNrqL_f0.js";import"./form-CUXIC19o.js";import"./label-CDt53aWD.js";import"./file-type-icon-CB7H_Wiy.js";import"./drawer-ClX3akJx.js";import"./collection-search-CDZk-ZPx.js";import"./Upload01-CbAoc2QM.js";import"./select-aD2SqHOW.js";import"./ArrowLeft-BJlpl6z3.js";import"./tabs-DX2hIJ3b.js";import"./toggle-group-BtNaSJHm.js";import"./task-route-DCBGrQpz.js";import"./toolbar-icon-button-DI6yIlPy.js";import"./github-repo-picker-9AcEQIzR.js";import"./use-debounced-value-3IbXIZAk.js";import"./authenticate-and-persist-oauth-B1cWso3x.js";import"./mcp-oauth-PBuEj92n.js";import"./extract-connection-data-KaTj8mHV.js";import"./metadata-dUsYcpuu.js";import"./connection-gqBIrJrp.js";import"./provision-repo-scoped-github-connection-WQFARyHG.js";import"./connection-card-Cuu-NGPd.js";import"./use-registry-connections-CdSZH0XX.js";import"./retry-CErkP7V6.js";import"./connection-slug-CITJ0kGN.js";import"./textarea-DJdAgtmk.js";import"./UserSquare-BYbdOYH9.js";import"./connection-form-helpers-CBOILzhO.js";import"./collection-tabs-D1lKbsAt.js";import"./badge-BmwbVsh5.js";import"./use-file-configs-B45QMkT9.js";import"./site-slug-uya6Wp4-.js";import"./get-initials-D-f_fDFw.js";import"./Shield01-P1rLU6cR.js";import"./select-model-BAm7L9iK.js";import"./checkbox-DnuAdak3.js";import"./ChevronSelectorVertical-BbsmXbxd.js";import"./Key01-ladeKbIs.js";import"./ai-providers-logos-DD3qZ33J.js";import"./folder-icon-C6cEeAnl.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-tS7pmMWO.js";import"./toolbar-kq9Y7nNF.js";import"./GitBranch01-DLsJ2eA8.js";import"./Package-DlB0zfSe.js";import"./skill-preview-Crvic_gM.js";import"./pt-BR-CLy76QW2.js";import"./alert-dialog-Cj0fNCkE.js";import"./Play-CNXxnEyG.js";import"./use-debounced-autosave-8VnwrEMs.js";import"./search-input-DJIbu8BB.js";import"./use-mcp-auth-status-CaPfR8Sa.js";import"./switch-BImv-gvt.js";import"./Users01-BYaxTYGQ.js";import"./use-secrets-BjE52mie.js";import"./client-icons-DyKPA_If.js";import"./connect-layout-CmPm31Qh.js";import"./self-tool-result-j5kSv4ca.js";import"./track-X0YKsDzo.js";import"./use-tags-B-KgG3zC.js";import"./breadcrumb-B_bU6eJc.js";import"./automation-list-row-BR_7Wuv2.js";import"./site-error--i37Vnuw.js";import"./cards-D4AMs5hh.js";import"./CreditCard01-VG7XqKoo.js";import"./HardDrive-DZFCo6aQ.js";import"./Sun-DwCUi13i.js";function pr(u){return u.schema?.definitions??u.schema?.$defs??{}}function ks(u,e){const a=pr(e),d=a[btoa(u)];if(!d)return[];const p=[d];if(Array.isArray(d.allOf)){const b=d.allOf.find(x=>typeof x.$ref=="string")?.$ref;if(typeof b=="string"){const x=a[b.replace("#/definitions/","")];x&&p.push(x)}}return p}function gr(u,e){for(const a of ks(u,e)){const d=typeof a.image=="string"?a.image:void 0;if(d?.includes("{{{"))return d}}function hr(u,e){if(!e)return;const a=as(u);if(!a)return;const d=gr(a.resolveType,e);if(!d)return;const p=Io(d,a.data);if(p)return ir(p)}const vr={escape:$o};function Sr(u,e){for(const a of ks(u,e)){const d=typeof a.title=="string"?a.title:void 0;if(d?.includes("{{"))return d}}function br(u,e){if(!e)return;const a=as(u);if(a)try{const d=Sr(a.resolveType,e);return d&&Fo.render(d,a.data,{},vr).trim()||void 0}catch{return}}const yr="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",xr="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 Xn(u){return Array.from({length:u},(e,a)=>({id:crypto.randomUUID(),index:a}))}function Ds(u){return u.map((e,a)=>({...e,index:a}))}function _r(u,e){if(e===u.length)return u;if(e<u.length)return Ds(u.slice(0,e));const a=Array.from({length:e-u.length},(d,p)=>({id:crypto.randomUUID(),index:u.length+p}));return[...u,...a]}function Ts(u){const e=st.c(25),{section:a,raw:d,meta:p}=u,b=a.isSavedBlock===!0,x=a.isMultivariate===!0;let v;e[0]!==p||e[1]!==d?(v=d&&p?hr(d,p):void 0,e[0]=p,e[1]=d,e[2]=v):v=e[2];const y=v;let g;e[3]!==p||e[4]!==x||e[5]!==d||e[6]!==b?(g=d&&p&&!b&&!x?br(d,p):void 0,e[3]=p,e[4]=x,e[5]=d,e[6]=b,e[7]=g):g=e[7];const k=g;let O;e[8]===Symbol.for("react.memo_cache_sentinel")?(O=n.jsx($a,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[8]=O):O=e[8];let M;e[9]!==y?(M=y&&n.jsx("img",{src:y,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[9]=y,e[10]=M):M=e[10];let N;e[11]!==x||e[12]!==b?(N=b?{color:qo}:x?{color:"oklch(0.65 0.15 160)"}:void 0,e[11]=x,e[12]=b,e[13]=N):N=e[13];let c;e[14]!==N?(c=n.jsx(Sn,{className:"h-4 w-4 shrink-0",style:N}),e[14]=N,e[15]=c):c=e[15];const E=a.isHidden&&"line-through opacity-50";let R;e[16]!==E?(R=Ne("min-w-0 flex-1 truncate text-sm font-medium",E),e[16]=E,e[17]=R):R=e[17];const l=k??a.label;let w;e[18]!==R||e[19]!==l?(w=n.jsx("span",{className:R,children:l}),e[18]=R,e[19]=l,e[20]=w):w=e[20];let r;return e[21]!==w||e[22]!==M||e[23]!==c?(r=n.jsxs(n.Fragment,{children:[O,M,c,w]}),e[21]=w,e[22]=M,e[23]=c,e[24]=r):r=e[24],r}const jr="w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]",Er="w-0 -ml-2 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:ml-0 group-hover:w-7 group-hover:opacity-100 group-hover:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms] group-has-[:focus-visible]:ml-0 group-has-[:focus-visible]:w-7 group-has-[:focus-visible]:opacity-100 group-has-[:focus-visible]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]",Rr="w-7 ml-0 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:opacity-100 group-has-[:focus-visible]:opacity-100";function Lt(u,e){return Ne("h-7 shrink-0 overflow-hidden",e?jr:u?Rr:Er)}function Vs(u,e){const a=u.isSavedBlock===!0,d=u.isMultivariate===!0;return Ne("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":a?yr:d?gs:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function wr(u){const e=st.c(43),{section:a,raw:d,meta:p,sortableId:b,selected:x,onSelect:v,onDelete:y,onDuplicate:g,onMakeReusable:k,onToggleHidden:O,onToggleLazy:M,onAddVariant:N,onDetach:c}=u,E=Tt(),R=d?ms(d.__resolveType??""):!1,l=a.isHidden===!0,w=R||l;let r;e[0]!==a?(r=zo(a),e[0]=a,e[1]=r):r=e[1];const le=r,J=rs();let Q;e[2]!==b?(Q={id:b,animateLayoutChanges:Mr},e[2]=b,e[3]=Q):Q=e[3];const{attributes:te,listeners:m,setNodeRef:C,transform:ce,isDragging:P}=fs(Q);let Z;e[4]!==ce?(Z=ps.Transform.toString(ce?{...ce,x:0}:null),e[4]=ce,e[5]=Z):Z=e[5];const D=P?0:void 0;let ne;e[6]!==Z||e[7]!==D?(ne={transform:Z,opacity:D},e[6]=Z,e[7]=D,e[8]=ne):ne=e[8];const B=ne;let me;e[9]!==a?(me=Ho(a),e[9]=a,e[10]=me):me=e[10];const Se=me,be=_.useRef(null),U=_.useRef(!1),[ee,ye]=_.useState(null);let ae;e[11]!==te||e[12]!==m||e[13]!==J||e[14]!==ye?(ae=J?{onPointerDown:T=>{U.current=!1,be.current={x:T.clientX,y:T.clientY}},onPointerMove:T=>{const Pe=be.current;Pe&&Math.hypot(T.clientX-Pe.x,T.clientY-Pe.y)>8&&(be.current=null,U.current=!0,ye({x:T.clientX,y:T.clientY}))},onPointerUp:()=>{be.current=null}}:{...te,...m},e[11]=te,e[12]=m,e[13]=J,e[14]=ye,e[15]=ae):ae=e[15];const L=ae,qe="button",Qe=0;let xe,fe;e[16]!==v?(xe=()=>{if(U.current){U.current=!1;return}v()},fe=T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),v())},e[16]=v,e[17]=xe,e[18]=fe):(xe=e[17],fe=e[18]);const I=P?"cursor-grabbing":"cursor-pointer";let F;e[19]!==a||e[20]!==x||e[21]!==I?(F=Ne("touch-none transition-colors",I,Vs(a,x)),e[19]=a,e[20]=x,e[21]=I,e[22]=F):F=e[22];let ue;e[23]!==p||e[24]!==d||e[25]!==a?(ue=n.jsx(Ts,{section:a,raw:d,meta:p}),e[23]=p,e[24]=d,e[25]=a,e[26]=ue):ue=e[26];const pe=!J&&!a.isMultivariate&&n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx(Je,{type:"button",variant:"ghost",size:"icon","aria-label":E(R?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:Ne(Lt(w,R)),onClick:T=>{T.stopPropagation(),M()},onPointerDown:Cr,children:n.jsx(ar,{className:Ne("h-3.5 w-3.5",R&&"text-yellow-500")})})}),n.jsx(Dt,{side:"bottom",children:E(R?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),re=J?n.jsx(Kn,{children:n.jsx(Je,{type:"button",variant:"ghost",size:"icon","aria-label":E(l?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:Ne(Lt(w,l)),onClick:Ar,onPointerDown:Pr,children:l?n.jsx(Jn,{className:"h-3.5 w-3.5"}):n.jsx(Qn,{className:"h-3.5 w-3.5"})})}):n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx(Je,{type:"button",variant:"ghost",size:"icon","aria-label":E(l?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:Ne(Lt(w,l)),onClick:T=>{T.stopPropagation(),O()},onPointerDown:Nr,children:l?n.jsx(Jn,{className:"h-3.5 w-3.5"}):n.jsx(Qn,{className:"h-3.5 w-3.5"})})}),n.jsx(Dt,{side:"bottom",children:E(l?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),ge=J?n.jsx(Kn,{children:n.jsx(Je,{type:"button",variant:"ghost",size:"icon","aria-label":E("sectionsEditor.sectionList.sectionActionsMenu"),className:Ne(Lt(w,!1)),onClick:Vr,onPointerDown:Tr,children:n.jsx(vn,{className:"h-3.5 w-3.5"})})}):n.jsxs(Es,{children:[n.jsx(Rs,{asChild:!0,children:n.jsx(Je,{type:"button",variant:"ghost",size:"icon","aria-label":E("sectionsEditor.sectionList.sectionActionsMenu"),className:Ne(Lt(w,!1),"data-[state=open]:ml-0 data-[state=open]:w-7 data-[state=open]:opacity-100 data-[state=open]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]"),onClick:Dr,onPointerDown:kr,children:n.jsx(vn,{className:"h-3.5 w-3.5"})})}),n.jsxs(ws,{align:"end",className:"w-44",children:[n.jsxs(vt,{onClick:T=>{T.stopPropagation(),g()},children:[n.jsx(_s,{className:"h-4 w-4"}),E("sectionsEditor.sectionList.duplicateMenuItem")]}),le&&n.jsxs(vt,{className:Uo,onClick:T=>{T.stopPropagation(),N()},children:[n.jsx(or,{className:"h-4 w-4"}),E("sectionsEditor.sectionList.addVariantMenuItem")]}),Se&&n.jsxs(vt,{className:xr,onClick:T=>{T.stopPropagation(),k()},children:[n.jsx(Sn,{className:"h-4 w-4"}),E("sectionsEditor.sectionList.makeReusableMenuItem")]}),a.isSavedBlock===!0&&!a.isMultivariate&&n.jsxs(vt,{onClick:T=>{T.stopPropagation(),c()},children:[n.jsx(Sn,{className:"h-4 w-4"}),E("sectionsEditor.sectionList.detachMenuItem")]}),n.jsxs(vt,{className:"text-destructive focus:text-destructive",onClick:T=>{T.stopPropagation(),y()},children:[n.jsx(js,{className:"h-4 w-4"}),E("sectionsEditor.sectionList.deleteMenuItem")]})]})]});let se;e[27]!==ee||e[28]!==J||e[29]!==ye?(se=J&&n.jsxs(nr,{open:ee!==null,onOpenChange:T=>{T||ye(null)},children:[n.jsx(sr,{asChild:!0,children:n.jsx("div",{className:"pointer-events-none fixed",style:{left:ee?.x??0,top:ee?.y??0}})}),n.jsx(Go,{})]}),e[27]=ee,e[28]=J,e[29]=ye,e[30]=se):se=e[30];let he;return e[31]!==L||e[32]!==C||e[33]!==B||e[34]!==xe||e[35]!==fe||e[36]!==F||e[37]!==ue||e[38]!==pe||e[39]!==re||e[40]!==ge||e[41]!==se?(he=n.jsxs("div",{ref:C,style:B,...L,role:qe,tabIndex:Qe,onClick:xe,onKeyDown:fe,className:F,children:[ue,pe,re,ge,se]}),e[31]=L,e[32]=C,e[33]=B,e[34]=xe,e[35]=fe,e[36]=F,e[37]=ue,e[38]=pe,e[39]=re,e[40]=ge,e[41]=se,e[42]=he):he=e[42],he}function kr(u){return u.stopPropagation()}function Dr(u){return u.stopPropagation()}function Tr(u){return u.stopPropagation()}function Vr(u){return u.stopPropagation()}function Nr(u){return u.stopPropagation()}function Pr(u){return u.stopPropagation()}function Ar(u){return u.stopPropagation()}function Cr(u){return u.stopPropagation()}function Mr(){return!1}function Lr(u){const e=st.c(104),{listKey:a,rawSections:d,sections:p,meta:b,selectedIndex:x,onSelect:v,onReorder:y,onDelete:g,onDuplicate:k,onMakeReusable:O,onToggleHidden:M,onToggleLazy:N,onAddVariant:c,onDetach:E,onAddSection:R,canAddSection:l}=u,w=l===void 0?!0:l,r=Tt(),le=rs();let J;e[0]!==p.length?(J=()=>Xn(p.length),e[0]=p.length,e[1]=J):J=e[1];const[Q,te]=_.useState(J),[m,C]=_.useState(null),[ce,P]=_.useState(a),[Z,D]=_.useState(p.length),ne=_.useRef(!1);ce!==a?(P(a),D(p.length),te(Xn(p.length))):Z!==p.length&&(D(p.length),te(ke=>_r(ke,p.length)));let B;e[2]===Symbol.for("react.memo_cache_sentinel")?(B={activationConstraint:{distance:8}},e[2]=B):B=e[2];let me;e[3]===Symbol.for("react.memo_cache_sentinel")?(me={coordinateGetter:hs},e[3]=me):me=e[3];const Se=is(Zt(ds,B),Zt(us,me));let be;e[4]!==Q?(be=Q.map(Or),e[4]=Q,e[5]=be):be=e[5];const U=be;let ee;e[6]===Symbol.for("react.memo_cache_sentinel")?(ee=ke=>{C(String(ke.active.id))},e[6]=ee):ee=e[6];const ye=ee;let ae;e[7]!==U||e[8]!==y?(ae=ke=>{C(null);const{active:$,over:q}=ke;if(!q||$.id===q.id)return;const ie=U.indexOf(String($.id)),Te=U.indexOf(String(q.id));ie===-1||Te===-1||(te(ct=>Ds(Ot([...ct],ie,Te))),ne.current=!0,requestAnimationFrame(()=>{ne.current=!1}),y?.(ie,Te))},e[7]=U,e[8]=y,e[9]=ae):ae=e[9];const L=ae;let qe;e[10]===Symbol.for("react.memo_cache_sentinel")?(qe=()=>{C(null)},e[10]=qe):qe=e[10];const Qe=qe;let xe,fe,I,F,ue,pe,re,ge,se,he,T,Pe,Re,$e,ze;if(e[11]!==m||e[12]!==w||e[13]!==Q||e[14]!==U||e[15]!==L||e[16]!==b||e[17]!==R||e[18]!==c||e[19]!==g||e[20]!==E||e[21]!==k||e[22]!==O||e[23]!==v||e[24]!==M||e[25]!==N||e[26]!==d||e[27]!==p||e[28]!==x||e[29]!==Se||e[30]!==r){$e=Symbol.for("react.early_return_sentinel");e:{const ke=$=>{ne.current||v($)};if(e[46]!==m||e[47]!==w||e[48]!==Q||e[49]!==R||e[50]!==d||e[51]!==p||e[52]!==r){const $=m?Q.find(q=>q.id===m):null;if(F=$!=null?p[$.index]:null,I=$!=null?d[$.index]:void 0,Q.length===0){let q;e[56]!==r?(q=r("sectionsEditor.sectionList.noSections"),e[56]=r,e[57]=q):q=e[57];let ie;e[58]!==q?(ie=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:q}),e[58]=q,e[59]=ie):ie=e[59];const Te=!w;let ct;e[60]===Symbol.for("react.memo_cache_sentinel")?(ct=n.jsx(bn,{size:14}),e[60]=ct):ct=e[60];let _e;e[61]!==r?(_e=r("sectionsEditor.sectionList.addSectionButton"),e[61]=r,e[62]=_e):_e=e[62];let We;e[63]!==R||e[64]!==Te||e[65]!==_e?(We=n.jsxs(Je,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Te,onClick:R,children:[ct,_e]}),e[63]=R,e[64]=Te,e[65]=_e,e[66]=We):We=e[66];let Ce;e[67]!==ie||e[68]!==We?(Ce=n.jsxs("div",{className:"space-y-2",children:[ie,We]}),e[67]=ie,e[68]=We,e[69]=Ce):Ce=e[69],$e=Ce;break e}Re=Ne($&&"cursor-grabbing"),e[46]=m,e[47]=w,e[48]=Q,e[49]=R,e[50]=d,e[51]=p,e[52]=r,e[53]=I,e[54]=F,e[55]=Re}else I=e[53],F=e[54],Re=e[55];fe=vs,ge=Se,se=Ss,he=ye,T=L,Pe=Qe,xe=bs,pe=U,re=ys,ze="space-y-1",ue=Q.map($=>{const q=p[$.index];return q?n.jsx(wr,{sortableId:$.id,section:q,raw:d[$.index],meta:b,selected:x===$.index,onSelect:()=>ke($.index),onDelete:()=>g($.index),onDuplicate:()=>k($.index),onMakeReusable:()=>O($.index),onToggleHidden:()=>M($.index),onToggleLazy:()=>N($.index),onAddVariant:()=>c($.index),onDetach:()=>E($.index)},$.id):null})}e[11]=m,e[12]=w,e[13]=Q,e[14]=U,e[15]=L,e[16]=b,e[17]=R,e[18]=c,e[19]=g,e[20]=E,e[21]=k,e[22]=O,e[23]=v,e[24]=M,e[25]=N,e[26]=d,e[27]=p,e[28]=x,e[29]=Se,e[30]=r,e[31]=xe,e[32]=fe,e[33]=I,e[34]=F,e[35]=ue,e[36]=pe,e[37]=re,e[38]=ge,e[39]=se,e[40]=he,e[41]=T,e[42]=Pe,e[43]=Re,e[44]=$e,e[45]=ze}else xe=e[31],fe=e[32],I=e[33],F=e[34],ue=e[35],pe=e[36],re=e[37],ge=e[38],se=e[39],he=e[40],T=e[41],Pe=e[42],Re=e[43],$e=e[44],ze=e[45];if($e!==Symbol.for("react.early_return_sentinel"))return $e;let Le;e[70]!==ue||e[71]!==ze?(Le=n.jsx("div",{className:ze,children:ue}),e[70]=ue,e[71]=ze,e[72]=Le):Le=e[72];let oe;e[73]!==xe||e[74]!==pe||e[75]!==re||e[76]!==Le?(oe=n.jsx(xe,{items:pe,strategy:re,children:Le}),e[73]=xe,e[74]=pe,e[75]=re,e[76]=Le,e[77]=oe):oe=e[77];let He;e[78]!==I||e[79]!==F||e[80]!==b?(He=F?n.jsx("div",{className:Ne("cursor-grabbing shadow-lg ring-1 ring-border/60",Vs(F,!1)),children:n.jsx(Ts,{section:F,raw:I,meta:b})}):null,e[78]=I,e[79]=F,e[80]=b,e[81]=He):He=e[81];let Fe;e[82]!==He?(Fe=ss.createPortal(n.jsx(ls,{dropAnimation:cs,children:He}),document.body),e[82]=He,e[83]=Fe):Fe=e[83];let we;e[84]!==fe||e[85]!==ge||e[86]!==se||e[87]!==he||e[88]!==T||e[89]!==Pe||e[90]!==oe||e[91]!==Fe?(we=n.jsxs(fe,{sensors:ge,collisionDetection:se,onDragStart:he,onDragEnd:T,onDragCancel:Pe,children:[oe,Fe]}),e[84]=fe,e[85]=ge,e[86]=se,e[87]=he,e[88]=T,e[89]=Pe,e[90]=oe,e[91]=Fe,e[92]=we):we=e[92];const Oe=le||!w;let De;e[93]===Symbol.for("react.memo_cache_sentinel")?(De=n.jsx(bn,{size:14}),e[93]=De):De=e[93];let Be;e[94]!==r?(Be=r("sectionsEditor.sectionList.addSectionButton"),e[94]=r,e[95]=Be):Be=e[95];let Ae;e[96]!==R||e[97]!==Oe||e[98]!==Be?(Ae=n.jsxs(Je,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:Oe,onClick:R,children:[De,Be]}),e[96]=R,e[97]=Oe,e[98]=Be,e[99]=Ae):Ae=e[99];let Ge;return e[100]!==Re||e[101]!==we||e[102]!==Ae?(Ge=n.jsxs("div",{className:Re,children:[we,Ae]}),e[100]=Re,e[101]=we,e[102]=Ae,e[103]=Ge):Ge=e[103],Ge}function Or(u){return u.id}function Zn(u){const e=st.c(57),{open:a,initialName:d,autoLabel:p,isPending:b,onSubmit:x,onOpenChange:v}=u,y=b===void 0?!1:b,g=Tt(),[k,O]=_.useState(d),[M,N]=_.useState(a);a!==M&&(N(a),a&&O(d));let c;e[0]!==y||e[1]!==v?(c=ee=>{!ee&&!y&&v(!1)},e[0]=y,e[1]=v,e[2]=c):c=e[2];const E=c;let R;e[3]!==y||e[4]!==k||e[5]!==x?(R=async ee=>{ee.preventDefault(),!y&&await x(k.trim())},e[3]=y,e[4]=k,e[5]=x,e[6]=R):R=e[6];const l=R;let w;e[7]!==g?(w=g("sectionsEditor.variantRenameDialog.title"),e[7]=g,e[8]=w):w=e[8];let r;e[9]!==w?(r=n.jsx(Ya,{children:w}),e[9]=w,e[10]=r):r=e[10];let le;e[11]!==p||e[12]!==g?(le=g("sectionsEditor.variantRenameDialog.description",{fallback:p||g("sectionsEditor.variantRenameDialog.defaultFallback")}),e[11]=p,e[12]=g,e[13]=le):le=e[13];let J;e[14]!==le?(J=n.jsx(Ja,{children:le}),e[14]=le,e[15]=J):J=e[15];let Q;e[16]!==r||e[17]!==J?(Q=n.jsxs(Qa,{children:[r,J]}),e[16]=r,e[17]=J,e[18]=Q):Q=e[18];let te;e[19]!==g?(te=g("sectionsEditor.variantRenameDialog.nameLabel"),e[19]=g,e[20]=te):te=e[20];let m;e[21]!==te?(m=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:te}),e[21]=te,e[22]=m):m=e[22];let C;e[23]===Symbol.for("react.memo_cache_sentinel")?(C=ee=>O(ee.target.value),e[23]=C):C=e[23];let ce;e[24]!==p||e[25]!==y||e[26]!==k?(ce=n.jsx(tr,{id:"variant-rename-name",value:k,onChange:C,placeholder:p,autoFocus:!0,disabled:y}),e[24]=p,e[25]=y,e[26]=k,e[27]=ce):ce=e[27];let P;e[28]!==m||e[29]!==ce?(P=n.jsxs("div",{className:"space-y-1.5 py-4",children:[m,ce]}),e[28]=m,e[29]=ce,e[30]=P):P=e[30];let Z;e[31]!==v?(Z=()=>v(!1),e[31]=v,e[32]=Z):Z=e[32];let D;e[33]!==g?(D=g("sectionsEditor.variantRenameDialog.cancel"),e[33]=g,e[34]=D):D=e[34];let ne;e[35]!==y||e[36]!==Z||e[37]!==D?(ne=n.jsx(Je,{type:"button",variant:"outline",onClick:Z,disabled:y,children:D}),e[35]=y,e[36]=Z,e[37]=D,e[38]=ne):ne=e[38];let B;e[39]!==y||e[40]!==g?(B=y?n.jsxs(n.Fragment,{children:[n.jsx(os,{className:"size-3.5"}),g("sectionsEditor.variantRenameDialog.saving")]}):g("sectionsEditor.variantRenameDialog.save"),e[39]=y,e[40]=g,e[41]=B):B=e[41];let me;e[42]!==y||e[43]!==B?(me=n.jsx(Je,{type:"submit",disabled:y,children:B}),e[42]=y,e[43]=B,e[44]=me):me=e[44];let Se;e[45]!==ne||e[46]!==me?(Se=n.jsxs(Xa,{children:[ne,me]}),e[45]=ne,e[46]=me,e[47]=Se):Se=e[47];let be;e[48]!==l||e[49]!==P||e[50]!==Se||e[51]!==Q?(be=n.jsx(Za,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:l,children:[Q,P,Se]})}),e[48]=l,e[49]=P,e[50]=Se,e[51]=Q,e[52]=be):be=e[52];let U;return e[53]!==E||e[54]!==a||e[55]!==be?(U=n.jsx(er,{open:a,onOpenChange:E,children:be}),e[53]=E,e[54]=a,e[55]=be,e[56]=U):U=e[56],U}function Ns(u){const e=st.c(5),{rule:a,matchers:d}=u,p=a?.__resolveType??"";let b;if(e[0]!==d||e[1]!==p){const g=d.find(k=>k.resolveType===p)?.iconName??Wo(p);b=za(g),e[0]=d,e[1]=p,e[2]=b}else b=e[2];const x=b;if(!x)return null;let v;return e[3]!==x?(v=n.jsx(x,{size:14,className:"shrink-0"}),e[3]=x,e[4]=v):v=e[4],v}function es(u){return u.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
2
+ `)}function ts(u){return u.map((e,a)=>({id:crypto.randomUUID(),index:a,variant:e}))}function Br(u,e){const a=new Map;for(const d of u){const p=a.get(d.variant.label);p?p.push(d):a.set(d.variant.label,[d])}return e.map((d,p)=>({id:a.get(d.label)?.shift()?.id??crypto.randomUUID(),index:p,variant:d}))}function Kr(u){return u.map((e,a)=>({...e,index:a}))}function Ps(u){const e=st.c(17),{label:a,effectiveRule:d,matchers:p,canDelete:b,dragging:x,onRename:v,onDuplicate:y,onDelete:g}=u,k=Tt();let O;e[0]!==d||e[1]!==p?(O=n.jsx(Ns,{rule:d,matchers:p}),e[0]=d,e[1]=p,e[2]=O):O=e[2];let M;e[3]!==a?(M=n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:a}),e[3]=a,e[4]=M):M=e[4];let N;e[5]!==b||e[6]!==x||e[7]!==a||e[8]!==g||e[9]!==y||e[10]!==v||e[11]!==k?(N=!x&&n.jsxs(Es,{children:[n.jsx(Rs,{asChild:!0,children:n.jsx(Je,{type:"button",variant:"ghost",size:"icon","aria-label":k("sectionsEditor.pageVariantTabs.actionsAriaLabel",{label:a}),className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:Fr,onPointerDown:Ir,children:n.jsx(vn,{size:14})})}),n.jsxs(ws,{align:"end",className:"w-36",children:[n.jsxs(vt,{onClick:E=>{E.stopPropagation(),v?.()},children:[n.jsx(dr,{size:14}),k("sectionsEditor.pageVariantTabs.renameAction")]}),n.jsxs(vt,{onClick:E=>{E.stopPropagation(),y?.()},children:[n.jsx(_s,{size:14}),k("sectionsEditor.pageVariantTabs.duplicateAction")]}),n.jsx(rr,{}),n.jsxs(vt,{variant:"destructive",disabled:!b,onClick:E=>{E.stopPropagation(),g?.()},children:[n.jsx(js,{size:14}),k("sectionsEditor.pageVariantTabs.deleteAction")]})]})]}),e[5]=b,e[6]=x,e[7]=a,e[8]=g,e[9]=y,e[10]=v,e[11]=k,e[12]=N):N=e[12];let c;return e[13]!==O||e[14]!==M||e[15]!==N?(c=n.jsxs(n.Fragment,{children:[O,M,N]}),e[13]=O,e[14]=M,e[15]=N,e[16]=c):c=e[16],c}function Ir(u){return u.stopPropagation()}function Fr(u){return u.stopPropagation()}function $r(u){const e=st.c(33),{entry:a,isActive:d,canDelete:p,decofile:b,meta:x,matchers:v,onSelect:y,onRename:g,onDuplicate:k,onDelete:O}=u;let M;e[0]!==a.id?(M={id:a.id,animateLayoutChanges:zr},e[0]=a.id,e[1]=M):M=e[1];const{attributes:N,listeners:c,setNodeRef:E,transform:R,isDragging:l}=fs(M);let w;e[2]!==R?(w=ps.Transform.toString(R?{...R,x:0}:null),e[2]=R,e[3]=w):w=e[3];const r=l?0:void 0;let le;e[4]!==w||e[5]!==r?(le={transform:w,opacity:r},e[4]=w,e[5]=r,e[6]=le):le=e[6];const J=le,Q=x??void 0;let te;e[7]!==b||e[8]!==a.variant.rule||e[9]!==Q?(te=Bt(a.variant.rule,b,Q),e[7]=b,e[8]=a.variant.rule,e[9]=Q,e[10]=te):te=e[10];const m=te;let C;e[11]!==y?(C=B=>{B.target===B.currentTarget&&(B.key==="Enter"||B.key===" ")&&(B.preventDefault(),y())},e[11]=y,e[12]=C):C=e[12];const ce=l?"cursor-grabbing":"cursor-pointer active:cursor-grabbing",P=d?xs:gs;let Z;e[13]!==ce||e[14]!==P?(Z=Ne("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors touch-none",ce,P),e[13]=ce,e[14]=P,e[15]=Z):Z=e[15];let D;e[16]!==p||e[17]!==m||e[18]!==a.variant.label||e[19]!==v||e[20]!==O||e[21]!==k||e[22]!==g?(D=n.jsx(Ps,{label:a.variant.label,effectiveRule:m,matchers:v,canDelete:p,onRename:g,onDuplicate:k,onDelete:O}),e[16]=p,e[17]=m,e[18]=a.variant.label,e[19]=v,e[20]=O,e[21]=k,e[22]=g,e[23]=D):D=e[23];let ne;return e[24]!==N||e[25]!==c||e[26]!==y||e[27]!==E||e[28]!==J||e[29]!==Z||e[30]!==D||e[31]!==C?(ne=n.jsx("div",{ref:E,style:J,...N,...c,onClick:y,onKeyDown:C,className:Z,children:D}),e[24]=N,e[25]=c,e[26]=y,e[27]=E,e[28]=J,e[29]=Z,e[30]=D,e[31]=C,e[32]=ne):ne=e[32],ne}function zr(){return!1}function Hr(u){const e=st.c(9),{variant:a,decofile:d,meta:p,matchers:b}=u,x=p??void 0;let v;e[0]!==d||e[1]!==x||e[2]!==a.rule?(v=Bt(a.rule,d,x),e[0]=d,e[1]=x,e[2]=a.rule,e[3]=v):v=e[3];const y=v;let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=Ne("flex items-center gap-2 rounded-md px-2 py-2.5 shadow-lg ring-1 ring-border/60 cursor-grabbing",xs),e[4]=g):g=e[4];let k;return e[5]!==y||e[6]!==b||e[7]!==a.label?(k=n.jsx("div",{className:g,children:n.jsx(Ps,{label:a.label,effectiveRule:y,matchers:b,canDelete:!1,dragging:!0})}),e[5]=y,e[6]=b,e[7]=a.label,e[8]=k):k=e[8],k}function Ur(u){const e=st.c(91),{listKey:a,variants:d,activeIndex:p,decofile:b,meta:x,matchers:v,onSelect:y,onReorder:g,onRename:k,onDuplicate:O,onDelete:M,onAdd:N}=u,c=Tt();let E;e[0]!==d?(E=()=>ts(d),e[0]=d,e[1]=E):E=e[1];const[R,l]=_.useState(E),[w,r]=_.useState(null),[le,J]=_.useState(a),[Q,te]=_.useState(d.length);let m;e[2]!==d?(m=()=>es(d),e[2]=d,e[3]=m):m=e[3];const[C,ce]=_.useState(m),P=_.useRef(!1),Z=es(d);le!==a?(J(a),te(d.length),ce(Z),l(ts(d))):(Q!==d.length||C!==Z)&&(te(d.length),ce(Z),l(Fe=>Br(Fe,d)));let D;e[4]===Symbol.for("react.memo_cache_sentinel")?(D={activationConstraint:{distance:8}},e[4]=D):D=e[4];let ne;e[5]===Symbol.for("react.memo_cache_sentinel")?(ne={coordinateGetter:hs},e[5]=ne):ne=e[5];const B=is(Zt(ds,D),Zt(us,ne));let me;e[6]!==R?(me=R.map(Gr),e[6]=R,e[7]=me):me=e[7];const Se=me,be=d.length>1;let U;e[8]!==R?(U=Fe=>{const we=String(Fe.active.id);r(R.find(Oe=>Oe.id===we)??null)},e[8]=R,e[9]=U):U=e[9];const ee=U;let ye;e[10]!==Se||e[11]!==g?(ye=Fe=>{r(null);const{active:we,over:Oe}=Fe;if(!Oe||we.id===Oe.id)return;const De=Se.indexOf(String(we.id)),Be=Se.indexOf(String(Oe.id));De===-1||Be===-1||(l(Ae=>Kr(Ot([...Ae],De,Be))),P.current=!0,requestAnimationFrame(()=>{P.current=!1}),g(De,Be))},e[10]=Se,e[11]=g,e[12]=ye):ye=e[12];const ae=ye;let L;e[13]===Symbol.for("react.memo_cache_sentinel")?(L=()=>{r(null)},e[13]=L):L=e[13];const qe=L;let Qe,xe,fe,I,F,ue,pe,re,ge,se,he,T,Pe;if(e[14]!==p||e[15]!==be||e[16]!==b||e[17]!==R||e[18]!==Se||e[19]!==ae||e[20]!==ee||e[21]!==v||e[22]!==x||e[23]!==N||e[24]!==M||e[25]!==O||e[26]!==k||e[27]!==y||e[28]!==B||e[29]!==c){const Fe=q=>{P.current||y(q)};he="space-y-1 border-b p-2";let we;e[43]!==c?(we=c("sectionsEditor.pageVariantTabs.variantsLabel"),e[43]=c,e[44]=we):we=e[44];let Oe;e[45]!==we?(Oe=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:we}),e[45]=we,e[46]=Oe):Oe=e[46];let De;e[47]!==c?(De=c("sectionsEditor.pageVariantTabs.addVariantAriaLabel"),e[47]=c,e[48]=De):De=e[48];let Be;e[49]===Symbol.for("react.memo_cache_sentinel")?(Be=n.jsx(bn,{size:14}),e[49]=Be):Be=e[49];let Ae;e[50]!==N||e[51]!==De?(Ae=n.jsx(kt,{asChild:!0,children:n.jsx(Je,{type:"button",variant:"ghost",size:"icon","aria-label":De,className:"size-6",onClick:N,children:Be})}),e[50]=N,e[51]=De,e[52]=Ae):Ae=e[52];let Ge;e[53]!==c?(Ge=c("sectionsEditor.pageVariantTabs.addVariantTooltip"),e[53]=c,e[54]=Ge):Ge=e[54];let ke;e[55]!==Ge?(ke=n.jsx(Dt,{children:Ge}),e[55]=Ge,e[56]=ke):ke=e[56];let $;e[57]!==Ae||e[58]!==ke?($=n.jsxs(wt,{children:[Ae,ke]}),e[57]=Ae,e[58]=ke,e[59]=$):$=e[59],e[60]!==Oe||e[61]!==$?(T=n.jsxs("div",{className:"flex items-center justify-between",children:[Oe,$]}),e[60]=Oe,e[61]=$,e[62]=T):T=e[62],xe=vs,ue=B,pe=Ss,re=ee,ge=ae,se=qe,Qe=bs,I=Se,F=ys,Pe="space-y-0.5",fe=R.map(q=>n.jsx($r,{entry:q,isActive:q.index===p,canDelete:be,decofile:b,meta:x,matchers:v,onSelect:()=>Fe(q.index),onRename:()=>k(q.index),onDuplicate:()=>O(q.index),onDelete:()=>M(q.index)},q.id)),e[14]=p,e[15]=be,e[16]=b,e[17]=R,e[18]=Se,e[19]=ae,e[20]=ee,e[21]=v,e[22]=x,e[23]=N,e[24]=M,e[25]=O,e[26]=k,e[27]=y,e[28]=B,e[29]=c,e[30]=Qe,e[31]=xe,e[32]=fe,e[33]=I,e[34]=F,e[35]=ue,e[36]=pe,e[37]=re,e[38]=ge,e[39]=se,e[40]=he,e[41]=T,e[42]=Pe}else Qe=e[30],xe=e[31],fe=e[32],I=e[33],F=e[34],ue=e[35],pe=e[36],re=e[37],ge=e[38],se=e[39],he=e[40],T=e[41],Pe=e[42];let Re;e[63]!==fe||e[64]!==Pe?(Re=n.jsx("div",{className:Pe,children:fe}),e[63]=fe,e[64]=Pe,e[65]=Re):Re=e[65];let $e;e[66]!==Qe||e[67]!==I||e[68]!==F||e[69]!==Re?($e=n.jsx(Qe,{items:I,strategy:F,children:Re}),e[66]=Qe,e[67]=I,e[68]=F,e[69]=Re,e[70]=$e):$e=e[70];let ze;e[71]!==w||e[72]!==b||e[73]!==v||e[74]!==x?(ze=w?n.jsx(Hr,{variant:w.variant,decofile:b,meta:x,matchers:v}):null,e[71]=w,e[72]=b,e[73]=v,e[74]=x,e[75]=ze):ze=e[75];let Le;e[76]!==ze?(Le=ss.createPortal(n.jsx(ls,{dropAnimation:cs,children:ze}),document.body),e[76]=ze,e[77]=Le):Le=e[77];let oe;e[78]!==xe||e[79]!==ue||e[80]!==pe||e[81]!==re||e[82]!==ge||e[83]!==se||e[84]!==$e||e[85]!==Le?(oe=n.jsxs(xe,{sensors:ue,collisionDetection:pe,onDragStart:re,onDragEnd:ge,onDragCancel:se,children:[$e,Le]}),e[78]=xe,e[79]=ue,e[80]=pe,e[81]=re,e[82]=ge,e[83]=se,e[84]=$e,e[85]=Le,e[86]=oe):oe=e[86];let He;return e[87]!==he||e[88]!==T||e[89]!==oe?(He=n.jsxs("div",{className:he,children:[T,oe]}),e[87]=he,e[88]=T,e[89]=oe,e[90]=He):He=e[90],He}function Gr(u){return u.id}function ns(u){const e=st.c(21),{currentRt:a,currentLabel:d,currentGlobalKey:p,matchers:b,globals:x,onSelect:v,onSelectGlobal:y,schema:g,formValue:k,onChange:O,formKey:M,formWrapperClassName:N,meta:c,decofile:E,onSaveReferencedBlock:R,sandbox:l}=u;let w;e[0]!==p||e[1]!==d||e[2]!==a||e[3]!==x||e[4]!==b||e[5]!==v||e[6]!==y?(w=n.jsx(Yo,{currentRt:a,currentLabel:d,currentGlobalKey:p,matchers:b,globals:x,onSelect:v,onSelectGlobal:y}),e[0]=p,e[1]=d,e[2]=a,e[3]=x,e[4]=b,e[5]=v,e[6]=y,e[7]=w):w=e[7];let r;e[8]!==E||e[9]!==M||e[10]!==k||e[11]!==N||e[12]!==c||e[13]!==O||e[14]!==R||e[15]!==l||e[16]!==g?(r=g&&k&&n.jsx("div",{className:N,children:n.jsx(Jo,{schema:g,value:k,onChange:O,meta:c,decofile:E,onSaveReferencedBlock:R,sandbox:l},M)}),e[8]=E,e[9]=M,e[10]=k,e[11]=N,e[12]=c,e[13]=O,e[14]=R,e[15]=l,e[16]=g,e[17]=r):r=e[17];let le;return e[18]!==w||e[19]!==r?(le=n.jsxs(n.Fragment,{children:[w,r]}),e[18]=w,e[19]=r,e[20]=le):le=e[20],le}function Fc({orgSlug:u,virtualMcpId:e,branch:a,previewReady:d=!0,previewUrl:p,currentPath:b,activePageBlockKey:x=null,activeGlobalBlockKey:v=null,externalSelection:y,onSaved:g,initialEditSeo:k=!1,onExitSeo:O,onViewJsonFile:M,onVariantPreviewOverride:N}){const c=Tt(),E=Ko()?.taskId??null,R=d?{orgSlug:u,virtualMcpId:e,branch:a,threadId:E,previewUrl:p}:null,{data:l,isLoading:w}=Qo(R),{data:r,isLoading:le}=Xo(R),J=Zo(),Q=J?.entity?.id===e?J.entity.metadata?.siteSlug??null:null,te=mr({virtualMcpId:e,sandboxUrl:p}),[m,C]=_.useState(null),[ce,P]=_.useState(null),[Z,D]=_.useState(null),[ne,B]=_.useState(0),[me,Se]=_.useState(void 0),[be,U]=_.useState(null),[ee,ye]=_.useState(null),[ae,L]=_.useState([]),qe=_.useRef(null),[Qe,xe]=_.useState(ae.length);Qe!==ae.length&&(xe(ae.length),requestAnimationFrame(()=>{qe.current&&(qe.current.scrollTop=0)}));const[fe,I]=_.useState(0),[F,ue]=_.useState(null),[pe,re]=_.useState(null),[ge,se]=_.useState(null),[he,T]=_.useState(!0),[Pe,Re]=_.useState(!1),[$e,ze]=_.useState(!1),Le=_.useRef(null),[oe,He]=_.useState(k),[Fe,we]=_.useState(k);k&&!Fe&&(we(!0),He(!0),C(null),P(null),D(null),L([])),!k&&Fe&&we(!1);const[Oe,De]=_.useState(null),[Be,Ae]=_.useState(void 0),[Ge,ke]=_.useState([]),[$,q]=_.useState(0),[ie,Te]=_.useState(0),[ct,_e]=_.useState(null),[We,Ce]=_.useState(null),[yn,xn]=_.useState(null),As=Oo(),Cs=`${u}/${e}/${a}`,en=ea({orgSlug:u,virtualMcpId:e,branch:a}),[Ms,Ls]=_.useState(b),[Os,Bs]=_.useState(x),[Ks,Is]=_.useState(v);(Ms!==b||Os!==x||Ks!==v)&&(queueMicrotask(()=>en.flush()),Ls(b),Bs(x),Is(v),C(null),P(null),D(null),B(0),U(null),ye(null),Te(0),_e(null),Ce(null),L([]),I(t=>t+1),He(!1),De(null),Ae(void 0),ke([]),q(t=>t+1));const je=ta({orgSlug:u,virtualMcpId:e,branch:a}),Kt=Da((t,s)=>{je.mutate({blockKey:t,data:s},{onSuccess:()=>g?.(),onError:o=>Y.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:o.message}))})}),tn=na({orgSlug:u,virtualMcpId:e,branch:a}),[Vt,It]=_.useState(!1),Ke=_.useRef(null),ot=_.useRef(null),at=_.useRef(null),nn=_.useRef({}),et=_.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!d||w||le)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(os,{className:"size-5 text-muted-foreground"})});if(!l||!r)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const Fs=sa(l),Ee=!!v,Ye=Ee?null:oa(Fs,b,x),j=Ee?v:Ye?.key??null,sn=Ee&&v?l[v]:void 0,_n=Ee&&v&&sn?aa(v,sn):Ee&&v?v:"",Ft=!Ee&&j&&l[j]?l[j]:null,on=oe&&l&&r&&j&&Ye?In(l,{kind:"page",pageKey:j,pageName:String(Ye.name??""),path:String(Ye.path??"")},r):null,$s=oe?Ft?.seo:void 0,an=Be!==void 0?Be:$s,zs=oe?ra(an):void 0,Hs=on?.seoTypeOptions??[],Us=oe&&r?ia(r):"",jn=Oe??zs??{},rn=oe&&on?lr(jn,on):null,Gs=oe&&rn&&la(an)?Wt(rn,r):null,qs=oe?ca(l,r)?.seoData:void 0,Ue=Ee?[{label:"Default",sections:[{__resolveType:v}]}]:ua(Ft?.sections,l??{}),$t=Ue.length>1,Me=Math.min(ne,Ue.length-1),ut=Ue[Me],G=ut?.sections??[],Ie=Yt(G,l),En=!Ee&&da(Ft?.sections);if(Ee&&v&&yn!==v){xn(v);const t=G[0],s=Ie[0];if(t&&s){C(0),Te(0),L([]);const o=bt(t,s,l);o&&(P(o.data),D(o.resolveType),Ce(null),_e(null))}}!Ee&&yn!==null&&xn(null),et.current={rawSections:G,parsedSections:Ie,decofile:l??{},activePageKey:j,pageVariants:Ue,variantIndex:Me,sectionVariantIndex:ie,selectedSectionIndex:m};const Ws=()=>({multivariate:En,index:Me,variants:Ue.map(t=>({rule:t.rule}))}),Rn=(t,s)=>{if(!N)return;if(!j||!En||t.length<=1){N(null);return}const o=Yn(j,{multivariate:!0,index:s,variants:t},l,r);N(o.length>0?o:null)},xt=(t,s,o)=>{if(!N)return;if(!j){N(null);return}const i=Ws(),f=Yn(j,i,l,r);if(!t||s<0){N(f.length>0?f:null);return}const S=Aa({pageKey:j,page:i,sectionIndex:s,sectionLazy:Ie[s]?.isLazy??!1,mvObj:t,selectedVariantIndex:o,decofile:l,meta:r}),h=[...f,...S];N(h.length>0?h:null)},dt=(t,s,o,i=m??-1,f=!1)=>{const S=nt(t,s);if(!S){P(null),D(null),Ce(null),_e(null),f&&xt(null,i,o);return}const V=Fn(S,ht)[o];if(!V){P(null),D(null),Ce(null),_e(null),f&&xt(null,i,o);return}const X=ya(V.value,l);P(X?.data??null),D(X?.resolveType??null);const{resolveType:A,formValue:K}=At(V.rule,l,r??void 0);Ce(A),_e(K),f&&xt(S,i,o)},Nt=y?.index;if(y!==void 0&&(y?.seq??null)!==me&&(Se(y?.seq??null),typeof Nt=="number")){const t=G[Nt],s=Ie[Nt];if(t&&s)if(C(Nt),Te(0),L([]),I(o=>o+1),s.isMultivariate)dt(t,s,0,Nt);else{const o=bt(t,s,l);o?(P(o.data),D(o.resolveType)):(P(null),D(null)),Ce(null),_e(null)}}const zt={orgSlug:u,virtualMcpId:e,branch:a,threadId:E,previewUrl:p??void 0,siteSlug:Q},ln=Z&&r?Wt(Z,r):null,Xe=(t,s)=>{if(!j)return;Ke.current&&(clearTimeout(Ke.current),Ke.current=null),at.current&&(clearTimeout(at.current),at.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null);const o=Mt(l,j,t,Me,Ue);je.mutate({blockKey:j,data:o},{onSuccess:()=>s?.onSuccess?.()??g?.(),onError:i=>Y.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:i.message}))})},_t=()=>{C(null),P(null),D(null),Te(0),_e(null),Ce(null),L([]),I(t=>t+1)},Ys=(t,s)=>{Ke.current&&clearTimeout(Ke.current);const o=et.current.sectionVariantIndex;Ke.current=setTimeout(()=>{const{rawSections:i,parsedSections:f,decofile:S,activePageKey:h,pageVariants:V,variantIndex:X}=et.current,A=i[s];if(!A)return;const K=f[s];if(!K)return;if(K.isSavedBlock){const H=Ma(A,K);if(!H)return;je.mutate({blockKey:H,data:t},{onSuccess:()=>g?.(),onError:W=>Y.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:W.message}))});return}if(!h)return;const z={...S[h]},ve=[...i];if(K.isMultivariate){const H=nt(A,K);if(!H||!h)return;const W=La(H,o,t);ve[s]=yt(A,K,W)}else if(K.isHidden){const H=ms(A.__resolveType),W=H?{...A.section}:{...A},Ve=Array.isArray(W.variants)?[...W.variants]:[];Ve[0]&&(Ve[0]={...Ve[0],value:t}),W.variants=Ve,H?ve[s]={...A,section:W}:ve[s]=W}else K.isLazy?ve[s]={...A,section:t}:ve[s]=t;if(V.length>1){const H=z.sections,W=[...H?.variants??[]];W[X]&&(W[X]={...W[X],value:ve}),z.sections={...H,variants:W}}else z.sections=ve;je.mutate({blockKey:h,data:z},{onSuccess:()=>g?.(),onError:H=>Y.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:H.message}))})},hn)},Js=t=>{C(t),Te(0),L([]),I(f=>f+1);const s=G[t],o=Ie[t];if(!s||!o)return;if(o.isMultivariate){dt(s,o,0,t);return}const i=bt(s,o,l);if(!i){P(null),D(null),Ce(null),_e(null),xt(null,t,0);return}P(i.data),D(i.resolveType),Ce(null),_e(null),xt(null,t,0)},wn=t=>{const s=t;P(s),m!==null&&Ys(s,m)},cn=t=>{if(!j||!l||!r||!Ye)return;const s={kind:"page",pageKey:j,pageName:String(Ye.name??""),path:String(Ye.path??"")},o=In(l,s,r);o&&en.save(j,()=>{const i=As.getQueryData(Bo.decofile(Cs))?.[j];if(!i||typeof i!="object"||i===null||Array.isArray(i))return null;const f={...i,...nn.current};return nn.current={},t?.raw!==void 0?{...f,seo:t.raw}:t?.inner!==void 0?ur(s,o,f,t.inner):f})},Qs=(t,s)=>{j&&(nn.current[t]=s,cn())},Xs=(t,s)=>{if(!j)return;const o=Ot([...G],t,s);m!==null&&(m===t?C(s):t<m&&s>=m?C(m-1):t>m&&s<=m&&C(m+1)),Xe(o)},Zs=t=>{if(!j)return;const s=G.filter((o,i)=>i!==t);m===t?_t():m!==null&&m>t&&C(m-1),Xe(s)},eo=t=>{if(!j)return;const s=G[t];if(!s)return;const o=[...G];o.splice(t+1,0,Pa(s)),m!==null&&m>t&&C(m+1),Xe(o)},to=t=>{if(!j)return;const s=G[t],o=Ie[t];if(!s||!o)return;const i=o.isHidden?Va(s):Na(s);if(!i)return;const f=[...G];f[t]=i,m===t&&_t(),Xe(f)},no=t=>{if(!j)return;const s=G[t],o=Ie[t];if(!s||!o||o.isMultivariate)return;const i=Ta(s);if(!i)return;const f=[...G];f[t]=i,m===t&&_t(),Xe(f)},so=t=>{if(!j)return;const s=G[t],o=Ie[t];if(!s||!o?.isSavedBlock)return;const i=bt(s,o,l);if(!i?.data)return;const{name:f,...S}=i.data,h=[...G];o.isLazy?h[t]={...s,section:S}:h[t]=S,m===t&&_t(),Xe(h)},oo=t=>{if(!j)return;const s=[...G,{__resolveType:t.resolveType}],o=s.length-1;Xe(s,{onSuccess:()=>{Re(!1),C(o),Te(0),L([]),I(h=>h+1);const i=s[o],f=Yt(s,l)[o];if(!i||!f)return;if(f.isMultivariate){dt(i,f,0);return}const S=bt(i,f,l);if(!S){P(null),D(null),Ce(null),_e(null);return}P(S.data),D(S.resolveType),Ce(null),_e(null)}})},kn=t=>{Le.current=t.append,Re(!0)},ao=t=>{const s=Le.current;if(!s){oo(t);return}s({__resolveType:t.resolveType}),Re(!1),Le.current=null},ro=t=>{if(m===null)return;const s=G[m],o=Ie[m];!s||!o?.isMultivariate||(Te(t),L([]),I(i=>i+1),dt(s,o,t,m,!0))},io=t=>{if(m===null||!j)return;const s=G[m],o=Ie[m];if(!s||!o?.isMultivariate)return;const i=nt(s,o);if(!i)return;const f=wa(i,t);if(!f){Y.error(c("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const S=[...G];S[m]=yt(s,o,f);const h=f.variants;let V=ie;t===ie?V=Math.min(t,h.length-1):t<ie&&(V=ie-1),Te(V),L([]),I(X=>X+1),dt(S[m],o,V),Xe(S)},lo=t=>{if(m===null||!j)return;const s=G[m],o=Ie[m];if(!s||!o?.isMultivariate)return;const i=nt(s,o);if(!i)return;const f=ka(i,t),S=[...G];S[m]=yt(s,o,f);const h=t+1;Te(h),L([]),I(V=>V+1),dt(S[m],o,h),Xe(S)},co=(t,s)=>{if(m===null||!j||t===s)return;const o=G[m],i=Ie[m];if(!o||!i?.isMultivariate)return;const f=nt(o,i);if(!f)return;const S=Ea(f,t,s),h=[...G];h[m]=yt(o,i,S);let V=ie;ie===t?V=s:t<ie&&s>=ie?V=ie-1:t>ie&&s<=ie&&(V=ie+1),Te(V),dt(h[m],i,V),Xe(h)},un=t=>{const s=t??m;if(s===null||!j)return;const o=G[s],i=Ie[s];if(!o||!i)return;const f=xa(o,i);if(!f){Y.error(c("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const S=[...G];S[s]=f.section;const h=Yt(S,l)[s];if(!h?.isMultivariate){Y.error(c("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}C(s),Te(f.newVariantIndex),L([]),I(V=>V+1),dt(f.section,h,f.newVariantIndex,s),Xe(S)},uo=()=>{if(m===null||!j)return;const t=G[m],s=Ie[m];if(!t||!s?.isMultivariate)return;const o=nt(t,s);if(!o)return;const i=Ra(t,s,o);if(!i){Y.error(c("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const f=[...G];f[m]=i;const S=Yt(f,l)[m];if(!S)return;Te(0),Ce(null),_e(null),L([]),I(V=>V+1);const h=bt(i,S,l);h?(P(h.data),D(h.resolveType)):(P(null),D(null)),xt(null,m,0),Xe(f)},mo=async t=>{if(F===null||!j)return;const s=gn(t,l);if(s){Y.error(s);return}const o=G[F],i=Ie[F];if(!o||!i)return;const f=bt(o,i,l);if(!f){Y.error(c("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const S={...f.data,name:t};try{await je.mutateAsync({blockKey:t,data:S});const h=[...G];h[F]={__resolveType:t},await je.mutateAsync({blockKey:j,data:Mt(l,j,h,Me,Ue)}),m===F&&_t(),ue(null),Y.success(c("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),g?.()}catch(h){Y.error(h instanceof Error?h.message:c("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"))}},Dn=ut?.rule;if($t&&m===null&&ee===null&&Dn){const{resolveType:t,formValue:s}=At(Dn,l??{},r??void 0);ye(t),U(s)}const Ht=r?ma(r):[],Tn=r&&l?fa(r,l):[],fo=!Ee&&!!(te&&r&&l),po=ee&&r?Wt(ee,r):null,jt=()=>{ot.current&&(clearTimeout(ot.current),ot.current=null),at.current&&(clearTimeout(at.current),at.current=null)},Pt=async(t,s)=>{if(!(Ca(s,t,r)>0))try{await tn.mutateAsync({blockKey:t})}catch(o){Y.error(o instanceof Error?o.message:c("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"))}},Vn=t=>{ot.current&&clearTimeout(ot.current),ot.current=setTimeout(()=>{const{activePageKey:s,decofile:o,variantIndex:i}=et.current;if(!s)return;const f={...o[s]},S={...f.sections},h=[...S.variants??[]],V=h[i],X=V?.rule;if(Et(X,o,r)){const A=X?.__resolveType??"",K=o[A],z=typeof K?.name=="string"?K.name:A,{__resolveType:ve,...H}=t;je.mutate({blockKey:A,data:Rt(ve??"",H,z)},{onSuccess:()=>g?.(),onError:W=>Y.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:W.message}))});return}V&&(h[i]={...V,rule:t}),f.sections={...S,variants:h},je.mutate({blockKey:s,data:f},{onSuccess:()=>g?.(),onError:A=>Y.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:A.message}))})},hn)},go=t=>{ye(t);const s=t?Un(t,r):{__resolveType:Gn};U(t?s:{}),Vn(s)},ho=t=>{const s=t;U(s);const o=ee?{__resolveType:ee,...s}:{...s};Vn(o)},vo=async t=>{jt();const{activePageKey:s,decofile:o,variantIndex:i}=et.current;if(!s)return;const f=o[s],S=f?.sections;if(!S||typeof S!="object"||Array.isArray(S))return;const h=S;if(!Array.isArray(h.variants))return;const V=[...h.variants],X=V[i];if(!X)return;const A=Ct(X.rule,o,r),K=Qt(t);V[i]={...X,rule:K};const z={...o,[s]:{...f,sections:{...h,variants:V}}},{resolveType:ve,formValue:H}=At(K,z,r??void 0);ye(ve),U(H);try{await je.mutateAsync({blockKey:s,data:z[s]}),A&&A!==t&&await Pt(A,z),g?.()}catch(W){Y.error(W instanceof Error?W.message:c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}},Nn=t=>{at.current&&clearTimeout(at.current);const{selectedSectionIndex:s,sectionVariantIndex:o}=et.current;s!==null&&(at.current=setTimeout(()=>{const{rawSections:i,parsedSections:f,decofile:S,activePageKey:h,pageVariants:V,variantIndex:X}=et.current;if(!h)return;const A=i[s],K=f[s];if(!A||!K?.isMultivariate)return;const z=nt(A,K);if(!z)return;const H=(z.variants??[])[o]?.rule;if(Et(H,S,r)){const de=H?.__resolveType??"",Ze=S[de],it=typeof Ze?.name=="string"?Ze.name:de,{__resolveType:pt,...lt}=t;je.mutate({blockKey:de,data:Rt(pt??"",lt,it)},{onSuccess:()=>g?.(),onError:gt=>Y.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:gt.message}))});return}const W=Hn(z,o,t),Ve=[...i];Ve[s]=yt(A,K,W);const tt=Mt(S,h,Ve,X,V);je.mutate({blockKey:h,data:tt},{onSuccess:()=>g?.(),onError:de=>Y.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:de.message}))})},hn))},So=t=>{Ce(t);const s=t?Un(t,r):{__resolveType:Gn};_e(t?s:{}),Nn(s)},bo=t=>{const s=t;_e(s);const o=We?{__resolveType:We,...s}:{...s};Nn(o)},yo=async t=>{jt();const{selectedSectionIndex:s,sectionVariantIndex:o,rawSections:i,parsedSections:f,decofile:S,activePageKey:h,pageVariants:V,variantIndex:X}=et.current;if(s===null||!h)return;const A=i[s],K=f[s];if(!A||!K?.isMultivariate)return;const z=nt(A,K);if(!z)return;const ve=z.variants??[],H=Ct(ve[o]?.rule,S,r),W=Qt(t),Ve=Hn(z,o,W),tt=[...i];tt[s]=yt(A,K,Ve);const de=Mt(S,h,tt,X,V),Ze={...S,[h]:de},{resolveType:it,formValue:pt}=At(W,Ze,r??void 0);Ce(it),_e(pt);try{await je.mutateAsync({blockKey:h,data:de}),H&&H!==t&&await Pt(H,Ze),g?.()}catch(lt){Y.error(lt instanceof Error?lt.message:c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}};if(!Ee&&!Ye)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.noPageFound",{currentPath:b})});if(Ee&&!sn)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.globalBlockNotFound")});const mt=m!==null?Ie[m]??null:null,Pn=m!==null?G[m]:null,An=Pn&&mt?.isMultivariate?nt(Pn,mt):null,St=An?Fn(An,ht):[],dn=Math.min(ie,Math.max(St.length-1,0)),Ut=St[dn]??null,ft=mt?.isMultivariate===!0,Cn=m!==null&&mt!==null,Gt=Cn&&(ft||!!(ln&&ce)),xo=Gt&&!Ee&&mt?.isSavedBlock===!0,rt=Ee||xo,_o=Ee?_n:mt?.label??"",jo=We&&r?Wt(We,r):null,mn=Gt&&(!Ee||ae.length>0)?Ee?[_n,...ae]:[Ye.name,mt.label,...ft&&Ut?[Ut.label]:[],...ae]:[],Eo=oe&&Ye?[Ye.name,"SEO",...Ge]:[],qt=oe?Eo:rt?mn.length>0?mn:[_o]:mn,Ro=!oe&&!Ee&&ft&&ae.length===0,Mn=()=>{if(!j)return;jt(),Ke.current&&(clearTimeout(Ke.current),Ke.current=null);const t=l[j],s=_a(t.sections,G);if(!s)return;const o=ja(s);je.mutate({blockKey:j,data:{...t,sections:s}},{onSuccess:()=>{B(o),C(null),P(null),D(null),L([]),U(null),ye(null)},onError:i=>Y.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:i.message}))})},fn=(t,s,o)=>{if(!j)return;jt(),Ke.current&&(clearTimeout(Ke.current),Ke.current=null);const i=l[j],f=i.sections;if(!f||typeof f!="object"||Array.isArray(f))return;const S=f;if(!Array.isArray(S.variants))return;const h=t([...S.variants]);if(!h)return;const V=Oa(S,h),X={...l,[j]:{...i,sections:V}};je.mutate({blockKey:j,data:X[j]},{onSuccess:()=>{s?.(),o&&Pt(o,X)},onError:A=>Y.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:A.message}))})},wo=t=>{re(null),B(t),C(null),P(null),D(null),L([]);const s=Ue[t]?.rule,{resolveType:o,formValue:i}=At(s,l??{},r??void 0);ye(o),U(i),Rn(Ue.map(f=>({rule:f.rule})),t)},ko=(t,s)=>{if(t===s)return;let o=Me;Me===t?o=s:t<Me&&s>=Me?o=Me-1:t>Me&&s<=Me&&(o=Me+1),B(o);const i=Ot(Ue.map(f=>({rule:f.rule})),t,s);Rn(i,o),fn(f=>Ot(f,t,s))},Do=t=>{const s=Ue[t]?.rule,o=Ct(s,l??{},r??void 0);fn(i=>i.length<=1?null:(i.splice(t,1),i),()=>{Ue.length-1===1?B(0):t<Me?B(Me-1):t===Me&&B(Math.max(0,t-1)),C(null),P(null),D(null),L([]),U(null),ye(null)},o)},To=t=>{fn(s=>Ba(s,t),()=>{B(t+1),C(null),P(null),D(null),L([]),U(null),ye(null)})},Vo=async(t,s)=>{jt(),Ke.current&&(clearTimeout(Ke.current),Ke.current=null);const o=et.current.activePageKey,i=et.current.decofile;if(!o)return;const f=i[o],S=f.sections;if(!S||typeof S!="object"||Array.isArray(S))return;const h=S;if(!Array.isArray(h.variants))return;const V=[...h.variants],X=V[t];if(!X?.rule||typeof X.rule!="object"){Y.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const A=X.rule,K=s.trim();It(!0);try{if(!K){if(!Et(A,i,r)){re(null);return}const tt=A.__resolveType??"";V[t]={...X,rule:qn(A,i,r)};const de={...i,[o]:{...f,sections:{...h,variants:V}}};await je.mutateAsync({blockKey:o,data:de[o]}),await Pt(tt,de),re(null),g?.();return}const z=Wn(A,i,r);if(!z){Y.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(z.blockKey){await je.mutateAsync({blockKey:z.blockKey,data:Rt(z.resolveType,z.data,K)}),re(null),g?.();return}const ve=pn(K),H=gn(ve,i);if(H){Y.error(H);return}const W=Rt(z.resolveType,z.data,K);let Ve=null;try{await je.mutateAsync({blockKey:ve,data:W}),Ve=ve,V[t]={...X,rule:Qt(ve)},await je.mutateAsync({blockKey:o,data:{...f,sections:{...h,variants:V}}}),Ve=null}catch(tt){throw Ve&&await tn.mutateAsync({blockKey:Ve}).catch(()=>{}),tt}re(null),Y.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:K})),g?.()}catch(z){Y.error(z instanceof Error?z.message:c("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{It(!1)}},No=async(t,s)=>{jt(),Ke.current&&(clearTimeout(Ke.current),Ke.current=null);const{selectedSectionIndex:o,rawSections:i,parsedSections:f,decofile:S,activePageKey:h,pageVariants:V,variantIndex:X}=et.current;if(o===null||!h)return;const A=i[o],K=f[o];if(!A||!K?.isMultivariate)return;const z=nt(A,K);if(!z)return;const ve=z.variants??[],H=ve[t];if(!H?.rule||typeof H.rule!="object"){Y.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const W=H.rule,Ve=s.trim();It(!0);const tt=async de=>{const Ze={...z,variants:de},it=[...i];it[o]=yt(A,K,Ze);const pt=Mt(S,h,it,X,V);return await je.mutateAsync({blockKey:h,data:pt}),{...S,[h]:pt}};try{if(!Ve){if(!Et(W,S,r)){se(null);return}const gt=W.__resolveType??"",Bn=[...ve];Bn[t]={...H,rule:qn(W,S,r)};const Lo=await tt(Bn);await Pt(gt,Lo),se(null),g?.();return}const de=Wn(W,S,r);if(!de){Y.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(de.blockKey){await je.mutateAsync({blockKey:de.blockKey,data:Rt(de.resolveType,de.data,Ve)}),se(null),g?.();return}const Ze=pn(Ve),it=gn(Ze,S);if(it){Y.error(it);return}const pt=Rt(de.resolveType,de.data,Ve);let lt=null;try{await je.mutateAsync({blockKey:Ze,data:pt}),lt=Ze;const gt=[...ve];gt[t]={...H,rule:Qt(Ze)},await tt(gt),lt=null}catch(gt){throw lt&&await tn.mutateAsync({blockKey:lt}).catch(()=>{}),gt}se(null),Y.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:Ve})),g?.()}catch(de){Y.error(de instanceof Error?de.message:c("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{It(!1)}},Ln=()=>{_t()},Po=t=>{De(t),cn({inner:t})},Ao=t=>{Ae(t),cn({raw:t})},Co=()=>{De(null),ke([])},Mo=()=>q(t=>t+1),On=t=>{if(oe){if(t===0){en.flush(),He(!1),De(null),Ae(void 0),ke([]),q(o=>o+1),O?.();return}if(t===1){ke([]),q(o=>o+1);return}ke(Ge.slice(0,t-1)),q(o=>o+1);return}if(Ee){L(ae.slice(0,t)),I(o=>o+1);return}if(t===0){Ln();return}if(t===1){L([]),I(o=>o+1);return}if(ft&&t===2){L([]),I(o=>o+1);return}const s=ft?2:1;L(ae.slice(0,t-s))};return n.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[n.jsx("div",{className:"shrink-0",children:rt||Gt||oe?n.jsxs("div",{className:Ne("border-b px-3 py-2.5",rt&&"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:[qt.length>1&&n.jsx("button",{type:"button",onClick:()=>On(Ka(qt.length,{isMultivariateSectionTop:Ro})),title:c("sectionsEditor.sectionsEditor.back"),"aria-label":c("sectionsEditor.sectionsEditor.back"),className:Ne("shrink-0 inline-flex size-6 items-center justify-center rounded-md transition-colors",rt?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:n.jsx(Ha,{className:"size-4"})}),!Ee&&$t&&ut&&n.jsxs("button",{type:"button",onClick:Ln,title:c("sectionsEditor.sectionsEditor.editingInVariant",{variant:ut.label}),className:Ne("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",pa),children:[n.jsx(Ns,{rule:Bt(ut.rule,l??{},r??void 0),matchers:Ht}),n.jsx("span",{className:"max-w-[160px] truncate",children:ut.label})]}),n.jsx("nav",{"aria-label":c("sectionsEditor.sectionsEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:qt.map((t,s)=>{const o=s===qt.length-1,i=ga(t);return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[s>0&&n.jsx(qa,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>On(s),title:i,className:Ne("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",o?rt?"font-semibold text-global-section-fg dark:text-global-section-fg-dark":"font-medium text-foreground":rt?"text-foreground/80":"text-muted-foreground",rt?"hover:bg-global-section/15":"hover:bg-accent hover:text-accent-foreground"),children:i})]},`${i}-${s}`)})}),rt&&n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(Wa,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(Dt,{side:"bottom",className:"max-w-[260px]",children:c("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Cn&&!ft&&!mt?.isHidden&&j&&n.jsx($n,{onClick:()=>un()})]}),rt&&n.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:c("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):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(ha,{pageKey:j,initialName:Ye.name,initialPath:Ye.path,onFieldChange:Qs})}),n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx(Je,{type:"button",variant:"ghost",size:"icon","aria-label":c("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:()=>He(!0),children:n.jsx(Ua,{size:14})})}),n.jsx(Dt,{side:"bottom",children:c("sectionsEditor.sectionsEditor.editSeo")})]}),n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx(Je,{type:"button",variant:"ghost",size:"icon","aria-label":c("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>M&&j?M():ze(!0),children:n.jsx(Ga,{size:14})})}),n.jsx(Dt,{side:"bottom",children:c("sectionsEditor.sectionsEditor.viewJson")})]}),n.jsx($n,{onClick:Mn})]})}),oe?n.jsx(Xt,{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:Ft&&j?n.jsx(cr,{rawSeo:an,innerSeo:jn,defaultResolveType:Us,seoSchema:Gs,activeResolveType:rn,seoTypeOptions:Hs,formResetKey:$,siteDefaultSeo:qs,onBreadcrumbChange:ke,onPersistRaw:Ao,onInnerChange:Po,onClearForm:Co,onBumpFormKey:Mo}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"):Gt?n.jsxs(Xt,{viewportRef:qe,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[ft&&St.length>0&&ae.length===0&&n.jsxs(n.Fragment,{children:[n.jsx(va,{listKey:`${j??""}:${m??""}`,variants:St.map((t,s)=>({index:s,label:t.label})),selectedIndex:dn,onSelect:ro,onRename:se,onDuplicate:lo,onDelete:io,onRemoveAll:uo,onReorder:co,onAdd:()=>un()}),ft&&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:c("sectionsEditor.sectionsEditor.variantRule")}),n.jsx(ns,{currentRt:We??"",currentLabel:Jt(Ut?.rule,l??{},ht,r??void 0),currentGlobalKey:Ct(Ut?.rule,l??{},r??void 0)??void 0,matchers:Ht,globals:Tn,onSelect:So,onSelectGlobal:yo,schema:jo,formValue:ct,onChange:bo,formKey:`${m??"none"}:${dn}:${We??""}`,formWrapperClassName:"pt-1",meta:r??void 0,decofile:l,onSaveReferencedBlock:Kt,sandbox:zt})]})]}),n.jsx(zn,{activeSchema:ln,formValue:ce,formResetKey:fe,onFormChange:wn,onBreadcrumbChange:L,breadcrumbPath:ae,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:r,decofile:l,onSaveReferencedBlock:Kt,sandbox:zt,previewBaseUrl:te,onRequestAddSection:kn})]},"editor-section-form"):Ee?n.jsx(Xt,{viewportRef:qe,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(zn,{activeSchema:ln,formValue:ce,formResetKey:fe,onFormChange:wn,onBreadcrumbChange:L,breadcrumbPath:ae,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:r,decofile:l,onSaveReferencedBlock:Kt,sandbox:zt,previewBaseUrl:te,onRequestAddSection:kn})},"editor-global-block"):n.jsxs(Xt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[$t&&j&&n.jsx(Ur,{listKey:j,variants:Ue,activeIndex:Me,decofile:l??{},meta:r,matchers:Ht,onSelect:wo,onReorder:ko,onRename:re,onDuplicate:To,onDelete:Do,onAdd:Mn}),$t&&ee!==null&&n.jsxs("div",{className:Ne("px-3 border-b",he?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>T(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":he,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c("sectionsEditor.sectionsEditor.variantRule")}),he?n.jsx(Ia,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(Fa,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),he&&n.jsx("div",{className:Ne("space-y-3",Vt&&"pointer-events-none opacity-50"),children:n.jsx(ns,{currentRt:ee,currentLabel:Jt(ut?.rule,l??{},ht,r??void 0),currentGlobalKey:Ct(ut?.rule,l??{},r??void 0)??void 0,matchers:Ht,globals:Tn,onSelect:go,onSelectGlobal:vo,schema:po,formValue:be,onChange:ho,formKey:`${Me}:${ee??""}`,formWrapperClassName:"space-y-3",meta:r??void 0,decofile:l,onSaveReferencedBlock:Kt,sandbox:zt})})]}),n.jsx("div",{className:"p-2 pt-3",children:n.jsx(Lr,{listKey:`${j??""}-${Me}`,rawSections:G,sections:Ie,meta:r,selectedIndex:m,onSelect:Js,onReorder:Xs,onDelete:Zs,onDuplicate:eo,onMakeReusable:ue,onToggleHidden:to,onToggleLazy:no,onAddVariant:un,onDetach:so,onAddSection:()=>Re(!0),canAddSection:fo})})]},"editor-section-list"),n.jsx(Sa,{open:F!==null,onOpenChange:t=>{t||ue(null)},defaultBlockId:F!==null?pn(Ie[F]?.label??""):"",isPending:je.isPending,onSubmit:mo}),te&&n.jsx(fr,{open:Pe,onOpenChange:t=>{Re(t),t||(Le.current=null)},meta:r,decofile:l,previewBaseUrl:te,onSelect:ao}),$e&&j&&l&&n.jsx(ba,{open:$e,onOpenChange:ze,pageKey:j,decofile:l}),pe!==null&&n.jsx(Zn,{open:!0,initialName:Et(Ue[pe]?.rule,l??{},r??void 0)?Jt(Ue[pe]?.rule,l??{},ht,r??void 0):"",autoLabel:ht(Bt(Ue[pe]?.rule,l??{},r??void 0)),isPending:Vt,onSubmit:async t=>{await Vo(pe,t)},onOpenChange:t=>{!t&&!Vt&&re(null)}}),ge!==null&&n.jsx(Zn,{open:!0,initialName:Et(St[ge]?.rule,l??{},r??void 0)?Jt(St[ge]?.rule,l??{},ht,r??void 0):"",autoLabel:ht(Bt(St[ge]?.rule,l??{},r??void 0)),isPending:Vt,onSubmit:async t=>{await No(ge,t)},onOpenChange:t=>{!t&&!Vt&&se(null)}})]})}export{Fc as SectionsEditor};
@@ -1 +1 @@
1
- import{r as d,bs as st,bq as Ne,j as i,e2 as rt,bu as Ie,br as k,e3 as lt,bn as j,bt as P,cI as $,e4 as at,aC as Ee,e5 as Re,bo as ct,cD as it,e6 as dt,cM as ut,e7 as pt,e8 as ft,e9 as mt,ea as ht,eb as gt,bp as vt,ec as xt,ed as St,ee as wt,c as ee,l as oe}from"./index-PqfClboL.js";import{i as Ct}from"./Check-tzg1v70M.js";import{t as je,n as yt}from"./ChevronUp-CdsnYS3o.js";function Pe(s,[e,t]){return Math.min(t,Math.max(e,s))}var bt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],J="Select",[de,ue,Tt]=ct(J),[ne]=vt(J,[Tt,Re]),pe=Re(),[Nt,G]=ne(J),[Pt,_t]=ne(J),Me=s=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:a,value:r,defaultValue:l,onValueChange:c,dir:u,name:m,autoComplete:v,disabled:w,required:C,form:S}=s,p=pe(e),[g,y]=d.useState(null),[h,x]=d.useState(null),[F,M]=d.useState(!1),se=st(u),[_,O]=Ne({prop:o,defaultProp:n??!1,onChange:a,caller:J}),[U,q]=Ne({prop:r,defaultProp:l,onChange:c,caller:J}),L=d.useRef(null),B=g?S||!!g.closest("form"):!0,[W,V]=d.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return i.jsx(rt,{...p,children:i.jsxs(Nt,{required:C,scope:e,trigger:g,onTriggerChange:y,valueNode:h,onValueNodeChange:x,valueNodeHasChildren:F,onValueNodeHasChildrenChange:M,contentId:Ie(),value:U,onValueChange:q,open:_,onOpenChange:O,dir:se,triggerPointerDownPosRef:L,disabled:w,children:[i.jsx(de.Provider,{scope:e,children:i.jsx(Pt,{scope:s.__scopeSelect,onNativeOptionAdd:d.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:d.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?i.jsxs(et,{"aria-hidden":!0,required:C,tabIndex:-1,name:m,autoComplete:v,value:U,onChange:E=>q(E.target.value),disabled:w,form:S,children:[U===void 0?i.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};Me.displayName=J;var Ae="SelectTrigger",Oe=d.forwardRef((s,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=s,a=pe(t),r=G(Ae,t),l=r.disabled||o,c=k(e,r.onTriggerChange),u=ue(t),m=d.useRef("touch"),[v,w,C]=ot(p=>{const g=u().filter(x=>!x.disabled),y=g.find(x=>x.value===r.value),h=nt(g,p,y);h!==void 0&&r.onValueChange(h.value)}),S=p=>{l||(r.onOpenChange(!0),C()),p&&(r.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return i.jsx(lt,{asChild:!0,...a,children:i.jsx(j.button,{type:"button",role:"combobox","aria-controls":r.contentId,"aria-expanded":r.open,"aria-required":r.required,"aria-autocomplete":"none",dir:r.dir,"data-state":r.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":tt(r.value)?"":void 0,...n,ref:c,onClick:P(n.onClick,p=>{p.currentTarget.focus(),m.current!=="mouse"&&S(p)}),onPointerDown:P(n.onPointerDown,p=>{m.current=p.pointerType;const g=p.target;g.hasPointerCapture(p.pointerId)&&g.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:P(n.onKeyDown,p=>{const g=v.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&w(p.key),!(g&&p.key===" ")&&bt.includes(p.key)&&(S(),p.preventDefault())})})})});Oe.displayName=Ae;var De="SelectValue",ke=d.forwardRef((s,e)=>{const{__scopeSelect:t,className:o,style:n,children:a,placeholder:r="",...l}=s,c=G(De,t),{onValueNodeHasChildrenChange:u}=c,m=a!==void 0,v=k(e,c.onValueNodeChange);return $(()=>{u(m)},[u,m]),i.jsx(j.span,{...l,ref:v,style:{pointerEvents:"none"},children:tt(c.value)?i.jsx(i.Fragment,{children:r}):a})});ke.displayName=De;var Et="SelectIcon",Le=d.forwardRef((s,e)=>{const{__scopeSelect:t,children:o,...n}=s;return i.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});Le.displayName=Et;var Rt="SelectPortal",Be=s=>i.jsx(at,{asChild:!0,...s});Be.displayName=Rt;var Q="SelectContent",Ve=d.forwardRef((s,e)=>{const t=G(Q,s.__scopeSelect),[o,n]=d.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const a=o;return a?Ee.createPortal(i.jsx(He,{scope:s.__scopeSelect,children:i.jsx(de.Slot,{scope:s.__scopeSelect,children:i.jsx("div",{children:s.children})})}),a):null}return i.jsx(ze,{...s,ref:e})});Ve.displayName=Q;var A=10,[He,Y]=ne(Q),jt="SelectContentImpl",Mt=xt("SelectContent.RemoveScroll"),ze=d.forwardRef((s,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:a,onPointerDownOutside:r,side:l,sideOffset:c,align:u,alignOffset:m,arrowPadding:v,collisionBoundary:w,collisionPadding:C,sticky:S,hideWhenDetached:p,avoidCollisions:g,...y}=s,h=G(Q,t),[x,F]=d.useState(null),[M,se]=d.useState(null),_=k(e,f=>F(f)),[O,U]=d.useState(null),[q,L]=d.useState(null),B=ue(t),[W,V]=d.useState(!1),H=d.useRef(!1);d.useEffect(()=>{if(x)return pt(x)},[x]),ft();const E=d.useCallback(f=>{const[T,...R]=B().map(N=>N.ref.current),[b]=R.slice(-1),I=document.activeElement;for(const N of f)if(N===I||(N?.scrollIntoView({block:"nearest"}),N===T&&M&&(M.scrollTop=0),N===b&&M&&(M.scrollTop=M.scrollHeight),N?.focus(),document.activeElement!==I))return},[B,M]),D=d.useCallback(()=>E([O,x]),[E,O,x]);d.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=h;d.useEffect(()=>{if(x){let f={x:0,y:0};const T=b=>{f={x:Math.abs(Math.round(b.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(b.pageY)-(K.current?.y??0))}},R=b=>{f.x<=10&&f.y<=10?b.preventDefault():x.contains(b.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]),d.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]=ot(f=>{const T=B().filter(I=>!I.disabled),R=T.find(I=>I.ref.current===document.activeElement),b=nt(T,f,R);b&&setTimeout(()=>b.ref.current.focus())}),me=d.useCallback((f,T,R)=>{const b=!H.current&&!R;(h.value!==void 0&&h.value===T||b)&&(U(f),b&&(H.current=!0))},[h.value]),he=d.useCallback(()=>x?.focus(),[x]),te=d.useCallback((f,T,R)=>{const b=!H.current&&!R;(h.value!==void 0&&h.value===T||b)&&L(f)},[h.value]),ce=o==="popper"?Se:Fe,re=ce===Se?{side:l,sideOffset:c,align:u,alignOffset:m,arrowPadding:v,collisionBoundary:w,collisionPadding:C,sticky:S,hideWhenDetached:p,avoidCollisions:g}:{};return i.jsx(He,{scope:t,content:x,viewport:M,onViewportChange:se,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:i.jsx(mt,{as:Mt,allowPinchZoom:!0,children:i.jsx(ht,{asChild:!0,trapped:h.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:P(n,f=>{h.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:i.jsx(gt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:r,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>h.onOpenChange(!1),children:i.jsx(ce,{role:"listbox",id:h.contentId,"data-state":h.open?"open":"closed",dir:h.dir,onContextMenu:f=>f.preventDefault(),...y,...re,onPlaced:()=>V(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:P(y.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 b=B().filter(I=>!I.disabled).map(I=>I.ref.current);if(["ArrowUp","End"].includes(f.key)&&(b=b.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const I=f.target,N=b.indexOf(I);b=b.slice(N+1)}setTimeout(()=>E(b)),f.preventDefault()}})})})})})})});ze.displayName=jt;var At="SelectItemAlignedPosition",Fe=d.forwardRef((s,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=s,a=G(Q,t),r=Y(Q,t),[l,c]=d.useState(null),[u,m]=d.useState(null),v=k(e,_=>m(_)),w=ue(t),C=d.useRef(!1),S=d.useRef(!0),{viewport:p,selectedItem:g,selectedItemText:y,focusSelectedItem:h}=r,x=d.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&u&&p&&g&&y){const _=a.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),U=a.valueNode.getBoundingClientRect(),q=y.getBoundingClientRect();if(a.dir!=="rtl"){const I=q.left-O.left,N=U.left-I,X=_.left-N,Z=_.width+X,ge=Math.max(Z,O.width),ve=window.innerWidth-A,xe=Pe(N,[A,Math.max(A,ve-ge)]);l.style.minWidth=Z+"px",l.style.left=xe+"px"}else{const I=O.right-q.right,N=window.innerWidth-U.right-I,X=window.innerWidth-_.right-N,Z=_.width+X,ge=Math.max(Z,O.width),ve=window.innerWidth-A,xe=Pe(N,[A,Math.max(A,ve-ge)]);l.style.minWidth=Z+"px",l.style.right=xe+"px"}const L=w(),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(g.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=_.top+_.height/2-A,ce=B-te,re=g.offsetHeight/2,f=g.offsetTop+re,T=H+E+f,R=K-T;if(T<=te){const I=L.length>0&&g===L[L.length-1].ref.current;l.style.bottom="0px";const N=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ce,re+(I?he:0)+N+D),Z=T+X;l.style.height=Z+"px"}else{const I=L.length>0&&g===L[0].ref.current;l.style.top="0px";const X=Math.max(te,H+p.offsetTop+(I?me:0)+re)+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(()=>C.current=!0)}},[w,a.trigger,a.valueNode,l,u,p,g,y,a.dir,o]);$(()=>x(),[x]);const[F,M]=d.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const se=d.useCallback(_=>{_&&S.current===!0&&(x(),h?.(),S.current=!1)},[x,h]);return i.jsx(Dt,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:C,onScrollButtonChange:se,children:i.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:F},children:i.jsx(j.div,{...n,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});Fe.displayName=At;var Ot="SelectPopperPosition",Se=d.forwardRef((s,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...a}=s,r=pe(t);return i.jsx(St,{...r,...a,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...a.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=Ot;var[Dt,Te]=ne(Q,{}),we="SelectViewport",Ue=d.forwardRef((s,e)=>{const{__scopeSelect:t,nonce:o,...n}=s,a=Y(we,t),r=Te(we,t),l=k(e,a.onViewportChange),c=d.useRef(0);return i.jsxs(i.Fragment,{children:[i.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}),i.jsx(de.Slot,{scope:t,children:i.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:P(n.onScroll,u=>{const m=u.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:w}=r;if(w?.current&&v){const C=Math.abs(c.current-m.scrollTop);if(C>0){const S=window.innerHeight-A*2,p=parseFloat(v.style.minHeight),g=parseFloat(v.style.height),y=Math.max(p,g);if(y<S){const h=y+C,x=Math.min(S,h),F=h-x;v.style.height=x+"px",v.style.bottom==="0px"&&(m.scrollTop=F>0?F:0,v.style.justifyContent="flex-end")}}}c.current=m.scrollTop})})})]})});Ue.displayName=we;var We="SelectGroup",[kt,Lt]=ne(We),Bt=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s,n=Ie();return i.jsx(kt,{scope:t,id:n,children:i.jsx(j.div,{role:"group","aria-labelledby":n,...o,ref:e})})});Bt.displayName=We;var Ke="SelectLabel",Vt=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s,n=Lt(Ke,t);return i.jsx(j.div,{id:n.id,...o,ref:e})});Vt.displayName=Ke;var ie="SelectItem",[Ht,$e]=ne(ie),Ge=d.forwardRef((s,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:a,...r}=s,l=G(ie,t),c=Y(ie,t),u=l.value===o,[m,v]=d.useState(a??""),[w,C]=d.useState(!1),S=k(e,h=>c.itemRefCallback?.(h,o,n)),p=Ie(),g=d.useRef("touch"),y=()=>{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 i.jsx(Ht,{scope:t,value:o,disabled:n,textId:p,isSelected:u,onItemTextChange:d.useCallback(h=>{v(x=>x||(h?.textContent??"").trim())},[]),children:i.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:m,children:i.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":w?"":void 0,"aria-selected":u&&w,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...r,ref:S,onFocus:P(r.onFocus,()=>C(!0)),onBlur:P(r.onBlur,()=>C(!1)),onClick:P(r.onClick,()=>{g.current!=="mouse"&&y()}),onPointerUp:P(r.onPointerUp,()=>{g.current==="mouse"&&y()}),onPointerDown:P(r.onPointerDown,h=>{g.current=h.pointerType}),onPointerMove:P(r.onPointerMove,h=>{g.current=h.pointerType,n?c.onItemLeave?.():g.current==="mouse"&&h.currentTarget.focus({preventScroll:!0})}),onPointerLeave:P(r.onPointerLeave,h=>{h.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:P(r.onKeyDown,h=>{c.searchRef?.current!==""&&h.key===" "||(It.includes(h.key)&&y(),h.key===" "&&h.preventDefault())})})})})});Ge.displayName=ie;var le="SelectItemText",Ye=d.forwardRef((s,e)=>{const{__scopeSelect:t,className:o,style:n,...a}=s,r=G(le,t),l=Y(le,t),c=$e(le,t),u=_t(le,t),[m,v]=d.useState(null),w=k(e,y=>v(y),c.onItemTextChange,y=>l.itemTextRefCallback?.(y,c.value,c.disabled)),C=m?.textContent,S=d.useMemo(()=>i.jsx("option",{value:c.value,disabled:c.disabled,children:C},c.value),[c.disabled,c.value,C]),{onNativeOptionAdd:p,onNativeOptionRemove:g}=u;return $(()=>(p(S),()=>g(S)),[p,g,S]),i.jsxs(i.Fragment,{children:[i.jsx(j.span,{id:c.textId,...a,ref:w}),c.isSelected&&r.valueNode&&!r.valueNodeHasChildren?Ee.createPortal(a.children,r.valueNode):null]})});Ye.displayName=le;var qe="SelectItemIndicator",Xe=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s;return $e(qe,t).isSelected?i.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});Xe.displayName=qe;var Ce="SelectScrollUpButton",Ze=d.forwardRef((s,e)=>{const t=Y(Ce,s.__scopeSelect),o=Te(Ce,s.__scopeSelect),[n,a]=d.useState(!1),r=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=c.scrollTop>0;a(u)};const c=t.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?i.jsx(Qe,{...s,ref:r,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=t;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});Ze.displayName=Ce;var ye="SelectScrollDownButton",Je=d.forwardRef((s,e)=>{const t=Y(ye,s.__scopeSelect),o=Te(ye,s.__scopeSelect),[n,a]=d.useState(!1),r=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=c.scrollHeight-c.clientHeight,m=Math.ceil(c.scrollTop)<u;a(m)};const c=t.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?i.jsx(Qe,{...s,ref:r,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=t;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});Je.displayName=ye;var Qe=d.forwardRef((s,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=s,a=Y("SelectScrollButton",t),r=d.useRef(null),l=ue(t),c=d.useCallback(()=>{r.current!==null&&(window.clearInterval(r.current),r.current=null)},[]);return d.useEffect(()=>()=>c(),[c]),$(()=>{l().find(m=>m.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),i.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:P(n.onPointerDown,()=>{r.current===null&&(r.current=window.setInterval(o,50))}),onPointerMove:P(n.onPointerMove,()=>{a.onItemLeave?.(),r.current===null&&(r.current=window.setInterval(o,50))}),onPointerLeave:P(n.onPointerLeave,()=>{c()})})}),zt="SelectSeparator",Ft=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s;return i.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});Ft.displayName=zt;var be="SelectArrow",Ut=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s,n=pe(t),a=G(be,t),r=Y(be,t);return a.open&&r.position==="popper"?i.jsx(wt,{...n,...o,ref:e}):null});Ut.displayName=be;var Wt="SelectBubbleInput",et=d.forwardRef(({__scopeSelect:s,value:e,...t},o)=>{const n=d.useRef(null),a=k(o,n),r=it(e);return d.useEffect(()=>{const l=n.current;if(!l)return;const c=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(c,"value").set;if(r!==e&&m){const v=new Event("change",{bubbles:!0});m.call(l,e),l.dispatchEvent(v)}},[r,e]),i.jsx(j.select,{...t,style:{...dt,...t.style},ref:a,defaultValue:e})});et.displayName=Wt;function tt(s){return s===""||s===void 0}function ot(s){const e=ut(s),t=d.useRef(""),o=d.useRef(0),n=d.useCallback(r=>{const l=t.current+r;e(l),(function c(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>c(""),1e3))})(l)},[e]),a=d.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return d.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,a]}function nt(s,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,a=t?s.indexOf(t):-1;let r=Kt(s,Math.max(a,0));n.length===1&&(r=r.filter(u=>u!==t));const c=r.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return c!==t?c:void 0}function Kt(s,e){return s.map((t,o)=>s[(e+o)%s.length])}var $t=Me,Gt=Oe,Yt=ke,qt=Le,Xt=Be,Zt=Ve,Jt=Ue,Qt=Ge,_e=Ye,eo=Xe,to=Ze,oo=Je;function co(s){const e=ee.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx($t,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function io(s){const e=ee.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(Yt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function uo(s){const e=ee.c(13);let t,o,n,a;e[0]!==s?({className:o,size:a,children:t,...n}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=n,e[4]=a):(t=e[1],o=e[2],n=e[3],a=e[4]);const r=a===void 0?"default":a;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 c;e[7]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx(qt,{asChild:!0,children:i.jsx(je,{className:"size-4 opacity-50"})}),e[7]=c):c=e[7];let u;return e[8]!==t||e[9]!==n||e[10]!==r||e[11]!==l?(u=i.jsxs(Gt,{"data-slot":"select-trigger","data-size":r,className:l,...n,children:[t,c]}),e[8]=t,e[9]=n,e[10]=r,e[11]=l,e[12]=u):u=e[12],u}function po(s){const e=ee.c(25);let t,o,n,a,r;e[0]!==s?({className:o,children:t,position:a,hideScrollButtons:r,...n}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=n,e[4]=a,e[5]=r):(t=e[1],o=e[2],n=e[3],a=e[4],r=e[5]);const l=a===void 0?"popper":a,c=r===void 0?!1:r,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 m;e[6]!==o||e[7]!==u?(m=oe("notranslate 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]=m):m=e[8];let v;e[9]!==c?(v=!c&&i.jsx(no,{}),e[9]=c,e[10]=v):v=e[10];const w=l==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let C;e[11]!==w?(C=oe("p-1",w),e[11]=w,e[12]=C):C=e[12];let S;e[13]!==t||e[14]!==C?(S=i.jsx(Jt,{className:C,children:t}),e[13]=t,e[14]=C,e[15]=S):S=e[15];let p;e[16]!==c?(p=!c&&i.jsx(so,{}),e[16]=c,e[17]=p):p=e[17];let g;return e[18]!==l||e[19]!==n||e[20]!==m||e[21]!==v||e[22]!==S||e[23]!==p?(g=i.jsx(Xt,{children:i.jsxs(Zt,{"data-slot":"select-content",translate:"no",className:m,position:l,...n,children:[v,S,p]})}),e[18]=l,e[19]=n,e[20]=m,e[21]=v,e[22]=S,e[23]=p,e[24]=g):g=e[24],g}function fo(s){const e=ee.c(19);let t,o,n,a,r;e[0]!==s?({className:o,children:t,description:n,hideCheck:r,...a}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=n,e[4]=a,e[5]=r):(t=e[1],o=e[2],n=e[3],a=e[4],r=e[5]);const l=r===void 0?!1:r,c=n&&"items-start py-2";let u;e[6]!==o||e[7]!==c?(u=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",c,o),e[6]=o,e[7]=c,e[8]=u):u=e[8];let m;e[9]!==l?(m=!l&&i.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:i.jsx(eo,{children:i.jsx(Ct,{className:"size-4"})})}),e[9]=l,e[10]=m):m=e[10];let v;e[11]!==t||e[12]!==n?(v=n?i.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[i.jsx(_e,{children:t}),i.jsx("span",{className:"text-xs text-muted-foreground whitespace-normal",children:n})]}):i.jsx(_e,{children:t}),e[11]=t,e[12]=n,e[13]=v):v=e[13];let w;return e[14]!==a||e[15]!==u||e[16]!==m||e[17]!==v?(w=i.jsxs(Qt,{"data-slot":"select-item",className:u,...a,children:[m,v]}),e[14]=a,e[15]=u,e[16]=m,e[17]=v,e[18]=w):w=e[18],w}function no(s){const e=ee.c(9);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,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 a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(yt,{className:"size-4"}),e[5]=a):a=e[5];let r;return e[6]!==o||e[7]!==n?(r=i.jsx(to,{"data-slot":"select-scroll-up-button",className:n,...o,children:a}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r}function so(s){const e=ee.c(9);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,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 a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(je,{className:"size-4"}),e[5]=a):a=e[5];let r;return e[6]!==o||e[7]!==n?(r=i.jsx(oo,{"data-slot":"select-scroll-down-button",className:n,...o,children:a}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r}export{co as S,uo as a,io as b,po as c,fo as d,Pe as e};
1
+ import{r as d,br as st,bp as Ne,j as i,e1 as rt,bt as Ie,bq as k,e2 as lt,bm as j,bs as P,cI as $,e3 as at,aB as Ee,e4 as Re,bn as ct,cD as it,e5 as dt,cM as ut,e6 as pt,e7 as ft,e8 as mt,e9 as ht,ea as gt,bo as vt,eb as xt,ec as St,ed as wt,c as ee,l as oe}from"./index-BkawI5he.js";import{i as yt}from"./Check-AnkVYvzC.js";import{t as je,n as Ct}from"./ChevronUp-3g3WN6eT.js";function Pe(s,[e,t]){return Math.min(t,Math.max(e,s))}var bt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],J="Select",[de,ue,Tt]=ct(J),[ne]=vt(J,[Tt,Re]),pe=Re(),[Nt,G]=ne(J),[Pt,_t]=ne(J),Me=s=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:a,value:r,defaultValue:l,onValueChange:c,dir:u,name:m,autoComplete:v,disabled:w,required:y,form:S}=s,p=pe(e),[g,C]=d.useState(null),[h,x]=d.useState(null),[F,M]=d.useState(!1),se=st(u),[_,O]=Ne({prop:o,defaultProp:n??!1,onChange:a,caller:J}),[U,q]=Ne({prop:r,defaultProp:l,onChange:c,caller:J}),L=d.useRef(null),B=g?S||!!g.closest("form"):!0,[W,V]=d.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return i.jsx(rt,{...p,children:i.jsxs(Nt,{required:y,scope:e,trigger:g,onTriggerChange:C,valueNode:h,onValueNodeChange:x,valueNodeHasChildren:F,onValueNodeHasChildrenChange:M,contentId:Ie(),value:U,onValueChange:q,open:_,onOpenChange:O,dir:se,triggerPointerDownPosRef:L,disabled:w,children:[i.jsx(de.Provider,{scope:e,children:i.jsx(Pt,{scope:s.__scopeSelect,onNativeOptionAdd:d.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:d.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?i.jsxs(et,{"aria-hidden":!0,required:y,tabIndex:-1,name:m,autoComplete:v,value:U,onChange:E=>q(E.target.value),disabled:w,form:S,children:[U===void 0?i.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};Me.displayName=J;var Ae="SelectTrigger",Oe=d.forwardRef((s,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=s,a=pe(t),r=G(Ae,t),l=r.disabled||o,c=k(e,r.onTriggerChange),u=ue(t),m=d.useRef("touch"),[v,w,y]=ot(p=>{const g=u().filter(x=>!x.disabled),C=g.find(x=>x.value===r.value),h=nt(g,p,C);h!==void 0&&r.onValueChange(h.value)}),S=p=>{l||(r.onOpenChange(!0),y()),p&&(r.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return i.jsx(lt,{asChild:!0,...a,children:i.jsx(j.button,{type:"button",role:"combobox","aria-controls":r.contentId,"aria-expanded":r.open,"aria-required":r.required,"aria-autocomplete":"none",dir:r.dir,"data-state":r.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":tt(r.value)?"":void 0,...n,ref:c,onClick:P(n.onClick,p=>{p.currentTarget.focus(),m.current!=="mouse"&&S(p)}),onPointerDown:P(n.onPointerDown,p=>{m.current=p.pointerType;const g=p.target;g.hasPointerCapture(p.pointerId)&&g.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:P(n.onKeyDown,p=>{const g=v.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&w(p.key),!(g&&p.key===" ")&&bt.includes(p.key)&&(S(),p.preventDefault())})})})});Oe.displayName=Ae;var De="SelectValue",ke=d.forwardRef((s,e)=>{const{__scopeSelect:t,className:o,style:n,children:a,placeholder:r="",...l}=s,c=G(De,t),{onValueNodeHasChildrenChange:u}=c,m=a!==void 0,v=k(e,c.onValueNodeChange);return $(()=>{u(m)},[u,m]),i.jsx(j.span,{...l,ref:v,style:{pointerEvents:"none"},children:tt(c.value)?i.jsx(i.Fragment,{children:r}):a})});ke.displayName=De;var Et="SelectIcon",Le=d.forwardRef((s,e)=>{const{__scopeSelect:t,children:o,...n}=s;return i.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});Le.displayName=Et;var Rt="SelectPortal",Be=s=>i.jsx(at,{asChild:!0,...s});Be.displayName=Rt;var Q="SelectContent",Ve=d.forwardRef((s,e)=>{const t=G(Q,s.__scopeSelect),[o,n]=d.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const a=o;return a?Ee.createPortal(i.jsx(He,{scope:s.__scopeSelect,children:i.jsx(de.Slot,{scope:s.__scopeSelect,children:i.jsx("div",{children:s.children})})}),a):null}return i.jsx(ze,{...s,ref:e})});Ve.displayName=Q;var A=10,[He,Y]=ne(Q),jt="SelectContentImpl",Mt=xt("SelectContent.RemoveScroll"),ze=d.forwardRef((s,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:a,onPointerDownOutside:r,side:l,sideOffset:c,align:u,alignOffset:m,arrowPadding:v,collisionBoundary:w,collisionPadding:y,sticky:S,hideWhenDetached:p,avoidCollisions:g,...C}=s,h=G(Q,t),[x,F]=d.useState(null),[M,se]=d.useState(null),_=k(e,f=>F(f)),[O,U]=d.useState(null),[q,L]=d.useState(null),B=ue(t),[W,V]=d.useState(!1),H=d.useRef(!1);d.useEffect(()=>{if(x)return pt(x)},[x]),ft();const E=d.useCallback(f=>{const[T,...R]=B().map(N=>N.ref.current),[b]=R.slice(-1),I=document.activeElement;for(const N of f)if(N===I||(N?.scrollIntoView({block:"nearest"}),N===T&&M&&(M.scrollTop=0),N===b&&M&&(M.scrollTop=M.scrollHeight),N?.focus(),document.activeElement!==I))return},[B,M]),D=d.useCallback(()=>E([O,x]),[E,O,x]);d.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=h;d.useEffect(()=>{if(x){let f={x:0,y:0};const T=b=>{f={x:Math.abs(Math.round(b.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(b.pageY)-(K.current?.y??0))}},R=b=>{f.x<=10&&f.y<=10?b.preventDefault():x.contains(b.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]),d.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]=ot(f=>{const T=B().filter(I=>!I.disabled),R=T.find(I=>I.ref.current===document.activeElement),b=nt(T,f,R);b&&setTimeout(()=>b.ref.current.focus())}),me=d.useCallback((f,T,R)=>{const b=!H.current&&!R;(h.value!==void 0&&h.value===T||b)&&(U(f),b&&(H.current=!0))},[h.value]),he=d.useCallback(()=>x?.focus(),[x]),te=d.useCallback((f,T,R)=>{const b=!H.current&&!R;(h.value!==void 0&&h.value===T||b)&&L(f)},[h.value]),ce=o==="popper"?Se:Fe,re=ce===Se?{side:l,sideOffset:c,align:u,alignOffset:m,arrowPadding:v,collisionBoundary:w,collisionPadding:y,sticky:S,hideWhenDetached:p,avoidCollisions:g}:{};return i.jsx(He,{scope:t,content:x,viewport:M,onViewportChange:se,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:i.jsx(mt,{as:Mt,allowPinchZoom:!0,children:i.jsx(ht,{asChild:!0,trapped:h.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:P(n,f=>{h.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:i.jsx(gt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:r,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>h.onOpenChange(!1),children:i.jsx(ce,{role:"listbox",id:h.contentId,"data-state":h.open?"open":"closed",dir:h.dir,onContextMenu:f=>f.preventDefault(),...C,...re,onPlaced:()=>V(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:P(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 b=B().filter(I=>!I.disabled).map(I=>I.ref.current);if(["ArrowUp","End"].includes(f.key)&&(b=b.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const I=f.target,N=b.indexOf(I);b=b.slice(N+1)}setTimeout(()=>E(b)),f.preventDefault()}})})})})})})});ze.displayName=jt;var At="SelectItemAlignedPosition",Fe=d.forwardRef((s,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=s,a=G(Q,t),r=Y(Q,t),[l,c]=d.useState(null),[u,m]=d.useState(null),v=k(e,_=>m(_)),w=ue(t),y=d.useRef(!1),S=d.useRef(!0),{viewport:p,selectedItem:g,selectedItemText:C,focusSelectedItem:h}=r,x=d.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&u&&p&&g&&C){const _=a.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),U=a.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(a.dir!=="rtl"){const I=q.left-O.left,N=U.left-I,X=_.left-N,Z=_.width+X,ge=Math.max(Z,O.width),ve=window.innerWidth-A,xe=Pe(N,[A,Math.max(A,ve-ge)]);l.style.minWidth=Z+"px",l.style.left=xe+"px"}else{const I=O.right-q.right,N=window.innerWidth-U.right-I,X=window.innerWidth-_.right-N,Z=_.width+X,ge=Math.max(Z,O.width),ve=window.innerWidth-A,xe=Pe(N,[A,Math.max(A,ve-ge)]);l.style.minWidth=Z+"px",l.style.right=xe+"px"}const L=w(),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(g.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=_.top+_.height/2-A,ce=B-te,re=g.offsetHeight/2,f=g.offsetTop+re,T=H+E+f,R=K-T;if(T<=te){const I=L.length>0&&g===L[L.length-1].ref.current;l.style.bottom="0px";const N=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ce,re+(I?he:0)+N+D),Z=T+X;l.style.height=Z+"px"}else{const I=L.length>0&&g===L[0].ref.current;l.style.top="0px";const X=Math.max(te,H+p.offsetTop+(I?me:0)+re)+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(()=>y.current=!0)}},[w,a.trigger,a.valueNode,l,u,p,g,C,a.dir,o]);$(()=>x(),[x]);const[F,M]=d.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const se=d.useCallback(_=>{_&&S.current===!0&&(x(),h?.(),S.current=!1)},[x,h]);return i.jsx(Dt,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:y,onScrollButtonChange:se,children:i.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:F},children:i.jsx(j.div,{...n,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});Fe.displayName=At;var Ot="SelectPopperPosition",Se=d.forwardRef((s,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...a}=s,r=pe(t);return i.jsx(St,{...r,...a,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...a.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=Ot;var[Dt,Te]=ne(Q,{}),we="SelectViewport",Ue=d.forwardRef((s,e)=>{const{__scopeSelect:t,nonce:o,...n}=s,a=Y(we,t),r=Te(we,t),l=k(e,a.onViewportChange),c=d.useRef(0);return i.jsxs(i.Fragment,{children:[i.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}),i.jsx(de.Slot,{scope:t,children:i.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:P(n.onScroll,u=>{const m=u.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:w}=r;if(w?.current&&v){const y=Math.abs(c.current-m.scrollTop);if(y>0){const S=window.innerHeight-A*2,p=parseFloat(v.style.minHeight),g=parseFloat(v.style.height),C=Math.max(p,g);if(C<S){const h=C+y,x=Math.min(S,h),F=h-x;v.style.height=x+"px",v.style.bottom==="0px"&&(m.scrollTop=F>0?F:0,v.style.justifyContent="flex-end")}}}c.current=m.scrollTop})})})]})});Ue.displayName=we;var We="SelectGroup",[kt,Lt]=ne(We),Bt=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s,n=Ie();return i.jsx(kt,{scope:t,id:n,children:i.jsx(j.div,{role:"group","aria-labelledby":n,...o,ref:e})})});Bt.displayName=We;var Ke="SelectLabel",Vt=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s,n=Lt(Ke,t);return i.jsx(j.div,{id:n.id,...o,ref:e})});Vt.displayName=Ke;var ie="SelectItem",[Ht,$e]=ne(ie),Ge=d.forwardRef((s,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:a,...r}=s,l=G(ie,t),c=Y(ie,t),u=l.value===o,[m,v]=d.useState(a??""),[w,y]=d.useState(!1),S=k(e,h=>c.itemRefCallback?.(h,o,n)),p=Ie(),g=d.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 i.jsx(Ht,{scope:t,value:o,disabled:n,textId:p,isSelected:u,onItemTextChange:d.useCallback(h=>{v(x=>x||(h?.textContent??"").trim())},[]),children:i.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:m,children:i.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":w?"":void 0,"aria-selected":u&&w,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...r,ref:S,onFocus:P(r.onFocus,()=>y(!0)),onBlur:P(r.onBlur,()=>y(!1)),onClick:P(r.onClick,()=>{g.current!=="mouse"&&C()}),onPointerUp:P(r.onPointerUp,()=>{g.current==="mouse"&&C()}),onPointerDown:P(r.onPointerDown,h=>{g.current=h.pointerType}),onPointerMove:P(r.onPointerMove,h=>{g.current=h.pointerType,n?c.onItemLeave?.():g.current==="mouse"&&h.currentTarget.focus({preventScroll:!0})}),onPointerLeave:P(r.onPointerLeave,h=>{h.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:P(r.onKeyDown,h=>{c.searchRef?.current!==""&&h.key===" "||(It.includes(h.key)&&C(),h.key===" "&&h.preventDefault())})})})})});Ge.displayName=ie;var le="SelectItemText",Ye=d.forwardRef((s,e)=>{const{__scopeSelect:t,className:o,style:n,...a}=s,r=G(le,t),l=Y(le,t),c=$e(le,t),u=_t(le,t),[m,v]=d.useState(null),w=k(e,C=>v(C),c.onItemTextChange,C=>l.itemTextRefCallback?.(C,c.value,c.disabled)),y=m?.textContent,S=d.useMemo(()=>i.jsx("option",{value:c.value,disabled:c.disabled,children:y},c.value),[c.disabled,c.value,y]),{onNativeOptionAdd:p,onNativeOptionRemove:g}=u;return $(()=>(p(S),()=>g(S)),[p,g,S]),i.jsxs(i.Fragment,{children:[i.jsx(j.span,{id:c.textId,...a,ref:w}),c.isSelected&&r.valueNode&&!r.valueNodeHasChildren?Ee.createPortal(a.children,r.valueNode):null]})});Ye.displayName=le;var qe="SelectItemIndicator",Xe=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s;return $e(qe,t).isSelected?i.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});Xe.displayName=qe;var ye="SelectScrollUpButton",Ze=d.forwardRef((s,e)=>{const t=Y(ye,s.__scopeSelect),o=Te(ye,s.__scopeSelect),[n,a]=d.useState(!1),r=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=c.scrollTop>0;a(u)};const c=t.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?i.jsx(Qe,{...s,ref:r,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=t;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});Ze.displayName=ye;var Ce="SelectScrollDownButton",Je=d.forwardRef((s,e)=>{const t=Y(Ce,s.__scopeSelect),o=Te(Ce,s.__scopeSelect),[n,a]=d.useState(!1),r=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=c.scrollHeight-c.clientHeight,m=Math.ceil(c.scrollTop)<u;a(m)};const c=t.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?i.jsx(Qe,{...s,ref:r,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=t;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});Je.displayName=Ce;var Qe=d.forwardRef((s,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=s,a=Y("SelectScrollButton",t),r=d.useRef(null),l=ue(t),c=d.useCallback(()=>{r.current!==null&&(window.clearInterval(r.current),r.current=null)},[]);return d.useEffect(()=>()=>c(),[c]),$(()=>{l().find(m=>m.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),i.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:P(n.onPointerDown,()=>{r.current===null&&(r.current=window.setInterval(o,50))}),onPointerMove:P(n.onPointerMove,()=>{a.onItemLeave?.(),r.current===null&&(r.current=window.setInterval(o,50))}),onPointerLeave:P(n.onPointerLeave,()=>{c()})})}),zt="SelectSeparator",Ft=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s;return i.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});Ft.displayName=zt;var be="SelectArrow",Ut=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s,n=pe(t),a=G(be,t),r=Y(be,t);return a.open&&r.position==="popper"?i.jsx(wt,{...n,...o,ref:e}):null});Ut.displayName=be;var Wt="SelectBubbleInput",et=d.forwardRef(({__scopeSelect:s,value:e,...t},o)=>{const n=d.useRef(null),a=k(o,n),r=it(e);return d.useEffect(()=>{const l=n.current;if(!l)return;const c=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(c,"value").set;if(r!==e&&m){const v=new Event("change",{bubbles:!0});m.call(l,e),l.dispatchEvent(v)}},[r,e]),i.jsx(j.select,{...t,style:{...dt,...t.style},ref:a,defaultValue:e})});et.displayName=Wt;function tt(s){return s===""||s===void 0}function ot(s){const e=ut(s),t=d.useRef(""),o=d.useRef(0),n=d.useCallback(r=>{const l=t.current+r;e(l),(function c(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>c(""),1e3))})(l)},[e]),a=d.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return d.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,a]}function nt(s,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,a=t?s.indexOf(t):-1;let r=Kt(s,Math.max(a,0));n.length===1&&(r=r.filter(u=>u!==t));const c=r.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return c!==t?c:void 0}function Kt(s,e){return s.map((t,o)=>s[(e+o)%s.length])}var $t=Me,Gt=Oe,Yt=ke,qt=Le,Xt=Be,Zt=Ve,Jt=Ue,Qt=Ge,_e=Ye,eo=Xe,to=Ze,oo=Je;function co(s){const e=ee.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx($t,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function io(s){const e=ee.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(Yt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function uo(s){const e=ee.c(13);let t,o,n,a;e[0]!==s?({className:o,size:a,children:t,...n}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=n,e[4]=a):(t=e[1],o=e[2],n=e[3],a=e[4]);const r=a===void 0?"default":a;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 c;e[7]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx(qt,{asChild:!0,children:i.jsx(je,{className:"size-4 opacity-50"})}),e[7]=c):c=e[7];let u;return e[8]!==t||e[9]!==n||e[10]!==r||e[11]!==l?(u=i.jsxs(Gt,{"data-slot":"select-trigger","data-size":r,className:l,...n,children:[t,c]}),e[8]=t,e[9]=n,e[10]=r,e[11]=l,e[12]=u):u=e[12],u}function po(s){const e=ee.c(25);let t,o,n,a,r;e[0]!==s?({className:o,children:t,position:a,hideScrollButtons:r,...n}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=n,e[4]=a,e[5]=r):(t=e[1],o=e[2],n=e[3],a=e[4],r=e[5]);const l=a===void 0?"popper":a,c=r===void 0?!1:r,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 m;e[6]!==o||e[7]!==u?(m=oe("notranslate 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]=m):m=e[8];let v;e[9]!==c?(v=!c&&i.jsx(no,{}),e[9]=c,e[10]=v):v=e[10];const w=l==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let y;e[11]!==w?(y=oe("p-1",w),e[11]=w,e[12]=y):y=e[12];let S;e[13]!==t||e[14]!==y?(S=i.jsx(Jt,{className:y,children:t}),e[13]=t,e[14]=y,e[15]=S):S=e[15];let p;e[16]!==c?(p=!c&&i.jsx(so,{}),e[16]=c,e[17]=p):p=e[17];let g;return e[18]!==l||e[19]!==n||e[20]!==m||e[21]!==v||e[22]!==S||e[23]!==p?(g=i.jsx(Xt,{children:i.jsxs(Zt,{"data-slot":"select-content",translate:"no",className:m,position:l,...n,children:[v,S,p]})}),e[18]=l,e[19]=n,e[20]=m,e[21]=v,e[22]=S,e[23]=p,e[24]=g):g=e[24],g}function fo(s){const e=ee.c(19);let t,o,n,a,r;e[0]!==s?({className:o,children:t,description:n,hideCheck:r,...a}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=n,e[4]=a,e[5]=r):(t=e[1],o=e[2],n=e[3],a=e[4],r=e[5]);const l=r===void 0?!1:r,c=n&&"items-start py-2";let u;e[6]!==o||e[7]!==c?(u=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",c,o),e[6]=o,e[7]=c,e[8]=u):u=e[8];let m;e[9]!==l?(m=!l&&i.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:i.jsx(eo,{children:i.jsx(yt,{className:"size-4"})})}),e[9]=l,e[10]=m):m=e[10];let v;e[11]!==t||e[12]!==n?(v=n?i.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[i.jsx(_e,{children:t}),i.jsx("span",{className:"text-xs text-muted-foreground whitespace-normal",children:n})]}):i.jsx(_e,{children:t}),e[11]=t,e[12]=n,e[13]=v):v=e[13];let w;return e[14]!==a||e[15]!==u||e[16]!==m||e[17]!==v?(w=i.jsxs(Qt,{"data-slot":"select-item",className:u,...a,children:[m,v]}),e[14]=a,e[15]=u,e[16]=m,e[17]=v,e[18]=w):w=e[18],w}function no(s){const e=ee.c(9);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,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 a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(Ct,{className:"size-4"}),e[5]=a):a=e[5];let r;return e[6]!==o||e[7]!==n?(r=i.jsx(to,{"data-slot":"select-scroll-up-button",className:n,...o,children:a}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r}function so(s){const e=ee.c(9);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,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 a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(je,{className:"size-4"}),e[5]=a):a=e[5];let r;return e[6]!==o||e[7]!==n?(r=i.jsx(oo,{"data-slot":"select-scroll-down-button",className:n,...o,children:a}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r}export{co as S,uo as a,io as b,po as c,fo as d,Pe as e};