decocms 4.491.3 → 4.492.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (507) hide show
  1. package/dist/client/assets/{ActiveShapeUtils-CO9ka_yi.js → ActiveShapeUtils-QC-80JaD.js} +1 -1
  2. package/dist/client/assets/{AlertCircle-C3fpFT5I.js → AlertCircle--xQnBD7d.js} +1 -1
  3. package/dist/client/assets/{AreaChart-BvjH9pmK.js → AreaChart-DcLcpJwq.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-C1IFj0Ic.js → ArrowLeft-CYC7J9yW.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-DR-Jhbl1.js → ArrowUp-U1ggjjLO.js} +1 -1
  6. package/dist/client/assets/{BarChart-CJ_IiQ71.js → BarChart-C6ZU6W4p.js} +1 -1
  7. package/dist/client/assets/{Building02-uHT4KVtK.js → Building02-HV2PP9yH.js} +1 -1
  8. package/dist/client/assets/{CategoricalChart-zte0bRec.js → CategoricalChart-BlJZ99ma.js} +1 -1
  9. package/dist/client/assets/{CheckCircle-BKHstO_Q.js → CheckCircle-drYdikgt.js} +1 -1
  10. package/dist/client/assets/{ChevronSelectorVertical-DAO6R1Op.js → ChevronSelectorVertical-DFKb4uq6.js} +1 -1
  11. package/dist/client/assets/{ChevronUp-CceLPRrE.js → ChevronUp-DZuLpYB1.js} +1 -1
  12. package/dist/client/assets/{Copy01-Dx3ZT0bA.js → Copy01-D4AqaFnb.js} +1 -1
  13. package/dist/client/assets/{CreditCard01-Dko0T335.js → CreditCard01-BsSJIpnP.js} +1 -1
  14. package/dist/client/assets/{DotsVertical-aHYBPlin.js → DotsVertical-BRQyK86q.js} +1 -1
  15. package/dist/client/assets/{ErrorBarContext-B8QqSSmC.js → ErrorBarContext-Du4zoKdZ.js} +1 -1
  16. package/dist/client/assets/{Globe04-BDe-0jS0.js → Globe04-CHyEXekU.js} +1 -1
  17. package/dist/client/assets/{Image01-Cxa392ef.js → Image01-iHUacVtP.js} +1 -1
  18. package/dist/client/assets/{Key01-BHiUNW_5.js → Key01-CZzgEM3b.js} +1 -1
  19. package/dist/client/assets/{Link01-BRZRc4wX.js → Link01-CLZO7iiX.js} +1 -1
  20. package/dist/client/assets/{LinkBroken01-kK_na_OL.js → LinkBroken01-B1PEGLti.js} +1 -1
  21. package/dist/client/assets/{Monitor01-Cl4JLYVa.js → Monitor01-Cp_HdXFf.js} +1 -1
  22. package/dist/client/assets/{Play-CzTcIQz_.js → Play-CFzbBn-6.js} +1 -1
  23. package/dist/client/assets/{Plus-nldAzVeQ.js → Plus-BjGOOPj6.js} +1 -1
  24. package/dist/client/assets/{SearchMd-BiZNveM1.js → SearchMd-8jxREbgM.js} +1 -1
  25. package/dist/client/assets/{Sector-DOgIwKt7.js → Sector-AZp03vzg.js} +1 -1
  26. package/dist/client/assets/{ShoppingBag01-o0DdjJD9.js → ShoppingBag01-C_Zwelnq.js} +1 -1
  27. package/dist/client/assets/{Sun-BYGxydmh.js → Sun-VfgIFUUc.js} +1 -1
  28. package/dist/client/assets/{SwitchHorizontal01-Bx3d-jDI.js → SwitchHorizontal01-f_6gEt2c.js} +1 -1
  29. package/dist/client/assets/{Tool01-Blw6F5iV.js → Tool01-BD6R-D4L.js} +1 -1
  30. package/dist/client/assets/{Trash01-DAoFHSpp.js → Trash01-BuqURrgl.js} +1 -1
  31. package/dist/client/assets/{Upload01-CtKBhqsv.js → Upload01-CbIQEt1I.js} +1 -1
  32. package/dist/client/assets/{User01-Awky2MVQ.js → User01-CHX0WSlv.js} +1 -1
  33. package/dist/client/assets/{UserSquare-BMOlWqCu.js → UserSquare-v2Vi63lF.js} +1 -1
  34. package/dist/client/assets/{Users01-D7ZFKC4W.js → Users01-WUyPxnjn.js} +1 -1
  35. package/dist/client/assets/{XAxis-BLZT-vtl.js → XAxis-DnYEgdBg.js} +1 -1
  36. package/dist/client/assets/{XClose-DBJ7sD1T.js → XClose-Dz5Xu4ap.js} +1 -1
  37. package/dist/client/assets/{ZoomOut-CQckFmS9.js → ZoomOut-BMJlPGPs.js} +1 -1
  38. package/dist/client/assets/{access-gate-DEyXiK2N.js → access-gate-t5XdpP7o.js} +1 -1
  39. package/dist/client/assets/add-connection-dialog-DRVvTqsY.js +1 -0
  40. package/dist/client/assets/agent-analytics-CcVnAkkt.js +2 -0
  41. package/dist/client/assets/agent-app-BkQm9oem.js +1 -0
  42. package/dist/client/assets/agent-assets-Czl2J78n.js +1 -0
  43. package/dist/client/assets/agent-automation-Ci4UFwzb.js +20 -0
  44. package/dist/client/assets/agent-automations-Bz7d9DBh.js +1 -0
  45. package/dist/client/assets/agent-connect-sources-DIyj1Rir.js +1 -0
  46. package/dist/client/assets/agent-deck-3-EO6Xhr.js +1 -0
  47. package/dist/client/assets/agent-e2e-DIxhjk62.js +1 -0
  48. package/dist/client/assets/agent-experiments-Dn8tNUUB.js +1 -0
  49. package/dist/client/assets/agent-file-CZOQf9Yc.js +1 -0
  50. package/dist/client/assets/agent-hosting-BsE9QUz1.js +1 -0
  51. package/dist/client/assets/agent-icon-V8lPNv7A.js +1 -0
  52. package/dist/client/assets/agent-library-DkCo-Ode.js +1 -0
  53. package/dist/client/assets/agent-library-file-D3g_rHVL.js +1 -0
  54. package/dist/client/assets/agent-monitor-pph3rxpK.js +1 -0
  55. package/dist/client/assets/agent-overview-DW2iu_qJ.js +1 -0
  56. package/dist/client/assets/agent-settings-DW_a2Oeo.js +1 -0
  57. package/dist/client/assets/{agent-site-editor-Dv8qh0xB.js → agent-site-editor--h_d0ri-.js} +5 -5
  58. package/dist/client/assets/agent-site-editor-code-DTMSEaFy.js +2 -0
  59. package/dist/client/assets/{agent-site-editor-content-EotWUMUT.js → agent-site-editor-content-B0U6dbmd.js} +6 -6
  60. package/dist/client/assets/{agent-site-editor-preview-DaqE_qX4.js → agent-site-editor-preview-DHCTEFq_.js} +4 -4
  61. package/dist/client/assets/agent-view-BVT0tnMS.js +1 -0
  62. package/dist/client/assets/{agent-view-guard-Bf5Bn5K4.js → agent-view-guard-CiQwzIBH.js} +1 -1
  63. package/dist/client/assets/agents-list-D6RNu5TG.js +1 -0
  64. package/dist/client/assets/{ai-providers-VCM02Z-N.js → ai-providers-CmqZsPDb.js} +2 -2
  65. package/dist/client/assets/{alert-CGA3Ty0D.js → alert-BsNaBF81.js} +1 -1
  66. package/dist/client/assets/{alert-dialog-kjq4dW3k.js → alert-dialog-BTzKubzN.js} +2 -2
  67. package/dist/client/assets/{analytics-sections-Cjkr8Muu.js → analytics-sections-s9PmHD7K.js} +1 -1
  68. package/dist/client/assets/api-keys-BNHCLXyO.js +1 -0
  69. package/dist/client/assets/api-keys-CplXRVbk.js +1 -0
  70. package/dist/client/assets/app-editor-C2lg73cH.js +1 -0
  71. package/dist/client/assets/asset-utils-Cba9XUPE.js +1 -0
  72. package/dist/client/assets/{auth-Cps-90jQ.js → auth-C364y6MM.js} +1 -1
  73. package/dist/client/assets/{auth-catchall-Batt4Wp1.js → auth-catchall-Fu5UnD3F.js} +1 -1
  74. package/dist/client/assets/auth-entry-TtvThk9b.js +1 -0
  75. package/dist/client/assets/{auth-split-layout-lt03dL19.js → auth-split-layout-DSLQPMD9.js} +1 -1
  76. package/dist/client/assets/authenticate-and-persist-oauth-BKg7tWBc.js +1 -0
  77. package/dist/client/assets/{automation-list-row-C9YrfX3o.js → automation-list-row-DlIRdIvL.js} +1 -1
  78. package/dist/client/assets/automation-runs-D7YzXLl4.js +1 -0
  79. package/dist/client/assets/automations-nTgDp9lT.js +1 -0
  80. package/dist/client/assets/autosend-CezXEQCq.js +1 -0
  81. package/dist/client/assets/{avatar-TL9HUab0.js → avatar-DbpOZfYL.js} +1 -1
  82. package/dist/client/assets/{badge-CKM84j2S.js → badge-BgcNCpYt.js} +1 -1
  83. package/dist/client/assets/{block-document-w2kAyl6z.js → block-document-iTsyUX-a.js} +3 -3
  84. package/dist/client/assets/{blocks-preview-workspace-context-PwUYRK7b.js → blocks-preview-workspace-context-BXKULFqX.js} +1 -1
  85. package/dist/client/assets/{blog-schema-Cx6xDQRb.js → blog-schema-DD23vovf.js} +1 -1
  86. package/dist/client/assets/{board-analytics-DT3f2AVB.js → board-analytics-Cwy2ZAGo.js} +1 -1
  87. package/dist/client/assets/buckets-BSK6ehlm.js +1 -0
  88. package/dist/client/assets/{build-improve-prompt-doc-R0amEUpn.js → build-improve-prompt-doc-Y3OzCwPY.js} +1 -1
  89. package/dist/client/assets/{calendar-DaaBbvOH.js → calendar-CEOFJdzz.js} +1 -1
  90. package/dist/client/assets/capability-load-error-BCbiiwNK.js +1 -0
  91. package/dist/client/assets/category-editor-CVM9Agvl.js +1 -0
  92. package/dist/client/assets/{chart-DZbYggl3.js → chart-BirAG0oj.js} +1 -1
  93. package/dist/client/assets/{chat-context-UMp8QwjT.js → chat-context-By_4gW6u.js} +8 -8
  94. package/dist/client/assets/chat-draft-CjxNTkoz.js +1 -0
  95. package/dist/client/assets/{checkbox-B2kVXKBD.js → checkbox-C1PTdkvC.js} +1 -1
  96. package/dist/client/assets/choose-editor-D5Z-yVXB.js +1 -0
  97. package/dist/client/assets/claim-phase-copy-DjK7-Dlj.js +1 -0
  98. package/dist/client/assets/{cli-auth-success-DtMJnqjK.js → cli-auth-success-DPNe5AnC.js} +1 -1
  99. package/dist/client/assets/{client-icons-D3ZaOjXM.js → client-icons-gmrQyeik.js} +1 -1
  100. package/dist/client/assets/{collapsible-vN3Y9B-p.js → collapsible-B4tt-A-a.js} +1 -1
  101. package/dist/client/assets/collection-detail-CRZTOFcZ.js +1 -0
  102. package/dist/client/assets/collection-display-button-iFLNUDt5.js +1 -0
  103. package/dist/client/assets/{collection-search-BoB9COGX.js → collection-search-6N7Rez-8.js} +1 -1
  104. package/dist/client/assets/{collection-table-wrapper-CxJ6Bp-f.js → collection-table-wrapper-CfCYWslA.js} +1 -1
  105. package/dist/client/assets/{collection-tabs-Cw7XLgNG.js → collection-tabs-CKHgPBCn.js} +1 -1
  106. package/dist/client/assets/column-rules-2VSan5Bc.js +3 -0
  107. package/dist/client/assets/{combobox-PSOtDaya.js → combobox-DaqRmpnO.js} +1 -1
  108. package/dist/client/assets/command-Y5_oacWW.js +1 -0
  109. package/dist/client/assets/{companion-mcps-section-gXkjR-XD.js → companion-mcps-section-B-ijJ6Yp.js} +1 -1
  110. package/dist/client/assets/config-BokZbmON.js +1 -0
  111. package/dist/client/assets/{connect-Dn2pI97X.js → connect-CRGqUZ7U.js} +3 -3
  112. package/dist/client/assets/connect-layout-D4PD9y64.js +1 -0
  113. package/dist/client/assets/{connection-FKmTBjan.js → connection-CRPvojqI.js} +1 -1
  114. package/dist/client/assets/connection-card-KyCZsDMq.js +1 -0
  115. package/dist/client/assets/connection-detail-BcuPo63c.js +1 -0
  116. package/dist/client/assets/connection-form-helpers-DHRB6y9q.js +1 -0
  117. package/dist/client/assets/connections-BsYVOIWF.js +1 -0
  118. package/dist/client/assets/context-TgkInbqd.js +1 -0
  119. package/dist/client/assets/{context-menu-BLhcVqO0.js → context-menu-BcvT-xNL.js} +1 -1
  120. package/dist/client/assets/{core.esm-DbclD67Y.js → core.esm-BCt5zzlL.js} +1 -1
  121. package/dist/client/assets/create-organization-dialog-DA_Cpcir.js +1 -0
  122. package/dist/client/assets/daily-pulse-DL2RQNPh.js +1 -0
  123. package/dist/client/assets/{device-hint-CbxzMdRC.js → device-hint-C-6GVgyh.js} +1 -1
  124. package/dist/client/assets/discover-DMYUdkQJ.js +1 -0
  125. package/dist/client/assets/domain-settings-Bw-4hQ9O.js +1 -0
  126. package/dist/client/assets/{drawer-CXs6iEYK.js → drawer-Mq2IQ1xB.js} +1 -1
  127. package/dist/client/assets/{editor-CPkkN1Zr.js → editor-4gGGw1LX.js} +3 -3
  128. package/dist/client/assets/{empty-state-D45gZaZ-.js → empty-state-Z7KZaCgr.js} +1 -1
  129. package/dist/client/assets/{empty-state-DnQ_qEjI.js → empty-state-pDkjxQ9v.js} +1 -1
  130. package/dist/client/assets/{extract-connection-data-Q_j_fmQx.js → extract-connection-data-DmRZ30Aj.js} +1 -1
  131. package/dist/client/assets/{feature-gate-CFL9eB8c.js → feature-gate-Dejbstp-.js} +1 -1
  132. package/dist/client/assets/feature-paywall-BatvuaQK.js +1 -0
  133. package/dist/client/assets/file-explorer-DoxI5WYH.js +2 -0
  134. package/dist/client/assets/{file-preview-DT-0IR-r.js → file-preview-BKQ9z_Zk.js} +1 -1
  135. package/dist/client/assets/file-share-button-E78-t03V.js +3 -0
  136. package/dist/client/assets/{file-type-icon-Du5QihE_.js → file-type-icon-BIQRdF9B.js} +1 -1
  137. package/dist/client/assets/flat-project-DcECHGX3.js +1 -0
  138. package/dist/client/assets/{folder-icon-DXEgDwxo.js → folder-icon-BeWIM1Mh.js} +2 -2
  139. package/dist/client/assets/{form-BBtB5neb.js → form-ClLZmF-x.js} +1 -1
  140. package/dist/client/assets/general-CQandLDD.js +1 -0
  141. package/dist/client/assets/home-DVyZY-sa.js +1 -0
  142. package/dist/client/assets/{icon-button-BiR7Hy07.js → icon-button-BflDTZbH.js} +1 -1
  143. package/dist/client/assets/{index-DltLvtZg.js → index-0YmFgk-4.js} +1 -1
  144. package/dist/client/assets/{index-DWUcsrDk.js → index-BRB9eRek.js} +2 -2
  145. package/dist/client/assets/{index-D1CuHcEn.js → index-BRHoVQcU.js} +1 -1
  146. package/dist/client/assets/{index-CeMEs5dC.js → index-BgOyhevJ.js} +2 -2
  147. package/dist/client/assets/{index-C-3lNbMm.js → index-BhOWNPjr.js} +6 -6
  148. package/dist/client/assets/{index-CmC6v99h.js → index-C8DfgSPy.js} +5 -5
  149. package/dist/client/assets/{index-BvwJHqHQ.js → index-CbgPEOCa.js} +2 -2
  150. package/dist/client/assets/index-CkPHS5Dh.js +1 -0
  151. package/dist/client/assets/{index-D8mID9PZ.js → index-D7iHvf3D.js} +1 -1
  152. package/dist/client/assets/index-DAmEDD4z.js +1 -0
  153. package/dist/client/assets/{index-CoDuotD7.js → index-DHrUbuPD.js} +1 -1
  154. package/dist/client/assets/{index-KqttCHw1.js → index-DQmyVRcq.js} +1 -1
  155. package/dist/client/assets/{index-D_7jfHk6.js → index-P5CXrVFm.js} +43 -43
  156. package/dist/client/assets/{index-redirect-_9q4bmDQ.js → index-redirect-CG5FAh2K.js} +1 -1
  157. package/dist/client/assets/{infiniteQueryObserver-DG8sBe4B.js → infiniteQueryObserver-DozMisCD.js} +1 -1
  158. package/dist/client/assets/infra-billing-DfiPMKeD.js +1 -0
  159. package/dist/client/assets/input-CeiEotQg.js +1 -0
  160. package/dist/client/assets/{input-DQp1LVsq.js → input-ykei6Cwl.js} +5 -5
  161. package/dist/client/assets/{integration-icon-BM3EOzpn.js → integration-icon-67Xzvyfa.js} +1 -1
  162. package/dist/client/assets/jira-icon-B2BuyBB4.js +1 -0
  163. package/dist/client/assets/{label-DxOPcXJe.js → label-BFTsWxRX.js} +1 -1
  164. package/dist/client/assets/{layout-bHPl4zx9.js → layout-C1lXfV0M.js} +1 -1
  165. package/dist/client/assets/legacy-agents-deep-biwbtqII.js +1 -0
  166. package/dist/client/assets/{legacy-main-redirect-z5zSFE1g.js → legacy-main-redirect-DddC7e1C.js} +1 -1
  167. package/dist/client/assets/library-Cof5sIHl.js +1 -0
  168. package/dist/client/assets/{library-tab-Z6y7ewdW.js → library-tab-NRFXm3NX.js} +3 -3
  169. package/dist/client/assets/login-DgVB-KHS.js +1 -0
  170. package/dist/client/assets/{markdown-6zdu9t3J.js → markdown-DsXUd5ra.js} +3 -3
  171. package/dist/client/assets/{mcp-app-renderer-D5zA7BfR.js → mcp-app-renderer-Cbidp8HH.js} +1 -1
  172. package/dist/client/assets/mcp-oauth-Bvbum4TV.js +1 -0
  173. package/dist/client/assets/mcp-oauth-Em69Rf1Z.js +1 -0
  174. package/dist/client/assets/members-D8MOsQpb.js +1 -0
  175. package/dist/client/assets/{memory-C67vpugN.js → memory-KM-sFXxK.js} +2 -2
  176. package/dist/client/assets/{mini-report-page-jD0aWOQw.js → mini-report-page-D6-Sz9FL.js} +1 -1
  177. package/dist/client/assets/{mock-board-DX11vRZx.js → mock-board-CjxyB2zF.js} +1 -1
  178. package/dist/client/assets/{monaco-editor-BfKI4VlA.js → monaco-editor-dzebtzJe.js} +2 -2
  179. package/dist/client/assets/{monitoring-stats-row-DB55KTTw.js → monitoring-stats-row-Br92KCz7.js} +1 -1
  180. package/dist/client/assets/{multi-select-DVylmGoB.js → multi-select-OMY7Ad0D.js} +1 -1
  181. package/dist/client/assets/mustache-mZQO-vIe.js +4 -0
  182. package/dist/client/assets/new-project-dialog-c2qIcucJ.js +1 -0
  183. package/dist/client/assets/{oauth-callback-Cqdj0zbM.js → oauth-callback-CbK8qs_l.js} +1 -1
  184. package/dist/client/assets/{oauth-callback-ai-provider-Cwy6YGO7.js → oauth-callback-ai-provider-DeX6N2Kr.js} +1 -1
  185. package/dist/client/assets/onboarding-BW2HKXvH.js +1 -0
  186. package/dist/client/assets/openai-conversation-D8EGaB-O.js +3 -0
  187. package/dist/client/assets/optimistic-project-sidebar-views-BfSXwHy1.js +1 -0
  188. package/dist/client/assets/{organization-choice-CG-C6xsW.js → organization-choice-D26FpHn1.js} +1 -1
  189. package/dist/client/assets/orgs-DOgJxZAX.js +1 -0
  190. package/dist/client/assets/{page-seo-form-C6V8K2um.js → page-seo-form-DKPmGeGi.js} +1 -1
  191. package/dist/client/assets/pair-tkynKLUn.js +48 -0
  192. package/dist/client/assets/plan-ladder-DK8XbnR2.js +1 -0
  193. package/dist/client/assets/{popover-C2vJrXky.js → popover-BEaGTFER.js} +1 -1
  194. package/dist/client/assets/post-calendar-BNSAMYq7.js +1 -0
  195. package/dist/client/assets/post-editor-COrT_mtL.js +2 -0
  196. package/dist/client/assets/preview-content-BDIAdwAe.js +1 -0
  197. package/dist/client/assets/preview-dialog-lyZyRYbk.js +1 -0
  198. package/dist/client/assets/{preview-panel-CaQ4Pbpr.js → preview-panel-CAmSZPFR.js} +1 -1
  199. package/dist/client/assets/product-picker-dialog-DsW2hIqG.js +1 -0
  200. package/dist/client/assets/profile-8rq0jv1t.js +1 -0
  201. package/dist/client/assets/project-app-view-BATWfA47.js +1 -0
  202. package/dist/client/assets/project-feed-D-Njb4Fa.js +1 -0
  203. package/dist/client/assets/{project-icon-DU1uywdD.js → project-icon-CVjxspby.js} +1 -1
  204. package/dist/client/assets/project-reports-BkzVwq7y.js +1 -0
  205. package/dist/client/assets/project-tasks-B54X-ADA.js +1 -0
  206. package/dist/client/assets/projects-Ci0VMAti.js +1 -0
  207. package/dist/client/assets/{projects-empty-state-BsW_dfGL.js → projects-empty-state-DqLxqHkr.js} +1 -1
  208. package/dist/client/assets/prompts-CcDUo4xE.js +1 -0
  209. package/dist/client/assets/record-editor-CsrZJ7eU.js +1 -0
  210. package/dist/client/assets/redirect-editor-CeRRUF_Y.js +1 -0
  211. package/dist/client/assets/{reports-CMClJ0_S.js → reports-BKEK9PjO.js} +2 -2
  212. package/dist/client/assets/reports-TUXU0eWQ.js +1 -0
  213. package/dist/client/assets/reports-onboarding-BWPW_861.js +1 -0
  214. package/dist/client/assets/reports-tab-MTJjgnyg.js +2 -0
  215. package/dist/client/assets/repositories-COdTxGIM.js +1 -0
  216. package/dist/client/assets/repository-binding-DgstszW0.js +1 -0
  217. package/dist/client/assets/repository-import-picker-C4LOW7uq.js +1 -0
  218. package/dist/client/assets/repository-picker-iVChzqUi.js +1 -0
  219. package/dist/client/assets/require-capability-CIonrRSM.js +1 -0
  220. package/dist/client/assets/{required-auth-layout-CDif9NZC.js → required-auth-layout-Docb5mc1.js} +1 -1
  221. package/dist/client/assets/reset-password-D-Uff2pm.js +1 -0
  222. package/dist/client/assets/{resizable-CIqqPf7O.js → resizable-DQkQHFqP.js} +1 -1
  223. package/dist/client/assets/{resolve-tab-icon-S311kwwr.js → resolve-tab-icon-BJCQiMAG.js} +1 -1
  224. package/dist/client/assets/review-settings-CQUW-c0y.js +1 -0
  225. package/dist/client/assets/{rich-text-link-control-CMeXviAY.js → rich-text-link-control-BtAN4nTK.js} +1 -1
  226. package/dist/client/assets/roles-B5x0qKiF.js +1 -0
  227. package/dist/client/assets/route-B3BzuLT3.js +1 -0
  228. package/dist/client/assets/route-CV820oik.js +1 -0
  229. package/dist/client/assets/route-DkvQrfxW.js +1 -0
  230. package/dist/client/assets/{runnable-block-editor-BWSWYcJ-.js → runnable-block-editor-COF6SwRV.js} +4 -4
  231. package/dist/client/assets/sandbox-lifecycle-context-CZJ_j0np.js +1 -0
  232. package/dist/client/assets/{schema-D1veJPjJ.js → schema-DPby9xN_.js} +1 -1
  233. package/dist/client/assets/{scroll-area-Ce9NeF1s.js → scroll-area-BaXoWTc0.js} +1 -1
  234. package/dist/client/assets/{search-input-DpJBHwWo.js → search-input-zIdNkZIZ.js} +1 -1
  235. package/dist/client/assets/search-toggle-Dd74zbFD.js +1 -0
  236. package/dist/client/assets/{secret-picker-B_ADx-sY.js → secret-picker-BNQiMdJy.js} +1 -1
  237. package/dist/client/assets/secrets-DYrvzDcq.js +1 -0
  238. package/dist/client/assets/sections-editor-CWdxzvx_.js +1 -0
  239. package/dist/client/assets/{select-CZdnCwuC.js → select-BTTyWh-3.js} +1 -1
  240. package/dist/client/assets/select-model-_gJCiq6c.js +1 -0
  241. package/dist/client/assets/seo-editor-D2aPe-YC.js +1 -0
  242. package/dist/client/assets/{separator-BtrJ5AFz.js → separator-DjDQYMtn.js} +1 -1
  243. package/dist/client/assets/settings-tab-B0TsEFTt.js +4 -0
  244. package/dist/client/assets/sheet-eZJW88LV.js +1 -0
  245. package/dist/client/assets/shell-layout-OtP14C-y.js +1 -0
  246. package/dist/client/assets/skills-CyhJcNik.js +1 -0
  247. package/dist/client/assets/{slider-BpZoep6A.js → slider-C2iod3T6.js} +1 -1
  248. package/dist/client/assets/{sortable.esm-DyjKGVzh.js → sortable.esm-B2cNTSsr.js} +1 -1
  249. package/dist/client/assets/sso-BSD5EMNY.js +1 -0
  250. package/dist/client/assets/{suggestion-DmBBrXFD.js → suggestion-CEZpMvzO.js} +2 -2
  251. package/dist/client/assets/{switch-hSsSQMgC.js → switch-BJJ-2yIv.js} +1 -1
  252. package/dist/client/assets/{symbol-CkeqKRPe.js → symbol-DQiTO71i.js} +1 -1
  253. package/dist/client/assets/synced-repos-19fjd8br.js +1 -0
  254. package/dist/client/assets/{tab-icon-glyph-BRREqFJ3.js → tab-icon-glyph-B8UDsLej.js} +1 -1
  255. package/dist/client/assets/{table-Dfov51xE.js → table-B9C_mOX3.js} +1 -1
  256. package/dist/client/assets/{tabs-Df848FrP.js → tabs-9di2Neit.js} +1 -1
  257. package/dist/client/assets/{task-board-ChFrokIN.js → task-board-DsgdOWHQ.js} +1 -1
  258. package/dist/client/assets/{task-route-4t67EvVC.js → task-route-_EeI73mv.js} +1 -1
  259. package/dist/client/assets/{task-status-cI-KMHji.js → task-status-B--cbdkz.js} +1 -1
  260. package/dist/client/assets/taskboard-analytics-C8fUYGcQ.js +1 -0
  261. package/dist/client/assets/{tasks-Dcje4OJR.js → tasks-Bd7TbgaV.js} +3 -3
  262. package/dist/client/assets/tasks-RI02vBG9.js +1 -0
  263. package/dist/client/assets/{textarea-DaHaRA0Z.js → textarea-BqIcQ24a.js} +1 -1
  264. package/dist/client/assets/thread-analytics-CsSdT5az.js +1 -0
  265. package/dist/client/assets/thread-button-CycuvBQ2.js +1 -0
  266. package/dist/client/assets/{thread-intent-Cxso0qKW.js → thread-intent-Dkew51FR.js} +4 -4
  267. package/dist/client/assets/thread-route-BhC2i0VX.js +1 -0
  268. package/dist/client/assets/thread-route-VDZP73-c.js +1 -0
  269. package/dist/client/assets/thread-sheet-body-D66PmCTc.js +1 -0
  270. package/dist/client/assets/time-range-picker-PWsm0WiC.js +1 -0
  271. package/dist/client/assets/{toggle-group-BFX-9eHs.js → toggle-group-DlaKauZK.js} +1 -1
  272. package/dist/client/assets/{tool-namespace-BHB8Go32.js → tool-namespace-BqgKCylT.js} +1 -1
  273. package/dist/client/assets/{toolbar-icon-button-D9aCXzS4.js → toolbar-icon-button-uADDhC14.js} +1 -1
  274. package/dist/client/assets/{tooltip-BULKkf4A.js → tooltip-K3E8D0ro.js} +1 -1
  275. package/dist/client/assets/{tooltipContext-1NNpJuJd.js → tooltipContext-BRcqEDXN.js} +1 -1
  276. package/dist/client/assets/{track-CpjpKs1v.js → track-CP2DG_55.js} +1 -1
  277. package/dist/client/assets/{types-Blm6OQRg.js → types-DcgxOiad.js} +3 -3
  278. package/dist/client/assets/{url-slug-d-Er1jOR.js → url-slug-DhfDl2ps.js} +1 -1
  279. package/dist/client/assets/{usage-stats-Dqycj-p-.js → usage-stats-BxwGMEO8.js} +8 -8
  280. package/dist/client/assets/use-ai-providers-RQRNdq_e.js +1 -0
  281. package/dist/client/assets/use-automations-Ca5X-jRM.js +1 -0
  282. package/dist/client/assets/{use-autosave-DBCPQM6l.js → use-autosave-CJc5IdX2.js} +1 -1
  283. package/dist/client/assets/use-chat-layout-state-DtHzBS8D.js +1 -0
  284. package/dist/client/assets/use-chat-navigation-CVp0n3Im.js +1 -0
  285. package/dist/client/assets/{use-clock-tick-DGTQe72H.js → use-clock-tick-DpFEAg9e.js} +1 -1
  286. package/dist/client/assets/use-connect-companion-CtkvmHzJ.js +1 -0
  287. package/dist/client/assets/use-connection-Bt-E6mI8.js +1 -0
  288. package/dist/client/assets/{use-copy-CRIUfo35.js → use-copy-CnGdfZZq.js} +1 -1
  289. package/dist/client/assets/{use-create-virtual-mcp-DzmQH3J8.js → use-create-virtual-mcp-DSPEp1ij.js} +1 -1
  290. package/dist/client/assets/{use-date-fns-locale-DIokBBqe.js → use-date-fns-locale-CoQZHHDk.js} +1 -1
  291. package/dist/client/assets/{use-debounced-autosave-BRSYFOGW.js → use-debounced-autosave-D9QlyCIh.js} +1 -1
  292. package/dist/client/assets/{use-debounced-value-DCB8Le0h.js → use-debounced-value-BUXOxoNR.js} +1 -1
  293. package/dist/client/assets/use-deco-credits-D1Zzfqcx.js +1 -0
  294. package/dist/client/assets/{use-decopilot-events-uItZ_pJe.js → use-decopilot-events-BlbrCauc.js} +1 -1
  295. package/dist/client/assets/use-delete-connection-BHcEA-CR.js +1 -0
  296. package/dist/client/assets/{use-deployment-admin-BSf-NdBG.js → use-deployment-admin-Bep6HJdp.js} +1 -1
  297. package/dist/client/assets/use-ensure-project-folder-CqnXJXRD.js +1 -0
  298. package/dist/client/assets/{use-fast-preview-draft-url-8LcTSnsj.js → use-fast-preview-draft-url-CGzNCC1A.js} +1 -1
  299. package/dist/client/assets/use-file-configs-BPwg0FRs.js +1 -0
  300. package/dist/client/assets/{use-infinite-scroll-B02yfFGd.js → use-infinite-scroll-DGijCA4m.js} +1 -1
  301. package/dist/client/assets/use-join-requests-DSEFov6n.js +1 -0
  302. package/dist/client/assets/use-main-panel-tabs-OrkHtB0p.js +1 -0
  303. package/dist/client/assets/use-mcp-auth-status-DQxUdxan.js +1 -0
  304. package/dist/client/assets/{use-mcp-client-MUIIizLf.js → use-mcp-client-BzoSbdXu.js} +4 -4
  305. package/dist/client/assets/{use-mcp-prompts-C3siW74f.js → use-mcp-prompts-C6OXhadi.js} +1 -1
  306. package/dist/client/assets/{use-mcp-tools-CPLGkZB5.js → use-mcp-tools-D_8Ajj_N.js} +1 -1
  307. package/dist/client/assets/use-members-BuywckX1.js +1 -0
  308. package/dist/client/assets/{use-mobile-DF1FX6Xv.js → use-mobile-C8-RuCPF.js} +1 -1
  309. package/dist/client/assets/use-navigate-to-agent-DLNrFLDT.js +1 -0
  310. package/dist/client/assets/use-new-blocks-editor-Jqd7-2D9.js +1 -0
  311. package/dist/client/assets/{use-open-billing-url-CqJ0vDkP.js → use-open-billing-url-xKTM1AUW.js} +1 -1
  312. package/dist/client/assets/use-org-auth-client-B6LnSeUd.js +1 -0
  313. package/dist/client/assets/use-org-fs-DErltq5P.js +1 -0
  314. package/dist/client/assets/use-org-repo-syncs-DMFEDOzK.js +1 -0
  315. package/dist/client/assets/{use-org-sso-BEGhJLya.js → use-org-sso-sw3on3hq.js} +1 -1
  316. package/dist/client/assets/use-organization-roles-DjUuzQZu.js +1 -0
  317. package/dist/client/assets/use-organization-settings-BHelWCQF.js +1 -0
  318. package/dist/client/assets/{use-panel-navigate-C4UE8Qkr.js → use-panel-navigate-BLjJq7A_.js} +1 -1
  319. package/dist/client/assets/{use-project-scope-BMVXwaQ4.js → use-project-scope-B9l8p85i.js} +1 -1
  320. package/dist/client/assets/use-releases-CsZsJd__.js +1 -0
  321. package/dist/client/assets/use-reports-diagnostic-CA8bVs4C.js +1 -0
  322. package/dist/client/assets/use-sandbox-events-C41kLIF6.js +2 -0
  323. package/dist/client/assets/use-secrets-Od0f7P_4.js +1 -0
  324. package/dist/client/assets/use-section-preview-base-CtsulJXk.js +1 -0
  325. package/dist/client/assets/use-tags-Df3tX30j.js +1 -0
  326. package/dist/client/assets/use-task-board-analytics-D3QeGKDt.js +1 -0
  327. package/dist/client/assets/{use-task-board-events-BDjHMnwS.js → use-task-board-events-DgHn2yeU.js} +1 -1
  328. package/dist/client/assets/use-task-board-item-prs-C9TWjRE5.js +1 -0
  329. package/dist/client/assets/use-task-board-items-DqDMBUiA.js +1 -0
  330. package/dist/client/assets/use-task-metadata-BGZgwqEP.js +1 -0
  331. package/dist/client/assets/{use-thread-analytics-DJQ2zz_B.js → use-thread-analytics-DpRLYYMv.js} +1 -1
  332. package/dist/client/assets/use-thread-outputs-Bd93hD9n.js +1 -0
  333. package/dist/client/assets/useInfiniteQuery-DCtX1Z2b.js +1 -0
  334. package/dist/client/assets/{useQueries-DKVO6hGe.js → useQueries-FiLem-Cr.js} +1 -1
  335. package/dist/client/assets/useSuspenseInfiniteQuery-BY9PV9K3.js +1 -0
  336. package/dist/client/assets/{users-DbpeSClG.js → users-DDcsQE52.js} +1 -1
  337. package/dist/client/assets/{utils-Cxy1EsFU.js → utils-D-s8UffD.js} +1 -1
  338. package/dist/client/assets/variant-calendar-A2za84Mi.js +1 -0
  339. package/dist/client/assets/{variant-matcher-override-BD9nzwGm.js → variant-matcher-override-BQT0OBiv.js} +1 -1
  340. package/dist/client/assets/{view-mode-toggle-CVVPadaN.js → view-mode-toggle-CLajaG70.js} +1 -1
  341. package/dist/client/assets/{virtual-mcp-CYDFCAA6.js → virtual-mcp-BsaYLZxR.js} +1 -1
  342. package/dist/client/assets/{watch-sse-pool-BXtoXPGx.js → watch-sse-pool-Ckvo_uxI.js} +1 -1
  343. package/dist/client/index.html +1 -1
  344. package/dist/server/server.js +633 -633
  345. package/package.json +1 -1
  346. package/dist/client/assets/LinkExternal01-CILXo-bC.js +0 -1
  347. package/dist/client/assets/X-DzPShgV5.js +0 -1
  348. package/dist/client/assets/add-connection-dialog-Eph5CbUo.js +0 -1
  349. package/dist/client/assets/agent-analytics-DSdixv-f.js +0 -2
  350. package/dist/client/assets/agent-app-CT6U3s2r.js +0 -1
  351. package/dist/client/assets/agent-assets-G93-pOM9.js +0 -1
  352. package/dist/client/assets/agent-automation-DP6Bv0AB.js +0 -20
  353. package/dist/client/assets/agent-automations-YDqRnDcc.js +0 -1
  354. package/dist/client/assets/agent-connect-sources-CSrFX52j.js +0 -1
  355. package/dist/client/assets/agent-deck-D9Bphszm.js +0 -1
  356. package/dist/client/assets/agent-e2e-k9wCqssu.js +0 -1
  357. package/dist/client/assets/agent-experiments-CPSBbmYr.js +0 -1
  358. package/dist/client/assets/agent-file-BAkSJWMw.js +0 -1
  359. package/dist/client/assets/agent-hosting-B1Ag0zD8.js +0 -1
  360. package/dist/client/assets/agent-icon-CnnNyirr.js +0 -1
  361. package/dist/client/assets/agent-library-Ch3sHhuh.js +0 -1
  362. package/dist/client/assets/agent-library-file-Bq6m6SHP.js +0 -1
  363. package/dist/client/assets/agent-monitor-DyddEd79.js +0 -1
  364. package/dist/client/assets/agent-overview-BlP2a40h.js +0 -1
  365. package/dist/client/assets/agent-settings-CaxlA04S.js +0 -1
  366. package/dist/client/assets/agent-site-editor-code-D0j_GVVh.js +0 -2
  367. package/dist/client/assets/agent-view-UQmbv7nk.js +0 -1
  368. package/dist/client/assets/agents-list-CJcm3Kq8.js +0 -1
  369. package/dist/client/assets/api-keys-BjTJSB_i.js +0 -1
  370. package/dist/client/assets/api-keys-BrfzhtIS.js +0 -1
  371. package/dist/client/assets/app-editor-CJudcxBz.js +0 -1
  372. package/dist/client/assets/asset-utils-Cdgz7yau.js +0 -1
  373. package/dist/client/assets/auth-entry-BUqhj_6T.js +0 -1
  374. package/dist/client/assets/authenticate-and-persist-oauth-eDHShxj5.js +0 -1
  375. package/dist/client/assets/automation-runs-BZA4OsIt.js +0 -1
  376. package/dist/client/assets/automations-DpWIQ3oV.js +0 -1
  377. package/dist/client/assets/autosend-BQ3F90GX.js +0 -1
  378. package/dist/client/assets/buckets-AVx7AXso.js +0 -1
  379. package/dist/client/assets/capability-load-error-BVlvKXjS.js +0 -1
  380. package/dist/client/assets/category-editor-B-jccGXu.js +0 -1
  381. package/dist/client/assets/chat-draft-CYy-Qv-a.js +0 -1
  382. package/dist/client/assets/choose-editor-BDo9cuNm.js +0 -1
  383. package/dist/client/assets/claim-phase-copy-DG8E1-gc.js +0 -1
  384. package/dist/client/assets/collection-detail-CBqQPzi0.js +0 -1
  385. package/dist/client/assets/collection-display-button-XaptFv9u.js +0 -1
  386. package/dist/client/assets/column-rules-Bq3eiowV.js +0 -3
  387. package/dist/client/assets/command-Doiz3O29.js +0 -1
  388. package/dist/client/assets/config-B01oZvpJ.js +0 -1
  389. package/dist/client/assets/connect-layout-CoxrwG6t.js +0 -1
  390. package/dist/client/assets/connection-card-Cvk5T5vt.js +0 -1
  391. package/dist/client/assets/connection-detail-BRdQkO7d.js +0 -1
  392. package/dist/client/assets/connection-form-helpers-D4Q7rLyt.js +0 -1
  393. package/dist/client/assets/connections-C8qSBDCe.js +0 -1
  394. package/dist/client/assets/context-Bt7kDQzj.js +0 -1
  395. package/dist/client/assets/create-organization-dialog-D-t_ZE2o.js +0 -1
  396. package/dist/client/assets/daily-pulse-DYPs4tl1.js +0 -1
  397. package/dist/client/assets/dialog-DRpbbWU1.js +0 -1
  398. package/dist/client/assets/discover-3ATGdKP8.js +0 -1
  399. package/dist/client/assets/domain-settings-C4-yAgIW.js +0 -1
  400. package/dist/client/assets/feature-paywall-0RYA-1Op.js +0 -1
  401. package/dist/client/assets/file-explorer-Cyg7RguR.js +0 -2
  402. package/dist/client/assets/file-share-button-C8ZBUx_e.js +0 -3
  403. package/dist/client/assets/flat-project-BpQGs-gN.js +0 -1
  404. package/dist/client/assets/general-B3jgLFML.js +0 -1
  405. package/dist/client/assets/home-DYCk_i5V.js +0 -1
  406. package/dist/client/assets/index-Cx0uPPmh.js +0 -1
  407. package/dist/client/assets/index-qeM6EfxB.js +0 -1
  408. package/dist/client/assets/infra-billing-BFh6IlFL.js +0 -1
  409. package/dist/client/assets/input-B0doV0os.js +0 -1
  410. package/dist/client/assets/input-BQ74PHN6.js +0 -1
  411. package/dist/client/assets/jira-icon-C1bLqdEg.js +0 -1
  412. package/dist/client/assets/legacy-agents-deep-BBjNU_wv.js +0 -1
  413. package/dist/client/assets/library-CVuXHyjV.js +0 -1
  414. package/dist/client/assets/login-DNhk4MX6.js +0 -1
  415. package/dist/client/assets/mcp-oauth-C5T-IVs8.js +0 -1
  416. package/dist/client/assets/members-BftWOm2t.js +0 -1
  417. package/dist/client/assets/mustache-D-VzFUJG.js +0 -4
  418. package/dist/client/assets/new-project-dialog-CXEwhrv6.js +0 -1
  419. package/dist/client/assets/onboarding-BisuojYF.js +0 -1
  420. package/dist/client/assets/openai-conversation-BICNFmxp.js +0 -3
  421. package/dist/client/assets/optimistic-project-sidebar-views-BINKTU3_.js +0 -1
  422. package/dist/client/assets/orgs-DCjydoUZ.js +0 -1
  423. package/dist/client/assets/pair-knnOGTuF.js +0 -47
  424. package/dist/client/assets/plan-ladder-DlpzxobM.js +0 -1
  425. package/dist/client/assets/post-calendar-3X9xGSKe.js +0 -1
  426. package/dist/client/assets/post-editor-BS-N2LHp.js +0 -2
  427. package/dist/client/assets/preview-content-CWMTMNmp.js +0 -1
  428. package/dist/client/assets/preview-dialog-CmtjgV1o.js +0 -1
  429. package/dist/client/assets/product-picker-dialog-904WCGJu.js +0 -1
  430. package/dist/client/assets/profile-aIUaVWtC.js +0 -1
  431. package/dist/client/assets/project-app-view-ChZmhZ13.js +0 -1
  432. package/dist/client/assets/project-feed-t8IHFF-d.js +0 -1
  433. package/dist/client/assets/project-reports-BF24m5b-.js +0 -1
  434. package/dist/client/assets/project-tasks-Wmmy6hRq.js +0 -1
  435. package/dist/client/assets/projects-CxEhyr52.js +0 -1
  436. package/dist/client/assets/prompts-Cad3gM_K.js +0 -1
  437. package/dist/client/assets/record-editor-Cu0LbDVm.js +0 -1
  438. package/dist/client/assets/redirect-editor-B65ggNrM.js +0 -1
  439. package/dist/client/assets/reports-B3_ASbsZ.js +0 -1
  440. package/dist/client/assets/reports-onboarding-DzC8BMPj.js +0 -1
  441. package/dist/client/assets/reports-tab-flC8aPMq.js +0 -2
  442. package/dist/client/assets/repositories-BRVHvY5X.js +0 -1
  443. package/dist/client/assets/repository-binding-DpX8yLri.js +0 -1
  444. package/dist/client/assets/repository-import-picker-CO5nKRxA.js +0 -1
  445. package/dist/client/assets/repository-picker-C2HnHK1A.js +0 -1
  446. package/dist/client/assets/require-capability-Do1773Hs.js +0 -1
  447. package/dist/client/assets/reset-password-Dh0gWEkU.js +0 -1
  448. package/dist/client/assets/review-settings-C9jJxNAv.js +0 -1
  449. package/dist/client/assets/roles-BOnFVbcr.js +0 -1
  450. package/dist/client/assets/route-Bvv7axF1.js +0 -1
  451. package/dist/client/assets/route-DNZvy3kt.js +0 -1
  452. package/dist/client/assets/route-DdkXah7z.js +0 -1
  453. package/dist/client/assets/sandbox-lifecycle-context-BJE24h7z.js +0 -1
  454. package/dist/client/assets/search-toggle-Br3rmrbk.js +0 -1
  455. package/dist/client/assets/secrets-t0Aczfol.js +0 -1
  456. package/dist/client/assets/sections-editor-CEBB7XW8.js +0 -1
  457. package/dist/client/assets/select-model-ER05JMp8.js +0 -1
  458. package/dist/client/assets/seo-editor-DHXJaGsL.js +0 -1
  459. package/dist/client/assets/settings-tab-CTiWw7bm.js +0 -4
  460. package/dist/client/assets/sheet-Gpaizien.js +0 -1
  461. package/dist/client/assets/shell-layout-B0-NcUCt.js +0 -1
  462. package/dist/client/assets/skills-BHEjjAUu.js +0 -1
  463. package/dist/client/assets/sso-Dgg4nP6H.js +0 -1
  464. package/dist/client/assets/synced-repos-B1QJsQos.js +0 -1
  465. package/dist/client/assets/taskboard-analytics-C5y5DQZh.js +0 -1
  466. package/dist/client/assets/tasks-B6PT7ia3.js +0 -1
  467. package/dist/client/assets/thread-analytics-5o8rlytc.js +0 -1
  468. package/dist/client/assets/thread-button-DwjwmudD.js +0 -1
  469. package/dist/client/assets/thread-route-BcAw7-v0.js +0 -1
  470. package/dist/client/assets/thread-route-CW2be8Kx.js +0 -1
  471. package/dist/client/assets/thread-sheet-body-B6geJ00B.js +0 -1
  472. package/dist/client/assets/time-range-picker-Bu58tMJr.js +0 -1
  473. package/dist/client/assets/use-ai-providers-C1bb7SnA.js +0 -1
  474. package/dist/client/assets/use-automations-zlAoF9SL.js +0 -1
  475. package/dist/client/assets/use-chat-layout-state-DDDFQN6Y.js +0 -1
  476. package/dist/client/assets/use-chat-navigation-BF9opsK8.js +0 -1
  477. package/dist/client/assets/use-connect-companion-DcLSyBxl.js +0 -1
  478. package/dist/client/assets/use-connection-5LUEsGlJ.js +0 -1
  479. package/dist/client/assets/use-deco-credits-BgPf-IIH.js +0 -1
  480. package/dist/client/assets/use-delete-connection-BLZ4VLoa.js +0 -1
  481. package/dist/client/assets/use-ensure-project-folder-BUpbRP81.js +0 -1
  482. package/dist/client/assets/use-file-configs-By7UB_YZ.js +0 -1
  483. package/dist/client/assets/use-join-requests-Cb1ihQM1.js +0 -1
  484. package/dist/client/assets/use-main-panel-tabs-xXeWrfnF.js +0 -1
  485. package/dist/client/assets/use-mcp-auth-status-B-gyzfqG.js +0 -1
  486. package/dist/client/assets/use-members-vjX9lJhj.js +0 -1
  487. package/dist/client/assets/use-navigate-to-agent-p65xWFDF.js +0 -1
  488. package/dist/client/assets/use-new-blocks-editor-DZnaAqkX.js +0 -1
  489. package/dist/client/assets/use-org-auth-client-CuZ7oLTb.js +0 -1
  490. package/dist/client/assets/use-org-fs-DPxqVRhB.js +0 -1
  491. package/dist/client/assets/use-org-repo-syncs-BG16MD5Q.js +0 -1
  492. package/dist/client/assets/use-organization-roles-DOROP0yS.js +0 -1
  493. package/dist/client/assets/use-organization-settings-CB0-LYjl.js +0 -1
  494. package/dist/client/assets/use-releases-DO5M1M4y.js +0 -1
  495. package/dist/client/assets/use-reports-diagnostic-C3LmmHKo.js +0 -1
  496. package/dist/client/assets/use-sandbox-events-E2bKOQlM.js +0 -2
  497. package/dist/client/assets/use-secrets-C2sdbGJM.js +0 -1
  498. package/dist/client/assets/use-section-preview-base-26sYGS0B.js +0 -1
  499. package/dist/client/assets/use-tags-CFN9IU6i.js +0 -1
  500. package/dist/client/assets/use-task-board-analytics-BmwRnCgb.js +0 -1
  501. package/dist/client/assets/use-task-board-item-prs-DY1JtBFR.js +0 -1
  502. package/dist/client/assets/use-task-board-items-DUgOnZAe.js +0 -1
  503. package/dist/client/assets/use-task-metadata-BCqsxDXx.js +0 -1
  504. package/dist/client/assets/use-thread-outputs-DfIiLAuO.js +0 -1
  505. package/dist/client/assets/useInfiniteQuery-eYXaZ_bo.js +0 -1
  506. package/dist/client/assets/useSuspenseInfiniteQuery-i_drPWHc.js +0 -1
  507. package/dist/client/assets/variant-calendar-BR3Tvz7m.js +0 -1
@@ -0,0 +1 @@
1
+ import{aE as ne,bT as Fe,c as P,j as r,a2 as O,aa as F,K as A,m as fe,o as H,e as G,aD as ae,b as L,r as _,B as R,at as X,D as je,q as ye,s as ve,v as Ne,aK as Se,b2 as oe,w as Pe,a6 as Ie,t as re,I as we,l as he,h as xe,ax as Le}from"./index-P5CXrVFm.js";import{i as le}from"./ArrowLeft-CYC7J9yW.js";import{s as de}from"./Plus-BjGOOPj6.js";import{b as He,T as Ge,a as qe}from"./tooltip-K3E8D0ro.js";import{L as Ce}from"./label-BFTsWxRX.js";import{u as Ke}from"./useInfiniteQuery-DCtX1Z2b.js";import{C as Te}from"./collection-search-6N7Rez-8.js";import{n as Me,t as Ue}from"./ShoppingBag01-C_Zwelnq.js";import{A as We}from"./avatar-DbpOZfYL.js";import{u as Be}from"./use-debounced-value-BUXOxoNR.js";import{a as Qe}from"./use-organization-settings-BHelWCQF.js";const ue="deco-sites";function Ye(t){if(!t||typeof t!="object")return null;const e=t.github;if(!e||typeof e!="object")return null;const i=e.owner,o=e.repo;return typeof i!="string"||typeof o!="string"||i.length===0||o.length===0?null:{owner:i,repo:o}}function Lt(t,e){const i=e?Ye(e):null,o=i?.owner??ue,n=i?.repo??t;return{owner:o,name:n,url:`https://github.com/${o}/${n}`}}const Ve=[{id:"storefront",repo:{owner:ue,name:"storefront-tanstack"}},{id:"blog",repo:{owner:ue,name:"blog-tanstack"}}];Fe(["storefront","blog"]);const Je=ne().trim().min(1).max(100).regex(/^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/,"Use lower-case letters, numbers and hyphens, starting and ending with a letter or number"),Ee={github:"github.com",gitlab:"gitlab.com",bitbucket:"bitbucket.org"},Xe=new Set(["github","bitbucket"]);function Ze(t){const e=t.toLowerCase();return e==="github.com"||e==="www.github.com"?"github":e==="gitlab.com"||e==="www.gitlab.com"?"gitlab":e==="bitbucket.org"||e==="www.bitbucket.org"?"bitbucket":/(^|[.-])gitlab([.-]|$)/.test(e)?"gitlab":null}function et(t){const e=t.toLowerCase();return e.startsWith("www.")?e.slice(4):e}function Ht(t,e){const i=t.trim();if(!i)return null;let o,n;const s=/^(?:[\w.-]+@)?([\w.-]+(?::\d+)?):(?!\/\/)(.+)$/.exec(i);if(s&&!/^[a-z][a-z0-9+.-]*:\/\//i.test(i))o=s[1],n=s[2];else if(/^[a-z][a-z0-9+.-]*:\/\//i.test(i)){let d;try{d=new URL(i)}catch{return null}if(!/^(https?|ssh|git)(\+ssh)?:$/.test(d.protocol))return null;o=d.host,n=d.pathname}else if(e?.provider)o=e.host??Ee[e.provider],n=i;else return null;o=et(o);const l=e?.provider??Ze(o);if(!l)return null;let a=n.split("/").map(d=>d.trim()).filter(Boolean);const c=a.indexOf("-");if(c>=0&&(a=a.slice(0,c)),Xe.has(l)&&(a=a.slice(0,2)),a.length<2)return null;const f=a[a.length-1];return a[a.length-1]=f.replace(/\.git$/i,""),a.some(d=>d.length===0||d==="."||d==="..")?null:{provider:l,host:o,path:a.join("/")}}function Gt(t){return`https://${t.host}/${t.path}`}function tt(t){const e=P.c(4),{size:i,className:o}=t,n=i===void 0?24:i;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=r.jsx("path",{d:"M.778 1.213a.768.768 0 00-.768.892l3.263 19.81c.084.5.515.868 1.022.873H19.95a.772.772 0 00.77-.646l3.27-20.03a.768.768 0 00-.768-.891zM14.52 15.53H9.522L8.17 8.466h7.561z"}),e[0]=s):s=e[0];let l;return e[1]!==o||e[2]!==n?(l=r.jsx("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:o,children:s}),e[1]=o,e[2]=n,e[3]=l):l=e[3],l}function st(t){const e=P.c(4),{size:i,className:o}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=r.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0016 8c0-4.42-3.58-8-8-8z"}),e[0]=n):n=e[0];let s;return e[1]!==o||e[2]!==i?(s=r.jsx("svg",{width:i,height:i,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",className:o,children:n}),e[1]=o,e[2]=i,e[3]=s):s=e[3],s}function it(t){const e=P.c(4),{size:i,className:o}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=r.jsx("path",{d:"M23.6004 9.5927l-.0337-.0862L20.3.9814a.851.851 0 00-.3362-.405.8748.8748 0 00-.9997.0539.8748.8748 0 00-.29.4399l-2.2055 6.748H7.5375L5.3318 1.0702a.8573.8573 0 00-.29-.4412.8748.8748 0 00-.9997-.0537.8585.8585 0 00-.3361.4049L.4332 9.5015l-.0325.0862a6.0657 6.0657 0 002.0119 7.0105l.0113.0087.03.0213 4.976 3.7264 2.462 1.8633 1.4995 1.1321a1.0085 1.0085 0 001.2197 0l1.4995-1.1321 2.462-1.8633 5.0062-3.7489.0125-.01a6.0682 6.0682 0 002.0094-7.003z"}),e[0]=n):n=e[0];let s;return e[1]!==o||e[2]!==i?(s=r.jsx("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:o,children:n}),e[1]=o,e[2]=i,e[3]=s):s=e[3],s}const nt={github:st,gitlab:it,bitbucket:tt};function me(t){const e=P.c(4),{provider:i,size:o,className:n}=t,s=o===void 0?16:o,l=nt[i];let a;return e[0]!==l||e[1]!==n||e[2]!==s?(a=r.jsx(l,{size:s,className:n}),e[0]=l,e[1]=n,e[2]=s,e[3]=a):a=e[3],a}const ot=5*6e4;function rt(){const t=P.c(7),{org:e}=O(),i=F();let o;t[0]!==e.id?(o=A.gitProviderCapabilities(e.id),t[0]=e.id,t[1]=o):o=t[1];let n;t[2]!==i?(n=()=>i.call("GIT_PROVIDER_CAPABILITIES",{}),t[2]=i,t[3]=n):n=t[3];let s;return t[4]!==o||t[5]!==n?(s={queryKey:o,staleTime:ot,queryFn:n},t[4]=o,t[5]=n,t[6]=s):s=t[6],fe(s)}function lt(){const t=P.c(7),{org:e}=O(),i=F();let o;t[0]!==e.id?(o=A.gitAccounts(e.id),t[0]=e.id,t[1]=o):o=t[1];let n;t[2]!==i?(n=async()=>(await i.call("GIT_ACCOUNT_LIST",{})).accounts,t[2]=i,t[3]=n):n=t[3];let s;return t[4]!==o||t[5]!==n?(s={queryKey:o,staleTime:6e4,queryFn:n},t[4]=o,t[5]=n,t[6]=s):s=t[6],fe(s)}function ct(t){const e=P.c(9),{org:i}=O(),o=F();let n;e[0]!==t||e[1]!==i.id?(n=A.repositories(i.id,t),e[0]=t,e[1]=i.id,e[2]=n):n=e[2];let s;e[3]!==t||e[4]!==o?(s=async()=>(await o.call("REPOSITORY_LIST",{})).repositories,e[3]=t,e[4]=o,e[5]=s):s=e[5];let l;return e[6]!==n||e[7]!==s?(l={queryKey:n,staleTime:6e4,queryFn:s},e[6]=n,e[7]=s,e[8]=l):l=e[8],fe(l)}function at(t,e){const i=P.c(12),{org:o}=O(),n=F();let s;i[0]!==t||i[1]!==o.id||i[2]!==e?(s=A.providerRepoSearch(o.id,t??"",e),i[0]=t,i[1]=o.id,i[2]=e,i[3]=s):s=i[3];const l=t!==null;let a;i[4]!==t||i[5]!==e||i[6]!==n?(a=async f=>{const{pageParam:d}=f;return t===null?{repositories:[],hasMore:!1}:await n.call("REPOSITORY_SEARCH",{accountId:t,page:d,perPage:100,...e?{query:e}:{}})},i[4]=t,i[5]=e,i[6]=n,i[7]=a):a=i[7];let c;return i[8]!==s||i[9]!==l||i[10]!==a?(c={queryKey:s,enabled:l,initialPageParam:1,getNextPageParam:dt,staleTime:3e4,retry:!1,queryFn:a},i[8]=s,i[9]=l,i[10]=a,i[11]=c):c=i[11],Ke(c)}function dt(t,e){return t.hasMore?e.length+1:void 0}function ut(){const t=P.c(8),{org:e}=O(),i=F(),o=H();let n;t[0]!==i?(n=async a=>(await i.call("GIT_ACCOUNT_CONNECT_TOKEN",a)).account,t[0]=i,t[1]=n):n=t[1];let s;t[2]!==e||t[3]!==o?(s=()=>o.invalidateQueries({queryKey:A.gitAccounts(e.id)}),t[2]=e,t[3]=o,t[4]=s):s=t[4];let l;return t[5]!==n||t[6]!==s?(l={mutationFn:n,onSettled:s},t[5]=n,t[6]=s,t[7]=l):l=t[7],G(l)}function mt(){const t=P.c(8),{org:e}=O(),i=H();let o;t[0]!==e?(o=async()=>{const l=await fetch(`/api/${encodeURIComponent(e.slug)}/git-providers/github/cli/connect`,{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"}),a=await l.json().catch(pt);if(!l.ok){const c=ae({error:ne()}).safeParse(a);throw new Error(c.success?c.data.error:l.statusText)}return ae({account:ae({id:ne(),login:ne()})}).parse(a).account},t[0]=e,t[1]=o):o=t[1];let n;t[2]!==e||t[3]!==i?(n=()=>i.invalidateQueries({queryKey:A.gitAccounts(e.id)}),t[2]=e,t[3]=i,t[4]=n):n=t[4];let s;return t[5]!==o||t[6]!==n?(s={mutationFn:o,onSettled:n},t[5]=o,t[6]=n,t[7]=s):s=t[7],G(s)}function pt(){return null}function qt(){const t=P.c(8),{org:e}=O(),i=F(),o=H();let n;t[0]!==i?(n=a=>i.call("GIT_ACCOUNT_DELETE",{id:a}),t[0]=i,t[1]=n):n=t[1];let s;t[2]!==e||t[3]!==o?(s=()=>{o.invalidateQueries({queryKey:A.gitAccounts(e.id)}),o.invalidateQueries({queryKey:A.repositories(e.id)})},t[2]=e,t[3]=o,t[4]=s):s=t[4];let l;return t[5]!==n||t[6]!==s?(l={mutationFn:n,onSettled:s},t[5]=n,t[6]=s,t[7]=l):l=t[7],G(l)}function ft(){const t=P.c(8),{org:e}=O(),i=F(),o=H();let n;t[0]!==i?(n=async a=>(await i.call("REPOSITORY_LINK",a)).repository,t[0]=i,t[1]=n):n=t[1];let s;t[2]!==e||t[3]!==o?(s=()=>o.invalidateQueries({queryKey:A.repositories(e.id)}),t[2]=e,t[3]=o,t[4]=s):s=t[4];let l;return t[5]!==n||t[6]!==s?(l={mutationFn:n,onSettled:s},t[5]=n,t[6]=s,t[7]=l):l=t[7],G(l)}function ht(){const t=P.c(8),{org:e}=O(),i=F(),o=H();let n;t[0]!==i?(n=async a=>(await i.call("REPOSITORY_CREATE_FROM_TEMPLATE",a)).repository,t[0]=i,t[1]=n):n=t[1];let s;t[2]!==e||t[3]!==o?(s=()=>{o.invalidateQueries({queryKey:A.repositories(e.id)}),o.invalidateQueries({queryKey:A.gitAccounts(e.id)})},t[2]=e,t[3]=o,t[4]=s):s=t[4];let l;return t[5]!==n||t[6]!==s?(l={mutationFn:n,onSettled:s},t[5]=n,t[6]=s,t[7]=l):l=t[7],G(l)}function Kt(){const t=P.c(8),{org:e}=O(),i=F(),o=H();let n;t[0]!==i?(n=async a=>(await i.call("REPOSITORY_UPDATE",a)).repository,t[0]=i,t[1]=n):n=t[1];let s;t[2]!==e||t[3]!==o?(s=()=>o.invalidateQueries({queryKey:A.repositories(e.id)}),t[2]=e,t[3]=o,t[4]=s):s=t[4];let l;return t[5]!==n||t[6]!==s?(l={mutationFn:n,onSettled:s},t[5]=n,t[6]=s,t[7]=l):l=t[7],G(l)}function Mt(){const t=P.c(8),{org:e}=O(),i=F(),o=H();let n;t[0]!==i?(n=a=>i.call("REPOSITORY_DELETE",{id:a}),t[0]=i,t[1]=n):n=t[1];let s;t[2]!==e||t[3]!==o?(s=()=>o.invalidateQueries({queryKey:A.repositories(e.id)}),t[2]=e,t[3]=o,t[4]=s):s=t[4];let l;return t[5]!==n||t[6]!==s?(l={mutationFn:n,onSettled:s},t[5]=n,t[6]=s,t[7]=l):l=t[7],G(l)}function $e(t,e){return t instanceof Error&&t.message?t.message:e}const be={github:{label:"settings.repositories.providerGithub"},gitlab:{label:"settings.repositories.providerGitlab"},bitbucket:{label:"settings.repositories.providerBitbucket"}};function xt(t,e){return e.length===0?"settings.repositories.githubUnavailable":t==="github"?e.some(i=>i.kind==="cli")?"settings.repositories.githubCliHint":"settings.repositories.providerGithubHint":e.length>1?"settings.repositories.providerTokenOrOauthHint":"settings.repositories.providerTokenOnlyHint"}const pe={gitlab:{title:"settings.repositories.tokenDialogTitle",description:"settings.repositories.tokenDialogDescription",placeholder:"settings.repositories.tokenPlaceholder",steps:["settings.repositories.gitlabStep1","settings.repositories.gitlabStep2","settings.repositories.gitlabStep3","settings.repositories.gitlabStep4"],askHost:!0,askWorkspace:!1,askProject:!0},bitbucket:{title:"settings.repositories.tokenDialogTitleBitbucket",description:"settings.repositories.tokenDialogDescriptionBitbucket",placeholder:"settings.repositories.tokenPlaceholderBitbucket",steps:["settings.repositories.bitbucketStep1","settings.repositories.bitbucketStep2","settings.repositories.bitbucketStep3","settings.repositories.bitbucketStep4"],askHost:!1,askWorkspace:!0,askProject:!1}},gt=["github","gitlab","bitbucket"];function se(t,e,i){if(t==="github"){const s=e?.github;return s?.cliConnectPath?[{kind:"cli"}]:s?.configured&&s.connectPath?[{kind:"app",href:i(s.connectPath)}]:[]}const o=t==="gitlab"?e?.gitlab:e?.bitbucket,n=[{kind:"token"}];return o&&o.oauthHosts.length>0&&o.connectPath&&n.push({kind:"oauth",href:i(o.connectPath)}),n}function bt(t,e){if(t==="bitbucket"){const s=e.workspace.trim();return s?`https://bitbucket.org/${encodeURIComponent(s)}/workspace/repositories`:null}const i=e.host.trim();if(!i)return null;const o=e.project.trim().replace(/^\/+|\/+$/g,""),n="?name=Studio&scopes=api";return o?`https://${i}/${o}/-/settings/access_tokens${n}`:`https://${i}/-/user_settings/personal_access_tokens${n}`}function _e(t){const e=P.c(10),{layout:i,disabled:o}=t,n=i===void 0?"buttons":i,s=o===void 0?!1:o,l=L(),[a,c]=_.useState(null);let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=()=>c({name:"provider"}),e[0]=f):f=e[0];const d=f;let u;e[1]!==s||e[2]!==n||e[3]!==l?(u=n==="picker"?r.jsxs(R,{variant:"ghost",size:"sm",disabled:s,onClick:d,"aria-label":l("settings.repositories.addAccount"),className:"w-full h-auto justify-start gap-3 rounded-none px-4 py-3 hover:bg-accent",children:[r.jsx("span",{className:"size-8 rounded-lg bg-muted flex items-center justify-center shrink-0",children:r.jsx(de,{size:16})}),r.jsxs("span",{className:"flex-1 min-w-0 text-left",children:[r.jsx("span",{className:"block text-sm font-medium",children:l("settings.repositories.addAccount")}),r.jsx("span",{className:"block text-xs font-normal text-muted-foreground whitespace-normal",children:l("settings.repositories.addAccountDescription")})]}),r.jsx("span",{className:"shrink-0 text-muted-foreground",children:r.jsx(X,{size:16})})]}):r.jsxs(R,{variant:"outline",size:"sm",disabled:s,onClick:d,children:[r.jsx(de,{size:16}),l("settings.repositories.addAccount")]}),e[1]=s,e[2]=n,e[3]=l,e[4]=u):u=e[4];let p;e[5]!==a?(p=a&&r.jsx(kt,{stage:a,onStage:c,onClose:()=>c(null)}),e[5]=a,e[6]=p):p=e[6];let m;return e[7]!==u||e[8]!==p?(m=r.jsxs(r.Fragment,{children:[u,p]}),e[7]=u,e[8]=p,e[9]=m):m=e[9],m}function kt({stage:t,onStage:e,onClose:i}){const o=L(),n=rt(),s=mt(),{org:l}=O(),a=`/${l.slug}/settings/repositories`,c=m=>`${m}?returnTo=${encodeURIComponent(a)}`;function f(m){const h=se(m,n.data,c),x=h.length===1?h[0]:void 0;if(x?.kind==="cli"){s.mutate(void 0,{onSuccess:g=>{re.success(o("settings.repositories.connected",{login:g.login})),i()},onError:g=>re.error($e(g,o("settings.repositories.failed")))});return}if(x?.href){globalThis.location.href=x.href;return}if(x?.kind==="token"){e({name:"token",provider:m});return}e({name:"method",provider:m})}const d=m=>e(se(m,n.data,c).length>1?{name:"method",provider:m}:{name:"provider"}),u=t.name==="token"?o(pe[t.provider].title):t.name==="method"?o(be[t.provider].label):o("settings.repositories.addAccountTitle"),p=t.name==="token"?o(pe[t.provider].description):t.name==="method"?o("settings.repositories.chooseMethodDescription"):o("settings.repositories.addAccountDescription");return r.jsx(je,{open:!0,onOpenChange:m=>!m&&i(),children:r.jsxs(ye,{className:"sm:max-w-md",children:[r.jsxs(ve,{children:[r.jsx(Ne,{children:u}),r.jsx(Se,{children:p})]}),t.name==="token"?r.jsx(jt,{provider:t.provider,onBack:()=>d(t.provider),onClose:i}):n.isError?r.jsxs("div",{className:"flex flex-col items-start gap-2",children:[r.jsx("p",{role:"alert",className:"text-sm text-destructive",children:o("settings.repositories.failed")}),r.jsx(R,{variant:"outline",size:"sm",onClick:()=>n.refetch(),children:o("settings.repositories.tryAgain")})]}):n.isPending?r.jsxs("div",{className:"flex flex-col gap-2",children:[r.jsx(oe,{className:"h-14 w-full"}),r.jsx(oe,{className:"h-14 w-full"})]}):t.name==="provider"?r.jsx("div",{className:"flex flex-col gap-1",children:gt.map(m=>{const h=se(m,n.data,c);return r.jsx(ke,{icon:r.jsx(me,{provider:m,size:16}),label:o(h[0]?.kind==="cli"?"settings.repositories.connectGithubCli":be[m].label),description:o(xt(m,h)),disabled:h.length===0||s.isPending,onClick:()=>f(m)},m)})}):r.jsx("div",{className:"flex flex-col gap-1",children:se(t.provider,n.data,c).map(m=>r.jsx(ke,{icon:r.jsx(me,{provider:t.provider,size:16}),label:o(m.kind==="cli"?"settings.repositories.connectGithubCli":m.kind==="token"?"settings.repositories.methodToken":m.kind==="oauth"?"settings.repositories.methodOauth":"settings.repositories.methodApp"),description:o(m.kind==="cli"?"settings.repositories.githubCliHint":m.kind==="token"?"settings.repositories.methodTokenHint":m.kind==="oauth"?"settings.repositories.methodOauthHint":"settings.repositories.methodAppHint"),note:m.kind==="oauth"?o("settings.repositories.methodOauthScopeNote"):void 0,href:m.href,onClick:m.kind==="cli"?()=>f(t.provider):m.kind==="token"?()=>e({name:"token",provider:t.provider}):void 0},m.kind))}),t.name==="method"&&r.jsx(Pe,{className:"sm:justify-start",children:r.jsxs(R,{variant:"ghost",size:"sm",onClick:()=>e({name:"provider"}),children:[r.jsx(le,{size:16}),o("settings.repositories.back")]})})]})})}function ke(t){const e=P.c(32),{icon:i,label:o,description:n,note:s,href:l,onClick:a,disabled:c}=t;let f;e[0]!==i?(f=r.jsx("span",{className:"size-8 rounded-lg bg-muted flex items-center justify-center shrink-0",children:i}),e[0]=i,e[1]=f):f=e[1];let d;e[2]!==o?(d=r.jsx("span",{className:"block text-sm font-medium",children:o}),e[2]=o,e[3]=d):d=e[3];let u;e[4]!==n?(u=r.jsx("span",{className:"block text-xs font-normal text-muted-foreground whitespace-normal",children:n}),e[4]=n,e[5]=u):u=e[5];let p;e[6]!==s?(p=s&&r.jsx("span",{className:"block text-xs font-normal text-warning whitespace-normal mt-0.5",children:s}),e[6]=s,e[7]=p):p=e[7];let m;e[8]!==d||e[9]!==u||e[10]!==p?(m=r.jsxs("span",{className:"flex-1 min-w-0 text-left",children:[d,u,p]}),e[8]=d,e[9]=u,e[10]=p,e[11]=m):m=e[11];let h;e[12]!==c?(h=!c&&r.jsx("span",{className:"shrink-0 text-muted-foreground",children:r.jsx(X,{size:16})}),e[12]=c,e[13]=h):h=e[13];let x;e[14]!==f||e[15]!==m||e[16]!==h?(x=r.jsxs(r.Fragment,{children:[f,m,h]}),e[14]=f,e[15]=m,e[16]=h,e[17]=x):x=e[17];const g=x,k=!!l&&!c;let b;e[18]!==g||e[19]!==c||e[20]!==l?(b=l&&!c?r.jsx("a",{href:l,children:g}):g,e[18]=g,e[19]=c,e[20]=l,e[21]=b):b=e[21];let j;e[22]!==c||e[23]!==o||e[24]!==a||e[25]!==k||e[26]!==b?(j=r.jsx(R,{variant:"ghost","aria-label":o,disabled:c,asChild:k,onClick:a,className:"w-full h-auto justify-start gap-3 px-3 py-3 hover:bg-accent",children:b}),e[22]=c,e[23]=o,e[24]=a,e[25]=k,e[26]=b,e[27]=j):j=e[27];const v=j;let S;return e[28]!==v||e[29]!==n||e[30]!==c?(S=c?r.jsxs(He,{children:[r.jsx(Ge,{asChild:!0,children:r.jsx("span",{tabIndex:0,children:v})}),r.jsx(qe,{children:n})]}):v,e[28]=v,e[29]=n,e[30]=c,e[31]=S):S=e[31],S}function jt(t){const e=P.c(89),{provider:i,onBack:o,onClose:n}=t,s=L(),l=pe[i],a=ut(),[c,f]=_.useState(Ee[i]),[d,u]=_.useState(""),[p,m]=_.useState(""),[h,x]=_.useState("");let g;e[0]!==l.askWorkspace||e[1]!==c||e[2]!==h||e[3]!==d?(g=!!c.trim()&&!!h.trim()&&(!l.askWorkspace||!!d.trim()),e[0]=l.askWorkspace,e[1]=c,e[2]=h,e[3]=d,e[4]=g):g=e[4];const k=g;let b;e[5]!==c||e[6]!==p||e[7]!==i||e[8]!==d?(b=bt(i,{host:c,workspace:d,project:p}),e[5]=c,e[6]=p,e[7]=i,e[8]=d,e[9]=b):b=e[9];const j=b;let v;e[10]!==a||e[11]!==l.askWorkspace||e[12]!==c||e[13]!==n||e[14]!==i||e[15]!==k||e[16]!==s||e[17]!==h||e[18]!==d?(v=function(){k&&a.mutate({type:i,host:c.trim(),token:h.trim(),...l.askWorkspace?{workspace:d.trim()}:{}},{onSuccess:J=>{re.success(s("settings.repositories.connected",{login:J.login})),x(""),n()},onError:J=>re.error($e(J,s("settings.repositories.failed")))})},e[10]=a,e[11]=l.askWorkspace,e[12]=c,e[13]=n,e[14]=i,e[15]=k,e[16]=s,e[17]=h,e[18]=d,e[19]=v):v=e[19];const S=v;let w;e[20]!==l.askHost||e[21]!==c||e[22]!==i||e[23]!==s?(w=l.askHost&&r.jsx(ie,{id:`${i}-host`,label:s("settings.repositories.tokenHostLabel"),value:c,onChange:f,placeholder:s("settings.repositories.tokenHostPlaceholder")}),e[20]=l.askHost,e[21]=c,e[22]=i,e[23]=s,e[24]=w):w=e[24];let N;e[25]!==l.askWorkspace||e[26]!==i||e[27]!==s||e[28]!==d?(N=l.askWorkspace&&r.jsx(ie,{id:`${i}-workspace`,label:s("settings.repositories.tokenWorkspaceLabel"),value:d,onChange:u,placeholder:s("settings.repositories.tokenWorkspacePlaceholder"),hint:s("settings.repositories.tokenWorkspaceHint")}),e[25]=l.askWorkspace,e[26]=i,e[27]=s,e[28]=d,e[29]=N):N=e[29];let T;e[30]!==l.askProject||e[31]!==p||e[32]!==i||e[33]!==s?(T=l.askProject&&r.jsx(ie,{id:`${i}-project`,label:s("settings.repositories.tokenProjectLabel"),value:p,onChange:m,placeholder:s("settings.repositories.tokenProjectPlaceholder"),hint:s("settings.repositories.tokenProjectHint")}),e[30]=l.askProject,e[31]=p,e[32]=i,e[33]=s,e[34]=T):T=e[34];let y;e[35]!==s?(y=s("settings.repositories.tokenStepsTitle"),e[35]=s,e[36]=y):y=e[36];let C;e[37]!==y?(C=r.jsx("p",{className:"text-xs font-medium",children:y}),e[37]=y,e[38]=C):C=e[38];let E;if(e[39]!==l.steps||e[40]!==s){let Z;e[42]!==s?(Z=J=>r.jsx("li",{children:s(J)},J),e[42]=s,e[43]=Z):Z=e[43],E=l.steps.map(Z),e[39]=l.steps,e[40]=s,e[41]=E}else E=e[41];let $;e[44]!==E?($=r.jsx("ol",{className:"flex flex-col gap-1 list-decimal pl-4 text-xs text-muted-foreground",children:E}),e[44]=E,e[45]=$):$=e[45];let z;e[46]!==j||e[47]!==s?(z=j&&r.jsx(R,{variant:"outline",size:"sm",className:"self-start",asChild:!0,children:r.jsxs("a",{href:j,target:"_blank",rel:"noreferrer",children:[r.jsx(Ie,{size:14}),s("settings.repositories.openProvider")]})}),e[46]=j,e[47]=s,e[48]=z):z=e[48];let D;e[49]!==$||e[50]!==z||e[51]!==C?(D=r.jsxs("div",{className:"rounded-lg border border-border/60 bg-muted/40 p-3 flex flex-col gap-2",children:[C,$,z]}),e[49]=$,e[50]=z,e[51]=C,e[52]=D):D=e[52];const q=`${i}-token`;let I;e[53]!==s?(I=s("settings.repositories.tokenLabel"),e[53]=s,e[54]=I):I=e[54];let K;e[55]!==l.placeholder||e[56]!==s?(K=s(l.placeholder),e[55]=l.placeholder,e[56]=s,e[57]=K):K=e[57];let M;e[58]!==q||e[59]!==I||e[60]!==K||e[61]!==h?(M=r.jsx(ie,{id:q,label:I,value:h,onChange:x,placeholder:K,type:"password"}),e[58]=q,e[59]=I,e[60]=K,e[61]=h,e[62]=M):M=e[62];let U;e[63]!==D||e[64]!==M||e[65]!==w||e[66]!==N||e[67]!==T?(U=r.jsxs("div",{className:"flex flex-col gap-3",children:[w,N,T,D,M]}),e[63]=D,e[64]=M,e[65]=w,e[66]=N,e[67]=T,e[68]=U):U=e[68];const De=a.isPending;let ee;e[69]===Symbol.for("react.memo_cache_sentinel")?(ee=r.jsx(le,{size:16}),e[69]=ee):ee=e[69];let W;e[70]!==s?(W=s("settings.repositories.back"),e[70]=s,e[71]=W):W=e[71];let B;e[72]!==a.isPending||e[73]!==o||e[74]!==W?(B=r.jsxs(R,{variant:"ghost",size:"sm",onClick:o,disabled:De,children:[ee,W]}),e[72]=a.isPending,e[73]=o,e[74]=W,e[75]=B):B=e[75];const ce=!k||a.isPending;let Q;e[76]!==a.isPending||e[77]!==s?(Q=a.isPending?s("settings.repositories.connecting"):s("settings.repositories.connect"),e[76]=a.isPending,e[77]=s,e[78]=Q):Q=e[78];let Y;e[79]!==S||e[80]!==ce||e[81]!==Q?(Y=r.jsx(R,{onClick:S,disabled:ce,children:Q}),e[79]=S,e[80]=ce,e[81]=Q,e[82]=Y):Y=e[82];let V;e[83]!==B||e[84]!==Y?(V=r.jsxs(Pe,{className:"sm:justify-between",children:[B,Y]}),e[83]=B,e[84]=Y,e[85]=V):V=e[85];let te;return e[86]!==U||e[87]!==V?(te=r.jsxs(r.Fragment,{children:[U,V]}),e[86]=U,e[87]=V,e[88]=te):te=e[88],te}function ie(t){const e=P.c(17),{id:i,label:o,value:n,onChange:s,placeholder:l,hint:a,type:c}=t;let f;e[0]!==i||e[1]!==o?(f=r.jsx(Ce,{htmlFor:i,children:o}),e[0]=i,e[1]=o,e[2]=f):f=e[2];let d;e[3]!==s?(d=h=>s(h.target.value),e[3]=s,e[4]=d):d=e[4];let u;e[5]!==i||e[6]!==l||e[7]!==d||e[8]!==c||e[9]!==n?(u=r.jsx(we,{id:i,type:c,value:n,onChange:d,placeholder:l,autoComplete:"off"}),e[5]=i,e[6]=l,e[7]=d,e[8]=c,e[9]=n,e[10]=u):u=e[10];let p;e[11]!==a?(p=a&&r.jsx("p",{className:"text-xs text-muted-foreground",children:a}),e[11]=a,e[12]=p):p=e[12];let m;return e[13]!==f||e[14]!==u||e[15]!==p?(m=r.jsxs("div",{className:"flex flex-col gap-1.5",children:[f,u,p]}),e[13]=f,e[14]=u,e[15]=p,e[16]=m):m=e[16],m}function ze(t){const e=P.c(3),{provider:i,className:o}=t;let n;return e[0]!==o||e[1]!==i?(n=r.jsx(me,{provider:i,size:16,className:o}),e[0]=o,e[1]=i,e[2]=n):n=e[2],n}function ge(t){const e=P.c(8),{account:i,className:o}=t;let n;e[0]!==i.avatarUrl?(n=i.avatarUrl?.trim()||void 0,e[0]=i.avatarUrl,e[1]=n):n=e[1];let s;e[2]!==i.type?(s=r.jsx(ze,{provider:i.type,className:"text-muted-foreground"}),e[2]=i.type,e[3]=s):s=e[3];let l;return e[4]!==o||e[5]!==n||e[6]!==s?(l=r.jsx(We,{url:n,fallback:s,shape:"circle",size:"sm",className:o,muted:!0}),e[4]=o,e[5]=n,e[6]=s,e[7]=l):l=e[7],l}function yt(t){return(t??[]).filter(e=>e.status==="active"&&e.servable)}function Ae(t){const e=P.c(12),{title:i,accounts:o,onSelect:n,disabled:s}=t;let l;e[0]!==i?(l=r.jsx("p",{className:"px-4 py-2 text-xs font-medium text-muted-foreground",children:i}),e[0]=i,e[1]=l):l=e[1];let a;if(e[2]!==o||e[3]!==s||e[4]!==n){let f;e[6]!==s||e[7]!==n?(f=d=>r.jsxs("button",{type:"button",onClick:()=>n(d),disabled:s,className:"w-full flex items-center gap-3 px-4 py-3 text-left hover:bg-accent transition-colors focus-visible:outline-none focus-visible:bg-accent disabled:opacity-50",children:[r.jsx(ge,{account:d,className:"size-8"}),r.jsxs("span",{className:"flex-1 min-w-0",children:[r.jsx("span",{className:"block text-sm font-medium truncate",children:d.login}),r.jsx("span",{className:"block text-xs text-muted-foreground truncate",children:d.host})]}),r.jsx(X,{size:16,className:"text-muted-foreground"})]},d.id),e[6]=s,e[7]=n,e[8]=f):f=e[8],a=o.map(f),e[2]=o,e[3]=s,e[4]=n,e[5]=a}else a=e[5];let c;return e[9]!==l||e[10]!==a?(c=r.jsxs("div",{className:"py-2",children:[l,a]}),e[9]=l,e[10]=a,e[11]=c):c=e[11],c}const Re={storefront:{icon:Ue,title:"common.createSite.templates.storefront.title",description:"common.createSite.templates.storefront.description"},blog:{icon:Me,title:"common.createSite.templates.blog.title",description:"common.createSite.templates.blog.description"}};function Ut(t){return Re[t].title}function vt(t){const e=P.c(41),{accounts:i,pending:o,onExit:n,onCreate:s}=t,l=L();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={kind:"template"},e[0]=a):a=e[0];const[c,f]=_.useState(a);let d;e[1]!==n||e[2]!==c.kind||e[3]!==c.template?(d=function(){c.kind==="template"?n():c.kind==="account"?f({kind:"template"}):f({kind:"account",template:c.template})},e[1]=n,e[2]=c.kind,e[3]=c.template,e[4]=d):d=e[4];const u=d;let p;e[5]!==l?(p=l("common.repositoryPicker.back"),e[5]=l,e[6]=p):p=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=r.jsx(le,{size:16}),e[7]=m):m=e[7];let h;e[8]!==u||e[9]!==o||e[10]!==p?(h=r.jsx(R,{size:"icon",variant:"ghost",className:"size-6 -ml-1",disabled:o,onClick:u,"aria-label":p,children:m}),e[8]=u,e[9]=o,e[10]=p,e[11]=h):h=e[11];let x;e[12]!==l?(x=l("common.createSite.entry"),e[12]=l,e[13]=x):x=e[13];let g;e[14]!==x?(g=r.jsx("span",{className:"text-sm font-medium truncate",children:x}),e[14]=x,e[15]=g):g=e[15];let k;e[16]!==h||e[17]!==g?(k=r.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 pr-12 gap-3 shrink-0",children:[h,g]}),e[16]=h,e[17]=g,e[18]=k):k=e[18];let b;e[19]!==c.kind||e[20]!==l?(b=c.kind==="template"&&r.jsxs("div",{className:"py-2",children:[r.jsx("p",{className:"px-4 py-2 text-xs font-medium text-muted-foreground",children:l("common.createSite.templateSection")}),Ve.map(N=>{const{id:T}=N,y=Re[T],C=y.icon;return r.jsxs("button",{type:"button",onClick:()=>f({kind:"account",template:T}),className:"w-full flex items-center gap-3 px-4 py-3 text-left hover:bg-accent transition-colors focus-visible:outline-none focus-visible:bg-accent",children:[r.jsx("div",{className:"size-8 rounded-lg bg-muted flex items-center justify-center shrink-0",children:r.jsx(C,{size:16,className:"text-muted-foreground"})}),r.jsxs("span",{className:"flex-1 min-w-0",children:[r.jsx("span",{className:"block text-sm font-medium truncate",children:l(y.title)}),r.jsx("span",{className:"block text-xs text-muted-foreground truncate",children:l(y.description)})]}),r.jsx(X,{size:16,className:"shrink-0 text-muted-foreground"})]},T)})]}),e[19]=c.kind,e[20]=l,e[21]=b):b=e[21];let j;e[22]!==i||e[23]!==o||e[24]!==c.kind||e[25]!==c.template||e[26]!==l?(j=c.kind==="account"&&r.jsxs(r.Fragment,{children:[i.length>0?r.jsx(Ae,{title:l("common.createSite.accountSection"),accounts:i,onSelect:N=>f({kind:"name",template:c.template,account:N}),disabled:o}):r.jsx("p",{className:"px-4 pt-4 pb-2 text-sm text-muted-foreground",children:l("common.createSite.noGithubAccount")}),r.jsxs("div",{className:"border-t border-border py-2",children:[r.jsx("p",{className:"px-4 py-2 text-xs text-muted-foreground leading-relaxed",children:l("common.createSite.accountHint")}),r.jsx(_e,{layout:"picker",disabled:o})]})]}),e[22]=i,e[23]=o,e[24]=c.kind,e[25]=c.template,e[26]=l,e[27]=j):j=e[27];let v;e[28]!==s||e[29]!==o||e[30]!==c.account||e[31]!==c.kind||e[32]!==c.template?(v=c.kind==="name"&&r.jsx(Nt,{account:c.account,pending:o,onSubmit:N=>s({template:c.template,account:c.account,name:N})}),e[28]=s,e[29]=o,e[30]=c.account,e[31]=c.kind,e[32]=c.template,e[33]=v):v=e[33];let S;e[34]!==j||e[35]!==v||e[36]!==b?(S=r.jsxs("div",{className:"flex-1 overflow-y-auto",children:[b,j,v]}),e[34]=j,e[35]=v,e[36]=b,e[37]=S):S=e[37];let w;return e[38]!==S||e[39]!==k?(w=r.jsxs(r.Fragment,{children:[k,S]}),e[38]=S,e[39]=k,e[40]=w):w=e[40],w}function Nt(t){const e=P.c(53),{account:i,pending:o,onSubmit:n}=t,s=L(),[l,a]=_.useState("");let c;e[0]!==l?(c=Je.safeParse(l),e[0]=l,e[1]=c):c=e[1];const f=c,d=l.length>0&&!f.success;let u;e[2]!==n||e[3]!==f.data||e[4]!==f.success||e[5]!==o?(u=function(I){I.preventDefault(),f.success&&!o&&n(f.data)},e[2]=n,e[3]=f.data,e[4]=f.success,e[5]=o,e[6]=u):u=e[6];const p=u;let m;e[7]!==i?(m=r.jsx(ge,{account:i,className:"size-6"}),e[7]=i,e[8]=m):m=e[8];let h;e[9]!==i.login?(h=r.jsx("span",{className:"font-medium truncate",children:i.login}),e[9]=i.login,e[10]=h):h=e[10];let x;e[11]!==m||e[12]!==h?(x=r.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[m,h]}),e[11]=m,e[12]=h,e[13]=x):x=e[13];let g;e[14]!==s?(g=s("common.createSite.nameLabel"),e[14]=s,e[15]=g):g=e[15];let k;e[16]!==g?(k=r.jsx(Ce,{htmlFor:"create-site-name",children:g}),e[16]=g,e[17]=k):k=e[17];let b;e[18]!==s?(b=s("common.createSite.namePlaceholder"),e[18]=s,e[19]=b):b=e[19];let j;e[20]===Symbol.for("react.memo_cache_sentinel")?(j=q=>a(q.target.value.toLowerCase().replace(/[\s_]+/g,"-")),e[20]=j):j=e[20];let v;e[21]!==l||e[22]!==o||e[23]!==d||e[24]!==b?(v=r.jsx(we,{id:"create-site-name",autoFocus:!0,autoComplete:"off",spellCheck:!1,value:l,disabled:o,placeholder:b,"aria-invalid":d,onChange:j}),e[21]=l,e[22]=o,e[23]=d,e[24]=b,e[25]=v):v=e[25];const S=d?"text-destructive":"text-muted-foreground";let w;e[26]!==S?(w=he("text-xs",S),e[26]=S,e[27]=w):w=e[27];let N;e[28]!==i.login||e[29]!==l||e[30]!==d||e[31]!==s?(N=d?s("common.createSite.nameInvalid"):s("common.createSite.nameHint",{path:`${i.login}/${l.trim()||s("common.createSite.namePlaceholder")}`}),e[28]=i.login,e[29]=l,e[30]=d,e[31]=s,e[32]=N):N=e[32];let T;e[33]!==w||e[34]!==N?(T=r.jsx("p",{className:w,children:N}),e[33]=w,e[34]=N,e[35]=T):T=e[35];let y;e[36]!==v||e[37]!==T||e[38]!==k?(y=r.jsxs("div",{className:"flex flex-col gap-2",children:[k,v,T]}),e[36]=v,e[37]=T,e[38]=k,e[39]=y):y=e[39];const C=!f.success||o;let E;e[40]!==o?(E=o&&r.jsx(xe,{className:"size-4"}),e[40]=o,e[41]=E):E=e[41];let $;e[42]!==s?($=s("common.createSite.create"),e[42]=s,e[43]=$):$=e[43];let z;e[44]!==C||e[45]!==E||e[46]!==$?(z=r.jsxs(R,{type:"submit",disabled:C,children:[E,$]}),e[44]=C,e[45]=E,e[46]=$,e[47]=z):z=e[47];let D;return e[48]!==p||e[49]!==y||e[50]!==z||e[51]!==x?(D=r.jsxs("form",{onSubmit:p,className:"p-4 flex flex-col gap-4",children:[x,y,z]}),e[48]=p,e[49]=y,e[50]=z,e[51]=x,e[52]=D):D=e[52],D}const St="create-site";function Oe(t){const e=P.c(20),{provider:i,path:o,host:n,hint:s,disabled:l,busy:a,onSelect:c}=t,f=l&&"opacity-60 cursor-not-allowed";let d;e[0]!==f?(d=he("w-full flex items-center gap-3 px-4 py-3 text-left hover:bg-accent transition-colors focus-visible:outline-none focus-visible:bg-accent",f),e[0]=f,e[1]=d):d=e[1];let u;e[2]!==i?(u=r.jsx("div",{className:"size-8 rounded-lg bg-muted flex items-center justify-center shrink-0",children:r.jsx(ze,{provider:i,className:"text-muted-foreground"})}),e[2]=i,e[3]=u):u=e[3];let p;e[4]!==o?(p=r.jsx("span",{className:"block text-sm font-medium truncate",children:o}),e[4]=o,e[5]=p):p=e[5];const m=s?`${n} · ${s}`:n;let h;e[6]!==m?(h=r.jsx("span",{className:"block text-xs text-muted-foreground truncate",children:m}),e[6]=m,e[7]=h):h=e[7];let x;e[8]!==p||e[9]!==h?(x=r.jsxs("span",{className:"flex-1 min-w-0",children:[p,h]}),e[8]=p,e[9]=h,e[10]=x):x=e[10];let g;e[11]!==a?(g=a?r.jsx(xe,{className:"size-4 text-muted-foreground"}):r.jsx(X,{size:16,className:"shrink-0 text-muted-foreground"}),e[11]=a,e[12]=g):g=e[12];let k;return e[13]!==l||e[14]!==c||e[15]!==d||e[16]!==u||e[17]!==x||e[18]!==g?(k=r.jsxs("button",{type:"button",disabled:l,onClick:c,className:d,children:[u,x,g]}),e[13]=l,e[14]=c,e[15]=d,e[16]=u,e[17]=x,e[18]=g,e[19]=k):k=e[19],k}function Pt(t){const e=P.c(25),{onPick:i,pendingPath:o}=t,n=L(),s=ct(),[l,a]=_.useState("");if(s.isPending){let d;return e[0]===Symbol.for("react.memo_cache_sentinel")?(d=r.jsx(oe,{className:"h-24 w-full"}),e[0]=d):d=e[0],d}if(s.isError){let d;return e[1]!==s.error.message?(d=r.jsx("p",{role:"alert",className:"p-4 text-sm text-destructive",children:s.error.message}),e[1]=s.error.message,e[2]=d):d=e[2],d}let c,f;if(e[3]!==i||e[4]!==o||e[5]!==l||e[6]!==s.data||e[7]!==n){f=Symbol.for("react.early_return_sentinel");e:{const d=s.data??[];if(d.length===0){f=null;break e}let u;e[10]!==l?(u=j=>j.path.toLowerCase().includes(l.trim().toLowerCase()),e[10]=l,e[11]=u):u=e[11];const p=d.filter(u);let m;e[12]!==n?(m=n("common.repositoryPicker.searchPlaceholder"),e[12]=n,e[13]=m):m=e[13];const h=o!==null;let x;e[14]!==l||e[15]!==m||e[16]!==h?(x=r.jsx(Te,{value:l,onChange:a,placeholder:m,disabled:h}),e[14]=l,e[15]=m,e[16]=h,e[17]=x):x=e[17];let g;e[18]!==n?(g=n("common.repositoryPicker.linkedSection"),e[18]=n,e[19]=g):g=e[19];let k;e[20]!==g?(k=r.jsx("p",{className:"px-4 pt-4 pb-2 text-xs font-medium text-muted-foreground",children:g}),e[20]=g,e[21]=k):k=e[21];let b;e[22]!==i||e[23]!==o?(b=j=>r.jsx(Oe,{provider:j.provider,path:j.path,host:j.host,hint:j.defaultBranch,disabled:o!==null,busy:o===j.id,onSelect:()=>i(j)},j.id),e[22]=i,e[23]=o,e[24]=b):b=e[24],c=r.jsxs("div",{className:"pb-2",children:[x,k,p.length===0&&r.jsx("p",{className:"px-4 py-6 text-center text-sm text-muted-foreground",children:n("common.repositoryPicker.searchEmpty")}),p.map(b)]})}e[3]=i,e[4]=o,e[5]=l,e[6]=s.data,e[7]=n,e[8]=c,e[9]=f}else c=e[8],f=e[9];return f!==Symbol.for("react.early_return_sentinel")?f:c}function wt(t){const e=P.c(35),{account:i,onLink:o,pendingPath:n}=t,s=L(),[l,a]=_.useState(""),c=Be(l,300),f=_.useDeferredValue(c),d=l!==f,u=at(i.id,f);let p,m,h,x;if(e[0]!==d||e[1]!==o||e[2]!==n||e[3]!==l||e[4]!==u.data?.pages||e[5]!==u.error||e[6]!==u.hasNextPage||e[7]!==u.isError||e[8]!==u.isFetching||e[9]!==u.isPending||e[10]!==s){const j=u.data?.pages.flatMap(Ct)??[];h="h-80 min-h-0 flex flex-col overflow-hidden";let v;e[15]!==s?(v=s("common.repositoryPicker.searchPlaceholder"),e[15]=s,e[16]=v):v=e[16];const S=d||u.isFetching;e[17]!==l||e[18]!==v||e[19]!==S?(x=r.jsx(Te,{placeholder:v,value:l,onChange:a,isSearching:S}),e[17]=l,e[18]=v,e[19]=S,e[20]=x):x=e[20];const w=d?"opacity-40":"opacity-100";e[21]!==w?(p=he("flex-1 overflow-y-auto transition-opacity duration-150",w),e[21]=w,e[22]=p):p=e[22],m=u.isPending?r.jsx("div",{className:"flex-1 flex items-center justify-center py-10",children:r.jsx(xe,{className:"size-4.5 text-muted-foreground"})}):u.isError?r.jsx("p",{className:"px-4 py-10 text-center text-sm text-muted-foreground",children:u.error instanceof Error?u.error.message:s("common.repositoryPicker.searchFailed")}):j.length===0?r.jsx("p",{className:"px-4 py-10 text-center text-sm text-muted-foreground",children:s(u.hasNextPage?"common.repositoryPicker.searchMore":"common.repositoryPicker.searchEmpty")}):j.map(N=>r.jsx(Oe,{provider:N.ref.provider,path:N.ref.path,host:N.ref.host,hint:N.visibility,disabled:n!==null,busy:n===N.ref.path,onSelect:()=>o(N.webUrl,N.ref.path)},`${N.ref.host}/${N.ref.path}`)),e[0]=d,e[1]=o,e[2]=n,e[3]=l,e[4]=u.data?.pages,e[5]=u.error,e[6]=u.hasNextPage,e[7]=u.isError,e[8]=u.isFetching,e[9]=u.isPending,e[10]=s,e[11]=p,e[12]=m,e[13]=h,e[14]=x}else p=e[11],m=e[12],h=e[13],x=e[14];let g;e[23]!==n||e[24]!==u||e[25]!==s?(g=u.hasNextPage&&r.jsx(R,{variant:"ghost",className:"w-full",disabled:u.isFetchingNextPage||n!==null,onClick:()=>{u.fetchNextPage()},children:s("common.repositoryPicker.loadMore")}),e[23]=n,e[24]=u,e[25]=s,e[26]=g):g=e[26];let k;e[27]!==p||e[28]!==m||e[29]!==g?(k=r.jsxs("div",{className:p,children:[m,g]}),e[27]=p,e[28]=m,e[29]=g,e[30]=k):k=e[30];let b;return e[31]!==h||e[32]!==x||e[33]!==k?(b=r.jsxs("div",{className:h,children:[x,k]}),e[31]=h,e[32]=x,e[33]=k,e[34]=b):b=e[34],b}function Ct(t){return t.repositories}function Wt({open:t,onOpenChange:e,title:i,onPicked:o,onError:n,allowCreateSite:s=!1}){const l=L(),a=lt(),c=ft(),f=ht(),d=Qe("site_create_enabled")&&s,[u,p]=_.useState(null),[m,h]=_.useState(!1),[x,g]=_.useState(null),[k,b]=_.useState(null),j=yt(a.data),v=j.filter(y=>y.type==="github");function S(y){const C=y instanceof Error?y.message:l("common.repositoryPicker.linkFailed");b(C),n?.(C)}async function w(y){g(y.id),b(null);try{await o({repository:y})}catch(C){S(C)}finally{g(null)}}async function N(y,C){if(u){g(C),b(null);try{const E=await c.mutateAsync({url:y,accountId:u.id});await o({repository:E})}catch(E){S(E)}finally{g(null)}}}async function T({template:y,account:C,name:E}){g(St),b(null);try{const $=await f.mutateAsync({accountId:C.id,name:E,template:y});await o({repository:$,createdFromTemplate:y})}catch($){S($)}finally{g(null)}}return r.jsx(je,{open:t,onOpenChange:y=>{x===null&&(y||(p(null),h(!1),b(null)),e(y))},children:r.jsxs(ye,{className:"sm:max-w-lg max-h-[85svh] p-0 gap-0 overflow-hidden flex flex-col",children:[r.jsxs(ve,{className:"sr-only",children:[r.jsx(Ne,{children:i}),r.jsx(Se,{children:l("common.repositoryPicker.description")})]}),m?r.jsx(vt,{accounts:v,pending:x!==null,onExit:()=>{h(!1),b(null)},onCreate:y=>{T(y)}}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 pr-12 gap-3 shrink-0",children:[u?r.jsx(R,{size:"icon",variant:"ghost",className:"size-6 -ml-1",disabled:x!==null,onClick:()=>p(null),"aria-label":l("common.repositoryPicker.back"),children:r.jsx(le,{size:16})}):r.jsx(Le,{size:16,className:"text-muted-foreground shrink-0"}),u&&r.jsx(ge,{account:u,className:"size-6"}),r.jsx("span",{className:"text-sm font-medium truncate",children:u?u.login:i})]}),a.isPending?r.jsx("div",{className:"p-4",children:r.jsx(oe,{className:"h-24 w-full"})}):a.isError?r.jsx("p",{role:"alert",className:"p-4 text-sm text-destructive",children:a.error.message}):u?r.jsx(wt,{account:u,onLink:(y,C)=>{N(y,C)},pendingPath:x},u.id):r.jsxs("div",{className:"flex-1 overflow-y-auto",children:[d&&r.jsx("div",{className:"border-b border-border py-2",children:r.jsxs("button",{type:"button",disabled:x!==null,onClick:()=>{h(!0),b(null)},className:"w-full flex items-center gap-3 px-4 py-3 text-left hover:bg-accent transition-colors focus-visible:outline-none focus-visible:bg-accent disabled:opacity-50",children:[r.jsx("div",{className:"size-8 rounded-lg bg-muted flex items-center justify-center shrink-0",children:r.jsx(de,{size:16,className:"text-muted-foreground"})}),r.jsxs("span",{className:"flex-1 min-w-0",children:[r.jsx("span",{className:"block text-sm font-medium truncate",children:l("common.createSite.entry")}),r.jsx("span",{className:"block text-xs text-muted-foreground truncate",children:l("common.createSite.entryHint")})]}),r.jsx(X,{size:16,className:"shrink-0 text-muted-foreground"})]})}),r.jsx(Pt,{onPick:w,pendingPath:x}),j.length>0&&r.jsx(Ae,{title:l("common.repositoryPicker.browseSection"),accounts:j,onSelect:p,disabled:x!==null}),r.jsxs("div",{className:"border-t border-border py-2",children:[r.jsx("p",{className:"px-4 py-2 text-xs text-muted-foreground leading-relaxed",children:l("common.repositoryPicker.description")}),r.jsx(_e,{layout:"picker",disabled:x!==null})]})]})]}),k&&r.jsx("p",{role:"alert",className:"px-4 pb-3 text-sm text-destructive",children:k})]})})}export{Ee as D,st as G,Wt as R,me as a,rt as b,qt as c,Mt as d,lt as e,$e as f,_e as g,Kt as h,Lt as i,Ht as p,Gt as r,Ut as t,ct as u};
@@ -0,0 +1 @@
1
+ import{c as p,am as l,j as m}from"./index-P5CXrVFm.js";import{A as u}from"./access-gate-t5XdpP7o.js";function R(c){const t=p.c(6),{capability:n,area:e,children:r}=c,{granted:i,loading:s,error:o}=l(n);let a;return t[0]!==e||t[1]!==r||t[2]!==o||t[3]!==i||t[4]!==s?(a=m.jsx(u,{granted:i,loading:s,error:o,area:e,children:r}),t[0]=e,t[1]=r,t[2]=o,t[3]=i,t[4]=s,t[5]=a):a=t[5],a}export{R};
@@ -1 +1 @@
1
- import{c as a,b as u,a as f,j as s,h as d,N as h}from"./index-D_7jfHk6.js";function x(){const i=a.c(1),e=window.location.pathname+window.location.search;let n;if(i[0]===Symbol.for("react.memo_cache_sentinel")){const c=e==="/login"||e.startsWith("/login?")?{}:{next:e};n=s.jsx(h,{to:"/login",search:c,replace:!0}),i[0]=n}else n=i[0];return n}function j(i){const e=a.c(7),{children:n}=i,o=u(),{data:c,isPending:m}=f.useSession();if(c){let t;return e[0]!==n?(t=s.jsx(s.Fragment,{children:n}),e[0]=n,e[1]=t):t=e[1],t}if(m){let t;e[2]!==o?(t=o("common.loading"),e[2]=o,e[3]=t):t=e[3];let l;return e[4]!==t?(l=s.jsx("div",{className:"flex min-h-dvh w-full items-center justify-center",children:s.jsx(d,{className:"size-5 text-muted-foreground",label:t})}),e[4]=t,e[5]=l):l=e[5],l}let r;return e[6]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(x,{}),e[6]=r):r=e[6],r}export{j as R};
1
+ import{c as a,b as u,a as f,j as s,h as d,N as h}from"./index-P5CXrVFm.js";function x(){const i=a.c(1),e=window.location.pathname+window.location.search;let n;if(i[0]===Symbol.for("react.memo_cache_sentinel")){const c=e==="/login"||e.startsWith("/login?")?{}:{next:e};n=s.jsx(h,{to:"/login",search:c,replace:!0}),i[0]=n}else n=i[0];return n}function j(i){const e=a.c(7),{children:n}=i,o=u(),{data:c,isPending:m}=f.useSession();if(c){let t;return e[0]!==n?(t=s.jsx(s.Fragment,{children:n}),e[0]=n,e[1]=t):t=e[1],t}if(m){let t;e[2]!==o?(t=o("common.loading"),e[2]=o,e[3]=t):t=e[3];let l;return e[4]!==t?(l=s.jsx("div",{className:"flex min-h-dvh w-full items-center justify-center",children:s.jsx(d,{className:"size-5 text-muted-foreground",label:t})}),e[4]=t,e[5]=l):l=e[5],l}let r;return e[6]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(x,{}),e[6]=r):r=e[6],r}export{j as R};
@@ -0,0 +1 @@
1
+ import{c as O,b as A,u as K,d as V,r as z,e as $,j as s,B as T,I as D,a as G}from"./index-P5CXrVFm.js";function Q(){const e=O.c(53),t=A();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/reset-password"},e[0]=n):n=e[0];const{token:o,error:F}=K(n),a=V(),[l,M]=z.useState(""),[i,q]=z.useState(""),[r,B]=z.useState(!1),c=F==="INVALID_TOKEN";let v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v={mutationFn:H,onSuccess:()=>{B(!0)}},e[1]=v):v=e[1];const b=$(v),N=l===i,d=l.length>=8&&i.length>=8&&N,m=b.isPending,P=b.error;let y;e[2]!==d||e[3]!==l||e[4]!==b||e[5]!==o?(y=j=>{j.preventDefault(),!(!o||!d)&&b.mutate({newPassword:l,token:o})},e[2]=d,e[3]=l,e[4]=b,e[5]=o,e[6]=y):y=e[6];const I=y;let k;e[7]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle, var(--primary-foreground) 1px, transparent 1px)",backgroundSize:"16px 16px",opacity:.15}}),e[7]=k):k=e[7];let S,_,L,E;e[8]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),_=s.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),L=s.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),E=s.jsx("div",{className:"absolute right-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),e[8]=S,e[9]=_,e[10]=L,e[11]=E):(S=e[8],_=e[9],L=e[10],E=e[11]);let C;e[12]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx("div",{className:"flex justify-center",children:s.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12"})}),e[12]=C):C=e[12];let u;e[13]!==r||e[14]!==t?(u=t(r?"routes.resetPassword.passwordResetSuccessful":"routes.resetPassword.setNewPassword"),e[13]=r,e[14]=t,e[15]=u):u=e[15];let x;e[16]!==u?(x=s.jsx("div",{className:"text-center space-y-1",children:s.jsx("p",{className:"text-sm text-foreground/70",children:u})}),e[16]=u,e[17]=x):x=e[17];let f;e[18]!==c||e[19]!==a||e[20]!==r||e[21]!==t||e[22]!==o?(f=(c||!o&&!r)&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:t("routes.resetPassword.invalidOrExpiredLink")}),s.jsx(T,{onClick:()=>a({to:"/login"}),className:"w-full font-semibold",size:"lg",children:t("routes.resetPassword.backToLogin")})]}),e[18]=c,e[19]=a,e[20]=r,e[21]=t,e[22]=o,e[23]=f):f=e[23];let g;e[24]!==P||e[25]!==t?(g=P&&s.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:P.message||t("routes.resetPassword.failedToReset")}),e[24]=P,e[25]=t,e[26]=g):g=e[26];let p;e[27]!==a||e[28]!==r||e[29]!==t?(p=r&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-xl bg-success/10 p-3 text-sm text-success text-center",children:t("routes.resetPassword.passwordResetDescription")}),s.jsx(T,{onClick:()=>a({to:"/login"}),className:"w-full font-semibold",size:"lg",children:t("routes.resetPassword.goToLogin")})]}),e[27]=a,e[28]=r,e[29]=t,e[30]=p):p=e[30];let w;e[31]!==d||e[32]!==i||e[33]!==I||e[34]!==c||e[35]!==m||e[36]!==l||e[37]!==N||e[38]!==r||e[39]!==t||e[40]!==o?(w=o&&!c&&!r&&s.jsxs("form",{onSubmit:I,className:"grid gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:t("routes.resetPassword.newPasswordLabel")}),s.jsx(D,{type:"password",placeholder:"••••••••",value:l,onChange:j=>M(j.target.value),required:!0,minLength:8,disabled:m})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:t("routes.resetPassword.confirmPasswordLabel")}),s.jsx(D,{type:"password",placeholder:"••••••••",value:i,onChange:j=>q(j.target.value),required:!0,minLength:8,disabled:m}),i&&!N&&s.jsx("p",{className:"text-xs text-destructive mt-1.5",children:t("routes.resetPassword.passwordsDoNotMatch")})]}),s.jsx(T,{type:"submit",disabled:m||!d,className:"w-full font-semibold",size:"lg",children:t(m?"routes.resetPassword.resetting":"routes.resetPassword.resetPassword")})]}),e[31]=d,e[32]=i,e[33]=I,e[34]=c,e[35]=m,e[36]=l,e[37]=N,e[38]=r,e[39]=t,e[40]=o,e[41]=w):w=e[41];let h;e[42]!==a||e[43]!==r||e[44]!==t?(h=!r&&s.jsx("div",{className:"text-center",children:s.jsx(T,{type:"button",variant:"link",onClick:()=>a({to:"/login"}),className:"text-sm text-muted-foreground hover:text-foreground",children:t("routes.resetPassword.backToSignIn")})}),e[42]=a,e[43]=r,e[44]=t,e[45]=h):h=e[45];let R;return e[46]!==x||e[47]!==f||e[48]!==g||e[49]!==p||e[50]!==w||e[51]!==h?(R=s.jsxs("main",{className:"relative flex min-h-screen items-center justify-center bg-gradient-to-br from-primary to-primary/75 p-4",children:[k,s.jsxs("div",{className:"relative z-10",children:[S,_,L,E,s.jsxs("div",{className:"mx-auto w-full min-w-[400px] max-w-md grid gap-6 bg-card p-10 border border-primary-foreground/20",children:[C,x,f,g,p,w,h]})]})]}),e[46]=x,e[47]=f,e[48]=g,e[49]=p,e[50]=w,e[51]=h,e[52]=R):R=e[52],R}async function H(e){const{newPassword:t,token:n}=e,o=await G.resetPassword({newPassword:t,token:n});if(o.error)throw new Error(o.error.message||"Failed to reset password");return o}export{Q as default};
@@ -1 +1 @@
1
- import{r as L,j as A,c as ve,l as He}from"./index-D_7jfHk6.js";import{ak as ft}from"./agent-icon-CnnNyirr.js";function pt(e,t){const n=getComputedStyle(e),o=parseFloat(n.fontSize);return t*o}function ht(e,t){const n=getComputedStyle(e.ownerDocument.documentElement),o=parseFloat(n.fontSize);return t*o}function gt(e){return e/100*window.innerHeight}function vt(e){return e/100*window.innerWidth}function mt(e){switch(typeof e){case"number":return[e,"px"];case"string":{const t=parseFloat(e);return e.endsWith("%")?[t,"%"]:e.endsWith("px")?[t,"px"]:e.endsWith("rem")?[t,"rem"]:e.endsWith("em")?[t,"em"]:e.endsWith("vh")?[t,"vh"]:e.endsWith("vw")?[t,"vw"]:[t,"%"]}}}function re({groupSize:e,panelElement:t,styleProp:n}){let o;const[r,a]=mt(n);switch(a){case"%":{o=r/100*e;break}case"px":{o=r;break}case"rem":{o=ht(t,r);break}case"em":{o=pt(t,r);break}case"vh":{o=gt(r);break}case"vw":{o=vt(r);break}}return o}function T(e){return parseFloat(e.toFixed(3))}function te({group:e}){const{orientation:t,panels:n}=e;return n.reduce((o,r)=>(o+=t==="horizontal"?r.element.offsetWidth:r.element.offsetHeight,o),0)}function he(e){const{panels:t}=e,n=te({group:e});return n===0?t.map(o=>({groupResizeBehavior:o.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:o.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:o.panelConstraints.disabled,minSize:0,maxSize:100,panelId:o.id})):t.map(o=>{const{element:r,panelConstraints:a}=o;let l=0;if(a.collapsedSize!==void 0){const c=re({groupSize:n,panelElement:r,styleProp:a.collapsedSize});l=T(c/n*100)}let s;if(a.defaultSize!==void 0){const c=re({groupSize:n,panelElement:r,styleProp:a.defaultSize});s=T(c/n*100)}let i=0;if(a.minSize!==void 0){const c=re({groupSize:n,panelElement:r,styleProp:a.minSize});i=T(c/n*100)}let u=100;if(a.maxSize!==void 0){const c=re({groupSize:n,panelElement:r,styleProp:a.maxSize});u=T(c/n*100)}return{groupResizeBehavior:a.groupResizeBehavior,collapsedSize:l,collapsible:a.collapsible===!0,defaultSize:s,disabled:a.disabled,minSize:i,maxSize:u,panelId:o.id}})}function P(e,t="Assertion error"){if(!e)throw Error(t)}function ge(e,t){return Array.from(t).sort(e==="horizontal"?bt:yt)}function bt(e,t){const n=e.element.offsetLeft-t.element.offsetLeft;return n!==0?n:e.element.offsetWidth-t.element.offsetWidth}function yt(e,t){const n=e.element.offsetTop-t.element.offsetTop;return n!==0?n:e.element.offsetHeight-t.element.offsetHeight}function Ve(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function Ue(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function zt({orientation:e,rects:t,targetRect:n}){const o={x:n.x+n.width/2,y:n.y+n.height/2};let r,a=Number.MAX_VALUE;for(const l of t){const{x:s,y:i}=Ue(o,l),u=e==="horizontal"?s:i;u<a&&(a=u,r=l)}return P(r,"No rect found"),r}let ue;function St(){return ue===void 0&&(typeof matchMedia=="function"?ue=!!matchMedia("(pointer:coarse)").matches:ue=!1),ue}function Ye(e){const{element:t,orientation:n,panels:o,separators:r}=e,a=ge(n,Array.from(t.children).filter(Ve).map(m=>({element:m}))).map(({element:m})=>m),l=[];let s=!1,i=!1,u=-1,c=-1,h=0,d,S=[];{let m=-1;for(const f of a)f.hasAttribute("data-panel")&&(m++,f.hasAttribute("data-disabled")||(h++,u===-1&&(u=m),c=m))}if(h>1){let m=-1;for(const f of a)if(f.hasAttribute("data-panel")){m++;const g=o.find(p=>p.element===f);if(g){if(d){const p=d.element.getBoundingClientRect(),y=f.getBoundingClientRect();let z;if(i){const b=n==="horizontal"?new DOMRect(p.right,p.top,0,p.height):new DOMRect(p.left,p.bottom,p.width,0),v=n==="horizontal"?new DOMRect(y.left,y.top,0,y.height):new DOMRect(y.left,y.top,y.width,0);switch(S.length){case 0:{z=[b,v];break}case 1:{const R=S[0],E=zt({orientation:n,rects:[p,y],targetRect:R.element.getBoundingClientRect()});z=[R,E===p?v:b];break}default:{z=S;break}}}else S.length?z=S:z=[n==="horizontal"?new DOMRect(p.right,y.top,y.left-p.right,y.height):new DOMRect(y.left,p.bottom,y.width,y.top-p.bottom)];for(const b of z){let v="width"in b?b:b.element.getBoundingClientRect();const R=St()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(v.width<R){const M=R-v.width;v=new DOMRect(v.x-M/2,v.y,v.width+M,v.height)}if(v.height<R){const M=R-v.height;v=new DOMRect(v.x,v.y-M/2,v.width,v.height+M)}const E=m<=u||m>c;!s&&!E&&l.push({group:e,groupSize:te({group:e}),panels:[d,g],separator:"width"in b?void 0:b,rect:v}),s=!1}}i=!1,d=g,S=[]}}else if(f.hasAttribute("data-separator")){f.ariaDisabled!==null&&(s=!0);const g=r.find(p=>p.element===f);g?S.push(g):(d=void 0,S=[])}else i=!0}return l}class Xe{#e={};addListener(t,n){const o=this.#e[t];return o===void 0?this.#e[t]=[n]:o.includes(n)||o.push(n),()=>{this.removeListener(t,n)}}emit(t,n){const o=this.#e[t];if(o!==void 0)if(o.length===1)o[0].call(null,n);else{let r=!1,a=null;const l=Array.from(o);for(let s=0;s<l.length;s++){const i=l[s];try{i.call(null,n)}catch(u){a===null&&(r=!0,a=u)}}if(r)throw a}}removeAllListeners(){this.#e={}}removeListener(t,n){const o=this.#e[t];if(o!==void 0){const r=o.indexOf(n);r>=0&&o.splice(r,1)}}}let Q={cursorFlags:0,state:"inactive"};const me=new Xe;function U(){return Q}function wt(e){return me.addListener("change",e)}function xt(e){const t=Q,n={...Q};n.cursorFlags=e,Q=n,me.emit("change",{prev:t,next:n})}function ee(e){const t=Q;Q=e,me.emit("change",{prev:t,next:e})}const Ct=e=>e,pe=()=>{},_e=1,Je=2,qe=4,Ke=8,Le=3,Re=12;let ce;function Ee(){return ce===void 0&&(ce=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(ce=!0)),ce}function Pt({cursorFlags:e,groups:t,state:n}){let o=0,r=0;switch(n){case"active":case"hover":t.forEach(a=>{if(!a.mutableState.disableCursor)switch(a.orientation){case"horizontal":{o++;break}case"vertical":{r++;break}}})}if(!(o===0&&r===0)){switch(n){case"active":{if(e&&Ee()){const a=(e&_e)!==0,l=(e&Je)!==0,s=(e&qe)!==0,i=(e&Ke)!==0;if(a)return s?"se-resize":i?"ne-resize":"e-resize";if(l)return s?"sw-resize":i?"nw-resize":"w-resize";if(s)return"s-resize";if(i)return"n-resize"}break}}return Ee()?o>0&&r>0?"move":o>0?"ew-resize":"ns-resize":o>0&&r>0?"grab":o>0?"col-resize":"row-resize"}}const ke=new WeakMap;function be(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=ke.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&(Object.isExtensible(e.adoptedStyleSheets)?e.adoptedStyleSheets.push(n):e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]));const o=U();switch(o.state){case"active":case"hover":{const r=Pt({cursorFlags:o.cursorFlags,groups:o.hitRegions.map(l=>l.group),state:o.state}),a=`*, *:hover {cursor: ${r} !important; }`;if(t===a)return;t=a,r?n.cssRules.length===0?n.insertRule(a):n.replaceSync(a):n.cssRules.length===1&&n.deleteRule(0);break}case"inactive":{t=void 0,n.cssRules.length===1&&n.deleteRule(0);break}}ke.set(e,{prevStyle:t,styleSheet:n})}let F=new Map;const Ze=new Xe;function Lt(e){F=new Map(F),F.delete(e)}function Me(e,t){for(const[n]of F)if(n.id===e)return n}function H(e,t){for(const[n,o]of F)if(n.id===e)return o;if(t)throw Error(`Could not find data for Group with id ${e}`)}function _(){return F}function ye(e,t){return Ze.addListener("groupChange",n=>{n.group.id===e&&t(n)})}function W(e,t,n){const o=F.get(e);F=new Map(F),F.set(e,t),Ze.emit("groupChange",{group:e,isUserInteraction:n?.isUserInteraction===!0,prev:o,next:t})}function Qe(e){const t=U();let n=!1;return t.state==="active"&&(ee({cursorFlags:0,state:"inactive"}),t.hitRegions.length>0&&(be(e),n=!0,t.hitRegions.forEach(o=>{const r=H(o.group.id,!0);W(o.group,r,{isUserInteraction:!0})}))),n}function De(e){e.defaultPrevented||Qe(e.currentTarget)}function Rt(e,t,n){let o,r={x:1/0,y:1/0};for(const a of t){const l=Ue(n,a.rect);switch(e){case"horizontal":{l.x<=r.x&&(o=a,r=l);break}case"vertical":{l.y<=r.y&&(o=a,r=l);break}}}return o?{distance:r,hitRegion:o}:void 0}function Et(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function kt(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:Ne(e),b:Ne(t)};let o;for(;n.a.at(-1)===n.b.at(-1);)o=n.a.pop(),n.b.pop();P(o,"Stacking order can only be calculated for elements with a common ancestor");const r={a:Te(Ie(n.a)),b:Te(Ie(n.b))};if(r.a===r.b){const a=o.childNodes,l={a:n.a.at(-1),b:n.b.at(-1)};let s=a.length;for(;s--;){const i=a[s];if(i===l.a)return 1;if(i===l.b)return-1}}return Math.sign(r.a-r.b)}const Mt=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Dt(e){const t=getComputedStyle(et(e)??e).display;return t==="flex"||t==="inline-flex"}function It(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||Dt(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||Mt.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function Ie(e){let t=e.length;for(;t--;){const n=e[t];if(P(n,"Missing node"),It(n))return n}return null}function Te(e){return e&&Number(getComputedStyle(e).zIndex)||0}function Ne(e){const t=[];for(;e;)t.push(e),e=et(e);return t}function et(e){const{parentNode:t}=e;return Et(t)?t.host:t}function Tt(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function Nt({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!Ve(n)||n.contains(e)||e.contains(n))return!0;if(kt(n,e)>0){let o=n;for(;o;){if(o.contains(e))return!0;if(Tt(o.getBoundingClientRect(),t))return!1;o=o.parentElement}}return!0}function ze(e,t){const n=[];return t.forEach((o,r)=>{if(r.disabled)return;const a=Ye(r),l=Rt(r.orientation,a,{x:e.clientX,y:e.clientY});l&&l.distance.x<=0&&l.distance.y<=0&&Nt({groupElement:r.element,hitRegion:l.hitRegion.rect,pointerEventTarget:e.target})&&n.push(l.hitRegion)}),n}function jt(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function I(e,t,n=0){return Math.abs(T(e)-T(t))<=n}function O(e,t){return I(e,t)?0:e>t?1:-1}function Z({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:o}){const{collapsedSize:r=0,collapsible:a,disabled:l,maxSize:s=100,minSize:i=0}=t;if(l&&!e)return n;if(O(o,i)<0)if(a){const u=(r+i)/2;O(o,u)<0?o=r:o=i}else o=i;return o=Math.min(s,o),o=T(o),o}function ie({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:o,prevLayout:r,trigger:a}){if(I(e,0))return t;const l=a==="imperative-api",s=Object.values(t),i=Object.values(r),u=[...s],[c,h]=o;P(c!=null,"Invalid first pivot index"),P(h!=null,"Invalid second pivot index");let d=0;switch(a){case"keyboard":{{const f=e<0?h:c,g=n[f];P(g,`Panel constraints not found for index ${f}`);const{collapsedSize:p=0,collapsible:y,minSize:z=0}=g;if(y){const b=s[f];if(P(b!=null,`Previous layout not found for panel index ${f}`),I(b,p)){const v=z-b;O(v,Math.abs(e))>0&&(e=e<0?0-v:v)}}}{const f=e<0?c:h,g=n[f];P(g,`No panel constraints found for index ${f}`);const{collapsedSize:p=0,collapsible:y,minSize:z=0}=g;if(y){const b=s[f];if(P(b!=null,`Previous layout not found for panel index ${f}`),I(b,z)){const v=b-p;O(v,Math.abs(e))>0&&(e=e<0?0-v:v)}}}break}default:{const f=e<0?h:c,g=n[f];P(g,`Panel constraints not found for index ${f}`);const p=s[f],{collapsible:y,collapsedSize:z,minSize:b}=g;if(y&&O(p,b)<0)if(e>0){const v=b-z,R=v/2,E=p+e;O(E,b)<0&&(e=O(e,R)<=0?0:v)}else{const v=b-z,R=100-v/2,E=p-e;O(E,b)<0&&(e=O(100+e,R)>0?0:-v)}break}}{const f=e<0?1:-1;let g=e<0?h:c,p=0;for(;;){const z=s[g];P(z!=null,`Previous layout not found for panel index ${g}`);const b=Z({overrideDisabledPanels:l,panelConstraints:n[g],prevSize:z,size:100})-z;if(p+=b,g+=f,g<0||g>=n.length)break}const y=Math.min(Math.abs(e),Math.abs(p));e=e<0?0-y:y}{let f=e<0?c:h;for(;f>=0&&f<n.length;){const g=Math.abs(e)-Math.abs(d),p=s[f];P(p!=null,`Previous layout not found for panel index ${f}`);const y=p-g,z=Z({overrideDisabledPanels:l,panelConstraints:n[f],prevSize:p,size:y});if(!I(p,z)&&(d+=p-z,u[f]=z,d.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?f--:f++}}if(jt(i,u))return r;{const f=e<0?h:c,g=s[f];P(g!=null,`Previous layout not found for panel index ${f}`);const p=g+d,y=Z({overrideDisabledPanels:l,panelConstraints:n[f],prevSize:g,size:p});if(u[f]=y,!I(y,p)){let z=p-y,b=e<0?h:c;for(;b>=0&&b<n.length;){const v=u[b];P(v!=null,`Previous layout not found for panel index ${b}`);const R=v+z,E=Z({overrideDisabledPanels:l,panelConstraints:n[b],prevSize:v,size:R});if(I(v,E)||(z-=E-v,u[b]=E),I(z,0))break;e>0?b--:b++}}}const S=Object.values(u).reduce((f,g)=>g+f,0);if(!I(S,100,.1))return r;const m=Object.keys(r);return u.reduce((f,g,p)=>(f[m[p]]=g,f),{})}function Y(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(t[n]===void 0||O(e[n],t[n])!==0)return!1;return!0}function X({layout:e,panelConstraints:t}){const n=Object.values(e),o=[...n],r=o.reduce((s,i)=>s+i,0);if(o.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${o.map(s=>`${s}%`).join(", ")}`);if(!I(r,100)&&o.length>0)for(let s=0;s<t.length;s++){const i=o[s];P(i!=null,`No layout data found for index ${s}`);const u=100/r*i;o[s]=u}let a=0;for(let s=0;s<t.length;s++){const i=n[s];P(i!=null,`No layout data found for index ${s}`);const u=o[s];P(u!=null,`No layout data found for index ${s}`);const c=Z({overrideDisabledPanels:!0,panelConstraints:t[s],prevSize:i,size:u});u!=c&&(a+=u-c,o[s]=c)}if(!I(a,0))for(let s=0;s<t.length;s++){const i=o[s];P(i!=null,`No layout data found for index ${s}`);const u=i+a,c=Z({overrideDisabledPanels:!0,panelConstraints:t[s],prevSize:i,size:u});if(i!==c&&(a-=c-i,o[s]=c,I(a,0)))break}const l=Object.keys(e);return o.reduce((s,i,u)=>(s[l[u]]=i,s),{})}function tt({groupId:e,panelId:t}){const n=()=>{const i=_();for(const[u,{defaultLayoutDeferred:c,derivedPanelConstraints:h,layout:d,groupSize:S,separatorToPanels:m}]of i)if(u.id===e)return{defaultLayoutDeferred:c,derivedPanelConstraints:h,group:u,groupSize:S,layout:d,separatorToPanels:m};throw Error(`Group ${e} not found`)},o=()=>{const i=n().derivedPanelConstraints.find(u=>u.panelId===t);if(i!==void 0)return i;throw Error(`Panel constraints not found for Panel ${t}`)},r=()=>{const i=n().group.panels.find(u=>u.id===t);if(i!==void 0)return i;throw Error(`Layout not found for Panel ${t}`)},a=()=>{const i=n().layout[t];if(i!==void 0)return i;throw Error(`Layout not found for Panel ${t}`)},l=({nextSize:i,panels:u,prevLayout:c,derivedPanelConstraints:h})=>{const d=a(),S=u.findIndex(g=>g.id===t),m=S===0,f=S===u.length-1;if(f&&i<d&&(m||u.slice(0,S).every((g,p)=>{const y=h[p];return y?.collapsible&&I(y.collapsedSize,c[y.panelId])}))){const g=u.slice(0,S).reduce((p,y)=>p+c[y.id],0);return{...c,[t]:T(100-g)}}return ie({delta:f?d-i:i-d,initialLayout:c,panelConstraints:h,pivotIndices:f?[S-1,S]:[S,S+1],prevLayout:c,trigger:"imperative-api"})},s=i=>{const u=a();if(i===u)return;const{defaultLayoutDeferred:c,derivedPanelConstraints:h,group:d,groupSize:S,layout:m,separatorToPanels:f}=n(),g=l({nextSize:i,panels:d.panels,prevLayout:m,derivedPanelConstraints:h}),p=X({layout:g,panelConstraints:h});Y(m,p)||W(d,{defaultLayoutDeferred:c,derivedPanelConstraints:h,groupSize:S,layout:p,separatorToPanels:f})};return{collapse:()=>{const{collapsible:i,collapsedSize:u}=o(),{mutableValues:c}=r(),h=a();i&&h!==u&&(c.expandToSize=h,s(u))},expand:()=>{const{collapsible:i,collapsedSize:u,minSize:c}=o(),{mutableValues:h}=r(),d=a();if(i&&d===u){let S=h.expandToSize??c;S===0&&(S=1),s(S)}},getSize:()=>{const{group:i}=n(),u=a(),{element:c}=r(),h=i.orientation==="horizontal"?c.offsetWidth:c.offsetHeight;return{asPercentage:u,inPixels:h}},isCollapsed:()=>{const{collapsible:i,collapsedSize:u}=o(),c=a();return i&&I(u,c)},resize:i=>{const{group:u}=n(),{element:c}=r(),h=te({group:u}),d=re({groupSize:h,panelElement:c,styleProp:i}),S=T(d/h*100);s(S)}}}function je(e){if(e.defaultPrevented)return;const t=_();ze(e,t).forEach(n=>{if(n.separator&&!n.separator.disableDoubleClick){const o=n.panels.find(r=>r.panelConstraints.defaultSize!==void 0);if(o){const r=o.panelConstraints.defaultSize,a=tt({groupId:n.group.id,panelId:o.id});a&&r!==void 0&&(a.resize(r),e.preventDefault())}}})}function de(e){const t=_();for(const[n]of t)if(n.separators.some(o=>o.element===e))return n;throw Error("Could not find parent Group for separator element")}function nt({groupId:e}){const t=()=>{const n=_();for(const[o,r]of n)if(o.id===e)return{group:o,...r};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){const{defaultLayoutDeferred:n,layout:o}=t();return n?{}:o},setLayout(n){const{defaultLayoutDeferred:o,derivedPanelConstraints:r,group:a,groupSize:l,layout:s,separatorToPanels:i}=t(),u=X({layout:n,panelConstraints:r});return o?s:(Y(s,u)||W(a,{defaultLayoutDeferred:o,derivedPanelConstraints:r,groupSize:l,layout:u,separatorToPanels:i}),u)}}}function V(e,t){const n=de(e),o=H(n.id,!0),r=n.separators.find(c=>c.element===e);P(r,"Matching separator not found");const a=o.separatorToPanels.get(r);P(a,"Matching panels not found");const l=a.map(c=>n.panels.indexOf(c)),s=nt({groupId:n.id}).getLayout(),i=ie({delta:t,initialLayout:s,panelConstraints:o.derivedPanelConstraints,pivotIndices:l,prevLayout:s,trigger:"keyboard"}),u=X({layout:i,panelConstraints:o.derivedPanelConstraints});Y(s,u)||W(n,{defaultLayoutDeferred:o.defaultLayoutDeferred,derivedPanelConstraints:o.derivedPanelConstraints,groupSize:o.groupSize,layout:u,separatorToPanels:o.separatorToPanels},{isUserInteraction:!0})}function Oe(e){if(e.defaultPrevented)return;const t=e.currentTarget,n=de(t);if(!n.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),n.orientation==="vertical"&&V(t,5);break}case"ArrowLeft":{e.preventDefault(),n.orientation==="horizontal"&&V(t,-5);break}case"ArrowRight":{e.preventDefault(),n.orientation==="horizontal"&&V(t,5);break}case"ArrowUp":{e.preventDefault(),n.orientation==="vertical"&&V(t,-5);break}case"End":{e.preventDefault(),V(t,100);break}case"Enter":{e.preventDefault();const o=de(t),r=H(o.id,!0),{derivedPanelConstraints:a,layout:l,separatorToPanels:s}=r,i=o.separators.find(d=>d.element===t);P(i,"Matching separator not found");const u=s.get(i);P(u,"Matching panels not found");const c=u[0],h=a.find(d=>d.panelId===c.id);if(P(h,"Panel metadata not found"),h.collapsible){const d=l[c.id],S=h.collapsedSize===d?o.mutableState.expandedPanelSizes[c.id]??h.minSize:h.collapsedSize;V(t,S-d)}break}case"F6":{e.preventDefault();const o=de(t).separators.map(l=>l.element),r=Array.from(o).findIndex(l=>l===e.currentTarget);P(r!==null,"Index not found");const a=e.shiftKey?r>0?r-1:o.length-1:r+1<o.length?r+1:0;o[a].focus({preventScroll:!0});break}case"Home":{e.preventDefault(),V(t,-100);break}}}function Fe(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=_(),n=ze(e,t),o=new Map;let r=!1;n.forEach(a=>{a.separator&&(r||(r=!0,a.separator.element.focus({focusVisible:!1,preventScroll:!0})));const l=t.get(a.group);l&&o.set(a.group,l.layout)}),ee({cursorFlags:0,hitRegions:n,initialLayoutMap:o,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}),n.length&&e.preventDefault()}function ot({document:e,event:t,hitRegions:n,initialLayoutMap:o,mountedGroups:r,pointerDownAtPoint:a,prevCursorFlags:l}){let s=0;n.forEach(u=>{const{group:c,groupSize:h}=u,{orientation:d,panels:S}=c,{disableCursor:m}=c.mutableState;let f=0;a?d==="horizontal"?f=(t.clientX-a.x)/h*100:f=(t.clientY-a.y)/h*100:d==="horizontal"?f=t.clientX<0?-100:100:f=t.clientY<0?-100:100;const g=o.get(c),p=r.get(c);if(!g||!p)return;const{defaultLayoutDeferred:y,derivedPanelConstraints:z,groupSize:b,layout:v,separatorToPanels:R}=p;if(z&&v&&R){const E=ie({delta:f,initialLayout:g,panelConstraints:z,pivotIndices:u.panels.map(M=>S.indexOf(M)),prevLayout:v,trigger:"mouse-or-touch"});if(Y(E,v)){if(f!==0&&!m)switch(d){case"horizontal":{s|=f<0?_e:Je;break}case"vertical":{s|=f<0?qe:Ke;break}}}else W(u.group,{defaultLayoutDeferred:y,derivedPanelConstraints:z,groupSize:b,layout:E,separatorToPanels:R})}});let i=0;t.movementX===0?i|=l&Le:i|=s&Le,t.movementY===0?i|=l&Re:i|=s&Re,xt(i),be(e)}function Ae(e){const t=_(),n=U();n.state==="active"&&ot({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}function Ge(e){if(e.defaultPrevented)return;const t=U(),n=_();switch(t.state){case"active":{if(e.buttons===0){ee({cursorFlags:0,state:"inactive"}),t.hitRegions.forEach(o=>{const r=H(o.group.id,!0);W(o.group,r,{isUserInteraction:!0})});return}for(const o of t.hitRegions)if(o.separator){const{element:r}=o.separator;r.hasPointerCapture?.(e.pointerId)||r.setPointerCapture?.(e.pointerId)}ot({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break}default:{const o=ze(e,n);o.length===0?t.state!=="inactive"&&ee({cursorFlags:0,state:"inactive"}):ee({cursorFlags:0,hitRegions:o,state:"hover"}),be(e.currentTarget);break}}}function $e(e){e.relatedTarget instanceof HTMLIFrameElement&&U().state==="hover"&&ee({cursorFlags:0,state:"inactive"})}function Be(e){e.defaultPrevented||e.pointerType==="mouse"&&e.button>0||Qe(e.currentTarget)&&e.preventDefault()}function We(e){let t=0,n=0;const o={};for(const a of e)if(a.defaultSize!==void 0){t++;const l=T(a.defaultSize);n+=l,o[a.panelId]=l}else o[a.panelId]=void 0;const r=e.length-t;if(r!==0){const a=T((100-n)/r);for(const l of e)l.defaultSize===void 0&&(o[l.panelId]=a)}return o}function Ot(e,t,n){if(!n[0])return;const o=e.panels.find(i=>i.element===t);if(!o||!o.onResize)return;const r=te({group:e}),a=e.orientation==="horizontal"?o.element.offsetWidth:o.element.offsetHeight,l=o.mutableValues.prevSize,s={asPercentage:T(a/r*100),inPixels:a};o.mutableValues.prevSize=s,o.onResize(s,o.id,l)}function Ft(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function At({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:o}){if(n<=0||t<=0||n===t)return o;let r=0,a=0,l=!1;const s=new Map,i=[];for(const h of e.panels){const d=o[h.id]??0;if(h.panelConstraints.groupResizeBehavior==="preserve-pixel-size"){l=!0;const S=d/100*n,m=T(S/t*100);s.set(h.id,m),r+=m}else i.push(h.id),a+=d}if(!l||i.length===0)return o;const u=100-r,c={...o};if(s.forEach((h,d)=>{c[d]=h}),a>0)for(const h of i){const d=o[h]??0;c[h]=T(d/a*u)}else{const h=T(u/i.length);for(const d of i)c[d]=h}return c}function Gt(e,t){const n=e.map(r=>r.id),o=Object.keys(t);if(n.length!==o.length)return!1;for(const r of n)if(!o.includes(r))return!1;return!0}const K=new Map;function $t(e){let t=!0;P(e.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const n=e.element.ownerDocument.defaultView.ResizeObserver,o=new Set,r=new Set,a=new n(m=>{for(const f of m){const{borderBoxSize:g,target:p}=f;if(p===e.element){if(t){const y=te({group:e});if(y===0)return;const z=H(e.id);if(!z)return;const b=he(e),v=z.defaultLayoutDeferred?We(b):z.layout,R=At({group:e,nextGroupSize:y,prevGroupSize:z.groupSize,prevLayout:v}),E=X({layout:R,panelConstraints:b});if(!z.defaultLayoutDeferred&&Y(z.layout,E)&&Ft(z.derivedPanelConstraints,b)&&z.groupSize===y)return;W(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:b,groupSize:y,layout:E,separatorToPanels:z.separatorToPanels})}}else Ot(e,p,g)}});a.observe(e.element),e.panels.forEach(m=>{P(!o.has(m.id),`Panel ids must be unique; id "${m.id}" was used more than once`),o.add(m.id),m.onResize&&a.observe(m.element)});const l=te({group:e}),s=he(e),i=e.panels.map(({id:m})=>m).join(",");let u=e.mutableState.defaultLayout;u&&(Gt(e.panels,u)||(u=void 0));const c=e.mutableState.layouts[i]??u??We(s),h=X({layout:c,panelConstraints:s}),d=e.element.ownerDocument;K.set(d,(K.get(d)??0)+1);const S=new Map;return Ye(e).forEach(m=>{m.separator&&S.set(m.separator,m.panels)}),W(e,{defaultLayoutDeferred:l===0,derivedPanelConstraints:s,groupSize:l,layout:h,separatorToPanels:S}),e.separators.forEach(m=>{P(!r.has(m.id),`Separator ids must be unique; id "${m.id}" was used more than once`),r.add(m.id),m.element.addEventListener("keydown",Oe)}),K.get(d)===1&&(d.addEventListener("contextmenu",De,!0),d.addEventListener("dblclick",je,!0),d.addEventListener("pointerdown",Fe,!0),d.addEventListener("pointerleave",Ae),d.addEventListener("pointermove",Ge),d.addEventListener("pointerout",$e),d.addEventListener("pointerup",Be,!0)),function(){t=!1,K.set(d,Math.max(0,(K.get(d)??0)-1)),Lt(e),e.separators.forEach(m=>{m.element.removeEventListener("keydown",Oe)}),K.get(d)||(d.removeEventListener("contextmenu",De,!0),d.removeEventListener("dblclick",je,!0),d.removeEventListener("pointerdown",Fe,!0),d.removeEventListener("pointerleave",Ae),d.removeEventListener("pointermove",Ge),d.removeEventListener("pointerout",$e),d.removeEventListener("pointerup",Be,!0)),a.disconnect()}}function Bt(){const[e,t]=L.useState({}),n=L.useCallback(()=>t({}),[]);return[e,n]}function Se(e){const t=L.useId();return`${e??t}`}const J=typeof window<"u"?L.useLayoutEffect:L.useEffect;function ae(e){const t=L.useRef(e);return J(()=>{t.current=e},[e]),L.useCallback((...n)=>t.current?.(...n),[t])}function we(...e){return ae(t=>{e.forEach(n=>{if(n)switch(typeof n){case"function":{n(t);break}case"object":{n.current=t;break}}})})}function xe(e){const t=L.useRef({...e});return J(()=>{for(const n in e)t.current[n]=e[n]},[e]),t.current}const rt=L.createContext(null);function Wt(e,t){const n=L.useRef({getLayout:()=>({}),setLayout:Ct});L.useImperativeHandle(t,()=>n.current,[]),J(()=>{Object.assign(n.current,nt({groupId:e}))})}function at({children:e,className:t,defaultLayout:n,disableCursor:o,disabled:r,elementRef:a,groupRef:l,id:s,onLayoutChange:i,onLayoutChanged:u,orientation:c="horizontal",resizeTargetMinimumSize:h={coarse:20,fine:10},style:d,...S}){const m=L.useRef({onLayoutChange:{},onLayoutChanged:{}}),f=ae(w=>{Y(m.current.onLayoutChange,w)||(m.current.onLayoutChange=w,i?.(w))}),g=ae((w,x)=>{Y(m.current.onLayoutChanged,w)||(m.current.onLayoutChanged=w,u?.(w,{isUserInteraction:x}))}),p=Se(s),y=L.useRef(null),[z,b]=Bt(),v=L.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:h,separators:[]}),R=we(y,a);Wt(p,l);const E=ae((w,x)=>{const k=U(),C=Me(w),D=H(w);if(D){let N=!1;return k.state==="active"&&(N=k.hitRegions.some(ne=>ne.group===C)),{flexGrow:D.layout[x]??1,pointerEvents:N?"none":void 0}}if(n?.[x])return{flexGrow:n?.[x]}}),M=xe({defaultLayout:n,disableCursor:o}),j=L.useMemo(()=>({get disableCursor(){return!!M.disableCursor},getPanelStyles:E,id:p,orientation:c,registerPanel:w=>{const x=v.current;return x.panels=ge(c,[...x.panels,w]),b(),()=>{x.panels=x.panels.filter(k=>k!==w),b()}},registerSeparator:w=>{const x=v.current;return x.separators=ge(c,[...x.separators,w]),b(),()=>{x.separators=x.separators.filter(k=>k!==w),b()}},updatePanelProps:(w,{disabled:x})=>{const k=v.current.panels.find(N=>N.id===w);k&&(k.panelConstraints.disabled=x);const C=Me(p),D=H(p);C&&D&&W(C,{...D,derivedPanelConstraints:he(C)})},updateSeparatorProps:(w,{disabled:x,disableDoubleClick:k})=>{const C=v.current.separators.find(D=>D.id===w);C&&(C.disabled=x,C.disableDoubleClick=k)}}),[E,p,b,c,M]),G=L.useRef(null);return J(()=>{const w=y.current;if(w===null)return;const x=v.current;let k;if(M.defaultLayout!==void 0&&Object.keys(M.defaultLayout).length===x.panels.length){k={};for(const $ of x.panels){const q=M.defaultLayout[$.id];q!==void 0&&(k[$.id]=q)}}const C={disabled:!!r,element:w,id:p,mutableState:{defaultLayout:k,disableCursor:!!M.disableCursor,expandedPanelSizes:v.current.lastExpandedPanelSizes,layouts:v.current.layouts},orientation:c,panels:x.panels,resizeTargetMinimumSize:x.resizeTargetMinimumSize,separators:x.separators};G.current=C;const D=$t(C),{defaultLayoutDeferred:N,derivedPanelConstraints:ne,layout:se}=H(C.id,!0);!N&&ne.length>0&&(f(se),g(se,!1));const oe=ye(p,$=>{const{defaultLayoutDeferred:q,derivedPanelConstraints:Pe,layout:le}=$.next;if(q||Pe.length===0)return;const lt=C.panels.map(({id:B})=>B).join(",");C.mutableState.layouts[lt]=le,Pe.forEach(B=>{if(B.collapsible){const{layout:fe}=$.prev??{};if(fe){const ct=I(B.collapsedSize,le[B.panelId]),dt=I(B.collapsedSize,fe[B.panelId]);ct&&!dt&&(C.mutableState.expandedPanelSizes[B.panelId]=fe[B.panelId])}}});const ut=U().state!=="active";f(le),ut&&g(le,$.isUserInteraction)});return()=>{G.current=null,D(),oe()}},[r,p,g,f,c,z,M]),L.useEffect(()=>{const w=G.current;w&&(w.mutableState.defaultLayout=n,w.mutableState.disableCursor=!!o)}),A.jsx(rt.Provider,{value:j,children:A.jsx("div",{...S,className:t,"data-group":!0,"data-testid":p,id:p,ref:R,style:{height:"100%",width:"100%",overflow:"hidden",...d,display:"flex",flexDirection:c==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:c==="horizontal"?"pan-y":"pan-x"},children:e})})}at.displayName="Group";function Ce(){const e=L.useContext(rt);return P(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function Ht(e,t){const{id:n}=Ce(),o=L.useRef({collapse:pe,expand:pe,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:pe});L.useImperativeHandle(t,()=>o.current,[]),J(()=>{Object.assign(o.current,tt({groupId:n,panelId:e}))})}function it({children:e,className:t,collapsedSize:n="0%",collapsible:o=!1,defaultSize:r,disabled:a,elementRef:l,groupResizeBehavior:s="preserve-relative-size",id:i,maxSize:u="100%",minSize:c="0%",onResize:h,panelRef:d,style:S,...m}){const f=!!i,g=Se(i),p=xe({disabled:a}),y=L.useRef(null),z=we(y,l),{getPanelStyles:b,id:v,orientation:R,registerPanel:E,updatePanelProps:M}=Ce(),j=h!==null,G=ae((C,D,N)=>{h?.(C,i,N)});J(()=>{const C=y.current;if(C!==null){const D={element:C,id:g,idIsStable:f,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:j?G:void 0,panelConstraints:{groupResizeBehavior:s,collapsedSize:n,collapsible:o,defaultSize:r,disabled:p.disabled,maxSize:u,minSize:c}};return E(D)}},[s,n,o,r,j,g,f,u,c,G,E,p]),L.useEffect(()=>{M(g,{disabled:a})},[a,g,M]),Ht(g,d);const w=()=>{const C=b(v,g);if(C)return JSON.stringify(C)},x=L.useSyncExternalStore(C=>ye(v,C),w,w);let k;return x?k=JSON.parse(x):r!==void 0?k={flexGrow:void 0,flexShrink:void 0,flexBasis:r}:k={flexGrow:1},A.jsx("div",{...m,"data-disabled":a||void 0,"data-panel":!0,"data-testid":g,id:g,ref:z,style:{...Vt,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...k},children:A.jsx("div",{className:t,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...S,touchAction:R==="horizontal"?"pan-y":"pan-x"},children:e})})}it.displayName="Panel";const Vt={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function Ut({layout:e,panelConstraints:t,panelId:n,panelIndex:o}){let r,a;const l=e[n],s=t.find(i=>i.panelId===n);if(s){const i=s.maxSize,u=s.collapsible?s.collapsedSize:s.minSize,c=[o,o+1];a=X({layout:ie({delta:u-l,initialLayout:e,panelConstraints:t,pivotIndices:c,prevLayout:e}),panelConstraints:t})[n],r=X({layout:ie({delta:i-l,initialLayout:e,panelConstraints:t,pivotIndices:c,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:r,valueMin:a,valueNow:l}}function st({children:e,className:t,disabled:n,disableDoubleClick:o,elementRef:r,id:a,style:l,...s}){const i=Se(a),u=xe({disabled:n,disableDoubleClick:o}),[c,h]=L.useState({}),[d,S]=L.useState("inactive"),[m,f]=L.useState(!1),g=L.useRef(null),p=we(g,r),{disableCursor:y,id:z,orientation:b,registerSeparator:v,updateSeparatorProps:R}=Ce(),E=b==="horizontal"?"vertical":"horizontal";J(()=>{const G=g.current;if(G!==null){const w={disabled:u.disabled,disableDoubleClick:u.disableDoubleClick,element:G,id:i},x=v(w),k=wt(D=>{S(D.next.state!=="inactive"&&D.next.hitRegions.some(N=>N.separator===w)?D.next.state:"inactive")}),C=ye(z,D=>{const{derivedPanelConstraints:N,layout:ne,separatorToPanels:se}=D.next,oe=se.get(w);if(oe){const $=oe[0],q=oe.indexOf($);h(Ut({layout:ne,panelConstraints:N,panelId:$.id,panelIndex:q}))}});return()=>{k(),C(),x()}}},[z,i,v,u]),L.useEffect(()=>{R(i,{disabled:n,disableDoubleClick:o})},[n,o,i,R]);let M;n&&!y&&(M="not-allowed");let j;return n?j="disabled":d==="active"?j="active":m?j="focus":j=d,A.jsx("div",{...s,"aria-controls":c.valueControls,"aria-disabled":n||void 0,"aria-orientation":E,"aria-valuemax":c.valueMax,"aria-valuemin":c.valueMin,"aria-valuenow":c.valueNow,children:e,className:t,"data-separator":j,"data-testid":i,id:i,onBlur:()=>f(!1),onFocus:()=>f(!0),ref:p,role:"separator",style:{flexBasis:"auto",cursor:M,...l,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:n?void 0:0})}st.displayName="Separator";function _t(e){const t=ve.c(10);let n,o,r;t[0]!==e?({className:n,ref:r,...o}=e,t[0]=e,t[1]=n,t[2]=o,t[3]=r):(n=t[1],o=t[2],r=t[3]);let a;t[4]!==n?(a=He("flex h-full w-full",n),t[4]=n,t[5]=a):a=t[5];let l;return t[6]!==o||t[7]!==r||t[8]!==a?(l=A.jsx(at,{groupRef:r,"data-slot":"resizable-panel-group",className:a,...o}),t[6]=o,t[7]=r,t[8]=a,t[9]=l):l=t[9],l}function Jt(e){const t=ve.c(10);let n,o,r;t[0]!==e?({ref:o,style:r,...n}=e,t[0]=e,t[1]=n,t[2]=o,t[3]=r):(n=t[1],o=t[2],r=t[3]);let a;t[4]!==r?(a={overflow:"hidden",...r},t[4]=r,t[5]=a):a=t[5];let l;return t[6]!==n||t[7]!==o||t[8]!==a?(l=A.jsx(it,{panelRef:o,"data-slot":"resizable-panel",style:a,...n}),t[6]=n,t[7]=o,t[8]=a,t[9]=l):l=t[9],l}function qt(e){const t=ve.c(12);let n,o,r;t[0]!==e?({withHandle:r,className:n,...o}=e,t[0]=e,t[1]=n,t[2]=o,t[3]=r):(n=t[1],o=t[2],r=t[3]);let a;t[4]!==n?(a=He("bg-border focus-visible:ring-ring relative flex w-[0.5px] items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:-translate-y-1/2 aria-[orientation=horizontal]:after:translate-x-0 [&[aria-orientation=horizontal]>div]:rotate-90",n),t[4]=n,t[5]=a):a=t[5];let l;t[6]!==r?(l=r&&A.jsx("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:A.jsx(ft,{className:"size-2.5"})}),t[6]=r,t[7]=l):l=t[7];let s;return t[8]!==o||t[9]!==a||t[10]!==l?(s=A.jsx(st,{"data-slot":"resizable-handle",className:a,...o,children:l}),t[8]=o,t[9]=a,t[10]=l,t[11]=s):s=t[11],s}export{_t as R,Jt as a,qt as b};
1
+ import{r as L,j as A,c as ve,l as He}from"./index-P5CXrVFm.js";import{ak as ft}from"./agent-icon-V8lPNv7A.js";function pt(e,t){const n=getComputedStyle(e),o=parseFloat(n.fontSize);return t*o}function ht(e,t){const n=getComputedStyle(e.ownerDocument.documentElement),o=parseFloat(n.fontSize);return t*o}function gt(e){return e/100*window.innerHeight}function vt(e){return e/100*window.innerWidth}function mt(e){switch(typeof e){case"number":return[e,"px"];case"string":{const t=parseFloat(e);return e.endsWith("%")?[t,"%"]:e.endsWith("px")?[t,"px"]:e.endsWith("rem")?[t,"rem"]:e.endsWith("em")?[t,"em"]:e.endsWith("vh")?[t,"vh"]:e.endsWith("vw")?[t,"vw"]:[t,"%"]}}}function re({groupSize:e,panelElement:t,styleProp:n}){let o;const[r,a]=mt(n);switch(a){case"%":{o=r/100*e;break}case"px":{o=r;break}case"rem":{o=ht(t,r);break}case"em":{o=pt(t,r);break}case"vh":{o=gt(r);break}case"vw":{o=vt(r);break}}return o}function T(e){return parseFloat(e.toFixed(3))}function te({group:e}){const{orientation:t,panels:n}=e;return n.reduce((o,r)=>(o+=t==="horizontal"?r.element.offsetWidth:r.element.offsetHeight,o),0)}function he(e){const{panels:t}=e,n=te({group:e});return n===0?t.map(o=>({groupResizeBehavior:o.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:o.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:o.panelConstraints.disabled,minSize:0,maxSize:100,panelId:o.id})):t.map(o=>{const{element:r,panelConstraints:a}=o;let l=0;if(a.collapsedSize!==void 0){const c=re({groupSize:n,panelElement:r,styleProp:a.collapsedSize});l=T(c/n*100)}let s;if(a.defaultSize!==void 0){const c=re({groupSize:n,panelElement:r,styleProp:a.defaultSize});s=T(c/n*100)}let i=0;if(a.minSize!==void 0){const c=re({groupSize:n,panelElement:r,styleProp:a.minSize});i=T(c/n*100)}let u=100;if(a.maxSize!==void 0){const c=re({groupSize:n,panelElement:r,styleProp:a.maxSize});u=T(c/n*100)}return{groupResizeBehavior:a.groupResizeBehavior,collapsedSize:l,collapsible:a.collapsible===!0,defaultSize:s,disabled:a.disabled,minSize:i,maxSize:u,panelId:o.id}})}function P(e,t="Assertion error"){if(!e)throw Error(t)}function ge(e,t){return Array.from(t).sort(e==="horizontal"?bt:yt)}function bt(e,t){const n=e.element.offsetLeft-t.element.offsetLeft;return n!==0?n:e.element.offsetWidth-t.element.offsetWidth}function yt(e,t){const n=e.element.offsetTop-t.element.offsetTop;return n!==0?n:e.element.offsetHeight-t.element.offsetHeight}function Ve(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function Ue(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function zt({orientation:e,rects:t,targetRect:n}){const o={x:n.x+n.width/2,y:n.y+n.height/2};let r,a=Number.MAX_VALUE;for(const l of t){const{x:s,y:i}=Ue(o,l),u=e==="horizontal"?s:i;u<a&&(a=u,r=l)}return P(r,"No rect found"),r}let ue;function St(){return ue===void 0&&(typeof matchMedia=="function"?ue=!!matchMedia("(pointer:coarse)").matches:ue=!1),ue}function Ye(e){const{element:t,orientation:n,panels:o,separators:r}=e,a=ge(n,Array.from(t.children).filter(Ve).map(m=>({element:m}))).map(({element:m})=>m),l=[];let s=!1,i=!1,u=-1,c=-1,h=0,d,S=[];{let m=-1;for(const f of a)f.hasAttribute("data-panel")&&(m++,f.hasAttribute("data-disabled")||(h++,u===-1&&(u=m),c=m))}if(h>1){let m=-1;for(const f of a)if(f.hasAttribute("data-panel")){m++;const g=o.find(p=>p.element===f);if(g){if(d){const p=d.element.getBoundingClientRect(),y=f.getBoundingClientRect();let z;if(i){const b=n==="horizontal"?new DOMRect(p.right,p.top,0,p.height):new DOMRect(p.left,p.bottom,p.width,0),v=n==="horizontal"?new DOMRect(y.left,y.top,0,y.height):new DOMRect(y.left,y.top,y.width,0);switch(S.length){case 0:{z=[b,v];break}case 1:{const R=S[0],E=zt({orientation:n,rects:[p,y],targetRect:R.element.getBoundingClientRect()});z=[R,E===p?v:b];break}default:{z=S;break}}}else S.length?z=S:z=[n==="horizontal"?new DOMRect(p.right,y.top,y.left-p.right,y.height):new DOMRect(y.left,p.bottom,y.width,y.top-p.bottom)];for(const b of z){let v="width"in b?b:b.element.getBoundingClientRect();const R=St()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(v.width<R){const M=R-v.width;v=new DOMRect(v.x-M/2,v.y,v.width+M,v.height)}if(v.height<R){const M=R-v.height;v=new DOMRect(v.x,v.y-M/2,v.width,v.height+M)}const E=m<=u||m>c;!s&&!E&&l.push({group:e,groupSize:te({group:e}),panels:[d,g],separator:"width"in b?void 0:b,rect:v}),s=!1}}i=!1,d=g,S=[]}}else if(f.hasAttribute("data-separator")){f.ariaDisabled!==null&&(s=!0);const g=r.find(p=>p.element===f);g?S.push(g):(d=void 0,S=[])}else i=!0}return l}class Xe{#e={};addListener(t,n){const o=this.#e[t];return o===void 0?this.#e[t]=[n]:o.includes(n)||o.push(n),()=>{this.removeListener(t,n)}}emit(t,n){const o=this.#e[t];if(o!==void 0)if(o.length===1)o[0].call(null,n);else{let r=!1,a=null;const l=Array.from(o);for(let s=0;s<l.length;s++){const i=l[s];try{i.call(null,n)}catch(u){a===null&&(r=!0,a=u)}}if(r)throw a}}removeAllListeners(){this.#e={}}removeListener(t,n){const o=this.#e[t];if(o!==void 0){const r=o.indexOf(n);r>=0&&o.splice(r,1)}}}let Q={cursorFlags:0,state:"inactive"};const me=new Xe;function U(){return Q}function wt(e){return me.addListener("change",e)}function xt(e){const t=Q,n={...Q};n.cursorFlags=e,Q=n,me.emit("change",{prev:t,next:n})}function ee(e){const t=Q;Q=e,me.emit("change",{prev:t,next:e})}const Ct=e=>e,pe=()=>{},_e=1,Je=2,qe=4,Ke=8,Le=3,Re=12;let ce;function Ee(){return ce===void 0&&(ce=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(ce=!0)),ce}function Pt({cursorFlags:e,groups:t,state:n}){let o=0,r=0;switch(n){case"active":case"hover":t.forEach(a=>{if(!a.mutableState.disableCursor)switch(a.orientation){case"horizontal":{o++;break}case"vertical":{r++;break}}})}if(!(o===0&&r===0)){switch(n){case"active":{if(e&&Ee()){const a=(e&_e)!==0,l=(e&Je)!==0,s=(e&qe)!==0,i=(e&Ke)!==0;if(a)return s?"se-resize":i?"ne-resize":"e-resize";if(l)return s?"sw-resize":i?"nw-resize":"w-resize";if(s)return"s-resize";if(i)return"n-resize"}break}}return Ee()?o>0&&r>0?"move":o>0?"ew-resize":"ns-resize":o>0&&r>0?"grab":o>0?"col-resize":"row-resize"}}const ke=new WeakMap;function be(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=ke.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&(Object.isExtensible(e.adoptedStyleSheets)?e.adoptedStyleSheets.push(n):e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]));const o=U();switch(o.state){case"active":case"hover":{const r=Pt({cursorFlags:o.cursorFlags,groups:o.hitRegions.map(l=>l.group),state:o.state}),a=`*, *:hover {cursor: ${r} !important; }`;if(t===a)return;t=a,r?n.cssRules.length===0?n.insertRule(a):n.replaceSync(a):n.cssRules.length===1&&n.deleteRule(0);break}case"inactive":{t=void 0,n.cssRules.length===1&&n.deleteRule(0);break}}ke.set(e,{prevStyle:t,styleSheet:n})}let F=new Map;const Ze=new Xe;function Lt(e){F=new Map(F),F.delete(e)}function Me(e,t){for(const[n]of F)if(n.id===e)return n}function H(e,t){for(const[n,o]of F)if(n.id===e)return o;if(t)throw Error(`Could not find data for Group with id ${e}`)}function _(){return F}function ye(e,t){return Ze.addListener("groupChange",n=>{n.group.id===e&&t(n)})}function W(e,t,n){const o=F.get(e);F=new Map(F),F.set(e,t),Ze.emit("groupChange",{group:e,isUserInteraction:n?.isUserInteraction===!0,prev:o,next:t})}function Qe(e){const t=U();let n=!1;return t.state==="active"&&(ee({cursorFlags:0,state:"inactive"}),t.hitRegions.length>0&&(be(e),n=!0,t.hitRegions.forEach(o=>{const r=H(o.group.id,!0);W(o.group,r,{isUserInteraction:!0})}))),n}function De(e){e.defaultPrevented||Qe(e.currentTarget)}function Rt(e,t,n){let o,r={x:1/0,y:1/0};for(const a of t){const l=Ue(n,a.rect);switch(e){case"horizontal":{l.x<=r.x&&(o=a,r=l);break}case"vertical":{l.y<=r.y&&(o=a,r=l);break}}}return o?{distance:r,hitRegion:o}:void 0}function Et(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function kt(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:Ne(e),b:Ne(t)};let o;for(;n.a.at(-1)===n.b.at(-1);)o=n.a.pop(),n.b.pop();P(o,"Stacking order can only be calculated for elements with a common ancestor");const r={a:Te(Ie(n.a)),b:Te(Ie(n.b))};if(r.a===r.b){const a=o.childNodes,l={a:n.a.at(-1),b:n.b.at(-1)};let s=a.length;for(;s--;){const i=a[s];if(i===l.a)return 1;if(i===l.b)return-1}}return Math.sign(r.a-r.b)}const Mt=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Dt(e){const t=getComputedStyle(et(e)??e).display;return t==="flex"||t==="inline-flex"}function It(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||Dt(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||Mt.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function Ie(e){let t=e.length;for(;t--;){const n=e[t];if(P(n,"Missing node"),It(n))return n}return null}function Te(e){return e&&Number(getComputedStyle(e).zIndex)||0}function Ne(e){const t=[];for(;e;)t.push(e),e=et(e);return t}function et(e){const{parentNode:t}=e;return Et(t)?t.host:t}function Tt(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function Nt({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!Ve(n)||n.contains(e)||e.contains(n))return!0;if(kt(n,e)>0){let o=n;for(;o;){if(o.contains(e))return!0;if(Tt(o.getBoundingClientRect(),t))return!1;o=o.parentElement}}return!0}function ze(e,t){const n=[];return t.forEach((o,r)=>{if(r.disabled)return;const a=Ye(r),l=Rt(r.orientation,a,{x:e.clientX,y:e.clientY});l&&l.distance.x<=0&&l.distance.y<=0&&Nt({groupElement:r.element,hitRegion:l.hitRegion.rect,pointerEventTarget:e.target})&&n.push(l.hitRegion)}),n}function jt(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function I(e,t,n=0){return Math.abs(T(e)-T(t))<=n}function O(e,t){return I(e,t)?0:e>t?1:-1}function Z({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:o}){const{collapsedSize:r=0,collapsible:a,disabled:l,maxSize:s=100,minSize:i=0}=t;if(l&&!e)return n;if(O(o,i)<0)if(a){const u=(r+i)/2;O(o,u)<0?o=r:o=i}else o=i;return o=Math.min(s,o),o=T(o),o}function ie({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:o,prevLayout:r,trigger:a}){if(I(e,0))return t;const l=a==="imperative-api",s=Object.values(t),i=Object.values(r),u=[...s],[c,h]=o;P(c!=null,"Invalid first pivot index"),P(h!=null,"Invalid second pivot index");let d=0;switch(a){case"keyboard":{{const f=e<0?h:c,g=n[f];P(g,`Panel constraints not found for index ${f}`);const{collapsedSize:p=0,collapsible:y,minSize:z=0}=g;if(y){const b=s[f];if(P(b!=null,`Previous layout not found for panel index ${f}`),I(b,p)){const v=z-b;O(v,Math.abs(e))>0&&(e=e<0?0-v:v)}}}{const f=e<0?c:h,g=n[f];P(g,`No panel constraints found for index ${f}`);const{collapsedSize:p=0,collapsible:y,minSize:z=0}=g;if(y){const b=s[f];if(P(b!=null,`Previous layout not found for panel index ${f}`),I(b,z)){const v=b-p;O(v,Math.abs(e))>0&&(e=e<0?0-v:v)}}}break}default:{const f=e<0?h:c,g=n[f];P(g,`Panel constraints not found for index ${f}`);const p=s[f],{collapsible:y,collapsedSize:z,minSize:b}=g;if(y&&O(p,b)<0)if(e>0){const v=b-z,R=v/2,E=p+e;O(E,b)<0&&(e=O(e,R)<=0?0:v)}else{const v=b-z,R=100-v/2,E=p-e;O(E,b)<0&&(e=O(100+e,R)>0?0:-v)}break}}{const f=e<0?1:-1;let g=e<0?h:c,p=0;for(;;){const z=s[g];P(z!=null,`Previous layout not found for panel index ${g}`);const b=Z({overrideDisabledPanels:l,panelConstraints:n[g],prevSize:z,size:100})-z;if(p+=b,g+=f,g<0||g>=n.length)break}const y=Math.min(Math.abs(e),Math.abs(p));e=e<0?0-y:y}{let f=e<0?c:h;for(;f>=0&&f<n.length;){const g=Math.abs(e)-Math.abs(d),p=s[f];P(p!=null,`Previous layout not found for panel index ${f}`);const y=p-g,z=Z({overrideDisabledPanels:l,panelConstraints:n[f],prevSize:p,size:y});if(!I(p,z)&&(d+=p-z,u[f]=z,d.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?f--:f++}}if(jt(i,u))return r;{const f=e<0?h:c,g=s[f];P(g!=null,`Previous layout not found for panel index ${f}`);const p=g+d,y=Z({overrideDisabledPanels:l,panelConstraints:n[f],prevSize:g,size:p});if(u[f]=y,!I(y,p)){let z=p-y,b=e<0?h:c;for(;b>=0&&b<n.length;){const v=u[b];P(v!=null,`Previous layout not found for panel index ${b}`);const R=v+z,E=Z({overrideDisabledPanels:l,panelConstraints:n[b],prevSize:v,size:R});if(I(v,E)||(z-=E-v,u[b]=E),I(z,0))break;e>0?b--:b++}}}const S=Object.values(u).reduce((f,g)=>g+f,0);if(!I(S,100,.1))return r;const m=Object.keys(r);return u.reduce((f,g,p)=>(f[m[p]]=g,f),{})}function Y(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(t[n]===void 0||O(e[n],t[n])!==0)return!1;return!0}function X({layout:e,panelConstraints:t}){const n=Object.values(e),o=[...n],r=o.reduce((s,i)=>s+i,0);if(o.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${o.map(s=>`${s}%`).join(", ")}`);if(!I(r,100)&&o.length>0)for(let s=0;s<t.length;s++){const i=o[s];P(i!=null,`No layout data found for index ${s}`);const u=100/r*i;o[s]=u}let a=0;for(let s=0;s<t.length;s++){const i=n[s];P(i!=null,`No layout data found for index ${s}`);const u=o[s];P(u!=null,`No layout data found for index ${s}`);const c=Z({overrideDisabledPanels:!0,panelConstraints:t[s],prevSize:i,size:u});u!=c&&(a+=u-c,o[s]=c)}if(!I(a,0))for(let s=0;s<t.length;s++){const i=o[s];P(i!=null,`No layout data found for index ${s}`);const u=i+a,c=Z({overrideDisabledPanels:!0,panelConstraints:t[s],prevSize:i,size:u});if(i!==c&&(a-=c-i,o[s]=c,I(a,0)))break}const l=Object.keys(e);return o.reduce((s,i,u)=>(s[l[u]]=i,s),{})}function tt({groupId:e,panelId:t}){const n=()=>{const i=_();for(const[u,{defaultLayoutDeferred:c,derivedPanelConstraints:h,layout:d,groupSize:S,separatorToPanels:m}]of i)if(u.id===e)return{defaultLayoutDeferred:c,derivedPanelConstraints:h,group:u,groupSize:S,layout:d,separatorToPanels:m};throw Error(`Group ${e} not found`)},o=()=>{const i=n().derivedPanelConstraints.find(u=>u.panelId===t);if(i!==void 0)return i;throw Error(`Panel constraints not found for Panel ${t}`)},r=()=>{const i=n().group.panels.find(u=>u.id===t);if(i!==void 0)return i;throw Error(`Layout not found for Panel ${t}`)},a=()=>{const i=n().layout[t];if(i!==void 0)return i;throw Error(`Layout not found for Panel ${t}`)},l=({nextSize:i,panels:u,prevLayout:c,derivedPanelConstraints:h})=>{const d=a(),S=u.findIndex(g=>g.id===t),m=S===0,f=S===u.length-1;if(f&&i<d&&(m||u.slice(0,S).every((g,p)=>{const y=h[p];return y?.collapsible&&I(y.collapsedSize,c[y.panelId])}))){const g=u.slice(0,S).reduce((p,y)=>p+c[y.id],0);return{...c,[t]:T(100-g)}}return ie({delta:f?d-i:i-d,initialLayout:c,panelConstraints:h,pivotIndices:f?[S-1,S]:[S,S+1],prevLayout:c,trigger:"imperative-api"})},s=i=>{const u=a();if(i===u)return;const{defaultLayoutDeferred:c,derivedPanelConstraints:h,group:d,groupSize:S,layout:m,separatorToPanels:f}=n(),g=l({nextSize:i,panels:d.panels,prevLayout:m,derivedPanelConstraints:h}),p=X({layout:g,panelConstraints:h});Y(m,p)||W(d,{defaultLayoutDeferred:c,derivedPanelConstraints:h,groupSize:S,layout:p,separatorToPanels:f})};return{collapse:()=>{const{collapsible:i,collapsedSize:u}=o(),{mutableValues:c}=r(),h=a();i&&h!==u&&(c.expandToSize=h,s(u))},expand:()=>{const{collapsible:i,collapsedSize:u,minSize:c}=o(),{mutableValues:h}=r(),d=a();if(i&&d===u){let S=h.expandToSize??c;S===0&&(S=1),s(S)}},getSize:()=>{const{group:i}=n(),u=a(),{element:c}=r(),h=i.orientation==="horizontal"?c.offsetWidth:c.offsetHeight;return{asPercentage:u,inPixels:h}},isCollapsed:()=>{const{collapsible:i,collapsedSize:u}=o(),c=a();return i&&I(u,c)},resize:i=>{const{group:u}=n(),{element:c}=r(),h=te({group:u}),d=re({groupSize:h,panelElement:c,styleProp:i}),S=T(d/h*100);s(S)}}}function je(e){if(e.defaultPrevented)return;const t=_();ze(e,t).forEach(n=>{if(n.separator&&!n.separator.disableDoubleClick){const o=n.panels.find(r=>r.panelConstraints.defaultSize!==void 0);if(o){const r=o.panelConstraints.defaultSize,a=tt({groupId:n.group.id,panelId:o.id});a&&r!==void 0&&(a.resize(r),e.preventDefault())}}})}function de(e){const t=_();for(const[n]of t)if(n.separators.some(o=>o.element===e))return n;throw Error("Could not find parent Group for separator element")}function nt({groupId:e}){const t=()=>{const n=_();for(const[o,r]of n)if(o.id===e)return{group:o,...r};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){const{defaultLayoutDeferred:n,layout:o}=t();return n?{}:o},setLayout(n){const{defaultLayoutDeferred:o,derivedPanelConstraints:r,group:a,groupSize:l,layout:s,separatorToPanels:i}=t(),u=X({layout:n,panelConstraints:r});return o?s:(Y(s,u)||W(a,{defaultLayoutDeferred:o,derivedPanelConstraints:r,groupSize:l,layout:u,separatorToPanels:i}),u)}}}function V(e,t){const n=de(e),o=H(n.id,!0),r=n.separators.find(c=>c.element===e);P(r,"Matching separator not found");const a=o.separatorToPanels.get(r);P(a,"Matching panels not found");const l=a.map(c=>n.panels.indexOf(c)),s=nt({groupId:n.id}).getLayout(),i=ie({delta:t,initialLayout:s,panelConstraints:o.derivedPanelConstraints,pivotIndices:l,prevLayout:s,trigger:"keyboard"}),u=X({layout:i,panelConstraints:o.derivedPanelConstraints});Y(s,u)||W(n,{defaultLayoutDeferred:o.defaultLayoutDeferred,derivedPanelConstraints:o.derivedPanelConstraints,groupSize:o.groupSize,layout:u,separatorToPanels:o.separatorToPanels},{isUserInteraction:!0})}function Oe(e){if(e.defaultPrevented)return;const t=e.currentTarget,n=de(t);if(!n.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),n.orientation==="vertical"&&V(t,5);break}case"ArrowLeft":{e.preventDefault(),n.orientation==="horizontal"&&V(t,-5);break}case"ArrowRight":{e.preventDefault(),n.orientation==="horizontal"&&V(t,5);break}case"ArrowUp":{e.preventDefault(),n.orientation==="vertical"&&V(t,-5);break}case"End":{e.preventDefault(),V(t,100);break}case"Enter":{e.preventDefault();const o=de(t),r=H(o.id,!0),{derivedPanelConstraints:a,layout:l,separatorToPanels:s}=r,i=o.separators.find(d=>d.element===t);P(i,"Matching separator not found");const u=s.get(i);P(u,"Matching panels not found");const c=u[0],h=a.find(d=>d.panelId===c.id);if(P(h,"Panel metadata not found"),h.collapsible){const d=l[c.id],S=h.collapsedSize===d?o.mutableState.expandedPanelSizes[c.id]??h.minSize:h.collapsedSize;V(t,S-d)}break}case"F6":{e.preventDefault();const o=de(t).separators.map(l=>l.element),r=Array.from(o).findIndex(l=>l===e.currentTarget);P(r!==null,"Index not found");const a=e.shiftKey?r>0?r-1:o.length-1:r+1<o.length?r+1:0;o[a].focus({preventScroll:!0});break}case"Home":{e.preventDefault(),V(t,-100);break}}}function Fe(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=_(),n=ze(e,t),o=new Map;let r=!1;n.forEach(a=>{a.separator&&(r||(r=!0,a.separator.element.focus({focusVisible:!1,preventScroll:!0})));const l=t.get(a.group);l&&o.set(a.group,l.layout)}),ee({cursorFlags:0,hitRegions:n,initialLayoutMap:o,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}),n.length&&e.preventDefault()}function ot({document:e,event:t,hitRegions:n,initialLayoutMap:o,mountedGroups:r,pointerDownAtPoint:a,prevCursorFlags:l}){let s=0;n.forEach(u=>{const{group:c,groupSize:h}=u,{orientation:d,panels:S}=c,{disableCursor:m}=c.mutableState;let f=0;a?d==="horizontal"?f=(t.clientX-a.x)/h*100:f=(t.clientY-a.y)/h*100:d==="horizontal"?f=t.clientX<0?-100:100:f=t.clientY<0?-100:100;const g=o.get(c),p=r.get(c);if(!g||!p)return;const{defaultLayoutDeferred:y,derivedPanelConstraints:z,groupSize:b,layout:v,separatorToPanels:R}=p;if(z&&v&&R){const E=ie({delta:f,initialLayout:g,panelConstraints:z,pivotIndices:u.panels.map(M=>S.indexOf(M)),prevLayout:v,trigger:"mouse-or-touch"});if(Y(E,v)){if(f!==0&&!m)switch(d){case"horizontal":{s|=f<0?_e:Je;break}case"vertical":{s|=f<0?qe:Ke;break}}}else W(u.group,{defaultLayoutDeferred:y,derivedPanelConstraints:z,groupSize:b,layout:E,separatorToPanels:R})}});let i=0;t.movementX===0?i|=l&Le:i|=s&Le,t.movementY===0?i|=l&Re:i|=s&Re,xt(i),be(e)}function Ae(e){const t=_(),n=U();n.state==="active"&&ot({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}function Ge(e){if(e.defaultPrevented)return;const t=U(),n=_();switch(t.state){case"active":{if(e.buttons===0){ee({cursorFlags:0,state:"inactive"}),t.hitRegions.forEach(o=>{const r=H(o.group.id,!0);W(o.group,r,{isUserInteraction:!0})});return}for(const o of t.hitRegions)if(o.separator){const{element:r}=o.separator;r.hasPointerCapture?.(e.pointerId)||r.setPointerCapture?.(e.pointerId)}ot({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break}default:{const o=ze(e,n);o.length===0?t.state!=="inactive"&&ee({cursorFlags:0,state:"inactive"}):ee({cursorFlags:0,hitRegions:o,state:"hover"}),be(e.currentTarget);break}}}function $e(e){e.relatedTarget instanceof HTMLIFrameElement&&U().state==="hover"&&ee({cursorFlags:0,state:"inactive"})}function Be(e){e.defaultPrevented||e.pointerType==="mouse"&&e.button>0||Qe(e.currentTarget)&&e.preventDefault()}function We(e){let t=0,n=0;const o={};for(const a of e)if(a.defaultSize!==void 0){t++;const l=T(a.defaultSize);n+=l,o[a.panelId]=l}else o[a.panelId]=void 0;const r=e.length-t;if(r!==0){const a=T((100-n)/r);for(const l of e)l.defaultSize===void 0&&(o[l.panelId]=a)}return o}function Ot(e,t,n){if(!n[0])return;const o=e.panels.find(i=>i.element===t);if(!o||!o.onResize)return;const r=te({group:e}),a=e.orientation==="horizontal"?o.element.offsetWidth:o.element.offsetHeight,l=o.mutableValues.prevSize,s={asPercentage:T(a/r*100),inPixels:a};o.mutableValues.prevSize=s,o.onResize(s,o.id,l)}function Ft(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function At({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:o}){if(n<=0||t<=0||n===t)return o;let r=0,a=0,l=!1;const s=new Map,i=[];for(const h of e.panels){const d=o[h.id]??0;if(h.panelConstraints.groupResizeBehavior==="preserve-pixel-size"){l=!0;const S=d/100*n,m=T(S/t*100);s.set(h.id,m),r+=m}else i.push(h.id),a+=d}if(!l||i.length===0)return o;const u=100-r,c={...o};if(s.forEach((h,d)=>{c[d]=h}),a>0)for(const h of i){const d=o[h]??0;c[h]=T(d/a*u)}else{const h=T(u/i.length);for(const d of i)c[d]=h}return c}function Gt(e,t){const n=e.map(r=>r.id),o=Object.keys(t);if(n.length!==o.length)return!1;for(const r of n)if(!o.includes(r))return!1;return!0}const K=new Map;function $t(e){let t=!0;P(e.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const n=e.element.ownerDocument.defaultView.ResizeObserver,o=new Set,r=new Set,a=new n(m=>{for(const f of m){const{borderBoxSize:g,target:p}=f;if(p===e.element){if(t){const y=te({group:e});if(y===0)return;const z=H(e.id);if(!z)return;const b=he(e),v=z.defaultLayoutDeferred?We(b):z.layout,R=At({group:e,nextGroupSize:y,prevGroupSize:z.groupSize,prevLayout:v}),E=X({layout:R,panelConstraints:b});if(!z.defaultLayoutDeferred&&Y(z.layout,E)&&Ft(z.derivedPanelConstraints,b)&&z.groupSize===y)return;W(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:b,groupSize:y,layout:E,separatorToPanels:z.separatorToPanels})}}else Ot(e,p,g)}});a.observe(e.element),e.panels.forEach(m=>{P(!o.has(m.id),`Panel ids must be unique; id "${m.id}" was used more than once`),o.add(m.id),m.onResize&&a.observe(m.element)});const l=te({group:e}),s=he(e),i=e.panels.map(({id:m})=>m).join(",");let u=e.mutableState.defaultLayout;u&&(Gt(e.panels,u)||(u=void 0));const c=e.mutableState.layouts[i]??u??We(s),h=X({layout:c,panelConstraints:s}),d=e.element.ownerDocument;K.set(d,(K.get(d)??0)+1);const S=new Map;return Ye(e).forEach(m=>{m.separator&&S.set(m.separator,m.panels)}),W(e,{defaultLayoutDeferred:l===0,derivedPanelConstraints:s,groupSize:l,layout:h,separatorToPanels:S}),e.separators.forEach(m=>{P(!r.has(m.id),`Separator ids must be unique; id "${m.id}" was used more than once`),r.add(m.id),m.element.addEventListener("keydown",Oe)}),K.get(d)===1&&(d.addEventListener("contextmenu",De,!0),d.addEventListener("dblclick",je,!0),d.addEventListener("pointerdown",Fe,!0),d.addEventListener("pointerleave",Ae),d.addEventListener("pointermove",Ge),d.addEventListener("pointerout",$e),d.addEventListener("pointerup",Be,!0)),function(){t=!1,K.set(d,Math.max(0,(K.get(d)??0)-1)),Lt(e),e.separators.forEach(m=>{m.element.removeEventListener("keydown",Oe)}),K.get(d)||(d.removeEventListener("contextmenu",De,!0),d.removeEventListener("dblclick",je,!0),d.removeEventListener("pointerdown",Fe,!0),d.removeEventListener("pointerleave",Ae),d.removeEventListener("pointermove",Ge),d.removeEventListener("pointerout",$e),d.removeEventListener("pointerup",Be,!0)),a.disconnect()}}function Bt(){const[e,t]=L.useState({}),n=L.useCallback(()=>t({}),[]);return[e,n]}function Se(e){const t=L.useId();return`${e??t}`}const J=typeof window<"u"?L.useLayoutEffect:L.useEffect;function ae(e){const t=L.useRef(e);return J(()=>{t.current=e},[e]),L.useCallback((...n)=>t.current?.(...n),[t])}function we(...e){return ae(t=>{e.forEach(n=>{if(n)switch(typeof n){case"function":{n(t);break}case"object":{n.current=t;break}}})})}function xe(e){const t=L.useRef({...e});return J(()=>{for(const n in e)t.current[n]=e[n]},[e]),t.current}const rt=L.createContext(null);function Wt(e,t){const n=L.useRef({getLayout:()=>({}),setLayout:Ct});L.useImperativeHandle(t,()=>n.current,[]),J(()=>{Object.assign(n.current,nt({groupId:e}))})}function at({children:e,className:t,defaultLayout:n,disableCursor:o,disabled:r,elementRef:a,groupRef:l,id:s,onLayoutChange:i,onLayoutChanged:u,orientation:c="horizontal",resizeTargetMinimumSize:h={coarse:20,fine:10},style:d,...S}){const m=L.useRef({onLayoutChange:{},onLayoutChanged:{}}),f=ae(w=>{Y(m.current.onLayoutChange,w)||(m.current.onLayoutChange=w,i?.(w))}),g=ae((w,x)=>{Y(m.current.onLayoutChanged,w)||(m.current.onLayoutChanged=w,u?.(w,{isUserInteraction:x}))}),p=Se(s),y=L.useRef(null),[z,b]=Bt(),v=L.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:h,separators:[]}),R=we(y,a);Wt(p,l);const E=ae((w,x)=>{const k=U(),C=Me(w),D=H(w);if(D){let N=!1;return k.state==="active"&&(N=k.hitRegions.some(ne=>ne.group===C)),{flexGrow:D.layout[x]??1,pointerEvents:N?"none":void 0}}if(n?.[x])return{flexGrow:n?.[x]}}),M=xe({defaultLayout:n,disableCursor:o}),j=L.useMemo(()=>({get disableCursor(){return!!M.disableCursor},getPanelStyles:E,id:p,orientation:c,registerPanel:w=>{const x=v.current;return x.panels=ge(c,[...x.panels,w]),b(),()=>{x.panels=x.panels.filter(k=>k!==w),b()}},registerSeparator:w=>{const x=v.current;return x.separators=ge(c,[...x.separators,w]),b(),()=>{x.separators=x.separators.filter(k=>k!==w),b()}},updatePanelProps:(w,{disabled:x})=>{const k=v.current.panels.find(N=>N.id===w);k&&(k.panelConstraints.disabled=x);const C=Me(p),D=H(p);C&&D&&W(C,{...D,derivedPanelConstraints:he(C)})},updateSeparatorProps:(w,{disabled:x,disableDoubleClick:k})=>{const C=v.current.separators.find(D=>D.id===w);C&&(C.disabled=x,C.disableDoubleClick=k)}}),[E,p,b,c,M]),G=L.useRef(null);return J(()=>{const w=y.current;if(w===null)return;const x=v.current;let k;if(M.defaultLayout!==void 0&&Object.keys(M.defaultLayout).length===x.panels.length){k={};for(const $ of x.panels){const q=M.defaultLayout[$.id];q!==void 0&&(k[$.id]=q)}}const C={disabled:!!r,element:w,id:p,mutableState:{defaultLayout:k,disableCursor:!!M.disableCursor,expandedPanelSizes:v.current.lastExpandedPanelSizes,layouts:v.current.layouts},orientation:c,panels:x.panels,resizeTargetMinimumSize:x.resizeTargetMinimumSize,separators:x.separators};G.current=C;const D=$t(C),{defaultLayoutDeferred:N,derivedPanelConstraints:ne,layout:se}=H(C.id,!0);!N&&ne.length>0&&(f(se),g(se,!1));const oe=ye(p,$=>{const{defaultLayoutDeferred:q,derivedPanelConstraints:Pe,layout:le}=$.next;if(q||Pe.length===0)return;const lt=C.panels.map(({id:B})=>B).join(",");C.mutableState.layouts[lt]=le,Pe.forEach(B=>{if(B.collapsible){const{layout:fe}=$.prev??{};if(fe){const ct=I(B.collapsedSize,le[B.panelId]),dt=I(B.collapsedSize,fe[B.panelId]);ct&&!dt&&(C.mutableState.expandedPanelSizes[B.panelId]=fe[B.panelId])}}});const ut=U().state!=="active";f(le),ut&&g(le,$.isUserInteraction)});return()=>{G.current=null,D(),oe()}},[r,p,g,f,c,z,M]),L.useEffect(()=>{const w=G.current;w&&(w.mutableState.defaultLayout=n,w.mutableState.disableCursor=!!o)}),A.jsx(rt.Provider,{value:j,children:A.jsx("div",{...S,className:t,"data-group":!0,"data-testid":p,id:p,ref:R,style:{height:"100%",width:"100%",overflow:"hidden",...d,display:"flex",flexDirection:c==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:c==="horizontal"?"pan-y":"pan-x"},children:e})})}at.displayName="Group";function Ce(){const e=L.useContext(rt);return P(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function Ht(e,t){const{id:n}=Ce(),o=L.useRef({collapse:pe,expand:pe,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:pe});L.useImperativeHandle(t,()=>o.current,[]),J(()=>{Object.assign(o.current,tt({groupId:n,panelId:e}))})}function it({children:e,className:t,collapsedSize:n="0%",collapsible:o=!1,defaultSize:r,disabled:a,elementRef:l,groupResizeBehavior:s="preserve-relative-size",id:i,maxSize:u="100%",minSize:c="0%",onResize:h,panelRef:d,style:S,...m}){const f=!!i,g=Se(i),p=xe({disabled:a}),y=L.useRef(null),z=we(y,l),{getPanelStyles:b,id:v,orientation:R,registerPanel:E,updatePanelProps:M}=Ce(),j=h!==null,G=ae((C,D,N)=>{h?.(C,i,N)});J(()=>{const C=y.current;if(C!==null){const D={element:C,id:g,idIsStable:f,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:j?G:void 0,panelConstraints:{groupResizeBehavior:s,collapsedSize:n,collapsible:o,defaultSize:r,disabled:p.disabled,maxSize:u,minSize:c}};return E(D)}},[s,n,o,r,j,g,f,u,c,G,E,p]),L.useEffect(()=>{M(g,{disabled:a})},[a,g,M]),Ht(g,d);const w=()=>{const C=b(v,g);if(C)return JSON.stringify(C)},x=L.useSyncExternalStore(C=>ye(v,C),w,w);let k;return x?k=JSON.parse(x):r!==void 0?k={flexGrow:void 0,flexShrink:void 0,flexBasis:r}:k={flexGrow:1},A.jsx("div",{...m,"data-disabled":a||void 0,"data-panel":!0,"data-testid":g,id:g,ref:z,style:{...Vt,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...k},children:A.jsx("div",{className:t,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...S,touchAction:R==="horizontal"?"pan-y":"pan-x"},children:e})})}it.displayName="Panel";const Vt={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function Ut({layout:e,panelConstraints:t,panelId:n,panelIndex:o}){let r,a;const l=e[n],s=t.find(i=>i.panelId===n);if(s){const i=s.maxSize,u=s.collapsible?s.collapsedSize:s.minSize,c=[o,o+1];a=X({layout:ie({delta:u-l,initialLayout:e,panelConstraints:t,pivotIndices:c,prevLayout:e}),panelConstraints:t})[n],r=X({layout:ie({delta:i-l,initialLayout:e,panelConstraints:t,pivotIndices:c,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:r,valueMin:a,valueNow:l}}function st({children:e,className:t,disabled:n,disableDoubleClick:o,elementRef:r,id:a,style:l,...s}){const i=Se(a),u=xe({disabled:n,disableDoubleClick:o}),[c,h]=L.useState({}),[d,S]=L.useState("inactive"),[m,f]=L.useState(!1),g=L.useRef(null),p=we(g,r),{disableCursor:y,id:z,orientation:b,registerSeparator:v,updateSeparatorProps:R}=Ce(),E=b==="horizontal"?"vertical":"horizontal";J(()=>{const G=g.current;if(G!==null){const w={disabled:u.disabled,disableDoubleClick:u.disableDoubleClick,element:G,id:i},x=v(w),k=wt(D=>{S(D.next.state!=="inactive"&&D.next.hitRegions.some(N=>N.separator===w)?D.next.state:"inactive")}),C=ye(z,D=>{const{derivedPanelConstraints:N,layout:ne,separatorToPanels:se}=D.next,oe=se.get(w);if(oe){const $=oe[0],q=oe.indexOf($);h(Ut({layout:ne,panelConstraints:N,panelId:$.id,panelIndex:q}))}});return()=>{k(),C(),x()}}},[z,i,v,u]),L.useEffect(()=>{R(i,{disabled:n,disableDoubleClick:o})},[n,o,i,R]);let M;n&&!y&&(M="not-allowed");let j;return n?j="disabled":d==="active"?j="active":m?j="focus":j=d,A.jsx("div",{...s,"aria-controls":c.valueControls,"aria-disabled":n||void 0,"aria-orientation":E,"aria-valuemax":c.valueMax,"aria-valuemin":c.valueMin,"aria-valuenow":c.valueNow,children:e,className:t,"data-separator":j,"data-testid":i,id:i,onBlur:()=>f(!1),onFocus:()=>f(!0),ref:p,role:"separator",style:{flexBasis:"auto",cursor:M,...l,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:n?void 0:0})}st.displayName="Separator";function _t(e){const t=ve.c(10);let n,o,r;t[0]!==e?({className:n,ref:r,...o}=e,t[0]=e,t[1]=n,t[2]=o,t[3]=r):(n=t[1],o=t[2],r=t[3]);let a;t[4]!==n?(a=He("flex h-full w-full",n),t[4]=n,t[5]=a):a=t[5];let l;return t[6]!==o||t[7]!==r||t[8]!==a?(l=A.jsx(at,{groupRef:r,"data-slot":"resizable-panel-group",className:a,...o}),t[6]=o,t[7]=r,t[8]=a,t[9]=l):l=t[9],l}function Jt(e){const t=ve.c(10);let n,o,r;t[0]!==e?({ref:o,style:r,...n}=e,t[0]=e,t[1]=n,t[2]=o,t[3]=r):(n=t[1],o=t[2],r=t[3]);let a;t[4]!==r?(a={overflow:"hidden",...r},t[4]=r,t[5]=a):a=t[5];let l;return t[6]!==n||t[7]!==o||t[8]!==a?(l=A.jsx(it,{panelRef:o,"data-slot":"resizable-panel",style:a,...n}),t[6]=n,t[7]=o,t[8]=a,t[9]=l):l=t[9],l}function qt(e){const t=ve.c(12);let n,o,r;t[0]!==e?({withHandle:r,className:n,...o}=e,t[0]=e,t[1]=n,t[2]=o,t[3]=r):(n=t[1],o=t[2],r=t[3]);let a;t[4]!==n?(a=He("bg-border focus-visible:ring-ring relative flex w-[0.5px] items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:-translate-y-1/2 aria-[orientation=horizontal]:after:translate-x-0 [&[aria-orientation=horizontal]>div]:rotate-90",n),t[4]=n,t[5]=a):a=t[5];let l;t[6]!==r?(l=r&&A.jsx("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:A.jsx(ft,{className:"size-2.5"})}),t[6]=r,t[7]=l):l=t[7];let s;return t[8]!==o||t[9]!==a||t[10]!==l?(s=A.jsx(st,{"data-slot":"resizable-handle",className:a,...o,children:l}),t[8]=o,t[9]=a,t[10]=l,t[11]=s):s=t[11],s}export{_t as R,Jt as a,qt as b};
@@ -1 +1 @@
1
- import{k as s,u as c,p as f,v as u,aC as l,d,h as p,aD as m,j as k,aE as b,al as I}from"./agent-icon-CnnNyirr.js";import{a as $,b as C}from"./ZoomOut-CQckFmS9.js";import{ac as y}from"./index-D_7jfHk6.js";const e={overview:k,settings:m,automations:p,"site-editor":d,code:l,content:C,assets:$,hosting:y,e2e:u,analytics:f,cdn:c,files:s};function S(n){return n in e}function a(n){const t=b(n);if(t.type==="icon"){const i=I(t.name);return i?{kind:"component",Component:i}:null}return t.type==="url"?{kind:"url",src:t.url}:null}function h(n){if(n.kind==="system")return S(n.tabId)?{kind:"component",Component:e[n.tabId]}:{kind:"fallback"};const t=a(n.iconUrl);if(t)return t;if(!n.appId)return{kind:"fallback"};const i=n.connections.find(r=>r.id===n.appId);if(!i)return{kind:"fallback"};const o=a(i.icon);return o||{kind:"fallback"}}export{h as r};
1
+ import{k as s,u as c,p as f,v as u,aC as l,d,h as p,aD as m,j as k,aE as b,al as I}from"./agent-icon-V8lPNv7A.js";import{a as $,b as C}from"./ZoomOut-BMJlPGPs.js";import{ak as y}from"./index-P5CXrVFm.js";const e={overview:k,settings:m,automations:p,"site-editor":d,code:l,content:C,assets:$,hosting:y,e2e:u,analytics:f,cdn:c,files:s};function S(n){return n in e}function a(n){const t=b(n);if(t.type==="icon"){const i=I(t.name);return i?{kind:"component",Component:i}:null}return t.type==="url"?{kind:"url",src:t.url}:null}function h(n){if(n.kind==="system")return S(n.tabId)?{kind:"component",Component:e[n.tabId]}:{kind:"fallback"};const t=a(n.iconUrl);if(t)return t;if(!n.appId)return{kind:"fallback"};const i=n.connections.find(r=>r.id===n.appId);if(!i)return{kind:"fallback"};const o=a(i.icon);return o||{kind:"fallback"}}export{h as r};
@@ -0,0 +1 @@
1
+ import{c as j,b as _,j as i,eu as E,et as M,y as fe,t as ie,ev as q,ax as ue,Q as me,H as xe,r as U,B as se,a2 as pe,b2 as he,I as je,W as G}from"./index-P5CXrVFm.js";import{S as re}from"./switch-BJJ-2yIv.js";import{f as be,b as ve,j as ye,e as Se,c as ae,h as _e,s as Te,d as ke,a as we,g as Ee,i as Me}from"./UserSquare-v2Vi63lF.js";import{f as Ce,a as de,e as Pe,g as Ke,h as Ne,i as $e,j as Re}from"./use-organization-settings-BHelWCQF.js";import{u as Ae}from"./use-new-blocks-editor-Jqd7-2D9.js";import{u as ze}from"./use-connection-Bt-E6mI8.js";function Je(){const e=j.c(12),t=_();let s;e[0]!==t?(s=t("settings.review.title"),e[0]=t,e[1]=s):s=e[1];let l;e[2]!==t?(l=t("settings.review.description"),e[2]=t,e[3]=l):l=e[3];let n;e[4]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx(Ve,{}),e[4]=n):n=e[4];let o;e[5]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx(S,{flag:"cheap_reviewer_model",icon:i.jsx(be,{size:16}),titleKey:"settings.review.cheapReviewerModelTitle",descriptionKey:"settings.review.cheapReviewerModelDescription"}),e[5]=o):o=e[5];let c,r;e[6]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx(S,{flag:"auto_merge",icon:i.jsx(ve,{size:16}),titleKey:"settings.review.autoMergeTitle",descriptionKey:"settings.review.autoMergeDescription"}),r=i.jsx(We,{}),e[6]=c,e[7]=r):(c=e[6],r=e[7]);let b;e[8]===Symbol.for("react.memo_cache_sentinel")?(b=i.jsxs(E,{children:[n,o,c,r,i.jsx(S,{flag:"auto_assign_report_tasks_to_super_agent",icon:i.jsx(ye,{size:16}),titleKey:"settings.review.autoAssignReportTasksTitle",descriptionKey:"settings.review.autoAssignReportTasksDescription"})]}),e[8]=b):b=e[8];let g;return e[9]!==s||e[10]!==l?(g=i.jsx(M,{title:s,description:l,children:b}),e[9]=s,e[10]=l,e[11]=g):g=e[11],g}function Xe(){const e=j.c(8),t=_();let s;e[0]!==t?(s=t("settings.agentTools.title"),e[0]=t,e[1]=s):s=e[1];let l;e[2]!==t?(l=t("settings.agentTools.description"),e[2]=t,e[3]=l):l=e[3];let n;e[4]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsxs(E,{children:[i.jsx(S,{flag:"coding_agent_org_mcps",icon:i.jsx(Se,{size:16}),titleKey:"settings.agentTools.orgMcpsTitle",descriptionKey:"settings.agentTools.orgMcpsDescription"}),i.jsx(De,{})]}),e[4]=n):n=e[4];let o;return e[5]!==s||e[6]!==l?(o=i.jsx(M,{title:s,description:l,children:n}),e[5]=s,e[6]=l,e[7]=o):o=e[7],o}function De(){const e=j.c(2),t=_();if(!de("coding_agent_org_mcps"))return null;let l;return e[0]!==t?(l=i.jsx(me,{children:n=>{const{reset:o}=n;return i.jsx(xe,{fallback:c=>{const{resetError:r}=c;return i.jsx(q,{title:t("settings.agentTools.orgMcpsPickTitle"),children:i.jsxs("div",{role:"alert",className:"mt-3 flex items-center gap-2",children:[i.jsx("p",{className:"text-sm text-destructive",children:t("settings.agentTools.orgMcpsPickLoadFailed")}),i.jsx(se,{variant:"outline",size:"sm",onClick:()=>{o(),r()},children:t("common.errorBoundary.tryAgain")})]})})},children:i.jsx(U.Suspense,{fallback:i.jsx(Oe,{}),children:i.jsx(Fe,{})})})}}),e[0]=t,e[1]=l):l=e[1],l}function Oe(){const e=j.c(5),t=_();let s;e[0]!==t?(s=t("settings.agentTools.orgMcpsPickTitle"),e[0]=t,e[1]=s):s=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(he,{className:"mt-3 h-24 w-full"}),e[2]=l):l=e[2];let n;return e[3]!==s?(n=i.jsx(q,{title:s,children:l}),e[3]=s,e[4]=n):n=e[4],n}function ce(e){return[...e].sort().join("\0")}function Be(e,t){return[G.SELF,G.REGISTRY,G.COMMUNITY_REGISTRY,G.DEV_ASSETS,G.REPORTS].some(s=>s(e)===t)}function Fe(){const e=j.c(84),t=_(),{org:s}=pe(),l=ze(),n=$e(),o=Re(),[c,r]=U.useState(n);let b;e[0]!==n?(b=ce(n),e[0]=n,e[1]=b):b=e[1];const[g,u]=U.useState(b),[a,m]=U.useState("");let y;e[2]!==n?(y=ce(n),e[2]=n,e[3]=y):y=e[3];const x=y;g!==x&&(u(x),r(n));let p,h,f,C,v;if(e[4]!==l||e[5]!==c||e[6]!==s||e[7]!==a||e[8]!==x){let d;e[14]!==s?(d=k=>!Be(s.id,k.id),e[14]=s,e[15]=d):d=e[15],f=l.filter(d);const T=a.trim().toLowerCase();v=T?f.filter(k=>`${k.title} ${k.slug??""}`.toLowerCase().includes(T)):f;let w;e[16]!==c?(w=new Set(c),e[16]=c,e[17]=w):w=e[17],h=w,p=ce(c.filter(k=>f.some(ge=>ge.id===k)))!==x,C=v.length>0&&v.every(k=>!h.has(k.id)),e[4]=l,e[5]=c,e[6]=s,e[7]=a,e[8]=x,e[9]=p,e[10]=h,e[11]=f,e[12]=C,e[13]=v}else p=e[9],h=e[10],f=e[11],C=e[12],v=e[13];const P=C;let J;e[18]!==c?(J=(d,T)=>{const w=new Set(d);r(T?c.filter(k=>!w.has(k)):[...new Set([...c,...d])])},e[18]=c,e[19]=J):J=e[19];const K=J;let X;e[20]!==c||e[21]!==f||e[22]!==o||e[23]!==t?(X=()=>o.mutate(c.filter(d=>f.some(T=>T.id===d)),{onSuccess:()=>ie.success(t("settings.agentTools.orgMcpsPickSaved")),onError:()=>ie.error(t("settings.agentTools.orgMcpsPickFailed"))}),e[20]=c,e[21]=f,e[22]=o,e[23]=t,e[24]=X):X=e[24];const le=X;let N;e[25]!==t?(N=t("settings.agentTools.orgMcpsPickTitle"),e[25]=t,e[26]=N):N=e[26];let $;e[27]!==t?($=t("settings.agentTools.orgMcpsPickDescription"),e[27]=t,e[28]=$):$=e[28];let Z;e[29]===Symbol.for("react.memo_cache_sentinel")?(Z=i.jsx(Me,{size:14,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),e[29]=Z):Z=e[29];let ee;e[30]===Symbol.for("react.memo_cache_sentinel")?(ee=d=>m(d.target.value),e[30]=ee):ee=e[30];let R;e[31]!==t?(R=t("settings.agentTools.orgMcpsPickSearch"),e[31]=t,e[32]=R):R=e[32];let A;e[33]!==t?(A=t("settings.agentTools.orgMcpsPickSearch"),e[33]=t,e[34]=A):A=e[34];let z;e[35]!==a||e[36]!==A||e[37]!==R?(z=i.jsxs("div",{className:"relative flex-1",children:[Z,i.jsx(je,{value:a,onChange:ee,placeholder:R,"aria-label":A,className:"h-8 pl-8 text-xs"})]}),e[35]=a,e[36]=A,e[37]=R,e[38]=z):z=e[38];const ne=v.length===0;let D;e[39]!==P||e[40]!==K||e[41]!==v?(D=()=>K(v.map(Ie),!P),e[39]=P,e[40]=K,e[41]=v,e[42]=D):D=e[42];let O;e[43]!==P||e[44]!==t?(O=t(P?"settings.agentTools.orgMcpsPickDisableAll":"settings.agentTools.orgMcpsPickEnableAll"),e[43]=P,e[44]=t,e[45]=O):O=e[45];let B;e[46]!==ne||e[47]!==D||e[48]!==O?(B=i.jsx(se,{variant:"outline",size:"sm",className:"shrink-0",disabled:ne,onClick:D,children:O}),e[46]=ne,e[47]=D,e[48]=O,e[49]=B):B=e[49];let F;e[50]!==z||e[51]!==B?(F=i.jsxs("div",{className:"flex items-center gap-2",children:[z,B]}),e[50]=z,e[51]=B,e[52]=F):F=e[52];let I;e[53]!==h||e[54]!==f.length||e[55]!==K||e[56]!==t||e[57]!==v?(I=f.length===0?i.jsx("p",{className:"p-3 text-xs text-muted-foreground",children:t("settings.agentTools.orgMcpsPickEmpty")}):v.length===0?i.jsx("p",{className:"p-3 text-xs text-muted-foreground",children:t("settings.agentTools.orgMcpsPickNoMatch")}):v.map(d=>{const T=d.title||d.id;return i.jsxs("div",{className:"flex items-center justify-between gap-3 px-3 py-2",children:[i.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[i.jsx(Le,{icon:d.icon,title:T}),i.jsxs("div",{className:"flex min-w-0 flex-col",children:[i.jsx("span",{className:"truncate text-sm leading-tight",children:T}),d.slug&&i.jsx("span",{className:"truncate text-xs text-muted-foreground",children:d.slug})]})]}),i.jsx(re,{checked:!h.has(d.id),"aria-label":t("settings.agentTools.orgMcpsPickAriaLabel",{name:T}),onCheckedChange:w=>K([d.id],w)})]},d.id)}),e[53]=h,e[54]=f.length,e[55]=K,e[56]=t,e[57]=v,e[58]=I):I=e[58];let L;e[59]!==I?(L=i.jsx("div",{className:"max-h-64 overflow-y-auto rounded-xl border border-border divide-y divide-border",children:I}),e[59]=I,e[60]=L):L=e[60];const oe=!p||o.isPending;let V;e[61]!==o.isPending||e[62]!==t?(V=o.isPending?t("settings.agentTools.orgMcpsPickSaving"):t("settings.agentTools.orgMcpsPickSave"),e[61]=o.isPending,e[62]=t,e[63]=V):V=e[63];let W;e[64]!==le||e[65]!==oe||e[66]!==V?(W=i.jsx(se,{size:"sm",disabled:oe,onClick:le,children:V}),e[64]=le,e[65]=oe,e[66]=V,e[67]=W):W=e[67];let H;e[68]!==p||e[69]!==n||e[70]!==o.isPending||e[71]!==t?(H=p&&i.jsx(se,{variant:"ghost",size:"sm",disabled:o.isPending,onClick:()=>r(n),children:t("settings.agentTools.orgMcpsPickDiscard")}),e[68]=p,e[69]=n,e[70]=o.isPending,e[71]=t,e[72]=H):H=e[72];let Q;e[73]!==W||e[74]!==H?(Q=i.jsxs("div",{className:"flex items-center gap-2",children:[W,H]}),e[73]=W,e[74]=H,e[75]=Q):Q=e[75];let Y;e[76]!==F||e[77]!==L||e[78]!==Q?(Y=i.jsxs("div",{className:"mt-3 flex w-full flex-col gap-2",children:[F,L,Q]}),e[76]=F,e[77]=L,e[78]=Q,e[79]=Y):Y=e[79];let te;return e[80]!==Y||e[81]!==N||e[82]!==$?(te=i.jsx(q,{title:N,description:$,children:Y}),e[80]=Y,e[81]=N,e[82]=$,e[83]=te):te=e[83],te}function Ie(e){return e.id}function Le(e){const t=j.c(4),{icon:s,title:l}=e,[n,o]=U.useState(!1);let c;return t[0]!==n||t[1]!==s||t[2]!==l?(c=i.jsx("div",{className:"flex size-7 shrink-0 items-center justify-center overflow-hidden rounded-md border border-border bg-muted/20",children:s&&!n?i.jsx("img",{src:s,alt:"",loading:"lazy",className:"h-full w-full object-cover",onError:()=>o(!0)}):i.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground",children:l.charAt(0).toUpperCase()})}),t[0]=n,t[1]=s,t[2]=l,t[3]=c):c=t[3],c}function Ze(){const e=j.c(5),t=_();let s;e[0]!==t?(s=t("sidebar.agentsSection.codeAgents"),e[0]=t,e[1]=s):s=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(E,{children:i.jsx(S,{flag:"coding_agents_claude_code",icon:i.jsx(ae,{size:16}),titleKey:"settings.agentTools.codingAgentsClaudeCodeTitle",descriptionKey:"settings.agentTools.codingAgentsClaudeCodeDescription"})}),e[2]=l):l=e[2];let n;return e[3]!==s?(n=i.jsx(M,{title:s,children:l}),e[3]=s,e[4]=n):n=e[4],n}function et(){const e=j.c(5),t=_();let s;e[0]!==t?(s=t("settings.agentTools.chatRuntimeSection"),e[0]=t,e[1]=s):s=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(E,{children:i.jsx(S,{flag:"chat_harness_sandbox_only",icon:i.jsx(ae,{size:16}),titleKey:"settings.agentTools.chatHarnessSandboxOnlyTitle",descriptionKey:"settings.agentTools.chatHarnessSandboxOnlyDescription"})}),e[2]=l):l=e[2];let n;return e[3]!==s?(n=i.jsx(M,{title:s,children:l}),e[3]=s,e[4]=n):n=e[4],n}function tt(){const e=j.c(5),t=_();let s;e[0]!==t?(s=t("settings.voice.title"),e[0]=t,e[1]=s):s=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(E,{children:i.jsx(S,{flag:"voice_mode",icon:i.jsx(_e,{size:16}),titleKey:"settings.voice.title",descriptionKey:"settings.voice.description"})}),e[2]=l):l=e[2];let n;return e[3]!==s?(n=i.jsx(M,{title:s,children:l}),e[3]=s,e[4]=n):n=e[4],n}function st(){const e=j.c(6),t=_();let s;e[0]!==t?(s=t("settings.blog.sectionTitle"),e[0]=t,e[1]=s):s=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(S,{flag:"blog_ai_enabled",icon:i.jsx(Te,{size:16}),titleKey:"settings.blog.aiTitle",descriptionKey:"settings.blog.aiDescription"}),e[2]=l):l=e[2];let n;e[3]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsxs(E,{children:[l,i.jsx(S,{flag:"hide_default_blog_blocks",icon:i.jsx(ke,{size:16}),titleKey:"settings.blogBlocks.title",descriptionKey:"settings.blogBlocks.description"})]}),e[3]=n):n=e[3];let o;return e[4]!==s?(o=i.jsx(M,{title:s,children:n}),e[4]=s,e[5]=o):o=e[5],o}function it(){const e=j.c(24),t=_(),s=Ae(),l=Ce();let n;e[0]!==t?(n=t("sidebar.projectNav.siteEditor"),e[0]=t,e[1]=n):n=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx(we,{size:16}),e[2]=o):o=e[2];let c;e[3]!==t?(c=t("settings.blocksEditor.title"),e[3]=t,e[4]=c):c=e[4];let r;e[5]!==t?(r=t("settings.blocksEditor.description"),e[5]=t,e[6]=r):r=e[6];const b=l.isPending;let g;e[7]!==t?(g=t("settings.blocksEditor.title"),e[7]=t,e[8]=g):g=e[8];let u;e[9]!==l||e[10]!==t?(u=x=>{fe("preferences_blocks_editor_toggled",{enabled:x}),l.mutate(x,{onError:()=>ie.error(t("settings.review.updateError"))})},e[9]=l,e[10]=t,e[11]=u):u=e[11];let a;e[12]!==s||e[13]!==l.isPending||e[14]!==g||e[15]!==u?(a=i.jsx(re,{checked:s,disabled:b,"aria-label":g,onCheckedChange:u}),e[12]=s,e[13]=l.isPending,e[14]=g,e[15]=u,e[16]=a):a=e[16];let m;e[17]!==c||e[18]!==r||e[19]!==a?(m=i.jsx(E,{children:i.jsx(q,{icon:o,title:c,description:r,action:a})}),e[17]=c,e[18]=r,e[19]=a,e[20]=m):m=e[20];let y;return e[21]!==n||e[22]!==m?(y=i.jsx(M,{title:n,children:m}),e[21]=n,e[22]=m,e[23]=y):y=e[23],y}function Ve(){const e=j.c(3),t=Pe();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx(Ee,{size:16}),e[0]=s):s=e[0];let l;return e[1]!==t?(l=i.jsx(S,{flag:"reviewer_enabled",icon:s,titleKey:"settings.review.reviewerTitle",descriptionKey:"settings.review.reviewerDescription",enabled:t}),e[1]=t,e[2]=l):l=e[2],l}function We(){const e=j.c(3),t=Ke();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx(ue,{size:16}),e[0]=s):s=e[0];let l;return e[1]!==t?(l=i.jsx(S,{flag:"auto_resolve_conflicts",icon:s,titleKey:"settings.review.autoResolveConflictsTitle",descriptionKey:"settings.review.autoResolveConflictsDescription",enabled:t}),e[1]=t,e[2]=l):l=e[2],l}function S(e){const t=j.c(23),{flag:s,icon:l,titleKey:n,descriptionKey:o,enabled:c}=e,r=_(),b=de(s),g=c??b,u=Ne();let a;t[0]!==r||t[1]!==n?(a=r(n),t[0]=r,t[1]=n,t[2]=a):a=t[2];let m;t[3]!==o||t[4]!==r?(m=r(o),t[3]=o,t[4]=r,t[5]=m):m=t[5];const y=u.isPending;let x;t[6]!==r||t[7]!==n?(x=r(n),t[6]=r,t[7]=n,t[8]=x):x=t[8];let p;t[9]!==s||t[10]!==u||t[11]!==r?(p=C=>u.mutate(s,C,{onError:()=>ie.error(r("settings.review.updateError"))}),t[9]=s,t[10]=u,t[11]=r,t[12]=p):p=t[12];let h;t[13]!==g||t[14]!==u.isPending||t[15]!==x||t[16]!==p?(h=i.jsx(re,{checked:g,disabled:y,"aria-label":x,onCheckedChange:p}),t[13]=g,t[14]=u.isPending,t[15]=x,t[16]=p,t[17]=h):h=t[17];let f;return t[18]!==l||t[19]!==a||t[20]!==m||t[21]!==h?(f=i.jsx(q,{icon:l,title:a,description:m,action:h}),t[18]=l,t[19]=a,t[20]=m,t[21]=h,t[22]=f):f=t[22],f}export{Xe as A,st as B,et as C,Je as R,tt as V,Ze as a,it as b};
@@ -1 +1 @@
1
- import{c as y,l as m,b as G,r as x,j as a,a9 as J}from"./index-D_7jfHk6.js";import{i as F}from"./Link01-BRZRc4wX.js";import{s as Q}from"./Trash01-DAoFHSpp.js";const ie="[&_a]:cursor-pointer [&_a]:text-primary [&_a]:underline [&_a]:decoration-primary/60 [&_a]:underline-offset-2 [&_a]:rounded-sm [&_a]:bg-primary/5 [&_a]:px-0.5",V=new Set(["http:","https:","mailto:","tel:","ftp:"]);function X(s){if(s.startsWith("/")||s.startsWith(".")||s.startsWith("#"))return!0;try{const e=new URL(s,"https://placeholder.invalid");return V.has(e.protocol)}catch{return!1}}function Y(s){const e=s.trim();return e?e.startsWith("/")||e.startsWith(".")||e.startsWith("#")||/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(e)?e:`https://${e}`:""}const ee="noopener noreferrer nofollow";function D(s){const e=y.c(8),{active:r,label:i,onClick:c,children:n}=s,l=r?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground";let t;e[0]!==l?(t=m("flex h-7 w-7 items-center justify-center rounded-[var(--studio-control-radius,var(--radius))] transition-colors cursor-pointer",l),e[0]=l,e[1]=t):t=e[1];let u;return e[2]!==r||e[3]!==n||e[4]!==i||e[5]!==c||e[6]!==t?(u=a.jsx("button",{type:"button","aria-label":i,"aria-pressed":r,onMouseDown:te,onClick:c,className:t,children:n}),e[2]=r,e[3]=n,e[4]=i,e[5]=c,e[6]=t,e[7]=u):u=e[7],u}function te(s){return s.preventDefault()}function K(s){const e=y.c(7),{active:r,label:i,onSelect:c}=s,n=r?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground";let l;e[0]!==n?(l=m("flex-1 rounded-[var(--studio-control-radius,var(--radius))] px-2 py-1 text-xs transition-colors cursor-pointer",n),e[0]=n,e[1]=l):l=e[1];let t;return e[2]!==r||e[3]!==i||e[4]!==c||e[5]!==l?(t=a.jsx("button",{type:"button","aria-pressed":r,onMouseDown:re,onClick:c,className:l,children:i}),e[2]=r,e[3]=i,e[4]=c,e[5]=l,e[6]=t):t=e[6],t}function re(s){return s.preventDefault()}function P(s){const e=y.c(8),{active:r,icon:i,label:c,onSelect:n}=s,l=r?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground";let t;e[0]!==l?(t=m("flex flex-1 items-center justify-center gap-1 rounded-[var(--studio-control-radius,var(--radius))] px-2 py-1 text-xs transition-colors cursor-pointer",l),e[0]=l,e[1]=t):t=e[1];let u;return e[2]!==r||e[3]!==i||e[4]!==c||e[5]!==n||e[6]!==t?(u=a.jsxs("button",{type:"button","aria-pressed":r,onMouseDown:ne,onClick:n,className:t,children:[i,c]}),e[2]=r,e[3]=i,e[4]=c,e[5]=n,e[6]=t,e[7]=u):u=e[7],u}function ne(s){return s.preventDefault()}function le(s){const e=y.c(27),{editor:r,active:i,open:c,onOpenChange:n,sources:l}=s,t=G(),[u,z]=x.useState(""),[d,C]=x.useState(!0),[A,E]=x.useState(!1),[S,_]=x.useState("url");let h;e[0]!==i||e[1]!==r||e[2]!==n?(h=()=>{const o=r.getAttributes("link");z(typeof o.href=="string"?o.href:""),C(i?o.target==="_blank":!0),E(!1),_("url"),n(!0)},e[0]=i,e[1]=r,e[2]=n,e[3]=h):h=e[3];const Z=h;let v;e[4]!==r||e[5]!==n?(v=()=>{n(!1),r.chain().focus().run()},e[4]=r,e[5]=n,e[6]=v):v=e[6];const M=v;let b;e[7]!==r||e[8]!==d||e[9]!==n?(b=(o,B)=>{const U=B===void 0?!1:B,R=U?o.trim():Y(o);if(R===""){r.chain().focus().extendMarkRange("link").unsetLink().run(),n(!1);return}if(!U&&!X(R)){E(!0);return}r.chain().focus().extendMarkRange("link").setLink({href:R,target:d?"_blank":null,rel:d?ee:null}).run(),n(!1)},e[7]=r,e[8]=d,e[9]=n,e[10]=b):b=e[10];const g=b;let k;e[11]!==g||e[12]!==u?(k=()=>g(u),e[11]=g,e[12]=u,e[13]=k):k=e[13];const W=k;let L;e[14]!==r||e[15]!==n?(L=()=>{r.chain().focus().extendMarkRange("link").unsetLink().run(),n(!1)},e[14]=r,e[15]=n,e[16]=L):L=e[16];const q=L,I=!!l?.length,$=l?.find(o=>o.id===S),O=x.useRef(null),H="relative";let f;e[17]!==t?(f=t("sectionsEditor.richTextLinkControl.linkButtonLabel"),e[17]=t,e[18]=f):f=e[18];const w=c?M:Z;let j;e[19]===Symbol.for("react.memo_cache_sentinel")?(j=a.jsx(F,{size:14}),e[19]=j):j=e[19];let p;e[20]!==i||e[21]!==f||e[22]!==w?(p=a.jsx(D,{active:i,label:f,onClick:w,children:j}),e[20]=i,e[21]=f,e[22]=w,e[23]=p):p=e[23];const N=c&&a.jsxs("div",{ref:O,className:m("absolute left-0 top-full z-20 mt-1.5 flex flex-col gap-1 rounded-[var(--studio-surface-radius,var(--radius-md))] border bg-popover p-1 shadow-md",I?"w-80":"w-64"),onBlur:()=>{requestAnimationFrame(()=>{O.current?.contains(document.activeElement)||n(!1)})},children:[I&&a.jsxs("div",{className:"flex items-center gap-0.5 rounded-[var(--studio-control-radius,var(--radius))] bg-muted/40 p-0.5",children:[a.jsx(P,{active:S==="url",icon:a.jsx(F,{size:12}),label:t("sectionsEditor.richTextLinkControl.tabUrl"),onSelect:()=>_("url")}),l?.map(o=>a.jsx(P,{active:S===o.id,icon:o.icon,label:o.label,onSelect:()=>_(o.id)},o.id))]}),$?$.render(o=>g(o,!0)):a.jsxs("div",{className:"flex items-center gap-0.5",children:[a.jsx("input",{autoFocus:!0,type:"text","aria-label":t("sectionsEditor.richTextLinkControl.urlInputAriaLabel"),"aria-invalid":A,placeholder:t("sectionsEditor.richTextLinkControl.urlInputPlaceholder"),value:u,onChange:o=>{z(o.target.value),E(!1)},onKeyDown:o=>{o.key==="Enter"?(o.preventDefault(),W()):o.key==="Escape"&&(o.preventDefault(),M())},className:m("h-7 flex-1 rounded-[var(--studio-control-radius,var(--radius))] bg-transparent px-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none",A&&"text-destructive")}),a.jsx(D,{active:!1,label:t("sectionsEditor.richTextLinkControl.applyLinkLabel"),onClick:W,children:a.jsx(J,{size:14})}),i&&a.jsx(D,{active:!1,label:t("sectionsEditor.richTextLinkControl.removeLinkLabel"),onClick:q,children:a.jsx(Q,{size:14})})]}),a.jsxs("div",{className:"flex items-center gap-0.5 rounded-[var(--studio-control-radius,var(--radius))] bg-muted/40 p-0.5",children:[a.jsx(K,{active:!d,label:t("sectionsEditor.richTextLinkControl.sameTabLabel"),onSelect:()=>C(!1)}),a.jsx(K,{active:d,label:t("sectionsEditor.richTextLinkControl.newTabLabel"),onSelect:()=>C(!0)})]})]});let T;return e[24]!==p||e[25]!==N?(T=a.jsxs("div",{className:H,children:[p,N]}),e[24]=p,e[25]=N,e[26]=T):T=e[26],T}export{ie as E,le as R,D as T,X as i,Y as n};
1
+ import{c as y,l as m,b as G,r as x,j as a,ah as J}from"./index-P5CXrVFm.js";import{i as F}from"./Link01-CLZO7iiX.js";import{s as Q}from"./Trash01-BuqURrgl.js";const ie="[&_a]:cursor-pointer [&_a]:text-primary [&_a]:underline [&_a]:decoration-primary/60 [&_a]:underline-offset-2 [&_a]:rounded-sm [&_a]:bg-primary/5 [&_a]:px-0.5",V=new Set(["http:","https:","mailto:","tel:","ftp:"]);function X(s){if(s.startsWith("/")||s.startsWith(".")||s.startsWith("#"))return!0;try{const e=new URL(s,"https://placeholder.invalid");return V.has(e.protocol)}catch{return!1}}function Y(s){const e=s.trim();return e?e.startsWith("/")||e.startsWith(".")||e.startsWith("#")||/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(e)?e:`https://${e}`:""}const ee="noopener noreferrer nofollow";function D(s){const e=y.c(8),{active:r,label:i,onClick:c,children:n}=s,l=r?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground";let t;e[0]!==l?(t=m("flex h-7 w-7 items-center justify-center rounded-[var(--studio-control-radius,var(--radius))] transition-colors cursor-pointer",l),e[0]=l,e[1]=t):t=e[1];let u;return e[2]!==r||e[3]!==n||e[4]!==i||e[5]!==c||e[6]!==t?(u=a.jsx("button",{type:"button","aria-label":i,"aria-pressed":r,onMouseDown:te,onClick:c,className:t,children:n}),e[2]=r,e[3]=n,e[4]=i,e[5]=c,e[6]=t,e[7]=u):u=e[7],u}function te(s){return s.preventDefault()}function K(s){const e=y.c(7),{active:r,label:i,onSelect:c}=s,n=r?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground";let l;e[0]!==n?(l=m("flex-1 rounded-[var(--studio-control-radius,var(--radius))] px-2 py-1 text-xs transition-colors cursor-pointer",n),e[0]=n,e[1]=l):l=e[1];let t;return e[2]!==r||e[3]!==i||e[4]!==c||e[5]!==l?(t=a.jsx("button",{type:"button","aria-pressed":r,onMouseDown:re,onClick:c,className:l,children:i}),e[2]=r,e[3]=i,e[4]=c,e[5]=l,e[6]=t):t=e[6],t}function re(s){return s.preventDefault()}function P(s){const e=y.c(8),{active:r,icon:i,label:c,onSelect:n}=s,l=r?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground";let t;e[0]!==l?(t=m("flex flex-1 items-center justify-center gap-1 rounded-[var(--studio-control-radius,var(--radius))] px-2 py-1 text-xs transition-colors cursor-pointer",l),e[0]=l,e[1]=t):t=e[1];let u;return e[2]!==r||e[3]!==i||e[4]!==c||e[5]!==n||e[6]!==t?(u=a.jsxs("button",{type:"button","aria-pressed":r,onMouseDown:ne,onClick:n,className:t,children:[i,c]}),e[2]=r,e[3]=i,e[4]=c,e[5]=n,e[6]=t,e[7]=u):u=e[7],u}function ne(s){return s.preventDefault()}function le(s){const e=y.c(27),{editor:r,active:i,open:c,onOpenChange:n,sources:l}=s,t=G(),[u,z]=x.useState(""),[d,C]=x.useState(!0),[A,E]=x.useState(!1),[S,_]=x.useState("url");let h;e[0]!==i||e[1]!==r||e[2]!==n?(h=()=>{const o=r.getAttributes("link");z(typeof o.href=="string"?o.href:""),C(i?o.target==="_blank":!0),E(!1),_("url"),n(!0)},e[0]=i,e[1]=r,e[2]=n,e[3]=h):h=e[3];const Z=h;let v;e[4]!==r||e[5]!==n?(v=()=>{n(!1),r.chain().focus().run()},e[4]=r,e[5]=n,e[6]=v):v=e[6];const M=v;let b;e[7]!==r||e[8]!==d||e[9]!==n?(b=(o,B)=>{const U=B===void 0?!1:B,R=U?o.trim():Y(o);if(R===""){r.chain().focus().extendMarkRange("link").unsetLink().run(),n(!1);return}if(!U&&!X(R)){E(!0);return}r.chain().focus().extendMarkRange("link").setLink({href:R,target:d?"_blank":null,rel:d?ee:null}).run(),n(!1)},e[7]=r,e[8]=d,e[9]=n,e[10]=b):b=e[10];const g=b;let k;e[11]!==g||e[12]!==u?(k=()=>g(u),e[11]=g,e[12]=u,e[13]=k):k=e[13];const W=k;let L;e[14]!==r||e[15]!==n?(L=()=>{r.chain().focus().extendMarkRange("link").unsetLink().run(),n(!1)},e[14]=r,e[15]=n,e[16]=L):L=e[16];const q=L,I=!!l?.length,$=l?.find(o=>o.id===S),O=x.useRef(null),H="relative";let f;e[17]!==t?(f=t("sectionsEditor.richTextLinkControl.linkButtonLabel"),e[17]=t,e[18]=f):f=e[18];const w=c?M:Z;let j;e[19]===Symbol.for("react.memo_cache_sentinel")?(j=a.jsx(F,{size:14}),e[19]=j):j=e[19];let p;e[20]!==i||e[21]!==f||e[22]!==w?(p=a.jsx(D,{active:i,label:f,onClick:w,children:j}),e[20]=i,e[21]=f,e[22]=w,e[23]=p):p=e[23];const N=c&&a.jsxs("div",{ref:O,className:m("absolute left-0 top-full z-20 mt-1.5 flex flex-col gap-1 rounded-[var(--studio-surface-radius,var(--radius-md))] border bg-popover p-1 shadow-md",I?"w-80":"w-64"),onBlur:()=>{requestAnimationFrame(()=>{O.current?.contains(document.activeElement)||n(!1)})},children:[I&&a.jsxs("div",{className:"flex items-center gap-0.5 rounded-[var(--studio-control-radius,var(--radius))] bg-muted/40 p-0.5",children:[a.jsx(P,{active:S==="url",icon:a.jsx(F,{size:12}),label:t("sectionsEditor.richTextLinkControl.tabUrl"),onSelect:()=>_("url")}),l?.map(o=>a.jsx(P,{active:S===o.id,icon:o.icon,label:o.label,onSelect:()=>_(o.id)},o.id))]}),$?$.render(o=>g(o,!0)):a.jsxs("div",{className:"flex items-center gap-0.5",children:[a.jsx("input",{autoFocus:!0,type:"text","aria-label":t("sectionsEditor.richTextLinkControl.urlInputAriaLabel"),"aria-invalid":A,placeholder:t("sectionsEditor.richTextLinkControl.urlInputPlaceholder"),value:u,onChange:o=>{z(o.target.value),E(!1)},onKeyDown:o=>{o.key==="Enter"?(o.preventDefault(),W()):o.key==="Escape"&&(o.preventDefault(),M())},className:m("h-7 flex-1 rounded-[var(--studio-control-radius,var(--radius))] bg-transparent px-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none",A&&"text-destructive")}),a.jsx(D,{active:!1,label:t("sectionsEditor.richTextLinkControl.applyLinkLabel"),onClick:W,children:a.jsx(J,{size:14})}),i&&a.jsx(D,{active:!1,label:t("sectionsEditor.richTextLinkControl.removeLinkLabel"),onClick:q,children:a.jsx(Q,{size:14})})]}),a.jsxs("div",{className:"flex items-center gap-0.5 rounded-[var(--studio-control-radius,var(--radius))] bg-muted/40 p-0.5",children:[a.jsx(K,{active:!d,label:t("sectionsEditor.richTextLinkControl.sameTabLabel"),onSelect:()=>C(!1)}),a.jsx(K,{active:d,label:t("sectionsEditor.richTextLinkControl.newTabLabel"),onSelect:()=>C(!0)})]})]});let T;return e[24]!==p||e[25]!==N?(T=a.jsxs("div",{className:H,children:[p,N]}),e[24]=p,e[25]=N,e[26]=T):T=e[26],T}export{ie as E,le as R,D as T,X as i,Y as n};
@@ -0,0 +1 @@
1
+ import{b as oe,r as Y,a2 as ke,J as jt,K as me,m as ze,da as Pt,j as s,l as J,h as ue,B as ae,c as q,aD as qe,bU as Me,aE as ne,bS as Ke,cX as We,o as it,aC as Dt,aB as Mt,e as rt,t as Le,y as Fe,d8 as Lt,x as vt,n as re,af as at,P as yt,et as Xe,eu as et,ev as tt,a4 as wt,aV as st,at as kt,av as Gt,u as ct,fZ as dt,g2 as Bt,H as Ut,d as Kt,X as Vt,T as zt,V as Ft,U as Yt}from"./index-P5CXrVFm.js";import{u as $t}from"./use-organization-roles-DjUuzQZu.js";import{u as Ye}from"./use-org-auth-client-B6LnSeUd.js";import{g as mt,a as Qt}from"./role-color-Dn2tXDDF.js";import{B as ve}from"./badge-BgcNCpYt.js";import{f as ut,e as ft,A as gt,a as Tt,b as ht,c as xt,g as _t,d as Et}from"./alert-dialog-BTzKubzN.js";import{i as Ht}from"./DotsVertical-BRQyK86q.js";import{s as Ve}from"./Plus-BjGOOPj6.js";import{s as Zt}from"./Trash01-BuqURrgl.js";import{C as Jt}from"./collection-table-wrapper-CfCYWslA.js";import{E as lt}from"./empty-state-pDkjxQ9v.js";import{S as $e}from"./search-input-zIdNkZIZ.js";import{P as pt,D as At}from"./ai-providers-logos-DD3qZ33J.js";import{I as Qe}from"./integration-icon-67Xzvyfa.js";import{u as qt}from"./use-infinite-scroll-DGijCA4m.js";import{C as Ge}from"./checkbox-C1PTdkvC.js";import{i as Wt}from"./ArrowLeft-CYC7J9yW.js";import{u as Xt}from"./useSuspenseInfiniteQuery-BY9PV9K3.js";import{u as es}from"./use-mcp-client-BzoSbdXu.js";import{C as ts}from"./collection-search-6N7Rez-8.js";import{p as ss}from"./connection-CRPvojqI.js";import{a as It}from"./use-members-BuywckX1.js";import{g as St}from"./get-initials-D-f_fDFw.js";import{u as ls}from"./use-connection-Bt-E6mI8.js";import{i as os}from"./repository-binding-DgstszW0.js";import{u as ns,h as is}from"./use-ai-providers-RQRNdq_e.js";import{A as Rt}from"./avatar-DbpOZfYL.js";import{S as fe}from"./switch-BJJ-2yIv.js";import{c as be,b as je,T as Pe,a as De}from"./tooltip-K3E8D0ro.js";import{P as rs}from"./project-icon-CVjxspby.js";import{s as as}from"./use-project-scope-B9l8p85i.js";import{t as cs}from"./Building02-HV2PP9yH.js";import{t as ds}from"./ChevronUp-DZuLpYB1.js";import{x as ms,k as us}from"./agent-icon-V8lPNv7A.js";import{A as fs}from"./access-gate-t5XdpP7o.js";import"./table-B9C_mOX3.js";import"./ArrowUp-U1ggjjLO.js";import"./SearchMd-8jxREbgM.js";import"./LinkBroken01-B1PEGLti.js";import"./infiniteQueryObserver-DozMisCD.js";import"./auth-C364y6MM.js";import"./url-slug-DhfDl2ps.js";import"./User01-CHX0WSlv.js";import"./index-BRHoVQcU.js";import"./AlertCircle--xQnBD7d.js";import"./Tool01-BD6R-D4L.js";import"./ShoppingBag01-C_Zwelnq.js";import"./ZoomOut-BMJlPGPs.js";import"./CheckCircle-drYdikgt.js";import"./ChevronSelectorVertical-DFKb4uq6.js";import"./UserSquare-v2Vi63lF.js";import"./Copy01-D4AqaFnb.js";import"./CreditCard01-BsSJIpnP.js";import"./Image01-iHUacVtP.js";import"./Globe04-CHyEXekU.js";import"./SwitchHorizontal01-f_6gEt2c.js";import"./Key01-CZzgEM3b.js";import"./Link01-CLZO7iiX.js";import"./Monitor01-Cp_HdXFf.js";import"./Sun-VfgIFUUc.js";import"./Play-CFzbBn-6.js";import"./Upload01-CbIQEt1I.js";import"./Users01-WUyPxnjn.js";import"./XClose-Dz5Xu4ap.js";import"./capability-load-error-BCbiiwNK.js";const He="basic-usage",Ze=[{id:He,label:"Basic Usage",description:"Tools all org members can access by default",section:"Basic Usage",tools:["COLLECTION_CONNECTIONS_LIST","COLLECTION_CONNECTIONS_GET","CONNECTION_TEST","CONNECTION_TOOLS_SEARCH","CONNECTION_TOOL_CALL","COLLECTION_VIRTUAL_MCP_LIST","COLLECTION_VIRTUAL_MCP_GET","VIRTUAL_MCP_LAST_USED_LIST","SIDEBAR_GET","SIDEBAR_PREFERENCES_SET","PROJECT_FOLDER_ENSURE","AUTOMATION_GET","AUTOMATION_LIST","AUTOMATION_RUN_STATS","AI_PROVIDERS_LIST","AI_PROVIDERS_LIST_MODELS","AI_PROVIDERS_ACTIVE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_CREDITS","AI_PLAN_ENTITLEMENTS","AI_PLAN_LIST","ORGANIZATION_BILLING_PLAN_PRICES","AI_PROVIDER_TOPUP_URL","LIST_OBJECTS","GET_OBJECT_METADATA","GET_PRESIGNED_URL","PUT_PRESIGNED_URL","FILE_OBJECTS_LIST","ORG_REPO_SYNC_LIST","SANDBOX_START","SANDBOX_DELETE","REPOSITORY_SEARCH_BRANCHES","GIT_PROVIDER_CAPABILITIES","GIT_ACCOUNT_LIST","REPOSITORY_LIST","REPOSITORY_SEARCH","CHANGE_REQUEST_STATE","CHANGE_REQUEST_LAST_MERGED","CHANGE_REQUEST_LIST_OPEN","CHANGE_REQUEST_CHECK_LOG","GLOBAL_SEARCH","ORGANIZATION_SETTINGS_GET","USER_GET","ORGANIZATION_HAS_SITE","ORGANIZATION_BLOCKS_EDITOR_SET","COLLECTION_THREADS_CREATE","COLLECTION_THREADS_LIST","COLLECTION_THREADS_GET","COLLECTION_THREADS_UPDATE","COLLECTION_THREADS_DELETE","COLLECTION_THREAD_MESSAGES_LIST","TASK_BOARD_ITEM_CREATE","TASK_BOARD_ITEM_LIST","TASK_BOARD_ITEM_UPDATE","TASK_BOARD_ITEM_DELETE","TASK_BOARD_PROMPT_LIST","TASK_BOARD_PROMPT_UPSERT","TASK_BOARD_PROMPT_DELETE","TASK_BOARD_ITEM_PRS_GET","TASK_BOARD_PREVIEW_PROBE","TASK_BOARD_ITEM_RERUN","TASK_BOARD_RUN_REVIEWER","TASK_BOARD_REVIEW_DECISION","TASK_BOARD_PROMOTE_TO_PRODUCTION","TASK_BOARD_ACTIVITY_LIST","TASK_BOARD_COMMENT_LIST","TASK_BOARD_COMMENT_CREATE","TASK_BOARD_COMMENT_UPDATE","TASK_BOARD_COMMENT_DELETE","TASK_BOARD_DISMISSED_LIST","TASK_BOARD_DISMISSED_RESTORE","TASK_BOARD_SPRINT_LIST","TASK_BOARD_SPRINT_CREATE","TASK_BOARD_SPRINT_UPDATE","TASK_BOARD_SPRINT_START","TASK_BOARD_SPRINT_COMPLETE","TASK_BOARD_SPRINT_DELETE","TASK_BOARD_ADMIN_ORG_LIST","TASK_BOARD_DELIVERY","TASK_BOARD_OPERATION","TASK_BOARD_OPERATION_TASKS","TASK_BOARD_REWORK","TASK_BOARD_SPRINTS","TASK_BOARD_STUCK","TASK_BOARD_COST","TASK_BOARD_QUALITY","TASK_BOARD_ERRORS","TASK_BOARD_TENANTS","THREAD_ANALYTICS_ORG_LIST","THREAD_ANALYTICS_LIVE","THREAD_ANALYTICS_USAGE","THREAD_ANALYTICS_ERRORS","NOTIFICATION_LIST","NOTIFICATION_MARK_READ","NOTIFICATION_SUBSCRIPTION_SET","NOTIFICATION_SUBSCRIPTION_LIST","generate_image","web_search","deep_research","suggest_task","update_interests"]},{id:"org:manage",label:"Manage organization",description:"Edit organization settings and domain configuration",section:"Organization",tools:["ORGANIZATION_GET","ORGANIZATION_LIST","ORGANIZATION_UPDATE","ORGANIZATION_SETTINGS_GET","ORGANIZATION_SETTINGS_UPDATE","ORGANIZATION_DOMAIN_LIST","ORGANIZATION_DOMAIN_ADD","ORGANIZATION_DOMAIN_UPDATE","ORGANIZATION_DOMAIN_VERIFY","ORGANIZATION_DOMAIN_REMOVE","JIRA_INTEGRATION_GET","JIRA_INTEGRATION_UPSERT","JIRA_INTEGRATION_DELETE","JIRA_BOARDS_LIST","JIRA_BOARD_COLUMNS_LIST","JIRA_AUTOMATION_LIST","JIRA_AUTOMATION_UPSERT","JIRA_RUN_START"]},{id:"members:manage",label:"Manage members",description:"Invite members, remove them, and change their roles",section:"Organization",tools:["ORGANIZATION_MEMBER_LIST","ORGANIZATION_MEMBER_ADD","ORGANIZATION_MEMBER_REMOVE","ORGANIZATION_MEMBER_UPDATE_ROLE","ORGANIZATION_BILLING_CHECKOUT_START","ORGANIZATION_BILLING_PORTAL","ORGANIZATION_TASK_QUOTA_GET","INFRA_BILLING_SITES_LIST","INFRA_BILLING_GET","INFRA_BILLING_PORTAL","ORGANIZATION_JOIN_REQUEST_LIST","ORGANIZATION_JOIN_REQUEST_APPROVE","ORGANIZATION_JOIN_REQUEST_DENY"],dangerous:!0},{id:"connections:manage",label:"Manage connections",description:"Create, update, and delete connections",section:"Connections & Agents",tools:["COLLECTION_CONNECTIONS_CREATE","COLLECTION_CONNECTIONS_UPDATE","COLLECTION_CONNECTIONS_DELETE","REPORTS_SETUP","REPORTS_RUN","REPORTS_BIND","REPORTS_CONNECTION_STATUS","REPORTS_SET_REPOSITORY"],dangerous:!0},{id:"agents:manage",label:"Manage agents",description:"Create, configure, and delete agents",section:"Connections & Agents",tools:["COLLECTION_VIRTUAL_MCP_CREATE","COLLECTION_VIRTUAL_MCP_UPDATE","COLLECTION_VIRTUAL_MCP_DELETE","VIRTUAL_MCP_PINNED_VIEWS_UPDATE","PROJECT_FOLDERS_SET"],dangerous:!0},{id:"automations:manage",label:"Manage automations",description:"Create, update, run, and delete automations",section:"Automations",tools:["AUTOMATION_CREATE","AUTOMATION_UPDATE","AUTOMATION_DELETE","AUTOMATION_TRIGGER_ADD","AUTOMATION_TRIGGER_REMOVE","AUTOMATION_TRIGGER_ROTATE_TOKEN","AUTOMATION_RUN"],dangerous:!0},{id:"monitoring:view",label:"View monitoring",description:"Access logs and usage statistics",section:"Monitoring",tools:["MONITORING_HEATMAP","MONITORING_LOG_GET","MONITORING_LOGS_LIST","MONITORING_STATS","MONITORING_THREAD_USAGE"]},{id:"secrets:manage",label:"Manage secrets",description:"Create and list secrets stored in the credential vault",section:"Organization",tools:["SECRET_CREATE","SECRET_LIST"]},{id:"file-configs:manage",label:"Manage file configs",description:"Create, list, update and delete S3 bucket configurations and synced GitHub repositories",section:"Organization",tools:["FILE_CONFIG_CREATE","FILE_CONFIG_LIST","FILE_CONFIG_UPDATE","FILE_CONFIG_DELETE","FILE_OBJECTS_LIST","FILE_OBJECT_DELETE","ORG_REPO_SYNC_CREATE","ORG_REPO_SYNC_LIST","ORG_REPO_SYNC_UPDATE","ORG_REPO_SYNC_DELETE","ORG_REPO_SYNC_RUN"]},{id:"ai-providers:manage",label:"Manage AI providers",description:"Add or remove API keys and provision provider credentials",section:"AI Providers",tools:["AI_PROVIDER_KEY_CREATE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_KEY_DELETE","AI_PROVIDER_KEY_UPDATE","AI_PROVIDER_KEY_PREVIEW","AI_PROVIDER_OAUTH_URL","AI_PROVIDER_OAUTH_EXCHANGE","AI_PROVIDER_PROVISION_KEY","AI_PROVIDER_TOPUP_URL","AI_PROVIDER_CREDITS","AI_PLAN_ENTITLEMENTS","AI_PLAN_LIST","AI_PLAN_SET","AI_PLAN_INVOICE_UPGRADE","CLAUDE_SUBSCRIPTION_CONNECT","CLAUDE_SUBSCRIPTION_STATUS","CLAUDE_SUBSCRIPTION_DISCONNECT","GITHUB_COPILOT_CONNECT","GITHUB_COPILOT_STATUS","GITHUB_COPILOT_DISCONNECT","GITHUB_COPILOT_SHARE"]},{id:"tags:manage",label:"Manage tags",description:"Create, assign, and delete organization tags",section:"Organization",tools:["TAGS_LIST","TAGS_CREATE","TAGS_DELETE","MEMBER_TAGS_GET","MEMBER_TAGS_SET"]},{id:"experiments:manage",label:"Manage experiments",description:"Create, update, and delete A/B experiments, and view results",section:"Experiments",tools:["EXPERIMENT_LIST","EXPERIMENT_GET","EXPERIMENT_CREATE","EXPERIMENT_SUGGEST","EXPERIMENT_IMPLEMENT","EXPERIMENT_IMPLEMENT_LOCAL","EXPERIMENT_PREVIEW_SYNC_LOCAL","EXPERIMENT_UPDATE","EXPERIMENT_DELETE","EXPERIMENT_RESULTS"],dangerous:!0},{id:"registry:manage",label:"Browse registry",description:"Browse the Deco MCP catalog",section:"Store & Registry",tools:["COLLECTION_REGISTRY_APP_LIST","COLLECTION_REGISTRY_APP_GET","COLLECTION_REGISTRY_APP_VERSIONS","COLLECTION_REGISTRY_APP_FILTERS","REGISTRY_ITEM_LIST","REGISTRY_ITEM_SEARCH","REGISTRY_ITEM_GET","REGISTRY_ITEM_VERSIONS","REGISTRY_ITEM_FILTERS"]},{id:"api-keys:manage",label:"Manage API keys",description:"Create, update, and revoke API keys",section:"Developer",tools:["API_KEY_CREATE","API_KEY_LIST","API_KEY_UPDATE","API_KEY_DELETE"]},{id:"storage:delete",label:"Delete from storage",description:"Permanently delete files from object storage",section:"Developer",tools:["DELETE_OBJECT","DELETE_OBJECTS"],dangerous:!0},{id:"connections:sql",label:"Run SQL queries",description:"Execute raw SQL against connected databases",section:"Developer",tools:["DATABASES_RUN_SQL"],dangerous:!0}];[...Ze.find(t=>t.id===He)?.tools??[]];const gs=["agents:manage","connections:manage"];new Set(Ze.filter(t=>gs.includes(t.id)).flatMap(t=>t.tools));function Ts(){const t=new Map;for(const e of Ze){if(e.id===He)continue;const l=t.get(e.section)??[];l.push(e),t.set(e.section,l)}return Array.from(t.entries()).map(([e,l])=>({section:e,capabilities:l}))}function hs(t,e,l){if(l)return!0;const r=new Set(e);return t.tools.every(n=>r.has(n))}function xs(t,e,l){if(l){const n=new Set(e);for(const o of t.tools)n.add(o);return Array.from(n)}const r=new Set(e);for(const n of t.tools)r.delete(n);return Array.from(r)}const Je="projects",ot="*";function _s(t){if(!t)return null;const e=t[Je];return Array.isArray(e)?e:null}function Es(t){const e=q.c(21),{connection:l,isSelected:r,hasToolsEnabled:n,activeToolsCount:o,totalToolsCount:d,onSelect:f,onToggle:m}=t,c=r?"bg-accent/50":"hover:bg-muted/50";let g;e[0]!==c?(g=J("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",c),e[0]=c,e[1]=g):g=e[1];let u;e[2]!==l.icon||e[3]!==l.title?(u=s.jsx(Qe,{icon:l.icon,name:l.title,size:"xs"}),e[2]=l.icon,e[3]=l.title,e[4]=u):u=e[4];let T;e[5]!==l.title?(T=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:l.title})}),e[5]=l.title,e[6]=T):T=e[6];let x;e[7]!==f||e[8]!==u||e[9]!==T?(x=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:f,children:[u,T]}),e[7]=f,e[8]=u,e[9]=T,e[10]=x):x=e[10];let a;e[11]!==o||e[12]!==l.tools||e[13]!==n||e[14]!==m||e[15]!==d?(a=l.tools&&l.tools.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[o,"/",d]}),s.jsx(Ge,{checked:n,onCheckedChange:m,onClick:ps})]}),e[11]=o,e[12]=l.tools,e[13]=n,e[14]=m,e[15]=d,e[16]=a):a=e[16];let h;return e[17]!==g||e[18]!==x||e[19]!==a?(h=s.jsxs("div",{className:g,children:[x,a]}),e[17]=g,e[18]=x,e[19]=a,e[20]=h):h=e[20],h}function ps(t){return t.stopPropagation()}function As(t){const e=q.c(18),{connectionId:l,tool:r,isSelected:n,onToggle:o}=t,d=`tool-${l}-${r.name}`,f=n?"text-foreground":"text-muted-foreground";let m;e[0]!==f?(m=J("text-sm font-medium",f),e[0]=f,e[1]=m):m=e[1];let c;e[2]!==m||e[3]!==r.name?(c=s.jsx("div",{className:"flex items-center gap-2 mb-1",children:s.jsx("span",{className:m,children:r.name})}),e[2]=m,e[3]=r.name,e[4]=c):c=e[4];let g;e[5]!==r.description?(g=r.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:r.description}),e[5]=r.description,e[6]=g):g=e[6];let u;e[7]!==c||e[8]!==g?(u=s.jsxs("div",{className:"flex-1 min-w-0",children:[c,g]}),e[7]=c,e[8]=g,e[9]=u):u=e[9];const T=`tool-${l}-${r.name}`;let x;e[10]!==n||e[11]!==o||e[12]!==T?(x=s.jsx("div",{className:"flex items-center shrink-0",children:s.jsx(Ge,{id:T,checked:n,onCheckedChange:o,onClick:Is})}),e[10]=n,e[11]=o,e[12]=T,e[13]=x):x=e[13];let a;return e[14]!==d||e[15]!==u||e[16]!==x?(a=s.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:d,children:[u,x]}),e[14]=d,e[15]=u,e[16]=x,e[17]=a):a=e[17],a}function Is(t){return t.stopPropagation()}function Ss({toolSet:t,onToolSetChange:e,excludeVirtualMcpId:l,searchQuery:r}){const n=oe(),[o,d]=Y.useState(""),f=r!==void 0?r:o,m=Y.useDeferredValue(f),[c,g]=Y.useState("all"),[u,T]=Y.useState(!1),x=Y.useRef(new Set(Object.keys(t))),{org:a}=ke(),h=es({connectionId:jt,orgId:a.id,orgSlug:a.slug}),S=100,p=m.trim(),A=p?{operator:"or",conditions:[{field:["title"],operator:"contains",value:p},{field:["description"],operator:"contains",value:p}]}:void 0,b=!!l,N={...A&&{where:A},orderBy:[{field:["updated_at"],direction:"asc"}],limit:S,offset:0,...b&&{include_virtual:!0}},P=JSON.stringify(N),{data:R,fetchNextPage:j,hasNextPage:D,isFetchingNextPage:_}=Xt({queryKey:me.collectionListInfinite(h,a.id,"","CONNECTIONS",P),queryFn:async({pageParam:E=0})=>(await h.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...A&&{where:A},orderBy:[{field:["updated_at"],direction:"asc"}],limit:S,offset:E,...b&&{include_virtual:!0}}})).structuredContent,initialPageParam:0,getNextPageParam:(E,G)=>{if(E?.hasMore)return G.reduce((H,Z)=>H+(Z?.items?.length??0),0)},staleTime:3e4}),C=R?.pages.flatMap(E=>E?.items??[])??[],O=qt(j,D??!1,_),i=l?C.filter(E=>E.connection_type!=="VIRTUAL"?!0:ss(E.connection_url)!==l):C,I=x.current,k=[...I.values()].map(E=>i.find(G=>G.id===E)).filter(E=>E!==void 0),w=i.filter(E=>!I.has(E.id)),V=[...k,...w],L=E=>{const G=t[E];return G!==void 0&&G.length>0},z=V.filter(E=>{if(c==="all")return!0;const G=L(E.id);return c==="selected"?G:c==="unselected"?!G:!0}),[y,F]=Y.useState(V[0]?.id??null),K=y?V.find(E=>E.id===y)??null:null,{data:B,isFetching:U}=ze({...Pt(a.id,"CONNECTIONS",y??void 0,h),enabled:!!y}),Q=B?.item?.tools??[],W=(E,G)=>t[E]?.includes(G)??!1,te=(E,G)=>{const H=t[E]??[],Z=H.includes(G),le={...t};if(Z){const ie=H.filter(ce=>ce!==G);ie.length===0?delete le[E]:le[E]=ie}else le[E]=[...H,G];e(le)},se=E=>{if((t[E]??[]).length>0){const Z={...t};delete Z[E],e(Z);return}const H=E===y?Q:[];if(!H.length){F(E);return}e({...t,[E]:H.map(Z=>Z.name)})},$=E=>{F(E),T(!0)},X=()=>{T(!1)};return s.jsxs("div",{className:"flex h-full",children:[s.jsxs("div",{className:J("w-full md:w-80 border-r border-border flex flex-col",u&&"hidden md:flex"),children:[r===void 0&&s.jsx(ts,{value:o,onChange:d,placeholder:n("common.toolSetSelector.searchPlaceholder")}),s.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[s.jsx("button",{type:"button",onClick:()=>g("all"),className:J("flex-1 px-3 py-1.5 text-xs font-medium rounded-lg transition-colors border cursor-pointer",c==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:n("common.toolSetSelector.filterAll")}),s.jsx("button",{type:"button",onClick:()=>g("selected"),className:J("flex-1 px-3 py-1.5 text-xs font-medium rounded-lg transition-colors border cursor-pointer",c==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:n("common.toolSetSelector.filterSelected")}),s.jsx("button",{type:"button",onClick:()=>g("unselected"),className:J("flex-1 px-3 py-1.5 text-xs font-medium rounded-lg transition-colors border cursor-pointer",c==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:n("common.toolSetSelector.filterUnselected")})]}),s.jsx("div",{className:"flex-1 overflow-auto",children:z.length===0?s.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:n(f?"common.toolSetSelector.noConnectionsFound":c==="selected"?"common.toolSetSelector.noServersSelected":c==="unselected"?"common.toolSetSelector.noUnselectedServers":"common.toolSetSelector.noConnectionsAvailable")}):s.jsxs("div",{className:"p-2 space-y-1",children:[z.map(E=>{const G=y===E.id,H=G?Q.length:0,Z=t[E.id]?.length??0;return s.jsx(Es,{connection:{...E,tools:G?Q:E.tools},isSelected:G,hasToolsEnabled:L(E.id),activeToolsCount:Z,totalToolsCount:H,onSelect:()=>$(E.id),onToggle:()=>se(E.id)},E.id)}),s.jsx("div",{ref:O,className:"h-4"}),_&&s.jsx("div",{className:"flex justify-center py-3",children:s.jsx(ue,{className:"size-4.5 text-muted-foreground"})})]})})]}),s.jsx("div",{className:J("flex-1 flex-col",u?"flex":"hidden md:flex"),children:K?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"md:hidden border-b border-border p-4 flex items-center gap-3",children:[s.jsx(ae,{variant:"ghost",size:"sm",onClick:X,className:"h-8 w-8 p-0 shrink-0",children:s.jsx(Wt,{size:20})}),s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[s.jsx(Qe,{icon:K.icon,name:K.title,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:K.title}),K.description&&s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:K.description})]})]})]}),s.jsx("div",{className:"flex-1 overflow-auto p-4",children:U?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(ue,{className:"size-4.5 text-muted-foreground"})}):Q.length===0?s.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:n("common.toolSetSelector.noToolsAvailable")}):s.jsx("div",{className:"space-y-2",children:Q.map(E=>s.jsx(As,{connectionId:K.id,tool:E,isSelected:W(K.id,E.name),onToggle:()=>te(K.id,E.name)},E.name))})})]}):s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx("div",{className:"text-sm text-muted-foreground text-center",children:n("common.toolSetSelector.selectConnection")})})})]})}const Rs=qe({role:qe({id:ne().optional(),slug:ne().optional(),label:ne()}),allowAllStaticPermissions:Ke(),staticPermissions:Me(ne()),toolSet:We(ne(),Me(ne())),allowAllModels:Ke(),modelSet:We(ne(),Me(ne())),allowAllProjects:Ke(),projectSet:Me(ne()),memberIds:Me(ne())});function nt(t,e,l,r){const n=s.jsx(fe,{checked:e,disabled:l,onCheckedChange:r});return l?s.jsx(be,{children:s.jsxs(je,{children:[s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:n})}),s.jsx(De,{children:s.jsx("p",{children:t("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):n}function Ns(t){const e=q.c(41),{allowAllStaticPermissions:l,staticPermissions:r,onAllowAllChange:n,onPermissionsChange:o,readOnly:d,searchQuery:f}=t,m=d===void 0?!1:d,c=oe();let g;e[0]!==f?(g=f.trim().toLowerCase(),e[0]=f,e[1]=g):g=e[1];const u=Y.useDeferredValue(g);let T;if(e[2]!==l||e[3]!==u||e[4]!==n||e[5]!==o||e[6]!==m||e[7]!==f||e[8]!==r||e[9]!==c){const x=Ts(),a=(_,C)=>{if(!m){if(l&&C){const O=x.flatMap(bs).flatMap(Cs);n(!1),o(O.filter(i=>!_.tools.includes(i)));return}l||o(xs(_,r,!C))}};let h;e[11]!==u?(h=_=>{const{section:C,capabilities:O}=_;return{section:C,capabilities:O.filter(i=>!u||i.label.toLowerCase().includes(u)||i.description.toLowerCase().includes(u))}},e[11]=u,e[12]=h):h=e[12];const S=x.map(h).filter(Os);let p;e[13]!==c?(p=c("settings.orgRoleDetail.general"),e[13]=c,e[14]=p):p=e[14];let A;e[15]!==c?(A=c("settings.orgRoleDetail.allOrgPermissions"),e[15]=c,e[16]=A):A=e[16];let b;e[17]!==c?(b=c("settings.orgRoleDetail.grantFullAccessToAllFeaturesBelow"),e[17]=c,e[18]=b):b=e[18];let N;e[19]!==l||e[20]!==n||e[21]!==o?(N=()=>{n(!l),o([])},e[19]=l,e[20]=n,e[21]=o,e[22]=N):N=e[22];let P;e[23]!==l||e[24]!==m||e[25]!==c||e[26]!==N?(P=nt(c,l,m,N),e[23]=l,e[24]=m,e[25]=c,e[26]=N,e[27]=P):P=e[27];let R;e[28]!==l||e[29]!==n||e[30]!==o||e[31]!==m?(R=m?void 0:()=>{n(!l),o([])},e[28]=l,e[29]=n,e[30]=o,e[31]=m,e[32]=R):R=e[32];let j;e[33]!==R||e[34]!==A||e[35]!==b||e[36]!==P?(j=s.jsx(et,{children:s.jsx(tt,{title:A,description:b,action:P,onClick:R})}),e[33]=R,e[34]=A,e[35]=b,e[36]=P,e[37]=j):j=e[37];let D;e[38]!==j||e[39]!==p?(D=s.jsx(Xe,{title:p,children:j}),e[38]=j,e[39]=p,e[40]=D):D=e[40],T=s.jsx("div",{children:s.jsxs("div",{className:"flex flex-col gap-10 py-4",children:[D,S.length===0&&u?s.jsx("p",{className:"text-sm text-muted-foreground py-4",children:c("settings.orgRoleDetail.noPermissionsMatch",{searchQuery:f})}):S.map(_=>{const{section:C,capabilities:O}=_;return s.jsx(Xe,{title:C,children:s.jsx(et,{children:O.map(i=>{const I=hs(i,r,l);return s.jsx(tt,{title:s.jsxs("span",{className:"flex items-center gap-1.5",children:[i.label,i.dangerous&&s.jsx(wt,{size:12,className:"text-warning shrink-0"})]}),description:i.description,action:nt(c,I,m,()=>a(i,I)),onClick:m?void 0:()=>a(i,I)},i.id)})})},C)})]})}),e[2]=l,e[3]=u,e[4]=n,e[5]=o,e[6]=m,e[7]=f,e[8]=r,e[9]=c,e[10]=T}else T=e[10];return T}function Os(t){return t.capabilities.length>0}function Cs(t){return t.tools}function bs(t){return t.capabilities}const Nt={anthropic:"Anthropic",openrouter:"OpenRouter"},js={openai:"OpenAI",anthropic:"Anthropic",google:"Google","meta-llama":"Meta",mistralai:"Mistral","x-ai":"xAI",deepseek:"DeepSeek",qwen:"Qwen",moonshotai:"MoonshotAI",nvidia:"NVIDIA",perplexity:"Perplexity",cohere:"Cohere",amazon:"Amazon",microsoft:"Microsoft","z-ai":"Z.ai","ibm-granite":"IBM Granite",alibaba:"Alibaba",baidu:"Baidu",bytedance:"ByteDance",tencent:"Tencent",minimax:"MiniMax",nousresearch:"Nous Research",allenai:"Allen AI",inception:"Inception"};function Ps(t,e){const l=t.indexOf("/"),r=l>0?t.slice(0,l):e;return r.startsWith("~")?r.slice(1):r}function Ds(t){return js[t]??Nt[t]??t}function Ms(t){const e=t.indexOf(": ");return e>0&&e<32?t.slice(e+2):t}const Ot=30;function Ls(t){const e=q.c(40),{connectionId:l,subProviderId:r,subProviderName:n,groupLogo:o,models:d,allConnectionModelIds:f,selectedModels:m,allowAllModels:c,allConnectionModelsSelected:g,onToggleModel:u,onExitAllowAll:T,readOnly:x,defaultExpanded:a}=t,h=oe(),[S,p]=Y.useState(a),A=a||S,b=p,[N,P]=Y.useState(Ot);let R;e[0]!==g||e[1]!==c||e[2]!==m?(R=_=>c||g||m.includes("*")||m.includes(_),e[0]=g,e[1]=c,e[2]=m,e[3]=R):R=e[3];const j=R;let D;if(e[4]!==f||e[5]!==c||e[6]!==l||e[7]!==A||e[8]!==o||e[9]!==j||e[10]!==d||e[11]!==T||e[12]!==u||e[13]!==x||e[14]!==r||e[15]!==n||e[16]!==h||e[17]!==N){let _;e[19]!==j?(_=U=>j(U.id),e[19]=j,e[20]=_):_=e[20];const C=d.filter(_).length,O=d.slice(0,N),i=d.length>N;let I;e[21]===Symbol.for("react.memo_cache_sentinel")?(I=()=>b(ks),e[21]=I):I=e[21];const k=o??pt[r]??At;let w;e[22]!==n||e[23]!==k?(w=s.jsx(Qe,{icon:k,name:n,size:"sm"}),e[22]=n,e[23]=k,e[24]=w):w=e[24];let V;e[25]!==n?(V=s.jsx("span",{className:"text-sm font-medium truncate",children:n}),e[25]=n,e[26]=V):V=e[26];let L;e[27]!==w||e[28]!==V?(L=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[w,V]}),e[27]=w,e[28]=V,e[29]=L):L=e[29];const z=h("settings.orgRoleDetail.enabledCount",{enabledCount:C,total:d.length});let y;e[30]!==z?(y=s.jsx(ve,{variant:"secondary",className:"text-xs text-muted-foreground",children:z}),e[30]=z,e[31]=y):y=e[31];let F;e[32]!==A?(F=A?s.jsx(ds,{size:16,className:"text-muted-foreground shrink-0"}):s.jsx(kt,{size:16,className:"text-muted-foreground shrink-0"}),e[32]=A,e[33]=F):F=e[33];let K;e[34]!==y||e[35]!==F?(K=s.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[y,F]}),e[34]=y,e[35]=F,e[36]=K):K=e[36];let B;e[37]!==K||e[38]!==L?(B=s.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3 hover:bg-muted/50 cursor-pointer",onClick:I,children:[L,K]}),e[37]=K,e[38]=L,e[39]=B):B=e[39],D=s.jsxs("div",{className:"border border-border rounded-lg overflow-hidden bg-card",children:[B,A&&s.jsxs("div",{className:"border-t border-border bg-muted/20",children:[O.map(U=>{const Q=j(U.id),W=()=>{if(!x){if(c){T(l,f,U.id);return}u(l,U.id)}};return s.jsxs("div",{className:J("flex items-center justify-between gap-3 px-4 py-3 border-b border-border last:border-b-0",!x&&"hover:bg-muted/50 cursor-pointer"),onClick:W,children:[s.jsx("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:s.jsx("span",{className:"text-sm truncate",children:U.title})}),s.jsx("div",{onClick:ws,children:x?s.jsx(be,{children:s.jsxs(je,{children:[s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:s.jsx(fe,{checked:Q,disabled:!0,onCheckedChange:ys})})}),s.jsx(De,{children:s.jsx("p",{children:h("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):s.jsx(fe,{checked:Q,onCheckedChange:W})})]},U.id)}),i&&s.jsx("button",{type:"button",className:"w-full px-4 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors",onClick:()=>P(vs),children:h("settings.orgRoleDetail.showMore",{remaining:d.length-N})})]})]}),e[4]=f,e[5]=c,e[6]=l,e[7]=A,e[8]=o,e[9]=j,e[10]=d,e[11]=T,e[12]=u,e[13]=x,e[14]=r,e[15]=n,e[16]=h,e[17]=N,e[18]=D}else D=e[18];return D}function vs(t){return t+Ot}function ys(){}function ws(t){return t.stopPropagation()}function ks(t){return!t}function Gs(t){const e=q.c(33),{connection:l,selectedModels:r,allowAllModels:n,onToggleModel:o,onExitAllowAll:d,allConnectionModelsSelected:f,searchQuery:m,readOnly:c}=t,g=is(l.id);let u,T,x,a,h;if(e[0]!==f||e[1]!==n||e[2]!==l.id||e[3]!==l.label||e[4]!==l.providerId||e[5]!==d||e[6]!==o||e[7]!==g||e[8]!==c||e[9]!==m||e[10]!==r){h=Symbol.for("react.early_return_sentinel");e:{let A;e[16]!==l.label?(A=I=>({...I,id:I.modelId,provider:l.label}),e[16]=l.label,e[17]=A):A=e[17];const b=g.filter(Vs).map(A),N=m.trim().toLowerCase(),P=N?b.filter(I=>I.title.toLowerCase().includes(N)||I.id.toLowerCase().includes(N)||I.provider?.toLowerCase().includes(N)):b;if(P.length===0){h=null;break e}const R=new Map;for(const I of P){const k=Ps(I.id,l.providerId),w=R.get(k)??{models:[],logo:null};w.models.push({id:I.id,title:Ms(I.title),logo:I.logo}),!w.logo&&I.logo&&(w.logo=I.logo),R.set(k,w)}const j=Array.from(R.entries()).map(Ks).sort(Us),D=j.length===1||N.length>0;x="flex flex-col gap-3";const _=pt[l.providerId]??At;let C;e[18]!==l.providerId||e[19]!==_?(C=s.jsx("img",{src:_,alt:l.providerId,className:"w-4 h-4 rounded-sm dark:bg-white dark:rounded-sm dark:p-px"}),e[18]=l.providerId,e[19]=_,e[20]=C):C=e[20];const O=Nt[l.providerId]??l.providerId;let i;e[21]!==O?(i=s.jsx("h4",{className:"text-sm font-medium",children:O}),e[21]=O,e[22]=i):i=e[22],e[23]!==i||e[24]!==C?(a=s.jsxs("div",{className:"flex items-center gap-2",children:[C,i]}),e[23]=i,e[24]=C,e[25]=a):a=e[25],u="flex flex-col gap-3",T=j.map(I=>s.jsx(Ls,{connectionId:l.id,subProviderId:I.id,subProviderName:I.name,groupLogo:I.logo,models:I.models,allConnectionModelIds:b.map(Bs),selectedModels:r,allowAllModels:n,allConnectionModelsSelected:f,onToggleModel:o,onExitAllowAll:d,readOnly:c,defaultExpanded:D},I.id))}e[0]=f,e[1]=n,e[2]=l.id,e[3]=l.label,e[4]=l.providerId,e[5]=d,e[6]=o,e[7]=g,e[8]=c,e[9]=m,e[10]=r,e[11]=u,e[12]=T,e[13]=x,e[14]=a,e[15]=h}else u=e[11],T=e[12],x=e[13],a=e[14],h=e[15];if(h!==Symbol.for("react.early_return_sentinel"))return h;let S;e[26]!==u||e[27]!==T?(S=s.jsx("div",{className:u,children:T}),e[26]=u,e[27]=T,e[28]=S):S=e[28];let p;return e[29]!==x||e[30]!==a||e[31]!==S?(p=s.jsxs("div",{className:x,children:[a,S]}),e[29]=x,e[30]=a,e[31]=S,e[32]=p):p=e[32],p}function Bs(t){return t.id}function Us(t,e){return t.name.localeCompare(e.name)}function Ks(t){const[e,l]=t;return{id:e,name:Ds(e),logo:l.logo,models:l.models}}function Vs(t,e,l){return l.findIndex(r=>r.modelId===t.modelId)===e}function zs(t){const e=q.c(41),{allowAllModels:l,modelSet:r,onAllowAllChange:n,onModelSetChange:o,readOnly:d,searchQuery:f}=t,m=d===void 0?!1:d,c=oe(),g=Y.useDeferredValue(f),u=ns();let T;e[0]!==r||e[1]!==o?(T=(_,C)=>{const O=r[_]??[],i={...r};if(O.includes(C)){const I=O.filter(k=>k!==C);I.length===0?delete i[_]:i[_]=I}else i[_]=[...O,C];o(i)},e[0]=r,e[1]=o,e[2]=T):T=e[2];const x=T;let a;e[3]!==r||e[4]!==n||e[5]!==o?(a=(_,C,O)=>{n(!1),o({...r,[_]:C.filter(i=>i!==O)})},e[3]=r,e[4]=n,e[5]=o,e[6]=a):a=e[6];const h=a,S=!m&&"hover:bg-muted/50 cursor-pointer";let p;e[7]!==S?(p=J("flex items-center justify-between px-4 py-3 rounded-lg border border-border bg-card",S),e[7]=S,e[8]=p):p=e[8];let A;e[9]!==l||e[10]!==n||e[11]!==o||e[12]!==m?(A=()=>{if(m)return;const _=!l;n(_),_&&o({})},e[9]=l,e[10]=n,e[11]=o,e[12]=m,e[13]=A):A=e[13];let b;e[14]!==c?(b=c("settings.orgRoleDetail.allModels"),e[14]=c,e[15]=b):b=e[15];let N;e[16]!==b?(N=s.jsx("span",{className:"text-sm font-medium",children:b}),e[16]=b,e[17]=N):N=e[17];let P;e[18]!==l||e[19]!==n||e[20]!==o||e[21]!==m||e[22]!==c?(P=s.jsx("div",{onClick:Ys,children:m?s.jsx(be,{children:s.jsxs(je,{children:[s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:s.jsx(fe,{checked:l,disabled:!0,onCheckedChange:Fs})})}),s.jsx(De,{children:s.jsx("p",{children:c("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):s.jsx(fe,{checked:l,onCheckedChange:_=>{n(_),_&&o({})}})}),e[18]=l,e[19]=n,e[20]=o,e[21]=m,e[22]=c,e[23]=P):P=e[23];let R;e[24]!==p||e[25]!==A||e[26]!==N||e[27]!==P?(R=s.jsxs("div",{className:p,onClick:A,children:[N,P]}),e[24]=p,e[25]=A,e[26]=N,e[27]=P,e[28]=R):R=e[28];let j;e[29]!==u||e[30]!==l||e[31]!==g||e[32]!==h||e[33]!==r||e[34]!==m||e[35]!==c||e[36]!==x?(j=u.length===0?s.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:c("settings.orgRoleDetail.noLlmConnectionsConfigured")}):u.map(_=>s.jsx(Y.Suspense,{fallback:s.jsxs("div",{className:"px-4 py-3 flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(ue,{className:"size-4"}),c("settings.orgRoleDetail.loadingModels")]}),children:s.jsx(Gs,{connection:_,selectedModels:r[_.id]??[],allowAllModels:l,onToggleModel:x,onExitAllowAll:h,allConnectionModelsSelected:(r[_.id]??[]).includes("*"),searchQuery:g,readOnly:m})},_.id)),e[29]=u,e[30]=l,e[31]=g,e[32]=h,e[33]=r,e[34]=m,e[35]=c,e[36]=x,e[37]=j):j=e[37];let D;return e[38]!==R||e[39]!==j?(D=s.jsxs("div",{className:"flex flex-col h-full overflow-auto gap-6 pb-6",children:[R,j]}),e[38]=R,e[39]=j,e[40]=D):D=e[40],D}function Fs(){}function Ys(t){return t.stopPropagation()}function $s(t){const e=q.c(39),{allowAllProjects:l,projectSet:r,onAllowAllChange:n,onProjectSetChange:o,readOnly:d,searchQuery:f}=t,m=d===void 0?!1:d,c=oe(),g=Y.useDeferredValue(f),u=os();let T;if(e[0]!==l||e[1]!==g||e[2]!==n||e[3]!==o||e[4]!==r||e[5]!==m||e[6]!==f||e[7]!==c||e[8]!==u){const x=as(u),a=g.trim().toLowerCase(),h=a?x.filter(O=>O.title.toLowerCase().includes(a)):x,S=O=>{if(l){n(!1),o(x.map(Zs).filter(i=>i!==O));return}r.includes(O)?o(r.filter(i=>i!==O)):o([...r,O])},p=!m&&"hover:bg-muted/50 cursor-pointer";let A;e[10]!==p?(A=J("flex items-center justify-between px-4 py-3 rounded-lg border border-border bg-card",p),e[10]=p,e[11]=A):A=e[11];let b;e[12]!==l||e[13]!==n||e[14]!==o||e[15]!==m?(b=()=>{if(m)return;const O=!l;n(O),O&&o([])},e[12]=l,e[13]=n,e[14]=o,e[15]=m,e[16]=b):b=e[16];let N;e[17]!==c?(N=c("settings.orgRoleDetail.allProjects"),e[17]=c,e[18]=N):N=e[18];let P;e[19]!==N?(P=s.jsx("span",{className:"text-sm font-medium",children:N}),e[19]=N,e[20]=P):P=e[20];let R;e[21]!==c?(R=c("settings.orgRoleDetail.allProjectsDescription"),e[21]=c,e[22]=R):R=e[22];let j;e[23]!==R?(j=s.jsx("span",{className:"text-xs text-muted-foreground",children:R}),e[23]=R,e[24]=j):j=e[24];let D;e[25]!==P||e[26]!==j?(D=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[P,j]}),e[25]=P,e[26]=j,e[27]=D):D=e[27];let _;e[28]!==l||e[29]!==n||e[30]!==o||e[31]!==m||e[32]!==c?(_=s.jsx("div",{onClick:Hs,children:m?s.jsx(be,{children:s.jsxs(je,{children:[s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:s.jsx(fe,{checked:l,disabled:!0,onCheckedChange:Qs})})}),s.jsx(De,{children:s.jsx("p",{children:c("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):s.jsx(fe,{checked:l,onCheckedChange:O=>{n(O),O&&o([])}})}),e[28]=l,e[29]=n,e[30]=o,e[31]=m,e[32]=c,e[33]=_):_=e[33];let C;e[34]!==D||e[35]!==_||e[36]!==A||e[37]!==b?(C=s.jsxs("div",{className:A,onClick:b,children:[D,_]}),e[34]=D,e[35]=_,e[36]=A,e[37]=b,e[38]=C):C=e[38],T=s.jsxs("div",{className:"flex flex-col h-full overflow-auto gap-6 p-4",children:[C,x.length===0?s.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:c("settings.orgRoleDetail.noProjectsAvailable")}):h.length===0?s.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:c("settings.orgRoleDetail.noProjectsMatch",{searchQuery:f})}):s.jsx("div",{className:"flex flex-col gap-1",children:h.map(O=>{const i=l||r.includes(O.id);return s.jsxs("label",{className:J("flex items-center gap-3 px-3 py-2 rounded-lg border border-transparent",m?"cursor-default":"hover:bg-muted/50 cursor-pointer"),children:[s.jsx(Ge,{checked:i,disabled:m,onCheckedChange:()=>{m||S(O.id)}}),s.jsx(rs,{icon:O.icon,name:O.title}),s.jsx("span",{className:"text-sm truncate",children:O.title})]},O.id)})})]}),e[0]=l,e[1]=g,e[2]=n,e[3]=o,e[4]=r,e[5]=m,e[6]=f,e[7]=c,e[8]=u,e[9]=T}else T=e[9];return T}function Qs(){}function Hs(t){return t.stopPropagation()}function Zs(t){return t.id}function Js(t){const e=q.c(75),{open:l,onOpenChange:r,selectedMemberIds:n,onAddMembers:o}=t,d=oe(),[f,m]=Y.useState(""),c=Y.useDeferredValue(f);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=[],e[0]=g):g=e[0];const[u,T]=Y.useState(g),{data:x}=It();let a,h,S,p,A,b,N,P,R,j,D;if(e[1]!==x?.data?.members||e[2]!==c||e[3]!==o||e[4]!==r||e[5]!==l||e[6]!==u||e[7]!==f||e[8]!==n||e[9]!==d){const y=x?.data?.members??[];let F;e[21]!==c?(F=$=>{const X=c.toLowerCase();return $.user?.name?.toLowerCase().includes(X)||$.user?.email?.toLowerCase().includes(X)},e[21]=c,e[22]=F):F=e[22];const K=y.filter(F);let B;e[23]!==o||e[24]!==r||e[25]!==u?(B=()=>{o(u),T([]),r(!1)},e[23]=o,e[24]=r,e[25]=u,e[26]=B):B=e[26],S=B,h=ut,j=l,D=r,a=ft,P="sm:max-w-md p-0";let U;e[27]!==d?(U=d("settings.orgRoleDetail.addMembersToRole"),e[27]=d,e[28]=U):U=e[28];let Q;e[29]!==U?(Q=s.jsx(gt,{children:U}),e[29]=U,e[30]=Q):Q=e[30];let W;e[31]!==d?(W=d("settings.orgRoleDetail.selectMembersToAddToThisRole"),e[31]=d,e[32]=W):W=e[32];let te;e[33]!==W?(te=s.jsx(Tt,{children:W}),e[33]=W,e[34]=te):te=e[34],e[35]!==Q||e[36]!==te?(R=s.jsxs(ht,{className:"px-6 pt-6",children:[Q,te]}),e[35]=Q,e[36]=te,e[37]=R):R=e[37],b="flex flex-col h-80";let se;e[38]!==d?(se=d("settings.orgRoleDetail.searchMembers"),e[38]=d,e[39]=se):se=e[39],e[40]!==f||e[41]!==se?(N=s.jsx("div",{className:"border-b border-border px-4 py-3",children:s.jsx($e,{value:f,onChange:m,placeholder:se,className:"w-full"})}),e[40]=f,e[41]=se,e[42]=N):N=e[42],p="flex-1 overflow-auto",A=K.length===0?s.jsx("div",{className:"flex items-center justify-center h-full px-6",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:d(f?"settings.orgRoleDetail.noMembersFound":"settings.orgRoleDetail.noMembersAvailable")})}):s.jsx("div",{className:"px-6 py-2 space-y-1",children:K.map($=>{const X=$.role!=="owner",E=n.includes($.id),G=u.includes($.id);return s.jsxs("label",{className:J("flex items-center gap-3 p-2 rounded-lg",!X||E?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-muted/50"),children:[s.jsx(Ge,{checked:G||E,onCheckedChange:()=>{!X||E||T(H=>H.includes($.id)?H.filter(Z=>Z!==$.id):[...H,$.id])},disabled:!X||E}),s.jsx(Rt,{url:$.user?.image??void 0,fallback:St($.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:$.user?.name||d("settings.orgRoleDetail.unknown")}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:$.user?.email})]}),!X&&s.jsx(ve,{variant:"secondary",className:"shrink-0",children:d("settings.orgRoleDetail.owner")}),E&&X&&s.jsx(ve,{variant:"outline",className:"shrink-0",children:d("settings.orgRoleDetail.added")})]},$.id)})}),e[1]=x?.data?.members,e[2]=c,e[3]=o,e[4]=r,e[5]=l,e[6]=u,e[7]=f,e[8]=n,e[9]=d,e[10]=a,e[11]=h,e[12]=S,e[13]=p,e[14]=A,e[15]=b,e[16]=N,e[17]=P,e[18]=R,e[19]=j,e[20]=D}else a=e[10],h=e[11],S=e[12],p=e[13],A=e[14],b=e[15],N=e[16],P=e[17],R=e[18],j=e[19],D=e[20];let _;e[43]!==p||e[44]!==A?(_=s.jsx("div",{className:p,children:A}),e[43]=p,e[44]=A,e[45]=_):_=e[45];let C;e[46]!==_||e[47]!==b||e[48]!==N?(C=s.jsxs("div",{className:b,children:[N,_]}),e[46]=_,e[47]=b,e[48]=N,e[49]=C):C=e[49];let O;e[50]!==d?(O=d("settings.orgRoleDetail.cancel"),e[50]=d,e[51]=O):O=e[51];let i;e[52]!==O?(i=s.jsx(xt,{children:O}),e[52]=O,e[53]=i):i=e[53];const I=u.length===0;let k;e[54]!==u.length||e[55]!==d?(k=d("settings.orgRoleDetail.addWithCount",{count:u.length}),e[54]=u.length,e[55]=d,e[56]=k):k=e[56];let w;e[57]!==S||e[58]!==I||e[59]!==k?(w=s.jsx(_t,{onClick:S,disabled:I,children:k}),e[57]=S,e[58]=I,e[59]=k,e[60]=w):w=e[60];let V;e[61]!==i||e[62]!==w?(V=s.jsxs(Et,{className:"px-6 pb-6",children:[i,w]}),e[61]=i,e[62]=w,e[63]=V):V=e[63];let L;e[64]!==a||e[65]!==C||e[66]!==V||e[67]!==P||e[68]!==R?(L=s.jsxs(a,{className:P,children:[R,C,V]}),e[64]=a,e[65]=C,e[66]=V,e[67]=P,e[68]=R,e[69]=L):L=e[69];let z;return e[70]!==h||e[71]!==L||e[72]!==j||e[73]!==D?(z=s.jsx(h,{open:j,onOpenChange:D,children:L}),e[70]=h,e[71]=L,e[72]=j,e[73]=D,e[74]=z):z=e[74],z}function qs(t){const e=q.c(33),{memberIds:l,onMemberIdsChange:r,readOnly:n,readOnlyMessage:o,searchQuery:d,addMemberDialogOpen:f,onAddMemberDialogOpenChange:m}=t,c=n===void 0?!1:n,g=o===void 0?void 0:o,u=oe(),T=Y.useDeferredValue(d),{data:x}=It();let a,h,S;if(e[0]!==x?.data?.members||e[1]!==T||e[2]!==l||e[3]!==r||e[4]!==c||e[5]!==g||e[6]!==d||e[7]!==u){const P=x?.data?.members??[];let R;e[11]!==l?(R=i=>l.includes(i.id),e[11]=l,e[12]=R):R=e[12];const j=P.filter(R);let D;e[13]!==T?(D=i=>{const I=T.toLowerCase();return i.user?.name?.toLowerCase().includes(I)||i.user?.email?.toLowerCase().includes(I)},e[13]=T,e[14]=D):D=e[14];const _=j.filter(D);let C;e[15]!==g||e[16]!==u?(C=g??u("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),e[15]=g,e[16]=u,e[17]=C):C=e[17];const O=C;S="flex flex-col h-full",a="flex-1 overflow-auto",h=j.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h3",{className:"text-base font-medium mb-1",children:u("settings.orgRoleDetail.noMembers")}),s.jsx("p",{className:"text-sm text-muted-foreground",children:u("settings.orgRoleDetail.addMembersToGrantPermissions")})]})}):_.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:u("settings.orgRoleDetail.noMembersMatch",{searchQuery:d})})}):s.jsx("div",{className:"p-4 space-y-2",children:_.map(i=>s.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30",children:[s.jsx(Rt,{url:i.user?.image??void 0,fallback:St(i.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:i.user?.name||u("settings.orgRoleDetail.unknown")}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:i.user?.email})]}),c?s.jsx(be,{children:s.jsxs(je,{children:[s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:s.jsx(ae,{variant:"ghost",size:"sm",disabled:!0,"aria-label":u("settings.orgRoleDetail.removeMember",{name:i.user?.name||u("settings.orgRoleDetail.unknown")}),children:s.jsx(st,{size:16})})})}),s.jsx(De,{children:s.jsx("p",{children:O})})]})}):s.jsx(ae,{variant:"ghost",size:"sm","aria-label":u("settings.orgRoleDetail.removeMember",{name:i.user?.name||u("settings.orgRoleDetail.unknown")}),onClick:()=>r(l.filter(I=>I!==i.id)),children:s.jsx(st,{size:16})})]},i.id))}),e[0]=x?.data?.members,e[1]=T,e[2]=l,e[3]=r,e[4]=c,e[5]=g,e[6]=d,e[7]=u,e[8]=a,e[9]=h,e[10]=S}else a=e[8],h=e[9],S=e[10];let p;e[18]!==a||e[19]!==h?(p=s.jsx("div",{className:a,children:h}),e[18]=a,e[19]=h,e[20]=p):p=e[20];let A;e[21]!==l||e[22]!==r?(A=P=>r([...l,...P]),e[21]=l,e[22]=r,e[23]=A):A=e[23];let b;e[24]!==f||e[25]!==l||e[26]!==m||e[27]!==A?(b=s.jsx(Js,{open:f,onOpenChange:m,selectedMemberIds:l,onAddMembers:A}),e[24]=f,e[25]=l,e[26]=m,e[27]=A,e[28]=b):b=e[28];let N;return e[29]!==S||e[30]!==p||e[31]!==b?(N=s.jsxs("div",{className:S,children:[p,b]}),e[29]=S,e[30]=p,e[31]=b,e[32]=N):N=e[32],N}function Ws(t){const e=q.c(3);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(ue,{className:"size-6 text-muted-foreground"})}),e[0]=l):l=e[0];let r;return e[1]!==t?(r=s.jsx(Y.Suspense,{fallback:l,children:s.jsx(qs,{...t})}),e[1]=t,e[2]=r):r=e[2],r}const Xs={owner:[],admin:[],user:[]};function el(t,e,l,r){const n=t==="owner"||t==="admin";return{role:{id:l?.id,slug:t,label:t.charAt(0).toUpperCase()+t.slice(1)},allowAllStaticPermissions:n,staticPermissions:Xs[t],toolSet:{},allowAllModels:!0,modelSet:{},allowAllProjects:!0,projectSet:[],memberIds:e.filter(o=>o.role===t).map(o=>o.id)}}function tl(t,e,l){const r=t.permission||{},n=r.self||[],o=n.includes("*"),d=o?[]:n.filter(a=>a!=="*"),f={};for(const[a,h]of Object.entries(r))if(!(a==="self"||a==="models"||a===Je))if(a==="*")for(const S of l)f[S.id]=h.includes("*")?S.tools?.map(p=>p.name)??[]:h;else{const S=l.find(p=>p.id===a);S&&(f[a]=h.includes("*")?S.tools?.map(p=>p.name)??[]:h)}const m=r.models||[],c=m.length===0||m.includes("*:*"),g={};if(!c)for(const a of m){const h=a.indexOf(":");if(h===-1)continue;const S=a.slice(0,h),p=a.slice(h+1);g[S]||(g[S]=[]),g[S].push(p)}const u=_s(r),T=u===null||u.includes(ot),x=T?[]:u.filter(a=>a!==ot);return{role:{id:t.id,slug:t.role,label:t.label},allowAllStaticPermissions:o,staticPermissions:d,toolSet:f,allowAllModels:c,modelSet:g,allowAllProjects:T,projectSet:x,memberIds:e.filter(a=>a.role===t.role).map(a=>a.id)}}function sl(t,e){const l={};t.allowAllStaticPermissions?l.self=["*"]:t.staticPermissions.length>0&&(l.self=t.staticPermissions);for(const[r,n]of Object.entries(t.toolSet))if(n.length>0){const d=e.find(f=>f.id===r)?.tools?.map(f=>f.name)??[];l[r]=d.length>0&&d.every(f=>n.includes(f))?["*"]:n}if(t.allowAllModels)l.models=["*:*"];else{const r=[];for(const[n,o]of Object.entries(t.modelSet))for(const d of o)r.push(`${n}:${d}`);r.length>0&&(l.models=r)}return t.allowAllProjects||(l[Je]=t.projectSet),l}function ll(t,e,l){return t.kind==="builtin"?el(t.role,e,void 0):t.kind==="custom"?tl(t.role,e,l):{role:{id:void 0,slug:void 0,label:""},allowAllStaticPermissions:!1,staticPermissions:[],toolSet:{},allowAllModels:!0,modelSet:{},allowAllProjects:!0,projectSet:[],memberIds:[]}}function ol(t){const e=q.c(19),{readOnly:l,readOnlyMessage:r,onOpen:n}=t,o=r===void 0?void 0:r,d=oe();let f;e[0]!==o||e[1]!==d?(f=o??d("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),e[0]=o,e[1]=d,e[2]=f):f=e[2];const m=f;if(l){let T;e[3]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx(Ve,{size:16}),e[3]=T):T=e[3];let x;e[4]!==d?(x=d("settings.orgRoleDetail.addMember"),e[4]=d,e[5]=x):x=e[5];let a;e[6]!==x?(a=s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:s.jsxs(ae,{variant:"outline",size:"sm",disabled:!0,children:[T,x]})})}),e[6]=x,e[7]=a):a=e[7];let h;e[8]!==m?(h=s.jsx(De,{children:s.jsx("p",{children:m})}),e[8]=m,e[9]=h):h=e[9];let S;return e[10]!==a||e[11]!==h?(S=s.jsx(be,{children:s.jsxs(je,{children:[a,h]})}),e[10]=a,e[11]=h,e[12]=S):S=e[12],S}let c;e[13]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Ve,{size:16}),e[13]=c):c=e[13];let g;e[14]!==d?(g=d("settings.orgRoleDetail.addMember"),e[14]=d,e[15]=g):g=e[15];let u;return e[16]!==n||e[17]!==g?(u=s.jsxs(ae,{variant:"outline",size:"sm",onClick:n,children:[c,g]}),e[16]=n,e[17]=g,e[18]=u):u=e[18],u}function nl(t){const e=q.c(14),{locator:l}=ke(),r=Ye(),n=ls();let o;e[0]!==l?(o=me.members(l),e[0]=l,e[1]=o):o=e[1];let d;e[2]!==r?(d=()=>r.organization.listMembers(),e[2]=r,e[3]=d):d=e[3];let f;e[4]!==o||e[5]!==d?(f={queryKey:o,queryFn:d},e[4]=o,e[5]=d,e[6]=f):f=e[6];const{data:m,isPending:c}=ze(f);if(c||!n){let x;return e[7]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(re,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(ue,{className:"size-8 text-muted-foreground"})})}),e[7]=x):x=e[7],x}let g;e[8]!==m?.data?.members?(g=m?.data?.members??[],e[8]=m?.data?.members,e[9]=g):g=e[9];const u=g;let T;return e[10]!==n||e[11]!==u||e[12]!==t?(T=s.jsx(il,{...t,members:u,connections:n}),e[10]=n,e[11]=u,e[12]=t,e[13]=T):T=e[13],T}function il({target:t,onBack:e,onSaved:l,members:r,connections:n}){const o=oe(),{locator:d}=ke(),f=Ye(),m=it(),c=t.kind==="builtin",g=t.kind==="builtin"&&t.role==="owner",u=t.kind==="new",[T,x]=Y.useState(c?"org":"mcp"),a=Dt({resolver:Mt(Rs),defaultValues:ll(t,r,n)}),h=a.formState.isValid,S=a.formState.isDirty,p=rt({mutationFn:async i=>{const I=sl(i,n),k=i.role.slug||i.role.label.toLowerCase().replace(/\s+/g,"-"),w=(i.role.slug==="owner"||i.role.slug==="admin"||i.role.slug==="user")&&!i.role.id,V=async(L,z)=>{const y=r.filter(B=>B.role===(z??L)).map(B=>B.id),F=i.memberIds.filter(B=>!y.includes(B)),K=y.filter(B=>!i.memberIds.includes(B));for(const B of F){const U=await f.organization.updateMemberRole({memberId:B,role:[L]});if(U?.error)throw new Error(U.error.message??o("settings.orgRoleDetail.somethingWentWrong"))}for(const B of K){const U=await f.organization.updateMemberRole({memberId:B,role:["user"]});if(U?.error)throw new Error(U.error.message??o("settings.orgRoleDetail.somethingWentWrong"))}};if(w)return await V(i.role.slug),i;if(i.role.id){const L=i.role.label.toLowerCase().replace(/\s+/g,"-"),z=i.role.slug,y=L!==z,F=await f.organization.updateRole({roleId:i.role.id,data:{permission:I,...y?{roleName:L}:{}}});if(F?.error)throw new Error(F.error.message??o("settings.orgRoleDetail.somethingWentWrong"));return await V(y?L:z,y?z:void 0),y?{...i,role:{...i.role,slug:L}}:i}else{const L=await f.organization.createRole({role:k,permission:I});if(L?.error)throw new Error(L.error.message??o("settings.orgRoleDetail.somethingWentWrong"));for(const z of i.memberIds){const y=await f.organization.updateMemberRole({memberId:z,role:[k]});if(y?.error)throw new Error(y.error.message)}return{...i,role:{...i.role,id:L.data?.roleData?.id,slug:k}}}},onSuccess:(i,I)=>{m.invalidateQueries({queryKey:me.members(d)}),m.invalidateQueries({queryKey:me.organizationRoles(d)});const k=!I.role.id&&!I.role.slug,w=I.role.slug==="owner"&&!I.role.id;Fe(w?"role_members_updated":k?"role_created":"role_updated",{role_slug:I.role.slug??null}),Le.success(o(w?"settings.orgRoleDetail.membersUpdatedSuccessfully":k?"settings.orgRoleDetail.roleCreatedSuccessfully":"settings.orgRoleDetail.roleUpdatedSuccessfully")),a.reset(i),l(i.role.id)},onError:i=>{Le.error(i instanceof Error?i.message:o("settings.orgRoleDetail.failedToSaveRole"))}}),A=a.handleSubmit(i=>{if(!i.role.label.trim()){Le.error(o("settings.orgRoleDetail.roleNameIsRequired")),a.setFocus("role.label");return}p.mutate(i)}),b=!g,N=t.kind==="builtin"?t.role.charAt(0).toUpperCase()+t.role.slice(1):t.kind==="custom"?t.role.label:"",P=[...g?[]:[{id:"mcp",label:o("settings.orgRoleDetail.mcpPermissions"),icon:ms}],{id:"org",label:o("settings.orgRoleDetail.organizationPermissions"),icon:cs},{id:"models",label:o("settings.orgRoleDetail.models"),icon:Lt},{id:"projects",label:o("settings.orgRoleDetail.projects"),icon:us},{id:"members",label:o("settings.orgRoleDetail.members"),icon:vt}],[R,j]=Y.useState(""),[D,_]=Y.useState(!1),C=i=>{x(i),j("")},O={mcp:o("settings.orgRoleDetail.searchMcpServers"),org:o("settings.orgRoleDetail.searchPermissions"),models:o("settings.orgRoleDetail.searchModels"),projects:o("settings.orgRoleDetail.searchProjects"),members:o("settings.orgRoleDetail.searchMembers")};return s.jsx(re,{children:s.jsxs(re.Content,{className:J("flex flex-col",T!=="org"&&"overflow-hidden"),children:[s.jsx("div",{className:"shrink-0 mx-auto w-full max-w-[1200px] px-4 md:px-10 pt-8 md:pt-12 pb-4",children:s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsx(re.Title,{actions:b&&s.jsxs(s.Fragment,{children:[s.jsx(ae,{variant:"outline",size:"sm",onClick:e,disabled:p.isPending,children:o("settings.orgRoleDetail.cancel")}),s.jsx(ae,{size:"sm",onClick:A,disabled:p.isPending||!h||!S,children:p.isPending?o("settings.orgRoleDetail.saving"):o(u?"settings.orgRoleDetail.createRole":"settings.orgRoleDetail.saveChanges")})]}),children:s.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[s.jsx("div",{className:J("size-2.5 rounded-full shrink-0",t.kind==="builtin"?mt(t.role,!0):Qt(a.watch("role.label")))}),g&&s.jsx(at,{size:16,className:"text-muted-foreground shrink-0"}),u||t.kind==="custom"?s.jsx("input",{...a.register("role.label"),placeholder:o("settings.orgRoleDetail.roleName"),className:"leading-tight text-foreground bg-transparent border-none outline-none px-1 -mx-1 rounded hover:bg-input/25 focus:bg-input/25 transition-colors w-64 placeholder:text-muted-foreground/50",autoFocus:u}):s.jsx("span",{className:"truncate",children:N})]})}),s.jsx(s.Fragment,{children:s.jsx(yt.Toolbar.Left.Portal,{children:s.jsx(re.Tabs,{children:P.map(i=>s.jsx(re.Tab,{active:T===i.id,onClick:()=>C(i.id),children:i.label},i.id))})})}),s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx($e,{value:R,onChange:j,placeholder:O[T]??"Search...",className:"w-full md:w-[375px]"}),T==="members"&&s.jsx(ol,{readOnly:t.kind==="builtin"&&t.role==="owner",onOpen:()=>_(!0)})]})]})}),s.jsx("div",{className:J("mx-auto w-full max-w-[1200px] px-4 md:px-10 pb-6",T!=="org"&&"flex-1 min-h-0"),children:s.jsxs("div",{className:J(T!=="org"&&"h-full overflow-hidden",T!=="models"&&T!=="projects"&&T!=="org"&&"border border-border rounded-xl bg-card"),children:[T==="mcp"&&!g&&s.jsx(Y.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(ue,{className:"size-6 text-muted-foreground"})}),children:s.jsx(Ss,{toolSet:a.watch("toolSet"),onToolSetChange:i=>a.setValue("toolSet",i,{shouldDirty:!0}),searchQuery:R})}),T==="org"&&s.jsx(Ns,{allowAllStaticPermissions:a.watch("allowAllStaticPermissions"),staticPermissions:a.watch("staticPermissions"),onAllowAllChange:i=>a.setValue("allowAllStaticPermissions",i,{shouldDirty:!0}),onPermissionsChange:i=>a.setValue("staticPermissions",i,{shouldDirty:!0}),readOnly:g,searchQuery:R}),T==="models"&&s.jsx(zs,{allowAllModels:a.watch("allowAllModels"),modelSet:a.watch("modelSet"),onAllowAllChange:i=>a.setValue("allowAllModels",i,{shouldDirty:!0}),onModelSetChange:i=>a.setValue("modelSet",i,{shouldDirty:!0}),readOnly:g,searchQuery:R}),T==="projects"&&s.jsx($s,{allowAllProjects:a.watch("allowAllProjects"),projectSet:a.watch("projectSet"),onAllowAllChange:i=>a.setValue("allowAllProjects",i,{shouldDirty:!0}),onProjectSetChange:i=>a.setValue("projectSet",i,{shouldDirty:!0}),readOnly:g,searchQuery:R}),T==="members"&&s.jsx(Ws,{memberIds:a.watch("memberIds"),onMemberIdsChange:i=>a.setValue("memberIds",i,{shouldDirty:!0}),readOnly:t.kind==="builtin"&&(t.role==="owner"||t.role==="user"),readOnlyMessage:t.kind==="builtin"&&t.role==="user"?o("settings.orgRoleDetail.userIsDefaultRoleMessage"):o("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),searchQuery:R,addMemberDialogOpen:D,onAddMemberDialogOpenChange:_})]})})]})})}function rl(t){return t.kind==="builtin"?`builtin-${t.role}`:t.kind==="custom"?`custom-${t.role.id}`:"new"}function al(t){const e=q.c(6),{area:l,children:r}=t,{isPrivileged:n,loading:o,error:d}=Gt();let f;return e[0]!==l||e[1]!==r||e[2]!==d||e[3]!==n||e[4]!==o?(f=s.jsx(fs,{granted:n,loading:o,error:d,area:l,children:r}),e[0]=l,e[1]=r,e[2]=d,e[3]=n,e[4]=o,e[5]=f):f=e[5],f}const cl=[{role:"owner",labelKey:"settings.roles.roleOwner"},{role:"admin",labelKey:"settings.roles.roleAdmin"},{role:"user",labelKey:"settings.roles.roleUser"}];function dl(){const t=q.c(128),e=oe(),[l,r]=Y.useState(""),[n,o]=Y.useState(null),d=Kt();let f;t[0]===Symbol.for("react.memo_cache_sentinel")?(f={strict:!1},t[0]=f):f=t[0];const{role:m}=ct(f),{locator:c}=ke(),g=Ye(),u=it(),{customRoles:T,refetch:x}=$t();let a;t[1]!==d?(a=M=>d({to:".",search:v=>({...v,role:M})}),t[1]=d,t[2]=a):a=t[2];const h=a;let S;e:{if(!m){S=null;break e}if(m==="new"){S={kind:"new"};break e}if(m.startsWith("builtin-")){S={kind:"builtin",role:m.slice(8)};break e}let M;t[3]!==m?(M=ee=>ee.id===m,t[3]=m,t[4]=M):M=t[4];const v=T.find(M);S=v?{kind:"custom",role:v}:null}const p=S;let A;t[5]!==c?(A=me.members(c),t[5]=c,t[6]=A):A=t[6];let b;t[7]!==g?(b=()=>g.organization.listMembers(),t[7]=g,t[8]=b):b=t[8];let N;t[9]!==A||t[10]!==b?(N={queryKey:A,queryFn:b},t[9]=A,t[10]=b,t[11]=N):N=t[11];const{data:P}=ze(N);let R;t[12]!==P?.data?.members?(R=P?.data?.members??[],t[12]=P?.data?.members,t[13]=R):R=t[13];const j=R;let D;t[14]!==j?(D=M=>j.filter(v=>v.role===M).length,t[14]=j,t[15]=D):D=t[15];const _=D;let C;if(t[16]!==T||t[17]!==_||t[18]!==l||t[19]!==e){let M;t[21]!==_||t[22]!==e?(M=de=>({kind:"builtin",role:{...de,memberCount:_(de.role),label:e(de.labelKey)}}),t[21]=_,t[22]=e,t[23]=M):M=t[23];const v=cl.map(M);let ee;t[24]!==_?(ee=de=>({kind:"custom",role:{...de,memberCount:_(de.role)}}),t[24]=_,t[25]=ee):ee=t[25];const Ct=T.map(ee);if(C=[...v,...Ct],l){const de=l.toLowerCase();C=C.filter(bt=>bt.role.label.toLowerCase().includes(de))}t[16]=T,t[17]=_,t[18]=l,t[19]=e,t[20]=C}else C=t[20];let O;t[26]!==g?(O=async M=>{const v=await g.organization.deleteRole({roleId:M});if(v?.error)throw new Error(v.error.message);return v?.data},t[26]=g,t[27]=O):O=t[27];const i=rt({mutationFn:O,onSuccess:(M,v)=>{Fe("role_deleted",{role_id:v}),u.invalidateQueries({queryKey:me.members(c)}),u.invalidateQueries({queryKey:me.organizationRoles(c)}),Le.success(e("settings.roles.deletedSuccessfully")),x(),p?.kind==="custom"&&p.role.id===v&&h(void 0)},onError:Tl});let I;t[28]!==e?(I=e("settings.roles.columnRole"),t[28]=e,t[29]=I):I=t[29];let k;t[30]!==I?(k={id:"role",header:I,render:gl,cellClassName:"flex-1 min-w-0",sortable:!0},t[30]=I,t[31]=k):k=t[31];let w;t[32]!==e?(w=e("settings.roles.columnType"),t[32]=e,t[33]=w):w=t[33];let V;t[34]!==e?(V=M=>M.kind==="builtin"?s.jsx(ve,{variant:"secondary",className:"text-xs",children:e("settings.roles.builtIn")}):s.jsx(ve,{variant:"outline",className:"text-xs",children:e("settings.roles.custom")}),t[34]=e,t[35]=V):V=t[35];let L;t[36]!==w||t[37]!==V?(L={id:"type",header:w,render:V,cellClassName:"w-28 shrink-0"},t[36]=w,t[37]=V,t[38]=L):L=t[38];let z;t[39]!==e?(z=e("settings.roles.columnPermissions"),t[39]=e,t[40]=z):z=t[40];let y;t[41]!==e?(y=M=>{if(M.kind==="builtin")return M.role.role==="owner"||M.role.role==="admin"?s.jsx("span",{className:"text-sm text-muted-foreground",children:e("settings.roles.fullAccess")}):s.jsx("span",{className:"text-sm text-muted-foreground",children:e("settings.roles.basicAccess")});const v=M.role,ee=[];return v.allowsAllStaticPermissions?ee.push(e("settings.roles.fullOrgAccess")):v.staticPermissionCount&&v.staticPermissionCount>0&&ee.push(e("settings.roles.orgPermsCount",{count:v.staticPermissionCount})),v.allowsAllConnections?ee.push(e("settings.roles.allConnections")):v.connectionCount&&v.connectionCount>0&&ee.push(e("settings.roles.connectionCount",{count:v.connectionCount})),s.jsx("span",{className:"text-sm text-muted-foreground truncate",children:ee.length>0?ee.join(", "):e("settings.roles.noPermissions")})},t[41]=e,t[42]=y):y=t[42];let F;t[43]!==z||t[44]!==y?(F={id:"permissions",header:z,render:y,cellClassName:"flex-1 min-w-0"},t[43]=z,t[44]=y,t[45]=F):F=t[45];let K;t[46]!==e?(K=e("settings.roles.columnMembers"),t[46]=e,t[47]=K):K=t[47];let B;t[48]!==K?(B={id:"members",header:K,render:fl,cellClassName:"w-24 shrink-0"},t[48]=K,t[49]=B):B=t[49];let U;t[50]!==e?(U={id:"actions",header:"",render:M=>M.kind==="builtin"?null:s.jsxs(Vt,{children:[s.jsx(zt,{asChild:!0,children:s.jsx(ae,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:ul,children:s.jsx(Ht,{size:16})})}),s.jsx(Ft,{align:"end",onClick:ml,children:s.jsxs(Yt,{variant:"destructive",onClick:()=>{const v=M.role;v.id&&o({id:v.id,label:v.label})},children:[s.jsx(Zt,{size:16}),e("settings.roles.delete")]})})]}),cellClassName:"w-12 shrink-0"},t[50]=e,t[51]=U):U=t[51];let Q;t[52]!==k||t[53]!==L||t[54]!==F||t[55]!==B||t[56]!==U?(Q=[k,L,F,B,U],t[52]=k,t[53]=L,t[54]=F,t[55]=B,t[56]=U,t[57]=Q):Q=t[57];const W=Q;let te;t[58]!==h?(te=M=>{if(M.kind==="builtin")h(`builtin-${M.role.role}`);else{const v=M.role;h(v.id)}},t[58]=h,t[59]=te):te=t[59];const se=te;if(p){let M;t[60]!==h?(M=()=>h(void 0),t[60]=h,t[61]=M):M=t[61];let v;return t[62]!==x||t[63]!==h?(v=()=>{x(),h(void 0)},t[62]=x,t[63]=h,t[64]=v):v=t[64],s.jsx(nl,{target:p,onBack:M,onSaved:v},rl(p))}let $;t[65]!==e?($=e("settings.roles.searchPlaceholder"),t[65]=e,t[66]=$):$=t[66];let X;t[67]===Symbol.for("react.memo_cache_sentinel")?(X=M=>{M.key==="Escape"&&(r(""),M.target.blur())},t[67]=X):X=t[67];let E;t[68]!==l||t[69]!==$?(E=s.jsx($e,{value:l,onChange:r,placeholder:$,className:"w-full md:w-[375px]",onKeyDown:X}),t[68]=l,t[69]=$,t[70]=E):E=t[70];let G;t[71]!==h?(G=()=>h("new"),t[71]=h,t[72]=G):G=t[72];let H;t[73]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(Ve,{size:16}),t[73]=H):H=t[73];let Z;t[74]!==e?(Z=e("settings.roles.createRole"),t[74]=e,t[75]=Z):Z=t[75];let le;t[76]!==G||t[77]!==Z?(le=s.jsx(re.Actions,{children:s.jsxs(ae,{size:"sm",onClick:G,children:[H,Z]})}),t[76]=G,t[77]=Z,t[78]=le):le=t[78];let ie;t[79]!==E||t[80]!==le?(ie=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[E,le]}),t[79]=E,t[80]=le,t[81]=ie):ie=t[81];let ce;t[82]!==l||t[83]!==e?(ce=l?s.jsx(lt,{title:e("settings.roles.noRolesFound"),description:e("settings.roles.noRolesMatchSearch",{search:l})}):s.jsx(lt,{title:e("settings.roles.noRoles"),description:e("settings.roles.createRoleGetStarted")}),t[82]=l,t[83]=e,t[84]=ce):ce=t[84];let ge;t[85]!==C||t[86]!==W||t[87]!==se||t[88]!==ce?(ge=s.jsx(Jt,{columns:W,data:C,isLoading:!1,onRowClick:se,emptyState:ce}),t[85]=C,t[86]=W,t[87]=se,t[88]=ce,t[89]=ge):ge=t[89];const Be=n!==null;let ye;t[90]===Symbol.for("react.memo_cache_sentinel")?(ye=M=>!M&&o(null),t[90]=ye):ye=t[90];let Te;t[91]!==e?(Te=e("settings.roles.deleteRoleTitle"),t[91]=e,t[92]=Te):Te=t[92];let he;t[93]!==Te?(he=s.jsx(gt,{children:Te}),t[93]=Te,t[94]=he):he=t[94];const Ue=n?.label??"";let xe;t[95]!==e||t[96]!==Ue?(xe=e("settings.roles.deleteRoleConfirm",{role:Ue}),t[95]=e,t[96]=Ue,t[97]=xe):xe=t[97];let _e;t[98]!==xe?(_e=s.jsx(Tt,{children:xe}),t[98]=xe,t[99]=_e):_e=t[99];let Ee;t[100]!==he||t[101]!==_e?(Ee=s.jsxs(ht,{children:[he,_e]}),t[100]=he,t[101]=_e,t[102]=Ee):Ee=t[102];let pe;t[103]!==e?(pe=e("settings.roles.cancel"),t[103]=e,t[104]=pe):pe=t[104];let Ae;t[105]!==pe?(Ae=s.jsx(xt,{children:pe}),t[105]=pe,t[106]=Ae):Ae=t[106];let Ie;t[107]!==i||t[108]!==n?(Ie=()=>{n?.id&&i.mutate(n.id),o(null)},t[107]=i,t[108]=n,t[109]=Ie):Ie=t[109];let Se;t[110]!==e?(Se=e("settings.roles.delete"),t[110]=e,t[111]=Se):Se=t[111];let Re;t[112]!==Ie||t[113]!==Se?(Re=s.jsx(_t,{onClick:Ie,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Se}),t[112]=Ie,t[113]=Se,t[114]=Re):Re=t[114];let Ne;t[115]!==Ae||t[116]!==Re?(Ne=s.jsxs(Et,{children:[Ae,Re]}),t[115]=Ae,t[116]=Re,t[117]=Ne):Ne=t[117];let Oe;t[118]!==Ee||t[119]!==Ne?(Oe=s.jsxs(ft,{children:[Ee,Ne]}),t[118]=Ee,t[119]=Ne,t[120]=Oe):Oe=t[120];let Ce;t[121]!==Be||t[122]!==Oe?(Ce=s.jsx(ut,{open:Be,onOpenChange:ye,children:Oe}),t[121]=Be,t[122]=Oe,t[123]=Ce):Ce=t[123];let we;return t[124]!==ie||t[125]!==ge||t[126]!==Ce?(we=s.jsxs(dt,{group:"members",className:"gap-6",children:[ie,ge,Ce]}),t[124]=ie,t[125]=ge,t[126]=Ce,t[127]=we):we=t[127],we}function ml(t){return t.stopPropagation()}function ul(t){return t.stopPropagation()}function fl(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.role.memberCount})}function gl(t){return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:J("size-2.5 rounded-full shrink-0",mt(t.role.role,t.kind==="builtin"))}),s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:t.role.label}),t.kind==="builtin"&&s.jsx(at,{size:12,className:"text-muted-foreground shrink-0"})]})}function Tl(t,e){Fe("role_delete_failed",{role_id:e,error:t instanceof Error?t.message:String(t)}),Le.error(t instanceof Error?t.message:"Failed to delete role")}function hl(){const t=q.c(13),e=oe();let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l={strict:!1},t[0]=l):l=t[0];const{role:r}=ct(l);let n;t[1]!==e?(n=e("settings.roles.failedToLoad"),t[1]=e,t[2]=n):n=t[2];let o;t[3]!==n?(o=s.jsx(re,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-sm text-muted-foreground",children:n})})}),t[3]=n,t[4]=o):o=t[4];let d;t[5]!==r?(d=r?s.jsx(re,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(ue,{className:"size-8 text-muted-foreground"})})}):s.jsx(dt,{group:"members",className:"gap-6",children:s.jsx(Bt,{})}),t[5]=r,t[6]=d):d=t[6];let f;t[7]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(dl,{}),t[7]=f):f=t[7];let m;t[8]!==d?(m=s.jsx(Y.Suspense,{fallback:d,children:f}),t[8]=d,t[9]=m):m=t[9];let c;return t[10]!==o||t[11]!==m?(c=s.jsx(Ut,{fallback:o,children:m}),t[10]=o,t[11]=m,t[12]=c):c=t[12],c}function jo(){const t=q.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(al,{area:"roles",children:s.jsx(hl,{})}),t[0]=e):e=t[0],e}export{jo as default};