decocms 4.582.1 → 4.583.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (552) hide show
  1. package/dist/client/assets/{AlertCircle-DT2ZDuIl.js → AlertCircle-BfuEGc37.js} +1 -1
  2. package/dist/client/assets/{AreaChart-DcNurrpT.js → AreaChart-DR454FhG.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-DR_MRxUB.js → ArrowLeft-Ccyza8AK.js} +1 -1
  4. package/dist/client/assets/ArrowRight-BfJPk4p9.js +1 -0
  5. package/dist/client/assets/{ArrowUp-BdtMKnAz.js → ArrowUp-Cfwuhrfj.js} +1 -1
  6. package/dist/client/assets/{BookOpen01-DejCO54_.js → BookOpen01-vaPiqXWZ.js} +1 -1
  7. package/dist/client/assets/{CartesianChart-43C3tGyF.js → CartesianChart-Vg3-F_Bi.js} +1 -1
  8. package/dist/client/assets/{CategoricalChart-GawOpO41.js → CategoricalChart-gtbFaKuM.js} +1 -1
  9. package/dist/client/assets/{CheckCircle-CM--cqi0.js → CheckCircle-WpYwhp7A.js} +1 -1
  10. package/dist/client/assets/ChevronDown-Kpzb5_P-.js +1 -0
  11. package/dist/client/assets/{ChevronSelectorVertical-BJDM_s_Z.js → ChevronSelectorVertical-DNPn4Jhl.js} +1 -1
  12. package/dist/client/assets/ChevronUp-CwLphDxo.js +1 -0
  13. package/dist/client/assets/{CreditCard01-BKZ9QJb-.js → CreditCard01-CDUEuZ6_.js} +1 -1
  14. package/dist/client/assets/Eye-BeTcpGN-.js +1 -0
  15. package/dist/client/assets/File02-D8jC2XAm.js +1 -0
  16. package/dist/client/assets/{Globe04-BZJYx7x5.js → Globe04-CM5K7y4B.js} +1 -1
  17. package/dist/client/assets/Image01-0Jwady1a.js +1 -0
  18. package/dist/client/assets/{Key01-CC_tghZO.js → Key01-Dqvoolzt.js} +1 -1
  19. package/dist/client/assets/LayoutLeft-Nn_BPz0l.js +1 -0
  20. package/dist/client/assets/LinkBroken01-6J7zZ1XX.js +1 -0
  21. package/dist/client/assets/Minimize01-Dylk6LHz.js +1 -0
  22. package/dist/client/assets/{Minus-Bj5yI5D8.js → Minus-BFZz-RWg.js} +1 -1
  23. package/dist/client/assets/{Monitor01-DeK03po-.js → Monitor01-ZIydqkip.js} +1 -1
  24. package/dist/client/assets/{Play-kYcUI1An.js → Play-CkrBckKV.js} +1 -1
  25. package/dist/client/assets/{Plus-DEeR8qC2.js → Plus-C8Idvwpa.js} +1 -1
  26. package/dist/client/assets/{ReferenceLine-DbQts9AQ.js → ReferenceLine-2ZGA3m5C.js} +1 -1
  27. package/dist/client/assets/{SearchMd-DVpGBR2l.js → SearchMd-G9SUUXxg.js} +1 -1
  28. package/dist/client/assets/{ShoppingBag01-BV5nZGeU.js → ShoppingBag01-sbzM0fY9.js} +1 -1
  29. package/dist/client/assets/{Sun-Ba2OXmDv.js → Sun-Bvg5JrAI.js} +1 -1
  30. package/dist/client/assets/{SwitchHorizontal01-Cp1oX99F.js → SwitchHorizontal01-BbD-SqO6.js} +1 -1
  31. package/dist/client/assets/Tool01-DOjdBvJ6.js +1 -0
  32. package/dist/client/assets/{Tooltip-DNR0eew9.js → Tooltip-buu7_uLC.js} +1 -1
  33. package/dist/client/assets/{Trash01-CgZrkZ3U.js → Trash01-BRIjyxCC.js} +1 -1
  34. package/dist/client/assets/TrendUp01-DLgSqdSd.js +1 -0
  35. package/dist/client/assets/{Upload01-DDoiK0tv.js → Upload01-Dd-OapHB.js} +1 -1
  36. package/dist/client/assets/UserCheck01-DVOI9Qq6.js +1 -0
  37. package/dist/client/assets/{UserSquare-DEjJtCDR.js → UserSquare-CRBGeews.js} +1 -1
  38. package/dist/client/assets/{Users01-DVMhWmct.js → Users01-bZ_S-kH7.js} +1 -1
  39. package/dist/client/assets/{XClose-xYIhBL8b.js → XClose-CWGS9q3D.js} +1 -1
  40. package/dist/client/assets/{Zap-BsuEhLd3.js → Zap-BxaAY56U.js} +1 -1
  41. package/dist/client/assets/{access-gate-BYQd4796.js → access-gate-BpukTmFQ.js} +1 -1
  42. package/dist/client/assets/{add-connection-dialog-C86xZwTt.js → add-connection-dialog-BfsrivZp.js} +1 -1
  43. package/dist/client/assets/agent-app-ZmiqpLI8.js +1 -0
  44. package/dist/client/assets/agent-assets-CxDlSc-F.js +1 -0
  45. package/dist/client/assets/agent-automation-Cvq2MsBo.js +20 -0
  46. package/dist/client/assets/agent-automations-DqPMEPTu.js +1 -0
  47. package/dist/client/assets/agent-blog-CBUzxo-R.js +2 -0
  48. package/dist/client/assets/agent-blog-post-Bi0pzlIG.js +2 -0
  49. package/dist/client/assets/agent-calendar-D817wzif.js +1 -0
  50. package/dist/client/assets/{agent-capabilities-B40k722B.js → agent-capabilities-COfZW6Pr.js} +1 -1
  51. package/dist/client/assets/agent-connect-sources-DEAtqQDn.js +1 -0
  52. package/dist/client/assets/agent-deck-DLJ_JEHY.js +1 -0
  53. package/dist/client/assets/agent-e2e-B_mxpyua.js +1 -0
  54. package/dist/client/assets/agent-experiments-CC4vS2Ak.js +1 -0
  55. package/dist/client/assets/agent-file-DaY3pEIy.js +1 -0
  56. package/dist/client/assets/agent-hosting-CNynwqai.js +1 -0
  57. package/dist/client/assets/agent-icon-DE4TWlDl.js +1 -0
  58. package/dist/client/assets/agent-library-53yJ_N0C.js +1 -0
  59. package/dist/client/assets/agent-library-file-CmdRdcgJ.js +1 -0
  60. package/dist/client/assets/agent-overview-Bjahi54k.js +1 -0
  61. package/dist/client/assets/agent-releases-De-C-EMX.js +2 -0
  62. package/dist/client/assets/agent-settings-Bmfo6yEF.js +1 -0
  63. package/dist/client/assets/{agent-site-editor-CS9MMMbk.js → agent-site-editor-B5E5lU9u.js} +2 -2
  64. package/dist/client/assets/agent-site-editor-code-BzQzaZAE.js +2 -0
  65. package/dist/client/assets/agent-site-editor-content-D03NaTwn.js +1 -0
  66. package/dist/client/assets/agent-site-editor-preview-wStmeJD1.js +1 -0
  67. package/dist/client/assets/agent-view-Dh2W4gDj.js +1 -0
  68. package/dist/client/assets/agent-view-guard-25E2XJRr.js +1 -0
  69. package/dist/client/assets/ai-providers-E4UhWu6J.js +1 -0
  70. package/dist/client/assets/{alert-DFQMLwuf.js → alert-GV95Dsn9.js} +1 -1
  71. package/dist/client/assets/analytics-sections-C9-8NbQC.js +1 -0
  72. package/dist/client/assets/api-keys-BU9wHAPs.js +1 -0
  73. package/dist/client/assets/api-keys-C8ArQ5p_.js +1 -0
  74. package/dist/client/assets/app-editor-kEra9PRa.js +1 -0
  75. package/dist/client/assets/{asset-utils-DxQXeDgB.js → asset-utils-DWvcPbEZ.js} +1 -1
  76. package/dist/client/assets/{auth-catchall-ChHXwieU.js → auth-catchall-Dy37bIqg.js} +1 -1
  77. package/dist/client/assets/{auth-entry-BUy5eNSm.js → auth-entry-BHlmJEBv.js} +1 -1
  78. package/dist/client/assets/{auth-Br21RAsk.js → auth-gL3R1YGn.js} +1 -1
  79. package/dist/client/assets/{auth-split-layout-DXcvh-93.js → auth-split-layout-ckQyQHcL.js} +1 -1
  80. package/dist/client/assets/{authenticate-and-persist-oauth-CTJV9ez5.js → authenticate-and-persist-oauth-C7oT67KU.js} +1 -1
  81. package/dist/client/assets/automation-list-row-DriFJJzl.js +1 -0
  82. package/dist/client/assets/{automation-runs-BluUkmKT.js → automation-runs-C37do2Pw.js} +1 -1
  83. package/dist/client/assets/automations-tDs_UhVP.js +1 -0
  84. package/dist/client/assets/{badge-C2zO_tAX.js → badge-BG-k6t3T.js} +1 -1
  85. package/dist/client/assets/{block-document-DTM21O-Q.js → block-document-pPtike34.js} +3 -3
  86. package/dist/client/assets/{blocks-preview-workspace-context-0qX3i0Hw.js → blocks-preview-workspace-context-BBjk2tme.js} +1 -1
  87. package/dist/client/assets/{blocks-tab-states-BZoxOO-H.js → blocks-tab-states-GP0NCNYs.js} +1 -1
  88. package/dist/client/assets/{blog-preview-url-Bcn3MddY.js → blog-preview-url-CwSXxQWr.js} +1 -1
  89. package/dist/client/assets/blog-schema-DOB707mb.js +1 -0
  90. package/dist/client/assets/{blog-source-gate-DcD3mNPu.js → blog-source-gate-3rG_0gJI.js} +1 -1
  91. package/dist/client/assets/blog-view-gate-Be4DtolQ.js +1 -0
  92. package/dist/client/assets/buckets-BZrhNTRn.js +1 -0
  93. package/dist/client/assets/{build-improve-prompt-doc-BYTmOiJ8.js → build-improve-prompt-doc-DVbQXrhG.js} +1 -1
  94. package/dist/client/assets/calendar-CcuaFZRF.js +1 -0
  95. package/dist/client/assets/{capability-load-error-CHW06qRY.js → capability-load-error-Bcs21XUc.js} +1 -1
  96. package/dist/client/assets/category-editor-CnJqxifY.js +1 -0
  97. package/dist/client/assets/{category-tree-EQNjX_vh.js → category-tree-D2ejZxYL.js} +1 -1
  98. package/dist/client/assets/{chart-DP-afdSL.js → chart-B2B-jcI-.js} +1 -1
  99. package/dist/client/assets/chat-context-CiT7AzBS.js +43 -0
  100. package/dist/client/assets/{chat-draft-BnT_bTVf.js → chat-draft-BNZV2YjB.js} +1 -1
  101. package/dist/client/assets/{checkbox-Dn6r2X61.js → checkbox-DSC8VbDf.js} +1 -1
  102. package/dist/client/assets/choose-editor-uAW7DjQg.js +1 -0
  103. package/dist/client/assets/{cli-auth-success-BWjEoABt.js → cli-auth-success-B897Xynp.js} +1 -1
  104. package/dist/client/assets/cms-settings-editor-B4pAxgqZ.js +1 -0
  105. package/dist/client/assets/{cms-store-drafts-DC7_MPeX.js → cms-store-drafts-CtClpzKs.js} +1 -1
  106. package/dist/client/assets/{collapsible-waKUBV3F.js → collapsible-DrV9qsGN.js} +1 -1
  107. package/dist/client/assets/collection-detail-DucMHrT0.js +1 -0
  108. package/dist/client/assets/{collection-display-button-CpOX39FE.js → collection-display-button-BHyM7wC2.js} +1 -1
  109. package/dist/client/assets/{collection-search-CKJ8zcS9.js → collection-search-BbCHAL7t.js} +1 -1
  110. package/dist/client/assets/{collection-table-wrapper-DX64SyX5.js → collection-table-wrapper-BlLHObjj.js} +1 -1
  111. package/dist/client/assets/{collection-tabs-DL3FYMaD.js → collection-tabs-BXeEDC1Y.js} +1 -1
  112. package/dist/client/assets/{combobox-CZTRaybI.js → combobox-DugO3-8Q.js} +1 -1
  113. package/dist/client/assets/{command-B0-oLV0k.js → command-Bo6EGcaE.js} +1 -1
  114. package/dist/client/assets/{companion-mcps-section-CAkQdc3e.js → companion-mcps-section-CsXLIG2Z.js} +1 -1
  115. package/dist/client/assets/config-CdVwRL_a.js +1 -0
  116. package/dist/client/assets/{client-icons-B7ckFhTB.js → connect-key--cfk-fLm.js} +1 -1
  117. package/dist/client/assets/{connect-layout-By1LwNsY.js → connect-layout-BPppRISp.js} +1 -1
  118. package/dist/client/assets/connect-lufub1FU.js +9 -0
  119. package/dist/client/assets/{connect-source-dialog-Clx35W2U.js → connect-source-dialog-CfsFTEbG.js} +1 -1
  120. package/dist/client/assets/{connection-CwOP2DkA.js → connection-BLQs5hMz.js} +1 -1
  121. package/dist/client/assets/{connection-card-DxEnheWw.js → connection-card-vLs08dR6.js} +1 -1
  122. package/dist/client/assets/connection-detail-CLkPYY1x.js +1 -0
  123. package/dist/client/assets/{connection-form-helpers-DsiTws_r.js → connection-form-helpers-BSIh8Ep0.js} +1 -1
  124. package/dist/client/assets/connection-slug-CmPPcsjf.js +1 -0
  125. package/dist/client/assets/connections-C4ZbA0RY.js +1 -0
  126. package/dist/client/assets/{content-tab-D3gTzU_j.js → content-tab-C-pzFX10.js} +4 -4
  127. package/dist/client/assets/context-3bSluoDN.js +1 -0
  128. package/dist/client/assets/{context-menu-BAywIeQG.js → context-menu-CzIORBDb.js} +1 -1
  129. package/dist/client/assets/{context-shell-C8ZPCYjw.js → context-shell-3lL8N_R5.js} +4 -4
  130. package/dist/client/assets/{create-organization-dialog-BpL43B76.js → create-organization-dialog-k086v-9Q.js} +1 -1
  131. package/dist/client/assets/daily-pulse-P6H0d8QI.js +1 -0
  132. package/dist/client/assets/{delete-copy-UjfjjP4_.js → delete-copy-BQaedVkX.js} +1 -1
  133. package/dist/client/assets/{device-hint-AWxEadtg.js → device-hint-CvnqGHIy.js} +1 -1
  134. package/dist/client/assets/discover-qzwfuJLu.js +1 -0
  135. package/dist/client/assets/{domain-settings-BCvvef40.js → domain-settings-y3u2iu2W.js} +1 -1
  136. package/dist/client/assets/{drawer-CfOCKnhq.js → drawer-CarQd6Jb.js} +1 -1
  137. package/dist/client/assets/{editor-COFIs9XE.js → editor-DYk_2MJQ.js} +1 -1
  138. package/dist/client/assets/{editor-classes-aqVUSPbm.js → editor-classes-DVIoQu74.js} +1 -1
  139. package/dist/client/assets/{empty-message-CirmMDhM.js → empty-message-C90DlePv.js} +1 -1
  140. package/dist/client/assets/{empty-state-C7Sg1bax.js → empty-state-B67nwURy.js} +1 -1
  141. package/dist/client/assets/{empty-state-CFvQY7HR.js → empty-state-XAK3RjVy.js} +1 -1
  142. package/dist/client/assets/experiments-tab-choice-D8ZqCESL.js +1 -0
  143. package/dist/client/assets/{extract-connection-data-CFxfI9gN.js → extract-connection-data-D6CjTXbp.js} +1 -1
  144. package/dist/client/assets/feature-gate-CCvZeJRu.js +1 -0
  145. package/dist/client/assets/{feature-paywall-AtUr_EOu.js → feature-paywall-DzmzZ5s3.js} +1 -1
  146. package/dist/client/assets/file-explorer-BqxAkXtr.js +2 -0
  147. package/dist/client/assets/{file-preview-PSKf9fIz.js → file-preview-C0yEEExh.js} +1 -1
  148. package/dist/client/assets/file-share-button-CowSSkLB.js +3 -0
  149. package/dist/client/assets/{file-type-icon-3Zm8W435.js → file-type-icon-CEP8k4gh.js} +1 -1
  150. package/dist/client/assets/folder-icon-CmtFeppJ.js +1 -0
  151. package/dist/client/assets/{form-BZ7xdssd.js → form-8GAe5FIZ.js} +1 -1
  152. package/dist/client/assets/{frame-navigation-8oPGH7NY.js → frame-navigation-BpI5RQJq.js} +1 -1
  153. package/dist/client/assets/gateway-client-BqPME1T5.js +1 -0
  154. package/dist/client/assets/general-DbhKzHt5.js +1 -0
  155. package/dist/client/assets/{github-icon-DH5Sm3NR.js → github-icon-BH4kK9If.js} +1 -1
  156. package/dist/client/assets/{held-block-view-BR-UYX4S.js → held-block-view-MI6LUwjK.js} +3 -3
  157. package/dist/client/assets/home-_NmLJi-9.js +1 -0
  158. package/dist/client/assets/home-overview-CTEEkh3w.js +1 -0
  159. package/dist/client/assets/{hosted-reconcile-C5UVxzTP.js → hosted-reconcile-BbIfIwl1.js} +1 -1
  160. package/dist/client/assets/{icon-button-BfibpDoO.js → icon-button-Dd8gTd4-.js} +1 -1
  161. package/dist/client/assets/index-B-OtHlgY.js +4 -0
  162. package/dist/client/assets/{index-BXpXjiyK.js → index-BRHz7VD8.js} +1 -1
  163. package/dist/client/assets/{index-dsAQGF7D.js → index-BY10zRfl.js} +1 -1
  164. package/dist/client/assets/index-B_-z8Lrt.js +1 -0
  165. package/dist/client/assets/{index-DF1Gszum.js → index-C17JTAPe.js} +2 -2
  166. package/dist/client/assets/{index-n1AjR0vt.js → index-CADsC-mK.js} +2 -2
  167. package/dist/client/assets/{index-BpLEscAk.js → index-CYjM_f4V.js} +1 -1
  168. package/dist/client/assets/{index-Db96seLi.js → index-CZQ-Wgjf.js} +1 -1
  169. package/dist/client/assets/{index-BP527m3V.js → index-CwntHk8S.js} +13 -13
  170. package/dist/client/assets/index-DClpdtOI.js +1 -0
  171. package/dist/client/assets/{index-Ds3fsbcX.js → index-DEOQXzn-.js} +1 -1
  172. package/dist/client/assets/{index-DZi8I8ot.js → index-DIHnNoyA.js} +1 -1
  173. package/dist/client/assets/{index-DoH06YKc.js → index-DPCC7KEx.js} +1 -1
  174. package/dist/client/assets/{index-CQ7e2YEj.js → index-Dez-6rcd.js} +1 -1
  175. package/dist/client/assets/index-Dkr4Q9bE.js +1 -0
  176. package/dist/client/assets/{index-CmzG_GaM.js → index-Do3hK3is.js} +1 -1
  177. package/dist/client/assets/{index-jQ2gY_fm.js → index-km18CQ4q.js} +1 -1
  178. package/dist/client/assets/index-pbgcO64n.css +1 -0
  179. package/dist/client/assets/{index-redirect-QRKsjVCi.js → index-redirect-CTR6WNPG.js} +1 -1
  180. package/dist/client/assets/{infiniteQueryObserver-BFZQsptZ.js → infiniteQueryObserver-DdeQTeaz.js} +1 -1
  181. package/dist/client/assets/infra-billing-tXzfTwHJ.js +1 -0
  182. package/dist/client/assets/input-CxFJosPu.js +17 -0
  183. package/dist/client/assets/{input-C1HwcZTs.js → input-DXyNd1dE.js} +1 -1
  184. package/dist/client/assets/{integration-icon-XUOEUOb8.js → integration-icon-BCAGJ22m.js} +1 -1
  185. package/dist/client/assets/item-actions-B4f3ZYnI.js +1 -0
  186. package/dist/client/assets/{jira-icon-B48lqxRs.js → jira-icon-B0PrtQPW.js} +1 -1
  187. package/dist/client/assets/{label-DSlWCd9e.js → label-BFX3DXnu.js} +1 -1
  188. package/dist/client/assets/{layout-QjOyVmz4.js → layout-GEd6141D.js} +1 -1
  189. package/dist/client/assets/{legacy-admin-welcome-dialog-DWeHIzCA.js → legacy-admin-welcome-dialog-CjbAHNU0.js} +1 -1
  190. package/dist/client/assets/legacy-agents-deep-BRMRDtxS.js +1 -0
  191. package/dist/client/assets/{legacy-main-redirect-h5ds91_H.js → legacy-main-redirect-Cpcnm12P.js} +1 -1
  192. package/dist/client/assets/library-GlSV21no.js +1 -0
  193. package/dist/client/assets/{library-tab-DI2mHZkf.js → library-tab-DiZQg1qQ.js} +2 -2
  194. package/dist/client/assets/{login-DgKeSKz2.js → login-DUNIcOhP.js} +1 -1
  195. package/dist/client/assets/{markdown-BTKw4nl8.js → markdown-sWsq0zMA.js} +5 -5
  196. package/dist/client/assets/{mcp-app-renderer-BT9_tzyT.js → mcp-app-renderer-DSMzeo3v.js} +1 -1
  197. package/dist/client/assets/{mcp-oauth-BQRDLkqA.js → mcp-oauth-Cal4irlG.js} +1 -1
  198. package/dist/client/assets/{mcp-oauth-1Tp9szFm.js → mcp-oauth-DFWIYz5V.js} +1 -1
  199. package/dist/client/assets/members-D9DcuyAK.js +1 -0
  200. package/dist/client/assets/memory-DYN3365K.js +7 -0
  201. package/dist/client/assets/mock-board-llSJ1DSL.js +10 -0
  202. package/dist/client/assets/{monaco-editor-DTLNzmeB.js → monaco-editor-4_N5zBDQ.js} +1 -1
  203. package/dist/client/assets/{monitoring-CRmBvi8F.js → monitoring-5YgUKCBd.js} +2 -2
  204. package/dist/client/assets/{monitoring-stats-row-G2RBze7B.js → monitoring-stats-row-BCaHkQz9.js} +1 -1
  205. package/dist/client/assets/multi-select-B4K-daTY.js +1 -0
  206. package/dist/client/assets/{mustache-p2j_fCOZ.js → mustache-B8t03rZ4.js} +1 -1
  207. package/dist/client/assets/{named-rule-step-BJ5LyK07.js → named-rule-step-P0BFUtVs.js} +1 -1
  208. package/dist/client/assets/named-rule-view-CvRYAekO.js +1 -0
  209. package/dist/client/assets/new-project-dialog-DI67z-Vr.js +1 -0
  210. package/dist/client/assets/new-project-store-DoliA5Iq.js +1 -0
  211. package/dist/client/assets/{oauth-callback-Cg1KjIf_.js → oauth-callback-DtdbhW3N.js} +1 -1
  212. package/dist/client/assets/{oauth-callback-ai-provider-hOquTBPU.js → oauth-callback-ai-provider-iNwVQAC1.js} +1 -1
  213. package/dist/client/assets/{oauth-consent-CzhJum4d.js → oauth-consent-Co0jE424.js} +1 -1
  214. package/dist/client/assets/{onboarding-FLu6ztJj.js → onboarding-Dn4ndntc.js} +1 -1
  215. package/dist/client/assets/openai-conversation-D43N7JcR.js +3 -0
  216. package/dist/client/assets/{optimistic-project-sidebar-views-D6axz004.js → optimistic-project-sidebar-views-PUKP14F8.js} +1 -1
  217. package/dist/client/assets/order-monitor-day-fHekYy64.js +1 -0
  218. package/dist/client/assets/{organization-choice-dV-mJr-d.js → organization-choice-Ctd80SL2.js} +1 -1
  219. package/dist/client/assets/orgs-BQeWnD4l.js +1 -0
  220. package/dist/client/assets/own-accounts-section-CwzdBIu0.js +1 -0
  221. package/dist/client/assets/pair-Du2wOAPA.js +48 -0
  222. package/dist/client/assets/{parse-sections-Cy8SKsEh.js → parse-sections-DUEfhNb0.js} +4 -4
  223. package/dist/client/assets/plan-BDh0er6r.js +1 -0
  224. package/dist/client/assets/{plan-ladder-xVKcSuhD.js → plan-ladder-cJHOFEt_.js} +1 -1
  225. package/dist/client/assets/{plan-usage-card-Cxjcl-tF.js → plan-usage-card-DnCWaNBs.js} +1 -1
  226. package/dist/client/assets/{popover-CelLmvH8.js → popover-XZWwzjJe.js} +1 -1
  227. package/dist/client/assets/post-calendar-Cq2VElZ4.js +1 -0
  228. package/dist/client/assets/{post-editor-DkdXE0U4.js → post-editor-ChZHYnmE.js} +2 -2
  229. package/dist/client/assets/preview-content-Ct9U0F_F.js +1 -0
  230. package/dist/client/assets/{preview-dialog-BTVSDgVC.js → preview-dialog-BlN_MeAY.js} +1 -1
  231. package/dist/client/assets/{preview-panel-COaKD6oK.js → preview-panel-CMaIBxrS.js} +1 -1
  232. package/dist/client/assets/preview-tab-rp6yyGU1.js +557 -0
  233. package/dist/client/assets/product-picker-dialog-Cp5iroCv.js +1 -0
  234. package/dist/client/assets/profile-BvhSJiAV.js +1 -0
  235. package/dist/client/assets/project-app-view-BPtWGCfo.js +1 -0
  236. package/dist/client/assets/project-apps-CDSLxQ6C.js +1 -0
  237. package/dist/client/assets/{project-icon-TEwy-duh.js → project-icon-C_Qws_Ah.js} +1 -1
  238. package/dist/client/assets/{project-index-DqRiC0zN.js → project-index-dmu51Z_5.js} +1 -1
  239. package/dist/client/assets/project-reports-BVUPVqwF.js +1 -0
  240. package/dist/client/assets/project-tasks-i5QwXcB1.js +1 -0
  241. package/dist/client/assets/projects-9cB_xTYP.js +1 -0
  242. package/dist/client/assets/{projects-empty-state-OMTDG8SV.js → projects-empty-state-ZoaV8gjs.js} +1 -1
  243. package/dist/client/assets/{prompts-TP7YCuz6.js → prompts-DfPwtsSz.js} +1 -1
  244. package/dist/client/assets/record-editor-BQX3fl3B.js +1 -0
  245. package/dist/client/assets/redirect-editor-DmgDoBZW.js +1 -0
  246. package/dist/client/assets/{reports-CvxegUiQ.js → reports-B7Mq5ojT.js} +1 -1
  247. package/dist/client/assets/reports-Dmcxcdt8.js +1 -0
  248. package/dist/client/assets/reports-onboarding-DnVjGniS.js +1 -0
  249. package/dist/client/assets/reports-tab-D7WrLBuD.js +2 -0
  250. package/dist/client/assets/repositories-B6qJORdw.js +1 -0
  251. package/dist/client/assets/repositories-CKo-J8oc.js +1 -0
  252. package/dist/client/assets/{repository-binding-DGc5VhVW.js → repository-binding-Cqb4hBI0.js} +1 -1
  253. package/dist/client/assets/{repository-picker-DO5Hy-o-.js → repository-picker-B967M4cj.js} +1 -1
  254. package/dist/client/assets/{require-capability-CCGZ96D-.js → require-capability-CnRgBqvn.js} +1 -1
  255. package/dist/client/assets/{required-auth-layout-DoMwdVaZ.js → required-auth-layout-DwZV69de.js} +1 -1
  256. package/dist/client/assets/{reset-password-B672rI1V.js → reset-password-DBlLRH7P.js} +1 -1
  257. package/dist/client/assets/resizable-Ddu9Pik_.js +1 -0
  258. package/dist/client/assets/resolve-tab-icon-C5v6XuFJ.js +1 -0
  259. package/dist/client/assets/{review-settings-B8FCs2a_.js → review-settings-_NtVHX9D.js} +1 -1
  260. package/dist/client/assets/{role-color-CPDxseg4.js → role-color-CYCY1ZHM.js} +1 -1
  261. package/dist/client/assets/roles-BOIysbZW.js +1 -0
  262. package/dist/client/assets/route-B2eUAr3E.js +1 -0
  263. package/dist/client/assets/route-DjNFlT9m.js +1 -0
  264. package/dist/client/assets/route-l3dfZAcw.js +1 -0
  265. package/dist/client/assets/route-page-header-x4fiBRQK.js +1 -0
  266. package/dist/client/assets/{sandbox-git-api-3zULVhcU.js → sandbox-git-api-CX3IYPAX.js} +1 -1
  267. package/dist/client/assets/{sandbox-lifecycle-context-BEzUu66E.js → sandbox-lifecycle-context-CsmYXarj.js} +1 -1
  268. package/dist/client/assets/save-status-DM-afM9Q.js +1 -0
  269. package/dist/client/assets/{schema-DIJe3qA1.js → schema-Bh0CFZUA.js} +1 -1
  270. package/dist/client/assets/{schema-BtzAS_P2.js → schema-CsGAsuNy.js} +1 -1
  271. package/dist/client/assets/{scroll-area-mVo2jhxQ.js → scroll-area-DkuLv9J_.js} +1 -1
  272. package/dist/client/assets/{search-input-ChnwrZA6.js → search-input-Yj0UUhbr.js} +1 -1
  273. package/dist/client/assets/{search-toggle-CC4Rs40x.js → search-toggle-CTqn74j5.js} +1 -1
  274. package/dist/client/assets/{secret-picker-CWGbJrCR.js → secret-picker-FNSDTzDT.js} +1 -1
  275. package/dist/client/assets/secrets-DnkJAwly.js +1 -0
  276. package/dist/client/assets/{section-array-field-4mOiVd7b.js → section-array-field-DbmoEjb3.js} +1 -1
  277. package/dist/client/assets/sections-Bk5O8laV.js +1 -0
  278. package/dist/client/assets/sections-editor-BYa3JqlT.js +1 -0
  279. package/dist/client/assets/select-DqZVtjvu.js +1 -0
  280. package/dist/client/assets/{select-model-BqTl5eD-.js → select-model-D_3F7ch9.js} +1 -1
  281. package/dist/client/assets/{seo-editor-iaqzR9NS.js → seo-editor-alLFkZ3V.js} +1 -1
  282. package/dist/client/assets/{separator-CwN-gidC.js → separator-DOH2DVT3.js} +1 -1
  283. package/dist/client/assets/session-runtime-DaEm9VzJ.js +1 -0
  284. package/dist/client/assets/settings-tab-Dnn9Ngte.js +1 -0
  285. package/dist/client/assets/{sheet-1BLiVjE3.js → sheet-B3BCtfXu.js} +1 -1
  286. package/dist/client/assets/shell-layout-BMy93BCc.js +1 -0
  287. package/dist/client/assets/{site-draft-actions-GLib44bU.js → site-draft-actions-C2zLtAMz.js} +5 -5
  288. package/dist/client/assets/site-draft-view-ikG8CMuB.js +1 -0
  289. package/dist/client/assets/site-editor-B8VlT5Kv.js +1 -0
  290. package/dist/client/assets/site-editor-toast-GAJZE2A0.js +1 -0
  291. package/dist/client/assets/skills-dIhMA0Ze.js +1 -0
  292. package/dist/client/assets/{slider-BKrw7nqs.js → slider-DirLi5JL.js} +1 -1
  293. package/dist/client/assets/{sortable.esm-CA_k0RaZ.js → sortable.esm-B3zbNG6q.js} +1 -1
  294. package/dist/client/assets/sso-tZNmyRgp.js +1 -0
  295. package/dist/client/assets/{suggestion-BdOz28RC.js → suggestion-bCd1m59t.js} +1 -1
  296. package/dist/client/assets/{super-agent-icon-DExAOD4i.js → super-agent-icon-AJ6ZRe5V.js} +1 -1
  297. package/dist/client/assets/{switch-B60LgmjA.js → switch-BviC1co2.js} +1 -1
  298. package/dist/client/assets/{synced-repos-DfFbkdSN.js → synced-repos-DsEdkMaA.js} +1 -1
  299. package/dist/client/assets/{tab-icon-glyph-MzzsG5oc.js → tab-icon-glyph-DkjrfS6l.js} +1 -1
  300. package/dist/client/assets/{table-KEskYvtS.js → table-DX15DDx1.js} +1 -1
  301. package/dist/client/assets/{tabs-DXm_rA9S.js → tabs-BiFBpWbA.js} +1 -1
  302. package/dist/client/assets/task-board-DD2iUGL4.js +1 -0
  303. package/dist/client/assets/{core.esm-YEEWezEY.js → task-key-DP7js_2-.js} +2 -2
  304. package/dist/client/assets/task-route-Bfb6XWlb.js +1 -0
  305. package/dist/client/assets/{task-status-Bn4DeOrT.js → task-status-CBWakThc.js} +1 -1
  306. package/dist/client/assets/taskboard-analytics-B5XiM0gZ.js +1 -0
  307. package/dist/client/assets/{tasks-fWq-fqoJ.js → tasks-BPwrQv5-.js} +3 -3
  308. package/dist/client/assets/tasks-ip1BqsyR.js +1 -0
  309. package/dist/client/assets/{textarea-CRgCAK3p.js → textarea-BoSVR1xB.js} +1 -1
  310. package/dist/client/assets/thread-analytics-B3wSdPFK.js +1 -0
  311. package/dist/client/assets/thread-button-CIHD7120.js +1 -0
  312. package/dist/client/assets/{thread-intent-DrRX6nG0.js → thread-intent-DpzwhK2y.js} +6 -6
  313. package/dist/client/assets/thread-route-Bdw4g7Hg.js +1 -0
  314. package/dist/client/assets/thread-route-D4mea9ep.js +1 -0
  315. package/dist/client/assets/thread-sheet-body-C1_HCALD.js +1 -0
  316. package/dist/client/assets/time-range-picker-B9_5lQqT.js +1 -0
  317. package/dist/client/assets/{toggle-group-JYZ1PCaE.js → toggle-group-l7lV2Oqp.js} +1 -1
  318. package/dist/client/assets/{tool-set-selector-DTAr1xzz.js → tool-set-selector-BQISxiF9.js} +1 -1
  319. package/dist/client/assets/{toolbar-icon-button-B0M5XFng.js → toolbar-icon-button-CflJ2Qid.js} +1 -1
  320. package/dist/client/assets/{tooltip-D9qNlq6S.js → tooltip-BTd3W-2Z.js} +1 -1
  321. package/dist/client/assets/{tooltipContext-B94TDN-Q.js → tooltipContext-De8eALzu.js} +1 -1
  322. package/dist/client/assets/{track-DJVHN5Lv.js → track-BBHYiJkY.js} +1 -1
  323. package/dist/client/assets/{types-BfPC7vnd.js → types-C8b3acwX.js} +1 -1
  324. package/dist/client/assets/{url-slug-Bts08KOo.js → url-slug-gNlq1cKV.js} +1 -1
  325. package/dist/client/assets/{usage-stats-CK4hgSt6.js → usage-stats-Bk_1jh1-.js} +2 -2
  326. package/dist/client/assets/{use-ai-providers-CxZCPqVC.js → use-ai-providers-Cya2RotC.js} +1 -1
  327. package/dist/client/assets/use-api-keys-BdlPKuv4.js +1 -0
  328. package/dist/client/assets/use-apply-named-rule-CcoLpt-_.js +1 -0
  329. package/dist/client/assets/use-ask-in-chat-B_ARVX9A.js +1 -0
  330. package/dist/client/assets/{use-automations-B7d02VWl.js → use-automations-CerQ9Qaj.js} +1 -1
  331. package/dist/client/assets/{use-autosave-DOc72aWE.js → use-autosave-CQa7WbXM.js} +1 -1
  332. package/dist/client/assets/use-blocks-v8-project-BedqZgtc.js +1 -0
  333. package/dist/client/assets/use-blog-view-9s3Vkx1q.js +1 -0
  334. package/dist/client/assets/use-chat-layout-state-CWt5k1nY.js +1 -0
  335. package/dist/client/assets/{use-cms-publish-actions-DimSJzWP.js → use-cms-publish-actions-7QluCfa8.js} +4 -4
  336. package/dist/client/assets/use-connect-companion-B8Oqj7MQ.js +1 -0
  337. package/dist/client/assets/{use-connection-CFmR-X06.js → use-connection-2s3z_IKD.js} +1 -1
  338. package/dist/client/assets/{use-content-sync-BEqIA-0g.js → use-content-sync-DxzP8nN9.js} +1 -1
  339. package/dist/client/assets/{use-copy-PziytufC.js → use-copy-sOY8Yuot.js} +1 -1
  340. package/dist/client/assets/use-current-view-EjRzX02x.js +1 -0
  341. package/dist/client/assets/{use-date-fns-locale-BVsHKqDt.js → use-date-fns-locale-DjDbgiCF.js} +1 -1
  342. package/dist/client/assets/{use-debounced-autosave-CU3dUlJX.js → use-debounced-autosave--lHIRoNY.js} +1 -1
  343. package/dist/client/assets/{use-debounced-value-DJ5YZsat.js → use-debounced-value-RJW46-1q.js} +1 -1
  344. package/dist/client/assets/{use-deco-credits-_9aC49vI.js → use-deco-credits-d4Nbb0l0.js} +1 -1
  345. package/dist/client/assets/use-decopilot-events-BGpwG8Pb.js +1 -0
  346. package/dist/client/assets/use-delete-block-BR5smTsV.js +1 -0
  347. package/dist/client/assets/{use-delete-connection-Bp9D22pQ.js → use-delete-connection-DHkW3H9t.js} +1 -1
  348. package/dist/client/assets/{use-deployment-admin-D8TSoW7b.js → use-deployment-admin-j92yIioi.js} +1 -1
  349. package/dist/client/assets/{use-entitlements-Chh3D10H.js → use-entitlements-DtyegfyM.js} +1 -1
  350. package/dist/client/assets/use-fast-preview-draft-url-B4HFa9pK.js +1 -0
  351. package/dist/client/assets/{use-file-configs-8VTVKs7P.js → use-file-configs-CzyibAGV.js} +1 -1
  352. package/dist/client/assets/{use-id-selection-LGL3_97F.js → use-id-selection-DSQKok9P.js} +1 -1
  353. package/dist/client/assets/use-in-settings-DLJEfljS.js +1 -0
  354. package/dist/client/assets/{use-inbox-feed-DjVLN02v.js → use-inbox-feed-BNnBKFlA.js} +1 -1
  355. package/dist/client/assets/{use-infinite-scroll-BBVWbqWO.js → use-infinite-scroll-D1tYrKq7.js} +1 -1
  356. package/dist/client/assets/{use-join-requests-4dddz-2V.js → use-join-requests-CSjMfH5p.js} +1 -1
  357. package/dist/client/assets/use-main-panel-tabs-CllMGKzI.js +1 -0
  358. package/dist/client/assets/use-mcp-auth-status-DS0pbV57.js +1 -0
  359. package/dist/client/assets/{use-mcp-client-CaYmuD4l.js → use-mcp-client-Cvc3WWPF.js} +2 -2
  360. package/dist/client/assets/{use-mcp-prompts-lHtFGIni.js → use-mcp-prompts-Ck1uv43A.js} +1 -1
  361. package/dist/client/assets/{use-mcp-tools-COoBOTb8.js → use-mcp-tools-BIzewITl.js} +1 -1
  362. package/dist/client/assets/{use-mobile-B0YlxBUo.js → use-mobile-CG2XwDbe.js} +1 -1
  363. package/dist/client/assets/{use-move-blocks-CRsMTnFT.js → use-move-blocks-Dv6zyDyx.js} +1 -1
  364. package/dist/client/assets/{use-navigate-to-agent-D9u86crS.js → use-navigate-to-agent-BFBISUMc.js} +1 -1
  365. package/dist/client/assets/use-never-published-D3zJmakm.js +1 -0
  366. package/dist/client/assets/{use-org-fs-Cv09aZqm.js → use-org-fs-BfE7L8cf.js} +1 -1
  367. package/dist/client/assets/use-org-notice-DghJzmC_.js +1 -0
  368. package/dist/client/assets/{use-org-repo-syncs-CKUvsIrW.js → use-org-repo-syncs-CU3MGWk9.js} +1 -1
  369. package/dist/client/assets/{use-org-sso-CBrdU305.js → use-org-sso-C8BMUr72.js} +1 -1
  370. package/dist/client/assets/{use-organization-settings-BWLJTTpw.js → use-organization-settings-Ddjh427l.js} +1 -1
  371. package/dist/client/assets/use-panel-navigate-V2MXWXLu.js +1 -0
  372. package/dist/client/assets/use-project-native-view-presence-EdJBeOw9.js +1 -0
  373. package/dist/client/assets/use-project-scope-COzEo5Zz.js +1 -0
  374. package/dist/client/assets/use-recent-apps-BpR_nbgz.js +1 -0
  375. package/dist/client/assets/{use-reports-diagnostic-CgjecoRR.js → use-reports-diagnostic-DYf7sFCj.js} +1 -1
  376. package/dist/client/assets/use-sandbox-events-cbWqZuIm.js +2 -0
  377. package/dist/client/assets/{use-secrets-D46GKExN.js → use-secrets-BamKWPUs.js} +1 -1
  378. package/dist/client/assets/{use-section-preview-base-BO578O9L.js → use-section-preview-base-Cy_X_Jjl.js} +1 -1
  379. package/dist/client/assets/use-sidebar-collapsed-CGkkkrTj.js +1 -0
  380. package/dist/client/assets/{use-tags-LwHF4ikl.js → use-tags-staoqXQp.js} +1 -1
  381. package/dist/client/assets/{use-task-board-analytics-TZTLLgky.js → use-task-board-analytics-C5Dsg-uV.js} +1 -1
  382. package/dist/client/assets/{use-task-board-item-prs-BW_n16vt.js → use-task-board-item-prs-DsFjq28v.js} +1 -1
  383. package/dist/client/assets/use-task-board-items-OgSDu-ag.js +1 -0
  384. package/dist/client/assets/{use-task-board-prompts-CHIblyN4.js → use-task-board-prompts-Bn4-yS6Z.js} +1 -1
  385. package/dist/client/assets/{use-task-metadata-DdKhuIQ3.js → use-task-metadata-Bc8o5Sts.js} +1 -1
  386. package/dist/client/assets/{use-thread-outputs-DsjZa1n5.js → use-thread-outputs-Co5bznxQ.js} +1 -1
  387. package/dist/client/assets/use-view-draft-kind-BdwsMdex.js +1 -0
  388. package/dist/client/assets/use-voice-input-CwLNuWlo.js +1 -0
  389. package/dist/client/assets/useInfiniteQuery-BagPKS5m.js +1 -0
  390. package/dist/client/assets/{useQueries-B8jtB-RW.js → useQueries-BjVZ4kPO.js} +1 -1
  391. package/dist/client/assets/useSuspenseInfiniteQuery-BUmkwIx5.js +1 -0
  392. package/dist/client/assets/{users-zlgoDQuW.js → users-CPRHIyd2.js} +1 -1
  393. package/dist/client/assets/utils-DPEBLDgi.js +4 -0
  394. package/dist/client/assets/variant-calendar-Dlw46bNO.js +1 -0
  395. package/dist/client/assets/{variant-matcher-override-BKIrGg8S.js → variant-matcher-override-ChW3ijK5.js} +1 -1
  396. package/dist/client/assets/{view-header-OfKMmhb0.js → view-header-D4oknAV1.js} +1 -1
  397. package/dist/client/assets/virtual-mcp-nhrh3mtw.js +1 -0
  398. package/dist/client/assets/{watch-sse-pool-B39Ow5tK.js → watch-sse-pool-CTgVk3NA.js} +1 -1
  399. package/dist/client/index.html +2 -2
  400. package/dist/server/server.js +1 -1
  401. package/package.json +1 -1
  402. package/dist/client/assets/ChevronUp-DM7pn8nV.js +0 -1
  403. package/dist/client/assets/LinkBroken01-4l2zZef9.js +0 -1
  404. package/dist/client/assets/Tool01-BlUlKjGy.js +0 -1
  405. package/dist/client/assets/agent-app-qCE6mpox.js +0 -1
  406. package/dist/client/assets/agent-assets-BERkZgBg.js +0 -1
  407. package/dist/client/assets/agent-automation-B3znFoJv.js +0 -20
  408. package/dist/client/assets/agent-automations-BI5n1DEk.js +0 -1
  409. package/dist/client/assets/agent-blog-DFA4iTY2.js +0 -2
  410. package/dist/client/assets/agent-blog-post-CJzR6SRp.js +0 -2
  411. package/dist/client/assets/agent-calendar-DCBRCsam.js +0 -1
  412. package/dist/client/assets/agent-connect-sources-BvH_YwiD.js +0 -1
  413. package/dist/client/assets/agent-deck-C_9xRnWL.js +0 -1
  414. package/dist/client/assets/agent-e2e-B2FpHDAG.js +0 -1
  415. package/dist/client/assets/agent-experiments-BDFLMLOM.js +0 -1
  416. package/dist/client/assets/agent-file-CAkn0Q5x.js +0 -1
  417. package/dist/client/assets/agent-hosting-D0d8gHPR.js +0 -1
  418. package/dist/client/assets/agent-icon-CpMz1pSC.js +0 -1
  419. package/dist/client/assets/agent-library-Cs6jlCDK.js +0 -1
  420. package/dist/client/assets/agent-library-file-DV2qsJC9.js +0 -1
  421. package/dist/client/assets/agent-overview-IBMGymrh.js +0 -1
  422. package/dist/client/assets/agent-releases-k0DaB9LQ.js +0 -2
  423. package/dist/client/assets/agent-settings-DF71XJZP.js +0 -1
  424. package/dist/client/assets/agent-site-editor-code-gfgfb7xF.js +0 -2
  425. package/dist/client/assets/agent-site-editor-content-C07hh63_.js +0 -1
  426. package/dist/client/assets/agent-site-editor-preview-CFg2FnqN.js +0 -1
  427. package/dist/client/assets/agent-view-CzQtfKwQ.js +0 -1
  428. package/dist/client/assets/agent-view-guard-XdI97YrW.js +0 -1
  429. package/dist/client/assets/ai-providers-DoacYpUR.js +0 -1
  430. package/dist/client/assets/analytics-sections-DNjeT1Pf.js +0 -1
  431. package/dist/client/assets/api-keys-Bbyyi1IV.js +0 -1
  432. package/dist/client/assets/api-keys-CLzhmgUv.js +0 -1
  433. package/dist/client/assets/app-editor-Cd7oWsvo.js +0 -1
  434. package/dist/client/assets/automation-list-row-COaiktOt.js +0 -1
  435. package/dist/client/assets/automations-BvZ8wxJr.js +0 -1
  436. package/dist/client/assets/blog-schema-PWQlG4FM.js +0 -1
  437. package/dist/client/assets/blog-view-gate-BpiHsFQi.js +0 -1
  438. package/dist/client/assets/buckets-r-Vn310N.js +0 -1
  439. package/dist/client/assets/calendar-DkvAGmxG.js +0 -1
  440. package/dist/client/assets/category-editor-D53-0-dG.js +0 -1
  441. package/dist/client/assets/chat-context-Na_9rQo_.js +0 -39
  442. package/dist/client/assets/choose-editor-DFYfaLQ4.js +0 -1
  443. package/dist/client/assets/cms-settings-editor-BLtwrg_Q.js +0 -1
  444. package/dist/client/assets/collection-detail-BdQUzwBw.js +0 -1
  445. package/dist/client/assets/config-DhSdzr_l.js +0 -1
  446. package/dist/client/assets/connect-DwtFEmWa.js +0 -9
  447. package/dist/client/assets/connection-detail-Bm5pNgz3.js +0 -1
  448. package/dist/client/assets/connection-slug-CqKJM07D.js +0 -1
  449. package/dist/client/assets/connections-8N6-U8BU.js +0 -1
  450. package/dist/client/assets/context-CdMMXT5s.js +0 -1
  451. package/dist/client/assets/discover-DhvRjqxh.js +0 -1
  452. package/dist/client/assets/experiments-tab-choice-Ch-KXcUZ.js +0 -1
  453. package/dist/client/assets/feature-gate-BsIQ70jm.js +0 -1
  454. package/dist/client/assets/file-explorer-DpEdUCiL.js +0 -2
  455. package/dist/client/assets/file-share-button-D9sAYI1R.js +0 -3
  456. package/dist/client/assets/folder-icon-D4-RUOt8.js +0 -1
  457. package/dist/client/assets/general-Bt-teqGz.js +0 -1
  458. package/dist/client/assets/home-CIpHO2ej.js +0 -1
  459. package/dist/client/assets/home-overview-9H7C1hoB.js +0 -1
  460. package/dist/client/assets/index-BqWale_V.css +0 -1
  461. package/dist/client/assets/index-DCl7HPjQ.js +0 -1
  462. package/dist/client/assets/index-DN9fxTzN.js +0 -1
  463. package/dist/client/assets/index-DuYneP0E.js +0 -1
  464. package/dist/client/assets/index-tLhNg31B.js +0 -4
  465. package/dist/client/assets/infra-billing-C3ShZZOT.js +0 -1
  466. package/dist/client/assets/input-GqBshPf5.js +0 -17
  467. package/dist/client/assets/item-actions-BfBBT1Qz.js +0 -1
  468. package/dist/client/assets/legacy-agents-deep-COHFWDWb.js +0 -1
  469. package/dist/client/assets/library-BMXElwFo.js +0 -1
  470. package/dist/client/assets/members-DQZtkBei.js +0 -1
  471. package/dist/client/assets/memory-B82F2Q7k.js +0 -7
  472. package/dist/client/assets/mock-board-B7BOXAS7.js +0 -10
  473. package/dist/client/assets/multi-select-ykLyfeEh.js +0 -1
  474. package/dist/client/assets/named-rule-view-BBEm0z_K.js +0 -1
  475. package/dist/client/assets/new-project-dialog-C3JFSI1q.js +0 -1
  476. package/dist/client/assets/openai-conversation-DhsFXaEr.js +0 -3
  477. package/dist/client/assets/order-monitor-day-CQJg9ymu.js +0 -1
  478. package/dist/client/assets/orgs-DafOcWKJ.js +0 -1
  479. package/dist/client/assets/own-accounts-section-BitxRWkd.js +0 -1
  480. package/dist/client/assets/pair-Dsc6GXhQ.js +0 -48
  481. package/dist/client/assets/plan-5t2sCqh-.js +0 -1
  482. package/dist/client/assets/post-calendar-DkUmj6jK.js +0 -1
  483. package/dist/client/assets/preview-content-Di9jV9fD.js +0 -1
  484. package/dist/client/assets/preview-tab-BFi8NHe-.js +0 -557
  485. package/dist/client/assets/product-picker-dialog-tqTphLK7.js +0 -1
  486. package/dist/client/assets/profile-ItK6hTrx.js +0 -1
  487. package/dist/client/assets/project-app-view-CMAf9Mlz.js +0 -1
  488. package/dist/client/assets/project-apps-ByyLejju.js +0 -1
  489. package/dist/client/assets/project-reports-CPvLPQcs.js +0 -1
  490. package/dist/client/assets/project-tasks-B88cPPXW.js +0 -1
  491. package/dist/client/assets/projects-FY3sblQl.js +0 -1
  492. package/dist/client/assets/record-editor-IJLTcCdR.js +0 -1
  493. package/dist/client/assets/redirect-editor-B2-M7doi.js +0 -1
  494. package/dist/client/assets/reports-ODcJFAP-.js +0 -1
  495. package/dist/client/assets/reports-onboarding-BicRsxJF.js +0 -1
  496. package/dist/client/assets/reports-tab-CCY5hBR2.js +0 -2
  497. package/dist/client/assets/repositories-C0edGPcS.js +0 -1
  498. package/dist/client/assets/repositories-V6vmPwSM.js +0 -1
  499. package/dist/client/assets/resizable-DrLaW_Jl.js +0 -1
  500. package/dist/client/assets/resolve-tab-icon-CfRdrLF-.js +0 -1
  501. package/dist/client/assets/roles-BYqU9-We.js +0 -1
  502. package/dist/client/assets/route-BXYvPulM.js +0 -1
  503. package/dist/client/assets/route-Bh9fCZXT.js +0 -1
  504. package/dist/client/assets/route-a1KQq-lz.js +0 -1
  505. package/dist/client/assets/save-status-Cx3aKwGu.js +0 -1
  506. package/dist/client/assets/secrets-DE59ARp-.js +0 -1
  507. package/dist/client/assets/sections-B1sv3rvB.js +0 -1
  508. package/dist/client/assets/sections-editor-sTEVWcAy.js +0 -1
  509. package/dist/client/assets/select-BNoZ1cwH.js +0 -1
  510. package/dist/client/assets/settings-tab-H1Nf96Yz.js +0 -1
  511. package/dist/client/assets/shell-layout-BHtZVBED.js +0 -1
  512. package/dist/client/assets/site-draft-view-CKK7PKoH.js +0 -1
  513. package/dist/client/assets/site-editor-Bl3uFRW-.js +0 -1
  514. package/dist/client/assets/site-editor-toast-BXRGIPuY.js +0 -1
  515. package/dist/client/assets/skills-Q6l6j9x7.js +0 -1
  516. package/dist/client/assets/sso-C4bCFgaT.js +0 -1
  517. package/dist/client/assets/task-board-CdhOR9bl.js +0 -1
  518. package/dist/client/assets/task-key-BCHdFiOO.js +0 -1
  519. package/dist/client/assets/task-route-DeSbQRkP.js +0 -1
  520. package/dist/client/assets/taskboard-analytics-CRI_d1NW.js +0 -1
  521. package/dist/client/assets/tasks-DGRURa32.js +0 -1
  522. package/dist/client/assets/thread-analytics-aoAc3KR6.js +0 -1
  523. package/dist/client/assets/thread-route-D404Xl1w.js +0 -1
  524. package/dist/client/assets/thread-route-L_F2dRjs.js +0 -1
  525. package/dist/client/assets/thread-sheet-body-D3DOFB6A.js +0 -1
  526. package/dist/client/assets/time-range-picker-DouTd8PJ.js +0 -1
  527. package/dist/client/assets/tool-namespace-BBpCD9sF.js +0 -1
  528. package/dist/client/assets/use-apply-named-rule-h1W6SPpC.js +0 -1
  529. package/dist/client/assets/use-ask-in-chat-D4gRql_N.js +0 -1
  530. package/dist/client/assets/use-blocks-v8-project-BLLvbZl2.js +0 -1
  531. package/dist/client/assets/use-chat-layout-state-DQhX2zdi.js +0 -1
  532. package/dist/client/assets/use-connect-companion-CqTyzSlz.js +0 -1
  533. package/dist/client/assets/use-decopilot-events-B84nN_Z6.js +0 -1
  534. package/dist/client/assets/use-delete-block-BbJuByhU.js +0 -1
  535. package/dist/client/assets/use-fast-preview-draft-url-DRtzWCS3.js +0 -1
  536. package/dist/client/assets/use-main-panel-tabs-Bq834oWY.js +0 -1
  537. package/dist/client/assets/use-mcp-auth-status-ewp8JzH8.js +0 -1
  538. package/dist/client/assets/use-never-published-BRSQAhRd.js +0 -1
  539. package/dist/client/assets/use-project-native-view-presence-D5R7YysD.js +0 -1
  540. package/dist/client/assets/use-project-scope-Dzg0nsjs.js +0 -1
  541. package/dist/client/assets/use-recent-apps-BKAftwoT.js +0 -1
  542. package/dist/client/assets/use-sandbox-events-BtXLDGZr.js +0 -2
  543. package/dist/client/assets/use-sidebar-collapsed-x7SsKYNl.js +0 -1
  544. package/dist/client/assets/use-task-board-events-U_kvLTo1.js +0 -1
  545. package/dist/client/assets/use-task-board-items-B66t-aAy.js +0 -1
  546. package/dist/client/assets/use-view-draft-kind-BtHf66Jj.js +0 -1
  547. package/dist/client/assets/use-voice-input-Li611DFd.js +0 -1
  548. package/dist/client/assets/useInfiniteQuery-CN2uIy97.js +0 -1
  549. package/dist/client/assets/useSuspenseInfiniteQuery-ECHIzp7d.js +0 -1
  550. package/dist/client/assets/utils-DONok1LX.js +0 -4
  551. package/dist/client/assets/variant-calendar-CjAgTw5u.js +0 -1
  552. package/dist/client/assets/virtual-mcp-BKUZFB3-.js +0 -1
@@ -1 +1 @@
1
- import{c as lt,m as J,j as l}from"./index-BP527m3V.js";import{C as Q,c as Z,B as mt,b as ut}from"./chart-DP-afdSL.js";import{C as tt,X as et,Y as at}from"./CartesianChart-43C3tGyF.js";import{a as dt,A as ht}from"./AreaChart-DcNurrpT.js";import{C as pt}from"./tooltipContext-B94TDN-Q.js";const it=60*1e3,P=60*it,xt=24*P,st=25*P;function q(s,t){if(s.length===0)return 0;const r=[...s].sort((f,c)=>f-c),e=Math.max(0,Math.min(r.length-1,Math.ceil(t*r.length)-1));return r[e]??0}function gt(s,t){return t<=st?s.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):s.toLocaleDateString([],{month:"short",day:"numeric"})}function yt(s,t){const r=t-s;return r<=P?Math.max(1,Math.min(60,Math.ceil(r/it))):r<=st?Math.max(1,Math.min(25,Math.ceil(r/P))):Math.max(1,Math.min(31,Math.ceil(r/xt)))}function kt(s,t,r,e){const f=t.getTime(),c=r.getTime(),h=Math.max(1,c-f),n=yt(f,c),g=Math.max(1,Math.floor(h/n)),a=[];for(let o=0;o<n;o++){const i=new Date(f+o*g);a.push({t:i.toISOString(),ts:i.getTime(),label:gt(i,h),calls:0,errors:0,durations:[]})}for(const o of s){const i=new Date(o.timestamp).getTime(),m=Math.floor((i-f)/g),x=Math.max(0,Math.min(n-1,m)),u=a[x];u&&(u.calls+=1,o.isError&&(u.errors+=1),Number.isFinite(o.durationMs)&&u.durations.push(o.durationMs))}return a.map(o=>({t:o.t,ts:o.ts,label:o.label,calls:o.calls,errors:o.errors,errorRate:o.calls>0?o.errors/o.calls*100:0,avg:Math.round(o.durations.length>0?o.durations.reduce((i,m)=>i+m,0)/o.durations.length:0),p50:Math.round(q(o.durations,.5)),p95:Math.round(q(o.durations,.95))}))}function _t(s,t,r,e,f){const c=e??s.length,h=f??s.filter(i=>i.isError).length,n=s.map(i=>i.durationMs),g=n.length>0?n.reduce((i,m)=>i+m,0)/n.length:0,a=q(n,.95),o=kt(s,t.startDate,t.endDate);return{totalCalls:c,totalErrors:h,avgDurationMs:g,p95DurationMs:a,data:o}}function ot(s){return s>=1e3?`${(s/1e3).toFixed(1)}k`:String(s)}function rt(s){const t=lt.c(19),{active:r,payload:e,dataKey:f,colorVar:c}=s;if(!r||!e?.length)return null;const h=e[0],n=h?.payload?.t??"";let g;t[0]!==h?.payload?.label||t[1]!==n?(g=n?new Date(n).toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):h?.payload?.label??"",t[0]=h?.payload?.label,t[1]=n,t[2]=g):g=t[2];const a=g,o=h?.value,i=typeof o=="number"?o:0,m=f==="avg"||f==="p50"||f==="p95",x=f==="costUsd";let u;t[3]!==x||t[4]!==m||t[5]!==i?(u=x?`$${i.toFixed(i<1?4:2)}`:m?i>=1e4?`${(i/1e3).toFixed(1)}s`:`${Math.round(i)}ms`:i.toLocaleString(),t[3]=x,t[4]=m,t[5]=i,t[6]=u):u=t[6];const S=u;let y;t[7]!==a?(y=l.jsx("div",{className:"text-2xs text-muted-foreground mb-1",children:a}),t[7]=a,t[8]=y):y=t[8];let k;t[9]!==c?(k=l.jsx("div",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:c}}),t[9]=c,t[10]=k):k=t[10];let v;t[11]!==S?(v=l.jsx("span",{className:"text-xs font-medium tabular-nums",children:S}),t[11]=S,t[12]=v):v=t[12];let p;t[13]!==k||t[14]!==v?(p=l.jsxs("div",{className:"flex items-center gap-1.5",children:[k,v]}),t[13]=k,t[14]=v,t[15]=p):p=t[15];let j;return t[16]!==y||t[17]!==p?(j=l.jsxs("div",{className:"rounded-lg bg-popover px-3 py-2 shadow-soft",children:[y,p]}),t[16]=y,t[17]=p,t[18]=j):j=t[18],j}function Ct(s){const t=lt.c(85),{data:r,dataKey:e,colorNum:f,chartHeight:c,variant:h,ariaLabel:n}=s,g=h===void 0?"bar":h,a=`var(--chart-${f})`,o=`kpi-gradient-${e}-${f}`,i=Math.max(...r.map(d=>d[e]??0),0);if(g==="area"){let d;t[0]!==c?(d=J(c,"w-full"),t[0]=c,t[1]=d):d=t[1];let M;t[2]!==a||t[3]!==e?(M={label:e,color:a},t[2]=a,t[3]=e,t[4]=M):M=t[4];let b;t[5]!==e||t[6]!==M?(b={[e]:M},t[5]=e,t[6]=M,t[7]=b):b=t[7];let I;t[8]===Symbol.for("react.memo_cache_sentinel")?(I={left:0,right:-12,top:8,bottom:8},t[8]=I):I=t[8];let $,O;t[9]!==a?($=l.jsx("stop",{offset:"0%",stopColor:a,stopOpacity:.2}),O=l.jsx("stop",{offset:"100%",stopColor:a,stopOpacity:0}),t[9]=a,t[10]=$,t[11]=O):($=t[10],O=t[11]);let w;t[12]!==o||t[13]!==$||t[14]!==O?(w=l.jsx("defs",{children:l.jsxs("linearGradient",{id:o,x1:"0",y1:"0",x2:"0",y2:"1",children:[$,O]})}),t[12]=o,t[13]=$,t[14]=O,t[15]=w):w=t[15];let R;t[16]===Symbol.for("react.memo_cache_sentinel")?(R=l.jsx(tt,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),t[16]=R):R=t[16];let V;t[17]===Symbol.for("react.memo_cache_sentinel")?(V=l.jsx(et,{dataKey:"label",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"var(--muted-foreground)",opacity:.7},interval:"preserveStartEnd",tickMargin:8}),t[17]=V):V=t[17];let U;t[18]===Symbol.for("react.memo_cache_sentinel")?(U={fontSize:11,fill:"var(--muted-foreground)",opacity:.7},t[18]=U):U=t[18];const W=i>0?"auto":10;let E;t[19]!==W?(E=l.jsx(at,{orientation:"right",axisLine:!1,tickLine:!1,tick:U,tickFormatter:ot,width:40,domain:[0,W],tickCount:5}),t[19]=W,t[20]=E):E=t[20];let Y;t[21]===Symbol.for("react.memo_cache_sentinel")?(Y={stroke:"var(--border)",strokeDasharray:"4 4"},t[21]=Y):Y=t[21];let T;t[22]!==a||t[23]!==e?(T=l.jsx(Q,{cursor:Y,content:nt=>{const{active:ct,payload:ft}=nt;return l.jsx(rt,{active:ct,payload:ft,dataKey:e,colorVar:a})}}),t[22]=a,t[23]=e,t[24]=T):T=t[24];const X=`url(#${o})`;let z;t[25]!==a?(z={r:4,fill:a,stroke:"var(--background)",strokeWidth:2},t[25]=a,t[26]=z):z=t[26];let A;t[27]!==a||t[28]!==e||t[29]!==X||t[30]!==z?(A=l.jsx(dt,{type:"linear",dataKey:e,stroke:a,strokeWidth:2,fill:X,animationDuration:300,dot:!1,activeDot:z}),t[27]=a,t[28]=e,t[29]=X,t[30]=z,t[31]=A):A=t[31];let B;t[32]!==r||t[33]!==E||t[34]!==T||t[35]!==A||t[36]!==w?(B=l.jsxs(ht,{data:r,margin:I,children:[w,R,V,E,T,A]}),t[32]=r,t[33]=E,t[34]=T,t[35]=A,t[36]=w,t[37]=B):B=t[37];let H;return t[38]!==n||t[39]!==B||t[40]!==d||t[41]!==b?(H=l.jsx(Z,{role:"img","aria-label":n,className:d,config:b,children:B}),t[38]=n,t[39]=B,t[40]=d,t[41]=b,t[42]=H):H=t[42],H}let m;t[43]!==c?(m=J(c,"w-full"),t[43]=c,t[44]=m):m=t[44];let x;t[45]!==a||t[46]!==e?(x={label:e,color:a},t[45]=a,t[46]=e,t[47]=x):x=t[47];let u;t[48]!==e||t[49]!==x?(u={[e]:x},t[48]=e,t[49]=x,t[50]=u):u=t[50];let S,y;t[51]===Symbol.for("react.memo_cache_sentinel")?(S={left:0,right:-12,top:8,bottom:8},y=l.jsx(tt,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),t[51]=S,t[52]=y):(S=t[51],y=t[52]);let k;t[53]===Symbol.for("react.memo_cache_sentinel")?(k={fontSize:11,fill:"var(--muted-foreground)",opacity:.7},t[53]=k):k=t[53];const v=r.length<=6?0:Math.floor(r.length/6);let p;t[54]!==v?(p=l.jsx(et,{dataKey:"label",axisLine:!1,tickLine:!1,tick:k,interval:v,tickMargin:8}),t[54]=v,t[55]=p):p=t[55];let j;t[56]===Symbol.for("react.memo_cache_sentinel")?(j={fontSize:11,fill:"var(--muted-foreground)",opacity:.7},t[56]=j):j=t[56];const G=i>0?"auto":10;let _;t[57]!==G?(_=l.jsx(at,{orientation:"right",axisLine:!1,tickLine:!1,tick:j,tickFormatter:ot,width:40,domain:[0,G],tickCount:5}),t[57]=G,t[58]=_):_=t[58];let K;t[59]===Symbol.for("react.memo_cache_sentinel")?(K={fill:"var(--muted)",opacity:.3},t[59]=K):K=t[59];let C;t[60]!==a||t[61]!==e?(C=l.jsx(Q,{cursor:K,content:d=>{const{active:M,payload:b}=d;return l.jsx(rt,{active:M,payload:b,dataKey:e,colorVar:a})}}),t[60]=a,t[61]=e,t[62]=C):C=t[62];let L;if(t[63]!==a||t[64]!==r||t[65]!==e){let d;t[67]!==a||t[68]!==e?(d=(M,b)=>l.jsx(pt,{fill:(M[e]??0)===0?"var(--muted-foreground)":a,fillOpacity:(M[e]??0)===0?.15:.85},`cell-${b}`),t[67]=a,t[68]=e,t[69]=d):d=t[69],L=r.map(d),t[63]=a,t[64]=r,t[65]=e,t[66]=L}else L=t[66];let D;t[70]!==a||t[71]!==e||t[72]!==L?(D=l.jsx(mt,{dataKey:e,fill:a,radius:0,minPointSize:1,children:L}),t[70]=a,t[71]=e,t[72]=L,t[73]=D):D=t[73];let N;t[74]!==r||t[75]!==_||t[76]!==C||t[77]!==D||t[78]!==p?(N=l.jsxs(ut,{data:r,margin:S,children:[y,p,_,C,D]}),t[74]=r,t[75]=_,t[76]=C,t[77]=D,t[78]=p,t[79]=N):N=t[79];let F;return t[80]!==n||t[81]!==N||t[82]!==m||t[83]!==u?(F=l.jsx(Z,{role:"img","aria-label":n,className:m,config:u,children:N}),t[80]=n,t[81]=N,t[82]=m,t[83]=u,t[84]=F):F=t[84],F}export{Ct as K,_t as c};
1
+ import{c as lt,m as J,j as l}from"./index-CwntHk8S.js";import{C as Q,c as Z,B as mt,b as ut}from"./chart-B2B-jcI-.js";import{C as tt,X as et,Y as at}from"./CartesianChart-Vg3-F_Bi.js";import{a as dt,A as ht}from"./AreaChart-DR454FhG.js";import{C as pt}from"./tooltipContext-De8eALzu.js";const it=60*1e3,P=60*it,xt=24*P,st=25*P;function q(s,t){if(s.length===0)return 0;const r=[...s].sort((f,c)=>f-c),e=Math.max(0,Math.min(r.length-1,Math.ceil(t*r.length)-1));return r[e]??0}function gt(s,t){return t<=st?s.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):s.toLocaleDateString([],{month:"short",day:"numeric"})}function yt(s,t){const r=t-s;return r<=P?Math.max(1,Math.min(60,Math.ceil(r/it))):r<=st?Math.max(1,Math.min(25,Math.ceil(r/P))):Math.max(1,Math.min(31,Math.ceil(r/xt)))}function kt(s,t,r,e){const f=t.getTime(),c=r.getTime(),h=Math.max(1,c-f),n=yt(f,c),g=Math.max(1,Math.floor(h/n)),a=[];for(let o=0;o<n;o++){const i=new Date(f+o*g);a.push({t:i.toISOString(),ts:i.getTime(),label:gt(i,h),calls:0,errors:0,durations:[]})}for(const o of s){const i=new Date(o.timestamp).getTime(),m=Math.floor((i-f)/g),x=Math.max(0,Math.min(n-1,m)),u=a[x];u&&(u.calls+=1,o.isError&&(u.errors+=1),Number.isFinite(o.durationMs)&&u.durations.push(o.durationMs))}return a.map(o=>({t:o.t,ts:o.ts,label:o.label,calls:o.calls,errors:o.errors,errorRate:o.calls>0?o.errors/o.calls*100:0,avg:Math.round(o.durations.length>0?o.durations.reduce((i,m)=>i+m,0)/o.durations.length:0),p50:Math.round(q(o.durations,.5)),p95:Math.round(q(o.durations,.95))}))}function _t(s,t,r,e,f){const c=e??s.length,h=f??s.filter(i=>i.isError).length,n=s.map(i=>i.durationMs),g=n.length>0?n.reduce((i,m)=>i+m,0)/n.length:0,a=q(n,.95),o=kt(s,t.startDate,t.endDate);return{totalCalls:c,totalErrors:h,avgDurationMs:g,p95DurationMs:a,data:o}}function ot(s){return s>=1e3?`${(s/1e3).toFixed(1)}k`:String(s)}function rt(s){const t=lt.c(19),{active:r,payload:e,dataKey:f,colorVar:c}=s;if(!r||!e?.length)return null;const h=e[0],n=h?.payload?.t??"";let g;t[0]!==h?.payload?.label||t[1]!==n?(g=n?new Date(n).toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):h?.payload?.label??"",t[0]=h?.payload?.label,t[1]=n,t[2]=g):g=t[2];const a=g,o=h?.value,i=typeof o=="number"?o:0,m=f==="avg"||f==="p50"||f==="p95",x=f==="costUsd";let u;t[3]!==x||t[4]!==m||t[5]!==i?(u=x?`$${i.toFixed(i<1?4:2)}`:m?i>=1e4?`${(i/1e3).toFixed(1)}s`:`${Math.round(i)}ms`:i.toLocaleString(),t[3]=x,t[4]=m,t[5]=i,t[6]=u):u=t[6];const S=u;let y;t[7]!==a?(y=l.jsx("div",{className:"text-2xs text-muted-foreground mb-1",children:a}),t[7]=a,t[8]=y):y=t[8];let k;t[9]!==c?(k=l.jsx("div",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:c}}),t[9]=c,t[10]=k):k=t[10];let v;t[11]!==S?(v=l.jsx("span",{className:"text-xs font-medium tabular-nums",children:S}),t[11]=S,t[12]=v):v=t[12];let p;t[13]!==k||t[14]!==v?(p=l.jsxs("div",{className:"flex items-center gap-1.5",children:[k,v]}),t[13]=k,t[14]=v,t[15]=p):p=t[15];let j;return t[16]!==y||t[17]!==p?(j=l.jsxs("div",{className:"rounded-lg bg-popover px-3 py-2 shadow-soft",children:[y,p]}),t[16]=y,t[17]=p,t[18]=j):j=t[18],j}function Ct(s){const t=lt.c(85),{data:r,dataKey:e,colorNum:f,chartHeight:c,variant:h,ariaLabel:n}=s,g=h===void 0?"bar":h,a=`var(--chart-${f})`,o=`kpi-gradient-${e}-${f}`,i=Math.max(...r.map(d=>d[e]??0),0);if(g==="area"){let d;t[0]!==c?(d=J(c,"w-full"),t[0]=c,t[1]=d):d=t[1];let M;t[2]!==a||t[3]!==e?(M={label:e,color:a},t[2]=a,t[3]=e,t[4]=M):M=t[4];let b;t[5]!==e||t[6]!==M?(b={[e]:M},t[5]=e,t[6]=M,t[7]=b):b=t[7];let I;t[8]===Symbol.for("react.memo_cache_sentinel")?(I={left:0,right:-12,top:8,bottom:8},t[8]=I):I=t[8];let $,O;t[9]!==a?($=l.jsx("stop",{offset:"0%",stopColor:a,stopOpacity:.2}),O=l.jsx("stop",{offset:"100%",stopColor:a,stopOpacity:0}),t[9]=a,t[10]=$,t[11]=O):($=t[10],O=t[11]);let w;t[12]!==o||t[13]!==$||t[14]!==O?(w=l.jsx("defs",{children:l.jsxs("linearGradient",{id:o,x1:"0",y1:"0",x2:"0",y2:"1",children:[$,O]})}),t[12]=o,t[13]=$,t[14]=O,t[15]=w):w=t[15];let R;t[16]===Symbol.for("react.memo_cache_sentinel")?(R=l.jsx(tt,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),t[16]=R):R=t[16];let V;t[17]===Symbol.for("react.memo_cache_sentinel")?(V=l.jsx(et,{dataKey:"label",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"var(--muted-foreground)",opacity:.7},interval:"preserveStartEnd",tickMargin:8}),t[17]=V):V=t[17];let U;t[18]===Symbol.for("react.memo_cache_sentinel")?(U={fontSize:11,fill:"var(--muted-foreground)",opacity:.7},t[18]=U):U=t[18];const W=i>0?"auto":10;let E;t[19]!==W?(E=l.jsx(at,{orientation:"right",axisLine:!1,tickLine:!1,tick:U,tickFormatter:ot,width:40,domain:[0,W],tickCount:5}),t[19]=W,t[20]=E):E=t[20];let Y;t[21]===Symbol.for("react.memo_cache_sentinel")?(Y={stroke:"var(--border)",strokeDasharray:"4 4"},t[21]=Y):Y=t[21];let T;t[22]!==a||t[23]!==e?(T=l.jsx(Q,{cursor:Y,content:nt=>{const{active:ct,payload:ft}=nt;return l.jsx(rt,{active:ct,payload:ft,dataKey:e,colorVar:a})}}),t[22]=a,t[23]=e,t[24]=T):T=t[24];const X=`url(#${o})`;let z;t[25]!==a?(z={r:4,fill:a,stroke:"var(--background)",strokeWidth:2},t[25]=a,t[26]=z):z=t[26];let A;t[27]!==a||t[28]!==e||t[29]!==X||t[30]!==z?(A=l.jsx(dt,{type:"linear",dataKey:e,stroke:a,strokeWidth:2,fill:X,animationDuration:300,dot:!1,activeDot:z}),t[27]=a,t[28]=e,t[29]=X,t[30]=z,t[31]=A):A=t[31];let B;t[32]!==r||t[33]!==E||t[34]!==T||t[35]!==A||t[36]!==w?(B=l.jsxs(ht,{data:r,margin:I,children:[w,R,V,E,T,A]}),t[32]=r,t[33]=E,t[34]=T,t[35]=A,t[36]=w,t[37]=B):B=t[37];let H;return t[38]!==n||t[39]!==B||t[40]!==d||t[41]!==b?(H=l.jsx(Z,{role:"img","aria-label":n,className:d,config:b,children:B}),t[38]=n,t[39]=B,t[40]=d,t[41]=b,t[42]=H):H=t[42],H}let m;t[43]!==c?(m=J(c,"w-full"),t[43]=c,t[44]=m):m=t[44];let x;t[45]!==a||t[46]!==e?(x={label:e,color:a},t[45]=a,t[46]=e,t[47]=x):x=t[47];let u;t[48]!==e||t[49]!==x?(u={[e]:x},t[48]=e,t[49]=x,t[50]=u):u=t[50];let S,y;t[51]===Symbol.for("react.memo_cache_sentinel")?(S={left:0,right:-12,top:8,bottom:8},y=l.jsx(tt,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),t[51]=S,t[52]=y):(S=t[51],y=t[52]);let k;t[53]===Symbol.for("react.memo_cache_sentinel")?(k={fontSize:11,fill:"var(--muted-foreground)",opacity:.7},t[53]=k):k=t[53];const v=r.length<=6?0:Math.floor(r.length/6);let p;t[54]!==v?(p=l.jsx(et,{dataKey:"label",axisLine:!1,tickLine:!1,tick:k,interval:v,tickMargin:8}),t[54]=v,t[55]=p):p=t[55];let j;t[56]===Symbol.for("react.memo_cache_sentinel")?(j={fontSize:11,fill:"var(--muted-foreground)",opacity:.7},t[56]=j):j=t[56];const G=i>0?"auto":10;let _;t[57]!==G?(_=l.jsx(at,{orientation:"right",axisLine:!1,tickLine:!1,tick:j,tickFormatter:ot,width:40,domain:[0,G],tickCount:5}),t[57]=G,t[58]=_):_=t[58];let K;t[59]===Symbol.for("react.memo_cache_sentinel")?(K={fill:"var(--muted)",opacity:.3},t[59]=K):K=t[59];let C;t[60]!==a||t[61]!==e?(C=l.jsx(Q,{cursor:K,content:d=>{const{active:M,payload:b}=d;return l.jsx(rt,{active:M,payload:b,dataKey:e,colorVar:a})}}),t[60]=a,t[61]=e,t[62]=C):C=t[62];let L;if(t[63]!==a||t[64]!==r||t[65]!==e){let d;t[67]!==a||t[68]!==e?(d=(M,b)=>l.jsx(pt,{fill:(M[e]??0)===0?"var(--muted-foreground)":a,fillOpacity:(M[e]??0)===0?.15:.85},`cell-${b}`),t[67]=a,t[68]=e,t[69]=d):d=t[69],L=r.map(d),t[63]=a,t[64]=r,t[65]=e,t[66]=L}else L=t[66];let D;t[70]!==a||t[71]!==e||t[72]!==L?(D=l.jsx(mt,{dataKey:e,fill:a,radius:0,minPointSize:1,children:L}),t[70]=a,t[71]=e,t[72]=L,t[73]=D):D=t[73];let N;t[74]!==r||t[75]!==_||t[76]!==C||t[77]!==D||t[78]!==p?(N=l.jsxs(ut,{data:r,margin:S,children:[y,p,_,C,D]}),t[74]=r,t[75]=_,t[76]=C,t[77]=D,t[78]=p,t[79]=N):N=t[79];let F;return t[80]!==n||t[81]!==N||t[82]!==m||t[83]!==u?(F=l.jsx(Z,{role:"img","aria-label":n,className:m,config:u,children:N}),t[80]=n,t[81]=N,t[82]=m,t[83]=u,t[84]=F):F=t[84],F}export{Ct as K,_t as c};
@@ -0,0 +1 @@
1
+ import{c as ie,r as U,m as ce,j as t}from"./index-CwntHk8S.js";import{B as le}from"./badge-BG-k6t3T.js";import{C as ne}from"./checkbox-DSC8VbDf.js";import{t as ae}from"./ChevronDown-Kpzb5_P-.js";import{a as de,C as me,b as oe,c as ue,e as fe,f as he}from"./command-Bo6EGcaE.js";import{a as xe,b as pe,P as ge}from"./popover-XZWwzjJe.js";const ve=[];function Ve(r){const e=ie.c(68),{options:a,onValueChange:o,defaultValue:W,placeholder:X,animation:Z,maxCount:ee,modalPopover:te,className:M,disabled:se,onSearchChange:S}=r,d=W===void 0?ve:W,$=X===void 0?"Select items":X,P=Z===void 0?0:Z,k=ee===void 0?3:ee,J=te===void 0?!1:te,Y=se===void 0?!1:se,[s,y]=U.useState(d),[F,_]=U.useState(!1);let V,E;e[0]!==d||e[1]!==s?(V=()=>{JSON.stringify(s)!==JSON.stringify(d)&&y(d)},E=[d,s],e[0]=d,e[1]=s,e[2]=V,e[3]=E):(V=e[2],E=e[3]),U.useEffect(V,E);let O;e[4]!==o||e[5]!==s?(O=l=>{if(l.key==="Enter")_(!0);else if(l.key==="Backspace"&&!l.currentTarget.value){const n=[...s];n.pop(),y(n),o(n)}},e[4]=o,e[5]=s,e[6]=O):O=e[6];const G=O;let D;e[7]!==o||e[8]!==s?(D=l=>{const n=s.includes(l.value)?s.filter(w=>w!==l.value):[...s,l.value];y(n),o(n)},e[7]=o,e[8]=s,e[9]=D):D=e[9];const c=D;let I;e[10]!==o?(I=()=>{y([]),o([])},e[10]=o,e[11]=I):I=e[11];const L=I;let z;e[12]===Symbol.for("react.memo_cache_sentinel")?(z=()=>{_(Ne)},e[12]=z):z=e[12];const re=z;let A;e[13]!==L||e[14]!==o||e[15]!==a||e[16]!==s.length?(A=()=>{if(s.length===a.length)L();else{const l=a.map(Ce);y(l),o(l)}},e[13]=L,e[14]=o,e[15]=a,e[16]=s.length,e[17]=A):A=e[17];const i=A;let m;e[18]!==M?(m=ce("focus-ring aria-invalid:bg-destructive/10 aria-invalid:shadow-[inset_0_0_0_1px_var(--destructive)] flex h-[var(--studio-control-height,2.25rem)] w-full max-w-xs items-center justify-between gap-2 rounded-[var(--studio-control-radius,var(--radius-lg))] bg-[var(--studio-input-background)] pr-3 pl-1.5 text-sm shadow-edge transition-[background-color,box-shadow] hover:bg-sidebar disabled:pointer-events-none disabled:text-subtle-foreground",M),e[18]=M,e[19]=m):m=e[19];let u;e[20]!==P||e[21]!==k||e[22]!==a||e[23]!==$||e[24]!==s?(u=s.length>0?t.jsxs("div",{className:"flex items-center justify-between w-full min-w-0",children:[t.jsxs("div",{className:"flex items-center gap-1 min-w-0 flex-1",children:[s.slice(0,k).map(l=>{const n=a.find(Q=>Q.value===l),w=n?.icon;return t.jsxs(le,{variant:"outline",size:"lg",className:"bg-card max-w-28",style:{animationDuration:`${P}s`},children:[w&&t.jsx(w,{className:"h-3 w-3 shrink-0"}),t.jsx("span",{className:"truncate",children:n?.label})]},l)}),s.length>k&&t.jsxs(le,{variant:"outline",size:"lg",className:"bg-card flex-shrink-0",style:{animationDuration:`${P}s`},children:["+",s.length-k]})]}),t.jsx("div",{className:"flex items-center shrink-0 ml-2",children:t.jsx(ae,{className:"text-muted-foreground size-3.5 shrink-0"})})]}):t.jsxs("div",{className:"flex w-full items-center justify-between gap-2",children:[t.jsx("span",{className:"text-subtle-foreground pl-1.5 text-sm",children:$}),t.jsx(ae,{className:"text-muted-foreground size-3.5 shrink-0"})]}),e[20]=P,e[21]=k,e[22]=a,e[23]=$,e[24]=s,e[25]=u):u=e[25];let f;e[26]!==Y||e[27]!==m||e[28]!==u?(f=t.jsx(xe,{asChild:!0,children:t.jsx("button",{type:"button",onClick:re,className:m,disabled:Y,children:u})}),e[26]=Y,e[27]=m,e[28]=u,e[29]=f):f=e[29];let R;e[30]===Symbol.for("react.memo_cache_sentinel")?(R=()=>_(!1),e[30]=R):R=e[30];const q=!S;let h;e[31]!==G||e[32]!==S?(h=t.jsx(de,{placeholder:"Search...",onKeyDown:G,onValueChange:S,className:"rounded-t-xl"}),e[31]=G,e[32]=S,e[33]=h):h=e[33];let T;e[34]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(me,{children:"No results found."}),e[34]=T):T=e[34];let x;e[35]!==i?(x=()=>{i()},e[35]=i,e[36]=x):x=e[36];let p;e[37]!==i?(p=l=>{l.stopPropagation(),i()},e[37]=i,e[38]=p):p=e[38];const H=s.length===a.length&&a.length>0;let g;e[39]!==H||e[40]!==i?(g=t.jsx(ne,{checked:H,onCheckedChange:i,className:"mr-2 [&_svg]:!text-primary-foreground",onClick:be}),e[39]=H,e[40]=i,e[41]=g):g=e[41];let B;e[42]===Symbol.for("react.memo_cache_sentinel")?(B=t.jsx("span",{children:"(Select All)"}),e[42]=B):B=e[42];let v;e[43]!==p||e[44]!==g?(v=t.jsxs("div",{className:"flex items-center w-full",onClick:p,children:[g,B]}),e[43]=p,e[44]=g,e[45]=v):v=e[45];let j;e[46]!==x||e[47]!==v?(j=t.jsx(oe,{onSelect:x,className:"cursor-pointer",children:v},"all"),e[46]=x,e[47]=v,e[48]=j):j=e[48];let b;if(e[49]!==a||e[50]!==s||e[51]!==c){let l;e[53]!==s||e[54]!==c?(l=n=>{const w=s.includes(n.value);return t.jsx(oe,{onSelect:()=>{c(n)},className:"cursor-pointer",children:t.jsxs("div",{className:"flex items-center w-full",onClick:Q=>{Q.stopPropagation(),c(n)},children:[t.jsx(ne,{checked:w,onCheckedChange:()=>{c(n)},className:"mr-2 [&_svg]:!text-primary-foreground",onClick:je}),n.icon&&t.jsx(n.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),t.jsx("span",{children:n.label})]})},n.value)},e[53]=s,e[54]=c,e[55]=l):l=e[55],b=a.map(l),e[49]=a,e[50]=s,e[51]=c,e[52]=b}else b=e[52];let C;e[56]!==j||e[57]!==b?(C=t.jsxs(ue,{className:"rounded-b-xl",children:[T,t.jsxs(fe,{children:[j,b]})]}),e[56]=j,e[57]=b,e[58]=C):C=e[58];let N;e[59]!==q||e[60]!==h||e[61]!==C?(N=t.jsx(pe,{className:"w-auto p-0 max-w-xs rounded-xl",align:"start",onEscapeKeyDown:R,children:t.jsxs(he,{shouldFilter:q,className:"rounded-xl",children:[h,C]})}),e[59]=q,e[60]=h,e[61]=C,e[62]=N):N=e[62];let K;return e[63]!==F||e[64]!==J||e[65]!==f||e[66]!==N?(K=t.jsxs(ge,{open:F,onOpenChange:_,modal:J,children:[f,N]}),e[63]=F,e[64]=J,e[65]=f,e[66]=N,e[67]=K):K=e[67],K}function je(r){return r.stopPropagation()}function be(r){return r.stopPropagation()}function Ce(r){return r.value}function Ne(r){return!r}export{Ve as M};
@@ -1,4 +1,4 @@
1
- import{c as W,j as y,b as q,r as P,D as z,v as B,w as F,x as M,B as A,t as N}from"./index-BP527m3V.js";import{i as $}from"./CheckCircle-CM--cqi0.js";import{e as H}from"./agent-icon-CpMz1pSC.js";import{MonacoCodeEditor as V}from"./monaco-editor-DTLNzmeB.js";import{u as G,k as L}from"./use-never-published-BRSQAhRd.js";function Q({open:n,onOpenChange:e,pageKey:r,decofile:t,onSave:a}){const s=q(),i=t[r],o=i===void 0,c=o?"":JSON.stringify(i,null,2),[l,p]=P.useState(!1),[v,m]=P.useState(c),[C,D]=P.useState(!1),u=!a||o,E=v!==c,f=()=>{navigator.clipboard.writeText(v).then(()=>{p(!0),setTimeout(()=>p(!1),2e3)})},h=async w=>{if(!a||C)return;let S;try{S=JSON.parse(w)}catch{N.error(s("sectionsEditor.pageJsonDialog.invalidJsonError"));return}D(!0);try{const g=await a(S);L(g)||N.success(s("sectionsEditor.pageJsonDialog.saveSuccess")),e(!1)}catch(g){N.error(s("sectionsEditor.pageJsonDialog.saveError",{error:g instanceof Error?g.message:String(g)}))}finally{D(!1)}};return y.jsx(z,{open:n,onOpenChange:e,children:y.jsxs(B,{className:"flex h-[85vh] w-[95vw] flex-col gap-0 overflow-hidden p-0 sm:max-w-6xl",children:[y.jsxs(F,{className:"shrink-0 px-4 py-3 border-b flex-row items-center justify-between space-y-0",children:[y.jsx(M,{className:"text-sm font-semibold",children:s("sectionsEditor.pageJsonDialog.title")}),y.jsxs("div",{className:"flex items-center gap-2 mr-8",children:[y.jsxs(A,{variant:"ghost",size:"sm",onClick:f,className:"text-xs",children:[l?y.jsx($,{size:12}):y.jsx(H,{size:12}),s(l?"sectionsEditor.pageJsonDialog.copied":"sectionsEditor.pageJsonDialog.copy")]}),!u&&y.jsx(A,{size:"sm",onClick:()=>h(v),disabled:!E||C,className:"h-7 text-xs",children:s(C?"sectionsEditor.pageJsonDialog.saving":"sectionsEditor.pageJsonDialog.save")})]})]}),o?y.jsxs("div",{className:"p-4 text-xs font-mono text-foreground/60",children:["// ",s("sectionsEditor.pageJsonDialog.pageNotFound")]}):y.jsx("div",{className:"min-h-0 flex-1 py-2",children:y.jsx(V,{code:c,language:"json",readOnly:u,height:"100%",onChange:w=>m(w??""),onSave:w=>{h(w)}})})]})})}function we(n){const e=W.c(10);let r,t;e[0]!==n?({params:r,...t}=n,e[0]=n,e[1]=r,e[2]=t):(r=e[1],t=e[2]);let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a={holdsCopy:!0},e[3]=a):a=e[3];const s=G(r,a);let i;e[4]!==t.pageKey||e[5]!==s?(i=c=>s.mutateAsync({blockKey:t.pageKey,data:c}),e[4]=t.pageKey,e[5]=s,e[6]=i):i=e[6];let o;return e[7]!==t||e[8]!==i?(o=y.jsx(Q,{...t,onSave:i}),e[7]=t,e[8]=i,e[9]=o):o=e[9],o}var X=Object.prototype.toString,j=Array.isArray||function(e){return X.call(e)==="[object Array]"};function O(n){return typeof n=="function"}function Y(n){return j(n)?"array":typeof n}function U(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function I(n,e){return n!=null&&typeof n=="object"&&e in n}function Z(n,e){return n!=null&&typeof n!="object"&&n.hasOwnProperty&&n.hasOwnProperty(e)}var ee=RegExp.prototype.test;function te(n,e){return ee.call(n,e)}var re=/\S/;function ne(n){return!te(re,n)}var se={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};function ae(n){return String(n).replace(/[&<>"'`=\/]/g,function(r){return se[r]})}var ie=/\s*/,oe=/\s+/,_=/\s*=/,ce=/\s*\}/,le=/#|\^|\/|>|\{|&|=|!/;function ue(n,e){if(!n)return[];var r=!1,t=[],a=[],s=[],i=!1,o=!1,c="",l=0;function p(){if(i&&!o)for(;s.length;)delete a[s.pop()];else s=[];i=!1,o=!1}var v,m,C;function D(b){if(typeof b=="string"&&(b=b.split(oe,2)),!j(b)||b.length!==2)throw new Error("Invalid tags: "+b);v=new RegExp(U(b[0])+"\\s*"),m=new RegExp("\\s*"+U(b[1])),C=new RegExp("\\s*"+U("}"+b[1]))}D(e||x.tags);for(var u=new T(n),E,f,h,w,S,g;!u.eos();){if(E=u.pos,h=u.scanUntil(v),h)for(var J=0,K=h.length;J<K;++J)w=h.charAt(J),ne(w)?(s.push(a.length),c+=w):(o=!0,r=!0,c+=" "),a.push(["text",w,E,E+1]),E+=1,w===`
1
+ import{c as W,j as y,b as q,r as P,D as z,v as B,w as F,x as M,B as A,t as N}from"./index-CwntHk8S.js";import{i as $}from"./CheckCircle-WpYwhp7A.js";import{e as H}from"./agent-icon-DE4TWlDl.js";import{MonacoCodeEditor as V}from"./monaco-editor-4_N5zBDQ.js";import{u as G,k as L}from"./use-never-published-D3zJmakm.js";function Q({open:n,onOpenChange:e,pageKey:r,decofile:t,onSave:a}){const s=q(),i=t[r],o=i===void 0,c=o?"":JSON.stringify(i,null,2),[l,p]=P.useState(!1),[v,m]=P.useState(c),[C,D]=P.useState(!1),u=!a||o,E=v!==c,f=()=>{navigator.clipboard.writeText(v).then(()=>{p(!0),setTimeout(()=>p(!1),2e3)})},h=async w=>{if(!a||C)return;let S;try{S=JSON.parse(w)}catch{N.error(s("sectionsEditor.pageJsonDialog.invalidJsonError"));return}D(!0);try{const g=await a(S);L(g)||N.success(s("sectionsEditor.pageJsonDialog.saveSuccess")),e(!1)}catch(g){N.error(s("sectionsEditor.pageJsonDialog.saveError",{error:g instanceof Error?g.message:String(g)}))}finally{D(!1)}};return y.jsx(z,{open:n,onOpenChange:e,children:y.jsxs(B,{className:"flex h-[85vh] w-[95vw] flex-col gap-0 overflow-hidden p-0 sm:max-w-6xl",children:[y.jsxs(F,{className:"shrink-0 px-4 py-3 border-b flex-row items-center justify-between space-y-0",children:[y.jsx(M,{className:"text-sm font-semibold",children:s("sectionsEditor.pageJsonDialog.title")}),y.jsxs("div",{className:"flex items-center gap-2 mr-8",children:[y.jsxs(A,{variant:"ghost",size:"sm",onClick:f,className:"text-xs",children:[l?y.jsx($,{size:12}):y.jsx(H,{size:12}),s(l?"sectionsEditor.pageJsonDialog.copied":"sectionsEditor.pageJsonDialog.copy")]}),!u&&y.jsx(A,{size:"sm",onClick:()=>h(v),disabled:!E||C,className:"h-7 text-xs",children:s(C?"sectionsEditor.pageJsonDialog.saving":"sectionsEditor.pageJsonDialog.save")})]})]}),o?y.jsxs("div",{className:"p-4 text-xs font-mono text-foreground/60",children:["// ",s("sectionsEditor.pageJsonDialog.pageNotFound")]}):y.jsx("div",{className:"min-h-0 flex-1 py-2",children:y.jsx(V,{code:c,language:"json",readOnly:u,height:"100%",onChange:w=>m(w??""),onSave:w=>{h(w)}})})]})})}function we(n){const e=W.c(10);let r,t;e[0]!==n?({params:r,...t}=n,e[0]=n,e[1]=r,e[2]=t):(r=e[1],t=e[2]);let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a={holdsCopy:!0},e[3]=a):a=e[3];const s=G(r,a);let i;e[4]!==t.pageKey||e[5]!==s?(i=c=>s.mutateAsync({blockKey:t.pageKey,data:c}),e[4]=t.pageKey,e[5]=s,e[6]=i):i=e[6];let o;return e[7]!==t||e[8]!==i?(o=y.jsx(Q,{...t,onSave:i}),e[7]=t,e[8]=i,e[9]=o):o=e[9],o}var X=Object.prototype.toString,j=Array.isArray||function(e){return X.call(e)==="[object Array]"};function O(n){return typeof n=="function"}function Y(n){return j(n)?"array":typeof n}function U(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function I(n,e){return n!=null&&typeof n=="object"&&e in n}function Z(n,e){return n!=null&&typeof n!="object"&&n.hasOwnProperty&&n.hasOwnProperty(e)}var ee=RegExp.prototype.test;function te(n,e){return ee.call(n,e)}var re=/\S/;function ne(n){return!te(re,n)}var se={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};function ae(n){return String(n).replace(/[&<>"'`=\/]/g,function(r){return se[r]})}var ie=/\s*/,oe=/\s+/,_=/\s*=/,ce=/\s*\}/,le=/#|\^|\/|>|\{|&|=|!/;function ue(n,e){if(!n)return[];var r=!1,t=[],a=[],s=[],i=!1,o=!1,c="",l=0;function p(){if(i&&!o)for(;s.length;)delete a[s.pop()];else s=[];i=!1,o=!1}var v,m,C;function D(b){if(typeof b=="string"&&(b=b.split(oe,2)),!j(b)||b.length!==2)throw new Error("Invalid tags: "+b);v=new RegExp(U(b[0])+"\\s*"),m=new RegExp("\\s*"+U(b[1])),C=new RegExp("\\s*"+U("}"+b[1]))}D(e||x.tags);for(var u=new T(n),E,f,h,w,S,g;!u.eos();){if(E=u.pos,h=u.scanUntil(v),h)for(var J=0,K=h.length;J<K;++J)w=h.charAt(J),ne(w)?(s.push(a.length),c+=w):(o=!0,r=!0,c+=" "),a.push(["text",w,E,E+1]),E+=1,w===`
2
2
  `&&(p(),c="",l=0,r=!1);if(!u.scan(v))break;if(i=!0,f=u.scan(le)||"name",u.scan(ie),f==="="?(h=u.scanUntil(_),u.scan(_),u.scanUntil(m)):f==="{"?(h=u.scanUntil(C),u.scan(ce),u.scanUntil(m),f="&"):h=u.scanUntil(m),!u.scan(m))throw new Error("Unclosed tag at "+u.pos);if(f==">"?S=[f,h,E,u.pos,c,l,r]:S=[f,h,E,u.pos],l++,a.push(S),f==="#"||f==="^")t.push(S);else if(f==="/"){if(g=t.pop(),!g)throw new Error('Unopened section "'+h+'" at '+E);if(g[1]!==h)throw new Error('Unclosed section "'+g[1]+'" at '+E)}else f==="name"||f==="{"||f==="&"?o=!0:f==="="&&D(h)}if(p(),g=t.pop(),g)throw new Error('Unclosed section "'+g[1]+'" at '+u.pos);return fe(pe(a))}function pe(n){for(var e=[],r,t,a=0,s=n.length;a<s;++a)r=n[a],r&&(r[0]==="text"&&t&&t[0]==="text"?(t[1]+=r[1],t[3]=r[3]):(e.push(r),t=r));return e}function fe(n){for(var e=[],r=e,t=[],a,s,i=0,o=n.length;i<o;++i)switch(a=n[i],a[0]){case"#":case"^":r.push(a),t.push(a),r=a[4]=[];break;case"/":s=t.pop(),s[5]=a[2],r=t.length>0?t[t.length-1][4]:e;break;default:r.push(a)}return e}function T(n){this.string=n,this.tail=n,this.pos=0}T.prototype.eos=function(){return this.tail===""};T.prototype.scan=function(e){var r=this.tail.match(e);if(!r||r.index!==0)return"";var t=r[0];return this.tail=this.tail.substring(t.length),this.pos+=t.length,t};T.prototype.scanUntil=function(e){var r=this.tail.search(e),t;switch(r){case-1:t=this.tail,this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,r),this.tail=this.tail.substring(r)}return this.pos+=t.length,t};function k(n,e){this.view=n,this.cache={".":this.view},this.parent=e}k.prototype.push=function(e){return new k(e,this)};k.prototype.lookup=function(e){var r=this.cache,t;if(r.hasOwnProperty(e))t=r[e];else{for(var a=this,s,i,o,c=!1;a;){if(e.indexOf(".")>0)for(s=a.view,i=e.split("."),o=0;s!=null&&o<i.length;)o===i.length-1&&(c=I(s,i[o])||Z(s,i[o])),s=s[i[o++]];else s=a.view[e],c=I(a.view,e);if(c){t=s;break}a=a.parent}r[e]=t}return O(t)&&(t=t.call(this.view)),t};function d(){this.templateCache={_cache:{},set:function(e,r){this._cache[e]=r},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}d.prototype.clearCache=function(){typeof this.templateCache<"u"&&this.templateCache.clear()};d.prototype.parse=function(e,r){var t=this.templateCache,a=e+":"+(r||x.tags).join(":"),s=typeof t<"u",i=s?t.get(a):void 0;return i==null&&(i=ue(e,r),s&&t.set(a,i)),i};d.prototype.render=function(e,r,t,a){var s=this.getConfigTags(a),i=this.parse(e,s),o=r instanceof k?r:new k(r,void 0);return this.renderTokens(i,o,t,e,a)};d.prototype.renderTokens=function(e,r,t,a,s){for(var i="",o,c,l,p=0,v=e.length;p<v;++p)l=void 0,o=e[p],c=o[0],c==="#"?l=this.renderSection(o,r,t,a,s):c==="^"?l=this.renderInverted(o,r,t,a,s):c===">"?l=this.renderPartial(o,r,t,s):c==="&"?l=this.unescapedValue(o,r):c==="name"?l=this.escapedValue(o,r,s):c==="text"&&(l=this.rawValue(o)),l!==void 0&&(i+=l);return i};d.prototype.renderSection=function(e,r,t,a,s){var i=this,o="",c=r.lookup(e[1]);function l(m){return i.render(m,r,t,s)}if(c){if(j(c))for(var p=0,v=c.length;p<v;++p)o+=this.renderTokens(e[4],r.push(c[p]),t,a,s);else if(typeof c=="object"||typeof c=="string"||typeof c=="number")o+=this.renderTokens(e[4],r.push(c),t,a,s);else if(O(c)){if(typeof a!="string")throw new Error("Cannot use higher-order sections without the original template");c=c.call(r.view,a.slice(e[3],e[5]),l),c!=null&&(o+=c)}else o+=this.renderTokens(e[4],r,t,a,s);return o}};d.prototype.renderInverted=function(e,r,t,a,s){var i=r.lookup(e[1]);if(!i||j(i)&&i.length===0)return this.renderTokens(e[4],r,t,a,s)};d.prototype.indentPartial=function(e,r,t){for(var a=r.replace(/[^ \t]/g,""),s=e.split(`
3
3
  `),i=0;i<s.length;i++)s[i].length&&(i>0||!t)&&(s[i]=a+s[i]);return s.join(`
4
4
  `)};d.prototype.renderPartial=function(e,r,t,a){if(t){var s=this.getConfigTags(a),i=O(t)?t(e[1]):t[e[1]];if(i!=null){var o=e[6],c=e[5],l=e[4],p=i;c==0&&l&&(p=this.indentPartial(i,l,o));var v=this.parse(p,s);return this.renderTokens(v,r,t,p,a)}}};d.prototype.unescapedValue=function(e,r){var t=r.lookup(e[1]);if(t!=null)return t};d.prototype.escapedValue=function(e,r,t){var a=this.getConfigEscape(t)||x.escape,s=r.lookup(e[1]);if(s!=null)return typeof s=="number"&&a===x.escape?String(s):a(s)};d.prototype.rawValue=function(e){return e[1]};d.prototype.getConfigTags=function(e){return j(e)?e:e&&typeof e=="object"?e.tags:void 0};d.prototype.getConfigEscape=function(e){if(e&&typeof e=="object"&&!j(e))return e.escape};var x={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(n){R.templateCache=n},get templateCache(){return R.templateCache}},R=new d;x.clearCache=function(){return R.clearCache()};x.parse=function(e,r){return R.parse(e,r)};x.render=function(e,r,t,a){if(typeof e!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+Y(e)+'" was given as the first argument for mustache#render(template, view, partials)');return R.render(e,r,t,a)};x.escape=ae;x.Scanner=T;x.Context=k;x.Writer=d;export{Q as P,we as S,x as m};
@@ -1 +1 @@
1
- import{r as p,fB as Ke,c as z,m as G,j as u,e9 as At,fC as Ot,b as pe,B as he,h as wt,I as Ie,F as Ct}from"./index-BP527m3V.js";import{i as St}from"./ArrowLeft-DR_MRxUB.js";import{s as it}from"./Plus-DEeR8qC2.js";import{e as Ve,b as De,a as Tt,c as It}from"./command-B0-oLV0k.js";import{L as _e}from"./label-DSlWCd9e.js";import{S as Dt}from"./slider-BKrw7nqs.js";import{C as Fe,u as _t,a as Lt,b as $t,S as Mt}from"./tooltipContext-B94TDN-Q.js";import{c as $,p as xe,a as Kt,i as Ft,s as U,b as zt,d as Bt,e as st,f as Wt,g as Vt,h as W,j as Gt,k as Ut,l as Ht,m as qt,n as Yt,o as lt,q as Zt,r as Xt,t as Jt,u as Qt,v as ot,w as en,x as tn,y as nn,z as ct,A as an,B as ze,D as ut,C as dt,R as rn,S as sn,E as mt,F as ve,G as ln,L as fe,Z as ft,H as on,I as cn,J as un,K as dn,M as Ge,N as Se,O as ke,P as mn,Q as fn,T as pn,U as vn,V as gn,W as hn,X as xn,Y as bn,_ as yn,$ as ge,a0 as Le,a1 as Ue,a2 as Pn,a3 as kn,a4 as jn,a5 as En,a6 as Nn,a7 as Rn,a8 as An,a9 as On,aa as wn,ab as Cn,ac as Sn,ad as Tn,ae as In}from"./CategoricalChart-GawOpO41.js";import{ar as pt,G as Dn}from"./agent-icon-CpMz1pSC.js";import{N as _n,g as Ln,ae as vt,af as gt,ad as $e,ag as $n,ah as Mn,ai as Kn,aj as Ee,a7 as Fn}from"./blocks-tab-states-BZoxOO-H.js";var ht=t=>t.graphicalItems.polarItems,zn=$([xe,Kt],Ft),Ne=$([ht,U,zn],zt),Bn=$([Ne],Bt),Re=$([Bn,st],Wt),Wn=$([Re,U,Ne],Vt);$([Re,U,Ne],(t,e,n)=>n.length>0?t.flatMap(a=>n.flatMap(r=>{var i,s=W(a,(i=e.dataKey)!==null&&i!==void 0?i:r.dataKey);return{value:s,errorDomain:[]}})).filter(Boolean):e?.dataKey!=null?t.map(a=>({value:W(a,e.dataKey),errorDomain:[]})):t.map(a=>({value:a,errorDomain:[]})));var He=()=>{},Vn=$([Re,U,Ne,Gt,xe,Ut],Ht),Gn=$([U,qt,Yt,He,Vn,He,lt,xe],Zt),xt=$([U,lt,Re,Wn,Xt,xe,Gn],Jt),Un=$([xt,Qt,ot],en),Hn=$([U,xt,Un,xe],tn);$([ot,Hn],nn);function qe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,a)}return n}function Ye(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?qe(Object(n),!0).forEach(function(a){qn(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):qe(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function qn(t,e,n){return(e=Yn(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Yn(t){var e=Zn(t,"string");return typeof e=="symbol"?e:e+""}function Zn(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var a=n.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Xn=(t,e)=>e,Be=$([ht,Xn],(t,e)=>t.filter(n=>n.type==="pie").find(n=>n.id===e)),Jn=[],We=(t,e,n)=>n?.length===0?Jn:n,bt=$([st,Be,We],(t,e,n)=>{var{chartData:a}=t;if(e!=null){var r;if(e?.data!=null&&e.data.length>0?r=e.data:r=a,(!r||!r.length)&&n!=null&&(r=n.map(i=>Ye(Ye({},e.presentationProps),i.props))),r!=null)return r}}),Qn=$([bt,Be,We],(t,e,n)=>{if(!(t==null||e==null))return t.map((a,r)=>{var i,s=W(a,e.nameKey,e.name),o;return n!=null&&(i=n[r])!==null&&i!==void 0&&(i=i.props)!==null&&i!==void 0&&i.fill?o=n[r].props.fill:typeof a=="object"&&a!=null&&"fill"in a?o=a.fill:o=e.fill,{value:ct(s,e.dataKey),color:o,payload:a,type:e.legendType}})}),ea=$([bt,Be,We,an],(t,e,n,a)=>{if(!(e==null||t==null))return Pa({offset:a,pieSettings:e,displayedData:t,cells:n})}),ta=["key"],na=["onMouseEnter","onClick","onMouseLeave"],aa=["id"],ra=["id"];function V(){return V=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var a in n)({}).hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},V.apply(null,arguments)}function Ae(t,e){if(t==null)return{};var n,a,r=ia(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)n=i[a],e.indexOf(n)===-1&&{}.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function ia(t,e){if(t==null)return{};var n={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;n[a]=t[a]}return n}function Ze(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,a)}return n}function w(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Ze(Object(n),!0).forEach(function(a){sa(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ze(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function sa(t,e,n){return(e=la(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function la(t){var e=oa(t,"string");return typeof e=="symbol"?e:e+""}function oa(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var a=n.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ca(t){var e=p.useMemo(()=>mt(t.children,Fe),[t.children]),n=ve(a=>Qn(a,t.id,e));return n==null?null:p.createElement(ln,{legendPayload:n})}function ua(t){if(!(t==null||typeof t=="boolean"||typeof t=="function")){if(p.isValidElement(t)){var e,n=(e=t.props)===null||e===void 0?void 0:e.fill;return typeof n=="string"?n:void 0}var{fill:a}=t;return typeof a=="string"?a:void 0}}var da=p.memo(t=>{var{dataKey:e,nameKey:n,sectors:a,stroke:r,strokeWidth:i,fill:s,name:o,hide:l,tooltipType:c,id:g,activeShape:f}=t,m=ua(f),x=a.map(v=>{var h=v.tooltipPayload;return m==null||h==null?h:h.map(b=>w(w({},b),{},{color:m,fill:m}))}),d={dataDefinedOnItem:x,getPosition:v=>{var h;return(h=a[Number(v)])===null||h===void 0?void 0:h.tooltipPosition},settings:{stroke:r,strokeWidth:i,fill:s,dataKey:e,nameKey:n,name:ct(o,e),hide:l,type:c,color:s,unit:"",graphicalItemId:g}};return p.createElement(on,{tooltipEntrySettings:d})}),ma=(t,e)=>t>e?"start":t<e?"end":"middle",fa=(t,e,n)=>typeof e=="function"?ge(e(t),n,n*.8):ge(e,n,n*.8),pa=(t,e,n)=>{var{top:a,left:r,width:i,height:s}=e,o=yn(i,s),l=r+ge(t.cx,i,i/2),c=a+ge(t.cy,s,s/2),g=ge(t.innerRadius,o,0),f=fa(n,t.outerRadius,o),m=t.maxRadius||Math.sqrt(i*i+s*s)/2;return{cx:l,cy:c,innerRadius:g,outerRadius:f,maxRadius:m}},va=(t,e)=>{var n=ke(e-t),a=Math.min(Math.abs(e-t),360);return n*a},ga=(t,e)=>{if(p.isValidElement(t))return p.cloneElement(t,e);if(typeof t=="function")return t(e);var n=Ke("recharts-pie-label-line",typeof t!="boolean"?t.className:""),{key:a}=e,r=Ae(e,ta);return p.createElement(Pn,V({},r,{type:"linear",className:n}))},ha=(t,e,n)=>{if(p.isValidElement(t))return p.cloneElement(t,e);var a=n;if(typeof t=="function"&&(a=t(e),p.isValidElement(a)))return a;var r=Ke("recharts-pie-label-text",kn(t));return p.createElement(jn,V({},e,{alignmentBaseline:"middle",className:r}),a)};function xa(t){var{sectors:e,props:n,showLabels:a}=t,{label:r,labelLine:i,dataKey:s}=n;if(!a||!r||!e)return null;var o=dt(n),l=Ue(r),c=Ue(i),g=typeof r=="object"&&"offsetRadius"in r&&typeof r.offsetRadius=="number"&&r.offsetRadius||20,f=e.map((m,x)=>{var d=(m.startAngle+m.endAngle)/2,v=Le(m.cx,m.cy,m.outerRadius+g,d),h=w(w(w(w({},o),m),{},{stroke:"none"},l),{},{index:x,textAnchor:ma(v.x,m.cx)},v),b=w(w(w(w({},o),m),{},{fill:"none",stroke:m.fill},c),{},{index:x,points:[Le(m.cx,m.cy,m.outerRadius,d),v],key:"line"});return p.createElement(ft,{zIndex:ut.label,key:"label-".concat(m.startAngle,"-").concat(m.endAngle,"-").concat(m.midAngle,"-").concat(x)},p.createElement(fe,null,i&&ga(i,b),ha(r,h,W(m,s))))});return p.createElement(fe,{className:"recharts-pie-labels"},f)}function ba(t){var{sectors:e,props:n,showLabels:a}=t,{label:r}=n;return typeof r=="object"&&r!=null&&"position"in r?p.createElement(bn,{label:r}):p.createElement(xa,{sectors:e,props:n,showLabels:a})}function ya(t){var{sectors:e,activeShape:n,inactiveShape:a,allOtherPieProps:r,shape:i,id:s}=t,o=ve(fn),l=ve(pn),c=ve(vn),{onMouseEnter:g,onClick:f,onMouseLeave:m}=r,x=Ae(r,na),d=_t(g,r.dataKey,s),v=Lt(m),h=$t(f,r.dataKey,s);return e==null||e.length===0?null:p.createElement(p.Fragment,null,e.map((b,y)=>{if(b?.startAngle===0&&b?.endAngle===0&&e.length!==1)return null;var O=c==null||c===s,N=String(y)===o&&(l==null||r.dataKey===l)&&O,R=o?a:null,k=n&&N?n:R,j=w(w({},b),{},{stroke:b.stroke,tabIndex:-1,[hn]:y,[gn]:s});return p.createElement(fe,V({key:"sector-".concat(b?.startAngle,"-").concat(b?.endAngle,"-").concat(b.midAngle,"-").concat(y),tabIndex:-1,className:"recharts-pie-sector"},xn(x,b,y),{onMouseEnter:d(b,y),onMouseLeave:v(b,y),onClick:h(b,y)}),p.createElement(Mt,V({option:i??k,index:y,shapeType:"sector",isActive:N},j)))}))}function Pa(t){var e,{pieSettings:n,displayedData:a,cells:r,offset:i}=t,{cornerRadius:s,startAngle:o,endAngle:l,dataKey:c,nameKey:g,tooltipType:f}=n,m=Math.abs(n.minAngle),x=va(o,l),d=Math.abs(x),v=a.length<=1?0:(e=n.paddingAngle)!==null&&e!==void 0?e:0,h=a.filter(P=>W(P,c,0)!==0).length,b=(d>=360?h:h-1)*v,y=a.reduce((P,A)=>{var E=W(A,c,0);return P+(Se(E)?E:0)},0),O=m>0&&y>0&&a.some(P=>{var A=W(P,c,0),E=(Se(A)?A:0)/y;return A!==0&&E*d<m}),N=O?m:0,R=d-h*N-b,k;if(y>0){var j;k=a.map((P,A)=>{var E=W(P,c,0),L=W(P,g,A),C=pa(n,i,P),K=(Se(E)?E:0)/y,T,M=w(w({},P),r&&r[A]&&r[A].props),S=M!=null&&"fill"in M&&typeof M.fill=="string"?M.fill:n.fill;A?T=j.endAngle+ke(x)*v*(E!==0?1:0):T=o;var D=T+ke(x)*((E!==0?N:0)+K*R),I=(T+D)/2,_=(C.innerRadius+C.outerRadius)/2,B=[{name:L,value:E,payload:M,dataKey:c,type:f,color:S,fill:S,graphicalItemId:n.id}],H=Le(C.cx,C.cy,_,I);return j=w(w(w(w({},n.presentationProps),{},{percent:K,cornerRadius:typeof s=="string"?parseFloat(s):s,name:L,tooltipPayload:B,midAngle:I,middleRadius:_,tooltipPosition:H},M),C),{},{value:E,dataKey:c,startAngle:T,endAngle:D,payload:M,paddingAngle:E!==0?ke(x)*v:0}),j})}return k}function ka(t){var{showLabels:e,sectors:n,children:a}=t,r=p.useMemo(()=>!e||!n?[]:n.map(i=>({value:i.value,payload:i.payload,clockWise:!1,parentViewBox:void 0,viewBox:{cx:i.cx,cy:i.cy,innerRadius:i.innerRadius,outerRadius:i.outerRadius,startAngle:i.startAngle,endAngle:i.endAngle,clockWise:!1},fill:i.fill})),[n,e]);return p.createElement(mn,{value:e?r:void 0},a)}function ja(t){var{props:e,previousSectorsRef:n,id:a}=t,{sectors:r,isAnimationActive:i,animationBegin:s,animationDuration:o,animationEasing:l,activeShape:c,inactiveShape:g,onAnimationStart:f,onAnimationEnd:m}=e,x=cn(e,"recharts-pie-"),d=n.current,[v,h]=p.useState(!1),b=p.useCallback(()=>{typeof m=="function"&&m(),h(!1)},[m]),y=p.useCallback(()=>{typeof f=="function"&&f(),h(!0)},[f]);return p.createElement(ka,{showLabels:!v,sectors:r},p.createElement(un,{animationId:x,begin:s,duration:o,isActive:i,easing:l,onAnimationStart:y,onAnimationEnd:b,key:x},O=>{var N,R=[],k=r&&r[0],j=(N=k?.startAngle)!==null&&N!==void 0?N:0;return r?.forEach((P,A)=>{var E=d&&d[A],L=A>0?dn(P,"paddingAngle",0):0;if(E){var C=Ge(E.endAngle-E.startAngle,P.endAngle-P.startAngle,O),K=w(w({},P),{},{startAngle:j+L,endAngle:j+C+L});R.push(K),j=K.endAngle}else{var{endAngle:T,startAngle:M}=P,S=Ge(0,T-M,O),D=w(w({},P),{},{startAngle:j+L,endAngle:j+S+L});R.push(D),j=D.endAngle}}),n.current=R,p.createElement(fe,null,p.createElement(ya,{sectors:R,activeShape:c,inactiveShape:g,allOtherPieProps:e,shape:e.shape,id:a}))}),p.createElement(ba,{showLabels:!v,sectors:r,props:e}),e.children)}var Ea={animationBegin:400,animationDuration:1500,animationEasing:"ease",cx:"50%",cy:"50%",dataKey:"value",endAngle:360,fill:"#808080",hide:!1,innerRadius:0,isAnimationActive:"auto",label:!1,labelLine:!0,legendType:"rect",minAngle:0,nameKey:"name",outerRadius:"80%",paddingAngle:0,rootTabIndex:0,startAngle:0,stroke:"#fff",zIndex:ut.area};function Na(t){var{id:e}=t,n=Ae(t,aa),{hide:a,className:r,rootTabIndex:i}=t,s=p.useMemo(()=>mt(t.children,Fe),[t.children]),o=ve(g=>ea(g,e,s)),l=p.useRef(null),c=Ke("recharts-pie",r);return a||o==null?(l.current=null,p.createElement(fe,{tabIndex:i,className:c})):p.createElement(ft,{zIndex:t.zIndex},p.createElement(da,{dataKey:t.dataKey,nameKey:t.nameKey,sectors:o,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,tooltipType:t.tooltipType,id:e,activeShape:t.activeShape}),p.createElement(fe,{tabIndex:i,className:c},p.createElement(ja,{props:w(w({},n),{},{sectors:o}),previousSectorsRef:l,id:e})))}function Ra(t){var e=ze(t,Ea),{id:n}=e,a=Ae(e,ra),r=dt(a);return p.createElement(rn,{id:n,type:"pie"},i=>p.createElement(p.Fragment,null,p.createElement(sn,{type:"pie",id:i,data:a.data,dataKey:a.dataKey,hide:a.hide,angleAxisId:0,radiusAxisId:0,name:a.name,nameKey:a.nameKey,tooltipType:a.tooltipType,legendType:a.legendType,fill:a.fill,cx:a.cx,cy:a.cy,startAngle:a.startAngle,endAngle:a.endAngle,paddingAngle:a.paddingAngle,minAngle:a.minAngle,innerRadius:a.innerRadius,outerRadius:a.outerRadius,cornerRadius:a.cornerRadius,presentationProps:r,maxRadius:e.maxRadius}),p.createElement(ca,V({},a,{id:i})),p.createElement(Na,V({},a,{id:i}))))}var yt=Ra;yt.displayName="Pie";function Aa(t){var e=En();return p.useEffect(()=>{e(Nn(t))},[e,t]),null}var Oa=["layout"];function Me(){return Me=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var a in n)({}).hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},Me.apply(null,arguments)}function wa(t,e){if(t==null)return{};var n,a,r=Ca(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)n=i[a],e.indexOf(n)===-1&&{}.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Ca(t,e){if(t==null)return{};var n={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;n[a]=t[a]}return n}function Xe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,a)}return n}function Sa(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Xe(Object(n),!0).forEach(function(a){Ta(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Xe(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function Ta(t,e,n){return(e=Ia(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ia(t){var e=Da(t,"string");return typeof e=="symbol"?e:e+""}function Da(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var a=n.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var _a={top:5,right:5,bottom:5,left:5},Pt=Sa({accessibilityLayer:!0,stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:_a,reverseStackOrder:!1,syncMethod:"index",layout:"radial",responsive:!1,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"},Tn),La=p.forwardRef(function(e,n){var a,r=ze(e.categoricalChartProps,Pt),{layout:i}=r,s=wa(r,Oa),{chartName:o,defaultTooltipEventType:l,validateTooltipEventTypes:c,tooltipPayloadSearcher:g}=e,f={chartName:o,defaultTooltipEventType:l,validateTooltipEventTypes:c,tooltipPayloadSearcher:g,eventEmitter:void 0};return p.createElement(Rn,{preloadedState:{options:f},reduxStoreName:(a=r.id)!==null&&a!==void 0?a:o},p.createElement(An,{chartData:r.data}),p.createElement(On,{layout:i,margin:r.margin}),p.createElement(wn,{throttleDelay:r.throttleDelay,throttledEvents:r.throttledEvents}),p.createElement(Cn,{baseValue:void 0,accessibilityLayer:r.accessibilityLayer,barCategoryGap:r.barCategoryGap,maxBarSize:r.maxBarSize,stackOffset:r.stackOffset,barGap:r.barGap,barSize:r.barSize,syncId:r.syncId,syncMethod:r.syncMethod,className:r.className,reverseStackOrder:r.reverseStackOrder}),p.createElement(Aa,{cx:r.cx,cy:r.cy,startAngle:r.startAngle,endAngle:r.endAngle,innerRadius:r.innerRadius,outerRadius:r.outerRadius}),p.createElement(Sn,Me({},s,{ref:n})))});function Je(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,a)}return n}function Qe(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Je(Object(n),!0).forEach(function(a){$a(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Je(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function $a(t,e,n){return(e=Ma(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ma(t){var e=Ka(t,"string");return typeof e=="symbol"?e:e+""}function Ka(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var a=n.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Fa=["item"],za=Qe(Qe({},Pt),{},{layout:"centric",startAngle:0,endAngle:360}),Ba=p.forwardRef((t,e)=>{var n=ze(t,za);return p.createElement(La,{chartName:"PieChart",defaultTooltipEventType:"item",validateTooltipEventTypes:Fa,tooltipPayloadSearcher:In,categoricalChartProps:n,ref:e})});const kt="var(--color-primary)",et=[kt,"var(--color-chart-1)","var(--color-chart-3)","var(--color-chart-4)"],Wa="color-mix(in oklch, var(--color-muted-foreground) 45%, transparent)";function jt(t){let e=0;return t.map(n=>n.role==="control"?Wa:et[e++%et.length])}function Va(t){const e=z.c(19),{arms:n,size:a,thickness:r}=t;let i;e[0]!==n?(i=jt(n),e[0]=n,e[1]=i):i=e[1];const s=i,o=a/2;let l;e[2]!==n?(l=n.map(Ua),e[2]=n,e[3]=l):l=e[3];const c=o-r,g=n.filter(Ga).length>1?2:0,f=r/4;let m;if(e[4]!==n||e[5]!==s){let v;e[7]!==s?(v=(h,b)=>u.jsx(Fe,{fill:s[b]},h.id),e[7]=s,e[8]=v):v=e[8],m=n.map(v),e[4]=n,e[5]=s,e[6]=m}else m=e[6];let x;e[9]!==o||e[10]!==l||e[11]!==c||e[12]!==g||e[13]!==f||e[14]!==m?(x=u.jsx(yt,{data:l,dataKey:"value",nameKey:"id",innerRadius:c,outerRadius:o,startAngle:90,endAngle:450,paddingAngle:g,cornerRadius:f,stroke:"none",isAnimationActive:!1,children:m}),e[9]=o,e[10]=l,e[11]=c,e[12]=g,e[13]=f,e[14]=m,e[15]=x):x=e[15];let d;return e[16]!==a||e[17]!==x?(d=u.jsx(Ba,{width:a,height:a,children:x}),e[16]=a,e[17]=x,e[18]=d):d=e[18],d}function Ga(t){return t.weight>0}function Ua(t){return{id:t.id,value:t.weight}}function je(t){return Number.isFinite(t)?Math.min(100,Math.max(0,Math.round(t))):0}function Ha(t){const e=je(t);return[{id:"in-test",role:"treatment",weight:e},{id:"rest",role:"control",weight:100-e}]}function tt(t){const e=z.c(11),{color:n,label:a,value:r,testId:i}=t;let s;e[0]!==n?(s=u.jsx("span",{className:"size-2.5 flex-shrink-0 rounded-full",style:{backgroundColor:n}}),e[0]=n,e[1]=s):s=e[1];let o;e[2]!==a?(o=u.jsx("span",{className:"min-w-0 flex-1 truncate",children:a}),e[2]=a,e[3]=o):o=e[3];let l;e[4]!==i||e[5]!==r?(l=u.jsxs("span",{className:"font-medium tabular-nums","data-testid":i,children:[r,"%"]}),e[4]=i,e[5]=r,e[6]=l):l=e[6];let c;return e[7]!==s||e[8]!==o||e[9]!==l?(c=u.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[s,o,l]}),e[7]=s,e[8]=o,e[9]=l,e[10]=c):c=e[10],c}function qa(t){const e=z.c(48),{value:n,onChange:a,onCommit:r,readOnly:i,sliderLabel:s,inTestLabel:o,restLabel:l,centerLabel:c,disabled:g,compact:f,className:m}=t;let x,d,v;e[0]!==n?(d=je(n),x=Ha(d),v=jt(x),e[0]=n,e[1]=x,e[2]=d,e[3]=v):(x=e[1],d=e[2],v=e[3]);const[h,b]=v,y=f?112:176,O=f&&"gap-4";let N;e[4]!==m||e[5]!==O?(N=G("flex flex-col items-center gap-6 sm:flex-row",O,m),e[4]=m,e[5]=O,e[6]=N):N=e[6];const R=f?14:22;let k;e[7]!==x||e[8]!==y||e[9]!==R?(k=u.jsx(Va,{arms:x,size:y,thickness:R}),e[7]=x,e[8]=y,e[9]=R,e[10]=k):k=e[10];const j=f?"text-xl":"text-3xl";let P;e[11]!==j?(P=G("font-medium tabular-nums",j),e[11]=j,e[12]=P):P=e[12];let A;e[13]!==d||e[14]!==P?(A=u.jsxs("span",{className:P,children:[d,"%"]}),e[13]=d,e[14]=P,e[15]=A):A=e[15];let E;e[16]!==c?(E=u.jsx("span",{className:"text-xs text-muted-foreground",children:c}),e[16]=c,e[17]=E):E=e[17];let L;e[18]!==A||e[19]!==E?(L=u.jsxs("div",{className:"pointer-events-none absolute inset-0 flex flex-col items-center justify-center",children:[A,E]}),e[18]=A,e[19]=E,e[20]=L):L=e[20];let C;e[21]!==L||e[22]!==k?(C=u.jsxs("div",{className:"relative flex-shrink-0","aria-hidden":"true",children:[k,L]}),e[21]=L,e[22]=k,e[23]=C):C=e[23];let K;e[24]!==h||e[25]!==o||e[26]!==d?(K=u.jsx(tt,{color:h,label:o,value:d,testId:"share-split-in"}),e[24]=h,e[25]=o,e[26]=d,e[27]=K):K=e[27];let T;e[28]!==g||e[29]!==h||e[30]!==a||e[31]!==r||e[32]!==i||e[33]!==d||e[34]!==s?(T=i?u.jsx("div",{className:"h-px w-full bg-border","aria-hidden":"true","data-testid":"share-split-divider"}):u.jsx(Dt,{value:[d],min:0,max:100,step:1,disabled:g,thumbLabel:s,thumbValueText:`${d}%`,onValueChange:_=>{const[B]=_;return a?.(je(B??0))},onValueCommit:_=>{const[B]=_;return r?.(je(B??0))},style:h===kt?void 0:{"--primary":h}}),e[28]=g,e[29]=h,e[30]=a,e[31]=r,e[32]=i,e[33]=d,e[34]=s,e[35]=T):T=e[35];const M=100-d;let S;e[36]!==b||e[37]!==l||e[38]!==M?(S=u.jsx(tt,{color:b,label:l,value:M,testId:"share-split-rest"}),e[36]=b,e[37]=l,e[38]=M,e[39]=S):S=e[39];let D;e[40]!==K||e[41]!==T||e[42]!==S?(D=u.jsxs("div",{className:"flex w-full min-w-0 flex-1 flex-col gap-3",children:[K,T,S]}),e[40]=K,e[41]=T,e[42]=S,e[43]=D):D=e[43];let I;return e[44]!==C||e[45]!==D||e[46]!==N?(I=u.jsxs("div",{className:N,"data-testid":"share-split",children:[C,D]}),e[44]=C,e[45]=D,e[46]=N,e[47]=I):I=e[47],I}const Ya=[[/always|matchalways/i,"Users03"],[/device|matchdevice/i,"Phone02"],[/date|matchdate/i,"Calendar"],[/random|matchrandom/i,"Shuffle01"],[/host|matchhost/i,"Globe02"],[/location|matchlocation/i,"MarkerPin01"],[/pathname/i,"Link03"],[/cron|matchcron/i,"Clock"],[/multi|matchmulti/i,"FilterLines"],[/never|matchnever/i,"EyeOff"],[/environment|matchenvironment/i,"Cloud01"],[/eq\.ts|\/eq$/i,"Brackets"],[/user|requser|isdecouser/i,"User01"],[/site|template/i,"LayoutAlt01"]],Za={"device-mobile":"Phone02","device-desktop":"Monitor01","device-tablet":"Tablet01","calendar-event":"Calendar","calendar-month":"Calendar",gift:"Gift01","user-check":"UserCheck01","user-x":"UserX01",clock:"Clock","current-location":"MarkerPin01","map-2":"MarkerPin01","world-search":"Globe02",shuffle:"Shuffle01",filter:"FilterLines","eye-off":"EyeOff",flask:"Beaker02",link:"Link03","git-merge":"GitBranch01",users:"Users03",flag:"Flag01","cloud-storm":"Cloud01",campaign:"Announcement01",experiment:"Beaker02",language:"Globe02","hand-click":"CursorClick01"};function Te(t){return pt(t)!==void 0}function Xa(t,e,n=!1){if(n&&/^campaign$/i.test(t))return"Calendar";if(n&&/^experiment$/i.test(t))return"Beaker02";if(e){if(Te(e))return e;const a=Za[e];if(a&&Te(a))return a}for(const[a,r]of Ya)if(a.test(t)&&Te(r))return r;return"FilterLines"}function Ja(t){return pt(t)??Dn}function Oe(t){const e=z.c(11),{iconName:n,size:a,className:r}=t,i=a===void 0?"md":a;let s;e[0]!==n?(s=Ja(n),e[0]=n,e[1]=s):s=e[1];const o=s,l=i==="sm"?"size-7":"size-9",c=i==="sm"?16:18;let g;e[2]!==l||e[3]!==r?(g=G("flex shrink-0 items-center justify-center rounded-full bg-muted",l,r),e[2]=l,e[3]=r,e[4]=g):g=e[4];let f;e[5]!==o||e[6]!==c?(f=u.jsx(o,{size:c,className:"text-muted-foreground"}),e[5]=o,e[6]=c,e[7]=f):f=e[7];let m;return e[8]!==g||e[9]!==f?(m=u.jsx("div",{className:g,children:f}),e[8]=g,e[9]=f,e[10]=m):m=e[10],m}function br(t,e){const n=[];for(const a of _n){if(Ln(t,a)!=="available")continue;const r=vt(e,a);if(r.kind==="conflict"){n.push({kind:a,state:"conflict",entries:[]});continue}const i=Object.entries(r.values).map(([s,o])=>({name:s,summary:Qa(a,o)}));n.push({kind:a,state:r.kind,entries:i})}return n}function Qa(t,e){return e===void 0?"":t==="experiments"?typeof e=="number"?At("sectionsEditor.namedRulePicker.shareOfVisitors",{share:String(e)}):"":typeof e=="object"?Ot(e)??"":""}function yr(t){return new Set(t.map(e=>Ee(e.kind).matcher))}function Et(t,e){const n=t.trim();return n?n.startsWith("__")?"reserved":e.includes(n)?"taken":null:"empty"}const me=t=>String(Math.abs(t)).padStart(2,"0");function nt(t){const e=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2}))?$/.exec(t.trim());if(!e)return null;const[,n,a,r,i,s,o]=e,l=new Date(Number(n),Number(a)-1,Number(r),Number(i),Number(s),Number(o??0));if(Number.isNaN(l.getTime()))return null;const c=-l.getTimezoneOffset(),f=`${c>=0?"+":"-"}${me(Math.trunc(c/60))}:${me(c%60)}`;return`${n}-${a}-${r}T${i}:${s}:${o??"00"}${f}`}function at(t){if(!t)return"";const e=new Date(t);return Number.isNaN(e.getTime())?"":`${e.getFullYear()}-${me(e.getMonth()+1)}-${me(e.getDate())}T${me(e.getHours())}:${me(e.getMinutes())}`}function er(t,e){const n=nt(t),a=nt(e);return n&&a&&new Date(a).getTime()<=new Date(n).getTime()?{problem:"end-before-start"}:{window:{...n?{start:n}:{},...a?{end:a}:{}}}}function Pr(t){if(!gt(t))return null;const{start:e,end:n}=t;return{...typeof e=="string"&&e?{start:e}:{},...typeof n=="string"&&n?{end:n}:{}}}function kr(t,e){const n=e.name.trim();if(!n||n.startsWith("__"))return{ok:!1,reason:"empty"};const a=$n(e.kind,n);if(!e.create)return{ok:!0,rule:a,blockWrite:null};const r=vt(t,e.kind);if(r.kind==="conflict")return{ok:!1,reason:"conflict"};if(Mn(r,n))return{ok:!0,rule:a,blockWrite:null};const i=e.kind==="experiments"?e.create.share:e.create.window;return{ok:!0,rule:a,blockWrite:{blockKey:Ee(e.kind).blockKey,block:Kn(r.block,e.kind,n,i)}}}function tr(t,e){const n=$e(t);if(!n||!e.some(r=>r.kind===n.kind))return null;const a=e.find(r=>r.kind===n.kind);return{...n,entry:a.entries.find(r=>r.name===n.name)??null}}function jr(t,e){const n=tr(t,e);if(n){const a=e.some(r=>r.kind===n.kind&&r.state==="conflict");return{kind:n.kind,name:n.name,summary:n.entry?.summary??"",missing:n.entry===null&&!a,conflict:a,inlineDate:!1}}return gt(t)&&e.some(a=>a.kind==="campaigns")?{kind:"campaigns",name:"",summary:"",missing:!1,conflict:e.some(a=>a.kind==="campaigns"&&a.state==="conflict"),inlineDate:!0}:null}function Er(t,e,n){if(e.length===0||$e(t))return null;const a=(s,o)=>{const l=e.find(c=>c.kind===s);return!!l&&l.state!=="conflict"&&!l.entries.some(c=>c.name===o)},r=new Set,i=[t];for(;i.length>0;){const s=i.pop();if(Array.isArray(s)){i.push(...s);continue}if(!s||typeof s!="object")continue;const o=$e(s);if(o){if(a(o.kind,o.name))return o.kind;continue}const l=s,c=l.__resolveType;typeof c=="string"&&n&&Object.hasOwn(n,c)&&!r.has(c)&&(r.add(c),i.push(n[c]));for(const[g,f]of Object.entries(l))g!=="__resolveType"&&i.push(f)}return null}function nr(t){if(!t||typeof t!="object"||Array.isArray(t))return null;const e=Object.keys(t);return e.length!==1||e[0]!=="__resolveType"?null:Fn(t.__resolveType)}function Nr(t,e,n){if(t.type!=="block-ref"||!t.anyOfRefs?.length)return[];if(!(e==null||typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0)&&nr(e)===null)return[];const r=new Set(t.anyOfRefs.map(i=>i.resolveType));return n.map(i=>i.kind).filter(i=>r.has(Ee(i).resolveType))}const rt="dark:scheme-dark";function we(t){return Xa(Ee(t).matcher,void 0,!0)}const Nt=p.createContext(null);function Rr(t){const e=z.c(3),{value:n,children:a}=t;let r;return e[0]!==a||e[1]!==n?(r=u.jsx(Nt.Provider,{value:n,children:a}),e[0]=a,e[1]=n,e[2]=r):r=e[2],r}function ar(){return p.useContext(Nt)}const Rt=p.createContext(null),Ar=Rt.Provider;function Or(){return p.useContext(Rt)}function wr(t){const e=z.c(11),{kinds:n,currentKind:a,onOpen:r}=t,i=pe();let s;if(e[0]!==a||e[1]!==n||e[2]!==r||e[3]!==i){let l;e[5]!==a||e[6]!==r||e[7]!==i?(l=c=>{const{kind:g}=c,f=i(g==="experiments"?"sectionsEditor.namedRulePicker.abTestTitle":"sectionsEditor.namedRulePicker.campaignTitle"),m=i(g==="experiments"?"sectionsEditor.namedRulePicker.abTestDescription":"sectionsEditor.namedRulePicker.campaignDescription");return u.jsxs(De,{value:`${f} ${m}`,onSelect:()=>r(g),className:G("gap-2.5",a===g&&"bg-accent/60"),children:[u.jsx(Oe,{iconName:we(g),size:"sm"}),u.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[u.jsx("span",{className:"text-sm",children:f}),u.jsx("span",{className:"truncate text-xs text-muted-foreground",children:m})]})]},g)},e[5]=a,e[6]=r,e[7]=i,e[8]=l):l=e[8],s=n.map(l),e[0]=a,e[1]=n,e[2]=r,e[3]=i,e[4]=s}else s=e[4];let o;return e[9]!==s?(o=u.jsx(u.Fragment,{children:s}),e[9]=s,e[10]=o):o=e[10],o}function Cr(t){const e=z.c(34),{kind:n,currentName:a,load:r,onBack:i,onPick:s,onCreate:o}=t,l=pe(),[c,g]=p.useState(""),f=n.kind==="experiments";let m,x,d,v;if(e[0]!==a||e[1]!==n.entries||e[2]!==n.kind||e[3]!==n.state||e[4]!==r||e[5]!==i||e[6]!==o||e[7]!==s||e[8]!==c||e[9]!==l||e[10]!==f){const y=c.trim(),O=n.entries.map(rr),N=n.state!=="conflict"&&Et(y,O)===null;let R;e[15]===Symbol.for("react.memo_cache_sentinel")?(R=u.jsx(St,{className:"size-3.5"}),e[15]=R):R=e[15];let k;e[16]!==l?(k=l("sectionsEditor.namedRulePicker.back"),e[16]=l,e[17]=k):k=e[17],e[18]!==i||e[19]!==k?(d=u.jsx("div",{className:"flex items-center gap-1 border-b border-border px-2 py-1.5",children:u.jsxs(he,{type:"button",variant:"ghost",size:"sm",className:"h-7 gap-1 px-2 text-xs text-muted-foreground",onClick:i,children:[R,k]})}),e[18]=i,e[19]=k,e[20]=d):d=e[20];let j;e[21]!==l||e[22]!==f?(j=l(f?"sectionsEditor.namedRulePicker.searchTests":"sectionsEditor.namedRulePicker.searchCampaigns"),e[21]=l,e[22]=f,e[23]=j):j=e[23],e[24]!==c||e[25]!==j?(v=u.jsx(Tt,{autoFocus:!0,value:c,onValueChange:g,placeholder:j}),e[24]=c,e[25]=j,e[26]=v):v=e[26],m=It,x=r&&!r.ready?r.failed?u.jsxs("div",{className:"flex flex-col items-center gap-3 px-4 py-6 text-center text-sm text-muted-foreground",children:[u.jsx("p",{children:l(f?"sectionsEditor.namedRulePicker.loadFailedTests":"sectionsEditor.namedRulePicker.loadFailedCampaigns")}),u.jsx(he,{type:"button",variant:"outline",size:"sm",onClick:r.retry,children:l("sectionsEditor.namedRules.tryAgain")})]}):u.jsx("div",{className:"flex justify-center px-4 py-6","data-testid":"named-rule-names-loading",children:u.jsx(wt,{className:"size-4 text-muted-foreground"})}):n.state==="conflict"?u.jsx("p",{className:"px-4 py-6 text-sm text-muted-foreground",children:l(f?"sectionsEditor.namedRulePicker.conflictTests":"sectionsEditor.namedRulePicker.conflictCampaigns")}):u.jsxs(u.Fragment,{children:[n.entries.length===0&&!y&&u.jsx("p",{className:"px-4 py-6 text-sm text-muted-foreground",children:l(f?"sectionsEditor.namedRulePicker.noTests":"sectionsEditor.namedRulePicker.noCampaigns")}),n.entries.length>0&&u.jsx(Ve,{heading:l(f?"sectionsEditor.namedRulePicker.testsHeading":"sectionsEditor.namedRulePicker.campaignsHeading"),children:n.entries.map(P=>u.jsxs(De,{value:`${P.name} ${P.summary}`,onSelect:()=>s(P.name),className:G("gap-2.5",a===P.name&&"bg-accent/60"),children:[u.jsx(Oe,{iconName:we(n.kind),size:"sm"}),u.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[u.jsx("span",{className:"truncate text-sm",children:P.name}),u.jsx("span",{className:"truncate text-xs text-muted-foreground",children:P.summary||(f?"":l("sectionsEditor.namedRulePicker.alwaysRunning"))})]})]},P.name))}),N&&u.jsx(Ve,{forceMount:!0,children:u.jsxs(De,{forceMount:!0,value:`__create__ ${y}`,onSelect:()=>o(y),className:"gap-2.5",children:[u.jsx(it,{className:"size-4 text-muted-foreground"}),u.jsx("span",{className:"truncate text-sm",children:f?l("sectionsEditor.namedRulePicker.createTest",{name:y}):l("sectionsEditor.namedRulePicker.createCampaign",{name:y})})]})})]}),e[0]=a,e[1]=n.entries,e[2]=n.kind,e[3]=n.state,e[4]=r,e[5]=i,e[6]=o,e[7]=s,e[8]=c,e[9]=l,e[10]=f,e[11]=m,e[12]=x,e[13]=d,e[14]=v}else m=e[11],x=e[12],d=e[13],v=e[14];let h;e[27]!==m||e[28]!==x?(h=u.jsx(m,{children:x}),e[27]=m,e[28]=x,e[29]=h):h=e[29];let b;return e[30]!==d||e[31]!==v||e[32]!==h?(b=u.jsxs(u.Fragment,{children:[d,v,h]}),e[30]=d,e[31]=v,e[32]=h,e[33]=b):b=e[33],b}function rr(t){return t.name}function ir(t,e,n){switch(e){case"empty":return t("sectionsEditor.namedRules.nameEmpty");case"reserved":return t("sectionsEditor.namedRules.nameReserved");case"taken":return n?.pickFromList?t("sectionsEditor.namedRules.nameTakenPick"):t("sectionsEditor.namedRules.nameTaken")}}function sr(t){const e=z.c(34),{idPrefix:n,start:a,end:r,onStartChange:i,onEndChange:s,className:o}=t,l=pe();let c;e[0]!==o?(c=G("grid grid-cols-2 gap-3",o),e[0]=o,e[1]=c):c=e[1];const g=`${n}-start`;let f;e[2]!==l?(f=l("sectionsEditor.namedRules.startLabel"),e[2]=l,e[3]=f):f=e[3];let m;e[4]!==g||e[5]!==f?(m=u.jsx(_e,{htmlFor:g,children:f}),e[4]=g,e[5]=f,e[6]=m):m=e[6];const x=`${n}-start`;let d;e[7]!==i?(d=A=>i(A.target.value),e[7]=i,e[8]=d):d=e[8];let v;e[9]!==a||e[10]!==x||e[11]!==d?(v=u.jsx(Ie,{id:x,type:"datetime-local",className:rt,value:a,onChange:d}),e[9]=a,e[10]=x,e[11]=d,e[12]=v):v=e[12];let h;e[13]!==m||e[14]!==v?(h=u.jsxs("div",{className:"flex flex-col gap-1.5",children:[m,v]}),e[13]=m,e[14]=v,e[15]=h):h=e[15];const b=`${n}-end`;let y;e[16]!==l?(y=l("sectionsEditor.namedRules.endLabel"),e[16]=l,e[17]=y):y=e[17];let O;e[18]!==y||e[19]!==b?(O=u.jsx(_e,{htmlFor:b,children:y}),e[18]=y,e[19]=b,e[20]=O):O=e[20];const N=`${n}-end`;let R;e[21]!==s?(R=A=>s(A.target.value),e[21]=s,e[22]=R):R=e[22];let k;e[23]!==r||e[24]!==N||e[25]!==R?(k=u.jsx(Ie,{id:N,type:"datetime-local",className:rt,value:r,onChange:R}),e[23]=r,e[24]=N,e[25]=R,e[26]=k):k=e[26];let j;e[27]!==O||e[28]!==k?(j=u.jsxs("div",{className:"flex flex-col gap-1.5",children:[O,k]}),e[27]=O,e[28]=k,e[29]=j):j=e[29];let P;return e[30]!==c||e[31]!==j||e[32]!==h?(P=u.jsxs("div",{className:c,children:[h,j]}),e[30]=c,e[31]=j,e[32]=h,e[33]=P):P=e[33],P}function Sr(t){const e=z.c(91),{kind:n,initialName:a,existingNames:r,prefill:i,pending:s,submitLabel:o,dismiss:l,standalone:c,onBack:g,onSubmit:f}=t,m=l===void 0?"back":l,x=c===void 0?!1:c,d=pe(),v=n==="experiments",[h,b]=p.useState(a),[y,O]=p.useState(50),N=i?.start;let R;e[0]!==N?(R=at(N),e[0]=N,e[1]=R):R=e[1];const[k,j]=p.useState(R),P=i?.end;let A;e[2]!==P?(A=at(P),e[2]=P,e[3]=A):A=e[3];const[E,L]=p.useState(A),[C,K]=p.useState(!1),[T,M]=p.useState(null);let S,D,I,_;if(e[4]!==E||e[5]!==r||e[6]!==h||e[7]!==x||e[8]!==k||e[9]!==T||e[10]!==d||e[11]!==v){S=T!==null&&T===h.trim()?null:Et(h,r);let F;e[16]!==E||e[17]!==k?(F=er(k,E),e[16]=E,e[17]=k,e[18]=F):F=e[18],_=F;let Pe;e[19]!==d||e[20]!==v||e[21]!==_?(Pe=v?null:"problem"in _?d("sectionsEditor.namedRules.endBeforeStart"):null,e[19]=d,e[20]=v,e[21]=_,e[22]=Pe):Pe=e[22],I=Pe,D=S?ir(d,S,{pickFromList:!x}):null,e[4]=E,e[5]=r,e[6]=h,e[7]=x,e[8]=k,e[9]=T,e[10]=d,e[11]=v,e[12]=S,e[13]=D,e[14]=I,e[15]=_}else S=e[12],D=e[13],I=e[14],_=e[15];const B=D;let H;e[23]!==h||e[24]!==S||e[25]!==f||e[26]!==s||e[27]!==y||e[28]!==v||e[29]!==I||e[30]!==_?(H=()=>{if(K(!0),S||I||s)return;const F=h.trim();M(F),v?f({kind:"experiments",name:F,create:{share:y}}):"window"in _&&f({kind:"campaigns",name:F,create:{window:_.window}})},e[23]=h,e[24]=S,e[25]=f,e[26]=s,e[27]=y,e[28]=v,e[29]=I,e[30]=_,e[31]=H):H=e[31];const Ce=H;let q;e[32]!==Ce?(q=F=>{F.preventDefault(),Ce()},e[32]=Ce,e[33]=q):q=e[33];let Y;e[34]!==n?(Y=we(n),e[34]=n,e[35]=Y):Y=e[35];let Z;e[36]!==Y?(Z=u.jsx(Oe,{iconName:Y,size:"sm"}),e[36]=Y,e[37]=Z):Z=e[37];let X;e[38]!==d||e[39]!==v?(X=d(v?"sectionsEditor.namedRulePicker.newTestTitle":"sectionsEditor.namedRulePicker.newCampaignTitle"),e[38]=d,e[39]=v,e[40]=X):X=e[40];let J;e[41]!==X?(J=u.jsx("h3",{className:"text-sm font-medium",children:X}),e[41]=X,e[42]=J):J=e[42];let Q;e[43]!==Z||e[44]!==J?(Q=u.jsxs("div",{className:"flex items-center gap-2",children:[Z,J]}),e[43]=Z,e[44]=J,e[45]=Q):Q=e[45];let ee;e[46]!==d?(ee=d("sectionsEditor.namedRules.nameLabel"),e[46]=d,e[47]=ee):ee=e[47];let te;e[48]!==ee?(te=u.jsx(_e,{htmlFor:"named-rule-name",children:ee}),e[48]=ee,e[49]=te):te=e[49];let be;e[50]===Symbol.for("react.memo_cache_sentinel")?(be=F=>b(F.target.value),e[50]=be):be=e[50];let ne;e[51]!==h?(ne=u.jsx(Ie,{id:"named-rule-name",value:h,onChange:be,autoFocus:!0}),e[51]=h,e[52]=ne):ne=e[52];let ae;e[53]!==B||e[54]!==C?(ae=C&&B&&u.jsx("p",{className:"text-xs text-destructive",children:B}),e[53]=B,e[54]=C,e[55]=ae):ae=e[55];let re;e[56]!==te||e[57]!==ne||e[58]!==ae?(re=u.jsxs("div",{className:"flex flex-col gap-1.5",children:[te,ne,ae]}),e[56]=te,e[57]=ne,e[58]=ae,e[59]=re):re=e[59];let ie;e[60]!==E||e[61]!==y||e[62]!==k||e[63]!==d||e[64]!==v?(ie=v?u.jsxs("div",{className:"flex flex-col gap-1.5",children:[u.jsx("span",{className:"text-sm font-medium",children:d("experiments.v8.shareTitle")}),u.jsx(qa,{compact:!0,value:y,onChange:O,sliderLabel:d("experiments.v8.shareLabel"),inTestLabel:d("experiments.v8.split.inTest"),restLabel:d("experiments.v8.split.rest"),centerLabel:d("experiments.v8.split.center")}),u.jsx("p",{className:"text-xs text-muted-foreground",children:d("sectionsEditor.namedRulePicker.shareHint")})]}):u.jsxs("div",{className:"flex flex-col gap-1.5",children:[u.jsx(sr,{idPrefix:"named-rule",start:k,end:E,onStartChange:j,onEndChange:L}),u.jsx("p",{className:"text-xs text-muted-foreground",children:d("sectionsEditor.namedRules.windowHint")})]}),e[60]=E,e[61]=y,e[62]=k,e[63]=d,e[64]=v,e[65]=ie):ie=e[65];let se;e[66]!==C||e[67]!==I?(se=C&&I&&u.jsx("p",{className:"text-xs text-destructive",children:I}),e[66]=C,e[67]=I,e[68]=se):se=e[68];let le;e[69]!==m||e[70]!==d?(le=d(m==="cancel"?"sectionsEditor.namedRulePicker.cancelCreate":"sectionsEditor.namedRulePicker.cancel"),e[69]=m,e[70]=d,e[71]=le):le=e[71];let oe;e[72]!==g||e[73]!==le?(oe=u.jsx(he,{type:"button",variant:"ghost",size:"sm",onClick:g,children:le}),e[72]=g,e[73]=le,e[74]=oe):oe=e[74];let ce;e[75]!==o||e[76]!==d?(ce=o??d("sectionsEditor.namedRulePicker.createAndUse"),e[75]=o,e[76]=d,e[77]=ce):ce=e[77];let ue;e[78]!==s||e[79]!==ce?(ue=u.jsx(he,{type:"submit",size:"sm",disabled:s,children:ce}),e[78]=s,e[79]=ce,e[80]=ue):ue=e[80];let de;e[81]!==oe||e[82]!==ue?(de=u.jsxs("div",{className:"flex justify-end gap-2",children:[oe,ue]}),e[81]=oe,e[82]=ue,e[83]=de):de=e[83];let ye;return e[84]!==Q||e[85]!==re||e[86]!==ie||e[87]!==se||e[88]!==de||e[89]!==q?(ye=u.jsxs("form",{className:"flex flex-col gap-4 p-4",onKeyDown:lr,onSubmit:q,children:[Q,re,ie,se,de]}),e[84]=Q,e[85]=re,e[86]=ie,e[87]=se,e[88]=de,e[89]=q,e[90]=ye):ye=e[90],ye}function lr(t){return t.stopPropagation()}function Tr(t){const e=z.c(32),{kind:n,name:a,summary:r,missing:i,conflict:s,inlineDate:o,onCreate:l}=t,c=pe(),g=n==="experiments";let f;e[0]!==s||e[1]!==o||e[2]!==i||e[3]!==l||e[4]!==c||e[5]!==g?(f=c(s?g?"sectionsEditor.namedRulePicker.conflictTests":"sectionsEditor.namedRulePicker.conflictCampaigns":o?"sectionsEditor.namedRulePicker.inlineDate":i?l?g?"sectionsEditor.namedRulePicker.missingTest":"sectionsEditor.namedRulePicker.missingCampaign":g?"sectionsEditor.namedRulePicker.missingTestNoCreate":"sectionsEditor.namedRulePicker.missingCampaignNoCreate":g?"sectionsEditor.namedRulePicker.testRowHint":"sectionsEditor.namedRulePicker.campaignRowHint"),e[0]=s,e[1]=o,e[2]=i,e[3]=l,e[4]=c,e[5]=g,e[6]=f):f=e[6];const m=f;let x;e[7]!==o||e[8]!==n||e[9]!==a||e[10]!==r?(x=!o&&u.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[u.jsx(Oe,{iconName:we(n),size:"sm"}),u.jsx("span",{className:"truncate text-sm font-medium",children:a}),r&&u.jsx("span",{className:"truncate text-xs text-muted-foreground",children:r})]}),e[7]=o,e[8]=n,e[9]=a,e[10]=r,e[11]=x):x=e[11];const d=s||i&&!o?"text-foreground":"text-muted-foreground";let v;e[12]!==d?(v=G("text-xs",d),e[12]=d,e[13]=v):v=e[13];const h=s?"named-rule-conflict":i&&!o?"named-rule-missing":void 0;let b;e[14]!==m||e[15]!==v||e[16]!==h?(b=u.jsx("p",{className:v,"data-testid":h,children:m}),e[14]=m,e[15]=v,e[16]=h,e[17]=b):b=e[17];let y;e[18]!==o||e[19]!==i||e[20]!==l||e[21]!==c?(y=i&&!o&&l&&u.jsxs(he,{type:"button",variant:"outline",size:"sm",className:"w-fit",onClick:l,children:[u.jsx(it,{className:"size-4"}),c("sectionsEditor.namedRulePicker.createMissing")]}),e[18]=o,e[19]=i,e[20]=l,e[21]=c,e[22]=y):y=e[22];let O;e[23]!==o||e[24]!==n||e[25]!==a?(O=!o&&u.jsx(or,{kind:n,name:a}),e[23]=o,e[24]=n,e[25]=a,e[26]=O):O=e[26];let N;return e[27]!==x||e[28]!==b||e[29]!==y||e[30]!==O?(N=u.jsxs("div",{className:"flex flex-col gap-1.5 rounded-[var(--studio-control-radius,var(--radius-md))] border border-border/80 bg-muted/30 px-3 py-2","data-testid":"named-rule-row",children:[x,b,y,O]}),e[27]=x,e[28]=b,e[29]=y,e[30]=O,e[31]=N):N=e[31],N}function or(t){const e=z.c(11),{kind:n,name:a}=t,r=pe(),i=ar();if(!i)return null;let s;e[0]!==n||e[1]!==a||e[2]!==i?(s=()=>i.open(n,a),e[0]=n,e[1]=a,e[2]=i,e[3]=s):s=e[3];let o;e[4]!==n||e[5]!==r?(o=r(n==="experiments"?"sectionsEditor.namedRulePicker.openExperiments":"sectionsEditor.namedRulePicker.openCalendar"),e[4]=n,e[5]=r,e[6]=o):o=e[6];let l;e[7]===Symbol.for("react.memo_cache_sentinel")?(l=u.jsx(Ct,{className:"size-3"}),e[7]=l):l=e[7];let c;return e[8]!==s||e[9]!==o?(c=u.jsxs("button",{type:"button",onClick:s,className:"inline-flex w-fit items-center gap-1 text-xs font-medium text-foreground underline-offset-2 hover:underline cursor-pointer",children:[o,l]}),e[8]=s,e[9]=o,e[10]=c):c=e[10],c}export{sr as C,rt as D,Oe as M,Rr as N,kt as P,qa as S,Cr as a,Sr as b,wr as c,Nr as d,nr as e,or as f,Et as g,Tr as h,at as i,Pr as j,jr as k,nt as l,Er as m,yr as n,Va as o,ir as p,jt as q,Xa as r,Ha as s,Wa as t,Or as u,br as v,er as w,Ar as x,kr as y};
1
+ import{r as p,fB as Ke,c as z,m as G,j as u,ea as At,fC as Ot,b as pe,B as he,h as wt,I as Ie,F as Ct}from"./index-CwntHk8S.js";import{i as St}from"./ArrowLeft-Ccyza8AK.js";import{s as it}from"./Plus-C8Idvwpa.js";import{e as Ve,b as De,a as Tt,c as It}from"./command-Bo6EGcaE.js";import{L as _e}from"./label-BFX3DXnu.js";import{S as Dt}from"./slider-DirLi5JL.js";import{C as Fe,u as _t,a as Lt,b as $t,S as Mt}from"./tooltipContext-De8eALzu.js";import{c as $,p as xe,a as Kt,i as Ft,s as U,b as zt,d as Bt,e as st,f as Wt,g as Vt,h as W,j as Gt,k as Ut,l as Ht,m as qt,n as Yt,o as lt,q as Zt,r as Xt,t as Jt,u as Qt,v as ot,w as en,x as tn,y as nn,z as ct,A as an,B as ze,D as ut,C as dt,R as rn,S as sn,E as mt,F as ve,G as ln,L as fe,Z as ft,H as on,I as cn,J as un,K as dn,M as Ge,N as Se,O as ke,P as mn,Q as fn,T as pn,U as vn,V as gn,W as hn,X as xn,Y as bn,_ as yn,$ as ge,a0 as Le,a1 as Ue,a2 as Pn,a3 as kn,a4 as jn,a5 as En,a6 as Nn,a7 as Rn,a8 as An,a9 as On,aa as wn,ab as Cn,ac as Sn,ad as Tn,ae as In}from"./CategoricalChart-gtbFaKuM.js";import{a9 as pt,z as Dn}from"./agent-icon-DE4TWlDl.js";import{N as _n,g as Ln,ae as vt,af as gt,ad as $e,ag as $n,ah as Mn,ai as Kn,aj as Ee,a7 as Fn}from"./blocks-tab-states-GP0NCNYs.js";var ht=t=>t.graphicalItems.polarItems,zn=$([xe,Kt],Ft),Ne=$([ht,U,zn],zt),Bn=$([Ne],Bt),Re=$([Bn,st],Wt),Wn=$([Re,U,Ne],Vt);$([Re,U,Ne],(t,e,n)=>n.length>0?t.flatMap(a=>n.flatMap(r=>{var i,s=W(a,(i=e.dataKey)!==null&&i!==void 0?i:r.dataKey);return{value:s,errorDomain:[]}})).filter(Boolean):e?.dataKey!=null?t.map(a=>({value:W(a,e.dataKey),errorDomain:[]})):t.map(a=>({value:a,errorDomain:[]})));var He=()=>{},Vn=$([Re,U,Ne,Gt,xe,Ut],Ht),Gn=$([U,qt,Yt,He,Vn,He,lt,xe],Zt),xt=$([U,lt,Re,Wn,Xt,xe,Gn],Jt),Un=$([xt,Qt,ot],en),Hn=$([U,xt,Un,xe],tn);$([ot,Hn],nn);function qe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,a)}return n}function Ye(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?qe(Object(n),!0).forEach(function(a){qn(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):qe(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function qn(t,e,n){return(e=Yn(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Yn(t){var e=Zn(t,"string");return typeof e=="symbol"?e:e+""}function Zn(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var a=n.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Xn=(t,e)=>e,Be=$([ht,Xn],(t,e)=>t.filter(n=>n.type==="pie").find(n=>n.id===e)),Jn=[],We=(t,e,n)=>n?.length===0?Jn:n,bt=$([st,Be,We],(t,e,n)=>{var{chartData:a}=t;if(e!=null){var r;if(e?.data!=null&&e.data.length>0?r=e.data:r=a,(!r||!r.length)&&n!=null&&(r=n.map(i=>Ye(Ye({},e.presentationProps),i.props))),r!=null)return r}}),Qn=$([bt,Be,We],(t,e,n)=>{if(!(t==null||e==null))return t.map((a,r)=>{var i,s=W(a,e.nameKey,e.name),o;return n!=null&&(i=n[r])!==null&&i!==void 0&&(i=i.props)!==null&&i!==void 0&&i.fill?o=n[r].props.fill:typeof a=="object"&&a!=null&&"fill"in a?o=a.fill:o=e.fill,{value:ct(s,e.dataKey),color:o,payload:a,type:e.legendType}})}),ea=$([bt,Be,We,an],(t,e,n,a)=>{if(!(e==null||t==null))return Pa({offset:a,pieSettings:e,displayedData:t,cells:n})}),ta=["key"],na=["onMouseEnter","onClick","onMouseLeave"],aa=["id"],ra=["id"];function V(){return V=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var a in n)({}).hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},V.apply(null,arguments)}function Ae(t,e){if(t==null)return{};var n,a,r=ia(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)n=i[a],e.indexOf(n)===-1&&{}.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function ia(t,e){if(t==null)return{};var n={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;n[a]=t[a]}return n}function Ze(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,a)}return n}function w(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Ze(Object(n),!0).forEach(function(a){sa(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ze(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function sa(t,e,n){return(e=la(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function la(t){var e=oa(t,"string");return typeof e=="symbol"?e:e+""}function oa(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var a=n.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ca(t){var e=p.useMemo(()=>mt(t.children,Fe),[t.children]),n=ve(a=>Qn(a,t.id,e));return n==null?null:p.createElement(ln,{legendPayload:n})}function ua(t){if(!(t==null||typeof t=="boolean"||typeof t=="function")){if(p.isValidElement(t)){var e,n=(e=t.props)===null||e===void 0?void 0:e.fill;return typeof n=="string"?n:void 0}var{fill:a}=t;return typeof a=="string"?a:void 0}}var da=p.memo(t=>{var{dataKey:e,nameKey:n,sectors:a,stroke:r,strokeWidth:i,fill:s,name:o,hide:l,tooltipType:c,id:g,activeShape:f}=t,m=ua(f),x=a.map(v=>{var h=v.tooltipPayload;return m==null||h==null?h:h.map(b=>w(w({},b),{},{color:m,fill:m}))}),d={dataDefinedOnItem:x,getPosition:v=>{var h;return(h=a[Number(v)])===null||h===void 0?void 0:h.tooltipPosition},settings:{stroke:r,strokeWidth:i,fill:s,dataKey:e,nameKey:n,name:ct(o,e),hide:l,type:c,color:s,unit:"",graphicalItemId:g}};return p.createElement(on,{tooltipEntrySettings:d})}),ma=(t,e)=>t>e?"start":t<e?"end":"middle",fa=(t,e,n)=>typeof e=="function"?ge(e(t),n,n*.8):ge(e,n,n*.8),pa=(t,e,n)=>{var{top:a,left:r,width:i,height:s}=e,o=yn(i,s),l=r+ge(t.cx,i,i/2),c=a+ge(t.cy,s,s/2),g=ge(t.innerRadius,o,0),f=fa(n,t.outerRadius,o),m=t.maxRadius||Math.sqrt(i*i+s*s)/2;return{cx:l,cy:c,innerRadius:g,outerRadius:f,maxRadius:m}},va=(t,e)=>{var n=ke(e-t),a=Math.min(Math.abs(e-t),360);return n*a},ga=(t,e)=>{if(p.isValidElement(t))return p.cloneElement(t,e);if(typeof t=="function")return t(e);var n=Ke("recharts-pie-label-line",typeof t!="boolean"?t.className:""),{key:a}=e,r=Ae(e,ta);return p.createElement(Pn,V({},r,{type:"linear",className:n}))},ha=(t,e,n)=>{if(p.isValidElement(t))return p.cloneElement(t,e);var a=n;if(typeof t=="function"&&(a=t(e),p.isValidElement(a)))return a;var r=Ke("recharts-pie-label-text",kn(t));return p.createElement(jn,V({},e,{alignmentBaseline:"middle",className:r}),a)};function xa(t){var{sectors:e,props:n,showLabels:a}=t,{label:r,labelLine:i,dataKey:s}=n;if(!a||!r||!e)return null;var o=dt(n),l=Ue(r),c=Ue(i),g=typeof r=="object"&&"offsetRadius"in r&&typeof r.offsetRadius=="number"&&r.offsetRadius||20,f=e.map((m,x)=>{var d=(m.startAngle+m.endAngle)/2,v=Le(m.cx,m.cy,m.outerRadius+g,d),h=w(w(w(w({},o),m),{},{stroke:"none"},l),{},{index:x,textAnchor:ma(v.x,m.cx)},v),b=w(w(w(w({},o),m),{},{fill:"none",stroke:m.fill},c),{},{index:x,points:[Le(m.cx,m.cy,m.outerRadius,d),v],key:"line"});return p.createElement(ft,{zIndex:ut.label,key:"label-".concat(m.startAngle,"-").concat(m.endAngle,"-").concat(m.midAngle,"-").concat(x)},p.createElement(fe,null,i&&ga(i,b),ha(r,h,W(m,s))))});return p.createElement(fe,{className:"recharts-pie-labels"},f)}function ba(t){var{sectors:e,props:n,showLabels:a}=t,{label:r}=n;return typeof r=="object"&&r!=null&&"position"in r?p.createElement(bn,{label:r}):p.createElement(xa,{sectors:e,props:n,showLabels:a})}function ya(t){var{sectors:e,activeShape:n,inactiveShape:a,allOtherPieProps:r,shape:i,id:s}=t,o=ve(fn),l=ve(pn),c=ve(vn),{onMouseEnter:g,onClick:f,onMouseLeave:m}=r,x=Ae(r,na),d=_t(g,r.dataKey,s),v=Lt(m),h=$t(f,r.dataKey,s);return e==null||e.length===0?null:p.createElement(p.Fragment,null,e.map((b,y)=>{if(b?.startAngle===0&&b?.endAngle===0&&e.length!==1)return null;var O=c==null||c===s,N=String(y)===o&&(l==null||r.dataKey===l)&&O,R=o?a:null,k=n&&N?n:R,j=w(w({},b),{},{stroke:b.stroke,tabIndex:-1,[hn]:y,[gn]:s});return p.createElement(fe,V({key:"sector-".concat(b?.startAngle,"-").concat(b?.endAngle,"-").concat(b.midAngle,"-").concat(y),tabIndex:-1,className:"recharts-pie-sector"},xn(x,b,y),{onMouseEnter:d(b,y),onMouseLeave:v(b,y),onClick:h(b,y)}),p.createElement(Mt,V({option:i??k,index:y,shapeType:"sector",isActive:N},j)))}))}function Pa(t){var e,{pieSettings:n,displayedData:a,cells:r,offset:i}=t,{cornerRadius:s,startAngle:o,endAngle:l,dataKey:c,nameKey:g,tooltipType:f}=n,m=Math.abs(n.minAngle),x=va(o,l),d=Math.abs(x),v=a.length<=1?0:(e=n.paddingAngle)!==null&&e!==void 0?e:0,h=a.filter(P=>W(P,c,0)!==0).length,b=(d>=360?h:h-1)*v,y=a.reduce((P,A)=>{var E=W(A,c,0);return P+(Se(E)?E:0)},0),O=m>0&&y>0&&a.some(P=>{var A=W(P,c,0),E=(Se(A)?A:0)/y;return A!==0&&E*d<m}),N=O?m:0,R=d-h*N-b,k;if(y>0){var j;k=a.map((P,A)=>{var E=W(P,c,0),L=W(P,g,A),C=pa(n,i,P),K=(Se(E)?E:0)/y,T,M=w(w({},P),r&&r[A]&&r[A].props),S=M!=null&&"fill"in M&&typeof M.fill=="string"?M.fill:n.fill;A?T=j.endAngle+ke(x)*v*(E!==0?1:0):T=o;var D=T+ke(x)*((E!==0?N:0)+K*R),I=(T+D)/2,_=(C.innerRadius+C.outerRadius)/2,B=[{name:L,value:E,payload:M,dataKey:c,type:f,color:S,fill:S,graphicalItemId:n.id}],H=Le(C.cx,C.cy,_,I);return j=w(w(w(w({},n.presentationProps),{},{percent:K,cornerRadius:typeof s=="string"?parseFloat(s):s,name:L,tooltipPayload:B,midAngle:I,middleRadius:_,tooltipPosition:H},M),C),{},{value:E,dataKey:c,startAngle:T,endAngle:D,payload:M,paddingAngle:E!==0?ke(x)*v:0}),j})}return k}function ka(t){var{showLabels:e,sectors:n,children:a}=t,r=p.useMemo(()=>!e||!n?[]:n.map(i=>({value:i.value,payload:i.payload,clockWise:!1,parentViewBox:void 0,viewBox:{cx:i.cx,cy:i.cy,innerRadius:i.innerRadius,outerRadius:i.outerRadius,startAngle:i.startAngle,endAngle:i.endAngle,clockWise:!1},fill:i.fill})),[n,e]);return p.createElement(mn,{value:e?r:void 0},a)}function ja(t){var{props:e,previousSectorsRef:n,id:a}=t,{sectors:r,isAnimationActive:i,animationBegin:s,animationDuration:o,animationEasing:l,activeShape:c,inactiveShape:g,onAnimationStart:f,onAnimationEnd:m}=e,x=cn(e,"recharts-pie-"),d=n.current,[v,h]=p.useState(!1),b=p.useCallback(()=>{typeof m=="function"&&m(),h(!1)},[m]),y=p.useCallback(()=>{typeof f=="function"&&f(),h(!0)},[f]);return p.createElement(ka,{showLabels:!v,sectors:r},p.createElement(un,{animationId:x,begin:s,duration:o,isActive:i,easing:l,onAnimationStart:y,onAnimationEnd:b,key:x},O=>{var N,R=[],k=r&&r[0],j=(N=k?.startAngle)!==null&&N!==void 0?N:0;return r?.forEach((P,A)=>{var E=d&&d[A],L=A>0?dn(P,"paddingAngle",0):0;if(E){var C=Ge(E.endAngle-E.startAngle,P.endAngle-P.startAngle,O),K=w(w({},P),{},{startAngle:j+L,endAngle:j+C+L});R.push(K),j=K.endAngle}else{var{endAngle:T,startAngle:M}=P,S=Ge(0,T-M,O),D=w(w({},P),{},{startAngle:j+L,endAngle:j+S+L});R.push(D),j=D.endAngle}}),n.current=R,p.createElement(fe,null,p.createElement(ya,{sectors:R,activeShape:c,inactiveShape:g,allOtherPieProps:e,shape:e.shape,id:a}))}),p.createElement(ba,{showLabels:!v,sectors:r,props:e}),e.children)}var Ea={animationBegin:400,animationDuration:1500,animationEasing:"ease",cx:"50%",cy:"50%",dataKey:"value",endAngle:360,fill:"#808080",hide:!1,innerRadius:0,isAnimationActive:"auto",label:!1,labelLine:!0,legendType:"rect",minAngle:0,nameKey:"name",outerRadius:"80%",paddingAngle:0,rootTabIndex:0,startAngle:0,stroke:"#fff",zIndex:ut.area};function Na(t){var{id:e}=t,n=Ae(t,aa),{hide:a,className:r,rootTabIndex:i}=t,s=p.useMemo(()=>mt(t.children,Fe),[t.children]),o=ve(g=>ea(g,e,s)),l=p.useRef(null),c=Ke("recharts-pie",r);return a||o==null?(l.current=null,p.createElement(fe,{tabIndex:i,className:c})):p.createElement(ft,{zIndex:t.zIndex},p.createElement(da,{dataKey:t.dataKey,nameKey:t.nameKey,sectors:o,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,tooltipType:t.tooltipType,id:e,activeShape:t.activeShape}),p.createElement(fe,{tabIndex:i,className:c},p.createElement(ja,{props:w(w({},n),{},{sectors:o}),previousSectorsRef:l,id:e})))}function Ra(t){var e=ze(t,Ea),{id:n}=e,a=Ae(e,ra),r=dt(a);return p.createElement(rn,{id:n,type:"pie"},i=>p.createElement(p.Fragment,null,p.createElement(sn,{type:"pie",id:i,data:a.data,dataKey:a.dataKey,hide:a.hide,angleAxisId:0,radiusAxisId:0,name:a.name,nameKey:a.nameKey,tooltipType:a.tooltipType,legendType:a.legendType,fill:a.fill,cx:a.cx,cy:a.cy,startAngle:a.startAngle,endAngle:a.endAngle,paddingAngle:a.paddingAngle,minAngle:a.minAngle,innerRadius:a.innerRadius,outerRadius:a.outerRadius,cornerRadius:a.cornerRadius,presentationProps:r,maxRadius:e.maxRadius}),p.createElement(ca,V({},a,{id:i})),p.createElement(Na,V({},a,{id:i}))))}var yt=Ra;yt.displayName="Pie";function Aa(t){var e=En();return p.useEffect(()=>{e(Nn(t))},[e,t]),null}var Oa=["layout"];function Me(){return Me=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var a in n)({}).hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},Me.apply(null,arguments)}function wa(t,e){if(t==null)return{};var n,a,r=Ca(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)n=i[a],e.indexOf(n)===-1&&{}.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Ca(t,e){if(t==null)return{};var n={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;n[a]=t[a]}return n}function Xe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,a)}return n}function Sa(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Xe(Object(n),!0).forEach(function(a){Ta(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Xe(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function Ta(t,e,n){return(e=Ia(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ia(t){var e=Da(t,"string");return typeof e=="symbol"?e:e+""}function Da(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var a=n.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var _a={top:5,right:5,bottom:5,left:5},Pt=Sa({accessibilityLayer:!0,stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:_a,reverseStackOrder:!1,syncMethod:"index",layout:"radial",responsive:!1,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"},Tn),La=p.forwardRef(function(e,n){var a,r=ze(e.categoricalChartProps,Pt),{layout:i}=r,s=wa(r,Oa),{chartName:o,defaultTooltipEventType:l,validateTooltipEventTypes:c,tooltipPayloadSearcher:g}=e,f={chartName:o,defaultTooltipEventType:l,validateTooltipEventTypes:c,tooltipPayloadSearcher:g,eventEmitter:void 0};return p.createElement(Rn,{preloadedState:{options:f},reduxStoreName:(a=r.id)!==null&&a!==void 0?a:o},p.createElement(An,{chartData:r.data}),p.createElement(On,{layout:i,margin:r.margin}),p.createElement(wn,{throttleDelay:r.throttleDelay,throttledEvents:r.throttledEvents}),p.createElement(Cn,{baseValue:void 0,accessibilityLayer:r.accessibilityLayer,barCategoryGap:r.barCategoryGap,maxBarSize:r.maxBarSize,stackOffset:r.stackOffset,barGap:r.barGap,barSize:r.barSize,syncId:r.syncId,syncMethod:r.syncMethod,className:r.className,reverseStackOrder:r.reverseStackOrder}),p.createElement(Aa,{cx:r.cx,cy:r.cy,startAngle:r.startAngle,endAngle:r.endAngle,innerRadius:r.innerRadius,outerRadius:r.outerRadius}),p.createElement(Sn,Me({},s,{ref:n})))});function Je(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,a)}return n}function Qe(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Je(Object(n),!0).forEach(function(a){$a(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Je(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function $a(t,e,n){return(e=Ma(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ma(t){var e=Ka(t,"string");return typeof e=="symbol"?e:e+""}function Ka(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var a=n.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Fa=["item"],za=Qe(Qe({},Pt),{},{layout:"centric",startAngle:0,endAngle:360}),Ba=p.forwardRef((t,e)=>{var n=ze(t,za);return p.createElement(La,{chartName:"PieChart",defaultTooltipEventType:"item",validateTooltipEventTypes:Fa,tooltipPayloadSearcher:In,categoricalChartProps:n,ref:e})});const kt="var(--color-primary)",et=[kt,"var(--color-chart-1)","var(--color-chart-3)","var(--color-chart-4)"],Wa="color-mix(in oklch, var(--color-muted-foreground) 45%, transparent)";function jt(t){let e=0;return t.map(n=>n.role==="control"?Wa:et[e++%et.length])}function Va(t){const e=z.c(19),{arms:n,size:a,thickness:r}=t;let i;e[0]!==n?(i=jt(n),e[0]=n,e[1]=i):i=e[1];const s=i,o=a/2;let l;e[2]!==n?(l=n.map(Ua),e[2]=n,e[3]=l):l=e[3];const c=o-r,g=n.filter(Ga).length>1?2:0,f=r/4;let m;if(e[4]!==n||e[5]!==s){let v;e[7]!==s?(v=(h,b)=>u.jsx(Fe,{fill:s[b]},h.id),e[7]=s,e[8]=v):v=e[8],m=n.map(v),e[4]=n,e[5]=s,e[6]=m}else m=e[6];let x;e[9]!==o||e[10]!==l||e[11]!==c||e[12]!==g||e[13]!==f||e[14]!==m?(x=u.jsx(yt,{data:l,dataKey:"value",nameKey:"id",innerRadius:c,outerRadius:o,startAngle:90,endAngle:450,paddingAngle:g,cornerRadius:f,stroke:"none",isAnimationActive:!1,children:m}),e[9]=o,e[10]=l,e[11]=c,e[12]=g,e[13]=f,e[14]=m,e[15]=x):x=e[15];let d;return e[16]!==a||e[17]!==x?(d=u.jsx(Ba,{width:a,height:a,children:x}),e[16]=a,e[17]=x,e[18]=d):d=e[18],d}function Ga(t){return t.weight>0}function Ua(t){return{id:t.id,value:t.weight}}function je(t){return Number.isFinite(t)?Math.min(100,Math.max(0,Math.round(t))):0}function Ha(t){const e=je(t);return[{id:"in-test",role:"treatment",weight:e},{id:"rest",role:"control",weight:100-e}]}function tt(t){const e=z.c(11),{color:n,label:a,value:r,testId:i}=t;let s;e[0]!==n?(s=u.jsx("span",{className:"size-2.5 flex-shrink-0 rounded-full",style:{backgroundColor:n}}),e[0]=n,e[1]=s):s=e[1];let o;e[2]!==a?(o=u.jsx("span",{className:"min-w-0 flex-1 truncate",children:a}),e[2]=a,e[3]=o):o=e[3];let l;e[4]!==i||e[5]!==r?(l=u.jsxs("span",{className:"font-medium tabular-nums","data-testid":i,children:[r,"%"]}),e[4]=i,e[5]=r,e[6]=l):l=e[6];let c;return e[7]!==s||e[8]!==o||e[9]!==l?(c=u.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[s,o,l]}),e[7]=s,e[8]=o,e[9]=l,e[10]=c):c=e[10],c}function qa(t){const e=z.c(48),{value:n,onChange:a,onCommit:r,readOnly:i,sliderLabel:s,inTestLabel:o,restLabel:l,centerLabel:c,disabled:g,compact:f,className:m}=t;let x,d,v;e[0]!==n?(d=je(n),x=Ha(d),v=jt(x),e[0]=n,e[1]=x,e[2]=d,e[3]=v):(x=e[1],d=e[2],v=e[3]);const[h,b]=v,y=f?112:176,O=f&&"gap-4";let N;e[4]!==m||e[5]!==O?(N=G("flex flex-col items-center gap-6 sm:flex-row",O,m),e[4]=m,e[5]=O,e[6]=N):N=e[6];const R=f?14:22;let k;e[7]!==x||e[8]!==y||e[9]!==R?(k=u.jsx(Va,{arms:x,size:y,thickness:R}),e[7]=x,e[8]=y,e[9]=R,e[10]=k):k=e[10];const j=f?"text-xl":"text-3xl";let P;e[11]!==j?(P=G("font-medium tabular-nums",j),e[11]=j,e[12]=P):P=e[12];let A;e[13]!==d||e[14]!==P?(A=u.jsxs("span",{className:P,children:[d,"%"]}),e[13]=d,e[14]=P,e[15]=A):A=e[15];let E;e[16]!==c?(E=u.jsx("span",{className:"text-xs text-muted-foreground",children:c}),e[16]=c,e[17]=E):E=e[17];let L;e[18]!==A||e[19]!==E?(L=u.jsxs("div",{className:"pointer-events-none absolute inset-0 flex flex-col items-center justify-center",children:[A,E]}),e[18]=A,e[19]=E,e[20]=L):L=e[20];let C;e[21]!==L||e[22]!==k?(C=u.jsxs("div",{className:"relative flex-shrink-0","aria-hidden":"true",children:[k,L]}),e[21]=L,e[22]=k,e[23]=C):C=e[23];let K;e[24]!==h||e[25]!==o||e[26]!==d?(K=u.jsx(tt,{color:h,label:o,value:d,testId:"share-split-in"}),e[24]=h,e[25]=o,e[26]=d,e[27]=K):K=e[27];let T;e[28]!==g||e[29]!==h||e[30]!==a||e[31]!==r||e[32]!==i||e[33]!==d||e[34]!==s?(T=i?u.jsx("div",{className:"h-px w-full bg-border","aria-hidden":"true","data-testid":"share-split-divider"}):u.jsx(Dt,{value:[d],min:0,max:100,step:1,disabled:g,thumbLabel:s,thumbValueText:`${d}%`,onValueChange:_=>{const[B]=_;return a?.(je(B??0))},onValueCommit:_=>{const[B]=_;return r?.(je(B??0))},style:h===kt?void 0:{"--primary":h}}),e[28]=g,e[29]=h,e[30]=a,e[31]=r,e[32]=i,e[33]=d,e[34]=s,e[35]=T):T=e[35];const M=100-d;let S;e[36]!==b||e[37]!==l||e[38]!==M?(S=u.jsx(tt,{color:b,label:l,value:M,testId:"share-split-rest"}),e[36]=b,e[37]=l,e[38]=M,e[39]=S):S=e[39];let D;e[40]!==K||e[41]!==T||e[42]!==S?(D=u.jsxs("div",{className:"flex w-full min-w-0 flex-1 flex-col gap-3",children:[K,T,S]}),e[40]=K,e[41]=T,e[42]=S,e[43]=D):D=e[43];let I;return e[44]!==C||e[45]!==D||e[46]!==N?(I=u.jsxs("div",{className:N,"data-testid":"share-split",children:[C,D]}),e[44]=C,e[45]=D,e[46]=N,e[47]=I):I=e[47],I}const Ya=[[/always|matchalways/i,"Users03"],[/device|matchdevice/i,"Phone02"],[/date|matchdate/i,"Calendar"],[/random|matchrandom/i,"Shuffle01"],[/host|matchhost/i,"Globe02"],[/location|matchlocation/i,"MarkerPin01"],[/pathname/i,"Link03"],[/cron|matchcron/i,"Clock"],[/multi|matchmulti/i,"FilterLines"],[/never|matchnever/i,"EyeOff"],[/environment|matchenvironment/i,"Cloud01"],[/eq\.ts|\/eq$/i,"Brackets"],[/user|requser|isdecouser/i,"User01"],[/site|template/i,"LayoutAlt01"]],Za={"device-mobile":"Phone02","device-desktop":"Monitor01","device-tablet":"Tablet01","calendar-event":"Calendar","calendar-month":"Calendar",gift:"Gift01","user-check":"UserCheck01","user-x":"UserX01",clock:"Clock","current-location":"MarkerPin01","map-2":"MarkerPin01","world-search":"Globe02",shuffle:"Shuffle01",filter:"FilterLines","eye-off":"EyeOff",flask:"Beaker02",link:"Link03","git-merge":"GitBranch01",users:"Users03",flag:"Flag01","cloud-storm":"Cloud01",campaign:"Announcement01",experiment:"Beaker02",language:"Globe02","hand-click":"CursorClick01"};function Te(t){return pt(t)!==void 0}function Xa(t,e,n=!1){if(n&&/^campaign$/i.test(t))return"Calendar";if(n&&/^experiment$/i.test(t))return"Beaker02";if(e){if(Te(e))return e;const a=Za[e];if(a&&Te(a))return a}for(const[a,r]of Ya)if(a.test(t)&&Te(r))return r;return"FilterLines"}function Ja(t){return pt(t)??Dn}function Oe(t){const e=z.c(11),{iconName:n,size:a,className:r}=t,i=a===void 0?"md":a;let s;e[0]!==n?(s=Ja(n),e[0]=n,e[1]=s):s=e[1];const o=s,l=i==="sm"?"size-7":"size-9",c=i==="sm"?16:18;let g;e[2]!==l||e[3]!==r?(g=G("flex shrink-0 items-center justify-center rounded-full bg-muted",l,r),e[2]=l,e[3]=r,e[4]=g):g=e[4];let f;e[5]!==o||e[6]!==c?(f=u.jsx(o,{size:c,className:"text-muted-foreground"}),e[5]=o,e[6]=c,e[7]=f):f=e[7];let m;return e[8]!==g||e[9]!==f?(m=u.jsx("div",{className:g,children:f}),e[8]=g,e[9]=f,e[10]=m):m=e[10],m}function br(t,e){const n=[];for(const a of _n){if(Ln(t,a)!=="available")continue;const r=vt(e,a);if(r.kind==="conflict"){n.push({kind:a,state:"conflict",entries:[]});continue}const i=Object.entries(r.values).map(([s,o])=>({name:s,summary:Qa(a,o)}));n.push({kind:a,state:r.kind,entries:i})}return n}function Qa(t,e){return e===void 0?"":t==="experiments"?typeof e=="number"?At("sectionsEditor.namedRulePicker.shareOfVisitors",{share:String(e)}):"":typeof e=="object"?Ot(e)??"":""}function yr(t){return new Set(t.map(e=>Ee(e.kind).matcher))}function Et(t,e){const n=t.trim();return n?n.startsWith("__")?"reserved":e.includes(n)?"taken":null:"empty"}const me=t=>String(Math.abs(t)).padStart(2,"0");function nt(t){const e=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2}))?$/.exec(t.trim());if(!e)return null;const[,n,a,r,i,s,o]=e,l=new Date(Number(n),Number(a)-1,Number(r),Number(i),Number(s),Number(o??0));if(Number.isNaN(l.getTime()))return null;const c=-l.getTimezoneOffset(),f=`${c>=0?"+":"-"}${me(Math.trunc(c/60))}:${me(c%60)}`;return`${n}-${a}-${r}T${i}:${s}:${o??"00"}${f}`}function at(t){if(!t)return"";const e=new Date(t);return Number.isNaN(e.getTime())?"":`${e.getFullYear()}-${me(e.getMonth()+1)}-${me(e.getDate())}T${me(e.getHours())}:${me(e.getMinutes())}`}function er(t,e){const n=nt(t),a=nt(e);return n&&a&&new Date(a).getTime()<=new Date(n).getTime()?{problem:"end-before-start"}:{window:{...n?{start:n}:{},...a?{end:a}:{}}}}function Pr(t){if(!gt(t))return null;const{start:e,end:n}=t;return{...typeof e=="string"&&e?{start:e}:{},...typeof n=="string"&&n?{end:n}:{}}}function kr(t,e){const n=e.name.trim();if(!n||n.startsWith("__"))return{ok:!1,reason:"empty"};const a=$n(e.kind,n);if(!e.create)return{ok:!0,rule:a,blockWrite:null};const r=vt(t,e.kind);if(r.kind==="conflict")return{ok:!1,reason:"conflict"};if(Mn(r,n))return{ok:!0,rule:a,blockWrite:null};const i=e.kind==="experiments"?e.create.share:e.create.window;return{ok:!0,rule:a,blockWrite:{blockKey:Ee(e.kind).blockKey,block:Kn(r.block,e.kind,n,i)}}}function tr(t,e){const n=$e(t);if(!n||!e.some(r=>r.kind===n.kind))return null;const a=e.find(r=>r.kind===n.kind);return{...n,entry:a.entries.find(r=>r.name===n.name)??null}}function jr(t,e){const n=tr(t,e);if(n){const a=e.some(r=>r.kind===n.kind&&r.state==="conflict");return{kind:n.kind,name:n.name,summary:n.entry?.summary??"",missing:n.entry===null&&!a,conflict:a,inlineDate:!1}}return gt(t)&&e.some(a=>a.kind==="campaigns")?{kind:"campaigns",name:"",summary:"",missing:!1,conflict:e.some(a=>a.kind==="campaigns"&&a.state==="conflict"),inlineDate:!0}:null}function Er(t,e,n){if(e.length===0||$e(t))return null;const a=(s,o)=>{const l=e.find(c=>c.kind===s);return!!l&&l.state!=="conflict"&&!l.entries.some(c=>c.name===o)},r=new Set,i=[t];for(;i.length>0;){const s=i.pop();if(Array.isArray(s)){i.push(...s);continue}if(!s||typeof s!="object")continue;const o=$e(s);if(o){if(a(o.kind,o.name))return o.kind;continue}const l=s,c=l.__resolveType;typeof c=="string"&&n&&Object.hasOwn(n,c)&&!r.has(c)&&(r.add(c),i.push(n[c]));for(const[g,f]of Object.entries(l))g!=="__resolveType"&&i.push(f)}return null}function nr(t){if(!t||typeof t!="object"||Array.isArray(t))return null;const e=Object.keys(t);return e.length!==1||e[0]!=="__resolveType"?null:Fn(t.__resolveType)}function Nr(t,e,n){if(t.type!=="block-ref"||!t.anyOfRefs?.length)return[];if(!(e==null||typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0)&&nr(e)===null)return[];const r=new Set(t.anyOfRefs.map(i=>i.resolveType));return n.map(i=>i.kind).filter(i=>r.has(Ee(i).resolveType))}const rt="dark:scheme-dark";function we(t){return Xa(Ee(t).matcher,void 0,!0)}const Nt=p.createContext(null);function Rr(t){const e=z.c(3),{value:n,children:a}=t;let r;return e[0]!==a||e[1]!==n?(r=u.jsx(Nt.Provider,{value:n,children:a}),e[0]=a,e[1]=n,e[2]=r):r=e[2],r}function ar(){return p.useContext(Nt)}const Rt=p.createContext(null),Ar=Rt.Provider;function Or(){return p.useContext(Rt)}function wr(t){const e=z.c(11),{kinds:n,currentKind:a,onOpen:r}=t,i=pe();let s;if(e[0]!==a||e[1]!==n||e[2]!==r||e[3]!==i){let l;e[5]!==a||e[6]!==r||e[7]!==i?(l=c=>{const{kind:g}=c,f=i(g==="experiments"?"sectionsEditor.namedRulePicker.abTestTitle":"sectionsEditor.namedRulePicker.campaignTitle"),m=i(g==="experiments"?"sectionsEditor.namedRulePicker.abTestDescription":"sectionsEditor.namedRulePicker.campaignDescription");return u.jsxs(De,{value:`${f} ${m}`,onSelect:()=>r(g),className:G("gap-2.5",a===g&&"bg-accent/60"),children:[u.jsx(Oe,{iconName:we(g),size:"sm"}),u.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[u.jsx("span",{className:"text-sm",children:f}),u.jsx("span",{className:"truncate text-xs text-muted-foreground",children:m})]})]},g)},e[5]=a,e[6]=r,e[7]=i,e[8]=l):l=e[8],s=n.map(l),e[0]=a,e[1]=n,e[2]=r,e[3]=i,e[4]=s}else s=e[4];let o;return e[9]!==s?(o=u.jsx(u.Fragment,{children:s}),e[9]=s,e[10]=o):o=e[10],o}function Cr(t){const e=z.c(34),{kind:n,currentName:a,load:r,onBack:i,onPick:s,onCreate:o}=t,l=pe(),[c,g]=p.useState(""),f=n.kind==="experiments";let m,x,d,v;if(e[0]!==a||e[1]!==n.entries||e[2]!==n.kind||e[3]!==n.state||e[4]!==r||e[5]!==i||e[6]!==o||e[7]!==s||e[8]!==c||e[9]!==l||e[10]!==f){const y=c.trim(),O=n.entries.map(rr),N=n.state!=="conflict"&&Et(y,O)===null;let R;e[15]===Symbol.for("react.memo_cache_sentinel")?(R=u.jsx(St,{className:"size-3.5"}),e[15]=R):R=e[15];let k;e[16]!==l?(k=l("sectionsEditor.namedRulePicker.back"),e[16]=l,e[17]=k):k=e[17],e[18]!==i||e[19]!==k?(d=u.jsx("div",{className:"flex items-center gap-1 border-b border-border px-2 py-1.5",children:u.jsxs(he,{type:"button",variant:"ghost",size:"sm",className:"h-7 gap-1 px-2 text-xs text-muted-foreground",onClick:i,children:[R,k]})}),e[18]=i,e[19]=k,e[20]=d):d=e[20];let j;e[21]!==l||e[22]!==f?(j=l(f?"sectionsEditor.namedRulePicker.searchTests":"sectionsEditor.namedRulePicker.searchCampaigns"),e[21]=l,e[22]=f,e[23]=j):j=e[23],e[24]!==c||e[25]!==j?(v=u.jsx(Tt,{autoFocus:!0,value:c,onValueChange:g,placeholder:j}),e[24]=c,e[25]=j,e[26]=v):v=e[26],m=It,x=r&&!r.ready?r.failed?u.jsxs("div",{className:"flex flex-col items-center gap-3 px-4 py-6 text-center text-sm text-muted-foreground",children:[u.jsx("p",{children:l(f?"sectionsEditor.namedRulePicker.loadFailedTests":"sectionsEditor.namedRulePicker.loadFailedCampaigns")}),u.jsx(he,{type:"button",variant:"outline",size:"sm",onClick:r.retry,children:l("sectionsEditor.namedRules.tryAgain")})]}):u.jsx("div",{className:"flex justify-center px-4 py-6","data-testid":"named-rule-names-loading",children:u.jsx(wt,{className:"size-4 text-muted-foreground"})}):n.state==="conflict"?u.jsx("p",{className:"px-4 py-6 text-sm text-muted-foreground",children:l(f?"sectionsEditor.namedRulePicker.conflictTests":"sectionsEditor.namedRulePicker.conflictCampaigns")}):u.jsxs(u.Fragment,{children:[n.entries.length===0&&!y&&u.jsx("p",{className:"px-4 py-6 text-sm text-muted-foreground",children:l(f?"sectionsEditor.namedRulePicker.noTests":"sectionsEditor.namedRulePicker.noCampaigns")}),n.entries.length>0&&u.jsx(Ve,{heading:l(f?"sectionsEditor.namedRulePicker.testsHeading":"sectionsEditor.namedRulePicker.campaignsHeading"),children:n.entries.map(P=>u.jsxs(De,{value:`${P.name} ${P.summary}`,onSelect:()=>s(P.name),className:G("gap-2.5",a===P.name&&"bg-accent/60"),children:[u.jsx(Oe,{iconName:we(n.kind),size:"sm"}),u.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[u.jsx("span",{className:"truncate text-sm",children:P.name}),u.jsx("span",{className:"truncate text-xs text-muted-foreground",children:P.summary||(f?"":l("sectionsEditor.namedRulePicker.alwaysRunning"))})]})]},P.name))}),N&&u.jsx(Ve,{forceMount:!0,children:u.jsxs(De,{forceMount:!0,value:`__create__ ${y}`,onSelect:()=>o(y),className:"gap-2.5",children:[u.jsx(it,{className:"size-4 text-muted-foreground"}),u.jsx("span",{className:"truncate text-sm",children:f?l("sectionsEditor.namedRulePicker.createTest",{name:y}):l("sectionsEditor.namedRulePicker.createCampaign",{name:y})})]})})]}),e[0]=a,e[1]=n.entries,e[2]=n.kind,e[3]=n.state,e[4]=r,e[5]=i,e[6]=o,e[7]=s,e[8]=c,e[9]=l,e[10]=f,e[11]=m,e[12]=x,e[13]=d,e[14]=v}else m=e[11],x=e[12],d=e[13],v=e[14];let h;e[27]!==m||e[28]!==x?(h=u.jsx(m,{children:x}),e[27]=m,e[28]=x,e[29]=h):h=e[29];let b;return e[30]!==d||e[31]!==v||e[32]!==h?(b=u.jsxs(u.Fragment,{children:[d,v,h]}),e[30]=d,e[31]=v,e[32]=h,e[33]=b):b=e[33],b}function rr(t){return t.name}function ir(t,e,n){switch(e){case"empty":return t("sectionsEditor.namedRules.nameEmpty");case"reserved":return t("sectionsEditor.namedRules.nameReserved");case"taken":return n?.pickFromList?t("sectionsEditor.namedRules.nameTakenPick"):t("sectionsEditor.namedRules.nameTaken")}}function sr(t){const e=z.c(34),{idPrefix:n,start:a,end:r,onStartChange:i,onEndChange:s,className:o}=t,l=pe();let c;e[0]!==o?(c=G("grid grid-cols-2 gap-3",o),e[0]=o,e[1]=c):c=e[1];const g=`${n}-start`;let f;e[2]!==l?(f=l("sectionsEditor.namedRules.startLabel"),e[2]=l,e[3]=f):f=e[3];let m;e[4]!==g||e[5]!==f?(m=u.jsx(_e,{htmlFor:g,children:f}),e[4]=g,e[5]=f,e[6]=m):m=e[6];const x=`${n}-start`;let d;e[7]!==i?(d=A=>i(A.target.value),e[7]=i,e[8]=d):d=e[8];let v;e[9]!==a||e[10]!==x||e[11]!==d?(v=u.jsx(Ie,{id:x,type:"datetime-local",className:rt,value:a,onChange:d}),e[9]=a,e[10]=x,e[11]=d,e[12]=v):v=e[12];let h;e[13]!==m||e[14]!==v?(h=u.jsxs("div",{className:"flex flex-col gap-1.5",children:[m,v]}),e[13]=m,e[14]=v,e[15]=h):h=e[15];const b=`${n}-end`;let y;e[16]!==l?(y=l("sectionsEditor.namedRules.endLabel"),e[16]=l,e[17]=y):y=e[17];let O;e[18]!==y||e[19]!==b?(O=u.jsx(_e,{htmlFor:b,children:y}),e[18]=y,e[19]=b,e[20]=O):O=e[20];const N=`${n}-end`;let R;e[21]!==s?(R=A=>s(A.target.value),e[21]=s,e[22]=R):R=e[22];let k;e[23]!==r||e[24]!==N||e[25]!==R?(k=u.jsx(Ie,{id:N,type:"datetime-local",className:rt,value:r,onChange:R}),e[23]=r,e[24]=N,e[25]=R,e[26]=k):k=e[26];let j;e[27]!==O||e[28]!==k?(j=u.jsxs("div",{className:"flex flex-col gap-1.5",children:[O,k]}),e[27]=O,e[28]=k,e[29]=j):j=e[29];let P;return e[30]!==c||e[31]!==j||e[32]!==h?(P=u.jsxs("div",{className:c,children:[h,j]}),e[30]=c,e[31]=j,e[32]=h,e[33]=P):P=e[33],P}function Sr(t){const e=z.c(91),{kind:n,initialName:a,existingNames:r,prefill:i,pending:s,submitLabel:o,dismiss:l,standalone:c,onBack:g,onSubmit:f}=t,m=l===void 0?"back":l,x=c===void 0?!1:c,d=pe(),v=n==="experiments",[h,b]=p.useState(a),[y,O]=p.useState(50),N=i?.start;let R;e[0]!==N?(R=at(N),e[0]=N,e[1]=R):R=e[1];const[k,j]=p.useState(R),P=i?.end;let A;e[2]!==P?(A=at(P),e[2]=P,e[3]=A):A=e[3];const[E,L]=p.useState(A),[C,K]=p.useState(!1),[T,M]=p.useState(null);let S,D,I,_;if(e[4]!==E||e[5]!==r||e[6]!==h||e[7]!==x||e[8]!==k||e[9]!==T||e[10]!==d||e[11]!==v){S=T!==null&&T===h.trim()?null:Et(h,r);let F;e[16]!==E||e[17]!==k?(F=er(k,E),e[16]=E,e[17]=k,e[18]=F):F=e[18],_=F;let Pe;e[19]!==d||e[20]!==v||e[21]!==_?(Pe=v?null:"problem"in _?d("sectionsEditor.namedRules.endBeforeStart"):null,e[19]=d,e[20]=v,e[21]=_,e[22]=Pe):Pe=e[22],I=Pe,D=S?ir(d,S,{pickFromList:!x}):null,e[4]=E,e[5]=r,e[6]=h,e[7]=x,e[8]=k,e[9]=T,e[10]=d,e[11]=v,e[12]=S,e[13]=D,e[14]=I,e[15]=_}else S=e[12],D=e[13],I=e[14],_=e[15];const B=D;let H;e[23]!==h||e[24]!==S||e[25]!==f||e[26]!==s||e[27]!==y||e[28]!==v||e[29]!==I||e[30]!==_?(H=()=>{if(K(!0),S||I||s)return;const F=h.trim();M(F),v?f({kind:"experiments",name:F,create:{share:y}}):"window"in _&&f({kind:"campaigns",name:F,create:{window:_.window}})},e[23]=h,e[24]=S,e[25]=f,e[26]=s,e[27]=y,e[28]=v,e[29]=I,e[30]=_,e[31]=H):H=e[31];const Ce=H;let q;e[32]!==Ce?(q=F=>{F.preventDefault(),Ce()},e[32]=Ce,e[33]=q):q=e[33];let Y;e[34]!==n?(Y=we(n),e[34]=n,e[35]=Y):Y=e[35];let Z;e[36]!==Y?(Z=u.jsx(Oe,{iconName:Y,size:"sm"}),e[36]=Y,e[37]=Z):Z=e[37];let X;e[38]!==d||e[39]!==v?(X=d(v?"sectionsEditor.namedRulePicker.newTestTitle":"sectionsEditor.namedRulePicker.newCampaignTitle"),e[38]=d,e[39]=v,e[40]=X):X=e[40];let J;e[41]!==X?(J=u.jsx("h3",{className:"text-sm font-medium",children:X}),e[41]=X,e[42]=J):J=e[42];let Q;e[43]!==Z||e[44]!==J?(Q=u.jsxs("div",{className:"flex items-center gap-2",children:[Z,J]}),e[43]=Z,e[44]=J,e[45]=Q):Q=e[45];let ee;e[46]!==d?(ee=d("sectionsEditor.namedRules.nameLabel"),e[46]=d,e[47]=ee):ee=e[47];let te;e[48]!==ee?(te=u.jsx(_e,{htmlFor:"named-rule-name",children:ee}),e[48]=ee,e[49]=te):te=e[49];let be;e[50]===Symbol.for("react.memo_cache_sentinel")?(be=F=>b(F.target.value),e[50]=be):be=e[50];let ne;e[51]!==h?(ne=u.jsx(Ie,{id:"named-rule-name",value:h,onChange:be,autoFocus:!0}),e[51]=h,e[52]=ne):ne=e[52];let ae;e[53]!==B||e[54]!==C?(ae=C&&B&&u.jsx("p",{className:"text-xs text-destructive",children:B}),e[53]=B,e[54]=C,e[55]=ae):ae=e[55];let re;e[56]!==te||e[57]!==ne||e[58]!==ae?(re=u.jsxs("div",{className:"flex flex-col gap-1.5",children:[te,ne,ae]}),e[56]=te,e[57]=ne,e[58]=ae,e[59]=re):re=e[59];let ie;e[60]!==E||e[61]!==y||e[62]!==k||e[63]!==d||e[64]!==v?(ie=v?u.jsxs("div",{className:"flex flex-col gap-1.5",children:[u.jsx("span",{className:"text-sm font-medium",children:d("experiments.v8.shareTitle")}),u.jsx(qa,{compact:!0,value:y,onChange:O,sliderLabel:d("experiments.v8.shareLabel"),inTestLabel:d("experiments.v8.split.inTest"),restLabel:d("experiments.v8.split.rest"),centerLabel:d("experiments.v8.split.center")}),u.jsx("p",{className:"text-xs text-muted-foreground",children:d("sectionsEditor.namedRulePicker.shareHint")})]}):u.jsxs("div",{className:"flex flex-col gap-1.5",children:[u.jsx(sr,{idPrefix:"named-rule",start:k,end:E,onStartChange:j,onEndChange:L}),u.jsx("p",{className:"text-xs text-muted-foreground",children:d("sectionsEditor.namedRules.windowHint")})]}),e[60]=E,e[61]=y,e[62]=k,e[63]=d,e[64]=v,e[65]=ie):ie=e[65];let se;e[66]!==C||e[67]!==I?(se=C&&I&&u.jsx("p",{className:"text-xs text-destructive",children:I}),e[66]=C,e[67]=I,e[68]=se):se=e[68];let le;e[69]!==m||e[70]!==d?(le=d(m==="cancel"?"sectionsEditor.namedRulePicker.cancelCreate":"sectionsEditor.namedRulePicker.cancel"),e[69]=m,e[70]=d,e[71]=le):le=e[71];let oe;e[72]!==g||e[73]!==le?(oe=u.jsx(he,{type:"button",variant:"ghost",size:"sm",onClick:g,children:le}),e[72]=g,e[73]=le,e[74]=oe):oe=e[74];let ce;e[75]!==o||e[76]!==d?(ce=o??d("sectionsEditor.namedRulePicker.createAndUse"),e[75]=o,e[76]=d,e[77]=ce):ce=e[77];let ue;e[78]!==s||e[79]!==ce?(ue=u.jsx(he,{type:"submit",size:"sm",disabled:s,children:ce}),e[78]=s,e[79]=ce,e[80]=ue):ue=e[80];let de;e[81]!==oe||e[82]!==ue?(de=u.jsxs("div",{className:"flex justify-end gap-2",children:[oe,ue]}),e[81]=oe,e[82]=ue,e[83]=de):de=e[83];let ye;return e[84]!==Q||e[85]!==re||e[86]!==ie||e[87]!==se||e[88]!==de||e[89]!==q?(ye=u.jsxs("form",{className:"flex flex-col gap-4 p-4",onKeyDown:lr,onSubmit:q,children:[Q,re,ie,se,de]}),e[84]=Q,e[85]=re,e[86]=ie,e[87]=se,e[88]=de,e[89]=q,e[90]=ye):ye=e[90],ye}function lr(t){return t.stopPropagation()}function Tr(t){const e=z.c(32),{kind:n,name:a,summary:r,missing:i,conflict:s,inlineDate:o,onCreate:l}=t,c=pe(),g=n==="experiments";let f;e[0]!==s||e[1]!==o||e[2]!==i||e[3]!==l||e[4]!==c||e[5]!==g?(f=c(s?g?"sectionsEditor.namedRulePicker.conflictTests":"sectionsEditor.namedRulePicker.conflictCampaigns":o?"sectionsEditor.namedRulePicker.inlineDate":i?l?g?"sectionsEditor.namedRulePicker.missingTest":"sectionsEditor.namedRulePicker.missingCampaign":g?"sectionsEditor.namedRulePicker.missingTestNoCreate":"sectionsEditor.namedRulePicker.missingCampaignNoCreate":g?"sectionsEditor.namedRulePicker.testRowHint":"sectionsEditor.namedRulePicker.campaignRowHint"),e[0]=s,e[1]=o,e[2]=i,e[3]=l,e[4]=c,e[5]=g,e[6]=f):f=e[6];const m=f;let x;e[7]!==o||e[8]!==n||e[9]!==a||e[10]!==r?(x=!o&&u.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[u.jsx(Oe,{iconName:we(n),size:"sm"}),u.jsx("span",{className:"truncate text-sm font-medium",children:a}),r&&u.jsx("span",{className:"truncate text-xs text-muted-foreground",children:r})]}),e[7]=o,e[8]=n,e[9]=a,e[10]=r,e[11]=x):x=e[11];const d=s||i&&!o?"text-foreground":"text-muted-foreground";let v;e[12]!==d?(v=G("text-xs",d),e[12]=d,e[13]=v):v=e[13];const h=s?"named-rule-conflict":i&&!o?"named-rule-missing":void 0;let b;e[14]!==m||e[15]!==v||e[16]!==h?(b=u.jsx("p",{className:v,"data-testid":h,children:m}),e[14]=m,e[15]=v,e[16]=h,e[17]=b):b=e[17];let y;e[18]!==o||e[19]!==i||e[20]!==l||e[21]!==c?(y=i&&!o&&l&&u.jsxs(he,{type:"button",variant:"outline",size:"sm",className:"w-fit",onClick:l,children:[u.jsx(it,{className:"size-4"}),c("sectionsEditor.namedRulePicker.createMissing")]}),e[18]=o,e[19]=i,e[20]=l,e[21]=c,e[22]=y):y=e[22];let O;e[23]!==o||e[24]!==n||e[25]!==a?(O=!o&&u.jsx(or,{kind:n,name:a}),e[23]=o,e[24]=n,e[25]=a,e[26]=O):O=e[26];let N;return e[27]!==x||e[28]!==b||e[29]!==y||e[30]!==O?(N=u.jsxs("div",{className:"flex flex-col gap-1.5 rounded-[var(--studio-control-radius,var(--radius-md))] border border-border/80 bg-muted/30 px-3 py-2","data-testid":"named-rule-row",children:[x,b,y,O]}),e[27]=x,e[28]=b,e[29]=y,e[30]=O,e[31]=N):N=e[31],N}function or(t){const e=z.c(11),{kind:n,name:a}=t,r=pe(),i=ar();if(!i)return null;let s;e[0]!==n||e[1]!==a||e[2]!==i?(s=()=>i.open(n,a),e[0]=n,e[1]=a,e[2]=i,e[3]=s):s=e[3];let o;e[4]!==n||e[5]!==r?(o=r(n==="experiments"?"sectionsEditor.namedRulePicker.openExperiments":"sectionsEditor.namedRulePicker.openCalendar"),e[4]=n,e[5]=r,e[6]=o):o=e[6];let l;e[7]===Symbol.for("react.memo_cache_sentinel")?(l=u.jsx(Ct,{className:"size-3"}),e[7]=l):l=e[7];let c;return e[8]!==s||e[9]!==o?(c=u.jsxs("button",{type:"button",onClick:s,className:"inline-flex w-fit items-center gap-1 text-xs font-medium text-foreground underline-offset-2 hover:underline cursor-pointer",children:[o,l]}),e[8]=s,e[9]=o,e[10]=c):c=e[10],c}export{sr as C,rt as D,Oe as M,Rr as N,kt as P,qa as S,Cr as a,Sr as b,wr as c,Nr as d,nr as e,or as f,Et as g,Tr as h,at as i,Pr as j,jr as k,nt as l,Er as m,yr as n,Va as o,ir as p,jt as q,Xa as r,Ha as s,Wa as t,Or as u,br as v,er as w,Ar as x,kr as y};
@@ -0,0 +1 @@
1
+ import{b as S,r as U,j as p,B as ee,t as E,c as N,x as te,v as ne,D as se}from"./index-CwntHk8S.js";import{B as z}from"./badge-BG-k6t3T.js";import{ae as v,aj as H,ai as F,am as ae,g as le}from"./blocks-tab-states-GP0NCNYs.js";import{g as oe,p as re,b as ie}from"./named-rule-step-P0BFUtVs.js";import{s as ce}from"./Trash01-BRIjyxCC.js";import{aq as L,aN as de,aO as B,u as G,v as J}from"./site-editor-toast-GAJZE2A0.js";import{u as ue}from"./use-apply-named-rule-CcoLpt-_.js";import{c as Q,k as W}from"./use-sandbox-events-cbWqZuIm.js";function fe(n,e,t,s){const a=v(n,e);return a.kind==="conflict"?null:{writes:{[H(e).blockKey]:F(a.block,e,t,s)}}}function me(n,e,t,s){const a=v(n,e);if(a.kind==="conflict")return{problem:"conflict"};const r=oe(t,Object.keys(a.values));return r?{problem:r}:{change:fe(n,e,t.trim(),s)}}function he(n,e,t){const s=v(n,e);return s.kind!=="saved"||!Object.hasOwn(s.block,t)?null:{writes:{[H(e).blockKey]:ae(s.block,t)}}}function ge(n,e,t,s){if(s===void 0)return null;const a=v(n,e);return a.kind==="conflict"||Object.hasOwn(a.block,t)?null:{writes:{[H(e).blockKey]:F(a.block,e,t,s)}}}function Ie(n,e,t,s){if(!n)return null;const a=v(n,e);return a.kind!=="saved"||!Object.hasOwn(a.values,t)?"new":pe(a.values[t],s)?"published":"changed"}function Ke(n,e,t){if(!n)return;const s=v(n,e);if(s.kind==="saved")return s.values[t]}function Be(n,e,t){if(!e)return[];const s=v(e,t);if(s.kind!=="saved")return[];const a=v(n,t),r=a.kind==="conflict"?{}:a.values;return Object.keys(s.values).filter(o=>!Object.hasOwn(r,o))}function pe(n,e){return typeof n=="number"||typeof e=="number"?n===e:q(n.start,e.start)&&q(n.end,e.end)}function q(n,e){return n===void 0||e===void 0?n===e:n===e||new Date(n).getTime()===new Date(e).getTime()}function be({kind:n,name:e,pending:t,apply:s,reread:a,onDeleted:r,onUndo:o}){const l=S(),i=n==="experiments",[c,f]=U.useState(!1),u=async()=>{const m=await a();return m||E.info(l("sectionsEditor.namedRules.unavailable"),{...B,description:l("sectionsEditor.namedRules.unavailableHint")}),m},h=async m=>{const g=await u();if(!g)return;const x=ge(g,n,e,m);if(x){o(x);return}const w=v(g,n).kind==="conflict";E.info(l(w?"sectionsEditor.namedRules.changedMeanwhile":"sectionsEditor.namedRules.alreadyBack"),{...B,description:l(w?"sectionsEditor.namedRules.changedMeanwhileHint":"sectionsEditor.namedRules.alreadyBackHint")})},d=async()=>{f(!0);let m;try{m=await u()}finally{f(!1)}if(!m)return;const g=he(m,n,e);if(!g)return;const x=v(m,n),w=x.kind==="saved"?x.block[e]:void 0,k=await s(g);if(k.ok){if(k.keptTheirs){L(l,!1);return}r(),E.success(i?l("experiments.v8.deleted",{name:e}):l("sandbox.dateCampaigns.deleted",{name:e}),{id:de,description:l(i?"experiments.v8.deletedHint":"sandbox.dateCampaigns.deletedHint"),action:{label:l("sectionsEditor.namedRules.undo"),onClick:()=>{h(w)}}})}};return p.jsxs(ee,{type:"button",variant:"ghost",size:"sm",disabled:t||c,onClick:()=>{d()},children:[p.jsx(ce,{size:16}),l(i?"experiments.v8.delete":"sandbox.dateCampaigns.delete")]})}function ve(n,e){const t={...n};for(const[s,a]of Object.entries(e))a.kind!==null&&(a.before!==null?t[s]=a.before:a.baseVersion===null&&delete t[s]);return t}function xe(n){const e=N.c(7);let t;e[0]!==n.branch||e[1]!==n.orgSlug||e[2]!==n.virtualMcpId?(t={orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch},e[0]=n.branch,e[1]=n.orgSlug,e[2]=n.virtualMcpId,e[3]=t):t=e[3];const s=t,a=G(n.virtualMcpId,n.branch),r=J(s),o=Q(a,r||null),l=W(a,r||null,o.data);if(!n.decofile||!o.data)return null;if(Object.keys(o.data.changes).length===0)return n.decofile;let i;return e[4]!==n.decofile||e[5]!==l.data?(i=l.data?.entries?ve(n.decofile,l.data.entries):null,e[4]=n.decofile,e[5]=l.data,e[6]=i):i=e[6],i}function ye(n,e,t,s){if(!Object.hasOwn(e,s))return n;const a=t&&Object.hasOwn(t,s)?t[s]:null;if(!a)return"unknown";if(a.kind===null)return n;if(a.before!==null)return{...n,[s]:a.before};if(a.baseVersion!==null)return"unknown";const r={...n};return delete r[s],r}function we(n){const e=N.c(16);let t;e[0]!==n.branch||e[1]!==n.orgSlug||e[2]!==n.virtualMcpId?(t={orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch},e[0]=n.branch,e[1]=n.orgSlug,e[2]=n.virtualMcpId,e[3]=t):t=e[3];const s=t,a=G(n.virtualMcpId,n.branch),r=J(s),o=Q(a,r||null),l=W(a,r||null,o.data);if(!o.data){let d;return e[4]!==o?(d=o.isError?{state:"failed",retry:()=>{o.refetch()}}:{state:"loading"},e[4]=o,e[5]=d):d=e[5],d}if(!n.decofile){let d;return e[6]===Symbol.for("react.memo_cache_sentinel")?(d={state:"loading"},e[6]=d):d=e[6],d}if(Object.hasOwn(o.data.changes,n.blockKey)&&!l.data){let d;return e[7]!==l?(d=l.isError?{state:"failed",retry:()=>{l.refetch()}}:{state:"loading"},e[7]=l,e[8]=d):d=e[8],d}const c=l.data?.entries;let f;e[9]!==o.data.changes||e[10]!==n.blockKey||e[11]!==n.decofile||e[12]!==c?(f=ye(n.decofile,o.data.changes,c,n.blockKey),e[9]=o.data.changes,e[10]=n.blockKey,e[11]=n.decofile,e[12]=c,e[13]=f):f=e[13];const u=f;let h;return e[14]!==u?(h=u==="unknown"?{state:"unknown"}:{state:"ready",content:u},e[14]=u,e[15]=h):h=e[15],h}function _(n,e){return e==="experiments"?{new:n("experiments.v8.new"),stateNew:n("experiments.v8.state.new"),stateChanged:n("experiments.v8.state.changed"),removedTitle:n("experiments.v8.removedTitle"),removedHint:n("experiments.v8.removedHint"),created:t=>n("sectionsEditor.namedRulePicker.createdTest",{name:t})}:{new:n("sandbox.dateCampaigns.new"),stateNew:n("sandbox.dateCampaigns.state.new"),stateChanged:n("sandbox.dateCampaigns.state.changed"),removedTitle:n("sandbox.dateCampaigns.removedTitle"),removedHint:n("sandbox.dateCampaigns.removedHint"),created:t=>n("sectionsEditor.namedRulePicker.createdCampaign",{name:t})}}function Ne(n,e,t){const s=le(e,t);return s!=="available"?s:v(n,t).kind==="conflict"?"conflict":null}function He(n,e){const t=N.c(46),s=S(),{orgSlug:a,virtualMcpId:r,branch:o,decofile:l,meta:i}=e;let c;t[0]!==o||t[1]!==l||t[2]!==a||t[3]!==r?(c={orgSlug:a,virtualMcpId:r,branch:o,decofile:l},t[0]=o,t[1]=l,t[2]=a,t[3]=r,t[4]=c):c=t[4];const f=xe(c);let u;t[5]!==n?(u=H(n),t[5]=n,t[6]=u):u=t[6];let h;t[7]!==o||t[8]!==l||t[9]!==a||t[10]!==u.blockKey||t[11]!==r?(h={orgSlug:a,virtualMcpId:r,branch:o,decofile:l,blockKey:u.blockKey},t[7]=o,t[8]=l,t[9]=a,t[10]=u.blockKey,t[11]=r,t[12]=h):h=t[12];const d=we(h);let m;t[13]!==o||t[14]!==a||t[15]!==r?(m={orgSlug:a,virtualMcpId:r,branch:o},t[13]=o,t[14]=a,t[15]=r,t[16]=m):m=t[16];const{apply:g,reread:x,isPending:w,holdsCopy:k}=ue(m),[X,Y]=U.useState(null),P=e.open?e.open.name:X,C=e.open?e.open.set:Y,[$,A]=U.useState(!1);let T;t[17]!==g||t[18]!==s?(T=async(b,K)=>{const D=K===void 0?s("sectionsEditor.namedRules.saved"):K;if(!b)return!1;const R=await g(b);return R.ok&&R.keptTheirs?L(s,!1):R.ok&&E.success(D,{...B,description:s("sectionsEditor.namedRules.savedHint")}),R.ok},t[17]=g,t[18]=s,t[19]=T):T=t[19];const y=T;let M;t[20]!==l||t[21]!==n||t[22]!==y||t[23]!==C||t[24]!==s?(M=b=>{if(b.kind!==n||!b.create)return;const K=b.kind==="experiments"?b.create.share:b.create.window,D=me(l,n,b.name,K);if(!("change"in D)){E.info(D.problem==="conflict"?s("sectionsEditor.namedRules.changedMeanwhile"):re(s,D.problem),B);return}const R=b.name.trim();y(D.change,_(s,n).created(R)).then(Z=>{Z&&(A(!1),C(R))})},t[20]=l,t[21]=n,t[22]=y,t[23]=C,t[24]=s,t[25]=M):M=t[25];const V=M;let j;t[26]!==l||t[27]!==n||t[28]!==i?(j=Ne(l,i,n),t[26]=l,t[27]=n,t[28]=i,t[29]=j):j=t[29];let O;t[30]!==y?(O=b=>{y(b)},t[30]=y,t[31]=O):O=t[31];let I;return t[32]!==g||t[33]!==V||t[34]!==$||t[35]!==k||t[36]!==w||t[37]!==d||t[38]!==P||t[39]!==f||t[40]!==x||t[41]!==y||t[42]!==C||t[43]!==j||t[44]!==O?(I={published:f,live:d,apply:g,reread:x,isPending:w,holdsCopy:k,openName:P,setOpenName:C,creating:$,setCreating:A,blocked:j,save:y,create:V,undo:O},t[32]=g,t[33]=V,t[34]=$,t[35]=k,t[36]=w,t[37]=d,t[38]=P,t[39]=f,t[40]=x,t[41]=y,t[42]=C,t[43]=j,t[44]=O,t[45]=I):I=t[45],I}function _e(n){const e=N.c(23),{kind:t,open:s,onOpenChange:a,existingNames:r,pending:o,onCreate:l}=n,i=S();let c;e[0]!==t||e[1]!==i?(c=_(i,t),e[0]=t,e[1]=i,e[2]=c):c=e[2];let f;e[3]!==c.new?(f=p.jsx(te,{className:"sr-only",children:c.new}),e[3]=c.new,e[4]=f):f=e[4];let u;e[5]!==i?(u=i("sectionsEditor.namedRules.create"),e[5]=i,e[6]=u):u=e[6];let h;e[7]!==a?(h=()=>a(!1),e[7]=a,e[8]=h):h=e[8];let d;e[9]!==r||e[10]!==t||e[11]!==l||e[12]!==o||e[13]!==u||e[14]!==h?(d=p.jsx(ie,{kind:t,initialName:"",existingNames:r,pending:o,submitLabel:u,dismiss:"cancel",standalone:!0,onBack:h,onSubmit:l}),e[9]=r,e[10]=t,e[11]=l,e[12]=o,e[13]=u,e[14]=h,e[15]=d):d=e[15];let m;e[16]!==f||e[17]!==d?(m=p.jsxs(ne,{className:"p-0 sm:max-w-md",children:[f,d]}),e[16]=f,e[17]=d,e[18]=m):m=e[18];let g;return e[19]!==a||e[20]!==s||e[21]!==m?(g=p.jsx(se,{open:s,onOpenChange:a,children:m}),e[19]=a,e[20]=s,e[21]=m,e[22]=g):g=e[22],g}function Pe(n){const e=N.c(15),{kind:t,removed:s}=n,a=S();let r;e[0]!==t||e[1]!==a?(r=_(a,t),e[0]=t,e[1]=a,e[2]=r):r=e[2];const o=r;if(s.length===0)return null;let l;e[3]!==o.removedTitle?(l=p.jsx("h3",{className:"text-sm font-medium",children:o.removedTitle}),e[3]=o.removedTitle,e[4]=l):l=e[4];let i;e[5]!==o.removedHint?(i=p.jsx("p",{className:"text-xs text-muted-foreground",children:o.removedHint}),e[5]=o.removedHint,e[6]=i):i=e[6];let c;e[7]!==s?(c=s.map(Re),e[7]=s,e[8]=c):c=e[8];let f;e[9]!==c?(f=p.jsx("ul",{className:"text-sm text-muted-foreground",children:c}),e[9]=c,e[10]=f):f=e[10];let u;return e[11]!==l||e[12]!==i||e[13]!==f?(u=p.jsxs("div",{className:"flex flex-col gap-1",children:[l,i,f]}),e[11]=l,e[12]=i,e[13]=f,e[14]=u):u=e[14],u}function Re(n){return p.jsx("li",{className:"line-through",children:n},n)}function ke(n){const e=N.c(7),{kind:t,state:s,changed:a}=n,r=a===void 0?!0:a,o=S();let l;e[0]!==t||e[1]!==o?(l=_(o,t),e[0]=t,e[1]=o,e[2]=l):l=e[2];const i=l;if(s==="new"){let c;return e[3]!==i.stateNew?(c=p.jsx(z,{variant:"muted",children:i.stateNew}),e[3]=i.stateNew,e[4]=c):c=e[4],c}if(s==="changed"&&r){let c;return e[5]!==i.stateChanged?(c=p.jsx(z,{variant:"muted",children:i.stateChanged}),e[5]=i.stateChanged,e[6]=c):c=e[6],c}return null}function $e(n){const e=N.c(9),{kind:t,name:s,status:a,entryState:r}=n;let o;e[0]!==s?(o=p.jsx("h2",{className:"text-lg font-semibold",children:s}),e[0]=s,e[1]=o):o=e[1];let l;e[2]!==r||e[3]!==t?(l=p.jsx(ke,{kind:t,state:r,changed:!1}),e[2]=r,e[3]=t,e[4]=l):l=e[4];let i;return e[5]!==a||e[6]!==o||e[7]!==l?(i=p.jsxs("div",{className:"flex items-center gap-3",children:[o,a,l]}),e[5]=a,e[6]=o,e[7]=l,e[8]=i):i=e[8],i}function Ve(n){const e=N.c(8),{kind:t,detail:s}=n;let a;return e[0]!==s.apply||e[1]!==s.onDeleted||e[2]!==s.onUndo||e[3]!==s.pending||e[4]!==s.reread||e[5]!==s.row.name||e[6]!==t?(a=p.jsx(be,{kind:t,name:s.row.name,pending:s.pending,apply:s.apply,reread:s.reread,onDeleted:s.onDeleted,onUndo:s.onUndo}),e[0]=s.apply,e[1]=s.onDeleted,e[2]=s.onUndo,e[3]=s.pending,e[4]=s.reread,e[5]=s.row.name,e[6]=t,e[7]=a):a=e[7],a}function Ue(n,e,t){return{row:e,decofile:t.decofile,meta:t.meta,pending:n.isPending,holdsCopy:n.holdsCopy,onBack:()=>n.setOpenName(null),onSave:n.save,apply:n.apply,reread:n.reread,onDeleted:()=>n.setOpenName(null),onUndo:n.undo}}export{ke as N,Be as a,Ne as b,He as c,Ue as d,_e as e,$e as f,Pe as g,fe as h,Ve as i,Ie as n,Ke as p,we as u};
@@ -0,0 +1 @@
1
+ import{c as v,b as A,a4 as $,q as H,T as B,cG as z,t as S,j as t,B as T,r as M,D as q,v as U,w as Z,x as G,aS as Q,E as I,I as W,m as J}from"./index-CwntHk8S.js";import{i as X}from"./ArrowLeft-Ccyza8AK.js";import{s as Y}from"./Plus-C8Idvwpa.js";import{L as ee}from"./label-BFX3DXnu.js";import{u as te}from"./use-mcp-client-Cvc3WWPF.js";import{u as V}from"./use-navigate-to-agent-BFBISUMc.js";import{t as oe,R as re}from"./repository-picker-B967M4cj.js";import{o as se,a as K}from"./new-project-store-DoliA5Iq.js";import{c as ne}from"./repository-binding-Cqb4hBI0.js";function ie(d){const e=d.path.split("/"),i=e[e.length-1]??d.path;return{owner:e.slice(0,-1).join("/"),name:i,url:d.webUrl}}function ce(d,e,i){return{title:e.name,description:i.description,pinned:!1,icon:null,metadata:{repository:{owner:e.owner,name:e.name,url:e.url,repositoryId:d.id},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"site-editor"},chatDefaultOpen:!0}}},connections:[]}}function ae(d){const e=v.c(25),{open:i,onOpenChange:r,title:s,onImportComplete:o,mode:c}=d,a=c===void 0?"agent":c,n=A(),{org:l}=$(),u=H(),h=V();let f;e[0]!==l.id||e[1]!==l.slug?(f={connectionId:B,orgId:l.id,orgSlug:l.slug},e[0]=l.id,e[1]=l.slug,e[2]=f):f=e[2];const y=te(f);let x;e[3]!==a||e[4]!==n||e[5]!==s?(x=s??n(a==="link"?"common.repositoryPicker.addRepo":"common.repositoryPicker.importFromGitHub"),e[3]=a,e[4]=n,e[5]=s,e[6]=x):x=e[6];const j=x;let P;e[7]!==y||e[8]!==n?(P=async function(C,k){const{repository:w,createdFromTemplate:b}=C,O=b?n("common.createSite.agentDescription",{template:n(oe(b))}):n("common.repositoryPicker.agentDescription",{path:w.path}),D=await y.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:ce(w,k,{description:O})}}),E=(D.structuredContent??D).item?.id;if(!E)throw new Error(n("common.repositoryPicker.createAgentFailed"));return E},e[7]=y,e[8]=n,e[9]=P):P=e[9];const p=P;let _;e[10]!==p||e[11]!==a||e[12]!==h||e[13]!==o||e[14]!==r||e[15]!==l.id||e[16]!==u||e[17]!==n?(_=async function(C){const{repository:k}=C,w=ie(k),b=a==="agent"?await p(C,w):null;z(u,l.id),r(!1),o?o({virtualMcpId:b,repository:k}):b?(S.success(C.createdFromTemplate?n("common.createSite.created",{name:w.name}):n("common.repositoryPicker.importedRepo",{name:w.name})),h(b)):S.success(n("common.repositoryPicker.addedRepo",{name:w.name}))},e[10]=p,e[11]=a,e[12]=h,e[13]=o,e[14]=r,e[15]=l.id,e[16]=u,e[17]=n,e[18]=_):_=e[18];const g=_,R=a==="agent";let N;return e[19]!==g||e[20]!==r||e[21]!==i||e[22]!==j||e[23]!==R?(N=t.jsx(re,{open:i,onOpenChange:r,title:j,onPicked:g,onError:le,allowCreateSite:R}),e[19]=g,e[20]=r,e[21]=i,e[22]=j,e[23]=R,e[24]=N):N=e[24],N}function le(d){return S.error(d)}const L={viewBox:"0 0 96 64",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0},m={stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"};function pe(d){const e=v.c(9),{className:i}=d;let r,s,o,c,a,n,l;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("path",{d:"M22 46V22",...m,opacity:.7}),s=t.jsx("circle",{cx:"22",cy:"18",r:"4",...m,opacity:.8}),o=t.jsx("circle",{cx:"22",cy:"50",r:"4",...m,opacity:.8}),c=t.jsx("path",{d:"M22 32h14a6 6 0 0 1 6 6v4",...m,opacity:.6}),a=t.jsx("circle",{cx:"42",cy:"46",r:"4",...m,opacity:.7}),n=t.jsx("path",{d:"M56 22h9l3 4h14a3 3 0 0 1 3 3v20a3 3 0 0 1-3 3H56a3 3 0 0 1-3-3V25a3 3 0 0 1 3-3Z",...m,opacity:.75}),l=t.jsx("path",{d:"M53 34h32",...m,opacity:.5}),e[0]=r,e[1]=s,e[2]=o,e[3]=c,e[4]=a,e[5]=n,e[6]=l):(r=e[0],s=e[1],o=e[2],c=e[3],a=e[4],n=e[5],l=e[6]);let u;return e[7]!==i?(u=t.jsxs("svg",{...L,className:i,children:[r,s,o,c,a,n,l]}),e[7]=i,e[8]=u):u=e[8],u}function de(d){const e=v.c(4),{className:i}=d;let r,s;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("path",{d:"M16 22a4 4 0 0 1 4-4h14l6 6h20a4 4 0 0 1 4 4v20a4 4 0 0 1-4 4H20a4 4 0 0 1-4-4V22Z",...m,opacity:.8}),s=t.jsx("path",{d:"M16 28h64",...m,opacity:.5}),e[0]=r,e[1]=s):(r=e[0],s=e[1]);let o;return e[2]!==i?(o=t.jsxs("svg",{...L,className:i,children:[r,s]}),e[2]=i,e[3]=o):o=e[3],o}function Ne(d){const e=v.c(5),{className:i}=d;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsxs("g",{opacity:.55,children:[t.jsx("rect",{x:"46",y:"16",width:"128",height:"88",rx:"8",...m}),t.jsx("path",{d:"M46 34h128",...m,opacity:.6}),t.jsx("circle",{cx:"56",cy:"25",r:"2",fill:"currentColor",opacity:.6}),t.jsx("circle",{cx:"64",cy:"25",r:"2",fill:"currentColor",opacity:.45}),t.jsx("circle",{cx:"72",cy:"25",r:"2",fill:"currentColor",opacity:.3}),t.jsx("rect",{x:"58",y:"44",width:"104",height:"24",rx:"4",...m,opacity:.5}),t.jsx("rect",{x:"58",y:"76",width:"30",height:"16",rx:"3",...m,opacity:.4}),t.jsx("rect",{x:"95",y:"76",width:"30",height:"16",rx:"3",...m,opacity:.3}),t.jsx("rect",{x:"132",y:"76",width:"30",height:"16",rx:"3",...m,opacity:.22})]}),e[0]=r):r=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsxs("g",{transform:"rotate(-8 44 92)",children:[t.jsx("rect",{x:"22",y:"52",width:"44",height:"76",rx:"8",...m,fill:"var(--color-background)"}),t.jsx("path",{d:"M37 60h14",...m,opacity:.5}),t.jsx("rect",{x:"29",y:"68",width:"30",height:"20",rx:"3",...m,opacity:.45}),t.jsx("path",{d:"M29 96h30M29 104h20",...m,opacity:.35}),t.jsx("rect",{x:"29",y:"112",width:"30",height:"8",rx:"4",...m,opacity:.5})]}),e[1]=s):s=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsxs("g",{transform:"rotate(10 168 104)",children:[t.jsx("path",{d:"M150 92h30a6 6 0 0 1 6 6v26a6 6 0 0 1-6 6h-30a6 6 0 0 1-6-6V98a6 6 0 0 1 6-6Z",...m,fill:"var(--color-background)"}),t.jsx("circle",{cx:"165",cy:"104",r:"3.5",...m}),t.jsx("path",{d:"M152 116h26M152 124h16",...m,opacity:.45})]}),e[2]=o):o=e[2];let c;return e[3]!==i?(c=t.jsxs("svg",{viewBox:"0 0 220 140",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,className:i,children:[r,s,o]}),e[3]=i,e[4]=c):c=e[4],c}const ue={repository:{titleKey:"projects.new.path.repository",hintKey:"projects.new.path.repository.hint",art:pe,plate:"bg-chart-5/10 group-hover:bg-chart-5/16",art_:"text-chart-5"},folder:{titleKey:"projects.new.path.folder",hintKey:"projects.new.path.folder.hint",art:de,plate:"bg-chart-1/10 group-hover:bg-chart-1/16",art_:"text-chart-1"}},me=["repository","folder"];function he(d){const e=v.c(25),{path:i,onSelect:r}=d,s=A(),o=ue[i],c=o.art;let a;e[0]!==o.art_||e[1]!==o.plate?(a=J("flex h-28 items-center justify-center rounded-lg transition-colors",o.plate,o.art_),e[0]=o.art_,e[1]=o.plate,e[2]=a):a=e[2];let n;e[3]!==c?(n=t.jsx(c,{className:"h-20"}),e[3]=c,e[4]=n):n=e[4];let l;e[5]!==a||e[6]!==n?(l=t.jsx("span",{className:a,children:n}),e[5]=a,e[6]=n,e[7]=l):l=e[7];let u;e[8]!==o.titleKey||e[9]!==s?(u=s(o.titleKey),e[8]=o.titleKey,e[9]=s,e[10]=u):u=e[10];let h;e[11]!==u?(h=t.jsx("span",{className:"text-sm font-medium text-foreground",children:u}),e[11]=u,e[12]=h):h=e[12];let f;e[13]!==o.hintKey||e[14]!==s?(f=s(o.hintKey),e[13]=o.hintKey,e[14]=s,e[15]=f):f=e[15];let y;e[16]!==f?(y=t.jsx("span",{className:"text-xs text-muted-foreground",children:f}),e[16]=f,e[17]=y):y=e[17];let x;e[18]!==h||e[19]!==y?(x=t.jsxs("span",{className:"flex flex-col gap-0.5 px-1 pb-1",children:[h,y]}),e[18]=h,e[19]=y,e[20]=x):x=e[20];let j;return e[21]!==r||e[22]!==l||e[23]!==x?(j=t.jsxs("button",{type:"button",onClick:r,className:"group flex flex-col gap-3 surface p-3 text-left focus-ring transition-[transform,background-color] duration-200 hover:-translate-y-0.5 hover:bg-accent motion-reduce:transition-none motion-reduce:hover:translate-y-0",children:[l,x]}),e[21]=r,e[22]=l,e[23]=x,e[24]=j):j=e[24],j}function fe(d){const e=v.c(8),{label:i,children:r,hint:s}=d;let o;e[0]!==i?(o=t.jsx(ee,{children:i}),e[0]=i,e[1]=o):o=e[1];let c;e[2]!==s?(c=s&&t.jsx("p",{className:"text-xs text-muted-foreground",children:s}),e[2]=s,e[3]=c):c=e[3];let a;return e[4]!==r||e[5]!==o||e[6]!==c?(a=t.jsxs("div",{className:"flex flex-col gap-1.5",children:[o,r,c]}),e[4]=r,e[5]=o,e[6]=c,e[7]=a):a=e[7],a}function ke({open:d,onOpenChange:e,source:i="org_home"}){const r=A(),s=ne(),o=V(),[c,a]=M.useState(null),[n,l]=M.useState(""),[u,h]=M.useState(null),f=M.useRef(null),y=()=>{a(null),l(""),h(null)},x=()=>{e(!1),y()};if(c==="repository")return t.jsx(ae,{open:!0,onOpenChange:p=>{p||x()},onImportComplete:({virtualMcpId:p})=>{p&&(K(p),o(p)),x()}});const j=async()=>{if(s.create.isPending)return;const p=n.trim();if(!p){h(r("projects.new.nameRequired"));return}try{const g=(await s.create.mutateAsync({title:p,description:null,status:"active",pinned:!1,connections:[],metadata:{instructions:null,project:{storeUrl:null},ui:{pinnedViews:null,layout:{defaultMainView:{type:"overview"},chatDefaultOpen:!0}}}}))?.id;I("project_created",{source:i,path:c}),x(),g&&(K(g),o(g)),S.success(r("projects.new.created",{title:p}))}catch{h(r("projects.new.failed"))}};return t.jsx(q,{open:d,onOpenChange:p=>{p?e(!0):x()},children:t.jsxs(U,{className:"sm:max-w-3xl",ref:f,onOpenAutoFocus:p=>{p.preventDefault(),f.current?.focus()},children:[t.jsxs(Z,{children:[t.jsx(G,{children:r("projects.new.title")}),t.jsx(Q,{children:r(c?"projects.new.step.folder.title":"projects.new.subtitle")})]}),c===null?t.jsx("div",{className:"grid grid-cols-1 gap-3 animate-in fade-in-0 duration-200 sm:grid-cols-2 motion-reduce:animate-none",children:me.map(p=>t.jsx(he,{path:p,onSelect:()=>{I("project_create_path_selected",{source:i,path:p}),a(p)}},p))}):t.jsxs("form",{className:"flex flex-col gap-4 animate-in fade-in-0 slide-in-from-right-2 duration-200 motion-reduce:animate-none",onSubmit:p=>{p.preventDefault(),h(null),j()},children:[t.jsx(fe,{label:r("projects.new.nameLabel"),children:t.jsx(W,{autoFocus:!0,value:n,onChange:p=>l(p.target.value),placeholder:r("projects.new.namePlaceholder")})}),u&&t.jsx("p",{className:"text-sm text-destructive",children:u}),t.jsxs("div",{className:"flex items-center justify-between gap-2 pt-1",children:[t.jsxs(T,{type:"button",variant:"ghost",onClick:()=>y(),children:[t.jsx(X,{size:14}),r("projects.new.back")]}),t.jsx(T,{type:"submit",disabled:s.create.isPending,children:s.create.isPending?r("projects.new.creating"):r("projects.new.create")})]})]})]})})}function Me(d){const e=v.c(11),{source:i,variant:r,size:s,label:o}=d,c=r===void 0?"default":r,a=s===void 0?"sm":s,n=A();let l;e[0]!==i?(l=()=>se(i),e[0]=i,e[1]=l):l=e[1];let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Y,{size:14}),e[2]=u):u=e[2];let h;e[3]!==o||e[4]!==n?(h=o??n("projects.home.newProject"),e[3]=o,e[4]=n,e[5]=h):h=e[5];let f;return e[6]!==a||e[7]!==l||e[8]!==h||e[9]!==c?(f=t.jsxs(T,{size:a,variant:c,onClick:l,children:[u,h]}),e[6]=a,e[7]=l,e[8]=h,e[9]=c,e[10]=f):f=e[10],f}export{Ne as E,Me as N,ae as R,ke as a};
@@ -0,0 +1 @@
1
+ import{c as a,r as s,E as l}from"./index-CwntHk8S.js";import{S as u}from"./thread-intent-DpzwhK2y.js";const n=new u(!1);let c="unknown",r=null;function f(e,t){c=e,r=t?.onCreated??null,l("project_create_clicked",{source:e}),n.set(!0)}function m(){const e=a.c(2),t=s.useSyncExternalStore(n.subscribe,n.get);let o;return e[0]!==t?(o=[t,n.set],e[0]=t,e[1]=o):o=e[1],o}function d(e){const t=r;r=null,t?.(e)}function w(){return c}export{d as a,w as n,f as o,m as u};
@@ -1 +1 @@
1
- import{b as o,r as c,j as e,h as n}from"./index-BP527m3V.js";import{h as u}from"./mcp-oauth-1Tp9szFm.js";import"./auth-Br21RAsk.js";function f(){const t=o(),[a,l]=c.useState(null),[r,i]=c.useState(!1);return c.useEffect(()=>{(async()=>{try{const s=await u();if(!s.success){l(s.error||t("routes.oauthCallback.authenticationFailed")),setTimeout(()=>{window.close()},3e3);return}i(!0),setTimeout(()=>{window.close()},1500)}catch(s){l(s instanceof Error?s.message:String(s)),setTimeout(()=>{window.close()},3e3)}})()},[]),e.jsx("div",{className:"min-h-screen flex items-center justify-center p-8 bg-background",children:e.jsxs("div",{className:"w-full max-w-md flex flex-col items-center justify-center gap-8",children:[r&&e.jsx("img",{src:"/empty-state-success.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),!r&&!a&&e.jsx("div",{className:"flex items-center justify-center py-4",children:e.jsx(n,{className:"size-8 text-primary"})}),a&&e.jsx("img",{src:"/empty-state-error.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),e.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[e.jsx("h2",{className:"text-lg font-medium text-foreground",children:t(a?"routes.oauthCallback.authenticationFailedTitle":r?"routes.oauthCallback.authenticationSuccessfulTitle":"routes.oauthCallback.authenticationInProgressTitle")}),e.jsx("div",{className:"text-sm text-muted-foreground",children:a?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mb-2",children:t("routes.oauthCallback.errorOccurred")}),e.jsx("p",{className:"text-destructive",children:a}),e.jsxs("p",{className:"mt-2",children:[e.jsx("br",{}),t("routes.oauthCallback.windowClosingAutomatically")]})]}):r?e.jsxs("p",{children:[t("routes.oauthCallback.authenticationComplete"),e.jsx("br",{}),t("routes.oauthCallback.windowClosingAutomatically")]}):e.jsx("p",{children:t("routes.oauthCallback.processingAuthentication")})})]})]})})}export{f as default};
1
+ import{b as o,r as c,j as e,h as n}from"./index-CwntHk8S.js";import{h as u}from"./mcp-oauth-DFWIYz5V.js";import"./auth-gL3R1YGn.js";function f(){const t=o(),[a,l]=c.useState(null),[r,i]=c.useState(!1);return c.useEffect(()=>{(async()=>{try{const s=await u();if(!s.success){l(s.error||t("routes.oauthCallback.authenticationFailed")),setTimeout(()=>{window.close()},3e3);return}i(!0),setTimeout(()=>{window.close()},1500)}catch(s){l(s instanceof Error?s.message:String(s)),setTimeout(()=>{window.close()},3e3)}})()},[]),e.jsx("div",{className:"min-h-screen flex items-center justify-center p-8 bg-background",children:e.jsxs("div",{className:"w-full max-w-md flex flex-col items-center justify-center gap-8",children:[r&&e.jsx("img",{src:"/empty-state-success.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),!r&&!a&&e.jsx("div",{className:"flex items-center justify-center py-4",children:e.jsx(n,{className:"size-8 text-primary"})}),a&&e.jsx("img",{src:"/empty-state-error.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),e.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[e.jsx("h2",{className:"text-lg font-medium text-foreground",children:t(a?"routes.oauthCallback.authenticationFailedTitle":r?"routes.oauthCallback.authenticationSuccessfulTitle":"routes.oauthCallback.authenticationInProgressTitle")}),e.jsx("div",{className:"text-sm text-muted-foreground",children:a?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mb-2",children:t("routes.oauthCallback.errorOccurred")}),e.jsx("p",{className:"text-destructive",children:a}),e.jsxs("p",{className:"mt-2",children:[e.jsx("br",{}),t("routes.oauthCallback.windowClosingAutomatically")]})]}):r?e.jsxs("p",{children:[t("routes.oauthCallback.authenticationComplete"),e.jsx("br",{}),t("routes.oauthCallback.windowClosingAutomatically")]}):e.jsx("p",{children:t("routes.oauthCallback.processingAuthentication")})})]})]})})}export{f as default};
@@ -1 +1 @@
1
- import{b as d,r as a,j as e,h}from"./index-BP527m3V.js";function x(){const r=d(),[s,o]=a.useState("loading"),[l,u]=a.useState(null),c=a.useRef(!1);return c.current||(c.current=!0,queueMicrotask(()=>{try{const t=new URLSearchParams(window.location.search),i=t.get("code"),n=t.get("state");if(!i||!n)throw new Error("Missing code or state parameter");if(window.opener)window.opener.postMessage({type:"AI_PROVIDER_OAUTH_CALLBACK",code:i,stateToken:n},window.location.origin),o("success"),setTimeout(()=>window.close(),1500);else throw new Error("No opener window found")}catch(t){console.error("OAuth callback error:",t),u(t instanceof Error?t.message:String(t)),o("error"),setTimeout(()=>window.close(),3e3)}})),e.jsx("div",{className:"min-h-screen flex items-center justify-center p-8 bg-background",children:e.jsxs("div",{className:"w-full max-w-md flex flex-col items-center justify-center gap-8",children:[s==="success"&&e.jsx("img",{src:"/empty-state-success.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),s==="loading"&&e.jsx("div",{className:"flex items-center justify-center py-4",children:e.jsx(h,{className:"size-8 text-primary"})}),s==="error"&&e.jsx("img",{src:"/empty-state-error.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),e.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[e.jsx("h2",{className:"text-lg font-medium text-foreground",children:r(s==="error"?"routes.oauthCallbackAiProvider.authFailed":s==="success"?"routes.oauthCallbackAiProvider.authSuccess":"routes.oauthCallbackAiProvider.authInProgress")}),e.jsx("div",{className:"text-sm text-muted-foreground",children:s==="error"?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mb-2",children:r("routes.oauthCallbackAiProvider.errorOccurred")}),e.jsx("p",{className:"text-destructive",children:l}),e.jsx("p",{className:"mt-2",children:r("routes.oauthCallbackAiProvider.windowCloseAuto")})]}):s==="success"?e.jsx("p",{children:r("routes.oauthCallbackAiProvider.authCompleteCloseAuto")}):e.jsx("p",{children:r("routes.oauthCallbackAiProvider.processingAuth")})})]})]})})}export{x as default};
1
+ import{b as d,r as a,j as e,h}from"./index-CwntHk8S.js";function x(){const r=d(),[s,o]=a.useState("loading"),[l,u]=a.useState(null),c=a.useRef(!1);return c.current||(c.current=!0,queueMicrotask(()=>{try{const t=new URLSearchParams(window.location.search),i=t.get("code"),n=t.get("state");if(!i||!n)throw new Error("Missing code or state parameter");if(window.opener)window.opener.postMessage({type:"AI_PROVIDER_OAUTH_CALLBACK",code:i,stateToken:n},window.location.origin),o("success"),setTimeout(()=>window.close(),1500);else throw new Error("No opener window found")}catch(t){console.error("OAuth callback error:",t),u(t instanceof Error?t.message:String(t)),o("error"),setTimeout(()=>window.close(),3e3)}})),e.jsx("div",{className:"min-h-screen flex items-center justify-center p-8 bg-background",children:e.jsxs("div",{className:"w-full max-w-md flex flex-col items-center justify-center gap-8",children:[s==="success"&&e.jsx("img",{src:"/empty-state-success.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),s==="loading"&&e.jsx("div",{className:"flex items-center justify-center py-4",children:e.jsx(h,{className:"size-8 text-primary"})}),s==="error"&&e.jsx("img",{src:"/empty-state-error.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),e.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[e.jsx("h2",{className:"text-lg font-medium text-foreground",children:r(s==="error"?"routes.oauthCallbackAiProvider.authFailed":s==="success"?"routes.oauthCallbackAiProvider.authSuccess":"routes.oauthCallbackAiProvider.authInProgress")}),e.jsx("div",{className:"text-sm text-muted-foreground",children:s==="error"?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mb-2",children:r("routes.oauthCallbackAiProvider.errorOccurred")}),e.jsx("p",{className:"text-destructive",children:l}),e.jsx("p",{className:"mt-2",children:r("routes.oauthCallbackAiProvider.windowCloseAuto")})]}):s==="success"?e.jsx("p",{children:r("routes.oauthCallbackAiProvider.authCompleteCloseAuto")}):e.jsx("p",{children:r("routes.oauthCallbackAiProvider.processingAuth")})})]})]})})}export{x as default};
@@ -1 +1 @@
1
- import{c as p,b as g,K as j,e as w,j as t,B as h,i as y}from"./index-BP527m3V.js";import{A as N}from"./auth-split-layout-DXcvh-93.js";import{A as _}from"./auth-entry-BUy5eNSm.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";const f="/api/auth/custom/mcp-consent";function C(){const e=new URLSearchParams(window.location.search);return e.delete("prompt"),e}async function S(e){const n=new URLSearchParams({client_id:e.get("client_id")??"",redirect_uri:e.get("redirect_uri")??"",scope:e.get("scope")??""}),s=await fetch(`${f}?${n}`,{credentials:"include"});if(!s.ok)throw new Error(`consent request failed (${s.status})`);return await s.json()}function R(){const e=p.c(11),n=g();let s,i,c;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=C(),i=y,c={queryKey:j.mcpOAuthConsent(s.toString()),queryFn:()=>S(s),retry:!1},e[0]=s,e[1]=i,e[2]=c):(s=e[0],i=e[1],c=e[2]);const o=i(c);let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l={mutationFn:async()=>{const a=await fetch(f,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:s.get("client_id"),scope:s.get("scope")??void 0})});if(!a.ok)throw new Error(`consent failed (${a.status})`)},onSuccess:()=>{window.location.href=`/api/auth/mcp/authorize?${s}`}},e[3]=l):l=e[3];const r=w(l);let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=()=>{const a=new URL(s.get("redirect_uri")??"/");a.searchParams.set("error","access_denied");const m=s.get("state");m&&a.searchParams.set("state",m),window.location.href=a.toString()},e[4]=d):d=e[4];const x=d;if(o.isPending){let a;return e[5]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(_,{}),e[5]=a):a=e[5],a}let u;return e[6]!==r||e[7]!==o.data||e[8]!==o.isError||e[9]!==n?(u=t.jsx(N,{children:t.jsx("div",{className:"flex w-full max-w-sm flex-col gap-5",children:o.isError||r.isError||!o.data?t.jsx("p",{className:"text-sm text-muted-foreground",children:n("routes.oauthConsent.unavailable")}):t.jsxs(t.Fragment,{children:[t.jsx("h1",{className:"text-xl font-semibold",children:n("routes.oauthConsent.title")}),t.jsx("p",{className:"text-sm text-muted-foreground",children:n("routes.oauthConsent.description",{client:o.data.clientName||n("routes.oauthConsent.unknownClient")})}),t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:n("routes.oauthConsent.redirectLabel")}),t.jsx("code",{className:"break-all text-sm font-medium",children:o.data.redirectTarget})]}),t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:n("routes.oauthConsent.scopesLabel")}),t.jsx("span",{className:"text-sm",children:o.data.scopes.join(", ")})]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(h,{variant:"outline",className:"flex-1",onClick:x,disabled:r.isPending,children:n("routes.oauthConsent.deny")}),t.jsx(h,{className:"flex-1",onClick:()=>r.mutate(),disabled:r.isPending,children:n("routes.oauthConsent.allow")})]})]})})}),e[6]=r,e[7]=o.data,e[8]=o.isError,e[9]=n,e[10]=u):u=e[10],u}export{R as default};
1
+ import{c as p,b as g,K as j,e as w,j as t,B as h,i as y}from"./index-CwntHk8S.js";import{A as N}from"./auth-split-layout-ckQyQHcL.js";import{A as _}from"./auth-entry-BHlmJEBv.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";const f="/api/auth/custom/mcp-consent";function C(){const e=new URLSearchParams(window.location.search);return e.delete("prompt"),e}async function S(e){const n=new URLSearchParams({client_id:e.get("client_id")??"",redirect_uri:e.get("redirect_uri")??"",scope:e.get("scope")??""}),s=await fetch(`${f}?${n}`,{credentials:"include"});if(!s.ok)throw new Error(`consent request failed (${s.status})`);return await s.json()}function R(){const e=p.c(11),n=g();let s,i,c;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=C(),i=y,c={queryKey:j.mcpOAuthConsent(s.toString()),queryFn:()=>S(s),retry:!1},e[0]=s,e[1]=i,e[2]=c):(s=e[0],i=e[1],c=e[2]);const o=i(c);let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l={mutationFn:async()=>{const a=await fetch(f,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:s.get("client_id"),scope:s.get("scope")??void 0})});if(!a.ok)throw new Error(`consent failed (${a.status})`)},onSuccess:()=>{window.location.href=`/api/auth/mcp/authorize?${s}`}},e[3]=l):l=e[3];const r=w(l);let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=()=>{const a=new URL(s.get("redirect_uri")??"/");a.searchParams.set("error","access_denied");const m=s.get("state");m&&a.searchParams.set("state",m),window.location.href=a.toString()},e[4]=d):d=e[4];const x=d;if(o.isPending){let a;return e[5]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(_,{}),e[5]=a):a=e[5],a}let u;return e[6]!==r||e[7]!==o.data||e[8]!==o.isError||e[9]!==n?(u=t.jsx(N,{children:t.jsx("div",{className:"flex w-full max-w-sm flex-col gap-5",children:o.isError||r.isError||!o.data?t.jsx("p",{className:"text-sm text-muted-foreground",children:n("routes.oauthConsent.unavailable")}):t.jsxs(t.Fragment,{children:[t.jsx("h1",{className:"text-xl font-semibold",children:n("routes.oauthConsent.title")}),t.jsx("p",{className:"text-sm text-muted-foreground",children:n("routes.oauthConsent.description",{client:o.data.clientName||n("routes.oauthConsent.unknownClient")})}),t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:n("routes.oauthConsent.redirectLabel")}),t.jsx("code",{className:"break-all text-sm font-medium",children:o.data.redirectTarget})]}),t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:n("routes.oauthConsent.scopesLabel")}),t.jsx("span",{className:"text-sm",children:o.data.scopes.join(", ")})]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(h,{variant:"outline",className:"flex-1",onClick:x,disabled:r.isPending,children:n("routes.oauthConsent.deny")}),t.jsx(h,{className:"flex-1",onClick:()=>r.mutate(),disabled:r.isPending,children:n("routes.oauthConsent.allow")})]})]})})}),e[6]=r,e[7]=o.data,e[8]=o.isError,e[9]=n,e[10]=u):u=e[10],u}export{R as default};
@@ -1 +1 @@
1
- import{c as ie,j as t,a as ye,h as ce,b as de,i as Ce,K as Oe,r as P,B as Ne,e as pe,o as ve,C as ze,I as Le,m as ae,t as he}from"./index-BP527m3V.js";import{R as _e}from"./required-auth-layout-DoMwdVaZ.js";import{A as oe}from"./auth-split-layout-DXcvh-93.js";import{O as Ee}from"./organization-choice-dV-mJr-d.js";import{L as Ae}from"./label-DSlWCd9e.js";import{S as De}from"./switch-B60LgmjA.js";import{t as Pe,a as Re}from"./Globe04-BZJYx7x5.js";import{i as Fe}from"./CheckCircle-CM--cqi0.js";import{i as Me}from"./Upload01-DDoiK0tv.js";import"./Plus-DEeR8qC2.js";const $e=new Set(["gmail.com","googlemail.com","outlook.com","hotmail.com","live.com","yahoo.com","yahoo.co.uk","icloud.com","me.com","mac.com","aol.com","protonmail.com","proton.me","zoho.com","yandex.com","mail.com","gmx.com","gmx.net","tutanota.com","fastmail.com"]);function xe(i){return i.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function ot(){const i=ie.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(_e,{children:t.jsx(Te,{})}),i[0]=e):e=i[0],e}function fe(i){const e=ie.c(13),{title:b,description:m,logoUrl:n,logoFallback:o}=i;let a;e[0]!==o||e[1]!==n?(a=t.jsx("div",{children:n?t.jsx(ve,{url:n,fallback:o??"?",shape:"square",size:"base",className:"h-12 w-12"}):t.jsxs(t.Fragment,{children:[t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]})}),e[0]=o,e[1]=n,e[2]=a):a=e[2];let f;e[3]!==b?(f=t.jsx("h1",{className:"text-2xl font-medium leading-8",children:b}),e[3]=b,e[4]=f):f=e[4];let l;e[5]!==m?(l=t.jsx("p",{className:"text-base text-muted-foreground leading-6",children:m}),e[5]=m,e[6]=l):l=e[6];let s;e[7]!==f||e[8]!==l?(s=t.jsxs("div",{className:"space-y-2",children:[f,l]}),e[7]=f,e[8]=l,e[9]=s):s=e[9];let j;return e[10]!==a||e[11]!==s?(j=t.jsxs("div",{className:"grid gap-10",children:[a,s]}),e[10]=a,e[11]=s,e[12]=j):j=e[12],j}function Te(){const i=ie.c(4),{data:e,isPending:b}=ye.useSession();if(b){let a;return i[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(oe,{children:t.jsx("div",{className:"flex items-center gap-2",children:t.jsx(ce,{className:"size-3.5 text-muted-foreground"})})}),i[0]=a):a=i[0],a}const m=e?.user?.email??"",n=e?.user?.name;let o;return i[1]!==n||i[2]!==m?(o=t.jsx(qe,{email:m,userName:n}),i[1]=n,i[2]=m,i[3]=o):o=i[3],o}function qe(i){const e=ie.c(59),{email:b,userName:m}=i,n=de(),o=b.split("@")[1]?.toLowerCase()??"",a=!!o&&!$e.has(o),f=o.split(".")[0]??"",l=f.charAt(0).toUpperCase()+f.slice(1);let s;e[0]!==l||e[1]!==a||e[2]!==m?(s=a?l:m?.split(" ")[0]??"",e[0]=l,e[1]=a,e[2]=m,e[3]=s):s=e[3];const j=s,{data:c,isLoading:v,isError:u,refetch:w}=Ce({queryKey:Oe.domainLookup(o),queryFn:Be,enabled:a});let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=new Set,e[4]=g):g=e[4];const[_,M]=P.useState(g),[$,y]=P.useState(!1);if(v){let r;return e[5]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(ce,{className:"size-3.5 text-muted-foreground"}),e[5]=r):r=e[5],t.jsx(oe,{children:t.jsxs("div",{className:"flex items-center gap-2 py-4",children:[r,t.jsx("span",{className:"text-sm text-muted-foreground",children:n("routes.onboarding.checking",{domain:o})})]})})}if(u){let r;e[6]!==w?(r=()=>w(),e[6]=w,e[7]=r):r=e[7];let d;e[8]!==n?(d=n("routes.onboarding.retry"),e[8]=n,e[9]=d):d=e[9];let h;return e[10]!==r||e[11]!==d?(h=t.jsx(Ne,{variant:"outline",size:"sm",onClick:r,children:d}),e[10]=r,e[11]=d,e[12]=h):h=e[12],t.jsx(oe,{children:t.jsxs("div",{className:"flex flex-col items-start gap-3 py-4",children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:n("routes.onboarding.checkFailed",{domain:o})}),h]})})}let N,A;e[13]!==c?.organizations?(N=(c?.organizations??[]).flatMap(Ke),A=N.some(Ie),e[13]=c?.organizations,e[14]=N,e[15]=A):(N=e[14],A=e[15]);const p=A;if($){let r;e[16]!==m?(r=m?.split(" ")[0]??"",e[16]=m,e[17]=r):r=e[17];let d;e[18]!==y?(d=()=>y(!1),e[18]=y,e[19]=d):d=e[19];let h;return e[20]!==l||e[21]!==o||e[22]!==a||e[23]!==r||e[24]!==d?(h=t.jsx(be,{isCorporateEmail:a,emailDomain:o,domainLabel:l,defaultName:r,allowDomainClaim:!1,onBack:d}),e[20]=l,e[21]=o,e[22]=a,e[23]=r,e[24]=d,e[25]=h):h=e[25],h}if(N.length>0){let r;e[26]!==p||e[27]!==N.length||e[28]!==n?(r=p?N.length===1?n("routes.onboarding.accessSingle"):n("routes.onboarding.accessMultiple"):n("routes.onboarding.requestAccess"),e[26]=p,e[27]=N.length,e[28]=n,e[29]=r):r=e[29];let d;e[30]!==p||e[31]!==n?(d=n(p?"routes.onboarding.emailMatchesOrg":"routes.onboarding.emailMatchesOrgApproval"),e[30]=p,e[31]=n,e[32]=d):d=e[32];let h;e[33]!==r||e[34]!==d?(h=t.jsx(fe,{title:r,description:d}),e[33]=r,e[34]=d,e[35]=h):h=e[35];let O;e[36]!==M?(O=R=>M(F=>new Set(F).add(R)),e[36]=M,e[37]=O):O=e[37];let C;e[38]!==N||e[39]!==o||e[40]!==_||e[41]!==O?(C=t.jsx(Ee,{organizations:N,domain:o,requestedSlugs:_,onRequestedSlug:O,onJoined:Ue}),e[38]=N,e[39]=o,e[40]=_,e[41]=O,e[42]=C):C=e[42];let z;e[43]!==y?(z=()=>y(!0),e[43]=y,e[44]=z):z=e[44];let E;e[45]!==n?(E=n("routes.onboarding.createNewOrg"),e[45]=n,e[46]=E):E=e[46];let k;e[47]!==E||e[48]!==z?(k=t.jsx("button",{type:"button",className:"text-sm text-muted-foreground hover:text-foreground transition-colors text-center",onClick:z,children:E}),e[47]=E,e[48]=z,e[49]=k):k=e[49];let L;return e[50]!==k||e[51]!==h||e[52]!==C?(L=t.jsx(oe,{children:t.jsxs("div",{className:"grid gap-10",children:[h,C,k]})}),e[50]=k,e[51]=h,e[52]=C,e[53]=L):L=e[53],L}let D;return e[54]!==j||e[55]!==l||e[56]!==o||e[57]!==a?(D=t.jsx(be,{isCorporateEmail:a,emailDomain:o,domainLabel:l,defaultName:j}),e[54]=j,e[55]=l,e[56]=o,e[57]=a,e[58]=D):D=e[58],D}function Ue(i,e){window.location.href=`/${e}`}function Ie(i){return i.joinMode==="auto"}function Ke(i){return i.joinMode==="auto"||i.joinMode==="request"?[{id:i.id,name:i.name,slug:i.slug,logo:i.logo,joinMode:i.joinMode}]:[]}async function Be(){const i=await fetch("/api/auth/custom/domain-lookup",{credentials:"include"});if(!i.ok)throw new Error(`Failed to look up domain (${i.status})`);return i.json()}function be(i){const e=ie.c(103),{isCorporateEmail:b,emailDomain:m,domainLabel:n,defaultName:o,allowDomainClaim:a,onBack:f}=i,l=a===void 0?!0:a,s=de(),j=b&&l?`https://www.google.com/s2/favicons?domain=${m}&sz=128`:null,[c,v]=P.useState(o),[u,w]=P.useState(j),[g,_]=P.useState(!0),[M,$]=P.useState(null);let y;e[0]!==g||e[1]!==u||e[2]!==c?(y=async()=>{const x=await fetch("/api/auth/custom/domain-setup",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:c.trim()||void 0,logo:u??void 0,claimDomain:g})}),S=await x.json();if(!x.ok||!S.success)throw new Error(S.error||"Failed to set up organization");return S},e[0]=g,e[1]=u,e[2]=c,e[3]=y):y=e[3];let N;e[4]!==g?(N=x=>{if(!x.slug)return;const S=we.filter(ke=>g||!ke.claimOnly).length,ne=Se*(S-1)+800;$(x.slug),setTimeout(()=>{window.location.href=`/${x.slug}`},ne)},e[4]=g,e[5]=N):N=e[5];let A;e[6]!==y||e[7]!==N?(A={mutationFn:y,onSuccess:N},e[6]=y,e[7]=N,e[8]=A):A=e[8];const p=pe(A);let D;e[9]!==u||e[10]!==c?(D={mutationFn:async()=>{const x=c.trim(),S=xe(x);if(!S)throw new Error("Invalid organization name");const ne=await ye.organization.create({name:x,slug:S,...u?{logo:u}:{}});if(ne?.error)throw new Error(ne.error.message||"Failed to create organization");window.location.href=`/${ne?.data?.slug??S}`}},e[9]=u,e[10]=c,e[11]=D):D=e[11];const r=pe(D);if(p.isPending||M){let x;e[12]!==n||e[13]!==c?(x=c.trim()||n,e[12]=n,e[13]=c,e[14]=x):x=e[14];let S;return e[15]!==g||e[16]!==m||e[17]!==u||e[18]!==x?(S=t.jsx(oe,{children:t.jsx(Ge,{orgName:x,domain:m,claimDomain:g,logoUrl:u})}),e[15]=g,e[16]=m,e[17]=u,e[18]=x,e[19]=S):S=e[19],S}const d=r.isPending;let h;e[20]!==c?(h=xe(c.trim()),e[20]=c,e[21]=h):h=e[21];const O=!!h,C=p.error||r.error||null;let z;e[22]!==l||e[23]!==O||e[24]!==r||e[25]!==p||e[26]!==b?(z=x=>{x.preventDefault(),O&&(b&&l?p.mutate():r.mutate())},e[22]=l,e[23]=O,e[24]=r,e[25]=p,e[26]=b,e[27]=z):z=e[27];const E=z;let k;e[28]!==s?(k=s("routes.onboarding.welcomeTitle"),e[28]=s,e[29]=k):k=e[29];let L;e[30]!==s?(L=s("routes.onboarding.setupDescription"),e[30]=s,e[31]=L):L=e[31];let R;e[32]!==k||e[33]!==L?(R=t.jsx(fe,{title:k,description:L}),e[32]=k,e[33]=L,e[34]=R):R=e[34];let F;e[35]!==s?(F=s("routes.onboarding.orgAvatar"),e[35]=s,e[36]=F):F=e[36];let T;e[37]!==F?(T=t.jsx("p",{className:"text-sm font-medium",children:F}),e[37]=F,e[38]=T):T=e[38];let q;e[39]!==s?(q=s("routes.onboarding.optional"),e[39]=s,e[40]=q):q=e[40];let U;e[41]!==q?(U=t.jsx("p",{className:"text-xs text-muted-foreground",children:q}),e[41]=q,e[42]=U):U=e[42];let I;e[43]!==T||e[44]!==U?(I=t.jsxs("div",{className:"space-y-0.5",children:[T,U]}),e[43]=T,e[44]=U,e[45]=I):I=e[45];let K;e[46]!==o||e[47]!==c?(K=(c.trim()||o||"?").charAt(0).toUpperCase(),e[46]=o,e[47]=c,e[48]=K):K=e[48];const me=d||p.isPending;let B;e[49]!==u||e[50]!==K||e[51]!==me?(B=t.jsx(Je,{value:u,fallback:K,onChange:w,disabled:me}),e[49]=u,e[50]=K,e[51]=me,e[52]=B):B=e[52];let J;e[53]!==I||e[54]!==B?(J=t.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[I,B]}),e[53]=I,e[54]=B,e[55]=J):J=e[55];let G;e[56]!==s?(G=s("routes.onboarding.orgName"),e[56]=s,e[57]=G):G=e[57];let Y;e[58]!==G?(Y=t.jsx(Ae,{htmlFor:"org-name",className:"text-sm font-medium shrink-0",children:G}),e[58]=G,e[59]=Y):Y=e[59];let le;e[60]===Symbol.for("react.memo_cache_sentinel")?(le=x=>v(x.target.value),e[60]=le):le=e[60];let H;e[61]!==o||e[62]!==s?(H=o||s("routes.onboarding.myOrganizationPlaceholder"),e[61]=o,e[62]=s,e[63]=H):H=e[63];const ue=d||p.isPending;let Q;e[64]!==c||e[65]!==H||e[66]!==ue?(Q=t.jsx(Le,{id:"org-name",value:c,onChange:le,placeholder:H,disabled:ue,className:"h-10 max-w-[220px]"}),e[64]=c,e[65]=H,e[66]=ue,e[67]=Q):Q=e[67];let W;e[68]!==Y||e[69]!==Q?(W=t.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[Y,Q]}),e[68]=Y,e[69]=Q,e[70]=W):W=e[70];let V;e[71]!==l||e[72]!==g||e[73]!==p.isPending||e[74]!==m||e[75]!==b||e[76]!==d||e[77]!==s?(V=b&&l&&t.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[t.jsxs("div",{className:"space-y-0.5",children:[t.jsx("p",{className:"text-sm font-medium",children:s("routes.onboarding.allowSignups",{domain:m})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("routes.onboarding.allowSignupsDescription",{domain:m})})]}),t.jsx(De,{checked:g,onCheckedChange:_,disabled:d||p.isPending})]}),e[71]=l,e[72]=g,e[73]=p.isPending,e[74]=m,e[75]=b,e[76]=d,e[77]=s,e[78]=V):V=e[78];let X;e[79]!==J||e[80]!==W||e[81]!==V?(X=t.jsxs("div",{className:"surface divide-y divide-border",children:[J,W,V]}),e[79]=J,e[80]=W,e[81]=V,e[82]=X):X=e[82];let Z;e[83]!==C||e[84]!==s?(Z=C&&t.jsx("p",{className:"text-xs text-destructive",children:C instanceof Error?C.message:s("routes.onboarding.failedCreateOrg")}),e[83]=C,e[84]=s,e[85]=Z):Z=e[85];const ge=!O||d||p.isPending;let ee;e[86]!==p.isPending||e[87]!==d||e[88]!==s?(ee=d||p.isPending?t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ce,{className:"size-3.5"})," ",s("routes.onboarding.creating")]}):s("routes.onboarding.continue"),e[86]=p.isPending,e[87]=d,e[88]=s,e[89]=ee):ee=e[89];let te;e[90]!==ge||e[91]!==ee?(te=t.jsx(Ne,{type:"submit",size:"xl",className:"w-full",disabled:ge,children:ee}),e[90]=ge,e[91]=ee,e[92]=te):te=e[92];let se;e[93]!==f||e[94]!==s?(se=f&&t.jsx("button",{type:"button",className:"text-sm text-muted-foreground hover:text-foreground transition-colors text-center",onClick:f,children:s("routes.onboarding.seeAvailableOrgs")}),e[93]=f,e[94]=s,e[95]=se):se=e[95];let re;return e[96]!==E||e[97]!==R||e[98]!==X||e[99]!==Z||e[100]!==te||e[101]!==se?(re=t.jsx(oe,{children:t.jsxs("form",{onSubmit:E,className:"grid gap-10",children:[R,X,Z,te,se]})}),e[96]=E,e[97]=R,e[98]=X,e[99]=Z,e[100]=te,e[101]=se,e[102]=re):re=e[102],re}function Je(i){const e=ie.c(18),{value:b,fallback:m,onChange:n,disabled:o}=i,a=de(),f=P.useRef(null);let l;e[0]!==n||e[1]!==a?(l=M=>{const $=M.target.files?.[0];if(!$)return;if($.size>2097152){he.error(a("routes.onboarding.imageTooLarge")),f.current&&(f.current.value="");return}const y=new FileReader;y.onerror=()=>he.error(a("routes.onboarding.failedReadImage")),y.onloadend=()=>{y.result&&n(y.result),f.current&&(f.current.value="")},y.readAsDataURL($)},e[0]=n,e[1]=a,e[2]=l):l=e[2];const s=l;let j;e[3]===Symbol.for("react.memo_cache_sentinel")?(j=()=>f.current?.click(),e[3]=j):j=e[3];let c;e[4]!==a?(c=a("routes.onboarding.uploadOrgLogo"),e[4]=a,e[5]=c):c=e[5];let v;e[6]!==o||e[7]!==s?(v=t.jsx("input",{ref:f,type:"file",accept:"image/*",onChange:s,className:"hidden",disabled:o}),e[6]=o,e[7]=s,e[8]=v):v=e[8];const u=b??void 0;let w;e[9]!==m||e[10]!==u?(w=t.jsx(ve,{url:u,fallback:m,shape:"square",size:"base"}),e[9]=m,e[10]=u,e[11]=w):w=e[11];let g;e[12]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("span",{className:"absolute inset-0 flex items-center justify-center bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity",children:t.jsx(Me,{size:14,className:"text-white"})}),e[12]=g):g=e[12];let _;return e[13]!==o||e[14]!==c||e[15]!==v||e[16]!==w?(_=t.jsxs("button",{type:"button",onClick:j,disabled:o,className:"relative rounded-lg overflow-hidden ring-1 ring-border hover:ring-2 hover:ring-ring/40 transition-all disabled:opacity-50 group","aria-label":c,children:[v,w,g]}),e[13]=o,e[14]=c,e[15]=v,e[16]=w,e[17]=_):_=e[17],_}const we=[{icon:Pe,labelKey:"routes.onboarding.step.creatingOrg",claimOnly:!1},{icon:Re,labelKey:"routes.onboarding.step.claimingDomain",claimOnly:!0},{icon:ze,labelKey:"routes.onboarding.step.enablingAutoJoin",claimOnly:!0}],Se=1500,je=[{bg:"var(--brand-green-light)",fg:"var(--brand-green-dark)"},{bg:"var(--brand-purple-light)",fg:"var(--brand-purple-dark)"},{bg:"var(--brand-yellow-light)",fg:"var(--brand-yellow-dark)"}];function Ge({orgName:i,domain:e,claimDomain:b,logoUrl:m}){const n=de(),o=we.filter(s=>b||!s.claimOnly),[a,f]=P.useState(0),l=P.useRef(!1);if(!l.current){l.current=!0;for(let s=1;s<o.length;s++)setTimeout(()=>f(s),Se*s)}return t.jsxs("div",{className:"grid gap-10",children:[t.jsx(fe,{title:n("routes.onboarding.settingUp",{orgName:i}),description:n("routes.onboarding.gettingReady",{domain:e}),logoUrl:m??null,logoFallback:i.charAt(0).toUpperCase()||"?"}),t.jsx("ul",{className:"grid gap-5",children:o.map((s,j)=>{const c=s.icon,v=j===a,u=j<a,w=je[j%je.length],g=n(s.labelKey);return t.jsxs("li",{className:"flex items-center gap-4 motion-safe:transition-opacity motion-safe:duration-300 motion-safe:ease-out",style:{opacity:u||v?1:.4},children:[t.jsxs("span",{className:ae("relative grid h-8 w-8 shrink-0 place-items-center rounded-lg","motion-safe:transition-colors motion-safe:duration-300",!u&&(v?"bg-muted text-foreground":"bg-muted text-muted-foreground")),style:u?{backgroundColor:w.bg,color:w.fg}:void 0,children:[t.jsx(Fe,{size:16,className:ae("absolute motion-safe:transition-all motion-safe:duration-300 motion-safe:ease-out",u?"scale-100 opacity-100":"scale-75 opacity-0"),"aria-hidden":"true"}),t.jsx(ce,{className:ae("absolute size-4","motion-safe:transition-opacity motion-safe:duration-200",v?"opacity-100":"opacity-0")}),t.jsx(c,{size:16,className:ae("absolute motion-safe:transition-opacity motion-safe:duration-200",!u&&!v?"opacity-100":"opacity-0"),"aria-hidden":"true"})]}),t.jsx("span",{className:ae("text-base leading-6 motion-safe:transition-colors motion-safe:duration-300",v||u?"text-foreground":"text-muted-foreground"),children:g})]},s.labelKey)})})]})}export{ot as default};
1
+ import{c as ie,j as t,a as ye,h as ce,b as de,i as Ce,K as Oe,r as P,B as Ne,e as pe,o as ve,C as ze,I as Le,m as ae,t as he}from"./index-CwntHk8S.js";import{R as _e}from"./required-auth-layout-DwZV69de.js";import{A as oe}from"./auth-split-layout-ckQyQHcL.js";import{O as Ee}from"./organization-choice-Ctd80SL2.js";import{L as Ae}from"./label-BFX3DXnu.js";import{S as De}from"./switch-BviC1co2.js";import{t as Pe,a as Re}from"./Globe04-CM5K7y4B.js";import{i as Fe}from"./CheckCircle-WpYwhp7A.js";import{i as Me}from"./Upload01-Dd-OapHB.js";import"./Plus-C8Idvwpa.js";const $e=new Set(["gmail.com","googlemail.com","outlook.com","hotmail.com","live.com","yahoo.com","yahoo.co.uk","icloud.com","me.com","mac.com","aol.com","protonmail.com","proton.me","zoho.com","yandex.com","mail.com","gmx.com","gmx.net","tutanota.com","fastmail.com"]);function xe(i){return i.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function ot(){const i=ie.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(_e,{children:t.jsx(Te,{})}),i[0]=e):e=i[0],e}function fe(i){const e=ie.c(13),{title:b,description:m,logoUrl:n,logoFallback:o}=i;let a;e[0]!==o||e[1]!==n?(a=t.jsx("div",{children:n?t.jsx(ve,{url:n,fallback:o??"?",shape:"square",size:"base",className:"h-12 w-12"}):t.jsxs(t.Fragment,{children:[t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]})}),e[0]=o,e[1]=n,e[2]=a):a=e[2];let f;e[3]!==b?(f=t.jsx("h1",{className:"text-2xl font-medium leading-8",children:b}),e[3]=b,e[4]=f):f=e[4];let l;e[5]!==m?(l=t.jsx("p",{className:"text-base text-muted-foreground leading-6",children:m}),e[5]=m,e[6]=l):l=e[6];let s;e[7]!==f||e[8]!==l?(s=t.jsxs("div",{className:"space-y-2",children:[f,l]}),e[7]=f,e[8]=l,e[9]=s):s=e[9];let j;return e[10]!==a||e[11]!==s?(j=t.jsxs("div",{className:"grid gap-10",children:[a,s]}),e[10]=a,e[11]=s,e[12]=j):j=e[12],j}function Te(){const i=ie.c(4),{data:e,isPending:b}=ye.useSession();if(b){let a;return i[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(oe,{children:t.jsx("div",{className:"flex items-center gap-2",children:t.jsx(ce,{className:"size-3.5 text-muted-foreground"})})}),i[0]=a):a=i[0],a}const m=e?.user?.email??"",n=e?.user?.name;let o;return i[1]!==n||i[2]!==m?(o=t.jsx(qe,{email:m,userName:n}),i[1]=n,i[2]=m,i[3]=o):o=i[3],o}function qe(i){const e=ie.c(59),{email:b,userName:m}=i,n=de(),o=b.split("@")[1]?.toLowerCase()??"",a=!!o&&!$e.has(o),f=o.split(".")[0]??"",l=f.charAt(0).toUpperCase()+f.slice(1);let s;e[0]!==l||e[1]!==a||e[2]!==m?(s=a?l:m?.split(" ")[0]??"",e[0]=l,e[1]=a,e[2]=m,e[3]=s):s=e[3];const j=s,{data:c,isLoading:v,isError:u,refetch:w}=Ce({queryKey:Oe.domainLookup(o),queryFn:Be,enabled:a});let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=new Set,e[4]=g):g=e[4];const[_,M]=P.useState(g),[$,y]=P.useState(!1);if(v){let r;return e[5]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(ce,{className:"size-3.5 text-muted-foreground"}),e[5]=r):r=e[5],t.jsx(oe,{children:t.jsxs("div",{className:"flex items-center gap-2 py-4",children:[r,t.jsx("span",{className:"text-sm text-muted-foreground",children:n("routes.onboarding.checking",{domain:o})})]})})}if(u){let r;e[6]!==w?(r=()=>w(),e[6]=w,e[7]=r):r=e[7];let d;e[8]!==n?(d=n("routes.onboarding.retry"),e[8]=n,e[9]=d):d=e[9];let h;return e[10]!==r||e[11]!==d?(h=t.jsx(Ne,{variant:"outline",size:"sm",onClick:r,children:d}),e[10]=r,e[11]=d,e[12]=h):h=e[12],t.jsx(oe,{children:t.jsxs("div",{className:"flex flex-col items-start gap-3 py-4",children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:n("routes.onboarding.checkFailed",{domain:o})}),h]})})}let N,A;e[13]!==c?.organizations?(N=(c?.organizations??[]).flatMap(Ke),A=N.some(Ie),e[13]=c?.organizations,e[14]=N,e[15]=A):(N=e[14],A=e[15]);const p=A;if($){let r;e[16]!==m?(r=m?.split(" ")[0]??"",e[16]=m,e[17]=r):r=e[17];let d;e[18]!==y?(d=()=>y(!1),e[18]=y,e[19]=d):d=e[19];let h;return e[20]!==l||e[21]!==o||e[22]!==a||e[23]!==r||e[24]!==d?(h=t.jsx(be,{isCorporateEmail:a,emailDomain:o,domainLabel:l,defaultName:r,allowDomainClaim:!1,onBack:d}),e[20]=l,e[21]=o,e[22]=a,e[23]=r,e[24]=d,e[25]=h):h=e[25],h}if(N.length>0){let r;e[26]!==p||e[27]!==N.length||e[28]!==n?(r=p?N.length===1?n("routes.onboarding.accessSingle"):n("routes.onboarding.accessMultiple"):n("routes.onboarding.requestAccess"),e[26]=p,e[27]=N.length,e[28]=n,e[29]=r):r=e[29];let d;e[30]!==p||e[31]!==n?(d=n(p?"routes.onboarding.emailMatchesOrg":"routes.onboarding.emailMatchesOrgApproval"),e[30]=p,e[31]=n,e[32]=d):d=e[32];let h;e[33]!==r||e[34]!==d?(h=t.jsx(fe,{title:r,description:d}),e[33]=r,e[34]=d,e[35]=h):h=e[35];let O;e[36]!==M?(O=R=>M(F=>new Set(F).add(R)),e[36]=M,e[37]=O):O=e[37];let C;e[38]!==N||e[39]!==o||e[40]!==_||e[41]!==O?(C=t.jsx(Ee,{organizations:N,domain:o,requestedSlugs:_,onRequestedSlug:O,onJoined:Ue}),e[38]=N,e[39]=o,e[40]=_,e[41]=O,e[42]=C):C=e[42];let z;e[43]!==y?(z=()=>y(!0),e[43]=y,e[44]=z):z=e[44];let E;e[45]!==n?(E=n("routes.onboarding.createNewOrg"),e[45]=n,e[46]=E):E=e[46];let k;e[47]!==E||e[48]!==z?(k=t.jsx("button",{type:"button",className:"text-sm text-muted-foreground hover:text-foreground transition-colors text-center",onClick:z,children:E}),e[47]=E,e[48]=z,e[49]=k):k=e[49];let L;return e[50]!==k||e[51]!==h||e[52]!==C?(L=t.jsx(oe,{children:t.jsxs("div",{className:"grid gap-10",children:[h,C,k]})}),e[50]=k,e[51]=h,e[52]=C,e[53]=L):L=e[53],L}let D;return e[54]!==j||e[55]!==l||e[56]!==o||e[57]!==a?(D=t.jsx(be,{isCorporateEmail:a,emailDomain:o,domainLabel:l,defaultName:j}),e[54]=j,e[55]=l,e[56]=o,e[57]=a,e[58]=D):D=e[58],D}function Ue(i,e){window.location.href=`/${e}`}function Ie(i){return i.joinMode==="auto"}function Ke(i){return i.joinMode==="auto"||i.joinMode==="request"?[{id:i.id,name:i.name,slug:i.slug,logo:i.logo,joinMode:i.joinMode}]:[]}async function Be(){const i=await fetch("/api/auth/custom/domain-lookup",{credentials:"include"});if(!i.ok)throw new Error(`Failed to look up domain (${i.status})`);return i.json()}function be(i){const e=ie.c(103),{isCorporateEmail:b,emailDomain:m,domainLabel:n,defaultName:o,allowDomainClaim:a,onBack:f}=i,l=a===void 0?!0:a,s=de(),j=b&&l?`https://www.google.com/s2/favicons?domain=${m}&sz=128`:null,[c,v]=P.useState(o),[u,w]=P.useState(j),[g,_]=P.useState(!0),[M,$]=P.useState(null);let y;e[0]!==g||e[1]!==u||e[2]!==c?(y=async()=>{const x=await fetch("/api/auth/custom/domain-setup",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:c.trim()||void 0,logo:u??void 0,claimDomain:g})}),S=await x.json();if(!x.ok||!S.success)throw new Error(S.error||"Failed to set up organization");return S},e[0]=g,e[1]=u,e[2]=c,e[3]=y):y=e[3];let N;e[4]!==g?(N=x=>{if(!x.slug)return;const S=we.filter(ke=>g||!ke.claimOnly).length,ne=Se*(S-1)+800;$(x.slug),setTimeout(()=>{window.location.href=`/${x.slug}`},ne)},e[4]=g,e[5]=N):N=e[5];let A;e[6]!==y||e[7]!==N?(A={mutationFn:y,onSuccess:N},e[6]=y,e[7]=N,e[8]=A):A=e[8];const p=pe(A);let D;e[9]!==u||e[10]!==c?(D={mutationFn:async()=>{const x=c.trim(),S=xe(x);if(!S)throw new Error("Invalid organization name");const ne=await ye.organization.create({name:x,slug:S,...u?{logo:u}:{}});if(ne?.error)throw new Error(ne.error.message||"Failed to create organization");window.location.href=`/${ne?.data?.slug??S}`}},e[9]=u,e[10]=c,e[11]=D):D=e[11];const r=pe(D);if(p.isPending||M){let x;e[12]!==n||e[13]!==c?(x=c.trim()||n,e[12]=n,e[13]=c,e[14]=x):x=e[14];let S;return e[15]!==g||e[16]!==m||e[17]!==u||e[18]!==x?(S=t.jsx(oe,{children:t.jsx(Ge,{orgName:x,domain:m,claimDomain:g,logoUrl:u})}),e[15]=g,e[16]=m,e[17]=u,e[18]=x,e[19]=S):S=e[19],S}const d=r.isPending;let h;e[20]!==c?(h=xe(c.trim()),e[20]=c,e[21]=h):h=e[21];const O=!!h,C=p.error||r.error||null;let z;e[22]!==l||e[23]!==O||e[24]!==r||e[25]!==p||e[26]!==b?(z=x=>{x.preventDefault(),O&&(b&&l?p.mutate():r.mutate())},e[22]=l,e[23]=O,e[24]=r,e[25]=p,e[26]=b,e[27]=z):z=e[27];const E=z;let k;e[28]!==s?(k=s("routes.onboarding.welcomeTitle"),e[28]=s,e[29]=k):k=e[29];let L;e[30]!==s?(L=s("routes.onboarding.setupDescription"),e[30]=s,e[31]=L):L=e[31];let R;e[32]!==k||e[33]!==L?(R=t.jsx(fe,{title:k,description:L}),e[32]=k,e[33]=L,e[34]=R):R=e[34];let F;e[35]!==s?(F=s("routes.onboarding.orgAvatar"),e[35]=s,e[36]=F):F=e[36];let T;e[37]!==F?(T=t.jsx("p",{className:"text-sm font-medium",children:F}),e[37]=F,e[38]=T):T=e[38];let q;e[39]!==s?(q=s("routes.onboarding.optional"),e[39]=s,e[40]=q):q=e[40];let U;e[41]!==q?(U=t.jsx("p",{className:"text-xs text-muted-foreground",children:q}),e[41]=q,e[42]=U):U=e[42];let I;e[43]!==T||e[44]!==U?(I=t.jsxs("div",{className:"space-y-0.5",children:[T,U]}),e[43]=T,e[44]=U,e[45]=I):I=e[45];let K;e[46]!==o||e[47]!==c?(K=(c.trim()||o||"?").charAt(0).toUpperCase(),e[46]=o,e[47]=c,e[48]=K):K=e[48];const me=d||p.isPending;let B;e[49]!==u||e[50]!==K||e[51]!==me?(B=t.jsx(Je,{value:u,fallback:K,onChange:w,disabled:me}),e[49]=u,e[50]=K,e[51]=me,e[52]=B):B=e[52];let J;e[53]!==I||e[54]!==B?(J=t.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[I,B]}),e[53]=I,e[54]=B,e[55]=J):J=e[55];let G;e[56]!==s?(G=s("routes.onboarding.orgName"),e[56]=s,e[57]=G):G=e[57];let Y;e[58]!==G?(Y=t.jsx(Ae,{htmlFor:"org-name",className:"text-sm font-medium shrink-0",children:G}),e[58]=G,e[59]=Y):Y=e[59];let le;e[60]===Symbol.for("react.memo_cache_sentinel")?(le=x=>v(x.target.value),e[60]=le):le=e[60];let H;e[61]!==o||e[62]!==s?(H=o||s("routes.onboarding.myOrganizationPlaceholder"),e[61]=o,e[62]=s,e[63]=H):H=e[63];const ue=d||p.isPending;let Q;e[64]!==c||e[65]!==H||e[66]!==ue?(Q=t.jsx(Le,{id:"org-name",value:c,onChange:le,placeholder:H,disabled:ue,className:"h-10 max-w-[220px]"}),e[64]=c,e[65]=H,e[66]=ue,e[67]=Q):Q=e[67];let W;e[68]!==Y||e[69]!==Q?(W=t.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[Y,Q]}),e[68]=Y,e[69]=Q,e[70]=W):W=e[70];let V;e[71]!==l||e[72]!==g||e[73]!==p.isPending||e[74]!==m||e[75]!==b||e[76]!==d||e[77]!==s?(V=b&&l&&t.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[t.jsxs("div",{className:"space-y-0.5",children:[t.jsx("p",{className:"text-sm font-medium",children:s("routes.onboarding.allowSignups",{domain:m})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("routes.onboarding.allowSignupsDescription",{domain:m})})]}),t.jsx(De,{checked:g,onCheckedChange:_,disabled:d||p.isPending})]}),e[71]=l,e[72]=g,e[73]=p.isPending,e[74]=m,e[75]=b,e[76]=d,e[77]=s,e[78]=V):V=e[78];let X;e[79]!==J||e[80]!==W||e[81]!==V?(X=t.jsxs("div",{className:"surface divide-y divide-border",children:[J,W,V]}),e[79]=J,e[80]=W,e[81]=V,e[82]=X):X=e[82];let Z;e[83]!==C||e[84]!==s?(Z=C&&t.jsx("p",{className:"text-xs text-destructive",children:C instanceof Error?C.message:s("routes.onboarding.failedCreateOrg")}),e[83]=C,e[84]=s,e[85]=Z):Z=e[85];const ge=!O||d||p.isPending;let ee;e[86]!==p.isPending||e[87]!==d||e[88]!==s?(ee=d||p.isPending?t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ce,{className:"size-3.5"})," ",s("routes.onboarding.creating")]}):s("routes.onboarding.continue"),e[86]=p.isPending,e[87]=d,e[88]=s,e[89]=ee):ee=e[89];let te;e[90]!==ge||e[91]!==ee?(te=t.jsx(Ne,{type:"submit",size:"xl",className:"w-full",disabled:ge,children:ee}),e[90]=ge,e[91]=ee,e[92]=te):te=e[92];let se;e[93]!==f||e[94]!==s?(se=f&&t.jsx("button",{type:"button",className:"text-sm text-muted-foreground hover:text-foreground transition-colors text-center",onClick:f,children:s("routes.onboarding.seeAvailableOrgs")}),e[93]=f,e[94]=s,e[95]=se):se=e[95];let re;return e[96]!==E||e[97]!==R||e[98]!==X||e[99]!==Z||e[100]!==te||e[101]!==se?(re=t.jsx(oe,{children:t.jsxs("form",{onSubmit:E,className:"grid gap-10",children:[R,X,Z,te,se]})}),e[96]=E,e[97]=R,e[98]=X,e[99]=Z,e[100]=te,e[101]=se,e[102]=re):re=e[102],re}function Je(i){const e=ie.c(18),{value:b,fallback:m,onChange:n,disabled:o}=i,a=de(),f=P.useRef(null);let l;e[0]!==n||e[1]!==a?(l=M=>{const $=M.target.files?.[0];if(!$)return;if($.size>2097152){he.error(a("routes.onboarding.imageTooLarge")),f.current&&(f.current.value="");return}const y=new FileReader;y.onerror=()=>he.error(a("routes.onboarding.failedReadImage")),y.onloadend=()=>{y.result&&n(y.result),f.current&&(f.current.value="")},y.readAsDataURL($)},e[0]=n,e[1]=a,e[2]=l):l=e[2];const s=l;let j;e[3]===Symbol.for("react.memo_cache_sentinel")?(j=()=>f.current?.click(),e[3]=j):j=e[3];let c;e[4]!==a?(c=a("routes.onboarding.uploadOrgLogo"),e[4]=a,e[5]=c):c=e[5];let v;e[6]!==o||e[7]!==s?(v=t.jsx("input",{ref:f,type:"file",accept:"image/*",onChange:s,className:"hidden",disabled:o}),e[6]=o,e[7]=s,e[8]=v):v=e[8];const u=b??void 0;let w;e[9]!==m||e[10]!==u?(w=t.jsx(ve,{url:u,fallback:m,shape:"square",size:"base"}),e[9]=m,e[10]=u,e[11]=w):w=e[11];let g;e[12]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("span",{className:"absolute inset-0 flex items-center justify-center bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity",children:t.jsx(Me,{size:14,className:"text-white"})}),e[12]=g):g=e[12];let _;return e[13]!==o||e[14]!==c||e[15]!==v||e[16]!==w?(_=t.jsxs("button",{type:"button",onClick:j,disabled:o,className:"relative rounded-lg overflow-hidden ring-1 ring-border hover:ring-2 hover:ring-ring/40 transition-all disabled:opacity-50 group","aria-label":c,children:[v,w,g]}),e[13]=o,e[14]=c,e[15]=v,e[16]=w,e[17]=_):_=e[17],_}const we=[{icon:Pe,labelKey:"routes.onboarding.step.creatingOrg",claimOnly:!1},{icon:Re,labelKey:"routes.onboarding.step.claimingDomain",claimOnly:!0},{icon:ze,labelKey:"routes.onboarding.step.enablingAutoJoin",claimOnly:!0}],Se=1500,je=[{bg:"var(--brand-green-light)",fg:"var(--brand-green-dark)"},{bg:"var(--brand-purple-light)",fg:"var(--brand-purple-dark)"},{bg:"var(--brand-yellow-light)",fg:"var(--brand-yellow-dark)"}];function Ge({orgName:i,domain:e,claimDomain:b,logoUrl:m}){const n=de(),o=we.filter(s=>b||!s.claimOnly),[a,f]=P.useState(0),l=P.useRef(!1);if(!l.current){l.current=!0;for(let s=1;s<o.length;s++)setTimeout(()=>f(s),Se*s)}return t.jsxs("div",{className:"grid gap-10",children:[t.jsx(fe,{title:n("routes.onboarding.settingUp",{orgName:i}),description:n("routes.onboarding.gettingReady",{domain:e}),logoUrl:m??null,logoFallback:i.charAt(0).toUpperCase()||"?"}),t.jsx("ul",{className:"grid gap-5",children:o.map((s,j)=>{const c=s.icon,v=j===a,u=j<a,w=je[j%je.length],g=n(s.labelKey);return t.jsxs("li",{className:"flex items-center gap-4 motion-safe:transition-opacity motion-safe:duration-300 motion-safe:ease-out",style:{opacity:u||v?1:.4},children:[t.jsxs("span",{className:ae("relative grid h-8 w-8 shrink-0 place-items-center rounded-lg","motion-safe:transition-colors motion-safe:duration-300",!u&&(v?"bg-muted text-foreground":"bg-muted text-muted-foreground")),style:u?{backgroundColor:w.bg,color:w.fg}:void 0,children:[t.jsx(Fe,{size:16,className:ae("absolute motion-safe:transition-all motion-safe:duration-300 motion-safe:ease-out",u?"scale-100 opacity-100":"scale-75 opacity-0"),"aria-hidden":"true"}),t.jsx(ce,{className:ae("absolute size-4","motion-safe:transition-opacity motion-safe:duration-200",v?"opacity-100":"opacity-0")}),t.jsx(c,{size:16,className:ae("absolute motion-safe:transition-opacity motion-safe:duration-200",!u&&!v?"opacity-100":"opacity-0"),"aria-hidden":"true"})]}),t.jsx("span",{className:ae("text-base leading-6 motion-safe:transition-colors motion-safe:duration-300",v||u?"text-foreground":"text-muted-foreground"),children:g})]},s.labelKey)})})]})}export{ot as default};
@@ -0,0 +1,3 @@
1
+ import{e as J,f as B}from"./input-CxFJosPu.js";import{aF as A,aG as _,dC as C,bi as U,co as W}from"./index-CwntHk8S.js";import"./usage-stats-Bk_1jh1-.js";import"./utils-CVEq3hMx.js";import"./markdown-sWsq0zMA.js";import"./use-copy-sOY8Yuot.js";import"./agent-icon-DE4TWlDl.js";import"./AlertCircle-BfuEGc37.js";import"./UserCheck01-DVOI9Qq6.js";import"./Tool01-DOjdBvJ6.js";import"./ArrowUp-Cfwuhrfj.js";import"./ArrowLeft-Ccyza8AK.js";import"./ArrowRight-BfJPk4p9.js";import"./BookOpen01-vaPiqXWZ.js";import"./Globe04-CM5K7y4B.js";import"./CheckCircle-WpYwhp7A.js";import"./TrendUp01-DLgSqdSd.js";import"./ChevronDown-Kpzb5_P-.js";import"./ChevronSelectorVertical-DNPn4Jhl.js";import"./ChevronUp-CwLphDxo.js";import"./UserSquare-CRBGeews.js";import"./LinkBroken01-6J7zZ1XX.js";import"./CreditCard01-CDUEuZ6_.js";import"./File02-D8jC2XAm.js";import"./Minimize01-Dylk6LHz.js";import"./SwitchHorizontal01-BbD-SqO6.js";import"./Eye-BeTcpGN-.js";import"./Image01-0Jwady1a.js";import"./Key01-Dqvoolzt.js";import"./LayoutLeft-Nn_BPz0l.js";import"./Minus-BFZz-RWg.js";import"./Monitor01-ZIydqkip.js";import"./Sun-Bvg5JrAI.js";import"./Play-CkrBckKV.js";import"./Plus-C8Idvwpa.js";import"./SearchMd-G9SUUXxg.js";import"./ShoppingBag01-sbzM0fY9.js";import"./Trash01-BRIjyxCC.js";import"./Upload01-Dd-OapHB.js";import"./Users01-bZ_S-kH7.js";import"./XClose-CWGS9q3D.js";import"./Zap-BxaAY56U.js";import"./chat-context-CiT7AzBS.js";import"./use-panel-navigate-V2MXWXLu.js";import"./thread-route-Bdw4g7Hg.js";import"./use-project-scope-COzEo5Zz.js";import"./repository-binding-Cqb4hBI0.js";import"./use-mcp-client-Cvc3WWPF.js";import"./auth-gL3R1YGn.js";import"./use-view-draft-kind-BdwsMdex.js";import"./use-blog-view-9s3Vkx1q.js";import"./use-organization-settings-Ddjh427l.js";import"./schema-CsGAsuNy.js";import"./task-board-DD2iUGL4.js";import"./thread-intent-DpzwhK2y.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-CTgVk3NA.js";import"./session-runtime-DaEm9VzJ.js";import"./use-entitlements-DtyegfyM.js";import"./use-ai-providers-Cya2RotC.js";import"./use-current-view-EjRzX02x.js";import"./use-in-settings-DLJEfljS.js";import"./use-decopilot-events-BGpwG8Pb.js";import"./use-mobile-CG2XwDbe.js";import"./tooltip-BTd3W-2Z.js";import"./index-DEOQXzn-.js";import"./gateway-client-BqPME1T5.js";import"./form-8GAe5FIZ.js";import"./label-BFX3DXnu.js";import"./icon-button-Dd8gTd4-.js";import"./file-type-icon-CEP8k4gh.js";import"./chat-draft-BNZV2YjB.js";import"./use-voice-input-CwLNuWlo.js";import"./popover-XZWwzjJe.js";import"./drawer-CarQd6Jb.js";import"./index-C17JTAPe.js";import"./checkbox-DSC8VbDf.js";import"./select-DqZVtjvu.js";import"./index-BdQq_4o_.js";import"./ai-providers-logos-DD3qZ33J.js";import"./openai-compatible-presets-BKGfVqEx.js";import"./tabs-BiFBpWbA.js";import"./active-indicator-CCMhAsc_.js";import"./use-deco-credits-d4Nbb0l0.js";import"./toggle-group-l7lV2Oqp.js";import"./input-DXyNd1dE.js";import"./suggestion-bCd1m59t.js";import"./use-mcp-prompts-Ck1uv43A.js";import"./use-org-fs-BfE7L8cf.js";import"./useInfiniteQuery-BagPKS5m.js";import"./infiniteQueryObserver-DdeQTeaz.js";import"./question-004-sINsf4GQ.js";import"./feature-paywall-DzmzZ5s3.js";import"./plan-ladder-cJHOFEt_.js";import"./add-connection-dialog-BfsrivZp.js";import"./collection-search-BbCHAL7t.js";import"./extract-connection-data-D6CjTXbp.js";import"./metadata-D72DunRR.js";import"./connection-BLQs5hMz.js";import"./url-slug-gNlq1cKV.js";import"./connection-card-vLs08dR6.js";import"./connection-slug-CmPPcsjf.js";import"./integration-icon-BCAGJ22m.js";import"./textarea-BoSVR1xB.js";import"./use-connection-2s3z_IKD.js";import"./schema-Bh0CFZUA.js";import"./connection-form-helpers-BSIh8Ep0.js";import"./authenticate-and-persist-oauth-C7oT67KU.js";import"./mcp-oauth-Cal4irlG.js";import"./mcp-oauth-DFWIYz5V.js";import"./collection-tabs-BXeEDC1Y.js";import"./badge-BG-k6t3T.js";import"./use-infinite-scroll-D1tYrKq7.js";import"./useSuspenseInfiniteQuery-BUmkwIx5.js";import"./use-task-board-items-OgSDu-ag.js";import"./use-chat-layout-state-CWt5k1nY.js";class X{constructor(t,r=4e3){this.onDisconnect=t,this.graceMs=r}onDisconnect;graceMs;timer;report(t){if(t==="connected"){clearTimeout(this.timer),this.timer=void 0;return}if(t==="failed"||t==="closed"){clearTimeout(this.timer),this.timer=void 0,this.onDisconnect();return}t==="disconnected"&&!this.timer&&(this.timer=setTimeout(this.onDisconnect,this.graceMs))}dispose(){clearTimeout(this.timer),this.timer=void 0}}const F=A({type:W(["session.input_transcript.delta","session.output_transcript.delta"]),event_id:_(),delta:_(),start_ms:U().nonnegative(),end_ms:U().nonnegative()}),H=A({type:C("session.delegation.created"),offset_ms:U().nonnegative(),delegation:A({id:_(),target:C("client")})});class ${constructor(t,r){this.send=t,this.callbacks=r}send;callbacks;closed=!1;fragments=[];seen=new Set;delegated=new Set;consumed=new Set;pending=new Map;contexts=new Map;awaitingContext=new Map;receive(t,r=Date.now()){if(this.closed)return;const n=F.safeParse(t);if(n.success){const e=n.data;if(this.seen.has(e.event_id))return;this.seen.add(e.event_id);const s=e.type==="session.input_transcript.delta"?"user":"agent";if(this.fragments.push({role:s,text:e.delta,start:e.start_ms,end:e.end_ms,arrivedAt:r,id:e.event_id}),this.fragments.sort((o,i)=>o.start-i.start),this.fragments.length>4e3){this.callbacks.onError();return}this.callbacks.onMessage({role:s,message:e.delta,event_id:e.event_id});return}const a=H.safeParse(t);if(a.success){const{id:e}=a.data.delegation;if(this.delegated.has(e)||this.pending.has(e))return;if(this.delegated.size+this.pending.size>=40){this.callbacks.onError();return}this.pending.set(e,{offset:a.data.offset_ms,receivedAt:r});return}const m=A({type:C("session.thinking.appended"),client_event_id:_()}).safeParse(t);if(m.success){const e=m.data.client_event_id,s=this.awaitingContext.get(e);this.awaitingContext.delete(e),s&&(s.remaining.delete(e),s.remaining.size===0&&this.send({type:"session.commentary.append",event_id:crypto.randomUUID(),delegation_id:s.delegationId??null,content:"Studio has supplied the complete background result as context for this request. Briefly explain that result, including any failure or required approval. Acceptance or task creation alone does not mean the work completed."}));return}const p=A({type:_()}).safeParse(t);p.success&&p.data.type==="error"&&this.callbacks.onError()}tick(t=Date.now()){if(!this.closed)for(const[r,n]of this.pending){const a=this.fragments.filter(o=>o.start<n.offset),m=a.reduce((o,i)=>i.role==="user"?Math.max(o,i.arrivedAt):o,n.receivedAt);if(t-m<500)continue;const p=a.filter(o=>o.role==="user"&&!this.consumed.has(o.id));if(!p.length&&t-n.receivedAt<3e3)continue;if(this.pending.delete(r),this.delegated.add(r),!p.length){this.publishUpdate({delivery:"announce",delegationId:r,text:"No new transcribed request is available. No work was started. Ask the user to repeat the request."});continue}const e=p.map(o=>o.text).join("").trim(),s=[];for(const o of a){if(p.includes(o))continue;const i=s.at(-1);i?.role===o.role?i.text+=o.text:s.push({role:o.role,text:o.text})}if(e.length>J){this.publishUpdate({delivery:"announce",delegationId:r,text:"The spoken request is too long. No work was started. Ask the user to shorten it or continue in text."});continue}for(const o of p)this.consumed.add(o.id);this.callbacks.onDelegate({request:e,delegationId:r,transcript:B(s.map(({role:o,text:i})=>({role:o,text:i.trim()})).filter(({text:o})=>o))}).then(o=>{this.closed||this.publishUpdate({delivery:o.status==="rejected"?"announce":"context",delegationId:r,text:JSON.stringify(o)})}).catch(()=>{this.publishUpdate({delivery:"announce",delegationId:r,text:"Studio could not accept this request. Do not claim work started."})})}}publishUpdate(t){if(this.closed)return;if(t.contextId){if(this.contexts.get(t.contextId)===t.text)return;this.contexts.set(t.contextId,t.text)}const n=(t.contextId?`Updated ${t.contextId} data, superseding earlier values:
2
+ `:`Studio result data:
3
+ `)+t.text,a=new TextEncoder,m=t.delivery==="announce"&&a.encode(n).length>480,p={remaining:new Set,delegationId:t.delegationId};let e="",s=0;const o=()=>{if(!e)return;const i=crypto.randomUUID();m&&(p.remaining.add(i),this.awaitingContext.set(i,p)),this.send({type:t.delivery==="announce"&&!m?"session.commentary.append":"session.thinking.append",event_id:i,delegation_id:t.delegationId??null,content:e}),e="",s=0};for(const i of n){const v=a.encode(i).length;s+v>480&&o(),e+=i,s+=v}o()}close(){this.closed=!0,this.pending.clear(),this.awaitingContext.clear()}}async function ro(E,t,r){r.throwIfAborted();const n=new RTCPeerConnection,a=n.createDataChannel("oai-events"),m=document.createElement("audio");m.autoplay=!0;let p,e,s,o,i=!1,v=!1,h,O,L=0,P=0,g,w,y=!1;const I=Promise.withResolvers(),x=Promise.withResolvers();x.promise.catch(()=>{});const b=new $(d=>{!i&&a.readyState==="open"&&a.send(JSON.stringify(d))},t),q=new X(()=>{i||t.onDisconnect()}),M=async()=>{if(!i){i=!0,q.dispose(),b.close(),clearInterval(O),r.removeEventListener("abort",T),a.close(),n.close();for(const d of p?.getTracks()??[])d.stop();m.pause(),m.srcObject=null,e&&e.state!=="closed"&&await e.close().catch(()=>{})}},T=()=>{M()};r.addEventListener("abort",T,{once:!0});const u=AbortSignal.any([r,AbortSignal.timeout(3e4)]),j=x.promise,z=()=>x.reject(u.reason);u.addEventListener("abort",z,{once:!0}),j.catch(()=>{}),a.onmessage=({data:d})=>{if(!(i||typeof d!="string"))try{const l=JSON.parse(d);typeof l=="object"&&l!==null&&"type"in l&&(l.type==="session.started"&&(v=!0,x.resolve()),l.type==="session.closed"&&(I.resolve(),h||t.onDisconnect())),h||b.receive(l)}catch{t.onError()}},a.onclose=()=>{x.reject(new Error("Voice connection closed")),I.resolve(),!i&&!h&&t.onDisconnect()},n.onconnectionstatechange=()=>{i||q.report(n.connectionState)},n.ontrack=({streams:d,track:l})=>{if(i)return;const D=d[0]??new MediaStream([l]);m.srcObject=D,e??=new AudioContext,s=e.createAnalyser(),s.fftSize=256,o=new Uint8Array(s.fftSize),e.createMediaStreamSource(D).connect(s),e.resume().catch(()=>t.onError()),m.play().catch(()=>t.onError())};function N(){if(!s||!o||i)return 0;s.getByteTimeDomainData(o);let d=0;for(const l of o)d+=((l-128)/128)**2;return Math.min(1,Math.sqrt(d/o.length)*4)}try{const d=navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}}).then(c=>{if(i||u.aborted){for(const f of c.getTracks())f.stop();throw new DOMException("Voice connection cancelled","AbortError")}return p=c,c}),l=await Promise.race([d,new Promise((c,f)=>u.addEventListener("abort",()=>f(u.reason),{once:!0}))]);e??=new AudioContext,g=e.createAnalyser(),g.fftSize=256,w=new Uint8Array(g.fftSize),e.createMediaStreamSource(l).connect(g),await e.resume();for(const c of l.getAudioTracks())n.addTrack(c,l);const D=await n.createOffer();await n.setLocalDescription(D),u.throwIfAborted(),n.iceGatheringState!=="complete"&&await new Promise((c,f)=>{const S=()=>{n.iceGatheringState==="complete"&&(G(),c())},k=()=>{G(),f(u.reason)},G=()=>{n.removeEventListener("icegatheringstatechange",S),u.removeEventListener("abort",k)};n.addEventListener("icegatheringstatechange",S),u.addEventListener("abort",k,{once:!0}),S(),u.aborted&&k()});const V=n.localDescription?.sdp;if(!V)throw new Error("Missing voice offer");const R=await E(V,u);return await n.setRemoteDescription({type:"answer",sdp:R.sdp}),await j,r.throwIfAborted(),u.removeEventListener("abort",z),r.removeEventListener("abort",T),t.onConnect(),O=setInterval(()=>{if(i||h)return;if(b.tick(),g&&w&&!y){g.getByteTimeDomainData(w);const f=w.reduce((S,k)=>S+((k-128)/128)**2,0)/w.length;Math.sqrt(f)>.025&&(P=Date.now())}t.onUserSpeaking(!y&&Date.now()-P<400),N()>.02&&(L=Date.now()),t.onModeChange({mode:Date.now()-L<400?"speaking":"listening"})},100),{endSession:()=>(h??=(async()=>{b.close();for(const c of p?.getTracks()??[])c.stop();if(m.pause(),v&&a.readyState==="open"){a.send(JSON.stringify({type:"session.close"}));let c;await Promise.race([I.promise,new Promise(f=>{c=setTimeout(f,3e3)})]),clearTimeout(c)}await M()})(),h),publishUpdate:c=>b.publishUpdate(c),setMicMuted:c=>{y=c;for(const f of p?.getAudioTracks()??[])f.enabled=!y;y&&t.onUserSpeaking(!1)},getOutputVolume:N}}catch(d){throw await M(),d}}export{ro as startOpenAIConversation};
@@ -1 +1 @@
1
- import{c as a,a4 as f,q as S,i as y,K as v}from"./index-BP527m3V.js";import{b as d}from"./use-project-native-view-presence-D5R7YysD.js";function c(e,i){return v.optimisticProjectSidebarViews(e,i)}function l(e){return typeof e=="object"&&e!==null}function b(e,i){return e[1]===i&&e[3]==="collection"&&e[4]==="VIRTUAL_MCP"}function P(e,i){if(!l(e))return e;if("item"in e&&l(e.item)&&e.item.id===i.id)return{...e,item:i};if(!("structuredContent"in e)||!l(e.structuredContent))return e;const s=e.structuredContent.items;if(!Array.isArray(s))return e;let r=!1;const t=s.map(n=>!l(n)||n.id!==i.id?n:(r=!0,i));return r?{...e,structuredContent:{...e.structuredContent,items:t}}:e}function x(e,i,s){e.setQueriesData({predicate:r=>b(r.queryKey,i)},r=>P(r,s))}function A(e,i,s){const r=e.getQueriesData({predicate:t=>b(t.queryKey,i)&&t.queryKey[5]===s});for(const[,t]of r)if(t?.item?.id===s)return t.item;return null}function V(e,i,s){return e.getQueryData(c(i,s))??null}function j(e,i){if(i)return{sidebarViews:[...i.views],sidebarViewsVersion:d};const s=e?.sidebarViews;return{sidebarViews:s===null?null:s?[...s]:void 0,sidebarViewsVersion:e?.sidebarViewsVersion}}function K(e,i,s){return i?{sidebarViews:[...i.views],sidebarViewsVersion:d}:s===void 0?{sidebarViews:e.sidebarViews===null?null:e.sidebarViews?[...e.sidebarViews]:void 0,sidebarViewsVersion:e.sidebarViewsVersion}:j(s,null)}function p(e,i,s,r,t){const n=V(e,i,s),o={revision:(n?.revision??0)+1,views:[...r],rollbackViews:n?[...n.rollbackViews]:[...t]};return e.setQueryData(c(i,s),o),{revision:o.revision,views:[...o.views],persistedViews:[...o.rollbackViews]}}function C(e,i,s){const r=V(e,i,s);return r?{revision:r.revision,views:[...r.views],persistedViews:[...r.rollbackViews]}:null}function m(e,i){const s=new Set(e),r=new Set(i);return s.size===r.size&&[...s].every(t=>r.has(t))}function R(e){return e?!m(e.views,e.persistedViews):!1}function k(e,i,s,{snapshot:r,saved:t,authoritativeViews:n}){if(!r)return{settledLatest:!1,reconciledViews:null};const o=V(e,i,s);if(!o||r.revision>o.revision)return{settledLatest:!1,reconciledViews:null};const u=n!==void 0?[...n]:t?[...r.views]:null,w={...o,rollbackViews:u??o.rollbackViews};return w.rollbackViews!==o.rollbackViews&&e.setQueryData(c(i,s),w),r.revision!==o.revision?{settledLatest:!1,reconciledViews:null}:(e.setQueryData(c(i,s),null),{settledLatest:!0,reconciledViews:t?u&&!m(u,r.views)?u:null:[...w.rollbackViews]})}function _(e){const i=a.c(5),{org:s}=f(),r=e??"";let t;i[0]!==s.id||i[1]!==r?(t=c(s.id,r),i[0]=s.id,i[1]=r,i[2]=t):t=i[2];let n;i[3]!==t?(n={queryKey:t,queryFn:O,enabled:!1,staleTime:Number.POSITIVE_INFINITY},i[3]=t,i[4]=n):n=i[4];const{data:o}=y(n);return o?.views}async function O(){return null}function L(e){const i=a.c(4),{org:s}=f(),r=S();let t;return i[0]!==s||i[1]!==r||i[2]!==e?(t={stage:(n,o)=>p(r,s.id,e,n,o),snapshot:()=>C(r,s.id,e),settle:n=>k(r,s.id,e,n)},i[0]=s,i[1]=r,i[2]=e,i[3]=t):t=i[3],t}export{L as a,b,j as i,R as o,K as p,A as r,_ as u,x as w};
1
+ import{c as a,a4 as f,q as S,i as y,K as v}from"./index-CwntHk8S.js";import{b as d}from"./use-project-native-view-presence-EdJBeOw9.js";function c(e,i){return v.optimisticProjectSidebarViews(e,i)}function l(e){return typeof e=="object"&&e!==null}function b(e,i){return e[1]===i&&e[3]==="collection"&&e[4]==="VIRTUAL_MCP"}function P(e,i){if(!l(e))return e;if("item"in e&&l(e.item)&&e.item.id===i.id)return{...e,item:i};if(!("structuredContent"in e)||!l(e.structuredContent))return e;const s=e.structuredContent.items;if(!Array.isArray(s))return e;let r=!1;const t=s.map(n=>!l(n)||n.id!==i.id?n:(r=!0,i));return r?{...e,structuredContent:{...e.structuredContent,items:t}}:e}function x(e,i,s){e.setQueriesData({predicate:r=>b(r.queryKey,i)},r=>P(r,s))}function A(e,i,s){const r=e.getQueriesData({predicate:t=>b(t.queryKey,i)&&t.queryKey[5]===s});for(const[,t]of r)if(t?.item?.id===s)return t.item;return null}function V(e,i,s){return e.getQueryData(c(i,s))??null}function j(e,i){if(i)return{sidebarViews:[...i.views],sidebarViewsVersion:d};const s=e?.sidebarViews;return{sidebarViews:s===null?null:s?[...s]:void 0,sidebarViewsVersion:e?.sidebarViewsVersion}}function K(e,i,s){return i?{sidebarViews:[...i.views],sidebarViewsVersion:d}:s===void 0?{sidebarViews:e.sidebarViews===null?null:e.sidebarViews?[...e.sidebarViews]:void 0,sidebarViewsVersion:e.sidebarViewsVersion}:j(s,null)}function p(e,i,s,r,t){const n=V(e,i,s),o={revision:(n?.revision??0)+1,views:[...r],rollbackViews:n?[...n.rollbackViews]:[...t]};return e.setQueryData(c(i,s),o),{revision:o.revision,views:[...o.views],persistedViews:[...o.rollbackViews]}}function C(e,i,s){const r=V(e,i,s);return r?{revision:r.revision,views:[...r.views],persistedViews:[...r.rollbackViews]}:null}function m(e,i){const s=new Set(e),r=new Set(i);return s.size===r.size&&[...s].every(t=>r.has(t))}function R(e){return e?!m(e.views,e.persistedViews):!1}function k(e,i,s,{snapshot:r,saved:t,authoritativeViews:n}){if(!r)return{settledLatest:!1,reconciledViews:null};const o=V(e,i,s);if(!o||r.revision>o.revision)return{settledLatest:!1,reconciledViews:null};const u=n!==void 0?[...n]:t?[...r.views]:null,w={...o,rollbackViews:u??o.rollbackViews};return w.rollbackViews!==o.rollbackViews&&e.setQueryData(c(i,s),w),r.revision!==o.revision?{settledLatest:!1,reconciledViews:null}:(e.setQueryData(c(i,s),null),{settledLatest:!0,reconciledViews:t?u&&!m(u,r.views)?u:null:[...w.rollbackViews]})}function _(e){const i=a.c(5),{org:s}=f(),r=e??"";let t;i[0]!==s.id||i[1]!==r?(t=c(s.id,r),i[0]=s.id,i[1]=r,i[2]=t):t=i[2];let n;i[3]!==t?(n={queryKey:t,queryFn:O,enabled:!1,staleTime:Number.POSITIVE_INFINITY},i[3]=t,i[4]=n):n=i[4];const{data:o}=y(n);return o?.views}async function O(){return null}function L(e){const i=a.c(4),{org:s}=f(),r=S();let t;return i[0]!==s||i[1]!==r||i[2]!==e?(t={stage:(n,o)=>p(r,s.id,e,n,o),snapshot:()=>C(r,s.id,e),settle:n=>k(r,s.id,e,n)},i[0]=s,i[1]=r,i[2]=e,i[3]=t):t=i[3],t}export{L as a,b,j as i,R as o,K as p,A as r,_ as u,x as w};