decocms 4.123.9 → 4.125.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 (244) hide show
  1. package/dist/client/assets/{AlertCircle-nsAOhmc5.js → AlertCircle-DvfBlYrL.js} +1 -1
  2. package/dist/client/assets/{AreaChart-COvvWTHK.js → AreaChart-BWXnmVtl.js} +1 -1
  3. package/dist/client/assets/{ArrowRight-W78pWgya.js → ArrowRight-K0PcGsAS.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-D_vtmz11.js → ArrowUp-DldyVTkl.js} +1 -1
  5. package/dist/client/assets/{ArrowUpRight-CE7N_ssY.js → ArrowUpRight-DkqOJwYV.js} +1 -1
  6. package/dist/client/assets/{Check-CbFEdDFo.js → Check-6GOKlhGR.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-vxKWSGjq.js → CheckCircle-9L_WEhjd.js} +1 -1
  8. package/dist/client/assets/{ChevronDown-CXe6JgOB.js → ChevronDown-D6K15SiY.js} +1 -1
  9. package/dist/client/assets/{ChevronRight-5eA6ROzl.js → ChevronRight-BINVR94A.js} +1 -1
  10. package/dist/client/assets/{ChevronUp-ClePnk1p.js → ChevronUp-DXmlrw7j.js} +1 -1
  11. package/dist/client/assets/{Copy01-D_I4zLJq.js → Copy01-DWcfJ6do.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-DF3Be14k.js → DotsVertical-BcxA0H0A.js} +1 -1
  13. package/dist/client/assets/{Eye-CCFNdeEl.js → Eye-DxciQ4X_.js} +1 -1
  14. package/dist/client/assets/{FilterLines-CV0dxqQH.js → FilterLines-CCcxnxPP.js} +1 -1
  15. package/dist/client/assets/{Globe01-K7604lAF.js → Globe01-CyO9gcZQ.js} +1 -1
  16. package/dist/client/assets/{Globe04-SqHL90_b.js → Globe04-5OrQ3MTy.js} +1 -1
  17. package/dist/client/assets/{HardDrive-D5BssK7-.js → HardDrive-BzO9Ubxq.js} +1 -1
  18. package/dist/client/assets/{Image01-sKA_S9si.js → Image01-B3kPPocy.js} +1 -1
  19. package/dist/client/assets/{Key01-HnuEM_kB.js → Key01-Ck9xvZVC.js} +1 -1
  20. package/dist/client/assets/{LayoutLeft-B8qL2spL.js → LayoutLeft-D2sYGMB7.js} +1 -1
  21. package/dist/client/assets/{LinkExternal01-BIeTlaI1.js → LinkExternal01-zAHttdgm.js} +1 -1
  22. package/dist/client/assets/{LogOut01-Dzrbv7eq.js → LogOut01-BBickpvV.js} +1 -1
  23. package/dist/client/assets/{Monitor01-ahykGWr6.js → Monitor01-JOpdz6lu.js} +1 -1
  24. package/dist/client/assets/{Package-DMX0KLYy.js → Package-BRrTF7o_.js} +1 -1
  25. package/dist/client/assets/{Palette-9lXole3j.js → Palette-We4HTFm2.js} +1 -1
  26. package/dist/client/assets/{Play-anRYH6K1.js → Play-Cbcre7D7.js} +1 -1
  27. package/dist/client/assets/{Plus-DS3KKDHn.js → Plus-SIohDtsd.js} +1 -1
  28. package/dist/client/assets/{SearchLg-z8IAxAgb.js → SearchLg-DhgY47Db.js} +1 -1
  29. package/dist/client/assets/{SearchMd-w82MFsfG.js → SearchMd-B358aeAc.js} +1 -1
  30. package/dist/client/assets/{Settings02-DBXlrfF_.js → Settings02-qZ1nu4UL.js} +1 -1
  31. package/dist/client/assets/{Shield01-4mocQmSI.js → Shield01-B1SuVOA4.js} +1 -1
  32. package/dist/client/assets/{Star01-Bf8yuwps.js → Star01-1OoCGUWI.js} +1 -1
  33. package/dist/client/assets/{Stars01-ByFhj5mQ.js → Stars01-DdCa_LJT.js} +1 -1
  34. package/dist/client/assets/{Stars02-B2okzw6k.js → Stars02-CUwVycc9.js} +1 -1
  35. package/dist/client/assets/{Sun-eT24COyo.js → Sun-Mn-iAMZy.js} +1 -1
  36. package/dist/client/assets/{SwitchHorizontal01-BVz6HjlA.js → SwitchHorizontal01-C8dryIxw.js} +1 -1
  37. package/dist/client/assets/{Tool01-Bxryucq9.js → Tool01-ue8ZSTBu.js} +1 -1
  38. package/dist/client/assets/{Tool02-DXkhQkf7.js → Tool02-Dx39xjiX.js} +1 -1
  39. package/dist/client/assets/{Trash01-JNWsD9zI.js → Trash01-C_B2puls.js} +1 -1
  40. package/dist/client/assets/{TrendUp01-lmorDXaS.js → TrendUp01-DNzoZibO.js} +1 -1
  41. package/dist/client/assets/{Upload01-iZa_BxIK.js → Upload01-C71fAuEP.js} +1 -1
  42. package/dist/client/assets/{User01-BVJUnJoI.js → User01-5JLGItxs.js} +1 -1
  43. package/dist/client/assets/{Users01-ClFkkNN7.js → Users01-VJm2IsPn.js} +1 -1
  44. package/dist/client/assets/{Users03-DDFwhuFu.js → Users03-CAM8GcdD.js} +1 -1
  45. package/dist/client/assets/{X-CUF99Lsu.js → X-YK9anGVG.js} +1 -1
  46. package/dist/client/assets/{XCircle-BTCzfXYC.js → XCircle-nNktCk-D.js} +1 -1
  47. package/dist/client/assets/{XClose-BAe5iaCX.js → XClose-CB5HyGcC.js} +1 -1
  48. package/dist/client/assets/{Zap-DZcAzV7c.js → Zap-BhoH6xTC.js} +1 -1
  49. package/dist/client/assets/{ZapSquare-Bp70BKvB.js → ZapSquare-CVD42dNd.js} +1 -1
  50. package/dist/client/assets/{ZoomOut-QXkH5zvj.js → ZoomOut-BxkGtahn.js} +1 -1
  51. package/dist/client/assets/{access-gate-CkbeCvYc.js → access-gate-BYB6IOGG.js} +1 -1
  52. package/dist/client/assets/add-section-modal-DqdZxv2N.js +1 -0
  53. package/dist/client/assets/{agent-icon-CaI0GdpH.js → agent-icon-Dev4TdKP.js} +1 -1
  54. package/dist/client/assets/{agents-list-BFuEOYoR.js → agents-list-CtHKIF4N.js} +1 -1
  55. package/dist/client/assets/{ai-providers-BezjsaBy.js → ai-providers-D1ywcWRo.js} +1 -1
  56. package/dist/client/assets/{alert-BICZmvJ3.js → alert-D0utymhp.js} +1 -1
  57. package/dist/client/assets/{alert-dialog-BIM3ZQ61.js → alert-dialog-CjSul7G9.js} +1 -1
  58. package/dist/client/assets/{app-editor-BjHtIAfU.js → app-editor-0Y_2ILhi.js} +1 -1
  59. package/dist/client/assets/{auth-uY-yd_Qx.js → auth-BZRVg8ck.js} +1 -1
  60. package/dist/client/assets/{auth-catchall-DuLg4ksr.js → auth-catchall-DQH3O9pf.js} +1 -1
  61. package/dist/client/assets/{auth-entry-D_4ILbuF.js → auth-entry-DDYO7W-P.js} +1 -1
  62. package/dist/client/assets/{auth-split-layout-CCza2ifT.js → auth-split-layout-BUmwEgK6.js} +1 -1
  63. package/dist/client/assets/{authenticate-and-persist-oauth-CHKgbLri.js → authenticate-and-persist-oauth-D7GT9tA-.js} +1 -1
  64. package/dist/client/assets/{automation-list-row-BgIWcdHf.js → automation-list-row-Zno4svqN.js} +1 -1
  65. package/dist/client/assets/{automation-runs-vYAByajM.js → automation-runs-B5g626U_.js} +1 -1
  66. package/dist/client/assets/{automations-BLwuU6AI.js → automations-BiV1a-dd.js} +1 -1
  67. package/dist/client/assets/{autosend-Cu5ph7K1.js → autosend-C9-kwqep.js} +1 -1
  68. package/dist/client/assets/{avatar-Bipd5UEy.js → avatar-GcuRDpnC.js} +1 -1
  69. package/dist/client/assets/{badge-C3f1raKX.js → badge-DBpyOFLb.js} +1 -1
  70. package/dist/client/assets/{block-document-C8YGje15.js → block-document-BMeDg_Ed.js} +2 -2
  71. package/dist/client/assets/{brand-context-DyCI1w8L.js → brand-context-D1ZrmkfV.js} +1 -1
  72. package/dist/client/assets/{buckets-CZ2hMVao.js → buckets-d4y3uiG5.js} +1 -1
  73. package/dist/client/assets/{bulk-category-panel-DrnFvo5I.js → bulk-category-panel-DVeSnpfF.js} +1 -1
  74. package/dist/client/assets/{calendar-CaYhlf3J.js → calendar-DSyZYysh.js} +1 -1
  75. package/dist/client/assets/{capability-load-error-oSOBjNiW.js → capability-load-error-DSXapAP0.js} +1 -1
  76. package/dist/client/assets/{card-Cz1w-KeT.js → card-CrYaoQbI.js} +1 -1
  77. package/dist/client/assets/category-editor-wCZemtPn.js +1 -0
  78. package/dist/client/assets/{chat-context-DrudQqbN.js → chat-context-CH9M1POl.js} +1 -1
  79. package/dist/client/assets/{checkbox-HZxDl7MX.js → checkbox-ftPwjSb4.js} +1 -1
  80. package/dist/client/assets/{cli-auth-success-DEViHtnN.js → cli-auth-success-Dg_MCI_P.js} +1 -1
  81. package/dist/client/assets/{collection-detail-BFhVDLOx.js → collection-detail-BfPLSGGx.js} +1 -1
  82. package/dist/client/assets/{collection-display-button-DRpGuADu.js → collection-display-button-C8JfjXWc.js} +1 -1
  83. package/dist/client/assets/{collection-search-BKwi5gox.js → collection-search-Clr4qw7r.js} +1 -1
  84. package/dist/client/assets/{collection-table-wrapper-DZ2wVNQR.js → collection-table-wrapper-BnqxTdBn.js} +1 -1
  85. package/dist/client/assets/{collection-tabs-C2hvedKX.js → collection-tabs-BRp9MTcw.js} +1 -1
  86. package/dist/client/assets/{command-CzcPmc98.js → command-DbFzg0Ix.js} +1 -1
  87. package/dist/client/assets/{commerce-onboarding-B74-dzK0.js → commerce-onboarding-BV177pws.js} +1 -1
  88. package/dist/client/assets/{companions-core-CEPgmi_H.js → companions-core-BZvN_jY1.js} +1 -1
  89. package/dist/client/assets/{connect-C8HMBeok.js → connect-DKYbS5Jd.js} +1 -1
  90. package/dist/client/assets/{connect-desktop-dialog-CTgRGfG0.js → connect-desktop-dialog-iKO3Pf42.js} +1 -1
  91. package/dist/client/assets/{connection-D2Pupsdd.js → connection-BiZ69GQ3.js} +1 -1
  92. package/dist/client/assets/{connection-card-COtpZU4g.js → connection-card-Bmy_0W2Y.js} +1 -1
  93. package/dist/client/assets/{connection-detail-CxfBbaEV.js → connection-detail-DBy3LTGL.js} +1 -1
  94. package/dist/client/assets/{connection-form-helpers-CS6sBlKC.js → connection-form-helpers-kpZCeheC.js} +1 -1
  95. package/dist/client/assets/{connections-XXELJwpZ.js → connections-T8kJarOL.js} +1 -1
  96. package/dist/client/assets/{decopilot-sse-pool-DScO8nLg.js → decopilot-sse-pool-BZzIo0CP.js} +1 -1
  97. package/dist/client/assets/{dialog-C9LdhEJ8.js → dialog-BLLPuSkh.js} +1 -1
  98. package/dist/client/assets/{domain-settings-BrGk7au0.js → domain-settings-eu3OocOq.js} +1 -1
  99. package/dist/client/assets/{drawer-iJbxlBHN.js → drawer-CqgBx9ma.js} +1 -1
  100. package/dist/client/assets/dropdown-menu-BvspipA8.js +1 -0
  101. package/dist/client/assets/{empty-state-Cm4v9nCd.js → empty-state-BbT4pQZU.js} +1 -1
  102. package/dist/client/assets/{extract-connection-data-bvDVBCCK.js → extract-connection-data-BvB2j9Z0.js} +1 -1
  103. package/dist/client/assets/file-explorer-D4aNaiPS.js +2 -0
  104. package/dist/client/assets/{file-type-icon-BFz-fAWJ.js → file-type-icon-DqqHwwEy.js} +1 -1
  105. package/dist/client/assets/{files-DI8kH-Qq.js → files-D0dL8gBi.js} +1 -1
  106. package/dist/client/assets/{form-ujVNSHLD.js → form-DMLPR4HN.js} +1 -1
  107. package/dist/client/assets/{general-C2c5f_Cu.js → general-B46oiC8m.js} +1 -1
  108. package/dist/client/assets/{github-repo-picker-CjqIThyB.js → github-repo-picker-B9VuEVcu.js} +1 -1
  109. package/dist/client/assets/{hooks-DppbqdpU.js → hooks-CLS683Io.js} +1 -1
  110. package/dist/client/assets/index-2J9eNNF9.js +1 -0
  111. package/dist/client/assets/{index-CeTww2Kq.js → index-6Ysvu-Cc.js} +2 -2
  112. package/dist/client/assets/{index-Bq-qtjfv.js → index-B61_ZLgS.js} +1 -1
  113. package/dist/client/assets/{index-fi0f1C_U.js → index-BgxPtxOZ.js} +5 -5
  114. package/dist/client/assets/{index-CggwapSx.js → index-BoVzJ4Oy.js} +1 -1
  115. package/dist/client/assets/{index-BRynC73_.js → index-CAzwvRqV.js} +1 -1
  116. package/dist/client/assets/{index-DFtHrGGw.js → index-COMayckQ.js} +1 -1
  117. package/dist/client/assets/{index-By7vVH6Z.js → index-CX8Y224E.js} +1 -1
  118. package/dist/client/assets/{index-rt1Yq-xm.js → index-Cdxjphpo.js} +3 -3
  119. package/dist/client/assets/{index-B4pWthKK.js → index-CoOuRc44.js} +1 -1
  120. package/dist/client/assets/{index-rMEa2YJG.js → index-Cv18L-zj.js} +1 -1
  121. package/dist/client/assets/index-DBC4gRwz.css +1 -0
  122. package/dist/client/assets/{index-CWYTgJsi.js → index-DSdazh5c.js} +5 -5
  123. package/dist/client/assets/{index-H0oW1Dgr.js → index-Dcu3F3N4.js} +1 -1
  124. package/dist/client/assets/{index-redirect-AVPe1SSk.js → index-redirect-DEYmC6io.js} +1 -1
  125. package/dist/client/assets/{input-CB7a8Fqy.js → input-CSaE3mqO.js} +1 -1
  126. package/dist/client/assets/{integration-icon-CDDsl6LV.js → integration-icon-BRmcaiHQ.js} +1 -1
  127. package/dist/client/assets/{invite-member-dialog-BQzvNXpQ.js → invite-member-dialog-BGpnUN63.js} +1 -1
  128. package/dist/client/assets/{label-B6kQLTZ2.js → label-DSiEjeBl.js} +1 -1
  129. package/dist/client/assets/{layout-DAO8axcv.js → layout-DOWDs3vA.js} +1 -1
  130. package/dist/client/assets/{login-DEWE8IhN.js → login-C3pv5Pp1.js} +1 -1
  131. package/dist/client/assets/{mcp-oauth-BdVW-uBg.js → mcp-oauth-BLKedGJf.js} +1 -1
  132. package/dist/client/assets/{members-C1MitF9D.js → members-7wM8Q1PI.js} +1 -1
  133. package/dist/client/assets/{monaco-editor-BAb_NIlJ.js → monaco-editor-DHg2OOqj.js} +1 -1
  134. package/dist/client/assets/{monitoring-stats-row-BVQqegLf.js → monitoring-stats-row-C07WyAj8.js} +1 -1
  135. package/dist/client/assets/{multi-select-Cq2iiOsd.js → multi-select-uQi-y9F_.js} +1 -1
  136. package/dist/client/assets/{oauth-callback-DxYzI6p1.js → oauth-callback-DETpTouu.js} +1 -1
  137. package/dist/client/assets/{oauth-callback-ai-provider-BBvudKeu.js → oauth-callback-ai-provider-DBtin7_d.js} +1 -1
  138. package/dist/client/assets/{onboarding-CRXPhUzH.js → onboarding-D_d7iQsr.js} +1 -1
  139. package/dist/client/assets/{org-install-Bk1fDRvr.js → org-install-D1V6sW2s.js} +1 -1
  140. package/dist/client/assets/{org-layout-CfSOES_e.js → org-layout-DR6ZTN3U.js} +1 -1
  141. package/dist/client/assets/{organization-choice-COUGNAy0.js → organization-choice-CwxZ8J2d.js} +1 -1
  142. package/dist/client/assets/{orgs-DhsywB_d.js → orgs-Diyn7qQu.js} +1 -1
  143. package/dist/client/assets/{page-seo-form-B_rosXuT.js → page-seo-form-B0EsBx9R.js} +1 -1
  144. package/dist/client/assets/page-seo-sheet-CgivSSdq.js +1 -0
  145. package/dist/client/assets/{popover-KcB6zphY.js → popover-D6oxOcZ4.js} +1 -1
  146. package/dist/client/assets/{post-editor-DO-2PHbj.js → post-editor-COKBeatI.js} +1 -1
  147. package/dist/client/assets/{primitives-Cgj0Xdzj.js → primitives-F-Eqr0_L.js} +1 -1
  148. package/dist/client/assets/{profile-D8fy7_qz.js → profile-D3GHg9o_.js} +1 -1
  149. package/dist/client/assets/project-app-view-BSSBPOjC.js +1 -0
  150. package/dist/client/assets/record-editor-ca_oGIG1.js +1 -0
  151. package/dist/client/assets/{redirect-editor-COGZkybC.js → redirect-editor-C2vx7FrF.js} +1 -1
  152. package/dist/client/assets/registry-CanEck9j.js +2 -0
  153. package/dist/client/assets/{registry-layout-D_xzQ7SH.js → registry-layout-CS2KKIp_.js} +1 -1
  154. package/dist/client/assets/{reports-DfigvYnl.js → reports-CPc8oCju.js} +1 -1
  155. package/dist/client/assets/{require-capability-BShwVM7q.js → require-capability-DUILy85y.js} +1 -1
  156. package/dist/client/assets/{required-auth-layout-D1lQLs9o.js → required-auth-layout-DzCrTphn.js} +1 -1
  157. package/dist/client/assets/{reset-password-DgKPQ9Q0.js → reset-password-HhC7ke8n.js} +1 -1
  158. package/dist/client/assets/roles-DetAta3A.js +1 -0
  159. package/dist/client/assets/{search-input-CMG5kT0r.js → search-input-CWNriSyB.js} +1 -1
  160. package/dist/client/assets/{secrets-DOD_JAS7.js → secrets-D6-sih5_.js} +1 -1
  161. package/dist/client/assets/sections-editor-DfUCGibT.js +2 -0
  162. package/dist/client/assets/{select-Dj6isKXJ.js → select-BNu0UqXJ.js} +1 -1
  163. package/dist/client/assets/{select-model-DTCkZwPH.js → select-model-Cf_p0TLX.js} +1 -1
  164. package/dist/client/assets/{self-tool-result-Dyt4J_bB.js → self-tool-result-CAEPfhr5.js} +1 -1
  165. package/dist/client/assets/{seo-editor-8eiSAnPG.js → seo-editor-DZuvVKMY.js} +1 -1
  166. package/dist/client/assets/{settings-layout-Cov48Axa.js → settings-layout-BAM6vRJ3.js} +1 -1
  167. package/dist/client/assets/{settings-section-DJ-LhHo0.js → settings-section-Bqwkr4KE.js} +1 -1
  168. package/dist/client/assets/{shell-controls-DqhiNxKe.js → shell-controls-vaP2981n.js} +1 -1
  169. package/dist/client/assets/{shell-layout-CRMkjcoU.js → shell-layout-DOlkGNlz.js} +1 -1
  170. package/dist/client/assets/{sidebar-5EbmaKfu.js → sidebar-BE5rbtRj.js} +1 -1
  171. package/dist/client/assets/{skeleton-CPE6o86c.js → skeleton-CVpUTj9M.js} +1 -1
  172. package/dist/client/assets/{sso-CGCZT8eB.js → sso-BZQVFXpT.js} +1 -1
  173. package/dist/client/assets/{store-CyblY7RP.js → store-C8rEYFtK.js} +1 -1
  174. package/dist/client/assets/store-registry-DJc1sPuW.js +2 -0
  175. package/dist/client/assets/{studio-tools-DyE5uoU2.js → studio-tools-CB0BsNyF.js} +1 -1
  176. package/dist/client/assets/{switch-BrBVeEiU.js → switch-CgliPAJw.js} +1 -1
  177. package/dist/client/assets/{table-BMvSP1FF.js → table-CWKekb51.js} +1 -1
  178. package/dist/client/assets/{tabs-DNTKvnYl.js → tabs-CuZTXp8u.js} +1 -1
  179. package/dist/client/assets/{textarea-DTuWp8dQ.js → textarea-BWA7VPpy.js} +1 -1
  180. package/dist/client/assets/{toggle-group-HR0MkXiQ.js → toggle-group-DOA3nzfo.js} +1 -1
  181. package/dist/client/assets/{toolbar-BoNyAuGH.js → toolbar-B-UUEyB8.js} +1 -1
  182. package/dist/client/assets/{toolbar-icon-button-BrVVEPAi.js → toolbar-icon-button-ZEdqZB84.js} +1 -1
  183. package/dist/client/assets/{tooltip-eTUejMvR.js → tooltip-3_lehhdo.js} +1 -1
  184. package/dist/client/assets/{use-ai-providers-DXcmm9Eo.js → use-ai-providers-Dx4DLoDP.js} +1 -1
  185. package/dist/client/assets/{use-api-keys-P_3VMNpU.js → use-api-keys-rQGzgECJ.js} +1 -1
  186. package/dist/client/assets/{use-automations-CyQ634sI.js → use-automations-BlgSr3l1.js} +1 -1
  187. package/dist/client/assets/{use-autosave-DFf6mjHW.js → use-autosave-DN3i3kNV.js} +1 -1
  188. package/dist/client/assets/{use-capability-DrqR3_St.js → use-capability-CNwJHk2z.js} +1 -1
  189. package/dist/client/assets/{use-clock-tick-D5Vy5Dow.js → use-clock-tick-jpmK11cv.js} +1 -1
  190. package/dist/client/assets/{use-connection-DQmaXrND.js → use-connection-BiY49XSx.js} +1 -1
  191. package/dist/client/assets/{use-copy-CILQcfx6.js → use-copy-BcdmJlLN.js} +1 -1
  192. package/dist/client/assets/{use-create-virtual-mcp-DmqPJKm7.js → use-create-virtual-mcp-CfhMpfVO.js} +1 -1
  193. package/dist/client/assets/{use-debounced-autosave-Cpb_4lIc.js → use-debounced-autosave-DGkouUV3.js} +1 -1
  194. package/dist/client/assets/{use-debounced-value-ypDUqPbN.js → use-debounced-value-BCj3lKWl.js} +1 -1
  195. package/dist/client/assets/{use-deco-credits-BkHvXdZJ.js → use-deco-credits-DGCZEoDr.js} +1 -1
  196. package/dist/client/assets/{use-decopilot-events-BzrOUotP.js → use-decopilot-events-DVGi0LdZ.js} +1 -1
  197. package/dist/client/assets/{use-delete-connection-CcNSb7GW.js → use-delete-connection-WbHVrZDS.js} +1 -1
  198. package/dist/client/assets/{use-deployment-admin-DdvgTrBf.js → use-deployment-admin-B4X4V8G-.js} +1 -1
  199. package/dist/client/assets/{use-file-configs-CxWcieBs.js → use-file-configs-CvbfKRwx.js} +1 -1
  200. package/dist/client/assets/{use-infinite-scroll-unU2jvvl.js → use-infinite-scroll-D-NPdfDw.js} +1 -1
  201. package/dist/client/assets/{use-join-requests-BFxl6FoG.js → use-join-requests-CVc1HBst.js} +1 -1
  202. package/dist/client/assets/{use-mcp-auth-status-CmPv2iz1.js → use-mcp-auth-status-B_jWlS2Z.js} +1 -1
  203. package/dist/client/assets/{use-mcp-client-D0JJUSC_.js → use-mcp-client-ef4ksNyA.js} +1 -1
  204. package/dist/client/assets/{use-mcp-tools-C4VVy_zP.js → use-mcp-tools-D8KT2fVf.js} +1 -1
  205. package/dist/client/assets/{use-members-Bo_LaHq3.js → use-members-0GKD4bJn.js} +1 -1
  206. package/dist/client/assets/{use-mobile-BBy2stTu.js → use-mobile-B5jZs1VP.js} +1 -1
  207. package/dist/client/assets/{use-navigate-to-agent-CVCBKtMO.js → use-navigate-to-agent-DLUfBudT.js} +1 -1
  208. package/dist/client/assets/{use-org-auth-client-BuQouTOU.js → use-org-auth-client-DgCAgruj.js} +1 -1
  209. package/dist/client/assets/{use-org-sso-DTdBxyH-.js → use-org-sso-Dp3twfT1.js} +1 -1
  210. package/dist/client/assets/{use-organization-roles-B1MPKRxw.js → use-organization-roles-CbTmmfbh.js} +1 -1
  211. package/dist/client/assets/{use-organization-settings-BpIk1GGk.js → use-organization-settings-RSUliLhn.js} +1 -1
  212. package/dist/client/assets/{use-registry-app-DNGwSCwE.js → use-registry-app-BVjdDftO.js} +1 -1
  213. package/dist/client/assets/{use-registry-connections-DvPR6a-P.js → use-registry-connections-DC7a1mBV.js} +1 -1
  214. package/dist/client/assets/{use-secrets-Dy18M2CK.js → use-secrets-B07BZaq3.js} +1 -1
  215. package/dist/client/assets/{use-status-sounds-CcXDiWAj.js → use-status-sounds-kuYb8Hy6.js} +1 -1
  216. package/dist/client/assets/{use-view-mode-BaFDl4Go.js → use-view-mode-BIDCBuEA.js} +1 -1
  217. package/dist/client/assets/{use-virtual-mcp-PPiLqJsk.js → use-virtual-mcp-4fMvIeYr.js} +1 -1
  218. package/dist/client/assets/useInfiniteQuery-C-Py1iBX.js +1 -0
  219. package/dist/client/assets/{useQueries-Coq8StiF.js → useQueries-DZEnrhzP.js} +1 -1
  220. package/dist/client/assets/{useRouterState-ByV3ZJe_.js → useRouterState-i4JOavHA.js} +1 -1
  221. package/dist/client/assets/useSuspenseInfiniteQuery-_UDJx_DH.js +1 -0
  222. package/dist/client/assets/{users-DpjAuRyW.js → users-BqYgoBC0.js} +1 -1
  223. package/dist/client/assets/{variant-calendar-C9xzKBq4.js → variant-calendar-DlFvCzAU.js} +1 -1
  224. package/dist/client/assets/{view-mode-toggle-DtsG85-8.js → view-mode-toggle-D1vG0072.js} +1 -1
  225. package/dist/client/index.html +2 -2
  226. package/dist/server/cli.js +644 -640
  227. package/dist/server/migrate.js +106 -102
  228. package/dist/server/server.js +455 -455
  229. package/package.json +1 -1
  230. package/dist/client/assets/add-section-modal-BfT4ro60.js +0 -1
  231. package/dist/client/assets/category-editor-C_5gsuSF.js +0 -1
  232. package/dist/client/assets/dropdown-menu-Cga-_vD5.js +0 -1
  233. package/dist/client/assets/file-explorer-CXzu3lsX.js +0 -2
  234. package/dist/client/assets/index-BtlIRb9g.js +0 -1
  235. package/dist/client/assets/index-DUF5arcS.css +0 -1
  236. package/dist/client/assets/page-seo-sheet-C2Y0yi73.js +0 -1
  237. package/dist/client/assets/project-app-view-CNS5CIa_.js +0 -1
  238. package/dist/client/assets/record-editor-3BeUaMBD.js +0 -1
  239. package/dist/client/assets/registry-DAY9NKnP.js +0 -2
  240. package/dist/client/assets/roles-Bz0K8eHy.js +0 -1
  241. package/dist/client/assets/sections-editor-DW7FtQIr.js +0 -2
  242. package/dist/client/assets/store-registry-BQX4ge-T.js +0 -2
  243. package/dist/client/assets/useInfiniteQuery-CXTRQ-Dk.js +0 -1
  244. package/dist/client/assets/useSuspenseInfiniteQuery-CZk_wXzA.js +0 -1
@@ -1 +0,0 @@
1
- import{c as it,r as E,j as e,k as rt}from"./index-fi0f1C_U.js";import{m as mt,o as pt,p as st,q as at}from"./sidebar-5EbmaKfu.js";import{m as nt}from"./automation-runs-vYAByajM.js";import{r as lt,u as ct,a as dt,b as St,i as ft,f as ut,d as vt,P as ht,S as gt}from"./page-seo-form-B_rosXuT.js";import{r as xt}from"./index-CWYTgJsi.js";import"./LayoutLeft-B8qL2spL.js";import"./use-mobile-BBy2stTu.js";import"./X-CUF99Lsu.js";import"./tooltip-eTUejMvR.js";import"./select-Dj6isKXJ.js";import"./Check-CbFEdDFo.js";import"./ChevronDown-CXe6JgOB.js";import"./ChevronUp-ClePnk1p.js";import"./useInfiniteQuery-CXTRQ-Dk.js";import"./use-infinite-scroll-unU2jvvl.js";import"./use-connection-DQmaXrND.js";import"./use-mcp-client-D0JJUSC_.js";import"./auth-uY-yd_Qx.js";import"./use-virtual-mcp-PPiLqJsk.js";import"./card-Cz1w-KeT.js";import"./table-BMvSP1FF.js";import"./empty-state-Cm4v9nCd.js";import"./use-members-Bo_LaHq3.js";import"./use-org-auth-client-BuQouTOU.js";import"./use-clock-tick-D5Vy5Dow.js";import"./AlertCircle-nsAOhmc5.js";import"./CheckCircle-vxKWSGjq.js";import"./DotsVertical-DF3Be14k.js";import"./agent-icon-CaI0GdpH.js";import"./Tool01-Bxryucq9.js";import"./ArrowUp-D_vtmz11.js";import"./Settings02-DBXlrfF_.js";import"./Tool02-DXkhQkf7.js";import"./ArrowRight-W78pWgya.js";import"./ArrowUpRight-CE7N_ssY.js";import"./TrendUp01-lmorDXaS.js";import"./ZapSquare-Bp70BKvB.js";import"./ZoomOut-QXkH5zvj.js";import"./Users03-DDFwhuFu.js";import"./ChevronRight-5eA6ROzl.js";import"./Stars02-B2okzw6k.js";import"./Copy01-D_I4zLJq.js";import"./Globe01-K7604lAF.js";import"./Eye-CCFNdeEl.js";import"./FilterLines-CV0dxqQH.js";import"./Star01-Bf8yuwps.js";import"./Globe04-SqHL90_b.js";import"./SwitchHorizontal01-BVz6HjlA.js";import"./HardDrive-D5BssK7-.js";import"./Image01-sKA_S9si.js";import"./Key01-HnuEM_kB.js";import"./XCircle-BTCzfXYC.js";import"./LinkExternal01-BIeTlaI1.js";import"./LogOut01-Dzrbv7eq.js";import"./Monitor01-ahykGWr6.js";import"./Sun-eT24COyo.js";import"./Package-DMX0KLYy.js";import"./Palette-9lXole3j.js";import"./Play-anRYH6K1.js";import"./Plus-DS3KKDHn.js";import"./SearchLg-z8IAxAgb.js";import"./SearchMd-w82MFsfG.js";import"./Shield01-4mocQmSI.js";import"./Stars01-ByFhj5mQ.js";import"./Trash01-JNWsD9zI.js";import"./Upload01-iZa_BxIK.js";import"./User01-BVJUnJoI.js";import"./Users01-ClFkkNN7.js";import"./XClose-BAe5iaCX.js";import"./Zap-DZcAzV7c.js";import"./use-automations-CyQ634sI.js";import"./studio-tools-DyE5uoU2.js";import"./useSuspenseInfiniteQuery-CZk_wXzA.js";import"./avatar-Bipd5UEy.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-CILQcfx6.js";import"./file-type-icon-BFz-fAWJ.js";import"./dialog-C9LdhEJ8.js";import"./tab-id-BijBBRwE.js";import"./hooks-DppbqdpU.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-DScO8nLg.js";import"./chat-context-DrudQqbN.js";import"./autosend-Cu5ph7K1.js";import"./use-ai-providers-DXcmm9Eo.js";import"./location-BpLtHjTZ.js";import"./use-decopilot-events-BzrOUotP.js";import"./use-organization-settings-BpIk1GGk.js";import"./monaco-editor-BAb_NIlJ.js";import"./index-BRynC73_.js";import"./index-Bq-qtjfv.js";import"./calendar-CaYhlf3J.js";import"./shell-layout-CRMkjcoU.js";import"./required-auth-layout-D1lQLs9o.js";import"./use-org-sso-DTdBxyH-.js";import"./integration-icon-CDDsl6LV.js";import"./use-navigate-to-agent-CVCBKtMO.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-COvvWTHK.js";import"./form-ujVNSHLD.js";import"./label-B6kQLTZ2.js";import"./input-CB7a8Fqy.js";import"./switch-BrBVeEiU.js";import"./drawer-iJbxlBHN.js";import"./collection-search-BKwi5gox.js";import"./index-rt1Yq-xm.js";import"./get-initials-D-f_fDFw.js";import"./popover-KcB6zphY.js";import"./use-registry-app-DNGwSCwE.js";import"./use-mcp-tools-C4VVy_zP.js";import"./github-repo-scope-DjMZbiKa.js";import"./authenticate-and-persist-oauth-CHKgbLri.js";import"./mcp-oauth-BdVW-uBg.js";import"./extract-connection-data-bvDVBCCK.js";import"./metadata-dUsYcpuu.js";import"./dropdown-menu-Cga-_vD5.js";import"./command-CzcPmc98.js";import"./index-CggwapSx.js";import"./companions-core-CEPgmi_H.js";import"./tabs-DNTKvnYl.js";import"./toggle-group-HR0MkXiQ.js";import"./use-deco-credits-BkHvXdZJ.js";import"./alert-dialog-BIM3ZQ61.js";import"./toolbar-icon-button-BrVVEPAi.js";import"./skeleton-CPE6o86c.js";import"./github-repo-picker-CjqIThyB.js";import"./use-debounced-value-ypDUqPbN.js";import"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import"./connection-card-COtpZU4g.js";import"./use-registry-connections-DvPR6a-P.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-DTuWp8dQ.js";import"./connection-form-helpers-CS6sBlKC.js";import"./collection-tabs-C2hvedKX.js";import"./badge-C3f1raKX.js";import"./connect-desktop-dialog-CTgRGfG0.js";import"./select-model-DTCkZwPH.js";import"./checkbox-HZxDl7MX.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-DJ-LhHo0.js";import"./index-rMEa2YJG.js";import"./toolbar-BoNyAuGH.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-CcXDiWAj.js";import"./deco-site-production-url-CaKZ7xBn.js";import"./use-capability-DrqR3_St.js";import"./pt-BR-CLy76QW2.js";import"./use-mcp-auth-status-CmPv2iz1.js";import"./use-debounced-autosave-Cpb_4lIc.js";import"./index-B4pWthKK.js";import"./search-input-CMG5kT0r.js";import"./use-secrets-Dy18M2CK.js";import"./useQueries-Coq8StiF.js";import"./use-file-configs-CxWcieBs.js";import"./automation-list-row-BgIWcdHf.js";function xi(u){const t=it.c(46),{open:k,onOpenChange:N,orgSlug:Q,virtualMcpId:U,branch:W,decofile:G,meta:s,target:m,onSaved:X}=u,o=lt(G,m,s),P=m.kind==="site"?"site":m.pageKey,[Y,Z]=E.useState(P),[tt,i]=E.useState(null),[J,g]=E.useState(void 0),[x,y]=E.useState(0);Y!==P&&(Z(P),i(null),g(void 0),y(wt));const{persistSeo:a,persistRawSeo:I,flush:K,isPending:D}=ct({orgSlug:Q,virtualMcpId:U,branch:W,target:m,resolved:o,onSaved:X}),w=m.kind==="page",ot=w?o?.rawSeoData:void 0,v=J!==void 0?J:ot,et=w?dt(v)??void 0:void 0,h=tt??et??o?.seoData??{},p=o?St(h,o):null,n=p&&(!w||ft(v))?xt(p,s):null,_=m.kind==="page"?ut(G,s)?.seoData??void 0:void 0;let j;t[0]!==s?(j=vt(s),t[0]=s,t[1]=j):j=t[1];const M=j;let R;t[2]!==a||t[3]!==o||t[4]!==i?(R=r=>{if(!o)return;const L=r;i(L),a(L)},t[2]=a,t[3]=o,t[4]=i,t[5]=R):R=t[5];const V=R;let F;t[6]!==K||t[7]!==N?(F=r=>{r||K(),N(r)},t[6]=K,t[7]=N,t[8]=F):F=t[8];const q=F,z=m.kind==="site"?"Site SEO":"Page SEO",T=w&&o,A=m.kind==="site"&&o&&n,B=m.kind==="site"?"No site-level SEO block found.":o?"SEO schema not found for this page.":"Could not load page SEO.";let C;t[9]!==i?(C=()=>i(null),t[9]=i,t[10]=C):C=t[10];const H=C;let O;t[11]!==y?(O=()=>y(yt),t[11]=y,t[12]=O):O=t[12];const $=O;let l;t[13]!==z?(l=e.jsx(mt,{className:"text-sm font-semibold",children:z}),t[13]=z,t[14]=l):l=t[14];let c;t[15]!==D?(c=D&&e.jsx(rt,{size:14,className:"animate-spin text-muted-foreground"}),t[15]=D,t[16]=c):c=t[16];let d;t[17]!==l||t[18]!==c?(d=e.jsxs(pt,{className:"px-4 py-3 border-b flex-row items-center justify-between space-y-0",children:[l,c]}),t[17]=l,t[18]=c,t[19]=d):d=t[19];let S;t[20]!==p||t[21]!==$||t[22]!==H||t[23]!==M||t[24]!==v||t[25]!==h||t[26]!==B||t[27]!==x||t[28]!==V||t[29]!==I||t[30]!==a||t[31]!==o||t[32]!==n||t[33]!==i||t[34]!==g||t[35]!==T||t[36]!==A||t[37]!==_?(S=!o||!T&&!A?e.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:B}):e.jsx(nt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:e.jsx("div",{className:"px-6 py-4",children:e.jsx("div",{className:"mx-auto max-w-sm",children:T?e.jsx(ht,{rawSeo:v,innerSeo:h,defaultResolveType:M,seoSchema:n,activeResolveType:p,seoTypeOptions:o.seoTypeOptions,formResetKey:x,siteDefaultSeo:_,onPersistRaw:r=>{g(r),I(r)},onInnerChange:r=>{i(r),a(r)},onClearForm:H,onBumpFormKey:$}):n&&p&&e.jsx(gt,{schema:n,resolveType:p,value:h,formResetKey:x,onChange:V})})})}),t[20]=p,t[21]=$,t[22]=H,t[23]=M,t[24]=v,t[25]=h,t[26]=B,t[27]=x,t[28]=V,t[29]=I,t[30]=a,t[31]=o,t[32]=n,t[33]=i,t[34]=g,t[35]=T,t[36]=A,t[37]=_,t[38]=S):S=t[38];let f;t[39]!==d||t[40]!==S?(f=e.jsxs(st,{side:"right",className:"w-[400px] sm:max-w-[440px] p-0 gap-0",children:[d,S]}),t[39]=d,t[40]=S,t[41]=f):f=t[41];let b;return t[42]!==q||t[43]!==k||t[44]!==f?(b=e.jsx(at,{open:k,onOpenChange:q,children:f}),t[42]=q,t[43]=k,t[44]=f,t[45]=b):b=t[45],b}function yt(u){return u+1}function wt(u){return u+1}export{xi as SeoSheet};
@@ -1 +0,0 @@
1
- import{c as L,F as H,j as U}from"./index-fi0f1C_U.js";import{a as O,g as $,s as E}from"./automation-runs-vYAByajM.js";import{r as k,u as B}from"./use-mcp-client-D0JJUSC_.js";import{b as V,c as Y}from"./use-mcp-tools-C4VVy_zP.js";import{u as q}from"./index-CWYTgJsi.js";import{c as G}from"./monaco-editor-BAb_NIlJ.js";import{g as F,M as K,a as D}from"./index-Bq-qtjfv.js";import{b as W,a as z}from"./chat-context-DrudQqbN.js";import{u as J}from"./shell-layout-CRMkjcoU.js";import{O as Q}from"./tab-id-BijBBRwE.js";import"./select-Dj6isKXJ.js";import"./tooltip-eTUejMvR.js";import"./Check-CbFEdDFo.js";import"./ChevronDown-CXe6JgOB.js";import"./ChevronUp-ClePnk1p.js";import"./useInfiniteQuery-CXTRQ-Dk.js";import"./use-infinite-scroll-unU2jvvl.js";import"./use-connection-DQmaXrND.js";import"./use-virtual-mcp-PPiLqJsk.js";import"./card-Cz1w-KeT.js";import"./sidebar-5EbmaKfu.js";import"./LayoutLeft-B8qL2spL.js";import"./use-mobile-BBy2stTu.js";import"./X-CUF99Lsu.js";import"./table-BMvSP1FF.js";import"./empty-state-Cm4v9nCd.js";import"./use-members-Bo_LaHq3.js";import"./use-org-auth-client-BuQouTOU.js";import"./use-clock-tick-D5Vy5Dow.js";import"./AlertCircle-nsAOhmc5.js";import"./CheckCircle-vxKWSGjq.js";import"./DotsVertical-DF3Be14k.js";import"./agent-icon-CaI0GdpH.js";import"./Tool01-Bxryucq9.js";import"./ArrowUp-D_vtmz11.js";import"./Settings02-DBXlrfF_.js";import"./Tool02-DXkhQkf7.js";import"./ArrowRight-W78pWgya.js";import"./ArrowUpRight-CE7N_ssY.js";import"./TrendUp01-lmorDXaS.js";import"./ZapSquare-Bp70BKvB.js";import"./ZoomOut-QXkH5zvj.js";import"./Users03-DDFwhuFu.js";import"./ChevronRight-5eA6ROzl.js";import"./Stars02-B2okzw6k.js";import"./Copy01-D_I4zLJq.js";import"./Globe01-K7604lAF.js";import"./Eye-CCFNdeEl.js";import"./FilterLines-CV0dxqQH.js";import"./Star01-Bf8yuwps.js";import"./Globe04-SqHL90_b.js";import"./SwitchHorizontal01-BVz6HjlA.js";import"./HardDrive-D5BssK7-.js";import"./Image01-sKA_S9si.js";import"./Key01-HnuEM_kB.js";import"./XCircle-BTCzfXYC.js";import"./LinkExternal01-BIeTlaI1.js";import"./LogOut01-Dzrbv7eq.js";import"./Monitor01-ahykGWr6.js";import"./Sun-eT24COyo.js";import"./Package-DMX0KLYy.js";import"./Palette-9lXole3j.js";import"./Play-anRYH6K1.js";import"./Plus-DS3KKDHn.js";import"./SearchLg-z8IAxAgb.js";import"./SearchMd-w82MFsfG.js";import"./Shield01-4mocQmSI.js";import"./Stars01-ByFhj5mQ.js";import"./Trash01-JNWsD9zI.js";import"./Upload01-iZa_BxIK.js";import"./User01-BVJUnJoI.js";import"./Users01-ClFkkNN7.js";import"./XClose-BAe5iaCX.js";import"./Zap-DZcAzV7c.js";import"./use-automations-CyQ634sI.js";import"./studio-tools-DyE5uoU2.js";import"./useSuspenseInfiniteQuery-CZk_wXzA.js";import"./avatar-Bipd5UEy.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-CILQcfx6.js";import"./file-type-icon-BFz-fAWJ.js";import"./dialog-C9LdhEJ8.js";import"./hooks-DppbqdpU.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-DScO8nLg.js";import"./calendar-CaYhlf3J.js";import"./integration-icon-CDDsl6LV.js";import"./use-navigate-to-agent-CVCBKtMO.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-COvvWTHK.js";import"./form-ujVNSHLD.js";import"./label-B6kQLTZ2.js";import"./input-CB7a8Fqy.js";import"./auth-uY-yd_Qx.js";import"./drawer-iJbxlBHN.js";import"./collection-search-BKwi5gox.js";import"./autosend-Cu5ph7K1.js";import"./index-rt1Yq-xm.js";import"./get-initials-D-f_fDFw.js";import"./popover-KcB6zphY.js";import"./use-registry-app-DNGwSCwE.js";import"./github-repo-scope-DjMZbiKa.js";import"./authenticate-and-persist-oauth-CHKgbLri.js";import"./mcp-oauth-BdVW-uBg.js";import"./extract-connection-data-bvDVBCCK.js";import"./metadata-dUsYcpuu.js";import"./use-decopilot-events-BzrOUotP.js";import"./dropdown-menu-Cga-_vD5.js";import"./command-CzcPmc98.js";import"./index-CggwapSx.js";import"./use-organization-settings-BpIk1GGk.js";import"./companions-core-CEPgmi_H.js";import"./tabs-DNTKvnYl.js";import"./toggle-group-HR0MkXiQ.js";import"./use-deco-credits-BkHvXdZJ.js";import"./alert-dialog-BIM3ZQ61.js";import"./toolbar-icon-button-BrVVEPAi.js";import"./skeleton-CPE6o86c.js";import"./github-repo-picker-CjqIThyB.js";import"./use-debounced-value-ypDUqPbN.js";import"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import"./connection-card-COtpZU4g.js";import"./use-registry-connections-DvPR6a-P.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-DTuWp8dQ.js";import"./connection-form-helpers-CS6sBlKC.js";import"./collection-tabs-C2hvedKX.js";import"./badge-C3f1raKX.js";import"./use-ai-providers-DXcmm9Eo.js";import"./connect-desktop-dialog-CTgRGfG0.js";import"./select-model-DTCkZwPH.js";import"./checkbox-HZxDl7MX.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-DJ-LhHo0.js";import"./index-rMEa2YJG.js";import"./toolbar-BoNyAuGH.js";import"./location-BpLtHjTZ.js";import"./index-BRynC73_.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-CcXDiWAj.js";import"./deco-site-production-url-CaKZ7xBn.js";import"./use-capability-DrqR3_St.js";import"./pt-BR-CLy76QW2.js";import"./use-mcp-auth-status-CmPv2iz1.js";import"./use-debounced-autosave-Cpb_4lIc.js";import"./index-B4pWthKK.js";import"./search-input-CMG5kT0r.js";import"./switch-BrBVeEiU.js";import"./use-secrets-Dy18M2CK.js";import"./useQueries-Coq8StiF.js";import"./use-file-configs-CxWcieBs.js";import"./automation-list-row-BgIWcdHf.js";import"./required-auth-layout-D1lQLs9o.js";import"./use-org-sso-DTdBxyH-.js";const X="studio://navigate";function Z(M){const[t]=M;if(M.length!==1||t?.type!=="resource_link"||!t.uri.startsWith(X))return{isNavigate:!1};let o=null;try{o=new URL(t.uri).searchParams.get("main")}catch{}return{isNavigate:!0,tab:o&&Q.has(o)?o:null}}const tt={};function ot(M){const t=L.c(38),{client:o,resourceURI:I,tool:i,connectionId:p,orgId:a,args:v}=M,{sendMessage:C}=W(),{setAppContext:f,clearAppContext:l}=z(),{openSidePanel:g,openTab:s}=J(),r=`${p}:${i.name}`;let c;t[0]!==s?(c=x=>x==="inline"?(s("0"),"inline"):"fullscreen",t[0]=s,t[1]=c):c=t[1];const m=c,n=v??tt;let u;t[2]!==o||t[3]!==i.name||t[4]!==n?(u={client:o,toolName:i.name,toolArguments:n},t[2]=o,t[3]=i.name,t[4]=n,t[5]=u):u=t[5];const{data:e}=Y(u);let h;if(t[6]!==i._meta||t[7]!==i.name){const x=$(i._meta);h=E(i.name,x),t[6]=i._meta,t[7]=i.name,t[8]=h}else h=t[8];const A=h;let d;t[9]!==i.inputSchema?(d=i.inputSchema??{type:"object"},t[9]=i.inputSchema,t[10]=d):d=t[10];let R;t[11]!==A||t[12]!==d||t[13]!==i?(R={...i,name:A,inputSchema:d},t[11]=A,t[12]=d,t[13]=i,t[14]=R):R=t[14];const b=R;let _;t[15]!==g||t[16]!==s||t[17]!==C?(_=x=>{const j=Z(x.content);if(j.isNavigate){j.tab&&s(j.tab);return}const w=G(x.content);w.content.length>0&&(g("chat"),C({tiptapDoc:w}))},t[15]=g,t[16]=s,t[17]=C,t[18]=_):_=t[18];const y=_;let P;t[19]!==b?(P={tool:b},t[19]=b,t[20]=P):P=t[20];let N;t[21]!==f||t[22]!==r?(N=x=>f(r,x),t[21]=f,t[22]=r,t[23]=N):N=t[23];let T;t[24]!==l||t[25]!==r?(T=()=>l(r),t[24]=l,t[25]=r,t[26]=T):T=t[26];let S;return t[27]!==o||t[28]!==y||t[29]!==m||t[30]!==a||t[31]!==I||t[32]!==P||t[33]!==N||t[34]!==T||t[35]!==n||t[36]!==e?(S=U.jsx(K,{resourceURI:I,orgId:a,toolInfo:P,toolInput:n,toolResult:e,displayMode:"fullscreen",minHeight:D.fullscreen.minHeight,maxHeight:D.fullscreen.maxHeight,client:o,onMessage:y,onUpdateModelContext:N,onTeardown:T,onRequestDisplayMode:m,className:"h-full"}),t[27]=o,t[28]=y,t[29]=m,t[30]=a,t[31]=I,t[32]=P,t[33]=N,t[34]=T,t[35]=n,t[36]=e,t[37]=S):S=t[37],S}function Xi(M){const t=L.c(24),{connectionId:o,toolName:I,args:i}=M,{org:p}=H(),a=q();let v;t[0]!==o||t[1]!==a?(v=k(o)&&a.vmEntry?.sandboxProviderKind==="user-desktop"&&a.previewUrl?`${a.previewUrl.replace(/\/+$/,"")}/api/mcp`:void 0,t[0]=o,t[1]=a,t[2]=v):v=t[2];const C=v;let f;t[3]!==o||t[4]!==C||t[5]!==p.id||t[6]!==p.slug?(f={connectionId:o,orgId:p.id,orgSlug:p.slug,mcpUrl:C},t[3]=o,t[4]=C,t[5]=p.id,t[6]=p.slug,t[7]=f):f=t[7];const l=B(f);let g;t[8]!==l?(g={client:l},t[8]=l,t[9]=g):g=t[9];const{data:s}=V(g);let r,c,m;t[10]!==I||t[11]!==s.tools?(r=O(decodeURIComponent(I)),m=s.tools.find(e=>e.name===r)??s.tools.find(e=>{const h=$(e._meta);if(!h)return!1;if(E(e.name,h)===r)return!0;const d=E(r,h);return d!==r&&e.name===d}),c=m?._meta?F(m._meta):void 0,t[10]=I,t[11]=s.tools,t[12]=r,t[13]=c,t[14]=m):(r=t[12],c=t[13],m=t[14]);const n=c;if(!m||!n){let e;return t[15]!==r?(e=U.jsx("div",{className:"flex items-center justify-center h-full w-full",children:U.jsxs("p",{className:"text-sm text-muted-foreground",children:['Tool "',r,'" not found or has no UI']})}),t[15]=r,t[16]=e):e=t[16],e}let u;return t[17]!==i||t[18]!==l||t[19]!==o||t[20]!==p.id||t[21]!==n||t[22]!==m?(u=U.jsx(ot,{client:l,resourceURI:n,tool:m,connectionId:o,orgId:p.id,args:i}),t[17]=i,t[18]=l,t[19]=o,t[20]=p.id,t[21]=n,t[22]=m,t[23]=u):u=t[23],u}export{Xi as AppViewContent};
@@ -1 +0,0 @@
1
- import{c as L,b as z,j as r}from"./index-fi0f1C_U.js";import{I as A}from"./input-CB7a8Fqy.js";import{L as F}from"./label-B6kQLTZ2.js";import{S as R,a as O,b as V,c as D,d as J}from"./select-Dj6isKXJ.js";import{T as M}from"./textarea-DTuWp8dQ.js";import{v as $,w as q,x as G,o as H,z as Q,I as U}from"./index-CWYTgJsi.js";import{s as I}from"./primitives-Cgj0Xdzj.js";import{u as W}from"./use-autosave-DFf6mjHW.js";import"./tooltip-eTUejMvR.js";import"./Check-CbFEdDFo.js";import"./ChevronDown-CXe6JgOB.js";import"./ChevronUp-ClePnk1p.js";import"./ArrowUp-D_vtmz11.js";import"./chat-context-DrudQqbN.js";import"./autosend-Cu5ph7K1.js";import"./hooks-DppbqdpU.js";import"./use-mcp-client-D0JJUSC_.js";import"./auth-uY-yd_Qx.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-DScO8nLg.js";import"./studio-tools-DyE5uoU2.js";import"./use-virtual-mcp-PPiLqJsk.js";import"./use-ai-providers-DXcmm9Eo.js";import"./location-BpLtHjTZ.js";import"./tab-id-BijBBRwE.js";import"./use-decopilot-events-BzrOUotP.js";import"./use-organization-settings-BpIk1GGk.js";import"./automation-runs-vYAByajM.js";import"./useInfiniteQuery-CXTRQ-Dk.js";import"./use-infinite-scroll-unU2jvvl.js";import"./use-connection-DQmaXrND.js";import"./card-Cz1w-KeT.js";import"./sidebar-5EbmaKfu.js";import"./LayoutLeft-B8qL2spL.js";import"./use-mobile-BBy2stTu.js";import"./X-CUF99Lsu.js";import"./table-BMvSP1FF.js";import"./empty-state-Cm4v9nCd.js";import"./use-members-Bo_LaHq3.js";import"./use-org-auth-client-BuQouTOU.js";import"./use-clock-tick-D5Vy5Dow.js";import"./AlertCircle-nsAOhmc5.js";import"./CheckCircle-vxKWSGjq.js";import"./DotsVertical-DF3Be14k.js";import"./agent-icon-CaI0GdpH.js";import"./Tool01-Bxryucq9.js";import"./Settings02-DBXlrfF_.js";import"./Tool02-DXkhQkf7.js";import"./ArrowRight-W78pWgya.js";import"./ArrowUpRight-CE7N_ssY.js";import"./TrendUp01-lmorDXaS.js";import"./ZapSquare-Bp70BKvB.js";import"./ZoomOut-QXkH5zvj.js";import"./Users03-DDFwhuFu.js";import"./ChevronRight-5eA6ROzl.js";import"./Stars02-B2okzw6k.js";import"./Copy01-D_I4zLJq.js";import"./Globe01-K7604lAF.js";import"./Eye-CCFNdeEl.js";import"./FilterLines-CV0dxqQH.js";import"./Star01-Bf8yuwps.js";import"./Globe04-SqHL90_b.js";import"./SwitchHorizontal01-BVz6HjlA.js";import"./HardDrive-D5BssK7-.js";import"./Image01-sKA_S9si.js";import"./Key01-HnuEM_kB.js";import"./XCircle-BTCzfXYC.js";import"./LinkExternal01-BIeTlaI1.js";import"./LogOut01-Dzrbv7eq.js";import"./Monitor01-ahykGWr6.js";import"./Sun-eT24COyo.js";import"./Package-DMX0KLYy.js";import"./Palette-9lXole3j.js";import"./Play-anRYH6K1.js";import"./Plus-DS3KKDHn.js";import"./SearchLg-z8IAxAgb.js";import"./SearchMd-w82MFsfG.js";import"./Shield01-4mocQmSI.js";import"./Stars01-ByFhj5mQ.js";import"./Trash01-JNWsD9zI.js";import"./Upload01-iZa_BxIK.js";import"./User01-BVJUnJoI.js";import"./Users01-ClFkkNN7.js";import"./XClose-BAe5iaCX.js";import"./Zap-DZcAzV7c.js";import"./use-automations-CyQ634sI.js";import"./useSuspenseInfiniteQuery-CZk_wXzA.js";import"./avatar-Bipd5UEy.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-CILQcfx6.js";import"./file-type-icon-BFz-fAWJ.js";import"./dialog-C9LdhEJ8.js";import"./monaco-editor-BAb_NIlJ.js";import"./index-BRynC73_.js";import"./index-Bq-qtjfv.js";import"./calendar-CaYhlf3J.js";import"./shell-layout-CRMkjcoU.js";import"./required-auth-layout-D1lQLs9o.js";import"./use-org-sso-DTdBxyH-.js";import"./integration-icon-CDDsl6LV.js";import"./use-navigate-to-agent-CVCBKtMO.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-COvvWTHK.js";import"./form-ujVNSHLD.js";import"./drawer-iJbxlBHN.js";import"./collection-search-BKwi5gox.js";import"./index-rt1Yq-xm.js";import"./get-initials-D-f_fDFw.js";import"./popover-KcB6zphY.js";import"./use-registry-app-DNGwSCwE.js";import"./use-mcp-tools-C4VVy_zP.js";import"./github-repo-scope-DjMZbiKa.js";import"./authenticate-and-persist-oauth-CHKgbLri.js";import"./mcp-oauth-BdVW-uBg.js";import"./extract-connection-data-bvDVBCCK.js";import"./metadata-dUsYcpuu.js";import"./dropdown-menu-Cga-_vD5.js";import"./command-CzcPmc98.js";import"./index-CggwapSx.js";import"./companions-core-CEPgmi_H.js";import"./tabs-DNTKvnYl.js";import"./toggle-group-HR0MkXiQ.js";import"./use-deco-credits-BkHvXdZJ.js";import"./alert-dialog-BIM3ZQ61.js";import"./toolbar-icon-button-BrVVEPAi.js";import"./skeleton-CPE6o86c.js";import"./github-repo-picker-CjqIThyB.js";import"./use-debounced-value-ypDUqPbN.js";import"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import"./connection-card-COtpZU4g.js";import"./use-registry-connections-DvPR6a-P.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./connection-form-helpers-CS6sBlKC.js";import"./collection-tabs-C2hvedKX.js";import"./badge-C3f1raKX.js";import"./connect-desktop-dialog-CTgRGfG0.js";import"./select-model-DTCkZwPH.js";import"./checkbox-HZxDl7MX.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-DJ-LhHo0.js";import"./index-rMEa2YJG.js";import"./toolbar-BoNyAuGH.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-CcXDiWAj.js";import"./deco-site-production-url-CaKZ7xBn.js";import"./use-capability-DrqR3_St.js";import"./pt-BR-CLy76QW2.js";import"./use-mcp-auth-status-CmPv2iz1.js";import"./use-debounced-autosave-Cpb_4lIc.js";import"./index-B4pWthKK.js";import"./search-input-CMG5kT0r.js";import"./switch-BrBVeEiU.js";import"./use-secrets-Dy18M2CK.js";import"./useQueries-Coq8StiF.js";import"./use-file-configs-CxWcieBs.js";import"./automation-list-row-BgIWcdHf.js";const X={authors:[{key:"name",labelKey:"sandbox.recordEditor.fieldName",widget:"text"},{key:"type",labelKey:"sandbox.recordEditor.fieldType",widget:"select",options:[{value:"Person",labelKey:"sandbox.recordEditor.optionPerson"},{value:"Organization",labelKey:"sandbox.recordEditor.optionOrganization"}]},{key:"email",labelKey:"sandbox.recordEditor.fieldEmail",widget:"text",placeholderKey:"sandbox.recordEditor.placeholderEmail"},{key:"jobTitle",labelKey:"sandbox.recordEditor.fieldJobTitle",widget:"text"},{key:"company",labelKey:"sandbox.recordEditor.fieldCompany",widget:"text"},{key:"avatar",labelKey:"sandbox.recordEditor.fieldAvatar",widget:"image"}]},Y={authors:"sandbox.recordEditor.titleAuthor"};function Xr(C){const t=L.c(40),{orgSlug:K,virtualMcpId:h,branch:w,kind:a,blockKey:g,block:f}=C,i=z(),P=$(h);let b;t[0]!==w||t[1]!==K||t[2]!==P||t[3]!==h?(b={orgSlug:K,virtualMcpId:h,branch:w,packagePath:P},t[0]=w,t[1]=K,t[2]=P,t[3]=h,t[4]=b):b=t[4];const p=q(b);let k;t[5]!==f||t[6]!==a?(k=G(f,a),t[5]=f,t[6]=a,t[7]=k):k=t[7];const B=k;let v;t[8]!==g||t[9]!==a||t[10]!==p?(v=l=>{p.mutate({blockKey:g,data:Q(g,a,l)})},t[8]=g,t[9]=a,t[10]=p,t[11]=v):v=t[11];const[e,S]=W(B,v);let j;t[12]!==e||t[13]!==S?(j=(l,o)=>S({...e,[l]:o}),t[12]=e,t[13]=S,t[14]=j):j=t[14];const s=j,N=Y[a];let n;t[15]!==i||t[16]!==N?(n=i(N),t[15]=i,t[16]=N,t[17]=n):n=t[17];let c;t[18]!==n?(c=r.jsx("span",{className:"text-sm font-medium",children:n}),t[18]=n,t[19]=c):c=t[19];let d;t[20]!==p.isError||t[21]!==p.isPending?(d=r.jsx(H,{isPending:p.isPending,isError:p.isError}),t[20]=p.isError,t[21]=p.isPending,t[22]=d):d=t[22];let y;t[23]!==c||t[24]!==d?(y=r.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[c,d]}),t[23]=c,t[24]=d,t[25]=y):y=t[25];const T=X[a];let x;if(t[26]!==e||t[27]!==s||t[28]!==i||t[29]!==T){let l;t[31]!==e||t[32]!==s||t[33]!==i?(l=o=>r.jsx("div",{className:"space-y-2",children:o.widget==="image"?r.jsx(U,{schema:{type:"string",format:"image-uri",title:i(o.labelKey)},value:e[o.key],onChange:m=>s(o.key,m),path:o.key,label:i(o.labelKey)}):o.widget==="select"?r.jsxs(r.Fragment,{children:[r.jsx(F,{htmlFor:o.key,children:i(o.labelKey)}),r.jsxs(R,{value:I(e[o.key])||o.options?.[0]?.value,onValueChange:m=>s(o.key,m),children:[r.jsx(O,{id:o.key,className:"h-10 w-full",children:r.jsx(V,{placeholder:i(o.labelKey)})}),r.jsx(D,{children:(o.options??[]).map(m=>r.jsx(J,{value:m.value,children:i(m.labelKey)},m.value))})]})]}):r.jsxs(r.Fragment,{children:[r.jsx(F,{htmlFor:o.key,children:i(o.labelKey)}),o.widget==="textarea"?r.jsx(M,{id:o.key,value:I(e[o.key]),onChange:m=>s(o.key,m.target.value),rows:3}):r.jsx(A,{id:o.key,value:I(e[o.key]),placeholder:o.placeholderKey?i(o.placeholderKey):void 0,onChange:m=>s(o.key,m.target.value),className:"h-10"})]})},o.key),t[31]=e,t[32]=s,t[33]=i,t[34]=l):l=t[34],x=T.map(l),t[26]=e,t[27]=s,t[28]=i,t[29]=T,t[30]=x}else x=t[30];let u;t[35]!==x?(u=r.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto px-6 py-6",children:r.jsx("div",{className:"mx-auto max-w-xl space-y-6",children:x})}),t[35]=x,t[36]=u):u=t[36];let E;return t[37]!==y||t[38]!==u?(E=r.jsxs("div",{className:"flex h-full flex-col",children:[y,u]}),t[37]=y,t[38]=u,t[39]=E):E=t[39],E}export{Xr as RecordEditor};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/registry-layout-D_xzQ7SH.js","assets/index-fi0f1C_U.js","assets/index-DUF5arcS.css","assets/Tool02-DXkhQkf7.js","assets/CheckCircle-vxKWSGjq.js","assets/Settings02-DBXlrfF_.js","assets/use-mcp-client-D0JJUSC_.js","assets/auth-uY-yd_Qx.js","assets/useInfiniteQuery-CXTRQ-Dk.js","assets/use-infinite-scroll-unU2jvvl.js","assets/studio-tools-DyE5uoU2.js","assets/badge-C3f1raKX.js","assets/input-CB7a8Fqy.js","assets/dropdown-menu-Cga-_vD5.js","assets/Check-CbFEdDFo.js","assets/ChevronRight-5eA6ROzl.js","assets/DotsVertical-DF3Be14k.js","assets/table-BMvSP1FF.js","assets/toggle-group-HR0MkXiQ.js","assets/use-view-mode-BaFDl4Go.js","assets/use-mobile-BBy2stTu.js","assets/FilterLines-CV0dxqQH.js","assets/Globe01-K7604lAF.js","assets/SearchMd-w82MFsfG.js","assets/dialog-C9LdhEJ8.js","assets/X-CUF99Lsu.js","assets/AlertCircle-nsAOhmc5.js","assets/Upload01-iZa_BxIK.js","assets/metadata-dUsYcpuu.js","assets/alert-dialog-BIM3ZQ61.js","assets/card-Cz1w-KeT.js","assets/Trash01-JNWsD9zI.js","assets/label-B6kQLTZ2.js","assets/select-Dj6isKXJ.js","assets/tooltip-eTUejMvR.js","assets/ChevronDown-CXe6JgOB.js","assets/ChevronUp-ClePnk1p.js","assets/switch-BrBVeEiU.js","assets/textarea-DTuWp8dQ.js","assets/ArrowRight-W78pWgya.js","assets/XCircle-BTCzfXYC.js","assets/checkbox-HZxDl7MX.js","assets/Eye-CCFNdeEl.js","assets/LinkExternal01-BIeTlaI1.js","assets/use-copy-CILQcfx6.js","assets/Copy01-D_I4zLJq.js","assets/Key01-HnuEM_kB.js","assets/Plus-DS3KKDHn.js","assets/mcp-oauth-BdVW-uBg.js","assets/Play-anRYH6K1.js"])))=>i.map(i=>d[i]);
2
- import{c as i,j as e,r as s,k as a,aF as o}from"./index-fi0f1C_U.js";import{R as m}from"./require-capability-BShwVM7q.js";import"./use-capability-DrqR3_St.js";import"./access-gate-CkbeCvYc.js";import"./capability-load-error-oSOBjNiW.js";const n=s.lazy(()=>o(()=>import("./registry-layout-D_xzQ7SH.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49])));function f(){const r=i.c(1);let t;return r[0]===Symbol.for("react.memo_cache_sentinel")?(t=e.jsx(m,{capability:"registry:manage",area:"the registry",children:e.jsx(s.Suspense,{fallback:e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx(a,{size:20,className:"animate-spin text-muted-foreground"})}),children:e.jsx(n,{})})}),r[0]=t):t=r[0],t}export{f as default};
@@ -1 +0,0 @@
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,W as Xe,a1 as Ue,X as ae,a3 as Je,a4 as et,o as rt,Z as Ot,Y as jt,e as at,t as ve,p as Ke,y as ct,z as vt,E as Mt,d as Dt,u as yt}from"./index-fi0f1C_U.js";import{u as wt}from"./use-organization-roles-B1MPKRxw.js";import{u as $e}from"./use-org-auth-client-BuQouTOU.js";import{g as dt,a as Pt}from"./role-color-Dn2tXDDF.js";import{B as Me}from"./badge-C3f1raKX.js";import{A as mt,a as ut,c as ft,d as gt,b as ht,f as xt,g as pt,e as Tt}from"./alert-dialog-BIM3ZQ61.js";import{c as Lt,D as Gt,b as kt,a as Ut}from"./dropdown-menu-Cga-_vD5.js";import{a as Bt}from"./DotsVertical-DF3Be14k.js";import{s as Ye}from"./Plus-DS3KKDHn.js";import{s as Vt}from"./Trash01-JNWsD9zI.js";import{C as zt}from"./collection-table-wrapper-DZ2wVNQR.js";import{P as ie}from"./index-B4pWthKK.js";import{E as tt}from"./empty-state-Cm4v9nCd.js";import{S as Qe}from"./search-input-CMG5kT0r.js";import{P as Et,D as It}from"./ai-providers-logos-DD3qZ33J.js";import{I as Ze}from"./integration-icon-CDDsl6LV.js";import{u as Yt}from"./use-infinite-scroll-unU2jvvl.js";import{C as He}from"./checkbox-HZxDl7MX.js";import{b as Ft}from"./Settings02-DBXlrfF_.js";import{u as Kt}from"./useSuspenseInfiniteQuery-CZk_wXzA.js";import{u as $t,S as Qt}from"./use-mcp-client-D0JJUSC_.js";import{C as Zt}from"./collection-search-BKwi5gox.js";import{p as Ht}from"./connection-D2Pupsdd.js";import{u as _t}from"./use-members-Bo_LaHq3.js";import{g as Rt}from"./get-initials-D-f_fDFw.js";import{u as qt}from"./use-connection-DQmaXrND.js";import{u as Wt,c as Xt}from"./use-ai-providers-DXcmm9Eo.js";import{A as St}from"./avatar-Bipd5UEy.js";import{S as De}from"./switch-BrBVeEiU.js";import{b as ye,c as we,T as Pe,a as Le}from"./tooltip-eTUejMvR.js";import{S as st,a as lt,b as ot}from"./settings-section-DJ-LhHo0.js";import{t as Jt}from"./ChevronDown-CXe6JgOB.js";import{i as es}from"./ChevronRight-5eA6ROzl.js";import{i as nt}from"./X-CUF99Lsu.js";import{a as ts}from"./use-capability-DrqR3_St.js";import{A as ss}from"./access-gate-CkbeCvYc.js";import"./Check-CbFEdDFo.js";import"./table-BMvSP1FF.js";import"./ArrowUp-D_vtmz11.js";import"./sidebar-5EbmaKfu.js";import"./LayoutLeft-B8qL2spL.js";import"./use-mobile-BBy2stTu.js";import"./SearchMd-w82MFsfG.js";import"./Tool02-DXkhQkf7.js";import"./agent-icon-CaI0GdpH.js";import"./AlertCircle-nsAOhmc5.js";import"./Tool01-Bxryucq9.js";import"./ArrowRight-W78pWgya.js";import"./ArrowUpRight-CE7N_ssY.js";import"./TrendUp01-lmorDXaS.js";import"./ZapSquare-Bp70BKvB.js";import"./ZoomOut-QXkH5zvj.js";import"./Users03-DDFwhuFu.js";import"./CheckCircle-vxKWSGjq.js";import"./ChevronUp-ClePnk1p.js";import"./Stars02-B2okzw6k.js";import"./Copy01-D_I4zLJq.js";import"./Globe01-K7604lAF.js";import"./Eye-CCFNdeEl.js";import"./FilterLines-CV0dxqQH.js";import"./Star01-Bf8yuwps.js";import"./Globe04-SqHL90_b.js";import"./SwitchHorizontal01-BVz6HjlA.js";import"./HardDrive-D5BssK7-.js";import"./Image01-sKA_S9si.js";import"./Key01-HnuEM_kB.js";import"./XCircle-BTCzfXYC.js";import"./LinkExternal01-BIeTlaI1.js";import"./LogOut01-Dzrbv7eq.js";import"./Monitor01-ahykGWr6.js";import"./Sun-eT24COyo.js";import"./Package-DMX0KLYy.js";import"./Palette-9lXole3j.js";import"./Play-anRYH6K1.js";import"./SearchLg-z8IAxAgb.js";import"./Shield01-4mocQmSI.js";import"./Stars01-ByFhj5mQ.js";import"./Upload01-iZa_BxIK.js";import"./User01-BVJUnJoI.js";import"./Users01-ClFkkNN7.js";import"./XClose-BAe5iaCX.js";import"./Zap-DZcAzV7c.js";import"./auth-uY-yd_Qx.js";import"./studio-tools-DyE5uoU2.js";import"./card-Cz1w-KeT.js";import"./capability-load-error-oSOBjNiW.js";const qe="basic-usage",We=[{id:qe,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","LINK_CURRENT_GET","LINK_DISCONNECT","BRAND_CONTEXT_LIST","COLLECTION_THREADS_CREATE","COLLECTION_THREADS_LIST","COLLECTION_THREADS_GET","COLLECTION_THREADS_UPDATE","COLLECTION_THREADS_DELETE","COLLECTION_THREAD_MESSAGES_LIST","THREAD_BACKGROUND_TOOL_START","THREAD_SUBTASK_DELIVER","TASK_BOARD_ITEM_CREATE","TASK_BOARD_ITEM_LIST","TASK_BOARD_ITEM_UPDATE","TASK_BOARD_ITEM_DELETE","TASK_BOARD_ITEM_PRS_GET"]},{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_SEATS_GET","ORGANIZATION_SEATS_SET","ORGANIZATION_BILLING_CHECKOUT_START","ORGANIZATION_SEATS_PREVIEW","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"]},{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===qe)?.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===qe)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(He,{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(He,{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}),C=100,R=h.trim(),_=R?{operator:"or",conditions:[{field:["title"],operator:"contains",value:R},{field:["description"],operator:"contains",value:R}]}:void 0,A=!!l,b={..._&&{where:_},orderBy:[{field:["updated_at"],direction:"asc"}],limit:C,offset:0,...A&&{include_virtual:!0}},v=JSON.stringify(b),{data:S,fetchNextPage:O,hasNextPage:M,isFetchingNextPage:E}=Kt({queryKey:me.collectionListInfinite(p,d.id,"","CONNECTIONS",v),queryFn:async({pageParam:T=0})=>(await p.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{..._&&{where:_},orderBy:[{field:["updated_at"],direction:"asc"}],limit:C,offset:T,...A&&{include_virtual:!0}}})).structuredContent,initialPageParam:0,getNextPageParam:(T,G)=>{if(T?.hasMore)return G.reduce((Q,q)=>Q+(q?.items?.length??0),0)},staleTime:3e4}),N=S?.pages.flatMap(T=>T?.items??[])??[],D=Yt(O,M??!1,E),r=l?N.filter(T=>T.connection_type!=="VIRTUAL"?!0:Ht(T.connection_url)!==l):N,I=x.current,k=[...I.values()].map(T=>r.find(G=>G.id===T)).filter(T=>T!==void 0),L=r.filter(T=>!I.has(T.id)),z=[...k,...L],y=T=>{const G=t[T];return G!==void 0&&G.length>0},Y=z.filter(T=>{if(m==="all")return!0;const G=y(T.id);return m==="selected"?G:m==="unselected"?!G:!0}),[w,F]=$.useState(z[0]?.id??null),V=w?z.find(T=>T.id===w)??null:null,{data:U,isFetching:B}=Fe({queryKey:me.collectionItem(p,d.id,"","CONNECTIONS",w??""),queryFn:async()=>w?(await p.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:w}})).structuredContent?.item??null:null,enabled:!!w,staleTime:3e4}),Z=U?.tools??[],X=(T,G)=>t[T]?.includes(G)??!1,te=(T,G)=>{const Q=t[T]??[],q=Q.includes(G),ne={...t};if(q){const se=Q.filter(oe=>oe!==G);se.length===0?delete ne[T]:ne[T]=se}else ne[T]=[...Q,G];e(ne)},le=T=>{const G=T===w?Z:[];if(!G.length)return;const Q=t[T]??[],q=G.map(oe=>oe.name),ne=Q.length>0&&q.every(oe=>Q.includes(oe)),se={...t};ne?delete se[T]:(se[T]=q,F(T)),e(se)},K=T=>{F(T),u(!0)},H=()=>{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:Y.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:[Y.map(T=>{const G=w===T.id,Q=G?Z.length:0,q=t[T.id]?.length??0;return s.jsx(rs,{connection:{...T,tools:G?Z:T.tools},isSelected:G,hasToolsEnabled:y(T.id),activeToolsCount:q,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:H,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(we,{children:[s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:i})}),s.jsx(Le,{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 C=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 _;e[15]!==m?(_=m("settings.orgRoleDetail.allOrgPermissions"),e[15]=m,e[16]=_):_=e[16];let A;e[17]!==m?(A=m("settings.orgRoleDetail.grantFullAccessToAllFeaturesBelow"),e[17]=m,e[18]=A):A=e[18];let b;e[19]!==l||e[20]!==i||e[21]!==o?(b=()=>{i(!l),o([])},e[19]=l,e[20]=i,e[21]=o,e[22]=b):b=e[22];let v;e[23]!==l||e[24]!==h||e[25]!==m||e[26]!==b?(v=it(m,l,h,b),e[23]=l,e[24]=h,e[25]=m,e[26]=b,e[27]=v):v=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]!==_||e[35]!==A||e[36]!==v?(O=s.jsx(lt,{children:s.jsx(ot,{title:_,description:A,action:v,onClick:S})}),e[33]=S,e[34]=_,e[35]=A,e[36]=v,e[37]=O):O=e[37];let M;e[38]!==O||e[39]!==R?(M=s.jsx(st,{title:R,children:O}),e[38]=O,e[39]=R,e[40]=M):M=e[40],u=s.jsx("div",{children:s.jsxs("div",{className:"flex flex-col gap-10 py-4",children:[M,C.length===0&&a?s.jsx("p",{className:"text-sm text-muted-foreground py-4",children:m("settings.orgRoleDetail.noPermissionsMatch",{searchQuery:g})}):C.map(E=>{const{section:N,capabilities:D}=E;return s.jsx(st,{title:N,children:s.jsx(lt,{children:D.map(r=>{const I=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(vt,{size:12,className:"text-warning shrink-0"})]}),description:r.description,action:it(m,I,h,()=>d(r,I)),onClick:h?void 0:()=>d(r,I)},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 bt={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]??bt[t]??t}function Is(t){const e=t.indexOf(": ");return e>0&&e<32?t.slice(e+2):t}const Nt=30;function _s(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(),[C,R]=$.useState(d),_=d||C,A=R,[b,v]=$.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 M;if(e[4]!==g||e[5]!==m||e[6]!==l||e[7]!==_||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]!==b){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,b),r=c.length>b;let I;e[21]===Symbol.for("react.memo_cache_sentinel")?(I=()=>A(Ns),e[21]=I):I=e[21];const k=o??Et[n]??It;let L;e[22]!==i||e[23]!==k?(L=s.jsx(Ze,{icon:k,name:i,size:"sm"}),e[22]=i,e[23]=k,e[24]=L):L=e[24];let z;e[25]!==i?(z=s.jsx("span",{className:"text-sm font-medium truncate",children:i}),e[25]=i,e[26]=z):z=e[26];let y;e[27]!==L||e[28]!==z?(y=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[L,z]}),e[27]=L,e[28]=z,e[29]=y):y=e[29];const Y=p("settings.orgRoleDetail.enabledCount",{enabledCount:N,total:c.length});let w;e[30]!==Y?(w=s.jsx(Me,{variant:"secondary",className:"text-xs text-muted-foreground",children:Y}),e[30]=Y,e[31]=w):w=e[31];let F;e[32]!==_?(F=_?s.jsx(Jt,{size:16,className:"text-muted-foreground shrink-0"}):s.jsx(es,{size:16,className:"text-muted-foreground shrink-0"}),e[32]=_,e[33]=F):F=e[33];let V;e[34]!==w||e[35]!==F?(V=s.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[w,F]}),e[34]=w,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:I,children:[y,V]}),e[37]=V,e[38]=y,e[39]=U):U=e[39],M=s.jsxs("div",{className:"border border-border rounded-lg overflow-hidden bg-card",children:[U,_&&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:bs,children:x?s.jsx(ye,{children:s.jsxs(we,{children:[s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:s.jsx(De,{checked:Z,disabled:!0,onCheckedChange:Ss})})}),s.jsx(Le,{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:()=>v(Rs),children:p("settings.orgRoleDetail.showMore",{remaining:c.length-b})})]})]}),e[4]=g,e[5]=m,e[6]=l,e[7]=_,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]=b,e[18]=M}else M=e[18];return M}function Rs(t){return t+Nt}function Ss(){}function bs(t){return t.stopPropagation()}function Ns(t){return!t}function Cs(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 _;e[16]!==l.label?(_=I=>({...I,id:I.modelId,provider:l.label}),e[16]=l.label,e[17]=_):_=e[17];const A=f.filter(vs).map(_),b=h.trim().toLowerCase(),v=b?A.filter(I=>I.title.toLowerCase().includes(b)||I.id.toLowerCase().includes(b)||I.provider?.toLowerCase().includes(b)):A;if(v.length===0){p=null;break e}const S=new Map;for(const I of v){const k=Ts(I.id,l.providerId),L=S.get(k)??{models:[],logo:null};L.models.push({id:I.id,title:Is(I.title),logo:I.logo}),!L.logo&&I.logo&&(L.logo=I.logo),S.set(k,L)}const O=Array.from(S.entries()).map(js).sort(Os),M=O.length===1||b.length>0;x="flex flex-col gap-3";const E=Et[l.providerId]??It;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=bt[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(I=>s.jsx(_s,{connectionId:l.id,subProviderId:I.id,subProviderName:I.name,groupLogo:I.logo,models:I.models,allConnectionModelIds:A.map(As),selectedModels:n,allowAllModels:i,allConnectionModelsSelected:g,onToggleModel:o,onExitAllowAll:c,readOnly:m,defaultExpanded:M},I.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 C;e[26]!==a||e[27]!==u?(C=s.jsx("div",{className:a,children:u}),e[26]=a,e[27]=u,e[28]=C):C=e[28];let R;return e[29]!==x||e[30]!==d||e[31]!==C?(R=s.jsxs("div",{className:x,children:[d,C]}),e[29]=x,e[30]=d,e[31]=C,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 vs(t,e,l){return l.findIndex(n=>n.modelId===t.modelId)===e}function Ms(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 I=D.filter(k=>k!==N);I.length===0?delete r[E]:r[E]=I}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,C=!h&&"hover:bg-muted/50 cursor-pointer";let R;e[7]!==C?(R=W("flex items-center justify-between px-4 py-3 rounded-lg border border-border bg-card",C),e[7]=C,e[8]=R):R=e[8];let _;e[9]!==l||e[10]!==i||e[11]!==o||e[12]!==h?(_=()=>{if(h)return;const E=!l;i(E),E&&o({})},e[9]=l,e[10]=i,e[11]=o,e[12]=h,e[13]=_):_=e[13];let A;e[14]!==m?(A=m("settings.orgRoleDetail.allModels"),e[14]=m,e[15]=A):A=e[15];let b;e[16]!==A?(b=s.jsx("span",{className:"text-sm font-medium",children:A}),e[16]=A,e[17]=b):b=e[17];let v;e[18]!==l||e[19]!==i||e[20]!==o||e[21]!==h||e[22]!==m?(v=s.jsx("div",{onClick:ys,children:h?s.jsx(ye,{children:s.jsxs(we,{children:[s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:s.jsx(De,{checked:l,disabled:!0,onCheckedChange:Ds})})}),s.jsx(Le,{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]=v):v=e[23];let S;e[24]!==R||e[25]!==_||e[26]!==b||e[27]!==v?(S=s.jsxs("div",{className:R,onClick:_,children:[b,v]}),e[24]=R,e[25]=_,e[26]=b,e[27]=v,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(Cs,{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 M;return e[38]!==S||e[39]!==O?(M=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]=M):M=e[40],M}function Ds(){}function ys(t){return t.stopPropagation()}function ws(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}=_t();let d,p,C,R,_,A,b,v,S,O,M;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 w=x?.data?.members??[];let F;e[21]!==m?(F=K=>{const H=m.toLowerCase();return K.user?.name?.toLowerCase().includes(H)||K.user?.email?.toLowerCase().includes(H)},e[21]=m,e[22]=F):F=e[22];const V=w.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],C=U,p=mt,O=l,M=n,d=ut,v="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?(b=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]=b):b=e[42],R="flex-1 overflow-auto",_=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 H=K.role!=="owner",T=i.includes(K.id),G=a.includes(K.id);return s.jsxs("label",{className:W("flex items-center gap-3 p-2 rounded-lg",!H||T?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-muted/50"),children:[s.jsx(He,{checked:G||T,onCheckedChange:()=>{!H||T||u(Q=>Q.includes(K.id)?Q.filter(q=>q!==K.id):[...Q,K.id])},disabled:!H||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})]}),!H&&s.jsx(Me,{variant:"secondary",className:"shrink-0",children:c("settings.orgRoleDetail.owner")}),T&&H&&s.jsx(Me,{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]=C,e[13]=R,e[14]=_,e[15]=A,e[16]=b,e[17]=v,e[18]=S,e[19]=O,e[20]=M}else d=e[10],p=e[11],C=e[12],R=e[13],_=e[14],A=e[15],b=e[16],v=e[17],S=e[18],O=e[19],M=e[20];let E;e[43]!==R||e[44]!==_?(E=s.jsx("div",{className:R,children:_}),e[43]=R,e[44]=_,e[45]=E):E=e[45];let N;e[46]!==E||e[47]!==A||e[48]!==b?(N=s.jsxs("div",{className:A,children:[b,E]}),e[46]=E,e[47]=A,e[48]=b,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 I=a.length===0;let k;e[54]!==a.length||e[55]!==c?(k=c("settings.orgRoleDetail.addWithCount",{count:a.length}),e[54]=a.length,e[55]=c,e[56]=k):k=e[56];let L;e[57]!==C||e[58]!==I||e[59]!==k?(L=s.jsx(pt,{onClick:C,disabled:I,children:k}),e[57]=C,e[58]=I,e[59]=k,e[60]=L):L=e[60];let z;e[61]!==r||e[62]!==L?(z=s.jsxs(Tt,{className:"px-6 pb-6",children:[r,L]}),e[61]=r,e[62]=L,e[63]=z):z=e[63];let y;e[64]!==d||e[65]!==N||e[66]!==z||e[67]!==v||e[68]!==S?(y=s.jsxs(d,{className:v,children:[S,N,z]}),e[64]=d,e[65]=N,e[66]=z,e[67]=v,e[68]=S,e[69]=y):y=e[69];let Y;return e[70]!==p||e[71]!==y||e[72]!==O||e[73]!==M?(Y=s.jsx(p,{open:O,onOpenChange:M,children:y}),e[70]=p,e[71]=y,e[72]=O,e[73]=M,e[74]=Y):Y=e[74],Y}function Ps(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}=_t();let d,p,C;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 v=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=v.filter(S);let M;e[13]!==u?(M=r=>{const I=u.toLowerCase();return r.user?.name?.toLowerCase().includes(I)||r.user?.email?.toLowerCase().includes(I)},e[13]=u,e[14]=M):M=e[14];const E=O.filter(M);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;C="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(we,{children:[s.jsx(Pe,{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(Le,{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(I=>I!==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]=C}else d=e[8],p=e[9],C=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 _;e[21]!==l||e[22]!==n?(_=v=>n([...l,...v]),e[21]=l,e[22]=n,e[23]=_):_=e[23];let A;e[24]!==g||e[25]!==l||e[26]!==h||e[27]!==_?(A=s.jsx(ws,{open:g,onOpenChange:h,selectedMemberIds:l,onAddMembers:_}),e[24]=g,e[25]=l,e[26]=h,e[27]=_,e[28]=A):A=e[28];let b;return e[29]!==C||e[30]!==R||e[31]!==A?(b=s.jsxs("div",{className:C,children:[R,A]}),e[29]=C,e[30]=R,e[31]=A,e[32]=b):b=e[32],b}function Ls(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(Ps,{...t})}),e[1]=t,e[2]=n):n=e[2],n}const Gs={owner:[],admin:[],user:[]};function ks(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:Gs[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"?ks(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 zs(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(Ye,{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(Pe,{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(Le,{children:s.jsx("p",{children:h})}),e[8]=h,e[9]=p):p=e[9];let C;return e[10]!==d||e[11]!==p?(C=s.jsx(ye,{children:s.jsxs(we,{children:[d,p]})}),e[10]=d,e[11]=p,e[12]=C):C=e[12],C}let m;e[13]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(Ye,{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 Ys(t){const e=J.c(14),{locator:l}=Be(),n=$e(),i=qt();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,C=d.formState.isDirty,R=at({mutationFn:async r=>{const I=Bs(r,i),k=r.role.slug||r.role.label.toLowerCase().replace(/\s+/g,"-"),L=(r.role.slug==="owner"||r.role.slug==="admin"||r.role.slug==="user")&&!r.role.id,z=async(y,Y)=>{const w=n.filter(U=>U.role===(Y??y)).map(U=>U.id),F=r.memberIds.filter(U=>!w.includes(U)),V=w.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(L)return await z(r.role.slug),r;if(r.role.id){const y=r.role.label.toLowerCase().replace(/\s+/g,"-"),Y=r.role.slug,w=y!==Y,F=await g.organization.updateRole({roleId:r.role.id,data:{permission:I,...w?{roleName:y}:{}}});if(F?.error)throw new Error(F.error.message??o("settings.orgRoleDetail.somethingWentWrong"));return await z(w?y:Y,w?Y:void 0),w?{...r,role:{...r.role,slug:y}}:r}else{const y=await g.organization.createRole({role:k,permission:I});if(y?.error)throw new Error(y.error.message??o("settings.orgRoleDetail.somethingWentWrong"));for(const Y of r.memberIds){const w=await g.organization.updateMemberRole({memberId:Y,role:[k]});if(w?.error)throw new Error(w.error.message)}return{...r,role:{...r.role,id:y.data?.roleData?.id,slug:k}}}},onSuccess:(r,I)=>{h.invalidateQueries({queryKey:me.members(c)}),h.invalidateQueries({queryKey:me.organizationRoles(c)});const k=!I.role.id&&!I.role.slug,L=I.role.slug==="owner"&&!I.role.id;Ke(L?"role_members_updated":k?"role_created":"role_updated",{role_slug:I.role.slug??null}),ve.success(o(L?"settings.orgRoleDetail.membersUpdatedSuccessfully":k?"settings.orgRoleDetail.roleCreatedSuccessfully":"settings.orgRoleDetail.roleUpdatedSuccessfully")),d.reset(r),l(r.role.id)},onError:r=>{ve.error(r instanceof Error?r.message:o("settings.orgRoleDetail.failedToSaveRole"))}}),_=d.handleSubmit(r=>{if(!r.role.label.trim()){ve.error(o("settings.orgRoleDetail.roleNameIsRequired")),d.setFocus("role.label");return}R.mutate(r)}),A=!f,b=t.kind==="builtin"?t.role.charAt(0).toUpperCase()+t.role.slice(1):t.kind==="custom"?t.role.label:"",v=[...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(""),[M,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:_,disabled:R.isPending||!p||!C,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):Pt(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:b})]})}),s.jsx("div",{className:"flex items-center gap-2",children:v.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(zs,{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(Ms,{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(Ls,{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:M,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}=wt();let d;t[1]!==c?(d=j=>c({to:".",search:P=>({...P,role:j})}),t[1]=c,t[2]=d):d=t[2];const p=d;let C;e:{if(!h){C=null;break e}if(h==="new"){C={kind:"new"};break e}if(h.startsWith("builtin-")){C={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 P=u.find(j);C=P?{kind:"custom",role:P}:null}const R=C;let _;t[5]!==m?(_=me.members(m),t[5]=m,t[6]=_):_=t[6];let A;t[7]!==f?(A=()=>f.organization.listMembers(),t[7]=f,t[8]=A):A=t[8];let b;t[9]!==_||t[10]!==A?(b={queryKey:_,queryFn:A},t[9]=_,t[10]=A,t[11]=b):b=t[11];const{data:v}=Fe(b);let S;t[12]!==v?.data?.members?(S=v?.data?.members??[],t[12]=v?.data?.members,t[13]=S):S=t[13];const O=S;let M;t[14]!==O?(M=j=>O.filter(P=>P.role===j).length,t[14]=O,t[15]=M):M=t[15];const E=M;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 P=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 Ct=u.map(ee);if(N=[...P,...Ct],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 P=await f.organization.deleteRole({roleId:j});if(P?.error)throw new Error(P.error.message);return P?.data},t[26]=f,t[27]=D):D=t[27];const r=at({mutationFn:D,onSuccess:(j,P)=>{Ke("role_deleted",{role_id:P}),a.invalidateQueries({queryKey:me.members(m)}),a.invalidateQueries({queryKey:me.organizationRoles(m)}),ve.success(e("settings.roles.deletedSuccessfully")),x(),R?.kind==="custom"&&R.role.id===P&&p(void 0)},onError:Js});let I;t[28]!==e?(I=e("settings.roles.columnRole"),t[28]=e,t[29]=I):I=t[29];let k;t[30]!==I?(k={id:"role",header:I,render:Xs,cellClassName:"flex-1 min-w-0",sortable:!0},t[30]=I,t[31]=k):k=t[31];let L;t[32]!==e?(L=e("settings.roles.columnType"),t[32]=e,t[33]=L):L=t[33];let z;t[34]!==e?(z=j=>j.kind==="builtin"?s.jsx(Me,{variant:"secondary",className:"text-xs",children:e("settings.roles.builtIn")}):s.jsx(Me,{variant:"outline",className:"text-xs",children:e("settings.roles.custom")}),t[34]=e,t[35]=z):z=t[35];let y;t[36]!==L||t[37]!==z?(y={id:"type",header:L,render:z,cellClassName:"w-28 shrink-0"},t[36]=L,t[37]=z,t[38]=y):y=t[38];let Y;t[39]!==e?(Y=e("settings.roles.columnPermissions"),t[39]=e,t[40]=Y):Y=t[40];let w;t[41]!==e?(w=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 P=j.role,ee=[];return P.allowsAllStaticPermissions?ee.push(e("settings.roles.fullOrgAccess")):P.staticPermissionCount&&P.staticPermissionCount>0&&ee.push(e("settings.roles.orgPermsCount",{count:P.staticPermissionCount})),P.allowsAllConnections?ee.push(e("settings.roles.allConnections")):P.connectionCount&&P.connectionCount>0&&ee.push(e("settings.roles.connectionCount",{count:P.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]=w):w=t[42];let F;t[43]!==Y||t[44]!==w?(F={id:"permissions",header:Y,render:w,cellClassName:"flex-1 min-w-0"},t[43]=Y,t[44]=w,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(Lt,{children:[s.jsx(Gt,{asChild:!0,children:s.jsx(ce,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:qs,children:s.jsx(Bt,{size:16})})}),s.jsx(kt,{align:"end",onClick:Hs,children:s.jsxs(Ut,{variant:"destructive",onClick:()=>{const P=j.role;P.id&&o({id:P.id,label:P.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]!==k||t[53]!==y||t[54]!==F||t[55]!==U||t[56]!==B?(Z=[k,y,F,U,B],t[52]=k,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 P=j.role;p(P.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 P;return t[62]!==x||t[63]!==p?(P=()=>{x(),p(void 0)},t[62]=x,t[63]=p,t[64]=P):P=t[64],s.jsx(Ys,{target:R,onBack:j,onSaved:P},Ks(R))}let K;t[65]!==e?(K=e("settings.roles.pageTitle"),t[65]=e,t[66]=K):K=t[66];let H;t[67]!==K?(H=s.jsx(ie.Title,{children:K}),t[67]=K,t[68]=H):H=t[68];let T;t[69]!==e?(T=e("settings.roles.searchPlaceholder"),t[69]=e,t[70]=T):T=t[70];let G;t[71]===Symbol.for("react.memo_cache_sentinel")?(G=j=>{j.key==="Escape"&&(n(""),j.target.blur())},t[71]=G):G=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:G}),t[72]=l,t[73]=T,t[74]=Q):Q=t[74];let q;t[75]!==p?(q=()=>p("new"),t[75]=p,t[76]=q):q=t[76];let ne;t[77]===Symbol.for("react.memo_cache_sentinel")?(ne=s.jsx(Ye,{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]!==q||t[81]!==se?(oe=s.jsxs(ce,{onClick:q,children:[ne,se]}),t[80]=q,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(zt,{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]!==H||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:[H,ue,ge]})})}),t[94]=H,t[95]=ue,t[96]=ge,t[97]=he):he=t[97];const Ve=i!==null;let Ge;t[98]===Symbol.for("react.memo_cache_sentinel")?(Ge=j=>!j&&o(null),t[98]=Ge):Ge=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 ze=i?.label??"";let Te;t[103]!==e||t[104]!==ze?(Te=e("settings.roles.deleteRoleConfirm",{role:ze}),t[103]=e,t[104]=ze,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 Ie;t[108]!==pe||t[109]!==Ee?(Ie=s.jsxs(ht,{children:[pe,Ee]}),t[108]=pe,t[109]=Ee,t[110]=Ie):Ie=t[110];let _e;t[111]!==e?(_e=e("settings.roles.cancel"),t[111]=e,t[112]=_e):_e=t[112];let Re;t[113]!==_e?(Re=s.jsx(xt,{children:_e}),t[113]=_e,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 be;t[118]!==e?(be=e("settings.roles.delete"),t[118]=e,t[119]=be):be=t[119];let Ne;t[120]!==Se||t[121]!==be?(Ne=s.jsx(pt,{onClick:Se,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:be}),t[120]=Se,t[121]=be,t[122]=Ne):Ne=t[122];let Ce;t[123]!==Re||t[124]!==Ne?(Ce=s.jsxs(Tt,{children:[Re,Ne]}),t[123]=Re,t[124]=Ne,t[125]=Ce):Ce=t[125];let Ae;t[126]!==Ie||t[127]!==Ce?(Ae=s.jsxs(ut,{children:[Ie,Ce]}),t[126]=Ie,t[127]=Ce,t[128]=Ae):Ae=t[128];let Oe;t[129]!==Ve||t[130]!==Ae?(Oe=s.jsx(mt,{open:Ve,onOpenChange:Ge,children:Ae}),t[129]=Ve,t[130]=Ae,t[131]=Oe):Oe=t[131];let ke;return t[132]!==he||t[133]!==Oe?(ke=s.jsxs(ie,{children:[he,Oe]}),t[132]=he,t[133]=Oe,t[134]=ke):ke=t[134],ke}function Hs(t){return t.stopPropagation()}function qs(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)}),ve.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(Mt,{fallback:n,children:i}),t[5]=n,t[6]=o):o=t[6],o}function wo(){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{wo as default};
@@ -1,2 +0,0 @@
1
- import{c as He,b as rt,r as V,m as Fe,j as n,af as Gn,B as Je,k as Un,o as _a,t as Q,K as ja}from"./index-fi0f1C_U.js";import{a3 as Ea,a4 as ka,a5 as Ra,H as Wn,J as Yt,a6 as qn,a7 as Jn,K as Yn,P as Qn,i as Xn,a8 as wa,V as Zn,W as es,a9 as Va,aa as Na,G as Da,L as ts,M as At,Q as ns,U as ss,N as as,_ as os,ab as Ta,ac as Mt,ad as Pa,S as is,ae as it,af as Ca,ag as Aa,ah as Ma,ai as Ka,e as La,k as Ba,aj as Fa,ak as Oa,al as Ia,am as $a,r as Gt,an as Ut,ao as za,ap as St,aq as Tt,ar as Ha,as as Ga,at as Ze,au as Pn,av as Ua,aw as Pt,ax as Wt,ay as Wa,az as un,aA as qa,aB as wt,aC as Ja,aD as Ya,aE as Qa,aF as Xa,aG as Za,aH as bt,aI as eo,aJ as to,aK as no,m as so,aL as Cn,aM as Ct,aN as ao,aO as oo,aP as io,aQ as ro,aR as dn,aS as An,aT as Mn,aU as Vt,aV as qt,aW as Kn,aX as lo,aY as mn,aZ as co,a_ as uo,a$ as mo,b0 as Ln,b1 as fo,b2 as po}from"./index-CWYTgJsi.js";import{t as go}from"./ChevronDown-CXe6JgOB.js";import{$ as pn,U as rs,E as ho,x as ls,a0 as vo,a1 as xo}from"./agent-icon-CaI0GdpH.js";import{i as cs}from"./ChevronRight-5eA6ROzl.js";import{n as So}from"./ChevronUp-ClePnk1p.js";import{i as bo}from"./Globe01-K7604lAF.js";import{m as Jt}from"./automation-runs-vYAByajM.js";import{c as yt,T as _t,a as jt}from"./tooltip-eTUejMvR.js";import{b as yo,h as _o,a as jo,c as Eo,d as ko,e as Ro}from"./dialog-C9LdhEJ8.js";import{I as wo}from"./input-CB7a8Fqy.js";import{a as us}from"./Copy01-D_I4zLJq.js";import{c as Vo}from"./ZoomOut-QXkH5zvj.js";import{i as No}from"./Settings02-DBXlrfF_.js";import{s as Do}from"./Eye-CCFNdeEl.js";import{s as ds}from"./TrendUp01-lmorDXaS.js";import{s as gn}from"./Plus-DS3KKDHn.js";import{s as ms}from"./Trash01-JNWsD9zI.js";import{i as To}from"./Zap-DZcAzV7c.js";import{a as vt,D as fs,b as ps,c as gs,i as Po}from"./dropdown-menu-Cga-_vD5.js";import{S as Co,r as Bn,a as Ao,d as Mo,b as Ko,i as Lo,f as Bo,P as Fo,c as Oo}from"./page-seo-form-B_rosXuT.js";import{b as Io}from"./Tool01-Bxryucq9.js";import{A as $o}from"./add-section-modal-BfT4ro60.js";import"./ArrowUp-D_vtmz11.js";import"./chat-context-DrudQqbN.js";import"./autosend-Cu5ph7K1.js";import"./hooks-DppbqdpU.js";import"./use-mcp-client-D0JJUSC_.js";import"./auth-uY-yd_Qx.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-DScO8nLg.js";import"./studio-tools-DyE5uoU2.js";import"./use-virtual-mcp-PPiLqJsk.js";import"./use-ai-providers-DXcmm9Eo.js";import"./location-BpLtHjTZ.js";import"./tab-id-BijBBRwE.js";import"./use-decopilot-events-BzrOUotP.js";import"./use-organization-settings-BpIk1GGk.js";import"./drawer-iJbxlBHN.js";import"./collection-search-BKwi5gox.js";import"./SearchMd-w82MFsfG.js";import"./use-mobile-BBy2stTu.js";import"./AreaChart-COvvWTHK.js";import"./index-Bq-qtjfv.js";import"./calendar-CaYhlf3J.js";import"./X-CUF99Lsu.js";import"./shell-layout-CRMkjcoU.js";import"./avatar-Bipd5UEy.js";import"./User01-BVJUnJoI.js";import"./Users03-DDFwhuFu.js";import"./SearchLg-z8IAxAgb.js";import"./Stars02-B2okzw6k.js";import"./XClose-BAe5iaCX.js";import"./CheckCircle-vxKWSGjq.js";import"./FilterLines-CV0dxqQH.js";import"./required-auth-layout-D1lQLs9o.js";import"./use-org-sso-DTdBxyH-.js";import"./index-rt1Yq-xm.js";import"./get-initials-D-f_fDFw.js";import"./SwitchHorizontal01-BVz6HjlA.js";import"./popover-KcB6zphY.js";import"./use-registry-app-DNGwSCwE.js";import"./use-mcp-tools-C4VVy_zP.js";import"./use-connection-DQmaXrND.js";import"./github-repo-scope-DjMZbiKa.js";import"./authenticate-and-persist-oauth-CHKgbLri.js";import"./mcp-oauth-BdVW-uBg.js";import"./extract-connection-data-bvDVBCCK.js";import"./metadata-dUsYcpuu.js";import"./use-members-Bo_LaHq3.js";import"./use-org-auth-client-BuQouTOU.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./AlertCircle-nsAOhmc5.js";import"./DotsVertical-DF3Be14k.js";import"./use-copy-CILQcfx6.js";import"./Check-CbFEdDFo.js";import"./LinkExternal01-BIeTlaI1.js";import"./command-CzcPmc98.js";import"./index-CggwapSx.js";import"./ArrowRight-W78pWgya.js";import"./companions-core-CEPgmi_H.js";import"./ZapSquare-Bp70BKvB.js";import"./Star01-Bf8yuwps.js";import"./Image01-sKA_S9si.js";import"./Upload01-iZa_BxIK.js";import"./form-ujVNSHLD.js";import"./label-B6kQLTZ2.js";import"./select-Dj6isKXJ.js";import"./tabs-DNTKvnYl.js";import"./Tool02-DXkhQkf7.js";import"./toggle-group-HR0MkXiQ.js";import"./use-deco-credits-BkHvXdZJ.js";import"./sidebar-5EbmaKfu.js";import"./LayoutLeft-B8qL2spL.js";import"./alert-dialog-BIM3ZQ61.js";import"./toolbar-icon-button-BrVVEPAi.js";import"./skeleton-CPE6o86c.js";import"./github-repo-picker-CjqIThyB.js";import"./use-debounced-value-ypDUqPbN.js";import"./use-navigate-to-agent-CVCBKtMO.js";import"./reusable-new-chat-CouMjkYR.js";import"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import"./connection-card-COtpZU4g.js";import"./use-registry-connections-DvPR6a-P.js";import"./useInfiniteQuery-CXTRQ-Dk.js";import"./use-infinite-scroll-unU2jvvl.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./card-Cz1w-KeT.js";import"./integration-icon-CDDsl6LV.js";import"./textarea-DTuWp8dQ.js";import"./connection-form-helpers-CS6sBlKC.js";import"./collection-tabs-C2hvedKX.js";import"./badge-C3f1raKX.js";import"./useSuspenseInfiniteQuery-CZk_wXzA.js";import"./Monitor01-ahykGWr6.js";import"./connect-desktop-dialog-CTgRGfG0.js";import"./select-model-DTCkZwPH.js";import"./checkbox-HZxDl7MX.js";import"./Key01-HnuEM_kB.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-DJ-LhHo0.js";import"./ArrowUpRight-CE7N_ssY.js";import"./Stars01-ByFhj5mQ.js";import"./index-rMEa2YJG.js";import"./Palette-9lXole3j.js";import"./file-type-icon-BFz-fAWJ.js";import"./toolbar-BoNyAuGH.js";import"./Package-DMX0KLYy.js";import"./index-BRynC73_.js";import"./XCircle-BTCzfXYC.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-CcXDiWAj.js";import"./empty-state-Cm4v9nCd.js";import"./deco-site-production-url-CaKZ7xBn.js";import"./use-capability-DrqR3_St.js";import"./pt-BR-CLy76QW2.js";import"./use-mcp-auth-status-CmPv2iz1.js";import"./Play-anRYH6K1.js";import"./use-debounced-autosave-Cpb_4lIc.js";import"./index-B4pWthKK.js";import"./search-input-CMG5kT0r.js";import"./switch-BrBVeEiU.js";import"./Users01-ClFkkNN7.js";import"./use-secrets-Dy18M2CK.js";import"./useQueries-Coq8StiF.js";import"./monaco-editor-BAb_NIlJ.js";import"./use-file-configs-CxWcieBs.js";import"./use-automations-CyQ634sI.js";import"./automation-list-row-BgIWcdHf.js";import"./Globe04-SqHL90_b.js";import"./HardDrive-D5BssK7-.js";import"./LogOut01-Dzrbv7eq.js";import"./Sun-eT24COyo.js";import"./Shield01-4mocQmSI.js";import"./table-BMvSP1FF.js";import"./use-clock-tick-D5Vy5Dow.js";function zo(g){return g.schema?.definitions??g.schema?.$defs??{}}function Ho(g,e){const o=zo(e),d=o[btoa(g)];if(!d)return;let f=typeof d.image=="string"?d.image:void 0;if(!f&&Array.isArray(d.allOf)){const S=d.allOf.find(b=>typeof b.$ref=="string")?.$ref;if(typeof S=="string"){const b=S.replace("#/definitions/",""),m=o[b];f=typeof m?.image=="string"?m.image:void 0}}if(f?.includes("{{{"))return f}function Go(g,e){if(!e)return;const o=Ea(g);if(!o)return;const d=Ho(o.resolveType,e);if(!d)return;const f=ka(d,o.data);if(f)return Ra(f)}const Uo="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",Wo="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 Fn(g){return Array.from({length:g},(e,o)=>({id:crypto.randomUUID(),index:o}))}function hs(g){return g.map((e,o)=>({...e,index:o}))}function qo(g,e){if(e===g.length)return g;if(e<g.length)return hs(g.slice(0,e));const o=Array.from({length:e-g.length},(d,f)=>({id:crypto.randomUUID(),index:g.length+f}));return[...g,...o]}function vs(g){const e=He.c(20),{section:o,raw:d,meta:f}=g,S=o.isSavedBlock===!0,b=o.isMultivariate===!0;let m;e[0]!==f||e[1]!==d?(m=d&&f?Go(d,f):void 0,e[0]=f,e[1]=d,e[2]=m):m=e[2];const h=m;let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Vo,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[3]=u):u=e[3];let y;e[4]!==h?(y=h&&n.jsx("img",{src:h,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[4]=h,e[5]=y):y=e[5];let k;e[6]!==b||e[7]!==S?(k=S?{color:Da}:b?{color:"oklch(0.65 0.15 160)"}:void 0,e[6]=b,e[7]=S,e[8]=k):k=e[8];let D;e[9]!==k?(D=n.jsx(pn,{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 r;e[11]!==E?(r=Fe("min-w-0 flex-1 truncate text-sm font-medium",E),e[11]=E,e[12]=r):r=e[12];let p;e[13]!==o.label||e[14]!==r?(p=n.jsx("span",{className:r,children:o.label}),e[13]=o.label,e[14]=r,e[15]=p):p=e[15];let i;return e[16]!==y||e[17]!==D||e[18]!==p?(i=n.jsxs(n.Fragment,{children:[u,y,D,p]}),e[16]=y,e[17]=D,e[18]=p,e[19]=i):i=e[19],i}function xs(g,e){const o=g.isSavedBlock===!0,d=g.isMultivariate===!0;return Fe("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":o?Uo: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 Jo(g){const e=He.c(81),{section:o,raw:d,meta:f,sortableId:S,selected:b,onSelect:m,onDelete:h,onDuplicate:u,onMakeReusable:y,onToggleHidden:k,onToggleLazy:D,onAddVariant:E,onDetach:r}=g,p=rt(),i=d?Xn(d.__resolveType??""):!1;let P;e[0]!==o?(P=wa(o),e[0]=o,e[1]=P):P=e[1];const l=P;let R;e[2]!==S?(R={id:S,animateLayoutChanges:ei},e[2]=S,e[3]=R):R=e[3];const{attributes:A,listeners:z,setNodeRef:v,transform:C,isDragging:ie}=Zn(R);let L;e[4]!==C?(L=es.Transform.toString(C?{...C,x:0}:null),e[4]=C,e[5]=L):L=e[5];const ue=ie?0:void 0;let K;e[6]!==L||e[7]!==ue?(K={transform:L,opacity:ue},e[6]=L,e[7]=ue,e[8]=K):K=e[8];const ge=K;let B;e[9]!==o?(B=Va(o),e[9]=o,e[10]=B):B=e[10];const se=B,he="button",fe=0;let F;e[11]!==m?(F=G=>{(G.key==="Enter"||G.key===" ")&&(G.preventDefault(),m())},e[11]=m,e[12]=F):F=e[12];const J=ie?"cursor-grabbing":"cursor-pointer";let X;e[13]!==o||e[14]!==b||e[15]!==J?(X=Fe("touch-none transition-colors",J,xs(o,b)),e[13]=o,e[14]=b,e[15]=J,e[16]=X):X=e[16];let re;e[17]!==f||e[18]!==d||e[19]!==o?(re=n.jsx(vs,{section:o,raw:d,meta:f}),e[17]=f,e[18]=d,e[19]=o,e[20]=re):re=e[20];const O=!o.isMultivariate&&n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Je,{type:"button",variant:"ghost",size:"icon","aria-label":p(i?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:Fe("h-7 w-7 shrink-0",i?"":"opacity-0 group-hover:opacity-100"),onClick:G=>{G.stopPropagation(),D()},onPointerDown:Zo,children:n.jsx(To,{className:Fe("h-3.5 w-3.5",i&&"text-yellow-500")})})}),n.jsx(jt,{side:"bottom",children:p(i?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]});let Ke;e[21]!==k||e[22]!==o.isHidden||e[23]!==o.isMultivariate||e[24]!==p?(Ke=!o.isMultivariate&&n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Je,{type:"button",variant:"ghost",size:"icon","aria-label":o.isHidden?p("sectionsEditor.sectionList.showSection"):p("sectionsEditor.sectionList.hideSection"),className:Fe("h-7 w-7 shrink-0",o.isHidden?"opacity-100":"opacity-0 group-hover:opacity-100"),onClick:G=>{G.stopPropagation(),k()},onPointerDown:Xo,children:o.isHidden?n.jsx(No,{className:"h-3.5 w-3.5"}):n.jsx(Do,{className:"h-3.5 w-3.5"})})}),n.jsx(jt,{side:"bottom",children:o.isHidden?p("sectionsEditor.sectionList.showSection"):p("sectionsEditor.sectionList.hideSection")})]}),e[21]=k,e[22]=o.isHidden,e[23]=o.isMultivariate,e[24]=p,e[25]=Ke):Ke=e[25];let Z;e[26]!==p?(Z=p("sectionsEditor.sectionList.sectionActionsMenu"),e[26]=p,e[27]=Z):Z=e[27];let Le;e[28]===Symbol.for("react.memo_cache_sentinel")?(Le=n.jsx(rs,{className:"h-3.5 w-3.5"}),e[28]=Le):Le=e[28];let ve;e[29]!==Z?(ve=n.jsx(fs,{asChild:!0,children:n.jsx(Je,{type:"button",variant:"ghost",size:"icon","aria-label":Z,className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100",onClick:Qo,onPointerDown:Yo,children:Le})}),e[29]=Z,e[30]=ve):ve=e[30];let de;e[31]!==u?(de=G=>{G.stopPropagation(),u()},e[31]=u,e[32]=de):de=e[32];let oe;e[33]===Symbol.for("react.memo_cache_sentinel")?(oe=n.jsx(us,{className:"h-4 w-4"}),e[33]=oe):oe=e[33];let ee;e[34]!==p?(ee=p("sectionsEditor.sectionList.duplicateMenuItem"),e[34]=p,e[35]=ee):ee=e[35];let le;e[36]!==de||e[37]!==ee?(le=n.jsxs(vt,{onClick:de,children:[oe,ee]}),e[36]=de,e[37]=ee,e[38]=le):le=e[38];let pe;e[39]!==l||e[40]!==E||e[41]!==p?(pe=l&&n.jsxs(vt,{className:Na,onClick:G=>{G.stopPropagation(),E()},children:[n.jsx(ds,{className:"h-4 w-4"}),p("sectionsEditor.sectionList.addVariantMenuItem")]}),e[39]=l,e[40]=E,e[41]=p,e[42]=pe):pe=e[42];let ke;e[43]!==se||e[44]!==y||e[45]!==p?(ke=se&&n.jsxs(vt,{className:Wo,onClick:G=>{G.stopPropagation(),y()},children:[n.jsx(pn,{className:"h-4 w-4"}),p("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[43]=se,e[44]=y,e[45]=p,e[46]=ke):ke=e[46];let Re;e[47]!==r||e[48]!==o.isMultivariate||e[49]!==o.isSavedBlock||e[50]!==p?(Re=o.isSavedBlock===!0&&!o.isMultivariate&&n.jsxs(vt,{onClick:G=>{G.stopPropagation(),r()},children:[n.jsx(pn,{className:"h-4 w-4"}),p("sectionsEditor.sectionList.detachMenuItem")]}),e[47]=r,e[48]=o.isMultivariate,e[49]=o.isSavedBlock,e[50]=p,e[51]=Re):Re=e[51];let xe;e[52]!==h?(xe=G=>{G.stopPropagation(),h()},e[52]=h,e[53]=xe):xe=e[53];let De;e[54]===Symbol.for("react.memo_cache_sentinel")?(De=n.jsx(ms,{className:"h-4 w-4"}),e[54]=De):De=e[54];let _e;e[55]!==p?(_e=p("sectionsEditor.sectionList.deleteMenuItem"),e[55]=p,e[56]=_e):_e=e[56];let I;e[57]!==xe||e[58]!==_e?(I=n.jsxs(vt,{className:"text-destructive focus:text-destructive",onClick:xe,children:[De,_e]}),e[57]=xe,e[58]=_e,e[59]=I):I=e[59];let ce;e[60]!==le||e[61]!==pe||e[62]!==ke||e[63]!==Re||e[64]!==I?(ce=n.jsxs(ps,{align:"end",className:"w-44",children:[le,pe,ke,Re,I]}),e[60]=le,e[61]=pe,e[62]=ke,e[63]=Re,e[64]=I,e[65]=ce):ce=e[65];let je;e[66]!==ve||e[67]!==ce?(je=n.jsxs(gs,{children:[ve,ce]}),e[66]=ve,e[67]=ce,e[68]=je):je=e[68];let Te;return e[69]!==A||e[70]!==z||e[71]!==m||e[72]!==v||e[73]!==ge||e[74]!==X||e[75]!==re||e[76]!==O||e[77]!==Ke||e[78]!==je||e[79]!==F?(Te=n.jsxs("div",{ref:v,style:ge,...A,...z,role:he,tabIndex:fe,onClick:m,onKeyDown:F,className:X,children:[re,O,Ke,je]}),e[69]=A,e[70]=z,e[71]=m,e[72]=v,e[73]=ge,e[74]=X,e[75]=re,e[76]=O,e[77]=Ke,e[78]=je,e[79]=F,e[80]=Te):Te=e[80],Te}function Yo(g){return g.stopPropagation()}function Qo(g){return g.stopPropagation()}function Xo(g){return g.stopPropagation()}function Zo(g){return g.stopPropagation()}function ei(){return!1}function ti(g){const e=He.c(104),{listKey:o,rawSections:d,sections:f,meta:S,selectedIndex:b,onSelect:m,onReorder:h,onDelete:u,onDuplicate:y,onMakeReusable:k,onToggleHidden:D,onToggleLazy:E,onAddVariant:r,onDetach:p,onAddSection:i,canAddSection:P}=g,l=P===void 0?!0:P,R=rt();let A;e[0]!==f.length?(A=()=>Fn(f.length),e[0]=f.length,e[1]=A):A=e[1];const[z,v]=V.useState(A),[C,ie]=V.useState(null),[L,ue]=V.useState(o),[K,ge]=V.useState(f.length),B=V.useRef(!1);L!==o?(ue(o),ge(f.length),v(Fn(f.length))):K!==f.length&&(ge(f.length),v(Ie=>qo(Ie,f.length)));let se;e[2]===Symbol.for("react.memo_cache_sentinel")?(se={activationConstraint:{distance:8}},e[2]=se):se=e[2];let he;e[3]===Symbol.for("react.memo_cache_sentinel")?(he={coordinateGetter:ts},e[3]=he):he=e[3];const fe=Wn(Yt(Qn,se),Yt(Yn,he));let F;e[4]!==z?(F=z.map(ni),e[4]=z,e[5]=F):F=e[5];const J=F;let X;e[6]===Symbol.for("react.memo_cache_sentinel")?(X=Ie=>{ie(String(Ie.active.id))},e[6]=X):X=e[6];const re=X;let O;e[7]!==J||e[8]!==h?(O=Ie=>{ie(null);const{active:N,over:ae}=Ie;if(!ae||N.id===ae.id)return;const $=J.indexOf(String(N.id)),Xe=J.indexOf(String(ae.id));$===-1||Xe===-1||(v(et=>hs(At([...et],$,Xe))),B.current=!0,requestAnimationFrame(()=>{B.current=!1}),h?.($,Xe))},e[7]=J,e[8]=h,e[9]=O):O=e[9];const Ke=O;let Z;e[10]===Symbol.for("react.memo_cache_sentinel")?(Z=()=>{ie(null)},e[10]=Z):Z=e[10];const Le=Z;let ve,de,oe,ee,le,pe,ke,Re,xe,De,_e,I,ce,je,Te;if(e[11]!==C||e[12]!==l||e[13]!==z||e[14]!==J||e[15]!==Ke||e[16]!==S||e[17]!==i||e[18]!==r||e[19]!==u||e[20]!==p||e[21]!==y||e[22]!==k||e[23]!==m||e[24]!==D||e[25]!==E||e[26]!==d||e[27]!==f||e[28]!==b||e[29]!==fe||e[30]!==R){je=Symbol.for("react.early_return_sentinel");e:{const Ie=N=>{B.current||m(N)};if(e[46]!==C||e[47]!==l||e[48]!==z||e[49]!==i||e[50]!==d||e[51]!==f||e[52]!==R){const N=C?z.find(ae=>ae.id===C):null;if(ee=N!=null?f[N.index]:null,oe=N!=null?d[N.index]:void 0,z.length===0){let ae;e[56]!==R?(ae=R("sectionsEditor.sectionList.noSections"),e[56]=R,e[57]=ae):ae=e[57];let $;e[58]!==ae?($=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:ae}),e[58]=ae,e[59]=$):$=e[59];const Xe=!l;let et;e[60]===Symbol.for("react.memo_cache_sentinel")?(et=n.jsx(gn,{size:14}),e[60]=et):et=e[60];let lt;e[61]!==R?(lt=R("sectionsEditor.sectionList.addSectionButton"),e[61]=R,e[62]=lt):lt=e[62];let ct;e[63]!==i||e[64]!==Xe||e[65]!==lt?(ct=n.jsxs(Je,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Xe,onClick:i,children:[et,lt]}),e[63]=i,e[64]=Xe,e[65]=lt,e[66]=ct):ct=e[66];let ut;e[67]!==$||e[68]!==ct?(ut=n.jsxs("div",{className:"space-y-2",children:[$,ct]}),e[67]=$,e[68]=ct,e[69]=ut):ut=e[69],je=ut;break e}ce=Fe(N&&"cursor-grabbing"),e[46]=C,e[47]=l,e[48]=z,e[49]=i,e[50]=d,e[51]=f,e[52]=R,e[53]=oe,e[54]=ee,e[55]=ce}else oe=e[53],ee=e[54],ce=e[55];de=ns,Re=fe,xe=ss,De=re,_e=Ke,I=Le,ve=as,pe=J,ke=os,Te="space-y-1",le=z.map(N=>{const ae=f[N.index];return ae?n.jsx(Jo,{sortableId:N.id,section:ae,raw:d[N.index],meta:S,selected:b===N.index,onSelect:()=>Ie(N.index),onDelete:()=>u(N.index),onDuplicate:()=>y(N.index),onMakeReusable:()=>k(N.index),onToggleHidden:()=>D(N.index),onToggleLazy:()=>E(N.index),onAddVariant:()=>r(N.index),onDetach:()=>p(N.index)},N.id):null})}e[11]=C,e[12]=l,e[13]=z,e[14]=J,e[15]=Ke,e[16]=S,e[17]=i,e[18]=r,e[19]=u,e[20]=p,e[21]=y,e[22]=k,e[23]=m,e[24]=D,e[25]=E,e[26]=d,e[27]=f,e[28]=b,e[29]=fe,e[30]=R,e[31]=ve,e[32]=de,e[33]=oe,e[34]=ee,e[35]=le,e[36]=pe,e[37]=ke,e[38]=Re,e[39]=xe,e[40]=De,e[41]=_e,e[42]=I,e[43]=ce,e[44]=je,e[45]=Te}else ve=e[31],de=e[32],oe=e[33],ee=e[34],le=e[35],pe=e[36],ke=e[37],Re=e[38],xe=e[39],De=e[40],_e=e[41],I=e[42],ce=e[43],je=e[44],Te=e[45];if(je!==Symbol.for("react.early_return_sentinel"))return je;let G;e[70]!==le||e[71]!==Te?(G=n.jsx("div",{className:Te,children:le}),e[70]=le,e[71]=Te,e[72]=G):G=e[72];let Ae;e[73]!==ve||e[74]!==pe||e[75]!==ke||e[76]!==G?(Ae=n.jsx(ve,{items:pe,strategy:ke,children:G}),e[73]=ve,e[74]=pe,e[75]=ke,e[76]=G,e[77]=Ae):Ae=e[77];let Oe;e[78]!==oe||e[79]!==ee||e[80]!==S?(Oe=ee?n.jsx("div",{className:Fe("cursor-grabbing shadow-lg ring-1 ring-border/60",xs(ee,!1)),children:n.jsx(vs,{section:ee,raw:oe,meta:S})}):null,e[78]=oe,e[79]=ee,e[80]=S,e[81]=Oe):Oe=e[81];let ze;e[82]!==Oe?(ze=Gn.createPortal(n.jsx(qn,{dropAnimation:Jn,children:Oe}),document.body),e[82]=Oe,e[83]=ze):ze=e[83];let Be;e[84]!==de||e[85]!==Re||e[86]!==xe||e[87]!==De||e[88]!==_e||e[89]!==I||e[90]!==Ae||e[91]!==ze?(Be=n.jsxs(de,{sensors:Re,collisionDetection:xe,onDragStart:De,onDragEnd:_e,onDragCancel:I,children:[Ae,ze]}),e[84]=de,e[85]=Re,e[86]=xe,e[87]=De,e[88]=_e,e[89]=I,e[90]=Ae,e[91]=ze,e[92]=Be):Be=e[92];const Se=!l;let we;e[93]===Symbol.for("react.memo_cache_sentinel")?(we=n.jsx(gn,{size:14}),e[93]=we):we=e[93];let be;e[94]!==R?(be=R("sectionsEditor.sectionList.addSectionButton"),e[94]=R,e[95]=be):be=e[95];let te;e[96]!==i||e[97]!==Se||e[98]!==be?(te=n.jsxs(Je,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:Se,onClick:i,children:[we,be]}),e[96]=i,e[97]=Se,e[98]=be,e[99]=te):te=e[99];let me;return e[100]!==ce||e[101]!==Be||e[102]!==te?(me=n.jsxs("div",{className:ce,children:[Be,te]}),e[100]=ce,e[101]=Be,e[102]=te,e[103]=me):me=e[103],me}function ni(g){return g.id}function On(g){const e=He.c(57),{open:o,initialName:d,autoLabel:f,isPending:S,onSubmit:b,onOpenChange:m}=g,h=S===void 0?!1:S,u=rt(),[y,k]=V.useState(d),[D,E]=V.useState(o);o!==D&&(E(o),o&&k(d));let r;e[0]!==h||e[1]!==m?(r=re=>{!re&&!h&&m(!1)},e[0]=h,e[1]=m,e[2]=r):r=e[2];const p=r;let i;e[3]!==h||e[4]!==y||e[5]!==b?(i=async re=>{re.preventDefault(),!h&&await b(y.trim())},e[3]=h,e[4]=y,e[5]=b,e[6]=i):i=e[6];const P=i;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(yo,{children:l}),e[9]=l,e[10]=R):R=e[10];let A;e[11]!==f||e[12]!==u?(A=u("sectionsEditor.variantRenameDialog.description",{fallback:f||u("sectionsEditor.variantRenameDialog.defaultFallback")}),e[11]=f,e[12]=u,e[13]=A):A=e[13];let z;e[14]!==A?(z=n.jsx(_o,{children:A}),e[14]=A,e[15]=z):z=e[15];let v;e[16]!==R||e[17]!==z?(v=n.jsxs(jo,{children:[R,z]}),e[16]=R,e[17]=z,e[18]=v):v=e[18];let C;e[19]!==u?(C=u("sectionsEditor.variantRenameDialog.nameLabel"),e[19]=u,e[20]=C):C=e[20];let ie;e[21]!==C?(ie=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:C}),e[21]=C,e[22]=ie):ie=e[22];let L;e[23]===Symbol.for("react.memo_cache_sentinel")?(L=re=>k(re.target.value),e[23]=L):L=e[23];let ue;e[24]!==f||e[25]!==h||e[26]!==y?(ue=n.jsx(wo,{id:"variant-rename-name",value:y,onChange:L,placeholder:f,autoFocus:!0,disabled:h}),e[24]=f,e[25]=h,e[26]=y,e[27]=ue):ue=e[27];let K;e[28]!==ie||e[29]!==ue?(K=n.jsxs("div",{className:"space-y-1.5 py-4",children:[ie,ue]}),e[28]=ie,e[29]=ue,e[30]=K):K=e[30];let ge;e[31]!==m?(ge=()=>m(!1),e[31]=m,e[32]=ge):ge=e[32];let B;e[33]!==u?(B=u("sectionsEditor.variantRenameDialog.cancel"),e[33]=u,e[34]=B):B=e[34];let se;e[35]!==h||e[36]!==ge||e[37]!==B?(se=n.jsx(Je,{type:"button",variant:"outline",onClick:ge,disabled:h,children:B}),e[35]=h,e[36]=ge,e[37]=B,e[38]=se):se=e[38];let he;e[39]!==h||e[40]!==u?(he=h?n.jsxs(n.Fragment,{children:[n.jsx(Un,{size:14,className:"animate-spin"}),u("sectionsEditor.variantRenameDialog.saving")]}):u("sectionsEditor.variantRenameDialog.save"),e[39]=h,e[40]=u,e[41]=he):he=e[41];let fe;e[42]!==h||e[43]!==he?(fe=n.jsx(Je,{type:"submit",disabled:h,children:he}),e[42]=h,e[43]=he,e[44]=fe):fe=e[44];let F;e[45]!==se||e[46]!==fe?(F=n.jsxs(Eo,{children:[se,fe]}),e[45]=se,e[46]=fe,e[47]=F):F=e[47];let J;e[48]!==P||e[49]!==K||e[50]!==F||e[51]!==v?(J=n.jsx(ko,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:P,children:[v,K,F]})}),e[48]=P,e[49]=K,e[50]=F,e[51]=v,e[52]=J):J=e[52];let X;return e[53]!==p||e[54]!==o||e[55]!==J?(X=n.jsx(Ro,{open:o,onOpenChange:p,children:J}),e[53]=p,e[54]=o,e[55]=J,e[56]=X):X=e[56],X}const si="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)]",Ss="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 bs(g){const e=He.c(5),{rule:o,matchers:d}=g,f=o?.__resolveType??"";let S;if(e[0]!==d||e[1]!==f){const u=d.find(y=>y.resolveType===f)?.iconName??Ta(f);S=ho(u),e[0]=d,e[1]=f,e[2]=S}else S=e[2];const b=S;if(!b)return null;let m;return e[3]!==b?(m=n.jsx(b,{size:14,className:"shrink-0"}),e[3]=b,e[4]=m):m=e[4],m}function In(g){return g.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
2
- `)}function fn(g){return g.map((e,o)=>({id:crypto.randomUUID(),index:o,variant:e}))}function ai(g){return g.map((e,o)=>({...e,index:o}))}function ys(g){const e=He.c(17),{label:o,effectiveRule:d,matchers:f,canDelete:S,dragging:b,onRename:m,onDuplicate:h,onDelete:u}=g,y=rt();let k;e[0]!==d||e[1]!==f?(k=n.jsx(bs,{rule:d,matchers:f}),e[0]=d,e[1]=f,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]!==S||e[6]!==b||e[7]!==o||e[8]!==u||e[9]!==h||e[10]!==m||e[11]!==y?(E=!b&&n.jsxs(gs,{children:[n.jsx(fs,{asChild:!0,children:n.jsx(Je,{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:ii,onPointerDown:oi,children:n.jsx(rs,{size:14})})}),n.jsxs(ps,{align:"end",className:"w-36",children:[n.jsxs(vt,{onClick:p=>{p.stopPropagation(),m?.()},children:[n.jsx(Io,{size:14}),y("sectionsEditor.pageVariantTabs.renameAction")]}),n.jsxs(vt,{onClick:p=>{p.stopPropagation(),h?.()},children:[n.jsx(us,{size:14}),y("sectionsEditor.pageVariantTabs.duplicateAction")]}),n.jsx(Po,{}),n.jsxs(vt,{variant:"destructive",disabled:!S,onClick:p=>{p.stopPropagation(),u?.()},children:[n.jsx(ms,{size:14}),y("sectionsEditor.pageVariantTabs.deleteAction")]})]})]}),e[5]=S,e[6]=b,e[7]=o,e[8]=u,e[9]=h,e[10]=m,e[11]=y,e[12]=E):E=e[12];let r;return e[13]!==k||e[14]!==D||e[15]!==E?(r=n.jsxs(n.Fragment,{children:[k,D,E]}),e[13]=k,e[14]=D,e[15]=E,e[16]=r):r=e[16],r}function oi(g){return g.stopPropagation()}function ii(g){return g.stopPropagation()}function ri(g){const e=He.c(33),{entry:o,sortableId:d,isActive:f,canDelete:S,decofile:b,meta:m,matchers:h,onSelect:u,onRename:y,onDuplicate:k,onDelete:D}=g;let E;e[0]!==d?(E={id:d,animateLayoutChanges:li},e[0]=d,e[1]=E):E=e[1];const{attributes:r,listeners:p,setNodeRef:i,transform:P,isDragging:l}=Zn(E);let R;e[2]!==P?(R=es.Transform.toString(P?{...P,x:0}:null),e[2]=P,e[3]=R):R=e[3];const A=l?0:void 0;let z;e[4]!==R||e[5]!==A?(z={transform:R,opacity:A},e[4]=R,e[5]=A,e[6]=z):z=e[6];const v=z,C=m??void 0;let ie;e[7]!==b||e[8]!==o.variant.rule||e[9]!==C?(ie=Mt(o.variant.rule,b,C),e[7]=b,e[8]=o.variant.rule,e[9]=C,e[10]=ie):ie=e[10];const L=ie;let ue;e[11]!==u?(ue=fe=>{fe.target===fe.currentTarget&&(fe.key==="Enter"||fe.key===" ")&&(fe.preventDefault(),u())},e[11]=u,e[12]=ue):ue=e[12];const K=l?"cursor-grabbing":"cursor-pointer active:cursor-grabbing",ge=f?Ss:si;let B;e[13]!==K||e[14]!==ge?(B=Fe("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors touch-none",K,ge),e[13]=K,e[14]=ge,e[15]=B):B=e[15];let se;e[16]!==S||e[17]!==L||e[18]!==o.variant.label||e[19]!==h||e[20]!==D||e[21]!==k||e[22]!==y?(se=n.jsx(ys,{label:o.variant.label,effectiveRule:L,matchers:h,canDelete:S,onRename:y,onDuplicate:k,onDelete:D}),e[16]=S,e[17]=L,e[18]=o.variant.label,e[19]=h,e[20]=D,e[21]=k,e[22]=y,e[23]=se):se=e[23];let he;return e[24]!==r||e[25]!==p||e[26]!==u||e[27]!==i||e[28]!==v||e[29]!==B||e[30]!==se||e[31]!==ue?(he=n.jsx("div",{ref:i,style:v,...r,...p,onClick:u,onKeyDown:ue,className:B,children:se}),e[24]=r,e[25]=p,e[26]=u,e[27]=i,e[28]=v,e[29]=B,e[30]=se,e[31]=ue,e[32]=he):he=e[32],he}function li(){return!1}function ci(g){const e=He.c(9),{variant:o,decofile:d,meta:f,matchers:S}=g,b=f??void 0;let m;e[0]!==d||e[1]!==b||e[2]!==o.rule?(m=Mt(o.rule,d,b),e[0]=d,e[1]=b,e[2]=o.rule,e[3]=m):m=e[3];const h=m;let u;e[4]===Symbol.for("react.memo_cache_sentinel")?(u=Fe("flex items-center gap-2 rounded-md px-2 py-2.5 shadow-lg ring-1 ring-border/60 cursor-grabbing",Ss),e[4]=u):u=e[4];let y;return e[5]!==h||e[6]!==S||e[7]!==o.label?(y=n.jsx("div",{className:u,children:n.jsx(ys,{label:o.label,effectiveRule:h,matchers:S,canDelete:!1,dragging:!0})}),e[5]=h,e[6]=S,e[7]=o.label,e[8]=y):y=e[8],y}function ui(g){const e=He.c(91),{listKey:o,variants:d,activeIndex:f,decofile:S,meta:b,matchers:m,onSelect:h,onReorder:u,onRename:y,onDuplicate:k,onDelete:D,onAdd:E}=g,r=rt();let p;e[0]!==d?(p=()=>fn(d),e[0]=d,e[1]=p):p=e[1];const[i,P]=V.useState(p),[l,R]=V.useState(null),[A,z]=V.useState(o),[v,C]=V.useState(d.length);let ie;e[2]!==d?(ie=()=>In(d),e[2]=d,e[3]=ie):ie=e[3];const[L,ue]=V.useState(ie),K=V.useRef(!1),ge=In(d);A!==o?(z(o),C(d.length),ue(ge),P(fn(d))):v!==d.length?(C(d.length),ue(ge),P(fn(d))):L!==ge&&(ue(ge),P(Be=>d.map((Se,we)=>({id:Be[we]?.id??crypto.randomUUID(),index:we,variant:Se}))));let B;e[4]===Symbol.for("react.memo_cache_sentinel")?(B={activationConstraint:{distance:8}},e[4]=B):B=e[4];let se;e[5]===Symbol.for("react.memo_cache_sentinel")?(se={coordinateGetter:ts},e[5]=se):se=e[5];const he=Wn(Yt(Qn,B),Yt(Yn,se));let fe;e[6]!==i?(fe=i.map(di),e[6]=i,e[7]=fe):fe=e[7];const F=fe,J=d.length>1;let X;e[8]!==i?(X=Be=>{const Se=String(Be.active.id);R(i.find(we=>we.id===Se)??null)},e[8]=i,e[9]=X):X=e[9];const re=X;let O;e[10]!==F||e[11]!==u?(O=Be=>{R(null);const{active:Se,over:we}=Be;if(!we||Se.id===we.id)return;const be=F.indexOf(String(Se.id)),te=F.indexOf(String(we.id));be===-1||te===-1||(P(me=>ai(At([...me],be,te))),K.current=!0,requestAnimationFrame(()=>{K.current=!1}),u(be,te))},e[10]=F,e[11]=u,e[12]=O):O=e[12];const Ke=O;let Z;e[13]===Symbol.for("react.memo_cache_sentinel")?(Z=()=>{R(null)},e[13]=Z):Z=e[13];const Le=Z;let ve,de,oe,ee,le,pe,ke,Re,xe,De,_e,I,ce;if(e[14]!==f||e[15]!==J||e[16]!==S||e[17]!==i||e[18]!==F||e[19]!==Ke||e[20]!==re||e[21]!==m||e[22]!==b||e[23]!==E||e[24]!==D||e[25]!==k||e[26]!==y||e[27]!==h||e[28]!==he||e[29]!==r){const Be=$=>{K.current||h($)};_e="space-y-1 border-b p-2";let Se;e[43]!==r?(Se=r("sectionsEditor.pageVariantTabs.variantsLabel"),e[43]=r,e[44]=Se):Se=e[44];let we;e[45]!==Se?(we=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:Se}),e[45]=Se,e[46]=we):we=e[46];let be;e[47]!==r?(be=r("sectionsEditor.pageVariantTabs.addVariantAriaLabel"),e[47]=r,e[48]=be):be=e[48];let te;e[49]===Symbol.for("react.memo_cache_sentinel")?(te=n.jsx(gn,{size:14}),e[49]=te):te=e[49];let me;e[50]!==E||e[51]!==be?(me=n.jsx(_t,{asChild:!0,children:n.jsx(Je,{type:"button",variant:"ghost",size:"icon","aria-label":be,className:"size-6",onClick:E,children:te})}),e[50]=E,e[51]=be,e[52]=me):me=e[52];let Ie;e[53]!==r?(Ie=r("sectionsEditor.pageVariantTabs.addVariantTooltip"),e[53]=r,e[54]=Ie):Ie=e[54];let N;e[55]!==Ie?(N=n.jsx(jt,{children:Ie}),e[55]=Ie,e[56]=N):N=e[56];let ae;e[57]!==me||e[58]!==N?(ae=n.jsxs(yt,{children:[me,N]}),e[57]=me,e[58]=N,e[59]=ae):ae=e[59],e[60]!==we||e[61]!==ae?(I=n.jsxs("div",{className:"flex items-center justify-between",children:[we,ae]}),e[60]=we,e[61]=ae,e[62]=I):I=e[62],de=ns,pe=he,ke=ss,Re=re,xe=Ke,De=Le,ve=as,ee=F,le=os,ce="space-y-0.5",oe=i.map($=>n.jsx(ri,{sortableId:$.id,entry:$,isActive:$.index===f,canDelete:J,decofile:S,meta:b,matchers:m,onSelect:()=>Be($.index),onRename:()=>y($.index),onDuplicate:()=>k($.index),onDelete:()=>D($.index)},$.id)),e[14]=f,e[15]=J,e[16]=S,e[17]=i,e[18]=F,e[19]=Ke,e[20]=re,e[21]=m,e[22]=b,e[23]=E,e[24]=D,e[25]=k,e[26]=y,e[27]=h,e[28]=he,e[29]=r,e[30]=ve,e[31]=de,e[32]=oe,e[33]=ee,e[34]=le,e[35]=pe,e[36]=ke,e[37]=Re,e[38]=xe,e[39]=De,e[40]=_e,e[41]=I,e[42]=ce}else ve=e[30],de=e[31],oe=e[32],ee=e[33],le=e[34],pe=e[35],ke=e[36],Re=e[37],xe=e[38],De=e[39],_e=e[40],I=e[41],ce=e[42];let je;e[63]!==oe||e[64]!==ce?(je=n.jsx("div",{className:ce,children:oe}),e[63]=oe,e[64]=ce,e[65]=je):je=e[65];let Te;e[66]!==ve||e[67]!==ee||e[68]!==le||e[69]!==je?(Te=n.jsx(ve,{items:ee,strategy:le,children:je}),e[66]=ve,e[67]=ee,e[68]=le,e[69]=je,e[70]=Te):Te=e[70];let G;e[71]!==l||e[72]!==S||e[73]!==m||e[74]!==b?(G=l?n.jsx(ci,{variant:l.variant,decofile:S,meta:b,matchers:m}):null,e[71]=l,e[72]=S,e[73]=m,e[74]=b,e[75]=G):G=e[75];let Ae;e[76]!==G?(Ae=Gn.createPortal(n.jsx(qn,{dropAnimation:Jn,children:G}),document.body),e[76]=G,e[77]=Ae):Ae=e[77];let Oe;e[78]!==de||e[79]!==pe||e[80]!==ke||e[81]!==Re||e[82]!==xe||e[83]!==De||e[84]!==Te||e[85]!==Ae?(Oe=n.jsxs(de,{sensors:pe,collisionDetection:ke,onDragStart:Re,onDragEnd:xe,onDragCancel:De,children:[Te,Ae]}),e[78]=de,e[79]=pe,e[80]=ke,e[81]=Re,e[82]=xe,e[83]=De,e[84]=Te,e[85]=Ae,e[86]=Oe):Oe=e[86];let ze;return e[87]!==_e||e[88]!==I||e[89]!==Oe?(ze=n.jsxs("div",{className:_e,children:[I,Oe]}),e[87]=_e,e[88]=I,e[89]=Oe,e[90]=ze):ze=e[90],ze}function di(g){return g.id}function mi(g){const e=He.c(16),{schema:o,value:d,onChange:f,meta:S,decofile:b,onSaveReferencedBlock:m,sandbox:h}=g,u=rt();let y;e[0]===Symbol.for("react.memo_cache_sentinel")?(y=[],e[0]=y):y=e[0];const[k,D]=V.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(ls,{className:"size-3.5"})}),k.map((i,P)=>{const l=P===k.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[P>0&&n.jsx(cs,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>D(k.slice(0,P+1)),title:i,className:Fe("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:i})]},`${i}-${P}`)})]}),e[1]=k,e[2]=u,e[3]=E):E=e[3];let r;e[4]!==k||e[5]!==b||e[6]!==S||e[7]!==f||e[8]!==m||e[9]!==h||e[10]!==o||e[11]!==d?(r=n.jsx(is,{schema:o,value:d,onChange:f,basePath:"",breadcrumbPath:k,onBreadcrumbChange:D,meta:S,decofile:b,onSaveReferencedBlock:m,sandbox:h}),e[4]=k,e[5]=b,e[6]=S,e[7]=f,e[8]=m,e[9]=h,e[10]=o,e[11]=d,e[12]=r):r=e[12];let p;return e[13]!==E||e[14]!==r?(p=n.jsxs("div",{className:"space-y-2",children:[E,r]}),e[13]=E,e[14]=r,e[15]=p):p=e[15],p}function $n(g){const e=He.c(21),{activeSchema:o,formValue:d,formResetKey:f,onFormChange:S,onBreadcrumbChange:b,breadcrumbPath:m,emptyMessage:h,beforeForm:u,seoResolveType:y,siteDefaultSeo:k,meta:D,decofile:E,onSaveReferencedBlock:r,sandbox:p}=g;let i;e[0]!==m?(i=m===void 0?[]:m,e[0]=m,e[1]=i):i=e[1];const P=i;let l;e[2]!==o||e[3]!==P||e[4]!==E||e[5]!==f||e[6]!==d||e[7]!==D||e[8]!==b||e[9]!==S||e[10]!==r||e[11]!==p||e[12]!==y||e[13]!==k?(l=o&&d?y?n.jsx(Co,{schema:o,resolveType:y,value:d,formResetKey:f,onChange:S,onBreadcrumbChange:b,siteDefaultSeo:k}):n.jsx(is,{schema:o,value:d,onChange:S,basePath:"",breadcrumbPath:P,onBreadcrumbChange:b,meta:D,decofile:E,onSaveReferencedBlock:r,sandbox:p},f):null,e[2]=o,e[3]=P,e[4]=E,e[5]=f,e[6]=d,e[7]=D,e[8]=b,e[9]=S,e[10]=r,e[11]=p,e[12]=y,e[13]=k,e[14]=l):l=e[14];const R=l;let A;e[15]!==h||e[16]!==R?(A=R??n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:h}),e[15]=h,e[16]=R,e[17]=A):A=e[17];let z;return e[18]!==u||e[19]!==A?(z=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,A]})}),e[18]=u,e[19]=A,e[20]=z):z=e[20],z}const fi="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 pi(g,e){return Pa(g,e,it)}function gi(g){const e=He.c(19),{pageKey:o,initialName:d,initialPath:f,onFieldChange:S}=g,b=rt(),[m,h]=V.useState(d),[u,y]=V.useState(f),[k,D]=V.useState(o);k!==o&&(D(o),h(d),y(f));let E;e[0]!==S?(E=A=>{h(A.target.value),S("name",A.target.value)},e[0]=S,e[1]=E):E=e[1];let r;e[2]!==b?(r=b("sectionsEditor.sectionsEditorPanels.pageNamePlaceholder"),e[2]=b,e[3]=r):r=e[3];let p;e[4]!==m||e[5]!==E||e[6]!==r?(p=n.jsx("input",{type:"text",value:m,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:r}),e[4]=m,e[5]=E,e[6]=r,e[7]=p):p=e[7];let i;e[8]!==S?(i=A=>{y(A.target.value),S("path",A.target.value)},e[8]=S,e[9]=i):i=e[9];let P;e[10]!==b?(P=b("sectionsEditor.sectionsEditorPanels.pathPlaceholder"),e[10]=b,e[11]=P):P=e[11];let l;e[12]!==u||e[13]!==i||e[14]!==P?(l=n.jsx("input",{type:"text",value:u,onChange:i,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:P}),e[12]=u,e[13]=i,e[14]=P,e[15]=l):l=e[15];let R;return e[16]!==p||e[17]!==l?(R=n.jsxs("div",{className:"space-y-1",children:[p,l]}),e[16]=p,e[17]=l,e[18]=R):R=e[18],R}function zn(g){const e=He.c(13),{onClick:o}=g,d=rt();let f;e[0]!==d?(f=d("sectionsEditor.sectionsEditorPanels.addVariant"),e[0]=d,e[1]=f):f=e[1];let S;e[2]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx(ds,{size:14}),e[2]=S):S=e[2];let b;e[3]!==o||e[4]!==f?(b=n.jsx(_t,{asChild:!0,children:n.jsx(Je,{type:"button",variant:"ghost",size:"icon","aria-label":f,className:"size-7 shrink-0 text-[oklch(0.65_0.15_160)]",onClick:o,children:S})}),e[3]=o,e[4]=f,e[5]=b):b=e[5];let m;e[6]!==d?(m=d("sectionsEditor.sectionsEditorPanels.addVariant"),e[6]=d,e[7]=m):m=e[7];let h;e[8]!==m?(h=n.jsx(jt,{side:"bottom",children:m}),e[8]=m,e[9]=h):h=e[9];let u;return e[10]!==b||e[11]!==h?(u=n.jsxs(yt,{children:[b,h]}),e[10]=b,e[11]=h,e[12]=u):u=e[12],u}function Hn(g){const e=He.c(21),{currentRt:o,currentLabel:d,currentGlobalKey:f,matchers:S,globals:b,onSelect:m,onSelectGlobal:h,schema:u,formValue:y,onChange:k,formKey:D,formWrapperClassName:E,meta:r,decofile:p,onSaveReferencedBlock:i,sandbox:P}=g;let l;e[0]!==f||e[1]!==d||e[2]!==o||e[3]!==b||e[4]!==S||e[5]!==m||e[6]!==h?(l=n.jsx(Ca,{currentRt:o,currentLabel:d,currentGlobalKey:f,matchers:S,globals:b,onSelect:m,onSelectGlobal:h}),e[0]=f,e[1]=d,e[2]=o,e[3]=b,e[4]=S,e[5]=m,e[6]=h,e[7]=l):l=e[7];let R;e[8]!==p||e[9]!==D||e[10]!==y||e[11]!==E||e[12]!==r||e[13]!==k||e[14]!==i||e[15]!==P||e[16]!==u?(R=u&&y&&n.jsx("div",{className:E,children:n.jsx(mi,{schema:u,value:y,onChange:k,meta:r,decofile:p,onSaveReferencedBlock:i,sandbox:P},D)}),e[8]=p,e[9]=D,e[10]=y,e[11]=E,e[12]=r,e[13]=k,e[14]=i,e[15]=P,e[16]=u,e[17]=R):R=e[17];let A;return e[18]!==l||e[19]!==R?(A=n.jsxs(n.Fragment,{children:[l,R]}),e[18]=l,e[19]=R,e[20]=A):A=e[20],A}function fc({orgSlug:g,virtualMcpId:e,branch:o,previewReady:d=!0,previewUrl:f,currentPath:S,activePageBlockKey:b=null,activeGlobalBlockKey:m=null,externalSelectedIndex:h,onSaved:u,initialEditSeo:y=!1,onExitSeo:k,onViewJsonFile:D,onVariantPreviewOverride:E}){const r=rt(),p=d?{orgSlug:g,virtualMcpId:e,branch:o,previewUrl:f}:null,{data:i,isLoading:P}=Aa(p),{data:l,isLoading:R}=Ma(p),A=Ka(),z=A?.entity?.id===e?A.entity.metadata?.siteSlug??null:null,[v,C]=V.useState(null),[ie,L]=V.useState(null),[ue,K]=V.useState(null),[ge,B]=V.useState(0),[se,he]=V.useState(void 0),[fe,F]=V.useState(null),[J,X]=V.useState(null),[re,O]=V.useState([]),[Ke,Z]=V.useState(0),[Le,ve]=V.useState(null),[de,oe]=V.useState(null),[ee,le]=V.useState(null),[pe,ke]=V.useState(!0),[Re,xe]=V.useState(!1),[De,_e]=V.useState(!1),[I,ce]=V.useState(y),[je,Te]=V.useState(y);y&&!je&&(Te(!0),ce(!0),C(null),L(null),K(null),O([])),!y&&je&&Te(!1);const[G,Ae]=V.useState(null),[Oe,ze]=V.useState(void 0),[Be,Se]=V.useState([]),[we,be]=V.useState(0),[te,me]=V.useState(0),[Ie,N]=V.useState(null),[ae,$]=V.useState(null),[Xe,et]=V.useState(null),lt=_a(),ct=`${g}/${e}/${o}`,ut=La({orgSlug:g,virtualMcpId:e,branch:o}),[_s,js]=V.useState(S),[Es,ks]=V.useState(b),[Rs,ws]=V.useState(m);(_s!==S||Es!==b||Rs!==m)&&(queueMicrotask(()=>ut.flush()),js(S),ks(b),ws(m),C(null),L(null),K(null),B(0),F(null),X(null),me(0),N(null),$(null),O([]),Z(t=>t+1),ce(!1),Ae(null),ze(void 0),Se([]),be(t=>t+1));const Ve=Ba({orgSlug:g,virtualMcpId:e,branch:o}),Kt=so((t,s)=>{Ve.mutate({blockKey:t,data:s},{onSuccess:()=>u?.(),onError:a=>Q.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:a.message}))})}),Qt=Fa({orgSlug:g,virtualMcpId:e,branch:o}),[Nt,Lt]=V.useState(!1),Ue=V.useRef(null),tt=V.useRef(null),nt=V.useRef(null),Xt=V.useRef({}),Ye=V.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!d||P||R)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(Un,{size:20,className:"animate-spin text-muted-foreground"})});if(!i||!l)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const Vs=Oa(i),Ne=!!m,Ge=Ne?null:Ia(Vs,S,b),w=Ne?m:Ge?.key??null,Zt=Ne&&m?i[m]:void 0,hn=Ne&&m&&Zt?$a(m,Zt):Ne&&m?m:"",Bt=!Ne&&w&&i[w]?i[w]:null,en=I&&i&&l&&w&&Ge?Bn(i,{kind:"page",pageKey:w,pageName:String(Ge.name??""),path:String(Ge.path??"")},l):null,Ns=I?Bt?.seo:void 0,tn=Oe!==void 0?Oe:Ns,Ds=I?Ao(tn):void 0,Ts=en?.seoTypeOptions??[],Ps=I&&l?Mo(l):"",vn=G??Ds??{},nn=I&&en?Ko(vn,en):null,Cs=I&&nn&&Lo(tn)?Gt(nn,l):null,As=I?Bo(i,l)?.seoData:void 0,$e=Ne?[{label:"Default",sections:[{__resolveType:m}]}]:pi(Bt?.sections,i??{}),Ft=$e.length>1,Ce=Math.min(ge,$e.length-1),dt=$e[Ce],W=dt?.sections??[],Me=Ut(W,i),xn=!Ne&&za(Bt?.sections);if(Ne&&m&&Xe!==m){et(m);const t=W[0],s=Me[0];if(t&&s){C(0),me(0),O([]);const a=St(t,s,i);a&&(L(a.data),K(a.resolveType),$(null),N(null))}}!Ne&&Xe!==null&&et(null),Ye.current={rawSections:W,parsedSections:Me,decofile:i??{},activePageKey:w,pageVariants:$e,variantIndex:Ce,sectionVariantIndex:te,selectedSectionIndex:v};const Ms=()=>({multivariate:xn,index:Ce,variants:$e.map(t=>({rule:t.rule}))}),Sn=(t,s)=>{if(!E)return;if(!w||!xn||t.length<=1){E(null);return}const a=Kn(w,{multivariate:!0,index:s,variants:t},i,l);E(a.length>0?a:null)},Et=(t,s,a)=>{if(!E)return;if(!w){E(null);return}const c=Ms(),x=Kn(w,c,i,l);if(!t||s<0){E(x.length>0?x:null);return}const j=lo({pageKey:w,page:c,sectionIndex:s,sectionLazy:Me[s]?.isLazy??!1,mvObj:t,selectedVariantIndex:a,decofile:i,meta:l}),_=[...x,...j];E(_.length>0?_:null)},mt=(t,s,a,c=v??-1,x=!1)=>{const j=Ze(t,s);if(!j){L(null),K(null),$(null),N(null),x&&Et(null,c,a);return}const T=Pn(j,it)[a];if(!T){L(null),K(null),$(null),N(null),x&&Et(null,c,a);return}const ne=Ja(T.value,i);L(ne?.data??null),K(ne?.resolveType??null);const{resolveType:M,formValue:H}=Tt(T.rule,i,l??void 0);$(M),N(H),x&&Et(j,c,a)};if(h!==void 0&&h!==se&&(he(h??null),typeof h=="number")){const t=W[h],s=Me[h];if(t&&s)if(C(h),me(0),O([]),Z(a=>a+1),s.isMultivariate)mt(t,s,0,h);else{const a=St(t,s,i);a?(L(a.data),K(a.resolveType)):(L(null),K(null)),$(null),N(null)}}const Ot={orgSlug:g,virtualMcpId:e,branch:o,previewUrl:f??void 0,siteSlug:z},sn=ue&&l?Gt(ue,l):null,We=(t,s)=>{if(!w)return;Ue.current&&(clearTimeout(Ue.current),Ue.current=null),nt.current&&(clearTimeout(nt.current),nt.current=null),tt.current&&(clearTimeout(tt.current),tt.current=null);const a=Ct(i,w,t,Ce,$e);Ve.mutate({blockKey:w,data:a},{onSuccess:()=>s?.onSuccess?.()??u?.(),onError:c=>Q.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:c.message}))})},kt=()=>{C(null),L(null),K(null),me(0),N(null),$(null),O([]),Z(t=>t+1)},Ks=(t,s)=>{Ue.current&&clearTimeout(Ue.current);const a=Ye.current.sectionVariantIndex;Ue.current=setTimeout(()=>{const{rawSections:c,parsedSections:x,decofile:j,activePageKey:_,pageVariants:T,variantIndex:ne}=Ye.current,M=c[s];if(!M)return;const H=x[s];if(!H)return;if(H.isSavedBlock){const q=H.isLazy?M.section?.__resolveType??M.__resolveType:M.__resolveType;Ve.mutate({blockKey:q,data:t},{onSuccess:()=>u?.(),onError:Y=>Q.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:Y.message}))});return}if(!_)return;const U={...j[_]},Ee=[...c];if(H.isMultivariate){const q=Ze(M,H);if(!q||!_)return;const Y=uo(q,a,t);Ee[s]=bt(M,H,Y)}else if(H.isHidden){const q=Xn(M.__resolveType),Y=q?{...M.section}:{...M},Pe=Array.isArray(Y.variants)?[...Y.variants]:[];Pe[0]&&(Pe[0]={...Pe[0],value:t}),Y.variants=Pe,q?Ee[s]={...M,section:Y}:Ee[s]=Y}else H.isLazy?Ee[s]={...M,section:t}:Ee[s]=t;if(T.length>1){const q=U.sections,Y=[...q?.variants??[]];Y[ne]&&(Y[ne]={...Y[ne],value:Ee}),U.sections={...q,variants:Y}}else U.sections=Ee;Ve.mutate({blockKey:_,data:U},{onSuccess:()=>u?.(),onError:q=>Q.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:q.message}))})},mn)},Ls=t=>{C(t),me(0),O([]),Z(x=>x+1);const s=W[t],a=Me[t];if(!s||!a)return;if(a.isMultivariate){mt(s,a,0,t);return}const c=St(s,a,i);if(!c){L(null),K(null),$(null),N(null),Et(null,t,0);return}L(c.data),K(c.resolveType),$(null),N(null),Et(null,t,0)},bn=t=>{const s=t;L(s),v!==null&&Ks(s,v)},an=t=>{if(!w||!i||!l||!Ge)return;const s={kind:"page",pageKey:w,pageName:String(Ge.name??""),path:String(Ge.path??"")},a=Bn(i,s,l);a&&ut.save(w,()=>{const c=lt.getQueryData(ja.decofile(ct))?.[w];if(!c||typeof c!="object"||c===null||Array.isArray(c))return null;const x={...c,...Xt.current};return Xt.current={},t?.raw!==void 0?{...x,seo:t.raw}:t?.inner!==void 0?Oo(s,a,x,t.inner):x})},Bs=(t,s)=>{w&&(Xt.current[t]=s,an())},Fs=(t,s)=>{if(!w)return;const a=At([...W],t,s);v!==null&&(v===t?C(s):t<v&&s>=v?C(v-1):t>v&&s<=v&&C(v+1)),We(a)},Os=t=>{if(!w)return;const s=W.filter((a,c)=>c!==t);v===t?kt():v!==null&&v>t&&C(v-1),We(s)},Is=t=>{if(!w)return;const s=W[t];if(!s)return;const a=[...W];a.splice(t+1,0,ro(s)),v!==null&&v>t&&C(v+1),We(a)},$s=t=>{if(!w)return;const s=W[t],a=Me[t];if(!s||!a||a.isMultivariate)return;const c=a.isHidden?oo(s):io(s);if(!c)return;const x=[...W];x[t]=c,v===t&&kt(),We(x)},zs=t=>{if(!w)return;const s=W[t],a=Me[t];if(!s||!a||a.isMultivariate)return;const c=ao(s);if(!c)return;const x=[...W];x[t]=c,v===t&&kt(),We(x)},Hs=t=>{if(!w)return;const s=W[t],a=Me[t];if(!s||!a?.isSavedBlock)return;const c=St(s,a,i);if(!c?.data)return;const{name:x,...j}=c.data,_=[...W];a.isLazy?_[t]={...s,section:j}:_[t]=j,v===t&&kt(),We(_)},Gs=t=>{if(!w)return;const s=[...W,{__resolveType:t.resolveType}],a=s.length-1;We(s,{onSuccess:()=>{xe(!1),C(a),me(0),O([]),Z(_=>_+1);const c=s[a],x=Ut(s,i)[a];if(!c||!x)return;if(x.isMultivariate){mt(c,x,0);return}const j=St(c,x,i);if(!j){L(null),K(null),$(null),N(null);return}L(j.data),K(j.resolveType),$(null),N(null)}})},Us=t=>{if(v===null)return;const s=W[v],a=Me[v];!s||!a?.isMultivariate||(me(t),O([]),Z(c=>c+1),mt(s,a,t,v,!0))},Ws=t=>{if(v===null||!w)return;const s=W[v],a=Me[v];if(!s||!a?.isMultivariate)return;const c=Ze(s,a);if(!c)return;const x=to(c,t);if(!x){Q.error(r("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const j=[...W];j[v]=bt(s,a,x);const _=x.variants;let T=te;t===te?T=Math.min(t,_.length-1):t<te&&(T=te-1),me(T),O([]),Z(ne=>ne+1),mt(j[v],a,T),We(j)},qs=t=>{if(v===null||!w)return;const s=W[v],a=Me[v];if(!s||!a?.isMultivariate)return;const c=Ze(s,a);if(!c)return;const x=no(c,t),j=[...W];j[v]=bt(s,a,x);const _=t+1;me(_),O([]),Z(T=>T+1),mt(j[v],a,_),We(j)},Js=(t,s)=>{if(v===null||!w||t===s)return;const a=W[v],c=Me[v];if(!a||!c?.isMultivariate)return;const x=Ze(a,c);if(!x)return;const j=Za(x,t,s),_=[...W];_[v]=bt(a,c,j);let T=te;te===t?T=s:t<te&&s>=te?T=te-1:t>te&&s<=te&&(T=te+1),me(T),mt(_[v],c,T),We(_)},on=t=>{const s=t??v;if(s===null||!w)return;const a=W[s],c=Me[s];if(!a||!c)return;const x=Ya(a,c);if(!x){Q.error(r("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const j=[...W];j[s]=x.section;const _=Ut(j,i)[s];if(!_?.isMultivariate){Q.error(r("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}C(s),me(x.newVariantIndex),O([]),Z(T=>T+1),mt(x.section,_,x.newVariantIndex,s),We(j)},Ys=()=>{if(v===null||!w)return;const t=W[v],s=Me[v];if(!t||!s?.isMultivariate)return;const a=Ze(t,s);if(!a)return;const c=eo(t,s,a);if(!c){Q.error(r("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const x=[...W];x[v]=c;const j=Ut(x,i)[v];if(!j)return;me(0),$(null),N(null),O([]),Z(T=>T+1);const _=St(c,j,i);_?(L(_.data),K(_.resolveType)):(L(null),K(null)),Et(null,v,0),We(x)},Qs=async t=>{if(Le===null||!w)return;const s=dn(t,i);if(s){Q.error(s);return}const a=W[Le],c=Me[Le];if(!a||!c)return;const x=St(a,c,i);if(!x){Q.error(r("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const j={...x.data,name:t};try{await Ve.mutateAsync({blockKey:t,data:j});const _=[...W];_[Le]={__resolveType:t},await Ve.mutateAsync({blockKey:w,data:Ct(i,w,_,Ce,$e)}),v===Le&&kt(),ve(null),Q.success(r("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),u?.()}catch(_){Q.error(_ instanceof Error?_.message:r("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"))}},yn=dt?.rule;if(Ft&&v===null&&J===null&&yn){const{resolveType:t,formValue:s}=Tt(yn,i??{},l??void 0);X(t),F(s)}const It=l?Ha(l):[],_n=l&&i?Ga(l,i):[],Xs=!Ne&&!!(f&&l&&i),Zs=J&&l?Gt(J,l):null,Rt=()=>{tt.current&&(clearTimeout(tt.current),tt.current=null),nt.current&&(clearTimeout(nt.current),nt.current=null)},Dt=async(t,s)=>{if(!(co(s,t,l)>0))try{await Qt.mutateAsync({blockKey:t})}catch(a){Q.error(a instanceof Error?a.message:r("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"))}},jn=t=>{tt.current&&clearTimeout(tt.current),tt.current=setTimeout(()=>{const{activePageKey:s,decofile:a,variantIndex:c}=Ye.current;if(!s)return;const x={...a[s]},j={...x.sections},_=[...j.variants??[]],T=_[c],ne=T?.rule;if(wt(ne,a,l)){const M=ne?.__resolveType??"",H=a[M],U=typeof H?.name=="string"?H.name:M,{__resolveType:Ee,...q}=t;Ve.mutate({blockKey:M,data:Vt(Ee??"",q,U)},{onSuccess:()=>u?.(),onError:Y=>Q.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:Y.message}))});return}T&&(_[c]={...T,rule:t}),x.sections={...j,variants:_},Ve.mutate({blockKey:s,data:x},{onSuccess:()=>u?.(),onError:M=>Q.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:M.message}))})},mn)},ea=t=>{X(t);const s=t?{__resolveType:t}:{__resolveType:Ln};F({}),jn(s)},ta=t=>{const s=t;F(s);const a=J?{__resolveType:J,...s}:{...s};jn(a)},na=async t=>{Rt();const{activePageKey:s,decofile:a,variantIndex:c}=Ye.current;if(!s)return;const x=a[s],j=x?.sections;if(!j||typeof j!="object"||Array.isArray(j))return;const _=j;if(!Array.isArray(_.variants))return;const T=[..._.variants],ne=T[c];if(!ne)return;const M=Pt(ne.rule,a,l),H=qt(t);T[c]={...ne,rule:H};const U={...a,[s]:{...x,sections:{..._,variants:T}}},{resolveType:Ee,formValue:q}=Tt(H,U,l??void 0);X(Ee),F(q);try{await Ve.mutateAsync({blockKey:s,data:U[s]}),M&&M!==t&&await Dt(M,U),u?.()}catch(Y){Q.error(Y instanceof Error?Y.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}},En=t=>{nt.current&&clearTimeout(nt.current);const{selectedSectionIndex:s,sectionVariantIndex:a}=Ye.current;s!==null&&(nt.current=setTimeout(()=>{const{rawSections:c,parsedSections:x,decofile:j,activePageKey:_,pageVariants:T,variantIndex:ne}=Ye.current;if(!_)return;const M=c[s],H=x[s];if(!M||!H?.isMultivariate)return;const U=Ze(M,H);if(!U)return;const q=(U.variants??[])[a]?.rule;if(wt(q,j,l)){const ye=q?.__resolveType??"",qe=j[ye],at=typeof qe?.name=="string"?qe.name:ye,{__resolveType:gt,...ot}=t;Ve.mutate({blockKey:ye,data:Vt(gt??"",ot,at)},{onSuccess:()=>u?.(),onError:ht=>Q.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:ht.message}))});return}const Y=Cn(U,a,t),Pe=[...c];Pe[s]=bt(M,H,Y);const Qe=Ct(j,_,Pe,ne,T);Ve.mutate({blockKey:_,data:Qe},{onSuccess:()=>u?.(),onError:ye=>Q.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:ye.message}))})},mn))},sa=t=>{$(t),N({}),En(t?{__resolveType:t}:{__resolveType:Ln})},aa=t=>{const s=t;N(s);const a=ae?{__resolveType:ae,...s}:{...s};En(a)},oa=async t=>{Rt();const{selectedSectionIndex:s,sectionVariantIndex:a,rawSections:c,parsedSections:x,decofile:j,activePageKey:_,pageVariants:T,variantIndex:ne}=Ye.current;if(s===null||!_)return;const M=c[s],H=x[s];if(!M||!H?.isMultivariate)return;const U=Ze(M,H);if(!U)return;const Ee=U.variants??[],q=Pt(Ee[a]?.rule,j,l),Y=qt(t),Pe=Cn(U,a,Y),Qe=[...c];Qe[s]=bt(M,H,Pe);const ye=Ct(j,_,Qe,ne,T),qe={...j,[_]:ye},{resolveType:at,formValue:gt}=Tt(Y,qe,l??void 0);$(at),N(gt);try{await Ve.mutateAsync({blockKey:_,data:ye}),q&&q!==t&&await Dt(q,qe),u?.()}catch(ot){Q.error(ot instanceof Error?ot.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}};if(!Ne&&!Ge)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.noPageFound",{currentPath:S})});if(Ne&&!Zt)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.globalBlockNotFound")});const ft=v!==null?Me[v]??null:null,kn=v!==null?W[v]:null,Rn=kn&&ft?.isMultivariate?Ze(kn,ft):null,xt=Rn?Pn(Rn,it):[],rn=Math.min(te,Math.max(xt.length-1,0)),$t=xt[rn]??null,pt=ft?.isMultivariate===!0,wn=v!==null&&ft!==null,zt=wn&&(pt||!!(sn&&ie)),ia=zt&&!Ne&&ft?.isSavedBlock===!0,st=Ne||ia,ra=Ne?hn:ft?.label??"",la=ae&&l?Gt(ae,l):null,ln=zt&&(!Ne||re.length>0)?Ne?[hn,...re]:[Ge.name,ft.label,...pt&&$t?[$t.label]:[],...re]:[],ca=I&&Ge?[Ge.name,"SEO",...Be]:[],Ht=I?ca:st?ln.length>0?ln:[ra]:ln,ua=!I&&!Ne&&pt&&re.length===0,Vn=()=>{if(!w)return;Rt(),Ue.current&&(clearTimeout(Ue.current),Ue.current=null);const t=i[w],s=Qa(t.sections,W);if(!s)return;const a=Xa(s);Ve.mutate({blockKey:w,data:{...t,sections:s}},{onSuccess:()=>{B(a),C(null),L(null),K(null),O([]),F(null),X(null)},onError:c=>Q.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:c.message}))})},cn=(t,s,a)=>{if(!w)return;Rt(),Ue.current&&(clearTimeout(Ue.current),Ue.current=null);const c=i[w],x=c.sections;if(!x||typeof x!="object"||Array.isArray(x))return;const j=x;if(!Array.isArray(j.variants))return;const _=t([...j.variants]);if(!_)return;const T=mo(j,_),ne={...i,[w]:{...c,sections:T}};Ve.mutate({blockKey:w,data:ne[w]},{onSuccess:()=>{s?.(),a&&Dt(a,ne)},onError:M=>Q.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:M.message}))})},da=t=>{oe(null),B(t),C(null),L(null),K(null),O([]);const s=$e[t]?.rule,{resolveType:a,formValue:c}=Tt(s,i??{},l??void 0);X(a),F(c),Sn($e.map(x=>({rule:x.rule})),t)},ma=(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),B(a);const c=At($e.map(x=>({rule:x.rule})),t,s);Sn(c,a),cn(x=>At(x,t,s))},fa=t=>{const s=$e[t]?.rule,a=Pt(s,i??{},l??void 0);cn(c=>c.length<=1?null:(c.splice(t,1),c),()=>{$e.length-1===1?B(0):t<Ce?B(Ce-1):t===Ce&&B(Math.max(0,t-1)),C(null),L(null),K(null),O([]),F(null),X(null)},a)},pa=t=>{cn(s=>fo(s,t),()=>{B(t+1),C(null),L(null),K(null),O([]),F(null),X(null)})},ga=async(t,s)=>{Rt();const a=Ye.current.activePageKey,c=Ye.current.decofile;if(!a)return;const x=c[a],j=x.sections;if(!j||typeof j!="object"||Array.isArray(j))return;const _=j;if(!Array.isArray(_.variants))return;const T=[..._.variants],ne=T[t];if(!ne?.rule||typeof ne.rule!="object"){Q.error(r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const M=ne.rule,H=s.trim();Lt(!0);try{if(!H){if(!wt(M,c,l)){oe(null);return}const Qe=M.__resolveType??"";T[t]={...ne,rule:An(M,c,l)};const ye={...c,[a]:{...x,sections:{..._,variants:T}}};await Ve.mutateAsync({blockKey:a,data:ye[a]}),await Dt(Qe,ye),oe(null),u?.();return}const U=Mn(M,c,l);if(!U){Q.error(r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(U.blockKey){await Ve.mutateAsync({blockKey:U.blockKey,data:Vt(U.resolveType,U.data,H)}),oe(null),u?.();return}const Ee=un(H),q=dn(Ee,c);if(q){Q.error(q);return}const Y=Vt(U.resolveType,U.data,H);let Pe=null;try{await Ve.mutateAsync({blockKey:Ee,data:Y}),Pe=Ee,T[t]={...ne,rule:qt(Ee)},await Ve.mutateAsync({blockKey:a,data:{...x,sections:{..._,variants:T}}}),Pe=null}catch(Qe){throw Pe&&await Qt.mutateAsync({blockKey:Pe}).catch(()=>{}),Qe}oe(null),Q.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:H})),u?.()}catch(U){Q.error(U instanceof Error?U.message:r("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Lt(!1)}},ha=async(t,s)=>{Rt();const{selectedSectionIndex:a,rawSections:c,parsedSections:x,decofile:j,activePageKey:_,pageVariants:T,variantIndex:ne}=Ye.current;if(a===null||!_)return;const M=c[a],H=x[a];if(!M||!H?.isMultivariate)return;const U=Ze(M,H);if(!U)return;const Ee=U.variants??[],q=Ee[t];if(!q?.rule||typeof q.rule!="object"){Q.error(r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const Y=q.rule,Pe=s.trim();Lt(!0);const Qe=async ye=>{const qe={...U,variants:ye},at=[...c];at[a]=bt(M,H,qe);const gt=Ct(j,_,at,ne,T);return await Ve.mutateAsync({blockKey:_,data:gt}),{...j,[_]:gt}};try{if(!Pe){if(!wt(Y,j,l)){le(null);return}const ht=Y.__resolveType??"",Tn=[...Ee];Tn[t]={...q,rule:An(Y,j,l)};const ya=await Qe(Tn);await Dt(ht,ya),le(null),u?.();return}const ye=Mn(Y,j,l);if(!ye){Q.error(r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(ye.blockKey){await Ve.mutateAsync({blockKey:ye.blockKey,data:Vt(ye.resolveType,ye.data,Pe)}),le(null),u?.();return}const qe=un(Pe),at=dn(qe,j);if(at){Q.error(at);return}const gt=Vt(ye.resolveType,ye.data,Pe);let ot=null;try{await Ve.mutateAsync({blockKey:qe,data:gt}),ot=qe;const ht=[...Ee];ht[t]={...q,rule:qt(qe)},await Qe(ht),ot=null}catch(ht){throw ot&&await Qt.mutateAsync({blockKey:ot}).catch(()=>{}),ht}le(null),Q.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:Pe})),u?.()}catch(ye){Q.error(ye instanceof Error?ye.message:r("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Lt(!1)}},Nn=()=>{kt()},va=t=>{Ae(t),an({inner:t})},xa=t=>{ze(t),an({raw:t})},Sa=()=>{Ae(null),Se([])},ba=()=>be(t=>t+1),Dn=t=>{if(I){if(t===0){ut.flush(),ce(!1),Ae(null),ze(void 0),Se([]),be(a=>a+1),k?.();return}if(t===1){Se([]),be(a=>a+1);return}Se(Be.slice(0,t-1)),be(a=>a+1);return}if(Ne){O(re.slice(0,t)),Z(a=>a+1);return}if(t===0){Nn();return}if(t===1){O([]),Z(a=>a+1);return}if(pt&&t===2){O([]),Z(a=>a+1);return}const s=pt?2:1;O(re.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:st||zt||I?n.jsxs("div",{className:Fe("border-b px-3 py-2.5",st&&"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:()=>Dn(po(Ht.length,{isMultivariateSectionTop:ua})),title:r("sectionsEditor.sectionsEditor.back"),"aria-label":r("sectionsEditor.sectionsEditor.back"),className:Fe("shrink-0 inline-flex size-6 items-center justify-center rounded-md transition-colors",st?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:n.jsx(ls,{className:"size-4"})}),!Ne&&Ft&&dt&&n.jsxs("button",{type:"button",onClick:Nn,title:r("sectionsEditor.sectionsEditor.editingInVariant",{variant:dt.label}),className:Fe("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",fi),children:[n.jsx(bs,{rule:Mt(dt.rule,i??{},l??void 0),matchers:It}),n.jsx("span",{className:"max-w-[160px] truncate",children:dt.label})]}),n.jsx("nav",{"aria-label":r("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(cs,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>Dn(s),title:t,className:Fe("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",a?st?"font-semibold text-global-section-fg dark:text-global-section-fg-dark":"font-medium text-foreground":st?"text-foreground/80":"text-muted-foreground",st?"hover:bg-global-section/15":"hover:bg-accent hover:text-accent-foreground"),children:t})]},`${t}-${s}`)})}),st&&n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(bo,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(jt,{side:"bottom",className:"max-w-[260px]",children:r("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),wn&&!pt&&!ft?.isHidden&&w&&n.jsx(zn,{onClick:()=>on()})]}),st&&n.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:r("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(gi,{pageKey:w,initialName:Ge.name,initialPath:Ge.path,onFieldChange:Bs})}),n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Je,{type:"button",variant:"ghost",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:()=>ce(!0),children:n.jsx(vo,{size:14})})}),n.jsx(jt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.editSeo")})]}),n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Je,{type:"button",variant:"ghost",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>D&&w?D(w):_e(!0),children:n.jsx(xo,{size:14})})}),n.jsx(jt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.viewJson")})]}),n.jsx(zn,{onClick:Vn})]})}),I?n.jsx(Jt,{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&&w?n.jsx(Fo,{rawSeo:tn,innerSeo:vn,defaultResolveType:Ps,seoSchema:Cs,activeResolveType:nn,seoTypeOptions:Ts,formResetKey:we,siteDefaultSeo:As,onBreadcrumbChange:Se,onPersistRaw:xa,onInnerChange:va,onClearForm:Sa,onBumpFormKey:ba}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:r("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})}):zt?n.jsxs(Jt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[pt&&xt.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(Ua,{listKey:`${w??""}:${v??""}`,variants:xt.map((t,s)=>({index:s,label:t.label})),selectedIndex:rn,onSelect:Us,onRename:le,onDuplicate:qs,onDelete:Ws,onRemoveAll:Ys,onReorder:Js,onAdd:()=>on()}),pt&&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:r("sectionsEditor.sectionsEditor.variantRule")}),n.jsx(Hn,{currentRt:ae??"",currentLabel:Wt($t?.rule,i??{},it,l??void 0),currentGlobalKey:Pt($t?.rule,i??{},l??void 0)??void 0,matchers:It,globals:_n,onSelect:sa,onSelectGlobal:oa,schema:la,formValue:Ie,onChange:aa,formKey:`${v??"none"}:${rn}:${ae??""}`,formWrapperClassName:"pt-1",meta:l??void 0,decofile:i,onSaveReferencedBlock:Kt,sandbox:Ot})]})]}),n.jsx($n,{activeSchema:sn,formValue:ie,formResetKey:Ke,onFormChange:bn,onBreadcrumbChange:O,breadcrumbPath:re,emptyMessage:r("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:l,decofile:i,onSaveReferencedBlock:Kt,sandbox:Ot})]}):Ne?n.jsx(Jt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx($n,{activeSchema:sn,formValue:ie,formResetKey:Ke,onFormChange:bn,onBreadcrumbChange:O,breadcrumbPath:re,emptyMessage:r("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:l,decofile:i,onSaveReferencedBlock:Kt,sandbox:Ot})}):n.jsxs(Jt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[Ft&&w&&n.jsx(ui,{listKey:w,variants:$e,activeIndex:Ce,decofile:i??{},meta:l,matchers:It,onSelect:da,onReorder:ma,onRename:oe,onDuplicate:pa,onDelete:fa,onAdd:Vn}),Ft&&J!==null&&n.jsxs("div",{className:Fe("px-3 border-b",pe?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>ke(t=>!t),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer rounded-sm py-0.5 hover:bg-muted/40","aria-expanded":pe,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:r("sectionsEditor.sectionsEditor.variantRule")}),pe?n.jsx(So,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(go,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),pe&&n.jsx("div",{className:Fe("space-y-3",Nt&&"pointer-events-none opacity-50"),children:n.jsx(Hn,{currentRt:J,currentLabel:Wt(dt?.rule,i??{},it,l??void 0),currentGlobalKey:Pt(dt?.rule,i??{},l??void 0)??void 0,matchers:It,globals:_n,onSelect:ea,onSelectGlobal:na,schema:Zs,formValue:fe,onChange:ta,formKey:`${Ce}:${J??""}`,formWrapperClassName:"space-y-3",meta:l??void 0,decofile:i,onSaveReferencedBlock:Kt,sandbox:Ot})})]}),n.jsx("div",{className:"p-2 pt-3",children:n.jsx(ti,{listKey:`${w??""}-${Ce}`,rawSections:W,sections:Me,meta:l,selectedIndex:v,onSelect:Ls,onReorder:Fs,onDelete:Os,onDuplicate:Is,onMakeReusable:ve,onToggleHidden:$s,onToggleLazy:zs,onAddVariant:on,onDetach:Hs,onAddSection:()=>xe(!0),canAddSection:Xs})})]}),n.jsx(Wa,{open:Le!==null,onOpenChange:t=>{t||ve(null)},defaultBlockId:Le!==null?un(Me[Le]?.label??""):"",isPending:Ve.isPending,onSubmit:Qs}),f&&n.jsx($o,{open:Re,onOpenChange:xe,meta:l,decofile:i,previewBaseUrl:f,onSelect:Gs}),De&&w&&i&&n.jsx(qa,{open:De,onOpenChange:_e,pageKey:w,decofile:i}),de!==null&&n.jsx(On,{open:!0,initialName:wt($e[de]?.rule,i??{},l??void 0)?Wt($e[de]?.rule,i??{},it,l??void 0):"",autoLabel:it(Mt($e[de]?.rule,i??{},l??void 0)),isPending:Nt,onSubmit:async t=>{await ga(de,t)},onOpenChange:t=>{!t&&!Nt&&oe(null)}}),ee!==null&&n.jsx(On,{open:!0,initialName:wt(xt[ee]?.rule,i??{},l??void 0)?Wt(xt[ee]?.rule,i??{},it,l??void 0):"",autoLabel:it(Mt(xt[ee]?.rule,i??{},l??void 0)),isPending:Nt,onSubmit:async t=>{await ha(ee,t)},onOpenChange:t=>{!t&&!Nt&&le(null)}})]})}export{fc as SectionsEditor};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/registry-layout-D_xzQ7SH.js","assets/index-fi0f1C_U.js","assets/index-DUF5arcS.css","assets/Tool02-DXkhQkf7.js","assets/CheckCircle-vxKWSGjq.js","assets/Settings02-DBXlrfF_.js","assets/use-mcp-client-D0JJUSC_.js","assets/auth-uY-yd_Qx.js","assets/useInfiniteQuery-CXTRQ-Dk.js","assets/use-infinite-scroll-unU2jvvl.js","assets/studio-tools-DyE5uoU2.js","assets/badge-C3f1raKX.js","assets/input-CB7a8Fqy.js","assets/dropdown-menu-Cga-_vD5.js","assets/Check-CbFEdDFo.js","assets/ChevronRight-5eA6ROzl.js","assets/DotsVertical-DF3Be14k.js","assets/table-BMvSP1FF.js","assets/toggle-group-HR0MkXiQ.js","assets/use-view-mode-BaFDl4Go.js","assets/use-mobile-BBy2stTu.js","assets/FilterLines-CV0dxqQH.js","assets/Globe01-K7604lAF.js","assets/SearchMd-w82MFsfG.js","assets/dialog-C9LdhEJ8.js","assets/X-CUF99Lsu.js","assets/AlertCircle-nsAOhmc5.js","assets/Upload01-iZa_BxIK.js","assets/metadata-dUsYcpuu.js","assets/alert-dialog-BIM3ZQ61.js","assets/card-Cz1w-KeT.js","assets/Trash01-JNWsD9zI.js","assets/label-B6kQLTZ2.js","assets/select-Dj6isKXJ.js","assets/tooltip-eTUejMvR.js","assets/ChevronDown-CXe6JgOB.js","assets/ChevronUp-ClePnk1p.js","assets/switch-BrBVeEiU.js","assets/textarea-DTuWp8dQ.js","assets/ArrowRight-W78pWgya.js","assets/XCircle-BTCzfXYC.js","assets/checkbox-HZxDl7MX.js","assets/Eye-CCFNdeEl.js","assets/LinkExternal01-BIeTlaI1.js","assets/use-copy-CILQcfx6.js","assets/Copy01-D_I4zLJq.js","assets/Key01-HnuEM_kB.js","assets/Plus-DS3KKDHn.js","assets/mcp-oauth-BdVW-uBg.js","assets/Play-anRYH6K1.js"])))=>i.map(i=>d[i]);
2
- import{c as m,d as n,f as c,j as t,k as f,r as l,aF as p}from"./index-fi0f1C_U.js";import{R as u}from"./require-capability-BShwVM7q.js";import"./use-capability-DrqR3_St.js";import"./access-gate-CkbeCvYc.js";import"./capability-load-error-oSOBjNiW.js";const g=l.lazy(()=>p(()=>import("./registry-layout-D_xzQ7SH.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49])));function j(){const e=m.c(5),i=n();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org"},e[0]=s):s=e[0];const{org:o}=c(s);let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"h-full flex items-center justify-center",children:t.jsx(f,{size:20,className:"animate-spin text-muted-foreground"})}),e[1]=r):r=e[1];let a;return e[2]!==i||e[3]!==o?(a=t.jsx(u,{capability:"registry:manage",area:"the registry",children:t.jsx(l.Suspense,{fallback:r,children:t.jsx(g,{onBack:()=>i({to:"/$org/settings/store",params:{org:o}})})})}),e[2]=i,e[3]=o,e[4]=a):a=e[4],a}export{j as default};
@@ -1 +0,0 @@
1
- import{I as u}from"./use-infinite-scroll-unU2jvvl.js";import{dW as i}from"./index-fi0f1C_U.js";function t(e,r){return i(e,u,r)}export{t as u};
@@ -1 +0,0 @@
1
- import{I as s}from"./use-infinite-scroll-unU2jvvl.js";import{dW as u,V as n}from"./index-fi0f1C_U.js";function a(r,e){return u({...r,enabled:!0,suspense:!0,throwOnError:n},s,e)}export{a as u};