@odigos/ui-kit 0.0.283 → 0.0.285

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 (52) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/lib/chunks/{helpers-BfXS2wve.js → helpers-C5bkjRbO.js} +1 -1
  3. package/lib/chunks/index-DBZ1mLhG.js +298 -0
  4. package/lib/chunks/source-instrument-form-context-CnRKQq6W.js +5 -0
  5. package/lib/chunks/ui-components-Ci-Vq1Dl.js +1620 -0
  6. package/lib/components.js +1 -1
  7. package/lib/constants/index.d.ts +1 -0
  8. package/lib/constants/recommendations/index.d.ts +31 -0
  9. package/lib/constants/strings/index.d.ts +3 -0
  10. package/lib/constants.js +1 -1
  11. package/lib/containers/_drawers/index.d.ts +1 -0
  12. package/lib/containers/_drawers/recommendations-drawer/helpers.d.ts +22 -0
  13. package/lib/containers/_drawers/recommendations-drawer/index.d.ts +9 -0
  14. package/lib/containers/_drawers/recommendations-drawer/manual-examples.d.ts +6 -0
  15. package/lib/containers/_drawers/recommendations-drawer/recommendation-card.d.ts +13 -0
  16. package/lib/containers/_drawers/recommendations-drawer/remediation-actions.d.ts +9 -0
  17. package/lib/containers/_drawers/recommendations-drawer/remediation-methods.d.ts +13 -0
  18. package/lib/containers/_modals/sampling-onboarding-modal/common/chrome.d.ts +10 -6
  19. package/lib/containers/_modals/sampling-onboarding-modal/common/section.d.ts +3 -3
  20. package/lib/containers/overview/search/builder.d.ts +3 -1
  21. package/lib/containers.js +295 -227
  22. package/lib/contexts/odigos-api/capabilities.d.ts +3 -0
  23. package/lib/contexts/odigos-api/hooks/use-actions-api.d.ts +3 -1
  24. package/lib/contexts/odigos-api/hooks/use-recommendations-api.d.ts +32 -0
  25. package/lib/contexts/odigos-api/index.d.ts +2 -1
  26. package/lib/contexts/odigos-api/types.d.ts +23 -1
  27. package/lib/contexts/odigos-api/use-odigos-api.d.ts +2 -0
  28. package/lib/contexts.js +1 -1
  29. package/lib/functions/index.d.ts +0 -1
  30. package/lib/functions.js +1 -1
  31. package/lib/hooks.js +1 -1
  32. package/lib/icons/common/index.d.ts +1 -0
  33. package/lib/icons/common/recommendations-icon/index.d.ts +2 -0
  34. package/lib/icons.js +1 -1
  35. package/lib/snippets/animated-collapse/index.d.ts +10 -0
  36. package/lib/snippets/index.d.ts +1 -0
  37. package/lib/snippets/rich-title/index.d.ts +4 -1
  38. package/lib/snippets/sampling-rule-form-sections/styled.d.ts +2 -2
  39. package/lib/snippets/yaml-section-card/index.d.ts +1 -0
  40. package/lib/snippets.js +1 -1
  41. package/lib/store.js +1 -1
  42. package/lib/theme.js +1 -1
  43. package/lib/types/common/index.d.ts +2 -1
  44. package/lib/types/destinations/index.d.ts +1 -0
  45. package/lib/types/index.d.ts +1 -0
  46. package/lib/types/recommendations.d.ts +73 -0
  47. package/lib/types.js +1 -1
  48. package/lib/visuals.js +1 -1
  49. package/package.json +18 -18
  50. package/lib/chunks/index--HGLHoM2.js +0 -257
  51. package/lib/chunks/source-instrument-form-context-CNsR2QcD.js +0 -5
  52. package/lib/chunks/ui-components-DLU_wMXv.js +0 -1601
@@ -0,0 +1,10 @@
1
+ import { type FC, type ReactNode } from 'react';
2
+ export interface AnimatedCollapseProps {
3
+ open: boolean;
4
+ children: ReactNode;
5
+ /** Delay only the opening fade so close/open can overlap smoothly. */
6
+ delayInMs?: number;
7
+ /** Cancels a parent flex gap while this section is collapsed. */
8
+ gapCancelPx?: number;
9
+ }
10
+ export declare const AnimatedCollapse: FC<AnimatedCollapseProps>;
@@ -1,4 +1,5 @@
1
1
  export * from './actions';
2
+ export * from './animated-collapse';
2
3
  export * from './cancel-modal';
3
4
  export * from './colored-span';
4
5
  export * from './connector-created-modal';
@@ -1,4 +1,4 @@
1
- import { ReactNode, type FC } from 'react';
1
+ import { ReactNode, type CSSProperties, type FC } from 'react';
2
2
  import type { SVG } from '../../types';
3
3
  import { type BadgeProps } from '../../components/badge';
4
4
  import { TypographyColor, TypographySize } from '../../components/typography';
@@ -9,6 +9,7 @@ export interface RichTitleProps {
9
9
  titleSize?: TypographySize;
10
10
  titleColor?: TypographyColor;
11
11
  titleWrap?: boolean;
12
+ titleMeta?: string;
12
13
  subTitle?: string;
13
14
  subTitleSize?: TypographySize;
14
15
  subTitleColor?: TypographyColor;
@@ -17,6 +18,8 @@ export interface RichTitleProps {
17
18
  withCopy?: boolean;
18
19
  badge?: BadgeProps;
19
20
  gap?: number;
21
+ textGap?: number;
22
+ alignItems?: CSSProperties['alignItems'];
20
23
  children?: ReactNode;
21
24
  }
22
25
  export declare const RichTitle: FC<RichTitleProps>;
@@ -1,2 +1,2 @@
1
- export declare const CellsRow: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
2
- export declare const Cell: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
1
+ export declare const CellsRow: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
2
+ export declare const Cell: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
@@ -7,5 +7,6 @@ export interface YamlSectionCardProps {
7
7
  fullHeight?: boolean;
8
8
  bgTint?: DataCardProps['bgTint'];
9
9
  codeBgColor?: CSSProperties['backgroundColor'];
10
+ compact?: boolean;
10
11
  }
11
12
  export declare const YamlSectionCard: FC<YamlSectionCardProps>;
package/lib/snippets.js CHANGED
@@ -1 +1 @@
1
- export{A as ActionType,a as Actions,R as RichTitle}from"./chunks/ui-components-DLU_wMXv.js";export{C as CancelModal,a as ConnectorCreatedModal,D as DURATION_OPTIONS,b as DeleteModal,c as DurationErrorsSection,d as DynamicActionFields,e as DynamicField,f as DynamicFields,E as EnableDisableSegment,I as InstrumentationPreviewSection,N as NOISY_PERCENTAGE_OPTIONS,O as OdigosLogoTextByTier,g as OperationSection,P as PERCENTAGE_OPTIONS,h as PercentageSection,i as PresetWithCustomInput,R as RuleInfoSection,j as RuleTypeSection,S as SamplingPreviewSection,k as SignalsCheckboxList,l as SourceScopeSection,U as UpgradeModal,W as WIDE_DRAWER_WIDTH,m as WideDrawer,Y as YamlSectionCard}from"./chunks/index--HGLHoM2.js";export{C as ColoredSpan,a as ColoredSpanVariant}from"./chunks/helpers-BfXS2wve.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";
1
+ export{A as ActionType,a as Actions,R as RichTitle}from"./chunks/ui-components-Ci-Vq1Dl.js";export{A as AnimatedCollapse,C as CancelModal,a as ConnectorCreatedModal,D as DURATION_OPTIONS,b as DeleteModal,c as DurationErrorsSection,d as DynamicActionFields,e as DynamicField,f as DynamicFields,E as EnableDisableSegment,I as InstrumentationPreviewSection,N as NOISY_PERCENTAGE_OPTIONS,O as OdigosLogoTextByTier,g as OperationSection,P as PERCENTAGE_OPTIONS,h as PercentageSection,i as PresetWithCustomInput,R as RuleInfoSection,j as RuleTypeSection,S as SamplingPreviewSection,k as SignalsCheckboxList,l as SourceScopeSection,U as UpgradeModal,W as WIDE_DRAWER_WIDTH,m as WideDrawer,Y as YamlSectionCard}from"./chunks/index-DBZ1mLhG.js";export{C as ColoredSpan,a as ColoredSpanVariant}from"./chunks/helpers-C5bkjRbO.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";
package/lib/store.js CHANGED
@@ -1 +1 @@
1
- export{df as DrawerType,bf as ProgressKeys,eA as getDrawerTypeForAdd,cx as getDrawerTypeForEdit,ge as useDarkMode,bc as useDataStreamStore,cs as useDrawerStore,ev as useFilterStore,b7 as useNotificationStore,bd as useProgressStore,eB as useSelectedStore,be as useSetupStore}from"./chunks/ui-components-DLU_wMXv.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";
1
+ export{dI as DrawerType,bg as ProgressKeys,f0 as getDrawerTypeForAdd,cA as getDrawerTypeForEdit,gL as useDarkMode,bd as useDataStreamStore,cv as useDrawerStore,eX as useFilterStore,b8 as useNotificationStore,be as useProgressStore,f1 as useSelectedStore,bf as useSetupStore}from"./chunks/ui-components-Ci-Vq1Dl.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";
package/lib/theme.js CHANGED
@@ -1 +1 @@
1
- export{go as Provider,gp as animations,gq as opacity,gr as palettes}from"./chunks/ui-components-DLU_wMXv.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";
1
+ export{gV as Provider,gW as animations,gX as opacity,gY as palettes}from"./chunks/ui-components-Ci-Vq1Dl.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";
@@ -125,7 +125,8 @@ export declare enum EntityTypes {
125
125
  Destination = "Destination",
126
126
  Action = "Action",
127
127
  InstrumentationRule = "InstrumentationRule",
128
- SamplingRule = "SamplingRule"
128
+ SamplingRule = "SamplingRule",
129
+ Recommendation = "Recommendation"
129
130
  }
130
131
  export declare enum OtherEntityTypes {
131
132
  DataStream = "DataStream"
@@ -43,6 +43,7 @@ export declare enum DestinationTypes {
43
43
  NewRelic = "newrelic",
44
44
  Observe = "observe",
45
45
  Odigos = "odigos",
46
+ OdigosProfileDiagnostic = "odigos_profile_diagnostic",
46
47
  OneUptime = "oneuptime",
47
48
  OpenObserve = "openobserve",
48
49
  Opsverse = "opsverse",
@@ -19,4 +19,5 @@ export * from './sources';
19
19
  export * from './tokens';
20
20
  export * from './traces';
21
21
  export * from './sampling';
22
+ export * from './recommendations';
22
23
  export * from './workload';
@@ -0,0 +1,73 @@
1
+ /** Matches GraphQL `RecommendationType`. */
2
+ export declare enum RecommendationType {
3
+ InferDBAttributes = "InferDBAttributes",
4
+ AutoGoOffsetUpdater = "AutoGoOffsetUpdater",
5
+ EnableOwnMetrics = "EnableOwnMetrics",
6
+ SampleHealthProbes = "SampleHealthProbes",
7
+ UrlTemplatization = "UrlTemplatization"
8
+ }
9
+ /**
10
+ * Derived UI grouping for a recommendation. Computed from `applied`,
11
+ * `conditionsMet`, and `dismissed` — never stored on the wire.
12
+ */
13
+ export declare enum RecommendationState {
14
+ Recommended = "recommended",
15
+ Applied = "applied",
16
+ Dismissed = "dismissed",
17
+ NotApplicable = "notApplicable"
18
+ }
19
+ export declare enum RecommendationApplyExampleType {
20
+ HelmValues = "HelmValues",
21
+ OdigosAction = "OdigosAction"
22
+ }
23
+ export declare enum RecommendationRemediationType {
24
+ DirectAutoOffsets = "DirectAutoOffsets",
25
+ DropAllHealthProbes = "DropAllHealthProbes",
26
+ EnableInferDbAttributes = "EnableInferDbAttributes",
27
+ EnableOwnMetricsStore = "EnableOwnMetricsStore",
28
+ EnableUrlTemplatization = "EnableUrlTemplatization",
29
+ ImageAutoOffsets = "ImageAutoOffsets",
30
+ SparseSampleHealthProbes = "SparseSampleHealthProbes"
31
+ }
32
+ /** Matches GraphQL `RecommendationCatalogCondition`. */
33
+ export interface RecommendationCatalogCondition {
34
+ type: string;
35
+ }
36
+ /** Matches GraphQL `RecommendationAppliedWhen`. */
37
+ export interface RecommendationAppliedWhen {
38
+ type: string;
39
+ expression?: string | null;
40
+ actionType?: string | null;
41
+ }
42
+ /** Matches GraphQL `RecommendationCatalogApplyExample`. */
43
+ export interface RecommendationCatalogApplyExample {
44
+ type: RecommendationApplyExampleType;
45
+ content: string;
46
+ }
47
+ /** Matches GraphQL `RecommendationCatalogRemediation`. */
48
+ export interface RecommendationCatalogRemediation {
49
+ type: RecommendationRemediationType;
50
+ buttonText: string;
51
+ tooltip: string;
52
+ applyExamples: RecommendationCatalogApplyExample[];
53
+ }
54
+ /** Matches GraphQL `Recommendation` — CR enriched with catalog metadata. */
55
+ export interface Recommendation {
56
+ name: string;
57
+ type: RecommendationType;
58
+ applied: boolean;
59
+ conditionsMet: boolean;
60
+ dismissed: boolean;
61
+ oss: boolean;
62
+ requireOdigosDeployment: boolean;
63
+ catalogConditions: RecommendationCatalogCondition[];
64
+ appliedWhen: RecommendationAppliedWhen[];
65
+ categories: string[];
66
+ title: string;
67
+ summary: string;
68
+ description: string;
69
+ docsUrl?: string | null;
70
+ pros: string[];
71
+ cons: string[];
72
+ remediations: RecommendationCatalogRemediation[];
73
+ }
package/lib/types.js CHANGED
@@ -1 +1 @@
1
- export{b_ as ActionCategoryTypes,bo as ActionKeyTypes,bp as ActionType,f7 as AgentInjectedReason,f8 as BooleanOperation,c6 as CloudConnectorFeatureKey,ag as CodeAttributesKeyTypes,f9 as ConditionType,ba as Crud,aa as CustomInstrumentationsKeyTypes,cI as DesiredConditionActionItemType,cm as DesiredStateProgress,fa as DestinationTypes,bb as EntityTypes,bF as ExtractionDataFormat,n as FieldTypes,ac as GolangCustomProbe,ae as HeadersCollectionKeyTypes,y as InputTypes,fb as InstallationMethod,fc as InstallationStatus,a9 as InstrumentationRuleType,fd as IntrumentationStatus,ab as JavaCustomProbe,fe as JsonOperation,bD as K8sAttributesFrom,bx as K8sResourceKind,ff as K8sWorkloadContainerAgentConfigTracesHeadSamplingSpanMetricsMode,fg as ListDirection,fh as NumberOperation,fi as OtelDistroName,fj as OtherEntityTypes,af as PayloadCollectionKeyTypes,ad as PhpCustomProbe,P as PlatformType,fk as PodContainerLifecycleStatus,fl as PodContainerStatus,fm as PodPhase,fn as Profile,M as ProgrammingLanguages,fo as SIGNAL_KEY_TO_TYPE,fp as SIGNAL_TYPE_TO_KEY,fq as SignalKey,bu as SignalType,fr as SortDirection,S as StatusType,fs as StringOperation,b as Tier,ft as WorkloadRolloutReason,eO as WorkloadRolloutStatus}from"./chunks/ui-components-DLU_wMXv.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";
1
+ export{c3 as ActionCategoryTypes,bt as ActionKeyTypes,bu as ActionType,fz as AgentInjectedReason,fA as BooleanOperation,ca as CloudConnectorFeatureKey,ag as CodeAttributesKeyTypes,fB as ConditionType,bb as Crud,aa as CustomInstrumentationsKeyTypes,cL as DesiredConditionActionItemType,cp as DesiredStateProgress,fC as DestinationTypes,bc as EntityTypes,bK as ExtractionDataFormat,n as FieldTypes,ac as GolangCustomProbe,ae as HeadersCollectionKeyTypes,y as InputTypes,fD as InstallationMethod,fE as InstallationStatus,a9 as InstrumentationRuleType,fF as IntrumentationStatus,ab as JavaCustomProbe,fG as JsonOperation,bI as K8sAttributesFrom,bC as K8sResourceKind,fH as K8sWorkloadContainerAgentConfigTracesHeadSamplingSpanMetricsMode,fI as ListDirection,fJ as NumberOperation,fK as OtelDistroName,fL as OtherEntityTypes,af as PayloadCollectionKeyTypes,ad as PhpCustomProbe,P as PlatformType,fM as PodContainerLifecycleStatus,fN as PodContainerStatus,fO as PodPhase,fP as Profile,M as ProgrammingLanguages,cX as RecommendationApplyExampleType,cY as RecommendationRemediationType,cW as RecommendationState,fQ as RecommendationType,fR as SIGNAL_KEY_TO_TYPE,fS as SIGNAL_TYPE_TO_KEY,fT as SignalKey,bz as SignalType,fU as SortDirection,S as StatusType,fV as StringOperation,b as Tier,fW as WorkloadRolloutReason,fe as WorkloadRolloutStatus}from"./chunks/ui-components-Ci-Vq1Dl.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";
package/lib/visuals.js CHANGED
@@ -1 +1 @@
1
- export{fu as VISUAL_ODIGOS_LOGO_HEIGHT,fv as VISUAL_ODIGOS_LOGO_WIDTH,V as VisualGreenRings,fw as VisualOdigosLogo,dq as VisualPurpleRings}from"./chunks/ui-components-DLU_wMXv.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";
1
+ export{fX as VISUAL_ODIGOS_LOGO_HEIGHT,fY as VISUAL_ODIGOS_LOGO_WIDTH,V as VisualGreenRings,fZ as VisualOdigosLogo,dS as VisualPurpleRings}from"./chunks/ui-components-Ci-Vq1Dl.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odigos/ui-kit",
3
- "version": "0.0.283",
3
+ "version": "0.0.285",
4
4
  "author": "Odigos",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -88,10 +88,10 @@
88
88
  }
89
89
  },
90
90
  "peerDependencies": {
91
- "@apollo/client": "^4.2.6",
92
- "react": "19.2.7",
93
- "react-dom": "19.2.7",
94
- "styled-components": "6.3.12"
91
+ "@apollo/client": "^4.2.9",
92
+ "react": "19.2.8",
93
+ "react-dom": "19.2.8",
94
+ "styled-components": "6.4.4"
95
95
  },
96
96
  "dependencies": {
97
97
  "@xyflow/react": "^12.11.2",
@@ -99,15 +99,15 @@
99
99
  "javascript-time-ago": "^2.6.4",
100
100
  "lottie-react": "^2.4.1",
101
101
  "prism-react-renderer": "^2.4.1",
102
- "react": "19.2.7",
103
- "react-dom": "19.2.7",
102
+ "react": "19.2.8",
103
+ "react-dom": "19.2.8",
104
104
  "react-error-boundary": "^6.1.2",
105
- "styled-components": "6.3.12",
105
+ "styled-components": "6.4.4",
106
106
  "virtua": "^0.50.0",
107
107
  "zustand": "^5.0.14"
108
108
  },
109
109
  "devDependencies": {
110
- "@apollo/client": "^4.2.8",
110
+ "@apollo/client": "^4.2.9",
111
111
  "@babel/core": "^7.29.7",
112
112
  "@babel/preset-env": "^7.29.7",
113
113
  "@babel/preset-react": "^7.29.7",
@@ -119,25 +119,25 @@
119
119
  "@rollup/plugin-terser": "^1.0.0",
120
120
  "@rollup/plugin-typescript": "^12.3.0",
121
121
  "@storybook/addon-webpack5-compiler-babel": "^4.0.1",
122
- "@storybook/react-webpack5": "10.5.4",
123
- "@types/node": "^26.1.1",
124
- "@types/react": "^19.2.17",
125
- "@types/react-dom": "^19.2.3",
126
- "@typescript-eslint/eslint-plugin": "^8.65.0",
127
- "@typescript-eslint/parser": "^8.65.0",
122
+ "@storybook/react-webpack5": "10.5.6",
123
+ "@types/node": "^26.1.2",
124
+ "@types/react": "^19.2.18",
125
+ "@types/react-dom": "^19.2.4",
126
+ "@typescript-eslint/eslint-plugin": "^8.66.0",
127
+ "@typescript-eslint/parser": "^8.66.0",
128
128
  "babel-loader": "^10.1.1",
129
129
  "babel-plugin-styled-components": "^2.3.0",
130
130
  "eslint": "^9.39.4",
131
131
  "eslint-plugin-react": "^7.37.5",
132
- "eslint-plugin-storybook": "10.5.4",
132
+ "eslint-plugin-storybook": "10.5.6",
133
133
  "graphql": "^17.0.2",
134
134
  "postcss": "^8.5.25",
135
- "rollup": "^4.62.2",
135
+ "rollup": "^4.62.4",
136
136
  "rollup-plugin-filesize": "^10.0.0",
137
137
  "rollup-plugin-postcss": "^4.0.2",
138
138
  "rollup-plugin-visualizer": "^7.0.1",
139
139
  "rxjs": "^7.8.2",
140
- "storybook": "10.5.4",
140
+ "storybook": "10.5.6",
141
141
  "typescript": "^5.9.3"
142
142
  },
143
143
  "resolutions": {
@@ -1,257 +0,0 @@
1
- import{jsx as e,jsxs as a,Fragment as t}from"react/jsx-runtime";import{D as l,c as r,F as n,d as i,e as o,f as s,g as c,h as d,B as u,i as p,j as h,k as g,W as m,l as v,m as b,V as f,n as y,o as x,p as C,q as k,r as S,C as T,s as $,u as w,I as M,v as A,w as O,x as L,y as P,z as E,N as I,E as R,S as N,G as V,H as D,U as z,J as X,K as H,L as _,M as B,O as q,Q as j,X as K,Y as U,Z as G,_ as F,$ as W,a0 as J,a1 as Y,a2 as Z,a3 as Q,a4 as ee,T as ae,a5 as te,a6 as le,a7 as re,a8 as ne,a9 as ie,aa as oe,ab as se,ac as ce,ad as de,ae as ue,af as pe,ag as he,ah as ge,b as me,ai as ve,aj as be,ak as fe,al as ye,am as xe,an as Ce,ao as ke,ap as Se,aq as Te,ar as $e,as as we,at as Me,au as Ae,av as Oe,aw as Le,ax as Pe,ay as Ee,az as Ie,aA as Re,aB as Ne,aC as Ve,aD as De,aE as ze,aF as Xe,aG as He,aH as _e,aI as Be,aJ as qe,aK as je,aL as Ke,aM as Ue,aN as Ge,aO as Fe,aP as We,aQ as Je,aR as Ye,aS as Ze,aT as Qe,aU as ea,aV as aa,aW as ta,aX as la,aY as ra,aZ as na,a_ as ia,a$ as oa,b0 as sa,b1 as ca,b2 as da,R as ua,b3 as pa,b4 as ha,A as ga,b5 as ma,b6 as va}from"./ui-components-DLU_wMXv.js";import{VIcon as ba,TrashIcon as fa,PlusIcon as ya,VSquareIcon as xa,XSquareIcon as Ca,EditIcon as ka,OdigosLogoTextCentral as Sa,OdigosLogoTextEnterprise as Ta,OdigosLogoTextCommunity as $a,OdigosLogoTextColoredCentral as wa,OdigosLogoTextColoredEnterprise as Ma,OdigosLogoTextColoredCommunity as Aa,ArrowLeftIcon as Oa,ArrowRightIcon as La,CopyIcon as Pa,YamlIcon as Ea}from"../icons.js";import Ia,{useMemo as Ra,useRef as Na,useCallback as Va,useState as Da,useEffect as za,Fragment as Xa,forwardRef as Ha,useImperativeHandle as _a}from"react";import Ba,{css as qa,useTheme as ja}from"styled-components";import{i as Ka,m as Ua,u as Ga,n as Fa,a as Wa,C as Ja,b as Ya,d as Za,e as Qa,f as et,g as at,h as tt,j as lt,k as rt}from"./helpers-BfXS2wve.js";const nt=/^[a-zA-Z]$/,it=new Set(["*","+","?"]),ot=new Set(["^","$"]),st={group:"rgba(102, 242, 102, 0.5)","anchor-quantifier":"rgba(102, 191, 255, 0.5)","class-bracket":"rgba(255, 153, 153, 0.5)","class-content":"rgba(178, 1, 1, 0.5)",alternation:"rgba(255, 153, 153, 0.5)",literal:"transparent"},ct=Ba.div`
2
- padding: 8px 16px;
3
- border-radius: 6px;
4
- border: 1px solid ${({theme:e})=>e.v2.colors.silver[500]};
5
- background: ${({theme:e})=>e.v2.colors.black[500]};
6
- font-family: ${({theme:e})=>e.font_family.code};
7
- font-size: 12px;
8
- line-height: 20px;
9
- color: ${({theme:e})=>e.v2.colors.white[500]};
10
- word-break: break-all;
11
- white-space: pre-wrap;
12
- user-select: text;
13
-
14
- /* Wraps the background tightly to each visual fragment when a colored
15
- token gets split across two visual lines. Without this the highlight
16
- stretches all the way to the right edge of the container. */
17
- & > span {
18
- box-decoration-break: clone;
19
- -webkit-box-decoration-break: clone;
20
- }
21
- `,dt=Ba.span`
22
- background: ${({$kind:e})=>st[e]};
23
- `,ut=({pattern:a,"data-id":t})=>{const l=Ra(()=>(e=>{const a=[];let t=0,l=!1;const r=(e,t)=>{const l=a[a.length-1];l&&l.kind===t?l.text+=e:a.push({text:e,kind:t})};for(;t<e.length;){const a=e[t];if(l){if("]"===a){r("]","class-bracket"),l=!1,t++;continue}if("\\"===a&&t+1<e.length){r(e.slice(t,t+2),"class-content"),t+=2;continue}r(a,"class-content"),t++}else{if("("===a&&"?"===e[t+1]){let a=2;const l=e[t+2];if(":"===l||"="===l||"!"===l)a=3;else if("<"===l){const l=e[t+3];if("="===l||"!"===l)a=4;else{const l=e.indexOf(">",t+2);-1!==l&&(a=l-t+1)}}r(e.slice(t,t+a),"group"),t+=a;continue}if("("!==a&&")"!==a)if("["!==a)if(it.has(a)||ot.has(a))r(a,"anchor-quantifier"),t++;else{if("{"===a){const a=e.indexOf("}",t);if(a>t&&/^\{\d+,?\d*\}$/.test(e.slice(t,a+1))){r(e.slice(t,a+1),"anchor-quantifier"),t=a+1;continue}}if("\\"===a&&t+1<e.length){const a=e[t+1];nt.test(a)?r(e.slice(t,t+2),"anchor-quantifier"):r(e.slice(t,t+2),"literal"),t+=2;continue}"|"!==a?(r(a,"literal"),t++):(r("|","alternation"),t++)}else"^"===e[t+1]?(r("[^","class-bracket"),t+=2):(r("[","class-bracket"),t++),l=!0;else r(a,"group"),t++}}return a})(a),[a]);return e(ct,a?{"data-id":t,children:l.map((a,t)=>e(dt,{$kind:a.kind,children:a.text},t))}:{"data-id":t,children:" "})},pt="rgba(102, 191, 255, 0.5)",ht=qa`
24
- font-family: ${({theme:e})=>e.font_family.code};
25
- font-size: 12px;
26
- line-height: 20px;
27
- letter-spacing: 0;
28
- white-space: pre-wrap;
29
- word-wrap: break-word;
30
- overflow-wrap: break-word;
31
- /* tab-size keeps tabs visually consistent across the two layers — some
32
- browsers default to 8 on a textarea but 4 on a div. */
33
- -moz-tab-size: 4;
34
- tab-size: 4;
35
- margin: 0;
36
- `,gt=Ba.div`
37
- position: relative;
38
- width: 100%;
39
- min-height: ${({$minHeight:e})=>e}px;
40
- border-radius: 6px;
41
- border: 1px solid ${({theme:e})=>e.v2.colors.silver[500]};
42
- background: ${({theme:e})=>e.v2.colors.black[500]};
43
-
44
- &:hover,
45
- &:focus-within {
46
- border-color: ${({theme:e})=>e.v2.colors.silver[300]};
47
- }
48
- `,mt=Ba.div`
49
- ${ht}
50
- position: absolute;
51
- inset: 0;
52
- padding: 12px;
53
- pointer-events: none;
54
- color: transparent;
55
- overflow: hidden;
56
-
57
- /* Mandatory for backgrounds that wrap across visual lines. */
58
- & > span {
59
- box-decoration-break: clone;
60
- -webkit-box-decoration-break: clone;
61
- }
62
- `,vt=Ba.textarea`
63
- ${ht}
64
- position: relative;
65
- z-index: 1;
66
- display: block;
67
- width: 100%;
68
- min-height: ${({$minHeight:e})=>e}px;
69
- padding: 12px;
70
- border: 0;
71
- background: transparent;
72
- outline: none;
73
- resize: vertical;
74
- color: ${({theme:e})=>e.v2.colors.white[500]};
75
- caret-color: ${({theme:e})=>e.v2.colors.white[500]};
76
- box-sizing: border-box;
77
-
78
- &::placeholder {
79
- color: ${({theme:e})=>e.v2.colors.silver[600]};
80
- }
81
- `,bt=e=>({before:e,matchPre:"",capture:"",matchPost:"",after:""}),ft=({regex:t,value:l,onChange:r,minHeight:n=240,...i})=>{const o=Na(null),s=Na(null),c=Ra(()=>((e,a)=>{if(!e||!a)return bt(a);let t;try{t=new RegExp(e)}catch{return bt(a)}const l=t.exec(a);if(!l)return bt(a);const r=l.index,n=l.index+l[0].length;if(l.length<2||null==l[1])return{before:a.slice(0,r),matchPre:"",capture:a.slice(r,n),matchPost:"",after:a.slice(n)};const i=l[0].indexOf(l[1]),o=i>=0?r+i:r,s=o+l[1].length;return{before:a.slice(0,r),matchPre:a.slice(r,o),capture:a.slice(o,s),matchPost:a.slice(s,n),after:a.slice(n)}})(t,l),[t,l]),d=Va(()=>{o.current&&s.current&&(o.current.scrollTop=s.current.scrollTop,o.current.scrollLeft=s.current.scrollLeft)},[]);return a(gt,{$minHeight:n,children:[a(mt,{ref:o,"aria-hidden":!0,children:[c.before,e("span",{style:{background:pt},children:c.matchPre}),e("span",{style:{background:"rgba(102, 242, 102, 0.5)"},children:c.capture}),e("span",{style:{background:pt},children:c.matchPost}),c.after,l.endsWith("\n")?" ":""]}),e(vt,{ref:s,$minHeight:n,value:l,onChange:e=>r(e.target.value),onScroll:d,spellCheck:!1,...i})]})},yt=Ba.div`
82
- flex: 1;
83
- min-height: 0;
84
- overflow-y: auto;
85
- `,xt=Ba.div`
86
- background: ${({theme:e})=>e.v2.colors.silver[900]};
87
- border-radius: 8px;
88
- padding: 8px;
89
- display: flex;
90
- flex-direction: column;
91
- gap: 12px;
92
- `,Ct=Ba.div`
93
- padding: 8px 16px;
94
- border-radius: 8px;
95
- background: ${({theme:e})=>e.v2.colors.silver[800]};
96
- font-family: ${({theme:e})=>e.font_family.code};
97
- font-size: 12px;
98
- line-height: 20px;
99
- color: ${({theme:e,$tone:a})=>"error"===a?e.v2.colors.red[500]:"match"===a?e.v2.colors.white[500]:e.v2.colors.silver[200]};
100
- word-break: break-all;
101
- white-space: pre-wrap;
102
- user-select: text;
103
- `,kt=({isOpen:t,regex:m,onClose:v,initialTestString:b=""})=>{const[f,y]=Da(b),x=Ra(()=>((e,a)=>{if(!e)return{ok:!0,isMatch:!1,message:r.RESULT_EMPTY_REGEX};if(!a)return{ok:!0,isMatch:!1,message:r.RESULT_EMPTY_INPUT};let t;try{t=new RegExp(e)}catch(e){return{ok:!1,message:e instanceof Error?e.message:r.RESULT_INVALID_REGEX_FALLBACK}}const l=t.exec(a);return l?{ok:!0,isMatch:!0,message:l.length>1?l[1]:l[0]}:{ok:!0,isMatch:!1,message:r.RESULT_NO_MATCH}})(m,f),[m,f]),C=x.ok?x.isMatch?"match":"neutral":"error";return e(l,{isOpen:t,header:{title:r.TITLE,onClose:()=>{y(""),v()}},children:e(yt,{children:a(xt,{children:[a(n,{$gap:6,children:[e(i,{label:r.REGEX_LABEL}),e(ut,{pattern:m,"data-id":"regex-tester-regex"}),!m&&e(o,{size:c.XXS,color:s.Secondary,children:r.REGEX_EMPTY_HINT})]}),a(n,{$gap:6,children:[a(d,{$width:"100%",$justifyContent:"space-between",$alignItems:"center",children:[e(i,{label:r.TEST_STRING_LABEL}),e(u,{"data-id":"regex-tester-unescape",label:r.UNESCAPE_LABEL,tooltip:r.UNESCAPE_TOOLTIP,variant:h.Secondary,size:p.S,onClick:()=>y(e=>(e=>{let a="";for(let t=0;t<e.length;t++){if("\\"===e[t]&&t+1<e.length){const l=e[t+1],r="n"===l?"\n":"t"===l?"\t":"r"===l?"\r":'"'===l?'"':"'"===l?"'":"\\"===l?"\\":null;if(null!=r){a+=r,t++;continue}}a+=e[t]}return a})(e)),disabled:(k=f,!/\\["'\\nrt]/.test(k))})]}),e(ft,{name:"regex-tester-test-string","data-id":"regex-tester-test-string",placeholder:r.TEST_STRING_PLACEHOLDER,regex:m,value:f,onChange:y,minHeight:240}),e(g,{helpMessage:r.TEST_STRING_HELP})]}),a(n,{$gap:8,children:[e(i,{label:r.RESULT_LABEL}),e(Ct,{$tone:C,"data-id":"regex-tester-result",children:x.message}),x.ok&&x.isMatch&&e(o,{size:c.XXS,color:s.Secondary,children:r.RESULT_CAPTURE_HINT})]})]})})});var k},St=({isOpen:a,onClose:t,onDeny:l,onApprove:r})=>e(m,{title:"Discard changes?",description:"You have unsaved changes.\nIf you cancel now, your changes won't be saved.",isOpen:a,onClose:t,denyButton:{label:"Keep editing",variant:h.Secondary,onClick:()=>{l?.(),t()}},approveButton:{label:"Discard changes",variant:h.Primary,onClick:()=>{r?.(),t()}}}),Tt=({isOpen:a,onClose:t,onViewConnector:l})=>e(m,{isOpen:a,onClose:t,visual:()=>e(f,{scale:1.2,icon:ba}),title:b.CLOUD_CONNECTOR_CREATED_MODAL_TITLE,description:b.CLOUD_CONNECTOR_CREATED_MODAL_DESC,denyButton:{label:v.STAY_ON_CONNECTIONS,variant:h.Secondary,onClick:t},approveButton:{label:v.GO_TO_CONNECTOR_OVERVIEW,variant:h.Primary,onClick:l??t}}),$t=({isOpen:a,onClose:t,onDeny:l,onApprove:r,action:n="delete",target:i,description:o,overrideApproveButtonLabel:s,overrideDenyButtonLabel:c})=>{const d=n.charAt(0).toUpperCase()+n.substring(1),u=i?.endsWith("s")?"these":"this";return e(m,{title:`${d}${i?` ${i}`:""}?`,description:o??`Are you sure you want to ${n}${i?` ${u} ${i}`:""}?`,isOpen:a,onClose:t,denyButton:{label:c??"Go back",variant:h.Secondary,onClick:()=>{l?.(),t()}},approveButton:{label:s??d,variant:h.Primary,onClick:()=>{r?.(),t()}}})},wt=({componentType:a,inputType:t,name:l,label:r,tooltip:n,badge:i,placeholder:o,required:s,disabled:c,value:d,setValue:u,errorMessage:p,warnMessage:h,helpMessage:g,dropdownOptions:m,dropdownNoSearch:v,dropdownNoCheckbox:b,timeUnits:f,timeDefaultUnit:E,toggleSize:I=k.L,keyLabel:R,valueLabel:N})=>{switch(a){case y.Input:return e(L,{name:l,type:t,label:r,tooltip:n,badge:i,placeholder:o,required:s,disabled:c,value:d??"",onChange:e=>{const a=e.target.value;u(t===P.Number?""===a?null:Number(a):a)},errorMessage:p,warnMessage:h,helpMessage:g},l);case y.MultiInput:return e(O,{name:l,label:r,tooltip:n,badge:i,placeholder:o,required:s,disabled:c,values:Array.isArray(d)?d:A(d,[]),setValues:e=>u(e),errorMessage:p,warnMessage:h,helpMessage:g,plain:!0},l);case y.KeyValuePair:return e(M,{name:l,label:r,tooltip:n,badge:i,required:s,disabled:c,limitFieldsPerRow:2,columns:[{keyName:"key",label:R||"Key",placeholder:R||"Key"},{keyName:"value",label:N||"Value",placeholder:N||"Value"}],values:Array.isArray(d)?d:A(d,[]),setValues:e=>u(e),errorMessage:p,warnMessage:h,helpMessage:g},l);case y.TextArea:return e(w,{name:l,label:r,tooltip:n,badge:i,required:s,disabled:c,placeholder:o,value:d??"",onChange:e=>u(e.target.value),errorMessage:p,warnMessage:h,helpMessage:g},l);case y.Dropdown:return e($,{name:l,label:r,tooltip:n,badge:i,placeholder:o,required:s,disabled:c,withSearch:!v,options:m?.map(e=>({id:e.id||"",label:e.label||"",withCheckbox:!b}))||[],values:d?[String(d)]:[],setValues:e=>u(e[0]),errorMessage:p,warnMessage:h,helpMessage:g},l);case y.Checkbox:return e(T,{name:l,label:r,tooltip:n,badge:i,value:!0===d||"true"===d,onChange:e=>u(e),disabled:c,errorMessage:p,warnMessage:h,helpMessage:g},l);case y.Time:return e(S,{name:l,label:r,tooltip:n,badge:i,placeholder:o,required:s,disabled:c,value:d??"",setValue:e=>u(e),units:f,defaultUnit:E,errorMessage:p,warnMessage:h,helpMessage:g},l);case y.Toggle:return e(x,{name:l,size:I,labelAlign:C.Right,label:r,tooltip:n,badge:i,value:!0===d||"true"===d,onChange:e=>u(e),disabled:c,errorMessage:p,warnMessage:h,helpMessage:g},l);default:return null}},Mt=Ba.div`
104
- display: flex;
105
- flex-wrap: wrap;
106
- gap: 8px;
107
- `,At=Ba.div`
108
- display: flex;
109
- align-items: center;
110
- gap: 8px;
111
- padding: 8px 12px;
112
- border-radius: 8px;
113
- cursor: pointer;
114
- background: ${({theme:e,$selected:a})=>a?e.v2.colors.silver[700]:e.v2.colors.silver[800]};
115
- border: 1px solid ${({theme:e,$selected:a})=>a?e.v2.colors.silver[500]:e.v2.colors.silver[750]};
116
-
117
- &:hover {
118
- background: ${({theme:e})=>e.v2.colors.silver[700]};
119
- }
120
- `,Ot=Ba.div`
121
- display: flex;
122
- width: 32px;
123
- height: 32px;
124
- justify-content: center;
125
- align-items: center;
126
- flex-shrink: 0;
127
- `,Lt=Ba.div`
128
- display: flex;
129
- flex-direction: column;
130
- gap: 12px;
131
- `,Pt=Ba.div`
132
- display: flex;
133
- flex-wrap: wrap;
134
- gap: 6px;
135
- `,Et=Ba.div`
136
- display: flex;
137
- align-items: center;
138
- gap: 8px;
139
- &::before,
140
- &::after {
141
- content: '';
142
- flex: 1;
143
- height: 1px;
144
- background-color: ${({theme:e})=>e.v2.colors.silver[700]};
145
- }
146
- `,It=Ba.div`
147
- padding: 2px 10px;
148
- border-radius: 999px;
149
- background-color: ${({theme:e})=>e.v2.colors.silver[700]};
150
- border: 1px solid ${({theme:e})=>e.v2.colors.silver[600]};
151
- `,Rt={[B.JavaScript]:"Node.js",[B.DotNet]:".NET",[B.Php]:"PHP",[B.Java]:"Java",[B.Go]:"Go",[B.Python]:"Python",[B.Ruby]:"Ruby",[B.Rust]:"Rust"},Nt=[B.Python,B.Java,B.JavaScript,B.DotNet,B.Php,B.Ruby,B.Go],Vt=[{value:"all",label:"Entire Cluster"},{value:"source",label:"Specific Source"},{value:"namespace",label:"Specific Namespace"},{value:"language",label:"Specific Programming Language"}];function Dt(e){return Rt[e]||e.charAt(0).toUpperCase()+e.slice(1)}function zt(e){return null!=e?`${e}. ${Z}`:Z}const Xt=({readOnly:a,...t})=>e(a?Bt:jt,{...t}),Ht=({title:t,count:l,children:r})=>a(n,{$gap:6,children:[a(d,{$gap:8,$alignItems:"center",children:[e(o,{size:c.XS,color:s.Primary,nowrap:!0,children:t}),l>1&&e(o,{size:c.XXS,color:s.Secondary,nowrap:!0,children:`(${J})`})]}),e(Pt,{children:r})]}),_t=()=>{const a=ja();return e(Et,{children:e(It,{children:e(o,{size:c.XXS,color:a.v2.colors.white[500],nowrap:!0,children:Y})})})},Bt=({scopes:t,titleNumber:l})=>{const r=zt(l);if(Ka(t))return e(E,{bgTint:"900",richTitle:{title:r},withCollapse:!0,collapseIsDefaultOpen:!0,children:e(I,{status:N.Default,message:R,fullWidth:!0})});const n=t.sources??[],i=t.namespaces??[],o=t.languages??[],s=[];return n.length&&s.push({kind:"sources",node:e(Ht,{title:V,count:n.length,children:n.map((a,t)=>{const l=[a.namespace,a.kind,a.name].filter(Boolean),r=l.length?l.join(" / "):z;return e(D,{label:r},`src-${t}-${r}`)})})}),i.length&&s.push({kind:"namespaces",node:e(Ht,{title:X,count:i.length,children:i.map((a,t)=>e(D,{label:a},`ns-${t}-${a}`))})}),o.length&&s.push({kind:"languages",node:e(Ht,{title:H,count:o.length,children:o.map((a,t)=>{const l=q(a);return e(D,{label:Dt(a),leftIcon:l},`lang-${t}-${a}`)})})}),e(E,{bgTint:"900",richTitle:{title:r,subTitle:s.length>1?_:void 0},withCollapse:!0,collapseIsDefaultOpen:!0,children:e(E,{bgTint:"800",children:e(Lt,{children:s.map((t,l)=>a(Ia.Fragment,{children:[l>0&&e(_t,{}),t.node]},t.kind))})})})},qt=e=>e.sources.length>0?"source":e.namespaces.length>0?"namespace":e.languages.length>0?"language":"all",jt=({scopes:t,onChange:l,sourceOptions:r=[],namespaceOptions:i=[],supportedLanguages:d,titleNumber:u,dataIdPrefix:p="source-scope",slim:h,disabled:g})=>{const m=t??Ua(),[v,b]=Da(()=>qt(m)),{sources:f,namespaces:y,languages:x}=m,C=f.length>0||y.length>0||x.length>0;za(()=>{C&&"all"===v&&b(qt(m))},[C,v]);const k=Ra(()=>Vt.map(e=>"language"===e.value&&0===d?.length?null:{...e,disabled:"all"===e.value&&C}).filter(Boolean),[C]),S=Ra(()=>f.map(e=>`${e.namespace}/${e.kind}/${e.name}`),[f]),$=Ra(()=>[...y],[y]),w=Ra(()=>new Set(x),[x]),M=Va(e=>{b(e)},[]),A=Va(e=>{const a=e.map(e=>(e=>{const a=e.split("/");return 3!==a.length?null:{namespace:a[0],kind:a[1],name:a[2]}})(e)).filter(e=>null!=e).map(e=>({namespace:e.namespace,kind:e.kind,name:e.name}));l({...m,sources:a})},[m,l]),O=Va(e=>{l({...m,namespaces:e})},[m,l]),L=Va(e=>{const a=m.languages,t=a.includes(e)?a.filter(a=>a!==e):[...a,e];l({...m,languages:t})},[m,l]),P=!C&&"all"===v,E=(d||Nt).map(e=>({id:e,label:Rt[e]??e.charAt(0).toUpperCase()+e.slice(1),Icon:q(e)}));return a(j,{richTitle:h?{title:zt(u),titleSize:c.XS,titleColor:s.Secondary,tooltip:K}:{title:zt(u),subTitle:K,subTitleWrap:!0},backgroundColor:h?"transparent":void 0,padding:h?0:void 0,children:[e(I,P?{status:N.Default,message:R,fullWidth:!0,smallIcon:!0}:{status:N.Info,message:_,fullWidth:!0,smallIcon:!0}),e(n,{$alignItems:"flex-start",children:e(U,{options:k,selected:v,setSelected:M,disabled:g})}),"source"===v&&e(G,{multiple:!0,"data-id":`${p}-autocomplete-source`,options:r,value:S,onSelect:A,placeholder:F,disabled:g}),"namespace"===v&&e(G,{multiple:!0,"data-id":`${p}-autocomplete-namespace`,options:i,value:$,onSelect:O,placeholder:"Search namespace",disabled:g}),"language"===v&&E.length>0&&e(Mt,{children:E.map(({id:t,label:l,Icon:r})=>{const n=w.has(t);return a(At,{$selected:n,onClick:()=>L(t),children:[e(T,{name:`${p}-lang-${t}`,size:W.S,value:n,onChange:()=>L(t),disabled:g}),e(Ot,{children:e(r,{size:20})}),e(o,{size:c.XS,nowrap:!0,children:l})]},t)})})]})},Kt=e=>{if(null!=e){if(!Array.isArray(e)&&"object"==typeof e)return Object.entries(e).map(([e,a])=>({id:e,label:null==a?e:String(a)}));if(Array.isArray(e))return e.map(e=>"string"==typeof e?{id:e,label:e}:e)}},Ut=e=>{if(!Array.isArray(e)||e.length<3)return;const[a,t,l]=e;return e=>{const r=null==e?.[a]?"":String(e[a]);switch(t){case"=":case"==":case"===":return r===l;case"!=":case"!==":return r!==l;default:return!0}}},Gt=e=>{if(Array.isArray(e))return e.map(e=>{const a=e;return{keyName:String(a.keyName??a.name??""),label:a.label??a.displayName,tooltip:a.tooltip,placeholder:a.placeholder,helpMessage:a.helpMessage,componentType:a.componentType,options:Kt(a.options??a.values),fullRow:a.fullRow,defaultValue:a.defaultValue,withRegexTester:a.withRegexTester,separator:a.separator,copyByColumn:a.copyByColumn,renderCondition:Ut(a.renderCondition)}})},Ft=e=>{if(Array.isArray(e))return e.map(e=>{if("string"==typeof e)return{id:e,label:e};const a=e;return{id:String(a.id??a.keyName??a.name??""),label:a.label??a.displayName??String(a.id??""),tooltip:a.tooltip,fields:Array.isArray(a.fields)?a.fields.map(Wt):void 0}})},Wt=e=>{const a="string"==typeof e.componentProperties?A(e.componentProperties,{}):e.componentProps||{};return{name:e.name,componentType:e.componentType,inputType:e.inputType??a.inputType??a.type,title:e.displayName,tooltip:a.tooltip,placeholder:a.placeholder,helpMessage:a.helpMessage,required:a.required,initialValue:e.initialValue,renderCondition:e.renderCondition,options:Kt(a.options??a.values),itemWrapperKey:a.itemWrapperKey,columns:Gt(a.columns),limitFieldsPerRow:a.limitFieldsPerRow,variant:a.variant,wrapKey:a.wrapKey,checkboxOptions:Ft(a.options??a.values),checkedValue:a.checkedValue??"true",valueMode:a.valueMode??"object",fields:Array.isArray(a.fields)?a.fields.map(Wt):void 0,addLabel:a.addLabel,itemLabel:a.itemLabel,keyLabel:a.titleKey??a.keyLabel,valueLabel:a.titleValue??a.valueLabel,persistAs:a.persistAs}},Jt=e=>{const a=e.initialValue;if(void 0!==a&&""!==a)return e.componentType===y.CheckboxList?"array"===e.valueMode?A(a,[]):A(a,{}):e.componentType!==y.MultiInput&&e.componentType!==y.MultiTabledInput||!e.wrapKey?e.componentType===y.MultiInput||e.componentType===y.MultiTabledInput?A(a,[]):e.componentType===y.SourceScopes?"null"===a||"{}"===a?Ua():Fa(A(a,null)):e.componentType===y.Toggle||e.componentType===y.Checkbox?"true"===a:a:{[e.wrapKey]:A(a,[])}},Yt=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),Zt=e=>Array.isArray(e)?e:[],Qt=e=>{const a={};return e.forEach(e=>{a[String(e.key??"")]=String(e.value??"")}),a},el=e=>Yt(e)?Object.entries(e).map(([e,a])=>({key:e,value:String(a??"")})):[],al=({field:a,value:t,setValue:l,errorMessage:r,disabled:n})=>{const[i,o]=Da(()=>el(t));return za(()=>{const e=Yt(t)?t:{};((e,a)=>{const t=Object.keys(e),l=Object.keys(a);return t.length===l.length&&t.every(t=>Object.prototype.hasOwnProperty.call(a,t)&&a[t]===e[t])})(Qt(i),e)||o(el(t))},[t]),e(M,{name:a.name,label:a.title,tooltip:a.tooltip,helpMessage:a.helpMessage,required:a.required,disabled:n,limitFieldsPerRow:2,columns:[{keyName:"key",label:a.keyLabel||"Key",placeholder:a.keyLabel||"Key"},{keyName:"value",label:a.valueLabel||"Value",placeholder:a.valueLabel||"Value"}],values:i,setValues:e=>{o(e),l(Qt(e))},errorMessage:r})},tl=({field:l,value:r,setValue:d,errorMessage:u,disabled:p,keyValuePersistAs:h,sourceOptions:m,namespaceOptions:v})=>{const{name:b,componentType:f,inputType:x,title:C,tooltip:k,placeholder:S,helpMessage:$,required:w,initialValue:A,options:L,itemWrapperKey:P,columns:E,limitFieldsPerRow:I,variant:R,wrapKey:N,checkboxOptions:V}=l,[D,z]=Da({open:!1,value:""});if(f===y.SourceScopes)return e(Xt,{scopes:Fa(r),onChange:e=>d(e),sourceOptions:m,namespaceOptions:v,dataIdPrefix:`dynamic-field-${b}`,slim:!0});if(f===y.CheckboxList&&"array"===l.valueMode){const t=Zt(r),l=(e,a)=>d(a?[...t.filter(a=>a!==e),e]:t.filter(a=>a!==e));return a(n,{$gap:12,children:[C&&e(i,{label:C,tooltip:k,required:w}),e(n,{$gap:8,children:(V||[]).map(a=>{const r=e(T,{name:a.id,label:a.label,value:t.includes(a.id),disabled:p,onChange:e=>l(a.id,e)},a.id);return a.tooltip?e(ae,{text:a.tooltip,withIcon:!0,children:r},a.id):r})}),e(g,{errorMessage:u,helpMessage:$})]})}if(f===y.CheckboxList){const t=Yt(r)?r:{},i=(e=>"emptyObject"!==e.checkedValue||{})(l),m=e=>"emptyObject"===l.checkedValue?Yt(e):!!e;return a(n,{$gap:12,children:[C&&e(o,{size:c.XS,color:s.Secondary,nowrap:!0,children:C}),e(n,{$gap:12,children:(V||[]).map(l=>{const r=t[l.id],o=m(r),s=Yt(r)?r:{},c=e(T,{label:l.label,value:o,disabled:p,onChange:e=>d({...t,[l.id]:e?Yt(r)?r:i:null})}),u=l.tooltip?e(ae,{text:l.tooltip,withIcon:!0,children:c}):c,g=o&&l.fields?.length?e(n,{$gap:12,$padding:"0 0 0 24px",children:l.fields.map(a=>e(tl,{field:a,value:s[a.name],setValue:e=>d({...t,[l.id]:{...s,[a.name]:e}}),disabled:p,keyValuePersistAs:h},`${b}-${l.id}-${a.name}`))}):null;return a(n,{$gap:12,children:[u,g]},l.id)})}),e(g,{errorMessage:u,helpMessage:$})]})}if(f===y.MultiTabledInput){const l=Zt(N?r?.[N]:r),n=e=>d(N?{...Yt(r)?r:{},[N]:e}:e),i=(E||[]).some(e=>e.withRegexTester);return a(t,{children:[e("cards"===R?te:M,{name:b,label:C,tooltip:k,helpMessage:$,required:w,disabled:p,columns:E||[],limitFieldsPerRow:I,values:l,setValues:n,errorMessage:u,onTestRegex:i?e=>z({open:!0,value:e}):void 0}),i&&e(kt,{isOpen:D.open,regex:D.value,onClose:()=>z({open:!1,value:""})})]})}if(f===y.MultiInput&&N){const a=Zt(r?.[N]);return e(O,{name:b,label:C,tooltip:k,helpMessage:$,required:w,disabled:p,placeholder:S,values:a,setValues:e=>d({...Yt(r)?r:{},[N]:e}),errorMessage:u})}if(f===y.MultiInput&&P){const a=Zt(r).map(e=>String(e?.[P]??""));return e(O,{name:b,label:C,tooltip:k,helpMessage:$,required:w,disabled:p,placeholder:S,values:a,setValues:e=>d(e.map(e=>({[P]:e}))),errorMessage:u})}return f===y.KeyValuePair?"map"===(l.persistAs??h)?e(al,{field:l,value:r,setValue:d,errorMessage:u,disabled:p}):e(wt,{componentType:f,name:b,label:C,tooltip:k,helpMessage:$,disabled:p,required:w,errorMessage:u,keyLabel:l.keyLabel,valueLabel:l.valueLabel,value:r??[],setValue:d}):e(wt,{componentType:f,inputType:x,name:b,label:C,tooltip:k,helpMessage:$,disabled:p,required:w,placeholder:S,errorMessage:u,dropdownOptions:L,value:(null==r?A:r)??"",setValue:d})},ll=({field:l,value:r,setValue:o,disabled:s,keyValuePersistAs:c,sourceOptions:g,namespaceOptions:m})=>{const v=ja(),b=Zt(r),f=b.length?b:[{}],y=l.fields||[],x=e=>o(e);return a(t,{children:[f.map((t,r)=>a(Xa,{children:[e(ee,{}),a(n,{$gap:12,children:[a(d,{$justifyContent:"space-between",$alignItems:"center",children:[e(i,{label:`${l.itemLabel||l.title||"Item"} ${r+1}`}),e(u,{leftIcon:()=>e(fa,{fill:v.v2.colors.red[500]}),variant:h.Secondary,size:p.S,onClick:()=>(e=>{const a=f.filter((a,t)=>t!==e);x(a)})(r),disabled:s||1===f.length})]}),y.map(a=>e(tl,{field:a,value:t[a.name],setValue:e=>((e,a,t)=>x(f.map((l,r)=>r===e?{...l,[a]:t}:l)))(r,a.name,e),disabled:s,keyValuePersistAs:c,sourceOptions:g,namespaceOptions:m},`${l.name}-group-${r}-${a.name}`))]})]},`${l.name}-group-${r}`)),e(u,{variant:h.Secondary,label:l.addLabel||"Add",leftIcon:ya,onClick:()=>x([...f,{}]),disabled:s}),e(ee,{})]})},rl=({field:t,value:l,setValue:r,errorMessage:o,disabled:s})=>a(n,{$gap:12,children:[t.title&&e(i,{label:t.title,tooltip:t.tooltip,required:t.required}),e(n,{$gap:8,children:(t.checkboxOptions||[]).map(a=>{const t=e(T,{name:a.id,label:a.label,value:!0===l?.[a.id],disabled:s,onChange:e=>r(a.id,e)},a.id);return a.tooltip?e(ae,{text:a.tooltip,withIcon:!0,children:t},a.id):t})}),e(g,{errorMessage:o,helpMessage:t.helpMessage})]}),nl=({signals:a,fields:l,value:r,setValue:n,formErrors:i,disabled:o,seedInitialValues:s,keyValuePersistAs:c="map",sourceOptions:d,namespaceOptions:u})=>{const{isK8s:p}=Ga(),h=(l||[]).filter(e=>!!e).map(e=>Wt(e));return za(()=>{if(!s)return;const e=r||{},a={};h.forEach(t=>{if(t.componentType===y.SourceScopes&&!p)return;const l=t.componentType===y.SourceScopes?Jt(t)??Ua():Jt(t);if(void 0===l)return;if(t.componentType===y.CheckboxList&&"flatFields"===t.valueMode&&Yt(l))return void Object.entries(l).forEach(([t,l])=>{void 0!==e[t]&&null!==e[t]||(a[t]=l)});const r=e[t.name];if(t.componentType===y.SourceScopes){if(void 0!==r)return}else if(null!=r)return;a[t.name]=Yt(l)&&Yt(a[t.name])?{...a[t.name],...l}:l}),Object.entries(a).forEach(([e,a])=>n(e,a))},[]),e(t,{children:h.map(t=>{const l=Object.entries(r||{}).map(([e,a])=>({name:e,key:e,value:a}));if(t.renderCondition&&!Q(t.renderCondition,a,l))return null;if(t.componentType===y.SourceScopes&&!p)return null;const s=r?.[t.name];if(t.componentType===y.FieldGroup)return e(ll,{field:t,value:s,setValue:e=>n(t.name,e),disabled:o,keyValuePersistAs:c,sourceOptions:d,namespaceOptions:u},t.name);if(t.componentType===y.CheckboxList&&"flatFields"===t.valueMode){const a=t.checkboxOptions?.map(e=>i[e.id]).find(Boolean);return e(rl,{field:t,value:r||{},setValue:n,errorMessage:a,disabled:o},t.name)}return e(tl,{field:t,value:s,setValue:e=>n(t.name,e),errorMessage:i[t.name],disabled:o,keyValuePersistAs:c,sourceOptions:d,namespaceOptions:u},t.name)})})},il=nl,ol=({isEnabled:a,setIsEnabled:t,fieldDisabled:l})=>{const r=ja();return e(U,{options:[{icon:xa,label:"Enable",value:!0,selectedBgColor:r.v2.colors.green[1e3],selectedBorderColor:r.v2.colors.green[400],selectedTextColor:r.v2.colors.green[400]},{icon:Ca,label:"Disable",value:!1,selectedBgColor:r.v2.colors.red[1e3],selectedBorderColor:r.v2.colors.red[500],selectedTextColor:r.v2.colors.red[400]}],size:le.S,selected:a,setSelected:t,disabled:l})},sl=Ba.div`
152
- display: flex;
153
- align-items: center;
154
- gap: 24px;
155
- padding: 8px 16px;
156
- border-radius: 12px;
157
- background-color: ${({theme:e})=>e.v2.colors.silver[800]};
158
- `,cl=Ba.div`
159
- flex: 1;
160
- min-width: 0;
161
- white-space: pre;
162
- overflow-x: auto;
163
- `,dl=({title:t,summary:l,onEdit:r,renderAction:n})=>{const i=Ra(()=>{const e=[];return t&&(e.push({text:t,variant:Wa.Default}),e.push({text:" - ",variant:Wa.Default})),e.push(...l),e},[t,l]);return a(sl,{children:[e(cl,{children:e(Ja,{parts:i})}),n&&n(),r&&e(u,{"data-id":"sampling-btn-edit-auto-rule",label:re,rightIcon:ka,variant:h.Text,size:p.S,onClick:r})]})},ul={[pe.HttpRequest]:"HTTP request",[pe.HttpResponse]:"HTTP response",[pe.DbQuery]:"DB query",[pe.Messaging]:"messaging"};function pl(e,a,t){return 1===e?a:t??`${a}s`}function hl(e,a){const t=[],l=e.slice(0,3),r=e.slice(3);return l.forEach((e,l)=>{l>0&&t.push({text:", ",variant:Wa.Default}),t.push({text:e,variant:a})}),r.length>0&&t.push({text:` + ${r.length} more`,variant:Wa.Default,tooltipItems:r}),t}const gl=({option:a,formState:t,renderAction:l})=>{const r=Ra(()=>{const e=function(e,a){switch(e){case ie.CodeAttributes:return(e=>{const a=Object.values(he).filter(a=>!!e.codeAttributes?.[a]).map(e=>ge(e).toLowerCase());return a.length?[{text:"Collect",variant:Wa.Action},{text:" ",variant:Wa.Default},...hl(a,Wa.Endpoint)]:null})(a);case ie.PayloadCollection:return(e=>{const a=Object.values(pe).filter(a=>null!=e.payloadCollection?.[a]).map(e=>ul[e]);return a.length?[{text:"Collect",variant:Wa.Action},{text:" ",variant:Wa.Default},...hl(a,Wa.Endpoint)]:null})(a);case ie.HeadersCollection:return(e=>{const a=(e.headersCollection?.[ue.HeaderKeys]??[]).map(e=>e.trim()).filter(e=>e.length>0);if(!a.length)return null;const t=pl(a.length,"HTTP header");return[{text:`Collect ${a.length} ${t}`,variant:Wa.Action},{text:"",variant:Wa.Default,tooltipItems:a}]})(a);case ie.CustomInstrumentation:return(e=>{const a=(e.customInstrumentations?.[oe.Java]??[]).map(e=>new se(e.className,e.methodName)).filter(e=>e.Verify()),t=(e.customInstrumentations?.[oe.Golang]??[]).map(e=>new ce(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)).filter(e=>e.Verify()),l=(e.customInstrumentations?.[oe.Php]??[]).map(e=>new de(e.className,e.functionName)).filter(e=>e.Verify());if(!(a.length+t.length+l.length))return null;const r=[];a.length&&r.push(`${a.length} Java ${pl(a.length,"probe")}`),t.length&&r.push(`${t.length} Go ${pl(t.length,"probe")}`),l.length&&r.push(`${l.length} PHP ${pl(l.length,"probe")}`);const n=[...a.map(e=>`Java: ${e.toString()}`),...t.map(e=>`Go: ${e.toString()}`),...l.map(e=>`PHP: ${e.toString()}`)];return[{text:`Apply ${r.join(" + ")}`,variant:Wa.Action},{text:"",variant:Wa.Default,tooltipItems:n}]})(a);default:return null}}(a?.type,t);return e?[...e,...Ya(t.sourceScopes)]:[]},[a?.type,t]),n=0===r.length;return e(dl,{title:n?ne:"Instrumentation Rule Preview",summary:r,renderAction:l})},ml=({size:a=200,central:t=!1,useInline:l=!1})=>{const{tier:r}=Ga();if(l){if(t)return e(Sa,{size:a});switch(r){case me.Community:return e($a,{size:a});case me.Onprem:return e(Ta,{size:a});default:return null}}if(t)return e(wa,{size:a});switch(r){case me.Community:return e(Aa,{size:a});case me.Onprem:return e(Ma,{size:a});default:return null}},vl=[{value:"50",label:"50%"},{value:"25",label:"25%"},{value:"10",label:"10%"},{value:"1",label:"1%"},{value:"custom",label:"Custom"}],bl=[{value:"10",label:"10%"},{value:"1",label:"1%"},{value:"0.5",label:"0.5%"},{value:"0.1",label:"0.1%"},{value:"custom",label:"Custom"}],fl=[{value:"5000",label:"5s"},{value:"1000",label:"1s"},{value:"500",label:"500ms"},{value:"100",label:"100ms"},{value:"50",label:"50ms"},{value:"custom",label:"Custom"}],yl=({description:t,options:l,selected:r,onSelect:o,customName:s,customLabel:c,customPlaceholder:u,customValue:p,onCustomChange:h,customInputType:g=P.Number,customMin:m,customMax:v})=>a(n,{$gap:6,children:[e(i,{label:t}),a(d,{$gap:8,$alignItems:"flex-end",children:[e(U,{options:l,selected:r,setSelected:o}),"custom"===r&&e(L,{name:s,label:c,placeholder:u,type:g,value:p,onChange:h,width:160,min:m,max:v})]})]}),xl=()=>{},Cl=a=>a.readOnly?e(kl,{rule:a.rule}):e(Sl,{ruleType:a.ruleType,formState:a.formState,onChange:a.onChange}),kl=({rule:t})=>{const l=null!=t.durationAtLeastMs;return t.error?e(j,{richTitle:{title:ve},children:e(x,{name:"sampling-view-toggle-keep-errors",onChange:xl,value:!0,size:k.S,label:be,labelAlign:C.Right})}):l?e(j,{richTitle:{title:fe},children:a("div",{children:[e(o,{size:c.XXXS,color:s.Secondary,children:ye}),e(o,{size:c.XS,children:`${t.durationAtLeastMs}ms`})]})}):null},Sl=({ruleType:a,formState:t,onChange:l})=>{const r=Va(e=>l({durationPreset:e}),[l]),n=Va(e=>l({customDurationMs:e.target.value}),[l]);return"Duration"===a?e(j,{richTitle:{title:fe,subTitle:xe},children:e(yl,{description:ye,options:fl,selected:t.durationPreset,onSelect:r,customName:"sampling-input-custom-duration",customLabel:Ce,customPlaceholder:"200ms",customValue:t.customDurationMs,onCustomChange:n})}):null},Tl=Ba.div`
164
- display: flex;
165
- gap: 32px;
166
- `,$l=Ba.div`
167
- display: flex;
168
- flex-direction: column;
169
- gap: 4px;
170
- `,wl=Ba.div`
171
- display: flex;
172
- flex-wrap: wrap;
173
- align-items: flex-end;
174
- gap: 16px;
175
- `,Ml=Ba.div`
176
- display: flex;
177
- align-items: flex-end;
178
- gap: 16px;
179
- padding: 12px 16px;
180
- border-radius: 8px;
181
- background-color: ${({theme:e})=>e.v2.colors.black[500]};
182
- `,Al=Ba.div`
183
- display: flex;
184
- align-items: flex-end;
185
- gap: 10px;
186
- flex: 1;
187
- `,Ol=Ba.div`
188
- display: flex;
189
- align-items: center;
190
- height: 32px;
191
- `,Ll=Ba.div`
192
- display: flex;
193
- align-items: flex-end;
194
- gap: 16px;
195
- margin-bottom: 12px;
196
- `,Pl="Any",El="Kafka topic",Il=()=>e("div",{style:{marginBottom:"8px"},children:e(o,{size:c.XS,weight:500,children:"And"})}),Rl=[{value:"all",label:"All Operations"},{value:"httpServer",label:"HTTP Server"},{value:"httpClient",label:"HTTP Client"}],Nl=[{value:"all",label:"All Operations"},{value:"httpServer",label:"HTTP Server"},{value:"kafkaConsumer",label:"Kafka Consumer"},{value:"kafkaProducer",label:"Kafka Producer"}],Vl=[{id:"",label:Pl},{id:"GET",label:"GET"},{id:"POST",label:"POST"},{id:"PUT",label:"PUT"},{id:"DELETE",label:"DELETE"},{id:"PATCH",label:"PATCH"}],Dl=a=>a.readOnly?e(zl,{data:a.data}):e(Xl,{category:a.category,formState:a.formState,onChange:a.onChange}),zl=({data:t})=>{const l=Ra(()=>(e=>{if("noisy"===e.category){const a=e.rule.operation;if(a?.httpServer)return[{id:"type",title:Ve,value:Ne},{id:"route",title:Oe,value:a.httpServer.route||a.httpServer.routePrefix||De},{id:"method",title:Ie,value:a.httpServer.method||Pl}];if(a?.httpClient){const e=[{id:"type",title:Ve,value:ze}];return a.httpClient.serverAddress&&e.push({id:"serverAddress",title:"Server address",value:a.httpClient.serverAddress}),e.push({id:"route",title:Oe,value:a.httpClient.templatedPath||a.httpClient.templatedPathPrefix||De}),e.push({id:"method",title:Ie,value:a.httpClient.method||Pl}),e}return[{id:"type",title:Ve,value:Xe}]}const a=e.rule.operation;return a?.httpServer?[{id:"type",title:Ve,value:Ne},{id:"route",title:Oe,value:a.httpServer.route||a.httpServer.routePrefix||De},{id:"method",title:Ie,value:a.httpServer.method||Pl}]:a?.kafkaConsumer?[{id:"type",title:Ve,value:He},{id:"topic",title:El,value:a.kafkaConsumer.kafkaTopic||De}]:a?.kafkaProducer?[{id:"type",title:Ve,value:_e},{id:"topic",title:El,value:a.kafkaProducer.kafkaTopic||De}]:[{id:"type",title:Ve,value:Xe}]})(t),[t]);return e(j,{richTitle:{title:ke},children:e(Tl,{children:l.map(({id:t,title:l,value:r})=>a($l,{children:[e(o,{size:c.XXXS,color:s.Secondary,nowrap:!0,children:l}),e(o,{size:c.XS,nowrap:!0,children:r})]},t))})})},Xl=({category:t,formState:l,onChange:r})=>{const i=Ra(()=>"noisy"===t?Rl:Nl,[t]),o=Va(e=>r({operationType:e,route:"",serverAddress:"",method:"",kafkaTopic:""}),[r]),s=Va(e=>a=>{a&&r({routeType:e,route:""})},[r]),c=Va(e=>r({route:e.target.value}),[r]),d=Va(e=>r({serverAddress:e.target.value}),[r]),u=Va(e=>r({method:e[0]||""}),[r]),g=Va(e=>r({kafkaTopic:e.target.value}),[r]),m="httpServer"===l.operationType||"httpClient"===l.operationType,v="kafkaConsumer"===l.operationType||"kafkaProducer"===l.operationType,b="httpClient"===l.operationType?Ae:Oe,f="httpClient"===l.operationType?Le:Pe;return a(j,{richTitle:{title:`2. ${ke}`,subTitle:Se},children:[e(n,{$alignItems:"flex-start",children:e(U,{options:i,selected:l.operationType,setSelected:o})}),m&&a(wl,{children:["httpClient"===l.operationType&&a(Ll,{children:[e(L,{name:"sampling-input-server-address",label:$e,placeholder:Te,value:l.serverAddress,onChange:d}),e(Il,{})]}),a(Ml,{children:[a(Al,{children:[e(Ol,{children:e(we,{"data-id":"sampling-radio-route",value:"route"===l.routeType,onChange:s("route")})}),e(L,{name:"sampling-input-route",label:b,placeholder:Me,value:"route"===l.routeType?l.route:"",onChange:c,disabled:"route"!==l.routeType})]}),a(Al,{children:[e(Ol,{children:e(we,{"data-id":"sampling-radio-route-prefix",value:"routePrefix"===l.routeType,onChange:s("routePrefix")})}),e(L,{name:"sampling-input-route-prefix",label:f,placeholder:Me,value:"routePrefix"===l.routeType?l.route:"",onChange:c,disabled:"routePrefix"!==l.routeType})]})]}),a(Ll,{children:[e(Il,{}),e(Ee,{label:Ie,items:Vl,selectedIds:[l.method||""],setSelectedIds:e=>u(e),buttonProps:{"data-id":"sampling-btn-method",label:Vl.find(e=>e.id===l.method)?.label||Pl,size:p.S,variant:h.Secondary}})]})]}),v&&e(L,{name:"sampling-input-kafka-topic",label:Re,placeholder:"Type kafka topic",value:l.kafkaTopic,onChange:g,width:"320px"})]})},Hl=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],_l=[{value:"all",label:"Keep All"},{value:"sample",label:"Sample"}],Bl=a=>a.readOnly?e(ql,{data:a.data}):e(jl,{category:a.category,formState:a.formState,onChange:a.onChange}),ql=({data:t})=>{const l=Ra(()=>(e=>{switch(e.category){case"highlyRelevant":return null!=e.rule.percentageAtLeast?{title:qe,method:Ue,description:je,value:`${e.rule.percentageAtLeast}%`}:{title:qe,method:Fe,description:null,value:null};case"noisy":return Za(e.rule.percentageAtMost)?{title:qe,method:Ge,description:null,value:null}:{title:qe,method:Ue,description:Ke,value:`${e.rule.percentageAtMost}%`};case"costReduction":return{title:qe,method:Ue,description:Ke,value:`${e.rule.percentageAtMost}%`}}})(t),[t]),r=[{id:"method",title:Ie,value:l.method},...null!=l.description?[{id:"value",title:l.description,value:l.value}]:[]];return e(j,{richTitle:{title:l.title},children:e(Tl,{children:r.map(({id:t,title:l,value:r})=>a($l,{children:[e(o,{size:c.XXXS,color:s.Secondary,nowrap:!0,children:l}),e(o,{size:c.XS,nowrap:!0,children:r})]},t))})})},jl=({category:t,formState:l,onChange:r})=>{const i="highlyRelevant"===t,o=i?_l:Hl,s=`${i?4:3}. ${qe}`,c=Be[t],d=i?je:Ke,u="noisy"===t?bl:vl,p=Va(e=>r({percentageMode:e}),[r]),h=Va(e=>r({percentagePreset:e}),[r]),g=Va(e=>r({customPercentage:e.target.value}),[r]);return a(j,{richTitle:{title:s,subTitle:c},children:["costReduction"!==t&&e(n,{$alignItems:"flex-start",children:e(U,{options:o,selected:l.percentageMode,setSelected:p})}),("costReduction"===t||"sample"===l.percentageMode)&&e(yl,{description:d,options:u,selected:l.percentagePreset,onSelect:h,customName:"sampling-input-custom-percentage",customPlaceholder:"5%",customValue:l.customPercentage,onCustomChange:g,customInputType:P.Decimal,customMin:0,customMax:100})]})},Kl=Ba.div`
197
- display: flex;
198
- align-items: flex-end;
199
- gap: 16px;
200
- `,Ul=Ba.div`
201
- width: 280px;
202
- flex-shrink: 0;
203
- `,Gl=Ba.div`
204
- flex: 1;
205
- min-width: 0;
206
- `;function Fl(e){return"highlyRelevant"===e.category?e.rule.error?"Error":null!=e.rule.durationAtLeastMs?"Duration":"Relevance":ta[e.category]}const Wl=a=>a.readOnly?e(Jl,{data:a.data}):e(Yl,{formState:a.formState,onChange:a.onChange}),Jl=({data:t})=>{const l=Ra(()=>[{id:"name",title:Je,value:t.rule.name||We},{id:"type",title:Ye,value:Fl(t)}],[t]),r=t.rule.notes||De;return a(j,{children:[e(Tl,{children:l.map(({id:t,title:l,value:r})=>a($l,{children:[e(o,{size:c.XXXS,color:s.Secondary,nowrap:!0,children:l}),e(o,{size:c.XS,nowrap:!0,children:r})]},t))}),a($l,{children:[e(o,{size:c.XXXS,color:s.Secondary,children:Ze}),e(o,{size:c.XS,children:r})]})]})},Yl=({formState:t,onChange:l})=>{const r=Va(e=>l({name:e.target.value}),[l]),n=Va(e=>l({notes:e.target.value}),[l]);return e(j,{children:a(Kl,{children:[e(Ul,{children:e(L,{name:"sampling-input-rule-name",label:Je,tooltip:"Optional. Give this rule a name for easier identification.",placeholder:Qe,value:t.name,onChange:r})}),e(Gl,{children:e(L,{name:"sampling-input-note",label:Ze,tooltip:aa,placeholder:ea,value:t.notes,onChange:n})})]})})},Zl=[{value:"Relevance",label:"Relevance"},{value:"Error",label:"Error"},{value:"Duration",label:"Duration"}],Ql=({formState:a,onChange:t})=>{const l=Va(e=>t({ruleType:e,keepErrors:"Error"===e}),[t]);return e(j,{richTitle:{title:`3. ${Ye}`,subTitle:la},children:e(n,{$alignItems:"flex-start",children:e(U,{options:Zl,selected:a.ruleType,setSelected:l})})})},er=a=>{const t=Ra(()=>{if(a.readOnly)return a.summary;switch(a.category){case"noisy":return at(rt(a.formState));case"highlyRelevant":return et(lt(a.formState));case"costReduction":return Qa(tt(a.formState))}},[a]);if(a.readOnly)return e(dl,{title:ra,summary:t,renderAction:a.renderAction});const l=1===t.length&&"default"===t[0].variant;return e(dl,{title:l?ne:ra,summary:l?[]:t,renderAction:a.renderAction})},ar=(e,a)=>!a?.length||!!a?.find(a=>a===e),tr=({title:t="Signals",required:l,errorMessage:r,allowedSignals:o,selectedSignals:s,setSelectedSignals:c,disabled:u})=>{const[p,h]=Da(1===s.length),m=Na(JSON.stringify(s));return za(()=>{let e=na(s).filter(e=>ar(e,o));e.length||(e=ia.filter(({id:e})=>ar(e,o)).map(({id:e})=>e));const a=JSON.stringify(e);m.current!==a&&(m.current=a,c(e),h(1===e.length))},[o,s]),a(n,{$gap:12,children:[e(i,{label:t,required:l}),e(d,{$gap:12,children:ia.map(a=>{const t=ar(a.id,o),l=((e,a)=>!!a?.find(a=>a===e))(a.id,s);return t?e(T,{label:a.value,disabled:u||!t||p&&l,value:l,onChange:e=>((e,a)=>{const t=e,l=a?[...s,t]:s.filter(e=>e!==t);c(l),h(1===l.length)})(a.id,e)},a.id):null})}),e(g,{errorMessage:r})]})},lr=({minSupportedVersion:a,currentVersion:t})=>e(m,{isOpen:!0,onClose:()=>{},relativeToParent:!0,visual:()=>e(f,{scale:2.4,icon:()=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"21",viewBox:"0 0 22 21",fill:"none",children:e("path",{fill:"#151618",d:"M9.4844 0.730003C9.99694 -0.243259 11.4076 -0.24341 11.92 0.730003L11.9685 0.831353L14.3039 6.22012L20.153 6.77755C21.3553 6.89211 21.841 8.38683 20.9358 9.18621L16.5314 13.0731L17.8091 18.8079C18.0716 19.9868 16.8005 20.9109 15.7605 20.2969L10.7017 17.3093L5.64282 20.2969C4.60289 20.9104 3.33173 19.9866 3.59427 18.8079L4.87192 13.0741L0.468608 9.18621C-0.43662 8.38693 0.0482932 6.8924 1.25029 6.77755L7.09837 6.22012L9.43588 0.831353L9.4844 0.730003ZM8.55284 7.02876C8.35287 7.48992 7.9179 7.80589 7.41751 7.85357L2.03952 8.36571L6.09027 11.941C6.46691 12.2737 6.63296 12.7852 6.5237 13.2758L5.34956 18.5459L10.0008 15.8009L10.1669 15.7179C10.5087 15.574 10.8945 15.5741 11.2364 15.7179L11.4036 15.8009L16.0538 18.5459L14.8807 13.2758C14.7714 12.7851 14.9374 12.2737 15.3141 11.941L19.3627 8.36571L13.9858 7.85357C13.4855 7.80587 13.0505 7.4899 12.8505 7.02876L10.7017 2.07342L8.55284 7.02876Z"})})}),title:"Upgrade Required",description:`To use this feature, please upgrade to Odigos v${a} or later.\nCurrent version: ${t}.`}),rr=Ba.div`
207
- display: flex;
208
- flex-direction: column;
209
- justify-content: flex-end;
210
- width: ${({$width:e})=>e};
211
- gap: ${({$columnHasHeader:e})=>e?"0":"12px"};
212
- `,nr=Ba.div`
213
- display: flex;
214
- align-items: center;
215
- min-height: 24px;
216
- padding: 12px;
217
- border-radius: 16px 16px 0 0;
218
- background-color: ${({theme:e})=>e.v2.colors.silver[800]};
219
- `,ir=Ba.div`
220
- display: flex;
221
- flex-direction: column;
222
- gap: ${({$gap:e})=>e}px;
223
- padding: 12px 12px 0 12px;
224
- width: 100%;
225
- height: ${({$heightOffset:e,$columnHasHeader:a})=>`calc(100vh - 180px - ${e}px ${a?"- 48px":""})`};
226
- border-radius: ${({$columnHasHeader:e,$isLeft:a,$isRight:t})=>e?a?"0 0 0 16px":t?"0 16px 0 0":"0":a?"16px 0 0 16px":t?"0 16px 16px 0":"16px"};
227
- background-color: ${({theme:e})=>e.v2.colors.silver[900]};
228
- overflow-y: auto;
229
- overflow-x: hidden;
230
- `,or=({isLeft:l,isRight:r,heightOffset:n=0,width:i,header:o,list:s})=>a(rr,{$width:i,$columnHasHeader:!!o,children:[o&&e(nr,{children:o}),e(ir,{$gap:8,$isLeft:l,$isRight:r,$heightOffset:n,$columnHasHeader:!!o,children:s.length?s.length>1?e(oa,{gap:8,elements:s}):e(t,{children:s[0]}):e(sa,{$height:"100%",children:e(ca,{})})})]}),sr="75vw",cr=Ba.div`
231
- display: flex;
232
- flex-direction: column;
233
- border-radius: 16px;
234
- background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
235
- overflow: hidden;
236
- `,dr=Ba.div`
237
- display: flex;
238
- gap: 12px;
239
- padding: 16px 16px 0 16px;
240
- background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
241
- position: sticky;
242
- top: 0;
243
- `,ur=Ba.div`
244
- padding: 12px 12px 0 12px;
245
- `,pr=Ba.div`
246
- display: flex;
247
- gap: 12px;
248
- padding: 16px;
249
- `,hr=Ba.div`
250
- padding: 5vh 10vw;
251
- border-radius: 12px;
252
- background-color: ${({theme:e})=>e.v2.colors.silver[800]};
253
- `,gr=Ha(({isOpen:t,withOverlay:r,disableAnimation:n,onClose:i,onBack:o,onNext:s,nextIsSkip:d,onSave:u,disableSave:p,connectionIds:g,header:v,subHeader:b,leftColumn:f,rightColumn:y,search:x,filters:C,errorMessage:k,isFormDirty:S,hideDirtyNote:T,forcedNote:$,isFetching:w,progress:M},A)=>{const[O,L]=Da(!1),[P,E]=Da(!1),[I,R]=Da(void 0);_a(A,()=>({clearErrors:()=>R(void 0)}));const V=P,D=Va(()=>{S&&!O?L(!0):(L(!1),i?.())},[S,O,i]),z=p||P||"boolean"==typeof S&&!S,X=Va(async()=>{E(!0);const e=await u();E(!1),!1!==e&&(e?.error?R(e.error):(g?.setValue([]),i?.()))},[u,g,i]),H=!!x||!!g||!!C,_=!!b,B=(H?48:0)+(_?50:0),q=Ra(()=>$||(w?{status:N.Info,message:"Fetching Data..."}:P&&!M?{status:N.Info,message:"Saving Changes..."}:I||k?{status:N.Error,message:I||k}:"boolean"!=typeof S||T?void 0:S?{status:N.Info,message:'The values don\'t reflect the current configurations of the selected clusters.\n"Save" will override the current configurations.'}:{status:N.Success,message:"The values reflect the current configuration of the selected cluster."}),[w,P,M,I,k,S,T,$]),j=Ra(()=>o?{label:"Back",leftIcon:Oa,variant:h.Secondary,onClick:o}:{label:"Cancel",variant:h.Secondary,onClick:D,disabled:V},[o,D,V]),[K,U]=Da(!1),G=Ra(()=>s?d?{"data-id":"wide-drawer-skip",label:"Skip",rightIcon:La,variant:h.Secondary,onClick:()=>U(!0)}:{"data-id":"wide-drawer-next",label:"Next",rightIcon:La,variant:h.Primary,onClick:s}:{"data-id":"wide-drawer-save",label:"Save",variant:h.Primary,onClick:X,disabled:z},[s,d,X,z]);return a(l,{width:sr,isOpen:t,disableAnimation:n,hideOverlay:!P&&!r,header:{...v,onClose:i?D:void 0,onCloseDisabled:V},footer:{note:q,actions:[j,G]},children:[P?e(sa,{$height:"calc(100vh - 136px)",children:e(hr,{children:e(da,{titleSize:c.S,subTitleSize:c.XXXS,withGradient:!0,withSpinner:!0,...M})})}):a(cr,{children:[H&&a(dr,{children:[g&&e(ua,{icon:xa,title:"Selected Clusters",badge:{label:g.value.length}}),x&&e(pa,{...x,width:x.width??"100%"}),C]}),_&&e(ur,{children:e(ua,{icon:b.icon,title:b.title,subTitle:b.description,badge:b.badge})}),a(pr,{children:[e(or,{isLeft:!0,heightOffset:B,...f}),e(or,{isRight:!0,heightOffset:B,...y})]})]}),e(St,{isOpen:O,onClose:()=>L(!1),onApprove:D}),e(m,{title:"Skip setup?",description:"Without completing setup, Odigos won't be able to collect and send your telemetry data. This may interrupt your data flow and limit the platform's ability to provide value.",isOpen:K,onClose:()=>U(!1),denyButton:{label:"Go Back",variant:h.Secondary,onClick:()=>U(!1)},approveButton:{label:"Skip",variant:h.Primary,onClick:()=>{s?.(),U(!1)}}})]})});gr.displayName=gr.name;const mr=Ba.div`
254
- padding: 0 24px;
255
- border-radius: 12px;
256
- background-color: ${({$codeBgColor:e})=>e||"transparent"};
257
- `,vr=({title:a="YAML",yaml:t,defaultOpen:l,fullHeight:r,bgTint:n="1000",codeBgColor:i})=>{const{clickCopy:o,isCopied:s}=ha(),c=Ra(()=>t?[{id:ma(),type:ga.Button,buttonProps:{variant:h.Text,size:p.S,leftIcon:s?ba:Pa,onClick:()=>o(t||""),disabled:s}}]:[],[t,s]);return e(E,{bgTint:n,richTitle:{icon:Ea,title:a},actions:c,withCollapse:!0,collapseIsDefaultOpen:l,fullHeight:r,children:e(mr,{$codeBgColor:i,children:t?e(va,{code:t,language:"yaml",theme:"duotoneDark"}):e(sa,{children:e(ca,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})})})};export{dl as A,St as C,fl as D,ol as E,gl as I,bl as N,ml as O,vl as P,Wl as R,er as S,lr as U,sr as W,vr as Y,Tt as a,$t as b,Cl as c,il as d,wt as e,nl as f,Dl as g,Bl as h,yl as i,Ql as j,tr as k,Xt as l,gr as m,kt as n};