decocms 4.176.0 → 4.177.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (223) hide show
  1. package/dist/client/assets/{AlertCircle-DgoHSCa6.js → AlertCircle-BKkj59p3.js} +1 -1
  2. package/dist/client/assets/{AreaChart-B8PkN6Dj.js → AreaChart-BGrw5ye5.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-CzhpipYZ.js → ArrowUp-hHV8dnEu.js} +1 -1
  4. package/dist/client/assets/{ArrowUpRight-HJ-SySJk.js → ArrowUpRight-DqAI4rqY.js} +1 -1
  5. package/dist/client/assets/{Check-DYjHBTZg.js → Check-B5Ocw477.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-Dq2wz_K8.js → CheckCircle-CeRr0f9K.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-8AYAqaQi.js → ChevronDown-DMeq6c1L.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-QYHUR3CH.js → ChevronRight-QXvwYeKn.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-BwstsprL.js → ChevronUp-M4yeuEfW.js} +1 -1
  10. package/dist/client/assets/{Copy01-A9kEZxuQ.js → Copy01-gnezadve.js} +1 -1
  11. package/dist/client/assets/{CpuChip01-KERcsFI3.js → CpuChip01-PDCt51S6.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-DMnvaRK-.js → DotsVertical-DwjRcP6A.js} +1 -1
  13. package/dist/client/assets/{Eye-qn4dLRcD.js → Eye-yZLJUkOu.js} +1 -1
  14. package/dist/client/assets/{FilterLines-DVyKrdrK.js → FilterLines-DuWH9nQz.js} +1 -1
  15. package/dist/client/assets/{HardDrive-CDhmT8Mp.js → HardDrive-C8l1Zp6S.js} +1 -1
  16. package/dist/client/assets/{Key01-BMqEHWvZ.js → Key01-8eNxtAQv.js} +1 -1
  17. package/dist/client/assets/{LayoutLeft-DM2MbZ1w.js → LayoutLeft-C94F55Om.js} +1 -1
  18. package/dist/client/assets/{LinkExternal01-CQtDG0da.js → LinkExternal01-Bl6piLeN.js} +1 -1
  19. package/dist/client/assets/{LogOut01-CPJNWfrn.js → LogOut01-DhQaTA2c.js} +1 -1
  20. package/dist/client/assets/{Monitor01-wqgbPiRT.js → Monitor01-BTZzveUz.js} +1 -1
  21. package/dist/client/assets/{Palette-Bph1p9n-.js → Palette-IM50iZxU.js} +1 -1
  22. package/dist/client/assets/{Play-DRYC-38J.js → Play-BNZnx80U.js} +1 -1
  23. package/dist/client/assets/{Plus-CVwkfcJG.js → Plus-Ca3Ml2LK.js} +1 -1
  24. package/dist/client/assets/{SearchLg-kMCs2Qn5.js → SearchLg-CIblHBBZ.js} +1 -1
  25. package/dist/client/assets/{SearchMd-CpktppFq.js → SearchMd-BGnU940I.js} +1 -1
  26. package/dist/client/assets/{Settings02-Ir6gkJK_.js → Settings02-DKxTap5H.js} +1 -1
  27. package/dist/client/assets/{Shield01-gsGgj4XE.js → Shield01-b72Anl0J.js} +1 -1
  28. package/dist/client/assets/{Star01-BQ_VQCxe.js → Star01-DnEuAXNt.js} +1 -1
  29. package/dist/client/assets/{Stars01-CvfdsbYh.js → Stars01-C4oq2iC_.js} +1 -1
  30. package/dist/client/assets/{Stars02-BbLZtJKs.js → Stars02-CkbAbEdB.js} +1 -1
  31. package/dist/client/assets/{Sun-DfgVj2gg.js → Sun-CsQDuyx5.js} +1 -1
  32. package/dist/client/assets/{SwitchHorizontal01-SNcdh7XR.js → SwitchHorizontal01-CG6QKK8a.js} +1 -1
  33. package/dist/client/assets/{Tool01-DawTZk8U.js → Tool01-FK_KEBNP.js} +1 -1
  34. package/dist/client/assets/{Tool02-DTO7eIxx.js → Tool02-cVrXNcsQ.js} +1 -1
  35. package/dist/client/assets/{Trash01-DD5HHtWd.js → Trash01-BwfIUnai.js} +1 -1
  36. package/dist/client/assets/{TrendUp01-DuBbjBGV.js → TrendUp01-D9erp13t.js} +1 -1
  37. package/dist/client/assets/{Upload01-B6UyPufY.js → Upload01-DW_Am5qr.js} +1 -1
  38. package/dist/client/assets/{User01-glsH12c1.js → User01-Bp6SHWEy.js} +1 -1
  39. package/dist/client/assets/{Users01-BSccQxC5.js → Users01-C1IDGxoN.js} +1 -1
  40. package/dist/client/assets/{Users03-DM8sZyNC.js → Users03-BixdONRb.js} +1 -1
  41. package/dist/client/assets/{X-D9krIRRY.js → X-CvDwW-rN.js} +1 -1
  42. package/dist/client/assets/{XCircle-id_cPfaD.js → XCircle-BPu7noSN.js} +1 -1
  43. package/dist/client/assets/{XClose-Yi3nldNz.js → XClose-1xNk-tzp.js} +1 -1
  44. package/dist/client/assets/{Zap-DcrVqprp.js → Zap-1crUVhxr.js} +1 -1
  45. package/dist/client/assets/{ZapSquare-iXkjHm19.js → ZapSquare-DHQmvZPE.js} +1 -1
  46. package/dist/client/assets/{access-gate-Bp90a8v-.js → access-gate-B5lWeKmi.js} +1 -1
  47. package/dist/client/assets/{add-section-modal-ibpGe4PR.js → add-section-modal-CfYXjzlL.js} +1 -1
  48. package/dist/client/assets/{agent-icon-lx2te62e.js → agent-icon-Cak8CGJ6.js} +1 -1
  49. package/dist/client/assets/{agents-list-DmGTQ9-l.js → agents-list-xent7roI.js} +1 -1
  50. package/dist/client/assets/ai-providers-5XiqMh7Q.js +1 -0
  51. package/dist/client/assets/{alert-dialog-DVbIa1Of.js → alert-dialog-CpxCqEN2.js} +1 -1
  52. package/dist/client/assets/{alert-BRO4RQH-.js → alert-mWK4wKIb.js} +1 -1
  53. package/dist/client/assets/{app-editor-Ly01wCwj.js → app-editor-D3zAfOep.js} +1 -1
  54. package/dist/client/assets/{auth-BruFhg3Y.js → auth-DZ7Xcgje.js} +1 -1
  55. package/dist/client/assets/{auth-catchall-Bh5WyLdO.js → auth-catchall-D1dtWonA.js} +1 -1
  56. package/dist/client/assets/{auth-entry-6PEqs9m8.js → auth-entry-BmwV4KyH.js} +1 -1
  57. package/dist/client/assets/{auth-split-layout-CtjhFxPW.js → auth-split-layout-CfI6hlU7.js} +1 -1
  58. package/dist/client/assets/{authenticate-and-persist-oauth-hVU4ZCxE.js → authenticate-and-persist-oauth-YZT_XlW1.js} +1 -1
  59. package/dist/client/assets/{automation-list-row-Bi03cpv8.js → automation-list-row-CY5mbjoe.js} +1 -1
  60. package/dist/client/assets/{automation-runs-D_fCrlsd.js → automation-runs-ZhchwZLV.js} +1 -1
  61. package/dist/client/assets/{automations-b92MPBcr.js → automations-CS0UKjL-.js} +1 -1
  62. package/dist/client/assets/{avatar-CfSwvvrb.js → avatar-Dacp4X8p.js} +1 -1
  63. package/dist/client/assets/{badge-B7J-knlJ.js → badge-DznEWlmt.js} +1 -1
  64. package/dist/client/assets/{block-document-BJMZjPC1.js → block-document-BgjTz2d-.js} +1 -1
  65. package/dist/client/assets/{brand-context-BrXE7V7M.js → brand-context-5otTfmwD.js} +1 -1
  66. package/dist/client/assets/{buckets-BoVITTHv.js → buckets-6tk5ZOMB.js} +1 -1
  67. package/dist/client/assets/{bulk-category-panel-B4_iWipL.js → bulk-category-panel-kL8_OjqP.js} +1 -1
  68. package/dist/client/assets/{calendar-QMKOnD6V.js → calendar-CTpilDEA.js} +1 -1
  69. package/dist/client/assets/{capability-load-error-C8XozWxK.js → capability-load-error-_ve37G5r.js} +1 -1
  70. package/dist/client/assets/{card-CodfA5B5.js → card-C2iwtGFp.js} +1 -1
  71. package/dist/client/assets/{category-editor-bXJCWp_m.js → category-editor-CIXf9dGr.js} +1 -1
  72. package/dist/client/assets/{chat-context-C_I5C_yI.js → chat-context-DisMiPOv.js} +1 -1
  73. package/dist/client/assets/{checkbox-v7KzBOL5.js → checkbox-BkO5OHp1.js} +1 -1
  74. package/dist/client/assets/{cli-auth-success-C-Gsmbtx.js → cli-auth-success-BbN2UAAt.js} +1 -1
  75. package/dist/client/assets/{collection-detail-pidO70ql.js → collection-detail-Dxp5hcn1.js} +1 -1
  76. package/dist/client/assets/{collection-display-button-DkFXFsOs.js → collection-display-button-hPlzDxsq.js} +1 -1
  77. package/dist/client/assets/{collection-search-CGU42tyL.js → collection-search-C4-orWMV.js} +1 -1
  78. package/dist/client/assets/{collection-table-wrapper-CqEfbXPf.js → collection-table-wrapper-z50WhZV2.js} +1 -1
  79. package/dist/client/assets/{collection-tabs-Cux53FF-.js → collection-tabs-BepyiKtU.js} +1 -1
  80. package/dist/client/assets/{command-BTSPIJyO.js → command-SbfUVBMB.js} +1 -1
  81. package/dist/client/assets/{commerce-onboarding-CTVsQmKV.js → commerce-onboarding-BViFwtqs.js} +1 -1
  82. package/dist/client/assets/{companions-core-C1ALkr4t.js → companions-core-PLS5yeYw.js} +1 -1
  83. package/dist/client/assets/{connect-CmmofoL4.js → connect-C4hNKE2-.js} +1 -1
  84. package/dist/client/assets/{connection-BiPy4E0d.js → connection-D7cW7a2d.js} +1 -1
  85. package/dist/client/assets/{connection-card-Cpkf46mx.js → connection-card-DEny4wOG.js} +1 -1
  86. package/dist/client/assets/{connection-detail-DTrk24p8.js → connection-detail-DMpwWAeH.js} +1 -1
  87. package/dist/client/assets/{connection-form-helpers-DRro6P0Z.js → connection-form-helpers-BbkQ3A6Z.js} +1 -1
  88. package/dist/client/assets/{connections-Cs0nL032.js → connections-DWlPro34.js} +1 -1
  89. package/dist/client/assets/{decopilot-sse-pool-B9lG-dGt.js → decopilot-sse-pool-UOrNfMxw.js} +1 -1
  90. package/dist/client/assets/{dialog-YX8qb6L-.js → dialog-wdHWjrNV.js} +1 -1
  91. package/dist/client/assets/{domain-settings-D9HkGVLh.js → domain-settings-rEsEz9WM.js} +1 -1
  92. package/dist/client/assets/{drawer-C00v8TOn.js → drawer-CwgbaEOp.js} +1 -1
  93. package/dist/client/assets/{dropdown-menu-Bkcoj5OX.js → dropdown-menu-CEEIyhym.js} +1 -1
  94. package/dist/client/assets/{empty-state-JLEZ7LAr.js → empty-state-1VHlo19P.js} +1 -1
  95. package/dist/client/assets/{extract-connection-data-B3m276aR.js → extract-connection-data-DZa8sbW7.js} +1 -1
  96. package/dist/client/assets/{file-explorer-Bn7jPCPW.js → file-explorer-DzL8rH_l.js} +1 -1
  97. package/dist/client/assets/{form-DCVw4Qxk.js → form-DHh4Wlvu.js} +1 -1
  98. package/dist/client/assets/{general-Bs4-Y0PL.js → general-Bo_rUkhq.js} +1 -1
  99. package/dist/client/assets/{github-repo-picker-DryZ8V-D.js → github-repo-picker-DRR2XHTS.js} +1 -1
  100. package/dist/client/assets/{hooks-DU9dCzN0.js → hooks-CvSAZ6QQ.js} +1 -1
  101. package/dist/client/assets/{index-QOUcb-D8.js → index-BU1J1Qx3.js} +1 -1
  102. package/dist/client/assets/{index-DBad3suF.js → index-BnfkTbju.js} +5 -5
  103. package/dist/client/assets/{index-C2p6NzxZ.js → index-CC8N_WW6.js} +1 -1
  104. package/dist/client/assets/{index-BAHKl3Dr.js → index-CQclcDZz.js} +1 -1
  105. package/dist/client/assets/{index-Czz1EmEk.js → index-Ch56WWNs.js} +1 -1
  106. package/dist/client/assets/{index-DlrJLd0f.js → index-CpP-S0pD.js} +5 -5
  107. package/dist/client/assets/{index-BQJXZZDV.js → index-D4y380hc.js} +1 -1
  108. package/dist/client/assets/{index-ykB4MWb0.js → index-D7nON68r.js} +3 -3
  109. package/dist/client/assets/{index-Ndog5o0_.js → index-DnAeXPYG.js} +1 -1
  110. package/dist/client/assets/{index-OaR__zjm.js → index-b_LxwSc-.js} +1 -1
  111. package/dist/client/assets/{index-VPK9H0ZZ.js → index-cPXA6sbw.js} +1 -1
  112. package/dist/client/assets/{index-redirect-LIBduwEN.js → index-redirect-C_XuYYY1.js} +1 -1
  113. package/dist/client/assets/{input-VJryuHef.js → input-s4-qH7Fl.js} +1 -1
  114. package/dist/client/assets/{integration-icon-L27I9d5j.js → integration-icon-BfDOy0DB.js} +1 -1
  115. package/dist/client/assets/{invite-member-dialog-BxDvqaQd.js → invite-member-dialog-D_JUl-8m.js} +1 -1
  116. package/dist/client/assets/{label-C3jo-Tkg.js → label-lanDCOta.js} +1 -1
  117. package/dist/client/assets/{layout-BECJKTgD.js → layout-CNPTvW9k.js} +1 -1
  118. package/dist/client/assets/{login-BSeNg30m.js → login-Da0QZ-Ds.js} +1 -1
  119. package/dist/client/assets/{mcp-oauth-C595Hc6X.js → mcp-oauth-DetPJykg.js} +1 -1
  120. package/dist/client/assets/{members-BWRWq0YG.js → members-C732__xA.js} +1 -1
  121. package/dist/client/assets/{monaco-editor-Mc_4JQvY.js → monaco-editor-CRtsEJ1X.js} +1 -1
  122. package/dist/client/assets/{monitoring-stats-row-IPWbQ95u.js → monitoring-stats-row-wko8c7Bp.js} +1 -1
  123. package/dist/client/assets/{multi-select-BYW5AnDa.js → multi-select-BslMsSWp.js} +1 -1
  124. package/dist/client/assets/{oauth-callback-C0XZ7HtH.js → oauth-callback-C0dXXw92.js} +1 -1
  125. package/dist/client/assets/{oauth-callback-ai-provider-BEL92Y9_.js → oauth-callback-ai-provider-B8fmo-HF.js} +1 -1
  126. package/dist/client/assets/{onboarding-CPU-RSGm.js → onboarding-DyErTJA4.js} +1 -1
  127. package/dist/client/assets/{org-layout-D19Ctg-Q.js → org-layout-BLKcylwW.js} +1 -1
  128. package/dist/client/assets/{organization-choice-Cmtj23ea.js → organization-choice-I8Dg5wj4.js} +1 -1
  129. package/dist/client/assets/{orgs-BXq2to1u.js → orgs-BnTgu6DD.js} +1 -1
  130. package/dist/client/assets/{page-seo-form-tenmD-hO.js → page-seo-form-B-W5X_KN.js} +1 -1
  131. package/dist/client/assets/{popover-CZ2c-1a4.js → popover-Ck_o5Wrt.js} +1 -1
  132. package/dist/client/assets/{post-editor-DUKdAYuv.js → post-editor-CvNkyJcu.js} +1 -1
  133. package/dist/client/assets/{primitives-DuNuXMzW.js → primitives-Cugfu3ek.js} +1 -1
  134. package/dist/client/assets/{profile-BKzR2oCN.js → profile-DHix16Tj.js} +1 -1
  135. package/dist/client/assets/project-app-view-CnZoXqWe.js +1 -0
  136. package/dist/client/assets/record-editor-Bmv79Tyx.js +1 -0
  137. package/dist/client/assets/{redirect-editor-DUseh2nY.js → redirect-editor-uvtYk6O4.js} +1 -1
  138. package/dist/client/assets/registry-gqAOQL_o.js +2 -0
  139. package/dist/client/assets/{registry-layout-_6Xwf8jj.js → registry-layout-BX1LbwNk.js} +1 -1
  140. package/dist/client/assets/{reports-TKLzlc4f.js → reports-DnFwql64.js} +1 -1
  141. package/dist/client/assets/{require-capability-Dt4nTGcU.js → require-capability-BEf-wZsP.js} +1 -1
  142. package/dist/client/assets/{required-auth-layout-DolQOWSu.js → required-auth-layout-Dv1xp3gR.js} +1 -1
  143. package/dist/client/assets/{reset-password-C757OLW1.js → reset-password-DReFCMq2.js} +1 -1
  144. package/dist/client/assets/roles-DhIHG7Qw.js +1 -0
  145. package/dist/client/assets/{search-input-Css9C8e3.js → search-input-GeOkxlFZ.js} +1 -1
  146. package/dist/client/assets/{secrets-Bey0Fsa1.js → secrets-B6_f3_7U.js} +1 -1
  147. package/dist/client/assets/{sections-editor-By-ag0Dl.js → sections-editor-DoKNFeWf.js} +1 -1
  148. package/dist/client/assets/{select-D8tnZPAO.js → select-D-d6Z69w.js} +1 -1
  149. package/dist/client/assets/{select-model-yU1XE-Tf.js → select-model-rj_wk5pD.js} +1 -1
  150. package/dist/client/assets/{self-tool-result-CYhLGfu-.js → self-tool-result-COWex9g2.js} +1 -1
  151. package/dist/client/assets/{seo-editor-D-WdirMf.js → seo-editor-UMJIOFgI.js} +1 -1
  152. package/dist/client/assets/{settings-layout-Cseye0gE.js → settings-layout-B0a-RGtW.js} +1 -1
  153. package/dist/client/assets/{settings-section-BQSpoRM4.js → settings-section-DCHGjEDu.js} +1 -1
  154. package/dist/client/assets/{shell-controls-TYIuY2Jq.js → shell-controls-CWFmi0NJ.js} +1 -1
  155. package/dist/client/assets/{shell-layout-DyRibQbN.js → shell-layout-fjbcJd19.js} +1 -1
  156. package/dist/client/assets/{sidebar-B7lAtJq4.js → sidebar-D3JiZvSx.js} +1 -1
  157. package/dist/client/assets/{skeleton-CZe0GgC0.js → skeleton-Db9HI085.js} +1 -1
  158. package/dist/client/assets/{spinner-DfDYGVyJ.js → spinner-DJUgX0rr.js} +1 -1
  159. package/dist/client/assets/{sso-Dfy0Fpii.js → sso-BLCOn8wd.js} +1 -1
  160. package/dist/client/assets/{store-DQHAR8NI.js → store-CLh1M9j_.js} +1 -1
  161. package/dist/client/assets/store-registry-DMMSWa9V.js +2 -0
  162. package/dist/client/assets/{studio-tools-z4_ic7wa.js → studio-tools-C42EgVLm.js} +1 -1
  163. package/dist/client/assets/{switch-DEGt7tYf.js → switch-Cy6lJIfU.js} +1 -1
  164. package/dist/client/assets/{tab-id-B7eCve3T.js → tab-id-v1C0oZfW.js} +1 -1
  165. package/dist/client/assets/{table-Cv4PaakJ.js → table-CsSOvNee.js} +1 -1
  166. package/dist/client/assets/{tabs-CWF4Eazm.js → tabs-139FL1FK.js} +1 -1
  167. package/dist/client/assets/{textarea-BDQ2l--t.js → textarea-BKf1b5oV.js} +1 -1
  168. package/dist/client/assets/{toggle-group-Brqv9lqE.js → toggle-group-BOONA6-L.js} +1 -1
  169. package/dist/client/assets/{toolbar-DmYuggMs.js → toolbar-oR4EYzLA.js} +1 -1
  170. package/dist/client/assets/{tooltip-CWiu9D12.js → tooltip-CuJ91_oS.js} +1 -1
  171. package/dist/client/assets/{use-ai-providers-1BerwWe9.js → use-ai-providers-DRHgvouV.js} +1 -1
  172. package/dist/client/assets/{use-automations-CU8_svlb.js → use-automations-BApaKvd-.js} +1 -1
  173. package/dist/client/assets/{use-autosave-3qFOw8Br.js → use-autosave-BiDFVhR_.js} +1 -1
  174. package/dist/client/assets/{use-capability-Bk3J-Iqx.js → use-capability-BEep6Ha8.js} +1 -1
  175. package/dist/client/assets/{use-clock-tick-CTvrsrV0.js → use-clock-tick-39-diZIc.js} +1 -1
  176. package/dist/client/assets/{use-connection-BbtNdpLj.js → use-connection-D2lVo9DS.js} +1 -1
  177. package/dist/client/assets/{use-copy-BsJIVo90.js → use-copy-BmP-JZoX.js} +1 -1
  178. package/dist/client/assets/{use-create-virtual-mcp-BdyQCM_T.js → use-create-virtual-mcp-DozUe3B3.js} +1 -1
  179. package/dist/client/assets/{use-debounced-autosave-C3NHFFOq.js → use-debounced-autosave-DBFnUAWb.js} +1 -1
  180. package/dist/client/assets/{use-debounced-value-Bq1aop1P.js → use-debounced-value-DFnm0L6O.js} +1 -1
  181. package/dist/client/assets/{use-deco-credits-Bbp8cHH-.js → use-deco-credits-CDZ4bsnT.js} +1 -1
  182. package/dist/client/assets/{use-decopilot-events-B0cZBVhM.js → use-decopilot-events-DfaI-_w-.js} +1 -1
  183. package/dist/client/assets/{use-delete-connection-DerUOluz.js → use-delete-connection-BjvGH-zU.js} +1 -1
  184. package/dist/client/assets/{use-deployment-admin-BTkbkisW.js → use-deployment-admin-Db6ZVHW1.js} +1 -1
  185. package/dist/client/assets/{use-file-configs-BFFJjpME.js → use-file-configs-BXcCgoFl.js} +1 -1
  186. package/dist/client/assets/{use-infinite-scroll-GJ1kJ9VT.js → use-infinite-scroll-BjiX8vQy.js} +1 -1
  187. package/dist/client/assets/{use-join-requests-DkTgjESV.js → use-join-requests-T9e39oSs.js} +1 -1
  188. package/dist/client/assets/{use-mcp-auth-status-DWNLpQfA.js → use-mcp-auth-status-DjbCSJ4O.js} +1 -1
  189. package/dist/client/assets/{use-mcp-client-BAuyfS_2.js → use-mcp-client-5QWj1A9a.js} +1 -1
  190. package/dist/client/assets/{use-mcp-tools-C9Je3U4Y.js → use-mcp-tools-CtGwHiDi.js} +1 -1
  191. package/dist/client/assets/{use-members-BxRg2DIY.js → use-members-jDNCRLL4.js} +1 -1
  192. package/dist/client/assets/{use-mobile-DrOZ2zHv.js → use-mobile-C91dq5AF.js} +1 -1
  193. package/dist/client/assets/{use-navigate-to-agent-BE4Poi7y.js → use-navigate-to-agent-3dJ7hC4y.js} +1 -1
  194. package/dist/client/assets/{use-org-auth-client-vrRyh83k.js → use-org-auth-client-DzbAlSpQ.js} +1 -1
  195. package/dist/client/assets/{use-org-sso-Sn4tasoh.js → use-org-sso-DqJAhHZh.js} +1 -1
  196. package/dist/client/assets/{use-organization-roles-D8iyhUpC.js → use-organization-roles-DTIBEtrP.js} +1 -1
  197. package/dist/client/assets/{use-organization-settings-D9AwPaOJ.js → use-organization-settings-CL4gJKEp.js} +1 -1
  198. package/dist/client/assets/{use-registry-connections-1P_9goJ5.js → use-registry-connections-LefDE-qL.js} +1 -1
  199. package/dist/client/assets/{use-secrets-CP_mnoUN.js → use-secrets-DrUz6g7Q.js} +1 -1
  200. package/dist/client/assets/{use-status-sounds-AG_d2u2d.js → use-status-sounds-9EpRxeoc.js} +1 -1
  201. package/dist/client/assets/{use-tags-D3lxkScm.js → use-tags-BFLq_4kR.js} +1 -1
  202. package/dist/client/assets/{use-view-mode-DycyPOGt.js → use-view-mode-BhBrwVJn.js} +1 -1
  203. package/dist/client/assets/{use-virtual-mcp-qrJo3ksT.js → use-virtual-mcp-Y2b8gepU.js} +1 -1
  204. package/dist/client/assets/useInfiniteQuery-4VbceBrT.js +1 -0
  205. package/dist/client/assets/{useQueries-VD06sM7p.js → useQueries-CIVj8X41.js} +1 -1
  206. package/dist/client/assets/{useRouterState-QCUcyPse.js → useRouterState-B5IUZfiB.js} +1 -1
  207. package/dist/client/assets/useSuspenseInfiniteQuery-q_0__sea.js +1 -0
  208. package/dist/client/assets/{users-CbPIccMz.js → users-rPgtrX9m.js} +1 -1
  209. package/dist/client/assets/{variant-calendar-Dv2ADWd3.js → variant-calendar-CE3Dv0bY.js} +1 -1
  210. package/dist/client/assets/{view-mode-toggle-Ct_CZRLn.js → view-mode-toggle-DX5KgKpr.js} +1 -1
  211. package/dist/client/index.html +1 -1
  212. package/dist/server/cli.js +463 -463
  213. package/dist/server/migrate.js +109 -109
  214. package/dist/server/server.js +316 -316
  215. package/package.json +1 -1
  216. package/dist/client/assets/ai-providers-p6QXZlHD.js +0 -1
  217. package/dist/client/assets/project-app-view-DZ8Vv3dE.js +0 -1
  218. package/dist/client/assets/record-editor-CmKqQLjp.js +0 -1
  219. package/dist/client/assets/registry-Cb19CW__.js +0 -2
  220. package/dist/client/assets/roles-Csib_Fqz.js +0 -1
  221. package/dist/client/assets/store-registry-ByWx3uUd.js +0 -2
  222. package/dist/client/assets/useInfiniteQuery-BWmod5eH.js +0 -1
  223. package/dist/client/assets/useSuspenseInfiniteQuery-DZgOlcJm.js +0 -1
@@ -1 +1 @@
1
- import{c as p,j as m}from"./index-DlrJLd0f.js";import{u as l}from"./use-capability-Bk3J-Iqx.js";import{A as u}from"./access-gate-Bp90a8v-.js";function b(c){const t=p.c(6),{capability:n,area:e,children:i}=c,{granted:a,loading:o,error:s}=l(n);let r;return t[0]!==e||t[1]!==i||t[2]!==s||t[3]!==a||t[4]!==o?(r=m.jsx(u,{granted:a,loading:o,error:s,area:e,children:i}),t[0]=e,t[1]=i,t[2]=s,t[3]=a,t[4]=o,t[5]=r):r=t[5],r}export{b as R};
1
+ import{c as p,j as m}from"./index-CpP-S0pD.js";import{u as l}from"./use-capability-BEep6Ha8.js";import{A as u}from"./access-gate-B5lWeKmi.js";function b(c){const t=p.c(6),{capability:n,area:e,children:i}=c,{granted:a,loading:o,error:s}=l(n);let r;return t[0]!==e||t[1]!==i||t[2]!==s||t[3]!==a||t[4]!==o?(r=m.jsx(u,{granted:a,loading:o,error:s,area:e,children:i}),t[0]=e,t[1]=i,t[2]=s,t[3]=a,t[4]=o,t[5]=r):r=t[5],r}export{b as R};
@@ -1 +1 @@
1
- import{c as l,j as s,A as a,S as m,g as h,i as u,N as g}from"./index-DlrJLd0f.js";function x(){const o=l.c(1),e=window.location.pathname+window.location.search;let t;if(o[0]===Symbol.for("react.memo_cache_sentinel")){const n=e==="/login"||e.startsWith("/login?")?{}:{next:e};t=s.jsx(g,{to:"/login",search:n,replace:!0}),o[0]=t}else t=o[0];return t}function f(o){const e=l.c(6),{children:t}=o;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(a,{children:s.jsx(m,{})}),e[0]=i):i=e[0];let n;e[1]!==t?(n=s.jsx(h,{children:t}),e[1]=t,e[2]=n):n=e[2];let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(u,{children:s.jsx(x,{})}),e[3]=r):r=e[3];let c;return e[4]!==n?(c=s.jsxs(s.Fragment,{children:[i,n,r]}),e[4]=n,e[5]=c):c=e[5],c}export{f as R};
1
+ import{c as l,j as s,A as a,S as m,g as h,i as u,N as g}from"./index-CpP-S0pD.js";function x(){const o=l.c(1),e=window.location.pathname+window.location.search;let t;if(o[0]===Symbol.for("react.memo_cache_sentinel")){const n=e==="/login"||e.startsWith("/login?")?{}:{next:e};t=s.jsx(g,{to:"/login",search:n,replace:!0}),o[0]=t}else t=o[0];return t}function f(o){const e=l.c(6),{children:t}=o;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(a,{children:s.jsx(m,{})}),e[0]=i):i=e[0];let n;e[1]!==t?(n=s.jsx(h,{children:t}),e[1]=t,e[2]=n):n=e[2];let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(u,{children:s.jsx(x,{})}),e[3]=r):r=e[3];let c;return e[4]!==n?(c=s.jsxs(s.Fragment,{children:[i,n,r]}),e[4]=n,e[5]=c):c=e[5],c}export{f as R};
@@ -1 +1 @@
1
- import{c as O,b as A,u as K,d as V,r as z,e as $,j as s,B as T,a as G}from"./index-DlrJLd0f.js";import{I as D}from"./input-VJryuHef.js";function U(){const e=O.c(53),t=A();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/reset-password"},e[0]=n):n=e[0];const{token:o,error:F}=K(n),a=V(),[l,M]=z.useState(""),[i,q]=z.useState(""),[r,B]=z.useState(!1),c=F==="INVALID_TOKEN";let v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v={mutationFn:H,onSuccess:()=>{B(!0)}},e[1]=v):v=e[1];const b=$(v),N=l===i,d=l.length>=8&&i.length>=8&&N,m=b.isPending,P=b.error;let y;e[2]!==d||e[3]!==l||e[4]!==b||e[5]!==o?(y=j=>{j.preventDefault(),!(!o||!d)&&b.mutate({newPassword:l,token:o})},e[2]=d,e[3]=l,e[4]=b,e[5]=o,e[6]=y):y=e[6];const I=y;let k;e[7]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle, var(--primary-foreground) 1px, transparent 1px)",backgroundSize:"16px 16px",opacity:.15}}),e[7]=k):k=e[7];let S,_,L,E;e[8]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),_=s.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),L=s.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),E=s.jsx("div",{className:"absolute right-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),e[8]=S,e[9]=_,e[10]=L,e[11]=E):(S=e[8],_=e[9],L=e[10],E=e[11]);let C;e[12]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx("div",{className:"flex justify-center",children:s.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12"})}),e[12]=C):C=e[12];let u;e[13]!==r||e[14]!==t?(u=t(r?"routes.resetPassword.passwordResetSuccessful":"routes.resetPassword.setNewPassword"),e[13]=r,e[14]=t,e[15]=u):u=e[15];let x;e[16]!==u?(x=s.jsx("div",{className:"text-center space-y-1",children:s.jsx("p",{className:"text-sm text-foreground/70",children:u})}),e[16]=u,e[17]=x):x=e[17];let f;e[18]!==c||e[19]!==a||e[20]!==r||e[21]!==t||e[22]!==o?(f=(c||!o&&!r)&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:t("routes.resetPassword.invalidOrExpiredLink")}),s.jsx(T,{onClick:()=>a({to:"/login"}),className:"w-full font-semibold",size:"lg",children:t("routes.resetPassword.backToLogin")})]}),e[18]=c,e[19]=a,e[20]=r,e[21]=t,e[22]=o,e[23]=f):f=e[23];let g;e[24]!==P||e[25]!==t?(g=P&&s.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:P.message||t("routes.resetPassword.failedToReset")}),e[24]=P,e[25]=t,e[26]=g):g=e[26];let p;e[27]!==a||e[28]!==r||e[29]!==t?(p=r&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-xl bg-success/10 p-3 text-sm text-success text-center",children:t("routes.resetPassword.passwordResetDescription")}),s.jsx(T,{onClick:()=>a({to:"/login"}),className:"w-full font-semibold",size:"lg",children:t("routes.resetPassword.goToLogin")})]}),e[27]=a,e[28]=r,e[29]=t,e[30]=p):p=e[30];let w;e[31]!==d||e[32]!==i||e[33]!==I||e[34]!==c||e[35]!==m||e[36]!==l||e[37]!==N||e[38]!==r||e[39]!==t||e[40]!==o?(w=o&&!c&&!r&&s.jsxs("form",{onSubmit:I,className:"grid gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:t("routes.resetPassword.newPasswordLabel")}),s.jsx(D,{type:"password",placeholder:"••••••••",value:l,onChange:j=>M(j.target.value),required:!0,minLength:8,disabled:m})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:t("routes.resetPassword.confirmPasswordLabel")}),s.jsx(D,{type:"password",placeholder:"••••••••",value:i,onChange:j=>q(j.target.value),required:!0,minLength:8,disabled:m}),i&&!N&&s.jsx("p",{className:"text-xs text-destructive mt-1.5",children:t("routes.resetPassword.passwordsDoNotMatch")})]}),s.jsx(T,{type:"submit",disabled:m||!d,className:"w-full font-semibold",size:"lg",children:t(m?"routes.resetPassword.resetting":"routes.resetPassword.resetPassword")})]}),e[31]=d,e[32]=i,e[33]=I,e[34]=c,e[35]=m,e[36]=l,e[37]=N,e[38]=r,e[39]=t,e[40]=o,e[41]=w):w=e[41];let h;e[42]!==a||e[43]!==r||e[44]!==t?(h=!r&&s.jsx("div",{className:"text-center",children:s.jsx(T,{type:"button",variant:"link",onClick:()=>a({to:"/login"}),className:"text-sm text-muted-foreground hover:text-foreground",children:t("routes.resetPassword.backToSignIn")})}),e[42]=a,e[43]=r,e[44]=t,e[45]=h):h=e[45];let R;return e[46]!==x||e[47]!==f||e[48]!==g||e[49]!==p||e[50]!==w||e[51]!==h?(R=s.jsxs("main",{className:"relative flex min-h-screen items-center justify-center bg-gradient-to-br from-primary to-primary/75 p-4",children:[k,s.jsxs("div",{className:"relative z-10",children:[S,_,L,E,s.jsxs("div",{className:"mx-auto w-full min-w-[400px] max-w-md grid gap-6 bg-card p-10 border border-primary-foreground/20",children:[C,x,f,g,p,w,h]})]})]}),e[46]=x,e[47]=f,e[48]=g,e[49]=p,e[50]=w,e[51]=h,e[52]=R):R=e[52],R}async function H(e){const{newPassword:t,token:n}=e,o=await G.resetPassword({newPassword:t,token:n});if(o.error)throw new Error(o.error.message||"Failed to reset password");return o}export{U as default};
1
+ import{c as O,b as A,u as K,d as V,r as z,e as $,j as s,B as T,a as G}from"./index-CpP-S0pD.js";import{I as D}from"./input-s4-qH7Fl.js";function U(){const e=O.c(53),t=A();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/reset-password"},e[0]=n):n=e[0];const{token:o,error:F}=K(n),a=V(),[l,M]=z.useState(""),[i,q]=z.useState(""),[r,B]=z.useState(!1),c=F==="INVALID_TOKEN";let v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v={mutationFn:H,onSuccess:()=>{B(!0)}},e[1]=v):v=e[1];const b=$(v),N=l===i,d=l.length>=8&&i.length>=8&&N,m=b.isPending,P=b.error;let y;e[2]!==d||e[3]!==l||e[4]!==b||e[5]!==o?(y=j=>{j.preventDefault(),!(!o||!d)&&b.mutate({newPassword:l,token:o})},e[2]=d,e[3]=l,e[4]=b,e[5]=o,e[6]=y):y=e[6];const I=y;let k;e[7]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle, var(--primary-foreground) 1px, transparent 1px)",backgroundSize:"16px 16px",opacity:.15}}),e[7]=k):k=e[7];let S,_,L,E;e[8]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),_=s.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),L=s.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),E=s.jsx("div",{className:"absolute right-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),e[8]=S,e[9]=_,e[10]=L,e[11]=E):(S=e[8],_=e[9],L=e[10],E=e[11]);let C;e[12]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx("div",{className:"flex justify-center",children:s.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12"})}),e[12]=C):C=e[12];let u;e[13]!==r||e[14]!==t?(u=t(r?"routes.resetPassword.passwordResetSuccessful":"routes.resetPassword.setNewPassword"),e[13]=r,e[14]=t,e[15]=u):u=e[15];let x;e[16]!==u?(x=s.jsx("div",{className:"text-center space-y-1",children:s.jsx("p",{className:"text-sm text-foreground/70",children:u})}),e[16]=u,e[17]=x):x=e[17];let f;e[18]!==c||e[19]!==a||e[20]!==r||e[21]!==t||e[22]!==o?(f=(c||!o&&!r)&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:t("routes.resetPassword.invalidOrExpiredLink")}),s.jsx(T,{onClick:()=>a({to:"/login"}),className:"w-full font-semibold",size:"lg",children:t("routes.resetPassword.backToLogin")})]}),e[18]=c,e[19]=a,e[20]=r,e[21]=t,e[22]=o,e[23]=f):f=e[23];let g;e[24]!==P||e[25]!==t?(g=P&&s.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:P.message||t("routes.resetPassword.failedToReset")}),e[24]=P,e[25]=t,e[26]=g):g=e[26];let p;e[27]!==a||e[28]!==r||e[29]!==t?(p=r&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-xl bg-success/10 p-3 text-sm text-success text-center",children:t("routes.resetPassword.passwordResetDescription")}),s.jsx(T,{onClick:()=>a({to:"/login"}),className:"w-full font-semibold",size:"lg",children:t("routes.resetPassword.goToLogin")})]}),e[27]=a,e[28]=r,e[29]=t,e[30]=p):p=e[30];let w;e[31]!==d||e[32]!==i||e[33]!==I||e[34]!==c||e[35]!==m||e[36]!==l||e[37]!==N||e[38]!==r||e[39]!==t||e[40]!==o?(w=o&&!c&&!r&&s.jsxs("form",{onSubmit:I,className:"grid gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:t("routes.resetPassword.newPasswordLabel")}),s.jsx(D,{type:"password",placeholder:"••••••••",value:l,onChange:j=>M(j.target.value),required:!0,minLength:8,disabled:m})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:t("routes.resetPassword.confirmPasswordLabel")}),s.jsx(D,{type:"password",placeholder:"••••••••",value:i,onChange:j=>q(j.target.value),required:!0,minLength:8,disabled:m}),i&&!N&&s.jsx("p",{className:"text-xs text-destructive mt-1.5",children:t("routes.resetPassword.passwordsDoNotMatch")})]}),s.jsx(T,{type:"submit",disabled:m||!d,className:"w-full font-semibold",size:"lg",children:t(m?"routes.resetPassword.resetting":"routes.resetPassword.resetPassword")})]}),e[31]=d,e[32]=i,e[33]=I,e[34]=c,e[35]=m,e[36]=l,e[37]=N,e[38]=r,e[39]=t,e[40]=o,e[41]=w):w=e[41];let h;e[42]!==a||e[43]!==r||e[44]!==t?(h=!r&&s.jsx("div",{className:"text-center",children:s.jsx(T,{type:"button",variant:"link",onClick:()=>a({to:"/login"}),className:"text-sm text-muted-foreground hover:text-foreground",children:t("routes.resetPassword.backToSignIn")})}),e[42]=a,e[43]=r,e[44]=t,e[45]=h):h=e[45];let R;return e[46]!==x||e[47]!==f||e[48]!==g||e[49]!==p||e[50]!==w||e[51]!==h?(R=s.jsxs("main",{className:"relative flex min-h-screen items-center justify-center bg-gradient-to-br from-primary to-primary/75 p-4",children:[k,s.jsxs("div",{className:"relative z-10",children:[S,_,L,E,s.jsxs("div",{className:"mx-auto w-full min-w-[400px] max-w-md grid gap-6 bg-card p-10 border border-primary-foreground/20",children:[C,x,f,g,p,w,h]})]})]}),e[46]=x,e[47]=f,e[48]=g,e[49]=p,e[50]=w,e[51]=h,e[52]=R):R=e[52],R}async function H(e){const{newPassword:t,token:n}=e,o=await G.resetPassword({newPassword:t,token:n});if(o.error)throw new Error(o.error.message||"Failed to reset password");return o}export{U as default};
@@ -0,0 +1 @@
1
+ import{b as re,r as $,F as Be,K as me,n as Fe,j as s,m as W,k as je,B as ce,c as J,Y as Xe,a3 as Ue,Z as ae,a5 as Je,a6 as et,o as rt,$ as Ot,_ as jt,e as at,t as Me,p as Ke,y as ct,z as Mt,E as vt,d as Dt,u as yt}from"./index-CpP-S0pD.js";import{u as Pt}from"./use-organization-roles-DTIBEtrP.js";import{u as $e}from"./use-org-auth-client-DzbAlSpQ.js";import{g as dt,a as Lt}from"./role-color-Dn2tXDDF.js";import{B as ve}from"./badge-DznEWlmt.js";import{g as mt,f as ut,A as ft,a as gt,b as ht,c as xt,d as pt,e as Tt}from"./alert-dialog-CpxCqEN2.js";import{c as wt,D as kt,b as Gt,a as Ut}from"./dropdown-menu-CEEIyhym.js";import{a as Bt}from"./DotsVertical-DwjRcP6A.js";import{s as ze}from"./Plus-Ca3Ml2LK.js";import{s as Vt}from"./Trash01-BwfIUnai.js";import{C as Yt}from"./collection-table-wrapper-z50WhZV2.js";import{P as ie}from"./index-CQclcDZz.js";import{E as tt}from"./empty-state-1VHlo19P.js";import{S as Qe}from"./search-input-GeOkxlFZ.js";import{P as Et,D as _t}from"./ai-providers-logos-DD3qZ33J.js";import{I as Ze}from"./integration-icon-BfDOy0DB.js";import{u as zt}from"./use-infinite-scroll-BjiX8vQy.js";import{C as qe}from"./checkbox-BkO5OHp1.js";import{b as Ft}from"./Settings02-DKxTap5H.js";import{u as Kt}from"./useSuspenseInfiniteQuery-q_0__sea.js";import{u as $t,S as Qt}from"./use-mcp-client-5QWj1A9a.js";import{C as Zt}from"./collection-search-C4-orWMV.js";import{p as qt}from"./connection-D7cW7a2d.js";import{u as It}from"./use-members-jDNCRLL4.js";import{g as Rt}from"./get-initials-D-f_fDFw.js";import{u as Ht}from"./use-connection-D2lVo9DS.js";import{u as Wt,g as Xt}from"./use-ai-providers-DRHgvouV.js";import{A as St}from"./avatar-Dacp4X8p.js";import{S as De}from"./switch-Cy6lJIfU.js";import{b as ye,c as Pe,T as Le,a as we}from"./tooltip-CuJ91_oS.js";import{S as st,a as lt,b as ot}from"./settings-section-DCHGjEDu.js";import{t as Jt}from"./ChevronDown-DMeq6c1L.js";import{i as es}from"./ChevronRight-QXvwYeKn.js";import{i as nt}from"./X-CvDwW-rN.js";import{a as ts}from"./use-capability-BEep6Ha8.js";import{A as ss}from"./access-gate-B5lWeKmi.js";import"./Check-B5Ocw477.js";import"./table-CsSOvNee.js";import"./ArrowUp-hHV8dnEu.js";import"./sidebar-D3JiZvSx.js";import"./LayoutLeft-C94F55Om.js";import"./use-mobile-C91dq5AF.js";import"./SearchMd-BGnU940I.js";import"./Tool02-cVrXNcsQ.js";import"./agent-icon-Cak8CGJ6.js";import"./AlertCircle-BKkj59p3.js";import"./Tool01-FK_KEBNP.js";import"./XCircle-BPu7noSN.js";import"./ArrowUpRight-DqAI4rqY.js";import"./TrendUp01-D9erp13t.js";import"./ZapSquare-DHQmvZPE.js";import"./Users03-BixdONRb.js";import"./CheckCircle-CeRr0f9K.js";import"./ChevronUp-M4yeuEfW.js";import"./Stars02-CkbAbEdB.js";import"./Copy01-gnezadve.js";import"./CpuChip01-PDCt51S6.js";import"./Eye-yZLJUkOu.js";import"./FilterLines-DuWH9nQz.js";import"./Star01-DnEuAXNt.js";import"./Palette-IM50iZxU.js";import"./SwitchHorizontal01-CG6QKK8a.js";import"./HardDrive-C8l1Zp6S.js";import"./Key01-8eNxtAQv.js";import"./LinkExternal01-Bl6piLeN.js";import"./LogOut01-DhQaTA2c.js";import"./Monitor01-BTZzveUz.js";import"./Sun-CsQDuyx5.js";import"./Play-BNZnx80U.js";import"./SearchLg-CIblHBBZ.js";import"./Shield01-b72Anl0J.js";import"./Stars01-C4oq2iC_.js";import"./Upload01-DW_Am5qr.js";import"./User01-Bp6SHWEy.js";import"./Users01-C1IDGxoN.js";import"./XClose-1xNk-tzp.js";import"./Zap-1crUVhxr.js";import"./auth-DZ7Xcgje.js";import"./studio-tools-C42EgVLm.js";import"./card-C2iwtGFp.js";import"./capability-load-error-_ve37G5r.js";const He="basic-usage",We=[{id:He,label:"Basic Usage",description:"Tools all org members can access by default",section:"Basic Usage",tools:["COLLECTION_CONNECTIONS_LIST","COLLECTION_CONNECTIONS_GET","CONNECTION_TEST","COLLECTION_VIRTUAL_MCP_LIST","COLLECTION_VIRTUAL_MCP_GET","VIRTUAL_MCP_PLUGIN_CONFIG_GET","VIRTUAL_MCP_LAST_USED_LIST","AUTOMATION_GET","AUTOMATION_LIST","AUTOMATION_RUN_STATS","AI_PROVIDERS_LIST","AI_PROVIDERS_LIST_MODELS","AI_PROVIDERS_ACTIVE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_CREDITS","AI_PROVIDER_TOPUP_URL","LIST_OBJECTS","GET_OBJECT_METADATA","GET_PRESIGNED_URL","PUT_PRESIGNED_URL","FILE_OBJECTS_LIST","SANDBOX_START","SANDBOX_DELETE","GLOBAL_SEARCH","ORGANIZATION_SETTINGS_GET","USER_GET","BRAND_CONTEXT_LIST","COLLECTION_THREADS_CREATE","COLLECTION_THREADS_LIST","COLLECTION_THREADS_GET","COLLECTION_THREADS_UPDATE","COLLECTION_THREADS_DELETE","COLLECTION_THREAD_MESSAGES_LIST","TASK_BOARD_ITEM_CREATE","TASK_BOARD_ITEM_LIST","TASK_BOARD_ITEM_UPDATE","TASK_BOARD_ITEM_DELETE","TASK_BOARD_ITEM_PRS_GET","TASK_BOARD_REVIEW_DECISION","TASK_BOARD_PROMOTE_TO_PRODUCTION","TASK_BOARD_ACTIVITY_LIST","TASK_BOARD_COMMENT_LIST","TASK_BOARD_COMMENT_CREATE","TASK_BOARD_COMMENT_UPDATE","TASK_BOARD_COMMENT_DELETE"]},{id:"org:manage",label:"Manage organization",description:"Edit organization settings, brand context, and domain configuration",section:"Organization",tools:["ORGANIZATION_GET","ORGANIZATION_LIST","ORGANIZATION_UPDATE","ORGANIZATION_SETTINGS_GET","ORGANIZATION_SETTINGS_UPDATE","BRAND_CONTEXT_LIST","BRAND_CONTEXT_GET","BRAND_CONTEXT_CREATE","BRAND_CONTEXT_UPDATE","BRAND_CONTEXT_DELETE","BRAND_CONTEXT_EXTRACT","BRAND_GET","BRAND_LIST","ORGANIZATION_DOMAIN_LIST","ORGANIZATION_DOMAIN_ADD","ORGANIZATION_DOMAIN_UPDATE","ORGANIZATION_DOMAIN_VERIFY","ORGANIZATION_DOMAIN_REMOVE"]},{id:"members:manage",label:"Manage members",description:"Invite members, remove them, and change their roles",section:"Organization",tools:["ORGANIZATION_MEMBER_LIST","ORGANIZATION_MEMBER_ADD","ORGANIZATION_MEMBER_REMOVE","ORGANIZATION_MEMBER_UPDATE_ROLE","ORGANIZATION_BILLING_CHECKOUT_START","ORGANIZATION_BILLING_PORTAL","ORGANIZATION_JOIN_REQUEST_LIST","ORGANIZATION_JOIN_REQUEST_APPROVE","ORGANIZATION_JOIN_REQUEST_DENY"],dangerous:!0},{id:"connections:manage",label:"Manage connections",description:"Create, update, and delete connections",section:"Connections & Agents",tools:["COLLECTION_CONNECTIONS_CREATE","COLLECTION_CONNECTIONS_UPDATE","COLLECTION_CONNECTIONS_DELETE","COMMERCE_DISCOVERY_SETUP","COMMERCE_DISCOVERY_RUN","COMMERCE_DISCOVERY_BIND","COMMERCE_DISCOVERY_CONNECTION_STATUS"],dangerous:!0},{id:"agents:manage",label:"Manage agents",description:"Create, configure, and delete agents",section:"Connections & Agents",tools:["COLLECTION_VIRTUAL_MCP_CREATE","COLLECTION_VIRTUAL_MCP_UPDATE","COLLECTION_VIRTUAL_MCP_DELETE","VIRTUAL_MCP_PLUGIN_CONFIG_UPDATE","VIRTUAL_MCP_PINNED_VIEWS_UPDATE"],dangerous:!0},{id:"automations:manage",label:"Manage automations",description:"Create, update, run, and delete automations",section:"Automations",tools:["AUTOMATION_CREATE","AUTOMATION_UPDATE","AUTOMATION_DELETE","AUTOMATION_TRIGGER_ADD","AUTOMATION_TRIGGER_REMOVE","AUTOMATION_TRIGGER_ROTATE_TOKEN","AUTOMATION_RUN"],dangerous:!0},{id:"monitoring:view",label:"View monitoring",description:"Access logs and usage statistics",section:"Monitoring",tools:["MONITORING_LOG_GET","MONITORING_LOGS_LIST","MONITORING_STATS","MONITORING_THREAD_USAGE"]},{id:"secrets:manage",label:"Manage secrets",description:"Create and list secrets stored in the credential vault",section:"Organization",tools:["SECRET_CREATE","SECRET_LIST"]},{id:"file-configs:manage",label:"Manage file configs",description:"Create, list, update and delete S3 bucket configurations",section:"Organization",tools:["FILE_CONFIG_CREATE","FILE_CONFIG_LIST","FILE_CONFIG_UPDATE","FILE_CONFIG_DELETE","FILE_OBJECTS_LIST"]},{id:"ai-providers:manage",label:"Manage AI providers",description:"Add or remove API keys and provision provider credentials",section:"AI Providers",tools:["AI_PROVIDER_KEY_CREATE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_KEY_DELETE","AI_PROVIDER_KEY_UPDATE","AI_PROVIDER_KEY_PREVIEW","AI_PROVIDER_OAUTH_URL","AI_PROVIDER_OAUTH_EXCHANGE","AI_PROVIDER_PROVISION_KEY","AI_PROVIDER_TOPUP_URL","AI_PROVIDER_CREDITS","CLAUDE_SUBSCRIPTION_CONNECT","CLAUDE_SUBSCRIPTION_STATUS","CLAUDE_SUBSCRIPTION_DISCONNECT"]},{id:"tags:manage",label:"Manage tags",description:"Create, assign, and delete organization tags",section:"Organization",tools:["TAGS_LIST","TAGS_CREATE","TAGS_DELETE","MEMBER_TAGS_GET","MEMBER_TAGS_SET"]},{id:"registry:manage",label:"Manage registry",description:"Browse, publish, and manage items in the registry",section:"Store & Registry",tools:["COLLECTION_REGISTRY_APP_LIST","COLLECTION_REGISTRY_APP_GET","COLLECTION_REGISTRY_APP_VERSIONS","COLLECTION_REGISTRY_APP_FILTERS","REGISTRY_ITEM_LIST","REGISTRY_ITEM_SEARCH","REGISTRY_ITEM_GET","REGISTRY_ITEM_VERSIONS","REGISTRY_ITEM_FILTERS","REGISTRY_DISCOVER_TOOLS","REGISTRY_ITEM_CREATE","REGISTRY_ITEM_BULK_CREATE","REGISTRY_ITEM_UPDATE","REGISTRY_ITEM_DELETE","REGISTRY_AI_GENERATE","REGISTRY_PUBLISH_REQUEST_LIST","REGISTRY_PUBLISH_REQUEST_REVIEW","REGISTRY_PUBLISH_REQUEST_COUNT","REGISTRY_PUBLISH_REQUEST_DELETE","REGISTRY_PUBLISH_API_KEY_GENERATE","REGISTRY_PUBLISH_API_KEY_LIST","REGISTRY_PUBLISH_API_KEY_REVOKE"],dangerous:!0},{id:"registry:monitor",label:"Monitor registry health",description:"Run health checks on registry connections and view results",section:"Store & Registry",tools:["REGISTRY_MONITOR_RUN_START","REGISTRY_MONITOR_RUN_LIST","REGISTRY_MONITOR_RUN_GET","REGISTRY_MONITOR_RUN_CANCEL","REGISTRY_MONITOR_RESULT_LIST","REGISTRY_MONITOR_CONNECTION_LIST","REGISTRY_MONITOR_CONNECTION_SYNC","REGISTRY_MONITOR_CONNECTION_UPDATE_AUTH"]},{id:"api-keys:manage",label:"Manage API keys",description:"Create, update, and revoke API keys",section:"Developer",tools:["API_KEY_CREATE","API_KEY_LIST","API_KEY_UPDATE","API_KEY_DELETE"]},{id:"storage:delete",label:"Delete from storage",description:"Permanently delete files from object storage",section:"Developer",tools:["DELETE_OBJECT","DELETE_OBJECTS"],dangerous:!0},{id:"connections:sql",label:"Run SQL queries",description:"Execute raw SQL against connected databases",section:"Developer",tools:["DATABASES_RUN_SQL"],dangerous:!0}];[...We.find(t=>t.id===He)?.tools??[]];const ls=["agents:manage","connections:manage"];new Set(We.filter(t=>ls.includes(t.id)).flatMap(t=>t.tools));function os(){const t=new Map;for(const e of We){if(e.id===He)continue;const l=t.get(e.section)??[];l.push(e),t.set(e.section,l)}return Array.from(t.entries()).map(([e,l])=>({section:e,capabilities:l}))}function ns(t,e,l){return l?!0:t.tools.every(n=>e.includes(n))}function is(t,e,l){if(l){const i=new Set(e);for(const o of t.tools)i.add(o);return Array.from(i)}const n=new Set(e);for(const i of t.tools)n.delete(i);return Array.from(n)}function rs(t){const e=J.c(21),{connection:l,isSelected:n,hasToolsEnabled:i,activeToolsCount:o,totalToolsCount:c,onSelect:g,onToggle:h}=t,m=n?"bg-accent/50":"hover:bg-muted/50";let f;e[0]!==m?(f=W("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",m),e[0]=m,e[1]=f):f=e[1];let a;e[2]!==l.icon||e[3]!==l.title?(a=s.jsx(Ze,{icon:l.icon,name:l.title,size:"xs"}),e[2]=l.icon,e[3]=l.title,e[4]=a):a=e[4];let u;e[5]!==l.title?(u=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:l.title})}),e[5]=l.title,e[6]=u):u=e[6];let x;e[7]!==g||e[8]!==a||e[9]!==u?(x=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:g,children:[a,u]}),e[7]=g,e[8]=a,e[9]=u,e[10]=x):x=e[10];let d;e[11]!==o||e[12]!==l.tools||e[13]!==i||e[14]!==h||e[15]!==c?(d=l.tools&&l.tools.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[o,"/",c]}),s.jsx(qe,{checked:i,onCheckedChange:h,onClick:as})]}),e[11]=o,e[12]=l.tools,e[13]=i,e[14]=h,e[15]=c,e[16]=d):d=e[16];let p;return e[17]!==f||e[18]!==x||e[19]!==d?(p=s.jsxs("div",{className:f,children:[x,d]}),e[17]=f,e[18]=x,e[19]=d,e[20]=p):p=e[20],p}function as(t){return t.stopPropagation()}function cs(t){const e=J.c(18),{connectionId:l,tool:n,isSelected:i,onToggle:o}=t,c=`tool-${l}-${n.name}`,g=i?"text-foreground":"text-muted-foreground";let h;e[0]!==g?(h=W("text-sm font-medium",g),e[0]=g,e[1]=h):h=e[1];let m;e[2]!==h||e[3]!==n.name?(m=s.jsx("div",{className:"flex items-center gap-2 mb-1",children:s.jsx("span",{className:h,children:n.name})}),e[2]=h,e[3]=n.name,e[4]=m):m=e[4];let f;e[5]!==n.description?(f=n.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:n.description}),e[5]=n.description,e[6]=f):f=e[6];let a;e[7]!==m||e[8]!==f?(a=s.jsxs("div",{className:"flex-1 min-w-0",children:[m,f]}),e[7]=m,e[8]=f,e[9]=a):a=e[9];const u=`tool-${l}-${n.name}`;let x;e[10]!==i||e[11]!==o||e[12]!==u?(x=s.jsx("div",{className:"flex items-center shrink-0",children:s.jsx(qe,{id:u,checked:i,onCheckedChange:o,onClick:ds})}),e[10]=i,e[11]=o,e[12]=u,e[13]=x):x=e[13];let d;return e[14]!==c||e[15]!==a||e[16]!==x?(d=s.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:c,children:[a,x]}),e[14]=c,e[15]=a,e[16]=x,e[17]=d):d=e[17],d}function ds(t){return t.stopPropagation()}function ms({toolSet:t,onToolSetChange:e,excludeVirtualMcpId:l,searchQuery:n}){const i=re(),[o,c]=$.useState(""),g=n!==void 0?n:o,h=$.useDeferredValue(g),[m,f]=$.useState("all"),[a,u]=$.useState(!1),x=$.useRef(new Set(Object.keys(t))),{org:d}=Be(),p=$t({connectionId:Qt,orgId:d.id,orgSlug:d.slug}),b=100,R=h.trim(),I=R?{operator:"or",conditions:[{field:["title"],operator:"contains",value:R},{field:["description"],operator:"contains",value:R}]}:void 0,A=!!l,C={...I&&{where:I},orderBy:[{field:["updated_at"],direction:"asc"}],limit:b,offset:0,...A&&{include_virtual:!0}},M=JSON.stringify(C),{data:S,fetchNextPage:O,hasNextPage:v,isFetchingNextPage:E}=Kt({queryKey:me.collectionListInfinite(p,d.id,"","CONNECTIONS",M),queryFn:async({pageParam:T=0})=>(await p.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...I&&{where:I},orderBy:[{field:["updated_at"],direction:"asc"}],limit:b,offset:T,...A&&{include_virtual:!0}}})).structuredContent,initialPageParam:0,getNextPageParam:(T,k)=>{if(T?.hasMore)return k.reduce((Q,H)=>Q+(H?.items?.length??0),0)},staleTime:3e4}),N=S?.pages.flatMap(T=>T?.items??[])??[],D=zt(O,v??!1,E),r=l?N.filter(T=>T.connection_type!=="VIRTUAL"?!0:qt(T.connection_url)!==l):N,_=x.current,G=[..._.values()].map(T=>r.find(k=>k.id===T)).filter(T=>T!==void 0),w=r.filter(T=>!_.has(T.id)),Y=[...G,...w],y=T=>{const k=t[T];return k!==void 0&&k.length>0},z=Y.filter(T=>{if(m==="all")return!0;const k=y(T.id);return m==="selected"?k:m==="unselected"?!k:!0}),[P,F]=$.useState(Y[0]?.id??null),V=P?Y.find(T=>T.id===P)??null:null,{data:U,isFetching:B}=Fe({queryKey:me.collectionItem(p,d.id,"","CONNECTIONS",P??""),queryFn:async()=>P?(await p.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:P}})).structuredContent?.item??null:null,enabled:!!P,staleTime:3e4}),Z=U?.tools??[],X=(T,k)=>t[T]?.includes(k)??!1,te=(T,k)=>{const Q=t[T]??[],H=Q.includes(k),ne={...t};if(H){const se=Q.filter(oe=>oe!==k);se.length===0?delete ne[T]:ne[T]=se}else ne[T]=[...Q,k];e(ne)},le=T=>{const k=T===P?Z:[];if(!k.length)return;const Q=t[T]??[],H=k.map(oe=>oe.name),ne=Q.length>0&&H.every(oe=>Q.includes(oe)),se={...t};ne?delete se[T]:(se[T]=H,F(T)),e(se)},K=T=>{F(T),u(!0)},q=()=>{u(!1)};return s.jsxs("div",{className:"flex h-full",children:[s.jsxs("div",{className:W("w-full md:w-80 border-r border-border flex flex-col",a&&"hidden md:flex"),children:[n===void 0&&s.jsx(Zt,{value:o,onChange:c,placeholder:i("common.toolSetSelector.searchPlaceholder")}),s.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[s.jsx("button",{onClick:()=>f("all"),className:W("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",m==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:i("common.toolSetSelector.filterAll")}),s.jsx("button",{onClick:()=>f("selected"),className:W("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",m==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:i("common.toolSetSelector.filterSelected")}),s.jsx("button",{onClick:()=>f("unselected"),className:W("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",m==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:i("common.toolSetSelector.filterUnselected")})]}),s.jsx("div",{className:"flex-1 overflow-auto",children:z.length===0?s.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:i(g?"common.toolSetSelector.noConnectionsFound":m==="selected"?"common.toolSetSelector.noServersSelected":m==="unselected"?"common.toolSetSelector.noUnselectedServers":"common.toolSetSelector.noConnectionsAvailable")}):s.jsxs("div",{className:"p-2 space-y-1",children:[z.map(T=>{const k=P===T.id,Q=k?Z.length:0,H=t[T.id]?.length??0;return s.jsx(rs,{connection:{...T,tools:k?Z:T.tools},isSelected:k,hasToolsEnabled:y(T.id),activeToolsCount:H,totalToolsCount:Q,onSelect:()=>K(T.id),onToggle:()=>le(T.id)},T.id)}),s.jsx("div",{ref:D,className:"h-4"}),E&&s.jsx("div",{className:"flex justify-center py-3",children:s.jsx(je,{size:18,className:"animate-spin text-muted-foreground"})})]})})]}),s.jsx("div",{className:W("flex-1 flex-col",a?"flex":"hidden md:flex"),children:V?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"md:hidden border-b border-border p-4 flex items-center gap-3",children:[s.jsx(ce,{variant:"ghost",size:"sm",onClick:q,className:"h-8 w-8 p-0 shrink-0",children:s.jsx(Ft,{size:20})}),s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[s.jsx(Ze,{icon:V.icon,name:V.title,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:V.title}),V.description&&s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:V.description})]})]})]}),s.jsx("div",{className:"flex-1 overflow-auto p-4",children:B?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(je,{size:18,className:"animate-spin text-muted-foreground"})}):Z.length===0?s.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:i("common.toolSetSelector.noToolsAvailable")}):s.jsx("div",{className:"space-y-2",children:Z.map(T=>s.jsx(cs,{connectionId:V.id,tool:T,isSelected:X(V.id,T.name),onToggle:()=>te(V.id,T.name)},T.name))})})]}):s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx("div",{className:"text-sm text-muted-foreground text-center",children:i("common.toolSetSelector.selectConnection")})})})]})}const us=Xe({role:Xe({id:ae().optional(),slug:ae().optional(),label:ae()}),allowAllStaticPermissions:et(),staticPermissions:Ue(ae()),toolSet:Je(ae(),Ue(ae())),allowAllModels:et(),modelSet:Je(ae(),Ue(ae())),memberIds:Ue(ae())});function it(t,e,l,n){const i=s.jsx(De,{checked:e,disabled:l,onCheckedChange:n});return l?s.jsx(ye,{children:s.jsxs(Pe,{children:[s.jsx(Le,{asChild:!0,children:s.jsx("div",{children:i})}),s.jsx(we,{children:s.jsx("p",{children:t("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):i}function fs(t){const e=J.c(41),{allowAllStaticPermissions:l,staticPermissions:n,onAllowAllChange:i,onPermissionsChange:o,readOnly:c,searchQuery:g}=t,h=c===void 0?!1:c,m=re();let f;e[0]!==g?(f=g.trim().toLowerCase(),e[0]=g,e[1]=f):f=e[1];const a=$.useDeferredValue(f);let u;if(e[2]!==l||e[3]!==a||e[4]!==i||e[5]!==o||e[6]!==h||e[7]!==g||e[8]!==n||e[9]!==m){const x=os(),d=(E,N)=>{if(!h){if(l&&N){const D=x.flatMap(xs).flatMap(hs);i(!1),o(D.filter(r=>!E.tools.includes(r)));return}l||o(is(E,n,!N))}};let p;e[11]!==a?(p=E=>{const{section:N,capabilities:D}=E;return{section:N,capabilities:D.filter(r=>!a||r.label.toLowerCase().includes(a)||r.description.toLowerCase().includes(a))}},e[11]=a,e[12]=p):p=e[12];const b=x.map(p).filter(gs);let R;e[13]!==m?(R=m("settings.orgRoleDetail.general"),e[13]=m,e[14]=R):R=e[14];let I;e[15]!==m?(I=m("settings.orgRoleDetail.allOrgPermissions"),e[15]=m,e[16]=I):I=e[16];let A;e[17]!==m?(A=m("settings.orgRoleDetail.grantFullAccessToAllFeaturesBelow"),e[17]=m,e[18]=A):A=e[18];let C;e[19]!==l||e[20]!==i||e[21]!==o?(C=()=>{i(!l),o([])},e[19]=l,e[20]=i,e[21]=o,e[22]=C):C=e[22];let M;e[23]!==l||e[24]!==h||e[25]!==m||e[26]!==C?(M=it(m,l,h,C),e[23]=l,e[24]=h,e[25]=m,e[26]=C,e[27]=M):M=e[27];let S;e[28]!==l||e[29]!==i||e[30]!==o||e[31]!==h?(S=h?void 0:()=>{i(!l),o([])},e[28]=l,e[29]=i,e[30]=o,e[31]=h,e[32]=S):S=e[32];let O;e[33]!==S||e[34]!==I||e[35]!==A||e[36]!==M?(O=s.jsx(lt,{children:s.jsx(ot,{title:I,description:A,action:M,onClick:S})}),e[33]=S,e[34]=I,e[35]=A,e[36]=M,e[37]=O):O=e[37];let v;e[38]!==O||e[39]!==R?(v=s.jsx(st,{title:R,children:O}),e[38]=O,e[39]=R,e[40]=v):v=e[40],u=s.jsx("div",{children:s.jsxs("div",{className:"flex flex-col gap-10 py-4",children:[v,b.length===0&&a?s.jsx("p",{className:"text-sm text-muted-foreground py-4",children:m("settings.orgRoleDetail.noPermissionsMatch",{searchQuery:g})}):b.map(E=>{const{section:N,capabilities:D}=E;return s.jsx(st,{title:N,children:s.jsx(lt,{children:D.map(r=>{const _=ns(r,n,l);return s.jsx(ot,{title:s.jsxs("span",{className:"flex items-center gap-1.5",children:[r.label,r.dangerous&&s.jsx(Mt,{size:12,className:"text-warning shrink-0"})]}),description:r.description,action:it(m,_,h,()=>d(r,_)),onClick:h?void 0:()=>d(r,_)},r.id)})})},N)})]})}),e[2]=l,e[3]=a,e[4]=i,e[5]=o,e[6]=h,e[7]=g,e[8]=n,e[9]=m,e[10]=u}else u=e[10];return u}function gs(t){return t.capabilities.length>0}function hs(t){return t.tools}function xs(t){return t.capabilities}const Ct={anthropic:"Anthropic",openrouter:"OpenRouter"},ps={openai:"OpenAI",anthropic:"Anthropic",google:"Google","meta-llama":"Meta",mistralai:"Mistral","x-ai":"xAI",deepseek:"DeepSeek",qwen:"Qwen",moonshotai:"MoonshotAI",nvidia:"NVIDIA",perplexity:"Perplexity",cohere:"Cohere",amazon:"Amazon",microsoft:"Microsoft","z-ai":"Z.ai","ibm-granite":"IBM Granite",alibaba:"Alibaba",baidu:"Baidu",bytedance:"ByteDance",tencent:"Tencent",minimax:"MiniMax",nousresearch:"Nous Research",allenai:"Allen AI",inception:"Inception"};function Ts(t,e){const l=t.indexOf("/"),n=l>0?t.slice(0,l):e;return n.startsWith("~")?n.slice(1):n}function Es(t){return ps[t]??Ct[t]??t}function _s(t){const e=t.indexOf(": ");return e>0&&e<32?t.slice(e+2):t}const Nt=30;function Is(t){const e=J.c(40),{connectionId:l,subProviderId:n,subProviderName:i,groupLogo:o,models:c,allConnectionModelIds:g,selectedModels:h,allowAllModels:m,allConnectionModelsSelected:f,onToggleModel:a,onExitAllowAll:u,readOnly:x,defaultExpanded:d}=t,p=re(),[b,R]=$.useState(d),I=d||b,A=R,[C,M]=$.useState(Nt);let S;e[0]!==f||e[1]!==m||e[2]!==h?(S=E=>m||f||h.includes("*")||h.includes(E),e[0]=f,e[1]=m,e[2]=h,e[3]=S):S=e[3];const O=S;let v;if(e[4]!==g||e[5]!==m||e[6]!==l||e[7]!==I||e[8]!==o||e[9]!==O||e[10]!==c||e[11]!==u||e[12]!==a||e[13]!==x||e[14]!==n||e[15]!==i||e[16]!==p||e[17]!==C){let E;e[19]!==O?(E=B=>O(B.id),e[19]=O,e[20]=E):E=e[20];const N=c.filter(E).length,D=c.slice(0,C),r=c.length>C;let _;e[21]===Symbol.for("react.memo_cache_sentinel")?(_=()=>A(Ns),e[21]=_):_=e[21];const G=o??Et[n]??_t;let w;e[22]!==i||e[23]!==G?(w=s.jsx(Ze,{icon:G,name:i,size:"sm"}),e[22]=i,e[23]=G,e[24]=w):w=e[24];let Y;e[25]!==i?(Y=s.jsx("span",{className:"text-sm font-medium truncate",children:i}),e[25]=i,e[26]=Y):Y=e[26];let y;e[27]!==w||e[28]!==Y?(y=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[w,Y]}),e[27]=w,e[28]=Y,e[29]=y):y=e[29];const z=p("settings.orgRoleDetail.enabledCount",{enabledCount:N,total:c.length});let P;e[30]!==z?(P=s.jsx(ve,{variant:"secondary",className:"text-xs text-muted-foreground",children:z}),e[30]=z,e[31]=P):P=e[31];let F;e[32]!==I?(F=I?s.jsx(Jt,{size:16,className:"text-muted-foreground shrink-0"}):s.jsx(es,{size:16,className:"text-muted-foreground shrink-0"}),e[32]=I,e[33]=F):F=e[33];let V;e[34]!==P||e[35]!==F?(V=s.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[P,F]}),e[34]=P,e[35]=F,e[36]=V):V=e[36];let U;e[37]!==V||e[38]!==y?(U=s.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3 hover:bg-muted/50 cursor-pointer",onClick:_,children:[y,V]}),e[37]=V,e[38]=y,e[39]=U):U=e[39],v=s.jsxs("div",{className:"border border-border rounded-lg overflow-hidden bg-card",children:[U,I&&s.jsxs("div",{className:"border-t border-border bg-muted/20",children:[D.map(B=>{const Z=O(B.id),X=()=>{if(!x){if(m){u(l,g,B.id);return}a(l,B.id)}};return s.jsxs("div",{className:W("flex items-center justify-between gap-3 px-4 py-3 border-b border-border last:border-b-0",!x&&"hover:bg-muted/50 cursor-pointer"),onClick:X,children:[s.jsx("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:s.jsx("span",{className:"text-sm truncate",children:B.title})}),s.jsx("div",{onClick:Cs,children:x?s.jsx(ye,{children:s.jsxs(Pe,{children:[s.jsx(Le,{asChild:!0,children:s.jsx("div",{children:s.jsx(De,{checked:Z,disabled:!0,onCheckedChange:Ss})})}),s.jsx(we,{children:s.jsx("p",{children:p("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):s.jsx(De,{checked:Z,onCheckedChange:X})})]},B.id)}),r&&s.jsx("button",{type:"button",className:"w-full px-4 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors",onClick:()=>M(Rs),children:p("settings.orgRoleDetail.showMore",{remaining:c.length-C})})]})]}),e[4]=g,e[5]=m,e[6]=l,e[7]=I,e[8]=o,e[9]=O,e[10]=c,e[11]=u,e[12]=a,e[13]=x,e[14]=n,e[15]=i,e[16]=p,e[17]=C,e[18]=v}else v=e[18];return v}function Rs(t){return t+Nt}function Ss(){}function Cs(t){return t.stopPropagation()}function Ns(t){return!t}function bs(t){const e=J.c(33),{connection:l,selectedModels:n,allowAllModels:i,onToggleModel:o,onExitAllowAll:c,allConnectionModelsSelected:g,searchQuery:h,readOnly:m}=t,f=Xt(l.id);let a,u,x,d,p;if(e[0]!==g||e[1]!==i||e[2]!==l.id||e[3]!==l.label||e[4]!==l.providerId||e[5]!==c||e[6]!==o||e[7]!==f||e[8]!==m||e[9]!==h||e[10]!==n){p=Symbol.for("react.early_return_sentinel");e:{let I;e[16]!==l.label?(I=_=>({..._,id:_.modelId,provider:l.label}),e[16]=l.label,e[17]=I):I=e[17];const A=f.filter(Ms).map(I),C=h.trim().toLowerCase(),M=C?A.filter(_=>_.title.toLowerCase().includes(C)||_.id.toLowerCase().includes(C)||_.provider?.toLowerCase().includes(C)):A;if(M.length===0){p=null;break e}const S=new Map;for(const _ of M){const G=Ts(_.id,l.providerId),w=S.get(G)??{models:[],logo:null};w.models.push({id:_.id,title:_s(_.title),logo:_.logo}),!w.logo&&_.logo&&(w.logo=_.logo),S.set(G,w)}const O=Array.from(S.entries()).map(js).sort(Os),v=O.length===1||C.length>0;x="flex flex-col gap-3";const E=Et[l.providerId]??_t;let N;e[18]!==l.providerId||e[19]!==E?(N=s.jsx("img",{src:E,alt:l.providerId,className:"w-4 h-4 rounded-sm dark:bg-white dark:rounded-sm dark:p-px"}),e[18]=l.providerId,e[19]=E,e[20]=N):N=e[20];const D=Ct[l.providerId]??l.providerId;let r;e[21]!==D?(r=s.jsx("h4",{className:"text-sm font-medium",children:D}),e[21]=D,e[22]=r):r=e[22],e[23]!==r||e[24]!==N?(d=s.jsxs("div",{className:"flex items-center gap-2",children:[N,r]}),e[23]=r,e[24]=N,e[25]=d):d=e[25],a="flex flex-col gap-3",u=O.map(_=>s.jsx(Is,{connectionId:l.id,subProviderId:_.id,subProviderName:_.name,groupLogo:_.logo,models:_.models,allConnectionModelIds:A.map(As),selectedModels:n,allowAllModels:i,allConnectionModelsSelected:g,onToggleModel:o,onExitAllowAll:c,readOnly:m,defaultExpanded:v},_.id))}e[0]=g,e[1]=i,e[2]=l.id,e[3]=l.label,e[4]=l.providerId,e[5]=c,e[6]=o,e[7]=f,e[8]=m,e[9]=h,e[10]=n,e[11]=a,e[12]=u,e[13]=x,e[14]=d,e[15]=p}else a=e[11],u=e[12],x=e[13],d=e[14],p=e[15];if(p!==Symbol.for("react.early_return_sentinel"))return p;let b;e[26]!==a||e[27]!==u?(b=s.jsx("div",{className:a,children:u}),e[26]=a,e[27]=u,e[28]=b):b=e[28];let R;return e[29]!==x||e[30]!==d||e[31]!==b?(R=s.jsxs("div",{className:x,children:[d,b]}),e[29]=x,e[30]=d,e[31]=b,e[32]=R):R=e[32],R}function As(t){return t.id}function Os(t,e){return t.name.localeCompare(e.name)}function js(t){const[e,l]=t;return{id:e,name:Es(e),logo:l.logo,models:l.models}}function Ms(t,e,l){return l.findIndex(n=>n.modelId===t.modelId)===e}function vs(t){const e=J.c(41),{allowAllModels:l,modelSet:n,onAllowAllChange:i,onModelSetChange:o,readOnly:c,searchQuery:g}=t,h=c===void 0?!1:c,m=re(),f=$.useDeferredValue(g),a=Wt();let u;e[0]!==n||e[1]!==o?(u=(E,N)=>{const D=n[E]??[],r={...n};if(D.includes(N)){const _=D.filter(G=>G!==N);_.length===0?delete r[E]:r[E]=_}else r[E]=[...D,N];o(r)},e[0]=n,e[1]=o,e[2]=u):u=e[2];const x=u;let d;e[3]!==n||e[4]!==i||e[5]!==o?(d=(E,N,D)=>{i(!1),o({...n,[E]:N.filter(r=>r!==D)})},e[3]=n,e[4]=i,e[5]=o,e[6]=d):d=e[6];const p=d,b=!h&&"hover:bg-muted/50 cursor-pointer";let R;e[7]!==b?(R=W("flex items-center justify-between px-4 py-3 rounded-lg border border-border bg-card",b),e[7]=b,e[8]=R):R=e[8];let I;e[9]!==l||e[10]!==i||e[11]!==o||e[12]!==h?(I=()=>{if(h)return;const E=!l;i(E),E&&o({})},e[9]=l,e[10]=i,e[11]=o,e[12]=h,e[13]=I):I=e[13];let A;e[14]!==m?(A=m("settings.orgRoleDetail.allModels"),e[14]=m,e[15]=A):A=e[15];let C;e[16]!==A?(C=s.jsx("span",{className:"text-sm font-medium",children:A}),e[16]=A,e[17]=C):C=e[17];let M;e[18]!==l||e[19]!==i||e[20]!==o||e[21]!==h||e[22]!==m?(M=s.jsx("div",{onClick:ys,children:h?s.jsx(ye,{children:s.jsxs(Pe,{children:[s.jsx(Le,{asChild:!0,children:s.jsx("div",{children:s.jsx(De,{checked:l,disabled:!0,onCheckedChange:Ds})})}),s.jsx(we,{children:s.jsx("p",{children:m("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):s.jsx(De,{checked:l,onCheckedChange:E=>{i(E),E&&o({})}})}),e[18]=l,e[19]=i,e[20]=o,e[21]=h,e[22]=m,e[23]=M):M=e[23];let S;e[24]!==R||e[25]!==I||e[26]!==C||e[27]!==M?(S=s.jsxs("div",{className:R,onClick:I,children:[C,M]}),e[24]=R,e[25]=I,e[26]=C,e[27]=M,e[28]=S):S=e[28];let O;e[29]!==a||e[30]!==l||e[31]!==f||e[32]!==p||e[33]!==n||e[34]!==h||e[35]!==m||e[36]!==x?(O=a.length===0?s.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:m("settings.orgRoleDetail.noLlmConnectionsConfigured")}):a.map(E=>s.jsx($.Suspense,{fallback:s.jsxs("div",{className:"px-4 py-3 flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(je,{className:"size-4 animate-spin"}),m("settings.orgRoleDetail.loadingModels")]}),children:s.jsx(bs,{connection:E,selectedModels:n[E.id]??[],allowAllModels:l,onToggleModel:x,onExitAllowAll:p,allConnectionModelsSelected:(n[E.id]??[]).includes("*"),searchQuery:f,readOnly:h})},E.id)),e[29]=a,e[30]=l,e[31]=f,e[32]=p,e[33]=n,e[34]=h,e[35]=m,e[36]=x,e[37]=O):O=e[37];let v;return e[38]!==S||e[39]!==O?(v=s.jsxs("div",{className:"flex flex-col h-full overflow-auto gap-6 pb-6",children:[S,O]}),e[38]=S,e[39]=O,e[40]=v):v=e[40],v}function Ds(){}function ys(t){return t.stopPropagation()}function Ps(t){const e=J.c(75),{open:l,onOpenChange:n,selectedMemberIds:i,onAddMembers:o}=t,c=re(),[g,h]=$.useState(""),m=$.useDeferredValue(g);let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=[],e[0]=f):f=e[0];const[a,u]=$.useState(f),{data:x}=It();let d,p,b,R,I,A,C,M,S,O,v;if(e[1]!==x?.data?.members||e[2]!==m||e[3]!==o||e[4]!==n||e[5]!==l||e[6]!==a||e[7]!==g||e[8]!==i||e[9]!==c){const P=x?.data?.members??[];let F;e[21]!==m?(F=K=>{const q=m.toLowerCase();return K.user?.name?.toLowerCase().includes(q)||K.user?.email?.toLowerCase().includes(q)},e[21]=m,e[22]=F):F=e[22];const V=P.filter(F);let U;e[23]!==o||e[24]!==n||e[25]!==a?(U=()=>{o(a),u([]),n(!1)},e[23]=o,e[24]=n,e[25]=a,e[26]=U):U=e[26],b=U,p=mt,O=l,v=n,d=ut,M="sm:max-w-md p-0";let B;e[27]!==c?(B=c("settings.orgRoleDetail.addMembersToRole"),e[27]=c,e[28]=B):B=e[28];let Z;e[29]!==B?(Z=s.jsx(ft,{children:B}),e[29]=B,e[30]=Z):Z=e[30];let X;e[31]!==c?(X=c("settings.orgRoleDetail.selectMembersToAddToThisRole"),e[31]=c,e[32]=X):X=e[32];let te;e[33]!==X?(te=s.jsx(gt,{children:X}),e[33]=X,e[34]=te):te=e[34],e[35]!==Z||e[36]!==te?(S=s.jsxs(ht,{className:"px-6 pt-6",children:[Z,te]}),e[35]=Z,e[36]=te,e[37]=S):S=e[37],A="flex flex-col h-80";let le;e[38]!==c?(le=c("settings.orgRoleDetail.searchMembers"),e[38]=c,e[39]=le):le=e[39],e[40]!==g||e[41]!==le?(C=s.jsx("div",{className:"border-b border-border px-4 py-3",children:s.jsx(Qe,{value:g,onChange:h,placeholder:le,className:"w-full"})}),e[40]=g,e[41]=le,e[42]=C):C=e[42],R="flex-1 overflow-auto",I=V.length===0?s.jsx("div",{className:"flex items-center justify-center h-full px-6",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:c(g?"settings.orgRoleDetail.noMembersFound":"settings.orgRoleDetail.noMembersAvailable")})}):s.jsx("div",{className:"px-6 py-2 space-y-1",children:V.map(K=>{const q=K.role!=="owner",T=i.includes(K.id),k=a.includes(K.id);return s.jsxs("label",{className:W("flex items-center gap-3 p-2 rounded-lg",!q||T?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-muted/50"),children:[s.jsx(qe,{checked:k||T,onCheckedChange:()=>{!q||T||u(Q=>Q.includes(K.id)?Q.filter(H=>H!==K.id):[...Q,K.id])},disabled:!q||T}),s.jsx(St,{url:K.user?.image??void 0,fallback:Rt(K.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:K.user?.name||c("settings.orgRoleDetail.unknown")}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:K.user?.email})]}),!q&&s.jsx(ve,{variant:"secondary",className:"shrink-0",children:c("settings.orgRoleDetail.owner")}),T&&q&&s.jsx(ve,{variant:"outline",className:"shrink-0",children:c("settings.orgRoleDetail.added")})]},K.id)})}),e[1]=x?.data?.members,e[2]=m,e[3]=o,e[4]=n,e[5]=l,e[6]=a,e[7]=g,e[8]=i,e[9]=c,e[10]=d,e[11]=p,e[12]=b,e[13]=R,e[14]=I,e[15]=A,e[16]=C,e[17]=M,e[18]=S,e[19]=O,e[20]=v}else d=e[10],p=e[11],b=e[12],R=e[13],I=e[14],A=e[15],C=e[16],M=e[17],S=e[18],O=e[19],v=e[20];let E;e[43]!==R||e[44]!==I?(E=s.jsx("div",{className:R,children:I}),e[43]=R,e[44]=I,e[45]=E):E=e[45];let N;e[46]!==E||e[47]!==A||e[48]!==C?(N=s.jsxs("div",{className:A,children:[C,E]}),e[46]=E,e[47]=A,e[48]=C,e[49]=N):N=e[49];let D;e[50]!==c?(D=c("settings.orgRoleDetail.cancel"),e[50]=c,e[51]=D):D=e[51];let r;e[52]!==D?(r=s.jsx(xt,{children:D}),e[52]=D,e[53]=r):r=e[53];const _=a.length===0;let G;e[54]!==a.length||e[55]!==c?(G=c("settings.orgRoleDetail.addWithCount",{count:a.length}),e[54]=a.length,e[55]=c,e[56]=G):G=e[56];let w;e[57]!==b||e[58]!==_||e[59]!==G?(w=s.jsx(pt,{onClick:b,disabled:_,children:G}),e[57]=b,e[58]=_,e[59]=G,e[60]=w):w=e[60];let Y;e[61]!==r||e[62]!==w?(Y=s.jsxs(Tt,{className:"px-6 pb-6",children:[r,w]}),e[61]=r,e[62]=w,e[63]=Y):Y=e[63];let y;e[64]!==d||e[65]!==N||e[66]!==Y||e[67]!==M||e[68]!==S?(y=s.jsxs(d,{className:M,children:[S,N,Y]}),e[64]=d,e[65]=N,e[66]=Y,e[67]=M,e[68]=S,e[69]=y):y=e[69];let z;return e[70]!==p||e[71]!==y||e[72]!==O||e[73]!==v?(z=s.jsx(p,{open:O,onOpenChange:v,children:y}),e[70]=p,e[71]=y,e[72]=O,e[73]=v,e[74]=z):z=e[74],z}function Ls(t){const e=J.c(33),{memberIds:l,onMemberIdsChange:n,readOnly:i,readOnlyMessage:o,searchQuery:c,addMemberDialogOpen:g,onAddMemberDialogOpenChange:h}=t,m=i===void 0?!1:i,f=o===void 0?void 0:o,a=re(),u=$.useDeferredValue(c),{data:x}=It();let d,p,b;if(e[0]!==x?.data?.members||e[1]!==u||e[2]!==l||e[3]!==n||e[4]!==m||e[5]!==f||e[6]!==c||e[7]!==a){const M=x?.data?.members??[];let S;e[11]!==l?(S=r=>l.includes(r.id),e[11]=l,e[12]=S):S=e[12];const O=M.filter(S);let v;e[13]!==u?(v=r=>{const _=u.toLowerCase();return r.user?.name?.toLowerCase().includes(_)||r.user?.email?.toLowerCase().includes(_)},e[13]=u,e[14]=v):v=e[14];const E=O.filter(v);let N;e[15]!==f||e[16]!==a?(N=f??a("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),e[15]=f,e[16]=a,e[17]=N):N=e[17];const D=N;b="flex flex-col h-full",d="flex-1 overflow-auto",p=O.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h3",{className:"text-base font-medium mb-1",children:a("settings.orgRoleDetail.noMembers")}),s.jsx("p",{className:"text-sm text-muted-foreground",children:a("settings.orgRoleDetail.addMembersToGrantPermissions")})]})}):E.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:a("settings.orgRoleDetail.noMembersMatch",{searchQuery:c})})}):s.jsx("div",{className:"p-4 space-y-2",children:E.map(r=>s.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30",children:[s.jsx(St,{url:r.user?.image??void 0,fallback:Rt(r.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:r.user?.name||a("settings.orgRoleDetail.unknown")}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:r.user?.email})]}),m?s.jsx(ye,{children:s.jsxs(Pe,{children:[s.jsx(Le,{asChild:!0,children:s.jsx("div",{children:s.jsx(ce,{variant:"ghost",size:"sm",disabled:!0,"aria-label":a("settings.orgRoleDetail.removeMember",{name:r.user?.name||a("settings.orgRoleDetail.unknown")}),children:s.jsx(nt,{size:16})})})}),s.jsx(we,{children:s.jsx("p",{children:D})})]})}):s.jsx(ce,{variant:"ghost",size:"sm","aria-label":a("settings.orgRoleDetail.removeMember",{name:r.user?.name||a("settings.orgRoleDetail.unknown")}),onClick:()=>n(l.filter(_=>_!==r.id)),children:s.jsx(nt,{size:16})})]},r.id))}),e[0]=x?.data?.members,e[1]=u,e[2]=l,e[3]=n,e[4]=m,e[5]=f,e[6]=c,e[7]=a,e[8]=d,e[9]=p,e[10]=b}else d=e[8],p=e[9],b=e[10];let R;e[18]!==d||e[19]!==p?(R=s.jsx("div",{className:d,children:p}),e[18]=d,e[19]=p,e[20]=R):R=e[20];let I;e[21]!==l||e[22]!==n?(I=M=>n([...l,...M]),e[21]=l,e[22]=n,e[23]=I):I=e[23];let A;e[24]!==g||e[25]!==l||e[26]!==h||e[27]!==I?(A=s.jsx(Ps,{open:g,onOpenChange:h,selectedMemberIds:l,onAddMembers:I}),e[24]=g,e[25]=l,e[26]=h,e[27]=I,e[28]=A):A=e[28];let C;return e[29]!==b||e[30]!==R||e[31]!==A?(C=s.jsxs("div",{className:b,children:[R,A]}),e[29]=b,e[30]=R,e[31]=A,e[32]=C):C=e[32],C}function ws(t){const e=J.c(3);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(je,{size:24,className:"animate-spin text-muted-foreground"})}),e[0]=l):l=e[0];let n;return e[1]!==t?(n=s.jsx($.Suspense,{fallback:l,children:s.jsx(Ls,{...t})}),e[1]=t,e[2]=n):n=e[2],n}const ks={owner:[],admin:[],user:[]};function Gs(t,e,l,n){const i=t==="owner"||t==="admin";return{role:{id:l?.id,slug:t,label:t.charAt(0).toUpperCase()+t.slice(1)},allowAllStaticPermissions:i,staticPermissions:ks[t],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:e.filter(o=>o.role===t).map(o=>o.id)}}function Us(t,e,l){const n=t.permission||{},i=n.self||[],o=i.includes("*"),c=o?[]:i.filter(a=>a!=="*"),g={};for(const[a,u]of Object.entries(n))if(!(a==="self"||a==="models"))if(a==="*")for(const x of l)g[x.id]=u.includes("*")?x.tools?.map(d=>d.name)??[]:u;else{const x=l.find(d=>d.id===a);x&&(g[a]=u.includes("*")?x.tools?.map(d=>d.name)??[]:u)}const h=n.models||[],m=h.length===0||h.includes("*:*"),f={};if(!m)for(const a of h){const u=a.indexOf(":");if(u===-1)continue;const x=a.slice(0,u),d=a.slice(u+1);f[x]||(f[x]=[]),f[x].push(d)}return{role:{id:t.id,slug:t.role,label:t.label},allowAllStaticPermissions:o,staticPermissions:c,toolSet:g,allowAllModels:m,modelSet:f,memberIds:e.filter(a=>a.role===t.role).map(a=>a.id)}}function Bs(t,e){const l={};t.allowAllStaticPermissions?l.self=["*"]:t.staticPermissions.length>0&&(l.self=t.staticPermissions);for(const[n,i]of Object.entries(t.toolSet))if(i.length>0){const c=e.find(g=>g.id===n)?.tools?.map(g=>g.name)??[];l[n]=c.length>0&&c.every(g=>i.includes(g))?["*"]:i}if(t.allowAllModels)l.models=["*:*"];else{const n=[];for(const[i,o]of Object.entries(t.modelSet))for(const c of o)n.push(`${i}:${c}`);n.length>0&&(l.models=n)}return l}function Vs(t,e,l){return t.kind==="builtin"?Gs(t.role,e,void 0):t.kind==="custom"?Us(t.role,e,l):{role:{id:void 0,slug:void 0,label:""},allowAllStaticPermissions:!1,staticPermissions:[],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:[]}}function Ys(t){const e=J.c(19),{readOnly:l,readOnlyMessage:n,onOpen:i}=t,o=n===void 0?void 0:n,c=re();let g;e[0]!==o||e[1]!==c?(g=o??c("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),e[0]=o,e[1]=c,e[2]=g):g=e[2];const h=g;if(l){let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(ze,{size:16}),e[3]=u):u=e[3];let x;e[4]!==c?(x=c("settings.orgRoleDetail.addMember"),e[4]=c,e[5]=x):x=e[5];let d;e[6]!==x?(d=s.jsx(Le,{asChild:!0,children:s.jsx("div",{children:s.jsxs(ce,{variant:"outline",size:"sm",disabled:!0,children:[u,x]})})}),e[6]=x,e[7]=d):d=e[7];let p;e[8]!==h?(p=s.jsx(we,{children:s.jsx("p",{children:h})}),e[8]=h,e[9]=p):p=e[9];let b;return e[10]!==d||e[11]!==p?(b=s.jsx(ye,{children:s.jsxs(Pe,{children:[d,p]})}),e[10]=d,e[11]=p,e[12]=b):b=e[12],b}let m;e[13]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(ze,{size:16}),e[13]=m):m=e[13];let f;e[14]!==c?(f=c("settings.orgRoleDetail.addMember"),e[14]=c,e[15]=f):f=e[15];let a;return e[16]!==i||e[17]!==f?(a=s.jsxs(ce,{variant:"outline",size:"sm",onClick:i,children:[m,f]}),e[16]=i,e[17]=f,e[18]=a):a=e[18],a}function zs(t){const e=J.c(14),{locator:l}=Be(),n=$e(),i=Ht();let o;e[0]!==l?(o=me.members(l),e[0]=l,e[1]=o):o=e[1];let c;e[2]!==n?(c=()=>n.organization.listMembers(),e[2]=n,e[3]=c):c=e[3];let g;e[4]!==o||e[5]!==c?(g={queryKey:o,queryFn:c},e[4]=o,e[5]=c,e[6]=g):g=e[6];const{data:h,isPending:m}=Fe(g);if(m||!i){let x;return e[7]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(ie,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(je,{size:32,className:"animate-spin text-muted-foreground"})})}),e[7]=x):x=e[7],x}let f;e[8]!==h?.data?.members?(f=h?.data?.members??[],e[8]=h?.data?.members,e[9]=f):f=e[9];const a=f;let u;return e[10]!==i||e[11]!==a||e[12]!==t?(u=s.jsx(Fs,{...t,members:a,connections:i}),e[10]=i,e[11]=a,e[12]=t,e[13]=u):u=e[13],u}function Fs({target:t,onBack:e,onSaved:l,members:n,connections:i}){const o=re(),{locator:c}=Be(),g=$e(),h=rt(),m=t.kind==="builtin",f=t.kind==="builtin"&&t.role==="owner",a=t.kind==="new",[u,x]=$.useState(m?"org":"mcp"),d=Ot({resolver:jt(us),defaultValues:Vs(t,n,i)}),p=d.formState.isValid,b=d.formState.isDirty,R=at({mutationFn:async r=>{const _=Bs(r,i),G=r.role.slug||r.role.label.toLowerCase().replace(/\s+/g,"-"),w=(r.role.slug==="owner"||r.role.slug==="admin"||r.role.slug==="user")&&!r.role.id,Y=async(y,z)=>{const P=n.filter(U=>U.role===(z??y)).map(U=>U.id),F=r.memberIds.filter(U=>!P.includes(U)),V=P.filter(U=>!r.memberIds.includes(U));for(const U of F){const B=await g.organization.updateMemberRole({memberId:U,role:[y]});if(B?.error)throw new Error(B.error.message??o("settings.orgRoleDetail.somethingWentWrong"))}for(const U of V){const B=await g.organization.updateMemberRole({memberId:U,role:["user"]});if(B?.error)throw new Error(B.error.message??o("settings.orgRoleDetail.somethingWentWrong"))}};if(w)return await Y(r.role.slug),r;if(r.role.id){const y=r.role.label.toLowerCase().replace(/\s+/g,"-"),z=r.role.slug,P=y!==z,F=await g.organization.updateRole({roleId:r.role.id,data:{permission:_,...P?{roleName:y}:{}}});if(F?.error)throw new Error(F.error.message??o("settings.orgRoleDetail.somethingWentWrong"));return await Y(P?y:z,P?z:void 0),P?{...r,role:{...r.role,slug:y}}:r}else{const y=await g.organization.createRole({role:G,permission:_});if(y?.error)throw new Error(y.error.message??o("settings.orgRoleDetail.somethingWentWrong"));for(const z of r.memberIds){const P=await g.organization.updateMemberRole({memberId:z,role:[G]});if(P?.error)throw new Error(P.error.message)}return{...r,role:{...r.role,id:y.data?.roleData?.id,slug:G}}}},onSuccess:(r,_)=>{h.invalidateQueries({queryKey:me.members(c)}),h.invalidateQueries({queryKey:me.organizationRoles(c)});const G=!_.role.id&&!_.role.slug,w=_.role.slug==="owner"&&!_.role.id;Ke(w?"role_members_updated":G?"role_created":"role_updated",{role_slug:_.role.slug??null}),Me.success(o(w?"settings.orgRoleDetail.membersUpdatedSuccessfully":G?"settings.orgRoleDetail.roleCreatedSuccessfully":"settings.orgRoleDetail.roleUpdatedSuccessfully")),d.reset(r),l(r.role.id)},onError:r=>{Me.error(r instanceof Error?r.message:o("settings.orgRoleDetail.failedToSaveRole"))}}),I=d.handleSubmit(r=>{if(!r.role.label.trim()){Me.error(o("settings.orgRoleDetail.roleNameIsRequired")),d.setFocus("role.label");return}R.mutate(r)}),A=!f,C=t.kind==="builtin"?t.role.charAt(0).toUpperCase()+t.role.slice(1):t.kind==="custom"?t.role.label:"",M=[...f?[]:[{id:"mcp",label:o("settings.orgRoleDetail.mcpPermissions")}],{id:"org",label:o("settings.orgRoleDetail.organizationPermissions")},{id:"models",label:o("settings.orgRoleDetail.models")},{id:"members",label:o("settings.orgRoleDetail.members")}],[S,O]=$.useState(""),[v,E]=$.useState(!1),N=r=>{x(r),O("")},D={mcp:o("settings.orgRoleDetail.searchMcpServers"),org:o("settings.orgRoleDetail.searchPermissions"),models:o("settings.orgRoleDetail.searchModels"),members:o("settings.orgRoleDetail.searchMembers")};return s.jsx(ie,{children:s.jsxs(ie.Content,{className:W("flex flex-col",u!=="org"&&"overflow-hidden"),children:[s.jsx("div",{className:"shrink-0 mx-auto w-full max-w-[1200px] px-4 md:px-10 pt-8 md:pt-12 pb-4",children:s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsx(ie.Title,{actions:A&&s.jsxs(s.Fragment,{children:[s.jsx(ce,{variant:"outline",size:"sm",onClick:e,disabled:R.isPending,children:o("settings.orgRoleDetail.cancel")}),s.jsx(ce,{size:"sm",onClick:I,disabled:R.isPending||!p||!b,children:R.isPending?o("settings.orgRoleDetail.saving"):o(a?"settings.orgRoleDetail.createRole":"settings.orgRoleDetail.saveChanges")})]}),children:s.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[s.jsx("div",{className:W("size-2.5 rounded-full shrink-0",t.kind==="builtin"?dt(t.role,!0):Lt(d.watch("role.label")))}),f&&s.jsx(ct,{size:16,className:"text-muted-foreground shrink-0"}),a||t.kind==="custom"?s.jsx("input",{...d.register("role.label"),placeholder:o("settings.orgRoleDetail.roleName"),className:"leading-tight text-foreground bg-transparent border-none outline-none px-1 -mx-1 rounded hover:bg-input/25 focus:bg-input/25 transition-colors w-64 placeholder:text-muted-foreground/50",autoFocus:a}):s.jsx("span",{className:"truncate",children:C})]})}),s.jsx("div",{className:"flex items-center gap-2",children:M.map(r=>s.jsx("button",{type:"button",onClick:()=>N(r.id),className:W("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex items-center",u===r.id?"bg-accent border-border text-foreground":"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:r.label},r.id))}),s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx(Qe,{value:S,onChange:O,placeholder:D[u]??"Search...",className:"w-full md:w-[375px]"}),u==="members"&&s.jsx(Ys,{readOnly:t.kind==="builtin"&&t.role==="owner",onOpen:()=>E(!0)})]})]})}),s.jsx("div",{className:W("mx-auto w-full max-w-[1200px] px-4 md:px-10 pb-6",u!=="org"&&"flex-1 min-h-0"),children:s.jsxs("div",{className:W(u!=="org"&&"h-full overflow-hidden",u!=="models"&&u!=="org"&&"border border-border rounded-xl bg-card"),children:[u==="mcp"&&!f&&s.jsx(ms,{toolSet:d.watch("toolSet"),onToolSetChange:r=>d.setValue("toolSet",r,{shouldDirty:!0}),searchQuery:S}),u==="org"&&s.jsx(fs,{allowAllStaticPermissions:d.watch("allowAllStaticPermissions"),staticPermissions:d.watch("staticPermissions"),onAllowAllChange:r=>d.setValue("allowAllStaticPermissions",r,{shouldDirty:!0}),onPermissionsChange:r=>d.setValue("staticPermissions",r,{shouldDirty:!0}),readOnly:f,searchQuery:S}),u==="models"&&s.jsx(vs,{allowAllModels:d.watch("allowAllModels"),modelSet:d.watch("modelSet"),onAllowAllChange:r=>d.setValue("allowAllModels",r,{shouldDirty:!0}),onModelSetChange:r=>d.setValue("modelSet",r,{shouldDirty:!0}),readOnly:f,searchQuery:S}),u==="members"&&s.jsx(ws,{memberIds:d.watch("memberIds"),onMemberIdsChange:r=>d.setValue("memberIds",r,{shouldDirty:!0}),readOnly:t.kind==="builtin"&&(t.role==="owner"||t.role==="user"),readOnlyMessage:t.kind==="builtin"&&t.role==="user"?o("settings.orgRoleDetail.userIsDefaultRoleMessage"):o("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),searchQuery:S,addMemberDialogOpen:v,onAddMemberDialogOpenChange:E})]})})]})})}function Ks(t){return t.kind==="builtin"?`builtin-${t.role}`:t.kind==="custom"?`custom-${t.role.id}`:"new"}function $s(t){const e=J.c(6),{area:l,children:n}=t,{isPrivileged:i,loading:o,error:c}=ts();let g;return e[0]!==l||e[1]!==n||e[2]!==c||e[3]!==i||e[4]!==o?(g=s.jsx(ss,{granted:i,loading:o,error:c,area:l,children:n}),e[0]=l,e[1]=n,e[2]=c,e[3]=i,e[4]=o,e[5]=g):g=e[5],g}const Qs=[{role:"owner",labelKey:"settings.roles.roleOwner"},{role:"admin",labelKey:"settings.roles.roleAdmin"},{role:"user",labelKey:"settings.roles.roleUser"}];function Zs(){const t=J.c(135),e=re(),[l,n]=$.useState(""),[i,o]=$.useState(null),c=Dt();let g;t[0]===Symbol.for("react.memo_cache_sentinel")?(g={strict:!1},t[0]=g):g=t[0];const{role:h}=yt(g),{locator:m}=Be(),f=$e(),a=rt(),{customRoles:u,refetch:x}=Pt();let d;t[1]!==c?(d=j=>c({to:".",search:L=>({...L,role:j})}),t[1]=c,t[2]=d):d=t[2];const p=d;let b;e:{if(!h){b=null;break e}if(h==="new"){b={kind:"new"};break e}if(h.startsWith("builtin-")){b={kind:"builtin",role:h.slice(8)};break e}let j;t[3]!==h?(j=ee=>ee.id===h,t[3]=h,t[4]=j):j=t[4];const L=u.find(j);b=L?{kind:"custom",role:L}:null}const R=b;let I;t[5]!==m?(I=me.members(m),t[5]=m,t[6]=I):I=t[6];let A;t[7]!==f?(A=()=>f.organization.listMembers(),t[7]=f,t[8]=A):A=t[8];let C;t[9]!==I||t[10]!==A?(C={queryKey:I,queryFn:A},t[9]=I,t[10]=A,t[11]=C):C=t[11];const{data:M}=Fe(C);let S;t[12]!==M?.data?.members?(S=M?.data?.members??[],t[12]=M?.data?.members,t[13]=S):S=t[13];const O=S;let v;t[14]!==O?(v=j=>O.filter(L=>L.role===j).length,t[14]=O,t[15]=v):v=t[15];const E=v;let N;if(t[16]!==u||t[17]!==E||t[18]!==l||t[19]!==e){let j;t[21]!==E||t[22]!==e?(j=de=>({kind:"builtin",role:{...de,memberCount:E(de.role),label:e(de.labelKey)}}),t[21]=E,t[22]=e,t[23]=j):j=t[23];const L=Qs.map(j);let ee;t[24]!==E?(ee=de=>({kind:"custom",role:{...de,memberCount:E(de.role)}}),t[24]=E,t[25]=ee):ee=t[25];const bt=u.map(ee);if(N=[...L,...bt],l){const de=l.toLowerCase();N=N.filter(At=>At.role.label.toLowerCase().includes(de))}t[16]=u,t[17]=E,t[18]=l,t[19]=e,t[20]=N}else N=t[20];let D;t[26]!==f?(D=async j=>{const L=await f.organization.deleteRole({roleId:j});if(L?.error)throw new Error(L.error.message);return L?.data},t[26]=f,t[27]=D):D=t[27];const r=at({mutationFn:D,onSuccess:(j,L)=>{Ke("role_deleted",{role_id:L}),a.invalidateQueries({queryKey:me.members(m)}),a.invalidateQueries({queryKey:me.organizationRoles(m)}),Me.success(e("settings.roles.deletedSuccessfully")),x(),R?.kind==="custom"&&R.role.id===L&&p(void 0)},onError:Js});let _;t[28]!==e?(_=e("settings.roles.columnRole"),t[28]=e,t[29]=_):_=t[29];let G;t[30]!==_?(G={id:"role",header:_,render:Xs,cellClassName:"flex-1 min-w-0",sortable:!0},t[30]=_,t[31]=G):G=t[31];let w;t[32]!==e?(w=e("settings.roles.columnType"),t[32]=e,t[33]=w):w=t[33];let Y;t[34]!==e?(Y=j=>j.kind==="builtin"?s.jsx(ve,{variant:"secondary",className:"text-xs",children:e("settings.roles.builtIn")}):s.jsx(ve,{variant:"outline",className:"text-xs",children:e("settings.roles.custom")}),t[34]=e,t[35]=Y):Y=t[35];let y;t[36]!==w||t[37]!==Y?(y={id:"type",header:w,render:Y,cellClassName:"w-28 shrink-0"},t[36]=w,t[37]=Y,t[38]=y):y=t[38];let z;t[39]!==e?(z=e("settings.roles.columnPermissions"),t[39]=e,t[40]=z):z=t[40];let P;t[41]!==e?(P=j=>{if(j.kind==="builtin")return j.role.role==="owner"||j.role.role==="admin"?s.jsx("span",{className:"text-sm text-muted-foreground",children:e("settings.roles.fullAccess")}):s.jsx("span",{className:"text-sm text-muted-foreground",children:e("settings.roles.basicAccess")});const L=j.role,ee=[];return L.allowsAllStaticPermissions?ee.push(e("settings.roles.fullOrgAccess")):L.staticPermissionCount&&L.staticPermissionCount>0&&ee.push(e("settings.roles.orgPermsCount",{count:L.staticPermissionCount})),L.allowsAllConnections?ee.push(e("settings.roles.allConnections")):L.connectionCount&&L.connectionCount>0&&ee.push(e("settings.roles.connectionCount",{count:L.connectionCount})),s.jsx("span",{className:"text-sm text-muted-foreground truncate",children:ee.length>0?ee.join(", "):e("settings.roles.noPermissions")})},t[41]=e,t[42]=P):P=t[42];let F;t[43]!==z||t[44]!==P?(F={id:"permissions",header:z,render:P,cellClassName:"flex-1 min-w-0"},t[43]=z,t[44]=P,t[45]=F):F=t[45];let V;t[46]!==e?(V=e("settings.roles.columnMembers"),t[46]=e,t[47]=V):V=t[47];let U;t[48]!==V?(U={id:"members",header:V,render:Ws,cellClassName:"w-24 shrink-0"},t[48]=V,t[49]=U):U=t[49];let B;t[50]!==e?(B={id:"actions",header:"",render:j=>j.kind==="builtin"?null:s.jsxs(wt,{children:[s.jsx(kt,{asChild:!0,children:s.jsx(ce,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Hs,children:s.jsx(Bt,{size:16})})}),s.jsx(Gt,{align:"end",onClick:qs,children:s.jsxs(Ut,{variant:"destructive",onClick:()=>{const L=j.role;L.id&&o({id:L.id,label:L.label})},children:[s.jsx(Vt,{size:16}),e("settings.roles.delete")]})})]}),cellClassName:"w-12 shrink-0"},t[50]=e,t[51]=B):B=t[51];let Z;t[52]!==G||t[53]!==y||t[54]!==F||t[55]!==U||t[56]!==B?(Z=[G,y,F,U,B],t[52]=G,t[53]=y,t[54]=F,t[55]=U,t[56]=B,t[57]=Z):Z=t[57];const X=Z;let te;t[58]!==p?(te=j=>{if(j.kind==="builtin")p(`builtin-${j.role.role}`);else{const L=j.role;p(L.id)}},t[58]=p,t[59]=te):te=t[59];const le=te;if(R){let j;t[60]!==p?(j=()=>p(void 0),t[60]=p,t[61]=j):j=t[61];let L;return t[62]!==x||t[63]!==p?(L=()=>{x(),p(void 0)},t[62]=x,t[63]=p,t[64]=L):L=t[64],s.jsx(zs,{target:R,onBack:j,onSaved:L},Ks(R))}let K;t[65]!==e?(K=e("settings.roles.pageTitle"),t[65]=e,t[66]=K):K=t[66];let q;t[67]!==K?(q=s.jsx(ie.Title,{children:K}),t[67]=K,t[68]=q):q=t[68];let T;t[69]!==e?(T=e("settings.roles.searchPlaceholder"),t[69]=e,t[70]=T):T=t[70];let k;t[71]===Symbol.for("react.memo_cache_sentinel")?(k=j=>{j.key==="Escape"&&(n(""),j.target.blur())},t[71]=k):k=t[71];let Q;t[72]!==l||t[73]!==T?(Q=s.jsx(Qe,{value:l,onChange:n,placeholder:T,className:"w-full md:w-[375px]",onKeyDown:k}),t[72]=l,t[73]=T,t[74]=Q):Q=t[74];let H;t[75]!==p?(H=()=>p("new"),t[75]=p,t[76]=H):H=t[76];let ne;t[77]===Symbol.for("react.memo_cache_sentinel")?(ne=s.jsx(ze,{size:16}),t[77]=ne):ne=t[77];let se;t[78]!==e?(se=e("settings.roles.createRole"),t[78]=e,t[79]=se):se=t[79];let oe;t[80]!==H||t[81]!==se?(oe=s.jsxs(ce,{onClick:H,children:[ne,se]}),t[80]=H,t[81]=se,t[82]=oe):oe=t[82];let ue;t[83]!==Q||t[84]!==oe?(ue=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[Q,oe]}),t[83]=Q,t[84]=oe,t[85]=ue):ue=t[85];let fe;t[86]!==l||t[87]!==e?(fe=l?s.jsx(tt,{title:e("settings.roles.noRolesFound"),description:e("settings.roles.noRolesMatchSearch",{search:l})}):s.jsx(tt,{title:e("settings.roles.noRoles"),description:e("settings.roles.createRoleGetStarted")}),t[86]=l,t[87]=e,t[88]=fe):fe=t[88];let ge;t[89]!==N||t[90]!==X||t[91]!==le||t[92]!==fe?(ge=s.jsx(Yt,{columns:X,data:N,isLoading:!1,onRowClick:le,emptyState:fe}),t[89]=N,t[90]=X,t[91]=le,t[92]=fe,t[93]=ge):ge=t[93];let he;t[94]!==q||t[95]!==ue||t[96]!==ge?(he=s.jsx(ie.Content,{children:s.jsx(ie.Body,{children:s.jsxs("div",{className:"flex flex-col gap-6",children:[q,ue,ge]})})}),t[94]=q,t[95]=ue,t[96]=ge,t[97]=he):he=t[97];const Ve=i!==null;let ke;t[98]===Symbol.for("react.memo_cache_sentinel")?(ke=j=>!j&&o(null),t[98]=ke):ke=t[98];let xe;t[99]!==e?(xe=e("settings.roles.deleteRoleTitle"),t[99]=e,t[100]=xe):xe=t[100];let pe;t[101]!==xe?(pe=s.jsx(ft,{children:xe}),t[101]=xe,t[102]=pe):pe=t[102];const Ye=i?.label??"";let Te;t[103]!==e||t[104]!==Ye?(Te=e("settings.roles.deleteRoleConfirm",{role:Ye}),t[103]=e,t[104]=Ye,t[105]=Te):Te=t[105];let Ee;t[106]!==Te?(Ee=s.jsx(gt,{children:Te}),t[106]=Te,t[107]=Ee):Ee=t[107];let _e;t[108]!==pe||t[109]!==Ee?(_e=s.jsxs(ht,{children:[pe,Ee]}),t[108]=pe,t[109]=Ee,t[110]=_e):_e=t[110];let Ie;t[111]!==e?(Ie=e("settings.roles.cancel"),t[111]=e,t[112]=Ie):Ie=t[112];let Re;t[113]!==Ie?(Re=s.jsx(xt,{children:Ie}),t[113]=Ie,t[114]=Re):Re=t[114];let Se;t[115]!==r||t[116]!==i?(Se=()=>{i?.id&&r.mutate(i.id),o(null)},t[115]=r,t[116]=i,t[117]=Se):Se=t[117];let Ce;t[118]!==e?(Ce=e("settings.roles.delete"),t[118]=e,t[119]=Ce):Ce=t[119];let Ne;t[120]!==Se||t[121]!==Ce?(Ne=s.jsx(pt,{onClick:Se,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Ce}),t[120]=Se,t[121]=Ce,t[122]=Ne):Ne=t[122];let be;t[123]!==Re||t[124]!==Ne?(be=s.jsxs(Tt,{children:[Re,Ne]}),t[123]=Re,t[124]=Ne,t[125]=be):be=t[125];let Ae;t[126]!==_e||t[127]!==be?(Ae=s.jsxs(ut,{children:[_e,be]}),t[126]=_e,t[127]=be,t[128]=Ae):Ae=t[128];let Oe;t[129]!==Ve||t[130]!==Ae?(Oe=s.jsx(mt,{open:Ve,onOpenChange:ke,children:Ae}),t[129]=Ve,t[130]=Ae,t[131]=Oe):Oe=t[131];let Ge;return t[132]!==he||t[133]!==Oe?(Ge=s.jsxs(ie,{children:[he,Oe]}),t[132]=he,t[133]=Oe,t[134]=Ge):Ge=t[134],Ge}function qs(t){return t.stopPropagation()}function Hs(t){return t.stopPropagation()}function Ws(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.role.memberCount})}function Xs(t){return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:W("size-2.5 rounded-full shrink-0",dt(t.role.role,t.kind==="builtin"))}),s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:t.role.label}),t.kind==="builtin"&&s.jsx(ct,{size:12,className:"text-muted-foreground shrink-0"})]})}function Js(t,e){Ke("role_delete_failed",{role_id:e,error:t instanceof Error?t.message:String(t)}),Me.error(t instanceof Error?t.message:"Failed to delete role")}function el(){const t=J.c(7),e=re();let l;t[0]!==e?(l=e("settings.roles.failedToLoad"),t[0]=e,t[1]=l):l=t[1];let n;t[2]!==l?(n=s.jsx(ie,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-sm text-muted-foreground",children:l})})}),t[2]=l,t[3]=n):n=t[3];let i;t[4]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx($.Suspense,{fallback:s.jsx(ie,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(je,{size:32,className:"animate-spin text-muted-foreground"})})}),children:s.jsx(Zs,{})}),t[4]=i):i=t[4];let o;return t[5]!==n?(o=s.jsx(vt,{fallback:n,children:i}),t[5]=n,t[6]=o):o=t[6],o}function jo(){const t=J.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx($s,{area:"roles",children:s.jsx(el,{})}),t[0]=e):e=t[0],e}export{jo as default};
@@ -1 +1 @@
1
- import{c as b,m as w,j as a,k as j}from"./index-DlrJLd0f.js";import{i as k}from"./SearchMd-CpktppFq.js";function S(f){const e=b.c(17),{value:l,onChange:c,placeholder:g,onKeyDown:d,className:u,isSearching:m,disabled:i}=f,p=g===void 0?"Search...":g,x=i&&"pointer-events-none opacity-50";let t;e[0]!==u||e[1]!==x?(t=w("flex items-center gap-4 rounded-lg bg-background dark:bg-input/30 px-3 h-8 card-shadow","focus-within:border-ring focus-within:ring-ring/20 focus-within:ring-[2px]","transition-[color,box-shadow]",x,u),e[0]=u,e[1]=x,e[2]=t):t=e[2];let n;e[3]!==m?(n=m?a.jsx(j,{size:16,className:"animate-spin text-muted-foreground/75 shrink-0"}):a.jsx(k,{size:16,className:"text-muted-foreground/75 shrink-0"}),e[3]=m,e[4]=n):n=e[4];let s;e[5]!==c?(s=h=>c(h.target.value),e[5]=c,e[6]=s):s=e[6];let o;e[7]!==i||e[8]!==d||e[9]!==p||e[10]!==s||e[11]!==l?(o=a.jsx("input",{type:"text",value:l,onChange:s,onKeyDown:d,placeholder:p,disabled:i,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[7]=i,e[8]=d,e[9]=p,e[10]=s,e[11]=l,e[12]=o):o=e[12];let r;return e[13]!==t||e[14]!==n||e[15]!==o?(r=a.jsxs("label",{className:t,children:[n,o]}),e[13]=t,e[14]=n,e[15]=o,e[16]=r):r=e[16],r}export{S};
1
+ import{c as b,m as w,j as a,k as j}from"./index-CpP-S0pD.js";import{i as k}from"./SearchMd-BGnU940I.js";function S(f){const e=b.c(17),{value:l,onChange:c,placeholder:g,onKeyDown:d,className:u,isSearching:m,disabled:i}=f,p=g===void 0?"Search...":g,x=i&&"pointer-events-none opacity-50";let t;e[0]!==u||e[1]!==x?(t=w("flex items-center gap-4 rounded-lg bg-background dark:bg-input/30 px-3 h-8 card-shadow","focus-within:border-ring focus-within:ring-ring/20 focus-within:ring-[2px]","transition-[color,box-shadow]",x,u),e[0]=u,e[1]=x,e[2]=t):t=e[2];let n;e[3]!==m?(n=m?a.jsx(j,{size:16,className:"animate-spin text-muted-foreground/75 shrink-0"}):a.jsx(k,{size:16,className:"text-muted-foreground/75 shrink-0"}),e[3]=m,e[4]=n):n=e[4];let s;e[5]!==c?(s=h=>c(h.target.value),e[5]=c,e[6]=s):s=e[6];let o;e[7]!==i||e[8]!==d||e[9]!==p||e[10]!==s||e[11]!==l?(o=a.jsx("input",{type:"text",value:l,onChange:s,onKeyDown:d,placeholder:p,disabled:i,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[7]=i,e[8]=d,e[9]=p,e[10]=s,e[11]=l,e[12]=o):o=e[12];let r;return e[13]!==t||e[14]!==n||e[15]!==o?(r=a.jsxs("label",{className:t,children:[n,o]}),e[13]=t,e[14]=n,e[15]=o,e[16]=r):r=e[16],r}export{S};
@@ -1 +1 @@
1
- import{c as j,b as y,j as s,E as $,r as v,y as k,B as _,t as w}from"./index-DlrJLd0f.js";import{i as F}from"./AlertCircle-DgoHSCa6.js";import{s as E}from"./Plus-CVwkfcJG.js";import{s as B}from"./User01-glsH12c1.js";import{t as L}from"./Users01-BSccQxC5.js";import{e as O,d as R,a as A,b as I,h as q,c as V}from"./dialog-YX8qb6L-.js";import{I as z}from"./input-VJryuHef.js";import{L as N}from"./label-C3jo-Tkg.js";import{S as H,a as G,b as J,c as K,d as D}from"./select-D8tnZPAO.js";import{S as M}from"./skeleton-CZe0GgC0.js";import{T as Q}from"./textarea-BDQ2l--t.js";import{P as C}from"./index-BAHKl3Dr.js";import{c as U}from"./settings-section-BQSpoRM4.js";import{u as W,a as X}from"./use-secrets-CP_mnoUN.js";import{R as Y}from"./require-capability-Dt4nTGcU.js";import"./X-D9krIRRY.js";import"./tooltip-CWiu9D12.js";import"./Check-DYjHBTZg.js";import"./ChevronDown-8AYAqaQi.js";import"./ChevronUp-BwstsprL.js";import"./sidebar-B7lAtJq4.js";import"./LayoutLeft-DM2MbZ1w.js";import"./use-mobile-DrOZ2zHv.js";import"./card-CodfA5B5.js";import"./ArrowUpRight-HJ-SySJk.js";import"./studio-tools-z4_ic7wa.js";import"./use-capability-Bk3J-Iqx.js";import"./access-gate-Bp90a8v-.js";import"./capability-load-error-C8XozWxK.js";function Z(t){const e=j.c(6),{error:r}=t,i=y();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(F,{size:16}),e[0]=c):c=e[0];let n;e[1]!==r.message||e[2]!==i?(n=i("settings.secrets.failedToLoadError",{error:r.message}),e[1]=r.message,e[2]=i,e[3]=n):n=e[3];let l;return e[4]!==n?(l=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[c,s.jsx("span",{className:"text-sm font-medium",children:n})]}),e[4]=n,e[5]=l):l=e[5],l}function ee(t){const e=j.c(8),{scope:r}=t,i=y(),c=r==="user"?B:L;let n;e[0]!==r||e[1]!==i?(n=i(r==="user"?"settings.secrets.scopePrivate":"settings.secrets.scopeOrganization"),e[0]=r,e[1]=i,e[2]=n):n=e[2];const l=n;let o;e[3]!==c?(o=s.jsx(c,{size:12}),e[3]=c,e[4]=o):o=e[4];let a;return e[5]!==l||e[6]!==o?(a=s.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-muted text-muted-foreground text-xs",children:[o,l]}),e[5]=l,e[6]=o,e[7]=a):a=e[7],a}function T(t){const e=j.c(20),{secret:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:s.jsx(k,{size:16,className:"text-muted-foreground"})}),e[0]=i):i=e[0];let c;e[1]!==r.name?(c=s.jsx("span",{className:"font-medium text-sm truncate",children:r.name}),e[1]=r.name,e[2]=c):c=e[2];let n;e[3]!==r.scope?(n=s.jsx(ee,{scope:r.scope}),e[3]=r.scope,e[4]=n):n=e[4];let l;e[5]!==c||e[6]!==n?(l=s.jsxs("div",{className:"flex items-center gap-2",children:[c,n]}),e[5]=c,e[6]=n,e[7]=l):l=e[7];let o;e[8]!==r.description?(o=r.description?s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:r.description}):null,e[8]=r.description,e[9]=o):o=e[9];let a;e[10]!==l||e[11]!==o?(a=s.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[i,s.jsxs("div",{className:"min-w-0",children:[l,o]})]}),e[10]=l,e[11]=o,e[12]=a):a=e[12];let u;e[13]!==r.createdAt?(u=new Date(r.createdAt).toLocaleDateString(),e[13]=r.createdAt,e[14]=u):u=e[14];let d;e[15]!==u?(d=s.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:u}),e[15]=u,e[16]=d):d=e[16];let m;return e[17]!==a||e[18]!==d?(m=s.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[a,d]}),e[17]=a,e[18]=d,e[19]=m):m=e[19],m}function te(t){const e=j.c(21),{onCreate:r}=t,i=y();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:s.jsx(k,{size:20,className:"text-muted-foreground"})}),e[0]=c):c=e[0];let n;e[1]!==i?(n=i("settings.secrets.emptyTitle"),e[1]=i,e[2]=n):n=e[2];let l;e[3]!==n?(l=s.jsx("p",{className:"font-medium text-sm",children:n}),e[3]=n,e[4]=l):l=e[4];let o;e[5]!==i?(o=i("settings.secrets.emptyDescription"),e[5]=i,e[6]=o):o=e[6];let a;e[7]!==o?(a=s.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:o}),e[7]=o,e[8]=a):a=e[8];let u;e[9]!==l||e[10]!==a?(u=s.jsxs("div",{children:[l,a]}),e[9]=l,e[10]=a,e[11]=u):u=e[11];let d;e[12]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(E,{size:14}),e[12]=d):d=e[12];let m;e[13]!==i?(m=i("settings.secrets.newSecret"),e[13]=i,e[14]=m):m=e[14];let p;e[15]!==r||e[16]!==m?(p=s.jsxs(_,{onClick:r,size:"sm",className:"mt-2",children:[d,m]}),e[15]=r,e[16]=m,e[17]=p):p=e[17];let x;return e[18]!==u||e[19]!==p?(x=s.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[c,u,p]}),e[18]=u,e[19]=p,e[20]=x):x=e[20],x}function P({open:t,onOpenChange:e}){const r=y(),[i,c]=v.useState("organization"),[n,l]=v.useState(""),[o,a]=v.useState(""),[u,d]=v.useState(""),m=X();function p(){c("organization"),l(""),a(""),d("")}function x(){p(),e(!1)}async function g(f){if(f.preventDefault(),!(!n.trim()||!o))try{await m.mutateAsync({scope:i,name:n.trim(),value:o,description:u.trim()||void 0}),w.success(r("settings.secrets.secretCreated",{name:n.trim()})),x()}catch(h){w.error(h instanceof Error?h.message:r("settings.secrets.failedToCreateSecret"))}}return s.jsx(O,{open:t,onOpenChange:f=>{f?e(f):x()},children:s.jsxs(R,{className:"sm:max-w-lg",children:[s.jsxs(A,{children:[s.jsx(I,{children:r("settings.secrets.newSecretTitle")}),s.jsx(q,{children:r("settings.secrets.newSecretDescription")})]}),s.jsxs("form",{onSubmit:g,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(N,{htmlFor:"secret-scope",children:r("settings.secrets.scopeLabel")}),s.jsxs(H,{value:i,onValueChange:f=>c(f),children:[s.jsx(G,{id:"secret-scope",children:s.jsx(J,{})}),s.jsxs(K,{children:[s.jsx(D,{value:"organization",children:r("settings.secrets.scopeOrganizationDescription")}),s.jsx(D,{value:"user",children:r("settings.secrets.scopePrivateDescription")})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(N,{htmlFor:"secret-name",children:r("settings.secrets.nameLabel")}),s.jsx(z,{id:"secret-name",value:n,onChange:f=>l(f.target.value),placeholder:r("settings.secrets.namePlaceholder"),autoComplete:"off",required:!0}),s.jsx("p",{className:"text-xs text-muted-foreground",children:r("settings.secrets.nameHelp")})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(N,{htmlFor:"secret-value",children:r("settings.secrets.valueLabel")}),s.jsx(z,{id:"secret-value",type:"password",value:o,onChange:f=>a(f.target.value),autoComplete:"new-password",required:!0})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(N,{htmlFor:"secret-description",children:r("settings.secrets.descriptionLabel")}),s.jsx(Q,{id:"secret-description",value:u,onChange:f=>d(f.target.value),rows:2,placeholder:r("settings.secrets.descriptionPlaceholder")})]}),s.jsxs(V,{children:[s.jsx(_,{type:"button",variant:"outline",onClick:x,disabled:m.isPending,children:r("settings.secrets.cancelButton")}),s.jsx(_,{type:"submit",disabled:m.isPending||!n.trim()||!o,children:m.isPending?r("settings.secrets.creatingButton"):r("settings.secrets.createButton")})]})]})]})})}function se(){const t=j.c(30),e=y(),r=W(),[i,c]=v.useState(!1);if(r.length===0){let d;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(te,{onCreate:()=>c(!0)}),t[0]=d):d=t[0];let m;return t[1]!==i?(m=s.jsxs(s.Fragment,{children:[d,s.jsx(P,{open:i,onOpenChange:c})]}),t[1]=i,t[2]=m):m=t[2],m}let n,l,o;if(t[3]!==r||t[4]!==e){const d=r.filter(ce),m=r.filter(ie),p=r.length===1?"settings.secrets.secretsCountSingular":"settings.secrets.secretsCountPlural";let x;t[8]!==r.length||t[9]!==e||t[10]!==p?(x=e(p,{count:r.length}),t[8]=r.length,t[9]=e,t[10]=p,t[11]=x):x=t[11];let g;t[12]!==x?(g=s.jsx("p",{className:"text-sm text-muted-foreground",children:x}),t[12]=x,t[13]=g):g=t[13];let f;t[14]===Symbol.for("react.memo_cache_sentinel")?(f=()=>c(!0),t[14]=f):f=t[14];let h;t[15]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(E,{size:14}),t[15]=h):h=t[15];let b;t[16]!==e?(b=e("settings.secrets.newSecret"),t[16]=e,t[17]=b):b=t[17];let S;t[18]!==b?(S=s.jsxs(_,{onClick:f,size:"sm",children:[h,b]}),t[18]=b,t[19]=S):S=t[19],t[20]!==g||t[21]!==S?(n=s.jsxs("div",{className:"flex items-center justify-between",children:[g,S]}),t[20]=g,t[21]=S,t[22]=n):n=t[22],l=d.length>0?s.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:e("settings.secrets.sectionOrganization")}),s.jsx("div",{children:d.map(ne)})]}):null,o=m.length>0?s.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:e("settings.secrets.sectionPrivate")}),s.jsx("div",{children:m.map(re)})]}):null,t[3]=r,t[4]=e,t[5]=n,t[6]=l,t[7]=o}else n=t[5],l=t[6],o=t[7];let a;t[23]!==i?(a=s.jsx(P,{open:i,onOpenChange:c}),t[23]=i,t[24]=a):a=t[24];let u;return t[25]!==n||t[26]!==l||t[27]!==o||t[28]!==a?(u=s.jsxs(s.Fragment,{children:[n,l,o,a]}),t[25]=n,t[26]=l,t[27]=o,t[28]=a,t[29]=u):u=t[29],u}function re(t){return s.jsx(T,{secret:t},t.id)}function ne(t){return s.jsx(T,{secret:t},t.id)}function ie(t){return t.scope==="user"}function ce(t){return t.scope==="organization"}function le(){const t=j.c(7),e=y();let r;t[0]!==e?(r=e("settings.nav.secrets"),t[0]=e,t[1]=r):r=t[1];let i;t[2]!==r?(i=s.jsx(C.Title,{children:r}),t[2]=r,t[3]=i):i=t[3];let c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx($,{fallback:oe,children:s.jsx(v.Suspense,{fallback:s.jsx(M,{className:"h-32 w-full"}),children:s.jsx(se,{})})}),t[4]=c):c=t[4];let n;return t[5]!==i?(n=s.jsx(C,{children:s.jsx(C.Content,{children:s.jsx(C.Body,{children:s.jsxs(U,{children:[i,c]})})})}),t[5]=i,t[6]=n):n=t[6],n}function oe(t){const{error:e}=t;return s.jsx(Z,{error:e??new Error("Failed to load secrets")})}function Re(){const t=j.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Y,{capability:"secrets:manage",area:"secrets",children:s.jsx(le,{})}),t[0]=e):e=t[0],e}export{Re as default};
1
+ import{c as j,b as y,j as s,E as $,r as v,y as k,B as _,t as w}from"./index-CpP-S0pD.js";import{i as F}from"./AlertCircle-BKkj59p3.js";import{s as E}from"./Plus-Ca3Ml2LK.js";import{s as B}from"./User01-Bp6SHWEy.js";import{t as L}from"./Users01-C1IDGxoN.js";import{e as O,d as R,a as A,b as I,h as q,c as V}from"./dialog-wdHWjrNV.js";import{I as z}from"./input-s4-qH7Fl.js";import{L as N}from"./label-lanDCOta.js";import{S as H,a as G,b as J,c as K,d as D}from"./select-D-d6Z69w.js";import{S as M}from"./skeleton-Db9HI085.js";import{T as Q}from"./textarea-BKf1b5oV.js";import{P as C}from"./index-CQclcDZz.js";import{c as U}from"./settings-section-DCHGjEDu.js";import{u as W,a as X}from"./use-secrets-DrUz6g7Q.js";import{R as Y}from"./require-capability-BEf-wZsP.js";import"./X-CvDwW-rN.js";import"./tooltip-CuJ91_oS.js";import"./Check-B5Ocw477.js";import"./ChevronDown-DMeq6c1L.js";import"./ChevronUp-M4yeuEfW.js";import"./sidebar-D3JiZvSx.js";import"./LayoutLeft-C94F55Om.js";import"./use-mobile-C91dq5AF.js";import"./card-C2iwtGFp.js";import"./ArrowUpRight-DqAI4rqY.js";import"./studio-tools-C42EgVLm.js";import"./use-capability-BEep6Ha8.js";import"./access-gate-B5lWeKmi.js";import"./capability-load-error-_ve37G5r.js";function Z(t){const e=j.c(6),{error:r}=t,i=y();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(F,{size:16}),e[0]=c):c=e[0];let n;e[1]!==r.message||e[2]!==i?(n=i("settings.secrets.failedToLoadError",{error:r.message}),e[1]=r.message,e[2]=i,e[3]=n):n=e[3];let l;return e[4]!==n?(l=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[c,s.jsx("span",{className:"text-sm font-medium",children:n})]}),e[4]=n,e[5]=l):l=e[5],l}function ee(t){const e=j.c(8),{scope:r}=t,i=y(),c=r==="user"?B:L;let n;e[0]!==r||e[1]!==i?(n=i(r==="user"?"settings.secrets.scopePrivate":"settings.secrets.scopeOrganization"),e[0]=r,e[1]=i,e[2]=n):n=e[2];const l=n;let o;e[3]!==c?(o=s.jsx(c,{size:12}),e[3]=c,e[4]=o):o=e[4];let a;return e[5]!==l||e[6]!==o?(a=s.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-muted text-muted-foreground text-xs",children:[o,l]}),e[5]=l,e[6]=o,e[7]=a):a=e[7],a}function T(t){const e=j.c(20),{secret:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:s.jsx(k,{size:16,className:"text-muted-foreground"})}),e[0]=i):i=e[0];let c;e[1]!==r.name?(c=s.jsx("span",{className:"font-medium text-sm truncate",children:r.name}),e[1]=r.name,e[2]=c):c=e[2];let n;e[3]!==r.scope?(n=s.jsx(ee,{scope:r.scope}),e[3]=r.scope,e[4]=n):n=e[4];let l;e[5]!==c||e[6]!==n?(l=s.jsxs("div",{className:"flex items-center gap-2",children:[c,n]}),e[5]=c,e[6]=n,e[7]=l):l=e[7];let o;e[8]!==r.description?(o=r.description?s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:r.description}):null,e[8]=r.description,e[9]=o):o=e[9];let a;e[10]!==l||e[11]!==o?(a=s.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[i,s.jsxs("div",{className:"min-w-0",children:[l,o]})]}),e[10]=l,e[11]=o,e[12]=a):a=e[12];let u;e[13]!==r.createdAt?(u=new Date(r.createdAt).toLocaleDateString(),e[13]=r.createdAt,e[14]=u):u=e[14];let d;e[15]!==u?(d=s.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:u}),e[15]=u,e[16]=d):d=e[16];let m;return e[17]!==a||e[18]!==d?(m=s.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[a,d]}),e[17]=a,e[18]=d,e[19]=m):m=e[19],m}function te(t){const e=j.c(21),{onCreate:r}=t,i=y();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:s.jsx(k,{size:20,className:"text-muted-foreground"})}),e[0]=c):c=e[0];let n;e[1]!==i?(n=i("settings.secrets.emptyTitle"),e[1]=i,e[2]=n):n=e[2];let l;e[3]!==n?(l=s.jsx("p",{className:"font-medium text-sm",children:n}),e[3]=n,e[4]=l):l=e[4];let o;e[5]!==i?(o=i("settings.secrets.emptyDescription"),e[5]=i,e[6]=o):o=e[6];let a;e[7]!==o?(a=s.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:o}),e[7]=o,e[8]=a):a=e[8];let u;e[9]!==l||e[10]!==a?(u=s.jsxs("div",{children:[l,a]}),e[9]=l,e[10]=a,e[11]=u):u=e[11];let d;e[12]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(E,{size:14}),e[12]=d):d=e[12];let m;e[13]!==i?(m=i("settings.secrets.newSecret"),e[13]=i,e[14]=m):m=e[14];let p;e[15]!==r||e[16]!==m?(p=s.jsxs(_,{onClick:r,size:"sm",className:"mt-2",children:[d,m]}),e[15]=r,e[16]=m,e[17]=p):p=e[17];let x;return e[18]!==u||e[19]!==p?(x=s.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[c,u,p]}),e[18]=u,e[19]=p,e[20]=x):x=e[20],x}function P({open:t,onOpenChange:e}){const r=y(),[i,c]=v.useState("organization"),[n,l]=v.useState(""),[o,a]=v.useState(""),[u,d]=v.useState(""),m=X();function p(){c("organization"),l(""),a(""),d("")}function x(){p(),e(!1)}async function g(f){if(f.preventDefault(),!(!n.trim()||!o))try{await m.mutateAsync({scope:i,name:n.trim(),value:o,description:u.trim()||void 0}),w.success(r("settings.secrets.secretCreated",{name:n.trim()})),x()}catch(h){w.error(h instanceof Error?h.message:r("settings.secrets.failedToCreateSecret"))}}return s.jsx(O,{open:t,onOpenChange:f=>{f?e(f):x()},children:s.jsxs(R,{className:"sm:max-w-lg",children:[s.jsxs(A,{children:[s.jsx(I,{children:r("settings.secrets.newSecretTitle")}),s.jsx(q,{children:r("settings.secrets.newSecretDescription")})]}),s.jsxs("form",{onSubmit:g,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(N,{htmlFor:"secret-scope",children:r("settings.secrets.scopeLabel")}),s.jsxs(H,{value:i,onValueChange:f=>c(f),children:[s.jsx(G,{id:"secret-scope",children:s.jsx(J,{})}),s.jsxs(K,{children:[s.jsx(D,{value:"organization",children:r("settings.secrets.scopeOrganizationDescription")}),s.jsx(D,{value:"user",children:r("settings.secrets.scopePrivateDescription")})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(N,{htmlFor:"secret-name",children:r("settings.secrets.nameLabel")}),s.jsx(z,{id:"secret-name",value:n,onChange:f=>l(f.target.value),placeholder:r("settings.secrets.namePlaceholder"),autoComplete:"off",required:!0}),s.jsx("p",{className:"text-xs text-muted-foreground",children:r("settings.secrets.nameHelp")})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(N,{htmlFor:"secret-value",children:r("settings.secrets.valueLabel")}),s.jsx(z,{id:"secret-value",type:"password",value:o,onChange:f=>a(f.target.value),autoComplete:"new-password",required:!0})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(N,{htmlFor:"secret-description",children:r("settings.secrets.descriptionLabel")}),s.jsx(Q,{id:"secret-description",value:u,onChange:f=>d(f.target.value),rows:2,placeholder:r("settings.secrets.descriptionPlaceholder")})]}),s.jsxs(V,{children:[s.jsx(_,{type:"button",variant:"outline",onClick:x,disabled:m.isPending,children:r("settings.secrets.cancelButton")}),s.jsx(_,{type:"submit",disabled:m.isPending||!n.trim()||!o,children:m.isPending?r("settings.secrets.creatingButton"):r("settings.secrets.createButton")})]})]})]})})}function se(){const t=j.c(30),e=y(),r=W(),[i,c]=v.useState(!1);if(r.length===0){let d;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(te,{onCreate:()=>c(!0)}),t[0]=d):d=t[0];let m;return t[1]!==i?(m=s.jsxs(s.Fragment,{children:[d,s.jsx(P,{open:i,onOpenChange:c})]}),t[1]=i,t[2]=m):m=t[2],m}let n,l,o;if(t[3]!==r||t[4]!==e){const d=r.filter(ce),m=r.filter(ie),p=r.length===1?"settings.secrets.secretsCountSingular":"settings.secrets.secretsCountPlural";let x;t[8]!==r.length||t[9]!==e||t[10]!==p?(x=e(p,{count:r.length}),t[8]=r.length,t[9]=e,t[10]=p,t[11]=x):x=t[11];let g;t[12]!==x?(g=s.jsx("p",{className:"text-sm text-muted-foreground",children:x}),t[12]=x,t[13]=g):g=t[13];let f;t[14]===Symbol.for("react.memo_cache_sentinel")?(f=()=>c(!0),t[14]=f):f=t[14];let h;t[15]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(E,{size:14}),t[15]=h):h=t[15];let b;t[16]!==e?(b=e("settings.secrets.newSecret"),t[16]=e,t[17]=b):b=t[17];let S;t[18]!==b?(S=s.jsxs(_,{onClick:f,size:"sm",children:[h,b]}),t[18]=b,t[19]=S):S=t[19],t[20]!==g||t[21]!==S?(n=s.jsxs("div",{className:"flex items-center justify-between",children:[g,S]}),t[20]=g,t[21]=S,t[22]=n):n=t[22],l=d.length>0?s.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:e("settings.secrets.sectionOrganization")}),s.jsx("div",{children:d.map(ne)})]}):null,o=m.length>0?s.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:e("settings.secrets.sectionPrivate")}),s.jsx("div",{children:m.map(re)})]}):null,t[3]=r,t[4]=e,t[5]=n,t[6]=l,t[7]=o}else n=t[5],l=t[6],o=t[7];let a;t[23]!==i?(a=s.jsx(P,{open:i,onOpenChange:c}),t[23]=i,t[24]=a):a=t[24];let u;return t[25]!==n||t[26]!==l||t[27]!==o||t[28]!==a?(u=s.jsxs(s.Fragment,{children:[n,l,o,a]}),t[25]=n,t[26]=l,t[27]=o,t[28]=a,t[29]=u):u=t[29],u}function re(t){return s.jsx(T,{secret:t},t.id)}function ne(t){return s.jsx(T,{secret:t},t.id)}function ie(t){return t.scope==="user"}function ce(t){return t.scope==="organization"}function le(){const t=j.c(7),e=y();let r;t[0]!==e?(r=e("settings.nav.secrets"),t[0]=e,t[1]=r):r=t[1];let i;t[2]!==r?(i=s.jsx(C.Title,{children:r}),t[2]=r,t[3]=i):i=t[3];let c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx($,{fallback:oe,children:s.jsx(v.Suspense,{fallback:s.jsx(M,{className:"h-32 w-full"}),children:s.jsx(se,{})})}),t[4]=c):c=t[4];let n;return t[5]!==i?(n=s.jsx(C,{children:s.jsx(C.Content,{children:s.jsx(C.Body,{children:s.jsxs(U,{children:[i,c]})})})}),t[5]=i,t[6]=n):n=t[6],n}function oe(t){const{error:e}=t;return s.jsx(Z,{error:e??new Error("Failed to load secrets")})}function Re(){const t=j.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Y,{capability:"secrets:manage",area:"secrets",children:s.jsx(le,{})}),t[0]=e):e=t[0],e}export{Re as default};
@@ -1,2 +1,2 @@
1
- import{c as Ue,b as ct,r as w,m as Oe,j as n,ag as Yn,B as Qe,k as Jn,o as Na,t as X,K as Da}from"./index-DlrJLd0f.js";import{a6 as Ta,a7 as Pa,a8 as Aa,a9 as Qn,aa as Xn,ab as Ca,ac as Ma,ad as Ka,N as La,ae as Ba,af as Ct,ag as Fa,S as Zn,ah as lt,ai as Oa,aj as Ia,ak as $a,al as za,D as Ha,F as Ga,am as Ua,an as Wa,ao as qa,ap as Ya,a0 as Gt,aq as Ut,ar as Ja,as as xt,at as Tt,au as Qa,av as Xa,aw as tt,ax as Mn,ay as Za,az as Pt,aA as Wt,aB as eo,aC as dn,aD as to,aE as wt,aF as no,aG as so,aH as ao,aI as oo,aJ as ro,aK as bt,aL as io,aM as lo,aN as co,H as uo,aO as Kn,aP as At,aQ as Ln,aR as Bn,aS as mo,aT as fo,aU as po,aV as go,aW as mn,aX as Fn,aY as On,aZ as Vt,a_ as qt,a$ as In,b0 as ho,b1 as fn,b2 as vo,b3 as So,b4 as xo,b5 as bo,b6 as yo}from"./index-DBad3suF.js";import{t as _o}from"./ChevronDown-8AYAqaQi.js";import{a3 as gn,x as jo,X as es,I as Eo,w as ts,a5 as ko,a6 as Ro}from"./agent-icon-lx2te62e.js";import{i as ns}from"./ChevronRight-QYHUR3CH.js";import{n as wo}from"./ChevronUp-BwstsprL.js";import{i as Vo}from"./Tool02-DTO7eIxx.js";import{l as Yt}from"./automation-runs-D_fCrlsd.js";import{c as yt,T as _t,a as jt}from"./tooltip-CWiu9D12.js";import{b as No,h as Do,a as To,c as Po,d as Ao,e as Co}from"./dialog-YX8qb6L-.js";import{I as Mo}from"./input-VJryuHef.js";import{a as ss}from"./Copy01-A9kEZxuQ.js";import{i as Ko}from"./Settings02-Ir6gkJK_.js";import{s as Lo}from"./Eye-qn4dLRcD.js";import{s as as}from"./TrendUp01-DuBbjBGV.js";import{s as hn}from"./Plus-CVwkfcJG.js";import{s as os}from"./Trash01-DD5HHtWd.js";import{i as Bo}from"./Zap-DcrVqprp.js";import{a as ht,D as rs,b as is,c as ls,i as Fo}from"./dropdown-menu-Bkcoj5OX.js";import{o as cs,p as Jt,K as us,P as ds,q as ms,z as fs,C as ps,A as gs,B as Mt,D as hs,v as vs,x as Ss,y as xs}from"./index-ykB4MWb0.js";import{S as Oo,r as $n,u as Io,d as $o,a as zo,i as Ho,f as Go,P as Uo,b as Wo}from"./page-seo-form-tenmD-hO.js";import{c as qo}from"./Tool01-DawTZk8U.js";import{A as Yo}from"./add-section-modal-ibpGe4PR.js";import"./ArrowUp-CzhpipYZ.js";import"./chat-context-C_I5C_yI.js";import"./tab-id-B7eCve3T.js";import"./Check-DYjHBTZg.js";import"./hooks-DU9dCzN0.js";import"./use-mcp-client-BAuyfS_2.js";import"./auth-BruFhg3Y.js";import"./decopilot-sse-pool-B9lG-dGt.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-qrJo3ksT.js";import"./use-ai-providers-1BerwWe9.js";import"./studio-tools-z4_ic7wa.js";import"./use-decopilot-events-B0cZBVhM.js";import"./use-organization-settings-D9AwPaOJ.js";import"./spinner-DfDYGVyJ.js";import"./drawer-C00v8TOn.js";import"./collection-search-CGU42tyL.js";import"./SearchMd-CpktppFq.js";import"./use-mobile-DrOZ2zHv.js";import"./AreaChart-B8PkN6Dj.js";import"./index-OaR__zjm.js";import"./calendar-QMKOnD6V.js";import"./X-D9krIRRY.js";import"./shell-layout-DyRibQbN.js";import"./avatar-CfSwvvrb.js";import"./User01-glsH12c1.js";import"./Users03-DM8sZyNC.js";import"./SearchLg-kMCs2Qn5.js";import"./Stars02-BbLZtJKs.js";import"./XClose-Yi3nldNz.js";import"./CheckCircle-Dq2wz_K8.js";import"./CpuChip01-KERcsFI3.js";import"./FilterLines-DVyKrdrK.js";import"./Monitor01-wqgbPiRT.js";import"./required-auth-layout-DolQOWSu.js";import"./use-org-sso-Sn4tasoh.js";import"./ZapSquare-iXkjHm19.js";import"./Star01-BQ_VQCxe.js";import"./Upload01-B6UyPufY.js";import"./AlertCircle-DgoHSCa6.js";import"./form-DCVw4Qxk.js";import"./label-C3jo-Tkg.js";import"./select-D8tnZPAO.js";import"./XCircle-id_cPfaD.js";import"./tabs-CWF4Eazm.js";import"./toggle-group-Brqv9lqE.js";import"./use-deco-credits-Bbp8cHH-.js";import"./sidebar-B7lAtJq4.js";import"./LayoutLeft-DM2MbZ1w.js";import"./popover-CZ2c-1a4.js";import"./alert-dialog-DVbIa1Of.js";import"./toolbar-DmYuggMs.js";import"./skeleton-CZe0GgC0.js";import"./github-repo-picker-DryZ8V-D.js";import"./use-debounced-value-Bq1aop1P.js";import"./use-connection-BbtNdpLj.js";import"./authenticate-and-persist-oauth-hVU4ZCxE.js";import"./mcp-oauth-C595Hc6X.js";import"./LinkExternal01-CQtDG0da.js";import"./use-mcp-tools-C9Je3U4Y.js";import"./extract-connection-data-B3m276aR.js";import"./metadata-dUsYcpuu.js";import"./use-navigate-to-agent-BE4Poi7y.js";import"./reusable-new-chat-CouMjkYR.js";import"./provision-repo-scoped-github-connection-B2s3ApVy.js";import"./agent-capabilities-cXfbMfjV.js";import"./connection-card-Cpkf46mx.js";import"./use-registry-connections-1P_9goJ5.js";import"./useInfiniteQuery-BWmod5eH.js";import"./use-infinite-scroll-GJ1kJ9VT.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./card-CodfA5B5.js";import"./integration-icon-L27I9d5j.js";import"./textarea-BDQ2l--t.js";import"./connection-form-helpers-DRro6P0Z.js";import"./collection-tabs-Cux53FF-.js";import"./badge-B7J-knlJ.js";import"./useSuspenseInfiniteQuery-DZgOlcJm.js";import"./select-model-yU1XE-Tf.js";import"./checkbox-v7KzBOL5.js";import"./Key01-BMqEHWvZ.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-BQSpoRM4.js";import"./ArrowUpRight-HJ-SySJk.js";import"./Stars01-CvfdsbYh.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-AG_d2u2d.js";import"./empty-state-JLEZ7LAr.js";import"./deco-site-production-url-CaKZ7xBn.js";import"./use-capability-Bk3J-Iqx.js";import"./monaco-editor-Mc_4JQvY.js";import"./pt-BR-CLy76QW2.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-mcp-auth-status-DWNLpQfA.js";import"./DotsVertical-DMnvaRK-.js";import"./Play-DRYC-38J.js";import"./use-debounced-autosave-C3NHFFOq.js";import"./index-BAHKl3Dr.js";import"./search-input-Css9C8e3.js";import"./switch-DEGt7tYf.js";import"./Users01-BSccQxC5.js";import"./use-secrets-CP_mnoUN.js";import"./format-time-BnbuEtat.js";import"./use-members-BxRg2DIY.js";import"./use-org-auth-client-vrRyh83k.js";import"./command-BTSPIJyO.js";import"./index-BQJXZZDV.js";import"./useQueries-VD06sM7p.js";import"./SwitchHorizontal01-SNcdh7XR.js";import"./Palette-Bph1p9n-.js";import"./use-file-configs-BFFJjpME.js";import"./use-automations-CU8_svlb.js";import"./automation-list-row-Bi03cpv8.js";import"./get-initials-D-f_fDFw.js";import"./HardDrive-CDhmT8Mp.js";import"./LogOut01-CPJNWfrn.js";import"./Sun-DfgVj2gg.js";import"./Shield01-gsGgj4XE.js";import"./table-Cv4PaakJ.js";import"./use-clock-tick-CTvrsrV0.js";import"./use-copy-BsJIVo90.js";import"./use-tags-D3lxkScm.js";import"./companions-core-C1ALkr4t.js";function Jo(h){return h.schema?.definitions??h.schema?.$defs??{}}function Qo(h,e){const o=Jo(e),d=o[btoa(h)];if(!d)return;let m=typeof d.image=="string"?d.image:void 0;if(!m&&Array.isArray(d.allOf)){const x=d.allOf.find(b=>typeof b.$ref=="string")?.$ref;if(typeof x=="string"){const b=x.replace("#/definitions/",""),f=o[b];m=typeof f?.image=="string"?f.image:void 0}}if(m?.includes("{{{"))return m}function Xo(h,e){if(!e)return;const o=Ta(h);if(!o)return;const d=Qo(o.resolveType,e);if(!d)return;const m=Pa(d,o.data);if(m)return Aa(m)}const Zo="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",er="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 zn(h){return Array.from({length:h},(e,o)=>({id:crypto.randomUUID(),index:o}))}function bs(h){return h.map((e,o)=>({...e,index:o}))}function tr(h,e){if(e===h.length)return h;if(e<h.length)return bs(h.slice(0,e));const o=Array.from({length:e-h.length},(d,m)=>({id:crypto.randomUUID(),index:h.length+m}));return[...h,...o]}function ys(h){const e=Ue.c(20),{section:o,raw:d,meta:m}=h,x=o.isSavedBlock===!0,b=o.isMultivariate===!0;let f;e[0]!==m||e[1]!==d?(f=d&&m?Xo(d,m):void 0,e[0]=m,e[1]=d,e[2]=f):f=e[2];const v=f;let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(jo,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[3]=u):u=e[3];let y;e[4]!==v?(y=v&&n.jsx("img",{src:v,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[4]=v,e[5]=y):y=e[5];let k;e[6]!==b||e[7]!==x?(k=x?{color:La}:b?{color:"oklch(0.65 0.15 160)"}:void 0,e[6]=b,e[7]=x,e[8]=k):k=e[8];let D;e[9]!==k?(D=n.jsx(gn,{className:"h-4 w-4 shrink-0",style:k}),e[9]=k,e[10]=D):D=e[10];const E=o.isHidden&&"line-through opacity-50";let i;e[11]!==E?(i=Oe("min-w-0 flex-1 truncate text-sm font-medium",E),e[11]=E,e[12]=i):i=e[12];let g;e[13]!==o.label||e[14]!==i?(g=n.jsx("span",{className:i,children:o.label}),e[13]=o.label,e[14]=i,e[15]=g):g=e[15];let r;return e[16]!==y||e[17]!==D||e[18]!==g?(r=n.jsxs(n.Fragment,{children:[u,y,D,g]}),e[16]=y,e[17]=D,e[18]=g,e[19]=r):r=e[19],r}function _s(h,e){const o=h.isSavedBlock===!0,d=h.isMultivariate===!0;return Oe("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":o?Zo:d?"text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]":"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function nr(h){const e=Ue.c(81),{section:o,raw:d,meta:m,sortableId:x,selected:b,onSelect:f,onDelete:v,onDuplicate:u,onMakeReusable:y,onToggleHidden:k,onToggleLazy:D,onAddVariant:E,onDetach:i}=h,g=ct(),r=d?Xn(d.__resolveType??""):!1;let A;e[0]!==o?(A=Ca(o),e[0]=o,e[1]=A):A=e[1];const l=A;let R;e[2]!==x?(R={id:x,animateLayoutChanges:ir},e[2]=x,e[3]=R):R=e[3];const{attributes:K,listeners:z,setNodeRef:p,transform:N,isDragging:ie}=fs(R);let L;e[4]!==N?(L=ps.Transform.toString(N?{...N,x:0}:null),e[4]=N,e[5]=L):L=e[5];const ce=ie?0:void 0;let M;e[6]!==L||e[7]!==ce?(M={transform:L,opacity:ce},e[6]=L,e[7]=ce,e[8]=M):M=e[8];const ge=M;let O;e[9]!==o?(O=Ma(o),e[9]=o,e[10]=O):O=e[10];const ne=O,he="button",me=0;let I;e[11]!==f?(I=T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),f())},e[11]=f,e[12]=I):I=e[12];const J=ie?"cursor-grabbing":"cursor-pointer";let Z;e[13]!==o||e[14]!==b||e[15]!==J?(Z=Oe("touch-none transition-colors",J,_s(o,b)),e[13]=o,e[14]=b,e[15]=J,e[16]=Z):Z=e[16];let ee;e[17]!==m||e[18]!==d||e[19]!==o?(ee=n.jsx(ys,{section:o,raw:d,meta:m}),e[17]=m,e[18]=d,e[19]=o,e[20]=ee):ee=e[20];const $=!o.isMultivariate&&n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":g(r?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:Oe("h-7 w-7 shrink-0",r?"":"opacity-0 group-hover:opacity-100"),onClick:T=>{T.stopPropagation(),D()},onPointerDown:rr,children:n.jsx(Bo,{className:Oe("h-3.5 w-3.5",r&&"text-yellow-500")})})}),n.jsx(jt,{side:"bottom",children:g(r?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]});let Ae;e[21]!==k||e[22]!==o.isHidden||e[23]!==o.isMultivariate||e[24]!==g?(Ae=!o.isMultivariate&&n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":o.isHidden?g("sectionsEditor.sectionList.showSection"):g("sectionsEditor.sectionList.hideSection"),className:Oe("h-7 w-7 shrink-0",o.isHidden?"opacity-100":"opacity-0 group-hover:opacity-100"),onClick:T=>{T.stopPropagation(),k()},onPointerDown:or,children:o.isHidden?n.jsx(Ko,{className:"h-3.5 w-3.5"}):n.jsx(Lo,{className:"h-3.5 w-3.5"})})}),n.jsx(jt,{side:"bottom",children:o.isHidden?g("sectionsEditor.sectionList.showSection"):g("sectionsEditor.sectionList.hideSection")})]}),e[21]=k,e[22]=o.isHidden,e[23]=o.isMultivariate,e[24]=g,e[25]=Ae):Ae=e[25];let Me;e[26]!==g?(Me=g("sectionsEditor.sectionList.sectionActionsMenu"),e[26]=g,e[27]=Me):Me=e[27];let et;e[28]===Symbol.for("react.memo_cache_sentinel")?(et=n.jsx(es,{className:"h-3.5 w-3.5"}),e[28]=et):et=e[28];let Se;e[29]!==Me?(Se=n.jsx(rs,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":Me,className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100",onClick:ar,onPointerDown:sr,children:et})}),e[29]=Me,e[30]=Se):Se=e[30];let H;e[31]!==u?(H=T=>{T.stopPropagation(),u()},e[31]=u,e[32]=H):H=e[32];let se;e[33]===Symbol.for("react.memo_cache_sentinel")?(se=n.jsx(ss,{className:"h-4 w-4"}),e[33]=se):se=e[33];let ae;e[34]!==g?(ae=g("sectionsEditor.sectionList.duplicateMenuItem"),e[34]=g,e[35]=ae):ae=e[35];let ue;e[36]!==H||e[37]!==ae?(ue=n.jsxs(ht,{onClick:H,children:[se,ae]}),e[36]=H,e[37]=ae,e[38]=ue):ue=e[38];let oe;e[39]!==l||e[40]!==E||e[41]!==g?(oe=l&&n.jsxs(ht,{className:Ka,onClick:T=>{T.stopPropagation(),E()},children:[n.jsx(as,{className:"h-4 w-4"}),g("sectionsEditor.sectionList.addVariantMenuItem")]}),e[39]=l,e[40]=E,e[41]=g,e[42]=oe):oe=e[42];let de;e[43]!==ne||e[44]!==y||e[45]!==g?(de=ne&&n.jsxs(ht,{className:er,onClick:T=>{T.stopPropagation(),y()},children:[n.jsx(gn,{className:"h-4 w-4"}),g("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[43]=ne,e[44]=y,e[45]=g,e[46]=de):de=e[46];let le;e[47]!==i||e[48]!==o.isMultivariate||e[49]!==o.isSavedBlock||e[50]!==g?(le=o.isSavedBlock===!0&&!o.isMultivariate&&n.jsxs(ht,{onClick:T=>{T.stopPropagation(),i()},children:[n.jsx(gn,{className:"h-4 w-4"}),g("sectionsEditor.sectionList.detachMenuItem")]}),e[47]=i,e[48]=o.isMultivariate,e[49]=o.isSavedBlock,e[50]=g,e[51]=le):le=e[51];let fe;e[52]!==v?(fe=T=>{T.stopPropagation(),v()},e[52]=v,e[53]=fe):fe=e[53];let De;e[54]===Symbol.for("react.memo_cache_sentinel")?(De=n.jsx(os,{className:"h-4 w-4"}),e[54]=De):De=e[54];let je;e[55]!==g?(je=g("sectionsEditor.sectionList.deleteMenuItem"),e[55]=g,e[56]=je):je=e[56];let re;e[57]!==fe||e[58]!==je?(re=n.jsxs(ht,{className:"text-destructive focus:text-destructive",onClick:fe,children:[De,je]}),e[57]=fe,e[58]=je,e[59]=re):re=e[59];let pe;e[60]!==ue||e[61]!==oe||e[62]!==de||e[63]!==le||e[64]!==re?(pe=n.jsxs(is,{align:"end",className:"w-44",children:[ue,oe,de,le,re]}),e[60]=ue,e[61]=oe,e[62]=de,e[63]=le,e[64]=re,e[65]=pe):pe=e[65];let xe;e[66]!==Se||e[67]!==pe?(xe=n.jsxs(ls,{children:[Se,pe]}),e[66]=Se,e[67]=pe,e[68]=xe):xe=e[68];let be;return e[69]!==K||e[70]!==z||e[71]!==f||e[72]!==p||e[73]!==ge||e[74]!==Z||e[75]!==ee||e[76]!==$||e[77]!==Ae||e[78]!==xe||e[79]!==I?(be=n.jsxs("div",{ref:p,style:ge,...K,...z,role:he,tabIndex:me,onClick:f,onKeyDown:I,className:Z,children:[ee,$,Ae,xe]}),e[69]=K,e[70]=z,e[71]=f,e[72]=p,e[73]=ge,e[74]=Z,e[75]=ee,e[76]=$,e[77]=Ae,e[78]=xe,e[79]=I,e[80]=be):be=e[80],be}function sr(h){return h.stopPropagation()}function ar(h){return h.stopPropagation()}function or(h){return h.stopPropagation()}function rr(h){return h.stopPropagation()}function ir(){return!1}function lr(h){const e=Ue.c(104),{listKey:o,rawSections:d,sections:m,meta:x,selectedIndex:b,onSelect:f,onReorder:v,onDelete:u,onDuplicate:y,onMakeReusable:k,onToggleHidden:D,onToggleLazy:E,onAddVariant:i,onDetach:g,onAddSection:r,canAddSection:A}=h,l=A===void 0?!0:A,R=ct();let K;e[0]!==m.length?(K=()=>zn(m.length),e[0]=m.length,e[1]=K):K=e[1];const[z,p]=w.useState(K),[N,ie]=w.useState(null),[L,ce]=w.useState(o),[M,ge]=w.useState(m.length),O=w.useRef(!1);L!==o?(ce(o),ge(m.length),p(zn(m.length))):M!==m.length&&(ge(m.length),p(ze=>tr(ze,m.length)));let ne;e[2]===Symbol.for("react.memo_cache_sentinel")?(ne={activationConstraint:{distance:8}},e[2]=ne):ne=e[2];let he;e[3]===Symbol.for("react.memo_cache_sentinel")?(he={coordinateGetter:gs},e[3]=he):he=e[3];const me=cs(Jt(ds,ne),Jt(us,he));let I;e[4]!==z?(I=z.map(cr),e[4]=z,e[5]=I):I=e[5];const J=I;let Z;e[6]===Symbol.for("react.memo_cache_sentinel")?(Z=ze=>{ie(String(ze.active.id))},e[6]=Z):Z=e[6];const ee=Z;let $;e[7]!==J||e[8]!==v?($=ze=>{ie(null);const{active:B,over:F}=ze;if(!F||B.id===F.id)return;const G=J.indexOf(String(B.id)),nt=J.indexOf(String(F.id));G===-1||nt===-1||(p(Re=>bs(Mt([...Re],G,nt))),O.current=!0,requestAnimationFrame(()=>{O.current=!1}),v?.(G,nt))},e[7]=J,e[8]=v,e[9]=$):$=e[9];const Ae=$;let Me;e[10]===Symbol.for("react.memo_cache_sentinel")?(Me=()=>{ie(null)},e[10]=Me):Me=e[10];const et=Me;let Se,H,se,ae,ue,oe,de,le,fe,De,je,re,pe,xe,be;if(e[11]!==N||e[12]!==l||e[13]!==z||e[14]!==J||e[15]!==Ae||e[16]!==x||e[17]!==r||e[18]!==i||e[19]!==u||e[20]!==g||e[21]!==y||e[22]!==k||e[23]!==f||e[24]!==D||e[25]!==E||e[26]!==d||e[27]!==m||e[28]!==b||e[29]!==me||e[30]!==R){xe=Symbol.for("react.early_return_sentinel");e:{const ze=B=>{O.current||f(B)};if(e[46]!==N||e[47]!==l||e[48]!==z||e[49]!==r||e[50]!==d||e[51]!==m||e[52]!==R){const B=N?z.find(F=>F.id===N):null;if(ae=B!=null?m[B.index]:null,se=B!=null?d[B.index]:void 0,z.length===0){let F;e[56]!==R?(F=R("sectionsEditor.sectionList.noSections"),e[56]=R,e[57]=F):F=e[57];let G;e[58]!==F?(G=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:F}),e[58]=F,e[59]=G):G=e[59];const nt=!l;let Re;e[60]===Symbol.for("react.memo_cache_sentinel")?(Re=n.jsx(hn,{size:14}),e[60]=Re):Re=e[60];let We;e[61]!==R?(We=R("sectionsEditor.sectionList.addSectionButton"),e[61]=R,e[62]=We):We=e[62];let Ne;e[63]!==r||e[64]!==nt||e[65]!==We?(Ne=n.jsxs(Qe,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:nt,onClick:r,children:[Re,We]}),e[63]=r,e[64]=nt,e[65]=We,e[66]=Ne):Ne=e[66];let vt;e[67]!==G||e[68]!==Ne?(vt=n.jsxs("div",{className:"space-y-2",children:[G,Ne]}),e[67]=G,e[68]=Ne,e[69]=vt):vt=e[69],xe=vt;break e}pe=Oe(B&&"cursor-grabbing"),e[46]=N,e[47]=l,e[48]=z,e[49]=r,e[50]=d,e[51]=m,e[52]=R,e[53]=se,e[54]=ae,e[55]=pe}else se=e[53],ae=e[54],pe=e[55];H=hs,le=me,fe=vs,De=ee,je=Ae,re=et,Se=Ss,oe=J,de=xs,be="space-y-1",ue=z.map(B=>{const F=m[B.index];return F?n.jsx(nr,{sortableId:B.id,section:F,raw:d[B.index],meta:x,selected:b===B.index,onSelect:()=>ze(B.index),onDelete:()=>u(B.index),onDuplicate:()=>y(B.index),onMakeReusable:()=>k(B.index),onToggleHidden:()=>D(B.index),onToggleLazy:()=>E(B.index),onAddVariant:()=>i(B.index),onDetach:()=>g(B.index)},B.id):null})}e[11]=N,e[12]=l,e[13]=z,e[14]=J,e[15]=Ae,e[16]=x,e[17]=r,e[18]=i,e[19]=u,e[20]=g,e[21]=y,e[22]=k,e[23]=f,e[24]=D,e[25]=E,e[26]=d,e[27]=m,e[28]=b,e[29]=me,e[30]=R,e[31]=Se,e[32]=H,e[33]=se,e[34]=ae,e[35]=ue,e[36]=oe,e[37]=de,e[38]=le,e[39]=fe,e[40]=De,e[41]=je,e[42]=re,e[43]=pe,e[44]=xe,e[45]=be}else Se=e[31],H=e[32],se=e[33],ae=e[34],ue=e[35],oe=e[36],de=e[37],le=e[38],fe=e[39],De=e[40],je=e[41],re=e[42],pe=e[43],xe=e[44],be=e[45];if(xe!==Symbol.for("react.early_return_sentinel"))return xe;let T;e[70]!==ue||e[71]!==be?(T=n.jsx("div",{className:be,children:ue}),e[70]=ue,e[71]=be,e[72]=T):T=e[72];let Ke;e[73]!==Se||e[74]!==oe||e[75]!==de||e[76]!==T?(Ke=n.jsx(Se,{items:oe,strategy:de,children:T}),e[73]=Se,e[74]=oe,e[75]=de,e[76]=T,e[77]=Ke):Ke=e[77];let Ie;e[78]!==se||e[79]!==ae||e[80]!==x?(Ie=ae?n.jsx("div",{className:Oe("cursor-grabbing shadow-lg ring-1 ring-border/60",_s(ae,!1)),children:n.jsx(ys,{section:ae,raw:se,meta:x})}):null,e[78]=se,e[79]=ae,e[80]=x,e[81]=Ie):Ie=e[81];let Ge;e[82]!==Ie?(Ge=Yn.createPortal(n.jsx(ms,{dropAnimation:Qn,children:Ie}),document.body),e[82]=Ie,e[83]=Ge):Ge=e[83];let $e;e[84]!==H||e[85]!==le||e[86]!==fe||e[87]!==De||e[88]!==je||e[89]!==re||e[90]!==Ke||e[91]!==Ge?($e=n.jsxs(H,{sensors:le,collisionDetection:fe,onDragStart:De,onDragEnd:je,onDragCancel:re,children:[Ke,Ge]}),e[84]=H,e[85]=le,e[86]=fe,e[87]=De,e[88]=je,e[89]=re,e[90]=Ke,e[91]=Ge,e[92]=$e):$e=e[92];const Ee=!l;let ye;e[93]===Symbol.for("react.memo_cache_sentinel")?(ye=n.jsx(hn,{size:14}),e[93]=ye):ye=e[93];let ke;e[94]!==R?(ke=R("sectionsEditor.sectionList.addSectionButton"),e[94]=R,e[95]=ke):ke=e[95];let Le;e[96]!==r||e[97]!==Ee||e[98]!==ke?(Le=n.jsxs(Qe,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:Ee,onClick:r,children:[ye,ke]}),e[96]=r,e[97]=Ee,e[98]=ke,e[99]=Le):Le=e[99];let Te;return e[100]!==pe||e[101]!==$e||e[102]!==Le?(Te=n.jsxs("div",{className:pe,children:[$e,Le]}),e[100]=pe,e[101]=$e,e[102]=Le,e[103]=Te):Te=e[103],Te}function cr(h){return h.id}function Hn(h){const e=Ue.c(57),{open:o,initialName:d,autoLabel:m,isPending:x,onSubmit:b,onOpenChange:f}=h,v=x===void 0?!1:x,u=ct(),[y,k]=w.useState(d),[D,E]=w.useState(o);o!==D&&(E(o),o&&k(d));let i;e[0]!==v||e[1]!==f?(i=ee=>{!ee&&!v&&f(!1)},e[0]=v,e[1]=f,e[2]=i):i=e[2];const g=i;let r;e[3]!==v||e[4]!==y||e[5]!==b?(r=async ee=>{ee.preventDefault(),!v&&await b(y.trim())},e[3]=v,e[4]=y,e[5]=b,e[6]=r):r=e[6];const A=r;let l;e[7]!==u?(l=u("sectionsEditor.variantRenameDialog.title"),e[7]=u,e[8]=l):l=e[8];let R;e[9]!==l?(R=n.jsx(No,{children:l}),e[9]=l,e[10]=R):R=e[10];let K;e[11]!==m||e[12]!==u?(K=u("sectionsEditor.variantRenameDialog.description",{fallback:m||u("sectionsEditor.variantRenameDialog.defaultFallback")}),e[11]=m,e[12]=u,e[13]=K):K=e[13];let z;e[14]!==K?(z=n.jsx(Do,{children:K}),e[14]=K,e[15]=z):z=e[15];let p;e[16]!==R||e[17]!==z?(p=n.jsxs(To,{children:[R,z]}),e[16]=R,e[17]=z,e[18]=p):p=e[18];let N;e[19]!==u?(N=u("sectionsEditor.variantRenameDialog.nameLabel"),e[19]=u,e[20]=N):N=e[20];let ie;e[21]!==N?(ie=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:N}),e[21]=N,e[22]=ie):ie=e[22];let L;e[23]===Symbol.for("react.memo_cache_sentinel")?(L=ee=>k(ee.target.value),e[23]=L):L=e[23];let ce;e[24]!==m||e[25]!==v||e[26]!==y?(ce=n.jsx(Mo,{id:"variant-rename-name",value:y,onChange:L,placeholder:m,autoFocus:!0,disabled:v}),e[24]=m,e[25]=v,e[26]=y,e[27]=ce):ce=e[27];let M;e[28]!==ie||e[29]!==ce?(M=n.jsxs("div",{className:"space-y-1.5 py-4",children:[ie,ce]}),e[28]=ie,e[29]=ce,e[30]=M):M=e[30];let ge;e[31]!==f?(ge=()=>f(!1),e[31]=f,e[32]=ge):ge=e[32];let O;e[33]!==u?(O=u("sectionsEditor.variantRenameDialog.cancel"),e[33]=u,e[34]=O):O=e[34];let ne;e[35]!==v||e[36]!==ge||e[37]!==O?(ne=n.jsx(Qe,{type:"button",variant:"outline",onClick:ge,disabled:v,children:O}),e[35]=v,e[36]=ge,e[37]=O,e[38]=ne):ne=e[38];let he;e[39]!==v||e[40]!==u?(he=v?n.jsxs(n.Fragment,{children:[n.jsx(Jn,{size:14,className:"animate-spin"}),u("sectionsEditor.variantRenameDialog.saving")]}):u("sectionsEditor.variantRenameDialog.save"),e[39]=v,e[40]=u,e[41]=he):he=e[41];let me;e[42]!==v||e[43]!==he?(me=n.jsx(Qe,{type:"submit",disabled:v,children:he}),e[42]=v,e[43]=he,e[44]=me):me=e[44];let I;e[45]!==ne||e[46]!==me?(I=n.jsxs(Po,{children:[ne,me]}),e[45]=ne,e[46]=me,e[47]=I):I=e[47];let J;e[48]!==A||e[49]!==M||e[50]!==I||e[51]!==p?(J=n.jsx(Ao,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:A,children:[p,M,I]})}),e[48]=A,e[49]=M,e[50]=I,e[51]=p,e[52]=J):J=e[52];let Z;return e[53]!==g||e[54]!==o||e[55]!==J?(Z=n.jsx(Co,{open:o,onOpenChange:g,children:J}),e[53]=g,e[54]=o,e[55]=J,e[56]=Z):Z=e[56],Z}const ur="text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]",js="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.2)]";function Es(h){const e=Ue.c(5),{rule:o,matchers:d}=h,m=o?.__resolveType??"";let x;if(e[0]!==d||e[1]!==m){const u=d.find(y=>y.resolveType===m)?.iconName??Ba(m);x=Eo(u),e[0]=d,e[1]=m,e[2]=x}else x=e[2];const b=x;if(!b)return null;let f;return e[3]!==b?(f=n.jsx(b,{size:14,className:"shrink-0"}),e[3]=b,e[4]=f):f=e[4],f}function Gn(h){return h.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
1
+ import{c as Ue,b as ct,r as w,m as Oe,j as n,ag as Yn,B as Qe,k as Jn,o as Na,t as X,K as Da}from"./index-CpP-S0pD.js";import{a6 as Ta,a7 as Pa,a8 as Aa,a9 as Qn,aa as Xn,ab as Ca,ac as Ma,ad as Ka,N as La,ae as Ba,af as Ct,ag as Fa,S as Zn,ah as lt,ai as Oa,aj as Ia,ak as $a,al as za,D as Ha,F as Ga,am as Ua,an as Wa,ao as qa,ap as Ya,a0 as Gt,aq as Ut,ar as Ja,as as xt,at as Tt,au as Qa,av as Xa,aw as tt,ax as Mn,ay as Za,az as Pt,aA as Wt,aB as eo,aC as dn,aD as to,aE as wt,aF as no,aG as so,aH as ao,aI as oo,aJ as ro,aK as bt,aL as io,aM as lo,aN as co,H as uo,aO as Kn,aP as At,aQ as Ln,aR as Bn,aS as mo,aT as fo,aU as po,aV as go,aW as mn,aX as Fn,aY as On,aZ as Vt,a_ as qt,a$ as In,b0 as ho,b1 as fn,b2 as vo,b3 as So,b4 as xo,b5 as bo,b6 as yo}from"./index-BnfkTbju.js";import{t as _o}from"./ChevronDown-DMeq6c1L.js";import{a3 as gn,x as jo,X as es,I as Eo,w as ts,a5 as ko,a6 as Ro}from"./agent-icon-Cak8CGJ6.js";import{i as ns}from"./ChevronRight-QXvwYeKn.js";import{n as wo}from"./ChevronUp-M4yeuEfW.js";import{i as Vo}from"./Tool02-cVrXNcsQ.js";import{l as Yt}from"./automation-runs-ZhchwZLV.js";import{c as yt,T as _t,a as jt}from"./tooltip-CuJ91_oS.js";import{b as No,h as Do,a as To,c as Po,d as Ao,e as Co}from"./dialog-wdHWjrNV.js";import{I as Mo}from"./input-s4-qH7Fl.js";import{a as ss}from"./Copy01-gnezadve.js";import{i as Ko}from"./Settings02-DKxTap5H.js";import{s as Lo}from"./Eye-yZLJUkOu.js";import{s as as}from"./TrendUp01-D9erp13t.js";import{s as hn}from"./Plus-Ca3Ml2LK.js";import{s as os}from"./Trash01-BwfIUnai.js";import{i as Bo}from"./Zap-1crUVhxr.js";import{a as ht,D as rs,b as is,c as ls,i as Fo}from"./dropdown-menu-CEEIyhym.js";import{o as cs,p as Jt,K as us,P as ds,q as ms,z as fs,C as ps,A as gs,B as Mt,D as hs,v as vs,x as Ss,y as xs}from"./index-D7nON68r.js";import{S as Oo,r as $n,u as Io,d as $o,a as zo,i as Ho,f as Go,P as Uo,b as Wo}from"./page-seo-form-B-W5X_KN.js";import{c as qo}from"./Tool01-FK_KEBNP.js";import{A as Yo}from"./add-section-modal-CfYXjzlL.js";import"./ArrowUp-hHV8dnEu.js";import"./chat-context-DisMiPOv.js";import"./tab-id-v1C0oZfW.js";import"./Check-B5Ocw477.js";import"./hooks-CvSAZ6QQ.js";import"./use-mcp-client-5QWj1A9a.js";import"./auth-DZ7Xcgje.js";import"./decopilot-sse-pool-UOrNfMxw.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-Y2b8gepU.js";import"./use-ai-providers-DRHgvouV.js";import"./studio-tools-C42EgVLm.js";import"./use-decopilot-events-DfaI-_w-.js";import"./use-organization-settings-CL4gJKEp.js";import"./spinner-DJUgX0rr.js";import"./drawer-CwgbaEOp.js";import"./collection-search-C4-orWMV.js";import"./SearchMd-BGnU940I.js";import"./use-mobile-C91dq5AF.js";import"./AreaChart-BGrw5ye5.js";import"./index-b_LxwSc-.js";import"./calendar-CTpilDEA.js";import"./X-CvDwW-rN.js";import"./shell-layout-fjbcJd19.js";import"./avatar-Dacp4X8p.js";import"./User01-Bp6SHWEy.js";import"./Users03-BixdONRb.js";import"./SearchLg-CIblHBBZ.js";import"./Stars02-CkbAbEdB.js";import"./XClose-1xNk-tzp.js";import"./CheckCircle-CeRr0f9K.js";import"./CpuChip01-PDCt51S6.js";import"./FilterLines-DuWH9nQz.js";import"./Monitor01-BTZzveUz.js";import"./required-auth-layout-Dv1xp3gR.js";import"./use-org-sso-DqJAhHZh.js";import"./ZapSquare-DHQmvZPE.js";import"./Star01-DnEuAXNt.js";import"./Upload01-DW_Am5qr.js";import"./AlertCircle-BKkj59p3.js";import"./form-DHh4Wlvu.js";import"./label-lanDCOta.js";import"./select-D-d6Z69w.js";import"./XCircle-BPu7noSN.js";import"./tabs-139FL1FK.js";import"./toggle-group-BOONA6-L.js";import"./use-deco-credits-CDZ4bsnT.js";import"./sidebar-D3JiZvSx.js";import"./LayoutLeft-C94F55Om.js";import"./popover-Ck_o5Wrt.js";import"./alert-dialog-CpxCqEN2.js";import"./toolbar-oR4EYzLA.js";import"./skeleton-Db9HI085.js";import"./github-repo-picker-DRR2XHTS.js";import"./use-debounced-value-DFnm0L6O.js";import"./use-connection-D2lVo9DS.js";import"./authenticate-and-persist-oauth-YZT_XlW1.js";import"./mcp-oauth-DetPJykg.js";import"./LinkExternal01-Bl6piLeN.js";import"./use-mcp-tools-CtGwHiDi.js";import"./extract-connection-data-DZa8sbW7.js";import"./metadata-dUsYcpuu.js";import"./use-navigate-to-agent-3dJ7hC4y.js";import"./reusable-new-chat-CouMjkYR.js";import"./provision-repo-scoped-github-connection-B2s3ApVy.js";import"./agent-capabilities-cXfbMfjV.js";import"./connection-card-DEny4wOG.js";import"./use-registry-connections-LefDE-qL.js";import"./useInfiniteQuery-4VbceBrT.js";import"./use-infinite-scroll-BjiX8vQy.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./card-C2iwtGFp.js";import"./integration-icon-BfDOy0DB.js";import"./textarea-BKf1b5oV.js";import"./connection-form-helpers-BbkQ3A6Z.js";import"./collection-tabs-BepyiKtU.js";import"./badge-DznEWlmt.js";import"./useSuspenseInfiniteQuery-q_0__sea.js";import"./select-model-rj_wk5pD.js";import"./checkbox-BkO5OHp1.js";import"./Key01-8eNxtAQv.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-DCHGjEDu.js";import"./ArrowUpRight-DqAI4rqY.js";import"./Stars01-C4oq2iC_.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-9EpRxeoc.js";import"./empty-state-1VHlo19P.js";import"./deco-site-production-url-CaKZ7xBn.js";import"./use-capability-BEep6Ha8.js";import"./monaco-editor-CRtsEJ1X.js";import"./pt-BR-CLy76QW2.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-mcp-auth-status-DjbCSJ4O.js";import"./DotsVertical-DwjRcP6A.js";import"./Play-BNZnx80U.js";import"./use-debounced-autosave-DBFnUAWb.js";import"./index-CQclcDZz.js";import"./search-input-GeOkxlFZ.js";import"./switch-Cy6lJIfU.js";import"./Users01-C1IDGxoN.js";import"./use-secrets-DrUz6g7Q.js";import"./format-time-BnbuEtat.js";import"./use-members-jDNCRLL4.js";import"./use-org-auth-client-DzbAlSpQ.js";import"./command-SbfUVBMB.js";import"./index-D4y380hc.js";import"./useQueries-CIVj8X41.js";import"./SwitchHorizontal01-CG6QKK8a.js";import"./Palette-IM50iZxU.js";import"./use-file-configs-BXcCgoFl.js";import"./use-automations-BApaKvd-.js";import"./automation-list-row-CY5mbjoe.js";import"./get-initials-D-f_fDFw.js";import"./HardDrive-C8l1Zp6S.js";import"./LogOut01-DhQaTA2c.js";import"./Sun-CsQDuyx5.js";import"./Shield01-b72Anl0J.js";import"./table-CsSOvNee.js";import"./use-clock-tick-39-diZIc.js";import"./use-copy-BmP-JZoX.js";import"./use-tags-BFLq_4kR.js";import"./companions-core-PLS5yeYw.js";function Jo(h){return h.schema?.definitions??h.schema?.$defs??{}}function Qo(h,e){const o=Jo(e),d=o[btoa(h)];if(!d)return;let m=typeof d.image=="string"?d.image:void 0;if(!m&&Array.isArray(d.allOf)){const x=d.allOf.find(b=>typeof b.$ref=="string")?.$ref;if(typeof x=="string"){const b=x.replace("#/definitions/",""),f=o[b];m=typeof f?.image=="string"?f.image:void 0}}if(m?.includes("{{{"))return m}function Xo(h,e){if(!e)return;const o=Ta(h);if(!o)return;const d=Qo(o.resolveType,e);if(!d)return;const m=Pa(d,o.data);if(m)return Aa(m)}const Zo="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",er="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 zn(h){return Array.from({length:h},(e,o)=>({id:crypto.randomUUID(),index:o}))}function bs(h){return h.map((e,o)=>({...e,index:o}))}function tr(h,e){if(e===h.length)return h;if(e<h.length)return bs(h.slice(0,e));const o=Array.from({length:e-h.length},(d,m)=>({id:crypto.randomUUID(),index:h.length+m}));return[...h,...o]}function ys(h){const e=Ue.c(20),{section:o,raw:d,meta:m}=h,x=o.isSavedBlock===!0,b=o.isMultivariate===!0;let f;e[0]!==m||e[1]!==d?(f=d&&m?Xo(d,m):void 0,e[0]=m,e[1]=d,e[2]=f):f=e[2];const v=f;let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(jo,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[3]=u):u=e[3];let y;e[4]!==v?(y=v&&n.jsx("img",{src:v,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[4]=v,e[5]=y):y=e[5];let k;e[6]!==b||e[7]!==x?(k=x?{color:La}:b?{color:"oklch(0.65 0.15 160)"}:void 0,e[6]=b,e[7]=x,e[8]=k):k=e[8];let D;e[9]!==k?(D=n.jsx(gn,{className:"h-4 w-4 shrink-0",style:k}),e[9]=k,e[10]=D):D=e[10];const E=o.isHidden&&"line-through opacity-50";let i;e[11]!==E?(i=Oe("min-w-0 flex-1 truncate text-sm font-medium",E),e[11]=E,e[12]=i):i=e[12];let g;e[13]!==o.label||e[14]!==i?(g=n.jsx("span",{className:i,children:o.label}),e[13]=o.label,e[14]=i,e[15]=g):g=e[15];let r;return e[16]!==y||e[17]!==D||e[18]!==g?(r=n.jsxs(n.Fragment,{children:[u,y,D,g]}),e[16]=y,e[17]=D,e[18]=g,e[19]=r):r=e[19],r}function _s(h,e){const o=h.isSavedBlock===!0,d=h.isMultivariate===!0;return Oe("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":o?Zo:d?"text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]":"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function nr(h){const e=Ue.c(81),{section:o,raw:d,meta:m,sortableId:x,selected:b,onSelect:f,onDelete:v,onDuplicate:u,onMakeReusable:y,onToggleHidden:k,onToggleLazy:D,onAddVariant:E,onDetach:i}=h,g=ct(),r=d?Xn(d.__resolveType??""):!1;let A;e[0]!==o?(A=Ca(o),e[0]=o,e[1]=A):A=e[1];const l=A;let R;e[2]!==x?(R={id:x,animateLayoutChanges:ir},e[2]=x,e[3]=R):R=e[3];const{attributes:K,listeners:z,setNodeRef:p,transform:N,isDragging:ie}=fs(R);let L;e[4]!==N?(L=ps.Transform.toString(N?{...N,x:0}:null),e[4]=N,e[5]=L):L=e[5];const ce=ie?0:void 0;let M;e[6]!==L||e[7]!==ce?(M={transform:L,opacity:ce},e[6]=L,e[7]=ce,e[8]=M):M=e[8];const ge=M;let O;e[9]!==o?(O=Ma(o),e[9]=o,e[10]=O):O=e[10];const ne=O,he="button",me=0;let I;e[11]!==f?(I=T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),f())},e[11]=f,e[12]=I):I=e[12];const J=ie?"cursor-grabbing":"cursor-pointer";let Z;e[13]!==o||e[14]!==b||e[15]!==J?(Z=Oe("touch-none transition-colors",J,_s(o,b)),e[13]=o,e[14]=b,e[15]=J,e[16]=Z):Z=e[16];let ee;e[17]!==m||e[18]!==d||e[19]!==o?(ee=n.jsx(ys,{section:o,raw:d,meta:m}),e[17]=m,e[18]=d,e[19]=o,e[20]=ee):ee=e[20];const $=!o.isMultivariate&&n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":g(r?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:Oe("h-7 w-7 shrink-0",r?"":"opacity-0 group-hover:opacity-100"),onClick:T=>{T.stopPropagation(),D()},onPointerDown:rr,children:n.jsx(Bo,{className:Oe("h-3.5 w-3.5",r&&"text-yellow-500")})})}),n.jsx(jt,{side:"bottom",children:g(r?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]});let Ae;e[21]!==k||e[22]!==o.isHidden||e[23]!==o.isMultivariate||e[24]!==g?(Ae=!o.isMultivariate&&n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":o.isHidden?g("sectionsEditor.sectionList.showSection"):g("sectionsEditor.sectionList.hideSection"),className:Oe("h-7 w-7 shrink-0",o.isHidden?"opacity-100":"opacity-0 group-hover:opacity-100"),onClick:T=>{T.stopPropagation(),k()},onPointerDown:or,children:o.isHidden?n.jsx(Ko,{className:"h-3.5 w-3.5"}):n.jsx(Lo,{className:"h-3.5 w-3.5"})})}),n.jsx(jt,{side:"bottom",children:o.isHidden?g("sectionsEditor.sectionList.showSection"):g("sectionsEditor.sectionList.hideSection")})]}),e[21]=k,e[22]=o.isHidden,e[23]=o.isMultivariate,e[24]=g,e[25]=Ae):Ae=e[25];let Me;e[26]!==g?(Me=g("sectionsEditor.sectionList.sectionActionsMenu"),e[26]=g,e[27]=Me):Me=e[27];let et;e[28]===Symbol.for("react.memo_cache_sentinel")?(et=n.jsx(es,{className:"h-3.5 w-3.5"}),e[28]=et):et=e[28];let Se;e[29]!==Me?(Se=n.jsx(rs,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":Me,className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100",onClick:ar,onPointerDown:sr,children:et})}),e[29]=Me,e[30]=Se):Se=e[30];let H;e[31]!==u?(H=T=>{T.stopPropagation(),u()},e[31]=u,e[32]=H):H=e[32];let se;e[33]===Symbol.for("react.memo_cache_sentinel")?(se=n.jsx(ss,{className:"h-4 w-4"}),e[33]=se):se=e[33];let ae;e[34]!==g?(ae=g("sectionsEditor.sectionList.duplicateMenuItem"),e[34]=g,e[35]=ae):ae=e[35];let ue;e[36]!==H||e[37]!==ae?(ue=n.jsxs(ht,{onClick:H,children:[se,ae]}),e[36]=H,e[37]=ae,e[38]=ue):ue=e[38];let oe;e[39]!==l||e[40]!==E||e[41]!==g?(oe=l&&n.jsxs(ht,{className:Ka,onClick:T=>{T.stopPropagation(),E()},children:[n.jsx(as,{className:"h-4 w-4"}),g("sectionsEditor.sectionList.addVariantMenuItem")]}),e[39]=l,e[40]=E,e[41]=g,e[42]=oe):oe=e[42];let de;e[43]!==ne||e[44]!==y||e[45]!==g?(de=ne&&n.jsxs(ht,{className:er,onClick:T=>{T.stopPropagation(),y()},children:[n.jsx(gn,{className:"h-4 w-4"}),g("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[43]=ne,e[44]=y,e[45]=g,e[46]=de):de=e[46];let le;e[47]!==i||e[48]!==o.isMultivariate||e[49]!==o.isSavedBlock||e[50]!==g?(le=o.isSavedBlock===!0&&!o.isMultivariate&&n.jsxs(ht,{onClick:T=>{T.stopPropagation(),i()},children:[n.jsx(gn,{className:"h-4 w-4"}),g("sectionsEditor.sectionList.detachMenuItem")]}),e[47]=i,e[48]=o.isMultivariate,e[49]=o.isSavedBlock,e[50]=g,e[51]=le):le=e[51];let fe;e[52]!==v?(fe=T=>{T.stopPropagation(),v()},e[52]=v,e[53]=fe):fe=e[53];let De;e[54]===Symbol.for("react.memo_cache_sentinel")?(De=n.jsx(os,{className:"h-4 w-4"}),e[54]=De):De=e[54];let je;e[55]!==g?(je=g("sectionsEditor.sectionList.deleteMenuItem"),e[55]=g,e[56]=je):je=e[56];let re;e[57]!==fe||e[58]!==je?(re=n.jsxs(ht,{className:"text-destructive focus:text-destructive",onClick:fe,children:[De,je]}),e[57]=fe,e[58]=je,e[59]=re):re=e[59];let pe;e[60]!==ue||e[61]!==oe||e[62]!==de||e[63]!==le||e[64]!==re?(pe=n.jsxs(is,{align:"end",className:"w-44",children:[ue,oe,de,le,re]}),e[60]=ue,e[61]=oe,e[62]=de,e[63]=le,e[64]=re,e[65]=pe):pe=e[65];let xe;e[66]!==Se||e[67]!==pe?(xe=n.jsxs(ls,{children:[Se,pe]}),e[66]=Se,e[67]=pe,e[68]=xe):xe=e[68];let be;return e[69]!==K||e[70]!==z||e[71]!==f||e[72]!==p||e[73]!==ge||e[74]!==Z||e[75]!==ee||e[76]!==$||e[77]!==Ae||e[78]!==xe||e[79]!==I?(be=n.jsxs("div",{ref:p,style:ge,...K,...z,role:he,tabIndex:me,onClick:f,onKeyDown:I,className:Z,children:[ee,$,Ae,xe]}),e[69]=K,e[70]=z,e[71]=f,e[72]=p,e[73]=ge,e[74]=Z,e[75]=ee,e[76]=$,e[77]=Ae,e[78]=xe,e[79]=I,e[80]=be):be=e[80],be}function sr(h){return h.stopPropagation()}function ar(h){return h.stopPropagation()}function or(h){return h.stopPropagation()}function rr(h){return h.stopPropagation()}function ir(){return!1}function lr(h){const e=Ue.c(104),{listKey:o,rawSections:d,sections:m,meta:x,selectedIndex:b,onSelect:f,onReorder:v,onDelete:u,onDuplicate:y,onMakeReusable:k,onToggleHidden:D,onToggleLazy:E,onAddVariant:i,onDetach:g,onAddSection:r,canAddSection:A}=h,l=A===void 0?!0:A,R=ct();let K;e[0]!==m.length?(K=()=>zn(m.length),e[0]=m.length,e[1]=K):K=e[1];const[z,p]=w.useState(K),[N,ie]=w.useState(null),[L,ce]=w.useState(o),[M,ge]=w.useState(m.length),O=w.useRef(!1);L!==o?(ce(o),ge(m.length),p(zn(m.length))):M!==m.length&&(ge(m.length),p(ze=>tr(ze,m.length)));let ne;e[2]===Symbol.for("react.memo_cache_sentinel")?(ne={activationConstraint:{distance:8}},e[2]=ne):ne=e[2];let he;e[3]===Symbol.for("react.memo_cache_sentinel")?(he={coordinateGetter:gs},e[3]=he):he=e[3];const me=cs(Jt(ds,ne),Jt(us,he));let I;e[4]!==z?(I=z.map(cr),e[4]=z,e[5]=I):I=e[5];const J=I;let Z;e[6]===Symbol.for("react.memo_cache_sentinel")?(Z=ze=>{ie(String(ze.active.id))},e[6]=Z):Z=e[6];const ee=Z;let $;e[7]!==J||e[8]!==v?($=ze=>{ie(null);const{active:B,over:F}=ze;if(!F||B.id===F.id)return;const G=J.indexOf(String(B.id)),nt=J.indexOf(String(F.id));G===-1||nt===-1||(p(Re=>bs(Mt([...Re],G,nt))),O.current=!0,requestAnimationFrame(()=>{O.current=!1}),v?.(G,nt))},e[7]=J,e[8]=v,e[9]=$):$=e[9];const Ae=$;let Me;e[10]===Symbol.for("react.memo_cache_sentinel")?(Me=()=>{ie(null)},e[10]=Me):Me=e[10];const et=Me;let Se,H,se,ae,ue,oe,de,le,fe,De,je,re,pe,xe,be;if(e[11]!==N||e[12]!==l||e[13]!==z||e[14]!==J||e[15]!==Ae||e[16]!==x||e[17]!==r||e[18]!==i||e[19]!==u||e[20]!==g||e[21]!==y||e[22]!==k||e[23]!==f||e[24]!==D||e[25]!==E||e[26]!==d||e[27]!==m||e[28]!==b||e[29]!==me||e[30]!==R){xe=Symbol.for("react.early_return_sentinel");e:{const ze=B=>{O.current||f(B)};if(e[46]!==N||e[47]!==l||e[48]!==z||e[49]!==r||e[50]!==d||e[51]!==m||e[52]!==R){const B=N?z.find(F=>F.id===N):null;if(ae=B!=null?m[B.index]:null,se=B!=null?d[B.index]:void 0,z.length===0){let F;e[56]!==R?(F=R("sectionsEditor.sectionList.noSections"),e[56]=R,e[57]=F):F=e[57];let G;e[58]!==F?(G=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:F}),e[58]=F,e[59]=G):G=e[59];const nt=!l;let Re;e[60]===Symbol.for("react.memo_cache_sentinel")?(Re=n.jsx(hn,{size:14}),e[60]=Re):Re=e[60];let We;e[61]!==R?(We=R("sectionsEditor.sectionList.addSectionButton"),e[61]=R,e[62]=We):We=e[62];let Ne;e[63]!==r||e[64]!==nt||e[65]!==We?(Ne=n.jsxs(Qe,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:nt,onClick:r,children:[Re,We]}),e[63]=r,e[64]=nt,e[65]=We,e[66]=Ne):Ne=e[66];let vt;e[67]!==G||e[68]!==Ne?(vt=n.jsxs("div",{className:"space-y-2",children:[G,Ne]}),e[67]=G,e[68]=Ne,e[69]=vt):vt=e[69],xe=vt;break e}pe=Oe(B&&"cursor-grabbing"),e[46]=N,e[47]=l,e[48]=z,e[49]=r,e[50]=d,e[51]=m,e[52]=R,e[53]=se,e[54]=ae,e[55]=pe}else se=e[53],ae=e[54],pe=e[55];H=hs,le=me,fe=vs,De=ee,je=Ae,re=et,Se=Ss,oe=J,de=xs,be="space-y-1",ue=z.map(B=>{const F=m[B.index];return F?n.jsx(nr,{sortableId:B.id,section:F,raw:d[B.index],meta:x,selected:b===B.index,onSelect:()=>ze(B.index),onDelete:()=>u(B.index),onDuplicate:()=>y(B.index),onMakeReusable:()=>k(B.index),onToggleHidden:()=>D(B.index),onToggleLazy:()=>E(B.index),onAddVariant:()=>i(B.index),onDetach:()=>g(B.index)},B.id):null})}e[11]=N,e[12]=l,e[13]=z,e[14]=J,e[15]=Ae,e[16]=x,e[17]=r,e[18]=i,e[19]=u,e[20]=g,e[21]=y,e[22]=k,e[23]=f,e[24]=D,e[25]=E,e[26]=d,e[27]=m,e[28]=b,e[29]=me,e[30]=R,e[31]=Se,e[32]=H,e[33]=se,e[34]=ae,e[35]=ue,e[36]=oe,e[37]=de,e[38]=le,e[39]=fe,e[40]=De,e[41]=je,e[42]=re,e[43]=pe,e[44]=xe,e[45]=be}else Se=e[31],H=e[32],se=e[33],ae=e[34],ue=e[35],oe=e[36],de=e[37],le=e[38],fe=e[39],De=e[40],je=e[41],re=e[42],pe=e[43],xe=e[44],be=e[45];if(xe!==Symbol.for("react.early_return_sentinel"))return xe;let T;e[70]!==ue||e[71]!==be?(T=n.jsx("div",{className:be,children:ue}),e[70]=ue,e[71]=be,e[72]=T):T=e[72];let Ke;e[73]!==Se||e[74]!==oe||e[75]!==de||e[76]!==T?(Ke=n.jsx(Se,{items:oe,strategy:de,children:T}),e[73]=Se,e[74]=oe,e[75]=de,e[76]=T,e[77]=Ke):Ke=e[77];let Ie;e[78]!==se||e[79]!==ae||e[80]!==x?(Ie=ae?n.jsx("div",{className:Oe("cursor-grabbing shadow-lg ring-1 ring-border/60",_s(ae,!1)),children:n.jsx(ys,{section:ae,raw:se,meta:x})}):null,e[78]=se,e[79]=ae,e[80]=x,e[81]=Ie):Ie=e[81];let Ge;e[82]!==Ie?(Ge=Yn.createPortal(n.jsx(ms,{dropAnimation:Qn,children:Ie}),document.body),e[82]=Ie,e[83]=Ge):Ge=e[83];let $e;e[84]!==H||e[85]!==le||e[86]!==fe||e[87]!==De||e[88]!==je||e[89]!==re||e[90]!==Ke||e[91]!==Ge?($e=n.jsxs(H,{sensors:le,collisionDetection:fe,onDragStart:De,onDragEnd:je,onDragCancel:re,children:[Ke,Ge]}),e[84]=H,e[85]=le,e[86]=fe,e[87]=De,e[88]=je,e[89]=re,e[90]=Ke,e[91]=Ge,e[92]=$e):$e=e[92];const Ee=!l;let ye;e[93]===Symbol.for("react.memo_cache_sentinel")?(ye=n.jsx(hn,{size:14}),e[93]=ye):ye=e[93];let ke;e[94]!==R?(ke=R("sectionsEditor.sectionList.addSectionButton"),e[94]=R,e[95]=ke):ke=e[95];let Le;e[96]!==r||e[97]!==Ee||e[98]!==ke?(Le=n.jsxs(Qe,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:Ee,onClick:r,children:[ye,ke]}),e[96]=r,e[97]=Ee,e[98]=ke,e[99]=Le):Le=e[99];let Te;return e[100]!==pe||e[101]!==$e||e[102]!==Le?(Te=n.jsxs("div",{className:pe,children:[$e,Le]}),e[100]=pe,e[101]=$e,e[102]=Le,e[103]=Te):Te=e[103],Te}function cr(h){return h.id}function Hn(h){const e=Ue.c(57),{open:o,initialName:d,autoLabel:m,isPending:x,onSubmit:b,onOpenChange:f}=h,v=x===void 0?!1:x,u=ct(),[y,k]=w.useState(d),[D,E]=w.useState(o);o!==D&&(E(o),o&&k(d));let i;e[0]!==v||e[1]!==f?(i=ee=>{!ee&&!v&&f(!1)},e[0]=v,e[1]=f,e[2]=i):i=e[2];const g=i;let r;e[3]!==v||e[4]!==y||e[5]!==b?(r=async ee=>{ee.preventDefault(),!v&&await b(y.trim())},e[3]=v,e[4]=y,e[5]=b,e[6]=r):r=e[6];const A=r;let l;e[7]!==u?(l=u("sectionsEditor.variantRenameDialog.title"),e[7]=u,e[8]=l):l=e[8];let R;e[9]!==l?(R=n.jsx(No,{children:l}),e[9]=l,e[10]=R):R=e[10];let K;e[11]!==m||e[12]!==u?(K=u("sectionsEditor.variantRenameDialog.description",{fallback:m||u("sectionsEditor.variantRenameDialog.defaultFallback")}),e[11]=m,e[12]=u,e[13]=K):K=e[13];let z;e[14]!==K?(z=n.jsx(Do,{children:K}),e[14]=K,e[15]=z):z=e[15];let p;e[16]!==R||e[17]!==z?(p=n.jsxs(To,{children:[R,z]}),e[16]=R,e[17]=z,e[18]=p):p=e[18];let N;e[19]!==u?(N=u("sectionsEditor.variantRenameDialog.nameLabel"),e[19]=u,e[20]=N):N=e[20];let ie;e[21]!==N?(ie=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:N}),e[21]=N,e[22]=ie):ie=e[22];let L;e[23]===Symbol.for("react.memo_cache_sentinel")?(L=ee=>k(ee.target.value),e[23]=L):L=e[23];let ce;e[24]!==m||e[25]!==v||e[26]!==y?(ce=n.jsx(Mo,{id:"variant-rename-name",value:y,onChange:L,placeholder:m,autoFocus:!0,disabled:v}),e[24]=m,e[25]=v,e[26]=y,e[27]=ce):ce=e[27];let M;e[28]!==ie||e[29]!==ce?(M=n.jsxs("div",{className:"space-y-1.5 py-4",children:[ie,ce]}),e[28]=ie,e[29]=ce,e[30]=M):M=e[30];let ge;e[31]!==f?(ge=()=>f(!1),e[31]=f,e[32]=ge):ge=e[32];let O;e[33]!==u?(O=u("sectionsEditor.variantRenameDialog.cancel"),e[33]=u,e[34]=O):O=e[34];let ne;e[35]!==v||e[36]!==ge||e[37]!==O?(ne=n.jsx(Qe,{type:"button",variant:"outline",onClick:ge,disabled:v,children:O}),e[35]=v,e[36]=ge,e[37]=O,e[38]=ne):ne=e[38];let he;e[39]!==v||e[40]!==u?(he=v?n.jsxs(n.Fragment,{children:[n.jsx(Jn,{size:14,className:"animate-spin"}),u("sectionsEditor.variantRenameDialog.saving")]}):u("sectionsEditor.variantRenameDialog.save"),e[39]=v,e[40]=u,e[41]=he):he=e[41];let me;e[42]!==v||e[43]!==he?(me=n.jsx(Qe,{type:"submit",disabled:v,children:he}),e[42]=v,e[43]=he,e[44]=me):me=e[44];let I;e[45]!==ne||e[46]!==me?(I=n.jsxs(Po,{children:[ne,me]}),e[45]=ne,e[46]=me,e[47]=I):I=e[47];let J;e[48]!==A||e[49]!==M||e[50]!==I||e[51]!==p?(J=n.jsx(Ao,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:A,children:[p,M,I]})}),e[48]=A,e[49]=M,e[50]=I,e[51]=p,e[52]=J):J=e[52];let Z;return e[53]!==g||e[54]!==o||e[55]!==J?(Z=n.jsx(Co,{open:o,onOpenChange:g,children:J}),e[53]=g,e[54]=o,e[55]=J,e[56]=Z):Z=e[56],Z}const ur="text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]",js="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.2)]";function Es(h){const e=Ue.c(5),{rule:o,matchers:d}=h,m=o?.__resolveType??"";let x;if(e[0]!==d||e[1]!==m){const u=d.find(y=>y.resolveType===m)?.iconName??Ba(m);x=Eo(u),e[0]=d,e[1]=m,e[2]=x}else x=e[2];const b=x;if(!b)return null;let f;return e[3]!==b?(f=n.jsx(b,{size:14,className:"shrink-0"}),e[3]=b,e[4]=f):f=e[4],f}function Gn(h){return h.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
2
2
  `)}function pn(h){return h.map((e,o)=>({id:crypto.randomUUID(),index:o,variant:e}))}function dr(h){return h.map((e,o)=>({...e,index:o}))}function ks(h){const e=Ue.c(17),{label:o,effectiveRule:d,matchers:m,canDelete:x,dragging:b,onRename:f,onDuplicate:v,onDelete:u}=h,y=ct();let k;e[0]!==d||e[1]!==m?(k=n.jsx(Es,{rule:d,matchers:m}),e[0]=d,e[1]=m,e[2]=k):k=e[2];let D;e[3]!==o?(D=n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:o}),e[3]=o,e[4]=D):D=e[4];let E;e[5]!==x||e[6]!==b||e[7]!==o||e[8]!==u||e[9]!==v||e[10]!==f||e[11]!==y?(E=!b&&n.jsxs(ls,{children:[n.jsx(rs,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":y("sectionsEditor.pageVariantTabs.actionsAriaLabel",{label:o}),className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:fr,onPointerDown:mr,children:n.jsx(es,{size:14})})}),n.jsxs(is,{align:"end",className:"w-36",children:[n.jsxs(ht,{onClick:g=>{g.stopPropagation(),f?.()},children:[n.jsx(qo,{size:14}),y("sectionsEditor.pageVariantTabs.renameAction")]}),n.jsxs(ht,{onClick:g=>{g.stopPropagation(),v?.()},children:[n.jsx(ss,{size:14}),y("sectionsEditor.pageVariantTabs.duplicateAction")]}),n.jsx(Fo,{}),n.jsxs(ht,{variant:"destructive",disabled:!x,onClick:g=>{g.stopPropagation(),u?.()},children:[n.jsx(os,{size:14}),y("sectionsEditor.pageVariantTabs.deleteAction")]})]})]}),e[5]=x,e[6]=b,e[7]=o,e[8]=u,e[9]=v,e[10]=f,e[11]=y,e[12]=E):E=e[12];let i;return e[13]!==k||e[14]!==D||e[15]!==E?(i=n.jsxs(n.Fragment,{children:[k,D,E]}),e[13]=k,e[14]=D,e[15]=E,e[16]=i):i=e[16],i}function mr(h){return h.stopPropagation()}function fr(h){return h.stopPropagation()}function pr(h){const e=Ue.c(33),{entry:o,sortableId:d,isActive:m,canDelete:x,decofile:b,meta:f,matchers:v,onSelect:u,onRename:y,onDuplicate:k,onDelete:D}=h;let E;e[0]!==d?(E={id:d,animateLayoutChanges:gr},e[0]=d,e[1]=E):E=e[1];const{attributes:i,listeners:g,setNodeRef:r,transform:A,isDragging:l}=fs(E);let R;e[2]!==A?(R=ps.Transform.toString(A?{...A,x:0}:null),e[2]=A,e[3]=R):R=e[3];const K=l?0:void 0;let z;e[4]!==R||e[5]!==K?(z={transform:R,opacity:K},e[4]=R,e[5]=K,e[6]=z):z=e[6];const p=z,N=f??void 0;let ie;e[7]!==b||e[8]!==o.variant.rule||e[9]!==N?(ie=Ct(o.variant.rule,b,N),e[7]=b,e[8]=o.variant.rule,e[9]=N,e[10]=ie):ie=e[10];const L=ie;let ce;e[11]!==u?(ce=me=>{me.target===me.currentTarget&&(me.key==="Enter"||me.key===" ")&&(me.preventDefault(),u())},e[11]=u,e[12]=ce):ce=e[12];const M=l?"cursor-grabbing":"cursor-pointer active:cursor-grabbing",ge=m?js:ur;let O;e[13]!==M||e[14]!==ge?(O=Oe("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors touch-none",M,ge),e[13]=M,e[14]=ge,e[15]=O):O=e[15];let ne;e[16]!==x||e[17]!==L||e[18]!==o.variant.label||e[19]!==v||e[20]!==D||e[21]!==k||e[22]!==y?(ne=n.jsx(ks,{label:o.variant.label,effectiveRule:L,matchers:v,canDelete:x,onRename:y,onDuplicate:k,onDelete:D}),e[16]=x,e[17]=L,e[18]=o.variant.label,e[19]=v,e[20]=D,e[21]=k,e[22]=y,e[23]=ne):ne=e[23];let he;return e[24]!==i||e[25]!==g||e[26]!==u||e[27]!==r||e[28]!==p||e[29]!==O||e[30]!==ne||e[31]!==ce?(he=n.jsx("div",{ref:r,style:p,...i,...g,onClick:u,onKeyDown:ce,className:O,children:ne}),e[24]=i,e[25]=g,e[26]=u,e[27]=r,e[28]=p,e[29]=O,e[30]=ne,e[31]=ce,e[32]=he):he=e[32],he}function gr(){return!1}function hr(h){const e=Ue.c(9),{variant:o,decofile:d,meta:m,matchers:x}=h,b=m??void 0;let f;e[0]!==d||e[1]!==b||e[2]!==o.rule?(f=Ct(o.rule,d,b),e[0]=d,e[1]=b,e[2]=o.rule,e[3]=f):f=e[3];const v=f;let u;e[4]===Symbol.for("react.memo_cache_sentinel")?(u=Oe("flex items-center gap-2 rounded-md px-2 py-2.5 shadow-lg ring-1 ring-border/60 cursor-grabbing",js),e[4]=u):u=e[4];let y;return e[5]!==v||e[6]!==x||e[7]!==o.label?(y=n.jsx("div",{className:u,children:n.jsx(ks,{label:o.label,effectiveRule:v,matchers:x,canDelete:!1,dragging:!0})}),e[5]=v,e[6]=x,e[7]=o.label,e[8]=y):y=e[8],y}function vr(h){const e=Ue.c(91),{listKey:o,variants:d,activeIndex:m,decofile:x,meta:b,matchers:f,onSelect:v,onReorder:u,onRename:y,onDuplicate:k,onDelete:D,onAdd:E}=h,i=ct();let g;e[0]!==d?(g=()=>pn(d),e[0]=d,e[1]=g):g=e[1];const[r,A]=w.useState(g),[l,R]=w.useState(null),[K,z]=w.useState(o),[p,N]=w.useState(d.length);let ie;e[2]!==d?(ie=()=>Gn(d),e[2]=d,e[3]=ie):ie=e[3];const[L,ce]=w.useState(ie),M=w.useRef(!1),ge=Gn(d);K!==o?(z(o),N(d.length),ce(ge),A(pn(d))):p!==d.length?(N(d.length),ce(ge),A(pn(d))):L!==ge&&(ce(ge),A($e=>d.map((Ee,ye)=>({id:$e[ye]?.id??crypto.randomUUID(),index:ye,variant:Ee}))));let O;e[4]===Symbol.for("react.memo_cache_sentinel")?(O={activationConstraint:{distance:8}},e[4]=O):O=e[4];let ne;e[5]===Symbol.for("react.memo_cache_sentinel")?(ne={coordinateGetter:gs},e[5]=ne):ne=e[5];const he=cs(Jt(ds,O),Jt(us,ne));let me;e[6]!==r?(me=r.map(Sr),e[6]=r,e[7]=me):me=e[7];const I=me,J=d.length>1;let Z;e[8]!==r?(Z=$e=>{const Ee=String($e.active.id);R(r.find(ye=>ye.id===Ee)??null)},e[8]=r,e[9]=Z):Z=e[9];const ee=Z;let $;e[10]!==I||e[11]!==u?($=$e=>{R(null);const{active:Ee,over:ye}=$e;if(!ye||Ee.id===ye.id)return;const ke=I.indexOf(String(Ee.id)),Le=I.indexOf(String(ye.id));ke===-1||Le===-1||(A(Te=>dr(Mt([...Te],ke,Le))),M.current=!0,requestAnimationFrame(()=>{M.current=!1}),u(ke,Le))},e[10]=I,e[11]=u,e[12]=$):$=e[12];const Ae=$;let Me;e[13]===Symbol.for("react.memo_cache_sentinel")?(Me=()=>{R(null)},e[13]=Me):Me=e[13];const et=Me;let Se,H,se,ae,ue,oe,de,le,fe,De,je,re,pe;if(e[14]!==m||e[15]!==J||e[16]!==x||e[17]!==r||e[18]!==I||e[19]!==Ae||e[20]!==ee||e[21]!==f||e[22]!==b||e[23]!==E||e[24]!==D||e[25]!==k||e[26]!==y||e[27]!==v||e[28]!==he||e[29]!==i){const $e=G=>{M.current||v(G)};je="space-y-1 border-b p-2";let Ee;e[43]!==i?(Ee=i("sectionsEditor.pageVariantTabs.variantsLabel"),e[43]=i,e[44]=Ee):Ee=e[44];let ye;e[45]!==Ee?(ye=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:Ee}),e[45]=Ee,e[46]=ye):ye=e[46];let ke;e[47]!==i?(ke=i("sectionsEditor.pageVariantTabs.addVariantAriaLabel"),e[47]=i,e[48]=ke):ke=e[48];let Le;e[49]===Symbol.for("react.memo_cache_sentinel")?(Le=n.jsx(hn,{size:14}),e[49]=Le):Le=e[49];let Te;e[50]!==E||e[51]!==ke?(Te=n.jsx(_t,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":ke,className:"size-6",onClick:E,children:Le})}),e[50]=E,e[51]=ke,e[52]=Te):Te=e[52];let ze;e[53]!==i?(ze=i("sectionsEditor.pageVariantTabs.addVariantTooltip"),e[53]=i,e[54]=ze):ze=e[54];let B;e[55]!==ze?(B=n.jsx(jt,{children:ze}),e[55]=ze,e[56]=B):B=e[56];let F;e[57]!==Te||e[58]!==B?(F=n.jsxs(yt,{children:[Te,B]}),e[57]=Te,e[58]=B,e[59]=F):F=e[59],e[60]!==ye||e[61]!==F?(re=n.jsxs("div",{className:"flex items-center justify-between",children:[ye,F]}),e[60]=ye,e[61]=F,e[62]=re):re=e[62],H=hs,oe=he,de=vs,le=ee,fe=Ae,De=et,Se=Ss,ae=I,ue=xs,pe="space-y-0.5",se=r.map(G=>n.jsx(pr,{sortableId:G.id,entry:G,isActive:G.index===m,canDelete:J,decofile:x,meta:b,matchers:f,onSelect:()=>$e(G.index),onRename:()=>y(G.index),onDuplicate:()=>k(G.index),onDelete:()=>D(G.index)},G.id)),e[14]=m,e[15]=J,e[16]=x,e[17]=r,e[18]=I,e[19]=Ae,e[20]=ee,e[21]=f,e[22]=b,e[23]=E,e[24]=D,e[25]=k,e[26]=y,e[27]=v,e[28]=he,e[29]=i,e[30]=Se,e[31]=H,e[32]=se,e[33]=ae,e[34]=ue,e[35]=oe,e[36]=de,e[37]=le,e[38]=fe,e[39]=De,e[40]=je,e[41]=re,e[42]=pe}else Se=e[30],H=e[31],se=e[32],ae=e[33],ue=e[34],oe=e[35],de=e[36],le=e[37],fe=e[38],De=e[39],je=e[40],re=e[41],pe=e[42];let xe;e[63]!==se||e[64]!==pe?(xe=n.jsx("div",{className:pe,children:se}),e[63]=se,e[64]=pe,e[65]=xe):xe=e[65];let be;e[66]!==Se||e[67]!==ae||e[68]!==ue||e[69]!==xe?(be=n.jsx(Se,{items:ae,strategy:ue,children:xe}),e[66]=Se,e[67]=ae,e[68]=ue,e[69]=xe,e[70]=be):be=e[70];let T;e[71]!==l||e[72]!==x||e[73]!==f||e[74]!==b?(T=l?n.jsx(hr,{variant:l.variant,decofile:x,meta:b,matchers:f}):null,e[71]=l,e[72]=x,e[73]=f,e[74]=b,e[75]=T):T=e[75];let Ke;e[76]!==T?(Ke=Yn.createPortal(n.jsx(ms,{dropAnimation:Qn,children:T}),document.body),e[76]=T,e[77]=Ke):Ke=e[77];let Ie;e[78]!==H||e[79]!==oe||e[80]!==de||e[81]!==le||e[82]!==fe||e[83]!==De||e[84]!==be||e[85]!==Ke?(Ie=n.jsxs(H,{sensors:oe,collisionDetection:de,onDragStart:le,onDragEnd:fe,onDragCancel:De,children:[be,Ke]}),e[78]=H,e[79]=oe,e[80]=de,e[81]=le,e[82]=fe,e[83]=De,e[84]=be,e[85]=Ke,e[86]=Ie):Ie=e[86];let Ge;return e[87]!==je||e[88]!==re||e[89]!==Ie?(Ge=n.jsxs("div",{className:je,children:[re,Ie]}),e[87]=je,e[88]=re,e[89]=Ie,e[90]=Ge):Ge=e[90],Ge}function Sr(h){return h.id}function xr(h){const e=Ue.c(16),{schema:o,value:d,onChange:m,meta:x,decofile:b,onSaveReferencedBlock:f,sandbox:v}=h,u=ct();let y;e[0]===Symbol.for("react.memo_cache_sentinel")?(y=[],e[0]=y):y=e[0];const[k,D]=w.useState(y);let E;e[1]!==k||e[2]!==u?(E=k.length>0&&n.jsxs("nav",{"aria-label":u("sectionsEditor.sectionsEditorPanels.variantRuleBreadcrumb"),className:"flex min-w-0 items-center gap-1 overflow-hidden text-xs",children:[n.jsx("button",{type:"button",onClick:()=>D([]),className:"flex shrink-0 items-center gap-0.5 rounded-md px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",title:u("sectionsEditor.sectionsEditorPanels.backToRule"),children:n.jsx(ts,{className:"size-3.5"})}),k.map((r,A)=>{const l=A===k.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[A>0&&n.jsx(ns,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>D(k.slice(0,A+1)),title:r,className:Oe("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",l?"font-medium text-foreground":"text-muted-foreground"),children:r})]},`${r}-${A}`)})]}),e[1]=k,e[2]=u,e[3]=E):E=e[3];let i;e[4]!==k||e[5]!==b||e[6]!==x||e[7]!==m||e[8]!==f||e[9]!==v||e[10]!==o||e[11]!==d?(i=n.jsx(Zn,{schema:o,value:d,onChange:m,basePath:"",breadcrumbPath:k,onBreadcrumbChange:D,meta:x,decofile:b,onSaveReferencedBlock:f,sandbox:v}),e[4]=k,e[5]=b,e[6]=x,e[7]=m,e[8]=f,e[9]=v,e[10]=o,e[11]=d,e[12]=i):i=e[12];let g;return e[13]!==E||e[14]!==i?(g=n.jsxs("div",{className:"space-y-2",children:[E,i]}),e[13]=E,e[14]=i,e[15]=g):g=e[15],g}function Un(h){const e=Ue.c(23),{activeSchema:o,formValue:d,formResetKey:m,onFormChange:x,onBreadcrumbChange:b,breadcrumbPath:f,emptyMessage:v,beforeForm:u,seoResolveType:y,siteDefaultSeo:k,meta:D,decofile:E,onSaveReferencedBlock:i,sandbox:g,previewBaseUrl:r,onRequestAddSection:A}=h;let l;e[0]!==f?(l=f===void 0?[]:f,e[0]=f,e[1]=l):l=e[1];const R=l;let K;e[2]!==o||e[3]!==R||e[4]!==E||e[5]!==m||e[6]!==d||e[7]!==D||e[8]!==b||e[9]!==x||e[10]!==A||e[11]!==i||e[12]!==r||e[13]!==g||e[14]!==y||e[15]!==k?(K=o&&d?y?n.jsx(Oo,{schema:o,resolveType:y,value:d,formResetKey:m,onChange:x,onBreadcrumbChange:b,siteDefaultSeo:k}):n.jsx(Zn,{schema:o,value:d,onChange:x,basePath:"",breadcrumbPath:R,onBreadcrumbChange:b,meta:D,decofile:E,onSaveReferencedBlock:i,sandbox:g,previewBaseUrl:r,onRequestAddSection:A},m):null,e[2]=o,e[3]=R,e[4]=E,e[5]=m,e[6]=d,e[7]=D,e[8]=b,e[9]=x,e[10]=A,e[11]=i,e[12]=r,e[13]=g,e[14]=y,e[15]=k,e[16]=K):K=e[16];const z=K;let p;e[17]!==v||e[18]!==z?(p=z??n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:v}),e[17]=v,e[18]=z,e[19]=p):p=e[19];let N;return e[20]!==u||e[21]!==p?(N=n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsxs("div",{className:"mx-auto max-w-2xl",children:[u,p]})}),e[20]=u,e[21]=p,e[22]=N):N=e[22],N}const br="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.22)]";function yr(h,e){return Fa(h,e,lt)}function _r(h){const e=Ue.c(19),{pageKey:o,initialName:d,initialPath:m,onFieldChange:x}=h,b=ct(),[f,v]=w.useState(d),[u,y]=w.useState(m),[k,D]=w.useState(o);k!==o&&(D(o),v(d),y(m));let E;e[0]!==x?(E=K=>{v(K.target.value),x("name",K.target.value)},e[0]=x,e[1]=E):E=e[1];let i;e[2]!==b?(i=b("sectionsEditor.sectionsEditorPanels.pageNamePlaceholder"),e[2]=b,e[3]=i):i=e[3];let g;e[4]!==f||e[5]!==E||e[6]!==i?(g=n.jsx("input",{type:"text",value:f,onChange:E,className:"w-full bg-transparent text-sm font-semibold truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:i}),e[4]=f,e[5]=E,e[6]=i,e[7]=g):g=e[7];let r;e[8]!==x?(r=K=>{y(K.target.value),x("path",K.target.value)},e[8]=x,e[9]=r):r=e[9];let A;e[10]!==b?(A=b("sectionsEditor.sectionsEditorPanels.pathPlaceholder"),e[10]=b,e[11]=A):A=e[11];let l;e[12]!==u||e[13]!==r||e[14]!==A?(l=n.jsx("input",{type:"text",value:u,onChange:r,className:"w-full bg-transparent text-xs text-muted-foreground truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:A}),e[12]=u,e[13]=r,e[14]=A,e[15]=l):l=e[15];let R;return e[16]!==g||e[17]!==l?(R=n.jsxs("div",{className:"space-y-1",children:[g,l]}),e[16]=g,e[17]=l,e[18]=R):R=e[18],R}function Wn(h){const e=Ue.c(13),{onClick:o}=h,d=ct();let m;e[0]!==d?(m=d("sectionsEditor.sectionsEditorPanels.addVariant"),e[0]=d,e[1]=m):m=e[1];let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(as,{size:14}),e[2]=x):x=e[2];let b;e[3]!==o||e[4]!==m?(b=n.jsx(_t,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":m,className:"size-7 shrink-0 text-[oklch(0.65_0.15_160)]",onClick:o,children:x})}),e[3]=o,e[4]=m,e[5]=b):b=e[5];let f;e[6]!==d?(f=d("sectionsEditor.sectionsEditorPanels.addVariant"),e[6]=d,e[7]=f):f=e[7];let v;e[8]!==f?(v=n.jsx(jt,{side:"bottom",children:f}),e[8]=f,e[9]=v):v=e[9];let u;return e[10]!==b||e[11]!==v?(u=n.jsxs(yt,{children:[b,v]}),e[10]=b,e[11]=v,e[12]=u):u=e[12],u}function qn(h){const e=Ue.c(21),{currentRt:o,currentLabel:d,currentGlobalKey:m,matchers:x,globals:b,onSelect:f,onSelectGlobal:v,schema:u,formValue:y,onChange:k,formKey:D,formWrapperClassName:E,meta:i,decofile:g,onSaveReferencedBlock:r,sandbox:A}=h;let l;e[0]!==m||e[1]!==d||e[2]!==o||e[3]!==b||e[4]!==x||e[5]!==f||e[6]!==v?(l=n.jsx(Oa,{currentRt:o,currentLabel:d,currentGlobalKey:m,matchers:x,globals:b,onSelect:f,onSelectGlobal:v}),e[0]=m,e[1]=d,e[2]=o,e[3]=b,e[4]=x,e[5]=f,e[6]=v,e[7]=l):l=e[7];let R;e[8]!==g||e[9]!==D||e[10]!==y||e[11]!==E||e[12]!==i||e[13]!==k||e[14]!==r||e[15]!==A||e[16]!==u?(R=u&&y&&n.jsx("div",{className:E,children:n.jsx(xr,{schema:u,value:y,onChange:k,meta:i,decofile:g,onSaveReferencedBlock:r,sandbox:A},D)}),e[8]=g,e[9]=D,e[10]=y,e[11]=E,e[12]=i,e[13]=k,e[14]=r,e[15]=A,e[16]=u,e[17]=R):R=e[17];let K;return e[18]!==l||e[19]!==R?(K=n.jsxs(n.Fragment,{children:[l,R]}),e[18]=l,e[19]=R,e[20]=K):K=e[20],K}function uc({orgSlug:h,virtualMcpId:e,branch:o,previewReady:d=!0,previewUrl:m,currentPath:x,activePageBlockKey:b=null,activeGlobalBlockKey:f=null,externalSelectedIndex:v,onSaved:u,initialEditSeo:y=!1,onExitSeo:k,onViewJsonFile:D,onVariantPreviewOverride:E}){const i=ct(),g=d?{orgSlug:h,virtualMcpId:e,branch:o,previewUrl:m}:null,{data:r,isLoading:A}=Ia(g),{data:l,isLoading:R}=$a(g),K=za(),z=K?.entity?.id===e?K.entity.metadata?.siteSlug??null:null,[p,N]=w.useState(null),[ie,L]=w.useState(null),[ce,M]=w.useState(null),[ge,O]=w.useState(0),[ne,he]=w.useState(void 0),[me,I]=w.useState(null),[J,Z]=w.useState(null),[ee,$]=w.useState([]),Ae=w.useRef(null),[Me,et]=w.useState(ee.length);Me!==ee.length&&(et(ee.length),requestAnimationFrame(()=>{Ae.current&&(Ae.current.scrollTop=0)}));const[Se,H]=w.useState(0),[se,ae]=w.useState(null),[ue,oe]=w.useState(null),[de,le]=w.useState(null),[fe,De]=w.useState(!0),[je,re]=w.useState(!1),[pe,xe]=w.useState(!1),be=w.useRef(null),[T,Ke]=w.useState(y),[Ie,Ge]=w.useState(y);y&&!Ie&&(Ge(!0),Ke(!0),N(null),L(null),M(null),$([])),!y&&Ie&&Ge(!1);const[$e,Ee]=w.useState(null),[ye,ke]=w.useState(void 0),[Le,Te]=w.useState([]),[ze,B]=w.useState(0),[F,G]=w.useState(0),[nt,Re]=w.useState(null),[We,Ne]=w.useState(null),[vt,vn]=w.useState(null),Rs=Na(),ws=`${h}/${e}/${o}`,Qt=Ha({orgSlug:h,virtualMcpId:e,branch:o}),[Vs,Ns]=w.useState(x),[Ds,Ts]=w.useState(b),[Ps,As]=w.useState(f);(Vs!==x||Ds!==b||Ps!==f)&&(queueMicrotask(()=>Qt.flush()),Ns(x),Ts(b),As(f),N(null),L(null),M(null),O(0),I(null),Z(null),G(0),Re(null),Ne(null),$([]),H(t=>t+1),Ke(!1),Ee(null),ke(void 0),Te([]),B(t=>t+1));const we=Ga({orgSlug:h,virtualMcpId:e,branch:o}),Kt=uo((t,s)=>{we.mutate({blockKey:t,data:s},{onSuccess:()=>u?.(),onError:a=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:a.message}))})}),Xt=Ua({orgSlug:h,virtualMcpId:e,branch:o}),[Nt,Lt]=w.useState(!1),Be=w.useRef(null),st=w.useRef(null),at=w.useRef(null),Zt=w.useRef({}),Xe=w.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!d||A||R)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(Jn,{size:20,className:"animate-spin text-muted-foreground"})});if(!r||!l)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:i("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const Cs=Wa(r),Ve=!!f,qe=Ve?null:qa(Cs,x,b),V=Ve?f:qe?.key??null,en=Ve&&f?r[f]:void 0,Sn=Ve&&f&&en?Ya(f,en):Ve&&f?f:"",Bt=!Ve&&V&&r[V]?r[V]:null,tn=T&&r&&l&&V&&qe?$n(r,{kind:"page",pageKey:V,pageName:String(qe.name??""),path:String(qe.path??"")},l):null,Ms=T?Bt?.seo:void 0,nn=ye!==void 0?ye:Ms,Ks=T?Io(nn):void 0,Ls=tn?.seoTypeOptions??[],Bs=T&&l?$o(l):"",xn=$e??Ks??{},sn=T&&tn?zo(xn,tn):null,Fs=T&&sn&&Ho(nn)?Gt(sn,l):null,Os=T?Go(r,l)?.seoData:void 0,He=Ve?[{label:"Default",sections:[{__resolveType:f}]}]:yr(Bt?.sections,r??{}),Ft=He.length>1,Ce=Math.min(ge,He.length-1),ut=He[Ce],q=ut?.sections??[],Fe=Ut(q,r),bn=!Ve&&Ja(Bt?.sections);if(Ve&&f&&vt!==f){vn(f);const t=q[0],s=Fe[0];if(t&&s){N(0),G(0),$([]);const a=xt(t,s,r);a&&(L(a.data),M(a.resolveType),Ne(null),Re(null))}}!Ve&&vt!==null&&vn(null),Xe.current={rawSections:q,parsedSections:Fe,decofile:r??{},activePageKey:V,pageVariants:He,variantIndex:Ce,sectionVariantIndex:F,selectedSectionIndex:p};const Is=()=>({multivariate:bn,index:Ce,variants:He.map(t=>({rule:t.rule}))}),yn=(t,s)=>{if(!E)return;if(!V||!bn||t.length<=1){E(null);return}const a=In(V,{multivariate:!0,index:s,variants:t},r,l);E(a.length>0?a:null)},Et=(t,s,a)=>{if(!E)return;if(!V){E(null);return}const c=Is(),S=In(V,c,r,l);if(!t||s<0){E(S.length>0?S:null);return}const j=ho({pageKey:V,page:c,sectionIndex:s,sectionLazy:Fe[s]?.isLazy??!1,mvObj:t,selectedVariantIndex:a,decofile:r,meta:l}),_=[...S,...j];E(_.length>0?_:null)},dt=(t,s,a,c=p??-1,S=!1)=>{const j=tt(t,s);if(!j){L(null),M(null),Ne(null),Re(null),S&&Et(null,c,a);return}const P=Mn(j,lt)[a];if(!P){L(null),M(null),Ne(null),Re(null),S&&Et(null,c,a);return}const te=no(P.value,r);L(te?.data??null),M(te?.resolveType??null);const{resolveType:C,formValue:U}=Tt(P.rule,r,l??void 0);Ne(C),Re(U),S&&Et(j,c,a)};if(v!==void 0&&v!==ne&&(he(v??null),typeof v=="number")){const t=q[v],s=Fe[v];if(t&&s)if(N(v),G(0),$([]),H(a=>a+1),s.isMultivariate)dt(t,s,0,v);else{const a=xt(t,s,r);a?(L(a.data),M(a.resolveType)):(L(null),M(null)),Ne(null),Re(null)}}const Ot={orgSlug:h,virtualMcpId:e,branch:o,previewUrl:m??void 0,siteSlug:z},an=ce&&l?Gt(ce,l):null,Ye=(t,s)=>{if(!V)return;Be.current&&(clearTimeout(Be.current),Be.current=null),at.current&&(clearTimeout(at.current),at.current=null),st.current&&(clearTimeout(st.current),st.current=null);const a=At(r,V,t,Ce,He);we.mutate({blockKey:V,data:a},{onSuccess:()=>s?.onSuccess?.()??u?.(),onError:c=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:c.message}))})},kt=()=>{N(null),L(null),M(null),G(0),Re(null),Ne(null),$([]),H(t=>t+1)},$s=(t,s)=>{Be.current&&clearTimeout(Be.current);const a=Xe.current.sectionVariantIndex;Be.current=setTimeout(()=>{const{rawSections:c,parsedSections:S,decofile:j,activePageKey:_,pageVariants:P,variantIndex:te}=Xe.current,C=c[s];if(!C)return;const U=S[s];if(!U)return;if(U.isSavedBlock){const Y=U.isLazy?C.section?.__resolveType??C.__resolveType:C.__resolveType;we.mutate({blockKey:Y,data:t},{onSuccess:()=>u?.(),onError:Q=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:Q.message}))});return}if(!_)return;const W={...j[_]},_e=[...c];if(U.isMultivariate){const Y=tt(C,U);if(!Y||!_)return;const Q=So(Y,a,t);_e[s]=bt(C,U,Q)}else if(U.isHidden){const Y=Xn(C.__resolveType),Q=Y?{...C.section}:{...C},Pe=Array.isArray(Q.variants)?[...Q.variants]:[];Pe[0]&&(Pe[0]={...Pe[0],value:t}),Q.variants=Pe,Y?_e[s]={...C,section:Q}:_e[s]=Q}else U.isLazy?_e[s]={...C,section:t}:_e[s]=t;if(P.length>1){const Y=W.sections,Q=[...Y?.variants??[]];Q[te]&&(Q[te]={...Q[te],value:_e}),W.sections={...Y,variants:Q}}else W.sections=_e;we.mutate({blockKey:_,data:W},{onSuccess:()=>u?.(),onError:Y=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:Y.message}))})},fn)},zs=t=>{N(t),G(0),$([]),H(S=>S+1);const s=q[t],a=Fe[t];if(!s||!a)return;if(a.isMultivariate){dt(s,a,0,t);return}const c=xt(s,a,r);if(!c){L(null),M(null),Ne(null),Re(null),Et(null,t,0);return}L(c.data),M(c.resolveType),Ne(null),Re(null),Et(null,t,0)},_n=t=>{const s=t;L(s),p!==null&&$s(s,p)},on=t=>{if(!V||!r||!l||!qe)return;const s={kind:"page",pageKey:V,pageName:String(qe.name??""),path:String(qe.path??"")},a=$n(r,s,l);a&&Qt.save(V,()=>{const c=Rs.getQueryData(Da.decofile(ws))?.[V];if(!c||typeof c!="object"||c===null||Array.isArray(c))return null;const S={...c,...Zt.current};return Zt.current={},t?.raw!==void 0?{...S,seo:t.raw}:t?.inner!==void 0?Wo(s,a,S,t.inner):S})},Hs=(t,s)=>{V&&(Zt.current[t]=s,on())},Gs=(t,s)=>{if(!V)return;const a=Mt([...q],t,s);p!==null&&(p===t?N(s):t<p&&s>=p?N(p-1):t>p&&s<=p&&N(p+1)),Ye(a)},Us=t=>{if(!V)return;const s=q.filter((a,c)=>c!==t);p===t?kt():p!==null&&p>t&&N(p-1),Ye(s)},Ws=t=>{if(!V)return;const s=q[t];if(!s)return;const a=[...q];a.splice(t+1,0,go(s)),p!==null&&p>t&&N(p+1),Ye(a)},qs=t=>{if(!V)return;const s=q[t],a=Fe[t];if(!s||!a||a.isMultivariate)return;const c=a.isHidden?fo(s):po(s);if(!c)return;const S=[...q];S[t]=c,p===t&&kt(),Ye(S)},Ys=t=>{if(!V)return;const s=q[t],a=Fe[t];if(!s||!a||a.isMultivariate)return;const c=mo(s);if(!c)return;const S=[...q];S[t]=c,p===t&&kt(),Ye(S)},Js=t=>{if(!V)return;const s=q[t],a=Fe[t];if(!s||!a?.isSavedBlock)return;const c=xt(s,a,r);if(!c?.data)return;const{name:S,...j}=c.data,_=[...q];a.isLazy?_[t]={...s,section:j}:_[t]=j,p===t&&kt(),Ye(_)},Qs=t=>{if(!V)return;const s=[...q,{__resolveType:t.resolveType}],a=s.length-1;Ye(s,{onSuccess:()=>{re(!1),N(a),G(0),$([]),H(_=>_+1);const c=s[a],S=Ut(s,r)[a];if(!c||!S)return;if(S.isMultivariate){dt(c,S,0);return}const j=xt(c,S,r);if(!j){L(null),M(null),Ne(null),Re(null);return}L(j.data),M(j.resolveType),Ne(null),Re(null)}})},jn=t=>{be.current=t.append,re(!0)},Xs=t=>{const s=be.current;if(!s){Qs(t);return}s({__resolveType:t.resolveType}),re(!1),be.current=null},Zs=t=>{if(p===null)return;const s=q[p],a=Fe[p];!s||!a?.isMultivariate||(G(t),$([]),H(c=>c+1),dt(s,a,t,p,!0))},ea=t=>{if(p===null||!V)return;const s=q[p],a=Fe[p];if(!s||!a?.isMultivariate)return;const c=tt(s,a);if(!c)return;const S=lo(c,t);if(!S){X.error(i("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const j=[...q];j[p]=bt(s,a,S);const _=S.variants;let P=F;t===F?P=Math.min(t,_.length-1):t<F&&(P=F-1),G(P),$([]),H(te=>te+1),dt(j[p],a,P),Ye(j)},ta=t=>{if(p===null||!V)return;const s=q[p],a=Fe[p];if(!s||!a?.isMultivariate)return;const c=tt(s,a);if(!c)return;const S=co(c,t),j=[...q];j[p]=bt(s,a,S);const _=t+1;G(_),$([]),H(P=>P+1),dt(j[p],a,_),Ye(j)},na=(t,s)=>{if(p===null||!V||t===s)return;const a=q[p],c=Fe[p];if(!a||!c?.isMultivariate)return;const S=tt(a,c);if(!S)return;const j=ro(S,t,s),_=[...q];_[p]=bt(a,c,j);let P=F;F===t?P=s:t<F&&s>=F?P=F-1:t>F&&s<=F&&(P=F+1),G(P),dt(_[p],c,P),Ye(_)},rn=t=>{const s=t??p;if(s===null||!V)return;const a=q[s],c=Fe[s];if(!a||!c)return;const S=so(a,c);if(!S){X.error(i("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const j=[...q];j[s]=S.section;const _=Ut(j,r)[s];if(!_?.isMultivariate){X.error(i("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}N(s),G(S.newVariantIndex),$([]),H(P=>P+1),dt(S.section,_,S.newVariantIndex,s),Ye(j)},sa=()=>{if(p===null||!V)return;const t=q[p],s=Fe[p];if(!t||!s?.isMultivariate)return;const a=tt(t,s);if(!a)return;const c=io(t,s,a);if(!c){X.error(i("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const S=[...q];S[p]=c;const j=Ut(S,r)[p];if(!j)return;G(0),Ne(null),Re(null),$([]),H(P=>P+1);const _=xt(c,j,r);_?(L(_.data),M(_.resolveType)):(L(null),M(null)),Et(null,p,0),Ye(S)},aa=async t=>{if(se===null||!V)return;const s=mn(t,r);if(s){X.error(s);return}const a=q[se],c=Fe[se];if(!a||!c)return;const S=xt(a,c,r);if(!S){X.error(i("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const j={...S.data,name:t};try{await we.mutateAsync({blockKey:t,data:j});const _=[...q];_[se]={__resolveType:t},await we.mutateAsync({blockKey:V,data:At(r,V,_,Ce,He)}),p===se&&kt(),ae(null),X.success(i("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),u?.()}catch(_){X.error(_ instanceof Error?_.message:i("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"))}},En=ut?.rule;if(Ft&&p===null&&J===null&&En){const{resolveType:t,formValue:s}=Tt(En,r??{},l??void 0);Z(t),I(s)}const It=l?Qa(l):[],kn=l&&r?Xa(l,r):[],oa=!Ve&&!!(m&&l&&r),ra=J&&l?Gt(J,l):null,Rt=()=>{st.current&&(clearTimeout(st.current),st.current=null),at.current&&(clearTimeout(at.current),at.current=null)},Dt=async(t,s)=>{if(!(vo(s,t,l)>0))try{await Xt.mutateAsync({blockKey:t})}catch(a){X.error(a instanceof Error?a.message:i("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"))}},Rn=t=>{st.current&&clearTimeout(st.current),st.current=setTimeout(()=>{const{activePageKey:s,decofile:a,variantIndex:c}=Xe.current;if(!s)return;const S={...a[s]},j={...S.sections},_=[...j.variants??[]],P=_[c],te=P?.rule;if(wt(te,a,l)){const C=te?.__resolveType??"",U=a[C],W=typeof U?.name=="string"?U.name:C,{__resolveType:_e,...Y}=t;we.mutate({blockKey:C,data:Vt(_e??"",Y,W)},{onSuccess:()=>u?.(),onError:Q=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:Q.message}))});return}P&&(_[c]={...P,rule:t}),S.sections={...j,variants:_},we.mutate({blockKey:s,data:S},{onSuccess:()=>u?.(),onError:C=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:C.message}))})},fn)},ia=t=>{Z(t);const s=t?Ln(t,l):{__resolveType:Bn};I(t?s:{}),Rn(s)},la=t=>{const s=t;I(s);const a=J?{__resolveType:J,...s}:{...s};Rn(a)},ca=async t=>{Rt();const{activePageKey:s,decofile:a,variantIndex:c}=Xe.current;if(!s)return;const S=a[s],j=S?.sections;if(!j||typeof j!="object"||Array.isArray(j))return;const _=j;if(!Array.isArray(_.variants))return;const P=[..._.variants],te=P[c];if(!te)return;const C=Pt(te.rule,a,l),U=qt(t);P[c]={...te,rule:U};const W={...a,[s]:{...S,sections:{..._,variants:P}}},{resolveType:_e,formValue:Y}=Tt(U,W,l??void 0);Z(_e),I(Y);try{await we.mutateAsync({blockKey:s,data:W[s]}),C&&C!==t&&await Dt(C,W),u?.()}catch(Q){X.error(Q instanceof Error?Q.message:i("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}},wn=t=>{at.current&&clearTimeout(at.current);const{selectedSectionIndex:s,sectionVariantIndex:a}=Xe.current;s!==null&&(at.current=setTimeout(()=>{const{rawSections:c,parsedSections:S,decofile:j,activePageKey:_,pageVariants:P,variantIndex:te}=Xe.current;if(!_)return;const C=c[s],U=S[s];if(!C||!U?.isMultivariate)return;const W=tt(C,U);if(!W)return;const Y=(W.variants??[])[a]?.rule;if(wt(Y,j,l)){const ve=Y?.__resolveType??"",Je=j[ve],rt=typeof Je?.name=="string"?Je.name:ve,{__resolveType:pt,...it}=t;we.mutate({blockKey:ve,data:Vt(pt??"",it,rt)},{onSuccess:()=>u?.(),onError:gt=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:gt.message}))});return}const Q=Kn(W,a,t),Pe=[...c];Pe[s]=bt(C,U,Q);const Ze=At(j,_,Pe,te,P);we.mutate({blockKey:_,data:Ze},{onSuccess:()=>u?.(),onError:ve=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:ve.message}))})},fn))},ua=t=>{Ne(t);const s=t?Ln(t,l):{__resolveType:Bn};Re(t?s:{}),wn(s)},da=t=>{const s=t;Re(s);const a=We?{__resolveType:We,...s}:{...s};wn(a)},ma=async t=>{Rt();const{selectedSectionIndex:s,sectionVariantIndex:a,rawSections:c,parsedSections:S,decofile:j,activePageKey:_,pageVariants:P,variantIndex:te}=Xe.current;if(s===null||!_)return;const C=c[s],U=S[s];if(!C||!U?.isMultivariate)return;const W=tt(C,U);if(!W)return;const _e=W.variants??[],Y=Pt(_e[a]?.rule,j,l),Q=qt(t),Pe=Kn(W,a,Q),Ze=[...c];Ze[s]=bt(C,U,Pe);const ve=At(j,_,Ze,te,P),Je={...j,[_]:ve},{resolveType:rt,formValue:pt}=Tt(Q,Je,l??void 0);Ne(rt),Re(pt);try{await we.mutateAsync({blockKey:_,data:ve}),Y&&Y!==t&&await Dt(Y,Je),u?.()}catch(it){X.error(it instanceof Error?it.message:i("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}};if(!Ve&&!qe)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:i("sectionsEditor.sectionsEditor.noPageFound",{currentPath:x})});if(Ve&&!en)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:i("sectionsEditor.sectionsEditor.globalBlockNotFound")});const mt=p!==null?Fe[p]??null:null,Vn=p!==null?q[p]:null,Nn=Vn&&mt?.isMultivariate?tt(Vn,mt):null,St=Nn?Mn(Nn,lt):[],ln=Math.min(F,Math.max(St.length-1,0)),$t=St[ln]??null,ft=mt?.isMultivariate===!0,Dn=p!==null&&mt!==null,zt=Dn&&(ft||!!(an&&ie)),fa=zt&&!Ve&&mt?.isSavedBlock===!0,ot=Ve||fa,pa=Ve?Sn:mt?.label??"",ga=We&&l?Gt(We,l):null,cn=zt&&(!Ve||ee.length>0)?Ve?[Sn,...ee]:[qe.name,mt.label,...ft&&$t?[$t.label]:[],...ee]:[],ha=T&&qe?[qe.name,"SEO",...Le]:[],Ht=T?ha:ot?cn.length>0?cn:[pa]:cn,va=!T&&!Ve&&ft&&ee.length===0,Tn=()=>{if(!V)return;Rt(),Be.current&&(clearTimeout(Be.current),Be.current=null);const t=r[V],s=ao(t.sections,q);if(!s)return;const a=oo(s);we.mutate({blockKey:V,data:{...t,sections:s}},{onSuccess:()=>{O(a),N(null),L(null),M(null),$([]),I(null),Z(null)},onError:c=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:c.message}))})},un=(t,s,a)=>{if(!V)return;Rt(),Be.current&&(clearTimeout(Be.current),Be.current=null);const c=r[V],S=c.sections;if(!S||typeof S!="object"||Array.isArray(S))return;const j=S;if(!Array.isArray(j.variants))return;const _=t([...j.variants]);if(!_)return;const P=xo(j,_),te={...r,[V]:{...c,sections:P}};we.mutate({blockKey:V,data:te[V]},{onSuccess:()=>{s?.(),a&&Dt(a,te)},onError:C=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:C.message}))})},Sa=t=>{oe(null),O(t),N(null),L(null),M(null),$([]);const s=He[t]?.rule,{resolveType:a,formValue:c}=Tt(s,r??{},l??void 0);Z(a),I(c),yn(He.map(S=>({rule:S.rule})),t)},xa=(t,s)=>{if(t===s)return;let a=Ce;Ce===t?a=s:t<Ce&&s>=Ce?a=Ce-1:t>Ce&&s<=Ce&&(a=Ce+1),O(a);const c=Mt(He.map(S=>({rule:S.rule})),t,s);yn(c,a),un(S=>Mt(S,t,s))},ba=t=>{const s=He[t]?.rule,a=Pt(s,r??{},l??void 0);un(c=>c.length<=1?null:(c.splice(t,1),c),()=>{He.length-1===1?O(0):t<Ce?O(Ce-1):t===Ce&&O(Math.max(0,t-1)),N(null),L(null),M(null),$([]),I(null),Z(null)},a)},ya=t=>{un(s=>bo(s,t),()=>{O(t+1),N(null),L(null),M(null),$([]),I(null),Z(null)})},_a=async(t,s)=>{Rt(),Be.current&&(clearTimeout(Be.current),Be.current=null);const a=Xe.current.activePageKey,c=Xe.current.decofile;if(!a)return;const S=c[a],j=S.sections;if(!j||typeof j!="object"||Array.isArray(j))return;const _=j;if(!Array.isArray(_.variants))return;const P=[..._.variants],te=P[t];if(!te?.rule||typeof te.rule!="object"){X.error(i("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const C=te.rule,U=s.trim();Lt(!0);try{if(!U){if(!wt(C,c,l)){oe(null);return}const Ze=C.__resolveType??"";P[t]={...te,rule:Fn(C,c,l)};const ve={...c,[a]:{...S,sections:{..._,variants:P}}};await we.mutateAsync({blockKey:a,data:ve[a]}),await Dt(Ze,ve),oe(null),u?.();return}const W=On(C,c,l);if(!W){X.error(i("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(W.blockKey){await we.mutateAsync({blockKey:W.blockKey,data:Vt(W.resolveType,W.data,U)}),oe(null),u?.();return}const _e=dn(U),Y=mn(_e,c);if(Y){X.error(Y);return}const Q=Vt(W.resolveType,W.data,U);let Pe=null;try{await we.mutateAsync({blockKey:_e,data:Q}),Pe=_e,P[t]={...te,rule:qt(_e)},await we.mutateAsync({blockKey:a,data:{...S,sections:{..._,variants:P}}}),Pe=null}catch(Ze){throw Pe&&await Xt.mutateAsync({blockKey:Pe}).catch(()=>{}),Ze}oe(null),X.success(i("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:U})),u?.()}catch(W){X.error(W instanceof Error?W.message:i("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Lt(!1)}},ja=async(t,s)=>{Rt(),Be.current&&(clearTimeout(Be.current),Be.current=null);const{selectedSectionIndex:a,rawSections:c,parsedSections:S,decofile:j,activePageKey:_,pageVariants:P,variantIndex:te}=Xe.current;if(a===null||!_)return;const C=c[a],U=S[a];if(!C||!U?.isMultivariate)return;const W=tt(C,U);if(!W)return;const _e=W.variants??[],Y=_e[t];if(!Y?.rule||typeof Y.rule!="object"){X.error(i("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const Q=Y.rule,Pe=s.trim();Lt(!0);const Ze=async ve=>{const Je={...W,variants:ve},rt=[...c];rt[a]=bt(C,U,Je);const pt=At(j,_,rt,te,P);return await we.mutateAsync({blockKey:_,data:pt}),{...j,[_]:pt}};try{if(!Pe){if(!wt(Q,j,l)){le(null);return}const gt=Q.__resolveType??"",Cn=[..._e];Cn[t]={...Y,rule:Fn(Q,j,l)};const Va=await Ze(Cn);await Dt(gt,Va),le(null),u?.();return}const ve=On(Q,j,l);if(!ve){X.error(i("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(ve.blockKey){await we.mutateAsync({blockKey:ve.blockKey,data:Vt(ve.resolveType,ve.data,Pe)}),le(null),u?.();return}const Je=dn(Pe),rt=mn(Je,j);if(rt){X.error(rt);return}const pt=Vt(ve.resolveType,ve.data,Pe);let it=null;try{await we.mutateAsync({blockKey:Je,data:pt}),it=Je;const gt=[..._e];gt[t]={...Y,rule:qt(Je)},await Ze(gt),it=null}catch(gt){throw it&&await Xt.mutateAsync({blockKey:it}).catch(()=>{}),gt}le(null),X.success(i("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:Pe})),u?.()}catch(ve){X.error(ve instanceof Error?ve.message:i("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Lt(!1)}},Pn=()=>{kt()},Ea=t=>{Ee(t),on({inner:t})},ka=t=>{ke(t),on({raw:t})},Ra=()=>{Ee(null),Te([])},wa=()=>B(t=>t+1),An=t=>{if(T){if(t===0){Qt.flush(),Ke(!1),Ee(null),ke(void 0),Te([]),B(a=>a+1),k?.();return}if(t===1){Te([]),B(a=>a+1);return}Te(Le.slice(0,t-1)),B(a=>a+1);return}if(Ve){$(ee.slice(0,t)),H(a=>a+1);return}if(t===0){Pn();return}if(t===1){$([]),H(a=>a+1);return}if(ft&&t===2){$([]),H(a=>a+1);return}const s=ft?2:1;$(ee.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:ot||zt||T?n.jsxs("div",{className:Oe("border-b px-3 py-2.5",ot&&"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:[Ht.length>1&&n.jsx("button",{type:"button",onClick:()=>An(yo(Ht.length,{isMultivariateSectionTop:va})),title:i("sectionsEditor.sectionsEditor.back"),"aria-label":i("sectionsEditor.sectionsEditor.back"),className:Oe("shrink-0 inline-flex size-6 items-center justify-center rounded-md transition-colors",ot?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:n.jsx(ts,{className:"size-4"})}),!Ve&&Ft&&ut&&n.jsxs("button",{type:"button",onClick:Pn,title:i("sectionsEditor.sectionsEditor.editingInVariant",{variant:ut.label}),className:Oe("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",br),children:[n.jsx(Es,{rule:Ct(ut.rule,r??{},l??void 0),matchers:It}),n.jsx("span",{className:"max-w-[160px] truncate",children:ut.label})]}),n.jsx("nav",{"aria-label":i("sectionsEditor.sectionsEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:Ht.map((t,s)=>{const a=s===Ht.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[s>0&&n.jsx(ns,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>An(s),title:t,className:Oe("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",a?ot?"font-semibold text-global-section-fg dark:text-global-section-fg-dark":"font-medium text-foreground":ot?"text-foreground/80":"text-muted-foreground",ot?"hover:bg-global-section/15":"hover:bg-accent hover:text-accent-foreground"),children:t})]},`${t}-${s}`)})}),ot&&n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(Vo,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(jt,{side:"bottom",className:"max-w-[260px]",children:i("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Dn&&!ft&&!mt?.isHidden&&V&&n.jsx(Wn,{onClick:()=>rn()})]}),ot&&n.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:i("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(_r,{pageKey:V,initialName:qe.name,initialPath:qe.path,onFieldChange:Hs})}),n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":i("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:()=>Ke(!0),children:n.jsx(ko,{size:14})})}),n.jsx(jt,{side:"bottom",children:i("sectionsEditor.sectionsEditor.editSeo")})]}),n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":i("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>D&&V?D(V):xe(!0),children:n.jsx(Ro,{size:14})})}),n.jsx(jt,{side:"bottom",children:i("sectionsEditor.sectionsEditor.viewJson")})]}),n.jsx(Wn,{onClick:Tn})]})}),T?n.jsx(Yt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:Bt&&V?n.jsx(Uo,{rawSeo:nn,innerSeo:xn,defaultResolveType:Bs,seoSchema:Fs,activeResolveType:sn,seoTypeOptions:Ls,formResetKey:ze,siteDefaultSeo:Os,onBreadcrumbChange:Te,onPersistRaw:ka,onInnerChange:Ea,onClearForm:Ra,onBumpFormKey:wa}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:i("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})}):zt?n.jsxs(Yt,{viewportRef:Ae,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[ft&&St.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(Za,{listKey:`${V??""}:${p??""}`,variants:St.map((t,s)=>({index:s,label:t.label})),selectedIndex:ln,onSelect:Zs,onRename:le,onDuplicate:ta,onDelete:ea,onRemoveAll:sa,onReorder:na,onAdd:()=>rn()}),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:i("sectionsEditor.sectionsEditor.variantRule")}),n.jsx(qn,{currentRt:We??"",currentLabel:Wt($t?.rule,r??{},lt,l??void 0),currentGlobalKey:Pt($t?.rule,r??{},l??void 0)??void 0,matchers:It,globals:kn,onSelect:ua,onSelectGlobal:ma,schema:ga,formValue:nt,onChange:da,formKey:`${p??"none"}:${ln}:${We??""}`,formWrapperClassName:"pt-1",meta:l??void 0,decofile:r,onSaveReferencedBlock:Kt,sandbox:Ot})]})]}),n.jsx(Un,{activeSchema:an,formValue:ie,formResetKey:Se,onFormChange:_n,onBreadcrumbChange:$,breadcrumbPath:ee,emptyMessage:i("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:l,decofile:r,onSaveReferencedBlock:Kt,sandbox:Ot,previewBaseUrl:m,onRequestAddSection:jn})]}):Ve?n.jsx(Yt,{viewportRef:Ae,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(Un,{activeSchema:an,formValue:ie,formResetKey:Se,onFormChange:_n,onBreadcrumbChange:$,breadcrumbPath:ee,emptyMessage:i("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:l,decofile:r,onSaveReferencedBlock:Kt,sandbox:Ot,previewBaseUrl:m,onRequestAddSection:jn})}):n.jsxs(Yt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[Ft&&V&&n.jsx(vr,{listKey:V,variants:He,activeIndex:Ce,decofile:r??{},meta:l,matchers:It,onSelect:Sa,onReorder:xa,onRename:oe,onDuplicate:ya,onDelete:ba,onAdd:Tn}),Ft&&J!==null&&n.jsxs("div",{className:Oe("px-3 border-b",fe?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>De(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":fe,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:i("sectionsEditor.sectionsEditor.variantRule")}),fe?n.jsx(wo,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(_o,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),fe&&n.jsx("div",{className:Oe("space-y-3",Nt&&"pointer-events-none opacity-50"),children:n.jsx(qn,{currentRt:J,currentLabel:Wt(ut?.rule,r??{},lt,l??void 0),currentGlobalKey:Pt(ut?.rule,r??{},l??void 0)??void 0,matchers:It,globals:kn,onSelect:ia,onSelectGlobal:ca,schema:ra,formValue:me,onChange:la,formKey:`${Ce}:${J??""}`,formWrapperClassName:"space-y-3",meta:l??void 0,decofile:r,onSaveReferencedBlock:Kt,sandbox:Ot})})]}),n.jsx("div",{className:"p-2 pt-3",children:n.jsx(lr,{listKey:`${V??""}-${Ce}`,rawSections:q,sections:Fe,meta:l,selectedIndex:p,onSelect:zs,onReorder:Gs,onDelete:Us,onDuplicate:Ws,onMakeReusable:ae,onToggleHidden:qs,onToggleLazy:Ys,onAddVariant:rn,onDetach:Js,onAddSection:()=>re(!0),canAddSection:oa})})]}),n.jsx(eo,{open:se!==null,onOpenChange:t=>{t||ae(null)},defaultBlockId:se!==null?dn(Fe[se]?.label??""):"",isPending:we.isPending,onSubmit:aa}),m&&n.jsx(Yo,{open:je,onOpenChange:t=>{re(t),t||(be.current=null)},meta:l,decofile:r,previewBaseUrl:m,onSelect:Xs}),pe&&V&&r&&n.jsx(to,{open:pe,onOpenChange:xe,pageKey:V,decofile:r}),ue!==null&&n.jsx(Hn,{open:!0,initialName:wt(He[ue]?.rule,r??{},l??void 0)?Wt(He[ue]?.rule,r??{},lt,l??void 0):"",autoLabel:lt(Ct(He[ue]?.rule,r??{},l??void 0)),isPending:Nt,onSubmit:async t=>{await _a(ue,t)},onOpenChange:t=>{!t&&!Nt&&oe(null)}}),de!==null&&n.jsx(Hn,{open:!0,initialName:wt(St[de]?.rule,r??{},l??void 0)?Wt(St[de]?.rule,r??{},lt,l??void 0):"",autoLabel:lt(Ct(St[de]?.rule,r??{},l??void 0)),isPending:Nt,onSubmit:async t=>{await ja(de,t)},onOpenChange:t=>{!t&&!Nt&&le(null)}})]})}export{uc as SectionsEditor};