decocms 4.372.0 → 4.372.1

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 (369) hide show
  1. package/dist/client/assets/{AlertCircle-Ddrj7VUD.js → AlertCircle-DbwtWnTP.js} +1 -1
  2. package/dist/client/assets/{AreaChart-0mAtLd45.js → AreaChart-tdrxZdfF.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-BKbGYh2B.js → ArrowLeft-CyH6aWpS.js} +1 -1
  4. package/dist/client/assets/{ArrowRight-6hYTENh_.js → ArrowRight-Bv0iX4wy.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-Dhew3Evs.js → ArrowUp-Scf6R8DX.js} +1 -1
  6. package/dist/client/assets/{CartesianChart-u2Ri6JFS.js → CartesianChart-D1MxLL7k.js} +1 -1
  7. package/dist/client/assets/{Check-Dnz3uW0f.js → Check-BZE0WrNL.js} +1 -1
  8. package/dist/client/assets/{CheckCircle-DQbrJHsr.js → CheckCircle-BKb1RVrA.js} +1 -1
  9. package/dist/client/assets/{ChevronRight-DK_MoZ-7.js → ChevronRight-DNrwFBnC.js} +1 -1
  10. package/dist/client/assets/{ChevronSelectorVertical-B64gqtde.js → ChevronSelectorVertical-oXn0cTzk.js} +1 -1
  11. package/dist/client/assets/{ChevronUp-XOZg-HiO.js → ChevronUp-D5_IWEtB.js} +1 -1
  12. package/dist/client/assets/{Copy01-l6PfB431.js → Copy01-DTHuBaTA.js} +1 -1
  13. package/dist/client/assets/{CreditCard01-DQsLDZWx.js → CreditCard01-CwX6pA0M.js} +1 -1
  14. package/dist/client/assets/{Database01-vUZciuwF.js → Database01-RGlwXHSd.js} +1 -1
  15. package/dist/client/assets/{DotsVertical-Dyzdr42E.js → DotsVertical-DE9eZKrJ.js} +1 -1
  16. package/dist/client/assets/{Download01-_eUxcgg1.js → Download01-qX3hmvr5.js} +1 -1
  17. package/dist/client/assets/{ErrorBarContext-DFc19StE.js → ErrorBarContext-9sp0Dc4M.js} +1 -1
  18. package/dist/client/assets/{Eye-B7hZLXRZ.js → Eye-DXUjft5i.js} +1 -1
  19. package/dist/client/assets/{File02-D1W0NjQG.js → File02-g-xJPix_.js} +1 -1
  20. package/dist/client/assets/{GitBranch01-CRUhFeKk.js → GitBranch01-ddoPQdPH.js} +1 -1
  21. package/dist/client/assets/{Globe01-D9zr3JIX.js → Globe01-DIy8wXF6.js} +1 -1
  22. package/dist/client/assets/{HardDrive-7_ZjnLMv.js → HardDrive-DU_z1AQw.js} +1 -1
  23. package/dist/client/assets/{Image01-7_HSDHV3.js → Image01-DfaxHjlV.js} +1 -1
  24. package/dist/client/assets/{Key01-ti2CpCiW.js → Key01-mqjfsZRe.js} +1 -1
  25. package/dist/client/assets/{Line-D9piFifo.js → Line-D02_6GXf.js} +1 -1
  26. package/dist/client/assets/{Link01-DYWtgbsz.js → Link01-C656VtHx.js} +1 -1
  27. package/dist/client/assets/{LinkExternal01--55N_6ts.js → LinkExternal01-BkRUjBAn.js} +1 -1
  28. package/dist/client/assets/{MessageCircle01-DELRsE6A.js → MessageCircle01-CgotMmLL.js} +1 -1
  29. package/dist/client/assets/{Monitor01-BoIweS2p.js → Monitor01-CQ6Zk1oP.js} +1 -1
  30. package/dist/client/assets/{Package-CSgBbMFc.js → Package-t6euxYcP.js} +1 -1
  31. package/dist/client/assets/{Palette-CaHW8y9T.js → Palette-oECS8j3l.js} +1 -1
  32. package/dist/client/assets/{Play-BolLrTAn.js → Play-DQgzDnaW.js} +1 -1
  33. package/dist/client/assets/{Plus-C5azC59K.js → Plus-D2HOi_DD.js} +1 -1
  34. package/dist/client/assets/{Printer-Dn2De3ak.js → Printer-BpZBiqyG.js} +1 -1
  35. package/dist/client/assets/{SearchLg-BZUR3n9c.js → SearchLg-DbX4T5E-.js} +1 -1
  36. package/dist/client/assets/{SearchMd-Ms_xvSfF.js → SearchMd-FDCJM3CR.js} +1 -1
  37. package/dist/client/assets/{Sector-DHu8bCK4.js → Sector-BW9tyobX.js} +1 -1
  38. package/dist/client/assets/{Settings02-BLcAotUO.js → Settings02-CFcKewXh.js} +1 -1
  39. package/dist/client/assets/{Share07-BypmcbEF.js → Share07-CxuHcmnM.js} +1 -1
  40. package/dist/client/assets/{Shield01-C_5dC1mR.js → Shield01-HrKG6yUn.js} +1 -1
  41. package/dist/client/assets/{Stars01-DTStBsXP.js → Stars01-B_nM3FYf.js} +1 -1
  42. package/dist/client/assets/{Sun-CEaGM44s.js → Sun-SBoG-e9B.js} +1 -1
  43. package/dist/client/assets/{SwitchHorizontal01-l3o5r_PJ.js → SwitchHorizontal01-hHr6GOmU.js} +1 -1
  44. package/dist/client/assets/{Tool01-C0-Xqkxp.js → Tool01-DHi_Z7zo.js} +1 -1
  45. package/dist/client/assets/{Tool02-CE2Fqpba.js → Tool02-JY0gm8cg.js} +1 -1
  46. package/dist/client/assets/{Trash01-DPQmLNZV.js → Trash01-C6bziN5X.js} +1 -1
  47. package/dist/client/assets/{TrendUp01-uTlAwt0S.js → TrendUp01-Bkdgpfn7.js} +1 -1
  48. package/dist/client/assets/{Upload01-D-20AdeD.js → Upload01-DC2spim9.js} +1 -1
  49. package/dist/client/assets/{User01-BA1LEBvQ.js → User01-BbOpA84p.js} +1 -1
  50. package/dist/client/assets/{UserSquare-D-v_LgOa.js → UserSquare-qgzToKNd.js} +1 -1
  51. package/dist/client/assets/{Users01-BpRvBK8_.js → Users01-BOsDT0Jv.js} +1 -1
  52. package/dist/client/assets/{Users03-BaYGM99c.js → Users03-BP-0DNhp.js} +1 -1
  53. package/dist/client/assets/{X-Dh_K-VDi.js → X-Bzh3NI3m.js} +1 -1
  54. package/dist/client/assets/{XCircle-BhDUy79p.js → XCircle-CuK2q_XU.js} +1 -1
  55. package/dist/client/assets/{XClose-Bw0VS-dj.js → XClose-Cvyz3reC.js} +1 -1
  56. package/dist/client/assets/{Zap-TxetSnv7.js → Zap-DXNovEva.js} +1 -1
  57. package/dist/client/assets/{ZoomOut-CJKT31Kx.js → ZoomOut-BRjMa-04.js} +1 -1
  58. package/dist/client/assets/{access-gate-Dt6vr2zi.js → access-gate-NMf18NsK.js} +1 -1
  59. package/dist/client/assets/{add-connection-dialog-Bwzbw2rJ.js → add-connection-dialog-GfufFuLz.js} +1 -1
  60. package/dist/client/assets/{agent-analytics-OtUj5VAg.js → agent-analytics-DKvARLL3.js} +1 -1
  61. package/dist/client/assets/agent-app-CQgi_fkJ.js +1 -0
  62. package/dist/client/assets/{agent-assets-Ds2YrU5Y.js → agent-assets-DePuap3v.js} +1 -1
  63. package/dist/client/assets/{agent-automation-BzHNBuT4.js → agent-automation-NvLs9ax2.js} +1 -1
  64. package/dist/client/assets/{agent-automations-BvUPSQUr.js → agent-automations-BV3f-ekl.js} +1 -1
  65. package/dist/client/assets/{agent-connect-sources-B2VHxv-N.js → agent-connect-sources-DtqgR_Ib.js} +1 -1
  66. package/dist/client/assets/agent-deck-Dx12NQ18.js +1 -0
  67. package/dist/client/assets/{agent-e2e-CCN3csfU.js → agent-e2e-CHL03ziT.js} +1 -1
  68. package/dist/client/assets/{agent-experiments-C1xtDG8f.js → agent-experiments-CWfra8gc.js} +1 -1
  69. package/dist/client/assets/agent-file-B5qivcOi.js +1 -0
  70. package/dist/client/assets/{agent-git-O5fnLyKj.js → agent-git-CU-dqFim.js} +1 -1
  71. package/dist/client/assets/{agent-hosting-ClZ4R70M.js → agent-hosting-x-9xTx9o.js} +1 -1
  72. package/dist/client/assets/{agent-icon-Cyx7Smko.js → agent-icon-BD4DM2Lv.js} +1 -1
  73. package/dist/client/assets/agent-library-file-OKK2mnnF.js +1 -0
  74. package/dist/client/assets/{agent-monitor-B2s_I09z.js → agent-monitor-CpVDwlgY.js} +1 -1
  75. package/dist/client/assets/{agent-overview-CLGjxUwU.js → agent-overview-SQDEg6Zv.js} +1 -1
  76. package/dist/client/assets/agent-settings-BraxsXkL.js +1 -0
  77. package/dist/client/assets/{agent-site-editor-DElX-Rtx.js → agent-site-editor-BXrb3i4T.js} +1 -1
  78. package/dist/client/assets/agent-site-editor-code-03I9o24S.js +2 -0
  79. package/dist/client/assets/{agent-site-editor-content-D8Swy0HF.js → agent-site-editor-content-C3uy2bqp.js} +2 -2
  80. package/dist/client/assets/{agent-site-editor-preview-BEkJn_qI.js → agent-site-editor-preview-BB-KqzfI.js} +3 -3
  81. package/dist/client/assets/agent-view-74_Cuyp8.js +1 -0
  82. package/dist/client/assets/{agent-view-guard-Cc93o9kZ.js → agent-view-guard-q_9RifUL.js} +1 -1
  83. package/dist/client/assets/{agents-list-D23HRLNK.js → agents-list-BCgsEzHh.js} +1 -1
  84. package/dist/client/assets/{ai-providers-AQKJLPCp.js → ai-providers-DGgtE9F7.js} +1 -1
  85. package/dist/client/assets/{alert-Bb5psHaZ.js → alert-Cnsh1M35.js} +1 -1
  86. package/dist/client/assets/{alert-dialog-DfGZ77rh.js → alert-dialog-Bi9Cy1y8.js} +1 -1
  87. package/dist/client/assets/{api-keys-7xk7B181.js → api-keys-BlYGdiam.js} +1 -1
  88. package/dist/client/assets/api-keys-ClN6LoeU.js +1 -0
  89. package/dist/client/assets/app-editor-CaCDGdiz.js +1 -0
  90. package/dist/client/assets/{asset-utils-Dl8tpNxx.js → asset-utils-syVIRo9d.js} +1 -1
  91. package/dist/client/assets/{auth-5BCk_I76.js → auth-D-2jYpOE.js} +1 -1
  92. package/dist/client/assets/{auth-catchall-BXX_QHt4.js → auth-catchall-C3GEml6h.js} +1 -1
  93. package/dist/client/assets/{auth-entry-BYY2pacz.js → auth-entry-CJhH7CHs.js} +1 -1
  94. package/dist/client/assets/{auth-split-layout-Bh_B_vjZ.js → auth-split-layout-B3xBkE6i.js} +1 -1
  95. package/dist/client/assets/{authenticate-and-persist-oauth-Bj_Y1vgm.js → authenticate-and-persist-oauth-2yRhuiER.js} +1 -1
  96. package/dist/client/assets/{automation-list-row-TgtbvSc5.js → automation-list-row-DVPV4sOa.js} +1 -1
  97. package/dist/client/assets/{automation-runs-CVEQI8qU.js → automation-runs-DnDgp3GT.js} +1 -1
  98. package/dist/client/assets/automations-XsBsFuGM.js +1 -0
  99. package/dist/client/assets/{autosend-ClVEnX_S.js → autosend-D-BN-cv5.js} +1 -1
  100. package/dist/client/assets/{avatar-CR9KEb-s.js → avatar-Duu5Gg02.js} +1 -1
  101. package/dist/client/assets/{badge-DOT8HE5Z.js → badge-BNBGXxmC.js} +1 -1
  102. package/dist/client/assets/{block-document-Boj9yYni.js → block-document-BT-7XjFG.js} +1 -1
  103. package/dist/client/assets/{blocks-preview-workspace-context-Dh0KsAvE.js → blocks-preview-workspace-context-BvM2Da4n.js} +1 -1
  104. package/dist/client/assets/{breadcrumb-CVSmj3i3.js → breadcrumb-sWWxibcS.js} +1 -1
  105. package/dist/client/assets/{buckets-B0FCB4zB.js → buckets-Biauz5yB.js} +1 -1
  106. package/dist/client/assets/{build-improve-prompt-doc-C9jBTscU.js → build-improve-prompt-doc-RalyChXZ.js} +1 -1
  107. package/dist/client/assets/{bulk-category-panel-QprmcNHA.js → bulk-category-panel-CODUgRdO.js} +1 -1
  108. package/dist/client/assets/{calendar-SAWOBJxF.js → calendar-Dyov14Y_.js} +1 -1
  109. package/dist/client/assets/{capability-load-error-D1mxtMyB.js → capability-load-error-L3ivCxmO.js} +1 -1
  110. package/dist/client/assets/{cards-DQPi8IW_.js → cards-ojW-Mo-n.js} +1 -1
  111. package/dist/client/assets/category-editor-CFCxetoB.js +1 -0
  112. package/dist/client/assets/{chart-BGm-AILS.js → chart-Con9xnVz.js} +1 -1
  113. package/dist/client/assets/{chat-context-H28jTcB6.js → chat-context-BBVkwd3p.js} +1 -1
  114. package/dist/client/assets/{chat-draft-BTIUwp87.js → chat-draft-bAtYgASI.js} +1 -1
  115. package/dist/client/assets/{checkbox-D_GODf3h.js → checkbox-Dkejdmst.js} +1 -1
  116. package/dist/client/assets/{choose-editor-CqXPKhwg.js → choose-editor-BKF6XAA7.js} +1 -1
  117. package/dist/client/assets/{cli-auth-success-Nkuy_2dv.js → cli-auth-success-BUl2RZMr.js} +1 -1
  118. package/dist/client/assets/{client-icons-D55uOktL.js → client-icons-DLMNndDc.js} +1 -1
  119. package/dist/client/assets/{collapsible-CkoFdRnK.js → collapsible-n44mVpiB.js} +1 -1
  120. package/dist/client/assets/{collection-detail-7A7zRYv2.js → collection-detail-B7MXGdLU.js} +1 -1
  121. package/dist/client/assets/{collection-display-button-B730w9Ah.js → collection-display-button-C3iXY6zC.js} +1 -1
  122. package/dist/client/assets/{collection-search-B2t2IaOK.js → collection-search-CeA9TK20.js} +1 -1
  123. package/dist/client/assets/{collection-table-wrapper-87GtYm7N.js → collection-table-wrapper-SWoJua5h.js} +1 -1
  124. package/dist/client/assets/{collection-tabs-DAqaNYVU.js → collection-tabs-3kW0qDG6.js} +1 -1
  125. package/dist/client/assets/{combobox-CA5nnv9O.js → combobox-Px3Uvt7K.js} +1 -1
  126. package/dist/client/assets/{command-CtFXOSiX.js → command-D2fiEFer.js} +1 -1
  127. package/dist/client/assets/{command-palette-store-BL5hnWnv.js → command-palette-store-LVCQ6fRv.js} +1 -1
  128. package/dist/client/assets/{companion-mcps-section-DVYB246Y.js → companion-mcps-section-BcoKVpmX.js} +1 -1
  129. package/dist/client/assets/{connect-F12K-hsA.js → connect-DlipH902.js} +1 -1
  130. package/dist/client/assets/{connect-layout-DCgHt0wb.js → connect-layout-BQblJmFQ.js} +1 -1
  131. package/dist/client/assets/{connection-DhRpG43c.js → connection-BfiO32wM.js} +1 -1
  132. package/dist/client/assets/{connection-card-BCofIpgI.js → connection-card-83VJQMov.js} +1 -1
  133. package/dist/client/assets/{connection-detail-CkBpJk50.js → connection-detail-j_CvFKhd.js} +1 -1
  134. package/dist/client/assets/{connection-form-helpers-C7Pc9F54.js → connection-form-helpers-Ms_1nBbP.js} +1 -1
  135. package/dist/client/assets/{connections-BsBFmd4I.js → connections-CERSp27f.js} +1 -1
  136. package/dist/client/assets/{create-organization-dialog-CYwIBo_O.js → create-organization-dialog-D0myNU26.js} +1 -1
  137. package/dist/client/assets/{decofile-api-Cdto5FQ3.js → decofile-api-BVqR93jw.js} +1 -1
  138. package/dist/client/assets/{decopilot-BecreIFq.js → decopilot-72HlEf1U.js} +1 -1
  139. package/dist/client/assets/{dialog-SKkzdrcZ.js → dialog-DbzCN1O8.js} +1 -1
  140. package/dist/client/assets/{discover-BWfGXdtB.js → discover-D5kdY2vL.js} +1 -1
  141. package/dist/client/assets/{domain-settings-ClqqVAOw.js → domain-settings-uVxQd7aQ.js} +1 -1
  142. package/dist/client/assets/{download-app-dialog-DQE0snIy.js → download-app-dialog-Bsig7tOs.js} +1 -1
  143. package/dist/client/assets/{drawer-BleKwXKQ.js → drawer-CBdcJytm.js} +1 -1
  144. package/dist/client/assets/{dropdown-menu-DRuEZVW9.js → dropdown-menu-Dd8nakK9.js} +1 -1
  145. package/dist/client/assets/{editor-oZAad1yU.js → editor-CpBx0ZCm.js} +1 -1
  146. package/dist/client/assets/{empty-state-Bi9IU32F.js → empty-state-BIcQyeij.js} +1 -1
  147. package/dist/client/assets/{empty-state-CaG0BWIR.js → empty-state-ClEXvr10.js} +1 -1
  148. package/dist/client/assets/{extract-connection-data-C8zB3-0T.js → extract-connection-data-CM8c_Wvw.js} +1 -1
  149. package/dist/client/assets/{feature-gate-UfjS24Ou.js → feature-gate-BURkiaEd.js} +1 -1
  150. package/dist/client/assets/{feature-paywall-pQTqQ94T.js → feature-paywall-BOwjYKin.js} +1 -1
  151. package/dist/client/assets/{file-explorer-s0AeRobY.js → file-explorer-BgbzlNyO.js} +1 -1
  152. package/dist/client/assets/{file-preview-Dzjub9Lu.js → file-preview-BOFvyeTK.js} +1 -1
  153. package/dist/client/assets/{file-share-button-BqqM0Upa.js → file-share-button-Doj91OJi.js} +1 -1
  154. package/dist/client/assets/{file-type-icon-CMiynV8b.js → file-type-icon-C37FwvPU.js} +1 -1
  155. package/dist/client/assets/{folder-icon-3FCd-eRP.js → folder-icon-Dox5xEXV.js} +1 -1
  156. package/dist/client/assets/{form-H9AoFazU.js → form-B7dtslOD.js} +1 -1
  157. package/dist/client/assets/{gateway-client-BQS5H6XZ.js → gateway-client-CFIpVRaR.js} +1 -1
  158. package/dist/client/assets/{general-st9zEmU7.js → general-BcnikUr3.js} +1 -1
  159. package/dist/client/assets/{github-icon-TtZ8EUXE.js → github-icon-BcrkxW36.js} +1 -1
  160. package/dist/client/assets/{home-DMdfBPme.js → home-MrzklFP0.js} +1 -1
  161. package/dist/client/assets/{hooks-D5z7CgCt.js → hooks-CkL4R3Tj.js} +1 -1
  162. package/dist/client/assets/{hooks-abtcLONn.js → hooks-D09Ti1PG.js} +1 -1
  163. package/dist/client/assets/{index-C-9h82SA.js → index-B46P4HkV.js} +1 -1
  164. package/dist/client/assets/{index-BC68yJ9a.js → index-BFjKFLU3.js} +1 -1
  165. package/dist/client/assets/{index-DAUnTbKR.js → index-BwuwoN1w.js} +1 -1
  166. package/dist/client/assets/{index-C1pofvkl.js → index-C9w15wdL.js} +1 -1
  167. package/dist/client/assets/{index-BQgXOHRB.js → index-CULK6hDm.js} +1 -1
  168. package/dist/client/assets/{index-Cm__CFgO.js → index-CuiP-22D.js} +1 -1
  169. package/dist/client/assets/{index-CdCU_XIc.js → index-Cyoz5tz5.js} +1 -1
  170. package/dist/client/assets/{index-Os5Hiv1r.js → index-D-XXgZ8p.js} +1 -1
  171. package/dist/client/assets/{index-tw-L0pq4.js → index-D68Q2TT2.js} +1 -1
  172. package/dist/client/assets/{index-CHIEfkY6.js → index-DLxUQ-f9.js} +1 -1
  173. package/dist/client/assets/{index-C4m-Xj9t.js → index-DZOe0ODJ.js} +1 -1
  174. package/dist/client/assets/{index-CZFOUXi8.js → index-G9Ugx8pT.js} +1 -1
  175. package/dist/client/assets/{index-soiZgi77.js → index-KOGfrBZR.js} +1 -1
  176. package/dist/client/assets/{index-CoJzC8_g.js → index-NrvdR10n.js} +1 -1
  177. package/dist/client/assets/{index-redirect-BGMUaELH.js → index-redirect-AuU1lkcv.js} +1 -1
  178. package/dist/client/assets/{index-Cjhl57C5.js → index-z4bKt11m.js} +2 -2
  179. package/dist/client/assets/{infiniteQueryObserver-CTAqrRzL.js → infiniteQueryObserver-BjcfJE2O.js} +1 -1
  180. package/dist/client/assets/{infra-billing-D-R9Zdx8.js → infra-billing-Blv1R6xm.js} +1 -1
  181. package/dist/client/assets/{input-CImpk8th.js → input-C7XH8Uj_.js} +1 -1
  182. package/dist/client/assets/{input-DkPDVfFk.js → input-CSQboV8k.js} +1 -1
  183. package/dist/client/assets/{input-DNp0K9zv.js → input-I71U33T1.js} +1 -1
  184. package/dist/client/assets/{integration-icon-Dq1cJDX8.js → integration-icon-DOHTaQ6D.js} +1 -1
  185. package/dist/client/assets/{label-Bk7iLZH7.js → label-8juC5J-g.js} +1 -1
  186. package/dist/client/assets/{last-preview-page-BmfL1c7N.js → last-preview-page-C8M_ayBL.js} +1 -1
  187. package/dist/client/assets/{layout-Ci3akdxf.js → layout-fdXIUmGR.js} +1 -1
  188. package/dist/client/assets/{legacy-agents-deep-CqdHGYTA.js → legacy-agents-deep-CIQ2cOBs.js} +1 -1
  189. package/dist/client/assets/{legacy-main-redirect-BqiddEXn.js → legacy-main-redirect-DdrzU7Xj.js} +1 -1
  190. package/dist/client/assets/{library-BUfXzmmk.js → library-DyrbEVfm.js} +1 -1
  191. package/dist/client/assets/{login-BUL2HRoD.js → login-BhC3su0G.js} +1 -1
  192. package/dist/client/assets/{markdown-Cqyyk371.js → markdown-BhLIBmBv.js} +1 -1
  193. package/dist/client/assets/{mcp-app-renderer-zIU2-SQD.js → mcp-app-renderer-DjwQ0S-h.js} +1 -1
  194. package/dist/client/assets/{mcp-oauth-qvcFIOHE.js → mcp-oauth-DiqQlKOx.js} +1 -1
  195. package/dist/client/assets/{members-B2ASFRpM.js → members-PF8wxsqA.js} +1 -1
  196. package/dist/client/assets/{message-templates-BvJNSKe2.js → message-templates-BvR8vQvs.js} +1 -1
  197. package/dist/client/assets/{mini-report-page-GL8Uh_Lo.js → mini-report-page-D2etEugE.js} +1 -1
  198. package/dist/client/assets/{mock-board-D2--sNwu.js → mock-board-jCiKK3gA.js} +3 -3
  199. package/dist/client/assets/{monaco-editor-Bg8UPXit.js → monaco-editor-BHu8MLvz.js} +1 -1
  200. package/dist/client/assets/{monitoring-stats-row-C9igDEpY.js → monitoring-stats-row-2QEp_Jld.js} +1 -1
  201. package/dist/client/assets/{multi-select-B0yDI0nj.js → multi-select-DcF09HV8.js} +1 -1
  202. package/dist/client/assets/{mustache-CDAsLK2v.js → mustache-DtVu96DY.js} +1 -1
  203. package/dist/client/assets/{oauth-callback-D8Lk8lTx.js → oauth-callback-CwSlt3mo.js} +1 -1
  204. package/dist/client/assets/{oauth-callback-ai-provider-P1E8_NRm.js → oauth-callback-ai-provider-Co0a0HMU.js} +1 -1
  205. package/dist/client/assets/{onboarding-Df5HIECJ.js → onboarding-D-ej0NPt.js} +1 -1
  206. package/dist/client/assets/{optimistic-project-sidebar-views-IR0sppyV.js → optimistic-project-sidebar-views-yjPJnhEG.js} +1 -1
  207. package/dist/client/assets/{org-file-open-context-Dd47NmeH.js → org-file-open-context-BgiBbqKQ.js} +1 -1
  208. package/dist/client/assets/{organization-choice-B_XEkc76.js → organization-choice-loyQwhEZ.js} +1 -1
  209. package/dist/client/assets/{orgs-BAOnfPU8.js → orgs-DkENMfud.js} +1 -1
  210. package/dist/client/assets/{page-seo-form-DbL4-FYa.js → page-seo-form-BBCLz5m0.js} +1 -1
  211. package/dist/client/assets/{pair-BHYz9F-Z.js → pair-B2TMNGEX.js} +1 -1
  212. package/dist/client/assets/{plan-ladder-Cqfgwdfc.js → plan-ladder-C80Qcxkm.js} +1 -1
  213. package/dist/client/assets/{popover-Bn0xXLy8.js → popover-CsEsUqbZ.js} +1 -1
  214. package/dist/client/assets/{post-calendar-6AuB-9GD.js → post-calendar-gswoVxcp.js} +1 -1
  215. package/dist/client/assets/{post-editor-D6gFXTiI.js → post-editor-5tYPjO0c.js} +1 -1
  216. package/dist/client/assets/{preview-content-BJK2rc2w.js → preview-content-D5E6-qEP.js} +1 -1
  217. package/dist/client/assets/{preview-dialog-CdfWw2XK.js → preview-dialog-D1qWdONG.js} +1 -1
  218. package/dist/client/assets/{primitives-CSJauIt5.js → primitives-Dy5hA1_y.js} +1 -1
  219. package/dist/client/assets/{profile-BUYSJtW_.js → profile-9GEyG1R7.js} +1 -1
  220. package/dist/client/assets/{project-app-view-BAHsn_eP.js → project-app-view-CsjjG0iu.js} +1 -1
  221. package/dist/client/assets/{project-feed-La6-iUzD.js → project-feed-CEhr0jA4.js} +1 -1
  222. package/dist/client/assets/{project-icon-CiuTzDLi.js → project-icon-Cw3la58q.js} +1 -1
  223. package/dist/client/assets/project-reports-D83XbTn5.js +1 -0
  224. package/dist/client/assets/project-tasks-IrwgrDaD.js +1 -0
  225. package/dist/client/assets/{prompts-BAZWbRxz.js → prompts-DQaXCBzS.js} +1 -1
  226. package/dist/client/assets/record-editor-C02fIlfV.js +1 -0
  227. package/dist/client/assets/{redirect-editor-9oPfVcJw.js → redirect-editor-B2uGI7FY.js} +1 -1
  228. package/dist/client/assets/registry-CORfkc_Z.js +2 -0
  229. package/dist/client/assets/{registry-layout-CrG4EYUR.js → registry-layout-tJiz4Tt0.js} +1 -1
  230. package/dist/client/assets/{reports-DHS4fi6t.js → reports-DvgXBdzM.js} +1 -1
  231. package/dist/client/assets/reports-X2I2m9Nu.js +1 -0
  232. package/dist/client/assets/{reports-onboarding-BtdzeKZT.js → reports-onboarding-BLUSVbkd.js} +1 -1
  233. package/dist/client/assets/{reports-tab-B5bMQgk-.js → reports-tab-DSknxHUH.js} +2 -2
  234. package/dist/client/assets/{repositories-DbRCe9LF.js → repositories-cOMgIGPf.js} +1 -1
  235. package/dist/client/assets/{repository-import-picker-Bo_Cabzz.js → repository-import-picker-C0YugeGx.js} +1 -1
  236. package/dist/client/assets/{repository-picker-CRqY_3jm.js → repository-picker-BaqWNwxf.js} +1 -1
  237. package/dist/client/assets/{require-capability-CLz-loNQ.js → require-capability-CjU7EXPP.js} +1 -1
  238. package/dist/client/assets/{required-auth-layout-t1gcmOkS.js → required-auth-layout-WkX8CtfT.js} +1 -1
  239. package/dist/client/assets/{reset-password-C_PBrpSa.js → reset-password-FnA2kczZ.js} +1 -1
  240. package/dist/client/assets/{resizable-CTEnH3yu.js → resizable-7umHaFcH.js} +1 -1
  241. package/dist/client/assets/{review-settings-CIZvhdQE.js → review-settings-BHAkNdHq.js} +1 -1
  242. package/dist/client/assets/{rich-text-link-control-DdZo0zBm.js → rich-text-link-control-DgGIjR0I.js} +1 -1
  243. package/dist/client/assets/{roles-D7Yxadr5.js → roles-iNTzpIoS.js} +1 -1
  244. package/dist/client/assets/{route-DMLSQe3Y.js → route-BdFq2Icl.js} +1 -1
  245. package/dist/client/assets/{route-aV7nBxG9.js → route-D2mgsDfh.js} +1 -1
  246. package/dist/client/assets/{route-BhbKY_6m.js → route-DQ3O_pQ7.js} +1 -1
  247. package/dist/client/assets/{runnable-block-editor-CNau3nKH.js → runnable-block-editor-CCXhy-vO.js} +1 -1
  248. package/dist/client/assets/{sandbox-lifecycle-context-Dhs5hLj1.js → sandbox-lifecycle-context-DL9kkwoa.js} +1 -1
  249. package/dist/client/assets/{schema-BTHH8GSh.js → schema-D0xfowSf.js} +1 -1
  250. package/dist/client/assets/{scroll-area-YQLTU6PQ.js → scroll-area-BqCCUXvj.js} +1 -1
  251. package/dist/client/assets/{search-input-Cx2Izgwg.js → search-input-DpLbMQRj.js} +1 -1
  252. package/dist/client/assets/{secrets-B1YWh_ht.js → secrets-B9E8fieV.js} +1 -1
  253. package/dist/client/assets/{sections-editor-C4NhZuXp.js → sections-editor-D24EQfD8.js} +1 -1
  254. package/dist/client/assets/{select-C5Qbx8Kw.js → select-cIekAVlM.js} +1 -1
  255. package/dist/client/assets/{select-model-CIR4DebA.js → select-model-DcwphIdD.js} +1 -1
  256. package/dist/client/assets/{seo-editor-b4BYh3S0.js → seo-editor-BRYLT6tF.js} +1 -1
  257. package/dist/client/assets/{settings-tab-wJidOo3Q.js → settings-tab-DKZf7OJg.js} +1 -1
  258. package/dist/client/assets/{sheet-DvqFDAlT.js → sheet-DhNzwMUj.js} +1 -1
  259. package/dist/client/assets/{shell-layout-knqcStSb.js → shell-layout-DMJSwXH6.js} +1 -1
  260. package/dist/client/assets/{sidebar-CPIvGktg.js → sidebar-BCim0GYP.js} +1 -1
  261. package/dist/client/assets/{skill-preview-Dr3uDA0q.js → skill-preview-eH_MzYft.js} +1 -1
  262. package/dist/client/assets/{skills-B7mrIhFJ.js → skills-BtiwGp2Q.js} +1 -1
  263. package/dist/client/assets/{sso-JfSG6sY-.js → sso-BOpSC7cb.js} +1 -1
  264. package/dist/client/assets/{store-CRU_7Bvk.js → store-DmrioYP8.js} +1 -1
  265. package/dist/client/assets/store-registry-B398fyC0.js +2 -0
  266. package/dist/client/assets/{switch-Cf30aXkY.js → switch-9PLadaw_.js} +1 -1
  267. package/dist/client/assets/{synced-repos-C5RH3GVW.js → synced-repos-gfJnKqre.js} +1 -1
  268. package/dist/client/assets/{table-D6IMkB4T.js → table-B6mPp07a.js} +1 -1
  269. package/dist/client/assets/{tabs-DSOAK--9.js → tabs-Co2GUrNY.js} +1 -1
  270. package/dist/client/assets/{task-board-DpuhnKzF.js → task-board-lQZGfEfb.js} +1 -1
  271. package/dist/client/assets/{task-route-CPm3yGLT.js → task-route-Btltx00G.js} +1 -1
  272. package/dist/client/assets/{task-status-CesK2f9G.js → task-status-CLlOhQGx.js} +1 -1
  273. package/dist/client/assets/{taskboard-analytics-DWWMZZdU.js → taskboard-analytics-CCRKXVH2.js} +1 -1
  274. package/dist/client/assets/tasks-BqLnbtfB.js +1 -0
  275. package/dist/client/assets/{tasks-BGbHPX0w.js → tasks-D_kcQmbi.js} +1 -1
  276. package/dist/client/assets/{textarea-DXDx4Cy0.js → textarea-BEOceSll.js} +1 -1
  277. package/dist/client/assets/{thread-intent-Cdmdi4Qs.js → thread-intent-9fI0jPLV.js} +1 -1
  278. package/dist/client/assets/{thread-route-CnHTxNkK.js → thread-route-B1EuqJlg.js} +1 -1
  279. package/dist/client/assets/{thread-route-BMICHdvv.js → thread-route-DG6kj-ho.js} +1 -1
  280. package/dist/client/assets/{thread-sheet-body-BGNoSu7i.js → thread-sheet-body-CbIiPC8V.js} +1 -1
  281. package/dist/client/assets/{toggle-group-Cj0z3PRY.js → toggle-group-Ck5f9XVv.js} +1 -1
  282. package/dist/client/assets/{toolbar-icon-button-BehOLAeE.js → toolbar-icon-button-8ctMGgIP.js} +1 -1
  283. package/dist/client/assets/{tooltip-BDUrOxgN.js → tooltip-BuKeolDX.js} +1 -1
  284. package/dist/client/assets/{track-BJHbd99y.js → track-B7aLvyYR.js} +1 -1
  285. package/dist/client/assets/{types-DlfDRNRB.js → types-Bh4jNqv3.js} +1 -1
  286. package/dist/client/assets/{usage-stats-nuoZXpxw.js → usage-stats-waRf4dtg.js} +1 -1
  287. package/dist/client/assets/{use-ai-providers-QvFz5SFX.js → use-ai-providers-B0bxSHYG.js} +1 -1
  288. package/dist/client/assets/{use-automations-jwtTHLHf.js → use-automations-BdS9yl-d.js} +1 -1
  289. package/dist/client/assets/{use-autosave-D5Khb0ju.js → use-autosave-CfERN5UF.js} +1 -1
  290. package/dist/client/assets/{use-connect-companion-DDWKSdwn.js → use-connect-companion-_GDNSGRN.js} +1 -1
  291. package/dist/client/assets/{use-connection-CpOBycNm.js → use-connection-CPQUKm0a.js} +1 -1
  292. package/dist/client/assets/{use-copy-M0GDas2Q.js → use-copy-DUiBegp6.js} +1 -1
  293. package/dist/client/assets/{use-create-virtual-mcp-BFxHh87r.js → use-create-virtual-mcp-BRT9hKZ3.js} +1 -1
  294. package/dist/client/assets/{use-date-fns-locale-BAJylOmL.js → use-date-fns-locale-PFUAQIxr.js} +1 -1
  295. package/dist/client/assets/{use-debounced-autosave-CAXyZd0j.js → use-debounced-autosave-CyDohN_c.js} +1 -1
  296. package/dist/client/assets/{use-debounced-value-CVkWNti9.js → use-debounced-value-DeY1TNRX.js} +1 -1
  297. package/dist/client/assets/{use-deco-credits-D4THYOkS.js → use-deco-credits-Du6WCMYS.js} +1 -1
  298. package/dist/client/assets/{use-decopilot-events-DlUI-60k.js → use-decopilot-events-_O_0AHeH.js} +1 -1
  299. package/dist/client/assets/{use-delete-connection-BznnJgfw.js → use-delete-connection-kqt66yqS.js} +1 -1
  300. package/dist/client/assets/{use-deployment-admin-Buoxj9IO.js → use-deployment-admin-MznxNIiy.js} +1 -1
  301. package/dist/client/assets/{use-entitlements-BP7WwVM_.js → use-entitlements-BWaaNeuI.js} +1 -1
  302. package/dist/client/assets/{use-fast-preview-draft-url-Cu15Ye_n.js → use-fast-preview-draft-url-BrZtKg6o.js} +1 -1
  303. package/dist/client/assets/{use-file-configs-CyU7Mcil.js → use-file-configs-sqbLS09v.js} +1 -1
  304. package/dist/client/assets/{use-infinite-scroll-AtjP0SZW.js → use-infinite-scroll-RrOnf-fI.js} +1 -1
  305. package/dist/client/assets/{use-join-requests-aG0T3ECI.js → use-join-requests-BZzsbvb0.js} +1 -1
  306. package/dist/client/assets/{use-main-panel-tabs-IIO818_j.js → use-main-panel-tabs-CyT7yQAB.js} +1 -1
  307. package/dist/client/assets/{use-mcp-auth-status-bcJwzpw7.js → use-mcp-auth-status-DvQCYJw0.js} +1 -1
  308. package/dist/client/assets/{use-mcp-client-Bf0VpOBw.js → use-mcp-client-B1u2B39v.js} +1 -1
  309. package/dist/client/assets/{use-mcp-prompts-DxcgJEJ7.js → use-mcp-prompts-DxT8Kz-M.js} +1 -1
  310. package/dist/client/assets/{use-mcp-tools-DhZM9sTC.js → use-mcp-tools-Ch_j97A3.js} +1 -1
  311. package/dist/client/assets/{use-members-CsAzsmBA.js → use-members-H3oi0qPu.js} +1 -1
  312. package/dist/client/assets/{use-mobile-C5SrWG9H.js → use-mobile-CV7f0Wqe.js} +1 -1
  313. package/dist/client/assets/{use-navigate-to-agent-DOYg6fyU.js → use-navigate-to-agent-BMSyO1iB.js} +1 -1
  314. package/dist/client/assets/{use-open-billing-url-Cjz--xRu.js → use-open-billing-url-BGn9Wkis.js} +1 -1
  315. package/dist/client/assets/{use-org-auth-client-C16MEGGe.js → use-org-auth-client-ZxEGrzhh.js} +1 -1
  316. package/dist/client/assets/{use-org-fs-BSDHmLev.js → use-org-fs-D6lKuMAi.js} +1 -1
  317. package/dist/client/assets/{use-org-notice-BALWnbFe.js → use-org-notice-C5thI8aD.js} +1 -1
  318. package/dist/client/assets/{use-org-sso-Dpa7KwXX.js → use-org-sso-vHIufIoJ.js} +1 -1
  319. package/dist/client/assets/{use-organization-roles-Cog-K9KN.js → use-organization-roles-DmWmnvDm.js} +1 -1
  320. package/dist/client/assets/{use-organization-settings-pqtCEzuj.js → use-organization-settings-C-XY0Wze.js} +1 -1
  321. package/dist/client/assets/{use-panel-navigate-bhAOxlzp.js → use-panel-navigate-BG4d0Vrr.js} +1 -1
  322. package/dist/client/assets/{use-project-native-view-presence-DnirX6kM.js → use-project-native-view-presence-0NQTfFQT.js} +1 -1
  323. package/dist/client/assets/{use-project-scope-BfeOcOX-.js → use-project-scope-DRope0ob.js} +1 -1
  324. package/dist/client/assets/{use-registry-connections-BJotyFay.js → use-registry-connections-D_a0MIjQ.js} +1 -1
  325. package/dist/client/assets/{use-releases-CjPEhpWE.js → use-releases-BPrtCiPS.js} +1 -1
  326. package/dist/client/assets/{use-reports-diagnostic-R9_oa5XU.js → use-reports-diagnostic-BtS3SpeX.js} +1 -1
  327. package/dist/client/assets/{use-route-default-main-DO9nAIOF.js → use-route-default-main-DBXt2fvS.js} +1 -1
  328. package/dist/client/assets/{use-secrets-Do9S2OuA.js → use-secrets-C5iKdreo.js} +1 -1
  329. package/dist/client/assets/{use-section-preview-base-DTsnvRL8.js → use-section-preview-base-Dwn5dF7B.js} +1 -1
  330. package/dist/client/assets/{use-session-runtime--RMOkDN5.js → use-session-runtime-DU2zS-3V.js} +1 -1
  331. package/dist/client/assets/{use-tags-C-xYWG0d.js → use-tags-BvskEBAC.js} +1 -1
  332. package/dist/client/assets/{use-task-board-analytics-DqKWhXe3.js → use-task-board-analytics-DjIJHPkR.js} +1 -1
  333. package/dist/client/assets/{use-task-metadata-Bm567Cyu.js → use-task-metadata-9gheSHac.js} +1 -1
  334. package/dist/client/assets/{use-thread-outputs-DA9fNv-d.js → use-thread-outputs-DAcljy5D.js} +1 -1
  335. package/dist/client/assets/{use-view-mode-mEqX4oRI.js → use-view-mode-CTt0Tykp.js} +1 -1
  336. package/dist/client/assets/{use-virtual-mcp-BvrPyGzX.js → use-virtual-mcp-Bq1RMGPF.js} +1 -1
  337. package/dist/client/assets/useInfiniteQuery-C6OBOha-.js +1 -0
  338. package/dist/client/assets/{useQueries-DqQ6INqi.js → useQueries-DMqJmHGu.js} +1 -1
  339. package/dist/client/assets/useSuspenseInfiniteQuery-XFcbI_PD.js +1 -0
  340. package/dist/client/assets/{users-BS3mOvNq.js → users-B0Y-7Aab.js} +1 -1
  341. package/dist/client/assets/{utils-DAYUNxCI.js → utils-CU3t1jst.js} +1 -1
  342. package/dist/client/assets/{variant-calendar-D_T3c3MC.js → variant-calendar-Bp201sXA.js} +1 -1
  343. package/dist/client/assets/{variant-matcher-override-BSFlzIhP.js → variant-matcher-override-DUPu0vkW.js} +1 -1
  344. package/dist/client/assets/{view-mode-toggle-CzqFE_Lp.js → view-mode-toggle-DaZN0qXY.js} +1 -1
  345. package/dist/client/assets/{virtual-mcp-CG3JbZx8.js → virtual-mcp-BYPZngzy.js} +1 -1
  346. package/dist/client/index.html +1 -1
  347. package/dist/server/cli.js +118 -118
  348. package/dist/server/server.js +114 -114
  349. package/package.json +1 -1
  350. package/dist/client/assets/agent-app-huXdhJP6.js +0 -1
  351. package/dist/client/assets/agent-deck-DGboeeyf.js +0 -1
  352. package/dist/client/assets/agent-file-B8pH22Ku.js +0 -1
  353. package/dist/client/assets/agent-library-file-D-88nLF8.js +0 -1
  354. package/dist/client/assets/agent-settings-BzADpWtq.js +0 -1
  355. package/dist/client/assets/agent-site-editor-code-CGdhTJXE.js +0 -2
  356. package/dist/client/assets/agent-view-BZUeqD_l.js +0 -1
  357. package/dist/client/assets/api-keys-DfV1qFa5.js +0 -1
  358. package/dist/client/assets/app-editor-CK2-PFMD.js +0 -1
  359. package/dist/client/assets/automations-CfjjbeEx.js +0 -1
  360. package/dist/client/assets/category-editor-CG20ku6V.js +0 -1
  361. package/dist/client/assets/project-reports-jZGDkYDU.js +0 -1
  362. package/dist/client/assets/project-tasks-BDg0EJtT.js +0 -1
  363. package/dist/client/assets/record-editor-C96ND1CU.js +0 -1
  364. package/dist/client/assets/registry-rXZoWB8a.js +0 -2
  365. package/dist/client/assets/reports-C9YET_Fq.js +0 -1
  366. package/dist/client/assets/store-registry-Q0TOzx2-.js +0 -2
  367. package/dist/client/assets/tasks-DTqkQgJb.js +0 -1
  368. package/dist/client/assets/useInfiniteQuery-C-lwb5Ji.js +0 -1
  369. package/dist/client/assets/useSuspenseInfiniteQuery-CjJ_vWiS.js +0 -1
@@ -1 +1 @@
1
- import{c as y,b as T,j as n,I as It,r as A,J as xs,M as E,l as z,B as Le,F as gs,R as we,U as Xe,o as F,X as Pt,a as Y,d as $e,v as Tt,t as re,Y as hs,Z as zt,_ as At,n as Ot,e as bs,K as Ee,w as js,$ as vs,m as st,a0 as ys,s as Ss,L as Rt,a1 as M,C as ce,D as nt,a2 as ks,a3 as jt,a4 as Ns,a5 as _s,a6 as ws,a7 as $s,a8 as Cs,f as Is,k as Ps,a9 as Ts,E as zs,u as As,O as Os}from"./index-Cjhl57C5.js";import{u as Ce,S as Rs,a as Ds,b as Ms,c as ae,d as L,e as se,f as Ye,g as Ls,h as Es}from"./sidebar-CPIvGktg.js";import{S as Fs,a as qs,b as Vs}from"./sheet-DvqFDAlT.js";import{u as ot}from"./use-mobile-C5SrWG9H.js";import{i as it,a as Bs}from"./Printer-Dn2De3ak.js";import{P as Ne}from"./index-CZFOUXi8.js";import{T as rt,I as Us}from"./toolbar-icon-button-BehOLAeE.js";import{u as Hs,i as Dt}from"./use-org-notice-BALWnbFe.js";import{u as Se,a as He,b as Mt}from"./use-project-scope-BfeOcOX-.js";import{u as Ks}from"./thread-route-CnHTxNkK.js";import{L as Z}from"./anchors-yqDzZN4K.js";import{P as at,a as Ke,b as lt}from"./popover-Bn0xXLy8.js";import{D as Lt,a as Et,b as Ft,c as Ws}from"./drawer-BleKwXKQ.js";import{A as Fe}from"./avatar-CR9KEb-s.js";import{T as ct,a as dt,b as Gs,c as ut}from"./tooltip-BDUrOxgN.js";import{a as Qs}from"./Copy01-l6PfB431.js";import{n as Js}from"./Download01-_eUxcgg1.js";import{i as Xs}from"./Globe01-D9zr3JIX.js";import{n as qt}from"./LinkExternal01--55N_6ts.js";import{g as Ze,e as Ys}from"./TrendUp01-uTlAwt0S.js";import{i as Vt}from"./Monitor01-BoIweS2p.js";import{n as Zs,a as en}from"./Sun-CEaGM44s.js";import{a as Bt}from"./Settings02-BLcAotUO.js";import{i as tn}from"./Shield01-C_5dC1mR.js";import{t as sn,a as nn,i as on,b as rn,c as Ut,s as mt,d as an,A as ln,n as Ht,e as Kt,f as cn,g as dn,h as un,j as mn,k as fn,l as pn,m as xn}from"./agent-icon-Cyx7Smko.js";import{b as et,t as gn}from"./Users03-BaYGM99c.js";import{u as hn}from"./use-deployment-admin-Buoxj9IO.js";import{u as bn}from"./use-is-desktop-app-BNujXJc_.js";import{i as jn,a as vt,D as vn}from"./download-app-dialog-DQE0snIy.js";import{I as yn,u as Sn}from"./use-join-requests-aG0T3ECI.js";import{u as kn}from"./use-deco-credits-D4THYOkS.js";import{u as Nn,a as Wt}from"./use-entitlements-BP7WwVM_.js";import{u as _n,P as wn}from"./plan-ladder-Cqfgwdfc.js";import{u as $n}from"./use-organization-settings-pqtCEzuj.js";import{S as Cn}from"./scroll-area-YQLTU6PQ.js";import{u as In}from"./useInfiniteQuery-C-lwb5Ji.js";import{n as Pn}from"./hooks-D5z7CgCt.js";import{t as Gt,S as Tn,b as zn,p as An,a as On,i as Rn,c as Dn,d as Mn}from"./task-route-CPm3yGLT.js";import{g as Ln}from"./get-initials-D-f_fDFw.js";import{a as En}from"./format-time-BtXRrtv4.js";import{i as qe}from"./Check-Dnz3uW0f.js";import{i as Fn}from"./ChevronSelectorVertical-B64gqtde.js";import{s as qn}from"./Plus-C5azC59K.js";import{C as yt,a as Me,b as Ve,c as Vn,d as Bn,e as Un}from"./command-CtFXOSiX.js";import{P as ft}from"./project-icon-CiuTzDLi.js";import{C as Hn}from"./create-organization-dialog-CYwIBo_O.js";import{s as Kn}from"./XClose-Bw0VS-dj.js";import{u as Wn}from"./use-virtual-mcp-BvrPyGzX.js";import{i as Gn}from"./Share07-BypmcbEF.js";import{i as Qn}from"./ArrowLeft-BKbGYh2B.js";import{e as Jn,r as Qt,u as Xn,s as Yn,p as Zn,P as eo}from"./use-project-native-view-presence-DnirX6kM.js";import{u as Jt}from"./optimistic-project-sidebar-views-IR0sppyV.js";import{u as pt}from"./use-navigate-to-agent-DOYg6fyU.js";import{c as to}from"./SwitchHorizontal01-l3o5r_PJ.js";import{a as so}from"./Image01-7_HSDHV3.js";import{u as no}from"./use-panel-navigate-bhAOxlzp.js";import{t as oo}from"./ChevronUp-XOZg-HiO.js";import{i as io}from"./ChevronRight-DK_MoZ-7.js";import{i as ro}from"./CreditCard01-DQsLDZWx.js";import{i as ao}from"./GitBranch01-CRUhFeKk.js";import{i as lo}from"./HardDrive-7_ZjnLMv.js";import{i as co}from"./Key01-ti2CpCiW.js";import{t as uo}from"./Stars01-DTStBsXP.js";import{s as mo}from"./User01-BA1LEBvQ.js";import{i as fo}from"./Zap-TxetSnv7.js";import{p as po,q as xo}from"./question-004-sINsf4GQ.js";import{u as go}from"./use-decopilot-events-DlUI-60k.js";import"./X-Dh_K-VDi.js";import"./github-repo-BknN0SVI.js";import"./index-C-9h82SA.js";import"./AlertCircle-Ddrj7VUD.js";import"./Tool01-C0-Xqkxp.js";import"./ArrowUp-Dhew3Evs.js";import"./Tool02-CE2Fqpba.js";import"./ArrowRight-6hYTENh_.js";import"./ZoomOut-CJKT31Kx.js";import"./CheckCircle-DQbrJHsr.js";import"./DotsVertical-Dyzdr42E.js";import"./UserSquare-D-v_LgOa.js";import"./Database01-vUZciuwF.js";import"./MessageCircle01-DELRsE6A.js";import"./Eye-B7hZLXRZ.js";import"./File02-D1W0NjQG.js";import"./Link01-DYWtgbsz.js";import"./Package-CSgBbMFc.js";import"./Palette-CaHW8y9T.js";import"./Play-BolLrTAn.js";import"./SearchLg-BZUR3n9c.js";import"./SearchMd-Ms_xvSfF.js";import"./Trash01-DPQmLNZV.js";import"./Upload01-D-20AdeD.js";import"./Users01-BpRvBK8_.js";import"./XCircle-BhDUy79p.js";import"./dialog-SKkzdrcZ.js";import"./form-H9AoFazU.js";import"./label-Bk7iLZH7.js";import"./select-C5Qbx8Kw.js";import"./textarea-DXDx4Cy0.js";import"./use-org-auth-client-C16MEGGe.js";import"./use-organization-roles-Cog-K9KN.js";import"./use-ai-providers-QvFz5SFX.js";import"./schema-BTHH8GSh.js";import"./task-board-DpuhnKzF.js";import"./infiniteQueryObserver-CTAqrRzL.js";import"./use-mcp-client-Bf0VpOBw.js";import"./auth-5BCk_I76.js";import"./backoff-8mStPHYB.js";import"./dropdown-menu-DRuEZVW9.js";import"./github-icon-TtZ8EUXE.js";import"./differenceInSeconds-C3x8sHUj.js";import"./index-CdCU_XIc.js";import"./alert-dialog-DfGZ77rh.js";import"./input-CImpk8th.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./use-file-configs-CyU7Mcil.js";import"./site-slug-uya6Wp4-.js";import"./thread-intent-Cdmdi4Qs.js";import"./slugify-CEUa2lfQ.js";function le(){const{state:t,isMobile:e}=Ce();return t==="collapsed"&&!e}function ho(t){const e=y.c(11),{onPointerDown:s,onDoubleClick:r}=t,o=T(),{isMobile:i}=Ce(),a=le();if(i||a)return null;let l;e[0]!==o?(l=o("sidebar.sidebarResizeHandle.ariaLabel"),e[0]=o,e[1]=l):l=e[1];let c;e[2]!==o?(c=o("sidebar.sidebarResizeHandle.title"),e[2]=o,e[3]=c):c=e[3];let d,u;e[4]===Symbol.for("react.memo_cache_sentinel")?(d={left:"var(--sidebar-width)"},u=n.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-transparent transition-colors duration-150 group-hover/resize:bg-border group-active/resize:bg-border"}),e[4]=d,e[5]=u):(d=e[4],u=e[5]);let m;return e[6]!==r||e[7]!==s||e[8]!==l||e[9]!==c?(m=n.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":l,title:c,onPointerDown:s,onDoubleClick:r,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize",style:d,children:u}),e[6]=r,e[7]=s,e[8]=l,e[9]=c,e[10]=m):m=e[10],m}const xt=240,bo=400,jo="sidebar.width";function _e(t){return Math.max(xt,Math.min(bo,t))}function vo(){const t=y.c(11),[e,s]=It(jo,yo),r=A.useRef(null);let o;t[0]!==s||t[1]!==e?(o=u=>{u.preventDefault();const m=u.clientX,f=_e(e),p=r.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),g=p?Array.from(p.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const x of g)x.style.transition="none";const h=x=>{const j=_e(f+(x.clientX-m));p?.style.setProperty("--sidebar-width",`${j}px`)},b=x=>{const j=_e(f+(x.clientX-m));s(j);for(const v of g)v.style.transition="";window.removeEventListener("pointermove",h),window.removeEventListener("pointerup",b),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",h),window.addEventListener("pointerup",b)},t[0]=s,t[1]=e,t[2]=o):o=t[2];const i=o;let a;t[3]!==s?(a=()=>{s(xt)},t[3]=s,t[4]=a):a=t[4];const l=a;let c;t[5]!==e?(c=_e(e),t[5]=e,t[6]=c):c=t[6];let d;return t[7]!==i||t[8]!==l||t[9]!==c?(d={width:c,wrapperRef:r,onStartResize:i,resetWidth:l},t[7]=i,t[8]=l,t[9]=c,t[10]=d):d=t[10],d}function yo(t){return typeof t=="number"?_e(t):xt}const Xt=A.createContext(null);function Yt(){const t=A.use(Xt);if(!t)throw new Error("Layout regions require a Layout");return t}function So({children:t,notice:e,expandedSidebar:s=!1}){const r=ot(),[o,i]=It(xs.sidebarOpen(),!0),a=vo();return n.jsx(Xt,{value:{isMobile:r,resize:a},children:n.jsx(Rs,{open:s||o,onOpenChange:i,children:n.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[e,n.jsx(Ds,{ref:a.wrapperRef,className:"flex-1 bg-sidebar relative min-h-0",style:{"--sidebar-width":`${a.width}px`,"--sidebar-width-icon":"3.125rem"},children:t})]})})})}function ko(t){const e=y.c(22),{children:s,renderMobile:r}=t,o=T(),{isMobile:i,resize:a}=Yt(),{openMobile:l,setOpenMobile:c}=Ce();if(!i){let h;e[0]!==a.onStartResize||e[1]!==a.resetWidth?(h=n.jsx(ho,{onPointerDown:a.onStartResize,onDoubleClick:a.resetWidth}),e[0]=a.onStartResize,e[1]=a.resetWidth,e[2]=h):h=e[2];let b;return e[3]!==s||e[4]!==h?(b=n.jsxs(n.Fragment,{children:[s,h]}),e[3]=s,e[4]=h,e[5]=b):b=e[5],b}let d;e[6]!==o?(d=o("layouts.shellControls.navigationTitle"),e[6]=o,e[7]=d):d=e[7];let u;e[8]!==d?(u=n.jsx(Fs,{className:"sr-only",children:d}),e[8]=d,e[9]=u):u=e[9];let m;e[10]!==c?(m=()=>c(!1),e[10]=c,e[11]=m):m=e[11];let f;e[12]!==r||e[13]!==m?(f=r({onClose:m}),e[12]=r,e[13]=m,e[14]=f):f=e[14];let p;e[15]!==u||e[16]!==f?(p=n.jsxs(qs,{side:"left",hideCloseButton:!0,className:"w-screen max-w-none! p-0",children:[u,f]}),e[15]=u,e[16]=f,e[17]=p):p=e[17];let g;return e[18]!==l||e[19]!==c||e[20]!==p?(g=n.jsx(Vs,{open:l,onOpenChange:c,children:p}),e[18]=l,e[19]=c,e[20]=p,e[21]=g):g=e[21],g}function No(t){const e=y.c(10),{children:s}=t,r=T(),{isMobile:o}=Yt(),{toggleSidebar:i}=Ce();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={background:"transparent",containerType:"inline-size"},e[0]=a):a=e[0];let l;e[1]!==o||e[2]!==r||e[3]!==i?(l=o&&n.jsxs(Ne.Topbar,{className:"px-1 bg-sidebar",children:[n.jsx(Ne.Topbar.Left,{className:"shrink-0",children:n.jsx(rt,{onClick:i,"aria-label":r("layouts.shellControls.toggleSidebar"),children:n.jsx(it,{size:16})})}),n.jsx(Ne.Topbar.Center,{className:"justify-start",children:n.jsx(Ne.Topbar.Center.Target,{})})]}),e[1]=o,e[2]=r,e[3]=i,e[4]=l):l=e[4];let c;e[5]!==s?(c=n.jsx("div",{className:"relative flex-1 min-h-0 flex flex-row",children:s}),e[5]=s,e[6]=c):c=e[6];let d;return e[7]!==l||e[8]!==c?(d=n.jsx(Ms,{className:"flex flex-col min-h-0",style:a,children:n.jsxs(Ne,{variant:"plain",className:"bg-sidebar",children:[l,c]})}),e[7]=l,e[8]=c,e[9]=d):d=e[9],d}const Je=Object.assign(So,{Sidebar:ko,Content:No});function _o(){const t=y.c(19),{org:e}=E(),{data:s}=Hs(e.slug);if(!s)return null;const r=s.severity==="block",o=r?"border-destructive/25 bg-destructive/5 text-destructive":"border-warning/40 bg-warning/10 text-foreground";let i;t[0]!==o?(i=z("flex shrink-0 flex-wrap items-center gap-x-3 gap-y-1 border-b px-4 py-2 text-sm",o),t[0]=o,t[1]=i):i=t[1];const a=r?void 0:"text-warning";let l;t[2]!==a?(l=z("size-4 shrink-0",a),t[2]=a,t[3]=l):l=t[3];let c;t[4]!==l?(c=n.jsx(gs,{className:l}),t[4]=l,t[5]=c):c=t[5];let d;t[6]!==s.title?(d=n.jsx("span",{className:"font-medium",children:s.title}),t[6]=s.title,t[7]=d):d=t[7];let u;t[8]!==s.message?(u=n.jsx("span",{className:"min-w-0 flex-1 text-muted-foreground",children:s.message}),t[8]=s.message,t[9]=u):u=t[9];let m;t[10]!==s.ctaLabel||t[11]!==s.ctaUrl?(m=s.ctaUrl&&s.ctaLabel?n.jsx(Le,{size:"sm",variant:"outline",asChild:!0,children:n.jsx("a",{href:s.ctaUrl,target:"_blank",rel:"noreferrer noopener",children:s.ctaLabel})}):null,t[10]=s.ctaLabel,t[11]=s.ctaUrl,t[12]=m):m=t[12];let f;return t[13]!==i||t[14]!==c||t[15]!==d||t[16]!==u||t[17]!==m?(f=n.jsxs("div",{role:"alert",className:i,children:[c,d,u,m]}),t[13]=i,t[14]=c,t[15]=d,t[16]=u,t[17]=m,t[18]=f):f=t[18],f}function wo(){const t=y.c(4),{setScope:e}=Se(),s=Ks(),r=we();let o;return t[0]!==r||t[1]!==s||t[2]!==e?(o=()=>{const i=s!==void 0?"route_resolves_scope":Xe(r,null)?null:"route_needs_scope";F("scope_cleared",{relocated:i!==null,reason:i}),e(null)},t[0]=r,t[1]=s,t[2]=e,t[3]=o):o=t[3],o}function We(){const t=y.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings",shouldThrow:!1},t[0]=e):e=t[0],!!Pt(e)}const Be="size-4 shrink-0";function gt(t){const e=y.c(5),{children:s,className:r}=t;let o;e[0]!==r?(o=z("flex w-4 shrink-0 items-center justify-center",r),e[0]=r,e[1]=o):o=e[1];let i;return e[2]!==s||e[3]!==o?(i=n.jsx("span",{className:o,children:s}),e[2]=s,e[3]=o,e[4]=i):i=e[4],i}function ye(t){const e=y.c(26),{item:s,onClose:r}=t;let o;e[0]!==s.className?(o=z("flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",s.className),e[0]=s.className,e[1]=o):o=e[1];const i=o;if(s.href){const u=s.external?"_blank":void 0,m=s.external?"noopener noreferrer":void 0;let f;e[2]!==s.icon?(f=n.jsx("span",{className:"shrink-0 text-muted-foreground",children:s.icon}),e[2]=s.icon,e[3]=f):f=e[3];let p;e[4]!==s.label?(p=n.jsx("span",{className:"flex-1",children:s.label}),e[4]=s.label,e[5]=p):p=e[5];let g;return e[6]!==i||e[7]!==s.href||e[8]!==r||e[9]!==u||e[10]!==m||e[11]!==f||e[12]!==p?(g=n.jsxs("a",{href:s.href,target:u,rel:m,className:i,onClick:r,children:[f,p]}),e[6]=i,e[7]=s.href,e[8]=r,e[9]=u,e[10]=m,e[11]=f,e[12]=p,e[13]=g):g=e[13],g}let a;e[14]!==s||e[15]!==r?(a=()=>{s.onClick?.(),r()},e[14]=s,e[15]=r,e[16]=a):a=e[16];let l;e[17]!==s.icon?(l=n.jsx("span",{className:"shrink-0 text-muted-foreground",children:s.icon}),e[17]=s.icon,e[18]=l):l=e[18];let c;e[19]!==s.label?(c=n.jsx("span",{className:"flex-1",children:s.label}),e[19]=s.label,e[20]=c):c=e[20];let d;return e[21]!==i||e[22]!==a||e[23]!==l||e[24]!==c?(d=n.jsxs("button",{type:"button",onClick:a,className:i,children:[l,c]}),e[21]=i,e[22]=a,e[23]=l,e[24]=c,e[25]=d):d=e[25],d}function $o(){const t=y.c(4),e=T();let s;t[0]!==e?(s=e("common.accountPopover.impersonating"),t[0]=e,t[1]=s):s=t[1];let r;return t[2]!==s?(r=n.jsx("span",{className:"shrink-0 inline-flex items-center rounded-full bg-warning/10 px-2 py-0.5 text-[10px] font-medium text-warning",children:s}),t[2]=s,t[3]=r):r=t[3],r}function St(t){const e=y.c(38),{user:s,userImage:r,isImpersonating:o,isMobile:i}=t,a=T(),l=i?"py-4 border-b border-border":"py-3 mx-1 mt-1";let c;e[0]!==l?(c=z("flex items-center gap-3 px-4",l),e[0]=l,e[1]=c):c=e[1];const d=s?.name??"U";let u;e[2]!==d||e[3]!==r?(u=n.jsx(Fe,{url:r,fallback:d,shape:"circle",size:"sm",className:"shrink-0"}),e[2]=d,e[3]=r,e[4]=u):u=e[4];let m;e[5]!==a||e[6]!==s?.name?(m=s?.name??a("common.accountPopover.defaultUserName"),e[5]=a,e[6]=s?.name,e[7]=m):m=e[7];let f;e[8]!==m?(f=n.jsx("p",{className:"text-sm font-medium truncate",children:m}),e[8]=m,e[9]=f):f=e[9];let p;e[10]!==o?(p=o&&n.jsx($o,{}),e[10]=o,e[11]=p):p=e[11];let g;e[12]!==f||e[13]!==p?(g=n.jsxs("div",{className:"flex items-center gap-2",children:[f,p]}),e[12]=f,e[13]=p,e[14]=g):g=e[14];const h=s?.email;let b;e[15]!==h?(b=n.jsx("p",{className:"text-xs text-muted-foreground truncate",children:h}),e[15]=h,e[16]=b):b=e[16];let x;e[17]!==b||e[18]!==g?(x=n.jsxs("div",{className:"flex-1 min-w-0",children:[g,b]}),e[17]=b,e[18]=g,e[19]=x):x=e[19];let j;e[20]!==a||e[21]!==s?(j=()=>{s?.id&&navigator.clipboard.writeText(s.id).then(()=>{re.success(a("common.accountPopover.userIdCopied"))})},e[20]=a,e[21]=s,e[22]=j):j=e[22];let v;e[23]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(Qs,{size:14}),e[23]=v):v=e[23];let S;e[24]!==j?(S=n.jsx(ct,{asChild:!0,children:n.jsx("button",{type:"button",tabIndex:-1,onClick:j,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:v})}),e[24]=j,e[25]=S):S=e[25];let k;e[26]!==a?(k=a("common.accountPopover.copyUserId"),e[26]=a,e[27]=k):k=e[27];let N;e[28]!==k?(N=n.jsx(dt,{side:"right",children:n.jsx("p",{className:"text-xs",children:k})}),e[28]=k,e[29]=N):N=e[29];let _;e[30]!==S||e[31]!==N?(_=n.jsx(Gs,{delayDuration:300,children:n.jsxs(ut,{children:[S,N]})}),e[30]=S,e[31]=N,e[32]=_):_=e[32];let $;return e[33]!==x||e[34]!==_||e[35]!==c||e[36]!==u?($=n.jsxs("div",{className:c,children:[u,x,_]}),e[33]=x,e[34]=_,e[35]=c,e[36]=u,e[37]=$):$=e[37],$}function kt(t){const e=y.c(35),{themeOptions:s,preferences:r,setPreferences:o,isMobile:i}=t,a=T(),l=i?"size-8":"size-7",c=i?"px-3 py-3":"px-2 py-1.5";let d;e[0]!==c?(d=z("flex items-center justify-between border-t border-border/50",c),e[0]=c,e[1]=d):d=e[1];let u;if(e[2]!==l||e[3]!==r.theme||e[4]!==o||e[5]!==s){let k;e[7]!==l||e[8]!==r.theme||e[9]!==o?(k=N=>{const{value:_,icon:$,label:w}=N;return n.jsx("button",{type:"button","aria-label":w,onClick:()=>o(C=>({...C,theme:_})),className:z(l,"rounded-md flex items-center justify-center transition-colors",r.theme===_?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:$},_)},e[7]=l,e[8]=r.theme,e[9]=o,e[10]=k):k=e[10],u=s.map(k),e[2]=l,e[3]=r.theme,e[4]=o,e[5]=s,e[6]=u}else u=e[6];let m;e[11]!==u?(m=n.jsx("div",{className:"flex items-center gap-0.5",children:u}),e[11]=u,e[12]=m):m=e[12];let f;e[13]!==r.enableSounds||e[14]!==a?(f=r.enableSounds?a("common.accountPopover.disableSounds"):a("common.accountPopover.enableSounds"),e[13]=r.enableSounds,e[14]=a,e[15]=f):f=e[15];let p;e[16]!==o?(p=()=>o(Co),e[16]=o,e[17]=p):p=e[17];const g=r.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let h;e[18]!==l||e[19]!==g?(h=z(l,"rounded-md flex items-center justify-center transition-colors",g),e[18]=l,e[19]=g,e[20]=h):h=e[20];let b;e[21]!==r.enableSounds?(b=r.enableSounds?n.jsx(nn,{size:14}):n.jsx(on,{size:14}),e[21]=r.enableSounds,e[22]=b):b=e[22];let x;e[23]!==f||e[24]!==p||e[25]!==h||e[26]!==b?(x=n.jsx("button",{type:"button","aria-label":f,onClick:p,className:h,children:b}),e[23]=f,e[24]=p,e[25]=h,e[26]=b,e[27]=x):x=e[27];let j;e[28]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.372.0"]}),e[28]=j):j=e[28];let v;e[29]!==x?(v=n.jsxs("div",{className:"flex items-center gap-2",children:[x,j]}),e[29]=x,e[30]=v):v=e[30];let S;return e[31]!==v||e[32]!==d||e[33]!==m?(S=n.jsxs("div",{className:d,children:[m,v]}),e[31]=v,e[32]=d,e[33]=m,e[34]=S):S=e[34],S}function Co(t){return{...t,enableSounds:!t.enableSounds}}function Nt(t){const e=y.c(54),{user:s,userImage:r,menuItems:o,signOutItem:i,stopImpersonatingItem:a,isImpersonating:l,themeOptions:c,preferences:d,setPreferences:u,close:m,isMobile:f}=t;if(f){let S;e[0]!==l||e[1]!==s||e[2]!==r?(S=n.jsx(St,{user:s,userImage:r,isImpersonating:l,isMobile:!0}),e[0]=l,e[1]=s,e[2]=r,e[3]=S):S=e[3];let k;if(e[4]!==m||e[5]!==o){let P;e[7]!==m?(P=O=>n.jsx(ye,{item:O,onClose:m},O.key),e[7]=m,e[8]=P):P=e[8],k=o.map(P),e[4]=m,e[5]=o,e[6]=k}else k=e[6];let N;e[9]!==m||e[10]!==a?(N=a&&n.jsx(ye,{item:a,onClose:m}),e[9]=m,e[10]=a,e[11]=N):N=e[11];let _;e[12]!==m||e[13]!==i?(_=n.jsx(ye,{item:i,onClose:m}),e[12]=m,e[13]=i,e[14]=_):_=e[14];let $;e[15]!==k||e[16]!==N||e[17]!==_?($=n.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:n.jsxs("nav",{className:"flex flex-col px-2 pt-2 pb-2 gap-0.5",children:[k,N,_]})}),e[15]=k,e[16]=N,e[17]=_,e[18]=$):$=e[18];let w;e[19]!==d||e[20]!==u||e[21]!==c?(w=n.jsx(kt,{themeOptions:c,preferences:d,setPreferences:u,isMobile:!0}),e[19]=d,e[20]=u,e[21]=c,e[22]=w):w=e[22];let C;return e[23]!==S||e[24]!==$||e[25]!==w?(C=n.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[S,$,w]}),e[23]=S,e[24]=$,e[25]=w,e[26]=C):C=e[26],C}let p;e[27]!==l||e[28]!==s||e[29]!==r?(p=n.jsx(St,{user:s,userImage:r,isImpersonating:l,isMobile:!1}),e[27]=l,e[28]=s,e[29]=r,e[30]=p):p=e[30];let g;if(e[31]!==m||e[32]!==o){let S;e[34]!==m?(S=k=>n.jsx(ye,{item:k,onClose:m},k.key),e[34]=m,e[35]=S):S=e[35],g=o.map(S),e[31]=m,e[32]=o,e[33]=g}else g=e[33];let h;e[36]!==m||e[37]!==a?(h=a&&n.jsx(ye,{item:a,onClose:m}),e[36]=m,e[37]=a,e[38]=h):h=e[38];let b;e[39]!==m||e[40]!==i?(b=n.jsx(ye,{item:i,onClose:m}),e[39]=m,e[40]=i,e[41]=b):b=e[41];let x;e[42]!==g||e[43]!==h||e[44]!==b?(x=n.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[g,h,b]}),e[42]=g,e[43]=h,e[44]=b,e[45]=x):x=e[45];let j;e[46]!==d||e[47]!==u||e[48]!==c?(j=n.jsx(kt,{themeOptions:c,preferences:d,setPreferences:u,isMobile:!1}),e[46]=d,e[47]=u,e[48]=c,e[49]=j):j=e[49];let v;return e[50]!==p||e[51]!==x||e[52]!==j?(v=n.jsx("div",{className:"flex w-full flex-col overflow-hidden",children:n.jsxs("div",{className:"flex flex-col",children:[p,x,j]})}),e[50]=p,e[51]=x,e[52]=j,e[53]=v):v=e[53],v}function tt(){const t=y.c(107),e=T(),{data:s}=Y.useSession(),{org:r}=E(),o=$e();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org",shouldThrow:!1},t[0]=i):i=t[0];const l=Pt(i)?.params.org,[c,d]=Tt(),u=ot(),{isAdmin:m}=hn(),f=bn(),[p,g]=A.useState(!1),[h,b]=A.useState(!1),x=s?.user,j=x?.image,v=!!s?.session?.impersonatedBy;let S;t[1]===Symbol.for("react.memo_cache_sentinel")?(S=()=>g(!1),t[1]=S):S=t[1];const k=S;let N;t[2]!==e?(N=e("common.accountPopover.preferences"),t[2]=e,t[3]=N):N=t[3];let _;t[4]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx(Bt,{size:16}),t[4]=_):_=t[4];let $;t[5]!==o||t[6]!==l?($=()=>{o({to:"/$org/settings/profile",params:{org:l??""}})},t[5]=o,t[6]=l,t[7]=$):$=t[7];let w;t[8]!==N||t[9]!==$?(w={key:"preferences",label:N,icon:_,onClick:$},t[8]=N,t[9]=$,t[10]=w):w=t[10];let C;t[11]!==r||t[12]!==o?(C=r?[{key:"connect-clients",label:"Connect to Agents",icon:n.jsx(qt,{size:16}),onClick:()=>{o({to:"/$org/settings/connect",params:{org:r.slug}})}}]:[],t[11]=r,t[12]=o,t[13]=C):C=t[13];let P;t[14]!==f||t[15]!==e?(P=(jn()||vt())&&!f?[{key:"install-desktop-app",label:vt()?e("downloadApp.installOnLinux"):e("downloadApp.installOnMac"),icon:n.jsx(Js,{size:16}),onClick:()=>b(!0)}]:[],t[14]=f,t[15]=e,t[16]=P):P=t[16];let O;t[17]!==e?(O=e("common.accountPopover.termsOfUse"),t[17]=e,t[18]=O):O=t[18];let ne;t[19]===Symbol.for("react.memo_cache_sentinel")?(ne=n.jsx(Bs,{size:16}),t[19]=ne):ne=t[19];let K;t[20]!==O?(K={key:"terms",label:O,icon:ne,href:"https://www.decocms.com/terms-of-use",external:!0},t[20]=O,t[21]=K):K=t[21];let W;t[22]!==e?(W=e("common.accountPopover.privacyPolicy"),t[22]=e,t[23]=W):W=t[23];let oe;t[24]===Symbol.for("react.memo_cache_sentinel")?(oe=n.jsx(tn,{size:16}),t[24]=oe):oe=t[24];let q;t[25]!==W?(q={key:"privacy",label:W,icon:oe,href:"https://www.decocms.com/privacy-policy",external:!0},t[25]=W,t[26]=q):q=t[26];let G;t[27]!==e?(G=e("common.accountPopover.githubRepo"),t[27]=e,t[28]=G):G=t[28];let V;t[29]===Symbol.for("react.memo_cache_sentinel")?(V=n.jsx(hs,{className:"w-4 h-4"}),t[29]=V):V=t[29];let B;t[30]!==G?(B={key:"github",label:G,icon:V,href:"https://github.com/decocms/studio",external:!0},t[30]=G,t[31]=B):B=t[31];let Q;t[32]!==e?(Q=e("common.accountPopover.community"),t[32]=e,t[33]=Q):Q=t[33];let ee;t[34]===Symbol.for("react.memo_cache_sentinel")?(ee=n.jsx(et,{size:16}),t[34]=ee):ee=t[34];let J;t[35]!==Q?(J={key:"community",label:Q,icon:ee,href:"https://decocms.com/discord",external:!0},t[35]=Q,t[36]=J):J=t[36];let U;t[37]!==e?(U=e("common.accountPopover.homepage"),t[37]=e,t[38]=U):U=t[38];let me;t[39]===Symbol.for("react.memo_cache_sentinel")?(me=n.jsx(Xs,{size:16}),t[39]=me):me=t[39];let D;t[40]!==U?(D={key:"homepage",label:U,icon:me,href:"https://decocms.com",external:!0},t[40]=U,t[41]=D):D=t[41];let H;t[42]!==m||t[43]!==o||t[44]!==e?(H=m?[{key:"admin-dashboard",label:e("common.accountPopover.adminDashboard"),icon:n.jsx(sn,{size:16}),onClick:()=>o({to:"/_admin"}),className:"text-warning"}]:[],t[42]=m,t[43]=o,t[44]=e,t[45]=H):H=t[45];let ie;t[46]!==K||t[47]!==q||t[48]!==B||t[49]!==J||t[50]!==D||t[51]!==H||t[52]!==w||t[53]!==C||t[54]!==P?(ie=[w,...C,...P,K,q,B,J,D,...H],t[46]=K,t[47]=q,t[48]=B,t[49]=J,t[50]=D,t[51]=H,t[52]=w,t[53]=C,t[54]=P,t[55]=ie):ie=t[55];const ke=ie;let X;t[56]!==e?(X=e("common.accountPopover.signOut"),t[56]=e,t[57]=X):X=t[57];let te;t[58]===Symbol.for("react.memo_cache_sentinel")?(te=n.jsx(Ze,{size:16}),t[58]=te):te=t[58];let I;t[59]!==X?(I={key:"logout",label:X,icon:te,onClick:Po},t[59]=X,t[60]=I):I=t[60];const R=I;let Ie;t[61]!==v||t[62]!==e?(Ie=v?{key:"stop-impersonating",label:e("common.accountPopover.stopImpersonation"),icon:n.jsx(Ze,{size:16}),onClick:async()=>{const{error:bt}=await Y.admin.stopImpersonating();if(bt){re.error(bt.message||e("common.accountPopover.failedToStopImpersonation"));return}window.location.href="/"},className:"text-warning"}:null,t[61]=v,t[62]=e,t[63]=Ie):Ie=t[63];const Ge=Ie;let Pe;t[64]===Symbol.for("react.memo_cache_sentinel")?(Pe=n.jsx(Zs,{size:14}),t[64]=Pe):Pe=t[64];let fe;t[65]!==e?(fe=e("common.accountPopover.lightTheme"),t[65]=e,t[66]=fe):fe=t[66];let pe;t[67]!==fe?(pe={value:"light",icon:Pe,label:fe},t[67]=fe,t[68]=pe):pe=t[68];let Te;t[69]===Symbol.for("react.memo_cache_sentinel")?(Te=n.jsx(en,{size:14}),t[69]=Te):Te=t[69];let xe;t[70]!==e?(xe=e("common.accountPopover.darkTheme"),t[70]=e,t[71]=xe):xe=t[71];let ge;t[72]!==xe?(ge={value:"dark",icon:Te,label:xe},t[72]=xe,t[73]=ge):ge=t[73];let ze;t[74]===Symbol.for("react.memo_cache_sentinel")?(ze=n.jsx(Vt,{size:14}),t[74]=ze):ze=t[74];let he;t[75]!==e?(he=e("common.accountPopover.systemTheme"),t[75]=e,t[76]=he):he=t[76];let be;t[77]!==he?(be={value:"system",icon:ze,label:he},t[77]=he,t[78]=be):be=t[78];let Ae;t[79]!==pe||t[80]!==ge||t[81]!==be?(Ae=[pe,ge,be],t[79]=pe,t[80]=ge,t[81]=be,t[82]=Ae):Ae=t[82];const Qe=Ae;let Oe;t[83]!==v||t[84]!==u||t[85]!==ke||t[86]!==c||t[87]!==d||t[88]!==R||t[89]!==Ge||t[90]!==Qe||t[91]!==x||t[92]!==j?(Oe={user:x,userImage:j,menuItems:ke,signOutItem:R,stopImpersonatingItem:Ge,isImpersonating:v,themeOptions:Qe,preferences:c,setPreferences:d,close:k,isMobile:u},t[83]=v,t[84]=u,t[85]=ke,t[86]=c,t[87]=d,t[88]=R,t[89]=Ge,t[90]=Qe,t[91]=x,t[92]=j,t[93]=Oe):Oe=t[93];const Re=Oe;let je;t[94]!==v||t[95]!==u||t[96]!==p||t[97]!==Re||t[98]!==e||t[99]!==x?.name||t[100]!==j?(je=u?n.jsxs(Lt,{open:p,onOpenChange:g,direction:"bottom",children:[n.jsxs("button",{type:"button",onClick:()=>g(!0),className:z("flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground",v&&"border-2 border-dashed border-warning"),children:[n.jsx(Fe,{url:j,fallback:x?.name??"U",shape:"circle",size:"2xs",className:"shrink-0"}),n.jsx("span",{className:"truncate",children:x?.name??e("common.accountPopover.defaultAccountLabel")})]}),n.jsxs(Et,{className:"h-[80dvh] p-0",children:[n.jsx(Ft,{className:"sr-only",children:e("common.accountPopover.account")}),n.jsx(Nt,{...Re})]})]}):n.jsxs(at,{open:p,onOpenChange:g,children:[n.jsx(Ke,{asChild:!0,children:n.jsxs(ae,{"data-tour":Z.account,tooltip:x?.name??e("common.accountPopover.defaultAccountLabel"),className:z("rounded-md",v&&"border-2 border-dashed border-warning"),children:[n.jsx(gt,{children:n.jsx(Fe,{url:j,fallback:x?.name??"U",shape:"circle",size:"2xs",className:"size-[18px] shrink-0"})}),n.jsx("span",{className:"truncate",children:x?.name??e("common.accountPopover.defaultAccountLabel")})]})}),n.jsx(lt,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[280px] p-0 flex flex-col max-h-[520px]",onCloseAutoFocus:Io,children:n.jsx(Nt,{...Re})})]}),t[94]=v,t[95]=u,t[96]=p,t[97]=Re,t[98]=e,t[99]=x?.name,t[100]=j,t[101]=je):je=t[101];let ve;t[102]!==h?(ve=n.jsx(vn,{open:h,onOpenChange:b}),t[102]=h,t[103]=ve):ve=t[103];let De;return t[104]!==je||t[105]!==ve?(De=n.jsxs(n.Fragment,{children:[je,ve]}),t[104]=je,t[105]=ve,t[106]=De):De=t[106],De}function Io(t){return t.preventDefault()}function Po(){F("signed_out",{source:"account_popover"}),zt(),Y.signOut()}class To extends A.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,s){}render(){return this.state.hasError?null:this.props.children}}function zo(t){return t<=1?"text-destructive":t<=5?"text-warning":"text-foreground/70"}function Ao(){const t=y.c(17),e=$e(),{org:s}=E(),{hasDecoKey:r,balanceDollars:o}=kn();if(!r)return null;let i;t[0]!==o?(i=o!=null?`Credits: $${o.toFixed(2)}`:"Credits",t[0]=o,t[1]=i):i=t[1];let a;t[2]!==o?(a=z(o!=null&&zo(o)),t[2]=o,t[3]=a):a=t[3];let l;t[4]!==e||t[5]!==s.slug?(l=()=>e({to:"/$org/settings/ai-providers",params:{org:s.slug}}),t[4]=e,t[5]=s.slug,t[6]=l):l=t[6];let c;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(rn,{}),t[7]=c):c=t[7];let d;t[8]!==o?(d=o!=null?`$${o.toFixed(2)}`:"Credits",t[8]=o,t[9]=d):d=t[9];let u;t[10]!==d?(u=n.jsx("span",{children:d}),t[10]=d,t[11]=u):u=t[11];let m;return t[12]!==i||t[13]!==a||t[14]!==l||t[15]!==u?(m=n.jsx(L,{children:n.jsx(se,{children:n.jsxs(ae,{tooltip:i,className:a,onClick:l,children:[c,u]})})}),t[12]=i,t[13]=a,t[14]=l,t[15]=u,t[16]=m):m=t[16],m}const Oo={ok:"stroke-brand-purple",warn:"stroke-warning",exhausted:"stroke-destructive"},Ro={ok:"bg-brand-purple",warn:"bg-warning",exhausted:"bg-destructive"};function Do(){const t=y.c(40),e=T(),s=le(),r=$e(),{org:o}=E(),{data:i}=Wt();if(!i?.usage||!i.features.chat)return null;let a,l;if(t[0]!==i.usage.percent?(a=Math.round(i.usage.percent*100),l=Number.isFinite(a),t[0]=i.usage.percent,t[1]=a,t[2]=l):(a=t[1],l=t[2]),!l)return null;const c=Math.min(100,Math.max(0,a)),d=i.plan.name;let u;t[3]!==e?(u=e("settings.planUsage.aiUsage"),t[3]=e,t[4]=u):u=t[4];const m=`${d} · ${u} ${c}%`;let f;t[5]!==r||t[6]!==o.slug?(f=()=>r({to:"/$org/settings/ai-providers",params:{org:o.slug}}),t[5]=r,t[6]=o.slug,t[7]=f):f=t[7];const p=!s&&"-ml-px";let g;t[8]!==p?(g=z(p),t[8]=p,t[9]=g):g=t[9];let h;t[10]!==i.plan.id||t[11]!==i.usage.state||t[12]!==s||t[13]!==c?(h=s?n.jsx(Lo,{percent:c,state:i.usage.state}):n.jsx(Mo,{planId:i.plan.id}),t[10]=i.plan.id,t[11]=i.usage.state,t[12]=s,t[13]=c,t[14]=h):h=t[14];let b;t[15]!==g||t[16]!==h?(b=n.jsx(gt,{className:g,children:h}),t[15]=g,t[16]=h,t[17]=b):b=t[17];let x;t[18]!==i.plan.name?(x=n.jsx("span",{className:"truncate font-medium",children:i.plan.name}),t[18]=i.plan.name,t[19]=x):x=t[19];let j;t[20]!==c?(j=n.jsxs("span",{className:"tabular-nums text-xs text-muted-foreground",children:[c,"%"]}),t[20]=c,t[21]=j):j=t[21];let v;t[22]!==j||t[23]!==x?(v=n.jsxs("span",{className:"flex items-baseline justify-between gap-2",children:[x,j]}),t[22]=j,t[23]=x,t[24]=v):v=t[24];const S=Ro[i.usage.state];let k;t[25]!==S?(k=z("block h-full rounded-full",S),t[25]=S,t[26]=k):k=t[26];const N=`${c}%`;let _;t[27]!==N?(_={width:N},t[27]=N,t[28]=_):_=t[28];let $;t[29]!==k||t[30]!==_?($=n.jsx("span",{className:"block h-1 overflow-hidden rounded-full bg-muted",children:n.jsx("span",{className:k,style:_})}),t[29]=k,t[30]=_,t[31]=$):$=t[31];let w;t[32]!==v||t[33]!==$?(w=n.jsxs("span",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[v,$]}),t[32]=v,t[33]=$,t[34]=w):w=t[34];let C;return t[35]!==w||t[36]!==m||t[37]!==f||t[38]!==b?(C=n.jsx(L,{children:n.jsx(se,{children:n.jsxs(ae,{tooltip:m,className:"h-auto! rounded-lg border border-border bg-card px-2 py-2 [&_svg]:opacity-100!",onClick:f,children:[b,w]})})}),t[35]=w,t[36]=m,t[37]=f,t[38]=b,t[39]=C):C=t[39],C}function Mo(t){const e=y.c(6),{planId:s}=t,{data:r}=_n();let o;e[0]!==s||e[1]!==r?(o=r?.findIndex(l=>l.id===s)??-1,e[0]=s,e[1]=r,e[2]=o):o=e[2];const i=o;if(i<0){let l;return e[3]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(Ut,{className:Be}),e[3]=l):l=e[3],l}let a;return e[4]!==i?(a=n.jsx(wn,{index:i,className:Be}),e[4]=i,e[5]=a):a=e[5],a}function Lo(t){const e=y.c(5),{percent:s,state:r}=t,o=2*Math.PI*8;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=z("-rotate-90",Be),e[0]=i):i=e[0];let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx("circle",{cx:"10",cy:"10",r:8,fill:"none",strokeWidth:"3",className:"stroke-muted"}),e[1]=a):a=e[1];const l=Oo[r],c=`${o*s/100} ${o}`;let d;return e[2]!==l||e[3]!==c?(d=n.jsxs("svg",{viewBox:"0 0 20 20",className:i,"aria-hidden":"true",children:[a,n.jsx("circle",{cx:"10",cy:"10",r:8,fill:"none",strokeWidth:"3",strokeLinecap:"round",className:l,strokeDasharray:c})]}),e[2]=l,e[3]=c,e[4]=d):d=e[4],d}function Eo(){return Nn()?n.jsx(Do,{}):n.jsx(Ao,{})}function _t(){const t=y.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(To,{children:n.jsx(A.Suspense,{fallback:null,children:n.jsx(Eo,{})})}),t[0]=e):e=t[0],e}const Fo=6e4;function qo(t,e){return t.call("NOTIFICATION_LIST",e?{cursor:e}:{})}function Vo(t,e){if(!t)return t;const s=e?new Set(e):null;let r=0;const o=t.pages.map(a=>{const l=a.notifications.filter(c=>s&&!s.has(c.id)?!0:(r++,!1));return{...a,notifications:l}}),i=s?Math.max(0,(t.pages[0]?.unreadCount??0)-r):0;return{...t,pages:o.map(a=>({...a,unreadCount:i}))}}function Bo(t,e){const s=y.c(4),{data:r}=Y.useSession(),o=r?.user?.id;let i;s[0]!==e||s[1]!==t||s[2]!==o?(i=a=>!t||!o?Ko:Pn.subscribe(t,c=>{try{if(JSON.parse(c.data).subject!==o)return}catch{return}e(),a()},e),s[0]=e,s[1]=t,s[2]=o,s[3]=i):i=s[3],A.useSyncExternalStore(i,Ho,Uo)}function Uo(){return 0}function Ho(){return 0}function Ko(){}function Zt(){const t=y.c(37),{locator:e,org:s}=E(),r=At(),o=Ot();let i;t[0]!==e?(i=Ee.notifications(e),t[0]=e,t[1]=i):i=t[1];const a=i;let l;t[2]!==r?(l=$=>{const{pageParam:w}=$;return qo(r,w)},t[2]=r,t[3]=l):l=t[3];let c;t[4]!==a||t[5]!==l?(c={queryKey:a,queryFn:l,initialPageParam:void 0,getNextPageParam:Qo,refetchInterval:Fo},t[4]=a,t[5]=l,t[6]=c):c=t[6];const d=In(c);let u;t[7]!==o||t[8]!==a?(u=()=>o.invalidateQueries({queryKey:a,refetchType:"active"}),t[7]=o,t[8]=a,t[9]=u):u=t[9],Bo(s.slug,u);let m;t[10]!==r?(m=$=>r.call("NOTIFICATION_MARK_READ",$?{ids:$}:{}),t[10]=r,t[11]=m):m=t[11];let f,p;t[12]!==o||t[13]!==a?(f=async $=>{await o.cancelQueries({queryKey:a}),o.setQueryData(a,w=>Vo(w,$))},p=()=>o.invalidateQueries({queryKey:a}),t[12]=o,t[13]=a,t[14]=f,t[15]=p):(f=t[14],p=t[15]);let g;t[16]!==m||t[17]!==f||t[18]!==p?(g={mutationFn:m,onMutate:f,onSettled:p},t[16]=m,t[17]=f,t[18]=p,t[19]=g):g=t[19];const h=bs(g);let b;t[20]!==d.data?.pages?(b=d.data?.pages??[],t[20]=d.data?.pages,t[21]=b):b=t[21];const x=b;let j;t[22]!==x?(j=x.flatMap(Wo),t[22]=x,t[23]=j):j=t[23];const v=x[0]?.unreadCount??0;let S;t[24]!==d?(S=()=>{d.hasNextPage&&!d.isFetchingNextPage&&d.fetchNextPage()},t[24]=d,t[25]=S):S=t[25];let k,N;t[26]!==h?(k=()=>h.mutate(null),N=$=>h.mutate([$]),t[26]=h,t[27]=k,t[28]=N):(k=t[27],N=t[28]);let _;return t[29]!==d.hasNextPage||t[30]!==d.isFetchingNextPage||t[31]!==v||t[32]!==S||t[33]!==k||t[34]!==N||t[35]!==j?(_={updates:j,redDotCount:v,hasMore:d.hasNextPage,isFetchingMore:d.isFetchingNextPage,fetchMore:S,markAllRead:k,markRead:N},t[29]=d.hasNextPage,t[30]=d.isFetchingNextPage,t[31]=v,t[32]=S,t[33]=k,t[34]=N,t[35]=j,t[36]=_):_=t[36],_}function Wo(t){return t.notifications.map(Go)}function Go(t){return{id:t.id,taskBoardItemId:t.taskBoardItemId,taskTitle:t.taskTitle,taskKeySeq:t.taskKeySeq,action:t.type,actorName:t.actorName,actorImage:t.actorImage,occurredAt:t.createdAt}}function Qo(t){return t.nextCursor??void 0}function Jo(t){switch(t){case"mentioned":case"review_requested":return"font-medium text-foreground";case"merge_failed":case"review_changes_requested":return"font-medium text-destructive";case"review_approved":return"font-medium text-success";default:return""}}function Xo(t,e){switch(t.action){case"commented":return e("sidebar.inbox.actionCommented");case"mentioned":return e("sidebar.inbox.actionMentioned");case"created":return e("sidebar.inbox.actionCreated");case"status_changed":return e("sidebar.inbox.actionStatusChanged");case"assignee_changed":return e("sidebar.inbox.actionAssigneeChanged");case"review_requested":return e("sidebar.inbox.actionReviewRequested");case"review_approved":return e("sidebar.inbox.actionReviewApproved");case"review_changes_requested":return e("sidebar.inbox.actionReviewChangesRequested");case"merge_failed":return e("sidebar.inbox.actionMergeFailed");default:{const s=t.action;return String(s)}}}function Yo(t){const e=y.c(36),{update:s,orgSlug:r,onSelect:o}=t,i=T();let a;e[0]!==r||e[1]!==s.taskKeySeq?(a=Gt(r,s.taskKeySeq),e[0]=r,e[1]=s.taskKeySeq,e[2]=a):a=e[2];const l=a,c=!s.actorName;let d;e[3]!==c||e[4]!==s.actorImage||e[5]!==s.actorName?(d=n.jsx("span",{className:"mt-0.5 shrink-0",children:c?n.jsx(Tn,{size:24}):n.jsx(Fe,{url:s.actorImage??void 0,fallback:Ln(s.actorName??void 0),shape:"circle",size:"xs"})}),e[3]=c,e[4]=s.actorImage,e[5]=s.actorName,e[6]=d):d=e[6];let u;e[7]!==s.taskTitle?(u=n.jsx("p",{className:"min-w-0 flex-1 truncate text-sm font-medium text-foreground",children:s.taskTitle}),e[7]=s.taskTitle,e[8]=u):u=e[8];let m;e[9]!==s.occurredAt?(m=En(new Date(s.occurredAt)),e[9]=s.occurredAt,e[10]=m):m=e[10];let f;e[11]!==m?(f=n.jsx("span",{className:"shrink-0 text-xs text-muted-foreground/70",children:m}),e[11]=m,e[12]=f):f=e[12];let p;e[13]!==u||e[14]!==f?(p=n.jsxs("div",{className:"flex items-baseline gap-2",children:[u,f]}),e[13]=u,e[14]=f,e[15]=p):p=e[15];let g;e[16]!==l?(g=l&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"font-medium",children:l})," · "]}),e[16]=l,e[17]=g):g=e[17];let h;e[18]!==s.action?(h=z(Jo(s.action)),e[18]=s.action,e[19]=h):h=e[19];let b;e[20]!==i||e[21]!==s?(b=Xo(s,i),e[20]=i,e[21]=s,e[22]=b):b=e[22];let x;e[23]!==h||e[24]!==b?(x=n.jsx("span",{className:h,children:b}),e[23]=h,e[24]=b,e[25]=x):x=e[25];let j;e[26]!==x||e[27]!==g?(j=n.jsxs("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:[g,x]}),e[26]=x,e[27]=g,e[28]=j):j=e[28];let v;e[29]!==j||e[30]!==p?(v=n.jsxs("div",{className:"min-w-0 flex-1",children:[p,j]}),e[29]=j,e[30]=p,e[31]=v):v=e[31];let S;return e[32]!==o||e[33]!==v||e[34]!==d?(S=n.jsxs("button",{type:"button",onClick:o,className:"flex w-full items-start gap-3 border-b border-border px-4 py-3 text-left transition-colors last:border-0 hover:bg-muted/25",children:[d,v]}),e[32]=o,e[33]=v,e[34]=d,e[35]=S):S=e[35],S}function Zo(t){const e=y.c(2),{onReach:s}=t;let r;return e[0]!==s?(r=n.jsx("div",{className:"h-8 shrink-0",ref:o=>{if(!o)return;const i=new IntersectionObserver(a=>{a.some(ei)&&s()});return i.observe(o),()=>i.disconnect()}}),e[0]=s,e[1]=r):r=e[1],r}function ei(t){return t.isIntersecting}function ti(t){const e=y.c(23),{onClose:s}=t,r=T(),o=$e(),{org:i}=E(),{updates:a,markAllRead:l,markRead:c,hasMore:d,fetchMore:u}=Zt();let m;e[0]!==r?(m=r("sidebar.inbox.title"),e[0]=r,e[1]=m):m=e[1];let f;e[2]!==m?(f=n.jsx("h3",{className:"text-sm font-medium",children:m}),e[2]=m,e[3]=f):f=e[3];let p;e[4]!==l||e[5]!==r||e[6]!==a.length?(p=a.length>0&&n.jsx(Le,{size:"sm",variant:"ghost",className:"h-7 px-2 text-xs text-muted-foreground",onClick:l,children:r("sidebar.inbox.markAllRead")}),e[4]=l,e[5]=r,e[6]=a.length,e[7]=p):p=e[7];let g;e[8]!==f||e[9]!==p?(g=n.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-4 py-3",children:[f,p]}),e[8]=f,e[9]=p,e[10]=g):g=e[10];let h;e[11]!==u||e[12]!==d||e[13]!==c||e[14]!==o||e[15]!==s||e[16]!==i||e[17]!==r||e[18]!==a?(h=a.length===0?n.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 py-10 text-center",children:[n.jsx(mt,{size:24,className:"text-muted-foreground/50"}),n.jsx("p",{className:"text-sm font-medium text-foreground",children:r("sidebar.inbox.emptyTitle")}),n.jsx("p",{className:"text-xs text-muted-foreground",children:r("sidebar.inbox.emptyBody")})]}):n.jsxs(Cn,{className:"min-h-0 flex-1",children:[a.map(x=>{const j=Gt(i.slug,x.taskKeySeq);return n.jsx(Yo,{update:x,orgSlug:i.slug,onSelect:()=>{c(x.id),s(),j&&o({to:"/$org/tasks/{-$taskKey}",params:{org:i.slug,taskKey:j}})}},x.id)}),d&&n.jsx(Zo,{onReach:u})]}),e[11]=u,e[12]=d,e[13]=c,e[14]=o,e[15]=s,e[16]=i,e[17]=r,e[18]=a,e[19]=h):h=e[19];let b;return e[20]!==g||e[21]!==h?(b=n.jsxs(n.Fragment,{children:[g,h]}),e[20]=g,e[21]=h,e[22]=b):b=e[22],b}function es(){const t=y.c(1),{redDotCount:e}=Zt();if(e===0)return null;let s;return t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx("span",{className:"pointer-events-none absolute top-1 right-1 size-2 rounded-full bg-destructive"}),t[0]=s):s=t[0],s}function ts(t){const e=y.c(10),{open:s,onOpenChange:r,children:o}=t;let i;e[0]!==r||e[1]!==s?(i=s&&n.jsx(ti,{onClose:()=>r(!1)}),e[0]=r,e[1]=s,e[2]=i):i=e[2];let a;e[3]!==i?(a=n.jsx(lt,{side:"right",align:"end",sideOffset:12,collisionPadding:16,className:"flex max-h-[min(650px,calc(100dvh-4rem))] w-[min(400px,calc(100vw-2rem))] flex-col p-0",children:i}),e[3]=i,e[4]=a):a=e[4];let l;return e[5]!==o||e[6]!==r||e[7]!==s||e[8]!==a?(l=n.jsxs(at,{open:s,onOpenChange:r,children:[o,a]}),e[5]=o,e[6]=r,e[7]=s,e[8]=a,e[9]=l):l=e[9],l}function ss(){const t=y.c(9),e=T(),[s,r]=A.useState(!1);let o;t[0]!==e?(o=e("sidebar.inbox.title"),t[0]=e,t[1]=o):o=t[1];let i,a;t[2]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(mt,{size:15}),a=n.jsx(es,{}),t[2]=i,t[3]=a):(i=t[2],a=t[3]);let l;t[4]!==o?(l=n.jsx(Ke,{asChild:!0,children:n.jsxs("button",{type:"button","aria-label":o,className:"relative flex size-7 shrink-0 items-center justify-center rounded-md text-sidebar-foreground/60 transition-colors hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[i,a]})}),t[4]=o,t[5]=l):l=t[5];let c;return t[6]!==s||t[7]!==l?(c=n.jsx(ts,{open:s,onOpenChange:r,children:l}),t[6]=s,t[7]=l,t[8]=c):c=t[8],c}function si(){const t=y.c(15),e=T(),[s,r]=A.useState(!1),o=le();let i;t[0]!==o||t[1]!==e?(i=o?e("sidebar.inbox.title"):void 0,t[0]=o,t[1]=e,t[2]=i):i=t[2];let a,l;t[3]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(mt,{}),l=n.jsx(es,{}),t[3]=a,t[4]=l):(a=t[3],l=t[4]);let c;t[5]!==e?(c=e("sidebar.inbox.title"),t[5]=e,t[6]=c):c=t[6];let d;t[7]!==c?(d=n.jsx("span",{className:"truncate",children:c}),t[7]=c,t[8]=d):d=t[8];let u;t[9]!==i||t[10]!==d?(u=n.jsx(Ke,{asChild:!0,children:n.jsxs(ae,{tooltip:i,className:"relative",children:[a,l,d]})}),t[9]=i,t[10]=d,t[11]=u):u=t[11];let m;return t[12]!==s||t[13]!==u?(m=n.jsx(ts,{open:s,onOpenChange:r,children:u}),t[12]=s,t[13]=u,t[14]=m):m=t[14],m}function wt(){const t=y.c(10),e=T();let s;t[0]!==e?(s=e("sidebar.sidebarFooter.inviteMembers"),t[0]=e,t[1]=s):s=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(gt,{children:n.jsx(an,{className:Be})}),t[2]=r):r=t[2];let o;t[3]!==e?(o=e("sidebar.sidebarFooter.inviteMembers"),t[3]=e,t[4]=o):o=t[4];let i;t[5]!==o?(i=n.jsx("span",{children:o}),t[5]=o,t[6]=i):i=t[6];let a;return t[7]!==s||t[8]!==i?(a=n.jsx(L,{className:"gap-0.5",children:n.jsx(se,{children:n.jsx(yn,{trigger:n.jsxs(ae,{tooltip:s,children:[r,i]})})})}),t[7]=s,t[8]=i,t[9]=a):a=t[9],a}function ni(){const t=y.c(13),e=le(),r=!$n();if(e){let c;t[0]!==r?(c=r&&n.jsx(_t,{}),t[0]=r,t[1]=c):c=t[1];let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(wt,{}),t[2]=d):d=t[2];let u;t[3]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(se,{children:n.jsx(si,{})}),t[3]=u):u=t[3];let m;t[4]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsxs(L,{children:[u,n.jsx(se,{children:n.jsx(tt,{})})]}),t[4]=m):m=t[4];let f;return t[5]!==c?(f=n.jsxs(Ye,{className:"px-2 pb-3 gap-1",children:[c,d,m]}),t[5]=c,t[6]=f):f=t[6],f}let o;t[7]!==r?(o=r&&n.jsx(_t,{}),t[7]=r,t[8]=o):o=t[8];let i;t[9]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(wt,{}),t[9]=i):i=t[9];let a;t[10]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(L,{className:"gap-0.5",children:n.jsx(se,{children:n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(tt,{})}),n.jsx(ss,{})]})})}),t[10]=a):a=t[10];let l;return t[11]!==o?(l=n.jsxs(Ye,{className:"px-2 pb-3 gap-0.5",children:[o,i,a]}),t[11]=o,t[12]=l):l=t[12],l}function oi(){const t=y.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(Ye,{className:"px-2 pb-3",children:n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(L,{children:n.jsx(se,{children:n.jsx(tt,{})})})}),n.jsx(ss,{})]})}),t[0]=e):e=t[0],e}function ii(t){let e=0;for(let r=0;r<t.length;r++)e=t.charCodeAt(r)+((e<<5)-e);const s=Math.abs(e)%360;return{backgroundColor:`hsl(${s} 55% 70%)`,color:`hsl(${s} 55% 20%)`}}function ht(t){const e=y.c(13),{org:s,size:r}=t,o=r===void 0?"sm":r,i=o==="xs"?"size-5":"size-6",a=o==="xs"?"text-[9px]":"text-xs";let l;e[0]!==i?(l=z(i,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=i,e[1]=l):l=e[1];let c;e[2]!==s.logo||e[3]!==s.name?(c=s.logo?void 0:ii(s.name),e[2]=s.logo,e[3]=s.name,e[4]=c):c=e[4];let d;e[5]!==s.logo||e[6]!==s.name||e[7]!==a?(d=s.logo?n.jsx("img",{src:s.logo,alt:"",className:"size-full object-cover"}):n.jsx("span",{className:z("font-semibold leading-none",a),children:s.name.slice(0,2).toUpperCase()}),e[5]=s.logo,e[6]=s.name,e[7]=a,e[8]=d):d=e[8];let u;return e[9]!==l||e[10]!==c||e[11]!==d?(u=n.jsx("div",{className:l,style:c,children:d}),e[9]=l,e[10]=c,e[11]=d,e[12]=u):u=e[12],u}function ri({invitation:t,onChanged:e}){const s=T(),[r,o]=A.useState(!1),i=t.organizationName??s("header.orgSwitcher.unknownOrganization"),a=async()=>{o(!0);try{const d=await Y.organization.acceptInvitation({invitationId:t.id});if(d.error){re.error(d.error.message),o(!1);return}}catch{re.error(s("header.orgSwitcher.failedToAcceptInvitation")),o(!1);return}re.success(s("header.orgSwitcher.joined",{name:i})),js();let c;try{c=(await Y.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=c?`/${c}`:"/"},l=async()=>{o(!0);try{const c=await Y.organization.rejectInvitation({invitationId:t.id});if(c.error){re.error(c.error.message),o(!1);return}re.success(s("header.orgSwitcher.invitationDeclined")),o(!1),e()}catch{re.error(s("header.orgSwitcher.failedToDeclineInvitation")),o(!1)}};return n.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-dashed border-border px-3 py-2.5",children:[n.jsx(ht,{org:{name:i},size:"sm"}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("p",{className:"truncate text-sm font-medium",children:i}),n.jsx("p",{className:"truncate text-xs text-muted-foreground",children:s("header.orgSwitcher.invitedToJoin")})]}),n.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[n.jsx(Le,{size:"sm",variant:"default",className:"h-7 text-xs",onClick:a,disabled:r,children:s("header.orgSwitcher.accept")}),n.jsx(Le,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground",onClick:l,disabled:r,"aria-label":s("header.orgSwitcher.declineInvitationTo",{name:i}),children:n.jsx(Kn,{size:14})})]})]})}function ns(){const t=A.useContext(vs),{data:e,refetch:s}=t.hooks.useListUserInvitations();return{invitations:(e??[]).filter(o=>o.status==="pending"&&new Date(o.expiresAt)>new Date),refetch:()=>s?.()}}function ai(t){const e=y.c(13),s=t.trim(),{data:r}=Y.useSession(),o=r?.user?.id??"",i=s.length>0&&!!o,a=Ee.projectSearch(o,s);let l;e[0]!==s?(l=async x=>{const{signal:j}=x,v=await fetch(`/api/_me/projects/search?q=${encodeURIComponent(s)}`,{signal:j});if(!v.ok)throw new Error(`Project search failed: ${v.status}`);return await v.json()},e[0]=s,e[1]=l):l=e[1];let c;e[2]!==i||e[3]!==a||e[4]!==l?(c={queryKey:a,queryFn:l,enabled:i,placeholderData:ys,staleTime:3e4,retry:!1},e[2]=i,e[3]=a,e[4]=l,e[5]=c):c=e[5];const{data:d,isFetching:u,isPlaceholderData:m,isError:f}=st(c);let p;e[6]!==d?.items?(p=d?.items??[],e[6]=d?.items,e[7]=p):p=e[7];const g=i&&u,h=i&&m;let b;return e[8]!==f||e[9]!==p||e[10]!==g||e[11]!==h?(b={hits:p,isSearching:g,isStale:h,isError:f},e[8]=f,e[9]=p,e[10]=g,e[11]=h,e[12]=b):b=e[12],b}function $t(t){const e=y.c(15),{id:s,label:r,createLabel:o,onCreate:i}=t;let a;e[0]!==s||e[1]!==r?(a=n.jsx("span",{id:s,className:"truncate",children:r}),e[0]=s,e[1]=r,e[2]=a):a=e[2];let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(qn,{size:14}),e[3]=l):l=e[3];let c;e[4]!==o||e[5]!==i?(c=n.jsx(ct,{asChild:!0,children:n.jsx("button",{type:"button","aria-label":o,className:"-my-1 shrink-0 cursor-pointer rounded-md p-1 text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",onClick:i,children:l})}),e[4]=o,e[5]=i,e[6]=c):c=e[6];let d;e[7]!==o?(d=n.jsx(dt,{side:"right",children:o}),e[7]=o,e[8]=d):d=e[8];let u;e[9]!==c||e[10]!==d?(u=n.jsxs(ut,{children:[c,d]}),e[9]=c,e[10]=d,e[11]=u):u=e[11];let m;return e[12]!==a||e[13]!==u?(m=n.jsxs("div",{className:"flex w-full items-center justify-between gap-2 px-2 py-1.5 text-xs font-medium text-muted-foreground",children:[a,u]}),e[12]=a,e[13]=u,e[14]=m):m=e[14],m}const Ue="min-h-9 items-center",de={allProjects:"scope:__all__",project:t=>`scope:${t}`,org:t=>`org:${t}`,foreignProject:(t,e)=>`travel:${t}:${e}`};function li(t){const e=y.c(9),{active:s,rows:r}=t,o=T();let i,a,l;if(e[0]!==s||e[1]!==r||e[2]!==o){l=Symbol.for("react.early_return_sentinel");e:{const d=r.get(s);if(d?.kind!=="travel"){l=null;break e}i="border-t border-border px-3 py-2 text-xs text-warning",a=o("sidebar.picker.verbTravel",{name:d.label})}e[0]=s,e[1]=r,e[2]=o,e[3]=i,e[4]=a,e[5]=l}else i=e[3],a=e[4],l=e[5];if(l!==Symbol.for("react.early_return_sentinel"))return l;let c;return e[6]!==i||e[7]!==a?(c=n.jsx("div",{className:i,children:a}),e[6]=i,e[7]=a,e[8]=c):c=e[8],c}function ci(t){const e=y.c(25),{onClose:s,onCreateOrg:r,className:o}=t,i=T(),a=A.useId(),l=A.useId(),c=$e(),{org:d}=E(),{scopeId:u,projects:m,setScope:f}=Se(),{hasMore:p}=Wn(),[g,h]=A.useState(""),[b,x]=A.useState(de.allProjects),j=A.useDeferredValue(g);let v;e[0]!==j?(v=j.trim(),e[0]=j,e[1]=v):v=e[1];const S=v,k=S.length>0,{data:N}=Ss(),{invitations:_,refetch:$}=ns();let w;e[2]!==d.slug?(w=(I,R)=>I.slug===d.slug?-1:R.slug===d.slug?1:0,e[2]=d.slug,e[3]=w):w=e[3];const C=(N??[]).slice().sort(w),{hits:P,isSearching:O,isStale:ne,isError:K}=ai(k?S:""),W=k?C.filter(I=>{const R=S.toLowerCase();return I.name.toLowerCase().includes(R)||I.slug.toLowerCase().includes(R)}):[],oe=we();let q;e[4]!==oe?(q=oe.startsWith("/$org/settings"),e[4]=oe,e[5]=q):q=e[5];const G=q,V=new Map;let B;e[6]!==G||e[7]!==s||e[8]!==f?(B=I=>{F("scope_set",{scoped:I!==null,fromSettings:G}),f(I),s()},e[6]=G,e[7]=s,e[8]=f,e[9]=B):B=e[9];const Q=B;let ee;e[10]!==c||e[11]!==s?(ee=(I,R)=>{F("org_project_travel",{scoped:!!R}),c(R?{to:"/$org/projects/$agentId",params:{org:I,agentId:R}}:{to:"/$org/home",params:{org:I}}),s()},e[10]=c,e[11]=s,e[12]=ee):ee=e[12];const J=ee;let U;e[13]!==c||e[14]!==s||e[15]!==d.slug?(U=()=>{F("picker_new_project"),c({to:"/$org/home",params:{org:d.slug}}),s()},e[13]=c,e[14]=s,e[15]=d.slug,e[16]=U):U=e[16];const me=U;V.set(de.allProjects,{kind:"scope",label:i("sidebar.scope.allProjects")});let D;e[17]!==i?(D=i("sidebar.picker.searchPlaceholder"),e[17]=i,e[18]=D):D=e[18];let H;e[19]!==g||e[20]!==D?(H=n.jsx(Un,{value:g,onValueChange:h,placeholder:D}),e[19]=g,e[20]=D,e[21]=H):H=e[21];const ie=Vn,ke="max-h-none min-h-0 flex-1",X=k?n.jsxs(n.Fragment,{children:[K&&n.jsx(yt,{children:i("sidebar.picker.searchFailed")}),!K&&!O&&P.length===0&&W.length===0&&n.jsx(yt,{children:i("sidebar.picker.noMatches",{query:S})}),!K&&P.length>0&&n.jsx(Me,{heading:i("sidebar.picker.projectsHeading"),className:z(ne&&"opacity-50"),children:P.map(I=>n.jsx(di,{hit:I,currentOrgSlug:d.slug,scopeId:u,rows:V,onScope:Q,onTravel:J},`${I.orgSlug}:${I.id}`))}),W.length>0&&n.jsx(Me,{heading:i("sidebar.picker.orgsHeading"),children:W.map(I=>n.jsx(Ct,{candidate:I,currentOrgSlug:d.slug,rows:V,onTravel:J,onClose:s},I.id))})]}):n.jsxs(n.Fragment,{children:[n.jsx($t,{id:a,label:i("sidebar.picker.projectsHeading"),createLabel:i("sidebar.picker.newProject"),onCreate:me}),n.jsxs(Me,{"aria-labelledby":a,children:[n.jsxs(Ve,{value:de.allProjects,className:Ue,onSelect:()=>Q(null),children:[n.jsx("span",{className:"min-w-0 flex-1 truncate",children:i("sidebar.scope.allProjects")}),u===null&&n.jsx(qe,{size:14})]}),m.map(I=>{const R=de.project(I.id);return V.set(R,{kind:"scope",label:I.title}),n.jsxs(Ve,{value:R,className:Ue,onSelect:()=>Q(I.id),children:[n.jsx(ft,{icon:I.icon,name:I.title}),n.jsx("span",{className:"min-w-0 flex-1 truncate",children:I.title}),u===I.id&&n.jsx(qe,{size:14})]},I.id)}),p&&n.jsx("p",{className:"px-3 py-1.5 text-xs text-muted-foreground",children:i("sidebar.picker.moreExist")})]}),n.jsx($t,{id:l,label:i("sidebar.picker.orgsHeading"),createLabel:i("sidebar.picker.newOrganization"),onCreate:r}),n.jsxs(Me,{"aria-labelledby":l,children:[_.map(I=>n.jsx(ri,{invitation:I,onChanged:$},I.id)),C.map(I=>n.jsx(Ct,{candidate:I,currentOrgSlug:d.slug,rows:V,onTravel:J,onClose:s},I.id))]})]});let te;return e[22]!==ie||e[23]!==X?(te=n.jsx(ie,{className:ke,children:X}),e[22]=ie,e[23]=X,e[24]=te):te=e[24],n.jsxs(Bn,{shouldFilter:!1,value:b,onValueChange:x,className:o,children:[H,te,n.jsx(li,{active:b,rows:V})]})}function Ct(t){const e=y.c(22),{candidate:s,currentOrgSlug:r,rows:o,onTravel:i,onClose:a}=t,l=s.slug===r;let c;e[0]!==s.name||e[1]!==s.slug||e[2]!==l||e[3]!==o?(c=de.org(s.slug),o.set(c,{kind:l?"scope":"travel",label:s.name}),e[0]=s.name,e[1]=s.slug,e[2]=l,e[3]=o,e[4]=c):c=e[4];let d;e[5]!==s.slug||e[6]!==l||e[7]!==a||e[8]!==i?(d=()=>l?a():i(s.slug),e[5]=s.slug,e[6]=l,e[7]=a,e[8]=i,e[9]=d):d=e[9];let u;e[10]!==s?(u=n.jsx(ht,{org:s,size:"xs"}),e[10]=s,e[11]=u):u=e[11];let m;e[12]!==s.name?(m=n.jsx("span",{className:"min-w-0 flex-1 truncate",children:s.name}),e[12]=s.name,e[13]=m):m=e[13];let f;e[14]!==l?(f=l&&n.jsx(qe,{size:14}),e[14]=l,e[15]=f):f=e[15];let p;return e[16]!==d||e[17]!==u||e[18]!==m||e[19]!==f||e[20]!==c?(p=n.jsxs(Ve,{value:c,className:Ue,onSelect:d,children:[u,m,f]}),e[16]=d,e[17]=u,e[18]=m,e[19]=f,e[20]=c,e[21]=p):p=e[21],p}function di(t){const e=y.c(30),{hit:s,currentOrgSlug:r,scopeId:o,rows:i,onScope:a,onTravel:l}=t,c=s.orgSlug===r;let d;e[0]!==s.id||e[1]!==s.orgSlug||e[2]!==s.title||e[3]!==c||e[4]!==i?(d=c?de.project(s.id):de.foreignProject(s.orgSlug,s.id),i.set(d,{kind:c?"scope":"travel",label:s.title}),e[0]=s.id,e[1]=s.orgSlug,e[2]=s.title,e[3]=c,e[4]=i,e[5]=d):d=e[5];let u;e[6]!==s.id||e[7]!==s.orgSlug||e[8]!==c||e[9]!==a||e[10]!==l?(u=()=>c?a(s.id):l(s.orgSlug,s.id),e[6]=s.id,e[7]=s.orgSlug,e[8]=c,e[9]=a,e[10]=l,e[11]=u):u=e[11];let m;e[12]!==s.icon||e[13]!==s.title?(m=n.jsx(ft,{icon:s.icon,name:s.title}),e[12]=s.icon,e[13]=s.title,e[14]=m):m=e[14];let f;e[15]!==s.title?(f=n.jsx("span",{className:"min-w-0 flex-1 truncate",children:s.title}),e[15]=s.title,e[16]=f):f=e[16];let p;e[17]!==s.orgName?(p=n.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:s.orgName}),e[17]=s.orgName,e[18]=p):p=e[18];let g;e[19]!==s.id||e[20]!==c||e[21]!==o?(g=c&&o===s.id&&n.jsx(qe,{size:14}),e[19]=s.id,e[20]=c,e[21]=o,e[22]=g):g=e[22];let h;return e[23]!==u||e[24]!==m||e[25]!==f||e[26]!==p||e[27]!==g||e[28]!==d?(h=n.jsxs(Ve,{value:d,className:Ue,onSelect:u,children:[m,f,p,g]}),e[23]=u,e[24]=m,e[25]=f,e[26]=p,e[27]=g,e[28]=d,e[29]=h):h=e[29],h}function os(t){const e=y.c(32),{collapsed:s,onNavigate:r}=t,o=s===void 0?!1:s,i=T(),{org:a}=E(),{project:l}=Se(),{invitations:c}=ns(),[d,u]=A.useState(!1),[m,f]=A.useState(!1),p=ot();let g;if(e[0]!==o||e[1]!==c.length||e[2]!==a||e[3]!==l||e[4]!==i){const $=l?i("sidebar.picker.projectInOrg",{project:l.title,org:a.name}):a.name;let w;e[6]!==a||e[7]!==l?(w=l?n.jsx(ln,{icon:l.icon,name:l.title,size:"xs",className:"shrink-0"}):n.jsx(ht,{org:a,size:"sm"}),e[6]=a,e[7]=l,e[8]=w):w=e[8];let C;e[9]!==c.length?(C=c.length>0&&n.jsx("span",{className:"absolute -right-1 -top-1 size-2.5 rounded-full bg-destructive ring-2 ring-background"}),e[9]=c.length,e[10]=C):C=e[10];let P;e[11]!==w||e[12]!==C?(P=n.jsxs("div",{className:"relative inline-flex shrink-0",children:[w,C]}),e[11]=w,e[12]=C,e[13]=P):P=e[13];const O=P;g=o?n.jsx(ae,{tooltip:$,"data-tour":Z.switcher,children:O}):n.jsxs("button",{type:"button","data-tour":Z.switcher,"aria-label":i("sidebar.picker.ariaLabel",{name:$}),className:z("flex min-w-0 flex-1 items-center gap-2 rounded-lg py-1.5 pl-1 pr-1.5 text-left md:h-[34px] md:py-0","[transition:background-color_180ms_ease] hover:bg-sidebar-accent",Us),children:[O,n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-foreground",children:l?l.title:a.name}),n.jsx(Fn,{size:14,className:"shrink-0 text-muted-foreground"})]}),e[0]=o,e[1]=c.length,e[2]=a,e[3]=l,e[4]=i,e[5]=g}else g=e[5];const h=g,b=p?"min-h-0 flex-1":"max-h-[min(560px,70dvh,var(--radix-popover-content-available-height,70dvh))]";let x;e[14]!==r?(x=()=>{u(!1),r?.()},e[14]=r,e[15]=x):x=e[15];let j;e[16]===Symbol.for("react.memo_cache_sentinel")?(j=()=>{u(!1),f(!0)},e[16]=j):j=e[16];let v;e[17]!==b||e[18]!==x?(v=n.jsx(ci,{onClose:x,onCreateOrg:j,className:b}),e[17]=b,e[18]=x,e[19]=v):v=e[19];const S=v;let k;e[20]!==o||e[21]!==S||e[22]!==p||e[23]!==d||e[24]!==i||e[25]!==h?(k=p?n.jsxs(Lt,{open:d,onOpenChange:u,direction:"bottom",children:[n.jsx(Ws,{asChild:!0,children:h}),n.jsxs(Et,{className:"flex max-h-[85dvh] flex-col p-0",children:[n.jsx(Ft,{className:"sr-only",children:i("sidebar.picker.title")}),S]})]}):n.jsxs(at,{open:d,onOpenChange:u,children:[n.jsx(Ke,{asChild:!0,children:h}),n.jsx(lt,{side:o?"right":"bottom",align:"start",className:"w-[min(340px,calc(100vw-2rem))] p-0",children:S})]}),e[20]=o,e[21]=S,e[22]=p,e[23]=d,e[24]=i,e[25]=h,e[26]=k):k=e[26];let N;e[27]!==m?(N=n.jsx(Hn,{open:m,onOpenChange:f}),e[27]=m,e[28]=N):N=e[28];let _;return e[29]!==k||e[30]!==N?(_=n.jsxs(n.Fragment,{children:[k,N]}),e[29]=k,e[30]=N,e[31]=_):_=e[31],_}const is=16;function ui(){const t=y.c(7),e=le(),s=We();let r;t[0]!==e?(r=n.jsx(os,{collapsed:e}),t[0]=e,t[1]=r):r=t[1];let o;t[2]!==s?(o=!s&&n.jsx(fi,{}),t[2]=s,t[3]=o):o=t[3];let i;return t[4]!==r||t[5]!==o?(i=n.jsxs(n.Fragment,{children:[r,o]}),t[4]=r,t[5]=o,t[6]=i):i=t[6],i}function mi(t){const e=y.c(12),{onClose:s}=t,r=T();let o;e[0]!==s?(o=n.jsx(os,{onNavigate:s}),e[0]=s,e[1]=o):o=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx("div",{className:"flex-1"}),e[2]=i):i=e[2];let a;e[3]!==r?(a=r("sidebar.header.closeSidebar"),e[3]=r,e[4]=a):a=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(it,{size:is}),e[5]=l):l=e[5];let c;e[6]!==s||e[7]!==a?(c=n.jsx(rt,{onClick:s,"aria-label":a,children:l}),e[6]=s,e[7]=a,e[8]=c):c=e[8];let d;return e[9]!==o||e[10]!==c?(d=n.jsxs(n.Fragment,{children:[o,i,c]}),e[9]=o,e[10]=c,e[11]=d):d=e[11],d}function fi(){const t=y.c(12),e=T(),s=le(),{toggleSidebar:r}=Ce();let o;t[0]!==e?(o=e("sidebar.header.toggleSidebar"),t[0]=e,t[1]=o):o=t[1];const i=o;let a;t[2]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(it,{size:is}),t[2]=a):a=t[2];let l;t[3]!==i||t[4]!==r?(l=n.jsx(ct,{asChild:!0,children:n.jsx(rt,{"aria-label":i,onClick:r,className:"shrink-0 rounded-lg md:size-[34px] group-data-[state=collapsed]/sidebar:mx-auto",children:a})}),t[3]=i,t[4]=r,t[5]=l):l=t[5];const c=!s;let d;t[6]!==i||t[7]!==c?(d=n.jsx(dt,{side:"right",hidden:c,children:i}),t[6]=i,t[7]=c,t[8]=d):d=t[8];let u;return t[9]!==l||t[10]!==d?(u=n.jsxs(ut,{children:[l,d]}),t[9]=l,t[10]=d,t[11]=u):u=t[11],u}function ue(t){const e=y.c(33),{icon:s,label:r,isActive:o,link:i,onSelect:a,ariaLabel:l,className:c,dataTour:d,children:u,trailing:m}=t,f=o===void 0?!1:o,p=le(),g=l??r,h=p?g:void 0;let b;e[0]!==c||e[1]!==d||e[2]!==f||e[3]!==h?(b={isActive:f,tooltip:h,className:c,"data-tour":d},e[0]=c,e[1]=d,e[2]=f,e[3]=h,e[4]=b):b=e[4];const x=b;let j;e[5]!==m?(j=m&&n.jsx("span",{className:"order-last ml-auto flex shrink-0 items-center group-data-[state=collapsed]/sidebar:hidden",children:m}),e[5]=m,e[6]=j):j=e[6];let v;e[7]!==r?(v=n.jsx("span",{className:"truncate",children:r}),e[7]=r,e[8]=v):v=e[8];let S;e[9]!==s||e[10]!==j||e[11]!==v?(S=n.jsxs(n.Fragment,{children:[s,j,v]}),e[9]=s,e[10]=j,e[11]=v,e[12]=S):S=e[12];const k=S;if(i){const $=f?"page":void 0;let w;e[13]!==k||e[14]!==i||e[15]!==g||e[16]!==a||e[17]!==$?(w=n.jsx(Rt,{...i,"aria-label":g,"aria-current":$,onClick:a,children:k}),e[13]=k,e[14]=i,e[15]=g,e[16]=a,e[17]=$,e[18]=w):w=e[18];let C;e[19]!==x||e[20]!==w?(C=n.jsx(ae,{asChild:!0,...x,children:w}),e[19]=x,e[20]=w,e[21]=C):C=e[21];let P;return e[22]!==u||e[23]!==C?(P=n.jsxs(se,{children:[C,u]}),e[22]=u,e[23]=C,e[24]=P):P=e[24],P}let N;e[25]!==k||e[26]!==g||e[27]!==a||e[28]!==x?(N=n.jsx(ae,{...x,"aria-label":g,onClick:a,children:k}),e[25]=k,e[26]=g,e[27]=a,e[28]=x,e[29]=N):N=e[29];let _;return e[30]!==u||e[31]!==N?(_=n.jsxs(se,{children:[N,u]}),e[30]=u,e[31]=N,e[32]=_):_=e[32],_}function rs(t){const e=y.c(5),{label:s,link:r,onSelect:o}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(Qn,{size:16}),e[0]=i):i=e[0];let a;return e[1]!==s||e[2]!==r||e[3]!==o?(a=n.jsx("div",{className:"-mx-2 border-b border-sidebar-border px-2 py-2",children:n.jsx(L,{className:"shrink-0",children:n.jsx(ue,{icon:i,label:s,className:"text-sidebar-foreground/70",link:r,onSelect:o})})}),e[1]=s,e[2]=r,e[3]=o,e[4]=a):a=e[4],a}function pi(t){return t==="board"?"kanban":t==="cdn"?"monitoring":Dt(t)?"cms":null}function as(){const t=y.c(2),{data:e}=Wt();let s;return t[0]!==e?(s=r=>{const o=pi(r);return!o||!e?!1:e.features[o]!==!0},t[0]=e,t[1]=s):s=t[1],s}const xi="settings",gi=["overview","reports","board","files"];function hi(t,e){return!t||!e?!1:!Mt(e.metadata)}function bi(t,e,s,r){if(!t||!e)return!0;const o=r!==void 0;return Jn(o?r:Qt(e.metadata),o?1:e.metadata?.sidebarViewsVersion).includes(s)}function ji(){const t=y.c(16),e=T(),{org:s}=E(),r=we(),o=He(),{project:i,repo:a}=Se(),l=Jt(i?.id);let c;t[0]!==i||t[1]!==o?(c=hi(o,i),t[0]=i,t[1]=o,t[2]=c):c=t[2];const d=c;let u;t[3]!==l||t[4]!==i||t[5]!==o?(u=p=>bi(o,i,p,l),t[3]=l,t[4]=i,t[5]=o,t[6]=u):u=t[6];const m=u;let f;if(t[7]!==m||t[8]!==d||t[9]!==r||t[10]!==s||t[11]!==i?.id||t[12]!==a||t[13]!==o||t[14]!==e){const p={overview:d||!m("overview")?null:{key:"overview",label:e("sidebar.navDestinations.home"),icon:n.jsx(cn,{size:16}),isActive:r===M.home||r===M.orgIndex||r===ce.root||r===`${ce.root}/`,trackAs:"overview",link:o?{to:ce.root,params:{org:s.slug,agentId:o}}:{to:M.home,params:{org:s.slug}}},reports:Xe(M.reports,o)&&!d&&m("reports")?{key:"reports",label:e("sidebar.navDestinations.reports"),icon:n.jsx(Kt,{size:16}),isActive:r===M.reports||r===ce.reports,trackAs:"reports",link:o?{to:ce.reports,params:{org:s.slug,agentId:o}}:{to:M.reports,params:{org:s.slug}}}:null,board:d||!m("board")?null:{key:"board",label:e("sidebar.navDestinations.tasks"),icon:n.jsx(Ht,{size:16}),isActive:r===M.tasks||r===ce.tasks,trackAs:"board",dataTour:Z.tasks,link:{to:o?ce.tasks:M.tasks,params:{org:s.slug,agentId:o??void 0,taskKey:void 0},search:g=>{const h=a??i?.id;return h?{...g,repo:h}:g}}},files:Xe(M.library,o)?{key:"files",label:e("sidebar.navDestinations.library"),icon:n.jsx(Gn,{size:16}),isActive:r===M.library,trackAs:"files",link:{to:M.library,params:{org:s.slug}}}:null};f=gi.map(g=>p[g]).filter(vi),t[7]=m,t[8]=d,t[9]=r,t[10]=s,t[11]=i?.id,t[12]=a,t[13]=o,t[14]=e,t[15]=f}else f=t[15];return f}function vi(t){return t!==null}function yi(t){const e=y.c(9),{onNavigate:s}=t,r=ji(),o=as();let i;if(e[0]!==r||e[1]!==o||e[2]!==s){let l;e[4]!==o||e[5]!==s?(l=c=>n.jsx(ue,{icon:c.icon,label:c.label,dataTour:c.dataTour,isActive:c.isActive,link:c.link,trailing:o(c.key)?n.jsx(nt,{size:14,className:"text-muted-foreground"}):void 0,onSelect:()=>{F("nav_destination_clicked",{destination:c.trackAs}),s?.()}},c.key),e[4]=o,e[5]=s,e[6]=l):l=e[6],i=r.map(l),e[0]=r,e[1]=o,e[2]=s,e[3]=i}else i=e[3];let a;return e[7]!==i?(a=n.jsx(L,{className:"gap-1",children:i}),e[7]=i,e[8]=a):a=e[8],a}function Si(t){const e=y.c(18),{onNavigate:s}=t,r=T(),{org:o}=E(),i=He(),a=pt(),l=we(),c=ks();let d;e[0]!==c||e[1]!==l?(d=l.startsWith("/$org/settings")||l.startsWith(M.projects)&&c==="settings",e[0]=c,e[1]=l,e[2]=d):d=e[2];const u=d;let m;e[3]!==r?(m=r("sidebar.navDestinations.settings"),e[3]=r,e[4]=m):m=e[4];const f=m;let p;e[5]!==o||e[6]!==i?(p=i?void 0:{to:"/$org/settings",params:{org:o.slug}},e[5]=o,e[6]=i,e[7]=p):p=e[7];const g=p;let h;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(Bt,{size:16}),e[8]=h):h=e[8];let b;e[9]!==a||e[10]!==s||e[11]!==i?(b=()=>{F("nav_destination_clicked",{destination:xi,target:i?"project":"org"}),i&&a(i,{panel:"settings"}),s?.()},e[9]=a,e[10]=s,e[11]=i,e[12]=b):b=e[12];let x;return e[13]!==u||e[14]!==f||e[15]!==g||e[16]!==b?(x=n.jsx(L,{className:"gap-1",children:n.jsx(ue,{dataTour:Z.settings,icon:h,label:f,isActive:u,link:g,onSelect:b})}),e[13]=u,e[14]=f,e[15]=g,e[16]=b,e[17]=x):x=e[17],x}function ki(t,e){const s=new Set(e);return s.size===0?t:t.filter(r=>s.has(r.connectionId))}function Ni(t){const e=t.metadata?.ui;return Array.isArray(e?.pinnedViews)?e.pinnedViews.filter(s=>!!s&&typeof s=="object"&&typeof s.connectionId=="string"&&typeof s.toolName=="string"):[]}function _i(t){const e=y.c(13),{onNavigate:s}=t,r=T(),{project:o}=Se(),i=pt(),a=we(),l=no(),c=Xn(o),d=as(),u=Jt(o?.id);if(!o)return null;let m;if(e[0]!==c.presence||e[1]!==u||e[2]!==o.metadata){const g=Mt(o.metadata),h=u??Qt(o.metadata);m=new Set(Yn(h,Zn(g,c.presence),u!==void 0?1:o.metadata.sidebarViewsVersion)),e[0]=c.presence,e[1]=u,e[2]=o.metadata,e[3]=m}else m=e[3];const f=m;let p;if(e[4]!==l||e[5]!==d||e[6]!==a||e[7]!==i||e[8]!==s||e[9]!==o||e[10]!==f||e[11]!==r){const g=[];f.has("site-editor")&&g.push({key:"site-editor",label:r("sidebar.projectNav.siteEditor"),icon:n.jsx(Vt,{size:16}),panel:"site-editor",isActive:Ci,dataTour:Z.siteEditor});const h={assets:{label:r("common.mainPanelTabs.assets"),icon:n.jsx(so,{size:16})},hosting:{label:r("common.mainPanelTabs.hosting"),icon:n.jsx(mn,{size:16})},e2e:{label:r("common.mainPanelTabs.e2e"),icon:n.jsx(Ys,{size:16})},analytics:{label:r("common.mainPanelTabs.analytics"),icon:n.jsx(Kt,{size:16})},cdn:{label:r("common.mainPanelTabs.cdn"),icon:n.jsx(un,{size:16})},experiments:{label:r("experiments.title"),icon:n.jsx(dn,{size:16})}};for(const x of eo){if(!f.has(x))continue;const j=h[x];g.push({key:x,label:j.label,icon:j.icon,panel:x,isActive:v=>v===x})}for(const x of ki(Ni(o),(o.connections??[]).map($i)))x.toolName!=="fetch_assets"&&g.push({key:`pinned:${x.connectionId}:${x.toolName}`,label:x.label||x.toolName,icon:x.icon?n.jsx("img",{src:x.icon,alt:"",className:"size-4 rounded-[3px]"}):n.jsx(to,{size:16}),panel:jt(x.connectionId,x.toolName),isActive:j=>j===jt(x.connectionId,x.toolName)});f.has("automations")&&g.push({key:"automations",label:r("sidebar.projectNav.automations"),icon:n.jsx(Ut,{size:16}),panel:"automations",isActive:wi,dataTour:Z.automations});const b=a.startsWith(M.projects);p=n.jsx(L,{className:"gap-1",children:g.map(x=>n.jsx(ue,{icon:x.icon,label:x.label,dataTour:x.dataTour,isActive:b&&x.isActive(l),trailing:d(x.panel)?n.jsx(nt,{size:14,className:"text-muted-foreground"}):void 0,onSelect:()=>{F("project_nav_clicked",{surface:x.key}),i(o.id,{panel:x.panel}),s?.()}},x.key))}),e[4]=l,e[5]=d,e[6]=a,e[7]=i,e[8]=s,e[9]=o,e[10]=f,e[11]=r,e[12]=p}else p=e[12];return p}function wi(t){return t==="automations"||Ns(t)!==null}function $i(t){return t.connection_id}function Ci(t){return!!t&&Dt(t)}const Ii=3;function Pi(t,e){return t.status==="archived"||t.status==="done"?!1:e&&t.assigneeId===e?!0:Rn(t)||Dn(t)}function Ti(t,e,s){const r=new Map;for(const i of e){if(!Pi(i,s))continue;const a=An(i,t);for(const l of a){const c=r.get(l.id)??[];c.push({task:i,only:a.length===1}),r.set(l.id,c)}}const o=new Map;for(const[i,a]of r)a.sort((l,c)=>Number(c.only)-Number(l.only)||(c.task.updatedAt??"").localeCompare(l.task.updatedAt??"")),o.set(i,a.slice(0,Ii).map(l=>l.task));return o}function zi(t){const e=y.c(21),{task:s,orgSlug:r,isLast:o,onNavigate:i}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx("span",{"aria-hidden":"true",className:"absolute top-0 left-4 h-1/2 w-3 rounded-bl-lg border-b border-l border-sidebar-border"}),e[0]=a):a=e[0];let l;e[1]!==o?(l=!o&&n.jsx("span",{"aria-hidden":"true",className:"absolute top-1/2 bottom-0 left-4 border-l border-sidebar-border"}),e[1]=o,e[2]=l):l=e[2];let c;e[3]!==r||e[4]!==s?(c=On(r,s),e[3]=r,e[4]=s,e[5]=c):c=e[5];let d;e[6]!==r||e[7]!==c?(d={org:r,taskKey:c},e[6]=r,e[7]=c,e[8]=d):d=e[8];let u;e[9]!==i||e[10]!==s.status?(u=()=>{F("sidebar_attention_task_clicked",{status:s.status}),i?.()},e[9]=i,e[10]=s.status,e[11]=u):u=e[11];let m;e[12]!==s.title?(m=n.jsx("span",{className:"truncate",children:s.title}),e[12]=s.title,e[13]=m):m=e[13];let f;e[14]!==d||e[15]!==u||e[16]!==m?(f=n.jsx(Rt,{to:"/$org/tasks/{-$taskKey}",params:d,onClick:u,className:"flex h-8 items-center rounded-lg pr-2 pl-9 text-sm text-sidebar-foreground/70 transition-colors hover:bg-sidebar-accent hover:text-sidebar-foreground",children:m}),e[14]=d,e[15]=u,e[16]=m,e[17]=f):f=e[17];let p;return e[18]!==l||e[19]!==f?(p=n.jsxs("li",{className:"relative",children:[a,l,f]}),e[18]=l,e[19]=f,e[20]=p):p=e[20],p}function Ai(t){const e=y.c(35),{onNavigate:s}=t,r=T(),o=le(),{org:i,locator:a}=E(),l=At(),{projects:c}=Se(),d=He(),u=pt(),{data:m}=Y.useSession();let f;e[0]!==a||e[1]!==l?(f=Mn(a,l),e[0]=a,e[1]=l,e[2]=f):f=e[2];const p=!o&&!d;let g;e[3]!==f||e[4]!==p?(g={...f,enabled:p},e[3]=f,e[4]=p,e[5]=g):g=e[5];const{data:h}=st(g);if(d||c.length===0)return null;let b,x,j,v,S,k;if(e[6]!==o||e[7]!==h?.items||e[8]!==u||e[9]!==s||e[10]!==i||e[11]!==c||e[12]!==d||e[13]!==m?.user?.id||e[14]!==r){const $=Ti(zn(c),h?.items??[],m?.user?.id),w=o&&"pt-3";e[21]!==w?(v=z("flex flex-col gap-1",w),e[21]=w,e[22]=v):v=e[22],S=Z.projects,e[23]!==o||e[24]!==r?(k=!o&&n.jsx("p",{className:"px-2 pt-5 pb-0.5 text-xs font-medium text-muted-foreground/60",children:r("sidebar.projects.heading")}),e[23]=o,e[24]=r,e[25]=k):k=e[25],b=L,x="gap-1",j=c.map(C=>{const P=$.get(C.id)??[];return n.jsx(ue,{icon:n.jsx(ft,{icon:C.icon,name:C.title}),label:C.title,isActive:C.id===d,onSelect:()=>{F("sidebar_project_clicked"),u(C.id,{panel:_s(C.metadata?.ui?.layout)}),s?.()},children:!o&&P.length>0&&n.jsx("ul",{className:"flex flex-col",children:P.map((O,ne)=>n.jsx(zi,{task:O,orgSlug:i.slug,isLast:ne===P.length-1,onNavigate:s},O.id))})},C.id)}),e[6]=o,e[7]=h?.items,e[8]=u,e[9]=s,e[10]=i,e[11]=c,e[12]=d,e[13]=m?.user?.id,e[14]=r,e[15]=b,e[16]=x,e[17]=j,e[18]=v,e[19]=S,e[20]=k}else b=e[15],x=e[16],j=e[17],v=e[18],S=e[19],k=e[20];let N;e[26]!==b||e[27]!==x||e[28]!==j?(N=n.jsx(b,{className:x,children:j}),e[26]=b,e[27]=x,e[28]=j,e[29]=N):N=e[29];let _;return e[30]!==v||e[31]!==S||e[32]!==k||e[33]!==N?(_=n.jsxs("div",{className:v,"data-tour":S,children:[k,N]}),e[30]=v,e[31]=S,e[32]=k,e[33]=N,e[34]=_):_=e[34],_}function Oi(){const t=y.c(8),e=T(),{capabilities:s,isPrivileged:r,loading:o,error:i}=ws(),a=Sn().length,l=$s();let c;return t[0]!==s||t[1]!==i||t[2]!==r||t[3]!==a||t[4]!==o||t[5]!==e||t[6]!==l?(c=[{key:"account",label:"",items:[{key:"profile",label:e("settings.nav.profile"),icon:n.jsx(mo,{size:14}),to:"/$org/settings/profile"}]},{key:"organization",label:e("settings.nav.organization"),items:[{key:"general",label:e("settings.nav.general"),icon:n.jsx(gn,{size:14}),to:"/$org/settings/general",requires:"org:manage"},{key:"billing",label:e("settings.nav.billing"),icon:n.jsx(ro,{size:14}),to:"/$org/settings/ai-providers",group:"billing"},{key:"connect",label:e("settings.nav.connect"),icon:n.jsx(qt,{size:14}),to:"/$org/settings/connect",group:"connect"},{key:"tasks",label:e("settings.nav.tasks"),icon:n.jsx(Ht,{size:14}),to:"/$org/settings/task-board",requires:"org:manage"}]},{key:"build",label:e("settings.nav.build"),items:[{key:"repositories",label:e("settings.nav.repositories"),icon:n.jsx(ao,{size:14}),to:"/$org/settings/repositories",requires:"file-configs:manage"},{key:"connections",label:e("settings.nav.connections"),icon:n.jsx(fn,{size:14}),to:"/$org/settings/connections"},{key:"agents",label:e("settings.nav.agents"),icon:n.jsx(et,{size:14}),to:"/$org/settings/agents"},{key:"automations",label:e("settings.nav.automations"),icon:n.jsx(fo,{size:14}),to:"/$org/settings/automations",requires:"automations:manage"},{key:"skills",label:e("settings.nav.skills"),icon:n.jsx(uo,{size:14}),to:"/$org/settings/skills"}]},{key:"manage",label:e("settings.nav.manage"),items:[{key:"monitor",label:e("settings.nav.monitor"),icon:n.jsx(pn,{size:14}),to:"/$org/settings/monitor",requires:"monitoring:view"},{key:"members",label:e("settings.nav.members"),icon:n.jsx(et,{size:14}),to:"/$org/settings/members",group:"members",badge:a}]},{key:"advanced",label:e("settings.nav.advanced"),collapsible:!0,items:[{key:"secrets",label:e("settings.nav.secrets"),icon:n.jsx(co,{size:14}),to:"/$org/settings/secrets",requires:"secrets:manage"},{key:"storage",label:e("settings.nav.storage"),icon:n.jsx(lo,{size:14}),to:"/$org/settings/buckets",group:"storage"},{key:"store",label:e("settings.nav.store"),icon:n.jsx(xn,{size:14}),to:"/$org/settings/store",requires:"registry:manage"},{key:"sso",label:e("settings.nav.security"),icon:n.jsx(nt,{size:14}),to:"/$org/settings/sso",requires:"org:manage"}]}].map(u=>({...u,items:u.items.flatMap(m=>{if(m.group){const[f]=l[m.group];return f?[{...m,to:f.to}]:Cs(m.group)?[]:[m]}return o||i?[m]:m.privilegedOnly?r?[m]:[]:m.requires?r||s[m.requires]?[m]:[]:[m]})})).filter(Ri),t[0]=s,t[1]=i,t[2]=r,t[3]=a,t[4]=o,t[5]=e,t[6]=l,t[7]=c):c=t[7],c}function Ri(t){return t.items.length>0}function ls(){const t=y.c(8);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org"},t[0]=e):e=t[0];const{org:s}=Is(e);let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r={select:Di},t[1]=r):r=t[1];const o=Ps(r);let i;if(t[2]!==s||t[3]!==o){const c=d=>{const u=d.replace("$org",s);return o===u||o.startsWith(`${u}/`)};i=d=>[d.to,...d.group?Ts(d.group):[]].some(c),t[2]=s,t[3]=o,t[4]=i}else i=t[4];const a=i;let l;return t[5]!==a||t[6]!==s?(l={org:s,isActive:a},t[5]=a,t[6]=s,t[7]=l):l=t[7],l}function Di(t){return t.location.pathname}function Mi(){const t=y.c(9),{isActive:e}=ls();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s={},t[0]=s):s=t[0];const[r,o]=A.useState(s);let i;t[1]!==e||t[2]!==r?(i=u=>r[u.key]??(!u.collapsible||u.items.some(e)),t[1]=e,t[2]=r,t[3]=i):i=t[3];const a=i;let l;t[4]!==a?(l=u=>o(m=>({...m,[u.key]:!a(u)})),t[4]=a,t[5]=l):l=t[5];const c=l;let d;return t[6]!==a||t[7]!==c?(d={isOpen:a,toggle:c},t[6]=a,t[7]=c,t[8]=d):d=t[8],d}function Li(t){const e=y.c(21),{group:s,open:r,onToggle:o,className:i}=t;let a,l,c,d,u;if(e[0]!==i||e[1]!==s.collapsible||e[2]!==s.label||e[3]!==o||e[4]!==r){u=Symbol.for("react.early_return_sentinel");e:{const g=z("text-xs font-medium text-muted-foreground/60 truncate",i);if(!s.collapsible){u=n.jsx("p",{className:g,children:s.label});break e}a="button",l=o,c=r,d=z("flex w-full items-center gap-1 rounded-md hover:text-muted-foreground",g)}e[0]=i,e[1]=s.collapsible,e[2]=s.label,e[3]=o,e[4]=r,e[5]=a,e[6]=l,e[7]=c,e[8]=d,e[9]=u}else a=e[5],l=e[6],c=e[7],d=e[8],u=e[9];if(u!==Symbol.for("react.early_return_sentinel"))return u;let m;e[10]!==r?(m=r?n.jsx(oo,{size:12}):n.jsx(io,{size:12}),e[10]=r,e[11]=m):m=e[11];let f;e[12]!==s.label?(f=n.jsx("span",{className:"truncate",children:s.label}),e[12]=s.label,e[13]=f):f=e[13];let p;return e[14]!==a||e[15]!==l||e[16]!==c||e[17]!==d||e[18]!==m||e[19]!==f?(p=n.jsxs("button",{type:a,onClick:l,"aria-expanded":c,className:d,children:[m,f]}),e[14]=a,e[15]=l,e[16]=c,e[17]=d,e[18]=m,e[19]=f,e[20]=p):p=e[20],p}function Ei(t){const e=y.c(5),{icon:s,badge:r}=t;let o;e[0]!==r?(o=r?n.jsx("span",{className:"absolute -right-1 -top-1 size-2 rounded-full bg-destructive pointer-events-none"}):null,e[0]=r,e[1]=o):o=e[1];let i;return e[2]!==s||e[3]!==o?(i=n.jsxs("span",{className:"relative shrink-0",children:[s,o]}),e[2]=s,e[3]=o,e[4]=i):i=e[4],i}function cs(t){const e=y.c(22),{onNavigate:s}=t,r=T(),o=Oi(),{org:i,isActive:a}=ls(),{isOpen:l,toggle:c}=Mi();let d;if(e[0]!==o||e[1]!==a||e[2]!==l||e[3]!==s||e[4]!==i||e[5]!==c){let h;e[7]!==a||e[8]!==l||e[9]!==s||e[10]!==i||e[11]!==c?(h=(b,x)=>n.jsxs("div",{className:"flex flex-col",children:[b.label&&n.jsx(Li,{group:b,open:l(b),onToggle:()=>c(b),className:z("px-2 pt-1.5 pb-0.5",x>0&&"mt-3")}),l(b)&&n.jsx(L,{className:"gap-0.5",children:b.items.map(j=>n.jsx(ue,{icon:n.jsx(Ei,{icon:j.icon,badge:j.badge}),label:j.label,isActive:a(j),link:{to:j.to,params:{org:i}},className:"gap-2.5",onSelect:()=>{F("settings_nav_clicked",{section_key:j.key,group_key:b.key}),s?.()}},j.key))})]},b.key),e[7]=a,e[8]=l,e[9]=s,e[10]=i,e[11]=c,e[12]=h):h=e[12],d=o.map(h),e[0]=o,e[1]=a,e[2]=l,e[3]=s,e[4]=i,e[5]=c,e[6]=d}else d=e[6];let u;e[13]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx("div",{className:"mx-2 my-2 border-t border-border/50"}),e[13]=u):u=e[13];let m;e[14]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx("span",{className:"shrink-0",children:n.jsx(Ze,{size:14})}),e[14]=m):m=e[14];let f;e[15]!==r?(f=r("settings.nav.signOut"),e[15]=r,e[16]=f):f=e[16];let p;e[17]!==f?(p=n.jsxs("div",{className:"mt-auto flex flex-col",children:[u,n.jsx(L,{className:"gap-0.5",children:n.jsx(ue,{icon:m,label:f,className:"gap-2.5",onSelect:Fi})})]}),e[17]=f,e[18]=p):p=e[18];let g;return e[19]!==d||e[20]!==p?(g=n.jsxs(n.Fragment,{children:[d,p]}),e[19]=d,e[20]=p,e[21]=g):g=e[21],g}function Fi(){F("signed_out",{source:"settings_sidebar"}),zt(),Y.signOut()}function ds(t){const e=y.c(8),{onNavigate:s}=t,r=T(),{org:o}=E();let i;e[0]!==r?(i=r("settings.nav.backToHome"),e[0]=r,e[1]=i):i=e[1];let a;e[2]!==o.slug?(a={to:"/$org/home",params:{org:o.slug}},e[2]=o.slug,e[3]=a):a=e[3];let l;return e[4]!==s||e[5]!==i||e[6]!==a?(l=n.jsx(rs,{label:i,link:a,onSelect:s}),e[4]=s,e[5]=i,e[6]=a,e[7]=l):l=e[7],l}function us(){const t=y.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"px-4 pb-1",children:n.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v","4.372.0"]})}),t[0]=e):e=t[0],e}const qi="pt-1.5";function ms(t){const e=y.c(15),{header:s,back:r,body:o,footer:i,sheet:a}=t;let l;e[0]!==s?(l=s&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"flex h-12 shrink-0 flex-row items-center gap-2 px-2 group-data-[state=collapsed]/sidebar:h-auto group-data-[state=collapsed]/sidebar:flex-col group-data-[state=collapsed]/sidebar:py-2",children:s}),n.jsx("div",{className:"mt-1.5 h-px shrink-0 bg-sidebar-border"})]}),e[0]=s,e[1]=l):l=e[1];let c;e[2]!==r?(c=r&&n.jsx("div",{className:"shrink-0 px-2",children:r}),e[2]=r,e[3]=c):c=e[3];let d;e[4]!==o?(d=n.jsx(Ls,{className:"gap-0 overflow-y-auto px-2 pt-2 pb-2 group-data-[state=collapsed]/sidebar:[scrollbar-width:none] group-data-[state=collapsed]/sidebar:[&::-webkit-scrollbar]:hidden",children:o}),e[4]=o,e[5]=d):d=e[5];let u;e[6]!==i||e[7]!==l||e[8]!==c||e[9]!==d?(u=n.jsxs(n.Fragment,{children:[l,c,d,i]}),e[6]=i,e[7]=l,e[8]=c,e[9]=d,e[10]=u):u=e[10];const m=u;if(a){let p;return e[11]!==m?(p=n.jsx("div",{className:"group/sidebar flex h-full w-full flex-col bg-sidebar text-sidebar-foreground","data-sidebar":"sidebar","data-state":"expanded","data-tour":Z.nav,children:m}),e[11]=m,e[12]=p):p=e[12],p}let f;return e[13]!==m?(f=n.jsx(Es,{className:qi,"data-tour":Z.nav,children:m}),e[13]=m,e[14]=f):f=e[14],f}function fs(t){const e=y.c(8),{onNavigate:s}=t,r=T(),o=He(),i=wo();if(!o)return null;let a;e[0]!==r?(a=r("sidebar.scope.allProjects"),e[0]=r,e[1]=a):a=e[1];let l;e[2]!==i||e[3]!==s?(l=()=>{i(),s?.()},e[2]=i,e[3]=s,e[4]=l):l=e[4];let c;return e[5]!==a||e[6]!==l?(c=n.jsx(rs,{label:a,onSelect:l}),e[5]=a,e[6]=l,e[7]=c):c=e[7],c}function ps(t){const e=y.c(2),{onNavigate:s}=t;let r;return e[0]!==s?(r=n.jsx(zs,{children:n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(yi,{onNavigate:s}),n.jsx(_i,{onNavigate:s}),n.jsx(Si,{onNavigate:s}),n.jsx(Ai,{onNavigate:s})]})}),e[0]=s,e[1]=r):r=e[1],r}function Vi(){const t=y.c(3),e=We();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(ui,{}),t[0]=s):s=t[0];let r;return t[1]!==e?(r=n.jsx(ms,{header:s,back:e?n.jsx(ds,{}):n.jsx(fs,{}),body:e?n.jsx(cs,{}):n.jsx(ps,{}),footer:e?n.jsx(us,{}):n.jsx(ni,{})}),t[1]=e,t[2]=r):r=t[2],r}function Bi(t){const e=y.c(13),{onClose:s}=t,r=We();let o;e[0]!==s?(o=n.jsx(mi,{onClose:s}),e[0]=s,e[1]=o):o=e[1];let i,a;e[2]!==r||e[3]!==s?(i=r?n.jsx(ds,{onNavigate:s}):n.jsx(fs,{onNavigate:s}),a=r?n.jsx(cs,{onNavigate:s}):n.jsx(ps,{onNavigate:s}),e[2]=r,e[3]=s,e[4]=i,e[5]=a):(i=e[4],a=e[5]);let l;e[6]!==r?(l=r?n.jsx(us,{}):n.jsx(oi,{}),e[6]=r,e[7]=l):l=e[7];let c;return e[8]!==o||e[9]!==i||e[10]!==a||e[11]!==l?(c=n.jsx(ms,{sheet:!0,header:o,back:i,body:a,footer:l}),e[8]=o,e[9]=i,e[10]=a,e[11]=l,e[12]=c):c=e[12],c}const Ui=new Set(["completed","failed","requires_action"]);function Hi(t){const e=y.c(5),[s]=Tt();let r;e[0]!==s?(r=i=>{s.enableSounds&&Ui.has(i.data.status)&&po(xo.dataUri).catch(Ki)},e[0]=s,e[1]=r):r=e[1];let o;e[2]!==t||e[3]!==r?(o={orgSlug:t,onTaskStatus:r},e[2]=t,e[3]=r,e[4]=o):o=e[4],go(o)}function Ki(t){console.warn("[status-sounds] playback failed:",t)}const Wi=2e3,Gi=4e4;function Qi(t){return t==="success"||t==="updated"}function Ji(t){const e=y.c(15);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},e[0]=s):s=e[0];const r=As(s),o=Ot();let i;e[1]!==r.checkout?(i=Qi(r.checkout),e[1]=r.checkout,e[2]=i):i=e[2];const a=i,[l]=A.useState(Xi);let c;e[3]!==t?(c=Ee.checkoutReturnPoll(t),e[3]=t,e[4]=c):c=e[4];let d;e[5]!==l?(d=()=>Date.now()<l?Wi:!1,e[5]=l,e[6]=d):d=e[6];let u;e[7]!==t||e[8]!==o?(u=async()=>(await o.invalidateQueries({queryKey:Ee.aiPlanEntitlements(t)}),Date.now()),e[7]=t,e[8]=o,e[9]=u):u=e[9];let m;e[10]!==a||e[11]!==c||e[12]!==d||e[13]!==u?(m={queryKey:c,enabled:a,gcTime:0,staleTime:0,refetchInterval:d,queryFn:u},e[10]=a,e[11]=c,e[12]=d,e[13]=u,e[14]=m):m=e[14],st(m)}function Xi(){return Date.now()+Gi}function cl(){const t=y.c(5),e=We(),{org:s}=E();Hi(s.slug),Ji(s.id);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(_o,{}),t[0]=r):r=t[0];let o;t[1]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(Je.Sidebar,{renderMobile:Yi,children:n.jsx(Vi,{})}),t[1]=o):o=t[1];let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(Je.Content,{children:n.jsx(Os,{})}),t[2]=i):i=t[2];let a;return t[3]!==e?(a=n.jsxs(Je,{expandedSidebar:e,notice:r,children:[o,i]}),t[3]=e,t[4]=a):a=t[4],a}function Yi(t){const{onClose:e}=t;return n.jsx(Bi,{onClose:e})}export{cl as default};
1
+ import{c as y,b as T,j as n,I as It,r as A,J as xs,M as E,l as z,B as Le,F as gs,R as we,U as Xe,o as F,X as Pt,a as Y,d as $e,v as Tt,t as re,Y as hs,Z as zt,_ as At,n as Ot,e as bs,K as Ee,w as js,$ as vs,m as st,a0 as ys,s as Ss,L as Rt,a1 as M,C as ce,D as nt,a2 as ks,a3 as jt,a4 as Ns,a5 as _s,a6 as ws,a7 as $s,a8 as Cs,f as Is,k as Ps,a9 as Ts,E as zs,u as As,O as Os}from"./index-z4bKt11m.js";import{u as Ce,S as Rs,a as Ds,b as Ms,c as ae,d as L,e as se,f as Ye,g as Ls,h as Es}from"./sidebar-BCim0GYP.js";import{S as Fs,a as qs,b as Vs}from"./sheet-DhNzwMUj.js";import{u as ot}from"./use-mobile-CV7f0Wqe.js";import{i as it,a as Bs}from"./Printer-BpZBiqyG.js";import{P as Ne}from"./index-G9Ugx8pT.js";import{T as rt,I as Us}from"./toolbar-icon-button-8ctMGgIP.js";import{u as Hs,i as Dt}from"./use-org-notice-C5thI8aD.js";import{u as Se,a as He,b as Mt}from"./use-project-scope-DRope0ob.js";import{u as Ks}from"./thread-route-B1EuqJlg.js";import{L as Z}from"./anchors-yqDzZN4K.js";import{P as at,a as Ke,b as lt}from"./popover-CsEsUqbZ.js";import{D as Lt,a as Et,b as Ft,c as Ws}from"./drawer-CBdcJytm.js";import{A as Fe}from"./avatar-Duu5Gg02.js";import{T as ct,a as dt,b as Gs,c as ut}from"./tooltip-BuKeolDX.js";import{a as Qs}from"./Copy01-DTHuBaTA.js";import{n as Js}from"./Download01-qX3hmvr5.js";import{i as Xs}from"./Globe01-DIy8wXF6.js";import{n as qt}from"./LinkExternal01-BkRUjBAn.js";import{g as Ze,e as Ys}from"./TrendUp01-Bkdgpfn7.js";import{i as Vt}from"./Monitor01-CQ6Zk1oP.js";import{n as Zs,a as en}from"./Sun-SBoG-e9B.js";import{a as Bt}from"./Settings02-CFcKewXh.js";import{i as tn}from"./Shield01-HrKG6yUn.js";import{t as sn,a as nn,i as on,b as rn,c as Ut,s as mt,d as an,A as ln,n as Ht,e as Kt,f as cn,g as dn,h as un,j as mn,k as fn,l as pn,m as xn}from"./agent-icon-BD4DM2Lv.js";import{b as et,t as gn}from"./Users03-BP-0DNhp.js";import{u as hn}from"./use-deployment-admin-MznxNIiy.js";import{u as bn}from"./use-is-desktop-app-BNujXJc_.js";import{i as jn,a as vt,D as vn}from"./download-app-dialog-Bsig7tOs.js";import{I as yn,u as Sn}from"./use-join-requests-BZzsbvb0.js";import{u as kn}from"./use-deco-credits-Du6WCMYS.js";import{u as Nn,a as Wt}from"./use-entitlements-BWaaNeuI.js";import{u as _n,P as wn}from"./plan-ladder-C80Qcxkm.js";import{u as $n}from"./use-organization-settings-C-XY0Wze.js";import{S as Cn}from"./scroll-area-BqCCUXvj.js";import{u as In}from"./useInfiniteQuery-C6OBOha-.js";import{n as Pn}from"./hooks-CkL4R3Tj.js";import{t as Gt,S as Tn,b as zn,p as An,a as On,i as Rn,c as Dn,d as Mn}from"./task-route-Btltx00G.js";import{g as Ln}from"./get-initials-D-f_fDFw.js";import{a as En}from"./format-time-BtXRrtv4.js";import{i as qe}from"./Check-BZE0WrNL.js";import{i as Fn}from"./ChevronSelectorVertical-oXn0cTzk.js";import{s as qn}from"./Plus-D2HOi_DD.js";import{C as yt,a as Me,b as Ve,c as Vn,d as Bn,e as Un}from"./command-D2fiEFer.js";import{P as ft}from"./project-icon-Cw3la58q.js";import{C as Hn}from"./create-organization-dialog-D0myNU26.js";import{s as Kn}from"./XClose-Cvyz3reC.js";import{u as Wn}from"./use-virtual-mcp-Bq1RMGPF.js";import{i as Gn}from"./Share07-CxuHcmnM.js";import{i as Qn}from"./ArrowLeft-CyH6aWpS.js";import{e as Jn,r as Qt,u as Xn,s as Yn,p as Zn,P as eo}from"./use-project-native-view-presence-0NQTfFQT.js";import{u as Jt}from"./optimistic-project-sidebar-views-yjPJnhEG.js";import{u as pt}from"./use-navigate-to-agent-BMSyO1iB.js";import{c as to}from"./SwitchHorizontal01-hHr6GOmU.js";import{a as so}from"./Image01-DfaxHjlV.js";import{u as no}from"./use-panel-navigate-BG4d0Vrr.js";import{t as oo}from"./ChevronUp-D5_IWEtB.js";import{i as io}from"./ChevronRight-DNrwFBnC.js";import{i as ro}from"./CreditCard01-CwX6pA0M.js";import{i as ao}from"./GitBranch01-ddoPQdPH.js";import{i as lo}from"./HardDrive-DU_z1AQw.js";import{i as co}from"./Key01-mqjfsZRe.js";import{t as uo}from"./Stars01-B_nM3FYf.js";import{s as mo}from"./User01-BbOpA84p.js";import{i as fo}from"./Zap-DXNovEva.js";import{p as po,q as xo}from"./question-004-sINsf4GQ.js";import{u as go}from"./use-decopilot-events-_O_0AHeH.js";import"./X-Bzh3NI3m.js";import"./github-repo-BknN0SVI.js";import"./index-B46P4HkV.js";import"./AlertCircle-DbwtWnTP.js";import"./Tool01-DHi_Z7zo.js";import"./ArrowUp-Scf6R8DX.js";import"./Tool02-JY0gm8cg.js";import"./ArrowRight-Bv0iX4wy.js";import"./ZoomOut-BRjMa-04.js";import"./CheckCircle-BKb1RVrA.js";import"./DotsVertical-DE9eZKrJ.js";import"./UserSquare-qgzToKNd.js";import"./Database01-RGlwXHSd.js";import"./MessageCircle01-CgotMmLL.js";import"./Eye-DXUjft5i.js";import"./File02-g-xJPix_.js";import"./Link01-C656VtHx.js";import"./Package-t6euxYcP.js";import"./Palette-oECS8j3l.js";import"./Play-DQgzDnaW.js";import"./SearchLg-DbX4T5E-.js";import"./SearchMd-FDCJM3CR.js";import"./Trash01-C6bziN5X.js";import"./Upload01-DC2spim9.js";import"./Users01-BOsDT0Jv.js";import"./XCircle-CuK2q_XU.js";import"./dialog-DbzCN1O8.js";import"./form-B7dtslOD.js";import"./label-8juC5J-g.js";import"./select-cIekAVlM.js";import"./textarea-BEOceSll.js";import"./use-org-auth-client-ZxEGrzhh.js";import"./use-organization-roles-DmWmnvDm.js";import"./use-ai-providers-B0bxSHYG.js";import"./schema-D0xfowSf.js";import"./task-board-lQZGfEfb.js";import"./infiniteQueryObserver-BjcfJE2O.js";import"./use-mcp-client-B1u2B39v.js";import"./auth-D-2jYpOE.js";import"./backoff-8mStPHYB.js";import"./dropdown-menu-Dd8nakK9.js";import"./github-icon-BcrkxW36.js";import"./differenceInSeconds-C3x8sHUj.js";import"./index-Cyoz5tz5.js";import"./alert-dialog-Bi9Cy1y8.js";import"./input-C7XH8Uj_.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./use-file-configs-sqbLS09v.js";import"./site-slug-uya6Wp4-.js";import"./thread-intent-9fI0jPLV.js";import"./slugify-CEUa2lfQ.js";function le(){const{state:t,isMobile:e}=Ce();return t==="collapsed"&&!e}function ho(t){const e=y.c(11),{onPointerDown:s,onDoubleClick:r}=t,o=T(),{isMobile:i}=Ce(),a=le();if(i||a)return null;let l;e[0]!==o?(l=o("sidebar.sidebarResizeHandle.ariaLabel"),e[0]=o,e[1]=l):l=e[1];let c;e[2]!==o?(c=o("sidebar.sidebarResizeHandle.title"),e[2]=o,e[3]=c):c=e[3];let d,u;e[4]===Symbol.for("react.memo_cache_sentinel")?(d={left:"var(--sidebar-width)"},u=n.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-transparent transition-colors duration-150 group-hover/resize:bg-border group-active/resize:bg-border"}),e[4]=d,e[5]=u):(d=e[4],u=e[5]);let m;return e[6]!==r||e[7]!==s||e[8]!==l||e[9]!==c?(m=n.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":l,title:c,onPointerDown:s,onDoubleClick:r,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize",style:d,children:u}),e[6]=r,e[7]=s,e[8]=l,e[9]=c,e[10]=m):m=e[10],m}const xt=240,bo=400,jo="sidebar.width";function _e(t){return Math.max(xt,Math.min(bo,t))}function vo(){const t=y.c(11),[e,s]=It(jo,yo),r=A.useRef(null);let o;t[0]!==s||t[1]!==e?(o=u=>{u.preventDefault();const m=u.clientX,f=_e(e),p=r.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),g=p?Array.from(p.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const x of g)x.style.transition="none";const h=x=>{const j=_e(f+(x.clientX-m));p?.style.setProperty("--sidebar-width",`${j}px`)},b=x=>{const j=_e(f+(x.clientX-m));s(j);for(const v of g)v.style.transition="";window.removeEventListener("pointermove",h),window.removeEventListener("pointerup",b),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",h),window.addEventListener("pointerup",b)},t[0]=s,t[1]=e,t[2]=o):o=t[2];const i=o;let a;t[3]!==s?(a=()=>{s(xt)},t[3]=s,t[4]=a):a=t[4];const l=a;let c;t[5]!==e?(c=_e(e),t[5]=e,t[6]=c):c=t[6];let d;return t[7]!==i||t[8]!==l||t[9]!==c?(d={width:c,wrapperRef:r,onStartResize:i,resetWidth:l},t[7]=i,t[8]=l,t[9]=c,t[10]=d):d=t[10],d}function yo(t){return typeof t=="number"?_e(t):xt}const Xt=A.createContext(null);function Yt(){const t=A.use(Xt);if(!t)throw new Error("Layout regions require a Layout");return t}function So({children:t,notice:e,expandedSidebar:s=!1}){const r=ot(),[o,i]=It(xs.sidebarOpen(),!0),a=vo();return n.jsx(Xt,{value:{isMobile:r,resize:a},children:n.jsx(Rs,{open:s||o,onOpenChange:i,children:n.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[e,n.jsx(Ds,{ref:a.wrapperRef,className:"flex-1 bg-sidebar relative min-h-0",style:{"--sidebar-width":`${a.width}px`,"--sidebar-width-icon":"3.125rem"},children:t})]})})})}function ko(t){const e=y.c(22),{children:s,renderMobile:r}=t,o=T(),{isMobile:i,resize:a}=Yt(),{openMobile:l,setOpenMobile:c}=Ce();if(!i){let h;e[0]!==a.onStartResize||e[1]!==a.resetWidth?(h=n.jsx(ho,{onPointerDown:a.onStartResize,onDoubleClick:a.resetWidth}),e[0]=a.onStartResize,e[1]=a.resetWidth,e[2]=h):h=e[2];let b;return e[3]!==s||e[4]!==h?(b=n.jsxs(n.Fragment,{children:[s,h]}),e[3]=s,e[4]=h,e[5]=b):b=e[5],b}let d;e[6]!==o?(d=o("layouts.shellControls.navigationTitle"),e[6]=o,e[7]=d):d=e[7];let u;e[8]!==d?(u=n.jsx(Fs,{className:"sr-only",children:d}),e[8]=d,e[9]=u):u=e[9];let m;e[10]!==c?(m=()=>c(!1),e[10]=c,e[11]=m):m=e[11];let f;e[12]!==r||e[13]!==m?(f=r({onClose:m}),e[12]=r,e[13]=m,e[14]=f):f=e[14];let p;e[15]!==u||e[16]!==f?(p=n.jsxs(qs,{side:"left",hideCloseButton:!0,className:"w-screen max-w-none! p-0",children:[u,f]}),e[15]=u,e[16]=f,e[17]=p):p=e[17];let g;return e[18]!==l||e[19]!==c||e[20]!==p?(g=n.jsx(Vs,{open:l,onOpenChange:c,children:p}),e[18]=l,e[19]=c,e[20]=p,e[21]=g):g=e[21],g}function No(t){const e=y.c(10),{children:s}=t,r=T(),{isMobile:o}=Yt(),{toggleSidebar:i}=Ce();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={background:"transparent",containerType:"inline-size"},e[0]=a):a=e[0];let l;e[1]!==o||e[2]!==r||e[3]!==i?(l=o&&n.jsxs(Ne.Topbar,{className:"px-1 bg-sidebar",children:[n.jsx(Ne.Topbar.Left,{className:"shrink-0",children:n.jsx(rt,{onClick:i,"aria-label":r("layouts.shellControls.toggleSidebar"),children:n.jsx(it,{size:16})})}),n.jsx(Ne.Topbar.Center,{className:"justify-start",children:n.jsx(Ne.Topbar.Center.Target,{})})]}),e[1]=o,e[2]=r,e[3]=i,e[4]=l):l=e[4];let c;e[5]!==s?(c=n.jsx("div",{className:"relative flex-1 min-h-0 flex flex-row",children:s}),e[5]=s,e[6]=c):c=e[6];let d;return e[7]!==l||e[8]!==c?(d=n.jsx(Ms,{className:"flex flex-col min-h-0",style:a,children:n.jsxs(Ne,{variant:"plain",className:"bg-sidebar",children:[l,c]})}),e[7]=l,e[8]=c,e[9]=d):d=e[9],d}const Je=Object.assign(So,{Sidebar:ko,Content:No});function _o(){const t=y.c(19),{org:e}=E(),{data:s}=Hs(e.slug);if(!s)return null;const r=s.severity==="block",o=r?"border-destructive/25 bg-destructive/5 text-destructive":"border-warning/40 bg-warning/10 text-foreground";let i;t[0]!==o?(i=z("flex shrink-0 flex-wrap items-center gap-x-3 gap-y-1 border-b px-4 py-2 text-sm",o),t[0]=o,t[1]=i):i=t[1];const a=r?void 0:"text-warning";let l;t[2]!==a?(l=z("size-4 shrink-0",a),t[2]=a,t[3]=l):l=t[3];let c;t[4]!==l?(c=n.jsx(gs,{className:l}),t[4]=l,t[5]=c):c=t[5];let d;t[6]!==s.title?(d=n.jsx("span",{className:"font-medium",children:s.title}),t[6]=s.title,t[7]=d):d=t[7];let u;t[8]!==s.message?(u=n.jsx("span",{className:"min-w-0 flex-1 text-muted-foreground",children:s.message}),t[8]=s.message,t[9]=u):u=t[9];let m;t[10]!==s.ctaLabel||t[11]!==s.ctaUrl?(m=s.ctaUrl&&s.ctaLabel?n.jsx(Le,{size:"sm",variant:"outline",asChild:!0,children:n.jsx("a",{href:s.ctaUrl,target:"_blank",rel:"noreferrer noopener",children:s.ctaLabel})}):null,t[10]=s.ctaLabel,t[11]=s.ctaUrl,t[12]=m):m=t[12];let f;return t[13]!==i||t[14]!==c||t[15]!==d||t[16]!==u||t[17]!==m?(f=n.jsxs("div",{role:"alert",className:i,children:[c,d,u,m]}),t[13]=i,t[14]=c,t[15]=d,t[16]=u,t[17]=m,t[18]=f):f=t[18],f}function wo(){const t=y.c(4),{setScope:e}=Se(),s=Ks(),r=we();let o;return t[0]!==r||t[1]!==s||t[2]!==e?(o=()=>{const i=s!==void 0?"route_resolves_scope":Xe(r,null)?null:"route_needs_scope";F("scope_cleared",{relocated:i!==null,reason:i}),e(null)},t[0]=r,t[1]=s,t[2]=e,t[3]=o):o=t[3],o}function We(){const t=y.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings",shouldThrow:!1},t[0]=e):e=t[0],!!Pt(e)}const Be="size-4 shrink-0";function gt(t){const e=y.c(5),{children:s,className:r}=t;let o;e[0]!==r?(o=z("flex w-4 shrink-0 items-center justify-center",r),e[0]=r,e[1]=o):o=e[1];let i;return e[2]!==s||e[3]!==o?(i=n.jsx("span",{className:o,children:s}),e[2]=s,e[3]=o,e[4]=i):i=e[4],i}function ye(t){const e=y.c(26),{item:s,onClose:r}=t;let o;e[0]!==s.className?(o=z("flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",s.className),e[0]=s.className,e[1]=o):o=e[1];const i=o;if(s.href){const u=s.external?"_blank":void 0,m=s.external?"noopener noreferrer":void 0;let f;e[2]!==s.icon?(f=n.jsx("span",{className:"shrink-0 text-muted-foreground",children:s.icon}),e[2]=s.icon,e[3]=f):f=e[3];let p;e[4]!==s.label?(p=n.jsx("span",{className:"flex-1",children:s.label}),e[4]=s.label,e[5]=p):p=e[5];let g;return e[6]!==i||e[7]!==s.href||e[8]!==r||e[9]!==u||e[10]!==m||e[11]!==f||e[12]!==p?(g=n.jsxs("a",{href:s.href,target:u,rel:m,className:i,onClick:r,children:[f,p]}),e[6]=i,e[7]=s.href,e[8]=r,e[9]=u,e[10]=m,e[11]=f,e[12]=p,e[13]=g):g=e[13],g}let a;e[14]!==s||e[15]!==r?(a=()=>{s.onClick?.(),r()},e[14]=s,e[15]=r,e[16]=a):a=e[16];let l;e[17]!==s.icon?(l=n.jsx("span",{className:"shrink-0 text-muted-foreground",children:s.icon}),e[17]=s.icon,e[18]=l):l=e[18];let c;e[19]!==s.label?(c=n.jsx("span",{className:"flex-1",children:s.label}),e[19]=s.label,e[20]=c):c=e[20];let d;return e[21]!==i||e[22]!==a||e[23]!==l||e[24]!==c?(d=n.jsxs("button",{type:"button",onClick:a,className:i,children:[l,c]}),e[21]=i,e[22]=a,e[23]=l,e[24]=c,e[25]=d):d=e[25],d}function $o(){const t=y.c(4),e=T();let s;t[0]!==e?(s=e("common.accountPopover.impersonating"),t[0]=e,t[1]=s):s=t[1];let r;return t[2]!==s?(r=n.jsx("span",{className:"shrink-0 inline-flex items-center rounded-full bg-warning/10 px-2 py-0.5 text-[10px] font-medium text-warning",children:s}),t[2]=s,t[3]=r):r=t[3],r}function St(t){const e=y.c(38),{user:s,userImage:r,isImpersonating:o,isMobile:i}=t,a=T(),l=i?"py-4 border-b border-border":"py-3 mx-1 mt-1";let c;e[0]!==l?(c=z("flex items-center gap-3 px-4",l),e[0]=l,e[1]=c):c=e[1];const d=s?.name??"U";let u;e[2]!==d||e[3]!==r?(u=n.jsx(Fe,{url:r,fallback:d,shape:"circle",size:"sm",className:"shrink-0"}),e[2]=d,e[3]=r,e[4]=u):u=e[4];let m;e[5]!==a||e[6]!==s?.name?(m=s?.name??a("common.accountPopover.defaultUserName"),e[5]=a,e[6]=s?.name,e[7]=m):m=e[7];let f;e[8]!==m?(f=n.jsx("p",{className:"text-sm font-medium truncate",children:m}),e[8]=m,e[9]=f):f=e[9];let p;e[10]!==o?(p=o&&n.jsx($o,{}),e[10]=o,e[11]=p):p=e[11];let g;e[12]!==f||e[13]!==p?(g=n.jsxs("div",{className:"flex items-center gap-2",children:[f,p]}),e[12]=f,e[13]=p,e[14]=g):g=e[14];const h=s?.email;let b;e[15]!==h?(b=n.jsx("p",{className:"text-xs text-muted-foreground truncate",children:h}),e[15]=h,e[16]=b):b=e[16];let x;e[17]!==b||e[18]!==g?(x=n.jsxs("div",{className:"flex-1 min-w-0",children:[g,b]}),e[17]=b,e[18]=g,e[19]=x):x=e[19];let j;e[20]!==a||e[21]!==s?(j=()=>{s?.id&&navigator.clipboard.writeText(s.id).then(()=>{re.success(a("common.accountPopover.userIdCopied"))})},e[20]=a,e[21]=s,e[22]=j):j=e[22];let v;e[23]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(Qs,{size:14}),e[23]=v):v=e[23];let S;e[24]!==j?(S=n.jsx(ct,{asChild:!0,children:n.jsx("button",{type:"button",tabIndex:-1,onClick:j,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:v})}),e[24]=j,e[25]=S):S=e[25];let k;e[26]!==a?(k=a("common.accountPopover.copyUserId"),e[26]=a,e[27]=k):k=e[27];let N;e[28]!==k?(N=n.jsx(dt,{side:"right",children:n.jsx("p",{className:"text-xs",children:k})}),e[28]=k,e[29]=N):N=e[29];let _;e[30]!==S||e[31]!==N?(_=n.jsx(Gs,{delayDuration:300,children:n.jsxs(ut,{children:[S,N]})}),e[30]=S,e[31]=N,e[32]=_):_=e[32];let $;return e[33]!==x||e[34]!==_||e[35]!==c||e[36]!==u?($=n.jsxs("div",{className:c,children:[u,x,_]}),e[33]=x,e[34]=_,e[35]=c,e[36]=u,e[37]=$):$=e[37],$}function kt(t){const e=y.c(35),{themeOptions:s,preferences:r,setPreferences:o,isMobile:i}=t,a=T(),l=i?"size-8":"size-7",c=i?"px-3 py-3":"px-2 py-1.5";let d;e[0]!==c?(d=z("flex items-center justify-between border-t border-border/50",c),e[0]=c,e[1]=d):d=e[1];let u;if(e[2]!==l||e[3]!==r.theme||e[4]!==o||e[5]!==s){let k;e[7]!==l||e[8]!==r.theme||e[9]!==o?(k=N=>{const{value:_,icon:$,label:w}=N;return n.jsx("button",{type:"button","aria-label":w,onClick:()=>o(C=>({...C,theme:_})),className:z(l,"rounded-md flex items-center justify-center transition-colors",r.theme===_?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:$},_)},e[7]=l,e[8]=r.theme,e[9]=o,e[10]=k):k=e[10],u=s.map(k),e[2]=l,e[3]=r.theme,e[4]=o,e[5]=s,e[6]=u}else u=e[6];let m;e[11]!==u?(m=n.jsx("div",{className:"flex items-center gap-0.5",children:u}),e[11]=u,e[12]=m):m=e[12];let f;e[13]!==r.enableSounds||e[14]!==a?(f=r.enableSounds?a("common.accountPopover.disableSounds"):a("common.accountPopover.enableSounds"),e[13]=r.enableSounds,e[14]=a,e[15]=f):f=e[15];let p;e[16]!==o?(p=()=>o(Co),e[16]=o,e[17]=p):p=e[17];const g=r.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let h;e[18]!==l||e[19]!==g?(h=z(l,"rounded-md flex items-center justify-center transition-colors",g),e[18]=l,e[19]=g,e[20]=h):h=e[20];let b;e[21]!==r.enableSounds?(b=r.enableSounds?n.jsx(nn,{size:14}):n.jsx(on,{size:14}),e[21]=r.enableSounds,e[22]=b):b=e[22];let x;e[23]!==f||e[24]!==p||e[25]!==h||e[26]!==b?(x=n.jsx("button",{type:"button","aria-label":f,onClick:p,className:h,children:b}),e[23]=f,e[24]=p,e[25]=h,e[26]=b,e[27]=x):x=e[27];let j;e[28]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.372.1"]}),e[28]=j):j=e[28];let v;e[29]!==x?(v=n.jsxs("div",{className:"flex items-center gap-2",children:[x,j]}),e[29]=x,e[30]=v):v=e[30];let S;return e[31]!==v||e[32]!==d||e[33]!==m?(S=n.jsxs("div",{className:d,children:[m,v]}),e[31]=v,e[32]=d,e[33]=m,e[34]=S):S=e[34],S}function Co(t){return{...t,enableSounds:!t.enableSounds}}function Nt(t){const e=y.c(54),{user:s,userImage:r,menuItems:o,signOutItem:i,stopImpersonatingItem:a,isImpersonating:l,themeOptions:c,preferences:d,setPreferences:u,close:m,isMobile:f}=t;if(f){let S;e[0]!==l||e[1]!==s||e[2]!==r?(S=n.jsx(St,{user:s,userImage:r,isImpersonating:l,isMobile:!0}),e[0]=l,e[1]=s,e[2]=r,e[3]=S):S=e[3];let k;if(e[4]!==m||e[5]!==o){let P;e[7]!==m?(P=O=>n.jsx(ye,{item:O,onClose:m},O.key),e[7]=m,e[8]=P):P=e[8],k=o.map(P),e[4]=m,e[5]=o,e[6]=k}else k=e[6];let N;e[9]!==m||e[10]!==a?(N=a&&n.jsx(ye,{item:a,onClose:m}),e[9]=m,e[10]=a,e[11]=N):N=e[11];let _;e[12]!==m||e[13]!==i?(_=n.jsx(ye,{item:i,onClose:m}),e[12]=m,e[13]=i,e[14]=_):_=e[14];let $;e[15]!==k||e[16]!==N||e[17]!==_?($=n.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:n.jsxs("nav",{className:"flex flex-col px-2 pt-2 pb-2 gap-0.5",children:[k,N,_]})}),e[15]=k,e[16]=N,e[17]=_,e[18]=$):$=e[18];let w;e[19]!==d||e[20]!==u||e[21]!==c?(w=n.jsx(kt,{themeOptions:c,preferences:d,setPreferences:u,isMobile:!0}),e[19]=d,e[20]=u,e[21]=c,e[22]=w):w=e[22];let C;return e[23]!==S||e[24]!==$||e[25]!==w?(C=n.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[S,$,w]}),e[23]=S,e[24]=$,e[25]=w,e[26]=C):C=e[26],C}let p;e[27]!==l||e[28]!==s||e[29]!==r?(p=n.jsx(St,{user:s,userImage:r,isImpersonating:l,isMobile:!1}),e[27]=l,e[28]=s,e[29]=r,e[30]=p):p=e[30];let g;if(e[31]!==m||e[32]!==o){let S;e[34]!==m?(S=k=>n.jsx(ye,{item:k,onClose:m},k.key),e[34]=m,e[35]=S):S=e[35],g=o.map(S),e[31]=m,e[32]=o,e[33]=g}else g=e[33];let h;e[36]!==m||e[37]!==a?(h=a&&n.jsx(ye,{item:a,onClose:m}),e[36]=m,e[37]=a,e[38]=h):h=e[38];let b;e[39]!==m||e[40]!==i?(b=n.jsx(ye,{item:i,onClose:m}),e[39]=m,e[40]=i,e[41]=b):b=e[41];let x;e[42]!==g||e[43]!==h||e[44]!==b?(x=n.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[g,h,b]}),e[42]=g,e[43]=h,e[44]=b,e[45]=x):x=e[45];let j;e[46]!==d||e[47]!==u||e[48]!==c?(j=n.jsx(kt,{themeOptions:c,preferences:d,setPreferences:u,isMobile:!1}),e[46]=d,e[47]=u,e[48]=c,e[49]=j):j=e[49];let v;return e[50]!==p||e[51]!==x||e[52]!==j?(v=n.jsx("div",{className:"flex w-full flex-col overflow-hidden",children:n.jsxs("div",{className:"flex flex-col",children:[p,x,j]})}),e[50]=p,e[51]=x,e[52]=j,e[53]=v):v=e[53],v}function tt(){const t=y.c(107),e=T(),{data:s}=Y.useSession(),{org:r}=E(),o=$e();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org",shouldThrow:!1},t[0]=i):i=t[0];const l=Pt(i)?.params.org,[c,d]=Tt(),u=ot(),{isAdmin:m}=hn(),f=bn(),[p,g]=A.useState(!1),[h,b]=A.useState(!1),x=s?.user,j=x?.image,v=!!s?.session?.impersonatedBy;let S;t[1]===Symbol.for("react.memo_cache_sentinel")?(S=()=>g(!1),t[1]=S):S=t[1];const k=S;let N;t[2]!==e?(N=e("common.accountPopover.preferences"),t[2]=e,t[3]=N):N=t[3];let _;t[4]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx(Bt,{size:16}),t[4]=_):_=t[4];let $;t[5]!==o||t[6]!==l?($=()=>{o({to:"/$org/settings/profile",params:{org:l??""}})},t[5]=o,t[6]=l,t[7]=$):$=t[7];let w;t[8]!==N||t[9]!==$?(w={key:"preferences",label:N,icon:_,onClick:$},t[8]=N,t[9]=$,t[10]=w):w=t[10];let C;t[11]!==r||t[12]!==o?(C=r?[{key:"connect-clients",label:"Connect to Agents",icon:n.jsx(qt,{size:16}),onClick:()=>{o({to:"/$org/settings/connect",params:{org:r.slug}})}}]:[],t[11]=r,t[12]=o,t[13]=C):C=t[13];let P;t[14]!==f||t[15]!==e?(P=(jn()||vt())&&!f?[{key:"install-desktop-app",label:vt()?e("downloadApp.installOnLinux"):e("downloadApp.installOnMac"),icon:n.jsx(Js,{size:16}),onClick:()=>b(!0)}]:[],t[14]=f,t[15]=e,t[16]=P):P=t[16];let O;t[17]!==e?(O=e("common.accountPopover.termsOfUse"),t[17]=e,t[18]=O):O=t[18];let ne;t[19]===Symbol.for("react.memo_cache_sentinel")?(ne=n.jsx(Bs,{size:16}),t[19]=ne):ne=t[19];let K;t[20]!==O?(K={key:"terms",label:O,icon:ne,href:"https://www.decocms.com/terms-of-use",external:!0},t[20]=O,t[21]=K):K=t[21];let W;t[22]!==e?(W=e("common.accountPopover.privacyPolicy"),t[22]=e,t[23]=W):W=t[23];let oe;t[24]===Symbol.for("react.memo_cache_sentinel")?(oe=n.jsx(tn,{size:16}),t[24]=oe):oe=t[24];let q;t[25]!==W?(q={key:"privacy",label:W,icon:oe,href:"https://www.decocms.com/privacy-policy",external:!0},t[25]=W,t[26]=q):q=t[26];let G;t[27]!==e?(G=e("common.accountPopover.githubRepo"),t[27]=e,t[28]=G):G=t[28];let V;t[29]===Symbol.for("react.memo_cache_sentinel")?(V=n.jsx(hs,{className:"w-4 h-4"}),t[29]=V):V=t[29];let B;t[30]!==G?(B={key:"github",label:G,icon:V,href:"https://github.com/decocms/studio",external:!0},t[30]=G,t[31]=B):B=t[31];let Q;t[32]!==e?(Q=e("common.accountPopover.community"),t[32]=e,t[33]=Q):Q=t[33];let ee;t[34]===Symbol.for("react.memo_cache_sentinel")?(ee=n.jsx(et,{size:16}),t[34]=ee):ee=t[34];let J;t[35]!==Q?(J={key:"community",label:Q,icon:ee,href:"https://decocms.com/discord",external:!0},t[35]=Q,t[36]=J):J=t[36];let U;t[37]!==e?(U=e("common.accountPopover.homepage"),t[37]=e,t[38]=U):U=t[38];let me;t[39]===Symbol.for("react.memo_cache_sentinel")?(me=n.jsx(Xs,{size:16}),t[39]=me):me=t[39];let D;t[40]!==U?(D={key:"homepage",label:U,icon:me,href:"https://decocms.com",external:!0},t[40]=U,t[41]=D):D=t[41];let H;t[42]!==m||t[43]!==o||t[44]!==e?(H=m?[{key:"admin-dashboard",label:e("common.accountPopover.adminDashboard"),icon:n.jsx(sn,{size:16}),onClick:()=>o({to:"/_admin"}),className:"text-warning"}]:[],t[42]=m,t[43]=o,t[44]=e,t[45]=H):H=t[45];let ie;t[46]!==K||t[47]!==q||t[48]!==B||t[49]!==J||t[50]!==D||t[51]!==H||t[52]!==w||t[53]!==C||t[54]!==P?(ie=[w,...C,...P,K,q,B,J,D,...H],t[46]=K,t[47]=q,t[48]=B,t[49]=J,t[50]=D,t[51]=H,t[52]=w,t[53]=C,t[54]=P,t[55]=ie):ie=t[55];const ke=ie;let X;t[56]!==e?(X=e("common.accountPopover.signOut"),t[56]=e,t[57]=X):X=t[57];let te;t[58]===Symbol.for("react.memo_cache_sentinel")?(te=n.jsx(Ze,{size:16}),t[58]=te):te=t[58];let I;t[59]!==X?(I={key:"logout",label:X,icon:te,onClick:Po},t[59]=X,t[60]=I):I=t[60];const R=I;let Ie;t[61]!==v||t[62]!==e?(Ie=v?{key:"stop-impersonating",label:e("common.accountPopover.stopImpersonation"),icon:n.jsx(Ze,{size:16}),onClick:async()=>{const{error:bt}=await Y.admin.stopImpersonating();if(bt){re.error(bt.message||e("common.accountPopover.failedToStopImpersonation"));return}window.location.href="/"},className:"text-warning"}:null,t[61]=v,t[62]=e,t[63]=Ie):Ie=t[63];const Ge=Ie;let Pe;t[64]===Symbol.for("react.memo_cache_sentinel")?(Pe=n.jsx(Zs,{size:14}),t[64]=Pe):Pe=t[64];let fe;t[65]!==e?(fe=e("common.accountPopover.lightTheme"),t[65]=e,t[66]=fe):fe=t[66];let pe;t[67]!==fe?(pe={value:"light",icon:Pe,label:fe},t[67]=fe,t[68]=pe):pe=t[68];let Te;t[69]===Symbol.for("react.memo_cache_sentinel")?(Te=n.jsx(en,{size:14}),t[69]=Te):Te=t[69];let xe;t[70]!==e?(xe=e("common.accountPopover.darkTheme"),t[70]=e,t[71]=xe):xe=t[71];let ge;t[72]!==xe?(ge={value:"dark",icon:Te,label:xe},t[72]=xe,t[73]=ge):ge=t[73];let ze;t[74]===Symbol.for("react.memo_cache_sentinel")?(ze=n.jsx(Vt,{size:14}),t[74]=ze):ze=t[74];let he;t[75]!==e?(he=e("common.accountPopover.systemTheme"),t[75]=e,t[76]=he):he=t[76];let be;t[77]!==he?(be={value:"system",icon:ze,label:he},t[77]=he,t[78]=be):be=t[78];let Ae;t[79]!==pe||t[80]!==ge||t[81]!==be?(Ae=[pe,ge,be],t[79]=pe,t[80]=ge,t[81]=be,t[82]=Ae):Ae=t[82];const Qe=Ae;let Oe;t[83]!==v||t[84]!==u||t[85]!==ke||t[86]!==c||t[87]!==d||t[88]!==R||t[89]!==Ge||t[90]!==Qe||t[91]!==x||t[92]!==j?(Oe={user:x,userImage:j,menuItems:ke,signOutItem:R,stopImpersonatingItem:Ge,isImpersonating:v,themeOptions:Qe,preferences:c,setPreferences:d,close:k,isMobile:u},t[83]=v,t[84]=u,t[85]=ke,t[86]=c,t[87]=d,t[88]=R,t[89]=Ge,t[90]=Qe,t[91]=x,t[92]=j,t[93]=Oe):Oe=t[93];const Re=Oe;let je;t[94]!==v||t[95]!==u||t[96]!==p||t[97]!==Re||t[98]!==e||t[99]!==x?.name||t[100]!==j?(je=u?n.jsxs(Lt,{open:p,onOpenChange:g,direction:"bottom",children:[n.jsxs("button",{type:"button",onClick:()=>g(!0),className:z("flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground",v&&"border-2 border-dashed border-warning"),children:[n.jsx(Fe,{url:j,fallback:x?.name??"U",shape:"circle",size:"2xs",className:"shrink-0"}),n.jsx("span",{className:"truncate",children:x?.name??e("common.accountPopover.defaultAccountLabel")})]}),n.jsxs(Et,{className:"h-[80dvh] p-0",children:[n.jsx(Ft,{className:"sr-only",children:e("common.accountPopover.account")}),n.jsx(Nt,{...Re})]})]}):n.jsxs(at,{open:p,onOpenChange:g,children:[n.jsx(Ke,{asChild:!0,children:n.jsxs(ae,{"data-tour":Z.account,tooltip:x?.name??e("common.accountPopover.defaultAccountLabel"),className:z("rounded-md",v&&"border-2 border-dashed border-warning"),children:[n.jsx(gt,{children:n.jsx(Fe,{url:j,fallback:x?.name??"U",shape:"circle",size:"2xs",className:"size-[18px] shrink-0"})}),n.jsx("span",{className:"truncate",children:x?.name??e("common.accountPopover.defaultAccountLabel")})]})}),n.jsx(lt,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[280px] p-0 flex flex-col max-h-[520px]",onCloseAutoFocus:Io,children:n.jsx(Nt,{...Re})})]}),t[94]=v,t[95]=u,t[96]=p,t[97]=Re,t[98]=e,t[99]=x?.name,t[100]=j,t[101]=je):je=t[101];let ve;t[102]!==h?(ve=n.jsx(vn,{open:h,onOpenChange:b}),t[102]=h,t[103]=ve):ve=t[103];let De;return t[104]!==je||t[105]!==ve?(De=n.jsxs(n.Fragment,{children:[je,ve]}),t[104]=je,t[105]=ve,t[106]=De):De=t[106],De}function Io(t){return t.preventDefault()}function Po(){F("signed_out",{source:"account_popover"}),zt(),Y.signOut()}class To extends A.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,s){}render(){return this.state.hasError?null:this.props.children}}function zo(t){return t<=1?"text-destructive":t<=5?"text-warning":"text-foreground/70"}function Ao(){const t=y.c(17),e=$e(),{org:s}=E(),{hasDecoKey:r,balanceDollars:o}=kn();if(!r)return null;let i;t[0]!==o?(i=o!=null?`Credits: $${o.toFixed(2)}`:"Credits",t[0]=o,t[1]=i):i=t[1];let a;t[2]!==o?(a=z(o!=null&&zo(o)),t[2]=o,t[3]=a):a=t[3];let l;t[4]!==e||t[5]!==s.slug?(l=()=>e({to:"/$org/settings/ai-providers",params:{org:s.slug}}),t[4]=e,t[5]=s.slug,t[6]=l):l=t[6];let c;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(rn,{}),t[7]=c):c=t[7];let d;t[8]!==o?(d=o!=null?`$${o.toFixed(2)}`:"Credits",t[8]=o,t[9]=d):d=t[9];let u;t[10]!==d?(u=n.jsx("span",{children:d}),t[10]=d,t[11]=u):u=t[11];let m;return t[12]!==i||t[13]!==a||t[14]!==l||t[15]!==u?(m=n.jsx(L,{children:n.jsx(se,{children:n.jsxs(ae,{tooltip:i,className:a,onClick:l,children:[c,u]})})}),t[12]=i,t[13]=a,t[14]=l,t[15]=u,t[16]=m):m=t[16],m}const Oo={ok:"stroke-brand-purple",warn:"stroke-warning",exhausted:"stroke-destructive"},Ro={ok:"bg-brand-purple",warn:"bg-warning",exhausted:"bg-destructive"};function Do(){const t=y.c(40),e=T(),s=le(),r=$e(),{org:o}=E(),{data:i}=Wt();if(!i?.usage||!i.features.chat)return null;let a,l;if(t[0]!==i.usage.percent?(a=Math.round(i.usage.percent*100),l=Number.isFinite(a),t[0]=i.usage.percent,t[1]=a,t[2]=l):(a=t[1],l=t[2]),!l)return null;const c=Math.min(100,Math.max(0,a)),d=i.plan.name;let u;t[3]!==e?(u=e("settings.planUsage.aiUsage"),t[3]=e,t[4]=u):u=t[4];const m=`${d} · ${u} ${c}%`;let f;t[5]!==r||t[6]!==o.slug?(f=()=>r({to:"/$org/settings/ai-providers",params:{org:o.slug}}),t[5]=r,t[6]=o.slug,t[7]=f):f=t[7];const p=!s&&"-ml-px";let g;t[8]!==p?(g=z(p),t[8]=p,t[9]=g):g=t[9];let h;t[10]!==i.plan.id||t[11]!==i.usage.state||t[12]!==s||t[13]!==c?(h=s?n.jsx(Lo,{percent:c,state:i.usage.state}):n.jsx(Mo,{planId:i.plan.id}),t[10]=i.plan.id,t[11]=i.usage.state,t[12]=s,t[13]=c,t[14]=h):h=t[14];let b;t[15]!==g||t[16]!==h?(b=n.jsx(gt,{className:g,children:h}),t[15]=g,t[16]=h,t[17]=b):b=t[17];let x;t[18]!==i.plan.name?(x=n.jsx("span",{className:"truncate font-medium",children:i.plan.name}),t[18]=i.plan.name,t[19]=x):x=t[19];let j;t[20]!==c?(j=n.jsxs("span",{className:"tabular-nums text-xs text-muted-foreground",children:[c,"%"]}),t[20]=c,t[21]=j):j=t[21];let v;t[22]!==j||t[23]!==x?(v=n.jsxs("span",{className:"flex items-baseline justify-between gap-2",children:[x,j]}),t[22]=j,t[23]=x,t[24]=v):v=t[24];const S=Ro[i.usage.state];let k;t[25]!==S?(k=z("block h-full rounded-full",S),t[25]=S,t[26]=k):k=t[26];const N=`${c}%`;let _;t[27]!==N?(_={width:N},t[27]=N,t[28]=_):_=t[28];let $;t[29]!==k||t[30]!==_?($=n.jsx("span",{className:"block h-1 overflow-hidden rounded-full bg-muted",children:n.jsx("span",{className:k,style:_})}),t[29]=k,t[30]=_,t[31]=$):$=t[31];let w;t[32]!==v||t[33]!==$?(w=n.jsxs("span",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[v,$]}),t[32]=v,t[33]=$,t[34]=w):w=t[34];let C;return t[35]!==w||t[36]!==m||t[37]!==f||t[38]!==b?(C=n.jsx(L,{children:n.jsx(se,{children:n.jsxs(ae,{tooltip:m,className:"h-auto! rounded-lg border border-border bg-card px-2 py-2 [&_svg]:opacity-100!",onClick:f,children:[b,w]})})}),t[35]=w,t[36]=m,t[37]=f,t[38]=b,t[39]=C):C=t[39],C}function Mo(t){const e=y.c(6),{planId:s}=t,{data:r}=_n();let o;e[0]!==s||e[1]!==r?(o=r?.findIndex(l=>l.id===s)??-1,e[0]=s,e[1]=r,e[2]=o):o=e[2];const i=o;if(i<0){let l;return e[3]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(Ut,{className:Be}),e[3]=l):l=e[3],l}let a;return e[4]!==i?(a=n.jsx(wn,{index:i,className:Be}),e[4]=i,e[5]=a):a=e[5],a}function Lo(t){const e=y.c(5),{percent:s,state:r}=t,o=2*Math.PI*8;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=z("-rotate-90",Be),e[0]=i):i=e[0];let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx("circle",{cx:"10",cy:"10",r:8,fill:"none",strokeWidth:"3",className:"stroke-muted"}),e[1]=a):a=e[1];const l=Oo[r],c=`${o*s/100} ${o}`;let d;return e[2]!==l||e[3]!==c?(d=n.jsxs("svg",{viewBox:"0 0 20 20",className:i,"aria-hidden":"true",children:[a,n.jsx("circle",{cx:"10",cy:"10",r:8,fill:"none",strokeWidth:"3",strokeLinecap:"round",className:l,strokeDasharray:c})]}),e[2]=l,e[3]=c,e[4]=d):d=e[4],d}function Eo(){return Nn()?n.jsx(Do,{}):n.jsx(Ao,{})}function _t(){const t=y.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(To,{children:n.jsx(A.Suspense,{fallback:null,children:n.jsx(Eo,{})})}),t[0]=e):e=t[0],e}const Fo=6e4;function qo(t,e){return t.call("NOTIFICATION_LIST",e?{cursor:e}:{})}function Vo(t,e){if(!t)return t;const s=e?new Set(e):null;let r=0;const o=t.pages.map(a=>{const l=a.notifications.filter(c=>s&&!s.has(c.id)?!0:(r++,!1));return{...a,notifications:l}}),i=s?Math.max(0,(t.pages[0]?.unreadCount??0)-r):0;return{...t,pages:o.map(a=>({...a,unreadCount:i}))}}function Bo(t,e){const s=y.c(4),{data:r}=Y.useSession(),o=r?.user?.id;let i;s[0]!==e||s[1]!==t||s[2]!==o?(i=a=>!t||!o?Ko:Pn.subscribe(t,c=>{try{if(JSON.parse(c.data).subject!==o)return}catch{return}e(),a()},e),s[0]=e,s[1]=t,s[2]=o,s[3]=i):i=s[3],A.useSyncExternalStore(i,Ho,Uo)}function Uo(){return 0}function Ho(){return 0}function Ko(){}function Zt(){const t=y.c(37),{locator:e,org:s}=E(),r=At(),o=Ot();let i;t[0]!==e?(i=Ee.notifications(e),t[0]=e,t[1]=i):i=t[1];const a=i;let l;t[2]!==r?(l=$=>{const{pageParam:w}=$;return qo(r,w)},t[2]=r,t[3]=l):l=t[3];let c;t[4]!==a||t[5]!==l?(c={queryKey:a,queryFn:l,initialPageParam:void 0,getNextPageParam:Qo,refetchInterval:Fo},t[4]=a,t[5]=l,t[6]=c):c=t[6];const d=In(c);let u;t[7]!==o||t[8]!==a?(u=()=>o.invalidateQueries({queryKey:a,refetchType:"active"}),t[7]=o,t[8]=a,t[9]=u):u=t[9],Bo(s.slug,u);let m;t[10]!==r?(m=$=>r.call("NOTIFICATION_MARK_READ",$?{ids:$}:{}),t[10]=r,t[11]=m):m=t[11];let f,p;t[12]!==o||t[13]!==a?(f=async $=>{await o.cancelQueries({queryKey:a}),o.setQueryData(a,w=>Vo(w,$))},p=()=>o.invalidateQueries({queryKey:a}),t[12]=o,t[13]=a,t[14]=f,t[15]=p):(f=t[14],p=t[15]);let g;t[16]!==m||t[17]!==f||t[18]!==p?(g={mutationFn:m,onMutate:f,onSettled:p},t[16]=m,t[17]=f,t[18]=p,t[19]=g):g=t[19];const h=bs(g);let b;t[20]!==d.data?.pages?(b=d.data?.pages??[],t[20]=d.data?.pages,t[21]=b):b=t[21];const x=b;let j;t[22]!==x?(j=x.flatMap(Wo),t[22]=x,t[23]=j):j=t[23];const v=x[0]?.unreadCount??0;let S;t[24]!==d?(S=()=>{d.hasNextPage&&!d.isFetchingNextPage&&d.fetchNextPage()},t[24]=d,t[25]=S):S=t[25];let k,N;t[26]!==h?(k=()=>h.mutate(null),N=$=>h.mutate([$]),t[26]=h,t[27]=k,t[28]=N):(k=t[27],N=t[28]);let _;return t[29]!==d.hasNextPage||t[30]!==d.isFetchingNextPage||t[31]!==v||t[32]!==S||t[33]!==k||t[34]!==N||t[35]!==j?(_={updates:j,redDotCount:v,hasMore:d.hasNextPage,isFetchingMore:d.isFetchingNextPage,fetchMore:S,markAllRead:k,markRead:N},t[29]=d.hasNextPage,t[30]=d.isFetchingNextPage,t[31]=v,t[32]=S,t[33]=k,t[34]=N,t[35]=j,t[36]=_):_=t[36],_}function Wo(t){return t.notifications.map(Go)}function Go(t){return{id:t.id,taskBoardItemId:t.taskBoardItemId,taskTitle:t.taskTitle,taskKeySeq:t.taskKeySeq,action:t.type,actorName:t.actorName,actorImage:t.actorImage,occurredAt:t.createdAt}}function Qo(t){return t.nextCursor??void 0}function Jo(t){switch(t){case"mentioned":case"review_requested":return"font-medium text-foreground";case"merge_failed":case"review_changes_requested":return"font-medium text-destructive";case"review_approved":return"font-medium text-success";default:return""}}function Xo(t,e){switch(t.action){case"commented":return e("sidebar.inbox.actionCommented");case"mentioned":return e("sidebar.inbox.actionMentioned");case"created":return e("sidebar.inbox.actionCreated");case"status_changed":return e("sidebar.inbox.actionStatusChanged");case"assignee_changed":return e("sidebar.inbox.actionAssigneeChanged");case"review_requested":return e("sidebar.inbox.actionReviewRequested");case"review_approved":return e("sidebar.inbox.actionReviewApproved");case"review_changes_requested":return e("sidebar.inbox.actionReviewChangesRequested");case"merge_failed":return e("sidebar.inbox.actionMergeFailed");default:{const s=t.action;return String(s)}}}function Yo(t){const e=y.c(36),{update:s,orgSlug:r,onSelect:o}=t,i=T();let a;e[0]!==r||e[1]!==s.taskKeySeq?(a=Gt(r,s.taskKeySeq),e[0]=r,e[1]=s.taskKeySeq,e[2]=a):a=e[2];const l=a,c=!s.actorName;let d;e[3]!==c||e[4]!==s.actorImage||e[5]!==s.actorName?(d=n.jsx("span",{className:"mt-0.5 shrink-0",children:c?n.jsx(Tn,{size:24}):n.jsx(Fe,{url:s.actorImage??void 0,fallback:Ln(s.actorName??void 0),shape:"circle",size:"xs"})}),e[3]=c,e[4]=s.actorImage,e[5]=s.actorName,e[6]=d):d=e[6];let u;e[7]!==s.taskTitle?(u=n.jsx("p",{className:"min-w-0 flex-1 truncate text-sm font-medium text-foreground",children:s.taskTitle}),e[7]=s.taskTitle,e[8]=u):u=e[8];let m;e[9]!==s.occurredAt?(m=En(new Date(s.occurredAt)),e[9]=s.occurredAt,e[10]=m):m=e[10];let f;e[11]!==m?(f=n.jsx("span",{className:"shrink-0 text-xs text-muted-foreground/70",children:m}),e[11]=m,e[12]=f):f=e[12];let p;e[13]!==u||e[14]!==f?(p=n.jsxs("div",{className:"flex items-baseline gap-2",children:[u,f]}),e[13]=u,e[14]=f,e[15]=p):p=e[15];let g;e[16]!==l?(g=l&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"font-medium",children:l})," · "]}),e[16]=l,e[17]=g):g=e[17];let h;e[18]!==s.action?(h=z(Jo(s.action)),e[18]=s.action,e[19]=h):h=e[19];let b;e[20]!==i||e[21]!==s?(b=Xo(s,i),e[20]=i,e[21]=s,e[22]=b):b=e[22];let x;e[23]!==h||e[24]!==b?(x=n.jsx("span",{className:h,children:b}),e[23]=h,e[24]=b,e[25]=x):x=e[25];let j;e[26]!==x||e[27]!==g?(j=n.jsxs("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:[g,x]}),e[26]=x,e[27]=g,e[28]=j):j=e[28];let v;e[29]!==j||e[30]!==p?(v=n.jsxs("div",{className:"min-w-0 flex-1",children:[p,j]}),e[29]=j,e[30]=p,e[31]=v):v=e[31];let S;return e[32]!==o||e[33]!==v||e[34]!==d?(S=n.jsxs("button",{type:"button",onClick:o,className:"flex w-full items-start gap-3 border-b border-border px-4 py-3 text-left transition-colors last:border-0 hover:bg-muted/25",children:[d,v]}),e[32]=o,e[33]=v,e[34]=d,e[35]=S):S=e[35],S}function Zo(t){const e=y.c(2),{onReach:s}=t;let r;return e[0]!==s?(r=n.jsx("div",{className:"h-8 shrink-0",ref:o=>{if(!o)return;const i=new IntersectionObserver(a=>{a.some(ei)&&s()});return i.observe(o),()=>i.disconnect()}}),e[0]=s,e[1]=r):r=e[1],r}function ei(t){return t.isIntersecting}function ti(t){const e=y.c(23),{onClose:s}=t,r=T(),o=$e(),{org:i}=E(),{updates:a,markAllRead:l,markRead:c,hasMore:d,fetchMore:u}=Zt();let m;e[0]!==r?(m=r("sidebar.inbox.title"),e[0]=r,e[1]=m):m=e[1];let f;e[2]!==m?(f=n.jsx("h3",{className:"text-sm font-medium",children:m}),e[2]=m,e[3]=f):f=e[3];let p;e[4]!==l||e[5]!==r||e[6]!==a.length?(p=a.length>0&&n.jsx(Le,{size:"sm",variant:"ghost",className:"h-7 px-2 text-xs text-muted-foreground",onClick:l,children:r("sidebar.inbox.markAllRead")}),e[4]=l,e[5]=r,e[6]=a.length,e[7]=p):p=e[7];let g;e[8]!==f||e[9]!==p?(g=n.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-4 py-3",children:[f,p]}),e[8]=f,e[9]=p,e[10]=g):g=e[10];let h;e[11]!==u||e[12]!==d||e[13]!==c||e[14]!==o||e[15]!==s||e[16]!==i||e[17]!==r||e[18]!==a?(h=a.length===0?n.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 py-10 text-center",children:[n.jsx(mt,{size:24,className:"text-muted-foreground/50"}),n.jsx("p",{className:"text-sm font-medium text-foreground",children:r("sidebar.inbox.emptyTitle")}),n.jsx("p",{className:"text-xs text-muted-foreground",children:r("sidebar.inbox.emptyBody")})]}):n.jsxs(Cn,{className:"min-h-0 flex-1",children:[a.map(x=>{const j=Gt(i.slug,x.taskKeySeq);return n.jsx(Yo,{update:x,orgSlug:i.slug,onSelect:()=>{c(x.id),s(),j&&o({to:"/$org/tasks/{-$taskKey}",params:{org:i.slug,taskKey:j}})}},x.id)}),d&&n.jsx(Zo,{onReach:u})]}),e[11]=u,e[12]=d,e[13]=c,e[14]=o,e[15]=s,e[16]=i,e[17]=r,e[18]=a,e[19]=h):h=e[19];let b;return e[20]!==g||e[21]!==h?(b=n.jsxs(n.Fragment,{children:[g,h]}),e[20]=g,e[21]=h,e[22]=b):b=e[22],b}function es(){const t=y.c(1),{redDotCount:e}=Zt();if(e===0)return null;let s;return t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx("span",{className:"pointer-events-none absolute top-1 right-1 size-2 rounded-full bg-destructive"}),t[0]=s):s=t[0],s}function ts(t){const e=y.c(10),{open:s,onOpenChange:r,children:o}=t;let i;e[0]!==r||e[1]!==s?(i=s&&n.jsx(ti,{onClose:()=>r(!1)}),e[0]=r,e[1]=s,e[2]=i):i=e[2];let a;e[3]!==i?(a=n.jsx(lt,{side:"right",align:"end",sideOffset:12,collisionPadding:16,className:"flex max-h-[min(650px,calc(100dvh-4rem))] w-[min(400px,calc(100vw-2rem))] flex-col p-0",children:i}),e[3]=i,e[4]=a):a=e[4];let l;return e[5]!==o||e[6]!==r||e[7]!==s||e[8]!==a?(l=n.jsxs(at,{open:s,onOpenChange:r,children:[o,a]}),e[5]=o,e[6]=r,e[7]=s,e[8]=a,e[9]=l):l=e[9],l}function ss(){const t=y.c(9),e=T(),[s,r]=A.useState(!1);let o;t[0]!==e?(o=e("sidebar.inbox.title"),t[0]=e,t[1]=o):o=t[1];let i,a;t[2]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(mt,{size:15}),a=n.jsx(es,{}),t[2]=i,t[3]=a):(i=t[2],a=t[3]);let l;t[4]!==o?(l=n.jsx(Ke,{asChild:!0,children:n.jsxs("button",{type:"button","aria-label":o,className:"relative flex size-7 shrink-0 items-center justify-center rounded-md text-sidebar-foreground/60 transition-colors hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[i,a]})}),t[4]=o,t[5]=l):l=t[5];let c;return t[6]!==s||t[7]!==l?(c=n.jsx(ts,{open:s,onOpenChange:r,children:l}),t[6]=s,t[7]=l,t[8]=c):c=t[8],c}function si(){const t=y.c(15),e=T(),[s,r]=A.useState(!1),o=le();let i;t[0]!==o||t[1]!==e?(i=o?e("sidebar.inbox.title"):void 0,t[0]=o,t[1]=e,t[2]=i):i=t[2];let a,l;t[3]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(mt,{}),l=n.jsx(es,{}),t[3]=a,t[4]=l):(a=t[3],l=t[4]);let c;t[5]!==e?(c=e("sidebar.inbox.title"),t[5]=e,t[6]=c):c=t[6];let d;t[7]!==c?(d=n.jsx("span",{className:"truncate",children:c}),t[7]=c,t[8]=d):d=t[8];let u;t[9]!==i||t[10]!==d?(u=n.jsx(Ke,{asChild:!0,children:n.jsxs(ae,{tooltip:i,className:"relative",children:[a,l,d]})}),t[9]=i,t[10]=d,t[11]=u):u=t[11];let m;return t[12]!==s||t[13]!==u?(m=n.jsx(ts,{open:s,onOpenChange:r,children:u}),t[12]=s,t[13]=u,t[14]=m):m=t[14],m}function wt(){const t=y.c(10),e=T();let s;t[0]!==e?(s=e("sidebar.sidebarFooter.inviteMembers"),t[0]=e,t[1]=s):s=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(gt,{children:n.jsx(an,{className:Be})}),t[2]=r):r=t[2];let o;t[3]!==e?(o=e("sidebar.sidebarFooter.inviteMembers"),t[3]=e,t[4]=o):o=t[4];let i;t[5]!==o?(i=n.jsx("span",{children:o}),t[5]=o,t[6]=i):i=t[6];let a;return t[7]!==s||t[8]!==i?(a=n.jsx(L,{className:"gap-0.5",children:n.jsx(se,{children:n.jsx(yn,{trigger:n.jsxs(ae,{tooltip:s,children:[r,i]})})})}),t[7]=s,t[8]=i,t[9]=a):a=t[9],a}function ni(){const t=y.c(13),e=le(),r=!$n();if(e){let c;t[0]!==r?(c=r&&n.jsx(_t,{}),t[0]=r,t[1]=c):c=t[1];let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(wt,{}),t[2]=d):d=t[2];let u;t[3]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(se,{children:n.jsx(si,{})}),t[3]=u):u=t[3];let m;t[4]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsxs(L,{children:[u,n.jsx(se,{children:n.jsx(tt,{})})]}),t[4]=m):m=t[4];let f;return t[5]!==c?(f=n.jsxs(Ye,{className:"px-2 pb-3 gap-1",children:[c,d,m]}),t[5]=c,t[6]=f):f=t[6],f}let o;t[7]!==r?(o=r&&n.jsx(_t,{}),t[7]=r,t[8]=o):o=t[8];let i;t[9]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(wt,{}),t[9]=i):i=t[9];let a;t[10]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(L,{className:"gap-0.5",children:n.jsx(se,{children:n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(tt,{})}),n.jsx(ss,{})]})})}),t[10]=a):a=t[10];let l;return t[11]!==o?(l=n.jsxs(Ye,{className:"px-2 pb-3 gap-0.5",children:[o,i,a]}),t[11]=o,t[12]=l):l=t[12],l}function oi(){const t=y.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(Ye,{className:"px-2 pb-3",children:n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(L,{children:n.jsx(se,{children:n.jsx(tt,{})})})}),n.jsx(ss,{})]})}),t[0]=e):e=t[0],e}function ii(t){let e=0;for(let r=0;r<t.length;r++)e=t.charCodeAt(r)+((e<<5)-e);const s=Math.abs(e)%360;return{backgroundColor:`hsl(${s} 55% 70%)`,color:`hsl(${s} 55% 20%)`}}function ht(t){const e=y.c(13),{org:s,size:r}=t,o=r===void 0?"sm":r,i=o==="xs"?"size-5":"size-6",a=o==="xs"?"text-[9px]":"text-xs";let l;e[0]!==i?(l=z(i,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=i,e[1]=l):l=e[1];let c;e[2]!==s.logo||e[3]!==s.name?(c=s.logo?void 0:ii(s.name),e[2]=s.logo,e[3]=s.name,e[4]=c):c=e[4];let d;e[5]!==s.logo||e[6]!==s.name||e[7]!==a?(d=s.logo?n.jsx("img",{src:s.logo,alt:"",className:"size-full object-cover"}):n.jsx("span",{className:z("font-semibold leading-none",a),children:s.name.slice(0,2).toUpperCase()}),e[5]=s.logo,e[6]=s.name,e[7]=a,e[8]=d):d=e[8];let u;return e[9]!==l||e[10]!==c||e[11]!==d?(u=n.jsx("div",{className:l,style:c,children:d}),e[9]=l,e[10]=c,e[11]=d,e[12]=u):u=e[12],u}function ri({invitation:t,onChanged:e}){const s=T(),[r,o]=A.useState(!1),i=t.organizationName??s("header.orgSwitcher.unknownOrganization"),a=async()=>{o(!0);try{const d=await Y.organization.acceptInvitation({invitationId:t.id});if(d.error){re.error(d.error.message),o(!1);return}}catch{re.error(s("header.orgSwitcher.failedToAcceptInvitation")),o(!1);return}re.success(s("header.orgSwitcher.joined",{name:i})),js();let c;try{c=(await Y.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=c?`/${c}`:"/"},l=async()=>{o(!0);try{const c=await Y.organization.rejectInvitation({invitationId:t.id});if(c.error){re.error(c.error.message),o(!1);return}re.success(s("header.orgSwitcher.invitationDeclined")),o(!1),e()}catch{re.error(s("header.orgSwitcher.failedToDeclineInvitation")),o(!1)}};return n.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-dashed border-border px-3 py-2.5",children:[n.jsx(ht,{org:{name:i},size:"sm"}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("p",{className:"truncate text-sm font-medium",children:i}),n.jsx("p",{className:"truncate text-xs text-muted-foreground",children:s("header.orgSwitcher.invitedToJoin")})]}),n.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[n.jsx(Le,{size:"sm",variant:"default",className:"h-7 text-xs",onClick:a,disabled:r,children:s("header.orgSwitcher.accept")}),n.jsx(Le,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground",onClick:l,disabled:r,"aria-label":s("header.orgSwitcher.declineInvitationTo",{name:i}),children:n.jsx(Kn,{size:14})})]})]})}function ns(){const t=A.useContext(vs),{data:e,refetch:s}=t.hooks.useListUserInvitations();return{invitations:(e??[]).filter(o=>o.status==="pending"&&new Date(o.expiresAt)>new Date),refetch:()=>s?.()}}function ai(t){const e=y.c(13),s=t.trim(),{data:r}=Y.useSession(),o=r?.user?.id??"",i=s.length>0&&!!o,a=Ee.projectSearch(o,s);let l;e[0]!==s?(l=async x=>{const{signal:j}=x,v=await fetch(`/api/_me/projects/search?q=${encodeURIComponent(s)}`,{signal:j});if(!v.ok)throw new Error(`Project search failed: ${v.status}`);return await v.json()},e[0]=s,e[1]=l):l=e[1];let c;e[2]!==i||e[3]!==a||e[4]!==l?(c={queryKey:a,queryFn:l,enabled:i,placeholderData:ys,staleTime:3e4,retry:!1},e[2]=i,e[3]=a,e[4]=l,e[5]=c):c=e[5];const{data:d,isFetching:u,isPlaceholderData:m,isError:f}=st(c);let p;e[6]!==d?.items?(p=d?.items??[],e[6]=d?.items,e[7]=p):p=e[7];const g=i&&u,h=i&&m;let b;return e[8]!==f||e[9]!==p||e[10]!==g||e[11]!==h?(b={hits:p,isSearching:g,isStale:h,isError:f},e[8]=f,e[9]=p,e[10]=g,e[11]=h,e[12]=b):b=e[12],b}function $t(t){const e=y.c(15),{id:s,label:r,createLabel:o,onCreate:i}=t;let a;e[0]!==s||e[1]!==r?(a=n.jsx("span",{id:s,className:"truncate",children:r}),e[0]=s,e[1]=r,e[2]=a):a=e[2];let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(qn,{size:14}),e[3]=l):l=e[3];let c;e[4]!==o||e[5]!==i?(c=n.jsx(ct,{asChild:!0,children:n.jsx("button",{type:"button","aria-label":o,className:"-my-1 shrink-0 cursor-pointer rounded-md p-1 text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",onClick:i,children:l})}),e[4]=o,e[5]=i,e[6]=c):c=e[6];let d;e[7]!==o?(d=n.jsx(dt,{side:"right",children:o}),e[7]=o,e[8]=d):d=e[8];let u;e[9]!==c||e[10]!==d?(u=n.jsxs(ut,{children:[c,d]}),e[9]=c,e[10]=d,e[11]=u):u=e[11];let m;return e[12]!==a||e[13]!==u?(m=n.jsxs("div",{className:"flex w-full items-center justify-between gap-2 px-2 py-1.5 text-xs font-medium text-muted-foreground",children:[a,u]}),e[12]=a,e[13]=u,e[14]=m):m=e[14],m}const Ue="min-h-9 items-center",de={allProjects:"scope:__all__",project:t=>`scope:${t}`,org:t=>`org:${t}`,foreignProject:(t,e)=>`travel:${t}:${e}`};function li(t){const e=y.c(9),{active:s,rows:r}=t,o=T();let i,a,l;if(e[0]!==s||e[1]!==r||e[2]!==o){l=Symbol.for("react.early_return_sentinel");e:{const d=r.get(s);if(d?.kind!=="travel"){l=null;break e}i="border-t border-border px-3 py-2 text-xs text-warning",a=o("sidebar.picker.verbTravel",{name:d.label})}e[0]=s,e[1]=r,e[2]=o,e[3]=i,e[4]=a,e[5]=l}else i=e[3],a=e[4],l=e[5];if(l!==Symbol.for("react.early_return_sentinel"))return l;let c;return e[6]!==i||e[7]!==a?(c=n.jsx("div",{className:i,children:a}),e[6]=i,e[7]=a,e[8]=c):c=e[8],c}function ci(t){const e=y.c(25),{onClose:s,onCreateOrg:r,className:o}=t,i=T(),a=A.useId(),l=A.useId(),c=$e(),{org:d}=E(),{scopeId:u,projects:m,setScope:f}=Se(),{hasMore:p}=Wn(),[g,h]=A.useState(""),[b,x]=A.useState(de.allProjects),j=A.useDeferredValue(g);let v;e[0]!==j?(v=j.trim(),e[0]=j,e[1]=v):v=e[1];const S=v,k=S.length>0,{data:N}=Ss(),{invitations:_,refetch:$}=ns();let w;e[2]!==d.slug?(w=(I,R)=>I.slug===d.slug?-1:R.slug===d.slug?1:0,e[2]=d.slug,e[3]=w):w=e[3];const C=(N??[]).slice().sort(w),{hits:P,isSearching:O,isStale:ne,isError:K}=ai(k?S:""),W=k?C.filter(I=>{const R=S.toLowerCase();return I.name.toLowerCase().includes(R)||I.slug.toLowerCase().includes(R)}):[],oe=we();let q;e[4]!==oe?(q=oe.startsWith("/$org/settings"),e[4]=oe,e[5]=q):q=e[5];const G=q,V=new Map;let B;e[6]!==G||e[7]!==s||e[8]!==f?(B=I=>{F("scope_set",{scoped:I!==null,fromSettings:G}),f(I),s()},e[6]=G,e[7]=s,e[8]=f,e[9]=B):B=e[9];const Q=B;let ee;e[10]!==c||e[11]!==s?(ee=(I,R)=>{F("org_project_travel",{scoped:!!R}),c(R?{to:"/$org/projects/$agentId",params:{org:I,agentId:R}}:{to:"/$org/home",params:{org:I}}),s()},e[10]=c,e[11]=s,e[12]=ee):ee=e[12];const J=ee;let U;e[13]!==c||e[14]!==s||e[15]!==d.slug?(U=()=>{F("picker_new_project"),c({to:"/$org/home",params:{org:d.slug}}),s()},e[13]=c,e[14]=s,e[15]=d.slug,e[16]=U):U=e[16];const me=U;V.set(de.allProjects,{kind:"scope",label:i("sidebar.scope.allProjects")});let D;e[17]!==i?(D=i("sidebar.picker.searchPlaceholder"),e[17]=i,e[18]=D):D=e[18];let H;e[19]!==g||e[20]!==D?(H=n.jsx(Un,{value:g,onValueChange:h,placeholder:D}),e[19]=g,e[20]=D,e[21]=H):H=e[21];const ie=Vn,ke="max-h-none min-h-0 flex-1",X=k?n.jsxs(n.Fragment,{children:[K&&n.jsx(yt,{children:i("sidebar.picker.searchFailed")}),!K&&!O&&P.length===0&&W.length===0&&n.jsx(yt,{children:i("sidebar.picker.noMatches",{query:S})}),!K&&P.length>0&&n.jsx(Me,{heading:i("sidebar.picker.projectsHeading"),className:z(ne&&"opacity-50"),children:P.map(I=>n.jsx(di,{hit:I,currentOrgSlug:d.slug,scopeId:u,rows:V,onScope:Q,onTravel:J},`${I.orgSlug}:${I.id}`))}),W.length>0&&n.jsx(Me,{heading:i("sidebar.picker.orgsHeading"),children:W.map(I=>n.jsx(Ct,{candidate:I,currentOrgSlug:d.slug,rows:V,onTravel:J,onClose:s},I.id))})]}):n.jsxs(n.Fragment,{children:[n.jsx($t,{id:a,label:i("sidebar.picker.projectsHeading"),createLabel:i("sidebar.picker.newProject"),onCreate:me}),n.jsxs(Me,{"aria-labelledby":a,children:[n.jsxs(Ve,{value:de.allProjects,className:Ue,onSelect:()=>Q(null),children:[n.jsx("span",{className:"min-w-0 flex-1 truncate",children:i("sidebar.scope.allProjects")}),u===null&&n.jsx(qe,{size:14})]}),m.map(I=>{const R=de.project(I.id);return V.set(R,{kind:"scope",label:I.title}),n.jsxs(Ve,{value:R,className:Ue,onSelect:()=>Q(I.id),children:[n.jsx(ft,{icon:I.icon,name:I.title}),n.jsx("span",{className:"min-w-0 flex-1 truncate",children:I.title}),u===I.id&&n.jsx(qe,{size:14})]},I.id)}),p&&n.jsx("p",{className:"px-3 py-1.5 text-xs text-muted-foreground",children:i("sidebar.picker.moreExist")})]}),n.jsx($t,{id:l,label:i("sidebar.picker.orgsHeading"),createLabel:i("sidebar.picker.newOrganization"),onCreate:r}),n.jsxs(Me,{"aria-labelledby":l,children:[_.map(I=>n.jsx(ri,{invitation:I,onChanged:$},I.id)),C.map(I=>n.jsx(Ct,{candidate:I,currentOrgSlug:d.slug,rows:V,onTravel:J,onClose:s},I.id))]})]});let te;return e[22]!==ie||e[23]!==X?(te=n.jsx(ie,{className:ke,children:X}),e[22]=ie,e[23]=X,e[24]=te):te=e[24],n.jsxs(Bn,{shouldFilter:!1,value:b,onValueChange:x,className:o,children:[H,te,n.jsx(li,{active:b,rows:V})]})}function Ct(t){const e=y.c(22),{candidate:s,currentOrgSlug:r,rows:o,onTravel:i,onClose:a}=t,l=s.slug===r;let c;e[0]!==s.name||e[1]!==s.slug||e[2]!==l||e[3]!==o?(c=de.org(s.slug),o.set(c,{kind:l?"scope":"travel",label:s.name}),e[0]=s.name,e[1]=s.slug,e[2]=l,e[3]=o,e[4]=c):c=e[4];let d;e[5]!==s.slug||e[6]!==l||e[7]!==a||e[8]!==i?(d=()=>l?a():i(s.slug),e[5]=s.slug,e[6]=l,e[7]=a,e[8]=i,e[9]=d):d=e[9];let u;e[10]!==s?(u=n.jsx(ht,{org:s,size:"xs"}),e[10]=s,e[11]=u):u=e[11];let m;e[12]!==s.name?(m=n.jsx("span",{className:"min-w-0 flex-1 truncate",children:s.name}),e[12]=s.name,e[13]=m):m=e[13];let f;e[14]!==l?(f=l&&n.jsx(qe,{size:14}),e[14]=l,e[15]=f):f=e[15];let p;return e[16]!==d||e[17]!==u||e[18]!==m||e[19]!==f||e[20]!==c?(p=n.jsxs(Ve,{value:c,className:Ue,onSelect:d,children:[u,m,f]}),e[16]=d,e[17]=u,e[18]=m,e[19]=f,e[20]=c,e[21]=p):p=e[21],p}function di(t){const e=y.c(30),{hit:s,currentOrgSlug:r,scopeId:o,rows:i,onScope:a,onTravel:l}=t,c=s.orgSlug===r;let d;e[0]!==s.id||e[1]!==s.orgSlug||e[2]!==s.title||e[3]!==c||e[4]!==i?(d=c?de.project(s.id):de.foreignProject(s.orgSlug,s.id),i.set(d,{kind:c?"scope":"travel",label:s.title}),e[0]=s.id,e[1]=s.orgSlug,e[2]=s.title,e[3]=c,e[4]=i,e[5]=d):d=e[5];let u;e[6]!==s.id||e[7]!==s.orgSlug||e[8]!==c||e[9]!==a||e[10]!==l?(u=()=>c?a(s.id):l(s.orgSlug,s.id),e[6]=s.id,e[7]=s.orgSlug,e[8]=c,e[9]=a,e[10]=l,e[11]=u):u=e[11];let m;e[12]!==s.icon||e[13]!==s.title?(m=n.jsx(ft,{icon:s.icon,name:s.title}),e[12]=s.icon,e[13]=s.title,e[14]=m):m=e[14];let f;e[15]!==s.title?(f=n.jsx("span",{className:"min-w-0 flex-1 truncate",children:s.title}),e[15]=s.title,e[16]=f):f=e[16];let p;e[17]!==s.orgName?(p=n.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:s.orgName}),e[17]=s.orgName,e[18]=p):p=e[18];let g;e[19]!==s.id||e[20]!==c||e[21]!==o?(g=c&&o===s.id&&n.jsx(qe,{size:14}),e[19]=s.id,e[20]=c,e[21]=o,e[22]=g):g=e[22];let h;return e[23]!==u||e[24]!==m||e[25]!==f||e[26]!==p||e[27]!==g||e[28]!==d?(h=n.jsxs(Ve,{value:d,className:Ue,onSelect:u,children:[m,f,p,g]}),e[23]=u,e[24]=m,e[25]=f,e[26]=p,e[27]=g,e[28]=d,e[29]=h):h=e[29],h}function os(t){const e=y.c(32),{collapsed:s,onNavigate:r}=t,o=s===void 0?!1:s,i=T(),{org:a}=E(),{project:l}=Se(),{invitations:c}=ns(),[d,u]=A.useState(!1),[m,f]=A.useState(!1),p=ot();let g;if(e[0]!==o||e[1]!==c.length||e[2]!==a||e[3]!==l||e[4]!==i){const $=l?i("sidebar.picker.projectInOrg",{project:l.title,org:a.name}):a.name;let w;e[6]!==a||e[7]!==l?(w=l?n.jsx(ln,{icon:l.icon,name:l.title,size:"xs",className:"shrink-0"}):n.jsx(ht,{org:a,size:"sm"}),e[6]=a,e[7]=l,e[8]=w):w=e[8];let C;e[9]!==c.length?(C=c.length>0&&n.jsx("span",{className:"absolute -right-1 -top-1 size-2.5 rounded-full bg-destructive ring-2 ring-background"}),e[9]=c.length,e[10]=C):C=e[10];let P;e[11]!==w||e[12]!==C?(P=n.jsxs("div",{className:"relative inline-flex shrink-0",children:[w,C]}),e[11]=w,e[12]=C,e[13]=P):P=e[13];const O=P;g=o?n.jsx(ae,{tooltip:$,"data-tour":Z.switcher,children:O}):n.jsxs("button",{type:"button","data-tour":Z.switcher,"aria-label":i("sidebar.picker.ariaLabel",{name:$}),className:z("flex min-w-0 flex-1 items-center gap-2 rounded-lg py-1.5 pl-1 pr-1.5 text-left md:h-[34px] md:py-0","[transition:background-color_180ms_ease] hover:bg-sidebar-accent",Us),children:[O,n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-foreground",children:l?l.title:a.name}),n.jsx(Fn,{size:14,className:"shrink-0 text-muted-foreground"})]}),e[0]=o,e[1]=c.length,e[2]=a,e[3]=l,e[4]=i,e[5]=g}else g=e[5];const h=g,b=p?"min-h-0 flex-1":"max-h-[min(560px,70dvh,var(--radix-popover-content-available-height,70dvh))]";let x;e[14]!==r?(x=()=>{u(!1),r?.()},e[14]=r,e[15]=x):x=e[15];let j;e[16]===Symbol.for("react.memo_cache_sentinel")?(j=()=>{u(!1),f(!0)},e[16]=j):j=e[16];let v;e[17]!==b||e[18]!==x?(v=n.jsx(ci,{onClose:x,onCreateOrg:j,className:b}),e[17]=b,e[18]=x,e[19]=v):v=e[19];const S=v;let k;e[20]!==o||e[21]!==S||e[22]!==p||e[23]!==d||e[24]!==i||e[25]!==h?(k=p?n.jsxs(Lt,{open:d,onOpenChange:u,direction:"bottom",children:[n.jsx(Ws,{asChild:!0,children:h}),n.jsxs(Et,{className:"flex max-h-[85dvh] flex-col p-0",children:[n.jsx(Ft,{className:"sr-only",children:i("sidebar.picker.title")}),S]})]}):n.jsxs(at,{open:d,onOpenChange:u,children:[n.jsx(Ke,{asChild:!0,children:h}),n.jsx(lt,{side:o?"right":"bottom",align:"start",className:"w-[min(340px,calc(100vw-2rem))] p-0",children:S})]}),e[20]=o,e[21]=S,e[22]=p,e[23]=d,e[24]=i,e[25]=h,e[26]=k):k=e[26];let N;e[27]!==m?(N=n.jsx(Hn,{open:m,onOpenChange:f}),e[27]=m,e[28]=N):N=e[28];let _;return e[29]!==k||e[30]!==N?(_=n.jsxs(n.Fragment,{children:[k,N]}),e[29]=k,e[30]=N,e[31]=_):_=e[31],_}const is=16;function ui(){const t=y.c(7),e=le(),s=We();let r;t[0]!==e?(r=n.jsx(os,{collapsed:e}),t[0]=e,t[1]=r):r=t[1];let o;t[2]!==s?(o=!s&&n.jsx(fi,{}),t[2]=s,t[3]=o):o=t[3];let i;return t[4]!==r||t[5]!==o?(i=n.jsxs(n.Fragment,{children:[r,o]}),t[4]=r,t[5]=o,t[6]=i):i=t[6],i}function mi(t){const e=y.c(12),{onClose:s}=t,r=T();let o;e[0]!==s?(o=n.jsx(os,{onNavigate:s}),e[0]=s,e[1]=o):o=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx("div",{className:"flex-1"}),e[2]=i):i=e[2];let a;e[3]!==r?(a=r("sidebar.header.closeSidebar"),e[3]=r,e[4]=a):a=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(it,{size:is}),e[5]=l):l=e[5];let c;e[6]!==s||e[7]!==a?(c=n.jsx(rt,{onClick:s,"aria-label":a,children:l}),e[6]=s,e[7]=a,e[8]=c):c=e[8];let d;return e[9]!==o||e[10]!==c?(d=n.jsxs(n.Fragment,{children:[o,i,c]}),e[9]=o,e[10]=c,e[11]=d):d=e[11],d}function fi(){const t=y.c(12),e=T(),s=le(),{toggleSidebar:r}=Ce();let o;t[0]!==e?(o=e("sidebar.header.toggleSidebar"),t[0]=e,t[1]=o):o=t[1];const i=o;let a;t[2]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(it,{size:is}),t[2]=a):a=t[2];let l;t[3]!==i||t[4]!==r?(l=n.jsx(ct,{asChild:!0,children:n.jsx(rt,{"aria-label":i,onClick:r,className:"shrink-0 rounded-lg md:size-[34px] group-data-[state=collapsed]/sidebar:mx-auto",children:a})}),t[3]=i,t[4]=r,t[5]=l):l=t[5];const c=!s;let d;t[6]!==i||t[7]!==c?(d=n.jsx(dt,{side:"right",hidden:c,children:i}),t[6]=i,t[7]=c,t[8]=d):d=t[8];let u;return t[9]!==l||t[10]!==d?(u=n.jsxs(ut,{children:[l,d]}),t[9]=l,t[10]=d,t[11]=u):u=t[11],u}function ue(t){const e=y.c(33),{icon:s,label:r,isActive:o,link:i,onSelect:a,ariaLabel:l,className:c,dataTour:d,children:u,trailing:m}=t,f=o===void 0?!1:o,p=le(),g=l??r,h=p?g:void 0;let b;e[0]!==c||e[1]!==d||e[2]!==f||e[3]!==h?(b={isActive:f,tooltip:h,className:c,"data-tour":d},e[0]=c,e[1]=d,e[2]=f,e[3]=h,e[4]=b):b=e[4];const x=b;let j;e[5]!==m?(j=m&&n.jsx("span",{className:"order-last ml-auto flex shrink-0 items-center group-data-[state=collapsed]/sidebar:hidden",children:m}),e[5]=m,e[6]=j):j=e[6];let v;e[7]!==r?(v=n.jsx("span",{className:"truncate",children:r}),e[7]=r,e[8]=v):v=e[8];let S;e[9]!==s||e[10]!==j||e[11]!==v?(S=n.jsxs(n.Fragment,{children:[s,j,v]}),e[9]=s,e[10]=j,e[11]=v,e[12]=S):S=e[12];const k=S;if(i){const $=f?"page":void 0;let w;e[13]!==k||e[14]!==i||e[15]!==g||e[16]!==a||e[17]!==$?(w=n.jsx(Rt,{...i,"aria-label":g,"aria-current":$,onClick:a,children:k}),e[13]=k,e[14]=i,e[15]=g,e[16]=a,e[17]=$,e[18]=w):w=e[18];let C;e[19]!==x||e[20]!==w?(C=n.jsx(ae,{asChild:!0,...x,children:w}),e[19]=x,e[20]=w,e[21]=C):C=e[21];let P;return e[22]!==u||e[23]!==C?(P=n.jsxs(se,{children:[C,u]}),e[22]=u,e[23]=C,e[24]=P):P=e[24],P}let N;e[25]!==k||e[26]!==g||e[27]!==a||e[28]!==x?(N=n.jsx(ae,{...x,"aria-label":g,onClick:a,children:k}),e[25]=k,e[26]=g,e[27]=a,e[28]=x,e[29]=N):N=e[29];let _;return e[30]!==u||e[31]!==N?(_=n.jsxs(se,{children:[N,u]}),e[30]=u,e[31]=N,e[32]=_):_=e[32],_}function rs(t){const e=y.c(5),{label:s,link:r,onSelect:o}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(Qn,{size:16}),e[0]=i):i=e[0];let a;return e[1]!==s||e[2]!==r||e[3]!==o?(a=n.jsx("div",{className:"-mx-2 border-b border-sidebar-border px-2 py-2",children:n.jsx(L,{className:"shrink-0",children:n.jsx(ue,{icon:i,label:s,className:"text-sidebar-foreground/70",link:r,onSelect:o})})}),e[1]=s,e[2]=r,e[3]=o,e[4]=a):a=e[4],a}function pi(t){return t==="board"?"kanban":t==="cdn"?"monitoring":Dt(t)?"cms":null}function as(){const t=y.c(2),{data:e}=Wt();let s;return t[0]!==e?(s=r=>{const o=pi(r);return!o||!e?!1:e.features[o]!==!0},t[0]=e,t[1]=s):s=t[1],s}const xi="settings",gi=["overview","reports","board","files"];function hi(t,e){return!t||!e?!1:!Mt(e.metadata)}function bi(t,e,s,r){if(!t||!e)return!0;const o=r!==void 0;return Jn(o?r:Qt(e.metadata),o?1:e.metadata?.sidebarViewsVersion).includes(s)}function ji(){const t=y.c(16),e=T(),{org:s}=E(),r=we(),o=He(),{project:i,repo:a}=Se(),l=Jt(i?.id);let c;t[0]!==i||t[1]!==o?(c=hi(o,i),t[0]=i,t[1]=o,t[2]=c):c=t[2];const d=c;let u;t[3]!==l||t[4]!==i||t[5]!==o?(u=p=>bi(o,i,p,l),t[3]=l,t[4]=i,t[5]=o,t[6]=u):u=t[6];const m=u;let f;if(t[7]!==m||t[8]!==d||t[9]!==r||t[10]!==s||t[11]!==i?.id||t[12]!==a||t[13]!==o||t[14]!==e){const p={overview:d||!m("overview")?null:{key:"overview",label:e("sidebar.navDestinations.home"),icon:n.jsx(cn,{size:16}),isActive:r===M.home||r===M.orgIndex||r===ce.root||r===`${ce.root}/`,trackAs:"overview",link:o?{to:ce.root,params:{org:s.slug,agentId:o}}:{to:M.home,params:{org:s.slug}}},reports:Xe(M.reports,o)&&!d&&m("reports")?{key:"reports",label:e("sidebar.navDestinations.reports"),icon:n.jsx(Kt,{size:16}),isActive:r===M.reports||r===ce.reports,trackAs:"reports",link:o?{to:ce.reports,params:{org:s.slug,agentId:o}}:{to:M.reports,params:{org:s.slug}}}:null,board:d||!m("board")?null:{key:"board",label:e("sidebar.navDestinations.tasks"),icon:n.jsx(Ht,{size:16}),isActive:r===M.tasks||r===ce.tasks,trackAs:"board",dataTour:Z.tasks,link:{to:o?ce.tasks:M.tasks,params:{org:s.slug,agentId:o??void 0,taskKey:void 0},search:g=>{const h=a??i?.id;return h?{...g,repo:h}:g}}},files:Xe(M.library,o)?{key:"files",label:e("sidebar.navDestinations.library"),icon:n.jsx(Gn,{size:16}),isActive:r===M.library,trackAs:"files",link:{to:M.library,params:{org:s.slug}}}:null};f=gi.map(g=>p[g]).filter(vi),t[7]=m,t[8]=d,t[9]=r,t[10]=s,t[11]=i?.id,t[12]=a,t[13]=o,t[14]=e,t[15]=f}else f=t[15];return f}function vi(t){return t!==null}function yi(t){const e=y.c(9),{onNavigate:s}=t,r=ji(),o=as();let i;if(e[0]!==r||e[1]!==o||e[2]!==s){let l;e[4]!==o||e[5]!==s?(l=c=>n.jsx(ue,{icon:c.icon,label:c.label,dataTour:c.dataTour,isActive:c.isActive,link:c.link,trailing:o(c.key)?n.jsx(nt,{size:14,className:"text-muted-foreground"}):void 0,onSelect:()=>{F("nav_destination_clicked",{destination:c.trackAs}),s?.()}},c.key),e[4]=o,e[5]=s,e[6]=l):l=e[6],i=r.map(l),e[0]=r,e[1]=o,e[2]=s,e[3]=i}else i=e[3];let a;return e[7]!==i?(a=n.jsx(L,{className:"gap-1",children:i}),e[7]=i,e[8]=a):a=e[8],a}function Si(t){const e=y.c(18),{onNavigate:s}=t,r=T(),{org:o}=E(),i=He(),a=pt(),l=we(),c=ks();let d;e[0]!==c||e[1]!==l?(d=l.startsWith("/$org/settings")||l.startsWith(M.projects)&&c==="settings",e[0]=c,e[1]=l,e[2]=d):d=e[2];const u=d;let m;e[3]!==r?(m=r("sidebar.navDestinations.settings"),e[3]=r,e[4]=m):m=e[4];const f=m;let p;e[5]!==o||e[6]!==i?(p=i?void 0:{to:"/$org/settings",params:{org:o.slug}},e[5]=o,e[6]=i,e[7]=p):p=e[7];const g=p;let h;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(Bt,{size:16}),e[8]=h):h=e[8];let b;e[9]!==a||e[10]!==s||e[11]!==i?(b=()=>{F("nav_destination_clicked",{destination:xi,target:i?"project":"org"}),i&&a(i,{panel:"settings"}),s?.()},e[9]=a,e[10]=s,e[11]=i,e[12]=b):b=e[12];let x;return e[13]!==u||e[14]!==f||e[15]!==g||e[16]!==b?(x=n.jsx(L,{className:"gap-1",children:n.jsx(ue,{dataTour:Z.settings,icon:h,label:f,isActive:u,link:g,onSelect:b})}),e[13]=u,e[14]=f,e[15]=g,e[16]=b,e[17]=x):x=e[17],x}function ki(t,e){const s=new Set(e);return s.size===0?t:t.filter(r=>s.has(r.connectionId))}function Ni(t){const e=t.metadata?.ui;return Array.isArray(e?.pinnedViews)?e.pinnedViews.filter(s=>!!s&&typeof s=="object"&&typeof s.connectionId=="string"&&typeof s.toolName=="string"):[]}function _i(t){const e=y.c(13),{onNavigate:s}=t,r=T(),{project:o}=Se(),i=pt(),a=we(),l=no(),c=Xn(o),d=as(),u=Jt(o?.id);if(!o)return null;let m;if(e[0]!==c.presence||e[1]!==u||e[2]!==o.metadata){const g=Mt(o.metadata),h=u??Qt(o.metadata);m=new Set(Yn(h,Zn(g,c.presence),u!==void 0?1:o.metadata.sidebarViewsVersion)),e[0]=c.presence,e[1]=u,e[2]=o.metadata,e[3]=m}else m=e[3];const f=m;let p;if(e[4]!==l||e[5]!==d||e[6]!==a||e[7]!==i||e[8]!==s||e[9]!==o||e[10]!==f||e[11]!==r){const g=[];f.has("site-editor")&&g.push({key:"site-editor",label:r("sidebar.projectNav.siteEditor"),icon:n.jsx(Vt,{size:16}),panel:"site-editor",isActive:Ci,dataTour:Z.siteEditor});const h={assets:{label:r("common.mainPanelTabs.assets"),icon:n.jsx(so,{size:16})},hosting:{label:r("common.mainPanelTabs.hosting"),icon:n.jsx(mn,{size:16})},e2e:{label:r("common.mainPanelTabs.e2e"),icon:n.jsx(Ys,{size:16})},analytics:{label:r("common.mainPanelTabs.analytics"),icon:n.jsx(Kt,{size:16})},cdn:{label:r("common.mainPanelTabs.cdn"),icon:n.jsx(un,{size:16})},experiments:{label:r("experiments.title"),icon:n.jsx(dn,{size:16})}};for(const x of eo){if(!f.has(x))continue;const j=h[x];g.push({key:x,label:j.label,icon:j.icon,panel:x,isActive:v=>v===x})}for(const x of ki(Ni(o),(o.connections??[]).map($i)))x.toolName!=="fetch_assets"&&g.push({key:`pinned:${x.connectionId}:${x.toolName}`,label:x.label||x.toolName,icon:x.icon?n.jsx("img",{src:x.icon,alt:"",className:"size-4 rounded-[3px]"}):n.jsx(to,{size:16}),panel:jt(x.connectionId,x.toolName),isActive:j=>j===jt(x.connectionId,x.toolName)});f.has("automations")&&g.push({key:"automations",label:r("sidebar.projectNav.automations"),icon:n.jsx(Ut,{size:16}),panel:"automations",isActive:wi,dataTour:Z.automations});const b=a.startsWith(M.projects);p=n.jsx(L,{className:"gap-1",children:g.map(x=>n.jsx(ue,{icon:x.icon,label:x.label,dataTour:x.dataTour,isActive:b&&x.isActive(l),trailing:d(x.panel)?n.jsx(nt,{size:14,className:"text-muted-foreground"}):void 0,onSelect:()=>{F("project_nav_clicked",{surface:x.key}),i(o.id,{panel:x.panel}),s?.()}},x.key))}),e[4]=l,e[5]=d,e[6]=a,e[7]=i,e[8]=s,e[9]=o,e[10]=f,e[11]=r,e[12]=p}else p=e[12];return p}function wi(t){return t==="automations"||Ns(t)!==null}function $i(t){return t.connection_id}function Ci(t){return!!t&&Dt(t)}const Ii=3;function Pi(t,e){return t.status==="archived"||t.status==="done"?!1:e&&t.assigneeId===e?!0:Rn(t)||Dn(t)}function Ti(t,e,s){const r=new Map;for(const i of e){if(!Pi(i,s))continue;const a=An(i,t);for(const l of a){const c=r.get(l.id)??[];c.push({task:i,only:a.length===1}),r.set(l.id,c)}}const o=new Map;for(const[i,a]of r)a.sort((l,c)=>Number(c.only)-Number(l.only)||(c.task.updatedAt??"").localeCompare(l.task.updatedAt??"")),o.set(i,a.slice(0,Ii).map(l=>l.task));return o}function zi(t){const e=y.c(21),{task:s,orgSlug:r,isLast:o,onNavigate:i}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx("span",{"aria-hidden":"true",className:"absolute top-0 left-4 h-1/2 w-3 rounded-bl-lg border-b border-l border-sidebar-border"}),e[0]=a):a=e[0];let l;e[1]!==o?(l=!o&&n.jsx("span",{"aria-hidden":"true",className:"absolute top-1/2 bottom-0 left-4 border-l border-sidebar-border"}),e[1]=o,e[2]=l):l=e[2];let c;e[3]!==r||e[4]!==s?(c=On(r,s),e[3]=r,e[4]=s,e[5]=c):c=e[5];let d;e[6]!==r||e[7]!==c?(d={org:r,taskKey:c},e[6]=r,e[7]=c,e[8]=d):d=e[8];let u;e[9]!==i||e[10]!==s.status?(u=()=>{F("sidebar_attention_task_clicked",{status:s.status}),i?.()},e[9]=i,e[10]=s.status,e[11]=u):u=e[11];let m;e[12]!==s.title?(m=n.jsx("span",{className:"truncate",children:s.title}),e[12]=s.title,e[13]=m):m=e[13];let f;e[14]!==d||e[15]!==u||e[16]!==m?(f=n.jsx(Rt,{to:"/$org/tasks/{-$taskKey}",params:d,onClick:u,className:"flex h-8 items-center rounded-lg pr-2 pl-9 text-sm text-sidebar-foreground/70 transition-colors hover:bg-sidebar-accent hover:text-sidebar-foreground",children:m}),e[14]=d,e[15]=u,e[16]=m,e[17]=f):f=e[17];let p;return e[18]!==l||e[19]!==f?(p=n.jsxs("li",{className:"relative",children:[a,l,f]}),e[18]=l,e[19]=f,e[20]=p):p=e[20],p}function Ai(t){const e=y.c(35),{onNavigate:s}=t,r=T(),o=le(),{org:i,locator:a}=E(),l=At(),{projects:c}=Se(),d=He(),u=pt(),{data:m}=Y.useSession();let f;e[0]!==a||e[1]!==l?(f=Mn(a,l),e[0]=a,e[1]=l,e[2]=f):f=e[2];const p=!o&&!d;let g;e[3]!==f||e[4]!==p?(g={...f,enabled:p},e[3]=f,e[4]=p,e[5]=g):g=e[5];const{data:h}=st(g);if(d||c.length===0)return null;let b,x,j,v,S,k;if(e[6]!==o||e[7]!==h?.items||e[8]!==u||e[9]!==s||e[10]!==i||e[11]!==c||e[12]!==d||e[13]!==m?.user?.id||e[14]!==r){const $=Ti(zn(c),h?.items??[],m?.user?.id),w=o&&"pt-3";e[21]!==w?(v=z("flex flex-col gap-1",w),e[21]=w,e[22]=v):v=e[22],S=Z.projects,e[23]!==o||e[24]!==r?(k=!o&&n.jsx("p",{className:"px-2 pt-5 pb-0.5 text-xs font-medium text-muted-foreground/60",children:r("sidebar.projects.heading")}),e[23]=o,e[24]=r,e[25]=k):k=e[25],b=L,x="gap-1",j=c.map(C=>{const P=$.get(C.id)??[];return n.jsx(ue,{icon:n.jsx(ft,{icon:C.icon,name:C.title}),label:C.title,isActive:C.id===d,onSelect:()=>{F("sidebar_project_clicked"),u(C.id,{panel:_s(C.metadata?.ui?.layout)}),s?.()},children:!o&&P.length>0&&n.jsx("ul",{className:"flex flex-col",children:P.map((O,ne)=>n.jsx(zi,{task:O,orgSlug:i.slug,isLast:ne===P.length-1,onNavigate:s},O.id))})},C.id)}),e[6]=o,e[7]=h?.items,e[8]=u,e[9]=s,e[10]=i,e[11]=c,e[12]=d,e[13]=m?.user?.id,e[14]=r,e[15]=b,e[16]=x,e[17]=j,e[18]=v,e[19]=S,e[20]=k}else b=e[15],x=e[16],j=e[17],v=e[18],S=e[19],k=e[20];let N;e[26]!==b||e[27]!==x||e[28]!==j?(N=n.jsx(b,{className:x,children:j}),e[26]=b,e[27]=x,e[28]=j,e[29]=N):N=e[29];let _;return e[30]!==v||e[31]!==S||e[32]!==k||e[33]!==N?(_=n.jsxs("div",{className:v,"data-tour":S,children:[k,N]}),e[30]=v,e[31]=S,e[32]=k,e[33]=N,e[34]=_):_=e[34],_}function Oi(){const t=y.c(8),e=T(),{capabilities:s,isPrivileged:r,loading:o,error:i}=ws(),a=Sn().length,l=$s();let c;return t[0]!==s||t[1]!==i||t[2]!==r||t[3]!==a||t[4]!==o||t[5]!==e||t[6]!==l?(c=[{key:"account",label:"",items:[{key:"profile",label:e("settings.nav.profile"),icon:n.jsx(mo,{size:14}),to:"/$org/settings/profile"}]},{key:"organization",label:e("settings.nav.organization"),items:[{key:"general",label:e("settings.nav.general"),icon:n.jsx(gn,{size:14}),to:"/$org/settings/general",requires:"org:manage"},{key:"billing",label:e("settings.nav.billing"),icon:n.jsx(ro,{size:14}),to:"/$org/settings/ai-providers",group:"billing"},{key:"connect",label:e("settings.nav.connect"),icon:n.jsx(qt,{size:14}),to:"/$org/settings/connect",group:"connect"},{key:"tasks",label:e("settings.nav.tasks"),icon:n.jsx(Ht,{size:14}),to:"/$org/settings/task-board",requires:"org:manage"}]},{key:"build",label:e("settings.nav.build"),items:[{key:"repositories",label:e("settings.nav.repositories"),icon:n.jsx(ao,{size:14}),to:"/$org/settings/repositories",requires:"file-configs:manage"},{key:"connections",label:e("settings.nav.connections"),icon:n.jsx(fn,{size:14}),to:"/$org/settings/connections"},{key:"agents",label:e("settings.nav.agents"),icon:n.jsx(et,{size:14}),to:"/$org/settings/agents"},{key:"automations",label:e("settings.nav.automations"),icon:n.jsx(fo,{size:14}),to:"/$org/settings/automations",requires:"automations:manage"},{key:"skills",label:e("settings.nav.skills"),icon:n.jsx(uo,{size:14}),to:"/$org/settings/skills"}]},{key:"manage",label:e("settings.nav.manage"),items:[{key:"monitor",label:e("settings.nav.monitor"),icon:n.jsx(pn,{size:14}),to:"/$org/settings/monitor",requires:"monitoring:view"},{key:"members",label:e("settings.nav.members"),icon:n.jsx(et,{size:14}),to:"/$org/settings/members",group:"members",badge:a}]},{key:"advanced",label:e("settings.nav.advanced"),collapsible:!0,items:[{key:"secrets",label:e("settings.nav.secrets"),icon:n.jsx(co,{size:14}),to:"/$org/settings/secrets",requires:"secrets:manage"},{key:"storage",label:e("settings.nav.storage"),icon:n.jsx(lo,{size:14}),to:"/$org/settings/buckets",group:"storage"},{key:"store",label:e("settings.nav.store"),icon:n.jsx(xn,{size:14}),to:"/$org/settings/store",requires:"registry:manage"},{key:"sso",label:e("settings.nav.security"),icon:n.jsx(nt,{size:14}),to:"/$org/settings/sso",requires:"org:manage"}]}].map(u=>({...u,items:u.items.flatMap(m=>{if(m.group){const[f]=l[m.group];return f?[{...m,to:f.to}]:Cs(m.group)?[]:[m]}return o||i?[m]:m.privilegedOnly?r?[m]:[]:m.requires?r||s[m.requires]?[m]:[]:[m]})})).filter(Ri),t[0]=s,t[1]=i,t[2]=r,t[3]=a,t[4]=o,t[5]=e,t[6]=l,t[7]=c):c=t[7],c}function Ri(t){return t.items.length>0}function ls(){const t=y.c(8);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org"},t[0]=e):e=t[0];const{org:s}=Is(e);let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r={select:Di},t[1]=r):r=t[1];const o=Ps(r);let i;if(t[2]!==s||t[3]!==o){const c=d=>{const u=d.replace("$org",s);return o===u||o.startsWith(`${u}/`)};i=d=>[d.to,...d.group?Ts(d.group):[]].some(c),t[2]=s,t[3]=o,t[4]=i}else i=t[4];const a=i;let l;return t[5]!==a||t[6]!==s?(l={org:s,isActive:a},t[5]=a,t[6]=s,t[7]=l):l=t[7],l}function Di(t){return t.location.pathname}function Mi(){const t=y.c(9),{isActive:e}=ls();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s={},t[0]=s):s=t[0];const[r,o]=A.useState(s);let i;t[1]!==e||t[2]!==r?(i=u=>r[u.key]??(!u.collapsible||u.items.some(e)),t[1]=e,t[2]=r,t[3]=i):i=t[3];const a=i;let l;t[4]!==a?(l=u=>o(m=>({...m,[u.key]:!a(u)})),t[4]=a,t[5]=l):l=t[5];const c=l;let d;return t[6]!==a||t[7]!==c?(d={isOpen:a,toggle:c},t[6]=a,t[7]=c,t[8]=d):d=t[8],d}function Li(t){const e=y.c(21),{group:s,open:r,onToggle:o,className:i}=t;let a,l,c,d,u;if(e[0]!==i||e[1]!==s.collapsible||e[2]!==s.label||e[3]!==o||e[4]!==r){u=Symbol.for("react.early_return_sentinel");e:{const g=z("text-xs font-medium text-muted-foreground/60 truncate",i);if(!s.collapsible){u=n.jsx("p",{className:g,children:s.label});break e}a="button",l=o,c=r,d=z("flex w-full items-center gap-1 rounded-md hover:text-muted-foreground",g)}e[0]=i,e[1]=s.collapsible,e[2]=s.label,e[3]=o,e[4]=r,e[5]=a,e[6]=l,e[7]=c,e[8]=d,e[9]=u}else a=e[5],l=e[6],c=e[7],d=e[8],u=e[9];if(u!==Symbol.for("react.early_return_sentinel"))return u;let m;e[10]!==r?(m=r?n.jsx(oo,{size:12}):n.jsx(io,{size:12}),e[10]=r,e[11]=m):m=e[11];let f;e[12]!==s.label?(f=n.jsx("span",{className:"truncate",children:s.label}),e[12]=s.label,e[13]=f):f=e[13];let p;return e[14]!==a||e[15]!==l||e[16]!==c||e[17]!==d||e[18]!==m||e[19]!==f?(p=n.jsxs("button",{type:a,onClick:l,"aria-expanded":c,className:d,children:[m,f]}),e[14]=a,e[15]=l,e[16]=c,e[17]=d,e[18]=m,e[19]=f,e[20]=p):p=e[20],p}function Ei(t){const e=y.c(5),{icon:s,badge:r}=t;let o;e[0]!==r?(o=r?n.jsx("span",{className:"absolute -right-1 -top-1 size-2 rounded-full bg-destructive pointer-events-none"}):null,e[0]=r,e[1]=o):o=e[1];let i;return e[2]!==s||e[3]!==o?(i=n.jsxs("span",{className:"relative shrink-0",children:[s,o]}),e[2]=s,e[3]=o,e[4]=i):i=e[4],i}function cs(t){const e=y.c(22),{onNavigate:s}=t,r=T(),o=Oi(),{org:i,isActive:a}=ls(),{isOpen:l,toggle:c}=Mi();let d;if(e[0]!==o||e[1]!==a||e[2]!==l||e[3]!==s||e[4]!==i||e[5]!==c){let h;e[7]!==a||e[8]!==l||e[9]!==s||e[10]!==i||e[11]!==c?(h=(b,x)=>n.jsxs("div",{className:"flex flex-col",children:[b.label&&n.jsx(Li,{group:b,open:l(b),onToggle:()=>c(b),className:z("px-2 pt-1.5 pb-0.5",x>0&&"mt-3")}),l(b)&&n.jsx(L,{className:"gap-0.5",children:b.items.map(j=>n.jsx(ue,{icon:n.jsx(Ei,{icon:j.icon,badge:j.badge}),label:j.label,isActive:a(j),link:{to:j.to,params:{org:i}},className:"gap-2.5",onSelect:()=>{F("settings_nav_clicked",{section_key:j.key,group_key:b.key}),s?.()}},j.key))})]},b.key),e[7]=a,e[8]=l,e[9]=s,e[10]=i,e[11]=c,e[12]=h):h=e[12],d=o.map(h),e[0]=o,e[1]=a,e[2]=l,e[3]=s,e[4]=i,e[5]=c,e[6]=d}else d=e[6];let u;e[13]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx("div",{className:"mx-2 my-2 border-t border-border/50"}),e[13]=u):u=e[13];let m;e[14]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx("span",{className:"shrink-0",children:n.jsx(Ze,{size:14})}),e[14]=m):m=e[14];let f;e[15]!==r?(f=r("settings.nav.signOut"),e[15]=r,e[16]=f):f=e[16];let p;e[17]!==f?(p=n.jsxs("div",{className:"mt-auto flex flex-col",children:[u,n.jsx(L,{className:"gap-0.5",children:n.jsx(ue,{icon:m,label:f,className:"gap-2.5",onSelect:Fi})})]}),e[17]=f,e[18]=p):p=e[18];let g;return e[19]!==d||e[20]!==p?(g=n.jsxs(n.Fragment,{children:[d,p]}),e[19]=d,e[20]=p,e[21]=g):g=e[21],g}function Fi(){F("signed_out",{source:"settings_sidebar"}),zt(),Y.signOut()}function ds(t){const e=y.c(8),{onNavigate:s}=t,r=T(),{org:o}=E();let i;e[0]!==r?(i=r("settings.nav.backToHome"),e[0]=r,e[1]=i):i=e[1];let a;e[2]!==o.slug?(a={to:"/$org/home",params:{org:o.slug}},e[2]=o.slug,e[3]=a):a=e[3];let l;return e[4]!==s||e[5]!==i||e[6]!==a?(l=n.jsx(rs,{label:i,link:a,onSelect:s}),e[4]=s,e[5]=i,e[6]=a,e[7]=l):l=e[7],l}function us(){const t=y.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"px-4 pb-1",children:n.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v","4.372.1"]})}),t[0]=e):e=t[0],e}const qi="pt-1.5";function ms(t){const e=y.c(15),{header:s,back:r,body:o,footer:i,sheet:a}=t;let l;e[0]!==s?(l=s&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"flex h-12 shrink-0 flex-row items-center gap-2 px-2 group-data-[state=collapsed]/sidebar:h-auto group-data-[state=collapsed]/sidebar:flex-col group-data-[state=collapsed]/sidebar:py-2",children:s}),n.jsx("div",{className:"mt-1.5 h-px shrink-0 bg-sidebar-border"})]}),e[0]=s,e[1]=l):l=e[1];let c;e[2]!==r?(c=r&&n.jsx("div",{className:"shrink-0 px-2",children:r}),e[2]=r,e[3]=c):c=e[3];let d;e[4]!==o?(d=n.jsx(Ls,{className:"gap-0 overflow-y-auto px-2 pt-2 pb-2 group-data-[state=collapsed]/sidebar:[scrollbar-width:none] group-data-[state=collapsed]/sidebar:[&::-webkit-scrollbar]:hidden",children:o}),e[4]=o,e[5]=d):d=e[5];let u;e[6]!==i||e[7]!==l||e[8]!==c||e[9]!==d?(u=n.jsxs(n.Fragment,{children:[l,c,d,i]}),e[6]=i,e[7]=l,e[8]=c,e[9]=d,e[10]=u):u=e[10];const m=u;if(a){let p;return e[11]!==m?(p=n.jsx("div",{className:"group/sidebar flex h-full w-full flex-col bg-sidebar text-sidebar-foreground","data-sidebar":"sidebar","data-state":"expanded","data-tour":Z.nav,children:m}),e[11]=m,e[12]=p):p=e[12],p}let f;return e[13]!==m?(f=n.jsx(Es,{className:qi,"data-tour":Z.nav,children:m}),e[13]=m,e[14]=f):f=e[14],f}function fs(t){const e=y.c(8),{onNavigate:s}=t,r=T(),o=He(),i=wo();if(!o)return null;let a;e[0]!==r?(a=r("sidebar.scope.allProjects"),e[0]=r,e[1]=a):a=e[1];let l;e[2]!==i||e[3]!==s?(l=()=>{i(),s?.()},e[2]=i,e[3]=s,e[4]=l):l=e[4];let c;return e[5]!==a||e[6]!==l?(c=n.jsx(rs,{label:a,onSelect:l}),e[5]=a,e[6]=l,e[7]=c):c=e[7],c}function ps(t){const e=y.c(2),{onNavigate:s}=t;let r;return e[0]!==s?(r=n.jsx(zs,{children:n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(yi,{onNavigate:s}),n.jsx(_i,{onNavigate:s}),n.jsx(Si,{onNavigate:s}),n.jsx(Ai,{onNavigate:s})]})}),e[0]=s,e[1]=r):r=e[1],r}function Vi(){const t=y.c(3),e=We();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(ui,{}),t[0]=s):s=t[0];let r;return t[1]!==e?(r=n.jsx(ms,{header:s,back:e?n.jsx(ds,{}):n.jsx(fs,{}),body:e?n.jsx(cs,{}):n.jsx(ps,{}),footer:e?n.jsx(us,{}):n.jsx(ni,{})}),t[1]=e,t[2]=r):r=t[2],r}function Bi(t){const e=y.c(13),{onClose:s}=t,r=We();let o;e[0]!==s?(o=n.jsx(mi,{onClose:s}),e[0]=s,e[1]=o):o=e[1];let i,a;e[2]!==r||e[3]!==s?(i=r?n.jsx(ds,{onNavigate:s}):n.jsx(fs,{onNavigate:s}),a=r?n.jsx(cs,{onNavigate:s}):n.jsx(ps,{onNavigate:s}),e[2]=r,e[3]=s,e[4]=i,e[5]=a):(i=e[4],a=e[5]);let l;e[6]!==r?(l=r?n.jsx(us,{}):n.jsx(oi,{}),e[6]=r,e[7]=l):l=e[7];let c;return e[8]!==o||e[9]!==i||e[10]!==a||e[11]!==l?(c=n.jsx(ms,{sheet:!0,header:o,back:i,body:a,footer:l}),e[8]=o,e[9]=i,e[10]=a,e[11]=l,e[12]=c):c=e[12],c}const Ui=new Set(["completed","failed","requires_action"]);function Hi(t){const e=y.c(5),[s]=Tt();let r;e[0]!==s?(r=i=>{s.enableSounds&&Ui.has(i.data.status)&&po(xo.dataUri).catch(Ki)},e[0]=s,e[1]=r):r=e[1];let o;e[2]!==t||e[3]!==r?(o={orgSlug:t,onTaskStatus:r},e[2]=t,e[3]=r,e[4]=o):o=e[4],go(o)}function Ki(t){console.warn("[status-sounds] playback failed:",t)}const Wi=2e3,Gi=4e4;function Qi(t){return t==="success"||t==="updated"}function Ji(t){const e=y.c(15);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},e[0]=s):s=e[0];const r=As(s),o=Ot();let i;e[1]!==r.checkout?(i=Qi(r.checkout),e[1]=r.checkout,e[2]=i):i=e[2];const a=i,[l]=A.useState(Xi);let c;e[3]!==t?(c=Ee.checkoutReturnPoll(t),e[3]=t,e[4]=c):c=e[4];let d;e[5]!==l?(d=()=>Date.now()<l?Wi:!1,e[5]=l,e[6]=d):d=e[6];let u;e[7]!==t||e[8]!==o?(u=async()=>(await o.invalidateQueries({queryKey:Ee.aiPlanEntitlements(t)}),Date.now()),e[7]=t,e[8]=o,e[9]=u):u=e[9];let m;e[10]!==a||e[11]!==c||e[12]!==d||e[13]!==u?(m={queryKey:c,enabled:a,gcTime:0,staleTime:0,refetchInterval:d,queryFn:u},e[10]=a,e[11]=c,e[12]=d,e[13]=u,e[14]=m):m=e[14],st(m)}function Xi(){return Date.now()+Gi}function cl(){const t=y.c(5),e=We(),{org:s}=E();Hi(s.slug),Ji(s.id);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(_o,{}),t[0]=r):r=t[0];let o;t[1]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(Je.Sidebar,{renderMobile:Yi,children:n.jsx(Vi,{})}),t[1]=o):o=t[1];let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(Je.Content,{children:n.jsx(Os,{})}),t[2]=i):i=t[2];let a;return t[3]!==e?(a=n.jsxs(Je,{expandedSidebar:e,notice:r,children:[o,i]}),t[3]=e,t[4]=a):a=t[4],a}function Yi(t){const{onClose:e}=t;return n.jsx(Bi,{onClose:e})}export{cl as default};
@@ -1,4 +1,4 @@
1
- import{c as q,n as Ot,m as $0,K as Y9,b as l9,j as r,l as e9,B as u9,F as Es,as as Ms,e as Dt,r as $,t as j9,aw as $t,h as j0,ax as Ps,E as Rs,ay as Is}from"./index-Cjhl57C5.js";import{u as Te}from"./use-session-runtime--RMOkDN5.js";import{f as Fs,p as Os,s as Ds,t as $s,a as et}from"./decofile-api-Cdto5FQ3.js";import{e as zt}from"./backoff-8mStPHYB.js";import{s as zs,a as Bs,b as Vs}from"./utils-DAYUNxCI.js";import{b as Ne}from"./sandbox-url-D3mC8qhT.js";import{g as Bt,z as D9,A as Vt,r as F9,B as Us,b as v9,P as J9,D as Z9,N as S0,E as b9,L as tt,F as o0,C as Ks,H as Ut,l as Kt,I as nt,J as Gs,K as Hs,M as Gt,O as p0,k as qs,Q as Ws,v as Ys,T as Js,U as Zs}from"./claim-phase-copy-0btUuJoC.js";import{V as Qs,W as Xs,X as e1,Y as t1,Z as n1,_ as s1,$ as r1,a0 as i1,O as o1,U as _e,y as Ht,a1 as st,a2 as Ce,o as l1,R as a1,x as c1,a3 as L1,a4 as d1}from"./agent-icon-Cyx7Smko.js";import{i as qt}from"./Play-BolLrTAn.js";import{S as rt}from"./sandbox-start-errors-BK_aDCyt.js";import{G as u1}from"./pair-BHYz9F-Z.js";import{i as Q9}from"./Check-Dnz3uW0f.js";import{i as Ae}from"./ChevronSelectorVertical-B64gqtde.js";import{e as Y0,C as J0,b as K9,a as l0,c as Z0,d as we,f as f1}from"./command-CtFXOSiX.js";import{a as k0,b as T0,P as N0}from"./popover-Bn0xXLy8.js";import{u as Wt}from"./chat-context-H28jTcB6.js";import{i as m1}from"./ArrowLeft-BKbGYh2B.js";import{i as Q0}from"./ChevronRight-DK_MoZ-7.js";import{n as Yt}from"./LinkExternal01--55N_6ts.js";import{i as Jt}from"./X-Dh_K-VDi.js";import{S as p1}from"./scroll-area-YQLTU6PQ.js";import{T as M9,a as P9,c as R9}from"./tooltip-BDUrOxgN.js";import{a as Zt,d as h1}from"./use-virtual-mcp-BvrPyGzX.js";import{M as Qt}from"./monaco-editor-Bg8UPXit.js";import{C as g1}from"./calendar-SAWOBJxF.js";import{I as w9}from"./input-CImpk8th.js";import{T as x1}from"./textarea-DXDx4Cy0.js";import{L as G9}from"./label-Bk7iLZH7.js";import{a as y1,b as v1}from"./Tool01-C0-Xqkxp.js";import{i as b1}from"./SwitchHorizontal01-l3o5r_PJ.js";import{s as Ee}from"./Plus-C5azC59K.js";import{E as t0,M as j1,m as S1,g as _0,u as k1,s as T1,a as N1,b as _1}from"./index-Cm__CFgO.js";import{S as X0,b as ee,a as te,d as ne,c as a0}from"./select-C5Qbx8Kw.js";import{a as C1}from"./Palette-CaHW8y9T.js";import{T as C9,R as A1,u as Xt,C as en,a as tn,b as z0,s as nn,K as sn,P as rn,D as on,c as ln,S as an,v as cn,d as Ln,e as xe}from"./rich-text-link-control-DdZo0zBm.js";import{S as Me}from"./switch-Cf30aXkY.js";import{s as w1}from"./safe-image-url-D5z803Ot.js";import{a as Pe}from"./Copy01-l6PfB431.js";import{a as Re}from"./MessageCircle01-DELRsE6A.js";import{i as E1}from"./Settings02-BLcAotUO.js";import{s as M1}from"./Eye-B7hZLXRZ.js";import{s as C0}from"./Trash01-DPQmLNZV.js";import{D as se,a as $9,b as re,c as ie}from"./dropdown-menu-DRuEZVW9.js";import{t as Ie}from"./ChevronUp-XOZg-HiO.js";import{i as dn}from"./Globe01-D9zr3JIX.js";import{d as un,h as fn,c as mn,e as P1,b as pn,D as hn}from"./dialog-SKkzdrcZ.js";import{i as ye}from"./File02-D1W0NjQG.js";import{i as A0}from"./Upload01-D-20AdeD.js";import{i as gn}from"./AlertCircle-Ddrj7VUD.js";import{i as xn}from"./DotsVertical-Dyzdr42E.js";import{a as c0}from"./Image01-7_HSDHV3.js";import{S as R1}from"./search-input-Cx2Izgwg.js";import{T as I1,a as F1,c as O1,b as D1}from"./tabs-DSOAK--9.js";import{u as $1}from"./use-debounced-value-CVkWNti9.js";import{u as z1,a as yn}from"./use-file-configs-CyU7Mcil.js";import{u as B1,a as Fe,i as vn,e as V1,b as it,f as U1}from"./asset-utils-Dl8tpNxx.js";import{m as bn}from"./match-site-slug-config-D3fUJ6vX.js";import{a as K1,T as G1}from"./toggle-group-Cj0z3PRY.js";import{s as jn}from"./TrendUp01-uTlAwt0S.js";import{b as H1}from"./Printer-Dn2De3ak.js";import{i as q1}from"./Tool02-CE2Fqpba.js";import{A as W1,a as Y1,b as J1,c as Z1,g as Q1,d as X1,e as er,f as tr}from"./alert-dialog-DfGZ77rh.js";import{o as nr}from"./sandbox-git-api-CMdpE2TE.js";function Oe(t,e){const n=(t??"").trim().replace(/^[/\\]+|[/\\]+$/g,"");return n?`${n}/${e}`:e}function sr(t){let e;try{e=JSON.parse(t)}catch{return null}return typeof e!="object"||e===null||Array.isArray(e)?null:e}function rr(t,e){return Ne(t,e)}function ir(t,e){return Ne(t,"preview-fetch",{path:e})}function or(t){return rr(t,"preview-invoke")}function Sn(t){try{const{hostname:e}=new URL(t);return e==="localhost"||e.endsWith(".localhost")||e==="127.0.0.1"||e==="::1"}catch{return!1}}function lr(){if(typeof document>"u")return null;const t=Array.from(document.querySelectorAll("iframe"));for(const e of t){const n=e.getAttribute("src");if(n&&Sn(n))return n}return null}function kn(t,e){const n=t.previewUrl??t.getFallbackPreviewUrl?.()??lr();return n&&Sn(n)?new URL(e,n).toString():ir(t,e)}function ar(t){return kn(t,"/.decofile")}function cr(t){return t===400?"absent":t===404?"unavailable":t>=200&&t<300?"ok":"error"}function ot(t){return t.liveOk||t.committedAbsent?404:t.liveStatus??502}async function Tn(t,e){const n=Ne(t,"read"),s=await fetch(n,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:e,full:!0})}),i=cr(s.status);if(i==="absent")return{kind:"absent"};if(i==="unavailable")return{kind:"unavailable"};if(i==="error"){const l=new Error(`Failed to read ${e}: ${s.status}`);throw l.status=s.status,l}const o=await s.json();if(typeof o.content!="string")return{kind:"unavailable"};try{return{kind:"data",data:JSON.parse(zs(o.content))}}catch{return{kind:"unavailable"}}}async function Lr(t){const e=`/api/${t.orgSlug}/decofile/${encodeURIComponent(t.virtualMcpId)}/${encodeURIComponent(t.branch)}/meta`,n=await fetch(e,{cache:"no-store"});if(n.status===404)return{kind:"absent"};if(!n.ok){const s=new Error(`Failed to read committed meta: ${n.status}`);throw s.status=n.status,s}try{return{kind:"data",data:await n.json()}}catch{return{kind:"unavailable"}}}function De(t){return Zt(t)?.metadata?.runtime?.path??null}function k5(t,e){const n=q.c(15),s=t?`${t.orgSlug}/${t.virtualMcpId}/${t.branch}`:"",i=e?.fetchEnabled??!0,o=De(t?.virtualMcpId),l=Te(t?.virtualMcpId).runtime==="cms",a=Ot();let c;n[0]!==s?(c=Y9.decofile(s),n[0]=s,n[1]=c):c=n[1];let L;n[2]!==l||n[3]!==i||n[4]!==o||n[5]!==t||n[6]!==a?(L=async()=>{if(l)return Fs(a,t);const b=()=>Tn(t,Oe(o,".deco/blocks.gen.json"));if(i){const j=await fetch(ar(t),{cache:"no-store"}).catch(ur);if(j?.ok){const S=sr(await j.text());if(S)return S}const h=await b();if(h.kind==="data")return h.data;const v=new Error(`Failed to fetch decofile: ${j?.status??"network error"}`);throw v.status=ot({liveOk:!!j?.ok,liveStatus:j?.status,committedAbsent:h.kind==="absent"}),v}const m=await b();if(m.kind==="data")return m.data;const p=new Error("decofile unavailable (preview down, no committed snapshot)");throw p.status=ot({liveOk:!1,committedAbsent:m.kind==="absent"}),p},n[2]=l,n[3]=i,n[4]=o,n[5]=t,n[6]=a,n[7]=L):L=n[7];const d=!!t;let u;n[8]!==l?(u=(b,m)=>{if(l)return b<3;const p=m.status;return p!==502&&p!==404&&b<2},n[8]=l,n[9]=u):u=n[9];let f;return n[10]!==c||n[11]!==L||n[12]!==d||n[13]!==u?(f={queryKey:c,queryFn:L,enabled:d,staleTime:3e4,retry:u,retryDelay:dr},n[10]=c,n[11]=L,n[12]=d,n[13]=u,n[14]=f):f=n[14],$0(f)}function dr(t){return zt(5e3,1e3,t,2,0)}function ur(){return null}const fr=new Set(["website/pages/Page.tsx","$live/pages/LivePage.tsx"]);function mr(t){return t.includes("matchers")||t.includes("Match")}function Nn(t,e){const n=t.__resolveType;return typeof n!="string"||!n||fr.has(n)?!1:e?Us(e,n):mr(n)}function pr(t,e){const n=[];for(const[s,i]of Object.entries(e)){if(s.includes("/")||!D9(s)||Vt(s)||!i||typeof i!="object"||Array.isArray(i))continue;const o=i;Nn(o,t)&&n.push({blockKey:s,matcherResolveType:o.__resolveType??"",name:typeof o.name=="string"?o.name:void 0})}return n.sort((s,i)=>(s.name??s.blockKey).localeCompare(i.name??i.blockKey))}function w0(t,e,n){if(!t)return!1;const s=t.__resolveType;if(typeof s!="string"||!D9(s)||!Object.hasOwn(e,s))return!1;const i=e[s];return!i||typeof i!="object"||Array.isArray(i)?!1:Nn(i,n)}function T5(t,e,n){return w0(t,e,n)?t?.__resolveType??null:null}function _n(t,e,n){if(!t)return null;const s=t.__resolveType??"";if(!s)return null;if(w0(t,e,n)){const l=e[s]??{},a=l.__resolveType??s,{__resolveType:c,name:L,...d}=l;return{resolveType:a,data:d,blockKey:s}}const{__resolveType:i,...o}=t;return{resolveType:s,data:o}}function Cn(t,e,n){const s=_n(t,e,n);return s?{__resolveType:s.resolveType,...s.data}:{__resolveType:""}}function N5(t,e,n){if(t)return w0(t,e,n)?Cn(t,e,n):t}function hr(t,e,n,s){if(!t)return"Default";if(w0(t,e,s)){const i=t.__resolveType??"",o=e[i];return Bt(i,o)}return n(t)}function _5(t,e,n){return{__resolveType:t,...e,name:n}}function gr(t){return{__resolveType:t}}function C5(t,e,n){const s=_n(t,e,n);return s?{resolveType:s.resolveType,formValue:s.data}:{resolveType:"",formValue:{}}}function xr(t,e){const n={__resolveType:t};if(!t||!e)return n;const s=F9(t,e),i=s?.type==="inline-union"?s.inlineUnionBranches?.[0]?.discriminators:void 0;return i?{...n,...i}:n}function yr(t){const e=[];return t.fastPreviewActive?e.push({kind:"committed"}):(t.fetchEnabled&&t.previewUrl&&e.push({kind:"live",baseUrl:t.previewUrl}),e.push({kind:"committed"})),t.productionUrl&&e.push({kind:"production",baseUrl:t.productionUrl}),e}function vr(t){return Y9.liveMeta(t.orgSlug,t.virtualMcpId,t.branch,t.previewUrl??"",t.productionUrl??"")}function A5(t,e){const n=q.c(19),s=e?.fetchEnabled??!0,i=t?.previewUrl,o=De(t?.virtualMcpId),{previewServerUrl:l,runtime:a}=Te(t?.virtualMcpId),c=a==="cms";let L;n[0]!==t||n[1]!==i||n[2]!==l?(L=t?vr({...t,previewUrl:i,productionUrl:l}):Y9.liveMeta(""),n[0]=t,n[1]=i,n[2]=l,n[3]=L):L=n[3];let d;n[4]!==c||n[5]!==s||n[6]!==o||n[7]!==t||n[8]!==i||n[9]!==l?(d=async()=>{const p=jr,j=()=>c?Lr(t):Tn(t,Oe(o,".deco/meta.gen.json")),h=yr({fetchEnabled:s,previewUrl:i,productionUrl:l,fastPreviewActive:c});for(const S of h){if(S.kind==="committed"){const x=await j();if(x.kind==="data")return x.data;continue}const g=await p(S.baseUrl);if(g)return g}const v=new Error("live meta unavailable (dev server down, no committed snapshot, no production fallback)");throw v.status=502,v},n[4]=c,n[5]=s,n[6]=o,n[7]=t,n[8]=i,n[9]=l,n[10]=d):d=n[10];const u=!!t,f=e?.refetchInterval;let b;n[11]!==c?(b=(p,j)=>(c||j.status!==502)&&p<3,n[11]=c,n[12]=b):b=n[12];let m;return n[13]!==L||n[14]!==d||n[15]!==u||n[16]!==f||n[17]!==b?(m={queryKey:L,queryFn:d,enabled:u,refetchInterval:f,refetchIntervalInBackground:!1,staleTime:3e5,retry:b,retryDelay:br},n[13]=L,n[14]=d,n[15]=u,n[16]=f,n[17]=b,n[18]=m):m=n[18],$0(m)}function br(t){return zt(5e3,1e3,t,2,0)}async function jr(t){const e=new URL("/live/_meta",t).href,n=await fetch(e,{cache:"no-store"}).catch(Sr);if(!n?.ok)return null;try{return await n.json()}catch{return null}}function Sr(){return null}function de(t,e,n){const s=n[t];return typeof s?.name=="string"&&s.name||t.replace(/[-_]/g," ").replace(/\b\w/g,i=>i.toUpperCase())||`Section ${e+1}`}function w5(t,e){return t.map((n,s)=>{const i=n.__resolveType??"",o=v9(i);if(!o&&i!==""&&D9(i)&&i in e)return{index:s,resolveType:i,label:de(i,s,e),isLazy:!1,isSavedBlock:!0};const l=o?n.section:void 0,a=o?l?.__resolveType??"":i;if(a===J9||a===Z9){const L=o?l:n,d=Array.isArray(L?.variants)?L.variants:[];if(d.length===1&&(d[0]?.rule?.__resolveType??"")===S0){const b=d[0]?.value??{};let m=b.__resolveType??"";const p=v9(m);let j=b;if(p){const h=b.section;m=h?.__resolveType??m,h&&(j=h)}if(m===J9||m===Z9){const v=(Array.isArray(j.variants)?j.variants:[])[0]?.value?.__resolveType,S=v?b9(v):"Section";return{index:s,resolveType:i,label:`Variants of ${S}`,isHidden:!0,isLazy:p}}return m!==""&&D9(m)&&m in e?{index:s,resolveType:i,label:de(m,s,e),isHidden:!0,isLazy:p,isSavedBlock:!0}:{index:s,resolveType:i,label:b9(m)||`Section ${s+1}`,isHidden:!0,isLazy:p}}const u=d[0]?.value?.__resolveType,f=u?b9(u):"Section";return{index:s,resolveType:i,label:`Variants of ${f}`,isMultivariate:!0,isLazy:o}}const c=o?n.section?.__resolveType??i:i;return o&&c!==""&&D9(c)&&c in e?{index:s,resolveType:i,label:de(c,s,e),isLazy:!0,isSavedBlock:!0}:{index:s,resolveType:i,label:b9(c)||`Section ${s+1}`,isLazy:o}})}function An(t){const e=t.__resolveType??"";return v9(e)?t.section??t:t}function B0(t){const i=(v9(t.__resolveType??"")?t.section:t)?.variants?.[0];return i?.rule?.__resolveType!==S0?null:i?.value??null}function E5(t){const e=An(t);return{__resolveType:Z9,variants:[{value:e,rule:{__resolveType:S0}}]}}function M5(t){const e=t.__resolveType??"";if(!e)return null;if(v9(e))return t.section??null;const n=B0(t);return n?v9(n.__resolveType??"")?n:{__resolveType:tt,section:An(n)}:{__resolveType:tt,section:t}}function M0(t){const e=t.__resolveType??"";if(!e)return null;if(v9(e)){const n=t.section,s=n?.__resolveType??"";return!s||!n?null:{resolveType:s,data:n}}return{resolveType:e,data:t}}function P5(t){const e=B0(t);if(e)return M0(e);if(v9(t.__resolveType??"")){const s=t.section;if(!s)return null;const i=B0(s);return M0(i||s)}return M0(t)}function R5(t){return B0(t)}const kr=["website/matchers/always.ts","$live/matchers/MatchAlways.ts"];function $e(t){if(!t)return!1;const e=t.__resolveType??"";return e===""?Object.keys(t).length===0:kr.includes(e)||e.includes("always")}function Tr(t){const e=t.variants??[];if(e.length===0)return-1;const n=e.findIndex(s=>$e(s.rule));return n!==-1?n:e.length-1}function I5(t,e,n){const s=n.variants??[];if(s.length===0)return null;const i=Tr(n),o=s[i]?.value;if(!o)return null;const l=structuredClone(o);return e.isLazy?{...t,section:l}:l}function wn(t,e){return e.isMultivariate?e.isLazy?t.section??null:t:null}function F5(t,e){return Array.isArray(t.variants)?t.variants.map((n,s)=>({label:e(n.rule)||`Variant ${s+1}`,value:n.value??{},rule:n.rule})):[]}function O5(t,e){const n=t.__resolveType??"";if(!n)return null;if(v9(n)){const s=t.section??t,i=s.__resolveType??n;if(!i.includes("/")&&i in e){const o=e[i]??{};return{data:{...o},resolveType:o.__resolveType??i}}return{data:{...s},resolveType:i}}if(!n.includes("/")&&n in e){const s=e[n]??{};return{data:{...s},resolveType:s.__resolveType??n}}return{data:{...t},resolveType:n}}function Nr(t,e){const n=t.__resolveType??"";return v9(n)?{...t,section:e}:e}function _r(t,e,n){return e.isLazy?{...t,section:n}:n}function D5(t,e,n){const s=[...t.variants??[]],i=s[e];if(!i)return t;const o=i.value??{};return s[e]={...i,value:Nr(o,n)},{...t,variants:s}}function $5(t,e,n){const s=[...t.variants??[]];return s[e]?(s[e]={...s[e],rule:n},{...t,variants:s}):t}function z5(t,e){const n=[...t.variants??[]],s=n[e];return s?(n.splice(e+1,0,structuredClone(s)),{...t,variants:n}):t}function B5(t,e,n){const s=[...t.variants??[]];if(e===n||e<0||n<0||e>=s.length||n>=s.length)return t;const[i]=s.splice(e,1);return i?(s.splice(n,0,i),{...t,variants:s}):t}function V5(t,e){const n=[...t.variants??[]];return n.length<=1?null:(n.splice(e,1),{...t,variants:n})}function ve(t){return{rule:o0(),value:structuredClone(t)}}function En(t,e){return{...e,__resolveType:Z9,variants:t}}function U5(t){return t.isHidden!==!0&&t.isSavedBlock!==!0}function Cr(t,e){if(e.isHidden)return null;if(e.isMultivariate){const s=wn(t,e)?.variants??[],i=s[s.length-1]?.value;return i?structuredClone(i):null}if(e.isLazy){const n=t.section;return n?structuredClone(n):null}return structuredClone(t)}function Ar(t,e,n){if(e.isMultivariate||e.isHidden)return null;const s=Cr(t,e);if(!s)return null;const i=En([ve(s),ve(s)]);return e.isLazy?{...t,section:i}:i}function K5(t,e,n){if(e.isHidden||e.isSavedBlock)return null;if(e.isMultivariate){const i=wn(t,e);if(!i)return null;const o=i.variants??[],l=o[o.length-1]?.value;if(!l)return null;const a=En([...o,ve(l)],i);return{section:_r(t,e,a),newVariantIndex:o.length}}const s=Ar(t,e);return s?{section:s,newVariantIndex:1}:null}const wr=new Set(["website/pages/Page.tsx","$live/pages/LivePage.tsx"]);function oe(t){return t.anyOfRefs?.some(e=>e.resolveType!==J9?!1:e.schema?.properties?.variants?.items?.properties?.value?.type==="array")??!1}function Er(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;const e=t;return e.__resolveType===Z9&&Array.isArray(e.variants)}function V0(t){return!t||typeof t!="object"||Array.isArray(t)?!1:t.__resolveType===J9}function Mr(t){if(!V0(t))return null;const e=t.variants;if(!Array.isArray(e))return null;const n=e[0]?.value;return Array.isArray(n)?n:null}function Pr(t,e){if(!V0(t))return e;const n=structuredClone(t),s=[...n.variants??[]];return s.length===0?s.push({rule:o0(),value:e}):s[0]={...s[0],value:e},{...n,variants:s}}function Rr(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;const e=t;return typeof e.__resolveType=="string"&&wr.has(e.__resolveType)&&typeof e.path=="string"}function G5(t,e){const s=t[e]?.sections;if(!s||Array.isArray(s))return 1;const i=s;return Array.isArray(i.variants)?i.variants.length:1}function H5(t,e,n){const i=t[e]?.sections;if(Array.isArray(i))return n===0?i:[];if(i&&typeof i=="object"){const o=i.variants;if(Array.isArray(o)){const l=o[n];return Array.isArray(l?.value)?l.value:[]}}return[]}function Ir(t,e,n){if(Array.isArray(t))return[{label:"Default",sections:t}];if(t&&typeof t=="object"){const s=t;if(Array.isArray(s.variants)){const i=s.variants,o=i.map(c=>hr(c.rule,e,n)),l=o.reduce((c,L)=>(c[L]=(c[L]??0)+1,c),{}),a={};return i.map((c,L)=>{const d=o[L]??`Variant ${L+1}`,u=l[d]??1;let f=d;return u>1&&(a[d]=(a[d]??0)+1,f=`${d} ${a[d]}`),{label:f||`Variant ${L+1}`,sections:Array.isArray(c.value)?c.value:[],rule:c.rule}})}}return[]}function m0(t){return{rule:o0(),value:t}}function r0(t,e){return{...e,__resolveType:J9,variants:t}}function q5(t,e){const n=structuredClone(e);if(Array.isArray(t))return r0([m0(t),m0(n)]);if(t&&typeof t=="object"){const s=t;return Array.isArray(s.variants)?r0([...s.variants,m0(n)],s):null}return r0([m0([]),m0(n)])}function W5(t){const e=t.variants;return Array.isArray(e)?e.length-1:1}function Y5(t,e){const n=t[e];if(!n)return null;const s=[...t];return s.splice(e+1,0,structuredClone(n)),s}function J5(t,e){if(e.length===0)return r0([],t);if(e.length===1){const n=e[0],s=n?.rule;if(!$e(s))return r0(e,t);if(Array.isArray(n?.value))return n.value}return r0(e,t)}function Fr(t,e){for(const[n,s]of Object.entries(t)){if(!Rr(s))continue;const i=s.sections;if(Array.isArray(i)){e(void 0,n,0);continue}if(!i||typeof i!="object")continue;const o=i.variants;if(Array.isArray(o))for(let l=0;l<o.length;l++){const a=o[l];e(a?.rule,n,l)}}}function Z5(t,e,n){let s=0;return Fr(t,i=>{if(!i)return;(i.__resolveType??"")===e&&w0(i,t,n)&&s++}),s}const Or={provision:0,cloning:1,install:2,dev:3};function Dr(t){return Or[t.step]}const lt=48,Mn=28,Pn=3,$r=(()=>{const t=[];let e=0;for(let n=0;n<lt;n++)n===Mn?t.push(null):(t.push(e/(lt-1)*Pn),e++);return t})();function zr(t){return{provision:t("sandbox.bootingVisual.phaseProvision"),cloning:t("sandbox.bootingVisual.phaseCloning"),install:t("sandbox.bootingVisual.phaseInstall"),dev:t("sandbox.bootingVisual.phaseDev")}}function Br(t,e,n){return t.step==="provision"&&e!=null&&e.kind!=="ready"&&e.kind!=="failed"?Ks[e.kind].long:n[t.step]}const O9="bg-foreground/[0.05]",E9="bg-foreground/[0.09]",Vr=Array.from({length:35},()=>Math.random()*1.8),Ur=Array.from({length:35},()=>Math.random()<.4);function Kr(t){const e=q.c(31),{progress:n,claimPhase:s}=t,i=l9();let o;e[0]!==n?(o=Dr(n),e[0]=n,e[1]=o):o=e[1];const l=o;let a;e[2]!==s||e[3]!==n||e[4]!==i?(a=Br(n,s,zr(i)),e[2]=s,e[3]=n,e[4]=i,e[5]=a):a=e[5];const c=a;let L;e[6]===Symbol.for("react.memo_cache_sentinel")?(L=r.jsx(u1,{}),e[6]=L):L=e[6];const d=`${n.step}-${c}`;let u;e[7]!==c||e[8]!==d?(u=r.jsxs("div",{className:"flex items-center gap-2 rounded-full border border-foreground/10 bg-background px-3.5 py-1.5 shadow-[0_4px_20px_-4px_rgb(0_0_0_/_0.12)]",children:[L,r.jsxs("span",{className:"animate-in fade-in text-[13px] font-medium text-foreground/85 duration-500",children:[c,"…"]},d)]}),e[7]=c,e[8]=d,e[9]=u):u=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=r.jsx(Gr,{}),e[10]=f):f=e[10];let b;e[11]!==l?(b=r.jsx(P0,{phase:0,current:l,children:f}),e[11]=l,e[12]=b):b=e[12];let m;e[13]===Symbol.for("react.memo_cache_sentinel")?(m=r.jsx(qr,{}),e[13]=m):m=e[13];let p;e[14]!==l?(p=r.jsx(P0,{phase:1,current:l,children:m}),e[14]=l,e[15]=p):p=e[15];let j;e[16]===Symbol.for("react.memo_cache_sentinel")?(j=r.jsx(Wr,{}),e[16]=j):j=e[16];let h;e[17]!==l?(h=r.jsx(P0,{phase:2,current:l,children:j}),e[17]=l,e[18]=h):h=e[18];let v;e[19]===Symbol.for("react.memo_cache_sentinel")?(v=r.jsx(Jr,{}),e[19]=v):v=e[19];let S;e[20]!==l?(S=r.jsx(P0,{phase:3,current:l,children:v}),e[20]=l,e[21]=S):S=e[21];let g;e[22]!==h||e[23]!==S||e[24]!==b||e[25]!==p?(g=r.jsxs("div",{className:"relative aspect-[4/3] w-[min(78%,560px)]",children:[b,p,h,S]}),e[22]=h,e[23]=S,e[24]=b,e[25]=p,e[26]=g):g=e[26];let x;e[27]===Symbol.for("react.memo_cache_sentinel")?(x=r.jsx("style",{children:`
1
+ import{c as q,n as Ot,m as $0,K as Y9,b as l9,j as r,l as e9,B as u9,F as Es,as as Ms,e as Dt,r as $,t as j9,aw as $t,h as j0,ax as Ps,E as Rs,ay as Is}from"./index-z4bKt11m.js";import{u as Te}from"./use-session-runtime-DU2zS-3V.js";import{f as Fs,p as Os,s as Ds,t as $s,a as et}from"./decofile-api-BVqR93jw.js";import{e as zt}from"./backoff-8mStPHYB.js";import{s as zs,a as Bs,b as Vs}from"./utils-CU3t1jst.js";import{b as Ne}from"./sandbox-url-D3mC8qhT.js";import{g as Bt,z as D9,A as Vt,r as F9,B as Us,b as v9,P as J9,D as Z9,N as S0,E as b9,L as tt,F as o0,C as Ks,H as Ut,l as Kt,I as nt,J as Gs,K as Hs,M as Gt,O as p0,k as qs,Q as Ws,v as Ys,T as Js,U as Zs}from"./claim-phase-copy-0btUuJoC.js";import{V as Qs,W as Xs,X as e1,Y as t1,Z as n1,_ as s1,$ as r1,a0 as i1,O as o1,U as _e,y as Ht,a1 as st,a2 as Ce,o as l1,R as a1,x as c1,a3 as L1,a4 as d1}from"./agent-icon-BD4DM2Lv.js";import{i as qt}from"./Play-DQgzDnaW.js";import{S as rt}from"./sandbox-start-errors-BK_aDCyt.js";import{G as u1}from"./pair-B2TMNGEX.js";import{i as Q9}from"./Check-BZE0WrNL.js";import{i as Ae}from"./ChevronSelectorVertical-oXn0cTzk.js";import{e as Y0,C as J0,b as K9,a as l0,c as Z0,d as we,f as f1}from"./command-D2fiEFer.js";import{a as k0,b as T0,P as N0}from"./popover-CsEsUqbZ.js";import{u as Wt}from"./chat-context-BBVkwd3p.js";import{i as m1}from"./ArrowLeft-CyH6aWpS.js";import{i as Q0}from"./ChevronRight-DNrwFBnC.js";import{n as Yt}from"./LinkExternal01-BkRUjBAn.js";import{i as Jt}from"./X-Bzh3NI3m.js";import{S as p1}from"./scroll-area-BqCCUXvj.js";import{T as M9,a as P9,c as R9}from"./tooltip-BuKeolDX.js";import{a as Zt,d as h1}from"./use-virtual-mcp-Bq1RMGPF.js";import{M as Qt}from"./monaco-editor-BHu8MLvz.js";import{C as g1}from"./calendar-Dyov14Y_.js";import{I as w9}from"./input-C7XH8Uj_.js";import{T as x1}from"./textarea-BEOceSll.js";import{L as G9}from"./label-8juC5J-g.js";import{a as y1,b as v1}from"./Tool01-DHi_Z7zo.js";import{i as b1}from"./SwitchHorizontal01-hHr6GOmU.js";import{s as Ee}from"./Plus-D2HOi_DD.js";import{E as t0,M as j1,m as S1,g as _0,u as k1,s as T1,a as N1,b as _1}from"./index-CuiP-22D.js";import{S as X0,b as ee,a as te,d as ne,c as a0}from"./select-cIekAVlM.js";import{a as C1}from"./Palette-oECS8j3l.js";import{T as C9,R as A1,u as Xt,C as en,a as tn,b as z0,s as nn,K as sn,P as rn,D as on,c as ln,S as an,v as cn,d as Ln,e as xe}from"./rich-text-link-control-DgGIjR0I.js";import{S as Me}from"./switch-9PLadaw_.js";import{s as w1}from"./safe-image-url-D5z803Ot.js";import{a as Pe}from"./Copy01-DTHuBaTA.js";import{a as Re}from"./MessageCircle01-CgotMmLL.js";import{i as E1}from"./Settings02-CFcKewXh.js";import{s as M1}from"./Eye-DXUjft5i.js";import{s as C0}from"./Trash01-C6bziN5X.js";import{D as se,a as $9,b as re,c as ie}from"./dropdown-menu-Dd8nakK9.js";import{t as Ie}from"./ChevronUp-D5_IWEtB.js";import{i as dn}from"./Globe01-DIy8wXF6.js";import{d as un,h as fn,c as mn,e as P1,b as pn,D as hn}from"./dialog-DbzCN1O8.js";import{i as ye}from"./File02-g-xJPix_.js";import{i as A0}from"./Upload01-DC2spim9.js";import{i as gn}from"./AlertCircle-DbwtWnTP.js";import{i as xn}from"./DotsVertical-DE9eZKrJ.js";import{a as c0}from"./Image01-DfaxHjlV.js";import{S as R1}from"./search-input-DpLbMQRj.js";import{T as I1,a as F1,c as O1,b as D1}from"./tabs-Co2GUrNY.js";import{u as $1}from"./use-debounced-value-DeY1TNRX.js";import{u as z1,a as yn}from"./use-file-configs-sqbLS09v.js";import{u as B1,a as Fe,i as vn,e as V1,b as it,f as U1}from"./asset-utils-syVIRo9d.js";import{m as bn}from"./match-site-slug-config-D3fUJ6vX.js";import{a as K1,T as G1}from"./toggle-group-Ck5f9XVv.js";import{s as jn}from"./TrendUp01-Bkdgpfn7.js";import{b as H1}from"./Printer-BpZBiqyG.js";import{i as q1}from"./Tool02-JY0gm8cg.js";import{A as W1,a as Y1,b as J1,c as Z1,g as Q1,d as X1,e as er,f as tr}from"./alert-dialog-Bi9Cy1y8.js";import{o as nr}from"./sandbox-git-api-CMdpE2TE.js";function Oe(t,e){const n=(t??"").trim().replace(/^[/\\]+|[/\\]+$/g,"");return n?`${n}/${e}`:e}function sr(t){let e;try{e=JSON.parse(t)}catch{return null}return typeof e!="object"||e===null||Array.isArray(e)?null:e}function rr(t,e){return Ne(t,e)}function ir(t,e){return Ne(t,"preview-fetch",{path:e})}function or(t){return rr(t,"preview-invoke")}function Sn(t){try{const{hostname:e}=new URL(t);return e==="localhost"||e.endsWith(".localhost")||e==="127.0.0.1"||e==="::1"}catch{return!1}}function lr(){if(typeof document>"u")return null;const t=Array.from(document.querySelectorAll("iframe"));for(const e of t){const n=e.getAttribute("src");if(n&&Sn(n))return n}return null}function kn(t,e){const n=t.previewUrl??t.getFallbackPreviewUrl?.()??lr();return n&&Sn(n)?new URL(e,n).toString():ir(t,e)}function ar(t){return kn(t,"/.decofile")}function cr(t){return t===400?"absent":t===404?"unavailable":t>=200&&t<300?"ok":"error"}function ot(t){return t.liveOk||t.committedAbsent?404:t.liveStatus??502}async function Tn(t,e){const n=Ne(t,"read"),s=await fetch(n,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:e,full:!0})}),i=cr(s.status);if(i==="absent")return{kind:"absent"};if(i==="unavailable")return{kind:"unavailable"};if(i==="error"){const l=new Error(`Failed to read ${e}: ${s.status}`);throw l.status=s.status,l}const o=await s.json();if(typeof o.content!="string")return{kind:"unavailable"};try{return{kind:"data",data:JSON.parse(zs(o.content))}}catch{return{kind:"unavailable"}}}async function Lr(t){const e=`/api/${t.orgSlug}/decofile/${encodeURIComponent(t.virtualMcpId)}/${encodeURIComponent(t.branch)}/meta`,n=await fetch(e,{cache:"no-store"});if(n.status===404)return{kind:"absent"};if(!n.ok){const s=new Error(`Failed to read committed meta: ${n.status}`);throw s.status=n.status,s}try{return{kind:"data",data:await n.json()}}catch{return{kind:"unavailable"}}}function De(t){return Zt(t)?.metadata?.runtime?.path??null}function k5(t,e){const n=q.c(15),s=t?`${t.orgSlug}/${t.virtualMcpId}/${t.branch}`:"",i=e?.fetchEnabled??!0,o=De(t?.virtualMcpId),l=Te(t?.virtualMcpId).runtime==="cms",a=Ot();let c;n[0]!==s?(c=Y9.decofile(s),n[0]=s,n[1]=c):c=n[1];let L;n[2]!==l||n[3]!==i||n[4]!==o||n[5]!==t||n[6]!==a?(L=async()=>{if(l)return Fs(a,t);const b=()=>Tn(t,Oe(o,".deco/blocks.gen.json"));if(i){const j=await fetch(ar(t),{cache:"no-store"}).catch(ur);if(j?.ok){const S=sr(await j.text());if(S)return S}const h=await b();if(h.kind==="data")return h.data;const v=new Error(`Failed to fetch decofile: ${j?.status??"network error"}`);throw v.status=ot({liveOk:!!j?.ok,liveStatus:j?.status,committedAbsent:h.kind==="absent"}),v}const m=await b();if(m.kind==="data")return m.data;const p=new Error("decofile unavailable (preview down, no committed snapshot)");throw p.status=ot({liveOk:!1,committedAbsent:m.kind==="absent"}),p},n[2]=l,n[3]=i,n[4]=o,n[5]=t,n[6]=a,n[7]=L):L=n[7];const d=!!t;let u;n[8]!==l?(u=(b,m)=>{if(l)return b<3;const p=m.status;return p!==502&&p!==404&&b<2},n[8]=l,n[9]=u):u=n[9];let f;return n[10]!==c||n[11]!==L||n[12]!==d||n[13]!==u?(f={queryKey:c,queryFn:L,enabled:d,staleTime:3e4,retry:u,retryDelay:dr},n[10]=c,n[11]=L,n[12]=d,n[13]=u,n[14]=f):f=n[14],$0(f)}function dr(t){return zt(5e3,1e3,t,2,0)}function ur(){return null}const fr=new Set(["website/pages/Page.tsx","$live/pages/LivePage.tsx"]);function mr(t){return t.includes("matchers")||t.includes("Match")}function Nn(t,e){const n=t.__resolveType;return typeof n!="string"||!n||fr.has(n)?!1:e?Us(e,n):mr(n)}function pr(t,e){const n=[];for(const[s,i]of Object.entries(e)){if(s.includes("/")||!D9(s)||Vt(s)||!i||typeof i!="object"||Array.isArray(i))continue;const o=i;Nn(o,t)&&n.push({blockKey:s,matcherResolveType:o.__resolveType??"",name:typeof o.name=="string"?o.name:void 0})}return n.sort((s,i)=>(s.name??s.blockKey).localeCompare(i.name??i.blockKey))}function w0(t,e,n){if(!t)return!1;const s=t.__resolveType;if(typeof s!="string"||!D9(s)||!Object.hasOwn(e,s))return!1;const i=e[s];return!i||typeof i!="object"||Array.isArray(i)?!1:Nn(i,n)}function T5(t,e,n){return w0(t,e,n)?t?.__resolveType??null:null}function _n(t,e,n){if(!t)return null;const s=t.__resolveType??"";if(!s)return null;if(w0(t,e,n)){const l=e[s]??{},a=l.__resolveType??s,{__resolveType:c,name:L,...d}=l;return{resolveType:a,data:d,blockKey:s}}const{__resolveType:i,...o}=t;return{resolveType:s,data:o}}function Cn(t,e,n){const s=_n(t,e,n);return s?{__resolveType:s.resolveType,...s.data}:{__resolveType:""}}function N5(t,e,n){if(t)return w0(t,e,n)?Cn(t,e,n):t}function hr(t,e,n,s){if(!t)return"Default";if(w0(t,e,s)){const i=t.__resolveType??"",o=e[i];return Bt(i,o)}return n(t)}function _5(t,e,n){return{__resolveType:t,...e,name:n}}function gr(t){return{__resolveType:t}}function C5(t,e,n){const s=_n(t,e,n);return s?{resolveType:s.resolveType,formValue:s.data}:{resolveType:"",formValue:{}}}function xr(t,e){const n={__resolveType:t};if(!t||!e)return n;const s=F9(t,e),i=s?.type==="inline-union"?s.inlineUnionBranches?.[0]?.discriminators:void 0;return i?{...n,...i}:n}function yr(t){const e=[];return t.fastPreviewActive?e.push({kind:"committed"}):(t.fetchEnabled&&t.previewUrl&&e.push({kind:"live",baseUrl:t.previewUrl}),e.push({kind:"committed"})),t.productionUrl&&e.push({kind:"production",baseUrl:t.productionUrl}),e}function vr(t){return Y9.liveMeta(t.orgSlug,t.virtualMcpId,t.branch,t.previewUrl??"",t.productionUrl??"")}function A5(t,e){const n=q.c(19),s=e?.fetchEnabled??!0,i=t?.previewUrl,o=De(t?.virtualMcpId),{previewServerUrl:l,runtime:a}=Te(t?.virtualMcpId),c=a==="cms";let L;n[0]!==t||n[1]!==i||n[2]!==l?(L=t?vr({...t,previewUrl:i,productionUrl:l}):Y9.liveMeta(""),n[0]=t,n[1]=i,n[2]=l,n[3]=L):L=n[3];let d;n[4]!==c||n[5]!==s||n[6]!==o||n[7]!==t||n[8]!==i||n[9]!==l?(d=async()=>{const p=jr,j=()=>c?Lr(t):Tn(t,Oe(o,".deco/meta.gen.json")),h=yr({fetchEnabled:s,previewUrl:i,productionUrl:l,fastPreviewActive:c});for(const S of h){if(S.kind==="committed"){const x=await j();if(x.kind==="data")return x.data;continue}const g=await p(S.baseUrl);if(g)return g}const v=new Error("live meta unavailable (dev server down, no committed snapshot, no production fallback)");throw v.status=502,v},n[4]=c,n[5]=s,n[6]=o,n[7]=t,n[8]=i,n[9]=l,n[10]=d):d=n[10];const u=!!t,f=e?.refetchInterval;let b;n[11]!==c?(b=(p,j)=>(c||j.status!==502)&&p<3,n[11]=c,n[12]=b):b=n[12];let m;return n[13]!==L||n[14]!==d||n[15]!==u||n[16]!==f||n[17]!==b?(m={queryKey:L,queryFn:d,enabled:u,refetchInterval:f,refetchIntervalInBackground:!1,staleTime:3e5,retry:b,retryDelay:br},n[13]=L,n[14]=d,n[15]=u,n[16]=f,n[17]=b,n[18]=m):m=n[18],$0(m)}function br(t){return zt(5e3,1e3,t,2,0)}async function jr(t){const e=new URL("/live/_meta",t).href,n=await fetch(e,{cache:"no-store"}).catch(Sr);if(!n?.ok)return null;try{return await n.json()}catch{return null}}function Sr(){return null}function de(t,e,n){const s=n[t];return typeof s?.name=="string"&&s.name||t.replace(/[-_]/g," ").replace(/\b\w/g,i=>i.toUpperCase())||`Section ${e+1}`}function w5(t,e){return t.map((n,s)=>{const i=n.__resolveType??"",o=v9(i);if(!o&&i!==""&&D9(i)&&i in e)return{index:s,resolveType:i,label:de(i,s,e),isLazy:!1,isSavedBlock:!0};const l=o?n.section:void 0,a=o?l?.__resolveType??"":i;if(a===J9||a===Z9){const L=o?l:n,d=Array.isArray(L?.variants)?L.variants:[];if(d.length===1&&(d[0]?.rule?.__resolveType??"")===S0){const b=d[0]?.value??{};let m=b.__resolveType??"";const p=v9(m);let j=b;if(p){const h=b.section;m=h?.__resolveType??m,h&&(j=h)}if(m===J9||m===Z9){const v=(Array.isArray(j.variants)?j.variants:[])[0]?.value?.__resolveType,S=v?b9(v):"Section";return{index:s,resolveType:i,label:`Variants of ${S}`,isHidden:!0,isLazy:p}}return m!==""&&D9(m)&&m in e?{index:s,resolveType:i,label:de(m,s,e),isHidden:!0,isLazy:p,isSavedBlock:!0}:{index:s,resolveType:i,label:b9(m)||`Section ${s+1}`,isHidden:!0,isLazy:p}}const u=d[0]?.value?.__resolveType,f=u?b9(u):"Section";return{index:s,resolveType:i,label:`Variants of ${f}`,isMultivariate:!0,isLazy:o}}const c=o?n.section?.__resolveType??i:i;return o&&c!==""&&D9(c)&&c in e?{index:s,resolveType:i,label:de(c,s,e),isLazy:!0,isSavedBlock:!0}:{index:s,resolveType:i,label:b9(c)||`Section ${s+1}`,isLazy:o}})}function An(t){const e=t.__resolveType??"";return v9(e)?t.section??t:t}function B0(t){const i=(v9(t.__resolveType??"")?t.section:t)?.variants?.[0];return i?.rule?.__resolveType!==S0?null:i?.value??null}function E5(t){const e=An(t);return{__resolveType:Z9,variants:[{value:e,rule:{__resolveType:S0}}]}}function M5(t){const e=t.__resolveType??"";if(!e)return null;if(v9(e))return t.section??null;const n=B0(t);return n?v9(n.__resolveType??"")?n:{__resolveType:tt,section:An(n)}:{__resolveType:tt,section:t}}function M0(t){const e=t.__resolveType??"";if(!e)return null;if(v9(e)){const n=t.section,s=n?.__resolveType??"";return!s||!n?null:{resolveType:s,data:n}}return{resolveType:e,data:t}}function P5(t){const e=B0(t);if(e)return M0(e);if(v9(t.__resolveType??"")){const s=t.section;if(!s)return null;const i=B0(s);return M0(i||s)}return M0(t)}function R5(t){return B0(t)}const kr=["website/matchers/always.ts","$live/matchers/MatchAlways.ts"];function $e(t){if(!t)return!1;const e=t.__resolveType??"";return e===""?Object.keys(t).length===0:kr.includes(e)||e.includes("always")}function Tr(t){const e=t.variants??[];if(e.length===0)return-1;const n=e.findIndex(s=>$e(s.rule));return n!==-1?n:e.length-1}function I5(t,e,n){const s=n.variants??[];if(s.length===0)return null;const i=Tr(n),o=s[i]?.value;if(!o)return null;const l=structuredClone(o);return e.isLazy?{...t,section:l}:l}function wn(t,e){return e.isMultivariate?e.isLazy?t.section??null:t:null}function F5(t,e){return Array.isArray(t.variants)?t.variants.map((n,s)=>({label:e(n.rule)||`Variant ${s+1}`,value:n.value??{},rule:n.rule})):[]}function O5(t,e){const n=t.__resolveType??"";if(!n)return null;if(v9(n)){const s=t.section??t,i=s.__resolveType??n;if(!i.includes("/")&&i in e){const o=e[i]??{};return{data:{...o},resolveType:o.__resolveType??i}}return{data:{...s},resolveType:i}}if(!n.includes("/")&&n in e){const s=e[n]??{};return{data:{...s},resolveType:s.__resolveType??n}}return{data:{...t},resolveType:n}}function Nr(t,e){const n=t.__resolveType??"";return v9(n)?{...t,section:e}:e}function _r(t,e,n){return e.isLazy?{...t,section:n}:n}function D5(t,e,n){const s=[...t.variants??[]],i=s[e];if(!i)return t;const o=i.value??{};return s[e]={...i,value:Nr(o,n)},{...t,variants:s}}function $5(t,e,n){const s=[...t.variants??[]];return s[e]?(s[e]={...s[e],rule:n},{...t,variants:s}):t}function z5(t,e){const n=[...t.variants??[]],s=n[e];return s?(n.splice(e+1,0,structuredClone(s)),{...t,variants:n}):t}function B5(t,e,n){const s=[...t.variants??[]];if(e===n||e<0||n<0||e>=s.length||n>=s.length)return t;const[i]=s.splice(e,1);return i?(s.splice(n,0,i),{...t,variants:s}):t}function V5(t,e){const n=[...t.variants??[]];return n.length<=1?null:(n.splice(e,1),{...t,variants:n})}function ve(t){return{rule:o0(),value:structuredClone(t)}}function En(t,e){return{...e,__resolveType:Z9,variants:t}}function U5(t){return t.isHidden!==!0&&t.isSavedBlock!==!0}function Cr(t,e){if(e.isHidden)return null;if(e.isMultivariate){const s=wn(t,e)?.variants??[],i=s[s.length-1]?.value;return i?structuredClone(i):null}if(e.isLazy){const n=t.section;return n?structuredClone(n):null}return structuredClone(t)}function Ar(t,e,n){if(e.isMultivariate||e.isHidden)return null;const s=Cr(t,e);if(!s)return null;const i=En([ve(s),ve(s)]);return e.isLazy?{...t,section:i}:i}function K5(t,e,n){if(e.isHidden||e.isSavedBlock)return null;if(e.isMultivariate){const i=wn(t,e);if(!i)return null;const o=i.variants??[],l=o[o.length-1]?.value;if(!l)return null;const a=En([...o,ve(l)],i);return{section:_r(t,e,a),newVariantIndex:o.length}}const s=Ar(t,e);return s?{section:s,newVariantIndex:1}:null}const wr=new Set(["website/pages/Page.tsx","$live/pages/LivePage.tsx"]);function oe(t){return t.anyOfRefs?.some(e=>e.resolveType!==J9?!1:e.schema?.properties?.variants?.items?.properties?.value?.type==="array")??!1}function Er(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;const e=t;return e.__resolveType===Z9&&Array.isArray(e.variants)}function V0(t){return!t||typeof t!="object"||Array.isArray(t)?!1:t.__resolveType===J9}function Mr(t){if(!V0(t))return null;const e=t.variants;if(!Array.isArray(e))return null;const n=e[0]?.value;return Array.isArray(n)?n:null}function Pr(t,e){if(!V0(t))return e;const n=structuredClone(t),s=[...n.variants??[]];return s.length===0?s.push({rule:o0(),value:e}):s[0]={...s[0],value:e},{...n,variants:s}}function Rr(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;const e=t;return typeof e.__resolveType=="string"&&wr.has(e.__resolveType)&&typeof e.path=="string"}function G5(t,e){const s=t[e]?.sections;if(!s||Array.isArray(s))return 1;const i=s;return Array.isArray(i.variants)?i.variants.length:1}function H5(t,e,n){const i=t[e]?.sections;if(Array.isArray(i))return n===0?i:[];if(i&&typeof i=="object"){const o=i.variants;if(Array.isArray(o)){const l=o[n];return Array.isArray(l?.value)?l.value:[]}}return[]}function Ir(t,e,n){if(Array.isArray(t))return[{label:"Default",sections:t}];if(t&&typeof t=="object"){const s=t;if(Array.isArray(s.variants)){const i=s.variants,o=i.map(c=>hr(c.rule,e,n)),l=o.reduce((c,L)=>(c[L]=(c[L]??0)+1,c),{}),a={};return i.map((c,L)=>{const d=o[L]??`Variant ${L+1}`,u=l[d]??1;let f=d;return u>1&&(a[d]=(a[d]??0)+1,f=`${d} ${a[d]}`),{label:f||`Variant ${L+1}`,sections:Array.isArray(c.value)?c.value:[],rule:c.rule}})}}return[]}function m0(t){return{rule:o0(),value:t}}function r0(t,e){return{...e,__resolveType:J9,variants:t}}function q5(t,e){const n=structuredClone(e);if(Array.isArray(t))return r0([m0(t),m0(n)]);if(t&&typeof t=="object"){const s=t;return Array.isArray(s.variants)?r0([...s.variants,m0(n)],s):null}return r0([m0([]),m0(n)])}function W5(t){const e=t.variants;return Array.isArray(e)?e.length-1:1}function Y5(t,e){const n=t[e];if(!n)return null;const s=[...t];return s.splice(e+1,0,structuredClone(n)),s}function J5(t,e){if(e.length===0)return r0([],t);if(e.length===1){const n=e[0],s=n?.rule;if(!$e(s))return r0(e,t);if(Array.isArray(n?.value))return n.value}return r0(e,t)}function Fr(t,e){for(const[n,s]of Object.entries(t)){if(!Rr(s))continue;const i=s.sections;if(Array.isArray(i)){e(void 0,n,0);continue}if(!i||typeof i!="object")continue;const o=i.variants;if(Array.isArray(o))for(let l=0;l<o.length;l++){const a=o[l];e(a?.rule,n,l)}}}function Z5(t,e,n){let s=0;return Fr(t,i=>{if(!i)return;(i.__resolveType??"")===e&&w0(i,t,n)&&s++}),s}const Or={provision:0,cloning:1,install:2,dev:3};function Dr(t){return Or[t.step]}const lt=48,Mn=28,Pn=3,$r=(()=>{const t=[];let e=0;for(let n=0;n<lt;n++)n===Mn?t.push(null):(t.push(e/(lt-1)*Pn),e++);return t})();function zr(t){return{provision:t("sandbox.bootingVisual.phaseProvision"),cloning:t("sandbox.bootingVisual.phaseCloning"),install:t("sandbox.bootingVisual.phaseInstall"),dev:t("sandbox.bootingVisual.phaseDev")}}function Br(t,e,n){return t.step==="provision"&&e!=null&&e.kind!=="ready"&&e.kind!=="failed"?Ks[e.kind].long:n[t.step]}const O9="bg-foreground/[0.05]",E9="bg-foreground/[0.09]",Vr=Array.from({length:35},()=>Math.random()*1.8),Ur=Array.from({length:35},()=>Math.random()<.4);function Kr(t){const e=q.c(31),{progress:n,claimPhase:s}=t,i=l9();let o;e[0]!==n?(o=Dr(n),e[0]=n,e[1]=o):o=e[1];const l=o;let a;e[2]!==s||e[3]!==n||e[4]!==i?(a=Br(n,s,zr(i)),e[2]=s,e[3]=n,e[4]=i,e[5]=a):a=e[5];const c=a;let L;e[6]===Symbol.for("react.memo_cache_sentinel")?(L=r.jsx(u1,{}),e[6]=L):L=e[6];const d=`${n.step}-${c}`;let u;e[7]!==c||e[8]!==d?(u=r.jsxs("div",{className:"flex items-center gap-2 rounded-full border border-foreground/10 bg-background px-3.5 py-1.5 shadow-[0_4px_20px_-4px_rgb(0_0_0_/_0.12)]",children:[L,r.jsxs("span",{className:"animate-in fade-in text-[13px] font-medium text-foreground/85 duration-500",children:[c,"…"]},d)]}),e[7]=c,e[8]=d,e[9]=u):u=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=r.jsx(Gr,{}),e[10]=f):f=e[10];let b;e[11]!==l?(b=r.jsx(P0,{phase:0,current:l,children:f}),e[11]=l,e[12]=b):b=e[12];let m;e[13]===Symbol.for("react.memo_cache_sentinel")?(m=r.jsx(qr,{}),e[13]=m):m=e[13];let p;e[14]!==l?(p=r.jsx(P0,{phase:1,current:l,children:m}),e[14]=l,e[15]=p):p=e[15];let j;e[16]===Symbol.for("react.memo_cache_sentinel")?(j=r.jsx(Wr,{}),e[16]=j):j=e[16];let h;e[17]!==l?(h=r.jsx(P0,{phase:2,current:l,children:j}),e[17]=l,e[18]=h):h=e[18];let v;e[19]===Symbol.for("react.memo_cache_sentinel")?(v=r.jsx(Jr,{}),e[19]=v):v=e[19];let S;e[20]!==l?(S=r.jsx(P0,{phase:3,current:l,children:v}),e[20]=l,e[21]=S):S=e[21];let g;e[22]!==h||e[23]!==S||e[24]!==b||e[25]!==p?(g=r.jsxs("div",{className:"relative aspect-[4/3] w-[min(78%,560px)]",children:[b,p,h,S]}),e[22]=h,e[23]=S,e[24]=b,e[25]=p,e[26]=g):g=e[26];let x;e[27]===Symbol.for("react.memo_cache_sentinel")?(x=r.jsx("style",{children:`
2
2
  @keyframes vm-pulse-soft {
3
3
  0%, 100% { opacity: 0.25; }
4
4
  50% { opacity: 1; }
@@ -1,2 +1,2 @@
1
- import{n as G,r as o,de as Ce,dc as De,c as Pe,e as Ae,d8 as ee,M as Ee,j as ye,K as Y,x as _e}from"./index-Cjhl57C5.js";import{u as Le}from"./use-mcp-client-Bf0VpOBw.js";import{u as Ue}from"./use-session-runtime--RMOkDN5.js";import{u as Re,b as Oe}from"./chat-context-H28jTcB6.js";import{u as Be}from"./hooks-D5z7CgCt.js";import{e as ge}from"./backoff-8mStPHYB.js";import{b as Ne}from"./sandbox-url-D3mC8qhT.js";import{a as Fe}from"./use-virtual-mcp-BvrPyGzX.js";import{d as $e}from"./sandbox-start-errors-BK_aDCyt.js";function Ke(e,t){const n=G(t);return Ve({filters:{...e,status:"pending"}},n).length}function fe(e,t){return e.findAll(t.filters).map(n=>t.select?t.select(n):n.state)}function Ve(e={},t){const n=G(t).getMutationCache(),s=o.useRef(e),u=o.useRef(null);return u.current===null&&(u.current=fe(n,e)),o.useEffect(()=>{s.current=e}),o.useSyncExternalStore(o.useCallback(c=>n.subscribe(()=>{const a=Ce(u.current,fe(n,s.current));u.current!==a&&(u.current=a,De.schedule(c))}),[n]),()=>u.current,()=>u.current)}async function qe(e,t,n){const s=await e.callTool({name:t,arguments:n});if(s.isError){const u=s.content?.[0]?.text??`Tool ${t} failed without a message`;throw new Error(u)}return s}const be=["SANDBOX_START"],W=new Map,He=e=>`${e.virtualMcpId}::${e.branch??""}`,Me=e=>e.message.includes("retry shortly"),ie=new Set,le={mark:(e,t)=>ie.add(`${e}::${t}`),clear:(e,t)=>ie.delete(`${e}::${t}`),isStopped:(e,t)=>ie.has(`${e}::${t}`)};function Qe(e,t){const n=G();return Ae({mutationKey:be,retry:(s,u)=>Me(u)&&s<6,retryDelay:s=>ge(5e3,500,s,2,0),mutationFn:async s=>{s.branch&&le.clear(s.virtualMcpId,s.branch);const u=He(s),c=W.get(u);if(c)return c;const a=(async()=>(await qe(e,"SANDBOX_START",s)).structuredContent)();W.set(u,a);try{return await a}finally{W.get(u)===a&&W.delete(u)}},onSuccess:()=>{ee(n),t?.onStarted?.()}})}function Rt(e,t){const n=Pe.c(3);let s;return n[0]!==t||n[1]!==e?(s={mutationKey:be,predicate:c=>{if(!e)return!1;const a=c.state.variables;return!a||a.virtualMcpId!==e?!1:(a.branch??"")===(t??"")}},n[0]=t,n[1]=e,n[2]=s):s=n[2],Ke(s)>0}function Se(e){return e==="installing"||e==="install-failed"||e==="starting"||e==="start-failed"||e==="running"||e==="crashed"}const Ye={phase:null,lifecycle:{phase:"idle"},status:{state:"running"},branch:{kind:"unknown"},notFound:!1,scripts:[],activeProcesses:[],getBuffer:()=>"",hasData:()=>!1,subscribeChunks:()=>()=>{},subscribeReload:()=>()=>{}},ve=o.createContext(Ye),me=16384;class Ge{data="";append(t){this.data+=t,this.data.length>me&&(this.data=this.data.slice(this.data.length-me))}get(){return this.data}clear(){this.data=""}}const Xe=1e3,je=3e4,Ie=3e3,he=["lifecycle","status","tasks","scripts","branch","reload","file-changed"],pe="log";function Je(e){if(!e)return null;try{return new URL("/_sandbox/events",e).href}catch{return null}}function We(e){return e===404}async function ze(e){try{const t=await fetch(e,{headers:{Accept:"text/event-stream"},cache:"no-store",signal:AbortSignal.timeout(Ie)});return await t.body?.cancel().catch(()=>{}),We(t.status)}catch{return!1}}function gt({virtualMcpId:e,branch:t,previewUrl:n=null,enabled:s=!0,children:u}){const{org:c}=Ee(),a=G(),V=Re()?.taskId??null,[X,E]=o.useState(null),[te,b]=o.useState({phase:"idle"}),[ne,U]=o.useState({state:"running"}),[re,y]=o.useState({kind:"unknown"}),[j,h]=o.useState(!1),[k,q]=o.useState([]),[se,R]=o.useState([]),[,H]=o.useState(0),v=o.useRef(new Map),O=o.useRef(new Set),w=o.useRef(new Set),C=o.useRef(null),p=Je(n),M=Fe(e)?.metadata?.runtime?.selected==="deno",_=d=>{let S=v.current.get(d);return S||(S=new Ge,v.current.set(d,S)),S};o.useEffect(()=>{if(E(null),b({phase:"idle"}),U({state:"running"}),y({kind:"unknown"}),C.current=null,h(!1),q([]),R([]),v.current.clear(),!e||!t||!s)return;const d=Ne({orgSlug:c.slug,virtualMcpId:e,branch:t,threadId:V??null},"events");let S=!1,D=0,L=null,T=null,P=null,g=null,m=null,A=null;const I=r=>{try{const i=JSON.parse(r.data);E(i),i.kind!=="failed"&&(h(!1),D=0),i.kind==="ready"&&ae()}catch(i){console.warn("[vm-events] bad phase payload",i)}},B=()=>{h(!0),E(null),b({phase:"idle"}),U({state:"running"}),y({kind:"unknown"}),q([]),R([]),v.current.clear()},Q=r=>{try{const i=JSON.parse(r.data);if(typeof i.data!="string")return;D=0;const f=i.data.replace(/\r?\n/g,`\r
1
+ import{n as G,r as o,de as Ce,dc as De,c as Pe,e as Ae,d8 as ee,M as Ee,j as ye,K as Y,x as _e}from"./index-z4bKt11m.js";import{u as Le}from"./use-mcp-client-B1u2B39v.js";import{u as Ue}from"./use-session-runtime-DU2zS-3V.js";import{u as Re,b as Oe}from"./chat-context-BBVkwd3p.js";import{u as Be}from"./hooks-CkL4R3Tj.js";import{e as ge}from"./backoff-8mStPHYB.js";import{b as Ne}from"./sandbox-url-D3mC8qhT.js";import{a as Fe}from"./use-virtual-mcp-Bq1RMGPF.js";import{d as $e}from"./sandbox-start-errors-BK_aDCyt.js";function Ke(e,t){const n=G(t);return Ve({filters:{...e,status:"pending"}},n).length}function fe(e,t){return e.findAll(t.filters).map(n=>t.select?t.select(n):n.state)}function Ve(e={},t){const n=G(t).getMutationCache(),s=o.useRef(e),u=o.useRef(null);return u.current===null&&(u.current=fe(n,e)),o.useEffect(()=>{s.current=e}),o.useSyncExternalStore(o.useCallback(c=>n.subscribe(()=>{const a=Ce(u.current,fe(n,s.current));u.current!==a&&(u.current=a,De.schedule(c))}),[n]),()=>u.current,()=>u.current)}async function qe(e,t,n){const s=await e.callTool({name:t,arguments:n});if(s.isError){const u=s.content?.[0]?.text??`Tool ${t} failed without a message`;throw new Error(u)}return s}const be=["SANDBOX_START"],W=new Map,He=e=>`${e.virtualMcpId}::${e.branch??""}`,Me=e=>e.message.includes("retry shortly"),ie=new Set,le={mark:(e,t)=>ie.add(`${e}::${t}`),clear:(e,t)=>ie.delete(`${e}::${t}`),isStopped:(e,t)=>ie.has(`${e}::${t}`)};function Qe(e,t){const n=G();return Ae({mutationKey:be,retry:(s,u)=>Me(u)&&s<6,retryDelay:s=>ge(5e3,500,s,2,0),mutationFn:async s=>{s.branch&&le.clear(s.virtualMcpId,s.branch);const u=He(s),c=W.get(u);if(c)return c;const a=(async()=>(await qe(e,"SANDBOX_START",s)).structuredContent)();W.set(u,a);try{return await a}finally{W.get(u)===a&&W.delete(u)}},onSuccess:()=>{ee(n),t?.onStarted?.()}})}function Rt(e,t){const n=Pe.c(3);let s;return n[0]!==t||n[1]!==e?(s={mutationKey:be,predicate:c=>{if(!e)return!1;const a=c.state.variables;return!a||a.virtualMcpId!==e?!1:(a.branch??"")===(t??"")}},n[0]=t,n[1]=e,n[2]=s):s=n[2],Ke(s)>0}function Se(e){return e==="installing"||e==="install-failed"||e==="starting"||e==="start-failed"||e==="running"||e==="crashed"}const Ye={phase:null,lifecycle:{phase:"idle"},status:{state:"running"},branch:{kind:"unknown"},notFound:!1,scripts:[],activeProcesses:[],getBuffer:()=>"",hasData:()=>!1,subscribeChunks:()=>()=>{},subscribeReload:()=>()=>{}},ve=o.createContext(Ye),me=16384;class Ge{data="";append(t){this.data+=t,this.data.length>me&&(this.data=this.data.slice(this.data.length-me))}get(){return this.data}clear(){this.data=""}}const Xe=1e3,je=3e4,Ie=3e3,he=["lifecycle","status","tasks","scripts","branch","reload","file-changed"],pe="log";function Je(e){if(!e)return null;try{return new URL("/_sandbox/events",e).href}catch{return null}}function We(e){return e===404}async function ze(e){try{const t=await fetch(e,{headers:{Accept:"text/event-stream"},cache:"no-store",signal:AbortSignal.timeout(Ie)});return await t.body?.cancel().catch(()=>{}),We(t.status)}catch{return!1}}function gt({virtualMcpId:e,branch:t,previewUrl:n=null,enabled:s=!0,children:u}){const{org:c}=Ee(),a=G(),V=Re()?.taskId??null,[X,E]=o.useState(null),[te,b]=o.useState({phase:"idle"}),[ne,U]=o.useState({state:"running"}),[re,y]=o.useState({kind:"unknown"}),[j,h]=o.useState(!1),[k,q]=o.useState([]),[se,R]=o.useState([]),[,H]=o.useState(0),v=o.useRef(new Map),O=o.useRef(new Set),w=o.useRef(new Set),C=o.useRef(null),p=Je(n),M=Fe(e)?.metadata?.runtime?.selected==="deno",_=d=>{let S=v.current.get(d);return S||(S=new Ge,v.current.set(d,S)),S};o.useEffect(()=>{if(E(null),b({phase:"idle"}),U({state:"running"}),y({kind:"unknown"}),C.current=null,h(!1),q([]),R([]),v.current.clear(),!e||!t||!s)return;const d=Ne({orgSlug:c.slug,virtualMcpId:e,branch:t,threadId:V??null},"events");let S=!1,D=0,L=null,T=null,P=null,g=null,m=null,A=null;const I=r=>{try{const i=JSON.parse(r.data);E(i),i.kind!=="failed"&&(h(!1),D=0),i.kind==="ready"&&ae()}catch(i){console.warn("[vm-events] bad phase payload",i)}},B=()=>{h(!0),E(null),b({phase:"idle"}),U({state:"running"}),y({kind:"unknown"}),q([]),R([]),v.current.clear()},Q=r=>{try{const i=JSON.parse(r.data);if(typeof i.data!="string")return;D=0;const f=i.data.replace(/\r?\n/g,`\r
2
2
  `);_(i.source).append(f);for(const l of O.current)try{l(i.source,f)}catch{}H(l=>l+1)}catch{}},J=r=>{const i=r.type;try{const f=JSON.parse(r.data);switch(D=0,i){case"lifecycle":{const l=f;b(l.state);const F=`${c.slug}/${e}/${t}`;if(Se(l.state.phase)&&!(A&&Se(A))){ee(a,c.id);const K=Y.decofile(F);a.getQueryData(K)===void 0&&a.invalidateQueries({queryKey:K})}l.state.phase==="running"&&A!=="running"&&(ee(a,c.id),a.invalidateQueries({queryKey:Y.decofile(F)}),a.invalidateQueries({queryKey:Y.liveMeta(c.slug,e,t)})),A=l.state.phase;const $=l.state.phase==="running"?l.state.port:null,ce=C.current;if(C.current=$,ce!==null&&$!==null&&ce!==$)for(const K of w.current)try{K()}catch{}return}case"status":U(f);return;case"tasks":{const F=f.active.map($=>$.logName??"").filter(Boolean);R(F);return}case"scripts":q(f.scripts);return;case"branch":{const l=f.meta;y(l);return}case"reload":for(const l of w.current)try{l()}catch{}return;case"file-changed":{const{path:l}=f,F=`${c.slug}/${e}/${t}`;if(l.startsWith(".deco/")||l.includes("/.deco/")){if(!(A==="running"))return;P&&clearTimeout(P),P=setTimeout(()=>{if(P=null,a.invalidateQueries({queryKey:Y.decofile(F)}),M)for(const K of w.current)try{K()}catch{}},500)}else T&&clearTimeout(T),T=setTimeout(()=>{T=null,a.invalidateQueries({queryKey:Y.liveMeta(c.slug,e,t)})},1e3);return}}}catch{}};function N(){if(S)return;const r=new EventSource(d);g=r,r.onopen=()=>{},r.onerror=()=>{g===r&&r.readyState===EventSource.CLOSED&&x("studio")},r.addEventListener("phase",I),r.addEventListener("gone",B),r.addEventListener(pe,Q);for(const i of he)r.addEventListener(i,J)}function ae(){if(S||!p||m)return;const r=new EventSource(p);m=r;let i=!1;r.onopen=()=>{if(S||m!==r)return;i=!0,D=0;const f=g;g=null,f?.close()},r.onerror=()=>{m===r&&r.readyState===EventSource.CLOSED&&ue(r,i)},r.addEventListener(pe,Q);for(const f of he)r.addEventListener(f,J)}async function ue(r,i){const f=p?await ze(p):!1;if(!(S||m!==r)){if(r.close(),m=null,f){B(),g||N();return}i&&x("direct")}}function x(r){if(S||L)return;const i=ge(je,Xe,D,2,0);D++,L=setTimeout(()=>{if(L=null,!S){if(r==="direct"){m?.close(),m=null,ae();return}g?.close(),g=null,N()}},i)}return N(),()=>{S=!0,g?.close(),m?.close(),L&&clearTimeout(L),T&&clearTimeout(T),P&&clearTimeout(P)}},[e,t,c.slug,s,V,p,a,M]);const oe={phase:X,lifecycle:te,status:ne,branch:re,notFound:j,scripts:k,activeProcesses:se,getBuffer:d=>v.current.get(d)?.get()??"",hasData:d=>(v.current.get(d)?.get().length??0)>0,subscribeChunks:d=>(O.current.add(d),()=>{O.current.delete(d)}),subscribeReload:d=>(w.current.add(d),()=>{w.current.delete(d)})};return ye.jsx(ve,{value:oe,children:u})}function de(){return o.use(ve)}function bt(e){const{subscribeChunks:t}=de(),n=o.useRef(e);n.current=e,o.useEffect(()=>t((c,a)=>{n.current?.(c,a)}),[t])}function vt(e){const{subscribeReload:t}=de(),n=o.useRef(e);n.current=e,o.useEffect(()=>t(()=>{n.current?.()}),[t])}function Ze(e){return e.appPaused||e.userStopped?{kind:"suspended"}:e.startError&&!e.previewUrl?{kind:"errored",error:e.startError}:e.previewUrl?{kind:"iframe",previewUrl:e.previewUrl}:{kind:"starting"}}function et(e){return e.executionEnabled&&e.sessionRuntime==="sandbox"&&e.hasActiveGithubRepo&&!!e.userId&&!!e.branch&&!e.vmEntry&&!e.userStopped&&!e.isPending&&!e.attempted}function wt(e){return e.threadLoaded&&e.isOwner&&e.hasActiveGithubRepo&&!e.branch&&!e.attempted}function tt(e){return e.executionEnabled&&e.notFound&&!!e.deadVmId&&!e.isPending&&!e.userStopped&&e.deadVmId!==e.lastDeadVmId}function Tt(e){const{agentSandboxMap:t,threadSandboxMap:n,userId:s,branch:u}=e,c=e.ownerId??s;if(!s||!c||!u)return t;const a=n?.[c]?.[u];return a?{...t??{},[s]:{...t?.[s]??{},[u]:a}}:t}function z(e,t,n){const s={virtualMcpId:e};return t&&(s.branch=t),n&&(s.threadId=n),s}const we=2,nt=new Set(["scheduling-timeout","reconciler-error","claim-never-created","unknown"]);function Te(e){return nt.has(e)}function rt(e){return e.executionEnabled&&e.failedReason!==null&&Te(e.failedReason)&&e.attempts<we&&!e.isPending&&!e.userStopped&&!e.alreadyHandled}const st={branch:null,count:0,handled:!1};function ot(e,t){return e.branch===t?e:{branch:t,count:0,handled:!1}}function at(e){return e.mutationError?e.mutationError:e.phase?.kind==="failed"&&!e.startPending&&e.claimRetryExhausted?{code:null,message:e.phase.message}:null}function ut(e){switch(e.kind){case"suspended":return"suspended";case"iframe":return"running";case"starting":return"starting";case"errored":return"errored"}}function xe(e,t){return`${e??""}::${t??""}`}function ct(e){const t=e.vmEntry?.previewUrl??null;return t||(e.seeded?.key===e.key?e.seeded.url:null)}function Z(e){const{data:t,virtualMcpId:n,branch:s}=e;t?.branch&&!s&&e.setCurrentTaskBranch(t.branch),t?.previewUrl&&e.setSeededPreviewUrl({key:xe(n,t.branch??s),url:t.previewUrl})}const it={branch:null,previewState:{kind:"starting"},status:"idle",vmEntry:null,previewUrl:null,userStopped:!1,start:()=>{},stop:async()=>{},restart:async()=>{},retry:()=>{},resume:()=>{}},ke=o.createContext(it);function xt(){return o.use(ke)}function kt({executionEnabled:e,virtualMcpId:t,branch:n,userId:s,hasActiveGithubRepo:u,vmEntry:c,threadId:a,children:V}){const{org:X}=Ee(),{setCurrentTaskBranch:E}=Oe(),te=Be(),b=de(),ne=G(),U=Ue(t),re=U.resolved?U.runtime:null,y=Re()?.taskId??null,j=Le({connectionId:_e,orgId:X.id,orgSlug:X.slug}),h=Qe(j,{onStarted:()=>{a&&te?.refreshThreadMetadata(a)}}),{mutate:k,reset:q}=h,[se,R]=o.useState(null),H=o.useRef(new Set),v=o.useRef(null),[O,w]=o.useState(st),C=ot(O,n);C!==O&&w(C);const p=b.phase?.kind==="failed"?b.phase:null,M=ct({vmEntry:c,seeded:p?null:se,key:xe(t,n)}),_=!!t&&!!n&&le.isStopped(t,n),oe=b.status.state==="paused",d=!p||!Te(p.reason)||C.count>=we,S=at({mutationError:h.isError&&h.error?$e(h.error.message):null,phase:b.phase,startPending:h.isPending,claimRetryExhausted:d}),D=Ze({previewUrl:M,appPaused:oe,userStopped:_,startError:S}),L=ut(D),T=n??"",P=H.current.has(T),g=et({executionEnabled:e,hasActiveGithubRepo:u,userId:s,branch:n,vmEntry:c,userStopped:_,isPending:h.isPending,attempted:P,sessionRuntime:re});o.useEffect(()=>{if(!g||!t)return;H.current.add(T);const x=z(t,n,y);k(x,{onSuccess:r=>{Z({data:r,virtualMcpId:t,branch:n,setCurrentTaskBranch:E,setSeededPreviewUrl:R})},onError:r=>{console.error("[sandbox-lifecycle] auto-start failed:",r)}})},[g,T,n,t,y,k,E,R]);const m=b.notFound?c?.sandboxHandle??null:null,A=tt({executionEnabled:e,notFound:b.notFound,deadVmId:m,lastDeadVmId:v.current,isPending:h.isPending,userStopped:_});o.useEffect(()=>{if(!A||!m||!t)return;v.current=m;const x=z(t,n,y);k(x,{onSuccess:r=>{Z({data:r,virtualMcpId:t,branch:n,setCurrentTaskBranch:E,setSeededPreviewUrl:R})},onError:r=>{console.error("[sandbox-lifecycle] self-heal failed:",r)}})},[A,m,t,n,y,k,E,R]);const I=rt({executionEnabled:e,failedReason:p?.reason??null,attempts:C.count,isPending:h.isPending,userStopped:_,alreadyHandled:C.handled});o.useEffect(()=>{if(!p){w(r=>r.handled?{...r,handled:!1}:r);return}if(!I||!t)return;w(r=>({...r,handled:!0,count:r.count+1}));const x=z(t,n,y);k(x,{onSuccess:r=>{Z({data:r,virtualMcpId:t,branch:n,setCurrentTaskBranch:E,setSeededPreviewUrl:R})},onError:r=>{console.error("[sandbox-lifecycle] claim auto-retry failed:",r)}})},[p,I,t,n,y,k,E,R]);const B=()=>{if(!e||!t)return;const x=z(t,n,y);k(x,{onSuccess:r=>{Z({data:r,virtualMcpId:t,branch:n,setCurrentTaskBranch:E,setSeededPreviewUrl:R})},onError:r=>{console.error("[sandbox-lifecycle] user start failed:",r)}})},Q=async()=>{if(!(!e||!t||!n)&&c){le.mark(t,n);try{await j.callTool({name:"SANDBOX_DELETE",arguments:{virtualMcpId:t,branch:n}})}catch{}ee(ne)}},J=async()=>{await Q(),B()},N=()=>{H.current=new Set,v.current=null,w({branch:n,count:0,handled:!1}),q(),B()},ue={branch:n,previewState:D,status:L,vmEntry:c,previewUrl:M,userStopped:_,start:B,stop:Q,restart:J,retry:N,resume:N};return ye.jsx(ke,{value:ue,children:V})}export{gt as S,kt as a,Qe as b,de as c,xt as d,bt as e,vt as f,Ke as g,Tt as o,wt as s,Rt as u};