@odigos/ui-kit 0.0.256 → 0.0.258

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 (59) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/lib/chunks/{connections-scope-D_2Q866B.js → connections-scope-DgpFs9S1.js} +1 -1
  3. package/lib/chunks/{helpers-CUmUiA_l.js → helpers-BlFl20R2.js} +2 -2
  4. package/lib/chunks/index-BVL5-zQa.js +155 -0
  5. package/lib/chunks/{source-instrument-form-context-DaQkZ03_.js → source-instrument-form-context-o2ynNRPg.js} +1 -1
  6. package/lib/chunks/ui-components-BmIux5o5.js +1692 -0
  7. package/lib/chunks/use-odigos-api-hslZLdix.js +5 -0
  8. package/lib/components/_v2/autocomplete/index.d.ts +4 -0
  9. package/lib/components/_v2/badge/index.d.ts +2 -2
  10. package/lib/components/_v2/cards/status-card/index.d.ts +2 -2
  11. package/lib/components/_v2/condition/index.d.ts +2 -2
  12. package/lib/components/_v2/drop-data/index.d.ts +2 -0
  13. package/lib/components/_v2/table/index.d.ts +4 -0
  14. package/lib/components/_v2/table/styled.d.ts +1 -0
  15. package/lib/components/_v2/table/table-rows/index.d.ts +6 -0
  16. package/lib/components/_v2/table/types.d.ts +6 -0
  17. package/lib/components/scroll-y/index.d.ts +4 -0
  18. package/lib/components/v2.js +1 -1
  19. package/lib/components.js +1 -1
  20. package/lib/constants.js +1 -1
  21. package/lib/containers/_v2/_drawers/edit-rule-drawer/helpers.d.ts +1 -1
  22. package/lib/containers/_v2/_drawers/edit-source-drawer/profiling/flame-graph-canvas.d.ts +6 -0
  23. package/lib/containers/_v2/_drawers/edit-source-drawer/profiling/flamebearer.d.ts +3 -1
  24. package/lib/containers/_v2/_drawers/edit-source-drawer/profiling/symbol-table/index.d.ts +34 -0
  25. package/lib/containers/_v2/_drawers/edit-source-drawer/profiling/symbol-table/modify-rules-modal.d.ts +10 -0
  26. package/lib/containers/_v2/_drawers/edit-source-drawer/profiling/symbol-table/symbol-instrumentation.d.ts +86 -0
  27. package/lib/containers/_v2/_drawers/edit-source-drawer/profiling/symbol-table/use-symbol-instrumentation.d.ts +69 -0
  28. package/lib/containers/service-map/react-flow/columns/active-node-info.d.ts +2 -0
  29. package/lib/containers/service-map/react-flow/columns/column-root.d.ts +4 -0
  30. package/lib/containers/service-map/react-flow/{search-and-select-nodes.d.ts → columns/search-and-select-nodes.d.ts} +0 -1
  31. package/lib/containers/service-map/service-map-context.d.ts +3 -3
  32. package/lib/containers/v2.js +158 -143
  33. package/lib/containers.js +30 -12
  34. package/lib/contexts/odigos-api/hooks/use-sources-api.d.ts +4 -1
  35. package/lib/contexts/odigos-api.js +1 -1
  36. package/lib/contexts.js +1 -1
  37. package/lib/functions/get-health-badge-label/index.d.ts +2 -2
  38. package/lib/functions/get-status-color/index.d.ts +2 -2
  39. package/lib/functions/get-status-from-pod-status/index.d.ts +2 -2
  40. package/lib/functions/get-status-icon/index.d.ts +2 -2
  41. package/lib/functions/get-status-type-from-odigos-health/index.d.ts +2 -2
  42. package/lib/functions/map-desired-status-to-condition-status/index.d.ts +2 -2
  43. package/lib/functions.js +1 -1
  44. package/lib/hooks.js +1 -1
  45. package/lib/snippets/_v2/sampling-rule-form-sections/preset-with-custom-input.d.ts +1 -1
  46. package/lib/snippets/v2.js +1 -1
  47. package/lib/snippets.js +1 -1
  48. package/lib/store/useProgressStore.d.ts +2 -2
  49. package/lib/store.js +1 -1
  50. package/lib/theme.js +1 -1
  51. package/lib/types/common/index.d.ts +5 -10
  52. package/lib/types/sampling.d.ts +2 -0
  53. package/lib/types.js +1 -1
  54. package/lib/visuals.js +1 -1
  55. package/package.json +1 -1
  56. package/lib/chunks/index-hiRPXsEi.js +0 -155
  57. package/lib/chunks/ui-components-B1TCLO_N.js +0 -1666
  58. package/lib/chunks/use-odigos-api-BMcghWbA.js +0 -5
  59. package/lib/containers/_v2/_drawers/edit-source-drawer/profiling/symbol-table.d.ts +0 -21
@@ -1,4 +1,4 @@
1
- import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect as n,useMemo as a,useRef as i,useCallback as l,useState as s,Fragment as r,forwardRef as c,useImperativeHandle as d,Children as u,createContext as p,useContext as h,useLayoutEffect as g}from"react";import m,{useTheme as f,css as b,keyframes as v}from"styled-components";import{u as y,n as C,C as S,e as w,f as x,h as T,d as k,b as $,c as E,S as I,j as A,R as N,k as O,l as R,a as D,r as P,o as F,p as L,q as _,s as z,t as M,w as B,x as X,y as V,z as U,A as H,B as G}from"../chunks/helpers-CUmUiA_l.js";import{f as j,a1 as W,a2 as K,M as Y,a3 as J,a4 as q,a5 as Z,a6 as Q,a7 as ee,a8 as te,a9 as oe,aa as ne,b as ae,ab as ie,c as le,y as se,ac as re,ad as ce,ae as de,af as ue,ag as pe,ah as he,ai as ge,aj as me,ak as fe,al as be,am as ve,g as ye,N as Ce,an as Se,ao as we,ap as xe,aq as Te,ar as ke,R as $e,o as Ee,S as Ie,k as Ae,m as Ne,as as Oe,at as Re,au as De,H as Pe,av as Fe,G as Le,J as _e,C as ze,n as Me,B as Be,aw as Xe,ax as Ve,ay as Ue,p as He,h as Ge,az as je,aA as We,aB as Ke,aC as Ye,aD as Je,aE as qe,aF as Ze,aG as Qe,aH as et,aI as tt,aJ as ot,A as nt,aK as at,D as it,aL as lt,aM as st,aN as rt,aO as ct,aP as dt,aQ as ut,e as pt,s as ht,I as gt,E as mt,aR as ft,T as bt,aS as vt,aT as yt,W as Ct,aU as St,aV as wt,Y as xt,_ as Tt,aW as kt,aX as $t,aY as Et,aZ as It,a_ as At,d as Nt,a$ as Ot,l as Rt,b0 as Dt,b1 as Pt,b2 as Ft,O as Lt,F as _t,b3 as zt,b4 as Mt,b5 as Bt,b6 as Xt,b7 as Vt,b8 as Ut,b9 as Ht,ba as Gt,bb as jt,bc as Wt,bd as Kt,be as Yt,bf as Jt,bg as qt,z as Zt,L as Qt,bh as eo,bi as to,q as oo,r as no,w as ao,K as io,bj as lo,bk as so,bl as ro,bm as co,bn as uo,bo as po,bp as ho,bq as go,br as mo,bs as fo,bt as bo,bu as vo,bv as yo,bw as Co,bx as So,by as wo,bz as xo,bA as To,bB as ko,bC as $o,bD as Eo,bE as Io,bF as Ao,bG as No,bH as Oo,bI as Ro,bJ as Do,bK as Po,bL as Fo,bM as Lo,bN as _o,bO as zo,bP as Mo,bQ as Bo,bR as Xo,bS as Vo,bT as Uo,bU as Ho,bV as Go,bW as jo,bX as Wo,bY as Ko,bZ as Yo,b_ as Jo,b$ as qo,c0 as Zo,c1 as Qo,c2 as en,c3 as tn,c4 as on,c5 as nn,c6 as an,c7 as ln,c8 as sn,c9 as rn,ca as cn,cb as dn,cc as un,cd as pn,ce as hn,cf as gn,cg as mn,ch as fn,ci as bn,cj as vn,ck as yn,cl as Cn,cm as Sn,cn as wn,co as xn,cp as Tn,cq as kn,cr as $n,cs as En,ct as In,cu as An,cv as Nn,cw as On,cx as Rn,cy as Dn,cz as Pn,cA as Fn,cB as Ln,cC as _n,cD as zn,cE as Mn,cF as Bn,cG as Xn,cH as Vn,cI as Un,cJ as Hn,cK as Gn,cL as jn,cM as Wn,cN as Kn,cO as Yn,cP as Jn,cQ as qn,cR as Zn,cS as Qn,cT as ea,cU as ta,cV as oa,cW as na,cX as aa,cY as ia,cZ as la,c_ as sa,c$ as ra,d0 as ca,d1 as da,d2 as ua,d3 as pa,d4 as ha,d5 as ga,d6 as ma,d7 as fa,d8 as ba,d9 as va,da as ya,db as Ca,dc as Sa,dd as wa,de as xa,x as Ta,df as ka,v as $a,dg as Ea,dh as Ia,di as Aa,dj as Na,dk as Oa,dl as Ra,dm as Da,dn as Pa,X as Fa,dp as La,dq as _a,dr as za,ds as Ma,dt as Ba,du as Xa,dv as Va,dw as Ua,dx as Ha,dy as Ga,dz as ja,dA as Wa,dB as Ka,dC as Ya,dD as Ja,dE as qa,dF as Za,dG as Qa,dH as ei,dI as ti,dJ as oi,dK as ni,dL as ai,dM as ii,dN as li,dO as si}from"../chunks/ui-components-B1TCLO_N.js";import{TrashIcon as ri,PlusIcon as ci,ArrowRightIcon as di,VSquareIcon as ui,XSquareIcon as pi,BookIcon as hi,DeleteIcon as gi,EditIcon as mi,GoLogo as fi,JavaLogo as bi,ChevronRightIcon as vi,ActionIcon as yi,DestinationIcon as Ci,ChevronUpIcon as Si,ChevronDownIcon as wi,VIcon as xi,XIcon as Ti,InstrumentationRuleIcon as ki,SourceIcon as $i,NamespacesIcon as Ei,SettingsIcon as Ii,PodIcon as Ai,OdigosLogo as Ni,K8sLogo as Oi,RefreshIcon as Ri,ExclamationCircleIcon as Di,QuestionCircleIcon as Pi,InboundIcon as Fi,OutboundIcon as Li,UserIcon as _i,TerminalIcon as zi,SearchIcon as Mi,MinusIcon as Bi,ExpandIcon as Xi,CopyIcon as Vi,DotIcon as Ui,DownloadIcon as Hi,RefreshLeftArrowIcon as Gi,VmLogo as ji,SamplingIcon as Wi,ExclamationTriangleIcon as Ki,KeyIcon as Yi,DiagnoseIcon as Ji,StarIcon as qi,ArrowIcon as Zi,ConnectionsIcon as Qi,FilterIcon as el,DataStreamIcon as tl,PipelineCollectorIcon as ol,ArrowDownSquareIcon as nl,ArrowUpSquareIcon as al,GatewayIcon as il,YamlIcon as ll}from"../icons.js";import{d as sl}from"../chunks/use-odigos-api-BMcghWbA.js";import{S as rl,D as cl,I as dl,a as ul,A as pl,P as hl,b as gl,c as ml,R as fl,O as bl,d as vl,e as yl,f as Cl,W as Sl,g as wl,C as xl,Y as Tl,h as kl,i as $l,U as El}from"../chunks/index-hiRPXsEi.js";import{O as Il}from"../chunks/connections-scope-D_2Q866B.js";import{u as Al,f as Nl,g as Ol,e as Rl,i as Dl,h as Pl,S as Fl,k as Ll,E as _l,l as zl,m as Ml,j as Bl,b as Xl,d as Vl,a as Ul,A as Hl,R as Gl,c as jl,D as Wl}from"../chunks/source-instrument-form-context-DaQkZ03_.js";import{U as Kl}from"../chunks/consts-D6GCMJ6c.js";import{createPortal as Yl}from"react-dom";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"../chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"virtua";import"@apollo/client";import"@apollo/client/link/error";import"@apollo/client/link/context";import"@apollo/client/utilities";const Jl=[{id:"CREDIT_CARD",label:"Credit card"}],ql=[{id:j.CollectContainerAttributes,label:"Collect container attributes"},{id:j.CollectReplicaSetAttributes,label:"Collect ReplicaSet attributes"},{id:j.CollectWorkloadId,label:"Collect workload ID"},{id:j.CollectClusterId,label:"Collect cluster ID"}],Zl=[{id:Z.Pod,label:Z.Pod},{id:Z.Namespace,label:Z.Namespace},{id:Z.Node,label:Z.Node}],Ql=[{label:"Label key",keyName:"labelKey",placeholder:"app.kubernetes.io/name"},{label:"Attribute key",keyName:"attributeKey",placeholder:"app.kubernetes.name"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:Zl}],es=[{label:"Annotation key",keyName:"annotationKey",placeholder:"kubectl.kubernetes.io/restartedAt"},{label:"Attribute key",keyName:"attributeKey",placeholder:"kubectl.kubernetes.restartedAt"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:Zl}],ts=/^[a-zA-Z]$/,os=new Set(["*","+","?"]),ns=new Set(["^","$"]),as={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"},is=m.div`
1
+ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect as o,useMemo as a,useRef as i,useCallback as l,useState as s,Fragment as r,forwardRef as c,useImperativeHandle as d,Children as u,createContext as p,useContext as h,useLayoutEffect as m}from"react";import g,{useTheme as f,css as b,keyframes as v}from"styled-components";import{u as y,n as C,C as S,e as w,f as x,h as k,d as T,b as $,c as I,S as E,j as A,R as N,k as O,l as R,a as D,r as P,o as F,p as L,q as _,s as M,t as z,w as B,x as X,y as V,z as U,A as G,B as H}from"../chunks/helpers-BlFl20R2.js";import{f as j,a6 as W,a7 as K,V as Y,a8 as J,a9 as q,aa as Z,ab as Q,ac as ee,ad as te,ae as ne,af as oe,b as ae,O as ie,c as le,y as se,B as re,z as ce,L as de,M as ue,ag as pe,ah as he,ai as me,aj as ge,ak as fe,al as be,am as ve,g as ye,N as Ce,an as Se,ao as we,ap as xe,aq as ke,ar as Te,Y as $e,o as Ie,S as Ee,k as Ae,m as Ne,as as Oe,at as Re,au as De,H as Pe,av as Fe,G as Le,J as _e,C as Me,n as ze,R as Be,aw as Xe,ax as Ve,ay as Ue,p as Ge,h as He,az as je,aA as We,aB as Ke,aC as Ye,aD as Je,aE as qe,aF as Ze,aG as Qe,aH as et,aI as tt,aJ as nt,A as ot,aK as at,D as it,aL as lt,aM as st,aN as rt,aO as ct,aP as dt,aQ as ut,e as pt,s as ht,I as mt,E as gt,T as ft,aR as bt,aS as vt,$ as yt,aT as Ct,aU as St,a1 as wt,a3 as xt,aV as kt,aW as Tt,aX as $t,aY as It,aZ as Et,d as At,a_ as Nt,l as Ot,a$ as Rt,b0 as Dt,b1 as Pt,W as Ft,F as Lt,b2 as _t,b3 as Mt,b4 as zt,b5 as Bt,b6 as Xt,b7 as Vt,b8 as Ut,b9 as Gt,ba as Ht,bb as jt,bc as Wt,bd as Kt,be as Yt,U as Jt,Q as qt,bf as Zt,bg as Qt,q as en,r as tn,w as nn,K as on,bh as an,bi as ln,bj as sn,bk as rn,bl as cn,bm as dn,bn as un,bo as pn,bp as hn,bq as mn,br as gn,bs as fn,bt as bn,bu as vn,bv as yn,bw as Cn,bx as Sn,by as wn,bz as xn,bA as kn,bB as Tn,bC as $n,bD as In,bE as En,bF as An,bG as Nn,bH as On,bI as Rn,bJ as Dn,bK as Pn,bL as Fn,bM as Ln,bN as _n,bO as Mn,bP as zn,bQ as Bn,bR as Xn,bS as Vn,bT as Un,bU as Gn,bV as Hn,bW as jn,bX as Wn,bY as Kn,bZ as Yn,b_ as Jn,b$ as qn,c0 as Zn,c1 as Qn,c2 as eo,c3 as to,c4 as no,c5 as oo,c6 as ao,c7 as io,c8 as lo,c9 as so,ca as ro,cb as co,cc as uo,cd as po,ce as ho,cf as mo,cg as go,ch as fo,ci as bo,cj as vo,ck as yo,cl as Co,cm as So,cn as wo,co as xo,cp as ko,cq as To,cr as $o,cs as Io,ct as Eo,cu as Ao,cv as No,cw as Oo,cx as Ro,cy as Do,cz as Po,cA as Fo,cB as Lo,cC as _o,cD as Mo,cE as zo,cF as Bo,cG as Xo,cH as Vo,cI as Uo,cJ as Go,cK as Ho,cL as jo,cM as Wo,cN as Ko,cO as Yo,cP as Jo,cQ as qo,cR as Zo,cS as Qo,cT as ea,cU as ta,cV as na,cW as oa,cX as aa,cY as ia,cZ as la,c_ as sa,c$ as ra,d0 as ca,d1 as da,d2 as ua,d3 as pa,d4 as ha,d5 as ma,d6 as ga,d7 as fa,d8 as ba,d9 as va,da as ya,db as Ca,dc as Sa,x as wa,dd as xa,v as ka,de as Ta,df as $a,dg as Ia,dh as Ea,di as Aa,dj as Na,dk as Oa,dl as Ra,a0 as Da,dm as Pa,dn as Fa,dp as La,dq as _a,dr as Ma,ds as za,dt as Ba,du as Xa,dv as Va,dw as Ua,dx as Ga,dy as Ha,dz as ja,dA as Wa,dB as Ka,dC as Ya,dD as Ja,dE as qa,dF as Za,dG as Qa,dH as ei,dI as ti,dJ as ni,dK as oi,dL as ai,dM as ii}from"../chunks/ui-components-BmIux5o5.js";import{TrashIcon as li,PlusIcon as si,ArrowRightIcon as ri,VSquareIcon as ci,XSquareIcon as di,BookIcon as ui,DeleteIcon as pi,EditIcon as hi,GoLogo as mi,JavaLogo as gi,ChevronRightIcon as fi,ActionIcon as bi,DestinationIcon as vi,ChevronUpIcon as yi,ChevronDownIcon as Ci,VIcon as Si,XIcon as wi,InstrumentationRuleIcon as xi,SourceIcon as ki,NamespacesIcon as Ti,SettingsIcon as $i,PodIcon as Ii,OdigosLogo as Ei,K8sLogo as Ai,RefreshIcon as Ni,ExclamationCircleIcon as Oi,QuestionCircleIcon as Ri,InboundIcon as Di,OutboundIcon as Pi,UserIcon as Fi,TerminalIcon as Li,MinusIcon as _i,SearchIcon as Mi,ExpandIcon as zi,CopyIcon as Bi,DotIcon as Xi,ArrowDownIcon as Vi,DownloadIcon as Ui,RefreshLeftArrowIcon as Gi,VmLogo as Hi,SamplingIcon as ji,ExclamationTriangleIcon as Wi,KeyIcon as Ki,DiagnoseIcon as Yi,StarIcon as Ji,ArrowIcon as qi,ConnectionsIcon as Zi,FilterIcon as Qi,DataStreamIcon as el,PipelineCollectorIcon as tl,ArrowDownSquareIcon as nl,ArrowUpSquareIcon as ol,GatewayIcon as al,YamlIcon as il}from"../icons.js";import{d as ll}from"../chunks/use-odigos-api-hslZLdix.js";import{S as sl,D as rl,I as cl,a as dl,A as ul,P as pl,b as hl,c as ml,R as gl,O as fl,d as bl,e as vl,f as yl,W as Cl,g as Sl,C as wl,Y as xl,h as kl,i as Tl,U as $l}from"../chunks/index-BVL5-zQa.js";import{O as Il}from"../chunks/connections-scope-DgpFs9S1.js";import{u as El,f as Al,g as Nl,e as Ol,i as Rl,h as Dl,S as Pl,k as Fl,E as Ll,l as _l,m as Ml,j as zl,b as Bl,d as Xl,a as Vl,A as Ul,R as Gl,c as Hl,D as jl}from"../chunks/source-instrument-form-context-o2ynNRPg.js";import{U as Wl}from"../chunks/consts-D6GCMJ6c.js";import{createPortal as Kl}from"react-dom";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"../chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"virtua";import"@apollo/client";import"@apollo/client/link/error";import"@apollo/client/link/context";import"@apollo/client/utilities";const Yl=[{id:"CREDIT_CARD",label:"Credit card"}],Jl=[{id:j.CollectContainerAttributes,label:"Collect container attributes"},{id:j.CollectReplicaSetAttributes,label:"Collect ReplicaSet attributes"},{id:j.CollectWorkloadId,label:"Collect workload ID"},{id:j.CollectClusterId,label:"Collect cluster ID"}],ql=[{id:Z.Pod,label:Z.Pod},{id:Z.Namespace,label:Z.Namespace},{id:Z.Node,label:Z.Node}],Zl=[{label:"Label key",keyName:"labelKey",placeholder:"app.kubernetes.io/name"},{label:"Attribute key",keyName:"attributeKey",placeholder:"app.kubernetes.name"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:ql}],Ql=[{label:"Annotation key",keyName:"annotationKey",placeholder:"kubectl.kubernetes.io/restartedAt"},{label:"Attribute key",keyName:"attributeKey",placeholder:"kubectl.kubernetes.restartedAt"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:ql}],es=/^[a-zA-Z]$/,ts=new Set(["*","+","?"]),ns=new Set(["^","$"]),os={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"},as=g.div`
2
2
  padding: 8px 16px;
3
3
  border-radius: 6px;
4
4
  border: 1px solid ${({theme:e})=>e.v2.colors.silver[500]};
@@ -18,9 +18,9 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
18
18
  box-decoration-break: clone;
19
19
  -webkit-box-decoration-break: clone;
20
20
  }
21
- `,ls=m.span`
22
- background: ${({$kind:e})=>as[e]};
23
- `,ss=({pattern:e,"data-id":o})=>{const n=a(()=>(e=>{const t=[];let o=0,n=!1;const a=(e,o)=>{const n=t[t.length-1];n&&n.kind===o?n.text+=e:t.push({text:e,kind:o})};for(;o<e.length;){const t=e[o];if(n){if("]"===t){a("]","class-bracket"),n=!1,o++;continue}if("\\"===t&&o+1<e.length){a(e.slice(o,o+2),"class-content"),o+=2;continue}a(t,"class-content"),o++}else{if("("===t&&"?"===e[o+1]){let t=2;const n=e[o+2];if(":"===n||"="===n||"!"===n)t=3;else if("<"===n){const n=e[o+3];if("="===n||"!"===n)t=4;else{const n=e.indexOf(">",o+2);-1!==n&&(t=n-o+1)}}a(e.slice(o,o+t),"group"),o+=t;continue}if("("!==t&&")"!==t)if("["!==t)if(os.has(t)||ns.has(t))a(t,"anchor-quantifier"),o++;else{if("{"===t){const t=e.indexOf("}",o);if(t>o&&/^\{\d+,?\d*\}$/.test(e.slice(o,t+1))){a(e.slice(o,t+1),"anchor-quantifier"),o=t+1;continue}}if("\\"===t&&o+1<e.length){const t=e[o+1];ts.test(t)?a(e.slice(o,o+2),"anchor-quantifier"):a(e.slice(o,o+2),"literal"),o+=2;continue}"|"!==t?(a(t,"literal"),o++):(a("|","alternation"),o++)}else"^"===e[o+1]?(a("[^","class-bracket"),o+=2):(a("[","class-bracket"),o++),n=!0;else a(t,"group"),o++}}return t})(e),[e]);return t(is,e?{"data-id":o,children:n.map((e,o)=>t(ls,{$kind:e.kind,children:e.text},o))}:{"data-id":o,children:" "})},rs="rgba(102, 191, 255, 0.5)",cs=b`
21
+ `,is=g.span`
22
+ background: ${({$kind:e})=>os[e]};
23
+ `,ls=({pattern:e,"data-id":n})=>{const o=a(()=>(e=>{const t=[];let n=0,o=!1;const a=(e,n)=>{const o=t[t.length-1];o&&o.kind===n?o.text+=e:t.push({text:e,kind:n})};for(;n<e.length;){const t=e[n];if(o){if("]"===t){a("]","class-bracket"),o=!1,n++;continue}if("\\"===t&&n+1<e.length){a(e.slice(n,n+2),"class-content"),n+=2;continue}a(t,"class-content"),n++}else{if("("===t&&"?"===e[n+1]){let t=2;const o=e[n+2];if(":"===o||"="===o||"!"===o)t=3;else if("<"===o){const o=e[n+3];if("="===o||"!"===o)t=4;else{const o=e.indexOf(">",n+2);-1!==o&&(t=o-n+1)}}a(e.slice(n,n+t),"group"),n+=t;continue}if("("!==t&&")"!==t)if("["!==t)if(ts.has(t)||ns.has(t))a(t,"anchor-quantifier"),n++;else{if("{"===t){const t=e.indexOf("}",n);if(t>n&&/^\{\d+,?\d*\}$/.test(e.slice(n,t+1))){a(e.slice(n,t+1),"anchor-quantifier"),n=t+1;continue}}if("\\"===t&&n+1<e.length){const t=e[n+1];es.test(t)?a(e.slice(n,n+2),"anchor-quantifier"):a(e.slice(n,n+2),"literal"),n+=2;continue}"|"!==t?(a(t,"literal"),n++):(a("|","alternation"),n++)}else"^"===e[n+1]?(a("[^","class-bracket"),n+=2):(a("[","class-bracket"),n++),o=!0;else a(t,"group"),n++}}return t})(e),[e]);return t(as,e?{"data-id":n,children:o.map((e,n)=>t(is,{$kind:e.kind,children:e.text},n))}:{"data-id":n,children:" "})},ss="rgba(102, 191, 255, 0.5)",rs=b`
24
24
  font-family: ${({theme:e})=>e.font_family.code};
25
25
  font-size: 12px;
26
26
  line-height: 20px;
@@ -33,7 +33,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
33
33
  -moz-tab-size: 4;
34
34
  tab-size: 4;
35
35
  margin: 0;
36
- `,ds=m.div`
36
+ `,cs=g.div`
37
37
  position: relative;
38
38
  width: 100%;
39
39
  min-height: ${({$minHeight:e})=>e}px;
@@ -45,8 +45,8 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
45
45
  &:focus-within {
46
46
  border-color: ${({theme:e})=>e.v2.colors.silver[300]};
47
47
  }
48
- `,us=m.div`
49
- ${cs}
48
+ `,ds=g.div`
49
+ ${rs}
50
50
  position: absolute;
51
51
  inset: 0;
52
52
  padding: 12px;
@@ -59,8 +59,8 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
59
59
  box-decoration-break: clone;
60
60
  -webkit-box-decoration-break: clone;
61
61
  }
62
- `,ps=m.textarea`
63
- ${cs}
62
+ `,us=g.textarea`
63
+ ${rs}
64
64
  position: relative;
65
65
  z-index: 1;
66
66
  display: block;
@@ -78,18 +78,18 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
78
78
  &::placeholder {
79
79
  color: ${({theme:e})=>e.v2.colors.silver[600]};
80
80
  }
81
- `,hs=e=>({before:e,matchPre:"",capture:"",matchPost:"",after:""}),gs=({regex:o,value:n,onChange:s,minHeight:r=240,...c})=>{const d=i(null),u=i(null),p=a(()=>((e,t)=>{if(!e||!t)return hs(t);let o;try{o=new RegExp(e)}catch{return hs(t)}const n=o.exec(t);if(!n)return hs(t);const a=n.index,i=n.index+n[0].length;if(n.length<2||null==n[1])return{before:t.slice(0,a),matchPre:"",capture:t.slice(a,i),matchPost:"",after:t.slice(i)};const l=n[0].indexOf(n[1]),s=l>=0?a+l:a,r=s+n[1].length;return{before:t.slice(0,a),matchPre:t.slice(a,s),capture:t.slice(s,r),matchPost:t.slice(r,i),after:t.slice(i)}})(o,n),[o,n]),h=l(()=>{d.current&&u.current&&(d.current.scrollTop=u.current.scrollTop,d.current.scrollLeft=u.current.scrollLeft)},[]);return e(ds,{$minHeight:r,children:[e(us,{ref:d,"aria-hidden":!0,children:[p.before,t("span",{style:{background:rs},children:p.matchPre}),t("span",{style:{background:"rgba(102, 242, 102, 0.5)"},children:p.capture}),t("span",{style:{background:rs},children:p.matchPost}),p.after,n.endsWith("\n")?" ":""]}),t(ps,{ref:u,$minHeight:r,value:n,onChange:e=>s(e.target.value),onScroll:h,spellCheck:!1,...c})]})},ms=m.div`
81
+ `,ps=e=>({before:e,matchPre:"",capture:"",matchPost:"",after:""}),hs=({regex:n,value:o,onChange:s,minHeight:r=240,...c})=>{const d=i(null),u=i(null),p=a(()=>((e,t)=>{if(!e||!t)return ps(t);let n;try{n=new RegExp(e)}catch{return ps(t)}const o=n.exec(t);if(!o)return ps(t);const a=o.index,i=o.index+o[0].length;if(o.length<2||null==o[1])return{before:t.slice(0,a),matchPre:"",capture:t.slice(a,i),matchPost:"",after:t.slice(i)};const l=o[0].indexOf(o[1]),s=l>=0?a+l:a,r=s+o[1].length;return{before:t.slice(0,a),matchPre:t.slice(a,s),capture:t.slice(s,r),matchPost:t.slice(r,i),after:t.slice(i)}})(n,o),[n,o]),h=l(()=>{d.current&&u.current&&(d.current.scrollTop=u.current.scrollTop,d.current.scrollLeft=u.current.scrollLeft)},[]);return e(cs,{$minHeight:r,children:[e(ds,{ref:d,"aria-hidden":!0,children:[p.before,t("span",{style:{background:ss},children:p.matchPre}),t("span",{style:{background:"rgba(102, 242, 102, 0.5)"},children:p.capture}),t("span",{style:{background:ss},children:p.matchPost}),p.after,o.endsWith("\n")?" ":""]}),t(us,{ref:u,$minHeight:r,value:o,onChange:e=>s(e.target.value),onScroll:h,spellCheck:!1,...c})]})},ms=g.div`
82
82
  flex: 1;
83
83
  min-height: 0;
84
84
  overflow-y: auto;
85
- `,fs=m.div`
85
+ `,gs=g.div`
86
86
  background: ${({theme:e})=>e.v2.colors.silver[900]};
87
87
  border-radius: 8px;
88
88
  padding: 8px;
89
89
  display: flex;
90
90
  flex-direction: column;
91
91
  gap: 12px;
92
- `,bs=m.div`
92
+ `,fs=g.div`
93
93
  padding: 8px 16px;
94
94
  border-radius: 8px;
95
95
  background: ${({theme:e})=>e.v2.colors.silver[800]};
@@ -100,7 +100,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
100
100
  word-break: break-all;
101
101
  white-space: pre-wrap;
102
102
  user-select: text;
103
- `,vs=({isOpen:o,regex:n,onClose:i,initialTestString:l=""})=>{const[r,c]=s(l),d=a(()=>((e,t)=>{if(!e)return{ok:!0,isMatch:!1,message:ne.RESULT_EMPTY_REGEX};if(!t)return{ok:!0,isMatch:!1,message:ne.RESULT_EMPTY_INPUT};let o;try{o=new RegExp(e)}catch(e){return{ok:!1,message:e instanceof Error?e.message:ne.RESULT_INVALID_REGEX_FALLBACK}}const n=o.exec(t);return n?{ok:!0,isMatch:!0,message:n.length>1?n[1]:n[0]}:{ok:!0,isMatch:!1,message:ne.RESULT_NO_MATCH}})(n,r),[n,r]),u=d.ok?d.isMatch?"match":"neutral":"error";return t(oe,{isOpen:o,header:{title:ne.TITLE,onClose:()=>{c(""),i()}},children:t(ms,{children:e(fs,{children:[e(W,{$gap:6,children:[t(K,{label:ne.REGEX_LABEL}),t(ss,{pattern:n,"data-id":"regex-tester-regex"}),!n&&t(ae,{size:le.XXS,color:ie.Secondary,children:ne.REGEX_EMPTY_HINT})]}),e(W,{$gap:6,children:[e(se,{$width:"100%",$justifyContent:"space-between",$alignItems:"center",children:[t(K,{label:ne.TEST_STRING_LABEL}),t(re,{"data-id":"regex-tester-unescape",label:ne.UNESCAPE_LABEL,tooltip:ne.UNESCAPE_TOOLTIP,variant:de.Secondary,size:ce.S,onClick:()=>c(e=>(e=>{let t="";for(let o=0;o<e.length;o++){if("\\"===e[o]&&o+1<e.length){const n=e[o+1],a="n"===n?"\n":"t"===n?"\t":"r"===n?"\r":'"'===n?'"':"'"===n?"'":"\\"===n?"\\":null;if(null!=a){t+=a,o++;continue}}t+=e[o]}return t})(e)),disabled:(p=r,!/\\["'\\nrt]/.test(p))})]}),t(gs,{name:"regex-tester-test-string","data-id":"regex-tester-test-string",placeholder:ne.TEST_STRING_PLACEHOLDER,regex:n,value:r,onChange:c,minHeight:240}),t(J,{helpMessage:ne.TEST_STRING_HELP})]}),e(W,{$gap:8,children:[t(K,{label:ne.RESULT_LABEL}),t(bs,{$tone:u,"data-id":"regex-tester-result",children:d.message}),d.ok&&d.isMatch&&t(ae,{size:le.XXS,color:ie.Secondary,children:ne.RESULT_CAPTURE_HINT})]})]})})});var p},ys=j.ExtractAttribute;var Cs;!function(e){e.Preset="preset",e.Regex="regex"}(Cs||(Cs={}));const Ss=[he.JSON,he.SQL,he.ResourcePath],ws=(e=he.JSON)=>({targetAttributeName:"",lookupKey:"",dataFormat:e,regex:""}),xs=e=>!!e.regex&&!e.lookupKey&&!e.dataFormat,Ts=m.div`
103
+ `,bs=({isOpen:n,regex:o,onClose:i,initialTestString:l=""})=>{const[r,c]=s(l),d=a(()=>((e,t)=>{if(!e)return{ok:!0,isMatch:!1,message:oe.RESULT_EMPTY_REGEX};if(!t)return{ok:!0,isMatch:!1,message:oe.RESULT_EMPTY_INPUT};let n;try{n=new RegExp(e)}catch(e){return{ok:!1,message:e instanceof Error?e.message:oe.RESULT_INVALID_REGEX_FALLBACK}}const o=n.exec(t);return o?{ok:!0,isMatch:!0,message:o.length>1?o[1]:o[0]}:{ok:!0,isMatch:!1,message:oe.RESULT_NO_MATCH}})(o,r),[o,r]),u=d.ok?d.isMatch?"match":"neutral":"error";return t(ne,{isOpen:n,header:{title:oe.TITLE,onClose:()=>{c(""),i()}},children:t(ms,{children:e(gs,{children:[e(W,{$gap:6,children:[t(K,{label:oe.REGEX_LABEL}),t(ls,{pattern:o,"data-id":"regex-tester-regex"}),!o&&t(ae,{size:le.XXS,color:ie.Secondary,children:oe.REGEX_EMPTY_HINT})]}),e(W,{$gap:6,children:[e(se,{$width:"100%",$justifyContent:"space-between",$alignItems:"center",children:[t(K,{label:oe.TEST_STRING_LABEL}),t(re,{"data-id":"regex-tester-unescape",label:oe.UNESCAPE_LABEL,tooltip:oe.UNESCAPE_TOOLTIP,variant:de.Secondary,size:ce.S,onClick:()=>c(e=>(e=>{let t="";for(let n=0;n<e.length;n++){if("\\"===e[n]&&n+1<e.length){const o=e[n+1],a="n"===o?"\n":"t"===o?"\t":"r"===o?"\r":'"'===o?'"':"'"===o?"'":"\\"===o?"\\":null;if(null!=a){t+=a,n++;continue}}t+=e[n]}return t})(e)),disabled:(p=r,!/\\["'\\nrt]/.test(p))})]}),t(hs,{name:"regex-tester-test-string","data-id":"regex-tester-test-string",placeholder:oe.TEST_STRING_PLACEHOLDER,regex:o,value:r,onChange:c,minHeight:240}),t(J,{helpMessage:oe.TEST_STRING_HELP})]}),e(W,{$gap:8,children:[t(K,{label:oe.RESULT_LABEL}),t(fs,{$tone:u,"data-id":"regex-tester-result",children:d.message}),d.ok&&d.isMatch&&t(ae,{size:le.XXS,color:ie.Secondary,children:oe.RESULT_CAPTURE_HINT})]})]})})});var p},vs=j.ExtractAttribute;var ys;!function(e){e.Preset="preset",e.Regex="regex"}(ys||(ys={}));const Cs=[he.JSON,he.SQL,he.ResourcePath],Ss=(e=he.JSON)=>({targetAttributeName:"",lookupKey:"",dataFormat:e,regex:""}),ws=e=>!!e.regex&&!e.lookupKey&&!e.dataFormat,xs=g.div`
104
104
  width: 100%;
105
105
  background: ${({theme:e})=>e.v2.colors.silver[800]};
106
106
  border-radius: 8px;
@@ -108,13 +108,13 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
108
108
  display: flex;
109
109
  flex-direction: column;
110
110
  gap: 8px;
111
- `,ks=m.div`
111
+ `,ks=g.div`
112
112
  flex: 1;
113
113
  min-width: 0;
114
- `,$s=m.div`
114
+ `,Ts=g.div`
115
115
  /* Pushes the arrow down to sit next to the inputs rather than the field titles. */
116
116
  padding-top: 24px;
117
- `,Es=e=>Object.entries(e||{}).map(([e,t])=>({oldKey:e,newKey:t})),Is=e=>{const t={};return e.forEach(({oldKey:e,newKey:o})=>{t[e]=o}),t},As=j.UrlTemplatizationRulesGroups,Ns=[{keyName:"kind",label:"Kind",placeholder:"Any kind",componentType:"dropdown",options:[{id:"Deployment",label:"Deployment"},{id:"StatefulSet",label:"StatefulSet"},{id:"DaemonSet",label:"DaemonSet"}]},{keyName:"name",label:"Name",placeholder:"Any name"}],Os={[ye.K8sAttributes]:({value:a,setValue:i,formErrors:l})=>(n(()=>{a[j.CollectContainerAttributes]||a[j.CollectReplicaSetAttributes]||a[j.CollectWorkloadId]||a[j.CollectClusterId]||a[j.LabelsAttributes]?.length||a[j.AnnotationsAttributes]?.length||(i(j.CollectContainerAttributes,!0),i(j.CollectReplicaSetAttributes,!0),i(j.CollectWorkloadId,!0),i(j.CollectClusterId,!0),i(j.LabelsAttributes,[]),i(j.AnnotationsAttributes,[]))},[]),e(o,{children:[t(W,{$gap:6,children:ql.map(({id:o,label:n})=>e(W,{children:[t(Y,{label:n,value:a[o]||!1,onChange:e=>i(o,e)}),t(J,{errorMessage:l[o]})]},o))}),t(q,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:Ql,values:a[j.LabelsAttributes]||[],setValues:e=>i(j.LabelsAttributes,e),errorMessage:l[j.LabelsAttributes]}),t(q,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:es,values:a[j.AnnotationsAttributes]||[],setValues:e=>i(j.AnnotationsAttributes,e),errorMessage:l[j.AnnotationsAttributes]})]})),[ye.AddClusterInfo]:({value:n,setValue:a,formErrors:i})=>{const l=f();return e(o,{children:[t(Q,{label:"Overwrite existing values",labelAlign:ee.Left,labelColor:l.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:n[j.OverwriteExistingValues]||!1,onChange:e=>a(j.OverwriteExistingValues,e)}),t(q,{name:"clusterAttributes",label:"Resource attributes",limitFieldsPerRow:2,columns:[{keyName:"attributeName",label:"Attribute name",placeholder:"Attribute name"},{keyName:"attributeStringValue",label:"Attribute value",placeholder:"Attribute value"}],values:n[j.ClusterAttributes]||[],setValues:e=>a(j.ClusterAttributes,e),errorMessage:i[j.ClusterAttributes]})]})},[ye.DeleteAttributes]:({value:e,setValue:o,formErrors:n})=>t(te,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[j.AttributeNamesToDelete]||[],setValues:e=>o(j.AttributeNamesToDelete,e),errorMessage:n[j.AttributeNamesToDelete]}),[ye.RenameAttributes]:({value:e,setValue:o,formErrors:a})=>{const i=e[j.Renames],[l,r]=s(()=>Es(i));return n(()=>{((e,t)=>{const o=Object.keys(e),n=Object.keys(t);return o.length===n.length&&o.every(o=>Object.prototype.hasOwnProperty.call(t,o)&&t[o]===e[o])})(Is(l),i||{})||r(Es(i))},[i]),t(q,{name:"renames",label:"Attributes to rename",limitFieldsPerRow:2,columns:[{keyName:"oldKey",label:"Old key",placeholder:"Old key"},{keyName:"newKey",label:"New key",placeholder:"New key"}],values:l,setValues:e=>{const t=e.map(e=>({oldKey:String(e.oldKey??""),newKey:String(e.newKey??"")}));r(t),o(j.Renames,Is(t))},errorMessage:a[j.Renames]})},[ye.PiiMasking]:({value:o,setValue:a,formErrors:i})=>(n(()=>{o[j.PiiCategories]?.length||a(j.PiiCategories,Jl.map(({id:e})=>e))},[]),e(W,{$gap:12,children:[t(K,{label:"Attributes to mask"}),t(W,{$gap:6,children:Jl.map(({id:e,label:n})=>t(Y,{label:n,value:o[j.PiiCategories]?.includes(e)||!1,onChange:t=>{const n=o[j.PiiCategories]||[],i=t?[...n,e]:n.filter(t=>t!==e);a(j.PiiCategories,i)}},e))}),t(J,{errorMessage:i[j.PiiCategories]})]})),[ye.URLTemplatization]:({value:n,setValue:a,formErrors:i})=>{const l=f(),s=n[As]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>a(As,e),d=(e,t)=>c(s.map((o,n)=>n===e?{...o,...t}:o));return e(o,{children:[s.map((o,n)=>e(r,{children:[t(ve,{}),e(W,{$gap:12,children:[e(se,{$justifyContent:"space-between",$alignItems:"center",children:[t(K,{label:`Rule Group ${n+1}`}),t(re,{leftIcon:()=>t(ri,{fill:l.v2.colors.red[500]}),variant:de.Secondary,size:ce.S,onClick:()=>{return e=n,c(s.filter((t,o)=>o!==e));var e},disabled:1===s.length})]}),t(be,{name:`urlGroup-${n}-namespace`,label:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:o.filterK8sNamespace||"",onChange:e=>d(n,{filterK8sNamespace:e.target.value})}),t(q,{name:`urlGroup-${n}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:Ns,values:o.workloadFilters||[],setValues:e=>d(n,{workloadFilters:e})}),t(te,{name:`urlGroup-${n}-templates`,label:"Templates",required:!0,placeholder:"e.g. /user/{id}",values:o.templatizationRules.map(e=>e.template),setValues:e=>d(n,{templatizationRules:e.map(e=>({template:e}))})})]}),t(J,{errorMessage:i[As]})]},`url-templatization-group-${n}`)),t(re,{variant:de.Secondary,label:"Add rule group",leftIcon:ci,onClick:()=>c([...s,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(ve,{})]})},[ye.ExtractAttribute]:({value:o,setValue:a,formErrors:i})=>{const l=f(),r=i[ys],c=o[ys]?.extractions||[],[d,u]=s(()=>(e=>e.length&&e.some(xs)?Cs.Regex:Cs.Preset)(c)),[p,h]=s(null),g=e=>a(ys,{extractions:e});n(()=>{0===c.length&&g([d===Cs.Preset?ws():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},[]);const m=(e,t)=>{g(c.map((o,n)=>n===e?{...o,...t}:o))},b=()=>{g([...c,d===Cs.Preset?ws():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},v=d===Cs.Preset,y=c.length?c:[v?ws():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}],C=null!=p&&y[p]?.regex||"";return e(W,{$gap:16,$width:"100%",children:[t(ue,{options:[{value:Cs.Preset,label:pe.SEGMENT_PRESET_LABEL,tooltip:pe.SEGMENT_PRESET_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]},{value:Cs.Regex,label:pe.SEGMENT_REGEX_LABEL,tooltip:pe.SEGMENT_REGEX_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]}],selected:d,setSelected:e=>{u(e),g([e===Cs.Preset?ws():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])}}),e(W,{$gap:8,$width:"100%",children:[y.map((o,n)=>{const a=n===y.length-1,i=o.dataFormat||he.JSON,s=me[i];return e(Ts,{"data-id":`extract-row-${n}`,children:[e(se,{$gap:10,$alignItems:"flex-start",$width:"100%",$justifyContent:"space-between",children:[e(W,{$gap:10,children:[t(K,{label:v?pe.PRESET_ROW_TITLE(n):pe.REGEX_ROW_TITLE(n)}),v&&t(se,{$gap:24,children:Ss.map(e=>t(ge,{"data-id":`extract-row-${n}-fmt-${e}`,size:fe.L,label:me[e].label,value:i===e,onChange:t=>t&&m(n,{dataFormat:e})},`extract-row-${n}-fmt-${e}`))})]}),e(se,{$gap:4,$alignItems:"center",children:[!v&&t(re,{"data-id":`extract-row-${n}-test-regex`,label:pe.TEST_REGEX_LABEL,variant:de.Secondary,size:ce.S,onClick:()=>h(n),disabled:!o.regex?.trim()}),t(re,{"data-id":`extract-row-${n}-delete`,leftIcon:()=>t(ri,{fill:l.v2.colors.red[500]}),variant:de.Secondary,size:ce.S,onClick:()=>(e=>{const t=c.filter((t,o)=>o!==e);g(t.length?t:[d===Cs.Preset?ws():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])})(n)}),a&&t(re,{"data-id":`extract-row-${n}-add`,leftIcon:ci,variant:de.Secondary,size:ce.S,onClick:b})]})]}),v?e(se,{$gap:8,$alignItems:"flex-start",$width:"100%",children:[t(ks,{children:t(be,{name:`extract-row-${n}-lookupKey`,label:s.keyLabel,placeholder:s.placeholder,helpMessage:s.helpMessage,width:"100%",value:o.lookupKey||"",onChange:e=>m(n,{lookupKey:e.target.value})})}),t($s,{children:t(di,{size:24,fill:l.v2.colors.silver[200]})}),t(ks,{children:t(be,{name:`extract-row-${n}-targetAttributeName`,label:pe.TARGET_LABEL,placeholder:pe.TARGET_PLACEHOLDER,helpMessage:pe.TARGET_HELP,width:"100%",value:o.targetAttributeName||"",onChange:e=>m(n,{targetAttributeName:e.target.value})})})]}):e(W,{$gap:12,$width:"100%",children:[t(be,{name:`extract-row-${n}-regex`,label:pe.REGEX_LABEL,placeholder:pe.REGEX_PLACEHOLDER,helpMessage:pe.REGEX_HELP,width:"100%",value:o.regex||"",onChange:e=>m(n,{regex:e.target.value})}),t(be,{name:`extract-row-${n}-targetAttributeName`,label:pe.TARGET_LABEL,placeholder:pe.TARGET_PLACEHOLDER,helpMessage:pe.TARGET_HELP,width:"100%",value:o.targetAttributeName||"",onChange:e=>m(n,{targetAttributeName:e.target.value})})]})]},`extract-row-${n}`)}),t(J,{errorMessage:r})]}),t(vs,{isOpen:null!=p,regex:C,onClose:()=>h(null)})]})}},Rs=({actionType:e,value:o,setValue:n,formErrors:a})=>{if(!e)return null;const i=Os[e];return i?t(i,{value:o,setValue:n,formErrors:a}):null},Ds=()=>{const o=f(),{selectedOption:n,genericForm:a}=Al();if(!a||!n)return t(Ce,{title:"No active form"});const{formData:i,handleFormChange:l,formErrors:s}=a;return e(W,{$gap:24,children:[e(se,{$gap:12,$justifyContent:"space-between",children:[t(Se,{size:le.XXXS,maxLines:2,children:n.docsDescription}),e(se,{$gap:12,children:[t(ue,{options:[{icon:ui,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:pi,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],size:we.S,selected:i.disabled,setSelected:e=>l("disabled",e)}),t(re,{leftIcon:hi,variant:de.Secondary,size:ce.S,onClick:()=>window.open(`${xe}${n.docsEndpoint}`,"_blank","noopener noreferrer")})]})]}),t(rl,{title:"Signals for processing",allowedSignals:n.allowedSignals,selectedSignals:i.signals||[],setSelectedSignals:e=>l("signals",e),errorMessage:s.signals}),t(be,{name:"actionName",label:"Action name",placeholder:"Use a name that describes the action...",value:i.name||"",onChange:({target:{value:e}})=>l("name",e),errorMessage:s.name}),t(Rs,{actionType:n.type,value:i.fields,setValue:(e,t)=>l(`fields.${e}`,t),formErrors:s}),t(Te,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:i.notes||"",onChange:({target:{value:e}})=>l("notes",e),errorMessage:s.notes})]})},Ps=({signals:e,fields:o,disabled:n,formData:a,handleFormChange:i,formErrors:l})=>o?.map(({renderCondition:o,componentType:s,type:r,name:c,title:d,tooltip:u,placeholder:p,value:h,required:g,options:m})=>{if(!(!o||ke(o,e,a.fields)))return null;const f=c,b=a.fields.find(e=>e.key===f),v=b?b.value:h;return t(cl,{componentType:s,inputType:r,name:f,label:d,tooltip:u,disabled:n,required:g,placeholder:p,errorMessage:l[f],dropdownOptions:m,value:v||"",setValue:e=>i(f,e)},f)}),Fs=m(se)`
117
+ `,$s=e=>Object.entries(e||{}).map(([e,t])=>({oldKey:e,newKey:t})),Is=e=>{const t={};return e.forEach(({oldKey:e,newKey:n})=>{t[e]=n}),t},Es=j.UrlTemplatizationRulesGroups,As=[{keyName:"kind",label:"Kind",placeholder:"Any kind",componentType:"dropdown",options:[{id:"Deployment",label:"Deployment"},{id:"StatefulSet",label:"StatefulSet"},{id:"DaemonSet",label:"DaemonSet"}]},{keyName:"name",label:"Name",placeholder:"Any name"}],Ns={[ye.K8sAttributes]:({value:a,setValue:i,formErrors:l})=>(o(()=>{a[j.CollectContainerAttributes]||a[j.CollectReplicaSetAttributes]||a[j.CollectWorkloadId]||a[j.CollectClusterId]||a[j.LabelsAttributes]?.length||a[j.AnnotationsAttributes]?.length||(i(j.CollectContainerAttributes,!0),i(j.CollectReplicaSetAttributes,!0),i(j.CollectWorkloadId,!0),i(j.CollectClusterId,!0),i(j.LabelsAttributes,[]),i(j.AnnotationsAttributes,[]))},[]),e(n,{children:[t(W,{$gap:6,children:Jl.map(({id:n,label:o})=>e(W,{children:[t(Y,{label:o,value:a[n]||!1,onChange:e=>i(n,e)}),t(J,{errorMessage:l[n]})]},n))}),t(q,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:Zl,values:a[j.LabelsAttributes]||[],setValues:e=>i(j.LabelsAttributes,e),errorMessage:l[j.LabelsAttributes]}),t(q,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:Ql,values:a[j.AnnotationsAttributes]||[],setValues:e=>i(j.AnnotationsAttributes,e),errorMessage:l[j.AnnotationsAttributes]})]})),[ye.AddClusterInfo]:({value:o,setValue:a,formErrors:i})=>{const l=f();return e(n,{children:[t(Q,{label:"Overwrite existing values",labelAlign:ee.Left,labelColor:l.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:o[j.OverwriteExistingValues]||!1,onChange:e=>a(j.OverwriteExistingValues,e)}),t(q,{name:"clusterAttributes",label:"Resource attributes",limitFieldsPerRow:2,columns:[{keyName:"attributeName",label:"Attribute name",placeholder:"Attribute name"},{keyName:"attributeStringValue",label:"Attribute value",placeholder:"Attribute value"}],values:o[j.ClusterAttributes]||[],setValues:e=>a(j.ClusterAttributes,e),errorMessage:i[j.ClusterAttributes]})]})},[ye.DeleteAttributes]:({value:e,setValue:n,formErrors:o})=>t(te,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[j.AttributeNamesToDelete]||[],setValues:e=>n(j.AttributeNamesToDelete,e),errorMessage:o[j.AttributeNamesToDelete]}),[ye.RenameAttributes]:({value:e,setValue:n,formErrors:a})=>{const i=e[j.Renames],[l,r]=s(()=>$s(i));return o(()=>{((e,t)=>{const n=Object.keys(e),o=Object.keys(t);return n.length===o.length&&n.every(n=>Object.prototype.hasOwnProperty.call(t,n)&&t[n]===e[n])})(Is(l),i||{})||r($s(i))},[i]),t(q,{name:"renames",label:"Attributes to rename",limitFieldsPerRow:2,columns:[{keyName:"oldKey",label:"Old key",placeholder:"Old key"},{keyName:"newKey",label:"New key",placeholder:"New key"}],values:l,setValues:e=>{const t=e.map(e=>({oldKey:String(e.oldKey??""),newKey:String(e.newKey??"")}));r(t),n(j.Renames,Is(t))},errorMessage:a[j.Renames]})},[ye.PiiMasking]:({value:n,setValue:a,formErrors:i})=>(o(()=>{n[j.PiiCategories]?.length||a(j.PiiCategories,Yl.map(({id:e})=>e))},[]),e(W,{$gap:12,children:[t(K,{label:"Attributes to mask"}),t(W,{$gap:6,children:Yl.map(({id:e,label:o})=>t(Y,{label:o,value:n[j.PiiCategories]?.includes(e)||!1,onChange:t=>{const o=n[j.PiiCategories]||[],i=t?[...o,e]:o.filter(t=>t!==e);a(j.PiiCategories,i)}},e))}),t(J,{errorMessage:i[j.PiiCategories]})]})),[ye.URLTemplatization]:({value:o,setValue:a,formErrors:i})=>{const l=f(),s=o[Es]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>a(Es,e),d=(e,t)=>c(s.map((n,o)=>o===e?{...n,...t}:n));return e(n,{children:[s.map((n,o)=>e(r,{children:[t(ve,{}),e(W,{$gap:12,children:[e(se,{$justifyContent:"space-between",$alignItems:"center",children:[t(K,{label:`Rule Group ${o+1}`}),t(re,{leftIcon:()=>t(li,{fill:l.v2.colors.red[500]}),variant:de.Secondary,size:ce.S,onClick:()=>{return e=o,c(s.filter((t,n)=>n!==e));var e},disabled:1===s.length})]}),t(be,{name:`urlGroup-${o}-namespace`,label:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:n.filterK8sNamespace||"",onChange:e=>d(o,{filterK8sNamespace:e.target.value})}),t(q,{name:`urlGroup-${o}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:As,values:n.workloadFilters||[],setValues:e=>d(o,{workloadFilters:e})}),t(te,{name:`urlGroup-${o}-templates`,label:"Templates",required:!0,placeholder:"e.g. /user/{id}",values:n.templatizationRules.map(e=>e.template),setValues:e=>d(o,{templatizationRules:e.map(e=>({template:e}))})})]}),t(J,{errorMessage:i[Es]})]},`url-templatization-group-${o}`)),t(re,{variant:de.Secondary,label:"Add rule group",leftIcon:si,onClick:()=>c([...s,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(ve,{})]})},[ye.ExtractAttribute]:({value:n,setValue:a,formErrors:i})=>{const l=f(),r=i[vs],c=n[vs]?.extractions||[],[d,u]=s(()=>(e=>e.length&&e.some(ws)?ys.Regex:ys.Preset)(c)),[p,h]=s(null),m=e=>a(vs,{extractions:e});o(()=>{0===c.length&&m([d===ys.Preset?Ss():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},[]);const g=(e,t)=>{m(c.map((n,o)=>o===e?{...n,...t}:n))},b=()=>{m([...c,d===ys.Preset?Ss():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},v=d===ys.Preset,y=c.length?c:[v?Ss():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}],C=null!=p&&y[p]?.regex||"";return e(W,{$gap:16,$width:"100%",children:[t(ue,{options:[{value:ys.Preset,label:pe.SEGMENT_PRESET_LABEL,tooltip:pe.SEGMENT_PRESET_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]},{value:ys.Regex,label:pe.SEGMENT_REGEX_LABEL,tooltip:pe.SEGMENT_REGEX_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]}],selected:d,setSelected:e=>{u(e),m([e===ys.Preset?Ss():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])}}),e(W,{$gap:8,$width:"100%",children:[y.map((n,o)=>{const a=o===y.length-1,i=n.dataFormat||he.JSON,s=ge[i];return e(xs,{"data-id":`extract-row-${o}`,children:[e(se,{$gap:10,$alignItems:"flex-start",$width:"100%",$justifyContent:"space-between",children:[e(W,{$gap:10,children:[t(K,{label:v?pe.PRESET_ROW_TITLE(o):pe.REGEX_ROW_TITLE(o)}),v&&t(se,{$gap:24,children:Cs.map(e=>t(me,{"data-id":`extract-row-${o}-fmt-${e}`,size:fe.L,label:ge[e].label,value:i===e,onChange:t=>t&&g(o,{dataFormat:e})},`extract-row-${o}-fmt-${e}`))})]}),e(se,{$gap:4,$alignItems:"center",children:[!v&&t(re,{"data-id":`extract-row-${o}-test-regex`,label:pe.TEST_REGEX_LABEL,variant:de.Secondary,size:ce.S,onClick:()=>h(o),disabled:!n.regex?.trim()}),t(re,{"data-id":`extract-row-${o}-delete`,leftIcon:()=>t(li,{fill:l.v2.colors.red[500]}),variant:de.Secondary,size:ce.S,onClick:()=>(e=>{const t=c.filter((t,n)=>n!==e);m(t.length?t:[d===ys.Preset?Ss():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])})(o)}),a&&t(re,{"data-id":`extract-row-${o}-add`,leftIcon:si,variant:de.Secondary,size:ce.S,onClick:b})]})]}),v?e(se,{$gap:8,$alignItems:"flex-start",$width:"100%",children:[t(ks,{children:t(be,{name:`extract-row-${o}-lookupKey`,label:s.keyLabel,placeholder:s.placeholder,helpMessage:s.helpMessage,width:"100%",value:n.lookupKey||"",onChange:e=>g(o,{lookupKey:e.target.value})})}),t(Ts,{children:t(ri,{size:24,fill:l.v2.colors.silver[200]})}),t(ks,{children:t(be,{name:`extract-row-${o}-targetAttributeName`,label:pe.TARGET_LABEL,placeholder:pe.TARGET_PLACEHOLDER,helpMessage:pe.TARGET_HELP,width:"100%",value:n.targetAttributeName||"",onChange:e=>g(o,{targetAttributeName:e.target.value})})})]}):e(W,{$gap:12,$width:"100%",children:[t(be,{name:`extract-row-${o}-regex`,label:pe.REGEX_LABEL,placeholder:pe.REGEX_PLACEHOLDER,helpMessage:pe.REGEX_HELP,width:"100%",value:n.regex||"",onChange:e=>g(o,{regex:e.target.value})}),t(be,{name:`extract-row-${o}-targetAttributeName`,label:pe.TARGET_LABEL,placeholder:pe.TARGET_PLACEHOLDER,helpMessage:pe.TARGET_HELP,width:"100%",value:n.targetAttributeName||"",onChange:e=>g(o,{targetAttributeName:e.target.value})})]})]},`extract-row-${o}`)}),t(J,{errorMessage:r})]}),t(bs,{isOpen:null!=p,regex:C,onClose:()=>h(null)})]})}},Os=({actionType:e,value:n,setValue:o,formErrors:a})=>{if(!e)return null;const i=Ns[e];return i?t(i,{value:n,setValue:o,formErrors:a}):null},Rs=()=>{const n=f(),{selectedOption:o,genericForm:a}=El();if(!a||!o)return t(Ce,{title:"No active form"});const{formData:i,handleFormChange:l,formErrors:s}=a;return e(W,{$gap:24,children:[e(se,{$gap:12,$justifyContent:"space-between",children:[t(Se,{size:le.XXXS,maxLines:2,children:o.docsDescription}),e(se,{$gap:12,children:[t(ue,{options:[{icon:ci,label:"Enabled",value:!1,selectedBgColor:n.v2.colors.green[800]},{icon:di,label:"Disabled",value:!0,selectedBgColor:n.v2.colors.red[800]}],size:we.S,selected:i.disabled,setSelected:e=>l("disabled",e)}),t(re,{leftIcon:ui,variant:de.Secondary,size:ce.S,onClick:()=>window.open(`${xe}${o.docsEndpoint}`,"_blank","noopener noreferrer")})]})]}),t(sl,{title:"Signals for processing",allowedSignals:o.allowedSignals,selectedSignals:i.signals||[],setSelectedSignals:e=>l("signals",e),errorMessage:s.signals}),t(be,{name:"actionName",label:"Action name",placeholder:"Use a name that describes the action...",value:i.name||"",onChange:({target:{value:e}})=>l("name",e),errorMessage:s.name}),t(Os,{actionType:o.type,value:i.fields,setValue:(e,t)=>l(`fields.${e}`,t),formErrors:s}),t(ke,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:i.notes||"",onChange:({target:{value:e}})=>l("notes",e),errorMessage:s.notes})]})},Ds=({signals:e,fields:n,disabled:o,formData:a,handleFormChange:i,formErrors:l})=>n?.map(({renderCondition:n,componentType:s,type:r,name:c,title:d,tooltip:u,placeholder:p,value:h,required:m,options:g})=>{if(!(!n||Te(n,e,a.fields)))return null;const f=c,b=a.fields.find(e=>e.key===f),v=b?b.value:h;return t(rl,{componentType:s,inputType:r,name:f,label:d,tooltip:u,disabled:o,required:m,placeholder:p,errorMessage:l[f],dropdownOptions:g,value:v||"",setValue:e=>i(f,e)},f)}),Ps=g(se)`
118
118
  position: sticky;
119
119
  bottom: 4px;
120
120
  align-self: center;
@@ -125,50 +125,50 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
125
125
  background-color: ${({theme:e})=>e.v2.colors.black[500]};
126
126
  box-shadow: 0 4px 16.7px 0 rgba(0, 0, 0, 0.83);
127
127
  z-index: 1;
128
- `,Ls=c(({isEdit:o},a)=>{const i=f(),{isVm:l}=y(),{destinationsApi:r}=sl(),{activeForm:c,genericForm:u,validateFormData:p,thisUnsavedDestination:h,addUnsavedDestination:g,updateUnsavedDestination:m,deleteUnsavedDestination:b}=Nl(),[v,C]=s(h?.testResult),[S,w]=s(!!h);n(()=>{h?(C(h.testResult),w(!0)):(C(void 0),w(!1))},[h]);const x=async()=>{if(!c?.option.testConnectionSupported||!u||l)return;const e=await r.testConnection(Oe(u.formData));return C(e),e};return d(a,()=>({testConnection:x,testConnectionSupported:!!c?.option.testConnectionSupported}),[c?.option.testConnectionSupported,u,r]),u&&c?e(W,{$gap:24,style:{minHeight:"100%"},children:[e(se,{$gap:12,$justifyContent:"space-between",children:[v?v.succeeded?t($e,{status:Ee.Success,message:v.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t($e,{status:Ee.Error,message:v.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),e(se,{$gap:12,children:[!l&&t(ue,{options:[{icon:ui,label:"Enabled",value:!1,selectedBgColor:i.v2.colors.green[800]},{icon:pi,label:"Disabled",value:!0,selectedBgColor:i.v2.colors.red[800]}],size:we.S,selected:u.formData.disabled,setSelected:e=>u.handleFormChange("disabled",e),disabled:S}),t(re,{"data-id":"dest-form-docs",leftIcon:hi,variant:de.Secondary,size:ce.S,onClick:()=>window.open(`${xe}/backends/${c.option.type}`,"_blank","noopener noreferrer")})]})]}),t(rl,{title:"This connection will monitor:",allowedSignals:Ne(c.option.supportedSignals),selectedSignals:Ae(u.formData.exportedSignals),setSelectedSignals:e=>u.handleFormChange("exportedSignals",{logs:e.includes(Ie.Logs),metrics:e.includes(Ie.Metrics),traces:e.includes(Ie.Traces),profiles:e.includes(Ie.Profiles)}),disabled:S,errorMessage:u.formErrors.exportedSignals}),t(be,{name:"destinationName",label:"Destination name",placeholder:"Use a name that describes the destination...",value:u.formData.name,onChange:({target:{value:e}})=>u.handleFormChange("name",e),disabled:S,errorMessage:u.formErrors.name}),t(Ps,{signals:Ae(u.formData.exportedSignals),fields:c.dynamicFields,disabled:S,formData:u.formData,handleFormChange:(e,t)=>{u.handleFormChange("fields",u.formData.fields.map(o=>o.key===e?{...o,value:t}:o)),e&&u.formErrors[e]&&u.handleErrorChange(e,void 0)},formErrors:u.formErrors}),!o&&e(Fs,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(re,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:gi,variant:de.Secondary,textColor:i.v2.colors.red[500],onClick:()=>b(c.unsavedIdx)})}),!l&&(!h||h.option.testConnectionSupported&&!S)&&t("div",{style:{width:"150px"},children:t(re,{"data-id":"dest-form-test-connection",fullWidth:!0,label:"Test Connection",variant:de.Secondary,onClick:x})}),h&&t("div",S?{style:{width:"150px"},children:t(re,{"data-id":"dest-form-edit",fullWidth:!0,label:"Edit",rightIcon:mi,variant:de.Secondary,onClick:()=>w(!1)})}:{style:{width:"150px"},children:t(re,{"data-id":"dest-form-save",fullWidth:!0,label:"Save Changes",variant:de.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await x(),o=!!e&&!e.succeeded;m(c.unsavedIdx,{formData:t,testResult:e},o)}}})}),!h&&t("div",{style:{width:"150px"},children:t(re,{"data-id":"dest-form-add",fullWidth:!0,label:"Add Destination",variant:de.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await x(),o=!!e&&!e.succeeded;g({formData:t,testResult:e},o)}}})})]})]}):t(Ce,{title:"No active form"})});Ls.displayName="AddDestinationForm";const _s=[{id:Re.FilePath,label:"Collect file path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Re.Function,label:"Collect function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Re.LineNumber,label:"Collect line number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],zs=[{id:Re.Column,label:"Collect column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Re.Namespace,label:"Collect namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Re.StackTrace,label:"Collect stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],Ms=["*"],Bs=[{id:Fe.HttpRequest,label:"Collect HTTP request",tooltip:""},{id:Fe.HttpResponse,label:"Collect HTTP response",tooltip:""},{id:Fe.DbQuery,label:"Collect DB query",tooltip:""},{id:Fe.Messaging,label:"Collect messaging",tooltip:""}],Xs={[ze.Java]:[new _e("","")],[ze.Golang]:[new Le("")]},Vs={[Me.CodeAttributes]:({value:i,setValue:l,formErrors:s})=>{const r=s.codeAttributes,c=a(()=>Object.entries(i.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[i]);n(()=>{if(!c.length&&!r){const e={[Re.FilePath]:!0,[Re.Function]:!0,[Re.LineNumber]:!0,[Re.Column]:null,[Re.Namespace]:null,[Re.StackTrace]:null};l("codeAttributes",e)}},[]);const d=(e,t)=>{const o=t?[...c,e]:c.filter(t=>t!==e),n=Object.values(Re).reduce((e,t)=>(e[t]=!!o.includes(t)||null,e),{});l("codeAttributes",n)};return e(o,{children:[e(W,{$gap:12,children:[t(ae,{size:le.XS,color:ie.Secondary,nowrap:!0,children:"Recommended data to collect"}),t(W,{$gap:6,children:_s.map(({id:e,label:o,tooltip:n})=>t(De,{text:n,withIcon:!0,children:t(Y,{label:o,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(J,{errorMessage:r})]}),e(W,{$gap:12,children:[t(ae,{size:le.XS,color:ie.Secondary,nowrap:!0,children:"Verbose data to collect"}),t(W,{$gap:6,children:zs.map(({id:e,label:o,tooltip:n})=>t(De,{text:n,withIcon:!0,children:t(Y,{label:o,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(J,{errorMessage:r})]})]})},[Me.CustomInstrumentation]:({value:i,setValue:l,formErrors:s})=>{const r=s.customInstrumentations,c=a(()=>(i?.customInstrumentations?.[ze.Golang]||[]).map(e=>new Le(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[i]),d=a(()=>(i?.customInstrumentations?.[ze.Java]||[]).map(e=>new _e(e.className,e.methodName)),[i]);return n(()=>{i?.customInstrumentations||r||l("customInstrumentations",{[ze.Golang]:Xs[ze.Golang],[ze.Java]:Xs[ze.Java]})},[]),e(o,{children:[e(W,{children:[e(se,{$gap:8,children:[t(fi,{}),t(K,{label:"Golang custom probes"})]}),t(q,{name:"golangProbes",columns:[{keyName:"packageName",label:"Package name",placeholder:"e.g. github.com/my-org/my-package",tooltip:"The full import path of the package containing the function or method to be instrumented."},{keyName:"functionName",label:"Function name",placeholder:"e.g. myFunction",tooltip:"The name of the function to be instrumented. Leave empty if instrumenting a receiver method."},{keyName:"receiverName",label:"Receiver name",placeholder:"e.g. myReceiver",tooltip:"The name of the receiver type if instrumenting a method. Leave empty if instrumenting a standalone function."},{keyName:"receiverMethodName",label:"Receiver method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented. Leave empty if instrumenting a standalone function."}],values:c,setValues:e=>{const t={};t[ze.Golang]=e.map(e=>new Le(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),t[ze.Java]=d,l("customInstrumentations",t)},errorMessage:r,limitFieldsPerRow:2})]}),e(W,{children:[e(se,{$gap:8,children:[t(bi,{}),t(K,{label:"Java custom probes"})]}),t(q,{name:"javaProbes",columns:[{keyName:"className",label:"Class name",placeholder:"e.g. com.example.MyClass",tooltip:"The name of the class to be instrumented."},{keyName:"methodName",label:"Method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented."}],values:d,setValues:e=>{const t={};t[ze.Golang]=c,t[ze.Java]=e.map(e=>new _e(e.className,e.methodName)),l("customInstrumentations",t)},errorMessage:r,limitFieldsPerRow:2})]})]})},[Me.HeadersCollection]:({value:e,setValue:o,formErrors:i})=>{const l=i.headersCollection,s=a(()=>e?.headersCollection?.[Pe.HeaderKeys]||[],[e]),r=e=>{const t={[Pe.HeaderKeys]:e};o("headersCollection",t)};return n(()=>{s.length||l||r(Ms)},[]),t(te,{name:"headerKeys",label:"Header keys",tooltip:"Specify which headers you want to collect",helpMessage:"Asterisk (*) will collect all headers",values:s,setValues:r,errorMessage:l})},[Me.PayloadCollection]:({value:o,setValue:i,formErrors:l})=>{const s=l.payloadCollection,r=a(()=>Object.entries(o.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[o]);n(()=>{if(!r.length&&!s){const e={[Fe.HttpRequest]:{},[Fe.HttpResponse]:{},[Fe.DbQuery]:{},[Fe.Messaging]:{}};i("payloadCollection",e)}},[]);return e(W,{$gap:12,children:[t(ae,{size:le.XS,color:ie.Secondary,nowrap:!0,children:"Type of data to collect"}),t(W,{$gap:6,children:Bs.map(({id:e,label:o,tooltip:n})=>t(De,{text:n,withIcon:!0,children:t(Y,{label:o,value:r.includes(e),onChange:t=>((e,t)=>{const o=t?[...r,e]:r.filter(t=>t!==e),n={[Fe.HttpRequest]:o.includes(Fe.HttpRequest)?{}:null,[Fe.HttpResponse]:o.includes(Fe.HttpResponse)?{}:null,[Fe.DbQuery]:o.includes(Fe.DbQuery)?{}:null,[Fe.Messaging]:o.includes(Fe.Messaging)?{}:null};i("payloadCollection",n)})(e,t)})},e))}),t(J,{errorMessage:s})]})},[Me.UnknownType]:null},Us=({ruleType:e,value:o,setValue:n,formErrors:a})=>{if(!e)return null;const i=Vs[e];return i?t(i,{value:o,setValue:n,formErrors:a}):null},Hs=()=>{const o=f(),{selectedOption:n,genericForm:a,sourceOptions:i,namespaceOptions:l}=Ol();if(!a||!n)return t(Ce,{title:"No active form"});const{formData:s,handleFormChange:r,formErrors:c}=a;return e(W,{$gap:24,children:[e(se,{$gap:12,$justifyContent:"space-between",children:[t(Se,{size:le.XXXS,maxLines:2,children:n.docsDescription}),e(se,{$gap:12,children:[t(ue,{options:[{icon:ui,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:pi,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],size:we.S,selected:s.disabled,setSelected:e=>r("disabled",e)}),t(re,{leftIcon:hi,variant:de.Secondary,size:ce.S,onClick:()=>window.open(`${xe}${n.docsEndpoint}`,"_blank","noopener noreferrer")})]})]}),t(dl,{option:n,formState:s}),e(se,{$gap:12,children:[t(ae,{size:le.XS,color:ie.Secondary,nowrap:!0,children:"Supported Languages:"}),n.supportedLanguages.map(e=>t(Be,{label:Xe[e],leftIcon:Ve(e),backgroundColor:o.v2.colors.purple[900]},e))]}),t(ul,{scopes:s.sourceScopes,onChange:e=>r("sourceScopes",e),sourceOptions:i,namespaceOptions:l,supportedLanguages:n.type===Me.CustomInstrumentation?[]:n.supportedLanguages,dataIdPrefix:"instrumentation-rule",slim:!0}),t(be,{name:"ruleName",label:"Rule name",placeholder:"Use a name that describes the rule...",value:s.ruleName,onChange:({target:{value:e}})=>r("ruleName",e),errorMessage:c.ruleName}),t(Us,{ruleType:n.type,value:s,setValue:(e,t)=>r(e,t),formErrors:c}),t(Te,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:s.notes,onChange:({target:{value:e}})=>r("notes",e),errorMessage:c.notes})]})},Gs=()=>{const{pendingMerge:e,confirmMerge:o,cancelMerge:n}=Rl();if(!e)return null;const{existingName:a,editingName:i}=e;return t(Ue,{isOpen:!0,onClose:n,title:"Merge with existing Data Stream?",description:He.DATA_STREAM_MERGE_WARNING(i,a),approveButton:{"data-id":"data-stream-merge-confirm",label:"Merge",variant:de.Primary,onClick:o},denyButton:{"data-id":"data-stream-merge-cancel",label:"Cancel",variant:de.Secondary,onClick:n}})},js=({autoFocus:o})=>{const{dataStreams:n}=Ge(),{genericForm:i,excludeName:l,editingName:s}=Rl(),{formData:r,formErrors:c,handleFormChange:d}=i,u=r.name,p=a(()=>n.find(e=>e.name===u&&e.name!==l),[n,u,l]);return e(W,{$width:"100%",$gap:12,children:[t(be,{name:"data-stream-name",label:He.STREAM_NAME,placeholder:He.NAME_YOUR_STREAM_PLACEHOLDER,tooltip:He.STREAM_DESCRIPTION,required:!0,autoFocus:o,value:u,onChange:e=>d("name",e.target.value),errorMessage:c.name}),p&&t($e,{status:Ee.Warning,message:He.DATA_STREAM_MERGE_WARNING(s,p.name),fullWidth:!0})]})},Ws=()=>{const{selectedStreamName:e}=Ge(),{genericForm:o}=Dl();if(!o)return t(Ce,{title:"No active form"});const{formData:n,handleFormChange:a,formErrors:i}=o;return t(be,{name:"sourceName",label:He.NAME,tooltip:"This overrides the default service name (service.name) reported in your telemetry.",placeholder:"Use a name that overrides the source name",value:n.otelServiceName,onChange:({target:{value:t}})=>{a("otelServiceName",t),a("currentStreamName",e)},errorMessage:i.otelServiceName})},Ks=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],Ys=m.div`
128
+ `,Fs=c(({isEdit:n},a)=>{const i=f(),{isVm:l}=y(),{destinationsApi:r}=ll(),{activeForm:c,genericForm:u,validateFormData:p,thisUnsavedDestination:h,addUnsavedDestination:m,updateUnsavedDestination:g,deleteUnsavedDestination:b}=Al(),[v,C]=s(h?.testResult),[S,w]=s(!!h);o(()=>{h?(C(h.testResult),w(!0)):(C(void 0),w(!1))},[h]);const x=async()=>{if(!c?.option.testConnectionSupported||!u||l)return;const e=await r.testConnection(Oe(u.formData));return C(e),e};return d(a,()=>({testConnection:x,testConnectionSupported:!!c?.option.testConnectionSupported}),[c?.option.testConnectionSupported,u,r]),u&&c?e(W,{$gap:24,style:{minHeight:"100%"},children:[e(se,{$gap:12,$justifyContent:"space-between",children:[v?v.succeeded?t($e,{status:Ie.Success,message:v.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t($e,{status:Ie.Error,message:v.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),e(se,{$gap:12,children:[!l&&t(ue,{options:[{icon:ci,label:"Enabled",value:!1,selectedBgColor:i.v2.colors.green[800]},{icon:di,label:"Disabled",value:!0,selectedBgColor:i.v2.colors.red[800]}],size:we.S,selected:u.formData.disabled,setSelected:e=>u.handleFormChange("disabled",e),disabled:S}),t(re,{"data-id":"dest-form-docs",leftIcon:ui,variant:de.Secondary,size:ce.S,onClick:()=>window.open(`${xe}/backends/${c.option.type}`,"_blank","noopener noreferrer")})]})]}),t(sl,{title:"This connection will monitor:",allowedSignals:Ne(c.option.supportedSignals),selectedSignals:Ae(u.formData.exportedSignals),setSelectedSignals:e=>u.handleFormChange("exportedSignals",{logs:e.includes(Ee.Logs),metrics:e.includes(Ee.Metrics),traces:e.includes(Ee.Traces),profiles:e.includes(Ee.Profiles)}),disabled:S,errorMessage:u.formErrors.exportedSignals}),t(be,{name:"destinationName",label:"Destination name",placeholder:"Use a name that describes the destination...",value:u.formData.name,onChange:({target:{value:e}})=>u.handleFormChange("name",e),disabled:S,errorMessage:u.formErrors.name}),t(Ds,{signals:Ae(u.formData.exportedSignals),fields:c.dynamicFields,disabled:S,formData:u.formData,handleFormChange:(e,t)=>{u.handleFormChange("fields",u.formData.fields.map(n=>n.key===e?{...n,value:t}:n)),e&&u.formErrors[e]&&u.handleErrorChange(e,void 0)},formErrors:u.formErrors}),!n&&e(Ps,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(re,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:pi,variant:de.Secondary,textColor:i.v2.colors.red[500],onClick:()=>b(c.unsavedIdx)})}),!l&&(!h||h.option.testConnectionSupported&&!S)&&t("div",{style:{width:"150px"},children:t(re,{"data-id":"dest-form-test-connection",fullWidth:!0,label:"Test Connection",variant:de.Secondary,onClick:x})}),h&&t("div",S?{style:{width:"150px"},children:t(re,{"data-id":"dest-form-edit",fullWidth:!0,label:"Edit",rightIcon:hi,variant:de.Secondary,onClick:()=>w(!1)})}:{style:{width:"150px"},children:t(re,{"data-id":"dest-form-save",fullWidth:!0,label:"Save Changes",variant:de.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await x(),n=!!e&&!e.succeeded;g(c.unsavedIdx,{formData:t,testResult:e},n)}}})}),!h&&t("div",{style:{width:"150px"},children:t(re,{"data-id":"dest-form-add",fullWidth:!0,label:"Add Destination",variant:de.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await x(),n=!!e&&!e.succeeded;m({formData:t,testResult:e},n)}}})})]})]}):t(Ce,{title:"No active form"})});Fs.displayName="AddDestinationForm";const Ls=[{id:Re.FilePath,label:"Collect file path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Re.Function,label:"Collect function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Re.LineNumber,label:"Collect line number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],_s=[{id:Re.Column,label:"Collect column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Re.Namespace,label:"Collect namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Re.StackTrace,label:"Collect stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],Ms=["*"],zs=[{id:Fe.HttpRequest,label:"Collect HTTP request",tooltip:""},{id:Fe.HttpResponse,label:"Collect HTTP response",tooltip:""},{id:Fe.DbQuery,label:"Collect DB query",tooltip:""},{id:Fe.Messaging,label:"Collect messaging",tooltip:""}],Bs={[Me.Java]:[new _e("","")],[Me.Golang]:[new Le("")]},Xs={[ze.CodeAttributes]:({value:i,setValue:l,formErrors:s})=>{const r=s.codeAttributes,c=a(()=>Object.entries(i.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[i]);o(()=>{if(!c.length&&!r){const e={[Re.FilePath]:!0,[Re.Function]:!0,[Re.LineNumber]:!0,[Re.Column]:null,[Re.Namespace]:null,[Re.StackTrace]:null};l("codeAttributes",e)}},[]);const d=(e,t)=>{const n=t?[...c,e]:c.filter(t=>t!==e),o=Object.values(Re).reduce((e,t)=>(e[t]=!!n.includes(t)||null,e),{});l("codeAttributes",o)};return e(n,{children:[e(W,{$gap:12,children:[t(ae,{size:le.XS,color:ie.Secondary,nowrap:!0,children:"Recommended data to collect"}),t(W,{$gap:6,children:Ls.map(({id:e,label:n,tooltip:o})=>t(De,{text:o,withIcon:!0,children:t(Y,{label:n,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(J,{errorMessage:r})]}),e(W,{$gap:12,children:[t(ae,{size:le.XS,color:ie.Secondary,nowrap:!0,children:"Verbose data to collect"}),t(W,{$gap:6,children:_s.map(({id:e,label:n,tooltip:o})=>t(De,{text:o,withIcon:!0,children:t(Y,{label:n,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(J,{errorMessage:r})]})]})},[ze.CustomInstrumentation]:({value:i,setValue:l,formErrors:s})=>{const r=s.customInstrumentations,c=a(()=>(i?.customInstrumentations?.[Me.Golang]||[]).map(e=>new Le(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[i]),d=a(()=>(i?.customInstrumentations?.[Me.Java]||[]).map(e=>new _e(e.className,e.methodName)),[i]);return o(()=>{i?.customInstrumentations||r||l("customInstrumentations",{[Me.Golang]:Bs[Me.Golang],[Me.Java]:Bs[Me.Java]})},[]),e(n,{children:[e(W,{children:[e(se,{$gap:8,children:[t(mi,{}),t(K,{label:"Golang custom probes"})]}),t(q,{name:"golangProbes",columns:[{keyName:"packageName",label:"Package name",placeholder:"e.g. github.com/my-org/my-package",tooltip:"The full import path of the package containing the function or method to be instrumented."},{keyName:"functionName",label:"Function name",placeholder:"e.g. myFunction",tooltip:"The name of the function to be instrumented. Leave empty if instrumenting a receiver method."},{keyName:"receiverName",label:"Receiver name",placeholder:"e.g. myReceiver",tooltip:"The name of the receiver type if instrumenting a method. Leave empty if instrumenting a standalone function."},{keyName:"receiverMethodName",label:"Receiver method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented. Leave empty if instrumenting a standalone function."}],values:c,setValues:e=>{const t={};t[Me.Golang]=e.map(e=>new Le(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),t[Me.Java]=d,l("customInstrumentations",t)},errorMessage:r,limitFieldsPerRow:2})]}),e(W,{children:[e(se,{$gap:8,children:[t(gi,{}),t(K,{label:"Java custom probes"})]}),t(q,{name:"javaProbes",columns:[{keyName:"className",label:"Class name",placeholder:"e.g. com.example.MyClass",tooltip:"The name of the class to be instrumented."},{keyName:"methodName",label:"Method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented."}],values:d,setValues:e=>{const t={};t[Me.Golang]=c,t[Me.Java]=e.map(e=>new _e(e.className,e.methodName)),l("customInstrumentations",t)},errorMessage:r,limitFieldsPerRow:2})]})]})},[ze.HeadersCollection]:({value:e,setValue:n,formErrors:i})=>{const l=i.headersCollection,s=a(()=>e?.headersCollection?.[Pe.HeaderKeys]||[],[e]),r=e=>{const t={[Pe.HeaderKeys]:e};n("headersCollection",t)};return o(()=>{s.length||l||r(Ms)},[]),t(te,{name:"headerKeys",label:"Header keys",tooltip:"Specify which headers you want to collect",helpMessage:"Asterisk (*) will collect all headers",values:s,setValues:r,errorMessage:l})},[ze.PayloadCollection]:({value:n,setValue:i,formErrors:l})=>{const s=l.payloadCollection,r=a(()=>Object.entries(n.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[n]);o(()=>{if(!r.length&&!s){const e={[Fe.HttpRequest]:{},[Fe.HttpResponse]:{},[Fe.DbQuery]:{},[Fe.Messaging]:{}};i("payloadCollection",e)}},[]);return e(W,{$gap:12,children:[t(ae,{size:le.XS,color:ie.Secondary,nowrap:!0,children:"Type of data to collect"}),t(W,{$gap:6,children:zs.map(({id:e,label:n,tooltip:o})=>t(De,{text:o,withIcon:!0,children:t(Y,{label:n,value:r.includes(e),onChange:t=>((e,t)=>{const n=t?[...r,e]:r.filter(t=>t!==e),o={[Fe.HttpRequest]:n.includes(Fe.HttpRequest)?{}:null,[Fe.HttpResponse]:n.includes(Fe.HttpResponse)?{}:null,[Fe.DbQuery]:n.includes(Fe.DbQuery)?{}:null,[Fe.Messaging]:n.includes(Fe.Messaging)?{}:null};i("payloadCollection",o)})(e,t)})},e))}),t(J,{errorMessage:s})]})},[ze.UnknownType]:null},Vs=({ruleType:e,value:n,setValue:o,formErrors:a})=>{if(!e)return null;const i=Xs[e];return i?t(i,{value:n,setValue:o,formErrors:a}):null},Us=()=>{const n=f(),{selectedOption:o,genericForm:a,sourceOptions:i,namespaceOptions:l}=Nl();if(!a||!o)return t(Ce,{title:"No active form"});const{formData:s,handleFormChange:r,formErrors:c}=a;return e(W,{$gap:24,children:[e(se,{$gap:12,$justifyContent:"space-between",children:[t(Se,{size:le.XXXS,maxLines:2,children:o.docsDescription}),e(se,{$gap:12,children:[t(ue,{options:[{icon:ci,label:"Enabled",value:!1,selectedBgColor:n.v2.colors.green[800]},{icon:di,label:"Disabled",value:!0,selectedBgColor:n.v2.colors.red[800]}],size:we.S,selected:s.disabled,setSelected:e=>r("disabled",e)}),t(re,{leftIcon:ui,variant:de.Secondary,size:ce.S,onClick:()=>window.open(`${xe}${o.docsEndpoint}`,"_blank","noopener noreferrer")})]})]}),t(cl,{option:o,formState:s}),e(se,{$gap:12,children:[t(ae,{size:le.XS,color:ie.Secondary,nowrap:!0,children:"Supported Languages:"}),o.supportedLanguages.map(e=>t(Be,{label:Xe[e],leftIcon:Ve(e),backgroundColor:n.v2.colors.purple[900]},e))]}),t(dl,{scopes:s.sourceScopes,onChange:e=>r("sourceScopes",e),sourceOptions:i,namespaceOptions:l,supportedLanguages:o.type===ze.CustomInstrumentation?[]:o.supportedLanguages,dataIdPrefix:"instrumentation-rule",slim:!0}),t(be,{name:"ruleName",label:"Rule name",placeholder:"Use a name that describes the rule...",value:s.ruleName,onChange:({target:{value:e}})=>r("ruleName",e),errorMessage:c.ruleName}),t(Vs,{ruleType:o.type,value:s,setValue:(e,t)=>r(e,t),formErrors:c}),t(ke,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:s.notes,onChange:({target:{value:e}})=>r("notes",e),errorMessage:c.notes})]})},Gs=()=>{const{pendingMerge:e,confirmMerge:n,cancelMerge:o}=Ol();if(!e)return null;const{existingName:a,editingName:i}=e;return t(Ue,{isOpen:!0,onClose:o,title:"Merge with existing Data Stream?",description:Ge.DATA_STREAM_MERGE_WARNING(i,a),approveButton:{"data-id":"data-stream-merge-confirm",label:"Merge",variant:de.Primary,onClick:n},denyButton:{"data-id":"data-stream-merge-cancel",label:"Cancel",variant:de.Secondary,onClick:o}})},Hs=({autoFocus:n})=>{const{dataStreams:o}=He(),{genericForm:i,excludeName:l,editingName:s}=Ol(),{formData:r,formErrors:c,handleFormChange:d}=i,u=r.name,p=a(()=>o.find(e=>e.name===u&&e.name!==l),[o,u,l]);return e(W,{$width:"100%",$gap:12,children:[t(be,{name:"data-stream-name",label:Ge.STREAM_NAME,placeholder:Ge.NAME_YOUR_STREAM_PLACEHOLDER,tooltip:Ge.STREAM_DESCRIPTION,required:!0,autoFocus:n,value:u,onChange:e=>d("name",e.target.value),errorMessage:c.name}),p&&t($e,{status:Ie.Warning,message:Ge.DATA_STREAM_MERGE_WARNING(s,p.name),fullWidth:!0})]})},js=()=>{const{selectedStreamName:e}=He(),{genericForm:n}=Rl();if(!n)return t(Ce,{title:"No active form"});const{formData:o,handleFormChange:a,formErrors:i}=n;return t(be,{name:"sourceName",label:Ge.NAME,tooltip:"This overrides the default service name (service.name) reported in your telemetry.",placeholder:"Use a name that overrides the source name",value:o.otelServiceName,onChange:({target:{value:t}})=>{a("otelServiceName",t),a("currentStreamName",e)},errorMessage:i.otelServiceName})},Ws=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],Ks=g.div`
129
129
  display: flex;
130
130
  flex-direction: column;
131
131
  gap: 24px;
132
- `,Js=m.div`
132
+ `,Ys=g.div`
133
133
  display: contents;
134
134
  & > * {
135
135
  opacity: ${({$faded:e})=>e?.4:1};
136
136
  transition: opacity 0.2s ease;
137
137
  }
138
- `,qs=({value:e})=>{const o=f();return t(Be,e?{status:Ee.Success,label:Ze,leftIcon:ui}:{label:Qe,leftIcon:pi,backgroundColor:o.v2.colors.silver[500],textColor:o.v2.colors.white[500]})},Zs=({value:e,onChange:o})=>{const n=f(),i=a(()=>[{icon:ui,label:Ze,value:!0,selectedBgColor:n.v2.colors.green[800]},{icon:pi,label:Qe,value:!1,selectedBgColor:n.v2.colors.silver[500]}],[n]);return t(ue,{options:i,selected:e,setSelected:o??(()=>{}),disabled:!o})},Qs=()=>{const e=Pl();switch(e.formType){case Fl.Create:return t(er,{category:e.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Zs,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})});case Fl.View:return e.data?e.isEditing?t(er,{category:e.data.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Zs,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})}):t(tr,{data:e.data,renderAction:()=>t(qs,{value:!e.data?.rule.disabled})}):null;case Fl.EditAutoNoisy:return t(or,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:qe,sectionTitle:Ke,sectionSubTitle:Je,presetLabel:We,customInputName:"sampling-auto-input-custom-percentage",percentageMode:e.percentageMode,setPercentageMode:e.setPercentageMode,percentagePreset:e.percentagePreset,setPercentagePreset:e.setPercentagePreset,customPercentage:e.customPercentage,setCustomPercentage:e.setCustomPercentage,renderAction:()=>t(Zs,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Fl.EditAutoCostReduction:return t(or,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:Ye,sectionTitle:Ke,presetLabel:We,customInputName:"sampling-cr-auto-input-custom-percentage",showModeToggle:!1,percentageMode:e.percentageMode,setPercentageMode:e.setPercentageMode,percentagePreset:e.percentagePreset,setPercentagePreset:e.setPercentagePreset,customPercentage:e.customPercentage,setCustomPercentage:e.setCustomPercentage,renderAction:()=>t(Zs,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Fl.EditAutoHighlyRelevant:return t(Ys,{children:t(pl,{title:e.localEnabled?void 0:je,summary:e.summary,renderAction:()=>t(Zs,{value:e.localEnabled,onChange:e.setLocalEnabled})})})}},er=({category:o,formData:n,onChange:a,sourceOptions:i,namespaceOptions:l,renderAction:s})=>e(Ys,{children:[t(ml,{category:o,formState:n,renderAction:s}),e(Js,{$faded:!!n.disabled,children:[t(fl,{category:o,formState:n,onChange:a}),t(ul,{scopes:n.sourceScopes,onChange:e=>a({sourceScopes:e}),sourceOptions:i,namespaceOptions:l,titleNumber:1,dataIdPrefix:"sampling"}),t(bl,{category:o,formState:n,onChange:a}),"highlyRelevant"===o&&t(vl,{formState:n,onChange:a}),"highlyRelevant"===o&&t(yl,{ruleType:n.ruleType,formState:n,onChange:a}),t(Cl,{category:o,formState:n,onChange:a})]})]}),tr=({data:o,renderAction:n})=>e(Ys,{children:[t(ml,{readOnly:!0,summary:o.summary,renderAction:n}),t(fl,{readOnly:!0,data:o}),t(ul,{readOnly:!0,scopes:C(o.rule.sourceScopes)}),t(bl,{readOnly:!0,data:o}),t(Cl,{readOnly:!0,data:o}),"highlyRelevant"===o.category&&t(yl,{readOnly:!0,rule:o.rule})]}),or=({enabled:o,summary:n,inactiveTitle:a,sectionTitle:i,sectionSubTitle:s,presetLabel:r,customInputName:c,showModeToggle:d=!0,percentageMode:u,setPercentageMode:p,percentagePreset:h,setPercentagePreset:g,customPercentage:m,setCustomPercentage:f,renderAction:b})=>{const v=l(e=>p(e),[p]),y=l(e=>g(e),[g]),C=l(e=>f(e.target.value),[f]),S=!d||"sample"===u;return e(Ys,{children:[t(pl,{title:o?void 0:a,summary:n,renderAction:b}),t(Js,{$faded:!o,children:e(et,{richTitle:{title:i,subTitle:s},children:[d&&t(W,{$alignItems:"flex-start",children:t(ue,{options:Ks,selected:u,setSelected:v})}),S&&t(hl,{description:r,options:gl,selected:h,onSelect:y,customName:c,customLabel:tt,customPlaceholder:"5%",customValue:m,onCustomChange:C})]})})]})},nr=m.div`
138
+ `,Js=({value:e})=>{const n=f();return t(Be,e?{status:Ie.Success,label:Ze,leftIcon:ci}:{label:Qe,leftIcon:di,backgroundColor:n.v2.colors.silver[500],textColor:n.v2.colors.white[500]})},qs=({value:e,onChange:n})=>{const o=f(),i=a(()=>[{icon:ci,label:Ze,value:!0,selectedBgColor:o.v2.colors.green[800]},{icon:di,label:Qe,value:!1,selectedBgColor:o.v2.colors.silver[500]}],[o]);return t(ue,{options:i,selected:e,setSelected:n??(()=>{}),disabled:!n})},Zs=()=>{const e=Dl();switch(e.formType){case Pl.Create:return t(Qs,{category:e.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(qs,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})});case Pl.View:return e.data?e.isEditing?t(Qs,{category:e.data.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(qs,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})}):t(er,{data:e.data,renderAction:()=>t(Js,{value:!e.data?.rule.disabled})}):null;case Pl.EditAutoNoisy:return t(tr,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:qe,sectionTitle:Ke,sectionSubTitle:Je,presetLabel:We,customInputName:"sampling-auto-input-custom-percentage",percentageMode:e.percentageMode,setPercentageMode:e.setPercentageMode,percentagePreset:e.percentagePreset,setPercentagePreset:e.setPercentagePreset,customPercentage:e.customPercentage,setCustomPercentage:e.setCustomPercentage,renderAction:()=>t(qs,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Pl.EditAutoCostReduction:return t(tr,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:Ye,sectionTitle:Ke,presetLabel:We,customInputName:"sampling-cr-auto-input-custom-percentage",showModeToggle:!1,percentageMode:e.percentageMode,setPercentageMode:e.setPercentageMode,percentagePreset:e.percentagePreset,setPercentagePreset:e.setPercentagePreset,customPercentage:e.customPercentage,setCustomPercentage:e.setCustomPercentage,renderAction:()=>t(qs,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Pl.EditAutoHighlyRelevant:return t(Ks,{children:t(ul,{title:e.localEnabled?void 0:je,summary:e.summary,renderAction:()=>t(qs,{value:e.localEnabled,onChange:e.setLocalEnabled})})})}},Qs=({category:n,formData:o,onChange:a,sourceOptions:i,namespaceOptions:l,renderAction:s})=>e(Ks,{children:[t(ml,{category:n,formState:o,renderAction:s}),e(Ys,{$faded:!!o.disabled,children:[t(gl,{category:n,formState:o,onChange:a}),t(dl,{scopes:o.sourceScopes,onChange:e=>a({sourceScopes:e}),sourceOptions:i,namespaceOptions:l,titleNumber:1,dataIdPrefix:"sampling"}),t(fl,{category:n,formState:o,onChange:a}),"highlyRelevant"===n&&t(bl,{formState:o,onChange:a}),"highlyRelevant"===n&&t(vl,{ruleType:o.ruleType,formState:o,onChange:a}),t(yl,{category:n,formState:o,onChange:a})]})]}),er=({data:n,renderAction:o})=>e(Ks,{children:[t(ml,{readOnly:!0,summary:n.summary,renderAction:o}),t(gl,{readOnly:!0,data:n}),t(dl,{readOnly:!0,scopes:C(n.rule.sourceScopes)}),t(fl,{readOnly:!0,data:n}),t(yl,{readOnly:!0,data:n}),"highlyRelevant"===n.category&&t(vl,{readOnly:!0,rule:n.rule})]}),tr=({enabled:n,summary:o,inactiveTitle:a,sectionTitle:i,sectionSubTitle:s,presetLabel:r,customInputName:c,showModeToggle:d=!0,percentageMode:u,setPercentageMode:p,percentagePreset:h,setPercentagePreset:m,customPercentage:g,setCustomPercentage:f,renderAction:b})=>{const v=l(e=>p(e),[p]),y=l(e=>m(e),[m]),C=l(e=>f(e.target.value),[f]),S=!d||"sample"===u;return e(Ks,{children:[t(ul,{title:n?void 0:a,summary:o,renderAction:b}),t(Ys,{$faded:!n,children:e(et,{richTitle:{title:i,subTitle:s},children:[d&&t(W,{$alignItems:"flex-start",children:t(ue,{options:Ws,selected:u,setSelected:v})}),S&&t(pl,{description:r,options:hl,selected:h,onSelect:y,customName:c,customLabel:tt,customPlaceholder:"5%",customValue:g,onCustomChange:C})]})})]})},nr=g.div`
139
139
  display: flex;
140
140
  align-items: center;
141
141
  justify-content: space-between;
142
142
  gap: 12px;
143
143
  padding: 8px 12px;
144
144
  border-radius: 12px;
145
- background-color: ${({$isSelected:e,$purpleColors:t,theme:o})=>e?t?o.v2.colors.purple[800]:o.v2.colors.silver[600]:t?o.v2.colors.purple[900]:"transparent"};
145
+ background-color: ${({$isSelected:e,$purpleColors:t,theme:n})=>e?t?n.v2.colors.purple[800]:n.v2.colors.silver[600]:t?n.v2.colors.purple[900]:"transparent"};
146
146
  cursor: ${({$disabled:e})=>e?"not-allowed":"pointer"};
147
147
  opacity: ${({$disabled:e})=>e?.5:1};
148
148
  &:hover {
149
- background-color: ${({$isSelected:e,$purpleColors:t,theme:o})=>o.v2.colors[t?"purple":"silver"][e?"700":"800"]};
149
+ background-color: ${({$isSelected:e,$purpleColors:t,theme:n})=>n.v2.colors[t?"purple":"silver"][e?"700":"800"]};
150
150
  }
151
- `,ar=m.div`
151
+ `,or=g.div`
152
152
  display: flex;
153
153
  align-items: center;
154
154
  justify-content: center;
155
155
  padding: 8px;
156
156
  border-radius: 8px;
157
- background-color: ${({theme:e})=>e.v2.colors.white[500]+ot["004"]};
158
- `,ir=({dataId:o,icon:n,title:a,description:i,withCarret:l,purpleColors:s,disabled:r,children:c,isSelected:d,onClick:u,isChecked:p,isPartiallyChecked:h,onCheckboxChange:g})=>e(nr,{"data-id":o||`list-item-${a}`,$isSelected:d,$purpleColors:s,$disabled:r,onClick:()=>!d&&!r&&u(),children:[e(W,{$gap:4,children:[e(se,{$gap:12,children:[g&&t(Y,{partiallyChecked:h||!1,value:p||!1,onChange:e=>g(e)}),n&&t(ar,{children:t(n,{size:20})}),t(ae,{size:le.XS,children:a})]}),i&&t(ae,{size:le.XXXS,color:ie.Secondary,children:i})]}),(l||c)&&e(se,{$gap:8,children:[c,l&&t(vi,{size:18})]})]}),lr=({onClose:e,selectedConnectionIds:o,setSelectedConnectionIds:n,withOverlay:l})=>{const{actionsApi:r}=sl(),[c,d]=s(""),u=i(null),{selectedOption:p,onSelectOption:h,genericForm:g,validateFormData:m}=Al(),f=a(()=>(c?nt.filter(e=>e?.label?.toLowerCase().includes(c.toLowerCase())):nt).filter(e=>!!e),[c]),b=a(()=>f.map(e=>{const o=p?.type===e.type;return t(ir,{dataId:e.type?`option-${e.type}`:void 0,title:e.label,description:e.description,withCarret:!0,isSelected:o,onClick:()=>{u.current?.clearErrors(),h(e)}},e.type)}),[p?.type,f.length,h]),v=a(()=>p?[t(Ds,{},p.type)]:[t(at,{$height:"100%",children:t(Ce,{icon:yi,title:"Action not selected",subTitle:"Please select an action to add"})},"no-data")],[p]);return t(Sl,{ref:u,isOpen:!0,withOverlay:l,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=m();if(e)return!1;await r.create(t)},disableSave:!p||!g?.isFormDirty,isFormDirty:g?.isFormDirty,hideDirtyNote:!0,progress:{title:He.CREATING_ACTION,subTitle:He.CREATING_ACTION_SUBTITLE},header:{icon:yi,title:He.ADD_ACTION,subTitle:He.ADD_ACTION_DESCRIPTION},connectionIds:o&&n?{value:o,setValue:n}:void 0,search:{value:c,onChange:d},leftColumn:{width:"40%",list:b},rightColumn:{width:"60%",list:v}})},sr=({destinationsByCategory:n,filters:i,setFilters:l})=>{const s=a(()=>Object.values(it).map(e=>({id:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()})).filter(e=>n[e.id]?.length),[n]),r=a(()=>{const e=Object.values(Ie).map(e=>({value:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}));return e.unshift({value:null,label:"All"}),e},[]);return e(o,{children:[t(lt,{placeholder:"Select category",options:s,values:i.categoryType?[i.categoryType]:[],setValues:e=>l({...i,categoryType:i.categoryType===e[0]?null:e[0]})}),t(ue,{options:r,selected:i.signalType,setSelected:e=>l({...i,signalType:e})})]})},rr=m.div`
157
+ background-color: ${({theme:e})=>e.v2.colors.white[500]+nt["004"]};
158
+ `,ar=({dataId:n,icon:o,title:a,description:i,withCarret:l,purpleColors:s,disabled:r,children:c,isSelected:d,onClick:u,isChecked:p,isPartiallyChecked:h,onCheckboxChange:m})=>e(nr,{"data-id":n||`list-item-${a}`,$isSelected:d,$purpleColors:s,$disabled:r,onClick:()=>!d&&!r&&u(),children:[e(W,{$gap:4,children:[e(se,{$gap:12,children:[m&&t(Y,{partiallyChecked:h||!1,value:p||!1,onChange:e=>m(e)}),o&&t(or,{children:t(o,{size:20})}),t(ae,{size:le.XS,children:a})]}),i&&t(ae,{size:le.XXXS,color:ie.Secondary,children:i})]}),(l||c)&&e(se,{$gap:8,children:[c,l&&t(fi,{size:18})]})]}),ir=({onClose:e,selectedConnectionIds:n,setSelectedConnectionIds:o,withOverlay:l})=>{const{actionsApi:r}=ll(),[c,d]=s(""),u=i(null),{selectedOption:p,onSelectOption:h,genericForm:m,validateFormData:g}=El(),f=a(()=>(c?ot.filter(e=>e?.label?.toLowerCase().includes(c.toLowerCase())):ot).filter(e=>!!e),[c]),b=a(()=>f.map(e=>{const n=p?.type===e.type;return t(ar,{dataId:e.type?`option-${e.type}`:void 0,title:e.label,description:e.description,withCarret:!0,isSelected:n,onClick:()=>{u.current?.clearErrors(),h(e)}},e.type)}),[p?.type,f.length,h]),v=a(()=>p?[t(Rs,{},p.type)]:[t(at,{$height:"100%",children:t(Ce,{icon:bi,title:"Action not selected",subTitle:"Please select an action to add"})},"no-data")],[p]);return t(Cl,{ref:u,isOpen:!0,withOverlay:l,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=g();if(e)return!1;await r.create(t)},disableSave:!p||!m?.isFormDirty,isFormDirty:m?.isFormDirty,hideDirtyNote:!0,progress:{title:Ge.CREATING_ACTION,subTitle:Ge.CREATING_ACTION_SUBTITLE},header:{icon:bi,title:Ge.ADD_ACTION,subTitle:Ge.ADD_ACTION_DESCRIPTION},connectionIds:n&&o?{value:n,setValue:o}:void 0,search:{value:c,onChange:d},leftColumn:{width:"40%",list:b},rightColumn:{width:"60%",list:v}})},lr=({destinationsByCategory:o,filters:i,setFilters:l})=>{const s=a(()=>Object.values(it).map(e=>({id:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()})).filter(e=>o[e.id]?.length),[o]),r=a(()=>{const e=Object.values(Ee).map(e=>({value:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}));return e.unshift({value:null,label:"All"}),e},[]);return e(n,{children:[t(lt,{placeholder:"Select category",options:s,values:i.categoryType?[i.categoryType]:[],setValues:e=>l({...i,categoryType:i.categoryType===e[0]?null:e[0]})}),t(ue,{options:r,selected:i.signalType,setSelected:e=>l({...i,signalType:e})})]})},sr=g.div`
159
159
  display: flex;
160
160
  flex-direction: column;
161
161
  padding: 8px;
162
162
  border-radius: 16px;
163
163
  border: ${({$purpleColors:e,theme:t})=>e?`1px solid ${t.v2.colors.purple[500]}`:"1px solid transparent"};
164
- background-color: ${({$noBgColor:e,$purpleColors:t,theme:o})=>e?"transparent":t?o.v2.colors.purple[900]:o.v2.colors.silver[800]};
165
- `,cr=m.div`
164
+ background-color: ${({$noBgColor:e,$purpleColors:t,theme:n})=>e?"transparent":t?n.v2.colors.purple[900]:n.v2.colors.silver[800]};
165
+ `,rr=g.div`
166
166
  display: flex;
167
167
  align-items: center;
168
168
  justify-content: space-between;
169
169
  gap: 12px;
170
170
  padding: ${({$isOpen:e})=>e?"2px 12px 8px 12px":"2px 12px"};
171
- `,dr=({title:o,tooltip:n,list:a,noBgColor:i,purpleColors:l})=>{const[r,c]=s(!0);return e(rr,{"data-id":`collapse-${o}`,$noBgColor:i,$purpleColors:l,children:[e(cr,{$isOpen:r,children:[e(se,{$gap:10,children:[t(ae,{size:le.XS,children:o}),n&&t(De,{text:n,withIcon:!0}),t(Be,{label:a.length,status:l?Ee.Default:void 0})]}),t(st,{icon:r?Si:wi,size:rt.M,onClick:()=>c(e=>!e)})]}),r?t(W,{children:a.length?u.toArray(a):t(at,{$padding:"12px 0",children:t(Ce,{})})}):null]})},ur=(e,t,o)=>t||o.signalType?e.filter(e=>e.displayName.toLowerCase().includes(t.toLowerCase())&&(!o.signalType||Ne(e.supportedSignals).includes(o.signalType))):e,pr=({option:e,formData:o,testResult:n,isSelected:a,onSelect:i})=>t(ir,{icon:ut(e.type).icon,title:o?.name||e.displayName,withCarret:!0,purpleColors:!!o,isSelected:a,onClick:()=>i(),children:n&&t(Be,{status:n.succeeded?Ee.Success:Ee.Error,leftIcon:n.succeeded?xi:Ti})}),hr=({listType:e,destinationOptions:o,unsavedDestinations:n})=>{const{activeForm:a,onChangeActiveForm:i}=Nl();return o?.length?t(dr,{title:dt[e].TITLE,tooltip:dt[e].DESCRIPTION,list:o.map((o,n)=>t(pr,{option:o,isSelected:a?.listType===e&&"number"!=typeof a?.unsavedIdx&&(null!=o.id&&""!==o.id?a?.option.id===o.id:a?.option.type===o.type),onSelect:()=>i({listType:e,option:o})},`${e}-${o.id??o.type}-${n}`))}):n?.length?t(dr,{purpleColors:!0,title:dt[e].TITLE,tooltip:dt[e].DESCRIPTION,list:n.map(({option:o,formData:n,testResult:l},s)=>t(pr,{option:o,formData:n,testResult:l,isSelected:a?.unsavedIdx===s&&a?.listType===e,onSelect:()=>i({listType:e,option:o,unsavedIdx:s})},`${e}-${s}`))},e):void 0};var gr;!function(e){e.SELF_HOSTED="self hosted",e.MANAGED="managed"}(gr||(gr={}));const mr=(e,t)=>{const o=[],n=[],a=[];return e&&e.destinationCategories.categories.forEach(e=>{e.name===gr.SELF_HOSTED?n.push(...e.items):e.name===gr.MANAGED&&a.push(...e.items)}),t&&t?.potentialDestinations.forEach(t=>{for(const n of e?.destinationCategories?.categories||[]){const e=pt(n),a=e.items.findIndex(e=>e.type===t.type);if(-1!==a){const n=ht(t.fields,{});Object.keys(n).length&&(e.items[a].fields=e.items[a].fields.map(e=>({...e,initialValue:n[e.name]})),o.push(e.items[a]))}}}),{[it.DETECTED]:o,[it.SELF_HOSTED]:n,[it.MANAGED]:a}},fr=({onClose:e,onBack:o,onNext:i,selectedConnectionIds:r,setSelectedConnectionIds:c,initialInputs:d,withOverlay:u,disableAnimation:p})=>{const{destinationsApi:h}=sl(),[g,m]=s(""),[f,b]=s({categoryType:null,signalType:null}),{items:v}=h.useDestinations(),{data:y,loading:C}=h.useDestinationCategories(),{data:S,loading:w}=h.usePotentialDestinations(),{activeForm:x,genericForm:T,unsavedDestinations:k,setUnsavedDestinations:$}=Nl();n(()=>{d&&$(d)},[d]);const E=C||w,I=a(()=>y?.destinationCategories?.categories??[],[y]),[A,N]=s({[it.ALL]:[],[it.UNSAVED]:[],[it.EXISTS]:[],[it.DETECTED]:[],[it.SELF_HOSTED]:[],[it.MANAGED]:[]});n(()=>{const e=v.map(e=>{let t;for(const o of I){const n=o.items.find(t=>t.type===e.destinationType.type);if(n){t=n;break}}const o=ht(e.fields,{});return{id:e.id,type:e.destinationType.type,displayName:e.name||e.destinationType.displayName,selected:!0,testConnectionSupported:t?.testConnectionSupported??!1,supportedSignals:e.destinationType.supportedSignals,fields:t?t.fields.map(e=>({...e,initialValue:o[e.name]??e.initialValue})):[]}});N(t=>({...t,[it.EXISTS]:e}))},[v,I]),n(()=>{(y||S)&&N(e=>({...e,...mr(y,S)}))},[y,S]);const O=l(async()=>{for(const{option:e,formData:t}of k){const o=Oe(t);if(e.id){const t=Object.fromEntries(e.fields.map(e=>[e.name,e.initialValue??""])),n=Object.fromEntries(o.fields.map(e=>[e.key,e.value??""]));if(!Object.keys(t).some(e=>t[e]!==n[e])){await h.update(e.id,o);continue}}await h.create(o)}},[k,h]),R=(({isFetching:e,destinationsByCategory:o,searchText:n,filters:i})=>{const{unsavedDestinations:l}=Nl();return{width:"40%",list:a(()=>{const a=[];l.length&&a.push(t(hr,{listType:it.UNSAVED,unsavedDestinations:l},"unsaved"));for(const e of Object.values(it)){if(i.categoryType&&i.categoryType!==e)continue;const l=ur(o[e],n,i);l.length&&a.push(t(hr,{listType:e,destinationOptions:l},e))}return e&&a.push(t(at,{$height:"100%",children:t(ct,{title:"Fetching destinations",withSpinner:!0})},"loading-more")),a},[l,o,n,i,e])}})({isFetching:E,destinationsByCategory:A,searchText:g,filters:f}),D=(()=>{const{activeForm:e}=Nl();return{width:"60%",list:e?[t(Ls,{},e.option.type)]:[t(at,{$height:"100%",children:t(Ce,{icon:Ci,title:"Select destination from the list",subTitle:"Add destination so your data has somewhere to go."})},"no-data")]}})();return t(Sl,{isOpen:!0,withOverlay:u,disableAnimation:p,onClose:e,onBack:o?()=>o(k):void 0,onNext:i?()=>i(k):void 0,nextIsSkip:!k.length,onSave:O,disableSave:!x&&!k.length,isFetching:E,isFormDirty:k.length>0||T?.isFormDirty,hideDirtyNote:!0,progress:{title:He.CREATING_DESTINATION,subTitle:He.CREATING_DESTINATION_SUBTITLE},header:{icon:Ci,title:He.ADD_DESTINATIONS,subTitle:He.ADD_DESTINATION_DRAWER_DESCRIPTION},connectionIds:r&&c?{value:r,setValue:c}:void 0,search:{value:g,onChange:m},filters:t(sr,{destinationsByCategory:A,filters:f,setFilters:b}),leftColumn:R,rightColumn:D})},br=({onClose:e,selectedConnectionIds:o,setSelectedConnectionIds:n,withOverlay:l})=>{const{instrumentationRulesApi:r}=sl(),[c,d]=s(""),u=i(null),{selectedOption:p,onSelectOption:h,genericForm:g,validateFormData:m}=Ol(),f=a(()=>c?gt.filter(e=>e.label.toLowerCase().includes(c.toLowerCase())):gt,[c]),b=a(()=>f.map(e=>{const o=p?.type===e.type;return t(ir,{dataId:`option-${e.type}`,title:e.label,description:e.description,withCarret:!0,isSelected:o,onClick:()=>{u.current?.clearErrors(),h(e)}},e.type)}),[p,f.length,h]),v=a(()=>p?[t(Hs,{},p.type)]:[t(at,{$height:"100%",children:t(Ce,{icon:ki,title:"Instrumentation rule not selected",subTitle:"Please select an instrumentation rule to add"})},"no-data")],[p]);return t(Sl,{ref:u,isOpen:!0,withOverlay:l,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=m();if(e)return!1;await r.create(t,p?.type)},disableSave:!p||!g?.isFormDirty,isFormDirty:g?.isFormDirty,hideDirtyNote:!0,progress:{title:He.CREATING_INSTRUMENTATION_RULE,subTitle:He.CREATING_INSTRUMENTATION_RULE_SUBTITLE},header:{icon:ki,title:He.ADD_INSTRUMENTATION_RULE,subTitle:He.ADD_INSTRUMENTATION_RULE_DESCRIPTION},connectionIds:o&&n?{value:o,setValue:n}:void 0,search:{value:c,onChange:d},leftColumn:{width:"40%",list:b},rightColumn:{width:"60%",list:v}})},vr={groupSegmentLabel:"Namespace",itemSegmentLabel:"Source",searchPlaceholder:()=>{},groupColumnHeader:"Namespaces",fetchingGroups:{title:He.FETCHING_NAMESPACES,subTitle:He.FETCHING_NAMESPACES_SUBTITLE},noGroups:{title:"No namespaces",subTitle:"No namespaces found in this cluster"},noGroupMatchedFilter:e=>`No namespace matched the filter '${e}'`,itemColumnHeader:"Workloads",selectGroupPrompt:{title:He.SELECT_NAMESPACE,subTitle:He.SELECT_NAMESPACE_SUBTITLE},noItemsInGroupSubTitle:"No sources found in this namespace"},yr={groupSegmentLabel:"Kind",itemSegmentLabel:"Source",searchPlaceholder:e=>"Search by "+(e===mt.Namespace?"kind":"source"),groupColumnHeader:"Kinds",fetchingGroups:{title:"Fetching kinds",subTitle:"Please wait while we fetch the kinds"},noGroups:{title:"No kinds",subTitle:"No kinds found on this host"},noGroupMatchedFilter:e=>`No kind matched the filter '${e}'`,itemColumnHeader:"Sources",selectGroupPrompt:{title:"Select kind from the list",subTitle:"Pick a kind so you can select sources from it."},noItemsInGroupSubTitle:"No sources found in this kind"},Cr=e=>e?yr:vr,Sr="No matches",wr="No sources",xr=e=>`No sources matched the filter '${e}'`,Tr=e=>(e?"Unselect":"Select")+" all",kr="Show only:",$r="Selected",Er="Auto",Ir="Automatically instrument all workloads currently in the namespace, and all workloads that will be deployed to this namespace in the future",Ar="Enterprise only",Nr=m.div``,Or=m.div`
171
+ `,cr=({title:n,tooltip:o,list:a,noBgColor:i,purpleColors:l})=>{const[r,c]=s(!0);return e(sr,{"data-id":`collapse-${n}`,$noBgColor:i,$purpleColors:l,children:[e(rr,{$isOpen:r,children:[e(se,{$gap:10,children:[t(ae,{size:le.XS,children:n}),o&&t(De,{text:o,withIcon:!0}),t(Be,{label:a.length,status:l?Ie.Default:void 0})]}),t(st,{icon:r?yi:Ci,size:rt.M,onClick:()=>c(e=>!e)})]}),r?t(W,{children:a.length?u.toArray(a):t(at,{$padding:"12px 0",children:t(Ce,{})})}):null]})},dr=(e,t,n)=>t||n.signalType?e.filter(e=>e.displayName.toLowerCase().includes(t.toLowerCase())&&(!n.signalType||Ne(e.supportedSignals).includes(n.signalType))):e,ur=({option:e,formData:n,testResult:o,isSelected:a,onSelect:i})=>t(ar,{icon:ut(e.type).icon,title:n?.name||e.displayName,withCarret:!0,purpleColors:!!n,isSelected:a,onClick:()=>i(),children:o&&t(Be,{status:o.succeeded?Ie.Success:Ie.Error,leftIcon:o.succeeded?Si:wi})}),pr=({listType:e,destinationOptions:n,unsavedDestinations:o})=>{const{activeForm:a,onChangeActiveForm:i}=Al();return n?.length?t(cr,{title:dt[e].TITLE,tooltip:dt[e].DESCRIPTION,list:n.map((n,o)=>t(ur,{option:n,isSelected:a?.listType===e&&"number"!=typeof a?.unsavedIdx&&(null!=n.id&&""!==n.id?a?.option.id===n.id:a?.option.type===n.type),onSelect:()=>i({listType:e,option:n})},`${e}-${n.id??n.type}-${o}`))}):o?.length?t(cr,{purpleColors:!0,title:dt[e].TITLE,tooltip:dt[e].DESCRIPTION,list:o.map(({option:n,formData:o,testResult:l},s)=>t(ur,{option:n,formData:o,testResult:l,isSelected:a?.unsavedIdx===s&&a?.listType===e,onSelect:()=>i({listType:e,option:n,unsavedIdx:s})},`${e}-${s}`))},e):void 0};var hr;!function(e){e.SELF_HOSTED="self hosted",e.MANAGED="managed"}(hr||(hr={}));const mr=(e,t)=>{const n=[],o=[],a=[];return e&&e.destinationCategories.categories.forEach(e=>{e.name===hr.SELF_HOSTED?o.push(...e.items):e.name===hr.MANAGED&&a.push(...e.items)}),t&&t?.potentialDestinations.forEach(t=>{for(const o of e?.destinationCategories?.categories||[]){const e=pt(o),a=e.items.findIndex(e=>e.type===t.type);if(-1!==a){const o=ht(t.fields,{});Object.keys(o).length&&(e.items[a].fields=e.items[a].fields.map(e=>({...e,initialValue:o[e.name]})),n.push(e.items[a]))}}}),{[it.DETECTED]:n,[it.SELF_HOSTED]:o,[it.MANAGED]:a}},gr=({onClose:e,onBack:n,onNext:i,selectedConnectionIds:r,setSelectedConnectionIds:c,initialInputs:d,withOverlay:u,disableAnimation:p})=>{const{destinationsApi:h}=ll(),[m,g]=s(""),[f,b]=s({categoryType:null,signalType:null}),{items:v}=h.useDestinations(),{data:y,loading:C}=h.useDestinationCategories(),{data:S,loading:w}=h.usePotentialDestinations(),{activeForm:x,genericForm:k,unsavedDestinations:T,setUnsavedDestinations:$}=Al();o(()=>{d&&$(d)},[d]);const I=C||w,E=a(()=>y?.destinationCategories?.categories??[],[y]),[A,N]=s({[it.ALL]:[],[it.UNSAVED]:[],[it.EXISTS]:[],[it.DETECTED]:[],[it.SELF_HOSTED]:[],[it.MANAGED]:[]});o(()=>{const e=v.map(e=>{let t;for(const n of E){const o=n.items.find(t=>t.type===e.destinationType.type);if(o){t=o;break}}const n=ht(e.fields,{});return{id:e.id,type:e.destinationType.type,displayName:e.name||e.destinationType.displayName,selected:!0,testConnectionSupported:t?.testConnectionSupported??!1,supportedSignals:e.destinationType.supportedSignals,fields:t?t.fields.map(e=>({...e,initialValue:n[e.name]??e.initialValue})):[]}});N(t=>({...t,[it.EXISTS]:e}))},[v,E]),o(()=>{(y||S)&&N(e=>({...e,...mr(y,S)}))},[y,S]);const O=l(async()=>{for(const{option:e,formData:t}of T){const n=Oe(t);if(e.id){const t=Object.fromEntries(e.fields.map(e=>[e.name,e.initialValue??""])),o=Object.fromEntries(n.fields.map(e=>[e.key,e.value??""]));if(!Object.keys(t).some(e=>t[e]!==o[e])){await h.update(e.id,n);continue}}await h.create(n)}},[T,h]),R=(({isFetching:e,destinationsByCategory:n,searchText:o,filters:i})=>{const{unsavedDestinations:l}=Al();return{width:"40%",list:a(()=>{const a=[];l.length&&a.push(t(pr,{listType:it.UNSAVED,unsavedDestinations:l},"unsaved"));for(const e of Object.values(it)){if(i.categoryType&&i.categoryType!==e)continue;const l=dr(n[e],o,i);l.length&&a.push(t(pr,{listType:e,destinationOptions:l},e))}return e&&a.push(t(at,{$height:"100%",children:t(ct,{title:"Fetching destinations",withSpinner:!0})},"loading-more")),a},[l,n,o,i,e])}})({isFetching:I,destinationsByCategory:A,searchText:m,filters:f}),D=(()=>{const{activeForm:e}=Al();return{width:"60%",list:e?[t(Fs,{},e.option.type)]:[t(at,{$height:"100%",children:t(Ce,{icon:vi,title:"Select destination from the list",subTitle:"Add destination so your data has somewhere to go."})},"no-data")]}})();return t(Cl,{isOpen:!0,withOverlay:u,disableAnimation:p,onClose:e,onBack:n?()=>n(T):void 0,onNext:i?()=>i(T):void 0,nextIsSkip:!T.length,onSave:O,disableSave:!x&&!T.length,isFetching:I,isFormDirty:T.length>0||k?.isFormDirty,hideDirtyNote:!0,progress:{title:Ge.CREATING_DESTINATION,subTitle:Ge.CREATING_DESTINATION_SUBTITLE},header:{icon:vi,title:Ge.ADD_DESTINATIONS,subTitle:Ge.ADD_DESTINATION_DRAWER_DESCRIPTION},connectionIds:r&&c?{value:r,setValue:c}:void 0,search:{value:m,onChange:g},filters:t(lr,{destinationsByCategory:A,filters:f,setFilters:b}),leftColumn:R,rightColumn:D})},fr=({onClose:e,selectedConnectionIds:n,setSelectedConnectionIds:o,withOverlay:l})=>{const{instrumentationRulesApi:r}=ll(),[c,d]=s(""),u=i(null),{selectedOption:p,onSelectOption:h,genericForm:m,validateFormData:g}=Nl(),f=a(()=>c?mt.filter(e=>e.label.toLowerCase().includes(c.toLowerCase())):mt,[c]),b=a(()=>f.map(e=>{const n=p?.type===e.type;return t(ar,{dataId:`option-${e.type}`,title:e.label,description:e.description,withCarret:!0,isSelected:n,onClick:()=>{u.current?.clearErrors(),h(e)}},e.type)}),[p,f.length,h]),v=a(()=>p?[t(Us,{},p.type)]:[t(at,{$height:"100%",children:t(Ce,{icon:xi,title:"Instrumentation rule not selected",subTitle:"Please select an instrumentation rule to add"})},"no-data")],[p]);return t(Cl,{ref:u,isOpen:!0,withOverlay:l,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=g();if(e)return!1;await r.create(t,p?.type)},disableSave:!p||!m?.isFormDirty,isFormDirty:m?.isFormDirty,hideDirtyNote:!0,progress:{title:Ge.CREATING_INSTRUMENTATION_RULE,subTitle:Ge.CREATING_INSTRUMENTATION_RULE_SUBTITLE},header:{icon:xi,title:Ge.ADD_INSTRUMENTATION_RULE,subTitle:Ge.ADD_INSTRUMENTATION_RULE_DESCRIPTION},connectionIds:n&&o?{value:n,setValue:o}:void 0,search:{value:c,onChange:d},leftColumn:{width:"40%",list:b},rightColumn:{width:"60%",list:v}})},br={groupSegmentLabel:"Namespace",itemSegmentLabel:"Source",searchPlaceholder:()=>{},groupColumnHeader:"Namespaces",fetchingGroups:{title:Ge.FETCHING_NAMESPACES,subTitle:Ge.FETCHING_NAMESPACES_SUBTITLE},noGroups:{title:"No namespaces",subTitle:"No namespaces found in this cluster"},noGroupMatchedFilter:e=>`No namespace matched the filter '${e}'`,itemColumnHeader:"Workloads",selectGroupPrompt:{title:Ge.SELECT_NAMESPACE,subTitle:Ge.SELECT_NAMESPACE_SUBTITLE},noItemsInGroupSubTitle:"No sources found in this namespace"},vr={groupSegmentLabel:"Kind",itemSegmentLabel:"Source",searchPlaceholder:e=>"Search by "+(e===gt.Namespace?"kind":"source"),groupColumnHeader:"Kinds",fetchingGroups:{title:"Fetching kinds",subTitle:"Please wait while we fetch the kinds"},noGroups:{title:"No kinds",subTitle:"No kinds found on this host"},noGroupMatchedFilter:e=>`No kind matched the filter '${e}'`,itemColumnHeader:"Sources",selectGroupPrompt:{title:"Select kind from the list",subTitle:"Pick a kind so you can select sources from it."},noItemsInGroupSubTitle:"No sources found in this kind"},yr=e=>e?vr:br,Cr="No matches",Sr="No sources",wr=e=>`No sources matched the filter '${e}'`,xr=e=>(e?"Unselect":"Select")+" all",kr="Show only:",Tr="Selected",$r="Auto",Ir="Automatically instrument all workloads currently in the namespace, and all workloads that will be deployed to this namespace in the future",Er="Enterprise only",Ar=g.div``,Nr=g.div`
172
172
  visibility: hidden;
173
173
 
174
174
  transition: visibility 0s;
@@ -176,19 +176,19 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
176
176
  transition-duration: 0s;
177
177
  }
178
178
 
179
- ${Nr}:hover & {
179
+ ${Ar}:hover & {
180
180
  visibility: visible;
181
181
  }
182
- `,Rr=({workloadName:e,workloadKind:o,isChecked:n,onToggle:a,disabled:i,disabledReason:l})=>{const s=f(),r=()=>{};return t(Nr,{children:t(ir,{dataId:`source-${e}`,title:e,disabled:i,onClick:i?r:a,isChecked:n,onCheckboxChange:i?r:a,children:i&&l?t(Be,{label:l,status:Ee.Default,textSize:le.XXXS}):t(Or,{children:t(Be,{label:o,status:Ee.Info,textSize:le.XXXS,backgroundColor:s.v2.colors.blue[900]})})})})},Dr=m.div``,Pr=m.div`
182
+ `,Or=({workloadName:e,workloadKind:n,isChecked:o,onToggle:a,disabled:i,disabledReason:l})=>{const s=f(),r=()=>{};return t(Ar,{children:t(ar,{dataId:`source-${e}`,title:e,disabled:i,onClick:i?r:a,isChecked:o,onCheckboxChange:i?r:a,children:i&&l?t(Be,{label:l,status:Ie.Default,textSize:le.XXXS}):t(Nr,{children:t(Be,{label:n,status:Ie.Info,textSize:le.XXXS,backgroundColor:s.v2.colors.blue[900]})})})})},Rr=g.div``,Dr=g.div`
183
183
  visibility: ${({$visible:e})=>e?"visible":"hidden"};
184
184
 
185
185
  transition: visibility 0s;
186
186
  ${({$visible:e})=>!e&&"& * {\n transition-duration: 0s !important;\n }"}
187
187
 
188
- ${Dr}:hover & {
188
+ ${Rr}:hover & {
189
189
  visibility: visible;
190
190
  }
191
- `,Fr=({clusterId:o,namespaceName:n,checkbox:a,isFutureApps:i,selectedCounts:l,isActive:s,onActive:r,handleSourceChange:c})=>{const{isVm:d}=y(),u=e=>{r(),c({clusterId:o,workloadId:{namespace:n},auto:e.auto,selected:e.all})};return t(Dr,{children:t(ir,{dataId:`namespace-${n}`,withCarret:!0,title:n,isSelected:s,onClick:r,isPartiallyChecked:a.partial,isChecked:a.all,onCheckboxChange:e=>u({auto:e,all:e}),children:e(se,{$gap:12,children:[!d&&t(Pr,{$visible:s||i,children:t(De,{text:Ir,children:t(Q,{label:Er,labelAlign:ee.Left,size:vt.S,value:i,onChange:e=>u({auto:e,all:e||void 0})})})}),e(se,{$gap:8,children:[t(ae,{variant:yt.Span,size:le.XXXS,color:ie.Secondary,align:"right",children:$r}),t(Be,{label:`${l.sourced}/${l.total}`,status:s?Ee.Default:ft.Unknown,minWidth:"42px"})]})]})})})},Lr=({withCollapse:e,clusterId:o,clusterName:n,namespaces:i,selectedArea:l,setSelectedArea:s,handleSourceChange:r})=>{const c=a(()=>i.map(({name:e,totalWorkloads:a,selectedCount:i,isAllSourced:c,isSomeSourced:d,isFutureApps:u})=>t(Fr,{clusterId:o,namespaceName:e,isFutureApps:u,checkbox:{all:c||u,partial:d},selectedCounts:{sourced:i,total:a},isActive:l.clusterId===o&&l.namespaceName===e,onActive:()=>s({clusterId:o,clusterName:n,namespaceName:e}),handleSourceChange:r},`${o}#${e}`)),[o,n,i,l]);return e?t(dr,{title:n,list:c,noBgColor:!0}):c},_r=({onClose:o,onBack:i,onNext:l,selectedConnectionIds:r,setSelectedConnectionIds:c,withOverlay:d,disableAnimation:u})=>{const{isVm:p}=y(),{sourcesApi:h,snapshotsApi:g,namespacesApi:m}=sl(),{data:f,loading:b,refetch:v}=g.useSnapshots(),{items:C,loading:S,refetch:w}=m.useNamespaces(),x=Cr(p),{selectedStreamName:T}=Ge(),{progress:k,resetProgress:$}=Ct(),{isFetching:E,setIsFetching:I,setSnapshots:A,formData:N,handleSourceChange:O,handleSelectAll:R,formDiff:D,isFormDirty:P}=Bl();n(()=>{v(),w()},[]);const F=a(()=>{if(f)return f;const e=C;return e.length?{clusters:[{clusterId:wt,clusterName:St,namespaces:e.map(e=>({name:e.name,selected:e.markedForInstrumentation&&e.dataStreamNames.includes(T),workloads:e.workloads?.map(e=>({namespace:e.id.namespace,name:e.id.name,kind:e.id.kind,selected:(e.markedForInstrumentation?.markedForInstrumentation??!1)&&(e.dataStreamNames?.includes(T)??!1)}))||[]}))}]}:null},[f,C,T]);n(()=>{I(b||S),F&&A(F)},[F,b,S,I,A]);const[L,_]=s(""),[z,M]=s(mt.Namespace),[B,X]=s({showOnlySelected:!1}),[V,U]=s({clusterId:"",clusterName:"",namespaceName:""}),H=(({isFetching:o,formData:n,handleSourceChange:i,handleSelectAll:l,selectedArea:s,setSelectedArea:r,searchText:c,searchBy:d,filters:u})=>{const{isVm:p}=y(),h=Cr(p),g=a(()=>n.map(e=>{const t=[...e.namespaces].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>zl(e,c,u)).map(e=>({name:e.name,totalWorkloads:e.workloads.length,...Ml(e)}));return{clusterId:e.clusterId,clusterName:e.clusterName,visibleNamespaces:t}}),[n,c,u]),m=a(()=>{let e=!1;for(const{visibleNamespaces:t}of g)for(const{totalWorkloads:o,selectedCount:n}of t)if(e=!0,n!==o)return!1;return e},[g]),{list:f,withFilterCount:b,filteredCount:v,totalCount:C}=a(()=>{const e=g.map(({clusterId:e,clusterName:o,visibleNamespaces:n})=>n.length?t(Lr,{withCollapse:g.length>1,clusterId:e,clusterName:o,namespaces:n,selectedArea:s,setSelectedArea:r,handleSourceChange:i},e):null),o=e.filter(e=>null!==e);return{list:o,withFilterCount:o.length!==e.length,filteredCount:o.length,totalCount:e.length}},[g,s]);return{width:"60%",header:e(se,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(se,{$gap:8,children:[t(ae,{size:le.XS,nowrap:!0,children:h.groupColumnHeader}),t(De,{text:b?He.FILTERED_COUNT_TOOLTIP:void 0,children:t(Be,{label:`${b?`${v} / ${C}`:C}`,status:ft.Unknown})})]}),t(ae,{"data-id":"namespaces-select-all",onClick:()=>l({boolean:!m,searchText:c,searchBy:d,filters:u}),disabled:!f.length,size:le.XS,children:Tr(m)})]}),list:f.length?f:o?[t(at,{$height:"100%",children:t(ct,{title:h.fetchingGroups.title,subTitle:h.fetchingGroups.subTitle,withSpinner:!0})},"loading")]:[t(at,{$height:"100%",children:t(Ce,c?{icon:Ei,title:Sr,subTitle:h.noGroupMatchedFilter(c)}:{icon:Ei,title:h.noGroups.title,subTitle:h.noGroups.subTitle})},"no-data")]}})({isFetching:E,formData:N,handleSourceChange:O,handleSelectAll:R,selectedArea:V,setSelectedArea:U,searchText:z===mt.Namespace?L:"",searchBy:z,filters:B}),G=(({formData:o,handleSourceChange:n,handleSelectAll:i,selectedArea:l,searchText:s,searchBy:r,filters:c})=>{const{tier:d,isVm:u}=y(),p=Cr(u),h=d===bt.Onprem,g=a(()=>l.value.namespaceName?o.find(({clusterId:e})=>e===l.value.clusterId)?.namespaces.find(({name:e})=>e===l.value.namespaceName):void 0,[o,l.value.clusterId,l.value.namespaceName]),m=a(()=>g?[...g.workloads].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Ll(e,s,c)):[],[g,s,c]),f=a(()=>!!m.length&&m.every(({selected:e})=>e),[m]),b=a(()=>{if(!g)return[];const{clusterId:e}=l.value,{name:o}=g;return m.map(({name:a,selected:i,kind:l})=>{const s=!u&&!h&&_l.has(l);return t(Rr,{workloadName:a,workloadKind:l,isChecked:!s&&(i||!1),onToggle:()=>n({clusterId:e,workloadId:{namespace:o,name:a,kind:l}}),disabled:s,disabledReason:Ar},`${e}#${o}#${a}#${l}`)})},[m,g,l.value.clusterId]),{withFilterCount:v,filteredCount:C,totalCount:S}=a(()=>{const e=g?.workloads.length??0;return{withFilterCount:m.length!==e,filteredCount:m.length,totalCount:e}},[m,g]);return{width:"40%",header:e(se,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(se,{$gap:8,children:[t(ae,{size:le.XS,nowrap:!0,children:l.value.namespaceName?`${l.value.namespaceName} > ${p.itemColumnHeader}`:p.itemColumnHeader}),t(De,{text:v?He.FILTERED_COUNT_TOOLTIP:void 0,children:t(Be,{label:`${v?`${C} / ${S}`:S}`,status:ft.Unknown})})]}),t(ae,{"data-id":"workloads-select-all",onClick:()=>i({clusterId:l.value.clusterId,namespaceName:l.value.namespaceName,boolean:!f,searchText:s,searchBy:r,filters:c}),disabled:!b.length,size:le.XS,children:Tr(f)})]}),list:b.length?b:[t(at,{$height:"100%",children:t(Ce,g?s?{icon:$i,title:Sr,subTitle:xr(s)}:{icon:$i,title:wr,subTitle:p.noItemsInGroupSubTitle}:{icon:$i,title:p.selectGroupPrompt.title,subTitle:p.selectGroupPrompt.subTitle})},"no-data")]}})({formData:N,handleSourceChange:O,handleSelectAll:R,selectedArea:{value:V},searchText:z===mt.Source?L:"",searchBy:z,filters:B});return t(Sl,{isOpen:!0,withOverlay:d,disableAnimation:u,onClose:o?()=>{$(xt.BulkInstrumenting),o()}:void 0,onBack:i?()=>i(D):void 0,onNext:l?()=>l(D):void 0,nextIsSkip:!P,onSave:()=>h.persistV2(D),header:{icon:$i,title:He.ADD_SOURCE,subTitle:He.ADD_SOURCES_DESCRIPTION},connectionIds:r&&c?{value:r,setValue:c}:void 0,search:{value:L,onChange:e=>{_(e),z===mt.Namespace&&U({clusterId:"",clusterName:"",namespaceName:""})},placeholder:x.searchPlaceholder(z),segment:{options:[{label:x.groupSegmentLabel,value:mt.Namespace},{label:x.itemSegmentLabel,value:mt.Source}],selected:z,setSelected:M}},filters:e(se,{$gap:8,children:[t(ae,{size:le.XXXS,color:ie.Secondary,nowrap:!0,children:kr}),t(Q,{name:"filter-selected",size:vt.S,label:$r,value:B.showOnlySelected,onChange:e=>X(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:P,isFetching:E,progress:{title:He.CREATING_SOURCES,subTitle:He.CREATING_SOURCES_SUBTITLE,percentage:k[xt.BulkInstrumenting]?.percentage||0},leftColumn:H,rightColumn:G})},zr=(e,t)=>{const o=[{id:"type",title:He.TYPE,label:t.label},{id:"status",title:He.STATUS,badge:{status:e.disabled?ft.Unknown:Ee.Success,label:e.disabled?He.DISABLED:He.ENABLED}}],n=e.signals?.map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return n&&o.push({id:"signals",title:He.SIGNALS_FOR_PROCESSING,label:n}),e.name&&o.push({id:"name",title:He.NAME,label:e.name}),e.notes&&o.push({id:"notes",title:He.NOTES,label:e.notes}),o},Mr=({onClose:i,actionId:r})=>{const c=f(),{actionsApi:d}=sl(),{items:u,refetch:p}=d.useActions(),{selectedOption:h,loadAction:g,validateFormData:m,genericForm:b}=Al();n(()=>{p()},[]);const[v,y]=s(!1),[C,S]=s(!1),[w,x]=s(null),T=v&&!!b?.isFormDirty,k=a(()=>u?.find(e=>Tt(e)===r),[r,u]),$=a(()=>nt.find(({type:e})=>e===k?.type)??null,[k?.type]);n(()=>{k&&g(k)},[k]);const E=l(()=>{k&&y(!0)},[k]),I=l(()=>{k&&(g(k),y(!1))},[k,g]),A=l(()=>{T?x("close"):i()},[T,i]),N=l(()=>{T?x("cancel"):I()},[T,I]),O=l(()=>{const e=w;x(null),"close"===e?(I(),i()):I()},[w,I,i]),R=l(async()=>{if(k){const{errorMessage:e,preparedFormData:t}=m();e||(await d.update(k.id,t),y(!1))}},[k,m,d]),D=l(()=>{k&&S(!0)},[k]),P=l(async()=>{k&&(await d.remove(k.id,k.type),i())},[k,d,i]);if(!k||!$)return null;const F=(e=>{const t=[],{type:o,fields:n}=e,a=e=>({status:e?Ee.Success:ft.Unknown,label:e?"True":"False",invertColors:!0});if(o===ye.K8sAttributes&&(t.push({id:"collectContainerAttributes",title:"Collect Container Attributes",badge:a(n.collectContainerAttributes)}),t.push({id:"collectReplicaSetAttributes",title:"Collect ReplicaSet Attributes",badge:a(n.collectReplicaSetAttributes)}),t.push({id:"collectWorkloadId",title:"Collect Workload ID",badge:a(n.collectWorkloadId)}),t.push({id:"collectClusterId",title:"Collect Cluster ID",badge:a(n.collectClusterId)}),n.labelsAttributes?.forEach(({labelKey:e,attributeKey:o,from:a,fromSources:i},l)=>{const s=i?.length?i.join(", "):a||Z.Pod,r=(n.labelsAttributes?.length??0)>1?`Label #${l+1} `:"Label ";t.push({id:`label-${l}-key`,title:`${r}Key`,label:e}),t.push({id:`label-${l}-attr`,title:`${r}Attribute Key`,label:o}),t.push({id:`label-${l}-from`,title:`${r}From`,label:s})}),n.annotationsAttributes?.forEach(({annotationKey:e,attributeKey:o,from:a,fromSources:i},l)=>{const s=i?.length?i.join(", "):a||Z.Pod,r=(n.annotationsAttributes?.length??0)>1?`Annotation #${l+1} `:"Annotation ";t.push({id:`annotation-${l}-key`,title:`${r}Key`,label:e}),t.push({id:`annotation-${l}-attr`,title:`${r}Attribute Key`,label:o}),t.push({id:`annotation-${l}-from`,title:`${r}From`,label:s})})),o===ye.AddClusterInfo&&(t.push({id:"overwriteExistingValues",title:"Overwrite Existing Values",badge:a(n.overwriteExistingValues)}),n.clusterAttributes?.forEach(({attributeName:e,attributeStringValue:o},n)=>{t.push({id:`cluster-attr-${n}`,title:e,label:o})})),o===ye.DeleteAttributes&&n.attributeNamesToDelete?.forEach((e,o)=>{t.push({id:`del-attr-${o}`,title:"Attribute"+((n.attributeNamesToDelete?.length??0)>1?` #${o+1}`:""),label:e})}),o===ye.RenameAttributes&&Object.entries(n.renames||{}).forEach(([e,o],n)=>{t.push({id:`rename-${n}`,title:e,label:o})}),o===ye.PiiMasking&&n.piiCategories?.forEach((e,o)=>{t.push({id:`pii-${o}`,title:"Category"+((n.piiCategories?.length??0)>1?` #${o+1}`:""),label:e})}),o===ye.ExtractAttribute){const e=n.extractAttribute?.extractions??[];e.forEach(({targetAttributeName:o,lookupKey:n,dataFormat:a,regex:i},l)=>{const s=e.length>1?`Extraction #${l+1} `:"Extraction ";t.push({id:`extract-${l}-target`,title:`${s}New Attribute Name`,label:o||"-"}),n&&t.push({id:`extract-${l}-lookupKey`,title:`${s}Lookup Key`,label:n}),a&&t.push({id:`extract-${l}-format`,title:`${s}Data Format`,label:a}),i&&t.push({id:`extract-${l}-regex`,title:`${s}Regex`,label:i})})}return o===ye.URLTemplatization&&n.urlTemplatizationRulesGroups?.forEach((e,o)=>{const a=(n.urlTemplatizationRulesGroups?.length??0)>1?`Group #${o+1} `:"Group ";e.filterK8sNamespace&&t.push({id:`group-${o}-ns`,title:`${a}Namespace`,label:e.filterK8sNamespace}),e.workloadFilters?.forEach((n,i)=>{const l=[n.kind,n.name].filter(Boolean).join("/");l&&t.push({id:`group-${o}-wf-${i}`,title:`${a}Workload${(e.workloadFilters?.length??0)>1?` #${i+1}`:""}`,label:l})});const i=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");i&&t.push({id:`group-${o}-templates`,title:`${a}Templates`,label:i}),e.notes&&t.push({id:`group-${o}-notes`,title:`${a}Notes`,label:e.notes})}),t})(k);return e(o,{children:[t(oe,{isOpen:!0,header:{icon:At(k.type),title:$.label,onClose:A,actions:[{id:"edit-action-btn-edit",label:kt.EDIT,icon:mi,active:v,onClick:E},{id:"edit-action-btn-delete",label:kt.DELETE,icon:ri,color:c.v2.colors.red[500],active:C,onClick:D}]},footer:{actions:v?[{"data-id":"edit-action-btn-cancel",label:kt.CANCEL,variant:de.Secondary,onClick:N},{"data-id":"edit-action-btn-save",label:kt.SAVE,variant:de.Primary,onClick:R}]:[]},children:t($t,{$padding:"4px 12px 12px",children:v&&h?t(Ds,{}):t(W,{$gap:16,children:e(Et,{bgTint:"1000",children:[e(Et,{bgTint:"900",children:[t(It,{conditions:k.conditions||[]}),t(Et,{bgTint:"800",cellsPerRow:2,items:zr(k,$)})]}),!!F?.length&&t(Et,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Et,{bgTint:"800",cellsPerRow:2,items:F})})]})})})}),t(wl,{target:"action",isOpen:C,onClose:()=>S(!1),onApprove:P}),t(xl,{isOpen:null!==w,onClose:()=>x(null),onApprove:O})]})},Br=({onClose:o,connections:l,selectedConnectionIds:r,setSelectedConnectionIds:c})=>{const{configApi:d}=sl(),[u,p]=s(""),[h,g]=s({showOnlySelected:!1}),m=a(()=>l.filter(e=>{const t=!u||e.name.toLowerCase().includes(u.toLowerCase()),o=!h.showOnlySelected||h.showOnlySelected&&r.includes(e.id);return t&&o}),[l.length,r.length,u,h]),f=e=>{c(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},b=1===r.length?r[0]:void 0,{data:v,loading:y}=d.useEffectiveConfig(b?{id:b}:void 0,{skip:!b}),C=a(()=>{if(b&&v)return{rollout:{automaticRolloutDisabled:v.rollout?.automaticRolloutDisabled??!1}}},[b,v]),{formData:S,handleFormChange:w,areFormValuesEqual:x,resetFormData:T}=Nt(C||{rollout:{automaticRolloutDisabled:!1}}),k=i(T);k.current=T,n(()=>{C&&k.current(C)},[C]);const $=a(()=>r.length>1||void 0!==C&&!x(C,S),[r.length,C,S]);return t(Sl,{isOpen:!0,onClose:o,onSave:async()=>await(d.applyConfigurations?.(S,r))??void 0,header:{icon:Ii,title:"Cluster Configuration"},connectionIds:{value:r,setValue:c},search:{placeholder:"Search by cluster name",value:u,onChange:p},filters:e(se,{$gap:8,children:[t(ae,{size:le.XXXS,color:ie.Secondary,nowrap:!0,children:"Show only:"}),t(Q,{size:vt.S,label:"Selected",value:h.showOnlySelected,onChange:e=>g(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:$,isFetching:y,leftColumn:{width:"35%",header:e(se,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(se,{$gap:8,children:[t(ae,{size:le.XS,children:"Clusters"}),t(Be,{label:m.length,status:ft.Unknown})]}),e(se,{$gap:8,children:[t(ae,{size:le.XXXS,color:ie.Secondary,align:"right",children:"Selected clusters"}),t(Be,{label:`${r.length}/${m.length}`,status:ft.Unknown})]})]}),list:m.map(e=>t(ir,{title:e.name,isChecked:r.includes(e.id),onClick:()=>f(e.id),onCheckboxChange:()=>f(e.id)},e.id))},rightColumn:{width:"65%",header:t(ae,{size:le.XS,children:"Configurations"}),list:[t(Q,{label:"Automatic rollout disabled",tooltip:"Odigos automatically triggers a one-time rollout for workloads when instrumenting or uninstrumenting, ensuring that changes are applied without requiring manual intervention. When automatic rollout is disabled, Odigos will not restart workloads, and users will need to manually trigger rollouts after adding or removing sources.",value:S.rollout?.automaticRolloutDisabled||!1,onChange:e=>w("rollout.automaticRolloutDisabled",e)},"automatic-rollout-disabled")]}})},Xr=e=>{const t=[{id:"type",title:He.TYPE,label:e.destinationType.displayName},{id:"status",title:He.STATUS,badge:{status:e.disabled?ft.Unknown:Ee.Success,label:e.disabled?He.DISABLED:He.ENABLED}}],o=Ae(e.exportedSignals).map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return o&&t.push({id:"monitors",title:He.MONITORS,label:o}),e.name&&t.push({id:"name",title:He.NAME,label:e.name}),t},Vr=({onClose:r,destinationId:c})=>{const d=f(),{isVm:u}=y(),{destinationsApi:p}=sl(),{selectedStreamName:h}=Ge(),{items:g,refetch:m}=p.useDestinations(),{data:b,loading:v}=p.useDestinationCategories(),{activeForm:C,loadDestination:S,validateFormData:w,genericForm:x}=Nl();n(()=>{m()},[]);const T=i(null),[k,$]=s(!1),[E,I]=s(!1),[A,N]=s(null),O=k&&!!x?.isFormDirty,R=a(()=>Dt(g,h),[g,h]),D=a(()=>R?.find(e=>Tt(e)===c),[c,R]),P=b?.destinationCategories?.categories??null;n(()=>{D&&P&&S(D,P)},[D,P]);const F=a(()=>D&&P?Pt(P,D):[],[D,P]),L=l(()=>{D&&$(!0)},[D]),_=l(()=>{D&&P&&(S(D,P),$(!1))},[D,P,S]),z=l(()=>{O?N("close"):r()},[O,r]),M=l(()=>{O?N("cancel"):_()},[O,_]),B=l(()=>{const e=A;N(null),"close"===e?(_(),r()):_()},[A,_,r]),X=l(async()=>{if(D){const{errorMessage:e,preparedFormData:t}=w();e||(await p.update(D.id,Oe(t)),$(!1))}},[D,w,p]),V=l(()=>{D&&I(!0)},[D]),U=l(async()=>{D&&(await p.remove(D.id),r())},[D,p,r]);if(!D)return null;const{icon:H,iconSrc:G}=ut(D.destinationType.type),j=((e,t)=>{const o=[],n=Ot(e,t),a=n.map(e=>({name:e.key,value:e.value})),i=Ae(e.exportedSignals);let l=[];const s=()=>{l.length&&(o.push({kind:"cells",id:`cells-${o.length}`,items:l}),l=[])};return n.forEach(({key:e,name:n,value:r})=>{const c=t.find(t=>t.name===e),{secret:d,componentType:u,componentProperties:p,hideFromReadData:h,customReadDataLabels:g}=c||{};if(h?.length&&ke(h,i,a))return;const{type:m}=ht(p,{type:""}),f=d||"password"===m;if(g?.length)g.forEach(({condition:t,...o},n)=>{t==r&&l.push({id:`${e}-custom-${n}`,title:o.title,label:o.value})});else if(r)if(f)l.push({id:e,title:n,label:new Array(10).fill("•").join("")});else{if(u===Rt.MultiInput){const t=ht(r,null);if(Array.isArray(t)&&t.length)return s(),void o.push({kind:"list",id:e,title:n,items:t.map((t,o)=>({id:`${e}-${o}`,label:String(t)}))})}if(u===Rt.KeyValuePair){const t=ht(r,null);if(Array.isArray(t)&&t.length)return s(),void o.push({kind:"pairs",id:e,title:n,items:t.map((t,o)=>{const n=t&&"object"==typeof t?t:{};return{id:`${e}-${o}`,title:null!=n.key?String(n.key):"",label:null!=n.value?String(n.value):""}})})}l.push({id:e,title:n,label:r})}else l.push({id:e,title:n,label:"-"})}),s(),o})(D,F);return e(o,{children:[t(oe,{isOpen:!0,header:{icon:H,iconSrc:G,title:D.name||D.destinationType.displayName,onClose:z,actions:[{id:"edit-destination-btn-edit",label:kt.EDIT,icon:mi,active:k,onClick:L},{id:"edit-destination-btn-delete",label:kt.DELETE,icon:ri,color:d.v2.colors.red[500],active:E,onClick:V}]},footer:{actions:k?[{"data-id":"edit-destination-btn-cancel",label:kt.CANCEL,variant:de.Secondary,onClick:M},...C?.option.testConnectionSupported&&!u?[{"data-id":"edit-destination-btn-test-connection",label:kt.TEST_CONNECTION,variant:de.Secondary,onClick:()=>T.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:kt.SAVE,variant:de.Primary,onClick:X}]:[]},children:t($t,{$padding:"4px 12px 12px",children:v?t(at,{$height:"50vh",children:t(ct,{withSpinner:!0})}):k&&C?t(Ls,{ref:T,isEdit:!0}):t(W,{$gap:16,children:e(Et,{bgTint:"1000",children:[e(Et,{bgTint:"900",children:[!u&&t(It,{conditions:D.conditions||[]}),t(Et,{bgTint:"800",cellsPerRow:2,items:Xr(D)})]}),!!j.length&&t(Et,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:j.map(e=>"cells"===e.kind?t(Et,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t(Et,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})})}),t(wl,{target:"destination",isOpen:E,onClose:()=>I(!1),onApprove:U}),t(xl,{isOpen:null!==A,onClose:()=>N(null),onApprove:B})]})},Ur=(e,t)=>{const o=[{id:"type",title:He.TYPE,label:t.label},{id:"status",title:He.STATUS,badge:{status:e.disabled?ft.Unknown:Ee.Success,label:e.disabled?He.DISABLED:He.ENABLED}}];return e.ruleName&&o.push({id:"name",title:He.NAME,label:e.ruleName}),e.profileName&&o.push({id:"profile",title:He.MANAGED_BY_PROFILE,label:e.profileName}),e.notes&&o.push({id:"notes",title:He.NOTES,label:e.notes}),o},Hr=({onClose:i,ruleId:r})=>{const c=f(),{addNotification:d}=Lt(),{instrumentationRulesApi:u}=sl(),{items:p,refetch:h}=u.useRules(),{selectedOption:g,loadRule:m,validateFormData:b,genericForm:v}=Ol();n(()=>{h()},[]);const[y,C]=s(!1),[S,w]=s(!1),[x,T]=s(null),k=y&&!!v?.isFormDirty,$=a(()=>p?.find(e=>Tt(e)===r),[r,p]),E=a(()=>gt.find(({type:e})=>e===$?.type)??null,[$?.type]);n(()=>{$&&m($)},[$]);const I=l(()=>{if($){if(!$.mutable)return void d({type:Ee.Warning,title:_t.FORBIDDEN,message:_t.CANNOT_EDIT_RULE,crdType:mt.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});C(!0)}},[$,d]),A=l(()=>{$&&(m($),C(!1))},[$,m]),N=l(()=>{k?T("close"):i()},[k,i]),O=l(()=>{k?T("cancel"):A()},[k,A]),R=l(()=>{const e=x;T(null),"close"===e?(A(),i()):A()},[x,A,i]),D=l(async()=>{if($){const{errorMessage:e,preparedFormData:t}=b();e||(await u.update($.ruleId,t,$.type),C(!1))}},[$,b,u]),P=l(()=>{if($){if(!$.mutable)return void d({type:Ee.Warning,title:_t.FORBIDDEN,message:_t.CANNOT_DELETE_RULE,crdType:mt.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});w(!0)}},[$,d]),F=l(async()=>{$&&(await u.remove($.ruleId,$.type),i())},[$,u,i]);if(!$||!E)return null;const L=((e,o)=>{const n=[];return e.payloadCollection&&Object.entries(e.payloadCollection).forEach(([e,o])=>{o&&n.push(t(ae,{size:le.XS,children:`• ${Ft(e).toLowerCase()}`},`payload-${e}`))}),e.codeAttributes&&Object.entries(e.codeAttributes).forEach(([e,o])=>{o&&n.push(t(ae,{size:le.XS,children:`• ${Ft(e).toLowerCase()}`},`code-${e}`))}),e.headersCollection?.[Pe.HeaderKeys]?.length&&e.headersCollection[Pe.HeaderKeys].forEach((e,o)=>{e&&n.push(t(ae,{size:le.XS,children:e},`header-${o}-${e}`))}),e.customInstrumentations&&(e.customInstrumentations[ze.Java]?.forEach((e,a)=>{const i=new _e(e.className,e.methodName);if(i.Verify()){0===a&&n.push(t(ae,{size:le.XS,children:"Java Custom Probes:"},"java-custom-probes"));const e=i.toString();n.push(t(ae,{size:le.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},`java-probe-${a}-${e}`))}}),e.customInstrumentations[ze.Golang]?.forEach((e,a)=>{const i=new Le(e.packageName,e.functionName,e.receiverName,e.receiverMethodName);if(i.Verify()){0===a&&n.push(t(ae,{size:le.XS,children:"Golang Custom Probes:"},"golang-custom-probes"));const e=i.toString();n.push(t(ae,{size:le.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},`golang-probe-${a}-${e}`))}})),n})($,c);return e(o,{children:[t(oe,{isOpen:!0,header:{icon:Mt($.type),title:E.label,onClose:N,actions:[{id:"edit-rule-btn-edit",label:kt.EDIT,icon:mi,active:y,onClick:I},{id:"edit-rule-btn-delete",label:kt.DELETE,icon:ri,color:c.v2.colors.red[500],active:S,onClick:P}]},footer:{actions:y?[{"data-id":"edit-rule-btn-cancel",label:kt.CANCEL,variant:de.Secondary,onClick:O},{"data-id":"edit-rule-btn-save",label:kt.SAVE,variant:de.Primary,onClick:D}]:[]},children:t($t,{$padding:"4px 12px 12px",children:y&&g?t(Hs,{}):t(W,{$gap:16,children:e(Et,{bgTint:"1000",children:[e(Et,{bgTint:"900",children:[t(It,{conditions:$.conditions||[]}),t(Et,{bgTint:"800",cellsPerRow:2,items:Ur($,E)})]}),t(ul,{readOnly:!0,scopes:$.sourceScopes??null}),!!L.length&&t(Et,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Et,{bgTint:"800",children:L})}),!!E.supportedLanguages.length&&t(Et,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Et,{bgTint:"800",children:t(se,{$gap:12,$wrap:"wrap",children:E.supportedLanguages.map(e=>t(zt,{label:Xe[e],leftIcon:Ve(e),flex:"0.5"},e))})})})]})})})}),t(wl,{target:"instrumentation rule",isOpen:S,onClose:()=>w(!1),onApprove:F}),t(xl,{isOpen:null!==x,onClose:()=>T(null),onApprove:R})]})};var Gr;!function(e){e.Overview="overview",e.Pods="pods",e.PeerSources="peer-sources",e.Profiling="profiling",e.Sampling="sampling",e.Debug="debug"}(Gr||(Gr={}));const jr=({collapseIsDefaultOpen:e,isJumpToTarget:o,onClickRestartPod:n,namespace:i,podName:l,nodeName:s,startTime:r,agentInjectedStatus:c,odigosHealthStatus:d,k8sHealthStatus:u,children:p})=>{const{formatDurationAgo:h}=Bt(),g=Xt(!!o),m=a(()=>({title:l,icon:Ai,withCopy:!0}),[l]),f=a(()=>{const e=[],t=Vt(c);t&&e.push(t);const o=Vt(d,Ni,"health");o&&e.push(o);const n=Vt(u,Oi,"health");return n&&e.push(n),e},[c,d,u]),b=a(()=>n?[{id:`restart-pod-${l}`,icon:Ri,label:kt.RESTART_POD,onClick:()=>n(i,l)}]:void 0,[n,i,l]),v=a(()=>[{id:"nodeName",title:He.NODE,label:s,withCopy:!0},{id:"age",title:He.AGE,label:r?h(r,{style:"short"}):He.NOT_RUNNING,labelTooltip:r}],[s,r,h]);return t("div",{ref:g,children:t(Et,{bgTint:"900",richTitle:m,badges:f,dropDataActions:b,items:v,withCollapse:!0,collapseIsDefaultOpen:e,children:p})})},Wr=m.div`
191
+ `,Pr=({clusterId:n,namespaceName:o,checkbox:a,isFutureApps:i,selectedCounts:l,isActive:s,onActive:r,handleSourceChange:c})=>{const{isVm:d}=y(),u=e=>{r(),c({clusterId:n,workloadId:{namespace:o},auto:e.auto,selected:e.all})};return t(Rr,{children:t(ar,{dataId:`namespace-${o}`,withCarret:!0,title:o,isSelected:s,onClick:r,isPartiallyChecked:a.partial,isChecked:a.all,onCheckboxChange:e=>u({auto:e,all:e}),children:e(se,{$gap:12,children:[!d&&t(Dr,{$visible:s||i,children:t(De,{text:Ir,children:t(Q,{label:$r,labelAlign:ee.Left,size:bt.S,value:i,onChange:e=>u({auto:e,all:e||void 0})})})}),e(se,{$gap:8,children:[t(ae,{variant:vt.Span,size:le.XXXS,color:ie.Secondary,align:"right",children:Tr}),t(Be,{label:`${l.sourced}/${l.total}`,status:s?Ie.Default:Ie.Unknown,minWidth:"42px"})]})]})})})},Fr=({withCollapse:e,clusterId:n,clusterName:o,namespaces:i,selectedArea:l,setSelectedArea:s,handleSourceChange:r})=>{const c=a(()=>i.map(({name:e,totalWorkloads:a,selectedCount:i,isAllSourced:c,isSomeSourced:d,isFutureApps:u})=>t(Pr,{clusterId:n,namespaceName:e,isFutureApps:u,checkbox:{all:c||u,partial:d},selectedCounts:{sourced:i,total:a},isActive:l.clusterId===n&&l.namespaceName===e,onActive:()=>s({clusterId:n,clusterName:o,namespaceName:e}),handleSourceChange:r},`${n}#${e}`)),[n,o,i,l]);return e?t(cr,{title:o,list:c,noBgColor:!0}):c},Lr=({onClose:n,onBack:i,onNext:l,selectedConnectionIds:r,setSelectedConnectionIds:c,withOverlay:d,disableAnimation:u})=>{const{isVm:p}=y(),{sourcesApi:h,snapshotsApi:m,namespacesApi:g}=ll(),{data:f,loading:b,refetch:v}=m.useSnapshots(),{items:C,loading:S,refetch:w}=g.useNamespaces(),x=yr(p),{selectedStreamName:k}=He(),{progress:T,resetProgress:$}=yt(),{isFetching:I,setIsFetching:E,setSnapshots:A,formData:N,handleSourceChange:O,handleSelectAll:R,formDiff:D,isFormDirty:P}=zl();o(()=>{v(),w()},[]);const F=a(()=>{if(f)return f;const e=C;return e.length?{clusters:[{clusterId:St,clusterName:Ct,namespaces:e.map(e=>({name:e.name,selected:e.markedForInstrumentation&&e.dataStreamNames.includes(k),workloads:e.workloads?.map(e=>({namespace:e.id.namespace,name:e.id.name,kind:e.id.kind,selected:(e.markedForInstrumentation?.markedForInstrumentation??!1)&&(e.dataStreamNames?.includes(k)??!1)}))||[]}))}]}:null},[f,C,k]);o(()=>{E(b||S),F&&A(F)},[F,b,S,E,A]);const[L,_]=s(""),[M,z]=s(gt.Namespace),[B,X]=s({showOnlySelected:!1}),[V,U]=s({clusterId:"",clusterName:"",namespaceName:""}),G=(({isFetching:n,formData:o,handleSourceChange:i,handleSelectAll:l,selectedArea:s,setSelectedArea:r,searchText:c,searchBy:d,filters:u})=>{const{isVm:p}=y(),h=yr(p),m=a(()=>o.map(e=>{const t=[...e.namespaces].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>_l(e,c,u)).map(e=>({name:e.name,totalWorkloads:e.workloads.length,...Ml(e)}));return{clusterId:e.clusterId,clusterName:e.clusterName,visibleNamespaces:t}}),[o,c,u]),g=a(()=>{let e=!1;for(const{visibleNamespaces:t}of m)for(const{totalWorkloads:n,selectedCount:o}of t)if(e=!0,o!==n)return!1;return e},[m]),{list:f,withFilterCount:b,filteredCount:v,totalCount:C}=a(()=>{const e=m.map(({clusterId:e,clusterName:n,visibleNamespaces:o})=>o.length?t(Fr,{withCollapse:m.length>1,clusterId:e,clusterName:n,namespaces:o,selectedArea:s,setSelectedArea:r,handleSourceChange:i},e):null),n=e.filter(e=>null!==e);return{list:n,withFilterCount:n.length!==e.length,filteredCount:n.length,totalCount:e.length}},[m,s]);return{width:"60%",header:e(se,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(se,{$gap:8,children:[t(ae,{size:le.XS,nowrap:!0,children:h.groupColumnHeader}),t(De,{text:b?Ge.FILTERED_COUNT_TOOLTIP:void 0,children:t(Be,{label:`${b?`${v} / ${C}`:C}`,status:Ie.Unknown})})]}),t(ae,{"data-id":"namespaces-select-all",onClick:()=>l({boolean:!g,searchText:c,searchBy:d,filters:u}),disabled:!f.length,size:le.XS,children:xr(g)})]}),list:f.length?f:n?[t(at,{$height:"100%",children:t(ct,{title:h.fetchingGroups.title,subTitle:h.fetchingGroups.subTitle,withSpinner:!0})},"loading")]:[t(at,{$height:"100%",children:t(Ce,c?{icon:Ti,title:Cr,subTitle:h.noGroupMatchedFilter(c)}:{icon:Ti,title:h.noGroups.title,subTitle:h.noGroups.subTitle})},"no-data")]}})({isFetching:I,formData:N,handleSourceChange:O,handleSelectAll:R,selectedArea:V,setSelectedArea:U,searchText:M===gt.Namespace?L:"",searchBy:M,filters:B}),H=(({formData:n,handleSourceChange:o,handleSelectAll:i,selectedArea:l,searchText:s,searchBy:r,filters:c})=>{const{tier:d,isVm:u}=y(),p=yr(u),h=d===ft.Onprem,m=a(()=>l.value.namespaceName?n.find(({clusterId:e})=>e===l.value.clusterId)?.namespaces.find(({name:e})=>e===l.value.namespaceName):void 0,[n,l.value.clusterId,l.value.namespaceName]),g=a(()=>m?[...m.workloads].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Fl(e,s,c)):[],[m,s,c]),f=a(()=>!!g.length&&g.every(({selected:e})=>e),[g]),b=a(()=>{if(!m)return[];const{clusterId:e}=l.value,{name:n}=m;return g.map(({name:a,selected:i,kind:l})=>{const s=!u&&!h&&Ll.has(l);return t(Or,{workloadName:a,workloadKind:l,isChecked:!s&&(i||!1),onToggle:()=>o({clusterId:e,workloadId:{namespace:n,name:a,kind:l}}),disabled:s,disabledReason:Er},`${e}#${n}#${a}#${l}`)})},[g,m,l.value.clusterId]),{withFilterCount:v,filteredCount:C,totalCount:S}=a(()=>{const e=m?.workloads.length??0;return{withFilterCount:g.length!==e,filteredCount:g.length,totalCount:e}},[g,m]);return{width:"40%",header:e(se,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(se,{$gap:8,children:[t(ae,{size:le.XS,nowrap:!0,children:l.value.namespaceName?`${l.value.namespaceName} > ${p.itemColumnHeader}`:p.itemColumnHeader}),t(De,{text:v?Ge.FILTERED_COUNT_TOOLTIP:void 0,children:t(Be,{label:`${v?`${C} / ${S}`:S}`,status:Ie.Unknown})})]}),t(ae,{"data-id":"workloads-select-all",onClick:()=>i({clusterId:l.value.clusterId,namespaceName:l.value.namespaceName,boolean:!f,searchText:s,searchBy:r,filters:c}),disabled:!b.length,size:le.XS,children:xr(f)})]}),list:b.length?b:[t(at,{$height:"100%",children:t(Ce,m?s?{icon:ki,title:Cr,subTitle:wr(s)}:{icon:ki,title:Sr,subTitle:p.noItemsInGroupSubTitle}:{icon:ki,title:p.selectGroupPrompt.title,subTitle:p.selectGroupPrompt.subTitle})},"no-data")]}})({formData:N,handleSourceChange:O,handleSelectAll:R,selectedArea:{value:V},searchText:M===gt.Source?L:"",searchBy:M,filters:B});return t(Cl,{isOpen:!0,withOverlay:d,disableAnimation:u,onClose:n?()=>{$(wt.BulkInstrumenting),n()}:void 0,onBack:i?()=>i(D):void 0,onNext:l?()=>l(D):void 0,nextIsSkip:!P,onSave:()=>h.persistV2(D),header:{icon:ki,title:Ge.ADD_SOURCE,subTitle:Ge.ADD_SOURCES_DESCRIPTION},connectionIds:r&&c?{value:r,setValue:c}:void 0,search:{value:L,onChange:e=>{_(e),M===gt.Namespace&&U({clusterId:"",clusterName:"",namespaceName:""})},placeholder:x.searchPlaceholder(M),segment:{options:[{label:x.groupSegmentLabel,value:gt.Namespace},{label:x.itemSegmentLabel,value:gt.Source}],selected:M,setSelected:z}},filters:e(se,{$gap:8,children:[t(ae,{size:le.XXXS,color:ie.Secondary,nowrap:!0,children:kr}),t(Q,{name:"filter-selected",size:bt.S,label:Tr,value:B.showOnlySelected,onChange:e=>X(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:P,isFetching:I,progress:{title:Ge.CREATING_SOURCES,subTitle:Ge.CREATING_SOURCES_SUBTITLE,percentage:T[wt.BulkInstrumenting]?.percentage||0},leftColumn:G,rightColumn:H})},_r=(e,t)=>{const n=[{id:"type",title:Ge.TYPE,label:t.label},{id:"status",title:Ge.STATUS,badge:{status:e.disabled?Ie.Unknown:Ie.Success,label:e.disabled?Ge.DISABLED:Ge.ENABLED}}],o=e.signals?.map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return o&&n.push({id:"signals",title:Ge.SIGNALS_FOR_PROCESSING,label:o}),e.name&&n.push({id:"name",title:Ge.NAME,label:e.name}),e.notes&&n.push({id:"notes",title:Ge.NOTES,label:e.notes}),n},Mr=({onClose:i,actionId:r})=>{const c=f(),{actionsApi:d}=ll(),{items:u,refetch:p}=d.useActions(),{selectedOption:h,loadAction:m,validateFormData:g,genericForm:b}=El();o(()=>{p()},[]);const[v,y]=s(!1),[C,S]=s(!1),[w,x]=s(null),k=v&&!!b?.isFormDirty,T=a(()=>u?.find(e=>xt(e)===r),[r,u]),$=a(()=>ot.find(({type:e})=>e===T?.type)??null,[T?.type]);o(()=>{T&&m(T)},[T]);const I=l(()=>{T&&y(!0)},[T]),E=l(()=>{T&&(m(T),y(!1))},[T,m]),A=l(()=>{k?x("close"):i()},[k,i]),N=l(()=>{k?x("cancel"):E()},[k,E]),O=l(()=>{const e=w;x(null),"close"===e?(E(),i()):E()},[w,E,i]),R=l(async()=>{if(T){const{errorMessage:e,preparedFormData:t}=g();e||(await d.update(T.id,t),y(!1))}},[T,g,d]),D=l(()=>{T&&S(!0)},[T]),P=l(async()=>{T&&(await d.remove(T.id,T.type),i())},[T,d,i]);if(!T||!$)return null;const F=(e=>{const t=[],{type:n,fields:o}=e,a=e=>({status:e?Ie.Success:Ie.Unknown,label:e?"True":"False",invertColors:!0});if(n===ye.K8sAttributes&&(t.push({id:"collectContainerAttributes",title:"Collect Container Attributes",badge:a(o.collectContainerAttributes)}),t.push({id:"collectReplicaSetAttributes",title:"Collect ReplicaSet Attributes",badge:a(o.collectReplicaSetAttributes)}),t.push({id:"collectWorkloadId",title:"Collect Workload ID",badge:a(o.collectWorkloadId)}),t.push({id:"collectClusterId",title:"Collect Cluster ID",badge:a(o.collectClusterId)}),o.labelsAttributes?.forEach(({labelKey:e,attributeKey:n,from:a,fromSources:i},l)=>{const s=i?.length?i.join(", "):a||Z.Pod,r=(o.labelsAttributes?.length??0)>1?`Label #${l+1} `:"Label ";t.push({id:`label-${l}-key`,title:`${r}Key`,label:e}),t.push({id:`label-${l}-attr`,title:`${r}Attribute Key`,label:n}),t.push({id:`label-${l}-from`,title:`${r}From`,label:s})}),o.annotationsAttributes?.forEach(({annotationKey:e,attributeKey:n,from:a,fromSources:i},l)=>{const s=i?.length?i.join(", "):a||Z.Pod,r=(o.annotationsAttributes?.length??0)>1?`Annotation #${l+1} `:"Annotation ";t.push({id:`annotation-${l}-key`,title:`${r}Key`,label:e}),t.push({id:`annotation-${l}-attr`,title:`${r}Attribute Key`,label:n}),t.push({id:`annotation-${l}-from`,title:`${r}From`,label:s})})),n===ye.AddClusterInfo&&(t.push({id:"overwriteExistingValues",title:"Overwrite Existing Values",badge:a(o.overwriteExistingValues)}),o.clusterAttributes?.forEach(({attributeName:e,attributeStringValue:n},o)=>{t.push({id:`cluster-attr-${o}`,title:e,label:n})})),n===ye.DeleteAttributes&&o.attributeNamesToDelete?.forEach((e,n)=>{t.push({id:`del-attr-${n}`,title:"Attribute"+((o.attributeNamesToDelete?.length??0)>1?` #${n+1}`:""),label:e})}),n===ye.RenameAttributes&&Object.entries(o.renames||{}).forEach(([e,n],o)=>{t.push({id:`rename-${o}`,title:e,label:n})}),n===ye.PiiMasking&&o.piiCategories?.forEach((e,n)=>{t.push({id:`pii-${n}`,title:"Category"+((o.piiCategories?.length??0)>1?` #${n+1}`:""),label:e})}),n===ye.ExtractAttribute){const e=o.extractAttribute?.extractions??[];e.forEach(({targetAttributeName:n,lookupKey:o,dataFormat:a,regex:i},l)=>{const s=e.length>1?`Extraction #${l+1} `:"Extraction ";t.push({id:`extract-${l}-target`,title:`${s}New Attribute Name`,label:n||"-"}),o&&t.push({id:`extract-${l}-lookupKey`,title:`${s}Lookup Key`,label:o}),a&&t.push({id:`extract-${l}-format`,title:`${s}Data Format`,label:a}),i&&t.push({id:`extract-${l}-regex`,title:`${s}Regex`,label:i})})}return n===ye.URLTemplatization&&o.urlTemplatizationRulesGroups?.forEach((e,n)=>{const a=(o.urlTemplatizationRulesGroups?.length??0)>1?`Group #${n+1} `:"Group ";e.filterK8sNamespace&&t.push({id:`group-${n}-ns`,title:`${a}Namespace`,label:e.filterK8sNamespace}),e.workloadFilters?.forEach((o,i)=>{const l=[o.kind,o.name].filter(Boolean).join("/");l&&t.push({id:`group-${n}-wf-${i}`,title:`${a}Workload${(e.workloadFilters?.length??0)>1?` #${i+1}`:""}`,label:l})});const i=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");i&&t.push({id:`group-${n}-templates`,title:`${a}Templates`,label:i}),e.notes&&t.push({id:`group-${n}-notes`,title:`${a}Notes`,label:e.notes})}),t})(T);return e(n,{children:[t(ne,{isOpen:!0,header:{icon:Et(T.type),title:$.label,onClose:A,actions:[{id:"edit-action-btn-edit",label:kt.EDIT,icon:hi,active:v,onClick:I},{id:"edit-action-btn-delete",label:kt.DELETE,icon:li,color:c.v2.colors.red[500],active:C,onClick:D}]},footer:{actions:v?[{"data-id":"edit-action-btn-cancel",label:kt.CANCEL,variant:de.Secondary,onClick:N},{"data-id":"edit-action-btn-save",label:kt.SAVE,variant:de.Primary,onClick:R}]:[]},children:t(Tt,{$padding:"4px 12px 12px",children:v&&h?t(Rs,{}):t(W,{$gap:16,children:e($t,{bgTint:"1000",children:[e($t,{bgTint:"900",children:[t(It,{conditions:T.conditions||[]}),t($t,{bgTint:"800",cellsPerRow:2,items:_r(T,$)})]}),!!F?.length&&t($t,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t($t,{bgTint:"800",cellsPerRow:2,items:F})})]})})})}),t(Sl,{target:"action",isOpen:C,onClose:()=>S(!1),onApprove:P}),t(wl,{isOpen:null!==w,onClose:()=>x(null),onApprove:O})]})},zr=({onClose:n,connections:l,selectedConnectionIds:r,setSelectedConnectionIds:c})=>{const{configApi:d}=ll(),[u,p]=s(""),[h,m]=s({showOnlySelected:!1}),g=a(()=>l.filter(e=>{const t=!u||e.name.toLowerCase().includes(u.toLowerCase()),n=!h.showOnlySelected||h.showOnlySelected&&r.includes(e.id);return t&&n}),[l.length,r.length,u,h]),f=e=>{c(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},b=1===r.length?r[0]:void 0,{data:v,loading:y}=d.useEffectiveConfig(b?{id:b}:void 0,{skip:!b}),C=a(()=>{if(b&&v)return{rollout:{automaticRolloutDisabled:v.rollout?.automaticRolloutDisabled??!1}}},[b,v]),{formData:S,handleFormChange:w,areFormValuesEqual:x,resetFormData:k}=At(C||{rollout:{automaticRolloutDisabled:!1}}),T=i(k);T.current=k,o(()=>{C&&T.current(C)},[C]);const $=a(()=>r.length>1||void 0!==C&&!x(C,S),[r.length,C,S]);return t(Cl,{isOpen:!0,onClose:n,onSave:async()=>await(d.applyConfigurations?.(S,r))??void 0,header:{icon:$i,title:"Cluster Configuration"},connectionIds:{value:r,setValue:c},search:{placeholder:"Search by cluster name",value:u,onChange:p},filters:e(se,{$gap:8,children:[t(ae,{size:le.XXXS,color:ie.Secondary,nowrap:!0,children:"Show only:"}),t(Q,{size:bt.S,label:"Selected",value:h.showOnlySelected,onChange:e=>m(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:$,isFetching:y,leftColumn:{width:"35%",header:e(se,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(se,{$gap:8,children:[t(ae,{size:le.XS,children:"Clusters"}),t(Be,{label:g.length,status:Ie.Unknown})]}),e(se,{$gap:8,children:[t(ae,{size:le.XXXS,color:ie.Secondary,align:"right",children:"Selected clusters"}),t(Be,{label:`${r.length}/${g.length}`,status:Ie.Unknown})]})]}),list:g.map(e=>t(ar,{title:e.name,isChecked:r.includes(e.id),onClick:()=>f(e.id),onCheckboxChange:()=>f(e.id)},e.id))},rightColumn:{width:"65%",header:t(ae,{size:le.XS,children:"Configurations"}),list:[t(Q,{label:"Automatic rollout disabled",tooltip:"Odigos automatically triggers a one-time rollout for workloads when instrumenting or uninstrumenting, ensuring that changes are applied without requiring manual intervention. When automatic rollout is disabled, Odigos will not restart workloads, and users will need to manually trigger rollouts after adding or removing sources.",value:S.rollout?.automaticRolloutDisabled||!1,onChange:e=>w("rollout.automaticRolloutDisabled",e)},"automatic-rollout-disabled")]}})},Br=e=>{const t=[{id:"type",title:Ge.TYPE,label:e.destinationType.displayName},{id:"status",title:Ge.STATUS,badge:{status:e.disabled?Ie.Unknown:Ie.Success,label:e.disabled?Ge.DISABLED:Ge.ENABLED}}],n=Ae(e.exportedSignals).map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return n&&t.push({id:"monitors",title:Ge.MONITORS,label:n}),e.name&&t.push({id:"name",title:Ge.NAME,label:e.name}),t},Xr=({onClose:r,destinationId:c})=>{const d=f(),{isVm:u}=y(),{destinationsApi:p}=ll(),{selectedStreamName:h}=He(),{items:m,refetch:g}=p.useDestinations(),{data:b,loading:v}=p.useDestinationCategories(),{activeForm:C,loadDestination:S,validateFormData:w,genericForm:x}=Al();o(()=>{g()},[]);const k=i(null),[T,$]=s(!1),[I,E]=s(!1),[A,N]=s(null),O=T&&!!x?.isFormDirty,R=a(()=>Rt(m,h),[m,h]),D=a(()=>R?.find(e=>xt(e)===c),[c,R]),P=b?.destinationCategories?.categories??null;o(()=>{D&&P&&S(D,P)},[D,P]);const F=a(()=>D&&P?Dt(P,D):[],[D,P]),L=l(()=>{D&&$(!0)},[D]),_=l(()=>{D&&P&&(S(D,P),$(!1))},[D,P,S]),M=l(()=>{O?N("close"):r()},[O,r]),z=l(()=>{O?N("cancel"):_()},[O,_]),B=l(()=>{const e=A;N(null),"close"===e?(_(),r()):_()},[A,_,r]),X=l(async()=>{if(D){const{errorMessage:e,preparedFormData:t}=w();e||(await p.update(D.id,Oe(t)),$(!1))}},[D,w,p]),V=l(()=>{D&&E(!0)},[D]),U=l(async()=>{D&&(await p.remove(D.id),r())},[D,p,r]);if(!D)return null;const{icon:G,iconSrc:H}=ut(D.destinationType.type),j=((e,t)=>{const n=[],o=Nt(e,t),a=o.map(e=>({name:e.key,value:e.value})),i=Ae(e.exportedSignals);let l=[];const s=()=>{l.length&&(n.push({kind:"cells",id:`cells-${n.length}`,items:l}),l=[])};return o.forEach(({key:e,name:o,value:r})=>{const c=t.find(t=>t.name===e),{secret:d,componentType:u,componentProperties:p,hideFromReadData:h,customReadDataLabels:m}=c||{};if(h?.length&&Te(h,i,a))return;const{type:g}=ht(p,{type:""}),f=d||"password"===g;if(m?.length)m.forEach(({condition:t,...n},o)=>{t==r&&l.push({id:`${e}-custom-${o}`,title:n.title,label:n.value})});else if(r)if(f)l.push({id:e,title:o,label:new Array(10).fill("•").join("")});else{if(u===Ot.MultiInput){const t=ht(r,null);if(Array.isArray(t)&&t.length)return s(),void n.push({kind:"list",id:e,title:o,items:t.map((t,n)=>({id:`${e}-${n}`,label:String(t)}))})}if(u===Ot.KeyValuePair){const t=ht(r,null);if(Array.isArray(t)&&t.length)return s(),void n.push({kind:"pairs",id:e,title:o,items:t.map((t,n)=>{const o=t&&"object"==typeof t?t:{};return{id:`${e}-${n}`,title:null!=o.key?String(o.key):"",label:null!=o.value?String(o.value):""}})})}l.push({id:e,title:o,label:r})}else l.push({id:e,title:o,label:"-"})}),s(),n})(D,F);return e(n,{children:[t(ne,{isOpen:!0,header:{icon:G,iconSrc:H,title:D.name||D.destinationType.displayName,onClose:M,actions:[{id:"edit-destination-btn-edit",label:kt.EDIT,icon:hi,active:T,onClick:L},{id:"edit-destination-btn-delete",label:kt.DELETE,icon:li,color:d.v2.colors.red[500],active:I,onClick:V}]},footer:{actions:T?[{"data-id":"edit-destination-btn-cancel",label:kt.CANCEL,variant:de.Secondary,onClick:z},...C?.option.testConnectionSupported&&!u?[{"data-id":"edit-destination-btn-test-connection",label:kt.TEST_CONNECTION,variant:de.Secondary,onClick:()=>k.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:kt.SAVE,variant:de.Primary,onClick:X}]:[]},children:t(Tt,{$padding:"4px 12px 12px",children:v?t(at,{$height:"50vh",children:t(ct,{withSpinner:!0})}):T&&C?t(Fs,{ref:k,isEdit:!0}):t(W,{$gap:16,children:e($t,{bgTint:"1000",children:[e($t,{bgTint:"900",children:[!u&&t(It,{conditions:D.conditions||[]}),t($t,{bgTint:"800",cellsPerRow:2,items:Br(D)})]}),!!j.length&&t($t,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:j.map(e=>"cells"===e.kind?t($t,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t($t,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})})}),t(Sl,{target:"destination",isOpen:I,onClose:()=>E(!1),onApprove:U}),t(wl,{isOpen:null!==A,onClose:()=>N(null),onApprove:B})]})},Vr=(e,t)=>{const n=[{id:"type",title:Ge.TYPE,label:t.label},{id:"status",title:Ge.STATUS,badge:{status:e.disabled?Ie.Unknown:Ie.Success,label:e.disabled?Ge.DISABLED:Ge.ENABLED}}];return e.ruleName&&n.push({id:"name",title:Ge.NAME,label:e.ruleName}),e.profileName&&n.push({id:"profile",title:Ge.MANAGED_BY_PROFILE,label:e.profileName}),e.notes&&n.push({id:"notes",title:Ge.NOTES,label:e.notes}),n},Ur=({onClose:i,ruleId:r})=>{const c=f(),{addNotification:d}=Ft(),{instrumentationRulesApi:u}=ll(),{items:p,refetch:h}=u.useRules(),{selectedOption:m,loadRule:g,validateFormData:b,genericForm:v}=Nl();o(()=>{h()},[]);const[y,C]=s(!1),[S,w]=s(!1),[x,k]=s(null),T=y&&!!v?.isFormDirty,$=a(()=>p?.find(e=>xt(e)===r),[r,p]),I=a(()=>mt.find(({type:e})=>e===$?.type)??null,[$?.type]);o(()=>{$&&g($)},[$]);const E=l(()=>{if($){if(!$.mutable)return void d({type:Ie.Warning,title:Lt.FORBIDDEN,message:Lt.CANNOT_EDIT_RULE,crdType:gt.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});C(!0)}},[$,d]),A=l(()=>{$&&(g($),C(!1))},[$,g]),N=l(()=>{T?k("close"):i()},[T,i]),O=l(()=>{T?k("cancel"):A()},[T,A]),R=l(()=>{const e=x;k(null),"close"===e?(A(),i()):A()},[x,A,i]),D=l(async()=>{if($){const{errorMessage:e,preparedFormData:t}=b();e||(await u.update($.ruleId,t,$.type),C(!1))}},[$,b,u]),P=l(()=>{if($){if(!$.mutable)return void d({type:Ie.Warning,title:Lt.FORBIDDEN,message:Lt.CANNOT_DELETE_RULE,crdType:gt.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});w(!0)}},[$,d]),F=l(async()=>{$&&(await u.remove($.ruleId,$.type),i())},[$,u,i]);if(!$||!I)return null;const L=((e,n)=>{const o=[];return e.payloadCollection&&Object.entries(e.payloadCollection).forEach(([e,n])=>{n&&o.push(t(ae,{size:le.XS,children:`• ${Pt(e).toLowerCase()}`},`payload-${e}`))}),e.codeAttributes&&Object.entries(e.codeAttributes).forEach(([e,n])=>{n&&o.push(t(ae,{size:le.XS,children:`• ${Pt(e).toLowerCase()}`},`code-${e}`))}),e.headersCollection?.[Pe.HeaderKeys]?.length&&e.headersCollection[Pe.HeaderKeys].forEach((e,n)=>{e&&o.push(t(ae,{size:le.XS,children:e},`header-${n}-${e}`))}),e.customInstrumentations&&(e.customInstrumentations[Me.Java]?.forEach((e,a)=>{const i=new _e(e.className,e.methodName);if(i.Verify()){0===a&&o.push(t(ae,{size:le.XS,children:"Java Custom Probes:"},"java-custom-probes"));const e=i.toString();o.push(t(ae,{size:le.XXS,color:n.v2.colors.grey[200],children:`• ${e}`},`java-probe-${a}-${e}`))}}),e.customInstrumentations[Me.Golang]?.forEach((e,a)=>{const i=new Le(e.packageName,e.functionName,e.receiverName,e.receiverMethodName);if(i.Verify()){0===a&&o.push(t(ae,{size:le.XS,children:"Golang Custom Probes:"},"golang-custom-probes"));const e=i.toString();o.push(t(ae,{size:le.XXS,color:n.v2.colors.grey[200],children:`• ${e}`},`golang-probe-${a}-${e}`))}})),o})($,c);return e(n,{children:[t(ne,{isOpen:!0,header:{icon:Mt($.type),title:I.label,onClose:N,actions:[{id:"edit-rule-btn-edit",label:kt.EDIT,icon:hi,active:y,onClick:E},{id:"edit-rule-btn-delete",label:kt.DELETE,icon:li,color:c.v2.colors.red[500],active:S,onClick:P}]},footer:{actions:y?[{"data-id":"edit-rule-btn-cancel",label:kt.CANCEL,variant:de.Secondary,onClick:O},{"data-id":"edit-rule-btn-save",label:kt.SAVE,variant:de.Primary,onClick:D}]:[]},children:t(Tt,{$padding:"4px 12px 12px",children:y&&m?t(Us,{}):t(W,{$gap:16,children:e($t,{bgTint:"1000",children:[e($t,{bgTint:"900",children:[t(It,{conditions:$.conditions||[]}),t($t,{bgTint:"800",cellsPerRow:2,items:Vr($,I)})]}),t(dl,{readOnly:!0,scopes:$.sourceScopes??null}),!!L.length&&t($t,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t($t,{bgTint:"800",children:L})}),!!I.supportedLanguages.length&&t($t,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t($t,{bgTint:"800",children:t(se,{$gap:12,$wrap:"wrap",children:I.supportedLanguages.map(e=>t(_t,{label:Xe[e],leftIcon:Ve(e),flex:"0.5"},e))})})})]})})})}),t(Sl,{target:"instrumentation rule",isOpen:S,onClose:()=>w(!1),onApprove:F}),t(wl,{isOpen:null!==x,onClose:()=>k(null),onApprove:R})]})};var Gr;!function(e){e.Overview="overview",e.Pods="pods",e.PeerSources="peer-sources",e.Profiling="profiling",e.Sampling="sampling",e.Debug="debug"}(Gr||(Gr={}));const Hr=({collapseIsDefaultOpen:e,isJumpToTarget:n,onClickRestartPod:o,namespace:i,podName:l,nodeName:s,startTime:r,agentInjectedStatus:c,odigosHealthStatus:d,k8sHealthStatus:u,children:p})=>{const{formatDurationAgo:h}=zt(),m=Bt(!!n),g=a(()=>({title:l,icon:Ii,withCopy:!0}),[l]),f=a(()=>{const e=[],t=Xt(c);t&&e.push(t);const n=Xt(d,Ei,"health");n&&e.push(n);const o=Xt(u,Ai,"health");return o&&e.push(o),e},[c,d,u]),b=a(()=>o?[{id:`restart-pod-${l}`,icon:Ni,label:kt.RESTART_POD,onClick:()=>o(i,l)}]:void 0,[o,i,l]),v=a(()=>[{id:"nodeName",title:Ge.NODE,label:s,withCopy:!0},{id:"age",title:Ge.AGE,label:r?h(r,{style:"short"}):Ge.NOT_RUNNING,labelTooltip:r}],[s,r,h]);return t("div",{ref:m,children:t($t,{bgTint:"900",richTitle:g,badges:f,dropDataActions:b,items:v,withCollapse:!0,collapseIsDefaultOpen:e,children:p})})},jr=g.div`
192
192
  display: flex;
193
193
  align-items: center;
194
194
  justify-content: space-between;
@@ -196,7 +196,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
196
196
  padding: ${({$noPadding:e})=>e?"0":"12px"};
197
197
  border-radius: 12px;
198
198
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
199
- `,Kr=({podsOdigosHealthStatus:o,pods:n,noPadding:i})=>{const l=Gt(o?.status),s=Ft(o?.name),r=o?.message,{totalPodsCount:c,injectionsAsExpectedCount:d,odigosHealthyPodsCount:u,k8sHealthyPodsCount:p}=a(()=>({totalPodsCount:n?.length||0,injectionsAsExpectedCount:n?.reduce((e,t)=>e+(t.agentInjectedStatus?.status===Ut.Success?1:0),0)||0,odigosHealthyPodsCount:n?.reduce((e,t)=>e+(t.odigosHealthStatus?.status===Ut.Success?1:0),0)||0,k8sHealthyPodsCount:n?.reduce((e,t)=>e+(t.k8sHealthStatus?.status===Ut.Success?1:0),0)||0}),[n]);return n?.length&&o&&l?e(Wr,{$noPadding:i,children:[t(Ht,{invertColors:!0,hideBackground:!0,status:l,title:s,subTitle:r}),e(se,{$gap:8,children:[t(Jr,{label:He.PODS,count:c}),t(Jr,{label:He.INJECTIONS_AS_EXPECTED,count:d,total:c}),t(Jr,{label:He.ODIGOS_HEALTHY,icon:Ni,count:u,total:c}),t(Jr,{label:He.KUBERNETES_HEALTHY,icon:Oi,count:p,total:c})]})]}):null},Yr=m.div`
199
+ `,Wr=({podsOdigosHealthStatus:n,pods:o,noPadding:i})=>{const l=Gt(n?.status),s=Pt(n?.name),r=n?.message,{totalPodsCount:c,injectionsAsExpectedCount:d,odigosHealthyPodsCount:u,k8sHealthyPodsCount:p}=a(()=>({totalPodsCount:o?.length||0,injectionsAsExpectedCount:o?.reduce((e,t)=>e+(t.agentInjectedStatus?.status===Vt.Success?1:0),0)||0,odigosHealthyPodsCount:o?.reduce((e,t)=>e+(t.odigosHealthStatus?.status===Vt.Success?1:0),0)||0,k8sHealthyPodsCount:o?.reduce((e,t)=>e+(t.k8sHealthStatus?.status===Vt.Success?1:0),0)||0}),[o]);return o?.length&&n&&l?e(jr,{$noPadding:i,children:[t(Ut,{invertColors:!0,hideBackground:!0,status:l,title:s,subTitle:r}),e(se,{$gap:8,children:[t(Yr,{label:Ge.PODS,count:c}),t(Yr,{label:Ge.INJECTIONS_AS_EXPECTED,count:d,total:c}),t(Yr,{label:Ge.ODIGOS_HEALTHY,icon:Ei,count:u,total:c}),t(Yr,{label:Ge.KUBERNETES_HEALTHY,icon:Ai,count:p,total:c})]})]}):null},Kr=g.div`
200
200
  display: flex;
201
201
  flex-direction: column;
202
202
  justify-content: center;
@@ -207,7 +207,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
207
207
  width: fit-content;
208
208
  border-radius: 8px;
209
209
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
210
- `,Jr=({count:o,total:n,label:a,icon:i})=>{const l=f(),s=void 0===n?void 0:o===n?l.v2.colors.green[500]:l.v2.colors.red[500];return e(Yr,{children:[e(se,{$gap:0,$alignItems:"flex-end",children:[t(ae,{size:le.L,color:s,weight:500,nowrap:!0,children:o}),void 0!==n&&t(ae,{size:le.S,color:s,weight:500,nowrap:!0,children:`/${n}`})]}),e(se,{$alignItems:"center",$gap:4,children:[i&&t(i,{size:16}),t(ae,{size:le.XXXS,nowrap:!0,children:a})]})]})},qr=e=>{if(e.overrideProcessNum)return e.overrideProcessNum.toString();const t=e.identifyingAttributes?.find(({name:e})=>e===jt.PID)??e.identifyingAttributes?.find(({name:e})=>e===jt.VPID);return t?.value??null};var Zr;!function(e){e.IdentifyingAttributes="identifying-attributes",e.InstrumentationLibraries="instrumentation-libraries"}(Zr||(Zr={}));const Qr=({overrideProcessNum:o,healthy:i,healthStatus:l,identifyingAttributes:r,instrumentations:c,isJumpToTarget:d})=>{const u=f(),[p,h]=s(Zr.IdentifyingAttributes),g=Xt(!!d),{tabOptions:m,firstTabValue:b,bothTabsDisabled:v}=a(()=>{const e=c?.some(e=>!1===e.healthy),o=[{value:Zr.IdentifyingAttributes,label:He.IDENTIFYING_ATTRIBUTES,disabled:!r?.length,selectedBgColor:u.v2.colors.purple[500]},{value:Zr.InstrumentationLibraries,label:He.INSTRUMENTATION_LIBRARIES,icon:e?e=>t(Di,{...e,fill:u.v2.colors.red[500]}):void 0,disabled:!c?.length,selectedBgColor:u.v2.colors.purple[500]}];return{tabOptions:o,firstTabValue:o.find(e=>!e.disabled)?.value||o[0].value,bothTabsDisabled:o.every(e=>e.disabled)}},[r,c]);n(()=>{b&&h(b)},[b]);const y=a(()=>{switch(p){case Zr.IdentifyingAttributes:return t(W,{children:r?.map((e,o)=>t(ac,{label:e.name,value:e.value},`attr-${o}-${e.name}`))});case Zr.InstrumentationLibraries:return t(W,{children:c?.map((e,o)=>t(ac,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},`instr-${o}-${e.name}`))});default:return null}},[p,r,c]),C=a(()=>qr({overrideProcessNum:o,identifyingAttributes:r}),[o,r]);return t("div",{ref:g,children:e(Et,{bgTint:"800",richTitle:{title:C?`${He.PROCESS} ${He.PID(C)}`:He.PROCESS_FALLBACK_NAME},renderOnRightSide:t(ae,{color:i?ie.Success:ie.Error,size:le.XXXS,children:l?.message}),badges:[{key:"odigos-healthy",status:i?Ee.Success:Ee.Error,leftIcon:Ni,label:i?He.HEALTHY:He.NOT_HEALTHY,textSize:le.XXXS,invertColors:!0,useSecondaryTone:!0}],withCollapse:!v,collapseIsDefaultOpen:d,children:[!v&&t(ue,{options:m,selected:p,setSelected:h}),!v&&y]})})},ec=m.div`
210
+ `,Yr=({count:n,total:o,label:a,icon:i})=>{const l=f(),s=void 0===o?void 0:n===o?l.v2.colors.green[500]:l.v2.colors.red[500];return e(Kr,{children:[e(se,{$gap:0,$alignItems:"flex-end",children:[t(ae,{size:le.L,color:s,weight:500,nowrap:!0,children:n}),void 0!==o&&t(ae,{size:le.S,color:s,weight:500,nowrap:!0,children:`/${o}`})]}),e(se,{$alignItems:"center",$gap:4,children:[i&&t(i,{size:16}),t(ae,{size:le.XXXS,nowrap:!0,children:a})]})]})},Jr=e=>{if(e.overrideProcessNum)return e.overrideProcessNum.toString();const t=e.identifyingAttributes?.find(({name:e})=>e===Ht.PID)??e.identifyingAttributes?.find(({name:e})=>e===Ht.VPID);return t?.value??null};var qr;!function(e){e.IdentifyingAttributes="identifying-attributes",e.InstrumentationLibraries="instrumentation-libraries"}(qr||(qr={}));const Zr=({overrideProcessNum:n,healthy:i,healthStatus:l,identifyingAttributes:r,instrumentations:c,isJumpToTarget:d})=>{const u=f(),[p,h]=s(qr.IdentifyingAttributes),m=Bt(!!d),{tabOptions:g,firstTabValue:b,bothTabsDisabled:v}=a(()=>{const e=c?.some(e=>!1===e.healthy),n=[{value:qr.IdentifyingAttributes,label:Ge.IDENTIFYING_ATTRIBUTES,disabled:!r?.length,selectedBgColor:u.v2.colors.purple[500]},{value:qr.InstrumentationLibraries,label:Ge.INSTRUMENTATION_LIBRARIES,icon:e?e=>t(Oi,{...e,fill:u.v2.colors.red[500]}):void 0,disabled:!c?.length,selectedBgColor:u.v2.colors.purple[500]}];return{tabOptions:n,firstTabValue:n.find(e=>!e.disabled)?.value||n[0].value,bothTabsDisabled:n.every(e=>e.disabled)}},[r,c]);o(()=>{b&&h(b)},[b]);const y=a(()=>{switch(p){case qr.IdentifyingAttributes:return t(W,{children:r?.map((e,n)=>t(oc,{label:e.name,value:e.value},`attr-${n}-${e.name}`))});case qr.InstrumentationLibraries:return t(W,{children:c?.map((e,n)=>t(oc,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},`instr-${n}-${e.name}`))});default:return null}},[p,r,c]),C=a(()=>Jr({overrideProcessNum:n,identifyingAttributes:r}),[n,r]);return t("div",{ref:m,children:e($t,{bgTint:"800",richTitle:{title:C?`${Ge.PROCESS} ${Ge.PID(C)}`:Ge.PROCESS_FALLBACK_NAME},renderOnRightSide:t(ae,{color:i?ie.Success:ie.Error,size:le.XXXS,children:l?.message}),badges:[{key:"odigos-healthy",status:i?Ie.Success:Ie.Error,leftIcon:Ei,label:i?Ge.HEALTHY:Ge.NOT_HEALTHY,textSize:le.XXXS,invertColors:!0,useSecondaryTone:!0}],withCollapse:!v,collapseIsDefaultOpen:d,children:[!v&&t(ue,{options:g,selected:p,setSelected:h}),!v&&y]})})},Qr=g.div`
211
211
  display: flex;
212
212
  align-items: flex-start;
213
213
  gap: 8px;
@@ -216,23 +216,23 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
216
216
  &:hover {
217
217
  background-color: ${({theme:e})=>e.v2.colors.silver[700]};
218
218
  }
219
- `,tc=m(ae)`
219
+ `,ec=g(ae)`
220
220
  flex: 0 0 30%;
221
- `,oc=m(ae)`
221
+ `,tc=g(ae)`
222
222
  flex: 1 1 auto;
223
223
  min-width: 0;
224
- `,nc=m(se)`
224
+ `,nc=g(se)`
225
225
  flex: 1 1 auto;
226
226
  justify-content: flex-end;
227
227
  min-width: 0;
228
- `,ac=({label:o,value:n,isStandardLibrary:a,healthy:i,message:l})=>{const s="boolean"==typeof i;return e(ec,{children:[t(tc,{size:le.XXS,color:ie.Secondary,children:o}),n&&t(oc,{size:le.XXS,color:ie.Primary,align:"right",children:n}),(s||a)&&e(nc,{children:[a&&t(Be,{status:Ee.Info,label:He.STANDARD,textSize:le.XXXS,invertColors:!0}),s&&t(Be,{status:i?Ee.Success:Ee.Error,label:i?He.HEALTHY:He.NOT_HEALTHY,textSize:le.XXXS,invertColors:!0,tooltip:l??void 0})]})]})},ic=p(null),lc=({value:e,children:o})=>t(ic.Provider,{value:e,children:o}),sc=({podContainers:e,sourceContainers:o,jumpToTarget:n})=>{const i=e??[],l=a(()=>({title:He.CONTAINERS,titleSize:le.XS,badge:{label:i.length}}),[i.length]),s=a(()=>{const e=new Map;return o?.forEach(t=>e.set(t.containerName,t)),e},[o]);return t(Et,{bgTint:"800",richTitle:l,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(W,{$gap:8,children:i.map(e=>{const o=n?.containerName===e.containerName;return t(cc,{...e,language:Wt(s.get(e.containerName)),jumpToTarget:o?n:null},`pod-container-${e.containerName}`)})})})},rc=m.div`
228
+ `,oc=({label:n,value:o,isStandardLibrary:a,healthy:i,message:l})=>{const s="boolean"==typeof i;return e(Qr,{children:[t(ec,{size:le.XXS,color:ie.Secondary,children:n}),o&&t(tc,{size:le.XXS,color:ie.Primary,align:"right",children:o}),(s||a)&&e(nc,{children:[a&&t(Be,{status:Ie.Info,label:Ge.STANDARD,textSize:le.XXXS,invertColors:!0}),s&&t(Be,{status:i?Ie.Success:Ie.Error,label:i?Ge.HEALTHY:Ge.NOT_HEALTHY,textSize:le.XXXS,invertColors:!0,tooltip:l??void 0})]})]})},ac=p(null),ic=({value:e,children:n})=>t(ac.Provider,{value:e,children:n}),lc=({podContainers:e,sourceContainers:n,jumpToTarget:o})=>{const i=e??[],l=a(()=>({title:Ge.CONTAINERS,titleSize:le.XS,badge:{label:i.length}}),[i.length]),s=a(()=>{const e=new Map;return n?.forEach(t=>e.set(t.containerName,t)),e},[n]);return t($t,{bgTint:"800",richTitle:l,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(W,{$gap:8,children:i.map(e=>{const n=o?.containerName===e.containerName;return t(rc,{...e,language:jt(s.get(e.containerName)),jumpToTarget:n?o:null},`pod-container-${e.containerName}`)})})})},sc=g.div`
229
229
  display: flex;
230
230
  flex-direction: column;
231
231
  gap: 12px;
232
232
  padding: 8px 12px;
233
233
  border-radius: 8px;
234
234
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
235
- `,cc=({language:o,containerName:n,otelDistroName:i,runningStartedTime:l,started:s,ready:r,restartCount:c,isCrashLoop:d,waitingReasonEnum:u,waitingMessage:p,odigosHealthStatus:h,k8sHealthStatus:g,processes:m,jumpToTarget:f})=>{const b=!!f,v=b&&!f?.processPid,{formatDurationAgo:y}=Bt(),C=Xt(v),S=a(()=>({title:n,icon:o?Ve(o):Pi,iconWithWrapper:!0}),[n,o]),w=a(()=>{const e=[],t=Vt({status:i?Ut.Success:Ut.Disabled,reasonEnum:i?He.INSTRUMENTED_WITH_DISTRO(i):He.UNINSTRUMENTED,message:""});t&&e.push(t);const o=Vt(h,Ni,"health");o&&e.push(o);const n=Vt(g,Oi,"health");return n&&e.push(n),e},[g,h,i]),x=a(()=>[{id:"runningTime",title:He.RUNNING_TIME,label:l?y(l,{style:"short"}):He.NOT_RUNNING,labelTooltip:`${He.RUNNING_TIME_TOOLTIP}. (${l})`},{id:"blank",spacer:!0},{id:"started",badge:{status:s?Ee.Success:Kt.Disabled,leftIcon:s?ui:pi,label:s?He.STARTED:He.NOT_STARTED,textSize:le.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"ready",badge:{status:r?Ee.Success:Kt.Disabled,leftIcon:r?ui:pi,label:r?He.READY:He.NOT_READY,textSize:le.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"isCrashLoop",badge:{status:d?Ee.Error:Ee.Success,leftIcon:d?pi:ui,label:d?He.CRASHLOOP:He.NO_CRASHLOOP,textSize:le.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"restartCount",title:He.RESTARTS,badge:{status:c?Ee.Error:void 0,label:c||0,textSize:le.XXXS}}],[l,y,s,r,d,c]),T=a(()=>p?Ft(u):"",[p,u]);return t("div",{ref:C,children:e(Et,{bgTint:"750",richTitle:S,badges:w,items:x,withCollapse:!0,collapseIsDefaultOpen:b,children:[p&&t(rc,{children:e(se,{$gap:10,$alignItems:"center",children:[t(zt,{variant:Yt.Pink,leftIcon:Oi,label:T}),t(ae,{size:le.XXXS,color:ie.Error,children:p})]})}),(m??[]).map((e,o)=>{const a=o+1,i=b&&(l=f,s=e,!!l?.processPid&&qr({identifyingAttributes:s.identifyingAttributes})===l.processPid);var l,s;return t(Qr,{...e,overrideProcessNum:a,isJumpToTarget:i},`pod-container-${n}-process-${a}`)})]})})},dc=({podName:e,namespace:o,hasRestarted:n})=>{const i=a(()=>({title:He.DEBUG_COMMANDS,titleSize:le.XS}),[]),l=a(()=>[{label:He.GET_POD_YAML,value:`kubectl get pod ${e} -n ${o} -o yaml`},{label:He.DESCRIBE_POD,value:`kubectl describe pod ${e} -n ${o}`},{label:He.GET_POD_LOGS,value:`kubectl logs ${e} -n ${o}${n?" -p":""}`}],[e,o,n]);return t(Et,{bgTint:"800",richTitle:i,withCollapse:!0,children:l.map(({label:e,value:o})=>t(Jt,{bgTint:"700",label:e,value:o},e))})},uc=({source:n,onClickRestartPod:i})=>{const{jumpToTarget:l}=(()=>{const e=h(ic);if(!e)throw new Error("useJumpToTargetContext must be used within a JumpToTargetContextProvider");return e})(),s=l?.tab===Gr.Pods?l:null,r=n?.pods??[],c=r.length>0,d=a(()=>r.some(e=>e.containers?.some(e=>e.restartCount&&e.restartCount>0)),[r]),u=a(()=>({title:He.PODS,badge:{label:r.length}}),[r.length]);return t(W,{$gap:12,children:c?e(o,{children:[t(Kr,{podsOdigosHealthStatus:n.podsOdigosHealthStatus,pods:r}),t(Et,{bgTint:"1000",richTitle:u,children:r.map(o=>{const a=s?.podName===o.podName,l=a&&!s?.containerName;return e(jr,{...o,namespace:n.id.namespace,onClickRestartPod:i,collapseIsDefaultOpen:a,isJumpToTarget:l,children:[t(dc,{podName:o.podName,namespace:n.id.namespace,hasRestarted:d}),t(sc,{podContainers:o.containers,sourceContainers:n.containers,jumpToTarget:a?s:null})]},`pod-${o.podName}`)})})]}):t(at,{$height:"70vh",children:t(Ce,{title:He.NO_RUNNING_PODS,subTitle:He.NO_RUNNING_PODS_SUBTITLE})})})},pc=({source:o})=>{const n=a(()=>o.serviceName||o.id.name,[o]),{sourcesApi:i}=sl(),{data:l,loading:s,refetch:r}=i.usePeerSources({serviceName:n},{fetchPolicy:"network-only"}),c=l?.peerSources??null;return!c||s?t(at,s?{$height:"70vh",children:t(ct,{withSpinner:!0})}:{$height:"70vh",children:t(Ce,{subTitle:He.COULD_NOT_FETCH_PEER_SOURCES})}):e(se,{$gap:16,$alignItems:"flex-start",children:[t(hc,{icon:Fi,title:He.INBOUND,subTitle:He.INBOUND_DESCRIPTION(n),onRefresh:r,items:c?.inbound??[]}),t(hc,{icon:Li,title:He.OUTBOUND,subTitle:He.OUTBOUND_DESCRIPTION(n),onRefresh:r,items:c?.outbound??[]})]})},hc=({icon:o,title:n,subTitle:i,onRefresh:l,items:r})=>{const[c,d]=s(""),u=a(()=>r.filter(e=>e.serviceName.toLowerCase().includes(c.toLowerCase())),[r,c]);return e(Et,{bgTint:"1000",richTitle:{icon:o,title:n,titleSize:le.XS,subTitle:i,subTitleSize:le.XXXS,badge:{label:r.length}},actions:[{id:"refresh",type:qt.Button,buttonProps:{variant:de.Secondary,size:ce.S,leftIcon:Ri,onClick:l}}],children:[t(Zt,{value:c,onChange:d,width:"100%"}),t(Qt,{height:"calc(100vh - 284px)",gap:4,elements:u.length||c?!u.length&&c?[t(at,{$height:"50vh",children:t(Ce,{icon:o,title:He.NO_RESULTS,subTitle:He.NO_RESULTS_FOR_FILTER(c)})},"no-results")]:u.map(e=>t(mc,{...e},`${n}-${e.serviceName}`)):[t(at,{$height:"50vh",children:t(Ce,{icon:o,title:`No ${n} connections yet`,subTitle:n===He.INBOUND?He.NO_INBOUND_CONNECTIONS_DESCRIPTION:He.NO_OUTBOUND_CONNECTIONS_DESCRIPTION})},"no-data")]})]})},gc=m.div`
235
+ `,rc=({language:n,containerName:o,otelDistroName:i,runningStartedTime:l,started:s,ready:r,restartCount:c,isCrashLoop:d,waitingReasonEnum:u,waitingMessage:p,odigosHealthStatus:h,k8sHealthStatus:m,processes:g,jumpToTarget:f})=>{const b=!!f,v=b&&!f?.processPid,{formatDurationAgo:y}=zt(),C=Bt(v),S=a(()=>({title:o,icon:n?Ve(n):Ri,iconWithWrapper:!0}),[o,n]),w=a(()=>{const e=[],t=Xt({status:i?Vt.Success:Vt.Disabled,reasonEnum:i?Ge.INSTRUMENTED_WITH_DISTRO(i):Ge.UNINSTRUMENTED,message:""});t&&e.push(t);const n=Xt(h,Ei,"health");n&&e.push(n);const o=Xt(m,Ai,"health");return o&&e.push(o),e},[m,h,i]),x=a(()=>[{id:"runningTime",title:Ge.RUNNING_TIME,label:l?y(l,{style:"short"}):Ge.NOT_RUNNING,labelTooltip:`${Ge.RUNNING_TIME_TOOLTIP}. (${l})`},{id:"blank",spacer:!0},{id:"started",badge:{status:s?Ie.Success:Ie.Disabled,leftIcon:s?ci:di,label:s?Ge.STARTED:Ge.NOT_STARTED,textSize:le.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"ready",badge:{status:r?Ie.Success:Ie.Disabled,leftIcon:r?ci:di,label:r?Ge.READY:Ge.NOT_READY,textSize:le.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"isCrashLoop",badge:{status:d?Ie.Error:Ie.Success,leftIcon:d?di:ci,label:d?Ge.CRASHLOOP:Ge.NO_CRASHLOOP,textSize:le.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"restartCount",title:Ge.RESTARTS,badge:{status:c?Ie.Error:void 0,label:c||0,textSize:le.XXXS}}],[l,y,s,r,d,c]),k=a(()=>p?Pt(u):"",[p,u]);return t("div",{ref:C,children:e($t,{bgTint:"750",richTitle:S,badges:w,items:x,withCollapse:!0,collapseIsDefaultOpen:b,children:[p&&t(sc,{children:e(se,{$gap:10,$alignItems:"center",children:[t(_t,{variant:Wt.Pink,leftIcon:Ai,label:k}),t(ae,{size:le.XXXS,color:ie.Error,children:p})]})}),(g??[]).map((e,n)=>{const a=n+1,i=b&&(l=f,s=e,!!l?.processPid&&Jr({identifyingAttributes:s.identifyingAttributes})===l.processPid);var l,s;return t(Zr,{...e,overrideProcessNum:a,isJumpToTarget:i},`pod-container-${o}-process-${a}`)})]})})},cc=({podName:e,namespace:n,hasRestarted:o})=>{const i=a(()=>({title:Ge.DEBUG_COMMANDS,titleSize:le.XS}),[]),l=a(()=>[{label:Ge.GET_POD_YAML,value:`kubectl get pod ${e} -n ${n} -o yaml`},{label:Ge.DESCRIBE_POD,value:`kubectl describe pod ${e} -n ${n}`},{label:Ge.GET_POD_LOGS,value:`kubectl logs ${e} -n ${n}${o?" -p":""}`}],[e,n,o]);return t($t,{bgTint:"800",richTitle:i,withCollapse:!0,children:l.map(({label:e,value:n})=>t(Kt,{bgTint:"700",label:e,value:n},e))})},dc=({source:o,onClickRestartPod:i})=>{const{jumpToTarget:l}=(()=>{const e=h(ac);if(!e)throw new Error("useJumpToTargetContext must be used within a JumpToTargetContextProvider");return e})(),s=l?.tab===Gr.Pods?l:null,r=o?.pods??[],c=r.length>0,d=a(()=>r.some(e=>e.containers?.some(e=>e.restartCount&&e.restartCount>0)),[r]),u=a(()=>({title:Ge.PODS,badge:{label:r.length}}),[r.length]);return t(W,{$gap:12,children:c?e(n,{children:[t(Wr,{podsOdigosHealthStatus:o.podsOdigosHealthStatus,pods:r}),t($t,{bgTint:"1000",richTitle:u,children:r.map(n=>{const a=s?.podName===n.podName,l=a&&!s?.containerName;return e(Hr,{...n,namespace:o.id.namespace,onClickRestartPod:i,collapseIsDefaultOpen:a,isJumpToTarget:l,children:[t(cc,{podName:n.podName,namespace:o.id.namespace,hasRestarted:d}),t(lc,{podContainers:n.containers,sourceContainers:o.containers,jumpToTarget:a?s:null})]},`pod-${n.podName}`)})})]}):t(at,{$height:"70vh",children:t(Ce,{title:Ge.NO_RUNNING_PODS,subTitle:Ge.NO_RUNNING_PODS_SUBTITLE})})})},uc=({source:n})=>{const o=a(()=>n.serviceName||n.id.name,[n]),{sourcesApi:i}=ll(),{data:l,loading:s,refetch:r}=i.usePeerSources({serviceName:o},{fetchPolicy:"network-only"}),c=l?.peerSources??null;return!c||s?t(at,s?{$height:"70vh",children:t(ct,{withSpinner:!0})}:{$height:"70vh",children:t(Ce,{subTitle:Ge.COULD_NOT_FETCH_PEER_SOURCES})}):e(se,{$gap:16,$alignItems:"flex-start",children:[t(pc,{icon:Di,title:Ge.INBOUND,subTitle:Ge.INBOUND_DESCRIPTION(o),onRefresh:r,items:c?.inbound??[]}),t(pc,{icon:Pi,title:Ge.OUTBOUND,subTitle:Ge.OUTBOUND_DESCRIPTION(o),onRefresh:r,items:c?.outbound??[]})]})},pc=({icon:n,title:o,subTitle:i,onRefresh:l,items:r})=>{const[c,d]=s(""),u=a(()=>r.filter(e=>e.serviceName.toLowerCase().includes(c.toLowerCase())),[r,c]);return e($t,{bgTint:"1000",richTitle:{icon:n,title:o,titleSize:le.XS,subTitle:i,subTitleSize:le.XXXS,badge:{label:r.length}},actions:[{id:"refresh",type:Yt.Button,buttonProps:{variant:de.Secondary,size:ce.S,leftIcon:Ni,onClick:l}}],children:[t(Jt,{value:c,onChange:d,width:"100%"}),t(qt,{height:"calc(100vh - 284px)",gap:4,elements:u.length||c?!u.length&&c?[t(at,{$height:"50vh",children:t(Ce,{icon:n,title:Ge.NO_RESULTS,subTitle:Ge.NO_RESULTS_FOR_FILTER(c)})},"no-results")]:u.map(e=>t(mc,{...e},`${o}-${e.serviceName}`)):[t(at,{$height:"50vh",children:t(Ce,{icon:n,title:`No ${o} connections yet`,subTitle:o===Ge.INBOUND?Ge.NO_INBOUND_CONNECTIONS_DESCRIPTION:Ge.NO_OUTBOUND_CONNECTIONS_DESCRIPTION})},"no-data")]})]})},hc=g.div`
236
236
  display: flex;
237
237
  align-items: center;
238
238
  justify-content: space-between;
@@ -246,9 +246,9 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
246
246
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
247
247
  }
248
248
  `}
249
- `,mc=({serviceName:o,isVirtual:n,nodeAttributes:i})=>{const l=eo(e=>e.drawerEntityId),{items:s}=sl().sourcesApi.useSources(),r=a(()=>s.find(e=>e.id.name===o||e.serviceName===o),[s,o]),c=a(()=>r&&JSON.stringify(to(r))!==JSON.stringify(to(l)),[r,l]),d=a(()=>{if(n){const e=Object.fromEntries((i??[]).map(({key:e,value:t})=>[e,t]));return[oo({serviceName:o,attributes:e})]}if(o?.toLowerCase()===Kl)return[_i];const e=r?no(r):void 0;return e?.length?e:[Pi]},[n,i,o,r]),u=c?()=>{const{setDrawerType:e,setDrawerEntityId:t}=eo.getState();e(mt.Source),t({namespace:r?.id.namespace??"",name:r?.id.name??"",kind:r?.id.kind??""})}:void 0;return e(gc,{onClick:u,$withClick:!!u,children:[e(se,{$gap:8,children:[t(ao,{icons:d}),t(ae,{size:le.XXS,children:o})]}),n&&t(Be,{status:Ee.Info,label:He.VIRTUAL,textSize:le.XXXS,invertColors:!0,tooltip:He.VIRTUAL_TOOLTIP})]})},fc=e=>{if("string"==typeof e)return e;if(e&&"object"==typeof e){const t=e;if("string"==typeof t.k8sActualManifest)return t.k8sActualManifest;if("string"==typeof t.manifest)return t.manifest}},bc=({source:o})=>{const i=f(),{k8sManifestApi:l}=sl(),[r,c]=s(!0),[d,u]=s(void 0),[p,h]=s(!0),[g,m]=s(void 0);n(()=>{l.fetch({namespace:o.id.namespace,kind:o.id.kind,name:o.id.name}).then(({data:e})=>u(fc(e))).finally(()=>c(!1)),l.fetch({namespace:o.id.namespace,kind:io.InstrumentationConfig,name:`${o.id.kind}-${o.id.name}`.toLowerCase()}).then(({data:e})=>m(fc(e))).finally(()=>h(!1))},[l,o.id.namespace,o.id.kind,o.id.name]);const b=a(()=>[{label:He.DESCRIBE_POD,value:`kubectl describe ${o.id.kind} ${o.id.name} -n ${o.id.namespace}`},{label:He.GET_POD_YAML,value:`kubectl get ${o.id.kind} ${o.id.name} -n ${o.id.namespace} -o yaml`},{label:He.GET_POD_YAML,value:`kubectl get ${io.InstrumentationConfig} ${o.id.kind}-${o.id.name} -n ${o.id.namespace} -o yaml`}],[o.id.kind,o.id.name,o.id.namespace]);return e(Et,{bgTint:"1000",children:[t(Et,{bgTint:"900",richTitle:{icon:zi,title:He.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:b.map(({label:e,value:o},n)=>t(Jt,{label:e,value:o},`debug-cmd-${n}-${e}`))}),r?t(lo,{size:1}):t(Tl,{bgTint:"800",codeBgColor:i.v2.colors.silver[900],title:`${o.id.kind} YAML`,yaml:d}),p?t(lo,{size:1}):t(Tl,{bgTint:"800",codeBgColor:i.v2.colors.silver[900],title:"Instrumentation Config YAML",yaml:g})]})},vc=({title:o,children:n})=>e(W,{$gap:8,children:[t(ae,{size:le.XXXS,color:ie.Secondary,children:o}),n]}),yc=({source:o})=>{const n=a(()=>{const[e,t]=so(o.telemetryMetrics?.[0]?.throughputBytes||0).split(" ");return{value:e,units:t}},[o]);return t(vc,{title:He.THROUGHPUT_LAST_10_SECONDS,children:e(se,{$alignItems:"flex-end",$gap:4,children:[t(ae,{size:le.L,children:n.value}),t(ae,{size:le.XS,variant:yt.Span,children:n.units})]})})},Cc=({source:o})=>{const{CopyButton:n}=ro();return t(vc,{title:He.NAMESPACE,children:e(se,{children:[t(zt,{variant:Yt.Blue,label:o.id.namespace}),t(n,{value:o.id.namespace,size:rt.XS})]})})},Sc=({source:e})=>t(vc,{title:He.KIND,children:t(se,{children:t(zt,{variant:Yt.Blue,label:e.id.kind})})}),wc=({source:o})=>{const{CopyButton:n}=ro();return t(vc,{title:He.NAME,children:e(se,{children:[t(zt,{variant:Yt.Blue,label:o.id.name}),t(n,{value:o.id.name,size:rt.XS})]})})},xc=({source:o})=>{const{isVm:n}=y();return t(Et,{children:e(se,{$gap:24,$alignItems:"flex-start",$justifyContent:"flex-start",$wrap:"wrap",children:[!n&&t(yc,{source:o}),!n&&t(Cc,{source:o}),t(Sc,{source:o}),t(wc,{source:o})]})})},Tc=({source:e})=>t(Et,{bgTint:"900",children:t(Kr,{podsOdigosHealthStatus:e.podsOdigosHealthStatus,pods:e.pods,noPadding:!0})}),kc=({source:e})=>{const o=a(()=>e.workloadOdigosHealthStatus?{status:e.workloadOdigosHealthStatus.status?co(e.workloadOdigosHealthStatus.status):ft.Unknown,title:Ft(e.workloadOdigosHealthStatus.reasonEnum),subTitle:e.workloadOdigosHealthStatus.message}:null,[e]);return o?t(Ht,{...o,width:"100%"}):null},$c="calc(50% - 6px)",Ec=({source:o,onClickRollout:n,onClickRollback:i})=>{const l=a(()=>{const{status:e,reasonEnum:t,message:a}=o.conditions?.rollout||{},i=Gt(e);if(!i)return null;return{status:i,title:t?.toLowerCase().includes("rollout")?Ft(t):`${He.ROLLOUT} ${Ft(t)}`,subTitle:a,action:i!==Ee.Success?{icon:Ri,tooltip:He.ROLLOUT_RESTART,onClick:n}:void 0}},[o]),s=a(()=>{const{status:e,reasonEnum:t,message:n}=o.autoRollback?.autoRollbackStatus||{},a=Gt(e);if(!a)return null;return{status:a,title:t?.toLowerCase().includes("rollback")?Ft(t):`${He.ROLLBACK} ${Ft(t)}`,subTitle:n,action:a!==Ee.Success?{icon:Ri,tooltip:He.ROLLBACK_RECOVER,onClick:i}:void 0}},[o]);return l||s?e(se,{$gap:12,$alignItems:"stretch",children:[l&&t(Ht,{invertColors:!0,slim:!0,width:s?$c:"100%",...l}),s&&t(Ht,{invertColors:!0,slim:!0,width:$c,...s})]}):null},Ic=p(null),Ac=m.div`
249
+ `,mc=({serviceName:n,isVirtual:o,nodeAttributes:i})=>{const l=Zt(e=>e.drawerEntityId),{items:s}=ll().sourcesApi.useSources(),r=a(()=>s.find(e=>e.id.name===n||e.serviceName===n),[s,n]),c=a(()=>r&&JSON.stringify(Qt(r))!==JSON.stringify(Qt(l)),[r,l]),d=a(()=>{if(o){const e=Object.fromEntries((i??[]).map(({key:e,value:t})=>[e,t]));return[en({serviceName:n,attributes:e})]}if(n?.toLowerCase()===Wl)return[Fi];const e=r?tn(r):void 0;return e?.length?e:[Ri]},[o,i,n,r]),u=c?()=>{const{setDrawerType:e,setDrawerEntityId:t}=Zt.getState();e(gt.Source),t({namespace:r?.id.namespace??"",name:r?.id.name??"",kind:r?.id.kind??""})}:void 0;return e(hc,{onClick:u,$withClick:!!u,children:[e(se,{$gap:8,children:[t(nn,{icons:d}),t(ae,{size:le.XXS,children:n})]}),o&&t(Be,{status:Ie.Info,label:Ge.VIRTUAL,textSize:le.XXXS,invertColors:!0,tooltip:Ge.VIRTUAL_TOOLTIP})]})},gc=e=>{if("string"==typeof e)return e;if(e&&"object"==typeof e){const t=e;if("string"==typeof t.k8sActualManifest)return t.k8sActualManifest;if("string"==typeof t.manifest)return t.manifest}},fc=({source:n})=>{const i=f(),{k8sManifestApi:l}=ll(),[r,c]=s(!0),[d,u]=s(void 0),[p,h]=s(!0),[m,g]=s(void 0);o(()=>{l.fetch({namespace:n.id.namespace,kind:n.id.kind,name:n.id.name}).then(({data:e})=>u(gc(e))).finally(()=>c(!1)),l.fetch({namespace:n.id.namespace,kind:on.InstrumentationConfig,name:`${n.id.kind}-${n.id.name}`.toLowerCase()}).then(({data:e})=>g(gc(e))).finally(()=>h(!1))},[l,n.id.namespace,n.id.kind,n.id.name]);const b=a(()=>[{label:Ge.DESCRIBE_POD,value:`kubectl describe ${n.id.kind} ${n.id.name} -n ${n.id.namespace}`},{label:Ge.GET_POD_YAML,value:`kubectl get ${n.id.kind} ${n.id.name} -n ${n.id.namespace} -o yaml`},{label:Ge.GET_POD_YAML,value:`kubectl get ${on.InstrumentationConfig} ${n.id.kind}-${n.id.name} -n ${n.id.namespace} -o yaml`}],[n.id.kind,n.id.name,n.id.namespace]);return e($t,{bgTint:"1000",children:[t($t,{bgTint:"900",richTitle:{icon:Li,title:Ge.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:b.map(({label:e,value:n},o)=>t(Kt,{label:e,value:n},`debug-cmd-${o}-${e}`))}),r?t(an,{size:1}):t(xl,{bgTint:"800",codeBgColor:i.v2.colors.silver[900],title:`${n.id.kind} YAML`,yaml:d}),p?t(an,{size:1}):t(xl,{bgTint:"800",codeBgColor:i.v2.colors.silver[900],title:"Instrumentation Config YAML",yaml:m})]})},bc=({title:n,children:o})=>e(W,{$gap:8,children:[t(ae,{size:le.XXXS,color:ie.Secondary,children:n}),o]}),vc=({source:n})=>{const o=a(()=>{const[e,t]=ln(n.telemetryMetrics?.[0]?.throughputBytes||0).split(" ");return{value:e,units:t}},[n]);return t(bc,{title:Ge.THROUGHPUT_LAST_10_SECONDS,children:e(se,{$alignItems:"flex-end",$gap:4,children:[t(ae,{size:le.L,children:o.value}),t(ae,{size:le.XS,variant:vt.Span,children:o.units})]})})},yc=({source:n})=>{const{CopyButton:o}=sn();return t(bc,{title:Ge.NAMESPACE,children:e(se,{children:[t(_t,{variant:Wt.Blue,label:n.id.namespace}),t(o,{value:n.id.namespace,size:rt.XS})]})})},Cc=({source:e})=>t(bc,{title:Ge.KIND,children:t(se,{children:t(_t,{variant:Wt.Blue,label:e.id.kind})})}),Sc=({source:n})=>{const{CopyButton:o}=sn();return t(bc,{title:Ge.NAME,children:e(se,{children:[t(_t,{variant:Wt.Blue,label:n.id.name}),t(o,{value:n.id.name,size:rt.XS})]})})},wc=({source:n})=>{const{isVm:o}=y();return t($t,{children:e(se,{$gap:24,$alignItems:"flex-start",$justifyContent:"flex-start",$wrap:"wrap",children:[!o&&t(vc,{source:n}),!o&&t(yc,{source:n}),t(Cc,{source:n}),t(Sc,{source:n})]})})},xc=({source:e})=>t($t,{bgTint:"900",children:t(Wr,{podsOdigosHealthStatus:e.podsOdigosHealthStatus,pods:e.pods,noPadding:!0})}),kc=({source:e})=>{const n=a(()=>e.workloadOdigosHealthStatus?{status:e.workloadOdigosHealthStatus.status?rn(e.workloadOdigosHealthStatus.status):Ie.Unknown,title:Pt(e.workloadOdigosHealthStatus.reasonEnum),subTitle:e.workloadOdigosHealthStatus.message}:null,[e]);return n?t(Ut,{...n,width:"100%"}):null},Tc="calc(50% - 6px)",$c=({source:n,onClickRollout:o,onClickRollback:i})=>{const l=a(()=>{const{status:e,reasonEnum:t,message:a}=n.conditions?.rollout||{},i=Gt(e);if(!i)return null;return{status:i,title:t?.toLowerCase().includes("rollout")?Pt(t):`${Ge.ROLLOUT} ${Pt(t)}`,subTitle:a,action:i!==Ie.Success?{icon:Ni,tooltip:Ge.ROLLOUT_RESTART,onClick:o}:void 0}},[n]),s=a(()=>{const{status:e,reasonEnum:t,message:o}=n.autoRollback?.autoRollbackStatus||{},a=Gt(e);if(!a)return null;return{status:a,title:t?.toLowerCase().includes("rollback")?Pt(t):`${Ge.ROLLBACK} ${Pt(t)}`,subTitle:o,action:a!==Ie.Success?{icon:Ni,tooltip:Ge.ROLLBACK_RECOVER,onClick:i}:void 0}},[n]);return l||s?e(se,{$gap:12,$alignItems:"stretch",children:[l&&t(Ut,{invertColors:!0,slim:!0,width:s?Tc:"100%",...l}),s&&t(Ut,{invertColors:!0,slim:!0,width:Tc,...s})]}):null},Ic=p(null),Ec=g.div`
250
250
  position: relative;
251
- `,Nc=({children:e})=>{const o=i(null);return t(Ac,{ref:o,children:t(Ic.Provider,{value:o,children:e})})},Oc=m.div`
251
+ `,Ac=({children:e})=>{const n=i(null);return t(Ec,{ref:n,children:t(Ic.Provider,{value:n,children:e})})},Nc=g.div`
252
252
  position: fixed;
253
253
  top: ${({$coords:e})=>e.top}px;
254
254
  right: ${({$coords:e})=>e.right}px;
@@ -262,14 +262,14 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
262
262
  padding: 12px 16px;
263
263
  border-radius: 12px;
264
264
  background-color: ${({theme:e})=>e.v2.colors.silver[750]};
265
- `,Rc=m.div`
265
+ `,Oc=g.div`
266
266
  display: flex;
267
267
  align-items: flex-end;
268
268
  justify-content: space-between;
269
269
  gap: 8px;
270
- `,Dc=m.div`
270
+ `,Rc=g.div`
271
271
  flex: 1;
272
- `,Pc=({width:o,onClose:n,onSave:a,saveTooltip:i,onDelete:l,deleteTooltip:r,title:c,subTitle:d,warning:u,children:p,pushButtonsWith:m})=>{const b=f(),v=h(Ic),[y,C]=s(null);return uo(v??{current:null},n),g(()=>{const e=v?.current?.getBoundingClientRect();e&&C({top:e.bottom+4,right:window.innerWidth-e.left-24})},[v]),y?Yl(e(Oc,{$coords:y,$width:o,"data-ignore-outside-click":"true",children:[e(W,{$gap:4,children:[t(ae,{size:le.XXS,children:c}),t(ae,{size:le.XXXS,color:ie.Secondary,children:d})]}),e(Rc,{children:[t(Dc,{children:p}),e(se,{$gap:8,$width:"fit-content",$margin:`0 0 ${m||0} 0`,children:[t(re,{variant:de.Secondary,onClick:l,leftIcon:ri,tooltip:r,hideTooltipIcon:!0,iconSize:16,size:ce.S,textColor:b.v2.colors.red[500]}),t(re,{variant:de.Primary,onClick:a,leftIcon:xi,tooltip:i,hideTooltipIcon:!0,iconSize:16,size:ce.S})]})]}),t("div",{children:t($e,{status:Ee.Warning,message:u})})]}),document.body):null},Fc=({language:o,overridden:n,onOverride:i,defaultValues:l})=>{const{tier:r}=y(),{formData:c,handleFormChange:d,resetFormData:u}=Nt(l),p=a(()=>{if(!o)return[];const e=po[o].community,t=r===bt.Onprem?po[o].enterprise:[];return e.concat(t).map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})).sort((e,t)=>e.label.localeCompare(t.label))},[o,r]),[h,g]=s(!1),[m,f]=s(!1),b=()=>{h||(m&&u(),f(e=>!e))};return e(se,{$gap:4,$alignItems:"center",children:[n?t(Be,{status:Ee.Info,invertColors:!0,label:He.OVERIDDEN}):null,e(Nc,{children:[t(De,{text:He.OVERRIDE_OTEL_DISTRO_NAME,children:t(st,{icon:mi,onClick:b})}),m&&t(Pc,{width:"500px",onClose:b,onSave:async()=>{g(!0),await i(c),g(!1),b()},saveTooltip:He.OVERRIDE_OTEL_DISTRO_NAME_SAVE_TOOLTIP,onDelete:async()=>{g(!0),await i({otelDistroName:null}),g(!1),b()},deleteTooltip:He.OVERRIDE_OTEL_DISTRO_NAME_DELETE_TOOLTIP,title:He.OVERRIDE_OTEL_DISTRO_NAME,subTitle:He.OVERRIDE_OTEL_DISTRO_NAME_SUBTITLE,warning:He.OVERRIDE_OTEL_DISTRO_NAME_WARNING,children:t(lt,{label:He.OTEL_DISTRO_NAME,options:p,values:c.otelDistroName?[c.otelDistroName]:[],setValues:e=>d("otelDistroName",e[0])})})]})]})},Lc=({overridden:o,onOverride:n,defaultValues:i,originalValues:l})=>{const{addNotification:r}=Lt(),{formData:c,handleFormChange:d,resetFormData:u}=Nt(i),p=a(()=>ho.map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})),[]),[h,g]=s(!1),[m,f]=s(!1),b=()=>{h||(m&&u(),f(e=>!e))};return e(se,{children:[o?t(Be,{status:Ee.Info,invertColors:!0,label:He.OVERIDDEN}):null,e(Nc,{children:[t(De,{text:He.OVERRIDE_RUNTIME_DETAILS,children:t(st,{icon:mi,onClick:b})}),m&&t(Pc,{width:"500px",onClose:b,onSave:async()=>{!c.version||go(c.version)?(g(!0),await n(c),g(!1),b()):r({type:Ee.Warning,message:_t.INVALID_VERSION,hideFromHistory:!0})},saveTooltip:He.OVERRIDE_RUNTIME_DETAILS_SAVE_TOOLTIP,onDelete:async()=>{g(!0),await n({language:null,version:""}),g(!1),b()},deleteTooltip:He.OVERRIDE_RUNTIME_DETAILS_DELETE_TOOLTIP,title:He.OVERRIDE_RUNTIME_DETAILS,subTitle:He.OVERRIDE_RUNTIME_DETAILS_SUBTITLE,warning:He.OVERRIDE_RUNTIME_WARNING,pushButtonsWith:"20px",children:e(se,{$gap:8,children:[t(lt,{label:He.LANGUAGE,options:p,values:c.language?[c.language]:[],setValues:e=>d("language",e[0]),helpMessage:`Auto-detected: ${l.language||"none"}`}),t(be,{label:He.RUNTIME_VERSION,placeholder:He.VERSION_PLACEHOLDER,value:c.version,onChange:e=>d("version",e.target.value),helpMessage:`Auto-detected: ${l.version||"none"}`})]})})]})]})},_c=({source:e})=>{const{isVm:o}=y(),{containers:n,containersRichTitle:i}=a(()=>{const t=e?.conditions?.runtimeDetection;return{containers:e?.containers??[],containersRichTitle:{title:o?He.DETECTED_PROCESSES:`${e.id.kind} ${He.CONTAINERS}`,tooltip:t?.message||(o?He.DETECTED_PROCESSES_DESCRIPTION:He.DETECTED_CONTAINERS_DESCRIPTION),badge:Gt(t?.status)===Kt.Loading?{status:Kt.Loading,backgroundColor:"transparent"}:{label:e?.containers?.length}}}},[e,o]);return t(Et,{bgTint:"1000",richTitle:i,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(W,{$gap:8,children:n.map(o=>o&&t(Xc,{...o,sourceId:e.id},`source-container-${o.containerName}`))})})},zc=m.div`
272
+ `,Dc=({width:n,onClose:o,onSave:a,saveTooltip:i,onDelete:l,deleteTooltip:r,title:c,subTitle:d,warning:u,children:p,pushButtonsWith:g})=>{const b=f(),v=h(Ic),[y,C]=s(null);return cn(v??{current:null},o),m(()=>{const e=v?.current?.getBoundingClientRect();e&&C({top:e.bottom+4,right:window.innerWidth-e.left-24})},[v]),y?Kl(e(Nc,{$coords:y,$width:n,"data-ignore-outside-click":"true",children:[e(W,{$gap:4,children:[t(ae,{size:le.XXS,children:c}),t(ae,{size:le.XXXS,color:ie.Secondary,children:d})]}),e(Oc,{children:[t(Rc,{children:p}),e(se,{$gap:8,$width:"fit-content",$margin:`0 0 ${g||0} 0`,children:[t(re,{variant:de.Secondary,onClick:l,leftIcon:li,tooltip:r,hideTooltipIcon:!0,iconSize:16,size:ce.S,textColor:b.v2.colors.red[500]}),t(re,{variant:de.Primary,onClick:a,leftIcon:Si,tooltip:i,hideTooltipIcon:!0,iconSize:16,size:ce.S})]})]}),t("div",{children:t($e,{status:Ie.Warning,message:u})})]}),document.body):null},Pc=({language:n,overridden:o,onOverride:i,defaultValues:l})=>{const{tier:r}=y(),{formData:c,handleFormChange:d,resetFormData:u}=At(l),p=a(()=>{if(!n)return[];const e=dn[n].community,t=r===ft.Onprem?dn[n].enterprise:[];return e.concat(t).map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})).sort((e,t)=>e.label.localeCompare(t.label))},[n,r]),[h,m]=s(!1),[g,f]=s(!1),b=()=>{h||(g&&u(),f(e=>!e))};return e(se,{$gap:4,$alignItems:"center",children:[o?t(Be,{status:Ie.Info,invertColors:!0,label:Ge.OVERIDDEN}):null,e(Ac,{children:[t(De,{text:Ge.OVERRIDE_OTEL_DISTRO_NAME,children:t(st,{icon:hi,onClick:b})}),g&&t(Dc,{width:"500px",onClose:b,onSave:async()=>{m(!0),await i(c),m(!1),b()},saveTooltip:Ge.OVERRIDE_OTEL_DISTRO_NAME_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await i({otelDistroName:null}),m(!1),b()},deleteTooltip:Ge.OVERRIDE_OTEL_DISTRO_NAME_DELETE_TOOLTIP,title:Ge.OVERRIDE_OTEL_DISTRO_NAME,subTitle:Ge.OVERRIDE_OTEL_DISTRO_NAME_SUBTITLE,warning:Ge.OVERRIDE_OTEL_DISTRO_NAME_WARNING,children:t(lt,{label:Ge.OTEL_DISTRO_NAME,options:p,values:c.otelDistroName?[c.otelDistroName]:[],setValues:e=>d("otelDistroName",e[0])})})]})]})},Fc=({overridden:n,onOverride:o,defaultValues:i,originalValues:l})=>{const{addNotification:r}=Ft(),{formData:c,handleFormChange:d,resetFormData:u}=At(i),p=a(()=>un.map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})),[]),[h,m]=s(!1),[g,f]=s(!1),b=()=>{h||(g&&u(),f(e=>!e))};return e(se,{children:[n?t(Be,{status:Ie.Info,invertColors:!0,label:Ge.OVERIDDEN}):null,e(Ac,{children:[t(De,{text:Ge.OVERRIDE_RUNTIME_DETAILS,children:t(st,{icon:hi,onClick:b})}),g&&t(Dc,{width:"500px",onClose:b,onSave:async()=>{!c.version||pn(c.version)?(m(!0),await o(c),m(!1),b()):r({type:Ie.Warning,message:Lt.INVALID_VERSION,hideFromHistory:!0})},saveTooltip:Ge.OVERRIDE_RUNTIME_DETAILS_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await o({language:null,version:""}),m(!1),b()},deleteTooltip:Ge.OVERRIDE_RUNTIME_DETAILS_DELETE_TOOLTIP,title:Ge.OVERRIDE_RUNTIME_DETAILS,subTitle:Ge.OVERRIDE_RUNTIME_DETAILS_SUBTITLE,warning:Ge.OVERRIDE_RUNTIME_WARNING,pushButtonsWith:"20px",children:e(se,{$gap:8,children:[t(lt,{label:Ge.LANGUAGE,options:p,values:c.language?[c.language]:[],setValues:e=>d("language",e[0]),helpMessage:`Auto-detected: ${l.language||"none"}`}),t(be,{label:Ge.RUNTIME_VERSION,placeholder:Ge.VERSION_PLACEHOLDER,value:c.version,onChange:e=>d("version",e.target.value),helpMessage:`Auto-detected: ${l.version||"none"}`})]})})]})]})},Lc=({source:e})=>{const{isVm:n}=y(),{containers:o,containersRichTitle:i}=a(()=>{const t=e?.conditions?.runtimeDetection;return{containers:e?.containers??[],containersRichTitle:{title:n?Ge.DETECTED_PROCESSES:`${e.id.kind} ${Ge.CONTAINERS}`,tooltip:t?.message||(n?Ge.DETECTED_PROCESSES_DESCRIPTION:Ge.DETECTED_CONTAINERS_DESCRIPTION),badge:Gt(t?.status)===Ie.Loading?{status:Ie.Loading,backgroundColor:"transparent"}:{label:e?.containers?.length}}}},[e,n]);return t($t,{bgTint:"1000",richTitle:i,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(W,{$gap:8,children:o.map(n=>n&&t(Bc,{...n,sourceId:e.id},`source-container-${n.containerName}`))})})},_c=g.div`
273
273
  display: flex;
274
274
  flex-direction: column;
275
275
  align-self: stretch;
@@ -277,28 +277,43 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
277
277
  padding: 8px 12px;
278
278
  border-radius: 8px;
279
279
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
280
- `,Mc=m.div`
280
+ `,Mc=g.div`
281
281
  display: flex;
282
282
  align-items: center;
283
283
  justify-content: center;
284
284
  padding: 8px;
285
285
  border-radius: 10px;
286
286
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
287
- `,Bc=m.div`
287
+ `,zc=g.div`
288
288
  display: flex;
289
289
  flex-direction: column;
290
290
  gap: 12px;
291
291
  padding: 8px 12px;
292
292
  border-radius: 8px;
293
293
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
294
- `,Xc=({sourceId:o,...n})=>{const{containerName:i,runtimeInfo:l,agentEnabled:s,overrides:r}=n,c=f(),{sourcesApi:d}=sl(),u=a(()=>!!r?.runtimeInfo?.language||!!r?.runtimeInfo?.runtimeVersion,[r]),p=a(()=>({language:Wt(n),version:mo(n)||void 0}),[n]),h=a(()=>!!r?.otelDistroName,[r]),g=a(()=>({otelDistroName:r?.otelDistroName||n.agentEnabled?.otelDistroName}),[r,n]),m=a(()=>!l&&!u,[l,u]),b=a(()=>m?Pi:Ve(p.language),[m,p]),v=a(()=>{if(m)return"";const{language:e,version:t}=p;return`${e}${t?` • ${t}`:""}`},[m,p]),y=a(()=>m?{status:Kt.Loading,label:He.WAITING_FOR_RUNTIME_DETECTION}:{status:s?.otelDistroName?Ee.Success:Kt.Disabled,leftIcon:s?.otelDistroName?ui:pi,label:s?.otelDistroName?`Instrumented | ${s.otelDistroName}`:"Uninstrumented",tooltip:s?.agentEnabledStatus?.message},[m,s]),C=e=>d.update(o,{containerName:i,...h?g:{},...u?p:{},...e}),S=a(()=>{const e=[];return n.agentConfig?.traces?.headSampling?.noisyOperations?.length&&e.push(He.HEAD_SAMPLING),(n.collectorConfig?.tailSampling?.noisyOperations?.length||n.collectorConfig?.tailSampling?.highlyRelevantOperations?.length||n.collectorConfig?.tailSampling?.costReductionRules?.length)&&e.push(He.TAIL_SAMPLING),e},[n]);return e(zc,{children:[e(se,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(se,{$gap:8,$alignItems:"center",children:[t(Mc,{children:t(b,{size:24,fill:l?void 0:c.v2.colors.grey[400]})}),t(ae,{children:i}),t(zt,v?{variant:Yt.Blue,label:v}:{variant:Yt.Loader,label:He.DETECTING_RUNTIME_INFO}),t(Lc,{overridden:u,onOverride:C,defaultValues:p,originalValues:{language:n.runtimeInfo?.language,version:n.runtimeInfo?.runtimeVersion||""}})]}),e(se,{$gap:8,$alignItems:"center",children:[t(Be,{...y,textSize:le.XXXS}),t(Fc,{language:p.language,overridden:h,onOverride:C,defaultValues:g})]})]}),!s||s.agentEnabled||m?null:t(Bc,{children:e(se,{$gap:10,$alignItems:"center",children:[t(zt,{variant:Yt.Pink,label:Ft(s.agentEnabledStatus?.reasonEnum)||He.NO_AVAILABLE_AGENT}),t(ae,{size:le.XXXS,color:ie.Secondary,children:s?.agentEnabledStatus?.message})]})}),S.length>0&&t(Bc,{children:t(se,{$gap:16,$wrap:"wrap",children:S.map((e,o)=>t(Be,{label:e,leftIcon:ui,status:Ee.Success,invertColors:!0,useSecondaryTone:!0},`${i}-rule-${o}`))})})]})},Vc=({source:o,onClickRollout:n,onClickRollback:a})=>{const{isVm:i}=y();return e(W,{$gap:12,children:[t(xc,{source:o}),t(kc,{source:o}),!i&&t(Ec,{source:o,onClickRollout:n,onClickRollback:a}),!i&&t(_c,{source:o}),!i&&t(Tc,{source:o})]})};function Uc(e,t){const o=e.names[t];if(null==o)return"";if("string"==typeof o)return o;if("object"==typeof o&&"name"in o){const e=o.name;if("string"==typeof e)return e}return"number"==typeof o||"boolean"==typeof o?String(o):""}function Hc(e){const t=Math.abs(e);return t>=1e9?`${Gc(e/1e9)}s`:t>=1e6?`${Gc(e/1e6)}ms`:t>=1e3?`${Gc(e/1e3)}μs`:String(Math.round(e))}function Gc(e){return e.toFixed(2).replace(/\.?0+$/,"")}function jc(e){const t=[];for(let o=0;o<e.levels.length;o++){const n=e.levels[o];let a=0;for(let e=0;e+3<n.length;e+=4){const i=n[e],l=n[e+1],s=n[e+2],r=n[e+3],c=a+i;t.push({level:o,offset:c,size:l,self:s,nameIndex:r}),a=c+l}}return t}function Wc(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function Kc(e,t){const o=t.trim().toLowerCase();return!o||e.toLowerCase().includes(o)}function Yc(e,t,o,n,a,i={}){if(0===e.levels.length||t<2||o<2)return null;const{zoomRoot:l=null,shouldKeepName:s,collapseRecursive:r=!1}=i,c=jc(e);let d=l?function(e,t){const o=e.reduce((e,t)=>Math.max(e,t.level),t.level),n=new Map;for(const t of e){const e=n.get(t.level);e?e.push(t):n.set(t.level,[t])}const a=[t];for(let e=t.level+1;e<=o;e++){const t=a.filter(t=>t.level===e-1);if(0===t.length)break;const o=n.get(e);if(o?.length)for(const e of o)for(const o of t)if(e.offset>=o.offset&&e.offset+e.size<=o.offset+o.size){a.push(e);break}}return a}(c,l):c;if(0===d.length)return null;if(s&&(d=d.filter(t=>s(Uc(e,t.nameIndex))),0===d.length))return null;if(r&&(d=function(e,t){if(0===t.length)return t;const o=[...t].sort((e,t)=>e.level-t.level||e.offset-t.offset),n=new Map;for(const e of o){const t=n.get(e.level);t?t.push(e):n.set(e.level,[e])}const a=new Set;for(const t of o){const o=n.get(t.level+1);if(!o)continue;const i=o.filter(e=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);if(1!==i.length)continue;const l=i[0];l.size===t.size&&Uc(e,l.nameIndex)===Uc(e,t.nameIndex)&&a.add(Wc(l))}if(0===a.size)return o;const i=[];for(const e of o){if(a.has(Wc(e)))continue;let t=0;for(let o=0;o<e.level;o++){const i=n.get(o);if(!i)continue;const l=i.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);l&&a.has(Wc(l))&&t++}i.push({...e,level:e.level-t})}return i}(e,d),0===d.length))return null;const u=l?.level??0,p=l?.offset??0,h=l?.size??e.numTicks;if(h<=0)return null;const g=d.reduce((e,t)=>Math.max(e,t.level-u),0)+1,m=n??Number.POSITIVE_INFINITY,f=Math.max(1,Math.min(o/g,m)),b=a.trim(),v=f>8?1:0;return d.map(o=>{const n=o.level-u,a=(o.offset-p)/h*t,i=Math.max(o.size/h*t,1),l=n*f,s=Math.max(f-v,1),r=Uc(e,o.nameIndex);return{...o,x:a,y:l,w:i,h:s,name:r,matchesSearch:Kc(r,b)}})}function Jc(e,t){let o=0;for(let t=0;t<e.length;t++)o=31*o+e.charCodeAt(t)>>>0;const n=t.v2.colors.black[500],a=[{fill:t.v2.colors.purple[300],text:n},{fill:t.v2.colors.green[300],text:n},{fill:t.v2.colors.red[300],text:n},{fill:t.v2.colors.blue[300],text:n},{fill:t.v2.colors.yellow[300],text:n}];return a[o%a.length]}var qc,Zc;!function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(qc||(qc={})),function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(Zc||(Zc={}));function Qc(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function ed(e,t,o){for(const n of o)if(e>=n.x&&e<n.x+n.w&&t>=n.y&&t<n.y+n.h)return n;return null}function td(e){return e>=1073741824?`${(e/1073741824).toFixed(1)} GiB`:e>=1048576?`${(e/1048576).toFixed(1)} MiB`:e>=1024?`${(e/1024).toFixed(1)} KiB`:`${e} B`}const od=({flamebearer:o,maxRowPx:r,searchQuery:c="",shouldKeepName:d,minHostHeight:u=200,onFullscreenChange:p,profilingSlots:h})=>{const m=f(),b=i(null),v=i(null),y=i({x:0,y:0}),C=i(o.numTicks),[S,w]=s({w:0,h:0}),[x,T]=s(""),[k,$]=s(null),[E,I]=s([]),[A,N]=s(!1),[O,R]=s(qc.Fit),[D,P]=s(Zc.Fit),[F,L]=s(!1),_=Math.max(1,Math.min(Math.floor(S.w*O),8192)),z=Math.max(1,Math.min(Math.floor(S.h*D),8192)),M=E.length>0?E[E.length-1]:null,B=M?.size??o.numTicks;n(()=>{C.current!==o.numTicks&&(C.current=o.numTicks,I([]))},[o.numTicks]),g(()=>{const e=b.current;if(!e)return;const t=new ResizeObserver(()=>{const t=e.getBoundingClientRect();w({w:Math.floor(t.width),h:Math.floor(t.height)})});return t.observe(e),()=>t.disconnect()},[]),n(()=>{if(!A)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[A]),n(()=>(p?.(A),()=>{A&&p?.(!1)}),[A,p]);const X=a(()=>Yc(o,_,z,r,c,{zoomRoot:M,shouldKeepName:d,collapseRecursive:F}),[o,r,c,z,_,M,d,F]),V=a(()=>function(e){return[...e].sort((e,t)=>t.level-e.level)}(X?.length?c.trim()?X.filter(e=>e.matchesSearch):X:[]),[X,c]),U=l(e=>{if(_<2||z<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const n=ed((e.clientX-t.left)/t.width*_,(e.clientY-t.top)/t.height*z,V);if(n){const e=Wc(n);$(e);const t=B>0?(100*n.size/B).toFixed(1):"0",a=o.numTicks>0?(100*n.size/o.numTicks).toFixed(1):"0";T(`${n.name}\ntotal ${Hc(n.size)} (${t}% of view, ${a}% of profile) · self ${Hc(n.self)}`)}else $(null),T("")},[V,o.numTicks,z,_,B]),H=l(e=>{U(e)},[U]),G=l(()=>{$(null),T("")},[]),j=l(e=>{y.current={x:e.clientX,y:e.clientY}},[]),W=l(e=>{const{x:t,y:o}=y.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-o)>3)return;if(_<2||z<2)return;const n=e.currentTarget.getBoundingClientRect();if(n.width<1||n.height<1)return;const a=ed((e.clientX-n.left)/n.width*_,(e.clientY-n.top)/n.height*z,V);if(!a)return;const i=function(e){return{level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}}(a);I(e=>{const t=e.length>0?e[e.length-1]:null;return t&&function(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}(i,t)?e.slice(0,-1):[...e,i]})},[V,z,_]);g(()=>{const e=v.current;if(!e||_<2||z<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,n=Math.max(_,z),a=Math.min(t,16384/n);e.width=Math.floor(_*a),e.height=Math.floor(z*a),e.style.width=`${_}px`,e.style.height=`${z}px`;const i=e.getContext("2d");i&&(i.setTransform(a,0,0,a,0,0),i.clearRect(0,0,_,z),X?.length?function(e,t,o,n,a,i,l,s){const r=i.v2.colors.silver[900];e.fillStyle=r,e.fillRect(0,0,t,o);const c=a.trim().length>0;e.textRendering="optimizeLegibility";for(const t of n){const{x:o,y:n,w:a,h:l,name:r,size:d,matchesSearch:u}=t;if(c&&!u)continue;const{fill:p,text:h}=Jc(r,i);e.fillStyle=p,e.fillRect(o,n,a,l),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(o+.5,n+.5),e.lineTo(o+a-.5,n+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(o+.5,n+.5,Math.max(a-1,0),Math.max(l-1,0));const g=Qc(d,s),m=`${r} (${Hc(d)}, ${g}%)`,f=i.v2.text.size.xs,b=8,v=5,y=26,C=Math.min(f,Math.floor(l-2));if(a>=y&&C>=b){e.font=`${C}px ${i.font_family.primary}, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`,e.textBaseline="middle",e.textAlign="left";let t=m;for(;t.length>2&&e.measureText(t).width>a-2*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=a-2*v&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,o+v,n+l/2),e.fillStyle=h,e.fillText(t,o+v,n+l/2))}}if(l)for(const t of n){if(Wc(t)!==l)continue;if(c&&!t.matchesSearch)continue;const{x:o,y:n,w:a,h:i}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(o+1,n+1,Math.max(a-2,0),Math.max(i-2,0));break}}(i,_,z,X,c,m,k,o.numTicks):(i.fillStyle=m.v2.colors.silver[900],i.fillRect(0,0,_,z)))},[X,o.numTicks,k,c,z,_,m]);const K=l(()=>N(e=>!e),[]),Y=o.numTicks>0?Math.max(0,Math.min(100,Math.round(B/o.numTicks*100))):100,J=a(()=>function(e,t){const o=jc(e),n=t?.offset??0,a=n+(t?.size??e.numTicks),i=(t?.level??-1)+1,l=t?.size??e.numTicks;let s=null;for(const e of o)e.level<i||e.offset<n||e.offset+e.size>a||e.size>=l||(!s||e.size>s.size||e.size===s.size&&e.level<s.level)&&(s=e);return s}(o,M),[o,M]),q=null!==J,Z=E.length>0,te=M?Uc(o,M.nameIndex):"",oe=l(()=>I([]),[]),ne=l(()=>I(e=>e.slice(0,-1)),[]),pe=l(()=>{J&&I(e=>[...e,J])},[J]);return e("div",{style:A?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:m.v2.colors.silver[900]}:{flex:1,minHeight:u,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(se,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(Q,{label:"Collapse recursive",tooltip:"Collapse straight-line recursion (parent → single same-name child of equal width) into a single bar. Helps deep recursive call chains fit on screen.",labelAlign:ee.Left,size:vt.S,value:F,onChange:L}),e(se,{$gap:8,children:[e(se,{children:[t(re,{variant:de.Secondary,size:ce.S,label:"Reset zoom",leftIcon:Mi,onClick:oe,disabled:!E.length}),t(re,{variant:de.Secondary,size:ce.S,iconSize:20,leftIcon:Bi,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!Z,onClick:ne}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(ae,{size:le.XXS,color:ie.Secondary,nowrap:!0,align:"center",children:`${Y}%`})}),t(re,{variant:de.Secondary,size:ce.S,iconSize:20,leftIcon:ci,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!q,onClick:pe})]}),e(se,{children:[t(De,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(ue,{variant:fo.Filled,options:[{value:qc.Fit,label:"W: Fit"},{value:qc.X10,label:"10x"}],selected:O,setSelected:R})}),t(De,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(ue,{variant:fo.Filled,options:[{value:Zc.Fit,label:"H: Fit"},{value:Zc.X10,label:"10x"}],selected:D,setSelected:P})})]}),t(re,{variant:de.Secondary,size:ce.S,iconSize:24,leftIcon:A?Ti:Xi,tooltip:A?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:K})]})]}),t(De,{fullWidth:!0,keepAlive:!0,text:x,children:t("div",{ref:b,style:{flex:1,minWidth:0,width:"100%",height:A?"calc(100vh - 80px)":"calc(100vh - 364px)",position:"relative",overflowX:O>1?"auto":"hidden",overflowY:D>1?"auto":"hidden"},children:t("div",{style:{width:_||"100%",height:z||"100%",position:"relative"},children:t("canvas",{ref:v,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:k?"pointer":"default"},onPointerDown:j,onPointerMove:H,onPointerLeave:G,onClick:W})})})}),e(se,{$justifyContent:"space-between",children:[t(ae,M?{size:le.XXXS,color:m.v2.colors.silver[300],children:`Zoomed: ${te} • ${Hc(B)} samples in view`}:{size:le.XXXS,color:m.v2.colors.silver[300],children:"Click a frame to zoom into its subtree (pprof-style)."}),h&&t(ae,{size:le.XXXS,color:m.v2.colors.silver[300],children:`${h.activeKeys.length} / ${h.maxSlots} profiling slots · ${td(h.totalBytesUsed)} / ${td(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})};var nd,ad;!function(e){e.Symbol="symbol",e.Self="self",e.Total="total"}(nd||(nd={})),function(e){e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"}(ad||(ad={}));const id=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function ld(e,t){const o=function(e){return e.split(" ")[0]??""}(e);if(t.includes(ad.FilterOutVoid)&&"void"===o)return!1;if(t.includes(ad.OnlyWithReturnValues)){if(!(e.includes(" ")&&"void"!==o&&id.test(o)))return!1}return!0}const sd={options:[{id:ad.FilterOutVoid,label:"Filter out void symbols"},{id:ad.OnlyWithReturnValues,label:"Only show functions with return values"}],filterRow:(e,t)=>ld(e.cells.find(e=>e.key===nd.Symbol)?.rawValue?.toString()??"",t)},rd=({rows:e,languages:o,filters:n,onFiltersChange:i})=>{const l=a(()=>[{key:nd.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:o?.includes(bo.Java)?sd:void 0,noFilter:!o?.includes(bo.Java)},{key:nd.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:nd.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[o]),s=a(()=>e.map(e=>({cells:[{key:nd.Symbol,rawValue:e.name},{key:nd.Self,rawValue:Hc(e.self)},{key:nd.Total,rawValue:Hc(e.total)}]})),[e]);return t(vo,{variant:yo.Data,maxHeight:"calc(100vh - 306px)",columns:l,rows:s,filters:n,onFiltersChange:i,rowActionsPushLeftPosition:"12px",getRowActions:e=>[{id:`copy-${e.cells[0].rawValue}`,label:"",rightIcon:Vi,onClick:()=>{navigator.clipboard.writeText(e.cells[0].rawValue)}}]})};var cd;!function(e){e.Table="table",e.Flame="flame",e.Both="both"}(cd||(cd={}));const dd=m(W)`
294
+ `,Bc=({sourceId:n,...o})=>{const{containerName:i,runtimeInfo:l,agentEnabled:s,overrides:r}=o,c=f(),{sourcesApi:d}=ll(),u=a(()=>!!r?.runtimeInfo?.language||!!r?.runtimeInfo?.runtimeVersion,[r]),p=a(()=>({language:jt(o),version:hn(o)||void 0}),[o]),h=a(()=>!!r?.otelDistroName,[r]),m=a(()=>({otelDistroName:r?.otelDistroName||o.agentEnabled?.otelDistroName}),[r,o]),g=a(()=>!l&&!u,[l,u]),b=a(()=>g?Ri:Ve(p.language),[g,p]),v=a(()=>{if(g)return"";const{language:e,version:t}=p;return`${e}${t?` • ${t}`:""}`},[g,p]),y=a(()=>g?{status:Ie.Loading,label:Ge.WAITING_FOR_RUNTIME_DETECTION}:{status:s?.otelDistroName?Ie.Success:Ie.Disabled,leftIcon:s?.otelDistroName?ci:di,label:s?.otelDistroName?`Instrumented | ${s.otelDistroName}`:"Uninstrumented",tooltip:s?.agentEnabledStatus?.message},[g,s]),C=e=>d.update(n,{containerName:i,...h?m:{},...u?p:{},...e}),S=a(()=>{const e=[];return o.agentConfig?.traces?.headSampling?.noisyOperations?.length&&e.push(Ge.HEAD_SAMPLING),(o.collectorConfig?.tailSampling?.noisyOperations?.length||o.collectorConfig?.tailSampling?.highlyRelevantOperations?.length||o.collectorConfig?.tailSampling?.costReductionRules?.length)&&e.push(Ge.TAIL_SAMPLING),e},[o]);return e(_c,{children:[e(se,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(se,{$gap:8,$alignItems:"center",children:[t(Mc,{children:t(b,{size:24,fill:l?void 0:c.v2.colors.grey[400]})}),t(ae,{children:i}),t(_t,v?{variant:Wt.Blue,label:v}:{variant:Wt.Loader,label:Ge.DETECTING_RUNTIME_INFO}),t(Fc,{overridden:u,onOverride:C,defaultValues:p,originalValues:{language:o.runtimeInfo?.language,version:o.runtimeInfo?.runtimeVersion||""}})]}),e(se,{$gap:8,$alignItems:"center",children:[t(Be,{...y,textSize:le.XXXS}),t(Pc,{language:p.language,overridden:h,onOverride:C,defaultValues:m})]})]}),!s||s.agentEnabled||g?null:t(zc,{children:e(se,{$gap:10,$alignItems:"center",children:[t(_t,{variant:Wt.Pink,label:Pt(s.agentEnabledStatus?.reasonEnum)||Ge.NO_AVAILABLE_AGENT}),t(ae,{size:le.XXXS,color:ie.Secondary,children:s?.agentEnabledStatus?.message})]})}),S.length>0&&t(zc,{children:t(se,{$gap:16,$wrap:"wrap",children:S.map((e,n)=>t(Be,{label:e,leftIcon:ci,status:Ie.Success,invertColors:!0,useSecondaryTone:!0},`${i}-rule-${n}`))})})]})},Xc=({source:n,onClickRollout:o,onClickRollback:a})=>{const{isVm:i}=y();return e(W,{$gap:12,children:[t(wc,{source:n}),t(kc,{source:n}),!i&&t($c,{source:n,onClickRollout:o,onClickRollback:a}),!i&&t(Lc,{source:n}),!i&&t(xc,{source:n})]})},Vc=g(W)`
295
+ width: 100%;
296
+ max-height: 320px;
297
+ overflow-y: auto;
298
+ gap: 8px;
299
+ `,Uc=g(se)`
300
+ width: 100%;
301
+ align-items: center;
302
+ gap: 8px;
303
+ padding: 8px 12px;
304
+ border-radius: 8px;
305
+ background: ${({theme:e})=>e.v2.colors.silver[900]};
306
+ & > * {
307
+ font-family: monospace !important;
308
+ }
309
+ `,Gc=({pendingModify:n,onClose:o,onConfirm:a})=>{const i=f();return t(Ue,{isOpen:!!n,title:'Modify the "Profiling Symbols" rule',description:'These changes are applied immediately to a single custom instrumentation rule named "Profiling Symbols".\nSelected symbols are added to it; unchecked symbols are removed from it (the rule is deleted once empty). Symbols managed by other rules are never touched.',onClose:o,denyButton:{variant:de.Secondary,label:"Cancel",onClick:o},approveButton:{variant:de.Primary,label:"Confirm",onClick:a},children:n&&e(Vc,{children:[n.add.map(n=>e(Uc,{children:[t(Be,{leftIcon:si,status:Ie.Success,useSecondaryTone:!0,textColor:i.v2.colors.white[500],textSize:le.XXS}),t(ae,{size:le.XS,color:ie.Primary,children:n})]},`add-${n}`)),n.remove.map(n=>e(Uc,{children:[t(Be,{leftIcon:_i,status:Ie.Error,useSecondaryTone:!0,textColor:i.v2.colors.white[500],textSize:le.XXS}),t(ae,{size:le.XS,color:ie.Primary,children:n})]},`remove-${n}`))]})})};function Hc(e,t){const n=e.names[t];if(null==n)return"";if("string"==typeof n)return n;if("object"==typeof n&&"name"in n){const e=n.name;if("string"==typeof e)return e}return"number"==typeof n||"boolean"==typeof n?String(n):""}function jc(e){const t=Math.abs(e);return t>=1e9?`${Wc(e/1e9)}s`:t>=1e6?`${Wc(e/1e6)}ms`:t>=1e3?`${Wc(e/1e3)}μs`:String(Math.round(e))}function Wc(e){return e.toFixed(2).replace(/\.?0+$/,"")}function Kc(e){const t=[];for(let n=0;n<e.levels.length;n++){const o=e.levels[n];let a=0;for(let e=0;e+3<o.length;e+=4){const i=o[e],l=o[e+1],s=o[e+2],r=o[e+3],c=a+i;t.push({level:n,offset:c,size:l,self:s,nameIndex:r}),a=c+l}}return t}function Yc(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function Jc(e,t){const n=e.reduce((e,t)=>Math.max(e,t.level),t.level),o=new Map;for(const t of e){const e=o.get(t.level);e?e.push(t):o.set(t.level,[t])}const a=[t];for(let e=t.level+1;e<=n;e++){const t=a.filter(t=>t.level===e-1);if(0===t.length)break;const n=o.get(e);if(n?.length)for(const e of n)for(const n of t)if(e.offset>=n.offset&&e.offset+e.size<=n.offset+n.size){a.push(e);break}}return a}function qc(e,t){const n=t.trim().toLowerCase();return!n||e.toLowerCase().includes(n)}function Zc(e,t,n,o,a,i={}){if(0===e.levels.length||t<2||n<2)return null;const{zoomRoot:l=null,shouldKeepName:s,collapseRecursive:r=!1,allRects:c}=i,d=c??Kc(e);let u=l?Jc(d,l):d;if(0===u.length)return null;if(s&&(u=u.filter(t=>s(Hc(e,t.nameIndex))),0===u.length))return null;if(r&&(u=function(e,t){if(0===t.length)return t;const n=[...t].sort((e,t)=>e.level-t.level||e.offset-t.offset),o=new Map;for(const e of n){const t=o.get(e.level);t?t.push(e):o.set(e.level,[e])}const a=new Set;for(const t of n){const n=o.get(t.level+1);if(!n)continue;const i=n.filter(e=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);if(1!==i.length)continue;const l=i[0];l.size===t.size&&Hc(e,l.nameIndex)===Hc(e,t.nameIndex)&&a.add(Yc(l))}if(0===a.size)return n;const i=[];for(const e of n){if(a.has(Yc(e)))continue;let t=0;for(let n=0;n<e.level;n++){const i=o.get(n);if(!i)continue;const l=i.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);l&&a.has(Yc(l))&&t++}i.push({...e,level:e.level-t})}return i}(e,u),0===u.length))return null;const p=l?.level??0,h=l?.offset??0,m=l?.size??e.numTicks;if(m<=0)return null;const g=u.reduce((e,t)=>Math.max(e,t.level-p),0)+1,f=o??Number.POSITIVE_INFINITY,b=Math.max(1,Math.min(n/g,f)),v=a.trim(),y=b>8?1:0;return u.map(n=>{const o=n.level-p,a=(n.offset-h)/m*t,i=Math.max(n.size/m*t,1),l=o*b,s=Math.max(b-y,1),r=Hc(e,n.nameIndex);return{...n,x:a,y:l,w:i,h:s,name:r,matchesSearch:qc(r,v)}})}function Qc(e,t){let n=0;for(let t=0;t<e.length;t++)n=31*n+e.charCodeAt(t)>>>0;const o=t.v2.colors.black[500],a=[{fill:t.v2.colors.purple[300],text:o},{fill:t.v2.colors.green[300],text:o},{fill:t.v2.colors.red[300],text:o},{fill:t.v2.colors.blue[300],text:o},{fill:t.v2.colors.yellow[300],text:o}];return a[n%a.length]}var ed,td;!function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(ed||(ed={})),function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(td||(td={}));function nd(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function od(e,t,n){for(const o of n)if(e>=o.x&&e<o.x+o.w&&t>=o.y&&t<o.y+o.h)return o;return null}function ad(e){return e>=1073741824?`${(e/1073741824).toFixed(1)} GiB`:e>=1048576?`${(e/1048576).toFixed(1)} MiB`:e>=1024?`${(e/1024).toFixed(1)} KiB`:`${e} B`}const id=({flamebearer:n,maxRowPx:r,searchQuery:c="",shouldKeepName:d,minHostHeight:u=200,onFullscreenChange:p,profilingSlots:h,onFrameClick:g,onZoomedSymbolsChange:b,onResetZoom:v})=>{const y=f(),C=i(null),S=i(null),w=i({x:0,y:0}),x=i(n.numTicks),[k,T]=s({w:0,h:0}),[$,I]=s(""),[E,A]=s(null),[N,O]=s([]),[R,D]=s(!1),[P,F]=s(ed.Fit),[L,_]=s(td.Fit),[M,z]=s(!1),B=Math.max(1,Math.min(Math.floor(k.w*P),8192)),X=Math.max(1,Math.min(Math.floor(k.h*L),8192)),V=N.length>0?N[N.length-1]:null,U=V?.size??n.numTicks,G=a(()=>Kc(n),[n]);o(()=>{x.current!==n.numTicks&&(x.current=n.numTicks,O([]))},[n.numTicks]),o(()=>{if(!b)return;if(!V)return void b(null);const e=Jc(G,V),t=new Set;for(const o of e){const e=Hc(n,o.nameIndex);e&&t.add(e)}b([...t])},[V,n,G,b]),m(()=>{const e=C.current;if(!e)return;const t=new ResizeObserver(()=>{const t=e.getBoundingClientRect();T({w:Math.floor(t.width),h:Math.floor(t.height)})});return t.observe(e),()=>t.disconnect()},[]),o(()=>{if(!R)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[R]),o(()=>(p?.(R),()=>{R&&p?.(!1)}),[R,p]);const H=a(()=>Zc(n,B,X,r,c,{zoomRoot:V,shouldKeepName:d,collapseRecursive:M,allRects:G}),[n,r,c,X,B,V,d,M,G]),j=a(()=>function(e){return[...e].sort((e,t)=>t.level-e.level)}(H?.length?c.trim()?H.filter(e=>e.matchesSearch):H:[]),[H,c]),W=l(e=>{if(B<2||X<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const o=od((e.clientX-t.left)/t.width*B,(e.clientY-t.top)/t.height*X,j);if(o){const e=Yc(o);A(e);const t=U>0?(100*o.size/U).toFixed(1):"0",a=n.numTicks>0?(100*o.size/n.numTicks).toFixed(1):"0";I(`${o.name}\ntotal ${jc(o.size)} (${t}% of view, ${a}% of profile) · self ${jc(o.self)}`)}else A(null),I("")},[j,n.numTicks,X,B,U]),K=l(e=>{W(e)},[W]),Y=l(()=>{A(null),I("")},[]),J=l(e=>{w.current={x:e.clientX,y:e.clientY}},[]),q=l(e=>{const{x:t,y:n}=w.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-n)>3)return;if(B<2||X<2)return;const o=e.currentTarget.getBoundingClientRect();if(o.width<1||o.height<1)return;const a=od((e.clientX-o.left)/o.width*B,(e.clientY-o.top)/o.height*X,j);if(!a)return;g?.(a.name);const i=function(e){return{level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}}(a);O(e=>{const t=e.length>0?e[e.length-1]:null;return t&&function(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}(i,t)?e.slice(0,-1):[...e,i]})},[j,X,B,g]);m(()=>{const e=S.current;if(!e||B<2||X<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,o=Math.max(B,X),a=Math.min(t,16384/o);e.width=Math.floor(B*a),e.height=Math.floor(X*a),e.style.width=`${B}px`,e.style.height=`${X}px`;const i=e.getContext("2d");i&&(i.setTransform(a,0,0,a,0,0),i.clearRect(0,0,B,X),H?.length?function(e,t,n,o,a,i,l,s){const r=i.v2.colors.silver[900];e.fillStyle=r,e.fillRect(0,0,t,n);const c=a.trim().length>0;e.textRendering="optimizeLegibility";for(const t of o){const{x:n,y:o,w:a,h:l,name:r,size:d,matchesSearch:u}=t;if(c&&!u)continue;const{fill:p,text:h}=Qc(r,i);e.fillStyle=p,e.fillRect(n,o,a,l),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(n+.5,o+.5),e.lineTo(n+a-.5,o+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(n+.5,o+.5,Math.max(a-1,0),Math.max(l-1,0));const m=nd(d,s),g=`${r} (${jc(d)}, ${m}%)`,f=i.v2.text.size.xs,b=8,v=5,y=26,C=Math.min(f,Math.floor(l-2));if(a>=y&&C>=b){e.font=`${C}px ${i.font_family.primary}, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`,e.textBaseline="middle",e.textAlign="left";let t=g;for(;t.length>2&&e.measureText(t).width>a-2*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=a-2*v&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,n+v,o+l/2),e.fillStyle=h,e.fillText(t,n+v,o+l/2))}}if(l)for(const t of o){if(Yc(t)!==l)continue;if(c&&!t.matchesSearch)continue;const{x:n,y:o,w:a,h:i}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(n+1,o+1,Math.max(a-2,0),Math.max(i-2,0));break}}(i,B,X,H,c,y,E,n.numTicks):(i.fillStyle=y.v2.colors.silver[900],i.fillRect(0,0,B,X)))},[H,n.numTicks,E,c,X,B,y]);const Z=l(()=>D(e=>!e),[]),te=n.numTicks>0?Math.max(0,Math.min(100,Math.round(U/n.numTicks*100))):100,ne=a(()=>function(e,t,n){const o=n??Kc(e),a=t?.offset??0,i=a+(t?.size??e.numTicks),l=(t?.level??-1)+1,s=t?.size??e.numTicks;let r=null;for(const e of o)e.level<l||e.offset<a||e.offset+e.size>i||e.size>=s||(!r||e.size>r.size||e.size===r.size&&e.level<r.level)&&(r=e);return r}(n,V,G),[n,V,G]),oe=null!==ne,pe=N.length>0,he=V?Hc(n,V.nameIndex):"",me=l(()=>{O([]),v?.()},[v]),ge=l(()=>O(e=>e.slice(0,-1)),[]),fe=l(()=>{ne&&O(e=>[...e,ne])},[ne]);return e("div",{style:R?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:y.v2.colors.silver[900]}:{flex:1,minHeight:u,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(se,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(Q,{label:"Collapse recursive",tooltip:"Collapse straight-line recursion (parent → single same-name child of equal width) into a single bar. Helps deep recursive call chains fit on screen.",labelAlign:ee.Left,size:bt.S,value:M,onChange:z}),e(se,{$gap:8,children:[e(se,{children:[t(re,{variant:de.Secondary,size:ce.S,label:"Reset zoom",leftIcon:Mi,onClick:me,disabled:!N.length}),t(re,{variant:de.Secondary,size:ce.S,iconSize:20,leftIcon:_i,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!pe,onClick:ge}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(ae,{size:le.XXS,color:ie.Secondary,nowrap:!0,align:"center",children:`${te}%`})}),t(re,{variant:de.Secondary,size:ce.S,iconSize:20,leftIcon:si,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!oe,onClick:fe})]}),e(se,{children:[t(De,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(ue,{variant:mn.Filled,options:[{value:ed.Fit,label:"W: Fit"},{value:ed.X10,label:"10x"}],selected:P,setSelected:F})}),t(De,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(ue,{variant:mn.Filled,options:[{value:td.Fit,label:"H: Fit"},{value:td.X10,label:"10x"}],selected:L,setSelected:_})})]}),t(re,{variant:de.Secondary,size:ce.S,iconSize:24,leftIcon:R?wi:zi,tooltip:R?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:Z})]})]}),t(De,{fullWidth:!0,keepAlive:!0,text:$,children:t("div",{ref:C,style:{flex:1,minWidth:0,width:"100%",height:R?"calc(100vh - 80px)":"calc(100vh - 364px)",position:"relative",overflow:"hidden"},children:t("div",{style:{position:"absolute",inset:0,overflowX:P>1?"auto":"hidden",overflowY:L>1?"auto":"hidden"},children:t("div",{style:{width:B||"100%",height:X||"100%",position:"relative"},children:t("canvas",{ref:S,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:E?"pointer":"default"},onPointerDown:J,onPointerMove:K,onPointerLeave:Y,onClick:q})})})})}),e(se,{$justifyContent:"space-between",children:[t(ae,V?{size:le.XXXS,color:y.v2.colors.silver[300],children:`Zoomed: ${he} • ${jc(U)} samples in view`}:{size:le.XXXS,color:y.v2.colors.silver[300],children:g?"Click a frame to zoom in and jump to its row in the symbol table.":"Click a frame to zoom into its subtree (pprof-style)."}),h&&t(ae,{size:le.XXXS,color:y.v2.colors.silver[300],children:`${h.activeKeys.length} / ${h.maxSlots} profiling slots · ${ad(h.totalBytesUsed)} / ${ad(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})},ld=[gn.Go,gn.Java],sd="Profiling Symbols";function rd(e,t){if(0===t.length)return null;const n=1===t.length?t[0]:function(e){return e.includes("/")||/\.\(\*?[^)]+\)\./.test(e)?gn.Go:e.includes(" ")||e.includes("(")?gn.Java:gn.Go}(e);if(n===gn.Go){const t=function(e){let t=e.trim();if(!t)return null;t=t.replace(/\[[^\]]*\]/g,"");const n=t.lastIndexOf("/"),o=t.indexOf(".",n+1);if(-1===o)return null;const a=t.slice(0,o),i=t.slice(o+1);if(!a||!i)return null;const l=i.match(/^\(\*?([^)]+)\)\.(.+)$/);if(l){const e=new Le(a,"",l[1],l[2]);return e.Verify()?e:null}const s=new Le(a,i);return s.Verify()?s:null}(e);return t?{language:n,golang:t}:null}if(n===gn.Java){const t=function(e){let t=e.trim();if(!t)return null;const n=t.indexOf("(");-1!==n&&(t=t.slice(0,n).trim());const o=t.split(/\s+/);t=o[o.length-1]??"";const a=t.lastIndexOf(".");if(-1===a)return null;const i=t.slice(0,a),l=t.slice(a+1),s=new _e(i,l);return s.Verify()?s:null}(e);return t?{language:n,java:t}:null}return null}function cd(e,t){return e.namespace===t.namespace&&e.name===t.name&&e.kind===t.kind}function dd(e,t,n){if(!e)return!0;const{sources:o=[],namespaces:a=[],languages:i=[]}=e,l=!o.length||o.some(e=>cd(e,t.id)),s=!a.length||a.includes(t.id.namespace),r=!i.length||null==n||i.includes(n);return l&&s&&r}function ud(e,t){return e.packageName===t.packageName&&(e.functionName||"")===(t.functionName||"")&&(e.receiverName||"")===(t.receiverName||"")&&(e.receiverMethodName||"")===(t.receiverMethodName||"")}function pd(e,t){return e.className===t.className&&e.methodName===t.methodName}function hd(e,t,n,o){const a=rd(e,n);if(!a)return[];const i=[];for(const e of o){const n=e.customInstrumentations;if(!n)continue;if(!dd(e.sourceScopes,t,a.language))continue;const o=!!a.golang&&!!n[Me.Golang]?.some(e=>ud(e,a.golang)),l=!!a.java&&!!n[Me.Java]?.some(e=>pd(e,a.java));(o||l)&&i.push({rule:e,resolved:a})}return i}function md({source:e,languages:t,rows:n}){const{instrumentationRulesApi:o,capabilities:i}=ll(),{items:r}=o.useRules(),[c,d]=s(new Set),[u,p]=s(new Set),[h,m]=s(null),g=a(()=>function(e){const t=new Set(e??[]);return ld.filter(e=>t.has(e))}(t),[t]),f=i.canCreateInstrumentationRule,b=a(()=>function(e,t){const n=e.filter(e=>e.type===ze.CustomInstrumentation&&e.ruleName===sd&&dd(e.sourceScopes,t));return n.find(e=>e.sourceScopes?.sources?.some(e=>cd(e,t.id)))??n[0]??null}(r,e),[r,e]),v=f&&g.length>0,y=a(()=>{const t=new Map;for(const o of n){const n=!!rd(o.name,g),a=hd(o.name,e,g,r),i=!!b&&a.some(e=>e.rule.ruleId===b.ruleId),l=a.filter(e=>e.rule.ruleId!==b?.ruleId),s=!i&&l.length>0,c=v&&n,d=s;let u;if(s){const e=[...new Set(l.map(e=>e.rule.ruleName))];u=`Managed by ${e.length>1?"rules":"rule"} ${e.map(e=>`“${e}”`).join(", ")}. Edit ${e.length>1?"those rules":"that rule"} to change this symbol.`}let p=!1,h="Add this symbol to the “Profiling Symbols” rule";s?h=u??"Managed by another rule":0===a.length&&(0===g.length?h="Custom instrumentation is only available for Go and Java sources":f?n?p=!0:h="This symbol could not be parsed into a probe automatically":h="You don’t have permission to add custom instrumentation"),t.set(o.name,{parsable:n,inManagedRule:i,otherRules:l,showCheckbox:c,checkboxDisabled:d,checkboxTooltip:u,addEnabled:p,addTooltip:h})}return t},[n,r,e,g,f,v,b]),C=a(()=>{const e=new Set;return y.forEach((t,n)=>{t.inManagedRule&&e.add(n)}),e},[y]),S=a(()=>[...c].filter(e=>y.get(e)?.addEnabled&&!C.has(e)),[c,y,C]),w=a(()=>[...u].filter(e=>C.has(e)),[u,C]),x=S.length+w.length,k=l(e=>{const t=y.get(e);return t?.inManagedRule?!u.has(e):!!(t&&t.otherRules.length>0)||c.has(e)},[y,u,c]),T=l((e,t)=>{const n=y.get(e);n&&!n.checkboxDisabled&&(n.inManagedRule?p(n=>{const o=new Set(n);return t?o.delete(e):o.add(e),o}):d(n=>{const o=new Set(n);return t?o.add(e):o.delete(e),o}))},[y]),$=l(()=>{d(new Set),p(new Set)},[]),I=l(t=>{(async()=>{const n=t.add.map(e=>rd(e,g)).filter(e=>!!e),a=t.remove.map(e=>rd(e,g)).filter(e=>!!e);if(b){const{customInstrumentations:e,isEmpty:t}=function(e,t,n){const o=e.customInstrumentations??{};let a=[...o[Me.Golang]??[]],i=[...o[Me.Java]??[]];for(const e of n)e.golang&&(a=a.filter(t=>!ud(t,e.golang))),e.java&&(i=i.filter(t=>!pd(t,e.java)));for(const e of t)e.golang&&!a.some(t=>ud(t,e.golang))&&a.push(e.golang),e.java&&!i.some(t=>pd(t,e.java))&&i.push(e.java);return{customInstrumentations:{[Me.Golang]:a,[Me.Java]:i},isEmpty:0===a.length&&0===i.length}}(b,n,a);t?await o.remove(b.ruleId,ze.CustomInstrumentation):await o.update(b.ruleId,function(e,t){return{ruleName:e.ruleName,notes:e.notes,disabled:e.disabled,sourceScopes:e.sourceScopes??null,workloads:null,instrumentationLibraries:e.instrumentationLibraries??null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:t}}(b,e),ze.CustomInstrumentation)}else n.length>0&&await o.create(function(e,t){const n=e.map(e=>e.golang).filter(e=>!!e),o=e.map(e=>e.java).filter(e=>!!e),a={sources:[{namespace:t.id.namespace,name:t.id.name,kind:t.id.kind}],namespaces:[],languages:[]};return{ruleName:sd,notes:"Symbols selected from the profiling tab.",disabled:!1,sourceScopes:a,workloads:null,instrumentationLibraries:null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:{[Me.Golang]:n,[Me.Java]:o}}}(n,e),ze.CustomInstrumentation)})()},[b,g,e,o]),E=l(()=>{x&&m({add:S,remove:w})},[x,S,w]),A=l(e=>m({add:[e],remove:[]}),[]),N=l(e=>m({add:[],remove:[e]}),[]),O=l(()=>m(null),[]),R=l(()=>{h&&(I(h),m(null),$())},[h,I,$]),D=l(e=>y.get(e)??{parsable:!1,inManagedRule:!1,otherRules:[],showCheckbox:!1,checkboxDisabled:!1,addEnabled:!1,addTooltip:"Custom instrumentation is only available for Go and Java sources"},[y]);return{instrumentation:a(()=>({getSymbolState:D,onAdd:A,onRemove:N,selectionEnabled:v,isSelected:k,onToggleSymbol:T}),[D,A,N,v,k,T]),pendingCount:x,pendingModify:h,closeModify:O,openBulkModify:E,resetSelection:$,confirmModify:R}}var gd,fd,bd;!function(e){e.Symbol="symbol",e.Self="self",e.Total="total"}(gd||(gd={})),function(e){e.OnlyInstrumentable="only-instrumentable"}(fd||(fd={})),function(e){e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"}(bd||(bd={}));const vd=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function yd(e,t){const n=function(e){return e.split(" ")[0]??""}(e);if(t.includes(bd.FilterOutVoid)&&"void"===n)return!1;if(t.includes(bd.OnlyWithReturnValues)){if(!(e.includes(" ")&&"void"!==n&&vd.test(n)))return!1}return!0}const Cd=({rows:e,languages:n,instrumentation:o,searchQuery:i,filters:s,onFiltersChange:r,zoomedSymbols:c,highlightSymbol:d,scrollSignal:u})=>{const p=!!n?.includes(gn.Java),h=a(()=>{const t=c?new Set(c):null,n=i?.trim().toLowerCase();return e.filter(e=>(!t||t.has(e.name))&&(!n||e.name.toLowerCase().includes(n)))},[e,i,c]),m=a(()=>{const e=[];if(o.selectionEnabled&&e.push({id:fd.OnlyInstrumentable,label:"Only show instrumentable symbols"}),p&&(e.push({id:bd.FilterOutVoid,label:"Filter out void symbols"}),e.push({id:bd.OnlyWithReturnValues,label:"Only show functions with return values"})),0!==e.length)return{options:e,filterRow:(e,t)=>{const n=e.cells.find(e=>e.key===gd.Symbol)?.rawValue?.toString()??"";return!(t.includes(fd.OnlyInstrumentable)&&!o.getSymbolState(n).showCheckbox)&&yd(n,t)}}},[o,p]),g=a(()=>[{key:gd.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:m,noFilter:!m},{key:gd.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:gd.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[m]),f=a(()=>h.map(e=>{const t=o.getSymbolState(e.name),n=t.showCheckbox;return{id:e.name,cells:[{key:gd.Symbol,rawValue:e.name},{key:gd.Self,rawValue:jc(e.self)},{key:gd.Total,rawValue:jc(e.total)}],isSelected:n?o.isSelected(e.name):void 0,onSelect:n?()=>o.onToggleSymbol(e.name,!0):void 0,onDeselect:n?()=>o.onToggleSymbol(e.name,!1):void 0,hideCheckbox:!n,checkboxDisabled:n?t.checkboxDisabled:void 0,checkboxTooltip:n?t.checkboxTooltip:void 0}}),[h,o]),b=l(e=>{const t=e.cells[0].rawValue,n=o.getSymbolState(t),a=[];return n.inManagedRule?a.push({id:`remove-instrumentation-${t}`,label:"",leftIcon:li,tooltip:"Remove from the “Profiling Symbols” rule",onClick:()=>o.onRemove(t)}):a.push({id:`add-instrumentation-${t}`,label:"",leftIcon:si,tooltip:n.addTooltip,disabled:!n.addEnabled,onClick:()=>o.onAdd(t)}),a.push({id:`copy-${t}`,label:"",leftIcon:Bi,tooltip:"Copy symbol name",onClick:()=>{navigator.clipboard.writeText(t)}}),a},[o]);return t(fn,{variant:bn.Data,maxHeight:"calc(100vh - 306px)",columns:g,rows:f,withCheckboxes:o.selectionEnabled,filters:s,onFiltersChange:r,activeRowId:d,scrollSignal:u,getRowActions:b})};var Sd;!function(e){e.Table="table",e.Flame="flame",e.Both="both"}(Sd||(Sd={}));const wd=g(W)`
295
310
  width: 100%;
296
311
  flex: 1;
297
312
  border-radius: 16px;
298
313
  overflow: hidden;
299
314
  background: ${({theme:e})=>e.v2.colors.silver[800]};
300
315
  box-shadow: 0 2px 14.1px 0 rgba(0, 0, 0, 0.25);
301
- `,ud=m.div`
316
+ `,xd=g.div`
302
317
  display: flex;
303
318
  align-items: center;
304
319
  gap: 10px;
@@ -306,11 +321,11 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
306
321
  padding: 12px 12px 8px;
307
322
  background: ${({theme:e})=>e.v2.colors.silver[800]};
308
323
  border-radius: 16px 16px 0 0;
309
- `,pd=m(se)`
324
+ `,kd=g(se)`
310
325
  flex-shrink: 0;
311
326
  align-items: center;
312
327
  gap: 4px;
313
- `,hd=m.div`
328
+ `,Td=g.div`
314
329
  flex: 1;
315
330
  display: flex;
316
331
  align-items: stretch;
@@ -318,20 +333,20 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
318
333
  padding: 16px;
319
334
  background: ${({theme:e})=>e.v2.colors.silver[800]};
320
335
  border-radius: 0 0 16px 16px;
321
- `,gd=m(W)`
336
+ `,$d=g(W)`
322
337
  flex: ${({$splitWithFlame:e})=>e?"0 0 min(413px, 42%)":"1 1 auto"};
323
338
  width: ${({$splitWithFlame:e})=>e?"auto":"100%"};
324
339
  max-width: ${({$splitWithFlame:e})=>e?"none":"100%"};
325
340
  gap: 10px;
326
- `,md=m(W)`
341
+ `,Id=g(W)`
327
342
  flex: ${({$splitWithTable:e})=>e?"1":"1 1 auto"};
328
343
  width: ${({$splitWithTable:e})=>e?"auto":"100%"};
329
344
  gap: 10px;
330
- `,fd=m(se)`
345
+ `,Ed=g(se)`
331
346
  width: 100%;
332
347
  min-height: 32px;
333
348
  flex-shrink: 0;
334
- `,bd=({source:o,onFlameFullscreenChange:l})=>{const c=f(),d=o.id,{profilingApi:u}=sl(),[p,h]=s(!0),[g,m]=s(cd.Both),[b,v]=s(""),[y,C]=s({}),[S,w]=s(!1),x=i(!1);n(()=>{x.current||(x.current=!0,u.enableProfiling?.(d),w(!0))},[u,d]);const{data:T}=u.useSlots({skip:!S,pollInterval:3e3,fetchPolicy:"network-only"}),[k,$]=s(0),{data:E,refetch:I}=u.useSourceProfiling(d,{skip:!S||!p,pollInterval:3e3,fetchPolicy:"network-only",onCompleted:()=>$(e=>e+1)}),A=E?.profileJson??null,N=a(()=>function(e){if(!e?.trim())return null;try{const t=JSON.parse(e),o=t.flamebearer;return!o?.names?.length||!Array.isArray(o.levels)||"number"!=typeof o.numTicks||o.numTicks<=0?null:{flamebearer:o,units:t.metadata?.units}}catch{return null}}(A),[A]),O=a(()=>N?function(e){const t=new Map;for(let o=0;o<e.levels.length;o++){const n=e.levels[o];for(let o=0;o+3<n.length;o+=4){const a=n[o+1],i=n[o+2],l=Uc(e,n[o+3]);if(!l)continue;const s=t.get(l);(!s||a>s.total)&&t.set(l,{self:i,total:a})}}return[...t.entries()].map(([e,t])=>({name:e,self:t.self,total:t.total})).sort((e,t)=>t.self-e.self)}(N.flamebearer):[],[N]),R=a(()=>{const e=b.trim().toLowerCase();return e?O.filter(t=>t.name.toLowerCase().includes(e)):O},[O,b]),D=g===cd.Table||g===cd.Both,P=g===cd.Flame||g===cd.Both,F=D&&P,L=o.runtimeInfo?.detectedLanguages||o.containers?.map(e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??""),_=a(()=>function(e,t){if(!t?.includes(bo.Java))return;const o=e?.[nd.Symbol]?.filter(Boolean)??[];return 0!==o.length?e=>ld(e,o):void 0}(y,L),[y,L]);return!A&&k<2?t(at,{$height:"70vh",children:t(ct,{withSpinner:!0})}):e(dd,{$gap:0,$width:"100%",children:[e(ud,{children:[t(De,{text:"Live CPU profile collected from the workload agent. Search symbols, switch between the table and flame graph, or download a JSON snapshot.",withIcon:!0,children:t(pd,{children:t(ae,{size:le.S,weight:500,color:ie.Primary,nowrap:!0,children:"CPU Profiling"})})}),e(se,{style:{flex:1,minWidth:200,gap:10,alignItems:"center",flexWrap:"wrap"},children:[t("div",{style:{flex:"1 1 220px",minWidth:180},children:t(Zt,{value:b,onChange:v,placeholder:"Search by symbol name",width:"100%",idleBackgroundColor:c.v2.colors.silver[900],emphasizeBackgroundColor:c.v2.colors.silver[800]})}),t(ue,{variant:fo.Filled,options:[{value:cd.Table,label:"Top table"},{value:cd.Flame,label:"Flame graph"},{value:cd.Both,label:"Both"}],selected:g,setSelected:m}),t(re,p?{variant:de.Secondary,size:ce.S,label:"Live",tooltip:"Odigos profiler works in-memory and doesn't store any data on disk, to keep minimum memory footprint we store only last 10 minutes of data on demand",leftIcon:e=>t(Ui,{...e,size:8,fill:c.v2.colors.green[500]})}:{variant:de.Secondary,size:ce.S,label:"Paused",tooltip:"Odigos profiler is still collecting data, but the UI is not updating in real time",leftIcon:e=>t(Ui,{...e,size:8,fill:c.v2.colors.red[500]})})]})]}),t(hd,{$gap:D&&P?16:0,children:N?e(r,{children:[D&&e(gd,{$splitWithFlame:F,children:[t(fd,{$justifyContent:"flex-end",children:t(re,{variant:de.Secondary,size:ce.S,label:"Download snapshot",rightIcon:Hi,onClick:()=>{if(!A)return;const e=new Blob([A],{type:"application/json"}),t=URL.createObjectURL(e),n=document.createElement("a");n.href=t,n.download=`cpu-profile-${o.id.namespace}-${o.id.kind}-${o.id.name}.json`,n.click(),URL.revokeObjectURL(t)},disabled:!A})}),t(rd,{rows:R,languages:L,filters:y,onFiltersChange:C})]}),P&&e(md,{$splitWithTable:F,children:[e(fd,{$justifyContent:"space-between",children:[t(Be,{label:N?`Total in view ${Hc(N.flamebearer.numTicks)}`:"No profile sample yet",backgroundColor:c.v2.colors.silver[750],textColor:c.v2.colors.silver[200],textSize:le.XXS}),e(se,{$gap:12,children:[!p&&t(re,{variant:de.Secondary,size:ce.S,label:"Refresh",leftIcon:Ri,onClick:I}),t(Q,{label:"Auto refresh",labelAlign:ee.Left,size:vt.S,value:p,onChange:h})]})]}),t(od,{flamebearer:N.flamebearer,maxRowPx:24,searchQuery:b,shouldKeepName:_,minHostHeight:280,onFullscreenChange:l,profilingSlots:T??null},g)]})]}):t(at,{children:t(Ce,{title:"No profile samples yet",subTitle:"Dynamically collecting profiling samples — keep this tab open while the agent sends OTLP profiles."})})})]})},vd=m.div`
349
+ `,Ad=({source:n,onFlameFullscreenChange:c})=>{const d=f(),u=n.id,{profilingApi:p}=ll(),[h,m]=s(!0),[g,b]=s(Sd.Both),[v,y]=s(""),[C,S]=s({}),[w,x]=s(!1),k=i(!1);o(()=>{k.current||(k.current=!0,p.enableProfiling?.(u),x(!0))},[p,u]);const{data:T}=p.useSlots({skip:!w,pollInterval:3e3,fetchPolicy:"network-only"}),{data:$,loading:I,refetch:E}=p.useSourceProfiling(u,{skip:!w,pollInterval:h?3e3:0,fetchPolicy:"network-only"}),A=$?.profileJson??null,N=a(()=>function(e){if(!e?.trim())return null;try{const t=JSON.parse(e),n=t.flamebearer;return!n?.names?.length||!Array.isArray(n.levels)||"number"!=typeof n.numTicks||n.numTicks<=0?null:{flamebearer:n,units:t.metadata?.units}}catch{return null}}(A),[A]),O=a(()=>N?function(e){const t=new Map;for(let n=0;n<e.levels.length;n++){const o=e.levels[n];for(let n=0;n+3<o.length;n+=4){const a=o[n+1],i=o[n+2],l=Hc(e,o[n+3]);if(!l)continue;const s=t.get(l);(!s||a>s.total)&&t.set(l,{self:i,total:a})}}return[...t.entries()].map(([e,t])=>({name:e,self:t.self,total:t.total})).sort((e,t)=>t.self-e.self)}(N.flamebearer):[],[N]),R=g===Sd.Table||g===Sd.Both,D=g===Sd.Flame||g===Sd.Both,P=R&&D,F=a(()=>n.runtimeInfo?.detectedLanguages||n.containers?.map(e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??""),[n]),L=a(()=>function(e,t){if(!t?.includes(gn.Java))return;const n=(e?.[gd.Symbol]?.filter(Boolean)??[]).filter(e=>e===bd.FilterOutVoid||e===bd.OnlyWithReturnValues);return 0!==n.length?e=>yd(e,n):void 0}(C,F),[C,F]),{instrumentation:_,pendingCount:M,pendingModify:z,closeModify:B,openBulkModify:X,resetSelection:V,confirmModify:U}=md({source:n,languages:F,rows:O}),[G,H]=s(null),[j,K]=s(0),[Y,J]=s(null),q=l(e=>{H(e),K(e=>e+1),b(e=>e===Sd.Flame?Sd.Both:e)},[]);return!A&&I?t(at,{$height:"70vh",children:t(ct,{withSpinner:!0})}):e(wd,{$gap:0,$width:"100%",children:[e(xd,{children:[t(De,{text:"Live CPU profile collected from the workload agent. Search symbols, switch between the table and flame graph, or download a JSON snapshot.",withIcon:!0,children:t(kd,{children:t(ae,{size:le.S,weight:500,color:ie.Primary,nowrap:!0,children:"CPU Profiling"})})}),e(se,{style:{flex:1,minWidth:200,gap:10,alignItems:"center",flexWrap:"wrap"},children:[t("div",{style:{flex:"1 1 220px",minWidth:180},children:t(Jt,{value:v,onChange:y,placeholder:"Search by symbol name",width:"100%",idleBackgroundColor:d.v2.colors.silver[900],emphasizeBackgroundColor:d.v2.colors.silver[800]})}),t(ue,{variant:mn.Filled,options:[{value:Sd.Table,label:"Top table"},{value:Sd.Flame,label:"Flame graph"},{value:Sd.Both,label:"Both"}],selected:g,setSelected:b}),t(re,h?{variant:de.Secondary,size:ce.S,label:"Live",tooltip:"Odigos profiler works in-memory and doesn't store any data on disk, to keep minimum memory footprint we store only last 10 minutes of data on demand",leftIcon:e=>t(Xi,{...e,size:8,fill:d.v2.colors.green[500]})}:{variant:de.Secondary,size:ce.S,label:"Paused",tooltip:"Odigos profiler is still collecting data, but the UI is not updating in real time",leftIcon:e=>t(Xi,{...e,size:8,fill:d.v2.colors.red[500]})})]})]}),t(Td,{$gap:R&&D?16:0,children:N?e(r,{children:[R&&e($d,{$splitWithFlame:P,children:[e(Ed,{$justifyContent:"space-between",children:[e(W,{$margin:"0 0 0 20px",children:[t(ae,{size:le.XXXS,nowrap:!0,children:"Please select symbols to"}),e(se,{$gap:8,children:[e(se,{children:[t(Vi,{size:24}),t(ae,{size:le.S,color:ie.Success,nowrap:!0,children:"Custom Instrument"})]}),t(re,{leftIcon:ui,variant:de.Secondary,size:ce.S,onClick:()=>window.open(`${xe}/enterprise/pipeline/rules/custominstrumentation`,"_blank","noopener noreferrer")})]})]}),e(se,{$gap:8,children:[Y&&t(De,{text:"The table is scoped to the symbols inside the flame graph’s current zoom. Use “Reset zoom” on the flame graph to show all symbols again.",children:t(Be,{label:`Zoomed: ${Y.length} symbols`,backgroundColor:d.v2.colors.silver[750],textColor:d.v2.colors.silver[200],textSize:le.XXS})}),t(re,{variant:de.Secondary,size:ce.S,label:"Download snapshot",rightIcon:Ui,onClick:()=>{if(!A)return;const e=new Blob([A],{type:"application/json"}),t=URL.createObjectURL(e),o=document.createElement("a");o.href=t,o.download=`cpu-profile-${n.id.namespace}-${n.id.kind}-${n.id.name}.json`,o.click(),URL.revokeObjectURL(t)},disabled:!A})]})]}),t(Cd,{rows:O,languages:F,instrumentation:_,searchQuery:v,filters:C,onFiltersChange:S,zoomedSymbols:Y,highlightSymbol:G,scrollSignal:j})]}),D&&e(Id,{$splitWithTable:P,children:[e(Ed,{$justifyContent:"space-between",children:[t(Be,{label:N?`Total in view ${jc(N.flamebearer.numTicks)}`:"No profile sample yet",backgroundColor:d.v2.colors.silver[750],textColor:d.v2.colors.silver[200],textSize:le.XXS}),e(se,{$gap:12,children:[!h&&t(re,{variant:de.Secondary,size:ce.S,label:"Refresh",leftIcon:Ni,onClick:E}),t(Q,{label:"Auto refresh",labelAlign:ee.Left,size:bt.S,value:h,onChange:m})]})]}),t(id,{flamebearer:N.flamebearer,maxRowPx:24,searchQuery:v,shouldKeepName:L,minHostHeight:280,onFullscreenChange:c,profilingSlots:T??null,onFrameClick:q,onZoomedSymbolsChange:J,onResetZoom:()=>H(null)},g)]})]}):t(at,{children:t(Ce,{title:"No profile samples yet",subTitle:"Dynamically collecting profiling samples — keep this tab open while the agent sends OTLP profiles."})})}),t(Gc,{pendingModify:z,onClose:B,onConfirm:U}),t(vn,{isOpen:M>0,richTitle:{icon:xi,title:"Profiling Symbols",badge:{label:M}},actions:[{id:"profiling-bulk-cancel",type:Yt.Button,buttonProps:{variant:de.Secondary,size:ce.S,label:"Cancel",onClick:V}},{id:"profiling-bulk-apply",type:Yt.Button,buttonProps:{variant:de.Primary,size:ce.S,label:"Modify Rule",leftIcon:hi,onClick:X}}]})]})},Nd=g.div`
335
350
  position: relative;
336
351
  display: flex;
337
352
  align-items: center;
@@ -339,17 +354,17 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
339
354
  padding: 8px 16px;
340
355
  border-radius: 12px;
341
356
  background-color: ${({theme:e})=>e.v2.colors.silver[700]};
342
- `,yd=m.div`
357
+ `,Od=g.div`
343
358
  display: flex;
344
359
  flex-direction: column;
345
360
  gap: 4px;
346
361
  flex: 1;
347
362
  min-width: 0;
348
- `,Cd=m.div`
363
+ `,Rd=g.div`
349
364
  min-width: 0;
350
365
  white-space: pre;
351
366
  overflow-x: auto;
352
- `,Sd=m.div`
367
+ `,Dd=g.div`
353
368
  position: absolute;
354
369
  top: 50%;
355
370
  right: 8px;
@@ -358,11 +373,11 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
358
373
  pointer-events: none;
359
374
  transition: opacity 0.15s ease;
360
375
 
361
- ${vd}:hover & {
376
+ ${Nd}:hover & {
362
377
  opacity: 1;
363
378
  pointer-events: auto;
364
379
  }
365
- `,wd=({name:o,summary:n,onJumpToRule:a})=>e(vd,{children:[e(yd,{children:[o&&t(ae,{size:le.XXXS,color:ie.Secondary,nowrap:!0,children:o}),t(Cd,{children:t(S,{parts:n})})]}),a&&t(Sd,{children:t(De,{text:He.OPEN_IN_SAMPLING_PAGE,children:t(re,{"data-id":"sampling-rule-jump",variant:de.Primary,size:ce.S,leftIcon:Xi,onClick:a})})})]}),xd=({source:e,onRedirectToSampling:o})=>t(Et,{bgTint:"1000",richTitle:{title:He.SAMPLING},children:e.containers?.map(e=>t($d,{container:e,onRedirectToSampling:o},e.containerName))});var Td;!function(e){e.All="all",e.Noisy="noisy",e.HighlyRelevant="highly-relevant",e.CostReduction="cost-reduction"}(Td||(Td={}));const kd=e=>"noisy"===e.type?w(e.rule):"highlyRelevant"===e.type?x(e.rule):"costReduction"===e.type?T(e.rule):[],$d=({container:o,onRedirectToSampling:n})=>{const[i,l]=s(Td.All),r=eo(e=>e.setPendingViewSamplingRule),c=o.agentConfig?.traces?.headSampling?.noisyOperations??[],d=a(()=>(o.collectorConfig?.tailSampling?.noisyOperations??[]).map(e=>({type:"noisy",rule:e})),[o.agentConfig?.traces?.headSampling?.noisyOperations]),u=a(()=>(o.collectorConfig?.tailSampling?.highlyRelevantOperations??[]).map(e=>({type:"highlyRelevant",rule:e})),[o.collectorConfig?.tailSampling?.highlyRelevantOperations]),p=a(()=>(o.collectorConfig?.tailSampling?.costReductionRules??[]).map(e=>({type:"costReduction",rule:e})),[o.collectorConfig?.tailSampling?.costReductionRules]),h=a(()=>i===Td.Noisy?d:i===Td.HighlyRelevant?u:i===Td.CostReduction?p:[...d,...u,...p],[i,u,p]),g=a(()=>(e,t)=>{r({ruleId:e,category:t}),n()},[n,r]);return e(Et,{bgTint:"900",richTitle:{title:o.containerName},withCollapse:!0,collapseIsDefaultOpen:!0,children:[e(Et,{bgTint:"800",richTitle:{title:He.HEAD_SAMPLING,badge:{label:c.length}},withCollapse:!0,collapseIsDefaultOpen:!!c.length,children:[t(ae,{size:le.XXS,children:He.NOISY_OPERATIONS}),t(W,{$gap:4,children:c.length?c.map(e=>t(wd,{name:e.name,summary:w(e),onJumpToRule:()=>g(e.ruleId,"noisy")},e.ruleId)):t(Ce,{title:"No noisy operations"})})]}),e(Et,{bgTint:"800",richTitle:{title:He.TAIL_SAMPLING,badge:{label:d.length+u.length+p.length}},withCollapse:!0,collapseIsDefaultOpen:!!h.length,children:[t(ue,{options:(m=d.length,f=u.length,b=p.length,[{value:Td.All,label:"All",badge:{label:m+f+b,textSize:le.XXXS}},{value:Td.Noisy,label:He.NOISY_OPERATIONS,badge:{label:m,textSize:le.XXXS}},{value:Td.HighlyRelevant,label:He.HIGHLY_RELEVANT_OPERATIONS,badge:{label:f,textSize:le.XXXS}},{value:Td.CostReduction,label:He.COST_REDUCTION_OPERATIONS,badge:{label:b,textSize:le.XXXS}}]),selected:i,setSelected:l}),t(W,{$gap:4,children:h.length?h.map(e=>t(wd,{name:e.rule.name,summary:kd(e),onJumpToRule:()=>g(e.rule.ruleId,e.type)},e.rule.ruleId)):t(Ce,{title:`No ${i===Td.All?`${Td.Noisy}, ${Td.HighlyRelevant} and ${Td.CostReduction}`:i} operations`})})]})]});var m,f,b},Ed=[io.Deployment,io.StatefulSet,io.DaemonSet,io.DeploymentConfig,io.Rollout,io.Pod];var Id;!function(e){e.Workload="Workload",e.Pod="Pod"}(Id||(Id={}));const Ad=e=>!!e&&Gt(e.status)===Ee.Error,Nd=e=>Ad(e.healthStatus),Od=e=>Ad(e.odigosHealthStatus)||(e.processes??[]).some(Nd),Rd=e=>Ad(e.agentInjectedStatus)||Ad(e.odigosHealthStatus)||(e.containers??[]).some(Od),Dd=({onClose:o,sourceId:r,onRedirectToSampling:c})=>{const d=f(),{isVm:u}=y(),{sourcesApi:p,configApi:h}=sl(),{selectedStreamName:g}=Ge(),{genericForm:m,loadSource:b,validateFormData:v}=Dl(),{data:C}=h.useEffectiveConfig(),[S,w]=s(!1),[x,T]=s(!1),[k,$]=s(!1),[E,I]=s(Gr.Overview),[A,N]=s(null),[O,R]=s({openFor:null}),D=(()=>{const[e,t]=s(null),o=l(e=>{t({tab:Gr.Pods,podName:e.podName})},[]),n=l((e,o)=>{t({tab:Gr.Pods,podName:e.podName,containerName:o.containerName})},[]),i=l((e,o,n)=>{const a=qr({identifyingAttributes:n.identifyingAttributes});t({tab:Gr.Pods,podName:e.podName,containerName:o.containerName,processPid:a})},[]),r=l(()=>t(null),[]);return a(()=>({jumpToTarget:e,jumpToPod:o,jumpToContainer:n,jumpToProcess:i,clearJumpToTarget:r}),[e,o,n,i,r])})();n(()=>{D.jumpToTarget&&I(D.jumpToTarget.tab)},[D.jumpToTarget]),n(()=>{A&&JSON.stringify(to(r))!==JSON.stringify(to(A))&&N(null)},[r,A]);const P=i(!1),F=l(async()=>N(await p.fetchById(r)||null),[r,p]);n(()=>{if(P.current||(F(),P.current=!0),!S){const e=setInterval(()=>F(),3e3);return()=>clearInterval(e)}},[F,S]),n(()=>{A&&b(A)},[A]);const L=A&&Ed.includes(A.id.kind),_=a(()=>{const e=[],o=(A?.pods??[]).some(Rd);return e.push({value:Gr.Overview,label:He.OVERVIEW}),u||(e.push({value:Gr.Pods,label:He.PODS,icon:o?e=>t(Di,{...e,fill:d.v2.colors.red[500]}):void 0}),e.push({value:Gr.PeerSources,label:He.PEER_SOURCES}),C?.profiling?.enabled&&e.push({value:Gr.Profiling,label:He.PROFILING}),e.push({value:Gr.Sampling,label:He.SAMPLING}),e.push({value:Gr.Debug,label:He.DEBUG})),e},[u,C,A?.pods]),z=l(()=>w(!0),[]),M=a(()=>()=>{o(),c()},[o,c]),B=l(()=>{A&&b(A),w(!1)},[A]),X=l(async()=>{if(!A||!m)return;const{errorMessage:e,preparedFormData:t}=v();if(e)return;const o=t.otelServiceName!==A.id.name?t.otelServiceName:"";await p.update(r,{...t,otelServiceName:o}),w(!1)},[A,m,v,r,p]),V=l(()=>T(!0),[]),U=l(async()=>{A&&(await p.persistV2({[wt]:[{namespace:A.id.namespace,name:A.id.name,kind:A.id.kind,selected:!1,currentStreamName:g}]}),T(!1),o())},[A,p,g,o]),H=l(()=>{R({openFor:Id.Workload})},[]),G=l(e=>{I(e),D.clearJumpToTarget()},[D]),j=l(async()=>{await p.recoverFromRollback(r)},[p,r]),K=l(()=>R({openFor:null}),[]),Y=l(async()=>{O.openFor===Id.Workload?await p.restartWorkloads([r]):O.openFor===Id.Pod&&O.podNamespace&&O.podName&&await p.restartPod(O.podNamespace,O.podName),K()},[O,p,r,K]),J=a(()=>{const{kind:e,name:t}=r;return{title:`Rollout ${e}`,description:`Are you sure you want to rollout the ${e.toLowerCase()} "${t}"?`}},[r]),q=a(()=>{const e=[];return S||E===Gr.Overview&&(e.push({id:"edit-source-btn-edit",label:kt.EDIT,icon:mi,active:S,onClick:z}),!u&&L&&e.push({id:"edit-source-btn-restart",label:He.ROLLOUT,icon:Gi,onClick:H}),e.push({id:"edit-source-btn-delete",label:kt.UNINSTRUMENT,icon:ri,color:d.v2.colors.red[500],active:x,onClick:V})),e},[E,S,x,u,L,z,H,V,d]),Z=a(()=>{if(!A)return[];const e=[],t={backgroundColor:"transparent",textSize:le.S};return e.push({...t,label:A.id.name,leftIcon:u?void 0:Oi}),A.serviceName&&A.serviceName!==A.id.name&&e.push({...t,label:A.serviceName,leftIcon:Ni,textColor:d.v2.colors.silver[200]}),e},[A,d,u]);if(!A)return t(oe,{isOpen:!0,children:t(at,{$height:"80vh",children:t(ct,{withSpinner:!0})})});const Q=E===Gr.Profiling?k?"95vw":"80vw":S?void 0:"60vw";return e(lc,{value:D,children:[t(oe,{isOpen:!0,width:Q,minWidth:"777px",header:{icon:u?ji:Co(A.containers)[0],titleBadges:Z,onClose:()=>{G(Gr.Overview),N(null),$(!1),o()},actions:q},footer:{actions:S?[{"data-id":"edit-source-btn-cancel",label:kt.CANCEL,variant:de.Secondary,onClick:B},{"data-id":"edit-source-btn-save",label:kt.SAVE,variant:de.Primary,onClick:X}]:[]},children:t($t,{$padding:"4px 12px 12px",children:e(W,{$gap:16,children:[!S&&_.length>1&&t(ue,{options:_,selected:E,setSelected:G}),(()=>{switch(E){case Gr.Overview:return S?t(Ws,{}):t(Vc,{source:A,onClickRollout:H,onClickRollback:j});case Gr.Pods:return t(uc,{source:A,onClickRestartPod:L?(e,t)=>R({openFor:Id.Pod,podNamespace:e,podName:t}):void 0});case Gr.PeerSources:return t(pc,{source:A});case Gr.Profiling:return t(bd,{source:A,onFlameFullscreenChange:$});case Gr.Sampling:return t(xd,{source:A,onRedirectToSampling:M});case Gr.Debug:return t(bc,{source:A});default:return null}})()]})})}),t(wl,{target:"source",action:"uninstrument",isOpen:x,onClose:()=>T(!1),onApprove:U}),t(Ue,{isOpen:O.openFor===Id.Workload,title:J.title,description:J.description,onClose:K,denyButton:{label:"Go back",variant:de.Secondary,onClick:K},approveButton:{label:kt.CONFIRM,variant:de.Primary,onClick:Y}}),t(wl,{target:"pod",action:"restart",description:He.ROLLOUT_RESTART_WORKLOADS_DESCRIPTION,isOpen:O.openFor===Id.Pod,onClose:K,onApprove:Y,overrideApproveButtonLabel:He.DELETE_POD_TO_RESTART})]})},Pd=m.div`
380
+ `,Pd=({name:n,summary:o,onJumpToRule:a})=>e(Nd,{children:[e(Od,{children:[n&&t(ae,{size:le.XXXS,color:ie.Secondary,nowrap:!0,children:n}),t(Rd,{children:t(S,{parts:o})})]}),a&&t(Dd,{children:t(De,{text:Ge.OPEN_IN_SAMPLING_PAGE,children:t(re,{"data-id":"sampling-rule-jump",variant:de.Primary,size:ce.S,leftIcon:zi,onClick:a})})})]}),Fd=({source:e,onRedirectToSampling:n})=>t($t,{bgTint:"1000",richTitle:{title:Ge.SAMPLING},children:e.containers?.map(e=>t(Md,{container:e,onRedirectToSampling:n},e.containerName))});var Ld;!function(e){e.All="all",e.Noisy="noisy",e.HighlyRelevant="highly-relevant",e.CostReduction="cost-reduction"}(Ld||(Ld={}));const _d=e=>"noisy"===e.type?w(e.rule):"highlyRelevant"===e.type?x(e.rule):"costReduction"===e.type?k(e.rule):[],Md=({container:n,onRedirectToSampling:o})=>{const[i,l]=s(Ld.All),r=Zt(e=>e.setPendingViewSamplingRule),c=n.agentConfig?.traces?.headSampling?.noisyOperations??[],d=a(()=>(n.collectorConfig?.tailSampling?.noisyOperations??[]).map(e=>({type:"noisy",rule:e})),[n.agentConfig?.traces?.headSampling?.noisyOperations]),u=a(()=>(n.collectorConfig?.tailSampling?.highlyRelevantOperations??[]).map(e=>({type:"highlyRelevant",rule:e})),[n.collectorConfig?.tailSampling?.highlyRelevantOperations]),p=a(()=>(n.collectorConfig?.tailSampling?.costReductionRules??[]).map(e=>({type:"costReduction",rule:e})),[n.collectorConfig?.tailSampling?.costReductionRules]),h=a(()=>i===Ld.Noisy?d:i===Ld.HighlyRelevant?u:i===Ld.CostReduction?p:[...d,...u,...p],[i,u,p]),m=a(()=>(e,t)=>{r({ruleId:e,category:t}),o()},[o,r]);return e($t,{bgTint:"900",richTitle:{title:n.containerName},withCollapse:!0,collapseIsDefaultOpen:!0,children:[e($t,{bgTint:"800",richTitle:{title:Ge.HEAD_SAMPLING,badge:{label:c.length}},withCollapse:!0,collapseIsDefaultOpen:!!c.length,children:[t(ae,{size:le.XXS,children:Ge.NOISY_OPERATIONS}),t(W,{$gap:4,children:c.length?c.map(e=>t(Pd,{name:e.name,summary:w(e),onJumpToRule:()=>m(e.ruleId,"noisy")},e.ruleId)):t(Ce,{title:"No noisy operations"})})]}),e($t,{bgTint:"800",richTitle:{title:Ge.TAIL_SAMPLING,badge:{label:d.length+u.length+p.length}},withCollapse:!0,collapseIsDefaultOpen:!!h.length,children:[t(ue,{options:(g=d.length,f=u.length,b=p.length,[{value:Ld.All,label:"All",badge:{label:g+f+b,textSize:le.XXXS}},{value:Ld.Noisy,label:Ge.NOISY_OPERATIONS,badge:{label:g,textSize:le.XXXS}},{value:Ld.HighlyRelevant,label:Ge.HIGHLY_RELEVANT_OPERATIONS,badge:{label:f,textSize:le.XXXS}},{value:Ld.CostReduction,label:Ge.COST_REDUCTION_OPERATIONS,badge:{label:b,textSize:le.XXXS}}]),selected:i,setSelected:l}),t(W,{$gap:4,children:h.length?h.map(e=>t(Pd,{name:e.rule.name,summary:_d(e),onJumpToRule:()=>m(e.rule.ruleId,e.type)},e.rule.ruleId)):t(Ce,{title:`No ${i===Ld.All?`${Ld.Noisy}, ${Ld.HighlyRelevant} and ${Ld.CostReduction}`:i} operations`})})]})]});var g,f,b},zd=[on.Deployment,on.StatefulSet,on.DaemonSet,on.DeploymentConfig,on.Rollout,on.Pod];var Bd;!function(e){e.Workload="Workload",e.Pod="Pod"}(Bd||(Bd={}));const Xd=e=>!!e&&Gt(e.status)===Ie.Error,Vd=e=>Xd(e.healthStatus),Ud=e=>Xd(e.odigosHealthStatus)||(e.processes??[]).some(Vd),Gd=e=>Xd(e.agentInjectedStatus)||Xd(e.odigosHealthStatus)||(e.containers??[]).some(Ud),Hd=({onClose:n,sourceId:r,onRedirectToSampling:c})=>{const d=f(),{isVm:u}=y(),{sourcesApi:p,configApi:h}=ll(),{selectedStreamName:m}=He(),{genericForm:g,loadSource:b,validateFormData:v}=Rl(),{data:C}=h.useEffectiveConfig(),[S,w]=s(!1),[x,k]=s(!1),[T,$]=s(!1),[I,E]=s(Gr.Overview),[A,N]=s(null),[O,R]=s({openFor:null}),D=(()=>{const[e,t]=s(null),n=l(e=>{t({tab:Gr.Pods,podName:e.podName})},[]),o=l((e,n)=>{t({tab:Gr.Pods,podName:e.podName,containerName:n.containerName})},[]),i=l((e,n,o)=>{const a=Jr({identifyingAttributes:o.identifyingAttributes});t({tab:Gr.Pods,podName:e.podName,containerName:n.containerName,processPid:a})},[]),r=l(()=>t(null),[]);return a(()=>({jumpToTarget:e,jumpToPod:n,jumpToContainer:o,jumpToProcess:i,clearJumpToTarget:r}),[e,n,o,i,r])})();o(()=>{D.jumpToTarget&&E(D.jumpToTarget.tab)},[D.jumpToTarget]),o(()=>{A&&JSON.stringify(Qt(r))!==JSON.stringify(Qt(A))&&N(null)},[r,A]);const P=i(!1),F=l(async()=>N(await p.fetchById(r)||null),[r,p]);o(()=>{if(P.current||(F(),P.current=!0),!S){const e=setInterval(()=>F(),3e3);return()=>clearInterval(e)}},[F,S]),o(()=>{A&&b(A)},[A]);const L=A&&zd.includes(A.id.kind),_=a(()=>{const e=[],n=(A?.pods??[]).some(Gd);return e.push({value:Gr.Overview,label:Ge.OVERVIEW}),u||(e.push({value:Gr.Pods,label:Ge.PODS,icon:n?e=>t(Oi,{...e,fill:d.v2.colors.red[500]}):void 0}),e.push({value:Gr.PeerSources,label:Ge.PEER_SOURCES}),C?.profiling?.enabled&&e.push({value:Gr.Profiling,label:Ge.PROFILING}),e.push({value:Gr.Sampling,label:Ge.SAMPLING}),e.push({value:Gr.Debug,label:Ge.DEBUG})),e},[u,C,A?.pods]),M=l(()=>w(!0),[]),z=a(()=>()=>{n(),c()},[n,c]),B=l(()=>{A&&b(A),w(!1)},[A]),X=l(async()=>{if(!A||!g)return;const{errorMessage:e,preparedFormData:t}=v();if(e)return;const n=t.otelServiceName!==A.id.name?t.otelServiceName:"";await p.update(r,{...t,otelServiceName:n}),w(!1)},[A,g,v,r,p]),V=l(()=>k(!0),[]),U=l(async()=>{A&&(await p.persistV2({[St]:[{namespace:A.id.namespace,name:A.id.name,kind:A.id.kind,selected:!1,currentStreamName:m}]}),k(!1),n())},[A,p,m,n]),G=l(()=>{R({openFor:Bd.Workload})},[]),H=l(e=>{E(e),D.clearJumpToTarget()},[D]),j=l(async()=>{await p.recoverFromRollback(r)},[p,r]),K=l(()=>R({openFor:null}),[]),Y=l(async()=>{O.openFor===Bd.Workload?await p.restartWorkloads([r]):O.openFor===Bd.Pod&&O.podNamespace&&O.podName&&await p.restartPod(O.podNamespace,O.podName),K()},[O,p,r,K]),J=a(()=>{const{kind:e,name:t}=r;return{title:`Rollout ${e}`,description:`Are you sure you want to rollout the ${e.toLowerCase()} "${t}"?`}},[r]),q=a(()=>{const e=[];return S||I===Gr.Overview&&(e.push({id:"edit-source-btn-edit",label:kt.EDIT,icon:hi,active:S,onClick:M}),!u&&L&&e.push({id:"edit-source-btn-restart",label:Ge.ROLLOUT,icon:Gi,onClick:G}),e.push({id:"edit-source-btn-delete",label:kt.UNINSTRUMENT,icon:li,color:d.v2.colors.red[500],active:x,onClick:V})),e},[I,S,x,u,L,M,G,V,d]),Z=a(()=>{if(!A)return[];const e=[],t={backgroundColor:"transparent",textSize:le.S};return e.push({...t,label:A.id.name,leftIcon:u?void 0:Ai}),A.serviceName&&A.serviceName!==A.id.name&&e.push({...t,label:A.serviceName,leftIcon:Ei,textColor:d.v2.colors.silver[200]}),e},[A,d,u]);if(!A)return t(ne,{isOpen:!0,children:t(at,{$height:"80vh",children:t(ct,{withSpinner:!0})})});const Q=I===Gr.Profiling?T?"95vw":"fit-content":S?void 0:"60vw";return e(ic,{value:D,children:[t(ne,{isOpen:!0,width:Q,minWidth:"777px",header:{icon:u?Hi:yn(A.containers)[0],titleBadges:Z,onClose:()=>{H(Gr.Overview),N(null),$(!1),n()},actions:q},footer:{actions:S?[{"data-id":"edit-source-btn-cancel",label:kt.CANCEL,variant:de.Secondary,onClick:B},{"data-id":"edit-source-btn-save",label:kt.SAVE,variant:de.Primary,onClick:X}]:[]},children:t(Tt,{$padding:"4px 12px 12px",children:e(W,{$gap:16,children:[!S&&_.length>1&&t(ue,{options:_,selected:I,setSelected:H}),(()=>{switch(I){case Gr.Overview:return S?t(js,{}):t(Xc,{source:A,onClickRollout:G,onClickRollback:j});case Gr.Pods:return t(dc,{source:A,onClickRestartPod:L?(e,t)=>R({openFor:Bd.Pod,podNamespace:e,podName:t}):void 0});case Gr.PeerSources:return t(uc,{source:A});case Gr.Profiling:return t(Ad,{source:A,onFlameFullscreenChange:$});case Gr.Sampling:return t(Fd,{source:A,onRedirectToSampling:z});case Gr.Debug:return t(fc,{source:A});default:return null}})()]})})}),t(Sl,{target:"source",action:"uninstrument",isOpen:x,onClose:()=>k(!1),onApprove:U}),t(Ue,{isOpen:O.openFor===Bd.Workload,title:J.title,description:J.description,onClose:K,denyButton:{label:"Go back",variant:de.Secondary,onClick:K},approveButton:{label:kt.CONFIRM,variant:de.Primary,onClick:Y}}),t(Sl,{target:"pod",action:"restart",description:Ge.ROLLOUT_RESTART_WORKLOADS_DESCRIPTION,isOpen:O.openFor===Bd.Pod,onClose:K,onApprove:Y,overrideApproveButtonLabel:Ge.DELETE_POD_TO_RESTART})]})},jd=g.div`
366
381
  display: flex;
367
382
  align-items: center;
368
383
  gap: 8px;
@@ -372,9 +387,9 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
372
387
  &:hover {
373
388
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
374
389
  }
375
- `,Fd=m.div`
390
+ `,Wd=g.div`
376
391
  flex: 1;
377
- `,Ld=({onClick:o})=>{const n=f().v2.colors.red[500];return e(Pd,{"data-id":"sampling-view-btn-delete",onClick:o,children:[t(ae,{size:le.XS,weight:500,color:n,children:To}),t(ri,{size:16,fill:n})]})};function _d(n){if(n.isEditing){const{onCancelEdit:a,onSave:i,onDelete:l,duplicateWarning:s}=n;return{children:e(o,{children:[t(Ld,{onClick:l}),s&&t($e,{status:Ee.Warning,message:s.message,action:s.onViewRule?{"data-id":"sampling-view-edit-btn-view-duplicate",label:"View rule",onClick:s.onViewRule}:void 0}),t(Fd,{}),t(re,{"data-id":"sampling-view-edit-btn-cancel",label:So,variant:de.Secondary,size:ce.S,onClick:a}),t(re,{"data-id":"sampling-view-edit-btn-save",label:wo,variant:de.Primary,size:ce.S,onClick:i,disabled:!!s})]})}}const{onDelete:a,onCancel:i,onEdit:l}=n;return{children:e(o,{children:[t(Ld,{onClick:a}),t(Fd,{}),t(re,{"data-id":"sampling-view-btn-cancel",label:So,variant:de.Secondary,size:ce.S,onClick:i}),t(re,{"data-id":"sampling-view-btn-edit",label:xo,variant:de.Primary,size:ce.S,onClick:l})]})}}const zd={[Fl.EditAutoNoisy]:{title:Fo,subTitle:Po,cancelId:"sampling-edit-auto-rule-btn-cancel",saveId:"sampling-edit-auto-rule-btn-save"},[Fl.EditAutoCostReduction]:{title:Do,subTitle:Ro,cancelId:"sampling-edit-cost-reduction-auto-rule-btn-cancel",saveId:"sampling-edit-cost-reduction-auto-rule-btn-save"},[Fl.EditAutoHighlyRelevant]:{title:Oo,subTitle:No,cancelId:"sampling-edit-highly-relevant-auto-rule-btn-cancel",saveId:"sampling-edit-highly-relevant-auto-rule-btn-save"}},Md=({isOpen:e,title:o,subTitle:n,onClose:a,footer:i,renderBody:l})=>t(oe,{isOpen:e,width:_o,header:{icon:Wi,title:o,subTitle:n,onClose:a},footer:i,children:l?l():t($t,{$padding:"12px",children:t(Qs,{})})}),Bd=({isOpen:e,onClose:o,onSubmit:a,validateForm:i,onNavigateToDuplicate:s})=>{const{category:r,formData:c,resetForm:d,duplicateWarning:u,setDuplicateWarning:p}=Pl(Fl.Create);n(()=>{e&&d()},[e]);const h=l(()=>{if(i){const e=i(c);if(e)return void p(e)}a(c)},[c,a,i,p]),g={note:u?{status:Ee.Warning,message:u.message,action:s?{"data-id":"sampling-create-btn-view-duplicate",label:"View rule",onClick:()=>s(u.ruleId)}:void 0}:void 0,actions:[{"data-id":"sampling-create-btn-cancel",label:So,variant:de.Secondary,size:ce.S,onClick:o},{"data-id":"sampling-create-btn-submit",label:Io,variant:de.Primary,size:ce.S,onClick:h,disabled:!!u}]};return t(Md,{isOpen:e,title:Ao[r],subTitle:ko[r],onClose:o,footer:g})},Xd=({onClose:e,onDelete:o,onSaveEdit:n,validateForm:i,onNavigateToDuplicate:s})=>{const{data:r,isEditing:c,formData:d,handleEdit:u,handleCancelEdit:p,duplicateWarning:h,setDuplicateWarning:g}=Pl(Fl.View),m=r?.rule.name||Eo,f=c&&r?$o[r.category]:`${m} preview`,b=l(()=>{if(r&&c){if(i){const e=i(d);if(e)return void g(e)}n(d,r.rule.ruleId,r.samplingId)}},[r,c,d,n,i,g]),v=l(()=>{r&&o(r.rule.ruleId,r.samplingId)},[r,o]),y=a(()=>{if(!r)return;const t=h?{message:h.message,onViewRule:s?()=>s(h.ruleId):void 0}:null;return _d(c?{isEditing:!0,onCancelEdit:p,onSave:b,onDelete:v,duplicateWarning:t}:{isEditing:!1,onDelete:v,onCancel:e,onEdit:u})},[r,c,h,p,b,v,u,e,s]);return t(Md,{isOpen:!!r,title:f,subTitle:r?ko[r.category]:"",onClose:e,footer:y})},Vd=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:a,resolvedPercentage:i}=Pl(Fl.EditAutoNoisy),s=l(()=>n(a,i),[n,a,i]);return t(Gd,{formType:Fl.EditAutoNoisy,isOpen:e,onClose:o,onSave:s})},Ud=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:a,resolvedPercentage:i}=Pl(Fl.EditAutoCostReduction),s=l(()=>n(a,i),[n,a,i]);return t(Gd,{formType:Fl.EditAutoCostReduction,isOpen:e,onClose:o,onSave:s})},Hd=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:a}=Pl(Fl.EditAutoHighlyRelevant),i=l(()=>n(a),[n,a]);return t(Gd,{formType:Fl.EditAutoHighlyRelevant,isOpen:e,onClose:o,onSave:i})},Gd=({formType:e,isOpen:o,onClose:n,onSave:a})=>{const i=zd[e];return t(Md,{isOpen:o,title:i.title,subTitle:i.subTitle,onClose:n,footer:{actions:[{"data-id":i.cancelId,label:So,variant:de.Secondary,size:ce.S,onClick:n},{"data-id":i.saveId,label:Lo,variant:de.Primary,size:ce.S,onClick:a}]}})},jd=e=>{switch(e.formType){case Fl.Create:return t(Xl,{formType:Fl.Create,category:e.category,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(Bd,{...e})});case Fl.View:return t(Xl,{formType:Fl.View,data:e.data,defaultEditMode:e.defaultEditMode,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(Xd,{...e})});case Fl.EditAutoNoisy:return t(Xl,{formType:Fl.EditAutoNoisy,enabled:e.enabled,keepPercentage:e.keepPercentage,children:t(Vd,{...e})});case Fl.EditAutoCostReduction:return t(Xl,{formType:Fl.EditAutoCostReduction,enabled:e.enabled,dropPercentage:e.dropPercentage,children:t(Ud,{...e})});case Fl.EditAutoHighlyRelevant:return t(Xl,{formType:Fl.EditAutoHighlyRelevant,enabled:e.enabled,children:t(Hd,{...e})})}},Wd=({token:n,isLoading:a,isEditing:i,onEdit:l,onCancel:s,onSave:r,formData:c,handleFormChange:d,handleErrorChange:u,formErrors:p})=>{const{CopyButton:h}=ro(),g=!i||a||!c.newToken;return zo({key:"Enter",active:!g},r),e(se,i?{$justifyContent:"space-between",$alignItems:"flex-start",$gap:12,children:[t(be,{type:"password",value:c.newToken,onChange:e=>{d("newToken",e.target.value),u("newToken",void 0)},width:"430px",autoFocus:!0,errorMessage:p.newToken}),t(se,{$margin:a?"8px 0 0 0":"2px 0 0 0",$alignItems:"center",children:a?t(ct,{title:"Saving...",withGradient:!0}):e(o,{children:[t(re,{variant:de.Secondary,size:ce.S,leftIcon:Ti,onClick:s,disabled:a}),t(re,{variant:de.Primary,size:ce.S,leftIcon:xi,onClick:r,disabled:g})]})})]}:{$justifyContent:"space-between",$gap:12,children:[t(ae,{size:le.XS,children:new Array(55).fill("•").join("")}),e(se,{$alignItems:"center",$justifyContent:"space-between",children:[t(h,{value:n}),t(st,{icon:mi,onClick:l})]})]})},Kd=({expiresAt:e,callbackValid:o,callbackExpired:i})=>{const{formatTimeAgo:l}=Bt(),s=a(()=>l(e),[e,l]),r=a(()=>new Date(e).toDateString().split(" ").slice(1).join(" "),[e]),c=a(()=>Mo(e,0)?Ee.Error:Mo(e,2592e6)?Ee.Warning:Ee.Success,[e]),d=a(()=>c===Ee.Success?xi:c===Ee.Warning?Ki:Di,[c]);return n(()=>{c===Ee.Success?o():c===Ee.Error&&i()},[c]),t(De,{text:r,children:t(Be,{leftIcon:d,label:s,status:c,invertColors:!0,useSecondaryTone:!0})})},Yd=m.div`
392
+ `,Kd=({onClick:n})=>{const o=f().v2.colors.red[500];return e(jd,{"data-id":"sampling-view-btn-delete",onClick:n,children:[t(ae,{size:le.XS,weight:500,color:o,children:xn}),t(li,{size:16,fill:o})]})};function Yd(o){if(o.isEditing){const{onCancelEdit:a,onSave:i,onDelete:l,duplicateWarning:s}=o;return{children:e(n,{children:[t(Kd,{onClick:l}),s&&t($e,{status:Ie.Warning,message:s.message,action:s.onViewRule?{"data-id":"sampling-view-edit-btn-view-duplicate",label:"View rule",onClick:s.onViewRule}:void 0}),t(Wd,{}),t(re,{"data-id":"sampling-view-edit-btn-cancel",label:Cn,variant:de.Secondary,size:ce.S,onClick:a}),t(re,{"data-id":"sampling-view-edit-btn-save",label:Sn,variant:de.Primary,size:ce.S,onClick:i,disabled:!!s})]})}}const{onDelete:a,onCancel:i,onEdit:l}=o;return{children:e(n,{children:[t(Kd,{onClick:a}),t(Wd,{}),t(re,{"data-id":"sampling-view-btn-cancel",label:Cn,variant:de.Secondary,size:ce.S,onClick:i}),t(re,{"data-id":"sampling-view-btn-edit",label:wn,variant:de.Primary,size:ce.S,onClick:l})]})}}const Jd={[Pl.EditAutoNoisy]:{title:Pn,subTitle:Dn,cancelId:"sampling-edit-auto-rule-btn-cancel",saveId:"sampling-edit-auto-rule-btn-save"},[Pl.EditAutoCostReduction]:{title:Rn,subTitle:On,cancelId:"sampling-edit-cost-reduction-auto-rule-btn-cancel",saveId:"sampling-edit-cost-reduction-auto-rule-btn-save"},[Pl.EditAutoHighlyRelevant]:{title:Nn,subTitle:An,cancelId:"sampling-edit-highly-relevant-auto-rule-btn-cancel",saveId:"sampling-edit-highly-relevant-auto-rule-btn-save"}},qd=({isOpen:e,title:n,subTitle:o,onClose:a,footer:i,renderBody:l})=>t(ne,{isOpen:e,width:Ln,header:{icon:ji,title:n,subTitle:o,onClose:a},footer:i,children:l?l():t(Tt,{$padding:"12px",children:t(Zs,{})})}),Zd=({isOpen:e,onClose:n,onSubmit:a,validateForm:i,onNavigateToDuplicate:s})=>{const{category:r,formData:c,resetForm:d,duplicateWarning:u,setDuplicateWarning:p}=Dl(Pl.Create);o(()=>{e&&d()},[e]);const h=l(()=>{if(i){const e=i(c);if(e)return void p(e)}a(c)},[c,a,i,p]),m={note:u?{status:Ie.Warning,message:u.message,action:s?{"data-id":"sampling-create-btn-view-duplicate",label:"View rule",onClick:()=>s(u.ruleId)}:void 0}:void 0,actions:[{"data-id":"sampling-create-btn-cancel",label:Cn,variant:de.Secondary,size:ce.S,onClick:n},{"data-id":"sampling-create-btn-submit",label:In,variant:de.Primary,size:ce.S,onClick:h,disabled:!!u}]};return t(qd,{isOpen:e,title:En[r],subTitle:kn[r],onClose:n,footer:m})},Qd=({onClose:e,onDelete:n,onSaveEdit:o,validateForm:i,onNavigateToDuplicate:s})=>{const{data:r,isEditing:c,formData:d,handleEdit:u,handleCancelEdit:p,duplicateWarning:h,setDuplicateWarning:m}=Dl(Pl.View),g=r?.rule.name||$n,f=c&&r?Tn[r.category]:`${g} preview`,b=l(()=>{if(r&&c){if(i){const e=i(d);if(e)return void m(e)}o(d,r.rule.ruleId,r.samplingId)}},[r,c,d,o,i,m]),v=l(()=>{r&&n(r.rule.ruleId,r.samplingId)},[r,n]),y=a(()=>{if(!r)return;const t=h?{message:h.message,onViewRule:s?()=>s(h.ruleId):void 0}:null;return Yd(c?{isEditing:!0,onCancelEdit:p,onSave:b,onDelete:v,duplicateWarning:t}:{isEditing:!1,onDelete:v,onCancel:e,onEdit:u})},[r,c,h,p,b,v,u,e,s]);return t(qd,{isOpen:!!r,title:f,subTitle:r?kn[r.category]:"",onClose:e,footer:y})},eu=({isOpen:e,onClose:n,onSave:o})=>{const{localEnabled:a,resolvedPercentage:i}=Dl(Pl.EditAutoNoisy),s=l(()=>o(a,i),[o,a,i]);return t(ou,{formType:Pl.EditAutoNoisy,isOpen:e,onClose:n,onSave:s})},tu=({isOpen:e,onClose:n,onSave:o})=>{const{localEnabled:a,resolvedPercentage:i}=Dl(Pl.EditAutoCostReduction),s=l(()=>o(a,i),[o,a,i]);return t(ou,{formType:Pl.EditAutoCostReduction,isOpen:e,onClose:n,onSave:s})},nu=({isOpen:e,onClose:n,onSave:o})=>{const{localEnabled:a}=Dl(Pl.EditAutoHighlyRelevant),i=l(()=>o(a),[o,a]);return t(ou,{formType:Pl.EditAutoHighlyRelevant,isOpen:e,onClose:n,onSave:i})},ou=({formType:e,isOpen:n,onClose:o,onSave:a})=>{const i=Jd[e];return t(qd,{isOpen:n,title:i.title,subTitle:i.subTitle,onClose:o,footer:{actions:[{"data-id":i.cancelId,label:Cn,variant:de.Secondary,size:ce.S,onClick:o},{"data-id":i.saveId,label:Fn,variant:de.Primary,size:ce.S,onClick:a}]}})},au=e=>{switch(e.formType){case Pl.Create:return t(Bl,{formType:Pl.Create,category:e.category,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(Zd,{...e})});case Pl.View:return t(Bl,{formType:Pl.View,data:e.data,defaultEditMode:e.defaultEditMode,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(Qd,{...e})});case Pl.EditAutoNoisy:return t(Bl,{formType:Pl.EditAutoNoisy,enabled:e.enabled,keepPercentage:e.keepPercentage,children:t(eu,{...e})});case Pl.EditAutoCostReduction:return t(Bl,{formType:Pl.EditAutoCostReduction,enabled:e.enabled,dropPercentage:e.dropPercentage,children:t(tu,{...e})});case Pl.EditAutoHighlyRelevant:return t(Bl,{formType:Pl.EditAutoHighlyRelevant,enabled:e.enabled,children:t(nu,{...e})})}},iu=({token:o,isLoading:a,isEditing:i,onEdit:l,onCancel:s,onSave:r,formData:c,handleFormChange:d,handleErrorChange:u,formErrors:p})=>{const{CopyButton:h}=sn(),m=!i||a||!c.newToken;return _n({key:"Enter",active:!m},r),e(se,i?{$justifyContent:"space-between",$alignItems:"flex-start",$gap:12,children:[t(be,{type:"password",value:c.newToken,onChange:e=>{d("newToken",e.target.value),u("newToken",void 0)},width:"430px",autoFocus:!0,errorMessage:p.newToken}),t(se,{$margin:a?"8px 0 0 0":"2px 0 0 0",$alignItems:"center",children:a?t(ct,{title:"Saving...",withGradient:!0}):e(n,{children:[t(re,{variant:de.Secondary,size:ce.S,leftIcon:wi,onClick:s,disabled:a}),t(re,{variant:de.Primary,size:ce.S,leftIcon:Si,onClick:r,disabled:m})]})})]}:{$justifyContent:"space-between",$gap:12,children:[t(ae,{size:le.XS,children:new Array(55).fill("•").join("")}),e(se,{$alignItems:"center",$justifyContent:"space-between",children:[t(h,{value:o}),t(st,{icon:hi,onClick:l})]})]})},lu=({expiresAt:e,callbackValid:n,callbackExpired:i})=>{const{formatTimeAgo:l}=zt(),s=a(()=>l(e),[e,l]),r=a(()=>new Date(e).toDateString().split(" ").slice(1).join(" "),[e]),c=a(()=>Mn(e,0)?Ie.Error:Mn(e,2592e6)?Ie.Warning:Ie.Success,[e]),d=a(()=>c===Ie.Success?Si:c===Ie.Warning?Wi:Oi,[c]);return o(()=>{c===Ie.Success?n():c===Ie.Error&&i()},[c]),t(De,{text:r,children:t(Be,{leftIcon:d,label:s,status:c,invertColors:!0,useSecondaryTone:!0})})},su=g.div`
378
393
  display: flex;
379
394
  flex-direction: column;
380
395
  gap: 12px;
@@ -382,7 +397,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
382
397
  border-radius: 12px;
383
398
  border: 1px solid ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[500]:e.v2.colors.silver[600]};
384
399
  background-color: ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[1e3]:e.v2.colors.silver[800]};
385
- `,Jd=({children:e})=>{const o=f();return t(ae,{size:le.XXXS,color:o.v2.colors.grey[150],children:e})},qd=({token:o})=>{const{tokensApi:n}=sl(),[a,i]=s(!1),[l,r]=s(!1),[c,d]=s(!1),{formData:u,handleFormChange:p,formErrors:h,handleErrorChange:g,resetFormData:m}=Nt({newToken:""});return t(et,{richTitle:{icon:Yi,title:"Odigos Pro Token"},children:e(Yd,{$isExpired:c,children:[e(se,{$justifyContent:"space-between",children:[e(W,{$gap:4,children:[t(Jd,{children:"Issued for"}),t(ae,{size:le.XS,children:o.name||"N/A"})]}),e(W,{$gap:4,children:[t(Jd,{children:"Expiration"}),t(Kd,{expiresAt:o.expiresAt,callbackValid:()=>d(!1),callbackExpired:()=>d(!0)})]}),t(W,{})]}),t(se,{children:e(W,{children:[t(Jd,{children:"Token"}),t(Wd,{token:o.token,newToken:u.newToken,isLoading:a,isEditing:l,onEdit:()=>r(!0),onCancel:()=>(r(!1),void p("newToken","")),onSave:()=>(async()=>{if(!n.updateToken)return;i(!0);const e=await n.updateToken(u.newToken.trim());i(!1),e?.error?g("newToken",e.error):(r(!1),m())})(),formData:u,handleFormChange:p,handleErrorChange:g,formErrors:h})]})})]})})},Zd=m.div`
400
+ `,ru=({children:e})=>{const n=f();return t(ae,{size:le.XXXS,color:n.v2.colors.grey[150],children:e})},cu=({token:n})=>{const{tokensApi:o}=ll(),[a,i]=s(!1),[l,r]=s(!1),[c,d]=s(!1),{formData:u,handleFormChange:p,formErrors:h,handleErrorChange:m,resetFormData:g}=At({newToken:""});return t(et,{richTitle:{icon:Ki,title:"Odigos Pro Token"},children:e(su,{$isExpired:c,children:[e(se,{$justifyContent:"space-between",children:[e(W,{$gap:4,children:[t(ru,{children:"Issued for"}),t(ae,{size:le.XS,children:n.name||"N/A"})]}),e(W,{$gap:4,children:[t(ru,{children:"Expiration"}),t(lu,{expiresAt:n.expiresAt,callbackValid:()=>d(!1),callbackExpired:()=>d(!0)})]}),t(W,{})]}),t(se,{children:e(W,{children:[t(ru,{children:"Token"}),t(iu,{token:n.token,newToken:u.newToken,isLoading:a,isEditing:l,onEdit:()=>r(!0),onCancel:()=>(r(!1),void p("newToken","")),onSave:()=>(async()=>{if(!o.updateToken)return;i(!0);const e=await o.updateToken(u.newToken.trim());i(!1),e?.error?m("newToken",e.error):(r(!1),g())})(),formData:u,handleFormChange:p,handleErrorChange:m,formErrors:h})]})})]})})},du=g.div`
386
401
  display: flex;
387
402
  flex-direction: column;
388
403
  align-items: center;
@@ -391,23 +406,23 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
391
406
  padding: 12px 24px;
392
407
  border-radius: 8px;
393
408
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
394
- `,Qd=()=>{const{progress:o}=Ct(),{describeApi:n,namespacesApi:a}=sl(),{items:i}=a.useNamespaces(),[l,r]=s(null),{formData:c,handleFormChange:d,resetFormData:u}=Nt({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(et,{richTitle:{icon:Ji,title:"Diagnose"},children:l?e(Zd,{children:[t(ct,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",withGradient:!0,withSpinner:"number"==typeof o[xt.DownloadingDiagnose]?.percentage,percentage:o[xt.DownloadingDiagnose]?.percentage,withVisual:"number"!=typeof o[xt.DownloadingDiagnose]?.percentage,visualIcon:Hi,startedAt:l}),o[xt.DownloadingDiagnose]?.list?.length&&t(W,{$width:"100%",children:o[xt.DownloadingDiagnose].list.map((o,n)=>e(se,{$gap:4,$alignItems:"center",children:[o.status===Ee.Success?t(xi,{size:16}):o.status===Ee.Error?t(Ti,{size:16}):t(ct,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(ae,{size:le.XXXS,color:ie.Secondary,children:o.label})]},`diagnose-item-${n}-${o.label}`))})]}):e(W,{$gap:24,children:[t(ae,{size:le.XXS,color:ie.Secondary,children:"Download a tar.gz file with diagnostics from this cluster. Select which data to include before downloading, and share the file with the Odigos support team for troubleshooting."}),e(W,{$gap:16,children:[e(se,{$gap:8,children:[t(Y,{label:"Profiles",value:c.includeProfiles,onChange:e=>d("includeProfiles",e),tooltip:"Note: Adds 30s to diagnose download time to collect Profiles"}),t(ae,{size:le.XXXS,color:ie.Secondary,children:"Include pprof profiles"})]}),e(se,{$gap:8,children:[t(Y,{label:"Metrics",value:c.includeMetrics,onChange:e=>d("includeMetrics",e)}),t(ae,{size:le.XXXS,color:ie.Secondary,children:"Include Prometheus metrics"})]}),e(se,{$gap:8,children:[t(Y,{label:"Source Workloads",value:c.includeSourceWorkloads,onChange:e=>{d("includeSourceWorkloads",e),e&&d("sourceWorkloadNamespaces",[])}}),t(ae,{size:le.XXXS,color:ie.Secondary,children:"Include workload and pod manifests for instrumented sources"})]})]}),t(Bo,{alignX:Vo.Left,alignY:Xo.Bottom,items:i.map(e=>({id:e.name,label:e.name,withCheckbox:!0})),selectedIds:c.sourceWorkloadNamespaces,setSelectedIds:e=>d("sourceWorkloadNamespaces",e),withMultiSelect:!0,withSearch:!0,fullWidth:!0,buttonProps:{label:(c.sourceWorkloadNamespaces.length?"Selected":"Select")+" Namespaces",variant:de.Secondary,disabled:c.includeSourceWorkloads,leftIcon:c.sourceWorkloadNamespaces.length?()=>t(Be,{label:c.sourceWorkloadNamespaces.length,status:Ee.Default}):void 0}}),t(se,{$justifyContent:"flex-end",children:t(re,{label:"Download Diagnose",rightIcon:Hi,variant:de.Primary,onClick:async()=>{n.downloadDiagnose&&(r(Date.now()),await n.downloadDiagnose(c),r(null),u())},disabled:null!==l})})]})})},eu=()=>{const{platformType:e,version:o,tier:a}=y(),{describeApi:i}=sl(),[l,r]=s(null);return n(()=>{i.fetchDescribeOdigos&&i.fetchDescribeOdigos().then(({data:e})=>r(e?.describeOdigos??null))},[]),t(et,{richTitle:{icon:zi,title:"General Information"},children:t(Et,{cellsPerRow:2,items:[{id:Uo(),title:"Odigos Version",label:o},{id:Uo(),title:`${e.toUpperCase()} Version`,label:l?.kubernetesVersion?.value||"-"},{id:Uo(),title:"Installation Method",label:l?.installationMethod?.value||"-"},{id:Uo(),title:"Tier",label:a}]})})},tu=({isOpen:o,onClose:n})=>{const{describeApi:a,tokensApi:i}=sl(),l=i.useTokens().items[0];return e(oe,{isOpen:o,header:{icon:zi,title:"System Overview",onClose:n},children:[a.fetchDescribeOdigos&&t(eu,{}),i.updateToken&&l&&t(qd,{token:l}),a.downloadDiagnose&&t(Qd,{})]})},ou=({isOpen:n,onClose:a,onCloseEnd:i})=>{const{addDataStreams:s,setSelectedStreamName:r}=Ge(),{dataStreamsApi:c}=sl(),{requestSubmit:d}=Rl(),u=l(async e=>{c.create?await c.create(e):(s([e]),r(e.name)),a()},[c,s,r,a]),p=l(()=>d(u),[d,u]);return zo({key:"Enter",active:n},p),e(o,{children:[t(Ue,{isOpen:n,onClose:a,onCloseEnd:i,title:He.NAME_YOUR_STREAM,description:He.STREAM_DESCRIPTION,approveButton:{"data-id":"add-stream-btn-done",label:kt.DONE,variant:de.Primary,onClick:p},denyButton:{"data-id":"add-stream-btn-cancel",label:kt.CANCEL,variant:de.Secondary,onClick:a},children:t(js,{autoFocus:!0})}),t(Gs,{})]})},nu=({isOpen:a,onClose:i,onCloseEnd:s,dataStreamName:r})=>{const{dataStreamsApi:c}=sl(),{genericForm:d,loadDataStream:u,requestSubmit:p}=Rl();n(()=>{a&&r&&u(r)},[a,r]);const h=!!d?.isFormDirty,g=l(async e=>{await c.update(r,e),i()},[c,r,i]),m=l(()=>p(g),[p,g]);return zo({key:"Enter",active:a},m),e(o,{children:[t(Ue,{isOpen:a,onClose:i,onCloseEnd:s,title:He.RENAME_STREAM(r),description:He.STREAM_DESCRIPTION,approveButton:{"data-id":"edit-stream-btn-save",label:kt.SAVE,variant:de.Primary,onClick:m,disabled:!h},denyButton:{"data-id":"edit-stream-btn-cancel",label:kt.CANCEL,variant:de.Secondary,onClick:i},children:t(js,{autoFocus:!0})}),t(Gs,{})]})},au=({scale:o=1})=>e("svg",{width:742*o,height:533*o,viewBox:"0 0 742 533",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("path",{d:"M0 0H722C733.046 0 742 8.95431 742 20V513C742 524.046 733.046 533 722 533H0V0Z",fill:"url(#paint0_linear_1585_55266)"}),e("g",{clipPath:"url(#clip0_1585_55266)",children:[t("path",{opacity:"0.1",d:"M817.963 1364.02C1052.53 1129.46 1052.53 749.151 817.96 514.585C583.394 280.019 203.089 280.018 -31.4751 514.583C-266.039 749.147 -266.038 1129.45 -31.4725 1364.02C203.093 1598.58 583.398 1598.58 817.963 1364.02Z",fill:"url(#paint1_radial_1585_55266)"}),t("path",{opacity:"0.3",d:"M789.266 1335.32C1007.98 1116.61 1007.98 761.998 789.264 543.281C570.547 324.565 215.938 324.563 -2.7781 543.279C-221.494 761.995 -221.493 1116.6 -2.77577 1335.32C215.941 1554.04 570.55 1554.04 789.266 1335.32Z",fill:"url(#paint2_radial_1585_55266)"}),t("path",{opacity:"0.5",d:"M736.156 1282.21C925.539 1092.83 925.538 785.776 736.153 596.392C546.769 407.007 239.717 407.006 50.333 596.39C-139.05 785.773 -139.05 1092.83 50.3351 1282.21C239.72 1471.59 546.772 1471.6 736.156 1282.21Z",fill:"url(#paint3_radial_1585_55266)"}),t("path",{opacity:"0.7",d:"M628.365 1174.42C758.218 1044.57 758.217 834.036 628.364 704.182C498.51 574.329 287.977 574.328 158.124 704.181C28.2713 834.033 28.272 1044.57 158.125 1174.42C287.979 1304.27 498.512 1304.27 628.365 1174.42Z",fill:"url(#paint4_radial_1585_55266)"}),t("path",{opacity:"0.1",d:"M795.717 29.8993C1030.28 -204.665 1030.28 -584.97 795.714 -819.536C561.148 -1054.1 180.843 -1054.1 -53.7211 -819.539C-288.285 -584.974 -288.284 -204.669 -53.7185 29.8967C180.847 264.462 561.152 264.464 795.717 29.8993Z",fill:"url(#paint5_radial_1585_55266)"}),t("path",{opacity:"0.3",d:"M767.02 1.20219C985.736 -217.513 985.734 -572.123 767.017 -790.84C548.301 -1009.56 193.691 -1009.56 -25.0242 -790.842C-243.74 -572.126 -243.739 -217.517 -25.0219 1.19982C193.695 219.917 548.304 219.918 767.02 1.20219Z",fill:"url(#paint6_radial_1585_55266)"}),t("path",{opacity:"0.5",d:"M713.909 -51.908C903.293 -241.292 903.292 -548.344 713.907 -737.728C524.523 -927.113 217.47 -927.114 28.0869 -737.731C-161.297 -548.347 -161.296 -241.295 28.089 -51.91C217.474 137.475 524.526 137.476 713.909 -51.908Z",fill:"url(#paint7_radial_1585_55266)"}),t("path",{opacity:"0.7",d:"M606.119 -159.699C735.972 -289.552 735.971 -500.085 606.118 -629.939C476.264 -759.792 265.731 -759.793 135.878 -629.94C6.0252 -500.088 6.02586 -289.554 135.879 -159.701C265.733 -29.8472 476.266 -29.8465 606.119 -159.699Z",fill:"url(#paint8_radial_1585_55266)"})]}),e("defs",{children:[e("linearGradient",{id:"paint0_linear_1585_55266",x1:"371",y1:"0",x2:"371",y2:"533",gradientUnits:"userSpaceOnUse",children:[t("stop",{offset:"0.028197",stopColor:"#0B0517"}),t("stop",{offset:"1",stopColor:"#190D31"})]}),e("radialGradient",{id:"paint1_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(334.074 991.405) rotate(-45) scale(599.732 599.736)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.41",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.67",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.75",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.83",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.89",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.95",stopColor:"#7C3BFF",stopOpacity:"0.56"}),t("stop",{offset:"1",stopColor:"#7C3BFF",stopOpacity:"0.7"})]}),e("radialGradient",{id:"paint2_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(368.968 957.913) rotate(-45) scale(560.978 560.981)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.38",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.52",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.62",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.69",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.76",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.82",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.88",stopColor:"#7C3BFF",stopOpacity:"0.57"}),t("stop",{offset:"0.93",stopColor:"#7C3BFF",stopOpacity:"0.72"}),t("stop",{offset:"0.97",stopColor:"#7C3BFF",stopOpacity:"0.88"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint3_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(351.265 971.313) rotate(-45) scale(484.947 484.95)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint4_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(362.239 963.064) rotate(-45) scale(332.216 332.218)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint5_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(311.828 -342.716) rotate(-45) scale(599.733 599.736)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.41",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.67",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.75",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.83",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.89",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.95",stopColor:"#7C3BFF",stopOpacity:"0.56"}),t("stop",{offset:"1",stopColor:"#7C3BFF",stopOpacity:"0.7"})]}),e("radialGradient",{id:"paint6_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(346.722 -376.208) rotate(-45) scale(560.977 560.981)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.38",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.52",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.62",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.69",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.76",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.82",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.88",stopColor:"#7C3BFF",stopOpacity:"0.57"}),t("stop",{offset:"0.93",stopColor:"#7C3BFF",stopOpacity:"0.72"}),t("stop",{offset:"0.97",stopColor:"#7C3BFF",stopOpacity:"0.88"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint7_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(329.019 -362.807) rotate(-45) scale(484.947 484.95)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint8_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(339.993 -371.057) rotate(-45) scale(332.216 332.218)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),t("clipPath",{id:"clip0_1585_55266",children:t("rect",{width:"929.477",height:"667",fill:"white",transform:"translate(-93.7383 -134)"})})]})]}),iu=m.div`
409
+ `,uu=()=>{const{progress:n}=yt(),{describeApi:o,namespacesApi:a}=ll(),{items:i}=a.useNamespaces(),[l,r]=s(null),{formData:c,handleFormChange:d,resetFormData:u}=At({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(et,{richTitle:{icon:Yi,title:"Diagnose"},children:l?e(du,{children:[t(ct,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",withGradient:!0,withSpinner:"number"==typeof n[wt.DownloadingDiagnose]?.percentage,percentage:n[wt.DownloadingDiagnose]?.percentage,withVisual:"number"!=typeof n[wt.DownloadingDiagnose]?.percentage,visualIcon:Ui,startedAt:l}),n[wt.DownloadingDiagnose]?.list?.length&&t(W,{$width:"100%",children:n[wt.DownloadingDiagnose].list.map((n,o)=>e(se,{$gap:4,$alignItems:"center",children:[n.status===Ie.Success?t(Si,{size:16}):n.status===Ie.Error?t(wi,{size:16}):t(ct,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(ae,{size:le.XXXS,color:ie.Secondary,children:n.label})]},`diagnose-item-${o}-${n.label}`))})]}):e(W,{$gap:24,children:[t(ae,{size:le.XXS,color:ie.Secondary,children:"Download a tar.gz file with diagnostics from this cluster. Select which data to include before downloading, and share the file with the Odigos support team for troubleshooting."}),e(W,{$gap:16,children:[e(se,{$gap:8,children:[t(Y,{label:"Profiles",value:c.includeProfiles,onChange:e=>d("includeProfiles",e),tooltip:"Note: Adds 30s to diagnose download time to collect Profiles"}),t(ae,{size:le.XXXS,color:ie.Secondary,children:"Include pprof profiles"})]}),e(se,{$gap:8,children:[t(Y,{label:"Metrics",value:c.includeMetrics,onChange:e=>d("includeMetrics",e)}),t(ae,{size:le.XXXS,color:ie.Secondary,children:"Include Prometheus metrics"})]}),e(se,{$gap:8,children:[t(Y,{label:"Source Workloads",value:c.includeSourceWorkloads,onChange:e=>{d("includeSourceWorkloads",e),e&&d("sourceWorkloadNamespaces",[])}}),t(ae,{size:le.XXXS,color:ie.Secondary,children:"Include workload and pod manifests for instrumented sources"})]})]}),t(zn,{alignX:Xn.Left,alignY:Bn.Bottom,items:i.map(e=>({id:e.name,label:e.name,withCheckbox:!0})),selectedIds:c.sourceWorkloadNamespaces,setSelectedIds:e=>d("sourceWorkloadNamespaces",e),withMultiSelect:!0,withSearch:!0,fullWidth:!0,buttonProps:{label:(c.sourceWorkloadNamespaces.length?"Selected":"Select")+" Namespaces",variant:de.Secondary,disabled:c.includeSourceWorkloads,leftIcon:c.sourceWorkloadNamespaces.length?()=>t(Be,{label:c.sourceWorkloadNamespaces.length,status:Ie.Default}):void 0}}),t(se,{$justifyContent:"flex-end",children:t(re,{label:"Download Diagnose",rightIcon:Ui,variant:de.Primary,onClick:async()=>{o.downloadDiagnose&&(r(Date.now()),await o.downloadDiagnose(c),r(null),u())},disabled:null!==l})})]})})},pu=()=>{const{platformType:e,version:n,tier:a}=y(),{describeApi:i}=ll(),[l,r]=s(null);return o(()=>{i.fetchDescribeOdigos&&i.fetchDescribeOdigos().then(({data:e})=>r(e?.describeOdigos??null))},[]),t(et,{richTitle:{icon:Li,title:"General Information"},children:t($t,{cellsPerRow:2,items:[{id:Vn(),title:"Odigos Version",label:n},{id:Vn(),title:`${e.toUpperCase()} Version`,label:l?.kubernetesVersion?.value||"-"},{id:Vn(),title:"Installation Method",label:l?.installationMethod?.value||"-"},{id:Vn(),title:"Tier",label:a}]})})},hu=({isOpen:n,onClose:o})=>{const{describeApi:a,tokensApi:i}=ll(),l=i.useTokens().items[0];return e(ne,{isOpen:n,header:{icon:Li,title:"System Overview",onClose:o},children:[a.fetchDescribeOdigos&&t(pu,{}),i.updateToken&&l&&t(cu,{token:l}),a.downloadDiagnose&&t(uu,{})]})},mu=({isOpen:o,onClose:a,onCloseEnd:i})=>{const{addDataStreams:s,setSelectedStreamName:r}=He(),{dataStreamsApi:c}=ll(),{requestSubmit:d}=Ol(),u=l(async e=>{c.create?await c.create(e):(s([e]),r(e.name)),a()},[c,s,r,a]),p=l(()=>d(u),[d,u]);return _n({key:"Enter",active:o},p),e(n,{children:[t(Ue,{isOpen:o,onClose:a,onCloseEnd:i,title:Ge.NAME_YOUR_STREAM,description:Ge.STREAM_DESCRIPTION,approveButton:{"data-id":"add-stream-btn-done",label:kt.DONE,variant:de.Primary,onClick:p},denyButton:{"data-id":"add-stream-btn-cancel",label:kt.CANCEL,variant:de.Secondary,onClick:a},children:t(Hs,{autoFocus:!0})}),t(Gs,{})]})},gu=({isOpen:a,onClose:i,onCloseEnd:s,dataStreamName:r})=>{const{dataStreamsApi:c}=ll(),{genericForm:d,loadDataStream:u,requestSubmit:p}=Ol();o(()=>{a&&r&&u(r)},[a,r]);const h=!!d?.isFormDirty,m=l(async e=>{await c.update(r,e),i()},[c,r,i]),g=l(()=>p(m),[p,m]);return _n({key:"Enter",active:a},g),e(n,{children:[t(Ue,{isOpen:a,onClose:i,onCloseEnd:s,title:Ge.RENAME_STREAM(r),description:Ge.STREAM_DESCRIPTION,approveButton:{"data-id":"edit-stream-btn-save",label:kt.SAVE,variant:de.Primary,onClick:g,disabled:!h},denyButton:{"data-id":"edit-stream-btn-cancel",label:kt.CANCEL,variant:de.Secondary,onClick:i},children:t(Hs,{autoFocus:!0})}),t(Gs,{})]})},fu=({scale:n=1})=>e("svg",{width:742*n,height:533*n,viewBox:"0 0 742 533",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("path",{d:"M0 0H722C733.046 0 742 8.95431 742 20V513C742 524.046 733.046 533 722 533H0V0Z",fill:"url(#paint0_linear_1585_55266)"}),e("g",{clipPath:"url(#clip0_1585_55266)",children:[t("path",{opacity:"0.1",d:"M817.963 1364.02C1052.53 1129.46 1052.53 749.151 817.96 514.585C583.394 280.019 203.089 280.018 -31.4751 514.583C-266.039 749.147 -266.038 1129.45 -31.4725 1364.02C203.093 1598.58 583.398 1598.58 817.963 1364.02Z",fill:"url(#paint1_radial_1585_55266)"}),t("path",{opacity:"0.3",d:"M789.266 1335.32C1007.98 1116.61 1007.98 761.998 789.264 543.281C570.547 324.565 215.938 324.563 -2.7781 543.279C-221.494 761.995 -221.493 1116.6 -2.77577 1335.32C215.941 1554.04 570.55 1554.04 789.266 1335.32Z",fill:"url(#paint2_radial_1585_55266)"}),t("path",{opacity:"0.5",d:"M736.156 1282.21C925.539 1092.83 925.538 785.776 736.153 596.392C546.769 407.007 239.717 407.006 50.333 596.39C-139.05 785.773 -139.05 1092.83 50.3351 1282.21C239.72 1471.59 546.772 1471.6 736.156 1282.21Z",fill:"url(#paint3_radial_1585_55266)"}),t("path",{opacity:"0.7",d:"M628.365 1174.42C758.218 1044.57 758.217 834.036 628.364 704.182C498.51 574.329 287.977 574.328 158.124 704.181C28.2713 834.033 28.272 1044.57 158.125 1174.42C287.979 1304.27 498.512 1304.27 628.365 1174.42Z",fill:"url(#paint4_radial_1585_55266)"}),t("path",{opacity:"0.1",d:"M795.717 29.8993C1030.28 -204.665 1030.28 -584.97 795.714 -819.536C561.148 -1054.1 180.843 -1054.1 -53.7211 -819.539C-288.285 -584.974 -288.284 -204.669 -53.7185 29.8967C180.847 264.462 561.152 264.464 795.717 29.8993Z",fill:"url(#paint5_radial_1585_55266)"}),t("path",{opacity:"0.3",d:"M767.02 1.20219C985.736 -217.513 985.734 -572.123 767.017 -790.84C548.301 -1009.56 193.691 -1009.56 -25.0242 -790.842C-243.74 -572.126 -243.739 -217.517 -25.0219 1.19982C193.695 219.917 548.304 219.918 767.02 1.20219Z",fill:"url(#paint6_radial_1585_55266)"}),t("path",{opacity:"0.5",d:"M713.909 -51.908C903.293 -241.292 903.292 -548.344 713.907 -737.728C524.523 -927.113 217.47 -927.114 28.0869 -737.731C-161.297 -548.347 -161.296 -241.295 28.089 -51.91C217.474 137.475 524.526 137.476 713.909 -51.908Z",fill:"url(#paint7_radial_1585_55266)"}),t("path",{opacity:"0.7",d:"M606.119 -159.699C735.972 -289.552 735.971 -500.085 606.118 -629.939C476.264 -759.792 265.731 -759.793 135.878 -629.94C6.0252 -500.088 6.02586 -289.554 135.879 -159.701C265.733 -29.8472 476.266 -29.8465 606.119 -159.699Z",fill:"url(#paint8_radial_1585_55266)"})]}),e("defs",{children:[e("linearGradient",{id:"paint0_linear_1585_55266",x1:"371",y1:"0",x2:"371",y2:"533",gradientUnits:"userSpaceOnUse",children:[t("stop",{offset:"0.028197",stopColor:"#0B0517"}),t("stop",{offset:"1",stopColor:"#190D31"})]}),e("radialGradient",{id:"paint1_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(334.074 991.405) rotate(-45) scale(599.732 599.736)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.41",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.67",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.75",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.83",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.89",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.95",stopColor:"#7C3BFF",stopOpacity:"0.56"}),t("stop",{offset:"1",stopColor:"#7C3BFF",stopOpacity:"0.7"})]}),e("radialGradient",{id:"paint2_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(368.968 957.913) rotate(-45) scale(560.978 560.981)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.38",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.52",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.62",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.69",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.76",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.82",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.88",stopColor:"#7C3BFF",stopOpacity:"0.57"}),t("stop",{offset:"0.93",stopColor:"#7C3BFF",stopOpacity:"0.72"}),t("stop",{offset:"0.97",stopColor:"#7C3BFF",stopOpacity:"0.88"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint3_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(351.265 971.313) rotate(-45) scale(484.947 484.95)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint4_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(362.239 963.064) rotate(-45) scale(332.216 332.218)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint5_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(311.828 -342.716) rotate(-45) scale(599.733 599.736)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.41",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.67",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.75",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.83",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.89",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.95",stopColor:"#7C3BFF",stopOpacity:"0.56"}),t("stop",{offset:"1",stopColor:"#7C3BFF",stopOpacity:"0.7"})]}),e("radialGradient",{id:"paint6_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(346.722 -376.208) rotate(-45) scale(560.977 560.981)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.38",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.52",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.62",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.69",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.76",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.82",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.88",stopColor:"#7C3BFF",stopOpacity:"0.57"}),t("stop",{offset:"0.93",stopColor:"#7C3BFF",stopOpacity:"0.72"}),t("stop",{offset:"0.97",stopColor:"#7C3BFF",stopOpacity:"0.88"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint7_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(329.019 -362.807) rotate(-45) scale(484.947 484.95)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint8_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(339.993 -371.057) rotate(-45) scale(332.216 332.218)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),t("clipPath",{id:"clip0_1585_55266",children:t("rect",{width:"929.477",height:"667",fill:"white",transform:"translate(-93.7383 -134)"})})]})]}),bu=g.div`
395
410
  position: absolute;
396
411
  top: 50%;
397
412
  left: 50%;
398
413
  transform: translate(-50%, -50%);
399
414
  z-index: ${({theme:e})=>e.v2.zIndex.modal};
400
- `,lu="onboarding-done",su=()=>{const{currentModal:o,setCurrentModal:n}=Ho(),a=()=>n("");return e(Go,{isOpen:o===lu,onClose:a,children:[t(au,{}),t(iu,{children:e(W,{$gap:32,$alignItems:"center",children:[e(W,{$gap:24,$alignItems:"center",children:[t(ae,{size:le.L,weight:500,children:"Welcome to"}),t(kl,{size:260}),t(ae,{size:le.S,weight:400,children:"Your observability control plane is ready."})]}),t(re,{label:"Get Started",rightIcon:di,onClick:a})]})})]})},ru=m.div`
415
+ `,vu="onboarding-done",yu=()=>{const{currentModal:n,setCurrentModal:o}=Un(),a=()=>o("");return e(Gn,{isOpen:n===vu,onClose:a,children:[t(fu,{}),t(bu,{children:e(W,{$gap:32,$alignItems:"center",children:[e(W,{$gap:24,$alignItems:"center",children:[t(ae,{size:le.L,weight:500,children:"Welcome to"}),t(kl,{size:260}),t(ae,{size:le.S,weight:400,children:"Your observability control plane is ready."})]}),t(re,{label:"Get Started",rightIcon:ri,onClick:a})]})})]})},Cu=g.div`
401
416
  display: flex;
402
417
  flex-direction: column;
403
418
  gap: 8px;
404
419
  padding: 4px 8px;
405
420
  border-radius: 8px;
406
421
  width: 100%;
407
- `,cu=m.div`
422
+ `,Su=g.div`
408
423
  white-space: pre;
409
424
  overflow-x: auto;
410
- `,du=({name:o,recommended:n,toggleLabel:a,enabled:i,onEnabledChange:l,summary:s,toggleName:r})=>{const c=f();return e(ru,{children:[e(se,{$gap:8,$justifyContent:"space-between",children:[e(se,{$gap:4,children:[t(ae,{size:le.XS,color:c.v2.colors.white[500],nowrap:!0,children:o}),n&&t(Be,{label:jo,leftIcon:qi,backgroundColor:c.v2.colors.purple[700],textColor:c.v2.colors.white[500],textSize:le.XXXS})]}),t(Q,{name:r??`sampling-onboarding-toggle-${o}`,label:a,labelAlign:ee.Left,value:i,onChange:l,size:vt.S})]}),t(cu,{children:t(S,{parts:s})})]})},uu=m.div`
425
+ `,wu=({name:n,recommended:o,toggleLabel:a,enabled:i,onEnabledChange:l,summary:s,toggleName:r})=>{const c=f();return e(Cu,{children:[e(se,{$gap:8,$justifyContent:"space-between",children:[e(se,{$gap:4,children:[t(ae,{size:le.XS,color:c.v2.colors.white[500],nowrap:!0,children:n}),o&&t(Be,{label:Hn,leftIcon:Ji,backgroundColor:c.v2.colors.purple[700],textColor:c.v2.colors.white[500],textSize:le.XXXS})]}),t(Q,{name:r??`sampling-onboarding-toggle-${n}`,label:a,labelAlign:ee.Left,value:i,onChange:l,size:bt.S})]}),t(Su,{children:t(S,{parts:s})})]})},xu=g.div`
411
426
  position: relative;
412
427
  display: flex;
413
428
  align-items: center;
@@ -417,18 +432,18 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
417
432
  background-color: ${({theme:e})=>e.v2.colors.black[500]};
418
433
  border-top-left-radius: 18px;
419
434
  border-top-right-radius: 18px;
420
- `,pu=m.div`
435
+ `,ku=g.div`
421
436
  position: absolute;
422
437
  left: 16px;
423
438
  top: 50%;
424
439
  transform: translateY(-50%);
425
- `,hu=m.div`
440
+ `,Tu=g.div`
426
441
  height: 16px;
427
442
  width: 100%;
428
443
  background-color: ${({theme:e})=>e.v2.colors.black[500]};
429
444
  border-top-left-radius: 18px;
430
445
  border-top-right-radius: 18px;
431
- `,gu=m.div`
446
+ `,$u=g.div`
432
447
  width: ${({$width:e})=>e}px;
433
448
  display: flex;
434
449
  flex-direction: column;
@@ -436,7 +451,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
436
451
  gap: 22px;
437
452
  padding: 8px 32px 32px 32px;
438
453
  background-color: ${({theme:e})=>e.v2.colors.black[500]};
439
- `,mu=e=>t(Zi,{rotate:90,...e}),fu=({children:o,center:n,onNext:a,nextLabel:i=Wo,nextLoading:l})=>e(se,{$gap:8,$justifyContent:n?"center":"flex-end",$padding:"0 16px 16px 16px",children:[o,a&&t(re,{"data-id":"sampling-onboarding-btn-next",label:i,rightIcon:mu,variant:de.Primary,size:ce.M,onClick:a,loading:l})]}),bu=e=>t(Zi,{rotate:-90,...e}),vu=({title:o,onBack:n})=>{const a=f();return e(uu,{$hasBack:!!n,children:[n&&t(pu,{children:t(st,{"data-id":"sampling-onboarding-back",icon:bu,size:rt.M,onClick:n})}),t(ae,{size:le.M,weight:500,color:a.v2.colors.white[500],align:"center",children:o})]})},yu=m.div`
454
+ `,Iu=e=>t(qi,{rotate:90,...e}),Eu=({children:n,center:o,onNext:a,nextLabel:i=jn,nextLoading:l})=>e(se,{$gap:8,$justifyContent:o?"center":"flex-end",$padding:"0 16px 16px 16px",children:[n,a&&t(re,{"data-id":"sampling-onboarding-btn-next",label:i,rightIcon:Iu,variant:de.Primary,size:ce.M,onClick:a,loading:l})]}),Au=e=>t(qi,{rotate:-90,...e}),Nu=({title:n,onBack:o})=>{const a=f();return e(xu,{$hasBack:!!o,children:[o&&t(ku,{children:t(st,{"data-id":"sampling-onboarding-back",icon:Au,size:rt.M,onClick:o})}),t(ae,{size:le.M,weight:500,color:a.v2.colors.white[500],align:"center",children:n})]})},Ou=g.div`
440
455
  box-sizing: border-box;
441
456
  width: ${({$width:e})=>e??"100%"};
442
457
  ${({$fillHeight:e})=>e&&b`
@@ -449,16 +464,16 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
449
464
  padding: 16px;
450
465
  border-radius: 16px;
451
466
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
452
- `,Cu=({children:e,fillHeight:o,width:n})=>t(yu,{$fillHeight:o,$width:n,children:e}),Su=m.ul`
467
+ `,Ru=({children:e,fillHeight:n,width:o})=>t(Ou,{$fillHeight:n,$width:o,children:e}),Du=g.ul`
453
468
  margin: 0;
454
469
  padding: 0;
455
470
  list-style: disc;
456
- `,wu=m.li`
471
+ `,Pu=g.li`
457
472
  margin-left: 18px;
458
473
  & + & {
459
474
  margin-top: 6px;
460
475
  }
461
- `,xu=({items:e,color:o})=>{const n=f(),a=o||n.v2.colors.silver[200];return t(Su,{children:e.map((e,o)=>t(wu,{style:{color:a},children:t(ae,{size:le.XXS,color:a,children:e})},o))})},Tu=({items:o})=>{const n=f();return t(W,{$gap:16,children:o.map((o,a)=>e(se,{$gap:8,$alignItems:"flex-start",children:[e(ae,{size:le.XS,color:n.v2.colors.silver[200],weight:400,children:[a+1,"."]}),e(W,{$gap:2,children:[t(ae,{size:le.XS,color:n.v2.colors.white[500],weight:500,children:o.title}),t(ae,{size:le.XS,color:n.v2.colors.silver[200],children:o.description})]})]},a))})},ku=({message:e})=>t($e,{status:Ee.Default,message:e,fullWidth:!0,smallIcon:!0}),$u=m.div`
476
+ `,Fu=({items:e,color:n})=>{const o=f(),a=n||o.v2.colors.silver[200];return t(Du,{children:e.map((e,n)=>t(Pu,{style:{color:a},children:t(ae,{size:le.XXS,color:a,children:e})},n))})},Lu=({items:n})=>{const o=f();return t(W,{$gap:16,children:n.map((n,a)=>e(se,{$gap:8,$alignItems:"flex-start",children:[e(ae,{size:le.XS,color:o.v2.colors.silver[200],weight:400,children:[a+1,"."]}),e(W,{$gap:2,children:[t(ae,{size:le.XS,color:o.v2.colors.white[500],weight:500,children:n.title}),t(ae,{size:le.XS,color:o.v2.colors.silver[200],children:n.description})]})]},a))})},_u=({message:e})=>t($e,{status:Ie.Default,message:e,fullWidth:!0,smallIcon:!0}),Mu=g.div`
462
477
  width: 100%;
463
478
  padding: 8px;
464
479
  display: flex;
@@ -466,12 +481,12 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
466
481
  gap: 4px;
467
482
  border-radius: 16px;
468
483
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
469
- `,Eu=m.div`
484
+ `,zu=g.div`
470
485
  display: flex;
471
486
  align-items: center;
472
487
  gap: 8px;
473
488
  padding: 4px 8px 12px 8px;
474
- `,Iu=m.div`
489
+ `,Bu=g.div`
475
490
  width: 100%;
476
491
  display: flex;
477
492
  flex-direction: column;
@@ -479,20 +494,20 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
479
494
  padding: 8px;
480
495
  border-radius: 12px;
481
496
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
482
- `,Au=({children:e})=>{const o=f();return t(ae,{size:le.S,weight:500,color:o.v2.colors.white[500],align:"center",children:e})},Nu=m.div`
497
+ `,Xu=({children:e})=>{const n=f();return t(ae,{size:le.S,weight:500,color:n.v2.colors.white[500],align:"center",children:e})},Vu=g.div`
483
498
  white-space: pre-line;
484
- `,Ou=({enabled:n,onEnabledChange:i,onBack:l,onNext:s})=>{const r=f(),c=a(()=>k({enabled:n,keepPercentage:0}),[n]);return e(o,{children:[t(vu,{title:Ko,onBack:l}),e(gu,{$width:854,children:[t(Au,{children:Yo}),e(W,{$gap:8,$width:"100%",children:[t(Cu,{children:t(Nu,{children:t(ae,{size:le.XXS,color:r.v2.colors.silver[200],children:Jo})})}),e(W,{$gap:8,$width:"100%",children:[e($u,{children:[t(Eu,{children:t(ae,{size:le.S,weight:500,color:r.v2.colors.white[500],children:qo})}),t(Iu,{children:t(du,{name:Qo,recommended:!0,toggleLabel:Zo,enabled:n,onEnabledChange:i,summary:c,toggleName:"sampling-onboarding-noisy-toggle"})})]}),t(ku,{message:en})]})]})]}),t(fu,{onNext:s})]})},Ru=e=>t(Zi,{rotate:90,...e}),Du=({onClose:n})=>{const a=f();return e(o,{children:[t(hu,{}),e(gu,{$width:732,children:[t(tn,{icon:Wi}),e(W,{$gap:16,$alignItems:"center",$width:"100%",children:[t(ae,{size:le.M,weight:500,color:a.v2.colors.white[500],children:on}),nn.split("\n").map((e,o)=>t(Au,{children:e},`subtitle-${o}-${e}`)),e(Cu,{children:[t(ae,{size:le.XS,color:a.v2.colors.silver[200],children:an}),t(xu,{color:a.v2.colors.white[500],items:[ln,sn,rn]})]})]})]}),t(fu,{center:!0,children:t(re,{"data-id":"sampling-onboarding-btn-go-to",label:cn,rightIcon:Ru,variant:de.Primary,size:ce.M,onClick:n})})]})},Pu=e=>t(Zi,{rotate:90,...e}),Fu=m.div`
499
+ `,Uu=({enabled:o,onEnabledChange:i,onBack:l,onNext:s})=>{const r=f(),c=a(()=>T({enabled:o,keepPercentage:0}),[o]);return e(n,{children:[t(Nu,{title:Wn,onBack:l}),e($u,{$width:854,children:[t(Xu,{children:Kn}),e(W,{$gap:8,$width:"100%",children:[t(Ru,{children:t(Vu,{children:t(ae,{size:le.XXS,color:r.v2.colors.silver[200],children:Yn})})}),e(W,{$gap:8,$width:"100%",children:[e(Mu,{children:[t(zu,{children:t(ae,{size:le.S,weight:500,color:r.v2.colors.white[500],children:Jn})}),t(Bu,{children:t(wu,{name:Zn,recommended:!0,toggleLabel:qn,enabled:o,onEnabledChange:i,summary:c,toggleName:"sampling-onboarding-noisy-toggle"})})]}),t(_u,{message:Qn})]})]})]}),t(Eu,{onNext:s})]})},Gu=e=>t(qi,{rotate:90,...e}),Hu=({onClose:o})=>{const a=f();return e(n,{children:[t(Tu,{}),e($u,{$width:732,children:[t(eo,{icon:ji}),e(W,{$gap:16,$alignItems:"center",$width:"100%",children:[t(ae,{size:le.M,weight:500,color:a.v2.colors.white[500],children:to}),no.split("\n").map((e,n)=>t(Xu,{children:e},`subtitle-${n}-${e}`)),e(Ru,{children:[t(ae,{size:le.XS,color:a.v2.colors.silver[200],children:oo}),t(Fu,{color:a.v2.colors.white[500],items:[ao,io,lo]})]})]})]}),t(Eu,{center:!0,children:t(re,{"data-id":"sampling-onboarding-btn-go-to",label:so,rightIcon:Gu,variant:de.Primary,size:ce.M,onClick:o})})]})},ju=e=>t(qi,{rotate:90,...e}),Wu=g.div`
485
500
  display: flex;
486
501
  flex-direction: column;
487
502
  align-items: center;
488
503
  gap: 8px;
489
504
  width: 100%;
490
- `,Lu=({onSkip:n,onNext:a})=>{const i=f();return e(o,{children:[t(hu,{}),e(gu,{$width:732,children:[t(tn,{icon:Wi}),e(W,{$gap:16,$alignItems:"center",$width:"100%",children:[e(Fu,{children:[t(ae,{size:le.M,weight:500,color:i.v2.colors.white[500],children:dn}),t(Au,{children:un})]}),e(Cu,{children:[t(ae,{size:le.XS,color:i.v2.colors.silver[200],children:pn}),t(Tu,{items:[{title:gn,description:hn},{title:fn,description:mn},{title:vn,description:bn}]}),t(ku,{message:yn})]})]})]}),e(fu,{center:!0,children:[t(re,{"data-id":"sampling-onboarding-btn-skip",label:Cn,variant:de.Secondary,onClick:n}),t(re,{"data-id":"sampling-onboarding-btn-start",label:Sn,rightIcon:Pu,variant:de.Primary,onClick:a})]})]})},_u=m.div`
505
+ `,Ku=({onSkip:o,onNext:a})=>{const i=f();return e(n,{children:[t(Tu,{}),e($u,{$width:732,children:[t(eo,{icon:ji}),e(W,{$gap:16,$alignItems:"center",$width:"100%",children:[e(Wu,{children:[t(ae,{size:le.M,weight:500,color:i.v2.colors.white[500],children:ro}),t(Xu,{children:co})]}),e(Ru,{children:[t(ae,{size:le.XS,color:i.v2.colors.silver[200],children:uo}),t(Lu,{items:[{title:ho,description:po},{title:go,description:mo},{title:bo,description:fo}]}),t(_u,{message:vo})]})]})]}),e(Eu,{center:!0,children:[t(re,{"data-id":"sampling-onboarding-btn-skip",label:yo,variant:de.Secondary,onClick:o}),t(re,{"data-id":"sampling-onboarding-btn-start",label:Co,rightIcon:ju,variant:de.Primary,onClick:a})]})]})},Yu=g.div`
491
506
  display: flex;
492
507
  align-items: stretch;
493
508
  gap: 16px;
494
509
  width: 100%;
495
- `,zu=m.div`
510
+ `,Ju=g.div`
496
511
  flex: 1;
497
512
  display: flex;
498
513
  flex-direction: column;
@@ -512,18 +527,18 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
512
527
  background-color: ${t.v2.colors.silver[700]};
513
528
  }
514
529
  `}
515
- `,Mu=m.div`
530
+ `,qu=g.div`
516
531
  display: flex;
517
532
  align-items: center;
518
533
  gap: 8px;
519
534
  padding: 12px 16px;
520
- `,Bu=m.div`
535
+ `,Zu=g.div`
521
536
  flex: 1;
522
537
  padding: 8px;
523
538
  display: flex;
524
539
  flex-direction: column;
525
540
  gap: 8px;
526
- `,Xu=m.div`
541
+ `,Qu=g.div`
527
542
  flex: 1;
528
543
  display: flex;
529
544
  flex-direction: column;
@@ -531,17 +546,17 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
531
546
  padding: 12px;
532
547
  border-radius: 12px;
533
548
  background-color: ${({theme:e,$selected:t})=>t?e.v2.colors.purple[900]:e.v2.colors.silver[900]};
534
- `,Vu=m.div`
549
+ `,ep=g.div`
535
550
  display: flex;
536
551
  justify-content: flex-end;
537
- `,Uu=m.div`
552
+ `,tp=g.div`
538
553
  display: flex;
539
554
  align-items: center;
540
555
  gap: 8px;
541
556
  padding: 4px 12px 4px 4px;
542
557
  border-radius: 8px;
543
558
  background-color: ${({theme:e})=>e.v2.colors.yellow[1e3]};
544
- `,Hu=m.div`
559
+ `,np=g.div`
545
560
  display: flex;
546
561
  align-items: center;
547
562
  justify-content: center;
@@ -549,13 +564,13 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
549
564
  height: 24px;
550
565
  border-radius: 6px;
551
566
  background-color: ${({theme:e})=>e.v2.colors.yellow[900]};
552
- `,Gu=({selected:o,onSelect:n,name:a,description:i,badgeProps:l,bullets:s,warning:r,onReadMore:c})=>{const d=f(),u=o?d.v2.colors.white[500]:d.v2.colors.silver[200];return e(zu,{$selected:o,onClick:n,children:[e(Mu,{children:[t(ge,{"data-id":`sampling-onboarding-radio-${a}`,value:o,onChange:n,size:fe.L}),t(Wi,{size:24,fill:d.v2.colors.white[500]}),t(ae,{size:le.S,weight:500,color:d.v2.colors.white[500],children:a})]}),e(Bu,{children:[e(Xu,{$selected:o,children:[e(W,{$gap:8,children:[t(Be,{...l,textSize:le.XXXS}),t(ae,{size:le.XXS,color:u,children:i})]}),s&&s.length>0&&t(xu,{color:u,items:s}),r&&e(Uu,{children:[t(Hu,{children:t(Ki,{size:18,fill:d.v2.colors.yellow[500]})}),t(ae,{size:le.XXXS,color:d.v2.colors.yellow[500],children:r})]})]}),c&&t(Vu,{children:t(re,{"data-id":`sampling-onboarding-btn-read-more-${a}`,label:zn,rightIcon:hi,variant:de.Text,size:ce.S,onClick:e=>{e.stopPropagation(),c()}})})]})]})},ju=({strategy:n,onStrategyChange:a,onBack:i,onNext:l,docsUrl:s})=>{const r=f(),c=s?()=>window.open(s,"_blank"):void 0;return e(o,{children:[t(vu,{title:wn,onBack:i}),e(gu,{$width:854,children:[t(Au,{children:xn}),e(_u,{children:[t(Gu,{selected:"keep-list"===n,onSelect:()=>a("keep-list"),name:An,description:In,badgeProps:{label:En,backgroundColor:r.v2.colors.purple[500],textColor:r.v2.colors.white[500]},bullets:[kn,$n],warning:Tn,onReadMore:c}),t(Gu,{selected:"drop-list"===n,onSelect:()=>a("drop-list"),name:Pn,description:Dn,badgeProps:{label:Rn,backgroundColor:r.v2.colors.green[500],textColor:r.v2.colors.black[500]},bullets:[Nn,On],onReadMore:c}),t(Gu,{selected:"advanced"===n,onSelect:()=>a("advanced"),name:_n,description:Ln,badgeProps:{label:Fn,backgroundColor:r.v2.colors.blue[700],textColor:r.v2.colors.white[500]},onReadMore:c})]})]}),t(fu,{onNext:l})]})},Wu=({onBack:n,onNext:i,submitting:l})=>{const s=f(),r=a(()=>[{title:Vn,bullets:[Mn,Bn,Xn]},{title:Kn,bullets:[Un,Hn,Gn,jn,Wn]}],[]);return e(o,{children:[t(vu,{title:Yn,onBack:n}),e(gu,{$width:854,children:[t(Au,{children:Jn}),t(se,{$gap:16,$width:"100%",$alignItems:"stretch",children:r.map((o,n)=>e(Cu,{fillHeight:!0,width:"50%",children:[t(ae,{size:le.XS,color:s.v2.colors.white[500],children:o.title}),t(xu,{items:o.bullets})]},n))}),t(ku,{message:qn})]}),t(fu,{onNext:i,nextLoading:l})]})},Ku=m.div`
567
+ `,op=({selected:n,onSelect:o,name:a,description:i,badgeProps:l,bullets:s,warning:r,onReadMore:c})=>{const d=f(),u=n?d.v2.colors.white[500]:d.v2.colors.silver[200];return e(Ju,{$selected:n,onClick:o,children:[e(qu,{children:[t(me,{"data-id":`sampling-onboarding-radio-${a}`,value:n,onChange:o,size:fe.L}),t(ji,{size:24,fill:d.v2.colors.white[500]}),t(ae,{size:le.S,weight:500,color:d.v2.colors.white[500],children:a})]}),e(Zu,{children:[e(Qu,{$selected:n,children:[e(W,{$gap:8,children:[t(Be,{...l,textSize:le.XXXS}),t(ae,{size:le.XXS,color:u,children:i})]}),s&&s.length>0&&t(Fu,{color:u,items:s}),r&&e(tp,{children:[t(np,{children:t(Wi,{size:18,fill:d.v2.colors.yellow[500]})}),t(ae,{size:le.XXXS,color:d.v2.colors.yellow[500],children:r})]})]}),c&&t(ep,{children:t(re,{"data-id":`sampling-onboarding-btn-read-more-${a}`,label:_o,rightIcon:ui,variant:de.Text,size:ce.S,onClick:e=>{e.stopPropagation(),c()}})})]})]})},ap=({strategy:o,onStrategyChange:a,onBack:i,onNext:l,docsUrl:s})=>{const r=f(),c=s?()=>window.open(s,"_blank"):void 0;return e(n,{children:[t(Nu,{title:So,onBack:i}),e($u,{$width:854,children:[t(Xu,{children:wo}),e(Yu,{children:[t(op,{selected:"keep-list"===o,onSelect:()=>a("keep-list"),name:Eo,description:Io,badgeProps:{label:$o,backgroundColor:r.v2.colors.purple[500],textColor:r.v2.colors.white[500]},bullets:[ko,To],warning:xo,onReadMore:c}),t(op,{selected:"drop-list"===o,onSelect:()=>a("drop-list"),name:Do,description:Ro,badgeProps:{label:Oo,backgroundColor:r.v2.colors.green[500],textColor:r.v2.colors.black[500]},bullets:[Ao,No],onReadMore:c}),t(op,{selected:"advanced"===o,onSelect:()=>a("advanced"),name:Lo,description:Fo,badgeProps:{label:Po,backgroundColor:r.v2.colors.blue[700],textColor:r.v2.colors.white[500]},onReadMore:c})]})]}),t(Eu,{onNext:l})]})},ip=({onBack:o,onNext:i,submitting:l})=>{const s=f(),r=a(()=>[{title:Xo,bullets:[Mo,zo,Bo]},{title:Wo,bullets:[Vo,Uo,Go,Ho,jo]}],[]);return e(n,{children:[t(Nu,{title:Ko,onBack:o}),e($u,{$width:854,children:[t(Xu,{children:Yo}),t(se,{$gap:16,$width:"100%",$alignItems:"stretch",children:r.map((n,o)=>e(Ru,{fillHeight:!0,width:"50%",children:[t(ae,{size:le.XS,color:s.v2.colors.white[500],children:n.title}),t(Fu,{items:n.bullets})]},o))}),t(_u,{message:Jo})]}),t(Eu,{onNext:i,nextLoading:l})]})},lp=g.div`
553
568
  white-space: pre-line;
554
- `,Yu=({errorPresetEnabled:n,onErrorPresetChange:i,onBack:l,onNext:s,submitting:r})=>{const c=f(),d=a(()=>$(n?{disabled:!1}:null),[n]);return e(o,{children:[t(vu,{title:Zn,onBack:l}),e(gu,{$width:854,children:[t(Au,{children:Qn}),e(W,{$gap:8,$width:"100%",children:[e(Cu,{children:[t(Ku,{children:t(ae,{size:le.XXS,color:c.v2.colors.silver[200],children:ea})}),t(ku,{message:qn})]}),e($u,{children:[e(Eu,{children:[t(ae,{size:le.S,weight:500,color:c.v2.colors.white[500],children:ta}),t(Pi,{size:16,fill:c.v2.colors.silver[200]})]}),t(Iu,{children:t(du,{name:na,recommended:!0,toggleLabel:oa,enabled:n,onEnabledChange:i,summary:d,toggleName:"sampling-onboarding-drop-error-preset-toggle"})})]})]})]}),t(fu,{onNext:s,nextLoading:r})]})},Ju=m.div`
569
+ `,sp=({errorPresetEnabled:o,onErrorPresetChange:i,onBack:l,onNext:s,submitting:r})=>{const c=f(),d=a(()=>$(o?{disabled:!1}:null),[o]);return e(n,{children:[t(Nu,{title:qo,onBack:l}),e($u,{$width:854,children:[t(Xu,{children:Zo}),e(W,{$gap:8,$width:"100%",children:[e(Ru,{children:[t(lp,{children:t(ae,{size:le.XXS,color:c.v2.colors.silver[200],children:Qo})}),t(_u,{message:Jo})]}),e(Mu,{children:[e(zu,{children:[t(ae,{size:le.S,weight:500,color:c.v2.colors.white[500],children:ea}),t(Ri,{size:16,fill:c.v2.colors.silver[200]})]}),t(Bu,{children:t(wu,{name:na,recommended:!0,toggleLabel:ta,enabled:o,onEnabledChange:i,summary:d,toggleName:"sampling-onboarding-drop-error-preset-toggle"})})]})]})]}),t(Eu,{onNext:s,nextLoading:r})]})},rp=g.div`
555
570
  white-space: pre-line;
556
- `,qu=m.div`
571
+ `,cp=g.div`
557
572
  width: fit-content;
558
- `,Zu=["50","25","10","1","0.1"],Qu=({value:o,onChange:n,label:i})=>{const l=f(),s=a(()=>Zu.map(e=>({value:e,label:`${e}%`,selectedBgColor:l.v2.colors.purple[900],selectedBorderColor:l.v2.colors.purple[400]})),[l]);return e(W,{$gap:8,children:[t(ae,{size:le.XS,color:l.v2.colors.white[500],children:i}),t(qu,{children:t(ue,{"data-id":"sampling-onboarding-ambient",options:s,selected:o,setSelected:n})})]})},ep=({errorPresetEnabled:n,onErrorPresetChange:i,ambientPercentage:l,onAmbientPercentageChange:s,onBack:r,onNext:c,submitting:d})=>{const u=f(),p=a(()=>$(n?{disabled:!1}:null),[n]);return e(o,{children:[t(vu,{title:aa,onBack:r}),e(gu,{$width:854,children:[t(Au,{children:ia}),e(W,{$gap:8,$width:"100%",children:[e(Cu,{children:[t(Ju,{children:t(ae,{size:le.XXS,color:u.v2.colors.silver[200],children:la})}),t(xu,{items:[sa,ra,ca,da,ua]}),t(ku,{message:qn})]}),e($u,{children:[e(Eu,{children:[t(ae,{size:le.S,weight:500,color:u.v2.colors.white[500],children:pa}),t(Pi,{size:16,fill:u.v2.colors.silver[200]})]}),t(Iu,{children:t(du,{name:na,recommended:!0,toggleLabel:oa,enabled:n,onEnabledChange:i,summary:p,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(Iu,{children:t(Qu,{value:l,onChange:s,label:ha})})]})]})]}),t(fu,{onNext:c,nextLoading:d})]})},tp=({isOpen:e,onClose:o,k8sHealthProbesConfig:a,samplingId:i,docsUrl:r})=>{const{samplingApi:c}=sl(),[d,u]=s("welcome"),[p,h]=s(!0),[g,m]=s("keep-list"),[f,b]=s(!0),[v,y]=s("25"),[C,S]=s(!1);n(()=>{e&&(u("welcome"),h(a?.enabled??!0),m("keep-list"),b(!0),y("25"),S(!1))},[e,a?.enabled]);const w=l(async()=>{const e=i??"default",t=[];if(p!==(a?.enabled??!1)){const e=c.updateK8sHealthProbesConfig;e&&t.push(e({enabled:p,keepPercentage:a?.keepPercentage??0}))}if("advanced"!==g&&f){const o=c.createHighlyRelevant;o&&t.push(o({samplingId:e,rule:{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}}))}if("keep-list"===g){const o=c.createCostReduction;o&&t.push(o({samplingId:e,rule:{name:"Onboarding - Ambient sampling",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:parseFloat(v)}}))}S(!0);try{await Promise.all(t),u("success")}catch{}finally{S(!1)}},[i,c,p,a?.enabled,a?.keepPercentage,g,f,v]);let x=null;switch(d){case"welcome":x=t(Lu,{onSkip:o,onNext:()=>u("noisy")});break;case"noisy":x=t(Ou,{enabled:p,onEnabledChange:h,onBack:()=>u("welcome"),onNext:()=>u("strategy")});break;case"strategy":x=t(ju,{strategy:g,onStrategyChange:m,onBack:()=>u("noisy"),onNext:()=>{u("keep-list"===g?"keep-list":"drop-list"===g?"drop-list":"advanced")},docsUrl:r});break;case"keep-list":x=t(ep,{errorPresetEnabled:f,onErrorPresetChange:b,ambientPercentage:v,onAmbientPercentageChange:y,onBack:()=>u("strategy"),onNext:w,submitting:C});break;case"drop-list":x=t(Yu,{errorPresetEnabled:f,onErrorPresetChange:b,onBack:()=>u("strategy"),onNext:w,submitting:C});break;case"advanced":x=t(Wu,{onBack:()=>u("strategy"),onNext:w,submitting:C});break;case"success":x=t(Du,{onClose:o})}return t(Go,{isOpen:e,onClose:o,children:x})};var op,np;!function(e){e.BulkConfig="bulk-config",e.BulkSource="bulk-source",e.BulkDestination="bulk-destination",e.BulkAction="bulk-action",e.BulkInstrumentationRule="bulk-instrumentation-rule",e.Delete="delete"}(op||(op={})),function(e){e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"}(np||(np={}));const ap=[{key:np.Name,label:"Name"},{key:np.Type,label:"Type",textAlign:"right"},{key:np.Status,label:"Status"},{key:np.OdigosVersion,label:"Odigos Version"},{key:np.ConnectedSince,label:"Connected Since"},{key:np.LastActivity,label:"Last Activity"}],ip=(e,t)=>{const o=e.find(e=>e.key===np.Id)?.rawValue;return t(o?.toString()||"")},lp=e=>{const{connections:t,configMinSupportedVersion:o,snapshotMinSupportedVersion:n,onDelete:a,onAddSource:i,onAddDestination:l,onAddAction:s,onAddInstrumentationRule:r,onEditConfiguration:c}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===np.Status)?.rawValue===Ee.Success)(e))return[{id:Uo(),label:"Delete Connection",rightIcon:gi,onClick:()=>ip(e,a)}];const d=ip(e,e=>{const n=t.find(t=>t.id===e);return!!n&&E(n.odigosVersion,o)}),u=ip(e,e=>{const o=t.find(t=>t.id===e);return!!o&&E(o.odigosVersion,n)}),p=[];return i&&p.push({id:Uo(),tooltip:u?He.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${n} or later.`,rightIcon:$i,disabled:!u,onClick:()=>ip(e,i)}),l&&p.push({id:Uo(),tooltip:He.ADD_DESTINATION,rightIcon:Ci,onClick:()=>ip(e,l)}),s&&p.push({id:Uo(),tooltip:He.ADD_ACTION,rightIcon:yi,onClick:()=>ip(e,s)}),r&&p.push({id:Uo(),tooltip:He.ADD_INSTRUMENTATION_RULE,rightIcon:ki,onClick:()=>ip(e,r)}),c&&p.push({id:Uo(),tooltip:d?"Edit Configuration":`To use this feature, please upgrade to Odigos v${o} or later.`,rightIcon:Ii,disabled:!d,onClick:()=>ip(e,c)}),p}},sp=({connections:o,getConnections:i,onClickConnection:r,deleteConnection:c,configMinSupportedVersion:d=0,snapshotMinSupportedVersion:u=0})=>{const p=f(),{formatTimeAgo:h}=Bt(),{capabilities:g}=sl(),[m,b]=s(!1),[v,y]=s(o||[]),C=l(async()=>{try{b(!0),y(await i()??[])}catch(e){}finally{b(!1)}},[]);n(()=>{v.length||C()},[]);const[S,w]=s(""),[x,T]=s(null),[k,$]=s([]),I=a(()=>x===op.BulkConfig?d:x===op.BulkSource?u:0,[x,d,u]),{supportedConnections:A,supportedConnectionIds:N}=a(()=>{const e=((e,t)=>e.filter(e=>{const o=e.status===Ee.Success,n=E(e.odigosVersion,t);return o&&n}))(v,I);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[v,I]);n(()=>{if(!x||x===op.Delete)return;const e=k.filter(e=>!N.includes(e));e.length&&$(t=>t.filter(t=>!e.includes(t)))},[x,k.length,N.length]);const O=a(()=>v.filter(e=>!S||e.name.toLowerCase().includes(S.toLowerCase())).map(e=>({cells:[{key:np.Id,rawValue:e.id},{key:np.Name,rawValue:e.name},{key:np.Type,rawValue:e.type},{key:np.Status,rawValue:e.status,component:()=>(e=>{const o=e===Ee.Success?"Connection live":"Connection lost",n=e===Ee.Success?xi:Ti;return t(Be,{status:e,label:o,leftIcon:n})})(e.status)},{key:np.OdigosVersion,rawValue:e.odigosVersion},{key:np.ConnectedSince,rawValue:e.connectedAt?h(e.connectedAt):"-"},{key:np.LastActivity,rawValue:e.lastSeenAt?h(e.lastSeenAt):"-"}],onClick:e.status!==Ee.Success||x?void 0:()=>r(e),isSelected:k.includes(e.id),onSelect:()=>$(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>$(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==Ee.Success||x===op.BulkConfig&&!E(e.odigosVersion,d)||x===op.BulkSource&&!E(e.odigosVersion,u)})),[v,k,S,x,d,u,h,r]),R=a(()=>{const e=(e,t)=>{$([e]),T(t)};return lp({connections:v,configMinSupportedVersion:d,snapshotMinSupportedVersion:u,onDelete:t=>e(t,op.Delete),onAddSource:g.canFetchSnapshots&&g.canBulkPersistSources?t=>e(t,op.BulkSource):void 0,onAddDestination:g.canFetchDestinationCategories&&g.canFetchPotentialDestinations&&g.canCreateDestination?t=>e(t,op.BulkDestination):void 0,onAddAction:g.canCreateAction?t=>e(t,op.BulkAction):void 0,onAddInstrumentationRule:g.canCreateInstrumentationRule?t=>e(t,op.BulkInstrumentationRule):void 0,onEditConfiguration:g.canApplyEffectiveConfig?t=>e(t,op.BulkConfig):void 0})},[v,d,u,g]),D=a(()=>(e=>{const{onCancel:t,onAddSource:o,onAddDestination:n,onAddAction:a,onAddInstrumentationRule:i,onManageConfigurations:l}=e,s=[];o&&s.push({id:Uo(),type:qt.Button,buttonProps:{variant:de.Primary,size:ce.S,label:"Add Sources",rightIcon:$i,onClick:o}});const r=[n?{id:op.BulkDestination,label:He.ADD_DESTINATION,icon:Ci}:null,a?{id:op.BulkAction,label:He.ADD_ACTION,icon:yi}:null,i?{id:op.BulkInstrumentationRule,label:He.ADD_INSTRUMENTATION_RULE,icon:ki}:null,l?{id:op.BulkConfig,label:"Manage Configurations",icon:Ii}:null];return r.some(Boolean)&&s.push({id:Uo(),type:qt.ButtonDropData,buttonProps:{variant:de.Secondary,size:ce.S,label:"Bulk Operations",onClick:e=>{e===op.BulkSource?o?.():e===op.BulkDestination?n?.():e===op.BulkAction?a?.():e===op.BulkInstrumentationRule?i?.():e===op.BulkConfig&&l?.()}},dropDataProps:{alignX:Vo.Left,items:r}}),s.push({id:Uo(),type:qt.Button,buttonProps:{variant:de.Text,size:ce.S,label:kt.CANCEL,onClick:t}}),s})({onCancel:()=>$([]),onAddSource:g.canFetchSnapshots&&g.canBulkPersistSources?()=>T(op.BulkSource):void 0,onAddDestination:g.canFetchDestinationCategories&&g.canFetchPotentialDestinations&&g.canCreateDestination?()=>T(op.BulkDestination):void 0,onAddAction:g.canCreateAction?()=>T(op.BulkAction):void 0,onAddInstrumentationRule:g.canCreateInstrumentationRule?()=>T(op.BulkInstrumentationRule):void 0,onManageConfigurations:g.canApplyEffectiveConfig?()=>T(op.BulkConfig):void 0}),[g]);return t(ga,{children:e(et,{fullHeight:!0,richTitle:{icon:Qi,title:He.CONNECTIONS,badge:{label:v.length.toString(),status:ft.Unknown}},search:{placeholder:"Search by cluster name",value:S,onChange:e=>w(e),width:"300px"},actions:[{id:Uo(),type:qt.Button,buttonProps:{variant:de.Secondary,size:ce.S,leftIcon:Ri,onClick:C,disabled:m}}],children:[t(vo,{variant:yo.Pretty,headerBackgroundColor:p.v2.colors.silver[1e3],isLoading:m,withCheckboxes:!0,columns:ap,rows:O,rowActionsPushRightPosition:x?`calc(${$l} - 24px)`:void 0,getRowActions:R}),x===op.BulkConfig&&g.canApplyEffectiveConfig&&t(Il,{connectionIds:k,children:t(Br,{onClose:()=>T(null),connections:A,selectedConnectionIds:k,setSelectedConnectionIds:$})}),x===op.BulkSource&&g.canFetchSnapshots&&g.canBulkPersistSources&&t(Il,{connectionIds:k,children:t(Vl,{selectedConnectionIds:k,children:t(_r,{onClose:()=>T(null),selectedConnectionIds:k,setSelectedConnectionIds:$})})}),x===op.BulkDestination&&g.canFetchDestinationCategories&&g.canFetchPotentialDestinations&&g.canTestConnection&&g.canCreateDestination&&t(Il,{connectionIds:k,children:t(Ul,{children:t(fr,{onClose:()=>T(null),selectedConnectionIds:k,setSelectedConnectionIds:$})})}),x===op.BulkAction&&g.canCreateAction&&t(Il,{connectionIds:k,children:t(Hl,{children:t(lr,{onClose:()=>T(null),selectedConnectionIds:k,setSelectedConnectionIds:$})})}),x===op.BulkInstrumentationRule&&g.canCreateInstrumentationRule&&t(Il,{connectionIds:k,children:t(Gl,{children:t(br,{onClose:()=>T(null),selectedConnectionIds:k,setSelectedConnectionIds:$})})}),t(wl,{target:"connection",isOpen:x===op.Delete,onClose:()=>{$([]),T(null)},onApprove:async()=>{const e=k[0];e&&(await c(e),await C())}}),t(ma,{isOpen:!!k.length&&!x,richTitle:{icon:ui,title:"Selected Clusters",badge:{label:k.length}},actions:D})]})})},rp=m.div`
573
+ `,dp=["50","25","10","1","0.1"],up=({value:n,onChange:o,label:i})=>{const l=f(),s=a(()=>dp.map(e=>({value:e,label:`${e}%`,selectedBgColor:l.v2.colors.purple[900],selectedBorderColor:l.v2.colors.purple[400]})),[l]);return e(W,{$gap:8,children:[t(ae,{size:le.XS,color:l.v2.colors.white[500],children:i}),t(cp,{children:t(ue,{"data-id":"sampling-onboarding-ambient",options:s,selected:n,setSelected:o})})]})},pp=({errorPresetEnabled:o,onErrorPresetChange:i,ambientPercentage:l,onAmbientPercentageChange:s,onBack:r,onNext:c,submitting:d})=>{const u=f(),p=a(()=>$(o?{disabled:!1}:null),[o]);return e(n,{children:[t(Nu,{title:oa,onBack:r}),e($u,{$width:854,children:[t(Xu,{children:aa}),e(W,{$gap:8,$width:"100%",children:[e(Ru,{children:[t(rp,{children:t(ae,{size:le.XXS,color:u.v2.colors.silver[200],children:ia})}),t(Fu,{items:[la,sa,ra,ca,da]}),t(_u,{message:Jo})]}),e(Mu,{children:[e(zu,{children:[t(ae,{size:le.S,weight:500,color:u.v2.colors.white[500],children:ua}),t(Ri,{size:16,fill:u.v2.colors.silver[200]})]}),t(Bu,{children:t(wu,{name:na,recommended:!0,toggleLabel:ta,enabled:o,onEnabledChange:i,summary:p,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(Bu,{children:t(up,{value:l,onChange:s,label:pa})})]})]})]}),t(Eu,{onNext:c,nextLoading:d})]})},hp=({isOpen:e,onClose:n,k8sHealthProbesConfig:a,samplingId:i,docsUrl:r})=>{const{samplingApi:c}=ll(),[d,u]=s("welcome"),[p,h]=s(!0),[m,g]=s("keep-list"),[f,b]=s(!0),[v,y]=s("25"),[C,S]=s(!1);o(()=>{e&&(u("welcome"),h(a?.enabled??!0),g("keep-list"),b(!0),y("25"),S(!1))},[e,a?.enabled]);const w=l(async()=>{const e=i??"default",t=[];if(p!==(a?.enabled??!1)){const e=c.updateK8sHealthProbesConfig;e&&t.push(e({enabled:p,keepPercentage:a?.keepPercentage??0}))}if("advanced"!==m&&f){const n=c.createHighlyRelevant;n&&t.push(n({samplingId:e,rule:{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}}))}if("keep-list"===m){const n=c.createCostReduction;n&&t.push(n({samplingId:e,rule:{name:"Onboarding - Ambient sampling",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:parseFloat(v)}}))}S(!0);try{await Promise.all(t),u("success")}catch{}finally{S(!1)}},[i,c,p,a?.enabled,a?.keepPercentage,m,f,v]);let x=null;switch(d){case"welcome":x=t(Ku,{onSkip:n,onNext:()=>u("noisy")});break;case"noisy":x=t(Uu,{enabled:p,onEnabledChange:h,onBack:()=>u("welcome"),onNext:()=>u("strategy")});break;case"strategy":x=t(ap,{strategy:m,onStrategyChange:g,onBack:()=>u("noisy"),onNext:()=>{u("keep-list"===m?"keep-list":"drop-list"===m?"drop-list":"advanced")},docsUrl:r});break;case"keep-list":x=t(pp,{errorPresetEnabled:f,onErrorPresetChange:b,ambientPercentage:v,onAmbientPercentageChange:y,onBack:()=>u("strategy"),onNext:w,submitting:C});break;case"drop-list":x=t(sp,{errorPresetEnabled:f,onErrorPresetChange:b,onBack:()=>u("strategy"),onNext:w,submitting:C});break;case"advanced":x=t(ip,{onBack:()=>u("strategy"),onNext:w,submitting:C});break;case"success":x=t(Hu,{onClose:n})}return t(Gn,{isOpen:e,onClose:n,children:x})};var mp,gp;!function(e){e.BulkConfig="bulk-config",e.BulkSource="bulk-source",e.BulkDestination="bulk-destination",e.BulkAction="bulk-action",e.BulkInstrumentationRule="bulk-instrumentation-rule",e.Delete="delete"}(mp||(mp={})),function(e){e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"}(gp||(gp={}));const fp=[{key:gp.Name,label:"Name"},{key:gp.Type,label:"Type",textAlign:"right"},{key:gp.Status,label:"Status"},{key:gp.OdigosVersion,label:"Odigos Version"},{key:gp.ConnectedSince,label:"Connected Since"},{key:gp.LastActivity,label:"Last Activity"}],bp=(e,t)=>{const n=e.find(e=>e.key===gp.Id)?.rawValue;return t(n?.toString()||"")},vp=e=>{const{connections:t,configMinSupportedVersion:n,snapshotMinSupportedVersion:o,onDelete:a,onAddSource:i,onAddDestination:l,onAddAction:s,onAddInstrumentationRule:r,onEditConfiguration:c}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===gp.Status)?.rawValue===Ie.Success)(e))return[{id:Vn(),label:"Delete Connection",rightIcon:pi,onClick:()=>bp(e,a)}];const d=bp(e,e=>{const o=t.find(t=>t.id===e);return!!o&&I(o.odigosVersion,n)}),u=bp(e,e=>{const n=t.find(t=>t.id===e);return!!n&&I(n.odigosVersion,o)}),p=[];return i&&p.push({id:Vn(),tooltip:u?Ge.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${o} or later.`,rightIcon:ki,disabled:!u,onClick:()=>bp(e,i)}),l&&p.push({id:Vn(),tooltip:Ge.ADD_DESTINATION,rightIcon:vi,onClick:()=>bp(e,l)}),s&&p.push({id:Vn(),tooltip:Ge.ADD_ACTION,rightIcon:bi,onClick:()=>bp(e,s)}),r&&p.push({id:Vn(),tooltip:Ge.ADD_INSTRUMENTATION_RULE,rightIcon:xi,onClick:()=>bp(e,r)}),c&&p.push({id:Vn(),tooltip:d?"Edit Configuration":`To use this feature, please upgrade to Odigos v${n} or later.`,rightIcon:$i,disabled:!d,onClick:()=>bp(e,c)}),p}},yp=({connections:n,getConnections:i,onClickConnection:r,deleteConnection:c,configMinSupportedVersion:d=0,snapshotMinSupportedVersion:u=0})=>{const p=f(),{formatTimeAgo:h}=zt(),{capabilities:m}=ll(),[g,b]=s(!1),[v,y]=s(n||[]),C=l(async()=>{try{b(!0),y(await i()??[])}catch(e){}finally{b(!1)}},[]);o(()=>{v.length||C()},[]);const[S,w]=s(""),[x,k]=s(null),[T,$]=s([]),E=a(()=>x===mp.BulkConfig?d:x===mp.BulkSource?u:0,[x,d,u]),{supportedConnections:A,supportedConnectionIds:N}=a(()=>{const e=((e,t)=>e.filter(e=>{const n=e.status===Ie.Success,o=I(e.odigosVersion,t);return n&&o}))(v,E);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[v,E]);o(()=>{if(!x||x===mp.Delete)return;const e=T.filter(e=>!N.includes(e));e.length&&$(t=>t.filter(t=>!e.includes(t)))},[x,T.length,N.length]);const O=a(()=>v.filter(e=>!S||e.name.toLowerCase().includes(S.toLowerCase())).map(e=>({cells:[{key:gp.Id,rawValue:e.id},{key:gp.Name,rawValue:e.name},{key:gp.Type,rawValue:e.type},{key:gp.Status,rawValue:e.status,component:()=>(e=>{const n=e===Ie.Success?"Connection live":"Connection lost",o=e===Ie.Success?Si:wi;return t(Be,{status:e,label:n,leftIcon:o})})(e.status)},{key:gp.OdigosVersion,rawValue:e.odigosVersion},{key:gp.ConnectedSince,rawValue:e.connectedAt?h(e.connectedAt):"-"},{key:gp.LastActivity,rawValue:e.lastSeenAt?h(e.lastSeenAt):"-"}],onClick:e.status!==Ie.Success||x?void 0:()=>r(e),isSelected:T.includes(e.id),onSelect:()=>$(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>$(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==Ie.Success||x===mp.BulkConfig&&!I(e.odigosVersion,d)||x===mp.BulkSource&&!I(e.odigosVersion,u)})),[v,T,S,x,d,u,h,r]),R=a(()=>{const e=(e,t)=>{$([e]),k(t)};return vp({connections:v,configMinSupportedVersion:d,snapshotMinSupportedVersion:u,onDelete:t=>e(t,mp.Delete),onAddSource:m.canFetchSnapshots&&m.canBulkPersistSources?t=>e(t,mp.BulkSource):void 0,onAddDestination:m.canFetchDestinationCategories&&m.canFetchPotentialDestinations&&m.canCreateDestination?t=>e(t,mp.BulkDestination):void 0,onAddAction:m.canCreateAction?t=>e(t,mp.BulkAction):void 0,onAddInstrumentationRule:m.canCreateInstrumentationRule?t=>e(t,mp.BulkInstrumentationRule):void 0,onEditConfiguration:m.canApplyEffectiveConfig?t=>e(t,mp.BulkConfig):void 0})},[v,d,u,m]),D=a(()=>(e=>{const{onCancel:t,onAddSource:n,onAddDestination:o,onAddAction:a,onAddInstrumentationRule:i,onManageConfigurations:l}=e,s=[];n&&s.push({id:Vn(),type:Yt.Button,buttonProps:{variant:de.Primary,size:ce.S,label:"Add Sources",rightIcon:ki,onClick:n}});const r=[o?{id:mp.BulkDestination,label:Ge.ADD_DESTINATION,icon:vi}:null,a?{id:mp.BulkAction,label:Ge.ADD_ACTION,icon:bi}:null,i?{id:mp.BulkInstrumentationRule,label:Ge.ADD_INSTRUMENTATION_RULE,icon:xi}:null,l?{id:mp.BulkConfig,label:"Manage Configurations",icon:$i}:null];return r.some(Boolean)&&s.push({id:Vn(),type:Yt.ButtonDropData,buttonProps:{variant:de.Secondary,size:ce.S,label:"Bulk Operations",onClick:e=>{e===mp.BulkSource?n?.():e===mp.BulkDestination?o?.():e===mp.BulkAction?a?.():e===mp.BulkInstrumentationRule?i?.():e===mp.BulkConfig&&l?.()}},dropDataProps:{alignX:Xn.Left,items:r}}),s.push({id:Vn(),type:Yt.Button,buttonProps:{variant:de.Text,size:ce.S,label:kt.CANCEL,onClick:t}}),s})({onCancel:()=>$([]),onAddSource:m.canFetchSnapshots&&m.canBulkPersistSources?()=>k(mp.BulkSource):void 0,onAddDestination:m.canFetchDestinationCategories&&m.canFetchPotentialDestinations&&m.canCreateDestination?()=>k(mp.BulkDestination):void 0,onAddAction:m.canCreateAction?()=>k(mp.BulkAction):void 0,onAddInstrumentationRule:m.canCreateInstrumentationRule?()=>k(mp.BulkInstrumentationRule):void 0,onManageConfigurations:m.canApplyEffectiveConfig?()=>k(mp.BulkConfig):void 0}),[m]);return t(ha,{children:e(et,{fullHeight:!0,richTitle:{icon:Zi,title:Ge.CONNECTIONS,badge:{label:v.length.toString(),status:Ie.Unknown}},search:{placeholder:"Search by cluster name",value:S,onChange:e=>w(e),width:"300px"},actions:[{id:Vn(),type:Yt.Button,buttonProps:{variant:de.Secondary,size:ce.S,leftIcon:Ni,onClick:C,disabled:g}}],children:[t(fn,{variant:bn.Pretty,headerBackgroundColor:p.v2.colors.silver[1e3],isLoading:g,withCheckboxes:!0,columns:fp,rows:O,rowActionsPushRightPosition:x?`calc(${Tl} - 24px)`:void 0,getRowActions:R}),x===mp.BulkConfig&&m.canApplyEffectiveConfig&&t(Il,{connectionIds:T,children:t(zr,{onClose:()=>k(null),connections:A,selectedConnectionIds:T,setSelectedConnectionIds:$})}),x===mp.BulkSource&&m.canFetchSnapshots&&m.canBulkPersistSources&&t(Il,{connectionIds:T,children:t(Xl,{selectedConnectionIds:T,children:t(Lr,{onClose:()=>k(null),selectedConnectionIds:T,setSelectedConnectionIds:$})})}),x===mp.BulkDestination&&m.canFetchDestinationCategories&&m.canFetchPotentialDestinations&&m.canTestConnection&&m.canCreateDestination&&t(Il,{connectionIds:T,children:t(Vl,{children:t(gr,{onClose:()=>k(null),selectedConnectionIds:T,setSelectedConnectionIds:$})})}),x===mp.BulkAction&&m.canCreateAction&&t(Il,{connectionIds:T,children:t(Ul,{children:t(ir,{onClose:()=>k(null),selectedConnectionIds:T,setSelectedConnectionIds:$})})}),x===mp.BulkInstrumentationRule&&m.canCreateInstrumentationRule&&t(Il,{connectionIds:T,children:t(Gl,{children:t(fr,{onClose:()=>k(null),selectedConnectionIds:T,setSelectedConnectionIds:$})})}),t(Sl,{target:"connection",isOpen:x===mp.Delete,onClose:()=>{$([]),k(null)},onApprove:async()=>{const e=T[0];e&&(await c(e),await C())}}),t(vn,{isOpen:!!T.length&&!x,richTitle:{icon:ci,title:"Selected Clusters",badge:{label:T.length}},actions:D})]})})},Cp=g.div`
559
574
  display: flex;
560
575
  align-items: center;
561
576
  justify-content: space-between;
@@ -564,26 +579,26 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
564
579
  width: 100%;
565
580
  border-radius: 16px;
566
581
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
567
- `,cp=m.div`
582
+ `,Sp=g.div`
568
583
  display: flex;
569
584
  align-items: center;
570
585
  justify-content: center;
571
586
  padding: 8px;
572
587
  border-radius: 8px;
573
- background-color: ${({theme:e})=>e.v2.colors.white[500]+ot["004"]};
574
- `,dp=({setStep:o,onSave:n,sourcesPayload:i,destinationsPayload:l,disableAnimation:s})=>{const r=f(),c=()=>o(2),d=()=>o(3),u=a(()=>Object.values(i||{}).flatMap((o,n)=>o.map((o,a)=>{if(!o.selected)return null;const i=o.kind||mt.Namespace,l=i===mt.Namespace?o.namespace:`${o.namespace} → ${o.name}`;return e(rp,{children:[t(ae,{nowrap:!0,children:l}),t(Be,{label:i,status:Ee.Info,backgroundColor:r.v2.colors.blue[900]})]},`source-${n}-${a}`)})).filter(Boolean),[i]),p=a(()=>l?.map((o,n)=>{const a=ut(o.option.type).icon;return e(rp,{children:[e(se,{$gap:8,children:[a&&t(cp,{children:t(a,{size:24})}),t(ae,{nowrap:!0,children:o.formData.name||o.option.displayName})]}),void 0!==o.testResult&&t(Be,{status:o.testResult.succeeded?Ee.Success:Ee.Error,leftIcon:o.testResult.succeeded?xi:Ti})]},`destination-${n}`)})||[],[l]);return t(Sl,{isOpen:!0,disableAnimation:s,onBack:()=>o(3),onSave:n,header:{icon:Ni,title:He.SUMMARY,subTitle:He.REVIEW_SETUP},leftColumn:{width:"50%",header:e(se,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(se,{$gap:8,children:[t($i,{size:24}),t(ae,{nowrap:!0,children:He.SELECTED_SOURCES}),t(Be,{label:u.length})]}),t(re,{"data-id":"summary-edit-sources",leftIcon:mi,variant:de.Secondary,size:ce.S,onClick:c})]}),list:u.length?u:[t(at,{$height:"100%",children:t(Ce,{icon:$i,title:He.NO_SOURCES_SELECTED,subTitle:He.ADD_SOURCE_PROMPT,button:{leftIcon:ci,label:He.ADD_SOURCE,onClick:c}})},"no-sources-data")]},rightColumn:{width:"50%",header:e(se,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(se,{$gap:8,children:[t(Ci,{size:24}),t(ae,{nowrap:!0,children:He.SELECTED_DESTINATIONS}),t(Be,{label:p.length})]}),t(re,{"data-id":"summary-edit-destinations",leftIcon:mi,variant:de.Secondary,size:ce.S,onClick:d})]}),list:p.length?p:[t(at,{"data-id":"summary-no-destinations",$height:"100%",children:t(Ce,{icon:Ci,title:He.NO_DESTINATIONS_SELECTED,subTitle:He.ADD_DESTINATION_PROMPT,button:{leftIcon:ci,label:He.ADD_DESTINATIONS,onClick:d}})},"no-destinations-data")]}})},up=m.div`
588
+ background-color: ${({theme:e})=>e.v2.colors.white[500]+nt["004"]};
589
+ `,wp=({setStep:n,onSave:o,sourcesPayload:i,destinationsPayload:l,disableAnimation:s})=>{const r=f(),c=()=>n(2),d=()=>n(3),u=a(()=>Object.values(i||{}).flatMap((n,o)=>n.map((n,a)=>{if(!n.selected)return null;const i=n.kind||gt.Namespace,l=i===gt.Namespace?n.namespace:`${n.namespace} → ${n.name}`;return e(Cp,{children:[t(ae,{nowrap:!0,children:l}),t(Be,{label:i,status:Ie.Info,backgroundColor:r.v2.colors.blue[900]})]},`source-${o}-${a}`)})).filter(Boolean),[i]),p=a(()=>l?.map((n,o)=>{const a=ut(n.option.type).icon;return e(Cp,{children:[e(se,{$gap:8,children:[a&&t(Sp,{children:t(a,{size:24})}),t(ae,{nowrap:!0,children:n.formData.name||n.option.displayName})]}),void 0!==n.testResult&&t(Be,{status:n.testResult.succeeded?Ie.Success:Ie.Error,leftIcon:n.testResult.succeeded?Si:wi})]},`destination-${o}`)})||[],[l]);return t(Cl,{isOpen:!0,disableAnimation:s,onBack:()=>n(3),onSave:o,header:{icon:Ei,title:Ge.SUMMARY,subTitle:Ge.REVIEW_SETUP},leftColumn:{width:"50%",header:e(se,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(se,{$gap:8,children:[t(ki,{size:24}),t(ae,{nowrap:!0,children:Ge.SELECTED_SOURCES}),t(Be,{label:u.length})]}),t(re,{"data-id":"summary-edit-sources",leftIcon:hi,variant:de.Secondary,size:ce.S,onClick:c})]}),list:u.length?u:[t(at,{$height:"100%",children:t(Ce,{icon:ki,title:Ge.NO_SOURCES_SELECTED,subTitle:Ge.ADD_SOURCE_PROMPT,button:{leftIcon:si,label:Ge.ADD_SOURCE,onClick:c}})},"no-sources-data")]},rightColumn:{width:"50%",header:e(se,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(se,{$gap:8,children:[t(vi,{size:24}),t(ae,{nowrap:!0,children:Ge.SELECTED_DESTINATIONS}),t(Be,{label:p.length})]}),t(re,{"data-id":"summary-edit-destinations",leftIcon:hi,variant:de.Secondary,size:ce.S,onClick:d})]}),list:p.length?p:[t(at,{"data-id":"summary-no-destinations",$height:"100%",children:t(Ce,{icon:vi,title:Ge.NO_DESTINATIONS_SELECTED,subTitle:Ge.ADD_DESTINATION_PROMPT,button:{leftIcon:si,label:Ge.ADD_DESTINATIONS,onClick:d}})},"no-destinations-data")]}})},xp=g.div`
575
590
  position: relative;
576
591
  overflow: hidden;
577
592
  width: 100vw;
578
593
  height: 100vh;
579
594
  box-sizing: border-box;
580
- `,pp=m.svg`
595
+ `,kp=g.svg`
581
596
  position: absolute;
582
597
  top: 50%;
583
598
  left: 50%;
584
599
  transform: translate(-50%, -50%);
585
600
  z-index: -1;
586
- `,hp=[{opacity:"0.1"},{offset:"0.31",opacity:"0.11"},{offset:"0.45",opacity:"0.14"},{offset:"0.56",opacity:"0.19"},{offset:"0.65",opacity:"0.26"},{offset:"0.73",opacity:"0.35"},{offset:"0.8",opacity:"0.46"},{offset:"0.86",opacity:"0.6"},{offset:"0.92",opacity:"0.76"},{offset:"0.98",opacity:"0.93"},{offset:"1"}],gp=[{width:1440,height:900,pathOpacity:.1,path:"M719.992 1169.99C322.351 1169.99 0 847.64 0 450C0 52.3591 322.351 -269.992 719.992 -269.992C1117.63 -269.992 1439.98 52.3591 1439.98 450C1439.98 847.64 1117.63 1169.99 719.992 1169.99Z",gradientTransform:"translate(814.309 444.011) rotate(180) scale(718.904)",stops:[{opacity:"0.1"},{offset:"0.41",opacity:"0.11"},{offset:"0.56",opacity:"0.13"},{offset:"0.67",opacity:"0.18"},{offset:"0.75",opacity:"0.25"},{offset:"0.83",opacity:"0.33"},{offset:"0.89",opacity:"0.44"},{offset:"0.95",opacity:"0.56"},{offset:"1",opacity:"0.7"}]},{width:1343,height:900,pathOpacity:.3,path:"M671.344 1121.34C300.571 1121.34 0 820.773 0 450C0 79.2264 300.571 -221.345 671.344 -221.345C1042.12 -221.345 1342.69 79.2264 1342.69 450C1342.69 820.773 1042.12 1121.34 671.344 1121.34Z",gradientTransform:"translate(644.026 441.551) rotate(180) scale(581.31)",stops:hp},{width:1163,height:900,pathOpacity:.5,path:"M581.31 1031.31C260.261 1031.31 0 771.048 0 449.999C0 128.951 260.261 -131.311 581.31 -131.311C902.358 -131.311 1162.62 128.951 1162.62 449.999C1162.62 771.048 902.358 1031.31 581.31 1031.31Z",gradientTransform:"translate(644.026 441.551) rotate(180) scale(581.31)",stops:hp},{width:798,height:798,pathOpacity:.7,path:"M398.581 797.162C178.451 797.162 0 618.711 0 398.581C0 178.451 178.451 0 398.581 0C618.711 0 797.162 178.451 797.162 398.581C797.162 618.711 618.711 797.162 398.581 797.162Z",gradientTransform:"translate(445.003 392.441) rotate(180) scale(398.23)",stops:hp}],mp=({paddingXAxis:o="0px",paddingYAxis:i="0px",children:l})=>{const[r,c]=s(window.innerWidth),d=a(()=>r/gp[0].width,[r]);return n(()=>{const e=()=>c(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e(up,{$paddingXAxis:o,$paddingYAxis:i,children:[gp.map(({width:o,height:n,pathOpacity:a,path:i,gradientTransform:l,stops:s},r)=>{const c=`purple-ring-${r}`;return e(pp,{width:o*d,height:"100%",viewBox:`0 0 ${o} ${n}`,fill:"none",children:[t("path",{opacity:a,d:i,fill:`url(#${c})`}),t("defs",{children:t("radialGradient",{id:c,cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:l,children:s.map(({offset:e,opacity:o},n)=>t("stop",{offset:e,stopColor:"#7C3BFF",stopOpacity:o},n))})})]},c)}),l]})},fp=m.div`
601
+ `,Tp=[{opacity:"0.1"},{offset:"0.31",opacity:"0.11"},{offset:"0.45",opacity:"0.14"},{offset:"0.56",opacity:"0.19"},{offset:"0.65",opacity:"0.26"},{offset:"0.73",opacity:"0.35"},{offset:"0.8",opacity:"0.46"},{offset:"0.86",opacity:"0.6"},{offset:"0.92",opacity:"0.76"},{offset:"0.98",opacity:"0.93"},{offset:"1"}],$p=[{width:1440,height:900,pathOpacity:.1,path:"M719.992 1169.99C322.351 1169.99 0 847.64 0 450C0 52.3591 322.351 -269.992 719.992 -269.992C1117.63 -269.992 1439.98 52.3591 1439.98 450C1439.98 847.64 1117.63 1169.99 719.992 1169.99Z",gradientTransform:"translate(814.309 444.011) rotate(180) scale(718.904)",stops:[{opacity:"0.1"},{offset:"0.41",opacity:"0.11"},{offset:"0.56",opacity:"0.13"},{offset:"0.67",opacity:"0.18"},{offset:"0.75",opacity:"0.25"},{offset:"0.83",opacity:"0.33"},{offset:"0.89",opacity:"0.44"},{offset:"0.95",opacity:"0.56"},{offset:"1",opacity:"0.7"}]},{width:1343,height:900,pathOpacity:.3,path:"M671.344 1121.34C300.571 1121.34 0 820.773 0 450C0 79.2264 300.571 -221.345 671.344 -221.345C1042.12 -221.345 1342.69 79.2264 1342.69 450C1342.69 820.773 1042.12 1121.34 671.344 1121.34Z",gradientTransform:"translate(644.026 441.551) rotate(180) scale(581.31)",stops:Tp},{width:1163,height:900,pathOpacity:.5,path:"M581.31 1031.31C260.261 1031.31 0 771.048 0 449.999C0 128.951 260.261 -131.311 581.31 -131.311C902.358 -131.311 1162.62 128.951 1162.62 449.999C1162.62 771.048 902.358 1031.31 581.31 1031.31Z",gradientTransform:"translate(644.026 441.551) rotate(180) scale(581.31)",stops:Tp},{width:798,height:798,pathOpacity:.7,path:"M398.581 797.162C178.451 797.162 0 618.711 0 398.581C0 178.451 178.451 0 398.581 0C618.711 0 797.162 178.451 797.162 398.581C797.162 618.711 618.711 797.162 398.581 797.162Z",gradientTransform:"translate(445.003 392.441) rotate(180) scale(398.23)",stops:Tp}],Ip=({paddingXAxis:n="0px",paddingYAxis:i="0px",children:l})=>{const[r,c]=s(window.innerWidth),d=a(()=>r/$p[0].width,[r]);return o(()=>{const e=()=>c(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e(xp,{$paddingXAxis:n,$paddingYAxis:i,children:[$p.map(({width:n,height:o,pathOpacity:a,path:i,gradientTransform:l,stops:s},r)=>{const c=`purple-ring-${r}`;return e(kp,{width:n*d,height:"100%",viewBox:`0 0 ${n} ${o}`,fill:"none",children:[t("path",{opacity:a,d:i,fill:`url(#${c})`}),t("defs",{children:t("radialGradient",{id:c,cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:l,children:s.map(({offset:e,opacity:n},o)=>t("stop",{offset:e,stopColor:"#7C3BFF",stopOpacity:n},o))})})]},c)}),l]})},Ep=g.div`
587
602
  display: flex;
588
603
  flex-direction: column;
589
604
  align-items: center;
@@ -594,7 +609,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
594
609
  width: 50vw;
595
610
  border-radius: 16px;
596
611
  background: ${({theme:e})=>e.v2.colors.silver[900]};
597
- `,bp=m.div`
612
+ `,Ap=g.div`
598
613
  display: flex;
599
614
  flex-direction: column;
600
615
  align-items: center;
@@ -604,15 +619,15 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
604
619
  & * {
605
620
  text-align: center;
606
621
  }
607
- `,vp=({onStart:o})=>t(oe,{width:"75vw",isOpen:!0,hideOverlay:!0,disableAnimation:!0,children:t(at,{$height:"100%",children:e(fp,{children:[e(bp,{children:[t(ae,{size:le.L,weight:500,children:He.GET_STARTED_WITH}),t(kl,{size:260}),t(ae,{size:le.S,weight:400,children:He.GET_STARTED_DESCRIPTION})]}),t(re,{"data-id":"onboarding-get-started",label:kt.GET_STARTED,rightIcon:di,size:ce.L,onClick:o})]})})}),yp=[{step:1,label:He.INSTALLATION,forceDoneBadge:!0},{step:2,label:He.SOURCES_SETUP},{step:3,label:He.DESTINATIONS_SETUP},{step:4,label:He.SUMMARY}],Cp=m.div`
622
+ `,Np=({onStart:n})=>t(ne,{width:"75vw",isOpen:!0,hideOverlay:!0,disableAnimation:!0,children:t(at,{$height:"100%",children:e(Ep,{children:[e(Ap,{children:[t(ae,{size:le.L,weight:500,children:Ge.GET_STARTED_WITH}),t(kl,{size:260}),t(ae,{size:le.S,weight:400,children:Ge.GET_STARTED_DESCRIPTION})]}),t(re,{"data-id":"onboarding-get-started",label:kt.GET_STARTED,rightIcon:ri,size:ce.L,onClick:n})]})})}),Op=[{step:1,label:Ge.INSTALLATION,forceDoneBadge:!0},{step:2,label:Ge.SOURCES_SETUP},{step:3,label:Ge.DESTINATIONS_SETUP},{step:4,label:Ge.SUMMARY}],Rp=g.div`
608
623
  display: flex;
609
624
  flex-direction: column;
610
625
  gap: 32px;
611
626
  padding: 64px;
612
- `,Sp=({pagePaddingXAxis:o,pagePaddingYAxis:n,onDone:a})=>{const{setCurrentModal:i}=Ho(),{sourcesApi:l,destinationsApi:r}=sl(),[c,d]=s(1),[u,p]=s(!1),[h,g]=s(null),[m,f]=s(null),b=()=>d(e=>e+1),v=()=>d(e=>e-1);return e(mp,{paddingXAxis:o,paddingYAxis:n,children:[e(Cp,{children:[t(kl,{useInline:!0}),t(fa,{currentStep:c,data:yp,gap:32})]}),t(Vl,{initialInputs:h,children:e(Ul,{children:[1===c&&t(vp,{onStart:b}),2===c&&t(_r,{disableAnimation:!0,onBack:e=>{g(e),v()},onNext:e=>{g(e),b()}}),3===c&&t(fr,{disableAnimation:!0,onBack:e=>{f(e),v()},onNext:e=>{f(e),b()},initialInputs:m}),4===c&&t(dp,{disableAnimation:!0,setStep:d,onSave:async()=>{if(!u){p(!0);try{const e=[];h&&e.push(l.persistV2(h)),m&&e.push(...m.map(e=>r.create(e.formData)));const t=await Promise.allSettled(e),o=[];for(const e of t)"rejected"===e.status?o.push(e.reason?.message||String(e.reason)):e.value&&"object"==typeof e.value&&"error"in e.value&&e.value.error&&o.push(e.value.error);if(o.length)return{error:o.join("\n")};i(lu),a()}catch(e){return p(!1),{error:e instanceof Error?e.message:String(e)}}}},sourcesPayload:h,destinationsPayload:m})]})})]})},wp=e=>(e||[]).filter(e=>!!e.id).map(e=>String(e.id)),xp=e=>{let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)&&(t+=e.length)}),e.onlyErrors&&t++,t},Tp=m.div`
627
+ `,Dp=({pagePaddingXAxis:n,pagePaddingYAxis:o,onDone:a})=>{const{setCurrentModal:i}=Un(),{sourcesApi:l,destinationsApi:r}=ll(),[c,d]=s(1),[u,p]=s(!1),[h,m]=s(null),[g,f]=s(null),b=()=>d(e=>e+1),v=()=>d(e=>e-1);return e(Ip,{paddingXAxis:n,paddingYAxis:o,children:[e(Rp,{children:[t(kl,{useInline:!0}),t(ma,{currentStep:c,data:Op,gap:32})]}),t(Xl,{initialInputs:h,children:e(Vl,{children:[1===c&&t(Np,{onStart:b}),2===c&&t(Lr,{disableAnimation:!0,onBack:e=>{m(e),v()},onNext:e=>{m(e),b()}}),3===c&&t(gr,{disableAnimation:!0,onBack:e=>{f(e),v()},onNext:e=>{f(e),b()},initialInputs:g}),4===c&&t(wp,{disableAnimation:!0,setStep:d,onSave:async()=>{if(!u){p(!0);try{const e=[];h&&e.push(l.persistV2(h)),g&&e.push(...g.map(e=>r.create(e.formData)));const t=await Promise.allSettled(e),n=[];for(const e of t)"rejected"===e.status?n.push(e.reason?.message||String(e.reason)):e.value&&"object"==typeof e.value&&"error"in e.value&&e.value.error&&n.push(e.value.error);if(n.length)return{error:n.join("\n")};i(vu),a()}catch(e){return p(!1),{error:e instanceof Error?e.message:String(e)}}}},sourcesPayload:h,destinationsPayload:g})]})})]})},Pp=e=>(e||[]).filter(e=>!!e.id).map(e=>String(e.id)),Fp=e=>{let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)&&(t+=e.length)}),e.onlyErrors&&t++,t},Lp=g.div`
613
628
  position: relative;
614
629
  display: inline-flex;
615
- `,kp=m.button`
630
+ `,_p=g.button`
616
631
  display: inline-flex;
617
632
  align-items: center;
618
633
  gap: 8px;
@@ -625,7 +640,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
625
640
  &:hover {
626
641
  background-color: ${({theme:e})=>e.v2.colors.silver[700]};
627
642
  }
628
- `,$p=m.div`
643
+ `,Mp=g.div`
629
644
  position: absolute;
630
645
  top: calc(100% + 8px);
631
646
  right: 0;
@@ -638,25 +653,25 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
638
653
  border-radius: 12px;
639
654
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
640
655
  box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
641
- `,Ep=m.div`
656
+ `,zp=g.div`
642
657
  display: flex;
643
658
  flex-direction: column;
644
659
  gap: 12px;
645
660
  padding: 16px;
646
661
  max-height: 60vh;
647
662
  overflow-y: auto;
648
- `,Ip=m.div`
663
+ `,Bp=g.div`
649
664
  display: flex;
650
665
  align-items: center;
651
666
  gap: 8px;
652
667
  padding: 12px 16px;
653
668
  border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
654
- `,Ap=m.div`
669
+ `,Xp=g.div`
655
670
  display: flex;
656
671
  align-items: center;
657
672
  gap: 8px;
658
673
  margin-left: auto;
659
- `,Np=()=>{const o=f(),{sourcesApi:l,namespacesApi:r}=sl(),c=l.useSources().items,d=r.useNamespaces().items,{selectedStreamName:u}=Ge(),{getItemSS:p,setItemSS:h,removeItemSS:g}=Sa(),{namespaces:m,kinds:b,monitors:v,languages:y,onlyErrors:C,podsAgentInjectionStatus:S,setAll:w,clearAll:x,getEmptyState:T}=ba(),k=a(()=>va(c,u),[c,u]);n(()=>{const e=p(ya.OVERVIEW_FILTERS,T());w(e)},[]);const[$,E]=s({namespaces:m,kinds:b,monitors:v,languages:y,onlyErrors:C,podsAgentInjectionStatus:S}),[I,A]=s(xp($)),[N,O]=s(!1);n(()=>{if(!N){const e={namespaces:m,kinds:b,monitors:v,languages:y,onlyErrors:C,podsAgentInjectionStatus:S};E(e),A(xp(e))}},[N,m,b,v,y,C,S]);const R=i(null);uo(R,()=>O(!1)),zo({key:"Escape",active:N},()=>O(!1));const D=a(()=>{const e=new Set,t=[];return d.forEach(({name:o})=>{e.has(o)||(e.add(o),t.push({id:o,label:o,withCheckbox:!0}))}),t},[d]),P=a(()=>{const e=new Set,t=[];return k.forEach(({id:o})=>{const{kind:n}=o;e.has(n)||(e.add(n),t.push({id:n,label:n,withCheckbox:!0}))}),t},[k]),F=a(()=>{const e=new Set,t=[];return k.forEach(({runtimeInfo:o})=>{o?.detectedLanguages?.forEach(o=>{e.has(o)||(e.add(o),t.push({id:o,label:Xe[o]||o,withCheckbox:!0}))})}),t.sort((e,t)=>e.id.localeCompare(t.id))},[k]),L=a(()=>Ca.map(({id:e,value:t})=>({id:e,label:t,withCheckbox:!0})),[]),_=a(()=>{const e=new Set,t=[];return k.forEach(({podsAgentInjectionStatus:o})=>{const{reasonEnum:n,message:a}=o||{};if(n){if(e.has(n))return;e.add(n),t.push({id:n,label:Ft(n)})}else if(a){if(e.has(a))return;e.add(a),t.push({id:a,label:a,withCheckbox:!0})}}),t},[k]),z=(e,t,o)=>{const n=t.filter(e=>o.includes(e.id));E(t=>{return{...t,[e]:(o=n,o.map(({id:e,label:t})=>({id:e,label:t})))};var o})},M=N?Si:wi,B=a(()=>wp($.languages),[$.languages]);return e(Tp,{ref:R,children:[e(kp,{"data-id":"filters-trigger",$isOpen:N,type:"button",onClick:()=>O(e=>!e),children:[t(el,{size:16,fill:o.v2.colors.white[500]}),t(ae,{size:le.XS,weight:500,nowrap:!0,children:"Filters"}),I>0&&t(Be,{label:I,status:ft.Unknown,textSize:le.XXXS}),t(M,{size:16,fill:o.v2.colors.silver[200]})]}),N&&e($p,{children:[e(Ep,{children:[t(lt,{label:"Namespace",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!D.length,options:D,values:wp($.namespaces),setValues:e=>z("namespaces",D,e)}),t(lt,{label:"Kind",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!P.length,options:P,values:wp($.kinds),setValues:e=>z("kinds",P,e)}),t(lt,{label:"Programming Language",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!F.length,options:F,values:B,setValues:e=>z("languages",F,e)}),t(lt,{label:"Monitors",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!L.length,options:L,values:wp($.monitors),setValues:e=>z("monitors",L,e)}),t(lt,{label:"Agent Injection Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!_.length,options:_,values:wp($.podsAgentInjectionStatus),setValues:e=>z("podsAgentInjectionStatus",_,e)}),t(Q,{label:"Show only sources with errors",size:vt.L,value:!!$.onlyErrors,onChange:e=>E(t=>({...t,onlyErrors:e}))})]}),e(Ip,{children:[t(re,{"data-id":"filters-reset",size:ce.S,variant:de.Text,label:"Reset",onClick:()=>{g(ya.OVERVIEW_FILTERS),x(),E(T()),A(0),O(!1)},textColor:o.v2.colors.red[500]}),e(Ap,{children:[t(re,{"data-id":"filters-cancel",size:ce.S,variant:de.Secondary,label:"Cancel",onClick:()=>O(!1)}),t(re,{"data-id":"filters-apply",size:ce.S,variant:de.Primary,label:"Apply",onClick:()=>{h(ya.OVERVIEW_FILTERS,$),w($),A(xp($)),O(!1)}})]})]})]})]})},Op=m.div`
674
+ `,Vp=()=>{const n=f(),{sourcesApi:l,namespacesApi:r}=ll(),c=l.useSources().items,d=r.useNamespaces().items,{selectedStreamName:u}=He(),{getItemSS:p,setItemSS:h,removeItemSS:m}=ya(),{namespaces:g,kinds:b,monitors:v,languages:y,onlyErrors:C,podsAgentInjectionStatus:S,setAll:w,clearAll:x,getEmptyState:k}=ga(),T=a(()=>fa(c,u),[c,u]);o(()=>{const e=p(ba.OVERVIEW_FILTERS,k());w(e)},[]);const[$,I]=s({namespaces:g,kinds:b,monitors:v,languages:y,onlyErrors:C,podsAgentInjectionStatus:S}),[E,A]=s(Fp($)),[N,O]=s(!1);o(()=>{if(!N){const e={namespaces:g,kinds:b,monitors:v,languages:y,onlyErrors:C,podsAgentInjectionStatus:S};I(e),A(Fp(e))}},[N,g,b,v,y,C,S]);const R=i(null);cn(R,()=>O(!1)),_n({key:"Escape",active:N},()=>O(!1));const D=a(()=>{const e=new Set,t=[];return d.forEach(({name:n})=>{e.has(n)||(e.add(n),t.push({id:n,label:n,withCheckbox:!0}))}),t},[d]),P=a(()=>{const e=new Set,t=[];return T.forEach(({id:n})=>{const{kind:o}=n;e.has(o)||(e.add(o),t.push({id:o,label:o,withCheckbox:!0}))}),t},[T]),F=a(()=>{const e=new Set,t=[];return T.forEach(({runtimeInfo:n})=>{n?.detectedLanguages?.forEach(n=>{e.has(n)||(e.add(n),t.push({id:n,label:Xe[n]||n,withCheckbox:!0}))})}),t.sort((e,t)=>e.id.localeCompare(t.id))},[T]),L=a(()=>va.map(({id:e,value:t})=>({id:e,label:t,withCheckbox:!0})),[]),_=a(()=>{const e=new Set,t=[];return T.forEach(({podsAgentInjectionStatus:n})=>{const{reasonEnum:o,message:a}=n||{};if(o){if(e.has(o))return;e.add(o),t.push({id:o,label:Pt(o)})}else if(a){if(e.has(a))return;e.add(a),t.push({id:a,label:a,withCheckbox:!0})}}),t},[T]),M=(e,t,n)=>{const o=t.filter(e=>n.includes(e.id));I(t=>{return{...t,[e]:(n=o,n.map(({id:e,label:t})=>({id:e,label:t})))};var n})},z=N?yi:Ci,B=a(()=>Pp($.languages),[$.languages]);return e(Lp,{ref:R,children:[e(_p,{"data-id":"filters-trigger",$isOpen:N,type:"button",onClick:()=>O(e=>!e),children:[t(Qi,{size:16,fill:n.v2.colors.white[500]}),t(ae,{size:le.XS,weight:500,nowrap:!0,children:"Filters"}),E>0&&t(Be,{label:E,status:Ie.Unknown,textSize:le.XXXS}),t(z,{size:16,fill:n.v2.colors.silver[200]})]}),N&&e(Mp,{children:[e(zp,{children:[t(lt,{label:"Namespace",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!D.length,options:D,values:Pp($.namespaces),setValues:e=>M("namespaces",D,e)}),t(lt,{label:"Kind",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!P.length,options:P,values:Pp($.kinds),setValues:e=>M("kinds",P,e)}),t(lt,{label:"Programming Language",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!F.length,options:F,values:B,setValues:e=>M("languages",F,e)}),t(lt,{label:"Monitors",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!L.length,options:L,values:Pp($.monitors),setValues:e=>M("monitors",L,e)}),t(lt,{label:"Agent Injection Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!_.length,options:_,values:Pp($.podsAgentInjectionStatus),setValues:e=>M("podsAgentInjectionStatus",_,e)}),t(Q,{label:"Show only sources with errors",size:bt.L,value:!!$.onlyErrors,onChange:e=>I(t=>({...t,onlyErrors:e}))})]}),e(Bp,{children:[t(re,{"data-id":"filters-reset",size:ce.S,variant:de.Text,label:"Reset",onClick:()=>{m(ba.OVERVIEW_FILTERS),x(),I(k()),A(0),O(!1)},textColor:n.v2.colors.red[500]}),e(Xp,{children:[t(re,{"data-id":"filters-cancel",size:ce.S,variant:de.Secondary,label:"Cancel",onClick:()=>O(!1)}),t(re,{"data-id":"filters-apply",size:ce.S,variant:de.Primary,label:"Apply",onClick:()=>{h(ba.OVERVIEW_FILTERS,$),w($),A(Fp($)),O(!1)}})]})]})]})]})},Up=g.div`
660
675
  position: relative;
661
676
  display: flex;
662
677
  align-items: center;
@@ -667,7 +682,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
667
682
  box-sizing: border-box;
668
683
  border-radius: 16px 16px 0 0;
669
684
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
670
- `,Rp=m.div`
685
+ `,Gp=g.div`
671
686
  position: absolute;
672
687
  bottom: 0;
673
688
  left: 0;
@@ -676,7 +691,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
676
691
  background-color: ${({theme:e})=>e.v2.colors.purple[500]};
677
692
  border-radius: 32px;
678
693
  transition: width 0.3s;
679
- `,Dp=({entityType:o,badge:n,badgeTooltip:a,isLoading:i,refetch:l,partiallySelected:s,allSelected:r,onSelectAll:c,progressPercent:d})=>{const{setCurrentModal:u}=Ho();return e(Op,{children:[e(se,{$gap:8,style:{flex:1,minWidth:0},children:[c&&t(Y,{size:wa.S,partiallyChecked:s,value:!!r,onChange:c}),t(ae,{size:le.S,nowrap:!0,children:`${Ft(o)}s`}),t(Be,{label:n,tooltip:a,status:ft.Unknown,textSize:le.XXXS})]}),e(se,{children:[t(st,{"data-id":`add-${o}`,icon:ci,onClick:()=>u(o)}),t(st,{"data-id":`refresh-${o}`,icon:Ri,onClick:l,disabled:i})]}),"number"==typeof d&&t(Rp,{$percent:d})]})},Pp=m(W)`
694
+ `,Hp=({entityType:n,badge:o,badgeTooltip:a,isLoading:i,refetch:l,partiallySelected:s,allSelected:r,onSelectAll:c,progressPercent:d})=>{const{setCurrentModal:u}=Un();return e(Up,{children:[e(se,{$gap:8,style:{flex:1,minWidth:0},children:[c&&t(Y,{size:Ca.S,partiallyChecked:s,value:!!r,onChange:c}),t(ae,{size:le.S,nowrap:!0,children:`${Pt(n)}s`}),t(Be,{label:o,tooltip:a,status:Ie.Unknown,textSize:le.XXXS})]}),e(se,{children:[t(st,{"data-id":`add-${n}`,icon:si,onClick:()=>u(n)}),t(st,{"data-id":`refresh-${n}`,icon:Ni,onClick:l,disabled:i})]}),"number"==typeof d&&t(Gp,{$percent:d})]})},jp=g(W)`
680
695
  align-items: center !important;
681
696
  justify-content: center !important;
682
697
  align-self: stretch;
@@ -691,7 +706,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
691
706
  &:hover {
692
707
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
693
708
  }
694
- `,Fp=({entityType:o,description:n})=>{const{setCurrentModal:a}=Ho();return e(Pp,{onClick:()=>a(o),children:[e(se,{$gap:4,children:[t(ci,{size:16}),t(ae,{size:le.S,children:`Add ${Ft(o)}`})]}),t(ae,{size:le.XXS,align:"center",children:n})]})},Lp=m.div`
709
+ `,Wp=({entityType:n,description:o})=>{const{setCurrentModal:a}=Un();return e(jp,{onClick:()=>a(n),children:[e(se,{$gap:4,children:[t(si,{size:16}),t(ae,{size:le.S,children:`Add ${Pt(n)}`})]}),t(ae,{size:le.XXS,align:"center",children:o})]})},Kp=g.div`
695
710
  display: flex;
696
711
  align-items: center;
697
712
  gap: 12px;
@@ -706,10 +721,10 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
706
721
  &:hover {
707
722
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
708
723
  }
709
- `,_p=m(se)`
724
+ `,Yp=g(se)`
710
725
  flex: 1;
711
726
  min-width: 0;
712
- `,zp=({entityId:o,entityType:n,title:i,status:l,faded:s,tooltip:r,throughput:c,icon:d,icons:u,iconSrc:p,isActive:h,raw:g})=>{const m=f(),b=n===mt.Source,v="boolean"==typeof h,y=s||v&&!h,{setDrawerType:C,setDrawerEntityId:S}=eo(),{selectedSources:w,setSelectedSources:x}=xa(),T=g,k=b?T.id.namespace:"",$=a(()=>{if(!b)return-1;const e=w[k];return e?.length?e.findIndex(e=>e.id.name===T.id.name&&e.id.kind===T.id.kind):-1},[b,w,k,T.id]),E=v&&!h?Ta(Ee.Info,m):l?Ta(l,m):void 0,I=b&&"object"==typeof o?`${o.namespace}-${o.name}-${o.kind}`:o;return e(Lp,{"data-id":I,$faded:y,onClick:()=>{C(n),S(o)},children:[b&&t(Y,{size:wa.S,value:-1!==$,onChange:()=>{const e={...w};e[k]||(e[k]=[]),-1===$?e[k].push(T):e[k].splice($,1),x(e)}}),t(ao,{icons:u,icon:d,iconSrc:p}),e(_p,{$gap:4,children:[t(Se,{size:le.XS,nowrap:!0,children:i}),t(se,{$gap:6,$justifyContent:"flex-end",style:{marginLeft:"auto",flexShrink:0},children:c&&t(De,{text:r||"Heads up! The data-flow metrics you see are calculated over 10-second intervals.",children:t(Be,{label:c,status:l&&[Ee.Error,Ee.Warning].includes(l)?l:ft.Unknown,leftIcon:E,textSize:le.XXXS})})})]})]})};function Mp(e){return Object.values(e.conditions??{}).filter(Boolean).some(({status:e})=>e===Kt.Loading)?e:{...e,workloadOdigosHealthStatus:{status:Ut.Pending,name:"WorkloadOdigosHealthStatus",reasonEnum:"Pending",message:""}}}function Bp(e){const t=Object.values(e.conditions??{}).filter(Boolean),o=t.filter(({status:e})=>e!==Kt.Loading);return o?.length===t?.length?e:{...e,conditions:o?.length?o.reduce((e,t)=>(e[t.name]=t,e),{}):{}}}const Xp=m.div`
727
+ `,Jp=({entityId:n,entityType:o,title:i,status:l,faded:s,tooltip:r,throughput:c,icon:d,icons:u,iconSrc:p,isActive:h,raw:m})=>{const g=f(),b=o===gt.Source,v="boolean"==typeof h,y=s||v&&!h,{setDrawerType:C,setDrawerEntityId:S}=Zt(),{selectedSources:w,setSelectedSources:x}=Sa(),k=m,T=b?k.id.namespace:"",$=a(()=>{if(!b)return-1;const e=w[T];return e?.length?e.findIndex(e=>e.id.name===k.id.name&&e.id.kind===k.id.kind):-1},[b,w,T,k.id]),I=v&&!h?wa(Ie.Info,g):l?wa(l,g):void 0,E=b&&"object"==typeof n?`${n.namespace}-${n.name}-${n.kind}`:n;return e(Kp,{"data-id":E,$faded:y,onClick:()=>{C(o),S(n)},children:[b&&t(Y,{size:Ca.S,value:-1!==$,onChange:()=>{const e={...w};e[T]||(e[T]=[]),-1===$?e[T].push(k):e[T].splice($,1),x(e)}}),t(nn,{icons:u,icon:d,iconSrc:p}),e(Yp,{$gap:4,children:[t(Se,{size:le.XS,nowrap:!0,children:i}),t(se,{$gap:6,$justifyContent:"flex-end",style:{marginLeft:"auto",flexShrink:0},children:c&&t(De,{text:r||"Heads up! The data-flow metrics you see are calculated over 10-second intervals.",children:t(Be,{label:c,status:l&&[Ie.Error,Ie.Warning].includes(l)?l:Ie.Unknown,leftIcon:I,textSize:le.XXXS})})})]})]})};function qp(e){return Object.values(e.conditions??{}).filter(Boolean).some(({status:e})=>e===Ie.Loading)?e:{...e,workloadOdigosHealthStatus:{status:Vt.Pending,name:"WorkloadOdigosHealthStatus",reasonEnum:"Pending",message:""}}}function Zp(e){const t=Object.values(e.conditions??{}).filter(Boolean),n=t.filter(({status:e})=>e!==Ie.Loading);return n?.length===t?.length?e:{...e,conditions:n?.length?n.reduce((e,t)=>(e[t.name]=t,e),{}):{}}}const Qp=g.div`
713
728
  position: absolute;
714
729
  top: 0;
715
730
  left: 0;
@@ -720,22 +735,22 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
720
735
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
721
736
  border-bottom: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
722
737
  pointer-events: none;
723
- `,Vp=m.div`
738
+ `,eh=g.div`
724
739
  display: flex;
725
740
  align-items: center;
726
741
  gap: 8px;
727
742
  padding: 4px 8px 0;
728
- `,Up=m.div`
743
+ `,th=g.div`
729
744
  flex: 1;
730
745
  height: 1px;
731
746
  background: ${({theme:e})=>e.v2.colors.silver[700]};
732
- `,Hp=({namespace:e})=>{const o=f();return t(Xp,{children:t(ae,{size:le.XXS,nowrap:!0,color:o.v2.colors.grey[300],children:e})})},Gp=({namespace:o})=>{const n=f();return e(Vp,{children:[t(Up,{}),t(ae,{size:le.XXS,nowrap:!0,color:n.v2.colors.grey[300],children:o}),t(Up,{})]})},jp={[mt.InstrumentationRule]:He.NO_DATA_INSTRUMENTATION_RULES,[mt.Source]:He.NO_DATA_SOURCES,[mt.Action]:He.NO_DATA_ACTIONS,[mt.Destination]:He.NO_DATA_DESTINATIONS},Wp=m.div`
747
+ `,nh=({namespace:e})=>{const n=f();return t(Qp,{children:t(ae,{size:le.XXS,nowrap:!0,color:n.v2.colors.grey[300],children:e})})},oh=({namespace:n})=>{const o=f();return e(eh,{children:[t(th,{}),t(ae,{size:le.XXS,nowrap:!0,color:o.v2.colors.grey[300],children:n}),t(th,{})]})},ah={[gt.InstrumentationRule]:Ge.NO_DATA_INSTRUMENTATION_RULES,[gt.Source]:Ge.NO_DATA_SOURCES,[gt.Action]:Ge.NO_DATA_ACTIONS,[gt.Destination]:Ge.NO_DATA_DESTINATIONS},ih=g.div`
733
748
  display: flex;
734
749
  flex-direction: column;
735
750
  flex: 1 0 0;
736
751
  min-width: 0;
737
752
  ${({$isVm:e})=>e?"width: 45vw;":""}
738
- `,Kp=m.div`
753
+ `,lh=g.div`
739
754
  display: flex;
740
755
  flex-direction: column;
741
756
  align-items: stretch;
@@ -745,7 +760,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
745
760
  border-radius: 0 0 16px 16px;
746
761
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
747
762
  overflow: hidden;
748
- `,Yp=m.div`
763
+ `,sh=g.div`
749
764
  position: relative;
750
765
  display: flex;
751
766
  flex-direction: column;
@@ -757,7 +772,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
757
772
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
758
773
  height: ${({$height:e})=>e}px;
759
774
  overflow: hidden;
760
- `,Jp=(e,t,o)=>{const n=Tt(e);if(!n)return null;const a=t===mt.Source;let i,l,s=!1,r=e;if(a){const t=function(e){const t=e.workloadOdigosHealthStatus?.status;switch(t){case Ut.Failure:return{status:Ee.Error,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case Ut.Notice:return{status:Ee.Warning,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case Ut.Pending:case Ut.Waiting:return{status:void 0,faded:!1,displaySource:Mp(e)};case Ut.Unsupported:case Ut.Disabled:return{status:void 0,faded:!0,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};default:return{status:void 0,faded:!1,displaySource:Bp(e)}}}(e);i=t.status,s=t.faded,l=t.tooltip,r=t.displaySource}else{const{priorotizedStatus:t,hasDisableds:o}=$a(e.conditions);i=t,s=o}const c=Ea(e,t,{extended:a,prioritizeDisplayName:!a});let d,u,p,h,g;switch(t){case mt.Source:{d=no(e),u=Aa(mt.Source);const t=o?.get(Ia(n));h=so(t);break}case mt.Destination:{const t=ut(e.destinationType.type);u=t.icon,p=t.iconSrc;const a=o?.get(Ia(n));h=so(a),g=!e.disabled;break}case mt.Action:u=At(e.type),g=!e.disabled;break;case mt.InstrumentationRule:u=Mt(e.type),g=!e.disabled}return{key:Ia(n),entityId:n,namespace:a?e.id.namespace:void 0,raw:r,itemProps:{entityId:n,entityType:t,title:c,status:i,faded:s,tooltip:l,throughput:h,icon:u,icons:d,iconSrc:p,isActive:g,raw:r}}},qp=({entityType:o,entities:i,unfilteredCount:r,metrics:c,loading:d,maxHeight:u,refetch:p})=>{const{isVm:h}=y(),g=o===mt.Source,m=i.length!==r,f=Ct(e=>g?e.progress[xt.Instrumenting]?.percentage:void 0),b=Ct(e=>g?e.progress[xt.Uninstrumenting]?.percentage:void 0),v=!g||void 0===f&&void 0===b?void 0:f||b||0,{selectedSources:C,setSelectedSources:S}=xa(),w=a(()=>g?Object.values(C).reduce((e,t)=>e+t.length,0):0,[g,C]),x=a(()=>{if(!c)return;const e=new Map,t=o===mt.Source?c.sources:o===mt.Destination?c.destinations:void 0;if(t)for(const o of t)e.set(ka(o),o.throughput);return e},[c,o]),T=a(()=>i.map(e=>Jp(e,o,x)).filter(Boolean),[i,o,x]),[k,$]=s(""),{elements:E,indexToNamespace:I,multipleNs:A,dividerCount:N}=a(()=>{const e=[],o=[],n=new Set(T.map(e=>e.namespace).filter(Boolean)).size>1;n&&(o.push(""),e.push(t("div",{style:{height:24}},"ns-spacer")));let a=0,i="";for(const n of T)g&&n.namespace&&n.namespace!==i&&(""!==i&&(o.push(n.namespace),e.push(t(Gp,{namespace:n.namespace},`ns-divider-${n.namespace}`)),a+=1),i=n.namespace),o.push(n.namespace||""),e.push(t(zp,{...n.itemProps},n.key));return{elements:e,indexToNamespace:o,multipleNs:n,dividerCount:a}},[T,g]);n(()=>{if(g&&I.length&&!k){const e=I.find(Boolean);e&&$(e)}},[g,I]);const O=l(e=>{if(!I.length)return;const t=I[Math.min(e,I.length-1)];t&&t!==k&&$(t)},[I,k]);if(h&&[mt.InstrumentationRule,mt.Action].includes(o))return null;const R=58*T.length+(A?28:0)+32*N,D=Math.max(0,u-52-16),P=Math.min(D,R)+8,F="number"==typeof v?`${v}%`:m?`${i.length}/${r}`:r;return e(Wp,{$isVm:h,children:[t(Dp,{entityType:o,badge:F,badgeTooltip:m?He.FILTERED_COUNT_TOOLTIP:void 0,isLoading:d,refetch:p,partiallySelected:w>0&&i?.length!==w,allSelected:w>0&&i?.length===w,onSelectAll:g?e=>{if(g)if(e){const e={};i?.forEach(t=>{const{namespace:o}=t.id;e[o]?e[o].push(t):e[o]=[t]}),S(e)}else S({})}:void 0,progressPercent:v}),t(Kp,{children:i.length?e(Yp,{$height:P,children:[A&&k&&t(Hp,{namespace:k}),t(Qt,{gap:4,elements:E,onTopIndexChange:A?O:void 0})]}):d?t(lo,{size:3}):t(Fp,{entityType:o,description:jp[o]??He.TO_COLLECT_OTEL_DATA})})]})},Zp=m.div`
775
+ `,rh=(e,t,n)=>{const o=xt(e);if(!o)return null;const a=t===gt.Source;let i,l,s=!1,r=e;if(a){const t=function(e){const t=e.workloadOdigosHealthStatus?.status;switch(t){case Vt.Failure:return{status:Ie.Error,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case Vt.Notice:return{status:Ie.Warning,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case Vt.Pending:case Vt.Waiting:return{status:void 0,faded:!1,displaySource:qp(e)};case Vt.Unsupported:case Vt.Disabled:return{status:void 0,faded:!0,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};default:return{status:void 0,faded:!1,displaySource:Zp(e)}}}(e);i=t.status,s=t.faded,l=t.tooltip,r=t.displaySource}else{const{priorotizedStatus:t,hasDisableds:n}=ka(e.conditions);i=t,s=n}const c=Ta(e,t,{extended:a,prioritizeDisplayName:!a});let d,u,p,h,m;switch(t){case gt.Source:{d=tn(e),u=Ia(gt.Source);const t=n?.get($a(o));h=ln(t);break}case gt.Destination:{const t=ut(e.destinationType.type);u=t.icon,p=t.iconSrc;const a=n?.get($a(o));h=ln(a),m=!e.disabled;break}case gt.Action:u=Et(e.type),m=!e.disabled;break;case gt.InstrumentationRule:u=Mt(e.type),m=!e.disabled}return{key:$a(o),entityId:o,namespace:a?e.id.namespace:void 0,raw:r,itemProps:{entityId:o,entityType:t,title:c,status:i,faded:s,tooltip:l,throughput:h,icon:u,icons:d,iconSrc:p,isActive:m,raw:r}}},ch=({entityType:n,entities:i,unfilteredCount:r,metrics:c,loading:d,maxHeight:u,refetch:p})=>{const{isVm:h}=y(),m=n===gt.Source,g=i.length!==r,f=yt(e=>m?e.progress[wt.Instrumenting]?.percentage:void 0),b=yt(e=>m?e.progress[wt.Uninstrumenting]?.percentage:void 0),v=!m||void 0===f&&void 0===b?void 0:f||b||0,{selectedSources:C,setSelectedSources:S}=Sa(),w=a(()=>m?Object.values(C).reduce((e,t)=>e+t.length,0):0,[m,C]),x=a(()=>{if(!c)return;const e=new Map,t=n===gt.Source?c.sources:n===gt.Destination?c.destinations:void 0;if(t)for(const n of t)e.set(xa(n),n.throughput);return e},[c,n]),k=a(()=>i.map(e=>rh(e,n,x)).filter(Boolean),[i,n,x]),[T,$]=s(""),{elements:I,indexToNamespace:E,multipleNs:A,dividerCount:N}=a(()=>{const e=[],n=[],o=new Set(k.map(e=>e.namespace).filter(Boolean)).size>1;o&&(n.push(""),e.push(t("div",{style:{height:24}},"ns-spacer")));let a=0,i="";for(const o of k)m&&o.namespace&&o.namespace!==i&&(""!==i&&(n.push(o.namespace),e.push(t(oh,{namespace:o.namespace},`ns-divider-${o.namespace}`)),a+=1),i=o.namespace),n.push(o.namespace||""),e.push(t(Jp,{...o.itemProps},o.key));return{elements:e,indexToNamespace:n,multipleNs:o,dividerCount:a}},[k,m]);o(()=>{if(m&&E.length&&!T){const e=E.find(Boolean);e&&$(e)}},[m,E]);const O=l(e=>{if(!E.length)return;const t=E[Math.min(e,E.length-1)];t&&t!==T&&$(t)},[E,T]);if(h&&[gt.InstrumentationRule,gt.Action].includes(n))return null;const R=58*k.length+(A?28:0)+32*N,D=Math.max(0,u-52-16),P=Math.min(D,R)+8,F="number"==typeof v?`${v}%`:g?`${i.length}/${r}`:r;return e(ih,{$isVm:h,children:[t(Hp,{entityType:n,badge:F,badgeTooltip:g?Ge.FILTERED_COUNT_TOOLTIP:void 0,isLoading:d,refetch:p,partiallySelected:w>0&&i?.length!==w,allSelected:w>0&&i?.length===w,onSelectAll:m?e=>{if(m)if(e){const e={};i?.forEach(t=>{const{namespace:n}=t.id;e[n]?e[n].push(t):e[n]=[t]}),S(e)}else S({})}:void 0,progressPercent:v}),t(lh,{children:i.length?e(sh,{$height:P,children:[A&&T&&t(nh,{namespace:T}),t(qt,{gap:4,elements:I,onTopIndexChange:A?O:void 0})]}):d?t(an,{size:3}):t(Wp,{entityType:n,description:ah[n]??Ge.TO_COLLECT_OTEL_DATA})})]})},dh=g.div`
761
776
  width: 100%;
762
777
  flex: 1;
763
778
  min-height: 0;
@@ -765,10 +780,10 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
765
780
  display: flex;
766
781
  align-items: stretch;
767
782
  gap: 16px;
768
- `,Qp={sources:[],destinations:[]},eh=()=>{const o=ba(),{selectedStreamName:n}=Ge(),{containerRef:i,containerHeight:l}=Na(),{sourcesApi:s,destinationsApi:r,actionsApi:c,instrumentationRulesApi:d,metricsApi:u}=sl(),{items:p,loading:h}=s.useSources(),{items:g,loading:m}=r.useDestinations(),{items:f,loading:b}=c.useActions(),{items:v,loading:y}=d.useRules(),C=eo(e=>e.drawerType),S=Ho(e=>e.currentModal),{data:w}=u.useMetrics({skip:!(p.length&&g.length&&!C&&!S),pollInterval:1e4,fetchPolicy:"network-only"}),x=w?.getOverviewMetrics??Qp,T=a(()=>va(p,n),[p,n]),k=a(()=>Dt(g,n),[g,n]),$=a(()=>Oa(T,o),[T,o]),E=a(()=>Ra(k,o),[k,o]),I=a(()=>Da(f,o),[f,o]);return e(Zp,{ref:i,children:[t(qp,{entityType:mt.InstrumentationRule,entities:v,unfilteredCount:v.length,loading:y,maxHeight:l,refetch:d.fetchAll}),t(qp,{entityType:mt.Source,entities:$,unfilteredCount:T.length,metrics:x,loading:h,maxHeight:l,refetch:s.fetchAll}),t(qp,{entityType:mt.Action,entities:I,unfilteredCount:f.length,loading:b,maxHeight:l,refetch:c.fetchAll}),t(qp,{entityType:mt.Destination,entities:E,unfilteredCount:k.length,metrics:x,loading:m,maxHeight:l,refetch:r.fetchAll})]})},th="40vw",oh=m.div`
783
+ `,uh={sources:[],destinations:[]},ph=()=>{const n=ga(),{selectedStreamName:o}=He(),{containerRef:i,containerHeight:l}=Ea(),{sourcesApi:s,destinationsApi:r,actionsApi:c,instrumentationRulesApi:d,metricsApi:u}=ll(),{items:p,loading:h}=s.useSources(),{items:m,loading:g}=r.useDestinations(),{items:f,loading:b}=c.useActions(),{items:v,loading:y}=d.useRules(),C=Zt(e=>e.drawerType),S=Un(e=>e.currentModal),{data:w}=u.useMetrics({skip:!(p.length&&m.length&&!C&&!S),pollInterval:1e4,fetchPolicy:"network-only"}),x=w?.getOverviewMetrics??uh,k=a(()=>fa(p,o),[p,o]),T=a(()=>Rt(m,o),[m,o]),$=a(()=>Aa(k,n),[k,n]),I=a(()=>Na(T,n),[T,n]),E=a(()=>Oa(f,n),[f,n]);return e(dh,{ref:i,children:[t(ch,{entityType:gt.InstrumentationRule,entities:v,unfilteredCount:v.length,loading:y,maxHeight:l,refetch:d.fetchAll}),t(ch,{entityType:gt.Source,entities:$,unfilteredCount:k.length,metrics:x,loading:h,maxHeight:l,refetch:s.fetchAll}),t(ch,{entityType:gt.Action,entities:E,unfilteredCount:f.length,loading:b,maxHeight:l,refetch:c.fetchAll}),t(ch,{entityType:gt.Destination,entities:I,unfilteredCount:T.length,metrics:x,loading:g,maxHeight:l,refetch:r.fetchAll})]})},hh="40vw",mh=g.div`
769
784
  position: relative;
770
- width: ${th};
771
- `,nh=m.div`
785
+ width: ${hh};
786
+ `,gh=g.div`
772
787
  position: absolute;
773
788
  top: calc(100% + 8px);
774
789
  left: 0;
@@ -777,23 +792,23 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
777
792
  flex-direction: column;
778
793
  gap: 8px;
779
794
  padding: 8px;
780
- width: calc(${th} - 16px);
795
+ width: calc(${hh} - 16px);
781
796
  border-radius: 12px;
782
797
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
783
798
  box-shadow: 0 12px 24px 24px rgba(0, 0, 0, 0.5);
784
- `,ah=m.div`
799
+ `,fh=g.div`
785
800
  display: flex;
786
801
  align-items: center;
787
802
  overflow-x: auto;
788
- `,ih=m.div`
803
+ `,bh=g.div`
789
804
  display: flex;
790
805
  flex-direction: column;
791
806
  gap: 0;
792
807
  max-height: 60vh;
793
808
  overflow-y: auto;
794
- `,lh=m.div`
809
+ `,vh=g.div`
795
810
  padding: 8px 12px 4px 12px;
796
- `,sh=m.div`
811
+ `,yh=g.div`
797
812
  display: flex;
798
813
  align-items: center;
799
814
  gap: 8px;
@@ -803,12 +818,12 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
803
818
  &:hover {
804
819
  background-color: ${({theme:e})=>e.v2.colors.silver[700]};
805
820
  }
806
- `,rh=m.div`
821
+ `,Ch=g.div`
807
822
  padding: 16px 8px;
808
- `,ch=({preventPopup:o=!1})=>{const n=f(),{onClickNode:l}=Pa(),{searchText:c,setSearchText:d}=ba(),{selectedStreamName:u}=Ge(),{sourcesApi:p,destinationsApi:h,actionsApi:g,instrumentationRulesApi:m}=sl(),b=p.useSources().items,v=h.useDestinations().items,y=g.useActions().items,C=m.useRules().items,S=i(null),[w,x]=s(!1),[T,k]=s("all"),$=!o&&(!!c||w),E=()=>{d(""),x(!1),k("all")};uo(S,()=>E()),zo({key:"Escape",active:$},E);const{categories:I,searchResults:A}=a(()=>(({instrumentationRules:e,sources:t,actions:o,destinations:n,searchText:a,selectedCategory:i})=>{const l=a?e.filter(e=>e.type?.toLowerCase().includes(a)||e.ruleName?.toLowerCase().includes(a)):e,s=a?t.filter(e=>e.id.name?.toLowerCase().includes(a)||e.serviceName?.toLowerCase().includes(a)||e.id.namespace?.toLowerCase().includes(a)):t,r=a?o.filter(e=>e.type?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):o,c=a?n.filter(e=>e.destinationType.displayName?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):n,d=[{category:mt.Source,label:"Sources",count:s.length,entities:[]},{category:mt.Action,label:"Actions",count:r.length,entities:[]},{category:mt.Destination,label:"Destinations",count:c.length,entities:[]},{category:mt.InstrumentationRule,label:"Instrumentation Rules",count:l.length,entities:[]}];d.unshift({category:"all",label:"All",count:l.length+s.length+r.length+c.length,entities:[]});const u=d.filter(({count:e,category:t})=>!!e&&"all"!==t&&["all",t].includes(i)).map(e=>({...e,entities:e.category===mt.InstrumentationRule?l:e.category===mt.Source?s:e.category===mt.Action?r:e.category===mt.Destination?c:[]}));return{categories:d,searchResults:u}})({instrumentationRules:C,sources:va(b,u),actions:y,destinations:Dt(v,u),searchText:c,selectedCategory:T}),[C,b,y,v,u,c,T]),N=a(()=>I.filter(({count:e,category:t})=>!!e||"all"===t).map(({category:e,label:t,count:o})=>({value:e,label:o?`${t} (${o})`:t})),[I]),O=A.some(({entities:e})=>e.length>0);return e(oh,{ref:S,children:[t(Zt,{value:c,onChange:e=>d(e.toLowerCase()),onFocus:()=>x(!0),width:th}),$&&e(nh,{children:[N.length>1&&t(ah,{children:t(ue,{options:N,selected:T,setSelected:k})}),O?t(ih,{children:A.map(({category:o,label:a,entities:i},s)=>{if(!i.length)return null;const c=Aa(o);return e(r,{children:[t(lh,{children:t(ae,{size:le.XXS,color:ie.Secondary,children:a})}),i.map((a,i)=>e(sh,{onClick:()=>{const e=Tt(a);l(null,{data:{type:o,id:e}}),E()},children:[c&&t(c,{size:16,fill:n.v2.colors.white[500]}),t(ae,{size:le.XS,nowrap:!0,children:Ea(a,o,{extended:!0})})]},`entity-${s}-${i}`))]},`category-list-${o}`)})}):t(rh,{children:t(Ce,{hideIcon:!0,title:"No results",subTitle:c?`No matches for "${c}"`:"Start typing to search"})})]})]})},dh=({onRedirectToSampling:n})=>{const{currentModal:i,setCurrentModal:l}=Ho(),{drawerType:s,drawerEntityId:r,setDrawerType:c,setDrawerEntityId:d}=eo(),{sourcesApi:u}=sl(),{items:p}=u.useSources(),h=()=>{l(""),c(null),d(null)},g=a(()=>p.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:`${e.namespace} / ${e.kind} / ${e.name}`})),[p]),m=a(()=>Array.from(new Set(p.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[p]);return e(o,{children:[t(su,{}),i===mt.Source&&t(Vl,{children:t(_r,{onClose:h,withOverlay:!0})}),i===mt.Destination&&t(Ul,{children:t(fr,{onClose:h,withOverlay:!0})}),i===mt.InstrumentationRule&&t(Gl,{sourceOptions:g,namespaceOptions:m,children:t(br,{onClose:h,withOverlay:!0})}),i===mt.Action&&t(Hl,{children:t(lr,{onClose:h,withOverlay:!0})}),s===mt.Source&&r&&t(jl,{children:t(Dd,{onClose:h,sourceId:r,onRedirectToSampling:n})}),s===mt.Destination&&r&&t(Ul,{children:t(Vr,{onClose:h,destinationId:r})}),s===mt.InstrumentationRule&&r&&t(Gl,{sourceOptions:g,namespaceOptions:m,children:t(Hr,{onClose:h,ruleId:r})}),s===mt.Action&&r&&t(Hl,{children:t(Mr,{onClose:h,actionId:r})})]})},uh=e=>`Data Stream: ${e}`,ph="Search streams...",hh="No streams match",gh=m.div`
823
+ `,Sh=({preventPopup:n=!1})=>{const o=f(),{onClickNode:l}=Ra(),{searchText:c,setSearchText:d}=ga(),{selectedStreamName:u}=He(),{sourcesApi:p,destinationsApi:h,actionsApi:m,instrumentationRulesApi:g}=ll(),b=p.useSources().items,v=h.useDestinations().items,y=m.useActions().items,C=g.useRules().items,S=i(null),[w,x]=s(!1),[k,T]=s("all"),$=!n&&(!!c||w),I=()=>{d(""),x(!1),T("all")};cn(S,()=>I()),_n({key:"Escape",active:$},I);const{categories:E,searchResults:A}=a(()=>(({instrumentationRules:e,sources:t,actions:n,destinations:o,searchText:a,selectedCategory:i})=>{const l=a?e.filter(e=>e.type?.toLowerCase().includes(a)||e.ruleName?.toLowerCase().includes(a)):e,s=a?t.filter(e=>e.id.name?.toLowerCase().includes(a)||e.serviceName?.toLowerCase().includes(a)||e.id.namespace?.toLowerCase().includes(a)):t,r=a?n.filter(e=>e.type?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):n,c=a?o.filter(e=>e.destinationType.displayName?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):o,d=[{category:gt.Source,label:"Sources",count:s.length,entities:[]},{category:gt.Action,label:"Actions",count:r.length,entities:[]},{category:gt.Destination,label:"Destinations",count:c.length,entities:[]},{category:gt.InstrumentationRule,label:"Instrumentation Rules",count:l.length,entities:[]}];d.unshift({category:"all",label:"All",count:l.length+s.length+r.length+c.length,entities:[]});const u=d.filter(({count:e,category:t})=>!!e&&"all"!==t&&["all",t].includes(i)).map(e=>({...e,entities:e.category===gt.InstrumentationRule?l:e.category===gt.Source?s:e.category===gt.Action?r:e.category===gt.Destination?c:[]}));return{categories:d,searchResults:u}})({instrumentationRules:C,sources:fa(b,u),actions:y,destinations:Rt(v,u),searchText:c,selectedCategory:k}),[C,b,y,v,u,c,k]),N=a(()=>E.filter(({count:e,category:t})=>!!e||"all"===t).map(({category:e,label:t,count:n})=>({value:e,label:n?`${t} (${n})`:t})),[E]),O=A.some(({entities:e})=>e.length>0);return e(mh,{ref:S,children:[t(Jt,{value:c,onChange:e=>d(e.toLowerCase()),onFocus:()=>x(!0),width:hh}),$&&e(gh,{children:[N.length>1&&t(fh,{children:t(ue,{options:N,selected:k,setSelected:T})}),O?t(bh,{children:A.map(({category:n,label:a,entities:i},s)=>{if(!i.length)return null;const c=Ia(n);return e(r,{children:[t(vh,{children:t(ae,{size:le.XXS,color:ie.Secondary,children:a})}),i.map((a,i)=>e(yh,{onClick:()=>{const e=xt(a);l(null,{data:{type:n,id:e}}),I()},children:[c&&t(c,{size:16,fill:o.v2.colors.white[500]}),t(ae,{size:le.XS,nowrap:!0,children:Ta(a,n,{extended:!0})})]},`entity-${s}-${i}`))]},`category-list-${n}`)})}):t(Ch,{children:t(Ce,{hideIcon:!0,title:"No results",subTitle:c?`No matches for "${c}"`:"Start typing to search"})})]})]})},wh=({onRedirectToSampling:o})=>{const{sourcesApi:i}=ll(),{items:l}=i.useSources(),{currentModal:s,setCurrentModal:r}=Un(),{drawerType:c,drawerEntityId:d,setDrawerType:u,setDrawerEntityId:p}=Zt(),h=()=>{r("")},m=()=>{u(null),p(null)},g=a(()=>l.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[l]),f=a(()=>Array.from(new Set(l.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[l]);return e(n,{children:[t(yu,{}),s===gt.Source&&t(Xl,{children:t(Lr,{onClose:h,withOverlay:!0})}),s===gt.Destination&&t(Vl,{children:t(gr,{onClose:h,withOverlay:!0})}),s===gt.InstrumentationRule&&t(Gl,{sourceOptions:g,namespaceOptions:f,children:t(fr,{onClose:h,withOverlay:!0})}),s===gt.Action&&t(Ul,{children:t(ir,{onClose:h,withOverlay:!0})}),c===gt.Source&&d&&t(Hl,{children:t(Hd,{onClose:m,sourceId:d,onRedirectToSampling:o})}),c===gt.Destination&&d&&t(Vl,{children:t(Xr,{onClose:m,destinationId:d})}),c===gt.InstrumentationRule&&d&&t(Gl,{sourceOptions:g,namespaceOptions:f,children:t(Ur,{onClose:m,ruleId:d})}),c===gt.Action&&d&&t(Ul,{children:t(Mr,{onClose:m,actionId:d})})]})},xh=e=>`Data Stream: ${e}`,kh="Search streams...",Th="No streams match",$h=g.div`
809
824
  position: relative;
810
825
  display: inline-flex;
811
- `,mh=m.div`
826
+ `,Ih=g.div`
812
827
  display: inline-flex;
813
828
  align-items: center;
814
829
  gap: 6px;
@@ -819,7 +834,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
819
834
  &:hover {
820
835
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
821
836
  }
822
- `,fh=m.div`
837
+ `,Eh=g.div`
823
838
  position: absolute;
824
839
  top: calc(100% + 8px);
825
840
  left: 0;
@@ -833,18 +848,18 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
833
848
  border-radius: 12px;
834
849
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
835
850
  box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
836
- `,bh=m.div`
851
+ `,Ah=g.div`
837
852
  display: flex;
838
853
  align-items: center;
839
854
  gap: 8px;
840
855
  width: 100%;
841
- `,vh=m.div`
856
+ `,Nh=g.div`
842
857
  display: flex;
843
858
  flex-direction: column;
844
859
  gap: 0;
845
860
  max-height: 240px;
846
861
  overflow-y: auto;
847
- `,yh=m.div`
862
+ `,Oh=g.div`
848
863
  display: flex;
849
864
  align-items: center;
850
865
  gap: 8px;
@@ -855,29 +870,29 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
855
870
  &:hover {
856
871
  background-color: ${({$selected:e,theme:t})=>e?t.v2.colors.silver[600]:t.v2.colors.silver[700]};
857
872
  }
858
- `,Ch=m.div`
873
+ `,Rh=g.div`
859
874
  flex: 1;
860
875
  min-width: 0;
861
876
  overflow: hidden;
862
877
  text-overflow: ellipsis;
863
878
  white-space: nowrap;
864
- `,Sh=m.div`
879
+ `,Dh=g.div`
865
880
  display: flex;
866
881
  align-items: center;
867
882
  gap: 2px;
868
883
  flex-shrink: 0;
869
- `,wh=m.div`
884
+ `,Ph=g.div`
870
885
  display: flex;
871
886
  padding-top: 4px;
872
887
  border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
873
- `,xh=()=>{const l=f(),{isVm:r}=y(),{clearStore:c}=Fa(),{dataStreamsApi:d}=sl();d.useDataStreams();const{dataStreams:u,selectedStreamName:p,setSelectedStreamName:h}=Ge(),g=i(null),[m,b]=s(!1),[v,C]=s(""),[S,w]=s(""),[x,T]=s(!1),[k,$]=s(!1),[E,I]=s(!1),[A,N]=s(""),[O,R]=s(!1);uo(g,()=>b(!1)),n(()=>{m||C("")},[m]);const D=a(()=>{if(!v)return u;const e=v.toLowerCase();return u.filter(({name:t})=>t.toLowerCase().includes(e))},[u,v]),P=m?Si:wi;return r?null:e(o,{children:[e(gh,{ref:g,children:[e(mh,{"data-id":"data-stream-select",$isOpen:m,onClick:()=>b(e=>!e),children:[t(tl,{size:24}),t(ae,{size:le.S,weight:500,nowrap:!0,children:uh(p)}),t(Be,{label:u.length,status:ft.Unknown,textSize:le.XXXS}),t(P,{size:20,fill:l.v2.colors.silver[200]})]}),m&&e(fh,{children:[t(bh,{children:t(Zt,{value:v,onChange:C,placeholder:ph,width:"100%"})}),t(vh,{children:0===D.length?t(yh,{children:t(ae,{size:le.XS,color:ie.Secondary,children:hh})}):D.map(({name:o})=>{const n=o===La;return e(yh,{"data-id":`stream-row-${o}`,$selected:o===p,onClick:()=>(e=>{e!==p&&(c(),h(e)),b(!1)})(o),children:[t(Ch,{children:t(ae,{size:le.XS,nowrap:!0,children:o})}),e(Sh,{children:[t(st,{"data-id":`stream-edit-${o}`,icon:mi,size:rt.XS,onClick:e=>{e.stopPropagation(),b(!1),w(o),T(!0)}}),!n&&t(st,{"data-id":`stream-delete-${o}`,icon:ri,size:rt.XS,onClick:e=>{e.stopPropagation(),b(!1),N(o),R(!0)}})]})]},`stream-${o}`)})}),t(wh,{children:t(re,{"data-id":"add-stream-trigger",variant:de.Secondary,size:ce.S,leftIcon:ci,label:`${kt.NEW} ${He.STREAM_NAME}`,fullWidth:!0,onClick:()=>{b(!1),c(),I(!0),$(!0)}})})]})]}),E&&t(Wl,{defaultExcludeName:p,children:t(ou,{isOpen:k,onClose:()=>$(!1),onCloseEnd:()=>I(!1)})}),S&&t(Wl,{children:t(nu,{isOpen:x,dataStreamName:S,onClose:()=>T(!1),onCloseEnd:()=>w("")})}),t(wl,{target:`${He.STREAM_NAME.toLowerCase()} "${A}"`,isOpen:O,onClose:()=>R(!1),onApprove:async()=>{A&&await d.remove(A)}})]})},Th="multi-source-deselect",kh="multi-source-restart",$h="multi-source-uninstrument",Eh="Selected sources",Ih="Deselect",Ah="Restart",Nh="Uninstrument",Oh="Rollout Restart Workloads",Rh="Are you sure you want to rollout restart these workloads?",Dh="Go Back",Ph="Confirm",Fh=()=>{const{selectedStreamName:i}=Ge(),{selectedSources:r,setSelectedSources:c}=xa(),{sourcesApi:d}=sl(),[u,p]=s(!1),[h,g]=s(!1),m=a(()=>Object.values(r).reduce((e,t)=>e+t.length,0),[r]),f=l(()=>{c({})},[c]),b=l(()=>p(!1),[]),v=l(()=>g(!1),[]);n(()=>{f()},[i,f]);const y=l(()=>{d.restartWorkloads(Object.values(r).flat().filter(e=>e.id.kind!==io.StaticPod).map(to)),f()},[d,r,f]),C=l(()=>{d.persistV2(Object.fromEntries(Object.entries(r).map(([e,t])=>[e,t.map(({id:e})=>({namespace:e.namespace,name:e.name,kind:e.kind||void 0,selected:!1,currentStreamName:i}))]))),f()},[d,r,i,f]),S=a(()=>[{id:Th,type:qt.Button,buttonProps:{variant:de.Text,size:ce.S,label:Ih,onClick:f}},{id:kh,type:qt.Button,buttonProps:{variant:de.Secondary,size:ce.S,label:Ah,leftIcon:Gi,onClick:()=>p(!0)}},{id:$h,type:qt.Button,buttonProps:{variant:de.Primary,size:ce.S,label:Nh,leftIcon:ri,onClick:()=>g(!0)}}],[f]);return e(o,{children:[t(ma,{isOpen:m>0,richTitle:{icon:$i,title:Eh,badge:{label:m}},actions:S}),t(Ue,{isOpen:u,title:Oh,description:Rh,onClose:b,denyButton:{label:Dh,variant:de.Secondary,onClick:b},approveButton:{label:Ph,variant:de.Primary,onClick:()=>{y(),b()}}}),t(wl,{isOpen:h,action:"uninstrument",target:`${m} source${1===m?"":"s"}`,onClose:v,onDeny:v,onApprove:C})]})},Lh=v`
888
+ `,Fh=()=>{const l=f(),{isVm:r}=y(),{clearStore:c}=Da(),{dataStreamsApi:d}=ll();d.useDataStreams();const{dataStreams:u,selectedStreamName:p,setSelectedStreamName:h}=He(),m=i(null),[g,b]=s(!1),[v,C]=s(""),[S,w]=s(""),[x,k]=s(!1),[T,$]=s(!1),[I,E]=s(!1),[A,N]=s(""),[O,R]=s(!1);cn(m,()=>b(!1)),o(()=>{g||C("")},[g]);const D=a(()=>{if(!v)return u;const e=v.toLowerCase();return u.filter(({name:t})=>t.toLowerCase().includes(e))},[u,v]),P=g?yi:Ci;return r?null:e(n,{children:[e($h,{ref:m,children:[e(Ih,{"data-id":"data-stream-select",$isOpen:g,onClick:()=>b(e=>!e),children:[t(el,{size:24}),t(ae,{size:le.S,weight:500,nowrap:!0,children:xh(p)}),t(Be,{label:u.length,status:Ie.Unknown,textSize:le.XXXS}),t(P,{size:20,fill:l.v2.colors.silver[200]})]}),g&&e(Eh,{children:[t(Ah,{children:t(Jt,{value:v,onChange:C,placeholder:kh,width:"100%"})}),t(Nh,{children:0===D.length?t(Oh,{children:t(ae,{size:le.XS,color:ie.Secondary,children:Th})}):D.map(({name:n})=>{const o=n===Pa;return e(Oh,{"data-id":`stream-row-${n}`,$selected:n===p,onClick:()=>(e=>{e!==p&&(c(),h(e)),b(!1)})(n),children:[t(Rh,{children:t(ae,{size:le.XS,nowrap:!0,children:n})}),e(Dh,{children:[t(st,{"data-id":`stream-edit-${n}`,icon:hi,size:rt.XS,onClick:e=>{e.stopPropagation(),b(!1),w(n),k(!0)}}),!o&&t(st,{"data-id":`stream-delete-${n}`,icon:li,size:rt.XS,onClick:e=>{e.stopPropagation(),b(!1),N(n),R(!0)}})]})]},`stream-${n}`)})}),t(Ph,{children:t(re,{"data-id":"add-stream-trigger",variant:de.Secondary,size:ce.S,leftIcon:si,label:`${kt.NEW} ${Ge.STREAM_NAME}`,fullWidth:!0,onClick:()=>{b(!1),c(),E(!0),$(!0)}})})]})]}),I&&t(jl,{defaultExcludeName:p,children:t(mu,{isOpen:T,onClose:()=>$(!1),onCloseEnd:()=>E(!1)})}),S&&t(jl,{children:t(gu,{isOpen:x,dataStreamName:S,onClose:()=>k(!1),onCloseEnd:()=>w("")})}),t(Sl,{target:`${Ge.STREAM_NAME.toLowerCase()} "${A}"`,isOpen:O,onClose:()=>R(!1),onApprove:async()=>{A&&await d.remove(A)}})]})},Lh="multi-source-deselect",_h="multi-source-restart",Mh="multi-source-uninstrument",zh="Selected sources",Bh="Deselect",Xh="Restart",Vh="Uninstrument",Uh="Rollout Restart Workloads",Gh="Are you sure you want to rollout restart these workloads?",Hh="Go Back",jh="Confirm",Wh=()=>{const{selectedStreamName:i}=He(),{selectedSources:r,setSelectedSources:c}=Sa(),{sourcesApi:d}=ll(),[u,p]=s(!1),[h,m]=s(!1),g=a(()=>Object.values(r).reduce((e,t)=>e+t.length,0),[r]),f=l(()=>{c({})},[c]),b=l(()=>p(!1),[]),v=l(()=>m(!1),[]);o(()=>{f()},[i,f]);const y=l(()=>{d.restartWorkloads(Object.values(r).flat().filter(e=>e.id.kind!==on.StaticPod).map(Qt)),f()},[d,r,f]),C=l(()=>{d.persistV2(Object.fromEntries(Object.entries(r).map(([e,t])=>[e,t.map(({id:e})=>({namespace:e.namespace,name:e.name,kind:e.kind||void 0,selected:!1,currentStreamName:i}))]))),f()},[d,r,i,f]),S=a(()=>[{id:Lh,type:Yt.Button,buttonProps:{variant:de.Text,size:ce.S,label:Bh,onClick:f}},{id:_h,type:Yt.Button,buttonProps:{variant:de.Secondary,size:ce.S,label:Xh,leftIcon:Gi,onClick:()=>p(!0)}},{id:Mh,type:Yt.Button,buttonProps:{variant:de.Primary,size:ce.S,label:Vh,leftIcon:li,onClick:()=>m(!0)}}],[f]);return e(n,{children:[t(vn,{isOpen:g>0,richTitle:{icon:ki,title:zh,badge:{label:g}},actions:S}),t(Ue,{isOpen:u,title:Uh,description:Gh,onClose:b,denyButton:{label:Hh,variant:de.Secondary,onClick:b},approveButton:{label:jh,variant:de.Primary,onClick:()=>{y(),b()}}}),t(Sl,{isOpen:h,action:"uninstrument",target:`${g} source${1===g?"":"s"}`,onClose:v,onDeny:v,onApprove:C})]})},Kh=v`
874
889
  0% {
875
890
  background-position: 200% 50%;
876
891
  }
877
892
  100% {
878
893
  background-position: 0% 50%;
879
894
  }
880
- `,_h=m.div`
895
+ `,Yh=g.div`
881
896
  display: flex;
882
897
  align-items: center;
883
898
  justify-content: space-evenly;
@@ -888,50 +903,50 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
888
903
 
889
904
  background: ${({theme:e})=>`linear-gradient(90deg, ${e.v2.colors.pink[500]} 0%, ${e.v2.colors.purple[400]} 25%, ${e.v2.colors.green[500]} 50%, ${e.v2.colors.purple[400]} 75%, ${e.v2.colors.pink[500]} 100%)`};
890
905
  background-size: 200% 100%;
891
- animation: ${Lh} 15s linear infinite;
892
- `,zh=[ki,$i,yi,Ci],Mh=({onRedirectToSampling:o})=>{const n=f();return e(ga,{children:[e(et,{fullHeight:!0,customTitle:t(xh,{}),customSearch:t(ch,{}),filters:t(Np,{}),children:[t(_h,{children:zh.map((o,a)=>e(r,{children:[t(o,{size:24}),a<zh.length-1&&t(vi,{fill:n.v2.colors.white[500]+ot["020"],size:24})]},o.name))}),t(eh,{})]}),t(dh,{onRedirectToSampling:o}),t(Fh,{})]})};var Bh;!function(e){e.Gateway="gateway",e.Node="node"}(Bh||(Bh={}));const Xh=({onClickDownloadDiagnose:o,onClickRefresh:n,loading:i,disabled:l})=>{const s=a(()=>{const e=[];return o&&e.push({id:Uo(),type:qt.Button,buttonProps:{label:"Download Diagnose",leftIcon:Hi,size:ce.S,variant:de.Text,onClick:o,disabled:l}}),n&&e.push({id:Uo(),type:qt.Button,buttonProps:{label:"Refresh",leftIcon:Ri,size:ce.S,variant:de.Text,onClick:n,disabled:l,loading:i}}),e},[o,n,l,i]);return e(se,{$alignItems:"center",$justifyContent:"space-between",children:[t(_a,{icon:ol,title:"Collectors Pipeline"}),t(za,{actions:s})]})},Vh=({pod:o,onClose:n})=>{const{formatTimeAgo:i}=Bt(),{collectorsApi:l}=sl(),{data:s}=l.usePodInfo(o?{namespace:o.namespace,name:o.name}:void 0,{skip:!o}),r=a(()=>[{id:Uo(),title:"Node",label:s?.node??"-",withCopy:!0},{id:Uo(),title:"Status",badge:{status:Ma(s?.status),label:s?.status??"-"}}],[s]),c=a(()=>s?.containers?.map(e=>({id:Uo(),items:[{id:Uo(),title:"Container",label:e.name??"-"},{id:Uo(),title:"Status",label:e.startedAt?`${e.status} (since ${i(e.startedAt)})`:e.status},{id:Uo(),title:"Ready",badge:{status:e.ready?Ee.Success:Ee.Error,leftIcon:e.ready?ui:pi,label:e.ready?"True":"False",invertColors:!0}},{id:Uo(),title:"Started",badge:{status:e.started?Ee.Success:Ee.Error,leftIcon:e.started?ui:pi,label:e.started?"True":"False",invertColors:!0}},{id:Uo(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:Uo(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:Uo(),title:He.RESTARTS,label:e.restarts.toString()},{id:Uo(),title:"State Reason",label:e.stateReason??"-"},{id:Uo(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:Uo(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[s]);return t(oe,{isOpen:!!o,header:{icon:Ai,title:"Pod Information",onClose:n},children:s?e(Et,{bgTint:"1000",richTitle:{icon:Ai,title:s.name,withCopy:!0},children:[t(Et,{bgTint:"900",cellsPerRow:2,items:r}),e(Et,{bgTint:"900",richTitle:{icon:zi,title:He.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:[t(Jt,{value:`kubectl get pod ${s.name} -n ${s.namespace} -o yaml`}),t(Jt,{value:`kubectl describe pod ${s.name} -n ${s.namespace}`}),t(Jt,{value:`kubectl logs ${s.name} -n ${s.namespace}`})]}),t(Et,{bgTint:"900",richTitle:{title:"Containers Overview"},withCollapse:!0,collapseIsDefaultOpen:!0,children:c.length?c.map(({id:e,items:o})=>t(Et,{bgTint:"800",cellsPerRow:2,items:o},e)):t(Ce,{title:"No containers",subTitle:"Pod has no containers"})}),t(Tl,{bgTint:"900",yaml:s.manifestYAML,defaultOpen:!0})]}):t(at,{$height:"50vh",children:t(ct,{withSpinner:!0})})})};var Uh;!function(e){e.PodName="podName",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.SpanDropRate="spanDropRate",e.Age="age",e.DockerImage="dockerImage"}(Uh||(Uh={}));const Hh=e=>{const t=[{key:Uh.PodName,label:"Pod Name"},{key:Uh.Status,label:"Status"},{key:Uh.Restarts,label:He.RESTARTS},{key:Uh.NodeName,label:"Node Name"},{key:Uh.Age,label:"Age"},{key:Uh.DockerImage,label:"Collector Version"}];return e&&t.splice(4,0,{key:Uh.SpanDropRate,label:"Span Drop Rate",noSort:!0,noFilter:!0}),t},Gh=({isLoading:o,pods:n,withSpanDropRate:i})=>{const l=f(),{formatTimeAgo:r}=Bt(),[c,d]=s(null),u=a(()=>n.map(o=>({onClick:()=>d(o),cells:[{key:Uh.PodName,rawValue:o.name},{key:Uh.Status,rawValue:o.status,component:()=>{return e=o.status,t(Be,{status:Ma(e),label:e});var e}},{key:Uh.Restarts,rawValue:o.restartsCount.toString()},{key:Uh.NodeName,rawValue:o.nodeName},{key:Uh.SpanDropRate,rawValue:0,component:()=>{const{collectorMetrics:n}=o;if(!n)return t(ae,{children:"-"});const a=(n?.metricsAcceptedRps??0)+(n?.metricsDroppedRps??0),i=a>0?Math.round((n?.metricsDroppedRps??0)/a*100):0,l=i>0?Ee.Error:Ee.Success,s=(n?.exporterSuccessRps??0)+(n?.exporterFailedRps??0),r=s>0?Math.round((n?.exporterFailedRps??0)/s*100):0,c=r>0?Ee.Error:Ee.Success;return e(se,{$gap:4,children:[t(De,{text:`Accepted: ${n.metricsAcceptedRps.toLocaleString()} spans/s\nDropped: ${n.metricsDroppedRps.toLocaleString()} spans/s`,children:t(Be,{status:l,label:`Receiver ${i}%`,leftIcon:l===Ee.Error?nl:al,useSecondaryTone:!0,invertColors:!0})}),t(De,{text:`Success: ${n.exporterSuccessRps.toLocaleString()} spans/s\nFailed: ${n.exporterFailedRps.toLocaleString()} spans/s`,children:t(Be,{status:c,label:`Exporter ${r}%`,leftIcon:c===Ee.Error?nl:al,useSecondaryTone:!0,invertColors:!0})})]})}},{key:Uh.Age,rawValue:r(o.creationTimestamp)},{key:Uh.DockerImage,rawValue:o.image}]})),[n,l]);return e(Et,{fullHeight:!0,bgTint:"1000",moreSpacing:!0,richTitle:{icon:Ai,title:"Pods"},children:[t(vo,{variant:yo.Data,isLoading:o,columns:Hh(i),rows:u}),t(Vh,{pod:c,onClose:()=>d(null)})]})},jh=({isOpen:e,onClose:o,title:n,yaml:a})=>t(oe,{isOpen:e,header:{icon:il,title:n,onClose:o},children:t(Tl,{yaml:a,defaultOpen:!0})}),Wh=e=>{switch(e){case Ba.Healthy:return"All desired replicas are updated, available, and ready";case Ba.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case Ba.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case Ba.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case Ba.Down:return"No available replicas";case Ba.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}};var Kh;!function(e){e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"}(Kh||(Kh={}));const Yh=m.div`
906
+ animation: ${Kh} 15s linear infinite;
907
+ `,Jh=[xi,ki,bi,vi],qh=({onRedirectToSampling:n})=>{const o=f();return e(ha,{children:[e(et,{fullHeight:!0,customTitle:t(Fh,{}),customSearch:t(Sh,{}),filters:t(Vp,{}),children:[t(Yh,{children:Jh.map((n,a)=>e(r,{children:[t(n,{size:24}),a<Jh.length-1&&t(fi,{fill:o.v2.colors.white[500]+nt["020"],size:24})]},n.name))}),t(ph,{})]}),t(wh,{onRedirectToSampling:n}),t(Wh,{})]})};var Zh;!function(e){e.Gateway="gateway",e.Node="node"}(Zh||(Zh={}));const Qh=({onClickDownloadDiagnose:n,onClickRefresh:o,loading:i,disabled:l})=>{const s=a(()=>{const e=[];return n&&e.push({id:Vn(),type:Yt.Button,buttonProps:{label:"Download Diagnose",leftIcon:Ui,size:ce.S,variant:de.Text,onClick:n,disabled:l}}),o&&e.push({id:Vn(),type:Yt.Button,buttonProps:{label:"Refresh",leftIcon:Ni,size:ce.S,variant:de.Text,onClick:o,disabled:l,loading:i}}),e},[n,o,l,i]);return e(se,{$alignItems:"center",$justifyContent:"space-between",children:[t(Fa,{icon:tl,title:"Collectors Pipeline"}),t(La,{actions:s})]})},em=({pod:n,onClose:o})=>{const{formatTimeAgo:i}=zt(),{collectorsApi:l}=ll(),{data:s}=l.usePodInfo(n?{namespace:n.namespace,name:n.name}:void 0,{skip:!n}),r=a(()=>[{id:Vn(),title:"Node",label:s?.node??"-",withCopy:!0},{id:Vn(),title:"Status",badge:{status:_a(s?.status),label:s?.status??"-"}}],[s]),c=a(()=>s?.containers?.map(e=>({id:Vn(),items:[{id:Vn(),title:"Container",label:e.name??"-"},{id:Vn(),title:"Status",label:e.startedAt?`${e.status} (since ${i(e.startedAt)})`:e.status},{id:Vn(),title:"Ready",badge:{status:e.ready?Ie.Success:Ie.Error,leftIcon:e.ready?ci:di,label:e.ready?"True":"False",invertColors:!0}},{id:Vn(),title:"Started",badge:{status:e.started?Ie.Success:Ie.Error,leftIcon:e.started?ci:di,label:e.started?"True":"False",invertColors:!0}},{id:Vn(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:Vn(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:Vn(),title:Ge.RESTARTS,label:e.restarts.toString()},{id:Vn(),title:"State Reason",label:e.stateReason??"-"},{id:Vn(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:Vn(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[s]);return t(ne,{isOpen:!!n,header:{icon:Ii,title:"Pod Information",onClose:o},children:s?e($t,{bgTint:"1000",richTitle:{icon:Ii,title:s.name,withCopy:!0},children:[t($t,{bgTint:"900",cellsPerRow:2,items:r}),e($t,{bgTint:"900",richTitle:{icon:Li,title:Ge.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:[t(Kt,{value:`kubectl get pod ${s.name} -n ${s.namespace} -o yaml`}),t(Kt,{value:`kubectl describe pod ${s.name} -n ${s.namespace}`}),t(Kt,{value:`kubectl logs ${s.name} -n ${s.namespace}`})]}),t($t,{bgTint:"900",richTitle:{title:"Containers Overview"},withCollapse:!0,collapseIsDefaultOpen:!0,children:c.length?c.map(({id:e,items:n})=>t($t,{bgTint:"800",cellsPerRow:2,items:n},e)):t(Ce,{title:"No containers",subTitle:"Pod has no containers"})}),t(xl,{bgTint:"900",yaml:s.manifestYAML,defaultOpen:!0})]}):t(at,{$height:"50vh",children:t(ct,{withSpinner:!0})})})};var tm;!function(e){e.PodName="podName",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.SpanDropRate="spanDropRate",e.Age="age",e.DockerImage="dockerImage"}(tm||(tm={}));const nm=e=>{const t=[{key:tm.PodName,label:"Pod Name"},{key:tm.Status,label:"Status"},{key:tm.Restarts,label:Ge.RESTARTS},{key:tm.NodeName,label:"Node Name"},{key:tm.Age,label:"Age"},{key:tm.DockerImage,label:"Collector Version"}];return e&&t.splice(4,0,{key:tm.SpanDropRate,label:"Span Drop Rate",noSort:!0,noFilter:!0}),t},om=({isLoading:n,pods:o,withSpanDropRate:i})=>{const l=f(),{formatTimeAgo:r}=zt(),[c,d]=s(null),u=a(()=>o.map(n=>({onClick:()=>d(n),cells:[{key:tm.PodName,rawValue:n.name},{key:tm.Status,rawValue:n.status,component:()=>{return e=n.status,t(Be,{status:_a(e),label:e});var e}},{key:tm.Restarts,rawValue:n.restartsCount.toString()},{key:tm.NodeName,rawValue:n.nodeName},{key:tm.SpanDropRate,rawValue:0,component:()=>{const{collectorMetrics:o}=n;if(!o)return t(ae,{children:"-"});const a=(o?.metricsAcceptedRps??0)+(o?.metricsDroppedRps??0),i=a>0?Math.round((o?.metricsDroppedRps??0)/a*100):0,l=i>0?Ie.Error:Ie.Success,s=(o?.exporterSuccessRps??0)+(o?.exporterFailedRps??0),r=s>0?Math.round((o?.exporterFailedRps??0)/s*100):0,c=r>0?Ie.Error:Ie.Success;return e(se,{$gap:4,children:[t(De,{text:`Accepted: ${o.metricsAcceptedRps.toLocaleString()} spans/s\nDropped: ${o.metricsDroppedRps.toLocaleString()} spans/s`,children:t(Be,{status:l,label:`Receiver ${i}%`,leftIcon:l===Ie.Error?nl:ol,useSecondaryTone:!0,invertColors:!0})}),t(De,{text:`Success: ${o.exporterSuccessRps.toLocaleString()} spans/s\nFailed: ${o.exporterFailedRps.toLocaleString()} spans/s`,children:t(Be,{status:c,label:`Exporter ${r}%`,leftIcon:c===Ie.Error?nl:ol,useSecondaryTone:!0,invertColors:!0})})]})}},{key:tm.Age,rawValue:r(n.creationTimestamp)},{key:tm.DockerImage,rawValue:n.image}]})),[o,l]);return e($t,{fullHeight:!0,bgTint:"1000",moreSpacing:!0,richTitle:{icon:Ii,title:"Pods"},children:[t(fn,{variant:bn.Data,isLoading:n,columns:nm(i),rows:u}),t(em,{pod:c,onClose:()=>d(null)})]})},am=({isOpen:e,onClose:n,title:o,yaml:a})=>t(ne,{isOpen:e,header:{icon:al,title:o,onClose:n},children:t(xl,{yaml:a,defaultOpen:!0})}),im=e=>{switch(e){case Ma.Healthy:return"All desired replicas are updated, available, and ready";case Ma.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case Ma.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case Ma.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case Ma.Down:return"No available replicas";case Ma.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}};var lm;!function(e){e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"}(lm||(lm={}));const sm=g.div`
893
908
  flex: 0.5;
894
909
  padding: 12px;
895
910
  border-radius: 12px;
896
911
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
897
- `,Jh=({selectedTab:o,gatewayInfo:n,nodeCollectorInfo:i,isLoading:l})=>{const{formatTimeAgo:r}=Bt(),[c,d]=s(null),u=a(()=>(e=>{switch(e){case Bh.Gateway:return"Deployment";case Bh.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(o),[o]),p=a(()=>((e,t,o,n)=>{const a={status:ft.Disabled,label:"No rollouts yet"};let i=!1,l=null;switch(e){case Bh.Gateway:i=t?.rolloutInProgress??!1,l=t?.lastRolloutAt??null;break;case Bh.Node:i=o?.rolloutInProgress??!1,l=o?.lastRolloutAt??null;break;default:return a}return i?{status:Ee.Info,label:"Rollout in progress",rightIcon:Ri,useSecondaryTone:!0}:l?{status:ft.Disabled,label:`Last Rollout: ${n(l)}`}:a})(o,n,i,r),[n,i,o,r]),h=a(()=>((e,t,o,n)=>{let a=n?Ee.Info:ft.Unknown,i=n?"Loading":Ba.Unknown,l=n?"Fetching data...":Wh(Ba.Unknown);switch(e){case Bh.Gateway:a=t?.status?Ma(t?.status):a,i=t?.status??i,l=t?.status?Wh(t.status):l;break;case Bh.Node:a=o?.status?Ma(o?.status):a,i=o?.status??i,l=o?.status?Wh(o.status):l}return{status:a,title:i,description:l}})(o,n,i,l),[n,i,o,l]),g=a(()=>((e,t,o)=>{switch(e){case Bh.Gateway:return[{gaugeWidth:128,min:0,max:t?.hpa?.max??0,current:t?.hpa?.current??0,title:"HPA Spec",primaryLabel:"Current replicas",secondaryLabel:"Max replicas"}];case Bh.Node:return[{gaugeWidth:128,min:0,max:o?.nodes?.desired??0,current:o?.nodes?.ready??0,title:"Nodes",primaryLabel:"Ready nodes",secondaryLabel:"Desired nodes"}];default:return[]}})(o,n,i),[n,i,o]),m=a(()=>((e,t,o,n)=>{switch(e){case Bh.Gateway:return[{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${t?.resources?.requests.cpu}/${t?.resources?.limits.cpu}`,isLoading:n},{label:"Memory",value:`${t?.resources?.requests.memory}/${t?.resources?.limits.memory}`,isLoading:n}]}];case Bh.Node:return[{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${o?.resources?.requests.cpu}/${o?.resources?.limits.cpu}`,isLoading:n},{label:"Memory",value:`${o?.resources?.requests.memory}/${o?.resources?.limits.memory}`,isLoading:n}]}];default:return[]}})(o,n,i,l),[n,i,o,l]),f=a(()=>(o===Bh.Gateway?n?.manifestYAML:i?.manifestYAML)??"",[n,i,o]),b=a(()=>(o===Bh.Gateway?n?.configMapYAML:i?.configMapYAML)??"",[n,i,o]);return e(Et,{bgTint:"1000",moreSpacing:!0,richTitle:{icon:il,title:u,badge:p},actions:[{id:Uo(),type:qt.ButtonDropData,buttonProps:{variant:de.Secondary,size:ce.S,label:"View YAML",onClick:e=>d(e)},dropDataProps:{items:[{id:Kh.ManifestYaml,label:u,icon:ll},{id:Kh.ConfigMapYaml,label:"ConfigMap",icon:ll}]}}],children:[e(se,{$gap:16,children:[t("div",{children:t(Xa,{...h})}),g.map(e=>t(Yh,{children:t("div",{children:t(Va,{...e})})},e.title)),m.map(e=>t(Ua,{...e},e.title))]}),t(jh,{isOpen:c===Kh.ManifestYaml,onClose:()=>d(null),title:u,yaml:f}),t(jh,{isOpen:c===Kh.ConfigMapYaml,onClose:()=>d(null),title:"ConfigMap",yaml:b})]})},qh=[{value:Bh.Gateway,label:"Gateway"},{value:Bh.Node,label:"Node Collector"}],Zh=({minSupportedVersion:o=0})=>{const{isVersionSupported:n,version:i}=y(o),[r,c]=s(Bh.Gateway),d=r===Bh.Gateway,u=r===Bh.Node,{collectorsApi:p,configApi:h}=sl(),{data:g}=h.useEffectiveConfig(),{data:m,loading:f,refetch:b}=p.useGatewayInfo({skip:!d}),{data:v=[],loading:C,refetch:S}=p.useGatewayPods({skip:!d}),{data:w,loading:x,refetch:T}=p.useNodeCollectorInfo({skip:!u}),{data:k=[],loading:$,refetch:E}=p.useNodeCollectorPods({skip:!u}),I=d&&(f||C)||u&&(x||$),A=l(()=>{d?(b(),S()):u&&(T(),E())},[d,u,b,S,T,E]),N=a(()=>d?v:k,[v,k,d]);return e(ga,{children:[t(Xh,{disabled:!n,loading:I,onClickDownloadDiagnose:void 0,onClickRefresh:A}),e(Ha,{children:[e(W,{children:[t(ue,{variant:fo.Underline,size:we.L,options:qh,selected:r,setSelected:c}),t(Jh,{selectedTab:r,gatewayInfo:m??null,nodeCollectorInfo:w??null,isLoading:I})]}),t(Gh,{isLoading:I,pods:N,withSpanDropRate:!1===g?.odigosOwnTelemetryStore?.metricsStoreDisabled}),!n&&t(El,{minSupportedVersion:o,currentVersion:i||""})]})]})},Qh=m.div`
912
+ `,rm=({selectedTab:n,gatewayInfo:o,nodeCollectorInfo:i,isLoading:l})=>{const{formatTimeAgo:r}=zt(),[c,d]=s(null),u=a(()=>(e=>{switch(e){case Zh.Gateway:return"Deployment";case Zh.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(n),[n]),p=a(()=>((e,t,n,o)=>{const a={status:Ie.Disabled,label:"No rollouts yet"};let i=!1,l=null;switch(e){case Zh.Gateway:i=t?.rolloutInProgress??!1,l=t?.lastRolloutAt??null;break;case Zh.Node:i=n?.rolloutInProgress??!1,l=n?.lastRolloutAt??null;break;default:return a}return i?{status:Ie.Info,label:"Rollout in progress",rightIcon:Ni,useSecondaryTone:!0}:l?{status:Ie.Disabled,label:`Last Rollout: ${o(l)}`}:a})(n,o,i,r),[o,i,n,r]),h=a(()=>((e,t,n,o)=>{let a=o?Ie.Info:Ie.Unknown,i=o?"Loading":Ma.Unknown,l=o?"Fetching data...":im(Ma.Unknown);switch(e){case Zh.Gateway:a=t?.status?_a(t?.status):a,i=t?.status??i,l=t?.status?im(t.status):l;break;case Zh.Node:a=n?.status?_a(n?.status):a,i=n?.status??i,l=n?.status?im(n.status):l}return{status:a,title:i,description:l}})(n,o,i,l),[o,i,n,l]),m=a(()=>((e,t,n)=>{switch(e){case Zh.Gateway:return[{gaugeWidth:128,min:0,max:t?.hpa?.max??0,current:t?.hpa?.current??0,title:"HPA Spec",primaryLabel:"Current replicas",secondaryLabel:"Max replicas"}];case Zh.Node:return[{gaugeWidth:128,min:0,max:n?.nodes?.desired??0,current:n?.nodes?.ready??0,title:"Nodes",primaryLabel:"Ready nodes",secondaryLabel:"Desired nodes"}];default:return[]}})(n,o,i),[o,i,n]),g=a(()=>((e,t,n,o)=>{switch(e){case Zh.Gateway:return[{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${t?.resources?.requests.cpu}/${t?.resources?.limits.cpu}`,isLoading:o},{label:"Memory",value:`${t?.resources?.requests.memory}/${t?.resources?.limits.memory}`,isLoading:o}]}];case Zh.Node:return[{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${n?.resources?.requests.cpu}/${n?.resources?.limits.cpu}`,isLoading:o},{label:"Memory",value:`${n?.resources?.requests.memory}/${n?.resources?.limits.memory}`,isLoading:o}]}];default:return[]}})(n,o,i,l),[o,i,n,l]),f=a(()=>(n===Zh.Gateway?o?.manifestYAML:i?.manifestYAML)??"",[o,i,n]),b=a(()=>(n===Zh.Gateway?o?.configMapYAML:i?.configMapYAML)??"",[o,i,n]);return e($t,{bgTint:"1000",moreSpacing:!0,richTitle:{icon:al,title:u,badge:p},actions:[{id:Vn(),type:Yt.ButtonDropData,buttonProps:{variant:de.Secondary,size:ce.S,label:"View YAML",onClick:e=>d(e)},dropDataProps:{items:[{id:lm.ManifestYaml,label:u,icon:il},{id:lm.ConfigMapYaml,label:"ConfigMap",icon:il}]}}],children:[e(se,{$gap:16,children:[t("div",{children:t(za,{...h})}),m.map(e=>t(sm,{children:t("div",{children:t(Ba,{...e})})},e.title)),g.map(e=>t(Xa,{...e},e.title))]}),t(am,{isOpen:c===lm.ManifestYaml,onClose:()=>d(null),title:u,yaml:f}),t(am,{isOpen:c===lm.ConfigMapYaml,onClose:()=>d(null),title:"ConfigMap",yaml:b})]})},cm=[{value:Zh.Gateway,label:"Gateway"},{value:Zh.Node,label:"Node Collector"}],dm=({minSupportedVersion:n=0})=>{const{isVersionSupported:o,version:i}=y(n),[r,c]=s(Zh.Gateway),d=r===Zh.Gateway,u=r===Zh.Node,{collectorsApi:p,configApi:h}=ll(),{data:m}=h.useEffectiveConfig(),{data:g,loading:f,refetch:b}=p.useGatewayInfo({skip:!d}),{data:v=[],loading:C,refetch:S}=p.useGatewayPods({skip:!d}),{data:w,loading:x,refetch:k}=p.useNodeCollectorInfo({skip:!u}),{data:T=[],loading:$,refetch:I}=p.useNodeCollectorPods({skip:!u}),E=d&&(f||C)||u&&(x||$),A=l(()=>{d?(b(),S()):u&&(k(),I())},[d,u,b,S,k,I]),N=a(()=>d?v:T,[v,T,d]);return e(ha,{children:[t(Qh,{disabled:!o,loading:E,onClickDownloadDiagnose:void 0,onClickRefresh:A}),e(Va,{children:[e(W,{children:[t(ue,{variant:mn.Underline,size:we.L,options:cm,selected:r,setSelected:c}),t(rm,{selectedTab:r,gatewayInfo:g??null,nodeCollectorInfo:w??null,isLoading:E})]}),t(om,{isLoading:E,pods:N,withSpanDropRate:!1===m?.odigosOwnTelemetryStore?.metricsStoreDisabled}),!o&&t($l,{minSupportedVersion:n,currentVersion:i||""})]})]})},um=g.div`
898
913
  display: inline-flex;
899
914
  align-items: center;
900
915
  min-width: 0;
901
916
  overflow: hidden;
902
917
  white-space: pre;
903
918
  text-overflow: ellipsis;
904
- `,eg=m.div`
919
+ `,pm=g.div`
905
920
  display: flex;
906
921
  flex-direction: column;
907
922
  gap: 4px;
908
923
  min-width: 0;
909
924
  flex: 1;
910
925
  opacity: ${({$disabled:e})=>e?.4:1};
911
- `,tg=m(se)`
926
+ `,hm=g(se)`
912
927
  flex-shrink: 0;
913
928
  gap: 6px;
914
929
  align-items: center;
915
930
  min-height: 22px;
916
- `;const og=[{key:"content",label:"Content",noSort:!0,noFilter:!0,flex:1},{key:"badges",label:"Type",noSort:!0,noFilter:!0,flex:"0 0 128px"}],ng=[{value:"all",label:ja},{value:"Relevance",label:"Relevance"},{value:"Duration",label:"Duration"},{value:"Error",label:"Error"}],ag=({title:o,items:n,isLoading:i,showTypeFilter:r,onRuleClick:c,onCreateRule:d,onEditRule:u,onDeleteRule:p})=>{const h=f(),[g,m]=s(""),[b,v]=s("all"),y=a(()=>{let e=function(e,t,o){return o&&"all"!==t?e.filter(e=>e.typeBadge===t):e}(n,b,r);return e=function(e,t){if(!t.trim())return e;const o=t.toLowerCase();return e.filter(e=>{const t=e.name?.toLowerCase().includes(o),n=e.summary.map(e=>e.text).join("").toLowerCase();return t||n.includes(o)})}(e,g),e},[n,b,r,g]),C=a(()=>y.map(o=>{const n=o.typeBadge?function(e,t){const o=e.v2.colors;switch(t){case"Relevance":return{bg:o.blue[700],text:o.white[500]};case"Duration":return{bg:o.purple[700],text:o.white[500]};case"Error":return{bg:o.red[500],text:o.black[500]}}}(h,o.typeBadge):void 0;return{cells:[{key:"content",rawValue:o.summary.map(e=>e.text).join(""),component:()=>e(eg,{$disabled:o.disabled,children:[t(Qh,{children:t(S,{parts:o.summary})}),o.name&&t(ae,{size:le.XXS,color:ie.Secondary,nowrap:!0,children:o.name})]})},{key:"badges",rawValue:o.typeBadge||"",component:()=>e(tg,{children:[o.disabled&&t(Be,{label:Ga,textSize:le.XXXS,backgroundColor:h.v2.colors.grey[700],textColor:h.v2.colors.grey[300]}),o.typeBadge&&n&&t(Be,{label:o.typeBadge,textSize:le.XXXS,backgroundColor:n.bg,textColor:n.text})]})}],onClick:()=>c(o)}}),[y,h,c]),w=a(()=>{const e=e=>t(gi,{...e,fill:h.v2.colors.red[500]});return e.displayName="RedDeleteIcon",e},[h]),x=l(e=>{const t=C.indexOf(e);if(t<0)return[];const o=y[t];return o?[{id:"edit","data-id":"sampling-rule-action-edit",label:xo,leftIcon:mi,onClick:()=>u(o.ruleId,o.samplingId)},{id:"delete","data-id":"sampling-rule-action-delete",label:"",leftIcon:w,onClick:()=>p(o.ruleId,o.samplingId)}]:[]},[C,y,u,p,w]);return t(et,{fullHeight:!0,richTitle:{icon:Wi,title:o,badge:{label:n.length,backgroundColor:h.v2.colors.silver[600],textColor:h.v2.colors.white[500]}},search:{"data-id":"sampling-search-rules",value:g,onChange:m,placeholder:"Search..",width:"500px",...r?{segment:{"data-id":"sampling-segment-type-filter",options:ng,selected:b,setSelected:v}}:{}},children:t(vo,{variant:yo.Pretty,hideHeader:!0,isLoading:i,noDataProps:g.trim()?{hideIcon:!0,title:Wa,subTitle:Ja(g)}:{hideIcon:!0,title:Ya,button:{label:Ka,onClick:d}},columns:og,rows:C,getRowActions:x})})},ig=({docsUrl:o})=>{const{samplingApi:r,sourcesApi:c}=sl(),{items:d}=c.useSources(),u=a(()=>d.map(e=>({id:e.id})),[d]),{items:p,loading:h,k8sHealthProbesConfig:g,refetch:m}=r.useSamplingRules(),f=l((e,t)=>r.createNoisy?.({samplingId:e,rule:t}),[r]),b=l((e,t,o)=>r.updateNoisy?.(t,{samplingId:e,rule:o}),[r]),v=l((e,t)=>r.createHighlyRelevant?.({samplingId:e,rule:t}),[r]),y=l((e,t,o)=>r.updateHighlyRelevant?.(t,{samplingId:e,rule:o}),[r]),C=l((e,t)=>r.createCostReduction?.({samplingId:e,rule:t}),[r]),S=l((e,t,o)=>r.updateCostReduction?.(t,{samplingId:e,rule:o}),[r]),w=l((e,t,o)=>"noisy"===o?r.deleteNoisy?.(t,e):"highlyRelevant"===o?r.deleteHighlyRelevant?.(t,e):"costReduction"===o?r.deleteCostReduction?.(t,e):void 0,[r]),x=l((e,t)=>r.updateK8sHealthProbesConfig?.({enabled:e,keepPercentage:t}),[r]),T=a(()=>u.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:`${e.namespace} / ${e.kind} / ${e.name}`})),[u]),E=a(()=>Array.from(new Set(u.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[u]),[j,K]=s(I.Noisy),[Y,J]=s(null),[q,Z]=s(!1),[Q,ee]=s(!1),[te,oe]=s(null),[ne,ae]=s(!1),[ie,le]=s(!1),[pe,he]=s(!1),[ge,me]=s(!1);i(!1),n(()=>{},[h,p]);const{pendingViewSamplingRule:fe,setPendingViewSamplingRule:be}=eo();n(()=>{if(!fe)return;if(h||0===p.length)return;be(null);const e=A(p,fe.ruleId,fe.category);e&&(K(N[fe.category]),Z(!1),J(e))},[h,p,fe,be]);const ve=a(()=>k(g),[g]),ye=a(()=>O(p),[p]),Ce=a(()=>$(ye?.rule??null),[ye]),Se=a(()=>R(p),[p]),xe=a(()=>D(Se?.rule??null),[Se]),Te=i(Y);Te.current=Y,n(()=>{const e=Te.current;if(!e)return;const t=P(p,e);t?J(t):(J(null),Z(!1))},[p]);const ke=a(()=>{const e=new Set;return ye&&e.add(ye.rule.ruleId),Se&&e.add(Se.rule.ruleId),e},[ye,Se]),Ie=a(()=>F(p,j,ke),[p,j,ke]),Ae=l(()=>ee(!0),[]),Ne=l(()=>ee(!1),[]);l(()=>me(!1),[]);const Oe=l(async e=>{const t=p[0]?.id??"default";switch(X[j]){case"noisy":await f(t,z(e));break;case"highlyRelevant":await v(t,_(e));break;case"costReduction":await C(t,L(e))}ee(!1)},[p,j,f,v,C]),Re=l(e=>{const t=M(p,e);t&&(Z(!1),J(t))},[p]),De=l(()=>{J(null),Z(!1)},[]),Pe=l((e,t)=>{const o=Y;if(o&&o.rule.ruleId===e&&o.samplingId===t)Z(!0),J({...o});else for(const o of p){if(o.id!==t)continue;const n=[...o.noisyOperations.map(e=>({category:"noisy",rule:e})),...o.highlyRelevantOperations.map(e=>({category:"highlyRelevant",rule:e})),...o.costReductionRules.map(e=>({category:"costReduction",rule:e}))].find(t=>t.rule.ruleId===e);if(n)return Z(!0),void J({category:n.category,rule:n.rule,samplingId:t,summary:B(n.category,n.rule)})}},[Y,p]),Fe=l(async(e,t,o)=>{const n=Y?.category;if(n){switch(n){case"noisy":await b(o,t,z(e));break;case"highlyRelevant":await y(o,t,_(e));break;case"costReduction":await S(o,t,L(e))}Z(!1)}},[Y,b,y,S]),Le=l((e,t)=>{oe({ruleId:e,samplingId:t})},[]),_e=l(async()=>{if(!te)return;const{ruleId:e,samplingId:t}=te,o=Y?.category||X[j];await w(t,e,o),J(null),Z(!1),oe(null)},[te,Y,j,w]),ze=l(()=>oe(null),[]),Me=l(async(e,t)=>{await x(e,t),ae(!1)},[x]),Be=l(async e=>{const t=p[0]?.id??"default",o=ye;o?await y(o.samplingId,o.rule.ruleId,{name:o.rule.name,disabled:!e,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null,notes:o.rule.notes}):e&&await v(t,{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}),le(!1)},[p,ye,v,y]),Xe=l(async(e,t)=>{const o=p[0]?.id??"default",n=Se;n?await S(n.samplingId,n.rule.ruleId,{name:n.rule.name,disabled:!e,sourceScopes:null,operation:null,percentageAtMost:t,notes:n.rule.notes}):e&&await C(o,{name:"Auto - Drop Traces Cluster-Wide",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:t}),he(!1)},[p,Se,C,S]),Ve=l(e=>{const t=X[j];let o=null;switch(t){case"noisy":{const n=z(e);o=V(p,t,{sourceScopes:n.sourceScopes,operation:n.operation});break}case"highlyRelevant":{const n=_(e);o=V(p,t,{sourceScopes:n.sourceScopes,operation:n.operation,error:n.error??!1,durationAtLeastMs:n.durationAtLeastMs});break}case"costReduction":{const n=L(e);o=V(p,t,{sourceScopes:n.sourceScopes,operation:n.operation});break}}return o?{message:qa,ruleId:o}:null},[p,j]),He=l(e=>{const t=Y?.category,o=Y?.rule.ruleId;if(!t)return null;let n=null;switch(t){case"noisy":{const a=z(e);n=V(p,t,{sourceScopes:a.sourceScopes,operation:a.operation},o);break}case"highlyRelevant":{const a=_(e);n=V(p,t,{sourceScopes:a.sourceScopes,operation:a.operation,error:a.error??!1,durationAtLeastMs:a.durationAtLeastMs},o);break}case"costReduction":{const a=L(e);n=V(p,t,{sourceScopes:a.sourceScopes,operation:a.operation},o);break}}return n?{message:qa,ruleId:n}:null},[p,Y]),Ge=l(e=>{ee(!1);for(const t of p){const o=[...t.noisyOperations.map(e=>({category:"noisy",rule:e})),...t.highlyRelevantOperations.map(e=>({category:"highlyRelevant",rule:e})),...t.costReductionRules.map(e=>({category:"costReduction",rule:e}))].find(t=>t.rule.ruleId===e);if(o)return Z(!0),void J({category:o.category,rule:o.rule,samplingId:t.id,summary:B(o.category,o.rule)})}},[p]),We=a(()=>{const e=[];return o&&e.push({id:Uo(),type:qt.Button,buttonProps:{"data-id":"sampling-btn-docs",label:Za,leftIcon:hi,size:ce.S,variant:de.Text,onClick:()=>window.open(o,"_blank")}}),e.push({id:Uo(),type:qt.Button,buttonProps:{"data-id":"sampling-btn-refresh",label:Qa,leftIcon:Ri,size:ce.S,variant:de.Text,onClick:m,loading:h}}),e.push({id:Uo(),type:qt.Button,buttonProps:{"data-id":"sampling-btn-create-rule",label:ei,rightIcon:ci,size:ce.S,variant:de.Primary,onClick:Ae}}),e},[o,m,h,Ae]);return e(ga,{children:[e(se,{$gap:12,$justifyContent:"space-between",children:[t(_a,{icon:Wi,title:oi,subTitle:ti}),t(za,{actions:We})]}),e(W,{$gap:12,$fullHeight:!0,children:[t(ue,{variant:fo.Underline,size:we.L,options:U,selected:j,setSelected:K}),e(se,{$justifyContent:"space-between",children:[t($e,{status:Ee.Default,message:H[j]}),o&&t(re,{"data-id":"sampling-btn-docs-banner",label:"Docs",leftIcon:hi,size:ce.S,variant:de.Text,onClick:()=>window.open(o,"_blank")})]}),j===I.Noisy?t(pl,{title:qe,summary:ve,onEdit:()=>ae(!0)}):j===I.HighlyRelevant?t(pl,{title:je,summary:Ce,onEdit:()=>le(!0)}):j===I.CostReduction?t(pl,{title:Ye,summary:xe,onEdit:()=>he(!0)}):null,t(ag,{title:G[j],items:Ie,isLoading:h,showTypeFilter:j===I.HighlyRelevant,onRuleClick:Re,onCreateRule:Ae,onEditRule:Pe,onDeleteRule:Le})]}),t(jd,{formType:Fl.View,data:Y,defaultEditMode:q,onClose:De,onDelete:Le,onSaveEdit:Fe,sourceOptions:T,namespaceOptions:E,validateForm:He,onNavigateToDuplicate:Ge}),t(jd,{formType:Fl.Create,isOpen:Q,category:X[j],onClose:Ne,onSubmit:Oe,sourceOptions:T,namespaceOptions:E,validateForm:Ve,onNavigateToDuplicate:Ge}),t(jd,{formType:Fl.EditAutoNoisy,isOpen:ne,enabled:g?.enabled??!1,keepPercentage:g?.keepPercentage??0,onClose:()=>ae(!1),onSave:Me}),t(jd,{formType:Fl.EditAutoHighlyRelevant,isOpen:ie,enabled:!!ye&&!ye.rule.disabled,onClose:()=>le(!1),onSave:Be}),t(jd,{formType:Fl.EditAutoCostReduction,isOpen:pe,enabled:!!Se&&!Se.rule.disabled,dropPercentage:Se?.rule.percentageAtMost??25,onClose:()=>he(!1),onSave:Xe}),t(Ue,{title:li,description:ii,isOpen:!!te,onClose:ze,denyButton:{label:ai,variant:de.Secondary,onClick:ze},approveButton:{label:ni,variant:de.Primary,onClick:()=>{_e(),ze()}}}),false]})},lg=m.div`
931
+ `;const mm=[{key:"content",label:"Content",noSort:!0,noFilter:!0,flex:1},{key:"badges",label:"Type",noSort:!0,noFilter:!0,flex:"0 0 128px"}],gm=[{value:"all",label:Ga},{value:"Relevance",label:"Relevance"},{value:"Duration",label:"Duration"},{value:"Error",label:"Error"}],fm=({title:n,items:o,isLoading:i,showTypeFilter:r,onRuleClick:c,onCreateRule:d,onEditRule:u,onDeleteRule:p})=>{const h=f(),[m,g]=s(""),[b,v]=s("all"),y=a(()=>{let e=function(e,t,n){return n&&"all"!==t?e.filter(e=>e.typeBadge===t):e}(o,b,r);return e=function(e,t){if(!t.trim())return e;const n=t.toLowerCase();return e.filter(e=>{const t=e.name?.toLowerCase().includes(n),o=e.summary.map(e=>e.text).join("").toLowerCase();return t||o.includes(n)})}(e,m),e},[o,b,r,m]),C=a(()=>y.map(n=>{const o=n.typeBadge?function(e,t){const n=e.v2.colors;switch(t){case"Relevance":return{bg:n.blue[700],text:n.white[500]};case"Duration":return{bg:n.purple[700],text:n.white[500]};case"Error":return{bg:n.red[500],text:n.black[500]}}}(h,n.typeBadge):void 0;return{cells:[{key:"content",rawValue:n.summary.map(e=>e.text).join(""),component:()=>e(pm,{$disabled:n.disabled,children:[t(um,{children:t(S,{parts:n.summary})}),n.name&&t(ae,{size:le.XXS,color:ie.Secondary,nowrap:!0,children:n.name})]})},{key:"badges",rawValue:n.typeBadge||"",component:()=>e(hm,{children:[n.disabled&&t(Be,{label:Ua,textSize:le.XXXS,backgroundColor:h.v2.colors.grey[700],textColor:h.v2.colors.grey[300]}),n.typeBadge&&o&&t(Be,{label:n.typeBadge,textSize:le.XXXS,backgroundColor:o.bg,textColor:o.text})]})}],onClick:()=>c(n)}}),[y,h,c]),w=a(()=>{const e=e=>t(pi,{...e,fill:h.v2.colors.red[500]});return e.displayName="RedDeleteIcon",e},[h]),x=l(e=>{const t=C.indexOf(e);if(t<0)return[];const n=y[t];return n?[{id:"edit","data-id":"sampling-rule-action-edit",label:wn,leftIcon:hi,onClick:()=>u(n.ruleId,n.samplingId)},{id:"delete","data-id":"sampling-rule-action-delete",label:"",leftIcon:w,onClick:()=>p(n.ruleId,n.samplingId)}]:[]},[C,y,u,p,w]);return t(et,{fullHeight:!0,richTitle:{icon:ji,title:n,badge:{label:o.length,backgroundColor:h.v2.colors.silver[600],textColor:h.v2.colors.white[500]}},search:{"data-id":"sampling-search-rules",value:m,onChange:g,placeholder:"Search..",width:"500px",...r?{segment:{"data-id":"sampling-segment-type-filter",options:gm,selected:b,setSelected:v}}:{}},children:t(fn,{variant:bn.Pretty,hideHeader:!0,isLoading:i,noDataProps:m.trim()?{hideIcon:!0,title:Ha,subTitle:Ka(m)}:{hideIcon:!0,title:Wa,button:{label:ja,onClick:d}},columns:mm,rows:C,getRowActions:x})})},bm=({docsUrl:n})=>{const{samplingApi:r,sourcesApi:c}=ll(),{items:d}=c.useSources(),u=a(()=>d.map(e=>({id:e.id})),[d]),{items:p,loading:h,k8sHealthProbesConfig:m,refetch:g}=r.useSamplingRules(),f=l((e,t)=>r.createNoisy?.({samplingId:e,rule:t}),[r]),b=l((e,t,n)=>r.updateNoisy?.(t,{samplingId:e,rule:n}),[r]),v=l((e,t)=>r.createHighlyRelevant?.({samplingId:e,rule:t}),[r]),y=l((e,t,n)=>r.updateHighlyRelevant?.(t,{samplingId:e,rule:n}),[r]),C=l((e,t)=>r.createCostReduction?.({samplingId:e,rule:t}),[r]),S=l((e,t,n)=>r.updateCostReduction?.(t,{samplingId:e,rule:n}),[r]),w=l((e,t,n)=>"noisy"===n?r.deleteNoisy?.(t,e):"highlyRelevant"===n?r.deleteHighlyRelevant?.(t,e):"costReduction"===n?r.deleteCostReduction?.(t,e):void 0,[r]),x=l((e,t)=>r.updateK8sHealthProbesConfig?.({enabled:e,keepPercentage:t}),[r]),k=a(()=>u.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[u]),I=a(()=>Array.from(new Set(u.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[u]),[j,K]=s(E.Noisy),[Y,J]=s(null),[q,Z]=s(!1),[Q,ee]=s(!1),[te,ne]=s(null),[oe,ae]=s(!1),[ie,le]=s(!1),[pe,he]=s(!1),[me,ge]=s(!1);i(!1),o(()=>{},[h,p]);const{pendingViewSamplingRule:fe,setPendingViewSamplingRule:be}=Zt();o(()=>{if(!fe)return;if(h||0===p.length)return;be(null);const e=A(p,fe.ruleId,fe.category);e&&(K(N[fe.category]),Z(!1),J(e))},[h,p,fe,be]);const ve=a(()=>T(m),[m]),ye=a(()=>O(p),[p]),Ce=a(()=>$(ye?.rule??null),[ye]),Se=a(()=>R(p),[p]),xe=a(()=>D(Se?.rule??null),[Se]),ke=i(Y);ke.current=Y,o(()=>{const e=ke.current;if(!e)return;const t=P(p,e);t?J(t):(J(null),Z(!1))},[p]);const Te=a(()=>{const e=new Set;return ye&&e.add(ye.rule.ruleId),Se&&e.add(Se.rule.ruleId),e},[ye,Se]),Ee=a(()=>F(p,j,Te),[p,j,Te]),Ae=l(()=>ee(!0),[]),Ne=l(()=>ee(!1),[]);l(()=>ge(!1),[]);const Oe=l(async e=>{const t=p[0]?.id??"default";switch(X[j]){case"noisy":await f(t,M(e));break;case"highlyRelevant":await v(t,_(e));break;case"costReduction":await C(t,L(e))}ee(!1)},[p,j,f,v,C]),Re=l(e=>{const t=z(p,e);t&&(Z(!1),J(t))},[p]),De=l(()=>{J(null),Z(!1)},[]),Pe=l((e,t)=>{const n=Y;if(n&&n.rule.ruleId===e&&n.samplingId===t)Z(!0),J({...n});else for(const n of p){if(n.id!==t)continue;const o=[...n.noisyOperations.map(e=>({category:"noisy",rule:e})),...n.highlyRelevantOperations.map(e=>({category:"highlyRelevant",rule:e})),...n.costReductionRules.map(e=>({category:"costReduction",rule:e}))].find(t=>t.rule.ruleId===e);if(o)return Z(!0),void J({category:o.category,rule:o.rule,samplingId:t,summary:B(o.category,o.rule)})}},[Y,p]),Fe=l(async(e,t,n)=>{const o=Y?.category;if(o){switch(o){case"noisy":await b(n,t,M(e));break;case"highlyRelevant":await y(n,t,_(e));break;case"costReduction":await S(n,t,L(e))}Z(!1)}},[Y,b,y,S]),Le=l((e,t)=>{ne({ruleId:e,samplingId:t})},[]),_e=l(async()=>{if(!te)return;const{ruleId:e,samplingId:t}=te,n=Y?.category||X[j];await w(t,e,n),J(null),Z(!1),ne(null)},[te,Y,j,w]),Me=l(()=>ne(null),[]),ze=l(async(e,t)=>{await x(e,t),ae(!1)},[x]),Be=l(async e=>{const t=p[0]?.id??"default",n=ye;n?await y(n.samplingId,n.rule.ruleId,{name:n.rule.name,disabled:!e,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null,notes:n.rule.notes}):e&&await v(t,{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}),le(!1)},[p,ye,v,y]),Xe=l(async(e,t)=>{const n=p[0]?.id??"default",o=Se;o?await S(o.samplingId,o.rule.ruleId,{name:o.rule.name,disabled:!e,sourceScopes:null,operation:null,percentageAtMost:t,notes:o.rule.notes}):e&&await C(n,{name:"Auto - Drop Traces Cluster-Wide",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:t}),he(!1)},[p,Se,C,S]),Ve=l(e=>{const t=X[j];let n=null;switch(t){case"noisy":{const o=M(e);n=V(p,t,{sourceScopes:o.sourceScopes,operation:o.operation});break}case"highlyRelevant":{const o=_(e);n=V(p,t,{sourceScopes:o.sourceScopes,operation:o.operation,error:o.error??!1,durationAtLeastMs:o.durationAtLeastMs});break}case"costReduction":{const o=L(e);n=V(p,t,{sourceScopes:o.sourceScopes,operation:o.operation});break}}return n?{message:Ya,ruleId:n}:null},[p,j]),Ge=l(e=>{const t=Y?.category,n=Y?.rule.ruleId;if(!t)return null;let o=null;switch(t){case"noisy":{const a=M(e);o=V(p,t,{sourceScopes:a.sourceScopes,operation:a.operation},n);break}case"highlyRelevant":{const a=_(e);o=V(p,t,{sourceScopes:a.sourceScopes,operation:a.operation,error:a.error??!1,durationAtLeastMs:a.durationAtLeastMs},n);break}case"costReduction":{const a=L(e);o=V(p,t,{sourceScopes:a.sourceScopes,operation:a.operation},n);break}}return o?{message:Ya,ruleId:o}:null},[p,Y]),He=l(e=>{ee(!1);for(const t of p){const n=[...t.noisyOperations.map(e=>({category:"noisy",rule:e})),...t.highlyRelevantOperations.map(e=>({category:"highlyRelevant",rule:e})),...t.costReductionRules.map(e=>({category:"costReduction",rule:e}))].find(t=>t.rule.ruleId===e);if(n)return Z(!0),void J({category:n.category,rule:n.rule,samplingId:t.id,summary:B(n.category,n.rule)})}},[p]),We=a(()=>{const e=[];return n&&e.push({id:Vn(),type:Yt.Button,buttonProps:{"data-id":"sampling-btn-docs",label:Ja,leftIcon:ui,size:ce.S,variant:de.Text,onClick:()=>window.open(n,"_blank")}}),e.push({id:Vn(),type:Yt.Button,buttonProps:{"data-id":"sampling-btn-refresh",label:qa,leftIcon:Ni,size:ce.S,variant:de.Text,onClick:g,loading:h}}),e.push({id:Vn(),type:Yt.Button,buttonProps:{"data-id":"sampling-btn-create-rule",label:Za,rightIcon:si,size:ce.S,variant:de.Primary,onClick:Ae}}),e},[n,g,h,Ae]);return e(ha,{children:[e(se,{$gap:12,$justifyContent:"space-between",children:[t(Fa,{icon:ji,title:ei,subTitle:Qa}),t(La,{actions:We})]}),e(W,{$gap:12,$fullHeight:!0,children:[t(ue,{variant:mn.Underline,size:we.L,options:U,selected:j,setSelected:K}),e(se,{$justifyContent:"space-between",children:[t($e,{status:Ie.Default,message:G[j]}),n&&t(re,{"data-id":"sampling-btn-docs-banner",label:"Docs",leftIcon:ui,size:ce.S,variant:de.Text,onClick:()=>window.open(n,"_blank")})]}),j===E.Noisy?t(ul,{title:qe,summary:ve,onEdit:()=>ae(!0)}):j===E.HighlyRelevant?t(ul,{title:je,summary:Ce,onEdit:()=>le(!0)}):j===E.CostReduction?t(ul,{title:Ye,summary:xe,onEdit:()=>he(!0)}):null,t(fm,{title:H[j],items:Ee,isLoading:h,showTypeFilter:j===E.HighlyRelevant,onRuleClick:Re,onCreateRule:Ae,onEditRule:Pe,onDeleteRule:Le})]}),t(au,{formType:Pl.View,data:Y,defaultEditMode:q,onClose:De,onDelete:Le,onSaveEdit:Fe,sourceOptions:k,namespaceOptions:I,validateForm:Ge,onNavigateToDuplicate:He}),t(au,{formType:Pl.Create,isOpen:Q,category:X[j],onClose:Ne,onSubmit:Oe,sourceOptions:k,namespaceOptions:I,validateForm:Ve,onNavigateToDuplicate:He}),t(au,{formType:Pl.EditAutoNoisy,isOpen:oe,enabled:m?.enabled??!1,keepPercentage:m?.keepPercentage??0,onClose:()=>ae(!1),onSave:ze}),t(au,{formType:Pl.EditAutoHighlyRelevant,isOpen:ie,enabled:!!ye&&!ye.rule.disabled,onClose:()=>le(!1),onSave:Be}),t(au,{formType:Pl.EditAutoCostReduction,isOpen:pe,enabled:!!Se&&!Se.rule.disabled,dropPercentage:Se?.rule.percentageAtMost??25,onClose:()=>he(!1),onSave:Xe}),t(Ue,{title:ai,description:oi,isOpen:!!te,onClose:Me,denyButton:{label:ni,variant:de.Secondary,onClick:Me},approveButton:{label:ti,variant:de.Primary,onClick:()=>{_e(),Me()}}}),false]})},vm=g.div`
917
932
  display: flex;
918
933
  align-items: center;
919
934
  justify-content: space-between;
920
935
  padding: 0 12px;
921
- `,sg=({disabled:o,loading:n,tabs:i,selectedTab:l,setSelectedTab:r,onClickReset:c,onClickRefresh:d})=>{const[u,p]=s(!1),h=a(()=>{const e=[];return c&&e.push({id:Uo(),type:qt.Button,buttonProps:{label:"Reset",leftIcon:ri,size:ce.S,variant:de.Text,onClick:()=>p(!0),disabled:o}}),d&&e.push({id:Uo(),type:qt.Button,buttonProps:{label:"Refresh",leftIcon:Ri,size:ce.S,variant:de.Text,onClick:d,disabled:o,loading:n}}),e},[o,n,d]);return e(lg,{children:[e(se,{$gap:12,$alignItems:"center",children:[t(_a,{icon:Ii,title:"Odigos Settings"}),t(lt,{width:"350px",options:i,values:[l],setValues:e=>r(e[0]),disabled:o})]}),t(za,{actions:h}),t(Ue,{isOpen:u,onClose:()=>p(!1),title:"Reset Settings",description:"Are you sure you want to reset the settings? This will clear the odigos-local-ui-config and reset the settings to the default values.",denyButton:{label:"Deny",variant:de.Secondary,onClick:()=>p(!1)},approveButton:{label:"Approve",variant:de.Primary,onClick:()=>{c?.(),p(!1)}}})]})},rg=m(se)`
936
+ `,ym=({disabled:n,loading:o,tabs:i,selectedTab:l,setSelectedTab:r,onClickReset:c,onClickRefresh:d})=>{const[u,p]=s(!1),h=a(()=>{const e=[];return c&&e.push({id:Vn(),type:Yt.Button,buttonProps:{label:"Reset",leftIcon:li,size:ce.S,variant:de.Text,onClick:()=>p(!0),disabled:n}}),d&&e.push({id:Vn(),type:Yt.Button,buttonProps:{label:"Refresh",leftIcon:Ni,size:ce.S,variant:de.Text,onClick:d,disabled:n,loading:o}}),e},[n,o,d]);return e(vm,{children:[e(se,{$gap:12,$alignItems:"center",children:[t(Fa,{icon:$i,title:"Odigos Settings"}),t(lt,{width:"350px",options:i,values:[l],setValues:e=>r(e[0]),disabled:n})]}),t(La,{actions:h}),t(Ue,{isOpen:u,onClose:()=>p(!1),title:"Reset Settings",description:"Are you sure you want to reset the settings? This will clear the odigos-local-ui-config and reset the settings to the default values.",denyButton:{label:"Deny",variant:de.Secondary,onClick:()=>p(!1)},approveButton:{label:"Approve",variant:de.Primary,onClick:()=>{c?.(),p(!1)}}})]})},Cm=g(se)`
922
937
  flex: 1;
923
938
  min-height: 0;
924
939
  width: 100%;
925
940
  align-self: stretch;
926
- `,cg=m(W)`
941
+ `,Sm=g(W)`
927
942
  flex: 1;
928
943
  min-height: 0;
929
944
  height: 100%;
930
945
  overflow-y: auto;
931
- `,dg=m(cg)`
946
+ `,wm=g(Sm)`
932
947
  > section {
933
948
  min-height: 100%;
934
949
  box-sizing: border-box;
935
950
  flex-shrink: 0;
936
951
  }
937
- `,ug=e=>"general"===e.name?0:"advanced"===e.name?2:1,pg=({minSupportedVersion:o=0})=>{const{isVersionSupported:i,version:l,isEnterprise:r}=y(o),{configApi:c}=sl(),{data:d,loading:u}=c.useConfigYamls(),{data:p,loading:h,refetch:g}=c.useEffectiveConfig(),m=d?.configYamls??[],[f,b]=s(!1),v=async()=>{c.resetLocalUiConfigToDefaults&&await c.resetLocalUiConfigToDefaults()},C=a(()=>{if(!p)return{};const{manifestYAML:e,provenance:t,...o}=p;return o},[p]),{formData:S,handleFormChange:w,getNestedValue:x,getFormDiff:T,isFormDirty:k}=Nt(C);n(()=>{"{}"!==JSON.stringify(C)&&"{}"===JSON.stringify(S)&&w(void 0,void 0,C)},[C,S]);const $=a(()=>[...m].sort((e,t)=>ug(e)-ug(t)),[m]),E=a(()=>(e=>{if(!e)return{};const t={};for(const o of e)t[o.helmPath]=o.reconciledFrom;return t})(p?.provenance),[p?.provenance]),I=a(()=>{const e=new Set;for(const t of m)for(const o of t.fields)o.componentType===Rt.Dropdown&&e.add(o.helmValuePath);return e},[m]),A=a(()=>m.flatMap(e=>e.fields.map(e=>({name:e.helmValuePath,value:x("formData",e.helmValuePath)}))),[m,S,x]),[N,O]=s(!1),R=async()=>{const e=((e,t)=>{const o=(e,t,o)=>{for(let o=0;o<t.length-1;o++){const n=t[o];n in e&&"object"==typeof e[n]&&null!==e[n]||(e[n]={}),e=e[n]}e[t[t.length-1]]=o},n=JSON.parse(JSON.stringify(e));for(const e of t){const t=e.split(".");let a=n;for(const e of t){if(null==a||"object"!=typeof a){a=void 0;break}a=a[e]}"string"==typeof a&&o(n,t,a.replaceAll("-","_"))}return n})(T(C,S),I);await(async e=>{c.updateLocalUiConfig&&(b(!0),await c.updateLocalUiConfig(e),b(!1),await g())})(e),w(void 0,void 0,{})},D=a(()=>[{id:Uo(),type:qt.Button,buttonProps:{"data-id":"settings-save",variant:de.Primary,size:ce.S,label:"Save Changes",leftIcon:xi,loading:f,onClick:()=>O(!0)}},{id:Uo(),type:qt.Button,buttonProps:{"data-id":"settings-cancel",variant:de.Secondary,size:ce.S,label:"Cancel",leftIcon:Ti,onClick:()=>w(void 0,void 0,C)}}],[f,T,C,S,w]),P=a(()=>$.map(e=>({id:e.name,label:e.displayName})),[$]),F=a(()=>$.map(e=>e.name),[$]),{selectedSection:L,setSelectedSection:_,setSectionRef:z,setScrollContainerRef:M}=si({sectionNames:F});return e(ga,{$gap:12,children:[t(sg,{disabled:!i,loading:u||h,tabs:P,selectedTab:L,setSelectedTab:_,onClickReset:v?()=>v().then(()=>g?.()):void 0,onClickRefresh:g?()=>g():void 0}),e(Ha,{children:[!i&&t(El,{minSupportedVersion:o,currentVersion:l||""}),t(ma,{isOpen:k,richTitle:{icon:Ii,title:"Config Settings"},actions:D}),t(Ue,{isOpen:N,title:"Save Changes via UI?",description:"We recommend updating via your Helm values.yaml to ensure changes are version-controlled and go through a proper review process.",onClose:()=>O(!1),denyButton:{label:"Keep editing",variant:de.Secondary,onClick:()=>O(!1)},approveButton:{label:"Save changes",variant:de.Primary,onClick:()=>{R(),O(!1)}}}),e(rg,{$gap:24,$alignItems:"stretch",children:[t(cg,{ref:M,$gap:24,$width:"100%",children:m.length?$.map(o=>t(et,{id:o.name,ref:e=>z(o.name,e),richTitle:{icon:Ii,title:o.displayName},children:o.fields.map(o=>{if(o.isEnterpriseOnly&&!r)return null;if(o.renderCondition&&!ke(o.renderCondition,[],A))return null;const n=ht(o.componentProps||"{}",{}),a=E[o.helmValuePath];return e(W,{$gap:4,children:[t(cl,{componentType:o.componentType,inputType:n.type,name:o.helmValuePath,label:o.displayName,tooltip:o.description,badge:a?{status:"odigos-local-ui-config"===a?Ee.Warning:ft.Unknown,label:a,tooltip:`This field is reconciled from the following resource: ${a}`}:void 0,disabled:o.isHelmOnly||f,value:x("formData",o.helmValuePath),setValue:e=>w(o.helmValuePath,e),dropdownOptions:n.options?.map(e=>({id:e,label:e})),dropdownNoSearch:!0,dropdownNoCheckbox:!0},o.helmValuePath),o.isHelmOnly?t($e,{status:Ee.Info,smallIcon:!0,message:"This field can only be updated via Helm values.yaml file"}):null]},o.helmValuePath)})},o.name)):u?t(at,{$height:"30vh",children:t(ct,{withSpinner:!0})}):t(et,{richTitle:{icon:Ii,title:"Config Settings"},children:t(Ce,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})}),t(dg,{children:h&&!p?.manifestYAML?t(at,{$height:"30vh",children:t(ct,{withSpinner:!0})}):t(Tl,{title:"Effective Config YAML",yaml:p?.manifestYAML?.replaceAll(" |",""),defaultOpen:!0})})]})]})]})};export{lr as AddActionDrawer,Ds as AddActionForm,ou as AddDataStreamModal,fr as AddDestinationDrawer,Ls as AddDestinationForm,br as AddRuleDrawer,Hs as AddRuleForm,_r as AddSourceDrawer,sp as CentralConnections,js as DataStreamForm,Gs as DataStreamMergeWarning,Mr as EditActionDrawer,Br as EditConfigDrawer,nu as EditDataStreamModal,Vr as EditDestinationDrawer,Hr as EditRuleDrawer,Dd as EditSourceDrawer,Ws as EditSourceForm,lu as ONBOARDING_DONE_MODAL_ID,Sp as Onboarding,su as OnboardingDone,Mh as Overview,Zh as PipelineCollectors,vs as RegexTesterDrawer,tp as SamplingOnboardingModal,jd as SamplingRuleDrawer,Qs as SamplingRuleForm,ig as SamplingRules,pg as Settings,tu as SystemDrawer,qh as TABS};
952
+ `,xm=e=>"general"===e.name?0:"advanced"===e.name?2:1,km=({minSupportedVersion:n=0})=>{const{isVersionSupported:i,version:l,isEnterprise:r}=y(n),{configApi:c}=ll(),{data:d,loading:u}=c.useConfigYamls(),{data:p,loading:h,refetch:m}=c.useEffectiveConfig(),g=d?.configYamls??[],[f,b]=s(!1),v=async()=>{c.resetLocalUiConfigToDefaults&&await c.resetLocalUiConfigToDefaults()},C=a(()=>{if(!p)return{};const{manifestYAML:e,provenance:t,...n}=p;return n},[p]),{formData:S,handleFormChange:w,getNestedValue:x,getFormDiff:k,isFormDirty:T}=At(C);o(()=>{"{}"!==JSON.stringify(C)&&"{}"===JSON.stringify(S)&&w(void 0,void 0,C)},[C,S]);const $=a(()=>[...g].sort((e,t)=>xm(e)-xm(t)),[g]),I=a(()=>(e=>{if(!e)return{};const t={};for(const n of e)t[n.helmPath]=n.reconciledFrom;return t})(p?.provenance),[p?.provenance]),E=a(()=>{const e=new Set;for(const t of g)for(const n of t.fields)n.componentType===Ot.Dropdown&&e.add(n.helmValuePath);return e},[g]),A=a(()=>g.flatMap(e=>e.fields.map(e=>({name:e.helmValuePath,value:x("formData",e.helmValuePath)}))),[g,S,x]),[N,O]=s(!1),R=async()=>{const e=((e,t)=>{const n=(e,t,n)=>{for(let n=0;n<t.length-1;n++){const o=t[n];o in e&&"object"==typeof e[o]&&null!==e[o]||(e[o]={}),e=e[o]}e[t[t.length-1]]=n},o=JSON.parse(JSON.stringify(e));for(const e of t){const t=e.split(".");let a=o;for(const e of t){if(null==a||"object"!=typeof a){a=void 0;break}a=a[e]}"string"==typeof a&&n(o,t,a.replaceAll("-","_"))}return o})(k(C,S),E);await(async e=>{c.updateLocalUiConfig&&(b(!0),await c.updateLocalUiConfig(e),b(!1),await m())})(e),w(void 0,void 0,{})},D=a(()=>[{id:Vn(),type:Yt.Button,buttonProps:{"data-id":"settings-save",variant:de.Primary,size:ce.S,label:"Save Changes",leftIcon:Si,loading:f,onClick:()=>O(!0)}},{id:Vn(),type:Yt.Button,buttonProps:{"data-id":"settings-cancel",variant:de.Secondary,size:ce.S,label:"Cancel",leftIcon:wi,onClick:()=>w(void 0,void 0,C)}}],[f,k,C,S,w]),P=a(()=>$.map(e=>({id:e.name,label:e.displayName})),[$]),F=a(()=>$.map(e=>e.name),[$]),{selectedSection:L,setSelectedSection:_,setSectionRef:M,setScrollContainerRef:z}=ii({sectionNames:F});return e(ha,{$gap:12,children:[t(ym,{disabled:!i,loading:u||h,tabs:P,selectedTab:L,setSelectedTab:_,onClickReset:v?()=>v().then(()=>m?.()):void 0,onClickRefresh:m?()=>m():void 0}),e(Va,{children:[!i&&t($l,{minSupportedVersion:n,currentVersion:l||""}),t(vn,{isOpen:T,richTitle:{icon:$i,title:"Config Settings"},actions:D}),t(Ue,{isOpen:N,title:"Save Changes via UI?",description:"We recommend updating via your Helm values.yaml to ensure changes are version-controlled and go through a proper review process.",onClose:()=>O(!1),denyButton:{label:"Keep editing",variant:de.Secondary,onClick:()=>O(!1)},approveButton:{label:"Save changes",variant:de.Primary,onClick:()=>{R(),O(!1)}}}),e(Cm,{$gap:24,$alignItems:"stretch",children:[t(Sm,{ref:z,$gap:24,$width:"100%",children:g.length?$.map(n=>t(et,{id:n.name,ref:e=>M(n.name,e),richTitle:{icon:$i,title:n.displayName},children:n.fields.map(n=>{if(n.isEnterpriseOnly&&!r)return null;if(n.renderCondition&&!Te(n.renderCondition,[],A))return null;const o=ht(n.componentProps||"{}",{}),a=I[n.helmValuePath];return e(W,{$gap:4,children:[t(rl,{componentType:n.componentType,inputType:o.type,name:n.helmValuePath,label:n.displayName,tooltip:n.description,badge:a?{status:"odigos-local-ui-config"===a?Ie.Warning:Ie.Unknown,label:a,tooltip:`This field is reconciled from the following resource: ${a}`}:void 0,disabled:n.isHelmOnly||f,value:x("formData",n.helmValuePath),setValue:e=>w(n.helmValuePath,e),dropdownOptions:o.options?.map(e=>({id:e,label:e})),dropdownNoSearch:!0,dropdownNoCheckbox:!0},n.helmValuePath),n.isHelmOnly?t($e,{status:Ie.Info,smallIcon:!0,message:"This field can only be updated via Helm values.yaml file"}):null]},n.helmValuePath)})},n.name)):u?t(at,{$height:"30vh",children:t(ct,{withSpinner:!0})}):t(et,{richTitle:{icon:$i,title:"Config Settings"},children:t(Ce,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})}),t(wm,{children:h&&!p?.manifestYAML?t(at,{$height:"30vh",children:t(ct,{withSpinner:!0})}):t(xl,{title:"Effective Config YAML",yaml:p?.manifestYAML?.replaceAll(" |",""),defaultOpen:!0})})]})]})]})};export{ir as AddActionDrawer,Rs as AddActionForm,mu as AddDataStreamModal,gr as AddDestinationDrawer,Fs as AddDestinationForm,fr as AddRuleDrawer,Us as AddRuleForm,Lr as AddSourceDrawer,yp as CentralConnections,Hs as DataStreamForm,Gs as DataStreamMergeWarning,Mr as EditActionDrawer,zr as EditConfigDrawer,gu as EditDataStreamModal,Xr as EditDestinationDrawer,Ur as EditRuleDrawer,Hd as EditSourceDrawer,js as EditSourceForm,vu as ONBOARDING_DONE_MODAL_ID,Dp as Onboarding,yu as OnboardingDone,qh as Overview,dm as PipelineCollectors,bs as RegexTesterDrawer,hp as SamplingOnboardingModal,au as SamplingRuleDrawer,Zs as SamplingRuleForm,bm as SamplingRules,km as Settings,hu as SystemDrawer,cm as TABS};