decocms 4.261.0 → 4.261.2

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 (224) hide show
  1. package/dist/client/assets/{AlertCircle-DZFu44wM.js → AlertCircle-BKG7D-9N.js} +1 -1
  2. package/dist/client/assets/{AreaChart-DhghsA5m.js → AreaChart-JbCf9yx5.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-DkgXiBNy.js → ArrowLeft-yXWZTd3K.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-esO_GZxr.js → ArrowUp-B9rSngVL.js} +1 -1
  5. package/dist/client/assets/{Check-hLO7r2HE.js → Check-DsSX1qno.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-DLCLg_5s.js → CheckCircle-BAVtjq6J.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-tpHSHuoX.js → ChevronDown-3Y-CRZZD.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-DMlKw5yi.js → ChevronRight-Buq1yopX.js} +1 -1
  9. package/dist/client/assets/{ChevronSelectorVertical-CSVczE2B.js → ChevronSelectorVertical-DOBGpkVA.js} +1 -1
  10. package/dist/client/assets/{ChevronUp-Cp7vygr2.js → ChevronUp-BQkKayQd.js} +1 -1
  11. package/dist/client/assets/{Copy01-GrhKaAkx.js → Copy01-a2WKVjcK.js} +1 -1
  12. package/dist/client/assets/{CreditCard01-DnLfkTp9.js → CreditCard01-DdGNjzTK.js} +1 -1
  13. package/dist/client/assets/{DotsVertical-BXddSit_.js → DotsVertical-DTerhIVm.js} +1 -1
  14. package/dist/client/assets/{Download01-Dwq2qmmH.js → Download01-C28Kvbnr.js} +1 -1
  15. package/dist/client/assets/{Eye-C7GPYyDb.js → Eye-BYmVnsHQ.js} +1 -1
  16. package/dist/client/assets/{FilterLines-CXDPhDi6.js → FilterLines-DOdrxs6h.js} +1 -1
  17. package/dist/client/assets/{Globe01-BfB8eIJU.js → Globe01-BPd1JQ7C.js} +1 -1
  18. package/dist/client/assets/{Globe04-LxusD0rq.js → Globe04-C4cNBevR.js} +1 -1
  19. package/dist/client/assets/{HardDrive-LE4n1-ZA.js → HardDrive-BDZO-aak.js} +1 -1
  20. package/dist/client/assets/{Key01-DrEAOsuD.js → Key01-BYJxbFiz.js} +1 -1
  21. package/dist/client/assets/{LinkExternal01-BYVduhsN.js → LinkExternal01-xgcQx4Ym.js} +1 -1
  22. package/dist/client/assets/{LockUnlocked01-BaSB7sm3.js → LockUnlocked01-BLD2I2IR.js} +1 -1
  23. package/dist/client/assets/{LogOut01-266UJ8de.js → LogOut01-BvzIKGJZ.js} +1 -1
  24. package/dist/client/assets/{Monitor01-1xXq2IPx.js → Monitor01-59Ug2myj.js} +1 -1
  25. package/dist/client/assets/{Palette-1pI-KZlP.js → Palette-B0b0yZyd.js} +1 -1
  26. package/dist/client/assets/{Play-CtacMSAa.js → Play-CBvnCo9D.js} +1 -1
  27. package/dist/client/assets/{Plus-C_XyRV9o.js → Plus-BhxWvTlN.js} +1 -1
  28. package/dist/client/assets/{SearchLg-5xYQ9uvd.js → SearchLg-2wWsr3ld.js} +1 -1
  29. package/dist/client/assets/{SearchMd-C9GQ2km1.js → SearchMd-6mUsS-Y7.js} +1 -1
  30. package/dist/client/assets/{Settings02-DCCuKvtp.js → Settings02-CJtdruE3.js} +1 -1
  31. package/dist/client/assets/{Share07-BOHI3rrz.js → Share07-Bp2bqpBF.js} +1 -1
  32. package/dist/client/assets/{Shield01-COi1B7kf.js → Shield01-Bt1AMT_-.js} +1 -1
  33. package/dist/client/assets/{Stars01-CC06iPhj.js → Stars01-Bv4MJS3u.js} +1 -1
  34. package/dist/client/assets/{Stars02-D3qXoOLZ.js → Stars02-CWlpBG0m.js} +1 -1
  35. package/dist/client/assets/{Sun-jPBqcjFt.js → Sun-DW01oEoe.js} +1 -1
  36. package/dist/client/assets/{SwitchHorizontal01-DZYDjMbc.js → SwitchHorizontal01-1VwkcOEn.js} +1 -1
  37. package/dist/client/assets/{Tool01-C4zZsyps.js → Tool01-BdWMT188.js} +1 -1
  38. package/dist/client/assets/{Tool02-DLxiNzFy.js → Tool02-oxWxO97N.js} +1 -1
  39. package/dist/client/assets/{Trash01-BnhQdu9A.js → Trash01-DLeW8BuY.js} +1 -1
  40. package/dist/client/assets/{TrendUp01-B7GgpN9e.js → TrendUp01-lB5R-q63.js} +1 -1
  41. package/dist/client/assets/{Upload01-DLYjNhy_.js → Upload01-BRX3Gg8H.js} +1 -1
  42. package/dist/client/assets/{User01-BY4te5TI.js → User01-BmlhCgSw.js} +1 -1
  43. package/dist/client/assets/{UserSquare-DhGqN1SZ.js → UserSquare-CYd2ERl7.js} +1 -1
  44. package/dist/client/assets/{Users01-CvTMs3gp.js → Users01-C2tns4VW.js} +1 -1
  45. package/dist/client/assets/{Users03-D2cD7ccR.js → Users03-DGaF7kMn.js} +1 -1
  46. package/dist/client/assets/{XCircle-Dh3HHPWT.js → XCircle-Roe883NX.js} +1 -1
  47. package/dist/client/assets/{XClose-BDZnM-lS.js → XClose-COWGVm3N.js} +1 -1
  48. package/dist/client/assets/{YAxis-P3YoSbFK.js → YAxis-BZOvU2rx.js} +1 -1
  49. package/dist/client/assets/{Zap-8OtTGtWt.js → Zap-DPVLyPv1.js} +1 -1
  50. package/dist/client/assets/{ZapSquare-CUXTzDj_.js → ZapSquare-C0H24eK5.js} +1 -1
  51. package/dist/client/assets/{access-gate-BDK2itRc.js → access-gate-u7Tvu9Ix.js} +1 -1
  52. package/dist/client/assets/{agent-icon-DgBY8JIs.js → agent-icon-Cbo0rbd8.js} +1 -1
  53. package/dist/client/assets/{agents-list-DFngs-r9.js → agents-list-pZCDKW8N.js} +1 -1
  54. package/dist/client/assets/{ai-providers-Cp0Z6Ksg.js → ai-providers-CVnUYumq.js} +1 -1
  55. package/dist/client/assets/{alert-DCtEkBMx.js → alert-BdwRYqRH.js} +1 -1
  56. package/dist/client/assets/{alert-dialog-Do_ysv5F.js → alert-dialog-BRQzSE_N.js} +1 -1
  57. package/dist/client/assets/{api-keys-BmlIP6b7.js → api-keys-DxQdq1fa.js} +1 -1
  58. package/dist/client/assets/{app-editor-BdavU1Ne.js → app-editor-Bvqkmzhi.js} +1 -1
  59. package/dist/client/assets/{auth-RECGlrMr.js → auth-DXCk1XS_.js} +1 -1
  60. package/dist/client/assets/{auth-catchall-ByqK8F42.js → auth-catchall-CifmM10u.js} +1 -1
  61. package/dist/client/assets/{auth-entry-DhxiMgB-.js → auth-entry-DLCJ3jy9.js} +1 -1
  62. package/dist/client/assets/{auth-split-layout-BwIdQ9pF.js → auth-split-layout-ZmTSr9i4.js} +1 -1
  63. package/dist/client/assets/{authenticate-and-persist-oauth-CbGxzbun.js → authenticate-and-persist-oauth-Coc-ZKme.js} +1 -1
  64. package/dist/client/assets/{automation-list-row-BS3KBK6t.js → automation-list-row-aK8-F5Tj.js} +1 -1
  65. package/dist/client/assets/{automation-runs-xvz_4qW5.js → automation-runs-CqHC9Z0L.js} +1 -1
  66. package/dist/client/assets/{automations-CoLFqzHB.js → automations-C8LXsnE6.js} +1 -1
  67. package/dist/client/assets/{avatar-B_bJ6wU0.js → avatar-C3PwcJq8.js} +1 -1
  68. package/dist/client/assets/{badge-CLwqD33w.js → badge-CH9Icr1q.js} +1 -1
  69. package/dist/client/assets/{block-document-Vy9_D4Jy.js → block-document-CoJz5eXU.js} +1 -1
  70. package/dist/client/assets/{buckets-Dcyki0A_.js → buckets-BPF4BJO6.js} +1 -1
  71. package/dist/client/assets/{bulk-category-panel-og3ViWQq.js → bulk-category-panel-B5ekuTbL.js} +1 -1
  72. package/dist/client/assets/{capability-load-error-Bnr1maRf.js → capability-load-error-2DCBIdHV.js} +1 -1
  73. package/dist/client/assets/{cards-D06k-OVf.js → cards-CGfBM5Lb.js} +1 -1
  74. package/dist/client/assets/{category-editor-DTrvBRvk.js → category-editor-D60LSDe-.js} +1 -1
  75. package/dist/client/assets/{chart-CwvwARPR.js → chart-wX_z8gBg.js} +1 -1
  76. package/dist/client/assets/{chat-context-Dw8PIlGq.js → chat-context-C0CACiFo.js} +1 -1
  77. package/dist/client/assets/{checkbox-D6PhoM6C.js → checkbox-BM-8xu4l.js} +1 -1
  78. package/dist/client/assets/{choose-editor-pqGzHGBU.js → choose-editor-C_QdQsG5.js} +1 -1
  79. package/dist/client/assets/{cli-auth-success-DSUqXw_k.js → cli-auth-success-DB0zcznK.js} +1 -1
  80. package/dist/client/assets/{collection-detail-tEhZ4ytc.js → collection-detail-CV13d_b_.js} +1 -1
  81. package/dist/client/assets/{collection-display-button-sgrxkzr7.js → collection-display-button-C5bOITL9.js} +1 -1
  82. package/dist/client/assets/{collection-search-CgJtXHJn.js → collection-search-BB-cJIKU.js} +1 -1
  83. package/dist/client/assets/{collection-table-wrapper-B6CIJTsQ.js → collection-table-wrapper-B7WWQdrh.js} +1 -1
  84. package/dist/client/assets/{collection-tabs-6xHjR7WO.js → collection-tabs-CSymOanp.js} +1 -1
  85. package/dist/client/assets/{command-BdMtYkg5.js → command-DeEGxZTh.js} +1 -1
  86. package/dist/client/assets/{commerce-onboarding-50WeRiMc.js → commerce-onboarding-B-j2-Zff.js} +1 -1
  87. package/dist/client/assets/{connect-Dsogda48.js → connect-T3XLQSIe.js} +1 -1
  88. package/dist/client/assets/{connection-BTcwbAvn.js → connection-BOO72Vh-.js} +1 -1
  89. package/dist/client/assets/{connection-card-ew03Lcdy.js → connection-card-BFdaG5Pg.js} +1 -1
  90. package/dist/client/assets/{connection-detail-C4n31sy1.js → connection-detail-rdOMUqfX.js} +1 -1
  91. package/dist/client/assets/{connection-form-helpers-CSatHoi9.js → connection-form-helpers-CfykKxIx.js} +1 -1
  92. package/dist/client/assets/{connections-D_SonyD4.js → connections-YvKIsLU3.js} +1 -1
  93. package/dist/client/assets/{decopilot-sse-pool-Cy1jMi_E.js → decopilot-sse-pool-CRzlvmLY.js} +1 -1
  94. package/dist/client/assets/{dialog-29-_Zj5P.js → dialog-DQcS-86l.js} +1 -1
  95. package/dist/client/assets/{domain-settings-2BIR65qD.js → domain-settings-BRVnGJah.js} +1 -1
  96. package/dist/client/assets/{drawer-B5GprU2X.js → drawer-BxoRaw4y.js} +1 -1
  97. package/dist/client/assets/{dropdown-menu-BHTUy6WB.js → dropdown-menu-DR5TrQ6y.js} +1 -1
  98. package/dist/client/assets/{empty-state-DrfDSfvR.js → empty-state-sTCJA8AO.js} +1 -1
  99. package/dist/client/assets/{extract-connection-data-UeoUoqZ4.js → extract-connection-data-BpUCAP1Q.js} +1 -1
  100. package/dist/client/assets/{file-explorer-4LyVCp6d.js → file-explorer-Br6wUm2W.js} +1 -1
  101. package/dist/client/assets/{file-type-icon-DWj5ATqJ.js → file-type-icon-CxSX_liB.js} +1 -1
  102. package/dist/client/assets/{form-DtiDbMy5.js → form-Bz4b6vZ-.js} +1 -1
  103. package/dist/client/assets/{general-cxU5NyFy.js → general-dVSGXip3.js} +1 -1
  104. package/dist/client/assets/{github-repo-picker-DEBp_TQd.js → github-repo-picker-BOP91Taj.js} +1 -1
  105. package/dist/client/assets/{hooks-CxPd6lTT.js → hooks-BeMpgdL5.js} +1 -1
  106. package/dist/client/assets/{index-LghvRtbI.js → index-BMt9rXRF.js} +1 -1
  107. package/dist/client/assets/{index-CaPyX0Gl.js → index-BXActXGS.js} +1 -1
  108. package/dist/client/assets/{index-tHGIEJYl.js → index-BsXYh44E.js} +1 -1
  109. package/dist/client/assets/{index-BZ5T2iZo.js → index-ChqKDZgx.js} +1 -1
  110. package/dist/client/assets/{index-ByO5RuvU.js → index-Chy1AEww.js} +1 -1
  111. package/dist/client/assets/{index-BewLh1hW.js → index-D94CuDdg.js} +1 -1
  112. package/dist/client/assets/{index-D8jxCbiQ.js → index-DJF4EiWQ.js} +6 -6
  113. package/dist/client/assets/{index-CrWPp0h7.js → index-DJKQNVWv.js} +1 -1
  114. package/dist/client/assets/{index-BUry0fVo.js → index-DO5YRMF2.js} +3 -3
  115. package/dist/client/assets/{index-C3w9_7eu.js → index-D_zPDpJr.js} +1 -1
  116. package/dist/client/assets/{index-redirect-DpL_cf7O.js → index-redirect-C36nehcw.js} +1 -1
  117. package/dist/client/assets/{infra-billing-Cy9tmEKt.js → infra-billing-D5EwE3Hp.js} +1 -1
  118. package/dist/client/assets/{input-BFe0Oo8v.js → input-C_KfEpTM.js} +1 -1
  119. package/dist/client/assets/{integration-icon-HAvbIF-_.js → integration-icon-BvbufOa2.js} +1 -1
  120. package/dist/client/assets/{invite-member-dialog-CThVfron.js → invite-member-dialog-wO_W_Ljx.js} +1 -1
  121. package/dist/client/assets/{label-BUxT1WbP.js → label-hY48vMGc.js} +1 -1
  122. package/dist/client/assets/{layout-CiOQ7vpK.js → layout-9iEa3oAE.js} +1 -1
  123. package/dist/client/assets/{login-NrYZTBWV.js → login-CLyb1pLq.js} +1 -1
  124. package/dist/client/assets/{mcp-oauth-CA2NG4pB.js → mcp-oauth-BkOQlmKJ.js} +1 -1
  125. package/dist/client/assets/{members-C1wi7GGE.js → members-CbSBN1HV.js} +1 -1
  126. package/dist/client/assets/{monaco-editor-DaNRSZ7l.js → monaco-editor-DgpgN6WP.js} +1 -1
  127. package/dist/client/assets/{monitoring-stats-row-CRQrQo20.js → monitoring-stats-row-5waCAhHl.js} +1 -1
  128. package/dist/client/assets/{multi-select-1sRuS0-m.js → multi-select-B8w-Dt3y.js} +1 -1
  129. package/dist/client/assets/{oauth-callback-Dvogj_d3.js → oauth-callback-CNmQkkdC.js} +1 -1
  130. package/dist/client/assets/{oauth-callback-ai-provider-UQxb94QH.js → oauth-callback-ai-provider-CYwXK5tM.js} +1 -1
  131. package/dist/client/assets/{onboarding-20TqmU5G.js → onboarding-Rp21loqj.js} +1 -1
  132. package/dist/client/assets/{org-layout-z7IElyp_.js → org-layout-0VxB9Nd1.js} +1 -1
  133. package/dist/client/assets/{organization-choice-2CxqOeju.js → organization-choice-BwsM7CxR.js} +1 -1
  134. package/dist/client/assets/{orgs-NL4dVaJm.js → orgs-TXE5NWKL.js} +1 -1
  135. package/dist/client/assets/{page-seo-form-QjhN72eM.js → page-seo-form-CzKOGYav.js} +1 -1
  136. package/dist/client/assets/{popover-CuAT1vzx.js → popover-g2pYQ4-p.js} +1 -1
  137. package/dist/client/assets/{post-calendar-DrPK8ZUA.js → post-calendar-DWNcKzKt.js} +1 -1
  138. package/dist/client/assets/{post-editor-BHggAfqq.js → post-editor-CrU-G3ph.js} +1 -1
  139. package/dist/client/assets/{primitives-Ccv4P3nl.js → primitives-DlinE2fS.js} +1 -1
  140. package/dist/client/assets/{profile-27t6KEbh.js → profile-DhGzDLQO.js} +1 -1
  141. package/dist/client/assets/{project-app-view-CPCJs9zL.js → project-app-view-fMGxQ8IM.js} +1 -1
  142. package/dist/client/assets/record-editor-dRE9GllS.js +1 -0
  143. package/dist/client/assets/{redirect-editor-qsBLp4UG.js → redirect-editor-BJwUQBpX.js} +1 -1
  144. package/dist/client/assets/registry-DeJGbODx.js +2 -0
  145. package/dist/client/assets/{registry-layout-U8goM0XO.js → registry-layout-BQphjmQk.js} +1 -1
  146. package/dist/client/assets/{reports-CXqQ9sgh.js → reports-6dw_HARD.js} +1 -1
  147. package/dist/client/assets/{require-capability-CjqWynNw.js → require-capability-BnYIgpup.js} +1 -1
  148. package/dist/client/assets/{required-auth-layout-CSeTy-5X.js → required-auth-layout-ClLEHZpP.js} +1 -1
  149. package/dist/client/assets/{reset-password-NghMB8Pa.js → reset-password-o6ARh7vE.js} +1 -1
  150. package/dist/client/assets/{roles-0jodD3Re.js → roles-d34pbv6M.js} +1 -1
  151. package/dist/client/assets/{search-input-Cq4S4WH_.js → search-input-jHNXVj3b.js} +1 -1
  152. package/dist/client/assets/{secrets-C34-qWYk.js → secrets-BicvdQd-.js} +1 -1
  153. package/dist/client/assets/{sections-editor-CIbhX3CJ.js → sections-editor-Bu1oJmJZ.js} +1 -1
  154. package/dist/client/assets/{select-BadagpiW.js → select-BbTCc1n4.js} +1 -1
  155. package/dist/client/assets/{select-model-DTacKBU3.js → select-model-4byESaTm.js} +1 -1
  156. package/dist/client/assets/{self-tool-result-CSlcG95d.js → self-tool-result-sXGc5k6O.js} +1 -1
  157. package/dist/client/assets/{seo-editor-CdnvlyRP.js → seo-editor-1hl4f4Ii.js} +1 -1
  158. package/dist/client/assets/{settings-layout-DyRty4gu.js → settings-layout-DJXJBBJz.js} +1 -1
  159. package/dist/client/assets/{shell-controls-DI_y3HcN.js → shell-controls-BC1TAEog.js} +1 -1
  160. package/dist/client/assets/{shell-layout-BqlzQzhR.js → shell-layout-C9mXTtwc.js} +1 -1
  161. package/dist/client/assets/{spinner-BWvBZ6qE.js → spinner-DDmc-ww2.js} +1 -1
  162. package/dist/client/assets/{sprints-DdO64d8j.js → sprints-BARFiKGG.js} +1 -1
  163. package/dist/client/assets/{sso-B8yg9Wjg.js → sso-DND2jCnP.js} +1 -1
  164. package/dist/client/assets/{store-c-6951be.js → store-oS7nmBAQ.js} +1 -1
  165. package/dist/client/assets/store-registry-DcTC_Uyf.js +2 -0
  166. package/dist/client/assets/{switch-gkrLjjz_.js → switch-5ZIKkj65.js} +1 -1
  167. package/dist/client/assets/{synced-repos-CBjbWHnS.js → synced-repos-BIlzOOTX.js} +1 -1
  168. package/dist/client/assets/{tab-id-DitH4xVB.js → tab-id-gkLZKZzs.js} +1 -1
  169. package/dist/client/assets/{table-C7RJzUk_.js → table-BCmw_-1c.js} +1 -1
  170. package/dist/client/assets/{tabs-BKooiG0I.js → tabs-J0KT6kYH.js} +1 -1
  171. package/dist/client/assets/{task-key-BpFWHiTt.js → task-key-xPT-lgkK.js} +1 -1
  172. package/dist/client/assets/{tasks-C35WZrNI.js → tasks-BWrpFPnl.js} +1 -1
  173. package/dist/client/assets/{textarea-CUVPd2Xe.js → textarea-DHbS1l8X.js} +1 -1
  174. package/dist/client/assets/{toggle-group-CPRR2He7.js → toggle-group-CHSAg2sv.js} +1 -1
  175. package/dist/client/assets/{toolbar-CYzfjRkz.js → toolbar-B2KgVV2_.js} +1 -1
  176. package/dist/client/assets/{track-BNf7p9eq.js → track-Bn-O-__7.js} +1 -1
  177. package/dist/client/assets/{types-DdwB8_NE.js → types-CHZQlcZP.js} +1 -1
  178. package/dist/client/assets/{use-ai-providers-CZwP8dmM.js → use-ai-providers-Bivp-YWu.js} +1 -1
  179. package/dist/client/assets/{use-api-keys-9m9XgJI5.js → use-api-keys-DJi7fa3-.js} +1 -1
  180. package/dist/client/assets/{use-automations-vET1p7ZT.js → use-automations-D3Y02Hz6.js} +1 -1
  181. package/dist/client/assets/{use-autosave-B8Jf6Vv0.js → use-autosave-gyx0_R4U.js} +1 -1
  182. package/dist/client/assets/{use-clock-tick-CTRBK5JV.js → use-clock-tick-B4Vh8Egr.js} +1 -1
  183. package/dist/client/assets/{use-commerce-diagnostic-B7yXghOW.js → use-commerce-diagnostic-BlF1KvQS.js} +1 -1
  184. package/dist/client/assets/{use-connection-Blx5H12g.js → use-connection-CWTVS30P.js} +1 -1
  185. package/dist/client/assets/{use-copy-D1WvrpK0.js → use-copy-BhRV_-1G.js} +1 -1
  186. package/dist/client/assets/{use-create-virtual-mcp-C5yUgQqq.js → use-create-virtual-mcp-c7AO6kvw.js} +1 -1
  187. package/dist/client/assets/{use-debounced-autosave-DcmEEvKt.js → use-debounced-autosave-DdQp0gZ8.js} +1 -1
  188. package/dist/client/assets/{use-debounced-value-C5HiE91b.js → use-debounced-value-u04RrNmJ.js} +1 -1
  189. package/dist/client/assets/{use-decopilot-events-CuBSdjt3.js → use-decopilot-events-qr59AKHV.js} +1 -1
  190. package/dist/client/assets/{use-delete-connection-DAEaE-xO.js → use-delete-connection-CNs5qA9X.js} +1 -1
  191. package/dist/client/assets/{use-deployment-admin-Dhn8I_T7.js → use-deployment-admin-BDhTDz7I.js} +1 -1
  192. package/dist/client/assets/{use-file-configs-BYupDLzt.js → use-file-configs-C6xtQYYR.js} +1 -1
  193. package/dist/client/assets/{use-infinite-scroll-B8TNpK5j.js → use-infinite-scroll-B1K93eo8.js} +1 -1
  194. package/dist/client/assets/{use-join-requests-B8v3zLIL.js → use-join-requests-DrL-AJ_g.js} +1 -1
  195. package/dist/client/assets/{use-mcp-client-5QdhsKOJ.js → use-mcp-client-Zc_yhkHz.js} +1 -1
  196. package/dist/client/assets/{use-mcp-tools-BMgEopnM.js → use-mcp-tools-DWnWlwYx.js} +1 -1
  197. package/dist/client/assets/{use-members-C9xJOhFR.js → use-members-BXk31-rN.js} +1 -1
  198. package/dist/client/assets/{use-navigate-to-agent-Dg9sFjEg.js → use-navigate-to-agent-B2o_Px-4.js} +1 -1
  199. package/dist/client/assets/{use-org-auth-client-Bj6afkR4.js → use-org-auth-client-x9nq6dCg.js} +1 -1
  200. package/dist/client/assets/{use-org-repo-syncs-BEkShSDR.js → use-org-repo-syncs-BBhDoHSr.js} +1 -1
  201. package/dist/client/assets/{use-org-sso-Mm-Hsvi4.js → use-org-sso-CZmxM-OR.js} +1 -1
  202. package/dist/client/assets/{use-organization-roles-DChT4-75.js → use-organization-roles-eZvQ_3wO.js} +1 -1
  203. package/dist/client/assets/{use-organization-settings-DyeEQzE3.js → use-organization-settings-BV_7awEF.js} +1 -1
  204. package/dist/client/assets/{use-registry-connections-COPylfj9.js → use-registry-connections-Cdo42PB7.js} +1 -1
  205. package/dist/client/assets/{use-secrets-B1pIuTbk.js → use-secrets-C67DutYx.js} +1 -1
  206. package/dist/client/assets/{use-section-preview-base-LaMl7G6s.js → use-section-preview-base-dK2VZoN_.js} +1 -1
  207. package/dist/client/assets/{use-status-sounds-BdU_MBYP.js → use-status-sounds-BPSuggr1.js} +1 -1
  208. package/dist/client/assets/{use-tags-B1vJungu.js → use-tags-CqThj_Ac.js} +1 -1
  209. package/dist/client/assets/{use-view-mode-RiZ_Pv1K.js → use-view-mode-R0znvXDy.js} +1 -1
  210. package/dist/client/assets/{use-virtual-mcp-D0wWL0w5.js → use-virtual-mcp-BKSYfHzd.js} +1 -1
  211. package/dist/client/assets/useInfiniteQuery-VwVbIitv.js +1 -0
  212. package/dist/client/assets/useSuspenseInfiniteQuery-DufDrP8n.js +1 -0
  213. package/dist/client/assets/{users-8cRXa3gk.js → users-D0Wpz7bf.js} +1 -1
  214. package/dist/client/assets/{variant-calendar-ocf6fNJL.js → variant-calendar-B7RP6sqQ.js} +1 -1
  215. package/dist/client/assets/{view-mode-toggle-Gsu2-DBE.js → view-mode-toggle-RKo_tJq6.js} +1 -1
  216. package/dist/client/index.html +1 -1
  217. package/dist/server/cli.js +468 -468
  218. package/dist/server/server.js +328 -328
  219. package/package.json +1 -1
  220. package/dist/client/assets/record-editor-CP_2Qg7-.js +0 -1
  221. package/dist/client/assets/registry-BHVZv1ud.js +0 -2
  222. package/dist/client/assets/store-registry-8XjGYT8I.js +0 -2
  223. package/dist/client/assets/useInfiniteQuery-CMtrj8vY.js +0 -1
  224. package/dist/client/assets/useSuspenseInfiniteQuery-mllJ7qsB.js +0 -1
@@ -1,2 +1,2 @@
1
- import{c as We,b as ut,r as T,n as ze,j as n,aC as Zn,ab as _t,a8 as jt,B as Ze,a9 as Et,k as es,p as Ko,t as Y,K as Fo}from"./index-BUry0fVo.js";import{b as Io}from"./chat-context-Dw8PIlGq.js";import{aw as ts,ax as Oo,ay as $o,az as zo,aA as Ho,ab as ns,ac as Xt,aB as ss,aC as os,ad as as,ae as rs,aD as is,aE as Uo,al as ls,am as cs,aF as Go,aG as qo,aH as us,P as Wo,af as ds,ag as Bt,aj as ms,ak as fs,ah as ps,ar as gs,aI as Jo,aJ as Lt,aK as hs,aL as Yo,S as vs,aM as ct,H as bs,aN as Qo,aO as Xo,aP as Zo,aQ as ea,F as ta,G as na,aR as sa,aS as oa,aT as aa,aU as ra,ap as qt,aV as Wt,aW as ia,aX as xt,aY as Ct,aZ as la,a_ as ca,a$ as st,b0 as Kn,b1 as ua,b2 as At,b3 as Jt,b4 as da,b5 as fn,b6 as ma,b7 as Tt,b8 as fa,b9 as pa,ba as ga,bb as ha,bc as va,bd as yt,be as ba,bf as Sa,bg as xa,J as ya,bh as Fn,bi as Mt,bj as In,bk as On,bl as _a,bm as ja,bn as Ea,bo as Ra,bp as pn,bq as $n,br as zn,bs as Nt,bt as Yt,bu as Hn,bv as wa,bw as gn,bx as ka,by as Ta,bz as Na,bA as Va,bB as Da}from"./index-D8jxCbiQ.js";import{t as Pa}from"./ChevronDown-tpHSHuoX.js";import{ah as vn,x as Ca,V as Ss,G as Aa,w as xs,ao as Ma,r as Ba}from"./agent-icon-DgBY8JIs.js";import{i as ys}from"./ChevronRight-DMlKw5yi.js";import{n as La}from"./ChevronUp-Cp7vygr2.js";import{i as Ka}from"./Globe01-BfB8eIJU.js";import{B as Qt}from"./automation-runs-xvz_4qW5.js";import{b as Fa,h as Ia,a as Oa,c as $a,d as za,e as Ha}from"./dialog-29-_Zj5P.js";import{I as Ua}from"./input-BFe0Oo8v.js";import{a as _s}from"./Copy01-GrhKaAkx.js";import{i as Ga}from"./Settings02-DCCuKvtp.js";import{s as qa}from"./Eye-C7GPYyDb.js";import{s as js}from"./TrendUp01-B7GgpN9e.js";import{s as bn}from"./Plus-C_XyRV9o.js";import{s as Es}from"./Trash01-BnhQdu9A.js";import{i as Wa}from"./Zap-8OtTGtWt.js";import{D as Rs,a as bt,c as ws,b as ks,i as Ja}from"./dropdown-menu-BHTUy6WB.js";import{S as Ya,r as Un,u as Qa,d as Xa,a as Za,i as er,f as tr,P as nr,b as sr}from"./page-seo-form-QjhN72eM.js";import{b as or}from"./Tool01-C4zZsyps.js";import{u as ar,A as rr}from"./use-section-preview-base-LaMl7G6s.js";import"./tab-id-DitH4xVB.js";import"./Check-hLO7r2HE.js";import"./Download01-Dwq2qmmH.js";import"./session-runtime-wVXsCwcJ.js";import"./hooks-CxPd6lTT.js";import"./use-mcp-client-5QdhsKOJ.js";import"./constants-_08zpzmT.js";import"./auth-RECGlrMr.js";import"./decopilot-sse-pool-Cy1jMi_E.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-D0wWL0w5.js";import"./use-ai-providers-CZwP8dmM.js";import"./use-decopilot-events-CuBSdjt3.js";import"./use-organization-settings-DyeEQzE3.js";import"./ArrowUp-esO_GZxr.js";import"./spinner-BWvBZ6qE.js";import"./drawer-B5GprU2X.js";import"./collection-search-CgJtXHJn.js";import"./SearchMd-C9GQ2km1.js";import"./chart-CwvwARPR.js";import"./index-ByO5RuvU.js";import"./shell-layout-BqlzQzhR.js";import"./avatar-B_bJ6wU0.js";import"./User01-BY4te5TI.js";import"./Users03-D2cD7ccR.js";import"./SearchLg-5xYQ9uvd.js";import"./Stars02-D3qXoOLZ.js";import"./XClose-BDZnM-lS.js";import"./CheckCircle-DLCLg_5s.js";import"./FilterLines-CXDPhDi6.js";import"./Monitor01-1xXq2IPx.js";import"./required-auth-layout-CSeTy-5X.js";import"./use-org-sso-Mm-Hsvi4.js";import"./XCircle-Dh3HHPWT.js";import"./Upload01-DLYjNhy_.js";import"./AlertCircle-DZFu44wM.js";import"./form-DtiDbMy5.js";import"./label-BUxT1WbP.js";import"./select-BadagpiW.js";import"./UserSquare-DhGqN1SZ.js";import"./ArrowLeft-DkgXiBNy.js";import"./tabs-BKooiG0I.js";import"./Tool02-DLxiNzFy.js";import"./toggle-group-CPRR2He7.js";import"./use-commerce-diagnostic-B7yXghOW.js";import"./popover-CuAT1vzx.js";import"./self-tool-result-CSlcG95d.js";import"./alert-dialog-Do_ysv5F.js";import"./integration-icon-HAvbIF-_.js";import"./extract-connection-data-UeoUoqZ4.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-CMPWtdMv.js";import"./use-debounced-value-C5HiE91b.js";import"./LinkExternal01-BYVduhsN.js";import"./authenticate-and-persist-oauth-CbGxzbun.js";import"./mcp-oauth-CA2NG4pB.js";import"./track-BNf7p9eq.js";import"./toolbar-CYzfjRkz.js";import"./github-repo-picker-DEBp_TQd.js";import"./use-connection-Blx5H12g.js";import"./LockUnlocked01-BaSB7sm3.js";import"./use-mcp-tools-BMgEopnM.js";import"./use-navigate-to-agent-Dg9sFjEg.js";import"./reusable-new-chat-CzvRy4Pe.js";import"./agent-capabilities-C4tLW0Za.js";import"./connection-card-ew03Lcdy.js";import"./use-registry-connections-COPylfj9.js";import"./useInfiniteQuery-CMtrj8vY.js";import"./use-infinite-scroll-B8TNpK5j.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-CUVPd2Xe.js";import"./connection-form-helpers-CSatHoi9.js";import"./collection-tabs-6xHjR7WO.js";import"./badge-CLwqD33w.js";import"./useSuspenseInfiniteQuery-mllJ7qsB.js";import"./command-BdMtYkg5.js";import"./index-LghvRtbI.js";import"./use-clock-tick-CTRBK5JV.js";import"./DotsVertical-BXddSit_.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./select-model-DTacKBU3.js";import"./checkbox-D6PhoM6C.js";import"./ChevronSelectorVertical-CSVczE2B.js";import"./Key01-DrEAOsuD.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Stars01-CC06iPhj.js";import"./cards-D06k-OVf.js";import"./Share07-BOHI3rrz.js";import"./Palette-1pI-KZlP.js";import"./file-type-icon-DWj5ATqJ.js";import"./question-004-sINsf4GQ.js";import"./use-members-C9xJOhFR.js";import"./use-org-auth-client-Bj6afkR4.js";import"./use-status-sounds-BdU_MBYP.js";import"./empty-state-DrfDSfvR.js";import"./ZapSquare-CUXTzDj_.js";import"./types-DdwB8_NE.js";import"./use-file-configs-BYupDLzt.js";import"./monaco-editor-DaNRSZ7l.js";import"./pt-BR-CLy76QW2.js";import"./switch-gkrLjjz_.js";import"./Play-CtacMSAa.js";import"./use-debounced-autosave-DcmEEvKt.js";import"./search-input-Cq4S4WH_.js";import"./index-BZ5T2iZo.js";import"./Users01-CvTMs3gp.js";import"./use-secrets-B1pIuTbk.js";import"./AreaChart-DhghsA5m.js";import"./task-key-BpFWHiTt.js";import"./sprints-DdO64d8j.js";import"./use-copy-D1WvrpK0.js";import"./SwitchHorizontal01-DZYDjMbc.js";import"./use-tags-B1vJungu.js";import"./get-initials-D-f_fDFw.js";import"./use-automations-vET1p7ZT.js";import"./automation-list-row-BS3KBK6t.js";import"./site-error--i37Vnuw.js";import"./use-org-repo-syncs-BEkShSDR.js";import"./CreditCard01-DnLfkTp9.js";import"./Globe04-LxusD0rq.js";import"./HardDrive-LE4n1-ZA.js";import"./LogOut01-266UJ8de.js";import"./Sun-jPBqcjFt.js";import"./Shield01-COi1B7kf.js";import"./table-C7RJzUk_.js";function ir(m){return m.schema?.definitions??m.schema?.$defs??{}}function Ts(m,e){const a=ir(e),l=a[btoa(m)];if(!l)return[];const d=[l];if(Array.isArray(l.allOf)){const h=l.allOf.find(b=>typeof b.$ref=="string")?.$ref;if(typeof h=="string"){const b=a[h.replace("#/definitions/","")];b&&d.push(b)}}return d}function lr(m,e){for(const a of Ts(m,e)){const l=typeof a.image=="string"?a.image:void 0;if(l?.includes("{{{"))return l}}function cr(m,e){if(!e)return;const a=ts(m);if(!a)return;const l=lr(a.resolveType,e);if(!l)return;const d=Oo(l,a.data);if(d)return $o(d)}const ur={escape:Ho};function dr(m,e){for(const a of Ts(m,e)){const l=typeof a.title=="string"?a.title:void 0;if(l?.includes("{{"))return l}}function mr(m,e){if(!e)return;const a=ts(m);if(a)try{const l=dr(a.resolveType,e);return l&&zo.render(l,a.data,{},ur).trim()||void 0}catch{return}}const fr="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",pr="text-global-section-fg focus:bg-global-section/12 focus:text-global-section-fg dark:text-global-section-fg-dark dark:focus:bg-global-section/15 dark:focus:text-global-section-fg-dark [&_svg]:!text-global-section";function Gn(m){return Array.from({length:m},(e,a)=>({id:crypto.randomUUID(),index:a}))}function Ns(m){return m.map((e,a)=>({...e,index:a}))}function gr(m,e){if(e===m.length)return m;if(e<m.length)return Ns(m.slice(0,e));const a=Array.from({length:e-m.length},(l,d)=>({id:crypto.randomUUID(),index:m.length+d}));return[...m,...a]}function Vs(m){const e=We.c(25),{section:a,raw:l,meta:d}=m,h=a.isSavedBlock===!0,b=a.isMultivariate===!0;let p;e[0]!==d||e[1]!==l?(p=l&&d?cr(l,d):void 0,e[0]=d,e[1]=l,e[2]=p):p=e[2];const v=p;let f;e[3]!==d||e[4]!==b||e[5]!==l||e[6]!==h?(f=l&&d&&!h&&!b?mr(l,d):void 0,e[3]=d,e[4]=b,e[5]=l,e[6]=h,e[7]=f):f=e[7];const R=f;let V;e[8]===Symbol.for("react.memo_cache_sentinel")?(V=n.jsx(Ca,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[8]=V):V=e[8];let D;e[9]!==v?(D=v&&n.jsx("img",{src:v,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[9]=v,e[10]=D):D=e[10];let j;e[11]!==b||e[12]!==h?(j=h?{color:Wo}:b?{color:"oklch(0.65 0.15 160)"}:void 0,e[11]=b,e[12]=h,e[13]=j):j=e[13];let i;e[14]!==j?(i=n.jsx(vn,{className:"h-4 w-4 shrink-0",style:j}),e[14]=j,e[15]=i):i=e[15];const x=a.isHidden&&"line-through opacity-50";let E;e[16]!==x?(E=ze("min-w-0 flex-1 truncate text-sm font-medium",x),e[16]=x,e[17]=E):E=e[17];const c=R??a.label;let w;e[18]!==E||e[19]!==c?(w=n.jsx("span",{className:E,children:c}),e[18]=E,e[19]=c,e[20]=w):w=e[20];let r;return e[21]!==w||e[22]!==D||e[23]!==i?(r=n.jsxs(n.Fragment,{children:[V,D,i,w]}),e[21]=w,e[22]=D,e[23]=i,e[24]=r):r=e[24],r}const hr="w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]",vr="w-0 -ml-2 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:ml-0 group-hover:w-7 group-hover:opacity-100 group-hover:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms] group-has-[:focus-visible]:ml-0 group-has-[:focus-visible]:w-7 group-has-[:focus-visible]:opacity-100 group-has-[:focus-visible]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]",br="w-7 ml-0 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:opacity-100 group-has-[:focus-visible]:opacity-100";function hn(m,e){return ze("h-7 shrink-0 overflow-hidden",e?hr:m?br:vr)}function Ds(m,e){const a=m.isSavedBlock===!0,l=m.isMultivariate===!0;return ze("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":a?fr:l?us:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function Sr(m){const e=We.c(82),{section:a,raw:l,meta:d,sortableId:h,selected:b,onSelect:p,onDelete:v,onDuplicate:f,onMakeReusable:R,onToggleHidden:V,onToggleLazy:D,onAddVariant:j,onDetach:i}=m,x=ut(),E=l?is(l.__resolveType??""):!1,c=a.isHidden===!0,w=E||c;let r;e[0]!==a?(r=Uo(a),e[0]=a,e[1]=r):r=e[1];const B=r;let I;e[2]!==h?(I={id:h,animateLayoutChanges:Er},e[2]=h,e[3]=I):I=e[3];const{attributes:X,listeners:K,setNodeRef:g,transform:L,isDragging:ke}=ls(I);let C;e[4]!==L?(C=cs.Transform.toString(L?{...L,x:0}:null),e[4]=L,e[5]=C):C=e[5];const te=ke?0:void 0;let P;e[6]!==C||e[7]!==te?(P={transform:C,opacity:te},e[6]=C,e[7]=te,e[8]=P):P=e[8];const ne=P;let O;e[9]!==a?(O=Go(a),e[9]=a,e[10]=O):O=e[10];const Ae=O,xe="button",Te=0;let W;e[11]!==p?(W=k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),p())},e[11]=p,e[12]=W):W=e[12];const de=ke?"cursor-grabbing":"cursor-pointer";let re;e[13]!==a||e[14]!==b||e[15]!==de?(re=ze("touch-none transition-colors",de,Ds(a,b)),e[13]=a,e[14]=b,e[15]=de,e[16]=re):re=e[16];let se;e[17]!==d||e[18]!==l||e[19]!==a?(se=n.jsx(Vs,{section:a,raw:l,meta:d}),e[17]=d,e[18]=l,e[19]=a,e[20]=se):se=e[20];const F=!a.isMultivariate&&n.jsxs(_t,{children:[n.jsx(jt,{asChild:!0,children:n.jsx(Ze,{type:"button",variant:"ghost",size:"icon","aria-label":x(E?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:ze(hn(w,E)),onClick:k=>{k.stopPropagation(),D()},onPointerDown:jr,children:n.jsx(Wa,{className:ze("h-3.5 w-3.5",E&&"text-yellow-500")})})}),n.jsx(Et,{side:"bottom",children:x(E?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),Ye=!a.isMultivariate&&n.jsxs(_t,{children:[n.jsx(jt,{asChild:!0,children:n.jsx(Ze,{type:"button",variant:"ghost",size:"icon","aria-label":x(c?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:ze(hn(w,c)),onClick:k=>{k.stopPropagation(),V()},onPointerDown:_r,children:c?n.jsx(Ga,{className:"h-3.5 w-3.5"}):n.jsx(qa,{className:"h-3.5 w-3.5"})})}),n.jsx(Et,{side:"bottom",children:x(c?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),Ke=ws,Fe=Rs,Be=!0,$=Ze,me="button",Ie="ghost",Me="icon";let ee;e[21]!==x?(ee=x("sectionsEditor.sectionList.sectionActionsMenu"),e[21]=x,e[22]=ee):ee=e[22];const ye=ze(hn(w,!1),"data-[state=open]:ml-0 data-[state=open]:w-7 data-[state=open]:opacity-100 data-[state=open]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]");let ie;e[23]===Symbol.for("react.memo_cache_sentinel")?(ie=n.jsx(Ss,{className:"h-3.5 w-3.5"}),e[23]=ie):ie=e[23];let le;e[24]!==$||e[25]!==ee||e[26]!==ye?(le=n.jsx($,{type:me,variant:Ie,size:Me,"aria-label":ee,className:ye,onClick:yr,onPointerDown:xr,children:ie}),e[24]=$,e[25]=ee,e[26]=ye,e[27]=le):le=e[27];let fe;e[28]!==Fe||e[29]!==le?(fe=n.jsx(Fe,{asChild:Be,children:le}),e[28]=Fe,e[29]=le,e[30]=fe):fe=e[30];let pe;e[31]!==f?(pe=k=>{k.stopPropagation(),f()},e[31]=f,e[32]=pe):pe=e[32];let ge;e[33]===Symbol.for("react.memo_cache_sentinel")?(ge=n.jsx(_s,{className:"h-4 w-4"}),e[33]=ge):ge=e[33];let _e;e[34]!==x?(_e=x("sectionsEditor.sectionList.duplicateMenuItem"),e[34]=x,e[35]=_e):_e=e[35];let je;e[36]!==pe||e[37]!==_e?(je=n.jsxs(bt,{onClick:pe,children:[ge,_e]}),e[36]=pe,e[37]=_e,e[38]=je):je=e[38];let ce;e[39]!==B||e[40]!==j||e[41]!==x?(ce=B&&n.jsxs(bt,{className:qo,onClick:k=>{k.stopPropagation(),j()},children:[n.jsx(js,{className:"h-4 w-4"}),x("sectionsEditor.sectionList.addVariantMenuItem")]}),e[39]=B,e[40]=j,e[41]=x,e[42]=ce):ce=e[42];let z;e[43]!==Ae||e[44]!==R||e[45]!==x?(z=Ae&&n.jsxs(bt,{className:pr,onClick:k=>{k.stopPropagation(),R()},children:[n.jsx(vn,{className:"h-4 w-4"}),x("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[43]=Ae,e[44]=R,e[45]=x,e[46]=z):z=e[46];let Ee;e[47]!==i||e[48]!==a.isMultivariate||e[49]!==a.isSavedBlock||e[50]!==x?(Ee=a.isSavedBlock===!0&&!a.isMultivariate&&n.jsxs(bt,{onClick:k=>{k.stopPropagation(),i()},children:[n.jsx(vn,{className:"h-4 w-4"}),x("sectionsEditor.sectionList.detachMenuItem")]}),e[47]=i,e[48]=a.isMultivariate,e[49]=a.isSavedBlock,e[50]=x,e[51]=Ee):Ee=e[51];let he;e[52]!==v?(he=k=>{k.stopPropagation(),v()},e[52]=v,e[53]=he):he=e[53];let Re;e[54]===Symbol.for("react.memo_cache_sentinel")?(Re=n.jsx(Es,{className:"h-4 w-4"}),e[54]=Re):Re=e[54];let oe;e[55]!==x?(oe=x("sectionsEditor.sectionList.deleteMenuItem"),e[55]=x,e[56]=oe):oe=e[56];let Z;e[57]!==he||e[58]!==oe?(Z=n.jsxs(bt,{className:"text-destructive focus:text-destructive",onClick:he,children:[Re,oe]}),e[57]=he,e[58]=oe,e[59]=Z):Z=e[59];let ue;e[60]!==je||e[61]!==ce||e[62]!==z||e[63]!==Ee||e[64]!==Z?(ue=n.jsxs(ks,{align:"end",className:"w-44",children:[je,ce,z,Ee,Z]}),e[60]=je,e[61]=ce,e[62]=z,e[63]=Ee,e[64]=Z,e[65]=ue):ue=e[65];let ve;e[66]!==Ke||e[67]!==fe||e[68]!==ue?(ve=n.jsxs(Ke,{children:[fe,ue]}),e[66]=Ke,e[67]=fe,e[68]=ue,e[69]=ve):ve=e[69];let Ne;return e[70]!==X||e[71]!==K||e[72]!==p||e[73]!==g||e[74]!==ne||e[75]!==re||e[76]!==se||e[77]!==F||e[78]!==Ye||e[79]!==ve||e[80]!==W?(Ne=n.jsxs("div",{ref:g,style:ne,...X,...K,role:xe,tabIndex:Te,onClick:p,onKeyDown:W,className:re,children:[se,F,Ye,ve]}),e[70]=X,e[71]=K,e[72]=p,e[73]=g,e[74]=ne,e[75]=re,e[76]=se,e[77]=F,e[78]=Ye,e[79]=ve,e[80]=W,e[81]=Ne):Ne=e[81],Ne}function xr(m){return m.stopPropagation()}function yr(m){return m.stopPropagation()}function _r(m){return m.stopPropagation()}function jr(m){return m.stopPropagation()}function Er(){return!1}function Rr(m){const e=We.c(104),{listKey:a,rawSections:l,sections:d,meta:h,selectedIndex:b,onSelect:p,onReorder:v,onDelete:f,onDuplicate:R,onMakeReusable:V,onToggleHidden:D,onToggleLazy:j,onAddVariant:i,onDetach:x,onAddSection:E,canAddSection:c}=m,w=c===void 0?!0:c,r=ut();let B;e[0]!==d.length?(B=()=>Gn(d.length),e[0]=d.length,e[1]=B):B=e[1];const[I,X]=T.useState(B),[K,g]=T.useState(null),[L,ke]=T.useState(a),[C,te]=T.useState(d.length),P=T.useRef(!1);L!==a?(ke(a),te(d.length),X(Gn(d.length))):C!==d.length&&(te(d.length),X(Ne=>gr(Ne,d.length)));let ne;e[2]===Symbol.for("react.memo_cache_sentinel")?(ne={activationConstraint:{distance:8}},e[2]=ne):ne=e[2];let O;e[3]===Symbol.for("react.memo_cache_sentinel")?(O={coordinateGetter:ds},e[3]=O):O=e[3];const Ae=ns(Xt(rs,ne),Xt(as,O));let xe;e[4]!==I?(xe=I.map(wr),e[4]=I,e[5]=xe):xe=e[5];const Te=xe;let W;e[6]===Symbol.for("react.memo_cache_sentinel")?(W=Ne=>{g(String(Ne.active.id))},e[6]=W):W=e[6];const de=W;let re;e[7]!==Te||e[8]!==v?(re=Ne=>{g(null);const{active:k,over:be}=Ne;if(!be||k.id===be.id)return;const ae=Te.indexOf(String(k.id)),Ve=Te.indexOf(String(be.id));ae===-1||Ve===-1||(X(Oe=>Ns(Bt([...Oe],ae,Ve))),P.current=!0,requestAnimationFrame(()=>{P.current=!1}),v?.(ae,Ve))},e[7]=Te,e[8]=v,e[9]=re):re=e[9];const se=re;let F;e[10]===Symbol.for("react.memo_cache_sentinel")?(F=()=>{g(null)},e[10]=F):F=e[10];const Ye=F;let Ke,Fe,Be,$,me,Ie,Me,ee,ye,ie,le,fe,pe,ge,_e;if(e[11]!==K||e[12]!==w||e[13]!==I||e[14]!==Te||e[15]!==se||e[16]!==h||e[17]!==E||e[18]!==i||e[19]!==f||e[20]!==x||e[21]!==R||e[22]!==V||e[23]!==p||e[24]!==D||e[25]!==j||e[26]!==l||e[27]!==d||e[28]!==b||e[29]!==Ae||e[30]!==r){ge=Symbol.for("react.early_return_sentinel");e:{const Ne=k=>{P.current||p(k)};if(e[46]!==K||e[47]!==w||e[48]!==I||e[49]!==E||e[50]!==l||e[51]!==d||e[52]!==r){const k=K?I.find(be=>be.id===K):null;if($=k!=null?d[k.index]:null,Be=k!=null?l[k.index]:void 0,I.length===0){let be;e[56]!==r?(be=r("sectionsEditor.sectionList.noSections"),e[56]=r,e[57]=be):be=e[57];let ae;e[58]!==be?(ae=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:be}),e[58]=be,e[59]=ae):ae=e[59];const Ve=!w;let Oe;e[60]===Symbol.for("react.memo_cache_sentinel")?(Oe=n.jsx(bn,{size:14}),e[60]=Oe):Oe=e[60];let dt;e[61]!==r?(dt=r("sectionsEditor.sectionList.addSectionButton"),e[61]=r,e[62]=dt):dt=e[62];let De;e[63]!==E||e[64]!==Ve||e[65]!==dt?(De=n.jsxs(Ze,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Ve,onClick:E,children:[Oe,dt]}),e[63]=E,e[64]=Ve,e[65]=dt,e[66]=De):De=e[66];let et;e[67]!==ae||e[68]!==De?(et=n.jsxs("div",{className:"space-y-2",children:[ae,De]}),e[67]=ae,e[68]=De,e[69]=et):et=e[69],ge=et;break e}pe=ze(k&&"cursor-grabbing"),e[46]=K,e[47]=w,e[48]=I,e[49]=E,e[50]=l,e[51]=d,e[52]=r,e[53]=Be,e[54]=$,e[55]=pe}else Be=e[53],$=e[54],pe=e[55];Fe=ms,ee=Ae,ye=fs,ie=de,le=se,fe=Ye,Ke=ps,Ie=Te,Me=gs,_e="space-y-1",me=I.map(k=>{const be=d[k.index];return be?n.jsx(Sr,{sortableId:k.id,section:be,raw:l[k.index],meta:h,selected:b===k.index,onSelect:()=>Ne(k.index),onDelete:()=>f(k.index),onDuplicate:()=>R(k.index),onMakeReusable:()=>V(k.index),onToggleHidden:()=>D(k.index),onToggleLazy:()=>j(k.index),onAddVariant:()=>i(k.index),onDetach:()=>x(k.index)},k.id):null})}e[11]=K,e[12]=w,e[13]=I,e[14]=Te,e[15]=se,e[16]=h,e[17]=E,e[18]=i,e[19]=f,e[20]=x,e[21]=R,e[22]=V,e[23]=p,e[24]=D,e[25]=j,e[26]=l,e[27]=d,e[28]=b,e[29]=Ae,e[30]=r,e[31]=Ke,e[32]=Fe,e[33]=Be,e[34]=$,e[35]=me,e[36]=Ie,e[37]=Me,e[38]=ee,e[39]=ye,e[40]=ie,e[41]=le,e[42]=fe,e[43]=pe,e[44]=ge,e[45]=_e}else Ke=e[31],Fe=e[32],Be=e[33],$=e[34],me=e[35],Ie=e[36],Me=e[37],ee=e[38],ye=e[39],ie=e[40],le=e[41],fe=e[42],pe=e[43],ge=e[44],_e=e[45];if(ge!==Symbol.for("react.early_return_sentinel"))return ge;let je;e[70]!==me||e[71]!==_e?(je=n.jsx("div",{className:_e,children:me}),e[70]=me,e[71]=_e,e[72]=je):je=e[72];let ce;e[73]!==Ke||e[74]!==Ie||e[75]!==Me||e[76]!==je?(ce=n.jsx(Ke,{items:Ie,strategy:Me,children:je}),e[73]=Ke,e[74]=Ie,e[75]=Me,e[76]=je,e[77]=ce):ce=e[77];let z;e[78]!==Be||e[79]!==$||e[80]!==h?(z=$?n.jsx("div",{className:ze("cursor-grabbing shadow-lg ring-1 ring-border/60",Ds($,!1)),children:n.jsx(Vs,{section:$,raw:Be,meta:h})}):null,e[78]=Be,e[79]=$,e[80]=h,e[81]=z):z=e[81];let Ee;e[82]!==z?(Ee=Zn.createPortal(n.jsx(ss,{dropAnimation:os,children:z}),document.body),e[82]=z,e[83]=Ee):Ee=e[83];let he;e[84]!==Fe||e[85]!==ee||e[86]!==ye||e[87]!==ie||e[88]!==le||e[89]!==fe||e[90]!==ce||e[91]!==Ee?(he=n.jsxs(Fe,{sensors:ee,collisionDetection:ye,onDragStart:ie,onDragEnd:le,onDragCancel:fe,children:[ce,Ee]}),e[84]=Fe,e[85]=ee,e[86]=ye,e[87]=ie,e[88]=le,e[89]=fe,e[90]=ce,e[91]=Ee,e[92]=he):he=e[92];const Re=!w;let oe;e[93]===Symbol.for("react.memo_cache_sentinel")?(oe=n.jsx(bn,{size:14}),e[93]=oe):oe=e[93];let Z;e[94]!==r?(Z=r("sectionsEditor.sectionList.addSectionButton"),e[94]=r,e[95]=Z):Z=e[95];let ue;e[96]!==E||e[97]!==Re||e[98]!==Z?(ue=n.jsxs(Ze,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:Re,onClick:E,children:[oe,Z]}),e[96]=E,e[97]=Re,e[98]=Z,e[99]=ue):ue=e[99];let ve;return e[100]!==pe||e[101]!==he||e[102]!==ue?(ve=n.jsxs("div",{className:pe,children:[he,ue]}),e[100]=pe,e[101]=he,e[102]=ue,e[103]=ve):ve=e[103],ve}function wr(m){return m.id}function qn(m){const e=We.c(57),{open:a,initialName:l,autoLabel:d,isPending:h,onSubmit:b,onOpenChange:p}=m,v=h===void 0?!1:h,f=ut(),[R,V]=T.useState(l),[D,j]=T.useState(a);a!==D&&(j(a),a&&V(l));let i;e[0]!==v||e[1]!==p?(i=de=>{!de&&!v&&p(!1)},e[0]=v,e[1]=p,e[2]=i):i=e[2];const x=i;let E;e[3]!==v||e[4]!==R||e[5]!==b?(E=async de=>{de.preventDefault(),!v&&await b(R.trim())},e[3]=v,e[4]=R,e[5]=b,e[6]=E):E=e[6];const c=E;let w;e[7]!==f?(w=f("sectionsEditor.variantRenameDialog.title"),e[7]=f,e[8]=w):w=e[8];let r;e[9]!==w?(r=n.jsx(Fa,{children:w}),e[9]=w,e[10]=r):r=e[10];let B;e[11]!==d||e[12]!==f?(B=f("sectionsEditor.variantRenameDialog.description",{fallback:d||f("sectionsEditor.variantRenameDialog.defaultFallback")}),e[11]=d,e[12]=f,e[13]=B):B=e[13];let I;e[14]!==B?(I=n.jsx(Ia,{children:B}),e[14]=B,e[15]=I):I=e[15];let X;e[16]!==r||e[17]!==I?(X=n.jsxs(Oa,{children:[r,I]}),e[16]=r,e[17]=I,e[18]=X):X=e[18];let K;e[19]!==f?(K=f("sectionsEditor.variantRenameDialog.nameLabel"),e[19]=f,e[20]=K):K=e[20];let g;e[21]!==K?(g=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:K}),e[21]=K,e[22]=g):g=e[22];let L;e[23]===Symbol.for("react.memo_cache_sentinel")?(L=de=>V(de.target.value),e[23]=L):L=e[23];let ke;e[24]!==d||e[25]!==v||e[26]!==R?(ke=n.jsx(Ua,{id:"variant-rename-name",value:R,onChange:L,placeholder:d,autoFocus:!0,disabled:v}),e[24]=d,e[25]=v,e[26]=R,e[27]=ke):ke=e[27];let C;e[28]!==g||e[29]!==ke?(C=n.jsxs("div",{className:"space-y-1.5 py-4",children:[g,ke]}),e[28]=g,e[29]=ke,e[30]=C):C=e[30];let te;e[31]!==p?(te=()=>p(!1),e[31]=p,e[32]=te):te=e[32];let P;e[33]!==f?(P=f("sectionsEditor.variantRenameDialog.cancel"),e[33]=f,e[34]=P):P=e[34];let ne;e[35]!==v||e[36]!==te||e[37]!==P?(ne=n.jsx(Ze,{type:"button",variant:"outline",onClick:te,disabled:v,children:P}),e[35]=v,e[36]=te,e[37]=P,e[38]=ne):ne=e[38];let O;e[39]!==v||e[40]!==f?(O=v?n.jsxs(n.Fragment,{children:[n.jsx(es,{size:14,className:"animate-spin"}),f("sectionsEditor.variantRenameDialog.saving")]}):f("sectionsEditor.variantRenameDialog.save"),e[39]=v,e[40]=f,e[41]=O):O=e[41];let Ae;e[42]!==v||e[43]!==O?(Ae=n.jsx(Ze,{type:"submit",disabled:v,children:O}),e[42]=v,e[43]=O,e[44]=Ae):Ae=e[44];let xe;e[45]!==ne||e[46]!==Ae?(xe=n.jsxs($a,{children:[ne,Ae]}),e[45]=ne,e[46]=Ae,e[47]=xe):xe=e[47];let Te;e[48]!==c||e[49]!==C||e[50]!==xe||e[51]!==X?(Te=n.jsx(za,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:c,children:[X,C,xe]})}),e[48]=c,e[49]=C,e[50]=xe,e[51]=X,e[52]=Te):Te=e[52];let W;return e[53]!==x||e[54]!==a||e[55]!==Te?(W=n.jsx(Ha,{open:a,onOpenChange:x,children:Te}),e[53]=x,e[54]=a,e[55]=Te,e[56]=W):W=e[56],W}function Ps(m){const e=We.c(5),{rule:a,matchers:l}=m,d=a?.__resolveType??"";let h;if(e[0]!==l||e[1]!==d){const f=l.find(R=>R.resolveType===d)?.iconName??Jo(d);h=Aa(f),e[0]=l,e[1]=d,e[2]=h}else h=e[2];const b=h;if(!b)return null;let p;return e[3]!==b?(p=n.jsx(b,{size:14,className:"shrink-0"}),e[3]=b,e[4]=p):p=e[4],p}function Wn(m){return m.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
1
+ import{c as We,b as ut,r as T,n as ze,j as n,aC as Zn,ab as _t,a8 as jt,B as Ze,a9 as Et,k as es,p as Ko,t as Y,K as Fo}from"./index-DO5YRMF2.js";import{b as Io}from"./chat-context-C0CACiFo.js";import{aw as ts,ax as Oo,ay as $o,az as zo,aA as Ho,ab as ns,ac as Xt,aB as ss,aC as os,ad as as,ae as rs,aD as is,aE as Uo,al as ls,am as cs,aF as Go,aG as qo,aH as us,P as Wo,af as ds,ag as Bt,aj as ms,ak as fs,ah as ps,ar as gs,aI as Jo,aJ as Lt,aK as hs,aL as Yo,S as vs,aM as ct,H as bs,aN as Qo,aO as Xo,aP as Zo,aQ as ea,F as ta,G as na,aR as sa,aS as oa,aT as aa,aU as ra,ap as qt,aV as Wt,aW as ia,aX as xt,aY as Ct,aZ as la,a_ as ca,a$ as st,b0 as Kn,b1 as ua,b2 as At,b3 as Jt,b4 as da,b5 as fn,b6 as ma,b7 as Tt,b8 as fa,b9 as pa,ba as ga,bb as ha,bc as va,bd as yt,be as ba,bf as Sa,bg as xa,J as ya,bh as Fn,bi as Mt,bj as In,bk as On,bl as _a,bm as ja,bn as Ea,bo as Ra,bp as pn,bq as $n,br as zn,bs as Nt,bt as Yt,bu as Hn,bv as wa,bw as gn,bx as ka,by as Ta,bz as Na,bA as Va,bB as Da}from"./index-DJF4EiWQ.js";import{t as Pa}from"./ChevronDown-3Y-CRZZD.js";import{ah as vn,x as Ca,V as Ss,G as Aa,w as xs,ao as Ma,r as Ba}from"./agent-icon-Cbo0rbd8.js";import{i as ys}from"./ChevronRight-Buq1yopX.js";import{n as La}from"./ChevronUp-BQkKayQd.js";import{i as Ka}from"./Globe01-BPd1JQ7C.js";import{B as Qt}from"./automation-runs-CqHC9Z0L.js";import{b as Fa,h as Ia,a as Oa,c as $a,d as za,e as Ha}from"./dialog-DQcS-86l.js";import{I as Ua}from"./input-C_KfEpTM.js";import{a as _s}from"./Copy01-a2WKVjcK.js";import{i as Ga}from"./Settings02-CJtdruE3.js";import{s as qa}from"./Eye-BYmVnsHQ.js";import{s as js}from"./TrendUp01-lB5R-q63.js";import{s as bn}from"./Plus-BhxWvTlN.js";import{s as Es}from"./Trash01-DLeW8BuY.js";import{i as Wa}from"./Zap-DPVLyPv1.js";import{D as Rs,a as bt,c as ws,b as ks,i as Ja}from"./dropdown-menu-DR5TrQ6y.js";import{S as Ya,r as Un,u as Qa,d as Xa,a as Za,i as er,f as tr,P as nr,b as sr}from"./page-seo-form-CzKOGYav.js";import{b as or}from"./Tool01-BdWMT188.js";import{u as ar,A as rr}from"./use-section-preview-base-dK2VZoN_.js";import"./tab-id-gkLZKZzs.js";import"./Check-DsSX1qno.js";import"./Download01-C28Kvbnr.js";import"./session-runtime-wVXsCwcJ.js";import"./hooks-BeMpgdL5.js";import"./use-mcp-client-Zc_yhkHz.js";import"./constants-_08zpzmT.js";import"./auth-DXCk1XS_.js";import"./decopilot-sse-pool-CRzlvmLY.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-BKSYfHzd.js";import"./use-ai-providers-Bivp-YWu.js";import"./use-decopilot-events-qr59AKHV.js";import"./use-organization-settings-BV_7awEF.js";import"./ArrowUp-B9rSngVL.js";import"./spinner-DDmc-ww2.js";import"./drawer-BxoRaw4y.js";import"./collection-search-BB-cJIKU.js";import"./SearchMd-6mUsS-Y7.js";import"./chart-wX_z8gBg.js";import"./index-Chy1AEww.js";import"./shell-layout-C9mXTtwc.js";import"./avatar-C3PwcJq8.js";import"./User01-BmlhCgSw.js";import"./Users03-DGaF7kMn.js";import"./SearchLg-2wWsr3ld.js";import"./Stars02-CWlpBG0m.js";import"./XClose-COWGVm3N.js";import"./CheckCircle-BAVtjq6J.js";import"./FilterLines-DOdrxs6h.js";import"./Monitor01-59Ug2myj.js";import"./required-auth-layout-ClLEHZpP.js";import"./use-org-sso-CZmxM-OR.js";import"./XCircle-Roe883NX.js";import"./Upload01-BRX3Gg8H.js";import"./AlertCircle-BKG7D-9N.js";import"./form-Bz4b6vZ-.js";import"./label-hY48vMGc.js";import"./select-BbTCc1n4.js";import"./UserSquare-CYd2ERl7.js";import"./ArrowLeft-yXWZTd3K.js";import"./tabs-J0KT6kYH.js";import"./Tool02-oxWxO97N.js";import"./toggle-group-CHSAg2sv.js";import"./use-commerce-diagnostic-BlF1KvQS.js";import"./popover-g2pYQ4-p.js";import"./self-tool-result-sXGc5k6O.js";import"./alert-dialog-BRQzSE_N.js";import"./integration-icon-BvbufOa2.js";import"./extract-connection-data-BpUCAP1Q.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-CMPWtdMv.js";import"./use-debounced-value-u04RrNmJ.js";import"./LinkExternal01-xgcQx4Ym.js";import"./authenticate-and-persist-oauth-Coc-ZKme.js";import"./mcp-oauth-BkOQlmKJ.js";import"./track-Bn-O-__7.js";import"./toolbar-B2KgVV2_.js";import"./github-repo-picker-BOP91Taj.js";import"./use-connection-CWTVS30P.js";import"./LockUnlocked01-BLD2I2IR.js";import"./use-mcp-tools-DWnWlwYx.js";import"./use-navigate-to-agent-B2o_Px-4.js";import"./reusable-new-chat-CzvRy4Pe.js";import"./agent-capabilities-C4tLW0Za.js";import"./connection-card-BFdaG5Pg.js";import"./use-registry-connections-Cdo42PB7.js";import"./useInfiniteQuery-VwVbIitv.js";import"./use-infinite-scroll-B1K93eo8.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-DHbS1l8X.js";import"./connection-form-helpers-CfykKxIx.js";import"./collection-tabs-CSymOanp.js";import"./badge-CH9Icr1q.js";import"./useSuspenseInfiniteQuery-DufDrP8n.js";import"./command-DeEGxZTh.js";import"./index-BMt9rXRF.js";import"./use-clock-tick-B4Vh8Egr.js";import"./DotsVertical-DTerhIVm.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./select-model-4byESaTm.js";import"./checkbox-BM-8xu4l.js";import"./ChevronSelectorVertical-DOBGpkVA.js";import"./Key01-BYJxbFiz.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Stars01-Bv4MJS3u.js";import"./cards-CGfBM5Lb.js";import"./Share07-Bp2bqpBF.js";import"./Palette-B0b0yZyd.js";import"./file-type-icon-CxSX_liB.js";import"./question-004-sINsf4GQ.js";import"./use-members-BXk31-rN.js";import"./use-org-auth-client-x9nq6dCg.js";import"./use-status-sounds-BPSuggr1.js";import"./empty-state-sTCJA8AO.js";import"./ZapSquare-C0H24eK5.js";import"./types-CHZQlcZP.js";import"./use-file-configs-C6xtQYYR.js";import"./monaco-editor-DgpgN6WP.js";import"./pt-BR-CLy76QW2.js";import"./switch-5ZIKkj65.js";import"./Play-CBvnCo9D.js";import"./use-debounced-autosave-DdQp0gZ8.js";import"./search-input-jHNXVj3b.js";import"./index-ChqKDZgx.js";import"./Users01-C2tns4VW.js";import"./use-secrets-C67DutYx.js";import"./AreaChart-JbCf9yx5.js";import"./task-key-xPT-lgkK.js";import"./sprints-BARFiKGG.js";import"./use-copy-BhRV_-1G.js";import"./SwitchHorizontal01-1VwkcOEn.js";import"./use-tags-CqThj_Ac.js";import"./get-initials-D-f_fDFw.js";import"./use-automations-D3Y02Hz6.js";import"./automation-list-row-aK8-F5Tj.js";import"./site-error--i37Vnuw.js";import"./use-org-repo-syncs-BBhDoHSr.js";import"./CreditCard01-DdGNjzTK.js";import"./Globe04-C4cNBevR.js";import"./HardDrive-BDZO-aak.js";import"./LogOut01-BvzIKGJZ.js";import"./Sun-DW01oEoe.js";import"./Shield01-Bt1AMT_-.js";import"./table-BCmw_-1c.js";function ir(m){return m.schema?.definitions??m.schema?.$defs??{}}function Ts(m,e){const a=ir(e),l=a[btoa(m)];if(!l)return[];const d=[l];if(Array.isArray(l.allOf)){const h=l.allOf.find(b=>typeof b.$ref=="string")?.$ref;if(typeof h=="string"){const b=a[h.replace("#/definitions/","")];b&&d.push(b)}}return d}function lr(m,e){for(const a of Ts(m,e)){const l=typeof a.image=="string"?a.image:void 0;if(l?.includes("{{{"))return l}}function cr(m,e){if(!e)return;const a=ts(m);if(!a)return;const l=lr(a.resolveType,e);if(!l)return;const d=Oo(l,a.data);if(d)return $o(d)}const ur={escape:Ho};function dr(m,e){for(const a of Ts(m,e)){const l=typeof a.title=="string"?a.title:void 0;if(l?.includes("{{"))return l}}function mr(m,e){if(!e)return;const a=ts(m);if(a)try{const l=dr(a.resolveType,e);return l&&zo.render(l,a.data,{},ur).trim()||void 0}catch{return}}const fr="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",pr="text-global-section-fg focus:bg-global-section/12 focus:text-global-section-fg dark:text-global-section-fg-dark dark:focus:bg-global-section/15 dark:focus:text-global-section-fg-dark [&_svg]:!text-global-section";function Gn(m){return Array.from({length:m},(e,a)=>({id:crypto.randomUUID(),index:a}))}function Ns(m){return m.map((e,a)=>({...e,index:a}))}function gr(m,e){if(e===m.length)return m;if(e<m.length)return Ns(m.slice(0,e));const a=Array.from({length:e-m.length},(l,d)=>({id:crypto.randomUUID(),index:m.length+d}));return[...m,...a]}function Vs(m){const e=We.c(25),{section:a,raw:l,meta:d}=m,h=a.isSavedBlock===!0,b=a.isMultivariate===!0;let p;e[0]!==d||e[1]!==l?(p=l&&d?cr(l,d):void 0,e[0]=d,e[1]=l,e[2]=p):p=e[2];const v=p;let f;e[3]!==d||e[4]!==b||e[5]!==l||e[6]!==h?(f=l&&d&&!h&&!b?mr(l,d):void 0,e[3]=d,e[4]=b,e[5]=l,e[6]=h,e[7]=f):f=e[7];const R=f;let V;e[8]===Symbol.for("react.memo_cache_sentinel")?(V=n.jsx(Ca,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[8]=V):V=e[8];let D;e[9]!==v?(D=v&&n.jsx("img",{src:v,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[9]=v,e[10]=D):D=e[10];let j;e[11]!==b||e[12]!==h?(j=h?{color:Wo}:b?{color:"oklch(0.65 0.15 160)"}:void 0,e[11]=b,e[12]=h,e[13]=j):j=e[13];let i;e[14]!==j?(i=n.jsx(vn,{className:"h-4 w-4 shrink-0",style:j}),e[14]=j,e[15]=i):i=e[15];const x=a.isHidden&&"line-through opacity-50";let E;e[16]!==x?(E=ze("min-w-0 flex-1 truncate text-sm font-medium",x),e[16]=x,e[17]=E):E=e[17];const c=R??a.label;let w;e[18]!==E||e[19]!==c?(w=n.jsx("span",{className:E,children:c}),e[18]=E,e[19]=c,e[20]=w):w=e[20];let r;return e[21]!==w||e[22]!==D||e[23]!==i?(r=n.jsxs(n.Fragment,{children:[V,D,i,w]}),e[21]=w,e[22]=D,e[23]=i,e[24]=r):r=e[24],r}const hr="w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]",vr="w-0 -ml-2 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:ml-0 group-hover:w-7 group-hover:opacity-100 group-hover:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms] group-has-[:focus-visible]:ml-0 group-has-[:focus-visible]:w-7 group-has-[:focus-visible]:opacity-100 group-has-[:focus-visible]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]",br="w-7 ml-0 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:opacity-100 group-has-[:focus-visible]:opacity-100";function hn(m,e){return ze("h-7 shrink-0 overflow-hidden",e?hr:m?br:vr)}function Ds(m,e){const a=m.isSavedBlock===!0,l=m.isMultivariate===!0;return ze("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":a?fr:l?us:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function Sr(m){const e=We.c(82),{section:a,raw:l,meta:d,sortableId:h,selected:b,onSelect:p,onDelete:v,onDuplicate:f,onMakeReusable:R,onToggleHidden:V,onToggleLazy:D,onAddVariant:j,onDetach:i}=m,x=ut(),E=l?is(l.__resolveType??""):!1,c=a.isHidden===!0,w=E||c;let r;e[0]!==a?(r=Uo(a),e[0]=a,e[1]=r):r=e[1];const B=r;let I;e[2]!==h?(I={id:h,animateLayoutChanges:Er},e[2]=h,e[3]=I):I=e[3];const{attributes:X,listeners:K,setNodeRef:g,transform:L,isDragging:ke}=ls(I);let C;e[4]!==L?(C=cs.Transform.toString(L?{...L,x:0}:null),e[4]=L,e[5]=C):C=e[5];const te=ke?0:void 0;let P;e[6]!==C||e[7]!==te?(P={transform:C,opacity:te},e[6]=C,e[7]=te,e[8]=P):P=e[8];const ne=P;let O;e[9]!==a?(O=Go(a),e[9]=a,e[10]=O):O=e[10];const Ae=O,xe="button",Te=0;let W;e[11]!==p?(W=k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),p())},e[11]=p,e[12]=W):W=e[12];const de=ke?"cursor-grabbing":"cursor-pointer";let re;e[13]!==a||e[14]!==b||e[15]!==de?(re=ze("touch-none transition-colors",de,Ds(a,b)),e[13]=a,e[14]=b,e[15]=de,e[16]=re):re=e[16];let se;e[17]!==d||e[18]!==l||e[19]!==a?(se=n.jsx(Vs,{section:a,raw:l,meta:d}),e[17]=d,e[18]=l,e[19]=a,e[20]=se):se=e[20];const F=!a.isMultivariate&&n.jsxs(_t,{children:[n.jsx(jt,{asChild:!0,children:n.jsx(Ze,{type:"button",variant:"ghost",size:"icon","aria-label":x(E?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:ze(hn(w,E)),onClick:k=>{k.stopPropagation(),D()},onPointerDown:jr,children:n.jsx(Wa,{className:ze("h-3.5 w-3.5",E&&"text-yellow-500")})})}),n.jsx(Et,{side:"bottom",children:x(E?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),Ye=!a.isMultivariate&&n.jsxs(_t,{children:[n.jsx(jt,{asChild:!0,children:n.jsx(Ze,{type:"button",variant:"ghost",size:"icon","aria-label":x(c?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:ze(hn(w,c)),onClick:k=>{k.stopPropagation(),V()},onPointerDown:_r,children:c?n.jsx(Ga,{className:"h-3.5 w-3.5"}):n.jsx(qa,{className:"h-3.5 w-3.5"})})}),n.jsx(Et,{side:"bottom",children:x(c?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),Ke=ws,Fe=Rs,Be=!0,$=Ze,me="button",Ie="ghost",Me="icon";let ee;e[21]!==x?(ee=x("sectionsEditor.sectionList.sectionActionsMenu"),e[21]=x,e[22]=ee):ee=e[22];const ye=ze(hn(w,!1),"data-[state=open]:ml-0 data-[state=open]:w-7 data-[state=open]:opacity-100 data-[state=open]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]");let ie;e[23]===Symbol.for("react.memo_cache_sentinel")?(ie=n.jsx(Ss,{className:"h-3.5 w-3.5"}),e[23]=ie):ie=e[23];let le;e[24]!==$||e[25]!==ee||e[26]!==ye?(le=n.jsx($,{type:me,variant:Ie,size:Me,"aria-label":ee,className:ye,onClick:yr,onPointerDown:xr,children:ie}),e[24]=$,e[25]=ee,e[26]=ye,e[27]=le):le=e[27];let fe;e[28]!==Fe||e[29]!==le?(fe=n.jsx(Fe,{asChild:Be,children:le}),e[28]=Fe,e[29]=le,e[30]=fe):fe=e[30];let pe;e[31]!==f?(pe=k=>{k.stopPropagation(),f()},e[31]=f,e[32]=pe):pe=e[32];let ge;e[33]===Symbol.for("react.memo_cache_sentinel")?(ge=n.jsx(_s,{className:"h-4 w-4"}),e[33]=ge):ge=e[33];let _e;e[34]!==x?(_e=x("sectionsEditor.sectionList.duplicateMenuItem"),e[34]=x,e[35]=_e):_e=e[35];let je;e[36]!==pe||e[37]!==_e?(je=n.jsxs(bt,{onClick:pe,children:[ge,_e]}),e[36]=pe,e[37]=_e,e[38]=je):je=e[38];let ce;e[39]!==B||e[40]!==j||e[41]!==x?(ce=B&&n.jsxs(bt,{className:qo,onClick:k=>{k.stopPropagation(),j()},children:[n.jsx(js,{className:"h-4 w-4"}),x("sectionsEditor.sectionList.addVariantMenuItem")]}),e[39]=B,e[40]=j,e[41]=x,e[42]=ce):ce=e[42];let z;e[43]!==Ae||e[44]!==R||e[45]!==x?(z=Ae&&n.jsxs(bt,{className:pr,onClick:k=>{k.stopPropagation(),R()},children:[n.jsx(vn,{className:"h-4 w-4"}),x("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[43]=Ae,e[44]=R,e[45]=x,e[46]=z):z=e[46];let Ee;e[47]!==i||e[48]!==a.isMultivariate||e[49]!==a.isSavedBlock||e[50]!==x?(Ee=a.isSavedBlock===!0&&!a.isMultivariate&&n.jsxs(bt,{onClick:k=>{k.stopPropagation(),i()},children:[n.jsx(vn,{className:"h-4 w-4"}),x("sectionsEditor.sectionList.detachMenuItem")]}),e[47]=i,e[48]=a.isMultivariate,e[49]=a.isSavedBlock,e[50]=x,e[51]=Ee):Ee=e[51];let he;e[52]!==v?(he=k=>{k.stopPropagation(),v()},e[52]=v,e[53]=he):he=e[53];let Re;e[54]===Symbol.for("react.memo_cache_sentinel")?(Re=n.jsx(Es,{className:"h-4 w-4"}),e[54]=Re):Re=e[54];let oe;e[55]!==x?(oe=x("sectionsEditor.sectionList.deleteMenuItem"),e[55]=x,e[56]=oe):oe=e[56];let Z;e[57]!==he||e[58]!==oe?(Z=n.jsxs(bt,{className:"text-destructive focus:text-destructive",onClick:he,children:[Re,oe]}),e[57]=he,e[58]=oe,e[59]=Z):Z=e[59];let ue;e[60]!==je||e[61]!==ce||e[62]!==z||e[63]!==Ee||e[64]!==Z?(ue=n.jsxs(ks,{align:"end",className:"w-44",children:[je,ce,z,Ee,Z]}),e[60]=je,e[61]=ce,e[62]=z,e[63]=Ee,e[64]=Z,e[65]=ue):ue=e[65];let ve;e[66]!==Ke||e[67]!==fe||e[68]!==ue?(ve=n.jsxs(Ke,{children:[fe,ue]}),e[66]=Ke,e[67]=fe,e[68]=ue,e[69]=ve):ve=e[69];let Ne;return e[70]!==X||e[71]!==K||e[72]!==p||e[73]!==g||e[74]!==ne||e[75]!==re||e[76]!==se||e[77]!==F||e[78]!==Ye||e[79]!==ve||e[80]!==W?(Ne=n.jsxs("div",{ref:g,style:ne,...X,...K,role:xe,tabIndex:Te,onClick:p,onKeyDown:W,className:re,children:[se,F,Ye,ve]}),e[70]=X,e[71]=K,e[72]=p,e[73]=g,e[74]=ne,e[75]=re,e[76]=se,e[77]=F,e[78]=Ye,e[79]=ve,e[80]=W,e[81]=Ne):Ne=e[81],Ne}function xr(m){return m.stopPropagation()}function yr(m){return m.stopPropagation()}function _r(m){return m.stopPropagation()}function jr(m){return m.stopPropagation()}function Er(){return!1}function Rr(m){const e=We.c(104),{listKey:a,rawSections:l,sections:d,meta:h,selectedIndex:b,onSelect:p,onReorder:v,onDelete:f,onDuplicate:R,onMakeReusable:V,onToggleHidden:D,onToggleLazy:j,onAddVariant:i,onDetach:x,onAddSection:E,canAddSection:c}=m,w=c===void 0?!0:c,r=ut();let B;e[0]!==d.length?(B=()=>Gn(d.length),e[0]=d.length,e[1]=B):B=e[1];const[I,X]=T.useState(B),[K,g]=T.useState(null),[L,ke]=T.useState(a),[C,te]=T.useState(d.length),P=T.useRef(!1);L!==a?(ke(a),te(d.length),X(Gn(d.length))):C!==d.length&&(te(d.length),X(Ne=>gr(Ne,d.length)));let ne;e[2]===Symbol.for("react.memo_cache_sentinel")?(ne={activationConstraint:{distance:8}},e[2]=ne):ne=e[2];let O;e[3]===Symbol.for("react.memo_cache_sentinel")?(O={coordinateGetter:ds},e[3]=O):O=e[3];const Ae=ns(Xt(rs,ne),Xt(as,O));let xe;e[4]!==I?(xe=I.map(wr),e[4]=I,e[5]=xe):xe=e[5];const Te=xe;let W;e[6]===Symbol.for("react.memo_cache_sentinel")?(W=Ne=>{g(String(Ne.active.id))},e[6]=W):W=e[6];const de=W;let re;e[7]!==Te||e[8]!==v?(re=Ne=>{g(null);const{active:k,over:be}=Ne;if(!be||k.id===be.id)return;const ae=Te.indexOf(String(k.id)),Ve=Te.indexOf(String(be.id));ae===-1||Ve===-1||(X(Oe=>Ns(Bt([...Oe],ae,Ve))),P.current=!0,requestAnimationFrame(()=>{P.current=!1}),v?.(ae,Ve))},e[7]=Te,e[8]=v,e[9]=re):re=e[9];const se=re;let F;e[10]===Symbol.for("react.memo_cache_sentinel")?(F=()=>{g(null)},e[10]=F):F=e[10];const Ye=F;let Ke,Fe,Be,$,me,Ie,Me,ee,ye,ie,le,fe,pe,ge,_e;if(e[11]!==K||e[12]!==w||e[13]!==I||e[14]!==Te||e[15]!==se||e[16]!==h||e[17]!==E||e[18]!==i||e[19]!==f||e[20]!==x||e[21]!==R||e[22]!==V||e[23]!==p||e[24]!==D||e[25]!==j||e[26]!==l||e[27]!==d||e[28]!==b||e[29]!==Ae||e[30]!==r){ge=Symbol.for("react.early_return_sentinel");e:{const Ne=k=>{P.current||p(k)};if(e[46]!==K||e[47]!==w||e[48]!==I||e[49]!==E||e[50]!==l||e[51]!==d||e[52]!==r){const k=K?I.find(be=>be.id===K):null;if($=k!=null?d[k.index]:null,Be=k!=null?l[k.index]:void 0,I.length===0){let be;e[56]!==r?(be=r("sectionsEditor.sectionList.noSections"),e[56]=r,e[57]=be):be=e[57];let ae;e[58]!==be?(ae=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:be}),e[58]=be,e[59]=ae):ae=e[59];const Ve=!w;let Oe;e[60]===Symbol.for("react.memo_cache_sentinel")?(Oe=n.jsx(bn,{size:14}),e[60]=Oe):Oe=e[60];let dt;e[61]!==r?(dt=r("sectionsEditor.sectionList.addSectionButton"),e[61]=r,e[62]=dt):dt=e[62];let De;e[63]!==E||e[64]!==Ve||e[65]!==dt?(De=n.jsxs(Ze,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Ve,onClick:E,children:[Oe,dt]}),e[63]=E,e[64]=Ve,e[65]=dt,e[66]=De):De=e[66];let et;e[67]!==ae||e[68]!==De?(et=n.jsxs("div",{className:"space-y-2",children:[ae,De]}),e[67]=ae,e[68]=De,e[69]=et):et=e[69],ge=et;break e}pe=ze(k&&"cursor-grabbing"),e[46]=K,e[47]=w,e[48]=I,e[49]=E,e[50]=l,e[51]=d,e[52]=r,e[53]=Be,e[54]=$,e[55]=pe}else Be=e[53],$=e[54],pe=e[55];Fe=ms,ee=Ae,ye=fs,ie=de,le=se,fe=Ye,Ke=ps,Ie=Te,Me=gs,_e="space-y-1",me=I.map(k=>{const be=d[k.index];return be?n.jsx(Sr,{sortableId:k.id,section:be,raw:l[k.index],meta:h,selected:b===k.index,onSelect:()=>Ne(k.index),onDelete:()=>f(k.index),onDuplicate:()=>R(k.index),onMakeReusable:()=>V(k.index),onToggleHidden:()=>D(k.index),onToggleLazy:()=>j(k.index),onAddVariant:()=>i(k.index),onDetach:()=>x(k.index)},k.id):null})}e[11]=K,e[12]=w,e[13]=I,e[14]=Te,e[15]=se,e[16]=h,e[17]=E,e[18]=i,e[19]=f,e[20]=x,e[21]=R,e[22]=V,e[23]=p,e[24]=D,e[25]=j,e[26]=l,e[27]=d,e[28]=b,e[29]=Ae,e[30]=r,e[31]=Ke,e[32]=Fe,e[33]=Be,e[34]=$,e[35]=me,e[36]=Ie,e[37]=Me,e[38]=ee,e[39]=ye,e[40]=ie,e[41]=le,e[42]=fe,e[43]=pe,e[44]=ge,e[45]=_e}else Ke=e[31],Fe=e[32],Be=e[33],$=e[34],me=e[35],Ie=e[36],Me=e[37],ee=e[38],ye=e[39],ie=e[40],le=e[41],fe=e[42],pe=e[43],ge=e[44],_e=e[45];if(ge!==Symbol.for("react.early_return_sentinel"))return ge;let je;e[70]!==me||e[71]!==_e?(je=n.jsx("div",{className:_e,children:me}),e[70]=me,e[71]=_e,e[72]=je):je=e[72];let ce;e[73]!==Ke||e[74]!==Ie||e[75]!==Me||e[76]!==je?(ce=n.jsx(Ke,{items:Ie,strategy:Me,children:je}),e[73]=Ke,e[74]=Ie,e[75]=Me,e[76]=je,e[77]=ce):ce=e[77];let z;e[78]!==Be||e[79]!==$||e[80]!==h?(z=$?n.jsx("div",{className:ze("cursor-grabbing shadow-lg ring-1 ring-border/60",Ds($,!1)),children:n.jsx(Vs,{section:$,raw:Be,meta:h})}):null,e[78]=Be,e[79]=$,e[80]=h,e[81]=z):z=e[81];let Ee;e[82]!==z?(Ee=Zn.createPortal(n.jsx(ss,{dropAnimation:os,children:z}),document.body),e[82]=z,e[83]=Ee):Ee=e[83];let he;e[84]!==Fe||e[85]!==ee||e[86]!==ye||e[87]!==ie||e[88]!==le||e[89]!==fe||e[90]!==ce||e[91]!==Ee?(he=n.jsxs(Fe,{sensors:ee,collisionDetection:ye,onDragStart:ie,onDragEnd:le,onDragCancel:fe,children:[ce,Ee]}),e[84]=Fe,e[85]=ee,e[86]=ye,e[87]=ie,e[88]=le,e[89]=fe,e[90]=ce,e[91]=Ee,e[92]=he):he=e[92];const Re=!w;let oe;e[93]===Symbol.for("react.memo_cache_sentinel")?(oe=n.jsx(bn,{size:14}),e[93]=oe):oe=e[93];let Z;e[94]!==r?(Z=r("sectionsEditor.sectionList.addSectionButton"),e[94]=r,e[95]=Z):Z=e[95];let ue;e[96]!==E||e[97]!==Re||e[98]!==Z?(ue=n.jsxs(Ze,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:Re,onClick:E,children:[oe,Z]}),e[96]=E,e[97]=Re,e[98]=Z,e[99]=ue):ue=e[99];let ve;return e[100]!==pe||e[101]!==he||e[102]!==ue?(ve=n.jsxs("div",{className:pe,children:[he,ue]}),e[100]=pe,e[101]=he,e[102]=ue,e[103]=ve):ve=e[103],ve}function wr(m){return m.id}function qn(m){const e=We.c(57),{open:a,initialName:l,autoLabel:d,isPending:h,onSubmit:b,onOpenChange:p}=m,v=h===void 0?!1:h,f=ut(),[R,V]=T.useState(l),[D,j]=T.useState(a);a!==D&&(j(a),a&&V(l));let i;e[0]!==v||e[1]!==p?(i=de=>{!de&&!v&&p(!1)},e[0]=v,e[1]=p,e[2]=i):i=e[2];const x=i;let E;e[3]!==v||e[4]!==R||e[5]!==b?(E=async de=>{de.preventDefault(),!v&&await b(R.trim())},e[3]=v,e[4]=R,e[5]=b,e[6]=E):E=e[6];const c=E;let w;e[7]!==f?(w=f("sectionsEditor.variantRenameDialog.title"),e[7]=f,e[8]=w):w=e[8];let r;e[9]!==w?(r=n.jsx(Fa,{children:w}),e[9]=w,e[10]=r):r=e[10];let B;e[11]!==d||e[12]!==f?(B=f("sectionsEditor.variantRenameDialog.description",{fallback:d||f("sectionsEditor.variantRenameDialog.defaultFallback")}),e[11]=d,e[12]=f,e[13]=B):B=e[13];let I;e[14]!==B?(I=n.jsx(Ia,{children:B}),e[14]=B,e[15]=I):I=e[15];let X;e[16]!==r||e[17]!==I?(X=n.jsxs(Oa,{children:[r,I]}),e[16]=r,e[17]=I,e[18]=X):X=e[18];let K;e[19]!==f?(K=f("sectionsEditor.variantRenameDialog.nameLabel"),e[19]=f,e[20]=K):K=e[20];let g;e[21]!==K?(g=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:K}),e[21]=K,e[22]=g):g=e[22];let L;e[23]===Symbol.for("react.memo_cache_sentinel")?(L=de=>V(de.target.value),e[23]=L):L=e[23];let ke;e[24]!==d||e[25]!==v||e[26]!==R?(ke=n.jsx(Ua,{id:"variant-rename-name",value:R,onChange:L,placeholder:d,autoFocus:!0,disabled:v}),e[24]=d,e[25]=v,e[26]=R,e[27]=ke):ke=e[27];let C;e[28]!==g||e[29]!==ke?(C=n.jsxs("div",{className:"space-y-1.5 py-4",children:[g,ke]}),e[28]=g,e[29]=ke,e[30]=C):C=e[30];let te;e[31]!==p?(te=()=>p(!1),e[31]=p,e[32]=te):te=e[32];let P;e[33]!==f?(P=f("sectionsEditor.variantRenameDialog.cancel"),e[33]=f,e[34]=P):P=e[34];let ne;e[35]!==v||e[36]!==te||e[37]!==P?(ne=n.jsx(Ze,{type:"button",variant:"outline",onClick:te,disabled:v,children:P}),e[35]=v,e[36]=te,e[37]=P,e[38]=ne):ne=e[38];let O;e[39]!==v||e[40]!==f?(O=v?n.jsxs(n.Fragment,{children:[n.jsx(es,{size:14,className:"animate-spin"}),f("sectionsEditor.variantRenameDialog.saving")]}):f("sectionsEditor.variantRenameDialog.save"),e[39]=v,e[40]=f,e[41]=O):O=e[41];let Ae;e[42]!==v||e[43]!==O?(Ae=n.jsx(Ze,{type:"submit",disabled:v,children:O}),e[42]=v,e[43]=O,e[44]=Ae):Ae=e[44];let xe;e[45]!==ne||e[46]!==Ae?(xe=n.jsxs($a,{children:[ne,Ae]}),e[45]=ne,e[46]=Ae,e[47]=xe):xe=e[47];let Te;e[48]!==c||e[49]!==C||e[50]!==xe||e[51]!==X?(Te=n.jsx(za,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:c,children:[X,C,xe]})}),e[48]=c,e[49]=C,e[50]=xe,e[51]=X,e[52]=Te):Te=e[52];let W;return e[53]!==x||e[54]!==a||e[55]!==Te?(W=n.jsx(Ha,{open:a,onOpenChange:x,children:Te}),e[53]=x,e[54]=a,e[55]=Te,e[56]=W):W=e[56],W}function Ps(m){const e=We.c(5),{rule:a,matchers:l}=m,d=a?.__resolveType??"";let h;if(e[0]!==l||e[1]!==d){const f=l.find(R=>R.resolveType===d)?.iconName??Jo(d);h=Aa(f),e[0]=l,e[1]=d,e[2]=h}else h=e[2];const b=h;if(!b)return null;let p;return e[3]!==b?(p=n.jsx(b,{size:14,className:"shrink-0"}),e[3]=b,e[4]=p):p=e[4],p}function Wn(m){return m.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
2
2
  `)}function Jn(m){return m.map((e,a)=>({id:crypto.randomUUID(),index:a,variant:e}))}function kr(m,e){const a=new Map;for(const l of m){const d=a.get(l.variant.label);d?d.push(l):a.set(l.variant.label,[l])}return e.map((l,d)=>({id:a.get(l.label)?.shift()?.id??crypto.randomUUID(),index:d,variant:l}))}function Tr(m){return m.map((e,a)=>({...e,index:a}))}function Cs(m){const e=We.c(17),{label:a,effectiveRule:l,matchers:d,canDelete:h,dragging:b,onRename:p,onDuplicate:v,onDelete:f}=m,R=ut();let V;e[0]!==l||e[1]!==d?(V=n.jsx(Ps,{rule:l,matchers:d}),e[0]=l,e[1]=d,e[2]=V):V=e[2];let D;e[3]!==a?(D=n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:a}),e[3]=a,e[4]=D):D=e[4];let j;e[5]!==h||e[6]!==b||e[7]!==a||e[8]!==f||e[9]!==v||e[10]!==p||e[11]!==R?(j=!b&&n.jsxs(ws,{children:[n.jsx(Rs,{asChild:!0,children:n.jsx(Ze,{type:"button",variant:"ghost",size:"icon","aria-label":R("sectionsEditor.pageVariantTabs.actionsAriaLabel",{label:a}),className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:Vr,onPointerDown:Nr,children:n.jsx(Ss,{size:14})})}),n.jsxs(ks,{align:"end",className:"w-36",children:[n.jsxs(bt,{onClick:x=>{x.stopPropagation(),p?.()},children:[n.jsx(or,{size:14}),R("sectionsEditor.pageVariantTabs.renameAction")]}),n.jsxs(bt,{onClick:x=>{x.stopPropagation(),v?.()},children:[n.jsx(_s,{size:14}),R("sectionsEditor.pageVariantTabs.duplicateAction")]}),n.jsx(Ja,{}),n.jsxs(bt,{variant:"destructive",disabled:!h,onClick:x=>{x.stopPropagation(),f?.()},children:[n.jsx(Es,{size:14}),R("sectionsEditor.pageVariantTabs.deleteAction")]})]})]}),e[5]=h,e[6]=b,e[7]=a,e[8]=f,e[9]=v,e[10]=p,e[11]=R,e[12]=j):j=e[12];let i;return e[13]!==V||e[14]!==D||e[15]!==j?(i=n.jsxs(n.Fragment,{children:[V,D,j]}),e[13]=V,e[14]=D,e[15]=j,e[16]=i):i=e[16],i}function Nr(m){return m.stopPropagation()}function Vr(m){return m.stopPropagation()}function Dr(m){const e=We.c(33),{entry:a,isActive:l,canDelete:d,decofile:h,meta:b,matchers:p,onSelect:v,onRename:f,onDuplicate:R,onDelete:V}=m;let D;e[0]!==a.id?(D={id:a.id,animateLayoutChanges:Pr},e[0]=a.id,e[1]=D):D=e[1];const{attributes:j,listeners:i,setNodeRef:x,transform:E,isDragging:c}=ls(D);let w;e[2]!==E?(w=cs.Transform.toString(E?{...E,x:0}:null),e[2]=E,e[3]=w):w=e[3];const r=c?0:void 0;let B;e[4]!==w||e[5]!==r?(B={transform:w,opacity:r},e[4]=w,e[5]=r,e[6]=B):B=e[6];const I=B,X=b??void 0;let K;e[7]!==h||e[8]!==a.variant.rule||e[9]!==X?(K=Lt(a.variant.rule,h,X),e[7]=h,e[8]=a.variant.rule,e[9]=X,e[10]=K):K=e[10];const g=K;let L;e[11]!==v?(L=O=>{O.target===O.currentTarget&&(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),v())},e[11]=v,e[12]=L):L=e[12];const ke=c?"cursor-grabbing":"cursor-pointer active:cursor-grabbing",C=l?hs:us;let te;e[13]!==ke||e[14]!==C?(te=ze("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors touch-none",ke,C),e[13]=ke,e[14]=C,e[15]=te):te=e[15];let P;e[16]!==d||e[17]!==g||e[18]!==a.variant.label||e[19]!==p||e[20]!==V||e[21]!==R||e[22]!==f?(P=n.jsx(Cs,{label:a.variant.label,effectiveRule:g,matchers:p,canDelete:d,onRename:f,onDuplicate:R,onDelete:V}),e[16]=d,e[17]=g,e[18]=a.variant.label,e[19]=p,e[20]=V,e[21]=R,e[22]=f,e[23]=P):P=e[23];let ne;return e[24]!==j||e[25]!==i||e[26]!==v||e[27]!==x||e[28]!==I||e[29]!==te||e[30]!==P||e[31]!==L?(ne=n.jsx("div",{ref:x,style:I,...j,...i,onClick:v,onKeyDown:L,className:te,children:P}),e[24]=j,e[25]=i,e[26]=v,e[27]=x,e[28]=I,e[29]=te,e[30]=P,e[31]=L,e[32]=ne):ne=e[32],ne}function Pr(){return!1}function Cr(m){const e=We.c(9),{variant:a,decofile:l,meta:d,matchers:h}=m,b=d??void 0;let p;e[0]!==l||e[1]!==b||e[2]!==a.rule?(p=Lt(a.rule,l,b),e[0]=l,e[1]=b,e[2]=a.rule,e[3]=p):p=e[3];const v=p;let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=ze("flex items-center gap-2 rounded-md px-2 py-2.5 shadow-lg ring-1 ring-border/60 cursor-grabbing",hs),e[4]=f):f=e[4];let R;return e[5]!==v||e[6]!==h||e[7]!==a.label?(R=n.jsx("div",{className:f,children:n.jsx(Cs,{label:a.label,effectiveRule:v,matchers:h,canDelete:!1,dragging:!0})}),e[5]=v,e[6]=h,e[7]=a.label,e[8]=R):R=e[8],R}function Ar(m){const e=We.c(91),{listKey:a,variants:l,activeIndex:d,decofile:h,meta:b,matchers:p,onSelect:v,onReorder:f,onRename:R,onDuplicate:V,onDelete:D,onAdd:j}=m,i=ut();let x;e[0]!==l?(x=()=>Jn(l),e[0]=l,e[1]=x):x=e[1];const[E,c]=T.useState(x),[w,r]=T.useState(null),[B,I]=T.useState(a),[X,K]=T.useState(l.length);let g;e[2]!==l?(g=()=>Wn(l),e[2]=l,e[3]=g):g=e[3];const[L,ke]=T.useState(g),C=T.useRef(!1),te=Wn(l);B!==a?(I(a),K(l.length),ke(te),c(Jn(l))):(X!==l.length||L!==te)&&(K(l.length),ke(te),c(he=>kr(he,l)));let P;e[4]===Symbol.for("react.memo_cache_sentinel")?(P={activationConstraint:{distance:8}},e[4]=P):P=e[4];let ne;e[5]===Symbol.for("react.memo_cache_sentinel")?(ne={coordinateGetter:ds},e[5]=ne):ne=e[5];const O=ns(Xt(rs,P),Xt(as,ne));let Ae;e[6]!==E?(Ae=E.map(Mr),e[6]=E,e[7]=Ae):Ae=e[7];const xe=Ae,Te=l.length>1;let W;e[8]!==E?(W=he=>{const Re=String(he.active.id);r(E.find(oe=>oe.id===Re)??null)},e[8]=E,e[9]=W):W=e[9];const de=W;let re;e[10]!==xe||e[11]!==f?(re=he=>{r(null);const{active:Re,over:oe}=he;if(!oe||Re.id===oe.id)return;const Z=xe.indexOf(String(Re.id)),ue=xe.indexOf(String(oe.id));Z===-1||ue===-1||(c(ve=>Tr(Bt([...ve],Z,ue))),C.current=!0,requestAnimationFrame(()=>{C.current=!1}),f(Z,ue))},e[10]=xe,e[11]=f,e[12]=re):re=e[12];const se=re;let F;e[13]===Symbol.for("react.memo_cache_sentinel")?(F=()=>{r(null)},e[13]=F):F=e[13];const Ye=F;let Ke,Fe,Be,$,me,Ie,Me,ee,ye,ie,le,fe,pe;if(e[14]!==d||e[15]!==Te||e[16]!==h||e[17]!==E||e[18]!==xe||e[19]!==se||e[20]!==de||e[21]!==p||e[22]!==b||e[23]!==j||e[24]!==D||e[25]!==V||e[26]!==R||e[27]!==v||e[28]!==O||e[29]!==i){const he=ae=>{C.current||v(ae)};le="space-y-1 border-b p-2";let Re;e[43]!==i?(Re=i("sectionsEditor.pageVariantTabs.variantsLabel"),e[43]=i,e[44]=Re):Re=e[44];let oe;e[45]!==Re?(oe=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:Re}),e[45]=Re,e[46]=oe):oe=e[46];let Z;e[47]!==i?(Z=i("sectionsEditor.pageVariantTabs.addVariantAriaLabel"),e[47]=i,e[48]=Z):Z=e[48];let ue;e[49]===Symbol.for("react.memo_cache_sentinel")?(ue=n.jsx(bn,{size:14}),e[49]=ue):ue=e[49];let ve;e[50]!==j||e[51]!==Z?(ve=n.jsx(jt,{asChild:!0,children:n.jsx(Ze,{type:"button",variant:"ghost",size:"icon","aria-label":Z,className:"size-6",onClick:j,children:ue})}),e[50]=j,e[51]=Z,e[52]=ve):ve=e[52];let Ne;e[53]!==i?(Ne=i("sectionsEditor.pageVariantTabs.addVariantTooltip"),e[53]=i,e[54]=Ne):Ne=e[54];let k;e[55]!==Ne?(k=n.jsx(Et,{children:Ne}),e[55]=Ne,e[56]=k):k=e[56];let be;e[57]!==ve||e[58]!==k?(be=n.jsxs(_t,{children:[ve,k]}),e[57]=ve,e[58]=k,e[59]=be):be=e[59],e[60]!==oe||e[61]!==be?(fe=n.jsxs("div",{className:"flex items-center justify-between",children:[oe,be]}),e[60]=oe,e[61]=be,e[62]=fe):fe=e[62],Fe=ms,Ie=O,Me=fs,ee=de,ye=se,ie=Ye,Ke=ps,$=xe,me=gs,pe="space-y-0.5",Be=E.map(ae=>n.jsx(Dr,{entry:ae,isActive:ae.index===d,canDelete:Te,decofile:h,meta:b,matchers:p,onSelect:()=>he(ae.index),onRename:()=>R(ae.index),onDuplicate:()=>V(ae.index),onDelete:()=>D(ae.index)},ae.id)),e[14]=d,e[15]=Te,e[16]=h,e[17]=E,e[18]=xe,e[19]=se,e[20]=de,e[21]=p,e[22]=b,e[23]=j,e[24]=D,e[25]=V,e[26]=R,e[27]=v,e[28]=O,e[29]=i,e[30]=Ke,e[31]=Fe,e[32]=Be,e[33]=$,e[34]=me,e[35]=Ie,e[36]=Me,e[37]=ee,e[38]=ye,e[39]=ie,e[40]=le,e[41]=fe,e[42]=pe}else Ke=e[30],Fe=e[31],Be=e[32],$=e[33],me=e[34],Ie=e[35],Me=e[36],ee=e[37],ye=e[38],ie=e[39],le=e[40],fe=e[41],pe=e[42];let ge;e[63]!==Be||e[64]!==pe?(ge=n.jsx("div",{className:pe,children:Be}),e[63]=Be,e[64]=pe,e[65]=ge):ge=e[65];let _e;e[66]!==Ke||e[67]!==$||e[68]!==me||e[69]!==ge?(_e=n.jsx(Ke,{items:$,strategy:me,children:ge}),e[66]=Ke,e[67]=$,e[68]=me,e[69]=ge,e[70]=_e):_e=e[70];let je;e[71]!==w||e[72]!==h||e[73]!==p||e[74]!==b?(je=w?n.jsx(Cr,{variant:w.variant,decofile:h,meta:b,matchers:p}):null,e[71]=w,e[72]=h,e[73]=p,e[74]=b,e[75]=je):je=e[75];let ce;e[76]!==je?(ce=Zn.createPortal(n.jsx(ss,{dropAnimation:os,children:je}),document.body),e[76]=je,e[77]=ce):ce=e[77];let z;e[78]!==Fe||e[79]!==Ie||e[80]!==Me||e[81]!==ee||e[82]!==ye||e[83]!==ie||e[84]!==_e||e[85]!==ce?(z=n.jsxs(Fe,{sensors:Ie,collisionDetection:Me,onDragStart:ee,onDragEnd:ye,onDragCancel:ie,children:[_e,ce]}),e[78]=Fe,e[79]=Ie,e[80]=Me,e[81]=ee,e[82]=ye,e[83]=ie,e[84]=_e,e[85]=ce,e[86]=z):z=e[86];let Ee;return e[87]!==le||e[88]!==fe||e[89]!==z?(Ee=n.jsxs("div",{className:le,children:[fe,z]}),e[87]=le,e[88]=fe,e[89]=z,e[90]=Ee):Ee=e[90],Ee}function Mr(m){return m.id}function Br(m){const e=We.c(16),{schema:a,value:l,onChange:d,meta:h,decofile:b,onSaveReferencedBlock:p,sandbox:v}=m,f=ut();let R;e[0]===Symbol.for("react.memo_cache_sentinel")?(R=[],e[0]=R):R=e[0];const[V,D]=T.useState(R);let j;e[1]!==V||e[2]!==f?(j=V.length>0&&n.jsxs("nav",{"aria-label":f("sectionsEditor.sectionsEditorPanels.variantRuleBreadcrumb"),className:"flex min-w-0 items-center gap-1 overflow-hidden text-xs",children:[n.jsx("button",{type:"button",onClick:()=>D([]),className:"flex shrink-0 items-center gap-0.5 rounded-md px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",title:f("sectionsEditor.sectionsEditorPanels.backToRule"),children:n.jsx(xs,{className:"size-3.5"})}),V.map((E,c)=>{const w=c===V.length-1,r=bs(E);return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[c>0&&n.jsx(ys,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>D(V.slice(0,c+1)),title:r,className:ze("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",w?"font-medium text-foreground":"text-muted-foreground"),children:r})]},`${r}-${c}`)})]}),e[1]=V,e[2]=f,e[3]=j):j=e[3];let i;e[4]!==V||e[5]!==b||e[6]!==h||e[7]!==d||e[8]!==p||e[9]!==v||e[10]!==a||e[11]!==l?(i=n.jsx(vs,{schema:a,value:l,onChange:d,basePath:"",breadcrumbPath:V,onBreadcrumbChange:D,meta:h,decofile:b,onSaveReferencedBlock:p,sandbox:v}),e[4]=V,e[5]=b,e[6]=h,e[7]=d,e[8]=p,e[9]=v,e[10]=a,e[11]=l,e[12]=i):i=e[12];let x;return e[13]!==j||e[14]!==i?(x=n.jsxs("div",{className:"space-y-2",children:[j,i]}),e[13]=j,e[14]=i,e[15]=x):x=e[15],x}function Yn(m){const e=We.c(23),{activeSchema:a,formValue:l,formResetKey:d,onFormChange:h,onBreadcrumbChange:b,breadcrumbPath:p,emptyMessage:v,beforeForm:f,seoResolveType:R,siteDefaultSeo:V,meta:D,decofile:j,onSaveReferencedBlock:i,sandbox:x,previewBaseUrl:E,onRequestAddSection:c}=m;let w;e[0]!==p?(w=p===void 0?[]:p,e[0]=p,e[1]=w):w=e[1];const r=w;let B;e[2]!==a||e[3]!==r||e[4]!==j||e[5]!==d||e[6]!==l||e[7]!==D||e[8]!==b||e[9]!==h||e[10]!==c||e[11]!==i||e[12]!==E||e[13]!==x||e[14]!==R||e[15]!==V?(B=a&&l?R?n.jsx(Ya,{schema:a,resolveType:R,value:l,formResetKey:d,onChange:h,onBreadcrumbChange:b,siteDefaultSeo:V}):n.jsx(vs,{schema:a,value:l,onChange:h,basePath:"",breadcrumbPath:r,onBreadcrumbChange:b,meta:D,decofile:j,onSaveReferencedBlock:i,sandbox:x,previewBaseUrl:E,onRequestAddSection:c},d):null,e[2]=a,e[3]=r,e[4]=j,e[5]=d,e[6]=l,e[7]=D,e[8]=b,e[9]=h,e[10]=c,e[11]=i,e[12]=E,e[13]=x,e[14]=R,e[15]=V,e[16]=B):B=e[16];const I=B;let X;e[17]!==v||e[18]!==I?(X=I??n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:v}),e[17]=v,e[18]=I,e[19]=X):X=e[19];let K;return e[20]!==f||e[21]!==X?(K=n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsxs("div",{className:"mx-auto max-w-2xl",children:[f,X]})}),e[20]=f,e[21]=X,e[22]=K):K=e[22],K}const Lr="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.22)]";function Kr(m,e){return Yo(m,e,ct)}function Fr(m){const e=We.c(19),{pageKey:a,initialName:l,initialPath:d,onFieldChange:h}=m,b=ut(),[p,v]=T.useState(l),[f,R]=T.useState(d),[V,D]=T.useState(a);V!==a&&(D(a),v(l),R(d));let j;e[0]!==h?(j=B=>{v(B.target.value),h("name",B.target.value)},e[0]=h,e[1]=j):j=e[1];let i;e[2]!==b?(i=b("sectionsEditor.sectionsEditorPanels.pageNamePlaceholder"),e[2]=b,e[3]=i):i=e[3];let x;e[4]!==p||e[5]!==j||e[6]!==i?(x=n.jsx("input",{type:"text",value:p,onChange:j,className:"w-full bg-transparent text-sm font-semibold truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:i}),e[4]=p,e[5]=j,e[6]=i,e[7]=x):x=e[7];let E;e[8]!==h?(E=B=>{R(B.target.value),h("path",B.target.value)},e[8]=h,e[9]=E):E=e[9];let c;e[10]!==b?(c=b("sectionsEditor.sectionsEditorPanels.pathPlaceholder"),e[10]=b,e[11]=c):c=e[11];let w;e[12]!==f||e[13]!==E||e[14]!==c?(w=n.jsx("input",{type:"text",value:f,onChange:E,className:"w-full bg-transparent text-xs text-muted-foreground truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:c}),e[12]=f,e[13]=E,e[14]=c,e[15]=w):w=e[15];let r;return e[16]!==x||e[17]!==w?(r=n.jsxs("div",{className:"space-y-1",children:[x,w]}),e[16]=x,e[17]=w,e[18]=r):r=e[18],r}function Qn(m){const e=We.c(13),{onClick:a}=m,l=ut();let d;e[0]!==l?(d=l("sectionsEditor.sectionsEditorPanels.addVariant"),e[0]=l,e[1]=d):d=e[1];let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(js,{size:14}),e[2]=h):h=e[2];let b;e[3]!==a||e[4]!==d?(b=n.jsx(jt,{asChild:!0,children:n.jsx(Ze,{type:"button",variant:"ghost",size:"icon","aria-label":d,className:"size-7 shrink-0 text-[oklch(0.65_0.15_160)]",onClick:a,children:h})}),e[3]=a,e[4]=d,e[5]=b):b=e[5];let p;e[6]!==l?(p=l("sectionsEditor.sectionsEditorPanels.addVariant"),e[6]=l,e[7]=p):p=e[7];let v;e[8]!==p?(v=n.jsx(Et,{side:"bottom",children:p}),e[8]=p,e[9]=v):v=e[9];let f;return e[10]!==b||e[11]!==v?(f=n.jsxs(_t,{children:[b,v]}),e[10]=b,e[11]=v,e[12]=f):f=e[12],f}function Xn(m){const e=We.c(21),{currentRt:a,currentLabel:l,currentGlobalKey:d,matchers:h,globals:b,onSelect:p,onSelectGlobal:v,schema:f,formValue:R,onChange:V,formKey:D,formWrapperClassName:j,meta:i,decofile:x,onSaveReferencedBlock:E,sandbox:c}=m;let w;e[0]!==d||e[1]!==l||e[2]!==a||e[3]!==b||e[4]!==h||e[5]!==p||e[6]!==v?(w=n.jsx(Qo,{currentRt:a,currentLabel:l,currentGlobalKey:d,matchers:h,globals:b,onSelect:p,onSelectGlobal:v}),e[0]=d,e[1]=l,e[2]=a,e[3]=b,e[4]=h,e[5]=p,e[6]=v,e[7]=w):w=e[7];let r;e[8]!==x||e[9]!==D||e[10]!==R||e[11]!==j||e[12]!==i||e[13]!==V||e[14]!==E||e[15]!==c||e[16]!==f?(r=f&&R&&n.jsx("div",{className:j,children:n.jsx(Br,{schema:f,value:R,onChange:V,meta:i,decofile:x,onSaveReferencedBlock:E,sandbox:c},D)}),e[8]=x,e[9]=D,e[10]=R,e[11]=j,e[12]=i,e[13]=V,e[14]=E,e[15]=c,e[16]=f,e[17]=r):r=e[17];let B;return e[18]!==w||e[19]!==r?(B=n.jsxs(n.Fragment,{children:[w,r]}),e[18]=w,e[19]=r,e[20]=B):B=e[20],B}function Nc({orgSlug:m,virtualMcpId:e,branch:a,previewReady:l=!0,previewUrl:d,currentPath:h,activePageBlockKey:b=null,activeGlobalBlockKey:p=null,externalSelection:v,onSaved:f,initialEditSeo:R=!1,onExitSeo:V,onViewJsonFile:D,onVariantPreviewOverride:j}){const i=ut(),x=Io()?.taskId??null,E=l?{orgSlug:m,virtualMcpId:e,branch:a,threadId:x,previewUrl:d}:null,{data:c,isLoading:w}=Xo(E),{data:r,isLoading:B}=Zo(E),I=ea(),X=I?.entity?.id===e?I.entity.metadata?.siteSlug??null:null,K=ar({virtualMcpId:e,sandboxUrl:d}),[g,L]=T.useState(null),[ke,C]=T.useState(null),[te,P]=T.useState(null),[ne,O]=T.useState(0),[Ae,xe]=T.useState(void 0),[Te,W]=T.useState(null),[de,re]=T.useState(null),[se,F]=T.useState([]),Ye=T.useRef(null),[Ke,Fe]=T.useState(se.length);Ke!==se.length&&(Fe(se.length),requestAnimationFrame(()=>{Ye.current&&(Ye.current.scrollTop=0)}));const[Be,$]=T.useState(0),[me,Ie]=T.useState(null),[Me,ee]=T.useState(null),[ye,ie]=T.useState(null),[le,fe]=T.useState(!0),[pe,ge]=T.useState(!1),[_e,je]=T.useState(!1),ce=T.useRef(null),[z,Ee]=T.useState(R),[he,Re]=T.useState(R);R&&!he&&(Re(!0),Ee(!0),L(null),C(null),P(null),F([])),!R&&he&&Re(!1);const[oe,Z]=T.useState(null),[ue,ve]=T.useState(void 0),[Ne,k]=T.useState([]),[be,ae]=T.useState(0),[Ve,Oe]=T.useState(0),[dt,De]=T.useState(null),[et,qe]=T.useState(null),[Sn,xn]=T.useState(null),As=Ko(),Ms=`${m}/${e}/${a}`,Zt=ta({orgSlug:m,virtualMcpId:e,branch:a}),[Bs,Ls]=T.useState(h),[Ks,Fs]=T.useState(b),[Is,Os]=T.useState(p);(Bs!==h||Ks!==b||Is!==p)&&(queueMicrotask(()=>Zt.flush()),Ls(h),Fs(b),Os(p),L(null),C(null),P(null),O(0),W(null),re(null),Oe(0),De(null),qe(null),F([]),$(t=>t+1),Ee(!1),Z(null),ve(void 0),k([]),ae(t=>t+1));const Pe=na({orgSlug:m,virtualMcpId:e,branch:a}),Kt=ya((t,s)=>{Pe.mutate({blockKey:t,data:s},{onSuccess:()=>f?.(),onError:o=>Y.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:o.message}))})}),en=sa({orgSlug:m,virtualMcpId:e,branch:a}),[Vt,Ft]=T.useState(!1),He=T.useRef(null),ot=T.useRef(null),at=T.useRef(null),tn=T.useRef({}),tt=T.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!l||w||B)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(es,{size:20,className:"animate-spin text-muted-foreground"})});if(!c||!r)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:i("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const $s=oa(c),Ce=!!p,Je=Ce?null:aa($s,h,b),N=Ce?p:Je?.key??null,nn=Ce&&p?c[p]:void 0,yn=Ce&&p&&nn?ra(p,nn):Ce&&p?p:"",It=!Ce&&N&&c[N]?c[N]:null,sn=z&&c&&r&&N&&Je?Un(c,{kind:"page",pageKey:N,pageName:String(Je.name??""),path:String(Je.path??"")},r):null,zs=z?It?.seo:void 0,on=ue!==void 0?ue:zs,Hs=z?Qa(on):void 0,Us=sn?.seoTypeOptions??[],Gs=z&&r?Xa(r):"",_n=oe??Hs??{},an=z&&sn?Za(_n,sn):null,qs=z&&an&&er(on)?qt(an,r):null,Ws=z?tr(c,r)?.seoData:void 0,Ge=Ce?[{label:"Default",sections:[{__resolveType:p}]}]:Kr(It?.sections,c??{}),Ot=Ge.length>1,$e=Math.min(ne,Ge.length-1),mt=Ge[$e],G=mt?.sections??[],Ue=Wt(G,c),jn=!Ce&&ia(It?.sections);if(Ce&&p&&Sn!==p){xn(p);const t=G[0],s=Ue[0];if(t&&s){L(0),Oe(0),F([]);const o=xt(t,s,c);o&&(C(o.data),P(o.resolveType),qe(null),De(null))}}!Ce&&Sn!==null&&xn(null),tt.current={rawSections:G,parsedSections:Ue,decofile:c??{},activePageKey:N,pageVariants:Ge,variantIndex:$e,sectionVariantIndex:Ve,selectedSectionIndex:g};const Js=()=>({multivariate:jn,index:$e,variants:Ge.map(t=>({rule:t.rule}))}),En=(t,s)=>{if(!j)return;if(!N||!jn||t.length<=1){j(null);return}const o=Hn(N,{multivariate:!0,index:s,variants:t},c,r);j(o.length>0?o:null)},Rt=(t,s,o)=>{if(!j)return;if(!N){j(null);return}const u=Js(),S=Hn(N,u,c,r);if(!t||s<0){j(S.length>0?S:null);return}const _=wa({pageKey:N,page:u,sectionIndex:s,sectionLazy:Ue[s]?.isLazy??!1,mvObj:t,selectedVariantIndex:o,decofile:c,meta:r}),y=[...S,..._];j(y.length>0?y:null)},ft=(t,s,o,u=g??-1,S=!1)=>{const _=st(t,s);if(!_){C(null),P(null),qe(null),De(null),S&&Rt(null,u,o);return}const A=Kn(_,ct)[o];if(!A){C(null),P(null),qe(null),De(null),S&&Rt(null,u,o);return}const Q=fa(A.value,c);C(Q?.data??null),P(Q?.resolveType??null);const{resolveType:M,formValue:H}=Ct(A.rule,c,r??void 0);qe(M),De(H),S&&Rt(_,u,o)},Dt=v?.index;if(v!==void 0&&(v?.seq??null)!==Ae&&(xe(v?.seq??null),typeof Dt=="number")){const t=G[Dt],s=Ue[Dt];if(t&&s)if(L(Dt),Oe(0),F([]),$(o=>o+1),s.isMultivariate)ft(t,s,0,Dt);else{const o=xt(t,s,c);o?(C(o.data),P(o.resolveType)):(C(null),P(null)),qe(null),De(null)}}const $t={orgSlug:m,virtualMcpId:e,branch:a,threadId:x,previewUrl:d??void 0,siteSlug:X},rn=te&&r?qt(te,r):null,Qe=(t,s)=>{if(!N)return;He.current&&(clearTimeout(He.current),He.current=null),at.current&&(clearTimeout(at.current),at.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null);const o=Mt(c,N,t,$e,Ge);Pe.mutate({blockKey:N,data:o},{onSuccess:()=>s?.onSuccess?.()??f?.(),onError:u=>Y.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:u.message}))})},wt=()=>{L(null),C(null),P(null),Oe(0),De(null),qe(null),F([]),$(t=>t+1)},Ys=(t,s)=>{He.current&&clearTimeout(He.current);const o=tt.current.sectionVariantIndex;He.current=setTimeout(()=>{const{rawSections:u,parsedSections:S,decofile:_,activePageKey:y,pageVariants:A,variantIndex:Q}=tt.current,M=u[s];if(!M)return;const H=S[s];if(!H)return;if(H.isSavedBlock){const q=H.isLazy?M.section?.__resolveType??M.__resolveType:M.__resolveType;Pe.mutate({blockKey:q,data:t},{onSuccess:()=>f?.(),onError:J=>Y.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:J.message}))});return}if(!y)return;const U={..._[y]},we=[...u];if(H.isMultivariate){const q=st(M,H);if(!q||!y)return;const J=Ta(q,o,t);we[s]=yt(M,H,J)}else if(H.isHidden){const q=is(M.__resolveType),J=q?{...M.section}:{...M},Le=Array.isArray(J.variants)?[...J.variants]:[];Le[0]&&(Le[0]={...Le[0],value:t}),J.variants=Le,q?we[s]={...M,section:J}:we[s]=J}else H.isLazy?we[s]={...M,section:t}:we[s]=t;if(A.length>1){const q=U.sections,J=[...q?.variants??[]];J[Q]&&(J[Q]={...J[Q],value:we}),U.sections={...q,variants:J}}else U.sections=we;Pe.mutate({blockKey:y,data:U},{onSuccess:()=>f?.(),onError:q=>Y.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:q.message}))})},gn)},Qs=t=>{L(t),Oe(0),F([]),$(S=>S+1);const s=G[t],o=Ue[t];if(!s||!o)return;if(o.isMultivariate){ft(s,o,0,t);return}const u=xt(s,o,c);if(!u){C(null),P(null),qe(null),De(null),Rt(null,t,0);return}C(u.data),P(u.resolveType),qe(null),De(null),Rt(null,t,0)},Rn=t=>{const s=t;C(s),g!==null&&Ys(s,g)},ln=t=>{if(!N||!c||!r||!Je)return;const s={kind:"page",pageKey:N,pageName:String(Je.name??""),path:String(Je.path??"")},o=Un(c,s,r);o&&Zt.save(N,()=>{const u=As.getQueryData(Fo.decofile(Ms))?.[N];if(!u||typeof u!="object"||u===null||Array.isArray(u))return null;const S={...u,...tn.current};return tn.current={},t?.raw!==void 0?{...S,seo:t.raw}:t?.inner!==void 0?sr(s,o,S,t.inner):S})},Xs=(t,s)=>{N&&(tn.current[t]=s,ln())},Zs=(t,s)=>{if(!N)return;const o=Bt([...G],t,s);g!==null&&(g===t?L(s):t<g&&s>=g?L(g-1):t>g&&s<=g&&L(g+1)),Qe(o)},eo=t=>{if(!N)return;const s=G.filter((o,u)=>u!==t);g===t?wt():g!==null&&g>t&&L(g-1),Qe(s)},to=t=>{if(!N)return;const s=G[t];if(!s)return;const o=[...G];o.splice(t+1,0,Ra(s)),g!==null&&g>t&&L(g+1),Qe(o)},no=t=>{if(!N)return;const s=G[t],o=Ue[t];if(!s||!o||o.isMultivariate)return;const u=o.isHidden?ja(s):Ea(s);if(!u)return;const S=[...G];S[t]=u,g===t&&wt(),Qe(S)},so=t=>{if(!N)return;const s=G[t],o=Ue[t];if(!s||!o||o.isMultivariate)return;const u=_a(s);if(!u)return;const S=[...G];S[t]=u,g===t&&wt(),Qe(S)},oo=t=>{if(!N)return;const s=G[t],o=Ue[t];if(!s||!o?.isSavedBlock)return;const u=xt(s,o,c);if(!u?.data)return;const{name:S,..._}=u.data,y=[...G];o.isLazy?y[t]={...s,section:_}:y[t]=_,g===t&&wt(),Qe(y)},ao=t=>{if(!N)return;const s=[...G,{__resolveType:t.resolveType}],o=s.length-1;Qe(s,{onSuccess:()=>{ge(!1),L(o),Oe(0),F([]),$(y=>y+1);const u=s[o],S=Wt(s,c)[o];if(!u||!S)return;if(S.isMultivariate){ft(u,S,0);return}const _=xt(u,S,c);if(!_){C(null),P(null),qe(null),De(null);return}C(_.data),P(_.resolveType),qe(null),De(null)}})},wn=t=>{ce.current=t.append,ge(!0)},ro=t=>{const s=ce.current;if(!s){ao(t);return}s({__resolveType:t.resolveType}),ge(!1),ce.current=null},io=t=>{if(g===null)return;const s=G[g],o=Ue[g];!s||!o?.isMultivariate||(Oe(t),F([]),$(u=>u+1),ft(s,o,t,g,!0))},lo=t=>{if(g===null||!N)return;const s=G[g],o=Ue[g];if(!s||!o?.isMultivariate)return;const u=st(s,o);if(!u)return;const S=Sa(u,t);if(!S){Y.error(i("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const _=[...G];_[g]=yt(s,o,S);const y=S.variants;let A=Ve;t===Ve?A=Math.min(t,y.length-1):t<Ve&&(A=Ve-1),Oe(A),F([]),$(Q=>Q+1),ft(_[g],o,A),Qe(_)},co=t=>{if(g===null||!N)return;const s=G[g],o=Ue[g];if(!s||!o?.isMultivariate)return;const u=st(s,o);if(!u)return;const S=xa(u,t),_=[...G];_[g]=yt(s,o,S);const y=t+1;Oe(y),F([]),$(A=>A+1),ft(_[g],o,y),Qe(_)},uo=(t,s)=>{if(g===null||!N||t===s)return;const o=G[g],u=Ue[g];if(!o||!u?.isMultivariate)return;const S=st(o,u);if(!S)return;const _=va(S,t,s),y=[...G];y[g]=yt(o,u,_);let A=Ve;Ve===t?A=s:t<Ve&&s>=Ve?A=Ve-1:t>Ve&&s<=Ve&&(A=Ve+1),Oe(A),ft(y[g],u,A),Qe(y)},cn=t=>{const s=t??g;if(s===null||!N)return;const o=G[s],u=Ue[s];if(!o||!u)return;const S=pa(o,u);if(!S){Y.error(i("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const _=[...G];_[s]=S.section;const y=Wt(_,c)[s];if(!y?.isMultivariate){Y.error(i("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}L(s),Oe(S.newVariantIndex),F([]),$(A=>A+1),ft(S.section,y,S.newVariantIndex,s),Qe(_)},mo=()=>{if(g===null||!N)return;const t=G[g],s=Ue[g];if(!t||!s?.isMultivariate)return;const o=st(t,s);if(!o)return;const u=ba(t,s,o);if(!u){Y.error(i("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const S=[...G];S[g]=u;const _=Wt(S,c)[g];if(!_)return;Oe(0),qe(null),De(null),F([]),$(A=>A+1);const y=xt(u,_,c);y?(C(y.data),P(y.resolveType)):(C(null),P(null)),Rt(null,g,0),Qe(S)},fo=async t=>{if(me===null||!N)return;const s=pn(t,c);if(s){Y.error(s);return}const o=G[me],u=Ue[me];if(!o||!u)return;const S=xt(o,u,c);if(!S){Y.error(i("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const _={...S.data,name:t};try{await Pe.mutateAsync({blockKey:t,data:_});const y=[...G];y[me]={__resolveType:t},await Pe.mutateAsync({blockKey:N,data:Mt(c,N,y,$e,Ge)}),g===me&&wt(),Ie(null),Y.success(i("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),f?.()}catch(y){Y.error(y instanceof Error?y.message:i("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"))}},kn=mt?.rule;if(Ot&&g===null&&de===null&&kn){const{resolveType:t,formValue:s}=Ct(kn,c??{},r??void 0);re(t),W(s)}const zt=r?la(r):[],Tn=r&&c?ca(r,c):[],po=!Ce&&!!(K&&r&&c),go=de&&r?qt(de,r):null,kt=()=>{ot.current&&(clearTimeout(ot.current),ot.current=null),at.current&&(clearTimeout(at.current),at.current=null)},Pt=async(t,s)=>{if(!(ka(s,t,r)>0))try{await en.mutateAsync({blockKey:t})}catch(o){Y.error(o instanceof Error?o.message:i("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"))}},Nn=t=>{ot.current&&clearTimeout(ot.current),ot.current=setTimeout(()=>{const{activePageKey:s,decofile:o,variantIndex:u}=tt.current;if(!s)return;const S={...o[s]},_={...S.sections},y=[..._.variants??[]],A=y[u],Q=A?.rule;if(Tt(Q,o,r)){const M=Q?.__resolveType??"",H=o[M],U=typeof H?.name=="string"?H.name:M,{__resolveType:we,...q}=t;Pe.mutate({blockKey:M,data:Nt(we??"",q,U)},{onSuccess:()=>f?.(),onError:J=>Y.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:J.message}))});return}A&&(y[u]={...A,rule:t}),S.sections={..._,variants:y},Pe.mutate({blockKey:s,data:S},{onSuccess:()=>f?.(),onError:M=>Y.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:M.message}))})},gn)},ho=t=>{re(t);const s=t?In(t,r):{__resolveType:On};W(t?s:{}),Nn(s)},vo=t=>{const s=t;W(s);const o=de?{__resolveType:de,...s}:{...s};Nn(o)},bo=async t=>{kt();const{activePageKey:s,decofile:o,variantIndex:u}=tt.current;if(!s)return;const S=o[s],_=S?.sections;if(!_||typeof _!="object"||Array.isArray(_))return;const y=_;if(!Array.isArray(y.variants))return;const A=[...y.variants],Q=A[u];if(!Q)return;const M=At(Q.rule,o,r),H=Yt(t);A[u]={...Q,rule:H};const U={...o,[s]:{...S,sections:{...y,variants:A}}},{resolveType:we,formValue:q}=Ct(H,U,r??void 0);re(we),W(q);try{await Pe.mutateAsync({blockKey:s,data:U[s]}),M&&M!==t&&await Pt(M,U),f?.()}catch(J){Y.error(J instanceof Error?J.message:i("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}},Vn=t=>{at.current&&clearTimeout(at.current);const{selectedSectionIndex:s,sectionVariantIndex:o}=tt.current;s!==null&&(at.current=setTimeout(()=>{const{rawSections:u,parsedSections:S,decofile:_,activePageKey:y,pageVariants:A,variantIndex:Q}=tt.current;if(!y)return;const M=u[s],H=S[s];if(!M||!H?.isMultivariate)return;const U=st(M,H);if(!U)return;const q=(U.variants??[])[o]?.rule;if(Tt(q,_,r)){const Se=q?.__resolveType??"",Xe=_[Se],it=typeof Xe?.name=="string"?Xe.name:Se,{__resolveType:ht,...lt}=t;Pe.mutate({blockKey:Se,data:Nt(ht??"",lt,it)},{onSuccess:()=>f?.(),onError:vt=>Y.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:vt.message}))});return}const J=Fn(U,o,t),Le=[...u];Le[s]=yt(M,H,J);const nt=Mt(_,y,Le,Q,A);Pe.mutate({blockKey:y,data:nt},{onSuccess:()=>f?.(),onError:Se=>Y.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:Se.message}))})},gn))},So=t=>{qe(t);const s=t?In(t,r):{__resolveType:On};De(t?s:{}),Vn(s)},xo=t=>{const s=t;De(s);const o=et?{__resolveType:et,...s}:{...s};Vn(o)},yo=async t=>{kt();const{selectedSectionIndex:s,sectionVariantIndex:o,rawSections:u,parsedSections:S,decofile:_,activePageKey:y,pageVariants:A,variantIndex:Q}=tt.current;if(s===null||!y)return;const M=u[s],H=S[s];if(!M||!H?.isMultivariate)return;const U=st(M,H);if(!U)return;const we=U.variants??[],q=At(we[o]?.rule,_,r),J=Yt(t),Le=Fn(U,o,J),nt=[...u];nt[s]=yt(M,H,Le);const Se=Mt(_,y,nt,Q,A),Xe={..._,[y]:Se},{resolveType:it,formValue:ht}=Ct(J,Xe,r??void 0);qe(it),De(ht);try{await Pe.mutateAsync({blockKey:y,data:Se}),q&&q!==t&&await Pt(q,Xe),f?.()}catch(lt){Y.error(lt instanceof Error?lt.message:i("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}};if(!Ce&&!Je)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:i("sectionsEditor.sectionsEditor.noPageFound",{currentPath:h})});if(Ce&&!nn)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:i("sectionsEditor.sectionsEditor.globalBlockNotFound")});const pt=g!==null?Ue[g]??null:null,Dn=g!==null?G[g]:null,Pn=Dn&&pt?.isMultivariate?st(Dn,pt):null,St=Pn?Kn(Pn,ct):[],un=Math.min(Ve,Math.max(St.length-1,0)),Ht=St[un]??null,gt=pt?.isMultivariate===!0,Cn=g!==null&&pt!==null,Ut=Cn&&(gt||!!(rn&&ke)),_o=Ut&&!Ce&&pt?.isSavedBlock===!0,rt=Ce||_o,jo=Ce?yn:pt?.label??"",Eo=et&&r?qt(et,r):null,dn=Ut&&(!Ce||se.length>0)?Ce?[yn,...se]:[Je.name,pt.label,...gt&&Ht?[Ht.label]:[],...se]:[],Ro=z&&Je?[Je.name,"SEO",...Ne]:[],Gt=z?Ro:rt?dn.length>0?dn:[jo]:dn,wo=!z&&!Ce&&gt&&se.length===0,An=()=>{if(!N)return;kt(),He.current&&(clearTimeout(He.current),He.current=null);const t=c[N],s=ga(t.sections,G);if(!s)return;const o=ha(s);Pe.mutate({blockKey:N,data:{...t,sections:s}},{onSuccess:()=>{O(o),L(null),C(null),P(null),F([]),W(null),re(null)},onError:u=>Y.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:u.message}))})},mn=(t,s,o)=>{if(!N)return;kt(),He.current&&(clearTimeout(He.current),He.current=null);const u=c[N],S=u.sections;if(!S||typeof S!="object"||Array.isArray(S))return;const _=S;if(!Array.isArray(_.variants))return;const y=t([..._.variants]);if(!y)return;const A=Na(_,y),Q={...c,[N]:{...u,sections:A}};Pe.mutate({blockKey:N,data:Q[N]},{onSuccess:()=>{s?.(),o&&Pt(o,Q)},onError:M=>Y.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:M.message}))})},ko=t=>{ee(null),O(t),L(null),C(null),P(null),F([]);const s=Ge[t]?.rule,{resolveType:o,formValue:u}=Ct(s,c??{},r??void 0);re(o),W(u),En(Ge.map(S=>({rule:S.rule})),t)},To=(t,s)=>{if(t===s)return;let o=$e;$e===t?o=s:t<$e&&s>=$e?o=$e-1:t>$e&&s<=$e&&(o=$e+1),O(o);const u=Bt(Ge.map(S=>({rule:S.rule})),t,s);En(u,o),mn(S=>Bt(S,t,s))},No=t=>{const s=Ge[t]?.rule,o=At(s,c??{},r??void 0);mn(u=>u.length<=1?null:(u.splice(t,1),u),()=>{Ge.length-1===1?O(0):t<$e?O($e-1):t===$e&&O(Math.max(0,t-1)),L(null),C(null),P(null),F([]),W(null),re(null)},o)},Vo=t=>{mn(s=>Va(s,t),()=>{O(t+1),L(null),C(null),P(null),F([]),W(null),re(null)})},Do=async(t,s)=>{kt(),He.current&&(clearTimeout(He.current),He.current=null);const o=tt.current.activePageKey,u=tt.current.decofile;if(!o)return;const S=u[o],_=S.sections;if(!_||typeof _!="object"||Array.isArray(_))return;const y=_;if(!Array.isArray(y.variants))return;const A=[...y.variants],Q=A[t];if(!Q?.rule||typeof Q.rule!="object"){Y.error(i("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const M=Q.rule,H=s.trim();Ft(!0);try{if(!H){if(!Tt(M,u,r)){ee(null);return}const nt=M.__resolveType??"";A[t]={...Q,rule:$n(M,u,r)};const Se={...u,[o]:{...S,sections:{...y,variants:A}}};await Pe.mutateAsync({blockKey:o,data:Se[o]}),await Pt(nt,Se),ee(null),f?.();return}const U=zn(M,u,r);if(!U){Y.error(i("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(U.blockKey){await Pe.mutateAsync({blockKey:U.blockKey,data:Nt(U.resolveType,U.data,H)}),ee(null),f?.();return}const we=fn(H),q=pn(we,u);if(q){Y.error(q);return}const J=Nt(U.resolveType,U.data,H);let Le=null;try{await Pe.mutateAsync({blockKey:we,data:J}),Le=we,A[t]={...Q,rule:Yt(we)},await Pe.mutateAsync({blockKey:o,data:{...S,sections:{...y,variants:A}}}),Le=null}catch(nt){throw Le&&await en.mutateAsync({blockKey:Le}).catch(()=>{}),nt}ee(null),Y.success(i("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:H})),f?.()}catch(U){Y.error(U instanceof Error?U.message:i("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Ft(!1)}},Po=async(t,s)=>{kt(),He.current&&(clearTimeout(He.current),He.current=null);const{selectedSectionIndex:o,rawSections:u,parsedSections:S,decofile:_,activePageKey:y,pageVariants:A,variantIndex:Q}=tt.current;if(o===null||!y)return;const M=u[o],H=S[o];if(!M||!H?.isMultivariate)return;const U=st(M,H);if(!U)return;const we=U.variants??[],q=we[t];if(!q?.rule||typeof q.rule!="object"){Y.error(i("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const J=q.rule,Le=s.trim();Ft(!0);const nt=async Se=>{const Xe={...U,variants:Se},it=[...u];it[o]=yt(M,H,Xe);const ht=Mt(_,y,it,Q,A);return await Pe.mutateAsync({blockKey:y,data:ht}),{..._,[y]:ht}};try{if(!Le){if(!Tt(J,_,r)){ie(null);return}const vt=J.__resolveType??"",Ln=[...we];Ln[t]={...q,rule:$n(J,_,r)};const Lo=await nt(Ln);await Pt(vt,Lo),ie(null),f?.();return}const Se=zn(J,_,r);if(!Se){Y.error(i("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(Se.blockKey){await Pe.mutateAsync({blockKey:Se.blockKey,data:Nt(Se.resolveType,Se.data,Le)}),ie(null),f?.();return}const Xe=fn(Le),it=pn(Xe,_);if(it){Y.error(it);return}const ht=Nt(Se.resolveType,Se.data,Le);let lt=null;try{await Pe.mutateAsync({blockKey:Xe,data:ht}),lt=Xe;const vt=[...we];vt[t]={...q,rule:Yt(Xe)},await nt(vt),lt=null}catch(vt){throw lt&&await en.mutateAsync({blockKey:lt}).catch(()=>{}),vt}ie(null),Y.success(i("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:Le})),f?.()}catch(Se){Y.error(Se instanceof Error?Se.message:i("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Ft(!1)}},Mn=()=>{wt()},Co=t=>{Z(t),ln({inner:t})},Ao=t=>{ve(t),ln({raw:t})},Mo=()=>{Z(null),k([])},Bo=()=>ae(t=>t+1),Bn=t=>{if(z){if(t===0){Zt.flush(),Ee(!1),Z(null),ve(void 0),k([]),ae(o=>o+1),V?.();return}if(t===1){k([]),ae(o=>o+1);return}k(Ne.slice(0,t-1)),ae(o=>o+1);return}if(Ce){F(se.slice(0,t)),$(o=>o+1);return}if(t===0){Mn();return}if(t===1){F([]),$(o=>o+1);return}if(gt&&t===2){F([]),$(o=>o+1);return}const s=gt?2:1;F(se.slice(0,t-s))};return n.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[n.jsx("div",{className:"shrink-0",children:rt||Ut||z?n.jsxs("div",{className:ze("border-b px-3 py-2.5",rt&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[Gt.length>1&&n.jsx("button",{type:"button",onClick:()=>Bn(Da(Gt.length,{isMultivariateSectionTop:wo})),title:i("sectionsEditor.sectionsEditor.back"),"aria-label":i("sectionsEditor.sectionsEditor.back"),className:ze("shrink-0 inline-flex size-6 items-center justify-center rounded-md transition-colors",rt?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:n.jsx(xs,{className:"size-4"})}),!Ce&&Ot&&mt&&n.jsxs("button",{type:"button",onClick:Mn,title:i("sectionsEditor.sectionsEditor.editingInVariant",{variant:mt.label}),className:ze("shrink-0 inline-flex items-center gap-1 rounded-md h-6 px-1.5 text-xs font-medium cursor-pointer transition-opacity hover:opacity-80",Lr),children:[n.jsx(Ps,{rule:Lt(mt.rule,c??{},r??void 0),matchers:zt}),n.jsx("span",{className:"max-w-[160px] truncate",children:mt.label})]}),n.jsx("nav",{"aria-label":i("sectionsEditor.sectionsEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:Gt.map((t,s)=>{const o=s===Gt.length-1,u=bs(t);return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[s>0&&n.jsx(ys,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>Bn(s),title:u,className:ze("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",o?rt?"font-semibold text-global-section-fg dark:text-global-section-fg-dark":"font-medium text-foreground":rt?"text-foreground/80":"text-muted-foreground",rt?"hover:bg-global-section/15":"hover:bg-accent hover:text-accent-foreground"),children:u})]},`${u}-${s}`)})}),rt&&n.jsxs(_t,{children:[n.jsx(jt,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(Ka,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(Et,{side:"bottom",className:"max-w-[260px]",children:i("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Cn&&!gt&&!pt?.isHidden&&N&&n.jsx(Qn,{onClick:()=>cn()})]}),rt&&n.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:i("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):n.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(Fr,{pageKey:N,initialName:Je.name,initialPath:Je.path,onFieldChange:Xs})}),n.jsxs(_t,{children:[n.jsx(jt,{asChild:!0,children:n.jsx(Ze,{type:"button",variant:"ghost",size:"icon","aria-label":i("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:()=>Ee(!0),children:n.jsx(Ma,{size:14})})}),n.jsx(Et,{side:"bottom",children:i("sectionsEditor.sectionsEditor.editSeo")})]}),n.jsxs(_t,{children:[n.jsx(jt,{asChild:!0,children:n.jsx(Ze,{type:"button",variant:"ghost",size:"icon","aria-label":i("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>D&&N?D(N):je(!0),children:n.jsx(Ba,{size:14})})}),n.jsx(Et,{side:"bottom",children:i("sectionsEditor.sectionsEditor.viewJson")})]}),n.jsx(Qn,{onClick:An})]})}),z?n.jsx(Qt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:It&&N?n.jsx(nr,{rawSeo:on,innerSeo:_n,defaultResolveType:Gs,seoSchema:qs,activeResolveType:an,seoTypeOptions:Us,formResetKey:be,siteDefaultSeo:Ws,onBreadcrumbChange:k,onPersistRaw:Ao,onInnerChange:Co,onClearForm:Mo,onBumpFormKey:Bo}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:i("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"):Ut?n.jsxs(Qt,{viewportRef:Ye,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[gt&&St.length>0&&se.length===0&&n.jsxs(n.Fragment,{children:[n.jsx(ua,{listKey:`${N??""}:${g??""}`,variants:St.map((t,s)=>({index:s,label:t.label})),selectedIndex:un,onSelect:io,onRename:ie,onDuplicate:co,onDelete:lo,onRemoveAll:mo,onReorder:uo,onAdd:()=>cn()}),gt&&n.jsxs("div",{className:"px-3 py-3 border-b space-y-2",children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:i("sectionsEditor.sectionsEditor.variantRule")}),n.jsx(Xn,{currentRt:et??"",currentLabel:Jt(Ht?.rule,c??{},ct,r??void 0),currentGlobalKey:At(Ht?.rule,c??{},r??void 0)??void 0,matchers:zt,globals:Tn,onSelect:So,onSelectGlobal:yo,schema:Eo,formValue:dt,onChange:xo,formKey:`${g??"none"}:${un}:${et??""}`,formWrapperClassName:"pt-1",meta:r??void 0,decofile:c,onSaveReferencedBlock:Kt,sandbox:$t})]})]}),n.jsx(Yn,{activeSchema:rn,formValue:ke,formResetKey:Be,onFormChange:Rn,onBreadcrumbChange:F,breadcrumbPath:se,emptyMessage:i("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:r,decofile:c,onSaveReferencedBlock:Kt,sandbox:$t,previewBaseUrl:K,onRequestAddSection:wn})]},"editor-section-form"):Ce?n.jsx(Qt,{viewportRef:Ye,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(Yn,{activeSchema:rn,formValue:ke,formResetKey:Be,onFormChange:Rn,onBreadcrumbChange:F,breadcrumbPath:se,emptyMessage:i("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:r,decofile:c,onSaveReferencedBlock:Kt,sandbox:$t,previewBaseUrl:K,onRequestAddSection:wn})},"editor-global-block"):n.jsxs(Qt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[Ot&&N&&n.jsx(Ar,{listKey:N,variants:Ge,activeIndex:$e,decofile:c??{},meta:r,matchers:zt,onSelect:ko,onReorder:To,onRename:ee,onDuplicate:Vo,onDelete:No,onAdd:An}),Ot&&de!==null&&n.jsxs("div",{className:ze("px-3 border-b",le?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>fe(t=>!t),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer rounded-sm py-0.5 hover:bg-muted/40","aria-expanded":le,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:i("sectionsEditor.sectionsEditor.variantRule")}),le?n.jsx(La,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(Pa,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),le&&n.jsx("div",{className:ze("space-y-3",Vt&&"pointer-events-none opacity-50"),children:n.jsx(Xn,{currentRt:de,currentLabel:Jt(mt?.rule,c??{},ct,r??void 0),currentGlobalKey:At(mt?.rule,c??{},r??void 0)??void 0,matchers:zt,globals:Tn,onSelect:ho,onSelectGlobal:bo,schema:go,formValue:Te,onChange:vo,formKey:`${$e}:${de??""}`,formWrapperClassName:"space-y-3",meta:r??void 0,decofile:c,onSaveReferencedBlock:Kt,sandbox:$t})})]}),n.jsx("div",{className:"p-2 pt-3",children:n.jsx(Rr,{listKey:`${N??""}-${$e}`,rawSections:G,sections:Ue,meta:r,selectedIndex:g,onSelect:Qs,onReorder:Zs,onDelete:eo,onDuplicate:to,onMakeReusable:Ie,onToggleHidden:no,onToggleLazy:so,onAddVariant:cn,onDetach:oo,onAddSection:()=>ge(!0),canAddSection:po})})]},"editor-section-list"),n.jsx(da,{open:me!==null,onOpenChange:t=>{t||Ie(null)},defaultBlockId:me!==null?fn(Ue[me]?.label??""):"",isPending:Pe.isPending,onSubmit:fo}),K&&n.jsx(rr,{open:pe,onOpenChange:t=>{ge(t),t||(ce.current=null)},meta:r,decofile:c,previewBaseUrl:K,onSelect:ro}),_e&&N&&c&&n.jsx(ma,{open:_e,onOpenChange:je,pageKey:N,decofile:c}),Me!==null&&n.jsx(qn,{open:!0,initialName:Tt(Ge[Me]?.rule,c??{},r??void 0)?Jt(Ge[Me]?.rule,c??{},ct,r??void 0):"",autoLabel:ct(Lt(Ge[Me]?.rule,c??{},r??void 0)),isPending:Vt,onSubmit:async t=>{await Do(Me,t)},onOpenChange:t=>{!t&&!Vt&&ee(null)}}),ye!==null&&n.jsx(qn,{open:!0,initialName:Tt(St[ye]?.rule,c??{},r??void 0)?Jt(St[ye]?.rule,c??{},ct,r??void 0):"",autoLabel:ct(Lt(St[ye]?.rule,c??{},r??void 0)),isPending:Vt,onSubmit:async t=>{await Po(ye,t)},onOpenChange:t=>{!t&&!Vt&&ie(null)}})]})}export{Nc as SectionsEditor};
@@ -1 +1 @@
1
- import{r as i,bi as nt,bg as Pe,j as d,dK as rt,bk as Ie,bh as k,dL as st,bd as j,bj as N,cs as $,dM as lt,aC as _e,dN as Ee,be as at,cj as ct,dO as it,cu as dt,dP as ut,dQ as pt,dR as ft,dS as mt,dT as ht,bf as gt,dU as vt,dV as xt,dW as St,c as ee,n as oe}from"./index-BUry0fVo.js";import{i as wt}from"./Check-hLO7r2HE.js";import{t as Re}from"./ChevronDown-tpHSHuoX.js";import{n as Ct}from"./ChevronUp-Cp7vygr2.js";function Ne(r,[e,t]){return Math.min(t,Math.max(e,r))}var yt=[" ","Enter","ArrowUp","ArrowDown"],bt=[" ","Enter"],Q="Select",[de,ue,It]=at(Q),[ne]=gt(Q,[It,Ee]),pe=Ee(),[Tt,G]=ne(Q),[Pt,Nt]=ne(Q),je=r=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:c,value:s,defaultValue:l,onValueChange:a,dir:u,name:h,autoComplete:v,disabled:I,required:w,form:S}=r,p=pe(e),[g,C]=i.useState(null),[m,x]=i.useState(null),[U,M]=i.useState(!1),re=nt(u),[_,O]=Pe({prop:o,defaultProp:n??!1,onChange:c,caller:Q}),[F,q]=Pe({prop:s,defaultProp:l,onChange:a,caller:Q}),L=i.useRef(null),B=g?S||!!g.closest("form"):!0,[W,V]=i.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return d.jsx(rt,{...p,children:d.jsxs(Tt,{required:w,scope:e,trigger:g,onTriggerChange:C,valueNode:m,onValueNodeChange:x,valueNodeHasChildren:U,onValueNodeHasChildrenChange:M,contentId:Ie(),value:F,onValueChange:q,open:_,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:I,children:[d.jsx(de.Provider,{scope:e,children:d.jsx(Pt,{scope:r.__scopeSelect,onNativeOptionAdd:i.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:i.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?d.jsxs(Je,{"aria-hidden":!0,required:w,tabIndex:-1,name:h,autoComplete:v,value:F,onChange:E=>q(E.target.value),disabled:I,form:S,children:[F===void 0?d.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};je.displayName=Q;var Me="SelectTrigger",Ae=i.forwardRef((r,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=r,c=pe(t),s=G(Me,t),l=s.disabled||o,a=k(e,s.onTriggerChange),u=ue(t),h=i.useRef("touch"),[v,I,w]=tt(p=>{const g=u().filter(x=>!x.disabled),C=g.find(x=>x.value===s.value),m=ot(g,p,C);m!==void 0&&s.onValueChange(m.value)}),S=p=>{l||(s.onOpenChange(!0),w()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return d.jsx(st,{asChild:!0,...c,children:d.jsx(j.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":et(s.value)?"":void 0,...n,ref:a,onClick:N(n.onClick,p=>{p.currentTarget.focus(),h.current!=="mouse"&&S(p)}),onPointerDown:N(n.onPointerDown,p=>{h.current=p.pointerType;const g=p.target;g.hasPointerCapture(p.pointerId)&&g.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:N(n.onKeyDown,p=>{const g=v.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&I(p.key),!(g&&p.key===" ")&&yt.includes(p.key)&&(S(),p.preventDefault())})})})});Ae.displayName=Me;var Oe="SelectValue",De=i.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,children:c,placeholder:s="",...l}=r,a=G(Oe,t),{onValueNodeHasChildrenChange:u}=a,h=c!==void 0,v=k(e,a.onValueNodeChange);return $(()=>{u(h)},[u,h]),d.jsx(j.span,{...l,ref:v,style:{pointerEvents:"none"},children:et(a.value)?d.jsx(d.Fragment,{children:s}):c})});De.displayName=Oe;var _t="SelectIcon",ke=i.forwardRef((r,e)=>{const{__scopeSelect:t,children:o,...n}=r;return d.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});ke.displayName=_t;var Et="SelectPortal",Le=r=>d.jsx(lt,{asChild:!0,...r});Le.displayName=Et;var J="SelectContent",Be=i.forwardRef((r,e)=>{const t=G(J,r.__scopeSelect),[o,n]=i.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const c=o;return c?_e.createPortal(d.jsx(Ve,{scope:r.__scopeSelect,children:d.jsx(de.Slot,{scope:r.__scopeSelect,children:d.jsx("div",{children:r.children})})}),c):null}return d.jsx(He,{...r,ref:e})});Be.displayName=J;var A=10,[Ve,Y]=ne(J),Rt="SelectContentImpl",jt=vt("SelectContent.RemoveScroll"),He=i.forwardRef((r,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:c,onPointerDownOutside:s,side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:v,collisionBoundary:I,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:g,...C}=r,m=G(J,t),[x,U]=i.useState(null),[M,re]=i.useState(null),_=k(e,f=>U(f)),[O,F]=i.useState(null),[q,L]=i.useState(null),B=ue(t),[W,V]=i.useState(!1),H=i.useRef(!1);i.useEffect(()=>{if(x)return ut(x)},[x]),pt();const E=i.useCallback(f=>{const[T,...R]=B().map(P=>P.ref.current),[y]=R.slice(-1),b=document.activeElement;for(const P of f)if(P===b||(P?.scrollIntoView({block:"nearest"}),P===T&&M&&(M.scrollTop=0),P===y&&M&&(M.scrollTop=M.scrollHeight),P?.focus(),document.activeElement!==b))return},[B,M]),D=i.useCallback(()=>E([O,x]),[E,O,x]);i.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=m;i.useEffect(()=>{if(x){let f={x:0,y:0};const T=y=>{f={x:Math.abs(Math.round(y.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(y.pageY)-(K.current?.y??0))}},R=y=>{f.x<=10&&f.y<=10?y.preventDefault():x.contains(y.target)||z(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,z,K]),i.useEffect(()=>{const f=()=>z(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[z]);const[fe,ae]=tt(f=>{const T=B().filter(b=>!b.disabled),R=T.find(b=>b.ref.current===document.activeElement),y=ot(T,f,R);y&&setTimeout(()=>y.ref.current.focus())}),me=i.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&(F(f),y&&(H.current=!0))},[m.value]),he=i.useCallback(()=>x?.focus(),[x]),te=i.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&L(f)},[m.value]),ce=o==="popper"?Se:ze,se=ce===Se?{side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:v,collisionBoundary:I,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:g}:{};return d.jsx(Ve,{scope:t,content:x,viewport:M,onViewportChange:re,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:d.jsx(ft,{as:jt,allowPinchZoom:!0,children:d.jsx(mt,{asChild:!0,trapped:m.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:N(n,f=>{m.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:d.jsx(ht,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:c,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:d.jsx(ce,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:f=>f.preventDefault(),...C,...se,onPlaced:()=>V(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:N(C.onKeyDown,f=>{const T=f.ctrlKey||f.altKey||f.metaKey;if(f.key==="Tab"&&f.preventDefault(),!T&&f.key.length===1&&ae(f.key),["ArrowUp","ArrowDown","Home","End"].includes(f.key)){let y=B().filter(b=>!b.disabled).map(b=>b.ref.current);if(["ArrowUp","End"].includes(f.key)&&(y=y.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const b=f.target,P=y.indexOf(b);y=y.slice(P+1)}setTimeout(()=>E(y)),f.preventDefault()}})})})})})})});He.displayName=Rt;var Mt="SelectItemAlignedPosition",ze=i.forwardRef((r,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=r,c=G(J,t),s=Y(J,t),[l,a]=i.useState(null),[u,h]=i.useState(null),v=k(e,_=>h(_)),I=ue(t),w=i.useRef(!1),S=i.useRef(!0),{viewport:p,selectedItem:g,selectedItemText:C,focusSelectedItem:m}=s,x=i.useCallback(()=>{if(c.trigger&&c.valueNode&&l&&u&&p&&g&&C){const _=c.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),F=c.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(c.dir!=="rtl"){const b=q.left-O.left,P=F.left-b,X=_.left-P,Z=_.width+X,ge=Math.max(Z,O.width),ve=window.innerWidth-A,xe=Ne(P,[A,Math.max(A,ve-ge)]);l.style.minWidth=Z+"px",l.style.left=xe+"px"}else{const b=O.right-q.right,P=window.innerWidth-F.right-b,X=window.innerWidth-_.right-P,Z=_.width+X,ge=Math.max(Z,O.width),ve=window.innerWidth-A,xe=Ne(P,[A,Math.max(A,ve-ge)]);l.style.minWidth=Z+"px",l.style.right=xe+"px"}const L=I(),B=window.innerHeight-A*2,W=p.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),z=parseInt(V.paddingBottom,10),K=H+E+W+z+D,fe=Math.min(g.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=_.top+_.height/2-A,ce=B-te,se=g.offsetHeight/2,f=g.offsetTop+se,T=H+E+f,R=K-T;if(T<=te){const b=L.length>0&&g===L[L.length-1].ref.current;l.style.bottom="0px";const P=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ce,se+(b?he:0)+P+D),Z=T+X;l.style.height=Z+"px"}else{const b=L.length>0&&g===L[0].ref.current;l.style.top="0px";const X=Math.max(te,H+p.offsetTop+(b?me:0)+se)+R;l.style.height=X+"px",p.scrollTop=T-te+p.offsetTop}l.style.margin=`${A}px 0`,l.style.minHeight=fe+"px",l.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>w.current=!0)}},[I,c.trigger,c.valueNode,l,u,p,g,C,c.dir,o]);$(()=>x(),[x]);const[U,M]=i.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=i.useCallback(_=>{_&&S.current===!0&&(x(),m?.(),S.current=!1)},[x,m]);return d.jsx(Ot,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:w,onScrollButtonChange:re,children:d.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:U},children:d.jsx(j.div,{...n,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});ze.displayName=Mt;var At="SelectPopperPosition",Se=i.forwardRef((r,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...c}=r,s=pe(t);return d.jsx(xt,{...s,...c,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...c.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=At;var[Ot,Te]=ne(J,{}),we="SelectViewport",Ue=i.forwardRef((r,e)=>{const{__scopeSelect:t,nonce:o,...n}=r,c=Y(we,t),s=Te(we,t),l=k(e,c.onViewportChange),a=i.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),d.jsx(de.Slot,{scope:t,children:d.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:N(n.onScroll,u=>{const h=u.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:I}=s;if(I?.current&&v){const w=Math.abs(a.current-h.scrollTop);if(w>0){const S=window.innerHeight-A*2,p=parseFloat(v.style.minHeight),g=parseFloat(v.style.height),C=Math.max(p,g);if(C<S){const m=C+w,x=Math.min(S,m),U=m-x;v.style.height=x+"px",v.style.bottom==="0px"&&(h.scrollTop=U>0?U:0,v.style.justifyContent="flex-end")}}}a.current=h.scrollTop})})})]})});Ue.displayName=we;var Fe="SelectGroup",[Dt,kt]=ne(Fe),Lt=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=Ie();return d.jsx(Dt,{scope:t,id:n,children:d.jsx(j.div,{role:"group","aria-labelledby":n,...o,ref:e})})});Lt.displayName=Fe;var We="SelectLabel",Bt=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=kt(We,t);return d.jsx(j.div,{id:n.id,...o,ref:e})});Bt.displayName=We;var ie="SelectItem",[Vt,Ke]=ne(ie),$e=i.forwardRef((r,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:c,...s}=r,l=G(ie,t),a=Y(ie,t),u=l.value===o,[h,v]=i.useState(c??""),[I,w]=i.useState(!1),S=k(e,m=>a.itemRefCallback?.(m,o,n)),p=Ie(),g=i.useRef("touch"),C=()=>{n||(l.onValueChange(o),l.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(Vt,{scope:t,value:o,disabled:n,textId:p,isSelected:u,onItemTextChange:i.useCallback(m=>{v(x=>x||(m?.textContent??"").trim())},[]),children:d.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:h,children:d.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":I?"":void 0,"aria-selected":u&&I,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...s,ref:S,onFocus:N(s.onFocus,()=>w(!0)),onBlur:N(s.onBlur,()=>w(!1)),onClick:N(s.onClick,()=>{g.current!=="mouse"&&C()}),onPointerUp:N(s.onPointerUp,()=>{g.current==="mouse"&&C()}),onPointerDown:N(s.onPointerDown,m=>{g.current=m.pointerType}),onPointerMove:N(s.onPointerMove,m=>{g.current=m.pointerType,n?a.onItemLeave?.():g.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:N(s.onPointerLeave,m=>{m.currentTarget===document.activeElement&&a.onItemLeave?.()}),onKeyDown:N(s.onKeyDown,m=>{a.searchRef?.current!==""&&m.key===" "||(bt.includes(m.key)&&C(),m.key===" "&&m.preventDefault())})})})})});$e.displayName=ie;var le="SelectItemText",Ge=i.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,...c}=r,s=G(le,t),l=Y(le,t),a=Ke(le,t),u=Nt(le,t),[h,v]=i.useState(null),I=k(e,C=>v(C),a.onItemTextChange,C=>l.itemTextRefCallback?.(C,a.value,a.disabled)),w=h?.textContent,S=i.useMemo(()=>d.jsx("option",{value:a.value,disabled:a.disabled,children:w},a.value),[a.disabled,a.value,w]),{onNativeOptionAdd:p,onNativeOptionRemove:g}=u;return $(()=>(p(S),()=>g(S)),[p,g,S]),d.jsxs(d.Fragment,{children:[d.jsx(j.span,{id:a.textId,...c,ref:I}),a.isSelected&&s.valueNode&&!s.valueNodeHasChildren?_e.createPortal(c.children,s.valueNode):null]})});Ge.displayName=le;var Ye="SelectItemIndicator",qe=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return Ke(Ye,t).isSelected?d.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});qe.displayName=Ye;var Ce="SelectScrollUpButton",Xe=i.forwardRef((r,e)=>{const t=Y(Ce,r.__scopeSelect),o=Te(Ce,r.__scopeSelect),[n,c]=i.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollTop>0;c(u)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Qe,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop-a.offsetHeight)}}):null});Xe.displayName=Ce;var ye="SelectScrollDownButton",Ze=i.forwardRef((r,e)=>{const t=Y(ye,r.__scopeSelect),o=Te(ye,r.__scopeSelect),[n,c]=i.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollHeight-a.clientHeight,h=Math.ceil(a.scrollTop)<u;c(h)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Qe,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop+a.offsetHeight)}}):null});Ze.displayName=ye;var Qe=i.forwardRef((r,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=r,c=Y("SelectScrollButton",t),s=i.useRef(null),l=ue(t),a=i.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return i.useEffect(()=>()=>a(),[a]),$(()=>{l().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),d.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:N(n.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:N(n.onPointerMove,()=>{c.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:N(n.onPointerLeave,()=>{a()})})}),Ht="SelectSeparator",zt=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return d.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});zt.displayName=Ht;var be="SelectArrow",Ut=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=pe(t),c=G(be,t),s=Y(be,t);return c.open&&s.position==="popper"?d.jsx(St,{...n,...o,ref:e}):null});Ut.displayName=be;var Ft="SelectBubbleInput",Je=i.forwardRef(({__scopeSelect:r,value:e,...t},o)=>{const n=i.useRef(null),c=k(o,n),s=ct(e);return i.useEffect(()=>{const l=n.current;if(!l)return;const a=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(a,"value").set;if(s!==e&&h){const v=new Event("change",{bubbles:!0});h.call(l,e),l.dispatchEvent(v)}},[s,e]),d.jsx(j.select,{...t,style:{...it,...t.style},ref:c,defaultValue:e})});Je.displayName=Ft;function et(r){return r===""||r===void 0}function tt(r){const e=dt(r),t=i.useRef(""),o=i.useRef(0),n=i.useCallback(s=>{const l=t.current+s;e(l),(function a(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>a(""),1e3))})(l)},[e]),c=i.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return i.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,c]}function ot(r,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,c=t?r.indexOf(t):-1;let s=Wt(r,Math.max(c,0));n.length===1&&(s=s.filter(u=>u!==t));const a=s.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return a!==t?a:void 0}function Wt(r,e){return r.map((t,o)=>r[(e+o)%r.length])}var Kt=je,$t=Ae,Gt=De,Yt=ke,qt=Le,Xt=Be,Zt=Ue,Qt=$e,Jt=Ge,eo=qe,to=Xe,oo=Ze;function io(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Kt,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function uo(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Gt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(r){const e=ee.c(13);let t,o,n,c;e[0]!==r?({className:o,size:c,children:t,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c):(t=e[1],o=e[2],n=e[3],c=e[4]);const s=c===void 0?"default":c;let l;e[5]!==o?(l=oe("data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-lg bg-background px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[2px] card-shadow disabled:opacity-50 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=xs]:h-6 data-[size=xs]:px-2.5 data-[size=xs]:py-1.5 data-[size=xs]:rounded-lg *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=d.jsx(Yt,{asChild:!0,children:d.jsx(Re,{className:"size-4 opacity-50"})}),e[7]=a):a=e[7];let u;return e[8]!==t||e[9]!==n||e[10]!==s||e[11]!==l?(u=d.jsxs($t,{"data-slot":"select-trigger","data-size":s,className:l,...n,children:[t,a]}),e[8]=t,e[9]=n,e[10]=s,e[11]=l,e[12]=u):u=e[12],u}function fo(r){const e=ee.c(25);let t,o,n,c,s;e[0]!==r?({className:o,children:t,position:c,hideScrollButtons:s,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c,e[5]=s):(t=e[1],o=e[2],n=e[3],c=e[4],s=e[5]);const l=c===void 0?"popper":c,a=s===void 0?!1:s,u=l==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let h;e[6]!==o||e[7]!==u?(h=oe("notranslate bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=h):h=e[8];let v;e[9]!==a?(v=!a&&d.jsx(no,{}),e[9]=a,e[10]=v):v=e[10];const I=l==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let w;e[11]!==I?(w=oe("p-1",I),e[11]=I,e[12]=w):w=e[12];let S;e[13]!==t||e[14]!==w?(S=d.jsx(Zt,{className:w,children:t}),e[13]=t,e[14]=w,e[15]=S):S=e[15];let p;e[16]!==a?(p=!a&&d.jsx(ro,{}),e[16]=a,e[17]=p):p=e[17];let g;return e[18]!==l||e[19]!==n||e[20]!==h||e[21]!==v||e[22]!==S||e[23]!==p?(g=d.jsx(qt,{children:d.jsxs(Xt,{"data-slot":"select-content",translate:"no",className:h,position:l,...n,children:[v,S,p]})}),e[18]=l,e[19]=n,e[20]=h,e[21]=v,e[22]=S,e[23]=p,e[24]=g):g=e[24],g}function mo(r){const e=ee.c(16);let t,o,n,c;e[0]!==r?({className:o,children:t,hideCheck:c,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c):(t=e[1],o=e[2],n=e[3],c=e[4]);const s=c===void 0?!1:c;let l;e[5]!==o?(l=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]!==s?(a=!s&&d.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:d.jsx(eo,{children:d.jsx(wt,{className:"size-4"})})}),e[7]=s,e[8]=a):a=e[8];let u;e[9]!==t?(u=d.jsx(Jt,{children:t}),e[9]=t,e[10]=u):u=e[10];let h;return e[11]!==n||e[12]!==l||e[13]!==a||e[14]!==u?(h=d.jsxs(Qt,{"data-slot":"select-item",className:l,...n,children:[a,u]}),e[11]=n,e[12]=l,e[13]=a,e[14]=u,e[15]=h):h=e[15],h}function no(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=d.jsx(Ct,{className:"size-4"}),e[5]=c):c=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(to,{"data-slot":"select-scroll-up-button",className:n,...o,children:c}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}function ro(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=d.jsx(Re,{className:"size-4"}),e[5]=c):c=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(oo,{"data-slot":"select-scroll-down-button",className:n,...o,children:c}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}export{io as S,po as a,uo as b,fo as c,mo as d,Ne as e};
1
+ import{r as i,bi as nt,bg as Pe,j as d,dK as rt,bk as Ie,bh as k,dL as st,bd as j,bj as N,cs as $,dM as lt,aC as _e,dN as Ee,be as at,cj as ct,dO as it,cu as dt,dP as ut,dQ as pt,dR as ft,dS as mt,dT as ht,bf as gt,dU as vt,dV as xt,dW as St,c as ee,n as oe}from"./index-DO5YRMF2.js";import{i as wt}from"./Check-DsSX1qno.js";import{t as Re}from"./ChevronDown-3Y-CRZZD.js";import{n as Ct}from"./ChevronUp-BQkKayQd.js";function Ne(r,[e,t]){return Math.min(t,Math.max(e,r))}var yt=[" ","Enter","ArrowUp","ArrowDown"],bt=[" ","Enter"],Q="Select",[de,ue,It]=at(Q),[ne]=gt(Q,[It,Ee]),pe=Ee(),[Tt,G]=ne(Q),[Pt,Nt]=ne(Q),je=r=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:c,value:s,defaultValue:l,onValueChange:a,dir:u,name:h,autoComplete:v,disabled:I,required:w,form:S}=r,p=pe(e),[g,C]=i.useState(null),[m,x]=i.useState(null),[U,M]=i.useState(!1),re=nt(u),[_,O]=Pe({prop:o,defaultProp:n??!1,onChange:c,caller:Q}),[F,q]=Pe({prop:s,defaultProp:l,onChange:a,caller:Q}),L=i.useRef(null),B=g?S||!!g.closest("form"):!0,[W,V]=i.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return d.jsx(rt,{...p,children:d.jsxs(Tt,{required:w,scope:e,trigger:g,onTriggerChange:C,valueNode:m,onValueNodeChange:x,valueNodeHasChildren:U,onValueNodeHasChildrenChange:M,contentId:Ie(),value:F,onValueChange:q,open:_,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:I,children:[d.jsx(de.Provider,{scope:e,children:d.jsx(Pt,{scope:r.__scopeSelect,onNativeOptionAdd:i.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:i.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?d.jsxs(Je,{"aria-hidden":!0,required:w,tabIndex:-1,name:h,autoComplete:v,value:F,onChange:E=>q(E.target.value),disabled:I,form:S,children:[F===void 0?d.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};je.displayName=Q;var Me="SelectTrigger",Ae=i.forwardRef((r,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=r,c=pe(t),s=G(Me,t),l=s.disabled||o,a=k(e,s.onTriggerChange),u=ue(t),h=i.useRef("touch"),[v,I,w]=tt(p=>{const g=u().filter(x=>!x.disabled),C=g.find(x=>x.value===s.value),m=ot(g,p,C);m!==void 0&&s.onValueChange(m.value)}),S=p=>{l||(s.onOpenChange(!0),w()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return d.jsx(st,{asChild:!0,...c,children:d.jsx(j.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":et(s.value)?"":void 0,...n,ref:a,onClick:N(n.onClick,p=>{p.currentTarget.focus(),h.current!=="mouse"&&S(p)}),onPointerDown:N(n.onPointerDown,p=>{h.current=p.pointerType;const g=p.target;g.hasPointerCapture(p.pointerId)&&g.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:N(n.onKeyDown,p=>{const g=v.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&I(p.key),!(g&&p.key===" ")&&yt.includes(p.key)&&(S(),p.preventDefault())})})})});Ae.displayName=Me;var Oe="SelectValue",De=i.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,children:c,placeholder:s="",...l}=r,a=G(Oe,t),{onValueNodeHasChildrenChange:u}=a,h=c!==void 0,v=k(e,a.onValueNodeChange);return $(()=>{u(h)},[u,h]),d.jsx(j.span,{...l,ref:v,style:{pointerEvents:"none"},children:et(a.value)?d.jsx(d.Fragment,{children:s}):c})});De.displayName=Oe;var _t="SelectIcon",ke=i.forwardRef((r,e)=>{const{__scopeSelect:t,children:o,...n}=r;return d.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});ke.displayName=_t;var Et="SelectPortal",Le=r=>d.jsx(lt,{asChild:!0,...r});Le.displayName=Et;var J="SelectContent",Be=i.forwardRef((r,e)=>{const t=G(J,r.__scopeSelect),[o,n]=i.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const c=o;return c?_e.createPortal(d.jsx(Ve,{scope:r.__scopeSelect,children:d.jsx(de.Slot,{scope:r.__scopeSelect,children:d.jsx("div",{children:r.children})})}),c):null}return d.jsx(He,{...r,ref:e})});Be.displayName=J;var A=10,[Ve,Y]=ne(J),Rt="SelectContentImpl",jt=vt("SelectContent.RemoveScroll"),He=i.forwardRef((r,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:c,onPointerDownOutside:s,side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:v,collisionBoundary:I,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:g,...C}=r,m=G(J,t),[x,U]=i.useState(null),[M,re]=i.useState(null),_=k(e,f=>U(f)),[O,F]=i.useState(null),[q,L]=i.useState(null),B=ue(t),[W,V]=i.useState(!1),H=i.useRef(!1);i.useEffect(()=>{if(x)return ut(x)},[x]),pt();const E=i.useCallback(f=>{const[T,...R]=B().map(P=>P.ref.current),[y]=R.slice(-1),b=document.activeElement;for(const P of f)if(P===b||(P?.scrollIntoView({block:"nearest"}),P===T&&M&&(M.scrollTop=0),P===y&&M&&(M.scrollTop=M.scrollHeight),P?.focus(),document.activeElement!==b))return},[B,M]),D=i.useCallback(()=>E([O,x]),[E,O,x]);i.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=m;i.useEffect(()=>{if(x){let f={x:0,y:0};const T=y=>{f={x:Math.abs(Math.round(y.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(y.pageY)-(K.current?.y??0))}},R=y=>{f.x<=10&&f.y<=10?y.preventDefault():x.contains(y.target)||z(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,z,K]),i.useEffect(()=>{const f=()=>z(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[z]);const[fe,ae]=tt(f=>{const T=B().filter(b=>!b.disabled),R=T.find(b=>b.ref.current===document.activeElement),y=ot(T,f,R);y&&setTimeout(()=>y.ref.current.focus())}),me=i.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&(F(f),y&&(H.current=!0))},[m.value]),he=i.useCallback(()=>x?.focus(),[x]),te=i.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&L(f)},[m.value]),ce=o==="popper"?Se:ze,se=ce===Se?{side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:v,collisionBoundary:I,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:g}:{};return d.jsx(Ve,{scope:t,content:x,viewport:M,onViewportChange:re,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:d.jsx(ft,{as:jt,allowPinchZoom:!0,children:d.jsx(mt,{asChild:!0,trapped:m.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:N(n,f=>{m.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:d.jsx(ht,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:c,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:d.jsx(ce,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:f=>f.preventDefault(),...C,...se,onPlaced:()=>V(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:N(C.onKeyDown,f=>{const T=f.ctrlKey||f.altKey||f.metaKey;if(f.key==="Tab"&&f.preventDefault(),!T&&f.key.length===1&&ae(f.key),["ArrowUp","ArrowDown","Home","End"].includes(f.key)){let y=B().filter(b=>!b.disabled).map(b=>b.ref.current);if(["ArrowUp","End"].includes(f.key)&&(y=y.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const b=f.target,P=y.indexOf(b);y=y.slice(P+1)}setTimeout(()=>E(y)),f.preventDefault()}})})})})})})});He.displayName=Rt;var Mt="SelectItemAlignedPosition",ze=i.forwardRef((r,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=r,c=G(J,t),s=Y(J,t),[l,a]=i.useState(null),[u,h]=i.useState(null),v=k(e,_=>h(_)),I=ue(t),w=i.useRef(!1),S=i.useRef(!0),{viewport:p,selectedItem:g,selectedItemText:C,focusSelectedItem:m}=s,x=i.useCallback(()=>{if(c.trigger&&c.valueNode&&l&&u&&p&&g&&C){const _=c.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),F=c.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(c.dir!=="rtl"){const b=q.left-O.left,P=F.left-b,X=_.left-P,Z=_.width+X,ge=Math.max(Z,O.width),ve=window.innerWidth-A,xe=Ne(P,[A,Math.max(A,ve-ge)]);l.style.minWidth=Z+"px",l.style.left=xe+"px"}else{const b=O.right-q.right,P=window.innerWidth-F.right-b,X=window.innerWidth-_.right-P,Z=_.width+X,ge=Math.max(Z,O.width),ve=window.innerWidth-A,xe=Ne(P,[A,Math.max(A,ve-ge)]);l.style.minWidth=Z+"px",l.style.right=xe+"px"}const L=I(),B=window.innerHeight-A*2,W=p.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),z=parseInt(V.paddingBottom,10),K=H+E+W+z+D,fe=Math.min(g.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=_.top+_.height/2-A,ce=B-te,se=g.offsetHeight/2,f=g.offsetTop+se,T=H+E+f,R=K-T;if(T<=te){const b=L.length>0&&g===L[L.length-1].ref.current;l.style.bottom="0px";const P=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ce,se+(b?he:0)+P+D),Z=T+X;l.style.height=Z+"px"}else{const b=L.length>0&&g===L[0].ref.current;l.style.top="0px";const X=Math.max(te,H+p.offsetTop+(b?me:0)+se)+R;l.style.height=X+"px",p.scrollTop=T-te+p.offsetTop}l.style.margin=`${A}px 0`,l.style.minHeight=fe+"px",l.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>w.current=!0)}},[I,c.trigger,c.valueNode,l,u,p,g,C,c.dir,o]);$(()=>x(),[x]);const[U,M]=i.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=i.useCallback(_=>{_&&S.current===!0&&(x(),m?.(),S.current=!1)},[x,m]);return d.jsx(Ot,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:w,onScrollButtonChange:re,children:d.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:U},children:d.jsx(j.div,{...n,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});ze.displayName=Mt;var At="SelectPopperPosition",Se=i.forwardRef((r,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...c}=r,s=pe(t);return d.jsx(xt,{...s,...c,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...c.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=At;var[Ot,Te]=ne(J,{}),we="SelectViewport",Ue=i.forwardRef((r,e)=>{const{__scopeSelect:t,nonce:o,...n}=r,c=Y(we,t),s=Te(we,t),l=k(e,c.onViewportChange),a=i.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),d.jsx(de.Slot,{scope:t,children:d.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:N(n.onScroll,u=>{const h=u.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:I}=s;if(I?.current&&v){const w=Math.abs(a.current-h.scrollTop);if(w>0){const S=window.innerHeight-A*2,p=parseFloat(v.style.minHeight),g=parseFloat(v.style.height),C=Math.max(p,g);if(C<S){const m=C+w,x=Math.min(S,m),U=m-x;v.style.height=x+"px",v.style.bottom==="0px"&&(h.scrollTop=U>0?U:0,v.style.justifyContent="flex-end")}}}a.current=h.scrollTop})})})]})});Ue.displayName=we;var Fe="SelectGroup",[Dt,kt]=ne(Fe),Lt=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=Ie();return d.jsx(Dt,{scope:t,id:n,children:d.jsx(j.div,{role:"group","aria-labelledby":n,...o,ref:e})})});Lt.displayName=Fe;var We="SelectLabel",Bt=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=kt(We,t);return d.jsx(j.div,{id:n.id,...o,ref:e})});Bt.displayName=We;var ie="SelectItem",[Vt,Ke]=ne(ie),$e=i.forwardRef((r,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:c,...s}=r,l=G(ie,t),a=Y(ie,t),u=l.value===o,[h,v]=i.useState(c??""),[I,w]=i.useState(!1),S=k(e,m=>a.itemRefCallback?.(m,o,n)),p=Ie(),g=i.useRef("touch"),C=()=>{n||(l.onValueChange(o),l.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(Vt,{scope:t,value:o,disabled:n,textId:p,isSelected:u,onItemTextChange:i.useCallback(m=>{v(x=>x||(m?.textContent??"").trim())},[]),children:d.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:h,children:d.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":I?"":void 0,"aria-selected":u&&I,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...s,ref:S,onFocus:N(s.onFocus,()=>w(!0)),onBlur:N(s.onBlur,()=>w(!1)),onClick:N(s.onClick,()=>{g.current!=="mouse"&&C()}),onPointerUp:N(s.onPointerUp,()=>{g.current==="mouse"&&C()}),onPointerDown:N(s.onPointerDown,m=>{g.current=m.pointerType}),onPointerMove:N(s.onPointerMove,m=>{g.current=m.pointerType,n?a.onItemLeave?.():g.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:N(s.onPointerLeave,m=>{m.currentTarget===document.activeElement&&a.onItemLeave?.()}),onKeyDown:N(s.onKeyDown,m=>{a.searchRef?.current!==""&&m.key===" "||(bt.includes(m.key)&&C(),m.key===" "&&m.preventDefault())})})})})});$e.displayName=ie;var le="SelectItemText",Ge=i.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,...c}=r,s=G(le,t),l=Y(le,t),a=Ke(le,t),u=Nt(le,t),[h,v]=i.useState(null),I=k(e,C=>v(C),a.onItemTextChange,C=>l.itemTextRefCallback?.(C,a.value,a.disabled)),w=h?.textContent,S=i.useMemo(()=>d.jsx("option",{value:a.value,disabled:a.disabled,children:w},a.value),[a.disabled,a.value,w]),{onNativeOptionAdd:p,onNativeOptionRemove:g}=u;return $(()=>(p(S),()=>g(S)),[p,g,S]),d.jsxs(d.Fragment,{children:[d.jsx(j.span,{id:a.textId,...c,ref:I}),a.isSelected&&s.valueNode&&!s.valueNodeHasChildren?_e.createPortal(c.children,s.valueNode):null]})});Ge.displayName=le;var Ye="SelectItemIndicator",qe=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return Ke(Ye,t).isSelected?d.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});qe.displayName=Ye;var Ce="SelectScrollUpButton",Xe=i.forwardRef((r,e)=>{const t=Y(Ce,r.__scopeSelect),o=Te(Ce,r.__scopeSelect),[n,c]=i.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollTop>0;c(u)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Qe,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop-a.offsetHeight)}}):null});Xe.displayName=Ce;var ye="SelectScrollDownButton",Ze=i.forwardRef((r,e)=>{const t=Y(ye,r.__scopeSelect),o=Te(ye,r.__scopeSelect),[n,c]=i.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollHeight-a.clientHeight,h=Math.ceil(a.scrollTop)<u;c(h)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Qe,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop+a.offsetHeight)}}):null});Ze.displayName=ye;var Qe=i.forwardRef((r,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=r,c=Y("SelectScrollButton",t),s=i.useRef(null),l=ue(t),a=i.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return i.useEffect(()=>()=>a(),[a]),$(()=>{l().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),d.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:N(n.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:N(n.onPointerMove,()=>{c.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:N(n.onPointerLeave,()=>{a()})})}),Ht="SelectSeparator",zt=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return d.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});zt.displayName=Ht;var be="SelectArrow",Ut=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=pe(t),c=G(be,t),s=Y(be,t);return c.open&&s.position==="popper"?d.jsx(St,{...n,...o,ref:e}):null});Ut.displayName=be;var Ft="SelectBubbleInput",Je=i.forwardRef(({__scopeSelect:r,value:e,...t},o)=>{const n=i.useRef(null),c=k(o,n),s=ct(e);return i.useEffect(()=>{const l=n.current;if(!l)return;const a=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(a,"value").set;if(s!==e&&h){const v=new Event("change",{bubbles:!0});h.call(l,e),l.dispatchEvent(v)}},[s,e]),d.jsx(j.select,{...t,style:{...it,...t.style},ref:c,defaultValue:e})});Je.displayName=Ft;function et(r){return r===""||r===void 0}function tt(r){const e=dt(r),t=i.useRef(""),o=i.useRef(0),n=i.useCallback(s=>{const l=t.current+s;e(l),(function a(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>a(""),1e3))})(l)},[e]),c=i.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return i.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,c]}function ot(r,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,c=t?r.indexOf(t):-1;let s=Wt(r,Math.max(c,0));n.length===1&&(s=s.filter(u=>u!==t));const a=s.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return a!==t?a:void 0}function Wt(r,e){return r.map((t,o)=>r[(e+o)%r.length])}var Kt=je,$t=Ae,Gt=De,Yt=ke,qt=Le,Xt=Be,Zt=Ue,Qt=$e,Jt=Ge,eo=qe,to=Xe,oo=Ze;function io(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Kt,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function uo(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Gt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(r){const e=ee.c(13);let t,o,n,c;e[0]!==r?({className:o,size:c,children:t,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c):(t=e[1],o=e[2],n=e[3],c=e[4]);const s=c===void 0?"default":c;let l;e[5]!==o?(l=oe("data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-lg bg-background px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[2px] card-shadow disabled:opacity-50 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=xs]:h-6 data-[size=xs]:px-2.5 data-[size=xs]:py-1.5 data-[size=xs]:rounded-lg *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=d.jsx(Yt,{asChild:!0,children:d.jsx(Re,{className:"size-4 opacity-50"})}),e[7]=a):a=e[7];let u;return e[8]!==t||e[9]!==n||e[10]!==s||e[11]!==l?(u=d.jsxs($t,{"data-slot":"select-trigger","data-size":s,className:l,...n,children:[t,a]}),e[8]=t,e[9]=n,e[10]=s,e[11]=l,e[12]=u):u=e[12],u}function fo(r){const e=ee.c(25);let t,o,n,c,s;e[0]!==r?({className:o,children:t,position:c,hideScrollButtons:s,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c,e[5]=s):(t=e[1],o=e[2],n=e[3],c=e[4],s=e[5]);const l=c===void 0?"popper":c,a=s===void 0?!1:s,u=l==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let h;e[6]!==o||e[7]!==u?(h=oe("notranslate bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=h):h=e[8];let v;e[9]!==a?(v=!a&&d.jsx(no,{}),e[9]=a,e[10]=v):v=e[10];const I=l==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let w;e[11]!==I?(w=oe("p-1",I),e[11]=I,e[12]=w):w=e[12];let S;e[13]!==t||e[14]!==w?(S=d.jsx(Zt,{className:w,children:t}),e[13]=t,e[14]=w,e[15]=S):S=e[15];let p;e[16]!==a?(p=!a&&d.jsx(ro,{}),e[16]=a,e[17]=p):p=e[17];let g;return e[18]!==l||e[19]!==n||e[20]!==h||e[21]!==v||e[22]!==S||e[23]!==p?(g=d.jsx(qt,{children:d.jsxs(Xt,{"data-slot":"select-content",translate:"no",className:h,position:l,...n,children:[v,S,p]})}),e[18]=l,e[19]=n,e[20]=h,e[21]=v,e[22]=S,e[23]=p,e[24]=g):g=e[24],g}function mo(r){const e=ee.c(16);let t,o,n,c;e[0]!==r?({className:o,children:t,hideCheck:c,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c):(t=e[1],o=e[2],n=e[3],c=e[4]);const s=c===void 0?!1:c;let l;e[5]!==o?(l=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]!==s?(a=!s&&d.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:d.jsx(eo,{children:d.jsx(wt,{className:"size-4"})})}),e[7]=s,e[8]=a):a=e[8];let u;e[9]!==t?(u=d.jsx(Jt,{children:t}),e[9]=t,e[10]=u):u=e[10];let h;return e[11]!==n||e[12]!==l||e[13]!==a||e[14]!==u?(h=d.jsxs(Qt,{"data-slot":"select-item",className:l,...n,children:[a,u]}),e[11]=n,e[12]=l,e[13]=a,e[14]=u,e[15]=h):h=e[15],h}function no(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=d.jsx(Ct,{className:"size-4"}),e[5]=c):c=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(to,{"data-slot":"select-scroll-up-button",className:n,...o,children:c}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}function ro(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=d.jsx(Re,{className:"size-4"}),e[5]=c):c=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(oo,{"data-slot":"select-scroll-down-button",className:n,...o,children:c}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}export{io as S,po as a,uo as b,fo as c,mo as d,Ne as e};
@@ -1,4 +1,4 @@
1
- import{c as q,av as Se,b as ie,e as ye,t as ne,r as B,aC as mt,j as i,d6 as Ee,d7 as Oe,d8 as We,H as ge,p as ke,ap as Ve,ao as He,ak as qe,am as be,K as ce,B as oe,q as le,n as re,o as ft,Y as ee,d as pt,E as xt,D as gt,a5 as vt}from"./index-BUry0fVo.js";import{c as Ye,e as Ge,d as Xe,a as bt,b as Qe,h as yt,D as jt}from"./dialog-29-_Zj5P.js";import{d as St,b as Nt,a as wt,D as kt}from"./drawer-B5GprU2X.js";import{u as Je}from"./chat-context-Dw8PIlGq.js";import{C as _t}from"./checkbox-D6PhoM6C.js";import{I as xe}from"./input-BFe0Oo8v.js";import{S as Ct,a as It,b as Mt,c as Et,d as Ot}from"./select-BadagpiW.js";import{i as Ze}from"./ArrowLeft-DkgXiBNy.js";import{i as At}from"./ChevronSelectorVertical-CSVczE2B.js";import{i as Pt}from"./Key01-DrEAOsuD.js";import{i as et,b as Tt,a as Lt,s as zt}from"./Settings02-DCCuKvtp.js";import{i as tt}from"./SearchMd-C9GQ2km1.js";import{f as _e,u as Ft,b as Rt}from"./use-ai-providers-CZwP8dmM.js";import{g as Ce}from"./ai-providers-logos-DD3qZ33J.js";import{i as Ae}from"./Monitor01-1xXq2IPx.js";import{i as Kt}from"./AlertCircle-DZFu44wM.js";import{S as Pe}from"./spinner-BWvBZ6qE.js";import{i as Dt}from"./ChevronRight-DMlKw5yi.js";import{A as $t}from"./avatar-B_bJ6wU0.js";import{s as st}from"./Eye-C7GPYyDb.js";import{i as Ut,a as Bt,D as Wt}from"./tab-id-DitH4xVB.js";import{u as Vt}from"./use-is-desktop-app-BNujXJc_.js";import{c as Ht,a as qt,i as Yt}from"./Tool01-C4zZsyps.js";import{t as Te}from"./ChevronDown-tpHSHuoX.js";import{t as Gt}from"./Stars01-CC06iPhj.js";function zi(n,e){const t=q.c(9),s=Se(),o=ie();let l;t[0]!==s||t[1]!==n?(l=async()=>{const{url:h}=await s.call(n,{});return h},t[0]=s,t[1]=n,t[2]=l):l=t[2];let a;t[3]!==e||t[4]!==o?(a=h=>ne.error(o(e,{message:h.message})),t[3]=e,t[4]=o,t[5]=a):a=t[5];let r;return t[6]!==l||t[7]!==a?(r={mutationFn:l,onSuccess:Xt,onError:a},t[6]=l,t[7]=a,t[8]=r):r=t[8],ye(r)}function Xt(n){return window.open(n,"_blank","noopener,noreferrer")}function pe(n,e,t){let s=t.initialDeps??[],o,l=!0;function a(){var r,h,d;let c;t.key&&((r=t.debug)!=null&&r.call(t))&&(c=Date.now());const f=n();if(!(f.length!==s.length||f.some((m,b)=>s[b]!==m)))return o;s=f;let u;if(t.key&&((h=t.debug)!=null&&h.call(t))&&(u=Date.now()),o=e(...f),t.key&&((d=t.debug)!=null&&d.call(t))){const m=Math.round((Date.now()-c)*100)/100,b=Math.round((Date.now()-u)*100)/100,w=b/16,N=(j,_)=>{for(j=String(j);j.length<_;)j=" "+j;return j};console.info(`%c⏱ ${N(b,5)} /${N(m,5)} ms`,`
1
+ import{c as q,av as Se,b as ie,e as ye,t as ne,r as B,aC as mt,j as i,d6 as Ee,d7 as Oe,d8 as We,H as ge,p as ke,ap as Ve,ao as He,ak as qe,am as be,K as ce,B as oe,q as le,n as re,o as ft,Y as ee,d as pt,E as xt,D as gt,a5 as vt}from"./index-DO5YRMF2.js";import{c as Ye,e as Ge,d as Xe,a as bt,b as Qe,h as yt,D as jt}from"./dialog-DQcS-86l.js";import{d as St,b as Nt,a as wt,D as kt}from"./drawer-BxoRaw4y.js";import{u as Je}from"./chat-context-C0CACiFo.js";import{C as _t}from"./checkbox-BM-8xu4l.js";import{I as xe}from"./input-C_KfEpTM.js";import{S as Ct,a as It,b as Mt,c as Et,d as Ot}from"./select-BbTCc1n4.js";import{i as Ze}from"./ArrowLeft-yXWZTd3K.js";import{i as At}from"./ChevronSelectorVertical-DOBGpkVA.js";import{i as Pt}from"./Key01-BYJxbFiz.js";import{i as et,b as Tt,a as Lt,s as zt}from"./Settings02-CJtdruE3.js";import{i as tt}from"./SearchMd-6mUsS-Y7.js";import{f as _e,u as Ft,b as Rt}from"./use-ai-providers-Bivp-YWu.js";import{g as Ce}from"./ai-providers-logos-DD3qZ33J.js";import{i as Ae}from"./Monitor01-59Ug2myj.js";import{i as Kt}from"./AlertCircle-BKG7D-9N.js";import{S as Pe}from"./spinner-DDmc-ww2.js";import{i as Dt}from"./ChevronRight-Buq1yopX.js";import{A as $t}from"./avatar-C3PwcJq8.js";import{s as st}from"./Eye-BYmVnsHQ.js";import{i as Ut,a as Bt,D as Wt}from"./tab-id-gkLZKZzs.js";import{u as Vt}from"./use-is-desktop-app-BNujXJc_.js";import{c as Ht,a as qt,i as Yt}from"./Tool01-BdWMT188.js";import{t as Te}from"./ChevronDown-3Y-CRZZD.js";import{t as Gt}from"./Stars01-Bv4MJS3u.js";function zi(n,e){const t=q.c(9),s=Se(),o=ie();let l;t[0]!==s||t[1]!==n?(l=async()=>{const{url:h}=await s.call(n,{});return h},t[0]=s,t[1]=n,t[2]=l):l=t[2];let a;t[3]!==e||t[4]!==o?(a=h=>ne.error(o(e,{message:h.message})),t[3]=e,t[4]=o,t[5]=a):a=t[5];let r;return t[6]!==l||t[7]!==a?(r={mutationFn:l,onSuccess:Xt,onError:a},t[6]=l,t[7]=a,t[8]=r):r=t[8],ye(r)}function Xt(n){return window.open(n,"_blank","noopener,noreferrer")}function pe(n,e,t){let s=t.initialDeps??[],o,l=!0;function a(){var r,h,d;let c;t.key&&((r=t.debug)!=null&&r.call(t))&&(c=Date.now());const f=n();if(!(f.length!==s.length||f.some((m,b)=>s[b]!==m)))return o;s=f;let u;if(t.key&&((h=t.debug)!=null&&h.call(t))&&(u=Date.now()),o=e(...f),t.key&&((d=t.debug)!=null&&d.call(t))){const m=Math.round((Date.now()-c)*100)/100,b=Math.round((Date.now()-u)*100)/100,w=b/16,N=(j,_)=>{for(j=String(j);j.length<_;)j=" "+j;return j};console.info(`%c⏱ ${N(b,5)} /${N(m,5)} ms`,`
2
2
  font-size: .6rem;
3
3
  font-weight: bold;
4
4
  color: hsl(${Math.max(0,Math.min(120-120*w,120))}deg 100% 31%);`,t?.key)}return t?.onChange&&!(l&&t.skipInitialOnChange)&&t.onChange(o),l=!1,o}return a.updateDeps=r=>{s=r},a}function Le(n,e){if(n===void 0)throw new Error("Unexpected undefined");return n}const Qt=(n,e)=>Math.abs(n-e)<1.01,Jt=(n,e,t)=>{let s;return function(...o){n.clearTimeout(s),s=n.setTimeout(()=>e.apply(this,o),t)}},ze=n=>{const{offsetWidth:e,offsetHeight:t}=n;return{width:e,height:t}},Zt=n=>n,es=n=>{const e=Math.max(n.startIndex-n.overscan,0),t=Math.min(n.endIndex+n.overscan,n.count-1),s=[];for(let o=e;o<=t;o++)s.push(o);return s},ts=(n,e)=>{const t=n.scrollElement;if(!t)return;const s=n.targetWindow;if(!s)return;const o=a=>{const{width:r,height:h}=a;e({width:Math.round(r),height:Math.round(h)})};if(o(ze(t)),!s.ResizeObserver)return()=>{};const l=new s.ResizeObserver(a=>{const r=()=>{const h=a[0];if(h?.borderBoxSize){const d=h.borderBoxSize[0];if(d){o({width:d.inlineSize,height:d.blockSize});return}}o(ze(t))};n.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return l.observe(t,{box:"border-box"}),()=>{l.unobserve(t)}},Fe={passive:!0},Re=typeof window>"u"?!0:"onscrollend"in window,ss=(n,e)=>{const t=n.scrollElement;if(!t)return;const s=n.targetWindow;if(!s)return;let o=0;const l=n.options.useScrollendEvent&&Re?()=>{}:Jt(s,()=>{e(o,!1)},n.options.isScrollingResetDelay),a=c=>()=>{const{horizontal:f,isRtl:p}=n.options;o=f?t.scrollLeft*(p&&-1||1):t.scrollTop,l(),e(o,c)},r=a(!0),h=a(!1);t.addEventListener("scroll",r,Fe);const d=n.options.useScrollendEvent&&Re;return d&&t.addEventListener("scrollend",h,Fe),()=>{t.removeEventListener("scroll",r),d&&t.removeEventListener("scrollend",h)}},is=(n,e,t)=>{if(e?.borderBoxSize){const s=e.borderBoxSize[0];if(s)return Math.round(s[t.options.horizontal?"inlineSize":"blockSize"])}return n[t.options.horizontal?"offsetWidth":"offsetHeight"]},ns=(n,{adjustments:e=0,behavior:t},s)=>{var o,l;const a=n+e;(l=(o=s.scrollElement)==null?void 0:o.scrollTo)==null||l.call(o,{[s.options.horizontal?"left":"top"]:a,behavior:t})};class ls{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,s,o;return((o=(s=(t=this.targetWindow)==null?void 0:t.performance)==null?void 0:s.now)==null?void 0:o.call(s))??Date.now()},this.observer=(()=>{let t=null;const s=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(o=>{o.forEach(l=>{const a=()=>{const r=l.target,h=this.indexFromElement(r);if(!r.isConnected){this.observer.unobserve(r);return}this.shouldMeasureDuringScroll(h)&&this.resizeItem(h,this.options.measureElement(r,l,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var o;(o=s())==null||o.disconnect(),t=null},observe:o=>{var l;return(l=s())==null?void 0:l.observe(o,{box:"border-box"})},unobserve:o=>{var l;return(l=s())==null?void 0:l.unobserve(o)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([s,o])=>{typeof o>"u"&&delete t[s]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Zt,rangeExtractor:es,onChange:()=>{},measureElement:is,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 s,o;(o=(s=this.options).onChange)==null||o.call(s,this,t)},this.maybeNotify=pe(()=>(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 s=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==s){if(this.cleanup(),!s){this.maybeNotify();return}this.scrollElement=s,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(o=>{this.observer.observe(o)}),this.unsubs.push(this.options.observeElementRect(this,o=>{this.scrollRect=o,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(o,l)=>{this.scrollAdjustments=0,this.scrollDirection=l?this.getScrollOffset()<o?"forward":"backward":null,this.scrollOffset=o,this.isScrolling=l,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,s)=>{const o=new Map,l=new Map;for(let a=s-1;a>=0;a--){const r=t[a];if(o.has(r.lane))continue;const h=l.get(r.lane);if(h==null||r.end>h.end?l.set(r.lane,r):r.end<h.end&&o.set(r.lane,!0),o.size===this.options.lanes)break}return l.size===this.options.lanes?Array.from(l.values()).sort((a,r)=>a.end===r.end?a.index-r.index:a.end-r.end)[0]:void 0},this.getMeasurementOptions=pe(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(t,s,o,l,a,r,h)=>(this.prevLanes!==void 0&&this.prevLanes!==r&&(this.lanesChangedFlag=!0),this.prevLanes=r,this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:s,scrollMargin:o,getItemKey:l,enabled:a,lanes:r,laneAssignmentMode:h}),{key:!1}),this.getMeasurements=pe(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:s,scrollMargin:o,getItemKey:l,enabled:a,lanes:r,laneAssignmentMode:h},d)=>{if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const u of this.laneAssignments.keys())u>=t&&this.laneAssignments.delete(u);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(u=>{this.itemSizeCache.set(u.key,u.size)}));const c=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1);const f=this.measurementsCache.slice(0,c),p=new Array(r).fill(void 0);for(let u=0;u<c;u++){const m=f[u];m&&(p[m.lane]=u)}for(let u=c;u<t;u++){const m=l(u),b=this.laneAssignments.get(u);let w,N;const j=h==="estimate"||d.has(m);if(b!==void 0&&this.options.lanes>1){w=b;const k=p[w],x=k!==void 0?f[k]:void 0;N=x?x.end+this.options.gap:s+o}else{const k=this.options.lanes===1?f[u-1]:this.getFurthestMeasurement(f,u);N=k?k.end+this.options.gap:s+o,w=k?k.lane:u%this.options.lanes,this.options.lanes>1&&j&&this.laneAssignments.set(u,w)}const _=d.get(m),I=typeof _=="number"?_:this.options.estimateSize(u),A=N+I;f[u]={index:u,start:N,size:I,end:A,key:m,lane:w},p[w]=u}return this.measurementsCache=f,f},{key:!1,debug:()=>this.options.debug}),this.calculateRange=pe(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,s,o,l)=>this.range=t.length>0&&s>0?os({measurements:t,outerSize:s,scrollOffset:o,lanes:l}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=pe(()=>{let t=null,s=null;const o=this.calculateRange();return o&&(t=o.startIndex,s=o.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,s]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,s]},(t,s,o,l,a)=>l===null||a===null?[]:t({startIndex:l,endIndex:a,overscan:s,count:o}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const s=this.options.indexAttribute,o=t.getAttribute(s);return o?parseInt(o,10):(console.warn(`Missing attribute name '${s}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=t=>{var s;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const o=this.scrollState.index??((s=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:s.index);if(o!==void 0&&this.range){const l=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),a=Math.max(0,o-l),r=Math.min(this.options.count-1,o+l);return t>=a&&t<=r}return!0},this.measureElement=t=>{if(!t){this.elementsCache.forEach((a,r)=>{a.isConnected||(this.observer.unobserve(a),this.elementsCache.delete(r))});return}const s=this.indexFromElement(t),o=this.options.getItemKey(s),l=this.elementsCache.get(o);l!==t&&(l&&this.observer.unobserve(l),this.observer.observe(t),this.elementsCache.set(o,t)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(s)&&this.resizeItem(s,this.options.measureElement(t,void 0,this))},this.resizeItem=(t,s)=>{var o;const l=this.measurementsCache[t];if(!l)return;const a=this.itemSizeCache.get(l.key)??l.size,r=s-a;r!==0&&(((o=this.scrollState)==null?void 0:o.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(l,r,this):l.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=r,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(l.index),this.itemSizeCache=new Map(this.itemSizeCache.set(l.key,s)),this.notify(!1))},this.getVirtualItems=pe(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,s)=>{const o=[];for(let l=0,a=t.length;l<a;l++){const r=t[l],h=s[r];o.push(h)}return o},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const s=this.getMeasurements();if(s.length!==0)return Le(s[it(0,s.length-1,o=>Le(s[o]).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,s,o=0)=>{if(!this.scrollElement)return 0;const l=this.getSize(),a=this.getScrollOffset();s==="auto"&&(s=t>=a+l?"end":"start"),s==="center"?t+=(o-l)/2:s==="end"&&(t-=l);const r=this.getMaxScrollOffset();return Math.max(Math.min(r,t),0)},this.getOffsetForIndex=(t,s="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const o=this.getSize(),l=this.getScrollOffset(),a=this.measurementsCache[t];if(!a)return;if(s==="auto")if(a.end>=l+o-this.options.scrollPaddingEnd)s="end";else if(a.start<=l+this.options.scrollPaddingStart)s="start";else return[l,s];if(s==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),s];const r=s==="end"?a.end+this.options.scrollPaddingEnd:a.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(r,s,a.size),s]},this.scrollToOffset=(t,{align:s="start",behavior:o="auto"}={})=>{const l=this.getOffsetForAlignment(t,s),a=this.now();this.scrollState={index:null,align:s,behavior:o,startedAt:a,lastTargetOffset:l,stableFrames:0},this._scrollToOffset(l,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollToIndex=(t,{align:s="auto",behavior:o="auto"}={})=>{t=Math.max(0,Math.min(t,this.options.count-1));const l=this.getOffsetForIndex(t,s);if(!l)return;const[a,r]=l,h=this.now();this.scrollState={index:t,align:r,behavior:o,startedAt:h,lastTargetOffset:a,stableFrames:0},this._scrollToOffset(a,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollBy=(t,{behavior:s="auto"}={})=>{const o=this.getScrollOffset()+t,l=this.now();this.scrollState={index:null,align:"start",behavior:s,startedAt:l,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var t;const s=this.getMeasurements();let o;if(s.length===0)o=this.options.paddingStart;else if(this.options.lanes===1)o=((t=s[s.length-1])==null?void 0:t.end)??0;else{const l=Array(this.options.lanes).fill(null);let a=s.length-1;for(;a>=0&&l.some(r=>r===null);){const r=s[a];l[r.lane]===null&&(l[r.lane]=r.end),a--}o=Math.max(...l.filter(r=>r!==null))}return Math.max(o-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:s,behavior:o})=>{this.options.scrollToFn(t,{behavior:o,adjustments:s},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 s=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,o=s?s[0]:this.scrollState.lastTargetOffset,l=1,a=o!==this.scrollState.lastTargetOffset;if(!a&&Qt(o,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=l){this.scrollState=null;return}}else this.scrollState.stableFrames=0,a&&(this.scrollState.lastTargetOffset=o,this.scrollState.behavior="auto",this._scrollToOffset(o,{adjustments:void 0,behavior:"auto"}));this.scheduleScrollReconcile()}}const it=(n,e,t,s)=>{for(;n<=e;){const o=(n+e)/2|0,l=t(o);if(l<s)n=o+1;else if(l>s)e=o-1;else return o}return n>0?n-1:0};function os({measurements:n,outerSize:e,scrollOffset:t,lanes:s}){const o=n.length-1,l=h=>n[h].start;if(n.length<=s)return{startIndex:0,endIndex:o};let a=it(0,o,l,t),r=a;if(s===1)for(;r<o&&n[r].end<t+e;)r++;else if(s>1){const h=Array(s).fill(0);for(;r<o&&h.some(c=>c<t+e);){const c=n[r];h[c.lane]=c.end,r++}const d=Array(s).fill(t+e);for(;a>=0&&d.some(c=>c>=t);){const c=n[a];d[c.lane]=c.start,a--}a=Math.max(0,a-a%s),r=Math.min(o,r+(s-1-r%s))}return{startIndex:a,endIndex:r}}const Ke=typeof document<"u"?B.useLayoutEffect:B.useEffect;function rs({useFlushSync:n=!0,...e}){const t=B.useReducer(()=>({}),{})[1],s={...e,onChange:(l,a)=>{var r;n&&a?mt.flushSync(t):t(),(r=e.onChange)==null||r.call(e,l,a)}},[o]=B.useState(()=>new ls(s));return o.setOptions(s),Ke(()=>o._didMount(),[]),Ke(()=>o._willUpdate()),o}function as(n){return rs({observeElementRect:ts,observeElementOffset:ss,scrollToFn:ns,...n})}const nt=[{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 je(n){if(n)return nt.find(e=>e.id===n)}const De=4;function ve(n){const e=q.c(8),{logo:t,name:s,description:o,onClick:l}=n;let a;e[0]!==t||e[1]!==s?(a=t?i.jsx("img",{src:t,alt:s,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):i.jsx($t,{fallback:s.charAt(0),className:"size-8 bg-primary/10 text-primary"}),e[0]=t,e[1]=s,e[2]=a):a=e[2];let r;return e[3]!==o||e[4]!==s||e[5]!==l||e[6]!==a?(r=i.jsx(We,{onClick:l,icon:a,title:s,description:o}),e[3]=o,e[4]=s,e[5]=l,e[6]=a,e[7]=r):r=e[7],r}function lt(n){const e=q.c(38),{providers:t,onSelect:s,onShowAll:o}=n,l=ie();let a;e[0]!==t?(a=t.find(us),e[0]=t,e[1]=a):a=e[1];const r=a;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h={openrouter:0,llmapi:1,anthropic:2,google:3},e[2]=h):h=e[2];const d=h;let c;if(e[3]!==s||e[4]!==t||e[5]!==l){let I;e[7]===Symbol.for("react.memo_cache_sentinel")?(I=(y,E)=>{const z=d[y.id]??Number.MAX_SAFE_INTEGER,P=d[E.id]??Number.MAX_SAFE_INTEGER;return z-P},e[7]=I):I=e[7];const A=t.filter(hs).sort(I);let k;e[8]!==t?(k=t.find(ds),e[8]=t,e[9]=k):k=e[9];const x=k;let S;e[10]===Symbol.for("react.memo_cache_sentinel")?(S=je("openai"),e[10]=S):S=e[10];const C=S;let M;e[11]!==s?(M=y=>i.jsx(ve,{logo:y.logo,name:y.name,description:y.description,onClick:()=>s({kind:"provider",provider:y})},y.id),e[11]=s,e[12]=M):M=e[12];let g;e[13]!==s||e[14]!==x?(g=x&&C?[i.jsx(ve,{logo:C.logo,name:C.name,description:C.description,onClick:()=>s({kind:"openai-compatible",provider:x,preset:C})},C.id)]:[],e[13]=s,e[14]=x,e[15]=g):g=e[15];let v;e[16]!==s||e[17]!==x||e[18]!==l?(v=x?[...nt.filter(cs).map(y=>i.jsx(ve,{logo:y.logo,name:y.name,description:y.description,onClick:()=>s({kind:"openai-compatible",provider:x,preset:y})},y.id)),i.jsx(ve,{logo:x.logo,name:l("settings.aiProviders.customOpenAiCompatible"),description:l("settings.aiProviders.customOpenAiDescription"),onClick:()=>s({kind:"openai-compatible",provider:x,preset:null})},"custom")]:[],e[16]=s,e[17]=x,e[18]=l,e[19]=v):v=e[19],c=[...A.map(M),...g,...v],e[3]=s,e[4]=t,e[5]=l,e[6]=c}else c=e[6];const f=c,p=f.length-De,u=!!o&&p>0;let m;e[20]!==f||e[21]!==u?(m=u?f.slice(0,De):f,e[20]=f,e[21]=u,e[22]=m):m=e[22];const b=m;let w;e[23]!==r||e[24]!==s||e[25]!==l?(w=r&&i.jsx(Ee,{children:i.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:[i.jsx("div",{className:"absolute inset-0 rounded-xl bg-gradient-to-br from-violet-400/5 to-lime-400/5 pointer-events-none"}),i.jsx("p",{className:"text-xs font-medium text-violet-700 dark:text-violet-400 mb-1.5 px-2 pt-2 relative",children:l("settings.aiProviders.recommended")}),i.jsx(Oe,{className:"relative",children:i.jsx(ve,{logo:r.logo,name:r.name,description:r.description,onClick:()=>s({kind:"provider",provider:r})})})]})}),e[23]=r,e[24]=s,e[25]=l,e[26]=w):w=e[26];let N;e[27]!==p||e[28]!==o||e[29]!==u||e[30]!==l?(N=u&&i.jsx(We,{onClick:o,title:l(p===1?"settings.aiProviders.moreProvidersSingular":"settings.aiProviders.moreProvidersPlural",{count:p}),action:i.jsx(Dt,{size:16,className:"text-muted-foreground"})}),e[27]=p,e[28]=o,e[29]=u,e[30]=l,e[31]=N):N=e[31];let j;e[32]!==N||e[33]!==b?(j=i.jsx(Ee,{children:i.jsxs(Oe,{children:[b,N]})}),e[32]=N,e[33]=b,e[34]=j):j=e[34];let _;return e[35]!==w||e[36]!==j?(_=i.jsxs("div",{className:"flex flex-col gap-6",children:[w,j]}),e[35]=w,e[36]=j,e[37]=_):_=e[37],_}function cs(n){return n.id!=="openai"}function ds(n){return n.id==="openai-compatible"}function hs(n){return n.id!=="deco"&&n.id!=="openai-compatible"}function us(n){return n.id==="deco"}function ms(n){return qe({label:be().optional(),apiKey:be().min(1,n)})}function fs(n){const e=q.c(91),{providerId:t,onCancel:s,onSuccess:o}=n,{org:l}=ge(),a=Se(),r=ke(),[h,d]=B.useState(!1),c=ie();let f;e[0]!==c?(f=Ve(ms(c("settings.connectForms.apiKeyRequired"))),e[0]=c,e[1]=f):f=e[1];let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p={label:"",apiKey:""},e[2]=p):p=e[2];let u;e[3]!==f?(u={resolver:f,defaultValues:p},e[3]=f,e[4]=u):u=e[4];const{register:m,handleSubmit:b,formState:w}=He(u),{errors:N}=w;let j;e[5]!==t||e[6]!==a||e[7]!==c?(j=async se=>{await a.call("AI_PROVIDER_KEY_CREATE",{providerId:t,label:se.label||c("settings.connectForms.defaultKeyLabel"),apiKey:se.apiKey})},e[5]=t,e[6]=a,e[7]=c,e[8]=j):j=e[8];let _;e[9]!==o||e[10]!==l||e[11]!==r||e[12]!==c?(_=()=>{r.invalidateQueries({queryKey:ce.aiProviderKeys(l.id)}),r.invalidateQueries({queryKey:ce.aiProviders(l.id)}),ne.success(c("settings.connectForms.keySavedSuccess")),o()},e[9]=o,e[10]=l,e[11]=r,e[12]=c,e[13]=_):_=e[13];let I;e[14]!==c?(I=se=>{ne.error(c("settings.connectForms.failedSaveKey",{error:se.message}))},e[14]=c,e[15]=I):I=e[15];let A;e[16]!==j||e[17]!==_||e[18]!==I?(A={mutationFn:j,onSuccess:_,onError:I},e[16]=j,e[17]=_,e[18]=I,e[19]=A):A=e[19];const{mutate:k,isPending:x,error:S}=ye(A);let C;e[20]!==k?(C=se=>k(se),e[20]=k,e[21]=C):C=e[21];let M;e[22]!==b||e[23]!==C?(M=b(C),e[22]=b,e[23]=C,e[24]=M):M=e[24];let g;e[25]!==c?(g=c("settings.connectForms.labelField"),e[25]=c,e[26]=g):g=e[26];let v;e[27]!==g?(v=i.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:g}),e[27]=g,e[28]=v):v=e[28];let y;e[29]!==c?(y=c("settings.connectForms.labelPlaceholder"),e[29]=c,e[30]=y):y=e[30];let E;e[31]!==m?(E=m("label"),e[31]=m,e[32]=E):E=e[32];let z;e[33]!==y||e[34]!==E?(z=i.jsx(xe,{placeholder:y,...E,className:"h-8 text-sm"}),e[33]=y,e[34]=E,e[35]=z):z=e[35];let P;e[36]!==v||e[37]!==z?(P=i.jsxs("div",{className:"space-y-1",children:[v,z]}),e[36]=v,e[37]=z,e[38]=P):P=e[38];let O;e[39]!==c?(O=c("settings.connectForms.apiKeyField"),e[39]=c,e[40]=O):O=e[40];let T;e[41]!==O?(T=i.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:O}),e[41]=O,e[42]=T):T=e[42];const R=h?"text":"password";let F;e[43]!==m?(F=m("apiKey"),e[43]=m,e[44]=F):F=e[44];let K;e[45]!==R||e[46]!==F?(K=i.jsx(xe,{type:R,placeholder:"sk-...",...F,className:"ph-no-capture h-8 text-sm pr-8"}),e[45]=R,e[46]=F,e[47]=K):K=e[47];let Q;e[48]!==h?(Q=()=>d(!h),e[48]=h,e[49]=Q):Q=e[49];let V;e[50]!==h||e[51]!==c?(V=c(h?"settings.connectForms.hideApiKey":"settings.connectForms.showApiKey"),e[50]=h,e[51]=c,e[52]=V):V=e[52];let Y;e[53]!==h?(Y=h?i.jsx(et,{size:14}):i.jsx(st,{size:14}),e[53]=h,e[54]=Y):Y=e[54];let H;e[55]!==Q||e[56]!==V||e[57]!==Y?(H=i.jsx("button",{type:"button",onClick:Q,"aria-label":V,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:Y}),e[55]=Q,e[56]=V,e[57]=Y,e[58]=H):H=e[58];let J;e[59]!==K||e[60]!==H?(J=i.jsxs("div",{className:"relative",children:[K,H]}),e[59]=K,e[60]=H,e[61]=J):J=e[61];let $;e[62]!==N.apiKey?($=N.apiKey&&i.jsx("p",{className:"text-xs text-destructive",children:N.apiKey.message}),e[62]=N.apiKey,e[63]=$):$=e[63];let U;e[64]!==T||e[65]!==J||e[66]!==$?(U=i.jsxs("div",{className:"space-y-1",children:[T,J,$]}),e[64]=T,e[65]=J,e[66]=$,e[67]=U):U=e[67];let X;e[68]!==S?(X=S&&i.jsx("p",{className:"text-xs text-destructive",children:S.message}),e[68]=S,e[69]=X):X=e[69];let L;e[70]!==c?(L=c("settings.connectForms.cancel"),e[70]=c,e[71]=L):L=e[71];let D;e[72]!==x||e[73]!==s||e[74]!==L?(D=i.jsx(oe,{type:"button",variant:"ghost",size:"sm",onClick:s,disabled:x,children:L}),e[72]=x,e[73]=s,e[74]=L,e[75]=D):D=e[75];let W;e[76]!==x||e[77]!==c?(W=c(x?"settings.connectForms.saving":"settings.connectForms.saveKey"),e[76]=x,e[77]=c,e[78]=W):W=e[78];let G;e[79]!==x||e[80]!==W?(G=i.jsx(oe,{type:"submit",size:"sm",disabled:x,children:W}),e[79]=x,e[80]=W,e[81]=G):G=e[81];let Z;e[82]!==D||e[83]!==G?(Z=i.jsxs(Ye,{children:[D,G]}),e[82]=D,e[83]=G,e[84]=Z):Z=e[84];let te;return e[85]!==M||e[86]!==P||e[87]!==U||e[88]!==X||e[89]!==Z?(te=i.jsxs("form",{onSubmit:M,className:"space-y-3",children:[P,U,X,Z]}),e[85]=M,e[86]=P,e[87]=U,e[88]=X,e[89]=Z,e[90]=te):te=e[90],te}function ps(n){return qe({label:be().optional(),baseUrl:be().min(1,n),apiKey:be().optional()})}function xs(n){const e=q.c(109),{preset:t,onCancel:s,onSuccess:o}=n,{org:l}=ge(),a=Se(),r=ke(),[h,d]=B.useState(!1),c=ie();let f;e[0]!==c?(f=Ve(ps(c("settings.connectForms.baseUrlRequired"))),e[0]=c,e[1]=f):f=e[1];const p=t?.defaultBaseUrl??"";let u;e[2]!==p?(u={label:"",baseUrl:p,apiKey:""},e[2]=p,e[3]=u):u=e[3];let m;e[4]!==f||e[5]!==u?(m={resolver:f,defaultValues:u},e[4]=f,e[5]=u,e[6]=m):m=e[6];const{register:b,handleSubmit:w,formState:N}=He(m),{errors:j}=N;let _;e[7]!==t||e[8]!==a?(_=async ae=>{const ut=JSON.stringify({baseUrl:ae.baseUrl,apiKey:ae.apiKey||""});await a.call("AI_PROVIDER_KEY_CREATE",{providerId:"openai-compatible",label:ae.label||t?.name||ae.baseUrl,apiKey:ut,...t?{presetId:t.id}:{}})},e[7]=t,e[8]=a,e[9]=_):_=e[9];let I;e[10]!==o||e[11]!==l||e[12]!==r||e[13]!==c?(I=()=>{r.invalidateQueries({queryKey:ce.aiProviderKeys(l.id)}),r.invalidateQueries({queryKey:ce.aiProviders(l.id)}),ne.success(c("settings.connectForms.connectionSavedSuccess")),o()},e[10]=o,e[11]=l,e[12]=r,e[13]=c,e[14]=I):I=e[14];let A;e[15]!==c?(A=ae=>{ne.error(c("settings.connectForms.failedSaveConnection",{error:ae.message}))},e[15]=c,e[16]=A):A=e[16];let k;e[17]!==_||e[18]!==I||e[19]!==A?(k={mutationFn:_,onSuccess:I,onError:A},e[17]=_,e[18]=I,e[19]=A,e[20]=k):k=e[20];const{mutate:x,isPending:S,error:C}=ye(k);let M;e[21]!==t||e[22]!==c?(M=t?c("settings.connectForms.labelPlaceholderPreset",{name:t.name}):c("settings.connectForms.labelPlaceholderOpenAiCompatible"),e[21]=t,e[22]=c,e[23]=M):M=e[23];const g=M;let v;e[24]!==t?.baseUrlPlaceholder||e[25]!==c?(v=t?.baseUrlPlaceholder??c("settings.connectForms.baseUrlPlaceholder"),e[24]=t?.baseUrlPlaceholder,e[25]=c,e[26]=v):v=e[26];const y=v;let E;e[27]!==x?(E=ae=>x(ae),e[27]=x,e[28]=E):E=e[28];let z;e[29]!==w||e[30]!==E?(z=w(E),e[29]=w,e[30]=E,e[31]=z):z=e[31];let P;e[32]!==c?(P=c("settings.connectForms.labelField"),e[32]=c,e[33]=P):P=e[33];let O;e[34]!==P?(O=i.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:P}),e[34]=P,e[35]=O):O=e[35];let T;e[36]!==b?(T=b("label"),e[36]=b,e[37]=T):T=e[37];let R;e[38]!==g||e[39]!==T?(R=i.jsx(xe,{placeholder:g,...T,className:"h-8 text-sm"}),e[38]=g,e[39]=T,e[40]=R):R=e[40];let F;e[41]!==O||e[42]!==R?(F=i.jsxs("div",{className:"space-y-1",children:[O,R]}),e[41]=O,e[42]=R,e[43]=F):F=e[43];let K;e[44]!==y||e[45]!==j||e[46]!==t?.defaultBaseUrl||e[47]!==b||e[48]!==c?(K=t?.defaultBaseUrl?i.jsx("input",{type:"hidden",...b("baseUrl")}):i.jsxs("div",{className:"space-y-1",children:[i.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:c("settings.connectForms.baseUrlField")}),i.jsx(xe,{type:"url",placeholder:y,...b("baseUrl"),className:"h-8 text-sm"}),j.baseUrl&&i.jsx("p",{className:"text-xs text-destructive",children:j.baseUrl.message})]}),e[44]=y,e[45]=j,e[46]=t?.defaultBaseUrl,e[47]=b,e[48]=c,e[49]=K):K=e[49];let Q;e[50]!==c?(Q=c("settings.connectForms.apiKeyField"),e[50]=c,e[51]=Q):Q=e[51];let V;e[52]!==t?.apiKeyRecommended||e[53]!==c?(V=t?.apiKeyRecommended?c("settings.connectForms.recommended"):c("settings.connectForms.optional"),e[52]=t?.apiKeyRecommended,e[53]=c,e[54]=V):V=e[54];let Y;e[55]!==V?(Y=i.jsxs("span",{className:"text-muted-foreground/60",children:["(",V,")"]}),e[55]=V,e[56]=Y):Y=e[56];let H;e[57]!==Q||e[58]!==Y?(H=i.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:[Q," ",Y]}),e[57]=Q,e[58]=Y,e[59]=H):H=e[59];const J=h?"text":"password";let $;e[60]!==b?($=b("apiKey"),e[60]=b,e[61]=$):$=e[61];let U;e[62]!==J||e[63]!==$?(U=i.jsx(xe,{type:J,placeholder:"sk-...",...$,className:"ph-no-capture h-8 text-sm pr-8"}),e[62]=J,e[63]=$,e[64]=U):U=e[64];let X;e[65]!==h?(X=()=>d(!h),e[65]=h,e[66]=X):X=e[66];let L;e[67]!==h||e[68]!==c?(L=c(h?"settings.connectForms.hideApiKey":"settings.connectForms.showApiKey"),e[67]=h,e[68]=c,e[69]=L):L=e[69];let D;e[70]!==h?(D=h?i.jsx(et,{size:14}):i.jsx(st,{size:14}),e[70]=h,e[71]=D):D=e[71];let W;e[72]!==X||e[73]!==L||e[74]!==D?(W=i.jsx("button",{type:"button",onClick:X,"aria-label":L,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:D}),e[72]=X,e[73]=L,e[74]=D,e[75]=W):W=e[75];let G;e[76]!==U||e[77]!==W?(G=i.jsxs("div",{className:"relative",children:[U,W]}),e[76]=U,e[77]=W,e[78]=G):G=e[78];let Z;e[79]!==H||e[80]!==G?(Z=i.jsxs("div",{className:"space-y-1",children:[H,G]}),e[79]=H,e[80]=G,e[81]=Z):Z=e[81];let te;e[82]!==t?(te=t?.helpText&&i.jsx("p",{className:"text-xs text-muted-foreground",children:t.helpText}),e[82]=t,e[83]=te):te=e[83];let se;e[84]!==C?(se=C&&i.jsx("p",{className:"text-xs text-destructive",children:C.message}),e[84]=C,e[85]=se):se=e[85];let de;e[86]!==c?(de=c("settings.connectForms.cancel"),e[86]=c,e[87]=de):de=e[87];let he;e[88]!==S||e[89]!==s||e[90]!==de?(he=i.jsx(oe,{type:"button",variant:"ghost",size:"sm",onClick:s,disabled:S,children:de}),e[88]=S,e[89]=s,e[90]=de,e[91]=he):he=e[91];let ue;e[92]!==S||e[93]!==c?(ue=c(S?"settings.connectForms.saving":"settings.connectForms.saveConnection"),e[92]=S,e[93]=c,e[94]=ue):ue=e[94];let me;e[95]!==S||e[96]!==ue?(me=i.jsx(oe,{type:"submit",size:"sm",disabled:S,children:ue}),e[95]=S,e[96]=ue,e[97]=me):me=e[97];let fe;e[98]!==he||e[99]!==me?(fe=i.jsxs(Ye,{children:[he,me]}),e[98]=he,e[99]=me,e[100]=fe):fe=e[100];let Ne;return e[101]!==z||e[102]!==F||e[103]!==K||e[104]!==Z||e[105]!==te||e[106]!==se||e[107]!==fe?(Ne=i.jsxs("form",{onSubmit:z,className:"space-y-3",children:[F,K,Z,te,se,fe]}),e[101]=z,e[102]=F,e[103]=K,e[104]=Z,e[105]=te,e[106]=se,e[107]=fe,e[108]=Ne):Ne=e[108],Ne}const gs={kind:"closed"};function vs(n,e){switch(e.type){case"open":return n.kind==="closed"?{kind:"grid"}:n;case"close":return{kind:"closed"};case"back":switch(n.kind){case"form":case"oauth-pending":case"provision-pending":case"provision-error":return{kind:"grid"};default:return n}case"select-form":return n.kind!=="grid"?n:{kind:"form",providerId:e.providerId,presetId:e.presetId};case"select-oauth":return n.kind!=="grid"?n:{kind:"oauth-pending",providerId:e.providerId,stateToken:e.stateToken};case"oauth-failed":return n.kind==="oauth-pending"?{kind:"grid"}:n;case"select-provision":return n.kind!=="grid"?n:{kind:"provision-pending",providerId:e.providerId};case"provision-error":return n.kind!=="provision-pending"?n:{kind:"provision-error",providerId:n.providerId,error:e.error};case"retry-provision":return n.kind!=="provision-error"?n:{kind:"provision-pending",providerId:n.providerId}}}function bs(n){switch(n.kind){case"form":case"oauth-pending":case"provision-pending":case"provision-error":return n.providerId;default:return null}}function ys({open:n,onOpenChange:e,initialProvider:t}){const s=ie(),l=_e()?.providers??[],{org:a}=ge(),r=Se(),h=ke(),[d,c]=B.useReducer(vs,gs),f=B.useRef(!1);B.useEffect(()=>{n&&d.kind==="closed"?c({type:"open"}):!n&&d.kind!=="closed"&&c({type:"close"})},[n,d.kind]);const p=()=>{f.current=!1,c({type:"close"}),e(!1)},u=()=>{h.invalidateQueries({queryKey:ce.aiProviderKeys(a.id)}),h.invalidateQueries({queryKey:ce.aiProviders(a.id)})},{mutate:m}=ye({mutationFn:async({providerId:g,code:v,stateToken:y,label:E})=>(await r.call("AI_PROVIDER_OAUTH_EXCHANGE",{providerId:g,code:v,stateToken:y,label:E}),g),onSuccess:g=>{le("ai_provider_oauth_succeeded",{provider_id:g}),u();const v=l.find(y=>y.id===g);ne.success(s("settings.connectProviderDialog.oauthSuccessMessage",{provider:v?.name??s("settings.connectProviderDialog.defaultProviderName")})),p()},onError:(g,v)=>{le("ai_provider_oauth_failed",{provider_id:v.providerId,error:g.message}),ne.error(s("settings.connectProviderDialog.oauthFailedMessage",{error:g.message})),c({type:"oauth-failed"})}}),{mutate:b}=ye({mutationFn:async g=>(await r.call("AI_PROVIDER_PROVISION_KEY",{providerId:g}),g),onSuccess:g=>{le("ai_provider_provision_succeeded",{provider_id:g}),u();const v=l.find(y=>y.id===g);ne.success(s("settings.connectProviderDialog.provisionSuccessMessage",{provider:v?.name??s("settings.connectProviderDialog.defaultProviderName")})),p()},onError:(g,v)=>{le("ai_provider_provision_failed",{provider_id:v,error:g.message}),c({type:"provision-error",error:g.message})}}),w=async g=>{const{provider:v}=g,y=g.kind==="openai-compatible"?g.preset?.id??null:null,E=v.supportedMethods.includes("oauth-pkce"),z=v.supportedMethods.includes("api-key");if(v.supportsProvision===!0){le("ai_provider_connect_clicked",{provider_id:v.id,method:"provision"}),c({type:"select-provision",providerId:v.id}),b(v.id);return}if(E){le("ai_provider_connect_clicked",{provider_id:v.id,method:"oauth-pkce"});try{const O=await r.call("AI_PROVIDER_OAUTH_URL",{providerId:v.id,callbackUrl:`${window.location.origin}/oauth/callback/ai-provider`});if(!O?.url)throw new Error("Invalid response from AI_PROVIDER_OAUTH_URL");c({type:"select-oauth",providerId:v.id,stateToken:O.stateToken}),window.open(O.url,"AiProviderOAuth","width=600,height=700")}catch(O){ne.error(s("settings.connectProviderDialog.startOAuthFailedMessage",{error:O instanceof Error?O.message:String(O)}))}return}z&&(le("ai_provider_connect_clicked",{provider_id:v.id,...y!==null?{preset_id:y}:{},method:"api-key"}),c({type:"select-form",providerId:v.id,presetId:y}))},N=B.useRef(w);N.current=w;const j=B.useRef(t);j.current=t,B.useEffect(()=>{!j.current||d.kind!=="grid"||f.current||(f.current=!0,N.current(j.current))},[d.kind]);const _=d.kind==="oauth-pending"?d.stateToken:null,I=d.kind==="oauth-pending"?d.providerId:null;B.useEffect(()=>{if(d.kind!=="oauth-pending")return;let g=!1;const v=d.stateToken,y=d.providerId,E=P=>{if(P.origin!==window.location.origin||P.data?.type!=="AI_PROVIDER_OAUTH_CALLBACK")return;const{code:O,stateToken:T}=P.data;if(T!==v){ne.error(s("settings.connectProviderDialog.securityCheckFailedMessage")),c({type:"oauth-failed"});return}g=!0;const R=l.find(F=>F.id===y);m({providerId:y,code:O,stateToken:v,label:R?.name??y})};window.addEventListener("message",E);const z=setTimeout(()=>{g||(le("ai_provider_oauth_timeout",{provider_id:y}),c({type:"oauth-failed"}),ne.error(s("settings.connectProviderDialog.connectionTimedOutMessage")))},12e4);return()=>{window.removeEventListener("message",E),clearTimeout(z)}},[d.kind,_,I,m]);const A=bs(d),k=A?l.find(g=>g.id===A):null,S=(d.kind==="form"&&d.presetId?je(d.presetId):null)?.name??k?.name??s("settings.connectProviderDialog.defaultTitle"),C=d.kind!=="grid"&&d.kind!=="closed",M=()=>{t?p():c({type:"back"})};return i.jsx(Ge,{open:d.kind!=="closed",onOpenChange:g=>!g&&p(),children:i.jsxs(Xe,{className:"sm:max-w-md max-h-[90vh] overflow-y-auto",children:[i.jsxs(bt,{children:[i.jsxs("div",{className:"flex items-center gap-2",children:[C&&i.jsx(oe,{variant:"ghost",size:"icon","aria-label":s("settings.connectProviderDialog.backButtonLabel"),className:"h-7 w-7",onClick:M,children:i.jsx(Ze,{size:16})}),i.jsx(Qe,{children:S})]}),d.kind==="grid"&&!t&&i.jsx(yt,{children:s("settings.connectProviderDialog.gridDescription")})]}),d.kind==="grid"&&!t&&i.jsx(lt,{providers:l,onSelect:w}),d.kind==="form"&&(d.providerId==="openai-compatible"?i.jsx(xs,{preset:d.presetId?je(d.presetId):void 0,onCancel:()=>c({type:"back"}),onSuccess:()=>{u(),p()}}):i.jsx(fs,{providerId:d.providerId,onCancel:()=>c({type:"back"}),onSuccess:()=>{u(),p()}})),d.kind==="oauth-pending"&&i.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[i.jsx(Pe,{size:"lg"}),i.jsx("p",{className:"text-sm text-muted-foreground text-center",children:s("settings.connectProviderDialog.oauthPendingMessage")})]}),d.kind==="provision-pending"&&i.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[i.jsx(Pe,{size:"lg"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:s("settings.connectProviderDialog.provisionPendingMessage")})]}),d.kind==="provision-error"&&i.jsxs("div",{className:"flex flex-col items-center gap-4 py-6",children:[i.jsx(Kt,{size:28,className:"text-destructive"}),i.jsx("p",{className:"text-sm text-foreground text-center",children:d.error}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(oe,{variant:"outline",size:"sm",onClick:()=>c({type:"back"}),children:s("settings.connectProviderDialog.backButton")}),i.jsx(oe,{size:"sm",onClick:()=>{c({type:"retry-provision"}),b(d.providerId)},children:s("settings.connectProviderDialog.retryButton")})]})]})]})})}function js(){const n=q.c(7),{org:e}=ge(),t=Se();let s;n[0]!==e.id?(s=ce.defaultBrand(e.id),n[0]=e.id,n[1]=s):s=n[1];let o;n[2]!==t?(o=async()=>{const{items:r}=await t.call("BRAND_CONTEXT_LIST",{});return(Array.isArray(r)?r:[]).find(Ss)??null},n[2]=t,n[3]=o):o=n[3];let l;n[4]!==s||n[5]!==o?(l={queryKey:s,queryFn:o},n[4]=s,n[5]=o,n[6]=l):l=n[6];const{data:a}=ft(l);return a??null}function Ss(n){return n.isDefault&&!n.archivedAt}function Ns(n){const e=n.colors;if(!e)return null;if(Array.isArray(e)){const t=e.find(o=>typeof o=="object"&&o!==null&&"label"in o&&/primary|brand|main/i.test(o.label)),s=t?t.value:e[0]?.value;return typeof s=="string"?s:null}if(typeof e=="object"){const t=e;return t.primary??Object.values(t)[0]??null}return null}function ws(n){const e=q.c(49);let t;e[0]!==n?(t=n===void 0?{}:n,e[0]=n,e[1]=t):t=e[1];const{title:s,description:o}=t,l=ie(),{org:a}=ge(),r=js(),[h,d]=B.useState(null),[c,f]=B.useState(!1),[p,u]=B.useState(!1),m=Vt();let b;e[2]!==m?(b=(Ut()||Bt())&&!m,e[2]=m,e[3]=b):b=e[3];const w=b,N=_e();let j;e[4]!==N?.providers?(j=N?.providers??[],e[4]=N?.providers,e[5]=j):j=e[5];const _=j,I=a.name;let A;e[6]!==r?(A=r?Ns(r):null,e[6]=r,e[7]=A):A=e[7];const k=A,x=r?.favicon??r?.logo??null;let S;e[8]!==I||e[9]!==l||e[10]!==s?(S=s??(I?l("chat.noAiProviderEmptyState.headingWithOrg",{org:I}):l("chat.noAiProviderEmptyState.headingDefault")),e[8]=I,e[9]=l,e[10]=s,e[11]=S):S=e[11];const C=S;let M;e[12]!==o||e[13]!==l?(M=o??l("chat.noAiProviderEmptyState.subtitleDefault"),e[12]=o,e[13]=l,e[14]=M):M=e[14];const g=M,v=!!(x||k);let y;e[15]!==k?(y=k?{backgroundColor:`${k}18`,borderColor:`${k}30`}:void 0,e[15]=k,e[16]=y):y=e[16];const E=y,z=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 P;e[17]!==z||e[18]!==E||e[19]!==x||e[20]!==w||e[21]!==k||e[22]!==l?(P=x?i.jsx("div",{className:z,style:E,children:i.jsx("img",{src:x,alt:"",className:"size-7 rounded object-contain"})}):w?i.jsx("button",{type:"button",onClick:()=>u(!0),"aria-label":l("downloadApp.openLabel"),className:re(z,"cursor-pointer transition-colors hover:bg-accent"),style:E,children:i.jsx(Ae,{size:24,style:k?{color:k}:void 0,className:re(!k&&"text-muted-foreground")})}):i.jsx("div",{className:z,style:E,children:i.jsx(Ae,{size:24,style:k?{color:k}:void 0,className:re(!k&&"text-muted-foreground")})}),e[17]=z,e[18]=E,e[19]=x,e[20]=w,e[21]=k,e[22]=l,e[23]=P):P=e[23];let O;e[24]!==C?(O=i.jsx("p",{className:"text-xl font-semibold text-foreground tracking-tight",children:C}),e[24]=C,e[25]=O):O=e[25];let T;e[26]!==g?(T=i.jsx("p",{className:"text-sm text-muted-foreground max-w-md",children:g}),e[26]=g,e[27]=T):T=e[27];let R;e[28]!==T||e[29]!==O?(R=i.jsxs("div",{className:"space-y-2",children:[O,T]}),e[28]=T,e[29]=O,e[30]=R):R=e[30];let F;e[31]!==R||e[32]!==P?(F=i.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[P,R]}),e[31]=R,e[32]=P,e[33]=F):F=e[33];let K,Q;e[34]===Symbol.for("react.memo_cache_sentinel")?(K=L=>d(L),Q=()=>f(!0),e[34]=K,e[35]=Q):(K=e[34],Q=e[35]);let V;e[36]!==_?(V=i.jsx("div",{className:"w-full",children:i.jsx(lt,{providers:_,onSelect:K,onShowAll:Q})}),e[36]=_,e[37]=V):V=e[37];const Y=h!==null||c;let H;e[38]===Symbol.for("react.memo_cache_sentinel")?(H=L=>{L||(d(null),f(!1))},e[38]=H):H=e[38];const J=h??void 0;let $;e[39]!==Y||e[40]!==J?($=i.jsx(ys,{open:Y,onOpenChange:H,initialProvider:J}),e[39]=Y,e[40]=J,e[41]=$):$=e[41];let U;e[42]!==p?(U=i.jsx(Wt,{open:p,onOpenChange:u}),e[42]=p,e[43]=U):U=e[43];let X;return e[44]!==F||e[45]!==V||e[46]!==$||e[47]!==U?(X=i.jsxs("div",{className:"flex flex-col items-center gap-8 w-full max-w-3xl px-4",children:[F,V,$,U]}),e[44]=F,e[45]=V,e[46]=$,e[47]=U,e[48]=X):X=e[48],X}function Ie(n){const e=n.title.includes(": ");return{provider:e?n.title.split(": ")[0]??"":n.modelId.split("/")[0]??"",displayName:e?n.title.split(": ").slice(1).join(": "):n.title}}function ks(n){return n<32e3?{level:1,labelKey:"chat.shared.contextLevelSmall",descriptionKey:"chat.shared.contextLevelSmallDesc"}:n<2e5?{level:2,labelKey:"chat.shared.contextLevelMedium",descriptionKey:"chat.shared.contextLevelMediumDesc"}:n<5e5?{level:3,labelKey:"chat.shared.contextLevelLarge",descriptionKey:"chat.shared.contextLevelLargeDesc"}:{level:4,labelKey:"chat.shared.contextLevelVeryLarge",descriptionKey:"chat.shared.contextLevelVeryLargeDesc"}}const _s=["bg-destructive","bg-warning","bg-success","bg-success"],Cs=["text-success","text-warning","text-warning","text-destructive"];function Is(n,e){const t=Math.round(n*.75/1e3),s=t>=1?`${t}K`:`${Math.round(n*.75)}`;return e("chat.shared.approxWords",{wordCount:s})}function Ms(n){return n<1?{level:1,labelKey:"chat.shared.costLevelCheap"}:n<5?{level:2,labelKey:"chat.shared.costLevelModerate"}:n<15?{level:3,labelKey:"chat.shared.costLevelHigh"}:{level:4,labelKey:"chat.shared.costLevelExpensive"}}const Es={text:{icon:i.jsx(Yt,{className:"size-3.5"}),labelKey:"chat.shared.capabilityText"},vision:{icon:i.jsx(qt,{className:"size-3.5"}),labelKey:"chat.shared.capabilityVision"},image:{icon:i.jsx(Tt,{className:"size-3.5"}),labelKey:"chat.shared.capabilityImage"},tools:{icon:i.jsx(Ht,{className:"size-3.5"}),labelKey:"chat.shared.capabilityTools"},reasoning:{icon:i.jsx(Gt,{className:"size-3.5"}),labelKey:"chat.shared.capabilityReasoning"},"web-search":{icon:i.jsx(tt,{className:"size-3.5"}),labelKey:"chat.shared.capabilityWebSearch"}};function Os(n){const e=q.c(10),{capability:t}=n,s=ie(),o=Es[t];if(o){const h=o.icon;let d;e[0]!==o.labelKey||e[1]!==s?(d=s(o.labelKey),e[0]=o.labelKey,e[1]=s,e[2]=d):d=e[2];let c;return e[3]!==o.icon||e[4]!==d?(c=i.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground border border-border rounded px-2 py-0.5",children:[h,d]}),e[3]=o.icon,e[4]=d,e[5]=c):c=e[5],c}let l;e[6]!==t?(l=t.charAt(0).toUpperCase(),e[6]=t,e[7]=l):l=e[7];const a=l+t.slice(1);let r;return e[8]!==a?(r=i.jsx("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground border border-border rounded px-2 py-0.5",children:a}),e[8]=a,e[9]=r):r=e[9],r}function As(n){const e=q.c(59),{model:t,compact:s}=n,o=s===void 0?!1:s,l=ie();if(!t){let x;e[0]!==l?(x=l("chat.shared.hoverToPreview"),e[0]=l,e[1]=x):x=e[1];let S;return e[2]!==x?(S=i.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:x}),e[2]=x,e[3]=S):S=e[3],S}const a=t.costs?.input!=null?t.costs.input*1e6:null,r=t.costs?.output!=null?t.costs.output*1e6:null;let h;e[4]!==t?(h=Ie(t),e[4]=t,e[5]=h):h=e[5];const{provider:d,displayName:c}=h;if(o){let x;e[6]!==t.limits||e[7]!==l?(x=t.limits?.contextWindow&&i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-muted-foreground",children:l("chat.shared.context")}),i.jsxs("span",{className:"text-foreground font-medium",children:[t.limits.contextWindow.toLocaleString()," ",l("chat.shared.tokens")]})]}),e[6]=t.limits,e[7]=l,e[8]=x):x=e[8];let S;e[9]!==a||e[10]!==l?(S=a!=null&&i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-muted-foreground",children:l("chat.shared.input")}),i.jsxs("span",{className:"text-foreground font-medium",children:["$",a.toFixed(2)," / 1M"]})]}),e[9]=a,e[10]=l,e[11]=S):S=e[11];let C;e[12]!==r||e[13]!==l?(C=r!=null&&i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-muted-foreground",children:l("chat.shared.output")}),i.jsxs("span",{className:"text-foreground font-medium",children:["$",r.toFixed(2)," / 1M"]})]}),e[12]=r,e[13]=l,e[14]=C):C=e[14];let M;e[15]!==t.limits||e[16]!==l?(M=t.limits?.maxOutputTokens&&i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-muted-foreground",children:l("chat.shared.outputLimit")}),i.jsxs("span",{className:"text-foreground font-medium",children:[t.limits.maxOutputTokens.toLocaleString()," ",l("chat.shared.tokens")]})]}),e[15]=t.limits,e[16]=l,e[17]=M):M=e[17];let g;return e[18]!==x||e[19]!==S||e[20]!==C||e[21]!==M?(g=i.jsxs("div",{className:"flex flex-col gap-2 pt-3 pb-3 px-3 text-xs",children:[x,S,C,M]}),e[18]=x,e[19]=S,e[20]=C,e[21]=M,e[22]=g):g=e[22],g}let f;e[23]!==d?(f=i.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:d}),e[23]=d,e[24]=f):f=e[24];let p;e[25]!==t.logo||e[26]!==t.title?(p=t.logo&&i.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[25]=t.logo,e[26]=t.title,e[27]=p):p=e[27];let u;e[28]!==c?(u=i.jsx("p",{className:"text-lg font-semibold leading-snug tracking-tight",children:c}),e[28]=c,e[29]=u):u=e[29];let m;e[30]!==p||e[31]!==u?(m=i.jsxs("div",{className:"flex items-center gap-2.5",children:[p,u]}),e[30]=p,e[31]=u,e[32]=m):m=e[32];let b;e[33]!==t.modelId?(b=i.jsx("p",{className:"text-xs text-muted-foreground/50 font-mono",children:t.modelId}),e[33]=t.modelId,e[34]=b):b=e[34];let w;e[35]!==f||e[36]!==m||e[37]!==b?(w=i.jsxs("div",{className:"flex flex-col gap-1 pt-1 pr-6",children:[f,m,b]}),e[35]=f,e[36]=m,e[37]=b,e[38]=w):w=e[38];let N;e[39]!==t.capabilities?(N=t.capabilities&&t.capabilities.length>0&&i.jsx("div",{className:"flex flex-wrap items-center gap-1.5 pb-4 border-b border-border",children:[...new Set(t.capabilities)].map(Ps)}),e[39]=t.capabilities,e[40]=N):N=e[40];let j;e[41]!==t.limits||e[42]!==l?(j=t.limits?.contextWindow&&(()=>{const{level:x,labelKey:S,descriptionKey:C}=ks(t.limits.contextWindow);return i.jsxs("div",{className:"flex flex-col gap-1.5",children:[i.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:l("chat.shared.contextWindow")}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"flex items-center gap-0.5",children:[1,2,3,4].map(M=>i.jsx("div",{className:re("w-2 h-2 rounded-full",M<=x?_s[x-1]:"bg-muted")},M))}),i.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:l(S)}),i.jsxs("span",{className:"text-xs text-muted-foreground",children:["— ",l(C)]})]}),i.jsxs("span",{className:"text-sm text-muted-foreground",children:[t.limits.contextWindow.toLocaleString()," ",l("chat.shared.tokens")]})]})})(),e[41]=t.limits,e[42]=l,e[43]=j):j=e[43];let _;e[44]!==t.limits||e[45]!==l?(_=t.limits?.maxOutputTokens&&i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:l("chat.shared.outputLimit")}),i.jsxs("div",{className:"flex items-baseline gap-2",children:[i.jsxs("span",{className:"text-sm text-foreground",children:[t.limits.maxOutputTokens.toLocaleString()," ",l("chat.shared.tokens")]}),i.jsx("span",{className:"text-sm text-muted-foreground",children:Is(t.limits.maxOutputTokens,l)})]})]}),e[44]=t.limits,e[45]=l,e[46]=_):_=e[46];let I;e[47]!==a||e[48]!==r||e[49]!==l?(I=(a!=null||r!=null)&&(()=>{const{level:x,labelKey:S}=a!=null?Ms(a):{level:0,labelKey:null};return i.jsxs("div",{className:"flex flex-col gap-2",children:[i.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:l("chat.shared.pricing")}),a!=null&&i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"flex items-center",children:[1,2,3,4].map(C=>i.jsx("span",{className:re("text-sm font-bold leading-none",C<=x?Cs[x-1]:"text-muted-foreground/20"),children:"$"},C))}),i.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:S?l(S):""})]}),i.jsxs("div",{className:"flex flex-col gap-1",children:[a!=null&&i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("span",{className:"text-xs text-muted-foreground",children:l("chat.shared.input")}),i.jsxs("span",{className:"text-xs text-foreground",children:["$",a.toFixed(2)," / 1M"," ",l("chat.shared.tokens")]})]}),r!=null&&i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("span",{className:"text-xs text-muted-foreground",children:l("chat.shared.output")}),i.jsxs("span",{className:"text-xs text-foreground",children:["$",r.toFixed(2)," / 1M"," ",l("chat.shared.tokens")]})]})]})]})})(),e[47]=a,e[48]=r,e[49]=l,e[50]=I):I=e[50];let A;e[51]!==j||e[52]!==_||e[53]!==I?(A=i.jsxs("div",{className:"flex flex-col gap-6",children:[j,_,I]}),e[51]=j,e[52]=_,e[53]=I,e[54]=A):A=e[54];let k;return e[55]!==A||e[56]!==w||e[57]!==N?(k=i.jsxs("div",{className:"flex flex-col gap-5 py-1 px-1.5",children:[w,N,A]}),e[55]=A,e[56]=w,e[57]=N,e[58]=k):k=e[58],k}function Ps(n){return i.jsx(Os,{capability:n},n)}function ot(n){const e=q.c(22),{model:t,placeholder:s,isLoading:o}=n,l=o===void 0?!1:o,a=ie();let r;e[0]!==s||e[1]!==a?(r=s??a("chat.shared.selectModel"),e[0]=s,e[1]=a,e[2]=r):r=e[2];const h=r;if(l){let N;return e[3]===Symbol.for("react.memo_cache_sentinel")?(N=i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx(ee,{className:"w-5 h-5 rounded-sm shrink-0"}),i.jsx(ee,{className:"w-16 h-3 hidden md:block"})]}),e[3]=N):N=e[3],N}if(!t){let N;e[4]!==h?(N=i.jsx("span",{className:"text-sm text-muted-foreground",children:h}),e[4]=h,e[5]=N):N=e[5];let j;e[6]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsx(Te,{size:14,className:"text-muted-foreground opacity-50 shrink-0"}),e[6]=j):j=e[6];let _;return e[7]!==N?(_=i.jsxs("div",{className:"flex items-center gap-1.5",children:[N,j]}),e[7]=N,e[8]=_):_=e[8],_}let d;e[9]!==t?(d=Ie(t),e[9]=t,e[10]=d):d=e[10];const{displayName:c}=d;let f;e[11]!==t?(f=Ce(t),e[11]=t,e[12]=f):f=e[12];const p=f;let u;e[13]!==t.title||e[14]!==p?(u=i.jsx("img",{src:p,className:"w-3.5 h-3.5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[13]=t.title,e[14]=p,e[15]=u):u=e[15];let m;e[16]!==c?(m=i.jsx("span",{className:"text-sm truncate whitespace-nowrap text-muted-foreground max-w-[100px] sm:max-w-none",children:c}),e[16]=c,e[17]=m):m=e[17];let b;e[18]===Symbol.for("react.memo_cache_sentinel")?(b=i.jsx(Te,{size:14,className:"text-muted-foreground opacity-50 shrink-0"}),e[18]=b):b=e[18];let w;return e[19]!==u||e[20]!==m?(w=i.jsxs("div",{className:"flex items-center gap-1.5 min-w-0 overflow-hidden",children:[u,m,b]}),e[19]=u,e[20]=m,e[21]=w):w=e[21],w}const Ts=["vision","image","file","audio","video"],rt=["image/png","image/jpeg","image/gif","image/webp"],at=["application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"];function Me(n){const e=n?.capabilities;return e?Ts.some(t=>e.includes(t)):!1}function Fi(n,e){if(!n)return!1;if(n.startsWith("text/"))return!0;const t=e?.capabilities??[],s=t.includes("vision")||t.includes("image"),o=t.includes("file"),l=t.includes("audio"),a=t.includes("video");return!!(s&&rt.includes(n)||o&&n==="application/pdf"||l&&n.startsWith("audio/")||a&&n.startsWith("video/")||Me(e)&&at.includes(n))}function Ri(n){const e=n?.capabilities??[],t=["text/*"];return(e.includes("vision")||e.includes("image"))&&t.push(...rt),e.includes("file")&&t.push("application/pdf"),e.includes("audio")&&t.push("audio/*"),e.includes("video")&&t.push("video/*"),Me(n)&&t.push(...at),t.join(",")}function Ki(n){const e=n?.capabilities??[],t=[];return(e.includes("vision")||e.includes("image"))&&t.push("chat.shared.fileTypeImages"),e.includes("file")&&t.push("chat.shared.fileTypePdfs"),e.includes("audio")&&t.push("chat.shared.fileTypeAudio"),e.includes("video")&&t.push("chat.shared.fileTypeVideo"),Me(n)&&t.push("chat.shared.fileTypeOffice"),{parts:t,count:t.length}}const ct=["smarter","faster","cheaper"],Ls={smarter:"chat.decopilot.tierSmarter",faster:"chat.decopilot.tierFaster",cheaper:"chat.decopilot.tierCheaper"},zs=[{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"]}],Fs=zs.flatMap(({tier:n,prefixes:e})=>e.map(t=>({tier:n,prefix:t}))).sort((n,e)=>e.prefix.length-n.prefix.length),Rs="google/gemini-2.5-pro",$e=new Map;function Ks(n){const e=$e.get(n);if(e!==void 0)return e;let t=null;if(n.endsWith(":free"))t="cheaper";else for(const{tier:s,prefix:o}of Fs)if(n.startsWith(o)){if(o===Rs&&n.length>o.length&&n[o.length]==="-"){const a=n[o.length+1];if(!a||!/\d/.test(a))continue}t=s;break}return $e.set(n,t),t}function Ue(n){const e={smarter:[],faster:[],cheaper:[],other:[]};for(const t of n){const s=Ks(t.modelId);e[s??"other"].push(t)}for(const t of Object.keys(e))e[t].sort((s,o)=>s.title.localeCompare(o.title));return e}const dt="studio:model-shortlist:",Ds=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 $s(n){try{const e=localStorage.getItem(dt+n);return e?new Set(JSON.parse(e)):null}catch{return null}}function Us(n,e){localStorage.setItem(dt+n,JSON.stringify([...e]))}function Bs(n){const e=q.c(21),{model:t,onHover:s}=n;let o;e[0]!==t?(o=Ie(t),e[0]=t,e[1]=o):o=e[1];const{displayName:l,provider:a}=o;let r;e[2]!==t?(r=Ce(t),e[2]=t,e[3]=r):r=e[3];const h=r;let d;e[4]!==t||e[5]!==s?(d=()=>s(t),e[4]=t,e[5]=s,e[6]=d):d=e[6];let c;e[7]!==t.title||e[8]!==h?(c=i.jsx("img",{src:h,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]=h,e[9]=c):c=e[9];let f;e[10]!==l?(f=i.jsx("span",{className:"text-sm text-foreground leading-tight truncate",children:l}),e[10]=l,e[11]=f):f=e[11];let p;e[12]!==a?(p=i.jsx("span",{className:"text-xs text-muted-foreground/60 leading-tight",children:a}),e[12]=a,e[13]=p):p=e[13];let u;e[14]!==f||e[15]!==p?(u=i.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[f,p]}),e[14]=f,e[15]=p,e[16]=u):u=e[16];let m;return e[17]!==d||e[18]!==c||e[19]!==u?(m=i.jsxs("div",{className:"flex items-center gap-2.5 py-2 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:d,children:[c,u]}),e[17]=d,e[18]=c,e[19]=u,e[20]=m):m=e[20],m}function Ws(n){const e=q.c(16),{error:t,onRetry:s}=n,o=ie();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx("div",{className:"bg-destructive/10 p-2 rounded-full",children:i.jsx(gt,{className:"size-5 text-destructive"})}),e[0]=l):l=e[0];const a=o("chat.decopilot.failedToLoadModels");let r;e[1]!==a?(r=i.jsx("p",{className:"text-sm font-medium text-foreground",children:a}),e[1]=a,e[2]=r):r=e[2];const h=t?.message||o("chat.decopilot.couldNotFetchModels"),d=" "+o("chat.decopilot.tryAnotherProviderOrRetry");let c;e[3]!==h||e[4]!==d?(c=i.jsxs("p",{className:"text-xs text-muted-foreground max-w-[260px]",children:[h,d]}),e[3]=h,e[4]=d,e[5]=c):c=e[5];let f;e[6]!==r||e[7]!==c?(f=i.jsxs("div",{className:"flex flex-col gap-1",children:[r,c]}),e[6]=r,e[7]=c,e[8]=f):f=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=i.jsx(zt,{className:"size-3.5"}),e[9]=p):p=e[9];const u=o("chat.decopilot.retry");let m;e[10]!==s||e[11]!==u?(m=i.jsx("div",{className:"flex items-center gap-2",children:i.jsxs(oe,{variant:"outline",size:"sm",onClick:s,className:"gap-1.5",children:[p,u]})}),e[10]=s,e[11]=u,e[12]=m):m=e[12];let b;return e[13]!==m||e[14]!==f?(b=i.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-4 py-8 text-center",children:[l,f,m]}),e[13]=m,e[14]=f,e[15]=b):b=e[15],b}function Vs(){const n=q.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:Array.from({length:6}).map(Hs)}),n[0]=e):e=n[0],e}function Hs(n,e){return i.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[i.jsx(ee,{className:"size-5 shrink-0 rounded-sm"}),i.jsx(ee,{className:"flex-1 h-4"}),i.jsx(ee,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function Be(n){const e=q.c(12),{label:t,models:s,onSelect:o,onHover:l}=n;if(s.length===0)return null;let a;e[0]!==t?(a=i.jsx("div",{className:"text-xs font-medium text-muted-foreground px-3 pt-3 pb-1",children:t}),e[0]=t,e[1]=a):a=e[1];let r;if(e[2]!==s||e[3]!==l||e[4]!==o){let d;e[6]!==l||e[7]!==o?(d=c=>i.jsx("button",{type:"button",onClick:()=>o(c),onFocus:()=>l(c),className:"w-full text-left cursor-pointer",children:i.jsx(Bs,{model:c,onHover:l})},c.modelId),e[6]=l,e[7]=o,e[8]=d):d=e[8],r=s.map(d),e[2]=s,e[3]=l,e[4]=o,e[5]=r}else r=e[5];let h;return e[9]!==a||e[10]!==r?(h=i.jsxs("div",{children:[a,r]}),e[9]=a,e[10]=r,e[11]=h):h=e[11],h}function we(n,e){return e(n==="other"?"chat.decopilot.tierOther":Ls[n])}function qs(n){const e=q.c(21),{model:t,isChecked:s,onToggle:o,onHover:l}=n,[a,r]=B.useState(s);a!==s&&r(s);let h;e[0]!==t?(h=Ce(t),e[0]=t,e[1]=h):h=e[1];const d=h;let c;e[2]!==t||e[3]!==l?(c=()=>l(t),e[2]=t,e[3]=l,e[4]=c):c=e[4];let f;e[5]!==t.modelId||e[6]!==o?(f=()=>{r(Ys),o(t.modelId)},e[5]=t.modelId,e[6]=o,e[7]=f):f=e[7];let p;e[8]!==a||e[9]!==f?(p=i.jsx(_t,{checked:a,onCheckedChange:f}),e[8]=a,e[9]=f,e[10]=p):p=e[10];let u;e[11]!==d||e[12]!==t.title?(u=i.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]=u):u=e[13];let m;e[14]!==t.title?(m=i.jsx("span",{className:"text-sm text-foreground flex-1 min-w-0 line-clamp-1",children:t.title}),e[14]=t.title,e[15]=m):m=e[15];let b;return e[16]!==c||e[17]!==p||e[18]!==u||e[19]!==m?(b=i.jsxs("label",{className:"flex items-center gap-3 min-h-8 py-2.5 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:c,children:[p,u,m]}),e[16]=c,e[17]=p,e[18]=u,e[19]=m,e[20]=b):b=e[20],b}function Ys(n){return!n}function Gs(n,e){const t=[];for(const s of ct)if(n[s].length>0){t.push({type:"header",label:we(s,e)});for(const o of n[s])t.push({type:"model",model:o})}if(n.other.length>0){t.push({type:"header",label:we("other",e)});for(const s of n.other)t.push({type:"model",model:s})}return t}function Xs({items:n,shortlistSet:e,onToggle:t,onHover:s}){const o=B.useRef(null),l=as({count:n.length,getScrollElement:()=>o.current,estimateSize:a=>n[a]?.type==="header"?36:44,overscan:6});return i.jsx("div",{ref:o,className:"flex-1 overflow-y-auto",children:i.jsx("div",{className:"relative",style:{height:l.getTotalSize()},children:l.getVirtualItems().map(a=>{const r=n[a.index];return r?i.jsx("div",{"data-index":a.index,ref:l.measureElement,className:"absolute left-0 right-0 top-0 px-0.5",style:{transform:`translateY(${a.start}px)`},children:r.type==="header"?i.jsx("div",{className:"text-xs font-medium text-muted-foreground px-3 pt-3 pb-1",children:r.label}):i.jsx(qs,{model:r.model,isChecked:e.has(r.model.modelId),onToggle:t,onHover:s})},a.key):null})})})}function Qs(n){const e=q.c(30),{keyId:t,searchTerm:s,onHover:o,onModelSelect:l,managing:a,onToggleManage:r,filterModels:h}=n,d=ie(),{models:c}=Rt(t),f=h?c.filter(h):c.filter(Js);let p;e[0]!==t?(p=()=>(t?$s(t):null)??Ds,e[0]=t,e[1]=p):p=e[1];const[u,m]=B.useState(p),[,b]=B.useTransition();let w;e[2]!==t||e[3]!==b?(w=v=>{t&&b(()=>{m(y=>{const E=new Set(y);return E.has(v)?E.delete(v):E.add(v),Us(t,E),E})})},e[2]=t,e[3]=b,e[4]=w):w=e[4];const N=w,j=s.toLowerCase().trim(),_=v=>j?v.filter(y=>y.title.toLowerCase().includes(j)||y.modelId.toLowerCase().includes(j)):v;if(a){const v=Ue(_(f)),y=Gs(v,d);let E;e[5]!==u?(E=R=>u.has(R.modelId),e[5]=u,e[6]=E):E=e[6];const z=f.filter(E).length;let P;e[7]===Symbol.for("react.memo_cache_sentinel")?(P=i.jsx(Ze,{size:14}),e[7]=P):P=e[7];let O;e[8]!==d?(O=d("chat.decopilot.back"),e[8]=d,e[9]=O):O=e[9];let T;return e[10]!==r||e[11]!==O?(T=i.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground cursor-pointer",children:[P,O]}),e[10]=r,e[11]=O,e[12]=T):T=e[12],i.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[i.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border",children:[T,i.jsx("span",{className:"text-xs text-muted-foreground",children:d("chat.decopilot.selectedCount",{count:z})})]}),i.jsx(Xs,{items:y,shortlistSet:u,onToggle:N,onHover:o})]})}let I;e[13]!==u?(I=v=>u.has(v.modelId),e[13]=u,e[14]=I):I=e[14];const A=f.filter(I),k=A.length>0?A:f,x=Ue(_(k));let S;e[15]!==x||e[16]!==o||e[17]!==l||e[18]!==d?(S=ct.map(v=>i.jsx(Be,{label:we(v,d),models:x[v],onSelect:l,onHover:o},v)),e[15]=x,e[16]=o,e[17]=l,e[18]=d,e[19]=S):S=e[19];let C;e[20]!==d?(C=we("other",d),e[20]=d,e[21]=C):C=e[21];let M;e[22]!==x.other||e[23]!==o||e[24]!==l||e[25]!==C?(M=i.jsx(Be,{label:C,models:x.other,onSelect:l,onHover:o}),e[22]=x.other,e[23]=o,e[24]=l,e[25]=C,e[26]=M):M=e[26];let g;return e[27]!==S||e[28]!==M?(g=i.jsxs("div",{className:"flex-1 overflow-y-auto px-0.5 pt-1 [touch-action:pan-y]",children:[S,M]}),e[27]=S,e[28]=M,e[29]=g):g=e[29],g}function Js(n){return n.asyncResearch!==!0}function Zs(){const n=q.c(6);let e;n[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:i.jsxs("div",{className:"flex items-center gap-2.5 h-12 px-4",children:[i.jsx(ee,{className:"size-4 shrink-0"}),i.jsx(ee,{className:"flex-1 h-6"}),i.jsx(ee,{className:"w-[140px] h-8 shrink-0"})]})}),n[0]=e):e=n[0];let t;n[1]===Symbol.for("react.memo_cache_sentinel")?(t=i.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,i.jsx("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:Array.from({length:8}).map(ei)})]}),n[1]=t):t=n[1];let s;n[2]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[i.jsx(ee,{className:"size-6 shrink-0"}),i.jsx(ee,{className:"h-6 w-32"})]}),n[2]=s):s=n[2];let o;n[3]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsxs("div",{className:"flex flex-col gap-3 py-2 px-0",children:[s,i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(ee,{className:"h-6 w-20 rounded-md"}),i.jsx(ee,{className:"h-6 w-24 rounded-md"})]})]}),n[3]=o):o=n[3];let l;n[4]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsxs("div",{className:"flex flex-col gap-1.5",children:[i.jsx(ee,{className:"h-4 w-24"}),i.jsx(ee,{className:"h-4 w-32"})]}),n[4]=l):l=n[4];let a;return n[5]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsxs("div",{className:"flex flex-col md:flex-row h-full sm:h-[460px] min-h-0",children:[t,i.jsx("div",{className:"hidden md:block md:w-[320px] md:shrink-0 p-3",children:i.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[o,i.jsxs("div",{className:"flex flex-col gap-4",children:[l,i.jsxs("div",{className:"flex flex-col gap-1.5",children:[i.jsx(ee,{className:"h-4 w-16"}),i.jsx(ee,{className:"h-4 w-40"})]})]})]})})]}),n[5]=a):a=n[5],a}function ei(n,e){return i.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[i.jsx(ee,{className:"size-5 shrink-0 rounded-sm"}),i.jsx(ee,{className:"flex-1 h-4"}),i.jsx(ee,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function ht(n){const e=q.c(66),{onClose:t,credentialId:s,onCredentialChange:o,selectedModel:l,onModelChange:a,filterModels:r,compact:h}=n,d=ie(),[c,f]=B.useState(null),[p,u]=B.useState(""),[m,b]=B.useState(!1),w=_e(),N=Ft();let j;e[0]!==w?.providers?(j=Object.fromEntries((w?.providers??[]).map(ii)),e[0]=w?.providers,e[1]=j):j=e[1];const _=j,I=pt(),{org:A}=ge();let k;e[2]!==o?(k=L=>{o(L),f(null)},e[2]=o,e[3]=k):k=e[3];const x=k;let S;e[4]!==s||e[5]!==t||e[6]!==a?(S=L=>{s&&(a(L),u(""),t())},e[4]=s,e[5]=t,e[6]=a,e[7]=S):S=e[7];const C=S;if(N.length===0){const L=!h&&"sm:w-[740px]";let D;e[8]!==L?(D=re("flex items-center justify-center p-8 w-full",L),e[8]=L,e[9]=D):D=e[9];let W;e[10]===Symbol.for("react.memo_cache_sentinel")?(W=i.jsx(ws,{}),e[10]=W):W=e[10];let G;return e[11]!==D?(G=i.jsx("div",{className:D,children:W}),e[11]=D,e[12]=G):G=e[12],G}const M=h?"sm:h-[420px]":"sm:h-[460px]";let g;e[13]!==M?(g=re("flex flex-col md:flex-row h-full min-h-0",M),e[13]=M,e[14]=g):g=e[14];const v=h?"w-full":"md:border-r md:w-[420px] md:min-w-[420px]";let y;e[15]!==v?(y=re("flex-1 flex flex-col min-h-0 overflow-hidden",v),e[15]=v,e[16]=y):y=e[16];let E;e[17]===Symbol.for("react.memo_cache_sentinel")?(E=i.jsx(tt,{size:16,className:"text-muted-foreground shrink-0"}),e[17]=E):E=e[17];let z;e[18]!==m||e[19]!==d?(z=d(m?"chat.decopilot.searchAllModels":"chat.decopilot.searchForModel"),e[18]=m,e[19]=d,e[20]=z):z=e[20];let P;e[21]===Symbol.for("react.memo_cache_sentinel")?(P=L=>u(L.target.value),e[21]=P):P=e[21];let O;e[22]!==p||e[23]!==z?(O=i.jsx(xe,{autoFocus:!0,type:"text",placeholder:z,value:p,onChange:P,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[22]=p,e[23]=z,e[24]=O):O=e[24];let T;e[25]!==s||e[26]!==x||e[27]!==N||e[28]!==_||e[29]!==d?(T=N.length>0&&i.jsxs(Ct,{value:s??"",onValueChange:x,children:[i.jsxs(It,{size:"sm",className:"w-auto max-w-[140px] h-8 shrink-0 gap-1.5 px-2 [&>svg:last-child]:hidden",onClick:si,children:[i.jsx(Mt,{placeholder:d("chat.decopilot.key"),children:(()=>{const L=N.find(te=>te.id===s),D=L?_[L.providerId]:void 0,W=je(L?.presetId),G=W?.logo??D?.logo,Z=W?.name??D?.name??L?.providerId??"Key";return i.jsxs("span",{className:"flex items-center gap-1.5 min-w-0",children:[G?i.jsx("img",{src:G,alt:Z,className:"w-4 h-4 rounded shrink-0 dark:bg-white dark:rounded-sm dark:p-px"}):i.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:Z.slice(0,1).toUpperCase()}),i.jsx("span",{className:"text-xs truncate",children:Z})]})})()}),i.jsx(At,{className:"size-4 opacity-50 shrink-0 pointer-events-none"})]}),i.jsx(Et,{children:N.map(L=>{const D=_[L.providerId],W=je(L.presetId),G=W?.logo??D?.logo,Z=W?.name??D?.name??L.providerId;return i.jsx(Ot,{value:L.id,children:i.jsxs("div",{className:"flex items-center gap-2",children:[G?i.jsx("img",{src:G,alt:Z,className:"w-4 h-4 rounded dark:bg-white dark:rounded-sm dark:p-px"}):i.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:Z.slice(0,1).toUpperCase()}),i.jsxs("span",{children:[Z," — ",L.label]})]})},L.id)})})]}),e[25]=s,e[26]=x,e[27]=N,e[28]=_,e[29]=d,e[30]=T):T=e[30];let R;e[31]!==O||e[32]!==T?(R=i.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:i.jsxs("label",{className:"flex items-center gap-2.5 h-12 px-4 pr-12 md:pr-4 cursor-text",children:[E,O,T]})}),e[31]=O,e[32]=T,e[33]=R):R=e[33];let F;e[34]!==s?(F=L=>{const{error:D,resetError:W}=L;return i.jsx(Ws,{error:D,onRetry:W,credentialId:s??void 0})},e[34]=s,e[35]=F):F=e[35];let K;e[36]===Symbol.for("react.memo_cache_sentinel")?(K=i.jsx(Vs,{}),e[36]=K):K=e[36];const Q=s??void 0;let V;e[37]===Symbol.for("react.memo_cache_sentinel")?(V=()=>b(ti),e[37]=V):V=e[37];let Y;e[38]!==r||e[39]!==C||e[40]!==m||e[41]!==p||e[42]!==Q?(Y=i.jsx(B.Suspense,{fallback:K,children:i.jsx(Qs,{keyId:Q,searchTerm:p,onHover:f,onModelSelect:C,managing:m,onToggleManage:V,filterModels:r})}),e[38]=r,e[39]=C,e[40]=m,e[41]=p,e[42]=Q,e[43]=Y):Y=e[43];let H;e[44]!==s||e[45]!==F||e[46]!==Y?(H=i.jsx(xt,{fallback:F,children:Y},s),e[44]=s,e[45]=F,e[46]=Y,e[47]=H):H=e[47];let J;e[48]!==m||e[49]!==I||e[50]!==A||e[51]!==d?(J=!m&&i.jsxs("div",{className:"border-t border-border flex",children:[i.jsxs("button",{type:"button",onClick:()=>B.startTransition(()=>b(!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:[i.jsx(Lt,{className:"size-3.5 shrink-0"}),d("chat.decopilot.manageModels")]}),i.jsx("div",{className:"w-px bg-border shrink-0"}),i.jsxs("button",{type:"button",onClick:()=>I({to:"/$org/settings/ai-providers",params:{org:A.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:[i.jsx(Pt,{className:"size-3.5 shrink-0"}),d("chat.decopilot.manageApiKeys")]})]}),e[48]=m,e[49]=I,e[50]=A,e[51]=d,e[52]=J):J=e[52];let $;e[53]!==R||e[54]!==H||e[55]!==J||e[56]!==y?($=i.jsxs("div",{className:y,children:[R,H,J]}),e[53]=R,e[54]=H,e[55]=J,e[56]=y,e[57]=$):$=e[57];let U;e[58]!==h||e[59]!==c||e[60]!==l?(U=!h&&i.jsx("div",{className:"hidden md:flex md:flex-col md:w-[320px] md:shrink-0 p-3",children:i.jsx(As,{model:c??l??null})}),e[58]=h,e[59]=c,e[60]=l,e[61]=U):U=e[61];let X;return e[62]!==$||e[63]!==U||e[64]!==g?(X=i.jsxs("div",{className:g,children:[$,U]}),e[62]=$,e[63]=U,e[64]=g,e[65]=X):X=e[65],X}function ti(n){return!n}function si(n){return n.stopPropagation()}function ii(n){return[n.id,n]}function ni(n){const e=q.c(12),{onClose:t}=n,{credentialId:s,setCredentialId:o,selectedModel:l,setModel:a}=Je();let r;e[0]!==o?(r=c=>{le("chat_credential_changed",{credential_id:c}),o(c)},e[0]=o,e[1]=r):r=e[1];let h;e[2]!==s||e[3]!==l?.modelId||e[4]!==a?(h=c=>{s&&(le("chat_model_changed",{from_model_id:l?.modelId??null,to_model_id:c.modelId,to_model_provider:c.providerId??null,credential_id:s}),a({...c,keyId:s}))},e[2]=s,e[3]=l?.modelId,e[4]=a,e[5]=h):h=e[5];let d;return e[6]!==s||e[7]!==t||e[8]!==l||e[9]!==r||e[10]!==h?(d=i.jsx(ht,{onClose:t,credentialId:s,onCredentialChange:r,selectedModel:l,onModelChange:h}),e[6]=s,e[7]=t,e[8]=l,e[9]=r,e[10]=h,e[11]=d):d=e[11],d}function li(n){const e=q.c(2),{onClose:t}=n;let s;return e[0]!==t?(s=i.jsx(ni,{onClose:t}),e[0]=t,e[1]=s):s=e[1],s}function oi(n){const e=q.c(2);let t;return e[0]!==n?(t=i.jsx(ht,{...n}),e[0]=n,e[1]=t):t=e[1],t}function ri(n){const e=q.c(2),{onClose:t}=n;let s;return e[0]!==t?(s=i.jsx(li,{onClose:t}),e[0]=t,e[1]=s):s=e[1],s}function ai(n){const e=q.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(oi,{...t}),e[2]=t,e[3]=s):s=e[3],s}function Di(n){const e=q.c(48),{variant:t,className:s,placeholder:o,model:l,isLoading:a,credentialId:r,onCredentialChange:h,onModelChange:d,filterModels:c}=n,f=t===void 0?"borderless":t,p=o===void 0?"Select model":o,u=ie(),[m,b]=B.useState(!1),w=d!==void 0,N=vt(),j=f==="borderless"?"ghost":"outline",_=f==="borderless"&&"md:border-none";let I;e[0]!==s||e[1]!==_?(I=re("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",_,s),e[0]=s,e[1]=_,e[2]=I):I=e[2];let A;e[3]!==a||e[4]!==l||e[5]!==p||e[6]!==w?(A=w?i.jsx(ot,{model:l??null,placeholder:p,isLoading:a}):i.jsx(di,{placeholder:p}),e[3]=a,e[4]=l,e[5]=p,e[6]=w,e[7]=A):A=e[7];let k;e[8]!==j||e[9]!==I||e[10]!==A?(k=i.jsx(oe,{variant:j,size:"sm",className:I,children:A}),e[8]=j,e[9]=I,e[10]=A,e[11]=k):k=e[11];const x=k;let S;e[12]===Symbol.for("react.memo_cache_sentinel")?(S=i.jsx(Zs,{}),e[12]=S):S=e[12];let C;e[13]!==r||e[14]!==c||e[15]!==l||e[16]!==h||e[17]!==d||e[18]!==w?(C=i.jsx(B.Suspense,{fallback:S,children:w?i.jsx(ai,{onClose:()=>b(!1),credentialId:r??null,onCredentialChange:h??ci,selectedModel:l??null,onModelChange:d,filterModels:c}):i.jsx(ri,{onClose:()=>b(!1)})}),e[13]=r,e[14]=c,e[15]=l,e[16]=h,e[17]=d,e[18]=w,e[19]=C):C=e[19];const M=C;if(N){let P;e[20]!==x?(P=i.jsx(St,{asChild:!0,children:x}),e[20]=x,e[21]=P):P=e[21];let O;e[22]!==u?(O=u("chat.selectModel.selectModel"),e[22]=u,e[23]=O):O=e[23];let T;e[24]!==O?(T=i.jsx(Nt,{className:"sr-only",children:O}),e[24]=O,e[25]=T):T=e[25];let R;e[26]!==M?(R=i.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:M}),e[26]=M,e[27]=R):R=e[27];let F;e[28]!==T||e[29]!==R?(F=i.jsxs(wt,{className:"p-0 flex flex-col max-h-[95vh]",children:[T,R]}),e[28]=T,e[29]=R,e[30]=F):F=e[30];let K;return e[31]!==m||e[32]!==P||e[33]!==F?(K=i.jsxs(kt,{open:m,onOpenChange:b,children:[P,F]}),e[31]=m,e[32]=P,e[33]=F,e[34]=K):K=e[34],K}let g;e[35]!==x?(g=i.jsx(jt,{asChild:!0,children:x}),e[35]=x,e[36]=g):g=e[36];let v;e[37]!==u?(v=u("chat.selectModel.selectModel"),e[37]=u,e[38]=v):v=e[38];let y;e[39]!==v?(y=i.jsx(Qe,{className:"sr-only",children:v}),e[39]=v,e[40]=y):y=e[40];let E;e[41]!==M||e[42]!==y?(E=i.jsxs(Xe,{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:[y,M]}),e[41]=M,e[42]=y,e[43]=E):E=e[43];let z;return e[44]!==m||e[45]!==g||e[46]!==E?(z=i.jsxs(Ge,{open:m,onOpenChange:b,children:[g,E]}),e[44]=m,e[45]=g,e[46]=E,e[47]=z):z=e[47],z}function ci(){}function di(n){const e=q.c(4),{placeholder:t}=n,{selectedModel:s,isModelsLoading:o}=Je();let l;return e[0]!==o||e[1]!==s||e[2]!==t?(l=i.jsx(ot,{model:s,placeholder:t,isLoading:o}),e[0]=o,e[1]=s,e[2]=t,e[3]=l):l=e[3],l}export{ys as C,ai as M,ws as N,lt as P,Zs as a,Ri as b,Di as c,je as d,Ki as g,Fi as i,Me as m,zi as u};