@langwatch/server 3.8.0 → 3.9.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 (1330) hide show
  1. package/README.md +3 -3
  2. package/feature-map.json +4 -2
  3. package/langevals/evaluators/langevals/langevals_langevals/select_best_compare.py +165 -5
  4. package/langevals/evaluators/langevals/tests/test_select_best_compare.py +471 -9
  5. package/langevals/ts-integration/evaluators.generated.ts +83 -63
  6. package/langwatch/.env.example +7 -0
  7. package/langwatch/biome.jsonc +23 -0
  8. package/langwatch/dist/client/assets/AddAnnotationQueueDrawer-DKvtbwGG.js +2 -0
  9. package/langwatch/dist/client/assets/AddDatasetRecordDrawer-D1vOO9OS.js +6 -0
  10. package/langwatch/dist/client/assets/AddOrEditAnnotationScore-zxFsPi_K.js +2 -0
  11. package/langwatch/dist/client/assets/AddOrEditAnnotationScoreDrawer-soYSKpT_.js +2 -0
  12. package/langwatch/dist/client/assets/AddOrEditDatasetDrawer-BHJmgYGv.js +3 -0
  13. package/langwatch/dist/client/assets/AddParticipants-z6X3xaWh.js +2 -0
  14. package/langwatch/dist/client/assets/AgentHistoryDrawer-kb5K4X01.js +2 -0
  15. package/langwatch/dist/client/assets/AgentHttpEditorDrawer-Cf-aA1pn.js +5 -0
  16. package/langwatch/dist/client/assets/AgentListDrawer-z4OL5IVm.js +2 -0
  17. package/langwatch/dist/client/assets/AgentTypeSelectorDrawer-Ky7GOYHj.js +2 -0
  18. package/langwatch/dist/client/assets/AgentWorkflowEditorDrawer-CAszeo8y.js +2 -0
  19. package/langwatch/dist/client/assets/AgentWorkflowTargetEditorDrawer-DWrxkhIq.js +2 -0
  20. package/langwatch/dist/client/assets/AiGatewayLayout-BqznP5T2.js +2 -0
  21. package/langwatch/dist/client/assets/AnnotationsTable-C9n949u_.js +2 -0
  22. package/langwatch/dist/client/assets/AreaChart-PNFZHqkl.js +2 -0
  23. package/langwatch/dist/client/assets/AuthCard-D14g-b3Y.js +2 -0
  24. package/langwatch/dist/client/assets/AutomationDrawer-Cjo9egay.js +112 -0
  25. package/langwatch/dist/client/assets/BarChart-B23ShI5J.js +4 -0
  26. package/langwatch/dist/client/assets/BatchEvaluationSummary-CmkigWIn.js +2 -0
  27. package/langwatch/dist/client/assets/BudgetEditDrawer-nkQpQiY0.js +2 -0
  28. package/langwatch/dist/client/assets/CartesianChart-Ci1mTvgb.js +54 -0
  29. package/langwatch/dist/client/assets/CascadeArchiveDialog-BPqLe1Ai.js +2 -0
  30. package/langwatch/dist/client/assets/ChartTooltip-BMGa2HEK.js +2 -0
  31. package/langwatch/dist/client/assets/ChatWindow-BBsct-iS.js +5 -0
  32. package/langwatch/dist/client/assets/CodeEvaluatorEditorDrawer-DOqtlBKU.js +9 -0
  33. package/langwatch/dist/client/assets/CodexCodingDefaultsAsk--UfSQyVR.js +2 -0
  34. package/langwatch/dist/client/assets/ColorfulBlockIcons-zwwbjL9F.js +6 -0
  35. package/langwatch/dist/client/assets/ColumnTypeIcon-CZZ6Esh0.js +2 -0
  36. package/langwatch/dist/client/assets/ComparisonLeaderboardDrawer-ChH7KNaX.js +4 -0
  37. package/langwatch/dist/client/assets/ConfirmDialog-CWzCY4sN.js +2 -0
  38. package/langwatch/dist/client/assets/ContactSalesBlock-B3w2lKdE.js +2 -0
  39. package/langwatch/dist/client/assets/Conversation-BhvQmXJ-.js +2 -0
  40. package/langwatch/dist/client/assets/CopyInput-Qeb_2bgP.js +2 -0
  41. package/langwatch/dist/client/assets/CopyableInputWithPrefix-Bp04WBtM.js +2 -0
  42. package/langwatch/dist/client/assets/CreateProjectDrawer-Dg_yrbka.js +2 -0
  43. package/langwatch/dist/client/assets/CreateTeamDrawer-CLJnKmFE.js +2 -0
  44. package/langwatch/dist/client/assets/CustomGraph-C6j6slUs.js +2 -0
  45. package/langwatch/dist/client/assets/DashboardLayout-Cn5-9Ye2.js +96 -0
  46. package/langwatch/dist/client/assets/DashboardNameDrawer-BvGn3rsq.js +2 -0
  47. package/langwatch/dist/client/assets/DataPrivacyRuleDrawer-Wx7PJ_9S.js +2 -0
  48. package/langwatch/dist/client/assets/DatasetEditorTable-Ca3bmQrl.js +2 -0
  49. package/langwatch/dist/client/assets/DatasetPickerList-RZLjPQ2S.js +2 -0
  50. package/langwatch/dist/client/assets/DatasetPreviewTable-Ck22Wy4h.js +2 -0
  51. package/langwatch/dist/client/assets/DatasetSelector-BxeSHSDD.js +2 -0
  52. package/langwatch/dist/client/assets/DefaultModelOverrideDrawer-ncleLyuX.js +2 -0
  53. package/langwatch/dist/client/assets/DeleteConfirmationDialog-Br5m12kp.js +2 -0
  54. package/langwatch/dist/client/assets/DocsLinks-D-I122gH.js +2 -0
  55. package/langwatch/dist/client/assets/DynamicZodForm-BUbQBluG.js +2 -0
  56. package/langwatch/dist/client/assets/EditAutomationFilterDrawer-Bci7dGy6.js +3 -0
  57. package/langwatch/dist/client/assets/EditModelProviderDrawer-CdUQa5qQ.js +4 -0
  58. package/langwatch/dist/client/assets/EditProjectDrawer-DDMa3VNp.js +2 -0
  59. package/langwatch/dist/client/assets/EmojiPickerModal-BLskXRKS.js +3 -0
  60. package/langwatch/dist/client/assets/EnterpriseLockedSurface-CGy3NpuC.js +2 -0
  61. package/langwatch/dist/client/assets/ErrorBarContext-CUuF6tzC.js +2 -0
  62. package/langwatch/dist/client/assets/EvaluatorApiUsageDialog-Dw6JMkKa.js +107 -0
  63. package/langwatch/dist/client/assets/EvaluatorCategorySelectorDrawer-F1nHh-cP.js +2 -0
  64. package/langwatch/dist/client/assets/EvaluatorEditorDrawer-eotRSQPT.js +2 -0
  65. package/langwatch/dist/client/assets/EvaluatorEditorShared-BLZXXMFD.js +43 -0
  66. package/langwatch/dist/client/assets/EvaluatorHistoryDrawer-Bx_uZmkb.js +2 -0
  67. package/langwatch/dist/client/assets/EvaluatorListDrawer--2JYBA1w.js +2 -0
  68. package/langwatch/dist/client/assets/EvaluatorMappingsSection-DCqvgq8G.js +2 -0
  69. package/langwatch/dist/client/assets/EvaluatorSelection-BTMe6CCC.js +2 -0
  70. package/langwatch/dist/client/assets/EvaluatorSelectionBox-CDxYA37_.js +2 -0
  71. package/langwatch/dist/client/assets/EvaluatorTypeSelectorContent-BDgiQ_Gu.js +2 -0
  72. package/langwatch/dist/client/assets/EvaluatorTypeSelectorDrawer-D4HFeq77.js +2 -0
  73. package/langwatch/dist/client/assets/ExecutionState-xp8LG59p.js +2 -0
  74. package/langwatch/dist/client/assets/FeatureFlagsDrawer-DIplgYQy.js +2 -0
  75. package/langwatch/dist/client/assets/FieldInfoTooltip-C_hEtQpK.js +2 -0
  76. package/langwatch/dist/client/assets/FieldsFilters-Ci5mVooQ.js +2 -0
  77. package/langwatch/dist/client/assets/FilterDisplay-BKjP30tt.js +2 -0
  78. package/langwatch/dist/client/assets/FilterSidebar-Cgxbpfi7.js +2 -0
  79. package/langwatch/dist/client/assets/FormatMoney-LZE9c_pf.js +2 -0
  80. package/langwatch/dist/client/assets/FoundryDrawer-DjVyu6Ww.js +2 -0
  81. package/langwatch/dist/client/assets/FullLogo-DRBt8v39.js +2 -0
  82. package/langwatch/dist/client/assets/GovernanceLayout-Baar1Fc8.js +2 -0
  83. package/langwatch/dist/client/assets/GraphsLayout-RNsRoPhs.js +2 -0
  84. package/langwatch/dist/client/assets/GroupBindingInputRow-BxvXd1EU.js +2 -0
  85. package/langwatch/dist/client/assets/GuardrailsDrawer-BtsfIXzD.js +91 -0
  86. package/langwatch/dist/client/assets/History-B3CO9rUC.js +17 -0
  87. package/langwatch/dist/client/assets/HorizontalFormControl-CpxShF8O.js +2 -0
  88. package/langwatch/dist/client/assets/HoverableBigText-BMBnTTnr.js +2 -0
  89. package/langwatch/dist/client/assets/InstallCliCard-DO5HE9Zk.js +2 -0
  90. package/langwatch/dist/client/assets/IntegratePaneShell-Bc7i3AU3.js +8 -0
  91. package/langwatch/dist/client/assets/InviteMemberDrawer-CiQbGDVl.js +2 -0
  92. package/langwatch/dist/client/assets/IsolatedErrorBoundary-QK1gsCee.js +2 -0
  93. package/langwatch/dist/client/assets/LLMModelCostDrawer-K4uPc99h.js +2 -0
  94. package/langwatch/dist/client/assets/LangyContextTarget-Dxr919ue.js +2 -0
  95. package/langwatch/dist/client/assets/LegacyTracesDeprecationBanner-CnBBcfON.js +2 -0
  96. package/langwatch/dist/client/assets/Legend-C-o-ebW-.js +6 -0
  97. package/langwatch/dist/client/assets/Line-CbuF_DU9.js +2 -0
  98. package/langwatch/dist/client/assets/LineChart-CjG7MhLF.js +2 -0
  99. package/langwatch/dist/client/assets/ListTable-Dq11zhPy.js +2 -0
  100. package/langwatch/dist/client/assets/LoadingScreen-BRa1kl7f.js +2 -0
  101. package/langwatch/dist/client/assets/Markdown-Cip8Rj5C.js +35 -0
  102. package/langwatch/dist/client/assets/MenuLink-CEEzPpsg.js +2 -0
  103. package/langwatch/dist/client/assets/MessageCard-Nbu21sIo.js +2 -0
  104. package/langwatch/dist/client/assets/MetadataTag-CQmOL4su.js +5 -0
  105. package/langwatch/dist/client/assets/ModelProviderCustomModelInput-s8Z1JIfQ.js +2 -0
  106. package/langwatch/dist/client/assets/ModelProviderScreen-BkZVsCiO.js +2 -0
  107. package/langwatch/dist/client/assets/ModelSelector-BjEx9IlF.js +2 -0
  108. package/langwatch/dist/client/assets/MyLayout-Dr6t6Ogu.js +2 -0
  109. package/langwatch/dist/client/assets/NavigationFooter-GfOzirbT.js +2 -0
  110. package/langwatch/dist/client/assets/NewWorkflowForm-uqnhwRpZ.js +2 -0
  111. package/langwatch/dist/client/assets/NoDataInfoBlock-Busjhz63.js +2 -0
  112. package/langwatch/dist/client/assets/OnboardingContainer-BGhio01s.js +2 -0
  113. package/langwatch/dist/client/assets/OnlineEvaluationDrawer-DyCVUUmz.js +2 -0
  114. package/langwatch/dist/client/assets/OpsPageShell-GqOT9Ezv.js +2 -0
  115. package/langwatch/dist/client/assets/OttlEditor-BYyg1quG.js +3 -0
  116. package/langwatch/dist/client/assets/OverflownText-q6WIx911.js +2 -0
  117. package/langwatch/dist/client/assets/ProjectAvatar-B0tbfKzY.js +43 -0
  118. package/langwatch/dist/client/assets/ProjectLangyLayout-Du3nxtBV.js +82 -0
  119. package/langwatch/dist/client/assets/PromptEditorDrawer-DeL8XgdG.js +2 -0
  120. package/langwatch/dist/client/assets/PromptListDrawer-y4bmNt4t.js +2 -0
  121. package/langwatch/dist/client/assets/PropertySectionTitle-CK55WvKi.js +37 -0
  122. package/langwatch/dist/client/assets/ProviderModelSelector-B-0vpQ2t.js +2 -0
  123. package/langwatch/dist/client/assets/ProviderScopeChips-DN3rtvAE.js +2 -0
  124. package/langwatch/dist/client/assets/PushToCopiesDialog-Ry_M3FuH.js +2 -0
  125. package/langwatch/dist/client/assets/ReferenceDot-DrNtDSrg.js +2 -0
  126. package/langwatch/dist/client/assets/RenderInputOutput-DqsCnspr.js +261 -0
  127. package/langwatch/dist/client/assets/ScatterChart-jarSkvrF.js +2 -0
  128. package/langwatch/dist/client/assets/ScenarioFormDrawer-DvJcYmkQ.js +2 -0
  129. package/langwatch/dist/client/assets/ScenarioInputMappingSection-BewVLFCZ.js +2 -0
  130. package/langwatch/dist/client/assets/ScenarioRunDetailDrawer-BAPna8ym.js +3 -0
  131. package/langwatch/dist/client/assets/ScopeChipPicker-pQ061i-c.js +2 -0
  132. package/langwatch/dist/client/assets/SearchInput-DH_qIhwi.js +2 -0
  133. package/langwatch/dist/client/assets/SectionNavigationLayout-DwPBnqYj.js +2 -0
  134. package/langwatch/dist/client/assets/SelectDatasetDrawer-8MPCEZID.js +2 -0
  135. package/langwatch/dist/client/assets/SelectionActionBar-C2SOsiow.js +2 -0
  136. package/langwatch/dist/client/assets/SeriesFilterDrawer-d5DYEKTZ.js +2 -0
  137. package/langwatch/dist/client/assets/SettingsLayout-ZI47ZjuT.js +2 -0
  138. package/langwatch/dist/client/assets/SetupWithAgentButton-CNTb3Avj.js +4 -0
  139. package/langwatch/dist/client/assets/ShikiCommandBox-u0WEsz_9.js +5 -0
  140. package/langwatch/dist/client/assets/SpanDetails-L_YT0nxH.js +3 -0
  141. package/langwatch/dist/client/assets/SubscriptionPage-CaUbKJjG.js +2 -0
  142. package/langwatch/dist/client/assets/SuiteFormDrawer-BjUQdKq8.js +2 -0
  143. package/langwatch/dist/client/assets/Symbols-R6sphPWl.js +2 -0
  144. package/langwatch/dist/client/assets/TabButton-8Oc9UYh8.js +3 -0
  145. package/langwatch/dist/client/assets/TableCell-Ci8ylzki.js +2 -0
  146. package/langwatch/dist/client/assets/TargetTypeSelectorDrawer-DSKFRtdD.js +2 -0
  147. package/langwatch/dist/client/assets/TeamForm-CL9ycvq0.js +2 -0
  148. package/langwatch/dist/client/assets/TeamUserRoleField-D0ZTlKiH.js +2 -0
  149. package/langwatch/dist/client/assets/TraceDetails-JolY6sXJ.js +9 -0
  150. package/langwatch/dist/client/assets/TraceDetailsDrawer-lgPzHJ3L.js +2 -0
  151. package/langwatch/dist/client/assets/TraceIdPeek-DDi0ChdF.js +2 -0
  152. package/langwatch/dist/client/assets/TracesMapping-BPXT_-h4.js +2 -0
  153. package/langwatch/dist/client/assets/UpgradeModalContent-DmGd0n65.js +2 -0
  154. package/langwatch/dist/client/assets/UploadCSVDrawer-haYFZH65.js +3 -0
  155. package/langwatch/dist/client/assets/VariablesSection-DW_-pHw8.js +2 -0
  156. package/langwatch/dist/client/assets/VersionBadge-BrsZ4NP1.js +2 -0
  157. package/langwatch/dist/client/assets/ViaClaudeDesktopScreen-B9tl6d9Q.js +1161 -0
  158. package/langwatch/dist/client/assets/ViewAutomationDrawer-DliGiKaC.js +2 -0
  159. package/langwatch/dist/client/assets/VirtualKeySecretReveal-B9QMNIxJ.js +54 -0
  160. package/langwatch/dist/client/assets/WelcomeLayout-DZ1ue0he.js +2 -0
  161. package/langwatch/dist/client/assets/WithFeatureFlagGuard-CgkIIt3_.js +2 -0
  162. package/langwatch/dist/client/assets/WithPermissionGuard-Da_hdEdq.js +2 -0
  163. package/langwatch/dist/client/assets/WorkflowCard-C_ClnTV_.js +2 -0
  164. package/langwatch/dist/client/assets/WorkflowSelectorForEvaluatorDrawer-DozYRazW.js +2 -0
  165. package/langwatch/dist/client/assets/_...path_-Da4obdgF.js +2 -0
  166. package/langwatch/dist/client/assets/_Uint8Array-BKsS4AYJ.js +2 -0
  167. package/langwatch/dist/client/assets/__...path__-hjRUlcmj.js +22 -0
  168. package/langwatch/dist/client/assets/_baseAssignValue-B0IP5NGP.js +2 -0
  169. package/langwatch/dist/client/assets/_baseClone-DWP1OuEe.js +2 -0
  170. package/langwatch/dist/client/assets/_baseEach-Bv6waMUN.js +2 -0
  171. package/langwatch/dist/client/assets/_baseFor-K5aTWdeA.js +2 -0
  172. package/langwatch/dist/client/assets/_experiment_-Cv2h4AYK.js +2 -0
  173. package/langwatch/dist/client/assets/_id_-BoubOQoS.js +2 -0
  174. package/langwatch/dist/client/assets/_id_-BuzJEIUf.js +2 -0
  175. package/langwatch/dist/client/assets/_id_-BzLlrR7z.js +2 -0
  176. package/langwatch/dist/client/assets/_id_-DAzjJ7AY.js +2 -0
  177. package/langwatch/dist/client/assets/_id_-Dc2UAWAO.js +2 -0
  178. package/langwatch/dist/client/assets/_id_-DwutdLKk.js +2 -0
  179. package/langwatch/dist/client/assets/_id_-H7-5DI5r.js +2 -0
  180. package/langwatch/dist/client/assets/_project_-DTuunSJZ.js +8 -0
  181. package/langwatch/dist/client/assets/_runId_-BGhwmwQj.js +7 -0
  182. package/langwatch/dist/client/assets/_shell-ChQAHWWX.js +2 -0
  183. package/langwatch/dist/client/assets/_slug_-D6Y2wsW5.js +2 -0
  184. package/langwatch/dist/client/assets/_slug_-DLKkXVG8.js +2 -0
  185. package/langwatch/dist/client/assets/_slug_-yLo6E4BE.js +17 -0
  186. package/langwatch/dist/client/assets/_team_-TUptH6wK.js +2 -0
  187. package/langwatch/dist/client/assets/_workflow_-B_flNNON.js +3 -0
  188. package/langwatch/dist/client/assets/_workflow_-DUyBeEF1.js +25 -0
  189. package/langwatch/dist/client/assets/accept-BtE8pbrP.js +2 -0
  190. package/langwatch/dist/client/assets/activity-BDNvBEBL.js +1 -0
  191. package/langwatch/dist/client/assets/agents-CZnWSlhu.js +2 -0
  192. package/langwatch/dist/client/assets/alerts-BDNvBEBL.js +1 -0
  193. package/langwatch/dist/client/assets/all-in7z_yGY.js +2 -0
  194. package/langwatch/dist/client/assets/analytics-C8m2qboV.js +2 -0
  195. package/langwatch/dist/client/assets/annotation-scores-hmT53w46.js +2 -0
  196. package/langwatch/dist/client/assets/annotations-DwouO48Z.js +2 -0
  197. package/langwatch/dist/client/assets/anomaly-rules-DoJdIoCt.js +2 -0
  198. package/langwatch/dist/client/assets/api-keys-CykxAxvG.js +4 -0
  199. package/langwatch/dist/client/assets/asaplangy-D3J00Q-Z.js +5 -0
  200. package/langwatch/dist/client/assets/audit-log-Dy4vcEeJ.js +2 -0
  201. package/langwatch/dist/client/assets/auth-IqMSC5k1.js +2 -0
  202. package/langwatch/dist/client/assets/authentication-BqVl7Fh-.js +2 -0
  203. package/langwatch/dist/client/assets/authorize-BGMc1Gzv.js +2 -0
  204. package/langwatch/dist/client/assets/authorize-DhHzBVUd.js +2 -0
  205. package/langwatch/dist/client/assets/automations-BDNvBEBL.js +1 -0
  206. package/langwatch/dist/client/assets/automations-BhzNESFp.js +2 -0
  207. package/langwatch/dist/client/assets/billing-plans-D_IT1cHz.js +2 -0
  208. package/langwatch/dist/client/assets/blank-Ct2wtHyX.js +2 -0
  209. package/langwatch/dist/client/assets/blobs-Dwi1OImQ.js +2 -0
  210. package/langwatch/dist/client/assets/blockDiagram-677ZJIJ3-CnAsMlS_.js +133 -0
  211. package/langwatch/dist/client/assets/budgets-Cn5gXQK_.js +3 -0
  212. package/langwatch/dist/client/assets/bug-reports-feRha8NA.js +2 -0
  213. package/langwatch/dist/client/assets/cache-rules-T0g7jfVv.js +2 -0
  214. package/langwatch/dist/client/assets/choose-D7SJAjkq.js +2 -0
  215. package/langwatch/dist/client/assets/chunk-EX3LRPZG-DkekrL-i.js +232 -0
  216. package/langwatch/dist/client/assets/chunk-FWX5IMBZ-2uc49Oqf.js +3 -0
  217. package/langwatch/dist/client/assets/chunk-PUDLZKDR-CdFvlX4m.js +157 -0
  218. package/langwatch/dist/client/assets/chunk-RYQCIY6F-BLUBc3em.js +2 -0
  219. package/langwatch/dist/client/assets/chunk-V7JOEXUC-daLm26hJ.js +207 -0
  220. package/langwatch/dist/client/assets/classDiagram-OUVF2IWQ-CDA8LHAw.js +2 -0
  221. package/langwatch/dist/client/assets/classDiagram-v2-EOCWNBFH-CDA8LHAw.js +2 -0
  222. package/langwatch/dist/client/assets/clsx-CjueKrWZ.js +2 -0
  223. package/langwatch/dist/client/assets/codeAgentConfig-BGKq9uCt.js +7 -0
  224. package/langwatch/dist/client/assets/codingDefaultSync-BHSxIX3Y.js +2 -0
  225. package/langwatch/dist/client/assets/configure-CrBmyV7I.js +4 -0
  226. package/langwatch/dist/client/assets/constants-CDt5HyiB.js +2 -0
  227. package/langwatch/dist/client/assets/custom-wRFdLdR4.js +12 -0
  228. package/langwatch/dist/client/assets/custom_evaluator-C4ikBFuX.js +31 -0
  229. package/langwatch/dist/client/assets/dagre-VKFMJZFB-BElJnuGp.js +5 -0
  230. package/langwatch/dist/client/assets/dagre-VMur7wh6.js +2 -0
  231. package/langwatch/dist/client/assets/data-privacy-DAIYO4AS.js +2 -0
  232. package/langwatch/dist/client/assets/data-retention-6spK_HnV.js +2 -0
  233. package/langwatch/dist/client/assets/datasets-_6-oF4ZW.js +2 -0
  234. package/langwatch/dist/client/assets/debounce-CS9Z04io.js +2 -0
  235. package/langwatch/dist/client/assets/defaultModelState-B2tL23ua.js +2 -0
  236. package/langwatch/dist/client/assets/dejaview-Cde-wWV4.js +2 -0
  237. package/langwatch/dist/client/assets/departments-Cm-0ZxEt.js +2 -0
  238. package/langwatch/dist/client/assets/devices-DmiWzGY2.js +2 -0
  239. package/langwatch/dist/client/assets/dist-C4xeXVRv.js +6 -0
  240. package/langwatch/dist/client/assets/drawerFromUrl-CKr5SifD.js +2 -0
  241. package/langwatch/dist/client/assets/edit-CLmkWTOM.js +62 -0
  242. package/langwatch/dist/client/assets/email-suppressions-cqwH0a9N.js +2 -0
  243. package/langwatch/dist/client/assets/erDiagram-Q63AITRT-Byy32QYy.js +86 -0
  244. package/langwatch/dist/client/assets/error-D8QCVS4R.js +2 -0
  245. package/langwatch/dist/client/assets/errors-mlatPkMI.js +2 -0
  246. package/langwatch/dist/client/assets/evaluations-BBoYdpZy.js +2 -0
  247. package/langwatch/dist/client/assets/evaluations-DhzXchFj.js +2 -0
  248. package/langwatch/dist/client/assets/evaluators-BtHslgaT.js +2 -0
  249. package/langwatch/dist/client/assets/evaluators-_EDCn-tQ.js +148 -0
  250. package/langwatch/dist/client/assets/experiments-CffarahA.js +1 -0
  251. package/langwatch/dist/client/assets/feature-flags-mcBTRF0E.js +2 -0
  252. package/langwatch/dist/client/assets/fetchSSE-CnJPAkno.js +3 -0
  253. package/langwatch/dist/client/assets/fieldset-kmG3NTVs.js +2 -0
  254. package/langwatch/dist/client/assets/flowDiagram-23GEKE2U-CY9NG0NN.js +1 -0
  255. package/langwatch/dist/client/assets/forgot-password-wo5Sna-0.js +2 -0
  256. package/langwatch/dist/client/assets/formatMoney-ClmqgvaY.js +2 -0
  257. package/langwatch/dist/client/assets/formatTargetOutput-DXvqMkYJ.js +2 -0
  258. package/langwatch/dist/client/assets/foundry-CfvGgfP0.js +477 -0
  259. package/langwatch/dist/client/assets/gateway-Be0EsD57.js +2 -0
  260. package/langwatch/dist/client/assets/getEvaluator-D2EjIa3G.js +2 -0
  261. package/langwatch/dist/client/assets/getRadiusAndStrokeWidthFromDot-D2oUP3Tn.js +2 -0
  262. package/langwatch/dist/client/assets/governance-YZL-Q4Vy.js +2 -0
  263. package/langwatch/dist/client/assets/graphlib-DsLTzvlk.js +2 -0
  264. package/langwatch/dist/client/assets/grid-MxZhegzw.js +2 -0
  265. package/langwatch/dist/client/assets/groups-BmusUt3C.js +2 -0
  266. package/langwatch/dist/client/assets/guardrails-DAx8mDop.js +2 -0
  267. package/langwatch/dist/client/assets/handled-error-DbmvFmFF.js +2 -0
  268. package/langwatch/dist/client/assets/http-C64lOZI7.js +7 -0
  269. package/langwatch/dist/client/assets/identifierUtils-C2FgAR6z.js +2 -0
  270. package/langwatch/dist/client/assets/immer-DImI3Uq2.js +14 -0
  271. package/langwatch/dist/client/assets/index-8SbDirJv.js +68 -0
  272. package/langwatch/dist/client/assets/ingestion-source-detail-PQbeRniA.js +19 -0
  273. package/langwatch/dist/client/assets/ingestion-sources-CCyiAKHP.js +12 -0
  274. package/langwatch/dist/client/assets/integrations-WSl7N8v9.js +2 -0
  275. package/langwatch/dist/client/assets/isArrayLikeObject-DQ6J5Gh8.js +2 -0
  276. package/langwatch/dist/client/assets/isSymbol-DQQCRrSw.js +2 -0
  277. package/langwatch/dist/client/assets/langyHomeSuggestions-czH603Eu.js +2 -0
  278. package/langwatch/dist/client/assets/license-BXfbZQgG.js +2 -0
  279. package/langwatch/dist/client/assets/licenseStatusUtils-CeEgqpQ1.js +2 -0
  280. package/langwatch/dist/client/assets/lu-BSZWBZXU.js +2 -0
  281. package/langwatch/dist/client/assets/map-DUpZ7PrO.js +2 -0
  282. package/langwatch/dist/client/assets/mappingValidation-C7knTdfD.js +2 -0
  283. package/langwatch/dist/client/assets/me-DbCM2fI8.js +7 -0
  284. package/langwatch/dist/client/assets/me-DgXzEkaD.js +2 -0
  285. package/langwatch/dist/client/assets/members-CNILhgB4.js +2 -0
  286. package/langwatch/dist/client/assets/mermaid.core-1LNrQSiZ.js +12 -0
  287. package/langwatch/dist/client/assets/messages-CIoUj-2S.js +2 -0
  288. package/langwatch/dist/client/assets/metrics-Ba4ghWyR.js +2 -0
  289. package/langwatch/dist/client/assets/mindmap-definition-LN4V7U3C-BsK9qdX4.js +97 -0
  290. package/langwatch/dist/client/assets/model-costs-Cmo-7iNN.js +2 -0
  291. package/langwatch/dist/client/assets/model-providers-DNeQW-T1.js +2 -0
  292. package/langwatch/dist/client/assets/modelProviderHelpers-BgYFTBND.js +2 -0
  293. package/langwatch/dist/client/assets/my-queue-DAyfQ6lp.js +2 -0
  294. package/langwatch/dist/client/assets/normalizeComparison-QGQpERT7.js +2 -0
  295. package/langwatch/dist/client/assets/not-found-BFkr8OS7.js +2 -0
  296. package/langwatch/dist/client/assets/now-BWCCq_PO.js +2 -0
  297. package/langwatch/dist/client/assets/onboarding-DAAoh3gE.js +2 -0
  298. package/langwatch/dist/client/assets/online-evaluations-DbC0C3ct.js +2 -0
  299. package/langwatch/dist/client/assets/ops-BnGgY3gP.js +2 -0
  300. package/langwatch/dist/client/assets/organizations-D-hWxeYL.js +2 -0
  301. package/langwatch/dist/client/assets/pages-BthWVZpr.js +2 -0
  302. package/langwatch/dist/client/assets/persistence-NkzSPIBC.js +2 -0
  303. package/langwatch/dist/client/assets/personalProject-C9vU_vdl.js +2 -0
  304. package/langwatch/dist/client/assets/plans-B_rx4bLE.js +2 -0
  305. package/langwatch/dist/client/assets/preconditionFieldUtils-ryKgG9T1.js +2 -0
  306. package/langwatch/dist/client/assets/product-BuY5Xwg3.js +2 -0
  307. package/langwatch/dist/client/assets/project-C2NjfKL8.js +2 -0
  308. package/langwatch/dist/client/assets/projections-rLpLV9w3.js +2 -0
  309. package/langwatch/dist/client/assets/projects-BF0LrAID.js +2 -0
  310. package/langwatch/dist/client/assets/promptHandle-BT-5THDj.js +2 -0
  311. package/langwatch/dist/client/assets/prompts-BHe5aLJx.js +8 -0
  312. package/langwatch/dist/client/assets/radio-group-BPt-WSZX.js +2 -0
  313. package/langwatch/dist/client/assets/registry-olFQKglt.js +2 -0
  314. package/langwatch/dist/client/assets/reports-BLYN6Q1s.js +2 -0
  315. package/langwatch/dist/client/assets/request-DFzKYavU.js +2 -0
  316. package/langwatch/dist/client/assets/requirementDiagram-TGXJPOKE-CRtGWC_J.js +85 -0
  317. package/langwatch/dist/client/assets/reset-password-DYZspdMQ.js +2 -0
  318. package/langwatch/dist/client/assets/role-bindings-FmulBsng.js +2 -0
  319. package/langwatch/dist/client/assets/roles-RLhR-aqL.js +2 -0
  320. package/langwatch/dist/client/assets/routing-policies-ljceihkc.js +5 -0
  321. package/langwatch/dist/client/assets/scenarios-BQqYDDZG.js +2 -0
  322. package/langwatch/dist/client/assets/scheduler-BFnKJjAw.js +2 -0
  323. package/langwatch/dist/client/assets/schedules-BDNvBEBL.js +1 -0
  324. package/langwatch/dist/client/assets/scim-Bmka9JwE.js +2 -0
  325. package/langwatch/dist/client/assets/seatTypeCopy-fhsCX-T3.js +2 -0
  326. package/langwatch/dist/client/assets/secrets-Cwr6m0Ec.js +2 -0
  327. package/langwatch/dist/client/assets/segment-group-BktqF-NE.js +2 -0
  328. package/langwatch/dist/client/assets/segmented-control-Dux7mG6V.js +2 -0
  329. package/langwatch/dist/client/assets/select-BvA110t-.js +2 -0
  330. package/langwatch/dist/client/assets/send-KqbwnHm5.js +2 -0
  331. package/langwatch/dist/client/assets/sequenceView-CXTCS8lF.js +5 -0
  332. package/langwatch/dist/client/assets/seriesOptions-B04NlY20.js +1015 -0
  333. package/langwatch/dist/client/assets/settings-U355L_I1.js +2 -0
  334. package/langwatch/dist/client/assets/setup-BlSoABYV.js +2 -0
  335. package/langwatch/dist/client/assets/shikiAdapter-Ctbe7cQu.js +3 -0
  336. package/langwatch/dist/client/assets/showSuiteRunError-D2fez5Ub.js +2 -0
  337. package/langwatch/dist/client/assets/signin-DyT1qLoq.js +2 -0
  338. package/langwatch/dist/client/assets/signup-D8m3PZ3b.js +2 -0
  339. package/langwatch/dist/client/assets/stateDiagram-2N3HPSRC-iaTfadDT.js +2 -0
  340. package/langwatch/dist/client/assets/stateDiagram-v2-6OUMAXLB-DH-TUWs1.js +2 -0
  341. package/langwatch/dist/client/assets/subscription-_ypR9RT2.js +3 -0
  342. package/langwatch/dist/client/assets/subscriptions-BRPlrnsz.js +2 -0
  343. package/langwatch/dist/client/assets/suggestionUI-BvF9IL3n.js +106 -0
  344. package/langwatch/dist/client/assets/swimlanes-5IMT3BWC-DT3qutmi.js +3 -0
  345. package/langwatch/dist/client/assets/swimlanesDiagram-G3AALYLV-Chcqm6v8.js +9 -0
  346. package/langwatch/dist/client/assets/switch-BZp2DIfW.js +2 -0
  347. package/langwatch/dist/client/assets/switch-C1DNHB2v.js +2 -0
  348. package/langwatch/dist/client/assets/tabs-B6CQXTUQ.js +2 -0
  349. package/langwatch/dist/client/assets/teams-B3Yc0LtS.js +2 -0
  350. package/langwatch/dist/client/assets/teams-Df3DGQGZ.js +2 -0
  351. package/langwatch/dist/client/assets/tool-catalog-CpVqJ_Dp.js +7 -0
  352. package/langwatch/dist/client/assets/toolIcons-CwYXl2Eu.js +2 -0
  353. package/langwatch/dist/client/assets/tooltip-CM-lMDNU.js +2 -0
  354. package/langwatch/dist/client/assets/topic-clustering-DEtDEXOU.js +2 -0
  355. package/langwatch/dist/client/assets/topics-BGSBPvH8.js +2 -0
  356. package/langwatch/dist/client/assets/traceStore-C-SeEWpA.js +55 -0
  357. package/langwatch/dist/client/assets/traces-hMC5nfWE.js +289 -0
  358. package/langwatch/dist/client/assets/tracesMapping-CJhNJ9Ej.js +3 -0
  359. package/langwatch/dist/client/assets/tracking-in5OR8uP.js +2 -0
  360. package/langwatch/dist/client/assets/types-DNh2n8ZE.js +2 -0
  361. package/langwatch/dist/client/assets/types-OZJZgbcd.js +2 -0
  362. package/langwatch/dist/client/assets/types-nw9Z9F-v.js +2 -0
  363. package/langwatch/dist/client/assets/undo-2-CYjzz3Fj.js +2 -0
  364. package/langwatch/dist/client/assets/usage-BMXYHJUH.js +2 -0
  365. package/langwatch/dist/client/assets/usage-Da6wBDdP.js +2 -0
  366. package/langwatch/dist/client/assets/use-generic-onboarding-flow-eie3NRF5.js +2 -0
  367. package/langwatch/dist/client/assets/useActivePlan-Dsa3BYxd.js +2 -0
  368. package/langwatch/dist/client/assets/useAllPromptsForProject-BS-h_uSZ.js +2 -0
  369. package/langwatch/dist/client/assets/useAnnotationQueues-BMo2kZ_n.js +2 -0
  370. package/langwatch/dist/client/assets/useAvailableEvaluators-DkZ2Yt1F.js +2 -0
  371. package/langwatch/dist/client/assets/useCyclingVerb-BTWaxKR2.js +2 -0
  372. package/langwatch/dist/client/assets/useDepartmentColumn-xoZ52lPP.js +2 -0
  373. package/langwatch/dist/client/assets/useEvaluationsV3Store-CjI63SqB.js +2 -0
  374. package/langwatch/dist/client/assets/useExportTraces-kA2TFkjy.js +2 -0
  375. package/langwatch/dist/client/assets/useFeatureFlag-BjAcqOFH.js +2 -0
  376. package/langwatch/dist/client/assets/usePersonalContext-BGjy_Vrg.js +2 -0
  377. package/langwatch/dist/client/assets/useProjectSpanNames-DV-N8Iqc.js +2 -0
  378. package/langwatch/dist/client/assets/useProjectsForCopy-C63wLMNr.js +2 -0
  379. package/langwatch/dist/client/assets/useRunViaApiTabs-DMsq4RV1.js +50 -0
  380. package/langwatch/dist/client/assets/useShowLangy-C1pPUZqz.js +2 -0
  381. package/langwatch/dist/client/assets/useSimulationUpdateListener-ufWGuGhO.js +2 -0
  382. package/langwatch/dist/client/assets/useTargetName-DRCsNovZ.js +2 -0
  383. package/langwatch/dist/client/assets/useTargetNameMap-2sQCSyzN.js +2 -0
  384. package/langwatch/dist/client/assets/useTraceDetailsDrawer-CWSKPTh_.js +2 -0
  385. package/langwatch/dist/client/assets/useTraceUpdateListener-DqLF7KuU.js +2 -0
  386. package/langwatch/dist/client/assets/useUrlScopeFilter-BmRsU3rU.js +2 -0
  387. package/langwatch/dist/client/assets/useVariantMetrics-CK9aOmIb.js +2 -0
  388. package/langwatch/dist/client/assets/useWorkflowStore-CWWkoMW1.js +8 -0
  389. package/langwatch/dist/client/assets/users-B9jauEWz.js +2 -0
  390. package/langwatch/dist/client/assets/users-C8IaWy9-.js +2 -0
  391. package/langwatch/dist/client/assets/users-DIbzKO8Q.js +2 -0
  392. package/langwatch/dist/client/assets/v3-C9Ud_O3k.js +2 -0
  393. package/langwatch/dist/client/assets/variables-Dox25KUK.js +396 -0
  394. package/langwatch/dist/client/assets/viewStore-BCIvcW8n.js +2 -0
  395. package/langwatch/dist/client/assets/virtual-keys-D-qkAFBv.js +2 -0
  396. package/langwatch/dist/client/assets/welcome-CnjW7kg3.js +16 -0
  397. package/langwatch/dist/client/assets/wizard-CUCaNag_.js +2 -0
  398. package/langwatch/dist/client/assets/workbench-N1DutXtL.js +2 -0
  399. package/langwatch/dist/client/assets/workflows-D2XRYWpS.js +3 -0
  400. package/langwatch/dist/client/assets/wrap-D_XqGHIU.js +2 -0
  401. package/langwatch/dist/client/index.html +4 -4
  402. package/langwatch/dist/scenario-child-process.js +7 -0
  403. package/langwatch/e2e/auth-regression/better-auth-sso-smoketest.ts +72 -0
  404. package/langwatch/ee/LICENSE.md +52 -18
  405. package/langwatch/ee/README.md +15 -6
  406. package/langwatch/ee/admin/routes/__tests__/admin.integration.test.ts +1 -1
  407. package/langwatch/ee/admin/routes/admin.ts +1 -1
  408. package/langwatch/ee/audit-log/auditLog.ts +51 -0
  409. package/langwatch/ee/billing/__tests__/planLimits.unit.test.ts +6 -6
  410. package/langwatch/ee/billing/__tests__/planProvider.unit.test.ts +21 -33
  411. package/langwatch/ee/billing/__tests__/subscription.service.unit.test.ts +1 -0
  412. package/langwatch/ee/billing/__tests__/usage-limit.service.unit.test.ts +17 -17
  413. package/langwatch/ee/billing/planLimits.ts +1 -37
  414. package/langwatch/ee/billing/planProvider.ts +0 -13
  415. package/langwatch/ee/governance/reactors/__tests__/gatewayBudgetSync.reactor.unit.test.ts +39 -0
  416. package/langwatch/ee/governance/reactors/__tests__/governanceKpisSync.reactor.unit.test.ts +33 -0
  417. package/langwatch/ee/governance/reactors/__tests__/governanceOcsfEventsSync.reactor.unit.test.ts +33 -0
  418. package/langwatch/ee/governance/reactors/__tests__/governanceReactorsPreEnqueueGate.unit.test.ts +243 -0
  419. package/langwatch/ee/governance/reactors/gatewayBudgetSync.reactor.ts +391 -185
  420. package/langwatch/ee/governance/reactors/governanceKpisSync.reactor.ts +14 -7
  421. package/langwatch/ee/governance/reactors/governanceOcsfEventsSync.reactor.ts +97 -81
  422. package/langwatch/ee/governance/services/governanceAttributeKeys.ts +17 -0
  423. package/langwatch/ee/licensing/__tests__/constants.unit.test.ts +4 -6
  424. package/langwatch/ee/licensing/__tests__/defaults.unit.test.ts +63 -86
  425. package/langwatch/ee/licensing/__tests__/fixtures/testLicenses.ts +18 -0
  426. package/langwatch/ee/licensing/__tests__/licenseGenerationService.unit.test.ts +52 -16
  427. package/langwatch/ee/licensing/__tests__/licenseHandler.integration.test.ts +199 -15
  428. package/langwatch/ee/licensing/__tests__/mintedPlan.unit.test.ts +110 -0
  429. package/langwatch/ee/licensing/__tests__/planMapping.unit.test.ts +4 -29
  430. package/langwatch/ee/licensing/__tests__/planTemplates.unit.test.ts +0 -61
  431. package/langwatch/ee/licensing/__tests__/validation.unit.test.ts +69 -0
  432. package/langwatch/ee/licensing/constants.ts +11 -59
  433. package/langwatch/ee/licensing/defaults.ts +20 -32
  434. package/langwatch/ee/licensing/licenseGenerationService.ts +6 -19
  435. package/langwatch/ee/licensing/licenseHandler.ts +109 -92
  436. package/langwatch/ee/licensing/mintedPlan.ts +57 -0
  437. package/langwatch/ee/licensing/ossBaselineFloor.ts +45 -0
  438. package/langwatch/ee/licensing/planInfo.ts +0 -13
  439. package/langwatch/ee/licensing/planMapping.ts +0 -13
  440. package/langwatch/ee/licensing/planTemplates.ts +8 -42
  441. package/langwatch/ee/licensing/types.ts +24 -29
  442. package/langwatch/ee/licensing/validation.ts +13 -1
  443. package/langwatch/ee/scim/__tests__/scim-token.service.unit.test.ts +110 -0
  444. package/langwatch/ee/scim/__tests__/scim.costCenter.integration.test.ts +171 -0
  445. package/langwatch/ee/scim/__tests__/scim.service.unit.test.ts +415 -0
  446. package/langwatch/ee/scim/routes.ts +585 -0
  447. package/langwatch/ee/scim/scim-group.service.ts +465 -0
  448. package/langwatch/ee/scim/scim-role-resolver.ts +48 -0
  449. package/langwatch/ee/scim/scim-role-resolver.unit.test.ts +93 -0
  450. package/langwatch/ee/scim/scim-token.service.ts +71 -0
  451. package/langwatch/ee/scim/scim.service.ts +554 -0
  452. package/langwatch/ee/scim/scim.types.ts +149 -0
  453. package/langwatch/ee/scim/webhooks.ts +170 -0
  454. package/langwatch/ee/sso/__tests__/fallbackName.test.ts +142 -0
  455. package/langwatch/ee/sso/__tests__/matching.test.ts +126 -0
  456. package/langwatch/ee/sso/__tests__/parseIssuerUrl.test.ts +59 -0
  457. package/langwatch/ee/sso/__tests__/sso-gate.test.ts +459 -0
  458. package/langwatch/ee/sso/__tests__/sso-license.repository.test.ts +53 -0
  459. package/langwatch/ee/sso/__tests__/ssoPathGate.test.ts +182 -0
  460. package/langwatch/ee/sso/__tests__/ssoRouteTableCanary.test.ts +186 -0
  461. package/langwatch/ee/sso/matching.ts +48 -0
  462. package/langwatch/ee/sso/providers.ts +271 -0
  463. package/langwatch/ee/sso/sso-gate.ts +294 -0
  464. package/langwatch/ee/sso/sso-license.repository.ts +47 -0
  465. package/langwatch/ee/sso/ssoPathGate.ts +127 -0
  466. package/langwatch/package.json +1 -1
  467. package/langwatch/prisma/migrations/20260802120000_organization_user_disabled_at/migration.sql +7 -0
  468. package/langwatch/prisma/schema.prisma +8 -0
  469. package/langwatch/scripts/check-feature-parity.ts +0 -4
  470. package/langwatch/src/__tests__/noBinarySourceFiles.unit.test.ts +56 -0
  471. package/langwatch/src/app/api/agents/[[...route]]/app.ts +0 -2
  472. package/langwatch/src/app/api/agents/__tests__/agents-rest-api.integration.test.ts +0 -22
  473. package/langwatch/src/app/api/dashboards/[[...route]]/app.ts +0 -2
  474. package/langwatch/src/app/api/dashboards/__tests__/dashboard-rest-api.integration.test.ts +0 -18
  475. package/langwatch/src/app/api/dataset/[[...route]]/app.ts +0 -33
  476. package/langwatch/src/app/api/dataset/__tests__/dataset-rest-api.integration.test.ts +0 -24
  477. package/langwatch/src/app/api/dataset/__tests__/dataset-upload-api.integration.test.ts +0 -25
  478. package/langwatch/src/app/api/evaluators/[[...route]]/app.v1.ts +0 -2
  479. package/langwatch/src/app/api/export/scenario-runs/[[...route]]/app.ts +250 -0
  480. package/langwatch/src/app/api/export/scenario-runs/__tests__/scenario-run-export-route.integration.test.ts +336 -0
  481. package/langwatch/src/app/api/graphs/[[...route]]/app.ts +0 -2
  482. package/langwatch/src/app/api/middleware/__tests__/error-handler.unit.test.ts +4 -4
  483. package/langwatch/src/app/api/middleware/index.ts +0 -1
  484. package/langwatch/src/app/api/monitors/[[...route]]/app.ts +0 -2
  485. package/langwatch/src/app/api/projects/[[...route]]/app.ts +28 -8
  486. package/langwatch/src/app/api/prompts/[[...route]]/app.v1.ts +0 -2
  487. package/langwatch/src/app/api/scenario-events/[[...route]]/app.ts +0 -5
  488. package/langwatch/src/app/api/scenarios/[[...route]]/app.v1.ts +0 -2
  489. package/langwatch/src/app/api/shared/errors.ts +14 -0
  490. package/langwatch/src/app/api/simulation-runs/__tests__/simulation-run-platform-url.integration.test.ts +6 -3
  491. package/langwatch/src/app/api/suites/[[...route]]/app.ts +0 -2
  492. package/langwatch/src/app/api/teams/[[...route]]/app.ts +22 -1
  493. package/langwatch/src/app/api/teams/__tests__/teams-rest-api.integration.test.ts +146 -0
  494. package/langwatch/src/app/api/traces/[[...route]]/app.v1.ts +114 -0
  495. package/langwatch/src/app/api/triggers/[[...route]]/app.ts +0 -2
  496. package/langwatch/src/components/AddMembersForm.tsx +25 -5
  497. package/langwatch/src/components/AddOrEditDatasetDrawer.tsx +1 -9
  498. package/langwatch/src/components/ComparisonLeaderboardDrawer.tsx +496 -0
  499. package/langwatch/src/components/LicenseStatus.tsx +14 -16
  500. package/langwatch/src/components/__tests__/ComparisonLeaderboardDrawer.gate.integration.test.tsx +146 -0
  501. package/langwatch/src/components/__tests__/LicenseStatus.integration.test.tsx +129 -0
  502. package/langwatch/src/components/__tests__/UpgradeModal.integration.test.tsx +358 -68
  503. package/langwatch/src/components/agents/AgentCodeEditorDrawer.tsx +7 -14
  504. package/langwatch/src/components/agents/AgentHttpEditorDrawer.tsx +7 -14
  505. package/langwatch/src/components/agents/WorkflowSelectorDrawer.tsx +1 -15
  506. package/langwatch/src/components/analytics/DashboardNameDrawer.tsx +20 -26
  507. package/langwatch/src/components/auth/AuthCard.tsx +41 -0
  508. package/langwatch/src/components/batch-evaluation-results/BatchEvaluationResults.tsx +72 -0
  509. package/langwatch/src/components/batch-evaluation-results/BatchEvaluationResultsTable.tsx +109 -2
  510. package/langwatch/src/components/batch-evaluation-results/ComparisonCharts.tsx +241 -77
  511. package/langwatch/src/components/batch-evaluation-results/ComparisonLeaderboardChart.tsx +355 -0
  512. package/langwatch/src/components/batch-evaluation-results/ComparisonTable.tsx +437 -75
  513. package/langwatch/src/components/batch-evaluation-results/LeaderboardStep.tsx +105 -0
  514. package/langwatch/src/components/batch-evaluation-results/LeaderboardTrustPanel.tsx +464 -0
  515. package/langwatch/src/components/batch-evaluation-results/LeaderboardVerdictPanel.tsx +354 -0
  516. package/langwatch/src/components/batch-evaluation-results/PairwiseLeaderboard.tsx +553 -0
  517. package/langwatch/src/components/batch-evaluation-results/ParetoScatterChart.tsx +512 -0
  518. package/langwatch/src/components/batch-evaluation-results/TradeoffSummaryLine.tsx +58 -0
  519. package/langwatch/src/components/batch-evaluation-results/WinRateChart.tsx +12 -4
  520. package/langwatch/src/components/batch-evaluation-results/__tests__/ComparisonCharts.filter-overflow.integration.test.tsx +8 -1
  521. package/langwatch/src/components/batch-evaluation-results/__tests__/ComparisonCharts.leaderboard-gate.integration.test.tsx +192 -0
  522. package/langwatch/src/components/batch-evaluation-results/__tests__/ComparisonCharts.test.tsx +8 -1
  523. package/langwatch/src/components/batch-evaluation-results/__tests__/ComparisonTable.group-by-metadata.integration.test.tsx +352 -0
  524. package/langwatch/src/components/batch-evaluation-results/__tests__/bootstrapMeanCI.unit.test.ts +98 -0
  525. package/langwatch/src/components/batch-evaluation-results/__tests__/buildAxisLabels.unit.test.ts +134 -0
  526. package/langwatch/src/components/batch-evaluation-results/__tests__/buildPairwiseComparisons.test.ts +95 -0
  527. package/langwatch/src/components/batch-evaluation-results/__tests__/buildTrustChecks.unit.test.ts +551 -0
  528. package/langwatch/src/components/batch-evaluation-results/__tests__/computeBTLeaderboard.test.ts +428 -0
  529. package/langwatch/src/components/batch-evaluation-results/__tests__/computeBandClipping.unit.test.ts +125 -0
  530. package/langwatch/src/components/batch-evaluation-results/__tests__/computeComparability.unit.test.ts +208 -0
  531. package/langwatch/src/components/batch-evaluation-results/__tests__/computeJudgeBiasChecks.unit.test.ts +186 -0
  532. package/langwatch/src/components/batch-evaluation-results/__tests__/computeLeaderboardVerdict.test.ts +288 -0
  533. package/langwatch/src/components/batch-evaluation-results/__tests__/computeParetoDominance.unit.test.ts +599 -0
  534. package/langwatch/src/components/batch-evaluation-results/__tests__/computeSampleAdequacy.unit.test.ts +212 -0
  535. package/langwatch/src/components/batch-evaluation-results/__tests__/computeScoreBarScale.unit.test.ts +104 -0
  536. package/langwatch/src/components/batch-evaluation-results/__tests__/computeVariantMetrics.test.ts +99 -0
  537. package/langwatch/src/components/batch-evaluation-results/__tests__/detectComparisonColumns.test.ts +133 -0
  538. package/langwatch/src/components/batch-evaluation-results/__tests__/formatLeaderboardHeadline.unit.test.ts +252 -0
  539. package/langwatch/src/components/batch-evaluation-results/__tests__/formatTradeoffSummary.unit.test.ts +219 -0
  540. package/langwatch/src/components/batch-evaluation-results/__tests__/leaderboardCache.unit.test.ts +128 -0
  541. package/langwatch/src/components/batch-evaluation-results/__tests__/panelAgreement.unit.test.ts +165 -0
  542. package/langwatch/src/components/batch-evaluation-results/__tests__/paretoScatterPoints.unit.test.ts +95 -0
  543. package/langwatch/src/components/batch-evaluation-results/__tests__/scoreSeparation.unit.test.ts +314 -0
  544. package/langwatch/src/components/batch-evaluation-results/__tests__/variantMetricsSymmetry.unit.test.ts +129 -0
  545. package/langwatch/src/components/batch-evaluation-results/__tests__/verdictSafety.unit.test.ts +438 -0
  546. package/langwatch/src/components/batch-evaluation-results/__tests__/winMatrixHasPairwiseDetail.unit.test.ts +126 -0
  547. package/langwatch/src/components/batch-evaluation-results/bootstrapMeanCI.ts +78 -0
  548. package/langwatch/src/components/batch-evaluation-results/buildPairwiseComparisons.ts +30 -0
  549. package/langwatch/src/components/batch-evaluation-results/chartAxisLabels.ts +98 -0
  550. package/langwatch/src/components/batch-evaluation-results/computeBTLeaderboard.ts +814 -0
  551. package/langwatch/src/components/batch-evaluation-results/computeComparability.ts +305 -0
  552. package/langwatch/src/components/batch-evaluation-results/computeJudgeBiasChecks.ts +175 -0
  553. package/langwatch/src/components/batch-evaluation-results/computeLeaderboardVerdict.ts +277 -0
  554. package/langwatch/src/components/batch-evaluation-results/computeParetoDominance.ts +283 -0
  555. package/langwatch/src/components/batch-evaluation-results/computeSampleAdequacy.ts +91 -0
  556. package/langwatch/src/components/batch-evaluation-results/computeVariantMetrics.ts +236 -0
  557. package/langwatch/src/components/batch-evaluation-results/computeWinMatrixShape.ts +61 -0
  558. package/langwatch/src/components/batch-evaluation-results/formatLeaderboardHeadline.ts +139 -0
  559. package/langwatch/src/components/batch-evaluation-results/formatTradeoffSummary.ts +126 -0
  560. package/langwatch/src/components/batch-evaluation-results/mulberry32.ts +19 -0
  561. package/langwatch/src/components/batch-evaluation-results/scoreSeparation.ts +102 -0
  562. package/langwatch/src/components/batch-evaluation-results/types.ts +82 -9
  563. package/langwatch/src/components/batch-evaluation-results/useBTLeaderboard.ts +137 -0
  564. package/langwatch/src/components/batch-evaluation-results/usePairwiseSort.ts +78 -0
  565. package/langwatch/src/components/batch-evaluation-results/useResultsGrouping.ts +119 -0
  566. package/langwatch/src/components/batch-evaluation-results/useShowComparisonLeaderboard.ts +43 -0
  567. package/langwatch/src/components/batch-evaluation-results/useVariantMetrics.ts +106 -0
  568. package/langwatch/src/components/checks/DynamicZodForm.tsx +9 -0
  569. package/langwatch/src/components/drawerRegistry.ts +5 -0
  570. package/langwatch/src/components/evaluations/OnlineEvaluationDrawer.tsx +13 -20
  571. package/langwatch/src/components/evaluators/EvaluatorEditorShared.tsx +16 -20
  572. package/langwatch/src/components/evaluators/WorkflowSelectorForEvaluatorDrawer.tsx +1 -15
  573. package/langwatch/src/components/experiments/CreateExperimentButton.tsx +13 -17
  574. package/langwatch/src/components/license/LicenseDetailsCard.tsx +72 -23
  575. package/langwatch/src/components/license/LicenseGeneratorForm.tsx +0 -60
  576. package/langwatch/src/components/license/LicenseLoadError.tsx +23 -0
  577. package/langwatch/src/components/license/OverSeatsCallout.tsx +68 -0
  578. package/langwatch/src/components/license/ResourceLimitsDisplay.tsx +0 -74
  579. package/langwatch/src/components/license/__tests__/OverSeatsCallout.integration.test.tsx +56 -0
  580. package/langwatch/src/components/license/__tests__/ResourceLimitsDisplay.unit.test.ts +8 -135
  581. package/langwatch/src/components/license/__tests__/licenseStatusUtils.unit.test.ts +68 -13
  582. package/langwatch/src/components/license/__tests__/planFormDefaults.unit.test.ts +11 -11
  583. package/langwatch/src/components/license/__tests__/useLicenseActions.integration.test.ts +185 -0
  584. package/langwatch/src/components/license/licenseStatusUtils.ts +21 -17
  585. package/langwatch/src/components/license/planFormDefaults.ts +3 -18
  586. package/langwatch/src/components/license/useLicenseActions.ts +26 -3
  587. package/langwatch/src/components/me/PersonalRecentTracesTable.tsx +4 -0
  588. package/langwatch/src/components/ops/projections/BulkReplayWizard.tsx +23 -1
  589. package/langwatch/src/components/plans/PlansComparisonPage.tsx +18 -0
  590. package/langwatch/src/components/plans/__tests__/PlansComparisonPage.integration.test.tsx +17 -0
  591. package/langwatch/src/components/plans/__tests__/planCurrentResolver.unit.test.ts +19 -0
  592. package/langwatch/src/components/plans/planCurrentResolver.ts +13 -0
  593. package/langwatch/src/components/projects/CreateProjectDrawer.tsx +36 -40
  594. package/langwatch/src/components/prompts/PromptEditorDrawer.tsx +9 -15
  595. package/langwatch/src/components/prompts/__tests__/PromptEditorDrawer.test.tsx +0 -1
  596. package/langwatch/src/components/scenarios/ScenarioCreateModal.tsx +3 -5
  597. package/langwatch/src/components/scenarios/ScenarioFormDrawer.tsx +2 -32
  598. package/langwatch/src/components/settings/CreateTeamDrawer.tsx +31 -35
  599. package/langwatch/src/components/settings/EnterpriseCapabilitiesSection.tsx +236 -0
  600. package/langwatch/src/components/settings/InfoWithoutSelecting.tsx +25 -0
  601. package/langwatch/src/components/settings/OrganizationUserRoleField.tsx +21 -2
  602. package/langwatch/src/components/settings/__tests__/EnterpriseCapabilitiesSection.integration.test.tsx +173 -0
  603. package/langwatch/src/components/settings/__tests__/seatTypeCopy.unit.test.ts +94 -0
  604. package/langwatch/src/components/settings/__tests__/seatTypeExplanation.integration.test.tsx +126 -0
  605. package/langwatch/src/components/settings/seatTypeCopy.ts +29 -0
  606. package/langwatch/src/components/subscription/SubscriptionPage.tsx +0 -1
  607. package/langwatch/src/components/subscription/__tests__/subscription-test-setup.ts +0 -13
  608. package/langwatch/src/components/subscription/billing-plans.ts +3 -12
  609. package/langwatch/src/components/suites/RunHistoryFilters.tsx +55 -3
  610. package/langwatch/src/components/suites/RunHistoryPanel.tsx +44 -0
  611. package/langwatch/src/components/suites/ScenarioRunExportDialog.tsx +92 -0
  612. package/langwatch/src/components/suites/SuiteFormDrawer.tsx +4 -20
  613. package/langwatch/src/components/suites/__tests__/AllRunsPanel.integration.test.tsx +3 -0
  614. package/langwatch/src/components/suites/__tests__/RunHistoryEmptyState.integration.test.tsx +45 -0
  615. package/langwatch/src/components/suites/__tests__/RunHistoryLiveWindow.integration.test.tsx +135 -0
  616. package/langwatch/src/components/suites/__tests__/ScenarioRunExportUi.integration.test.tsx +227 -0
  617. package/langwatch/src/components/suites/__tests__/SuiteDetailPanel.integration.test.tsx +3 -0
  618. package/langwatch/src/components/suites/run-history-transforms.ts +1 -28
  619. package/langwatch/src/components/suites/useExportScenarioRuns.ts +333 -0
  620. package/langwatch/src/components/suites/useRunHistoryPagination.ts +14 -0
  621. package/langwatch/src/components/upgrade-modal/LimitContent.tsx +3 -154
  622. package/langwatch/src/env-create.mjs +4 -0
  623. package/langwatch/src/features/errors/logic/codes.ts +2 -1
  624. package/langwatch/src/features/errors/logic/presentation.ts +8 -3
  625. package/langwatch/src/features/langy/__tests__/presentLangyToolError.unit.test.ts +1 -1
  626. package/langwatch/src/features/langy/logic/langyToolFailure.ts +4 -7
  627. package/langwatch/src/features/traces-v2/components/TraceDrawer/conversationView/TurnSteps.tsx +1 -1
  628. package/langwatch/src/features/traces-v2/components/TraceDrawer/drawerHeader/DrawerHeader.tsx +34 -0
  629. package/langwatch/src/features/traces-v2/components/TraceDrawer/drawerHeader/__tests__/utils.unit.test.ts +74 -0
  630. package/langwatch/src/features/traces-v2/components/TraceDrawer/terminalView/TerminalView.tsx +57 -3
  631. package/langwatch/src/features/traces-v2/components/TraceDrawer/terminalView/__tests__/TerminalView.integration.test.tsx +43 -3
  632. package/langwatch/src/features/traces-v2/components/TraceTable/columns.ts +7 -0
  633. package/langwatch/src/features/traces-v2/components/TraceTable/registry/cells/trace/ContextSizeCell.tsx +48 -0
  634. package/langwatch/src/features/traces-v2/components/TraceTable/registry/cells/trace/__tests__/ContextSizeCell.integration.test.tsx +57 -0
  635. package/langwatch/src/features/traces-v2/components/TraceTable/registry/cells/trace/index.ts +2 -0
  636. package/langwatch/src/features/traces-v2/components/shared/TokenBreakdownTooltip.tsx +22 -0
  637. package/langwatch/src/features/traces-v2/lens/capabilities.ts +2 -0
  638. package/langwatch/src/features/traces-v2/types/trace.ts +2 -0
  639. package/langwatch/src/hooks/__tests__/useLicenseEnforcement.unit.test.tsx +18 -30
  640. package/langwatch/src/hooks/__tests__/useOrganizationTeamProject.personal-workspace.integration.test.tsx +30 -0
  641. package/langwatch/src/hooks/__tests__/usePostHogIdentify.unit.test.ts +3 -3
  642. package/langwatch/src/hooks/useMemberDisableAction.ts +53 -0
  643. package/langwatch/src/hooks/useOrganizationTeamProject.ts +8 -7
  644. package/langwatch/src/optimization_studio/components/Evaluate.tsx +39 -46
  645. package/langwatch/src/optimization_studio/components/workflow/NewWorkflowForm.tsx +22 -30
  646. package/langwatch/src/pages/[project]/analytics/custom/index.tsx +1 -6
  647. package/langwatch/src/pages/api/experiment/__tests__/init.unit.test.ts +2 -87
  648. package/langwatch/src/pages/api/experiment/init.ts +7 -60
  649. package/langwatch/src/pages/auth/__tests__/forgot-password.integration.test.tsx +38 -3
  650. package/langwatch/src/pages/auth/forgot-password.tsx +19 -23
  651. package/langwatch/src/pages/auth/reset-password.tsx +2 -23
  652. package/langwatch/src/pages/settings/__tests__/authentication.integration.test.tsx +7 -0
  653. package/langwatch/src/pages/settings/__tests__/team-settings.refused-save.integration.test.tsx +253 -0
  654. package/langwatch/src/pages/settings/authentication.tsx +7 -2
  655. package/langwatch/src/pages/settings/license.tsx +4 -3
  656. package/langwatch/src/pages/settings/members.tsx +126 -34
  657. package/langwatch/src/pages/settings/teams/[team].tsx +73 -20
  658. package/langwatch/src/pages/settings/usage.tsx +7 -8
  659. package/langwatch/src/prompts/prompt-playground/components/sidebar/AddPromptButton.tsx +3 -8
  660. package/langwatch/src/server/api/routers/__tests__/annotation.tenant-references.unit.test.ts +1 -1
  661. package/langwatch/src/server/api/routers/__tests__/apiKey.myBindings.unit.test.ts +1 -1
  662. package/langwatch/src/server/api/routers/__tests__/apiKey.nameById.unit.test.ts +1 -1
  663. package/langwatch/src/server/api/routers/__tests__/apiKey.restricted-permissions.unit.test.ts +4 -1
  664. package/langwatch/src/server/api/routers/__tests__/automations.router.integration.test.ts +1 -1
  665. package/langwatch/src/server/api/routers/__tests__/bugReports.gating.unit.test.ts +1 -1
  666. package/langwatch/src/server/api/routers/__tests__/enterprise-guards.integration.test.ts +0 -4
  667. package/langwatch/src/server/api/routers/__tests__/evaluators.tenant-workflow.unit.test.ts +1 -1
  668. package/langwatch/src/server/api/routers/__tests__/graphs.tenant-dashboard.unit.test.ts +1 -1
  669. package/langwatch/src/server/api/routers/__tests__/langy.turnErrors.unit.test.ts +1 -1
  670. package/langwatch/src/server/api/routers/__tests__/langyGithub.access-order.unit.test.ts +1 -1
  671. package/langwatch/src/server/api/routers/__tests__/license.integration.test.ts +1 -17
  672. package/langwatch/src/server/api/routers/__tests__/licenseEnforcement.reportLimitBlocked.unit.test.ts +1 -1
  673. package/langwatch/src/server/api/routers/__tests__/monitors.copy.integration.test.ts +1 -11
  674. package/langwatch/src/server/api/routers/__tests__/organization.acceptInvite.unit.test.ts +1 -1
  675. package/langwatch/src/server/api/routers/__tests__/organization.setMemberDisabled.integration.test.ts +306 -0
  676. package/langwatch/src/server/api/routers/__tests__/personal-workspace-invariants.integration.test.ts +794 -0
  677. package/langwatch/src/server/api/routers/__tests__/plan.getActivePlan.integration.test.ts +0 -1
  678. package/langwatch/src/server/api/routers/__tests__/project.getHasFirstMessage.unit.test.ts +1 -1
  679. package/langwatch/src/server/api/routers/__tests__/project.regenerateApiKey.unit.test.ts +2 -2
  680. package/langwatch/src/server/api/routers/__tests__/prompts.copy.integration.test.ts +0 -58
  681. package/langwatch/src/server/api/routers/__tests__/prompts.duplicate.integration.test.ts +0 -54
  682. package/langwatch/src/server/api/routers/__tests__/publicEnv.test.ts +60 -0
  683. package/langwatch/src/server/api/routers/__tests__/secrets.reserved-names.unit.test.ts +1 -1
  684. package/langwatch/src/server/api/routers/__tests__/team.update.multi-binding.unit.test.ts +1 -1
  685. package/langwatch/src/server/api/routers/__tests__/traces.4991-full-resolution.unit.test.ts +1 -1
  686. package/langwatch/src/server/api/routers/__tests__/tracesV2.transcript-read.unit.test.ts +121 -0
  687. package/langwatch/src/server/api/routers/__tests__/translate.unit.test.ts +1 -1
  688. package/langwatch/src/server/api/routers/__tests__/user.changePassword.unit.test.ts +105 -0
  689. package/langwatch/src/server/api/routers/__tests__/user.deactivation.unit.test.ts +1 -1
  690. package/langwatch/src/server/api/routers/__tests__/user.register.unit.test.ts +67 -5
  691. package/langwatch/src/server/api/routers/__tests__/workflows.generateCommitMessage.unit.test.ts +1 -1
  692. package/langwatch/src/server/api/routers/agents.ts +0 -6
  693. package/langwatch/src/server/api/routers/analytics/__tests__/dataForFilter.unit.test.ts +1 -1
  694. package/langwatch/src/server/api/routers/apiKey.ts +1 -1
  695. package/langwatch/src/server/api/routers/automations.ts +0 -4
  696. package/langwatch/src/server/api/routers/bugReports.ts +1 -1
  697. package/langwatch/src/server/api/routers/copyEvaluatorToProject.ts +2 -5
  698. package/langwatch/src/server/api/routers/dashboards.ts +0 -2
  699. package/langwatch/src/server/api/routers/dataset.ts +0 -9
  700. package/langwatch/src/server/api/routers/emailSuppression.ts +1 -1
  701. package/langwatch/src/server/api/routers/evaluators.ts +0 -4
  702. package/langwatch/src/server/api/routers/experiments.ts +0 -14
  703. package/langwatch/src/server/api/routers/export.ts +65 -24
  704. package/langwatch/src/server/api/routers/graphs.ts +0 -2
  705. package/langwatch/src/server/api/routers/group.ts +6 -0
  706. package/langwatch/src/server/api/routers/langyEgress.ts +1 -1
  707. package/langwatch/src/server/api/routers/langyGithub.ts +1 -1
  708. package/langwatch/src/server/api/routers/license.ts +44 -36
  709. package/langwatch/src/server/api/routers/licenseEnforcement.ts +0 -21
  710. package/langwatch/src/server/api/routers/modelProviders.ts +1 -1
  711. package/langwatch/src/server/api/routers/monitors.ts +0 -6
  712. package/langwatch/src/server/api/routers/onboarding/__tests__/onboarding.personal-workspace.integration.test.ts +8 -15
  713. package/langwatch/src/server/api/routers/onboarding/onboarding.router.unit.test.ts +1 -1
  714. package/langwatch/src/server/api/routers/onboarding/setProductInterest.integration.test.ts +1 -1
  715. package/langwatch/src/server/api/routers/ops.ts +2 -0
  716. package/langwatch/src/server/api/routers/organization.ts +67 -1
  717. package/langwatch/src/server/api/routers/project.ts +74 -36
  718. package/langwatch/src/server/api/routers/prompts/prompts.trpc-router.ts +0 -10
  719. package/langwatch/src/server/api/routers/publicEnv.ts +7 -3
  720. package/langwatch/src/server/api/routers/scenarios/__tests__/simulation-runner.router.unit.test.ts +1 -1
  721. package/langwatch/src/server/api/routers/scenarios/scenario-crud.router.ts +0 -4
  722. package/langwatch/src/server/api/routers/scimToken.ts +1 -1
  723. package/langwatch/src/server/api/routers/suites/suite.router.ts +0 -3
  724. package/langwatch/src/server/api/routers/team.ts +48 -39
  725. package/langwatch/src/server/api/routers/tracesV2.schemas.ts +2 -0
  726. package/langwatch/src/server/api/routers/tracesV2.ts +76 -20
  727. package/langwatch/src/server/api/routers/user.ts +16 -6
  728. package/langwatch/src/server/api/routers/workflows.ts +0 -7
  729. package/langwatch/src/server/api/trpc.ts +1 -1
  730. package/langwatch/src/server/api-key/__tests__/api-key.service.legacy-ceiling.unit.test.ts +379 -0
  731. package/langwatch/src/server/api-key/__tests__/api-key.service.safety.unit.test.ts +3 -0
  732. package/langwatch/src/server/api-key/__tests__/api-key.service.unit.test.ts +3 -0
  733. package/langwatch/src/server/api-key/api-key.service.ts +63 -22
  734. package/langwatch/src/server/api-router.ts +5 -3
  735. package/langwatch/src/server/app-layer/__tests__/tracing.unit.test.ts +142 -0
  736. package/langwatch/src/server/app-layer/clients/clickhouse/__tests__/cold-scan-detector.coverage.unit.test.ts +2 -0
  737. package/langwatch/src/server/app-layer/clients/clickhouse/windowed-read.ts +15 -0
  738. package/langwatch/src/server/app-layer/dependencies.ts +8 -0
  739. package/langwatch/src/server/app-layer/evaluations/repositories/__tests__/evaluation-run.resolver-window.unit.test.ts +103 -0
  740. package/langwatch/src/server/app-layer/evaluations/repositories/evaluation-run.clickhouse.repository.ts +35 -1
  741. package/langwatch/src/server/app-layer/groups/group.service.ts +37 -0
  742. package/langwatch/src/server/app-layer/groups/repositories/group.prisma.repository.ts +9 -0
  743. package/langwatch/src/server/app-layer/groups/repositories/group.repository.ts +8 -0
  744. package/langwatch/src/server/app-layer/langy/__tests__/langyConversationMemory.unit.test.ts +1 -1
  745. package/langwatch/src/server/app-layer/langy/__tests__/langyTurnContext.unit.test.ts +0 -0
  746. package/langwatch/src/server/app-layer/langy/langyConversationMemory.ts +1 -1
  747. package/langwatch/src/server/app-layer/logs/repositories/__tests__/canonical-log-record.clickhouse.repository.unit.test.ts +54 -0
  748. package/langwatch/src/server/app-layer/logs/repositories/canonical-log-record.clickhouse.repository.ts +29 -12
  749. package/langwatch/src/server/app-layer/ops/__tests__/integration/pending-counter-reconcile.integration.test.ts +240 -0
  750. package/langwatch/src/server/app-layer/ops/__tests__/integration/replay-full-rebuild.integration.test.ts +390 -0
  751. package/langwatch/src/server/app-layer/ops/__tests__/replay.service.unit.test.ts +105 -1
  752. package/langwatch/src/server/app-layer/ops/replay.service.ts +47 -0
  753. package/langwatch/src/server/app-layer/ops/repositories/__tests__/queue.redis.repository.reconcile-pending.unit.test.ts +752 -0
  754. package/langwatch/src/server/app-layer/ops/repositories/queue.redis.repository.ts +597 -48
  755. package/langwatch/src/server/app-layer/organizations/__tests__/organization.service.unit.test.ts +1 -0
  756. package/langwatch/src/server/app-layer/organizations/organization.service.ts +16 -0
  757. package/langwatch/src/server/app-layer/organizations/repositories/organization.prisma.repository.ts +63 -2
  758. package/langwatch/src/server/app-layer/organizations/repositories/organization.repository.ts +15 -0
  759. package/langwatch/src/server/app-layer/presets.ts +27 -13
  760. package/langwatch/src/server/app-layer/projects/__tests__/project-service-update.unit.test.ts +100 -0
  761. package/langwatch/src/server/app-layer/projects/project.service.ts +145 -6
  762. package/langwatch/src/server/app-layer/projects/repositories/project.prisma.repository.ts +2 -16
  763. package/langwatch/src/server/app-layer/projects/repositories/project.repository.ts +2 -13
  764. package/langwatch/src/server/app-layer/simulations/__tests__/scenario-run-export-sweep.integration.test.ts +370 -0
  765. package/langwatch/src/server/app-layer/simulations/repositories/simulation.clickhouse.repository.ts +302 -7
  766. package/langwatch/src/server/app-layer/simulations/repositories/simulation.repository.ts +62 -0
  767. package/langwatch/src/server/app-layer/subscription/__tests__/composite-plan-provider.unit.test.ts +2 -28
  768. package/langwatch/src/server/app-layer/subscription/__tests__/self-hosted-plan-provider.unit.test.ts +101 -0
  769. package/langwatch/src/server/app-layer/subscription/self-hosted-plan-provider.ts +34 -0
  770. package/langwatch/src/server/app-layer/teams/team.service.ts +27 -0
  771. package/langwatch/src/server/app-layer/traces/__tests__/claude-code-span-enrichment.unit.test.ts +179 -0
  772. package/langwatch/src/server/app-layer/traces/__tests__/coding-agent-span-filter.unit.test.ts +50 -0
  773. package/langwatch/src/server/app-layer/traces/__tests__/coding-agent-transcript.derivation.unit.test.ts +331 -0
  774. package/langwatch/src/server/app-layer/traces/__tests__/trace-io-extraction.service.unit.test.ts +20 -0
  775. package/langwatch/src/server/app-layer/traces/canonicalisation/__tests__/structuredIO.test.ts +22 -1
  776. package/langwatch/src/server/app-layer/traces/canonicalisation/extractors/__tests__/claudeCode.unit.test.ts +217 -0
  777. package/langwatch/src/server/app-layer/traces/canonicalisation/extractors/__tests__/codex.unit.test.ts +133 -0
  778. package/langwatch/src/server/app-layer/traces/canonicalisation/extractors/__tests__/vercel.unit.test.ts +79 -0
  779. package/langwatch/src/server/app-layer/traces/canonicalisation/extractors/_constants.ts +9 -0
  780. package/langwatch/src/server/app-layer/traces/canonicalisation/extractors/claudeCode.ts +429 -6
  781. package/langwatch/src/server/app-layer/traces/canonicalisation/extractors/codex.ts +158 -70
  782. package/langwatch/src/server/app-layer/traces/canonicalisation/extractors/vercel.ts +26 -8
  783. package/langwatch/src/server/app-layer/traces/claude-code-span-enrichment.ts +89 -1
  784. package/langwatch/src/server/app-layer/traces/coding-agent-span-filter.ts +23 -1
  785. package/langwatch/src/server/app-layer/traces/coding-agent-transcript.derivation.ts +330 -75
  786. package/langwatch/src/server/app-layer/traces/repositories/__tests__/span-storage.resolver-window.unit.test.ts +108 -0
  787. package/langwatch/src/server/app-layer/traces/repositories/__tests__/trace-list.clickhouse.repository.integration.test.ts +31 -2
  788. package/langwatch/src/server/app-layer/traces/repositories/span-storage.clickhouse.repository.ts +36 -1
  789. package/langwatch/src/server/app-layer/traces/repositories/trace-list.clickhouse.repository.ts +7 -0
  790. package/langwatch/src/server/app-layer/traces/trace-io-extraction.service.ts +8 -1
  791. package/langwatch/src/server/app-layer/traces/trace-list.service.ts +10 -0
  792. package/langwatch/src/server/app-layer/tracing.ts +47 -0
  793. package/langwatch/src/server/app-layer/usage/usage.service.ts +0 -80
  794. package/langwatch/src/server/better-auth/__tests__/hooks.test.ts +72 -0
  795. package/langwatch/src/server/better-auth/__tests__/index.test.ts +31 -9
  796. package/langwatch/src/server/better-auth/__tests__/resetRecoversOauthUser.test.ts +128 -0
  797. package/langwatch/src/server/better-auth/__tests__/ssoGate.hook.test.ts +321 -0
  798. package/langwatch/src/server/better-auth/hooks.ts +46 -1
  799. package/langwatch/src/server/better-auth/index.ts +123 -284
  800. package/langwatch/src/server/clickhouse/__tests__/replicatedEngineGuard.unit.test.ts +301 -0
  801. package/langwatch/src/server/clickhouse/goose.ts +8 -0
  802. package/langwatch/src/server/clickhouse/migrations/00064_replicate_gateway_budget_scope_totals.sql +291 -0
  803. package/langwatch/src/server/clickhouse/migrations/00065_replicate_trace_analytics_rollup.sql +143 -0
  804. package/langwatch/src/server/clickhouse/migrations/00066_replicate_evaluation_analytics_rollup.sql +115 -0
  805. package/langwatch/src/server/datasets/__tests__/dataset-chunking.unit.test.ts +0 -0
  806. package/langwatch/src/server/evaluations/evaluators.generated.ts +83 -63
  807. package/langwatch/src/server/event-sourcing/pipeline/__tests__/staticBuilder.validations.unit.test.ts +46 -0
  808. package/langwatch/src/server/event-sourcing/pipeline/processManagerDefinition.ts +14 -0
  809. package/langwatch/src/server/event-sourcing/pipeline/staticBuilder.ts +8 -0
  810. package/langwatch/src/server/event-sourcing/pipelines/automations/subscribers/__tests__/graphTriggerActivity.groupKey.unit.test.ts +55 -0
  811. package/langwatch/src/server/event-sourcing/pipelines/automations/subscribers/graphTriggerActivity.subscriber.ts +23 -0
  812. package/langwatch/src/server/event-sourcing/pipelines/blob-maintenance/process-manager/blobCleanup.process.ts +6 -4
  813. package/langwatch/src/server/event-sourcing/pipelines/coding-agent-processing/schemas/constants.ts +6 -4
  814. package/langwatch/src/server/event-sourcing/pipelines/evaluation-processing/pipeline.ts +9 -1
  815. package/langwatch/src/server/event-sourcing/pipelines/log-processing/__tests__/logCommandCoalescing.unit.test.ts +174 -0
  816. package/langwatch/src/server/event-sourcing/pipelines/log-processing/pipeline.ts +7 -0
  817. package/langwatch/src/server/event-sourcing/pipelines/log-processing/schemas/constants.ts +19 -0
  818. package/langwatch/src/server/event-sourcing/pipelines/metric-processing/__tests__/metricCommandCoalescing.unit.test.ts +137 -0
  819. package/langwatch/src/server/event-sourcing/pipelines/metric-processing/pipeline.ts +7 -0
  820. package/langwatch/src/server/event-sourcing/pipelines/metric-processing/schemas/constants.ts +19 -0
  821. package/langwatch/src/server/event-sourcing/pipelines/trace-processing/__tests__/aiSdkStructuredOutput.integration.test.ts +199 -0
  822. package/langwatch/src/server/event-sourcing/pipelines/trace-processing/pipeline.ts +9 -1
  823. package/langwatch/src/server/event-sourcing/pipelines/trace-processing/projections/__tests__/spanStorageGroupKey.unit.test.ts +98 -0
  824. package/langwatch/src/server/event-sourcing/pipelines/trace-processing/projections/__tests__/traceSummaryClaudeCodeLift.unit.test.ts +187 -1
  825. package/langwatch/src/server/event-sourcing/pipelines/trace-processing/projections/spanStorage.mapProjection.ts +10 -1
  826. package/langwatch/src/server/event-sourcing/pipelines/trace-processing/projections/spanStorageGroupKey.ts +63 -0
  827. package/langwatch/src/server/event-sourcing/pipelines/trace-processing/projections/traceSummary.foldProjection.ts +85 -18
  828. package/langwatch/src/server/event-sourcing/pipelines/trace-processing/reactors/__tests__/projectMetadata.groupKey.unit.test.ts +140 -0
  829. package/langwatch/src/server/event-sourcing/pipelines/trace-processing/reactors/projectMetadata.reactor.ts +23 -0
  830. package/langwatch/src/server/event-sourcing/projections/__tests__/projectionRouter.mapReactorCollapse.unit.test.ts +260 -0
  831. package/langwatch/src/server/event-sourcing/projections/foldProjection.types.ts +6 -3
  832. package/langwatch/src/server/event-sourcing/projections/global/__tests__/billingMeterDispatch.groupKey.unit.test.ts +139 -0
  833. package/langwatch/src/server/event-sourcing/projections/global/billingMeterDispatch.reactor.ts +27 -1
  834. package/langwatch/src/server/event-sourcing/projections/projectionRouter.ts +58 -41
  835. package/langwatch/src/server/event-sourcing/queues/groupQueue/__tests__/blobSweeper.integration.test.ts +149 -0
  836. package/langwatch/src/server/event-sourcing/queues/groupQueue/__tests__/groupQueue.decodeDrop.integration.test.ts +12 -1
  837. package/langwatch/src/server/event-sourcing/queues/groupQueue/__tests__/groupQueue.integration.test.ts +45 -0
  838. package/langwatch/src/server/event-sourcing/queues/groupQueue/blobSweeper.ts +130 -22
  839. package/langwatch/src/server/event-sourcing/queues/groupQueue/scripts.ts +46 -0
  840. package/langwatch/src/server/event-sourcing/replay/__tests__/traceAnalyticsRollupReplay.integration.test.ts +356 -0
  841. package/langwatch/src/server/event-sourcing/replay/replayService.ts +7 -0
  842. package/langwatch/src/server/event-sourcing/services/queues/__tests__/queueManager.commandGroupKey.test.ts +114 -2
  843. package/langwatch/src/server/event-sourcing/services/queues/queueManager.ts +13 -9
  844. package/langwatch/src/server/experiments-v3/execution/__tests__/buildTargetMetadata.unit.test.ts +93 -0
  845. package/langwatch/src/server/experiments-v3/execution/__tests__/orchestratorStorageDispatch.unit.test.ts +57 -0
  846. package/langwatch/src/server/experiments-v3/execution/__tests__/resultMapper.test.ts +180 -13
  847. package/langwatch/src/server/experiments-v3/execution/orchestrator.ts +40 -8
  848. package/langwatch/src/server/experiments-v3/execution/resultMapper.ts +81 -22
  849. package/langwatch/src/server/experiments-v3/execution/types.ts +8 -0
  850. package/langwatch/src/server/export/scenario-runs/__tests__/csv-serializer.unit.test.ts +732 -0
  851. package/langwatch/src/server/export/scenario-runs/__tests__/scenario-run-export.service.unit.test.ts +303 -0
  852. package/langwatch/src/server/export/scenario-runs/csv-serializer.ts +383 -0
  853. package/langwatch/src/server/export/scenario-runs/errors.ts +44 -0
  854. package/langwatch/src/server/export/scenario-runs/scenario-run-export.service.ts +200 -0
  855. package/langwatch/src/server/export/scenario-runs/types.ts +64 -0
  856. package/langwatch/src/server/featureFlag/frontendFeatureFlags.ts +4 -0
  857. package/langwatch/src/server/featureFlag/registry.ts +7 -0
  858. package/langwatch/src/server/gateway/virtualKey.service.ts +2 -2
  859. package/langwatch/src/server/license-enforcement/__tests__/constants.unit.test.ts +2 -10
  860. package/langwatch/src/server/license-enforcement/__tests__/license-enforcement.repository.integration.test.ts +17 -194
  861. package/langwatch/src/server/license-enforcement/__tests__/license-enforcement.repository.unit.test.ts +3 -301
  862. package/langwatch/src/server/license-enforcement/__tests__/license-enforcement.service.unit.test.ts +51 -137
  863. package/langwatch/src/server/license-enforcement/__tests__/license-limit-guard.unit.test.ts +46 -13
  864. package/langwatch/src/server/license-enforcement/__tests__/usage-stats.service.unit.test.ts +1 -3
  865. package/langwatch/src/server/license-enforcement/constants.ts +0 -26
  866. package/langwatch/src/server/license-enforcement/index.ts +0 -5
  867. package/langwatch/src/server/license-enforcement/license-enforcement.repository.ts +4 -227
  868. package/langwatch/src/server/license-enforcement/license-enforcement.service.ts +0 -52
  869. package/langwatch/src/server/license-enforcement/types.ts +8 -17
  870. package/langwatch/src/server/license-enforcement/usage-stats.service.ts +0 -32
  871. package/langwatch/src/server/modelProviders/__tests__/governanceSignup.providerScope.integration.test.ts +1 -1
  872. package/langwatch/src/server/rbac/__tests__/apiKeyCeilingStaleness.unit.test.ts +5 -0
  873. package/langwatch/src/server/rbac/__tests__/role-binding-resolver.ceiling.unit.test.ts +108 -3
  874. package/langwatch/src/server/rbac/role-binding-resolver.ts +147 -1
  875. package/langwatch/src/server/role/__tests__/role-service-rolebinding.unit.test.ts +2 -0
  876. package/langwatch/src/server/role/role.service.ts +15 -1
  877. package/langwatch/src/server/role-bindings/__tests__/role-binding.service.tenant.unit.test.ts +2 -0
  878. package/langwatch/src/server/role-bindings/personal-team-scope.ts +105 -0
  879. package/langwatch/src/server/role-bindings/role-binding.service.ts +10 -2
  880. package/langwatch/src/server/routes/__tests__/github-langy-install.integration.test.ts +1 -1
  881. package/langwatch/src/server/routes/auth.ts +6 -1
  882. package/langwatch/src/server/routes/github-langy.ts +1 -1
  883. package/langwatch/src/server/scenarios/__tests__/scenario-archive.integration.test.ts +11 -15
  884. package/langwatch/src/server/scenarios/scenario-run-category.ts +48 -0
  885. package/langwatch/src/server/stored-objects/__tests__/coerce-content-to-array.unit.test.ts +0 -0
  886. package/langwatch/src/server/stored-objects/__tests__/scenario-events-ingest.integration.test.ts +2 -6
  887. package/langwatch/src/server/teams/team.service.ts +14 -1
  888. package/langwatch/src/server/tracer/types.ts +3 -0
  889. package/langwatch/src/server/traces/__tests__/trace-service-claude-enrichment.unit.test.ts +85 -0
  890. package/langwatch/src/server/traces/mappers/__tests__/trace-summary.mapper.test.ts +106 -0
  891. package/langwatch/src/server/traces/mappers/trace-summary.mapper.ts +59 -0
  892. package/langwatch/src/server/traces/projection/catalog.ts +3 -0
  893. package/langwatch/src/server/traces/trace.service.ts +21 -1
  894. package/langwatch/src/server/workers/__tests__/livenessThread.unit.test.ts +133 -0
  895. package/langwatch/src/server/workers/startWorkers.ts +250 -29
  896. package/langwatch/src/utils/__tests__/api.unit.test.ts +15 -15
  897. package/langwatch/src/utils/constants.ts +1 -0
  898. package/langwatch/src/utils/lambdaFetch.ts +0 -0
  899. package/langwatch/test-setup.ts +9 -0
  900. package/mcp-server/dist/chunk-FMQIE5DL.js +2328 -0
  901. package/mcp-server/dist/create-mcp-server.js +1 -1
  902. package/mcp-server/dist/discover-evaluator-schema-HYPFWGNN.js +2191 -0
  903. package/mcp-server/dist/http-server-UBX7YFXE.js +24466 -0
  904. package/mcp-server/dist/index.js +49 -33
  905. package/package.json +1 -1
  906. package/packages/server/dist/cli.cjs +1 -1
  907. package/langwatch/dist/client/assets/AddAnnotationQueueDrawer-BeOD83jA.js +0 -2
  908. package/langwatch/dist/client/assets/AddDatasetRecordDrawer-jHTYLVuB.js +0 -6
  909. package/langwatch/dist/client/assets/AddOrEditAnnotationScore-DW5VXwj8.js +0 -2
  910. package/langwatch/dist/client/assets/AddOrEditAnnotationScoreDrawer-6ycw-4n0.js +0 -2
  911. package/langwatch/dist/client/assets/AddOrEditDatasetDrawer-DKQT3n1Q.js +0 -3
  912. package/langwatch/dist/client/assets/AddParticipants-7HKlJHjI.js +0 -2
  913. package/langwatch/dist/client/assets/AgentHistoryDrawer-B1kjJyfj.js +0 -2
  914. package/langwatch/dist/client/assets/AgentHttpEditorDrawer-Dkex2eS8.js +0 -5
  915. package/langwatch/dist/client/assets/AgentListDrawer-B-ab-fJ_.js +0 -2
  916. package/langwatch/dist/client/assets/AgentTypeSelectorDrawer-CBUwY7Q0.js +0 -2
  917. package/langwatch/dist/client/assets/AgentWorkflowEditorDrawer-DZr-iX29.js +0 -2
  918. package/langwatch/dist/client/assets/AgentWorkflowTargetEditorDrawer-C1AYXbvP.js +0 -2
  919. package/langwatch/dist/client/assets/AiGatewayLayout-BFUOyL-l.js +0 -2
  920. package/langwatch/dist/client/assets/AnnotationsTable-CnwGxhJg.js +0 -2
  921. package/langwatch/dist/client/assets/AreaChart-BZjKjRMD.js +0 -2
  922. package/langwatch/dist/client/assets/AutomationDrawer-BTtX7UXo.js +0 -112
  923. package/langwatch/dist/client/assets/BatchEvaluationSummary-CFBL50E9.js +0 -2
  924. package/langwatch/dist/client/assets/BudgetEditDrawer-DhNs7V2e.js +0 -2
  925. package/langwatch/dist/client/assets/CartesianChart-CgGSWzzH.js +0 -54
  926. package/langwatch/dist/client/assets/CascadeArchiveDialog-BOcl2osO.js +0 -2
  927. package/langwatch/dist/client/assets/ChartTooltip-BKs8as3o.js +0 -4
  928. package/langwatch/dist/client/assets/ChatWindow-B-UHoZDM.js +0 -5
  929. package/langwatch/dist/client/assets/CodeEvaluatorEditorDrawer-jdmrD4H5.js +0 -9
  930. package/langwatch/dist/client/assets/CodexCodingDefaultsAsk-CKLyE8Ty.js +0 -2
  931. package/langwatch/dist/client/assets/ColorfulBlockIcons-Ctm_Gy50.js +0 -6
  932. package/langwatch/dist/client/assets/ColumnTypeIcon-Bh1MI0_N.js +0 -2
  933. package/langwatch/dist/client/assets/ConfirmDialog-CbyD4lof.js +0 -2
  934. package/langwatch/dist/client/assets/ContactSalesBlock-3LFiXNMY.js +0 -2
  935. package/langwatch/dist/client/assets/Conversation-C27uRW0p.js +0 -2
  936. package/langwatch/dist/client/assets/CopyInput-BJ8UDgiW.js +0 -2
  937. package/langwatch/dist/client/assets/CopyableInputWithPrefix-DhfQEE7R.js +0 -2
  938. package/langwatch/dist/client/assets/CreateProjectDrawer-f6ESIihF.js +0 -2
  939. package/langwatch/dist/client/assets/CreateTeamDrawer-CsScDzr3.js +0 -2
  940. package/langwatch/dist/client/assets/CustomGraph-DOp8hQmM.js +0 -2
  941. package/langwatch/dist/client/assets/DashboardLayout-BhHe0vIT.js +0 -96
  942. package/langwatch/dist/client/assets/DashboardNameDrawer-WriiQpWZ.js +0 -2
  943. package/langwatch/dist/client/assets/DataPrivacyRuleDrawer-BWcEQSs7.js +0 -2
  944. package/langwatch/dist/client/assets/DatasetEditorTable-BLbB_Sn-.js +0 -2
  945. package/langwatch/dist/client/assets/DatasetPickerList-CDIBTAQW.js +0 -2
  946. package/langwatch/dist/client/assets/DatasetPreviewTable-UuBrd6hv.js +0 -2
  947. package/langwatch/dist/client/assets/DatasetSelector-DJI4ZOko.js +0 -2
  948. package/langwatch/dist/client/assets/DefaultModelOverrideDrawer-DfGbPivl.js +0 -2
  949. package/langwatch/dist/client/assets/DeleteConfirmationDialog-w7WZ7lHP.js +0 -2
  950. package/langwatch/dist/client/assets/DocsLinks-vsvIA7dY.js +0 -2
  951. package/langwatch/dist/client/assets/DynamicZodForm-lW0sHL84.js +0 -2
  952. package/langwatch/dist/client/assets/EditAutomationFilterDrawer-UZGlf7Jf.js +0 -3
  953. package/langwatch/dist/client/assets/EditModelProviderDrawer-FxE8Cjfj.js +0 -4
  954. package/langwatch/dist/client/assets/EditProjectDrawer-DvGgMwQg.js +0 -2
  955. package/langwatch/dist/client/assets/EmojiPickerModal-DOTbYgFl.js +0 -3
  956. package/langwatch/dist/client/assets/EnterpriseLockedSurface-CM8Sj7hf.js +0 -2
  957. package/langwatch/dist/client/assets/ErrorBarContext-Bpz3-JDH.js +0 -2
  958. package/langwatch/dist/client/assets/EvaluatorApiUsageDialog-Bnv6z6m_.js +0 -107
  959. package/langwatch/dist/client/assets/EvaluatorCategorySelectorDrawer-DPt4B9Ey.js +0 -2
  960. package/langwatch/dist/client/assets/EvaluatorEditorDrawer-C1OQ89no.js +0 -2
  961. package/langwatch/dist/client/assets/EvaluatorEditorShared-Dlnmyfw9.js +0 -43
  962. package/langwatch/dist/client/assets/EvaluatorHistoryDrawer-BFqreRNY.js +0 -2
  963. package/langwatch/dist/client/assets/EvaluatorListDrawer-B5GkvEER.js +0 -2
  964. package/langwatch/dist/client/assets/EvaluatorMappingsSection-uZ95zEz_.js +0 -2
  965. package/langwatch/dist/client/assets/EvaluatorSelection-CLClnlPT.js +0 -2
  966. package/langwatch/dist/client/assets/EvaluatorSelectionBox-VWh5DBap.js +0 -2
  967. package/langwatch/dist/client/assets/EvaluatorTypeSelectorContent-BTrBItgE.js +0 -2
  968. package/langwatch/dist/client/assets/EvaluatorTypeSelectorDrawer-0T-zwQQZ.js +0 -2
  969. package/langwatch/dist/client/assets/ExecutionState-BPNxLkdI.js +0 -2
  970. package/langwatch/dist/client/assets/FeatureFlagsDrawer-CpSauosT.js +0 -2
  971. package/langwatch/dist/client/assets/FieldInfoTooltip-BlO6fteF.js +0 -2
  972. package/langwatch/dist/client/assets/FieldsFilters-B46wbf2n.js +0 -2
  973. package/langwatch/dist/client/assets/FilterDisplay-BzhnJIar.js +0 -2
  974. package/langwatch/dist/client/assets/FilterSidebar-CbZF27X2.js +0 -2
  975. package/langwatch/dist/client/assets/FormatMoney-vCZvmGG1.js +0 -2
  976. package/langwatch/dist/client/assets/FoundryDrawer-DskBXiS5.js +0 -2
  977. package/langwatch/dist/client/assets/FullLogo-Db9M_uOO.js +0 -2
  978. package/langwatch/dist/client/assets/GovernanceLayout-DiDbO74a.js +0 -2
  979. package/langwatch/dist/client/assets/GraphsLayout-BCvqg3RK.js +0 -2
  980. package/langwatch/dist/client/assets/GroupBindingInputRow-DQP7aETW.js +0 -2
  981. package/langwatch/dist/client/assets/GuardrailsDrawer-CHV6LBxp.js +0 -91
  982. package/langwatch/dist/client/assets/History-hXXVv0A2.js +0 -17
  983. package/langwatch/dist/client/assets/HorizontalFormControl-lYiaIlzD.js +0 -2
  984. package/langwatch/dist/client/assets/HoverableBigText-CIhevUVt.js +0 -2
  985. package/langwatch/dist/client/assets/InstallCliCard-CJKSPLJ_.js +0 -2
  986. package/langwatch/dist/client/assets/IntegratePaneShell-BpcA5j4P.js +0 -8
  987. package/langwatch/dist/client/assets/InviteMemberDrawer-DiuPqGoS.js +0 -2
  988. package/langwatch/dist/client/assets/IsolatedErrorBoundary-CZ4MnYEN.js +0 -2
  989. package/langwatch/dist/client/assets/LLMModelCostDrawer-D1G0lU1N.js +0 -2
  990. package/langwatch/dist/client/assets/LangyContextTarget-CIlp_Zew.js +0 -2
  991. package/langwatch/dist/client/assets/LegacyTracesDeprecationBanner-Cd0jbm0t.js +0 -2
  992. package/langwatch/dist/client/assets/Legend-DY68SncN.js +0 -6
  993. package/langwatch/dist/client/assets/Line-B2wakHWw.js +0 -2
  994. package/langwatch/dist/client/assets/LineChart-Bb84FSVR.js +0 -2
  995. package/langwatch/dist/client/assets/ListTable-8idtTXBY.js +0 -2
  996. package/langwatch/dist/client/assets/LoadingScreen-DQ62wqSN.js +0 -2
  997. package/langwatch/dist/client/assets/Markdown-C9extmbX.js +0 -35
  998. package/langwatch/dist/client/assets/MenuLink-CVzOs3K8.js +0 -2
  999. package/langwatch/dist/client/assets/MessageCard--GCYkR2M.js +0 -2
  1000. package/langwatch/dist/client/assets/MetadataTag-CSCPlbDN.js +0 -5
  1001. package/langwatch/dist/client/assets/ModelProviderCustomModelInput-DUwvNeux.js +0 -2
  1002. package/langwatch/dist/client/assets/ModelProviderScreen-BVBKstQm.js +0 -2
  1003. package/langwatch/dist/client/assets/ModelSelector-4R-dc-Ny.js +0 -2
  1004. package/langwatch/dist/client/assets/MyLayout-DCMYTSgX.js +0 -2
  1005. package/langwatch/dist/client/assets/NavigationFooter-1VNOUoV6.js +0 -2
  1006. package/langwatch/dist/client/assets/NewWorkflowForm-CsYSc1Vr.js +0 -2
  1007. package/langwatch/dist/client/assets/NoDataInfoBlock-C8x5bzL0.js +0 -2
  1008. package/langwatch/dist/client/assets/OnboardingContainer-e4kVlnyx.js +0 -2
  1009. package/langwatch/dist/client/assets/OnlineEvaluationDrawer-D2jYsSON.js +0 -2
  1010. package/langwatch/dist/client/assets/OpsPageShell-Ch1rtwuD.js +0 -2
  1011. package/langwatch/dist/client/assets/OttlEditor-baChQv3o.js +0 -3
  1012. package/langwatch/dist/client/assets/OverflownText-CY4Y__oL.js +0 -2
  1013. package/langwatch/dist/client/assets/ProjectAvatar-DtI9dT1f.js +0 -43
  1014. package/langwatch/dist/client/assets/ProjectLangyLayout-Cl7GB9zi.js +0 -82
  1015. package/langwatch/dist/client/assets/PromptEditorDrawer-BLIu4fKV.js +0 -2
  1016. package/langwatch/dist/client/assets/PromptListDrawer-BHC9jUMJ.js +0 -2
  1017. package/langwatch/dist/client/assets/PropertySectionTitle-Da2IdhM3.js +0 -37
  1018. package/langwatch/dist/client/assets/ProviderModelSelector-Cg5Lbc1U.js +0 -2
  1019. package/langwatch/dist/client/assets/ProviderScopeChips-D7HJW6Ht.js +0 -2
  1020. package/langwatch/dist/client/assets/PushToCopiesDialog-B_hvn6aW.js +0 -2
  1021. package/langwatch/dist/client/assets/ReferenceDot-DbjBc6Dh.js +0 -2
  1022. package/langwatch/dist/client/assets/RenderInputOutput-BntIB-Ae.js +0 -261
  1023. package/langwatch/dist/client/assets/ScenarioFormDrawer-BORe6ffA.js +0 -2
  1024. package/langwatch/dist/client/assets/ScenarioInputMappingSection-DVpK_-Qh.js +0 -2
  1025. package/langwatch/dist/client/assets/ScenarioRunDetailDrawer-MJhw77cs.js +0 -3
  1026. package/langwatch/dist/client/assets/ScopeChipPicker-B3xHf0Ii.js +0 -2
  1027. package/langwatch/dist/client/assets/SearchInput-C7YbWRUQ.js +0 -2
  1028. package/langwatch/dist/client/assets/SectionNavigationLayout-CIP_2Nxf.js +0 -2
  1029. package/langwatch/dist/client/assets/SelectDatasetDrawer-D_nCx9JT.js +0 -2
  1030. package/langwatch/dist/client/assets/SelectionActionBar-fxhOYCmO.js +0 -2
  1031. package/langwatch/dist/client/assets/SeriesFilterDrawer-zoWjjTxC.js +0 -2
  1032. package/langwatch/dist/client/assets/SettingsLayout-sixsNIX_.js +0 -2
  1033. package/langwatch/dist/client/assets/SetupWithAgentButton-Bhxb1yOj.js +0 -4
  1034. package/langwatch/dist/client/assets/ShikiCommandBox-CN1W-H2m.js +0 -5
  1035. package/langwatch/dist/client/assets/SpanDetails-DavcMtlr.js +0 -3
  1036. package/langwatch/dist/client/assets/SubscriptionPage-gPKGn08f.js +0 -2
  1037. package/langwatch/dist/client/assets/SuiteFormDrawer-C_5urLUY.js +0 -2
  1038. package/langwatch/dist/client/assets/TabButton-Cp8UA45p.js +0 -3
  1039. package/langwatch/dist/client/assets/TableCell-Cbtwk2YR.js +0 -2
  1040. package/langwatch/dist/client/assets/TargetTypeSelectorDrawer-B0xHR5hC.js +0 -2
  1041. package/langwatch/dist/client/assets/TeamForm-DvN0gccP.js +0 -2
  1042. package/langwatch/dist/client/assets/TeamUserRoleField-DD6lt16j.js +0 -2
  1043. package/langwatch/dist/client/assets/TraceDetails-DZtIKcmo.js +0 -9
  1044. package/langwatch/dist/client/assets/TraceDetailsDrawer-DKgyPTw5.js +0 -2
  1045. package/langwatch/dist/client/assets/TraceIdPeek-7T88rBev.js +0 -2
  1046. package/langwatch/dist/client/assets/TracesMapping-CYIUxk62.js +0 -2
  1047. package/langwatch/dist/client/assets/UpgradeModalContent-eXy8pG4-.js +0 -2
  1048. package/langwatch/dist/client/assets/UploadCSVDrawer-BTttuVHZ.js +0 -3
  1049. package/langwatch/dist/client/assets/VariablesSection-hjZ5pmeK.js +0 -2
  1050. package/langwatch/dist/client/assets/VersionBadge-BPxGh4w7.js +0 -2
  1051. package/langwatch/dist/client/assets/ViaClaudeDesktopScreen-B9EYtw_g.js +0 -1161
  1052. package/langwatch/dist/client/assets/ViewAutomationDrawer-H_lJU8lG.js +0 -2
  1053. package/langwatch/dist/client/assets/VirtualKeySecretReveal-5GeVsP9d.js +0 -54
  1054. package/langwatch/dist/client/assets/WelcomeLayout-CDTLOa4d.js +0 -2
  1055. package/langwatch/dist/client/assets/WithFeatureFlagGuard-OePuXWRG.js +0 -2
  1056. package/langwatch/dist/client/assets/WithPermissionGuard-Cr6Aljmy.js +0 -2
  1057. package/langwatch/dist/client/assets/WorkflowCard-SFB2TN6O.js +0 -2
  1058. package/langwatch/dist/client/assets/WorkflowSelectorForEvaluatorDrawer-C9JwDruB.js +0 -2
  1059. package/langwatch/dist/client/assets/_...path_-Cgdgmf5W.js +0 -2
  1060. package/langwatch/dist/client/assets/_Uint8Array-DZ50H-2q.js +0 -2
  1061. package/langwatch/dist/client/assets/__...path__-CwRP2Csi.js +0 -22
  1062. package/langwatch/dist/client/assets/_baseAssignValue-BqKt0w0a.js +0 -2
  1063. package/langwatch/dist/client/assets/_baseClone-DCKy3Vq2.js +0 -2
  1064. package/langwatch/dist/client/assets/_baseEach-BGeacxUS.js +0 -2
  1065. package/langwatch/dist/client/assets/_baseFor-BQgMStOx.js +0 -2
  1066. package/langwatch/dist/client/assets/_experiment_-UwR3aJGK.js +0 -2
  1067. package/langwatch/dist/client/assets/_id_-7nn1sxUS.js +0 -2
  1068. package/langwatch/dist/client/assets/_id_-BGN_cxTM.js +0 -2
  1069. package/langwatch/dist/client/assets/_id_-C39KWPCF.js +0 -2
  1070. package/langwatch/dist/client/assets/_id_-CLpZ89Xl.js +0 -2
  1071. package/langwatch/dist/client/assets/_id_-CYndCW2V.js +0 -2
  1072. package/langwatch/dist/client/assets/_id_-CfWpUbg4.js +0 -2
  1073. package/langwatch/dist/client/assets/_id_-npXkLrUc.js +0 -2
  1074. package/langwatch/dist/client/assets/_project_-B7G8spwK.js +0 -8
  1075. package/langwatch/dist/client/assets/_runId_-BSik_ZD4.js +0 -7
  1076. package/langwatch/dist/client/assets/_shell-BGaZUKLi.js +0 -2
  1077. package/langwatch/dist/client/assets/_slug_-BN6BJfW8.js +0 -17
  1078. package/langwatch/dist/client/assets/_slug_-C7DGk6aN.js +0 -2
  1079. package/langwatch/dist/client/assets/_slug_-DOlOZ10W.js +0 -2
  1080. package/langwatch/dist/client/assets/_team_-B9rXOt0D.js +0 -2
  1081. package/langwatch/dist/client/assets/_workflow_-BJIdrL-L.js +0 -25
  1082. package/langwatch/dist/client/assets/_workflow_-BKcndaRn.js +0 -3
  1083. package/langwatch/dist/client/assets/accept-CSdmIcux.js +0 -2
  1084. package/langwatch/dist/client/assets/activity-QICCt22J.js +0 -1
  1085. package/langwatch/dist/client/assets/agents--fK5G7M5.js +0 -2
  1086. package/langwatch/dist/client/assets/alerts-QICCt22J.js +0 -1
  1087. package/langwatch/dist/client/assets/all-yOqzcthm.js +0 -2
  1088. package/langwatch/dist/client/assets/analytics-CjMLTwIY.js +0 -2
  1089. package/langwatch/dist/client/assets/annotation-scores-sPTr7fKF.js +0 -2
  1090. package/langwatch/dist/client/assets/annotations-Ye3ttmrc.js +0 -2
  1091. package/langwatch/dist/client/assets/anomaly-rules-DwSc-85q.js +0 -2
  1092. package/langwatch/dist/client/assets/api-keys-CKyHUAXs.js +0 -4
  1093. package/langwatch/dist/client/assets/asaplangy-6A4CIIRR.js +0 -5
  1094. package/langwatch/dist/client/assets/audit-log-DQ9_D13G.js +0 -2
  1095. package/langwatch/dist/client/assets/auth-CHp-bSLm.js +0 -2
  1096. package/langwatch/dist/client/assets/authentication-CktawfTg.js +0 -2
  1097. package/langwatch/dist/client/assets/authorize-BSFPddoX.js +0 -2
  1098. package/langwatch/dist/client/assets/authorize-YWRIgnuS.js +0 -2
  1099. package/langwatch/dist/client/assets/automations-CI-QD_zf.js +0 -2
  1100. package/langwatch/dist/client/assets/automations-QICCt22J.js +0 -1
  1101. package/langwatch/dist/client/assets/billing-plans-DUVLJ_Sk.js +0 -2
  1102. package/langwatch/dist/client/assets/blank-CqHTkVM2.js +0 -2
  1103. package/langwatch/dist/client/assets/blobs-B_lHV3eu.js +0 -2
  1104. package/langwatch/dist/client/assets/blockDiagram-677ZJIJ3-CQSMftlX.js +0 -133
  1105. package/langwatch/dist/client/assets/budgets-D0yk2zkk.js +0 -3
  1106. package/langwatch/dist/client/assets/bug-reports-D48JQaYJ.js +0 -2
  1107. package/langwatch/dist/client/assets/cache-rules-BLbEe56I.js +0 -2
  1108. package/langwatch/dist/client/assets/choose-CR8H5_AF.js +0 -2
  1109. package/langwatch/dist/client/assets/chunk-EX3LRPZG-CULySKMF.js +0 -232
  1110. package/langwatch/dist/client/assets/chunk-FWX5IMBZ-vsHlz4qh.js +0 -3
  1111. package/langwatch/dist/client/assets/chunk-PUDLZKDR-ByJfzd90.js +0 -157
  1112. package/langwatch/dist/client/assets/chunk-RYQCIY6F-DW5yDiZP.js +0 -2
  1113. package/langwatch/dist/client/assets/chunk-V7JOEXUC-rGVlZXkP.js +0 -207
  1114. package/langwatch/dist/client/assets/classDiagram-OUVF2IWQ-DjpCOWYp.js +0 -2
  1115. package/langwatch/dist/client/assets/classDiagram-v2-EOCWNBFH-DjpCOWYp.js +0 -2
  1116. package/langwatch/dist/client/assets/codeAgentConfig-DlJOMg8p.js +0 -7
  1117. package/langwatch/dist/client/assets/codingDefaultSync-C3S2VHmn.js +0 -2
  1118. package/langwatch/dist/client/assets/configure-BPQgl6jf.js +0 -4
  1119. package/langwatch/dist/client/assets/constants-Bb5Vi_Bd.js +0 -2
  1120. package/langwatch/dist/client/assets/custom-D79e_fnJ.js +0 -12
  1121. package/langwatch/dist/client/assets/custom_evaluator-DgcItmbH.js +0 -31
  1122. package/langwatch/dist/client/assets/dagre-BqI7WPId.js +0 -2
  1123. package/langwatch/dist/client/assets/dagre-VKFMJZFB-BJj7ndf9.js +0 -5
  1124. package/langwatch/dist/client/assets/data-privacy-BuolZ3DI.js +0 -2
  1125. package/langwatch/dist/client/assets/data-retention-yWQxxUQF.js +0 -2
  1126. package/langwatch/dist/client/assets/datasets-u_OgZHiv.js +0 -2
  1127. package/langwatch/dist/client/assets/debounce-BJsF8wQY.js +0 -2
  1128. package/langwatch/dist/client/assets/defaultModelState-DY_b79Yj.js +0 -2
  1129. package/langwatch/dist/client/assets/dejaview-DSjI4vi2.js +0 -2
  1130. package/langwatch/dist/client/assets/departments-C3oaBPyA.js +0 -2
  1131. package/langwatch/dist/client/assets/devices-O_ZVZdxA.js +0 -2
  1132. package/langwatch/dist/client/assets/dist-Dd3SzC15.js +0 -6
  1133. package/langwatch/dist/client/assets/drawerFromUrl-DaNSDEzf.js +0 -2
  1134. package/langwatch/dist/client/assets/edit-CswmqyLU.js +0 -62
  1135. package/langwatch/dist/client/assets/email-suppressions-B8AuxWio.js +0 -2
  1136. package/langwatch/dist/client/assets/erDiagram-Q63AITRT-DIiR5G9i.js +0 -86
  1137. package/langwatch/dist/client/assets/error-nKFTkytv.js +0 -2
  1138. package/langwatch/dist/client/assets/errors-e711UMq7.js +0 -2
  1139. package/langwatch/dist/client/assets/evaluations-Cg9PywKJ.js +0 -2
  1140. package/langwatch/dist/client/assets/evaluations-xuA_g6-G.js +0 -2
  1141. package/langwatch/dist/client/assets/evaluators-6oHFfk5m.js +0 -146
  1142. package/langwatch/dist/client/assets/evaluators-CBPI9nP9.js +0 -2
  1143. package/langwatch/dist/client/assets/experiments-DHsdWtPG.js +0 -1
  1144. package/langwatch/dist/client/assets/feature-flags-e-cVnxOK.js +0 -2
  1145. package/langwatch/dist/client/assets/fetchSSE-5rVPow_l.js +0 -3
  1146. package/langwatch/dist/client/assets/fieldset-BNLAUiqD.js +0 -2
  1147. package/langwatch/dist/client/assets/flowDiagram-23GEKE2U-DlrfK-aL.js +0 -1
  1148. package/langwatch/dist/client/assets/forgot-password-B_FXHTn9.js +0 -2
  1149. package/langwatch/dist/client/assets/formatMoney-DRwvOSzZ.js +0 -2
  1150. package/langwatch/dist/client/assets/formatTargetOutput-CkKef3lk.js +0 -2
  1151. package/langwatch/dist/client/assets/foundry-U39hnXil.js +0 -477
  1152. package/langwatch/dist/client/assets/gateway-DZnsUBnP.js +0 -2
  1153. package/langwatch/dist/client/assets/getEvaluator-irVFciCL.js +0 -2
  1154. package/langwatch/dist/client/assets/getRadiusAndStrokeWidthFromDot-BFtcAGI_.js +0 -2
  1155. package/langwatch/dist/client/assets/governance-BBQIXSQ_.js +0 -2
  1156. package/langwatch/dist/client/assets/graphlib-Bg9XziCe.js +0 -2
  1157. package/langwatch/dist/client/assets/grid-DVy6ELOp.js +0 -2
  1158. package/langwatch/dist/client/assets/groups-DYnJ4U2W.js +0 -2
  1159. package/langwatch/dist/client/assets/guardrails-DdKPd-Zs.js +0 -2
  1160. package/langwatch/dist/client/assets/handled-error-CI7XXA3n.js +0 -2
  1161. package/langwatch/dist/client/assets/http-DSF_1QKT.js +0 -7
  1162. package/langwatch/dist/client/assets/identifierUtils-B50FmQLB.js +0 -2
  1163. package/langwatch/dist/client/assets/immer-CFru3D02.js +0 -14
  1164. package/langwatch/dist/client/assets/index-CPtTUYLD.js +0 -68
  1165. package/langwatch/dist/client/assets/ingestion-source-detail-BLfzu5Yv.js +0 -19
  1166. package/langwatch/dist/client/assets/ingestion-sources-BcwE_tRu.js +0 -12
  1167. package/langwatch/dist/client/assets/integrations-D220c59Q.js +0 -2
  1168. package/langwatch/dist/client/assets/isArrayLikeObject-DUy1V36n.js +0 -2
  1169. package/langwatch/dist/client/assets/isSymbol-COuSxi_J.js +0 -2
  1170. package/langwatch/dist/client/assets/langyHomeSuggestions-6NtCcdnH.js +0 -2
  1171. package/langwatch/dist/client/assets/license-Be6bs3wD.js +0 -2
  1172. package/langwatch/dist/client/assets/licenseStatusUtils-YSS0xL-G.js +0 -2
  1173. package/langwatch/dist/client/assets/lu-DlSq9Be4.js +0 -2
  1174. package/langwatch/dist/client/assets/map-7tkBBrDN.js +0 -2
  1175. package/langwatch/dist/client/assets/mappingValidation-C-AT88B0.js +0 -2
  1176. package/langwatch/dist/client/assets/me-BHRwGQAJ.js +0 -7
  1177. package/langwatch/dist/client/assets/me-DyaTjlbw.js +0 -2
  1178. package/langwatch/dist/client/assets/members-Dn5oJBlv.js +0 -2
  1179. package/langwatch/dist/client/assets/mermaid.core-krP_t-L5.js +0 -12
  1180. package/langwatch/dist/client/assets/messages-CN1bd906.js +0 -2
  1181. package/langwatch/dist/client/assets/metrics-Do8QhcIC.js +0 -2
  1182. package/langwatch/dist/client/assets/mindmap-definition-LN4V7U3C-DBef2D4I.js +0 -97
  1183. package/langwatch/dist/client/assets/model-costs-D6eiVgIz.js +0 -2
  1184. package/langwatch/dist/client/assets/model-providers-CiSkvGtd.js +0 -2
  1185. package/langwatch/dist/client/assets/modelProviderHelpers-P2Cogc-H.js +0 -2
  1186. package/langwatch/dist/client/assets/my-queue-D1aRcnMh.js +0 -2
  1187. package/langwatch/dist/client/assets/normalizeComparison-BY-r_dYf.js +0 -2
  1188. package/langwatch/dist/client/assets/not-found-BiyummjJ.js +0 -2
  1189. package/langwatch/dist/client/assets/now-flOUcolU.js +0 -2
  1190. package/langwatch/dist/client/assets/onboarding-D3dMDvS6.js +0 -2
  1191. package/langwatch/dist/client/assets/online-evaluations-Dk2ygUi2.js +0 -2
  1192. package/langwatch/dist/client/assets/ops-Djcw5_lX.js +0 -2
  1193. package/langwatch/dist/client/assets/organizations-F6Q6gYJ3.js +0 -2
  1194. package/langwatch/dist/client/assets/pages-BXwixFEM.js +0 -2
  1195. package/langwatch/dist/client/assets/persistence-DZOtzFnQ.js +0 -2
  1196. package/langwatch/dist/client/assets/personalProject-DMRX2-SI.js +0 -2
  1197. package/langwatch/dist/client/assets/plans-C_VYB2VX.js +0 -2
  1198. package/langwatch/dist/client/assets/preconditionFieldUtils-B7QfymK4.js +0 -2
  1199. package/langwatch/dist/client/assets/product-D0RNZ3Ls.js +0 -2
  1200. package/langwatch/dist/client/assets/project-ZTQzA2gY.js +0 -2
  1201. package/langwatch/dist/client/assets/projections-DocSauqq.js +0 -2
  1202. package/langwatch/dist/client/assets/projects-ClyGKBO9.js +0 -2
  1203. package/langwatch/dist/client/assets/promptHandle-Cen_6YRW.js +0 -2
  1204. package/langwatch/dist/client/assets/prompts-CLb2R5Fd.js +0 -8
  1205. package/langwatch/dist/client/assets/radio-group-CWz2nJi3.js +0 -2
  1206. package/langwatch/dist/client/assets/registry-B64xvGV5.js +0 -2
  1207. package/langwatch/dist/client/assets/reports-C-XbHSdJ.js +0 -2
  1208. package/langwatch/dist/client/assets/request-C3Wgq2B3.js +0 -2
  1209. package/langwatch/dist/client/assets/requirementDiagram-TGXJPOKE-9g84jNsR.js +0 -85
  1210. package/langwatch/dist/client/assets/reset-password-ohopJtIH.js +0 -2
  1211. package/langwatch/dist/client/assets/role-bindings-BQ31P1EO.js +0 -2
  1212. package/langwatch/dist/client/assets/roles-CQDx2TP6.js +0 -2
  1213. package/langwatch/dist/client/assets/routing-policies-uvNo9gfx.js +0 -5
  1214. package/langwatch/dist/client/assets/scenarios-CpA_eExG.js +0 -2
  1215. package/langwatch/dist/client/assets/scheduler-CgzNzJjP.js +0 -2
  1216. package/langwatch/dist/client/assets/schedules-QICCt22J.js +0 -1
  1217. package/langwatch/dist/client/assets/scim-BivWilDe.js +0 -2
  1218. package/langwatch/dist/client/assets/secrets-Dp2ang1r.js +0 -2
  1219. package/langwatch/dist/client/assets/segment-group-DQ4SkpwM.js +0 -2
  1220. package/langwatch/dist/client/assets/segmented-control-BNxU6DEN.js +0 -2
  1221. package/langwatch/dist/client/assets/select-D17PWjH9.js +0 -2
  1222. package/langwatch/dist/client/assets/send-Dd5105kW.js +0 -2
  1223. package/langwatch/dist/client/assets/sequenceView-FFm7w152.js +0 -5
  1224. package/langwatch/dist/client/assets/seriesOptions-CDRg_FIS.js +0 -1015
  1225. package/langwatch/dist/client/assets/settings-aFAaBCpo.js +0 -2
  1226. package/langwatch/dist/client/assets/setup-BqCpBMpq.js +0 -2
  1227. package/langwatch/dist/client/assets/shikiAdapter-CbWAxLvq.js +0 -3
  1228. package/langwatch/dist/client/assets/showSuiteRunError-B2iiQdeh.js +0 -2
  1229. package/langwatch/dist/client/assets/signin-C6AzSXTw.js +0 -2
  1230. package/langwatch/dist/client/assets/signup-Co9SguQP.js +0 -2
  1231. package/langwatch/dist/client/assets/stateDiagram-2N3HPSRC-CDfCuyr-.js +0 -2
  1232. package/langwatch/dist/client/assets/stateDiagram-v2-6OUMAXLB-mNUL4OCz.js +0 -2
  1233. package/langwatch/dist/client/assets/subscription-BYrIJoC0.js +0 -3
  1234. package/langwatch/dist/client/assets/subscriptions-CrupW2oH.js +0 -2
  1235. package/langwatch/dist/client/assets/suggestionUI-0NFK2m-V.js +0 -106
  1236. package/langwatch/dist/client/assets/swimlanes-5IMT3BWC-aY42sUsR.js +0 -3
  1237. package/langwatch/dist/client/assets/swimlanesDiagram-G3AALYLV-BQgl3Mwz.js +0 -9
  1238. package/langwatch/dist/client/assets/switch-DGatWO8v.js +0 -2
  1239. package/langwatch/dist/client/assets/switch-mtnuJtgJ.js +0 -2
  1240. package/langwatch/dist/client/assets/tabs-U8n5D55_.js +0 -2
  1241. package/langwatch/dist/client/assets/teams-CMzKSSEB.js +0 -2
  1242. package/langwatch/dist/client/assets/teams-DBNLpvFi.js +0 -2
  1243. package/langwatch/dist/client/assets/tool-catalog-DgWWHys3.js +0 -7
  1244. package/langwatch/dist/client/assets/toolIcons-DmISNQ_S.js +0 -2
  1245. package/langwatch/dist/client/assets/tooltip-gjZ4s2dt.js +0 -2
  1246. package/langwatch/dist/client/assets/topic-clustering-wc06nKYO.js +0 -2
  1247. package/langwatch/dist/client/assets/topics-DbjuJKH7.js +0 -2
  1248. package/langwatch/dist/client/assets/traceStore-By6b3pBZ.js +0 -55
  1249. package/langwatch/dist/client/assets/traces-DjQaBgiE.js +0 -289
  1250. package/langwatch/dist/client/assets/tracesMapping-DpjIOyAg.js +0 -3
  1251. package/langwatch/dist/client/assets/tracking-D4oUOPlm.js +0 -2
  1252. package/langwatch/dist/client/assets/types-CCALFpCT.js +0 -2
  1253. package/langwatch/dist/client/assets/types-DfJmP3wn.js +0 -2
  1254. package/langwatch/dist/client/assets/types-X7bcC-zw.js +0 -2
  1255. package/langwatch/dist/client/assets/usage-B3fH-bNu.js +0 -2
  1256. package/langwatch/dist/client/assets/usage-YeRzOlEs.js +0 -2
  1257. package/langwatch/dist/client/assets/use-generic-onboarding-flow-DZY28ya2.js +0 -2
  1258. package/langwatch/dist/client/assets/useActivePlan-fRQ_etI2.js +0 -2
  1259. package/langwatch/dist/client/assets/useAllPromptsForProject-DCZJ0_-p.js +0 -2
  1260. package/langwatch/dist/client/assets/useAnnotationQueues-ByLqaEs6.js +0 -2
  1261. package/langwatch/dist/client/assets/useAvailableEvaluators-BKFN_L8t.js +0 -2
  1262. package/langwatch/dist/client/assets/useCompoundLicenseCheck-BqNF-zzC.js +0 -2
  1263. package/langwatch/dist/client/assets/useCyclingVerb-DSHVFfHS.js +0 -2
  1264. package/langwatch/dist/client/assets/useDepartmentColumn-D1DF_PiG.js +0 -2
  1265. package/langwatch/dist/client/assets/useEvaluationsV3Store-Bc6Q5CKo.js +0 -2
  1266. package/langwatch/dist/client/assets/useExportTraces-BqLmfd8N.js +0 -2
  1267. package/langwatch/dist/client/assets/useFeatureFlag-Do1Ecu3l.js +0 -2
  1268. package/langwatch/dist/client/assets/useInviteActions-DwPlKWmS.js +0 -2
  1269. package/langwatch/dist/client/assets/useLicenseEnforcement-DOI0dcqD.js +0 -2
  1270. package/langwatch/dist/client/assets/usePersonalContext-CggG6KVI.js +0 -2
  1271. package/langwatch/dist/client/assets/useProjectSpanNames-jFO9A6Re.js +0 -2
  1272. package/langwatch/dist/client/assets/useProjectsForCopy-B8F_BY79.js +0 -2
  1273. package/langwatch/dist/client/assets/useRunViaApiTabs-Cr0_nbbp.js +0 -50
  1274. package/langwatch/dist/client/assets/useShowLangy-kmjRxLHs.js +0 -2
  1275. package/langwatch/dist/client/assets/useSimulationUpdateListener-BQB61L8b.js +0 -2
  1276. package/langwatch/dist/client/assets/useTargetName-nPyk8kf-.js +0 -2
  1277. package/langwatch/dist/client/assets/useTargetNameMap-C2bPHyhD.js +0 -2
  1278. package/langwatch/dist/client/assets/useTraceDetailsDrawer-CL82mHNA.js +0 -2
  1279. package/langwatch/dist/client/assets/useTraceUpdateListener-r6BQdcuk.js +0 -2
  1280. package/langwatch/dist/client/assets/useUrlScopeFilter-DFlXMn0U.js +0 -2
  1281. package/langwatch/dist/client/assets/useWorkflowStore-DGHQA8ai.js +0 -8
  1282. package/langwatch/dist/client/assets/users-D5W8Qjjj.js +0 -2
  1283. package/langwatch/dist/client/assets/users-DFyHT5UO.js +0 -2
  1284. package/langwatch/dist/client/assets/users-rKylpyh9.js +0 -2
  1285. package/langwatch/dist/client/assets/v3-NB4P-Pc3.js +0 -2
  1286. package/langwatch/dist/client/assets/variables-DF2_abiB.js +0 -396
  1287. package/langwatch/dist/client/assets/viewStore-DtvCfAUF.js +0 -2
  1288. package/langwatch/dist/client/assets/virtual-keys-DW1kPrjW.js +0 -2
  1289. package/langwatch/dist/client/assets/welcome-DJsfSWej.js +0 -16
  1290. package/langwatch/dist/client/assets/wizard-D2X_QMNx.js +0 -2
  1291. package/langwatch/dist/client/assets/workbench-fZ1KK4fN.js +0 -2
  1292. package/langwatch/dist/client/assets/workflows-CY65pvqY.js +0 -3
  1293. package/langwatch/dist/client/assets/wrap-DlWOPhPw.js +0 -2
  1294. package/langwatch/src/app/api/middleware/__tests__/resource-limit-enforcement.integration.test.ts +0 -278
  1295. package/langwatch/src/app/api/middleware/__tests__/resource-limit.unit.test.ts +0 -299
  1296. package/langwatch/src/app/api/middleware/resource-limit.ts +0 -147
  1297. package/langwatch/src/app/api/scenario-events/[[...route]]/scenario-set-limit.ts +0 -54
  1298. package/langwatch/src/app/api/scenario-events/__tests__/scenario-set-limit.unit.test.ts +0 -195
  1299. package/langwatch/src/app/api/scenario-events/scenario-set-limit.stress.test.ts +0 -216
  1300. package/langwatch/src/components/__tests__/UpgradeModal.unit.test.tsx +0 -103
  1301. package/langwatch/src/hooks/useCompoundLicenseCheck.ts +0 -41
  1302. package/langwatch/src/pages/api/experiment/init.stress.test.ts +0 -130
  1303. package/langwatch/src/server/api/routers/__tests__/project.create.planLimit.integration.test.ts +0 -370
  1304. package/langwatch/src/server/api/routers/__tests__/team.createTeamWithMembers.planLimit.integration.test.ts +0 -251
  1305. package/langwatch/src/server/app-layer/usage/__tests__/usage-service-checkScenarioSetLimit.unit.test.ts +0 -322
  1306. package/langwatch/src/server/app-layer/usage/errors.ts +0 -24
  1307. package/langwatch/src/server/auditLog.ts +0 -49
  1308. package/langwatch/src/server/better-auth/__tests__/fallbackName.test.ts +0 -141
  1309. package/langwatch/src/server/better-auth/__tests__/parseIssuerUrl.test.ts +0 -58
  1310. package/langwatch/src/server/better-auth/__tests__/sso.test.ts +0 -125
  1311. package/langwatch/src/server/better-auth/sso.ts +0 -47
  1312. package/langwatch/src/server/event-sourcing/pipelines/trace-processing/projections/__tests__/traceSummary.coalesce.unit.test.ts +0 -33
  1313. package/langwatch/src/server/license-enforcement/__tests__/limit-breakdown.unit.test.ts +0 -101
  1314. package/langwatch/src/server/license-enforcement/__tests__/personal-workspaces-excluded.integration.test.ts +0 -391
  1315. package/langwatch/src/server/license-enforcement/enforcement.middleware.ts +0 -103
  1316. package/langwatch/src/server/license-enforcement/limit-breakdown.ts +0 -96
  1317. package/langwatch/src/server/routes/scim.ts +0 -583
  1318. package/langwatch/src/server/routes/webhooks.ts +0 -168
  1319. package/langwatch/src/server/scim/__tests__/scim-token.service.unit.test.ts +0 -109
  1320. package/langwatch/src/server/scim/__tests__/scim.costCenter.integration.test.ts +0 -170
  1321. package/langwatch/src/server/scim/__tests__/scim.service.unit.test.ts +0 -414
  1322. package/langwatch/src/server/scim/scim-group.service.ts +0 -464
  1323. package/langwatch/src/server/scim/scim-role-resolver.ts +0 -47
  1324. package/langwatch/src/server/scim/scim-role-resolver.unit.test.ts +0 -92
  1325. package/langwatch/src/server/scim/scim-token.service.ts +0 -70
  1326. package/langwatch/src/server/scim/scim.service.ts +0 -553
  1327. package/langwatch/src/server/scim/scim.types.ts +0 -148
  1328. package/mcp-server/dist/chunk-DSB77X63.js +0 -2328
  1329. package/mcp-server/dist/discover-evaluator-schema-OFEADIJY.js +0 -2175
  1330. package/mcp-server/dist/http-server-YVM4PRTC.js +0 -24466
@@ -1,2 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{dn as n,i as r,n as i}from"./portal-Sdfvrza9.js";import{t as a}from"./jsx-runtime-CFwixLRt.js";import{t as o}from"./skeleton-0JSrjbwm.js";import{t as s}from"./heading-C0sACr0w.js";import{n as c,t as l}from"./v-stack-hkuSkmCA.js";import{An as u}from"./ProjectAvatar-DtI9dT1f.js";import{t as d}from"./tooltip-gjZ4s2dt.js";import{d as f,n as p}from"./toaster-BsYkODqs.js";import{K as m,L as h}from"./Markdown-C9extmbX.js";import{t as g}from"./grid-DVy6ELOp.js";import{_,b as v,f as y,h as b,m as x,s as S,u as C,v as w,x as T,y as E}from"./DashboardLayout-BhHe0vIT.js";import{a as D,i as O,n as k,r as ee}from"./alert-CPsXih3K.js";import{r as A,t as j}from"./card-By_Mbslh.js";import{t as M}from"./spacer-C38e7o6r.js";import{n as N}from"./api-l6Cnm0vQ.js";import{t as P}from"./chart-no-axes-column-DyIZPb-w.js";import{t as te}from"./funnel-pN529WXj.js";import{t as ne}from"./square-pen-BeEJLs7r.js";import{r as F}from"./next-router-CWLrMXvP.js";import{Qn as I,Sr as L,Vt as R,W as z,t as B}from"./index-CPtTUYLD.js";import{t as V}from"./FilterDisplay-BzhnJIar.js";import{t as H}from"./WithPermissionGuard-Cr6Aljmy.js";import{t as U}from"./seriesIdentifier-nW7BcYaa.js";import{t as W}from"./CustomGraph-DOp8hQmM.js";import{a as G,t as K}from"./FilterSidebar-CbZF27X2.js";import{t as q}from"./GraphsLayout-BCvqg3RK.js";var J=f(`grid-3x3`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M3 15h18`,key:`5xshup`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),Y=e=>{let t=[],n=new Set,r=(e,t)=>`${e},${t}`,i=(e,t,i,a)=>{for(let o=e;o<e+i;o++)for(let e=t;e<t+a;e++)if(o>=2||n.has(r(o,e)))return!1;return!0},a=(e,t,i,a)=>{for(let o=e;o<e+i;o++)for(let e=t;e<t+a;e++)n.add(r(o,e))};for(let n of e){let{colSpan:e,rowSpan:r}=n,o=!1,s=0;for(;!o;){for(let c=0;c<=2-e;c++)if(i(c,s,e,r)){a(c,s,e,r),t.push({graphId:n.id,gridColumn:c,gridRow:s,colSpan:e,rowSpan:r}),o=!0;break}o||s++}}return t},X=e(t()),Z=a(),Q=[{value:`1x1`,label:`Small (1x1)`,colSpan:1,rowSpan:1},{value:`2x1`,label:`Wide (2x1)`,colSpan:2,rowSpan:1},{value:`1x2`,label:`Tall (1x2)`,colSpan:1,rowSpan:2},{value:`2x2`,label:`Large (2x2)`,colSpan:2,rowSpan:2}],re=(e,t)=>e===2&&t===2?`2x2`:e===2&&t===1?`2x1`:e===1&&t===2?`1x2`:`1x1`;function ie({graphId:e,projectSlug:t,dashboardId:n,colSpan:i,rowSpan:a,onSizeChange:o,onDelete:s,isDeleting:c}){let l=F(),d=re(i,a),f=`/${t}/analytics/custom/${e}${n?`?dashboard=${n}`:``}`;return(0,Z.jsxs)(h.Root,{children:[(0,Z.jsx)(h.Trigger,{asChild:!0,children:(0,Z.jsx)(r,{variant:`ghost`,loading:c,children:(0,Z.jsx)(u,{})})}),(0,Z.jsxs)(h.Content,{children:[(0,Z.jsxs)(h.Item,{value:`edit`,onClick:()=>{l.push(f)},children:[(0,Z.jsx)(ne,{}),` Edit Graph`]}),(0,Z.jsxs)(h.Root,{positioning:{placement:`right-start`,gutter:2},children:[(0,Z.jsxs)(h.TriggerItem,{value:`size`,children:[(0,Z.jsx)(J,{}),` Size (`,d,`)`]}),(0,Z.jsx)(h.Content,{children:Q.map(e=>(0,Z.jsxs)(h.Item,{value:e.value,onClick:()=>o(e.value),children:[e.label,e.value===d&&` ✓`]},e.value))})]}),(0,Z.jsxs)(h.Item,{value:`delete`,color:`red.600`,onClick:s,children:[(0,Z.jsx)(m,{}),` Delete Graph`]})]})]})}function ae({filters:e}){return(0,Z.jsx)(d,{content:(0,Z.jsx)(l,{align:`start`,backgroundColor:`black`,color:`white`,height:`100%`,textWrap:`wrap`,children:(0,Z.jsx)(V,{filters:e})}),positioning:{placement:`top`},showArrow:!0,children:(0,Z.jsx)(n,{padding:1,children:(0,Z.jsx)(te,{width:16,style:{minWidth:16}})})})}function oe({graphId:e,name:t,graph:a,projectSlug:o,dashboardId:c,colSpan:l,rowSpan:u,filters:f,trigger:p,isDragging:m,dragAttributes:h,dragListeners:g,onSizeChange:_,onDelete:v,isDeleting:y}){let{openDrawer:b}=z(),x=(0,X.useMemo)(()=>{if(t?.trim())return t;if(a&&typeof a==`object`&&`series`in a){let e=a;if(e.series&&e.series.length>0){let t=e.series.map(e=>e.name).filter(Boolean).join(`, `);if(t)return t.replace(/,([^,]*)$/,` and$1`)}}return`Untitled Graph`},[t,a]),S=(0,X.useMemo)(()=>U(a,0),[a]),C=(0,X.useMemo)(()=>!!(f&&typeof f==`object`&&Object.keys(f).length>0),[f]),w=!!(e&&e!==`custom`&&a),T=()=>{p&&b(`automation`,{automationId:p.id,prefilledGraphId:e,prefilledSeriesName:S})};return(0,Z.jsxs)(i,{...h,...g,align:`center`,marginBottom:4,cursor:m?`grabbing`:`grab`,children:[(0,Z.jsx)(P,{color:`orange`}),(0,Z.jsx)(s,{size:`sm`,marginLeft:2,children:x}),(0,Z.jsx)(M,{}),w&&(0,Z.jsx)(Z.Fragment,{children:p?.active?(0,Z.jsx)(d,{content:`Edit alert`,positioning:{placement:`top`},showArrow:!0,children:(0,Z.jsx)(n,{role:`button`,"aria-label":`Edit alert`,tabIndex:0,padding:1,cursor:`pointer`,color:`fg`,onClick:e=>{e.stopPropagation(),T()},onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),T())},children:(0,Z.jsx)(L,{width:18})})}):(0,Z.jsxs)(r,{variant:`outline`,colorPalette:`gray`,size:`sm`,onClick:t=>{t.stopPropagation(),b(`automation`,{prefilledGraphId:e,prefilledSeriesName:S})},children:[(0,Z.jsx)(L,{width:16}),`Add alert`]})}),C&&(0,Z.jsx)(ae,{filters:f}),(0,Z.jsx)(ie,{graphId:e,projectSlug:o,dashboardId:c,colSpan:l,rowSpan:u,onSizeChange:_,onDelete:v,isDeleting:y})]})}function $({graph:e,projectSlug:t,dashboardId:r,onDelete:i,onSizeChange:a,isDeleting:o}){let{attributes:s,listeners:c,setNodeRef:l,transform:u,transition:d,isDragging:f}=y({id:e.id}),p={transform:T.Transform.toString(u),transition:d,opacity:f?.5:1,gridColumn:`span ${e.colSpan}`,gridRow:`span ${e.rowSpan}`},m=e.rowSpan===2?600:300;return(0,Z.jsx)(n,{ref:l,style:p,minWidth:0,children:(0,Z.jsx)(A,{height:`full`,minWidth:0,children:(0,Z.jsxs)(j,{height:`full`,display:`flex`,flexDirection:`column`,minWidth:0,overflow:`hidden`,children:[(0,Z.jsx)(oe,{graphId:e.id,name:e.name,graph:e.graph,projectSlug:t,dashboardId:r,colSpan:e.colSpan,rowSpan:e.rowSpan,filters:e.filters,trigger:e.trigger,isDragging:f,dragAttributes:s,dragListeners:c,onSizeChange:a,onDelete:i,isDeleting:o}),(0,Z.jsx)(n,{flex:1,minHeight:0,children:(0,Z.jsx)(W,{input:{...e.graph,height:m},filters:e.filters},e.id)})]})})})}function se({graphs:e,projectSlug:t,dashboardId:r,onGraphDelete:a,onGraphSizeChange:o,onGraphsReorder:s,deletingGraphId:l}){let[u,d]=(0,X.useState)(null),f=e.find(e=>e.id===u),p=v(E(_,{activationConstraint:{distance:8}}));return(0,Z.jsxs)(x,{sensors:p,collisionDetection:w,onDragStart:e=>{d(e.active.id)},onDragEnd:t=>{d(null);let{active:n,over:r}=t;if(!r||n.id===r.id)return;let i=e.findIndex(e=>e.id===n.id),a=e.findIndex(e=>e.id===r.id);if(i!==-1&&a!==-1){let t=[...e],[n]=t.splice(i,1);t.splice(a,0,n),s(Y(t))}},children:[(0,Z.jsx)(S,{items:e.map(e=>e.id),strategy:C,children:(0,Z.jsx)(g,{templateColumns:`repeat(2, 1fr)`,autoRows:`minmax(350px, auto)`,gap:5,width:`100%`,children:e.map(e=>(0,Z.jsx)($,{graph:e,projectSlug:t,dashboardId:r,onDelete:()=>a(e.id),onSizeChange:t=>o(e.id,t),isDeleting:l===e.id},e.id))})}),(0,Z.jsx)(b,{children:f?(0,Z.jsx)(A,{boxShadow:`xl`,opacity:.9,width:f.colSpan===2?`600px`:`300px`,height:f.rowSpan===2?`400px`:`200px`,children:(0,Z.jsxs)(j,{children:[(0,Z.jsxs)(i,{align:`center`,marginBottom:4,children:[(0,Z.jsx)(P,{color:`orange`}),(0,Z.jsx)(c,{marginLeft:2,fontSize:`md`,fontWeight:`bold`,children:f.name})]}),(0,Z.jsx)(n,{flex:1,background:`gray.50`,borderRadius:`md`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`fg.subtle`,height:`calc(100% - 40px)`,children:`Chart preview`})]})}):null})]})}function ce(){let{project:e}=R(),{showFilters:t}=G(),a=F(),s=e?.id??``,u=a.query.dashboard,d=N.dashboards.getOrCreateFirst.useQuery({projectId:s},{enabled:!!s&&!u}),f=u??d.data?.id,m=N.dashboards.getAll.useQuery({projectId:s},{enabled:!!s}),h=m.data?.find(e=>e.id===f)?.name??`Reports`,g=N.graphs.getAll.useQuery({projectId:s,dashboardId:f},{enabled:!!s&&!!f}),_=N.graphs.delete.useMutation(),v=N.graphs.updateLayout.useMutation(),y=N.graphs.batchUpdateLayouts.useMutation(),b=N.dashboards.rename.useMutation(),x=e=>{f&&b.mutate({projectId:s,dashboardId:f,name:e},{onSuccess:()=>{m.refetch()},onError:()=>{p.create({title:`Error renaming dashboard`,type:`error`,duration:3e3,meta:{closable:!0}})}})},S=e=>{_.mutate({projectId:s,id:e},{onSuccess:()=>{g.refetch()},onError:()=>{p.create({title:`Error deleting graph`,type:`error`,duration:3e3,meta:{closable:!0}})}})},C=(e,t)=>{let n=Q.find(e=>e.value===t);if(!n)return;let r=g.data?.find(t=>t.id===e);r&&v.mutate({projectId:s,graphId:e,gridColumn:r.gridColumn,gridRow:r.gridRow,colSpan:n.colSpan,rowSpan:n.rowSpan},{onSuccess:()=>{let t=g.data?.map(t=>t.id===e?{...t,colSpan:n.colSpan,rowSpan:n.rowSpan}:t);if(t){let e=Y(t);y.mutate({projectId:s,layouts:e},{onSuccess:()=>{g.refetch()}})}},onError:()=>{p.create({title:`Error updating graph size`,type:`error`,duration:3e3,meta:{closable:!0}})}})},w=e=>{y.mutate({projectId:s,layouts:e},{onSuccess:()=>{g.refetch()},onError:()=>{p.create({title:`Error reordering graphs`,type:`error`,duration:3e3,meta:{closable:!0}})}})},T=g.data??[],E=T.length===0&&!g.isLoading,A=f?`/${e?.slug}/analytics/custom?dashboard=${f}`:`/${e?.slug}/analytics/custom`;return(0,Z.jsxs)(q,{title:h,analyticsHeaderProps:{isEditable:!0,onTitleSave:x},extraHeaderButtons:e?(0,Z.jsx)(B,{href:A,asChild:!0,children:(0,Z.jsxs)(r,{colorPalette:`orange`,size:`sm`,children:[(0,Z.jsx)(I,{}),` Add chart`]})}):null,children:[E&&(0,Z.jsxs)(O,{status:`info`,borderStartWidth:`4px`,borderStartColor:`colorPalette.solid`,marginBottom:6,children:[(0,Z.jsx)(ee,{alignSelf:`start`}),(0,Z.jsxs)(l,{align:`start`,children:[(0,Z.jsx)(D,{children:`Add your custom graphs here`}),(0,Z.jsx)(k,{children:(0,Z.jsxs)(c,{as:`span`,children:[`You haven`,`'`,`t set up any custom graphs yet. Click + Add chart to get started.`]})})]})]}),(0,Z.jsxs)(i,{align:`start`,gap:6,width:`full`,children:[(0,Z.jsx)(n,{flex:1,children:g.isLoading?(0,Z.jsx)(o,{height:`300px`}):(0,Z.jsx)(se,{graphs:T,projectSlug:e?.slug??``,dashboardId:f??void 0,onGraphDelete:S,onGraphSizeChange:C,onGraphsReorder:w,deletingGraphId:_.isLoading?_.variables?.id??null:null})}),t?(0,Z.jsx)(K,{}):null]})]})}var le=H(`analytics:view`)(ce);export{le as default};
2
- //# sourceMappingURL=reports-C-XbHSdJ.js.map
@@ -1,2 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{dn as n,i as r,n as i}from"./portal-Sdfvrza9.js";import{t as a}from"./jsx-runtime-CFwixLRt.js";import{t as o}from"./heading-C0sACr0w.js";import{n as s,t as c}from"./v-stack-hkuSkmCA.js";import{c as l,f as u,l as d}from"./toaster-BsYkODqs.js";import{a as f,i as p,n as m,r as h}from"./alert-CPsXih3K.js";import{t as g}from"./errors-e711UMq7.js";import{t as _}from"./spacer-C38e7o6r.js";import{tt as v}from"./immer-CFru3D02.js";import{n as y}from"./api-l6Cnm0vQ.js";import{t as b}from"./mail-C7uKOOUF.js";import{r as x}from"./next-router-CWLrMXvP.js";import{Ut as S,Vt as C,Wn as w}from"./index-CPtTUYLD.js";import{t as T}from"./next-head-B6Im7q_p.js";import{t as E}from"./WithFeatureFlagGuard-OePuXWRG.js";import{t as D}from"./formatBudgetUsd-BYb25IkY.js";import{t as O}from"./MyLayout-DCMYTSgX.js";var k=e(t()),A=a(),j=e=>D(e),M=e=>typeof e==`string`?e:Array.isArray(e)&&typeof e[0]==`string`?e[0]:``,N=e=>{if(!e)return null;let t=Number.parseFloat(e);return Number.isFinite(t)?t:null};function P(){let e=x(),{data:t}=S(),{organization:a}=C({redirectToOnboarding:!1,redirectToProjectOnboarding:!1}),E=M(e.query.scope),D=M(e.query.scope_id),P=M(e.query.limit_usd),I=M(e.query.spent_usd),L=M(e.query.period),R=N(P),z=N(I),B=L||`current period`,V=!!(E&&D&&R!==null&&z!==null),H=y.user.personalBudget.useQuery({organizationId:a?.id??``},{enabled:!!a,refetchOnWindowFocus:!1}),U=H.data&&`adminEmail`in H.data?H.data.adminEmail??null:null,[W,G]=(0,k.useState)(``),[K,q]=(0,k.useState)(`idle`),[J,Y]=(0,k.useState)(!1),X=y.user.requestBudgetIncrease.useMutation({onSuccess:()=>{q(`sent`)},onError:e=>{q(`idle`),g({error:e,fallbackTitle:`Couldn't send your request`}),Y(!0)}}),Z=!!t&&!a;return(0,A.jsxs)(O,{children:[(0,A.jsx)(T,{children:(0,A.jsx)(`title`,{children:`Request budget increase · LangWatch`})}),(0,A.jsxs)(c,{align:`stretch`,gap:6,width:`full`,maxWidth:`640px`,children:[(0,A.jsxs)(i,{alignItems:`end`,children:[(0,A.jsxs)(c,{align:`start`,gap:0,children:[(0,A.jsx)(o,{as:`h2`,size:`lg`,children:`Request budget increase`}),(0,A.jsx)(s,{color:`fg.muted`,fontSize:`sm`,children:`Send the request to your organization admin with the current spend and limit context.`})]}),(0,A.jsx)(_,{})]}),Z&&(0,A.jsxs)(p,{status:`info`,borderRadius:`md`,children:[(0,A.jsx)(h,{}),(0,A.jsxs)(n,{children:[(0,A.jsx)(f,{children:`Personal account — no admin to email`}),(0,A.jsx)(m,{fontSize:`sm`,children:`Budget-increase requests only apply to organization-managed accounts. Personal accounts manage their own limits in Settings.`})]})]}),!Z&&K===`sent`&&(0,A.jsxs)(p,{status:`success`,borderRadius:`md`,children:[(0,A.jsx)(h,{children:(0,A.jsx)(d,{size:18})}),(0,A.jsxs)(n,{children:[(0,A.jsx)(f,{children:`Request sent`}),(0,A.jsxs)(m,{fontSize:`sm`,children:[`We emailed `,U??`your organization admin`,` with the spend context. They'll review and update the budget in Settings → AI Governance → Budgets.`]})]})]}),!Z&&K!==`sent`&&J&&(0,A.jsxs)(p,{status:`error`,borderRadius:`md`,children:[(0,A.jsx)(h,{children:(0,A.jsx)(l,{size:18})}),(0,A.jsxs)(n,{children:[(0,A.jsx)(f,{children:`We couldn't send your request`}),(0,A.jsxs)(m,{fontSize:`sm`,children:[`Try again, or`,` `,U?(0,A.jsxs)(A.Fragment,{children:[`email`,` `,(0,A.jsx)(u,{href:`mailto:${U}`,children:U}),` `,`directly.`]}):`contact your organization admin directly.`]})]})]}),!Z&&K!==`sent`&&(0,A.jsxs)(A.Fragment,{children:[V?(0,A.jsxs)(n,{borderWidth:`1px`,borderColor:`border.muted`,borderRadius:`md`,padding:4,backgroundColor:`bg.subtle`,children:[(0,A.jsx)(s,{fontSize:`xs`,color:`fg.muted`,textTransform:`uppercase`,letterSpacing:`wider`,marginBottom:3,children:`Context (carried from the gateway block)`}),(0,A.jsxs)(c,{align:`stretch`,gap:2,children:[(0,A.jsx)(F,{label:`Scope`,value:E}),(0,A.jsx)(F,{label:`Period`,value:B}),(0,A.jsx)(F,{label:`Spent so far`,value:j(z??0),tone:`red`}),(0,A.jsx)(F,{label:`Current limit`,value:j(R??0)})]})]}):(0,A.jsxs)(p,{status:`warning`,borderRadius:`md`,children:[(0,A.jsx)(h,{children:(0,A.jsx)(l,{size:18})}),(0,A.jsxs)(n,{children:[(0,A.jsx)(f,{children:`No context attached`}),(0,A.jsx)(m,{fontSize:`sm`,children:`The page was opened without a budget block context. You can still send a free-form message — the admin will review and decide.`})]})]}),(0,A.jsxs)(n,{borderWidth:`1px`,borderColor:`border.muted`,borderRadius:`md`,padding:4,children:[(0,A.jsxs)(i,{marginBottom:2,fontSize:`sm`,color:`fg.muted`,children:[(0,A.jsx)(b,{size:14}),(0,A.jsxs)(s,{children:[`To: `,(0,A.jsx)(`strong`,{children:U??`your organization admin`})]})]}),(0,A.jsx)(s,{fontSize:`xs`,color:`fg.muted`,marginBottom:3,children:`Optional message — explain why you need the increase`}),(0,A.jsx)(v,{placeholder:`e.g. Need it for the demo on Friday — usually under limit`,value:W,onChange:e=>G(e.target.value),minHeight:`100px`,resize:`vertical`})]}),(0,A.jsxs)(i,{children:[(0,A.jsx)(_,{}),(0,A.jsxs)(r,{colorPalette:`orange`,onClick:()=>{a&&(Y(!1),q(`submitting`),X.mutate({organizationId:a.id,scope:E,scopeId:D,limitUsd:P,spentUsd:I,period:L||void 0,message:W.trim()?W.trim():void 0}))},disabled:K===`submitting`||!a||H.isLoading,loading:K===`submitting`,children:[(0,A.jsx)(w,{size:16}),`Send request`]})]})]})]})]})}function F({label:e,value:t,tone:n=`default`}){return(0,A.jsxs)(i,{fontSize:`sm`,children:[(0,A.jsx)(s,{color:`fg.muted`,minWidth:`120px`,children:e}),(0,A.jsx)(s,{fontFamily:`mono`,color:n===`red`?`red.500`:`fg`,fontWeight:n===`red`?`semibold`:`normal`,children:t})]})}var I=E(`release_ui_ai_governance_enabled`,{bypassOnboardingRedirect:!0})(P);export{I as default};
2
- //# sourceMappingURL=request-C3Wgq2B3.js.map
@@ -1,85 +0,0 @@
1
- import{n as e,t}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{t as n}from"./src-7ugfKe9P.js";import{H as r,K as i,U as a,a as o,b as s,v as c,w as l,x as u,y as d}from"./chunk-WYO6CB5R-DrXopwXN.js";import{g as f}from"./chunk-ICXQ74PX-CBGBbB0s.js";import"./chunk-HOUHSVGY-KCI5VyfN.js";import"./chunk-Q4XR5HBZ-Ckl7D0pA.js";import"./chunk-7BUUIJ7U-Bb538aSH.js";import"./chunk-OGEWGWER-tXhe91qF.js";import{t as p}from"./chunk-XXDRQBXY-B-zyTdG8.js";import{t as m}from"./chunk-VR4S4FIN-kgt10gXB.js";import"./chunk-C7G6YPKG-Cczu3qbd.js";import"./chunk-ZGVPDNZ5-_vNOpeVi.js";import"./chunk-52WLFC77-CyjMpySG.js";import{r as h,t as g}from"./chunk-FWX5IMBZ-vsHlz4qh.js";var _=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,3],r=[1,4],i=[1,5],a=[1,6],o=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],s=[1,22],c=[2,7],l=[1,26],u=[1,27],d=[1,28],f=[1,29],p=[1,33],m=[1,34],h=[1,35],g=[1,36],_=[1,37],v=[1,38],y=[1,24],b=[1,31],x=[1,32],S=[1,30],C=[1,39],w=[1,40],T=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],E=[1,61],D=[89,90],O=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],k=[27,29],ee=[1,70],A=[1,71],te=[1,72],ne=[1,73],re=[1,74],ie=[1,75],ae=[1,76],j=[1,83],M=[1,80],N=[1,84],P=[1,85],F=[1,86],I=[1,87],L=[1,88],R=[1,89],z=[1,90],B=[1,91],V=[1,92],oe=[5,8,9,11,13,21,22,23,24,27,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],H=[63,64],se=[1,101],ce=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],U=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],W=[1,110],G=[1,106],K=[1,107],q=[1,108],J=[1,109],Y=[1,111],X=[1,116],Z=[1,117],Q=[1,114],$=[1,115],le={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,direction:17,styleStatement:18,classDefStatement:19,classStatement:20,direction_tb:21,direction_bt:22,direction_rl:23,direction_lr:24,requirementType:25,requirementName:26,STRUCT_START:27,requirementBody:28,STYLE_SEPARATOR:29,idList:30,ID:31,COLONSEP:32,id:33,TEXT:34,text:35,RISK:36,riskLevel:37,VERIFYMTHD:38,verifyType:39,STRUCT_STOP:40,REQUIREMENT:41,FUNCTIONAL_REQUIREMENT:42,INTERFACE_REQUIREMENT:43,PERFORMANCE_REQUIREMENT:44,PHYSICAL_REQUIREMENT:45,DESIGN_CONSTRAINT:46,LOW_RISK:47,MED_RISK:48,HIGH_RISK:49,VERIFY_ANALYSIS:50,VERIFY_DEMONSTRATION:51,VERIFY_INSPECTION:52,VERIFY_TEST:53,ELEMENT:54,elementName:55,elementBody:56,TYPE:57,type:58,DOCREF:59,ref:60,END_ARROW_L:61,relationship:62,LINE:63,END_ARROW_R:64,CONTAINS:65,COPIES:66,DERIVES:67,SATISFIES:68,VERIFIES:69,REFINES:70,TRACES:71,CLASSDEF:72,stylesOpt:73,CLASS:74,ALPHA:75,COMMA:76,STYLE:77,style:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,MINUS:86,LABEL:87,SEMICOLON:88,unqString:89,qString:90,$accept:0,$end:1},terminals_:{2:`error`,5:`NEWLINE`,6:`RD`,8:`EOF`,9:`acc_title`,10:`acc_title_value`,11:`acc_descr`,12:`acc_descr_value`,13:`acc_descr_multiline_value`,21:`direction_tb`,22:`direction_bt`,23:`direction_rl`,24:`direction_lr`,27:`STRUCT_START`,29:`STYLE_SEPARATOR`,31:`ID`,32:`COLONSEP`,34:`TEXT`,36:`RISK`,38:`VERIFYMTHD`,40:`STRUCT_STOP`,41:`REQUIREMENT`,42:`FUNCTIONAL_REQUIREMENT`,43:`INTERFACE_REQUIREMENT`,44:`PERFORMANCE_REQUIREMENT`,45:`PHYSICAL_REQUIREMENT`,46:`DESIGN_CONSTRAINT`,47:`LOW_RISK`,48:`MED_RISK`,49:`HIGH_RISK`,50:`VERIFY_ANALYSIS`,51:`VERIFY_DEMONSTRATION`,52:`VERIFY_INSPECTION`,53:`VERIFY_TEST`,54:`ELEMENT`,57:`TYPE`,59:`DOCREF`,61:`END_ARROW_L`,63:`LINE`,64:`END_ARROW_R`,65:`CONTAINS`,66:`COPIES`,67:`DERIVES`,68:`SATISFIES`,69:`VERIFIES`,70:`REFINES`,71:`TRACES`,72:`CLASSDEF`,74:`CLASS`,75:`ALPHA`,76:`COMMA`,77:`STYLE`,80:`NUM`,81:`COLON`,82:`UNIT`,83:`SPACE`,84:`BRKT`,85:`PCT`,86:`MINUS`,87:`LABEL`,88:`SEMICOLON`,89:`unqString`,90:`qString`},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[17,1],[17,1],[17,1],[17,1],[14,5],[14,7],[28,5],[28,5],[28,5],[28,5],[28,2],[28,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[37,1],[37,1],[37,1],[39,1],[39,1],[39,1],[39,1],[15,5],[15,7],[56,5],[56,5],[56,2],[56,1],[16,5],[16,5],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[19,3],[20,3],[20,3],[30,1],[30,3],[30,1],[30,3],[18,3],[73,1],[73,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[26,1],[26,1],[33,1],[33,1],[35,1],[35,1],[55,1],[55,1],[58,1],[58,1],[60,1],[60,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 4:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 5:case 6:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:r.setDirection(`TB`);break;case 18:r.setDirection(`BT`);break;case 19:r.setDirection(`RL`);break;case 20:r.setDirection(`LR`);break;case 21:r.addRequirement(a[s-3],a[s-4]);break;case 22:r.addRequirement(a[s-5],a[s-6]),r.setClass([a[s-5]],a[s-3]);break;case 23:r.setNewReqId(a[s-2]);break;case 24:r.setNewReqText(a[s-2]);break;case 25:r.setNewReqRisk(a[s-2]);break;case 26:r.setNewReqVerifyMethod(a[s-2]);break;case 29:this.$=r.RequirementType.REQUIREMENT;break;case 30:this.$=r.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=r.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=r.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=r.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=r.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=r.RiskLevel.LOW_RISK;break;case 36:this.$=r.RiskLevel.MED_RISK;break;case 37:this.$=r.RiskLevel.HIGH_RISK;break;case 38:this.$=r.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=r.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=r.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=r.VerifyType.VERIFY_TEST;break;case 42:r.addElement(a[s-3]);break;case 43:r.addElement(a[s-5]),r.setClass([a[s-5]],a[s-3]);break;case 44:r.setNewElementType(a[s-2]);break;case 45:r.setNewElementDocRef(a[s-2]);break;case 48:r.addRelationship(a[s-2],a[s],a[s-4]);break;case 49:r.addRelationship(a[s-2],a[s-4],a[s]);break;case 50:this.$=r.Relationships.CONTAINS;break;case 51:this.$=r.Relationships.COPIES;break;case 52:this.$=r.Relationships.DERIVES;break;case 53:this.$=r.Relationships.SATISFIES;break;case 54:this.$=r.Relationships.VERIFIES;break;case 55:this.$=r.Relationships.REFINES;break;case 56:this.$=r.Relationships.TRACES;break;case 57:this.$=a[s-2],r.defineClass(a[s-1],a[s]);break;case 58:r.setClass(a[s-1],a[s]);break;case 59:r.setClass([a[s-2]],a[s]);break;case 60:case 62:this.$=[a[s]];break;case 61:case 63:this.$=a[s-2].concat([a[s]]);break;case 64:this.$=a[s-2],r.setCssStyle(a[s-1],a[s]);break;case 65:this.$=[a[s]];break;case 66:a[s-2].push(a[s]),this.$=a[s-2];break;case 68:this.$=a[s-1]+a[s];break}},`anonymous`),table:[{3:1,4:2,6:n,9:r,11:i,13:a},{1:[3]},{3:8,4:2,5:[1,7],6:n,9:r,11:i,13:a},{5:[1,9]},{10:[1,10]},{12:[1,11]},t(o,[2,6]),{3:12,4:2,6:n,9:r,11:i,13:a},{1:[2,2]},{4:17,5:s,7:13,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},t(o,[2,4]),t(o,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:s,7:42,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:43,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:44,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:45,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:46,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:47,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:48,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:49,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:50,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},t(T,[2,17]),t(T,[2,18]),t(T,[2,19]),t(T,[2,20]),{30:60,33:62,75:E,89:C,90:w},{30:63,33:62,75:E,89:C,90:w},{30:64,33:62,75:E,89:C,90:w},t(D,[2,29]),t(D,[2,30]),t(D,[2,31]),t(D,[2,32]),t(D,[2,33]),t(D,[2,34]),t(O,[2,81]),t(O,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},t(k,[2,79]),t(k,[2,80]),{27:[1,67],29:[1,68]},t(k,[2,85]),t(k,[2,86]),{62:69,65:ee,66:A,67:te,68:ne,69:re,70:ie,71:ae},{62:77,65:ee,66:A,67:te,68:ne,69:re,70:ie,71:ae},{30:78,33:62,75:E,89:C,90:w},{73:79,75:j,76:M,78:81,79:82,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V},t(oe,[2,60]),t(oe,[2,62]),{73:93,75:j,76:M,78:81,79:82,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V},{30:94,33:62,75:E,76:M,89:C,90:w},{5:[1,95]},{30:96,33:62,75:E,89:C,90:w},{5:[1,97]},{30:98,33:62,75:E,89:C,90:w},{63:[1,99]},t(H,[2,50]),t(H,[2,51]),t(H,[2,52]),t(H,[2,53]),t(H,[2,54]),t(H,[2,55]),t(H,[2,56]),{64:[1,100]},t(T,[2,59],{76:M}),t(T,[2,64],{76:se}),{33:103,75:[1,102],89:C,90:w},t(ce,[2,65],{79:104,75:j,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V}),t(U,[2,67]),t(U,[2,69]),t(U,[2,70]),t(U,[2,71]),t(U,[2,72]),t(U,[2,73]),t(U,[2,74]),t(U,[2,75]),t(U,[2,76]),t(U,[2,77]),t(U,[2,78]),t(T,[2,57],{76:se}),t(T,[2,58],{76:M}),{5:W,28:105,31:G,34:K,36:q,38:J,40:Y},{27:[1,112],76:M},{5:X,40:Z,56:113,57:Q,59:$},{27:[1,118],76:M},{33:119,89:C,90:w},{33:120,89:C,90:w},{75:j,78:121,79:82,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V},t(oe,[2,61]),t(oe,[2,63]),t(U,[2,68]),t(T,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:W,28:126,31:G,34:K,36:q,38:J,40:Y},t(T,[2,28]),{5:[1,127]},t(T,[2,42]),{32:[1,128]},{32:[1,129]},{5:X,40:Z,56:130,57:Q,59:$},t(T,[2,47]),{5:[1,131]},t(T,[2,48]),t(T,[2,49]),t(ce,[2,66],{79:104,75:j,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V}),{33:132,89:C,90:w},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},t(T,[2,27]),{5:W,28:145,31:G,34:K,36:q,38:J,40:Y},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},t(T,[2,46]),{5:X,40:Z,56:152,57:Q,59:$},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},t(T,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},t(T,[2,43]),{5:W,28:159,31:G,34:K,36:q,38:J,40:Y},{5:W,28:160,31:G,34:K,36:q,38:J,40:Y},{5:W,28:161,31:G,34:K,36:q,38:J,40:Y},{5:W,28:162,31:G,34:K,36:q,38:J,40:Y},{5:X,40:Z,56:163,57:Q,59:$},{5:X,40:Z,56:164,57:Q,59:$},t(T,[2,23]),t(T,[2,24]),t(T,[2,25]),t(T,[2,26]),t(T,[2,44]),t(T,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,ee,A;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var te=``;for(O in A=[],s[w])this.terminals_[O]&&O>f&&A.push(`'`+this.terminals_[O]+`'`);te=h.showPosition?`Parse error on line `+(l+1)+`:
2
- `+h.showPosition()+`
3
- Expecting `+A.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(te,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:A})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),ee=s[r[r.length-2]][r[r.length-1]],r.push(ee);break;case 3:return!0}}return!0},`parse`)};le.lexer=(function(){return{EOF:1,parseError:e(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:e(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:e(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:e(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:e(function(){return this._more=!0,this},`more`),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
- `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:e(function(e){this.unput(this.match.slice(e))},`less`),pastInput:e(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:e(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:e(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
5
- `+t+`^`},`showPosition`),test_match:e(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:e(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}else return!1}else if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e===!1?!1:e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.
6
- `+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:e(function(){return this.next()||this.lex()},`lex`),begin:e(function(e){this.conditionStack.push(e)},`begin`),popState:e(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:e(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:e(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:e(function(e){this.begin(e)},`pushState`),stateStackSize:e(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:e(function(e,t,n,r){switch(n){case 0:return`title`;case 1:return this.begin(`acc_title`),9;case 2:return this.popState(),`acc_title_value`;case 3:return this.begin(`acc_descr`),11;case 4:return this.popState(),`acc_descr_value`;case 5:this.begin(`acc_descr_multiline`);break;case 6:this.popState();break;case 7:return`acc_descr_multiline_value`;case 8:return 21;case 9:return 22;case 10:return 23;case 11:return 24;case 12:return 5;case 13:break;case 14:break;case 15:break;case 16:return 8;case 17:return 6;case 18:return 27;case 19:return 40;case 20:return 29;case 21:return 32;case 22:return 31;case 23:return 34;case 24:return 36;case 25:return 38;case 26:return 41;case 27:return 42;case 28:return 43;case 29:return 44;case 30:return 45;case 31:return 46;case 32:return 47;case 33:return 48;case 34:return 49;case 35:return 50;case 36:return 51;case 37:return 52;case 38:return 53;case 39:return 54;case 40:return 65;case 41:return 66;case 42:return 67;case 43:return 68;case 44:return 69;case 45:return 70;case 46:return 71;case 47:return 57;case 48:return 59;case 49:return this.begin(`style`),77;case 50:return 75;case 51:return 81;case 52:return 88;case 53:return`PERCENT`;case 54:return 86;case 55:return 84;case 56:break;case 57:this.begin(`string`);break;case 58:this.popState();break;case 59:return this.begin(`style`),72;case 60:return this.begin(`style`),74;case 61:return 61;case 62:return 64;case 63:return 63;case 64:this.begin(`string`);break;case 65:this.popState();break;case 66:return`qString`;case 67:return t.yytext=t.yytext.trim(),89;case 68:return 75;case 69:return 80;case 70:return 76}},`anonymous`),rules:[/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:$)/i,/^(?:requirementDiagram\b)/i,/^(?:\{)/i,/^(?:\})/i,/^(?::{3})/i,/^(?::)/i,/^(?:id\b)/i,/^(?:text\b)/i,/^(?:risk\b)/i,/^(?:verifyMethod\b)/i,/^(?:requirement\b)/i,/^(?:functionalRequirement\b)/i,/^(?:interfaceRequirement\b)/i,/^(?:performanceRequirement\b)/i,/^(?:physicalRequirement\b)/i,/^(?:designConstraint\b)/i,/^(?:low\b)/i,/^(?:medium\b)/i,/^(?:high\b)/i,/^(?:analysis\b)/i,/^(?:demonstration\b)/i,/^(?:inspection\b)/i,/^(?:test\b)/i,/^(?:element\b)/i,/^(?:contains\b)/i,/^(?:copies\b)/i,/^(?:derives\b)/i,/^(?:satisfies\b)/i,/^(?:verifies\b)/i,/^(?:refines\b)/i,/^(?:traces\b)/i,/^(?:type\b)/i,/^(?:docref\b)/i,/^(?:style\b)/i,/^(?:\w+)/i,/^(?::)/i,/^(?:;)/i,/^(?:%)/i,/^(?:-)/i,/^(?:#)/i,/^(?: )/i,/^(?:["])/i,/^(?:\n)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:<-)/i,/^(?:->)/i,/^(?:-)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[\w][^:,\r\n\{\<\>\-\=]*)/i,/^(?:\w+)/i,/^(?:[0-9]+)/i,/^(?:,)/i],conditions:{acc_descr_multiline:{rules:[6,7,68,69,70],inclusive:!1},acc_descr:{rules:[4,68,69,70],inclusive:!1},acc_title:{rules:[2,68,69,70],inclusive:!1},style:{rules:[50,51,52,53,54,55,56,57,58,68,69,70],inclusive:!1},unqString:{rules:[68,69,70],inclusive:!1},token:{rules:[68,69,70],inclusive:!1},string:{rules:[65,66,68,69,70],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,59,60,61,62,63,64,67,68,69,70],inclusive:!0}}}})();function ue(){this.yy={}}return e(ue,`Parser`),ue.prototype=le,le.Parser=ue,new ue})();_.parser=_;var v=_,y=class{constructor(){this.relations=[],this.latestRequirement=this.getInitialRequirement(),this.requirements=new Map,this.latestElement=this.getInitialElement(),this.elements=new Map,this.classes=new Map,this.direction=`TB`,this.RequirementType={REQUIREMENT:`Requirement`,FUNCTIONAL_REQUIREMENT:`Functional Requirement`,INTERFACE_REQUIREMENT:`Interface Requirement`,PERFORMANCE_REQUIREMENT:`Performance Requirement`,PHYSICAL_REQUIREMENT:`Physical Requirement`,DESIGN_CONSTRAINT:`Design Constraint`},this.RiskLevel={LOW_RISK:`Low`,MED_RISK:`Medium`,HIGH_RISK:`High`},this.VerifyType={VERIFY_ANALYSIS:`Analysis`,VERIFY_DEMONSTRATION:`Demonstration`,VERIFY_INSPECTION:`Inspection`,VERIFY_TEST:`Test`},this.Relationships={CONTAINS:`contains`,COPIES:`copies`,DERIVES:`derives`,SATISFIES:`satisfies`,VERIFIES:`verifies`,REFINES:`refines`,TRACES:`traces`},this.setAccTitle=a,this.getAccTitle=d,this.setAccDescription=r,this.getAccDescription=c,this.setDiagramTitle=i,this.getDiagramTitle=l,this.getConfig=e(()=>u().requirement,`getConfig`),this.clear(),this.setDirection=this.setDirection.bind(this),this.addRequirement=this.addRequirement.bind(this),this.setNewReqId=this.setNewReqId.bind(this),this.setNewReqRisk=this.setNewReqRisk.bind(this),this.setNewReqText=this.setNewReqText.bind(this),this.setNewReqVerifyMethod=this.setNewReqVerifyMethod.bind(this),this.addElement=this.addElement.bind(this),this.setNewElementType=this.setNewElementType.bind(this),this.setNewElementDocRef=this.setNewElementDocRef.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setCssStyle=this.setCssStyle.bind(this),this.setClass=this.setClass.bind(this),this.defineClass=this.defineClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}static{e(this,`RequirementDB`)}getDirection(){return this.direction}setDirection(e){this.direction=e}resetLatestRequirement(){this.latestRequirement=this.getInitialRequirement()}resetLatestElement(){this.latestElement=this.getInitialElement()}getInitialRequirement(){return{requirementId:``,text:``,risk:``,verifyMethod:``,name:``,type:``,cssStyles:[],classes:[`default`]}}getInitialElement(){return{name:``,type:``,docRef:``,cssStyles:[],classes:[`default`]}}addRequirement(e,t){return this.requirements.has(e)||this.requirements.set(e,{name:e,type:t,requirementId:this.latestRequirement.requirementId,text:this.latestRequirement.text,risk:this.latestRequirement.risk,verifyMethod:this.latestRequirement.verifyMethod,cssStyles:[],classes:[`default`]}),this.resetLatestRequirement(),this.requirements.get(e)}getRequirements(){return this.requirements}setNewReqId(e){this.latestRequirement!==void 0&&(this.latestRequirement.requirementId=e)}setNewReqText(e){this.latestRequirement!==void 0&&(this.latestRequirement.text=e)}setNewReqRisk(e){this.latestRequirement!==void 0&&(this.latestRequirement.risk=e)}setNewReqVerifyMethod(e){this.latestRequirement!==void 0&&(this.latestRequirement.verifyMethod=e)}addElement(e){return this.elements.has(e)||(this.elements.set(e,{name:e,type:this.latestElement.type,docRef:this.latestElement.docRef,cssStyles:[],classes:[`default`]}),n.info(`Added new element: `,e)),this.resetLatestElement(),this.elements.get(e)}getElements(){return this.elements}setNewElementType(e){this.latestElement!==void 0&&(this.latestElement.type=e)}setNewElementDocRef(e){this.latestElement!==void 0&&(this.latestElement.docRef=e)}addRelationship(e,t,n){this.relations.push({type:e,src:t,dst:n})}getRelationships(){return this.relations}clear(){this.relations=[],this.resetLatestRequirement(),this.requirements=new Map,this.resetLatestElement(),this.elements=new Map,this.classes=new Map,o()}setCssStyle(e,t){for(let n of e){let e=this.requirements.get(n)??this.elements.get(n);if(!t||!e)return;for(let n of t)n.includes(`,`)?e.cssStyles.push(...n.split(`,`)):e.cssStyles.push(n)}}setClass(e,t){for(let n of e){let e=this.requirements.get(n)??this.elements.get(n);if(e)for(let n of t){e.classes.push(n);let t=this.classes.get(n)?.styles;t&&e.cssStyles.push(...t)}}}defineClass(e,t){for(let n of e){let e=this.classes.get(n);e===void 0&&(e={id:n,styles:[],textStyles:[]},this.classes.set(n,e)),t&&t.forEach(function(t){if(/color/.exec(t)){let n=t.replace(`fill`,`bgFill`);e.textStyles.push(n)}e.styles.push(t)}),this.requirements.forEach(e=>{e.classes.includes(n)&&e.cssStyles.push(...t.flatMap(e=>e.split(`,`)))}),this.elements.forEach(e=>{e.classes.includes(n)&&e.cssStyles.push(...t.flatMap(e=>e.split(`,`)))})}}getClasses(){return this.classes}getData(){let e=u(),t=[],n=[];for(let n of this.requirements.values()){let r=n;r.id=n.name,r.cssStyles=n.cssStyles,r.cssClasses=n.classes.join(` `),r.shape=`requirementBox`,r.look=e.look,r.colorIndex=t.length,t.push(r)}for(let n of this.elements.values()){let r=n;r.shape=`requirementBox`,r.look=e.look,r.id=n.name,r.cssStyles=n.cssStyles,r.cssClasses=n.classes.join(` `),r.colorIndex=t.length,t.push(r)}for(let t of this.relations){let r=0,i=t.type===this.Relationships.CONTAINS,a={id:`${t.src}-${t.dst}-${r}`,start:this.requirements.get(t.src)?.name??this.elements.get(t.src)?.name,end:this.requirements.get(t.dst)?.name??this.elements.get(t.dst)?.name,label:`&lt;&lt;${t.type}&gt;&gt;`,classes:`relationshipLine`,style:[`fill:none`,i?``:`stroke-dasharray: 10,7`],labelpos:`c`,thickness:`normal`,type:`normal`,pattern:i?`normal`:`dashed`,arrowTypeStart:i?`requirement_contains`:``,arrowTypeEnd:i?``:`requirement_arrow`,look:e.look,labelType:`markdown`};n.push(a),r++}return{nodes:t,edges:n,other:{},config:e,direction:this.getDirection()}}},b=e(e=>{let{themeVariables:t,look:n}=s(),{bkgColorArray:r,borderColorArray:i}=t;if(!i?.length)return``;let a=``;for(let t=0;t<e.THEME_COLOR_LIMIT;t++)a+=`
7
-
8
- [data-look="${n}"][data-color-id="color-${t}"].node path {
9
- stroke: ${i[t]};
10
- fill: ${r?.length?r[t]:``};
11
- }
12
-
13
- [data-look="${n}"][data-color-id="color-${t}"].node rect {
14
- stroke: ${i[t]};
15
- fill: ${r?.length?r[t]:``};
16
- }
17
- `;return a},`genColor`),x=e(e=>{let{look:t,themeVariables:n}=s(),{requirementEdgeLabelBackground:r}=n;return`
18
- ${b(e)}
19
- marker {
20
- fill: ${e.relationColor};
21
- stroke: ${e.relationColor};
22
- }
23
-
24
- marker.cross {
25
- stroke: ${e.lineColor};
26
- }
27
-
28
- svg {
29
- font-family: ${e.fontFamily};
30
- font-size: ${e.fontSize};
31
- }
32
-
33
- .reqBox {
34
- fill: ${e.requirementBackground};
35
- fill-opacity: 1.0;
36
- stroke: ${e.requirementBorderColor};
37
- stroke-width: ${e.requirementBorderSize};
38
- }
39
-
40
- .reqTitle, .reqLabel{
41
- fill: ${e.requirementTextColor};
42
- }
43
- .reqLabelBox {
44
- fill: ${e.relationLabelBackground};
45
- fill-opacity: 1.0;
46
- }
47
-
48
- .req-title-line {
49
- stroke: ${e.requirementBorderColor};
50
- stroke-width: ${e.requirementBorderSize};
51
- }
52
- .relationshipLine {
53
- stroke: ${e.relationColor};
54
- stroke-width: ${t===`neo`?e.strokeWidth:`1px`};
55
- }
56
- .relationshipLabel {
57
- fill: ${e.relationLabelColor};
58
- }
59
- .edgeLabel {
60
- background-color: ${e.edgeLabelBackground};
61
- }
62
- .edgeLabel .label rect {
63
- fill: ${e.edgeLabelBackground};
64
- }
65
- .edgeLabel .label text {
66
- fill: ${e.relationLabelColor};
67
- }
68
- .divider {
69
- stroke: ${e.nodeBorder};
70
- stroke-width: 1;
71
- }
72
- .label {
73
- font-family: ${e.fontFamily};
74
- color: ${e.nodeTextColor||e.textColor};
75
- }
76
- .label text,span {
77
- fill: ${e.nodeTextColor||e.textColor};
78
- color: ${e.nodeTextColor||e.textColor};
79
- }
80
- .labelBkg {
81
- background-color: ${r??e.edgeLabelBackground};
82
- }
83
-
84
- `},`getStyles`),S={};t(S,{draw:()=>C});var C=e(async function(e,t,r,i){n.info(`REF0:`),n.info(`Drawing requirement diagram (unified)`,t);let{securityLevel:a,state:o,layout:s,look:c}=u(),l=i.db.getData(),d=p(t,a);l.type=i.type,l.layoutAlgorithm=g(s),l.nodeSpacing=o?.nodeSpacing??50,l.rankSpacing=o?.rankSpacing??50,l.markers=c===`neo`?[`requirement_contains_neo`,`requirement_arrow_neo`]:[`requirement_contains`,`requirement_arrow`],l.diagramId=t,await h(l,d),f.insertTitle(d,`requirementDiagramTitleText`,o?.titleTopMargin??25,i.db.getDiagramTitle()),m(d,8,`requirementDiagram`,o?.useMaxWidth??!0)},`draw`),w={parser:v,get db(){return new y},renderer:S,styles:x};export{w as diagram};
85
- //# sourceMappingURL=requirementDiagram-TGXJPOKE-9g84jNsR.js.map
@@ -1,2 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{dn as n,i as r,n as i}from"./portal-Sdfvrza9.js";import{t as a}from"./jsx-runtime-CFwixLRt.js";import{t as o}from"./heading-C0sACr0w.js";import{n as s,t as c}from"./v-stack-hkuSkmCA.js";import{i as l,n as u,r as d,t as f}from"./alert-CPsXih3K.js";import{n as p,r as m,t as h}from"./card-By_Mbslh.js";import{t as g}from"./container-Cxi_AjD-.js";import{t as _}from"./spacer-C38e7o6r.js";import{n as v}from"./auth-client-MjRW2PVA.js";import{s as y}from"./index.esm-Cpy5fWo1.js";import{An as b,En as x,Mr as S,_ as C,n as w}from"./index-CPtTUYLD.js";import{t as T}from"./zod-BDLLToBM.js";import{t as E}from"./LogoIcon-CyQDrYa_.js";import{n as D,t as O}from"./HorizontalFormControl-lYiaIlzD.js";var k=e(t()),A=a(),j=`This password reset link is invalid or has expired. Request a new one to continue.`,M=x({password:b().min(8,{message:`Password must be at least 8 characters`}),confirmPassword:b()}).refine(e=>e.password===e.confirmPassword,{message:`Passwords don't match`,path:[`confirmPassword`]});function N(){let e=C()?.get(`token`)??null;return e?(0,A.jsx)(P,{token:e}):(0,A.jsxs)(F,{title:`Invalid reset link`,children:[(0,A.jsx)(s,{children:j}),(0,A.jsx)(I,{})]})}function P({token:e}){let t=y({resolver:T(M)}),[a,b]=(0,k.useState)(!1),[x,C]=(0,k.useState)(!1),[N,P]=(0,k.useState)(null);return x?(0,A.jsxs)(F,{title:`Password updated`,children:[(0,A.jsx)(s,{children:`Your password has been reset. You can now sign in with your new password.`}),(0,A.jsx)(r,{colorPalette:`orange`,variant:`solid`,asChild:!0,children:(0,A.jsx)(w,{href:`/auth/signin`,style:{color:`white`},children:`Sign in`})})]}):(0,A.jsx)(g,{maxW:`container.md`,paddingTop:`calc(40vh - 164px)`,children:(0,A.jsx)(`form`,{onSubmit:t.handleSubmit(async t=>{b(!0),P(null);try{if((await v.resetPassword({newPassword:t.password,token:e}))?.error){P(j);return}C(!0)}catch{P(j)}finally{b(!1)}}),children:(0,A.jsxs)(m,{children:[(0,A.jsx)(p,{children:(0,A.jsxs)(i,{gap:4,children:[(0,A.jsx)(E,{width:30.69,height:42}),(0,A.jsx)(o,{size:`lg`,as:`h1`,children:`Reset password`})]})}),(0,A.jsx)(h,{children:(0,A.jsxs)(c,{width:`full`,children:[(0,A.jsx)(O,{label:`New Password`,helper:`Enter your new password`,invalid:t.formState.errors.password?.message!==void 0,children:(0,A.jsxs)(c,{align:`stretch`,gap:1,width:`full`,children:[(0,A.jsx)(S,{type:`password`,...t.register(`password`)}),(0,A.jsx)(D,{error:t.formState.errors.password})]})}),(0,A.jsx)(O,{label:`Confirm Password`,helper:`Confirm your new password`,invalid:t.formState.errors.confirmPassword?.message!==void 0,children:(0,A.jsxs)(c,{align:`stretch`,gap:1,width:`full`,children:[(0,A.jsx)(S,{type:`password`,...t.register(`confirmPassword`)}),(0,A.jsx)(D,{error:t.formState.errors.confirmPassword})]})}),N&&(0,A.jsxs)(l,{status:`error`,width:`full`,children:[(0,A.jsx)(d,{}),(0,A.jsxs)(f,{children:[(0,A.jsx)(u,{children:N}),(0,A.jsx)(I,{})]})]}),(0,A.jsxs)(i,{width:`full`,paddingTop:4,children:[(0,A.jsx)(n,{asChild:!0,children:(0,A.jsx)(w,{href:`/auth/signin`,style:{textDecoration:`underline`},children:`Back to sign in`})}),(0,A.jsx)(_,{}),(0,A.jsx)(r,{colorPalette:`orange`,type:`submit`,loading:a,children:`Reset password`})]})]})})]})})})}function F({title:e,children:t}){return(0,A.jsx)(g,{maxW:`container.md`,paddingTop:`calc(40vh - 164px)`,children:(0,A.jsxs)(m,{children:[(0,A.jsx)(p,{children:(0,A.jsxs)(i,{gap:4,children:[(0,A.jsx)(E,{width:30.69,height:42}),(0,A.jsx)(o,{size:`lg`,as:`h1`,children:e})]})}),(0,A.jsx)(h,{children:(0,A.jsx)(c,{width:`full`,align:`start`,gap:4,children:t})})]})})}function I(){return(0,A.jsx)(n,{asChild:!0,children:(0,A.jsx)(w,{href:`/auth/forgot-password`,style:{textDecoration:`underline`},children:`Request a new reset link`})})}export{N as default};
2
- //# sourceMappingURL=reset-password-ohopJtIH.js.map
@@ -1,2 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{a as n,dn as r,i,n as a}from"./portal-Sdfvrza9.js";import{t as o}from"./jsx-runtime-CFwixLRt.js";import{t as s}from"./heading-C0sACr0w.js";import{n as c,t as l}from"./v-stack-hkuSkmCA.js";import{n as u}from"./ProjectAvatar-DtI9dT1f.js";import{t as d}from"./badge-Cpc3eA-C.js";import{$ as f,Q as p,X as m,Y as h,Z as g,et as _,nt as v}from"./Markdown-C9extmbX.js";import{r as y,t as b}from"./card-By_Mbslh.js";import{t as x}from"./spacer-C38e7o6r.js";import{n as S}from"./api-l6Cnm0vQ.js";import{Un as C,Vt as w,zn as T}from"./index-CPtTUYLD.js";import{t as E}from"./useActivePlan-fRQ_etI2.js";import{t as D}from"./WithPermissionGuard-Cr6Aljmy.js";import{t as O}from"./SettingsLayout-sixsNIX_.js";import{t as k}from"./ContactSalesBlock-3LFiXNMY.js";var A=T(),j=e(t()),M=o();function N(e){return e===`ADMIN`?`red`:e===`MEMBER`?`blue`:e===`VIEWER`?`gray`:`purple`}function P(e){return e===A.RoleBindingScopeType.ORGANIZATION?`orange`:e===A.RoleBindingScopeType.TEAM?`teal`:`purple`}function F(e){return e===A.RoleBindingScopeType.ORGANIZATION?`Org`:e===A.RoleBindingScopeType.TEAM?`Team`:`Project`}function I(e){let t=new Map;for(let n of e){let e=n.userId??n.groupId??`unknown`;t.has(e)||t.set(e,{key:e,userId:n.userId,userName:n.userName,userEmail:n.userEmail,userImage:n.userImage,groupId:n.groupId,groupName:n.groupName,groupScimSource:n.groupScimSource,bindings:[]}),t.get(e).bindings.push(n)}return[...t.values()].sort((e,t)=>{let n=e.userName??e.groupName??e.userEmail??``,r=t.userName??t.groupName??t.userEmail??``;return n.localeCompare(r)})}function L({principal:e}){return e.userId?(0,M.jsxs)(a,{gap:2,children:[(0,M.jsx)(u,{id:e.userId,name:e.userName??e.userEmail??`?`,image:e.userImage,size:`xs`}),(0,M.jsxs)(l,{gap:0,align:`start`,children:[e.userName&&(0,M.jsx)(c,{fontWeight:`medium`,fontSize:`sm`,children:e.userName}),(0,M.jsx)(c,{fontSize:`xs`,color:`fg.muted`,children:e.userEmail??``})]})]}):(0,M.jsxs)(a,{gap:2,children:[(0,M.jsx)(r,{width:`6`,height:`6`,borderRadius:`full`,bg:`blue.subtle`,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0,children:(0,M.jsx)(C,{size:12})}),(0,M.jsxs)(l,{gap:0,align:`start`,children:[(0,M.jsx)(c,{fontWeight:`medium`,fontSize:`sm`,children:e.groupName??`Unknown group`}),e.groupScimSource&&(0,M.jsx)(d,{size:`xs`,colorPalette:`blue`,children:e.groupScimSource.toUpperCase()})]})]})}function R({bindings:e}){return(0,M.jsx)(l,{gap:1,align:`end`,children:e.map(e=>(0,M.jsxs)(a,{gap:1,children:[(0,M.jsx)(d,{colorPalette:N(e.role),size:`sm`,children:e.customRoleName??e.role}),(0,M.jsx)(c,{fontSize:`xs`,color:`fg.muted`,children:`on`}),(0,M.jsxs)(d,{colorPalette:P(e.scopeType),size:`sm`,children:[F(e.scopeType),` ·`,` `,e.scopeName??e.scopeId.slice(0,8)+`…`]})]},e.id))})}var z=[{label:`All`,value:`ALL`},{label:`Org`,value:A.RoleBindingScopeType.ORGANIZATION},{label:`Team`,value:A.RoleBindingScopeType.TEAM},{label:`Project`,value:A.RoleBindingScopeType.PROJECT}];function B({active:e,onChange:t}){return(0,M.jsx)(a,{gap:1,children:z.map(n=>(0,M.jsx)(i,{size:`sm`,variant:e===n.value?`subtle`:`ghost`,colorPalette:e===n.value?`blue`:`gray`,onClick:()=>t(n.value),children:n.label},n.value))})}function V(){let{organization:e}=w(),{isEnterprise:t,isLoading:i}=E(),[o,u]=(0,j.useState)(`ALL`),{data:d,isLoading:C}=S.roleBinding.listForOrg.useQuery({organizationId:e?.id??``},{enabled:!!e?.id&&t});if(i||!e)return(0,M.jsx)(O,{children:(0,M.jsx)(n,{})});if(!t)return(0,M.jsx)(O,{children:(0,M.jsx)(r,{width:`full`,children:(0,M.jsx)(k,{})})});let T=I(o===`ALL`?d??[]:(d??[]).filter(e=>e.scopeType===o));return(0,M.jsx)(O,{children:(0,M.jsxs)(l,{align:`start`,gap:6,width:`full`,children:[(0,M.jsxs)(l,{align:`start`,gap:1,width:`full`,children:[(0,M.jsx)(s,{as:`h2`,children:`Role Bindings`}),(0,M.jsx)(c,{color:`fg.muted`,fontSize:`sm`,children:`All role bindings in this organization.`})]}),(0,M.jsx)(v,{}),(0,M.jsxs)(a,{width:`full`,children:[(0,M.jsx)(B,{active:o,onChange:u}),(0,M.jsx)(x,{}),d&&(0,M.jsxs)(c,{fontSize:`sm`,color:`fg.muted`,children:[T.length,` `,T.length===1?`principal`:`principals`]})]}),(0,M.jsx)(y,{width:`full`,overflow:`hidden`,children:(0,M.jsx)(b,{paddingY:0,paddingX:0,overflowX:`auto`,children:C?(0,M.jsx)(r,{padding:8,display:`flex`,justifyContent:`center`,children:(0,M.jsx)(n,{})}):T.length===0?(0,M.jsx)(r,{padding:8,textAlign:`center`,children:(0,M.jsx)(c,{color:`fg.muted`,children:`No role bindings found.`})}):(0,M.jsxs)(f,{variant:`line`,size:`md`,width:`full`,children:[(0,M.jsx)(p,{children:(0,M.jsxs)(_,{children:[(0,M.jsx)(g,{width:`240px`,children:`Who`}),(0,M.jsx)(g,{textAlign:`right`,children:`Access`})]})}),(0,M.jsx)(h,{children:T.map(e=>(0,M.jsxs)(_,{children:[(0,M.jsx)(m,{children:(0,M.jsx)(L,{principal:e})}),(0,M.jsx)(m,{children:(0,M.jsx)(R,{bindings:e.bindings})})]},e.key))})]})})})]})})}var H=D(`organization:manage`,{layoutComponent:O})(V);export{H as default};
2
- //# sourceMappingURL=role-bindings-BQ31P1EO.js.map
@@ -1,2 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{a as n,dn as r,i,n as a}from"./portal-Sdfvrza9.js";import{t as o}from"./jsx-runtime-CFwixLRt.js";import{t as s}from"./heading-C0sACr0w.js";import{n as c,t as l}from"./v-stack-hkuSkmCA.js";import{pn as u,tr as d}from"./ProjectAvatar-DtI9dT1f.js";import{t as f}from"./badge-Cpc3eA-C.js";import{t as p}from"./tooltip-gjZ4s2dt.js";import{d as m,n as h}from"./toaster-BsYkODqs.js";import{K as g,O as _,nt as v,q as y,r as ee}from"./Markdown-C9extmbX.js";import{a as b,n as x,r as S,t as C}from"./field-BadoNaN5.js";import{n as w,r as T,t as E}from"./fieldset-BNLAUiqD.js";import{L as te}from"./DashboardLayout-BhHe0vIT.js";import{a as D,i as O,n as k,r as A,t as j}from"./alert-CPsXih3K.js";import{n as M,r as ne,t as N}from"./card-By_Mbslh.js";import{t as P}from"./errors-e711UMq7.js";import{tt as F}from"./immer-CFru3D02.js";import{n as I}from"./api-l6Cnm0vQ.js";import{t as L}from"./square-pen-BeEJLs7r.js";import{s as R}from"./index.esm-Cpy5fWo1.js";import{Gt as z,Kt as re,Mr as B,St as V,Vt as H,Wt as U,qn as W,zn as G}from"./index-CPtTUYLD.js";import{t as K}from"./useActivePlan-fRQ_etI2.js";import{t as ie}from"./check-CcrJKf5P.js";import{t as ae}from"./info-DRDUmL_M.js";import{t as oe}from"./plus-10dP8Fmk.js";import{t as se}from"./shield-Da9CJWs3.js";import{t as ce}from"./users-C1KVK1by.js";import{t as le}from"./WithPermissionGuard-Cr6Aljmy.js";import{t as q}from"./SettingsLayout-sixsNIX_.js";import{t as ue}from"./ContactSalesBlock-3LFiXNMY.js";var de=m(`shield-user`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M6.376 18.91a6 6 0 0 1 11.249.003`,key:`hnjrf2`}],[`circle`,{cx:`12`,cy:`11`,r:`4`,key:`1gt34v`}]]),J=e(t()),Y=G(),X=[z.TRACES,z.COST,z.SCENARIOS,z.ANNOTATIONS,z.ANALYTICS,z.EVALUATIONS,z.DATASETS,z.TRIGGERS,z.WORKFLOWS,z.EXPERIMENTS,z.PROMPTS,z.SECRETS,z.AUDIT_LOG,z.TEAM,z.PROJECT,z.GOVERNANCE,z.INGESTION_SOURCES,z.ANOMALY_RULES,z.COMPLIANCE_EXPORT,z.ACTIVITY_MONITOR,z.AI_TOOLS];function Z(e){return e===z.COST?[U.VIEW]:e===z.TRACES?[U.VIEW,U.SHARE]:e===z.SECRETS||e===z.EXPERIMENTS?[U.VIEW,U.MANAGE]:e===z.SCENARIOS||e===z.AUDIT_LOG||e===z.COMPLIANCE_EXPORT||e===z.ACTIVITY_MONITOR?[U.VIEW]:[U.MANAGE,U.VIEW,U.CREATE,U.UPDATE,U.DELETE]}var Q=o();function fe({permissions:e}){let t=(e,t)=>`${e}:${t}`,n={};return X.forEach(e=>{n[e]=Z(e).map(n=>t(e,n))}),(0,Q.jsx)(l,{align:`start`,width:`full`,gap:4,children:Object.keys(n).map(n=>{let i=Z(n);if(!i.some(t=>e.includes(`${n}:${t}`)))return null;let o=i.filter(t=>e.includes(`${n}:${t}`)),s=o.includes(`manage`)?o.filter(e=>e===`manage`||e===`share`):o;return(0,Q.jsxs)(r,{width:`full`,children:[(0,Q.jsxs)(l,{align:`start`,gap:2,width:`full`,children:[(0,Q.jsx)(c,{fontWeight:`semibold`,textTransform:`capitalize`,fontSize:`md`,children:n}),(0,Q.jsx)(l,{align:`start`,gap:1.5,paddingLeft:4,width:`full`,children:s.map(e=>{let r=t(n,e),i=e===`manage`?`Manage (Create, Update, Delete)`:e.charAt(0).toUpperCase()+e.slice(1);return(0,Q.jsxs)(a,{gap:2,align:`center`,children:[(0,Q.jsx)(ie,{size:14,color:`var(--chakra-colors-green-500)`}),(0,Q.jsx)(c,{fontSize:`sm`,color:`fg`,children:i})]},r)})})]}),(0,Q.jsx)(v,{marginY:3})]},n)})})}function $({name:e,description:t,permissionCount:n,isDefault:r=!1,icon:o=W,onDelete:s,onEdit:u,onViewPermissions:d,hasPermission:p}){let m=p(`organization:manage`);return(0,Q.jsxs)(ne,{width:`100%`,height:`100%`,borderWidth:`1px`,borderColor:`border`,_hover:d?{borderColor:`orange.400`,shadow:`md`}:{},transition:`all 0.2s`,display:`flex`,flexDirection:`column`,cursor:d&&m?`pointer`:`default`,onClick:d&&m?d:void 0,position:`relative`,children:[!r&&(0,Q.jsxs)(a,{gap:1,onClick:e=>e.stopPropagation(),position:`absolute`,right:4,top:`50%`,transform:`translateY(-50%)`,children:[d&&(0,Q.jsx)(i,{size:`sm`,variant:`ghost`,colorPalette:`blue`,onClick:e=>{e.stopPropagation(),d()},disabled:!p(`organization:manage`),children:(0,Q.jsx)(y,{size:14})}),u&&(0,Q.jsx)(i,{size:`sm`,variant:`ghost`,colorPalette:`orange`,onClick:e=>{e.stopPropagation(),u()},disabled:!p(`organization:manage`),children:(0,Q.jsx)(L,{size:14})}),s&&(0,Q.jsx)(i,{size:`sm`,variant:`ghost`,colorPalette:`red`,onClick:e=>{e.stopPropagation(),s()},disabled:!p(`organization:manage`),children:(0,Q.jsx)(g,{size:14})})]}),(0,Q.jsx)(M,{children:(0,Q.jsxs)(l,{align:`start`,gap:1,children:[(0,Q.jsxs)(a,{children:[(0,Q.jsx)(o,{size:18}),(0,Q.jsx)(c,{fontWeight:`semibold`,children:e})]}),r&&(0,Q.jsx)(c,{fontSize:`xs`,color:`fg.muted`,children:`Built-in Role`})]})}),(0,Q.jsx)(N,{paddingTop:0,flex:1,display:`flex`,flexDirection:`column`,children:(0,Q.jsxs)(l,{align:`start`,gap:2,flex:1,width:`full`,justifyContent:`space-between`,children:[(0,Q.jsx)(c,{fontSize:`sm`,color:`fg.muted`,children:t}),r?(0,Q.jsx)(f,{colorPalette:`orange`,size:`sm`,children:n}):(0,Q.jsx)(c,{fontSize:`xs`,color:`orange.fg`,fontWeight:`medium`,children:n})]})})]})}function pe({selectedPermissions:e,onChange:t}){let n=(e,t)=>`${e}:${t}`,i=(0,J.useMemo)(()=>{let e={};return X.forEach(t=>{e[t]=Z(t).map(e=>n(t,e))}),e},[]),o=(e,t)=>{if(e.endsWith(`:manage`))return i[t]||[];let[n,r]=e.split(`:`);if(r===`view`){let n=i[t]||[],r=[`create`,`update`,`delete`];return[e,...n.filter(e=>r.some(t=>e.endsWith(`:${t}`)))]}return[e]},s=(e,t)=>{if(e.endsWith(`:manage`))return i[t]||[];let[r,a]=e.split(`:`);return a===`create`||a===`update`||a===`delete`?[e,n(t,`view`)]:[e]},u=n=>{let[r]=n.split(`:`),i=o(n,r);t(e.filter(e=>!i.includes(e)))},d=n=>{let[r]=n.split(`:`),i=s(n,r);t([...e,...i.filter(t=>!e.includes(t))])},f=t=>{let[r,i]=t.split(`:`),a=n(r,`manage`),o=e.includes(a);e.includes(t)||o&&i!==`manage`?u(t):d(t)};return(0,Q.jsx)(l,{align:`start`,width:`full`,gap:4,children:Object.keys(i).map(t=>{let i=Z(t);return(0,Q.jsxs)(r,{width:`full`,children:[(0,Q.jsxs)(T,{children:[(0,Q.jsx)(w,{fontSize:`sm`,fontWeight:`semibold`,textTransform:`capitalize`,marginBottom:2,children:(0,Q.jsx)(c,{children:t})}),(0,Q.jsx)(E,{children:(0,Q.jsx)(a,{gap:4,flexWrap:`wrap`,paddingLeft:6,children:i.map(i=>{let o=n(t,i),s=e.includes(o),l=n(t,`manage`),u=e.includes(l),d=i!==`manage`&&u;return(0,Q.jsx)(_,{checked:s||d,onChange:()=>{f(d?l:o)},opacity:d?.6:1,cursor:d?`not-allowed`:`pointer`,children:i===`manage`?(0,Q.jsx)(p,{content:`Manage includes all permissions (view, create, update, delete) for this resource`,positioning:{placement:`top`},showArrow:!0,children:(0,Q.jsxs)(a,{gap:1,children:[(0,Q.jsx)(c,{fontSize:`sm`,textTransform:`capitalize`,children:i}),(0,Q.jsx)(r,{color:`fg.muted`,children:(0,Q.jsx)(ae,{size:14})})]})}):(0,Q.jsx)(c,{fontSize:`sm`,textTransform:`capitalize`,children:i})},o)})})})]}),(0,Q.jsx)(v,{marginY:3})]},t)})})}function me({open:e,onClose:t,onSubmit:n,initialData:r,title:a,submitLabel:o=`Create Role`,isSubmitting:u=!1}){let{register:d,handleSubmit:f,reset:p,formState:{errors:m},setValue:h,watch:g}=R({defaultValues:{name:r?.name??``,description:r?.description??``,permissions:r?.permissions??[]}}),_=g(`permissions`)||[];(0,J.useEffect)(()=>{r?(h(`name`,r.name),h(`description`,r.description),h(`permissions`,r.permissions)):p({name:``,description:``,permissions:[]})},[r,h,p]);let y=f(async e=>{await n(e),r||p()});return(0,Q.jsx)(V.Root,{open:e,onOpenChange:({open:e})=>!e&&t(),children:(0,Q.jsxs)(V.Content,{bg:`bg`,maxWidth:`900px`,maxHeight:`90vh`,overflowY:`auto`,children:[(0,Q.jsx)(V.Header,{children:(0,Q.jsx)(V.Title,{children:a})}),(0,Q.jsx)(V.Body,{children:(0,Q.jsx)(`form`,{id:`role-form`,onSubmit:e=>void y(e),children:(0,Q.jsxs)(l,{gap:6,align:`start`,children:[(0,Q.jsxs)(b,{invalid:!!m.name,children:[(0,Q.jsxs)(S,{children:[`Role Name`,` `,(0,Q.jsx)(c,{as:`span`,color:`red.500`,children:`*`})]}),(0,Q.jsx)(B,{...d(`name`,{required:`Role name is required`}),placeholder:`e.g., Data Analyst`}),m.name&&(0,Q.jsx)(C,{children:m.name.message})]}),(0,Q.jsxs)(b,{children:[(0,Q.jsx)(S,{children:`Description`}),(0,Q.jsx)(x,{children:`Describe what this role is for`}),(0,Q.jsx)(F,{...d(`description`),placeholder:`e.g., Can view and analyze data but cannot modify settings`,rows:3})]}),(0,Q.jsx)(v,{}),(0,Q.jsxs)(l,{align:`start`,width:`full`,gap:4,children:[(0,Q.jsx)(s,{size:`sm`,children:`Permissions`}),(0,Q.jsx)(c,{fontSize:`sm`,color:`fg.muted`,children:`Select the permissions this role should have`}),(0,Q.jsx)(pe,{selectedPermissions:_,onChange:e=>h(`permissions`,e)})]})]})})}),(0,Q.jsxs)(V.Footer,{children:[(0,Q.jsx)(i,{variant:`outline`,onClick:t,children:`Cancel`}),(0,Q.jsx)(i,{type:`submit`,form:`role-form`,colorPalette:`orange`,loading:u,children:o})]}),(0,Q.jsx)(V.CloseTrigger,{})]})})}function he(){let{organization:e,hasPermission:t}=H(),{isEnterprise:i,isLoading:a}=K();return!e||a?(0,Q.jsx)(q,{children:(0,Q.jsx)(l,{align:`center`,justify:`center`,width:`full`,height:`200px`,children:(0,Q.jsx)(n,{})})}):i?(0,Q.jsx)(q,{children:(0,Q.jsx)(_e,{organizationId:e.id,hasPermission:t})}):(0,Q.jsx)(q,{children:(0,Q.jsxs)(l,{gap:6,width:`full`,align:`start`,children:[(0,Q.jsxs)(O,{status:`info`,children:[(0,Q.jsx)(A,{}),(0,Q.jsxs)(j,{children:[(0,Q.jsx)(D,{children:`Enterprise Feature`}),(0,Q.jsx)(k,{children:`Custom roles are available on Enterprise plans. Contact sales to upgrade.`})]})]}),(0,Q.jsx)(r,{width:`full`,children:(0,Q.jsx)(ue,{})})]})})}var ge=le(`organization:manage`,{layoutComponent:q})(he);function _e({organizationId:e,hasPermission:t}){let{open:o,onOpen:f,onClose:m}=d(),{open:g,onOpen:_,onClose:y}=d(),{open:b,onOpen:x,onClose:S}=d(),{open:C,onOpen:w,onClose:T}=d(),[E,D]=(0,J.useState)(null),[O,k]=(0,J.useState)(null),[A,j]=(0,J.useState)(null),[M,F]=(0,J.useState)(null),L=I.useContext(),R=I.role.getAll.useQuery({organizationId:e}),z=I.role.create.useMutation({onSuccess:()=>{L.role.getAll.invalidate(),h.create({title:`Role created successfully`,type:`success`}),m()},onError:e=>P({error:e,fallbackTitle:`Couldn't create role`})}),B=I.role.delete.useMutation({onSuccess:()=>{L.role.getAll.invalidate(),h.create({title:`Role deleted successfully`,type:`success`})},onError:e=>P({error:e,fallbackTitle:`Couldn't delete role`})}),H=I.role.update.useMutation({onSuccess:()=>{L.role.getAll.invalidate(),h.create({title:`Role updated successfully`,type:`success`}),y(),D(null)},onError:e=>P({error:e,fallbackTitle:`Couldn't update role`})}),U=async e=>{try{let t=await L.role.getById.fetch({roleId:e});D({id:t.id,name:t.name,description:t.description??``,permissions:t.permissions}),_()}catch(e){P({error:e,fallbackTitle:`Couldn't load role details`})}},W=async e=>{try{let t=await L.role.getById.fetch({roleId:e});k({id:t.id,name:t.name,description:t.description??``,permissions:t.permissions}),x()}catch(e){P({error:e,fallbackTitle:`Couldn't load role details`})}},G=(e,t)=>{let n=re(t);j({name:e,description:K(e),permissions:n}),w()},K=e=>{switch(e){case`Admin`:return`Full access to all features and settings`;case`Member`:return`Can create and modify most resources, view costs and debug info`;case`Viewer`:return`Read-only access to analytics, messages, and guardrails`;default:return``}};return(0,Q.jsxs)(l,{align:`start`,width:`full`,gap:6,children:[(0,Q.jsxs)(a,{justify:`space-between`,width:`full`,children:[(0,Q.jsxs)(l,{align:`start`,gap:1,children:[(0,Q.jsx)(s,{as:`h2`,children:`Roles & Permissions`}),(0,Q.jsx)(c,{color:`fg.muted`,fontSize:`sm`,children:`Create custom roles and assign specific permissions to control access`})]}),(0,Q.jsx)(p,{content:`You need organization:manage permissions to create roles.`,disabled:t(`organization:manage`),children:(0,Q.jsxs)(te.HeaderButton,{onClick:f,disabled:!t(`organization:manage`),children:[(0,Q.jsx)(oe,{size:16}),` Create Role`]})})]}),(0,Q.jsx)(v,{}),(0,Q.jsxs)(l,{align:`start`,width:`full`,gap:4,children:[(0,Q.jsxs)(r,{children:[(0,Q.jsx)(s,{as:`h3`,children:`Default Roles`}),(0,Q.jsx)(c,{color:`fg.muted`,fontSize:`sm`,children:`These are the built-in roles that cannot be modified or deleted.`})]}),(0,Q.jsxs)(r,{width:`full`,display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(300px, 1fr))`,gap:4,children:[(0,Q.jsx)($,{hasPermission:t,name:`Admin`,description:`Full access to all features and settings`,isDefault:!0,permissionCount:`All Permissions`,icon:de,onViewPermissions:()=>G(`Admin`,Y.TeamUserRole.ADMIN)}),(0,Q.jsx)($,{hasPermission:t,name:`Member`,description:`Can create and modify most resources, view costs and debug info`,isDefault:!0,permissionCount:`Most Permissions`,icon:ce,onViewPermissions:()=>G(`Member`,Y.TeamUserRole.MEMBER)}),(0,Q.jsx)($,{hasPermission:t,name:`Viewer`,description:`Read-only access to analytics, messages, and guardrails`,isDefault:!0,permissionCount:`View Only`,icon:u,onViewPermissions:()=>G(`Viewer`,Y.TeamUserRole.VIEWER)})]})]}),(0,Q.jsx)(v,{}),(0,Q.jsxs)(l,{align:`start`,width:`full`,gap:4,children:[(0,Q.jsxs)(r,{children:[(0,Q.jsx)(s,{as:`h3`,children:`Custom Roles`}),(0,Q.jsx)(c,{color:`fg.muted`,fontSize:`sm`,children:`Custom roles created for your organization with specific permission sets.`})]}),R.isLoading&&(0,Q.jsx)(l,{align:`center`,width:`full`,padding:8,children:(0,Q.jsx)(n,{})}),R.data&&R.data.length===0&&(0,Q.jsx)(ne,{width:`full`,children:(0,Q.jsx)(N,{textAlign:`center`,padding:8,children:(0,Q.jsxs)(l,{gap:2,children:[(0,Q.jsx)(se,{size:48,color:`gray`}),(0,Q.jsx)(c,{color:`fg.muted`,children:`No custom roles yet. Create your first custom role to get started.`})]})})}),(0,Q.jsx)(r,{width:`full`,display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(300px, 1fr))`,gap:4,children:R.data?.map(e=>(0,Q.jsx)($,{name:e.name,description:e.description??``,permissionCount:`${e.permissions.length} permissions`,hasPermission:t,onDelete:()=>F({id:e.id,name:e.name}),onEdit:()=>{U(e.id)},onViewPermissions:()=>{W(e.id)}},e.id))})]}),(0,Q.jsx)(me,{open:o,onClose:m,onSubmit:async t=>{await z.mutateAsync({organizationId:e,name:t.name,description:t.description,permissions:t.permissions})},title:`Create Custom Role`,submitLabel:`Create Role`,isSubmitting:z.isLoading}),(0,Q.jsx)(me,{open:g,onClose:()=>{y(),D(null)},onSubmit:async e=>{E&&await H.mutateAsync({roleId:E.id,name:e.name,description:e.description,permissions:e.permissions})},initialData:E?{name:E.name,description:E.description,permissions:E.permissions}:void 0,title:`Edit Role`,submitLabel:`Update Role`,isSubmitting:H.isLoading}),(0,Q.jsx)(ee,{open:!!M,onOpenChange:e=>{e||F(null)},title:`Delete role`,message:`Are you sure you want to delete the role "${M?.name??``}"?`,confirmLabel:`Delete`,tone:`danger`,loading:B.isLoading,onConfirm:()=>{M&&B.mutate({roleId:M.id},{onSettled:()=>F(null)})}}),(0,Q.jsx)(V.Root,{open:b,onOpenChange:({open:e})=>!e&&S(),children:(0,Q.jsxs)(V.Content,{bg:`bg`,maxWidth:`600px`,maxHeight:`80vh`,overflowY:`auto`,children:[(0,Q.jsx)(V.Header,{children:(0,Q.jsxs)(V.Title,{children:[`View Permissions - `,O?.name]})}),(0,Q.jsx)(V.Body,{children:O&&(0,Q.jsxs)(l,{gap:4,align:`start`,children:[(0,Q.jsxs)(l,{align:`start`,gap:2,width:`full`,children:[(0,Q.jsx)(c,{fontWeight:`semibold`,children:`Description:`}),(0,Q.jsx)(c,{color:`fg.muted`,children:O.description||`No description provided`})]}),(0,Q.jsx)(v,{}),(0,Q.jsxs)(l,{align:`start`,gap:3,width:`full`,children:[(0,Q.jsxs)(c,{fontWeight:`semibold`,children:[`Permissions (`,O.permissions.length,`):`]}),(0,Q.jsx)(fe,{permissions:O.permissions})]})]})}),(0,Q.jsx)(V.Footer,{children:(0,Q.jsx)(i,{variant:`outline`,onClick:S,children:`Close`})}),(0,Q.jsx)(V.CloseTrigger,{})]})}),(0,Q.jsx)(V.Root,{open:C,onOpenChange:({open:e})=>!e&&T(),children:(0,Q.jsxs)(V.Content,{bg:`bg`,maxWidth:`600px`,maxHeight:`80vh`,overflowY:`auto`,children:[(0,Q.jsx)(V.Header,{children:(0,Q.jsxs)(V.Title,{children:[`View Permissions - `,A?.name]})}),(0,Q.jsx)(V.Body,{children:A&&(0,Q.jsxs)(l,{gap:4,align:`start`,children:[(0,Q.jsxs)(l,{align:`start`,gap:2,width:`full`,children:[(0,Q.jsx)(c,{fontWeight:`semibold`,children:`Description:`}),(0,Q.jsx)(c,{color:`fg.muted`,children:A.description})]}),(0,Q.jsx)(v,{}),(0,Q.jsxs)(l,{align:`start`,gap:3,width:`full`,children:[(0,Q.jsxs)(c,{fontWeight:`semibold`,children:[`Permissions (`,A.permissions.length,`):`]}),(0,Q.jsx)(fe,{permissions:A.permissions})]})]})}),(0,Q.jsx)(V.Footer,{children:(0,Q.jsx)(i,{variant:`outline`,onClick:T,children:`Close`})}),(0,Q.jsx)(V.CloseTrigger,{})]})})]})}export{ge as default};
2
- //# sourceMappingURL=roles-CQDx2TP6.js.map
@@ -1,5 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{a as n,dn as r,i,n as a}from"./portal-Sdfvrza9.js";import{t as o}from"./jsx-runtime-CFwixLRt.js";import{t as s}from"./heading-C0sACr0w.js";import{n as c,t as l}from"./v-stack-hkuSkmCA.js";import{t as u}from"./badge-Cpc3eA-C.js";import{n as d}from"./toaster-BsYkODqs.js";import{K as f,O as p,nt as m,r as h}from"./Markdown-C9extmbX.js";import{a as g,n as _,r as v}from"./field-BadoNaN5.js";import{t as y}from"./icon-button-Wlb_dGXL.js";import{n as b}from"./personalProject-DMRX2-SI.js";import{i as x,p as S,t as C}from"./errors-e711UMq7.js";import{r as w,t as T}from"./native-select-DL2k8x0o.js";import{t as E}from"./spacer-C38e7o6r.js";import{tt as D}from"./immer-CFru3D02.js";import{n as O}from"./api-l6Cnm0vQ.js";import{t as k}from"./GovernanceLayout-DiDbO74a.js";import{t as A}from"./arrow-down-CVwbPIqs.js";import{t as j}from"./arrow-up-BNJSVMQt.js";import{t as M}from"./ScopeChipPicker-B3xHf0Ii.js";import{t as N}from"./star-DpfQOsot.js";import{Mr as P,Qn as F,Vn as I,Vt as L,nr as R,or as z,t as B}from"./index-CPtTUYLD.js";import{t as V}from"./WithFeatureFlagGuard-OePuXWRG.js";import{t as H}from"./WithPermissionGuard-Cr6Aljmy.js";import{t as U}from"./FieldInfoTooltip-BlO6fteF.js";import{t as W}from"./ProviderScopeChips-D7HJW6Ht.js";var G=e(t()),K=o(),q=[{scope:`organization`,label:`Organization defaults`,subtitle:`Apply to every team / project that doesn't define its own default`},{scope:`team`,label:`Team defaults`,subtitle:`Override the org default for users in a specific team`},{scope:`project`,label:`Project defaults`,subtitle:`Override at the project level for production agents`}],J=[{value:`priority`,label:`Priority (try in order)`},{value:`cost`,label:`Cost-optimised`},{value:`latency`,label:`Latency-optimised`},{value:`round_robin`,label:`Round-robin`}];function Y(){let{organization:e}=L({redirectToOnboarding:!1}),t=e?.id??``,o=O.routingPolicy.list.useQuery({organizationId:t},{enabled:!!t,refetchOnWindowFocus:!1}),u=O.modelProvider.listAllForOrganizationForFrontend.useQuery({organizationId:t},{enabled:!!t,refetchOnWindowFocus:!1}),[f,p]=(0,G.useState)(null),[m,g]=(0,G.useState)(null),[_,v]=(0,G.useState)(null),y=(0,G.useMemo)(()=>e?.teams?.map(e=>({id:e.id,name:e.name}))??[],[e?.teams]),b=(0,G.useMemo)(()=>e?.teams?.flatMap(e=>e.projects.map(t=>({id:t.id,name:`${t.name} · ${e.name}`,teamId:e.id})))??[],[e?.teams]),w=(0,G.useMemo)(()=>{let t=new Map;for(let n of e?.teams??[])t.set(n.id,n.name);return t},[e?.teams]),T=(0,G.useMemo)(()=>{let t=new Map;for(let n of e?.teams??[])for(let e of n.projects)t.set(e.id,e.name);return t},[e?.teams]),D=t=>t.map(t=>({scopeType:t.scopeType,scopeId:t.scopeId,name:t.scopeType===`ORGANIZATION`?e?.name:t.scopeType===`TEAM`?w.get(t.scopeId):T.get(t.scopeId)})),A=O.useUtils(),j=()=>A.routingPolicy.list.invalidate({organizationId:t}),[M,N]=(0,G.useState)(null),P=O.routingPolicy.create.useMutation({onSuccess:()=>{j(),p(null),v(null),N(null),d.create({title:`Routing policy created`,type:`success`})},onError:e=>{N(x({error:e,fallbackTitle:`Couldn't create routing policy`}))}}),I=O.routingPolicy.update.useMutation({onSuccess:()=>{j(),p(null),v(null),N(null),d.create({title:`Routing policy updated`,type:`success`})},onError:e=>{N(x({error:e,fallbackTitle:`Couldn't update routing policy`}))}}),R=O.routingPolicy.setDefault.useMutation({onSuccess:()=>{j(),d.create({title:`Default policy updated`,type:`success`})},onError:e=>C({error:e,fallbackTitle:`Couldn't set the default policy`})}),V=O.routingPolicy.delete.useMutation({onSuccess:()=>{j(),g(null),d.create({title:`Routing policy deleted`,type:`success`})},onError:e=>C({error:e,fallbackTitle:`Couldn't delete routing policy`})}),H=(0,G.useMemo)(()=>{let e={organization:[],team:[],project:[]};for(let t of o.data??[]){let n=t.scopes?.[0];if(!n)continue;let r=String(n.scopeType).toLowerCase();e[r]&&e[r].push(t)}return e},[o.data]),U=(e,n,r=!1)=>{N(null),p(`new`);let i=e.toUpperCase(),a=i===`ORGANIZATION`?t:n;v({scopes:a?[{scopeType:i,scopeId:a}]:[],name:``,description:``,strategy:`priority`,modelProviderIds:[],modelAllowlist:[],isDefault:r,aliases:[],policyRules:Z})},W=e=>{N(null),p(e.id);let t=e.scopes.map(e=>({scopeType:e.scopeType,scopeId:e.scopeId})),n=e.modelAliases??{};v({scopes:t,name:e.name,description:e.description??``,strategy:e.strategy,modelProviderIds:Array.isArray(e.modelProviderIds)?e.modelProviderIds:[],modelAllowlist:Array.isArray(e.modelAllowlist)?e.modelAllowlist:[],isDefault:e.isDefault,aliases:Object.entries(n).map(([e,t])=>({from:e,to:t})),policyRules:te(e.policyRules)})},J=()=>{if(!_)return;let e={};for(let t of _.aliases){let n=t.from.trim(),r=t.to.trim();n&&r&&(e[n]=r)}let n=ee(_.policyRules);f===`new`?P.mutate({organizationId:t,scopes:_.scopes,name:_.name,description:_.description||null,modelProviderIds:_.modelProviderIds,modelAllowlist:_.modelAllowlist.length>0?_.modelAllowlist:null,strategy:_.strategy,isDefault:_.isDefault,modelAliases:e,policyRules:n}):f&&I.mutate({organizationId:t,id:f,name:_.name,description:_.description||null,modelProviderIds:_.modelProviderIds,modelAllowlist:_.modelAllowlist.length>0?_.modelAllowlist:null,strategy:_.strategy,modelAliases:e,policyRules:n})},Y=H.organization.length+H.team.length+H.project.length>0,Q=[...H.organization,...H.team,...H.project].some(e=>e.isDefault);return(0,K.jsxs)(k,{pageTitle:`Routing Policies · AI Governance · LangWatch`,children:[(0,K.jsxs)(l,{align:`stretch`,gap:6,width:`full`,maxW:`container.xl`,children:[(0,K.jsxs)(a,{alignItems:`end`,children:[(0,K.jsxs)(l,{align:`start`,gap:0,children:[(0,K.jsx)(s,{as:`h2`,size:`lg`,children:`Routing Policies`}),(0,K.jsx)(c,{color:`fg.muted`,fontSize:`sm`,children:`Define which providers and models personal, team, and project keys route through. The hierarchy is project → team → organization; first match wins.`})]}),(0,K.jsx)(E,{})]}),o.isLoading&&(0,K.jsx)(n,{size:`sm`}),!o.isLoading&&!Q&&(0,K.jsx)(r,{borderWidth:`1px`,borderColor:`orange.300`,borderRadius:`md`,backgroundColor:`orange.50`,padding:4,children:(0,K.jsxs)(a,{alignItems:`start`,gap:3,children:[(0,K.jsx)(r,{color:`orange.600`,paddingTop:`2px`,children:(0,K.jsx)(z,{size:18})}),(0,K.jsxs)(l,{align:`start`,gap:1,children:[(0,K.jsx)(c,{fontSize:`sm`,fontWeight:`semibold`,children:Y?`Mark one of your policies as default`:`Publish a default policy to unblock end-user keys`}),(0,K.jsxs)(c,{fontSize:`xs`,color:`fg.muted`,children:[`When at least one model provider is reachable from a user's personal team, personal keys still mint without a default and the gateway picks providers in`,` `,(0,K.jsx)(c,{as:`span`,fontFamily:`mono`,children:`fallbackPriorityGlobal`}),` `,`order. Orgs with zero accessible providers still hit a 409 at issue time; configure a model provider first. Publish an explicit default to pin a deterministic chain at the organization level, then override per-team or per-project as needed.`]}),(0,K.jsxs)(a,{gap:3,paddingTop:1,children:[(0,K.jsxs)(i,{size:`xs`,colorPalette:`orange`,onClick:()=>U(`organization`,t,!0),children:[(0,K.jsx)(F,{size:12}),` Add organization default`]}),(0,K.jsx)(B,{href:S(`/ai-gateway/governance/routing-policies`),isExternal:!0,color:`orange.700`,fontSize:`xs`,fontWeight:`medium`,children:`Docs →`})]})]})]})}),q.map(({scope:e,label:n,subtitle:o})=>(0,K.jsxs)(r,{borderWidth:`1px`,borderColor:`border.muted`,borderRadius:`md`,padding:4,children:[(0,K.jsxs)(a,{alignItems:`start`,marginBottom:3,children:[(0,K.jsxs)(l,{align:`start`,gap:0,children:[(0,K.jsx)(c,{fontSize:`sm`,fontWeight:`semibold`,children:n}),(0,K.jsx)(c,{fontSize:`xs`,color:`fg.muted`,children:o})]}),(0,K.jsx)(E,{}),(0,K.jsxs)(i,{size:`sm`,variant:`outline`,onClick:()=>U(e,e===`organization`?t:``),children:[(0,K.jsx)(F,{size:14}),` New`]})]}),(0,K.jsxs)(l,{align:`stretch`,gap:2,children:[H[e].length===0&&(0,K.jsx)(c,{fontSize:`sm`,color:`fg.muted`,children:`No policies defined at this scope.`}),H[e].map(e=>(0,K.jsx)(X,{policy:e,onEdit:()=>W(e),onSetDefault:()=>R.mutate({organizationId:t,id:e.id}),onDelete:()=>g(e),isPendingSetDefault:R.isPending&&R.variables?.id===e.id,isPendingDelete:V.isPending&&V.variables?.id===e.id,resolveScopeEntriesWithNames:D},e.id))]})]},e))]}),(0,K.jsx)(ie,{open:_!==null,composer:_,setComposer:v,mode:f===`new`?`create`:`edit`,isPending:f===`new`?P.isPending:I.isPending,availableCredentials:u.data?u.data.providers.filter(e=>!!e.id).map(e=>({id:e.id,modelProviderName:e.name??e.provider,slot:`primary`,disabledAt:e.disabledAt?new Date(e.disabledAt).toISOString():null,healthStatus:e.healthStatus??`UNKNOWN`})):[],credentialsLoading:u.isLoading,modelProvidersAdminPath:`/settings/model-providers`,errorMessage:M,onClearError:()=>N(null),onSubmit:J,onCancel:()=>{N(null),p(null),v(null)},organizationId:t,organizationName:e?.name,availableTeams:y,availableProjects:b,resolveScopeEntriesWithNames:D}),(0,K.jsx)(h,{open:!!m,onOpenChange:e=>{e||g(null)},title:m?.isDefault?`Delete default policy "${m?.name}"?`:`Delete routing policy "${m?.name??``}"?`,message:m?.isDefault?`This is the default policy at this scope. NEW personal-key issuance falls back to fallbackPriorityGlobal ordering across scope-eligible providers until another default is published. Existing VKs that already reference this policy keep the persisted routingPolicyId and will fail closed on the next request until you re-bind them to another policy.`:`Virtual keys that explicitly reference this policy will lose the reference and fail closed at the next request. Re-publish or pick another policy on the affected VKs to restore routing.`,confirmLabel:`Delete policy`,tone:`danger`,loading:V.isPending,onConfirm:()=>{m&&V.mutate({organizationId:t,id:m.id})}})]})}function X({policy:e,onEdit:t,onSetDefault:n,onDelete:r,isPendingSetDefault:o,isPendingDelete:s,resolveScopeEntriesWithNames:d}){let p=Array.isArray(e.modelAllowlist)?e.modelAllowlist.length:0,m=Array.isArray(e.modelProviderIds)?e.modelProviderIds.length:0,h=e.scopes.map(e=>({scopeType:e.scopeType,scopeId:e.scopeId}));return(0,K.jsxs)(a,{borderWidth:`1px`,borderColor:e.isDefault?`blue.300`:`border.muted`,borderRadius:`sm`,padding:3,gap:3,children:[(0,K.jsxs)(l,{align:`start`,gap:1,flex:1,minWidth:0,children:[(0,K.jsxs)(a,{gap:2,flexWrap:`wrap`,children:[(0,K.jsx)(c,{fontSize:`sm`,fontWeight:`medium`,children:e.name}),e.isDefault&&(0,K.jsx)(u,{colorPalette:`blue`,size:`sm`,variant:`surface`,children:`default`}),(0,K.jsx)(u,{size:`sm`,variant:`surface`,children:e.strategy}),(0,K.jsx)(W,{scopes:d(h),size:`xs`})]}),e.description&&(0,K.jsx)(c,{fontSize:`xs`,color:`fg.muted`,children:e.description}),(0,K.jsxs)(c,{fontSize:`xs`,color:`fg.muted`,children:[m,` provider`,m===1?``:`s`,p>0&&` · ${p} model glob${p===1?``:`s`} allow-listed`,p===0&&` · no model restrictions`]})]}),!e.isDefault&&(0,K.jsxs)(i,{size:`sm`,variant:`ghost`,onClick:n,loading:o,title:`Set as default for this scope`,children:[(0,K.jsx)(N,{size:14}),` Set default`]}),(0,K.jsxs)(i,{size:`sm`,variant:`ghost`,onClick:t,children:[(0,K.jsx)(R,{size:14}),` Edit`]}),(0,K.jsx)(i,{size:`sm`,variant:`ghost`,colorPalette:`red`,onClick:r,loading:s,children:(0,K.jsx)(f,{size:14})})]})}var Z={tools:{deny:``,allow:``},mcp:{deny:``,allow:``},urls:{deny:``,allow:``},models:{deny:``,allow:``}},Q={tools:{label:`Tools`,placeholderDeny:`e.g. ^shell_.*
2
- delete_user`,helper:`RE2 regexes matched against OpenAI tools[].function.name + Anthropic tools[].name. Deny wins.`},mcp:{label:`MCP servers`,placeholderDeny:`e.g. unapproved\\.example\\.com`,helper:`Matched against mcp_servers[].name and .url. Deny wins; applies before dispatch.`},urls:{label:`URLs`,placeholderDeny:`e.g. internal\\.corp\\..*`,helper:`Extracted from the raw request body (user messages, tool args, system prompts). First deny match returns 403 url_not_allowed.`},models:{label:`Models (policy)`,placeholderDeny:`e.g. gpt-4o-search.*`,helper:`RE2 regex policy distinct from the model allowlist above. Use this to enforce company policy (e.g. no non-deterministic models).`}};function $(e){return e.split(/\r?\n/).map(e=>e.trim()).filter(e=>e.length>0)}function ee(e){let t={};for(let n of[`tools`,`mcp`,`urls`,`models`]){let r=$(e[n].deny),i=$(e[n].allow);t[n]={deny:r,allow:i.length>0?i:null}}return t}function te(e){let t={...Z};if(!e||typeof e!=`object`)return t;let n=e;for(let e of[`tools`,`mcp`,`urls`,`models`]){let r=n[e];if(!r||typeof r!=`object`)continue;let i=r,a=Array.isArray(i.deny)?i.deny.filter(e=>typeof e==`string`):[],o=Array.isArray(i.allow)?i.allow.filter(e=>typeof e==`string`):[];t[e]={deny:a.join(`
3
- `),allow:o.join(`
4
- `)}}return t}function ne({values:e,onChange:t,placeholder:n,ordered:r,inputAriaLabel:o}){let[s,u]=(0,G.useState)(``),d=()=>{let n=s.split(`,`).map(e=>e.trim()).filter(t=>t.length>0&&!e.includes(t));if(n.length===0){u(``);return}t([...e,...n]),u(``)},f=n=>t(e.filter((e,t)=>t!==n)),p=(n,r)=>{if(n<0||r<0||n>=e.length||r>=e.length)return;let i=e.slice(),a=i[n];i[n]=i[r],i[r]=a,t(i)},m=e=>p(e,e-1),h=e=>p(e,e+1);return(0,K.jsxs)(l,{align:`stretch`,gap:2,children:[e.length>0&&(0,K.jsx)(l,{align:`stretch`,gap:1,children:e.map((t,n)=>(0,K.jsxs)(a,{borderWidth:`1px`,borderColor:`border.muted`,borderRadius:`sm`,paddingX:2,paddingY:1,gap:2,backgroundColor:`bg.subtle`,children:[r&&(0,K.jsxs)(c,{fontSize:`xs`,color:`fg.muted`,minWidth:`20px`,children:[n+1,`.`]}),(0,K.jsx)(c,{fontSize:`sm`,flex:1,fontFamily:`mono`,children:t}),r&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(i,{size:`xs`,variant:`ghost`,onClick:()=>m(n),disabled:n===0,"aria-label":`Move up`,children:(0,K.jsx)(j,{size:12})}),(0,K.jsx)(i,{size:`xs`,variant:`ghost`,onClick:()=>h(n),disabled:n===e.length-1,"aria-label":`Move down`,children:(0,K.jsx)(A,{size:12})})]}),(0,K.jsx)(i,{size:`xs`,variant:`ghost`,onClick:()=>f(n),"aria-label":`Remove`,children:(0,K.jsx)(I,{size:12})})]},`${t}-${n}`))}),(0,K.jsxs)(a,{gap:2,children:[(0,K.jsx)(P,{"aria-label":o,value:s,onChange:e=>u(e.target.value),onKeyDown:e=>{(e.key===`Enter`||e.key===`,`)&&(e.preventDefault(),d())},onBlur:()=>{s.trim().length>0&&d()},placeholder:n,size:`sm`}),(0,K.jsxs)(i,{size:`sm`,variant:`outline`,onClick:d,disabled:s.trim().length===0,children:[(0,K.jsx)(F,{size:12}),` Add`]})]})]})}function re({selectedIds:e,onChange:t,available:o,loading:s,modelProvidersAdminPath:u}){let d=(0,G.useMemo)(()=>{let e=new Map;for(let t of o)e.set(t.id,t);return e},[o]),f=(0,G.useMemo)(()=>o.filter(e=>!e.disabledAt),[o]),p=(0,G.useMemo)(()=>f.filter(t=>!e.includes(t.id)),[f,e]),m=o.length>0&&f.length===0,h=n=>t(e.filter((e,t)=>t!==n)),g=(n,r)=>{if(n<0||r<0||n>=e.length||r>=e.length)return;let i=e.slice(),a=i[n];i[n]=i[r],i[r]=a,t(i)},_=n=>{!n||e.includes(n)||t([...e,n])},v=e=>e.slot&&e.slot!==`primary`?`${e.modelProviderName} (${e.slot})`:e.modelProviderName;return s?(0,K.jsxs)(a,{gap:2,children:[(0,K.jsx)(n,{size:`xs`}),(0,K.jsx)(c,{fontSize:`sm`,color:`fg.muted`,children:`Loading model providers…`})]}):o.length===0&&e.length===0?(0,K.jsx)(r,{borderWidth:`1px`,borderColor:`orange.300`,borderRadius:`md`,backgroundColor:`orange.50`,padding:3,children:(0,K.jsxs)(l,{align:`start`,gap:1,children:[(0,K.jsx)(c,{fontSize:`sm`,fontWeight:`semibold`,children:`No model providers yet`}),(0,K.jsx)(c,{fontSize:`xs`,color:`fg.muted`,children:`A routing policy points at one or more model providers. Configure at least one before saving this policy.`}),u&&(0,K.jsx)(B,{href:u,color:`orange.700`,fontSize:`xs`,fontWeight:`medium`,children:`Open Model Providers admin →`})]})}):m&&e.length===0?(0,K.jsx)(r,{borderWidth:`1px`,borderColor:`orange.300`,borderRadius:`md`,backgroundColor:`orange.50`,padding:3,children:(0,K.jsxs)(l,{align:`start`,gap:1,children:[(0,K.jsx)(c,{fontSize:`sm`,fontWeight:`semibold`,children:`All model providers are disabled`}),(0,K.jsxs)(c,{fontSize:`xs`,color:`fg.muted`,children:[o.length===1?`The org has 1 model provider, but it's disabled.`:`The org has ${o.length} model providers, but all are disabled.`,` `,`Re-enable one (or add a fresh one) before this policy can route traffic.`]}),u&&(0,K.jsx)(B,{href:u,color:`orange.700`,fontSize:`xs`,fontWeight:`medium`,children:`Open Model Providers admin →`})]})}):(0,K.jsxs)(l,{align:`stretch`,gap:2,children:[e.length>0&&(0,K.jsx)(l,{align:`stretch`,gap:1,children:e.map((t,n)=>{let r=d.get(t),o=r?v(r):null;return(0,K.jsxs)(a,{borderWidth:`1px`,borderColor:r?`border.muted`:`red.300`,borderRadius:`sm`,paddingX:2,paddingY:1,gap:2,backgroundColor:r?`bg.subtle`:`red.50`,children:[(0,K.jsxs)(c,{fontSize:`xs`,color:`fg.muted`,minWidth:`20px`,children:[n+1,`.`]}),(0,K.jsxs)(l,{align:`start`,gap:0,flex:1,minWidth:0,children:[(0,K.jsx)(c,{fontSize:`sm`,fontWeight:`medium`,children:o??`Unknown credential`}),(0,K.jsx)(c,{fontSize:`xs`,color:`fg.muted`,fontFamily:`mono`,children:t}),r?.disabledAt&&(0,K.jsx)(c,{fontSize:`xs`,color:`orange.600`,children:`Disabled - requests will skip this credential`})]}),(0,K.jsx)(i,{size:`xs`,variant:`ghost`,onClick:()=>g(n,n-1),disabled:n===0,"aria-label":`Move up`,children:(0,K.jsx)(j,{size:12})}),(0,K.jsx)(i,{size:`xs`,variant:`ghost`,onClick:()=>g(n,n+1),disabled:n===e.length-1,"aria-label":`Move down`,children:(0,K.jsx)(A,{size:12})}),(0,K.jsx)(i,{size:`xs`,variant:`ghost`,onClick:()=>h(n),"aria-label":`Remove`,children:(0,K.jsx)(I,{size:12})})]},`${t}-${n}`)})}),p.length>0?(0,K.jsx)(w,{size:`sm`,children:(0,K.jsxs)(T,{value:``,"aria-label":`Add model provider`,onChange:e=>{let t=e.target.value;t&&(_(t),e.target.value=``)},children:[(0,K.jsx)(`option`,{value:``,children:`+ Add model provider…`}),p.map(e=>(0,K.jsxs)(`option`,{value:e.id,children:[v(e),e.disabledAt?` - disabled`:``]},e.id))]})}):(0,K.jsx)(c,{fontSize:`xs`,color:`fg.muted`,children:`All configured model providers are in this policy.`})]})}function ie({open:e,composer:t,setComposer:n,mode:o,isPending:s,availableCredentials:u,credentialsLoading:d,modelProvidersAdminPath:h,errorMessage:x,onClearError:S,onSubmit:C,onCancel:E,organizationId:O,organizationName:k,availableTeams:A,availableProjects:j,resolveScopeEntriesWithNames:N}){let L=!t?.name.trim()||t.scopes.length===0||t.modelProviderIds.length===0||s;return(0,K.jsx)(b.Root,{open:e,onOpenChange:({open:e})=>{e||E()},placement:`end`,size:`md`,children:(0,K.jsxs)(b.Content,{children:[(0,K.jsxs)(b.Header,{children:[(0,K.jsx)(b.Title,{children:o===`create`?`New routing policy`:`Edit routing policy`}),(0,K.jsx)(b.CloseTrigger,{})]}),(0,K.jsx)(b.Body,{children:t&&(0,K.jsxs)(l,{align:`stretch`,gap:4,children:[(0,K.jsxs)(g,{required:!0,children:[(0,K.jsx)(v,{children:`Scopes`}),o===`create`?(0,K.jsx)(M,{value:t.scopes,onChange:e=>n({...t,scopes:e}),organizationId:O,organizationName:k,availableTeams:A,availableProjects:j,label:``}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(W,{scopes:N(t.scopes)}),(0,K.jsx)(_,{children:`Scope is fixed after create. Delete and recreate to change which org / team / project this policy applies to.`})]})]}),(0,K.jsxs)(g,{required:!0,children:[(0,K.jsx)(v,{children:`Name`}),(0,K.jsx)(P,{value:t.name,onChange:e=>n({...t,name:e.target.value}),placeholder:`e.g. developer-default`,autoFocus:!0})]}),(0,K.jsxs)(g,{required:!0,children:[(0,K.jsx)(v,{children:`Strategy`}),(0,K.jsx)(w,{size:`sm`,children:(0,K.jsx)(T,{value:t.strategy,onChange:e=>n({...t,strategy:e.target.value}),children:J.map(e=>(0,K.jsx)(`option`,{value:e.value,children:e.label},e.value))})})]}),(0,K.jsxs)(g,{children:[(0,K.jsx)(v,{children:`Description`}),(0,K.jsx)(D,{rows:2,value:t.description,onChange:e=>n({...t,description:e.target.value}),placeholder:`What this policy is for`})]}),(0,K.jsxs)(g,{required:!0,children:[(0,K.jsxs)(v,{children:[`Model Providers (ordered)`,(0,K.jsx)(U,{description:`Ordered list of the org's model providers. The gateway tries #1 first; on 5xx, timeout, rate-limit, or circuit-breaker the next item in the list takes over. Re-order with the ↑/↓ arrows on each row to set fallback priority.`,docHref:`/ai-gateway/governance/routing-policies`})]}),(0,K.jsx)(re,{selectedIds:t.modelProviderIds,onChange:e=>n({...t,modelProviderIds:e}),available:u,loading:d,modelProvidersAdminPath:h}),(0,K.jsx)(_,{children:`First match wins. Use ↑/↓ to set fallback priority.`})]}),(0,K.jsxs)(g,{children:[(0,K.jsx)(v,{children:`Model allowlist (globs)`}),(0,K.jsx)(ne,{values:t.modelAllowlist,onChange:e=>n({...t,modelAllowlist:e}),placeholder:`claude-*`,ordered:!1,inputAriaLabel:`Add model allowlist glob`}),(0,K.jsx)(_,{children:`Empty = no restriction. Globs match against the requested model name.`})]}),(0,K.jsx)(m,{}),(0,K.jsxs)(a,{children:[(0,K.jsx)(c,{fontSize:`sm`,fontWeight:`semibold`,children:`Model aliases`}),(0,K.jsx)(U,{description:`Rewrite the model name a client requests before it reaches the provider. Useful for mapping 'gpt-4o' -> 'gpt-4o-mini' for cost control, or fanning one logical model across providers.`,docHref:`/ai-gateway/model-aliases`})]}),(0,K.jsx)(c,{fontSize:`xs`,color:`fg.muted`,children:`Per-policy alias rewrite. Applied to the model field before dispatch.`}),(0,K.jsxs)(l,{align:`stretch`,gap:2,children:[t.aliases.map((e,r)=>(0,K.jsxs)(a,{children:[(0,K.jsx)(P,{placeholder:`from (e.g. gpt-4o)`,size:`sm`,value:e.from,onChange:e=>n({...t,aliases:t.aliases.map((t,n)=>n===r?{...t,from:e.target.value}:t)})}),(0,K.jsx)(c,{children:`->`}),(0,K.jsx)(P,{placeholder:`to (e.g. gpt-4o-mini)`,size:`sm`,value:e.to,onChange:e=>n({...t,aliases:t.aliases.map((t,n)=>n===r?{...t,to:e.target.value}:t)})}),(0,K.jsx)(y,{"aria-label":`Remove alias`,variant:`ghost`,size:`xs`,onClick:()=>n({...t,aliases:t.aliases.filter((e,t)=>t!==r)}),children:(0,K.jsx)(f,{size:12})})]},r)),(0,K.jsxs)(i,{size:`xs`,variant:`outline`,onClick:()=>n({...t,aliases:[...t.aliases,{from:``,to:``}]}),children:[(0,K.jsx)(F,{size:12}),` Add alias`]})]}),(0,K.jsx)(m,{}),(0,K.jsxs)(a,{children:[(0,K.jsx)(c,{fontSize:`sm`,fontWeight:`semibold`,children:`Policy rules`}),(0,K.jsx)(U,{description:`RE2 regex deny/allow lists across 4 dimensions: tools, MCP servers, URLs, models. Enforced pre-dispatch (zero provider cost). Deny wins.`,docHref:`/ai-gateway/policy-rules`})]}),(0,K.jsx)(c,{fontSize:`xs`,color:`fg.muted`,children:`One pattern per line. Broken regex returns 503 fail-closed (never silent bypass).`}),[`tools`,`mcp`,`urls`,`models`].map(e=>(0,K.jsxs)(r,{children:[(0,K.jsx)(c,{fontSize:`sm`,fontWeight:`medium`,mb:1,children:Q[e].label}),(0,K.jsx)(c,{fontSize:`xs`,color:`fg.muted`,mb:2,children:Q[e].helper}),(0,K.jsxs)(a,{gap:3,align:`flex-start`,children:[(0,K.jsxs)(g,{flex:1,children:[(0,K.jsx)(v,{fontSize:`xs`,children:`Deny`}),(0,K.jsx)(D,{value:t.policyRules[e].deny,onChange:r=>n({...t,policyRules:{...t.policyRules,[e]:{...t.policyRules[e],deny:r.target.value}}}),placeholder:Q[e].placeholderDeny,rows:3,fontFamily:`mono`,fontSize:`xs`})]}),(0,K.jsxs)(g,{flex:1,children:[(0,K.jsx)(v,{fontSize:`xs`,children:`Allow (optional)`}),(0,K.jsx)(D,{value:t.policyRules[e].allow,onChange:r=>n({...t,policyRules:{...t.policyRules,[e]:{...t.policyRules[e],allow:r.target.value}}}),placeholder:`leave blank = no allowlist`,rows:3,fontFamily:`mono`,fontSize:`xs`})]})]})]},e)),(0,K.jsx)(p,{checked:t.isDefault,onChange:e=>n({...t,isDefault:e.target.checked}),children:(0,K.jsx)(c,{fontSize:`sm`,children:`Set as default for this scope`})})]})}),(0,K.jsx)(b.Footer,{children:(0,K.jsxs)(l,{align:`stretch`,gap:3,width:`full`,children:[x&&(0,K.jsx)(r,{borderWidth:`1px`,borderColor:`red.300`,borderRadius:`md`,backgroundColor:`red.50`,padding:3,children:(0,K.jsxs)(a,{alignItems:`start`,gap:2,children:[(0,K.jsx)(r,{color:`red.600`,paddingTop:`2px`,children:(0,K.jsx)(I,{size:14})}),(0,K.jsxs)(l,{align:`start`,gap:0,flex:1,minWidth:0,children:[(0,K.jsx)(c,{fontSize:`xs`,fontWeight:`semibold`,color:`red.700`,children:o===`create`?`Couldn't create the policy`:`Couldn't save the policy`}),(0,K.jsx)(c,{fontSize:`xs`,color:`red.700`,children:x})]}),(0,K.jsx)(i,{size:`xs`,variant:`ghost`,onClick:S,"aria-label":`Dismiss error`,children:(0,K.jsx)(I,{size:12})})]})}),(0,K.jsxs)(a,{gap:2,width:`full`,justifyContent:`flex-end`,children:[(0,K.jsx)(i,{variant:`ghost`,onClick:E,disabled:s,children:`Cancel`}),(0,K.jsx)(i,{onClick:C,loading:s,disabled:L,children:o===`create`?`Create policy`:`Save changes`})]})]})})]})})}var ae=V(`release_ui_ai_governance_enabled`,{bypassOnboardingRedirect:!0})(H(`organization:manage`,{})(Y));export{ae as default};
5
- //# sourceMappingURL=routing-policies-uvNo9gfx.js.map
@@ -1,2 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{a as n,dn as r,fn as i,i as a,n as o}from"./portal-Sdfvrza9.js";import{t as s}from"./jsx-runtime-CFwixLRt.js";import{t as c}from"./heading-C0sACr0w.js";import{n as l,t as u}from"./v-stack-hkuSkmCA.js";import{An as d,Ft as f,It as p,Lt as m,On as h,Rt as g}from"./ProjectAvatar-DtI9dT1f.js";import{c as _,d as v,n as y,r as b,u as x}from"./toaster-BsYkODqs.js";import{$ as S,L as C,O as w,Q as T,X as E,Y as D,Z as O,et as k}from"./Markdown-C9extmbX.js";import{t as A}from"./icon-D6xQEiPb.js";import{L as j,t as M}from"./DashboardLayout-BhHe0vIT.js";import{t as N}from"./icon-button-Wlb_dGXL.js";import{g as ee,h as te,r as ne,t as P}from"./errors-e711UMq7.js";import{t as re}from"./spacer-C38e7o6r.js";import{R as F,et as I,tt as L}from"./immer-CFru3D02.js";import{n as R}from"./api-l6Cnm0vQ.js";import{o as z}from"./trpcError-CFsR-0nB.js";import{t as B}from"./archive-CIpRF4hE.js";import{t as V}from"./arrow-right-Cn6z_njp.js";import{t as ie}from"./refresh-cw-CjWtrqB1.js";import{t as ae}from"./tag-DHgQs_5w.js";import{D as oe,Er as H,M as U,N as se,Qn as W,St as G,Vt as K,W as q,pr as ce}from"./index-CPtTUYLD.js";import{t as le}from"./WithPermissionGuard-Cr6Aljmy.js";import{t as ue}from"./useLicenseEnforcement-DOI0dcqD.js";import{a as de,i as fe,n as pe,o as me,r as he,t as J}from"./lib-epD9Y2nV.js";import{t as ge}from"./useModelProvidersSettings-CzJv8_Jy.js";import{a as _e,i as ve,n as Y,o as ye,s as be,t as xe}from"./defaultModelState-DY_b79Yj.js";import{i as X}from"./asaplangy-6A4CIIRR.js";import{t as Se}from"./LangyContextTarget-CIlp_Zew.js";var Ce=v(`pencil-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),Z=e(t()),Q=s();function we({selectedCount:e,onArchive:t}){return e===0?null:(0,Q.jsx)(r,{position:`fixed`,bottom:10,left:`50%`,transform:`translateX(-50%)`,backgroundColor:`#ffffff`,border:`1px solid #ccc`,boxShadow:`0 0 15px rgba(0, 0, 0, 0.2)`,borderRadius:`md`,padding:`8px`,paddingX:`16px`,zIndex:1e3,"data-bottom-floating-bar":``,"data-testid":`batch-action-bar`,children:(0,Q.jsxs)(o,{gap:3,children:[(0,Q.jsxs)(l,{whiteSpace:`nowrap`,fontSize:`sm`,fontWeight:`medium`,children:[e,` selected`]}),(0,Q.jsxs)(a,{size:`sm`,variant:`outline`,colorPalette:`orange`,onClick:t,children:[(0,Q.jsx)(B,{size:14}),`Archive`]})]})})}function Te({allLabels:e,activeLabels:t,onToggle:n}){let r=t.length>0;return(0,Q.jsxs)(m,{positioning:{placement:`bottom-start`},children:[(0,Q.jsx)(g,{asChild:!0,children:(0,Q.jsxs)(a,{size:`sm`,variant:r?`solid`:`outline`,colorPalette:r?`blue`:`gray`,children:[(0,Q.jsx)(ae,{size:14}),`Labels`,r&&(0,Q.jsxs)(l,{as:`span`,fontSize:`xs`,ml:1,children:[`(`,t.length,`)`]})]})}),(0,Q.jsx)(p,{width:`200px`,children:(0,Q.jsx)(f,{children:e.length===0?(0,Q.jsx)(l,{fontSize:`sm`,color:`fg.muted`,children:`No labels available`}):(0,Q.jsx)(u,{align:`stretch`,gap:2,children:e.map(e=>(0,Q.jsxs)(o,{cursor:`pointer`,onClick:()=>n(e),children:[(0,Q.jsx)(w,{checked:t.includes(e)}),(0,Q.jsx)(l,{fontSize:`sm`,children:e})]},e))})})})]})}function Ee({open:e,onClose:t,onConfirm:r,scenarios:i,isLoading:o=!1}){let s=i.length>1,c=s?`Archive ${i.length} scenarios?`:`Archive scenario?`;return(0,Q.jsx)(G.Root,{open:e,onOpenChange:t,placement:`center`,children:(0,Q.jsxs)(G.Content,{bg:`bg`,maxWidth:`500px`,onClick:e=>e.stopPropagation(),children:[(0,Q.jsx)(G.CloseTrigger,{}),(0,Q.jsx)(G.Header,{children:(0,Q.jsx)(G.Title,{fontSize:`md`,fontWeight:`500`,children:c})}),(0,Q.jsx)(G.Body,{children:(0,Q.jsxs)(u,{align:`stretch`,gap:4,children:[s?(0,Q.jsx)(ee,{paddingLeft:4,children:i.map(e=>(0,Q.jsx)(te,{fontSize:`sm`,children:e.name},e.id))}):i[0]&&(0,Q.jsx)(l,{children:(0,Q.jsx)(l,{as:`span`,fontWeight:`semibold`,children:i[0].name})}),(0,Q.jsx)(l,{color:`fg.muted`,fontSize:`sm`,children:`Archived scenarios will no longer appear in the library.`})]})}),(0,Q.jsxs)(G.Footer,{children:[(0,Q.jsx)(a,{variant:`outline`,mr:3,onClick:e=>{e.stopPropagation(),t()},disabled:o,children:`Cancel`}),(0,Q.jsx)(a,{colorPalette:`orange`,onClick:e=>{e.stopPropagation(),r()},disabled:o,children:o?(0,Q.jsx)(n,{size:`sm`}):`Archive`})]})]})})}var De=`Describe your scenario. What does your agent do? What situation do you want to test?`,Oe=`Generating...`,ke=6e4;function Ae({open:e,onClose:t,title:n,placeholder:i=De,exampleTemplates:a,onGenerate:s,onSkip:c,generatingText:d=Oe,footerHint:f,assistant:p}){let[m,h]=(0,Z.useState)(``),[g,_]=(0,Z.useState)(`idle`),[v,y]=(0,Z.useState)(`assist`),[b,x]=(0,Z.useState)(null),S=(0,Z.useRef)(null);(0,Z.useEffect)(()=>()=>{S.current&&clearTimeout(S.current)},[]),(0,Z.useEffect)(()=>{e&&(h(``),_(`idle`),y(`assist`),x(null))},[e]);let C=(0,Z.useCallback)(e=>{h(e.target.value)},[]),w=(0,Z.useCallback)(e=>{h(e)},[]),T=(0,Z.useCallback)(async()=>{if(!m.trim())return;let e=s(m);if(!e)return;_(`generating`),x(null);let t=new Promise((e,t)=>{S.current=setTimeout(()=>{t(Error(`Generation timed out. Please try again.`))},ke)});try{await Promise.race([e,t])}catch(e){console.error(`[AICreateModal] generation error:`,e),_(`error`),x(e)}finally{S.current&&=(clearTimeout(S.current),null)}},[m,s]),E=(0,Z.useCallback)(()=>{T()},[T]),D=(0,Z.useCallback)(()=>{c()},[c]),O=(0,Z.useCallback)(e=>{!e.open&&g!==`generating`&&t()},[g,t]),k=g!==`generating`;return(0,Q.jsx)(G.Root,{open:e,onOpenChange:O,children:(0,Q.jsxs)(G.Content,{className:p?`langy-root`:void 0,bg:p?X.bg:`bg`,maxWidth:p?`620px`:void 0,overflow:`hidden`,borderWidth:p?`1px`:void 0,borderColor:p?X.border:void 0,boxShadow:p?`0 28px 90px -32px rgba(2, 6, 23, 0.62)`:void 0,children:[p&&(0,Q.jsx)(se,{}),k&&(0,Q.jsx)(G.CloseTrigger,{}),(0,Q.jsx)(G.Header,{pb:p?3:void 0,children:p?(0,Q.jsxs)(o,{align:`start`,gap:3,paddingRight:8,children:[(0,Q.jsx)(r,{display:`grid`,placeItems:`center`,width:`42px`,height:`42px`,flexShrink:0,borderRadius:`12px`,borderWidth:`1px`,borderColor:`border.muted`,bg:`bg.surface`,children:(0,Q.jsx)(U,{size:27})}),(0,Q.jsxs)(r,{children:[(0,Q.jsxs)(o,{gap:2,align:`baseline`,flexWrap:`wrap`,children:[(0,Q.jsx)(G.Title,{children:n}),v===`assist`&&(0,Q.jsxs)(l,{fontSize:`xs`,fontWeight:`semibold`,color:`fg.muted`,letterSpacing:`0.04em`,children:[`with `,p.name]})]}),(0,Q.jsx)(l,{color:`fg.muted`,fontSize:`sm`,marginTop:1,children:v===`manual`?`Build the scenario yourself. ${p.name} stays one click away if you want a first draft.`:p.description})]})]}):(0,Q.jsx)(G.Title,{children:n})}),(0,Q.jsxs)(G.Body,{pb:p?4:void 0,children:[g===`idle`&&(p?(0,Q.jsxs)(u,{align:`stretch`,gap:5,children:[(0,Q.jsx)(Le,{mode:v,onChange:y,assistantName:p.name}),v===`assist`?(0,Q.jsxs)(u,{align:`stretch`,gap:4,children:[(0,Q.jsxs)(r,{children:[(0,Q.jsx)(l,{mb:2,fontSize:`11px`,fontWeight:`bold`,color:`fg.muted`,letterSpacing:`0.1em`,textTransform:`uppercase`,children:p.promptLabel??`Tell ${p.name} what to test`}),(0,Q.jsx)(L,{placeholder:i,value:m,onChange:C,rows:6,resize:`vertical`,fontSize:`md`})]}),(0,Q.jsx)(Me,{assistantName:p.name,templates:a,onTemplate:w})]}):(0,Q.jsx)(ze,{assistantName:p.name})]}):(0,Q.jsx)(je,{description:m,placeholder:i,exampleTemplates:a,onDescriptionChange:C,onExampleClick:w})),g===`generating`&&(0,Q.jsx)(Pe,{text:d,assistant:p}),g===`error`&&(0,Q.jsx)(Fe,{error:b})]}),(0,Q.jsxs)(G.Footer,{children:[g===`idle`&&(p?v===`assist`?(0,Q.jsx)(Ne,{onGenerate:T,isGenerateDisabled:!m.trim(),footerHint:f,assistant:p}):(0,Q.jsx)(Be,{onSkip:D}):(0,Q.jsx)(Ie,{onSkip:D,onGenerate:T,isGenerateDisabled:!m.trim(),footerHint:f})),g===`error`&&(0,Q.jsx)(Ve,{error:b,onSkip:D,onTryAgain:E,assistant:p})]})]})})}function je({description:e,placeholder:t,exampleTemplates:n,onDescriptionChange:i,onExampleClick:s}){return(0,Q.jsxs)(u,{align:`stretch`,gap:4,children:[(0,Q.jsx)(L,{placeholder:t,value:e,onChange:i,rows:5,resize:`vertical`}),(0,Q.jsxs)(r,{children:[(0,Q.jsx)(l,{fontSize:`sm`,color:`fg.muted`,mb:2,children:`Try an example:`}),(0,Q.jsx)(o,{gap:2,flexWrap:`wrap`,children:n.map(e=>(0,Q.jsx)(a,{size:`xs`,variant:`outline`,onClick:()=>s(e.text),children:e.label},e.label))})]})]})}function Me({assistantName:e,templates:t,onTemplate:n}){return t.length===0?null:(0,Q.jsxs)(r,{children:[(0,Q.jsxs)(l,{fontSize:`sm`,color:`fg.muted`,mb:2,children:[`Need inspiration? Pick a pattern and `,e,` takes it from there.`]}),(0,Q.jsx)(o,{gap:2,flexWrap:`wrap`,children:t.map(e=>(0,Q.jsx)(a,{size:`xs`,variant:`subtle`,borderRadius:`full`,onClick:()=>n(e.text),children:e.label},e.label))})]})}function Ne({onGenerate:e,isGenerateDisabled:t,footerHint:n,assistant:r}){return(0,Q.jsxs)(o,{gap:2,width:`full`,justify:n?`space-between`:`flex-end`,align:`center`,flexWrap:`wrap`,children:[n,(0,Q.jsxs)(a,{colorPalette:`orange`,onClick:e,disabled:t,"aria-label":`Generate with AI using ${r.name}`,children:[(0,Q.jsx)(H,{size:14}),r.generateLabel??`Draft with ${r.name}`]})]})}function Pe({text:e,assistant:t}){return t?(0,Q.jsxs)(u,{gap:4,py:8,textAlign:`center`,children:[(0,Q.jsxs)(r,{display:`grid`,placeItems:`center`,width:`52px`,height:`52px`,borderRadius:`16px`,borderWidth:`1px`,borderColor:`border`,bg:`bg.surface`,position:`relative`,children:[(0,Q.jsx)(U,{size:32}),(0,Q.jsx)(n,{position:`absolute`,inset:`-5px`,width:`60px`,height:`60px`,borderWidth:`2px`,color:`orange.400`})]}),(0,Q.jsxs)(u,{gap:1,children:[(0,Q.jsx)(l,{fontWeight:`semibold`,children:e}),(0,Q.jsx)(l,{color:`fg.muted`,fontSize:`sm`,children:t.reviewHint??`Nothing is saved yet — you will review and edit the draft first.`})]})]}):(0,Q.jsxs)(u,{gap:4,py:8,children:[(0,Q.jsx)(n,{size:`lg`,color:`blue.500`}),(0,Q.jsx)(l,{color:`fg.muted`,children:e})]})}function Fe({error:e}){let t=Y(e);return(0,Q.jsxs)(u,{gap:4,py:4,children:[(0,Q.jsx)(r,{p:3,borderRadius:`full`,bg:`red.100`,color:`red.600`,children:(0,Q.jsx)(A,{as:x,boxSize:6})}),(0,Q.jsxs)(u,{gap:1,children:[(0,Q.jsx)(l,{fontWeight:`semibold`,children:t.title}),t.copy&&(0,Q.jsx)(l,{color:`fg.muted`,fontSize:`sm`,textAlign:`center`,children:t.copy}),(0,Q.jsx)(b,{traceId:t.traceId})]})]})}function Ie({onSkip:e,onGenerate:t,isGenerateDisabled:n,footerHint:r}){return(0,Q.jsxs)(o,{gap:2,width:`full`,justify:r?`space-between`:`flex-end`,align:`center`,flexWrap:`wrap`,children:[r,(0,Q.jsxs)(o,{gap:2,children:[(0,Q.jsx)(a,{variant:`ghost`,onClick:e,children:`I'll write it myself`}),(0,Q.jsxs)(a,{colorPalette:`blue`,onClick:t,disabled:n,children:[(0,Q.jsx)(H,{size:14}),`Generate with AI`]})]})]})}function Le({mode:e,onChange:t,assistantName:n}){return(0,Q.jsxs)(o,{gap:1,padding:`3px`,alignSelf:`center`,borderWidth:`1px`,borderColor:`border`,borderRadius:`full`,bg:`bg.subtle`,children:[(0,Q.jsxs)(Re,{active:e===`assist`,accent:!0,onClick:()=>t(`assist`),children:[(0,Q.jsx)(H,{size:13}),`With `,n]}),(0,Q.jsxs)(Re,{active:e===`manual`,onClick:()=>t(`manual`),children:[(0,Q.jsx)(Ce,{size:13}),`Build it myself`]})]})}function Re({active:e,accent:t=!1,onClick:n,children:r}){return(0,Q.jsx)(i.button,{type:`button`,onClick:n,display:`inline-flex`,alignItems:`center`,gap:1.5,paddingX:3.5,paddingY:`7px`,borderRadius:`full`,fontSize:`sm`,fontWeight:`medium`,whiteSpace:`nowrap`,cursor:`pointer`,transition:`color 120ms ease, background 120ms ease, box-shadow 120ms ease`,color:e?t?`orange.fg`:`fg`:`fg.muted`,bg:e?`bg.surface`:`transparent`,boxShadow:e?`0 1px 2px rgba(2, 6, 23, 0.12)`:`none`,_hover:e?void 0:{color:`fg`},children:r})}function ze({assistantName:e}){return(0,Q.jsx)(r,{borderWidth:`1px`,borderColor:`border`,borderRadius:`xl`,bg:`bg.surface`,padding:5,children:(0,Q.jsxs)(o,{align:`start`,gap:3,children:[(0,Q.jsx)(r,{display:`grid`,placeItems:`center`,width:`36px`,height:`36px`,flexShrink:0,borderRadius:`10px`,borderWidth:`1px`,borderColor:`border`,bg:`bg.subtle`,color:`fg.muted`,children:(0,Q.jsx)(Ce,{size:18})}),(0,Q.jsxs)(u,{align:`start`,gap:1,children:[(0,Q.jsx)(l,{fontWeight:`semibold`,children:`Build it yourself`}),(0,Q.jsxs)(l,{color:`fg.muted`,fontSize:`sm`,lineHeight:`tall`,children:[`Open a blank scenario and write the situation and success criteria by hand — no model involved. You can hand it to `,e,` for a draft at any point.`]})]})]})})}function Be({onSkip:e}){return(0,Q.jsx)(o,{width:`full`,justify:`flex-end`,children:(0,Q.jsxs)(a,{colorPalette:`gray`,onClick:e,children:[`Open blank editor`,(0,Q.jsx)(V,{size:14})]})})}function Ve({error:e,onSkip:t,onTryAgain:n,assistant:r}){let i=Y(e),s=i.cta===`configure`||i.cta===`configure-and-retry`,c=i.cta===`retry`||i.cta===`configure-and-retry`||i.cta===`retry-or-skip`;return(0,Q.jsxs)(o,{gap:2,justify:`flex-end`,children:[(0,Q.jsx)(a,{variant:`ghost`,onClick:t,children:r?`Set up manually`:`I'll write it myself`}),s&&(0,Q.jsx)(a,{colorPalette:`blue`,asChild:!0,children:(0,Q.jsx)(`a`,{"data-testid":`error-configure-model-provider-button`,href:`/settings/model-providers`,target:`_blank`,rel:`noopener noreferrer`,style:{color:`white`},children:`Configure model provider`})}),c&&(0,Q.jsx)(a,{colorPalette:`blue`,onClick:n,children:`Try again`})]})}function He({open:e,onClose:t,onProceedAnyway:n}){return(0,Q.jsx)(G.Root,{open:e,onOpenChange:e=>!e.open&&t(),children:(0,Q.jsxs)(G.Content,{bg:`bg`,children:[(0,Q.jsx)(G.CloseTrigger,{}),(0,Q.jsx)(G.Header,{children:(0,Q.jsx)(G.Title,{children:`Model provider not ready`})}),(0,Q.jsx)(G.Body,{children:(0,Q.jsxs)(u,{gap:4,py:4,align:`center`,justify:`center`,children:[(0,Q.jsx)(r,{p:3,borderRadius:`full`,bg:`orange.100`,color:`orange.600`,children:(0,Q.jsx)(A,{as:_,boxSize:6})}),(0,Q.jsx)(l,{color:`fg.muted`,fontSize:`sm`,textAlign:`center`,children:`Scenarios need an enabled provider with a default model to run. Configure default model provider to get started, or proceed to create a new scenario anyway.`})]})}),(0,Q.jsx)(G.Footer,{children:(0,Q.jsxs)(o,{gap:2,justify:`flex-end`,children:[(0,Q.jsx)(a,{variant:`ghost`,onClick:n,children:`Proceed anyway`}),(0,Q.jsx)(a,{colorPalette:`blue`,asChild:!0,children:(0,Q.jsx)(`a`,{"data-testid":`model-provider-required-modal-configure-button`,href:`/settings/model-providers`,target:`_blank`,rel:`noopener noreferrer`,style:{color:`white`},children:`Configure model provider`})})]})})]})})}var Ue=`Create new scenario`,We=`Explain your agent, its goals and what behavior you want to test.`,Ge=`Drafting your scenario…`,Ke=[{label:`Customer Support`,text:`A customer support agent that handles complaints. Test an angry customer who was charged twice and wants a refund.`},{label:`RAG Q&A`,text:`A knowledge bot that answers questions from documentation. Test a question that requires combining info from multiple sources.`},{label:`Tool-calling Agent`,text:`An agent that uses tools to complete tasks. Test a request that requires calling multiple tools in sequence.`}];function qe({open:e,onClose:t}){let{project:n}=K(),{openDrawer:r}=q(),{checkAndProceed:i}=ue(`scenarios`),{hasEnabledProviders:a,providers:o}=ge({projectId:n?.id}),s=R.modelProvider.getResolvedDefault.useQuery({projectId:n?.id??``,featureKey:`scenarios.generator`},{enabled:!!n?.id}),c=xe({hasEnabledProviders:a,providers:o,defaultModel:s.data?.model}),l=(0,Z.useCallback)(e=>{r(`scenarioEditor`,{initialFormData:e},{resetStack:!0}),t()},[r,t]),u=(0,Z.useCallback)(async e=>{if(!n?.id)throw Error(`No project selected`);try{let t=await _e(e,n.id);ve(e),l(t)}catch(e){if(z(e))return;throw e}},[n?.id,l]),d=(0,Z.useCallback)(()=>{l({name:``,situation:``,criteria:[]})},[l]);return c.ok?(0,Q.jsx)(Ae,{open:e,onClose:t,title:Ue,placeholder:We,exampleTemplates:Ke,onGenerate:e=>i(()=>u(e)),onSkip:()=>i(d),generatingText:Ge,footerHint:(0,Q.jsx)(ye,{model:s.data?.model}),assistant:{name:`AI`,description:`Describe the behavior you care about. AI will turn it into an editable situation and success criteria.`,promptLabel:`What should this simulation prove?`,generateLabel:`Draft with AI`,reviewHint:`AI is shaping the situation and criteria. You will review everything before it is saved.`}}):(0,Q.jsx)(He,{open:e,onClose:t,onProceedAnyway:()=>i(d)})}function Je({onCreateClick:e}){return(0,Q.jsxs)(u,{gap:4,align:`center`,py:12,children:[(0,Q.jsx)(l,{fontSize:`lg`,color:`fg.muted`,children:`No scenarios yet`}),(0,Q.jsx)(l,{fontSize:`sm`,color:`fg.subtle`,children:`Create your first scenario to get started`}),(0,Q.jsxs)(a,{colorPalette:`blue`,onClick:e,children:[(0,Q.jsx)(W,{size:16}),` Create Scenario`]})]})}var $=he(),Ye=(e,t,n)=>{let r=e.getValue(t),i=n;return!i||i.length===0?!0:i.some(e=>r.includes(e))};function Xe({scenarios:e,columnFilters:t,onColumnFiltersChange:n,onRowClick:r,rowSelection:i,onRowSelectionChange:a,onArchive:s}){let[c,u]=(0,Z.useState)([]),f=pe({data:e,columns:(0,Z.useMemo)(()=>[$.display({id:`select`,header:({table:e})=>(0,Q.jsx)(w,{"aria-label":`Select all`,checked:e.getIsAllPageRowsSelected(),onChange:()=>e.toggleAllPageRowsSelected(),onClick:e=>e.stopPropagation()}),cell:({row:e})=>(0,Q.jsx)(w,{"aria-label":`Select ${e.original.name}`,checked:e.getIsSelected(),onChange:()=>e.toggleSelected(),onClick:e=>e.stopPropagation()}),enableSorting:!1}),$.accessor(`name`,{header:`Name`,cell:e=>(0,Q.jsx)(l,{fontWeight:`medium`,children:e.getValue()})}),$.accessor(`labels`,{header:`Labels`,enableSorting:!1,filterFn:Ye,cell:e=>(0,Q.jsx)(be,{labels:e.getValue()})}),$.accessor(`updatedAt`,{header:`Updated`,cell:e=>(0,Q.jsx)(l,{color:`fg.muted`,children:oe(e.getValue().getTime())})}),$.display({id:`actions`,header:``,cell:({row:e})=>(0,Q.jsxs)(C.Root,{children:[(0,Q.jsx)(C.Trigger,{asChild:!0,children:(0,Q.jsx)(N,{"aria-label":`Actions for ${e.original.name}`,variant:`ghost`,size:`sm`,onClick:e=>e.stopPropagation(),children:(0,Q.jsx)(d,{size:16})})}),(0,Q.jsx)(C.Content,{portalled:!1,children:(0,Q.jsxs)(C.Item,{value:`archive`,color:`orange.500`,onClick:t=>{t.stopPropagation(),s(e.original)},children:[(0,Q.jsx)(B,{size:14}),`Archive`]})})]}),enableSorting:!1})],[s]),state:{sorting:c,columnFilters:t,rowSelection:i},enableRowSelection:!0,onRowSelectionChange:e=>{a(typeof e==`function`?e(i):e)},onSortingChange:u,onColumnFiltersChange:e=>{n(typeof e==`function`?e(t):e)},getCoreRowModel:fe(),getFilteredRowModel:de(),getSortedRowModel:me(),getRowId:e=>e.id});return(0,Q.jsxs)(S,{variant:`line`,width:`full`,size:`md`,children:[(0,Q.jsx)(T,{children:f.getHeaderGroups().map(e=>(0,Q.jsx)(k,{children:e.headers.map(e=>(0,Q.jsx)(O,{cursor:e.column.getCanSort()?`pointer`:`default`,onClick:e.column.getToggleSortingHandler(),userSelect:`none`,width:e.id===`select`?`40px`:e.id===`actions`?`48px`:void 0,children:(0,Q.jsxs)(o,{gap:1,children:[J(e.column.columnDef.header,e.getContext()),e.column.getIsSorted()===`asc`&&(0,Q.jsx)(h,{size:14}),e.column.getIsSorted()===`desc`&&(0,Q.jsx)(I,{size:14})]})},e.id))},e.id))}),(0,Q.jsx)(D,{children:f.getRowModel().rows.map(e=>(0,Q.jsx)(Se,{target:F({scenarioId:e.original.id,name:e.original.name,noun:`scenario`}),children:(0,Q.jsx)(k,{cursor:`pointer`,_hover:{bg:`bg.emphasized`},onClick:()=>r(e.original.id),children:e.getVisibleCells().map(e=>(0,Q.jsx)(E,{children:J(e.column.columnDef.cell,e.getContext())},e.id))})},e.id))})]})}var Ze=[{icon:ce,title:`Automated Testing`,description:`Define test scenarios that run automatically against your AI agent to verify it handles real-world situations correctly.`},{icon:ie,title:`Regression Detection`,description:`Catch regressions early by re-running scenarios after every change, ensuring your agent never breaks existing behavior.`}];function Qe({onProceed:e}){return(0,Q.jsxs)(u,{gap:8,align:`center`,children:[(0,Q.jsxs)(u,{gap:3,textAlign:`center`,children:[(0,Q.jsx)(c,{as:`h2`,size:`xl`,children:`Welcome to Scenarios`}),(0,Q.jsx)(l,{fontSize:`md`,color:`fg.muted`,children:`Scenarios let you test your agent behavior with repeatable, automated checks. Define situations, set expectations, and verify your agent responds correctly every time.`})]}),(0,Q.jsx)(u,{gap:4,w:`full`,children:Ze.map(({icon:e,title:t,description:n})=>(0,Q.jsxs)(o,{gap:4,p:5,w:`full`,borderWidth:`1px`,borderColor:`border`,borderRadius:`lg`,align:`start`,children:[(0,Q.jsx)(r,{p:2,borderRadius:`md`,bg:`blue.50`,color:`blue.600`,_dark:{bg:`blue.900`,color:`blue.200`},flexShrink:0,children:(0,Q.jsx)(e,{size:20})}),(0,Q.jsxs)(u,{gap:1,align:`start`,children:[(0,Q.jsx)(l,{fontWeight:`semibold`,children:t}),(0,Q.jsx)(l,{fontSize:`sm`,color:`fg.muted`,children:n})]})]},t))}),(0,Q.jsxs)(a,{colorPalette:`blue`,size:`lg`,onClick:e,children:[`Create Your First Scenario `,(0,Q.jsx)(V,{size:16})]})]})}function $e({onProceed:e}){return(0,Q.jsx)(u,{py:16,px:8,maxW:`640px`,mx:`auto`,children:(0,Q.jsx)(Qe,{onProceed:e})})}function et({open:e,onOpenChange:t,onProceed:n}){return(0,Q.jsx)(G.Root,{open:e,onOpenChange:e=>t(e.open),placement:`center`,size:`lg`,children:(0,Q.jsxs)(G.Content,{bg:`bg`,maxWidth:`640px`,children:[(0,Q.jsx)(G.CloseTrigger,{}),(0,Q.jsx)(G.Body,{py:8,px:8,children:(0,Q.jsx)(Qe,{onProceed:n})})]})})}function tt(e){let[t,n]=(0,Z.useState)([]);return{columnFilters:t,setColumnFilters:n,allLabels:(0,Z.useMemo)(()=>{if(!e)return[];let t=new Set;return e.forEach(e=>e.labels.forEach(e=>t.add(e))),Array.from(t).sort()},[e]),activeLabels:(0,Z.useMemo)(()=>t.find(e=>e.id===`labels`)?.value??[],[t]),handleLabelToggle:(0,Z.useCallback)(e=>{n(t=>{let n=t.find(e=>e.id===`labels`)?.value??[],r=n.includes(e)?n.filter(t=>t!==e):[...n,e],i=t.filter(e=>e.id!==`labels`);return r.length===0?i:[...i,{id:`labels`,value:r}]})},[])}}var nt=`langwatch:scenarios:welcomeSeen`;function rt(){try{return localStorage.getItem(nt)===`true`}catch{return!1}}function it(){try{localStorage.setItem(nt,`true`)}catch{}}function at({scenarioCount:e,isLoading:t}){let[n,r]=(0,Z.useState)(rt),[i,a]=(0,Z.useState)(!1),[o,s]=(0,Z.useState)(!1),c=!t&&e===0&&!n,l=(0,Z.useCallback)(()=>{it(),r(!0)},[]);return{showInlineWelcome:c,showWelcomeModal:i,showCreateModal:o,handleNewScenario:(0,Z.useCallback)(()=>{!n&&!t&&e===0?a(!0):s(!0)},[n,t,e]),handleWelcomeProceed:(0,Z.useCallback)(()=>{l(),a(!1),s(!0)},[l]),handleWelcomeModalOpenChange:(0,Z.useCallback)(e=>{e||(l(),a(!1))},[l]),handleCloseCreateModal:(0,Z.useCallback)(()=>{s(!1)},[])}}function ot(){let[e,t]=(0,Z.useState)({}),n=(0,Z.useCallback)(e=>{t(t=>typeof e==`function`?e(t):e)},[]),r=(0,Z.useCallback)(e=>{t(t=>{let n={...t};return n[e]?delete n[e]:n[e]=!0,n})},[]),i=(0,Z.useCallback)(e=>{t(t=>{let n={...t};for(let t of e)n[t]=!0;return n})},[]),a=(0,Z.useCallback)(()=>{t({})},[]),o=(0,Z.useMemo)(()=>Object.keys(e).filter(t=>e[t]),[e]);return{toggle:r,selectAll:i,deselectAll:a,selectedIds:o,selectionCount:o.length,rowSelection:e,onRowSelectionChange:n}}function st(){let{project:e}=K(),{openDrawer:t}=q(),{rowSelection:r,onRowSelectionChange:i,selectedIds:a,selectionCount:s,deselectAll:c}=ot(),[l,d]=(0,Z.useState)(null),f=R.useContext(),{data:p,isLoading:m,error:h}=R.scenarios.getAll.useQuery({projectId:e?.id??``},{enabled:!!e}),g=(0,Z.useCallback)(()=>{f.scenarios.getAll.invalidate(),c(),d(null)},[f.scenarios.getAll,c]),_=R.scenarios.archive.useMutation({onSuccess:g,onError:e=>P({error:e,fallbackTitle:`Couldn't archive scenario`})}),v=R.scenarios.batchArchive.useMutation({onSuccess:e=>{e.failed.length>0&&y.create({title:`Some scenarios couldn't be archived`,description:`${e.failed.length} failed. Please retry.`,type:`error`,meta:{closable:!0}}),f.scenarios.getAll.invalidate(),c(),d(null)},onError:e=>P({error:e,fallbackTitle:`Couldn't archive scenarios`})}),{columnFilters:b,setColumnFilters:x,allLabels:S,activeLabels:C,handleLabelToggle:w}=tt(p),{showInlineWelcome:T,showWelcomeModal:E,showCreateModal:D,handleNewScenario:O,handleWelcomeProceed:k,handleWelcomeModalOpenChange:A,handleCloseCreateModal:N}=at({scenarioCount:p?.length??0,isLoading:m}),ee=e=>{t(`scenarioEditor`,{urlParams:{scenarioId:e}})},te=(0,Z.useCallback)(e=>{d({type:`single`,scenario:e})},[]),F=(0,Z.useCallback)(()=>{d({type:`batch`})},[]),I=()=>{e?.id&&(l?.type===`single`?_.mutate({projectId:e.id,id:l.scenario.id}):l?.type===`batch`&&v.mutate({projectId:e.id,ids:a}))},L=()=>{d(null)},z=(0,Z.useMemo)(()=>!l||!p?[]:l.type===`single`?[{id:l.scenario.id,name:l.scenario.name}]:p.filter(e=>a.includes(e.id)).map(e=>({id:e.id,name:e.name})),[l,p,a]);return(0,Q.jsxs)(M,{children:[(0,Q.jsx)(j.Header,{children:(0,Q.jsxs)(o,{justify:`space-between`,align:`center`,w:`full`,children:[(0,Q.jsx)(j.Heading,{children:`Scenario Library`}),(0,Q.jsx)(re,{}),(0,Q.jsx)(Te,{allLabels:S,activeLabels:C,onToggle:w}),(0,Q.jsxs)(j.HeaderButton,{onClick:O,children:[(0,Q.jsx)(W,{size:16}),` New Scenario`]})]})}),(0,Q.jsxs)(j.Container,{padding:0,children:[m&&(0,Q.jsx)(u,{gap:4,align:`center`,py:8,children:(0,Q.jsx)(n,{borderWidth:`3px`,animationDuration:`0.8s`})}),h&&!p?.length&&(0,Q.jsx)(u,{gap:4,align:`center`,py:8,children:(0,Q.jsx)(ne,{error:h,fallbackTitle:`Couldn't load scenarios`})}),!m&&!h&&p?.length===0&&T&&(0,Q.jsx)($e,{onProceed:k}),!m&&!h&&p?.length===0&&!T&&(0,Q.jsx)(Je,{onCreateClick:O}),p&&p.length>0&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(we,{selectedCount:s,onArchive:F}),(0,Q.jsx)(Xe,{scenarios:p,columnFilters:b,onColumnFiltersChange:x,onRowClick:ee,rowSelection:r,onRowSelectionChange:i,onArchive:te})]})]}),(0,Q.jsx)(et,{open:E,onOpenChange:A,onProceed:k}),(0,Q.jsx)(qe,{open:D,onClose:N}),(0,Q.jsx)(Ee,{open:l!==null,onClose:L,onConfirm:I,scenarios:z,isLoading:_.isPending||v.isPending})]})}var ct=le(`scenarios:view`,{layoutComponent:M})(st);export{ct as default};
2
- //# sourceMappingURL=scenarios-CpA_eExG.js.map
@@ -1,2 +0,0 @@
1
- import{a as e,n as t}from"./portal-Sdfvrza9.js";import{t as n}from"./jsx-runtime-CFwixLRt.js";import{n as r}from"./v-stack-hkuSkmCA.js";import{t as i}from"./badge-Cpc3eA-C.js";import{$ as a,Q as o,X as s,Y as c,Z as l,et as u}from"./Markdown-C9extmbX.js";import{Gt as d,L as f,t as p}from"./DashboardLayout-BhHe0vIT.js";import{a as m,i as h,n as g,r as _,t as v}from"./empty-state-T8EYr5NF.js";import{n as y}from"./api-l6Cnm0vQ.js";import{Pr as b}from"./index-CPtTUYLD.js";import{t as x}from"./OpsPageShell-Ch1rtwuD.js";var S=n();function C(e){if(!e)return`—`;let t=new Date(e).getTime()-Date.now(),n=Math.round(Math.abs(t)/6e4),r=n<1?`just now`:n<60?`${n}m`:n<1440?`${Math.round(n/60)}h`:`${Math.round(n/1440)}d`,i=t>=0?`in ${r}`:`${r} ago`;return`${new Date(e).toLocaleString()} (${n<1?r:i})`}function w(){let n=y.ops.listScheduledJobs.useQuery({limit:200},{refetchInterval:1e4});return(0,S.jsx)(x,{children:(0,S.jsxs)(p,{children:[(0,S.jsx)(f.Header,{children:(0,S.jsx)(f.Heading,{children:`Scheduler`})}),(0,S.jsxs)(f.Container,{children:[(0,S.jsxs)(r,{textStyle:`sm`,color:`fg.muted`,marginBottom:4,children:[`Durable `,(0,S.jsx)(`code`,{children:`ScheduledJob`}),` entries driving the in-process calendar scheduler (reports and other schedule-triggered work). When each next fires, when it last fired, and whether it is active.`]}),n.isLoading?(0,S.jsx)(b,{paddingY:20,children:(0,S.jsx)(h,{children:(0,S.jsxs)(v,{children:[(0,S.jsx)(_,{children:(0,S.jsx)(e,{size:`lg`})}),(0,S.jsx)(m,{children:`Loading scheduled jobs`})]})})}):(n.data?.length??0)===0?(0,S.jsx)(b,{paddingY:20,children:(0,S.jsx)(h,{children:(0,S.jsxs)(v,{children:[(0,S.jsx)(_,{children:(0,S.jsx)(d,{})}),(0,S.jsx)(m,{children:`No scheduled jobs`}),(0,S.jsx)(g,{children:`Nothing is on the calendar scheduler yet.`})]})})}):(0,S.jsxs)(a,{variant:`line`,size:`sm`,children:[(0,S.jsx)(o,{children:(0,S.jsxs)(u,{children:[(0,S.jsx)(l,{children:`Target`}),(0,S.jsx)(l,{children:`Project`}),(0,S.jsx)(l,{children:`Schedule`}),(0,S.jsx)(l,{children:`Next run`}),(0,S.jsx)(l,{children:`Last fired`}),(0,S.jsx)(l,{children:`In progress`}),(0,S.jsx)(l,{children:`Retries`}),(0,S.jsx)(l,{children:`Last error`}),(0,S.jsx)(l,{children:`Status`})]})}),(0,S.jsx)(c,{children:n.data?.map(e=>(0,S.jsxs)(u,{children:[(0,S.jsx)(s,{children:(0,S.jsxs)(t,{gap:2,children:[(0,S.jsx)(i,{colorPalette:`purple`,variant:`subtle`,children:e.targetType}),(0,S.jsx)(r,{textStyle:`xs`,color:`fg.muted`,fontFamily:`mono`,children:e.targetId})]})}),(0,S.jsx)(s,{children:(0,S.jsx)(r,{textStyle:`xs`,fontFamily:`mono`,children:e.projectId})}),(0,S.jsxs)(s,{children:[(0,S.jsx)(r,{textStyle:`xs`,fontFamily:`mono`,children:e.cron}),(0,S.jsx)(r,{textStyle:`xs`,color:`fg.muted`,children:e.timezone})]}),(0,S.jsx)(s,{children:C(e.nextRunAt)}),(0,S.jsx)(s,{children:C(e.lastSlot)}),(0,S.jsx)(s,{children:e.currentSlot?e.attempts>0?(0,S.jsx)(i,{colorPalette:`orange`,variant:`subtle`,children:`Retrying`}):(0,S.jsx)(i,{colorPalette:`blue`,variant:`subtle`,children:`Running`}):(0,S.jsx)(r,{textStyle:`xs`,color:`fg.muted`,children:`—`})}),(0,S.jsx)(s,{children:e.attempts>0?(0,S.jsx)(i,{colorPalette:e.attempts>=3?`red`:`orange`,variant:`subtle`,children:e.attempts}):(0,S.jsx)(r,{textStyle:`xs`,color:`fg.muted`,children:`—`})}),(0,S.jsx)(s,{maxWidth:`280px`,children:(0,S.jsx)(r,{textStyle:`xs`,color:`fg.muted`,truncate:!0,children:e.lastError??`—`})}),(0,S.jsx)(s,{children:e.active?(0,S.jsx)(i,{colorPalette:`green`,variant:`subtle`,children:`Active`}):(0,S.jsx)(i,{colorPalette:`gray`,variant:`subtle`,children:`Inactive`})})]},e.id))})]})]})]})})}export{w as default};
2
- //# sourceMappingURL=scheduler-CgzNzJjP.js.map
@@ -1 +0,0 @@
1
- import e from"./automations-CI-QD_zf.js";export{e as default};
@@ -1,2 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{i as n,n as r}from"./portal-Sdfvrza9.js";import{t as i}from"./jsx-runtime-CFwixLRt.js";import{t as a}from"./heading-C0sACr0w.js";import{n as o,t as s}from"./v-stack-hkuSkmCA.js";import{tr as c}from"./ProjectAvatar-DtI9dT1f.js";import{t as l}from"./badge-Cpc3eA-C.js";import{n as u}from"./toaster-BsYkODqs.js";import{$ as d,K as f,Q as p,X as m,Y as h,Z as g,et as _}from"./Markdown-C9extmbX.js";import{r as v,t as y}from"./card-By_Mbslh.js";import{t as b}from"./spacer-C38e7o6r.js";import{n as x}from"./api-l6Cnm0vQ.js";import{Mr as S,Qn as C,St as w,Vt as T,cr as E}from"./index-CPtTUYLD.js";import{t as D}from"./WithPermissionGuard-Cr6Aljmy.js";import{t as O}from"./SettingsLayout-sixsNIX_.js";import{t as k}from"./CopyInput-BJ8UDgiW.js";var A=e(t()),j=i();function M(){let{organization:e}=T();return e?(0,j.jsx)(P,{organizationId:e.id}):(0,j.jsx)(O,{})}var N=D(`organization:manage`,{layoutComponent:O})(M);function P({organizationId:e}){let t=x.scimToken.list.useQuery({organizationId:e}),i=x.scimToken.generate.useMutation(),T=x.scimToken.revoke.useMutation(),D=x.useContext(),{open:M,onOpen:N,onClose:P}=c(),[F,I]=(0,A.useState)(``),[L,R]=(0,A.useState)(null),[z,B]=(0,A.useState)(null),V=()=>{i.mutate({organizationId:e,description:F||void 0},{onSuccess:e=>{R(e.token),I(``),D.scimToken.list.invalidate()},onError:()=>{u.create({title:`Failed to generate token`,type:`error`,duration:5e3,meta:{closable:!0}})}})},H=t=>{T.mutate({organizationId:e,tokenId:t},{onSuccess:()=>{B(null),u.create({title:`Token revoked`,type:`success`,duration:3e3,meta:{closable:!0}}),D.scimToken.list.invalidate()},onError:()=>{u.create({title:`Failed to revoke token`,type:`error`,duration:5e3,meta:{closable:!0}})}})},U=typeof window<`u`?`${window.location.origin}/api/scim/v2`:``;return(0,j.jsxs)(O,{children:[(0,j.jsxs)(s,{gap:6,width:`full`,align:`start`,children:[(0,j.jsxs)(r,{width:`full`,children:[(0,j.jsx)(a,{children:`SCIM Provisioning`}),(0,j.jsx)(b,{})]}),(0,j.jsx)(v,{width:`full`,children:(0,j.jsx)(y,{children:(0,j.jsxs)(s,{gap:4,align:`start`,children:[(0,j.jsx)(o,{children:`SCIM (System for Cross-domain Identity Management) allows your identity provider (Okta, Azure AD, etc.) to automatically provision and deprovision users in LangWatch.`}),(0,j.jsxs)(s,{gap:2,align:`start`,width:`full`,children:[(0,j.jsx)(o,{fontWeight:`600`,children:`SCIM Base URL`}),(0,j.jsx)(k,{value:U,label:`SCIM Base URL`})]}),(0,j.jsx)(o,{fontSize:`sm`,color:`gray.500`,children:`Use this URL and a bearer token below to configure SCIM in your identity provider.`})]})})}),(0,j.jsxs)(r,{width:`full`,children:[(0,j.jsx)(a,{size:`md`,children:`Bearer Tokens`}),(0,j.jsx)(b,{}),(0,j.jsxs)(n,{size:`sm`,onClick:N,children:[(0,j.jsx)(C,{size:16}),`Generate Token`]})]}),(0,j.jsx)(v,{width:`full`,overflow:`hidden`,children:(0,j.jsx)(y,{paddingY:0,paddingX:0,overflowX:`auto`,children:(0,j.jsxs)(d,{variant:`line`,size:`md`,width:`full`,children:[(0,j.jsx)(p,{children:(0,j.jsxs)(_,{children:[(0,j.jsx)(g,{children:`Description`}),(0,j.jsx)(g,{children:`Created`}),(0,j.jsx)(g,{children:`Last Used`}),(0,j.jsx)(g,{width:`80px`})]})}),(0,j.jsxs)(h,{children:[t.data?.length===0&&(0,j.jsx)(_,{children:(0,j.jsx)(m,{colSpan:4,children:(0,j.jsx)(o,{color:`gray.500`,textAlign:`center`,paddingY:4,children:`No SCIM tokens yet. Generate one to get started.`})})}),t.data?.map(e=>(0,j.jsxs)(_,{children:[(0,j.jsx)(m,{children:(0,j.jsxs)(r,{children:[(0,j.jsx)(E,{size:14}),(0,j.jsx)(o,{children:e.description??`No description`})]})}),(0,j.jsx)(m,{children:new Date(e.createdAt).toLocaleDateString()}),(0,j.jsx)(m,{children:e.lastUsedAt?new Date(e.lastUsedAt).toLocaleDateString():(0,j.jsx)(l,{size:`sm`,colorPalette:`gray`,children:`Never`})}),(0,j.jsx)(m,{children:(0,j.jsx)(n,{size:`xs`,variant:`ghost`,colorPalette:`red`,onClick:()=>B(e.id),children:(0,j.jsx)(f,{size:14})})})]},e.id))]})]})})})]}),(0,j.jsx)(w.Root,{open:M&&!L,onOpenChange:({open:e})=>{e||(P(),I(``))},children:(0,j.jsxs)(w.Content,{bg:`bg`,children:[(0,j.jsx)(w.Header,{children:(0,j.jsx)(w.Title,{children:(0,j.jsx)(a,{size:`md`,children:`Generate SCIM Token`})})}),(0,j.jsx)(w.CloseTrigger,{}),(0,j.jsx)(w.Body,{paddingBottom:6,children:(0,j.jsxs)(s,{gap:4,align:`start`,children:[(0,j.jsx)(o,{children:`This token will be used by your identity provider to authenticate SCIM requests.`}),(0,j.jsxs)(s,{gap:1,align:`start`,width:`full`,children:[(0,j.jsx)(o,{fontWeight:`600`,fontSize:`sm`,children:`Description (optional)`}),(0,j.jsx)(S,{placeholder:`e.g., Okta SCIM integration`,value:F,onChange:e=>I(e.target.value)})]}),(0,j.jsx)(n,{width:`full`,onClick:V,disabled:i.isLoading,children:`Generate Token`})]})})]})}),(0,j.jsx)(w.Root,{open:!!L,onOpenChange:({open:e})=>{e||(R(null),P())},children:(0,j.jsxs)(w.Content,{bg:`bg`,children:[(0,j.jsx)(w.Header,{children:(0,j.jsx)(w.Title,{children:(0,j.jsx)(a,{size:`md`,children:`Token Generated`})})}),(0,j.jsx)(w.CloseTrigger,{}),(0,j.jsx)(w.Body,{paddingBottom:6,children:(0,j.jsxs)(s,{gap:4,align:`start`,children:[(0,j.jsx)(o,{color:`orange.500`,fontWeight:`600`,children:`Copy this token now. You won't be able to see it again.`}),L&&(0,j.jsx)(k,{value:L,label:`SCIM Token`})]})})]})}),(0,j.jsx)(w.Root,{open:!!z,onOpenChange:({open:e})=>{e||B(null)},children:(0,j.jsxs)(w.Content,{bg:`bg`,children:[(0,j.jsx)(w.Header,{children:(0,j.jsx)(w.Title,{children:(0,j.jsx)(a,{size:`md`,children:`Revoke Token`})})}),(0,j.jsx)(w.CloseTrigger,{}),(0,j.jsx)(w.Body,{paddingBottom:6,children:(0,j.jsxs)(s,{gap:4,align:`start`,children:[(0,j.jsx)(o,{children:`Are you sure you want to revoke this token? Any identity provider using it will no longer be able to provision users.`}),(0,j.jsxs)(r,{width:`full`,justify:`end`,gap:2,children:[(0,j.jsx)(n,{variant:`outline`,onClick:()=>B(null),children:`Cancel`}),(0,j.jsx)(n,{colorPalette:`red`,onClick:()=>z&&H(z),disabled:T.isLoading,children:`Revoke`})]})]})})]})})]})}export{N as default};
2
- //# sourceMappingURL=scim-BivWilDe.js.map
@@ -1,2 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{a as ee,dn as n,i as r,n as i}from"./portal-Sdfvrza9.js";import{t as a}from"./jsx-runtime-CFwixLRt.js";import{t as te}from"./heading-C0sACr0w.js";import{n as o,t as s}from"./v-stack-hkuSkmCA.js";import{An as c}from"./ProjectAvatar-DtI9dT1f.js";import{t as l}from"./tooltip-gjZ4s2dt.js";import{$ as u,K as d,L as f,Q as ne,X as p,Y as re,Z as m,et as h}from"./Markdown-C9extmbX.js";import{L as g,n as _}from"./DashboardLayout-BhHe0vIT.js";import{r as v,t as y}from"./card-By_Mbslh.js";import{a as b,i as x,n as ie,r as ae,t as S}from"./empty-state-T8EYr5NF.js";import{t as C}from"./errors-e711UMq7.js";import{t as w}from"./spacer-C38e7o6r.js";import{n as T}from"./api-l6Cnm0vQ.js";import{t as E}from"./square-pen-BeEJLs7r.js";import{Mr as D,Qn as O,St as k,Vt as A,cr as j}from"./index-CPtTUYLD.js";import{t as M}from"./SettingsLayout-sixsNIX_.js";var N=e(t()),P=a();function F(){let{project:e,organizations:t,hasPermission:a}=A(),F=a(`secrets:manage`),I=T.secrets.list.useQuery({projectId:e?.id??``},{enabled:!!e?.id}),L=I.data??[],R=T.secrets.create.useMutation(),z=T.secrets.update.useMutation(),B=T.secrets.delete.useMutation(),V=T.useContext(),[H,U]=(0,N.useState)(!1),[W,G]=(0,N.useState)(``),[K,q]=(0,N.useState)(``),[J,Y]=(0,N.useState)(null),[X,Z]=(0,N.useState)(null),[Q,$]=(0,N.useState)(``),oe=async()=>{if(!(!e?.id||!W||!K))try{await R.mutateAsync({projectId:e.id,name:W,value:K}),U(!1),G(``),q(``),await V.secrets.list.invalidate()}catch(e){C({error:e,fallbackTitle:`Couldn't create the secret`})}},se=async()=>{if(!(!e?.id||!J))try{await B.mutateAsync({projectId:e.id,secretId:J.id}),Y(null),await V.secrets.list.invalidate()}catch(e){C({error:e,fallbackTitle:`Couldn't delete the secret`})}},ce=async()=>{if(!(!e?.id||!X||!Q))try{await z.mutateAsync({projectId:e.id,secretId:X.id,value:Q}),Z(null),$(``),await V.secrets.list.invalidate()}catch(e){C({error:e,fallbackTitle:`Couldn't update the secret`})}};return(0,P.jsx)(M,{children:(0,P.jsxs)(s,{gap:6,width:`full`,align:`start`,children:[(0,P.jsxs)(i,{width:`full`,marginTop:2,children:[(0,P.jsx)(te,{as:`h2`,children:`Secrets`}),(0,P.jsx)(w,{}),t&&e&&(0,P.jsx)(_,{organizations:t,project:e}),F&&(0,P.jsx)(l,{content:`Add a new secret for use in code blocks`,disabled:!1,children:(0,P.jsxs)(g.HeaderButton,{onClick:()=>U(!0),children:[(0,P.jsx)(O,{}),` Add Secret`]})})]}),I.isLoading?(0,P.jsx)(ee,{}):L.length===0?(0,P.jsx)(x,{width:`full`,children:(0,P.jsxs)(S,{children:[(0,P.jsx)(ae,{children:(0,P.jsx)(j,{size:24})}),(0,P.jsxs)(s,{textAlign:`center`,children:[(0,P.jsx)(b,{children:`No secrets configured`}),(0,P.jsx)(ie,{children:`Add secrets to use in code blocks`})]})]})}):(0,P.jsx)(v,{width:`full`,overflow:`hidden`,children:(0,P.jsx)(y,{paddingY:0,paddingX:0,overflowX:`auto`,children:(0,P.jsxs)(u,{width:`full`,children:[(0,P.jsx)(ne,{children:(0,P.jsxs)(h,{children:[(0,P.jsx)(m,{children:`Name`}),(0,P.jsx)(m,{children:`Created By`}),(0,P.jsx)(m,{children:`Last Updated`}),(0,P.jsx)(m,{})]})}),(0,P.jsx)(re,{children:L.map(e=>(0,P.jsxs)(h,{children:[(0,P.jsx)(p,{children:(0,P.jsx)(o,{fontFamily:`mono`,children:e.name})}),(0,P.jsx)(p,{children:(0,P.jsx)(o,{children:e.createdBy?.name??`-`})}),(0,P.jsx)(p,{children:(0,P.jsx)(o,{children:new Date(e.updatedAt).toLocaleDateString()})}),(0,P.jsx)(p,{textAlign:`right`,children:F&&(0,P.jsxs)(f.Root,{children:[(0,P.jsx)(f.Trigger,{asChild:!0,children:(0,P.jsx)(r,{variant:`ghost`,size:`sm`,children:(0,P.jsx)(c,{})})}),(0,P.jsxs)(f.Content,{children:[(0,P.jsx)(f.Item,{value:`update`,onClick:()=>{Z({id:e.id,name:e.name}),$(``)},children:(0,P.jsxs)(n,{display:`flex`,alignItems:`center`,gap:2,children:[(0,P.jsx)(E,{size:14}),`Update Value`]})}),(0,P.jsx)(f.Item,{value:`delete`,color:`red`,onClick:()=>{Y({id:e.id,name:e.name})},children:(0,P.jsxs)(n,{display:`flex`,alignItems:`center`,gap:2,children:[(0,P.jsx)(d,{size:14}),`Delete Secret`]})})]})]})})]},e.id))})]})})}),(0,P.jsx)(k.Root,{open:H,onOpenChange:e=>{e.open||(U(!1),G(``),q(``))},children:(0,P.jsxs)(k.Content,{bg:`bg`,children:[(0,P.jsx)(k.Header,{children:(0,P.jsx)(k.Title,{children:`Add Secret`})}),(0,P.jsx)(k.Body,{children:(0,P.jsxs)(s,{gap:4,align:`start`,children:[(0,P.jsxs)(s,{gap:1,align:`start`,width:`full`,children:[(0,P.jsx)(o,{fontWeight:`medium`,children:`Name`}),(0,P.jsx)(D,{placeholder:`e.g., OPENAI_API_KEY`,value:W,onChange:e=>G(e.target.value.toUpperCase().replace(/[^A-Z0-9_]/g,``))})]}),(0,P.jsxs)(s,{gap:1,align:`start`,width:`full`,children:[(0,P.jsx)(o,{fontWeight:`medium`,children:`Value`}),(0,P.jsx)(D,{type:`password`,placeholder:`Enter secret value`,value:K,onChange:e=>q(e.target.value)})]})]})}),(0,P.jsxs)(k.Footer,{children:[(0,P.jsx)(k.ActionTrigger,{asChild:!0,children:(0,P.jsx)(r,{variant:`outline`,children:`Cancel`})}),(0,P.jsx)(r,{colorPalette:`blue`,loading:R.isPending,disabled:!W||!K,onClick:()=>void oe(),children:`Save`})]}),(0,P.jsx)(k.CloseTrigger,{})]})}),(0,P.jsx)(k.Root,{open:!!J,onOpenChange:e=>{e.open||Y(null)},children:(0,P.jsxs)(k.Content,{bg:`bg`,children:[(0,P.jsx)(k.Header,{children:(0,P.jsxs)(k.Title,{children:[`Delete `,J?.name??``,`?`]})}),(0,P.jsx)(k.Body,{children:(0,P.jsx)(o,{children:`Code blocks referencing this secret will no longer have access.`})}),(0,P.jsxs)(k.Footer,{children:[(0,P.jsx)(k.ActionTrigger,{asChild:!0,children:(0,P.jsx)(r,{variant:`outline`,children:`Cancel`})}),(0,P.jsx)(r,{colorPalette:`red`,loading:B.isPending,onClick:()=>void se(),children:`Delete`})]}),(0,P.jsx)(k.CloseTrigger,{})]})}),(0,P.jsx)(k.Root,{open:!!X,onOpenChange:e=>{e.open||(Z(null),$(``))},children:(0,P.jsxs)(k.Content,{bg:`bg`,children:[(0,P.jsx)(k.Header,{children:(0,P.jsxs)(k.Title,{children:[`Update Value for `,X?.name??``]})}),(0,P.jsx)(k.Body,{children:(0,P.jsxs)(s,{gap:1,align:`start`,width:`full`,children:[(0,P.jsx)(o,{fontWeight:`medium`,children:`New Value`}),(0,P.jsx)(D,{type:`password`,placeholder:`Enter new secret value`,value:Q,onChange:e=>$(e.target.value)})]})}),(0,P.jsxs)(k.Footer,{children:[(0,P.jsx)(k.ActionTrigger,{asChild:!0,children:(0,P.jsx)(r,{variant:`outline`,children:`Cancel`})}),(0,P.jsx)(r,{colorPalette:`blue`,loading:z.isPending,disabled:!Q,onClick:()=>void ce(),children:`Save`})]}),(0,P.jsx)(k.CloseTrigger,{})]})})]})})}export{F as default};
2
- //# sourceMappingURL=secrets-Dp2ang1r.js.map
@@ -1,2 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{C as n,D as r,E as i,S as a,_ as o,b as s,j as c,w as l,x as u}from"./portal-Sdfvrza9.js";import{t as d}from"./jsx-runtime-CFwixLRt.js";import{n as f}from"./icon-D6xQEiPb.js";import{l as p,u as m}from"./radio-group-CWz2nJi3.js";import{Rr as h}from"./index-CPtTUYLD.js";var[g,_]=i({name:`SegmentGroupContext`,hookName:`useSegmentGroupContext`,providerName:`<SegmentGroupProvider />`}),v=e=>e.children(_()),y=e(t(),1),b=d(),x=(0,y.forwardRef)((e,t)=>{let n=c(_().getIndicatorProps(),h.indicator.attrs,e);return(0,b.jsx)(l.div,{...n,ref:t})});x.displayName=`SegmentGroupIndicator`;var[S,C]=i({name:`SegmentGroupItemContext`,hookName:`useSegmentGroupItemContext`,providerName:`<SegmentGroupItemProvider />`}),[w,T]=i({name:`SegmentGroupItemPropsContext`,hookName:`useSegmentGroupItemPropsContext`,providerName:`<SegmentGroupItemPropsProvider />`}),E=f(),D=(0,y.forwardRef)((e,t)=>{let[n,r]=E(e,[`value`,`disabled`,`invalid`]),i=_(),a=c(i.getItemProps(n),h.item.attrs,r);return(0,b.jsx)(w,{value:n,children:(0,b.jsx)(S,{value:i.getItemState(n),children:(0,b.jsx)(l.label,{...a,ref:t})})})});D.displayName=`SegmentGroupItem`;var O=e=>e.children(C()),k=(0,y.forwardRef)((e,t)=>{let n=_(),r=T(),i=c(n.getItemControlProps(r),h.itemControl.attrs,e);return(0,b.jsx)(l.div,{...i,ref:t})});k.displayName=`SegmentGroupItemControl`;var A=(0,y.forwardRef)((e,t)=>{let n=_(),r=T(),i=c(n.getItemHiddenInputProps(r),e);return(0,b.jsx)(l.input,{...i,ref:t})});A.displayName=`SegmentGroupItemHiddenInput`;var j=(0,y.forwardRef)((e,t)=>{let n=_(),r=T(),i=c(n.getItemTextProps(r),h.itemText.attrs,e);return(0,b.jsx)(l.span,{...i,ref:t})});j.displayName=`SegmentGroupItemText`;var M=(0,y.forwardRef)((e,t)=>{let n=c(_().getLabelProps(),h.label.attrs,e);return(0,b.jsx)(l.span,{...n,ref:t})});M.displayName=`SegmentGroupLabel`;var N=e=>{let t=(0,y.useId)(),{getRootNode:r}=n(),{dir:i}=a();return m(u(p,{id:t,dir:i,getRootNode:r,...e}),s)},P=f(),F=(0,y.forwardRef)((e,t)=>{let[n,r]=P(e,[`defaultValue`,`disabled`,`form`,`id`,`ids`,`invalid`,`name`,`onValueChange`,`orientation`,`readOnly`,`required`,`value`]),i=N(n),a=c(i.getRootProps(),h.root.attrs,r);return(0,b.jsx)(g,{value:i,children:(0,b.jsx)(l.div,{...a,ref:t})})});F.displayName=`SegmentGroupRoot`;var I=f(),L=(0,y.forwardRef)((e,t)=>{let[{value:n},r]=I(e,[`value`]),i=c(n.getRootProps(),h.root.attrs,r);return(0,b.jsx)(g,{value:n,children:(0,b.jsx)(l.div,{...i,ref:t})})});L.displayName=`SegmentGroupRootProvider`;var R=r({Context:()=>v,Indicator:()=>x,Item:()=>D,ItemContext:()=>O,ItemControl:()=>k,ItemHiddenInput:()=>A,ItemText:()=>j,Label:()=>M,Root:()=>F,RootProvider:()=>L}),{withProvider:z,withContext:B,useStyles:V,PropsProvider:H}=o({key:`segmentGroup`});z(R.RootProvider,`root`,{forwardAsChild:!0});var U=z(R.Root,`root`,{forwardAsChild:!0,forwardProps:[`orientation`],defaultProps:{orientation:`horizontal`}}),W=B(R.Item,`item`,{forwardAsChild:!0}),G=B(R.ItemText,`itemText`,{forwardAsChild:!0}),K=B(R.Indicator,`indicator`,{forwardAsChild:!0}),q=R.ItemHiddenInput;R.Context,R.ItemContext;export{U as a,G as i,W as n,q as r,K as t};
2
- //# sourceMappingURL=segment-group-DQ4SkpwM.js.map
@@ -1,2 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{t as n}from"./jsx-runtime-CFwixLRt.js";import{a as r,i,n as a,r as o,t as s}from"./segment-group-DQ4SkpwM.js";var c=e(t()),l=n();function u(e){return e.map(e=>typeof e==`string`?{value:e,label:e}:e)}var d=c.forwardRef(function(e,t){let{items:n,...d}=e,f=c.useMemo(()=>u(n),[n]);return(0,l.jsxs)(r,{ref:t,...d,children:[(0,l.jsx)(s,{}),f.map(e=>(0,l.jsxs)(a,{value:e.value,disabled:e.disabled,children:[(0,l.jsx)(i,{children:e.label}),(0,l.jsx)(o,{})]},e.value))]})});export{d as t};
2
- //# sourceMappingURL=segmented-control-BNxU6DEN.js.map
@@ -1,2 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{C as n,Ct as r,D as i,E as a,K as o,Kt as s,O as c,Ot as l,S as u,T as ee,U as te,V as d,Wt as f,_ as p,_t as ne,b as m,d as h,j as g,k as _,lt as re,p as v,q as ie,t as y,u as ae,w as b,wt as x,x as S,zt as C}from"./portal-Sdfvrza9.js";import{t as w}from"./jsx-runtime-CFwixLRt.js";import{i as T,n as E,o as D,r as O}from"./badge-Cpc3eA-C.js";import{a as k,i as oe,n as se,o as ce,r as le}from"./tooltip-gjZ4s2dt.js";import{n as ue}from"./dismissable-layer-DBn7OJNY.js";import{a as de,c as fe,i as pe,t as me}from"./visually-hidden-0SZJZ5dQ.js";import{n as he,t as ge}from"./initial-focus-Bd40-gsw.js";import{n as A}from"./icon-D6xQEiPb.js";import{c as _e,l as ve,o as ye}from"./field-BadoNaN5.js";import{r as be}from"./IsolatedErrorBoundary-CZ4MnYEN.js";import{i as xe,n as Se,r as Ce,t as we}from"./split-presence-props-CBmNxzZm.js";import{a as Te}from"./field-uFetMRUQ.js";import{Kr as j}from"./index-CPtTUYLD.js";var Ee=Object.defineProperty,De=(e,t,n)=>t in e?Ee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,M=(e,t,n)=>De(e,typeof t==`symbol`?t:t+``,n),N={itemToValue(e){return typeof e==`string`?e:f(e)&&C(e,`value`)?e.value:``},itemToString(e){return typeof e==`string`?e:f(e)&&C(e,`label`)?e.label:N.itemToValue(e)},isItemDisabled(e){return f(e)&&C(e,`disabled`)?!!e.disabled:!1}},P=class e{constructor(t){M(this,`options`,t),M(this,`items`),M(this,`indexMap`,null),M(this,`copy`,t=>new e({...this.options,items:t??[...this.items]})),M(this,`isEqual`,e=>D(this.items,e.items)),M(this,`setItems`,e=>this.copy(e)),M(this,`getValues`,(e=this.items)=>{let t=[];for(let n of e){let e=this.getItemValue(n);e!=null&&t.push(e)}return t}),M(this,`find`,e=>{if(e==null)return null;let t=this.indexOf(e);return t===-1?null:this.at(t)}),M(this,`findMany`,e=>{let t=[];for(let n of e){let e=this.find(n);e!=null&&t.push(e)}return t}),M(this,`at`,e=>{if(!this.options.groupBy&&!this.options.groupSort)return this.items[e]??null;let t=0,n=this.group();for(let[,r]of n)for(let n of r){if(t===e)return n;t++}return null}),M(this,`sortFn`,(e,t)=>{let n=this.indexOf(e),r=this.indexOf(t);return(n??0)-(r??0)}),M(this,`sort`,e=>[...e].sort(this.sortFn.bind(this))),M(this,`getItemValue`,e=>e==null?null:this.options.itemToValue?.(e)??N.itemToValue(e)),M(this,`getItemDisabled`,e=>e==null?!1:this.options.isItemDisabled?.(e)??N.isItemDisabled(e)),M(this,`stringifyItem`,e=>e==null?null:this.options.itemToString?.(e)??N.itemToString(e)),M(this,`stringify`,e=>e==null?null:this.stringifyItem(this.find(e))),M(this,`stringifyItems`,(e,t=`, `)=>{let n=[];for(let t of e){let e=this.stringifyItem(t);e!=null&&n.push(e)}return n.join(t)}),M(this,`stringifyMany`,(e,t)=>this.stringifyItems(this.findMany(e),t)),M(this,`has`,e=>this.indexOf(e)!==-1),M(this,`hasItem`,e=>e==null?!1:this.has(this.getItemValue(e))),M(this,`group`,()=>{let{groupBy:e,groupSort:t}=this.options;if(!e)return[[``,[...this.items]]];let n=new Map;this.items.forEach((t,r)=>{let i=e(t,r);n.has(i)||n.set(i,[]),n.get(i).push(t)});let r=Array.from(n.entries());return t&&r.sort(([e],[n])=>{if(typeof t==`function`)return t(e,n);if(Array.isArray(t)){let r=t.indexOf(e),i=t.indexOf(n);return r===-1?1:i===-1?-1:r-i}return t===`asc`?e.localeCompare(n):t===`desc`?n.localeCompare(e):0}),r}),M(this,`getNextValue`,(e,t=1,n=!1)=>{let r=this.indexOf(e);if(r===-1)return null;for(r=n?Math.min(r+t,this.size-1):r+t;r<=this.size&&this.getItemDisabled(this.at(r));)r++;return this.getItemValue(this.at(r))}),M(this,`getPreviousValue`,(e,t=1,n=!1)=>{let r=this.indexOf(e);if(r===-1)return null;for(r=n?Math.max(r-t,0):r-t;r>=0&&this.getItemDisabled(this.at(r));)r--;return this.getItemValue(this.at(r))}),M(this,`indexOf`,e=>{if(e==null)return-1;if(!this.options.groupBy&&!this.options.groupSort)return this.items.findIndex(t=>this.getItemValue(t)===e);if(!this.indexMap){this.indexMap=new Map;let e=0,t=this.group();for(let[,n]of t)for(let t of n){let n=this.getItemValue(t);n!=null&&this.indexMap.set(n,e),e++}}return this.indexMap.get(e)??-1}),M(this,`getByText`,(e,t)=>{let n=t==null?-1:this.indexOf(t),r=e.length===1;for(let i=0;i<this.items.length;i++){let a=this.items[(n+i+1)%this.items.length];if(!(r&&this.getItemValue(a)===t)&&!this.getItemDisabled(a)&&Oe(this.stringifyItem(a),e))return a}}),M(this,`search`,(e,t)=>{let{state:n,currentValue:r,timeout:i=350}=t,a=n.keysSoFar+e,o=a.length>1&&Array.from(a).every(e=>e===a[0])?a[0]:a,s=this.getByText(o,r),c=this.getItemValue(s);function l(){clearTimeout(n.timer),n.timer=-1}function u(e){n.keysSoFar=e,l(),e!==``&&(n.timer=+setTimeout(()=>{u(``),l()},i))}return u(a),c}),M(this,`update`,(e,t)=>{let n=this.indexOf(e);return n===-1?this:this.copy([...this.items.slice(0,n),t,...this.items.slice(n+1)])}),M(this,`upsert`,(e,t,n=`append`)=>{let r=this.indexOf(e);return r===-1?(n===`append`?this.append:this.prepend)(t):this.copy([...this.items.slice(0,r),t,...this.items.slice(r+1)])}),M(this,`insert`,(e,...t)=>this.copy(F(this.items,e,...t))),M(this,`insertBefore`,(e,...t)=>{let n=this.indexOf(e);if(n===-1)if(this.items.length===0)n=0;else return this;return this.copy(F(this.items,n,...t))}),M(this,`insertAfter`,(e,...t)=>{let n=this.indexOf(e);if(n===-1)if(this.items.length===0)n=0;else return this;return this.copy(F(this.items,n+1,...t))}),M(this,`prepend`,(...e)=>this.copy(F(this.items,0,...e))),M(this,`append`,(...e)=>this.copy(F(this.items,this.items.length,...e))),M(this,`filter`,e=>{let t=this.items.filter((t,n)=>e(this.stringifyItem(t),n,t));return this.copy(t)}),M(this,`remove`,(...e)=>{let t=e.map(e=>typeof e==`string`?e:this.getItemValue(e));return this.copy(this.items.filter(e=>{let n=this.getItemValue(e);return n==null?!1:!t.includes(n)}))}),M(this,`move`,(e,t)=>{let n=this.indexOf(e);return n===-1?this:this.copy(I(this.items,[n],t))}),M(this,`moveBefore`,(e,...t)=>{let n=this.items.findIndex(t=>this.getItemValue(t)===e);if(n===-1)return this;let r=t.map(e=>this.items.findIndex(t=>this.getItemValue(t)===e)).sort((e,t)=>e-t);return this.copy(I(this.items,r,n))}),M(this,`moveAfter`,(e,...t)=>{let n=this.items.findIndex(t=>this.getItemValue(t)===e);if(n===-1)return this;let r=t.map(e=>this.items.findIndex(t=>this.getItemValue(t)===e)).sort((e,t)=>e-t);return this.copy(I(this.items,r,n+1))}),M(this,`reorder`,(e,t)=>this.copy(I(this.items,[e],t))),M(this,`compareValue`,(e,t)=>{let n=this.indexOf(e),r=this.indexOf(t);return n<r?-1:+(n>r)}),M(this,`range`,(e,t)=>{let n=[],r=e;for(;r!=null;){if(this.find(r)&&n.push(r),r===t)return n;r=this.getNextValue(r)}return[]}),M(this,`getValueRange`,(e,t)=>e&&t?this.compareValue(e,t)<=0?this.range(e,t):this.range(t,e):[]),M(this,`toString`,()=>{let e=``;for(let t of this.items){let n=[this.getItemValue(t),this.stringifyItem(t),this.getItemDisabled(t)].filter(Boolean).join(`:`);e+=n+`,`}return e}),M(this,`toJSON`,()=>({size:this.size,first:this.firstValue,last:this.lastValue})),this.items=[...t.items]}get size(){return this.items.length}get firstValue(){let e=0;for(;this.getItemDisabled(this.at(e));)e++;return this.getItemValue(this.at(e))}get lastValue(){let e=this.size-1;for(;this.getItemDisabled(this.at(e));)e--;return this.getItemValue(this.at(e))}*[Symbol.iterator](){yield*this.items}},Oe=(e,t)=>!!e?.toLowerCase().startsWith(t.toLowerCase());function F(e,t,...n){return[...e.slice(0,t),...n,...e.slice(t)]}function I(e,t,n){t=[...t].sort((e,t)=>e-t);let r=t.map(t=>e[t]);for(let n=t.length-1;n>=0;n--)e=[...e.slice(0,t[n]),...e.slice(t[n]+1)];return n=Math.max(0,n-t.filter(e=>e<n).length),[...e.slice(0,n),...r,...e.slice(n)]}function ke({values:e,collection:t,selectedItemMap:n}){let r=[];for(let i of e){let e=t.find(i)??n.get(i);e!=null&&r.push(e)}return r}function Ae({selectedItemMap:e,values:t,selectedItems:n,collection:r}){let i=new Map(e);for(let e of n){let t=r.getItemValue(e);t!=null&&i.set(t,e)}let a=new Set(t);for(let e of i.keys())a.has(e)||i.delete(e);return i}function L({values:e,collection:t,selectedItemMap:n}){let r=ke({values:e,collection:t,selectedItemMap:n});return{selectedItems:r,nextSelectedItemMap:Ae({selectedItemMap:n,values:e,selectedItems:r,collection:t})}}function je({selectedItems:e,collection:t}){return Ae({selectedItemMap:new Map,values:e.map(e=>t.getItemValue(e)).filter(Boolean),selectedItems:e,collection:t})}var Me=e=>new P(e);Me.empty=()=>new P({items:[]});var Ne=e=>e.ids?.root??`select:${e.id}`,R=e=>e.ids?.content??`select:${e.id}:content`,z=e=>e.ids?.trigger??`select:${e.id}:trigger`,Pe=e=>e.ids?.clearTrigger??`select:${e.id}:clear-trigger`,B=e=>e.ids?.label??`select:${e.id}:label`,Fe=e=>e.ids?.control??`select:${e.id}:control`,V=(e,t)=>e.ids?.item?.(t)??`select:${e.id}:option:${t}`,H=e=>e.ids?.hiddenSelect??`select:${e.id}:select`,Ie=e=>e.ids?.positioner??`select:${e.id}:positioner`,Le=(e,t)=>e.ids?.itemGroup?.(t)??`select:${e.id}:optgroup:${t}`,Re=(e,t)=>e.ids?.itemGroupLabel?.(t)??`select:${e.id}:optgroup-label:${t}`,U=e=>e.getById(H(e)),W=e=>e.getById(R(e)),G=e=>e.getById(z(e)),ze=e=>e.getById(Pe(e)),Be=e=>e.getById(Ie(e)),K=(e,t)=>t==null?null:e.getById(V(e,t));function Ve(e,t){let{context:n,prop:i,scope:a,state:s,computed:c,send:u}=e,ee=i(`translations`),d=i(`disabled`)||n.get(`fieldsetDisabled`),f=!!i(`invalid`),p=!!i(`required`),m=!!i(`readOnly`),h=i(`composite`),g=i(`collection`),_=s.hasTag(`open`),v=s.matches(`focused`),y=n.get(`highlightedValue`),ae=n.get(`highlightedItem`),b=c(`selectedItems`),S=n.get(`currentPlacement`),C=S?ce(S):void 0,w=c(`isTypingAhead`),T=c(`isInteractive`),D=y?V(a,y):void 0;function O(e){let t=g.getItemDisabled(e.item),r=g.getItemValue(e.item);return l(r,()=>`[zag-js] No value found for item ${JSON.stringify(e.item)}`),{value:r,disabled:!!(d||t),highlighted:y===r,selected:n.get(`value`).includes(r)}}let k=oe({...i(`positioning`),placement:S});return{open:_,focused:v,empty:n.get(`value`).length===0,highlightedItem:ae,highlightedValue:y,selectedItems:b,hasSelectedItems:c(`hasSelectedItems`),value:n.get(`value`),valueAsString:c(`valueAsString`),collection:g,multiple:!!i(`multiple`),disabled:!!d,reposition(e={}){u({type:`POSITIONING.SET`,options:e})},focus(){G(a)?.focus({preventScroll:!0})},setOpen(e){s.hasTag(`open`)!==e&&u({type:e?`OPEN`:`CLOSE`})},selectValue(e){u({type:`ITEM.SELECT`,value:e})},setValue(e){u({type:`VALUE.SET`,value:e})},selectAll(){u({type:`VALUE.SET`,value:g.getValues()})},setHighlightValue(e){u({type:`HIGHLIGHTED_VALUE.SET`,value:e})},clearHighlightValue(){u({type:`HIGHLIGHTED_VALUE.CLEAR`})},clearValue(e){u(e?{type:`ITEM.CLEAR`,value:e}:{type:`VALUE.CLEAR`})},getItemState:O,getRootProps(){return t.element({...j.root.attrs,dir:i(`dir`),id:Ne(a),"data-invalid":x(f),"data-readonly":x(m)})},getLabelProps(){return t.label({dir:i(`dir`),id:B(a),...j.label.attrs,"data-disabled":x(d),"data-invalid":x(f),"data-readonly":x(m),"data-required":x(p),htmlFor:H(a),onClick(e){e.defaultPrevented||d||G(a)?.focus({preventScroll:!0})}})},getControlProps(){return t.element({...j.control.attrs,dir:i(`dir`),id:Fe(a),"data-state":_?`open`:`closed`,"data-focus":x(v),"data-disabled":x(d),"data-invalid":x(f)})},getValueTextProps(){return t.element({...j.valueText.attrs,dir:i(`dir`),"data-disabled":x(d),"data-invalid":x(f),"data-focus":x(v)})},getTriggerProps(){return t.button({id:z(a),disabled:d,dir:i(`dir`),type:`button`,role:`combobox`,"aria-controls":R(a),"aria-expanded":_,"aria-haspopup":`listbox`,"data-state":_?`open`:`closed`,"aria-invalid":f,"aria-required":p,"aria-labelledby":B(a),...j.trigger.attrs,"data-disabled":x(d),"data-invalid":x(f),"data-readonly":x(m),"data-placement":S,"data-side":C,"data-placeholder-shown":x(!c(`hasSelectedItems`)),onClick(e){T&&(e.defaultPrevented||u({type:`TRIGGER.CLICK`}))},onFocus(){u({type:`TRIGGER.FOCUS`})},onBlur(){u({type:`TRIGGER.BLUR`})},onKeyDown(e){if(e.defaultPrevented||!T)return;let t={ArrowUp(){u({type:`TRIGGER.ARROW_UP`})},ArrowDown(e){u({type:e.altKey?`OPEN`:`TRIGGER.ARROW_DOWN`})},ArrowLeft(){u({type:`TRIGGER.ARROW_LEFT`})},ArrowRight(){u({type:`TRIGGER.ARROW_RIGHT`})},Home(){u({type:`TRIGGER.HOME`})},End(){u({type:`TRIGGER.END`})},Enter(){u({type:`TRIGGER.ENTER`})},Space(e){u(w?{type:`TRIGGER.TYPEAHEAD`,key:e.key}:{type:`TRIGGER.ENTER`})}}[te(e,{dir:i(`dir`),orientation:`vertical`})];if(t){t(e),e.preventDefault();return}E.isValidEvent(e)&&(u({type:`TRIGGER.TYPEAHEAD`,key:e.key}),e.preventDefault())}})},getIndicatorProps(){return t.element({...j.indicator.attrs,dir:i(`dir`),"aria-hidden":!0,"data-state":_?`open`:`closed`,"data-disabled":x(d),"data-invalid":x(f),"data-readonly":x(m)})},getItemProps(n){let o=O(n);return t.element({id:V(a,o.value),role:`option`,...j.item.attrs,dir:i(`dir`),"data-value":o.value,"aria-selected":o.selected,"data-state":o.selected?`checked`:`unchecked`,"data-highlighted":x(o.highlighted),"data-disabled":x(o.disabled),"aria-disabled":r(o.disabled),onPointerMove(e){o.disabled||e.pointerType!==`mouse`||o.value!==y&&u({type:`ITEM.POINTER_MOVE`,value:o.value})},onClick(e){e.defaultPrevented||o.disabled||u({type:`ITEM.CLICK`,src:`pointerup`,value:o.value})},onPointerLeave(t){o.disabled||n.persistFocus||t.pointerType===`mouse`&&e.event.previous()?.type.includes(`POINTER`)&&u({type:`ITEM.POINTER_LEAVE`})}})},getItemTextProps(e){let n=O(e);return t.element({...j.itemText.attrs,"data-state":n.selected?`checked`:`unchecked`,"data-disabled":x(n.disabled),"data-highlighted":x(n.highlighted)})},getItemIndicatorProps(e){let n=O(e);return t.element({"aria-hidden":!0,...j.itemIndicator.attrs,"data-state":n.selected?`checked`:`unchecked`,hidden:!n.selected})},getItemGroupLabelProps(e){let{htmlFor:n}=e;return t.element({...j.itemGroupLabel.attrs,id:Re(a,n),dir:i(`dir`),role:`presentation`})},getItemGroupProps(e){let{id:n}=e;return t.element({...j.itemGroup.attrs,"data-disabled":x(d),id:Le(a,n),"aria-labelledby":Re(a,n),role:`group`,dir:i(`dir`)})},getClearTriggerProps(){return t.button({...j.clearTrigger.attrs,id:Pe(a),type:`button`,"aria-label":ee.clearTriggerLabel,"data-invalid":x(f),disabled:d,hidden:!c(`hasSelectedItems`),dir:i(`dir`),onClick(e){e.defaultPrevented||u({type:`CLEAR.CLICK`})}})},getHiddenSelectProps(){let e=n.get(`value`),r=i(`multiple`)?e:e?.[0],o=e=>{pe(ie(e))||u({type:`VALUE.SET`,value:He(e.currentTarget)})};return t.select({name:i(`name`),form:i(`form`),disabled:d,multiple:i(`multiple`),required:i(`required`),"aria-hidden":!0,id:H(a),defaultValue:r,style:me,tabIndex:-1,autoComplete:i(`autoComplete`),onChange:o,onInput:o,onFocus(){G(a)?.focus({preventScroll:!0})},"aria-labelledby":B(a)})},getPositionerProps(){return t.element({...j.positioner.attrs,dir:i(`dir`),id:Ie(a),style:k.floating})},getContentProps(){return t.element({hidden:!_,dir:i(`dir`),id:R(a),role:h?`listbox`:`dialog`,...j.content.attrs,"data-state":_?`open`:`closed`,"data-placement":S,"data-side":C,"data-activedescendant":D,"aria-activedescendant":h?D:void 0,"aria-multiselectable":i(`multiple`)&&h?!0:void 0,"aria-labelledby":B(a),tabIndex:0,onKeyDown(e){if(!T||!re(e.currentTarget,o(e)))return;if(e.key===`Tab`&&!he(e)){e.preventDefault();return}let t={ArrowUp(){u({type:`CONTENT.ARROW_UP`})},ArrowDown(){u({type:`CONTENT.ARROW_DOWN`})},Home(){u({type:`CONTENT.HOME`})},End(){u({type:`CONTENT.END`})},Enter(){u({type:`ITEM.CLICK`,src:`keydown.enter`})},Space(e){w?u({type:`CONTENT.TYPEAHEAD`,key:e.key}):t.Enter?.(e)}},n=t[te(e)];if(n){n(e),e.preventDefault();return}ne(o(e))||E.isValidEvent(e)&&(u({type:`CONTENT.TYPEAHEAD`,key:e.key}),e.preventDefault())}})},getListProps(){return t.element({...j.list.attrs,tabIndex:0,role:h?void 0:`listbox`,"aria-labelledby":z(a),"aria-activedescendant":h?void 0:D,"aria-multiselectable":!h&&i(`multiple`)?!0:void 0})}}}var He=e=>e.multiple?Array.from(e.selectedOptions,e=>e.value):e.value?[e.value]:[],{and:q,not:J,or:Ue}=c(),We=_({props({props:e}){return{loopFocus:!1,closeOnSelect:!e.multiple,composite:!0,defaultValue:[],...e,collection:e.collection??Me.empty(),translations:{clearTriggerLabel:`Clear value`,...e.translations},positioning:{placement:`bottom-start`,gutter:8,...e.positioning}}},context({prop:e,bindable:t,getContext:n}){let r=e(`value`)??e(`defaultValue`)??[],i=e(`collection`).findMany(r);return{value:t(()=>({defaultValue:e(`defaultValue`),value:e(`value`),isEqual:D,onChange(t){let r=n(),i=e(`collection`),a=L({values:t,collection:i,selectedItemMap:r.get(`selectedItemMap`)}),o=e(`value`)??t,s=o===t?a:L({values:o,collection:i,selectedItemMap:a.nextSelectedItemMap});return r.set(`selectedItemMap`,s.nextSelectedItemMap),e(`onValueChange`)?.({value:t,items:a.selectedItems})}})),highlightedValue:t(()=>({defaultValue:e(`defaultHighlightedValue`)||null,value:e(`highlightedValue`),onChange(t){e(`onHighlightChange`)?.({highlightedValue:t,highlightedItem:e(`collection`).find(t),highlightedIndex:e(`collection`).indexOf(t)})}})),currentPlacement:t(()=>({defaultValue:void 0})),fieldsetDisabled:t(()=>({defaultValue:!1})),highlightedItem:t(()=>({defaultValue:null})),selectedItemMap:t(()=>({defaultValue:je({selectedItems:i,collection:e(`collection`)})}))}},refs(){return{typeahead:{...E.defaultOptions}}},computed:{hasSelectedItems:({context:e})=>e.get(`value`).length>0,isTypingAhead:({refs:e})=>e.get(`typeahead`).keysSoFar!==``,isDisabled:({prop:e,context:t})=>!!e(`disabled`)||!!t.get(`fieldsetDisabled`),isInteractive:({prop:e})=>!(e(`disabled`)||e(`readOnly`)),selectedItems:({context:e,prop:t})=>ke({values:e.get(`value`),collection:t(`collection`),selectedItemMap:e.get(`selectedItemMap`)}),valueAsString:({computed:e,prop:t})=>t(`collection`).stringifyItems(e(`selectedItems`))},initialState({prop:e}){return e(`open`)||e(`defaultOpen`)?`open`:`idle`},entry:[`syncSelectElement`],watch({context:e,prop:t,track:n,action:r}){n([()=>e.get(`value`).toString()],()=>{r([`syncSelectedItems`,`syncSelectElement`,`dispatchChangeEvent`])}),n([()=>t(`open`)],()=>{r([`toggleVisibility`])}),n([()=>e.get(`highlightedValue`)],()=>{r([`syncHighlightedItem`])}),n([()=>t(`collection`).toString()],()=>{r([`syncCollection`])})},on:{"HIGHLIGHTED_VALUE.SET":{actions:[`setHighlightedItem`]},"HIGHLIGHTED_VALUE.CLEAR":{actions:[`clearHighlightedItem`]},"ITEM.SELECT":{actions:[`selectItem`]},"ITEM.CLEAR":{actions:[`clearItem`]},"VALUE.SET":{actions:[`setSelectedItems`]},"VALUE.CLEAR":{actions:[`clearSelectedItems`]},"CLEAR.CLICK":{actions:[`clearSelectedItems`,`focusTriggerEl`]}},effects:[`trackFormControlState`],states:{idle:{tags:[`closed`],on:{"CONTROLLED.OPEN":[{guard:`isTriggerClickEvent`,target:`open`,actions:[`setInitialFocus`,`highlightFirstSelectedItem`]},{target:`open`,actions:[`setInitialFocus`]}],"TRIGGER.CLICK":[{guard:`isOpenControlled`,actions:[`invokeOnOpen`]},{target:`open`,actions:[`invokeOnOpen`,`setInitialFocus`,`highlightFirstSelectedItem`]}],"TRIGGER.FOCUS":{target:`focused`},OPEN:[{guard:`isOpenControlled`,actions:[`invokeOnOpen`]},{target:`open`,actions:[`setInitialFocus`,`invokeOnOpen`]}]}},focused:{tags:[`closed`],on:{"CONTROLLED.OPEN":[{guard:`isTriggerClickEvent`,target:`open`,actions:[`setInitialFocus`,`highlightFirstSelectedItem`]},{guard:`isTriggerArrowUpEvent`,target:`open`,actions:[`setInitialFocus`,`highlightComputedLastItem`]},{guard:Ue(`isTriggerArrowDownEvent`,`isTriggerEnterEvent`),target:`open`,actions:[`setInitialFocus`,`highlightComputedFirstItem`]},{target:`open`,actions:[`setInitialFocus`]}],OPEN:[{guard:`isOpenControlled`,actions:[`invokeOnOpen`]},{target:`open`,actions:[`setInitialFocus`,`invokeOnOpen`]}],"TRIGGER.BLUR":{target:`idle`},"TRIGGER.CLICK":[{guard:`isOpenControlled`,actions:[`invokeOnOpen`]},{target:`open`,actions:[`setInitialFocus`,`invokeOnOpen`,`highlightFirstSelectedItem`]}],"TRIGGER.ENTER":[{guard:`isOpenControlled`,actions:[`invokeOnOpen`]},{target:`open`,actions:[`setInitialFocus`,`invokeOnOpen`,`highlightComputedFirstItem`]}],"TRIGGER.ARROW_UP":[{guard:`isOpenControlled`,actions:[`invokeOnOpen`]},{target:`open`,actions:[`setInitialFocus`,`invokeOnOpen`,`highlightComputedLastItem`]}],"TRIGGER.ARROW_DOWN":[{guard:`isOpenControlled`,actions:[`invokeOnOpen`]},{target:`open`,actions:[`setInitialFocus`,`invokeOnOpen`,`highlightComputedFirstItem`]}],"TRIGGER.ARROW_LEFT":[{guard:q(J(`multiple`),`hasSelectedItems`),actions:[`selectPreviousItem`]},{guard:J(`multiple`),actions:[`selectLastItem`]}],"TRIGGER.ARROW_RIGHT":[{guard:q(J(`multiple`),`hasSelectedItems`),actions:[`selectNextItem`]},{guard:J(`multiple`),actions:[`selectFirstItem`]}],"TRIGGER.HOME":{guard:J(`multiple`),actions:[`selectFirstItem`]},"TRIGGER.END":{guard:J(`multiple`),actions:[`selectLastItem`]},"TRIGGER.TYPEAHEAD":{guard:J(`multiple`),actions:[`selectMatchingItem`]}}},open:{tags:[`open`],exit:[`scrollContentToTop`],effects:[`trackDismissableElement`,`trackFocusVisible`,`computePlacement`,`scrollToHighlightedItem`],on:{"CONTROLLED.CLOSE":[{guard:`restoreFocus`,target:`focused`,actions:[`focusTriggerEl`,`clearHighlightedItem`]},{target:`idle`,actions:[`clearHighlightedItem`]}],CLOSE:[{guard:`isOpenControlled`,actions:[`invokeOnClose`]},{guard:`restoreFocus`,target:`focused`,actions:[`invokeOnClose`,`focusTriggerEl`,`clearHighlightedItem`]},{target:`idle`,actions:[`invokeOnClose`,`clearHighlightedItem`]}],"TRIGGER.CLICK":[{guard:`isOpenControlled`,actions:[`invokeOnClose`]},{target:`focused`,actions:[`invokeOnClose`,`clearHighlightedItem`]}],"ITEM.CLICK":[{guard:q(`closeOnSelect`,`isOpenControlled`),actions:[`selectHighlightedItem`,`invokeOnClose`]},{guard:`closeOnSelect`,target:`focused`,actions:[`selectHighlightedItem`,`invokeOnClose`,`focusTriggerEl`,`clearHighlightedItem`]},{actions:[`selectHighlightedItem`]}],"CONTENT.HOME":{actions:[`highlightFirstItem`]},"CONTENT.END":{actions:[`highlightLastItem`]},"CONTENT.ARROW_DOWN":[{guard:q(`hasHighlightedItem`,`loop`,`isLastItemHighlighted`),actions:[`highlightFirstItem`]},{guard:`hasHighlightedItem`,actions:[`highlightNextItem`]},{actions:[`highlightFirstItem`]}],"CONTENT.ARROW_UP":[{guard:q(`hasHighlightedItem`,`loop`,`isFirstItemHighlighted`),actions:[`highlightLastItem`]},{guard:`hasHighlightedItem`,actions:[`highlightPreviousItem`]},{actions:[`highlightLastItem`]}],"CONTENT.TYPEAHEAD":{actions:[`highlightMatchingItem`]},"ITEM.POINTER_MOVE":{actions:[`highlightItem`]},"ITEM.POINTER_LEAVE":{actions:[`clearHighlightedItem`]},"POSITIONING.SET":{actions:[`reposition`]}}}},implementations:{guards:{loop:({prop:e})=>!!e(`loopFocus`),multiple:({prop:e})=>!!e(`multiple`),hasSelectedItems:({computed:e})=>!!e(`hasSelectedItems`),hasHighlightedItem:({context:e})=>e.get(`highlightedValue`)!=null,isFirstItemHighlighted:({context:e,prop:t})=>e.get(`highlightedValue`)===t(`collection`).firstValue,isLastItemHighlighted:({context:e,prop:t})=>e.get(`highlightedValue`)===t(`collection`).lastValue,closeOnSelect:({prop:e,event:t})=>!!(t.closeOnSelect??e(`closeOnSelect`)),restoreFocus:({event:e})=>Ge(e),isOpenControlled:({prop:e})=>e(`open`)!==void 0,isTriggerClickEvent:({event:e})=>e.previousEvent?.type===`TRIGGER.CLICK`,isTriggerEnterEvent:({event:e})=>e.previousEvent?.type===`TRIGGER.ENTER`,isTriggerArrowUpEvent:({event:e})=>e.previousEvent?.type===`TRIGGER.ARROW_UP`,isTriggerArrowDownEvent:({event:e})=>e.previousEvent?.type===`TRIGGER.ARROW_DOWN`},effects:{trackFocusVisible({scope:e}){return ve({root:e.getRootNode?.()})},trackFormControlState({context:e,scope:t}){return fe(U(t),{onFieldsetDisabledChange(t){e.set(`fieldsetDisabled`,t)},onFormReset(){let t=e.initial(`value`);e.set(`value`,t)}})},trackDismissableElement({scope:e,send:t,prop:n}){let r=()=>W(e),i=!0;return ue(r,{type:`listbox`,defer:!0,exclude:[G(e),ze(e)],onFocusOutside:n(`onFocusOutside`),onPointerDownOutside:n(`onPointerDownOutside`),onInteractOutside(e){n(`onInteractOutside`)?.(e),i=!(e.detail.focusable||e.detail.contextmenu)},onDismiss(){t({type:`CLOSE`,src:`interact-outside`,restoreFocus:i})}})},computePlacement({context:e,prop:t,scope:n}){let r=t(`positioning`);return e.set(`currentPlacement`,r.placement),k(()=>G(n),()=>Be(n),{defer:!0,...r,onComplete(t){e.set(`currentPlacement`,t.placement)}})},scrollToHighlightedItem({context:e,prop:t,scope:n}){let r=r=>{let i=e.get(`highlightedValue`);if(i==null||ye()===`pointer`)return;let a=W(n),o=t(`scrollToIndexFn`);if(o){let e=t(`collection`).indexOf(i);o?.({index:e,immediate:r,getElement:()=>K(n,i)});return}O(K(n,i),{rootEl:a,block:`nearest`})};return d(()=>{_e(`virtual`),r(!0)}),T(()=>W(n),{defer:!0,attributes:[`data-activedescendant`],callback(){r(!1)}})}},actions:{reposition({context:e,prop:t,scope:n,event:r}){k(G(n),()=>Be(n),{...t(`positioning`),...r.options,defer:!0,listeners:!1,onComplete(t){e.set(`currentPlacement`,t.placement)}})},toggleVisibility({send:e,prop:t,event:n}){e({type:t(`open`)?`CONTROLLED.OPEN`:`CONTROLLED.CLOSE`,previousEvent:n})},highlightPreviousItem({context:e,prop:t}){let n=e.get(`highlightedValue`);if(n==null)return;let r=t(`collection`).getPreviousValue(n,1,t(`loopFocus`));r!=null&&e.set(`highlightedValue`,r)},highlightNextItem({context:e,prop:t}){let n=e.get(`highlightedValue`);if(n==null)return;let r=t(`collection`).getNextValue(n,1,t(`loopFocus`));r!=null&&e.set(`highlightedValue`,r)},highlightFirstItem({context:e,prop:t}){let n=t(`collection`).firstValue;e.set(`highlightedValue`,n)},highlightLastItem({context:e,prop:t}){let n=t(`collection`).lastValue;e.set(`highlightedValue`,n)},setInitialFocus({scope:e}){d(()=>{ge({root:W(e)})?.focus({preventScroll:!0})})},focusTriggerEl({event:e,scope:t}){Ge(e)&&d(()=>{G(t)?.focus({preventScroll:!0})})},selectHighlightedItem({context:e,prop:t,event:n}){let r=n.value??e.get(`highlightedValue`);r==null||!t(`collection`).has(r)||(t(`onSelect`)?.({value:r}),r=t(`deselectable`)&&!t(`multiple`)&&e.get(`value`).includes(r)?null:r,e.set(`value`,e=>r==null?[]:t(`multiple`)?s(e,r):[r]))},highlightComputedFirstItem({context:e,prop:t,computed:n}){let r=t(`collection`),i=n(`hasSelectedItems`)?r.sort(e.get(`value`))[0]:r.firstValue;e.set(`highlightedValue`,i)},highlightComputedLastItem({context:e,prop:t,computed:n}){let r=t(`collection`),i=n(`hasSelectedItems`)?r.sort(e.get(`value`))[0]:r.lastValue;e.set(`highlightedValue`,i)},highlightFirstSelectedItem({context:e,prop:t,computed:n}){if(!n(`hasSelectedItems`))return;let r=t(`collection`).sort(e.get(`value`))[0];e.set(`highlightedValue`,r)},highlightItem({context:e,event:t}){e.set(`highlightedValue`,t.value)},highlightMatchingItem({context:e,prop:t,event:n,refs:r}){let i=t(`collection`).search(n.key,{state:r.get(`typeahead`),currentValue:e.get(`highlightedValue`)});i!=null&&e.set(`highlightedValue`,i)},setHighlightedItem({context:e,event:t}){e.set(`highlightedValue`,t.value)},clearHighlightedItem({context:e}){e.set(`highlightedValue`,null)},selectItem({context:e,prop:t,event:n}){t(`onSelect`)?.({value:n.value});let r=t(`deselectable`)&&!t(`multiple`)&&e.get(`value`).includes(n.value)?null:n.value;e.set(`value`,e=>r==null?[]:t(`multiple`)?s(e,r):[r])},clearItem({context:e,event:t}){e.set(`value`,e=>e.filter(e=>e!==t.value))},setSelectedItems({context:e,event:t}){e.set(`value`,t.value)},clearSelectedItems({context:e}){e.set(`value`,[])},selectPreviousItem({context:e,prop:t}){let[n]=e.get(`value`),r=t(`collection`).getPreviousValue(n);r&&e.set(`value`,[r])},selectNextItem({context:e,prop:t}){let[n]=e.get(`value`),r=t(`collection`).getNextValue(n);r&&e.set(`value`,[r])},selectFirstItem({context:e,prop:t}){let n=t(`collection`).firstValue;n&&e.set(`value`,[n])},selectLastItem({context:e,prop:t}){let n=t(`collection`).lastValue;n&&e.set(`value`,[n])},selectMatchingItem({context:e,prop:t,event:n,refs:r}){let i=t(`collection`).search(n.key,{state:r.get(`typeahead`),currentValue:e.get(`value`)[0]});i!=null&&e.set(`value`,[i])},scrollContentToTop({prop:e,scope:t}){if(e(`scrollToIndexFn`)){let n=e(`collection`).firstValue;e(`scrollToIndexFn`)?.({index:0,immediate:!0,getElement:()=>K(t,n)})}else W(t)?.scrollTo(0,0)},invokeOnOpen({prop:e,context:t}){e(`onOpenChange`)?.({open:!0,value:t.get(`value`)})},invokeOnClose({prop:e,context:t}){e(`onOpenChange`)?.({open:!1,value:t.get(`value`)})},syncSelectElement({context:e,prop:t,scope:n}){let r=U(n);if(r){if(e.get(`value`).length===0&&!t(`multiple`)){r.selectedIndex=-1;return}for(let t of r.options)t.selected=e.get(`value`).includes(t.value)}},syncCollection({context:e,prop:t}){let n=t(`collection`),r=n.find(e.get(`highlightedValue`));r&&e.set(`highlightedItem`,r);let i=L({values:e.get(`value`),collection:n,selectedItemMap:e.get(`selectedItemMap`)});e.set(`selectedItemMap`,i.nextSelectedItemMap)},syncSelectedItems({context:e,prop:t}){let n=L({values:e.get(`value`),collection:t(`collection`),selectedItemMap:e.get(`selectedItemMap`)});e.set(`selectedItemMap`,n.nextSelectedItemMap)},syncHighlightedItem({context:e,prop:t}){let n=t(`collection`),r=e.get(`highlightedValue`),i=r?n.find(r):null;e.set(`highlightedItem`,i)},dispatchChangeEvent({scope:e}){queueMicrotask(()=>{let t=U(e);if(!t)return;let n=new(e.getWin()).Event(`change`,{bubbles:!0,composed:!0});t.dispatchEvent(de(n))})}}}});function Ge(e){let t=e.restoreFocus??e.previousEvent?.restoreFocus;return t==null||!!t}var[Ke,Y]=a({name:`SelectContext`,hookName:`useSelectContext`,providerName:`<SelectProvider />`}),X=e(t(),1),Z=w(),qe=(0,X.forwardRef)((e,t)=>{let n=g(Y().getClearTriggerProps(),e);return(0,Z.jsx)(b.button,{...n,ref:t})});qe.displayName=`SelectClearTrigger`;var Je=(0,X.forwardRef)((e,t)=>{let n=Y(),r=Ce(),i=g(n.getContentProps(),r.getPresenceProps(),e);return r.unmounted?null:(0,Z.jsx)(b.div,{...i,ref:ee(r.ref,t)})});Je.displayName=`SelectContent`;var Ye=e=>e.children(Y()),Xe=(0,X.forwardRef)((e,t)=>{let n=g(Y().getControlProps(),e);return(0,Z.jsx)(b.div,{...n,ref:t})});Xe.displayName=`SelectControl`;var Ze=(0,X.forwardRef)((e,t)=>{let n=Y(),r=g(n.getHiddenSelectProps(),e),i=n.value.length===0,a=Te();return(0,Z.jsxs)(b.select,{"aria-describedby":a?.ariaDescribedby,...r,ref:t,children:[i&&(0,Z.jsx)(`option`,{value:``}),n.collection.items.map((e,t)=>(0,Z.jsx)(`option`,{value:n.collection.getItemValue(e)??``,disabled:n.collection.getItemDisabled(e),children:n.collection.stringifyItem(e)},t))]})});Ze.displayName=`SelectHiddenSelect`;var Qe=(0,X.forwardRef)((e,t)=>{let n=g(Y().getIndicatorProps(),e);return(0,Z.jsx)(b.div,{...n,ref:t})});Qe.displayName=`SelectIndicator`;var[$e,et]=a({name:`SelectItemContext`,hookName:`useSelectItemContext`,providerName:`<SelectItemProvider />`}),[tt,nt]=a({name:`SelectItemPropsContext`,hookName:`useSelectItemPropsContext`,providerName:`<SelectItemPropsProvider />`}),rt=A(),it=(0,X.forwardRef)((e,t)=>{let[n,r]=rt(e,[`item`,`persistFocus`]),i=Y(),a=g(i.getItemProps(n),r);return(0,Z.jsx)(tt,{value:n,children:(0,Z.jsx)($e,{value:i.getItemState(n),children:(0,Z.jsx)(b.div,{...a,ref:t})})})});it.displayName=`SelectItem`;var at=e=>e.children(et()),[ot,st]=a({name:`SelectItemGroupPropsContext`,hookName:`useSelectItemGroupPropsContext`,providerName:`<SelectItemGroupPropsProvider />`}),ct=A(),lt=(0,X.forwardRef)((e,t)=>{let n=(0,X.useId)(),[r,i]=ct(e,[`id`]),a={id:n,...r},o=g(Y().getItemGroupProps(a),i);return(0,Z.jsx)(ot,{value:a,children:(0,Z.jsx)(b.div,{...o,ref:t})})});lt.displayName=`SelectItemGroup`;var ut=(0,X.forwardRef)((e,t)=>{let n=Y(),r=st(),i=g(n.getItemGroupLabelProps({htmlFor:r.id}),e);return(0,Z.jsx)(b.div,{...i,ref:t})});ut.displayName=`SelectItemGroupLabel`;var dt=(0,X.forwardRef)((e,t)=>{let n=Y(),r=nt(),i=g(n.getItemIndicatorProps(r),e);return(0,Z.jsx)(b.div,{...i,ref:t})});dt.displayName=`SelectItemIndicator`;var ft=(0,X.forwardRef)((e,t)=>{let n=Y(),r=nt(),i=g(n.getItemTextProps(r),e);return(0,Z.jsx)(b.span,{...i,ref:t})});ft.displayName=`SelectItemText`;var pt=(0,X.forwardRef)((e,t)=>{let n=g(Y().getLabelProps(),e);return(0,Z.jsx)(b.label,{...n,ref:t})});pt.displayName=`SelectLabel`;var mt=(0,X.forwardRef)((e,t)=>{let n=g(Y().getListProps(),e);return(0,Z.jsx)(b.div,{...n,ref:t})});mt.displayName=`SelectList`;var ht=(0,X.forwardRef)((e,t)=>{let n=g(Y().getPositionerProps(),e);return Ce().unmounted?null:(0,Z.jsx)(b.div,{...n,ref:t})});ht.displayName=`SelectPositioner`;var gt=e=>{let t=(0,X.useId)(),{dir:r}=u(),{getRootNode:i}=n(),a=Te();return Ve(S(We,{id:t,ids:{label:a?.ids.label,hiddenSelect:a?.ids.control},disabled:a?.disabled,readOnly:a?.readOnly,invalid:a?.invalid,required:a?.required,dir:r,getRootNode:i,...e}),m)},_t=(0,X.forwardRef)((e,t)=>{let[n,r]=we(e),[i,a]=A()(r,`closeOnSelect.collection.composite.defaultHighlightedValue.defaultOpen.defaultValue.deselectable.disabled.form.highlightedValue.id.ids.invalid.loopFocus.multiple.name.onFocusOutside.onHighlightChange.onInteractOutside.onOpenChange.onPointerDownOutside.onSelect.onValueChange.open.positioning.readOnly.required.scrollToIndexFn.translations.autoComplete.value`.split(`.`)),o=gt(i),s=xe(g({present:o.open},n)),c=g(o.getRootProps(),a);return(0,Z.jsx)(Ke,{value:o,children:(0,Z.jsx)(Se,{value:s,children:(0,Z.jsx)(b.div,{...c,ref:t})})})}),vt=(0,X.forwardRef)((e,t)=>{let[n,r]=we(e),[{value:i},a]=A()(r,[`value`]),o=xe(g({present:i.open},n)),s=g(i.getRootProps(),a);return(0,Z.jsx)(Ke,{value:i,children:(0,Z.jsx)(Se,{value:o,children:(0,Z.jsx)(b.div,{...s,ref:t})})})}),yt=(0,X.forwardRef)((e,t)=>{let n=g(Y().getTriggerProps(),e);return(0,Z.jsx)(b.button,{...n,ref:t})});yt.displayName=`SelectTrigger`;var bt=(0,X.forwardRef)((e,t)=>{let{children:n,placeholder:r,...i}=e,a=Y(),o=g(a.getValueTextProps(),i);return(0,Z.jsx)(b.span,{...o,ref:t,children:n||a.valueAsString||r})});bt.displayName=`SelectValueText`;var Q=i({ClearTrigger:()=>qe,Content:()=>Je,Context:()=>Ye,Control:()=>Xe,HiddenSelect:()=>Ze,Indicator:()=>Qe,Item:()=>it,ItemContext:()=>at,ItemGroup:()=>lt,ItemGroupLabel:()=>ut,ItemIndicator:()=>dt,ItemText:()=>ft,Label:()=>pt,List:()=>mt,Positioner:()=>ht,Root:()=>_t,RootProvider:()=>vt,Trigger:()=>yt,ValueText:()=>bt}),{withProvider:xt,withContext:$,useStyles:St,PropsProvider:Ct}=p({key:`select`});xt(Q.RootProvider,`root`,{forwardAsChild:!0});var wt=xt(Q.Root,`root`,{forwardAsChild:!0,defaultProps:{positioning:{sameWidth:!0}}}),Tt=$(Q.Trigger,`trigger`,{forwardAsChild:!0}),Et=$(Q.Positioner,`positioner`,{forwardAsChild:!0}),Dt=$(Q.Content,`content`,{forwardAsChild:!0});$(Q.List,`list`,{forwardAsChild:!0});var Ot=$(Q.ValueText,`valueText`,{forwardAsChild:!0}),kt=$(Q.ClearTrigger,`clearTrigger`,{forwardAsChild:!0,defaultProps:{children:(0,Z.jsx)(v,{boxSize:`1em`})}}),At=$(Q.ItemGroup,`itemGroup`,{forwardAsChild:!0}),jt=$(Q.ItemGroupLabel,`itemGroupLabel`,{forwardAsChild:!0}),Mt=$(Q.Item,`item`,{forwardAsChild:!0}),Nt=$(Q.ItemText,`itemText`,{forwardAsChild:!0}),Pt=$(Q.ItemIndicator,`itemIndicator`,{forwardAsChild:!0,defaultProps:{children:(0,Z.jsx)(ae,{})}}),Ft=$(`div`,`indicatorGroup`),It=$(Q.Indicator,`indicator`,{forwardAsChild:!0,defaultProps:{children:(0,Z.jsx)(h,{})}}),Lt=$(Q.Control,`control`,{forwardAsChild:!0}),Rt=$(Q.Label,`label`,{forwardAsChild:!0}),zt=Q.Context,Bt=Q.HiddenSelect;Q.ItemContext;var Vt=e=>new P(e),Ht=`240ms cubic-bezier(0.32, 0.72, 0, 1)`,Ut={type:`spring`,stiffness:330,damping:34,mass:.82},Wt=.74;function Gt(e){return e<=0?432:Math.min(432,Math.max(340,e*Wt),Math.max(0,e-24))}var Kt=`min(432px, max(340px, ${Wt*100}vw), calc(100vw - 24px))`;function qt({floating:e,dockShellClaimed:t,panelHeightPx:n}){return e?{right:`calc(${Kt} + 14px)`,top:null,bottom:`12px`,height:n===null?`min(560px, calc(80dvh - 12px))`:`${Math.round(n)}px`,maxHeight:`calc(100dvh - 24px)`,borderTopLeftRadius:`20px`,borderBottomLeftRadius:`20px`}:{right:`382px`,top:`${t?56:0}px`,bottom:`0px`,height:null,maxHeight:null,borderTopLeftRadius:t?`12px`:`0px`,borderBottomLeftRadius:`0px`}}function Jt({emptyAndSettled:e,expectedMessageCount:t}){return e?380:t<=1?480:560}var Yt=X.forwardRef(function(e,t){let{children:n,clearable:r,"aria-label":i,...a}=e;return(0,Z.jsxs)(Lt,{...a,children:[(0,Z.jsx)(Tt,{ref:t,"aria-label":i,children:n}),(0,Z.jsxs)(Ft,{children:[r&&(0,Z.jsx)(Xt,{}),(0,Z.jsx)(It,{})]})]})}),Xt=X.forwardRef(function(e,t){return(0,Z.jsx)(kt,{asChild:!0,...e,ref:t,children:(0,Z.jsx)(be,{size:`xs`,variant:`plain`,focusVisibleRing:`inside`,focusRingWidth:`2px`,pointerEvents:`auto`})})}),Zt=X.forwardRef(function(e,t){let{portalled:n=!0,portalRef:r,...i}=e,{zIndex:a,depth:o}=le();return(0,Z.jsx)(y,{disabled:!n,container:r,children:(0,Z.jsx)(Et,{ref:e=>{e&&e.style.setProperty(`z-index`,a,`important`)},children:(0,Z.jsx)(se.Provider,{value:o,children:(0,Z.jsx)(Dt,{...i,ref:t})})})})}),Qt=X.forwardRef(function(e,t){let{item:n,children:r,...i}=e;return(0,Z.jsxs)(Mt,{item:n,...i,ref:t,children:[r,(0,Z.jsx)(Pt,{})]},n.value)}),$t=X.forwardRef(function(e,t){let{children:n,placeholder:r,...i}=e;return(0,Z.jsx)(Ot,{...i,ref:t,children:(0,Z.jsx)(zt,{children:e=>{let t=e.selectedItems;return t.length===0?r:n?n(t):t.length===1?e.collection.stringifyItem(t[0]):`${t.length} selected`}})})}),en=X.forwardRef(function(e,t){return(0,Z.jsx)(wt,{...e,ref:t,positioning:{sameWidth:!0,...e.positioning},children:e.asChild?e.children:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Bt,{}),e.children]})})}),tn={Root:en,Trigger:Yt,Content:Zt,Item:Qt,ValueText:$t,ItemGroup:X.forwardRef(function(e,t){let{children:n,label:r,...i}=e;return(0,Z.jsxs)(At,{...i,ref:t,children:[(0,Z.jsx)(jt,{children:r}),n]})}),Label:Rt,ItemText:Nt,Indicator:It,HiddenSelect:Bt,Control:Lt,IndicatorGroup:Ft,ItemIndicator:Pt};export{P as C,ke as S,wt as _,Yt as a,je as b,Ht as c,Gt as d,qt as f,Et as g,Mt as h,en as i,Ut as l,Dt as m,Zt as n,$t as o,Vt as p,Qt as r,Kt as s,tn as t,Jt as u,Tt as v,L as x,Ot as y};
2
- //# sourceMappingURL=select-D17PWjH9.js.map