decocms 4.61.2 → 4.63.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 (292) hide show
  1. package/dist/client/assets/{AlertCircle-BsA2wZmN.js → AlertCircle-BkrprcoF.js} +1 -1
  2. package/dist/client/assets/{AreaChart-BHEk1VG5.js → AreaChart-BeF6Gy1z.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-CDnEKV2Y.js → ArrowUp-CbMTR9M0.js} +1 -1
  4. package/dist/client/assets/{ArrowUpRight-DdPCnlNm.js → ArrowUpRight-L-sW_E0D.js} +1 -1
  5. package/dist/client/assets/{Check-CcLLJc-z.js → Check-DZygR-Fe.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-lXciCGfG.js → CheckCircle-BLRVelyD.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-BmFaSDo8.js → ChevronDown-DDDop4Os.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-C3Tgk-3m.js → ChevronRight-Cku8WSiq.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-Dew3RmKl.js → ChevronUp-PZzlDplk.js} +1 -1
  10. package/dist/client/assets/{Circle-C_fdyhr8.js → Circle-CadYWyyA.js} +1 -1
  11. package/dist/client/assets/{Copy01-b3lIb5yu.js → Copy01-ryDblf5m.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-CK1a4mKj.js → DotsVertical-Dg3Xo34T.js} +1 -1
  13. package/dist/client/assets/{Eye-DM8bmzm7.js → Eye-Bz-yLlBh.js} +1 -1
  14. package/dist/client/assets/{FilterLines-DCNZa1GS.js → FilterLines-CLgHUAPd.js} +1 -1
  15. package/dist/client/assets/{Globe01-B6kdhpV9.js → Globe01-JMrbqgtG.js} +1 -1
  16. package/dist/client/assets/{Globe04-CGLGspo5.js → Globe04-MZEsVtUE.js} +1 -1
  17. package/dist/client/assets/{HardDrive-CR6Rs-a1.js → HardDrive-P0VrWAsS.js} +1 -1
  18. package/dist/client/assets/{Key01-1r4YrQER.js → Key01-CxVX_Pbg.js} +1 -1
  19. package/dist/client/assets/{LayoutLeft-DvNM8qhm.js → LayoutLeft-Ccrzp7iH.js} +1 -1
  20. package/dist/client/assets/{LinkExternal01-Ck4lryDE.js → LinkExternal01-DNPuUmDD.js} +1 -1
  21. package/dist/client/assets/{List-DfPIAPM_.js → List-CbUCe9_w.js} +1 -1
  22. package/dist/client/assets/{Monitor01-D_DrBwt_.js → Monitor01-8E0Kd0bb.js} +1 -1
  23. package/dist/client/assets/{Package-CV2Q9Uup.js → Package-0lPNEylQ.js} +1 -1
  24. package/dist/client/assets/{Palette-BY5BmUDa.js → Palette-BMnON_zo.js} +1 -1
  25. package/dist/client/assets/{Play-Ci1OqtIO.js → Play-qfGjc7w4.js} +1 -1
  26. package/dist/client/assets/{Plus-Cgq7ON9K.js → Plus-cs1N_W6b.js} +1 -1
  27. package/dist/client/assets/{SearchLg-2as_l8YT.js → SearchLg-Cpz6OE5G.js} +1 -1
  28. package/dist/client/assets/{SearchMd-ZfoTl6vw.js → SearchMd-D4gbfQvO.js} +1 -1
  29. package/dist/client/assets/{Settings02-CS2jOfO5.js → Settings02-BQIcnVua.js} +1 -1
  30. package/dist/client/assets/{Shield01-C6TdRfmI.js → Shield01-uN7yLkjY.js} +1 -1
  31. package/dist/client/assets/{Star01-2DHf7kTZ.js → Star01-B61mWKGP.js} +1 -1
  32. package/dist/client/assets/{Stars01-BEHbN5c3.js → Stars01-COCvCNwS.js} +1 -1
  33. package/dist/client/assets/{Stars02-HLp9q8iP.js → Stars02-DCivmeGP.js} +1 -1
  34. package/dist/client/assets/{Sun-ByaEjJ0N.js → Sun-CN1qXAbA.js} +1 -1
  35. package/dist/client/assets/{SwitchHorizontal01-ilLzkPr_.js → SwitchHorizontal01-MT4LDKEV.js} +1 -1
  36. package/dist/client/assets/{Tool01-DVCGutKV.js → Tool01-Beyaqvxk.js} +1 -1
  37. package/dist/client/assets/{Tool02-CSTMjTef.js → Tool02-jYwfK8WU.js} +1 -1
  38. package/dist/client/assets/{Trash01--uX5q_ti.js → Trash01-CgtbhVG5.js} +1 -1
  39. package/dist/client/assets/Trash03-rtk2CmiW.js +1 -0
  40. package/dist/client/assets/{TrendUp01-acR-ekUr.js → TrendUp01-2mG8Ply8.js} +1 -1
  41. package/dist/client/assets/{Upload01-BaheeKQP.js → Upload01-CpJQboow.js} +1 -1
  42. package/dist/client/assets/{User01-5hu8D3_O.js → User01-Bnj-cSVO.js} +1 -1
  43. package/dist/client/assets/{Users01-Dh5E4dqf.js → Users01-0zLYZpC7.js} +1 -1
  44. package/dist/client/assets/{Users03-tGwfKVJc.js → Users03-7mmR4h8P.js} +1 -1
  45. package/dist/client/assets/{X-OFSHASit.js → X-BhKPwXx-.js} +1 -1
  46. package/dist/client/assets/{XCircle-D3cI1Aep.js → XCircle-BjlDFDl6.js} +1 -1
  47. package/dist/client/assets/{XClose-D5Ra7e-f.js → XClose-tZL2IdJO.js} +1 -1
  48. package/dist/client/assets/{Zap-CgjpaG4V.js → Zap-BPZV9XTy.js} +1 -1
  49. package/dist/client/assets/{ZapSquare-Dzb50Gix.js → ZapSquare-C0baTxoC.js} +1 -1
  50. package/dist/client/assets/{ZoomOut-DYAXxr_v.js → ZoomOut-CS3Og5lE.js} +1 -1
  51. package/dist/client/assets/{access-gate-B4XS-sin.js → access-gate-D5TOVD3E.js} +1 -1
  52. package/dist/client/assets/{add-section-modal-2QsV6sh6.js → add-section-modal-tXpF1_lX.js} +1 -1
  53. package/dist/client/assets/agent-icon-DkxLV1fV.js +1 -0
  54. package/dist/client/assets/agents-list-7jGVMclg.js +1 -0
  55. package/dist/client/assets/ai-providers-DfYQ_QQL.js +1 -0
  56. package/dist/client/assets/{alert-DBWDLZgp.js → alert-BGbl-kfx.js} +1 -1
  57. package/dist/client/assets/{alert-dialog-Bd5XLC3F.js → alert-dialog-qVVgQZs_.js} +3 -3
  58. package/dist/client/assets/app-editor-B_ZP-aVy.js +1 -0
  59. package/dist/client/assets/{auth-D_bm0-t3.js → auth-D3FIklA5.js} +1 -1
  60. package/dist/client/assets/{auth-catchall-CDVAqOkY.js → auth-catchall-DIcQ-n8K.js} +1 -1
  61. package/dist/client/assets/auth-entry-LhmBIgh6.js +1 -0
  62. package/dist/client/assets/{auth-split-layout-DB8qmgLK.js → auth-split-layout-D1GUoAkz.js} +1 -1
  63. package/dist/client/assets/{authenticate-and-persist-oauth-ClCvWDci.js → authenticate-and-persist-oauth-C4jnnZWl.js} +1 -1
  64. package/dist/client/assets/{automation-list-row-ByoN-o6y.js → automation-list-row-D0R4MbNV.js} +1 -1
  65. package/dist/client/assets/{automation-runs-Y9TSuy3F.js → automation-runs-BYtwdZxc.js} +1 -1
  66. package/dist/client/assets/automations--Z24mOUf.js +1 -0
  67. package/dist/client/assets/{autosend-qB5BaOSA.js → autosend-D43Y2Wye.js} +1 -1
  68. package/dist/client/assets/{avatar-DOYkgu8W.js → avatar-CEhTtT5Z.js} +1 -1
  69. package/dist/client/assets/{badge-BMMjntMn.js → badge-BRITDvjk.js} +1 -1
  70. package/dist/client/assets/{block-document-CCtmnkDi.js → block-document-CHZpIPJn.js} +1 -1
  71. package/dist/client/assets/brand-context-DNx2wpN3.js +1 -0
  72. package/dist/client/assets/{buckets-B22IEfKD.js → buckets-BBci7RWl.js} +1 -1
  73. package/dist/client/assets/bulk-category-panel-CCrSnxHT.js +1 -0
  74. package/dist/client/assets/calendar-DITgsboQ.js +1 -0
  75. package/dist/client/assets/capability-load-error-C3U-K2hK.js +1 -0
  76. package/dist/client/assets/{card-Bc92PJFP.js → card-dUi6YgZ6.js} +1 -1
  77. package/dist/client/assets/category-editor-BlBFOzrv.js +1 -0
  78. package/dist/client/assets/{chat-context-Awe2cIoY.js → chat-context-Iman-MuU.js} +6 -6
  79. package/dist/client/assets/{checkbox-B-y-IHdE.js → checkbox-BvCpvEfo.js} +1 -1
  80. package/dist/client/assets/{cli-auth-success-BlIIxKPd.js → cli-auth-success-DyhlAsFy.js} +1 -1
  81. package/dist/client/assets/collection-detail-CXqm_V0F.js +1 -0
  82. package/dist/client/assets/{collection-display-button-BVhQtAEp.js → collection-display-button-IFaJZ5V5.js} +1 -1
  83. package/dist/client/assets/{collection-search-DSP3ov6A.js → collection-search-B0UfZ-OT.js} +1 -1
  84. package/dist/client/assets/{collection-table-wrapper-CeR2zvlX.js → collection-table-wrapper-CoEKWaCw.js} +1 -1
  85. package/dist/client/assets/{collection-tabs-PTC62n_G.js → collection-tabs-CpnfoB9V.js} +1 -1
  86. package/dist/client/assets/{command-DzGwZa9g.js → command-cobicZB1.js} +1 -1
  87. package/dist/client/assets/commerce-onboarding-FW4szuTn.js +1 -0
  88. package/dist/client/assets/{connect-desktop-dialog-DiutLBhU.js → connect-desktop-dialog-DWRyRSkj.js} +1 -1
  89. package/dist/client/assets/connection-card-LUMMlH6G.js +1 -0
  90. package/dist/client/assets/connection-detail-DoPkmdCs.js +1 -0
  91. package/dist/client/assets/{connection-form-helpers-POWe2kJ-.js → connection-form-helpers-yaifOq7s.js} +1 -1
  92. package/dist/client/assets/connections-4fdav7OM.js +1 -0
  93. package/dist/client/assets/constants-D_FQAPnt.js +1 -0
  94. package/dist/client/assets/decopilot-sse-pool-D5PMEPBF.js +1 -0
  95. package/dist/client/assets/dialog-BzVEcj79.js +1 -0
  96. package/dist/client/assets/domain-settings-DCcEckko.js +1 -0
  97. package/dist/client/assets/{drawer-Ck_Oak77.js → drawer-DTss_--q.js} +1 -1
  98. package/dist/client/assets/{dropdown-menu-C9SSwIby.js → dropdown-menu-DDThFULM.js} +1 -1
  99. package/dist/client/assets/{empty-state-DD15-E7x.js → empty-state-Bfm4FdaU.js} +1 -1
  100. package/dist/client/assets/{extract-connection-data-Di6SAuY0.js → extract-connection-data-B3b_eFbC.js} +1 -1
  101. package/dist/client/assets/file-explorer-D3ekbS0A.js +2 -0
  102. package/dist/client/assets/{file-type-icon-CuakGACj.js → file-type-icon-Co-9ap-O.js} +1 -1
  103. package/dist/client/assets/{files-DrQIRu5a.js → files-nenoVdXA.js} +1 -1
  104. package/dist/client/assets/{form-YJrSMpNL.js → form-BEFBxu79.js} +1 -1
  105. package/dist/client/assets/general-DhzgM9yi.js +1 -0
  106. package/dist/client/assets/github-repo-picker-Bc5KArQ0.js +1 -0
  107. package/dist/client/assets/{hooks-GnFkomrq.js → hooks-pnrq3avL.js} +1 -1
  108. package/dist/client/assets/{index-0yvnZiwb.js → index-47mQkAxc.js} +1 -1
  109. package/dist/client/assets/{index-CCnsgP9d.js → index-B6vBs0RJ.js} +5 -5
  110. package/dist/client/assets/index-Bjoka7jJ.js +1 -0
  111. package/dist/client/assets/{index-DPzJsdBC.js → index-C-QXvkc1.js} +1 -1
  112. package/dist/client/assets/{index-Dv19SgJH.js → index-CBuBybHp.js} +28 -28
  113. package/dist/client/assets/{index-MwzluG1w.js → index-CI_dJNCw.js} +1 -1
  114. package/dist/client/assets/{index-DS3hrf0F.js → index-CX5pjTTE.js} +1 -1
  115. package/dist/client/assets/{index-Cim2j5YD.js → index-CYRx6VZs.js} +1 -1
  116. package/dist/client/assets/index-Ct4UCmlw.css +1 -0
  117. package/dist/client/assets/{index-Cyr1IOqy.js → index-D6481a7y.js} +1 -1
  118. package/dist/client/assets/index-DEFe_Ioe.js +1 -0
  119. package/dist/client/assets/index-Dw17x_vM.js +1 -0
  120. package/dist/client/assets/{index-BraRl60q.js → index-ZeEdh6la.js} +1 -1
  121. package/dist/client/assets/index-ho6IJJiJ.js +1 -0
  122. package/dist/client/assets/{index-redirect-Hp_EA6DJ.js → index-redirect-CId9LITt.js} +1 -1
  123. package/dist/client/assets/{index-CsZhMKFM.js → index-v1F20B0E.js} +26 -26
  124. package/dist/client/assets/{input-D5ccsU_1.js → input-DoMDIxWk.js} +1 -1
  125. package/dist/client/assets/{integration-icon-6pGkEdul.js → integration-icon-NHRUL2M2.js} +1 -1
  126. package/dist/client/assets/invite-member-dialog-DPbJQBPO.js +3 -0
  127. package/dist/client/assets/{label-BULuaMoF.js → label-BRpUtjMO.js} +1 -1
  128. package/dist/client/assets/{layout-BloKJFhD.js → layout-YL1-WGtk.js} +1 -1
  129. package/dist/client/assets/{login-Dzlh5qYT.js → login-mI70aY7y.js} +1 -1
  130. package/dist/client/assets/{mcp-oauth-z9GFPjDo.js → mcp-oauth-BhDqbGNe.js} +1 -1
  131. package/dist/client/assets/members-CcmOVZeT.js +1 -0
  132. package/dist/client/assets/{monaco-editor-CiP0ChuC.js → monaco-editor-CN68a7_6.js} +1 -1
  133. package/dist/client/assets/{monitoring-stats-row-CLHK9ypI.js → monitoring-stats-row-g88EsnKJ.js} +3 -3
  134. package/dist/client/assets/{oauth-callback-CdWGFVi8.js → oauth-callback-Dxm8R7-5.js} +1 -1
  135. package/dist/client/assets/{oauth-callback-ai-provider-qp9LO32T.js → oauth-callback-ai-provider-DoOKE-xx.js} +1 -1
  136. package/dist/client/assets/{onboarding-iL9ZeHnE.js → onboarding-B1NNpnvc.js} +1 -1
  137. package/dist/client/assets/{org-install-ZxTYabEU.js → org-install-BGV7QX9d.js} +1 -1
  138. package/dist/client/assets/{org-layout-DWaUEBqs.js → org-layout-e4sSXc2-.js} +1 -1
  139. package/dist/client/assets/{organization-choice-5GYvmez0.js → organization-choice-MatHTHWS.js} +1 -1
  140. package/dist/client/assets/{orgs-CRRA1WCm.js → orgs-DyYyghqa.js} +1 -1
  141. package/dist/client/assets/{page-seo-form-C4SLs6YG.js → page-seo-form-BdXxVdKh.js} +1 -1
  142. package/dist/client/assets/page-seo-sheet-iRiW3JQ1.js +1 -0
  143. package/dist/client/assets/{popover-C5PoRwEk.js → popover-BhTglK_V.js} +1 -1
  144. package/dist/client/assets/post-editor-BhXErJkg.js +1 -0
  145. package/dist/client/assets/{primitives-BEmjSMO9.js → primitives-ENZTjlku.js} +1 -1
  146. package/dist/client/assets/profile-C8J4RX1p.js +1 -0
  147. package/dist/client/assets/project-app-view-CLqEVreP.js +1 -0
  148. package/dist/client/assets/record-editor-CHvIMmJ7.js +1 -0
  149. package/dist/client/assets/registry-CmtvdFTb.js +2 -0
  150. package/dist/client/assets/{registry-layout-BDNmgEhN.js → registry-layout-DFPPdTUd.js} +4 -4
  151. package/dist/client/assets/{reports-C6ascunL.js → reports-B3Fg6jp_.js} +1 -1
  152. package/dist/client/assets/{require-capability-BjscC7QS.js → require-capability-D-A54-k8.js} +1 -1
  153. package/dist/client/assets/{required-auth-layout-R2McgzF5.js → required-auth-layout-LPVLIFMc.js} +1 -1
  154. package/dist/client/assets/{reset-password-Fw4tx_9w.js → reset-password-CVjmIBh9.js} +1 -1
  155. package/dist/client/assets/roles-BxJj-xe3.js +1 -0
  156. package/dist/client/assets/{search-input-BREJK7qA.js → search-input-B7l4w6Nk.js} +1 -1
  157. package/dist/client/assets/secrets-9rA0Xv9T.js +1 -0
  158. package/dist/client/assets/{sections-editor-CKmy6jCA.js → sections-editor-bOiVAtcG.js} +1 -1
  159. package/dist/client/assets/{select-CVMXwLRV.js → select-DJ-xJfBd.js} +1 -1
  160. package/dist/client/assets/{select-model-Cg3FzUNI.js → select-model-wshUAo0W.js} +1 -1
  161. package/dist/client/assets/self-tool-result-BJKZmspV.js +1 -0
  162. package/dist/client/assets/seo-editor-3ntseOCn.js +1 -0
  163. package/dist/client/assets/settings-layout-B8wOMjDB.js +1 -0
  164. package/dist/client/assets/{settings-section-BYCtjEaG.js → settings-section-C6yf8yzB.js} +1 -1
  165. package/dist/client/assets/{shell-controls-Daj0PZIQ.js → shell-controls-BZMA1sGn.js} +1 -1
  166. package/dist/client/assets/shell-layout-CDHmuxZH.js +1 -0
  167. package/dist/client/assets/sidebar-DMHBEB3a.js +1 -0
  168. package/dist/client/assets/{skeleton-BZzqWIif.js → skeleton-CYnpNimL.js} +1 -1
  169. package/dist/client/assets/sso-BzMLp8-J.js +1 -0
  170. package/dist/client/assets/store-BOc0PBwD.js +1 -0
  171. package/dist/client/assets/store-registry-DIdlXcXO.js +2 -0
  172. package/dist/client/assets/studio-tools-Dta_1_QR.js +1 -0
  173. package/dist/client/assets/{switch-B36ltQ63.js → switch-CxGmjhpb.js} +1 -1
  174. package/dist/client/assets/{table-CLRsCUXA.js → table-IyQgqCyJ.js} +1 -1
  175. package/dist/client/assets/{tabs-BoNNus4B.js → tabs-DJSveVrG.js} +1 -1
  176. package/dist/client/assets/{textarea-DPLwPKZJ.js → textarea-D5CZ7ZsG.js} +1 -1
  177. package/dist/client/assets/{toggle-group-DkGsY2u-.js → toggle-group-TzWGQhcY.js} +1 -1
  178. package/dist/client/assets/{toolbar-CedVmC1P.js → toolbar-DT9Q65OX.js} +1 -1
  179. package/dist/client/assets/{toolbar-icon-button-5fStNBy9.js → toolbar-icon-button-DCDLCG5U.js} +1 -1
  180. package/dist/client/assets/tools-list-CnR-7U8Q.js +1 -0
  181. package/dist/client/assets/{tooltip-Cs5hng3q.js → tooltip-CwWmycdW.js} +1 -1
  182. package/dist/client/assets/use-ai-providers-jn20SAL8.js +1 -0
  183. package/dist/client/assets/use-automations-BBihr9dY.js +1 -0
  184. package/dist/client/assets/use-capability-CXLvhLL0.js +1 -0
  185. package/dist/client/assets/{use-clock-tick-CB7NlnVZ.js → use-clock-tick-GG7JJthC.js} +1 -1
  186. package/dist/client/assets/{use-collections-Cl7KVWNQ.js → use-collections-Bw1ej6HH.js} +1 -1
  187. package/dist/client/assets/use-connection-DivkmGF9.js +1 -0
  188. package/dist/client/assets/{use-copy-B-pxrD6E.js → use-copy-CciEBKiS.js} +1 -1
  189. package/dist/client/assets/{use-create-virtual-mcp-DPkT8FPW.js → use-create-virtual-mcp-DkjEcux9.js} +1 -1
  190. package/dist/client/assets/{use-debounced-autosave-teletZQd.js → use-debounced-autosave-0ivINAXf.js} +1 -1
  191. package/dist/client/assets/{use-debounced-value-ChKSUuxz.js → use-debounced-value-D_iu4VB9.js} +1 -1
  192. package/dist/client/assets/use-deco-credits-D2VFeHYN.js +1 -0
  193. package/dist/client/assets/{use-decopilot-events-CWf9qNc0.js → use-decopilot-events-BT5pbFoO.js} +1 -1
  194. package/dist/client/assets/use-delete-connection-j9ShOV4G.js +1 -0
  195. package/dist/client/assets/{use-deployment-admin-C3JCAXzA.js → use-deployment-admin-EW9j2pmW.js} +1 -1
  196. package/dist/client/assets/use-file-configs-CZB3TWDj.js +1 -0
  197. package/dist/client/assets/use-infinite-scroll-DRJmUT_7.js +1 -0
  198. package/dist/client/assets/use-join-requests-DojedTk5.js +1 -0
  199. package/dist/client/assets/{use-mcp-client-Bv8WGceO.js → use-mcp-client-BmyqfqxQ.js} +4 -4
  200. package/dist/client/assets/{use-mcp-tools-_p3Gu3UX.js → use-mcp-tools-BH7UZO6u.js} +1 -1
  201. package/dist/client/assets/use-members-B9xQq8Nf.js +1 -0
  202. package/dist/client/assets/{use-mobile-DhhfLpzh.js → use-mobile-Dyi4jnPJ.js} +1 -1
  203. package/dist/client/assets/use-navigate-to-agent-CXN_R57g.js +1 -0
  204. package/dist/client/assets/use-org-auth-client-DvR9aTwL.js +1 -0
  205. package/dist/client/assets/{use-org-sso-DDm0m5Eb.js → use-org-sso-BpWCWfK7.js} +1 -1
  206. package/dist/client/assets/use-organization-roles-DrGTxpZM.js +1 -0
  207. package/dist/client/assets/use-organization-settings-JlbwL6sx.js +1 -0
  208. package/dist/client/assets/use-registry-connections-DlCFmIUa.js +1 -0
  209. package/dist/client/assets/use-secrets-CZWYXwBu.js +1 -0
  210. package/dist/client/assets/use-status-sounds-Bw2veslR.js +1 -0
  211. package/dist/client/assets/{use-view-mode-H6oFviHU.js → use-view-mode-_M46l8bo.js} +1 -1
  212. package/dist/client/assets/use-virtual-mcp-pJk84Xzr.js +1 -0
  213. package/dist/client/assets/useInfiniteQuery-DKESjHh5.js +1 -0
  214. package/dist/client/assets/{useRouterState-DjtN_ggp.js → useRouterState-BVrfD4QF.js} +1 -1
  215. package/dist/client/assets/useSuspenseInfiniteQuery-DLe2YLWa.js +1 -0
  216. package/dist/client/assets/{users-CwhV7o0r.js → users-BFk7oxwk.js} +1 -1
  217. package/dist/client/assets/variant-calendar-BFmG35Fm.js +1 -0
  218. package/dist/client/assets/{view-mode-toggle-DovE7i8d.js → view-mode-toggle-GXZBM6av.js} +1 -1
  219. package/dist/client/index.html +2 -2
  220. package/dist/server/cli.js +605 -601
  221. package/dist/server/migrate.js +75 -75
  222. package/dist/server/server.js +383 -379
  223. package/package.json +1 -1
  224. package/dist/client/assets/Loading02-Dx-xiZND.js +0 -1
  225. package/dist/client/assets/agent-icon-dPkJbbXq.js +0 -1
  226. package/dist/client/assets/agents-list-CBbQQUEx.js +0 -1
  227. package/dist/client/assets/ai-providers-CeevjV97.js +0 -1
  228. package/dist/client/assets/app-editor-CC9wPnl_.js +0 -1
  229. package/dist/client/assets/auth-entry-Bo3LWJI9.js +0 -1
  230. package/dist/client/assets/automations-DDTM3E3g.js +0 -1
  231. package/dist/client/assets/brand-context-Bkaj5nz3.js +0 -1
  232. package/dist/client/assets/bulk-category-panel-C3pu2Jik.js +0 -1
  233. package/dist/client/assets/calendar-Io_vhk-a.js +0 -1
  234. package/dist/client/assets/capability-load-error-COzn8-Xb.js +0 -1
  235. package/dist/client/assets/category-editor-C1FxzSFF.js +0 -1
  236. package/dist/client/assets/collection-detail-CcnshY5k.js +0 -1
  237. package/dist/client/assets/commerce-onboarding-v6NmdNz5.js +0 -1
  238. package/dist/client/assets/connection-card-CXwWR_5h.js +0 -1
  239. package/dist/client/assets/connection-detail-B_tl4TZx.js +0 -1
  240. package/dist/client/assets/connections-C1NH7yoX.js +0 -1
  241. package/dist/client/assets/constants-CaIX_f5U.js +0 -1
  242. package/dist/client/assets/decopilot-sse-pool-CJtSg3wj.js +0 -1
  243. package/dist/client/assets/dialog-DZtdYFi_.js +0 -1
  244. package/dist/client/assets/domain-settings-C7CfCyw6.js +0 -1
  245. package/dist/client/assets/file-explorer-CMqCjVts.js +0 -2
  246. package/dist/client/assets/general-XFvP4tXw.js +0 -1
  247. package/dist/client/assets/github-repo-picker-VDMXf52q.js +0 -1
  248. package/dist/client/assets/index-CEI6wi5Z.js +0 -1
  249. package/dist/client/assets/index-DFCCfX3B.js +0 -1
  250. package/dist/client/assets/index-DKyQrM3l.js +0 -1
  251. package/dist/client/assets/index-DPKpPAQv.js +0 -1
  252. package/dist/client/assets/index-DhnTILyr.css +0 -1
  253. package/dist/client/assets/invite-member-dialog-DV_-RNy8.js +0 -3
  254. package/dist/client/assets/members-BfULkB51.js +0 -1
  255. package/dist/client/assets/page-seo-sheet-CqzS0lEJ.js +0 -1
  256. package/dist/client/assets/post-editor-DQzYF8Ef.js +0 -1
  257. package/dist/client/assets/profile-Dh73-0Iy.js +0 -1
  258. package/dist/client/assets/project-app-view-KN05BOuo.js +0 -1
  259. package/dist/client/assets/record-editor-BGeMoeUP.js +0 -1
  260. package/dist/client/assets/registry-DGAgXfxF.js +0 -2
  261. package/dist/client/assets/roles-D6vLw9pS.js +0 -1
  262. package/dist/client/assets/secrets-B2rqgV3S.js +0 -1
  263. package/dist/client/assets/seo-editor-DVVtxnZN.js +0 -1
  264. package/dist/client/assets/settings-layout-CS4A10kE.js +0 -1
  265. package/dist/client/assets/shell-layout-Bi4LjwsI.js +0 -1
  266. package/dist/client/assets/sidebar-DRSu2iBz.js +0 -1
  267. package/dist/client/assets/sso-C6uqUsih.js +0 -1
  268. package/dist/client/assets/store-BZ7eoytz.js +0 -1
  269. package/dist/client/assets/store-registry-DA7t2U9g.js +0 -2
  270. package/dist/client/assets/studio-tools-CTswP4mA.js +0 -1
  271. package/dist/client/assets/tools-list-DyAKlhYk.js +0 -1
  272. package/dist/client/assets/use-ai-providers-D77UFwvU.js +0 -1
  273. package/dist/client/assets/use-automations-WNGih4F_.js +0 -1
  274. package/dist/client/assets/use-capability-DmeYLlad.js +0 -1
  275. package/dist/client/assets/use-connection-CcLotHiI.js +0 -1
  276. package/dist/client/assets/use-deco-credits-1Xd5keqC.js +0 -1
  277. package/dist/client/assets/use-delete-connection-BJuEHINL.js +0 -1
  278. package/dist/client/assets/use-file-configs-G_3bUBDS.js +0 -1
  279. package/dist/client/assets/use-infinite-scroll-BTdf9pFZ.js +0 -1
  280. package/dist/client/assets/use-join-requests-NgN8gue3.js +0 -1
  281. package/dist/client/assets/use-members-eaM3vNiv.js +0 -1
  282. package/dist/client/assets/use-navigate-to-agent-BsdctirU.js +0 -1
  283. package/dist/client/assets/use-org-auth-client-DYoTiK8H.js +0 -1
  284. package/dist/client/assets/use-organization-roles-CcwnCugJ.js +0 -1
  285. package/dist/client/assets/use-organization-settings-C4hP3pVq.js +0 -1
  286. package/dist/client/assets/use-registry-connections-xg-zrNmx.js +0 -1
  287. package/dist/client/assets/use-secrets-CdGKHqA-.js +0 -1
  288. package/dist/client/assets/use-status-sounds-Uz1qdvt2.js +0 -1
  289. package/dist/client/assets/use-virtual-mcp-CMvxAHEJ.js +0 -1
  290. package/dist/client/assets/useInfiniteQuery-BosqZeNZ.js +0 -1
  291. package/dist/client/assets/useSuspenseInfiniteQuery-Dh0QZdLF.js +0 -1
  292. package/dist/client/assets/variant-calendar-5liHDWH_.js +0 -1
@@ -1,4 +1,4 @@
1
- import{r as $,as as nt,c as B,j as s,H as Re,I as ae,a4 as oe,n as pe,J as Le,M as Pe,d as fe,K as te,t as Z,B as ee,R as J,a1 as ot,l as ne,m as rt,b as at,U as ct,$ as dt}from"./index-CsZhMKFM.js";import{c as $e,e as De,d as Fe,D as ut,a as Ke,f as mt,b as ft}from"./dialog-DZtdYFi_.js";import{g as ht,b as pt,a as xt,D as gt}from"./drawer-Ck_Oak77.js";import{u as vt}from"./use-mobile-DhhfLpzh.js";import{S as ye,u as bt,m as jt,a as xe}from"./chat-context-Awe2cIoY.js";import{C as yt}from"./checkbox-B-y-IHdE.js";import{I as le}from"./input-D5ccsU_1.js";import{S as St,a as kt,b as Nt,c as Ct,d as wt}from"./select-CVMXwLRV.js";import{S as X}from"./skeleton-BZzqWIif.js";import{i as Ue,b as Be,c as _t,a as It,s as Mt}from"./Settings02-CS2jOfO5.js";import{d as Ot,a as Et,b as Tt,i as At}from"./Tool01-DVCGutKV.js";import{i as zt}from"./Key01-1r4YrQER.js";import{i as We}from"./SearchMd-ZfoTl6vw.js";import{b as ge,u as Rt,a as Lt}from"./use-ai-providers-D77UFwvU.js";import{g as ve}from"./ai-providers-logos-DD3qZ33J.js";import{i as Pt}from"./Monitor01-D_DrBwt_.js";import{i as $t}from"./AlertCircle-BsA2wZmN.js";import{u as he}from"./studio-tools-CTswP4mA.js";import{i as Dt}from"./ChevronRight-C3Tgk-3m.js";import{A as Ft}from"./avatar-DOYkgu8W.js";import{S as Se,a as ke,b as He}from"./settings-section-BYCtjEaG.js";import{s as Ve}from"./Eye-DM8bmzm7.js";import{a as ue,b as me,C as Kt}from"./connect-desktop-dialog-DiutLBhU.js";import{t as Ne}from"./ChevronDown-BmFaSDo8.js";import{t as Ut}from"./Stars01-BEHbN5c3.js";function ie(i,e,t){let l=t.initialDeps??[],n,o=!0;function r(){var a,c,d;let u;t.key&&((a=t.debug)!=null&&a.call(t))&&(u=Date.now());const m=i();if(!(m.length!==l.length||m.some((g,x)=>l[x]!==g)))return n;l=m;let f;if(t.key&&((c=t.debug)!=null&&c.call(t))&&(f=Date.now()),n=e(...m),t.key&&((d=t.debug)!=null&&d.call(t))){const g=Math.round((Date.now()-u)*100)/100,x=Math.round((Date.now()-f)*100)/100,j=x/16,k=(w,_)=>{for(w=String(w);w.length<_;)w=" "+w;return w};console.info(`%c⏱ ${k(x,5)} /${k(g,5)} ms`,`
1
+ import{r as $,at as nt,c as B,j as s,H as Re,I as ae,C as oe,n as pe,J as Le,M as Pe,d as fe,K as te,t as Z,B as ee,p as J,z as ot,l as ne,m as rt,b as at,E as ct,x as dt}from"./index-v1F20B0E.js";import{c as $e,e as De,d as Fe,D as ut,a as Ke,h as mt,b as ft}from"./dialog-BzVEcj79.js";import{g as ht,b as pt,a as xt,D as gt}from"./drawer-DTss_--q.js";import{u as vt}from"./use-mobile-Dyi4jnPJ.js";import{S as ye,u as bt,m as jt,a as xe}from"./chat-context-Iman-MuU.js";import{C as yt}from"./checkbox-BvCpvEfo.js";import{I as le}from"./input-DoMDIxWk.js";import{S as St,a as kt,b as Nt,c as Ct,d as wt}from"./select-DJ-xJfBd.js";import{S as X}from"./skeleton-CYnpNimL.js";import{i as Ue,b as Be,c as _t,a as It,s as Mt}from"./Settings02-BQIcnVua.js";import{d as Ot,a as Et,b as Tt,i as At}from"./Tool01-Beyaqvxk.js";import{i as zt}from"./Key01-CxVX_Pbg.js";import{i as We}from"./SearchMd-D4gbfQvO.js";import{b as ge,u as Rt,a as Lt}from"./use-ai-providers-jn20SAL8.js";import{g as ve}from"./ai-providers-logos-DD3qZ33J.js";import{i as Pt}from"./Monitor01-8E0Kd0bb.js";import{i as $t}from"./AlertCircle-BkrprcoF.js";import{u as he}from"./studio-tools-Dta_1_QR.js";import{i as Dt}from"./ChevronRight-Cku8WSiq.js";import{A as Ft}from"./avatar-CEhTtT5Z.js";import{S as Se,a as ke,b as He}from"./settings-section-C6yf8yzB.js";import{s as Ve}from"./Eye-Bz-yLlBh.js";import{a as ue,b as me,C as Kt}from"./connect-desktop-dialog-DWRyRSkj.js";import{t as Ne}from"./ChevronDown-DDDop4Os.js";import{t as Ut}from"./Stars01-COCvCNwS.js";function ie(i,e,t){let l=t.initialDeps??[],n,o=!0;function r(){var a,c,d;let u;t.key&&((a=t.debug)!=null&&a.call(t))&&(u=Date.now());const m=i();if(!(m.length!==l.length||m.some((g,x)=>l[x]!==g)))return n;l=m;let f;if(t.key&&((c=t.debug)!=null&&c.call(t))&&(f=Date.now()),n=e(...m),t.key&&((d=t.debug)!=null&&d.call(t))){const g=Math.round((Date.now()-u)*100)/100,x=Math.round((Date.now()-f)*100)/100,j=x/16,k=(w,_)=>{for(w=String(w);w.length<_;)w=" "+w;return w};console.info(`%c⏱ ${k(x,5)} /${k(g,5)} ms`,`
2
2
  font-size: .6rem;
3
3
  font-weight: bold;
4
4
  color: hsl(${Math.max(0,Math.min(120-120*j,120))}deg 100% 31%);`,t?.key)}return t?.onChange&&!(o&&t.skipInitialOnChange)&&t.onChange(n),o=!1,n}return r.updateDeps=a=>{l=a},r}function Ce(i,e){if(i===void 0)throw new Error("Unexpected undefined");return i}const Bt=(i,e)=>Math.abs(i-e)<1.01,Wt=(i,e,t)=>{let l;return function(...n){i.clearTimeout(l),l=i.setTimeout(()=>e.apply(this,n),t)}},we=i=>{const{offsetWidth:e,offsetHeight:t}=i;return{width:e,height:t}},Ht=i=>i,Vt=i=>{const e=Math.max(i.startIndex-i.overscan,0),t=Math.min(i.endIndex+i.overscan,i.count-1),l=[];for(let n=e;n<=t;n++)l.push(n);return l},qt=(i,e)=>{const t=i.scrollElement;if(!t)return;const l=i.targetWindow;if(!l)return;const n=r=>{const{width:a,height:c}=r;e({width:Math.round(a),height:Math.round(c)})};if(n(we(t)),!l.ResizeObserver)return()=>{};const o=new l.ResizeObserver(r=>{const a=()=>{const c=r[0];if(c?.borderBoxSize){const d=c.borderBoxSize[0];if(d){n({width:d.inlineSize,height:d.blockSize});return}}n(we(t))};i.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return o.observe(t,{box:"border-box"}),()=>{o.unobserve(t)}},_e={passive:!0},Ie=typeof window>"u"?!0:"onscrollend"in window,Gt=(i,e)=>{const t=i.scrollElement;if(!t)return;const l=i.targetWindow;if(!l)return;let n=0;const o=i.options.useScrollendEvent&&Ie?()=>{}:Wt(l,()=>{e(n,!1)},i.options.isScrollingResetDelay),r=u=>()=>{const{horizontal:m,isRtl:p}=i.options;n=m?t.scrollLeft*(p&&-1||1):t.scrollTop,o(),e(n,u)},a=r(!0),c=r(!1);t.addEventListener("scroll",a,_e);const d=i.options.useScrollendEvent&&Ie;return d&&t.addEventListener("scrollend",c,_e),()=>{t.removeEventListener("scroll",a),d&&t.removeEventListener("scrollend",c)}},Xt=(i,e,t)=>{if(e?.borderBoxSize){const l=e.borderBoxSize[0];if(l)return Math.round(l[t.options.horizontal?"inlineSize":"blockSize"])}return i[t.options.horizontal?"offsetWidth":"offsetHeight"]},Yt=(i,{adjustments:e=0,behavior:t},l)=>{var n,o;const r=i+e;(o=(n=l.scrollElement)==null?void 0:n.scrollTo)==null||o.call(n,{[l.options.horizontal?"left":"top"]:r,behavior:t})};class Qt{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var t,l,n;return((n=(l=(t=this.targetWindow)==null?void 0:t.performance)==null?void 0:l.now)==null?void 0:n.call(l))??Date.now()},this.observer=(()=>{let t=null;const l=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(n=>{n.forEach(o=>{const r=()=>{const a=o.target,c=this.indexFromElement(a);if(!a.isConnected){this.observer.unobserve(a);return}this.shouldMeasureDuringScroll(c)&&this.resizeItem(c,this.options.measureElement(a,o,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()})}));return{disconnect:()=>{var n;(n=l())==null||n.disconnect(),t=null},observe:n=>{var o;return(o=l())==null?void 0:o.observe(n,{box:"border-box"})},unobserve:n=>{var o;return(o=l())==null?void 0:o.unobserve(n)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([l,n])=>{typeof n>"u"&&delete t[l]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Ht,rangeExtractor:Vt,onChange:()=>{},measureElement:Xt,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",...t}},this.notify=t=>{var l,n;(n=(l=this.options).onChange)==null||n.call(l,this,t)},this.maybeNotify=ie(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const l=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==l){if(this.cleanup(),!l){this.maybeNotify();return}this.scrollElement=l,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(n=>{this.observer.observe(n)}),this.unsubs.push(this.options.observeElementRect(this,n=>{this.scrollRect=n,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(n,o)=>{this.scrollAdjustments=0,this.scrollDirection=o?this.getScrollOffset()<n?"forward":"backward":null,this.scrollOffset=n,this.isScrolling=o,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(t,l)=>{const n=new Map,o=new Map;for(let r=l-1;r>=0;r--){const a=t[r];if(n.has(a.lane))continue;const c=o.get(a.lane);if(c==null||a.end>c.end?o.set(a.lane,a):a.end<c.end&&n.set(a.lane,!0),n.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((r,a)=>r.end===a.end?r.index-a.index:r.end-a.end)[0]:void 0},this.getMeasurementOptions=ie(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(t,l,n,o,r,a,c)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:l,scrollMargin:n,getItemKey:o,enabled:r,lanes:a,laneAssignmentMode:c}),{key:!1}),this.getMeasurements=ie(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:l,scrollMargin:n,getItemKey:o,enabled:r,lanes:a,laneAssignmentMode:c},d)=>{if(!r)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const f of this.laneAssignments.keys())f>=t&&this.laneAssignments.delete(f);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(f=>{this.itemSizeCache.set(f.key,f.size)}));const u=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1);const m=this.measurementsCache.slice(0,u),p=new Array(a).fill(void 0);for(let f=0;f<u;f++){const g=m[f];g&&(p[g.lane]=f)}for(let f=u;f<t;f++){const g=o(f),x=this.laneAssignments.get(f);let j,k;const w=c==="estimate"||d.has(g);if(x!==void 0&&this.options.lanes>1){j=x;const b=p[j],N=b!==void 0?m[b]:void 0;k=N?N.end+this.options.gap:l+n}else{const b=this.options.lanes===1?m[f-1]:this.getFurthestMeasurement(m,f);k=b?b.end+this.options.gap:l+n,j=b?b.lane:f%this.options.lanes,this.options.lanes>1&&w&&this.laneAssignments.set(f,j)}const _=d.get(g),I=typeof _=="number"?_:this.options.estimateSize(f),M=k+I;m[f]={index:f,start:k,size:I,end:M,key:g,lane:j},p[j]=f}return this.measurementsCache=m,m},{key:!1,debug:()=>this.options.debug}),this.calculateRange=ie(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,l,n,o)=>this.range=t.length>0&&l>0?Jt({measurements:t,outerSize:l,scrollOffset:n,lanes:o}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=ie(()=>{let t=null,l=null;const n=this.calculateRange();return n&&(t=n.startIndex,l=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,l]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,l]},(t,l,n,o,r)=>o===null||r===null?[]:t({startIndex:o,endIndex:r,overscan:l,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const l=this.options.indexAttribute,n=t.getAttribute(l);return n?parseInt(n,10):(console.warn(`Missing attribute name '${l}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=t=>{var l;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const n=this.scrollState.index??((l=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:l.index);if(n!==void 0&&this.range){const o=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,n-o),a=Math.min(this.options.count-1,n+o);return t>=r&&t<=a}return!0},this.measureElement=t=>{if(!t){this.elementsCache.forEach((r,a)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(a))});return}const l=this.indexFromElement(t),n=this.options.getItemKey(l),o=this.elementsCache.get(n);o!==t&&(o&&this.observer.unobserve(o),this.observer.observe(t),this.elementsCache.set(n,t)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(l)&&this.resizeItem(l,this.options.measureElement(t,void 0,this))},this.resizeItem=(t,l)=>{var n;const o=this.measurementsCache[t];if(!o)return;const r=this.itemSizeCache.get(o.key)??o.size,a=l-r;a!==0&&(((n=this.scrollState)==null?void 0:n.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(o,a,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,l)),this.notify(!1))},this.getVirtualItems=ie(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,l)=>{const n=[];for(let o=0,r=t.length;o<r;o++){const a=t[o],c=l[a];n.push(c)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const l=this.getMeasurements();if(l.length!==0)return Ce(l[qe(0,l.length-1,n=>Ce(l[n]).start,t)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(t,l,n=0)=>{if(!this.scrollElement)return 0;const o=this.getSize(),r=this.getScrollOffset();l==="auto"&&(l=t>=r+o?"end":"start"),l==="center"?t+=(n-o)/2:l==="end"&&(t-=o);const a=this.getMaxScrollOffset();return Math.max(Math.min(a,t),0)},this.getOffsetForIndex=(t,l="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const n=this.getSize(),o=this.getScrollOffset(),r=this.measurementsCache[t];if(!r)return;if(l==="auto")if(r.end>=o+n-this.options.scrollPaddingEnd)l="end";else if(r.start<=o+this.options.scrollPaddingStart)l="start";else return[o,l];if(l==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),l];const a=l==="end"?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,l,r.size),l]},this.scrollToOffset=(t,{align:l="start",behavior:n="auto"}={})=>{const o=this.getOffsetForAlignment(t,l),r=this.now();this.scrollState={index:null,align:l,behavior:n,startedAt:r,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(t,{align:l="auto",behavior:n="auto"}={})=>{t=Math.max(0,Math.min(t,this.options.count-1));const o=this.getOffsetForIndex(t,l);if(!o)return;const[r,a]=o,c=this.now();this.scrollState={index:t,align:a,behavior:n,startedAt:c,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(t,{behavior:l="auto"}={})=>{const n=this.getScrollOffset()+t,o=this.now();this.scrollState={index:null,align:"start",behavior:l,startedAt:o,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:l}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var t;const l=this.getMeasurements();let n;if(l.length===0)n=this.options.paddingStart;else if(this.options.lanes===1)n=((t=l[l.length-1])==null?void 0:t.end)??0;else{const o=Array(this.options.lanes).fill(null);let r=l.length-1;for(;r>=0&&o.some(a=>a===null);){const a=l[r];o[a.lane]===null&&(o[a.lane]=a.end),r--}n=Math.max(...o.filter(a=>a!==null))}return Math.max(n-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:l,behavior:n})=>{this.options.scrollToFn(t,{behavior:n,adjustments:l},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(e)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const l=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,n=l?l[0]:this.scrollState.lastTargetOffset,o=1,r=n!==this.scrollState.lastTargetOffset;if(!r&&Bt(n,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=o){this.scrollState=null;return}}else this.scrollState.stableFrames=0,r&&(this.scrollState.lastTargetOffset=n,this.scrollState.behavior="auto",this._scrollToOffset(n,{adjustments:void 0,behavior:"auto"}));this.scheduleScrollReconcile()}}const qe=(i,e,t,l)=>{for(;i<=e;){const n=(i+e)/2|0,o=t(n);if(o<l)i=n+1;else if(o>l)e=n-1;else return n}return i>0?i-1:0};function Jt({measurements:i,outerSize:e,scrollOffset:t,lanes:l}){const n=i.length-1,o=c=>i[c].start;if(i.length<=l)return{startIndex:0,endIndex:n};let r=qe(0,n,o,t),a=r;if(l===1)for(;a<n&&i[a].end<t+e;)a++;else if(l>1){const c=Array(l).fill(0);for(;a<n&&c.some(u=>u<t+e);){const u=i[a];c[u.lane]=u.end,a++}const d=Array(l).fill(t+e);for(;r>=0&&d.some(u=>u>=t);){const u=i[r];d[u.lane]=u.start,r--}r=Math.max(0,r-r%l),a=Math.min(n,a+(l-1-a%l))}return{startIndex:r,endIndex:a}}const Me=typeof document<"u"?$.useLayoutEffect:$.useEffect;function Zt({useFlushSync:i=!0,...e}){const t=$.useReducer(()=>({}),{})[1],l={...e,onChange:(o,r)=>{var a;i&&r?nt.flushSync(t):t(),(a=e.onChange)==null||a.call(e,o,r)}},[n]=$.useState(()=>new Qt(l));return n.setOptions(l),Me(()=>n._didMount(),[]),Me(()=>n._willUpdate()),n}function es(i){return Zt({observeElementRect:qt,observeElementOffset:Gt,scrollToFn:Yt,...i})}const ce=[{id:"openai",name:"OpenAI",description:"GPT-4, GPT-5, and other OpenAI models",logo:"https://decoims.com/decocms/b51001ef-ae58-4db4-8a75-9e6d2df2dd8e/openai.png",baseUrlPlaceholder:"https://api.openai.com/v1",defaultBaseUrl:"https://api.openai.com/v1",apiKeyRecommended:!0,helpText:"Use your OpenAI API key (starts with sk-)."},{id:"litellm",name:"LiteLLM",description:"Connect to a LiteLLM gateway your team manages",logo:"https://decoims.com/decocms/e974ae05-ad64-4b4a-8444-d9705f019b85/litellm.png",baseUrlPlaceholder:"http://localhost:4000",apiKeyRecommended:!0,helpText:"Point at your LiteLLM proxy. The base URL should be the root of the proxy (we'll append /v1)."},{id:"ollama",name:"Ollama",description:"Run open-source models on your own computer",logo:"https://decoims.com/decocms/2bb2f822-5288-4b7c-a541-dcbef76525a0/ollama.png",baseUrlPlaceholder:"http://localhost:11434",apiKeyRecommended:!1,helpText:"Ollama exposes /v1 by default — no API key required for local use."},{id:"lm-studio",name:"LM Studio",description:"Open models running through LM Studio",logo:"https://decoims.com/decocms/9f0ab1a9-d2d5-4f3e-9de0-aadd4926428d/lmstudio.webp",baseUrlPlaceholder:"http://localhost:1234",apiKeyRecommended:!1,helpText:"Start the local server in LM Studio, then paste its base URL here."},{id:"vllm",name:"vLLM",description:"Connect to your team's self-hosted vLLM server",logo:"https://decoims.com/decocms/b6c60e4f-a4aa-443c-981f-ad0f31640e22/vllm.png",baseUrlPlaceholder:"http://localhost:8000",apiKeyRecommended:!1}];function Oe(i){if(i)return ce.find(e=>e.id===i)}const Ee=4;function re(i){const e=B.c(8),{logo:t,name:l,description:n,onClick:o}=i;let r;e[0]!==t||e[1]!==l?(r=t?s.jsx("img",{src:t,alt:l,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(Ft,{fallback:l.charAt(0),className:"size-8 bg-primary/10 text-primary"}),e[0]=t,e[1]=l,e[2]=r):r=e[2];let a;return e[3]!==n||e[4]!==l||e[5]!==o||e[6]!==r?(a=s.jsx(He,{onClick:o,icon:r,title:l,description:n}),e[3]=n,e[4]=l,e[5]=o,e[6]=r,e[7]=a):a=e[7],a}function Ge(i){const e=B.c(32),{providers:t,onSelect:l,onShowAll:n}=i;let o;e[0]!==t?(o=t.find(ns),e[0]=t,e[1]=o):o=e[1];const r=o;let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a={openrouter:0,llmapi:1,anthropic:2,google:3},e[2]=a):a=e[2];const c=a;let d;if(e[3]!==l||e[4]!==t){let _;e[6]===Symbol.for("react.memo_cache_sentinel")?(_=(v,O)=>{const T=c[v.id]??Number.MAX_SAFE_INTEGER,A=c[O.id]??Number.MAX_SAFE_INTEGER;return T-A},e[6]=_):_=e[6];const I=t.filter(ls).sort(_);let M;e[7]!==t?(M=t.find(is),e[7]=t,e[8]=M):M=e[8];const b=M;let N;e[9]===Symbol.for("react.memo_cache_sentinel")?(N=ce.find(ss),e[9]=N):N=e[9];const S=N;let C;e[10]!==l?(C=v=>s.jsx(re,{logo:v.logo,name:v.name,description:v.description,onClick:()=>l({kind:"provider",provider:v})},v.id),e[10]=l,e[11]=C):C=e[11];let h,y;e[12]!==l||e[13]!==b?(h=b&&S?[s.jsx(re,{logo:S.logo,name:S.name,description:S.description,onClick:()=>l({kind:"openai-compatible",provider:b,preset:S})},S.id)]:[],y=b?[...ce.filter(ts).map(v=>s.jsx(re,{logo:v.logo,name:v.name,description:v.description,onClick:()=>l({kind:"openai-compatible",provider:b,preset:v})},v.id)),s.jsx(re,{logo:b.logo,name:"Custom OpenAI-compatible",description:"Bring your own model server (advanced)",onClick:()=>l({kind:"openai-compatible",provider:b,preset:null})},"custom")]:[],e[12]=l,e[13]=b,e[14]=h,e[15]=y):(h=e[14],y=e[15]),d=[...I.map(C),...h,...y],e[3]=l,e[4]=t,e[5]=d}else d=e[5];const u=d,m=u.length-Ee,p=!!n&&m>0;let f;e[16]!==u||e[17]!==p?(f=p?u.slice(0,Ee):u,e[16]=u,e[17]=p,e[18]=f):f=e[18];const g=f;let x;e[19]!==r||e[20]!==l?(x=r&&s.jsx(Se,{children:s.jsxs("div",{className:"relative rounded-xl border border-violet-400/30 bg-gradient-to-br from-violet-50/50 via-transparent to-lime-50/30 dark:from-violet-950/20 dark:to-lime-950/10 p-1.5",children:[s.jsx("div",{className:"absolute inset-0 rounded-xl bg-gradient-to-br from-violet-400/5 to-lime-400/5 pointer-events-none"}),s.jsx("p",{className:"text-xs font-medium text-violet-700 dark:text-violet-400 mb-1.5 px-2 pt-2 relative",children:"Recommended — 100+ models, pay as you go"}),s.jsx(ke,{className:"relative",children:s.jsx(re,{logo:r.logo,name:r.name,description:r.description,onClick:()=>l({kind:"provider",provider:r})})})]})}),e[19]=r,e[20]=l,e[21]=x):x=e[21];let j;e[22]!==m||e[23]!==n||e[24]!==p?(j=p&&s.jsx(He,{onClick:n,title:`${m} more provider${m===1?"":"s"}`,action:s.jsx(Dt,{size:16,className:"text-muted-foreground"})}),e[22]=m,e[23]=n,e[24]=p,e[25]=j):j=e[25];let k;e[26]!==j||e[27]!==g?(k=s.jsx(Se,{children:s.jsxs(ke,{children:[g,j]})}),e[26]=j,e[27]=g,e[28]=k):k=e[28];let w;return e[29]!==x||e[30]!==k?(w=s.jsxs("div",{className:"flex flex-col gap-6",children:[x,k]}),e[29]=x,e[30]=k,e[31]=w):w=e[31],w}function ts(i){return i.id!=="openai"}function ss(i){return i.id==="openai"}function is(i){return i.id==="openai-compatible"}function ls(i){return i.id!=="deco"&&i.id!=="openai-compatible"}function ns(i){return i.id==="deco"}const os=Re({label:ae().optional(),apiKey:ae().min(1,"API key is required")});function rs(i){const e=B.c(59),{providerId:t,onCancel:l,onSuccess:n}=i,{org:o}=oe(),r=he(),a=pe(),[c,d]=$.useState(!1);let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u={resolver:Le(os),defaultValues:{label:"",apiKey:""}},e[0]=u):u=e[0];const{register:m,handleSubmit:p,formState:f}=Pe(u),{errors:g}=f;let x;e[1]!==t||e[2]!==r?(x=async z=>{await r.call("AI_PROVIDER_KEY_CREATE",{providerId:t,label:z.label||"Personal key",apiKey:z.apiKey})},e[1]=t,e[2]=r,e[3]=x):x=e[3];let j;e[4]!==n||e[5]!==o||e[6]!==a?(j=()=>{a.invalidateQueries({queryKey:te.aiProviderKeys(o.id)}),a.invalidateQueries({queryKey:te.aiProviders(o.id)}),Z.success("Key saved successfully"),n()},e[4]=n,e[5]=o,e[6]=a,e[7]=j):j=e[7];let k;e[8]!==x||e[9]!==j?(k={mutationFn:x,onSuccess:j,onError:as},e[8]=x,e[9]=j,e[10]=k):k=e[10];const{mutate:w,isPending:_,error:I}=fe(k);let M;e[11]!==w?(M=z=>w(z),e[11]=w,e[12]=M):M=e[12];let b;e[13]!==p||e[14]!==M?(b=p(M),e[13]=p,e[14]=M,e[15]=b):b=e[15];let N;e[16]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),e[16]=N):N=e[16];let S;e[17]!==m?(S=m("label"),e[17]=m,e[18]=S):S=e[18];let C;e[19]!==S?(C=s.jsxs("div",{className:"space-y-1",children:[N,s.jsx(le,{placeholder:"e.g. Personal key",...S,className:"h-8 text-sm"})]}),e[19]=S,e[20]=C):C=e[20];let h;e[21]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"API Key"}),e[21]=h):h=e[21];const y=c?"text":"password";let v;e[22]!==m?(v=m("apiKey"),e[22]=m,e[23]=v):v=e[23];let O;e[24]!==y||e[25]!==v?(O=s.jsx(le,{type:y,placeholder:"sk-...",...v,className:"ph-no-capture h-8 text-sm pr-8"}),e[24]=y,e[25]=v,e[26]=O):O=e[26];let T;e[27]!==c?(T=()=>d(!c),e[27]=c,e[28]=T):T=e[28];let A;e[29]!==c?(A=c?s.jsx(Ue,{size:14}):s.jsx(Ve,{size:14}),e[29]=c,e[30]=A):A=e[30];let E;e[31]!==T||e[32]!==A?(E=s.jsx("button",{type:"button",onClick:T,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:A}),e[31]=T,e[32]=A,e[33]=E):E=e[33];let L;e[34]!==O||e[35]!==E?(L=s.jsxs("div",{className:"relative",children:[O,E]}),e[34]=O,e[35]=E,e[36]=L):L=e[36];let R;e[37]!==g.apiKey?(R=g.apiKey&&s.jsx("p",{className:"text-xs text-destructive",children:g.apiKey.message}),e[37]=g.apiKey,e[38]=R):R=e[38];let P;e[39]!==L||e[40]!==R?(P=s.jsxs("div",{className:"space-y-1",children:[h,L,R]}),e[39]=L,e[40]=R,e[41]=P):P=e[41];let D;e[42]!==I?(D=I&&s.jsx("p",{className:"text-xs text-destructive",children:I.message}),e[42]=I,e[43]=D):D=e[43];let F;e[44]!==_||e[45]!==l?(F=s.jsx(ee,{type:"button",variant:"ghost",size:"sm",onClick:l,disabled:_,children:"Cancel"}),e[44]=_,e[45]=l,e[46]=F):F=e[46];const W=_?"Saving...":"Save Key";let H;e[47]!==_||e[48]!==W?(H=s.jsx(ee,{type:"submit",size:"sm",disabled:_,children:W}),e[47]=_,e[48]=W,e[49]=H):H=e[49];let K;e[50]!==F||e[51]!==H?(K=s.jsxs($e,{children:[F,H]}),e[50]=F,e[51]=H,e[52]=K):K=e[52];let V;return e[53]!==C||e[54]!==P||e[55]!==D||e[56]!==K||e[57]!==b?(V=s.jsxs("form",{onSubmit:b,className:"space-y-3",children:[C,P,D,K]}),e[53]=C,e[54]=P,e[55]=D,e[56]=K,e[57]=b,e[58]=V):V=e[58],V}function as(i){Z.error(`Failed to save key: ${i.message}`)}const cs=Re({label:ae().optional(),baseUrl:ae().min(1,"Base URL is required"),apiKey:ae().optional()});function ds(i){const e=B.c(70),{preset:t,onCancel:l,onSuccess:n}=i,{org:o}=oe(),r=he(),a=pe(),[c,d]=$.useState(!1);let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=Le(cs),e[0]=u):u=e[0];const m=t?.defaultBaseUrl??"";let p;e[1]!==m?(p={resolver:u,defaultValues:{label:"",baseUrl:m,apiKey:""}},e[1]=m,e[2]=p):p=e[2];const{register:f,handleSubmit:g,formState:x}=Pe(p),{errors:j}=x;let k;e[3]!==t||e[4]!==r?(k=async se=>{const lt=JSON.stringify({baseUrl:se.baseUrl,apiKey:se.apiKey||""});await r.call("AI_PROVIDER_KEY_CREATE",{providerId:"openai-compatible",label:se.label||t?.name||se.baseUrl,apiKey:lt,...t?{presetId:t.id}:{}})},e[3]=t,e[4]=r,e[5]=k):k=e[5];let w;e[6]!==n||e[7]!==o||e[8]!==a?(w=()=>{a.invalidateQueries({queryKey:te.aiProviderKeys(o.id)}),a.invalidateQueries({queryKey:te.aiProviders(o.id)}),Z.success("Connection saved successfully"),n()},e[6]=n,e[7]=o,e[8]=a,e[9]=w):w=e[9];let _;e[10]!==k||e[11]!==w?(_={mutationFn:k,onSuccess:w,onError:us},e[10]=k,e[11]=w,e[12]=_):_=e[12];const{mutate:I,isPending:M,error:b}=fe(_),N=t?`e.g. ${t.name} prod, ${t.name} dev`:"e.g. My OpenAI-compatible server",S=t?.baseUrlPlaceholder??"http://localhost:4000/v1";let C;e[13]!==I?(C=se=>I(se),e[13]=I,e[14]=C):C=e[14];let h;e[15]!==g||e[16]!==C?(h=g(C),e[15]=g,e[16]=C,e[17]=h):h=e[17];let y;e[18]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),e[18]=y):y=e[18];let v;e[19]!==f?(v=f("label"),e[19]=f,e[20]=v):v=e[20];let O;e[21]!==N||e[22]!==v?(O=s.jsxs("div",{className:"space-y-1",children:[y,s.jsx(le,{placeholder:N,...v,className:"h-8 text-sm"})]}),e[21]=N,e[22]=v,e[23]=O):O=e[23];let T;e[24]!==S||e[25]!==j||e[26]!==t?.defaultBaseUrl||e[27]!==f?(T=t?.defaultBaseUrl?s.jsx("input",{type:"hidden",...f("baseUrl")}):s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Base URL"}),s.jsx(le,{type:"url",placeholder:S,...f("baseUrl"),className:"h-8 text-sm"}),j.baseUrl&&s.jsx("p",{className:"text-xs text-destructive",children:j.baseUrl.message})]}),e[24]=S,e[25]=j,e[26]=t?.defaultBaseUrl,e[27]=f,e[28]=T):T=e[28];const A=t?.apiKeyRecommended?"recommended":"optional";let E;e[29]!==A?(E=s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["API Key"," ",s.jsxs("span",{className:"text-muted-foreground/60",children:["(",A,")"]})]}),e[29]=A,e[30]=E):E=e[30];const L=c?"text":"password";let R;e[31]!==f?(R=f("apiKey"),e[31]=f,e[32]=R):R=e[32];let P;e[33]!==L||e[34]!==R?(P=s.jsx(le,{type:L,placeholder:"sk-...",...R,className:"ph-no-capture h-8 text-sm pr-8"}),e[33]=L,e[34]=R,e[35]=P):P=e[35];let D;e[36]!==c?(D=()=>d(!c),e[36]=c,e[37]=D):D=e[37];let F;e[38]!==c?(F=c?s.jsx(Ue,{size:14}):s.jsx(Ve,{size:14}),e[38]=c,e[39]=F):F=e[39];let W;e[40]!==D||e[41]!==F?(W=s.jsx("button",{type:"button",onClick:D,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:F}),e[40]=D,e[41]=F,e[42]=W):W=e[42];let H;e[43]!==P||e[44]!==W?(H=s.jsxs("div",{className:"relative",children:[P,W]}),e[43]=P,e[44]=W,e[45]=H):H=e[45];let K;e[46]!==E||e[47]!==H?(K=s.jsxs("div",{className:"space-y-1",children:[E,H]}),e[46]=E,e[47]=H,e[48]=K):K=e[48];let V;e[49]!==t?(V=t?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:t.helpText}),e[49]=t,e[50]=V):V=e[50];let z;e[51]!==b?(z=b&&s.jsx("p",{className:"text-xs text-destructive",children:b.message}),e[51]=b,e[52]=z):z=e[52];let Y;e[53]!==M||e[54]!==l?(Y=s.jsx(ee,{type:"button",variant:"ghost",size:"sm",onClick:l,disabled:M,children:"Cancel"}),e[53]=M,e[54]=l,e[55]=Y):Y=e[55];const Q=M?"Saving...":"Save Connection";let q;e[56]!==M||e[57]!==Q?(q=s.jsx(ee,{type:"submit",size:"sm",disabled:M,children:Q}),e[56]=M,e[57]=Q,e[58]=q):q=e[58];let G;e[59]!==Y||e[60]!==q?(G=s.jsxs($e,{children:[Y,q]}),e[59]=Y,e[60]=q,e[61]=G):G=e[61];let U;return e[62]!==O||e[63]!==T||e[64]!==K||e[65]!==V||e[66]!==z||e[67]!==G||e[68]!==h?(U=s.jsxs("form",{onSubmit:h,className:"space-y-3",children:[O,T,K,V,z,G]}),e[62]=O,e[63]=T,e[64]=K,e[65]=V,e[66]=z,e[67]=G,e[68]=h,e[69]=U):U=e[69],U}function us(i){Z.error(`Failed to save connection: ${i.message}`)}const ms={kind:"closed"};function fs(i,e){switch(e.type){case"open":return i.kind==="closed"?{kind:"grid"}:i;case"close":return{kind:"closed"};case"back":switch(i.kind){case"form":case"oauth-pending":case"provision-pending":case"provision-error":return{kind:"grid"};default:return i}case"select-form":return i.kind!=="grid"?i:{kind:"form",providerId:e.providerId,presetId:e.presetId};case"select-oauth":return i.kind!=="grid"?i:{kind:"oauth-pending",providerId:e.providerId,stateToken:e.stateToken};case"oauth-failed":return i.kind==="oauth-pending"?{kind:"grid"}:i;case"select-provision":return i.kind!=="grid"?i:{kind:"provision-pending",providerId:e.providerId};case"provision-error":return i.kind!=="provision-pending"?i:{kind:"provision-error",providerId:i.providerId,error:e.error};case"retry-provision":return i.kind!=="provision-error"?i:{kind:"provision-pending",providerId:i.providerId}}}function hs(i){switch(i.kind){case"form":case"oauth-pending":case"provision-pending":case"provision-error":return i.providerId;default:return null}}function ps({open:i,onOpenChange:e,initialProvider:t}){const n=ge()?.providers??[],{org:o}=oe(),r=he(),a=pe(),[c,d]=$.useReducer(fs,ms),u=$.useRef(!1);$.useEffect(()=>{i&&c.kind==="closed"?d({type:"open"}):!i&&c.kind!=="closed"&&d({type:"close"})},[i,c.kind]);const m=()=>{u.current=!1,d({type:"close"}),e(!1)},p=()=>{a.invalidateQueries({queryKey:te.aiProviderKeys(o.id)}),a.invalidateQueries({queryKey:te.aiProviders(o.id)})},{mutate:f}=fe({mutationFn:async({providerId:h,code:y,stateToken:v,label:O})=>(await r.call("AI_PROVIDER_OAUTH_EXCHANGE",{providerId:h,code:y,stateToken:v,label:O}),h),onSuccess:h=>{J("ai_provider_oauth_succeeded",{provider_id:h}),p();const y=n.find(v=>v.id===h);Z.success(`${y?.name??"Provider"} connected successfully`),m()},onError:(h,y)=>{J("ai_provider_oauth_failed",{provider_id:y.providerId,error:h.message}),Z.error(`OAuth connection failed: ${h.message}`),d({type:"oauth-failed"})}}),{mutate:g}=fe({mutationFn:async h=>(await r.call("AI_PROVIDER_PROVISION_KEY",{providerId:h}),h),onSuccess:h=>{J("ai_provider_provision_succeeded",{provider_id:h}),p();const y=n.find(v=>v.id===h);Z.success(`${y?.name??"Provider"} connected successfully`),m()},onError:(h,y)=>{J("ai_provider_provision_failed",{provider_id:y,error:h.message}),d({type:"provision-error",error:h.message})}}),x=async h=>{const{provider:y}=h,v=h.kind==="openai-compatible"?h.preset?.id??null:null,O=y.supportedMethods.includes("oauth-pkce"),T=y.supportedMethods.includes("api-key");if(y.supportsProvision===!0){J("ai_provider_connect_clicked",{provider_id:y.id,method:"provision"}),d({type:"select-provision",providerId:y.id}),g(y.id);return}if(O){J("ai_provider_connect_clicked",{provider_id:y.id,method:"oauth-pkce"});try{const E=await r.call("AI_PROVIDER_OAUTH_URL",{providerId:y.id,callbackUrl:`${window.location.origin}/oauth/callback/ai-provider`});if(!E?.url)throw new Error("Invalid response from AI_PROVIDER_OAUTH_URL");d({type:"select-oauth",providerId:y.id,stateToken:E.stateToken}),window.open(E.url,"AiProviderOAuth","width=600,height=700")}catch(E){Z.error(`Failed to start OAuth: ${E instanceof Error?E.message:String(E)}`)}return}T&&(J("ai_provider_connect_clicked",{provider_id:y.id,...v!==null?{preset_id:v}:{},method:"api-key"}),d({type:"select-form",providerId:y.id,presetId:v}))},j=$.useRef(x);j.current=x;const k=$.useRef(t);k.current=t,$.useEffect(()=>{!k.current||c.kind!=="grid"||u.current||(u.current=!0,j.current(k.current))},[c.kind]);const w=c.kind==="oauth-pending"?c.stateToken:null,_=c.kind==="oauth-pending"?c.providerId:null;$.useEffect(()=>{if(c.kind!=="oauth-pending")return;let h=!1;const y=c.stateToken,v=c.providerId,O=A=>{if(A.origin!==window.location.origin||A.data?.type!=="AI_PROVIDER_OAUTH_CALLBACK")return;const{code:E,stateToken:L}=A.data;if(L!==y){Z.error("Security check failed: State token mismatch"),d({type:"oauth-failed"});return}h=!0;const R=n.find(P=>P.id===v);f({providerId:v,code:E,stateToken:y,label:R?.name??v})};window.addEventListener("message",O);const T=setTimeout(()=>{h||(J("ai_provider_oauth_timeout",{provider_id:v}),d({type:"oauth-failed"}),Z.error("Connection timed out"))},12e4);return()=>{window.removeEventListener("message",O),clearTimeout(T)}},[c.kind,w,_,f]);const I=hs(c),M=I?n.find(h=>h.id===I):null,N=(c.kind==="form"&&c.presetId?ce.find(h=>h.id===c.presetId):null)?.name??M?.name??"Connect an AI provider",S=c.kind!=="grid"&&c.kind!=="closed",C=()=>{t?m():d({type:"back"})};return s.jsx(De,{open:c.kind!=="closed",onOpenChange:h=>!h&&m(),children:s.jsxs(Fe,{className:"sm:max-w-md max-h-[90vh] overflow-y-auto",children:[s.jsxs(ut,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[S&&s.jsx(ee,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:C,children:s.jsx(Be,{size:16})}),s.jsx(Ke,{children:N})]}),c.kind==="grid"&&!t&&s.jsx(mt,{children:"Pick a provider — we'll handle the rest."})]}),c.kind==="grid"&&!t&&s.jsx(Ge,{providers:n,onSelect:x}),c.kind==="form"&&(c.providerId==="openai-compatible"?s.jsx(ds,{preset:c.presetId?ce.find(h=>h.id===c.presetId):void 0,onCancel:()=>d({type:"back"}),onSuccess:()=>{p(),m()}}):s.jsx(rs,{providerId:c.providerId,onCancel:()=>d({type:"back"}),onSuccess:()=>{p(),m()}})),c.kind==="oauth-pending"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[s.jsx(ye,{size:"lg"}),s.jsx("p",{className:"text-sm text-muted-foreground text-center",children:"Authorize the connection in the popup window. This dialog will close once authorization completes."})]}),c.kind==="provision-pending"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[s.jsx(ye,{size:"lg"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Connecting…"})]}),c.kind==="provision-error"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-6",children:[s.jsx($t,{size:28,className:"text-destructive"}),s.jsx("p",{className:"text-sm text-foreground text-center",children:c.error}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(ee,{variant:"outline",size:"sm",onClick:()=>d({type:"back"}),children:"Back"}),s.jsx(ee,{size:"sm",onClick:()=>{d({type:"retry-provision"}),g(c.providerId)},children:"Retry"})]})]})]})})}function xs(){const i=B.c(7),{org:e}=oe(),t=he();let l;i[0]!==e.id?(l=te.defaultBrand(e.id),i[0]=e.id,i[1]=l):l=i[1];let n;i[2]!==t?(n=async()=>{const{items:a}=await t.call("BRAND_CONTEXT_LIST",{});return(Array.isArray(a)?a:[]).find(gs)??null},i[2]=t,i[3]=n):n=i[3];let o;i[4]!==l||i[5]!==n?(o={queryKey:l,queryFn:n},i[4]=l,i[5]=n,i[6]=o):o=i[6];const{data:r}=rt(o);return r??null}function gs(i){return i.isDefault&&!i.archivedAt}function vs(i){const e=i.colors;if(!e)return null;if(Array.isArray(e)){const t=e.find(n=>typeof n=="object"&&n!==null&&"label"in n&&/primary|brand|main/i.test(n.label)),l=t?t.value:e[0]?.value;return typeof l=="string"?l:null}if(typeof e=="object"){const t=e;return t.primary??Object.values(t)[0]??null}return null}function bs(i){const e=B.c(50);let t;e[0]!==i?(t=i===void 0?{}:i,e[0]=i,e[1]=t):t=e[1];const{title:l,description:n,onLocalRuntimePicked:o}=t,{org:r}=oe(),{localMode:a}=ot(),c=xs(),d=bt(),u=jt(),[m,p]=$.useState(null),[f,g]=$.useState(!1),[x,j]=$.useState(!1),k=ge();let w;e[2]!==k?.providers?(w=k?.providers??[],e[2]=k?.providers,e[3]=w):w=e[3];const _=w;let I;if(e[4]!==d.capabilities||e[5]!==d.online){if(I=[],d.online){if(d.capabilities.includes("claude-code")){let U;e[7]===Symbol.for("react.memo_cache_sentinel")?(U={option:"claude-code-desktop",label:"Claude Code",icon:s.jsx(ue,{size:16})},e[7]=U):U=e[7],I.push(U)}if(d.capabilities.includes("codex")){let U;e[8]===Symbol.for("react.memo_cache_sentinel")?(U={option:"codex-desktop",label:"Codex",icon:s.jsx(me,{size:16})},e[8]=U):U=e[8],I.push(U)}}e[4]=d.capabilities,e[5]=d.online,e[6]=I}else I=e[6];const M=I.length>0&&u!==null,b=r.name;let N;e[9]!==c?(N=c?vs(c):null,e[9]=c,e[10]=N):N=e[10];const S=N,C=c?.favicon??c?.logo??null,h=l??(b?`${b} is ready for agents`:"Your agents are almost ready"),y=n??(M?"Your desktop is linked — start now with a local coding agent, or connect a cloud provider for hosted models.":a?"Connect a provider, or run `bunx decocms@latest link` on your desktop for Claude Code, Codex, and local files.":"Connect a provider — or run `bunx decocms@latest link` on your desktop to use Claude Code, Codex, or your local files."),v=!!(C||S);let O;e[11]!==S?(O=S?{backgroundColor:`${S}18`,borderColor:`${S}30`}:void 0,e[11]=S,e[12]=O):O=e[12];const T=O,A=v?"flex items-center justify-center size-14 rounded-2xl border":"flex items-center justify-center size-14 rounded-2xl bg-muted border border-border";let E;e[13]!==A||e[14]!==T||e[15]!==C||e[16]!==d.online||e[17]!==S?(E=C?s.jsx("div",{className:A,style:T,children:s.jsx("img",{src:C,alt:"",className:"size-7 rounded object-contain"})}):s.jsx("button",{type:"button",onClick:()=>j(!0),"aria-label":d.online?"Desktop linked":"Connect your desktop",className:ne(A,"cursor-pointer transition-colors hover:bg-accent"),style:T,children:s.jsxs("span",{className:"relative inline-flex items-center justify-center",children:[s.jsx(Pt,{size:24,style:S?{color:S}:void 0,className:ne(!S&&"text-muted-foreground")}),d.online&&s.jsx("span",{className:"absolute -top-0.5 -right-0.5 size-2.5 rounded-full bg-success ring-2 ring-background animate-pulse"})]})}),e[13]=A,e[14]=T,e[15]=C,e[16]=d.online,e[17]=S,e[18]=E):E=e[18];let L;e[19]!==h?(L=s.jsx("p",{className:"text-xl font-semibold text-foreground tracking-tight",children:h}),e[19]=h,e[20]=L):L=e[20];let R;e[21]!==y?(R=s.jsx("p",{className:"text-sm text-muted-foreground max-w-md",children:y}),e[21]=y,e[22]=R):R=e[22];let P;e[23]!==L||e[24]!==R?(P=s.jsxs("div",{className:"space-y-2",children:[L,R]}),e[23]=L,e[24]=R,e[25]=P):P=e[25];let D;e[26]!==E||e[27]!==P?(D=s.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[E,P]}),e[26]=E,e[27]=P,e[28]=D):D=e[28];let F;e[29]!==u||e[30]!==M||e[31]!==I||e[32]!==o?(F=M&&s.jsxs("div",{className:"flex flex-col items-center gap-3 w-full",children:[s.jsx("div",{className:"flex flex-wrap items-center justify-center gap-2",children:I.map(U=>s.jsxs(ee,{variant:"default",className:"gap-2",onClick:()=>{u?.setPendingAgentOption(U.option),o?.(U.option)},children:[U.icon,"Use ",U.label]},U.option))}),s.jsxs("div",{className:"flex items-center gap-3 w-full max-w-xs text-xs text-muted-foreground",children:[s.jsx("span",{className:"h-px flex-1 bg-border"}),"or connect a cloud provider",s.jsx("span",{className:"h-px flex-1 bg-border"})]})]}),e[29]=u,e[30]=M,e[31]=I,e[32]=o,e[33]=F):F=e[33];let W,H;e[34]===Symbol.for("react.memo_cache_sentinel")?(W=U=>p(U),H=()=>g(!0),e[34]=W,e[35]=H):(W=e[34],H=e[35]);let K;e[36]!==_?(K=s.jsx("div",{className:"w-full",children:s.jsx(Ge,{providers:_,onSelect:W,onShowAll:H})}),e[36]=_,e[37]=K):K=e[37];const V=m!==null||f;let z;e[38]===Symbol.for("react.memo_cache_sentinel")?(z=U=>{U||(p(null),g(!1))},e[38]=z):z=e[38];const Y=m??void 0;let Q;e[39]!==V||e[40]!==Y?(Q=s.jsx(ps,{open:V,onOpenChange:z,initialProvider:Y}),e[39]=V,e[40]=Y,e[41]=Q):Q=e[41];let q;e[42]!==x?(q=s.jsx(Kt,{open:x,onOpenChange:j}),e[42]=x,e[43]=q):q=e[43];let G;return e[44]!==F||e[45]!==K||e[46]!==Q||e[47]!==q||e[48]!==D?(G=s.jsxs("div",{className:"flex flex-col items-center gap-8 w-full max-w-3xl px-4",children:[D,F,K,Q,q]}),e[44]=F,e[45]=K,e[46]=Q,e[47]=q,e[48]=D,e[49]=G):G=e[49],G}function be(i){const e=i.title.includes(": ");return{provider:e?i.title.split(": ")[0]??"":i.modelId.split("/")[0]??"",displayName:e?i.title.split(": ").slice(1).join(": "):i.title}}function js(i){return i<32e3?{level:1,label:"Small",description:"Short conversations"}:i<2e5?{level:2,label:"Medium",description:"Good for most tasks"}:i<5e5?{level:3,label:"Large",description:"Long projects & research"}:{level:4,label:"Very large",description:"Massive files & data"}}const ys=["bg-destructive","bg-warning","bg-success","bg-success"],Ss=["text-success","text-warning","text-warning","text-destructive"];function ks(i){const e=Math.round(i*.75/1e3);return e>=1?`~${e}K words`:`~${Math.round(i*.75)} words`}function Ns(i){return i<1?{level:1,label:"Cheap"}:i<5?{level:2,label:"Moderate"}:i<15?{level:3,label:"High"}:{level:4,label:"Expensive"}}const Cs={text:{icon:s.jsx(Tt,{className:"size-3.5"}),label:"Text"},vision:{icon:s.jsx(Et,{className:"size-3.5"}),label:"Vision"},image:{icon:s.jsx(_t,{className:"size-3.5"}),label:"Image"},tools:{icon:s.jsx(Ot,{className:"size-3.5"}),label:"Tools"},reasoning:{icon:s.jsx(Ut,{className:"size-3.5"}),label:"Reasoning"},"web-search":{icon:s.jsx(We,{className:"size-3.5"}),label:"Web search"}};function ws(i){const e=B.c(5),{capability:t}=i;let l;e[0]!==t?(l=Cs[t]??{icon:null,label:t.charAt(0).toUpperCase()+t.slice(1)},e[0]=t,e[1]=l):l=e[1];const n=l;let o;return e[2]!==n.icon||e[3]!==n.label?(o=s.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground border border-border rounded px-2 py-0.5",children:[n.icon,n.label]}),e[2]=n.icon,e[3]=n.label,e[4]=o):o=e[4],o}function _s(i){const e=B.c(49),{model:t,compact:l}=i,n=l===void 0?!1:l;if(!t){let b;return e[0]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"Hover to preview"}),e[0]=b):b=e[0],b}const o=t.costs?.input!=null?t.costs.input*1e6:null,r=t.costs?.output!=null?t.costs.output*1e6:null;let a;e[1]!==t?(a=be(t),e[1]=t,e[2]=a):a=e[2];const{provider:c,displayName:d}=a;if(n){let b;e[3]!==t.limits?(b=t.limits?.contextWindow&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Context"}),s.jsxs("span",{className:"text-foreground font-medium",children:[t.limits.contextWindow.toLocaleString()," tokens"]})]}),e[3]=t.limits,e[4]=b):b=e[4];let N;e[5]!==o?(N=o!=null&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Input"}),s.jsxs("span",{className:"text-foreground font-medium",children:["$",o.toFixed(2)," / 1M"]})]}),e[5]=o,e[6]=N):N=e[6];let S;e[7]!==r?(S=r!=null&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Output"}),s.jsxs("span",{className:"text-foreground font-medium",children:["$",r.toFixed(2)," / 1M"]})]}),e[7]=r,e[8]=S):S=e[8];let C;e[9]!==t.limits?(C=t.limits?.maxOutputTokens&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Output limit"}),s.jsxs("span",{className:"text-foreground font-medium",children:[t.limits.maxOutputTokens.toLocaleString()," tokens"]})]}),e[9]=t.limits,e[10]=C):C=e[10];let h;return e[11]!==b||e[12]!==N||e[13]!==S||e[14]!==C?(h=s.jsxs("div",{className:"flex flex-col gap-2 pt-3 pb-3 px-3 text-xs",children:[b,N,S,C]}),e[11]=b,e[12]=N,e[13]=S,e[14]=C,e[15]=h):h=e[15],h}let u;e[16]!==c?(u=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c}),e[16]=c,e[17]=u):u=e[17];let m;e[18]!==t.logo||e[19]!==t.title?(m=t.logo&&s.jsx("img",{src:t.logo,className:"size-6 shrink-0 rounded-md dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[18]=t.logo,e[19]=t.title,e[20]=m):m=e[20];let p;e[21]!==d?(p=s.jsx("p",{className:"text-lg font-semibold leading-snug tracking-tight",children:d}),e[21]=d,e[22]=p):p=e[22];let f;e[23]!==m||e[24]!==p?(f=s.jsxs("div",{className:"flex items-center gap-2.5",children:[m,p]}),e[23]=m,e[24]=p,e[25]=f):f=e[25];let g;e[26]!==t.modelId?(g=s.jsx("p",{className:"text-xs text-muted-foreground/50 font-mono",children:t.modelId}),e[26]=t.modelId,e[27]=g):g=e[27];let x;e[28]!==u||e[29]!==f||e[30]!==g?(x=s.jsxs("div",{className:"flex flex-col gap-1 pt-1 pr-6",children:[u,f,g]}),e[28]=u,e[29]=f,e[30]=g,e[31]=x):x=e[31];let j;e[32]!==t.capabilities?(j=t.capabilities&&t.capabilities.length>0&&s.jsx("div",{className:"flex flex-wrap items-center gap-1.5 pb-4 border-b border-border",children:[...new Set(t.capabilities)].map(Is)}),e[32]=t.capabilities,e[33]=j):j=e[33];let k;e[34]!==t.limits?(k=t.limits?.contextWindow&&(()=>{const{level:b,label:N,description:S}=js(t.limits.contextWindow);return s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Context window"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex items-center gap-0.5",children:[1,2,3,4].map(C=>s.jsx("div",{className:ne("w-2 h-2 rounded-full",C<=b?ys[b-1]:"bg-muted")},C))}),s.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:N}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:["— ",S]})]}),s.jsxs("span",{className:"text-sm text-muted-foreground",children:[t.limits.contextWindow.toLocaleString()," tokens"]})]})})(),e[34]=t.limits,e[35]=k):k=e[35];let w;e[36]!==t.limits?(w=t.limits?.maxOutputTokens&&s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Output limit"}),s.jsxs("div",{className:"flex items-baseline gap-2",children:[s.jsxs("span",{className:"text-sm text-foreground",children:[t.limits.maxOutputTokens.toLocaleString()," tokens"]}),s.jsx("span",{className:"text-sm text-muted-foreground",children:ks(t.limits.maxOutputTokens)})]})]}),e[36]=t.limits,e[37]=w):w=e[37];let _;e[38]!==o||e[39]!==r?(_=(o!=null||r!=null)&&(()=>{const{level:b,label:N}=o!=null?Ns(o):{level:0,label:""};return s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Pricing"}),o!=null&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex items-center",children:[1,2,3,4].map(S=>s.jsx("span",{className:ne("text-sm font-bold leading-none",S<=b?Ss[b-1]:"text-muted-foreground/20"),children:"$"},S))}),s.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:N})]}),s.jsxs("div",{className:"flex flex-col gap-1",children:[o!=null&&s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Input"}),s.jsxs("span",{className:"text-xs text-foreground",children:["$",o.toFixed(2)," / 1M tokens"]})]}),r!=null&&s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Output"}),s.jsxs("span",{className:"text-xs text-foreground",children:["$",r.toFixed(2)," / 1M tokens"]})]})]})]})})(),e[38]=o,e[39]=r,e[40]=_):_=e[40];let I;e[41]!==k||e[42]!==w||e[43]!==_?(I=s.jsxs("div",{className:"flex flex-col gap-6",children:[k,w,_]}),e[41]=k,e[42]=w,e[43]=_,e[44]=I):I=e[44];let M;return e[45]!==I||e[46]!==x||e[47]!==j?(M=s.jsxs("div",{className:"flex flex-col gap-5 py-1 px-1.5",children:[x,j,I]}),e[45]=I,e[46]=x,e[47]=j,e[48]=M):M=e[48],M}function Is(i){return s.jsx(ws,{capability:i},i)}function Xe(i){const e=B.c(19),{model:t,placeholder:l,isLoading:n}=i,o=l===void 0?"Select model":l;if(n===void 0?!1:n){let x;return e[0]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(X,{className:"w-5 h-5 rounded-sm shrink-0"}),s.jsx(X,{className:"w-16 h-3 hidden md:block"})]}),e[0]=x):x=e[0],x}if(!t){let x;e[1]!==o?(x=s.jsx("span",{className:"text-sm text-muted-foreground",children:o}),e[1]=o,e[2]=x):x=e[2];let j;e[3]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Ne,{size:14,className:"text-muted-foreground opacity-50 shrink-0"}),e[3]=j):j=e[3];let k;return e[4]!==x?(k=s.jsxs("div",{className:"flex items-center gap-1.5",children:[x,j]}),e[4]=x,e[5]=k):k=e[5],k}let a;e[6]!==t?(a=be(t),e[6]=t,e[7]=a):a=e[7];const{displayName:c}=a;let d;e[8]!==t?(d=ve(t),e[8]=t,e[9]=d):d=e[9];const u=d;let m;e[10]!==t.title||e[11]!==u?(m=s.jsx("img",{src:u,className:"w-3.5 h-3.5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[10]=t.title,e[11]=u,e[12]=m):m=e[12];let p;e[13]!==c?(p=s.jsx("span",{className:"text-sm truncate whitespace-nowrap text-muted-foreground max-w-[100px] sm:max-w-none",children:c}),e[13]=c,e[14]=p):p=e[14];let f;e[15]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Ne,{size:14,className:"text-muted-foreground opacity-50 shrink-0"}),e[15]=f):f=e[15];let g;return e[16]!==m||e[17]!==p?(g=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0 overflow-hidden",children:[m,p,f]}),e[16]=m,e[17]=p,e[18]=g):g=e[18],g}const Ms=["vision","image","file","audio","video"],Ye=["image/png","image/jpeg","image/gif","image/webp"],Qe=["application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"];function je(i){const e=i?.capabilities;return e?Ms.some(t=>e.includes(t)):!1}function $i(i,e){if(!i)return!1;if(i.startsWith("text/"))return!0;const t=e?.capabilities??[],l=t.includes("vision")||t.includes("image"),n=t.includes("file"),o=t.includes("audio"),r=t.includes("video");return!!(l&&Ye.includes(i)||n&&i==="application/pdf"||o&&i.startsWith("audio/")||r&&i.startsWith("video/")||je(e)&&Qe.includes(i))}function Di(i){const e=i?.capabilities??[],t=["text/*"];return(e.includes("vision")||e.includes("image"))&&t.push(...Ye),e.includes("file")&&t.push("application/pdf"),e.includes("audio")&&t.push("audio/*"),e.includes("video")&&t.push("video/*"),je(i)&&t.push(...Qe),t.join(",")}function Fi(i){const e=i?.capabilities??[],t=[];return(e.includes("vision")||e.includes("image"))&&t.push("images"),e.includes("file")&&t.push("PDFs"),e.includes("audio")&&t.push("audio"),e.includes("video")&&t.push("video"),je(i)&&t.push("Office files"),t.length===0?"text only":t.length===1?t[0]:t.length===2?`${t[0]} and ${t[1]}`:`${t.slice(0,-1).join(", ")}, and ${t.at(-1)}`}const Je=["smarter","faster","cheaper"],Ze={smarter:"Smarter",faster:"Faster",cheaper:"Cheaper"},Os=[{tier:"smarter",prefixes:["anthropic/claude-opus-4.8","anthropic/claude-sonnet-4.6","anthropic/claude-4.6-sonnet","openai/gpt-5.3-codex","google/gemini-3-pro","google/gemini-2.5-pro","cohere/command-r-plus","cohere/command-a"]},{tier:"faster",prefixes:["anthropic/claude-haiku-4.5","anthropic/claude-4.5-haiku","google/gemini-3-flash","openai/gpt-5.1-codex-mini","x-ai/grok-code-fast","x-ai/grok-3","mistralai/mistral-large","mistralai/codestral","mistralai/mistral-medium","minimax/minimax-m1"]},{tier:"cheaper",prefixes:["google/gemini-2.5-flash-lite","google/gemini-2.5-flash","google/gemini-2.0-flash","deepseek/deepseek-v3","openai/gpt-oss-120b","mistralai/mistral-small","mistralai/pixtral","cohere/command-r"]}],Es=Os.flatMap(({tier:i,prefixes:e})=>e.map(t=>({tier:i,prefix:t}))).sort((i,e)=>e.prefix.length-i.prefix.length),Ts="google/gemini-2.5-pro",Te=new Map;function As(i){const e=Te.get(i);if(e!==void 0)return e;let t=null;if(i.endsWith(":free"))t="cheaper";else for(const{tier:l,prefix:n}of Es)if(i.startsWith(n)){if(n===Ts&&i.length>n.length&&i[n.length]==="-"){const r=i[n.length+1];if(!r||!/\d/.test(r))continue}t=l;break}return Te.set(i,t),t}function Ae(i){const e={smarter:[],faster:[],cheaper:[],other:[]};for(const t of i){const l=As(t.modelId);e[l??"other"].push(t)}for(const t of Object.keys(e))e[t].sort((l,n)=>l.title.localeCompare(n.title));return e}const et="mesh:model-shortlist:",zs=new Set(["anthropic/claude-opus-4.8","anthropic/claude-sonnet-4.6","anthropic/claude-4.6-sonnet","anthropic/claude-sonnet-4.6:extended","openai/gpt-5.3-codex","google/gemini-3-pro-preview","google/gemini-2.5-pro","anthropic/claude-haiku-4.5","anthropic/claude-haiku-4.5-20251001","anthropic/claude-4.5-haiku","google/gemini-3-flash-preview","openai/gpt-5.1-codex-mini","x-ai/grok-code-fast-1","google/gemini-2.5-flash","deepseek/deepseek-v3.2","google/gemini-2.5-flash-lite","openai/gpt-oss-120b:free"]);function Rs(i){try{const e=localStorage.getItem(et+i);return e?new Set(JSON.parse(e)):null}catch{return null}}function Ls(i,e){localStorage.setItem(et+i,JSON.stringify([...e]))}function Ps(i){const e=B.c(21),{model:t,onHover:l}=i;let n;e[0]!==t?(n=be(t),e[0]=t,e[1]=n):n=e[1];const{displayName:o,provider:r}=n;let a;e[2]!==t?(a=ve(t),e[2]=t,e[3]=a):a=e[3];const c=a;let d;e[4]!==t||e[5]!==l?(d=()=>l(t),e[4]=t,e[5]=l,e[6]=d):d=e[6];let u;e[7]!==t.title||e[8]!==c?(u=s.jsx("img",{src:c,className:"w-4 h-4 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[7]=t.title,e[8]=c,e[9]=u):u=e[9];let m;e[10]!==o?(m=s.jsx("span",{className:"text-sm text-foreground leading-tight truncate",children:o}),e[10]=o,e[11]=m):m=e[11];let p;e[12]!==r?(p=s.jsx("span",{className:"text-xs text-muted-foreground/60 leading-tight",children:r}),e[12]=r,e[13]=p):p=e[13];let f;e[14]!==m||e[15]!==p?(f=s.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[m,p]}),e[14]=m,e[15]=p,e[16]=f):f=e[16];let g;return e[17]!==d||e[18]!==u||e[19]!==f?(g=s.jsxs("div",{className:"flex items-center gap-2.5 py-2 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:d,children:[u,f]}),e[17]=d,e[18]=u,e[19]=f,e[20]=g):g=e[20],g}function $s(i){const e=B.c(10),{error:t,onRetry:l}=i;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("div",{className:"bg-destructive/10 p-2 rounded-full",children:s.jsx(dt,{className:"size-5 text-destructive"})}),e[0]=n):n=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Failed to load models"}),e[1]=o):o=e[1];const r=t?.message||"Could not fetch models from this provider.";let a;e[2]!==r?(a=s.jsxs("div",{className:"flex flex-col gap-1",children:[o,s.jsxs("p",{className:"text-xs text-muted-foreground max-w-[260px]",children:[r," Try another provider or retry."]})]}),e[2]=r,e[3]=a):a=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Mt,{className:"size-3.5"}),e[4]=c):c=e[4];let d;e[5]!==l?(d=s.jsx("div",{className:"flex items-center gap-2",children:s.jsxs(ee,{variant:"outline",size:"sm",onClick:l,className:"gap-1.5",children:[c,"Retry"]})}),e[5]=l,e[6]=d):d=e[6];let u;return e[7]!==a||e[8]!==d?(u=s.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-4 py-8 text-center",children:[n,a,d]}),e[7]=a,e[8]=d,e[9]=u):u=e[9],u}function Ds(){const i=B.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:Array.from({length:6}).map(Fs)}),i[0]=e):e=i[0],e}function Fs(i,e){return s.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[s.jsx(X,{className:"size-5 shrink-0 rounded-sm"}),s.jsx(X,{className:"flex-1 h-4"}),s.jsx(X,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function ze(i){const e=B.c(12),{label:t,models:l,onSelect:n,onHover:o}=i;if(l.length===0)return null;let r;e[0]!==t?(r=s.jsx("div",{className:"text-xs font-medium text-muted-foreground px-3 pt-3 pb-1",children:t}),e[0]=t,e[1]=r):r=e[1];let a;if(e[2]!==l||e[3]!==o||e[4]!==n){let d;e[6]!==o||e[7]!==n?(d=u=>s.jsx("div",{onClick:()=>n(u),className:"cursor-pointer",children:s.jsx(Ps,{model:u,onHover:o})},u.modelId),e[6]=o,e[7]=n,e[8]=d):d=e[8],a=l.map(d),e[2]=l,e[3]=o,e[4]=n,e[5]=a}else a=e[5];let c;return e[9]!==r||e[10]!==a?(c=s.jsxs("div",{children:[r,a]}),e[9]=r,e[10]=a,e[11]=c):c=e[11],c}function Ks(i){const e=B.c(21),{model:t,isChecked:l,onToggle:n,onHover:o}=i,[r,a]=$.useState(l);r!==l&&a(l);let c;e[0]!==t?(c=ve(t),e[0]=t,e[1]=c):c=e[1];const d=c;let u;e[2]!==t||e[3]!==o?(u=()=>o(t),e[2]=t,e[3]=o,e[4]=u):u=e[4];let m;e[5]!==t.modelId||e[6]!==n?(m=()=>{a(Us),n(t.modelId)},e[5]=t.modelId,e[6]=n,e[7]=m):m=e[7];let p;e[8]!==r||e[9]!==m?(p=s.jsx(yt,{checked:r,onCheckedChange:m}),e[8]=r,e[9]=m,e[10]=p):p=e[10];let f;e[11]!==d||e[12]!==t.title?(f=s.jsx("img",{src:d,className:"w-5 h-5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[11]=d,e[12]=t.title,e[13]=f):f=e[13];let g;e[14]!==t.title?(g=s.jsx("span",{className:"text-sm text-foreground flex-1 min-w-0 line-clamp-1",children:t.title}),e[14]=t.title,e[15]=g):g=e[15];let x;return e[16]!==u||e[17]!==p||e[18]!==f||e[19]!==g?(x=s.jsxs("label",{className:"flex items-center gap-3 min-h-8 py-2.5 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:u,children:[p,f,g]}),e[16]=u,e[17]=p,e[18]=f,e[19]=g,e[20]=x):x=e[20],x}function Us(i){return!i}function Bs(i){const e=[];for(const t of Je)if(i[t].length>0){e.push({type:"header",label:Ze[t]});for(const l of i[t])e.push({type:"model",model:l})}if(i.other.length>0){e.push({type:"header",label:"Other"});for(const t of i.other)e.push({type:"model",model:t})}return e}function Ws({items:i,shortlistSet:e,onToggle:t,onHover:l}){const n=$.useRef(null),o=es({count:i.length,getScrollElement:()=>n.current,estimateSize:r=>i[r]?.type==="header"?36:44,overscan:6});return s.jsx("div",{ref:n,className:"flex-1 overflow-y-auto",children:s.jsx("div",{className:"relative",style:{height:o.getTotalSize()},children:o.getVirtualItems().map(r=>{const a=i[r.index];return a?s.jsx("div",{"data-index":r.index,ref:o.measureElement,className:"absolute left-0 right-0 top-0 px-0.5",style:{transform:`translateY(${r.start}px)`},children:a.type==="header"?s.jsx("div",{className:"text-xs font-medium text-muted-foreground px-3 pt-3 pb-1",children:a.label}):s.jsx(Ks,{model:a.model,isChecked:e.has(a.model.modelId),onToggle:t,onHover:l})},r.key):null})})})}function Hs(i){const e=B.c(23),{keyId:t,searchTerm:l,onHover:n,onModelSelect:o,managing:r,onToggleManage:a,filterModels:c}=i,{models:d}=Lt(t),u=c?d.filter(c):d.filter(Vs);let m;e[0]!==t?(m=()=>(t?Rs(t):null)??zs,e[0]=t,e[1]=m):m=e[1];const[p,f]=$.useState(m),[,g]=$.useTransition();let x;e[2]!==t||e[3]!==g?(x=h=>{t&&g(()=>{f(y=>{const v=new Set(y);return v.has(h)?v.delete(h):v.add(h),Ls(t,v),v})})},e[2]=t,e[3]=g,e[4]=x):x=e[4];const j=x,k=l.toLowerCase().trim(),w=h=>k?h.filter(y=>y.title.toLowerCase().includes(k)||y.modelId.toLowerCase().includes(k)):h;if(r){const h=Ae(w(u)),y=Bs(h);let v;e[5]!==p?(v=E=>p.has(E.modelId),e[5]=p,e[6]=v):v=e[6];const O=u.filter(v).length;let T;e[7]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx(Be,{size:14}),e[7]=T):T=e[7];let A;return e[8]!==a?(A=s.jsxs("button",{type:"button",onClick:a,className:"flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground cursor-pointer",children:[T,"Back"]}),e[8]=a,e[9]=A):A=e[9],s.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[s.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border",children:[A,s.jsxs("span",{className:"text-xs text-muted-foreground",children:[O," selected"]})]}),s.jsx(Ws,{items:y,shortlistSet:p,onToggle:j,onHover:n})]})}let _;e[10]!==p?(_=h=>p.has(h.modelId),e[10]=p,e[11]=_):_=e[11];const I=u.filter(_),M=I.length>0?I:u,b=Ae(w(M));let N;e[12]!==b||e[13]!==n||e[14]!==o?(N=Je.map(h=>s.jsx(ze,{label:Ze[h],models:b[h],onSelect:o,onHover:n},h)),e[12]=b,e[13]=n,e[14]=o,e[15]=N):N=e[15];let S;e[16]!==b.other||e[17]!==n||e[18]!==o?(S=s.jsx(ze,{label:"Other",models:b.other,onSelect:o,onHover:n}),e[16]=b.other,e[17]=n,e[18]=o,e[19]=S):S=e[19];let C;return e[20]!==N||e[21]!==S?(C=s.jsxs("div",{className:"flex-1 overflow-y-auto px-0.5 pt-1 [touch-action:pan-y]",children:[N,S]}),e[20]=N,e[21]=S,e[22]=C):C=e[22],C}function Vs(i){return i.asyncResearch!==!0}function qs(){const i=B.c(6);let e;i[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:s.jsxs("div",{className:"flex items-center gap-2.5 h-12 px-4",children:[s.jsx(X,{className:"size-4 shrink-0"}),s.jsx(X,{className:"flex-1 h-6"}),s.jsx(X,{className:"w-[140px] h-8 shrink-0"})]})}),i[0]=e):e=i[0];let t;i[1]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsxs("div",{className:"flex-1 flex flex-col md:border-r md:w-[420px] md:min-w-[420px] min-h-0 overflow-hidden",children:[e,s.jsx("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:Array.from({length:8}).map(Gs)})]}),i[1]=t):t=i[1];let l;i[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[s.jsx(X,{className:"size-6 shrink-0"}),s.jsx(X,{className:"h-6 w-32"})]}),i[2]=l):l=i[2];let n;i[3]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"flex flex-col gap-3 py-2 px-0",children:[l,s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(X,{className:"h-6 w-20 rounded-md"}),s.jsx(X,{className:"h-6 w-24 rounded-md"})]})]}),i[3]=n):n=i[3];let o;i[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(X,{className:"h-4 w-24"}),s.jsx(X,{className:"h-4 w-32"})]}),i[4]=o):o=i[4];let r;return i[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("div",{className:"flex flex-col md:flex-row h-full sm:h-[460px] min-h-0",children:[t,s.jsx("div",{className:"hidden md:block md:w-[320px] md:shrink-0 p-3",children:s.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[n,s.jsxs("div",{className:"flex flex-col gap-4",children:[o,s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(X,{className:"h-4 w-16"}),s.jsx(X,{className:"h-4 w-40"})]})]})]})})]}),i[5]=r):r=i[5],r}function Gs(i,e){return s.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[s.jsx(X,{className:"size-5 shrink-0 rounded-sm"}),s.jsx(X,{className:"flex-1 h-4"}),s.jsx(X,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function tt(i){const e=B.c(49),{onClose:t,credentialId:l,onCredentialChange:n,selectedModel:o,onModelChange:r,filterModels:a}=i,[c,d]=$.useState(null),[u,m]=$.useState(""),[p,f]=$.useState(!1),g=$.useRef(null),x=ge(),j=Rt();let k;e[0]!==x?.providers?(k=Object.fromEntries((x?.providers??[]).map(Qs)),e[0]=x?.providers,e[1]=k):k=e[1];const w=k,_=at(),{org:I}=oe();let M;e[2]!==n?(M=z=>{n(z),d(null)},e[2]=n,e[3]=M):M=e[3];const b=M;let N;e[4]!==l||e[5]!==t||e[6]!==r?(N=z=>{l&&(r(z),m(""),t())},e[4]=l,e[5]=t,e[6]=r,e[7]=N):N=e[7];const S=N;if(j.length===0){let z;return e[8]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx("div",{className:"flex items-center justify-center p-8 w-full sm:w-[740px]",children:s.jsx(bs,{})}),e[8]=z):z=e[8],z}let C;e[9]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(We,{size:16,className:"text-muted-foreground shrink-0"}),e[9]=C):C=e[9];const h=p?"Search all models...":"Search for a model...";let y;e[10]===Symbol.for("react.memo_cache_sentinel")?(y=z=>m(z.target.value),e[10]=y):y=e[10];let v;e[11]!==u||e[12]!==h?(v=s.jsx(le,{ref:g,type:"text",placeholder:h,value:u,onChange:y,className:"flex-1 min-w-0 border-0 !shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"}),e[11]=u,e[12]=h,e[13]=v):v=e[13];let O;e[14]!==l||e[15]!==b||e[16]!==j||e[17]!==w?(O=j.length>0&&s.jsxs(St,{value:l??"",onValueChange:b,children:[s.jsxs(kt,{size:"sm",className:"w-auto max-w-[140px] h-8 shrink-0 gap-1.5 px-2 [&>svg:last-child]:hidden",onClick:Ys,children:[s.jsx(Nt,{placeholder:"Key",children:(()=>{const z=j.find(U=>U.id===l),Y=z?w[z.providerId]:void 0,Q=Oe(z?.presetId),q=Q?.logo??Y?.logo,G=Q?.name??Y?.name??z?.providerId??"Key";return s.jsxs("span",{className:"flex items-center gap-1.5 min-w-0",children:[q?s.jsx("img",{src:q,alt:G,className:"w-4 h-4 rounded shrink-0 dark:bg-white dark:rounded-sm dark:p-px"}):s.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary shrink-0",children:G.slice(0,1).toUpperCase()}),s.jsx("span",{className:"text-xs truncate",children:G})]})})()}),s.jsx(At,{className:"size-4 opacity-50 shrink-0 pointer-events-none"})]}),s.jsx(Ct,{children:j.map(z=>{const Y=w[z.providerId],Q=Oe(z.presetId),q=Q?.logo??Y?.logo,G=Q?.name??Y?.name??z.providerId;return s.jsx(wt,{value:z.id,children:s.jsxs("div",{className:"flex items-center gap-2",children:[q?s.jsx("img",{src:q,alt:G,className:"w-4 h-4 rounded dark:bg-white dark:rounded-sm dark:p-px"}):s.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:G.slice(0,1).toUpperCase()}),s.jsxs("span",{children:[G," — ",z.label]})]})},z.id)})})]}),e[14]=l,e[15]=b,e[16]=j,e[17]=w,e[18]=O):O=e[18];let T;e[19]!==v||e[20]!==O?(T=s.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:s.jsxs("label",{className:"flex items-center gap-2.5 h-12 px-4 pr-12 md:pr-4 cursor-text",children:[C,v,O]})}),e[19]=v,e[20]=O,e[21]=T):T=e[21];let A;e[22]!==l?(A=z=>{const{error:Y,resetError:Q}=z;return s.jsx($s,{error:Y,onRetry:Q,credentialId:l??void 0})},e[22]=l,e[23]=A):A=e[23];let E;e[24]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx(Ds,{}),e[24]=E):E=e[24];const L=l??void 0;let R;e[25]===Symbol.for("react.memo_cache_sentinel")?(R=()=>f(Xs),e[25]=R):R=e[25];let P;e[26]!==a||e[27]!==S||e[28]!==p||e[29]!==u||e[30]!==L?(P=s.jsx($.Suspense,{fallback:E,children:s.jsx(Hs,{keyId:L,searchTerm:u,onHover:d,onModelSelect:S,managing:p,onToggleManage:R,filterModels:a})}),e[26]=a,e[27]=S,e[28]=p,e[29]=u,e[30]=L,e[31]=P):P=e[31];let D;e[32]!==l||e[33]!==A||e[34]!==P?(D=s.jsx(ct,{fallback:A,children:P},l),e[32]=l,e[33]=A,e[34]=P,e[35]=D):D=e[35];let F;e[36]!==p||e[37]!==_||e[38]!==I?(F=!p&&s.jsxs("div",{className:"border-t border-border flex",children:[s.jsxs("button",{type:"button",onClick:()=>$.startTransition(()=>f(!0)),className:"flex items-center gap-2 flex-1 px-4 py-2.5 text-xs text-muted-foreground hover:text-foreground hover:bg-accent cursor-pointer",children:[s.jsx(It,{className:"size-3.5 shrink-0"}),"Manage models"]}),s.jsx("div",{className:"w-px bg-border shrink-0"}),s.jsxs("button",{type:"button",onClick:()=>_({to:"/$org/settings/ai-providers",params:{org:I.slug}}),className:"flex items-center gap-2 flex-1 px-4 py-2.5 text-xs text-muted-foreground hover:text-foreground hover:bg-accent cursor-pointer",children:[s.jsx(zt,{className:"size-3.5 shrink-0"}),"Manage API keys"]})]}),e[36]=p,e[37]=_,e[38]=I,e[39]=F):F=e[39];let W;e[40]!==D||e[41]!==F||e[42]!==T?(W=s.jsxs("div",{className:"flex-1 flex flex-col md:border-r md:w-[420px] md:min-w-[420px] min-h-0 overflow-hidden",children:[T,D,F]}),e[40]=D,e[41]=F,e[42]=T,e[43]=W):W=e[43];const H=c??o??null;let K;e[44]!==H?(K=s.jsx("div",{className:"hidden md:flex md:flex-col md:w-[320px] md:shrink-0 p-3",children:s.jsx(_s,{model:H})}),e[44]=H,e[45]=K):K=e[45];let V;return e[46]!==W||e[47]!==K?(V=s.jsxs("div",{className:"flex flex-col md:flex-row h-full sm:h-[460px] min-h-0",children:[W,K]}),e[46]=W,e[47]=K,e[48]=V):V=e[48],V}function Xs(i){return!i}function Ys(i){return i.stopPropagation()}function Qs(i){return[i.id,i]}function Js(i){const e=B.c(12),{onClose:t}=i,{credentialId:l,setCredentialId:n,selectedModel:o,setModel:r}=xe();let a;e[0]!==n?(a=u=>{J("chat_credential_changed",{credential_id:u}),n(u)},e[0]=n,e[1]=a):a=e[1];let c;e[2]!==l||e[3]!==o?.modelId||e[4]!==r?(c=u=>{l&&(J("chat_model_changed",{from_model_id:o?.modelId??null,to_model_id:u.modelId,to_model_provider:u.providerId??null,credential_id:l}),r({...u,keyId:l}))},e[2]=l,e[3]=o?.modelId,e[4]=r,e[5]=c):c=e[5];let d;return e[6]!==l||e[7]!==t||e[8]!==o||e[9]!==a||e[10]!==c?(d=s.jsx(tt,{onClose:t,credentialId:l,onCredentialChange:a,selectedModel:o,onModelChange:c}),e[6]=l,e[7]=t,e[8]=o,e[9]=a,e[10]=c,e[11]=d):d=e[11],d}function Zs(i){const e=B.c(2),{onClose:t}=i;let l;return e[0]!==t?(l=s.jsx(Js,{onClose:t}),e[0]=t,e[1]=l):l=e[1],l}function ei(i){const e=B.c(2);let t;return e[0]!==i?(t=s.jsx(tt,{...i}),e[0]=i,e[1]=t):t=e[1],t}const ti=[{tier:"fast",description:"Quicker responses"},{tier:"smart",description:"Balanced quality"},{tier:"thinking",description:"Deeper reasoning"}];function st(i){const e=B.c(10),{modelSet:t,selectedModelId:l,onSelect:n}=i;let o,r;if(e[0]!==t.logo||e[1]!==t.models||e[2]!==t.tiers||e[3]!==n||e[4]!==l){const c=Object.fromEntries(t.models.map(si));o="flex flex-col p-2 w-[320px]",r=ti.map(d=>{const{tier:u,description:m}=d,p=t.tiers[u];if(!p.modelId)return null;const f=c[p.modelId];if(!f)return null;const g=l===p.modelId;return s.jsxs("button",{type:"button",onClick:()=>n(f),className:ne("flex items-center gap-3 px-3 py-2.5 rounded-lg text-left hover:bg-accent",g&&"bg-accent/50"),children:[s.jsx("img",{src:t.logo,alt:p.label,className:"size-5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px"}),s.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[s.jsx("span",{className:"text-sm text-foreground leading-tight truncate",children:p.label}),s.jsx("span",{className:"text-xs text-muted-foreground leading-tight",children:m})]})]},u)}),e[0]=t.logo,e[1]=t.models,e[2]=t.tiers,e[3]=n,e[4]=l,e[5]=o,e[6]=r}else o=e[5],r=e[6];let a;return e[7]!==o||e[8]!==r?(a=s.jsx("div",{className:o,children:r}),e[7]=o,e[8]=r,e[9]=a):a=e[9],a}function si(i){return[i.modelId,i]}const ii=[{providerId:"claude-code",modelId:"claude-code:haiku",title:"Claude Code Haiku",description:"Fast and lightweight",capabilities:["text"],limits:null,costs:null},{providerId:"claude-code",modelId:"claude-code:sonnet",title:"Claude Code Sonnet 5",description:"Balanced performance",capabilities:["text","reasoning"],limits:null,costs:null},{providerId:"claude-code",modelId:"claude-code:opus",title:"Claude Code Opus",description:"Most capable",capabilities:["text","reasoning"],limits:null,costs:null},{providerId:"claude-code",modelId:"claude-code:opus-1m",title:"Claude Code Opus 4.8 1M",description:"Most capable, 1M context window",capabilities:["text","reasoning"],limits:{contextWindow:1e6,maxOutputTokens:null},costs:null}],de="https://assets.decocache.com/decocms/6ac44f1c-c0cf-4480-84b5-2ae6fe742d0b/codex-app.png.png",li=[{providerId:"codex",modelId:"codex:gpt-5.6-sol",title:"GPT-5.6 Sol",description:"Frontier Codex model for deep reasoning, complex coding, and real-world work",capabilities:["text","reasoning"],logo:de,limits:null,costs:null},{providerId:"codex",modelId:"codex:gpt-5.6-terra",title:"GPT-5.6 Terra",description:"Balanced Codex model for everyday coding and agent work",capabilities:["text","reasoning"],logo:de,limits:null,costs:null},{providerId:"codex",modelId:"codex:gpt-5.6-luna",title:"GPT-5.6 Luna",description:"Fast Codex model for lightweight coding tasks and titles",capabilities:["text","reasoning"],logo:de,limits:null,costs:null},{providerId:"codex",modelId:"codex:gpt-5.3-codex-spark",title:"GPT-5.3 Codex Spark",description:"Ultra-fast coding model",capabilities:["text","reasoning"],logo:de,limits:null,costs:null}],ni="https://decoims.com/decocms/93e4059c-e598-412b-87eb-54d72a946ec8/claude-stroke-rounded.svg",oi="https://decoims.com/decocms/9170ffd4-b9cc-4661-ad8f-ae2eea019e00/codex.svg",ri={fast:{modelId:"claude-code:haiku",label:"Haiku 4.5",description:"Quicker responses",iconNode:s.jsx(ue,{size:16})},smart:{modelId:"claude-code:sonnet",label:"Sonnet 5",description:"Balanced quality",iconNode:s.jsx(ue,{size:16})},thinking:{modelId:"claude-code:opus-1m",label:"Opus 4.8 1M",description:"Deeper reasoning",iconNode:s.jsx(ue,{size:16})}},ai={fast:{modelId:"codex:gpt-5.6-luna",label:"GPT-5.6 Luna",description:"Quicker responses",iconNode:s.jsx(me,{size:16})},smart:{modelId:"codex:gpt-5.6-terra",label:"GPT-5.6 Terra",description:"Balanced quality",iconNode:s.jsx(me,{size:16})},thinking:{modelId:"codex:gpt-5.6-sol",label:"GPT-5.6 Sol",description:"Deeper reasoning",iconNode:s.jsx(me,{size:16})}};function it(i){return i==="claude-code"?{logo:ni,tiers:ri,models:ii}:i==="codex"?{logo:oi,tiers:ai,models:li}:null}function ci(i){const e=B.c(11),{onClose:t,agent:l}=i,n=xe(),o=l??n.pendingHarnessId??"decopilot";let r;e[0]!==o?(r=it(o),e[0]=o,e[1]=r):r=e[1];const a=r;if(!a){let m;return e[2]!==t?(m=s.jsx(Zs,{onClose:t}),e[2]=t,e[3]=m):m=e[3],m}const c=n.selectedModel?.modelId??a.tiers[n.simpleModeTier].modelId;let d;e[4]!==t||e[5]!==n?(d=m=>{n.setModel({...m,keyId:void 0}),t()},e[4]=t,e[5]=n,e[6]=d):d=e[6];let u;return e[7]!==a||e[8]!==c||e[9]!==d?(u=s.jsx(st,{modelSet:a,selectedModelId:c,onSelect:d}),e[7]=a,e[8]=c,e[9]=d,e[10]=u):u=e[10],u}function di(i){const e=B.c(13);let t,l;e[0]!==i?({agent:t,...l}=i,e[0]=i,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let n;e[3]!==t?(n=t?it(t):null,e[3]=t,e[4]=n):n=e[4];const o=n;if(!o){let d;return e[5]!==l?(d=s.jsx(ei,{...l}),e[5]=l,e[6]=d):d=e[6],d}const r=l.selectedModel?.modelId??o.tiers.smart.modelId;let a;e[7]!==l?(a=d=>{l.onModelChange(d),l.onClose()},e[7]=l,e[8]=a):a=e[8];let c;return e[9]!==o||e[10]!==r||e[11]!==a?(c=s.jsx(st,{modelSet:o,selectedModelId:r,onSelect:a}),e[9]=o,e[10]=r,e[11]=a,e[12]=c):c=e[12],c}function Ki(i){const e=B.c(39),{variant:t,className:l,placeholder:n,model:o,isLoading:r,credentialId:a,onCredentialChange:c,onModelChange:d,filterModels:u,agent:m}=i,p=t===void 0?"borderless":t,f=n===void 0?"Select model":n,[g,x]=$.useState(!1),j=d!==void 0,k=vt(),w=p==="borderless"?"ghost":"outline",_=p==="borderless"&&"md:border-none";let I;e[0]!==l||e[1]!==_?(I=ne("text-sm hover:bg-accent rounded-lg py-0.5 px-1 gap-1 shadow-none cursor-pointer border-0 group focus-visible:ring-0 focus-visible:ring-offset-0 min-w-0 shrink justify-start overflow-hidden",_,l),e[0]=l,e[1]=_,e[2]=I):I=e[2];let M;e[3]!==r||e[4]!==o||e[5]!==f||e[6]!==j?(M=j?s.jsx(Xe,{model:o??null,placeholder:f,isLoading:r}):s.jsx(mi,{placeholder:f}),e[3]=r,e[4]=o,e[5]=f,e[6]=j,e[7]=M):M=e[7];let b;e[8]!==w||e[9]!==I||e[10]!==M?(b=s.jsx(ee,{variant:w,size:"sm",className:I,children:M}),e[8]=w,e[9]=I,e[10]=M,e[11]=b):b=e[11];const N=b;let S;e[12]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(qs,{}),e[12]=S):S=e[12];let C;e[13]!==m||e[14]!==a||e[15]!==u||e[16]!==o||e[17]!==c||e[18]!==d||e[19]!==j?(C=s.jsx($.Suspense,{fallback:S,children:j?s.jsx(di,{onClose:()=>x(!1),agent:m,credentialId:a??null,onCredentialChange:c??ui,selectedModel:o??null,onModelChange:d,filterModels:u}):s.jsx(ci,{onClose:()=>x(!1),agent:m})}),e[13]=m,e[14]=a,e[15]=u,e[16]=o,e[17]=c,e[18]=d,e[19]=j,e[20]=C):C=e[20];const h=C;if(k){let A;e[21]!==N?(A=s.jsx(ht,{asChild:!0,children:N}),e[21]=N,e[22]=A):A=e[22];let E;e[23]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx(pt,{className:"sr-only",children:"Select model"}),e[23]=E):E=e[23];let L;e[24]!==h?(L=s.jsxs(xt,{className:"p-0 flex flex-col max-h-[95vh]",children:[E,s.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:h})]}),e[24]=h,e[25]=L):L=e[25];let R;return e[26]!==g||e[27]!==A||e[28]!==L?(R=s.jsxs(gt,{open:g,onOpenChange:x,children:[A,L]}),e[26]=g,e[27]=A,e[28]=L,e[29]=R):R=e[29],R}let y;e[30]!==N?(y=s.jsx(ft,{asChild:!0,children:N}),e[30]=N,e[31]=y):y=e[31];let v;e[32]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(Ke,{className:"sr-only",children:"Select model"}),e[32]=v):v=e[32];let O;e[33]!==h?(O=s.jsxs(Fe,{className:"p-0 gap-0 sm:max-w-fit overflow-hidden h-[100dvh] sm:h-auto max-h-[100dvh] sm:max-h-[85vh] w-full max-w-full sm:max-w-fit rounded-none sm:rounded-xl border-0 sm:border",closeButtonClassName:"top-3.5 right-3.5 z-20",children:[v,h]}),e[33]=h,e[34]=O):O=e[34];let T;return e[35]!==g||e[36]!==y||e[37]!==O?(T=s.jsxs(De,{open:g,onOpenChange:x,children:[y,O]}),e[35]=g,e[36]=y,e[37]=O,e[38]=T):T=e[38],T}function ui(){}function mi(i){const e=B.c(4),{placeholder:t}=i,{selectedModel:l,isModelsLoading:n}=xe();let o;return e[0]!==n||e[1]!==l||e[2]!==t?(o=s.jsx(Xe,{model:l,placeholder:t,isLoading:n}),e[0]=n,e[1]=l,e[2]=t,e[3]=o):o=e[3],o}export{ps as C,Ki as M,bs as N,ce as O,Ge as P,Di as a,Fi as g,$i as i,je as m};
@@ -0,0 +1 @@
1
+ import{Z as ot,_ as we,$ as it,a0 as rt,a1 as Qe,n as fe,a2 as at,a3 as lt,r as B,a4 as ct,a5 as dt,a6 as ut,a7 as mt,a8 as Fe,a9 as ft,aa as pt,ab as ht,c as Q,l as oe,j as s,B as W,d as _e,K as Z,H as he,I as ie,J as ge,M as xe,i as Ce,m as de,t as Se,v as Ne,p as ne,Q as gt,E as xt,a as yt}from"./index-v1F20B0E.js";import{u as Te}from"./use-mcp-client-BmyqfqxQ.js";import{W as Ge,S as bt}from"./constants-D_FQAPnt.js";import{I as Ie}from"./integration-icon-NHRUL2M2.js";import{c as ue,a as Be,h as Ve,D as He,d as We,e as Ye}from"./dialog-BzVEcj79.js";import{b as Oe,T as ke,a as Ae}from"./tooltip-CwWmycdW.js";import{i as Re}from"./CheckCircle-BLRVelyD.js";import{e as Ze,g as vt,h as Xe}from"./agent-icon-DkxLV1fV.js";import{g as Ct,c as jt,e as _t}from"./extract-connection-data-B3b_eFbC.js";import{g as St,f as Nt}from"./github-installations-D2vHSx02.js";import{F as re,a as ye,b as ae,c as ve,d as le,f as ce,e as wt}from"./form-BEFBxu79.js";import{I as be}from"./input-DoMDIxWk.js";import{i as Et}from"./Check-DZygR-Fe.js";import{a as Je}from"./Copy01-ryDblf5m.js";import{i as Tt}from"./Settings02-BQIcnVua.js";import{s as It}from"./Eye-Bz-yLlBh.js";import{u as Ot}from"./use-debounced-value-D_iu4VB9.js";import{a as kt}from"./authenticate-and-persist-oauth-C4jnnZWl.js";import{i as et}from"./ArrowUpRight-L-sW_E0D.js";function Ue(n,e){const t=new Set(e);return n.filter(o=>!t.has(o))}function At(n,e,t){const o=n.slice(0);return o[e]=t,o}var Rt=class extends ot{#o;#e;#i;#n;#t;#s;#r;#a;#l;#c=[];constructor(n,e,t){super(),this.#o=n,this.#n=t,this.#i=[],this.#t=[],this.#e=[],this.setQueries(e)}onSubscribe(){this.listeners.size===1&&this.#t.forEach(n=>{n.subscribe(e=>{this.#f(n,e)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#t.forEach(n=>{n.destroy()})}setQueries(n,e){this.#i=n,this.#n=e,we.batch(()=>{const t=this.#t,o=this.#m(this.#i);o.forEach(a=>a.observer.setOptions(a.defaultedQueryOptions));const i=o.map(a=>a.observer),r=i.map(a=>a.getCurrentResult()),l=t.length!==i.length,c=i.some((a,f)=>a!==t[f]),d=l||c,p=d?!0:r.some((a,f)=>{const u=this.#e[f];return!u||!it(a,u)});!d&&!p||(d&&(this.#c=o,this.#t=i),this.#e=r,this.hasListeners()&&(d&&(Ue(t,i).forEach(a=>{a.destroy()}),Ue(i,t).forEach(a=>{a.subscribe(f=>{this.#f(a,f)})})),this.#p()))})}getCurrentResult(){return this.#e}getQueries(){return this.#t.map(n=>n.getCurrentQuery())}getObservers(){return this.#t}getOptimisticResult(n,e){const t=this.#m(n),o=t.map(r=>r.observer.getOptimisticResult(r.defaultedQueryOptions)),i=t.map(r=>r.defaultedQueryOptions.queryHash);return[o,r=>this.#u(r??o,e,i),()=>this.#d(o,t)]}#d(n,e){return e.map((t,o)=>{const i=n[o];return t.defaultedQueryOptions.notifyOnChangeProps?i:t.observer.trackResult(i,r=>{e.forEach(l=>{l.observer.trackProp(r)})})})}#u(n,e,t){if(e){const o=this.#l,i=t!==void 0&&o!==void 0&&(o.length!==t.length||t.some((r,l)=>r!==o[l]));return(!this.#s||this.#e!==this.#a||i||e!==this.#r)&&(this.#r=e,this.#a=this.#e,t!==void 0&&(this.#l=t),this.#s=rt(this.#s,e(n))),this.#s}return n}#h(){return this.#n?.combine!==void 0&&this.#t.some((n,e)=>n.options.suspense&&this.#e[e]?.data===void 0)}#m(n){const e=new Map;this.#t.forEach(o=>{const i=o.options.queryHash;if(!i)return;const r=e.get(i);r?r.push(o):e.set(i,[o])});const t=[];return n.forEach(o=>{const i=this.#o.defaultQueryOptions(o),l=e.get(i.queryHash)?.shift()??new Qe(this.#o,i);t.push({defaultedQueryOptions:i,observer:l})}),t}#f(n,e){const t=this.#t.indexOf(n);t!==-1&&(this.#e=At(this.#e,t,e),this.#p())}#p(){if(this.hasListeners()){const n=this.#d(this.#e,this.#c),e=this.#h(),t=this.#s,o=e?t:this.#u(n,this.#n?.combine);(e||t!==o)&&we.batch(()=>{this.listeners.forEach(i=>{i(this.#e)})})}}};function Pt({queries:n,...e},t){const o=fe(t),i=at(),r=lt(),l=B.useMemo(()=>n.map(b=>{const h=o.defaultQueryOptions(b);return h._optimisticResults=i?"isRestoring":"optimistic",h}),[n,o,i]);l.forEach(b=>{ct(b);const h=o.getQueryCache().get(b.queryHash);dt(b,r,h)}),ut(r);const[c]=B.useState(()=>new Rt(o,l,e)),[d,p,a]=c.getOptimisticResult(l,e.combine),f=!i&&e.subscribed!==!1;B.useSyncExternalStore(B.useCallback(b=>f?c.subscribe(we.batchCalls(b)):mt,[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),B.useEffect(()=>{c.setQueries(l,e)},[l,e,c]);const g=d.some((b,h)=>Fe(l[h],b))?d.flatMap((b,h)=>{const m=l[h];if(m&&Fe(m,b)){const y=new Qe(o,m);return ft(m,y,r)}return[]}):[];if(g.length>0)throw Promise.all(g);const _=d.find((b,h)=>{const m=l[h];return m&&pt({result:b,errorResetBoundary:r,throwOnError:m.throwOnError,query:o.getQueryCache().get(m.queryHash),suspense:m.suspense})});if(_?.error)throw _.error;return p(a())}function Dt(n,e){return Pt({...n,queries:n.queries.map(t=>({...t,suspense:!0,throwOnError:ht,enabled:!0,placeholderData:void 0}))},e)}const Lt=/^[a-zA-Z][a-zA-Z\d+.-]*:/,$t=/^[a-zA-Z][a-zA-Z\d+.-]*:\/\//,Kt=/^[^\s/:?#]+\.[^\s/:?#]+:\d+(?:[/?#]|$)/,zt=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/i;function je(n){const e=n.trim();if(!e)return{ok:!1,error:"Enter a website URL."};const t=Lt.test(e),o=$t.test(e),i=Kt.test(e);if(t&&!o&&!i)return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const r=o?e:`https://${e}`;let l;try{l=new URL(r)}catch{return{ok:!1,error:"Enter a valid website URL."}}if(l.protocol!=="http:"&&l.protocol!=="https:")return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const c=l.hostname.split(".");return c.length<2||c.some(d=>!d||!zt.test(d))?{ok:!1,error:"Enter a valid website URL."}:(l.protocol="https:",{ok:!0,value:l.origin})}function jn(n,e){if(!n.trim())return!0;const t=je(n);if(!t.ok||!e)return!1;const o=je(e);return o.ok&&o.value===t.value}function _n(n){if(!n)return null;const e=je(n);return e.ok?new URL(e.value).hostname:null}function qt(n){const e=Q.c(14),{children:t,className:o,wrapperClassName:i}=n,[r,l]=B.useState(!0);let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=b=>{if(!b)return;const h=()=>{const y=b.scrollHeight-b.scrollTop-b.clientHeight<8;l(y)};h(),b.addEventListener("scroll",h,{passive:!0});const m=new ResizeObserver(h);m.observe(b);for(const y of Array.from(b.children))m.observe(y);return()=>{b.removeEventListener("scroll",h),m.disconnect()}},e[0]=c):c=e[0];const d=c;let p;e[1]!==i?(p=oe("relative",i),e[1]=i,e[2]=p):p=e[2];let a;e[3]!==t||e[4]!==o?(a=s.jsx("div",{ref:d,className:o,children:t}),e[3]=t,e[4]=o,e[5]=a):a=e[5];const f=r?"opacity-0":"opacity-100";let u;e[6]!==f?(u=oe("pointer-events-none absolute inset-x-0 -bottom-px h-[72px]","bg-gradient-to-t from-sidebar from-[6px] to-transparent","backdrop-blur-[1px] [mask-image:linear-gradient(to_top,black_6px,transparent)]","transition-opacity duration-200",f),e[6]=f,e[7]=u):u=e[7];let g;e[8]!==u?(g=s.jsx("div",{"aria-hidden":!0,className:u}),e[8]=u,e[9]=g):g=e[9];let _;return e[10]!==p||e[11]!==a||e[12]!==g?(_=s.jsxs("div",{className:p,children:[a,g]}),e[10]=p,e[11]=a,e[12]=g,e[13]=_):_=e[13],_}function Ft(n){const e=n.properties;if(!e)return[];const t=[];for(const[o,i]of Object.entries(e)){const c=i?.properties?.__type?.const;typeof c=="string"&&c.length>0&&t.push({fieldKey:o,bindingType:c})}return t}const Ut=[{fieldKey:"vtex",bindingType:"vtex"},{fieldKey:"ga4",bindingType:"google-analytics"},{fieldKey:"gsc",bindingType:"google-search-console"},{fieldKey:"github",bindingType:"github"}];function Mt(n,e){const t=[];if(n.length&&t.push({field:["id"],operator:"in",value:n}),e.length&&t.push({field:["name"],operator:"in",value:e}),t.length!==0)return t.length===1?t[0]:{operator:"or",conditions:t}}function te(n){const e=n;if(e.isError)throw new Error(e.content?.find(t=>t.text)?.text??"Tool call failed");return e.structuredContent??n}function Qt(n,e,t,o){return{...n??{},[e]:{__type:t,value:o}}}function Ee(n){return n==null?!1:typeof n=="string"?n.trim().length>0:typeof n=="number"||typeof n=="boolean"?!0:Array.isArray(n)?n.some(Ee):typeof n=="object"?Object.entries(n).some(([e,t])=>!e.startsWith("__")&&Ee(t)):!1}function Gt(n){const e={accountName:"Nome da conta",appKey:"App Key",appToken:"App Token",propertyId:"Propriedade",siteUrl:"Site"};return e[n]?e[n]:n.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/\b\w/g,t=>t.toUpperCase())}function Bt(n){return Ee(n)?typeof n=="string"?n.trim():typeof n=="number"||typeof n=="boolean"?String(n):JSON.stringify(n):null}function Vt(n){return n?Object.entries(n).flatMap(([e,t])=>{if(e.startsWith("__"))return[];const o=Bt(t);return o?[{key:e,label:Gt(e),value:o}]:[]}):[]}function Ht({autoOpenFieldKey:n,card:e}){return n===e.fieldKey&&e.satisfied&&!!e.linkedConnectionId}function Wt(n,e,t){const o=n.filter(i=>(i.app_name===e||!!t&&i.app_id===t)&&St(i)===null);return o.length===0?null:(o.sort((i,r)=>{const l=c=>c.status==="active"?0:1;return l(i)!==l(r)?l(i)-l(r):(r.updated_at??"").localeCompare(i.updated_at??"")}),o[0].id)}function Yt(n){return n.server?.icons?.[0]?.src??Ct(n.server?.repository)??null}function Zt(n,e){const t=n._meta?.["mcp.mesh"];return t?.friendlyName||t?.friendly_name||n.title||n.server?.title||n.server?.name||e}function Xt(n){const e=[],t=new Map(n.connections.map(o=>[o.id,o]));for(const o of n.requirements){const i=n.curated[o.bindingType],r=i?n.itemsById[i.registryAppId]:n.itemsByName[o.bindingType];if(!r)continue;const l=n.configurationState?.[o.fieldKey]?.value,c=l?t.get(l):void 0,d=l&&c?l:null,p=d?n.connectionReadiness?.[d]!==!1:!1,a=!!d&&p,f=a?void 0:n.saBindings?.[o.bindingType],u=a||!!f,g=a?"oauth":f?"sa":null;e.push({fieldKey:o.fieldKey,bindingType:o.bindingType,registryItem:r,title:Zt(r,o.bindingType),icon:Yt(r),headline:i?.headline??r._meta?.["mcp.mesh"]?.short_description??null,area:i?.area??null,bullets:i?.bullets??[],satisfied:u,candidateConnectionId:u?null:d||Wt(n.connections,o.bindingType,i?.registryAppId),linkedConnectionId:d,configurationState:c?.configuration_state??null,boundVia:g,boundResource:f?.resource??null})}return e}function Jt(n,e){if(!n)return null;const t=i=>{const r=i.startsWith("sc-domain:")?i.substring(10):(()=>{try{return new URL(i.startsWith("http")?i:`https://${i}`).hostname}catch{return null}})();return r===null?i:r.startsWith("www.")?r.substring(4):r},o=t(n);for(const i of e)if(t(i.siteUrl)===o)return i.siteUrl;return null}function es(n){return(n?.response?.accountSummaries??[]).map(o=>({account:o.account,options:(o.propertySummaries??[]).map(i=>({value:i.property,label:`${i.displayName} (${o.displayName})`}))}))}function Me(n){const e=Q.c(38);let t,o,i,r,l;e[0]!==n?({value:l,onChange:o,placeholder:i,className:t,...r}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=i,e[4]=r,e[5]=l):(t=e[1],o=e[2],i=e[3],r=e[4],l=e[5]);const[c,d]=B.useState(!1),[p,a]=B.useState(!1);let f;e[6]!==l?(f=async()=>{if(l)try{await navigator.clipboard.writeText(l),a(!0),setTimeout(()=>a(!1),2e3)}catch(T){console.error("Failed to copy text: ",T)}},e[6]=l,e[7]=f):f=e[7];const u=f;let g;e[8]!==c?(g=()=>{d(!c)},e[8]=c,e[9]=g):g=e[9];const _=g,b=c?"text":"password";let h;e[10]!==t?(h=oe("pr-20",t),e[10]=t,e[11]=h):h=e[11];let m;e[12]!==o||e[13]!==i||e[14]!==r||e[15]!==b||e[16]!==h||e[17]!==l?(m=s.jsx(be,{type:b,value:l,onChange:o,placeholder:i,className:h,...r}),e[12]=o,e[13]=i,e[14]=r,e[15]=b,e[16]=h,e[17]=l,e[18]=m):m=e[18];const y=c?"Hide password":"Show password";let C;e[19]!==c?(C=c?s.jsx(Tt,{size:16}):s.jsx(It,{size:16}),e[19]=c,e[20]=C):C=e[20];let x;e[21]!==y||e[22]!==C||e[23]!==_?(x=s.jsx(W,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:_,title:y,children:C}),e[21]=y,e[22]=C,e[23]=_,e[24]=x):x=e[24];const N=!l,E=p?"Copied!":"Copy token";let j;e[25]!==p?(j=p?s.jsx(Et,{size:16}):s.jsx(Je,{size:16}),e[25]=p,e[26]=j):j=e[26];let v;e[27]!==u||e[28]!==E||e[29]!==j||e[30]!==N?(v=s.jsx(W,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:u,disabled:N,title:E,children:j}),e[27]=u,e[28]=E,e[29]=j,e[30]=N,e[31]=v):v=e[31];let w;e[32]!==v||e[33]!==x?(w=s.jsxs("div",{className:"absolute right-1 top-1 flex items-center gap-1 h-8",children:[x,v]}),e[32]=v,e[33]=x,e[34]=w):w=e[34];let I;return e[35]!==w||e[36]!==m?(I=s.jsxs("div",{className:"relative",children:[m,w]}),e[35]=w,e[36]=m,e[37]=I):I=e[37],I}function Pe(n){const e=Q.c(19),{card:t,selfClient:o,org:i,onDone:r,onError:l}=n,c=fe();let d;e[0]!==t||e[1]!==o?(d=async h=>{const m={...t.configurationState??{},...h};await o.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:t.linkedConnectionId||t.candidateConnectionId,data:{configuration_state:m}}})},e[0]=t,e[1]=o,e[2]=d):d=e[2];let p;e[3]!==r||e[4]!==i||e[5]!==c?(p=async()=>{await c.invalidateQueries({queryKey:Z.commerceDiscoveryCompanionConnectionsPrefix(i.id)}),r()},e[3]=r,e[4]=i,e[5]=c,e[6]=p):p=e[6];let a;e[7]!==l?(a=h=>{l?.(h)},e[7]=l,e[8]=a):a=e[8];let f;e[9]!==d||e[10]!==p||e[11]!==a?(f={mutationFn:d,onSuccess:p,onError:a},e[9]=d,e[10]=p,e[11]=a,e[12]=f):f=e[12];const u=_e(f);let g;e[13]!==u?(g=h=>u.mutate(h),e[13]=u,e[14]=g):g=e[14];const _=g;let b;return e[15]!==u.error||e[16]!==u.isPending||e[17]!==_?(b={save:_,isPending:u.isPending,error:u.error},e[15]=u.error,e[16]=u.isPending,e[17]=_,e[18]=b):b=e[18],b}const ts=he({accountName:ie().min(1,"Informe o nome da conta"),appKey:ie().optional(),appToken:ie().optional()});function ss(n){const e=Q.c(63),{card:t,selfClient:o,org:i,onDone:r,onIsPendingChange:l}=n;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=ge(ts),e[0]=c):c=e[0];const d=t.configurationState?.accountName||"",p=t.configurationState?.appKey||"",a=t.configurationState?.appToken||"";let f;e[1]!==d||e[2]!==p||e[3]!==a?(f={resolver:c,defaultValues:{accountName:d,appKey:p,appToken:a}},e[1]=d,e[2]=p,e[3]=a,e[4]=f):f=e[4];const u=xe(f);let g;e[5]!==t.configurationState?.accountName||e[6]!==t.configurationState?.appKey||e[7]!==t.configurationState?.appToken||e[8]!==u?(g=()=>{u.reset({accountName:t.configurationState?.accountName||"",appKey:t.configurationState?.appKey||"",appToken:t.configurationState?.appToken||""})},e[5]=t.configurationState?.accountName,e[6]=t.configurationState?.appKey,e[7]=t.configurationState?.appToken,e[8]=u,e[9]=g):g=e[9];let _;e[10]!==t.configurationState||e[11]!==u?(_=[t.configurationState,u],e[10]=t.configurationState,e[11]=u,e[12]=_):_=e[12],B.useEffect(g,_);let b;e[13]!==t||e[14]!==r||e[15]!==i||e[16]!==o?(b={card:t,selfClient:o,org:i,onDone:r},e[13]=t,e[14]=r,e[15]=i,e[16]=o,e[17]=b):b=e[17];const{save:h,isPending:m,error:y}=Pe(b);let C,x;e[18]!==m||e[19]!==l?(x=()=>{l?.(m)},C=[m,l],e[18]=m,e[19]=l,e[20]=C,e[21]=x):(C=e[20],x=e[21]),B.useEffect(x,C);let N;if(e[22]!==u||e[23]!==h){let L;e[25]!==h?(L=async O=>{h(O)},e[25]=h,e[26]=L):L=e[26],N=u.handleSubmit(L),e[22]=u,e[23]=h,e[24]=N}else N=e[24];const E=N;let j;e[27]!==m?(j=L=>{const{field:O}=L;return s.jsxs(ae,{children:[s.jsx(ve,{children:"Nome da conta"}),s.jsx(le,{children:s.jsx(be,{placeholder:"Nome da sua conta VTEX",...O,disabled:m})}),s.jsx(ce,{})]})},e[27]=m,e[28]=j):j=e[28];let v;e[29]!==u.control||e[30]!==j?(v=s.jsx(re,{control:u.control,name:"accountName",render:j}),e[29]=u.control,e[30]=j,e[31]=v):v=e[31];let w;e[32]!==m?(w=L=>{const{field:O}=L;return s.jsxs(ae,{children:[s.jsx(ve,{children:"App Key (opcional)"}),s.jsx(le,{children:s.jsx(Me,{placeholder:"App Key da VTEX",...O,disabled:m})}),s.jsx(ce,{})]})},e[32]=m,e[33]=w):w=e[33];let I;e[34]!==u.control||e[35]!==w?(I=s.jsx(re,{control:u.control,name:"appKey",render:w}),e[34]=u.control,e[35]=w,e[36]=I):I=e[36];let T;e[37]!==m?(T=L=>{const{field:O}=L;return s.jsxs(ae,{children:[s.jsx(ve,{children:"App Token (opcional)"}),s.jsx(le,{children:s.jsx(Me,{placeholder:"App Token da VTEX",...O,disabled:m})}),s.jsx(ce,{})]})},e[37]=m,e[38]=T):T=e[38];let S;e[39]!==u.control||e[40]!==T?(S=s.jsx(re,{control:u.control,name:"appToken",render:T}),e[39]=u.control,e[40]=T,e[41]=S):S=e[41];let k;e[42]!==u||e[43]!==v||e[44]!==I||e[45]!==S?(k=s.jsxs(ye,{...u,children:[v,I,S]}),e[42]=u,e[43]=v,e[44]=I,e[45]=S,e[46]=k):k=e[46];let A;e[47]!==y?(A=y&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:y instanceof Error?y.message:"Não foi possível salvar a configuração"}),e[47]=y,e[48]=A):A=e[48];let P;e[49]!==m||e[50]!==r?(P=s.jsx(W,{type:"button",variant:"outline",onClick:r,disabled:m,children:"Cancelar"}),e[49]=m,e[50]=r,e[51]=P):P=e[51];const F=m?"Salvando...":"Salvar";let K;e[52]!==m||e[53]!==F?(K=s.jsx(W,{type:"submit",disabled:m,children:F}),e[52]=m,e[53]=F,e[54]=K):K=e[54];let q;e[55]!==P||e[56]!==K?(q=s.jsxs(ue,{className:"pt-4",children:[P,K]}),e[55]=P,e[56]=K,e[57]=q):q=e[57];let D;return e[58]!==E||e[59]!==k||e[60]!==A||e[61]!==q?(D=s.jsxs("form",{onSubmit:E,className:"space-y-4",children:[k,A,q]}),e[58]=E,e[59]=k,e[60]=A,e[61]=q,e[62]=D):D=e[62],D}function De(n){const e=Q.c(29),{options:t,value:o,onChange:i,disabled:r,ariaLabel:l,searchPlaceholder:c,hideSearch:d}=n,p=c===void 0?"Buscar...":c,a=d===void 0?!1:d,[f,u]=B.useState("");let g,_,b;if(e[0]!==t||e[1]!==f||e[2]!==o){const j=f.trim().toLowerCase();g=j?t.filter(v=>v.label.toLowerCase().includes(j)):t,_=g.map(ns),b=_.includes(o)?o:_[0]??"",e[0]=t,e[1]=f,e[2]=o,e[3]=g,e[4]=_,e[5]=b}else g=e[3],_=e[4],b=e[5];const h=b;let m;e[6]!==r||e[7]!==_||e[8]!==i?(m=function(v){if(r||!["ArrowDown","ArrowRight","ArrowUp","ArrowLeft","Home","End"].includes(v.key))return;v.preventDefault();const I=v.currentTarget.dataset.value,T=_.indexOf(I),S=_.length;if(S===0)return;let k;v.key==="ArrowDown"||v.key==="ArrowRight"?k=(T+1)%S:v.key==="ArrowUp"||v.key==="ArrowLeft"?k=(T-1+S)%S:v.key==="Home"?k=0:k=S-1;const A=_[k];i(A),v.currentTarget.closest('[role="radiogroup"]')?.querySelector(`[data-value="${CSS.escape(A)}"]`)?.focus()},e[6]=r,e[7]=_,e[8]=i,e[9]=m):m=e[9];const y=m;let C;e[10]!==l||e[11]!==r||e[12]!==a||e[13]!==f||e[14]!==p?(C=a?null:s.jsxs("div",{className:"relative",children:[s.jsx(Ze,{size:16,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),s.jsx(be,{type:"text",value:f,onChange:j=>u(j.target.value),disabled:r,placeholder:p,"aria-label":`Buscar ${l}`,className:"h-8 pl-8"})]}),e[10]=l,e[11]=r,e[12]=a,e[13]=f,e[14]=p,e[15]=C):C=e[15];let x;e[16]!==r||e[17]!==g||e[18]!==y||e[19]!==i||e[20]!==h||e[21]!==o?(x=g.length===0?s.jsx("div",{className:"px-2 py-2 text-sm text-muted-foreground",children:"Nenhum resultado"}):g.map(j=>{const v=j.value===o;return s.jsxs("button",{type:"button",role:"radio","aria-checked":v,disabled:r,"data-value":j.value,tabIndex:j.value===h?0:-1,onClick:()=>i(j.value),onKeyDown:y,className:oe("flex w-full items-center justify-between gap-2 rounded-sm px-2 py-2 text-left text-sm","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","disabled:pointer-events-none disabled:opacity-50",v?"bg-muted font-medium text-foreground":"text-foreground hover:bg-muted/50"),children:[s.jsx("span",{className:"truncate",children:j.label}),v?s.jsx(Re,{size:16,className:"shrink-0 text-primary"}):null]},j.value)}),e[16]=r,e[17]=g,e[18]=y,e[19]=i,e[20]=h,e[21]=o,e[22]=x):x=e[22];let N;e[23]!==l||e[24]!==x?(N=s.jsx("div",{role:"radiogroup","aria-label":l,className:"max-h-[280px] overflow-y-auto",children:x}),e[23]=l,e[24]=x,e[25]=N):N=e[25];let E;return e[26]!==C||e[27]!==N?(E=s.jsxs("div",{className:"space-y-2",children:[C,N]}),e[26]=C,e[27]=N,e[28]=E):E=e[28],E}function ns(n){return n.value}function Le(n){const e=Q.c(16),{label:t,iconSize:o,className:i,iconClassName:r,labelClassName:l}=n,c=o===void 0?14:o;let d;e[0]!==i?(d=oe("inline-flex items-center gap-2",i),e[0]=i,e[1]=d):d=e[1];let p;e[2]!==r?(p=oe("shrink-0 animate-spin",r),e[2]=r,e[3]=p):p=e[3];let a;e[4]!==c||e[5]!==p?(a=s.jsx(Ce,{size:c,className:p}),e[4]=c,e[5]=p,e[6]=a):a=e[6];let f;e[7]!==l?(f=oe("text-sm",l),e[7]=l,e[8]=f):f=e[8];let u;e[9]!==t||e[10]!==f?(u=s.jsx("span",{className:f,children:t}),e[9]=t,e[10]=f,e[11]=u):u=e[11];let g;return e[12]!==d||e[13]!==a||e[14]!==u?(g=s.jsxs("span",{className:d,children:[a,u]}),e[12]=d,e[13]=a,e[14]=u,e[15]=g):g=e[15],g}const os=he({propertyId:ie().min(1,"Selecione uma propriedade")});function is(n){const e=Q.c(68),{card:t,connectionId:o,companionClient:i,selfClient:r,org:l,onDone:c,onDisconnect:d,onIsPendingChange:p}=n;let a;e[0]!==o||e[1]!==l.id?(a=Z.commerceDiscoveryCompanionGaProperties(l.id,o),e[0]=o,e[1]=l.id,e[2]=a):a=e[2];let f;e[3]!==i?(f=async()=>{const $=await i.callTool({name:"get-account-summaries",arguments:{}}),U=te($);return es(U)},e[3]=i,e[4]=f):f=e[4];let u;e[5]!==a||e[6]!==f?(u={queryKey:a,queryFn:f},e[5]=a,e[6]=f,e[7]=u):u=e[7];const g=de(u);let _;e[8]===Symbol.for("react.memo_cache_sentinel")?(_=ge(os),e[8]=_):_=e[8];const b=t.configurationState?.propertyId||"";let h;e[9]!==b?(h={resolver:_,defaultValues:{propertyId:b}},e[9]=b,e[10]=h):h=e[10];const m=xe(h);let y;e[11]!==t||e[12]!==c||e[13]!==l||e[14]!==r?(y={card:t,selfClient:r,org:l,onDone:c},e[11]=t,e[12]=c,e[13]=l,e[14]=r,e[15]=y):y=e[15];const{save:C,isPending:x,error:N}=Pe(y);let E,j;e[16]!==x||e[17]!==p?(E=()=>{p?.(x)},j=[x,p],e[16]=x,e[17]=p,e[18]=E,e[19]=j):(E=e[18],j=e[19]),B.useEffect(E,j);let v;if(e[20]!==m||e[21]!==C){let $;e[23]!==C?($=async U=>{C(U)},e[23]=C,e[24]=$):$=e[24],v=m.handleSubmit($),e[20]=m,e[21]=C,e[22]=v}else v=e[22];const w=v;if(g.isLoading){let $;return e[25]===Symbol.for("react.memo_cache_sentinel")?($=s.jsx("div",{className:"flex min-h-[200px] items-center justify-center",children:s.jsx(Le,{label:"Carregando propriedades..."})}),e[25]=$):$=e[25],$}if(g.isError){let $;return e[26]===Symbol.for("react.memo_cache_sentinel")?($=s.jsx("div",{className:"space-y-4",children:s.jsx("p",{className:"text-sm text-destructive",children:"Não foi possível carregar as propriedades do Google Analytics."})}),e[26]=$):$=e[26],$}let I;e[27]!==g.data?(I=g.data||[],e[27]=g.data,e[28]=I):I=e[28];const T=I;if(T.flatMap(as).length===0){let $;e[29]===Symbol.for("react.memo_cache_sentinel")?($=s.jsx("p",{className:"text-sm text-muted-foreground",children:"Nenhuma propriedade do Google Analytics foi encontrada. Conecte uma conta do Google Analytics com propriedades."}),e[29]=$):$=e[29];let U;e[30]!==d?(U=d?s.jsx("button",{type:"button",onClick:d,className:"text-xs text-muted-foreground underline underline-offset-2 hover:text-destructive",children:"Desconectar conta"}):s.jsx("span",{}),e[30]=d,e[31]=U):U=e[31];let V;e[32]!==c?(V=s.jsx(W,{type:"button",variant:"outline",onClick:c,children:"Fechar"}),e[32]=c,e[33]=V):V=e[33];let Y;return e[34]!==U||e[35]!==V?(Y=s.jsxs("div",{className:"space-y-4",children:[$,s.jsxs(ue,{className:"flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[U,V]})]}),e[34]=U,e[35]=V,e[36]=Y):Y=e[36],Y}let k;e[37]!==x||e[38]!==T?(k=$=>{const{field:U}=$;return s.jsxs(ae,{children:[s.jsx(le,{children:s.jsx(De,{options:T.flatMap(rs),value:U.value,onChange:U.onChange,disabled:x,ariaLabel:"Propriedade do Google Analytics"})}),s.jsx(ce,{})]})},e[37]=x,e[38]=T,e[39]=k):k=e[39];let A;e[40]!==m.control||e[41]!==k?(A=s.jsx(re,{control:m.control,name:"propertyId",render:k}),e[40]=m.control,e[41]=k,e[42]=A):A=e[42];let P;e[43]!==m||e[44]!==A?(P=s.jsx(ye,{...m,children:A}),e[43]=m,e[44]=A,e[45]=P):P=e[45];let F;e[46]!==N?(F=N&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:N instanceof Error?N.message:"Não foi possível salvar a configuração"}),e[46]=N,e[47]=F):F=e[47];let K;e[48]!==x||e[49]!==d?(K=d?s.jsx("button",{type:"button",onClick:d,disabled:x,className:"text-xs text-muted-foreground underline underline-offset-2 hover:text-destructive disabled:opacity-50",children:"Desconectar conta"}):s.jsx("span",{}),e[48]=x,e[49]=d,e[50]=K):K=e[50];let q;e[51]!==x||e[52]!==c?(q=s.jsx(W,{type:"button",variant:"outline",onClick:c,disabled:x,children:"Cancelar"}),e[51]=x,e[52]=c,e[53]=q):q=e[53];const D=x?"Salvando...":"Salvar";let L;e[54]!==x||e[55]!==D?(L=s.jsx(W,{type:"submit",disabled:x,children:D}),e[54]=x,e[55]=D,e[56]=L):L=e[56];let O;e[57]!==q||e[58]!==L?(O=s.jsxs("div",{className:"flex gap-2",children:[q,L]}),e[57]=q,e[58]=L,e[59]=O):O=e[59];let z;e[60]!==K||e[61]!==O?(z=s.jsxs(ue,{className:"flex-col gap-2 pt-4 sm:flex-row sm:items-center sm:justify-between",children:[K,O]}),e[60]=K,e[61]=O,e[62]=z):z=e[62];let M;return e[63]!==w||e[64]!==P||e[65]!==F||e[66]!==z?(M=s.jsxs("form",{onSubmit:w,className:"space-y-4",children:[P,F,z]}),e[63]=w,e[64]=P,e[65]=F,e[66]=z,e[67]=M):M=e[67],M}function rs(n){return n.options}function as(n){return n.options}const ls=he({siteUrl:ie().min(1,"Selecione um site")});function cs(n){const e=Q.c(59),{card:t,connectionId:o,companionClient:i,selfClient:r,org:l,contextSiteUrl:c,onDone:d,onIsPendingChange:p}=n;let a;e[0]!==o||e[1]!==l.id?(a=Z.commerceDiscoveryCompanionGscSites(l.id,o),e[0]=o,e[1]=l.id,e[2]=a):a=e[2];let f;e[3]!==i?(f=async()=>{const O=await i.callTool({name:"list_sites",arguments:{}});return te(O).sites||[]},e[3]=i,e[4]=f):f=e[4];let u;e[5]!==a||e[6]!==f?(u={queryKey:a,queryFn:f},e[5]=a,e[6]=f,e[7]=u):u=e[7];const g=de(u);let _;e[8]===Symbol.for("react.memo_cache_sentinel")?(_=ge(ls),e[8]=_):_=e[8];const b=t.configurationState?.siteUrl||"";let h;e[9]!==b?(h={resolver:_,defaultValues:{siteUrl:b}},e[9]=b,e[10]=h):h=e[10];const m=xe(h);let y;e[11]!==t||e[12]!==d||e[13]!==l||e[14]!==r?(y={card:t,selfClient:r,org:l,onDone:d},e[11]=t,e[12]=d,e[13]=l,e[14]=r,e[15]=y):y=e[15];const{save:C,isPending:x,error:N}=Pe(y);let E,j;e[16]!==x||e[17]!==p?(E=()=>{p?.(x)},j=[x,p],e[16]=x,e[17]=p,e[18]=E,e[19]=j):(E=e[18],j=e[19]),B.useEffect(E,j);let v;if(e[20]!==m||e[21]!==C){let O;e[23]!==C?(O=async z=>{C(z)},e[23]=C,e[24]=O):O=e[24],v=m.handleSubmit(O),e[20]=m,e[21]=C,e[22]=v}else v=e[22];const w=v;if(g.isLoading){let O;return e[25]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx("div",{className:"flex min-h-[200px] items-center justify-center",children:s.jsx(Le,{label:"Carregando sites..."})}),e[25]=O):O=e[25],O}if(g.isError){let O;return e[26]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx("div",{className:"space-y-4",children:s.jsx("p",{className:"text-sm text-destructive",children:"Não foi possível carregar os sites do Google Search Console."})}),e[26]=O):O=e[26],O}let I,T;if(e[27]!==t.configurationState?.siteUrl||e[28]!==c||e[29]!==m||e[30]!==g.data){T=Symbol.for("react.early_return_sentinel");e:{if(I=g.data||[],I.length===0){let z;e[33]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx("div",{className:"space-y-4",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:"Nenhum site verificado foi encontrado. Verifique um site no Google Search Console."})}),e[33]=z):z=e[33],T=z;break e}const O=t.configurationState?.siteUrl;if(O&&m.getValues("siteUrl")!==O)m.setValue("siteUrl",O);else if(!O&&!m.getValues("siteUrl")){const z=Jt(c,I);z&&m.setValue("siteUrl",z)}}e[27]=t.configurationState?.siteUrl,e[28]=c,e[29]=m,e[30]=g.data,e[31]=I,e[32]=T}else I=e[31],T=e[32];if(T!==Symbol.for("react.early_return_sentinel"))return T;let S;e[34]!==x||e[35]!==I?(S=O=>{const{field:z}=O;return s.jsxs(ae,{children:[s.jsx(le,{children:s.jsx(De,{options:I.map(ds),value:z.value,onChange:z.onChange,disabled:x,ariaLabel:"Site verificado"})}),s.jsx(ce,{})]})},e[34]=x,e[35]=I,e[36]=S):S=e[36];let k;e[37]!==m.control||e[38]!==S?(k=s.jsx(re,{control:m.control,name:"siteUrl",render:S}),e[37]=m.control,e[38]=S,e[39]=k):k=e[39];let A;e[40]!==m||e[41]!==k?(A=s.jsx(ye,{...m,children:k}),e[40]=m,e[41]=k,e[42]=A):A=e[42];let P;e[43]!==N?(P=N&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:N instanceof Error?N.message:"Não foi possível salvar a configuração"}),e[43]=N,e[44]=P):P=e[44];let F;e[45]!==x||e[46]!==d?(F=s.jsx(W,{type:"button",variant:"outline",onClick:d,disabled:x,children:"Cancelar"}),e[45]=x,e[46]=d,e[47]=F):F=e[47];const K=x?"Salvando...":"Salvar";let q;e[48]!==x||e[49]!==K?(q=s.jsx(W,{type:"submit",disabled:x,children:K}),e[48]=x,e[49]=K,e[50]=q):q=e[50];let D;e[51]!==F||e[52]!==q?(D=s.jsxs(ue,{className:"pt-4",children:[F,q]}),e[51]=F,e[52]=q,e[53]=D):D=e[53];let L;return e[54]!==w||e[55]!==A||e[56]!==P||e[57]!==D?(L=s.jsxs("form",{onSubmit:w,className:"space-y-4",children:[A,P,D]}),e[54]=w,e[55]=A,e[56]=P,e[57]=D,e[58]=L):L=e[58],L}function ds(n){return{value:n.siteUrl,label:n.siteUrl}}const us=he({githubRepo:ie().min(1,"Selecione um repositório")}),ms=15e3,fs=/^[\w.-]+\/[\w.-]+$/;async function ps(n,e,t,o){const{installations:i}=await Nt(n,t),r=o.trim(),l=await Promise.allSettled(i.map(async a=>{const f=a.type==="User"?"user":"org",u=r?`${f}:${a.login} ${r} in:name`:`${f}:${a.login}`,_=await e.callTool({name:"search_repositories",arguments:{query:u,page:1,perPage:50}},void 0,{signal:AbortSignal.timeout(ms)}),b=_.content?.[0]?.text;if(_.isError)throw new Error(b??"search_repositories failed");if(!b)throw new Error("empty search_repositories response");return JSON.parse(b).items??[]})),c=new Map;let d=0;for(const a of l){if(a.status==="rejected"){d+=1;continue}for(const f of a.value)f.full_name&&!c.has(f.full_name)&&c.set(f.full_name,f)}return{repos:Array.from(c.values()).sort((a,f)=>(f.updated_at??"").localeCompare(a.updated_at??"")).map(a=>a.full_name),failed:d,total:i.length}}function hs(n){const e=Q.c(80),{connectionId:t,companionClient:o,selfClient:i,org:r,onDone:l,onIsPendingChange:c}=n,d=fe();let p;e[0]!==r.id?(p=Ge.COMMERCE_DISCOVERY(r.id),e[0]=r.id,e[1]=p):p=e[1];const a=p,[f,u]=B.useState(""),g=Ot(f,300);let _;e[2]!==t||e[3]!==r.id?(_=Z.commerceDiscoveryCompanionGithubSelected(r.id,t),e[2]=t,e[3]=r.id,e[4]=_):_=e[4];let b;e[5]!==a||e[6]!==i?(b=async()=>{const H=await i.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:a}}),ee=te(H).item?.configuration_state??null;return typeof ee?.github_repo=="string"?ee.github_repo:""},e[5]=a,e[6]=i,e[7]=b):b=e[7];let h;e[8]!==_||e[9]!==b?(h={queryKey:_,queryFn:b},e[8]=_,e[9]=b,e[10]=h):h=e[10];const m=de(h);let y;e[11]!==t||e[12]!==g||e[13]!==r.id?(y=Z.commerceDiscoveryCompanionGithubRepos(r.id,t,g.trim()),e[11]=t,e[12]=g,e[13]=r.id,e[14]=y):y=e[14];let C;e[15]!==o||e[16]!==t||e[17]!==g||e[18]!==i?(C=()=>ps(H=>i.callTool(H),o,t,g),e[15]=o,e[16]=t,e[17]=g,e[18]=i,e[19]=C):C=e[19];let x;e[20]!==y||e[21]!==C?(x={queryKey:y,queryFn:C},e[20]=y,e[21]=C,e[22]=x):x=e[22];const N=de(x);let E;e[23]===Symbol.for("react.memo_cache_sentinel")?(E={resolver:ge(us),defaultValues:{githubRepo:""}},e[23]=E):E=e[23];const j=xe(E);let v;e[24]!==a||e[25]!==i?(v=async H=>{const ee=await i.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:a}}),nt={...te(ee).item?.configuration_state??null??{},github_repo:H};await i.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:a,data:{configuration_state:nt}}})},e[24]=a,e[25]=i,e[26]=v):v=e[26];let w;e[27]!==a||e[28]!==l||e[29]!==r.id||e[30]!==d?(w=async()=>{await d.invalidateQueries({queryKey:Z.commerceDiscoveryConnection(r.id,a)}),await d.invalidateQueries({queryKey:Z.commerceDiscoveryCompanionConnectionsPrefix(r.id)}),l()},e[27]=a,e[28]=l,e[29]=r.id,e[30]=d,e[31]=w):w=e[31];let I;e[32]!==w||e[33]!==v?(I={mutationFn:v,onSuccess:w},e[32]=w,e[33]=v,e[34]=I):I=e[34];const T=_e(I),S=T.isPending;let k,A;e[35]!==S||e[36]!==c?(k=()=>{c?.(S)},A=[S,c],e[35]=S,e[36]=c,e[37]=k,e[38]=A):(k=e[37],A=e[38]),B.useEffect(k,A);let P;if(e[39]!==j||e[40]!==T){let H;e[42]!==T?(H=async ee=>{T.mutate(ee.githubRepo)},e[42]=T,e[43]=H):H=e[43],P=j.handleSubmit(H),e[39]=j,e[40]=T,e[41]=P}else P=e[41];const F=P,K=m.data??"";K&&j.getValues("githubRepo")!==K&&j.setValue("githubRepo",K);let q,D,L;if(e[44]!==g||e[45]!==N.data?.failed||e[46]!==N.data?.repos||e[47]!==N.data?.total||e[48]!==K){const H=N.data?.repos??[];q=N.data?.failed??0,L=N.data?.total??0;const ee=g.trim();D=[...H],ee&&fs.test(ee)&&!D.includes(ee)&&D.unshift(ee),K&&!D.includes(K)&&D.push(K),e[44]=g,e[45]=N.data?.failed,e[46]=N.data?.repos,e[47]=N.data?.total,e[48]=K,e[49]=q,e[50]=D,e[51]=L}else q=e[49],D=e[50],L=e[51];const O=L>0&&q===L,z=N.isError||O?"Não foi possível buscar os repositórios (erro ou tempo esgotado). Tente novamente ou digite o repositório no formato owner/nome.":q>0?"Parte da busca falhou — alguns repositórios podem não ter aparecido. Tente novamente ou digite owner/nome.":null;let M;e[52]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsx(Ze,{size:16,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),e[52]=M):M=e[52];let $;e[53]===Symbol.for("react.memo_cache_sentinel")?($=H=>u(H.target.value),e[53]=$):$=e[53];let U;e[54]!==S||e[55]!==f?(U=s.jsxs("div",{className:"relative",children:[M,s.jsx(be,{type:"text",value:f,onChange:$,disabled:S,placeholder:"Buscar repositório","aria-label":"Buscar repositório",className:"h-8 pl-8"})]}),e[54]=S,e[55]=f,e[56]=U):U=e[56];let V;e[57]!==j||e[58]!==S||e[59]!==D||e[60]!==N.isLoading||e[61]!==z?(V=N.isLoading?s.jsx("div",{className:"flex min-h-[160px] items-center justify-center",children:s.jsx(Le,{label:"Carregando repositórios..."})}):s.jsxs(s.Fragment,{children:[z&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:z}),D.length===0?!z&&s.jsx("p",{className:"text-sm text-muted-foreground",children:"Nenhum repositório encontrado. Digite o nome do repositório (owner/nome) para buscar."}):s.jsx(ye,{...j,children:s.jsx(re,{control:j.control,name:"githubRepo",render:H=>{const{field:ee}=H;return s.jsxs(ae,{children:[s.jsx(le,{children:s.jsx(De,{options:D.map(gs),value:ee.value,onChange:ee.onChange,disabled:S,ariaLabel:"Repositório",hideSearch:!0})}),s.jsx(ce,{})]})}})})]}),e[57]=j,e[58]=S,e[59]=D,e[60]=N.isLoading,e[61]=z,e[62]=V):V=e[62];let Y;e[63]!==T.error?(Y=T.error&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:T.error instanceof Error?T.error.message:"Não foi possível salvar a configuração"}),e[63]=T.error,e[64]=Y):Y=e[64];let X;e[65]!==S||e[66]!==l?(X=s.jsx(W,{type:"button",variant:"outline",onClick:l,disabled:S,children:"Cancelar"}),e[65]=S,e[66]=l,e[67]=X):X=e[67];const se=S?"Salvando...":"Salvar";let G;e[68]!==S||e[69]!==se?(G=s.jsx(W,{type:"submit",disabled:S,children:se}),e[68]=S,e[69]=se,e[70]=G):G=e[70];let R;e[71]!==X||e[72]!==G?(R=s.jsxs(ue,{className:"pt-4",children:[X,G]}),e[71]=X,e[72]=G,e[73]=R):R=e[73];let J;return e[74]!==F||e[75]!==U||e[76]!==V||e[77]!==Y||e[78]!==R?(J=s.jsxs("form",{onSubmit:F,className:"space-y-4",children:[U,V,Y,R]}),e[74]=F,e[75]=U,e[76]=V,e[77]=Y,e[78]=R,e[79]=J):J=e[79],J}function gs(n){return{value:n,label:n}}const xs={vtex:ss,"google-analytics":is,"google-search-console":cs,github:hs},me="deco-reader@decocms.iam.gserviceaccount.com",tt={"google-analytics":"ga4","google-search-console":"gsc"},st={ga4:{label:"Google Analytics",resourceLabel:"ID da propriedade",resourcePlaceholder:"ex: 123456789",resourceHint:"No GA4: Admin → Detalhes da propriedade → ID da propriedade (só números).",connectSteps:["Abra o Google Analytics (GA4) da sua loja.","Vá em Admin → Acesso à propriedade (Gerenciamento de acesso).",`Clique em + → Adicionar usuários, cole ${me} e conceda o papel Leitor.`,"Copie o ID da propriedade (Admin → Detalhes da propriedade) e cole abaixo."]},gsc:{label:"Google Search Console",resourceLabel:"Site / propriedade",resourcePlaceholder:"ex: sc-domain:sualoja.com.br",resourceHint:"Use o mesmo formato que aparece no Search Console: sc-domain:sualoja.com.br ou https://www.sualoja.com.br/.",connectSteps:["Abra o Google Search Console da sua loja.","Vá em Configurações → Usuários e permissões.",`Clique em Adicionar usuário, cole ${me} e escolha permissão Completa.`,"Copie o endereço do site como aparece no seletor de propriedades e cole abaixo."]}};function ys(n,e){const t=st[n].label;switch(e){case"no-access":return{title:`Ainda não conseguimos acessar este recurso no ${t}.`,steps:n==="ga4"?[`Confirme que ${me} foi adicionado em Admin → Acesso à propriedade com o papel Leitor.`,"Confira se o ID da propriedade está correto (só números, sem o prefixo 'properties/').","A concessão de acesso pode levar alguns segundos — tente novamente."]:[`Confirme que ${me} foi adicionado em Configurações → Usuários e permissões.`,"A permissão precisa ser Completa ou Restrita — 'Não verificado' não funciona.","Confira se o endereço do site está exatamente como aparece no Search Console."]};case"no-web-stream":return{title:"Esta propriedade do GA4 não tem um fluxo de dados da Web (site) configurado.",steps:["No GA4, vá em Admin → Fluxos de dados.","Clique em Adicionar fluxo → Web.","Informe a URL do site da sua loja e salve o fluxo.","Volte aqui e tente vincular de novo. (Propriedades só de app precisam de vínculo manual — fale com o suporte.)"]};case"no-match":return{title:"O recurso informado não corresponde ao domínio desta loja.",steps:n==="ga4"?["Verifique se digitou o ID da propriedade certa — provavelmente é de outro site.","No GA4, o site medido aparece em Admin → Fluxos de dados → (seu fluxo Web) → URL do stream."]:["Verifique se selecionou a propriedade do Search Console referente a esta loja.","O endereço precisa cobrir o mesmo domínio do diagnóstico."]};case"resource_already_bound":return{title:"Este recurso já está vinculado a outra loja.",steps:["Se este recurso é realmente desta loja, fale com o suporte para uma revisão manual.","Caso tenha digitado o id errado, confira e tente novamente."]};default:return{title:"Não foi possível verificar o acesso a este recurso.",steps:["Revise os passos de acesso acima e tente novamente.","Se persistir, fale com o suporte."]}}}function bs(n){const e=Q.c(76),{provider:t,siteUrl:o,selfClient:i,org:r,initialResourceId:l,onDone:c,onIsPendingChange:d,onOAuthInstead:p}=n,a=st[t],f=fe(),[u,g]=B.useState(null);let _,b;if(e[0]!==a.resourceLabel){const G=he({resourceId:ie().trim().min(1,`Informe o ${a.resourceLabel.toLowerCase()}`)});b=xe,_=ge(G),e[0]=a.resourceLabel,e[1]=_,e[2]=b}else _=e[1],b=e[2];const h=l??"";let m;e[3]!==h?(m={resourceId:h},e[3]=h,e[4]=m):m=e[4];let y;e[5]!==_||e[6]!==m?(y={resolver:_,defaultValues:m},e[5]=_,e[6]=m,e[7]=y):y=e[7];const C=b(y);let x;e[8]!==t||e[9]!==i||e[10]!==o?(x=async G=>{if(!o)throw new Error("URL da loja indisponível — recarregue a página.");const R=await i.callTool({name:"COMMERCE_DISCOVERY_BIND",arguments:{siteUrl:o,provider:t,resourceId:G.resourceId}});return te(R)},e[8]=t,e[9]=i,e[10]=o,e[11]=x):x=e[11];let N,E;e[12]!==d?(N=()=>d?.(!0),E=()=>d?.(!1),e[12]=d,e[13]=N,e[14]=E):(N=e[13],E=e[14]);let j;e[15]!==a.label||e[16]!==c||e[17]!==r||e[18]!==t||e[19]!==f||e[20]!==o?(j=async G=>{if(G.ok){g(null),Se.success(`${a.label} conectado`),o&&await f.invalidateQueries({queryKey:Z.commerceDiscoveryConnectionStatus(r.id,o)}),c();return}g({...ys(t,G.reason??"unknown"),detail:G.detail})},e[15]=a.label,e[16]=c,e[17]=r,e[18]=t,e[19]=f,e[20]=o,e[21]=j):j=e[21];let v;e[22]!==x||e[23]!==N||e[24]!==E||e[25]!==j?(v={mutationFn:x,onMutate:N,onSettled:E,onSuccess:j},e[22]=x,e[23]=N,e[24]=E,e[25]=j,e[26]=v):v=e[26];const w=_e(v);let I;if(e[27]!==C||e[28]!==w){let G;e[30]!==w?(G=R=>w.mutate(R),e[30]=w,e[31]=G):G=e[31],I=C.handleSubmit(G),e[27]=C,e[28]=w,e[29]=I}else I=e[29];const T=I,S=w.isPending,k=js;let A;e[32]!==a.connectSteps?(A=a.connectSteps.map(Cs),e[32]=a.connectSteps,e[33]=A):A=e[33];let P;e[34]!==A?(P=s.jsx("ol",{className:"space-y-2 text-sm text-muted-foreground",children:A}),e[34]=A,e[35]=P):P=e[35];let F;e[36]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx("code",{className:"min-w-0 flex-1 truncate text-xs text-foreground",children:me}),e[36]=F):F=e[36];let K;e[37]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-border bg-muted/40 p-2",children:[F,s.jsx(W,{type:"button",variant:"ghost",size:"icon-sm",onClick:k,"aria-label":"Copiar e-mail do service account",children:s.jsx(Je,{size:16})})]}),e[37]=K):K=e[37];let q;e[38]!==a.resourceHint||e[39]!==a.resourceLabel||e[40]!==a.resourcePlaceholder||e[41]!==S?(q=G=>{const{field:R}=G;return s.jsxs(ae,{children:[s.jsx(ve,{children:a.resourceLabel}),s.jsx(le,{children:s.jsx(be,{...R,placeholder:a.resourcePlaceholder,disabled:S,autoComplete:"off"})}),s.jsx(wt,{children:a.resourceHint}),s.jsx(ce,{})]})},e[38]=a.resourceHint,e[39]=a.resourceLabel,e[40]=a.resourcePlaceholder,e[41]=S,e[42]=q):q=e[42];let D;e[43]!==C.control||e[44]!==q?(D=s.jsx(re,{control:C.control,name:"resourceId",render:q}),e[43]=C.control,e[44]=q,e[45]=D):D=e[45];let L;e[46]!==C||e[47]!==D?(L=s.jsx(ye,{...C,children:D}),e[46]=C,e[47]=D,e[48]=L):L=e[48];let O;e[49]!==u?(O=u&&s.jsxs("div",{role:"alert",className:"space-y-2 rounded-lg border border-destructive/40 bg-destructive/5 p-3",children:[s.jsx("p",{className:"text-sm font-medium text-foreground",children:u.title}),s.jsx("ol",{className:"space-y-1 text-sm text-muted-foreground",children:u.steps.map(vs)})]}),e[49]=u,e[50]=O):O=e[50];let z;e[51]!==w.error||e[52]!==w.isError?(z=w.isError&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:w.error instanceof Error?w.error.message:"Não foi possível vincular."}),e[51]=w.error,e[52]=w.isError,e[53]=z):z=e[53];let M;e[54]!==S||e[55]!==p?(M=p?s.jsx("button",{type:"button",onClick:p,disabled:S,className:"text-xs text-muted-foreground underline underline-offset-2 hover:text-foreground disabled:opacity-50",children:"autorizar via login do Google"}):s.jsx("span",{}),e[54]=S,e[55]=p,e[56]=M):M=e[56];let $;e[57]!==S||e[58]!==c?($=s.jsx(W,{type:"button",variant:"outline",onClick:c,disabled:S,children:"Cancelar"}),e[57]=S,e[58]=c,e[59]=$):$=e[59];const U=S?"Verificando...":"Vincular";let V;e[60]!==S||e[61]!==U?(V=s.jsx(W,{type:"submit",disabled:S,children:U}),e[60]=S,e[61]=U,e[62]=V):V=e[62];let Y;e[63]!==$||e[64]!==V?(Y=s.jsxs("div",{className:"flex gap-2",children:[$,V]}),e[63]=$,e[64]=V,e[65]=Y):Y=e[65];let X;e[66]!==M||e[67]!==Y?(X=s.jsxs(ue,{className:"flex-col gap-2 pt-2 sm:flex-row sm:items-center sm:justify-between",children:[M,Y]}),e[66]=M,e[67]=Y,e[68]=X):X=e[68];let se;return e[69]!==T||e[70]!==P||e[71]!==L||e[72]!==O||e[73]!==z||e[74]!==X?(se=s.jsxs("form",{onSubmit:T,className:"space-y-4",children:[P,K,L,O,z,X]}),e[69]=T,e[70]=P,e[71]=L,e[72]=O,e[73]=z,e[74]=X,e[75]=se):se=e[75],se}function vs(n){return s.jsxs("li",{className:"flex gap-2",children:[s.jsx("span",{"aria-hidden":!0,children:"•"}),s.jsx("span",{children:n})]},n)}function Cs(n,e){return s.jsxs("li",{className:"flex gap-2",children:[s.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center rounded-full bg-muted text-xs font-medium text-foreground",children:e+1}),s.jsx("span",{children:n})]},n)}function js(){navigator.clipboard?.writeText(me),Se.success("E-mail copiado")}function _s(){const n=Q.c(2);let e;n[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"size-9 shrink-0 animate-pulse rounded-lg bg-muted/60"}),n[0]=e):e=n[0];let t;return n[1]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsxs("div",{className:"flex items-center gap-3 rounded-2xl border border-border bg-card p-3 sm:h-full sm:flex-col sm:items-stretch sm:p-4",children:[e,s.jsxs("div",{className:"min-w-0 flex-1 space-y-2",children:[s.jsx("div",{className:"h-4 w-24 animate-pulse rounded bg-muted/60"}),s.jsx("div",{className:"hidden h-3 w-full animate-pulse rounded bg-muted/60 sm:block"})]}),s.jsx("div",{className:"h-8 w-20 shrink-0 animate-pulse rounded-lg bg-muted/60 sm:mt-auto sm:w-full"})]}),n[1]=t):t=n[1],t}const Ss="rounded-full bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground";function Ns(n){const e=Q.c(36),{card:t,connecting:o,disconnecting:i,disabled:r,onConnect:l,onDisconnect:c,org:d,selfClient:p,siteUrl:a,autoOpenConfigFieldKey:f,onAutoOpenConfigHandled:u}=n,g=t.linkedConnectionId,_=tt[t.bindingType],b=!!_&&t.boundVia!=="oauth";let h;e[0]!==f||e[1]!==t||e[2]!==o||e[3]!==r||e[4]!==i||e[5]!==g||e[6]!==u||e[7]!==l||e[8]!==c||e[9]!==d||e[10]!==_||e[11]!==p||e[12]!==a||e[13]!==b?(h=b&&_?s.jsx(ws,{card:t,provider:_,org:d,selfClient:p,siteUrl:a,onOAuthInstead:l,disabled:r,connecting:o}):t.satisfied&&g?s.jsxs("div",{className:"flex items-center justify-end gap-1 sm:justify-start",children:[s.jsxs("span",{className:"flex items-center gap-1.5 text-sm text-muted-foreground",children:[s.jsx(Re,{size:16,className:"text-success"})," Conectado"]}),s.jsx(B.Suspense,{fallback:s.jsx(Es,{}),children:s.jsx(Ts,{card:t,org:d,selfClient:p,connectionId:g,contextSiteUrl:a,autoOpen:Ht({autoOpenFieldKey:f,card:t}),onAutoOpenHandled:u})}),s.jsxs(Oe,{children:[s.jsx(ke,{asChild:!0,children:s.jsx(W,{type:"button",variant:"ghost",size:"icon-sm",className:"shrink-0 text-muted-foreground hover:text-destructive",disabled:r||i,onClick:c,"aria-label":`Desconectar ${t.title}`,children:i?s.jsx(Ce,{size:16,className:"animate-spin"}):s.jsx(vt,{size:16})})}),s.jsx(Ae,{children:"Desconectar"})]})]}):s.jsx(W,{type:"button",variant:"outline",size:"sm",className:"sm:w-full",disabled:r||o,onClick:l,"aria-label":`Conectar ${t.title}`,children:o?s.jsx(Ce,{size:16,className:"animate-spin"}):"Conectar"}),e[0]=f,e[1]=t,e[2]=o,e[3]=r,e[4]=i,e[5]=g,e[6]=u,e[7]=l,e[8]=c,e[9]=d,e[10]=_,e[11]=p,e[12]=a,e[13]=b,e[14]=h):h=e[14];const m=h;let y;e[15]!==t.icon||e[16]!==t.title?(y=s.jsx(Ie,{icon:t.icon,name:t.title,size:"sm",fit:"contain",className:"shrink-0 p-1.5"}),e[15]=t.icon,e[16]=t.title,e[17]=y):y=e[17];let C;e[18]!==t.area?(C=t.area&&s.jsx("span",{className:oe("hidden sm:inline-block",Ss),children:t.area}),e[18]=t.area,e[19]=C):C=e[19];let x;e[20]!==y||e[21]!==C?(x=s.jsxs("div",{className:"shrink-0 sm:flex sm:w-full sm:items-center sm:justify-between sm:gap-2",children:[y,C]}),e[20]=y,e[21]=C,e[22]=x):x=e[22];let N;e[23]!==t.title?(N=s.jsx("p",{className:"text-sm font-medium text-foreground",children:t.title}),e[23]=t.title,e[24]=N):N=e[24];let E;e[25]!==t.headline?(E=t.headline&&s.jsx("p",{className:"hidden text-sm leading-5 text-muted-foreground sm:mt-0.5 sm:line-clamp-2 sm:block",children:t.headline}),e[25]=t.headline,e[26]=E):E=e[26];let j;e[27]!==N||e[28]!==E?(j=s.jsxs("div",{className:"min-w-0 flex-1",children:[N,E]}),e[27]=N,e[28]=E,e[29]=j):j=e[29];let v;e[30]!==m?(v=s.jsx("div",{className:"shrink-0 sm:mt-auto sm:w-full sm:pt-1",children:m}),e[30]=m,e[31]=v):v=e[31];let w;return e[32]!==x||e[33]!==j||e[34]!==v?(w=s.jsxs("div",{className:"flex items-center gap-3 rounded-2xl border border-border bg-card p-3 sm:h-full sm:flex-col sm:items-stretch sm:p-4",children:[x,j,v]}),e[32]=x,e[33]=j,e[34]=v,e[35]=w):w=e[35],w}function ws(n){const e=Q.c(39),{card:t,provider:o,org:i,selfClient:r,siteUrl:l,onOAuthInstead:c,disabled:d,connecting:p}=n,[a,f]=B.useState(!1),[u,g]=B.useState(!1);let _;e[0]!==u?(_=k=>{!k&&u||f(k)},e[0]=u,e[1]=_):_=e[1];const b=_;let h;e[2]!==t.satisfied||e[3]!==t.title||e[4]!==p||e[5]!==d?(h=t.satisfied?s.jsxs("div",{className:"flex items-center justify-end gap-1 sm:justify-start",children:[s.jsxs("span",{className:"flex items-center gap-1.5 text-sm text-muted-foreground",children:[s.jsx(Re,{size:16,className:"text-success"})," Conectado"]}),s.jsxs(Oe,{children:[s.jsx(ke,{asChild:!0,children:s.jsx(W,{type:"button",variant:"ghost",size:"icon-sm",className:"shrink-0",onClick:()=>f(!0),"aria-label":`Configurar ${t.title}`,children:s.jsx(Xe,{size:16})})}),s.jsx(Ae,{children:"Editar configuração"})]})]}):s.jsx(W,{type:"button",variant:"outline",size:"sm",className:"sm:w-full",disabled:d||p,onClick:()=>f(!0),"aria-label":`Conectar ${t.title}`,children:p?s.jsx(Ce,{size:16,className:"animate-spin"}):"Conectar"}),e[2]=t.satisfied,e[3]=t.title,e[4]=p,e[5]=d,e[6]=h):h=e[6];let m;e[7]!==t.icon||e[8]!==t.title?(m=s.jsx(Ie,{icon:t.icon,name:t.title,size:"md",fit:"contain",className:"p-1.5"}),e[7]=t.icon,e[8]=t.title,e[9]=m):m=e[9];let y;e[10]!==t.title?(y=s.jsx(Be,{children:t.title}),e[10]=t.title,e[11]=y):y=e[11];let C;e[12]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(Ve,{children:"Conceda acesso ao nosso leitor e informe o identificador"}),e[12]=C):C=e[12];let x;e[13]!==y?(x=s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[y,C]}),e[13]=y,e[14]=x):x=e[14];let N;e[15]!==m||e[16]!==x?(N=s.jsxs(He,{className:"flex-row items-center gap-3 space-y-0 text-left",children:[m,x]}),e[15]=m,e[16]=x,e[17]=N):N=e[17];const E=t.boundResource??void 0;let j;e[18]===Symbol.for("react.memo_cache_sentinel")?(j=()=>f(!1),e[18]=j):j=e[18];let v;e[19]!==t.satisfied||e[20]!==c?(v=t.satisfied?void 0:()=>{f(!1),c()},e[19]=t.satisfied,e[20]=c,e[21]=v):v=e[21];let w;e[22]!==i||e[23]!==o||e[24]!==r||e[25]!==l||e[26]!==v||e[27]!==E?(w=s.jsx(bs,{provider:o,siteUrl:l,selfClient:r,org:i,initialResourceId:E,onDone:j,onIsPendingChange:g,onOAuthInstead:v}),e[22]=i,e[23]=o,e[24]=r,e[25]=l,e[26]=v,e[27]=E,e[28]=w):w=e[28];let I;e[29]!==w||e[30]!==N?(I=s.jsxs(We,{className:"sm:max-w-lg",children:[N,w]}),e[29]=w,e[30]=N,e[31]=I):I=e[31];let T;e[32]!==b||e[33]!==a||e[34]!==I?(T=s.jsx(Ye,{open:a,onOpenChange:b,children:I}),e[32]=b,e[33]=a,e[34]=I,e[35]=T):T=e[35];let S;return e[36]!==T||e[37]!==h?(S=s.jsxs(s.Fragment,{children:[h,T]}),e[36]=T,e[37]=h,e[38]=S):S=e[38],S}function Es(){const n=Q.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"size-8 shrink-0 animate-pulse rounded-lg bg-muted/60"}),n[0]=e):e=n[0],e}function Ts(n){const e=Q.c(60),{card:t,org:o,selfClient:i,connectionId:r,contextSiteUrl:l,autoOpen:c,onAutoOpenHandled:d}=n;let p;e[0]!==r||e[1]!==o.id||e[2]!==o.slug?(p={connectionId:r,orgId:o.id,orgSlug:o.slug},e[0]=r,e[1]=o.id,e[2]=o.slug,e[3]=p):p=e[3];const a=Te(p),[f,u]=B.useState(c),[g,_]=B.useState(!1),b=fe(),h=xs[t.bindingType],m=Vt(t.configurationState);let y;e[4]!==c||e[5]!==d?(y=()=>{u(!1),c&&d()},e[4]=c,e[5]=d,e[6]=y):y=e[6];const C=y;let x;e[7]!==C||e[8]!==g?(x=U=>{if(!(!U&&g)){if(!U){C();return}u(!0)}},e[7]=C,e[8]=g,e[9]=x):x=e[9];const N=x;let E;e[10]!==r||e[11]!==i?(E=async()=>{await i.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:r,force:!0}})},e[10]=r,e[11]=i,e[12]=E):E=e[12];let j;e[13]!==t.title||e[14]!==C||e[15]!==o.id||e[16]!==b?(j=async()=>{await b.invalidateQueries({queryKey:Z.commerceDiscoveryCompanionConnectionsPrefix(o.id)}),Se.success(`${t.title} desconectado`),C()},e[13]=t.title,e[14]=C,e[15]=o.id,e[16]=b,e[17]=j):j=e[17];let v;e[18]!==E||e[19]!==j?(v={mutationFn:E,onSuccess:j,onError:Is},e[18]=E,e[19]=j,e[20]=v):v=e[20];const w=_e(v);if(!h)return null;let I;e[21]===Symbol.for("react.memo_cache_sentinel")?(I=()=>u(!0),e[21]=I):I=e[21];const T=`Configurar ${t.title}`;let S;e[22]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(Xe,{size:16}),e[22]=S):S=e[22];let k;e[23]!==T?(k=s.jsx(ke,{asChild:!0,children:s.jsx(W,{type:"button",variant:"ghost",size:"icon-sm",className:"shrink-0",onClick:I,"aria-label":T,children:S})}),e[23]=T,e[24]=k):k=e[24];const A=m.length>0?"Editar configuração":"Configurar";let P;e[25]!==A?(P=s.jsx(Ae,{children:A}),e[25]=A,e[26]=P):P=e[26];let F;e[27]!==k||e[28]!==P?(F=s.jsxs(Oe,{children:[k,P]}),e[27]=k,e[28]=P,e[29]=F):F=e[29];let K;e[30]!==t.icon||e[31]!==t.title?(K=s.jsx(Ie,{icon:t.icon,name:t.title,size:"md",fit:"contain",className:"p-1.5"}),e[30]=t.icon,e[31]=t.title,e[32]=K):K=e[32];let q;e[33]!==t.title?(q=s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[s.jsx(Be,{children:t.title}),s.jsxs(Ve,{children:["Configure o ",t.title," para enriquecer os dados"]})]}),e[33]=t.title,e[34]=q):q=e[34];let D;e[35]!==K||e[36]!==q?(D=s.jsxs(He,{className:"flex-row items-center gap-3 space-y-0 text-left",children:[K,q]}),e[35]=K,e[36]=q,e[37]=D):D=e[37];let L;e[38]!==w?(L=()=>w.mutate(),e[38]=w,e[39]=L):L=e[39];let O;e[40]!==h||e[41]!==t||e[42]!==C||e[43]!==a||e[44]!==r||e[45]!==l||e[46]!==o||e[47]!==i||e[48]!==L?(O=s.jsx(h,{card:t,connectionId:r,companionClient:a,selfClient:i,org:o,contextSiteUrl:l,onDone:C,onDisconnect:L,onIsPendingChange:_}),e[40]=h,e[41]=t,e[42]=C,e[43]=a,e[44]=r,e[45]=l,e[46]=o,e[47]=i,e[48]=L,e[49]=O):O=e[49];let z;e[50]!==D||e[51]!==O?(z=s.jsxs(We,{className:"sm:max-w-lg",children:[D,O]}),e[50]=D,e[51]=O,e[52]=z):z=e[52];let M;e[53]!==f||e[54]!==N||e[55]!==z?(M=s.jsx(Ye,{open:f,onOpenChange:N,children:z}),e[53]=f,e[54]=N,e[55]=z,e[56]=M):M=e[56];let $;return e[57]!==F||e[58]!==M?($=s.jsxs(s.Fragment,{children:[F,M]}),e[57]=F,e[58]=M,e[59]=$):$=e[59],$}function Is(){Se.error("Não foi possível desconectar. Tente novamente.")}const $e={vtex:{registryAppId:"deco/vtex",area:"Catálogo",headline:"Rupturas e PDPs que travam suas vendas."},"google-analytics":{registryAppId:"deco/google-analytics",area:"Funil",headline:"Onde a receita vaza no seu funil."},"google-search-console":{registryAppId:"deco/google-search-console",area:"Busca",headline:"O tráfego de busca que você deixa na mesa."},github:{registryAppId:"deco/mcp-github",area:"Engenharia",headline:"A saúde da entrega de código por trás da sua loja."}};function Os(n){const e=Q.c(40),{selfClient:t,org:o,cdConnectionId:i,siteUrl:r}=n;let l;e[0]!==i||e[1]!==o.id||e[2]!==o.slug?(l={connectionId:i,orgId:o.id,orgSlug:o.slug},e[0]=i,e[1]=o.id,e[2]=o.slug,e[3]=l):l=e[3];const c=Te(l);let d;e[4]!==i||e[5]!==o.id?(d=Z.commerceDiscoveryCompanionSchema(o.id,i),e[4]=i,e[5]=o.id,e[6]=d):d=e[6];let p;e[7]!==c?(p=async()=>{const R=await c.callTool({name:"MCP_CONFIGURATION",arguments:{}});return te(R)},e[7]=c,e[8]=p):p=e[8];let a;e[9]!==d||e[10]!==p?(a={queryKey:d,queryFn:p,retry:!1},e[9]=d,e[10]=p,e[11]=a):a=e[11];const f=de(a),u=f.data?.stateSchema?Ft(f.data.stateSchema):null,g=u&&u.length>0?u:Ut,_=g.map(qs),b=g.map(zs).filter(Ks),h=g.filter($s).map(Ls),m=[...b,...h].sort().join(",");let y;e[12]!==i||e[13]!==o.id?(y=Z.commerceDiscoveryConnection(o.id,i),e[12]=i,e[13]=o.id,e[14]=y):y=e[14];let C;e[15]!==i||e[16]!==t?(C=async()=>{const R=await t.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:i}});return te(R)},e[15]=i,e[16]=t,e[17]=C):C=e[17];let x;e[18]!==y||e[19]!==C?(x={queryKey:y,queryFn:C},e[18]=y,e[19]=C,e[20]=x):x=e[20];const E=Ne(x).data?.item?.configuration_state??null;let j;e[21]!==E?(j=R=>E?.[R.fieldKey]?.value,e[21]=E,e[22]=j):j=e[22];const v=g.map(j).filter(Ds),w=[..._.map(Ps),...b.map(Rs),...v.map(As)].sort().join(","),T=Ne({queryKey:Z.commerceDiscoveryCompanionConnections(o.id,w),queryFn:async()=>{if(g.length===0)return{items:[]};const R=[{field:["app_name"],operator:"in",value:_},{field:["app_id"],operator:"in",value:b}];v.length>0&&R.push({field:["id"],operator:"in",value:v});const J=await t.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{operator:"or",conditions:R},limit:1e3}});return te(J)}}).data?.items??[],S=new Set(v),k=T.filter(R=>S.has(R.id)),A=k.filter(ks);let P;e[23]!==o.id||e[24]!==o.slug?(P=R=>({queryKey:Z.commerceDiscoveryCompanionOAuthStatus(o.id,R.id),queryFn:async()=>{try{const J=await fetch(`/api/${encodeURIComponent(o.slug)}/connections/${encodeURIComponent(R.id)}/oauth-token/status`,{credentials:"include"});return J.ok?{hasToken:(await J.json()).hasToken===!0}:{hasToken:!1}}catch{return{hasToken:!1}}},retry:!1}),e[23]=o.id,e[24]=o.slug,e[25]=P):P=e[25];const F=Dt({queries:A.map(P)});let K;e[26]!==F?(K=(R,J)=>[R.id,F[J]?.data?.hasToken===!0],e[26]=F,e[27]=K):K=e[27];const q=new Map(A.map(K)),D={};for(const R of k)D[R.id]=!R.oauth_config||!!R.connection_token||q.get(R.id)===!0;const L=Ne({queryKey:Z.commerceDiscoveryCompanionRegistry(o.id,m),queryFn:async()=>{if(g.length===0)return{items:[]};const R=Mt(b,h),J=await jt(Ge.REGISTRY(o.id),o.id,o.slug,"COLLECTION_REGISTRY_APP_LIST",{...R?{where:R}:{},limit:1e3});return te(J)}}),O={},z={};for(const R of L.data?.items??[])O[R.id]=R,R.server?.name&&(z[R.server.name]=R);let M;e[28]!==o.id||e[29]!==r?(M=Z.commerceDiscoveryConnectionStatus(o.id,r??""),e[28]=o.id,e[29]=r,e[30]=M):M=e[30];const $=!!r;let U;e[31]!==t||e[32]!==r?(U=async()=>{const R=await t.callTool({name:"COMMERCE_DISCOVERY_CONNECTION_STATUS",arguments:{siteUrl:r}});return te(R)},e[31]=t,e[32]=r,e[33]=U):U=e[33];let V;e[34]!==M||e[35]!==$||e[36]!==U?(V={queryKey:M,enabled:$,queryFn:U},e[34]=M,e[35]=$,e[36]=U,e[37]=V):V=e[37];const Y=de(V),X={};for(const[R,J]of Object.entries(tt)){const H=Y.data?.providers?.[J];H?.connected&&H.via==="sa"&&(X[R]={resource:H.resource??null})}const se=Xt({requirements:g,itemsById:O,itemsByName:z,connections:T,connectionReadiness:D,configurationState:E,curated:$e,saBindings:X});let G;return e[38]!==se?(G={cards:se},e[38]=se,e[39]=G):G=e[39],G}function ks(n){return n.oauth_config&&!n.connection_token}function As(n){return`linked:${n}`}function Rs(n){return`app:${n}`}function Ps(n){return`binding:${n}`}function Ds(n){return typeof n=="string"&&n.length>0}function Ls(n){return n.bindingType}function $s(n){return!$e[n.bindingType]}function Ks(n){return!!n}function zs(n){return $e[n.bindingType]?.registryAppId}function qs(n){return n.bindingType}function Fs({selfClient:n,org:e,userId:t,cdConnectionId:o,domain:i,siteUrl:r}){const l=fe(),[c,d]=B.useState(null),[p,a]=B.useState(null),[f,u]=B.useState(null),g=async(h,m)=>{const y=await n.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:h,data:m}});return te(y)};async function _(h){d(h.fieldKey),u(null);const m={app_name:h.title,field_key:h.fieldKey,organization_id:e.id,domain:i,site_url:r};ne("commerce_onboarding_companion_connect_clicked",m);try{let y=h.candidateConnectionId;if(!y){const v=_t(h.registryItem,e.id,t,{remoteIndex:0}),w=v.connection_type==="STDIO",I=!!v.connection_url,T=w&&v.connection_headers&&typeof v.connection_headers=="object"&&"command"in v.connection_headers;if(!I&&!T)return ne("commerce_onboarding_companion_connect_failed",{...m,error:"no_connection_method"}),u(`${h.title} cannot be connected: no connection method available`),!1;const S=await n.callTool({name:"COLLECTION_CONNECTIONS_CREATE",arguments:{data:v}});y=te(S).item.id}const C=y,x=await kt({connectionId:C,orgId:e.id,orgSlug:e.slug,persistFallback:v=>g(C,{connection_token:v}).then(()=>{})});if(!x.ok)return ne("commerce_onboarding_companion_connect_failed",{...m,error:x.error}),u(`Couldn't sign in to ${h.title}: ${x.error}`),!1;const N=await n.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:o}}),E=te(N).item?.configuration_state??null,j=Qt(E,h.fieldKey,h.bindingType,C);return h.bindingType==="github"&&delete j.github_repo,await g(o,{configuration_state:j}),await l.invalidateQueries({queryKey:Z.commerceDiscoveryConnection(e.id,o)}),await l.invalidateQueries({queryKey:Z.commerceDiscoveryCompanionConnectionsPrefix(e.id)}),ne("commerce_onboarding_companion_connected",m),!0}catch(y){return ne("commerce_onboarding_companion_connect_failed",{...m,error:y instanceof Error?y.message:String(y)}),u(y instanceof Error?y.message:String(y)),!1}finally{d(null)}}async function b(h){a(h.fieldKey),u(null);const m={app_name:h.title,field_key:h.fieldKey,organization_id:e.id,domain:i,site_url:r};ne("commerce_onboarding_companion_disconnect_clicked",m);try{const y=await n.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:o}}),x={...te(y).item?.configuration_state??null??{}};return delete x[h.fieldKey],h.bindingType==="github"&&delete x.github_repo,await g(o,{configuration_state:x}),await l.invalidateQueries({queryKey:Z.commerceDiscoveryConnection(e.id,o)}),await l.invalidateQueries({queryKey:Z.commerceDiscoveryCompanionConnectionsPrefix(e.id)}),ne("commerce_onboarding_companion_disconnected",m),!0}catch(y){return ne("commerce_onboarding_companion_disconnect_failed",{...m,error:y instanceof Error?y.message:String(y)}),u(y instanceof Error?y.message:String(y)),!1}finally{a(null)}}return{connect:_,connectingFieldKey:c,disconnect:b,disconnectingFieldKey:p,error:f}}const Ke="flex min-h-0 flex-1 flex-col gap-4 md:grid md:flex-none md:gap-4";function ze(){const n=Q.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("h1",{className:"text-lg font-medium leading-6 text-foreground lg:text-2xl lg:leading-8",children:"Conecte suas ferramentas para ver o diagnóstico completo"}),n[0]=e):e=n[0],e}function Us(){const n=Q.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[0,1,2,3].map(Ms)}),n[0]=e):e=n[0],e}function Ms(n){return s.jsx(_s,{},n)}function Qs(){const n=Q.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:Ke,children:[s.jsx(ze,{}),s.jsx(Us,{})]}),n[0]=e):e=n[0],e}function Gs(n){const e=Q.c(5),{onRetry:t}=n;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(ze,{}),e[0]=o):o=e[0];let i,r;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("p",{className:"text-sm text-foreground",children:"Não foi possível carregar as integrações complementares."}),r=s.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Algo deu errado ao carregar suas integrações."}),e[1]=i,e[2]=r):(i=e[1],r=e[2]);let l;return e[3]!==t?(l=s.jsxs("div",{className:Ke,children:[o,s.jsxs("div",{role:"alert",className:"rounded-2xl border border-border bg-card p-4",children:[i,r,s.jsx(W,{type:"button",variant:"outline",size:"sm",className:"mt-3",onClick:t,children:"Tentar novamente"})]})]}),e[3]=t,e[4]=l):l=e[4],l}function Sn(n){const e=Q.c(2);let t;return e[0]!==n?(t=s.jsx(gt,{children:o=>{const{reset:i}=o;return s.jsx(xt,{fallback:r=>{const{resetError:l}=r;return s.jsx(Gs,{onRetry:()=>{i(),l()}})},children:s.jsx(B.Suspense,{fallback:s.jsx(Qs,{}),children:s.jsx(Bs,{...n})})})}}),e[0]=n,e[1]=t):t=e[1],t}function Bs(n){const e=Q.c(46),{org:t,cdConnectionId:o,siteUrl:i,onReadinessChange:r}=n,{data:l}=yt.useSession(),c=l?.user?.id??"";let d;if(e[0]!==i){const T=i?je(i):null;if(T?.ok)try{d=new URL(T.value).hostname}catch{d=void 0}e[0]=i,e[1]=d}else d=e[1];let p;e[2]!==t.id||e[3]!==t.slug?(p={connectionId:bt,orgId:t.id,orgSlug:t.slug},e[2]=t.id,e[3]=t.slug,e[4]=p):p=e[4];const a=Te(p);let f;e[5]!==o||e[6]!==t||e[7]!==a||e[8]!==i?(f={selfClient:a,org:t,cdConnectionId:o,siteUrl:i},e[5]=o,e[6]=t,e[7]=a,e[8]=i,e[9]=f):f=e[9];const{cards:u}=Os(f);let g;e[10]!==o||e[11]!==t||e[12]!==a||e[13]!==d||e[14]!==i||e[15]!==c?(g={selfClient:a,org:t,userId:c,cdConnectionId:o,domain:d,siteUrl:i},e[10]=o,e[11]=t,e[12]=a,e[13]=d,e[14]=i,e[15]=c,e[16]=g):g=e[16];const{connect:_,connectingFieldKey:b,disconnect:h,disconnectingFieldKey:m,error:y}=Fs(g),[C,x]=B.useState(null);if(r?.(u.length===0||u.some(Vs)),u.length===0)return null;const N=b!==null||m!==null;let E;e[17]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx(ze,{}),e[17]=E):E=e[17];let j;e[18]!==y?(j=y&&s.jsx("p",{role:"alert",className:"mb-3 text-sm text-destructive",children:y}),e[18]=y,e[19]=j):j=e[19];let v;if(e[20]!==C||e[21]!==N||e[22]!==u||e[23]!==_||e[24]!==b||e[25]!==h||e[26]!==m||e[27]!==t||e[28]!==a||e[29]!==i){let T;e[31]!==C||e[32]!==N||e[33]!==_||e[34]!==b||e[35]!==h||e[36]!==m||e[37]!==t||e[38]!==a||e[39]!==i?(T=S=>{const k=async()=>{await _(S)&&x(S.fieldKey)};return s.jsx(Ns,{card:S,connecting:b===S.fieldKey,disconnecting:m===S.fieldKey,disabled:N&&b!==S.fieldKey&&m!==S.fieldKey,org:t,selfClient:a,siteUrl:i,autoOpenConfigFieldKey:C,onAutoOpenConfigHandled:()=>x(A=>A===S.fieldKey?null:A),onConnect:()=>{k()},onDisconnect:()=>{h(S)}},S.fieldKey)},e[31]=C,e[32]=N,e[33]=_,e[34]=b,e[35]=h,e[36]=m,e[37]=t,e[38]=a,e[39]=i,e[40]=T):T=e[40],v=u.map(T),e[20]=C,e[21]=N,e[22]=u,e[23]=_,e[24]=b,e[25]=h,e[26]=m,e[27]=t,e[28]=a,e[29]=i,e[30]=v}else v=e[30];let w;e[41]!==v?(w=s.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:v}),e[41]=v,e[42]=w):w=e[42];let I;return e[43]!==j||e[44]!==w?(I=s.jsxs("div",{className:Ke,children:[E,s.jsxs(qt,{wrapperClassName:"flex min-h-0 flex-1 flex-col md:block",className:"-mx-1 min-h-0 flex-1 overflow-y-auto px-1 md:max-h-[min(60vh,calc(100dvh-330px))] md:flex-none",children:[j,w]})]}),e[43]=j,e[44]=w,e[45]=I):I=e[45],I}function Vs(n){return n.satisfied}const qe="https://decocms.com/agendar",Hs="Precisa de ajuda? Fale conosco",Ws="Agende uma chamada e ajudamos você a conectar suas ferramentas.",pe=[{photo:"https://decoims.com/image?src=decocms%2Fb07a1c19-0cd6-49c8-b326-86055ee78605%2Fauthor-1763423987973-baby.jpeg&quality=original&fit=cover&width=200&height=200",alt:"Especialista da deco"},{photo:"https://decoims.com/decocms/07c2daf4-a3c2-485e-a1a8-341585a06e3b/cecilia.png",alt:"Especialista da deco"},{photo:"https://decoims.com/decocms/48013ca2-3277-464b-b0f1-dd5f1f08d986/tavano.png",alt:"Especialista da deco"}],Ys="var(--brand-green-dark)";function Nn({siteUrl:n,email:e}){const t=new URL(qe);return n&&t.searchParams.set("siteUrl",n),e&&t.searchParams.set("email",e),t.toString()}function Zs(n){const e=Q.c(12),{href:t,size:o,className:i,orgId:r}=n,l=t===void 0?qe:t,c=o===void 0?"lg":o;let d;e[0]!==i?(d=oe("w-full",i),e[0]=i,e[1]=d):d=e[1];let p;e[2]!==r?(p=()=>ne("commerce_onboarding_meeting_cta_clicked",{placement:"visual_card",organization_id:r}),e[2]=r,e[3]=p):p=e[3];let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(et,{size:16}),e[4]=a):a=e[4];let f;e[5]!==l||e[6]!==p?(f=s.jsxs("a",{href:l,target:"_blank",rel:"noreferrer",onClick:p,children:["Agendar uma reunião",a]}),e[5]=l,e[6]=p,e[7]=f):f=e[7];let u;return e[8]!==c||e[9]!==d||e[10]!==f?(u=s.jsx(W,{asChild:!0,variant:"outline",size:c,className:d,children:f}),e[8]=c,e[9]=d,e[10]=f,e[11]=u):u=e[11],u}function Xs(n){const e=Q.c(10),{size:t}=n,o=t===void 0?72:t;let i;e[0]!==o?(i=Math.round(o*.3),e[0]=o,e[1]=i):i=e[1];const r=i;let l;e[2]!==o?(l={height:o},e[2]=o,e[3]=l):l=e[3];let c;e[4]!==r||e[5]!==o?(c=pe.map((p,a)=>s.jsxs("div",{className:"relative shrink-0",style:{width:o,height:o,marginLeft:a===0?0:-r,zIndex:pe.length-a},children:[s.jsx("div",{className:"h-full w-full overflow-hidden rounded-full border-4 border-card bg-muted",children:s.jsx("img",{src:p.photo,alt:p.alt,className:"h-full w-full object-cover",loading:"lazy"})}),a===0&&s.jsxs("span",{className:"absolute bottom-1.5 right-1.5 flex h-3.5 w-3.5",children:[s.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full bg-success opacity-60 motion-safe:animate-ping","aria-hidden":!0}),s.jsx("span",{className:"relative inline-flex h-3.5 w-3.5 rounded-full border-2 border-card bg-success"})]})]},p.photo)),e[4]=r,e[5]=o,e[6]=c):c=e[6];let d;return e[7]!==l||e[8]!==c?(d=s.jsx("div",{className:"flex items-end",style:l,children:c}),e[7]=l,e[8]=c,e[9]=d):d=e[9],d}function wn(n){const e=Q.c(6),{href:t,orgId:o}=n;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"h-20",style:{backgroundColor:Ys}}),e[0]=i):i=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"-mt-9 mb-4",children:s.jsx(Xs,{})}),e[1]=r):r=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs("div",{className:"grid gap-1.5",children:[s.jsx("h2",{className:"text-lg font-medium leading-6 text-foreground",children:Hs}),s.jsx("p",{className:"text-sm leading-5 text-muted-foreground",children:Ws})]}),e[2]=l):l=e[2];let c;return e[3]!==t||e[4]!==o?(c=s.jsx("div",{className:"relative flex h-full w-full items-center justify-center p-10",children:s.jsxs("div",{className:"w-full max-w-[440px] overflow-hidden rounded-3xl border border-border bg-card card-shadow",children:[i,s.jsxs("div",{className:"px-8 pb-8",children:[r,l,s.jsx(Zs,{href:t,size:"lg",className:"mt-6",orgId:o})]})]})}),e[3]=t,e[4]=o,e[5]=c):c=e[5],c}function En(n){const e=Q.c(13),{className:t,href:o,orgId:i}=n,r=o===void 0?qe:o;let l;e[0]!==i?(l=()=>ne("commerce_onboarding_meeting_cta_clicked",{placement:"mobile_banner",organization_id:i}),e[0]=i,e[1]=l):l=e[1];let c;e[2]!==t?(c=oe("flex items-center gap-3 rounded-xl border border-border bg-card p-3 card-shadow transition-colors hover:bg-accent",t),e[2]=t,e[3]=c):c=e[3];let d,p;e[4]===Symbol.for("react.memo_cache_sentinel")?(d={height:32,width:32+2*Math.round(22.4)},p=pe.map(Js),e[4]=d,e[5]=p):(d=e[4],p=e[5]);let a,f,u;e[6]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsxs("span",{className:"relative flex shrink-0 items-center",style:d,children:[p,s.jsx("span",{className:"absolute -right-0.5 -top-0.5 h-2.5 w-2.5 rounded-full border-2 border-card bg-success","aria-hidden":!0,style:{zIndex:pe.length+1}})]}),f=s.jsx("span",{className:"flex-1 text-sm font-medium leading-tight text-foreground",children:"Precisa de ajuda? Fale conosco"}),u=s.jsx(et,{size:16,className:"shrink-0 text-muted-foreground"}),e[6]=a,e[7]=f,e[8]=u):(a=e[6],f=e[7],u=e[8]);let g;return e[9]!==r||e[10]!==l||e[11]!==c?(g=s.jsxs("a",{href:r,target:"_blank",rel:"noreferrer",onClick:l,className:c,children:[a,f,u]}),e[9]=r,e[10]=l,e[11]=c,e[12]=g):g=e[12],g}function Js(n,e){return s.jsx("span",{className:"absolute block h-8 w-8 overflow-hidden rounded-full border-2 border-card",style:{left:e*Math.round(22.4),zIndex:pe.length-e},children:s.jsx("img",{src:n.photo,alt:n.alt,className:"h-full w-full object-cover",loading:"lazy"})},n.photo)}function Tn(n){const e=Q.c(10),{host:t}=n,o=`https://www.google.com/s2/favicons?domain=${t}&sz=128`;let i,r,l;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-7 w-7 dark:hidden"}),r=s.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-7 w-7 hidden dark:block"}),l=s.jsx("div",{className:"h-6 w-px rotate-12 bg-border","aria-hidden":"true"}),e[0]=i,e[1]=r,e[2]=l):(i=e[0],r=e[1],l=e[2]);let c;e[3]!==o?(c=s.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-border bg-white",children:s.jsx("img",{src:o,alt:"",className:"h-5 w-5",loading:"lazy"})}),e[3]=o,e[4]=c):c=e[4];let d;e[5]!==t?(d=s.jsx("span",{className:"text-lg font-medium text-foreground",children:t}),e[5]=t,e[6]=d):d=e[6];let p;return e[7]!==c||e[8]!==d?(p=s.jsxs("div",{className:"flex items-center gap-3",children:[i,r,l,c,d]}),e[7]=c,e[8]=d,e[9]=p):p=e[9],p}function en(n){return n.content?.find(e=>e.text)?.text??"A configuração do Commerce Discovery falhou."}function In(n){const e=n;if(e.isError)throw new Error(en(e));return e.structuredContent??n}export{Qs as C,Le as L,Tn as S,qt as a,Nn as b,wn as c,Sn as d,En as e,jn as i,je as n,In as p,_n as s};
@@ -0,0 +1 @@
1
+ import{c as T,j as t,r as Q,B as je,i as be}from"./index-v1F20B0E.js";import{i as Se}from"./ChevronRight-Cku8WSiq.js";import{X as fe}from"./agent-icon-DkxLV1fV.js";import{A as ue}from"./automation-runs-BYtwdZxc.js";import{r as Ne,u as ke,a as _e,b as we,i as Ce,d as Te,f as Fe,P as Re,S as Ee}from"./page-seo-form-BdXxVdKh.js";import{X as xe,r as ze}from"./index-CBuBybHp.js";import{a as ge}from"./Tool01-Beyaqvxk.js";import"./AlertCircle-BkrprcoF.js";import"./Trash03-rtk2CmiW.js";import"./ArrowUp-CbMTR9M0.js";import"./Settings02-BQIcnVua.js";import"./Tool02-jYwfK8WU.js";import"./XCircle-BjlDFDl6.js";import"./ArrowUpRight-L-sW_E0D.js";import"./TrendUp01-2mG8Ply8.js";import"./ZapSquare-C0baTxoC.js";import"./Users03-7mmR4h8P.js";import"./CheckCircle-BLRVelyD.js";import"./Check-DZygR-Fe.js";import"./ChevronDown-DDDop4Os.js";import"./ChevronUp-PZzlDplk.js";import"./Circle-CadYWyyA.js";import"./Stars02-DCivmeGP.js";import"./Copy01-ryDblf5m.js";import"./ZoomOut-CS3Og5lE.js";import"./DotsVertical-Dg3Xo34T.js";import"./Globe01-JMrbqgtG.js";import"./Eye-Bz-yLlBh.js";import"./FilterLines-CLgHUAPd.js";import"./Star01-B61mWKGP.js";import"./Globe04-MZEsVtUE.js";import"./SwitchHorizontal01-MT4LDKEV.js";import"./HardDrive-P0VrWAsS.js";import"./Key01-CxVX_Pbg.js";import"./LayoutLeft-Ccrzp7iH.js";import"./LinkExternal01-DNPuUmDD.js";import"./List-CbUCe9_w.js";import"./Monitor01-8E0Kd0bb.js";import"./Sun-CN1qXAbA.js";import"./Package-0lPNEylQ.js";import"./Palette-BMnON_zo.js";import"./Play-qfGjc7w4.js";import"./Plus-cs1N_W6b.js";import"./SearchLg-Cpz6OE5G.js";import"./SearchMd-D4gbfQvO.js";import"./Shield01-uN7yLkjY.js";import"./Stars01-COCvCNwS.js";import"./Trash01-CgtbhVG5.js";import"./Upload01-CpJQboow.js";import"./User01-Bnj-cSVO.js";import"./Users01-0zLYZpC7.js";import"./XClose-tZL2IdJO.js";import"./X-BhKPwXx-.js";import"./Zap-BPZV9XTy.js";import"./select-DJ-xJfBd.js";import"./tooltip-CwWmycdW.js";import"./useInfiniteQuery-DKESjHh5.js";import"./use-infinite-scroll-DRJmUT_7.js";import"./use-connection-DivkmGF9.js";import"./use-collections-Bw1ej6HH.js";import"./use-mcp-client-BmyqfqxQ.js";import"./constants-D_FQAPnt.js";import"./auth-D3FIklA5.js";import"./use-virtual-mcp-pJk84Xzr.js";import"./card-dUi6YgZ6.js";import"./sidebar-DMHBEB3a.js";import"./use-mobile-Dyi4jnPJ.js";import"./table-IyQgqCyJ.js";import"./empty-state-Bfm4FdaU.js";import"./use-members-B9xQq8Nf.js";import"./use-org-auth-client-DvR9aTwL.js";import"./use-clock-tick-GG7JJthC.js";import"./use-automations-BBihr9dY.js";import"./studio-tools-Dta_1_QR.js";import"./useSuspenseInfiniteQuery-DLe2YLWa.js";import"./badge-BRITDvjk.js";import"./checkbox-BvCpvEfo.js";import"./command-cobicZB1.js";import"./index-DEFe_Ioe.js";import"./dialog-BzVEcj79.js";import"./popover-BhTglK_V.js";import"./avatar-CEhTtT5Z.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-CciEBKiS.js";import"./file-type-icon-Co-9ap-O.js";import"./tab-id-bb-jjgGv.js";import"./monaco-editor-CN68a7_6.js";import"./index-CYRx6VZs.js";import"./chat-context-Iman-MuU.js";import"./autosend-D43Y2Wye.js";import"./hooks-pnrq3avL.js";import"./decopilot-sse-pool-D5PMEPBF.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-jn20SAL8.js";import"./use-decopilot-events-BT5pbFoO.js";import"./use-organization-settings-JlbwL6sx.js";import"./index-C-QXvkc1.js";import"./shell-layout-CDHmuxZH.js";import"./alert-dialog-qVVgQZs_.js";import"./required-auth-layout-LPVLIFMc.js";import"./use-org-sso-BpWCWfK7.js";import"./integration-icon-NHRUL2M2.js";import"./use-navigate-to-agent-CXN_R57g.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-BeF6Gy1z.js";import"./form-BEFBxu79.js";import"./label-BRpUtjMO.js";import"./input-DoMDIxWk.js";import"./switch-CxGmjhpb.js";import"./drawer-DTss_--q.js";import"./collection-search-B0UfZ-OT.js";import"./tabs-DJSveVrG.js";import"./toggle-group-TzWGQhcY.js";import"./use-deco-credits-D2VFeHYN.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-LUMMlH6G.js";import"./use-registry-connections-DlCFmIUa.js";import"./extract-connection-data-B3b_eFbC.js";import"./collection-tabs-CpnfoB9V.js";import"./textarea-D5CZ7ZsG.js";import"./connection-form-helpers-yaifOq7s.js";import"./authenticate-and-persist-oauth-C4jnnZWl.js";import"./mcp-oauth-BhDqbGNe.js";import"./connect-desktop-dialog-DWRyRSkj.js";import"./select-model-wshUAo0W.js";import"./skeleton-CYnpNimL.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-C6yf8yzB.js";import"./dropdown-menu-DDThFULM.js";import"./index-47mQkAxc.js";import"./toolbar-DT9Q65OX.js";import"./use-debounced-value-D_iu4VB9.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-Bw2veslR.js";import"./use-mcp-tools-BH7UZO6u.js";import"./use-capability-CXLvhLL0.js";import"./tools-list-CnR-7U8Q.js";import"./use-debounced-autosave-0ivINAXf.js";import"./index-CX5pjTTE.js";import"./search-input-B7l4w6Nk.js";import"./github-repo-picker-Bc5KArQ0.js";import"./github-installations-D2vHSx02.js";import"./use-secrets-CZWYXwBu.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./index-Bjoka7jJ.js";import"./get-initials-D-f_fDFw.js";import"./calendar-DITgsboQ.js";import"./toolbar-icon-button-DCDLCG5U.js";import"./use-file-configs-CZB3TWDj.js";import"./automation-list-row-D0R4MbNV.js";function U(n){return typeof n=="string"&&n.trim()?n:void 0}function he(n,e){if(n){if(e)try{const i=new URL(n,e).href;return xe(i)}catch{return}return xe(n)}}function Pe(n){if(!n)return{};const e=U(n.title),i=U(n.titleTemplate);return{title:e&&i?.includes("%s")?i.replace(/%s/g,e):e,description:U(n.description),image:U(n.image),favicon:U(n.favicon)}}function Oe(n){if(!n)return"example.com";try{return new URL(n).host}catch{return"example.com"}}const Z="Your page title",ee="Your meta description will appear here.",Le=[{id:"google",label:"Google",color:"#4285F4",layout:"search"},{id:"facebook",label:"Facebook",color:"#1877F2",layout:"card"},{id:"twitter",label:"X (Twitter)",color:"#0f1419",layout:"card"},{id:"linkedin",label:"LinkedIn",color:"#0A66C2",layout:"card"},{id:"whatsapp",label:"WhatsApp",color:"#25D366",layout:"chat"},{id:"telegram",label:"Telegram",color:"#229ED9",layout:"chat"},{id:"slack",label:"Slack",color:"#611f69",layout:"attachment"},{id:"discord",label:"Discord",color:"#5865F2",layout:"attachment"}];function pe(n){const e=T.c(10),{src:i,className:r,iconSize:h}=n,a=h===void 0?20:h;if(i){let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={objectFit:"cover"},e[0]=m):m=e[0];let p;return e[1]!==r||e[2]!==i?(p=t.jsx("img",{src:i,alt:"",referrerPolicy:"no-referrer",className:r,style:m}),e[1]=r,e[2]=i,e[3]=p):p=e[3],p}let s;e[4]===Symbol.for("react.memo_cache_sentinel")?(s={display:"flex",alignItems:"center",justifyContent:"center",background:"#e5e7eb",color:"#9ca3af"},e[4]=s):s=e[4];let o;e[5]!==a?(o=t.jsx(ge,{size:a}),e[5]=a,e[6]=o):o=e[6];let l;return e[7]!==r||e[8]!==o?(l=t.jsx("div",{className:r,style:s,children:o}),e[7]=r,e[8]=o,e[9]=l):l=e[9],l}function $e(n){const e=T.c(27),{seo:i,host:r,path:h}=n;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={background:"#fff",border:"1px solid #dadce0"},e[0]=a):a=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s={background:"#f1f3f4"},e[1]=s):s=e[1];let o;e[2]!==i.favicon?(o=t.jsx("div",{className:"flex size-6 shrink-0 items-center justify-center overflow-hidden rounded-full",style:s,children:i.favicon?t.jsx("img",{src:i.favicon,alt:"",className:"size-full object-cover"}):t.jsx(ge,{size:12,color:"#9aa0a6"})}),e[2]=i.favicon,e[3]=o):o=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l={color:"#202124"},e[4]=l):l=e[4];let m;e[5]!==r?(m=t.jsx("div",{className:"truncate text-[13px] leading-tight",style:l,children:r}),e[5]=r,e[6]=m):m=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p={color:"#4d5156"},e[7]=p):p=e[7];let d;e[8]!==r||e[9]!==h?(d=t.jsxs("div",{className:"truncate text-[12px] leading-tight",style:p,children:[r,h]}),e[8]=r,e[9]=h,e[10]=d):d=e[10];let c;e[11]!==m||e[12]!==d?(c=t.jsxs("div",{className:"min-w-0",children:[m,d]}),e[11]=m,e[12]=d,e[13]=c):c=e[13];let g;e[14]!==o||e[15]!==c?(g=t.jsxs("div",{className:"flex items-center gap-2",children:[o,c]}),e[14]=o,e[15]=c,e[16]=g):g=e[16];let f;e[17]===Symbol.for("react.memo_cache_sentinel")?(f={color:"#1a0dab"},e[17]=f):f=e[17];const x=i.title??Z;let u;e[18]!==x?(u=t.jsx("div",{className:"mt-1.5 truncate text-[18px] leading-snug",style:f,children:x}),e[18]=x,e[19]=u):u=e[19];let j;e[20]===Symbol.for("react.memo_cache_sentinel")?(j={color:"#4d5156"},e[20]=j):j=e[20];const v=i.description??ee;let y;e[21]!==v?(y=t.jsx("div",{className:"mt-0.5 line-clamp-2 text-[13px] leading-snug",style:j,children:v}),e[21]=v,e[22]=y):y=e[22];let b;return e[23]!==u||e[24]!==y||e[25]!==g?(b=t.jsxs("div",{className:"rounded-lg p-3 text-left",style:a,children:[g,u,y]}),e[23]=u,e[24]=y,e[25]=g,e[26]=b):b=e[26],b}function De(n){const e=T.c(20),{seo:i,host:r}=n;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={background:"#fff",border:"1px solid #e2e8f0"},e[0]=h):h=e[0];let a;e[1]!==i.image?(a=t.jsx(pe,{src:i.image,className:"h-40 w-full"}),e[1]=i.image,e[2]=a):a=e[2];let s;e[3]===Symbol.for("react.memo_cache_sentinel")?(s={borderTop:"1px solid #e2e8f0"},e[3]=s):s=e[3];let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o={color:"#8a9099"},e[4]=o):o=e[4];let l;e[5]!==r?(l=t.jsx("div",{className:"truncate text-[11px]",style:o,children:r}),e[5]=r,e[6]=l):l=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m={color:"#1c2024"},e[7]=m):m=e[7];const p=i.title??Z;let d;e[8]!==p?(d=t.jsx("div",{className:"line-clamp-1 text-[14px] font-semibold",style:m,children:p}),e[8]=p,e[9]=d):d=e[9];let c;e[10]===Symbol.for("react.memo_cache_sentinel")?(c={color:"#60666c"},e[10]=c):c=e[10];const g=i.description??ee;let f;e[11]!==g?(f=t.jsx("div",{className:"line-clamp-2 text-[12px]",style:c,children:g}),e[11]=g,e[12]=f):f=e[12];let x;e[13]!==f||e[14]!==l||e[15]!==d?(x=t.jsxs("div",{className:"px-3 py-2",style:s,children:[l,d,f]}),e[13]=f,e[14]=l,e[15]=d,e[16]=x):x=e[16];let u;return e[17]!==x||e[18]!==a?(u=t.jsxs("div",{className:"overflow-hidden rounded-lg text-left",style:h,children:[a,x]}),e[17]=x,e[18]=a,e[19]=u):u=e[19],u}function Ie(n){const e=T.c(23),{seo:i,host:r,accent:h}=n;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={background:"#f0f2f5"},e[0]=a):a=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("p",{className:"px-1 pb-1.5 text-[12px]",style:{color:"#3b4045"},children:"Here's a post you might write with the link of your website:"}),e[1]=s):s=e[1];const o=`3px solid ${h}`;let l;e[2]!==o?(l={background:"#fff",borderLeft:o},e[2]=o,e[3]=l):l=e[3];let m;e[4]!==i.image?(m=t.jsx(pe,{src:i.image,className:"h-28 w-full",iconSize:18}),e[4]=i.image,e[5]=m):m=e[5];let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p={color:"#1c2024"},e[6]=p):p=e[6];const d=i.title??Z;let c;e[7]!==d?(c=t.jsx("div",{className:"line-clamp-1 text-[12px] font-semibold",style:p,children:d}),e[7]=d,e[8]=c):c=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g={color:"#60666c"},e[9]=g):g=e[9];const f=i.description??ee;let x;e[10]!==f?(x=t.jsx("div",{className:"line-clamp-2 text-[11px]",style:g,children:f}),e[10]=f,e[11]=x):x=e[11];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u={color:"#8a9099"},e[12]=u):u=e[12];let j;e[13]!==r?(j=t.jsx("div",{className:"mt-0.5 text-[10px]",style:u,children:r}),e[13]=r,e[14]=j):j=e[14];let v;e[15]!==x||e[16]!==j||e[17]!==c?(v=t.jsxs("div",{className:"px-2.5 py-1.5",children:[c,x,j]}),e[15]=x,e[16]=j,e[17]=c,e[18]=v):v=e[18];let y;return e[19]!==v||e[20]!==l||e[21]!==m?(y=t.jsxs("div",{className:"rounded-lg p-2 text-left",style:a,children:[s,t.jsxs("div",{className:"overflow-hidden rounded-md",style:l,children:[m,v]})]}),e[19]=v,e[20]=l,e[21]=m,e[22]=y):y=e[22],y}function Ae(n){const e=T.c(33),{seo:i,host:r,accent:h,dark:a}=n,s=a?"#2b2d31":"#fff",o=a?"#00a8fc":"#1264a3",l=a?"#dbdee1":"#3b4045",m=a?"#949ba4":"#8a9099",p=a?"none":"1px solid #e2e8f0";let d;e[0]!==s||e[1]!==p?(d={background:s,border:p},e[0]=s,e[1]=p,e[2]=d):d=e[2];const c=`3px solid ${h}`;let g;e[3]!==c?(g={borderLeft:c,borderRadius:2},e[3]=c,e[4]=g):g=e[4];let f;e[5]!==m?(f={color:m},e[5]=m,e[6]=f):f=e[6];let x;e[7]!==r||e[8]!==f?(x=t.jsx("div",{className:"text-[10px]",style:f,children:r}),e[7]=r,e[8]=f,e[9]=x):x=e[9];let u;e[10]!==o?(u={color:o},e[10]=o,e[11]=u):u=e[11];const j=i.title??Z;let v;e[12]!==u||e[13]!==j?(v=t.jsx("div",{className:"line-clamp-1 text-[13px] font-semibold",style:u,children:j}),e[12]=u,e[13]=j,e[14]=v):v=e[14];let y;e[15]!==l?(y={color:l},e[15]=l,e[16]=y):y=e[16];const b=i.description??ee;let _;e[17]!==y||e[18]!==b?(_=t.jsx("div",{className:"line-clamp-2 text-[12px]",style:y,children:b}),e[17]=y,e[18]=b,e[19]=_):_=e[19];let N;e[20]!==_||e[21]!==x||e[22]!==v?(N=t.jsxs("div",{className:"min-w-0 flex-1",children:[x,v,_]}),e[20]=_,e[21]=x,e[22]=v,e[23]=N):N=e[23];let S;e[24]!==i.image?(S=t.jsx(pe,{src:i.image,className:"size-14 shrink-0 rounded",iconSize:16}),e[24]=i.image,e[25]=S):S=e[25];let k;e[26]!==N||e[27]!==S||e[28]!==g?(k=t.jsxs("div",{className:"flex gap-2.5 pl-2.5",style:g,children:[N,S]}),e[26]=N,e[27]=S,e[28]=g,e[29]=k):k=e[29];let C;return e[30]!==k||e[31]!==d?(C=t.jsx("div",{className:"rounded-lg p-2.5 text-left",style:d,children:k}),e[30]=k,e[31]=d,e[32]=C):C=e[32],C}function Be(n){const e=T.c(17),{platform:i,seo:r,host:h,path:a}=n;let s;e[0]!==h||e[1]!==a||e[2]!==i.color||e[3]!==i.id||e[4]!==i.layout||e[5]!==r?(s=i.layout==="search"?t.jsx($e,{seo:r,host:h,path:a}):i.layout==="card"?t.jsx(De,{seo:r,host:h,path:a}):i.layout==="chat"?t.jsx(Ie,{seo:r,host:h,path:a,accent:i.color}):t.jsx(Ae,{seo:r,host:h,path:a,accent:i.color,dark:i.id==="discord"}),e[0]=h,e[1]=a,e[2]=i.color,e[3]=i.id,e[4]=i.layout,e[5]=r,e[6]=s):s=e[6];const o=s;let l;e[7]!==i.color?(l=t.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{background:i.color}}),e[7]=i.color,e[8]=l):l=e[8];let m;e[9]!==i.label?(m=t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:i.label}),e[9]=i.label,e[10]=m):m=e[10];let p;e[11]!==l||e[12]!==m?(p=t.jsxs("div",{className:"mb-1.5 flex items-center gap-1.5",children:[l,m]}),e[11]=l,e[12]=m,e[13]=p):p=e[13];let d;return e[14]!==o||e[15]!==p?(d=t.jsxs("div",{children:[p,o]}),e[14]=o,e[15]=p,e[16]=d):d=e[16],d}function Ue(n){const e=T.c(17),{seo:i,url:r,path:h}=n,a=h===void 0?"/":h;let s,o,l;if(e[0]!==i||e[1]!==r){const u=Pe(i);s=u,o=he(u.image,r),l=he(u.favicon,r),e[0]=i,e[1]=r,e[2]=s,e[3]=o,e[4]=l}else s=e[2],o=e[3],l=e[4];let m;e[5]!==s||e[6]!==o||e[7]!==l?(m={...s,image:o,favicon:l},e[5]=s,e[6]=o,e[7]=l,e[8]=m):m=e[8];const p=m;let d;e[9]!==r?(d=Oe(r),e[9]=r,e[10]=d):d=e[10];const c=d,g=a==="/"?"":a;let f;e[11]!==g||e[12]!==c||e[13]!==p?(f=Le.map(u=>t.jsx(Be,{platform:u,seo:p,host:c,path:g},u.id)),e[11]=g,e[12]=c,e[13]=p,e[14]=f):f=e[14];let x;return e[15]!==f?(x=t.jsx("div",{className:"grid grid-cols-1 gap-4 @2xl:grid-cols-2",children:f}),e[15]=f,e[16]=x):x=e[16],x}function Di(n){const e=T.c(63),{orgSlug:i,virtualMcpId:r,branch:h,decofile:a,meta:s,target:o,previewBaseUrl:l,onSaved:m,onEditDefaultSeo:p,onBack:d}=n,c=Ne(a,o,s),g=c?.seoData,f=o.kind==="site"?"site":o.pageKey,[x,u]=Q.useState(f),[j,v]=Q.useState(null),[y,b]=Q.useState(0),[_,N]=Q.useState(void 0);x!==f&&(u(f),v(null),N(void 0),b(Me));const{persistSeo:S,persistRawSeo:k,flush:C,isPending:te}=ke({orgSlug:i,virtualMcpId:r,branch:h,target:o,resolved:c,onSaved:m}),K=o.kind==="page",ve=K?c?.rawSeoData:void 0,B=_!==void 0?_:ve,ye=K?_e(B)??void 0:void 0,w=j??ye??g??{},F=c?we(w,c):null,z=F&&(!K||Ce(B))?ze(F,s):null;let M;e[0]!==s?(M=Te(s),e[0]=s,e[1]=M):M=e[1];const oe=M;let R,X;e[2]!==a||e[3]!==w||e[4]!==s||e[5]!==o.kind?(R=o.kind==="page"?Fe(a,s)?.seoData??{}:{},X=o.kind==="page"?Ge(R,w):w,e[2]=a,e[3]=w,e[4]=s,e[5]=o.kind,e[6]=R,e[7]=X):(R=e[6],X=e[7]);const ie=X;let G;e[8]!==S||e[9]!==c||e[10]!==v?(G=E=>{if(!c)return;const de=E;v(de),S(de)},e[8]=S,e[9]=c,e[10]=v,e[11]=G):G=e[11];const se=G;let V;e[12]!==v?(V=()=>v(null),e[12]=v,e[13]=V):V=e[13];const le=V;let Y;e[14]!==b?(Y=()=>b(Ke),e[14]=b,e[15]=Y):Y=e[15];const re=Y;let H;e[16]!==C||e[17]!==d?(H=()=>{C(),d?.()},e[16]=C,e[17]=d,e[18]=H):H=e[18];const ae=H,P=o.kind==="page"?o.path:"/";let W;e[19]!==P||e[20]!==l||e[21]!==o.kind?(W=o.kind==="page"&&l?Xe(P,l):l??null,e[19]=P,e[20]=l,e[21]=o.kind,e[22]=W):W=e[22];const ne=W,ce=o.kind==="site"?"No site-level SEO block found.":c?"SEO schema not found for this page.":"Could not load page SEO.",q=K&&c,me=o.kind==="site"&&c&&z;let O;e[23]!==ae||e[24]!==o.kind||e[25]!==o.pageName?(O=o.kind==="page"?t.jsxs("nav",{className:"flex min-w-0 items-center gap-1 text-sm",children:[t.jsx("button",{type:"button",onClick:ae,title:o.pageName,className:"min-w-0 truncate rounded-md px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",children:o.pageName}),t.jsx(Se,{className:"size-3 shrink-0 text-muted-foreground/60"}),t.jsx("span",{className:"px-1 py-0.5 font-medium text-foreground",children:"SEO"})]}):t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(fe,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("span",{className:"text-sm font-medium",children:"Default SEO"}),t.jsx("span",{className:"hidden truncate text-xs text-muted-foreground sm:inline",children:"· applied to every page unless overridden"})]}),e[23]=ae,e[24]=o.kind,e[25]=o.pageName,e[26]=O):O=e[26];let L;e[27]!==te?(L=te&&t.jsx(be,{size:14,className:"animate-spin text-muted-foreground"}),e[27]=te,e[28]=L):L=e[28];let $;e[29]!==p||e[30]!==o.kind?($=o.kind==="page"&&p&&t.jsxs(je,{type:"button",variant:"outline",size:"sm",onClick:p,children:[t.jsx(fe,{size:14}),"Edit default SEO"]}),e[29]=p,e[30]=o.kind,e[31]=$):$=e[31];let D;e[32]!==$||e[33]!==L?(D=t.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[L,$]}),e[32]=$,e[33]=L,e[34]=D):D=e[34];let I;e[35]!==D||e[36]!==O?(I=t.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2 border-b px-4",children:[O,D]}),e[35]=D,e[36]=O,e[37]=I):I=e[37];let A;e[38]!==F||e[39]!==re||e[40]!==le||e[41]!==oe||e[42]!==B||e[43]!==w||e[44]!==ce||e[45]!==y||e[46]!==se||e[47]!==P||e[48]!==k||e[49]!==S||e[50]!==ie||e[51]!==ne||e[52]!==c||e[53]!==z||e[54]!==v||e[55]!==N||e[56]!==q||e[57]!==me||e[58]!==R?(A=!c||!q&&!me?t.jsx("div",{className:"flex flex-1 items-center justify-center px-6 text-center text-sm text-muted-foreground",children:ce}):t.jsxs("div",{className:"flex min-h-0 flex-1",children:[t.jsx(ue,{className:"w-full max-w-md shrink-0 border-r [&_[data-slot=scroll-area-viewport]>div]:!block",children:t.jsx("div",{className:"px-5 py-4",children:q?t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"mb-3 text-xs text-muted-foreground",children:"Empty fields inherit the default SEO. The preview shows the resolved result."}),t.jsx(Re,{rawSeo:B,innerSeo:w,defaultResolveType:oe,seoSchema:z,activeResolveType:F,seoTypeOptions:c.seoTypeOptions,formResetKey:y,siteDefaultSeo:R,onPersistRaw:E=>{N(E),k(E)},onInnerChange:E=>{v(E),S(E)},onClearForm:le,onBumpFormKey:re})]}):z&&F&&t.jsx(Ee,{schema:z,resolveType:F,value:w,formResetKey:y,onChange:se})})}),t.jsx(ue,{className:"min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:t.jsx("div",{className:"@container px-5 py-4",children:t.jsx(Ue,{seo:ie,url:ne,path:P})})})]}),e[38]=F,e[39]=re,e[40]=le,e[41]=oe,e[42]=B,e[43]=w,e[44]=ce,e[45]=y,e[46]=se,e[47]=P,e[48]=k,e[49]=S,e[50]=ie,e[51]=ne,e[52]=c,e[53]=z,e[54]=v,e[55]=N,e[56]=q,e[57]=me,e[58]=R,e[59]=A):A=e[59];let J;return e[60]!==I||e[61]!==A?(J=t.jsxs("div",{className:"flex h-full w-full flex-col",children:[I,A]}),e[60]=I,e[61]=A,e[62]=J):J=e[62],J}function Ke(n){return n+1}function Me(n){return n+1}function Xe(n,e){try{return new URL(n,e).href}catch{return e}}function Ge(n,e){const i=e.__resolveType,r=n.__resolveType;if(typeof i=="string"&&typeof r=="string"&&i!==r)return{...e};const h={...n};for(const[a,s]of Object.entries(e))a!=="__resolveType"&&s!=null&&(typeof s=="string"&&s.trim()===""||(h[a]=s));return h}export{Di as SeoEditor};
@@ -0,0 +1 @@
1
+ import{c as S,e as L,j as s,C as J,l as k,w as Q,L as R,p as B,W as I,a as G,i as D,r as F,O as K}from"./index-v1F20B0E.js";import{u as T}from"./useRouterState-BVrfD4QF.js";import{j as U,k as V,l as X,S as q,a as w,b as M,d as P,c as O,g as Y,h as Z}from"./sidebar-DMHBEB3a.js";import{a as ee}from"./index-CX5pjTTE.js";import{n as se,c as te,a as le,d as re,b as ie,i as E}from"./ZapSquare-C0baTxoC.js";import{t as oe,a as A}from"./Users03-7mmR4h8P.js";import{i as ne}from"./HardDrive-P0VrWAsS.js";import{i as ae}from"./Key01-CxVX_Pbg.js";import{i as ce}from"./Shield01-uN7yLkjY.js";import{s as me}from"./User01-Bnj-cSVO.js";import{i as fe}from"./Zap-BPZV9XTy.js";import{a as de}from"./use-capability-CXLvhLL0.js";import{u as xe}from"./use-join-requests-DojedTk5.js";import{u as W}from"./use-mobile-Dyi4jnPJ.js";import{u as be}from"./use-status-sounds-Bw2veslR.js";import{T as y}from"./toolbar-DT9Q65OX.js";import{S as ue,M as he}from"./shell-controls-BZMA1sGn.js";import"./LayoutLeft-Ccrzp7iH.js";import"./X-BhKPwXx-.js";import"./tooltip-CwWmycdW.js";import"./studio-tools-Dta_1_QR.js";import"./question-004-sINsf4GQ.js";import"./use-decopilot-events-BT5pbFoO.js";import"./decopilot-sse-pool-D5PMEPBF.js";import"./backoff-CrEUbyZT.js";import"./toolbar-icon-button-DCDLCG5U.js";function H(){const e=S.c(21),{capabilities:t,isPrivileged:m,loading:l,error:i}=de(),o=xe().length;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(oe,{size:14}),e[0]=n):n=e[0];let r,a;if(e[1]!==t||e[2]!==i||e[3]!==m||e[4]!==o||e[5]!==l){a=Symbol.for("react.early_return_sentinel");e:{let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(se,{size:14}),e[8]=f):f=e[8];let d;e[9]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(te,{size:14}),e[9]=d):d=e[9];let c;e[10]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(ae,{size:14}),e[10]=c):c=e[10];let x;e[11]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(ne,{size:14}),e[11]=x):x=e[11];let b;e[12]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(le,{size:14}),e[12]=b):b=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(A,{size:14}),e[13]=p):p=e[13];let h;e[14]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(fe,{size:14}),e[14]=h):h=e[14];let g;e[15]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(re,{size:14}),e[15]=g):g=e[15];let u;e[16]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(ie,{size:14}),e[16]=u):u=e[16];let _;e[17]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(A,{size:14}),e[17]=_):_=e[17];let j;e[18]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(ce,{size:14}),e[18]=j):j=e[18];let v;e[19]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(Q,{size:14}),e[19]=v):v=e[19];let N;e[20]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(me,{size:14}),e[20]=N):N=e[20];const C=[{label:"Organization",items:[{key:"general",label:"General",icon:n,to:"/$org/settings/general",requires:"org:manage"},{key:"brand-context",label:"Brand Context",icon:f,to:"/$org/settings/brand-context",requires:"org:manage"},{key:"ai-providers",label:"AI Providers",icon:d,to:"/$org/settings/ai-providers",requires:"ai-providers:manage"},{key:"secrets",label:"Secrets",icon:c,to:"/$org/settings/secrets",requires:"secrets:manage"},{key:"buckets",label:"Buckets",icon:x,to:"/$org/settings/buckets",requires:"file-configs:manage"}]},{label:"Build",items:[{key:"connections",label:"Connections",icon:b,to:"/$org/settings/connections"},{key:"agents",label:"Agents",icon:p,to:"/$org/settings/agents"},{key:"automations",label:"Automations",icon:h,to:"/$org/settings/automations",requires:"automations:manage"},{key:"store",label:"Store",icon:g,to:"/$org/settings/store",requires:"registry:manage"}]},{label:"Manage",items:[{key:"monitor",label:"Monitor",icon:u,to:"/$org/settings/monitor",requires:"monitoring:view"},{key:"members",label:"Members",icon:_,to:"/$org/settings/members",requires:"members:manage",badge:o},{key:"roles",label:"Roles",icon:j,to:"/$org/settings/roles",privilegedOnly:!0},{key:"sso",label:"Security",icon:v,to:"/$org/settings/sso",requires:"org:manage"}]},{label:"Account",items:[{key:"profile",label:"Profile & Preferences",icon:N,to:"/$org/settings/profile"}]}];if(l||i){a=C;break e}r=C.map(z=>({...z,items:z.items.filter($=>$.privilegedOnly?m:$.requires?m||t[$.requires]:!0)})).filter(pe)}e[1]=t,e[2]=i,e[3]=m,e[4]=o,e[5]=l,e[6]=r,e[7]=a}else r=e[6],a=e[7];return a!==Symbol.for("react.early_return_sentinel")?a:r}function pe(e){return e.items.length>0}function ge(){const e=S.c(19),t=H();let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={from:"/shell/$org"},e[0]=m):m=e[0];const{org:l}=L(m);let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i={select:_e},e[1]=i):i=e[1];const o=T(i);let n;e[2]!==l||e[3]!==o?(n=p=>{const h=p.replace("$org",l);return o.startsWith(h)},e[2]=l,e[3]=o,e[4]=n):n=e[4];const r=n;let a;if(e[5]!==t||e[6]!==r||e[7]!==l){let p;e[9]!==r||e[10]!==l?(p=(h,g)=>s.jsxs(q,{className:"pt-0 pr-0 pb-0 pl-0",children:[h.label&&s.jsx("p",{className:k("px-2 pt-1.5 pb-0.5 text-xs font-medium text-muted-foreground/60",g>0&&"mt-3"),children:h.label}),s.jsx(w,{children:s.jsx(M,{className:"gap-0.5",children:h.items.map(u=>s.jsx(P,{children:s.jsx(O,{asChild:!0,isActive:r(u.to),children:s.jsxs(R,{to:u.to,params:{org:l},onClick:()=>B("settings_nav_clicked",{section_key:u.key,section_label:u.label,group_label:h.label||"main"}),className:"flex items-center gap-2.5 text-sm",children:[s.jsxs("span",{className:"relative shrink-0",children:[u.icon,u.badge?s.jsx("span",{className:"absolute -right-1 -top-1 size-2 rounded-full bg-red-500 pointer-events-none"}):null]}),s.jsx("span",{className:"truncate",children:u.label})]})})},u.key))})})]},`${h.label}-${g}`),e[9]=r,e[10]=l,e[11]=p):p=e[11],a=t.map(p),e[5]=t,e[6]=r,e[7]=l,e[8]=a}else a=e[8];let f;e[12]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx("div",{className:"mx-2 my-2 border-t border-border/50"}),e[12]=f):f=e[12];let d;e[13]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsxs(q,{className:"pt-0 pr-0 pb-0 pl-0",children:[f,s.jsx(w,{children:s.jsx(M,{className:"gap-0.5",children:s.jsx(P,{children:s.jsxs(O,{onClick:je,className:"flex items-center gap-2.5 text-sm",children:[s.jsx("span",{className:"shrink-0",children:s.jsx(E,{size:14})}),s.jsx("span",{className:"truncate",children:"Sign Out"})]})})})})]}),e[13]=d):d=e[13];let c;e[14]!==a?(c=s.jsxs(Y,{className:"flex flex-col flex-1 mt-2 px-2 pb-2 gap-0 overflow-y-auto",children:[a,d]}),e[14]=a,e[15]=c):c=e[15];let x;e[16]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("div",{className:"mt-auto px-4 pb-1",children:s.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v","4.63.0"]})}),e[16]=x):x=e[16];let b;return e[17]!==c?(b=s.jsxs(Z,{variant:"sidebar",children:[c,x]}),e[17]=c,e[18]=b):b=e[18],b}function je(){B("signed_out",{source:"settings_sidebar"}),I(),G.signOut()}function _e(e){return e.location.pathname}function ye(e){const t=S.c(21),{onClose:m}=e,l=H();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org"},t[0]=i):i=t[0];const{org:o}=L(i);let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n={select:ve},t[1]=n):n=t[1];const r=T(n);let a;t[2]!==o||t[3]!==r?(a=g=>{const u=g.replace("$org",o);return r.startsWith(u)},t[2]=o,t[3]=r,t[4]=a):a=t[4];const f=a;let d;if(t[5]!==l||t[6]!==f||t[7]!==m||t[8]!==o){let g;t[10]!==f||t[11]!==m||t[12]!==o?(g=(u,_)=>s.jsxs("div",{className:"flex flex-col gap-0.5",children:[u.label&&s.jsx("p",{className:k("px-3 pt-1.5 pb-0.5 text-xs font-medium text-muted-foreground/60",_>0&&"mt-3"),children:u.label}),u.items.map(j=>s.jsxs(R,{to:j.to,params:{org:o},onClick:m,className:k("flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm",f(j.to)?"bg-sidebar-accent text-sidebar-accent-foreground font-medium":"text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground"),children:[s.jsxs("span",{className:"relative shrink-0",children:[j.icon,j.badge?s.jsx("span",{className:"absolute -right-1 -top-1 size-2 rounded-full bg-red-500 pointer-events-none"}):null]}),s.jsx("span",{className:"truncate",children:j.label})]},j.key))]},`${u.label}-${_}`),t[10]=f,t[11]=m,t[12]=o,t[13]=g):g=t[13],d=l.map(g),t[5]=l,t[6]=f,t[7]=m,t[8]=o,t[9]=d}else d=t[9];let c;t[14]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("div",{className:"h-px bg-border/50 my-2"}),t[14]=c):c=t[14];let x;t[15]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[c,s.jsxs("button",{type:"button",onClick:Se,className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[s.jsx("span",{className:"shrink-0",children:s.jsx(E,{size:14})}),s.jsx("span",{className:"truncate",children:"Sign Out"})]})]}),t[15]=x):x=t[15];let b;t[16]!==d?(b=s.jsxs("div",{className:"flex flex-col flex-1 overflow-y-auto px-2 py-2 gap-0.5",children:[d,x]}),t[16]=d,t[17]=b):b=t[17];let p;t[18]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx("div",{className:"px-4 pb-3 pt-1 border-t border-border/50",children:s.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v","4.63.0"]})}),t[18]=p):p=t[18];let h;return t[19]!==b?(h=s.jsxs("div",{className:"flex flex-col h-full bg-sidebar",children:[b,p]}),t[19]=b,t[20]=h):h=t[20],h}function Se(){I(),G.signOut()}function ve(e){return e.location.pathname}function Ne(){const e=S.c(4),t=W(),{org:m}=J();be(m.slug);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx(D,{size:20,className:"animate-spin text-muted-foreground"})}),e[0]=l):l=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(F.Suspense,{fallback:l,children:s.jsx("div",{className:"flex flex-1 items-center overflow-hidden rounded-[inherit]",children:s.jsx(ee,{value:"p-0",children:s.jsx("div",{className:"flex-1 min-w-0 overflow-hidden h-full",children:s.jsx(K,{})})})})}),e[1]=i):i=e[1];const o=i;if(t){let r;return e[2]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex flex-col flex-1 bg-background min-h-0 overflow-hidden",children:o}),e[2]=r):r=e[2],r}let n;return e[3]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("div",{className:"flex-1 min-h-0 p-1",children:s.jsx("div",{className:k("flex flex-col h-full min-h-0 bg-background overflow-hidden","card-shadow","rounded-[0.75rem]"),children:o})}),e[3]=n):n=e[3],n}function Ye(){const e=S.c(21),t=W();let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(y.LogoLink,{}),e[0]=m):m=e[0];let l;e[1]!==t?(l=t&&s.jsx(ue,{}),e[1]=t,e[2]=l):l=e[2];let i;e[3]!==l?(i=s.jsxs(y.LeftColumn,{children:[m,l]}),e[3]=l,e[4]=i):i=e[4];let o;e[5]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(y.CenterSlot,{}),e[5]=o):o=e[5];let n;e[6]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(y.RightColumn,{children:s.jsx("span",{})}),e[6]=n):n=e[6];let r;e[7]!==i?(r=s.jsxs(y.Header,{children:[i,o,n]}),e[7]=i,e[8]=r):r=e[8];let a;e[9]===Symbol.for("react.memo_cache_sentinel")?(a={"--sidebar-width-icon":"3.125rem"},e[9]=a):a=e[9];let f;e[10]!==t?(f=!t&&s.jsx(ge,{}),e[10]=t,e[11]=f):f=e[11];let d;e[12]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(U,{className:"flex flex-col",style:{background:"transparent",containerType:"inline-size"},children:s.jsx(Ne,{})}),e[12]=d):d=e[12];let c;e[13]!==f?(c=s.jsxs(V,{className:"flex-1 bg-sidebar min-h-0",style:a,children:[f,d]}),e[13]=f,e[14]=c):c=e[14];let x;e[15]!==t?(x=t&&s.jsx(he,{renderSidebar:ke}),e[15]=t,e[16]=x):x=e[16];let b;return e[17]!==x||e[18]!==r||e[19]!==c?(b=s.jsx(y.Provider,{children:s.jsx(X,{defaultOpen:!0,children:s.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[r,c,x]})})}),e[17]=x,e[18]=r,e[19]=c,e[20]=b):b=e[20],b}function ke(e){const{onClose:t}=e;return s.jsx(ye,{onClose:t})}export{ge as SettingsSidebar,ye as SettingsSidebarMobile,Ye as default};
@@ -1 +1 @@
1
- import{c as v,l as N,j as r,r as S}from"./index-CsZhMKFM.js";import{C as w}from"./card-Bc92PJFP.js";import{i as E}from"./ArrowUpRight-DdPCnlNm.js";function I(c){const e=v.c(12),{title:i,description:l,docsHref:t,actions:s,className:n,headerClassName:a,children:d}=c;let m;e[0]!==n?(m=N("flex flex-col gap-3",n),e[0]=n,e[1]=m):m=e[1];let f;e[2]!==s||e[3]!==l||e[4]!==t||e[5]!==a||e[6]!==i?(f=(i||l||t||s)&&r.jsxs("div",{className:N("flex items-center justify-between gap-3 px-4",a),children:[r.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[i&&r.jsx("h2",{className:"text-[15px] font-medium leading-tight",children:i}),(l||t)&&r.jsxs("p",{className:"text-sm text-muted-foreground leading-snug",children:[l,t&&r.jsxs("a",{href:t,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-0.5 ml-1 text-foreground hover:underline",children:["Docs ",r.jsx(E,{size:12})]})]})]}),s&&r.jsx("div",{className:"shrink-0",children:s})]}),e[2]=s,e[3]=l,e[4]=t,e[5]=a,e[6]=i,e[7]=f):f=e[7];let o;return e[8]!==d||e[9]!==m||e[10]!==f?(o=r.jsxs("section",{className:m,children:[f,d]}),e[8]=d,e[9]=m,e[10]=f,e[11]=o):o=e[11],o}function P(c){const e=v.c(11),{className:i,children:l}=c;let t,s,n;if(e[0]!==l||e[1]!==i){const d=S.Children.toArray(l).filter(S.isValidElement);t=w,e[5]!==i?(s=N("p-0 gap-0 overflow-hidden",i),e[5]=i,e[6]=s):s=e[6],n=d.map($),e[0]=l,e[1]=i,e[2]=t,e[3]=s,e[4]=n}else t=e[2],s=e[3],n=e[4];let a;return e[7]!==t||e[8]!==s||e[9]!==n?(a=r.jsx(t,{className:s,children:n}),e[7]=t,e[8]=s,e[9]=n,e[10]=a):a=e[10],a}function $(c,e){return r.jsxs("div",{children:[e>0&&r.jsx("div",{className:"h-px bg-border mx-5"}),c]},e)}function R(c){const e=v.c(27),{icon:i,title:l,description:t,action:s,onClick:n,className:a,children:d}=c,m=d?"flex items-start gap-3 px-4 py-4":"flex items-center gap-3 px-4 py-4",f=n&&"hover:bg-muted/50 cursor-pointer";let o;e[0]!==a||e[1]!==m||e[2]!==f?(o=N(m,f,a),e[0]=a,e[1]=m,e[2]=f,e[3]=o):o=e[3];const b=n?"button":void 0,C=n?0:void 0;let x;e[4]!==n?(x=n?k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),n())}:void 0,e[4]=n,e[5]=x):x=e[5];let p;e[6]!==i?(p=i&&r.jsx("div",{className:"size-8 shrink-0 rounded-lg bg-muted/60 flex items-center justify-center text-muted-foreground",children:i}),e[6]=i,e[7]=p):p=e[7];let u;e[8]!==l?(u=r.jsx("div",{className:"text-sm font-medium",children:l}),e[8]=l,e[9]=u):u=e[9];let h;e[10]!==t?(h=t&&r.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:t}),e[10]=t,e[11]=h):h=e[11];let g;e[12]!==d||e[13]!==u||e[14]!==h?(g=r.jsxs("div",{className:"flex-1 min-w-0",children:[u,h,d]}),e[12]=d,e[13]=u,e[14]=h,e[15]=g):g=e[15];let j;e[16]!==s?(j=s&&r.jsx("div",{className:"shrink-0",onClick:D,children:s}),e[16]=s,e[17]=j):j=e[17];let y;return e[18]!==n||e[19]!==g||e[20]!==j||e[21]!==o||e[22]!==b||e[23]!==C||e[24]!==x||e[25]!==p?(y=r.jsxs("div",{className:o,onClick:n,role:b,tabIndex:C,onKeyDown:x,children:[p,g,j]}),e[18]=n,e[19]=g,e[20]=j,e[21]=o,e[22]=b,e[23]=C,e[24]=x,e[25]=p,e[26]=y):y=e[26],y}function D(c){return c.stopPropagation()}function H(c){const e=v.c(5),{children:i,className:l}=c;let t;e[0]!==l?(t=N("flex items-center justify-end gap-2 px-4 py-4",l),e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==i||e[3]!==t?(s=r.jsx("div",{className:t,children:i}),e[2]=i,e[3]=t,e[4]=s):s=e[4],s}function K(c){const e=v.c(5),{className:i,children:l}=c;let t;e[0]!==i?(t=N("flex flex-col gap-10",i),e[0]=i,e[1]=t):t=e[1];let s;return e[2]!==l||e[3]!==t?(s=r.jsx("div",{className:t,children:l}),e[2]=l,e[3]=t,e[4]=s):s=e[4],s}export{I as S,P as a,R as b,K as c,H as d};
1
+ import{c as v,l as N,j as r,r as S}from"./index-v1F20B0E.js";import{C as w}from"./card-dUi6YgZ6.js";import{i as E}from"./ArrowUpRight-L-sW_E0D.js";function I(c){const e=v.c(12),{title:i,description:l,docsHref:t,actions:s,className:n,headerClassName:a,children:d}=c;let m;e[0]!==n?(m=N("flex flex-col gap-3",n),e[0]=n,e[1]=m):m=e[1];let f;e[2]!==s||e[3]!==l||e[4]!==t||e[5]!==a||e[6]!==i?(f=(i||l||t||s)&&r.jsxs("div",{className:N("flex items-center justify-between gap-3 px-4",a),children:[r.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[i&&r.jsx("h2",{className:"text-[15px] font-medium leading-tight",children:i}),(l||t)&&r.jsxs("p",{className:"text-sm text-muted-foreground leading-snug",children:[l,t&&r.jsxs("a",{href:t,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-0.5 ml-1 text-foreground hover:underline",children:["Docs ",r.jsx(E,{size:12})]})]})]}),s&&r.jsx("div",{className:"shrink-0",children:s})]}),e[2]=s,e[3]=l,e[4]=t,e[5]=a,e[6]=i,e[7]=f):f=e[7];let o;return e[8]!==d||e[9]!==m||e[10]!==f?(o=r.jsxs("section",{className:m,children:[f,d]}),e[8]=d,e[9]=m,e[10]=f,e[11]=o):o=e[11],o}function P(c){const e=v.c(11),{className:i,children:l}=c;let t,s,n;if(e[0]!==l||e[1]!==i){const d=S.Children.toArray(l).filter(S.isValidElement);t=w,e[5]!==i?(s=N("p-0 gap-0 overflow-hidden",i),e[5]=i,e[6]=s):s=e[6],n=d.map($),e[0]=l,e[1]=i,e[2]=t,e[3]=s,e[4]=n}else t=e[2],s=e[3],n=e[4];let a;return e[7]!==t||e[8]!==s||e[9]!==n?(a=r.jsx(t,{className:s,children:n}),e[7]=t,e[8]=s,e[9]=n,e[10]=a):a=e[10],a}function $(c,e){return r.jsxs("div",{children:[e>0&&r.jsx("div",{className:"h-px bg-border mx-5"}),c]},e)}function R(c){const e=v.c(27),{icon:i,title:l,description:t,action:s,onClick:n,className:a,children:d}=c,m=d?"flex items-start gap-3 px-4 py-4":"flex items-center gap-3 px-4 py-4",f=n&&"hover:bg-muted/50 cursor-pointer";let o;e[0]!==a||e[1]!==m||e[2]!==f?(o=N(m,f,a),e[0]=a,e[1]=m,e[2]=f,e[3]=o):o=e[3];const b=n?"button":void 0,C=n?0:void 0;let x;e[4]!==n?(x=n?k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),n())}:void 0,e[4]=n,e[5]=x):x=e[5];let p;e[6]!==i?(p=i&&r.jsx("div",{className:"size-8 shrink-0 rounded-lg bg-muted/60 flex items-center justify-center text-muted-foreground",children:i}),e[6]=i,e[7]=p):p=e[7];let u;e[8]!==l?(u=r.jsx("div",{className:"text-sm font-medium",children:l}),e[8]=l,e[9]=u):u=e[9];let h;e[10]!==t?(h=t&&r.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:t}),e[10]=t,e[11]=h):h=e[11];let g;e[12]!==d||e[13]!==u||e[14]!==h?(g=r.jsxs("div",{className:"flex-1 min-w-0",children:[u,h,d]}),e[12]=d,e[13]=u,e[14]=h,e[15]=g):g=e[15];let j;e[16]!==s?(j=s&&r.jsx("div",{className:"shrink-0",onClick:D,children:s}),e[16]=s,e[17]=j):j=e[17];let y;return e[18]!==n||e[19]!==g||e[20]!==j||e[21]!==o||e[22]!==b||e[23]!==C||e[24]!==x||e[25]!==p?(y=r.jsxs("div",{className:o,onClick:n,role:b,tabIndex:C,onKeyDown:x,children:[p,g,j]}),e[18]=n,e[19]=g,e[20]=j,e[21]=o,e[22]=b,e[23]=C,e[24]=x,e[25]=p,e[26]=y):y=e[26],y}function D(c){return c.stopPropagation()}function H(c){const e=v.c(5),{children:i,className:l}=c;let t;e[0]!==l?(t=N("flex items-center justify-end gap-2 px-4 py-4",l),e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==i||e[3]!==t?(s=r.jsx("div",{className:t,children:i}),e[2]=i,e[3]=t,e[4]=s):s=e[4],s}function K(c){const e=v.c(5),{className:i,children:l}=c;let t;e[0]!==i?(t=N("flex flex-col gap-10",i),e[0]=i,e[1]=t):t=e[1];let s;return e[2]!==l||e[3]!==t?(s=r.jsx("div",{className:t,children:l}),e[2]=l,e[3]=t,e[4]=s):s=e[4],s}export{I as S,P as a,R as b,K as c,H as d};
@@ -1 +1 @@
1
- import{c as f,j as a}from"./index-CsZhMKFM.js";import{u as p,m as b,p as d,q as h}from"./sidebar-DRSu2iBz.js";import{i as u}from"./LayoutLeft-DvNM8qhm.js";import{T as S}from"./toolbar-icon-button-5fStNBy9.js";function T(m){const e=f.c(4),{className:o}=m,{toggleSidebar:n}=p();let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=a.jsx(u,{size:16}),e[0]=t):t=e[0];let s;return e[1]!==o||e[2]!==n?(s=a.jsx(S,{onClick:n,"aria-label":"Toggle sidebar",className:o,children:t}),e[1]=o,e[2]=n,e[3]=s):s=e[3],s}function M(m){const e=f.c(12),{renderSidebar:o}=m,{openMobile:n,setOpenMobile:t}=p();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=a.jsx(b,{className:"sr-only",children:"Navigation"}),e[0]=s):s=e[0];let i;e[1]!==t?(i=()=>t(!1),e[1]=t,e[2]=i):i=e[2];let l;e[3]!==o||e[4]!==i?(l=o({onClose:i}),e[3]=o,e[4]=i,e[5]=l):l=e[5];let r;e[6]!==l?(r=a.jsxs(d,{side:"left",hideCloseButton:!0,className:"w-screen max-w-none! p-0",children:[s,l]}),e[6]=l,e[7]=r):r=e[7];let c;return e[8]!==n||e[9]!==t||e[10]!==r?(c=a.jsx(h,{open:n,onOpenChange:t,children:r}),e[8]=n,e[9]=t,e[10]=r,e[11]=c):c=e[11],c}export{M,T as S};
1
+ import{c as f,j as a}from"./index-v1F20B0E.js";import{u as p,m as b,p as d,q as h}from"./sidebar-DMHBEB3a.js";import{i as u}from"./LayoutLeft-Ccrzp7iH.js";import{T as S}from"./toolbar-icon-button-DCDLCG5U.js";function T(m){const e=f.c(4),{className:o}=m,{toggleSidebar:n}=p();let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=a.jsx(u,{size:16}),e[0]=t):t=e[0];let s;return e[1]!==o||e[2]!==n?(s=a.jsx(S,{onClick:n,"aria-label":"Toggle sidebar",className:o,children:t}),e[1]=o,e[2]=n,e[3]=s):s=e[3],s}function M(m){const e=f.c(12),{renderSidebar:o}=m,{openMobile:n,setOpenMobile:t}=p();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=a.jsx(b,{className:"sr-only",children:"Navigation"}),e[0]=s):s=e[0];let i;e[1]!==t?(i=()=>t(!1),e[1]=t,e[2]=i):i=e[2];let l;e[3]!==o||e[4]!==i?(l=o({onClose:i}),e[3]=o,e[4]=i,e[5]=l):l=e[5];let r;e[6]!==l?(r=a.jsxs(d,{side:"left",hideCloseButton:!0,className:"w-screen max-w-none! p-0",children:[s,l]}),e[6]=l,e[7]=r):r=e[7];let c;return e[8]!==n||e[9]!==t||e[10]!==r?(c=a.jsx(h,{open:n,onOpenChange:t,children:r}),e[8]=n,e[9]=t,e[10]=r,e[11]=c):c=e[11],c}export{M,T as S};