decocms 2.367.38 → 2.369.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 (248) hide show
  1. package/dist/client/assets/{AlertCircle-CVwjiL5t.js → AlertCircle-BCHNBTJj.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-BsdiWOZ_.js → ArrowUpRight-DOVZA3k4.js} +1 -1
  3. package/dist/client/assets/{Check-BIvjG7jh.js → Check-B34N9tsV.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-naAuY0Am.js → CheckCircle-CFtTCxLL.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-2DdfyPVo.js → ChevronDown-Dr50fepz.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-Djwmm7yx.js → ChevronRight-CISMqQmL.js} +1 -1
  7. package/dist/client/assets/{ChevronUp-CYign-Xr.js → ChevronUp-Caidv6lK.js} +1 -1
  8. package/dist/client/assets/{Container-BYMVUIOR.js → Container-B1RIjk98.js} +1 -1
  9. package/dist/client/assets/{DotsVertical-6XBT76_0.js → DotsVertical-rWYOU3RE.js} +1 -1
  10. package/dist/client/assets/{FilterLines-xU-m-2To.js → FilterLines-Bdqyhomu.js} +1 -1
  11. package/dist/client/assets/{HardDrive-CPUYFXaj.js → HardDrive-DoscLgG-.js} +1 -1
  12. package/dist/client/assets/{Key01-CTY2QvpD.js → Key01-BoIyqgwL.js} +1 -1
  13. package/dist/client/assets/{LayoutLeft-BA4wxcAF.js → LayoutLeft-D7dJReEM.js} +1 -1
  14. package/dist/client/assets/{LinkExternal01-Dn8eWUjC.js → LinkExternal01-DVJRR2up.js} +1 -1
  15. package/dist/client/assets/{Lock01-DzYUukb5.js → Lock01-Bk5T6G6y.js} +1 -1
  16. package/dist/client/assets/{Monitor01-nKIM1K_1.js → Monitor01-5rN-C0di.js} +1 -1
  17. package/dist/client/assets/{Palette-B6NpJZ9F.js → Palette-B-cRX_Fx.js} +1 -1
  18. package/dist/client/assets/{Play-qd-MZyD5.js → Play-BsXLejZM.js} +1 -1
  19. package/dist/client/assets/{Plus-Cq_1PqM9.js → Plus-beS007Js.js} +1 -1
  20. package/dist/client/assets/{RefreshCcw01-CYXiv82D.js → RefreshCcw01-Dcpv3eTL.js} +1 -1
  21. package/dist/client/assets/{SearchMd-WZzMz_xm.js → SearchMd-CB2F2Eh5.js} +1 -1
  22. package/dist/client/assets/{Settings02-BGX5GQSJ.js → Settings02-DB_WZ-LQ.js} +1 -1
  23. package/dist/client/assets/{Shield01-Dd3PCkCh.js → Shield01-D_j6WQ24.js} +1 -1
  24. package/dist/client/assets/{Star01-TIrOjEGQ.js → Star01-CH8zsyZS.js} +1 -1
  25. package/dist/client/assets/{Stars02-BgabhO3x.js → Stars02-CH6m9NsR.js} +1 -1
  26. package/dist/client/assets/{Sun-BMF5NYnu.js → Sun-vCQYJllf.js} +1 -1
  27. package/dist/client/assets/{SwitchHorizontal01-B39nOlBz.js → SwitchHorizontal01-BXOMQbPs.js} +1 -1
  28. package/dist/client/assets/{Tool01-CAdd6NGF.js → Tool01-B1_kF5r4.js} +1 -1
  29. package/dist/client/assets/{Trash01-CHrTm5S-.js → Trash01-Dv-uw8l0.js} +1 -1
  30. package/dist/client/assets/{Upload01-CfhmyOeM.js → Upload01-Dei9Gr0H.js} +1 -1
  31. package/dist/client/assets/{User01-CnVuEZ_q.js → User01-DuylSQbh.js} +1 -1
  32. package/dist/client/assets/{Users01-CARILaym.js → Users01-BWQyCQSo.js} +1 -1
  33. package/dist/client/assets/{Users03-COREII3z.js → Users03-Xhe-Woui.js} +1 -1
  34. package/dist/client/assets/{X-CexC7CUQ.js → X-DgjPW3BN.js} +1 -1
  35. package/dist/client/assets/XCircle-Kzv3aw-k.js +1 -0
  36. package/dist/client/assets/{XClose-BOJwjK3-.js → XClose-C8_9CjoM.js} +1 -1
  37. package/dist/client/assets/{Zap-DRsZpKeC.js → Zap-Co2SfCXQ.js} +1 -1
  38. package/dist/client/assets/{ZapSquare-rxLTzaCI.js → ZapSquare-BGWKuepx.js} +1 -1
  39. package/dist/client/assets/{accordion-DEFWqB9v.js → accordion-Bf2zVAiI.js} +1 -1
  40. package/dist/client/assets/{add-connection-dialog-CJWirXjW.js → add-connection-dialog-wVzM7TTa.js} +1 -1
  41. package/dist/client/assets/agent-icon-DAOer5aY.js +1 -0
  42. package/dist/client/assets/{agent-icons-BMYEM-93.js → agent-icons-DNhkZE7D.js} +1 -1
  43. package/dist/client/assets/agents-list-DABEUXXh.js +1 -0
  44. package/dist/client/assets/{ai-providers-DOK2_evy.js → ai-providers-ra9PS9Te.js} +1 -1
  45. package/dist/client/assets/{alert-DsUJkc45.js → alert-B8IvxWyW.js} +1 -1
  46. package/dist/client/assets/{alert-dialog-DJnXid5j.js → alert-dialog-CBy2mP5M.js} +3 -3
  47. package/dist/client/assets/{auth-catchall-D2kMqSF3.js → auth-catchall-DwI_DCPg.js} +1 -1
  48. package/dist/client/assets/{auth-split-layout-DNx4VwCy.js → auth-split-layout-CPl1Ogax.js} +1 -1
  49. package/dist/client/assets/{automation-list-row-9h6JxfVT.js → automation-list-row-DPAKg98L.js} +1 -1
  50. package/dist/client/assets/automations-vmGkl90g.js +1 -0
  51. package/dist/client/assets/{avatar-ByQQ7GEH.js → avatar-CBIJBj_W.js} +1 -1
  52. package/dist/client/assets/{badge-Dci-e_Pw.js → badge-CXArobm8.js} +1 -1
  53. package/dist/client/assets/{brand-context-CQ0JpFGU.js → brand-context-BHVsDYH_.js} +1 -1
  54. package/dist/client/assets/{card-CqaEJI_U.js → card-CNyFBXf4.js} +1 -1
  55. package/dist/client/assets/{chat-context-DxSqonhB.js → chat-context-BWXApvuA.js} +1 -1
  56. package/dist/client/assets/{checkbox-DdM7zWwz.js → checkbox-D1Q1psVt.js} +1 -1
  57. package/dist/client/assets/{cli-auth-success-W0LeKzND.js → cli-auth-success-Cv251YT1.js} +1 -1
  58. package/dist/client/assets/collection-detail-4oC2alH8.js +1 -0
  59. package/dist/client/assets/{collection-display-button-Bb5eYsxS.js → collection-display-button-CxfftABc.js} +1 -1
  60. package/dist/client/assets/{collection-search-CZPmAdbz.js → collection-search-CtjpA7Tw.js} +1 -1
  61. package/dist/client/assets/{collection-search-DYkFJwme.js → collection-search-D3hp8frj.js} +1 -1
  62. package/dist/client/assets/{collection-table-wrapper-VrRyg9Ib.js → collection-table-wrapper-htzX5Cc-.js} +1 -1
  63. package/dist/client/assets/{collection-tabs-BME6pm9f.js → collection-tabs-B9KC7Uhn.js} +1 -1
  64. package/dist/client/assets/{collections-CuEt9akO.js → collections-CEURDRm7.js} +1 -1
  65. package/dist/client/assets/{command-DaAuDqUV.js → command-BTA7LUZM.js} +1 -1
  66. package/dist/client/assets/{connect-desktop-dialog-v3Y8dgGN.js → connect-desktop-dialog-DygjlLBa.js} +1 -1
  67. package/dist/client/assets/{connection-card-BY9Z3I7R.js → connection-card-4Md1PbMA.js} +1 -1
  68. package/dist/client/assets/connection-detail-k_WdL2vk.js +1 -0
  69. package/dist/client/assets/{connection-form-helpers-M4qUZwhZ.js → connection-form-helpers-DI61y2e0.js} +1 -1
  70. package/dist/client/assets/connections-CMhBDlPe.js +1 -0
  71. package/dist/client/assets/{constants-piR0edM1.js → constants-D5RCRPRT.js} +1 -1
  72. package/dist/client/assets/{decopilot-sse-pool-DWRmePhE.js → decopilot-sse-pool-BgB0FvkR.js} +1 -1
  73. package/dist/client/assets/{dialog-Bg6eRMC4.js → dialog-2y75M1_6.js} +1 -1
  74. package/dist/client/assets/{domain-settings-CHHiS2Vl.js → domain-settings-qIsJxkrR.js} +1 -1
  75. package/dist/client/assets/{drawer-q5yKuLmY.js → drawer-W7QX6Ax_.js} +1 -1
  76. package/dist/client/assets/{dropdown-menu-TulqWZOe.js → dropdown-menu-9FoS_14a.js} +1 -1
  77. package/dist/client/assets/{dynamic-plugin-layout-DEIRfHv3.js → dynamic-plugin-layout-DE7Rx2Mh.js} +1 -1
  78. package/dist/client/assets/{empty-state-CKtqz2A5.js → empty-state-BlF5e09g.js} +1 -1
  79. package/dist/client/assets/{empty-state-ZqctI9xZ.js → empty-state-CRPtBPjo.js} +1 -1
  80. package/dist/client/assets/{extract-connection-data-BYGRbWJu.js → extract-connection-data-CtQqD73R.js} +1 -1
  81. package/dist/client/assets/features-6QwqoSn3.js +1 -0
  82. package/dist/client/assets/file-explorer-C9P9tLrr.js +2 -0
  83. package/dist/client/assets/{files-CXeAP3oD.js → files-B8cc-gBv.js} +1 -1
  84. package/dist/client/assets/{form-B-pClhzT.js → form-BVQywbIc.js} +1 -1
  85. package/dist/client/assets/general-CnRlBB-m.js +1 -0
  86. package/dist/client/assets/{generate-id-DfUEx9en.js → generate-id-CpWgmfmA.js} +1 -1
  87. package/dist/client/assets/{github-repo-picker-A9GOBLjA.js → github-repo-picker-DmuX5zhB.js} +1 -1
  88. package/dist/client/assets/{hooks-Buro5ByR.js → hooks-18b6g3fs.js} +1 -1
  89. package/dist/client/assets/{hover-card-CUfoIFQV.js → hover-card-DOoMOMFv.js} +1 -1
  90. package/dist/client/assets/index-0fMq3-pH.js +1 -0
  91. package/dist/client/assets/{index-BDOr2buP.js → index-8_y4UNLc.js} +1 -1
  92. package/dist/client/assets/{index-B_5hPR5_.js → index-B6vP9EOZ.js} +1 -1
  93. package/dist/client/assets/{index-C_m1_Qyy.js → index-BM33-uTI.js} +27 -27
  94. package/dist/client/assets/{index-DjuWoEWL.js → index-B_mvEXXb.js} +1 -1
  95. package/dist/client/assets/{index-Df1UV_SS.js → index-Bn5sNNK8.js} +1 -1
  96. package/dist/client/assets/{index-zGvFjFjO.js → index-BwE83rPX.js} +1 -1
  97. package/dist/client/assets/{index-CdCX0F7Y.js → index-C0gY1SEz.js} +4 -4
  98. package/dist/client/assets/{index-BHpJxImt.js → index-CZU3_Yg-.js} +2 -2
  99. package/dist/client/assets/{index-Wwb5vGkQ.js → index-Ct4M2Ud6.js} +1 -1
  100. package/dist/client/assets/index-D6GfXYzs.js +1 -0
  101. package/dist/client/assets/{index-CKs6rcu1.js → index-DHCuljhb.js} +1 -1
  102. package/dist/client/assets/{index-DKWbd0LS.js → index-g7KxjIc5.js} +2 -2
  103. package/dist/client/assets/index-k6iT8Tf1.js +1 -0
  104. package/dist/client/assets/{index-B55MEl-c.js → index-oIPZXuqi.js} +1 -1
  105. package/dist/client/assets/{index-DvIjF9DA.js → index-vupo1sDr.js} +13 -13
  106. package/dist/client/assets/{infiniteQueryObserver-CUomJPae.js → infiniteQueryObserver-DjZk0454.js} +1 -1
  107. package/dist/client/assets/{input-DHJ18fY7.js → input-DyimJ0YM.js} +1 -1
  108. package/dist/client/assets/{integration-icon-Bo72bKVV.js → integration-icon-D9qjqDnw.js} +1 -1
  109. package/dist/client/assets/{label-jUTi8Oc4.js → label-CYBEQrtl.js} +1 -1
  110. package/dist/client/assets/{layout-PcloJcLR.js → layout-CwSzvRV6.js} +1 -1
  111. package/dist/client/assets/{login-C1Yqpj4I.js → login-BwJgBWmn.js} +1 -1
  112. package/dist/client/assets/{members-x8tMmNra.js → members-SZUmLKla.js} +1 -1
  113. package/dist/client/assets/{monaco-editor-D-22abDQ.js → monaco-editor-BYDkxeGd.js} +3 -3
  114. package/dist/client/assets/{monitoring-stats-row-DkPBMjPc.js → monitoring-stats-row-8DFwtJdG.js} +1 -1
  115. package/dist/client/assets/{oauth-callback-5B-GDOKs.js → oauth-callback-D3HQSih9.js} +1 -1
  116. package/dist/client/assets/{oauth-callback-ai-provider-KqAiGkB8.js → oauth-callback-ai-provider-hlYQfy41.js} +1 -1
  117. package/dist/client/assets/{onboarding-BQaPrCwV.js → onboarding-ClFOQyD0.js} +1 -1
  118. package/dist/client/assets/{org-layout-DOPcV20w.js → org-layout-CQSZYn7L.js} +1 -1
  119. package/dist/client/assets/{org-plugin-layout-BlQBf5vT.js → org-plugin-layout-CkozoVe-.js} +1 -1
  120. package/dist/client/assets/{pair-DgOi01tx.js → pair-XXkclPo3.js} +1 -1
  121. package/dist/client/assets/{plugin-empty-state-qP6k2hvb.js → plugin-empty-state-DcMxNkqz.js} +1 -1
  122. package/dist/client/assets/{plugin-header-D3WS6Tch.js → plugin-header-RG7So6zC.js} +1 -1
  123. package/dist/client/assets/{plugin-layout--Nx4BaLL.js → plugin-layout-1Sg2oR8k.js} +1 -1
  124. package/dist/client/assets/{popover-COqcQ0Rg.js → popover-DOu91n_v.js} +1 -1
  125. package/dist/client/assets/{profile-DZu-CjT9.js → profile-Bu4-Eb6R.js} +1 -1
  126. package/dist/client/assets/project-app-view-yK_XWVMG.js +1 -0
  127. package/dist/client/assets/registry-D1JNm-Xx.js +2 -0
  128. package/dist/client/assets/{registry-layout-B6kU_bv7.js → registry-layout-BmtyLpq5.js} +3 -3
  129. package/dist/client/assets/{required-auth-layout-CJnuX5pr.js → required-auth-layout-tzyLq2cT.js} +1 -1
  130. package/dist/client/assets/{reset-password-B2Ia2er4.js → reset-password-CsA4hRoj.js} +1 -1
  131. package/dist/client/assets/roles-dL46UDfg.js +1 -0
  132. package/dist/client/assets/{search-input-BX9Kn801.js → search-input-DHqGiAAb.js} +1 -1
  133. package/dist/client/assets/{secrets-BEffGZyZ.js → secrets-CXaOA3bo.js} +1 -1
  134. package/dist/client/assets/sections-editor-AHG3CG-Y.js +1 -0
  135. package/dist/client/assets/{select-DAV_VIox.js → select-C7bkDnqt.js} +1 -1
  136. package/dist/client/assets/settings-layout-MCrWdztj.js +1 -0
  137. package/dist/client/assets/{settings-section-DLBjUAhp.js → settings-section-DFOkupJ0.js} +1 -1
  138. package/dist/client/assets/{shell-controls-CNwl3y79.js → shell-controls-jx6fo9En.js} +1 -1
  139. package/dist/client/assets/shell-layout-BgY4DXFm.js +1 -0
  140. package/dist/client/assets/{sidebar-BFp8v2I0.js → sidebar-Dne1fKYn.js} +1 -1
  141. package/dist/client/assets/{skeleton-tYEs8dsN.js → skeleton-BiCcS3UT.js} +1 -1
  142. package/dist/client/assets/{sortable.esm-vK1UhoBn.js → sortable.esm-BQrMCI5H.js} +1 -1
  143. package/dist/client/assets/{spinner-DLBC6d93.js → spinner-Bb25iFDc.js} +1 -1
  144. package/dist/client/assets/{sso-BvpZRsH4.js → sso-MK5Q0tuC.js} +1 -1
  145. package/dist/client/assets/{store-DMo12WtF.js → store-Cu8faowN.js} +1 -1
  146. package/dist/client/assets/store-registry-DYz-eLFY.js +2 -0
  147. package/dist/client/assets/{switch-Bmqleb0M.js → switch-STNewpCh.js} +1 -1
  148. package/dist/client/assets/{table-Cbi2Lt5J.js → table-BR0ZQG-N.js} +1 -1
  149. package/dist/client/assets/{tabs-DKgnbdu4.js → tabs-BIXB9X7f.js} +1 -1
  150. package/dist/client/assets/{task-status-CqP04HQ9.js → task-status-Cpj07cgX.js} +1 -1
  151. package/dist/client/assets/{textarea-C035ZOMR.js → textarea-Csq7UfFg.js} +1 -1
  152. package/dist/client/assets/{toggle-group-D_tMezdr.js → toggle-group-Cvm94FnA.js} +1 -1
  153. package/dist/client/assets/toolbar-BFZ_P1su.js +1 -0
  154. package/dist/client/assets/{tools-list-DmcpkTFh.js → tools-list-BG_WhFGX.js} +1 -1
  155. package/dist/client/assets/{tooltip-BeTs1OMg.js → tooltip-GbZ-ULDS.js} +1 -1
  156. package/dist/client/assets/{types-BZ3eurxp.js → types-BGMjh8Dq.js} +5 -5
  157. package/dist/client/assets/{use-ai-providers-CgowGcDz.js → use-ai-providers-CaxnWnZW.js} +1 -1
  158. package/dist/client/assets/{use-collections-D_7JW6dX.js → use-collections-DnQvffUs.js} +1 -1
  159. package/dist/client/assets/{use-connection-BbCw9KPq.js → use-connection-CRCT5mv0.js} +1 -1
  160. package/dist/client/assets/{use-copy-DbsD5qK3.js → use-copy-Bx-USwd1.js} +1 -1
  161. package/dist/client/assets/{use-create-virtual-mcp-DJVm-5Gn.js → use-create-virtual-mcp-DgE9-y_o.js} +1 -1
  162. package/dist/client/assets/{use-debounced-autosave-B4_HunOp.js → use-debounced-autosave-BBZX5k0R.js} +1 -1
  163. package/dist/client/assets/{use-delete-connection-B0yMHUHX.js → use-delete-connection-BXEk19GO.js} +1 -1
  164. package/dist/client/assets/{use-file-configs-DEsQ0trh.js → use-file-configs-D9H5_-BE.js} +1 -1
  165. package/dist/client/assets/{use-infinite-scroll-XJXa4_f9.js → use-infinite-scroll-D0a1rm12.js} +1 -1
  166. package/dist/client/assets/{use-list-state-C8eifEnv.js → use-list-state-BN7DRxUQ.js} +1 -1
  167. package/dist/client/assets/{use-mcp-prompts-Cxw_xwII.js → use-mcp-prompts-Bn3MJOn8.js} +1 -1
  168. package/dist/client/assets/{use-mcp-tools-Cg4H0QB3.js → use-mcp-tools-BppARYHs.js} +1 -1
  169. package/dist/client/assets/{use-members-BB2rBOpc.js → use-members-BF_X33y-.js} +1 -1
  170. package/dist/client/assets/{use-navigate-to-agent-CVbR4ICA.js → use-navigate-to-agent-COcSBZ_P.js} +1 -1
  171. package/dist/client/assets/{use-org-auth-client-Bk4CKLSt.js → use-org-auth-client-Bu3yErl5.js} +1 -1
  172. package/dist/client/assets/{use-org-sso-Baws_Cb6.js → use-org-sso-Cbun5-U-.js} +1 -1
  173. package/dist/client/assets/{use-organization-roles-DNG5Wg-t.js → use-organization-roles-BZFkc9QW.js} +1 -1
  174. package/dist/client/assets/{use-organization-settings-BfJ6uqm2.js → use-organization-settings-BgjGLKnf.js} +1 -1
  175. package/dist/client/assets/{use-registry-connections-CRI9AlTc.js → use-registry-connections-0IoXir_p.js} +1 -1
  176. package/dist/client/assets/{use-secrets-CPfeyzy3.js → use-secrets-CUom62Zy.js} +1 -1
  177. package/dist/client/assets/{use-status-sounds-Ch0BXIj1.js → use-status-sounds-BKNm7I6l.js} +1 -1
  178. package/dist/client/assets/{use-view-mode-Bzy-dMu6.js → use-view-mode-CWH9EmAt.js} +1 -1
  179. package/dist/client/assets/{use-virtual-mcp-DXij_fSZ.js → use-virtual-mcp-DA5BI4_W.js} +1 -1
  180. package/dist/client/assets/useInfiniteQuery-C-wnWXsR.js +1 -0
  181. package/dist/client/assets/{useRouterState-DNwJdpeR.js → useRouterState-Rq7IpB5d.js} +1 -1
  182. package/dist/client/assets/useSuspenseInfiniteQuery-Q-NFKrZT.js +1 -0
  183. package/dist/client/assets/{user-D0ZUKhOx.js → user-CpeLJRjb.js} +1 -1
  184. package/dist/client/assets/{view-mode-toggle-DPGq5mgK.js → view-mode-toggle-s0VkAFh3.js} +1 -1
  185. package/dist/client/assets/workflow-DPBHWxQm.js +1 -0
  186. package/dist/client/assets/workflow-detail-Din6OWiM.js +1 -0
  187. package/dist/client/index.html +1 -1
  188. package/dist/server/cli.js +1 -1
  189. package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esm/generated/root.js +36 -6
  190. package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esm/generated/root.js.map +1 -1
  191. package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esm/trace/internal.js +15 -0
  192. package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esm/trace/internal.js.map +1 -1
  193. package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esnext/generated/root.js +36 -6
  194. package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esnext/generated/root.js.map +1 -1
  195. package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esnext/trace/internal.js +15 -0
  196. package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esnext/trace/internal.js.map +1 -1
  197. package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/src/generated/root.js +36 -6
  198. package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/src/generated/root.js.map +1 -1
  199. package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/src/trace/internal.js +15 -0
  200. package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/src/trace/internal.js.map +1 -1
  201. package/dist/server/node_modules/@opentelemetry/otlp-transformer/package.json +12 -14
  202. package/dist/server/node_modules/protobufjs/dist/light/protobuf.js +13 -10
  203. package/dist/server/node_modules/protobufjs/dist/light/protobuf.js.map +1 -1
  204. package/dist/server/node_modules/protobufjs/dist/light/protobuf.min.js +3 -3
  205. package/dist/server/node_modules/protobufjs/dist/light/protobuf.min.js.map +1 -1
  206. package/dist/server/node_modules/protobufjs/dist/minimal/protobuf.js +2 -2
  207. package/dist/server/node_modules/protobufjs/dist/minimal/protobuf.min.js +2 -2
  208. package/dist/server/node_modules/protobufjs/dist/protobuf.js +14 -55
  209. package/dist/server/node_modules/protobufjs/dist/protobuf.js.map +1 -1
  210. package/dist/server/node_modules/protobufjs/dist/protobuf.min.js +3 -3
  211. package/dist/server/node_modules/protobufjs/dist/protobuf.min.js.map +1 -1
  212. package/dist/server/node_modules/protobufjs/package.json +1 -1
  213. package/dist/server/node_modules/protobufjs/src/message.js +7 -3
  214. package/dist/server/node_modules/protobufjs/src/object.js +3 -6
  215. package/dist/server/node_modules/protobufjs/src/parse.js +1 -45
  216. package/dist/server/node_modules/protobufjs/src/type.js +1 -0
  217. package/package.json +1 -1
  218. package/dist/client/assets/ArrowNarrowLeft-C0lNfAd-.js +0 -1
  219. package/dist/client/assets/XCircle-D5rCjCCo.js +0 -1
  220. package/dist/client/assets/agent-icon-C3wnlI99.js +0 -1
  221. package/dist/client/assets/agents-list-B3SpQwX5.js +0 -1
  222. package/dist/client/assets/automations-r03D9cAA.js +0 -1
  223. package/dist/client/assets/collection-detail-CGNHV1EW.js +0 -1
  224. package/dist/client/assets/connection-detail-CGrlvist.js +0 -1
  225. package/dist/client/assets/connections-BV1UPzfV.js +0 -1
  226. package/dist/client/assets/features-D7qzU1ah.js +0 -1
  227. package/dist/client/assets/file-explorer-C4vwodhd.js +0 -2
  228. package/dist/client/assets/general-BHrzNm6e.js +0 -1
  229. package/dist/client/assets/index-2vcb4P4k.js +0 -1
  230. package/dist/client/assets/index-BPYCGyhU.js +0 -1
  231. package/dist/client/assets/index-RQIiwepL.js +0 -1
  232. package/dist/client/assets/project-app-view-CbzbFEPu.js +0 -1
  233. package/dist/client/assets/registry-10Lvnw38.js +0 -2
  234. package/dist/client/assets/roles-Dnu1ERmI.js +0 -1
  235. package/dist/client/assets/sections-editor-6afDX4oI.js +0 -1
  236. package/dist/client/assets/settings-layout-Cs92wKZb.js +0 -1
  237. package/dist/client/assets/shell-layout-BZaILYv9.js +0 -1
  238. package/dist/client/assets/store-registry-BzJ2CQJA.js +0 -2
  239. package/dist/client/assets/toolbar-AIIkxXjs.js +0 -1
  240. package/dist/client/assets/useInfiniteQuery-D0JT5WrD.js +0 -1
  241. package/dist/client/assets/useSuspenseInfiniteQuery-D794zrC9.js +0 -1
  242. package/dist/client/assets/workflow-DkG9K0We.js +0 -1
  243. package/dist/client/assets/workflow-detail-CEB6a5Nl.js +0 -1
  244. package/dist/server/node_modules/ansi-styles/index.d.ts +0 -236
  245. package/dist/server/node_modules/ansi-styles/index.js +0 -223
  246. package/dist/server/node_modules/ansi-styles/license +0 -9
  247. package/dist/server/node_modules/ansi-styles/package.json +0 -54
  248. package/dist/server/node_modules/ansi-styles/readme.md +0 -173
@@ -1 +0,0 @@
1
- import{e as E,r as I,c as be,j as t,B as Se,q as is,a as Ys,K as Qs,E as Zs,l as Ct,L as Js,o as me}from"./index-C_m1_Qyy.js";import{i as os}from"./ChevronRight-Djwmm7yx.js";import{S as xt}from"./monaco-editor-D-22abDQ.js";import{i as Ve,l as lt,s as Ht,G as as,r as Xs,e as en,f as tn,a as sn,b as Wt,u as nn,c as rn,d as ln,g as on,h as an,j as gt,n as cn,A as Gt}from"./index-CdCX0F7Y.js";import{b as un,s as dn,a as Tt}from"./RefreshCcw01-CYXiv82D.js";import{ac as cs,C as Ye,s as Pt,ak as Nt,g as us}from"./agent-icon-C3wnlI99.js";import{s as wt}from"./Plus-Cq_1PqM9.js";import{s as Qe}from"./Trash01-CHrTm5S-.js";import{i as fn}from"./Zap-DRsZpKeC.js";import{a as ot,c as Ae,b as at,D as ct}from"./dropdown-menu-TulqWZOe.js";import{u as mn,a as qt,K as pn,P as hn,b as xn,C as gn,s as vn,d as ds,D as yn,c as bn,S as jn,v as Sn,e as _n}from"./sortable.esm-vK1UhoBn.js";import{I as Ue}from"./input-DHJ18fY7.js";import{T as Nn}from"./textarea-C035ZOMR.js";import{L as Le}from"./label-jUTi8Oc4.js";import{S as wn}from"./switch-Bmqleb0M.js";import{d as fs,a as ms,b as ps,c as hs,S as xs}from"./select-DAV_VIox.js";import{t as gs}from"./ChevronDown-2DdfyPVo.js";import{i as ut}from"./Upload01-CfhmyOeM.js";import{i as kn}from"./AlertCircle-CVwjiL5t.js";import{i as Yt}from"./Check-BIvjG7jh.js";import{i as Cn}from"./DotsVertical-6XBT76_0.js";import{a as Xe}from"./Tool01-CAdd6NGF.js";import{n as Tn}from"./LinkExternal01-Dn8eWUjC.js";import{b as $t,d as Dt,e as vs,c as Rt,a as It,D as Pn}from"./dialog-Bg6eRMC4.js";import{S as $n}from"./skeleton-tYEs8dsN.js";import{T as Dn,a as Rn,b as In,c as An}from"./tabs-DKgnbdu4.js";import{u as zn,c as ys}from"./use-file-configs-DEsQ0trh.js";import{u as Ln}from"./useInfiniteQuery-D0JT5WrD.js";import{S as Mn,u as On}from"./constants-piR0edM1.js";import{u as Fn}from"./unwrap-tool-result-BYXdCQMg.js";import{c as En,d as Vn,a as Qt,e as Un,C as Bn,g as Kn}from"./command-DaAuDqUV.js";import{i as Hn}from"./FilterLines-xU-m-2To.js";import{i as Wn}from"./SearchMd-WZzMz_xm.js";import{T as Gn,a as qn,b as Yn}from"./tooltip-BeTs1OMg.js";import"./spinner-DLBC6d93.js";import"./index-BHpJxImt.js";import"./chat-context-DxSqonhB.js";import"./hooks-Buro5ByR.js";import"./decopilot-sse-pool-DWRmePhE.js";import"./create-sse-subscription-CjI9SUTI.js";import"./use-virtual-mcp-DXij_fSZ.js";import"./use-collections-D_7JW6dX.js";import"./use-ai-providers-CgowGcDz.js";import"./use-organization-settings-BfJ6uqm2.js";import"./pair-DgOi01tx.js";import"./XCircle-D5rCjCCo.js";import"./index-zGvFjFjO.js";import"./use-copy-DbsD5qK3.js";import"./format-time-GeUngI9C.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./content-blocks-o63cs2vh.js";import"./types-BZ3eurxp.js";import"./Star01-TIrOjEGQ.js";import"./XClose-BOJwjK3-.js";import"./ZapSquare-rxLTzaCI.js";import"./Monitor01-nKIM1K_1.js";import"./shell-layout-BZaILYv9.js";import"./avatar-ByQQ7GEH.js";import"./User01-CnVuEZ_q.js";import"./Users03-COREII3z.js";import"./Lock01-DzYUukb5.js";import"./Stars02-BgabhO3x.js";import"./CheckCircle-naAuY0Am.js";import"./required-auth-layout-CJnuX5pr.js";import"./useRouterState-DNwJdpeR.js";import"./use-org-sso-Baws_Cb6.js";import"./integration-icon-Bo72bKVV.js";import"./Container-BYMVUIOR.js";import"./Palette-B6NpJZ9F.js";import"./use-mcp-prompts-Cxw_xwII.js";import"./form-B-pClhzT.js";import"./drawer-q5yKuLmY.js";import"./collection-search-CZPmAdbz.js";import"./X-CexC7CUQ.js";import"./SwitchHorizontal01-B39nOlBz.js";import"./toggle-group-D_tMezdr.js";import"./agent-icons-BMYEM-93.js";import"./checkbox-DdM7zWwz.js";import"./Key01-CTY2QvpD.js";import"./Settings02-BGX5GQSJ.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-DLBjUAhp.js";import"./card-CqaEJI_U.js";import"./ArrowUpRight-BsdiWOZ_.js";import"./connect-desktop-dialog-v3Y8dgGN.js";import"./popover-COqcQ0Rg.js";import"./index-B55MEl-c.js";import"./question-004-sINsf4GQ.js";import"./add-connection-dialog-CJWirXjW.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-BY9Z3I7R.js";import"./use-registry-connections-CRI9AlTc.js";import"./use-connection-BbCw9KPq.js";import"./extract-connection-data-BYGRbWJu.js";import"./generate-id-DfUEx9en.js";import"./collections-CuEt9akO.js";import"./collection-tabs-BME6pm9f.js";import"./badge-Dci-e_Pw.js";import"./connection-form-helpers-M4qUZwhZ.js";import"./use-infinite-scroll-XJXa4_f9.js";import"./useSuspenseInfiniteQuery-D794zrC9.js";import"./infiniteQueryObserver-CUomJPae.js";import"./index-2vcb4P4k.js";import"./sidebar-BFp8v2I0.js";import"./LayoutLeft-BA4wxcAF.js";import"./toolbar-AIIkxXjs.js";import"./collection-search-DYkFJwme.js";import"./use-navigate-to-agent-CVbR4ICA.js";import"./use-create-virtual-mcp-DJVm-5Gn.js";import"./github-repo-picker-A9GOBLjA.js";import"./use-mcp-tools-Cg4H0QB3.js";import"./Sun-BMF5NYnu.js";import"./Shield01-Dd3PCkCh.js";import"./alert-dialog-DJnXid5j.js";import"./index-Df1UV_SS.js";import"./Users01-CARILaym.js";import"./hover-card-CUfoIFQV.js";import"./task-status-CqP04HQ9.js";import"./use-status-sounds-Ch0BXIj1.js";import"./empty-state-CKtqz2A5.js";import"./accordion-DEFWqB9v.js";import"./user-D0ZUKhOx.js";import"./tools-list-DmcpkTFh.js";import"./Play-qd-MZyD5.js";import"./use-debounced-autosave-B4_HunOp.js";import"./index-CKs6rcu1.js";import"./use-secrets-CPfeyzy3.js";import"./view-mode-toggle-DPGq5mgK.js";import"./automation-list-row-9h6JxfVT.js";import"./search-input-BX9Kn801.js";import"./ArrowNarrowLeft-C0lNfAd-.js";import"./ChevronUp-CYign-Xr.js";import"./HardDrive-CPUYFXaj.js";import"./index-B_5hPR5_.js";function vt(n,e,s,r,l){const i={...n[e]};if(l.length>1){const o=i.sections,a=[...o?.variants??[]];a[r]&&(a[r]={...a[r],value:s}),i.sections={...o,variants:a}}else i.sections=s;return i}function Qn(n){return structuredClone(n)}function Zn(n){return!n.isSavedBlock&&!n.isMultivariate}function Jn(n){const e=n.replace(/[^A-Za-z0-9_-]/g,"");return/^[A-Za-z]/.test(e)?e:e?`Block${e}`:""}function Xn(n,e){const s=n.trim();return s?s.includes("/")?"Block name cannot contain slashes.":Object.hasOwn(e,s)?"A block with this name already exists.":/^[A-Za-z][A-Za-z0-9_-]*$/.test(s)?null:"Use letters, numbers, hyphens, or underscores. Must start with a letter.":"Block name is required."}function yt(n,e){return n.map((s,r)=>{const l=s.__resolveType??"",i=Ve(l);if(!i&&l!==""&&!l.includes("/")&&l in e){const d=e[l],u=typeof d?.name=="string"&&d.name||l.replace(/[-_]/g," ").replace(/\b\w/g,m=>m.toUpperCase())||`Section ${r+1}`;return{index:r,resolveType:l,label:u,isLazy:!1,isSavedBlock:!0}}const o=i?s.section:void 0;if((i?o?.__resolveType??"":l).includes("flags/multivariate")){const d=i?o:s,u=Array.isArray(d?.variants)?d.variants:[],m=["website/matchers/never.ts"];if(u.length===1&&m.includes(u[0]?.rule?.__resolveType??"")){const f=u[0]?.value??{};let x=f.__resolveType??"";const v=Ve(x);return v&&(x=f.section?.__resolveType??x),{index:r,resolveType:l,label:lt(x)||`Section ${r+1}`,isHidden:!0,isLazy:v}}const p=u[0]?.value?.__resolveType,h=p?lt(p):"Section";return{index:r,resolveType:l,label:`Variants of ${h}`,isMultivariate:!0,isLazy:i}}const c=i?s.section?.__resolveType??l:l;if(i&&c!==""&&!c.includes("/")&&c in e){const d=e[c],u=typeof d?.name=="string"&&d.name||c.replace(/[-_]/g," ").replace(/\b\w/g,m=>m.toUpperCase())||`Section ${r+1}`;return{index:r,resolveType:l,label:u,isLazy:!0,isSavedBlock:!0}}return{index:r,resolveType:l,label:lt(c)||`Section ${r+1}`,isLazy:i}})}const er="text-[oklch(0.45_0.15_289)] hover:bg-[oklch(0.7278_0.151_289/0.12)] dark:text-[oklch(0.78_0.15_289)] dark:hover:bg-[oklch(0.7278_0.151_289/0.15)]",tr="text-[oklch(0.45_0.15_289)] focus:bg-[oklch(0.7278_0.151_289/0.12)] focus:text-[oklch(0.45_0.15_289)] dark:text-[oklch(0.78_0.15_289)] dark:focus:bg-[oklch(0.7278_0.151_289/0.15)] dark:focus:text-[oklch(0.78_0.15_289)] [&_svg]:!text-[oklch(0.7278_0.151_289)]";function bt(n){return n.map((e,s)=>({id:crypto.randomUUID(),section:{...e,index:s}}))}function sr(n){return n.map((e,s)=>({...e,section:{...e.section,index:s}}))}function bs(n){const e=E.c(20),{section:s}=n,r=s.isSavedBlock===!0,l=s.isMultivariate===!0;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(cs,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[0]=i):i=e[0];let o;e[1]!==l||e[2]!==r?(o=r?{color:as}:l?{color:"oklch(0.65 0.15 160)"}:void 0,e[1]=l,e[2]=r,e[3]=o):o=e[3];let a;e[4]!==o?(a=t.jsx(Ye,{className:"h-4 w-4 shrink-0",style:o}),e[4]=o,e[5]=a):a=e[5];const c=s.isHidden&&"line-through opacity-50";let d;e[6]!==c?(d=be("min-w-0 flex-1 truncate text-sm font-medium",c),e[6]=c,e[7]=d):d=e[7];let u;e[8]!==s.label||e[9]!==d?(u=t.jsx("span",{className:d,children:s.label}),e[8]=s.label,e[9]=d,e[10]=u):u=e[10];let m;e[11]!==s.isHidden?(m=s.isHidden?t.jsx(un,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}):t.jsx(dn,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground/60 opacity-0 group-hover:opacity-100"}),e[11]=s.isHidden,e[12]=m):m=e[12];let p;e[13]!==s.isLazy?(p=s.isLazy&&t.jsx(fn,{className:"h-3.5 w-3.5 shrink-0 text-yellow-500"}),e[13]=s.isLazy,e[14]=p):p=e[14];let h;return e[15]!==a||e[16]!==u||e[17]!==m||e[18]!==p?(h=t.jsxs(t.Fragment,{children:[i,a,u,m,p]}),e[15]=a,e[16]=u,e[17]=m,e[18]=p,e[19]=h):h=e[19],h}function js(n,e){const s=n.isSavedBlock===!0,r=n.isMultivariate===!0;return be("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":s?er:r?"text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]":"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function nr(n){const e=E.c(50),{section:s,sortableId:r,selected:l,onSelect:i,onDelete:o,onDuplicate:a,onMakeReusable:c}=n;let d;e[0]!==r?(d={id:r,animateLayoutChanges:ir},e[0]=r,e[1]=d):d=e[1];const{attributes:u,listeners:m,setNodeRef:p,transform:h,isDragging:f}=xn(d);let x;e[2]!==h?(x=gn.Transform.toString(h?{...h,x:0}:null),e[2]=h,e[3]=x):x=e[3];const v=f?0:void 0;let g;e[4]!==x||e[5]!==v?(g={transform:x,opacity:v},e[4]=x,e[5]=v,e[6]=g):g=e[6];const j=g;let y;e[7]!==s?(y=Zn(s),e[7]=s,e[8]=y):y=e[8];const w=y;let b;e[9]!==i?(b=G=>{(G.key==="Enter"||G.key===" ")&&(G.preventDefault(),i())},e[9]=i,e[10]=b):b=e[10];const k=f?"cursor-grabbing":"cursor-pointer";let T;e[11]!==s||e[12]!==l||e[13]!==k?(T=be("touch-none transition-colors",k,js(s,l)),e[11]=s,e[12]=l,e[13]=k,e[14]=T):T=e[14];let C;e[15]!==s?(C=t.jsx(bs,{section:s}),e[15]=s,e[16]=C):C=e[16];const $=`Open actions for ${s.label}`;let N;e[17]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(Pt,{size:14}),e[17]=N):N=e[17];let D;e[18]!==$?(D=t.jsx(ot,{asChild:!0,children:t.jsx(Se,{type:"button",variant:"ghost",size:"icon","aria-label":$,className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:lr,onPointerDown:rr,children:N})}),e[18]=$,e[19]=D):D=e[19];let A;e[20]!==w||e[21]!==c?(A=w&&t.jsxs(Ae,{className:tr,onClick:G=>{G.stopPropagation(),c()},children:[t.jsx(Ye,{size:14}),"Save as global"]}),e[20]=w,e[21]=c,e[22]=A):A=e[22];let R;e[23]!==a?(R=G=>{G.stopPropagation(),a()},e[23]=a,e[24]=R):R=e[24];let M;e[25]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(Tt,{size:14}),e[25]=M):M=e[25];let O;e[26]!==R?(O=t.jsxs(Ae,{onClick:R,children:[M,"Duplicate"]}),e[26]=R,e[27]=O):O=e[27];let F;e[28]!==o?(F=G=>{G.stopPropagation(),o()},e[28]=o,e[29]=F):F=e[29];let J;e[30]===Symbol.for("react.memo_cache_sentinel")?(J=t.jsx(Qe,{size:14}),e[30]=J):J=e[30];let H;e[31]!==F?(H=t.jsxs(Ae,{variant:"destructive",onClick:F,children:[J,"Delete"]}),e[31]=F,e[32]=H):H=e[32];let Z;e[33]!==A||e[34]!==O||e[35]!==H?(Z=t.jsxs(at,{align:"end",children:[A,O,H]}),e[33]=A,e[34]=O,e[35]=H,e[36]=Z):Z=e[36];let V;e[37]!==D||e[38]!==Z?(V=t.jsxs(ct,{children:[D,Z]}),e[37]=D,e[38]=Z,e[39]=V):V=e[39];let z;return e[40]!==u||e[41]!==m||e[42]!==i||e[43]!==p||e[44]!==j||e[45]!==V||e[46]!==b||e[47]!==T||e[48]!==C?(z=t.jsxs("div",{ref:p,style:j,...u,...m,role:"button",tabIndex:0,onClick:i,onKeyDown:b,className:T,children:[C,V]}),e[40]=u,e[41]=m,e[42]=i,e[43]=p,e[44]=j,e[45]=V,e[46]=b,e[47]=T,e[48]=C,e[49]=z):z=e[49],z}function rr(n){return n.stopPropagation()}function lr(n){return n.stopPropagation()}function ir(){return!1}function or(n){const e=E.c(76),{listKey:s,sections:r,selectedIndex:l,onSelect:i,onReorder:o,onDelete:a,onDuplicate:c,onMakeReusable:d,onAddSection:u,canAddSection:m}=n,p=m===void 0?!0:m;let h;e[0]!==r?(h=()=>bt(r),e[0]=r,e[1]=h):h=e[1];const[f,x]=I.useState(h),[v,g]=I.useState(null),[j,y]=I.useState(s),[w,b]=I.useState(r.length);let k;e[2]!==r?(k=()=>Ht(r),e[2]=r,e[3]=k):k=e[3];const[T,C]=I.useState(k),$=I.useRef(!1),N=Ht(r);j!==s?(y(s),b(r.length),C(N),x(bt(r))):w!==r.length?(b(r.length),C(N),x(bt(r))):T!==N&&(C(N),x($e=>r.map((Ne,ne)=>({id:$e[ne]?.id??crypto.randomUUID(),section:{...Ne,index:ne}}))));let D;e[4]===Symbol.for("react.memo_cache_sentinel")?(D={activationConstraint:{distance:8}},e[4]=D):D=e[4];let A;e[5]===Symbol.for("react.memo_cache_sentinel")?(A={coordinateGetter:vn},e[5]=A):A=e[5];const R=mn(qt(hn,D),qt(pn,A));let M;e[6]!==f?(M=f.map(ar),e[6]=f,e[7]=M):M=e[7];const O=M;let F;e[8]!==f?(F=$e=>{const Ne=String($e.active.id);g(f.find(ne=>ne.id===Ne)??null)},e[8]=f,e[9]=F):F=e[9];const J=F;let H;e[10]!==O||e[11]!==o?(H=$e=>{g(null);const{active:Ne,over:ne}=$e;if(!ne||Ne.id===ne.id)return;const xe=O.indexOf(String(Ne.id)),Ce=O.indexOf(String(ne.id));xe===-1||Ce===-1||(x(we=>sr(ds([...we],xe,Ce))),$.current=!0,requestAnimationFrame(()=>{$.current=!1}),o?.(xe,Ce))},e[10]=O,e[11]=o,e[12]=H):H=e[12];const Z=H;let V;e[13]===Symbol.for("react.memo_cache_sentinel")?(V=()=>{g(null)},e[13]=V):V=e[13];const z=V;let G,B,te,U,ie,oe,ue,he,re,W,q,le,ae;if(e[14]!==v||e[15]!==p||e[16]!==f||e[17]!==O||e[18]!==Z||e[19]!==J||e[20]!==u||e[21]!==a||e[22]!==c||e[23]!==d||e[24]!==i||e[25]!==l||e[26]!==R){ae=Symbol.for("react.early_return_sentinel");e:{const $e=ne=>{$.current||i(ne)};if(f.length===0){let ne;e[40]===Symbol.for("react.memo_cache_sentinel")?(ne=t.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:"No sections in this page."}),e[40]=ne):ne=e[40];const xe=!p;let Ce;e[41]===Symbol.for("react.memo_cache_sentinel")?(Ce=t.jsx(wt,{size:14}),e[41]=Ce):Ce=e[41];let we;e[42]!==u||e[43]!==xe?(we=t.jsxs("div",{className:"space-y-2",children:[ne,t.jsxs(Se,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:xe,onClick:u,children:[Ce,"Add section"]})]}),e[42]=u,e[43]=xe,e[44]=we):we=e[44],ae=we;break e}const Ne=v&&"cursor-grabbing";e[45]!==Ne?(le=be(Ne),e[45]=Ne,e[46]=le):le=e[46],B=yn,ue=R,he=bn,re=J,W=Z,q=z,G=jn,ie=O,oe=Sn,te="space-y-1",U=f.map(ne=>t.jsx(nr,{sortableId:ne.id,section:ne.section,selected:l===ne.section.index,onSelect:()=>$e(ne.section.index),onDelete:()=>a(ne.section.index),onDuplicate:()=>c(ne.section.index),onMakeReusable:()=>d(ne.section.index)},ne.id))}e[14]=v,e[15]=p,e[16]=f,e[17]=O,e[18]=Z,e[19]=J,e[20]=u,e[21]=a,e[22]=c,e[23]=d,e[24]=i,e[25]=l,e[26]=R,e[27]=G,e[28]=B,e[29]=te,e[30]=U,e[31]=ie,e[32]=oe,e[33]=ue,e[34]=he,e[35]=re,e[36]=W,e[37]=q,e[38]=le,e[39]=ae}else G=e[27],B=e[28],te=e[29],U=e[30],ie=e[31],oe=e[32],ue=e[33],he=e[34],re=e[35],W=e[36],q=e[37],le=e[38],ae=e[39];if(ae!==Symbol.for("react.early_return_sentinel"))return ae;let pe;e[47]!==te||e[48]!==U?(pe=t.jsx("div",{className:te,children:U}),e[47]=te,e[48]=U,e[49]=pe):pe=e[49];let de;e[50]!==G||e[51]!==ie||e[52]!==oe||e[53]!==pe?(de=t.jsx(G,{items:ie,strategy:oe,children:pe}),e[50]=G,e[51]=ie,e[52]=oe,e[53]=pe,e[54]=de):de=e[54];let X;e[55]!==v?(X=v?t.jsx("div",{className:be("cursor-grabbing shadow-lg ring-1 ring-border/60",js(v.section,!1)),children:t.jsx(bs,{section:v.section})}):null,e[55]=v,e[56]=X):X=e[56];let ce;e[57]!==X?(ce=t.jsx(_n,{dropAnimation:null,children:X}),e[57]=X,e[58]=ce):ce=e[58];let _e;e[59]!==B||e[60]!==ue||e[61]!==he||e[62]!==re||e[63]!==W||e[64]!==q||e[65]!==de||e[66]!==ce?(_e=t.jsxs(B,{sensors:ue,collisionDetection:he,onDragStart:re,onDragEnd:W,onDragCancel:q,children:[de,ce]}),e[59]=B,e[60]=ue,e[61]=he,e[62]=re,e[63]=W,e[64]=q,e[65]=de,e[66]=ce,e[67]=_e):_e=e[67];const Re=!p;let se;e[68]===Symbol.for("react.memo_cache_sentinel")?(se=t.jsx(wt,{size:14}),e[68]=se):se=e[68];let ke;e[69]!==u||e[70]!==Re?(ke=t.jsxs(Se,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:Re,onClick:u,children:[se,"Add section"]}),e[69]=u,e[70]=Re,e[71]=ke):ke=e[71];let ee;return e[72]!==le||e[73]!==_e||e[74]!==ke?(ee=t.jsxs("div",{className:le,children:[_e,ke]}),e[72]=le,e[73]=_e,e[74]=ke,e[75]=ee):ee=e[75],ee}function ar(n){return n.id}function jt(n){const e=E.c(8),{htmlFor:s,label:r,description:l}=n;let i;e[0]!==s||e[1]!==r?(i=t.jsx(Le,{htmlFor:s,children:r}),e[0]=s,e[1]=r,e[2]=i):i=e[2];let o;e[3]!==l?(o=l&&t.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:l}),e[3]=l,e[4]=o):o=e[4];let a;return e[5]!==i||e[6]!==o?(a=t.jsxs("div",{className:"space-y-0.5",children:[i,o]}),e[5]=i,e[6]=o,e[7]=a):a=e[7],a}function st(n){const e=E.c(49),{schema:s,value:r,onChange:l,path:i,label:o}=n,a=typeof r=="string"?r:"",c=s.format;if(c==="textarea"||c==="rich-text"||c==="rich-text-inline"||c==="markdown"){let x;e[0]!==o||e[1]!==i||e[2]!==s.description?(x=t.jsx(jt,{htmlFor:i,label:o,description:s.description}),e[0]=o,e[1]=i,e[2]=s.description,e[3]=x):x=e[3];let v;e[4]!==l?(v=y=>l(y.target.value),e[4]=l,e[5]=v):v=e[5];let g;e[6]!==i||e[7]!==a||e[8]!==v?(g=t.jsx(Nn,{id:i,value:a,onChange:v,rows:4}),e[6]=i,e[7]=a,e[8]=v,e[9]=g):g=e[9];let j;return e[10]!==x||e[11]!==g?(j=t.jsxs("div",{className:"space-y-2",children:[x,g]}),e[10]=x,e[11]=g,e[12]=j):j=e[12],j}if(c==="color-input"){let x;e[13]!==o||e[14]!==i||e[15]!==s.description?(x=t.jsx(jt,{htmlFor:i,label:o,description:s.description}),e[13]=o,e[14]=i,e[15]=s.description,e[16]=x):x=e[16];const v=a||"#000000";let g;e[17]!==l?(g=T=>l(T.target.value),e[17]=l,e[18]=g):g=e[18];let j;e[19]!==v||e[20]!==g?(j=t.jsx("input",{type:"color",value:v,onChange:g,className:"h-10 w-10 cursor-pointer rounded-lg border border-border bg-background p-1"}),e[19]=v,e[20]=g,e[21]=j):j=e[21];let y;e[22]!==l?(y=T=>l(T.target.value),e[22]=l,e[23]=y):y=e[23];let w;e[24]!==i||e[25]!==a||e[26]!==y?(w=t.jsx(Ue,{id:i,value:a,onChange:y,placeholder:"#000000",className:"h-10 flex-1"}),e[24]=i,e[25]=a,e[26]=y,e[27]=w):w=e[27];let b;e[28]!==j||e[29]!==w?(b=t.jsxs("div",{className:"flex items-center gap-2",children:[j,w]}),e[28]=j,e[29]=w,e[30]=b):b=e[30];let k;return e[31]!==x||e[32]!==b?(k=t.jsxs("div",{className:"space-y-2",children:[x,b]}),e[31]=x,e[32]=b,e[33]=k):k=e[33],k}let d;e[34]!==o||e[35]!==i||e[36]!==s.description?(d=t.jsx(jt,{htmlFor:i,label:o,description:s.description}),e[34]=o,e[35]=i,e[36]=s.description,e[37]=d):d=e[37];const u=c==="url"?"url":"text";let m;e[38]!==l?(m=x=>l(x.target.value),e[38]=l,e[39]=m):m=e[39];const p=s.default!=null?String(s.default):void 0;let h;e[40]!==i||e[41]!==a||e[42]!==u||e[43]!==m||e[44]!==p?(h=t.jsx(Ue,{id:i,type:u,value:a,onChange:m,placeholder:p,className:"h-10"}),e[40]=i,e[41]=a,e[42]=u,e[43]=m,e[44]=p,e[45]=h):h=e[45];let f;return e[46]!==d||e[47]!==h?(f=t.jsxs("div",{className:"space-y-2",children:[d,h]}),e[46]=d,e[47]=h,e[48]=f):f=e[48],f}function cr(n){const e=E.c(17),{schema:s,value:r,onChange:l,path:i,label:o}=n,a=typeof r=="number"?r:"";let c;e[0]!==o||e[1]!==i?(c=t.jsx(Le,{htmlFor:i,children:o}),e[0]=o,e[1]=i,e[2]=c):c=e[2];let d;e[3]!==s.description?(d=s.description&&t.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:s.description}),e[3]=s.description,e[4]=d):d=e[4];let u;e[5]!==c||e[6]!==d?(u=t.jsxs("div",{className:"space-y-0.5",children:[c,d]}),e[5]=c,e[6]=d,e[7]=u):u=e[7];let m;e[8]!==l?(m=f=>{const x=f.target.value;l(x===""?void 0:Number(x))},e[8]=l,e[9]=m):m=e[9];let p;e[10]!==a||e[11]!==i||e[12]!==m?(p=t.jsx(Ue,{id:i,type:"number",value:a,onChange:m,className:"h-10"}),e[10]=a,e[11]=i,e[12]=m,e[13]=p):p=e[13];let h;return e[14]!==u||e[15]!==p?(h=t.jsxs("div",{className:"space-y-2",children:[u,p]}),e[14]=u,e[15]=p,e[16]=h):h=e[16],h}function ur(n){const e=E.c(17),{value:s,onChange:r,path:l,label:i,schema:o}=n,a=typeof s=="boolean"?s:!1;let c;e[0]!==i||e[1]!==l?(c=t.jsx(Le,{htmlFor:l,children:i}),e[0]=i,e[1]=l,e[2]=c):c=e[2];let d;e[3]!==o.description?(d=o.description&&t.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:o.description}),e[3]=o.description,e[4]=d):d=e[4];let u;e[5]!==c||e[6]!==d?(u=t.jsxs("div",{className:"space-y-0.5",children:[c,d]}),e[5]=c,e[6]=d,e[7]=u):u=e[7];let m;e[8]!==r?(m=f=>r(f),e[8]=r,e[9]=m):m=e[9];let p;e[10]!==a||e[11]!==l||e[12]!==m?(p=t.jsx(wn,{id:l,checked:a,onCheckedChange:m}),e[10]=a,e[11]=l,e[12]=m,e[13]=p):p=e[13];let h;return e[14]!==u||e[15]!==p?(h=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[u,p]}),e[14]=u,e[15]=p,e[16]=h):h=e[16],h}function dr(n){const e=E.c(25),{schema:s,value:r,onChange:l,path:i,label:o}=n;let a;e[0]!==s.enum?(a=s.enum??[],e[0]=s.enum,e[1]=a):a=e[1];const c=a,d=r!=null?String(r):"";let u;e[2]!==o||e[3]!==i?(u=t.jsx(Le,{htmlFor:i,children:o}),e[2]=o,e[3]=i,e[4]=u):u=e[4];let m;e[5]!==s.description?(m=s.description&&t.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:s.description}),e[5]=s.description,e[6]=m):m=e[6];let p;e[7]!==u||e[8]!==m?(p=t.jsxs("div",{className:"space-y-0.5",children:[u,m]}),e[7]=u,e[8]=m,e[9]=p):p=e[9];let h;e[10]!==l||e[11]!==c?(h=y=>{const w=c.find(b=>String(b)===y);l(w!==void 0?w:y)},e[10]=l,e[11]=c,e[12]=h):h=e[12];let f;e[13]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(ms,{className:"h-10",children:t.jsx(ps,{placeholder:"Select..."})}),e[13]=f):f=e[13];let x;e[14]!==c?(x=c.map(fr),e[14]=c,e[15]=x):x=e[15];let v;e[16]!==x?(v=t.jsx(hs,{children:x}),e[16]=x,e[17]=v):v=e[17];let g;e[18]!==d||e[19]!==h||e[20]!==v?(g=t.jsxs(xs,{value:d,onValueChange:h,children:[f,v]}),e[18]=d,e[19]=h,e[20]=v,e[21]=g):g=e[21];let j;return e[22]!==p||e[23]!==g?(j=t.jsxs("div",{className:"space-y-2",children:[p,g]}),e[22]=p,e[23]=g,e[24]=j):j=e[24],j}function fr(n){return t.jsx(fs,{value:String(n),children:String(n)},String(n))}function Fe(n,e){if(typeof n=="string")return n||`Item ${e+1}`;if(typeof n=="number"||typeof n=="boolean")return String(n);if(n&&typeof n=="object"&&!Array.isArray(n)){const s=n;for(const r of["name","label","title","text","href","id"])if(typeof s[r]=="string"&&s[r])return s[r]}return`Item ${e+1}`}function mr(n){const e=E.c(28),{schema:s,value:r,onChange:l,path:i,label:o,breadcrumbPath:a,onBreadcrumbChange:c}=n,d=a===void 0?[]:a,u=Array.isArray(r)?r:[],m=s.items,[p,h]=I.useState(null),f=()=>{const N=m?.type,D=m?.default!==void 0?m.default:N==="object"?{}:N==="number"||N==="integer"?0:N==="boolean"?!1:N==="array"?[]:"",A=[...u,D];l(A);const R=A.length-1;h(R),c?.([...d,Fe(D,R)])},x=N=>{l(u.filter((D,A)=>A!==N)),p===N&&(h(null),c?.(d))},v=(N,D)=>{const A=[...u];A[N]=D,l(A),p===N&&c?.([...d,Fe(D,N)])};if(p!==null&&p<u.length){const N=u[p],D=[...d,Fe(N,p)],A=m?.type==="object"&&m.properties?t.jsx(Ge,{schema:m,value:N,onChange:M=>v(p,M),basePath:`${i}.${p}`,breadcrumbPath:D,onBreadcrumbChange:c}):m?ks({schema:m,value:N,onChange:M=>v(p,M),path:`${i}.${p}`,label:m.title??`Item ${p+1}`,breadcrumbPath:D,onBreadcrumbChange:c}):null;let R;return e[0]!==A?(R=t.jsx("div",{className:"min-w-0 space-y-4",children:A}),e[0]=A,e[1]=R):R=e[1],R}let g;e[2]!==o?(g=t.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:o}),e[2]=o,e[3]=g):g=e[3];let j;e[4]!==u.length?(j=u.length>0&&t.jsx("span",{className:"rounded-md bg-muted px-1.5 py-0.5 text-xs font-medium text-muted-foreground",children:u.length}),e[4]=u.length,e[5]=j):j=e[5];let y;e[6]!==g||e[7]!==j?(y=t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[g,j]}),e[6]=g,e[7]=j,e[8]=y):y=e[8];let w;e[9]!==s.description?(w=s.description&&t.jsx("p",{className:"break-words text-xs leading-normal text-muted-foreground",children:s.description}),e[9]=s.description,e[10]=w):w=e[10];let b;e[11]!==y||e[12]!==w?(b=t.jsxs("div",{className:"min-w-0 space-y-0.5",children:[y,w]}),e[11]=y,e[12]=w,e[13]=b):b=e[13];let k;e[14]!==d||e[15]!==u||e[16]!==c||e[17]!==i||e[18]!==x||e[19]!==h?(k=u.length>0&&t.jsx("div",{className:"min-w-0 overflow-hidden rounded-xl border border-border/50 p-1.5",children:u.map((N,D)=>t.jsxs("div",{className:"group flex min-w-0 items-center gap-2.5 rounded-lg px-2 py-2.5 hover:bg-accent hover:text-accent-foreground",children:[t.jsx(cs,{className:"size-3.5 shrink-0 cursor-grab text-muted-foreground/40"}),t.jsx("button",{type:"button",onClick:()=>{h(D),c?.([...d,Fe(N,D)])},className:"min-w-0 flex-1 truncate text-left text-sm",title:Fe(N,D),children:Fe(N,D)}),t.jsxs(ct,{children:[t.jsx(ot,{asChild:!0,children:t.jsx(Se,{type:"button",variant:"ghost",size:"icon","aria-label":`Open actions for ${Fe(N,D)}`,className:"size-6 opacity-0 transition-opacity group-hover:opacity-100",onClick:pr,children:t.jsx(Pt,{size:14})})}),t.jsx(at,{align:"end",children:t.jsxs(Ae,{className:"text-destructive focus:text-destructive",onClick:()=>x(D),children:[t.jsx(Qe,{size:14}),"Delete"]})})]})]},`${i}.${D}`))}),e[14]=d,e[15]=u,e[16]=c,e[17]=i,e[18]=x,e[19]=h,e[20]=k):k=e[20];let T;e[21]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(wt,{size:14}),e[21]=T):T=e[21];let C;e[22]!==f?(C=t.jsxs("button",{type:"button",onClick:f,className:"flex w-full items-center justify-center gap-1.5 rounded-xl border border-dashed border-border/60 py-2.5 text-sm text-muted-foreground transition-colors hover:border-border hover:bg-muted/30",children:[T,"Add item"]}),e[22]=f,e[23]=C):C=e[23];let $;return e[24]!==b||e[25]!==k||e[26]!==C?($=t.jsxs("div",{className:"space-y-2",children:[b,k,C]}),e[24]=b,e[25]=k,e[26]=C,e[27]=$):$=e[27],$}function pr(n){return n.stopPropagation()}function hr(n){const e=E.c(37),{schema:s,value:r,onChange:l,path:i,label:o,breadcrumbPath:a,onBreadcrumbChange:c}=n,[d,u]=I.useState(!1);let m;e[0]!==r?(m=r!=null&&typeof r=="object"&&!Array.isArray(r)?r:{},e[0]=r,e[1]=m):m=e[1];const p=m;if(!s.properties)return null;const h=`${i}-fields`;let f;e[2]!==a?(f=a??[],e[2]=a,e[3]=f):f=e[3];let x;e[4]!==o||e[5]!==f?(x=[...f,o],e[4]=o,e[5]=f,e[6]=x):x=e[6];const v=x;let g;e[7]!==a||e[8]!==v||e[9]!==c||e[10]!==d?(g=()=>{const $=!d;u($),c?.($?v:a??[])},e[7]=a,e[8]=v,e[9]=c,e[10]=d,e[11]=g):g=e[11];const j=g;let y;e[12]!==d?(y=t.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors group-hover:text-accent-foreground",children:d?t.jsx(gs,{size:16}):t.jsx(os,{size:16})}),e[12]=d,e[13]=y):y=e[13];let w;e[14]!==o?(w=t.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:o}),e[14]=o,e[15]=w):w=e[15];let b;e[16]!==h||e[17]!==j||e[18]!==d||e[19]!==y||e[20]!==w?(b=t.jsxs("button",{type:"button","aria-expanded":d,"aria-controls":h,onClick:j,className:"group flex w-full min-w-0 items-center gap-2 rounded-md py-1.5 pr-2 text-left transition-colors hover:bg-accent hover:text-accent-foreground",children:[y,w]}),e[16]=h,e[17]=j,e[18]=d,e[19]=y,e[20]=w,e[21]=b):b=e[21];let k;e[22]!==s.description?(k=s.description&&t.jsx("p",{className:"break-words pl-9 text-xs leading-normal text-muted-foreground",children:s.description}),e[22]=s.description,e[23]=k):k=e[23];let T;e[24]!==h||e[25]!==v||e[26]!==p||e[27]!==c||e[28]!==l||e[29]!==d||e[30]!==i||e[31]!==s?(T=d&&t.jsx("div",{id:h,className:"ml-3 min-w-0 max-w-full overflow-hidden border-l border-border/80 pl-5",children:t.jsx(Ge,{schema:s,value:p,onChange:l,basePath:i,breadcrumbPath:v,onBreadcrumbChange:c})}),e[24]=h,e[25]=v,e[26]=p,e[27]=c,e[28]=l,e[29]=d,e[30]=i,e[31]=s,e[32]=T):T=e[32];let C;return e[33]!==b||e[34]!==k||e[35]!==T?(C=t.jsxs("div",{className:"min-w-0 space-y-2",children:[b,k,T]}),e[33]=b,e[34]=k,e[35]=T,e[36]=C):C=e[36],C}function Zt(n){const e=E.c(36),{schema:s,value:r,onChange:l,path:i,label:o}=n;if(s.anyOfRefs&&s.anyOfRefs.length>0){const f=s.anyOfRefs,x=r!==null&&typeof r=="object"&&!Array.isArray(r)&&typeof r.__resolveType=="string"?r.__resolveType:f[0]?.resolveType??"";let v;e[0]!==l?(v=$=>{l({__resolveType:$})},e[0]=l,e[1]=v):v=e[1];const g=v;let j;e[2]!==o||e[3]!==i?(j=t.jsx(Le,{htmlFor:i,children:o}),e[2]=o,e[3]=i,e[4]=j):j=e[4];let y;e[5]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(ms,{children:t.jsx(ps,{placeholder:"Select..."})}),e[5]=y):y=e[5];let w;e[6]!==f?(w=f.map(xr),e[6]=f,e[7]=w):w=e[7];let b;e[8]!==w?(b=t.jsx(hs,{children:w}),e[8]=w,e[9]=b):b=e[9];let k;e[10]!==x||e[11]!==g||e[12]!==b?(k=t.jsxs(xs,{value:x,onValueChange:g,children:[y,b]}),e[10]=x,e[11]=g,e[12]=b,e[13]=k):k=e[13];let T;e[14]!==s.description?(T=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground",children:s.description}),e[14]=s.description,e[15]=T):T=e[15];let C;return e[16]!==j||e[17]!==k||e[18]!==T?(C=t.jsxs("div",{className:"space-y-1.5",children:[j,k,T]}),e[16]=j,e[17]=k,e[18]=T,e[19]=C):C=e[19],C}let a;e[20]!==o||e[21]!==i?(a=t.jsx(Le,{htmlFor:i,children:o}),e[20]=o,e[21]=i,e[22]=a):a=e[22];const c=r!=null?String(r):"";let d;e[23]!==l?(d=f=>l(f.target.value),e[23]=l,e[24]=d):d=e[24];const u=s.description??"";let m;e[25]!==i||e[26]!==c||e[27]!==d||e[28]!==u?(m=t.jsx("input",{id:i,type:"text",value:c,onChange:d,className:"w-full rounded-md border bg-background px-3 py-1.5 text-sm",placeholder:u}),e[25]=i,e[26]=c,e[27]=d,e[28]=u,e[29]=m):m=e[29];let p;e[30]!==s.description?(p=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground",children:s.description}),e[30]=s.description,e[31]=p):p=e[31];let h;return e[32]!==a||e[33]!==m||e[34]!==p?(h=t.jsxs("div",{className:"space-y-1.5",children:[a,m,p]}),e[32]=a,e[33]=m,e[34]=p,e[35]=h):h=e[35],h}function xr(n){return t.jsx(fs,{value:n.resolveType,children:n.title},n.resolveType)}function gr(n){const e=E.c(13),{org:s}=is();let r;e[0]!==s.id||e[1]!==s.slug?(r={connectionId:Mn,orgId:s.id,orgSlug:s.slug},e[0]=s.id,e[1]=s.slug,e[2]=r):r=e[2];const l=On(r);let i;e[3]!==s.id||e[4]!==n.configId?(i=Qs.filePickerObjects(s.id,n.configId),e[3]=s.id,e[4]=n.configId,e[5]=i):i=e[5];const o=n.enabled!==!1&&!!n.configId;let a;e[6]!==l||e[7]!==n.configId?(a=async d=>{const{pageParam:u}=d,m=await l.callTool({name:"FILE_OBJECTS_LIST",arguments:{configId:n.configId,cursor:u??void 0}});return Fn(m)},e[6]=l,e[7]=n.configId,e[8]=a):a=e[8];let c;return e[9]!==i||e[10]!==o||e[11]!==a?(c={queryKey:i,enabled:o,staleTime:3e4,initialPageParam:null,queryFn:a,getNextPageParam:vr},e[9]=i,e[10]=o,e[11]=a,e[12]=c):c=e[12],Ln(c)}function vr(n){return n.nextCursor??void 0}function At(){const n=E.c(2),{org:e}=is();let s;return n[0]!==e?(s={mutationFn:async r=>{const l=r.file.type||"application/octet-stream",i=await fetch(`/api/${encodeURIComponent(e.slug)}/file-configs/${encodeURIComponent(r.configId)}/upload?filename=${encodeURIComponent(r.file.name)}`,{method:"POST",headers:{"Content-Type":l},body:r.file});if(!i.ok){const o=await i.text().catch(yr);let a=`${i.status} ${i.statusText}`;try{const c=JSON.parse(o);c.message&&(a=c.message)}catch{o&&(a=o.slice(0,200))}throw new Error(`Upload failed: ${a}`)}return await i.json()}},n[0]=e,n[1]=s):s=n[1],Ys(s)}function yr(){return""}const dt="file-picker:last-config-id";function Ss(n){const e=E.c(18),s=n.mode==="image"?"Pick an image":"Pick a file";let r;e[0]!==s?(r=t.jsx(Dt,{children:s}),e[0]=s,e[1]=r):r=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(vs,{children:"Upload a new file or pick one previously uploaded to a configured bucket."}),e[2]=l):l=e[2];let i;e[3]!==r?(i=t.jsxs(Rt,{children:[r,l]}),e[3]=r,e[4]=i):i=e[4];let o;e[5]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx($n,{className:"h-64 w-full"}),e[5]=o):o=e[5];let a;e[6]!==n?(a=m=>{n.onSelect(m),n.onOpenChange(!1)},e[6]=n,e[7]=a):a=e[7];let c;e[8]!==n.mode||e[9]!==a?(c=t.jsx(Zs,{fallback:br,children:t.jsx(I.Suspense,{fallback:o,children:t.jsx(Sr,{mode:n.mode,onSelect:a})})}),e[8]=n.mode,e[9]=a,e[10]=c):c=e[10];let d;e[11]!==i||e[12]!==c?(d=t.jsxs(It,{className:"sm:max-w-3xl max-h-[85vh] overflow-hidden flex flex-col",children:[i,c]}),e[11]=i,e[12]=c,e[13]=d):d=e[13];let u;return e[14]!==n.onOpenChange||e[15]!==n.open||e[16]!==d?(u=t.jsx($t,{open:n.open,onOpenChange:n.onOpenChange,children:d}),e[14]=n.onOpenChange,e[15]=n.open,e[16]=d,e[17]=u):u=e[17],u}function br(n){const{error:e}=n;return t.jsx(jr,{error:e??new Error("Failed to load buckets")})}function jr(n){const e=E.c(3),{error:s}=n;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(kn,{size:16}),e[0]=r):r=e[0];let l;return e[1]!==s.message?(l=t.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[r,t.jsx("span",{className:"text-sm font-medium",children:s.message})]}),e[1]=s.message,e[2]=l):l=e[2],l}function Sr(n){const e=E.c(23),{mode:s,onSelect:r}=n,l=zn();if(l.length===0){let h;return e[0]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(wr,{}),e[0]=h):h=e[0],h}if(l.length===1){const h=l[0];let f;return e[1]!==h||e[2]!==s||e[3]!==r?(f=t.jsx(Jt,{config:h,mode:s,onSelect:r}),e[1]=h,e[2]=s,e[3]=r,e[4]=f):f=e[4],f}let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=typeof window<"u"?window.localStorage.getItem(dt):null,e[5]=i):i=e[5];const o=i;let a;e[6]!==l?(a=l.find(h=>h.id===o)?.id??l[0].id,e[6]=l,e[7]=a):a=e[7];const c=a;let d;e[8]!==l?(d=l.map(_r),e[8]=l,e[9]=d):d=e[9];let u;e[10]!==d?(u=t.jsx(Rn,{className:"self-start",children:d}),e[10]=d,e[11]=u):u=e[11];let m;if(e[12]!==l||e[13]!==s||e[14]!==r){let h;e[16]!==s||e[17]!==r?(h=f=>t.jsx(In,{value:f.id,className:"min-h-0 flex-1 overflow-hidden",children:t.jsx(Jt,{config:f,mode:s,onSelect:r})},f.id),e[16]=s,e[17]=r,e[18]=h):h=e[18],m=l.map(h),e[12]=l,e[13]=s,e[14]=r,e[15]=m}else m=e[15];let p;return e[19]!==c||e[20]!==u||e[21]!==m?(p=t.jsxs(An,{defaultValue:c,onValueChange:Nr,className:"min-h-0 flex-1 flex flex-col",children:[u,m]}),e[19]=c,e[20]=u,e[21]=m,e[22]=p):p=e[22],p}function _r(n){return t.jsx(Dn,{value:n.id,children:n.name},n.id)}function Nr(n){typeof window<"u"&&window.localStorage.setItem(dt,n)}function wr(){const n=E.c(3);let e,s;n[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:t.jsx(ut,{size:20,className:"text-muted-foreground"})}),s=t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-sm",children:"No bucket configured"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:"Add an S3-compatible bucket in Settings before you can upload files."})]}),n[0]=e,n[1]=s):(e=n[0],s=n[1]);let r;return n[2]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsxs("div",{className:"rounded-xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[e,s,t.jsx(Se,{asChild:!0,size:"sm",className:"mt-2",children:t.jsx(Js,{to:"/settings/files",children:"Configure a bucket"})})]}),n[2]=r):r=n[2],r}function Jt({config:n,mode:e,onSelect:s}){const r=gr({configId:n.id}),l=At(),[i,o]=I.useState(!1),a=I.useRef(null),c=e==="image"?"image/*":void 0;async function d(v){if(!v)return;const g=Array.from(v);if(g.length===0)return;let j=null;const y=[];for(const w of g)try{const b=await l.mutateAsync({configId:n.id,file:w});j??=b.publicUrl}catch(b){y.push(`${w.name} (${b instanceof Error?b.message:"upload failed"})`)}await r.refetch(),y.length>0&&me.error(y.length===g.length?`Upload failed: ${y.join("; ")}`:`Some files failed: ${y.join("; ")}`),j&&s(j)}function u(v){v.preventDefault(),o(!0)}function m(){o(!1)}function p(v){v.preventDefault(),o(!1),d(v.dataTransfer.files)}const f=(r.data?.pages??[]).flatMap(v=>v.items),x=f.filter(v=>e==="image"?_s(v.key):!0);return t.jsxs("div",{className:"flex flex-col gap-3 min-h-0 h-full",children:[t.jsxs("button",{type:"button",onClick:()=>a.current?.click(),onDragOver:u,onDragLeave:m,onDrop:p,className:be("rounded-xl border border-dashed border-border/60 p-6 flex flex-col items-center justify-center gap-2 text-center transition-colors",i&&"border-primary bg-primary/5",l.isPending&&"opacity-60 pointer-events-none"),children:[t.jsx(ut,{size:18,className:"text-muted-foreground"}),t.jsx("p",{className:"text-sm font-medium",children:l.isPending?"Uploading…":"Drop files here or click to upload"}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Up to 100 MB."," ",e==="image"?"Images only (PNG, JPEG, WebP, GIF, SVG, AVIF).":"Common image, video, audio, and document types."]}),t.jsx("input",{ref:a,type:"file",accept:c,multiple:!0,className:"hidden",onChange:v=>{const g=v.target.files;v.target.value="",d(g)}})]}),r.isFetching&&!r.isFetchingNextPage?t.jsx("div",{className:"flex justify-end",children:t.jsx("span",{className:"text-xs text-muted-foreground",children:"Loading…"})}):null,t.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto pr-1",children:[x.length===0?e==="image"&&f.length>0?t.jsx(Cr,{}):t.jsx(kr,{}):e==="image"?t.jsx(Pr,{items:x,onSelect:s}):t.jsx($r,{items:x,onSelect:s}),r.hasNextPage&&t.jsx("div",{className:"flex justify-center py-4",children:t.jsx(Se,{type:"button",variant:"outline",size:"sm",disabled:r.isFetchingNextPage,onClick:()=>r.fetchNextPage(),children:r.isFetchingNextPage?t.jsxs(t.Fragment,{children:[t.jsx(Ct,{size:14,className:"animate-spin"}),"Loading…"]}):"Load more"})})]})]})}function kr(){const n=E.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"flex h-full min-h-40 flex-col items-center justify-center gap-2 py-8 text-center",children:[t.jsx("div",{className:"flex size-10 items-center justify-center rounded-full bg-muted",children:t.jsx(Xe,{size:18,className:"text-muted-foreground"})}),t.jsx("p",{className:"text-sm font-medium",children:"No files in this bucket yet"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Drop a file above to get started."})]}),n[0]=e):e=n[0],e}function Cr(){const n=E.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"flex h-full min-h-40 flex-col items-center justify-center gap-2 py-8 text-center",children:[t.jsx("div",{className:"flex size-10 items-center justify-center rounded-full bg-muted",children:t.jsx(Xe,{size:18,className:"text-muted-foreground"})}),t.jsx("p",{className:"text-sm font-medium",children:"No images in this bucket yet"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"The bucket has other files, but none match common image formats."})]}),n[0]=e):e=n[0],e}function _s(n){return/\.(png|jpe?g|gif|webp|svg|avif|bmp)$/i.test(n)}function Tr(n){const e=n.lastIndexOf(".");return e<0||e===n.length-1?"file":n.slice(e+1).toLowerCase()}function Pr(n){const e=E.c(7),{items:s,onSelect:r}=n;let l;if(e[0]!==s||e[1]!==r){let o;e[3]!==r?(o=a=>t.jsx(Ns,{item:a,variant:"image",onSelect:r},a.key),e[3]=r,e[4]=o):o=e[4],l=s.map(o),e[0]=s,e[1]=r,e[2]=l}else l=e[2];let i;return e[5]!==l?(i=t.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-3",children:l}),e[5]=l,e[6]=i):i=e[6],i}function $r(n){const e=E.c(7),{items:s,onSelect:r}=n;let l;if(e[0]!==s||e[1]!==r){let o;e[3]!==r?(o=a=>t.jsx("li",{children:t.jsx(Ns,{item:a,variant:"row",onSelect:r})},a.key),e[3]=r,e[4]=o):o=e[4],l=s.map(o),e[0]=s,e[1]=r,e[2]=l}else l=e[2];let i;return e[5]!==l?(i=t.jsx("ul",{className:"divide-y divide-border/60 rounded-lg border border-border/60",children:l}),e[5]=l,e[6]=i):i=e[6],i}function Ns(n){const e=E.c(58),{item:s,variant:r,onSelect:l}=n;let i;e[0]!==s.key?(i=Tr(s.key),e[0]=s.key,e[1]=i):i=e[1];const o=i;if(r==="image"){let y;e[2]!==s.publicUrl||e[3]!==l?(y=()=>l(s.publicUrl),e[2]=s.publicUrl,e[3]=l,e[4]=y):y=e[4];let w;e[5]!==s.key||e[6]!==s.publicUrl?(w=t.jsx("img",{src:s.publicUrl,alt:s.key,loading:"lazy",className:"h-full w-full object-cover",onError:Dr}),e[5]=s.key,e[6]=s.publicUrl,e[7]=w):w=e[7];let b;e[8]!==s.key||e[9]!==y||e[10]!==w?(b=t.jsx("button",{type:"button",onClick:y,className:"block h-full w-full transition hover:ring-2 hover:ring-primary",title:s.key,children:w}),e[8]=s.key,e[9]=y,e[10]=w,e[11]=b):b=e[11];let k;e[12]!==o?(k=t.jsx("span",{className:"pointer-events-none absolute left-1.5 top-1.5 rounded bg-background/80 px-1.5 py-0.5 text-[10px] font-medium uppercase text-foreground opacity-0 backdrop-blur-sm transition-opacity group-hover:opacity-100",children:o}),e[12]=o,e[13]=k):k=e[13];let T;e[14]!==s||e[15]!==l?(T=t.jsx("div",{className:"absolute right-1.5 top-1.5 opacity-0 transition-opacity group-hover:opacity-100",children:t.jsx(Xt,{item:s,onSelect:l})}),e[14]=s,e[15]=l,e[16]=T):T=e[16];let C;e[17]!==s.key?(C=es(s.key),e[17]=s.key,e[18]=C):C=e[18];let $;e[19]!==C?($=t.jsx("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 bg-gradient-to-t from-black/70 to-transparent p-2 opacity-0 transition-opacity group-hover:opacity-100",children:t.jsx("p",{className:"truncate text-xs text-white",children:C})}),e[19]=C,e[20]=$):$=e[20];let N;return e[21]!==b||e[22]!==k||e[23]!==T||e[24]!==$?(N=t.jsxs("div",{className:"group relative aspect-square overflow-hidden rounded-lg border border-border/60 bg-muted",children:[b,k,T,$]}),e[21]=b,e[22]=k,e[23]=T,e[24]=$,e[25]=N):N=e[25],N}let a;e[26]!==s.publicUrl||e[27]!==l?(a=()=>l(s.publicUrl),e[26]=s.publicUrl,e[27]=l,e[28]=a):a=e[28];let c;e[29]!==s.key?(c=t.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-md bg-muted",children:_s(s.key)?t.jsx(Xe,{size:16,className:"text-muted-foreground"}):t.jsx(Nt,{size:16,className:"text-muted-foreground"})}),e[29]=s.key,e[30]=c):c=e[30];let d;e[31]!==s.key?(d=es(s.key),e[31]=s.key,e[32]=d):d=e[32];let u;e[33]!==d?(u=t.jsx("p",{className:"truncate text-sm font-medium",children:d}),e[33]=d,e[34]=u):u=e[34];let m;e[35]!==s.key?(m=t.jsx("p",{className:"truncate font-mono text-xs text-muted-foreground",children:s.key}),e[35]=s.key,e[36]=m):m=e[36];let p;e[37]!==u||e[38]!==m?(p=t.jsxs("div",{className:"min-w-0 flex-1",children:[u,m]}),e[37]=u,e[38]=m,e[39]=p):p=e[39];let h;e[40]!==o?(h=t.jsx("span",{className:"shrink-0 rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium uppercase text-muted-foreground",children:o}),e[40]=o,e[41]=h):h=e[41];let f;e[42]!==s.size?(f=zr(s.size),e[42]=s.size,e[43]=f):f=e[43];let x;e[44]!==f?(x=t.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:f}),e[44]=f,e[45]=x):x=e[45];let v;e[46]!==x||e[47]!==a||e[48]!==c||e[49]!==p||e[50]!==h?(v=t.jsxs("button",{type:"button",onClick:a,className:"flex min-w-0 flex-1 items-center gap-3 text-left",children:[c,p,h,x]}),e[46]=x,e[47]=a,e[48]=c,e[49]=p,e[50]=h,e[51]=v):v=e[51];let g;e[52]!==s||e[53]!==l?(g=t.jsx(Xt,{item:s,onSelect:l}),e[52]=s,e[53]=l,e[54]=g):g=e[54];let j;return e[55]!==v||e[56]!==g?(j=t.jsxs("div",{className:"group flex items-center gap-3 px-3 py-2 transition hover:bg-muted/50",children:[v,g]}),e[55]=v,e[56]=g,e[57]=j):j=e[57],j}function Dr(n){n.target.style.display="none"}function Xt(n){const e=E.c(22),{item:s,onSelect:r}=n,[l,i]=I.useState(!1);let o;e[0]!==s.publicUrl?(o=async function(y){y.preventDefault(),y.stopPropagation();try{await navigator.clipboard.writeText(s.publicUrl),i(!0),window.setTimeout(()=>i(!1),1500)}catch{me.error("Failed to copy URL")}},e[0]=s.publicUrl,e[1]=o):o=e[1];const a=o;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(ot,{asChild:!0,children:t.jsx(Se,{type:"button",variant:"ghost",size:"icon",className:"size-7 rounded-md bg-background/80 backdrop-blur-sm",onClick:Ar,"aria-label":"Asset actions",children:t.jsx(Cn,{size:14})})}),e[2]=c):c=e[2];let d;e[3]!==s.publicUrl||e[4]!==r?(d=()=>r(s.publicUrl),e[3]=s.publicUrl,e[4]=r,e[5]=d):d=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Yt,{size:14}),e[6]=u):u=e[6];let m;e[7]!==d?(m=t.jsxs(Ae,{onClick:d,children:[u,"Use this"]}),e[7]=d,e[8]=m):m=e[8];let p;e[9]!==l?(p=l?t.jsx(Yt,{size:14}):t.jsx(Tt,{size:14}),e[9]=l,e[10]=p):p=e[10];const h=l?"Copied":"Copy URL";let f;e[11]!==a||e[12]!==p||e[13]!==h?(f=t.jsxs(Ae,{onClick:a,children:[p,h]}),e[11]=a,e[12]=p,e[13]=h,e[14]=f):f=e[14];let x;e[15]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(Tn,{size:14}),e[15]=x):x=e[15];let v;e[16]!==s.publicUrl?(v=t.jsx(Ae,{asChild:!0,children:t.jsxs("a",{href:s.publicUrl,target:"_blank",rel:"noreferrer",onClick:Rr,children:[x,"Open in new tab"]})}),e[16]=s.publicUrl,e[17]=v):v=e[17];let g;return e[18]!==v||e[19]!==m||e[20]!==f?(g=t.jsxs(ct,{children:[c,t.jsxs(at,{align:"end",onClick:Ir,children:[m,f,v]})]}),e[18]=v,e[19]=m,e[20]=f,e[21]=g):g=e[21],g}function Rr(n){return n.stopPropagation()}function Ir(n){return n.stopPropagation()}function Ar(n){return n.stopPropagation()}function es(n){const e=n.split("/");return e[e.length-1]??n}function zr(n){return n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`}function ws(n){if(typeof n=="string")return n;if(!n||typeof n!="object")return"";const e=n;if(Array.isArray(e.variants)){const s=e.variants,r=s.find(i=>i.rule?.__resolveType?.includes("always"));if(typeof r?.value=="string")return r.value;const l=s.find(i=>typeof i.value=="string");if(l)return l.value}return typeof e.src=="string"?e.src:typeof e.url=="string"?e.url:typeof e.value=="string"?e.value:""}function Lr(n){try{const e=new URL(n).pathname;return decodeURIComponent(e.split("/").pop()??n)}catch{return n.split("/").pop()??n}}function Mr(n){const e=n.lastIndexOf(".");return e<0||e===n.length-1?"":n.slice(e+1).toLowerCase()}function ts(n){const e=E.c(70),{schema:s,value:r,onChange:l,path:i,label:o}=n,a=ws(r),[c,d]=I.useState(!1),[u,m]=I.useState(!1),p=a?Lr(a):"",h=p?Mr(p):"",f=ys(),x=At();let v;e[0]!==f.data?.configs?(v=function(){const W=f.data?.configs??[];if(W.length===1)return W[0].id;if(W.length===0)return null;const q=typeof window<"u"?window.localStorage.getItem(dt):null;return W.some(le=>le.id===q)?q:null},e[0]=f.data?.configs,e[1]=v):v=e[1];const g=v;let j;e[2]!==l||e[3]!==g||e[4]!==d||e[5]!==x?(j=async function(W){if(!W)return;const q=Array.from(W);if(q.length===0)return;const le=g();if(!le){d(!0);return}try{const ae=await x.mutateAsync({configId:le,file:q[0]});l(ae.publicUrl),q.length>1&&me.info(`Uploaded ${q[0].name}; extra files were ignored (single-select field).`)}catch(ae){const pe=ae;me.error(pe instanceof Error?pe.message:"Upload failed")}},e[2]=l,e[3]=g,e[4]=d,e[5]=x,e[6]=j):j=e[6];const y=j;let w;e[7]!==m?(w=function(W){W.preventDefault(),W.dataTransfer.types.includes("Files")&&m(!0)},e[7]=m,e[8]=w):w=e[8];const b=w;let k;e[9]!==m?(k=function(W){W.currentTarget===W.target&&m(!1)},e[9]=m,e[10]=k):k=e[10];const T=k;let C;e[11]!==y||e[12]!==m?(C=function(W){W.preventDefault(),m(!1),y(W.dataTransfer.files)},e[11]=y,e[12]=m,e[13]=C):C=e[13];const $=C;let N;e[14]!==o||e[15]!==i?(N=t.jsx(Le,{htmlFor:i,children:o}),e[14]=o,e[15]=i,e[16]=N):N=e[16];let D;e[17]!==s.description?(D=s.description&&t.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:s.description}),e[17]=s.description,e[18]=D):D=e[18];let A;e[19]!==N||e[20]!==D?(A=t.jsxs("div",{className:"min-w-0 space-y-0.5",children:[N,D]}),e[19]=N,e[20]=D,e[21]=A):A=e[21];const R=u&&"border-primary ring-2 ring-primary/30",M=x.isPending&&"pointer-events-none opacity-60";let O;e[22]!==M||e[23]!==R?(O=be("group relative w-full overflow-hidden rounded-xl border border-border/60 bg-muted/30 transition",R,M),e[22]=M,e[23]=R,e[24]=O):O=e[24];let F;e[25]!==h||e[26]!==p||e[27]!==d||e[28]!==a||e[29]!==x.isPending?(F=a?t.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5",children:[t.jsx("div",{className:"flex size-10 shrink-0 items-center justify-center rounded-md bg-background",children:t.jsx(Nt,{size:18,className:"text-muted-foreground"})}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"truncate text-sm font-medium",children:p}),t.jsx("p",{className:"truncate text-xs text-muted-foreground",children:a})]}),h&&t.jsx("span",{className:"shrink-0 rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium uppercase text-muted-foreground",children:h})]}):t.jsxs("button",{type:"button",onClick:()=>d(!0),className:"flex w-full flex-col items-center justify-center gap-2 py-8 text-sm text-muted-foreground hover:bg-muted/60 hover:text-foreground",children:[t.jsx(Nt,{size:20}),t.jsx("span",{className:"text-sm font-medium",children:x.isPending?"Uploading…":"Drop a file or click to browse"}),t.jsx("span",{className:"text-xs text-muted-foreground",children:"Up to 100 MB"})]}),e[25]=h,e[26]=p,e[27]=d,e[28]=a,e[29]=x.isPending,e[30]=F):F=e[30];let J;e[31]!==u?(J=u&&t.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center bg-primary/10 backdrop-blur-[1px]",children:t.jsx("span",{className:"rounded-md bg-background px-3 py-1.5 text-xs font-medium shadow",children:"Drop to upload"})}),e[31]=u,e[32]=J):J=e[32];let H;e[33]!==T||e[34]!==b||e[35]!==$||e[36]!==O||e[37]!==F||e[38]!==J?(H=t.jsxs("div",{onDragOver:b,onDragLeave:T,onDrop:$,className:O,children:[F,J]}),e[33]=T,e[34]=b,e[35]=$,e[36]=O,e[37]=F,e[38]=J,e[39]=H):H=e[39];let Z;e[40]!==l?(Z=re=>l(re.target.value),e[40]=l,e[41]=Z):Z=e[41];let V;e[42]!==i||e[43]!==a||e[44]!==Z?(V=t.jsx(Ue,{id:i,type:"url",value:a,onChange:Z,placeholder:"https://...",className:"h-9 min-w-0 flex-1"}),e[42]=i,e[43]=a,e[44]=Z,e[45]=V):V=e[45];let z;e[46]!==d?(z=()=>d(!0),e[46]=d,e[47]=z):z=e[47];let G;e[48]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx(ut,{size:14}),e[48]=G):G=e[48];const B=a?"Replace":"Browse";let te;e[49]!==z||e[50]!==B?(te=t.jsxs(Se,{type:"button",variant:"outline",size:"sm",onClick:z,className:"h-9 shrink-0",children:[G,B]}),e[49]=z,e[50]=B,e[51]=te):te=e[51];let U;e[52]!==l||e[53]!==a?(U=a&&t.jsx(Se,{type:"button",variant:"ghost",size:"sm",onClick:()=>l(""),className:"h-9 shrink-0","aria-label":"Remove file",children:t.jsx(Qe,{size:14})}),e[52]=l,e[53]=a,e[54]=U):U=e[54];let ie;e[55]!==V||e[56]!==te||e[57]!==U?(ie=t.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[V,te,U]}),e[55]=V,e[56]=te,e[57]=U,e[58]=ie):ie=e[58];let oe;e[59]!==l?(oe=re=>l(re),e[59]=l,e[60]=oe):oe=e[60];let ue;e[61]!==c||e[62]!==d||e[63]!==oe?(ue=t.jsx(Ss,{open:c,onOpenChange:d,mode:"any",onSelect:oe}),e[61]=c,e[62]=d,e[63]=oe,e[64]=ue):ue=e[64];let he;return e[65]!==H||e[66]!==ie||e[67]!==ue||e[68]!==A?(he=t.jsxs("div",{className:"grid w-full min-w-0 grid-cols-[minmax(0,1fr)] gap-2 overflow-hidden",children:[A,H,ie,ue]}),e[65]=H,e[66]=ie,e[67]=ue,e[68]=A,e[69]=he):he=e[69],he}function Or(n){try{const e=new URL(n).pathname;return decodeURIComponent(e.split("/").pop()??n)}catch{return n.split("/").pop()??n}}function Fr(n){const e=n.lastIndexOf(".");return e<0||e===n.length-1?"":n.slice(e+1).toLowerCase()}const Er=new Set(["image/png","image/jpeg","image/gif","image/webp","image/svg+xml","image/avif"]);function ss(n){const e=E.c(79),{schema:s,value:r,onChange:l,path:i,label:o}=n,a=ws(r),[c,d]=I.useState(!1),[u,m]=I.useState(!1),[p,h]=I.useState(!1),[f,x]=I.useState(!1),v=a?Or(a):"",g=v?Fr(v):"",j=ys(),y=At();let w;e[0]!==l||e[1]!==x||e[2]!==h?(w=function(X){h(!1),x(!1),l(X)},e[0]=l,e[1]=x,e[2]=h,e[3]=w):w=e[3];const b=w;let k;e[4]!==j.data?.configs?(k=function(){const X=j.data?.configs??[];if(X.length===1)return X[0].id;if(X.length===0)return null;const ce=typeof window<"u"?window.localStorage.getItem(dt):null;return X.some(_e=>_e.id===ce)?ce:null},e[4]=j.data?.configs,e[5]=k):k=e[5];const T=k;let C;e[6]!==T||e[7]!==d||e[8]!==b||e[9]!==y?(C=async function(X){if(!X)return;const ce=Array.from(X).filter(Vr);if(ce.length===0){me.error("Only image files are accepted here.");return}const _e=T();if(!_e){d(!0);return}try{const Re=await y.mutateAsync({configId:_e,file:ce[0]});b(Re.publicUrl),ce.length>1&&me.info(`Uploaded ${ce[0].name}; extra files were ignored (single-select field).`)}catch(Re){const se=Re;me.error(se instanceof Error?se.message:"Upload failed")}},e[6]=T,e[7]=d,e[8]=b,e[9]=y,e[10]=C):C=e[10];const $=C;let N;e[11]!==m?(N=function(X){X.preventDefault(),X.dataTransfer.types.includes("Files")&&m(!0)},e[11]=m,e[12]=N):N=e[12];const D=N;let A;e[13]!==m?(A=function(X){X.currentTarget===X.target&&m(!1)},e[13]=m,e[14]=A):A=e[14];const R=A;let M;e[15]!==$||e[16]!==m?(M=function(X){X.preventDefault(),m(!1),$(X.dataTransfer.files)},e[15]=$,e[16]=m,e[17]=M):M=e[17];const O=M;let F;e[18]!==o||e[19]!==i?(F=t.jsx(Le,{htmlFor:i,children:o}),e[18]=o,e[19]=i,e[20]=F):F=e[20];let J;e[21]!==s.description?(J=s.description&&t.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:s.description}),e[21]=s.description,e[22]=J):J=e[22];let H;e[23]!==F||e[24]!==J?(H=t.jsxs("div",{className:"min-w-0 space-y-0.5",children:[F,J]}),e[23]=F,e[24]=J,e[25]=H):H=e[25];const Z=u&&"border-primary ring-2 ring-primary/30",V=y.isPending&&"pointer-events-none opacity-60";let z;e[26]!==Z||e[27]!==V?(z=be("group relative w-full overflow-hidden rounded-xl border border-border/60 bg-muted/30 transition",Z,V),e[26]=Z,e[27]=V,e[28]=z):z=e[28];let G;e[29]!==g||e[30]!==v||e[31]!==f||e[32]!==p||e[33]!==o||e[34]!==x||e[35]!==h||e[36]!==d||e[37]!==a||e[38]!==y.isPending?(G=a?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"relative h-40 w-full bg-[image:linear-gradient(45deg,rgba(0,0,0,0.04)_25%,transparent_25%,transparent_75%,rgba(0,0,0,0.04)_75%),linear-gradient(45deg,rgba(0,0,0,0.04)_25%,transparent_25%,transparent_75%,rgba(0,0,0,0.04)_75%)] bg-[position:0_0,8px_8px] [background-size:16px_16px]",children:[!f&&t.jsx("img",{src:a,alt:o,className:be("h-full w-full object-contain transition-opacity",!p&&"opacity-0"),onLoad:()=>h(!0),onError:()=>x(!0)},a),f&&t.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-1 text-muted-foreground",children:[t.jsx(Xe,{size:20}),t.jsx("p",{className:"text-xs",children:"Preview unavailable"})]}),!p&&!f&&t.jsx("div",{className:"absolute inset-0 animate-pulse bg-muted/60"})]}),t.jsxs("div",{className:"flex items-center gap-2 border-t border-border/60 bg-background/50 px-3 py-2",children:[t.jsx("span",{className:"min-w-0 flex-1 truncate text-xs font-medium",children:v}),g&&t.jsx("span",{className:"shrink-0 rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium uppercase text-muted-foreground",children:g})]})]}):t.jsxs("button",{type:"button",onClick:()=>d(!0),className:"flex h-40 w-full flex-col items-center justify-center gap-2 text-sm text-muted-foreground hover:bg-muted/60 hover:text-foreground",children:[t.jsx(Xe,{size:20}),t.jsx("span",{className:"text-sm font-medium",children:y.isPending?"Uploading…":"Drop an image or click to browse"}),t.jsx("span",{className:"text-xs text-muted-foreground",children:"PNG, JPEG, WebP, GIF, SVG, AVIF — up to 100 MB"})]}),e[29]=g,e[30]=v,e[31]=f,e[32]=p,e[33]=o,e[34]=x,e[35]=h,e[36]=d,e[37]=a,e[38]=y.isPending,e[39]=G):G=e[39];let B;e[40]!==u?(B=u&&t.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center bg-primary/10 backdrop-blur-[1px]",children:t.jsx("span",{className:"rounded-md bg-background px-3 py-1.5 text-xs font-medium shadow",children:"Drop to upload"})}),e[40]=u,e[41]=B):B=e[41];let te;e[42]!==R||e[43]!==D||e[44]!==O||e[45]!==z||e[46]!==G||e[47]!==B?(te=t.jsxs("div",{onDragOver:D,onDragLeave:R,onDrop:O,className:z,children:[G,B]}),e[42]=R,e[43]=D,e[44]=O,e[45]=z,e[46]=G,e[47]=B,e[48]=te):te=e[48];let U;e[49]!==b?(U=de=>b(de.target.value),e[49]=b,e[50]=U):U=e[50];let ie;e[51]!==i||e[52]!==a||e[53]!==U?(ie=t.jsx(Ue,{id:i,type:"url",value:a,onChange:U,placeholder:"https://...",className:"h-9 min-w-0 flex-1"}),e[51]=i,e[52]=a,e[53]=U,e[54]=ie):ie=e[54];let oe;e[55]!==d?(oe=()=>d(!0),e[55]=d,e[56]=oe):oe=e[56];let ue;e[57]===Symbol.for("react.memo_cache_sentinel")?(ue=t.jsx(ut,{size:14}),e[57]=ue):ue=e[57];const he=a?"Replace":"Browse";let re;e[58]!==oe||e[59]!==he?(re=t.jsxs(Se,{type:"button",variant:"outline",size:"sm",onClick:oe,className:"h-9 shrink-0",children:[ue,he]}),e[58]=oe,e[59]=he,e[60]=re):re=e[60];let W;e[61]!==b||e[62]!==a?(W=a&&t.jsx(Se,{type:"button",variant:"ghost",size:"sm",onClick:()=>b(""),className:"h-9 shrink-0","aria-label":"Remove image",children:t.jsx(Qe,{size:14})}),e[61]=b,e[62]=a,e[63]=W):W=e[63];let q;e[64]!==ie||e[65]!==re||e[66]!==W?(q=t.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[ie,re,W]}),e[64]=ie,e[65]=re,e[66]=W,e[67]=q):q=e[67];let le;e[68]!==b?(le=de=>b(de),e[68]=b,e[69]=le):le=e[69];let ae;e[70]!==c||e[71]!==d||e[72]!==le?(ae=t.jsx(Ss,{open:c,onOpenChange:d,mode:"image",onSelect:le}),e[70]=c,e[71]=d,e[72]=le,e[73]=ae):ae=e[73];let pe;return e[74]!==te||e[75]!==q||e[76]!==ae||e[77]!==H?(pe=t.jsxs("div",{className:"grid w-full min-w-0 grid-cols-[minmax(0,1fr)] gap-2 overflow-hidden",children:[H,te,q,ae]}),e[74]=te,e[75]=q,e[76]=ae,e[77]=H,e[78]=pe):pe=e[78],pe}function Vr(n){return Er.has(n.type||"")}const Ur=new Set(["__resolveType","@type"]);function Br(n){if(n.type!=="block-ref"||!n.anyOfRefs?.length||n.anyOfRefs.length!==1)return null;const e=n.anyOfRefs[0].resolveType;return e.endsWith("/multivariate/image.ts")?"image":e.endsWith("/multivariate/video.ts")||e.endsWith("/multivariate/file.ts")?"file":null}function Kr(n){return n.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[_-]/g," ").replace(/^\w/,e=>e.toUpperCase())}function Hr(n,e){if(e!==void 0)return e;switch(n){case"string":return"";case"number":case"integer":return 0;case"boolean":return!1;case"array":return[];case"object":return{};default:return null}}function ks(n){const{schema:e,value:s}=n;if(e.type==="block-ref"||s!==null&&typeof s=="object"&&!Array.isArray(s)&&typeof s.__resolveType=="string"&&e.anyOfRefs){const o=Br(e);return o==="image"?t.jsx(ss,{...n},n.path):o==="file"?t.jsx(ts,{...n},n.path):e.anyOfRefs?t.jsx(Zt,{...n},n.path):null}if(e.format==="image-uri")return t.jsx(ss,{...n},n.path);if(e.format==="file-uri")return t.jsx(ts,{...n},n.path);if(e.enum&&e.enum.length>0)return t.jsx(dr,{...n},n.path);if(e.type==="anyOf")return t.jsx(Zt,{...n},n.path);const r=s??Hr(e.type,e.default);if(r==null)return null;const l={...n,value:r},i=s==null?e.type??typeof r:Array.isArray(r)?"array":typeof r;if(i==="array"||Array.isArray(r))return t.jsx(mr,{...l},n.path);switch(i){case"boolean":return t.jsx(ur,{...l},n.path);case"number":case"integer":return t.jsx(cr,{...l},n.path);case"string":{const o=e.format;return o==="color-input"?t.jsx(st,{...l},n.path):o==="textarea"||o==="rich-text"||o==="html"?t.jsx(st,{...l},n.path):t.jsx(st,{...l},n.path)}case"object":return r!==null&&typeof r=="object"&&!Array.isArray(r)?t.jsx(hr,{...l},n.path):null;default:return t.jsx(st,{...l},n.path)}}function Ge(n){const e=E.c(13),{schema:s,value:r,onChange:l,basePath:i,breadcrumbPath:o,onBreadcrumbChange:a}=n;let c;e[0]!==o?(c=o===void 0?[]:o,e[0]=o,e[1]=c):c=e[1];const d=c,u=s.properties;if(!u)return null;let m;e[2]!==r?(m=r!=null&&typeof r=="object"&&!Array.isArray(r)?r:{},e[2]=r,e[3]=m):m=e[3];const p=m;let h,f;if(e[4]!==i||e[5]!==d||e[6]!==p||e[7]!==a||e[8]!==l||e[9]!==u){f=Symbol.for("react.early_return_sentinel");e:{const x=Object.keys(u).filter(Wr);if(x.length===0){let g;e[12]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"No editable fields on this section."}),e[12]=g):g=e[12],f=g;break e}const v=(g,j)=>{l({...p,[g]:j})};h=t.jsx("div",{className:"min-w-0 space-y-6",children:x.map(g=>{const j=u[g];if(!j)return null;const y=i?`${i}.${g}`:g,w=j.title??Kr(g);return ks({schema:j,value:p[g],onChange:b=>v(g,b),path:y,label:w,breadcrumbPath:d,onBreadcrumbChange:a})})})}e[4]=i,e[5]=d,e[6]=p,e[7]=a,e[8]=l,e[9]=u,e[10]=h,e[11]=f}else h=e[10],f=e[11];return f!==Symbol.for("react.early_return_sentinel")?f:h}function Wr(n){return!Ur.has(n)}const Gr=[[/always|matchalways/i,"Users03"],[/device|matchdevice/i,"Phone02"],[/date|matchdate/i,"Calendar"],[/random|matchrandom/i,"Shuffle01"],[/host|matchhost/i,"Globe02"],[/location|matchlocation/i,"MarkerPin01"],[/pathname/i,"Link03"],[/cron|matchcron/i,"Clock"],[/multi|matchmulti/i,"FilterLines"],[/never|matchnever/i,"EyeOff"],[/environment|matchenvironment/i,"Cloud01"],[/eq\.ts|\/eq$/i,"Brackets"],[/user|requser|isdecouser/i,"User01"],[/site|template/i,"LayoutAlt01"]],qr={"device-mobile":"Phone02","device-desktop":"Monitor01","device-tablet":"Tablet01","calendar-event":"Calendar","calendar-month":"Calendar",clock:"Clock","current-location":"MarkerPin01","map-2":"MarkerPin01","world-search":"Globe02",shuffle:"Shuffle01",filter:"FilterLines","eye-off":"EyeOff",flask:"Beaker02",link:"Link03","git-merge":"GitBranch01",users:"Users03",flag:"Flag01","cloud-storm":"Cloud01",campaign:"Announcement01",experiment:"Beaker02",language:"Globe02","hand-click":"CursorClick01"};function St(n){return us(n)!==void 0}function Cs(n,e){if(e){if(St(e))return e;const s=qr[e];if(s&&St(s))return s}for(const[s,r]of Gr)if(s.test(n)&&St(r))return r;return"FilterLines"}function Yr(n){return us(n)??Hn}function _t(n){const e=E.c(11),{iconName:s,size:r,className:l}=n,i=r===void 0?"md":r;let o;e[0]!==s?(o=Yr(s),e[0]=s,e[1]=o):o=e[1];const a=o,c=i==="sm"?"size-7":"size-9",d=i==="sm"?16:18;let u;e[2]!==c||e[3]!==l?(u=be("flex shrink-0 items-center justify-center rounded-full bg-muted",c,l),e[2]=c,e[3]=l,e[4]=u):u=e[4];let m;e[5]!==a||e[6]!==d?(m=t.jsx(a,{size:d,className:"text-muted-foreground"}),e[5]=a,e[6]=d,e[7]=m):m=e[7];let p;return e[8]!==u||e[9]!==m?(p=t.jsx("div",{className:u,children:m}),e[8]=u,e[9]=m,e[10]=p):p=e[10],p}const Ts="Users03";function Qr(n){const e=n.manifest?.blocks??{},s=[];for(const[r,l]of Object.entries(e))if(r.includes("matchers"))for(const i of Object.keys(l)){if(i.includes("always"))continue;const o=Xs(i,n);s.push({resolveType:i,title:o.title??lt(i),description:o.description,iconName:Cs(i,o.icon)})}return s}function Zr(n,e){if(!n)return Ts;const s=e.find(r=>r.resolveType===n);return s?s.iconName:Cs(n)}function ns(n){const e=E.c(41),{currentRt:s,currentLabel:r,matchers:l,onSelect:i}=n,[o,a]=I.useState(!1);let c;e[0]!==s||e[1]!==l?(c=Zr(s,l),e[0]=s,e[1]=l,e[2]=c):c=e[2];const d=c;let u;e[3]!==i?(u=R=>{i(R),a(!1)},e[3]=i,e[4]=u):u=e[4];const m=u;let p;e[5]===Symbol.for("react.memo_cache_sentinel")?(p=()=>a(!0),e[5]=p):p=e[5];let h;e[6]!==d?(h=t.jsx(_t,{iconName:d,size:"sm"}),e[6]=d,e[7]=h):h=e[7];let f;e[8]!==r?(f=t.jsx("span",{className:"flex-1 truncate",children:r}),e[8]=r,e[9]=f):f=e[9];let x;e[10]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(gs,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),e[10]=x):x=e[10];let v;e[11]!==h||e[12]!==f?(v=t.jsxs("button",{type:"button",onClick:p,className:"flex h-9 w-full items-center gap-2 rounded-md border border-input bg-transparent px-3 text-left text-sm shadow-xs transition-colors hover:bg-accent/40",children:[h,f,x]}),e[11]=h,e[12]=f,e[13]=v):v=e[13];let g;e[14]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(En,{placeholder:"Search rules..."}),e[14]=g):g=e[14];let j;e[15]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(Vn,{children:"No rules found."}),e[15]=j):j=e[15];let y;e[16]!==m?(y=()=>m(""),e[16]=m,e[17]=y):y=e[17];const w=!s&&"bg-accent/60";let b;e[18]!==w?(b=be("gap-2.5",w),e[18]=w,e[19]=b):b=e[19];let k;e[20]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(_t,{iconName:Ts,size:"sm"}),e[20]=k):k=e[20];let T;e[21]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[t.jsx("span",{className:"text-sm",children:"Always"}),t.jsx("span",{className:"text-xs text-muted-foreground",children:"Target all users"})]}),e[21]=T):T=e[21];let C;e[22]!==y||e[23]!==b?(C=t.jsxs(Qt,{value:"always Target all users",onSelect:y,className:b,children:[k,T]}),e[22]=y,e[23]=b,e[24]=C):C=e[24];let $;if(e[25]!==s||e[26]!==m||e[27]!==l){let R;e[29]!==s||e[30]!==m?(R=M=>t.jsxs(Qt,{value:`${M.title} ${M.resolveType} ${M.description??""}`,onSelect:()=>m(M.resolveType),className:be("gap-2.5",s===M.resolveType&&"bg-accent/60"),children:[t.jsx(_t,{iconName:M.iconName,size:"sm"}),t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[t.jsx("span",{className:"text-sm",children:M.title}),M.description&&t.jsx("span",{className:"truncate text-xs text-muted-foreground",children:M.description})]})]},M.resolveType),e[29]=s,e[30]=m,e[31]=R):R=e[31],$=l.map(R),e[25]=s,e[26]=m,e[27]=l,e[28]=$}else $=e[28];let N;e[32]!==C||e[33]!==$?(N=t.jsxs(Un,{children:[j,t.jsxs(Bn,{children:[C,$]})]}),e[32]=C,e[33]=$,e[34]=N):N=e[34];let D;e[35]!==o||e[36]!==N?(D=t.jsxs(Kn,{open:o,onOpenChange:a,title:"Choose a rule",description:"Pick how to target users for this variant",className:"sm:max-w-lg",children:[g,N]}),e[35]=o,e[36]=N,e[37]=D):D=e[37];let A;return e[38]!==D||e[39]!==v?(A=t.jsxs(t.Fragment,{children:[v,D]}),e[38]=D,e[39]=v,e[40]=A):A=e[40],A}function Jr(n){const e=E.c(37),{open:s,onOpenChange:r,defaultBlockId:l,isPending:i,onSubmit:o}=n,a=l===void 0?"":l,c=i===void 0?!1:i,[d,u]=I.useState(a),[m,p]=I.useState(s);s!==m&&(p(s),s&&u(a));let h;e[0]!==c||e[1]!==r?(h=R=>{!R&&!c&&r(!1)},e[0]=c,e[1]=r,e[2]=h):h=e[2];const f=h;let x;e[3]!==d||e[4]!==c||e[5]!==o?(x=async R=>{R.preventDefault();const M=d.trim();!M||c||await o(M)},e[3]=d,e[4]=c,e[5]=o,e[6]=x):x=e[6];const v=x;let g;e[7]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsxs(Rt,{children:[t.jsx(Dt,{children:"Save as global"}),t.jsx(vs,{children:"Save this section as a global block so it can be reused on other pages."})]}),e[7]=g):g=e[7];let j;e[8]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("label",{htmlFor:"block-id",className:"text-sm font-medium",children:"Block name"}),e[8]=j):j=e[8];let y;e[9]===Symbol.for("react.memo_cache_sentinel")?(y=R=>u(R.target.value),e[9]=y):y=e[9];let w;e[10]!==d||e[11]!==c?(w=t.jsxs("div",{className:"py-4 space-y-2",children:[j,t.jsx(Ue,{id:"block-id",value:d,onChange:y,placeholder:"MyNewBlock",autoFocus:!0,disabled:c})]}),e[10]=d,e[11]=c,e[12]=w):w=e[12];let b;e[13]!==r?(b=()=>r(!1),e[13]=r,e[14]=b):b=e[14];let k;e[15]!==c||e[16]!==b?(k=t.jsx(Se,{type:"button",variant:"outline",onClick:b,disabled:c,children:"Cancel"}),e[15]=c,e[16]=b,e[17]=k):k=e[17];let T;e[18]!==d||e[19]!==c?(T=!d.trim()||c,e[18]=d,e[19]=c,e[20]=T):T=e[20];let C;e[21]!==c?(C=c?t.jsxs(t.Fragment,{children:[t.jsx(Ct,{size:14,className:"animate-spin"}),"Saving…"]}):"Save",e[21]=c,e[22]=C):C=e[22];let $;e[23]!==T||e[24]!==C?($=t.jsx(Se,{type:"submit",disabled:T,children:C}),e[23]=T,e[24]=C,e[25]=$):$=e[25];let N;e[26]!==k||e[27]!==$?(N=t.jsxs(Pn,{children:[k,$]}),e[26]=k,e[27]=$,e[28]=N):N=e[28];let D;e[29]!==v||e[30]!==N||e[31]!==w?(D=t.jsx(It,{className:"sm:max-w-md",children:t.jsxs("form",{onSubmit:v,children:[g,w,N]})}),e[29]=v,e[30]=N,e[31]=w,e[32]=D):D=e[32];let A;return e[33]!==f||e[34]!==s||e[35]!==D?(A=t.jsx($t,{open:s,onOpenChange:f,children:D}),e[33]=f,e[34]=s,e[35]=D,e[36]=A):A=e[36],A}const Xr=12,it=new Set,kt=new Set;function el(){for(const n of kt)n()}function tl(n){return it.has(n)?!0:it.size>=Xr?!1:(it.add(n),!0)}function rs(n){it.delete(n)&&el()}function sl(n){return kt.add(n),()=>{kt.delete(n)}}function nl(n,e){const s=I.useRef(!1),[r,l]=I.useState(!1),i=I.useRef(null),o=I.useRef(null),a=I.useRef(null),c=I.useRef(n);c.current=n;const[d]=I.useState(()=>{const u=()=>{a.current?.(),a.current=null},m=()=>s.current?!0:tl(e)?(s.current=!0,l(!0),u(),!0):!1;return p=>{if(o.current=p,i.current&&(i.current.disconnect(),i.current=null),u(),!p){s.current&&(rs(e),s.current=!1,l(!1));return}queueMicrotask(()=>{if(o.current!==p)return;const h=new IntersectionObserver(f=>{if(f[0]?.isIntersecting??!1){!m()&&!a.current&&(a.current=sl(()=>{o.current===p&&m()}));return}u(),s.current&&(rs(e),s.current=!1,l(!1))},{root:c.current.current,rootMargin:"160px 0px"});h.observe(p),i.current=h})}});return{ref:d,iframeActive:r}}function rl(n){const e=E.c(8),{previewUrl:s,title:r,scrollRootRef:l,slotId:i}=n,{ref:o,iframeActive:a}=nl(l,i),[c,d]=I.useState(!1);let u;e[0]!==a||e[1]!==c||e[2]!==s||e[3]!==r?(u=a?t.jsxs(t.Fragment,{children:[!c&&t.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-muted/40",children:t.jsx(Ye,{className:"h-8 w-8 animate-pulse text-muted-foreground/40"})}),t.jsx("iframe",{src:s,title:`Preview ${r}`,sandbox:"allow-scripts allow-same-origin",referrerPolicy:"no-referrer",className:"pointer-events-none h-[200%] w-[200%] origin-top-left scale-50 border-0 bg-white",tabIndex:-1,onLoad:()=>d(!0)})]}):t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Ye,{className:"h-8 w-8 text-muted-foreground/30"})}),e[0]=a,e[1]=c,e[2]=s,e[3]=r,e[4]=u):u=e[4];let m;return e[5]!==o||e[6]!==u?(m=t.jsx("div",{ref:o,className:"relative aspect-[16/10] w-full overflow-hidden bg-muted/40",children:u}),e[5]=o,e[6]=u,e[7]=m):m=e[7],m}function ll(n){const e=E.c(26),{entry:s,previewUrl:r,scrollRootRef:l,onSelect:i}=n,o=s.isSavedBlock&&"border-[oklch(0.7278_0.151_289/0.35)] hover:bg-[oklch(0.7278_0.151_289/0.08)]";let a;e[0]!==o?(a=be("group flex flex-col overflow-hidden rounded-lg border bg-card text-left transition-colors","hover:border-primary/40 hover:bg-accent/30",o),e[0]=o,e[1]=a):a=e[1];let c;e[2]!==s.resolveType||e[3]!==s.title||e[4]!==r||e[5]!==l?(c=t.jsx(rl,{previewUrl:r,title:s.title,scrollRootRef:l,slotId:s.resolveType}),e[2]=s.resolveType,e[3]=s.title,e[4]=r,e[5]=l,e[6]=c):c=e[6];let d;e[7]!==s.isSavedBlock?(d=s.isSavedBlock?{color:as}:void 0,e[7]=s.isSavedBlock,e[8]=d):d=e[8];let u;e[9]!==d?(u=t.jsx(Ye,{className:"h-4 w-4 shrink-0",style:d}),e[9]=d,e[10]=u):u=e[10];let m;e[11]!==s.title?(m=t.jsx("p",{className:"truncate text-sm font-medium",children:s.title}),e[11]=s.title,e[12]=m):m=e[12];let p;e[13]!==s.description?(p=s.description&&t.jsx("p",{className:"truncate text-xs text-muted-foreground",children:s.description}),e[13]=s.description,e[14]=p):p=e[14];let h;e[15]!==m||e[16]!==p?(h=t.jsxs("div",{className:"min-w-0 flex-1",children:[m,p]}),e[15]=m,e[16]=p,e[17]=h):h=e[17];let f;e[18]!==u||e[19]!==h?(f=t.jsxs("div",{className:"flex items-center gap-2 border-t px-3 py-2.5",children:[u,h]}),e[18]=u,e[19]=h,e[20]=f):f=e[20];let x;return e[21]!==i||e[22]!==a||e[23]!==c||e[24]!==f?(x=t.jsxs("button",{type:"button",onClick:i,className:a,children:[c,f]}),e[21]=i,e[22]=a,e[23]=c,e[24]=f,e[25]=x):x=e[25],x}function il(n){const e=E.c(41),{open:s,onOpenChange:r,meta:l,decofile:i,previewBaseUrl:o,onSelect:a}=n,[c,d]=I.useState(""),[u,m]=I.useState(s),p=I.useRef(null);s!==u&&(m(s),s&&d(""));let h,f,x,v,g,j,y,w,b,k,T;if(e[0]!==i||e[1]!==l||e[2]!==r||e[3]!==a||e[4]!==s||e[5]!==o||e[6]!==c){const A=s&&l&&i?en(l,i):[],R=l?tn(l):"",M=i?sn(i):void 0,O=new Map;if(s&&R)for(const z of A)O.set(z.resolveType,Wt(o,R,z.previewBlock,M));const F=c.trim().toLowerCase(),J=F?A.filter(z=>z.title.toLowerCase().includes(F)||z.resolveType.toLowerCase().includes(F)||z.description?.toLowerCase().includes(F)):A;f=$t,k=s,T=r,h=It,y="top-3 right-3",w="flex h-[90vh] max-h-[90vh] w-[96vw] max-w-[96vw] sm:max-w-[96vw] flex-col gap-0 overflow-hidden p-0";let H;e[18]===Symbol.for("react.memo_cache_sentinel")?(H=t.jsx(Dt,{children:"Add section"}),e[18]=H):H=e[18];let Z;e[19]===Symbol.for("react.memo_cache_sentinel")?(Z=t.jsx(Wn,{size:14,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),e[19]=Z):Z=e[19];let V;e[20]===Symbol.for("react.memo_cache_sentinel")?(V=z=>d(z.target.value),e[20]=V):V=e[20],e[21]!==c?(b=t.jsxs(Rt,{className:"shrink-0 border-b px-4 py-3 text-left",children:[H,t.jsxs("div",{className:"relative pt-2",children:[Z,t.jsx(Ue,{value:c,onChange:V,placeholder:"Search sections...",className:"h-9 pl-8"})]})]}),e[21]=c,e[22]=b):b=e[22],g=p,j="min-h-0 flex-1 overflow-y-auto",x="p-4",v=J.length===0?t.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:"No sections found."}):t.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:J.map(z=>t.jsx(ll,{entry:z,scrollRootRef:p,previewUrl:O.get(z.resolveType)??Wt(o,R,z.previewBlock,M),onSelect:()=>a(z)},z.resolveType))}),e[0]=i,e[1]=l,e[2]=r,e[3]=a,e[4]=s,e[5]=o,e[6]=c,e[7]=h,e[8]=f,e[9]=x,e[10]=v,e[11]=g,e[12]=j,e[13]=y,e[14]=w,e[15]=b,e[16]=k,e[17]=T}else h=e[7],f=e[8],x=e[9],v=e[10],g=e[11],j=e[12],y=e[13],w=e[14],b=e[15],k=e[16],T=e[17];let C;e[23]!==x||e[24]!==v?(C=t.jsx("div",{className:x,children:v}),e[23]=x,e[24]=v,e[25]=C):C=e[25];let $;e[26]!==C||e[27]!==g||e[28]!==j?($=t.jsx("div",{ref:g,className:j,children:C}),e[26]=C,e[27]=g,e[28]=j,e[29]=$):$=e[29];let N;e[30]!==h||e[31]!==$||e[32]!==y||e[33]!==w||e[34]!==b?(N=t.jsxs(h,{closeButtonClassName:y,className:w,children:[b,$]}),e[30]=h,e[31]=$,e[32]=y,e[33]=w,e[34]=b,e[35]=N):N=e[35];let D;return e[36]!==f||e[37]!==N||e[38]!==k||e[39]!==T?(D=t.jsx(f,{open:k,onOpenChange:T,children:N}),e[36]=f,e[37]=N,e[38]=k,e[39]=T,e[40]=D):D=e[40],D}const ol="oklch(0.65 0.15 160)",al="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)]",cl="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 ul(n){const e=E.c(33),{variant:s,selected:r,canDelete:l,onSelect:i,onDuplicate:o,onDelete:a}=n;let c;e[0]!==i?(c=N=>{N.target===N.currentTarget&&(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),i())},e[0]=i,e[1]=c):c=e[1];const d=r?cl:al;let u;e[2]!==d?(u=be("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors cursor-pointer",d),e[2]=d,e[3]=u):u=e[3];let m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Ye,{className:"h-4 w-4 shrink-0",style:{color:ol}}),e[4]=m):m=e[4];let p;e[5]!==s.label?(p=t.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:s.label}),e[5]=s.label,e[6]=p):p=e[6];const h=`Open actions for ${s.label}`;let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Pt,{size:14}),e[7]=f):f=e[7];let x;e[8]!==h?(x=t.jsx(ot,{asChild:!0,children:t.jsx(Se,{type:"button",variant:"ghost",size:"icon","aria-label":h,className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:fl,onPointerDown:dl,children:f})}),e[8]=h,e[9]=x):x=e[9];let v;e[10]!==o?(v=N=>{N.stopPropagation(),o()},e[10]=o,e[11]=v):v=e[11];let g;e[12]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(Tt,{size:14}),e[12]=g):g=e[12];let j;e[13]!==v?(j=t.jsxs(Ae,{onClick:v,children:[g,"Duplicate"]}),e[13]=v,e[14]=j):j=e[14];const y=!l;let w;e[15]!==a?(w=N=>{N.stopPropagation(),a()},e[15]=a,e[16]=w):w=e[16];let b;e[17]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(Qe,{size:14}),e[17]=b):b=e[17];let k;e[18]!==y||e[19]!==w?(k=t.jsxs(Ae,{variant:"destructive",disabled:y,onClick:w,children:[b,"Delete"]}),e[18]=y,e[19]=w,e[20]=k):k=e[20];let T;e[21]!==j||e[22]!==k?(T=t.jsxs(at,{align:"end",children:[j,k]}),e[21]=j,e[22]=k,e[23]=T):T=e[23];let C;e[24]!==T||e[25]!==x?(C=t.jsxs(ct,{children:[x,T]}),e[24]=T,e[25]=x,e[26]=C):C=e[26];let $;return e[27]!==i||e[28]!==c||e[29]!==C||e[30]!==u||e[31]!==p?($=t.jsxs("div",{role:"button",tabIndex:0,onClick:i,onKeyDown:c,className:u,children:[m,p,C]}),e[27]=i,e[28]=c,e[29]=C,e[30]=u,e[31]=p,e[32]=$):$=e[32],$}function dl(n){return n.stopPropagation()}function fl(n){return n.stopPropagation()}function ml(n){const e=E.c(25),{variants:s,selectedIndex:r,onSelect:l,onDuplicate:i,onDelete:o,onRemoveAll:a}=n,c=s.length>1;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variants"}),e[0]=d):d=e[0];let u;e[1]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Qe,{size:14}),e[1]=u):u=e[1];let m;e[2]!==a?(m=t.jsx(Gn,{asChild:!0,children:t.jsx(Se,{type:"button",variant:"ghost",size:"icon","aria-label":"Remove all variants",className:"size-6 text-muted-foreground hover:text-destructive",onClick:a,children:u})}),e[2]=a,e[3]=m):m=e[3];let p;e[4]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(qn,{children:"Remove all variants"}),e[4]=p):p=e[4];let h;e[5]!==m?(h=t.jsxs("div",{className:"flex items-center justify-between",children:[d,t.jsxs(Yn,{children:[m,p]})]}),e[5]=m,e[6]=h):h=e[6];let f;if(e[7]!==c||e[8]!==o||e[9]!==i||e[10]!==l||e[11]!==r||e[12]!==s){let g;e[14]!==c||e[15]!==o||e[16]!==i||e[17]!==l||e[18]!==r?(g=j=>t.jsx(ul,{variant:j,selected:j.index===r,canDelete:c,onSelect:()=>l(j.index),onDuplicate:()=>i(j.index),onDelete:()=>o(j.index)},`${j.label}-${j.index}`),e[14]=c,e[15]=o,e[16]=i,e[17]=l,e[18]=r,e[19]=g):g=e[19],f=s.map(g),e[7]=c,e[8]=o,e[9]=i,e[10]=l,e[11]=r,e[12]=s,e[13]=f}else f=e[13];let x;e[20]!==f?(x=t.jsx("div",{className:"space-y-0.5",children:f}),e[20]=f,e[21]=x):x=e[21];let v;return e[22]!==h||e[23]!==x?(v=t.jsxs("div",{className:"space-y-1 border-b p-2",children:[h,x]}),e[22]=h,e[23]=x,e[24]=v):v=e[24],v}const pl=["website/matchers/always.ts","$live/matchers/MatchAlways.ts"];function hl(n){if(!n)return!1;const e=n.__resolveType??"";return e===""?Object.keys(n).length===0:pl.includes(e)||e.includes("always")}function xl(n){const e=n.variants??[];if(e.length===0)return-1;const s=e.findIndex(r=>hl(r.rule));return s!==-1?s:e.length-1}function gl(n,e,s){const r=s.variants??[];if(r.length===0)return null;const l=xl(s),i=r[l]?.value;if(!i)return null;const o=structuredClone(i);return e.isLazy?{...n,section:o}:o}function Ee(n,e){return e.isMultivariate?e.isLazy?n.section??null:n:null}function ls(n,e){return Array.isArray(n.variants)?n.variants.map((s,r)=>({label:e(s.rule)||`Variant ${r+1}`,value:s.value??{},rule:s.rule})):[]}function vl(n,e){const s=n.__resolveType??"";if(!s)return null;if(Ve(s)){const r=n.section??n,l=r.__resolveType??s;if(!l.includes("/")&&l in e){const i=e[l]??{};return{data:{...i},resolveType:i.__resolveType??l}}return{data:{...r},resolveType:l}}if(!s.includes("/")&&s in e){const r=e[s]??{};return{data:{...r},resolveType:r.__resolveType??s}}return{data:{...n},resolveType:s}}function yl(n,e){const s=n.__resolveType??"";return Ve(s)?{...n,section:e}:e}function nt(n,e,s){return e.isLazy?{...n,section:s}:s}function bl(n,e,s){const r=[...n.variants??[]],l=r[e];if(!l)return n;const i=l.value??{};return r[e]={...l,value:yl(i,s)},{...n,variants:r}}function jl(n,e,s){const r=[...n.variants??[]];return r[e]?(r[e]={...r[e],rule:s},{...n,variants:r}):n}function Sl(n,e){const s=[...n.variants??[]],r=s[e];return r?(s.splice(e+1,0,structuredClone(r)),{...n,variants:s}):n}function _l(n,e){const s=[...n.variants??[]];return s.length<=1?null:(s.splice(e,1),{...n,variants:s})}const rt=700,Nl=n=>n.charAt(0).toUpperCase()+n.slice(1).toLowerCase();function De(n){const e=n.split("/");return(e[e.length-1]??n).replace(/\.(tsx?|jsx?)$/,"").replace(/[-_]/g," ").replace(/\b\w/g,r=>r.toUpperCase())||n}function qe(n){if(!n)return"Default";const e=n.__resolveType??"";if(["website/matchers/always.ts","$live/matchers/MatchAlways.ts"].includes(e)||e==="")return"Default";switch(e){case"website/matchers/never.ts":return"Hidden";case"website/matchers/device.ts":case"$live/matchers/MatchDevice.ts":{const{mobile:r,tablet:l,desktop:i,devices:o=[]}=n,a=[...o];return r&&a.push("Mobile"),l&&a.push("Tablet"),i&&a.push("Desktop"),a.length>0?a.map(Nl).join(" & "):De(e)}case"website/matchers/date.ts":case"$live/matchers/MatchDate.ts":{const{start:r,end:l}=n;if(!r&&!l)return De(e);const i=new Intl.DateTimeFormat("en",{dateStyle:"medium",timeStyle:"short"});if(r&&l)try{return`${i.format(new Date(r))} → ${i.format(new Date(l))}`}catch{return De(e)}if(r)try{return`From ${i.format(new Date(r))}`}catch{return De(e)}if(l)try{return`Until ${i.format(new Date(l))}`}catch{return De(e)}return De(e)}case"website/matchers/random.ts":case"$live/matchers/MatchRandom.ts":{const{traffic:r}=n;return typeof r=="number"?`${Math.ceil(r*100)}% of sessions`:De(e)}case"website/matchers/host.ts":case"$live/matchers/MatchHost.ts":{const{includes:r,match:l}=n,i=[];return r&&i.push(r),l&&i.push(l),i.length>0?i.join(" - "):De(e)}case"website/matchers/pathname.ts":{const r=n.case,{type:l,pathname:i}=r??{};return l&&i?`Pathname ${l} ${i}`:De(e)}case"website/matchers/location.ts":case"$live/matchers/MatchLocation.ts":{const{includeLocations:r,excludeLocations:l}=n,i=c=>[c.city,c.regionCode,c.country].filter(Boolean).join(" - "),o=r?.[0];if(o){const c=(r?.length??0)-1;return`${i(o)}${c>0?` +${c}`:""}`}const a=l?.[0];if(a){const c=(l?.length??0)-1;return`Except ${i(a)}${c>0?` +${c}`:""}`}return"Any location"}case"website/matchers/multi.ts":case"$live/matchers/MatchMulti.ts":{const{matchers:r,op:l="AND"}=n;return r&&r.length>0?r.map(qe).join(` ${l} `):De(e)}default:return De(e)||"Default"}}function wl(n){if(Array.isArray(n))return[{label:"Default",sections:n}];if(n&&typeof n=="object"){const e=n;if(Array.isArray(e.variants))return e.variants.map((r,l)=>({label:qe(r.rule)||`Variant ${l+1}`,sections:Array.isArray(r.value)?r.value:[],rule:r.rule}))}return[]}function kl(n){const e=E.c(13),{pageKey:s,initialName:r,initialPath:l,onFieldChange:i}=n,[o,a]=I.useState(r),[c,d]=I.useState(l),[u,m]=I.useState(s);u!==s&&(m(s),a(r),d(l));let p;e[0]!==i?(p=g=>{a(g.target.value),i("name",g.target.value)},e[0]=i,e[1]=p):p=e[1];let h;e[2]!==o||e[3]!==p?(h=t.jsx("input",{type:"text",value:o,onChange:p,className:"w-full bg-transparent text-sm font-semibold truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:"Page name"}),e[2]=o,e[3]=p,e[4]=h):h=e[4];let f;e[5]!==i?(f=g=>{d(g.target.value),i("path",g.target.value)},e[5]=i,e[6]=f):f=e[6];let x;e[7]!==c||e[8]!==f?(x=t.jsx("input",{type:"text",value:c,onChange:f,className:"w-full bg-transparent text-xs text-muted-foreground truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:"/path"}),e[7]=c,e[8]=f,e[9]=x):x=e[9];let v;return e[10]!==h||e[11]!==x?(v=t.jsxs("div",{className:"space-y-1",children:[h,x]}),e[10]=h,e[11]=x,e[12]=v):v=e[12],v}function We(n,e,s){if(e.isMultivariate)return null;if(e.isSavedBlock){const r=e.isLazy?n.section?.__resolveType??n.__resolveType:n.__resolveType,l=s[r]??{},i=l.__resolveType??r;return{data:{...l},resolveType:i}}if(e.isHidden){const i=(Ve(n.__resolveType)?n.section:n)?.variants?.[0]?.value??n,o=i.__resolveType??"";if(Ve(o)){const a=i.section??{};return{data:{...a},resolveType:a.__resolveType??o}}return{data:{...i},resolveType:o}}if(e.isLazy){const r=n.section??n;return{data:{...r},resolveType:r.__resolveType??n.__resolveType}}return{data:{...n},resolveType:n.__resolveType}}function ta({orgSlug:n,virtualMcpId:e,branch:s,previewReady:r=!0,previewUrl:l,currentPath:i,activeGlobalBlockKey:o=null,externalSelectedIndex:a,onSaved:c}){const d=r?{orgSlug:n,virtualMcpId:e,branch:s}:null,{data:u,isLoading:m}=nn(d),{data:p,isLoading:h}=rn(d),[f,x]=I.useState(null),[v,g]=I.useState(null),[j,y]=I.useState(null),[w,b]=I.useState(0),[k,T]=I.useState(void 0),[C,$]=I.useState(null),[N,D]=I.useState(null),[A,R]=I.useState([]),[M,O]=I.useState(0),[F,J]=I.useState(null),[H,Z]=I.useState(!1),[V,z]=I.useState(0),[G,B]=I.useState(null),[te,U]=I.useState(null),[ie,oe]=I.useState(null),[ue,he]=I.useState(i),[re,W]=I.useState(o);(ue!==i||re!==o)&&(he(i),W(o),x(null),g(null),y(null),b(0),$(null),D(null),z(0),B(null),U(null),R([]),O(S=>S+1));const q=ln({orgSlug:n,virtualMcpId:e,branch:s}),le=I.useRef(null),ae=I.useRef(null),pe=I.useRef(null),de=I.useRef(null),X=I.useRef({}),ce=I.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!r||m||h)return t.jsx("div",{className:"h-full w-full flex items-center justify-center",children:t.jsx(Ct,{size:20,className:"animate-spin text-muted-foreground"})});if(!u||!p)return t.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:"Could not load site data."});const _e=on(u),Re=cn,se=!!o,ke=se?null:_e.find(S=>Re(S.path)===Re(i)),ee=se?o:ke?.key??null,$e=se&&o?u[o]:void 0,Ne=se&&o&&$e?an(o,$e):se&&o?o:"",ne=!se&&ee&&u[ee]?u[ee]:null,xe=se?[{label:"Default",sections:[{__resolveType:o}]}]:wl(ne?.sections),Ce=xe.length>1,we=Math.min(w,xe.length-1),ft=xe[we],fe=ft?.sections??[],Te=yt(fe,u);if(se&&o&&ie!==o){oe(o);const S=fe[0],_=Te[0];if(S&&_){x(0),z(0),R([]);const P=We(S,_,u);P&&(g(P.data),y(P.resolveType),U(null),B(null))}}!se&&ie!==null&&oe(null),ce.current={rawSections:fe,parsedSections:Te,decofile:u,activePageKey:ee,pageVariants:xe,variantIndex:we,sectionVariantIndex:V,selectedSectionIndex:f};const Be=(S,_,P)=>{const L=Ee(S,_);if(!L){g(null),y(null),U(null),B(null);return}const Q=ls(L,qe)[P];if(!Q){g(null),y(null),U(null),B(null);return}const K=vl(Q.value,u);g(K?.data??null),y(K?.resolveType??null);const ve=Q.rule?.__resolveType??"";if(U(ve),Q.rule){const{__resolveType:ze,...ge}=Q.rule;B(ge)}else B(null)};if(a!==void 0&&a!==k&&(T(a??null),typeof a=="number")){const S=fe[a],_=Te[a];if(S&&_)if(x(a),z(0),R([]),O(P=>P+1),_.isMultivariate)Be(S,_,0);else{const P=We(S,_,u);P?(g(P.data),y(P.resolveType)):(g(null),y(null)),U(null),B(null)}}const Ze=j&&p?gt(j,p):null,Me=(S,_)=>{if(!ee)return;const P=vt(u,ee,S,we,xe);q.mutate({blockKey:ee,data:P},{onSuccess:()=>_?.onSuccess?.()??c?.(),onError:L=>me.error(`Save failed: ${L.message}`)})},mt=()=>{x(null),g(null),y(null),z(0),B(null),U(null),R([]),O(S=>S+1)},Ps=(S,_)=>{le.current&&clearTimeout(le.current);const P=ce.current.sectionVariantIndex;le.current=setTimeout(()=>{const{rawSections:L,parsedSections:Y,decofile:Q,activePageKey:K,pageVariants:ve,variantIndex:ze}=ce.current,ge=L[_];if(!ge)return;const Pe=Y[_];if(!Pe)return;if(Pe.isSavedBlock){const je=Pe.isLazy?ge.section?.__resolveType??ge.__resolveType:ge.__resolveType;q.mutate({blockKey:je,data:S},{onSuccess:()=>c?.(),onError:ye=>me.error(`Save failed: ${ye.message}`)});return}if(!K)return;const Oe={...Q[K]},Ie=[...L];if(Pe.isMultivariate){const je=Ee(ge,Pe);if(!je||!K)return;const ye=bl(je,P,S);Ie[_]=nt(ge,Pe,ye)}else if(Pe.isHidden){const je=Ve(ge.__resolveType),ye=je?{...ge.section}:{...ge},He=Array.isArray(ye.variants)?[...ye.variants]:[];He[0]&&(He[0]={...He[0],value:S}),ye.variants=He,je?Ie[_]={...ge,section:ye}:Ie[_]=ye}else Pe.isLazy?Ie[_]={...ge,section:S}:Ie[_]=S;if(ve.length>1){const je=Oe.sections,ye=[...je?.variants??[]];ye[ze]&&(ye[ze]={...ye[ze],value:Ie}),Oe.sections={...je,variants:ye}}else Oe.sections=Ie;q.mutate({blockKey:K,data:Oe},{onSuccess:()=>c?.(),onError:je=>me.error(`Save failed: ${je.message}`)})},rt)},$s=S=>{x(S),z(0),R([]),O(Y=>Y+1);const _=fe[S],P=Te[S];if(!_||!P)return;if(P.isMultivariate){Be(_,P,0);return}const L=We(_,P,u);if(!L){g(null),y(null),U(null),B(null);return}g(L.data),y(L.resolveType),U(null),B(null)},zt=S=>{const _=S;g(_),f!==null&&Ps(_,f)},Ds=(S,_)=>{ee&&(X.current[S]=_,ae.current&&clearTimeout(ae.current),ae.current=setTimeout(()=>{const P=X.current;X.current={};const L={...u[ee],...P};q.mutate({blockKey:ee,data:L},{onError:Y=>me.error(`Save failed: ${Y.message}`)})},rt))},Rs=(S,_)=>{if(!ee)return;const P=ds([...fe],S,_);f!==null&&(f===S?x(_):S<f&&_>=f?x(f-1):S>f&&_<=f&&x(f+1)),Me(P)},Is=S=>{if(!ee)return;const _=fe.filter((P,L)=>L!==S);f===S?mt():f!==null&&f>S&&x(f-1),Me(_)},As=S=>{if(!ee)return;const _=fe[S];if(!_)return;const P=[...fe];P.splice(S+1,0,Qn(_)),f!==null&&f>S&&x(f+1),Me(P)},zs=S=>{if(!ee)return;const _=[...fe,{__resolveType:S.resolveType}],P=_.length-1;Me(_,{onSuccess:()=>{Z(!1),x(P),z(0),R([]),O(K=>K+1);const L=_[P],Y=yt(_,u)[P];if(!L||!Y)return;if(Y.isMultivariate){Be(L,Y,0);return}const Q=We(L,Y,u);if(!Q){g(null),y(null),U(null),B(null);return}g(Q.data),y(Q.resolveType),U(null),B(null)}})},Ls=S=>{if(f===null)return;const _=fe[f],P=Te[f];!_||!P?.isMultivariate||(z(S),R([]),O(L=>L+1),Be(_,P,S))},Ms=S=>{if(f===null||!ee)return;const _=fe[f],P=Te[f];if(!_||!P?.isMultivariate)return;const L=Ee(_,P);if(!L)return;const Y=_l(L,S);if(!Y){me.error("Cannot delete the only variant.");return}const Q=[...fe];Q[f]=nt(_,P,Y);const K=Y.variants;let ve=V;S===V?ve=Math.min(S,K.length-1):S<V&&(ve=V-1),z(ve),R([]),O(ze=>ze+1),Be(Q[f],P,ve),Me(Q)},Os=S=>{if(f===null||!ee)return;const _=fe[f],P=Te[f];if(!_||!P?.isMultivariate)return;const L=Ee(_,P);if(!L)return;const Y=Sl(L,S),Q=[...fe];Q[f]=nt(_,P,Y);const K=S+1;z(K),R([]),O(ve=>ve+1),Be(Q[f],P,K),Me(Q)},Fs=()=>{if(f===null||!ee)return;const S=fe[f],_=Te[f];if(!S||!_?.isMultivariate)return;const P=Ee(S,_);if(!P)return;const L=gl(S,_,P);if(!L){me.error("Could not remove variants.");return}const Y=[...fe];Y[f]=L;const Q=yt(Y,u)[f];if(!Q)return;z(0),U(null),B(null),R([]),O(ve=>ve+1);const K=We(L,Q,u);K?(g(K.data),y(K.resolveType)):(g(null),y(null)),Me(Y)},Es=async S=>{if(F===null||!ee)return;const _=Xn(S,u);if(_){me.error(_);return}const P=fe[F],L=Te[F];if(!P||!L)return;const Y=We(P,L,u);if(!Y){me.error("This section cannot be saved as global.");return}const Q={...Y.data,name:S};try{await q.mutateAsync({blockKey:S,data:Q});const K=[...fe];K[F]={__resolveType:S},await q.mutateAsync({blockKey:ee,data:vt(u,ee,K,we,xe)}),f===F&&mt(),J(null),me.success(`Saved global block "${S}"`),c?.()}catch(K){me.error(K instanceof Error?K.message:"Failed to save global block")}},pt=ft?.rule,Vs=pt?.__resolveType??"";if(Ce&&f===null&&N===null&&pt){D(Vs);const{__resolveType:S,..._}=pt;$(_)}const Lt=p?Qr(p):[],Us=!se&&!!(l&&p&&u),Mt=N&&p?gt(N,p):null,Ot=S=>{pe.current&&clearTimeout(pe.current),pe.current=setTimeout(()=>{const{activePageKey:_,decofile:P,variantIndex:L}=ce.current;if(!_)return;const Y={...P[_]},Q={...Y.sections},K=[...Q.variants??[]];K[L]&&(K[L]={...K[L],rule:S}),Y.sections={...Q,variants:K},q.mutate({blockKey:_,data:Y},{onSuccess:()=>c?.(),onError:ve=>me.error(`Save failed: ${ve.message}`)})},rt)},Bs=S=>{D(S);const _=S?{__resolveType:S}:{__resolveType:Gt};$({}),Ot(_)},Ks=S=>{const _=S;$(_);const P=N?{__resolveType:N,..._}:{..._};Ot(P)},Ft=S=>{de.current&&clearTimeout(de.current);const{selectedSectionIndex:_,sectionVariantIndex:P}=ce.current;_!==null&&(de.current=setTimeout(()=>{const{rawSections:L,parsedSections:Y,decofile:Q,activePageKey:K,pageVariants:ve,variantIndex:ze}=ce.current;if(!K)return;const ge=L[_],Pe=Y[_];if(!ge||!Pe?.isMultivariate)return;const Oe=Ee(ge,Pe);if(!Oe)return;const Ie=jl(Oe,P,S),je=[...L];je[_]=nt(ge,Pe,Ie);const ye=vt(Q,K,je,ze,ve);q.mutate({blockKey:K,data:ye},{onSuccess:()=>c?.(),onError:He=>me.error(`Save failed: ${He.message}`)})},rt))},Hs=S=>{U(S),B({}),Ft(S?{__resolveType:S}:{__resolveType:Gt})},Ws=S=>{const _=S;B(_);const P=te?{__resolveType:te,..._}:{..._};Ft(P)};if(!se&&!ke)return t.jsxs("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:["No page found for ",i]});if(se&&!$e)return t.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:"Global block not found"});const Je=f!==null?Te[f]??null:null,Et=f!==null?fe[f]:null,Vt=Et&&Je?.isMultivariate?Ee(Et,Je):null,et=Vt?ls(Vt,qe):[],Ut=Math.min(V,Math.max(et.length-1,0)),ht=et[Ut]??null,Ke=Je?.isMultivariate===!0,tt=f!==null&&Je!==null&&(Ke||!!(Ze&&v)),Bt=te&&p?gt(te,p):null,Kt=tt&&(!se||A.length>0)?se?[Ne,...A]:[ke.name,Je.label,...Ke&&ht?[ht.label]:[],...A]:[],Gs=()=>{mt()},qs=S=>{if(se){R(A.slice(0,S)),O(P=>P+1);return}if(S===0){Gs();return}if(S===1){R([]),O(P=>P+1);return}if(Ke&&S===2){R([]),O(P=>P+1);return}const _=Ke?2:1;R(A.slice(0,S-_))};return t.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[t.jsx("div",{className:"px-3 py-2.5 border-b shrink-0",children:tt&&(!se||A.length>0)?t.jsx("div",{className:"flex min-w-0 items-center overflow-hidden",children:t.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:Kt.map((S,_)=>{const P=_===Kt.length-1;return t.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[_>0&&t.jsx(os,{className:"size-3 shrink-0 text-muted-foreground/60"}),t.jsx("button",{type:"button",onClick:()=>qs(_),title:S,className:be("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",P?"font-medium text-foreground":"text-muted-foreground"),children:S})]},`${S}-${_}`)})})}):se?t.jsxs("div",{className:"space-y-0.5",children:[t.jsx("div",{className:"text-sm font-medium truncate",children:Ne}),t.jsx("div",{className:"text-xs text-muted-foreground",children:"Global component"})]}):t.jsx(kl,{pageKey:ee,initialName:ke.name,initialPath:ke.path,onFieldChange:Ds})}),Ce&&!tt&&t.jsx("div",{className:"flex gap-1 px-3 py-1.5 border-b shrink-0 overflow-x-auto",children:xe.map((S,_)=>t.jsx("button",{type:"button",onClick:()=>{b(_),x(null),g(null),y(null),R([]);const P=xe[_]?.rule,L=P?.__resolveType??"";if(D(L),P){const{__resolveType:Y,...Q}=P;$(Q)}else $(null)},className:be("shrink-0 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",_===we?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground"),children:S.label},_))}),tt?t.jsxs(xt,{className:"flex-1 min-h-0",children:[Ke&&et.length>0&&t.jsxs(t.Fragment,{children:[t.jsx(ml,{variants:et.map((S,_)=>({index:_,label:S.label})),selectedIndex:Ut,onSelect:Ls,onDuplicate:Os,onDelete:Ms,onRemoveAll:Fs}),Ke&&t.jsxs("div",{className:"px-3 py-3 border-b space-y-2",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variant rule"}),t.jsx(ns,{currentRt:te??"",currentLabel:qe(ht?.rule),matchers:Lt,onSelect:Hs}),Bt&&G&&t.jsx("div",{className:"pt-1",children:t.jsx(Ge,{schema:Bt,value:G,onChange:Ws,basePath:""})})]})]}),t.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden p-4",children:Ze&&v?t.jsx(Ge,{schema:Ze,value:v,onChange:zt,basePath:"",breadcrumbPath:[],onBreadcrumbChange:R},M):t.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"No editable fields for this variant."})})]}):se?t.jsx(xt,{className:"flex-1 min-h-0",children:t.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden p-4",children:Ze&&v?t.jsx(Ge,{schema:Ze,value:v,onChange:zt,basePath:"",breadcrumbPath:[],onBreadcrumbChange:R},M):t.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"No editable fields for this global block."})})}):t.jsxs(xt,{className:"flex-1 min-h-0",children:[Ce&&N!==null&&t.jsxs("div",{className:"px-3 py-3 border-b space-y-2",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variant rule"}),t.jsx(ns,{currentRt:N,currentLabel:qe(ft?.rule),matchers:Lt,onSelect:Bs}),Mt&&C&&t.jsx("div",{className:"pt-1",children:t.jsx(Ge,{schema:Mt,value:C,onChange:Ks,basePath:""})})]}),t.jsx("div",{className:"p-2",children:t.jsx(or,{listKey:`${ee??""}-${we}`,sections:Te,selectedIndex:f,onSelect:$s,onReorder:Rs,onDelete:Is,onDuplicate:As,onMakeReusable:J,onAddSection:()=>Z(!0),canAddSection:Us})})]}),t.jsx(Jr,{open:F!==null,onOpenChange:S=>{S||J(null)},defaultBlockId:F!==null?Jn(Te[F]?.label??""):"",isPending:q.isPending,onSubmit:Es}),l&&t.jsx(il,{open:H,onOpenChange:Z,meta:p,decofile:u,previewBaseUrl:l,onSelect:zs})]})}export{ta as SectionsEditor};
@@ -1 +0,0 @@
1
- import{e as y,g as P,j as s,L as w,q as E,aL as J,c as C,t as G,b as T,l as K,r as Q,O as U}from"./index-C_m1_Qyy.js";import{u as W}from"./useRouterState-DNwJdpeR.js";import{S as V,a as X,b as Y,h as M,i as I,j as O,f as A,g as L,l as Z,m as ee}from"./sidebar-BFp8v2I0.js";import{a as se}from"./index-CKs6rcu1.js";import{i as te}from"./ArrowNarrowLeft-C0lNfAd-.js";import{b as le,c as oe,a as ie,d as re,e as ne,i as q}from"./ZapSquare-rxLTzaCI.js";import{t as ae,a as R}from"./Users03-COREII3z.js";import{i as ce}from"./HardDrive-CPUYFXaj.js";import{i as me}from"./Key01-CTY2QvpD.js";import{i as fe}from"./Lock01-DzYUukb5.js";import{i as de}from"./Shield01-Dd3PCkCh.js";import{s as xe}from"./User01-CnVuEZ_q.js";import{i as B}from"./Zap-DRsZpKeC.js";import{u as F}from"./tooltip-BeTs1OMg.js";import{u as be}from"./use-status-sounds-Ch0BXIj1.js";import{a as S}from"./toolbar-AIIkxXjs.js";import{S as he,M as ue}from"./shell-controls-CNwl3y79.js";import"./LayoutLeft-BA4wxcAF.js";import"./X-CexC7CUQ.js";import"./question-004-sINsf4GQ.js";import"./decopilot-sse-pool-DWRmePhE.js";import"./create-sse-subscription-CjI9SUTI.js";import"./ChevronRight-Djwmm7yx.js";function H(){const e=y.c(31),t=E().project;let m;e[0]!==t.enabledPlugins?(m=t.enabledPlugins??[],e[0]=t.enabledPlugins,e[1]=m):m=e[1];const r=m;let l,n,i,o,a;if(e[2]!==r){const u=J.filter(D=>r.includes(D.pluginId)).map(pe);let h;e[8]===Symbol.for("react.memo_cache_sentinel")?(h={key:"general",label:"General",icon:s.jsx(ae,{size:14}),to:"/$org/settings/general"},e[8]=h):h=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f={key:"brand-context",label:"Brand Context",icon:s.jsx(le,{size:14}),to:"/$org/settings/brand-context"},e[9]=f):f=e[9];let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p={key:"ai-providers",label:"AI Providers",icon:s.jsx(oe,{size:14}),to:"/$org/settings/ai-providers"},e[10]=p):p=e[10];let c;e[11]===Symbol.for("react.memo_cache_sentinel")?(c={key:"secrets",label:"Secrets",icon:s.jsx(me,{size:14}),to:"/$org/settings/secrets"},e[11]=c):c=e[11],e[12]===Symbol.for("react.memo_cache_sentinel")?(i={label:"Organization",items:[h,f,p,c,{key:"files",label:"Files",icon:s.jsx(ce,{size:14}),to:"/$org/settings/files"}]},e[12]=i):i=e[12];let _;e[13]===Symbol.for("react.memo_cache_sentinel")?(_={key:"connections",label:"Connections",icon:s.jsx(ie,{size:14}),to:"/$org/settings/connections"},e[13]=_):_=e[13];let j;e[14]===Symbol.for("react.memo_cache_sentinel")?(j={key:"agents",label:"Agents",icon:s.jsx(R,{size:14}),to:"/$org/settings/agents"},e[14]=j):j=e[14];let v;e[15]===Symbol.for("react.memo_cache_sentinel")?(v={key:"automations",label:"Automations",icon:s.jsx(B,{size:14}),to:"/$org/settings/automations"},e[15]=v):v=e[15],e[16]===Symbol.for("react.memo_cache_sentinel")?(o={label:"Build",items:[_,j,v,{key:"store",label:"Store",icon:s.jsx(re,{size:14}),to:"/$org/settings/store"}]},e[16]=o):o=e[16];let N;e[17]===Symbol.for("react.memo_cache_sentinel")?(N={key:"monitor",label:"Monitor",icon:s.jsx(ne,{size:14}),to:"/$org/settings/monitor"},e[17]=N):N=e[17];let $;e[18]===Symbol.for("react.memo_cache_sentinel")?($={key:"members",label:"Members",icon:s.jsx(R,{size:14}),to:"/$org/settings/members"},e[18]=$):$=e[18];let k;e[19]===Symbol.for("react.memo_cache_sentinel")?(k={key:"roles",label:"Roles",icon:s.jsx(de,{size:14}),to:"/$org/settings/roles"},e[19]=k):k=e[19],e[20]===Symbol.for("react.memo_cache_sentinel")?(a={label:"Manage",items:[N,$,k,{key:"sso",label:"Security",icon:s.jsx(fe,{size:14}),to:"/$org/settings/sso"}]},e[20]=a):a=e[20],l="Extensions";let z;e[21]===Symbol.for("react.memo_cache_sentinel")?(z={key:"features",label:"Plugins",icon:s.jsx(B,{size:14}),to:"/$org/settings/features"},e[21]=z):z=e[21],n=[z,...u],e[2]=r,e[3]=l,e[4]=n,e[5]=i,e[6]=o,e[7]=a}else l=e[3],n=e[4],i=e[5],o=e[6],a=e[7];let x;e[22]!==l||e[23]!==n?(x={label:l,items:n},e[22]=l,e[23]=n,e[24]=x):x=e[24];let d;e[25]===Symbol.for("react.memo_cache_sentinel")?(d={label:"Account",items:[{key:"profile",label:"Profile & Preferences",icon:s.jsx(xe,{size:14}),to:"/$org/settings/profile"}]},e[25]=d):d=e[25];let b;return e[26]!==i||e[27]!==o||e[28]!==a||e[29]!==x?(b=[i,o,a,x,d],e[26]=i,e[27]=o,e[28]=a,e[29]=x,e[30]=b):b=e[30],b}function pe(e){const{key:t,label:m,icon:r,to:l}=e;return{key:t,label:m,icon:r,to:l}}function ge(){const e=y.c(19),t=H();let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={from:"/shell/$org"},e[0]=m):m=e[0];const{org:r}=P(m);let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l={select:_e},e[1]=l):l=e[1];const n=W(l);let i;e[2]!==r||e[3]!==n?(i=h=>{const f=h.replace("$org",r);return n.startsWith(f)},e[2]=r,e[3]=n,e[4]=i):i=e[4];const o=i;let a;if(e[5]!==t||e[6]!==o||e[7]!==r){let h;e[9]!==o||e[10]!==r?(h=(f,p)=>s.jsxs(M,{className:"pt-0 pr-0 pb-0 pl-0",children:[f.label&&s.jsx("p",{className:C("px-2 pt-1.5 pb-0.5 text-xs font-medium text-muted-foreground/60",p>0&&"mt-3"),children:f.label}),s.jsx(I,{children:s.jsx(O,{className:"gap-0.5",children:f.items.map(c=>s.jsx(A,{children:s.jsx(L,{asChild:!0,isActive:o(c.to),children:s.jsxs(w,{to:c.to,params:{org:r},onClick:()=>G("settings_nav_clicked",{section_key:c.key,section_label:c.label,group_label:f.label||"main"}),className:"flex items-center gap-2.5 text-sm",children:[s.jsx("span",{className:"shrink-0",children:c.icon}),s.jsx("span",{className:"truncate",children:c.label})]})})},c.key))})})]},`${f.label}-${p}`),e[9]=o,e[10]=r,e[11]=h):h=e[11],a=t.map(h),e[5]=t,e[6]=o,e[7]=r,e[8]=a}else a=e[8];let x;e[12]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("div",{className:"mx-2 my-2 border-t border-border/50"}),e[12]=x):x=e[12];let d;e[13]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsxs(M,{className:"pt-0 pr-0 pb-0 pl-0",children:[x,s.jsx(I,{children:s.jsx(O,{className:"gap-0.5",children:s.jsx(A,{children:s.jsxs(L,{onClick:je,className:"flex items-center gap-2.5 text-sm",children:[s.jsx("span",{className:"shrink-0",children:s.jsx(q,{size:14})}),s.jsx("span",{className:"truncate",children:"Sign Out"})]})})})})]}),e[13]=d):d=e[13];let b;e[14]!==a?(b=s.jsxs(Z,{className:"flex flex-col flex-1 mt-2 px-2 pb-2 gap-0 overflow-y-auto",children:[a,d]}),e[14]=a,e[15]=b):b=e[15];let g;e[16]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx("div",{className:"mt-auto px-4 pb-1",children:s.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v","2.367.38"]})}),e[16]=g):g=e[16];let u;return e[17]!==b?(u=s.jsxs(ee,{variant:"sidebar",children:[b,g]}),e[17]=b,e[18]=u):u=e[18],u}function je(){G("signed_out",{source:"settings_sidebar"}),T.signOut()}function _e(e){return e.location.pathname}function Se(e){const t=y.c(21),{onClose:m}=e,r=H();let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l={from:"/shell/$org"},t[0]=l):l=t[0];const{org:n}=P(l);let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i={select:ve},t[1]=i):i=t[1];const o=W(i);let a;t[2]!==n||t[3]!==o?(a=p=>{const c=p.replace("$org",n);return o.startsWith(c)},t[2]=n,t[3]=o,t[4]=a):a=t[4];const x=a;let d;if(t[5]!==r||t[6]!==x||t[7]!==m||t[8]!==n){let p;t[10]!==x||t[11]!==m||t[12]!==n?(p=(c,_)=>s.jsxs("div",{className:"flex flex-col gap-0.5",children:[c.label&&s.jsx("p",{className:C("px-3 pt-1.5 pb-0.5 text-xs font-medium text-muted-foreground/60",_>0&&"mt-3"),children:c.label}),c.items.map(j=>s.jsxs(w,{to:j.to,params:{org:n},onClick:m,className:C("flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm",x(j.to)?"bg-sidebar-accent text-sidebar-accent-foreground font-medium":"text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground"),children:[s.jsx("span",{className:"shrink-0",children:j.icon}),s.jsx("span",{className:"truncate",children:j.label})]},j.key))]},`${c.label}-${_}`),t[10]=x,t[11]=m,t[12]=n,t[13]=p):p=t[13],d=r.map(p),t[5]=r,t[6]=x,t[7]=m,t[8]=n,t[9]=d}else d=t[9];let b;t[14]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx("div",{className:"h-px bg-border/50 my-2"}),t[14]=b):b=t[14];let g;t[15]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[b,s.jsxs("button",{type:"button",onClick:ye,className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[s.jsx("span",{className:"shrink-0",children:s.jsx(q,{size:14})}),s.jsx("span",{className:"truncate",children:"Sign Out"})]})]}),t[15]=g):g=t[15];let u;t[16]!==d?(u=s.jsxs("div",{className:"flex flex-col flex-1 overflow-y-auto px-2 py-2 gap-0.5",children:[d,g]}),t[16]=d,t[17]=u):u=t[17];let h;t[18]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx("div",{className:"px-4 pb-3 pt-1 border-t border-border/50",children:s.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v","2.367.38"]})}),t[18]=h):h=t[18];let f;return t[19]!==u?(f=s.jsxs("div",{className:"flex flex-col h-full bg-sidebar",children:[u,h]}),t[19]=u,t[20]=f):f=t[20],f}function ye(){return T.signOut()}function ve(e){return e.location.pathname}function Ne(){const e=y.c(4),t=F(),{org:m}=E();be(m.slug);let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx(K,{size:20,className:"animate-spin text-muted-foreground"})}),e[0]=r):r=e[0];let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Q.Suspense,{fallback:r,children:s.jsx("div",{className:"flex flex-1 items-center overflow-hidden rounded-[inherit]",children:s.jsx(se,{value:"p-0",children:s.jsx("div",{className:"flex-1 min-w-0 overflow-hidden h-full",children:s.jsx(U,{})})})})}),e[1]=l):l=e[1];const n=l;if(t){let o;return e[2]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex flex-col flex-1 bg-background min-h-0 overflow-hidden",children:n}),e[2]=o):o=e[2],o}let i;return e[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex-1 min-h-0 p-1",children:s.jsx("div",{className:C("flex flex-col h-full min-h-0 bg-background overflow-hidden","card-shadow","rounded-[0.75rem]"),children:n})}),e[3]=i):i=e[3],i}function Ue(){const e=y.c(29),t=F();let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={from:"/shell/$org"},e[0]=m):m=e[0];const{org:r}=P(m);let l;e[1]!==r?(l={org:r},e[1]=r,e[2]=l):l=e[2];let n,i;e[3]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(te,{size:14,className:"shrink-0"}),i=s.jsx("span",{children:"Settings"}),e[3]=n,e[4]=i):(n=e[3],i=e[4]);let o;e[5]!==l?(o=s.jsxs(w,{to:"/$org",params:l,className:"wco-no-drag flex items-center gap-1.5 px-2 h-7 rounded-md text-sm text-muted-foreground hover:text-foreground hover:bg-accent transition-colors",children:[n,i]}),e[5]=l,e[6]=o):o=e[6];let a;e[7]!==t?(a=t&&s.jsx(he,{}),e[7]=t,e[8]=a):a=e[8];let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("span",{className:"hidden md:contents",children:s.jsx(S.Nav,{})}),e[9]=x):x=e[9];let d;e[10]!==o||e[11]!==a?(d=s.jsxs(S.LeftColumn,{children:[o,a,x]}),e[10]=o,e[11]=a,e[12]=d):d=e[12];let b;e[13]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(S.CenterSlot,{}),e[13]=b):b=e[13];let g;e[14]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(S.RightColumn,{children:s.jsx("span",{})}),e[14]=g):g=e[14];let u;e[15]!==d?(u=s.jsxs(S.Header,{children:[d,b,g]}),e[15]=d,e[16]=u):u=e[16];let h;e[17]===Symbol.for("react.memo_cache_sentinel")?(h={"--sidebar-width-icon":"3.5rem"},e[17]=h):h=e[17];let f;e[18]!==t?(f=!t&&s.jsx(ge,{}),e[18]=t,e[19]=f):f=e[19];let p;e[20]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(V,{className:"flex flex-col",style:{background:"transparent",containerType:"inline-size"},children:s.jsx(Ne,{})}),e[20]=p):p=e[20];let c;e[21]!==f?(c=s.jsxs(X,{className:"flex-1 bg-sidebar min-h-0",style:h,children:[f,p]}),e[21]=f,e[22]=c):c=e[22];let _;e[23]!==t?(_=t&&s.jsx(ue,{renderSidebar:$e}),e[23]=t,e[24]=_):_=e[24];let j;return e[25]!==u||e[26]!==c||e[27]!==_?(j=s.jsx(S.Provider,{children:s.jsx(Y,{defaultOpen:!0,children:s.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[u,c,_]})})}),e[25]=u,e[26]=c,e[27]=_,e[28]=j):j=e[28],j}function $e(e){const{onClose:t}=e;return s.jsx(Se,{onClose:t})}export{ge as SettingsSidebar,Se as SettingsSidebarMobile,Ue as default};
@@ -1 +0,0 @@
1
- import{e as N,a as K,j as n,B as C,o as F,b as G,a0 as ne,s as Y,K as Q,U as I,r as D,bj as se,f as oe,q as ae,g as ie,d as re,Z as le,S as ce,O as de,bk as ue}from"./index-C_m1_Qyy.js";import{A as V}from"./avatar-ByQQ7GEH.js";import{t as me,a as fe}from"./Users03-COREII3z.js";import{i as Z}from"./Lock01-DzYUukb5.js";import{a as ge,b as he,s as P,n as pe,i as xe}from"./Stars02-BgabhO3x.js";import{s as be}from"./XClose-BOJwjK3-.js";import{i as L}from"./CheckCircle-naAuY0Am.js";import{i as q}from"./FilterLines-xU-m-2To.js";import{i as B}from"./Zap-DRsZpKeC.js";import{a as ye,c as Se,d as we,b as je}from"./dialog-Bg6eRMC4.js";import{R as ve}from"./required-auth-layout-CJnuX5pr.js";import{g as Ne,u as ke,A as _e}from"./hooks-Buro5ByR.js";import{g as Oe}from"./constants-piR0edM1.js";import{a as Ce}from"./use-organization-settings-BfJ6uqm2.js";import{u as ze}from"./use-org-sso-Baws_Cb6.js";function Ee(t){const e=N.c(27),{orgName:s,orgSlug:o,orgLogo:u,domain:i}=t;let r;e[0]!==o?(r={mutationFn:async()=>{const y=await fetch("/api/auth/custom/domain-join",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationSlug:o})}),k=await y.json();if(!y.ok||!k.success)throw new Error(k.error??"Failed to join organization");return k},onSuccess:y=>{window.location.href=`/${y.slug??o}`},onError:Ae},e[0]=o,e[1]=r):r=e[1];const l=K(r),c=$e;let d;e[2]!==u||e[3]!==s?(d=u?n.jsx(V,{url:u,fallback:s.charAt(0).toUpperCase(),shape:"square",size:"base",className:"h-12 w-12"}):n.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:n.jsx(me,{className:"h-6 w-6 text-primary"})}),e[2]=u,e[3]=s,e[4]=d):d=e[4];let m;e[5]!==s?(m=n.jsxs("h3",{className:"text-lg font-medium",children:["Join ",s,"?"]}),e[5]=s,e[6]=m):m=e[6];let a;e[7]!==i?(a=n.jsxs("p",{className:"text-sm text-muted-foreground",children:["Anyone with an ",n.jsxs("strong",{children:["@",i]})," email can join this organization."]}),e[7]=i,e[8]=a):a=e[8];let h;e[9]!==m||e[10]!==a?(h=n.jsxs("div",{className:"space-y-2",children:[m,a]}),e[9]=m,e[10]=a,e[11]=h):h=e[11];let b;e[12]!==l?(b=()=>l.mutate(),e[12]=l,e[13]=b):b=e[13];const p=l.isPending?"Joining…":`Enter ${s}`;let f;e[14]!==l.isPending||e[15]!==b||e[16]!==p?(f=n.jsx(C,{onClick:b,disabled:l.isPending,children:p}),e[14]=l.isPending,e[15]=b,e[16]=p,e[17]=f):f=e[17];let g;e[18]!==l.isPending?(g=n.jsx(C,{variant:"ghost",onClick:c,disabled:l.isPending,children:"Go to home"}),e[18]=l.isPending,e[19]=g):g=e[19];let x;e[20]!==f||e[21]!==g?(x=n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[f,g]}),e[20]=f,e[21]=g,e[22]=x):x=e[22];let w;return e[23]!==x||e[24]!==d||e[25]!==h?(w=n.jsx("div",{className:"flex items-center justify-center min-h-screen bg-background",children:n.jsxs("div",{className:"flex flex-col items-center text-center space-y-4 max-w-sm px-6",children:[d,h,x]})}),e[23]=x,e[24]=d,e[25]=h,e[26]=w):w=e[26],w}function $e(){window.location.href="/"}function Ae(t){F.error(t instanceof Error?t.message:"Failed to join organization")}function W(t){const e=N.c(17),{orgSlug:s,orgName:o,reason:u}=t,i=Te,r=u==="not-found",l=r?ge:Z,c=r?"Organization not found":"No access";let d;e[0]!==r||e[1]!==o||e[2]!==s?(d=r?n.jsxs(n.Fragment,{children:["We couldn't find an organization called ",n.jsx("strong",{children:s}),"."]}):n.jsxs(n.Fragment,{children:["You don't have access to ",n.jsx("strong",{children:o??s}),". Ask an admin to invite you."]}),e[0]=r,e[1]=o,e[2]=s,e[3]=d):d=e[3];const m=d;let a;e[4]!==l?(a=n.jsx("div",{className:"bg-muted p-3 rounded-full",children:n.jsx(l,{className:"h-6 w-6 text-muted-foreground"})}),e[4]=l,e[5]=a):a=e[5];let h;e[6]!==c?(h=n.jsx("h3",{className:"text-lg font-medium",children:c}),e[6]=c,e[7]=h):h=e[7];let b;e[8]!==m?(b=n.jsx("p",{className:"text-sm text-muted-foreground",children:m}),e[8]=m,e[9]=b):b=e[9];let p;e[10]!==h||e[11]!==b?(p=n.jsxs("div",{className:"space-y-2",children:[h,b]}),e[10]=h,e[11]=b,e[12]=p):p=e[12];let f;e[13]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(C,{onClick:i,children:"Go to home"}),e[13]=f):f=e[13];let g;return e[14]!==a||e[15]!==p?(g=n.jsx("div",{className:"flex items-center justify-center min-h-screen bg-background",children:n.jsxs("div",{className:"flex flex-col items-center text-center space-y-4 max-w-sm px-6",children:[a,p,f]})}),e[14]=a,e[15]=p,e[16]=g):g=e[16],g}function Te(){window.location.href="/"}function Ie(t){const e=N.c(39),{invitationId:s,orgName:o,orgSlug:u,orgLogo:i}=t;let r;e[0]!==s?(r=async()=>{const z=await G.organization.acceptInvitation({invitationId:s});if(z.error)throw new Error(z.error.message);return z.data},e[0]=s,e[1]=r):r=e[1];let l;e[2]!==u?(l=()=>{ne(),window.location.href=`/${u}`},e[2]=u,e[3]=l):l=e[3];let c;e[4]!==r||e[5]!==l?(c={mutationFn:r,onSuccess:l,onError:De},e[4]=r,e[5]=l,e[6]=c):c=e[6];const d=K(c);let m;e[7]!==s?(m=async()=>{const z=await G.organization.rejectInvitation({invitationId:s});if(z.error)throw new Error(z.error.message);return z.data},e[7]=s,e[8]=m):m=e[8];let a;e[9]===Symbol.for("react.memo_cache_sentinel")?(a=Pe,e[9]=a):a=e[9];let h;e[10]!==m?(h={mutationFn:m,onSuccess:a,onError:Me},e[10]=m,e[11]=h):h=e[11];const b=K(h),p=d.isPending||b.isPending;let f;e[12]!==i||e[13]!==o?(f=i?n.jsx(V,{url:i,fallback:o.charAt(0).toUpperCase(),shape:"square",size:"base",className:"h-12 w-12"}):n.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:n.jsx(he,{className:"h-6 w-6 text-primary"})}),e[12]=i,e[13]=o,e[14]=f):f=e[14];let g;e[15]!==o?(g=n.jsxs("h3",{className:"text-lg font-medium",children:["You've been invited to ",n.jsx("strong",{children:o})]}),e[15]=o,e[16]=g):g=e[16];let x;e[17]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx("p",{className:"text-sm text-muted-foreground",children:"Accept the invitation to join this organization."}),e[17]=x):x=e[17];let w;e[18]!==g?(w=n.jsxs("div",{className:"space-y-2",children:[g,x]}),e[18]=g,e[19]=w):w=e[19];let y;e[20]!==d?(y=()=>d.mutate(),e[20]=d,e[21]=y):y=e[21];const k=d.isPending?"Accepting…":"Accept invitation";let v;e[22]!==p||e[23]!==y||e[24]!==k?(v=n.jsx(C,{onClick:y,disabled:p,children:k}),e[22]=p,e[23]=y,e[24]=k,e[25]=v):v=e[25];let _;e[26]!==b?(_=()=>b.mutate(),e[26]=b,e[27]=_):_=e[27];const S=b.isPending?"Declining…":"Decline";let j;e[28]!==p||e[29]!==_||e[30]!==S?(j=n.jsx(C,{variant:"ghost",onClick:_,disabled:p,children:S}),e[28]=p,e[29]=_,e[30]=S,e[31]=j):j=e[31];let T;e[32]!==v||e[33]!==j?(T=n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[v,j]}),e[32]=v,e[33]=j,e[34]=T):T=e[34];let M;return e[35]!==w||e[36]!==T||e[37]!==f?(M=n.jsx("div",{className:"flex items-center justify-center min-h-screen bg-background",children:n.jsxs("div",{className:"flex flex-col items-center text-center space-y-4 max-w-sm px-6",children:[f,w,T]})}),e[35]=w,e[36]=T,e[37]=f,e[38]=M):M=e[38],M}function Me(t){F.error(t instanceof Error?t.message:"Failed to decline invitation")}function Pe(){F.success("Invitation declined"),window.location.href="/"}function De(t){F.error(t instanceof Error?t.message:"Failed to accept invitation")}function Re(t){const e=N.c(7);let s;e[0]!==t?(s=Q.orgAccessStatus(t),e[0]=t,e[1]=s):s=e[1];let o;e[2]!==t?(o=async()=>{const i=await fetch(`/api/auth/custom/org-access-status/${encodeURIComponent(t)}`,{credentials:"include"});if(!i.ok)throw new Error(`org-access-status failed (${i.status})`);return await i.json()},e[2]=t,e[3]=o):o=e[3];let u;return e[4]!==s||e[5]!==o?(u={queryKey:s,queryFn:o,refetchOnWindowFocus:!1},e[4]=s,e[5]=o,e[6]=u):u=e[6],Y(u)}function Fe({orgSlug:t}){const{data:e}=Re(t);return(e.status==="not-found"||e.status==="no-access")&&localStorage.getItem(I.lastOrgSlug())===t?(localStorage.removeItem(I.lastOrgSlug()),window.location.href="/",null):e.status==="not-found"?n.jsx(W,{orgSlug:t,reason:"not-found"}):e.status==="pending-invite"?n.jsx(Ie,{invitationId:e.invitation.id,orgName:e.organization.name,orgSlug:e.organization.slug,orgLogo:e.organization.logo}):e.status==="auto-domain-join"?n.jsx(Ee,{orgName:e.organization.name,orgSlug:e.organization.slug,orgLogo:e.organization.logo,domain:e.organization.domain??""}):e.status==="member"?(window.location.reload(),null):n.jsx(W,{orgSlug:t,orgName:e.organization.name,reason:"no-access"})}function Le(t){const e=N.c(20),{release:s,onCtaClick:o,onLearnMoreClick:u}=t;let i;e[0]!==s.eyebrow?(i=s.eyebrow&&n.jsx("p",{className:"text-xs text-muted-foreground",children:s.eyebrow}),e[0]=s.eyebrow,e[1]=i):i=e[1];let r;e[2]!==s.title?(r=n.jsx("h3",{className:"text-base font-semibold text-foreground",children:s.title}),e[2]=s.title,e[3]=r):r=e[3];let l;e[4]!==i||e[5]!==r?(l=n.jsxs("div",{children:[i,r]}),e[4]=i,e[5]=r,e[6]=l):l=e[6];let c;e[7]!==s.bullets?(c=s.bullets.map(Ke),e[7]=s.bullets,e[8]=c):c=e[8];let d;e[9]!==c?(d=n.jsx("ul",{className:"flex flex-col gap-3",children:c}),e[9]=c,e[10]=d):d=e[10];let m;e[11]!==o||e[12]!==u||e[13]!==s.cta||e[14]!==s.learnMoreHref?(m=(s.cta||s.learnMoreHref)&&n.jsxs("div",{className:"flex items-center justify-between pt-1",children:[s.learnMoreHref?n.jsx("a",{href:s.learnMoreHref,target:"_blank",rel:"noreferrer",onClick:u,className:"text-xs text-muted-foreground hover:text-foreground underline-offset-2 hover:underline",children:"Learn More"}):n.jsx("span",{}),s.cta&&n.jsx(C,{asChild:!0,size:"sm",onClick:o,children:n.jsx("a",{href:s.cta.href,children:s.cta.label})})]}),e[11]=o,e[12]=u,e[13]=s.cta,e[14]=s.learnMoreHref,e[15]=m):m=e[15];let a;return e[16]!==l||e[17]!==d||e[18]!==m?(a=n.jsxs("div",{className:"flex flex-col gap-3",children:[l,d,m]}),e[16]=l,e[17]=d,e[18]=m,e[19]=a):a=e[19],a}function Ke(t,e){return n.jsxs("li",{className:"flex items-start gap-3",children:[n.jsx(t.icon,{size:20,className:"text-muted-foreground mt-0.5 shrink-0"}),n.jsxs("div",{className:"min-w-0",children:[n.jsx("p",{className:"text-sm font-medium text-foreground",children:t.title}),n.jsx("p",{className:"text-xs text-muted-foreground",children:t.body})]})]},e)}const X=[{id:"claude-opus-4-8",date:"2026-05-28",eyebrow:"Now Available",title:"Claude Opus 4.8 is the new default",bullets:[{icon:P,title:"Smarter thinking, same price",body:"Opus 4.8 now leads the Thinking and Smarter tiers, outperforming Opus 4.7 on coding, reasoning, and agent tasks at the same cost."},{icon:L,title:"More honest answers",body:"It's about 4× less likely to let a code flaw slip through unflagged, and surfaces uncertainty instead of making unsupported claims."},{icon:B,title:"Nothing to change",body:"Chats and agents pick up Opus 4.8 automatically wherever the Thinking or Smarter tier is selected."}],learnMoreHref:"https://www.anthropic.com/news/claude-opus-4-8"},{id:"enhanced-sidebar",date:"2026-05-28",eyebrow:"Now Available",title:"Enhanced sidebar",bullets:[{icon:P,title:"A clearer view of what's running",body:"See every task in your organization at a glance, with each agent and status group laid out so you can spot active work without hunting for it."},{icon:q,title:"Browse one group at a time",body:"Expand the groups you care about and pull in more results on demand — no more endless scrolling to find an older conversation."},{icon:L,title:"Polished and steadier",body:"Several sidebar bugs are fixed, including empty agent groups showing the right action and status filters returning the right tasks."}]},{id:"smarter-task-delegation",date:"2026-05-27",eyebrow:"Now Available",title:"Smarter task delegation",bullets:[{icon:fe,title:"Real results from delegated agents",body:"When one agent hands work to another, you'll see the full report inline — no more empty replies hiding the work that was done."},{icon:B,title:"Same powers, top to bottom",body:"Delegated agents now work with the same tools, context, and memory as the agent that called them, so complex multi-agent investigations finish on the first try."},{icon:L,title:"Clearer progress signals",body:"When a delegated task hits its limit or runs into a problem, you get a plain-language message instead of a silent stall."}]},{id:"sidebar-task-groups",date:"2026-05-27",eyebrow:"Now Available",title:"Redesigned sidebar",bullets:[{icon:P,title:"Group by agent or status",body:"Switch the task list between grouping by agent or by status — pick whichever matches how you're working right now."},{icon:q,title:"Sharper filters",body:"Narrow the list to your tasks, manual chats, or automations from a compact filter row above the groups."}]},{id:"release-channel",date:"2026-05-26",eyebrow:"Now Available",title:"Release announcements",bullets:[{icon:P,title:"Heads-up when features ship",body:"New releases surface in a corner card the first time you see them, then stick around in your inbox."},{icon:pe,title:"Unified inbox",body:"Org invitations and product updates now share one chronological feed in the sidebar."}]}],R="studio.release-feed.v1",U=new Set;let $="",A={},H=!1;function Ge(){if(H)return $||"{}";try{return localStorage.getItem(R)??"{}"}catch{return $||"{}"}}function ee(t){try{const e=JSON.parse(t);return e&&typeof e=="object"?e:{}}catch{return{}}}function J(){const t=Ge();return t!==$&&($=t,A=ee(t)),A}function Ue(t){U.add(t);const e=s=>{if(!(s.key!==R&&s.key!==null)){try{const o=localStorage.getItem(R)??"{}",i={...ee(o),...A};A=i,$=JSON.stringify(i)}catch{}t()}};return window.addEventListener("storage",e),()=>{U.delete(t),window.removeEventListener("storage",e)}}function He(t){A=t,$=JSON.stringify(t);try{localStorage.setItem(R,$),H=!1}catch{H=!0}U.forEach(e=>e())}function qe(){const t=N.c(7),e=D.useSyncExternalStore(Ue,J,J);let s;t[0]!==e?(s=c=>!!e[c],t[0]=e,t[1]=s):s=t[1];const o=s,u=Be;let i;t[2]!==e?(i=X.reduce((c,d)=>e[d.id]?c:c+1,0),t[2]=e,t[3]=i):i=t[3];const r=i;let l;return t[4]!==o||t[5]!==r?(l={isSeen:o,markSeen:u,unseenCount:r},t[4]=o,t[5]=r,t[6]=l):l=t[6],l}function Be(t){A[t]||He({...A,[t]:{seenAt:new Date().toISOString()}})}const We=720*60*60*1e3;function Je(t){const[e,s,o]=t.split("-").map(Number);return!e||!s||!o?new Date(t).getTime():new Date(e,s-1,o).getTime()}function Ye(t){const e=X[0];if(!e)return null;const s=Je(e.date),o=t-s;return o<0||o>We?null:e}function Qe(){const t=N.c(21),{isSeen:e,markSeen:s}=qe();let o,u,i;if(t[0]!==e){i=Symbol.for("react.early_return_sentinel");e:{if(o=Ye(Date.now()),!o){i=null;break e}u=e(o.id)}t[0]=e,t[1]=o,t[2]=u,t[3]=i}else o=t[1],u=t[2],i=t[3];if(i!==Symbol.for("react.early_return_sentinel"))return i;if(u)return null;let r;t[4]!==o.id||t[5]!==s?(r=()=>s(o.id),t[4]=o.id,t[5]=s,t[6]=r):r=t[6];let l;t[7]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(be,{size:14}),t[7]=l):l=t[7];let c;t[8]!==r?(c=n.jsx(C,{size:"icon",variant:"ghost","aria-label":"Dismiss release announcement",className:"absolute right-2 top-2 size-7 text-muted-foreground",onClick:r,children:l}),t[8]=r,t[9]=c):c=t[9];let d,m;t[10]!==o.id||t[11]!==s?(d=()=>s(o.id),m=()=>s(o.id),t[10]=o.id,t[11]=s,t[12]=d,t[13]=m):(d=t[12],m=t[13]);let a;t[14]!==o||t[15]!==d||t[16]!==m?(a=n.jsx(Le,{release:o,onCtaClick:d,onLearnMoreClick:m}),t[14]=o,t[15]=d,t[16]=m,t[17]=a):a=t[17];let h;return t[18]!==c||t[19]!==a?(h=n.jsxs("div",{role:"dialog","aria-label":"Release announcement",className:"fixed bottom-6 right-6 z-50 w-[min(360px,calc(100vw-3rem))] rounded-lg border border-border bg-background p-4 shadow-lg animate-in fade-in slide-in-from-bottom-2 duration-300",children:[c,a]}),t[18]=c,t[19]=a,t[20]=h):h=t[20],h}const te=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform),E=te?"⌘":"Ctrl",O={keyboardShortcuts:{keys:[E,"K"],description:"Keyboard shortcuts"},focusChatInput:{keys:[E,"L"],description:"Focus chat input"},saveAndFormat:{keys:[E,"S"],description:"Save & format"},sendMessage:{keys:["Enter"],description:"Send message"},newLine:{keys:["Shift","Enter"],description:"New line"},selectOption:{keys:["1-9"],description:"Select option"},applyFilter:{keys:[E,"Enter"],description:"Apply filter"},togglePlanMode:{keys:[E,"Shift","L"],description:"Toggle plan mode"},newTask:{keys:["Shift",E,"S"],description:"New task"},toggleDaemon:{keys:[E,"D"],description:"Toggle daemon logs"}},Ve=[{label:"General",shortcuts:[O.keyboardShortcuts,O.newTask,O.toggleDaemon]},{label:"Editor",shortcuts:[O.saveAndFormat]},{label:"Chat",shortcuts:[O.focusChatInput,O.togglePlanMode,O.sendMessage,O.newLine]},{label:"Questions",shortcuts:[O.selectOption]},{label:"Monitoring",shortcuts:[O.applyFilter]}];function Ze(t){return te?t.metaKey:t.ctrlKey}function Xe(t){const e=N.c(5),{open:s,onOpenChange:o}=t;let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Se,{children:n.jsx(we,{children:"Keyboard Shortcuts"})}),e[0]=u):u=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsxs(ye,{className:"sm:max-w-md",children:[u,n.jsx("div",{className:"flex flex-col gap-4",children:Ve.map(et)})]}),e[1]=i):i=e[1];let r;return e[2]!==o||e[3]!==s?(r=n.jsx(je,{open:s,onOpenChange:o,children:i}),e[2]=o,e[3]=s,e[4]=r):r=e[4],r}function et(t){return n.jsxs("div",{children:[n.jsx("h3",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-2",children:t.label}),n.jsx("div",{className:"flex flex-col gap-1.5",children:t.shortcuts.map(tt)})]},t.label)}function tt(t){return n.jsxs("div",{className:"flex items-center justify-between py-1",children:[n.jsx("span",{className:"text-sm",children:t.description}),n.jsx("div",{className:"flex items-center gap-1",children:t.keys.map(nt)})]},t.description)}function nt(t){return n.jsx("kbd",{className:"inline-flex items-center justify-center min-w-6 h-6 px-1.5 rounded-sm border border-border bg-muted text-muted-foreground text-xs font-mono",children:t},t)}function st({activeOrg:t}){return t&&se(t.id,{name:t.name??void 0,slug:t.slug??void 0}),null}function ot(t,e,s){if(!s)return null;const o=Ne(t,e);return o?o.threads.get().find(i=>i.id===s)?.branch??null:null}function at(t){const e=N.c(17),{orgSlug:s,orgName:o,domain:u}=t;let i;e[0]!==s?(i=()=>{window.location.href=`/api/${encodeURIComponent(s)}/sso/authorize`},e[0]=s,e[1]=i):i=e[1];const r=i,l=it;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:n.jsx(Z,{className:"h-6 w-6 text-primary"})}),e[2]=c):c=e[2];let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx("h3",{className:"text-lg font-medium",children:"SSO Authentication Required"}),e[3]=d):d=e[3];let m;e[4]!==u||e[5]!==o?(m=o?n.jsxs(n.Fragment,{children:[n.jsx("strong",{children:o})," requires SSO authentication",u?` via ${u}`:"","."]}):"This organization requires SSO authentication to access.",e[4]=u,e[5]=o,e[6]=m):m=e[6];let a;e[7]!==m?(a=n.jsxs("div",{className:"space-y-2",children:[d,n.jsx("p",{className:"text-sm text-muted-foreground",children:m})]}),e[7]=m,e[8]=a):a=e[8];let h;e[9]!==r?(h=n.jsx(C,{onClick:r,children:"Sign in with SSO"}),e[9]=r,e[10]=h):h=e[10];let b;e[11]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(C,{variant:"ghost",onClick:l,children:"Go back"}),e[11]=b):b=e[11];let p;e[12]!==h?(p=n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[h,b]}),e[12]=h,e[13]=p):p=e[13];let f;return e[14]!==a||e[15]!==p?(f=n.jsx("div",{className:"flex items-center justify-center min-h-screen bg-background",children:n.jsxs("div",{className:"flex flex-col items-center text-center space-y-4 max-w-sm px-6",children:[c,a,p]})}),e[14]=a,e[15]=p,e[16]=f):f=e[16],f}function it(){window.location.href="/"}function rt(t){const e=N.c(9),{orgName:s}=t,o=lt;let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx("div",{className:"bg-muted p-3 rounded-full",children:n.jsx(xe,{className:"h-6 w-6 text-muted-foreground"})}),e[0]=u):u=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx("h3",{className:"text-lg font-medium",children:"Organization unavailable"}),e[1]=i):i=e[1];let r;e[2]!==s?(r=s?n.jsxs(n.Fragment,{children:[n.jsx("strong",{children:s})," has been deleted or is no longer available."]}):"This organization has been deleted or is no longer available.",e[2]=s,e[3]=r):r=e[3];let l;e[4]!==r?(l=n.jsxs("div",{className:"space-y-2",children:[i,n.jsx("p",{className:"text-sm text-muted-foreground",children:r})]}),e[4]=r,e[5]=l):l=e[5];let c;e[6]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(C,{onClick:o,children:"Go to home"}),e[6]=c):c=e[6];let d;return e[7]!==l?(d=n.jsx("div",{className:"flex items-center justify-center min-h-screen bg-background",children:n.jsxs("div",{className:"flex flex-col items-center text-center space-y-4 max-w-sm px-6",children:[u,l,c]})}),e[7]=l,e[8]=d):d=e[8],d}function lt(){window.location.href="/"}function ct(t){const e=N.c(8),{org:s,children:o}=t,i=Ce(s.id,s.slug)?.enabled_plugins??null;let r;e[0]!==s.id||e[1]!==s.name||e[2]!==i?(r={id:s.id,organizationId:s.id,slug:"_org",name:s.name,enabledPlugins:i,ui:null},e[0]=s.id,e[1]=s.name,e[2]=i,e[3]=r):r=e[3];const l=r;let c;return e[4]!==o||e[5]!==s||e[6]!==l?(c=n.jsx(ue,{org:s,project:l,children:o}),e[4]=o,e[5]=s,e[6]=l,e[7]=c):c=e[7],c}function dt(){const t=oe(),{create:e}=ke(),{org:s,locator:o}=ae(),u=ie({strict:!1}),i=re({strict:!1}),r=u.org??"",l=u.taskId??"",c=(f,g,x=!0)=>t({to:"/$org/$taskId",params:{org:r,taskId:f},search:g,replace:x}),d=(f,g=!0)=>c(l,f,g),m=f=>d(g=>({...g,chat:f?1:0})),a=(f,g,x)=>c(f,w=>{const y={chat:1};return g?y.virtualmcpid=g:w.virtualmcpid&&(y.virtualmcpid=w.virtualmcpid),w.main&&(y.main=w.main),x?.autosend&&(y.autosend=_e),y},!1);return{setChatOpen:m,setTaskId:a,createNewTask:async f=>{const g=crypto.randomUUID(),x=f??i.virtualmcpid??Oe(s.id).id,y=x===i.virtualmcpid?ot(s.slug,o,l):null;try{await e({id:g,virtual_mcp_id:x,...y?{branch:y}:{}})}catch{}a(g,x)},openTab:f=>c(l||crypto.randomUUID(),g=>({...g,main:f})),toggleMain:()=>d(f=>{if(f.main!==void 0&&f.main!=="0")return{...f,main:"0"};const x={...f};return delete x.main,x})}}function ut(){const t=N.c(33);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org",shouldThrow:!1},t[0]=e):e=t[0];const o=le(e)?.params.org,[u,i]=D.useState(!1);let r,l;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=()=>{const S=j=>{Ze(j)&&j.code==="KeyK"&&(j.preventDefault(),i(!0))};return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},l=[],t[1]=r,t[2]=l):(r=t[1],l=t[2]),D.useEffect(r,l);let c;t[3]!==o?(c=Q.activeOrganization(o),t[3]=o,t[4]=c):c=t[4];let d;t[5]!==o?(d=async()=>{if(!o)return null;const{data:S}=await G.organization.getFullOrganization({query:{organizationSlug:o}}),j=S?.metadata?.archived===!0;return S&&!j&&localStorage.setItem(I.lastOrgSlug(),o),S},t[5]=o,t[6]=d):d=t[6];let m;t[7]!==c||t[8]!==d?(m={queryKey:c,queryFn:d,gcTime:1/0,refetchOnWindowFocus:!1},t[7]=c,t[8]=d,t[9]=m):m=t[9];const{data:a}=Y(m),h=a?.id,b=a?.slug,{data:p}=ze(h,b);if(!a){let S;t[10]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx(ce,{}),t[10]=S):S=t[10];let j;return t[11]!==o?(j=n.jsx(D.Suspense,{fallback:S,children:n.jsx(Fe,{orgSlug:o})}),t[11]=o,t[12]=j):j=t[12],j}if(a.metadata?.archived===!0){localStorage.getItem(I.lastOrgSlug())===o&&localStorage.removeItem(I.lastOrgSlug());let S;return t[13]!==a.name?(S=n.jsx(rt,{orgName:a.name}),t[13]=a.name,t[14]=S):S=t[14],S}if(p?.ssoRequired&&!p.authenticated){let S;return t[15]!==a.id||t[16]!==a.name||t[17]!==a.slug||t[18]!==p.domain?(S=n.jsx(at,{orgId:a.id,orgSlug:a.slug,orgName:a.name,domain:p.domain}),t[15]=a.id,t[16]=a.name,t[17]=a.slug,t[18]=p.domain,t[19]=S):S=t[19],S}const g=a.logo??null;let x;t[20]!==a||t[21]!==g?(x={...a,logo:g},t[20]=a,t[21]=g,t[22]=x):x=t[22];let w;t[23]!==a?(w=n.jsx(st,{activeOrg:a}),t[23]=a,t[24]=w):w=t[24];let y,k;t[25]===Symbol.for("react.memo_cache_sentinel")?(k=n.jsx(de,{}),y=n.jsx(Qe,{}),t[25]=y,t[26]=k):(y=t[25],k=t[26]);let v;t[27]!==u?(v=n.jsx(Xe,{open:u,onOpenChange:i}),t[27]=u,t[28]=v):v=t[28];let _;return t[29]!==v||t[30]!==x||t[31]!==w?(_=n.jsxs(ct,{org:x,children:[w,k,y,v]}),t[29]=v,t[30]=x,t[31]=w,t[32]=_):_=t[32],_}function mt(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(ve,{children:n.jsx(ut,{})}),t[0]=e):e=t[0],e}const Ct=Object.freeze(Object.defineProperty({__proto__:null,default:mt,usePanelActions:dt},Symbol.toStringTag,{value:"Module"}));export{O as K,X as R,qe as a,Le as b,Ze as i,ot as r,Ct as s,dt as u};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/registry-layout-B6kU_bv7.js","assets/index-C_m1_Qyy.js","assets/index-Di2g24XJ.css","assets/ArrowNarrowLeft-C0lNfAd-.js","assets/CheckCircle-naAuY0Am.js","assets/Container-BYMVUIOR.js","assets/Settings02-BGX5GQSJ.js","assets/XCircle-D5rCjCCo.js","assets/constants-piR0edM1.js","assets/useInfiniteQuery-D0JT5WrD.js","assets/infiniteQueryObserver-CUomJPae.js","assets/badge-Dci-e_Pw.js","assets/input-DHJ18fY7.js","assets/dropdown-menu-TulqWZOe.js","assets/Check-BIvjG7jh.js","assets/ChevronRight-Djwmm7yx.js","assets/DotsVertical-6XBT76_0.js","assets/table-Cbi2Lt5J.js","assets/toggle-group-D_tMezdr.js","assets/use-view-mode-Bzy-dMu6.js","assets/tooltip-BeTs1OMg.js","assets/FilterLines-xU-m-2To.js","assets/SearchMd-WZzMz_xm.js","assets/dialog-Bg6eRMC4.js","assets/X-CexC7CUQ.js","assets/AlertCircle-CVwjiL5t.js","assets/Upload01-CfhmyOeM.js","assets/alert-dialog-DJnXid5j.js","assets/card-CqaEJI_U.js","assets/Trash01-CHrTm5S-.js","assets/label-jUTi8Oc4.js","assets/select-DAV_VIox.js","assets/ChevronDown-2DdfyPVo.js","assets/ChevronUp-CYign-Xr.js","assets/switch-Bmqleb0M.js","assets/textarea-C035ZOMR.js","assets/RefreshCcw01-CYXiv82D.js","assets/checkbox-DdM7zWwz.js","assets/LinkExternal01-Dn8eWUjC.js","assets/use-copy-DbsD5qK3.js","assets/Key01-CTY2QvpD.js","assets/Plus-Cq_1PqM9.js","assets/Play-qd-MZyD5.js"])))=>i.map(i=>d[i]);
2
- import{e as n,f as c,g as m,j as r,l as f,r as l,_ as u}from"./index-C_m1_Qyy.js";const _=l.lazy(()=>u(()=>import("./registry-layout-B6kU_bv7.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])));function x(){const e=n.c(5),o=c();let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={from:"/shell/$org"},e[0]=t):t=e[0];const{org:i}=m(t);let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=r.jsx("div",{className:"h-full flex items-center justify-center",children:r.jsx(f,{size:20,className:"animate-spin text-muted-foreground"})}),e[1]=s):s=e[1];let a;return e[2]!==o||e[3]!==i?(a=r.jsx(l.Suspense,{fallback:s,children:r.jsx(_,{onBack:()=>o({to:"/$org/settings/store",params:{org:i}})})}),e[2]=o,e[3]=i,e[4]=a):a=e[4],a}export{x as default};
@@ -1 +0,0 @@
1
- import{e as c,c as E,j as l,r as m,aA as T,W as S,Y as k}from"./index-C_m1_Qyy.js";import{n as $}from"./ZapSquare-rxLTzaCI.js";import{i as C}from"./ChevronRight-Djwmm7yx.js";function j(s){const e=c.c(14);let t,o,n,r,i;e[0]!==s?({active:t,className:o,ref:r,type:i,...n}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=n,e[4]=r,e[5]=i):(t=e[1],o=e[2],n=e[3],r=e[4],i=e[5]);const f=i===void 0?"button":i,h=t?"bg-sidebar-accent text-sidebar-foreground":"text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground";let u;e[6]!==o||e[7]!==h?(u=E("relative flex size-10 md:size-7 shrink-0 items-center justify-center rounded-md transition-colors","max-md:[&_svg]:size-5","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",h,o),e[6]=o,e[7]=h,e[8]=u):u=e[8];let g;return e[9]!==n||e[10]!==r||e[11]!==u||e[12]!==f?(g=l.jsx("button",{ref:r,type:f,className:u,...n}),e[9]=n,e[10]=r,e[11]=u,e[12]=f,e[13]=g):g=e[13],g}const p=m.createContext(null);function d(){const s=m.use(p);if(!s)throw new Error("Toolbar.* must be used inside <Toolbar>");return s}function v(s){const e=c.c(8),{children:t}=s,[o,n]=m.useState(null),[r,i]=m.useState(null),[f,h]=m.useState(null),[u,g]=m.useState(null);let b;e[0]!==f||e[1]!==u||e[2]!==r||e[3]!==o?(b={togglesEl:o,setTogglesEl:n,tabsEl:r,setTabsEl:i,centerEl:f,setCenterEl:h,rightEl:u,setRightEl:g},e[0]=f,e[1]=u,e[2]=r,e[3]=o,e[4]=b):b=e[4];let x;return e[5]!==t||e[6]!==b?(x=l.jsx(p,{value:b,children:t}),e[5]=t,e[6]=b,e[7]=x):x=e[7],x}function a(s){const e=c.c(2),{children:t}=s;let o;return e[0]!==t?(o=l.jsx(v,{children:l.jsx("div",{className:"flex flex-col h-full min-h-0",children:t})}),e[0]=t,e[1]=o):o=e[1],o}function N(s){const e=c.c(2),{children:t}=s;let o;return e[0]!==t?(o=l.jsx("div",{className:"app-titlebar wco-drag shrink-0 grid grid-cols-3 items-center pl-1 pr-2 pt-0.25 h-12 bg-sidebar",children:t}),e[0]=t,e[1]=o):o=e[1],o}function w(s){const e=c.c(2),{children:t}=s;let o;return e[0]!==t?(o=l.jsx("div",{className:"flex items-center gap-0.5 min-w-0 justify-self-start",children:t}),e[0]=t,e[1]=o):o=e[1],o}function y(s){const e=c.c(2),{children:t}=s;let o;return e[0]!==t?(o=l.jsx("div",{className:"flex items-center justify-end gap-0.5 min-w-0 justify-self-end",children:t}),e[0]=t,e[1]=o):o=e[1],o}function R(){const s=c.c(2);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=l.jsx(j,{onClick:L,"aria-label":"Go back",title:"Go back",children:l.jsx($,{size:16})}),s[0]=e):e=s[0];let t;return s[1]===Symbol.for("react.memo_cache_sentinel")?(t=l.jsxs(l.Fragment,{children:[e,l.jsx(j,{onClick:_,"aria-label":"Go forward",title:"Go forward",children:l.jsx(C,{size:16})})]}),s[1]=t):t=s[1],t}function _(){return window.history.forward()}function L(){return window.history.back()}function z(){const s=c.c(7),t=S().logo??k,o=typeof t=="string"?t:t.light,n=typeof t=="string"?t:t.dark;let r;s[0]!==o?(r=l.jsx("img",{src:o,alt:"Logo",className:"size-6 object-contain dark:hidden"}),s[0]=o,s[1]=r):r=s[1];let i;s[2]!==n?(i=l.jsx("img",{src:n,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),s[2]=n,s[3]=i):i=s[3];let f;return s[4]!==r||s[5]!==i?(f=l.jsxs("span",{className:"wco-hide flex items-center shrink-0 px-2",children:[r,i]}),s[4]=r,s[5]=i,s[6]=f):f=s[6],f}function P(){const s=c.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=l.jsx(m.Suspense,{fallback:l.jsx("span",{className:"wco-hide shrink-0 size-6 mx-2"}),children:l.jsx(z,{})}),s[0]=e):e=s[0],e}function G(){const s=c.c(2),{setCenterEl:e}=d();let t;return s[0]!==e?(t=l.jsx("div",{ref:e,className:"min-w-0 flex items-center justify-center gap-2"}),s[0]=e,s[1]=t):t=s[1],t}function I(s){const e=c.c(3),{children:t}=s,{centerEl:o}=d();if(!o)return null;let n;return e[0]!==o||e[1]!==t?(n=T.createPortal(t,o),e[0]=o,e[1]=t,e[2]=n):n=e[2],n}function A(){const s=c.c(2),{setTabsEl:e}=d();let t;return s[0]!==e?(t=l.jsx("div",{ref:e,className:"shrink-0 flex items-center"}),s[0]=e,s[1]=t):t=s[1],t}function D(s){const e=c.c(3),{children:t}=s,{tabsEl:o}=d();if(!o)return null;let n;return e[0]!==t||e[1]!==o?(n=T.createPortal(t,o),e[0]=t,e[1]=o,e[2]=n):n=e[2],n}function F(){const s=c.c(2),{setTogglesEl:e}=d();let t;return s[0]!==e?(t=l.jsx("div",{ref:e,className:"contents"}),s[0]=e,s[1]=t):t=s[1],t}function H(s){const e=c.c(3),{children:t}=s,{togglesEl:o}=d();if(!o)return null;let n;return e[0]!==t||e[1]!==o?(n=T.createPortal(t,o),e[0]=t,e[1]=o,e[2]=n):n=e[2],n}function O(){const s=c.c(2),{setRightEl:e}=d();let t;return s[0]!==e?(t=l.jsx("div",{ref:e,className:"flex items-center justify-end gap-0.5 shrink-0"}),s[0]=e,s[1]=t):t=s[1],t}function B(s){const e=c.c(3),{children:t}=s,{rightEl:o}=d();if(!o)return null;let n;return e[0]!==t||e[1]!==o?(n=T.createPortal(t,o),e[0]=t,e[1]=o,e[2]=n):n=e[2],n}a.Provider=v;a.Header=N;a.LeftColumn=w;a.RightColumn=y;a.Nav=R;a.Logo=P;a.CenterSlot=G;a.Center=I;a.TabsSlot=A;a.Tabs=D;a.TogglesSlot=F;a.Toggles=H;a.RightSlot=O;a.Right=B;export{j as T,a};
@@ -1 +0,0 @@
1
- import{I as u}from"./infiniteQueryObserver-CUomJPae.js";import{c5 as i}from"./index-C_m1_Qyy.js";function t(e,r){return i(e,u,r)}export{t as u};
@@ -1 +0,0 @@
1
- import{I as s}from"./infiniteQueryObserver-CUomJPae.js";import{c5 as u,c6 as n}from"./index-C_m1_Qyy.js";function a(r,e){return u({...r,enabled:!0,suspense:!0,throwOnError:n},s,e)}export{a as u};
@@ -1 +0,0 @@
1
- import{e as oe,j as t,B as Ce,f as Be,b as ct,q as ze,r as dt,o as Le,D as mt,a as ut,K as Fe,cj as Ke,ck as pt}from"./index-C_m1_Qyy.js";import{u as qe,S as Ve}from"./constants-piR0edM1.js";import{B as ft,g as Me}from"./generate-id-DfUEx9en.js";import{C as Qe}from"./collection-display-button-Bb5eYsxS.js";import{C as ht}from"./collection-search-CZPmAdbz.js";import{C as gt}from"./card-CqaEJI_U.js";import{I as Ge}from"./integration-icon-Bo72bKVV.js";import{D as He,a as Je,b as Ye,c as O}from"./dropdown-menu-TulqWZOe.js";import{s as Xe,a as Ze}from"./RefreshCcw01-CYXiv82D.js";import{i as et}from"./DotsVertical-6XBT76_0.js";import{i as tt}from"./Tool01-CAdd6NGF.js";import{s as st}from"./Trash01-CHrTm5S-.js";import{C as xt}from"./collection-table-wrapper-VrRyg9Ib.js";import{E as Ue}from"./empty-state-ZqctI9xZ.js";import{n as We}from"./Stars02-BgabhO3x.js";import{U as jt}from"./user-D0ZUKhOx.js";import{E as it}from"./empty-state-CKtqz2A5.js";import{u as Ct}from"./use-list-state-C8eifEnv.js";import{g as bt}from"./connection-slug-eyAPH6o3.js";import{f as vt,g as yt,c as Nt,b as wt,d as St,e as Pt,a as _t,A as Dt}from"./alert-dialog-DJnXid5j.js";import{a as It,b as At}from"./use-collections-D_7JW6dX.js";import{a as Tt}from"./use-connection-BbCw9KPq.js";import{s as Et}from"./Plus-Cq_1PqM9.js";import{a as Ot}from"./layout-PcloJcLR.js";import{P as je}from"./index-CKs6rcu1.js";import"./collections-CuEt9akO.js";import"./SwitchHorizontal01-B39nOlBz.js";import"./Check-BIvjG7jh.js";import"./tooltip-BeTs1OMg.js";import"./view-mode-toggle-DPGq5mgK.js";import"./badge-Dci-e_Pw.js";import"./SearchMd-WZzMz_xm.js";import"./Container-BYMVUIOR.js";import"./agent-icon-C3wnlI99.js";import"./AlertCircle-CVwjiL5t.js";import"./ArrowNarrowLeft-C0lNfAd-.js";import"./XCircle-D5rCjCCo.js";import"./ArrowUpRight-BsdiWOZ_.js";import"./ZapSquare-rxLTzaCI.js";import"./Users03-COREII3z.js";import"./CheckCircle-naAuY0Am.js";import"./ChevronDown-2DdfyPVo.js";import"./ChevronRight-Djwmm7yx.js";import"./ChevronUp-CYign-Xr.js";import"./FilterLines-xU-m-2To.js";import"./Star01-TIrOjEGQ.js";import"./Palette-B6NpJZ9F.js";import"./HardDrive-CPUYFXaj.js";import"./Key01-CTY2QvpD.js";import"./LayoutLeft-BA4wxcAF.js";import"./LinkExternal01-Dn8eWUjC.js";import"./Lock01-DzYUukb5.js";import"./Monitor01-nKIM1K_1.js";import"./Sun-BMF5NYnu.js";import"./Play-qd-MZyD5.js";import"./Settings02-BGX5GQSJ.js";import"./Shield01-Dd3PCkCh.js";import"./Upload01-CfhmyOeM.js";import"./User01-CnVuEZ_q.js";import"./Users01-CARILaym.js";import"./XClose-BOJwjK3-.js";import"./X-CexC7CUQ.js";import"./Zap-DRsZpKeC.js";import"./table-Cbi2Lt5J.js";import"./avatar-ByQQ7GEH.js";import"./use-view-mode-Bzy-dMu6.js";import"./sidebar-BFp8v2I0.js";function $t(i,e){const s=i.properties||{};for(const n in s){const c=s[n];if(c&&c.type==="string"&&(c.format==="url"||c.format==="uri")&&e&&typeof e=="object"&&n in e&&e[n])return e[n]}const l=["image","img","avatar","icon","logo","thumbnail","cover"];for(const n of l)if(e&&typeof e=="object"&&n in e&&typeof e[n]=="string")return e[n]}function kt(i){const e=oe.c(25),{item:s,schema:l,actions:n}=i;let c;e[0]!==s||e[1]!==l?(c=$t(l,s),e[0]=s,e[1]=l,e[2]=c):c=e[2];const r=c,p=s&&typeof s=="object"&&"description"in s&&typeof s.description=="string"?s.description:void 0;let d;e[3]!==n?(d=n&&Object.keys(n).length>0,e[3]=n,e[4]=d):d=e[4];const o=d;let u;e[5]!==r||e[6]!==s.title?(u=t.jsx(Ge,{icon:r,name:s.title,size:"md",className:"shrink-0 shadow-sm"}),e[5]=r,e[6]=s.title,e[7]=u):u=e[7];let m;e[8]!==s.title?(m=t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:s.title}),e[8]=s.title,e[9]=m):m=e[9];const f=p||"No description";let a;e[10]!==f?(a=t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:f}),e[10]=f,e[11]=a):a=e[11];let v;e[12]!==m||e[13]!==a?(v=t.jsxs("div",{className:"flex flex-col gap-0 flex-1",children:[m,a]}),e[12]=m,e[13]=a,e[14]=v):v=e[14];let y;e[15]!==u||e[16]!==v?(y=t.jsxs("div",{className:"flex flex-col gap-4 p-6 flex-1",children:[u,v]}),e[15]=u,e[16]=v,e[17]=y):y=e[17];let b;e[18]!==n||e[19]!==o||e[20]!==s?(b=o&&t.jsx("div",{className:"absolute top-6 right-6 sm:opacity-0 sm:group-hover:opacity-100 transition-opacity",onClick:Kt,onMouseDown:Ft,children:t.jsxs(He,{children:[t.jsx(Je,{asChild:!0,children:t.jsx(Ce,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:Lt,children:t.jsx(et,{size:20})})}),t.jsxs(Ye,{align:"end",onClick:zt,children:[n.open&&t.jsxs(O,{onClick:g=>{g.stopPropagation(),n.open?.(s)},children:[t.jsx(Xe,{size:16}),"Open"]}),n.edit&&t.jsxs(O,{onClick:g=>{g.stopPropagation(),n.edit?.(s)},children:[t.jsx(tt,{size:16}),"Edit"]}),n.duplicate&&t.jsxs(O,{onClick:g=>{g.stopPropagation(),n.duplicate?.(s)},children:[t.jsx(Ze,{size:16}),"Duplicate"]}),n.delete&&t.jsxs(O,{variant:"destructive",onClick:g=>{g.stopPropagation(),n.delete?.(s)},children:[t.jsx(st,{size:16}),"Delete"]})]})]})}),e[18]=n,e[19]=o,e[20]=s,e[21]=b):b=e[21];let x;return e[22]!==y||e[23]!==b?(x=t.jsxs(gt,{className:"cursor-pointer transition-colors hover:bg-accent/50 h-full flex flex-col group relative",children:[y,b]}),e[22]=y,e[23]=b,e[24]=x):x=e[24],x}function zt(i){return i.stopPropagation()}function Lt(i){return i.stopPropagation()}function Ft(i){return i.stopPropagation()}function Kt(i){return i.stopPropagation()}const Mt=["icon","avatar","logo"],Re=["created_at","created_by","id"];function Ut(i){return Object.keys(i).find(e=>Mt.includes(e.toLowerCase()))}function ot(i,e){return Object.keys(i.properties||{}).filter(s=>["id","created_at","updated_at","created_by","updated_by"].includes(s)?!1:e?e.includes(s):!0).map(s=>({id:s,label:s.charAt(0).toUpperCase()+s.slice(1).replace(/_/g," ")}))}function Wt(i){const e=oe.c(30),{data:s,schema:l,viewMode:n,search:c,sortKey:r,sortDirection:p,onSort:d,actions:o,onItemClick:u,headerActions:m,emptyState:f,readOnly:a,columns:v,hideToolbar:y,sortableFields:b}=i,x=p===void 0?"asc":p,g=d===void 0?Vt:d;let $;e[0]!==o?($=o===void 0?{}:o,e[0]=o,e[1]=$):$=e[1];const h=$,T=u===void 0?qt:u,E=m===void 0?null:m,N=f===void 0?null:f,k=a===void 0?!1:a,j=v===void 0?void 0:v,z=y===void 0?!1:y,P=b===void 0?void 0:b;let D;e[2]!==j||e[3]!==l||e[4]!==P?(D=j?j.filter(Bt).filter(A=>!P||P.includes(A.id)).map(Rt):ot(l,P),e[2]=j,e[3]=l,e[4]=P,e[5]=D):D=e[5];const w=D;let S;e[6]!==E||e[7]!==z||e[8]!==g||e[9]!==x||e[10]!==r||e[11]!==w?(S=!z&&t.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:t.jsxs("div",{className:"flex items-center gap-3 h-12 px-4",children:[t.jsx("div",{className:"flex items-center gap-2 flex-1",children:E}),t.jsx("div",{className:"flex items-center gap-2 shrink-0",children:t.jsx(Qe,{sortKey:r,sortDirection:x,onSort:g,sortOptions:w})})]})}),e[6]=E,e[7]=z,e[8]=g,e[9]=x,e[10]=r,e[11]=w,e[12]=S):S=e[12];let _;e[13]!==h||e[14]!==j||e[15]!==s||e[16]!==N||e[17]!==T||e[18]!==g||e[19]!==k||e[20]!==l||e[21]!==c||e[22]!==x||e[23]!==r||e[24]!==P||e[25]!==n?(_=n==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:s.length===0?t.jsx("div",{className:"flex items-center justify-center h-full",children:N||t.jsx(Ue,{icon:t.jsx(We,{size:36,className:"text-muted-foreground"}),title:"No items found",description:c?"Try adjusting your search":"No items to display"})}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:s.map(A=>t.jsx("div",{onClick:()=>T?.(A),className:"cursor-pointer h-full",children:t.jsx(kt,{item:A,schema:l,readOnly:k,actions:h})},A.id))})}):t.jsx(xt,{columns:Ht(j,l,P,h),data:s,sortKey:r,sortDirection:x,onSort:g,onRowClick:T,emptyState:N||t.jsx(Ue,{icon:t.jsx(We,{size:36,className:"text-muted-foreground"}),title:"No items found",description:c?"Try adjusting your search":"No items to display"})}),e[13]=h,e[14]=j,e[15]=s,e[16]=N,e[17]=T,e[18]=g,e[19]=k,e[20]=l,e[21]=c,e[22]=x,e[23]=r,e[24]=P,e[25]=n,e[26]=_):_=e[26];let I;return e[27]!==S||e[28]!==_?(I=t.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[S,_]}),e[27]=S,e[28]=_,e[29]=I):I=e[29],I}function Rt(i){return{id:i.id,label:typeof i.header=="string"?i.header:i.id}}function Bt(i){return i.sortable!==!1}function qt(){}function Vt(){}function Qt(i){return{id:"actions",header:"",render:e=>t.jsxs(He,{children:[t.jsx(Je,{asChild:!0,children:t.jsx(Ce,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:t.jsx(et,{size:20})})}),t.jsxs(Ye,{align:"end",onClick:s=>s.stopPropagation(),children:[i.open&&t.jsxs(O,{onClick:s=>{s.stopPropagation(),i.open?.(e)},children:[t.jsx(Xe,{size:16}),"Open"]}),i.edit&&t.jsxs(O,{onClick:s=>{s.stopPropagation(),i.edit?.(e)},children:[t.jsx(tt,{size:16}),"Edit"]}),i.duplicate&&t.jsxs(O,{onClick:s=>{s.stopPropagation(),i.duplicate?.(e)},children:[t.jsx(Ze,{size:16}),"Duplicate"]}),i.delete&&t.jsxs(O,{variant:"destructive",onClick:s=>{s.stopPropagation(),i.delete?.(e)},children:[t.jsx(st,{size:16}),"Delete"]})]})]}),cellClassName:"w-[60px]",sortable:!1}}function nt(i){const e=i.type;return Array.isArray(e)?e.every(s=>nt({type:s})):e==="string"||e==="number"||e==="integer"||e==="boolean"||e==="null"}function Gt(i,e){const s=i.properties||{},l=Object.keys(s).filter(o=>{const u=s[o];return u&&nt(u)}),n=Ut(s),c=[],r=new Set;n&&l.includes(n)&&(c.push(n),r.add(n));const p=["title","description","updated_at","updated_by"];for(const o of p)l.includes(o)&&!r.has(o)&&(c.push(o),r.add(o));const d=l.filter(o=>!r.has(o)&&!Re.includes(o)).sort((o,u)=>o.localeCompare(u));for(const o of d)c.push(o),r.add(o);for(const o of Re)l.includes(o)&&!r.has(o)&&(c.push(o),r.add(o));return c.map(o=>{const u=s[o],m=e?e.includes(o):!["id"].includes(o);return o===n?{id:o,header:"",render:f=>{const a=f[o];return t.jsx(Ge,{icon:a,name:f.title,size:"sm",className:"shrink-0 shadow-sm"})},sortable:!1,cellClassName:"w-16 shrink-0",wrap:!0}:o==="description"?{id:o,header:"Description",render:f=>{const a=f[o];return a==null?"—":t.jsx("span",{className:"block truncate max-w-[50ch]",children:String(a)})},sortable:m,cellClassName:"max-w-[50ch]"}:o==="created_by"||o==="updated_by"?{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:f=>{const a=f[o];return a?t.jsx(jt,{id:String(a),size:"xs"}):"—"},sortable:m,cellClassName:"max-w-[250px]"}:u?.format==="date-time"||o.endsWith("_at")?{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:f=>{const a=f[o];return a?t.jsx("span",{className:"block truncate max-w-full",children:new Date(a).toLocaleDateString()}):"—"},sortable:m,cellClassName:"max-w-[200px]"}:{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:f=>{const a=f[o];return a==null?"—":t.jsx("span",{className:"block truncate max-w-full",children:String(a)})},sortable:m,cellClassName:"max-w-[200px]"}})}function Ht(i,e,s,l){const n=i||Gt(e,s);return n.some(p=>p.id==="actions")?n:Object.keys(l).length>0?[...n,Qt(l)]:n}function Jt(i){const e=oe.c(119),{connectionId:s,org:l,activeCollection:n,onItemClick:c}=i,r=n.name,p=n.schema??ft,d=n.hasCreateTool,o=n.hasUpdateTool,u=n.hasDeleteTool,m=Be(),{data:f}=ct.useSession(),a=f?.user?.id||"unknown",v=Tt(s);let y;e[0]!==v||e[1]!==s?(y=v?bt(v):s,e[0]=v,e[1]=s,e[2]=y):y=e[2];const b=y,{org:x}=ze();let g;e[3]!==s||e[4]!==x.id||e[5]!==x.slug?(g={connectionId:s,orgId:x.id,orgSlug:x.slug},e[3]=s,e[4]=x.id,e[5]=x.slug,e[6]=g):g=e[6];const $=qe(g),h=It(s,r,$),T=`${s}-${r}`;let E;e[7]!==l||e[8]!==T?(E={namespace:l,resource:T,defaultSortKey:"updated_at"},e[7]=l,e[8]=T,e[9]=E):E=e[9];const{search:N,searchTerm:k,setSearch:j,viewMode:z,setViewMode:P,sortKey:D,sortDirection:w,handleSort:S}=Ct(E);let _;e[10]!==k||e[11]!==w||e[12]!==D?(_={searchTerm:k,sortKey:D,sortDirection:w},e[10]=k,e[11]=w,e[12]=D,e[13]=_):_=e[13];const I=At(s,r,$,_),A=!d&&!o&&!u;let ne;e[14]!==b||e[15]!==r||e[16]!==m||e[17]!==c||e[18]!==l?(ne=C=>{if(c){c(C);return}m({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:l,appSlug:b,collectionName:r,itemId:C.id}})},e[14]=b,e[15]=r,e[16]=m,e[17]=c,e[18]=l,e[19]=ne):ne=e[19];const L=ne;let re;e[20]!==h.create||e[21]!==a?(re=async C=>{const xe=new Date().toISOString();await h.create.mutateAsync({...C,id:Me("conn"),title:`${C.title} (Copy)`,created_at:xe,updated_at:xe,created_by:a,updated_by:a})},e[20]=h.create,e[21]=a,e[22]=re):re=e[22];const be=re,[F,ve]=dt.useState(null);let le;e[23]===Symbol.for("react.memo_cache_sentinel")?(le=C=>{ve(C)},e[23]=le):le=e[23];const rt=le;let K;e[24]!==L||e[25]!==o?(K=o&&{edit:L},e[24]=L,e[25]=o,e[26]=K):K=e[26];let M;e[27]!==be||e[28]!==d?(M=d&&{duplicate:be},e[27]=be,e[28]=d,e[29]=M):M=e[29];let U;e[30]!==u?(U=u&&{delete:rt},e[30]=u,e[31]=U):U=e[31];let ae;e[32]!==M||e[33]!==U||e[34]!==K?(ae={...K,...M,...U},e[32]=M,e[33]=U,e[34]=K,e[35]=ae):ae=e[35];const ye=ae;let ce;e[36]!==h.delete||e[37]!==F?(ce=async()=>{F&&(await h.delete.mutateAsync(F.id),ve(null))},e[36]=h.delete,e[37]=F,e[38]=ce):ce=e[38];const Ne=ce;let de;e[39]!==h.create||e[40]!==b||e[41]!==r||e[42]!==d||e[43]!==m||e[44]!==l||e[45]!==a?(de=async()=>{if(!d){Le.error("Create operation is not available for this collection");return}const C=new Date().toISOString(),xe={id:Me("conn"),title:"New Item",description:"A brief description of the item",created_at:C,updated_at:C,created_by:a,updated_by:a};try{const ke=await h.create.mutateAsync(xe);m({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:l,appSlug:b,collectionName:r,itemId:ke.id}})}catch(ke){console.error("Failed to create item:",ke)}},e[39]=h.create,e[40]=b,e[41]=r,e[42]=d,e[43]=m,e[44]=l,e[45]=a,e[46]=de):de=e[46];const we=de;let me;e[47]!==p?(me=ot(p),e[47]=p,e[48]=me):me=e[48];const Se=me,lt=(I?.length??0)>0,at=d&&!lt&&!N;let ue;e[49]!==h.create||e[50]!==we||e[51]!==d?(ue=d?t.jsxs(Ce,{onClick:we,size:"sm",disabled:h.create.isPending,className:"h-7",children:[t.jsx(Et,{className:"mr-2 h-4 w-4"}),h.create.isPending?"Creating...":"Create"]}):null,e[49]=h.create,e[50]=we,e[51]=d,e[52]=ue):ue=e[52];const pe=ue,Pe=D;let W;e[53]!==S||e[54]!==w||e[55]!==Se||e[56]!==Pe?(W=t.jsx(Ot,{children:t.jsx(Qe,{sortKey:Pe,sortDirection:w,onSort:S,sortOptions:Se})}),e[53]=S,e[54]=w,e[55]=Se,e[56]=Pe,e[57]=W):W=e[57];const _e=`Search ${r}...`;let R;e[58]!==j?(R=C=>{C.key==="Escape"&&(j(""),C.target.blur())},e[58]=j,e[59]=R):R=e[59];let B;e[60]!==N||e[61]!==j||e[62]!==_e||e[63]!==R?(B=t.jsx("div",{className:"flex-1",children:t.jsx(ht,{value:N,onChange:j,placeholder:_e,onKeyDown:R})}),e[60]=N,e[61]=j,e[62]=_e,e[63]=R,e[64]=B):B=e[64];let q;e[65]!==pe||e[66]!==d?(q=d&&t.jsx("div",{className:"pr-3",children:pe}),e[65]=pe,e[66]=d,e[67]=q):q=e[67];let V;e[68]!==B||e[69]!==q?(V=t.jsxs("div",{className:"flex items-center gap-2",children:[B,q]}),e[68]=B,e[69]=q,e[70]=V):V=e[70];let Q;e[71]!==I?(Q=I??[],e[71]=I,e[72]=Q):Q=e[72];const De=D;let G;e[73]!==L?(G=C=>L(C),e[73]=L,e[74]=G):G=e[74];const Ie="No items found",Ae=N?"Try adjusting your search terms":"This collection doesn't have any items yet.",Te=at?pe:void 0;let H;e[75]!==Ie||e[76]!==Ae||e[77]!==Te?(H=t.jsx(it,{image:null,title:Ie,description:Ae,actions:Te}),e[75]=Ie,e[76]=Ae,e[77]=Te,e[78]=H):H=e[78];let J;e[79]!==S||e[80]!==A||e[81]!==ye||e[82]!==p||e[83]!==N||e[84]!==j||e[85]!==P||e[86]!==w||e[87]!==Q||e[88]!==De||e[89]!==G||e[90]!==H||e[91]!==z?(J=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(Wt,{hideToolbar:!0,data:Q,schema:p,viewMode:z,onViewModeChange:P,search:N,onSearchChange:j,sortKey:De,sortDirection:w,onSort:S,actions:ye,onItemClick:G,readOnly:A,emptyState:H})}),e[79]=S,e[80]=A,e[81]=ye,e[82]=p,e[83]=N,e[84]=j,e[85]=P,e[86]=w,e[87]=Q,e[88]=De,e[89]=G,e[90]=H,e[91]=z,e[92]=J):J=e[92];let Y;e[93]!==V||e[94]!==J?(Y=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[V,J]}),e[93]=V,e[94]=J,e[95]=Y):Y=e[95];const Ee=!!F;let fe;e[96]===Symbol.for("react.memo_cache_sentinel")?(fe=C=>{C||ve(null)},e[96]=fe):fe=e[96];let he;e[97]===Symbol.for("react.memo_cache_sentinel")?(he=t.jsx(Nt,{children:"Delete item?"}),e[97]=he):he=e[97];const Oe=F?.title;let X;e[98]!==Oe?(X=t.jsxs(wt,{children:[he,t.jsxs(St,{children:['Are you sure you want to delete "',Oe,'"? This action cannot be undone.']})]}),e[98]=Oe,e[99]=X):X=e[99];let Z;e[100]!==h.delete.isPending?(Z=t.jsx(vt,{disabled:h.delete.isPending,children:"Cancel"}),e[100]=h.delete.isPending,e[101]=Z):Z=e[101];const $e=h.delete.isPending?"Deleting...":"Delete";let ee;e[102]!==h.delete.isPending||e[103]!==Ne||e[104]!==$e?(ee=t.jsx(yt,{onClick:Ne,disabled:h.delete.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:$e}),e[102]=h.delete.isPending,e[103]=Ne,e[104]=$e,e[105]=ee):ee=e[105];let te;e[106]!==Z||e[107]!==ee?(te=t.jsxs(Pt,{children:[Z,ee]}),e[106]=Z,e[107]=ee,e[108]=te):te=e[108];let se;e[109]!==X||e[110]!==te?(se=t.jsxs(_t,{children:[X,te]}),e[109]=X,e[110]=te,e[111]=se):se=e[111];let ie;e[112]!==Ee||e[113]!==se?(ie=t.jsx(Dt,{open:Ee,onOpenChange:fe,children:se}),e[112]=Ee,e[113]=se,e[114]=ie):ie=e[114];let ge;return e[115]!==W||e[116]!==Y||e[117]!==ie?(ge=t.jsxs(t.Fragment,{children:[W,Y,ie]}),e[115]=W,e[116]=Y,e[117]=ie,e[118]=ge):ge=e[118],ge}function Yt(){const i=oe.c(13),{org:e,project:s}=ze(),l=mt();let n;i[0]!==e.id||i[1]!==e.slug?(n={connectionId:Ve,orgId:e.id,orgSlug:e.slug},i[0]=e.id,i[1]=e.slug,i[2]=n):n=i[2];const c=qe(n);let r;i[3]!==c||i[4]!==s?(r=async u=>{const m=s.enabledPlugins??[];if(m.includes(u))return;const f=[...m,u],a=await c.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:s.id,data:{metadata:{enabled_plugins:f}}}});return a.structuredContent??a},i[3]=c,i[4]=s,i[5]=r):r=i[5];let p;i[6]!==e.id||i[7]!==s||i[8]!==l?(p=()=>{l.invalidateQueries({queryKey:Fe.project(e.id,s.slug)}),l.invalidateQueries({queryKey:Fe.projects(e.id)})},i[6]=e.id,i[7]=s,i[8]=l,i[9]=p):p=i[9];let d;return i[10]!==r||i[11]!==p?(d={mutationFn:r,onSuccess:p,onError:Xt},i[10]=r,i[11]=p,i[12]=d):d=i[12],ut(d)}function Xt(i){Le.error("Failed to enable plugin: "+(i instanceof Error?i.message:"Unknown error"))}function Zt(i){const e=oe.c(12),{pluginId:s,title:l,description:n,icon:c}=i,r=Yt();let p;e[0]!==r||e[1]!==s?(p=async()=>{try{await r.mutateAsync(s),Le.success("Plugin enabled!")}catch{}},e[0]=r,e[1]=s,e[2]=p):p=e[2];const d=p,o=c??null,u=r.isPending?"Enabling…":"Enable plugin";let m;e[3]!==r.isPending||e[4]!==d||e[5]!==u?(m=t.jsx(Ce,{onClick:d,disabled:r.isPending,children:u}),e[3]=r.isPending,e[4]=d,e[5]=u,e[6]=m):m=e[6];let f;return e[7]!==n||e[8]!==o||e[9]!==m||e[10]!==l?(f=t.jsx(it,{image:o,title:l,description:n,actions:m}),e[7]=n,e[8]=o,e[9]=m,e[10]=l,e[11]=f):f=e[11],f}const es={name:"WORKFLOW",displayName:"Workflow",hasCreateTool:!0,hasUpdateTool:!0,hasDeleteTool:!0};function hi(){const{project:i,org:e}=ze();if(!(i.enabledPlugins??[]).includes(Ke))return t.jsx(je,{children:t.jsx(je.Content,{children:t.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:t.jsx(Zt,{pluginId:Ke,title:"Enable Workflows",description:"Automate multi-step processes by enabling the Workflows plugin. Once enabled you can create, run, and monitor workflows.",icon:t.jsx("div",{className:"bg-muted p-4 rounded-full",children:t.jsx(pt,{className:"size-8 text-muted-foreground"})})})})})});const n=Be();return t.jsx(je,{children:t.jsx(je.Content,{children:t.jsx(Jt,{connectionId:Ve,org:e.slug,activeCollection:es,onItemClick:c=>n({to:"/$org/settings/workflows/$itemId",params:{org:e.slug,itemId:c.id}})})})})}export{hi as default};
@@ -1 +0,0 @@
1
- import{e as s,g as l,j as o,l as a,E as n,r as c}from"./index-C_m1_Qyy.js";import{a as f}from"./index-Wwb5vGkQ.js";import"./index-DvIjF9DA.js";import"./constants-piR0edM1.js";import"./collections-CuEt9akO.js";import"./index-BDOr2buP.js";import"./use-virtual-mcp-DXij_fSZ.js";import"./use-collections-D_7JW6dX.js";import"./monaco-editor-D-22abDQ.js";import"./select-DAV_VIox.js";import"./tooltip-BeTs1OMg.js";import"./Check-BIvjG7jh.js";import"./ChevronDown-2DdfyPVo.js";import"./ChevronUp-CYign-Xr.js";import"./spinner-DLBC6d93.js";import"./accordion-DEFWqB9v.js";import"./agent-icon-C3wnlI99.js";import"./AlertCircle-CVwjiL5t.js";import"./Tool01-CAdd6NGF.js";import"./Stars02-BgabhO3x.js";import"./SwitchHorizontal01-B39nOlBz.js";import"./RefreshCcw01-CYXiv82D.js";import"./ArrowNarrowLeft-C0lNfAd-.js";import"./XCircle-D5rCjCCo.js";import"./ArrowUpRight-BsdiWOZ_.js";import"./ZapSquare-rxLTzaCI.js";import"./Users03-COREII3z.js";import"./CheckCircle-naAuY0Am.js";import"./ChevronRight-Djwmm7yx.js";import"./DotsVertical-6XBT76_0.js";import"./Container-BYMVUIOR.js";import"./FilterLines-xU-m-2To.js";import"./Star01-TIrOjEGQ.js";import"./Palette-B6NpJZ9F.js";import"./HardDrive-CPUYFXaj.js";import"./Key01-CTY2QvpD.js";import"./LayoutLeft-BA4wxcAF.js";import"./LinkExternal01-Dn8eWUjC.js";import"./Lock01-DzYUukb5.js";import"./Monitor01-nKIM1K_1.js";import"./Sun-BMF5NYnu.js";import"./Play-qd-MZyD5.js";import"./Plus-Cq_1PqM9.js";import"./SearchMd-WZzMz_xm.js";import"./Settings02-BGX5GQSJ.js";import"./Shield01-Dd3PCkCh.js";import"./Trash01-CHrTm5S-.js";import"./Upload01-CfhmyOeM.js";import"./User01-CnVuEZ_q.js";import"./Users01-CARILaym.js";import"./XClose-BOJwjK3-.js";import"./X-CexC7CUQ.js";import"./Zap-DRsZpKeC.js";import"./index-zGvFjFjO.js";import"./badge-Dci-e_Pw.js";import"./view-mode-toggle-DPGq5mgK.js";import"./layout-PcloJcLR.js";import"./index-CKs6rcu1.js";import"./sidebar-BFp8v2I0.js";import"./use-connection-BbCw9KPq.js";import"./use-mcp-tools-Cg4H0QB3.js";import"./dialog-Bg6eRMC4.js";import"./index-B55MEl-c.js";import"./hover-card-CUfoIFQV.js";import"./dropdown-menu-TulqWZOe.js";import"./integration-icon-Bo72bKVV.js";import"./index-Df1UV_SS.js";import"./empty-state-ZqctI9xZ.js";import"./create-sse-subscription-CjI9SUTI.js";import"./input-DHJ18fY7.js";function Dt(){const t=s.c(4);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org/settings/workflows/$itemId"},t[0]=r):r=t[0];const{itemId:e}=l(r);let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(a,{size:32,className:"animate-spin text-muted-foreground"})}),t[1]=i):i=t[1];const p=decodeURIComponent(e);let m;return t[2]!==p?(m=o.jsx(n,{children:o.jsx(c.Suspense,{fallback:i,children:o.jsx(f,{itemId:p})})}),t[2]=p,t[3]=m):m=t[3],m}export{Dt as default};