decocms 4.576.5 → 4.577.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 (503) hide show
  1. package/dist/client/assets/{AlertCircle-C4gtVV8B.js → AlertCircle-BdE1rZoJ.js} +1 -1
  2. package/dist/client/assets/{AreaChart-DoDuLI5t.js → AreaChart-D0m3b7qG.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-DpMV6ZsI.js → ArrowLeft-DIrnwv8l.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-BZtzDI6h.js → ArrowUp-km-Xmh__.js} +1 -1
  5. package/dist/client/assets/BookOpen01-BneB1q9z.js +1 -0
  6. package/dist/client/assets/{CartesianChart-T_ULwjNy.js → CartesianChart-BwsWHEdb.js} +1 -1
  7. package/dist/client/assets/{CategoricalChart-ysoAqy8Y.js → CategoricalChart-Dxo_7xLg.js} +1 -1
  8. package/dist/client/assets/{CheckCircle-DSJM5Ipe.js → CheckCircle-CiBUynzC.js} +1 -1
  9. package/dist/client/assets/{ChevronSelectorVertical-Y1qRZSrs.js → ChevronSelectorVertical-CRWdnYCm.js} +1 -1
  10. package/dist/client/assets/{ChevronUp-DlMNWluH.js → ChevronUp-B7dgqvYM.js} +1 -1
  11. package/dist/client/assets/{CreditCard01-DDsAjKey.js → CreditCard01-CcIddg9s.js} +1 -1
  12. package/dist/client/assets/{Globe04-xh_ZOoQS.js → Globe04-DIBckqos.js} +1 -1
  13. package/dist/client/assets/{Key01-BnxP0_QL.js → Key01-BV5ckBOE.js} +1 -1
  14. package/dist/client/assets/{LinkBroken01-4XuFjBFS.js → LinkBroken01-Mv2kbzSM.js} +1 -1
  15. package/dist/client/assets/{Minus-D8UqNYy4.js → Minus-Bygm9L7w.js} +1 -1
  16. package/dist/client/assets/{Monitor01-CVDkBVET.js → Monitor01-HDGt-WwC.js} +1 -1
  17. package/dist/client/assets/{Play--aCtxlXx.js → Play-DROL2O51.js} +1 -1
  18. package/dist/client/assets/{Plus-DXpzgENj.js → Plus-C-Or0hIv.js} +1 -1
  19. package/dist/client/assets/ReferenceLine-BPmIH9b3.js +1 -0
  20. package/dist/client/assets/{SearchMd-CWmEKOOP.js → SearchMd-D88tiwag.js} +1 -1
  21. package/dist/client/assets/ShoppingBag01-Cdbqpanm.js +1 -0
  22. package/dist/client/assets/{Sun-wXzOhHYv.js → Sun-CgOyXDTW.js} +1 -1
  23. package/dist/client/assets/{SwitchHorizontal01-C42vJfgE.js → SwitchHorizontal01-Dkkqg27i.js} +1 -1
  24. package/dist/client/assets/{Tool01-DB3xqZeL.js → Tool01-D4tVVqAj.js} +1 -1
  25. package/dist/client/assets/{Tooltip-Dz7b9lTi.js → Tooltip-cgLuNyXo.js} +1 -1
  26. package/dist/client/assets/{Trash01-BAWUFhrC.js → Trash01-Cqkcp6ky.js} +1 -1
  27. package/dist/client/assets/{Upload01-CMkGIZuR.js → Upload01-CsOcxm5q.js} +1 -1
  28. package/dist/client/assets/{UserSquare-NNxs0RWc.js → UserSquare-CK-bjijW.js} +1 -1
  29. package/dist/client/assets/{Users01-DIshv_Ib.js → Users01-BpEuprvx.js} +1 -1
  30. package/dist/client/assets/{XClose-E_Sbr7JC.js → XClose-D9taHFI1.js} +1 -1
  31. package/dist/client/assets/{Zap-BFWL2aD-.js → Zap-BhxT34oC.js} +1 -1
  32. package/dist/client/assets/{access-gate-H6si3iA0.js → access-gate-Bbt03qvc.js} +1 -1
  33. package/dist/client/assets/{add-connection-dialog-BCsDq0oB.js → add-connection-dialog-EzR6kkmo.js} +1 -1
  34. package/dist/client/assets/agent-app-xUigIkK8.js +1 -0
  35. package/dist/client/assets/agent-assets-DUoWUOFt.js +1 -0
  36. package/dist/client/assets/agent-automation-Cyb5qsWY.js +20 -0
  37. package/dist/client/assets/agent-automations-HcbM2XMD.js +1 -0
  38. package/dist/client/assets/agent-blog-BLi3oKLw.js +2 -0
  39. package/dist/client/assets/agent-blog-post-DXyE25Wg.js +2 -0
  40. package/dist/client/assets/agent-calendar-D7ih9de1.js +1 -0
  41. package/dist/client/assets/{agent-capabilities-C7nwtlfn.js → agent-capabilities-CrqOfLmC.js} +1 -1
  42. package/dist/client/assets/agent-connect-sources-DtVo8JXM.js +1 -0
  43. package/dist/client/assets/agent-deck-Cs__MOn_.js +1 -0
  44. package/dist/client/assets/agent-e2e-CBM_w3qk.js +1 -0
  45. package/dist/client/assets/agent-experiments-CR3rcuNZ.js +1 -0
  46. package/dist/client/assets/agent-file-DjiNMKB3.js +1 -0
  47. package/dist/client/assets/agent-hosting-C70MC-PA.js +1 -0
  48. package/dist/client/assets/agent-icon-bK3wLPrb.js +1 -0
  49. package/dist/client/assets/agent-library-CeznhRs4.js +1 -0
  50. package/dist/client/assets/agent-library-file-B-Sx2y3P.js +1 -0
  51. package/dist/client/assets/agent-overview-CFue46Ll.js +1 -0
  52. package/dist/client/assets/agent-releases-BlbJtMk9.js +2 -0
  53. package/dist/client/assets/agent-settings-BljPRjiA.js +1 -0
  54. package/dist/client/assets/{agent-site-editor-D7f7n9V8.js → agent-site-editor-BeTpu1p8.js} +9 -9
  55. package/dist/client/assets/agent-site-editor-code-BAiYvGFH.js +2 -0
  56. package/dist/client/assets/agent-site-editor-content-Bl3XwQ5q.js +1 -0
  57. package/dist/client/assets/agent-site-editor-preview-Cys48HaE.js +1 -0
  58. package/dist/client/assets/agent-view-DlR04ups.js +1 -0
  59. package/dist/client/assets/agent-view-guard-CruOWgYs.js +1 -0
  60. package/dist/client/assets/ai-providers-C2yFfgyi.js +1 -0
  61. package/dist/client/assets/{alert-gT8z0xwu.js → alert-jF8tTR34.js} +1 -1
  62. package/dist/client/assets/{analytics-sections-eEEKYoEI.js → analytics-sections-Qo8FMsPn.js} +1 -1
  63. package/dist/client/assets/{api-keys-DQU6MrN9.js → api-keys-15uqAkvj.js} +1 -1
  64. package/dist/client/assets/api-keys-BYU6jhvq.js +1 -0
  65. package/dist/client/assets/app-editor-B4pmL5qY.js +1 -0
  66. package/dist/client/assets/{asset-utils-ClCcVH6C.js → asset-utils-CwQVXoYw.js} +1 -1
  67. package/dist/client/assets/{auth-DzshLgt0.js → auth-YGSVzhUG.js} +1 -1
  68. package/dist/client/assets/{auth-catchall-knKXQdld.js → auth-catchall-hWKWJU80.js} +1 -1
  69. package/dist/client/assets/{auth-entry-CjhDapLF.js → auth-entry-DpL4vu4t.js} +1 -1
  70. package/dist/client/assets/{auth-split-layout-Cs3K7qF9.js → auth-split-layout-BFmr3RnK.js} +1 -1
  71. package/dist/client/assets/{authenticate-and-persist-oauth-DyNu9KE-.js → authenticate-and-persist-oauth-DHgqzdUM.js} +1 -1
  72. package/dist/client/assets/{automation-list-row-BIIymyig.js → automation-list-row-BAeLE453.js} +1 -1
  73. package/dist/client/assets/{automation-runs-BJn2B7cC.js → automation-runs-C7o6atC8.js} +1 -1
  74. package/dist/client/assets/automations-BvOuQD58.js +1 -0
  75. package/dist/client/assets/{badge-FhnYiqmQ.js → badge-D9oJO89f.js} +1 -1
  76. package/dist/client/assets/block-document-Phc0b_hv.js +3 -0
  77. package/dist/client/assets/{blocks-preview-workspace-context-DPP_AgWW.js → blocks-preview-workspace-context-XztheX0p.js} +1 -1
  78. package/dist/client/assets/{blocks-tab-states-DS5PjKyJ.js → blocks-tab-states-CPXZUbSV.js} +1 -1
  79. package/dist/client/assets/blog-preview-url-BlQDNdnl.js +1 -0
  80. package/dist/client/assets/blog-schema-BY4m7Viq.js +1 -0
  81. package/dist/client/assets/blog-source-gate-CiOBhTPt.js +1 -0
  82. package/dist/client/assets/blog-view-gate-CCZFjbaz.js +1 -0
  83. package/dist/client/assets/{buckets-Cm1lK-tx.js → buckets-BkOGaNvk.js} +1 -1
  84. package/dist/client/assets/{build-improve-prompt-doc-CKmcH9eT.js → build-improve-prompt-doc-BvBG7PT7.js} +1 -1
  85. package/dist/client/assets/{calendar-Dj2F2D9c.js → calendar-CNAmcpRM.js} +1 -1
  86. package/dist/client/assets/{capability-load-error-YlZMyLIu.js → capability-load-error-BfsuWu82.js} +1 -1
  87. package/dist/client/assets/category-editor-DfKRUZ0M.js +1 -0
  88. package/dist/client/assets/category-tree-C0ZkCPxc.js +4 -0
  89. package/dist/client/assets/{chart-4euqV-4L.js → chart-CjhZfLhJ.js} +1 -1
  90. package/dist/client/assets/chat-context-BXBBnsXM.js +39 -0
  91. package/dist/client/assets/{chat-draft-B1Q_ptQ-.js → chat-draft-BiNhHFHP.js} +1 -1
  92. package/dist/client/assets/{checkbox-Bq5cgSkE.js → checkbox-BqeIWnOr.js} +1 -1
  93. package/dist/client/assets/choose-editor-C3lPTBrc.js +1 -0
  94. package/dist/client/assets/{cli-auth-success-C9VZDuEf.js → cli-auth-success-DXTy0zTr.js} +1 -1
  95. package/dist/client/assets/{client-icons-x0Kj4XXu.js → client-icons-bVQyh7Ui.js} +1 -1
  96. package/dist/client/assets/cms-settings-editor-BGhvXRA5.js +1 -0
  97. package/dist/client/assets/cms-store-drafts-C_2pJAHv.js +1 -0
  98. package/dist/client/assets/collapsible-M6EMuds1.js +1 -0
  99. package/dist/client/assets/collection-detail-DtpW8ulK.js +1 -0
  100. package/dist/client/assets/{collection-display-button-B9tDNz3Q.js → collection-display-button-CLT_iQ9K.js} +1 -1
  101. package/dist/client/assets/{collection-search-o_TUN55Q.js → collection-search-d8_we7KS.js} +1 -1
  102. package/dist/client/assets/{collection-table-wrapper-CovrSOmj.js → collection-table-wrapper-jjhzHxOC.js} +1 -1
  103. package/dist/client/assets/{collection-tabs-C-HhSJ3V.js → collection-tabs-CDEZauaw.js} +1 -1
  104. package/dist/client/assets/{combobox-N56ErTGA.js → combobox-eXr44O4N.js} +1 -1
  105. package/dist/client/assets/{command-C4A_k1m6.js → command-CL5fBjco.js} +1 -1
  106. package/dist/client/assets/{companion-mcps-section-BIgg4-5f.js → companion-mcps-section-ZhumvGkq.js} +1 -1
  107. package/dist/client/assets/config-DTkH3DlA.js +1 -0
  108. package/dist/client/assets/{connect-CAWALh6X.js → connect-DTRBNGAJ.js} +3 -3
  109. package/dist/client/assets/{connect-layout-BGSvt_fK.js → connect-layout-C9YZDE5a.js} +1 -1
  110. package/dist/client/assets/{connect-source-dialog-zXoRskIf.js → connect-source-dialog-CtNzRZNm.js} +1 -1
  111. package/dist/client/assets/{connection-DWztoPJi.js → connection-DQRUSri4.js} +1 -1
  112. package/dist/client/assets/{connection-card-CWeiT8GU.js → connection-card-DiXDtKCD.js} +1 -1
  113. package/dist/client/assets/connection-detail-A1N-eCPy.js +1 -0
  114. package/dist/client/assets/{connection-form-helpers-DvFcvjHg.js → connection-form-helpers-DbQ-1SYg.js} +1 -1
  115. package/dist/client/assets/{connection-slug-7qrL1eY0.js → connection-slug-eNvNu5ns.js} +1 -1
  116. package/dist/client/assets/connections-F6Cb4hev.js +1 -0
  117. package/dist/client/assets/content-tab-zWTaVHTI.js +19 -0
  118. package/dist/client/assets/context-jjXucCze.js +1 -0
  119. package/dist/client/assets/{context-menu-CzVow7cK.js → context-menu-C8EhSOHZ.js} +1 -1
  120. package/dist/client/assets/{context-shell-A1z9qMT_.js → context-shell-DAsZEr3G.js} +3 -3
  121. package/dist/client/assets/{core.esm-DbuDfvWF.js → core.esm-q-GZRseF.js} +2 -2
  122. package/dist/client/assets/{create-organization-dialog-D6MpLXO5.js → create-organization-dialog-B0fwudcl.js} +1 -1
  123. package/dist/client/assets/delete-copy-DewsXC-x.js +4 -0
  124. package/dist/client/assets/{device-hint-DKfCoj9a.js → device-hint-DOHdIy74.js} +1 -1
  125. package/dist/client/assets/discover-Sgb2XR4X.js +1 -0
  126. package/dist/client/assets/{domain-settings-EcbckpYF.js → domain-settings-CzQKvon-.js} +1 -1
  127. package/dist/client/assets/{drawer-DO5xJQb9.js → drawer-CT21cqiT.js} +1 -1
  128. package/dist/client/assets/{editor-T1DFIh20.js → editor-DSTLBMSV.js} +2 -2
  129. package/dist/client/assets/{editor-classes-XhTpecj4.js → editor-classes-DNgU6VQ_.js} +1 -1
  130. package/dist/client/assets/empty-message-0iKzEZgc.js +15 -0
  131. package/dist/client/assets/{empty-state-DtO_Mv2g.js → empty-state-C7mAM8aV.js} +1 -1
  132. package/dist/client/assets/{empty-state-DPWCLNrd.js → empty-state-De0GyKdS.js} +1 -1
  133. package/dist/client/assets/experiments-tab-choice-DwnKczQ0.js +1 -0
  134. package/dist/client/assets/{extract-connection-data-DBROTNmw.js → extract-connection-data-C9uUQyrf.js} +1 -1
  135. package/dist/client/assets/feature-gate-BekWNhM3.js +1 -0
  136. package/dist/client/assets/{feature-paywall-jPIGYZOc.js → feature-paywall-CzMsGR-v.js} +1 -1
  137. package/dist/client/assets/file-explorer-BA6AotC6.js +2 -0
  138. package/dist/client/assets/{file-preview-D0iM2K-b.js → file-preview-CK5Pkylz.js} +1 -1
  139. package/dist/client/assets/{file-share-button-BsYWO9Hm.js → file-share-button-qjRy5kh1.js} +1 -1
  140. package/dist/client/assets/{file-type-icon-HeI2BZTs.js → file-type-icon-DI74_rhH.js} +1 -1
  141. package/dist/client/assets/{folder-icon-DTWsvVbL.js → folder-icon-RhxrL37z.js} +1 -1
  142. package/dist/client/assets/{form-BTSAyeiz.js → form-czY_WZeB.js} +1 -1
  143. package/dist/client/assets/frame-navigation-D3lcT6PQ.js +1 -0
  144. package/dist/client/assets/general-DyfkLFv0.js +1 -0
  145. package/dist/client/assets/{github-icon-B_en9n_0.js → github-icon-DbvGzNXg.js} +1 -1
  146. package/dist/client/assets/held-block-view-616AHRnA.js +3 -0
  147. package/dist/client/assets/home-CvjGQ8iY.js +1 -0
  148. package/dist/client/assets/{home-overview-BRS8Q3rl.js → home-overview-BspPD0Qy.js} +1 -1
  149. package/dist/client/assets/hosted-reconcile-gX34y3hJ.js +1 -0
  150. package/dist/client/assets/{icon-button-BMTp1-QM.js → icon-button-Bek6uWU8.js} +1 -1
  151. package/dist/client/assets/{index-DVvmeJMJ.js → index-5IFWC0PS.js} +47 -47
  152. package/dist/client/assets/index-BASUN16S.js +4 -0
  153. package/dist/client/assets/{index-laonBzOU.js → index-BFLUunGm.js} +1 -1
  154. package/dist/client/assets/index-BVaQtZpO.js +1 -0
  155. package/dist/client/assets/index-B_hHGrWo.js +1 -0
  156. package/dist/client/assets/{index-DyEEK3cc.js → index-BgGa_gEX.js} +1 -1
  157. package/dist/client/assets/{index-qsOMiawp.js → index-CJqO_lXj.js} +1 -1
  158. package/dist/client/assets/{index-dCHDMdOx.js → index-CLog75-o.js} +1 -1
  159. package/dist/client/assets/{index-CWuPd_va.js → index-CYAg_mZ5.js} +6 -6
  160. package/dist/client/assets/{index-DGy42Noz.js → index-Cb-PI-oM.js} +1 -1
  161. package/dist/client/assets/{index-DFaIOW9N.js → index-Cn4blTB2.js} +2 -2
  162. package/dist/client/assets/{index-DTVEZmhV.js → index-Co1pEKoz.js} +1 -1
  163. package/dist/client/assets/{index-D1ksSwz3.js → index-Cq3k2rBV.js} +1 -1
  164. package/dist/client/assets/index-D6lWWdm-.js +1 -0
  165. package/dist/client/assets/{index-DlxA0Tmo.js → index-DI1WEe1Y.js} +1 -1
  166. package/dist/client/assets/index-DYPWHH-M.css +1 -0
  167. package/dist/client/assets/{index-DlkOiyYS.js → index-ZpYsIOky.js} +2 -2
  168. package/dist/client/assets/{index-DwNl1Km0.js → index-e47kvUTQ.js} +1 -1
  169. package/dist/client/assets/{index-redirect-BEZcO3ft.js → index-redirect-B5LCK4UZ.js} +1 -1
  170. package/dist/client/assets/{infiniteQueryObserver-Depn9DGH.js → infiniteQueryObserver-CgeE9MzI.js} +1 -1
  171. package/dist/client/assets/{infra-billing-BGMskgUq.js → infra-billing-D_NOfbaI.js} +1 -1
  172. package/dist/client/assets/{input-aWrDx9Iy.js → input-1bbcsHzM.js} +3 -3
  173. package/dist/client/assets/{input-D4HN-yNN.js → input-Cof38_0i.js} +1 -1
  174. package/dist/client/assets/{integration-icon-C9OIwyFH.js → integration-icon-ClorKiq5.js} +1 -1
  175. package/dist/client/assets/item-actions-pz3LKYdP.js +1 -0
  176. package/dist/client/assets/{jira-icon-CnIpLe3l.js → jira-icon-CSE5FXRa.js} +1 -1
  177. package/dist/client/assets/{label-DxsI69Ti.js → label-C1myK8cj.js} +1 -1
  178. package/dist/client/assets/{layout-m_pr21sI.js → layout-B4vND3NH.js} +1 -1
  179. package/dist/client/assets/{legacy-admin-welcome-dialog-DIDvLt4b.js → legacy-admin-welcome-dialog-DtBTs-JZ.js} +1 -1
  180. package/dist/client/assets/{legacy-agents-deep-CK9Gbzky.js → legacy-agents-deep-wdUtLgZd.js} +1 -1
  181. package/dist/client/assets/{legacy-main-redirect-Cep_68fb.js → legacy-main-redirect-D0dw61Zg.js} +1 -1
  182. package/dist/client/assets/library-DmRa8bBp.js +1 -0
  183. package/dist/client/assets/{library-tab-Dy0wbynU.js → library-tab-3lHWVZnM.js} +4 -4
  184. package/dist/client/assets/{login-FVvIKUmZ.js → login-OeBuTK5R.js} +1 -1
  185. package/dist/client/assets/{markdown-DY1gkJzE.js → markdown-BhnPL5Bs.js} +1 -1
  186. package/dist/client/assets/{mcp-app-renderer-CbbHrG36.js → mcp-app-renderer-DeImvVKz.js} +1 -1
  187. package/dist/client/assets/{mcp-oauth-B4bma3Oc.js → mcp-oauth-D2St0yzi.js} +1 -1
  188. package/dist/client/assets/{mcp-oauth-Dz6mx5UF.js → mcp-oauth-DAPLorIu.js} +1 -1
  189. package/dist/client/assets/{members-CoNUsoOs.js → members-CRV8r-1W.js} +1 -1
  190. package/dist/client/assets/{memory-CJmsq8GA.js → memory-C08OAgnC.js} +2 -2
  191. package/dist/client/assets/{mock-board-C-Bptu2a.js → mock-board-UupkdDTJ.js} +3 -3
  192. package/dist/client/assets/{monaco-editor-ChRuLOCA.js → monaco-editor-DgmLjwMj.js} +1 -1
  193. package/dist/client/assets/{monitoring-DOIwwqmT.js → monitoring-C2AkJ1E2.js} +2 -2
  194. package/dist/client/assets/{monitoring-stats-row-MlJzIKBz.js → monitoring-stats-row-BkupHr4w.js} +1 -1
  195. package/dist/client/assets/{multi-select-HzpZ3y0m.js → multi-select-D_-o3Z5k.js} +1 -1
  196. package/dist/client/assets/mustache-D-pZ4GVh.js +4 -0
  197. package/dist/client/assets/named-rule-step-BqRLfozU.js +1 -0
  198. package/dist/client/assets/named-rule-view-Cjao8aHC.js +1 -0
  199. package/dist/client/assets/{new-project-dialog-DNs6nXJU.js → new-project-dialog-ly3jlxrO.js} +1 -1
  200. package/dist/client/assets/{oauth-callback-DJ1LZft0.js → oauth-callback-DGsbFvpE.js} +1 -1
  201. package/dist/client/assets/{oauth-callback-ai-provider-DdjujeOM.js → oauth-callback-ai-provider-DH_kBA_S.js} +1 -1
  202. package/dist/client/assets/{oauth-consent-C7arrnjn.js → oauth-consent-DiV1G_a8.js} +1 -1
  203. package/dist/client/assets/{onboarding-DCEuM15Q.js → onboarding-wSysb6DG.js} +1 -1
  204. package/dist/client/assets/openai-conversation-BnmAjQv3.js +3 -0
  205. package/dist/client/assets/{optimistic-project-sidebar-views-Bxu9JyYq.js → optimistic-project-sidebar-views-BddiZzQV.js} +1 -1
  206. package/dist/client/assets/{order-monitor-day-BHRAsIfi.js → order-monitor-day-vJd_rbss.js} +1 -1
  207. package/dist/client/assets/{organization-choice-BLi_jfq-.js → organization-choice-B_C6gRzc.js} +1 -1
  208. package/dist/client/assets/{orgs-B0FFSMlY.js → orgs-Hd1POC7b.js} +1 -1
  209. package/dist/client/assets/{own-accounts-section-BPiQsCnH.js → own-accounts-section-DRAcUJQm.js} +1 -1
  210. package/dist/client/assets/{pair-BefVcuJk.js → pair-DsQEIDjk.js} +7 -7
  211. package/dist/client/assets/parse-sections-DAMeYP46.js +4 -0
  212. package/dist/client/assets/plan-9F8q1LmB.js +1 -0
  213. package/dist/client/assets/{plan-ladder-BIrfRC9w.js → plan-ladder-BVTNP5Xz.js} +1 -1
  214. package/dist/client/assets/{plan-usage-card-9-4sECew.js → plan-usage-card-Du0lOF_J.js} +2 -2
  215. package/dist/client/assets/{popover-DVbSl4_S.js → popover-DP7XfF8t.js} +1 -1
  216. package/dist/client/assets/post-calendar-DDpUGeeB.js +1 -0
  217. package/dist/client/assets/post-editor-DtDeATFH.js +2 -0
  218. package/dist/client/assets/{preview-content-4sXQQAYj.js → preview-content-C5OVyGLr.js} +1 -1
  219. package/dist/client/assets/{preview-dialog-DdT5D37e.js → preview-dialog-DuuWqEir.js} +1 -1
  220. package/dist/client/assets/{preview-panel-08gBYjqh.js → preview-panel-BZ5HJll2.js} +1 -1
  221. package/dist/client/assets/preview-tab-P_107JPX.js +551 -0
  222. package/dist/client/assets/{product-picker-dialog-CK0DishF.js → product-picker-dialog-Dt7DCQ6n.js} +1 -1
  223. package/dist/client/assets/{profile-D-F6LVIp.js → profile-GhJox0Lx.js} +1 -1
  224. package/dist/client/assets/project-app-view-qeUPQ38h.js +1 -0
  225. package/dist/client/assets/project-apps-DfPcY68g.js +1 -0
  226. package/dist/client/assets/{project-icon-BfdBakvS.js → project-icon-B90806PF.js} +1 -1
  227. package/dist/client/assets/{project-index-CIwgcHHa.js → project-index-Do6iewlo.js} +1 -1
  228. package/dist/client/assets/project-reports-CidF3Xyg.js +1 -0
  229. package/dist/client/assets/project-tasks-BYy46ISP.js +1 -0
  230. package/dist/client/assets/projects-CymMldT7.js +1 -0
  231. package/dist/client/assets/{projects-empty-state-CNEfVw65.js → projects-empty-state-BTGd2cv1.js} +1 -1
  232. package/dist/client/assets/{prompts-xdLcYGyB.js → prompts-Cd0qPZsx.js} +1 -1
  233. package/dist/client/assets/record-editor-BH3fKYC8.js +1 -0
  234. package/dist/client/assets/redirect-editor-xZO49sls.js +1 -0
  235. package/dist/client/assets/{reports-BoYTb5US.js → reports-B9pEcRxn.js} +1 -1
  236. package/dist/client/assets/reports-DtEFVn9D.js +1 -0
  237. package/dist/client/assets/reports-onboarding-DxeuhIZr.js +1 -0
  238. package/dist/client/assets/reports-tab-YeP0tPeK.js +2 -0
  239. package/dist/client/assets/repositories-B0Temlg5.js +1 -0
  240. package/dist/client/assets/repositories-YEhOcvb2.js +1 -0
  241. package/dist/client/assets/{repository-binding-DJpVzzIq.js → repository-binding-L4ChVpPs.js} +1 -1
  242. package/dist/client/assets/repository-picker-CCYsOJZQ.js +1 -0
  243. package/dist/client/assets/{require-capability-BpMqCrIS.js → require-capability-Cm5TFoc0.js} +1 -1
  244. package/dist/client/assets/{required-auth-layout-BIQCwVTO.js → required-auth-layout-BUx3f5eg.js} +1 -1
  245. package/dist/client/assets/{reset-password-BKzfgMBU.js → reset-password-DWi7rqRm.js} +1 -1
  246. package/dist/client/assets/{resizable-C9_scy3R.js → resizable-Biivyzu2.js} +1 -1
  247. package/dist/client/assets/resolve-tab-icon-C_X-fR95.js +1 -0
  248. package/dist/client/assets/review-settings-DhlyLgn0.js +1 -0
  249. package/dist/client/assets/role-color-_0YSG8Dj.js +1 -0
  250. package/dist/client/assets/roles-akRjx2S4.js +1 -0
  251. package/dist/client/assets/route-CKHdrn7R.js +1 -0
  252. package/dist/client/assets/route-D1Gpwe4D.js +1 -0
  253. package/dist/client/assets/route-tQ0sT4aI.js +1 -0
  254. package/dist/client/assets/{sandbox-lifecycle-context-_uINbsP3.js → sandbox-lifecycle-context-BJx1JU2-.js} +1 -1
  255. package/dist/client/assets/save-status-T9dswXr1.js +1 -0
  256. package/dist/client/assets/{schema-CzuWRpLl.js → schema-Dc_MkHkp.js} +1 -1
  257. package/dist/client/assets/{schema-ChSE97DN.js → schema-DjfjCUhq.js} +1 -1
  258. package/dist/client/assets/{scroll-area-D1j-ZNOk.js → scroll-area-cgfYHO2J.js} +1 -1
  259. package/dist/client/assets/search-input-CgAhBcAm.js +1 -0
  260. package/dist/client/assets/{search-toggle-BSwOQVMD.js → search-toggle-BvL2EnQl.js} +1 -1
  261. package/dist/client/assets/{secret-picker-zgl1t1WE.js → secret-picker-pXy37N0W.js} +1 -1
  262. package/dist/client/assets/{secrets-Dvs-hzm1.js → secrets-DY2kpTfw.js} +1 -1
  263. package/dist/client/assets/section-array-field-Dqv2uZIX.js +1 -0
  264. package/dist/client/assets/{sections-COYsDPZ3.js → sections-BYpfTFZT.js} +1 -1
  265. package/dist/client/assets/sections-editor-D7uS2U4v.js +1 -0
  266. package/dist/client/assets/{select-CBAbBtbp.js → select-Dj8hBfnd.js} +1 -1
  267. package/dist/client/assets/{select-model-CScqhZ6D.js → select-model-BCp0KUZW.js} +1 -1
  268. package/dist/client/assets/seo-editor-C6gHCSwh.js +1 -0
  269. package/dist/client/assets/{separator-B-2WnIuS.js → separator-CD_4C4Y0.js} +1 -1
  270. package/dist/client/assets/settings-tab-DPVLqmJT.js +1 -0
  271. package/dist/client/assets/{sheet-BSTYuLMa.js → sheet-w42F36Fm.js} +1 -1
  272. package/dist/client/assets/shell-layout-SnEo2Z8s.js +1 -0
  273. package/dist/client/assets/site-draft-actions-X8qdJpR6.js +3 -0
  274. package/dist/client/assets/site-draft-view-DieOLT9Q.js +1 -0
  275. package/dist/client/assets/site-editor-D71enwO7.js +1 -0
  276. package/dist/client/assets/{site-editor-toast-Bz5hIXUq.js → site-editor-toast-CAmfWZOg.js} +1 -1
  277. package/dist/client/assets/skills-BPDMMsh1.js +1 -0
  278. package/dist/client/assets/{slider-B-4p3Nob.js → slider-BUH8Dwgf.js} +1 -1
  279. package/dist/client/assets/{sortable.esm-BMq0DSBR.js → sortable.esm-BwyBVE7G.js} +1 -1
  280. package/dist/client/assets/{sso-D7rzaxll.js → sso-Cf_QJD0l.js} +1 -1
  281. package/dist/client/assets/suggestion-EZp_1C2Z.js +2 -0
  282. package/dist/client/assets/{super-agent-icon-CSXn8PV0.js → super-agent-icon-Cuh3vhpx.js} +1 -1
  283. package/dist/client/assets/{switch-BoeP0_DT.js → switch-CcIiziq_.js} +1 -1
  284. package/dist/client/assets/synced-repos-Cnb_uqs2.js +1 -0
  285. package/dist/client/assets/{tab-icon-glyph-DWwnpbAG.js → tab-icon-glyph-DvOK9lLO.js} +1 -1
  286. package/dist/client/assets/{table-XIxdhyNo.js → table-CX_Xjv5_.js} +1 -1
  287. package/dist/client/assets/{tabs-B314G2il.js → tabs-BVFow_A3.js} +1 -1
  288. package/dist/client/assets/{task-board-D-pfBnAn.js → task-board-DVtARw_U.js} +1 -1
  289. package/dist/client/assets/{task-route-DrEh97G3.js → task-route-Ck3RXNt1.js} +1 -1
  290. package/dist/client/assets/{task-status-B5Pet88z.js → task-status-DFMg9mu2.js} +1 -1
  291. package/dist/client/assets/taskboard-analytics-BUGnnj7V.js +1 -0
  292. package/dist/client/assets/{tasks-D1UDrE84.js → tasks-B3OOn3U2.js} +3 -3
  293. package/dist/client/assets/tasks-DHWz5CTo.js +1 -0
  294. package/dist/client/assets/{textarea-yEyl1P1k.js → textarea-BxqysnAf.js} +1 -1
  295. package/dist/client/assets/thread-analytics-dnNDwV70.js +1 -0
  296. package/dist/client/assets/{thread-intent-BNVTtSHt.js → thread-intent-BujELieJ.js} +6 -6
  297. package/dist/client/assets/thread-route-BAkMWoFr.js +1 -0
  298. package/dist/client/assets/{thread-route-C8VqFbkH.js → thread-route-CG4NoBnV.js} +1 -1
  299. package/dist/client/assets/{thread-sheet-body-BPfgeSL4.js → thread-sheet-body-iPIMT5tX.js} +1 -1
  300. package/dist/client/assets/{time-range-picker-BvmuiVyh.js → time-range-picker-DXMtxhmu.js} +1 -1
  301. package/dist/client/assets/{toggle-group-pyWm-TzL.js → toggle-group-CFCrTuTF.js} +1 -1
  302. package/dist/client/assets/{tool-namespace-CtWbol20.js → tool-namespace-C9gQSjv3.js} +1 -1
  303. package/dist/client/assets/{tool-set-selector-o7QGolVt.js → tool-set-selector-Dpj_1lJt.js} +1 -1
  304. package/dist/client/assets/{toolbar-icon-button-DJE3OEfz.js → toolbar-icon-button-Bk7F5Fex.js} +1 -1
  305. package/dist/client/assets/{tooltip-BVrosRIK.js → tooltip-Bj0ggRLV.js} +1 -1
  306. package/dist/client/assets/{tooltipContext-qYwD6VMh.js → tooltipContext-BSiIa8-6.js} +1 -1
  307. package/dist/client/assets/{track-CeXWn-zt.js → track-uewKzN4A.js} +1 -1
  308. package/dist/client/assets/{types-DDm1cJJv.js → types-BuSDoCm5.js} +3 -3
  309. package/dist/client/assets/{url-slug-W6aFEmJF.js → url-slug-BFZflu8h.js} +1 -1
  310. package/dist/client/assets/{usage-stats-Dhf-DrML.js → usage-stats-FTjlrZsR.js} +2 -2
  311. package/dist/client/assets/{use-ai-providers-Cq3xA9Zt.js → use-ai-providers-hOyNnU7s.js} +1 -1
  312. package/dist/client/assets/use-apply-named-rule-JRuS8Fqz.js +1 -0
  313. package/dist/client/assets/use-ask-in-chat-BkWoc5AG.js +1 -0
  314. package/dist/client/assets/{use-automations-BVThKMGQ.js → use-automations-BW9n1XZu.js} +1 -1
  315. package/dist/client/assets/use-autosave-CFQpxLa7.js +1 -0
  316. package/dist/client/assets/use-blocks-v8-project-B4vRqcEf.js +1 -0
  317. package/dist/client/assets/use-chat-layout-state-Bib3kRoh.js +1 -0
  318. package/dist/client/assets/{use-cms-publish-actions-C7zW1hZf.js → use-cms-publish-actions-BanOYWkB.js} +5 -5
  319. package/dist/client/assets/{use-connect-companion-B9VAml3x.js → use-connect-companion-hxxGTIoI.js} +1 -1
  320. package/dist/client/assets/use-connection-CKudd0UO.js +1 -0
  321. package/dist/client/assets/use-content-sync-DVFphaEf.js +1 -0
  322. package/dist/client/assets/{use-copy-DT5ZzrsX.js → use-copy-s7vshP5o.js} +1 -1
  323. package/dist/client/assets/{use-date-fns-locale-Co74b8Ww.js → use-date-fns-locale-BcLGuFCX.js} +1 -1
  324. package/dist/client/assets/{use-debounced-autosave-4hpLvgm-.js → use-debounced-autosave-DF7xOcC9.js} +1 -1
  325. package/dist/client/assets/{use-debounced-value-jJnqowMI.js → use-debounced-value-B0C48w17.js} +1 -1
  326. package/dist/client/assets/{use-deco-credits-BQqUH0BV.js → use-deco-credits-Cc7w_fUS.js} +1 -1
  327. package/dist/client/assets/use-decopilot-events-Ctfpdj_z.js +1 -0
  328. package/dist/client/assets/use-delete-block-CMQm89VB.js +1 -0
  329. package/dist/client/assets/use-delete-connection-BM0YKMsI.js +1 -0
  330. package/dist/client/assets/{use-deployment-admin-CDyLX01_.js → use-deployment-admin-CJOxofw6.js} +1 -1
  331. package/dist/client/assets/{use-entitlements-u-J4FrTi.js → use-entitlements-BPjzEs4p.js} +1 -1
  332. package/dist/client/assets/use-fast-preview-draft-url-BwHAw0OT.js +1 -0
  333. package/dist/client/assets/{use-file-configs-BbIIeRpu.js → use-file-configs-DA74H1hE.js} +1 -1
  334. package/dist/client/assets/{use-id-selection-CUD8oDcN.js → use-id-selection-CMNzhPoi.js} +1 -1
  335. package/dist/client/assets/{use-inbox-feed-CcPQJJTK.js → use-inbox-feed-C-HQ6EgP.js} +1 -1
  336. package/dist/client/assets/{use-infinite-scroll-CfhQVaOS.js → use-infinite-scroll-M12K1Dpn.js} +1 -1
  337. package/dist/client/assets/{use-join-requests-CkLvGQO2.js → use-join-requests-ntiStw2Q.js} +1 -1
  338. package/dist/client/assets/use-main-panel-tabs-DLlaHA4v.js +1 -0
  339. package/dist/client/assets/{use-mcp-auth-status-KGdhyspi.js → use-mcp-auth-status-B2OMY_Tu.js} +1 -1
  340. package/dist/client/assets/{use-mcp-client-Bh7kEUBS.js → use-mcp-client-D_jTz-1i.js} +10 -10
  341. package/dist/client/assets/{use-mcp-prompts-BvdRcLVu.js → use-mcp-prompts-CFPSpaeI.js} +1 -1
  342. package/dist/client/assets/{use-mcp-tools-BXarw5nj.js → use-mcp-tools-BMGCtRJK.js} +1 -1
  343. package/dist/client/assets/{use-mobile-Dc6kWu8K.js → use-mobile-M7B5YJR_.js} +1 -1
  344. package/dist/client/assets/use-move-blocks-B5DoaBOm.js +1 -0
  345. package/dist/client/assets/use-navigate-to-agent-BoWId4qC.js +1 -0
  346. package/dist/client/assets/use-never-published-8p9ySrBa.js +1 -0
  347. package/dist/client/assets/{use-org-fs-DrGQDt6z.js → use-org-fs-Dpr5-hHp.js} +1 -1
  348. package/dist/client/assets/{use-org-repo-syncs-CJN2n862.js → use-org-repo-syncs-DOKrzBXU.js} +1 -1
  349. package/dist/client/assets/{use-org-sso-3rJKFGHZ.js → use-org-sso-zsNytoCe.js} +1 -1
  350. package/dist/client/assets/{use-organization-settings-Dw2wmQuO.js → use-organization-settings-CIEI8bNF.js} +1 -1
  351. package/dist/client/assets/use-project-native-view-presence-tu_PxC_K.js +1 -0
  352. package/dist/client/assets/use-project-scope-D1EeIJG0.js +1 -0
  353. package/dist/client/assets/use-recent-apps-DSYeKmJU.js +1 -0
  354. package/dist/client/assets/{use-reports-diagnostic-CnV_YMfp.js → use-reports-diagnostic-ChnnkK6V.js} +1 -1
  355. package/dist/client/assets/use-sandbox-events-bxyyBbR-.js +2 -0
  356. package/dist/client/assets/{use-secrets-CYyoVB7k.js → use-secrets-NY7H3OwI.js} +1 -1
  357. package/dist/client/assets/use-section-preview-base-Beu0iQz9.js +1 -0
  358. package/dist/client/assets/{use-sidebar-collapsed-CGsrtxLO.js → use-sidebar-collapsed-D0GS7hdN.js} +1 -1
  359. package/dist/client/assets/{use-tags-D570CleN.js → use-tags-NAzrZ60o.js} +1 -1
  360. package/dist/client/assets/{use-task-board-analytics-DCDiNKaK.js → use-task-board-analytics-DdzuizDS.js} +1 -1
  361. package/dist/client/assets/{use-task-board-events-DUIQmo3-.js → use-task-board-events-iA0mSg2Q.js} +1 -1
  362. package/dist/client/assets/{use-task-board-item-prs-CG0dFrGw.js → use-task-board-item-prs-Dw8_2urj.js} +1 -1
  363. package/dist/client/assets/{use-task-board-items-BB9JhdmM.js → use-task-board-items-DQYVvsFC.js} +1 -1
  364. package/dist/client/assets/{use-task-board-prompts-DTmkMV_c.js → use-task-board-prompts-DaZyR7M-.js} +1 -1
  365. package/dist/client/assets/{use-task-metadata-qW9LtgU4.js → use-task-metadata-c0FPnJ80.js} +1 -1
  366. package/dist/client/assets/{use-thread-outputs-CtFiUcL7.js → use-thread-outputs-nmtU5Zq-.js} +1 -1
  367. package/dist/client/assets/use-view-draft-kind-Cu0aFeKZ.js +1 -0
  368. package/dist/client/assets/{use-voice-input-DyZTYy5g.js → use-voice-input-DPQbRCzt.js} +1 -1
  369. package/dist/client/assets/useInfiniteQuery-CfdlXnOy.js +1 -0
  370. package/dist/client/assets/{useQueries-1XxIGeEN.js → useQueries-BncTnCJs.js} +1 -1
  371. package/dist/client/assets/useSuspenseInfiniteQuery-QQvh5ycV.js +1 -0
  372. package/dist/client/assets/{users-I0fvIaz3.js → users-DnLbGcVd.js} +1 -1
  373. package/dist/client/assets/{utils-Pt7-9-Ev.js → utils-yu1cqe5g.js} +2 -2
  374. package/dist/client/assets/variant-calendar-B9yPwKNQ.js +1 -0
  375. package/dist/client/assets/{variant-matcher-override-BZrGhjnT.js → variant-matcher-override-DUz7pA6N.js} +1 -1
  376. package/dist/client/assets/{view-header-D7Xjp31c.js → view-header-DYVjdF9_.js} +1 -1
  377. package/dist/client/assets/virtual-mcp-B46xFMzN.js +1 -0
  378. package/dist/client/assets/{watch-sse-pool-B9yUO9oy.js → watch-sse-pool-Cgkbp7EA.js} +1 -1
  379. package/dist/client/index.html +2 -2
  380. package/dist/server/server.js +584 -584
  381. package/package.json +1 -1
  382. package/dist/client/assets/ReferenceLine-CyROiAPM.js +0 -1
  383. package/dist/client/assets/ShoppingBag01-ClDrdJV2.js +0 -1
  384. package/dist/client/assets/agent-app-Bl_mPh_t.js +0 -1
  385. package/dist/client/assets/agent-assets-B5UWuXnl.js +0 -1
  386. package/dist/client/assets/agent-automation-C9PBjiVk.js +0 -20
  387. package/dist/client/assets/agent-automations-CMf5dE3K.js +0 -1
  388. package/dist/client/assets/agent-calendar-DfZ4ErN1.js +0 -1
  389. package/dist/client/assets/agent-connect-sources-DwgsD8vQ.js +0 -1
  390. package/dist/client/assets/agent-deck-DjXPR_Nl.js +0 -1
  391. package/dist/client/assets/agent-e2e-BRjoGfW2.js +0 -1
  392. package/dist/client/assets/agent-experiments-CA2mbR8k.js +0 -1
  393. package/dist/client/assets/agent-file-BQdiAqSO.js +0 -1
  394. package/dist/client/assets/agent-hosting-D5KChDQU.js +0 -1
  395. package/dist/client/assets/agent-icon-uDqFfzhf.js +0 -1
  396. package/dist/client/assets/agent-library-2kWug_zO.js +0 -1
  397. package/dist/client/assets/agent-library-file-DtPgl6Sc.js +0 -1
  398. package/dist/client/assets/agent-overview-CXQy1R3G.js +0 -1
  399. package/dist/client/assets/agent-releases-CaysxAFQ.js +0 -2
  400. package/dist/client/assets/agent-settings-Bt8gf0xs.js +0 -1
  401. package/dist/client/assets/agent-site-editor-code-DfcTCTxX.js +0 -2
  402. package/dist/client/assets/agent-site-editor-content-B47YLbhf.js +0 -1
  403. package/dist/client/assets/agent-site-editor-preview-Ci1e5zpi.js +0 -1
  404. package/dist/client/assets/agent-view-FTi4q4vz.js +0 -1
  405. package/dist/client/assets/agent-view-guard-BP5FCFpQ.js +0 -1
  406. package/dist/client/assets/ai-providers-CQ29Z6f1.js +0 -1
  407. package/dist/client/assets/api-keys-h9YcYrMI.js +0 -1
  408. package/dist/client/assets/app-editor-BSqFGCuO.js +0 -1
  409. package/dist/client/assets/automations-Xmpwvi6F.js +0 -1
  410. package/dist/client/assets/autosend-D-UTWUhf.js +0 -1
  411. package/dist/client/assets/block-document-0w5M-3LO.js +0 -3
  412. package/dist/client/assets/blog-schema-CYWT4exY.js +0 -1
  413. package/dist/client/assets/category-editor-BRFXJMj8.js +0 -1
  414. package/dist/client/assets/chat-context-bTdV0PQS.js +0 -39
  415. package/dist/client/assets/choose-editor-CKJ9YUAD.js +0 -1
  416. package/dist/client/assets/cms-settings-editor-Bl0s5YWk.js +0 -1
  417. package/dist/client/assets/cms-store-drafts-B8sdeq2z.js +0 -1
  418. package/dist/client/assets/collapsible-B2pXVUPn.js +0 -1
  419. package/dist/client/assets/collection-detail-D-ELQuvL.js +0 -1
  420. package/dist/client/assets/config-CaohtXWJ.js +0 -1
  421. package/dist/client/assets/connection-detail-CyQt5Knq.js +0 -1
  422. package/dist/client/assets/connections-Dfx8FH4D.js +0 -1
  423. package/dist/client/assets/content-tab-Bd4lKzez.js +0 -25
  424. package/dist/client/assets/context-DkOsTTFI.js +0 -1
  425. package/dist/client/assets/discover-Blhzpr1h.js +0 -1
  426. package/dist/client/assets/experiments-tab-choice-BKIwz3b9.js +0 -1
  427. package/dist/client/assets/feature-gate-B_FyKX76.js +0 -1
  428. package/dist/client/assets/file-explorer-mKoJ95H9.js +0 -2
  429. package/dist/client/assets/general-DQnQVbWU.js +0 -1
  430. package/dist/client/assets/home-CLDIpUPQ.js +0 -1
  431. package/dist/client/assets/hosted-reconcile-C7zHteUc.js +0 -1
  432. package/dist/client/assets/index-CnFz3TOs.js +0 -4
  433. package/dist/client/assets/index-DO-A5xCQ.css +0 -1
  434. package/dist/client/assets/index-DPvgRnv7.js +0 -1
  435. package/dist/client/assets/index-DisDzI9Z.js +0 -1
  436. package/dist/client/assets/index-MBimNXd5.js +0 -1
  437. package/dist/client/assets/library-CYKhZ1Xb.js +0 -1
  438. package/dist/client/assets/mustache-CtUZw69D.js +0 -4
  439. package/dist/client/assets/named-rule-view-CkgbSbSg.js +0 -1
  440. package/dist/client/assets/openai-conversation-D4xjY3_1.js +0 -3
  441. package/dist/client/assets/parse-sections-D2w3wSuP.js +0 -20
  442. package/dist/client/assets/plan-Da6szJuR.js +0 -1
  443. package/dist/client/assets/post-calendar-DEqb8d3G.js +0 -1
  444. package/dist/client/assets/post-editor-B-zzeLVe.js +0 -2
  445. package/dist/client/assets/preview-tab-DBOLhpj4.js +0 -551
  446. package/dist/client/assets/project-app-view-etnu6fhD.js +0 -1
  447. package/dist/client/assets/project-apps-D4MFXbKC.js +0 -1
  448. package/dist/client/assets/project-reports-B9YT4T_3.js +0 -1
  449. package/dist/client/assets/project-tasks-DhwbKHKQ.js +0 -1
  450. package/dist/client/assets/projects-DN5f4v6V.js +0 -1
  451. package/dist/client/assets/record-editor-DtXYbHpV.js +0 -1
  452. package/dist/client/assets/redirect-editor-BGoLXzQs.js +0 -1
  453. package/dist/client/assets/reports-BVe3MPdv.js +0 -1
  454. package/dist/client/assets/reports-onboarding-hafGLqtC.js +0 -1
  455. package/dist/client/assets/reports-tab-BGeZEsTL.js +0 -2
  456. package/dist/client/assets/repositories-B9hLcljS.js +0 -1
  457. package/dist/client/assets/repositories-DMPvx5Vv.js +0 -1
  458. package/dist/client/assets/repository-picker-8FkfYDdf.js +0 -1
  459. package/dist/client/assets/resolve-tab-icon-DO940wY_.js +0 -1
  460. package/dist/client/assets/review-settings-Bj89Yxea.js +0 -1
  461. package/dist/client/assets/role-color-Dy-P6oaY.js +0 -1
  462. package/dist/client/assets/roles-CvbfU6et.js +0 -1
  463. package/dist/client/assets/route-93-1A9vt.js +0 -1
  464. package/dist/client/assets/route-BdH_uLpp.js +0 -1
  465. package/dist/client/assets/route-y8ZhYa0n.js +0 -1
  466. package/dist/client/assets/search-input-Cvdta6ZJ.js +0 -1
  467. package/dist/client/assets/section-array-field-AXi3Vg_u.js +0 -1
  468. package/dist/client/assets/sections-editor-CyIATot1.js +0 -1
  469. package/dist/client/assets/seo-editor-C0rSQsv3.js +0 -1
  470. package/dist/client/assets/settings-tab-DFF8W9c5.js +0 -1
  471. package/dist/client/assets/shell-layout-CU0v0Q3J.js +0 -1
  472. package/dist/client/assets/site-draft-actions-D4mgl3Il.js +0 -3
  473. package/dist/client/assets/site-draft-view-BlOBzJMo.js +0 -1
  474. package/dist/client/assets/site-editor-BoWcMF8-.js +0 -1
  475. package/dist/client/assets/skills-CPsP4uSN.js +0 -1
  476. package/dist/client/assets/suggestion-UmoyYDA6.js +0 -2
  477. package/dist/client/assets/synced-repos-MPQrTxDL.js +0 -1
  478. package/dist/client/assets/taskboard-analytics-BCgYqiKL.js +0 -1
  479. package/dist/client/assets/tasks-D2QsX8U7.js +0 -1
  480. package/dist/client/assets/thread-analytics-DEw5nqD5.js +0 -1
  481. package/dist/client/assets/thread-route-0xQXgTvr.js +0 -1
  482. package/dist/client/assets/use-apply-named-rule-V-RgXu1D.js +0 -1
  483. package/dist/client/assets/use-ask-in-chat-CIVcbye6.js +0 -1
  484. package/dist/client/assets/use-autosave-CCiDACSS.js +0 -1
  485. package/dist/client/assets/use-blocks-v8-project-Cbqo1QTy.js +0 -1
  486. package/dist/client/assets/use-chat-layout-state-CGYfM8sf.js +0 -1
  487. package/dist/client/assets/use-connection-DnLlCwu6.js +0 -1
  488. package/dist/client/assets/use-content-sync-D9eluVVW.js +0 -1
  489. package/dist/client/assets/use-decopilot-events-B2tjImS_.js +0 -1
  490. package/dist/client/assets/use-delete-connection-DpEMQiOo.js +0 -1
  491. package/dist/client/assets/use-fast-preview-draft-url-BxKgK3r2.js +0 -1
  492. package/dist/client/assets/use-main-panel-tabs-DyYS88nS.js +0 -1
  493. package/dist/client/assets/use-move-blocks-D35xWi_f.js +0 -1
  494. package/dist/client/assets/use-navigate-to-agent-BNznjjAZ.js +0 -1
  495. package/dist/client/assets/use-project-native-view-presence-BNwJJKFa.js +0 -1
  496. package/dist/client/assets/use-project-scope-BbUTPXSS.js +0 -1
  497. package/dist/client/assets/use-recent-apps-BkGr3MbC.js +0 -1
  498. package/dist/client/assets/use-sandbox-events-C8uDi6Yt.js +0 -2
  499. package/dist/client/assets/use-section-preview-base-DqcwcHAy.js +0 -1
  500. package/dist/client/assets/useInfiniteQuery-BuWYzJlw.js +0 -1
  501. package/dist/client/assets/useSuspenseInfiniteQuery-BofrdpH6.js +0 -1
  502. package/dist/client/assets/variant-calendar-WNfoLO6H.js +0 -1
  503. package/dist/client/assets/virtual-mcp-CSkG36xb.js +0 -1
@@ -1 +0,0 @@
1
- import{c as C,b as J,e as nt,j as o,B as D,t as Z,o as ot,c_ as be,af as qt,a as se,M as Bt,V as Kt,K as Xe,c$ as Ht,d0 as Ut,as as he,m as wt,b8 as bn,C as Pt,r as G,ad as wn,ae as re,d1 as Sn,w as Gt,x as Jt,v as Vt,D as Wt,i as pe,d2 as vn,aq as Yt,d as kt,a4 as Tt,H as jn,T as Qt,E as St,aR as Xt,d3 as kn,aX as Tn,b2 as _t,J as Nn,d4 as Pn,cb as _n,aS as On,y as In,d5 as An,d6 as En,d7 as Cn,d8 as $n,d9 as Ln,a5 as Rn,u as zn,a6 as Dn,da as Mn,db as Fn,l as Zt,dc as Ot,dd as qn,O as Bn,aZ as It,de as Kn,a0 as Hn}from"./index-DVvmeJMJ.js";import{t as en}from"./Globe04-xh_ZOoQS.js";import{i as Un,s as ie}from"./UserSquare-NNxs0RWc.js";import{u as Gn}from"./use-deployment-admin-CDyLX01_.js";import{a as Jn}from"./admin-fetch-BhTJlAsX.js";import{ax as Vn,S as Wn,G as bt,a7 as Yn,I as Qn,ay as Xn,az as Zn,n as At,h as es,aA as ts,m as ns,aB as ss}from"./agent-icon-uDqFfzhf.js";import{s as tn}from"./XClose-E_Sbr7JC.js";import{u as os,a as is}from"./use-project-scope-BbUTPXSS.js";import{u as nn,a as as,A as rs}from"./autosend-D-UTWUhf.js";import{i as ge}from"./CheckCircle-DSJM5Ipe.js";import{i as Et}from"./Monitor01-CVDkBVET.js";import{i as Ye}from"./Zap-BFWL2aD-.js";import{s as Ct}from"./Plus-DXpzgENj.js";import{a as ls}from"./Tool01-DB3xqZeL.js";import{e as Qe,b as ae,d as cs,a as ds,c as us,C as ms}from"./command-C4A_k1m6.js";import{I as fs}from"./integration-icon-C9OIwyFH.js";import{P as gs}from"./project-icon-BfdBakvS.js";import{a as hs}from"./use-navigate-to-agent-BNznjjAZ.js";import{u as ps}from"./use-debounced-value-jJnqowMI.js";import{a as ys,m as xs}from"./use-mcp-client-Bh7kEUBS.js";import{u as bs,a as ws,n as Ss}from"./new-project-dialog-DNs6nXJU.js";import{S as vs,u as js}from"./thread-intent-BNVTtSHt.js";import{L as ks}from"./legacy-admin-welcome-dialog-DIDvLt4b.js";import{R as Ts}from"./required-auth-layout-BIQCwVTO.js";import{u as Ns,a as Ps,b as _s,c as Os}from"./thread-route-C8VqFbkH.js";import{u as Is}from"./use-org-sso-3rJKFGHZ.js";function As(t){const e=C.c(49),{orgName:s,orgSlug:a,orgLogo:n,domain:r}=t,i=J();let l;e[0]!==a||e[1]!==i?(l=async()=>{const O=await fetch("/api/auth/custom/domain-join",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationSlug:a})}),A=await O.json();if(!O.ok||!A.success)throw new Error(A.error??i("common.autoDomainJoinScreen.joinError"));return A},e[0]=a,e[1]=i,e[2]=l):l=e[2];let d;e[3]!==a?(d=O=>{window.location.href=`/${O.slug??a}`},e[3]=a,e[4]=d):d=e[4];let g;e[5]!==i?(g=O=>{Z.error(O instanceof Error?O.message:i("common.autoDomainJoinScreen.joinError"))},e[5]=i,e[6]=g):g=e[6];let h;e[7]!==l||e[8]!==d||e[9]!==g?(h={mutationFn:l,onSuccess:d,onError:g},e[7]=l,e[8]=d,e[9]=g,e[10]=h):h=e[10];const f=nt(h),m=Es;let c;e[11]!==n||e[12]!==s?(c=n?o.jsx(ot,{url:n,fallback:s,shape:"square",size:"base",className:"h-12 w-12"}):o.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:o.jsx(en,{className:"h-6 w-6 text-primary"})}),e[11]=n,e[12]=s,e[13]=c):c=e[13];let y;e[14]!==s||e[15]!==i?(y=i("common.autoDomainJoinScreen.joinPrompt",{orgName:s}),e[14]=s,e[15]=i,e[16]=y):y=e[16];let u;e[17]!==y?(u=o.jsx("h3",{className:"text-lg font-medium",children:y}),e[17]=y,e[18]=u):u=e[18];let p;e[19]!==r||e[20]!==i?(p=i("common.autoDomainJoinScreen.joinDescription",{domain:r}),e[19]=r,e[20]=i,e[21]=p):p=e[21];let S;e[22]!==p?(S=o.jsx("p",{className:"text-sm text-muted-foreground",children:p}),e[22]=p,e[23]=S):S=e[23];let x;e[24]!==u||e[25]!==S?(x=o.jsxs("div",{className:"space-y-2",children:[u,S]}),e[24]=u,e[25]=S,e[26]=x):x=e[26];let b;e[27]!==f?(b=()=>f.mutate(),e[27]=f,e[28]=b):b=e[28];let v;e[29]!==f.isPending||e[30]!==s||e[31]!==i?(v=f.isPending?i("common.autoDomainJoinScreen.joining"):i("common.autoDomainJoinScreen.enterOrg",{orgName:s}),e[29]=f.isPending,e[30]=s,e[31]=i,e[32]=v):v=e[32];let w;e[33]!==f.isPending||e[34]!==b||e[35]!==v?(w=o.jsx(D,{onClick:b,disabled:f.isPending,children:v}),e[33]=f.isPending,e[34]=b,e[35]=v,e[36]=w):w=e[36];const N=f.isPending;let T;e[37]!==i?(T=i("common.goHome"),e[37]=i,e[38]=T):T=e[38];let j;e[39]!==f.isPending||e[40]!==T?(j=o.jsx(D,{variant:"ghost",onClick:m,disabled:N,children:T}),e[39]=f.isPending,e[40]=T,e[41]=j):j=e[41];let P;e[42]!==w||e[43]!==j?(P=o.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[w,j]}),e[42]=w,e[43]=j,e[44]=P):P=e[44];let _;return e[45]!==x||e[46]!==P||e[47]!==c?(_=o.jsxs(be,{children:[c,x,P]}),e[45]=x,e[46]=P,e[47]=c,e[48]=_):_=e[48],_}function Es(){window.location.href="/"}function $t(t){const e=C.c(26),{orgSlug:s,orgId:a,orgName:n,reason:r}=t,i=J(),{isAdmin:l}=Gn(),d=Cs,g=r==="not-found",h=g?Un:qt;let f;e[0]!==g||e[1]!==i?(f=i(g?"common.noAccessScreen.organizationNotFound":"common.noAccessScreen.noAccess"),e[0]=g,e[1]=i,e[2]=f):f=e[2];const m=f;let c;e[3]!==g||e[4]!==n||e[5]!==s||e[6]!==i?(c=g?o.jsxs(o.Fragment,{children:[i("common.noAccessScreen.couldNotFind")," ",o.jsx("strong",{children:s}),"."]}):o.jsxs(o.Fragment,{children:[i("common.noAccessScreen.noAccessTo")," ",o.jsx("strong",{children:n??s}),".",o.jsx("br",{}),i("common.noAccessScreen.askAdminToInvite")]}),e[3]=g,e[4]=n,e[5]=s,e[6]=i,e[7]=c):c=e[7];const y=c;let u;e[8]!==h?(u=o.jsx("div",{className:"bg-muted p-3 rounded-full",children:o.jsx(h,{className:"h-6 w-6 text-muted-foreground"})}),e[8]=h,e[9]=u):u=e[9];let p;e[10]!==m?(p=o.jsx("h3",{className:"text-lg font-medium",children:m}),e[10]=m,e[11]=p):p=e[11];let S;e[12]!==y?(S=o.jsx("p",{className:"text-sm text-muted-foreground",children:y}),e[12]=y,e[13]=S):S=e[13];let x;e[14]!==p||e[15]!==S?(x=o.jsxs("div",{className:"space-y-2",children:[p,S]}),e[14]=p,e[15]=S,e[16]=x):x=e[16];let b;e[17]!==l||e[18]!==a||e[19]!==s||e[20]!==i?(b=l&&a?o.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[o.jsx($s,{orgId:a,orgSlug:s}),o.jsx(D,{variant:"ghost",onClick:d,children:i("common.goHome")})]}):o.jsx(D,{onClick:d,children:i("common.goHome")}),e[17]=l,e[18]=a,e[19]=s,e[20]=i,e[21]=b):b=e[21];let v;return e[22]!==u||e[23]!==x||e[24]!==b?(v=o.jsxs(be,{children:[u,x,b]}),e[22]=u,e[23]=x,e[24]=b,e[25]=v):v=e[25],v}function Cs(){window.location.href="/"}function $s(t){const e=C.c(20),{orgId:s,orgSlug:a}=t,n=J(),{data:r}=se.useSession(),i=r?.user.email;let l;e[0]!==i||e[1]!==s?(l=()=>Jn(`/api/_admin/orgs/${s}/members`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:i,role:"admin"})}),e[0]=i,e[1]=s,e[2]=l):l=e[2];let d;e[3]!==a?(d=()=>{window.location.href=`/${a}`},e[3]=a,e[4]=d):d=e[4];let g;e[5]!==n?(g=p=>{Z.error(p instanceof Error?p.message:n("common.noAccessScreen.adminJoinFailed"))},e[5]=n,e[6]=g):g=e[6];let h;e[7]!==l||e[8]!==d||e[9]!==g?(h={mutationFn:l,onSuccess:d,onError:g},e[7]=l,e[8]=d,e[9]=g,e[10]=h):h=e[10];const f=nt(h);let m;e[11]!==f?(m=()=>f.mutate(),e[11]=f,e[12]=m):m=e[12];const c=!i||f.isPending;let y;e[13]!==f.isPending||e[14]!==n?(y=f.isPending?n("common.noAccessScreen.adminJoining"):n("common.noAccessScreen.adminJoin"),e[13]=f.isPending,e[14]=n,e[15]=y):y=e[15];let u;return e[16]!==m||e[17]!==c||e[18]!==y?(u=o.jsx(D,{onClick:m,disabled:c,children:y}),e[16]=m,e[17]=c,e[18]=y,e[19]=u):u=e[19],u}function Ls(t){const e=C.c(59),{invitationId:s,orgName:a,orgSlug:n,orgLogo:r}=t,i=J();let l;e[0]!==s?(l=async()=>{const I=await se.organization.acceptInvitation({invitationId:s});if(I.error)throw new Error(I.error.message);return I.data},e[0]=s,e[1]=l):l=e[1];let d;e[2]!==n?(d=()=>{Bt(),window.location.href=`/${n}`},e[2]=n,e[3]=d):d=e[3];let g;e[4]!==i?(g=I=>{Z.error(I instanceof Error?I.message:i("common.pendingInviteScreen.failedToAccept"))},e[4]=i,e[5]=g):g=e[5];let h;e[6]!==l||e[7]!==d||e[8]!==g?(h={mutationFn:l,onSuccess:d,onError:g},e[6]=l,e[7]=d,e[8]=g,e[9]=h):h=e[9];const f=nt(h);let m;e[10]!==s?(m=async()=>{const I=await se.organization.rejectInvitation({invitationId:s});if(I.error)throw new Error(I.error.message);return I.data},e[10]=s,e[11]=m):m=e[11];let c,y;e[12]!==i?(c=()=>{Z.success(i("common.pendingInviteScreen.invitationDeclined")),window.location.href="/"},y=I=>{Z.error(I instanceof Error?I.message:i("common.pendingInviteScreen.failedToDecline"))},e[12]=i,e[13]=c,e[14]=y):(c=e[13],y=e[14]);let u;e[15]!==m||e[16]!==c||e[17]!==y?(u={mutationFn:m,onSuccess:c,onError:y},e[15]=m,e[16]=c,e[17]=y,e[18]=u):u=e[18];const p=nt(u),S=f.isPending||p.isPending;let x;e[19]!==r||e[20]!==a?(x=r?o.jsx(ot,{url:r,fallback:a,shape:"square",size:"base",className:"h-12 w-12"}):o.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:o.jsx(Vn,{className:"h-6 w-6 text-primary"})}),e[19]=r,e[20]=a,e[21]=x):x=e[21];let b;e[22]!==a||e[23]!==i?(b=i("common.pendingInviteScreen.invitedTo",{orgName:a}),e[22]=a,e[23]=i,e[24]=b):b=e[24];let v;e[25]!==b?(v=o.jsx("h3",{className:"text-lg font-medium",children:b}),e[25]=b,e[26]=v):v=e[26];let w;e[27]!==i?(w=i("common.pendingInviteScreen.acceptDescription"),e[27]=i,e[28]=w):w=e[28];let N;e[29]!==w?(N=o.jsx("p",{className:"text-sm text-muted-foreground",children:w}),e[29]=w,e[30]=N):N=e[30];let T;e[31]!==v||e[32]!==N?(T=o.jsxs("div",{className:"space-y-2",children:[v,N]}),e[31]=v,e[32]=N,e[33]=T):T=e[33];let j;e[34]!==f?(j=()=>f.mutate(),e[34]=f,e[35]=j):j=e[35];let P;e[36]!==f.isPending||e[37]!==i?(P=f.isPending?i("common.pendingInviteScreen.acceptingButton"):i("common.pendingInviteScreen.acceptButton"),e[36]=f.isPending,e[37]=i,e[38]=P):P=e[38];let _;e[39]!==S||e[40]!==j||e[41]!==P?(_=o.jsx(D,{onClick:j,disabled:S,children:P}),e[39]=S,e[40]=j,e[41]=P,e[42]=_):_=e[42];let O;e[43]!==p?(O=()=>p.mutate(),e[43]=p,e[44]=O):O=e[44];let A;e[45]!==p.isPending||e[46]!==i?(A=p.isPending?i("common.pendingInviteScreen.decliningButton"):i("common.pendingInviteScreen.declineButton"),e[45]=p.isPending,e[46]=i,e[47]=A):A=e[47];let $;e[48]!==S||e[49]!==O||e[50]!==A?($=o.jsx(D,{variant:"ghost",onClick:O,disabled:S,children:A}),e[48]=S,e[49]=O,e[50]=A,e[51]=$):$=e[51];let L;e[52]!==_||e[53]!==$?(L=o.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[_,$]}),e[52]=_,e[53]=$,e[54]=L):L=e[54];let R;return e[55]!==T||e[56]!==L||e[57]!==x?(R=o.jsxs(be,{children:[x,T,L]}),e[55]=T,e[56]=L,e[57]=x,e[58]=R):R=e[58],R}function Rs(t){const e=C.c(23),{orgName:s,orgLogo:a}=t,n=J();let r;e[0]!==a||e[1]!==s?(r=a?o.jsx(ot,{url:a,fallback:s,shape:"square",size:"base",className:"h-12 w-12"}):o.jsx("div",{className:"bg-primary/10 p-3 rounded-full","aria-hidden":"true",children:o.jsx(Wn,{className:"h-6 w-6 text-primary"})}),e[0]=a,e[1]=s,e[2]=r):r=e[2];let i;e[3]!==n?(i=n("common.requestPendingScreen.title"),e[3]=n,e[4]=i):i=e[4];let l;e[5]!==i?(l=o.jsx("h3",{className:"text-lg font-medium",children:i}),e[5]=i,e[6]=l):l=e[6];let d;e[7]!==s||e[8]!==n?(d=n("common.requestPendingScreen.description",{orgName:s}),e[7]=s,e[8]=n,e[9]=d):d=e[9];let g;e[10]!==d?(g=o.jsx("p",{className:"text-sm text-muted-foreground",children:d}),e[10]=d,e[11]=g):g=e[11];let h;e[12]!==l||e[13]!==g?(h=o.jsxs("div",{className:"space-y-2",children:[l,g]}),e[12]=l,e[13]=g,e[14]=h):h=e[14];let f;e[15]!==n?(f=n("common.goHome"),e[15]=n,e[16]=f):f=e[16];let m;e[17]!==f?(m=o.jsx(D,{variant:"ghost",onClick:zs,children:f}),e[17]=f,e[18]=m):m=e[18];let c;return e[19]!==r||e[20]!==h||e[21]!==m?(c=o.jsxs(be,{children:[r,h,m]}),e[19]=r,e[20]=h,e[21]=m,e[22]=c):c=e[22],c}function zs(){window.location.href="/"}function Ds(t){const e=C.c(45),{orgName:s,orgSlug:a,orgLogo:n,domain:r}=t,i=J();let l;e[0]!==a?(l=async()=>{const _=await fetch("/api/auth/custom/domain-request-join",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationSlug:a})}),O=await _.json();if(!_.ok||!O.success)throw new Error(O.error??"Failed to request access");return O},e[0]=a,e[1]=l):l=e[1];let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=Fs,e[2]=d):d=e[2];let g;e[3]!==i?(g=_=>{Z.error(_ instanceof Error?_.message:i("common.requestToJoinScreen.failedToRequest"))},e[3]=i,e[4]=g):g=e[4];let h;e[5]!==l||e[6]!==g?(h={mutationFn:l,onSuccess:d,onError:g},e[5]=l,e[6]=g,e[7]=h):h=e[7];const f=nt(h);let m;e[8]!==n||e[9]!==s?(m=n?o.jsx(ot,{url:n,fallback:s,shape:"square",size:"base",className:"h-12 w-12"}):o.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:o.jsx(en,{className:"h-6 w-6 text-primary"})}),e[8]=n,e[9]=s,e[10]=m):m=e[10];let c;e[11]!==s||e[12]!==i?(c=i("common.requestToJoinScreen.title",{orgName:s}),e[11]=s,e[12]=i,e[13]=c):c=e[13];let y;e[14]!==c?(y=o.jsx("h3",{className:"text-lg font-medium",children:c}),e[14]=c,e[15]=y):y=e[15];let u;e[16]!==r||e[17]!==i?(u=i("common.requestToJoinScreen.description",{domain:r}),e[16]=r,e[17]=i,e[18]=u):u=e[18];let p;e[19]!==u?(p=o.jsx("p",{className:"text-sm text-muted-foreground",children:u}),e[19]=u,e[20]=p):p=e[20];let S;e[21]!==y||e[22]!==p?(S=o.jsxs("div",{className:"space-y-2",children:[y,p]}),e[21]=y,e[22]=p,e[23]=S):S=e[23];let x;e[24]!==f?(x=()=>f.mutate(),e[24]=f,e[25]=x):x=e[25];let b;e[26]!==f.isPending||e[27]!==i?(b=f.isPending?i("common.requestToJoinScreen.requesting"):i("common.requestToJoinScreen.requestButton"),e[26]=f.isPending,e[27]=i,e[28]=b):b=e[28];let v;e[29]!==f.isPending||e[30]!==x||e[31]!==b?(v=o.jsx(D,{onClick:x,disabled:f.isPending,children:b}),e[29]=f.isPending,e[30]=x,e[31]=b,e[32]=v):v=e[32];const w=f.isPending;let N;e[33]!==i?(N=i("common.goHome"),e[33]=i,e[34]=N):N=e[34];let T;e[35]!==f.isPending||e[36]!==N?(T=o.jsx(D,{variant:"ghost",onClick:Ms,disabled:w,children:N}),e[35]=f.isPending,e[36]=N,e[37]=T):T=e[37];let j;e[38]!==v||e[39]!==T?(j=o.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[v,T]}),e[38]=v,e[39]=T,e[40]=j):j=e[40];let P;return e[41]!==S||e[42]!==j||e[43]!==m?(P=o.jsxs(be,{children:[m,S,j]}),e[41]=S,e[42]=j,e[43]=m,e[44]=P):P=e[44],P}function Ms(){window.location.href="/"}function Fs(t){if(t.alreadyMember&&t.slug){window.location.href=`/${t.slug}`;return}window.location.reload()}function qs(t){const e=C.c(7);let s;e[0]!==t?(s=Xe.orgAccessStatus(t),e[0]=t,e[1]=s):s=e[1];let a;e[2]!==t?(a=async()=>{const r=await fetch(`/api/auth/custom/org-access-status/${encodeURIComponent(t)}`,{credentials:"include"});if(!r.ok)throw new Error(`org-access-status failed (${r.status})`);return await r.json()},e[2]=t,e[3]=a):a=e[3];let n;return e[4]!==s||e[5]!==a?(n={queryKey:s,queryFn:a,refetchOnWindowFocus:!1},e[4]=s,e[5]=a,e[6]=n):n=e[6],Kt(n)}function Bs({orgSlug:t}){const{data:e}=qs(t);if(e.status!=="member"){const s=Ht()?.org===t;s&&Ut();const a=localStorage.getItem(he.lastOrgSlug())===t;if(a&&localStorage.removeItem(he.lastOrgSlug()),(s||a)&&(e.status==="not-found"||e.status==="no-access"))return window.location.href="/",null}return e.status==="not-found"?o.jsx($t,{orgSlug:t,reason:"not-found"}):e.status==="pending-invite"?o.jsx(Ls,{invitationId:e.invitation.id,orgName:e.organization.name,orgSlug:e.organization.slug,orgLogo:e.organization.logo}):e.status==="auto-domain-join"?o.jsx(As,{orgName:e.organization.name,orgSlug:e.organization.slug,orgLogo:e.organization.logo,domain:e.organization.domain??""}):e.status==="can-request"?o.jsx(Ds,{orgName:e.organization.name,orgSlug:e.organization.slug,orgLogo:e.organization.logo,domain:e.organization.domain??""}):e.status==="request-pending"?o.jsx(Rs,{orgName:e.organization.name,orgLogo:e.organization.logo}):e.status==="member"?(window.location.reload(),null):o.jsx($t,{orgSlug:t,orgId:e.organization.id,orgName:e.organization.name,reason:"no-access"})}function sn(t){const e=C.c(42),{ariaLabel:s,dismissLabel:a,eyebrow:n,title:r,description:i,icon:l,children:d,footerLeading:g,actions:h,onDismiss:f,tone:m}=t,c=m===void 0?"neutral":m,y=g||h;let u;e[0]!==c?(u=c==="system"&&o.jsx("div",{className:"h-0.5 bg-special"}),e[0]=c,e[1]=u):u=e[1];let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx(tn,{size:14}),e[2]=p):p=e[2];let S;e[3]!==a||e[4]!==f?(S=o.jsx(D,{size:"icon-sm",variant:"ghost","aria-label":a,className:"absolute right-2 top-2 z-10 text-muted-foreground",onClick:f,children:p}),e[3]=a,e[4]=f,e[5]=S):S=e[5];const x=l&&"flex items-start gap-3",b=d&&"pb-3";let v;e[6]!==x||e[7]!==b?(v=wt("p-4 pr-11",x,b),e[6]=x,e[7]=b,e[8]=v):v=e[8];let w;e[9]!==l?(w=l&&o.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-special/10 text-special",children:l}),e[9]=l,e[10]=w):w=e[10];let N;e[11]!==n?(N=n&&o.jsx("p",{className:"text-xs text-muted-foreground",children:n}),e[11]=n,e[12]=N):N=e[12];let T;e[13]!==r?(T=o.jsx("h3",{className:"text-base font-semibold text-foreground",children:r}),e[13]=r,e[14]=T):T=e[14];let j;e[15]!==i?(j=i&&o.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:i}),e[15]=i,e[16]=j):j=e[16];let P;e[17]!==T||e[18]!==j||e[19]!==N?(P=o.jsxs("div",{children:[N,T,j]}),e[17]=T,e[18]=j,e[19]=N,e[20]=P):P=e[20];let _;e[21]!==d?(_=d&&o.jsx("div",{className:"mt-3",children:d}),e[21]=d,e[22]=_):_=e[22];let O;e[23]!==P||e[24]!==_?(O=o.jsxs("div",{className:"min-w-0 flex-1",children:[P,_]}),e[23]=P,e[24]=_,e[25]=O):O=e[25];let A;e[26]!==O||e[27]!==v||e[28]!==w?(A=o.jsxs("div",{className:v,children:[w,O]}),e[26]=O,e[27]=v,e[28]=w,e[29]=A):A=e[29];let $;e[30]!==h||e[31]!==g||e[32]!==y||e[33]!==c?($=y&&o.jsxs("div",{className:wt("flex items-center justify-between gap-3 px-4 py-2.5",c==="system"?"border-t border-border bg-muted/50":"pt-0"),children:[o.jsx("div",{className:"min-w-0 text-xs text-muted-foreground",children:g}),o.jsx("div",{className:"flex shrink-0 items-center gap-2",children:h})]}),e[30]=h,e[31]=g,e[32]=y,e[33]=c,e[34]=$):$=e[34];let L;return e[35]!==s||e[36]!==A||e[37]!==$||e[38]!==u||e[39]!==S||e[40]!==c?(L=o.jsxs("div",{role:"dialog","aria-label":s,"data-slot":"announcement-card","data-tone":c,className:"relative w-full overflow-hidden rounded-lg bg-popover shadow-soft animate-in fade-in slide-in-from-bottom-2 duration-300",children:[u,S,A,$]}),e[35]=s,e[36]=A,e[37]=$,e[38]=u,e[39]=S,e[40]=c,e[41]=L):L=e[41],L}const Ks={switcher:"tour-layout-switcher",nav:"tour-layout-nav",tasks:"tour-layout-tasks",projects:"tour-layout-projects",account:"tour-layout-account",recentActivity:"tour-layout-recent-activity",siteEditor:"tour-layout-site-editor",surfaceTabs:"tour-layout-surface-tabs",branchPicker:"tour-layout-branch-picker",automations:"tour-layout-automations",settings:"tour-layout-settings"};function on(t){return`[data-tour="${Ks[t]}"]`}const Hs=[{scope:"shell",anchor:"switcher",titleKey:"layoutTour.switcher.title",descKey:"layoutTour.switcher.description",side:"right"},{scope:"shell",anchor:"nav",titleKey:"layoutTour.nav.title",descKey:"layoutTour.nav.description",side:"right"},{scope:"shell",anchor:"tasks",titleKey:"layoutTour.tasks.title",descKey:"layoutTour.tasks.description",side:"right"},{scope:"project",anchor:"siteEditor",titleKey:"layoutTour.siteEditor.title",descKey:"layoutTour.siteEditor.description",side:"right"},{scope:"project",anchor:"automations",titleKey:"layoutTour.automations.title",descKey:"layoutTour.automations.description",side:"right"},{scope:"shell",anchor:"settings",titleKey:"layoutTour.settings.title",descKey:"layoutTour.settings.description",side:"right"},{scope:"shell",anchor:"projects",titleKey:"layoutTour.projects.title",descKey:"layoutTour.projects.description",side:"right"},{scope:"shell",anchor:"account",titleKey:"layoutTour.account.title",descKey:"layoutTour.account.description",side:"right"},{scope:"siteEditor",anchor:"surfaceTabs",titleKey:"layoutTour.surfaceTabs.title",descKey:"layoutTour.surfaceTabs.description",side:"bottom"},{scope:"siteEditor",anchor:"branchPicker",titleKey:"layoutTour.branchPicker.title",descKey:"layoutTour.branchPicker.description",side:"bottom"},{scope:"orgHome",anchor:"recentActivity",titleKey:"layoutTour.recentActivity.title",descKey:"layoutTour.recentActivity.description",side:"top"}];function Us(t){return Hs.filter(e=>e.scope==="shell"||e.scope==="orgHome"&&t.onOrgHome||e.scope==="project"&&t.inProject||e.scope==="siteEditor"&&t.onSiteEditor)}function Gs(t,e){return Us(e).map(s=>({element:on(s.anchor),popover:{title:t(s.titleKey),description:t(s.descKey),side:s.side,align:"center"}}))}const Js=on("switcher"),Vs=30;function an(t){const e=document.querySelector(t);return e instanceof HTMLElement&&e.offsetParent!==null}function Ws(t,e){return Gs(t,e).filter(s=>typeof s.element=="string"&&an(s.element))}function Ys(t,e){return{showProgress:!0,progressText:t("layoutTour.progress"),nextBtnText:t("layoutTour.next"),prevBtnText:t("layoutTour.prev"),doneBtnText:t("layoutTour.done"),showButtons:["next","previous"],smoothScroll:!0,allowClose:!0,disableActiveInteraction:!0,stagePadding:6,stageRadius:8,waitForElement:0,skipMissingElement:!0,popoverClass:"layout-tour-popover",onPopoverRender:(s,{driver:a})=>{if(s.footerButtons.querySelector(".layout-tour-skip"))return;const n=document.createElement("button");n.type="button",n.className="driver-popover-footer-btn layout-tour-skip",n.textContent=t("layoutTour.skip"),n.addEventListener("click",()=>a.destroy()),s.footerButtons.insertBefore(n,s.footerButtons.firstChild)},onDestroyed:()=>{et=!1},steps:e}}let et=!1;async function Qs(){return(await bn(()=>import("./driver.js-Dj4CfABu.js"),[])).driver}function Xs(t,e){if(et)return;et=!0;let s=0;const a=()=>{if(!an(Js)&&s++<Vs){requestAnimationFrame(a);return}const n=Ws(t,e);if(n.length===0){et=!1;return}Qs().then(r=>{r(Ys(t,n)).drive()}).catch(()=>{et=!1})};a()}function Zs(t){return t!=="off"}function Wi(t){if(!t.hasSource)return[];const e=["site-editor"];return Zs(t.cmsMode)&&e.push("content"),t.runtime==="sandbox"&&e.push("code"),e}function rn(t){return t==="site-editor"||t==="content"||t==="code"||t.startsWith("code:")}function Yi(t){return t.reportsOnly&&!t.onReportAgent&&rn(t.tabId)}const ln=[{id:"new-layout",date:"2026-09-22",eyebrow:"Now Available",title:"New Layout",bullets:[{icon:Et,title:"Unified page headers",body:"Every page now has a clear header with navigation breadcrumbs and actions, making it easy to orient yourself and move around."},{icon:bt,title:"Consistent navigation and controls",body:"Settings and project pages use a predictable sidebar instead of scattered tabs. Buttons, inputs and toolbars share one shape and one height, and the layout adapts to smaller screens."},{icon:Yn,title:"Site editor redesigned",body:"Try the redesigned blocks editor from Profile & Preferences. Blocks share consistent actions, variants appear beside their block in the header, and section selection is searchable."}],cta:{label:"Take a tour",action:"start-tour"}},{id:"unified-workspace-layout",date:"2026-09-01",eyebrow:"Now Available",title:"A new way around Studio",bullets:[{icon:Pt,title:"Unified org switcher",body:"Organizations and agents now share one control at the top of the sidebar. Search it to jump straight to any agent, including ones in your other organizations."},{icon:ie,title:"Your org at a glance",body:"The organization home now opens on the agents your team built and the tasks they are running — no empty board to fill in first."},{icon:Et,title:"Simplified CMS",body:"The CMS opens over the page you are previewing rather than somewhere else, so changing a section never costs you your place."}],cta:{label:"Take the tour",action:"start-tour"}},{id:"codex-gpt-5-6-defaults",date:"2026-07-13",eyebrow:"Now Available",title:"Codex defaults move to GPT-5.6",bullets:[{icon:ie,title:"Sol leads Thinking",body:"Codex Thinking now defaults to `gpt-5.6-sol` for deeper coding and reasoning work."},{icon:ge,title:"Terra balances Smart",body:"The Smart tier now uses `gpt-5.6-terra`, replacing GPT-5.4 as the default balanced Codex model."},{icon:Ye,title:"Luna speeds up Fast",body:"The Fast tier and lightweight Codex title generation now use `gpt-5.6-luna`. Existing threads that reference older GPT-5.4 or GPT-5.5 model IDs remain supported."}]},{id:"claude-sonnet-5",date:"2026-06-30",eyebrow:"Now Available",title:"Claude Sonnet 5 powers the Smart tier",bullets:[{icon:ie,title:"More agentic coding",body:"Sonnet 5 is Anthropic's strongest Sonnet model yet, with improved reasoning, tool use, coding, and knowledge work compared with Sonnet 4.6."},{icon:ge,title:"Available in Claude Code",body:"The Claude Code harness now pins the Smart tier to the new `claude-sonnet-5` model id so new sessions use Sonnet 5 by default."},{icon:Ye,title:"Nothing to change",body:"Existing Smart-tier chats and agents pick up Sonnet 5 automatically. Thinking remains on Opus 4.8 1M."}],learnMoreHref:"https://www.anthropic.com/news/claude-sonnet-5"},{id:"fable-5-suspension",date:"2026-06-13",eyebrow:"Important Update",title:"Fable 5 & Mythos 5 suspended — Opus 4.8 takes over",bullets:[{icon:ge,title:"US government directive",body:"Anthropic received an export control directive requiring the suspension of Fable 5 and Mythos 5 access for all users, citing national security concerns. Anthropic is complying while it works to resolve the matter."},{icon:ie,title:"Opus 4.8 steps in as the Thinking tier",body:"The Thinking tier now runs on Claude Opus 4.8, which remains fully operational. Performance on most tasks is comparable, and Anthropic reports more than 95% of sessions were unaffected by the Fable 5 classifiers anyway."},{icon:Ye,title:"Nothing to change",body:"The switch is automatic — any chat or agent already using the Thinking tier is now served by Opus 4.8. Anthropic will share further details within 24 hours."}],learnMoreHref:"https://www.anthropic.com/news/fable-mythos-access"},{id:"claude-fable-5",date:"2026-06-09",eyebrow:"Now Available",title:"Claude Fable 5 leads the Thinking tier",bullets:[{icon:ie,title:"State-of-the-art reasoning",body:"Fable 5 takes the Thinking tier, posting top scores across software engineering, knowledge work, and vision — and outperforming Opus 4.8 on nearly every benchmark Anthropic tested."},{icon:ge,title:"Safety without the slowdown",body:"New classifiers route the small slice of high-risk requests (cybersecurity, bio/chem) back to Opus 4.8. Anthropic reports more than 95% of sessions never trigger a fallback."},{icon:Ye,title:"Nothing to change",body:"Chats and agents pick up Fable 5 automatically wherever the Thinking tier is selected. Opus 4.8 stays available as the safety fallback."}],learnMoreHref:"https://www.anthropic.com/news/claude-fable-5-mythos-5"},{id:"claude-opus-4-8",date:"2026-05-28",eyebrow:"Now Available",title:"Claude Opus 4.8 is the new default",bullets:[{icon:ie,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:ge,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:Ye,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:ie,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:bt,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:ge,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:Pt,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:Ye,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:ge,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:ie,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:bt,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:ie,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:Qn,title:"Unified inbox",body:"Org invitations and product updates now share one chronological feed in the sidebar."}]}],yt="studio.release-feed.v1",vt=new Set;let ye="",xe={},jt=!1;function eo(){if(jt)return ye||"{}";try{return localStorage.getItem(yt)??"{}"}catch{return ye||"{}"}}function cn(t){try{const e=JSON.parse(t);return e&&typeof e=="object"?e:{}}catch{return{}}}function Lt(){const t=eo();return t!==ye&&(ye=t,xe=cn(t)),xe}function to(t){vt.add(t);const e=s=>{if(!(s.key!==yt&&s.key!==null)){try{const a=localStorage.getItem(yt)??"{}",r={...cn(a),...xe};xe=r,ye=JSON.stringify(r)}catch{}t()}};return window.addEventListener("storage",e),()=>{vt.delete(t),window.removeEventListener("storage",e)}}function no(t){xe=t,ye=JSON.stringify(t);try{localStorage.setItem(yt,ye),jt=!1}catch{jt=!0}vt.forEach(e=>e())}function so(){const t=C.c(7),e=G.useSyncExternalStore(to,Lt,Lt);let s;t[0]!==e?(s=d=>!!e[d],t[0]=e,t[1]=s):s=t[1];const a=s,n=oo;let r;t[2]!==e?(r=ln.reduce((d,g)=>e[g.id]?d:d+1,0),t[2]=e,t[3]=r):r=t[3];const i=r;let l;return t[4]!==a||t[5]!==i?(l={isSeen:a,markSeen:n,unseenCount:i},t[4]=a,t[5]=i,t[6]=l):l=t[6],l}function oo(t){xe[t]||no({...xe,[t]:{seenAt:new Date().toISOString()}})}const Rt=new Map;function dn(t){let e=Rt.get(t);return e||(e={now:Date.now(),subscribers:new Set,intervalId:null},Rt.set(t,e)),e}function io(t,e){const s=dn(t);return s.subscribers.add(e),s.intervalId===null&&(s.intervalId=setInterval(()=>{s.now=Date.now();for(const a of s.subscribers)a()},t)),()=>{s.subscribers.delete(e),s.subscribers.size===0&&s.intervalId!==null&&(clearInterval(s.intervalId),s.intervalId=null)}}function ao(t){const e=C.c(4),s=t===void 0?6e4:t;let a;e[0]!==s?(a=()=>dn(s).now,e[0]=s,e[1]=a):a=e[1];const n=a;let r;return e[2]!==s?(r=i=>io(s,i),e[2]=s,e[3]=r):r=e[3],G.useSyncExternalStore(r,n,n)}const ro=720*60*60*1e3,lo=10080*60*1e3;function co(t){const[e,s,a]=t.split("-").map(Number);return!e||!s||!a?new Date(t).getTime():new Date(e,s-1,a).getTime()}function uo(t){const e=ln[0];if(!e)return null;const s=co(e.date),a=t-s;return a<0||a>ro?null:e}function mo(t){if(t instanceof Date)return t.getTime();if(typeof t=="string"||typeof t=="number"){const e=new Date(t).getTime();return Number.isFinite(e)?e:null}return null}function fo(t,e){const s=mo(t);return s===null?!1:e-s>=lo}function go(){const t=C.c(46),e=J(),s=os(),a=wn(),n=nn(),r=!!s,i=a===re.home&&!s;let l;t[0]!==n||t[1]!==r?(l=r&&!!n&&rn(n),t[0]=n,t[1]=r,t[2]=l):l=t[2];const d=l,{data:g}=se.useSession(),{isSeen:h,markSeen:f}=so(),m=ao(6e4);let c,y,u;if(t[3]!==h||t[4]!==m||t[5]!==g?.user?.createdAt){u=Symbol.for("react.early_return_sentinel");e:{if(c=uo(m),!c){u=null;break e}if(!fo(g?.user?.createdAt,m)){u=null;break e}y=h(c.id)}t[3]=h,t[4]=m,t[5]=g?.user?.createdAt,t[6]=c,t[7]=y,t[8]=u}else c=t[6],y=t[7],u=t[8];if(u!==Symbol.for("react.early_return_sentinel"))return u;if(y)return null;let p;t[9]!==c.id||t[10]!==r||t[11]!==f||t[12]!==i||t[13]!==d||t[14]!==e?(p=()=>{f(c.id),Xs(e,{onOrgHome:i,inProject:r,onSiteEditor:d})},t[9]=c.id,t[10]=r,t[11]=f,t[12]=i,t[13]=d,t[14]=e,t[15]=p):p=t[15];const S=p;let x;t[16]!==e?(x=e("announcements.release.ariaLabel"),t[16]=e,t[17]=x):x=t[17];let b;t[18]!==e?(b=e("announcements.release.dismiss"),t[18]=e,t[19]=b):b=t[19];const v=c.eyebrow,w=c.title;let N;t[20]!==c.id||t[21]!==f?(N=()=>f(c.id),t[20]=c.id,t[21]=f,t[22]=N):N=t[22];let T;t[23]!==c.id||t[24]!==c.learnMoreHref||t[25]!==f||t[26]!==e?(T=c.learnMoreHref?o.jsx("a",{href:c.learnMoreHref,target:"_blank",rel:"noreferrer",onClick:()=>f(c.id),className:"underline-offset-2 hover:text-foreground hover:underline",children:e("announcements.release.learnMore")}):null,t[23]=c.id,t[24]=c.learnMoreHref,t[25]=f,t[26]=e,t[27]=T):T=t[27];let j;t[28]!==c.cta||t[29]!==c.id||t[30]!==f||t[31]!==S?(j=c.cta?"href"in c.cta?o.jsx(D,{asChild:!0,size:"sm",onClick:()=>f(c.id),children:o.jsx("a",{href:c.cta.href,children:c.cta.label})}):o.jsx(D,{size:"sm",onClick:S,children:c.cta.label}):null,t[28]=c.cta,t[29]=c.id,t[30]=f,t[31]=S,t[32]=j):j=t[32];let P;t[33]!==c.bullets?(P=c.bullets.map(ho),t[33]=c.bullets,t[34]=P):P=t[34];let _;t[35]!==P?(_=o.jsx("ul",{className:"flex flex-col gap-3",children:P}),t[35]=P,t[36]=_):_=t[36];let O;return t[37]!==c.eyebrow||t[38]!==c.title||t[39]!==j||t[40]!==_||t[41]!==x||t[42]!==b||t[43]!==N||t[44]!==T?(O=o.jsx(sn,{ariaLabel:x,dismissLabel:b,eyebrow:v,title:w,onDismiss:N,footerLeading:T,actions:j,children:_}),t[37]=c.eyebrow,t[38]=c.title,t[39]=j,t[40]=_,t[41]=x,t[42]=b,t[43]=N,t[44]=T,t[45]=O):O=t[45],O}function ho(t,e){return o.jsxs("li",{className:"flex items-start gap-3",children:[o.jsx(t.icon,{size:20,className:"mt-0.5 shrink-0 text-muted-foreground"}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:t.title}),o.jsx("p",{className:"text-xs text-muted-foreground",children:t.body})]})]},e)}function po(t){const e=C.c(11),{open:s,onOpenChange:a}=t,n=J();let r;e[0]!==n?(r=n("common.keyboardShortcutsDialog.title"),e[0]=n,e[1]=r):r=e[1];let i;e[2]!==r?(i=o.jsx(Gt,{children:o.jsx(Jt,{children:r})}),e[2]=r,e[3]=i):i=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx("div",{className:"flex flex-col gap-4",children:Sn.map(yo)}),e[4]=l):l=e[4];let d;e[5]!==i?(d=o.jsxs(Vt,{className:"sm:max-w-md",children:[i,l]}),e[5]=i,e[6]=d):d=e[6];let g;return e[7]!==a||e[8]!==s||e[9]!==d?(g=o.jsx(Wt,{open:s,onOpenChange:a,children:d}),e[7]=a,e[8]=s,e[9]=d,e[10]=g):g=e[10],g}function yo(t){return o.jsxs("div",{children:[o.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:t.label}),o.jsx("div",{className:"flex flex-col gap-1.5",children:t.shortcuts.map(xo)})]},t.label)}function xo(t){return o.jsxs("div",{className:"flex items-center justify-between py-1",children:[o.jsx("span",{className:"text-sm",children:t.description}),o.jsx("div",{className:"flex items-center gap-1",children:t.keys.map(bo)})]},t.description)}function bo(t){return o.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)}const wo={xs:"xs",sm:"xs",lg:"md"};function un(t){const e=C.c(4),{org:s,size:a}=t,n=a===void 0?"sm":a,r=s.logo??void 0,i=wo[n];let l;return e[0]!==s.name||e[1]!==r||e[2]!==i?(l=o.jsx(ot,{url:r,fallback:s.name,size:i,tone:"solid"}),e[0]=s.name,e[1]=r,e[2]=i,e[3]=l):l=e[3],l}function Qi({invitation:t,onChanged:e}){const s=J(),[a,n]=G.useState(!1),r=t.organizationName??s("header.orgSwitcher.unknownOrganization"),i=async()=>{n(!0);try{const g=await se.organization.acceptInvitation({invitationId:t.id});if(g.error){Z.error(g.error.message),n(!1);return}}catch{Z.error(s("header.orgSwitcher.failedToAcceptInvitation")),n(!1);return}Z.success(s("header.orgSwitcher.joined",{name:r})),Bt();let d;try{d=(await se.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=d?`/${d}`:"/"},l=async()=>{n(!0);try{const d=await se.organization.rejectInvitation({invitationId:t.id});if(d.error){Z.error(d.error.message),n(!1);return}Z.success(s("header.orgSwitcher.invitationDeclined")),n(!1),e()}catch{Z.error(s("header.orgSwitcher.failedToDeclineInvitation")),n(!1)}};return o.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-dashed border-border px-3 py-2.5",children:[o.jsx(un,{org:{name:r},size:"sm"}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("p",{className:"truncate text-sm font-medium",children:r}),o.jsx("p",{className:"truncate text-xs text-muted-foreground",children:s("header.orgSwitcher.invitedToJoin")})]}),o.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[o.jsx(D,{size:"sm",variant:"default",onClick:i,disabled:a,children:s("header.orgSwitcher.accept")}),o.jsx(D,{size:"icon-sm",variant:"ghost",className:"text-muted-foreground",onClick:l,disabled:a,"aria-label":s("header.orgSwitcher.declineInvitationTo",{name:r}),children:o.jsx(tn,{size:14})})]})]})}function So(t){return typeof t=="object"&&t!==null&&Array.isArray(t.items)}function vo(t){const e=C.c(13),s=t.trim(),{data:a}=se.useSession(),n=a?.user?.id??"",r=s.length>0&&!!n,i=Xe.organizationSearch(n,s);let l;e[0]!==s?(l=async S=>{const{signal:x}=S,b=await fetch(`/api/_me/organizations/search?q=${encodeURIComponent(s)}`,{signal:x});if(!b.ok)throw new Error(`Organization search failed: ${b.status}`);const v=await b.json();if(!So(v))throw new Error("Invalid organization search response");return v},e[0]=s,e[1]=l):l=e[1];let d;e[2]!==r||e[3]!==i||e[4]!==l?(d={queryKey:i,queryFn:l,enabled:r,placeholderData:vn,staleTime:3e4,retry:!1},e[2]=r,e[3]=i,e[4]=l,e[5]=d):d=e[5];const{data:g,isFetching:h,isPlaceholderData:f,isError:m}=pe(d);let c;e[6]!==g?.items?(c=g?.items??[],e[6]=g?.items,e[7]=c):c=e[7];const y=r&&h,u=r&&f;let p;return e[8]!==m||e[9]!==c||e[10]!==y||e[11]!==u?(p={hits:c,isSearching:y,isStale:u,isError:m},e[8]=m,e[9]=c,e[10]=y,e[11]=u,e[12]=p):p=e[12],p}const jo=3,mn=10,ko=440,To=55;function Xi(t){const e=Math.floor((t-ko)/To);return Math.min(mn,Math.max(jo,e))}function No(t,e,s=mn*3,a=[]){return[...new Set([e,...a,...t])].slice(0,s)}function Po(t,e){return!e.id||t.some(s=>s.slug===e.slug)?[...t]:[...t,e]}function Zi(t,e,s,a,n=[]){if(t.length<=a)return{shown:[...t],hidden:[]};const r=new Map(t.map(l=>[l.slug,l])),i=new Set;s&&r.has(s)&&i.add(s);for(const l of n)r.has(l)&&i.add(l);for(const l of e){if(i.size>=a)break;r.has(l)&&i.add(l)}for(const l of t){if(i.size>=a)break;i.add(l.slug)}return{shown:t.filter(l=>i.has(l.slug)),hidden:t.filter(l=>!i.has(l.slug))}}const zt=[];function fn(){const t=C.c(6);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=he.recentOrgs(),t[0]=e):e=t[0];const[s,a]=Yt(e,zt),n=Array.isArray(s)?s:zt;let r;t[1]!==a?(r=(l,d)=>a(g=>No(Array.isArray(g)?g:[],l,void 0,d)),t[1]=a,t[2]=r):r=t[2];let i;return t[3]!==n||t[4]!==r?(i={recent:n,remember:r},t[3]=n,t[4]=r,t[5]=i):i=t[5],i}const gn={hidden:[],pinned:[],order:[]},st=(t,e)=>t.filter(s=>s!==e);function _o(t){if(typeof t!="object"||t===null)return gn;const e=a=>Array.isArray(a)?a.filter(n=>typeof n=="string"):[],s=t;return{hidden:e(s.hidden),pinned:e(s.pinned),order:e(s.order)}}function ea(t,e){return{...t,hidden:[...st(t.hidden,e),e],pinned:st(t.pinned,e)}}function Oo(t,e){return{...t,hidden:st(t.hidden,e)}}function ta(t,e){return t.pinned.includes(e)?{...t,pinned:st(t.pinned,e)}:{...t,hidden:st(t.hidden,e),pinned:[...t.pinned,e]}}function na(t,e,s){const a=n=>{const r=e.order.indexOf(n);return r===-1?Number.MAX_SAFE_INTEGER:r};return t.filter(n=>n.slug===s||!e.hidden.includes(n.slug)).map((n,r)=>({org:n,index:r})).sort((n,r)=>Number(e.pinned.includes(r.org.slug))-Number(e.pinned.includes(n.org.slug))||a(n.org.slug)-a(r.org.slug)||n.index-r.index).map(({org:n})=>n)}function sa(t,e,s,a){const n=e.indexOf(s),r=e.indexOf(a);if(n===-1||r===-1||n===r||t.pinned.includes(s)!==t.pinned.includes(a))return t;const i=[...e];return i.splice(n,1),i.splice(r,0,s),{...t,order:[...i,...t.order.filter(l=>!i.includes(l))]}}function Io(){const t=C.c(5),e=kt(),{remember:s}=fn();let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=he.railOrgPrefs(),t[0]=a):a=t[0];const[,n]=Yt(a,gn);let r;return t[1]!==e||t[2]!==s||t[3]!==n?(r=(i,l)=>{const d=l?.includes(i)??!1;n(g=>Oo(_o(g),i)),s(i,d?l:void 0),e({to:"/$org/home",params:{org:i},viewTransition:!0})},t[1]=e,t[2]=s,t[3]=n,t[4]=r):r=t[4],r}const Dt=8,Ze=["all","organizations","projects","chats","connections","actions"],Ao=5;function Mt(t){switch(t){case"all":return"commandPalette.scope.all";case"organizations":return"commandPalette.organizations";case"projects":return"commandPalette.projects";case"chats":return"commandPalette.scope.chats";case"connections":return"commandPalette.connections";case"actions":return"commandPalette.actions";default:return t}}function Eo(t,e){const s=a=>{const n=e.indexOf(a);return n===-1?Number.POSITIVE_INFINITY:n};return[...t].sort((a,n)=>s(a.slug)-s(n.slug)||a.name.localeCompare(n.name))}function Co(t,e){const{org:s}=Tt(),a=ys({connectionId:Qt,orgId:s.id,orgSlug:s.slug}),{data:n}=pe({queryKey:Xe.globalSearch(s.id,t,Dt),enabled:e&&!!a&&t.trim().length>=2,staleTime:15e3,retry:!1,queryFn:async()=>{if(!a)return[];try{return(await a.callTool({name:"GLOBAL_SEARCH",arguments:{query:t,limit:Dt}})).structuredContent?.items??[]}catch{return[]}}});return n??[]}function $o(t){const e=C.c(213),{open:s,onOpenChange:a}=t,n=J(),r=kt(),{org:i}=Tt(),{projects:l,hasProjects:d}=is(),{remember:g}=hs(i.slug),[h,f]=G.useState(""),[m,c]=G.useState("all");let y;e[0]!==m?(y=M=>m==="all"||m===M,e[0]=m,e[1]=y):y=e[1];const u=y,p=G.useDeferredValue(h),S=Co(p,u("chats")||u("connections")),x=Io(),{data:b}=jn(),{recent:v}=fn();let w;e[2]!==h?(w=h.trim(),e[2]=h,e[3]=w):w=e[3];const N=w,T=ps(N,150),{hits:j}=vo(u("organizations")?T:"");let P,_;if(e[4]!==i||e[5]!==j||e[6]!==b||e[7]!==v){const M=Eo(Po(b??[],i),v);let U;e[10]!==j?(U=new Set(j.map(Do)),e[10]=j,e[11]=U):U=e[11],P=U,_=[...M,...j.filter(Ee=>!M.some(F=>F.id===Ee.id))],e[4]=i,e[5]=j,e[6]=b,e[7]=v,e[8]=P,e[9]=_}else P=e[8],_=e[9];const O=_;let A;e[12]!==O||e[13]!==i.slug||e[14]!==m||e[15]!==N?(A=m==="all"&&!N?O.filter(M=>M.slug!==i.slug).slice(0,Ao):O,e[12]=O,e[13]=i.slug,e[14]=m,e[15]=N,e[16]=A):A=e[16];const $=A;let L;e[17]!==a?(L=()=>{a(!1),f(""),c("all")},e[17]=a,e[18]=L):L=e[18];const R=L;let I;e[19]!==m?(I=M=>{const U=Ze.indexOf(m);c(Ze[(U+M+Ze.length)%Ze.length]??"all")},e[19]=m,e[20]=I):I=e[20];const q=I;let H;e[21]!==R?(H=(M,U)=>{St("command_palette_used",{kind:U}),M(),R()},e[21]=R,e[22]=H):H=e[22];const z=H;let le;e[23]!==r||e[24]!==i.id||e[25]!==i.slug?(le=M=>{if(M.type==="connection"){if(!M.slug){r({to:"/$org/settings/connections",params:{org:i.slug},search:{tab:"all"}});return}r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:M.slug}});return}if(M.type==="task"){r({to:re.tasks,params:{org:i.slug,taskKey:M.key??void 0}});return}const U=Xt(i.id).id;kn(r,Tn({org:i.slug,agentId:M.virtual_mcp_id??U,superAgentId:U}),{search:()=>({thread:M.id}),replace:!1})},e[23]=r,e[24]=i.id,e[25]=i.slug,e[26]=le):le=e[26];const ee=le;let te;e[27]!==h?(te=[h],e[27]=h,e[28]=te):te=e[28];const oe=te;let ne,V,W,K,Y,Q,X,E,B,we,Se,ce,de,ue,me,fe;if(e[29]!==R||e[30]!==q||e[31]!==z||e[32]!==d||e[33]!==S||e[34]!==r||e[35]!==a||e[36]!==s||e[37]!==ee||e[38]!==i.slug||e[39]!==$||e[40]!==l||e[41]!==g||e[42]!==oe||e[43]!==m||e[44]!==P||e[45]!==u||e[46]!==n||e[47]!==h||e[48]!==x){const M=S.filter(zo),U=S.filter(Ro);let Ee;e[65]!==i.slug?(Ee={org:i.slug},e[65]=i.slug,e[66]=Ee):Ee=e[66];const F=Ee;let Ce;e[67]!==n?(Ce=n("sidebar.navDestinations.home"),e[67]=n,e[68]=Ce):Ce=e[68];let dt;e[69]===Symbol.for("react.memo_cache_sentinel")?(dt=o.jsx(es,{"aria-hidden":"true"}),e[69]=dt):dt=e[69];let $e;e[70]!==F||e[71]!==Ce?($e={key:"home",label:Ce,icon:dt,to:re.home,params:F},e[70]=F,e[71]=Ce,e[72]=$e):$e=e[72];let Le;e[73]!==n?(Le=n("sidebar.navDestinations.reports"),e[73]=n,e[74]=Le):Le=e[74];let ut;e[75]===Symbol.for("react.memo_cache_sentinel")?(ut=o.jsx(ts,{"aria-hidden":"true"}),e[75]=ut):ut=e[75];let Re;e[76]!==F||e[77]!==Le?(Re={key:"reports",label:Le,icon:ut,to:re.reports,params:F},e[76]=F,e[77]=Le,e[78]=Re):Re=e[78];let ze;e[79]!==n?(ze=n("sidebar.navDestinations.tasks"),e[79]=n,e[80]=ze):ze=e[80];let mt;e[81]===Symbol.for("react.memo_cache_sentinel")?(mt=o.jsx(At,{"aria-hidden":"true"}),e[81]=mt):mt=e[81];let De;e[82]!==i.slug?(De={org:i.slug,taskKey:void 0},e[82]=i.slug,e[83]=De):De=e[83];let Me;e[84]!==ze||e[85]!==De?(Me={key:"tasks",label:ze,icon:mt,to:re.tasks,params:De},e[84]=ze,e[85]=De,e[86]=Me):Me=e[86];let Fe;e[87]!==n?(Fe=n("sidebar.navDestinations.library"),e[87]=n,e[88]=Fe):Fe=e[88];let ft;e[89]===Symbol.for("react.memo_cache_sentinel")?(ft=o.jsx(ns,{"aria-hidden":"true"}),e[89]=ft):ft=e[89];let qe;e[90]!==F||e[91]!==Fe?(qe={key:"library",label:Fe,icon:ft,to:re.library,params:F},e[90]=F,e[91]=Fe,e[92]=qe):qe=e[92];let Be;e[93]!==n?(Be=n("sidebar.navDestinations.discover"),e[93]=n,e[94]=Be):Be=e[94];let gt;e[95]===Symbol.for("react.memo_cache_sentinel")?(gt=o.jsx(ss,{"aria-hidden":"true"}),e[95]=gt):gt=e[95];let Ke;e[96]!==F||e[97]!==Be?(Ke={key:"discover",label:Be,icon:gt,to:re.discover,params:F},e[96]=F,e[97]=Be,e[98]=Ke):Ke=e[98];let ht;e[99]!==$e||e[100]!==Re||e[101]!==Me||e[102]!==qe||e[103]!==Ke?(ht=[$e,Re,Me,qe,Ke],e[99]=$e,e[100]=Re,e[101]=Me,e[102]=qe,e[103]=Ke,e[104]=ht):ht=e[104];const xt=ht;V=cs,Se=s,e[105]!==R||e[106]!==a?(ce=k=>k?a(!0):R(),e[105]=R,e[106]=a,e[107]=ce):ce=e[107],e[108]!==n?(de=n("commandPalette.title"),e[108]=n,e[109]=de):de=e[109],e[110]!==n?(ue=n("commandPalette.description"),e[110]=n,e[111]=ue):ue=e[111];let He;e[112]!==m||e[113]!==n?(He=m==="all"?n("commandPalette.placeholder"):n("commandPalette.placeholderScoped",{scope:n(Mt(m)).toLowerCase()}),e[112]=m,e[113]=n,e[114]=He):He=e[114];let Ue;e[115]!==n?(Ue=n("commandPalette.placeholder"),e[115]=n,e[116]=Ue):Ue=e[116];let Ge;e[117]!==q||e[118]!==m||e[119]!==h?(Ge=k=>{if(k.key==="Tab"){k.preventDefault(),q(k.shiftKey?-1:1);return}k.key==="Backspace"&&!h&&m!=="all"&&(k.preventDefault(),c("all"))},e[117]=q,e[118]=m,e[119]=h,e[120]=Ge):Ge=e[120],e[121]!==He||e[122]!==Ue||e[123]!==Ge||e[124]!==h?(me=o.jsx(ds,{placeholder:He,"aria-label":Ue,value:h,onValueChange:f,onKeyDown:Ge}),e[121]=He,e[122]=Ue,e[123]=Ge,e[124]=h,e[125]=me):me=e[125];let Je;e[126]!==n?(Je=n("commandPalette.scope.label"),e[126]=n,e[127]=Je):Je=e[127];let Ve;e[128]!==m||e[129]!==n?(Ve=Ze.map(k=>o.jsx("button",{type:"button",role:"radio","aria-checked":m===k,tabIndex:-1,onMouseDown:Lo,onClick:()=>c(k),className:wt("h-7 shrink-0 cursor-pointer rounded-full px-3 text-xs font-medium transition-colors focus-ring",m===k?"bg-foreground text-background":"text-muted-foreground hover:bg-accent hover:text-foreground"),children:n(Mt(k))},k)),e[128]=m,e[129]=n,e[130]=Ve):Ve=e[130],e[131]!==Je||e[132]!==Ve?(fe=o.jsx("div",{role:"radiogroup","aria-label":Je,className:"flex gap-1 overflow-x-auto border-b px-3 py-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:Ve}),e[131]=Je,e[132]=Ve,e[133]=fe):fe=e[133],ne=us,W="h-[min(420px,60vh)] max-h-none";let We;e[134]!==n?(We=n("commandPalette.empty"),e[134]=n,e[135]=We):We=e[135],e[136]!==We?(K=o.jsx(ms,{children:We}),e[136]=We,e[137]=K):K=e[137],e[138]!==z||e[139]!==i.slug||e[140]!==$||e[141]!==P||e[142]!==u||e[143]!==n||e[144]!==h||e[145]!==x?(Y=u("organizations")&&$.length>0&&o.jsx(Qe,{heading:n("commandPalette.organizations"),children:$.map(k=>o.jsxs(ae,{value:`org ${k.name} ${k.slug}`,keywords:P.has(k.id)?[h]:void 0,onSelect:()=>z(()=>x(k.slug),"organization"),children:[o.jsx(un,{org:k,size:"xs"}),o.jsx("span",{className:"min-w-0 flex-1 truncate",children:k.name}),k.slug===i.slug&&o.jsx("span",{className:"text-meta shrink-0",children:n("sidebar.rail.currentOrganization")})]},`org:${k.id}`))}),e[138]=z,e[139]=i.slug,e[140]=$,e[141]=P,e[142]=u,e[143]=n,e[144]=h,e[145]=x,e[146]=Y):Y=e[146],e[147]!==xt||e[148]!==z||e[149]!==r||e[150]!==u||e[151]!==n?(Q=u("actions")&&o.jsx(Qe,{heading:n("commandPalette.goTo"),children:xt.map(k=>o.jsxs(ae,{onSelect:()=>z(()=>r({to:k.to,params:k.params}),"destination"),children:[k.icon,o.jsx("span",{children:k.label})]},k.key))}),e[147]=xt,e[148]=z,e[149]=r,e[150]=u,e[151]=n,e[152]=Q):Q=e[152],e[153]!==z||e[154]!==d||e[155]!==r||e[156]!==i.slug||e[157]!==l||e[158]!==g||e[159]!==u||e[160]!==n?(X=u("projects")&&d&&o.jsx(Qe,{heading:n("commandPalette.projects"),children:l.map(k=>o.jsxs(ae,{value:`project ${k.title}`,onSelect:()=>z(()=>{g(k.id),r({to:re.projects,params:{org:i.slug,agentId:k.id}})},"project"),children:[o.jsx(gs,{icon:k.icon,name:k.title,"aria-hidden":"true"}),o.jsx("span",{children:k.title})]},k.id))}),e[153]=z,e[154]=d,e[155]=r,e[156]=i.slug,e[157]=l,e[158]=g,e[159]=u,e[160]=n,e[161]=X):X=e[161],e[162]!==z||e[163]!==r||e[164]!==F||e[165]!==u||e[166]!==n?(E=u("actions")&&o.jsxs(Qe,{heading:n("commandPalette.actions"),children:[o.jsxs(ae,{value:n("commandPalette.newProject"),onSelect:()=>z(()=>r({to:re.home,params:F}),"new_project"),children:[o.jsx(Ct,{"aria-hidden":"true"}),o.jsx("span",{children:n("commandPalette.newProject")})]}),o.jsxs(ae,{value:n("commandPalette.inviteTeammate"),onSelect:()=>z(()=>r({to:"/$org/settings/members",params:F}),"invite"),children:[o.jsx(Xn,{"aria-hidden":"true"}),o.jsx("span",{children:n("commandPalette.inviteTeammate")})]}),o.jsxs(ae,{value:n("commandPalette.addConnection"),onSelect:()=>z(()=>r({to:"/$org/settings/connections",params:F,search:{tab:"all"}}),"add_connection"),children:[o.jsx(Ct,{"aria-hidden":"true"}),o.jsx("span",{children:n("commandPalette.addConnection")})]}),o.jsxs(ae,{value:n("commandPalette.settings"),onSelect:()=>z(()=>r({to:"/$org/settings/general",params:F}),"settings"),children:[o.jsx(ls,{"aria-hidden":"true"}),o.jsx("span",{children:n("commandPalette.settings")})]})]}),e[162]=z,e[163]=r,e[164]=F,e[165]=u,e[166]=n,e[167]=E):E=e[167],B=u("connections")&&M.length>0&&o.jsx(Qe,{heading:n("commandPalette.connections"),children:M.map(k=>o.jsxs(ae,{value:`${k.title} ${k.id}`,keywords:oe,onSelect:()=>z(()=>ee(k),"connection"),children:[o.jsx(fs,{icon:k.icon,name:k.title,size:"2xs","aria-hidden":"true"}),o.jsx("span",{className:"truncate",children:k.title})]},`connection:${k.id}`))}),we=u("chats")&&U.length>0&&o.jsx(Qe,{heading:n("commandPalette.results"),children:U.map(k=>o.jsxs(ae,{value:`${k.title} ${k.id}`,keywords:oe,onSelect:()=>z(()=>ee(k),k.type),children:[k.type==="thread"?o.jsx(Zn,{"aria-hidden":"true"}):o.jsx(At,{"aria-hidden":"true"}),o.jsx("span",{className:"truncate",children:k.title}),k.type==="task"&&k.key&&o.jsx("span",{className:"ml-auto shrink-0 font-mono text-xs text-muted-foreground",children:k.key})]},`${k.type}:${k.id}`))}),e[29]=R,e[30]=q,e[31]=z,e[32]=d,e[33]=S,e[34]=r,e[35]=a,e[36]=s,e[37]=ee,e[38]=i.slug,e[39]=$,e[40]=l,e[41]=g,e[42]=oe,e[43]=m,e[44]=P,e[45]=u,e[46]=n,e[47]=h,e[48]=x,e[49]=ne,e[50]=V,e[51]=W,e[52]=K,e[53]=Y,e[54]=Q,e[55]=X,e[56]=E,e[57]=B,e[58]=we,e[59]=Se,e[60]=ce,e[61]=de,e[62]=ue,e[63]=me,e[64]=fe}else ne=e[49],V=e[50],W=e[51],K=e[52],Y=e[53],Q=e[54],X=e[55],E=e[56],B=e[57],we=e[58],Se=e[59],ce=e[60],de=e[61],ue=e[62],me=e[63],fe=e[64];let ve;e[168]!==ne||e[169]!==W||e[170]!==K||e[171]!==Y||e[172]!==Q||e[173]!==X||e[174]!==E||e[175]!==B||e[176]!==we?(ve=o.jsxs(ne,{className:W,children:[K,Y,Q,X,E,B,we]}),e[168]=ne,e[169]=W,e[170]=K,e[171]=Y,e[172]=Q,e[173]=X,e[174]=E,e[175]=B,e[176]=we,e[177]=ve):ve=e[177];let it;e[178]===Symbol.for("react.memo_cache_sentinel")?(it=["↑","↓"],e[178]=it):it=e[178];let je;e[179]!==n?(je=n("commandPalette.hint.navigate"),e[179]=n,e[180]=je):je=e[180];let ke;e[181]!==je?(ke=o.jsx(pt,{keys:it,label:je}),e[181]=je,e[182]=ke):ke=e[182];let at;e[183]===Symbol.for("react.memo_cache_sentinel")?(at=["↵"],e[183]=at):at=e[183];let Te;e[184]!==n?(Te=n("commandPalette.hint.open"),e[184]=n,e[185]=Te):Te=e[185];let Ne;e[186]!==Te?(Ne=o.jsx(pt,{keys:at,label:Te}),e[186]=Te,e[187]=Ne):Ne=e[187];let rt;e[188]===Symbol.for("react.memo_cache_sentinel")?(rt=["Tab"],e[188]=rt):rt=e[188];let Pe;e[189]!==n?(Pe=n("commandPalette.hint.filter"),e[189]=n,e[190]=Pe):Pe=e[190];let _e;e[191]!==Pe?(_e=o.jsx(pt,{keys:rt,label:Pe}),e[191]=Pe,e[192]=_e):_e=e[192];let lt;e[193]===Symbol.for("react.memo_cache_sentinel")?(lt=["Esc"],e[193]=lt):lt=e[193];let Oe;e[194]!==n?(Oe=n("commandPalette.hint.close"),e[194]=n,e[195]=Oe):Oe=e[195];let Ie;e[196]!==Oe?(Ie=o.jsx(pt,{keys:lt,label:Oe}),e[196]=Oe,e[197]=Ie):Ie=e[197];let Ae;e[198]!==ke||e[199]!==Ne||e[200]!==_e||e[201]!==Ie?(Ae=o.jsxs("div",{className:"flex items-center gap-4 border-t px-3 py-2 text-xs text-muted-foreground",children:[ke,Ne,_e,Ie]}),e[198]=ke,e[199]=Ne,e[200]=_e,e[201]=Ie,e[202]=Ae):Ae=e[202];let ct;return e[203]!==V||e[204]!==Se||e[205]!==ce||e[206]!==de||e[207]!==ue||e[208]!==me||e[209]!==fe||e[210]!==ve||e[211]!==Ae?(ct=o.jsxs(V,{open:Se,onOpenChange:ce,title:de,description:ue,children:[me,fe,ve,Ae]}),e[203]=V,e[204]=Se,e[205]=ce,e[206]=de,e[207]=ue,e[208]=me,e[209]=fe,e[210]=ve,e[211]=Ae,e[212]=ct):ct=e[212],ct}function Lo(t){return t.preventDefault()}function Ro(t){return t.type!=="connection"}function zo(t){return t.type==="connection"}function Do(t){return t.id}function pt(t){const e=C.c(7),{keys:s,label:a}=t;let n;e[0]!==s?(n=s.map(Mo),e[0]=s,e[1]=n):n=e[1];let r;e[2]!==n?(r=o.jsx("span",{className:"flex items-center gap-0.5",children:n}),e[2]=n,e[3]=r):r=e[3];let i;return e[4]!==a||e[5]!==r?(i=o.jsxs("span",{className:"flex items-center gap-1.5",children:[r,a]}),e[4]=a,e[5]=r,e[6]=i):i=e[6],i}function Mo(t){return o.jsx("kbd",{className:"inline-flex h-5 min-w-5 items-center justify-center rounded-sm border border-border bg-muted px-1 font-mono text-2xs",children:t},t)}const tt=new vs(!1);function Fo(){tt.set(!0)}function qo(){tt.set(!1)}function Bo(){const t=C.c(2),e=G.useSyncExternalStore(tt.subscribe,tt.get);let s;return t[0]!==e?(s=[e,tt.set],t[0]=e,t[1]=s):s=t[1],s}const Ko=300*1e3,Ho=2;function Uo(t,e,s){return!e||e===s?{version:null,count:0}:t.version===e?{version:e,count:t.count+1}:{version:e,count:1}}function Go(t,e){return t.count>=Ho&&t.version!==null&&t.version!==e}function Jo(){const t=C.c(31),e=J();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s={queryKey:Xe.appVersionCheck(),queryFn:Wo,refetchInterval:Ko,refetchIntervalInBackground:!0,staleTime:0},t[0]=s):s=t[0];const{data:a,dataUpdatedAt:n}=pe(s),[r,i]=G.useState(0);let l;t[1]===Symbol.for("react.memo_cache_sentinel")?(l={version:null,count:0},t[1]=l):l=t[1];const[d,g]=G.useState(l);n!==r&&(i(n),g(j=>Uo(j,a,"4.576.5")));const[h,f]=G.useState(null);if(!Go(d,h))return null;let m;t[2]!==e?(m=e("announcements.version.ariaLabel"),t[2]=e,t[3]=m):m=t[3];let c;t[4]!==e?(c=e("announcements.version.dismiss"),t[4]=e,t[5]=c):c=t[5];let y;t[6]!==e?(y=e("announcements.version.eyebrow"),t[6]=e,t[7]=y):y=t[7];let u;t[8]!==e?(u=e("announcements.version.title"),t[8]=e,t[9]=u):u=t[9];let p;t[10]!==e?(p=e("announcements.version.description"),t[10]=e,t[11]=p):p=t[11];let S;t[12]===Symbol.for("react.memo_cache_sentinel")?(S=o.jsx(_t,{size:16}),t[12]=S):S=t[12];let x;t[13]!==d.version?(x=()=>f(d.version),t[13]=d.version,t[14]=x):x=t[14];let b;t[15]!==e?(b=e("announcements.version.currentSession",{version:"4.576.5"}),t[15]=e,t[16]=b):b=t[16];let v;t[17]!==e?(v=e("announcements.version.refresh"),t[17]=e,t[18]=v):v=t[18];let w;t[19]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx(_t,{size:14}),t[19]=w):w=t[19];let N;t[20]!==v?(N=o.jsxs(D,{size:"sm",onClick:Vo,children:[v,w]}),t[20]=v,t[21]=N):N=t[21];let T;return t[22]!==N||t[23]!==m||t[24]!==c||t[25]!==y||t[26]!==u||t[27]!==p||t[28]!==x||t[29]!==b?(T=o.jsx(sn,{ariaLabel:m,dismissLabel:c,eyebrow:y,title:u,description:p,icon:S,tone:"system",onDismiss:x,footerLeading:b,actions:N}),t[22]=N,t[23]=m,t[24]=c,t[25]=y,t[26]=u,t[27]=p,t[28]=x,t[29]=b,t[30]=T):T=t[30],T}function Vo(){return window.location.reload()}async function Wo(){const t=await fetch("/api/config",{cache:"no-store"}),{config:e}=await t.json();return e.version}function Yo(t){return{has(){try{return localStorage.getItem(t)==="1"}catch{return!1}},mark(){try{localStorage.setItem(t,"1")}catch{}}}}const Qo=Date.parse("2026-07-21T00:00:00Z"),Ft=t=>Yo(he.ptBrAnnouncementSeen(t));function Xo(){const t=C.c(35),e=J(),[s,a]=Nn(),{data:n,isPending:r}=se.useSession(),i=n?.user,l=i?.id,d=i?.createdAt,g=d!=null&&new Date(d).getTime()<Qo,h=Pn()==="pt-BR",f=!r&&!!l&&g&&h&&s.language==="en"&&!Ft(l).has()&&!_n(),[m,c]=G.useState(!1),[y,u]=G.useState(!1);!m&&!r&&(c(!0),f&&l&&(Ft(l).mark(),a(ei),u(!0),St("pt_br_auto_switch_shown")));let p;t[0]===Symbol.for("react.memo_cache_sentinel")?(p=z=>{St("pt_br_auto_switch_closed",{action:z}),u(!1)},t[0]=p):p=t[0];const S=p;let x;t[1]!==a?(x=()=>{a(Zo),S("switch-back")},t[1]=a,t[2]=x):x=t[2];const b=x;let v;t[3]===Symbol.for("react.memo_cache_sentinel")?(v=z=>!z&&S("dismiss"),t[3]=v):v=t[3];let w;t[4]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx("div",{className:"text-4xl","aria-hidden":"true",children:"🇧🇷"}),t[4]=w):w=t[4];let N;t[5]!==e?(N=e("announcements.ptBr.title"),t[5]=e,t[6]=N):N=t[6];let T;t[7]!==N?(T=o.jsx(Jt,{children:N}),t[7]=N,t[8]=T):T=t[8];let j;t[9]!==e?(j=e("announcements.ptBr.description"),t[9]=e,t[10]=j):j=t[10];let P;t[11]!==j?(P=o.jsx(On,{children:j}),t[11]=j,t[12]=P):P=t[12];let _;t[13]!==T||t[14]!==P?(_=o.jsxs(Gt,{children:[T,P]}),t[13]=T,t[14]=P,t[15]=_):_=t[15];let O;t[16]!==e?(O=e("announcements.ptBr.switchBack"),t[16]=e,t[17]=O):O=t[17];let A;t[18]!==b||t[19]!==O?(A=o.jsx(D,{variant:"outline",onClick:b,children:O}),t[18]=b,t[19]=O,t[20]=A):A=t[20];let $;t[21]===Symbol.for("react.memo_cache_sentinel")?($=()=>S("ok"),t[21]=$):$=t[21];let L;t[22]!==e?(L=e("announcements.ptBr.ok"),t[22]=e,t[23]=L):L=t[23];let R;t[24]!==L?(R=o.jsx(D,{onClick:$,children:L}),t[24]=L,t[25]=R):R=t[25];let I;t[26]!==A||t[27]!==R?(I=o.jsxs(In,{children:[A,R]}),t[26]=A,t[27]=R,t[28]=I):I=t[28];let q;t[29]!==I||t[30]!==_?(q=o.jsxs(Vt,{className:"sm:max-w-md",children:[w,_,I]}),t[29]=I,t[30]=_,t[31]=q):q=t[31];let H;return t[32]!==y||t[33]!==q?(H=o.jsx(Wt,{open:y,onOpenChange:v,children:q}),t[32]=y,t[33]=q,t[34]=H):H=t[34],H}function Zo(t){return{...t,language:"en"}}function ei(t){return{...t,language:"pt-BR"}}function ti(t){const e=An(t);return typeof e=="string"?e:void 0}function ni(){return ti("experiment-pipeline-check"),null}function si(t){const e=C.c(1),{activeOrg:s}=t;if(!s)return null;En(s.id,{name:s.name??void 0,slug:s.slug??void 0}),Cn();let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx(ni,{}),e[0]=a):a=e[0],a}function oi(t){const{prev:e,virtualMcpId:s,decopilotId:a,savedLayout:n,opts:r,autosendValue:i}=t,l={mainpanel:void 0};s?l.virtualmcpid=s:e.virtualmcpid&&(l.virtualmcpid=e.virtualmcpid);const d=typeof e.virtualmcpid=="string"?e.virtualmcpid:a,h=(s??d)!==d;let f,m;return r?.panel?m=r.panel:r?.newThread&&!h&&$n(e.tabId)?(m=e.tabId,l.mainpanel=e.mainpanel,f=e.sidepanel):n?(m=n.tab,n.sidepanel!==void 0&&(f=n.sidepanel),n.mainpanel!==void 0&&(l.mainpanel=n.mainpanel)):!h&&e.tabId&&!Ln(e.tabId)&&(m=e.tabId),f!==void 0&&(l.sidepanel=f),r?.autosend&&(l.autosend=i),{tabId:m,search:l}}const hn="studio:thread-layout:v4",ii=50;function pn(t){const e={};return t===null||typeof t!="object"||(typeof t.tab=="string"&&(e.tab=t.tab),typeof t.mainpanel=="boolean"&&(e.mainpanel=t.mainpanel),typeof t.sidepanel=="boolean"&&(e.sidepanel=t.sidepanel)),e}function ai(t,e,s,a=ii){const n=t.filter(([r])=>r!==e);for(n.push([e,pn(s)]);n.length>a;)n.shift();return n}function Nt(){try{const t=sessionStorage.getItem(hn);if(!t)return[];const e=JSON.parse(t);return Array.isArray(e)?e.filter(s=>Array.isArray(s)&&s.length===2&&typeof s[0]=="string"):[]}catch{return[]}}function yn(t){try{sessionStorage.setItem(hn,JSON.stringify(t))}catch{}}function ri(t,e){t&&yn(ai(Nt(),t,e))}function li(t){if(!t)return null;const e=Nt().find(([s])=>s===t);return e?pn(e[1]):null}function oa(t){if(!t)return;const e=Nt(),s=e.filter(([a])=>a!==t);s.length!==e.length&&yn(s)}function xn(t){return{queryKey:Xe.homeNextActions(t),queryFn:async()=>{const e=await fetch(`/api/${t}/home-next-actions`,{cache:"no-store"});if(!e.ok)throw new Error("Failed to load home next actions");return await e.json()},staleTime:0,refetchOnWindowFocus:"always"}}function ia(t){const e=C.c(10);let s;e[0]!==t?(s=xn(t),e[0]=t,e[1]=s):s=e[1];const a=pe(s);let n;e[2]!==a.data?.prompts?(n=a.data?.prompts??[],e[2]=a.data?.prompts,e[3]=n):n=e[3];let r;e[4]!==a.data?.tiles?(r=a.data?.tiles??[],e[4]=a.data?.tiles,e[5]=r):r=e[5];let i;return e[6]!==a.isLoading||e[7]!==n||e[8]!==r?(i={isLoading:a.isLoading,prompts:n,tiles:r},e[6]=a.isLoading,e[7]=n,e[8]=r,e[9]=i):i=e[9],i}function ci(t){const e=C.c(31),{orgSlug:s,orgName:a,domain:n}=t,r=J();let i;e[0]!==s?(i=()=>{window.location.href=`/api/${encodeURIComponent(s)}/sso/authorize`},e[0]=s,e[1]=i):i=e[1];const l=i,d=di;let g;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsx("div",{className:"bg-primary/10 p-3 rounded-full","aria-hidden":"true",children:o.jsx(qt,{className:"h-6 w-6 text-primary"})}),e[2]=g):g=e[2];let h;e[3]!==r?(h=r("common.ssoRequiredScreen.title"),e[3]=r,e[4]=h):h=e[4];let f;e[5]!==h?(f=o.jsx("h3",{className:"text-lg font-medium",children:h}),e[5]=h,e[6]=f):f=e[6];let m;e[7]!==n||e[8]!==a||e[9]!==r?(m=a?o.jsxs(o.Fragment,{children:[o.jsx("strong",{children:a})," ",r("common.ssoRequiredScreen.requiresSsoAuth"),n?` ${r("common.ssoRequiredScreen.via",{domain:n})}`:"","."]}):r("common.ssoRequiredScreen.orgRequiresSsoAuth"),e[7]=n,e[8]=a,e[9]=r,e[10]=m):m=e[10];let c;e[11]!==m?(c=o.jsx("p",{className:"text-sm text-muted-foreground",children:m}),e[11]=m,e[12]=c):c=e[12];let y;e[13]!==f||e[14]!==c?(y=o.jsxs("div",{className:"space-y-2",children:[f,c]}),e[13]=f,e[14]=c,e[15]=y):y=e[15];let u;e[16]!==r?(u=r("common.ssoRequiredScreen.signInWithSso"),e[16]=r,e[17]=u):u=e[17];let p;e[18]!==l||e[19]!==u?(p=o.jsx(D,{onClick:l,children:u}),e[18]=l,e[19]=u,e[20]=p):p=e[20];let S;e[21]!==r?(S=r("common.goBack"),e[21]=r,e[22]=S):S=e[22];let x;e[23]!==S?(x=o.jsx(D,{variant:"ghost",onClick:d,children:S}),e[23]=S,e[24]=x):x=e[24];let b;e[25]!==x||e[26]!==p?(b=o.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[p,x]}),e[25]=x,e[26]=p,e[27]=b):b=e[27];let v;return e[28]!==b||e[29]!==y?(v=o.jsxs(be,{children:[g,y,b]}),e[28]=b,e[29]=y,e[30]=v):v=e[30],v}function di(){window.location.href="/"}function ui(t){const e=C.c(27),{notice:s,orgSlug:a}=t,n=J();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:o.jsx(Rn,{className:"h-6 w-6 text-destructive"})}),e[0]=r):r=e[0];let i;e[1]!==s.title?(i=o.jsx("h3",{className:"text-lg font-medium",children:s.title}),e[1]=s.title,e[2]=i):i=e[2];let l;e[3]!==s.message?(l=o.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-line",children:s.message}),e[3]=s.message,e[4]=l):l=e[4];let d;e[5]!==i||e[6]!==l?(d=o.jsxs("div",{className:"space-y-2",children:[i,l]}),e[5]=i,e[6]=l,e[7]=d):d=e[7];let g;e[8]!==s.ctaLabel||e[9]!==s.ctaUrl?(g=s.ctaUrl&&s.ctaLabel?o.jsx(D,{asChild:!0,children:o.jsx("a",{href:s.ctaUrl,target:"_blank",rel:"noreferrer noopener",children:s.ctaLabel})}):null,e[8]=s.ctaLabel,e[9]=s.ctaUrl,e[10]=g):g=e[10];const h=`/${encodeURIComponent(a)}/settings/infra-billing`;let f;e[11]!==n?(f=n("common.blockedOrgScreen.goToBilling"),e[11]=n,e[12]=f):f=e[12];let m;e[13]!==h||e[14]!==f?(m=o.jsx(D,{variant:"outline",asChild:!0,children:o.jsx("a",{href:h,children:f})}),e[13]=h,e[14]=f,e[15]=m):m=e[15];let c;e[16]!==n?(c=n("common.blockedOrgScreen.switchOrg"),e[16]=n,e[17]=c):c=e[17];let y;e[18]!==c?(y=o.jsx(D,{variant:"ghost",asChild:!0,children:o.jsx("a",{href:"/",children:c})}),e[18]=c,e[19]=y):y=e[19];let u;e[20]!==y||e[21]!==g||e[22]!==m?(u=o.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[g,m,y]}),e[20]=y,e[21]=g,e[22]=m,e[23]=u):u=e[23];let p;return e[24]!==u||e[25]!==d?(p=o.jsxs(be,{children:[r,d,u]}),e[24]=u,e[25]=d,e[26]=p):p=e[26],p}function mi(t){const e=C.c(8);let s;e[0]!==t?(s=Xe.orgNotice(t??""),e[0]=t,e[1]=s):s=e[1];let a;e[2]!==t?(a=async()=>{const i=await fetch(`/api/${t}/notice`,{credentials:"include"});return i.ok?(await i.json()).notice??null:null},e[2]=t,e[3]=a):a=e[3];const n=!!t;let r;return e[4]!==s||e[5]!==a||e[6]!==n?(r={queryKey:s,queryFn:a,enabled:n,staleTime:6e4},e[4]=s,e[5]=a,e[6]=n,e[7]=r):r=e[7],pe(r)}const fi="/settings/infra-billing";function gi(t){return(t.endsWith("/")?t.slice(0,-1):t).endsWith(fi)}function hi(t){const e=C.c(7),{org:s,children:a}=t;let n;e[0]!==s.id||e[1]!==s.name?(n={id:s.id,organizationId:s.id,slug:"_org",name:s.name,ui:null},e[0]=s.id,e[1]=s.name,e[2]=n):n=e[2];const r=n;let i;return e[3]!==a||e[4]!==s||e[5]!==r?(i=o.jsx(Hn,{org:s,project:r,children:a}),e[3]=a,e[4]=s,e[5]=r,e[6]=i):i=e[6],i}function pi(){const t=kt(),e=js(),{org:s}=Tt(),a=zn({strict:!1}),n=nn(),{openPanel:r,closePanel:i}=as(),l=Ns(),d=Ps(),g=_s(),h=Os(),f=(u,p=!0)=>t({to:".",search:u,replace:p}),m=()=>f(u=>({...u,sidepanel:!0})),c=(u,p,S)=>{const x=!!d&&d===u;d&&!x&&ri(d,{tab:n,mainpanel:a.mainpanel,sidepanel:a.sidepanel});const b=x?null:li(u),v=Xt(s.id).id,w=oi({prev:{virtualmcpid:l,tabId:n,mainpanel:a.mainpanel,sidepanel:a.sidepanel},virtualMcpId:p,decopilotId:v,savedLayout:b,opts:S,autosendValue:rs});return h(u,()=>w.search,{virtualMcpId:p,view:{tabId:w.tabId}})};return{openSidePanel:m,setTaskId:c,createNewTask:async(u,p,S)=>{const x=crypto.randomUUID(),b=u??g;try{await e?.create({id:x,virtual_mcp_id:b,...p?{branch:p}:{}})}catch{}c(x,b,{...S,newThread:!0})},openTab:r,closeTab:i}}const yi=new Set(["/$org/","/$org/home"]);function xi(){const t=C.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e={select:bi},t[0]=e):e=t[0],Zt(e)}function bi(t){const e=t.matches.at(-1)?.fullPath;return e!==void 0&&yi.has(e)}function wi(){const t=C.c(54);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org",shouldThrow:!1},t[0]=e):e=t[0];const a=Dn(e)?.params.org,[n,r]=G.useState(!1),[i,l]=Bo(),[d,g]=bs(),h=Mn(),f=xi(),m=a??"";let c;t[1]!==m?(c=xn(m),t[1]=m,t[2]=c):c=t[2];const y=!!a&&f;let u;t[3]!==c||t[4]!==y?(u={...c,enabled:y},t[3]=c,t[4]=y,t[5]=u):u=t[5],pe(u);const{data:p}=se.useSession(),S=p?.user?.id;let x,b;t[6]!==h?(x=()=>{const E=B=>{if(It(B)&&B.code==="KeyK"){B.preventDefault(),Fo();return}if(B.key==="?"&&!Kn(B.target)){B.preventDefault(),r(!0);return}It(B)&&B.code==="BracketLeft"&&h.history.canGoBack()&&(B.preventDefault(),h.history.back())};return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},b=[h],t[6]=h,t[7]=x,t[8]=b):(x=t[7],b=t[8]),G.useEffect(x,b);let v;t[9]!==a||t[10]!==S?(v=Fn(a,S),t[9]=a,t[10]=S,t[11]=v):v=t[11];const{data:w}=Kt(v),N=w?.id,T=w?.slug,{data:j}=Is(N,T),P=!!j?.ssoRequired&&!j.authenticated,{data:_}=mi(T);let O;t[12]===Symbol.for("react.memo_cache_sentinel")?(O={select:Si},t[12]=O):O=t[12];const A=Zt(O),$=_?.severity==="block"&&!gi(A),L=N??"",R=T??"";let I;t[13]!==R||t[14]!==L?(I=xs({connectionId:Qt,orgId:L,orgSlug:R}),t[13]=R,t[14]=L,t[15]=I):I=t[15];const q=!!N&&!!T;let H;if(t[16]!==I||t[17]!==q?(H={...I,enabled:q},t[16]=I,t[17]=q,t[18]=H):H=t[18],pe(H),(!w||Ot(w)||P||$)&&qo(),!w){let E;return t[19]!==a?(E=o.jsx(Bs,{orgSlug:a}),t[19]=a,t[20]=E):E=t[20],E}if(Ot(w)){localStorage.getItem(he.lastOrgSlug())===a&&localStorage.removeItem(he.lastOrgSlug()),Ht()?.org===a&&Ut();let E;return t[21]!==w.name?(E=o.jsx(qn,{orgName:w.name}),t[21]=w.name,t[22]=E):E=t[22],E}if($&&_){let E;return t[23]!==w.slug||t[24]!==_?(E=o.jsx(ui,{notice:_,orgSlug:w.slug}),t[23]=w.slug,t[24]=_,t[25]=E):E=t[25],E}if(P){let E;return t[26]!==w.id||t[27]!==w.name||t[28]!==w.slug||t[29]!==j.domain?(E=o.jsx(ci,{orgId:w.id,orgSlug:w.slug,orgName:w.name,domain:j.domain}),t[26]=w.id,t[27]=w.name,t[28]=w.slug,t[29]=j.domain,t[30]=E):E=t[30],E}const le=w.logo??null;let ee;t[31]!==w||t[32]!==le?(ee={...w,logo:le},t[31]=w,t[32]=le,t[33]=ee):ee=t[33];let te;t[34]!==w?(te=o.jsx(si,{activeOrg:w}),t[34]=w,t[35]=te):te=t[35];let oe;t[36]===Symbol.for("react.memo_cache_sentinel")?(oe=o.jsx(Bn,{}),t[36]=oe):oe=t[36];let ne;t[37]===Symbol.for("react.memo_cache_sentinel")?(ne=o.jsxs("div",{className:"fixed bottom-6 right-6 z-50 flex w-[min(360px,calc(100vw-3rem))] flex-col gap-3",children:[o.jsx(go,{}),o.jsx(Jo,{})]}),t[37]=ne):ne=t[37];let V;t[38]!==i||t[39]!==l?(V=i&&o.jsx($o,{open:i,onOpenChange:l}),t[38]=i,t[39]=l,t[40]=V):V=t[40];let W;t[41]!==d||t[42]!==g?(W=d&&o.jsx(ws,{open:!0,onOpenChange:g,source:Ss()}),t[41]=d,t[42]=g,t[43]=W):W=t[43];let K;t[44]!==n?(K=o.jsx(po,{open:n,onOpenChange:r}),t[44]=n,t[45]=K):K=t[45];let Y,Q;t[46]===Symbol.for("react.memo_cache_sentinel")?(Y=o.jsx(Xo,{}),Q=o.jsx(ks,{}),t[46]=Y,t[47]=Q):(Y=t[46],Q=t[47]);let X;return t[48]!==ee||t[49]!==te||t[50]!==V||t[51]!==W||t[52]!==K?(X=o.jsxs(hi,{org:ee,children:[te,oe,ne,V,W,K,Y,Q]}),t[48]=ee,t[49]=te,t[50]=V,t[51]=W,t[52]=K,t[53]=X):X=t[53],X}function Si(t){return t.location.pathname}function vi(){const t=C.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(Ts,{children:o.jsx(wi,{})}),t[0]=e):e=t[0],e}const aa=Object.freeze(Object.defineProperty({__proto__:null,default:vi,usePanelActions:pi},Symbol.toStringTag,{value:"Module"}));export{gn as E,Qi as I,Ks as L,un as O,vo as a,fn as b,Io as c,Zi as d,na as e,Xi as f,pi as g,ea as h,rn as i,ao as j,oa as k,Zs as l,sa as m,ia as n,Fo as o,Wi as p,aa as q,_o as r,Yi as s,ta as t,mi as u,Po as w};
@@ -1,3 +0,0 @@
1
- import{c as B,b as ge,r as q,j as a,B as xe,m as K,K as os,ak as Ra,t as et,fb as Ta,ar as hr,ej as fr,Y as rs,c8 as Da,aG as Ts,aH as Ds,aI as Bs,aJ as Is,bj as $s,aK as Fs,aL as Ls,aM as Os,X as qs,Z as Hs,_ as Ks,a as Vs,a4 as gs,cy as Ba,h as as,fc as mr,fd as fn,bK as Ia,b7 as $a,bh as Un,fe as Fa,c2 as La,al as Oa,I as Ma,a7 as _a,ff as Ea,V as pr,i as dt,eW as mn,q as br,J as gr,D as xr,x as vr,v as yr,Q as jr,R as wr,fg as za,bk as Pr,a5 as pn,b2 as bn,e as qn,E as Ua,T as qa}from"./index-DVvmeJMJ.js";import{S as Ha}from"./separator-B-2WnIuS.js";import{f as Ka,u as cs,r as Sr,l as kr,c as Nr,b as Va}from"./chat-context-bTdV0PQS.js";import{u as It,at as Ga,au as Cr,av as Ar,c as gn,b as xn,M as vn,aw as Wa,L as Qa,ax as Ja,ah as Ya,ay as Xa,l as yn,S as Rr,az as Za,a1 as Tr,G as el,aA as tl,aB as sl,D as Dr}from"./site-editor-toast-Bz5hIXUq.js";import{j as nl,L as rl,g as al}from"./shell-layout-CU0v0Q3J.js";import{I as Br}from"./toolbar-icon-button-DJE3OEfz.js";import{b as ll,P as il,a as ol}from"./popover-DVbSl4_S.js";import{c as tt,T as st,a as nt,b as Gs}from"./tooltip-BVrosRIK.js";import{f as cl,a as dl,c as ul,C as Hn,e as Kn,b as Vn}from"./command-C4A_k1m6.js";import{T as Dt,a as Ir,c as $r}from"./tabs-B314G2il.js";import{t as Fr}from"./ChevronUp-DlMNWluH.js";import{Y as Lr,aH as Ws,F as hl,a as Or,aI as fl,b as ml,aJ as Mr,M as pl}from"./agent-icon-uDqFfzhf.js";import{a as _r}from"./SwitchHorizontal01-C42vJfgE.js";import{c as Er,s as Ms}from"./Tool01-DB3xqZeL.js";import{s as zr}from"./Plus-DXpzgENj.js";import{s as Qs}from"./Trash01-BAWUFhrC.js";import{u as ds}from"./use-voice-input-DyZTYy5g.js";import{l as bl,d as Ur}from"./thread-intent-BNVTtSHt.js";import{h as qr,r as Hr,u as xs,g as gl,e as Me,f as Kr}from"./repository-binding-DJpVzzIq.js";import{u as xl}from"./use-debounced-value-jJnqowMI.js";import{u as vl}from"./useInfiniteQuery-BuWYzJlw.js";import{d as yl,b as jl,p as wl,e as Vr,g as Gr,h as Wr}from"./use-navigate-to-agent-BNznjjAZ.js";import{u as Js,g as jn,n as ps,b as Qr,a as Pl,d as Sl,e as kl,r as ms,f as Nl,s as Cl,h as Ps,j as Al,c as wn}from"./cms-store-drafts-B8sdeq2z.js";import{a as _s}from"./virtual-mcp-CSkG36xb.js";import{u as Pn}from"./use-blocks-v8-project-Cbqo1QTy.js";import{G as Jr}from"./github-icon-B_en9n_0.js";import{u as Rl,a as Tl}from"./use-fast-preview-draft-url-BxKgK3r2.js";import{a6 as ss,a7 as Yr,D as Es,o as Sn,a8 as Dl,a9 as Bl,G as Il,aa as $l,ab as Fl,p as Ll,y as St,f as kn,ac as Ol}from"./blocks-tab-states-DS5PjKyJ.js";import"./index-MBimNXd5.js";import{T as Ml}from"./textarea-yEyl1P1k.js";import{i as Nn}from"./CheckCircle-DSJM5Ipe.js";import{n as _l,s as El,C as zl,a as Ul,b as ql,M as Hl,c as Kl,d as Vl,m as Gl,u as Wl}from"./use-cms-publish-actions-C7zW1hZf.js";import{a as Ql,g as Jl}from"./UserSquare-NNxs0RWc.js";import{i as Cn,b as An,m as Yl,h as Xl,c as Xr,f as Zr,d as Zl,r as Rn,e as ei,n as ti,g as si,j as ni,k as ri,l as Tn,o as ai,p as ea,q as li,s as Dn,t as tn}from"./sandbox-git-api-DcqI6XE4.js";import{b as ii,g as oi}from"./utils-Pt7-9-Ev.js";import{i as ci}from"./Monitor01-CVDkBVET.js";import{w as Bn,R as ta}from"./device-hint-DKfCoj9a.js";import{w as Gn}from"./editor-T1DFIh20.js";import{x as di,C as ui}from"./section-array-field-AXi3Vg_u.js";import{s as sa}from"./save-changes-debug-nBi-n9eV.js";import{u as hi}from"./use-mcp-client-Bh7kEUBS.js";import{u as fi}from"./use-sandbox-events-C8uDi6Yt.js";import{b as mi,a as pi}from"./sandbox-lifecycle-context-_uINbsP3.js";import{b as bi}from"./agent-capabilities-C7nwtlfn.js";import{b as gi}from"./thread-route-C8VqFbkH.js";function xi(t){const{value:e,baseBranch:s,releases:r,baseIsDraft:n=!1,storeDrafts:o=[]}=t,d=!n&&!!e&&e===s,l=r.find(c=>c.branch===e),i=d||l?void 0:o.find(c=>c.name===e),u=!d&&!l&&!i&&!!e;return i?{isBase:d,current:l,storeDraft:i,unlisted:u}:{isBase:d,current:l,unlisted:u}}const vi={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" "},Wn=1114111;function Qn(t){return t?t.replace(/&(#x?[0-9a-fA-F]+|[a-zA-Z]+);/g,(e,s)=>{if(s.startsWith("#x")||s.startsWith("#X")){const r=Number.parseInt(s.slice(2),16);return!Number.isFinite(r)||r>Wn?e:String.fromCodePoint(r)}if(s.startsWith("#")){const r=Number.parseInt(s.slice(1),10);return!Number.isFinite(r)||r>Wn?e:String.fromCodePoint(r)}return vi[s]??e}):""}function yi(t){const e=B.c(39),{url:s,onSave:r}=t,n=ge(),[o,d]=q.useState(s??"");let l;e[0]!==o?(l=o.trim(),e[0]=o,e[1]=l):l=e[1];const i=l;let u;e[2]!==r||e[3]!==i?(u=()=>r(i?bl(i):null),e[2]=r,e[3]=i,e[4]=u):u=e[4];const c=u;let h;e[5]!==n?(h=n("thread.branchPicker.localHint"),e[5]=n,e[6]=h):h=e[6];let p;e[7]!==h?(p=a.jsx("p",{className:"text-xs text-muted-foreground",children:h}),e[7]=h,e[8]=p):p=e[8];let b;e[9]!==n?(b=n("thread.branchPicker.localUrlLabel"),e[9]=n,e[10]=b):b=e[10];let f;e[11]!==n?(f=n("thread.branchPicker.localUrlPlaceholder"),e[11]=n,e[12]=f):f=e[12];let m;e[13]===Symbol.for("react.memo_cache_sentinel")?(m=N=>d(N.target.value),e[13]=m):m=e[13];let g;e[14]!==c||e[15]!==i?(g=N=>{N.key==="Enter"&&i&&c()},e[14]=c,e[15]=i,e[16]=g):g=e[16];let x;e[17]!==b||e[18]!==f||e[19]!==g||e[20]!==o?(x=a.jsx("input",{type:"url",inputMode:"url","aria-label":b,placeholder:f,value:o,onChange:m,onKeyDown:g,className:"h-8 w-full rounded-md border bg-transparent px-2 text-sm focus-ring"}),e[17]=b,e[18]=f,e[19]=g,e[20]=o,e[21]=x):x=e[21];let P;e[22]!==r||e[23]!==n||e[24]!==s?(P=s?a.jsx(xe,{variant:"ghost",size:"sm",className:"text-xs text-destructive hover:text-destructive",onClick:()=>r(null),children:n("thread.branchPicker.localTurnOff")}):a.jsx("span",{}),e[22]=r,e[23]=n,e[24]=s,e[25]=P):P=e[25];const j=!i;let y;e[26]!==n?(y=n("thread.branchPicker.save"),e[26]=n,e[27]=y):y=e[27];let S;e[28]!==c||e[29]!==j||e[30]!==y?(S=a.jsx(xe,{size:"sm",disabled:j,onClick:c,children:y}),e[28]=c,e[29]=j,e[30]=y,e[31]=S):S=e[31];let w;e[32]!==P||e[33]!==S?(w=a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[P,S]}),e[32]=P,e[33]=S,e[34]=w):w=e[34];let k;return e[35]!==w||e[36]!==p||e[37]!==x?(k=a.jsxs("div",{className:"flex flex-col gap-2 p-2",children:[p,x,w]}),e[35]=w,e[36]=p,e[37]=x,e[38]=k):k=e[38],k}function ji(t){const e=B.c(8),{virtualMcpId:s,branch:r,serve:n,rowRef:o,onPicked:d}=t,l=It(s,r),i=!!n.connection,u=i&&l.kind==="protocol"&&l.source==="local";let c;e[0]!==d||e[1]!==n?(c=()=>wi(n,d),e[0]=d,e[1]=n,e[2]=c):c=e[2];let h;return e[3]!==o||e[4]!==i||e[5]!==u||e[6]!==c?(h=a.jsx(Pi,{rowRef:o,selected:i,connected:u,onSelect:c}),e[3]=o,e[4]=i,e[5]=u,e[6]=c,e[7]=h):h=e[7],h}function wi(t,e){e?.(),!t.connection&&t.set({endpoint:t.lastEndpoint??Ga})}function Pi(t){const e=B.c(19),{rowRef:s,selected:r,connected:n,onSelect:o}=t,d=ge(),l=r?"bg-accent":"hover:bg-accent";let i;e[0]!==l?(i=K("flex rounded-lg",l),e[0]=l,e[1]=i):i=e[1];let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=a.jsx("span",{"data-testid":"localhost-dot",className:"h-2 w-2 shrink-0 rounded-full bg-foreground"}),e[2]=u):u=e[2];let c;e[3]!==d?(c=d("thread.branchPicker.localhost.label"),e[3]=d,e[4]=c):c=e[4];let h;e[5]!==c?(h=a.jsx("span",{className:"min-w-0 flex-1 truncate",children:c}),e[5]=c,e[6]=h):h=e[6];let p;e[7]!==n||e[8]!==d?(p=n&&a.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:d("thread.branchPicker.localhost.connected")}),e[7]=n,e[8]=d,e[9]=p):p=e[9];let b;e[10]!==o||e[11]!==r||e[12]!==h||e[13]!==p?(b=a.jsxs("button",{type:"button","aria-pressed":r,onClick:o,className:"flex w-full min-w-0 items-center gap-2.5 px-2 py-2 text-left text-sm",children:[u,h,p]}),e[10]=o,e[11]=r,e[12]=h,e[13]=p,e[14]=b):b=e[14];let f;return e[15]!==s||e[16]!==i||e[17]!==b?(f=a.jsx("div",{ref:s,className:i,children:b}),e[15]=s,e[16]=i,e[17]=b,e[18]=f):f=e[18],f}const Si=10080*60*1e3;function ki({sandboxMap:t,userId:e,rawBranches:s,now:r}){const n=new Map;for(const[h,p]of Object.entries(t??{}))for(const[b,f]of Object.entries(p??{})){let m=n.get(b);m||(m={userIds:new Set,lastActiveAt:0},n.set(b,m)),m.userIds.add(h);for(const g of Object.values(f??{})){const x=g?.createdAt??0;x>m.lastActiveAt&&(m.lastActiveAt=x)}}const o=r-Si,d=[...n.entries()].filter(([,h])=>h.lastActiveAt>=o).sort((h,p)=>p[1].lastActiveAt-h[1].lastActiveAt).map(([h,p])=>({name:h,source:"recent",contributors:[...p.userIds],lastActiveAt:p.lastActiveAt})),l=new Set(d.map(h=>h.name)),i=new Set(Object.keys(t?.[e]??{})),u=[...i].filter(h=>!l.has(h)).sort().map(h=>({name:h,source:"yours"})),c=s.filter(h=>!i.has(h.name)&&!l.has(h.name)).map(h=>({name:h.name,source:"other",author:h.author??null}));return{recent:d,yours:u,others:c}}const Ni=100,Ci=50,Ai=300;function on(t,e){const s=e.trim().toLowerCase();return s?t.toLowerCase().includes(s):!0}function Ri(t){const e=B.c(39),{orgId:s,orgSlug:r,userId:n,target:o,sandboxMap:d,owner:l,repo:i,search:u,enabled:c}=t,h=u===void 0?"":u,p=c===void 0?!0:c;let b;e[0]!==h?(b=h.trim(),e[0]=h,e[1]=b):b=e[1];const f=b,m=xl(f,Ai);let g;e[2]!==o?(g=qr(o),e[2]=o,e[3]=g):g=e[3];const x=g,P=f.length>0;let j;e[4]!==m||e[5]!==s||e[6]!==r||e[7]!==l||e[8]!==i||e[9]!==o?(j=os.githubBranchSearch(s,r,Hr(o),l,i,m),e[4]=m,e[5]=s,e[6]=r,e[7]=l,e[8]=i,e[9]=o,e[10]=j):j=e[10];const y=p&&x;let S;e[11]!==m||e[12]!==r||e[13]!==o?(S=D=>{const{pageParam:Z}=D;return Ra(r,"REPOSITORY_SEARCH_BRANCHES",{...o,query:m,limit:m?Ci:Ni,cursor:Z})},e[11]=m,e[12]=r,e[13]=o,e[14]=S):S=e[14];let w;e[15]!==m?(w=D=>m?void 0:D.nextCursor??void 0,e[15]=m,e[16]=w):w=e[16];let k;e[17]!==j||e[18]!==y||e[19]!==S||e[20]!==w?(k={queryKey:j,enabled:y,staleTime:3e4,retry:!1,initialPageParam:null,queryFn:S,getNextPageParam:w},e[17]=j,e[18]=y,e[19]=S,e[20]=w,e[21]=k):k=e[21];const{data:N,isLoading:C,isError:v,isFetching:A,hasNextPage:T,isFetchingNextPage:I,fetchNextPage:M}=vl(k),$=P&&(m!==f||A),H=(N?.pages??[]).flatMap(Ti),O=nl(6e4),G=ki({sandboxMap:d,userId:n,rawBranches:H,now:O});let E;e[22]!==f?(E=D=>on(D.name,f),e[22]=f,e[23]=E):E=e[23];const W=G.recent.filter(E);let F;e[24]!==f?(F=D=>on(D.name,f),e[24]=f,e[25]=F):F=e[25];const V=G.yours.filter(F),te=G.others,Y=N?.pages[0],re=P&&Y&&!$?Math.max(0,Y.totalCount-Y.branches.length):0,le=!P&&T;let _;e[26]!==M?(_=()=>{M()},e[26]=M,e[27]=_):_=e[27];let X;return e[28]!==re||e[29]!==v||e[30]!==I||e[31]!==C||e[32]!==$||e[33]!==te||e[34]!==W||e[35]!==le||e[36]!==_||e[37]!==V?(X={recent:W,yours:V,others:te,isLoading:C,isError:v,isSearching:$,hiddenMatchCount:re,hasMore:le,isFetchingMore:I,fetchMore:_},e[28]=re,e[29]=v,e[30]=I,e[31]=C,e[32]=$,e[33]=te,e[34]=W,e[35]=le,e[36]=_,e[37]=V,e[38]=X):X=e[38],X}function Ti(t){return t.branches}function Di(t){const e=B.c(7),s=ge(),{releases:r,createRelease:n}=Js(t.virtualMcpId),o=xs(t.virtualMcpId);let d;return e[0]!==n||e[1]!==t.userId||e[2]!==t.userLabel||e[3]!==o||e[4]!==r||e[5]!==s?(d=()=>{if(r.length>=_s)return et.error(s("thread.branchPicker.capReached",{max:_s})),null;const l=jn(t.userLabel);return n({branch:l,name:Qr(r,s("thread.branchPicker.defaultVersionName")),color:ps(r.length),createdBy:t.userId,createdAt:new Date().toISOString(),...o?{runtime:Ur(o.metadata)}:{}}).catch(i=>{et.error(s("thread.branchPicker.saveError"),{description:Cr(s,Ar(i))})}),l},e[0]=n,e[1]=t.userId,e[2]=t.userLabel,e[3]=o,e[4]=r,e[5]=s,e[6]=d):d=e[6],d}const zs="-mx-[3px] h-3.5 w-3.5 shrink-0";function Bi(t){const e=B.c(112),{virtualMcpId:s,isV8:r,userLabel:n,value:o,baseBranch:d,baseIsDraft:l,orgId:i,orgSlug:u,userId:c,target:h,owner:p,repo:b,sandboxMap:f,onChange:m,onCreateBranch:g,onAdoptBranch:x,disabled:P,spawnsNewChat:j,placement:y}=t,S=r===void 0?!1:r,w=l===void 0?!1:l,k=P===void 0?!1:P,N=j===void 0?!1:j,C=y===void 0?"chat":y,v=ge(),A=C==="header",[T,I]=q.useState(!1),[M,$]=q.useState(!1),[H,O]=q.useState("branches"),[G,E]=q.useState(null),[W,F]=q.useState(""),[V,te]=q.useState(null),[Y,re]=q.useState(null),le=q.useRef(null),{releases:_,createRelease:X,renameRelease:D,deleteRelease:Z}=Js(s);let se;e[0]!==c||e[1]!==n||e[2]!==s?(se={virtualMcpId:s,userLabel:n,userId:c},e[0]=c,e[1]=n,e[2]=s,e[3]=se):se=e[3];const ie=Di(se),{projectDefault:ue}=ds(s);let he;e[4]!==ue?(he=R=>Al(R,ue)==="sandbox",e[4]=ue,e[5]=he):he=e[5];const ne=he,oe=Pl(s,S),fe=S?Sl(_,oe.data):[],z=oe.refetch,ce=kl(s),{url:Pe,setUrl:Q,clear:ee}=gn(s),ve=xn(s),J=S&&!!ve.connection,me=S?ve.connection?.endpoint??null:Pe,we=!!me;let rt;e[6]!==ee||e[7]!==S||e[8]!==ve?(rt=()=>{ee(),S&&ve.clear()},e[6]=ee,e[7]=S,e[8]=ve,e[9]=rt):rt=e[9];const ye=rt;let _e;e[10]!==T?(_e={enabled:T},e[10]=T,e[11]=_e):_e=e[11];const{data:Ee}=Ta(_e);let Ne;e[12]!==Ee?.data?.members?(Ne=R=>R?Ee?.data?.members?.find(be=>be.userId===R)?.user?.name??void 0:void 0,e[12]=Ee?.data?.members,e[13]=Ne):Ne=e[13];const De=Ne,Le=_.length>=_s,Ce=_.length>1,ut=v("thread.branchPicker.capReached",{max:_s}),{isBase:Oe,current:Qe,storeDraft:ze,unlisted:Ue}=xi({value:o,baseBranch:d,releases:_,baseIsDraft:w,storeDrafts:fe}),L=Oe?v("thread.branchPicker.live"):Qe?.name??ze?.name??v("thread.branchPicker.defaultVersionName"),pe=J?v("thread.branchPicker.localhost.label"):we?v("thread.branchPicker.localLabel"):o?L:v("thread.branchPicker.selectVersion"),Ae=J?"bg-foreground":we?"bg-special":Oe?"bg-success":ze?ms(void 0):ms(Qe?.color??"orange"),Be=!J&&!we&&!Oe&&!!Qe&&ne(Qe),Te=R=>{ye();const be=fe.some(Ve=>Ve.name===R)?{runtime:"cms"}:_.find(Ve=>Ve.branch===R);m(R,be&&{runtime:be.runtime}),I(!1)};let qe;e[14]!==v?(qe=R=>{et.error(v("thread.branchPicker.saveError"),{description:Cr(v,Ar(R))})},e[14]=v,e[15]=qe):qe=e[15];const Ie=qe;let at;e[16]!==Q?(at=R=>{Q(R),$(!1),I(!1)},e[16]=Q,e[17]=at):at=e[17];const us=at,hs=(R,be)=>{if(ye(),x){x(R),$(!1),I(!1);return}if(!_.some(Ve=>Ve.branch===R)){if(Le){et.error(ut);return}X({branch:R,name:be.trim()||R,color:ps(_.length),createdBy:c,createdAt:new Date().toISOString()}).catch(Ie)}m(R),$(!1),I(!1)};let ht;e[18]!==ye||e[19]!==m||e[20]!==g||e[21]!==ie?(ht=()=>{const R=ie();R&&(ye(),(g??m)(R),I(!1))},e[18]=ye,e[19]=m,e[20]=g,e[21]=ie,e[22]=ht):ht=e[22];const Ft=ht;let Se;e[23]===Symbol.for("react.memo_cache_sentinel")?(Se=()=>{E(null),F(""),$(!1),O("branches")},e[23]=Se):Se=e[23];const Lt=Se;let lt;e[24]===Symbol.for("react.memo_cache_sentinel")?(lt=R=>{O(R),$(!0)},e[24]=lt):lt=e[24];const Nt=lt;let Ot;e[25]===Symbol.for("react.memo_cache_sentinel")?(Ot=R=>{E(R.branch),F(R.name)},e[25]=Ot):Ot=e[25];const fs=Ot;let Je;e[26]!==W||e[27]!==D||e[28]!==Ie?(Je=R=>{const be=W.trim();be&&D(R,be).catch(Ie),E(null),F("")},e[26]=W,e[27]=D,e[28]=Ie,e[29]=Je):Je=e[29];const Ct=Je,Mt=R=>{const be=R===void 0?o:R,Ve=W.trim();if(Ve&&be){if(Le){et.error(ut),E(null),F("");return}X({branch:be,name:Ve,color:ps(_.length),createdBy:c,createdAt:new Date().toISOString()}).catch(Ie)}E(null),F("")};let it;e[30]===Symbol.for("react.memo_cache_sentinel")?(it=()=>{E(null),F("")},e[30]=it):it=e[30];const At=it,ft=()=>{const R=V;if(te(null),!(!R||!Ce)){if(R.branch===o){const be=_.filter(en=>en.branch!==R.branch),Ve=be.find(en=>!ne(en))??be[0];Ve?Te(Ve.branch):I(!1)}else I(!1);Z(R.branch).catch(Ie)}},mt=Nl(_,ue),_t=(mt.content.length>0||fe.length>0)&&mt.code.length>0,Rt=R=>G===R.branch?a.jsx(sn,{value:W,onChange:F,onSave:()=>Ct(R.branch),onCancel:At},R.branch):a.jsx(nn,{rowRef:!we&&R.branch===o?le:void 0,dot:ms(R.color),codeIcon:ne(R)?Ps(R.color):void 0,label:R.name,creator:De(R.createdBy),originTooltip:S?v("thread.branchPicker.viaStudioUi"):void 0,branch:!S||ne(R)?R.branch:void 0,selected:!we&&R.branch===o,onSelect:()=>Te(R.branch),onRename:()=>fs(R),onDelete:()=>te(R),deleteBlocked:!Ce},R.branch),Tt=()=>{const R=Y;if(re(null),!(!R||R.name===o&&_.length===0)){if(R.name===o){const be=_[0];be?Te(be.branch):I(!1)}ce.mutateAsync(R.name).catch(be=>{et.error(v("thread.branchPicker.discardStoreDraftError"),{description:be instanceof Error?be.message:void 0})})}},pt=fe.map((R,be)=>G===R.name?a.jsx(sn,{value:W,onChange:F,onSave:()=>Mt(R.name),onCancel:At},`store:${R.name}`):a.jsx(nn,{rowRef:!we&&R.name===o?le:void 0,dot:ms(void 0),label:R.name,creator:De(R.createdBy),agentIcon:Ps(ps(be)),originTooltip:v("thread.branchPicker.storeDraftVia",{via:Cl(R.via)}),selected:!we&&R.name===o,onSelect:()=>Te(R.name),onRename:()=>{E(R.name),F(R.name)},onDelete:()=>re(R),deleteBlocked:R.name===o&&_.length===0},`store:${R.name}`));let bt;e[31]!==k||e[32]!==S||e[33]!==z?(bt=k?void 0:R=>{R?S&&z():Lt(),I(R)},e[31]=k,e[32]=S,e[33]=z,e[34]=bt):bt=e[34];const gt=A?"text-xs":"text-xs text-muted-foreground hover:text-foreground";let xt;e[35]!==gt?(xt=K("shrink min-w-0 max-w-[220px] gap-2",gt,Br),e[35]=gt,e[36]=xt):xt=e[36];let vt;e[37]!==k?(vt=!k&&a.jsx(Fr,{size:12,className:"opacity-60 shrink-0"}),e[37]=k,e[38]=vt):vt=e[38];let yt;e[39]!==pe?(yt=a.jsx(nt,{children:pe}),e[39]=pe,e[40]=yt):yt=e[40];const Ye=ll,jt="w-[min(300px,calc(100vw-2rem))] p-1.5",wt="start";let $e;e[41]===Symbol.for("react.memo_cache_sentinel")?($e=R=>{R.preventDefault(),le.current?.scrollIntoView({block:"nearest"})},e[41]=$e):$e=e[41];let Fe;e[42]!==N||e[43]!==v?(Fe=N&&a.jsx("p",{className:"px-2 pb-1.5 pt-1 text-xs text-muted-foreground",children:v("thread.branchPicker.newChatHint")}),e[42]=N,e[43]=v,e[44]=Fe):Fe=e[44];const Xe=M?a.jsx($i,{orgId:i,orgSlug:u,userId:c,target:h,owner:p,repo:b,sandboxMap:f,enabled:T,tab:H,onTabChange:O,isV8:S,localUrl:Pe,onSaveLocal:us,onBack:()=>$(!1),onAdopt:hs}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:K("always-scrollbar flex max-h-[min(50vh,20rem)] flex-col overflow-y-auto",S&&"gap-1"),children:[!S&&we&&me&&a.jsx(Ii,{rowRef:le,url:me,onSelect:()=>Nt("local"),onEdit:()=>Nt("local"),onTurnOff:()=>ye()}),Ue&&o&&(G===o?a.jsx(sn,{value:W,onChange:F,onSave:()=>Mt(),onCancel:At}):a.jsx(nn,{rowRef:we?void 0:le,dot:ms("orange"),label:v("thread.branchPicker.defaultVersionName"),branch:S?void 0:o,originTooltip:S?v("thread.branchPicker.viaStudioUi"):void 0,selected:!we,onSelect:()=>Te(o),onRename:()=>{E(o),F(Qr(_,v("thread.branchPicker.defaultVersionName")))}})),_t?a.jsxs(a.Fragment,{children:[a.jsx(Jn,{children:v("thread.branchPicker.groupContent")}),mt.content.map(Rt),pt,a.jsx(Jn,{divided:!0,children:v("thread.branchPicker.groupCode")}),mt.code.map(Rt)]}):a.jsxs(a.Fragment,{children:[_.map(Rt),pt]}),S&&a.jsx(ji,{virtualMcpId:s,branch:o,serve:ve,rowRef:J?le:void 0,onPicked:()=>I(!1)})]}),(Ue||_.length>0||fe.length>0||S)&&a.jsx("div",{className:"my-1 border-t"}),a.jsxs("button",{type:"button",onClick:()=>{Ft()},disabled:Le,className:"flex w-full items-center gap-2 rounded-lg px-2 py-2 text-left text-sm text-muted-foreground hover:bg-accent hover:text-foreground disabled:pointer-events-none disabled:opacity-50",children:[a.jsx(zr,{className:"h-4 w-4 shrink-0"}),v("thread.branchPicker.newVersion")]}),Le&&a.jsx("p",{className:"px-2 pb-1 pt-0.5 text-xs text-warning",children:ut}),a.jsxs("button",{type:"button",onClick:()=>Nt("branches"),className:K("flex w-full items-center justify-between gap-2 rounded-lg px-2 py-2 text-left text-xs text-muted-foreground hover:bg-accent hover:text-foreground",S&&"mt-1"),children:[v("thread.branchPicker.advanced"),a.jsx(hr,{className:"h-4 w-4 shrink-0"})]})]});let He;e[45]!==Ye||e[46]!==$e||e[47]!==Fe||e[48]!==Xe?(He=a.jsxs(Ye,{className:jt,align:wt,onOpenAutoFocus:$e,children:[Fe,Xe]}),e[45]=Ye,e[46]=$e,e[47]=Fe,e[48]=Xe,e[49]=He):He=e[49];const Pt=a.jsxs(il,{open:T,onOpenChange:bt,children:[a.jsxs(tt,{children:[a.jsx(st,{asChild:!0,children:a.jsx("span",{className:"inline-flex min-w-0 shrink",children:a.jsx(ol,{asChild:!0,children:a.jsxs(xe,{"data-tour":rl.branchPicker,variant:A?"outline":"ghost",size:A?"sm":"default","aria-label":pe,disabled:k,className:xt,children:[Be?a.jsx(Lr,{className:K(zs,Ps(Qe?.color))}):ze&&!we?a.jsx(fr,{className:K(zs,Ps(ps(fe.indexOf(ze))))}):a.jsx("span",{className:K("h-2 w-2 shrink-0 rounded-full",o||we?Ae:"bg-muted-foreground")}),a.jsx("span",{className:"min-w-0 truncate @max-3xl/panel-header:hidden",children:pe}),vt]})})})}),yt]}),He]}),Ze=V!==null;let ot;e[50]===Symbol.for("react.memo_cache_sentinel")?(ot=R=>{R||te(null)},e[50]=ot):ot=e[50];let U;e[51]!==v?(U=v("thread.branchPicker.deleteTitle"),e[51]=v,e[52]=U):U=e[52];let ae;e[53]!==U?(ae=a.jsx(Ts,{children:U}),e[53]=U,e[54]=ae):ae=e[54];let de;e[55]!==V||e[56]!==v?(de=V&&v("thread.branchPicker.deleteConfirm",{name:V.name}),e[55]=V,e[56]=v,e[57]=de):de=e[57];let je;e[58]!==de?(je=a.jsx(Ds,{children:de}),e[58]=de,e[59]=je):je=e[59];let Re;e[60]!==ae||e[61]!==je?(Re=a.jsxs(Bs,{children:[ae,je]}),e[60]=ae,e[61]=je,e[62]=Re):Re=e[62];let Ke;e[63]!==v?(Ke=v("thread.branchPicker.cancel"),e[63]=v,e[64]=Ke):Ke=e[64];let Et;e[65]!==Ke?(Et=a.jsx(Is,{children:Ke}),e[65]=Ke,e[66]=Et):Et=e[66];let zt;e[67]!==v?(zt=v("thread.branchPicker.delete"),e[67]=v,e[68]=zt):zt=e[68];let Ut;e[69]!==ft||e[70]!==zt?(Ut=a.jsx($s,{onClick:ft,variant:"destructive",children:zt}),e[69]=ft,e[70]=zt,e[71]=Ut):Ut=e[71];let qt;e[72]!==Et||e[73]!==Ut?(qt=a.jsxs(Fs,{children:[Et,Ut]}),e[72]=Et,e[73]=Ut,e[74]=qt):qt=e[74];let Ht;e[75]!==Re||e[76]!==qt?(Ht=a.jsxs(Ls,{children:[Re,qt]}),e[75]=Re,e[76]=qt,e[77]=Ht):Ht=e[77];let ys;e[78]!==Ze||e[79]!==Ht?(ys=a.jsx(Os,{open:Ze,onOpenChange:ot,children:Ht}),e[78]=Ze,e[79]=Ht,e[80]=ys):ys=e[80];const Zs=Y!==null;let js;e[81]===Symbol.for("react.memo_cache_sentinel")?(js=R=>{R||re(null)},e[81]=js):js=e[81];let Kt;e[82]!==v?(Kt=v("thread.branchPicker.deleteTitle"),e[82]=v,e[83]=Kt):Kt=e[83];let Vt;e[84]!==Kt?(Vt=a.jsx(Ts,{children:Kt}),e[84]=Kt,e[85]=Vt):Vt=e[85];let Gt;e[86]!==Y||e[87]!==v?(Gt=Y&&v("thread.branchPicker.discardStoreDraftConfirm",{name:Y.name}),e[86]=Y,e[87]=v,e[88]=Gt):Gt=e[88];let Wt;e[89]!==Gt?(Wt=a.jsx(Ds,{children:Gt}),e[89]=Gt,e[90]=Wt):Wt=e[90];let Qt;e[91]!==Vt||e[92]!==Wt?(Qt=a.jsxs(Bs,{children:[Vt,Wt]}),e[91]=Vt,e[92]=Wt,e[93]=Qt):Qt=e[93];let Jt;e[94]!==v?(Jt=v("thread.branchPicker.cancel"),e[94]=v,e[95]=Jt):Jt=e[95];let Yt;e[96]!==Jt?(Yt=a.jsx(Is,{children:Jt}),e[96]=Jt,e[97]=Yt):Yt=e[97];let Xt;e[98]!==v?(Xt=v("thread.branchPicker.delete"),e[98]=v,e[99]=Xt):Xt=e[99];let Zt;e[100]!==Tt||e[101]!==Xt?(Zt=a.jsx($s,{onClick:Tt,variant:"destructive",children:Xt}),e[100]=Tt,e[101]=Xt,e[102]=Zt):Zt=e[102];let es;e[103]!==Yt||e[104]!==Zt?(es=a.jsxs(Fs,{children:[Yt,Zt]}),e[103]=Yt,e[104]=Zt,e[105]=es):es=e[105];let ts;e[106]!==Qt||e[107]!==es?(ts=a.jsxs(Ls,{children:[Qt,es]}),e[106]=Qt,e[107]=es,e[108]=ts):ts=e[108];let ws;return e[109]!==Zs||e[110]!==ts?(ws=a.jsx(Os,{open:Zs,onOpenChange:js,children:ts}),e[109]=Zs,e[110]=ts,e[111]=ws):ws=e[111],a.jsxs(a.Fragment,{children:[Pt,ys,ws]})}function sn(t){const e=B.c(20),{value:s,onChange:r,onSave:n,onCancel:o}=t,d=ge();let l;e[0]!==d?(l=d("thread.branchPicker.rename"),e[0]=d,e[1]=l):l=e[1];let i;e[2]!==r?(i=f=>r(f.target.value),e[2]=r,e[3]=i):i=e[3];let u;e[4]!==o||e[5]!==n?(u=f=>{f.key==="Enter"&&n(),f.key==="Escape"&&(f.preventDefault(),f.stopPropagation(),o())},e[4]=o,e[5]=n,e[6]=u):u=e[6];let c;e[7]!==l||e[8]!==i||e[9]!==u||e[10]!==s?(c=a.jsx("input",{autoFocus:!0,"aria-label":l,value:s,onChange:i,onKeyDown:u,className:"h-8 flex-1 rounded-md border bg-transparent px-2 text-sm focus-ring"}),e[7]=l,e[8]=i,e[9]=u,e[10]=s,e[11]=c):c=e[11];let h;e[12]!==d?(h=d("thread.branchPicker.save"),e[12]=d,e[13]=h):h=e[13];let p;e[14]!==n||e[15]!==h?(p=a.jsx(xe,{size:"sm",onClick:n,children:h}),e[14]=n,e[15]=h,e[16]=p):p=e[16];let b;return e[17]!==c||e[18]!==p?(b=a.jsxs("div",{className:"flex items-center gap-1.5 p-1",children:[c,p]}),e[17]=c,e[18]=p,e[19]=b):b=e[19],b}function Jn(t){const e=B.c(5),{divided:s,children:r}=t,o=(s===void 0?!1:s)&&"mt-1 border-t";let d;e[0]!==o?(d=K("px-2 pb-1 pt-2 text-xs font-medium uppercase tracking-wide text-muted-foreground",o),e[0]=o,e[1]=d):d=e[1];let l;return e[2]!==r||e[3]!==d?(l=a.jsx("p",{className:d,children:r}),e[2]=r,e[3]=d,e[4]=l):l=e[4],l}function nn(t){const e=B.c(53),{rowRef:s,dot:r,codeIcon:n,agentIcon:o,originTooltip:d,label:l,creator:i,branch:u,selected:c,onSelect:h,onRename:p,onDelete:b,deleteBlocked:f}=t,m=f===void 0?!1:f,g=ge();let x;e[0]!==o||e[1]!==n||e[2]!==r?(x=n?a.jsx(Lr,{className:K(zs,n)}):o?a.jsx(fr,{className:K(zs,o)}):a.jsx("span",{className:K("h-2 w-2 shrink-0 rounded-full",r)}),e[0]=o,e[1]=n,e[2]=r,e[3]=x):x=e[3];let P;e[4]!==i?(P=i&&a.jsx("span",{className:"ml-1.5 text-xs font-normal text-muted-foreground/70",children:i}),e[4]=i,e[5]=P):P=e[5];let j;e[6]!==l||e[7]!==P?(j=a.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[l,P]}),e[6]=l,e[7]=P,e[8]=j):j=e[8];let y;e[9]!==h||e[10]!==c||e[11]!==x||e[12]!==j?(y=a.jsxs("button",{type:"button","aria-pressed":c,onClick:h,className:"flex min-w-0 flex-1 items-center gap-2.5 px-2 py-2 text-left text-sm",children:[x,j]}),e[9]=h,e[10]=c,e[11]=x,e[12]=j,e[13]=y):y=e[13];const S=y,w=c?"bg-accent":"hover:bg-accent";let k;e[14]!==w?(k=K("group flex items-center rounded-lg",w),e[14]=w,e[15]=k):k=e[15];let N;e[16]!==u||e[17]!==n||e[18]!==d||e[19]!==S||e[20]!==g?(N=u||d?a.jsxs(tt,{children:[a.jsx(st,{asChild:!0,children:S}),a.jsxs(nt,{side:"bottom",className:"text-xs",children:[n&&a.jsx("p",{className:"font-medium",children:g("thread.branchPicker.codeDraftTooltip")}),d&&a.jsx("p",{children:d}),u&&a.jsx("p",{className:"font-mono",children:g("thread.branchPicker.branchTooltip",{branch:u})})]})]}):S,e[16]=u,e[17]=n,e[18]=d,e[19]=S,e[20]=g,e[21]=N):N=e[21];let C;e[22]!==g?(C=g("thread.branchPicker.moreActions"),e[22]=g,e[23]=C):C=e[23];let v;e[24]===Symbol.for("react.memo_cache_sentinel")?(v=a.jsx(_r,{className:"h-4 w-4"}),e[24]=v):v=e[24];let A;e[25]!==C?(A=a.jsx(qs,{asChild:!0,children:a.jsx(xe,{variant:"ghost",size:"icon","aria-label":C,className:"mr-1 h-6 w-6 shrink-0 opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100",children:v})}),e[25]=C,e[26]=A):A=e[26];let T;e[27]===Symbol.for("react.memo_cache_sentinel")?(T=a.jsx(Er,{className:"h-4 w-4"}),e[27]=T):T=e[27];let I;e[28]!==g?(I=g("thread.branchPicker.rename"),e[28]=g,e[29]=I):I=e[29];let M;e[30]!==p||e[31]!==I?(M=a.jsxs(rs,{onSelect:p,children:[T,I]}),e[30]=p,e[31]=I,e[32]=M):M=e[32];let $;e[33]!==m||e[34]!==b||e[35]!==g?($=b&&a.jsxs(rs,{onSelect:b,disabled:m,className:"text-destructive focus:text-destructive",children:[a.jsx(Qs,{className:"h-4 w-4"}),g("thread.branchPicker.delete")]}),e[33]=m,e[34]=b,e[35]=g,e[36]=$):$=e[36];let H;e[37]!==m||e[38]!==b||e[39]!==g?(H=b&&m&&a.jsx("p",{className:"max-w-48 px-2 pb-1.5 text-xs text-muted-foreground",children:g("thread.branchPicker.keepOneDraft")}),e[37]=m,e[38]=b,e[39]=g,e[40]=H):H=e[40];let O;e[41]!==M||e[42]!==$||e[43]!==H?(O=a.jsxs(Hs,{align:"end",children:[M,$,H]}),e[41]=M,e[42]=$,e[43]=H,e[44]=O):O=e[44];let G;e[45]!==A||e[46]!==O?(G=a.jsxs(Ks,{children:[A,O]}),e[45]=A,e[46]=O,e[47]=G):G=e[47];let E;return e[48]!==s||e[49]!==G||e[50]!==k||e[51]!==N?(E=a.jsxs("div",{ref:s,className:k,children:[N,G]}),e[48]=s,e[49]=G,e[50]=k,e[51]=N,e[52]=E):E=e[52],E}function Ii(t){const e=B.c(40),{rowRef:s,url:r,onSelect:n,onEdit:o,onTurnOff:d}=t,l=ge();let i;try{let A;e[0]!==r?(A=new URL(r),e[0]=r,e[1]=A):A=e[1],i=A.host}catch{i=r}const u=i;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=a.jsx("span",{className:"h-2 w-2 shrink-0 rounded-full bg-special"}),e[2]=c):c=e[2];let h;e[3]!==l?(h=l("thread.branchPicker.localLabel"),e[3]=l,e[4]=h):h=e[4];let p;e[5]!==u?(p=a.jsx("span",{className:"ml-1.5 text-xs font-normal text-muted-foreground/70",children:u}),e[5]=u,e[6]=p):p=e[6];let b;e[7]!==h||e[8]!==p?(b=a.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[h,p]}),e[7]=h,e[8]=p,e[9]=b):b=e[9];let f;e[10]!==n||e[11]!==b?(f=a.jsxs("button",{type:"button","aria-pressed":!0,onClick:n,className:"flex min-w-0 flex-1 items-center gap-2.5 px-2 py-2 text-left text-sm",children:[c,b]}),e[10]=n,e[11]=b,e[12]=f):f=e[12];let m;e[13]!==l?(m=l("thread.branchPicker.moreActions"),e[13]=l,e[14]=m):m=e[14];let g;e[15]===Symbol.for("react.memo_cache_sentinel")?(g=a.jsx(_r,{className:"h-4 w-4"}),e[15]=g):g=e[15];let x;e[16]!==m?(x=a.jsx(qs,{asChild:!0,children:a.jsx(xe,{variant:"ghost",size:"icon","aria-label":m,className:"mr-1 h-6 w-6 shrink-0 opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100",children:g})}),e[16]=m,e[17]=x):x=e[17];let P;e[18]===Symbol.for("react.memo_cache_sentinel")?(P=a.jsx(Er,{className:"h-4 w-4"}),e[18]=P):P=e[18];let j;e[19]!==l?(j=l("thread.branchPicker.rename"),e[19]=l,e[20]=j):j=e[20];let y;e[21]!==o||e[22]!==j?(y=a.jsxs(rs,{onSelect:o,children:[P,j]}),e[21]=o,e[22]=j,e[23]=y):y=e[23];let S;e[24]===Symbol.for("react.memo_cache_sentinel")?(S=a.jsx(Qs,{className:"h-4 w-4"}),e[24]=S):S=e[24];let w;e[25]!==l?(w=l("thread.branchPicker.localTurnOff"),e[25]=l,e[26]=w):w=e[26];let k;e[27]!==d||e[28]!==w?(k=a.jsxs(rs,{onSelect:d,className:"text-destructive focus:text-destructive",children:[S,w]}),e[27]=d,e[28]=w,e[29]=k):k=e[29];let N;e[30]!==y||e[31]!==k?(N=a.jsxs(Hs,{align:"end",children:[y,k]}),e[30]=y,e[31]=k,e[32]=N):N=e[32];let C;e[33]!==N||e[34]!==x?(C=a.jsxs(Ks,{children:[x,N]}),e[33]=N,e[34]=x,e[35]=C):C=e[35];let v;return e[36]!==s||e[37]!==C||e[38]!==f?(v=a.jsxs("div",{ref:s,className:"group flex items-center rounded-lg bg-accent",children:[f,C]}),e[36]=s,e[37]=C,e[38]=f,e[39]=v):v=e[39],v}function $i(t){const e=B.c(73),{orgId:s,orgSlug:r,userId:n,target:o,owner:d,repo:l,sandboxMap:i,enabled:u,tab:c,onTabChange:h,isV8:p,localUrl:b,onSaveLocal:f,onBack:m,onAdopt:g}=t,x=ge(),[P,j]=q.useState(""),y=c==="branches"?P:"",S=u&&c==="branches";let w;e[0]!==s||e[1]!==r||e[2]!==d||e[3]!==l||e[4]!==i||e[5]!==y||e[6]!==S||e[7]!==o||e[8]!==n?(w={orgId:s,orgSlug:r,userId:n,target:o,sandboxMap:i,owner:d,repo:l,search:y,enabled:S},e[0]=s,e[1]=r,e[2]=d,e[3]=l,e[4]=i,e[5]=y,e[6]=S,e[7]=o,e[8]=n,e[9]=w):w=e[9];const{recent:k,yours:N,others:C,isLoading:v,hasMore:A,isFetchingMore:T,fetchMore:I}=Ri(w),M=u&&c==="prs";let $;e[10]!==s||e[11]!==r||e[12]!==d||e[13]!==l||e[14]!==M||e[15]!==o?($={orgId:s,orgSlug:r,target:o,owner:d,repo:l,enabled:M},e[10]=s,e[11]=r,e[12]=d,e[13]=l,e[14]=M,e[15]=o,e[16]=$):$=e[16];const{data:H,isLoading:O}=yl($);let G;if(e[17]!==I||e[18]!==A||e[19]!==T||e[20]!==v||e[21]!==p||e[22]!==b||e[23]!==g||e[24]!==m||e[25]!==f||e[26]!==h||e[27]!==C||e[28]!==d||e[29]!==O||e[30]!==k||e[31]!==l||e[32]!==P||e[33]!==x||e[34]!==H||e[35]!==c||e[36]!==N){const E=H===void 0?[]:H,W=`${d}/${l}`;let F;e[38]!==W?(F=W.toLowerCase(),e[38]=W,e[39]=F):F=e[39];const V=F;let te;e[40]!==V?(te=z=>z.headRepoFullName?.toLowerCase()===V,e[40]=V,e[41]=te):te=e[41];const Y=E.filter(te);let re;if(e[42]!==C||e[43]!==k||e[44]!==N){const z=new Set;re=[...k,...N,...C].filter(ce=>z.has(ce.name)?!1:(z.add(ce.name),!0)),e[42]=C,e[43]=k,e[44]=N,e[45]=re}else re=e[45];const le=re;let _;e[46]===Symbol.for("react.memo_cache_sentinel")?(_=a.jsx(hl,{className:"h-4 w-4 shrink-0"}),e[46]=_):_=e[46];let X;e[47]!==x?(X=x("thread.branchPicker.advancedBack"),e[47]=x,e[48]=X):X=e[48];let D;e[49]!==m||e[50]!==X?(D=a.jsxs("button",{type:"button",onClick:m,className:"flex items-center gap-1.5 px-2 py-1.5 text-xs text-muted-foreground hover:text-foreground",children:[_,X]}),e[49]=m,e[50]=X,e[51]=D):D=e[51];let Z;e[52]!==h?(Z=z=>{h(z),j("")},e[52]=h,e[53]=Z):Z=e[53];let se;e[54]!==x?(se=x("thread.branchPicker.branchesTab"),e[54]=x,e[55]=se):se=e[55];let ie;e[56]!==se?(ie=a.jsx(Dt,{value:"branches",className:"h-6 px-2.5 text-xs",children:se}),e[56]=se,e[57]=ie):ie=e[57];let ue;e[58]!==x?(ue=x("thread.branchPicker.prsTab"),e[58]=x,e[59]=ue):ue=e[59];let he;e[60]!==ue?(he=a.jsx(Dt,{value:"prs",className:"h-6 px-2.5 text-xs",children:ue}),e[60]=ue,e[61]=he):he=e[61];let ne;e[62]!==p||e[63]!==x?(ne=!p&&a.jsx(Dt,{value:"local",className:"h-6 px-2.5 text-xs",children:x("thread.branchPicker.localTab")}),e[62]=p,e[63]=x,e[64]=ne):ne=e[64];let oe;e[65]!==ie||e[66]!==he||e[67]!==ne?(oe=a.jsxs(Ir,{className:"h-auto w-fit justify-start gap-1 bg-accent p-1",variant:"pill",children:[ie,he,ne]}),e[65]=ie,e[66]=he,e[67]=ne,e[68]=oe):oe=e[68];let fe;e[69]!==Z||e[70]!==oe||e[71]!==c?(fe=a.jsx($r,{className:"px-2 pt-2 pb-1",value:c,onValueChange:Z,children:oe}),e[69]=Z,e[70]=oe,e[71]=c,e[72]=fe):fe=e[72],G=a.jsxs("div",{className:"flex flex-col",children:[D,fe,c==="local"&&!p?a.jsx(yi,{url:b,onSave:f}):a.jsxs(cl,{filter:c==="branches"?Fi:void 0,children:[a.jsx(dl,{placeholder:x(c==="branches"?"thread.branchPicker.searchBranches":"thread.branchPicker.searchPullRequests"),value:P,onValueChange:j}),a.jsx(ul,{onScroll:z=>{const ce=z.currentTarget;c==="branches"&&ce.scrollHeight-ce.scrollTop-ce.clientHeight<48&&I()},children:c==="branches"?a.jsxs(a.Fragment,{children:[v&&a.jsx("div",{className:"p-3 text-xs text-muted-foreground",children:x("thread.branchPicker.loadingMore")}),!v&&le.length===0&&a.jsx(Hn,{children:x("thread.branchPicker.noBranchesFound")}),le.length>0&&a.jsx(Kn,{children:le.map(z=>a.jsxs(Vn,{value:z.name,className:"cursor-pointer",onSelect:()=>g(z.name,z.name),children:[a.jsx(Da,{className:"mr-2 h-4 w-4 shrink-0"}),a.jsx("span",{className:"flex-1 truncate",children:z.name})]},z.name))}),A&&a.jsx("div",{className:"p-2",children:a.jsx(xe,{variant:"ghost",size:"sm",className:"h-7 w-full text-xs",disabled:T,onClick:I,children:x(T?"thread.branchPicker.loadingMore":"thread.branchPicker.loadMoreBranches")})})]}):a.jsxs(a.Fragment,{children:[O&&a.jsx("div",{className:"p-3 text-xs text-muted-foreground",children:x("thread.branchPicker.loadingPullRequests")}),!O&&Y.length===0&&a.jsx(Hn,{children:x("thread.branchPicker.noOpenPullRequests")}),Y.length>0&&a.jsx(Kn,{children:Y.map(z=>a.jsxs(Vn,{value:`#${z.number} ${z.title} ${z.head}`,className:"cursor-pointer",onSelect:()=>g(z.head,Qn(z.title)),children:[a.jsx(Ws,{className:"mr-2 h-4 w-4 shrink-0 text-muted-foreground"}),a.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[a.jsx("span",{className:"truncate",children:Qn(z.title)}),a.jsxs("span",{className:"truncate text-xs text-muted-foreground",children:["#",z.number," · ",z.head]})]})]},z.number))})]})})]})]}),e[17]=I,e[18]=A,e[19]=T,e[20]=v,e[21]=p,e[22]=b,e[23]=g,e[24]=m,e[25]=f,e[26]=h,e[27]=C,e[28]=d,e[29]=O,e[30]=k,e[31]=l,e[32]=P,e[33]=x,e[34]=H,e[35]=c,e[36]=N,e[37]=G}else G=e[37];return G}function Fi(t,e){return on(t,e)?1:0}function Li(t){const e=B.c(19),{locked:s,placement:r,value:n,virtualMcpId:o,isV8:d,userLabel:l,baseBranch:i,baseIsDraft:u,onChange:c,onCreateBranch:h,onAdoptBranch:p,orgId:b,orgSlug:f,userId:m,target:g,owner:x,repo:P,sandboxMap:j}=t;let y;return e[0]!==i||e[1]!==u||e[2]!==d||e[3]!==s||e[4]!==p||e[5]!==c||e[6]!==h||e[7]!==b||e[8]!==f||e[9]!==x||e[10]!==r||e[11]!==P||e[12]!==j||e[13]!==g||e[14]!==m||e[15]!==l||e[16]!==n||e[17]!==o?(y=a.jsx(Bi,{virtualMcpId:o,isV8:d,userLabel:l,value:n,baseBranch:i,baseIsDraft:u,orgId:b,orgSlug:f,userId:m,target:g,owner:x,repo:P,sandboxMap:j,onChange:c,onCreateBranch:h,onAdoptBranch:p,spawnsNewChat:s,placement:r}),e[0]=i,e[1]=u,e[2]=d,e[3]=s,e[4]=p,e[5]=c,e[6]=h,e[7]=b,e[8]=f,e[9]=x,e[10]=r,e[11]=P,e[12]=j,e[13]=g,e[14]=m,e[15]=l,e[16]=n,e[17]=o,e[18]=y):y=e[18],y}function Oi(t){const e=B.c(2),{branchPill:s}=t;if(!s)return null;let r;return e[0]!==s?(r=a.jsx(a.Fragment,{children:s}),e[0]=s,e[1]=r):r=e[1],r}function Mi(t){const{locked:e,sessionRuntime:s,projectRuntime:r,draftRuntime:n,current:o}=t;return t.contentOnly&&n==="cms"?s==="cms"&&!e?{kind:"switch"}:{kind:"new-chat",runtime:"cms"}:n==="sandbox"&&s!=="sandbox"?{kind:"new-chat",runtime:"sandbox"}:n==="cms"&&s==="sandbox"&&r==="cms"&&!o?{kind:"new-chat"}:e?s==="sandbox"?{kind:"new-chat",runtime:"sandbox"}:{kind:"new-chat"}:{kind:"switch"}}function _i(t){const e=B.c(25),{virtualMcp:s,currentBranch:r}=t,n=Ka(),o=cs();let d;e[0]!==n?.messages||e[1]!==o?.isThreadLocked?(d=(n?.messages??[]).length>0||(o?.isThreadLocked??!1),e[0]=n?.messages,e[1]=o?.isThreadLocked,e[2]=d):d=e[2];const l=d,i=o?.setCurrentTaskBranch,u=o?.createTask,c=ds(s?.id),h=c.runtime,p=s?.metadata;let b;e[3]!==p?(b=Ur(p),e[3]=p,e[4]=b):b=e[4];const f=b,m=f==="cms"&&h==="sandbox",g=gl(s),x=Me(g),{data:P}=Vs.useSession(),j=P?.user;let y;e[5]!==j?(y=wn(j),e[5]=j,e[6]=y):y=e[6];const S=y,w=P?.user?.id??"",{org:k}=gs(),N=jl(s,r),C=Pn(s?.id),v=C&&h==="cms";let A;e[7]!==u||e[8]!==r||e[9]!==l||e[10]!==f||e[11]!==h||e[12]!==c.resolved||e[13]!==i||e[14]!==C?(A=(E,W)=>{const F=Mi({locked:l,sessionRuntime:c.resolved?h:null,projectRuntime:f,draftRuntime:W&&(W.runtime??f),current:E===r,contentOnly:C});F.kind==="new-chat"&&u?u({branch:E,...F.runtime?{runtime:F.runtime}:{}}):i&&i(E)},e[7]=u,e[8]=r,e[9]=l,e[10]=f,e[11]=h,e[12]=c.resolved,e[13]=i,e[14]=C,e[15]=A):A=e[15];const T=A;let I;e[16]!==m||e[17]!==u||e[18]!==l||e[19]!==i?(I=E=>{(l||m)&&u?u({branch:E}):i&&i(E)},e[16]=m,e[17]=u,e[18]=l,e[19]=i,e[20]=I):I=e[20];const M=I;let $;e[21]!==u?($=u?E=>u({runtime:"sandbox",branch:E}):void 0,e[21]=u,e[22]=$):$=e[22];const H=$,O=g&&qr(x)?a.jsx(Li,{userLabel:S,virtualMcpId:s?.id??"",isV8:C,value:r,baseBranch:N,baseIsDraft:v,orgId:k.id,orgSlug:k.slug,userId:w,target:x,owner:g.owner,repo:g.name,sandboxMap:s?.metadata?.sandboxMap,onChange:T,onCreateBranch:M,onAdoptBranch:H,locked:l,placement:"chat"},`${Hr(x)}:${g.owner}/${g.name}`):null;let G;return e[23]!==O?(G=a.jsx(Oi,{branchPill:O}),e[23]=O,e[24]=G):G=e[24],G}const Ei=Ba("flex w-fit items-stretch [&>*]:focus-visible:z-10 [&>*]:focus-visible:relative [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-lg",{variants:{orientation:{horizontal:"[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",vertical:"flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none"}},defaultVariants:{orientation:"horizontal"}});function zi(t){const e=B.c(11);let s,r,n;e[0]!==t?({className:s,orientation:r,...n}=t,e[0]=t,e[1]=s,e[2]=r,e[3]=n):(s=e[1],r=e[2],n=e[3]);let o;e[4]!==s||e[5]!==r?(o=K(Ei({orientation:r}),s),e[4]=s,e[5]=r,e[6]=o):o=e[6];let d;return e[7]!==r||e[8]!==n||e[9]!==o?(d=a.jsx("div",{role:"group","data-slot":"button-group","data-orientation":r,className:o,...n}),e[7]=r,e[8]=n,e[9]=o,e[10]=d):d=e[10],d}function Ui(t){const e=B.c(14),{item:s}=t;let r;e[0]!==s?(r=()=>{s.onSelect()},e[0]=s,e[1]=r):r=e[1];let n;e[2]!==s.disabled||e[3]!==s.icon||e[4]!==s.label||e[5]!==r?(n=a.jsxs(rs,{disabled:s.disabled,onSelect:r,children:[s.icon,s.label]}),e[2]=s.disabled,e[3]=s.icon,e[4]=s.label,e[5]=r,e[6]=n):n=e[6];const o=n;if(!s.tooltip)return o;let d;e[7]!==o?(d=a.jsx(st,{asChild:!0,children:o}),e[7]=o,e[8]=d):d=e[8];let l;e[9]!==s.tooltip?(l=a.jsx(nt,{side:"right",children:s.tooltip}),e[9]=s.tooltip,e[10]=l):l=e[10];let i;return e[11]!==d||e[12]!==l?(i=a.jsxs(tt,{children:[d,l]}),e[11]=d,e[12]=l,e[13]=i):i=e[13],i}function na(t){const e=B.c(20),{label:s,onClick:r,variant:n,size:o,disabled:d,loading:l,pulse:i,tooltip:u,icon:c,items:h,menuAriaLabel:p,className:b}=t,f=n===void 0?"default":n,m=o===void 0?"default":o,g=d===void 0?!1:d,x=l===void 0?!1:l,P=i===void 0?!1:i,j=(h?.length??0)>0;let y;if(e[0]!==b||e[1]!==g||e[2]!==j||e[3]!==c||e[4]!==h||e[5]!==s||e[6]!==x||e[7]!==p||e[8]!==r||e[9]!==P||e[10]!==m||e[11]!==u||e[12]!==f){const S=K(Br,f==="default"&&"focus-visible:inset-ring-current");let w;e[14]!==c||e[15]!==x?(w=x?a.jsx(as,{size:"xs"}):c,e[14]=c,e[15]=x,e[16]=w):w=e[16];const k=a.jsxs(xe,{type:"button",variant:f,size:m,disabled:g,"aria-busy":x||void 0,onClick:x?void 0:r,className:K(S,j&&"rounded-r-none border-r border-current/20"),children:[w,s]}),N=P&&"animate-pulse-brightness motion-reduce:animate-none motion-reduce:opacity-80";let C;e[17]!==b||e[18]!==N?(C=K(N,b),e[17]=b,e[18]=N,e[19]=C):C=e[19],y=a.jsxs(zi,{className:C,children:[u?a.jsxs(tt,{children:[a.jsx(st,{asChild:!0,children:a.jsx("span",{className:K("inline-flex rounded-lg outline-none",S,g&&"cursor-not-allowed"),tabIndex:g?0:void 0,role:g?"button":void 0,"aria-disabled":g||void 0,children:k})}),a.jsx(nt,{children:u})]}):k,j?a.jsxs(Ks,{children:[a.jsx(qs,{asChild:!0,children:a.jsx(xe,{type:"button",variant:f,size:m,"aria-label":p,className:K("has-[>svg]:px-2",S),children:a.jsx(Fr,{className:"size-3.5"})})}),a.jsx(Hs,{align:"end",children:h?.map(qi)})]}):null]}),e[0]=b,e[1]=g,e[2]=j,e[3]=c,e[4]=h,e[5]=s,e[6]=x,e[7]=p,e[8]=r,e[9]=P,e[10]=m,e[11]=u,e[12]=f,e[13]=y}else y=e[13];return y}function qi(t){return a.jsx(Ui,{item:t},t.key)}async function Hi(t){if(t.hosted)return;const e=t.branch;await t.setCurrentTaskBranch(t.nextBranch()),e&&e!==t.baseBranch&&await t.deleteRelease(e)}function Ki(t,e,{hosted:s}){return s&&t!==null?t:e}function Vi(t,e){const s=B.c(11),[r,n]=q.useState(null);let o;s[0]!==r||s[1]!==t||s[2]!==e?(o=Ki(r,t,e),s[0]=r,s[1]=t,s[2]=e,s[3]=o):o=s[3];let d;s[4]!==t||s[5]!==e?(d=()=>n(e.hosted?t:null),s[4]=t,s[5]=e,s[6]=d):d=s[6];let l;s[7]===Symbol.for("react.memo_cache_sentinel")?(l=()=>n(null),s[7]=l):l=s[7];let i;return s[8]!==o||s[9]!==d?(i={shown:o,hold:d,release:l},s[8]=o,s[9]=d,s[10]=i):i=s[10],i}function Gi({open:t,hosted:e}){return t||e}function ra(t){return _l({userName:t?.name,userEmail:t?.email})??void 0}function Ys(t){const e=B.c(18),{state:s,header:r,body:n,note:o,gate:d,footer:l}=t,i=s!=="ready";let u;e[0]!==r?(u=a.jsx("div",{className:"space-y-0.5 px-4 py-3",children:r}),e[0]=r,e[1]=u):u=e[1];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=a.jsx("div",{className:"border-t"}),e[2]=c):c=e[2];let h;e[3]!==o?(h=o?a.jsx("div",{className:"space-y-1.5 border-t px-4 py-3",children:o}):null,e[3]=o,e[4]=h):h=e[4];let p;e[5]!==n||e[6]!==h?(p=a.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[n,h]}),e[5]=n,e[6]=h,e[7]=p):p=e[7];let b;e[8]===Symbol.for("react.memo_cache_sentinel")?(b=a.jsx("div",{className:"border-t"}),e[8]=b):b=e[8];let f;e[9]!==l?(f=a.jsx("div",{className:"space-y-2 px-4 py-3",children:l}),e[9]=l,e[10]=f):f=e[10];let m;return e[11]!==d||e[12]!==s||e[13]!==i||e[14]!==u||e[15]!==p||e[16]!==f?(m=a.jsxs("div",{className:"flex min-h-0 flex-1 flex-col","data-publish-state":s,"aria-busy":i,children:[u,c,p,d,b,f]}),e[11]=d,e[12]=s,e[13]=i,e[14]=u,e[15]=p,e[16]=f,e[17]=m):m=e[17],m}function bs(t){const e=B.c(2),{children:s}=t;let r;return e[0]!==s?(r=a.jsx("div",{className:"scroll-fade min-h-0 flex-1 space-y-3 overflow-y-auto overscroll-contain px-4 pt-3 pb-2 [scrollbar-width:thin]",children:s}),e[0]=s,e[1]=r):r=e[1],r}function aa(t){const e=B.c(10);let s,r,n;e[0]!==t?({className:r,children:s,...n}=t,e[0]=t,e[1]=s,e[2]=r,e[3]=n):(s=e[1],r=e[2],n=e[3]);let o;e[4]!==r?(o=K("rounded-lg border bg-card px-3 py-2.5",r),e[4]=r,e[5]=o):o=e[5];let d;return e[6]!==s||e[7]!==n||e[8]!==o?(d=a.jsx("div",{className:o,...n,children:s}),e[6]=s,e[7]=n,e[8]=o,e[9]=d):d=e[9],d}function We(t){const e=B.c(4),{className:s}=t;let r;e[0]!==s?(r=K("animate-pulse rounded bg-muted motion-reduce:animate-none",s),e[0]=s,e[1]=r):r=e[1];let n;return e[2]!==r?(n=a.jsx("div",{className:r}),e[2]=r,e[3]=n):n=e[3],n}function Bt(){const t=B.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=a.jsx(aa,{children:a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsx(We,{className:"size-4 rounded-md"}),a.jsx(We,{className:"h-3 w-24"}),a.jsx(We,{className:"h-2.5 w-16"}),a.jsx(We,{className:"ml-auto size-6 rounded"})]})}),t[0]=e):e=t[0],e}const Wi="secret";function la(t){return t.kind!=="block"?null:t.namedRule??null}function Qi(t,e){const s=e.find(r=>r&&typeof r=="object");return s?Il(s.__resolveType):$l(t)}const Ji=/(?:^|\/)\.deco\/blocks\/([^/]+)\.json$/;function In(t){const e=Ji.exec(t)?.[1];return e?ii(e):null}function Us(t){if(!t)return null;try{const e=JSON.parse(t);if(e&&typeof e=="object"&&!Array.isArray(e))return e}catch{}return null}function Yi(t,e){return t===null?"new":e===null?"removed":"edited"}function ia(t){const e=t.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").trim();return e?(e.charAt(0).toUpperCase()+e.slice(1)).replace(/\s+[A-Z](?=[a-z])/g,s=>s.toLowerCase()):t}function ns(t,e,s=!1){if(t&&typeof t=="object"&&!Array.isArray(t)){const r=t.__resolveType;if(typeof r=="string"&&r.trim()){if(s)return Ia(r);const o=(r.split("/").pop()??r).replace(/\.[jt]sx?$/,"");return ia(o)||o}}return`Section ${e+1}`}function $n(t){if(mr(t))return t.value??null;const e=t.__resolveType;return typeof e=="string"&&$a(e)?t.section??null:null}const oa=6;function As(t,e=0){if(e>oa||!t||typeof t!="object")return[];if(Array.isArray(t))return t.flatMap(n=>As(n,e+1));const s=t;if(fn(s.__resolveType))return cn(s).flatMap(n=>As(n?.value,e+1));const r=$n(s);return r!==null?As(r,e+1):[s]}function cn(t){const e=t?.variants;return Array.isArray(e)?e.map(s=>s&&typeof s=="object"&&!Array.isArray(s)?s:null):[]}function Yn(t){let e=t;for(let s=0;s<oa;s++){if(!e||typeof e!="object"||Array.isArray(e))return null;const r=e;if(fn(r.__resolveType))return r;const n=$n(r);if(n===null)return null;e=n}return null}function Xi(t,e,s){const r=cn(Yn(t)),n=e?cn(Yn(e)):[],o=e?Array.from({length:Math.max(r.length,n.length)},(i,u)=>u).filter(i=>!Xs(r[i],n[i])):[],l=[...o.map(i=>r[i]??n[i]),...r.filter((i,u)=>!o.includes(u))].flatMap(i=>As(i?.value)).map(i=>ns(i,s,!0));return[...new Set(l)]}function rn(t,e,s,r,n){let o=t,d=!1;for(let i=0;i<4;i++){if(!o||typeof o!="object"||Array.isArray(o)){d=!0;break}const u=o;if(fn(u.__resolveType)){d=!0;break}const c=$n(u);if(c===null)break;o=c}const l=d?Xi(t,n,e):[];return{name:ns(d?t:o,e,!0),kind:"section",status:s,fields:r,...d?{wrapper:!0}:{},...l.length>0?{held:l}:{}}}function dn(t,e){const s=t.sections;if(Array.isArray(s))return s.flatMap((r,n)=>r&&typeof r=="object"&&!Array.isArray(r)?[{section:r,basePath:["sections",n]}]:[]);if(s&&typeof s=="object"){const r=s.variants;if(Array.isArray(r))return r.flatMap((n,o)=>{const d=n&&typeof n=="object"&&!Array.isArray(n)?n.value:null,l=e&&mr(d),i=l?d.value:d;if(!Array.isArray(i))return[];const u=l?["sections","variants",o,"value","value"]:["sections","variants",o,"value"];return i.flatMap((c,h)=>c&&typeof c=="object"&&!Array.isArray(c)?[{section:c,basePath:[...u,h]}]:[])})}return[]}function Xn(t){return JSON.stringify(t,(e,s)=>{if(s&&typeof s=="object"&&!Array.isArray(s)){const r=s;return Object.keys(r).sort().reduce((n,o)=>(n[o]=r[o],n),{})}return s})}function Xs(t,e){return t===void 0&&e===void 0?!0:Xn(t)===Xn(e)}function kt(t,e,s,r=new Set){const n=new Set([...Object.keys(t??{}),...Object.keys(e??{})]),o=[];for(const d of n){if(d.startsWith("__")||r.has(d))continue;const l=t?t[d]:void 0,i=e?e[d]:void 0;Xs(l,i)||o.push({label:ia(d),path:[...s,d],from:l,to:i})}return o}function Zi(t,e){const s=e.find(r=>r&&typeof r=="object");return s?s.__resolveType===zl:t===Ul}function eo(t,e){const s=n=>n===void 0||!!n&&typeof n=="object"&&!Array.isArray(n)&&!("__resolveType"in n),r=[];for(const n of kt(t,e,[])){const o=String(n.path[0]);s(n.from)&&s(n.to)?r.push(...kt(n.from??{},n.to??{},[o])):r.push(n)}return r}const to=new Set(["sections"]);function Fn(t,e,s=!1){const r=t?dn(t,s):[],n=e?dn(e,s):[],o=[],d=Math.max(r.length,n.length);for(let i=0;i<d;i++){const u=r[i],c=n[i];if(!s){const h=so(u,c,i);h&&o.push(h);continue}if(u&&c){if(Xs(u.section,c.section))continue;o.push(rn(c.section,i,"edited",kt(u.section,c.section,c.basePath),u.section))}else c?o.push(rn(c.section,i,"new",[])):u&&o.push(rn(u.section,i,"removed",[]))}const l=kt(t,e,[],to);return l.length>0&&o.push({name:"Page settings",kind:"settings",status:"edited",fields:l}),o}function so(t,e,s){return t&&e?Xs(t.section,e.section)?null:{name:ns(e.section,s),kind:"section",status:"edited",fields:kt(t.section,e.section,e.basePath)}:e?{name:ns(e.section,s),kind:"section",status:"new",fields:[]}:t?{name:ns(t.section,s),kind:"section",status:"removed",fields:[]}:null}function un(t,e){return{kind:"other",blockKey:null,name:t.split("/").pop()??t,pagePath:null,isSiteApp:!1,status:e,filepaths:[t],sections:[],fromJson:null,toJson:null}}function no(t){const e=[],s=[],r=[],n=[];for(const[o,d]of Object.entries(t?.diffs??{})){if(Cn(o)){n.push(o);continue}const l=Yi(d.from,d.to),i=In(o);if(!i){r.push(un(o,l));continue}const u=Us(d.from),c=Us(d.to),h=c??u;if(!h){r.push(un(o,l));continue}const p=ss(i,h);if(p){e.push({kind:"page",blockKey:i,name:p.name,pagePath:p.path,isSiteApp:!1,status:l,filepaths:[o],sections:l==="edited"?Fn(u,c):[],fromJson:u,toJson:c});continue}const b=Sn(i,h);s.push({kind:"block",blockKey:i,name:Es(i,h),pagePath:null,isSiteApp:b,status:l,filepaths:[o],sections:l==="edited"?[{name:Es(i,h),kind:"section",status:"edited",fields:kt(u,c,[])}].filter(f=>f.fields.length>0):[],fromJson:u,toJson:c})}return ca({pages:e,blocks:s,other:r,generated:n})}function an(t,e){return(t.filepaths[0]??"").localeCompare(e.filepaths[0]??"")}function ca(t){const{pages:e,blocks:s,other:r,generated:n}=t;return e.sort(an),s.sort(an),r.sort(an),{pages:e,blocks:s,other:r,generated:n,count:e.length+s.length+r.length}}function ro(t){return t==="added"?"new":t==="removed"?"removed":"edited"}function da(t){return t.startsWith("pages-")}function ua(t){const{files:e,lookup:s,diff:r}=t,n=[],o=[],d=[],l=[];for(const i of e){const u=i.path;if(Cn(u)){l.push(u);continue}const c=ro(i.status),h=In(u);if(!h){d.push(un(u,c));continue}const p=r?.diffs[u],b=Us(p?.from??null),f=Us(p?.to??null),m=ha(s,h),g=m??f??b;if((m?ss(h,m):null)??(!m&&da(h))){const j=g?ss(h,g):null;n.push({kind:"page",blockKey:h,name:j?.name??Yr(h),pagePath:j?.path??null,isSiteApp:!1,status:c,filepaths:[u],sections:c==="edited"?Fn(b,f):[],fromJson:b,toJson:f??(c==="new"?m:null)});continue}const P=Es(h,g??{});o.push({kind:"block",blockKey:h,name:P,pagePath:null,isSiteApp:Sn(h,m??{}),status:c,filepaths:[u],sections:c==="edited"?[{name:P,kind:"section",status:"edited",fields:kt(b,f,[])}].filter(j=>j.fields.length>0):[],fromJson:b,toJson:f})}return ca({pages:n,blocks:o,other:d,generated:l})}function ha(t,e){const s=t?.[e];return s&&typeof s=="object"&&!Array.isArray(s)?s:null}function ao(t,e){return t??e}function fa(t){return t.length<=1?t[0]??"":`${t.slice(0,-1).join(", ")} and ${t[t.length-1]}`}const ln=3;function Ss(t){if(t.length<=ln)return fa(t);const e=t.length-ln;return`${t.slice(0,ln).join(", ")} and ${e} more`}function lo(t,e){if(!e){const r=t.sections.filter(n=>n.kind==="section").map(n=>n.name).slice(0,3);return r.length>0?`${t.name} (${r.join(", ")})`:t.name}const s=[...new Set(t.sections.filter(r=>r.kind==="section").flatMap(r=>r.wrapper?r.held??[]:[r.name]))].slice(0,3);return s.length>0?`${t.name} (${s.join(", ")})`:t.name}function io(t){const e=la(t);return e==="experiments"?"A/B tests":e==="campaigns"?"Campaign dates":t.name}function oo(t){const e=[],s=t.pages.filter(l=>l.status==="edited"),r=t.pages.filter(l=>l.status==="new"),n=t.pages.filter(l=>l.status==="removed");if(s.length>0&&e.push(`updated ${Ss(s.map(l=>lo(l,!!t.v8)))}`),r.length>0){const l=r.length===1?"page":"pages";e.push(`added the ${Ss(r.map(i=>i.name))} ${l}`)}if(n.length>0){const l=n.length===1?"page":"pages";e.push(`removed the ${Ss(n.map(i=>i.name))} ${l}`)}const o=t.blocks.map(io);if(o.length>0&&e.push(`changed ${Ss(o)}`),t.other.length>0){const l=t.other.length===1?"file":"files";e.push(`changed ${t.other.length} ${l}`)}if(e.length===0)return"";const d=fa(e);return El(d.charAt(0).toUpperCase()+d.slice(1))}function co(t,e){return t?dn(t,e).length:0}function uo(t,e=!1){const s={newPageSections:t.kind==="page"&&t.status==="new"?co(t.toJson,e):null,sections:0,settings:!1,fields:0};if(s.newPageSections!==null)return s;for(const r of t.sections){if(r.kind==="settings"){s.settings=!0;continue}t.kind==="page"?s.sections+=1:s.fields+=r.fields.length}return s}const Zn="••••••";function ls(t){if(Array.isArray(t))return t.map(ls);if(!t||typeof t!="object")return t;const e=t,s={};for(const[r,n]of Object.entries(e))s[r]=ls(n);return e.__resolveType===Wi&&"ciphertext"in e&&(s.ciphertext=Zn),La(e)&&"encrypted"in e&&(s.encrypted=Zn),s}function er(t){return t.map(e=>({...e,from:ls(e.from),to:ls(e.to)}))}function ho(t){const{changes:e,sides:s,lookup:r,meta:n,hosted:o}=t,d=[],l=[],i=c=>[...new Set((s?.diagnostics??[]).filter(h=>Un(Fa(h.file))===Un(c)).map(h=>h.side))],u=Object.keys(e).sort((c,h)=>c<h?-1:c>h?1:0);for(const c of u){const h=e[c],p=h.kind==="delete"?"removed":h.baseVersion===null?"new":"edited",b=s?.entries[c],f=b?.before??null,m=b?.after??null,g=ha(r,c),x=g??m??f,P=i(c),j={blockKey:c,status:p,filepaths:[],entry:{name:c,version:h.version},...P.length>0?{unreadable:P}:{},fromJson:ls(f),toJson:ls(m??(p==="new"?g:null))},y=g?ss(c,g,n):null,S=!g&&x?ss(c,x,n):null;if(y??S??(!x&&da(c))){const v=x?ss(c,x,n):null;d.push({...j,kind:"page",name:v?.name??Yr(c),pagePath:v?.path??null,isSiteApp:!1,sections:p==="edited"?Fn(f,m,!0).map(A=>({...A,fields:er(A.fields)})):[]});continue}const w=o?Dl(c,x,g,m,f):null,k=w?Bl(w,[x,g,m,f]):Es(c,x??{}),N=Qi(c,[g,m,f]),C=Zi(c,[g,m,f]);l.push({...j,kind:"block",name:C?"Settings":k,...C?{cmsSettings:!0}:{},...w?{blogKind:w}:{},...N?{namedRule:N}:{},pagePath:null,isSiteApp:Sn(c,g??x??{}),sections:p==="edited"?[{name:C?"Settings":k,kind:"section",status:"edited",fields:er(C?eo(f,m):kt(f,m,[]))}].filter(v=>v.fields.length>0):[]})}return{pages:d,blocks:l,other:[],generated:[],count:d.length+l.length,v8:!0}}function ke(t){return t.filepaths[0]??t.blockKey??t.name}function fo(t,e){return e(t==="new"?"thread.publishPopover.chipNew":t==="removed"?"thread.publishPopover.chipRemoved":"thread.publishPopover.chipEdited")}function mo(t,e){const s=t.kind==="block"?Ql:Or;return a.jsx("span",{title:fo(t.status,e),className:"flex shrink-0",children:a.jsx(s,{className:K("size-4",t.status==="new"&&"text-brand",t.status==="edited"&&"text-warning",t.status==="removed"&&"text-destructive")})})}function po(t,e){if(t.kind==="page")return t.pagePath;if(t.kind!=="block")return null;if(t.blogKind)return Fl(t.blogKind,e);if(t.cmsSettings)return e("thread.publishPopover.settingsDetail");const s=la(t);return s==="experiments"?e("thread.publishPopover.abTests"):s==="campaigns"?e("thread.publishPopover.campaignDates"):t.isSiteApp?e("thread.publishPopover.siteConfiguration"):e("thread.publishPopover.globalSection")}function bo(t,e,s){const r=uo(t,s);if(r.newPageSections!==null)return[r.newPageSections===1?e("thread.publishPopover.newPageSectionOne"):e("thread.publishPopover.newPageSections",{count:r.newPageSections})];const n=[];return r.sections===1?n.push(e("thread.publishPopover.sectionChangedOne")):r.sections>1&&n.push(e("thread.publishPopover.sectionsChanged",{count:r.sections})),r.fields===1?n.push(e("thread.publishPopover.fieldChangedOne")):r.fields>1&&n.push(e("thread.publishPopover.fieldsChanged",{count:r.fields})),r.settings&&n.push(e("thread.publishPopover.pageSettingsChanged")),n}function ma(t){const e=B.c(46),{change:s,bodyPending:r,selected:n,onSelect:o,confirming:d,onConfirmingChange:l,onDiscard:i,isPublishing:u,isDiscarding:c,v8:h}=t,p=r===void 0?!1:r,b=h===void 0?!1:h,f=ge();let m;e[0]!==s||e[1]!==f?(m=po(s,f),e[0]=s,e[1]=f,e[2]=m):m=e[2];const g=m;let x;if(e[3]!==p||e[4]!==s||e[5]!==d||e[6]!==g||e[7]!==c||e[8]!==u||e[9]!==l||e[10]!==i||e[11]!==o||e[12]!==n||e[13]!==f||e[14]!==b){const P=bo(s,f,b),j=p&&P.length===0&&s.status==="edited",y=n&&"border-foreground/30 bg-accent hover:bg-secondary-hover";let S;e[16]!==y?(S=K("cursor-pointer transition-colors hover:bg-accent",y),e[16]=y,e[17]=S):S=e[17];let w;e[18]!==s?(w=ke(s),e[18]=s,e[19]=w):w=e[19];let k;e[20]!==s||e[21]!==f?(k=mo(s,f),e[20]=s,e[21]=f,e[22]=k):k=e[22];let N;e[23]!==s.cmsSettings||e[24]!==s.name||e[25]!==f?(N=s.cmsSettings?f("thread.publishPopover.settings"):s.name,e[23]=s.cmsSettings,e[24]=s.name,e[25]=f,e[26]=N):N=e[26];let C;e[27]!==N?(C=a.jsx("span",{className:"truncate text-sm font-medium",children:N}),e[27]=N,e[28]=C):C=e[28];let v;e[29]!==g?(v=g?a.jsx("span",{className:"truncate text-xs text-muted-foreground",children:g}):null,e[29]=g,e[30]=v):v=e[30];let A;e[31]!==n||e[32]!==C||e[33]!==v?(A=a.jsxs("button",{type:"button",className:"flex min-w-0 flex-1 items-center gap-2 text-left","aria-pressed":n,children:[C,v]}),e[31]=n,e[32]=C,e[33]=v,e[34]=A):A=e[34];let T;e[35]!==d||e[36]!==c||e[37]!==u||e[38]!==l||e[39]!==i||e[40]!==f?(T=d?a.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[a.jsx("button",{type:"button",className:"text-xs text-muted-foreground hover:text-foreground",onClick:M=>{M.stopPropagation(),l(!1)},children:f("thread.publishDialog.cancel")}),a.jsx("button",{type:"button",className:"text-xs font-medium text-destructive disabled:opacity-50",onClick:M=>{M.stopPropagation(),l(!1),i?.()},disabled:c,children:f("thread.publishPopover.discard")})]}):i?a.jsx(Gs,{children:a.jsxs(tt,{children:[a.jsx(st,{asChild:!0,children:a.jsx(xe,{type:"button",variant:"ghost-destructive",size:"icon-xs","aria-label":f("thread.publishPopover.discard"),className:"shrink-0 disabled:pointer-events-auto",onClick:M=>{M.stopPropagation(),l(!0)},disabled:u||c,children:a.jsx(Qs,{className:"size-3.5"})})}),a.jsx(nt,{children:f("thread.publishPopover.discard")})]})}):null,e[35]=d,e[36]=c,e[37]=u,e[38]=l,e[39]=i,e[40]=f,e[41]=T):T=e[41];let I;e[42]!==A||e[43]!==T||e[44]!==k?(I=a.jsxs("div",{className:"flex items-center gap-2.5",children:[k,A,T]}),e[42]=A,e[43]=T,e[44]=k,e[45]=I):I=e[45],x=a.jsxs(aa,{className:S,"data-change-id":w,onClick:o,children:[I,P.length>0?a.jsx("div",{className:"mt-1 space-y-0.5 pl-[26px] text-xs text-muted-foreground",children:P.map(go)}):j?a.jsx("div",{className:"mt-1 space-y-0.5 pl-[26px]",children:a.jsx(We,{className:"h-4 w-2/3"})}):null]}),e[3]=p,e[4]=s,e[5]=d,e[6]=g,e[7]=c,e[8]=u,e[9]=l,e[10]=i,e[11]=o,e[12]=n,e[13]=f,e[14]=b,e[15]=x}else x=e[15];return x}function go(t,e){return a.jsx("div",{className:"truncate",children:t},`${e}-${t}`)}function pa(){const t=B.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={width:-1,height:-1},t[0]=e):e=t[0];const[s,r]=q.useState(e);let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=l=>{if(!l)return;const i=()=>r(c=>c.width===l.clientWidth&&c.height===l.clientHeight?c:{width:l.clientWidth,height:l.clientHeight});i();const u=new ResizeObserver(i);return u.observe(l),()=>u.disconnect()},t[1]=n):n=t[1];const o=n;let d;return t[2]!==s?(d=[s,o],t[2]=s,t[3]=d):d=t[3],d}function xo(){return document.documentElement.classList.contains("dark")?"vs-dark":"vs"}const vo=[{width:"w-3/4",tone:"ctx"},{width:"w-1/2",tone:"del"},{width:"w-3/5",tone:"add"},{width:"w-2/5",tone:"ctx"},{width:"w-4/5",tone:"add"},{width:"w-1/2",tone:"ctx"}];function tr(t){const e=B.c(10),{height:s}=t,r=ge();let n;e[0]!==s?(n={height:s},e[0]=s,e[1]=n):n=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=vo.map(yo),e[2]=o):o=e[2];let d;e[3]!==r?(d=r("thread.publishDialog.openingComparison"),e[3]=r,e[4]=d):d=e[4];let l;e[5]!==d?(l=a.jsx("div",{className:"flex items-center justify-center pt-1 text-2xs text-muted-foreground",children:d}),e[5]=d,e[6]=l):l=e[6];let i;return e[7]!==n||e[8]!==l?(i=a.jsxs("div",{style:n,className:"flex w-full flex-col gap-1.5 overflow-hidden px-3 py-2",children:[o,l]}),e[7]=n,e[8]=l,e[9]=i):i=e[9],i}function yo(t,e){return a.jsxs("div",{className:K("flex items-center gap-2 rounded px-1 py-0.5",t.tone==="del"&&"bg-destructive/5",t.tone==="add"&&"bg-success/5"),children:[a.jsx("div",{className:K("h-2 w-4 shrink-0 animate-pulse rounded-sm bg-muted",t.tone==="del"&&"bg-destructive/20",t.tone==="add"&&"bg-success/25")}),a.jsx("div",{className:K("h-2 animate-pulse rounded-sm bg-muted",t.width,t.tone==="del"&&"bg-destructive/20",t.tone==="add"&&"bg-success/25")})]},e)}const ba={readOnly:!0,renderSideBySide:!1,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:12},jo={...ba,lineNumbersMinChars:3,lineDecorationsWidth:4,folding:!1,glyphMargin:!1,renderOverviewRuler:!1};function wo(t){const e=B.c(11),{diff:s,emptyMessage:r,rowClassName:n,onDiscardFile:o,hideFileRows:d,editorHeight:l}=t,i=r===void 0?"No file changes in the working tree":r,u=n===void 0?"px-6":n,c=d===void 0?!1:d,h=l===void 0?"380px":l,[p,b]=q.useState(null),[f,m]=q.useState(null);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=xo(),e[0]=g):g=e[0];const x=g;if(!s||Object.keys(s.diffs).length===0){let j;return e[1]!==i?(j=a.jsx("div",{className:"flex items-center justify-center py-10 text-sm text-muted-foreground",children:i}),e[1]=i,e[2]=j):j=e[2],j}let P;return e[3]!==s.diffs||e[4]!==f||e[5]!==h||e[6]!==p||e[7]!==c||e[8]!==o||e[9]!==u?(P=a.jsx("div",{className:"divide-y",children:Object.entries(s.diffs).map(j=>{const[y,S]=j,{from:w,to:k}=S,N=p===y,C=w===null,v=k===null,A=y.startsWith("/")?y.slice(1):y,T=A.lastIndexOf("/"),I=T>=0?A.slice(T+1):A,M=T>=0?A.slice(0,T):null,$=oi(y),H=C?"bg-success":v?"bg-destructive":"bg-warning";return c?a.jsx("div",{children:a.jsx(Gn,{original:w??"",modified:k??"",language:$,theme:x,height:h,loading:a.jsx(tr,{height:h}),options:jo})},y):a.jsxs("div",{children:[a.jsxs("div",{className:K("flex items-center gap-3 py-3 hover:bg-accent",u),children:[a.jsx("button",{type:"button",className:"flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground transition-transform hover:text-foreground",onClick:()=>b(N?null:y),children:a.jsx(hr,{className:K("h-3.5 w-3.5 transition-transform",N&&"rotate-90")})}),a.jsx("div",{className:K("h-2.5 w-2.5 shrink-0 rounded-full",H)}),a.jsx(Or,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),a.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:I}),M&&a.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:M}),o?a.jsxs(Ks,{children:[a.jsx(qs,{asChild:!0,children:a.jsx("button",{type:"button",className:"flex h-6 w-6 shrink-0 items-center justify-center text-muted-foreground hover:bg-accent hover:text-foreground rounded-lg",children:a.jsx(Oa,{className:"h-3.5 w-3.5"})})}),a.jsx(Hs,{align:"end",children:a.jsx(rs,{className:"text-destructive focus:text-destructive",onSelect:()=>m(y),children:"Discard changes"})})]}):null]}),f===y&&o?a.jsxs("div",{className:K("flex items-center justify-between gap-3 border-t bg-destructive/5 py-2.5",u),children:[a.jsxs("span",{className:"text-xs text-destructive",children:["Discard all changes to"," ",a.jsx("span",{className:"font-medium",children:I}),"? This cannot be undone."]}),a.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[a.jsx(xe,{type:"button",variant:"ghost",size:"sm",onClick:()=>m(null),children:"Cancel"}),a.jsx(xe,{type:"button",variant:"destructive",size:"sm",onClick:()=>{m(null),o(y)},children:"Discard"})]})]}):null,N&&a.jsx("div",{className:"border-t",children:a.jsx(Gn,{original:w??"",modified:k??"",language:$,theme:x,height:h,loading:a.jsx(tr,{height:h}),options:ba})})]},y)})}),e[3]=s.diffs,e[4]=f,e[5]=h,e[6]=p,e[7]=c,e[8]=o,e[9]=u,e[10]=P):P=e[10],P}function Po(t){if(t.kind!=="block"||t.isSiteApp||!t.blockKey)return null;const e=(t.toJson??t.fromJson)?.__resolveType;return typeof e=="string"&&di(e)?t.blockKey:null}function So(t){return t.kind!=="page"?!0:!t.pagePath||St(t.pagePath).length>0}function ko(t,e){try{return Wa(t,Ol,e)}catch{return null}}function No(t,e,s){if(!e)return;const r=Ll(e,t);if(!r)return null;if(St(r.path).length===0||s?.path!==r.path)return r.path;const n=kn(r.path,s.params);return St(n).length===0?n:r.path}function Co(t){return t.sectionKey&&!t.v8?ko(t.previewServerUrl,t.sectionKey):Ro(t.previewServerUrl,t.path)}function Ao(t,e){if(t.kind!=="page")return"/";const s=t.pagePath;if(!s)return"";if(St(s).length===0)return s;if(e?.path!==s)return"";const r=kn(s,e.params);return St(r).length===0?r:""}function Ro(t,e){const s=e.trim();if(!s||St(s).length>0)return null;try{const r=new URL(t),n=new URL(s.startsWith("/")?s:`/${s}`,r);return n.origin===r.origin?n:null}catch{return null}}function To(t,e){return e?.kind==="pointer"&&e.link?vn(t.toString(),e.link):ga(t,e)}function ga(t,e){if(!e)return null;if(e.kind==="pointer")return vn(t.toString(),e.pointer);try{return new URL(`${t.pathname}${t.search}`,e.previewUrl).href}catch{return null}}function Do(t,e,s){return e===null?!1:t!=="other"||s?.kind==="sandbox"}function Bo(t,e){const s=e?t.kind==="page":t.kind!=="other";return{before:s&&t.status==="new"?"new":null,after:s&&t.status==="removed"?"removed":null}}const xa=q.createContext(!0),Io=["split","before","after","code"];function $o(t){return Io.includes(t)}const va={desktop:1280,mobile:412};function Fo(t,e){const s=(o,d)=>t.unreadable?.includes(d)?e:o?`${JSON.stringify(o,null,2)}
2
- `:null,r=t.status==="new"?null:s(t.fromJson,"before"),n=t.status==="removed"?null:s(t.toJson,"after");return r===null&&n===null?{diffs:{}}:t.status==="edited"&&(r===null||n===null)?{diffs:{}}:{diffs:{[Ea(t.entry.name)]:{from:r,to:n}}}}function ya(t){const e=B.c(76),{change:s,diff:r,bodyPending:n,previewServerUrl:o,draft:d,lastPage:l,v8:i,onReady:u}=t,c=ge(),h=q.use(xa),p=Po(s),b=i?null:p,f=i?p:null,m=f?No(f,i?.blocks,l):void 0,g=f!==null&&m===null,x=Do(s.kind,o,d)&&(f===null||typeof m=="string"),[P,j]=q.useState(null),y=x?P??"split":"code",[S,w]=q.useState("desktop"),[k,N]=q.useState(null),C=k??(f?m??"":Ao(s,l));let v;e[0]!==s?(v=So(s),e[0]=s,e[1]=v):v=e[1];const A=v,T=o?Co({previewServerUrl:o,sectionKey:p,path:C,v8:!!i}):null,I=T?vn(T.toString(),Qa):null,M=T?ga(T,d):null,$=T?To(T,d):null;let H;e[2]!==s||e[3]!==r?.diffs||e[4]!==c?(H=s.entry?Fo(s,c("thread.publishCompare.sideUnreadable")):{diffs:Object.fromEntries(s.filepaths.flatMap(J=>{const me=r?.diffs[J];return me?[[J,me]]:[]}))},e[2]=s,e[3]=r?.diffs,e[4]=c,e[5]=H):H=e[5];const O=H;let G;e[6]!==O.diffs?(G=Object.keys(O.diffs),e[6]=O.diffs,e[7]=G):G=e[7];const E=G.length>0;let W;e:{if(b!==null){W=null;break e}if(f!==null){const me=C.trim();if(!me){W=null;break e}W=St(me).length>0?c("thread.publishCompare.dynamicHint",{template:me}):c("thread.publishCompare.blockHint",{path:me});break e}if(s.kind!=="page"){let me;e[8]!==c?(me=c("thread.publishCompare.globalHint"),e[8]=c,e[9]=me):me=e[9],W=me;break e}let J;e[10]!==s.pagePath||e[11]!==c?(J=s.pagePath&&St(s.pagePath).length>0?c("thread.publishCompare.dynamicHint",{template:s.pagePath}):null,e[10]=s.pagePath,e[11]=c,e[12]=J):J=e[12],W=J}const F=W,V=Bo(s,!!i),[te,Y]=q.useState(Lo);let re;e[13]===Symbol.for("react.memo_cache_sentinel")?(re=J=>Y(me=>me.has(J)?me:new Set(me).add(J)),e[13]=re):re=e[13];const le=re;let _;e[14]!==i?(_=J=>i?a.jsx(_o,{...J,onLoaded:le}):a.jsx(Mo,{...J}),e[14]=i,e[15]=_):_=e[15];const X=_,Z=(x?[V.before==="new"?null:I,V.after==="removed"?null:M].flatMap(J=>J?[Bn(J,S)]:[]):[]).every(J=>te.has(J));let se;e[16]!==u||e[17]!==Z?(se=Z&&u?J=>{J&&u()}:void 0,e[16]=u,e[17]=Z,e[18]=se):se=e[18];const ie=se,ue=V.before==="new"?a.jsx(ks,{icon:a.jsx(zr,{className:"size-5 text-brand"}),title:c("thread.publishCompare.newTitle"),description:c("thread.publishCompare.newDescription")}):X({url:I,device:S,title:c("thread.publishCompare.before"),missing:c("thread.publishCompare.enterPath")}),he=V.after==="removed"?a.jsx(ks,{icon:a.jsx(Qs,{className:"size-5 text-destructive"}),title:c("thread.publishCompare.removedTitle"),description:c("thread.publishCompare.removedDescription")}):X({url:M,device:S,title:c("thread.publishCompare.after"),missing:c(T?"thread.publishCompare.draftUnavailable":"thread.publishCompare.enterPath")});let ne;e[19]!==x||e[20]!==j||e[21]!==h||e[22]!==c||e[23]!==y?(ne=x||h?a.jsx($r,{value:y,onValueChange:J=>{$o(J)&&j(J)},children:a.jsxs(Ir,{className:"h-8 w-auto",variant:"pill",children:[x?a.jsxs(a.Fragment,{children:[a.jsx(Dt,{value:"split",className:"px-3 text-xs",children:c("thread.publishCompare.sideBySide")}),a.jsx(Dt,{value:"before",className:"px-3 text-xs",children:c("thread.publishCompare.before")}),a.jsx(Dt,{value:"after",className:"px-3 text-xs",children:c("thread.publishCompare.after")})]}):null,h?a.jsx(Dt,{value:"code",className:"px-3 text-xs",children:c("thread.publishCompare.code")}):null]})}):null,e[19]=x,e[20]=j,e[21]=h,e[22]=c,e[23]=y,e[24]=ne):ne=e[24];let oe;e[25]!==$||e[26]!==x||e[27]!==s.pagePath||e[28]!==S||e[29]!==C||e[30]!==A||e[31]!==b||e[32]!==w||e[33]!==N||e[34]!==c||e[35]!==y?(oe=x&&y!=="code"?a.jsxs(a.Fragment,{children:[b?null:A?a.jsx(Ma,{value:C,onChange:J=>N(J.target.value),placeholder:s.pagePath??"/","aria-label":c("thread.publishCompare.pathLabel"),className:"h-8 w-56 font-mono text-xs"}):a.jsx("span",{className:"max-w-56 truncate px-1 font-mono text-xs text-muted-foreground",children:C}),a.jsxs("div",{className:"flex items-center rounded-lg border p-0.5",children:[a.jsx(sr,{active:S==="desktop",label:c("thread.publishCompare.desktop"),onClick:()=>w("desktop"),children:a.jsx(ci,{className:"size-3.5"})}),a.jsx(sr,{active:S==="mobile",label:c("thread.publishCompare.mobile"),onClick:()=>w("mobile"),children:a.jsx(fl,{className:"size-3.5"})})]}),$?a.jsxs("a",{href:$,target:"_blank",rel:"noopener noreferrer",className:"ml-auto flex items-center gap-1.5 text-xs text-muted-foreground transition-colors hover:text-foreground",children:[a.jsx(_a,{className:"size-3.5"}),c("thread.publishCompare.openDraft")]}):null]}):null,e[25]=$,e[26]=x,e[27]=s.pagePath,e[28]=S,e[29]=C,e[30]=A,e[31]=b,e[32]=w,e[33]=N,e[34]=c,e[35]=y,e[36]=oe):oe=e[36];let fe;e[37]!==ne||e[38]!==oe?(fe=a.jsxs("div",{className:"flex flex-wrap items-center gap-2 border-b bg-background px-4 py-2.5 max-md:pr-12",children:[ne,oe]}),e[37]=ne,e[38]=oe,e[39]=fe):fe=e[39];let z;e[40]!==x||e[41]!==F||e[42]!==y?(z=F&&x&&y!=="code"?a.jsx("p",{className:"border-b bg-background px-4 py-1.5 text-2xs text-muted-foreground",children:F}):null,e[40]=x,e[41]=F,e[42]=y,e[43]=z):z=e[43];let ce;e[44]!==g||e[45]!==h||e[46]!==c?(ce=g&&h?a.jsx("p",{className:"border-b bg-background px-4 py-1.5 text-2xs text-muted-foreground",children:c("thread.publishCompare.notOnAnyPage")}):null,e[44]=g,e[45]=h,e[46]=c,e[47]=ce):ce=e[47];let Pe;e[48]!==o||e[49]!==h||e[50]!==c||e[51]!==f||e[52]!==m||e[53]!==y?(Pe=y==="code"&&!h?f!==null&&m===void 0?a.jsx(We,{className:"m-4 h-64 rounded"}):o===null?a.jsx(ks,{icon:a.jsx(Ms,{className:"size-5 text-muted-foreground"}),title:c("thread.publishCompare.previewNotReadyTitle"),description:c("thread.publishCompare.draftUnavailable")}):a.jsx(ks,{icon:a.jsx(Ms,{className:"size-5 text-muted-foreground"}),title:c("thread.publishCompare.noPreviewTitle"),description:c("thread.publishCompare.noPreviewDescription")}):null,e[48]=o,e[49]=h,e[50]=c,e[51]=f,e[52]=m,e[53]=y,e[54]=Pe):Pe=e[54];let Q;e[55]!==n||e[56]!==E||e[57]!==O||e[58]!==h||e[59]!==c||e[60]!==y?(Q=y==="code"&&h?a.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto bg-background [scrollbar-width:thin]",children:E?a.jsx(wo,{diff:O,hideFileRows:!0,editorHeight:"70vh"}):n?a.jsx(We,{className:"m-4 h-64 rounded"}):a.jsx("p",{className:"px-4 py-6 text-xs text-muted-foreground",children:c("thread.publishPopover.detailsUnavailable")})}):null,e[55]=n,e[56]=E,e[57]=O,e[58]=h,e[59]=c,e[60]=y,e[61]=Q):Q=e[61];let ee;e[62]!==he||e[63]!==ue||e[64]!==x||e[65]!==c||e[66]!==y?(ee=x?a.jsxs("div",{className:K("flex min-h-0 flex-1 gap-3 p-3",y==="code"&&"hidden"),children:[a.jsx(nr,{label:c("thread.publishCompare.before"),hidden:y==="after",children:ue}),a.jsx(nr,{label:c("thread.publishCompare.after"),highlight:!0,hidden:y==="before",children:he})]}):null,e[62]=he,e[63]=ue,e[64]=x,e[65]=c,e[66]=y,e[67]=ee):ee=e[67];let ve;return e[68]!==ie||e[69]!==fe||e[70]!==z||e[71]!==ce||e[72]!==Pe||e[73]!==Q||e[74]!==ee?(ve=a.jsxs("div",{ref:ie,className:"flex min-h-0 min-w-0 flex-1 flex-col bg-muted/40",children:[fe,z,ce,Pe,Q,ee]}),e[68]=ie,e[69]=fe,e[70]=z,e[71]=ce,e[72]=Pe,e[73]=Q,e[74]=ee,e[75]=ve):ve=e[75],ve}function Lo(){return new Set}function sr(t){const e=B.c(8),{active:s,label:r,onClick:n,children:o}=t,d=s&&"bg-accent text-foreground";let l;e[0]!==d?(l=K("flex size-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:text-foreground",d),e[0]=d,e[1]=l):l=e[1];let i;return e[2]!==s||e[3]!==o||e[4]!==r||e[5]!==n||e[6]!==l?(i=a.jsx("button",{type:"button","aria-label":r,"aria-pressed":s,title:r,onClick:n,className:l,children:o}),e[2]=s,e[3]=o,e[4]=r,e[5]=n,e[6]=l,e[7]=i):i=e[7],i}function nr(t){const e=B.c(18),{label:s,highlight:r,hidden:n,children:o}=t,d=r===void 0?!1:r,i=(n===void 0?!1:n)&&"hidden";let u;e[0]!==i?(u=K("flex min-h-0 min-w-0 flex-1 flex-col gap-1.5",i),e[0]=i,e[1]=u):u=e[1];const c=d&&"bg-brand";let h;e[2]!==c?(h=K("size-1.5 rounded-full bg-muted-foreground/50",c),e[2]=c,e[3]=h):h=e[3];let p;e[4]!==h?(p=a.jsx("span",{className:h}),e[4]=h,e[5]=p):p=e[5];let b;e[6]!==s||e[7]!==p?(b=a.jsxs("div",{className:"flex items-center gap-1.5 px-0.5 text-2xs font-medium text-muted-foreground",children:[p,s]}),e[6]=s,e[7]=p,e[8]=b):b=e[8];const f=d&&"border-brand/60";let m;e[9]!==f?(m=K("relative min-h-0 flex-1 overflow-hidden rounded-lg border bg-background",f),e[9]=f,e[10]=m):m=e[10];let g;e[11]!==o||e[12]!==m?(g=a.jsx("div",{className:m,children:o}),e[11]=o,e[12]=m,e[13]=g):g=e[13];let x;return e[14]!==g||e[15]!==u||e[16]!==b?(x=a.jsxs("div",{className:u,children:[b,g]}),e[14]=g,e[15]=u,e[16]=b,e[17]=x):x=e[17],x}function ks(t){const e=B.c(10),{icon:s,title:r,description:n}=t;let o;e[0]!==s?(o=a.jsx("div",{className:"mb-1",children:s}),e[0]=s,e[1]=o):o=e[1];let d;e[2]!==r?(d=a.jsx("p",{className:"text-sm font-medium",children:r}),e[2]=r,e[3]=d):d=e[3];let l;e[4]!==n?(l=a.jsx("p",{className:"text-xs text-muted-foreground",children:n}),e[4]=n,e[5]=l):l=e[5];let i;return e[6]!==o||e[7]!==d||e[8]!==l?(i=a.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-1 px-6 text-center",children:[o,d,l]}),e[6]=o,e[7]=d,e[8]=l,e[9]=i):i=e[9],i}function Oo(t,e){if(!t)return{visibility:"hidden",width:e};const s=Math.min(t.width/e,1);return{left:Math.max((t.width-e*s)/2,0),width:e,height:t.height/s,transform:`scale(${s})`,transformOrigin:"top left"}}function Mo(t){const e=B.c(24),{url:s,device:r,title:n,missing:o}=t,[d,l]=pa(),[i,u]=q.useState(null);if(!s){let w;return e[0]!==o?(w=a.jsx("p",{className:"flex h-full items-center justify-center px-6 text-center text-xs text-muted-foreground",children:o}),e[0]=o,e[1]=w):w=e[1],w}let c;e[2]!==r||e[3]!==s?(c=Bn(s,r),e[2]=r,e[3]=s,e[4]=c):c=e[4];const h=c,p=va[r],b=d.width>0?Math.min(d.width/p,1):1,f=d.width>0?Math.max((d.width-p*b)/2,0):0;let m;e[5]!==h?(m=()=>u(h),e[5]=h,e[6]=m):m=e[6];const g=d.height>0?d.height/b:"100%",x=`scale(${b})`;let P;e[7]!==p||e[8]!==f||e[9]!==g||e[10]!==x?(P={left:f,width:p,height:g,transform:x,transformOrigin:"top left"},e[7]=p,e[8]=f,e[9]=g,e[10]=x,e[11]=P):P=e[11];let j;e[12]!==h||e[13]!==m||e[14]!==P||e[15]!==n?(j=a.jsx("iframe",{src:h,title:n,sandbox:"allow-scripts allow-same-origin",onLoad:m,className:"absolute top-0 border-0 bg-white",style:P},h),e[12]=h,e[13]=m,e[14]=P,e[15]=n,e[16]=j):j=e[16];let y;e[17]!==i||e[18]!==h?(y=i!==h?a.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background/60",children:a.jsx(as,{className:"size-5 motion-reduce:animate-none"})}):null,e[17]=i,e[18]=h,e[19]=y):y=e[19];let S;return e[20]!==l||e[21]!==j||e[22]!==y?(S=a.jsxs("div",{ref:l,className:"absolute inset-0",children:[j,y]}),e[20]=l,e[21]=j,e[22]=y,e[23]=S):S=e[23],S}function _o(t){const e=B.c(21),{url:s,device:r,title:n,missing:o,onLoaded:d}=t,[l,i]=pa(),[u,c]=q.useState(null),[h,p]=q.useState(null),b=l.width>0&&l.height>0;b&&(u?.width!==l.width||u?.height!==l.height)&&c(l);const f=b?l:u;if(!s){let S;return e[0]!==o?(S=a.jsx("p",{className:"flex h-full items-center justify-center px-6 text-center text-xs text-muted-foreground",children:o}),e[0]=o,e[1]=S):S=e[1],S}let m,g,x,P;if(e[2]!==f||e[3]!==r||e[4]!==d||e[5]!==i||e[6]!==h||e[7]!==n||e[8]!==s){const S=Bn(s,r),w=va[r];m=h?.src!==S;const k=[...h&&m?[h]:[],{src:S,logicalWidth:w}];g=i,x="absolute inset-0",P=k.map(N=>{const C=N.src===S&&m;return a.jsx("iframe",{src:N.src,title:n,"aria-hidden":C&&h?!0:void 0,sandbox:"allow-scripts allow-same-origin",onLoad:()=>{N.src===S&&(p(N),d?.(N.src))},className:K("absolute top-0 border-0 bg-white",C&&"pointer-events-none opacity-0"),style:Oo(f,N.logicalWidth)},N.src)}),e[2]=f,e[3]=r,e[4]=d,e[5]=i,e[6]=h,e[7]=n,e[8]=s,e[9]=m,e[10]=g,e[11]=x,e[12]=P}else m=e[9],g=e[10],x=e[11],P=e[12];let j;e[13]!==m||e[14]!==h?(j=m?h?a.jsx(as,{className:"absolute right-2 top-2 size-4 text-muted-foreground motion-reduce:animate-none"}):a.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background/60",children:a.jsx(as,{className:"size-5 motion-reduce:animate-none"})}):null,e[13]=m,e[14]=h,e[15]=j):j=e[15];let y;return e[16]!==g||e[17]!==x||e[18]!==P||e[19]!==j?(y=a.jsxs("div",{ref:g,className:x,children:[P,j]}),e[16]=g,e[17]=x,e[18]=P,e[19]=j,e[20]=y):y=e[20],y}const Eo=/^Co-authored-by:\s*([^<\r\n]+?)(?:\s*<[^>\r\n]*>)?\s*$/im;function zo(t){if(!t)return null;const e=Eo.exec(t)?.[1]?.trim();return e||null}function Uo(t){return/\[bot\]$/i.test(t)||/-bot$/i.test(t)}function qo(t){const e=zo(t.body);if(e)return e;const s=t.author.trim();return!s||Uo(s)?null:s}function Ho(t,e,s,r,n,o){return["cms-publish-bodies",t,e,s,r,n,o]}const Ko=6e4;function Vo(t,e){return e?null:t.files.map(s=>`${s.index}${s.working_dir} ${s.path}`).sort().join(`
3
- `)}function Go(t,e,s){const r=B.c(6);let n;r[0]!==s||r[1]!==t||r[2]!==e?(n=os.decofile(`${t}/${e}/${s}`),r[0]=s,r[1]=t,r[2]=e,r[3]=n):n=r[3];let o;r[4]!==n?(o={queryKey:n,queryFn:mn},r[4]=n,r[5]=o):o=r[5];const{data:d}=dt(o);return d}function ja(t){const{orgSlug:e,virtualMcpId:s,branch:r,threadId:n,baseBranch:o,fastPreview:d,recoverSandbox:l}=t,i={orgSlug:e,virtualMcpId:s,branch:r,threadId:n},u=d?{fastPreview:!0}:void 0,c=q.useRef(null),h=async S=>{try{return await S()}catch(w){if(!l||!Xr(w))throw w;return c.current??=l(),await c.current,S()}},p=pr({...An(i),queryFn:()=>h(()=>Zr(i))}),b=p.data,f=b.changedFiles??null,m=b.headSha??null,g=f?f.length>0:Yl(b)||Xl(b),x=dt({queryKey:Ho(e,s,r,o,m,Vo(b,d)),queryFn:()=>h(()=>Zl(i,b,o,u)),enabled:g,staleTime:d?Ko:0,gcTime:d?void 0:0,throwOnError:(S,w)=>!f&&w.state.data===void 0}),P=Go(e,s,r),j=x.data??null,y=f?ua({files:f,lookup:P,diff:j}):no(j);return{status:b,summary:y,allPaths:f?f.map(S=>S.path):Object.keys(j?.diffs??{}),discardablePaths:d?null:new Set(b.files.map(S=>S.path)),changedFilesTotal:b.changedFilesTotal??y.count,changedFilesTruncated:b.changedFilesTruncated??!1,headSha:m,diff:j,bodiesPending:g&&x.isPending,bodiesFailed:x.isError,cardsPending:!f&&g&&x.isPending,refresh:()=>Promise.all([p.refetch(),d?null:x.refetch()])}}function Wo(t){const e=B.c(4);let s;e[0]!==t?(s=os.decofile(t),e[0]=t,e[1]=s):s=e[1];let r;e[2]!==s?(r={queryKey:s,queryFn:mn},e[2]=s,e[3]=r):r=e[3];const{data:n}=dt(r);return n}function Qo(t,e){const s=B.c(5);let r;s[0]!==t||s[1]!==e?(r=e?Ya(e,t):os.liveMeta("","no-scope"),s[0]=t,s[1]=e,s[2]=r):r=s[2];let n;s[3]!==r?(n={queryKey:r,queryFn:mn},s[3]=r,s[4]=n):n=s[4];const{data:o}=dt(n);return o}function Ln(t){const e=B.c(27),{backend:s,cacheKey:r,scope:n}=t,o=br();let d;e[0]!==r?(d=os.contentChanges(r),e[0]=r,e[1]=d):d=e[1];let l;e[2]!==s.client||e[3]!==r||e[4]!==o?(l=()=>Xa(o,s.client,r),e[2]=s.client,e[3]=r,e[4]=o,e[5]=l):l=e[5];let i;e[6]!==d||e[7]!==l?(i={queryKey:d,queryFn:l,staleTime:0},e[6]=d,e[7]=l,e[8]=i):i=e[8];const u=pr(i),c=u.data,h=Ja(s,r,c),p=Wo(r),b=Qo(s,n),f=h.data??null,m=s.source==="github";let g;e[9]!==c.changes||e[10]!==p||e[11]!==b||e[12]!==f||e[13]!==m?(g=ho({changes:c.changes,sides:f,lookup:p,meta:b,hosted:m}),e[9]=c.changes,e[10]=p,e[11]=b,e[12]=f,e[13]=m,e[14]=g):g=e[14];const x=g;let P;e[15]!==c.changes?(P=Object.entries(c.changes).map(Jo),e[15]=c.changes,e[16]=P):P=e[16];const j=x.count>0&&h.isPending,y=p??null;let S;e[17]!==u?(S=()=>u.refetch(),e[17]=u,e[18]=S):S=e[18];let w;return e[19]!==c||e[20]!==h.isError||e[21]!==x||e[22]!==P||e[23]!==j||e[24]!==y||e[25]!==S?(w={changes:c,summary:x,entries:P,sidesPending:j,sidesFailed:h.isError,blocks:y,refresh:S},e[19]=c,e[20]=h.isError,e[21]=x,e[22]=P,e[23]=j,e[24]=y,e[25]=S,e[26]=w):w=e[26],w}function Jo(t){const[e,s]=t;return{name:e,version:s.version}}function Yo(t){return["smart-review-verdict",t.orgSlug,t.virtualMcpId,t.branch,t.threadId,t.fastPreview?"fast-preview-upstream":"sandbox",t.signature,t.language]}function Xo(t){const e=B.c(27),{orgSlug:s,virtualMcpId:r,branch:n,threadId:o,fastPreview:d,status:l,diff:i,enabled:u}=t,[c]=gr(),{language:h}=c;let p,b,f;if(e[0]!==n||e[1]!==i||e[2]!==u||e[3]!==d||e[4]!==h||e[5]!==s||e[6]!==l||e[7]!==o||e[8]!==r){const S=i?Rn(i):"";p=u&&!!n&&!!l&&!!i&&S!=="",f=dt,b=Yo({orgSlug:s,virtualMcpId:r,branch:n,threadId:o,fastPreview:d,signature:S,language:h}),e[0]=n,e[1]=i,e[2]=u,e[3]=d,e[4]=h,e[5]=s,e[6]=l,e[7]=o,e[8]=r,e[9]=p,e[10]=b,e[11]=f}else p=e[9],b=e[10],f=e[11];let m;e[12]!==n||e[13]!==i||e[14]!==h||e[15]!==s||e[16]!==l||e[17]!==o||e[18]!==r?(m=()=>ei({orgSlug:s,virtualMcpId:r,branch:n,threadId:o},{status:l,diff:i,language:h}),e[12]=n,e[13]=i,e[14]=h,e[15]=s,e[16]=l,e[17]=o,e[18]=r,e[19]=m):m=e[19];let g;e[20]!==p||e[21]!==b||e[22]!==m?(g={queryKey:b,queryFn:m,enabled:p,staleTime:1/0,gcTime:6e5,retry:Zo},e[20]=p,e[21]=b,e[22]=m,e[23]=g):g=e[23];const x=f(g),P=x.data??null,j=p&&x.isFetching&&!x.data;let y;return e[24]!==P||e[25]!==j?(y={verdict:P,loading:j},e[24]=P,e[25]=j,e[26]=y):y=e[26],y}function Zo(t,e){return!Xr(e)&&t<1}function wa(t){const e=B.c(30),{orgSlug:s,virtualMcpId:r,branch:n,threadId:o,fastPreview:d,status:l,diff:i,policy:u,judgeEnabled:c,paths:h}=t,p=c===void 0?!0:c,b=h===void 0?null:h;let f;e[0]!==i||e[1]!==p||e[2]!==u?(f=p&&ti(i,u),e[0]=i,e[1]=p,e[2]=u,e[3]=f):f=e[3];const m=f;let g;e[4]!==n||e[5]!==i||e[6]!==d||e[7]!==m||e[8]!==s||e[9]!==l||e[10]!==o||e[11]!==r?(g={orgSlug:s,virtualMcpId:r,branch:n,threadId:o,fastPreview:d,status:l,diff:i,enabled:m},e[4]=n,e[5]=i,e[6]=d,e[7]=m,e[8]=s,e[9]=l,e[10]=o,e[11]=r,e[12]=g):g=e[12];const{verdict:x,loading:P}=Xo(g);if(!i&&b){let w;e[13]!==b||e[14]!==u?(w=si(b,u),e[13]=b,e[14]=u,e[15]=w):w=e[15];let k;return e[16]!==w?(k={gate:w,ready:!1},e[16]=w,e[17]=k):k=e[17],k}if(!i){let w;return e[18]===Symbol.for("react.memo_cache_sentinel")?(w={gate:{allowed:!0,reason:null},ready:!1},e[18]=w):w=e[18],w}if(!m){let w;e[19]!==i||e[20]!==u?(w=ni(i,u),e[19]=i,e[20]=u,e[21]=w):w=e[21];let k;return e[22]!==w?(k={gate:w,ready:!0},e[22]=w,e[23]=k):k=e[23],k}let j;e[24]!==P||e[25]!==x?(j=ri(x,P),e[24]=P,e[25]=x,e[26]=j):j=e[26];const y=!P;let S;return e[27]!==j||e[28]!==y?(S={gate:j,ready:y},e[27]=j,e[28]=y,e[29]=S):S=e[29],S}function ec(t){return["main","master"].includes(t.trim().toLowerCase())}function tc(t,e,s,r){return t===0?r("thread.publishPopover.publish"):s||!ec(e)?t===1?r("thread.publishPopover.publishOne"):r("thread.publishPopover.publishCount",{count:t}):t===1?r("thread.publishPopover.publishOneInProduction"):r("thread.publishPopover.publishCountInProduction",{count:t})}const sc=2500;function nc(t){const{selectedId:e,readyIds:s,lastShownId:r,liveIds:n}=t;return e===null||s.has(e)?e:r!==null&&r!==e&&n.includes(r)?r:e}function Pa(t){const e=B.c(16),s=q.useRef(!1),r=ge();let n;e[0]!==t?(n=h=>{!h&&s.current||t.onOpenChange(h)},e[0]=t,e[1]=n):n=e[1];const o=n;let d;e[2]!==t.mode||e[3]!==r?(d=t.mode==="review"?r("thread.publishPopover.submitForReview"):r("thread.publishPopover.publish"),e[2]=t.mode,e[3]=r,e[4]=d):d=e[4];let l;e[5]!==d?(l=a.jsx(vr,{className:"sr-only",children:d}),e[5]=d,e[6]=l):l=e[6];let i;e[7]!==t?(i=a.jsx(rc,{...t,publishLockRef:s}),e[7]=t,e[8]=i):i=e[8];let u;e[9]!==l||e[10]!==i?(u=a.jsxs(yr,{"aria-describedby":void 0,className:"flex h-[calc(100dvh-2rem)] w-[calc(100vw-2rem)] max-w-none flex-col md:flex-row md:h-[calc(100dvh-6rem)] md:w-[calc(100vw-6rem)] gap-0 overflow-hidden p-0 sm:max-w-none",closeButtonClassName:"top-3.5 right-3.5",children:[l,i]}),e[9]=l,e[10]=i,e[11]=u):u=e[11];let c;return e[12]!==o||e[13]!==t.open||e[14]!==u?(c=a.jsx(xr,{open:t.open,onOpenChange:o,children:u}),e[12]=o,e[13]=t.open,e[14]=u,e[15]=c):c=e[15],c}function rc(t){const e=B.c(3),s=It(t.virtualMcpId,t.branch),r=s.kind==="protocol"&&s.source==="github";let n;return e[0]!==r||e[1]!==t?(n=Gi({open:t.open,hosted:r})?a.jsx(ic,{...t}):null,e[0]=r,e[1]=t,e[2]=n):n=e[2],n}const ac=4,is="flex h-[45%] min-h-0 min-w-0 shrink-0 md:h-auto md:flex-1";function vs(t){const e=B.c(5),{list:s,pane:r}=t;let n;e[0]!==s?(n=a.jsx("div",{className:"flex min-h-0 w-full flex-1 flex-col max-md:border-t md:w-[380px] md:flex-none md:shrink-0 md:border-l md:[&>[data-publish-state]>:first-child]:pr-12",children:s}),e[0]=s,e[1]=n):n=e[1];let o;return e[2]!==r||e[3]!==n?(o=a.jsxs(a.Fragment,{children:[r,n]}),e[2]=r,e[3]=n,e[4]=o):o=e[4],o}function On(){const t=B.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=a.jsx("div",{className:K(is,"bg-muted/40 p-3"),children:a.jsx(We,{className:"h-full w-full rounded-lg"})}),t[0]=e):e=t[0],e}function Mn(t){const e=B.c(11),{mode:s,title:r,subLine:n,trailing:o}=t,d=s==="review"?Ws:ml;let l;e[0]!==d?(l=a.jsx(d,{className:"size-4 shrink-0 text-muted-foreground"}),e[0]=d,e[1]=l):l=e[1];let i;e[2]!==l||e[3]!==r||e[4]!==o?(i=a.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[l,r,o]}),e[2]=l,e[3]=r,e[4]=o,e[5]=i):i=e[5];let u;e[6]!==n?(u=n?a.jsx("div",{className:"pl-6 text-xs text-muted-foreground",children:n}):null,e[6]=n,e[7]=u):u=e[7];let c;return e[8]!==i||e[9]!==u?(c=a.jsxs(a.Fragment,{children:[i,u]}),e[8]=i,e[9]=u,e[10]=c):c=e[10],c}function _n(t){const e=B.c(9),{draftPreviewUrl:s,t:r}=t;let n;e[0]!==s?(n=()=>{s&&window.open(s,"_blank","noopener,noreferrer")},e[0]=s,e[1]=n):n=e[1];const o=!s;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=a.jsx(Ms,{className:"size-4"}),e[2]=d):d=e[2];let l;e[3]!==r?(l=r("thread.publishPopover.preview"),e[3]=r,e[4]=l):l=e[4];let i;return e[5]!==n||e[6]!==o||e[7]!==l?(i=a.jsxs(xe,{type:"button",variant:"outline",onClick:n,disabled:o,children:[d,l]}),e[5]=n,e[6]=o,e[7]=l,e[8]=i):i=e[8],i}function Sa(t){const e=B.c(21),{mode:s,draftPreviewUrl:r}=t,n=ge();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(On,{}),e[0]=o):o=e[0];let d;e[1]===Symbol.for("react.memo_cache_sentinel")?(d=a.jsx(We,{className:"h-3.5 w-48"}),e[1]=d):d=e[1];let l;e[2]!==s?(l=a.jsx(Mn,{mode:s,title:d}),e[2]=s,e[3]=l):l=e[3];let i,u;e[4]===Symbol.for("react.memo_cache_sentinel")?(i=a.jsx(bs,{children:a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(Bt,{}),a.jsx(Bt,{}),a.jsx(Bt,{})]})}),u=a.jsxs(a.Fragment,{children:[a.jsx(We,{className:"h-3 w-20"}),a.jsx(We,{className:"h-14 w-full rounded-lg"})]}),e[4]=i,e[5]=u):(i=e[4],u=e[5]);let c;e[6]!==r||e[7]!==n?(c=a.jsx(_n,{draftPreviewUrl:r,t:n}),e[6]=r,e[7]=n,e[8]=c):c=e[8];const h=s==="review"?"default":"brand";let p;e[9]!==s||e[10]!==n?(p=n(s==="review"?"thread.publishPopover.submitForReview":"thread.publishPopover.publish"),e[9]=s,e[10]=n,e[11]=p):p=e[11];let b;e[12]!==h||e[13]!==p?(b=a.jsx(xe,{type:"button",variant:h,className:"flex-1",disabled:!0,children:p}),e[12]=h,e[13]=p,e[14]=b):b=e[14];let f;e[15]!==c||e[16]!==b?(f=a.jsxs("div",{className:"flex gap-2",children:[c,b]}),e[15]=c,e[16]=b,e[17]=f):f=e[17];let m;return e[18]!==f||e[19]!==l?(m=a.jsx(vs,{pane:o,list:a.jsx(Ys,{state:"loading",header:l,body:i,note:u,footer:f})}),e[18]=f,e[19]=l,e[20]=m):m=e[20],m}function lc(t){const e=B.c(26),{mode:s,draftPreviewUrl:r,message:n,onRetry:o}=t,d=ge();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=a.jsx("div",{className:K(is,"bg-muted/40")}),e[0]=l):l=e[0];let i;e[1]!==d?(i=d("thread.publishPopover.loadFailed"),e[1]=d,e[2]=i):i=e[2];let u;e[3]!==i?(u=a.jsx("span",{className:"truncate",children:i}),e[3]=i,e[4]=u):u=e[4];let c;e[5]!==s||e[6]!==u?(c=a.jsx(Mn,{mode:s,title:u}),e[5]=s,e[6]=u,e[7]=c):c=e[7];let h;e[8]!==n?(h=a.jsx("p",{className:"px-4 py-6 text-xs text-destructive",children:n}),e[8]=n,e[9]=h):h=e[9];let p;e[10]!==r||e[11]!==d?(p=a.jsx(_n,{draftPreviewUrl:r,t:d}),e[10]=r,e[11]=d,e[12]=p):p=e[12];let b;e[13]===Symbol.for("react.memo_cache_sentinel")?(b=a.jsx(bn,{className:"size-4"}),e[13]=b):b=e[13];let f;e[14]!==d?(f=d("thread.publishPopover.retry"),e[14]=d,e[15]=f):f=e[15];let m;e[16]!==o||e[17]!==f?(m=a.jsxs(xe,{type:"button",variant:"outline",className:"flex-1",onClick:o,children:[b,f]}),e[16]=o,e[17]=f,e[18]=m):m=e[18];let g;e[19]!==p||e[20]!==m?(g=a.jsxs("div",{className:"flex gap-2",children:[p,m]}),e[19]=p,e[20]=m,e[21]=g):g=e[21];let x;return e[22]!==g||e[23]!==c||e[24]!==h?(x=a.jsx(vs,{pane:l,list:a.jsx(Ys,{state:"ready",header:c,body:h,footer:g})}),e[22]=g,e[23]=c,e[24]=h,e[25]=x):x=e[25],x}function ic(t){const e=B.c(3),s=t.mode??"publish";let r;return e[0]!==s||e[1]!==t?(r=a.jsx(jr,{children:n=>{const{reset:o}=n;return a.jsx(wr,{fallback:d=>{const{error:l,resetError:i}=d;return a.jsx(lc,{mode:s,draftPreviewUrl:t.draftPreviewUrl,message:l?.message??"",onRetry:()=>{o(),i()}})},children:a.jsx(q.Suspense,{fallback:a.jsx(Sa,{mode:s,draftPreviewUrl:t.draftPreviewUrl}),children:a.jsx(oc,{...t})})})}}),e[0]=s,e[1]=t,e[2]=r):r=e[2],r}function oc(t){const e=B.c(13),s=It(t.virtualMcpId,t.branch);let r;e[0]!==t.branch||e[1]!==t.orgSlug||e[2]!==t.virtualMcpId?(r={orgSlug:t.orgSlug,virtualMcpId:t.virtualMcpId,branch:t.branch},e[0]=t.branch,e[1]=t.orgSlug,e[2]=t.virtualMcpId,e[3]=r):r=e[3];const n=yn(r);if(s.kind==="protocol"&&n){let d;return e[4]!==s||e[5]!==n||e[6]!==t?(d=s.source==="sandbox"?a.jsx(uc,{...t,backend:s,cacheKey:n}):a.jsx(dc,{...t,backend:s,cacheKey:n}),e[4]=s,e[5]=n,e[6]=t,e[7]=d):d=e[7],d}if(s.kind!=="legacy"){const d=t.mode??"publish";let l;return e[8]!==t.draftPreviewUrl||e[9]!==d?(l=a.jsx(Sa,{mode:d,draftPreviewUrl:t.draftPreviewUrl}),e[8]=t.draftPreviewUrl,e[9]=d,e[10]=l):l=e[10],l}let o;return e[11]!==t?(o=a.jsx(cc,{...t}),e[11]=t,e[12]=o):o=e[12],o}function cc(t){const e=B.c(52),s=cs()?.taskId??null;let r;e[0]!==t.baseBranch||e[1]!==t.branch||e[2]!==t.fastPreview||e[3]!==t.orgSlug||e[4]!==t.recoverSandbox||e[5]!==t.virtualMcpId||e[6]!==s?(r={orgSlug:t.orgSlug,virtualMcpId:t.virtualMcpId,branch:t.branch,threadId:s,baseBranch:t.baseBranch,fastPreview:t.fastPreview,recoverSandbox:t.recoverSandbox},e[0]=t.baseBranch,e[1]=t.branch,e[2]=t.fastPreview,e[3]=t.orgSlug,e[4]=t.recoverSandbox,e[5]=t.virtualMcpId,e[6]=s,e[7]=r):r=e[7];const n=ja(r),o=t.mode!=="review";let d;e[8]!==t.branch||e[9]!==t.fastPreview||e[10]!==t.orgSlug||e[11]!==t.publishPolicy||e[12]!==t.virtualMcpId||e[13]!==n.allPaths||e[14]!==n.diff||e[15]!==n.status||e[16]!==o||e[17]!==s?(d={orgSlug:t.orgSlug,virtualMcpId:t.virtualMcpId,branch:t.branch,threadId:s,fastPreview:t.fastPreview,status:n.status,diff:n.diff,paths:n.allPaths,policy:t.publishPolicy,judgeEnabled:o},e[8]=t.branch,e[9]=t.fastPreview,e[10]=t.orgSlug,e[11]=t.publishPolicy,e[12]=t.virtualMcpId,e[13]=n.allPaths,e[14]=n.diff,e[15]=n.status,e[16]=o,e[17]=s,e[18]=d):d=e[18];const{gate:l}=wa(d),i=n.discardablePaths;let u;e[19]!==i?(u=P=>i===null||P.every(j=>i.has(j)),e[19]=i,e[20]=u):u=e[20];const c=u;let h;e[21]!==c?(h=P=>c(P.filepaths),e[21]=c,e[22]=h):h=e[22];let p;e[23]!==c||e[24]!==n.allPaths||e[25]!==n.changedFilesTruncated?(p=!n.changedFilesTruncated&&c(n.allPaths),e[23]=c,e[24]=n.allPaths,e[25]=n.changedFilesTruncated,e[26]=p):p=e[26];let b;e[27]!==t.branch||e[28]!==n.status?(b=Tn(n.status)??t.branch,e[27]=t.branch,e[28]=n.status,e[29]=b):b=e[29];const f=n.headSha??void 0;let m;e[30]!==t.fastPreview||e[31]!==n.diff?(m=!t.fastPreview&&n.diff?{expectedDiffSignature:Rn(n.diff)}:{},e[30]=t.fastPreview,e[31]=n.diff,e[32]=m):m=e[32];let g;e[33]!==l||e[34]!==n.allPaths||e[35]!==n.bodiesFailed||e[36]!==n.bodiesPending||e[37]!==n.cardsPending||e[38]!==n.changedFilesTotal||e[39]!==n.changedFilesTruncated||e[40]!==n.diff||e[41]!==n.refresh||e[42]!==n.summary||e[43]!==h||e[44]!==p||e[45]!==b||e[46]!==f||e[47]!==m?(g={summary:n.summary,allPaths:n.allPaths,canDiscard:h,canDiscardAll:p,changedFilesTotal:n.changedFilesTotal,changedFilesTruncated:n.changedFilesTruncated,diff:n.diff,bodiesPending:n.bodiesPending,bodiesFailed:n.bodiesFailed,cardsPending:n.cardsPending,refresh:n.refresh,gate:l,headBranch:b,expectedHeadSha:f,...m,hosted:!1,otherWork:!1},e[33]=l,e[34]=n.allPaths,e[35]=n.bodiesFailed,e[36]=n.bodiesPending,e[37]=n.cardsPending,e[38]=n.changedFilesTotal,e[39]=n.changedFilesTruncated,e[40]=n.diff,e[41]=n.refresh,e[42]=n.summary,e[43]=h,e[44]=p,e[45]=b,e[46]=f,e[47]=m,e[48]=g):g=e[48];let x;return e[49]!==t||e[50]!==g?(x=a.jsx(En,{...t,source:g}),e[49]=t,e[50]=g,e[51]=x):x=e[51],x}function ka(t,e){return{summary:t.summary,allPaths:[],canDiscard:()=>!0,canDiscardAll:!0,changedFilesTotal:t.summary.count,changedFilesTruncated:!1,diff:null,bodiesPending:t.sidesPending,bodiesFailed:t.sidesFailed,cardsPending:!1,refresh:t.refresh,protocol:{backend:e,entries:t.entries},v8:{blocks:t.blocks}}}function dc(t){const e=B.c(23);let s,r,n;e[0]!==t?({backend:s,cacheKey:r,...n}=t,e[0]=t,e[1]=s,e[2]=r,e[3]=n):(s=e[1],r=e[2],n=e[3]);let o;e[4]!==n.branch||e[5]!==n.orgSlug||e[6]!==n.virtualMcpId?(o={orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch},e[4]=n.branch,e[5]=n.orgSlug,e[6]=n.virtualMcpId,e[7]=o):o=e[7];let d;e[8]!==s||e[9]!==r||e[10]!==o?(d={backend:s,cacheKey:r,scope:o},e[8]=s,e[9]=r,e[10]=o,e[11]=d):d=e[11];const l=Ln(d),i=s.source==="github";let u;e[12]!==s||e[13]!==l?(u=ka(l,s),e[12]=s,e[13]=l,e[14]=u):u=e[14];let c;e[15]===Symbol.for("react.memo_cache_sentinel")?(c={allowed:!0,reason:null},e[15]=c):c=e[15];let h;e[16]!==i||e[17]!==n.branch||e[18]!==u?(h={...u,gate:c,headBranch:n.branch,hosted:i,otherWork:!1},e[16]=i,e[17]=n.branch,e[18]=u,e[19]=h):h=e[19];let p;return e[20]!==n||e[21]!==h?(p=a.jsx(En,{...n,source:h}),e[20]=n,e[21]=h,e[22]=p):p=e[22],p}function uc(t){const e=B.c(58);let s,r,n;e[0]!==t?({backend:s,cacheKey:r,...n}=t,e[0]=t,e[1]=s,e[2]=r,e[3]=n):(s=e[1],r=e[2],n=e[3]);const o=cs()?.taskId??null;let d;e[4]!==n.branch||e[5]!==n.orgSlug||e[6]!==n.virtualMcpId?(d={orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch},e[4]=n.branch,e[5]=n.orgSlug,e[6]=n.virtualMcpId,e[7]=d):d=e[7];let l;e[8]!==s||e[9]!==r||e[10]!==d?(l={backend:s,cacheKey:r,scope:d},e[8]=s,e[9]=r,e[10]=d,e[11]=l):l=e[11];const i=Ln(l);let u;e[12]!==n.baseBranch||e[13]!==n.branch||e[14]!==n.fastPreview||e[15]!==n.orgSlug||e[16]!==n.recoverSandbox||e[17]!==n.virtualMcpId||e[18]!==o?(u={orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch,threadId:o,baseBranch:n.baseBranch,fastPreview:n.fastPreview,recoverSandbox:n.recoverSandbox},e[12]=n.baseBranch,e[13]=n.branch,e[14]=n.fastPreview,e[15]=n.orgSlug,e[16]=n.recoverSandbox,e[17]=n.virtualMcpId,e[18]=o,e[19]=u):u=e[19];const c=ja(u),h=n.mode!=="review";let p;e[20]!==c.allPaths||e[21]!==c.diff||e[22]!==c.status||e[23]!==n.branch||e[24]!==n.fastPreview||e[25]!==n.orgSlug||e[26]!==n.publishPolicy||e[27]!==n.virtualMcpId||e[28]!==h||e[29]!==o?(p={orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch,threadId:o,fastPreview:n.fastPreview,status:c.status,diff:c.diff,paths:c.allPaths,policy:n.publishPolicy,judgeEnabled:h},e[20]=c.allPaths,e[21]=c.diff,e[22]=c.status,e[23]=n.branch,e[24]=n.fastPreview,e[25]=n.orgSlug,e[26]=n.publishPolicy,e[27]=n.virtualMcpId,e[28]=h,e[29]=o,e[30]=p):p=e[30];const{gate:b}=wa(p);let f;if(e[31]!==c.allPaths||e[32]!==i){let k;e[34]!==i?(k=N=>{const C=In(N);return C===null?!Cn(N):!Object.hasOwn(i.changes.changes,C)},e[34]=i,e[35]=k):k=e[35],f=c.allPaths.some(k),e[31]=c.allPaths,e[32]=i,e[33]=f}else f=e[33];const m=f;let g;e[36]!==s||e[37]!==i?(g=ka(i,s),e[36]=s,e[37]=i,e[38]=g):g=e[38];let x;e[39]!==c||e[40]!==i?(x=()=>Promise.all([i.refresh(),c.refresh()]),e[39]=c,e[40]=i,e[41]=x):x=e[41];let P;e[42]!==c.status||e[43]!==n.branch?(P=Tn(c.status)??n.branch,e[42]=c.status,e[43]=n.branch,e[44]=P):P=e[44];const j=c.headSha??void 0;let y;e[45]!==c.diff?(y=c.diff?{expectedDiffSignature:Rn(c.diff)}:{},e[45]=c.diff,e[46]=y):y=e[46];let S;e[47]!==b||e[48]!==m||e[49]!==j||e[50]!==y||e[51]!==g||e[52]!==x||e[53]!==P?(S={...g,refresh:x,gate:b,headBranch:P,expectedHeadSha:j,...y,hosted:!1,otherWork:m},e[47]=b,e[48]=m,e[49]=j,e[50]=y,e[51]=g,e[52]=x,e[53]=P,e[54]=S):S=e[54];let w;return e[55]!==n||e[56]!==S?(w=a.jsx(En,{...n,source:S}),e[55]=n,e[56]=S,e[57]=w):w=e[57],w}function En(t){const e=B.c(130),{source:s,publishLockRef:r,onOpenChange:n,mode:o,fastPreview:d,orgSlug:l,virtualMcpId:i,branch:u,baseBranch:c,repoTarget:h,owner:p,repo:b,draftPreviewUrl:f,destinationHost:m,previewServerUrl:g,compareDraft:x,lastPublishedPr:P,onRequestApproval:j,openPullRequest:y,onPullRequestChanged:S,onPublished:w}=t,k=o===void 0?"publish":o,N=P===void 0?null:P,C=y===void 0?null:y,v=ge(),[A]=gr(),{language:T}=A,I=cs()?.taskId??null,{data:M}=Vs.useSession(),$=Sr(kr(l,i,u)),{allPaths:H,changedFilesTotal:O,changedFilesTruncated:G,diff:E,bodiesFailed:W,refresh:F,gate:V,hosted:te,otherWork:Y}=s;let re;e[0]!==x||e[1]!==s.bodiesPending||e[2]!==s.cardsPending||e[3]!==s.summary?(re={summary:s.summary,cardsPending:s.cardsPending,bodiesPending:s.bodiesPending,compareDraft:x},e[0]=x,e[1]=s.bodiesPending,e[2]=s.cardsPending,e[3]=s.summary,e[4]=re):re=e[4];const le=re;let _;e[5]!==te?(_={hosted:te},e[5]=te,e[6]=_):_=e[6];const X=Vi(le,_),{summary:D,cardsPending:Z,bodiesPending:se,compareDraft:ie}=X.shown,[ue,he]=q.useState(null),[ne,oe]=q.useState(!1),[fe,z]=q.useState(hc);let ce;e[7]===Symbol.for("react.memo_cache_sentinel")?(ce=U=>z(ae=>ae.has(U)?ae:new Set(ae).add(U)),e[7]=ce):ce=e[7];const Pe=ce,[Q,ee]=q.useState(null);let ve;e[8]===Symbol.for("react.memo_cache_sentinel")?(ve=[],e[8]=ve):ve=e[8];const[J,me]=q.useState(ve);let we;e[9]!==s.v8?(we=U=>{ee(U),me(ae=>[U,...ae.filter(de=>de!==U)]),s.v8&&setTimeout(()=>Pe(U),sc)},e[9]=s.v8,e[10]=we):we=e[10];const rt=we,[ye,_e]=q.useState(null);let Ee;e[11]!==ue||e[12]!==D?(Ee=ao(ue,oo(D)),e[11]=ue,e[12]=D,e[13]=Ee):Ee=e[13];const Ne=Ee,De=[...D.pages,...D.blocks,...D.other],Le=De.find(U=>ke(U)===Q)??De[0]??null,Ce=Le?ke(Le):null,ut=[...new Set([...Ce?[Ce]:[],...J,...De.map(ke)])].filter(U=>De.some(ae=>ke(ae)===U)).slice(0,ac),Oe=!!s.v8,[Qe,ze]=q.useState(null),Ue=Oe?nc({selectedId:Ce,readyIds:fe,lastShownId:Qe,liveIds:ut}):Ce;Oe&&Ue===Ce&&Ue!==Qe&&ze(Ue);const L=k==="review"&&!te,pe=Z?"loading":se?"manifest":"ready",Ae=C?.state==="open",Be=s.headBranch,Te=M?.user;let qe;e[14]!==Te?(qe=ra(Te),e[14]=Te,e[15]=qe):qe=e[15];let Ie;e[16]!==s.expectedDiffSignature?(Ie=s.expectedDiffSignature?{expectedDiffSignature:s.expectedDiffSignature}:{},e[16]=s.expectedDiffSignature,e[17]=Ie):Ie=e[17];let at;e[18]!==c||e[19]!==u||e[20]!==d||e[21]!==l||e[22]!==p||e[23]!==b||e[24]!==h||e[25]!==s.expectedHeadSha||e[26]!==s.headBranch||e[27]!==qe||e[28]!==Ie||e[29]!==I||e[30]!==i?(at={orgSlug:l,virtualMcpId:i,branch:u,threadId:I,fastPreview:d,baseBranch:c,target:h,owner:p,repo:b,headBranch:Be,coAuthor:qe,expectedHeadSha:s.expectedHeadSha,...Ie},e[18]=c,e[19]=u,e[20]=d,e[21]=l,e[22]=p,e[23]=b,e[24]=h,e[25]=s.expectedHeadSha,e[26]=s.headBranch,e[27]=qe,e[28]=Ie,e[29]=I,e[30]=i,e[31]=at):at=e[31];const us=at,hs=L?"review":"publish",ht=M?.user?.name;let Ft;e[32]!==H||e[33]!==m||e[34]!==te||e[35]!==Ne||e[36]!==n||e[37]!==w||e[38]!==S||e[39]!==r||e[40]!==F||e[41]!==s.protocol||e[42]!==hs||e[43]!==ht||e[44]!==us?(Ft={mode:hs,target:us,note:Ne,allPaths:H,destinationHost:m,publishLockRef:r,onOpenChange:n,refresh:F,onPullRequestChanged:S,onPublished:w,hosted:te,authorName:ht,protocol:s.protocol},e[32]=H,e[33]=m,e[34]=te,e[35]=Ne,e[36]=n,e[37]=w,e[38]=S,e[39]=r,e[40]=F,e[41]=s.protocol,e[42]=hs,e[43]=ht,e[44]=us,e[45]=Ft):Ft=e[45];const{isPublishing:Se,publishError:Lt,publishErrorDetail:lt,submit:Nt,discardChange:Ot,discardAll:fs}=ql(Ft),Je=Rr(l,i).phase==="saving",Ct=D.count>0||Y,Mt=!Se&&Ct&&(L||V.allowed);let it;e[46]!==c||e[47]!==L||e[48]!==s.v8||e[49]!==D.count||e[50]!==v?(it=L?D.count===0?v("thread.publishPopover.submitForReview"):D.count===1?v("thread.publishPopover.submitOneForReview"):v("thread.publishPopover.submitCountForReview",{count:D.count}):tc(D.count,c,!!s.v8,v),e[46]=c,e[47]=L,e[48]=s.v8,e[49]=D.count,e[50]=v,e[51]=it):it=e[51];const At=it;let ft;e:{if(L&&Ae){let de;e[52]!==C.number||e[53]!==v?(de=v("thread.publishPopover.updatesPullRequest",{number:C.number}),e[52]=C.number,e[53]=v,e[54]=de):de=e[54],ft=de;break e}const U=N;if(!U?.mergedAt){ft=null;break e}let ae;if(e[55]!==T||e[56]!==U||e[57]!==v){const de=za(new Date(U.mergedAt),T),je=qo(U);ae=je?v("thread.publishPopover.lastPublishedBy",{when:de,name:je}):v("thread.publishPopover.lastPublished",{when:de}),e[55]=T,e[56]=U,e[57]=v,e[58]=ae}else ae=e[58];ft=ae}const mt=ft;let _t;e[59]!==L||e[60]!==D.count||e[61]!==v?(_t=L?v("thread.publishPopover.submitForReview"):D.count===1?v("thread.publishPopover.publishOne"):D.count>1?v("thread.publishPopover.publishCount",{count:D.count}):v("thread.publishPopover.publish"),e[59]=L,e[60]=D.count,e[61]=v,e[62]=_t):_t=e[62];const Rt=_t,Tt=(U,ae)=>ae.length===0?null:a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("div",{className:"px-0.5 text-2xs font-medium text-muted-foreground",children:U}),ae.map(de=>{const je=ke(de);return a.jsx(ma,{change:de,bodyPending:se,selected:Le!==null&&ke(Le)===je,onSelect:()=>rt(je),confirming:ye===je,onConfirmingChange:Re=>_e(Re?je:null),onDiscard:s.canDiscard(de)?()=>{Ot(de)}:void 0,isPublishing:Se,isDiscarding:Je,v8:!!s.v8},je)})]});let pt;e:{if(L||!Ct){pt=null;break e}if(V.pending){let je;e[63]===Symbol.for("react.memo_cache_sentinel")?(je=a.jsx(as,{className:"size-3.5 motion-reduce:animate-none"}),e[63]=je):je=e[63];let Re;e[64]!==v?(Re=v("thread.publishPopover.reviewing"),e[64]=v,e[65]=Re):Re=e[65];let Ke;e[66]!==Re?(Ke=a.jsxs("div",{className:"flex items-center gap-2 border-t px-4 py-2.5 text-xs text-muted-foreground",children:[je,Re]}),e[66]=Re,e[67]=Ke):Ke=e[67],pt=Ke;break e}if(V.allowed){pt=null;break e}let U;e[68]===Symbol.for("react.memo_cache_sentinel")?(U=a.jsx(pn,{className:"mt-0.5 size-3.5 shrink-0"}),e[68]=U):U=e[68];let ae;e[69]!==V.reason||e[70]!==v?(ae=V.reason??v("thread.publishPopover.needsReviewGeneric"),e[69]=V.reason,e[70]=v,e[71]=ae):ae=e[71];let de;e[72]!==ae?(de=a.jsxs("div",{className:"flex items-start gap-2 border-t px-4 py-2.5 text-xs text-warning",children:[U,a.jsx("span",{children:ae})]}),e[72]=ae,e[73]=de):de=e[73],pt=de}const bt=pt;let gt;e[74]!==fs||e[75]!==ne||e[76]!==Je||e[77]!==Se||e[78]!==s.canDiscardAll||e[79]!==D.count||e[80]!==v?(gt=D.count<=1||!s.canDiscardAll?null:a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:"ml-auto shrink-0 text-2xs text-muted-foreground transition-colors hover:text-destructive disabled:opacity-50",onClick:()=>oe(!0),disabled:Se||Je,children:v("thread.publishPopover.discardAll")}),a.jsx(Os,{open:ne,onOpenChange:oe,children:a.jsxs(Ls,{children:[a.jsxs(Bs,{children:[a.jsx(Ts,{children:v("thread.publishPopover.discardAllTitle")}),a.jsx(Ds,{children:v("thread.publishPopover.discardAllConfirm")})]}),a.jsxs(Fs,{children:[a.jsx(Is,{children:v("thread.publishDialog.cancel")}),a.jsx($s,{onClick:()=>{fs()},disabled:Je,className:K(Pr({variant:"destructive"})),children:v("thread.publishPopover.discardAll")})]})]})})]}),e[74]=fs,e[75]=ne,e[76]=Je,e[77]=Se,e[78]=s.canDiscardAll,e[79]=D.count,e[80]=v,e[81]=gt):gt=e[81];const xt=gt,vt=Z?a.jsx(bs,{children:a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(Bt,{}),a.jsx(Bt,{})]})}):D.count===0&&Y?a.jsx("p",{className:"px-4 py-6 text-xs text-muted-foreground",children:v("thread.publishPopover.onlyOtherWork")}):D.count===0?a.jsxs("div",{className:"flex flex-col items-center gap-1 py-10 text-center",children:[a.jsx(Nn,{className:"mb-1 size-5 text-success"}),a.jsx("p",{className:"text-sm font-medium",children:v(L?"thread.publishPopover.nothingToSubmit":"thread.publishPopover.everythingLive")}),a.jsx("p",{className:"text-xs text-muted-foreground",children:v(L?"thread.publishPopover.submitEmptyHint":"thread.publishPopover.emptyHint")})]}):a.jsxs(bs,{children:[G?a.jsx("p",{className:"text-2xs text-muted-foreground",children:v("thread.publishPopover.showingFirst",{shown:D.count,total:O})}):null,Tt(v("thread.publishPopover.pagesGroup"),D.pages),Tt(v("thread.publishPopover.blocksGroup"),D.blocks),Tt(v("thread.publishPopover.otherGroup"),D.other),W?a.jsx("p",{className:"text-2xs text-muted-foreground",children:v("thread.publishPopover.detailsUnavailable")}):null,Y?a.jsx("p",{className:"text-2xs text-muted-foreground",children:v("thread.publishPopover.alsoOtherWork")}):null]}),yt=Z?a.jsx(On,{}):Le?a.jsx("div",{className:K(is,"relative"),children:De.filter(U=>ut.includes(ke(U))).map(U=>a.jsx("div",{className:K("absolute inset-0 flex",Oe?ke(U)===Ue?"z-10":"pointer-events-none opacity-0":ke(U)!==Ce&&"hidden"),inert:Oe&&ke(U)!==Ue,"aria-hidden":Oe&&ke(U)!==Ue?!0:void 0,children:a.jsx(ya,{change:U,diff:E,bodyPending:se,previewServerUrl:g,draft:ie,lastPage:$,v8:s.v8,onReady:Oe?()=>Pe(ke(U)):void 0})},ke(U)))}):a.jsx("div",{className:K(is,"bg-muted/40")});let Ye;e[82]!==At?(Ye=a.jsx("span",{className:"truncate",children:At}),e[82]=At,e[83]=Ye):Ye=e[83];let jt;e[84]!==xt||e[85]!==k||e[86]!==mt||e[87]!==Ye?(jt=a.jsx(Mn,{mode:k,title:Ye,subLine:mt,trailing:xt}),e[84]=xt,e[85]=k,e[86]=mt,e[87]=Ye,e[88]=jt):jt=e[88];let wt;e[89]!==Se||e[90]!==L||e[91]!==Ne||e[92]!==D.count||e[93]!==v?(wt=D.count===0?null:a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"text-sm font-medium",children:v(L?"thread.publishPopover.reviewNote":"thread.publishPopover.versionNote")}),a.jsx(Ml,{value:Ne,onChange:U=>he(U.target.value),placeholder:v(L?"thread.publishPopover.reviewNotePlaceholder":"thread.publishPopover.versionNotePlaceholder"),rows:2,maxLength:Hl,className:"resize-none text-sm",disabled:Se})]}),e[89]=Se,e[90]=L,e[91]=Ne,e[92]=D.count,e[93]=v,e[94]=wt):wt=e[94];let $e;e[95]!==f||e[96]!==v?($e=a.jsx(_n,{draftPreviewUrl:f,t:v}),e[95]=f,e[96]=v,e[97]=$e):$e=e[97];let Fe;e[98]!==Mt||e[99]!==V||e[100]!==Ct||e[101]!==te||e[102]!==Se||e[103]!==L||e[104]!==j||e[105]!==Rt||e[106]!==X||e[107]!==Nt||e[108]!==v?(Fe=!L&&!te&&Ct&&!V.allowed&&!V.pending?a.jsx(xe,{type:"button",className:"flex-1",onClick:j,disabled:Se,children:v("thread.publishPopover.requestApproval")}):a.jsxs(xe,{type:"button",variant:L?"default":"brand",className:"flex-1",onClick:()=>{X.hold(),Nt().then(U=>{U===!1&&X.release()})},disabled:!Mt,children:[Se?a.jsx(as,{className:"size-4 motion-reduce:animate-none"}):null,Se?v(L?"thread.publishPopover.submitting":"thread.publishPopover.publishing"):Rt]}),e[98]=Mt,e[99]=V,e[100]=Ct,e[101]=te,e[102]=Se,e[103]=L,e[104]=j,e[105]=Rt,e[106]=X,e[107]=Nt,e[108]=v,e[109]=Fe):Fe=e[109];let Xe;e[110]!==$e||e[111]!==Fe?(Xe=a.jsxs("div",{className:"flex gap-2",children:[$e,Fe]}),e[110]=$e,e[111]=Fe,e[112]=Xe):Xe=e[112];let He;e[113]!==Lt||e[114]!==lt||e[115]!==v?(He=Lt?a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-destructive",children:Lt}),lt?a.jsx(Za,{label:v("siteEditor.details"),detail:lt}):null]}):null,e[113]=Lt,e[114]=lt,e[115]=v,e[116]=He):He=e[116];let Pt;e[117]!==Xe||e[118]!==He?(Pt=a.jsxs(a.Fragment,{children:[Xe,He]}),e[117]=Xe,e[118]=He,e[119]=Pt):Pt=e[119];let Ze;e[120]!==vt||e[121]!==bt||e[122]!==pe||e[123]!==jt||e[124]!==wt||e[125]!==Pt?(Ze=a.jsx(Ys,{state:pe,header:jt,body:vt,note:wt,gate:bt,footer:Pt}),e[120]=vt,e[121]=bt,e[122]=pe,e[123]=jt,e[124]=wt,e[125]=Pt,e[126]=Ze):Ze=e[126];let ot;return e[127]!==yt||e[128]!==Ze?(ot=a.jsx(vs,{pane:yt,list:Ze}),e[127]=yt,e[128]=Ze,e[129]=ot):ot=e[129],ot}function hc(){return new Set}function fc(t){if(!(t==="claiming"||t==="ready"||t==="failed"))return ui[t].short}const mc=new Set(["failure","timed_out","cancelled","action_required"]);function Na(t){return t.status==="completed"&&mc.has(t.conclusion)}function zn(t){return t.status==="queued"||t.status==="in_progress"}function Rs(t){return t.isPending&&t.fetchStatus!=="idle"}function pc(t){return{key:"view-change-request",label:t("thread.cmsActions.viewOnProvider"),action:"open-pr-page"}}function ct(t,e,s){return e?[...t,pc(s)]:t}function Ge(t,e,s){return e.kind!=="ready"||e.behindBase<=0?t:[...t,{key:"get-latest",label:s("thread.cmsActions.getLatest"),action:"sync",tooltip:s("thread.cmsActions.getLatestTooltip")}]}function rr(t){return{key:"submit-for-review",label:t("thread.headerActions.submitForReview"),action:"create-pr"}}function Ns(t,e,s){if(e.filter(zn).length===0)return t;const n=e.filter(o=>o.status==="completed").length;return{...t,tooltip:s("thread.cmsActions.checksRunning",{done:n,total:e.length})}}function bc(t){const{lifecycle:e,branch:s,pr:r,checks:n,reviews:o,loading:d,t:l}=t;if(d)return{label:l("thread.headerActions.loading"),disabled:!0,loading:!0,variant:"outline",tooltip:l("thread.headerActions.loadingBranchTooltip"),menu:[]};switch(e.phase){case"idle":return{label:t.claimPhase&&fc(t.claimPhase.kind)||l("thread.headerActions.startingSandbox"),disabled:!0,loading:!0,variant:"outline",tooltip:l("thread.headerActions.waitingForDaemonTooltip"),menu:[]};case"cloning":return{label:l("thread.headerActions.cloningRepo"),disabled:!0,loading:!0,variant:"outline",tooltip:l("thread.headerActions.cloningRepoTooltip"),menu:[]};case"clone-failed":return{label:l("thread.headerActions.cloneFailed"),disabled:!0,variant:"outline",tooltip:e.error||l("thread.headerActions.cloneFailedDefaultTooltip"),menu:[]};case"checking-out":return{label:l("thread.headerActions.switchingTo",{branch:e.to}),disabled:!0,loading:!0,variant:"outline",tooltip:l("thread.headerActions.checkingOutTooltip",{branch:e.to}),menu:[]};case"installing":return{label:l("thread.headerActions.installingPackages"),disabled:!0,loading:!0,variant:"outline",tooltip:l("thread.headerActions.installingPackagesTooltip"),menu:[]};case"starting":{if(!(s.kind==="ready"&&(s.workingTreeDirty||s.aheadOfBase>0||s.unpushed>0))&&!t.noReviewableDiff)return{label:l("thread.headerActions.startingApp"),disabled:!0,loading:!0,variant:"outline",tooltip:l("thread.headerActions.startingAppTooltip"),menu:[]};break}}if(s.kind!=="ready")return{label:l("thread.headerActions.loadingBranch"),disabled:!0,loading:!0,variant:"outline",tooltip:l("thread.headerActions.waitingForBranchTooltip"),menu:[]};const i=s,u=i.unpushed>0&&!(r&&i.headSha&&r.headSha&&i.headSha===r.headSha);if(t.noReviewableDiff&&!r)return{label:l("thread.headerActions.upToDate"),disabled:!0,variant:"outline",tooltip:l("thread.headerActions.branchInSyncTooltip",{base:i.base}),menu:Ge([],i,l)};if(i.workingTreeDirty||u)return{label:l("thread.cmsActions.reviewAndPublish"),action:"publish",variant:"brand",menu:Ge(ct([rr(l)],r,l),i,l)};if(sa("no local work — checking PR/sync state",{workingTreeDirty:i.workingTreeDirty,unpushed:i.unpushed,aheadOfBase:i.aheadOfBase,behindBase:i.behindBase,branch:i.branch,base:i.base,prMerged:r?.merged??null,prState:r?.state??null}),r?.merged)return!!i.headSha&&!!r.headSha&&i.headSha!==r.headSha?{label:l("thread.headerActions.continue"),action:"create-pr",variant:"special",tooltip:l("thread.headerActions.openNewPrTooltip"),menu:Ge(ct([],r,l),i,l)}:{label:l("thread.headerActions.upToDate"),disabled:!0,variant:"outline",tooltip:l("thread.headerActions.prMergedTooltip",{prNumber:String(r.number),base:r.base}),menu:Ge(ct([],r,l),i,l)};if(i.aheadOfBase>0){if(r&&r.state==="closed"&&!r.merged)return{label:l("thread.headerActions.reopenPr"),action:"reopen",variant:"default",tooltip:l("thread.headerActions.reopenPrTooltip",{prNumber:String(r.number)}),menu:Ge(ct([],r,l),i,l)};if(!r)return{label:l("thread.cmsActions.reviewAndPublish"),action:"publish",variant:"brand",menu:Ge([rr(l)],i,l)};if((o?.mergeableState??"unknown")==="dirty")return{label:l("thread.cmsActions.getLatest"),action:"rebase",variant:"default",tooltip:l("thread.cmsActions.getLatestTooltip"),menu:[{key:"resolve-on-provider",label:l("thread.cmsActions.resolveOnProvider"),action:"open-pr-page"}]};const h=n.filter(zn).length,p=n.filter(Na).map(f=>f.name);if(h===0&&p.length>0)return{label:l("thread.headerActions.fixChecks"),action:"fix-checks",variant:"default",tooltip:l("thread.headerActions.failingChecksTooltip",{checks:p.join(", ")}),meta:{failingChecks:p},menu:Ge(ct([{key:"publish-anyway",label:l("thread.headerActions.publishAnyway"),action:"merge",tooltip:l("thread.headerActions.squashMergeTooltip",{prNumber:String(r.number),base:r.base})}],r,l),i,l)};if(o?.draft)return Ns({label:l("thread.headerActions.markReady"),action:"mark-ready",variant:"default",tooltip:l("thread.headerActions.markDraftReadyTooltip"),menu:Ge(ct([],r,l),i,l)},n,l);const b=o?.unresolvedConversations??0;return b>0?Ns({label:l("thread.headerActions.addressFeedback"),action:"resolve-comments",variant:"default",tooltip:l("thread.headerActions.unresolvedConversationsTooltip",{count:String(b)}),menu:Ge(ct([],r,l),i,l)},n,l):o?.missingRequiredApprovals?Ns({label:l("thread.cmsActions.waitingForReview"),action:"open-pr-page",variant:"outline",tooltip:l("thread.headerActions.waitingForApprovalsTooltip"),menu:Ge(ct([],r,l),i,l)},n,l):Ns({label:l("thread.cmsActions.reviewAndPublish"),action:"publish",variant:"brand",meta:{publishPolicyOverride:"open"},menu:Ge(ct([{key:"review",label:l("thread.headerActions.review"),action:"review"}],r,l),i,l)},n,l)}return i.behindBase>0?{label:l("thread.cmsActions.getLatest"),action:"sync",variant:"default",tooltip:l("thread.cmsActions.getLatestTooltip"),menu:[]}:{label:l("thread.headerActions.upToDate"),disabled:!0,variant:"outline",tooltip:l("thread.headerActions.branchInSyncTooltip",{base:i.base}),menu:[]}}function ar(t){return{key:"view-change-request",label:t("thread.cmsActions.viewOnProvider"),action:"open-pr"}}function Cs(t,e,s){return e.kind!=="ready"||e.behindBase<=0?t:[...t,{key:"get-latest",label:s("thread.cmsActions.getLatest"),action:"get-latest",tooltip:s("thread.cmsActions.getLatestTooltip")}]}function lr(t,e,s,r){const n=e.length;if(n===0)return t;if(e.filter(zn).length>0){const l=e.filter(u=>u.status==="completed").length,i=r("thread.cmsActions.checksRunning",{done:l,total:n});return s==="loading"?{...t,loading:!0,tooltip:i}:{...t,tooltip:i}}const d=e.filter(Na).length;return d>0?{...t,variant:"warning",tooltip:r("thread.cmsActions.checksFailing",{failed:d,total:n})}:t}function gc(t,e){return!!(t?.merged&&t.headSha&&e.kind==="ready"&&!e.workingTreeDirty&&e.headSha===t.headSha)}function xc(t){return Rs(t.prQuery)?!0:t.pr?.state!=="open"||t.pr.merged?!1:Rs(t.checksQuery)||Rs(t.reviewsQuery)}function vc(t,e){return t.workingTreeDirty?!0:e!==null?e>0:t.aheadOfBase>0}function yc(t,e){if(!t)return{branchMeta:{kind:"unknown"},publishableChangeCount:null};const s=Object.keys(t.changes).length;return{branchMeta:{kind:"ready",branch:e,base:t.base.resolvedRef??"main",workingTreeDirty:!1,unpushed:0,aheadOfBase:s,behindBase:0,headSha:t.revision},publishableChangeCount:s}}function jc(t){return{...t,menu:[]}}function wc(t){const{branch:e,pr:s,checks:r,reviews:n,publishing:o,saving:d,loading:l,publishableChangeCount:i,t:u}=t;if(e.kind!=="ready"&&t.statusError)return{label:u("thread.cmsActions.retry"),action:"retry-status",variant:"outline",disabled:t.statusRetrying,loading:t.statusRetrying,tooltip:t.statusError,menu:[]};if(l||e.kind!=="ready")return{label:u("thread.headerActions.loading"),variant:"outline",disabled:!0,loading:!0,menu:[]};if(o)return{label:u("thread.cmsActions.publishing"),variant:"outline",disabled:!0,loading:!0,menu:[]};if(t.syncing)return{label:u("thread.cmsActions.gettingLatest"),variant:"outline",disabled:!0,loading:!0,menu:[]};if(d)return{label:u("thread.headerActions.saving"),variant:"outline",disabled:!0,loading:!0,menu:[]};if(s&&s.state==="open"&&!s.merged?s:null){const h=n?.mergeableState??"unknown";return h==="dirty"?{label:u("thread.cmsActions.getLatest"),action:"get-latest",variant:"default",tooltip:u("thread.cmsActions.getLatestTooltip"),menu:[{key:"resolve-on-provider",label:u("thread.cmsActions.resolveOnProvider"),action:"open-pr"}]}:h==="blocked"||n?.draft?lr({label:u("thread.cmsActions.waitingForReview"),action:"open-pr",variant:"outline",menu:Cs([ar(u)],e,u)},r,"loading",u):lr({label:u("thread.cmsActions.reviewAndPublish"),action:"publish",variant:"brand",menu:Cs([ar(u)],e,u)},r,"none",u)}return gc(s,e)?{label:u("thread.headerActions.upToDate"),variant:"outline",disabled:!0,menu:Cs([],e,u)}:vc(e,i)?{label:u("thread.cmsActions.reviewAndPublish"),action:"publish",variant:"brand",menu:Cs([{key:"request-approval",label:u("thread.headerActions.submitForReview"),action:"request-approval"}],e,u)}:e.behindBase>0?{label:u("thread.cmsActions.getLatest"),action:"get-latest",variant:"default",tooltip:u("thread.cmsActions.getLatestTooltip"),menu:[],autoRun:e.aheadOfBase===0}:{label:u("thread.headerActions.upToDate"),variant:"outline",disabled:!0,menu:[]}}function Pc(t){return t.conflicting===!0?"dirty":t.conflicting===null?"unknown":t.reviewBlocked||t.unresolvedConversations>0?"blocked":"clean"}function Ca(t){const e=B.c(4);let s;e[0]!==t?(s=wl(t),e[0]=t,e[1]=s):s=e[1];let r;return e[2]!==s?(r={...s,select:Sc},e[2]=s,e[3]=r):r=e[3],dt(r)}function Sc(t){const e=t.changeRequest;return e?{draft:e.draft,mergeableState:Pc(e),unresolvedConversations:e.unresolvedConversations,missingRequiredApprovals:e.reviewBlocked}:null}function ir(t,e){return t==="open-pr"||e==="resolve-on-provider"?a.jsx(Jr,{size:16}):t==="publish"?a.jsx(Mr,{className:"size-4"}):t==="get-latest"||t==="retry-status"?a.jsx(bn,{className:"size-4"}):a.jsx(Ws,{className:"size-4"})}function kc(t){const e=B.c(63),{virtualMcpId:s}=t,r=ge(),{org:n}=gs(),o=br(),d=xs(s),{data:l}=Vs.useSession(),{deleteRelease:i}=Js(s),{currentBranch:u,setCurrentTaskBranch:c,taskId:h,createTask:p}=Nr();let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={open:!1,mode:"publish"},e[0]=b):b=e[0];const[f,m]=q.useState(b);let g;e[1]===Symbol.for("react.memo_cache_sentinel")?(g=L=>m({open:!0,mode:L}),e[1]=g):g=e[1];const x=g,P=Kr(d),j=P.status==="attached"||P.status==="public-clone"?P.repo:null,{previewServerUrl:y}=ds(s),S=u?Sr(kr(n.slug,s,u)):null,w=S?kn(S.path,S.params):"/",k=Rl(u?{orgSlug:n.slug,virtualMcpId:s,branch:u,previewServerUrl:y,path:w}:null);let N;e[2]!==u||e[3]!==n.slug||e[4]!==s?(N=u?{orgSlug:n.slug,virtualMcpId:s,branch:u}:null,e[2]=u,e[3]=n.slug,e[4]=s,e[5]=N):N=e[5];const C=Tl(N),v=It(s,u),A=v.kind==="protocol"&&v.source==="github";let T;e[6]!==u||e[7]!==n.slug||e[8]!==s?(T=u?{orgSlug:n.slug,virtualMcpId:s,branch:u}:null,e[6]=u,e[7]=n.slug,e[8]=s,e[9]=T):T=e[9];const I=yn(T),M=Tr(A?v:null,I);let $;e[10]!==n.slug||e[11]!==s?($=el(n.slug,s),e[10]=n.slug,e[11]=s,e[12]=$):$=e[12];const H=tl($,A?C:null),O=A?sl(y,w,H):k.url,G=u??"",E=h??null;let W;e[13]!==n.slug||e[14]!==G||e[15]!==E||e[16]!==s?(W=An({orgSlug:n.slug,virtualMcpId:s,branch:G,threadId:E}),e[13]=n.slug,e[14]=G,e[15]=E,e[16]=s,e[17]=W):W=e[17];const F=!!u&&v.kind!=="pending"&&!A;let V;e[18]!==W||e[19]!==F?(V={...W,enabled:F},e[18]=W,e[19]=F,e[20]=V):V=e[20];const te=dt(V),Y=A?null:te.data??null,re=A?yc(M.data,u??""):null,le=re?re.branchMeta:Y?{kind:"ready",branch:Tn(Y)??u??"",base:Y.base??"main",workingTreeDirty:ai(Y),unpushed:Y.unpushed??0,aheadOfBase:Y.aheadOfBase??0,behindBase:Y.behindBase??0,headSha:Y.headSha??""}:{kind:"unknown"},_=re?re.publishableChangeCount:Y?.changedFiles?ua({files:Y.changedFiles}).count:null,X=A?M:te,D=(le.kind==="ready"?le.branch:null)??u??null,Z=le.kind==="ready"?le.base:"main",se=Vr({orgId:n.id,orgSlug:n.slug,target:Me(j),owner:j?.owner??"",repo:j?.name??"",branch:D}),ie=se.data??null,ue=Gr({orgId:n.id,orgSlug:n.slug,target:Me(j),owner:j?.owner??"",repo:j?.name??"",base:Z}),he=Wr({orgId:n.id,orgSlug:n.slug,target:Me(j),owner:j?.owner??"",repo:j?.name??"",branch:D}),ne=Ca({orgId:n.id,orgSlug:n.slug,target:Me(j),owner:j?.owner??"",repo:j?.name??"",branch:D});let oe;e[21]!==he||e[22]!==ie||e[23]!==se||e[24]!==ne?(oe=xc({pr:ie,prQuery:se,checksQuery:he,reviewsQuery:ne}),e[21]=he,e[22]=ie,e[23]=se,e[24]=ne,e[25]=oe):oe=e[25];const fe=oe;let z;e[26]!==se?(z=async()=>{await se.refetch()},e[26]=se,e[27]=z):z=e[27];const ce=z,Pe=qn({mutationFn:()=>Hi({hosted:A,branch:u,baseBranch:Z,nextBranch:()=>jn(wn(l?.user)),setCurrentTaskBranch:c,deleteRelease:i}),onError:Ac});let Q;e[28]!==n.slug||e[29]!==h||e[30]!==s?(Q=async L=>(await li({orgSlug:n.slug,virtualMcpId:s,branch:L.branch,threadId:h??null},L.base),L),e[28]=n.slug,e[29]=h,e[30]=s,e[31]=Q):Q=e[31];let ee;e[32]!==u||e[33]!==n.slug||e[34]!==o||e[35]!==r||e[36]!==h||e[37]!==s?(ee=async L=>{et.success(r("thread.headerActions.syncedWithBase",{base:L.base})),await Promise.all([o.invalidateQueries({queryKey:Dn({orgSlug:n.slug,virtualMcpId:s,branch:u??L.branch,threadId:h??null})}),o.invalidateQueries({queryKey:os.decofile(`${n.slug}/${s}/${L.branch}`)})])},e[32]=u,e[33]=n.slug,e[34]=o,e[35]=r,e[36]=h,e[37]=s,e[38]=ee):ee=e[38];let ve;e[39]!==Q||e[40]!==ee?(ve={mutationFn:Q,onSuccess:ee,onError:Cc},e[39]=Q,e[40]=ee,e[41]=ve):ve=e[41];const J=qn(ve),me=Dr(n.slug,s),we=Pe.isPending,rt=wc({branch:le,pr:ie,checks:he.data??[],reviews:ne.data??null,publishing:we,saving:me,syncing:J.isPending,statusRetrying:X.isFetching&&!!X.error,statusError:X.error instanceof Error?X.error.message:X.error?String(X.error):null,loading:!!fe,publishableChangeCount:_,t:r}),ye=A?jc(rt):rt,_e=ye.autoRun&&le.kind==="ready"&&j&&y?`${D}@${le.headSha}`:null,Ee=q.useRef(null);if(q.useEffect(()=>{!_e||!D||Ee.current!==_e&&(Ee.current=_e,J.mutate({branch:D,base:Z}))},[_e,D,Z,J]),P.status==="detached"){let L;e[42]!==r?(L=r("thread.headerActions.reconnectGithub"),e[42]=r,e[43]=L):L=e[43];let pe;e[44]!==L?(pe=a.jsx(st,{asChild:!0,children:a.jsx("span",{children:a.jsx(xe,{size:"sm",variant:"outline",disabled:!0,children:L})})}),e[44]=L,e[45]=pe):pe=e[45];let Ae;e[46]!==r?(Ae=r("thread.headerActions.githubConnectionRemoved"),e[46]=r,e[47]=Ae):Ae=e[47];let Be;e[48]!==Ae?(Be=a.jsx(nt,{children:Ae}),e[48]=Ae,e[49]=Be):Be=e[49];let Te;return e[50]!==pe||e[51]!==Be?(Te=a.jsx(Gs,{children:a.jsxs(tt,{children:[pe,Be]})}),e[50]=pe,e[51]=Be,e[52]=Te):Te=e[52],Te}if(!d)return null;if(!j||!y){const L=j?"noPreviewServer":"noRepo";let pe;e[53]!==u||e[54]!==p?(pe=u?()=>{const Be=p?.({runtime:"sandbox",branch:u});Be&&Ua("coding_session_started",{thread_id:Be})}:void 0,e[53]=u,e[54]=p,e[55]=pe):pe=e[55];let Ae;return e[56]!==L||e[57]!==pe?(Ae=a.jsx(Rc,{reason:L,onStartCodingSession:pe}),e[56]=L,e[57]=pe,e[58]=Ae):Ae=e[58],Ae}if(!u)return null;const Ne=L=>{switch(L){case"publish":{x("publish");return}case"request-approval":{x("review");return}case"get-latest":{if(!D||J.isPending)return;J.mutate({branch:D,base:Z});return}case"retry-status":{X.refetch();return}case"open-pr":{ie?.htmlUrl&&window.open(ie.htmlUrl,"_blank","noopener,noreferrer");return}}};let De;e[59]!==Ne?(De=L=>({key:L.key,label:L.label,icon:ir(L.action,L.key),...L.tooltip?{tooltip:L.tooltip}:{},onSelect:()=>Ne(L.action)}),e[59]=Ne,e[60]=De):De=e[60];const Le=ye.menu.map(De),Ce=ye.action,ut=ye.label,Oe=ye.variant,Qe=!!ye.loading;let ze;e[61]!==r?(ze=r("thread.cmsActions.moreActionsAriaLabel"),e[61]=r,e[62]=ze):ze=e[62];const Ue=a.jsx(na,{size:"sm",label:ut,variant:Oe,disabled:!!ye.disabled||!Ce,loading:Qe,...Ce&&!ye.loading?{icon:ir(Ce)}:{},...ye.tooltip?{tooltip:ye.tooltip}:{},items:Le,menuAriaLabel:ze,onClick:Ce?()=>Ne(Ce):void 0});return a.jsxs(a.Fragment,{children:[ye.status?a.jsx("span",{className:"mr-1 hidden shrink-0 text-xs text-muted-foreground sm:inline",children:ye.status}):null,Ue,u?a.jsx(Pa,{open:f.open,mode:f.mode,fastPreview:!0,onOpenChange:L=>{L||m(Nc)},orgSlug:n.slug,virtualMcpId:s,branch:u,baseBranch:Z,repoTarget:Me(j),owner:j.owner,repo:j.name,publishPolicy:ea(d?.metadata?.publishPolicy),draftPreviewUrl:O,destinationHost:k.host,previewServerUrl:y,compareDraft:C?{kind:"pointer",pointer:C,...H?{link:H}:{}}:null,lastPublishedPr:ue.data??null,onRequestApproval:()=>x("review"),openPullRequest:ie?.state==="open"?ie:null,onPullRequestChanged:ce,onPublished:()=>Pe.mutateAsync()}):null]})}function Nc(t){return{...t,open:!1}}function Cc(t){et.error(t instanceof Error?t.message:String(t))}function Ac(t){console.error("site editor: settling after publish failed",t)}function Rc(t){const e=B.c(14),{reason:s,onStartCodingSession:r}=t,n=ge(),o=!r;let d;e[0]!==n?(d=n("sandbox.cmsUnavailable.startCodingSession"),e[0]=n,e[1]=d):d=e[1];let l;e[2]!==r||e[3]!==o||e[4]!==d?(l=a.jsx(st,{asChild:!0,children:a.jsx("span",{children:a.jsx(xe,{size:"sm",variant:"outline",disabled:o,onClick:r,children:d})})}),e[2]=r,e[3]=o,e[4]=d,e[5]=l):l=e[5];let i;e[6]!==s||e[7]!==n?(i=n(s==="noPreviewServer"?"sandbox.cmsUnavailable.noPreviewServer":"sandbox.cmsUnavailable.noRepo"),e[6]=s,e[7]=n,e[8]=i):i=e[8];let u;e[9]!==i?(u=a.jsx(nt,{children:i}),e[9]=i,e[10]=u):u=e[10];let c;return e[11]!==l||e[12]!==u?(c=a.jsx(Gs,{children:a.jsxs(tt,{children:[l,u]})}),e[11]=l,e[12]=u,e[13]=c):c=e[13],c}const $t="The user clicked this action deliberately — execute directly. Do not call user_ask unless you hit an actual problem outside the scope of this intent (missing auth, unresolvable conflict, a check with multiple plausible fixes).";function Tc(t){return`Reopen PR #${t.prNumber}. ${$t}`}function Dc(t){return`Rebase \`${t.branch}\` on the latest base and force-push with --force-with-lease. ${$t}`}function Bc(t){return`Sync \`${t.branch}\` with everyone else's work: \`git add -A\`, commit any pending local changes with a concise conventional-commit message (skip if the working tree is clean), \`git pull --rebase\` to bring in anything pushed directly to \`origin/${t.branch}\`, then \`git rebase origin/${t.base}\` to catch up with the base branch. Resolve any conflicts that come up, then push the result (force-with-lease only if the rebase rewrote commits already on the remote). ${$t}`}function Ic(t){const e=(t.failingChecks??[]).map(s=>`\`${s}\``).join(", ");return`PR #${t.prNumber} has failing checks: ${e}. For each: read the logs, diagnose the root cause, apply the smallest fix that makes it pass, commit, and push. ${$t}`}function $c(t){return`Mark PR #${t.prNumber} ready for review. ${$t}`}function Fc(t){return`Read the unresolved review threads on PR #${t.prNumber}. For each thread: understand the reviewer's ask, apply the needed changes, commit, push, reply explaining what changed, and resolve the thread. If a comment is a question that doesn't need a code change, reply with the answer and resolve. ${$t}`}function Lc(t){return`Review PR #${t.prNumber}. Read the full diff, analyze every changed file for correctness, security, code quality, and alignment with the repo's patterns. Post specific line-level review comments on concerns, then submit an overall review (approve / request changes / comment) with a concise summary. Do not modify the code — this is a read-and-comment pass. ${$t}`}function or(t){switch(t){case"publish":return a.jsx(Mr,{className:"size-4"});case"create-pr":case"reopen":return a.jsx(Ws,{className:"size-4"});case"rebase":case"sync":return a.jsx(bn,{className:"size-4"});case"fix-checks":return a.jsx(pn,{className:"size-4"});case"mark-ready":return a.jsx(Nn,{className:"size-4"});case"resolve-comments":return a.jsx(pl,{className:"size-4"});case"merge":return a.jsx(Jl,{className:"size-4"});case"review":return a.jsx(Ms,{className:"size-4"});case"open-pr-page":return a.jsx(Jr,{size:16})}}const cr=new Set(["reopen","rebase","fix-checks","mark-ready","resolve-comments","review","sync"]),dr=new Set(["publish","create-pr"]);function Oc(t){const e=B.c(44),{t:s,button:r,actionBusy:n,changeRequestPending:o,savePending:d,onAction:l}=t,i=r.action;let u;e[0]!==i||e[1]!==n?(u=n&&i!==void 0&&cr.has(i),e[0]=i,e[1]=n,e[2]=u):u=e[2];const c=u,h=o&&i==="merge";let p;e[3]!==i||e[4]!==d?(p=d&&i!==void 0&&dr.has(i),e[3]=i,e[4]=d,e[5]=p):p=e[5];const b=p,f=!!r.disabled||c||h||b||!i,m=!!r.loading||h;let g;e[6]!==r.tooltip||e[7]!==c||e[8]!==b||e[9]!==s?(g=c?s("thread.headerActions.chatIsRunning"):b?s("thread.headerActions.saving"):r.tooltip,e[6]=r.tooltip,e[7]=c,e[8]=b,e[9]=s,e[10]=g):g=e[10];const x=g;let P;if(e[11]!==n||e[12]!==r.menu||e[13]!==o||e[14]!==l||e[15]!==d||e[16]!==s){let A;e[18]!==n||e[19]!==o||e[20]!==l||e[21]!==d||e[22]!==s?(A=T=>{const I=n&&cr.has(T.action),M=d&&dr.has(T.action),$=T.action==="merge"&&o,H=M?s("thread.headerActions.saving"):I?s("thread.headerActions.chatIsRunning"):T.tooltip;return{key:T.key,label:T.label,icon:or(T.action),disabled:!!(I||M||$),...H?{tooltip:H}:{},onSelect:()=>l(T.action)}},e[18]=n,e[19]=o,e[20]=l,e[21]=d,e[22]=s,e[23]=A):A=e[23],P=r.menu.map(A),e[11]=n,e[12]=r.menu,e[13]=o,e[14]=l,e[15]=d,e[16]=s,e[17]=P}else P=e[17];const j=P,y=r.label,S=r.variant;let w;e[24]!==i||e[25]!==m?(w=i&&!m?{icon:or(i)}:{},e[24]=i,e[25]=m,e[26]=w):w=e[26];let k;e[27]!==x?(k=x?{tooltip:x}:{},e[27]=x,e[28]=k):k=e[28];let N;e[29]!==s?(N=s("thread.headerActions.moreActionsAriaLabel"),e[29]=s,e[30]=N):N=e[30];let C;e[31]!==i||e[32]!==l?(C=i?()=>l(i):void 0,e[31]=i,e[32]=l,e[33]=C):C=e[33];let v;return e[34]!==r.label||e[35]!==r.variant||e[36]!==f||e[37]!==j||e[38]!==m||e[39]!==w||e[40]!==k||e[41]!==N||e[42]!==C?(v=a.jsx(na,{size:"sm",label:y,variant:S,disabled:f,loading:m,...w,...k,items:j,menuAriaLabel:N,onClick:C}),e[34]=r.label,e[35]=r.variant,e[36]=f,e[37]=j,e[38]=m,e[39]=w,e[40]=k,e[41]=N,e[42]=C,e[43]=v):v=e[43],v}function ur(t){const e=B.c(9),{label:s,children:r}=t;if(!s){let l;return e[0]!==r?(l=a.jsx(a.Fragment,{children:r}),e[0]=r,e[1]=l):l=e[1],l}let n;e[2]!==r?(n=a.jsx(st,{asChild:!0,children:a.jsx("span",{children:r})}),e[2]=r,e[3]=n):n=e[3];let o;e[4]!==s?(o=a.jsx(nt,{children:s}),e[4]=s,e[5]=o):o=e[5];let d;return e[6]!==n||e[7]!==o?(d=a.jsx(Gs,{children:a.jsxs(tt,{children:[n,o]})}),e[6]=n,e[7]=o,e[8]=d):d=e[8],d}function Mc(t){return{label:t("thread.headerActions.loadingBranch"),disabled:!0,loading:!0,variant:"outline",tooltip:t("thread.headerActions.waitingForSandboxBranchTooltip"),menu:[]}}function _c({virtualMcpId:t}){const e=ge(),{org:s}=gs(),{data:r}=Vs.useSession(),n=xs(t),{deleteRelease:o}=Js(t),{currentBranch:d,setCurrentTaskBranch:l,createTask:i,taskId:u}=Nr(),c=Va(),{openSidePanel:h}=al(),[p,b]=q.useState({open:!1,mode:"publish",policyOverride:null}),f=hi({connectionId:qa,orgId:s.id,orgSlug:s.slug}),m=mi(f),[g,x]=q.useState(!1),P=q.useRef(""),j=Kr(n),y=j.status==="attached"||j.status==="public-clone"?j.repo:null,{lifecycle:S,branch:w,phase:k}=fi(),N={orgSlug:s.slug,virtualMcpId:t,branch:d??"",threadId:u??null},v=dt({queryKey:Dn(N),queryFn:()=>Zr(N),enabled:!!d,staleTime:15e3,refetchInterval:Q=>tn(Q.state.data)?5e3:!1}).data??null,A=w,T=S,I=A.kind==="ready"?A.branch:null,M=d??I??void 0,$=(A.kind==="ready"?A.branch:null)??M??null,H=Vr({orgId:s.id,orgSlug:s.slug,target:Me(y),owner:y?.owner??"",repo:y?.name??"",branch:$}),O=H.data??null,G=Wr({orgId:s.id,orgSlug:s.slug,target:Me(y),owner:y?.owner??"",repo:y?.name??"",branch:$}),E=Ca({orgId:s.id,orgSlug:s.slug,target:Me(y),owner:y?.owner??"",repo:y?.name??"",branch:$}),W=Gr({orgId:s.id,orgSlug:s.slug,target:Me(y),owner:y?.owner??"",repo:y?.name??"",base:A.kind==="ready"?A.base:null}),F=A,V=ea(n?.metadata?.publishPolicy),te=Dr(s.slug,t),{previewUrl:Y}=pi(),{previewServerUrl:re,projectDefault:le}=ds(t);if(j.status==="detached")return a.jsx(ur,{label:e("thread.headerActions.githubConnectionRemoved"),children:a.jsx(xe,{size:"sm",variant:"outline",disabled:!0,children:e("thread.headerActions.reconnectGithub")})});if(!y)return null;const _=$?bc({lifecycle:T,branch:F,claimPhase:k,pr:O,checks:G.data??[],reviews:E.data??null,noReviewableDiff:tn(v),loading:Rs(H),t:e}):Mc(e),X=JSON.stringify({label:_.label,branchKind:F.kind,workingTreeDirty:F.kind==="ready"?F.workingTreeDirty:null,unpushed:F.kind==="ready"?F.unpushed:null,aheadOfBase:F.kind==="ready"?F.aheadOfBase:null,lifecycle:T.phase,headBranch:$,noReviewableDiff:tn(v)});P.current!==X&&(P.current=X,sa("header button",{label:_.label,tooltip:_.tooltip,action:_.action,chatBranch:d,sandboxBranch:I,sandboxRouteBranch:M,headBranch:$,branchMeta:A,effectiveBranchMeta:F,lifecyclePhase:T.phase,prNumber:O?.number??null,prState:O?.state??null}));const D=Q=>(h(),c.sendMessage({parts:[{type:"text",text:Q}]})),Z=c.isStreaming,se=F.kind==="ready"?F.base:"main",ie=async()=>{await H.refetch()},ue=async()=>{const Q=d,ee=jn(wn(r?.user));le==="cms"?i({runtime:"cms",branch:ee}):await l(ee),Q&&Q!==se&&await o(Q)},he=async Q=>{if(!(!y||g)){x(!0);try{const ee=ra(r?.user);await Kl(s.slug,Me(y),{number:Q,coAuthor:ee}),et.success(e("thread.headerActions.publishedPr",{prNumber:String(Q)})),await ie(),await ue()}catch(ee){et.error(ee instanceof Vl?ee.detail??Gl(ee.reason,e):ee instanceof Error?ee.message:e("thread.headerActions.failedToMergePullRequest"))}finally{x(!1)}}},ne=(Q,ee)=>b({open:!0,mode:Q,policyOverride:ee}),oe=Q=>{if($)switch(Q){case"publish":ne("publish",_.meta?.publishPolicyOverride??null);return;case"create-pr":ne("review",null);return;case"merge":O&&he(O.number);return;case"sync":if(Z)return;D(Bc({branch:$,base:se}));return;case"open-pr-page":O?.htmlUrl&&window.open(O.htmlUrl,"_blank","noopener,noreferrer");return;case"review":if(Z)return;O&&D(Lc({prNumber:O.number}));return;case"reopen":if(Z)return;O&&D(Tc({prNumber:O.number}));return;case"rebase":if(Z)return;D(Dc({branch:$}));return;case"fix-checks":if(Z)return;O&&D(Ic({prNumber:O.number,failingChecks:_.meta?.failingChecks??[]}));return;case"mark-ready":if(Z)return;O&&D($c({prNumber:O.number}));return;case"resolve-comments":if(Z)return;O&&D(Fc({prNumber:O.number}));return}},fe=g||Z,z=a.jsx(Oc,{t:e,button:_,actionBusy:fe,changeRequestPending:g,savePending:te,onAction:oe}),ce=F.kind==="ready"&&F.pushError&&F.pushFailingSince?e("thread.headerActions.pushFailing",{since:new Date(F.pushFailingSince).toLocaleString(),error:F.pushError}):null,Pe=ce?a.jsx(ur,{label:ce,children:a.jsx(pn,{role:"img","aria-label":ce,className:"size-4 text-warning"})}):null;return M?a.jsxs(a.Fragment,{children:[Pe,z,a.jsx(Pa,{open:p.open,mode:p.mode,fastPreview:!1,recoverSandbox:()=>m.mutateAsync({virtualMcpId:t,branch:M,...u?{threadId:u}:{}}),onOpenChange:Q=>{Q||b(ee=>({...ee,open:!1}))},orgSlug:s.slug,virtualMcpId:t,branch:M,baseBranch:se,repoTarget:Me(y),owner:y.owner,repo:y.name,publishPolicy:p.policyOverride??V,draftPreviewUrl:Y,destinationHost:null,previewServerUrl:re,compareDraft:Y?{kind:"sandbox",previewUrl:Y}:null,lastPublishedPr:W.data??null,onRequestApproval:()=>b(Q=>({...Q,open:!0,mode:"review"})),openPullRequest:O?.state==="open"?O:null,onPullRequestChanged:ie,onPublished:ue})]}):a.jsxs(a.Fragment,{children:[Pe,z]})}function Ec(t){const e=B.c(33),{orgSlug:s,virtualMcpId:r,branch:n}=t,o=ge(),[d,l]=q.useState(!1),i=It(r,n),u=i.kind==="protocol"&&i.source==="local"?i:null;let c;e[0]!==n||e[1]!==s||e[2]!==r?(c=n?{orgSlug:s,virtualMcpId:r,branch:n}:null,e[0]=n,e[1]=s,e[2]=r,e[3]=c):c=e[3];const h=yn(c),{data:p}=Tr(u,h);if(!u||!h||!n)return null;let b;e[4]!==p?(b=p?Object.keys(p.changes).length:0,e[4]=p,e[5]=b):b=e[5];const f=b;let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=()=>l(!0),e[6]=m):m=e[6];let g;e[7]!==f||e[8]!==o?(g=f>0?o("decoServe.changes.buttonCount",{count:f}):o("decoServe.changes.button"),e[7]=f,e[8]=o,e[9]=g):g=e[9];let x;e[10]!==g?(x=a.jsx(xe,{size:"sm",variant:"outline","data-testid":"local-changes-button",onClick:m,children:g}),e[10]=g,e[11]=x):x=e[11];let P;e[12]!==o?(P=o("decoServe.changes.title"),e[12]=o,e[13]=P):P=e[13];let j;e[14]!==P?(j=a.jsx(vr,{className:"sr-only",children:P}),e[14]=P,e[15]=j):j=e[15];let y;e[16]!==n||e[17]!==h||e[18]!==u||e[19]!==d||e[20]!==s||e[21]!==o||e[22]!==r?(y=d?a.jsx(jr,{children:N=>{const{reset:C}=N;return a.jsx(wr,{fallback:v=>{const{resetError:A}=v;return a.jsx(hn,{title:o("decoServe.changes.title"),body:a.jsx("p",{className:"px-4 py-6 text-xs text-muted-foreground",children:o("decoServe.changes.loadFailed")}),onClose:()=>{C(),A(),l(!1)}})},children:a.jsx(q.Suspense,{fallback:a.jsx(vs,{pane:a.jsx(On,{}),list:a.jsx(hn,{title:o("decoServe.changes.title"),loading:!0,body:a.jsx(bs,{children:a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(Bt,{}),a.jsx(Bt,{})]})}),onClose:()=>l(!1)})}),children:a.jsx(zc,{orgSlug:s,virtualMcpId:r,branch:n,backend:u,cacheKey:h,onClose:()=>l(!1)})})})}}):null,e[16]=n,e[17]=h,e[18]=u,e[19]=d,e[20]=s,e[21]=o,e[22]=r,e[23]=y):y=e[23];let S;e[24]!==j||e[25]!==y?(S=a.jsxs(yr,{"aria-describedby":void 0,className:"flex h-[calc(100dvh-2rem)] w-[calc(100vw-2rem)] max-w-none flex-col md:flex-row md:h-[calc(100dvh-6rem)] md:w-[calc(100vw-6rem)] gap-0 overflow-hidden p-0 sm:max-w-none",closeButtonClassName:"top-3.5 right-3.5",children:[j,y]}),e[24]=j,e[25]=y,e[26]=S):S=e[26];let w;e[27]!==d||e[28]!==S?(w=a.jsx(xr,{open:d,onOpenChange:l,children:S}),e[27]=d,e[28]=S,e[29]=w):w=e[29];let k;return e[30]!==w||e[31]!==x?(k=a.jsxs(a.Fragment,{children:[x,w]}),e[30]=w,e[31]=x,e[32]=k):k=e[32],k}function hn(t){const e=B.c(22),{title:s,trailing:r,body:n,loading:o,onClose:d}=t,l=o===void 0?!1:o,i=ge(),u=l?"loading":"ready";let c;e[0]!==s?(c=a.jsx("span",{className:"truncate",children:s}),e[0]=s,e[1]=c):c=e[1];let h;e[2]!==c||e[3]!==r?(h=a.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[c,r]}),e[2]=c,e[3]=r,e[4]=h):h=e[4];let p;e[5]!==i?(p=i("decoServe.changes.hint"),e[5]=i,e[6]=p):p=e[6];let b;e[7]!==p?(b=a.jsx("p",{className:"text-2xs text-muted-foreground",children:a.jsx(ta,{text:p})}),e[7]=p,e[8]=b):b=e[8];let f;e[9]!==i?(f=i("decoServe.changes.close"),e[9]=i,e[10]=f):f=e[10];let m;e[11]!==d||e[12]!==f?(m=a.jsx(xe,{type:"button",variant:"outline",className:"w-full",onClick:d,children:f}),e[11]=d,e[12]=f,e[13]=m):m=e[13];let g;e[14]!==b||e[15]!==m?(g=a.jsxs(a.Fragment,{children:[b,m]}),e[14]=b,e[15]=m,e[16]=g):g=e[16];let x;return e[17]!==n||e[18]!==u||e[19]!==h||e[20]!==g?(x=a.jsx(Ys,{state:u,header:h,body:n,footer:g}),e[17]=n,e[18]=u,e[19]=h,e[20]=g,e[21]=x):x=e[21],x}function zc(t){const e=B.c(54),{orgSlug:s,virtualMcpId:r,branch:n,backend:o,cacheKey:d,onClose:l}=t,i=ge();let u;e[0]!==n||e[1]!==s||e[2]!==r?(u={orgSlug:s,virtualMcpId:r,branch:n},e[0]=n,e[1]=s,e[2]=r,e[3]=u):u=e[3];let c;e[4]!==o||e[5]!==d||e[6]!==u?(c={backend:o,cacheKey:d,scope:u},e[4]=o,e[5]=d,e[6]=u,e[7]=c):c=e[7];const h=Ln(c);let p;e[8]!==n||e[9]!==s||e[10]!==h.refresh||e[11]!==r?(p={orgSlug:s,virtualMcpId:r,branch:n,refresh:h.refresh},e[8]=n,e[9]=s,e[10]=h.refresh,e[11]=r,e[12]=p):p=e[12];const b=Wl(p),f=Rr(s,r).phase==="saving",m=o.describe.readOnly,[g,x]=q.useState(null),[P,j]=q.useState(null),[y,S]=q.useState(!1),{summary:w}=h;let k,N,C,v,A;if(e[13]!==g||e[14]!==o||e[15]!==P||e[16]!==b||e[17]!==y||e[18]!==f||e[19]!==m||e[20]!==h.blocks||e[21]!==h.entries||e[22]!==h.sidesFailed||e[23]!==h.sidesPending||e[24]!==w.blocks||e[25]!==w.count||e[26]!==w.pages||e[27]!==i){const M=[...w.pages,...w.blocks],$=M.find(E=>ke(E)===g)??M[0]??null;let H;e[33]!==w.count||e[34]!==i?(H=w.count===0?i("decoServe.changes.title"):w.count===1?i("decoServe.changes.titleOne"):i("decoServe.changes.titleCount",{count:w.count}),e[33]=w.count,e[34]=i,e[35]=H):H=e[35],A=H;const O=(E,W)=>W.length===0?null:a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("div",{className:"px-0.5 text-2xs font-medium text-muted-foreground",children:E}),W.map(F=>{const V=ke(F);return a.jsx(ma,{change:F,bodyPending:h.sidesPending,v8:!0,selected:$!==null&&ke($)===V,onSelect:()=>x(V),confirming:P===V,onConfirmingChange:te=>j(te?V:null),onDiscard:m||!F.entry?void 0:()=>{b(o,[F.entry],i("thread.publishPopover.discarded",{name:F.name}))},isPublishing:!1,isDiscarding:f},V)})]});let G;e[36]!==o||e[37]!==b||e[38]!==y||e[39]!==f||e[40]!==m||e[41]!==h.entries||e[42]!==w.count||e[43]!==i?(G=m||w.count<=1?null:a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:"ml-auto shrink-0 text-2xs text-muted-foreground transition-colors hover:text-destructive disabled:opacity-50",onClick:()=>S(!0),disabled:f,children:i("thread.publishPopover.discardAll")}),a.jsx(Os,{open:y,onOpenChange:S,children:a.jsxs(Ls,{children:[a.jsxs(Bs,{children:[a.jsx(Ts,{children:i("thread.publishPopover.discardAllTitle")}),a.jsx(Ds,{children:i("thread.publishPopover.discardAllConfirm")})]}),a.jsxs(Fs,{children:[a.jsx(Is,{children:i("thread.publishDialog.cancel")}),a.jsx($s,{onClick:()=>{b(o,h.entries,i("thread.publishDialog.allChangesDiscarded"))},disabled:f,className:K(Pr({variant:"destructive"})),children:i("thread.publishPopover.discardAll")})]})]})})]}),e[36]=o,e[37]=b,e[38]=y,e[39]=f,e[40]=m,e[41]=h.entries,e[42]=w.count,e[43]=i,e[44]=G):G=e[44],C=G,N=w.count===0?a.jsxs("div",{className:"flex flex-col items-center gap-1 py-10 text-center",children:[a.jsx(Nn,{className:"mb-1 size-5 text-success"}),a.jsx("p",{className:"text-sm font-medium",children:i("decoServe.changes.empty")})]}):a.jsxs(bs,{children:[O(i("thread.publishPopover.pagesGroup"),w.pages),O(i("thread.publishPopover.blocksGroup"),w.blocks),h.sidesFailed?a.jsx("p",{className:"text-2xs text-muted-foreground",children:i("thread.publishPopover.detailsUnavailable")}):null]}),k=vs,v=$?a.jsx("div",{className:K(is,"relative flex"),children:a.jsx(ya,{change:$,diff:null,bodyPending:h.sidesPending,previewServerUrl:null,draft:null,lastPage:null,v8:{blocks:h.blocks}},ke($))}):a.jsx("div",{className:K(is,"bg-muted/40")}),e[13]=g,e[14]=o,e[15]=P,e[16]=b,e[17]=y,e[18]=f,e[19]=m,e[20]=h.blocks,e[21]=h.entries,e[22]=h.sidesFailed,e[23]=h.sidesPending,e[24]=w.blocks,e[25]=w.count,e[26]=w.pages,e[27]=i,e[28]=k,e[29]=N,e[30]=C,e[31]=v,e[32]=A}else k=e[28],N=e[29],C=e[30],v=e[31],A=e[32];let T;e[45]!==N||e[46]!==C||e[47]!==l||e[48]!==A?(T=a.jsx(hn,{title:A,trailing:C,body:N,onClose:l}),e[45]=N,e[46]=C,e[47]=l,e[48]=A,e[49]=T):T=e[49];let I;return e[50]!==k||e[51]!==v||e[52]!==T?(I=a.jsx(k,{pane:v,list:T}),e[50]=k,e[51]=v,e[52]=T,e[53]=I):I=e[53],I}function Uc(t){const e=B.c(5),{virtualMcpId:s,branch:r}=t,n=ge(),o=It(s,r);if(!qc(o))return null;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=a.jsx(st,{asChild:!0,children:a.jsx("span",{"data-testid":"content-version-badge",className:"shrink-0 rounded border border-border px-1.5 py-px font-mono text-2xs leading-4 text-muted-foreground",children:"v8"})}),e[0]=d):d=e[0];let l;e[1]!==n?(l=n("decoServe.version.v8"),e[1]=n,e[2]=l):l=e[2];let i;return e[3]!==l?(i=a.jsxs(tt,{children:[d,a.jsx(nt,{side:"bottom",className:"max-w-xs",children:l})]}),e[3]=l,e[4]=i):i=e[4],i}function qc(t){return t.kind==="protocol"?t.hasSchema!==!1:t.kind==="unavailable"&&t.source!=="local"}function Hc(t){const e=B.c(11),{virtualMcpId:s,branch:r}=t,n=ge(),o=It(s,r);if(!(o.kind==="protocol"&&o.source==="local"&&o.describe.readOnly))return null;let l;e[0]!==n?(l=n("decoServe.readOnly.label"),e[0]=n,e[1]=l):l=e[1];let i;e[2]!==l?(i=a.jsx(st,{asChild:!0,children:a.jsx("span",{tabIndex:0,"data-testid":"deco-serve-read-only",className:"shrink-0 rounded-full bg-warning/10 px-2 py-0.5 text-xs font-medium text-foreground",children:l})}),e[2]=l,e[3]=i):i=e[3];let u;e[4]!==n?(u=n("decoServe.readOnly.tooltip"),e[4]=n,e[5]=u):u=e[5];let c;e[6]!==u?(c=a.jsx(nt,{side:"bottom",className:"max-w-xs",children:a.jsx(ta,{text:u})}),e[6]=u,e[7]=c):c=e[7];let h;return e[8]!==i||e[9]!==c?(h=a.jsxs(tt,{children:[i,c]}),e[8]=i,e[9]=c,e[10]=h):h=e[10],h}function Kc(t){return t.servingLocally||t.localPreview?"open":t.runtimeResolved?t.runtime!=="cms"?"open":t.branch?t.blocksV8?"open":t.defaultBranch?t.defaultBranch===t.branch?"blocked":"open":t.listedDraft||t.defaultBranch===null?"open":"pending":"pending":"pending"}function Vc(){const t=B.c(27),e=cs(),{org:s}=gs(),r=xs(e?.virtualMcpId),n=r?.id??e?.virtualMcpId??"",o=e?.currentBranch??null,{runtime:d,resolved:l}=ds(r?.id),i=Pn(r?.id),{url:u}=gn(r?.id),{connection:c}=xn(n||null),h=!!r&&!!o&&l&&d==="cms"&&!i&&!u,p=o??"",b=e?.taskId??null;let f,m,g,x;t[0]!==s.slug||t[1]!==p||t[2]!==b||t[3]!==n?(m={orgSlug:s.slug,virtualMcpId:n,branch:p,threadId:b},f=Gc,x=dt,g=An(m),t[0]=s.slug,t[1]=p,t[2]=b,t[3]=n,t[4]=f,t[5]=m,t[6]=g,t[7]=x):(f=t[4],m=t[5],g=t[6],x=t[7]);let P;t[8]!==f||t[9]!==m?(P=(T,I)=>f(I?.queryKey)===f(Dn(m))?T:void 0,t[8]=f,t[9]=m,t[10]=P):P=t[10];let j;t[11]!==h||t[12]!==g||t[13]!==P?(j={...g,enabled:h,placeholderData:P},t[11]=h,t[12]=g,t[13]=P,t[14]=j):j=t[14];const y=x(j),S=!!u,w=!!c;let k;if(t[15]!==i||t[16]!==o||t[17]!==r?.metadata?.releases||t[18]!==l||t[19]!==d||t[20]!==y.data||t[21]!==y.isError||t[22]!==S||t[23]!==w){let T;t[25]!==o?(T=I=>I.branch===o,t[25]=o,t[26]=T):T=t[26],k=Kc({runtime:d,runtimeResolved:l,blocksV8:i,localPreview:S,servingLocally:w,branch:o,listedDraft:(r?.metadata?.releases??[]).some(T),defaultBranch:y.data?y.data.base??null:y.isError?null:void 0}),t[15]=i,t[16]=o,t[17]=r?.metadata?.releases,t[18]=l,t[19]=d,t[20]=y.data,t[21]=y.isError,t[22]=S,t[23]=w,t[24]=k}else k=t[24];const N=k,C=`${n}:${o??""}`,[v,A]=q.useState(null);return N!=="pending"&&(v?.key!==C||v.gate!==N)&&A({key:C,gate:N}),N==="pending"&&v?.key===C?v.gate:N}function Gc(t){return t?.[2]}function Wc(t){const e=!t.hasEntity&&!t.servingLocally,s=t.hasEntity&&!t.localPreview&&!t.servingLocally&&!t.onProduction&&t.showsRepositoryActions;return{hidden:e,localFiles:!e&&t.servingLocally,draftSelect:!e&&t.hasEntity,publish:e||!s?null:t.runtime==="cms"?"cms":"code"}}function zd(t){const e=B.c(2),{blocksOnly:s}=t;let r;return e[0]!==s?(r=s?a.jsx(Qc,{}):a.jsx(Aa,{}),e[0]=s,e[1]=r):r=e[1],r}function Qc(){return Pn(gi())?a.jsx(xa,{value:!1,children:a.jsx(Aa,{})}):null}function Aa(){const t=B.c(32),e=cs(),{org:s}=gs(),r=xs(e?.virtualMcpId),n=e?.currentBranch??null,o=ds(r?.id).runtime,{url:d}=gn(r?.id),{connection:l}=xn(r?.id??e?.virtualMcpId),i=r?.id??e?.virtualMcpId,u=Vc()!=="open",c=!!r,h=!!l,p=!!d;let b;t[0]!==r||t[1]!==u||t[2]!==o||t[3]!==c||t[4]!==h||t[5]!==p?(b=Wc({hasEntity:c,servingLocally:h,localPreview:p,showsRepositoryActions:!!r&&bi(r),runtime:o,onProduction:u}),t[0]=r,t[1]=u,t[2]=o,t[3]=c,t[4]=h,t[5]=p,t[6]=b):b=t[6];const f=b;if(!i||f.hidden)return null;let m;t[7]!==n||t[8]!==i?(m=a.jsx(Uc,{virtualMcpId:i,branch:n}),t[7]=n,t[8]=i,t[9]=m):m=t[9];let g;t[10]!==n||t[11]!==f.localFiles||t[12]!==i?(g=f.localFiles&&a.jsx(Hc,{virtualMcpId:i,branch:n}),t[10]=n,t[11]=f.localFiles,t[12]=i,t[13]=g):g=t[13];let x;t[14]!==n||t[15]!==s||t[16]!==f.localFiles||t[17]!==i?(x=f.localFiles&&a.jsx(Ec,{orgSlug:s.slug,virtualMcpId:i,branch:n}),t[14]=n,t[15]=s,t[16]=f.localFiles,t[17]=i,t[18]=x):x=t[18];let P;t[19]!==n||t[20]!==r||t[21]!==f.draftSelect?(P=r&&f.draftSelect&&a.jsx("div",{className:"flex min-w-0 shrink items-center justify-end",children:a.jsx(_i,{virtualMcp:r,currentBranch:n})}),t[19]=n,t[20]=r,t[21]=f.draftSelect,t[22]=P):P=t[22];let j;t[23]!==r||t[24]!==f.publish?(j=r&&f.publish&&a.jsxs(a.Fragment,{children:[a.jsx(Ha,{orientation:"vertical",className:"mx-1 data-[orientation=vertical]:h-4"}),a.jsx("div",{className:"flex shrink-0 items-center justify-end gap-1",children:f.publish==="cms"?a.jsx(kc,{virtualMcpId:r.id}):a.jsx(_c,{virtualMcpId:r.id})})]}),t[23]=r,t[24]=f.publish,t[25]=j):j=t[25];let y;return t[26]!==m||t[27]!==g||t[28]!==x||t[29]!==P||t[30]!==j?(y=a.jsxs(a.Fragment,{children:[m,g,x,P,j]}),t[26]=m,t[27]=g,t[28]=x,t[29]=P,t[30]=j,t[31]=y):y=t[31],y}export{zd as S,Vc as a,Di as u};
@@ -1 +0,0 @@
1
- import{c as I,j as r,n as v,b as M,a4 as P,bi as R}from"./index-DVvmeJMJ.js";import{E as T}from"./empty-state-DtO_Mv2g.js";import{u as w}from"./chat-context-bTdV0PQS.js";import{u as B,k as L,t as _}from"./site-editor-toast-Bz5hIXUq.js";import{i as $,u as A,j as Q,S as U}from"./blocks-tab-states-DS5PjKyJ.js";import{a as G}from"./autosend-D-UTWUhf.js";function H(C){const e=I.c(7),{icon:l,title:i,description:t,action:n}=C;let a;e[0]!==n?(a=n?{children:n.label,onClick:n.onClick,disabled:n.disabled}:void 0,e[0]=n,e[1]=a):a=e[1];let o;return e[2]!==t||e[3]!==l||e[4]!==a||e[5]!==i?(o=r.jsx(v,{children:r.jsx(v.Content,{children:r.jsx(v.Container,{children:r.jsx(T,{icon:l,title:i,description:t,buttonProps:a})})})}),e[2]=t,e[3]=l,e[4]=a,e[5]=i,e[6]=o):o=e[6],o}function Y(C){const e=I.c(33),{virtualMcpId:l,icon:i,copy:t,skeleton:n,children:a}=C,o=M(),{org:p}=P(),k=w(),u=k?.currentBranch??null,g=B(l,u);R(g.kind==="protocol"&&g.source==="github");const{openPanel:D}=G();if(!u){const s=t.noDraftTitle,F=t.noDraftDesc;let d;e[0]!==o?(d=o("sectionsEditor.namedRules.openEditor"),e[0]=o,e[1]=d):d=e[1];let f;e[2]!==D?(f=()=>D("content"),e[2]=D,e[3]=f):f=e[3];let m;e[4]!==d||e[5]!==f?(m={label:d,onClick:f},e[4]=d,e[5]=f,e[6]=m):m=e[6];let j;return e[7]!==t.noDraftDesc||e[8]!==t.noDraftTitle||e[9]!==i||e[10]!==m?(j=r.jsx(H,{icon:i,title:s,description:F,action:m}),e[7]=t.noDraftDesc,e[8]=t.noDraftTitle,e[9]=i,e[10]=m,e[11]=j):j=e[11],j}if($(g)){let s;return e[12]===Symbol.for("react.memo_cache_sentinel")?(s=r.jsx(U,{}),e[12]=s):s=e[12],s}if(g.kind==="pending"){let s;return e[13]!==n?(s=r.jsx(r.Fragment,{children:n}),e[13]=n,e[14]=s):s=e[14],s}if(g.kind!=="protocol"){let s;return e[15]!==t.loadFailed||e[16]!==t.loadFailedHint||e[17]!==i?(s=r.jsx(H,{icon:i,title:t.loadFailed,description:t.loadFailedHint}),e[15]=t.loadFailed,e[16]=t.loadFailedHint,e[17]=i,e[18]=s):s=e[18],s}let c;e[19]!==u||e[20]!==p.slug||e[21]!==l?(c=JSON.stringify([p.slug,l,u]),e[19]=u,e[20]=p.slug,e[21]=l,e[22]=c):c=e[22];const h=k?.taskId??null;let x;return e[23]!==u||e[24]!==a||e[25]!==t||e[26]!==i||e[27]!==p.slug||e[28]!==n||e[29]!==c||e[30]!==h||e[31]!==l?(x=r.jsx(J,{orgSlug:p.slug,virtualMcpId:l,branch:u,threadId:h,icon:i,copy:t,skeleton:n,children:a},c),e[23]=u,e[24]=a,e[25]=t,e[26]=i,e[27]=p.slug,e[28]=n,e[29]=c,e[30]=h,e[31]=l,e[32]=x):x=e[32],x}function J(C){const e=I.c(35),{orgSlug:l,virtualMcpId:i,branch:t,threadId:n,icon:a,copy:o,skeleton:p,children:k}=C,u=M();let g;e[0]!==t||e[1]!==l||e[2]!==n||e[3]!==i?(g={orgSlug:l,virtualMcpId:i,branch:t,threadId:n,previewUrl:null},e[0]=t,e[1]=l,e[2]=n,e[3]=i,e[4]=g):g=e[4];const D=g,c=L(D),h=A(D),x=c.data,s=h.data;let F;e[5]!==t||e[6]!==l||e[7]!==i?(F={orgSlug:l,virtualMcpId:i,branch:t},e[5]=t,e[6]=l,e[7]=i,e[8]=F):F=e[8];const d=_(F,Q);if(!x||!s||!d.ready){if(c.isError||h.isError||d.failed){const N=o.loadFailed,O=o.loadFailedHint;let b;e[9]!==u?(b=u("sectionsEditor.namedRules.tryAgain"),e[9]=u,e[10]=b):b=e[10];let E;e[11]!==c||e[12]!==d||e[13]!==h?(E=()=>{c.isError&&c.refetch(),h.isError&&h.refetch(),d.failed&&d.retry()},e[11]=c,e[12]=d,e[13]=h,e[14]=E):E=e[14];let S;e[15]!==b||e[16]!==E?(S={label:b,onClick:E},e[15]=b,e[16]=E,e[17]=S):S=e[17];let y;return e[18]!==o.loadFailed||e[19]!==o.loadFailedHint||e[20]!==a||e[21]!==S?(y=r.jsx(H,{icon:a,title:N,description:O,action:S}),e[18]=o.loadFailed,e[19]=o.loadFailedHint,e[20]=a,e[21]=S,e[22]=y):y=e[22],y}let j;return e[23]!==p?(j=r.jsx(r.Fragment,{children:p}),e[23]=p,e[24]=j):j=e[24],j}let f;e[25]!==t||e[26]!==k||e[27]!==x||e[28]!==s||e[29]!==l||e[30]!==n||e[31]!==i?(f=k({orgSlug:l,virtualMcpId:i,branch:t,threadId:n,decofile:x,meta:s}),e[25]=t,e[26]=k,e[27]=x,e[28]=s,e[29]=l,e[30]=n,e[31]=i,e[32]=f):f=e[32];let m;return e[33]!==f?(m=r.jsx(r.Fragment,{children:f}),e[33]=f,e[34]=m):m=e[34],m}export{H as S,Y as a};