@odigos/ui-kit 0.0.272 → 0.0.274

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 (46) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/lib/chunks/helpers-9QRquBS1.js +9 -0
  3. package/lib/chunks/{index-D2_SqNhv.js → index-BesD_mee.js} +3 -3
  4. package/lib/chunks/source-instrument-form-context-fYKmw6ZG.js +5 -0
  5. package/lib/chunks/{ui-components-Cz2E0SIN.js → ui-components-i5FUYiX9.js} +215 -215
  6. package/lib/components/note/index.d.ts +2 -1
  7. package/lib/components.js +1 -1
  8. package/lib/constants/actions/categories.d.ts +6 -0
  9. package/lib/constants/actions/index.d.ts +1 -0
  10. package/lib/constants.js +1 -1
  11. package/lib/containers/_drawers/add-action-drawer/lists-column/index.d.ts +10 -0
  12. package/lib/containers/_drawers/edit-action-drawer/statuses-card.d.ts +6 -0
  13. package/lib/containers/central-connections/helpers.d.ts +2 -1
  14. package/lib/containers/central-connections/index.d.ts +1 -1
  15. package/lib/containers.js +272 -273
  16. package/lib/contexts/odigos-api/capabilities.d.ts +0 -4
  17. package/lib/contexts/odigos-api/types.d.ts +1 -1
  18. package/lib/contexts/odigos-context.d.ts +3 -1
  19. package/lib/contexts.js +1 -1
  20. package/lib/functions/get-action-conditions/index.d.ts +2 -0
  21. package/lib/functions/get-action-icon/index.d.ts +2 -2
  22. package/lib/functions/index.d.ts +2 -0
  23. package/lib/functions/map-desired-statuses-to-conditions/index.d.ts +2 -0
  24. package/lib/functions.js +1 -1
  25. package/lib/hooks.js +1 -1
  26. package/lib/icons/actions/enrichment-icon/index.d.ts +2 -0
  27. package/lib/icons/actions/index.d.ts +3 -0
  28. package/lib/icons/actions/normalization-icon/index.d.ts +2 -0
  29. package/lib/icons/actions/privacy-icon/index.d.ts +2 -0
  30. package/lib/icons/compute-platform/ecs-logo/index.d.ts +2 -0
  31. package/lib/icons/compute-platform/index.d.ts +1 -1
  32. package/lib/icons.js +1 -1
  33. package/lib/snippets/wide-drawer/index.d.ts +1 -1
  34. package/lib/snippets.js +1 -1
  35. package/lib/store.js +1 -1
  36. package/lib/theme.js +1 -1
  37. package/lib/types/actions/index.d.ts +12 -2
  38. package/lib/types/common/index.d.ts +17 -1
  39. package/lib/types/workload/index.d.ts +2 -16
  40. package/lib/types.js +1 -1
  41. package/lib/visuals.js +1 -1
  42. package/package.json +1 -1
  43. package/lib/chunks/helpers-BjINTDe1.js +0 -9
  44. package/lib/chunks/source-instrument-form-context-DqNzAFUO.js +0 -5
  45. package/lib/containers/_drawers/edit-source-drawer/helpers.d.ts +0 -16
  46. package/lib/icons/compute-platform/cloud-connector-policy-icon/index.d.ts +0 -2
package/lib/containers.js CHANGED
@@ -1,4 +1,34 @@
1
- import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEffect as i,useState as a,Fragment as l,forwardRef as r,useImperativeHandle as s,useMemo as c,useCallback as d,useRef as p,Children as u,createContext as h,useContext as m,useLayoutEffect as g,memo as f}from"react";import b,{useTheme as v,css as y,keyframes as C}from"styled-components";import{u as S,n as x,C as w,g as T,f as k,e as I,q as N,h as E,j as O,k as $,p as A,l as R,c as D,r as _,S as P,s as L,R as F,t as M,w as z,o as B,x as X,y as U,z as V,A as H,B as j,D as G,E as W,F as K,G as Y,H as J,I as q,J as Z}from"./chunks/helpers-BjINTDe1.js";import{bn as Q,F as ee,d as te,C as ne,k as oe,I as ie,bx as ae,o as le,p as re,w as se,Y as ce,by as de,h as pe,bz as ue,ar as he,bA as me,bB as ge,B as fe,i as be,j as ve,x as ye,a4 as Ce,bo as Se,b0 as xe,bC as we,g as Te,bD as ke,u as Ie,N as Ne,S as Ee,bE as Oe,bt as $e,bu as Ae,bs as Re,bF as De,e as _e,f as Pe,af as Le,T as Fe,ad as Me,ae as ze,ab as Be,aa as Xe,ac as Ue,a9 as Ve,b7 as He,a8 as je,bG as Ge,bH as We,bI as Ke,bJ as Ye,bK as Je,W as qe,m as Ze,bb as Qe,bL as et,bM as tt,bN as nt,bO as ot,bP as it,bQ as at,bR as lt,bS as rt,Q as st,bT as ct,bU as dt,bV as pt,bW as ut,bX as ht,a$ as mt,br as gt,s as ft,bY as bt,bZ as vt,b1 as yt,b_ as Ct,b$ as St,aY as xt,v as wt,bv as Tt,ba as kt,b as It,q as Nt,c0 as Et,bc as Ot,c1 as $t,c2 as At,be as Rt,c3 as Dt,b3 as _t,c4 as Pt,l as Lt,y as Ft,D as Mt,c5 as zt,n as Bt,bh as Xt,bm as Ut,z as Vt,c6 as Ht,c7 as jt,bl as Gt,c8 as Wt,a3 as Kt,c9 as Yt,ca as Jt,b6 as qt,H as Zt,cb as Qt,cc as en,cd as tn,ce as nn,ag as on,cf as an,cg as ln,ch as rn,ci as sn,cj as cn,O as dn,ck as pn,cl as un,A as hn,b2 as mn,a_ as gn,cm as fn,cn as bn,co as vn,cp as yn,cq as Cn,cr as Sn,bw as xn,cs as wn,ct as Tn,cu as kn,cv as In,cw as Nn,cx as En,cy as On,cz as $n,cA as An,cB as Rn,M as Dn,cC as _n,cD as Pn,cE as Ln,cF as Fn,cG as Mn,cH as zn,cI as Bn,cJ as Xn,cK as Un,cL as Vn,cM as Hn,cN as jn,cO as Gn,aO as Wn,cP as Kn,cQ as Yn,cR as Jn,cS as qn,cT as Zn,cU as Qn,cV as eo,cW as to,cX as no,cY as oo,cZ as io,c_ as ao,c$ as lo,d0 as ro,d1 as so,ax as co,d2 as po,d3 as uo,b4 as ho,d4 as mo,d5 as go,d6 as fo,d7 as bo,d8 as vo,d9 as yo,da as Co,db as So,dc as xo,dd as wo,de as To,df as ko,dg as Io,dh as No,di as Eo,dj as Oo,dk as $o,dl as Ao,dm as Ro,dn as Do,dp as _o,dq as Po,dr as Lo,ds as Fo,dt as Mo,du as zo,dv as Bo,dw as Xo,dx as Uo,dy as Vo,dz as Ho,dA as jo,dB as Go,dC as Wo,dD as Ko,dE as Yo,dF as Jo,dG as qo,dH as Zo,dI as Qo,dJ as ei,dK as ti,dL as ni,dM as oi,dN as ii,dO as ai,dP as li,dQ as ri,dR as si,dS as ci,dT as di,dU as pi,dV as ui,dW as hi,dX as mi,dY as gi,dZ as fi,d_ as bi,d$ as vi,e0 as yi,e1 as Ci,e2 as Si,e3 as xi,e4 as wi,e5 as Ti,e6 as ki,e7 as Ii,e8 as Ni,e9 as Ei,ea as Oi,eb as $i,ec as Ai,ed as Ri,ee as Di,ef as _i,eg as Pi,eh as Li,P as Fi,ei as Mi,ej as zi,ek as Bi,el as Xi,em as Ui,en as Vi,eo as Hi,aZ as ji,ep as Gi,$ as Wi,eq as Ki,er as Yi,es as Ji,et as qi,eu as Zi,ev as Qi,ew as ea,ex as ta,ey as na,ez as oa,eA as ia,bd as aa,eB as la,R as ra,a as sa,eC as ca,eD as da,eE as pa,eF as ua,eG as ha,eH as ma,eI as ga,eJ as fa,eK as ba,eL as va,eM as ya,eN as Ca,eO as Sa,eP as xa,eQ as wa,eR as Ta,eS as ka,eT as Ia,eU as Na,eV as Ea,eW as Oa,eX as $a}from"./chunks/ui-components-Cz2E0SIN.js";import{TrashIcon as Aa,PlusIcon as Ra,ArrowRightIcon as Da,VSquareIcon as _a,XSquareIcon as Pa,BookIcon as La,DeleteIcon as Fa,EditIcon as Ma,GoLogo as za,JavaLogo as Ba,PhpLogo as Xa,ChevronRightIcon as Ua,ActionIcon as Va,DestinationIcon as Ha,ChevronUpIcon as ja,ChevronDownIcon as Ga,VIcon as Wa,XIcon as Ka,InstrumentationRuleIcon as Ya,SourceIcon as Ja,NamespacesIcon as qa,AzureIcon as Za,GoogleCloudPlatformLogo as Qa,AwsLogo as el,CloudConnectorIcon as tl,EyeOpenIcon as nl,CloudConnectorPolicyIcon as ol,ArrowLeftIcon as il,ISquareIcon as al,RefreshIcon as ll,SettingsIcon as rl,PodIcon as sl,OdigosLogo as cl,K8sLogo as dl,ExclamationCircleIcon as pl,QuestionCircleIcon as ul,InboundIcon as hl,OutboundIcon as ml,UserIcon as gl,TerminalIcon as fl,RefreshLeftArrowIcon as bl,MinusIcon as vl,SearchIcon as yl,ExpandIcon as Cl,CopyIcon as Sl,DotIcon as xl,ArrowDownIcon as wl,DownloadIcon as Tl,VmLogo as kl,SamplingIcon as Il,ExclamationTriangleIcon as Nl,KeyIcon as El,DiagnoseIcon as Ol,StarIcon as $l,ArrowIcon as Al,ConnectionsIcon as Rl,FilterIcon as Dl,DataStreamIcon as _l,PipelineCollectorIcon as Pl,ArrowDownSquareIcon as Ll,ArrowUpSquareIcon as Fl,GatewayIcon as Ml,YamlIcon as zl,ImageErrorIcon as Bl,LockIcon as Xl}from"./icons.js";import{h as Ul,o as Vl,n as Hl,q as jl,m as Gl,t as Wl,s as Kl,S as Yl,w as Jl,E as ql,x as Zl,y as Ql,v as er,l as tr,d as nr,O as or,f as ir,b as ar,A as lr,R as rr,C as sr,e as cr,D as dr}from"./chunks/source-instrument-form-context-DqNzAFUO.js";import{n as pr,f as ur,k as hr,I as mr,l as gr,A as fr,i as br,P as vr,S as yr,R as Cr,g as Sr,j as xr,c as wr,h as Tr,m as kr,W as Ir,C as Nr,b as Er,Y as Or,O as $r,a as Ar,U as Rr,e as Dr}from"./chunks/index-D2_SqNhv.js";import{createPortal as _r}from"react-dom";import{MarkerType as Pr,useNodesState as Lr,useEdgesState as Fr,Handle as Mr,Position as zr,getSmoothStepPath as Br,BaseEdge as Xr,EdgeLabelRenderer as Ur,ReactFlowProvider as Vr,ReactFlow as Hr,Background as jr,Controls as Gr,ControlButton as Wr,useReactFlow as Kr}from"@xyflow/react";import Yr from"elkjs/lib/elk.bundled.js";import"@xyflow/react/dist/style.css";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";import"@apollo/client/react";import"@apollo/client/link/error";import"@apollo/client/link/context";import"@apollo/client/utilities";import"@apollo/client/errors";import"@apollo/client";const Jr=[{id:"CREDIT_CARD",label:"Credit card"}],qr=[{id:Q.CollectContainerAttributes,label:"Collect container attributes"},{id:Q.CollectReplicaSetAttributes,label:"Collect ReplicaSet attributes"},{id:Q.CollectWorkloadId,label:"Collect workload ID"},{id:Q.CollectClusterId,label:"Collect cluster ID"}],Zr=[{id:ae.Pod,label:ae.Pod},{id:ae.Namespace,label:ae.Namespace},{id:ae.Node,label:ae.Node}],Qr=[{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:Zr}],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:Zr}],ts=Q.ExtractAttribute;var ns;(e=>{e.Preset="preset",e.Regex="regex"})(ns||(ns={}));const os=[ue.JSON,ue.SQL,ue.ResourcePath],is=(e=ue.JSON)=>({targetAttributeName:"",lookupKey:"",dataFormat:e,regex:""}),as=e=>!!e.regex&&!e.lookupKey&&!e.dataFormat,ls=b.div`
1
+ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMemo as i,useEffect as a,useState as l,Fragment as r,forwardRef as s,useImperativeHandle as c,useCallback as d,useRef as p,Children as u,createContext as h,useContext as m,useLayoutEffect as g,memo as f}from"react";import b,{useTheme as v,css as y,keyframes as C}from"styled-components";import{u as S,n as x,C as w,g as T,f as k,e as I,q as N,h as E,j as O,k as $,p as A,l as R,c as D,r as _,S as P,s as L,R as F,t as M,w as z,o as B,x as X,y as U,z as V,A as H,B as j,D as G,E as W,F as K,G as Y,H as J,I as q,J as Z}from"./chunks/helpers-9QRquBS1.js";import{C as Q,e as ee,g as te,f as ne,h as oe,bx as ie,F as ae,by as le,bz as re,bA as se,bB as ce,bn as de,d as pe,k as ue,I as he,bC as me,o as ge,p as fe,w as be,Y as ve,bD as ye,bE as Ce,ar as Se,bF as xe,bG as we,B as Te,i as ke,j as Ie,x as Ne,a4 as Ee,bo as Oe,b0 as $e,bH as Ae,bI as Re,u as De,N as _e,S as Pe,bJ as Le,bt as Fe,bu as Me,bs as ze,bK as Be,af as Xe,T as Ue,ad as Ve,ae as He,ab as je,aa as Ge,ac as We,a9 as Ke,b7 as Ye,a8 as Je,bL as qe,bM as Ze,bN as Qe,bO as et,W as tt,m as nt,bb as ot,bP as it,bQ as at,bR as lt,bS as rt,bT as st,bU as ct,bV as dt,bW as pt,Q as ut,bX as ht,bY as mt,bZ as gt,a$ as ft,br as bt,s as vt,b_ as yt,b$ as Ct,b1 as St,c0 as xt,c1 as wt,aY as Tt,v as kt,bv as It,ba as Nt,q as Et,c2 as Ot,bc as $t,c3 as At,c4 as Rt,be as Dt,c5 as _t,b3 as Pt,c6 as Lt,l as Ft,y as Mt,D as zt,c7 as Bt,ag as Xt,c8 as Ut,c9 as Vt,n as Ht,bh as jt,bm as Gt,z as Wt,ca as Kt,cb as Yt,bl as Jt,cc as qt,a3 as Zt,cd as Qt,ce as en,b6 as tn,H as nn,cf as on,cg as an,ch as ln,ci as rn,cj as sn,ck as cn,cl as dn,cm as pn,O as un,cn as hn,co as mn,A as gn,b2 as fn,a_ as bn,cp as vn,cq as yn,cr as Cn,cs as Sn,ct as xn,cu as wn,bw as Tn,cv as kn,cw as In,cx as Nn,cy as En,cz as On,b as $n,cA as An,cB as Rn,M as Dn,cC as _n,cD as Pn,cE as Ln,cF as Fn,cG as Mn,cH as zn,cI as Bn,cJ as Xn,cK as Un,cL as Vn,cM as Hn,cN as jn,cO as Gn,cP as Wn,cQ as Kn,cR as Yn,cS as Jn,aO as qn,cT as Zn,cU as Qn,cV as eo,cW as to,cX as no,cY as oo,cZ as io,c_ as ao,c$ as lo,d0 as ro,d1 as so,d2 as co,d3 as po,d4 as uo,d5 as ho,ax as mo,d6 as go,d7 as fo,b4 as bo,d8 as vo,d9 as yo,da as Co,db as So,dc as xo,dd as wo,de as To,df as ko,dg as Io,dh as No,di as Eo,dj as Oo,dk as $o,dl as Ao,dm as Ro,dn as Do,dp as _o,dq as Po,dr as Lo,ds as Fo,dt as Mo,du as zo,dv as Bo,dw as Xo,dx as Uo,dy as Vo,dz as Ho,dA as jo,dB as Go,dC as Wo,dD as Ko,dE as Yo,dF as Jo,dG as qo,dH as Zo,dI as Qo,dJ as ei,dK as ti,dL as ni,dM as oi,dN as ii,dO as ai,dP as li,dQ as ri,dR as si,dS as ci,dT as di,dU as pi,dV as ui,dW as hi,dX as mi,dY as gi,dZ as fi,d_ as bi,d$ as vi,e0 as yi,e1 as Ci,e2 as Si,e3 as xi,e4 as wi,e5 as Ti,e6 as ki,e7 as Ii,e8 as Ni,e9 as Ei,ea as Oi,eb as $i,ec as Ai,ed as Ri,ee as Di,ef as _i,eg as Pi,eh as Li,ei as Fi,ej as Mi,ek as zi,el as Bi,P as Xi,em as Ui,en as Vi,eo as Hi,ep as ji,eq as Gi,er as Wi,es as Ki,aZ as Yi,et as Ji,$ as qi,eu as Zi,ev as Qi,ew as ea,ex as ta,ey as na,ez as oa,eA as ia,eB as aa,eC as la,eD as ra,eE as sa,eF as ca,bd as da,eG as pa,R as ua,a as ha,eH as ma,eI as ga,eJ as fa,eK as ba,eL as va,eM as ya,eN as Ca,eO as Sa,eP as xa,eQ as wa,eR as Ta,eS as ka,eT as Ia,eU as Na,eV as Ea,eW as Oa,eX as $a,eY as Aa,eZ as Ra,e_ as Da,e$ as _a,f0 as Pa}from"./chunks/ui-components-i5FUYiX9.js";import{ChevronRightIcon as La,ActionIcon as Fa,TrashIcon as Ma,PlusIcon as za,ArrowRightIcon as Ba,VSquareIcon as Xa,XSquareIcon as Ua,BookIcon as Va,DeleteIcon as Ha,EditIcon as ja,GoLogo as Ga,JavaLogo as Wa,PhpLogo as Ka,DestinationIcon as Ya,ChevronUpIcon as Ja,ChevronDownIcon as qa,VIcon as Za,XIcon as Qa,InstrumentationRuleIcon as el,SourceIcon as tl,NamespacesIcon as nl,AzureIcon as ol,GoogleCloudPlatformLogo as il,AwsLogo as al,CloudConnectorIcon as ll,EyeOpenIcon as rl,OdigosLogo as sl,ArrowLeftIcon as cl,ISquareIcon as dl,RefreshIcon as pl,SettingsIcon as ul,PodIcon as hl,K8sLogo as ml,ExclamationCircleIcon as gl,QuestionCircleIcon as fl,InboundIcon as bl,OutboundIcon as vl,UserIcon as yl,TerminalIcon as Cl,RefreshLeftArrowIcon as Sl,MinusIcon as xl,SearchIcon as wl,ExpandIcon as Tl,CopyIcon as kl,DotIcon as Il,ArrowDownIcon as Nl,DownloadIcon as El,SamplingIcon as Ol,ExclamationTriangleIcon as $l,KeyIcon as Al,DiagnoseIcon as Rl,StarIcon as Dl,ArrowIcon as _l,ConnectionsIcon as Pl,FilterIcon as Ll,DataStreamIcon as Fl,PipelineCollectorIcon as Ml,ArrowDownSquareIcon as zl,ArrowUpSquareIcon as Bl,GatewayIcon as Xl,YamlIcon as Ul,ImageErrorIcon as Vl,LockIcon as Hl}from"./icons.js";import{h as jl,o as Gl,n as Wl,q as Kl,m as Yl,t as Jl,s as ql,S as Zl,w as Ql,E as er,x as tr,y as nr,v as or,l as ir,d as ar,O as lr,f as rr,b as sr,A as cr,R as dr,C as pr,e as ur,D as hr}from"./chunks/source-instrument-form-context-fYKmw6ZG.js";import{n as mr,f as gr,k as fr,I as br,l as vr,A as yr,i as Cr,P as Sr,S as xr,R as wr,g as Tr,j as kr,c as Ir,h as Nr,m as Er,W as Or,C as $r,b as Ar,Y as Rr,O as Dr,a as _r,U as Pr,e as Lr}from"./chunks/index-BesD_mee.js";import{createPortal as Fr}from"react-dom";import{MarkerType as Mr,useNodesState as zr,useEdgesState as Br,Handle as Xr,Position as Ur,getSmoothStepPath as Vr,BaseEdge as Hr,EdgeLabelRenderer as jr,ReactFlowProvider as Gr,ReactFlow as Wr,Background as Kr,Controls as Yr,ControlButton as Jr,useReactFlow as qr}from"@xyflow/react";import Zr from"elkjs/lib/elk.bundled.js";import"@xyflow/react/dist/style.css";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";import"@apollo/client/react";import"@apollo/client/link/error";import"@apollo/client/link/context";import"@apollo/client/utilities";import"@apollo/client/errors";import"@apollo/client";const Qr=b.div`
2
+ display: flex;
3
+ align-items: center;
4
+ justify-content: space-between;
5
+ gap: 12px;
6
+ padding: 8px 12px;
7
+ border-radius: 12px;
8
+ 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"};
9
+ cursor: ${({$disabled:e})=>e?"not-allowed":"pointer"};
10
+ opacity: ${({$disabled:e})=>e?.5:1};
11
+ &:hover {
12
+ background-color: ${({$isSelected:e,$purpleColors:t,theme:n})=>n.v2.colors[t?"purple":"silver"][e?"700":"800"]};
13
+ }
14
+ `,es=b.div`
15
+ display: flex;
16
+ align-items: center;
17
+ justify-content: center;
18
+ padding: 8px;
19
+ border-radius: 8px;
20
+ background-color: ${({theme:e})=>e.v2.colors.white[500]+ie["004"]};
21
+ `,ts=b(oe)`
22
+ flex: 1;
23
+ min-width: 0;
24
+ `,ns=b(ae)`
25
+ flex: 1;
26
+ min-width: 0;
27
+ `,os=b(oe)`
28
+ flex-shrink: 0;
29
+ `,is=({dataId:n,icon:o,title:i,description:a,withCarret:l,purpleColors:r,disabled:s,children:c,isSelected:d,onClick:p,isChecked:u,isPartiallyChecked:h,onCheckboxChange:m})=>e(Qr,{"data-id":n||`list-item-${i}`,$isSelected:d,$purpleColors:r,$disabled:s,onClick:()=>!d&&!s&&p(),children:[e(ts,{$gap:12,children:[m&&t(Q,{partiallyChecked:h||!1,value:u||!1,onChange:e=>m(e)}),o&&t(es,{children:t(o,{size:20})}),e(ns,{$gap:4,children:[t(ee,{size:te.XS,nowrap:!0,children:i}),a&&t(ee,{size:te.XXXS,color:ne.Secondary,nowrap:!0,children:a})]})]}),(l||c)&&e(os,{$gap:8,children:[c,l&&t(La,{size:18})]})]}),as="other",ls={...se,[as]:{TITLE:"Other",ICON:Fa}},rs=b(oe)`
30
+ padding: 8px 12px 4px 12px;
31
+ `,ss=({bucket:n,options:o,selectedType:i,onSelectOption:a})=>{const l=v(),{TITLE:r,ICON:s}=ls[n],c=l.v2.colors.purple[200];return e("div",{"data-id":`action-category-${n}`,children:[e(rs,{$gap:8,children:[t(s,{fill:c}),t(ee,{size:te.XXS,color:c,children:r}),t(ce,{label:o.length})]}),o.map(e=>t(is,{dataId:e.type?`option-${e.type}`:void 0,icon:e.icon,title:e.label,description:e.subtitle||e.description,withCarret:!0,isSelected:i===e.type,onClick:()=>a(e)},e.type))]})},cs=[{id:"CREDIT_CARD",label:"Credit card"}],ds=[{id:de.CollectContainerAttributes,label:"Collect container attributes"},{id:de.CollectReplicaSetAttributes,label:"Collect ReplicaSet attributes"},{id:de.CollectWorkloadId,label:"Collect workload ID"},{id:de.CollectClusterId,label:"Collect cluster ID"}],ps=[{id:me.Pod,label:me.Pod},{id:me.Namespace,label:me.Namespace},{id:me.Node,label:me.Node}],us=[{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:ps}],hs=[{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:ps}],ms=de.ExtractAttribute;var gs;(e=>{e.Preset="preset",e.Regex="regex"})(gs||(gs={}));const fs=[Ce.JSON,Ce.SQL,Ce.ResourcePath],bs=(e=Ce.JSON)=>({targetAttributeName:"",lookupKey:"",dataFormat:e,regex:""}),vs=e=>!!e.regex&&!e.lookupKey&&!e.dataFormat,ys=b.div`
2
32
  width: 100%;
3
33
  background: ${({theme:e})=>e.v2.colors.silver[800]};
4
34
  border-radius: 8px;
@@ -6,13 +36,13 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
6
36
  display: flex;
7
37
  flex-direction: column;
8
38
  gap: 8px;
9
- `,rs=b.div`
39
+ `,Cs=b.div`
10
40
  flex: 1;
11
41
  min-width: 0;
12
- `,ss=b.div`
42
+ `,Ss=b.div`
13
43
  /* Pushes the arrow down to sit next to the inputs rather than the field titles. */
14
44
  padding-top: 24px;
15
- `,cs=e=>Object.entries(e||{}).map(([e,t])=>({oldKey:e,newKey:t})),ds=e=>{const t={};return e.forEach(({oldKey:e,newKey:n})=>{t[e]=n}),t},ps=Q.UrlTemplatizationRulesGroups,us=[{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"}],hs={[Se.K8sAttributes]:({value:o,setValue:a,formErrors:l})=>(i(()=>{o[Q.CollectContainerAttributes]||o[Q.CollectReplicaSetAttributes]||o[Q.CollectWorkloadId]||o[Q.CollectClusterId]||o[Q.LabelsAttributes]?.length||o[Q.AnnotationsAttributes]?.length||(a(Q.CollectContainerAttributes,!0),a(Q.CollectReplicaSetAttributes,!0),a(Q.CollectWorkloadId,!0),a(Q.CollectClusterId,!0),a(Q.LabelsAttributes,[]),a(Q.AnnotationsAttributes,[]))},[]),e(n,{children:[t(ee,{$gap:6,children:qr.map(({id:n,label:i})=>e(ee,{children:[t(ne,{label:i,value:o[n]||!1,onChange:e=>a(n,e)}),t(oe,{errorMessage:l[n]})]},n))}),t(ie,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:Qr,values:o[Q.LabelsAttributes]||[],setValues:e=>a(Q.LabelsAttributes,e),errorMessage:l[Q.LabelsAttributes]}),t(ie,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:es,values:o[Q.AnnotationsAttributes]||[],setValues:e=>a(Q.AnnotationsAttributes,e),errorMessage:l[Q.AnnotationsAttributes]})]})),[Se.AddClusterInfo]:({value:o,setValue:i,formErrors:a})=>{const l=v();return e(n,{children:[t(le,{label:"Overwrite existing values",labelAlign:re.Left,labelColor:l.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:o[Q.OverwriteExistingValues]||!1,onChange:e=>i(Q.OverwriteExistingValues,e)}),t(ie,{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[Q.ClusterAttributes]||[],setValues:e=>i(Q.ClusterAttributes,e),errorMessage:a[Q.ClusterAttributes]})]})},[Se.DeleteAttributes]:({value:e,setValue:n,formErrors:o})=>t(se,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[Q.AttributeNamesToDelete]||[],setValues:e=>n(Q.AttributeNamesToDelete,e),errorMessage:o[Q.AttributeNamesToDelete]}),[Se.RenameAttributes]:({value:e,setValue:n,formErrors:o})=>{const l=e[Q.Renames],[r,s]=a(()=>cs(l));return i(()=>{((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])})(ds(r),l||{})||s(cs(l))},[l]),t(ie,{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:r,setValues:e=>{const t=e.map(e=>({oldKey:String(e.oldKey??""),newKey:String(e.newKey??"")}));s(t),n(Q.Renames,ds(t))},errorMessage:o[Q.Renames]})},[Se.PiiMasking]:({value:n,setValue:o,formErrors:a})=>(i(()=>{n[Q.PiiCategories]?.length||o(Q.PiiCategories,Jr.map(({id:e})=>e))},[]),e(ee,{$gap:12,children:[t(te,{label:"Attributes to mask"}),t(ee,{$gap:6,children:Jr.map(({id:e,label:i})=>t(ne,{label:i,value:n[Q.PiiCategories]?.includes(e)||!1,onChange:t=>{const i=n[Q.PiiCategories]||[],a=t?[...i,e]:i.filter(t=>t!==e);o(Q.PiiCategories,a)}},e))}),t(oe,{errorMessage:a[Q.PiiCategories]})]})),[Se.URLTemplatization]:({value:o,setValue:i,formErrors:a})=>{const r=v(),s=o[ps]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>i(ps,e),d=(e,t)=>c(s.map((n,o)=>o===e?{...n,...t}:n));return e(n,{children:[s.map((n,o)=>e(l,{children:[t(Ce,{}),e(ee,{$gap:12,children:[e(pe,{$justifyContent:"space-between",$alignItems:"center",children:[t(te,{label:`Rule Group ${o+1}`}),t(fe,{leftIcon:()=>t(Aa,{fill:r.v2.colors.red[500]}),variant:ve.Secondary,size:be.S,onClick:()=>{return e=o,c(s.filter((t,n)=>n!==e));var e},disabled:1===s.length})]}),t(ye,{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(ie,{name:`urlGroup-${o}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:us,values:n.workloadFilters||[],setValues:e=>d(o,{workloadFilters:e})}),t(se,{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(oe,{errorMessage:a[ps]})]},`url-templatization-group-${o}`)),t(fe,{variant:ve.Secondary,label:"Add rule group",leftIcon:Ra,onClick:()=>c([...s,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(Ce,{})]})},[Se.ExtractAttribute]:({value:n,setValue:o,formErrors:l})=>{const r=v(),s=l[ts],c=n[ts]?.extractions||[],[d,p]=a(()=>(e=>e.length&&e.some(as)?ns.Regex:ns.Preset)(c)),[u,h]=a(null),m=e=>o(ts,{extractions:e});i(()=>{0===c.length&&m([d===ns.Preset?is():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},[]);const g=(e,t)=>{m(c.map((n,o)=>o===e?{...n,...t}:n))},f=()=>{m([...c,d===ns.Preset?is():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},b=d===ns.Preset,y=c.length?c:[b?is():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}],C=null!=u&&y[u]?.regex||"";return e(ee,{$gap:16,$width:"100%",children:[t(ce,{options:[{value:ns.Preset,label:de.SEGMENT_PRESET_LABEL,tooltip:de.SEGMENT_PRESET_TOOLTIP,selectedBgColor:r.v2.colors.purple[500]},{value:ns.Regex,label:de.SEGMENT_REGEX_LABEL,tooltip:de.SEGMENT_REGEX_TOOLTIP,selectedBgColor:r.v2.colors.purple[500]}],selected:d,setSelected:e=>{p(e),m([e===ns.Preset?is():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])}}),e(ee,{$gap:8,$width:"100%",children:[y.map((n,o)=>{const i=o===y.length-1,a=n.dataFormat||ue.JSON,l=me[a];return e(ls,{"data-id":`extract-row-${o}`,children:[e(pe,{$gap:10,$alignItems:"flex-start",$width:"100%",$justifyContent:"space-between",children:[e(ee,{$gap:10,children:[t(te,{label:b?de.PRESET_ROW_TITLE(o):de.REGEX_ROW_TITLE(o)}),b&&t(pe,{$gap:24,children:os.map(e=>t(he,{"data-id":`extract-row-${o}-fmt-${e}`,size:ge.L,label:me[e].label,value:a===e,onChange:t=>t&&g(o,{dataFormat:e})},`extract-row-${o}-fmt-${e}`))})]}),e(pe,{$gap:4,$alignItems:"center",children:[!b&&t(fe,{"data-id":`extract-row-${o}-test-regex`,label:de.TEST_REGEX_LABEL,variant:ve.Secondary,size:be.S,onClick:()=>h(o),disabled:!n.regex?.trim()}),t(fe,{"data-id":`extract-row-${o}-delete`,leftIcon:()=>t(Aa,{fill:r.v2.colors.red[500]}),variant:ve.Secondary,size:be.S,onClick:()=>(e=>{const t=c.filter((t,n)=>n!==e);m(t.length?t:[d===ns.Preset?is():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])})(o)}),i&&t(fe,{"data-id":`extract-row-${o}-add`,leftIcon:Ra,variant:ve.Secondary,size:be.S,onClick:f})]})]}),b?e(pe,{$gap:8,$alignItems:"flex-start",$width:"100%",children:[t(rs,{children:t(ye,{name:`extract-row-${o}-lookupKey`,label:l.keyLabel,placeholder:l.placeholder,helpMessage:l.helpMessage,width:"100%",value:n.lookupKey||"",onChange:e=>g(o,{lookupKey:e.target.value})})}),t(ss,{children:t(Da,{size:24,fill:r.v2.colors.silver[200]})}),t(rs,{children:t(ye,{name:`extract-row-${o}-targetAttributeName`,label:de.TARGET_LABEL,placeholder:de.TARGET_PLACEHOLDER,helpMessage:de.TARGET_HELP,width:"100%",value:n.targetAttributeName||"",onChange:e=>g(o,{targetAttributeName:e.target.value})})})]}):e(ee,{$gap:12,$width:"100%",children:[t(ye,{name:`extract-row-${o}-regex`,label:de.REGEX_LABEL,placeholder:de.REGEX_PLACEHOLDER,helpMessage:de.REGEX_HELP,width:"100%",value:n.regex||"",onChange:e=>g(o,{regex:e.target.value})}),t(ye,{name:`extract-row-${o}-targetAttributeName`,label:de.TARGET_LABEL,placeholder:de.TARGET_PLACEHOLDER,helpMessage:de.TARGET_HELP,width:"100%",value:n.targetAttributeName||"",onChange:e=>g(o,{targetAttributeName:e.target.value})})]})]},`extract-row-${o}`)}),t(oe,{errorMessage:s})]}),t(pr,{isOpen:null!=u,regex:C,onClose:()=>h(null)})]})},[Se.DbQueryTemplatization]:null,[Se.InferDbAttributes]:null},ms=({actionType:e,value:n,setValue:o,formErrors:i,dynamicFields:a,signals:l,sourceOptions:r,namespaceOptions:s})=>{if(!e)return null;if(a?.length)return t(ur,{fields:a,value:n||{},setValue:o,formErrors:i||{},signals:l||[],seedInitialValues:!0,keyValuePersistAs:"map",sourceOptions:r,namespaceOptions:s},e);const c=hs[e];return c?t(c,{value:n,setValue:o,formErrors:i}):null},gs=()=>{const n=v(),{selectedOption:o,genericForm:i,sourceOptions:a,namespaceOptions:l}=Ul();if(!i||!o)return t(xe,{title:"No active form"});const{formData:r,handleFormChange:s,formErrors:c}=i;return e(ee,{$gap:24,children:[e(pe,{$gap:12,$justifyContent:"space-between",children:[t(we,{size:Te.XXXS,maxLines:2,children:o.description}),e(pe,{$gap:12,children:[t(ce,{options:[{icon:_a,label:"Enabled",value:!1,selectedBgColor:n.v2.colors.green[800]},{icon:Pa,label:"Disabled",value:!0,selectedBgColor:n.v2.colors.red[800]}],size:ke.S,selected:r.disabled,setSelected:e=>s("disabled",e)}),t(fe,{leftIcon:La,variant:ve.Secondary,size:be.S,onClick:()=>o.docsUrl&&window.open(o.docsUrl,"_blank","noopener noreferrer")})]})]}),t(hr,{title:"Signals for processing",allowedSignals:o.allowedSignals,selectedSignals:r.signals||[],setSelectedSignals:e=>s("signals",e),errorMessage:c.signals}),t(ye,{name:"actionName",label:"Action name",placeholder:"Use a name that describes the action...",value:r.name||"",onChange:({target:{value:e}})=>s("name",e),errorMessage:c.name}),t(ms,{actionType:o.type,dynamicFields:o.fields,signals:r.signals||[],value:r.fields,setValue:(e,t)=>s(`fields.${e}`,t),formErrors:c,sourceOptions:a,namespaceOptions:l}),t(Ie,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:r.notes||"",onChange:({target:{value:e}})=>s("notes",e),errorMessage:c.notes})]})},fs=b(pe)`
45
+ `,xs=e=>Object.entries(e||{}).map(([e,t])=>({oldKey:e,newKey:t})),ws=e=>{const t={};return e.forEach(({oldKey:e,newKey:n})=>{t[e]=n}),t},Ts=de.UrlTemplatizationRulesGroups,ks=[{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"}],Is={[Oe.K8sAttributes]:({value:o,setValue:i,formErrors:l})=>(a(()=>{o[de.CollectContainerAttributes]||o[de.CollectReplicaSetAttributes]||o[de.CollectWorkloadId]||o[de.CollectClusterId]||o[de.LabelsAttributes]?.length||o[de.AnnotationsAttributes]?.length||(i(de.CollectContainerAttributes,!0),i(de.CollectReplicaSetAttributes,!0),i(de.CollectWorkloadId,!0),i(de.CollectClusterId,!0),i(de.LabelsAttributes,[]),i(de.AnnotationsAttributes,[]))},[]),e(n,{children:[t(ae,{$gap:6,children:ds.map(({id:n,label:a})=>e(ae,{children:[t(Q,{label:a,value:o[n]||!1,onChange:e=>i(n,e)}),t(ue,{errorMessage:l[n]})]},n))}),t(he,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:us,values:o[de.LabelsAttributes]||[],setValues:e=>i(de.LabelsAttributes,e),errorMessage:l[de.LabelsAttributes]}),t(he,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:hs,values:o[de.AnnotationsAttributes]||[],setValues:e=>i(de.AnnotationsAttributes,e),errorMessage:l[de.AnnotationsAttributes]})]})),[Oe.AddClusterInfo]:({value:o,setValue:i,formErrors:a})=>{const l=v();return e(n,{children:[t(ge,{label:"Overwrite existing values",labelAlign:fe.Left,labelColor:l.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:o[de.OverwriteExistingValues]||!1,onChange:e=>i(de.OverwriteExistingValues,e)}),t(he,{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[de.ClusterAttributes]||[],setValues:e=>i(de.ClusterAttributes,e),errorMessage:a[de.ClusterAttributes]})]})},[Oe.DeleteAttributes]:({value:e,setValue:n,formErrors:o})=>t(be,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[de.AttributeNamesToDelete]||[],setValues:e=>n(de.AttributeNamesToDelete,e),errorMessage:o[de.AttributeNamesToDelete]}),[Oe.RenameAttributes]:({value:e,setValue:n,formErrors:o})=>{const i=e[de.Renames],[r,s]=l(()=>xs(i));return a(()=>{((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])})(ws(r),i||{})||s(xs(i))},[i]),t(he,{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:r,setValues:e=>{const t=e.map(e=>({oldKey:String(e.oldKey??""),newKey:String(e.newKey??"")}));s(t),n(de.Renames,ws(t))},errorMessage:o[de.Renames]})},[Oe.PiiMasking]:({value:n,setValue:o,formErrors:i})=>(a(()=>{n[de.PiiCategories]?.length||o(de.PiiCategories,cs.map(({id:e})=>e))},[]),e(ae,{$gap:12,children:[t(pe,{label:"Attributes to mask"}),t(ae,{$gap:6,children:cs.map(({id:e,label:i})=>t(Q,{label:i,value:n[de.PiiCategories]?.includes(e)||!1,onChange:t=>{const i=n[de.PiiCategories]||[],a=t?[...i,e]:i.filter(t=>t!==e);o(de.PiiCategories,a)}},e))}),t(ue,{errorMessage:i[de.PiiCategories]})]})),[Oe.URLTemplatization]:({value:o,setValue:i,formErrors:a})=>{const l=v(),s=o[Ts]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>i(Ts,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(Ee,{}),e(ae,{$gap:12,children:[e(oe,{$justifyContent:"space-between",$alignItems:"center",children:[t(pe,{label:`Rule Group ${o+1}`}),t(Te,{leftIcon:()=>t(Ma,{fill:l.v2.colors.red[500]}),variant:Ie.Secondary,size:ke.S,onClick:()=>{return e=o,c(s.filter((t,n)=>n!==e));var e},disabled:1===s.length})]}),t(Ne,{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(he,{name:`urlGroup-${o}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:ks,values:n.workloadFilters||[],setValues:e=>d(o,{workloadFilters:e})}),t(be,{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(ue,{errorMessage:a[Ts]})]},`url-templatization-group-${o}`)),t(Te,{variant:Ie.Secondary,label:"Add rule group",leftIcon:za,onClick:()=>c([...s,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(Ee,{})]})},[Oe.ExtractAttribute]:({value:n,setValue:o,formErrors:i})=>{const r=v(),s=i[ms],c=n[ms]?.extractions||[],[d,p]=l(()=>(e=>e.length&&e.some(vs)?gs.Regex:gs.Preset)(c)),[u,h]=l(null),m=e=>o(ms,{extractions:e});a(()=>{0===c.length&&m([d===gs.Preset?bs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},[]);const g=(e,t)=>{m(c.map((n,o)=>o===e?{...n,...t}:n))},f=()=>{m([...c,d===gs.Preset?bs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},b=d===gs.Preset,y=c.length?c:[b?bs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}],C=null!=u&&y[u]?.regex||"";return e(ae,{$gap:16,$width:"100%",children:[t(ve,{options:[{value:gs.Preset,label:ye.SEGMENT_PRESET_LABEL,tooltip:ye.SEGMENT_PRESET_TOOLTIP,selectedBgColor:r.v2.colors.purple[500]},{value:gs.Regex,label:ye.SEGMENT_REGEX_LABEL,tooltip:ye.SEGMENT_REGEX_TOOLTIP,selectedBgColor:r.v2.colors.purple[500]}],selected:d,setSelected:e=>{p(e),m([e===gs.Preset?bs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])}}),e(ae,{$gap:8,$width:"100%",children:[y.map((n,o)=>{const i=o===y.length-1,a=n.dataFormat||Ce.JSON,l=xe[a];return e(ys,{"data-id":`extract-row-${o}`,children:[e(oe,{$gap:10,$alignItems:"flex-start",$width:"100%",$justifyContent:"space-between",children:[e(ae,{$gap:10,children:[t(pe,{label:b?ye.PRESET_ROW_TITLE(o):ye.REGEX_ROW_TITLE(o)}),b&&t(oe,{$gap:24,children:fs.map(e=>t(Se,{"data-id":`extract-row-${o}-fmt-${e}`,size:we.L,label:xe[e].label,value:a===e,onChange:t=>t&&g(o,{dataFormat:e})},`extract-row-${o}-fmt-${e}`))})]}),e(oe,{$gap:4,$alignItems:"center",children:[!b&&t(Te,{"data-id":`extract-row-${o}-test-regex`,label:ye.TEST_REGEX_LABEL,variant:Ie.Secondary,size:ke.S,onClick:()=>h(o),disabled:!n.regex?.trim()}),t(Te,{"data-id":`extract-row-${o}-delete`,leftIcon:()=>t(Ma,{fill:r.v2.colors.red[500]}),variant:Ie.Secondary,size:ke.S,onClick:()=>(e=>{const t=c.filter((t,n)=>n!==e);m(t.length?t:[d===gs.Preset?bs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])})(o)}),i&&t(Te,{"data-id":`extract-row-${o}-add`,leftIcon:za,variant:Ie.Secondary,size:ke.S,onClick:f})]})]}),b?e(oe,{$gap:8,$alignItems:"flex-start",$width:"100%",children:[t(Cs,{children:t(Ne,{name:`extract-row-${o}-lookupKey`,label:l.keyLabel,placeholder:l.placeholder,helpMessage:l.helpMessage,width:"100%",value:n.lookupKey||"",onChange:e=>g(o,{lookupKey:e.target.value})})}),t(Ss,{children:t(Ba,{size:24,fill:r.v2.colors.silver[200]})}),t(Cs,{children:t(Ne,{name:`extract-row-${o}-targetAttributeName`,label:ye.TARGET_LABEL,placeholder:ye.TARGET_PLACEHOLDER,helpMessage:ye.TARGET_HELP,width:"100%",value:n.targetAttributeName||"",onChange:e=>g(o,{targetAttributeName:e.target.value})})})]}):e(ae,{$gap:12,$width:"100%",children:[t(Ne,{name:`extract-row-${o}-regex`,label:ye.REGEX_LABEL,placeholder:ye.REGEX_PLACEHOLDER,helpMessage:ye.REGEX_HELP,width:"100%",value:n.regex||"",onChange:e=>g(o,{regex:e.target.value})}),t(Ne,{name:`extract-row-${o}-targetAttributeName`,label:ye.TARGET_LABEL,placeholder:ye.TARGET_PLACEHOLDER,helpMessage:ye.TARGET_HELP,width:"100%",value:n.targetAttributeName||"",onChange:e=>g(o,{targetAttributeName:e.target.value})})]})]},`extract-row-${o}`)}),t(ue,{errorMessage:s})]}),t(mr,{isOpen:null!=u,regex:C,onClose:()=>h(null)})]})},[Oe.DbQueryTemplatization]:null,[Oe.InferDbAttributes]:null},Ns=({actionType:e,value:n,setValue:o,formErrors:i,dynamicFields:a,signals:l,sourceOptions:r,namespaceOptions:s})=>{if(!e)return null;if(a?.length)return t(gr,{fields:a,value:n||{},setValue:o,formErrors:i||{},signals:l||[],seedInitialValues:!0,keyValuePersistAs:"map",sourceOptions:r,namespaceOptions:s},e);const c=Is[e];return c?t(c,{value:n,setValue:o,formErrors:i}):null},Es=()=>{const n=v(),{selectedOption:o,genericForm:i,sourceOptions:a,namespaceOptions:l}=jl();if(!i||!o)return t($e,{title:"No active form"});const{formData:r,handleFormChange:s,formErrors:c}=i;return e(ae,{$gap:24,children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[t(Ae,{size:te.XXXS,maxLines:2,children:o.description}),e(oe,{$gap:12,children:[t(ve,{options:[{icon:Xa,label:"Enabled",value:!1,selectedBgColor:n.v2.colors.green[800]},{icon:Ua,label:"Disabled",value:!0,selectedBgColor:n.v2.colors.red[800]}],size:Re.S,selected:r.disabled,setSelected:e=>s("disabled",e)}),t(Te,{leftIcon:Va,variant:Ie.Secondary,size:ke.S,onClick:()=>o.docsUrl&&window.open(o.docsUrl,"_blank","noopener noreferrer")})]})]}),t(fr,{title:"Signals for processing",allowedSignals:o.allowedSignals,selectedSignals:r.signals||[],setSelectedSignals:e=>s("signals",e),errorMessage:c.signals}),t(Ne,{name:"actionName",label:"Action name",placeholder:"Use a name that describes the action...",value:r.name||"",onChange:({target:{value:e}})=>s("name",e),errorMessage:c.name}),t(Ns,{actionType:o.type,dynamicFields:o.fields,signals:r.signals||[],value:r.fields,setValue:(e,t)=>s(`fields.${e}`,t),formErrors:c,sourceOptions:a,namespaceOptions:l}),t(De,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:r.notes||"",onChange:({target:{value:e}})=>s("notes",e),errorMessage:c.notes})]})},Os=b(oe)`
16
46
  position: sticky;
17
47
  bottom: 4px;
18
48
  align-self: center;
@@ -23,61 +53,30 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
23
53
  background-color: ${({theme:e})=>e.v2.colors.black[500]};
24
54
  box-shadow: 0 4px 16.7px 0 rgba(0, 0, 0, 0.83);
25
55
  z-index: 1;
26
- `,bs=r(({isEdit:n},o)=>{const l=v(),{isVm:r}=S(),{destinationsApi:c}=Vl(),{activeForm:d,genericForm:p,validateFormData:u,thisUnsavedDestination:h,addUnsavedDestination:m,updateUnsavedDestination:g,deleteUnsavedDestination:f}=Hl(),[b,y]=a(h?.testResult),[C,x]=a(!!h);i(()=>{h?(y(h.testResult),x(!0)):(y(void 0),x(!1))},[h]);const w=async()=>{if(!d?.option.testConnectionSupported||!p||r)return;const e=await c.testConnection(De(p.formData));return y(e),e};return s(o,()=>({testConnection:w,testConnectionSupported:!!d?.option.testConnectionSupported}),[d?.option.testConnectionSupported,p,c]),p&&d?e(ee,{$gap:24,style:{minHeight:"100%"},children:[e(pe,{$gap:12,$justifyContent:"space-between",children:[b?b.succeeded?t(Ne,{status:Ee.Success,message:b.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t(Ne,{status:Ee.Error,message:b.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),e(pe,{$gap:12,children:[!r&&t(ce,{options:[{icon:_a,label:"Enabled",value:!1,selectedBgColor:l.v2.colors.green[800]},{icon:Pa,label:"Disabled",value:!0,selectedBgColor:l.v2.colors.red[800]}],size:ke.S,selected:p.formData.disabled,setSelected:e=>p.handleFormChange("disabled",e),disabled:C}),t(fe,{"data-id":"dest-form-docs",leftIcon:La,variant:ve.Secondary,size:be.S,onClick:()=>window.open(`${Oe}/backends/${d.option.type}`,"_blank","noopener noreferrer")})]})]}),t(hr,{title:"This connection will monitor:",allowedSignals:Re(d.option.supportedSignals),selectedSignals:Ae(p.formData.exportedSignals),setSelectedSignals:e=>p.handleFormChange("exportedSignals",{logs:e.includes($e.Logs),metrics:e.includes($e.Metrics),traces:e.includes($e.Traces),profiles:e.includes($e.Profiles)}),disabled:C,errorMessage:p.formErrors.exportedSignals}),t(ye,{name:"destinationName",label:"Destination name",placeholder:"Use a name that describes the destination...",value:p.formData.name,onChange:({target:{value:e}})=>p.handleFormChange("name",e),disabled:C,errorMessage:p.formErrors.name}),t(ur,{signals:Ae(p.formData.exportedSignals),fields:d.option.fields,disabled:C,value:Object.fromEntries(p.formData.fields.map(e=>[e.key,e.value])),setValue:(e,t)=>{const n=p.formData.fields.some(t=>t.key===e);p.handleFormChange("fields",n?p.formData.fields.map(n=>n.key===e?{...n,value:t}:n):[...p.formData.fields,{key:e,value:t}]),e&&p.formErrors[e]&&p.handleErrorChange(e,void 0)},formErrors:p.formErrors,keyValuePersistAs:"array"}),!n&&e(fs,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(fe,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:Fa,variant:ve.Secondary,textColor:l.v2.colors.red[500],onClick:()=>f(d.unsavedIdx)})}),!r&&(!h||h.option.testConnectionSupported&&!C)&&t("div",{style:{width:"150px"},children:t(fe,{"data-id":"dest-form-test-connection",fullWidth:!0,label:"Test Connection",variant:ve.Secondary,onClick:w})}),h&&t("div",C?{style:{width:"150px"},children:t(fe,{"data-id":"dest-form-edit",fullWidth:!0,label:"Edit",rightIcon:Ma,variant:ve.Secondary,onClick:()=>x(!1)})}:{style:{width:"150px"},children:t(fe,{"data-id":"dest-form-save",fullWidth:!0,label:"Save Changes",variant:ve.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=u();if(!e){const e=await w(),n=!!e&&!e.succeeded;g(d.unsavedIdx,{formData:t,testResult:e},n)}}})}),!h&&t("div",{style:{width:"150px"},children:t(fe,{"data-id":"dest-form-add",fullWidth:!0,label:"Add Destination",variant:ve.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=u();if(!e){const e=await w(),n=!!e&&!e.succeeded;m({formData:t,testResult:e},n)}}})})]})]}):t(xe,{title:"No active form"})});bs.displayName="AddDestinationForm";const vs=[{id:Le.FilePath,label:"Collect file path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Le.Function,label:"Collect function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Le.LineNumber,label:"Collect line number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],ys=[{id:Le.Column,label:"Collect column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Le.Namespace,label:"Collect namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Le.StackTrace,label:"Collect stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],Cs=["*"],Ss=[{id:ze.HttpRequest,label:"Collect HTTP request",tooltip:""},{id:ze.HttpResponse,label:"Collect HTTP response",tooltip:""},{id:ze.DbQuery,label:"Collect DB query",tooltip:""},{id:ze.Messaging,label:"Collect messaging",tooltip:""}],xs={[Ve.Java]:[new Xe("","")],[Ve.Golang]:[new Be("")],[Ve.Php]:[new Ue("","")]},ws={[je.CodeAttributes]:({value:o,setValue:a,formErrors:l,disabled:r})=>{const s=l.codeAttributes,d=c(()=>Object.entries(o.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[o]);i(()=>{if(!d.length&&!s){const e={[Le.FilePath]:!0,[Le.Function]:!0,[Le.LineNumber]:!0,[Le.Column]:null,[Le.Namespace]:null,[Le.StackTrace]:null};a("codeAttributes",e)}},[]);const p=(e,t)=>{const n=t?[...d,e]:d.filter(t=>t!==e),o=Object.values(Le).reduce((e,t)=>(e[t]=!!n.includes(t)||null,e),{});a("codeAttributes",o)};return e(n,{children:[e(ee,{$gap:12,children:[t(_e,{size:Te.XS,color:Pe.Secondary,nowrap:!0,children:"Recommended data to collect"}),t(ee,{$gap:6,children:vs.map(({id:e,label:n,tooltip:o})=>t(Fe,{text:o,withIcon:!0,children:t(ne,{label:n,value:d.includes(e),onChange:t=>p(e,t),disabled:r})},e))}),t(oe,{errorMessage:s})]}),e(ee,{$gap:12,children:[t(_e,{size:Te.XS,color:Pe.Secondary,nowrap:!0,children:"Verbose data to collect"}),t(ee,{$gap:6,children:ys.map(({id:e,label:n,tooltip:o})=>t(Fe,{text:o,withIcon:!0,children:t(ne,{label:n,value:d.includes(e),onChange:t=>p(e,t),disabled:r})},e))}),t(oe,{errorMessage:s})]})]})},[je.CustomInstrumentation]:({value:o,setValue:a,formErrors:l,disabled:r})=>{const s=l.customInstrumentations,d=c(()=>(o?.customInstrumentations?.[Ve.Golang]||[]).map(e=>new Be(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[o]),p=c(()=>(o?.customInstrumentations?.[Ve.Java]||[]).map(e=>new Xe(e.className,e.methodName)),[o]),u=c(()=>(o?.customInstrumentations?.[Ve.Php]||[]).map(e=>new Ue(e.className,e.functionName)),[o]);return i(()=>{o?.customInstrumentations||s||a("customInstrumentations",{[Ve.Golang]:xs[Ve.Golang],[Ve.Java]:xs[Ve.Java],[Ve.Php]:xs[Ve.Php]})},[]),e(n,{children:[e(ee,{children:[e(pe,{$gap:8,children:[t(za,{}),t(te,{label:"Golang custom probes"})]}),t(ie,{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:d,setValues:e=>{const t={};t[Ve.Golang]=e.map(e=>new Be(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),t[Ve.Java]=p,t[Ve.Php]=u,a("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2,disabled:r})]}),e(ee,{children:[e(pe,{$gap:8,children:[t(Ba,{}),t(te,{label:"Java custom probes"})]}),t(ie,{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:p,setValues:e=>{const t={};t[Ve.Golang]=d,t[Ve.Java]=e.map(e=>new Xe(e.className,e.methodName)),t[Ve.Php]=u,a("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2,disabled:r})]}),e(ee,{children:[e(pe,{$gap:8,children:[t(Xa,{}),t(te,{label:"PHP custom probes"})]}),t(Ne,{status:Ee.Warning,message:He.PHP_CUSTOM_INSTRUMENTATION_RESTART,fullWidth:!0}),t(ie,{name:"phpProbes",columns:[{keyName:"className",label:"Class name",placeholder:"e.g. App\\Service\\OrderService",tooltip:"The fully qualified class name to instrument. Leave empty for a global function."},{keyName:"functionName",label:"Function name",placeholder:"e.g. processOrder",tooltip:"The name of the function or method to instrument."}],values:u,setValues:e=>{const t={};t[Ve.Golang]=d,t[Ve.Java]=p,t[Ve.Php]=e.map(e=>new Ue(e.className,e.functionName)),a("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]})]})},[je.HeadersCollection]:({value:e,setValue:n,formErrors:o,disabled:a})=>{const l=o.headersCollection,r=c(()=>e?.headersCollection?.[Me.HeaderKeys]||[],[e]),s=e=>{const t={[Me.HeaderKeys]:e};n("headersCollection",t)};return i(()=>{r.length||l||s(Cs)},[]),t(se,{name:"headerKeys",label:"Header keys",tooltip:"Specify which headers you want to collect",helpMessage:"Asterisk (*) will collect all headers",values:r,setValues:s,errorMessage:l,disabled:a})},[je.PayloadCollection]:({value:n,setValue:o,formErrors:a,disabled:l})=>{const r=a.payloadCollection,s=c(()=>Object.entries(n.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[n]);return i(()=>{if(!s.length&&!r){const e={[ze.HttpRequest]:{},[ze.HttpResponse]:{},[ze.DbQuery]:{},[ze.Messaging]:{}};o("payloadCollection",e)}},[]),e(ee,{$gap:12,children:[t(_e,{size:Te.XS,color:Pe.Secondary,nowrap:!0,children:"Type of data to collect"}),t(ee,{$gap:6,children:Ss.map(({id:e,label:n,tooltip:i})=>t(Fe,{text:i,withIcon:!0,children:t(ne,{label:n,value:s.includes(e),onChange:t=>((e,t)=>{const n=t?[...s,e]:s.filter(t=>t!==e),i={[ze.HttpRequest]:n.includes(ze.HttpRequest)?{}:null,[ze.HttpResponse]:n.includes(ze.HttpResponse)?{}:null,[ze.DbQuery]:n.includes(ze.DbQuery)?{}:null,[ze.Messaging]:n.includes(ze.Messaging)?{}:null};o("payloadCollection",i)})(e,t),disabled:l})},e))}),t(oe,{errorMessage:r})]})},[je.UnknownType]:null},Ts=({ruleType:e,value:n,setValue:o,formErrors:i,dynamicFields:a,disabled:l})=>{if(!e)return null;if(a?.length)return t(ur,{fields:a,value:n||{},setValue:o,formErrors:i||{},signals:[],seedInitialValues:!0,keyValuePersistAs:"map",disabled:l},e);const r=ws[e];return r?t(r,{value:n,setValue:o,formErrors:i,disabled:l}):null},ks=()=>{const n=v(),{isEnterprise:o,isVm:i}=S(),{selectedOption:a,genericForm:l,sourceOptions:r,namespaceOptions:s}=jl(),d=c(()=>Ge(a?.supportedLanguages),[a?.supportedLanguages]),p=c(()=>{if(a)return a.type===je.CustomInstrumentation?[]:We(a.supportedLanguages)},[a]);if(!l||!a)return t(xe,{title:"No active form"});const{formData:u,handleFormChange:h,formErrors:m}=l;return e(ee,{$gap:24,children:[e(pe,{$gap:12,$justifyContent:"space-between",children:[t(we,{size:Te.XXXS,maxLines:2,children:a.description}),e(pe,{$gap:12,children:[t(ce,{options:[{icon:_a,label:"Enabled",value:!1,selectedBgColor:n.v2.colors.green[800]},{icon:Pa,label:"Disabled",value:!0,selectedBgColor:n.v2.colors.red[800]}],size:ke.S,selected:u.disabled,setSelected:e=>h("disabled",e),disabled:!o}),t(fe,{leftIcon:La,variant:ve.Secondary,size:be.S,onClick:()=>a.docsUrl&&window.open(a.docsUrl,"_blank","noopener noreferrer")})]})]}),t(mr,{option:a,formState:u}),!!d.length&&e(pe,{$gap:12,children:[t(_e,{size:Te.XS,color:Pe.Secondary,nowrap:!0,children:"Supported Languages:"}),d.map(e=>t(Ke,{label:Je(e),leftIcon:Ye(e),backgroundColor:n.v2.colors.purple[900]},e))]}),!i&&t(gr,{scopes:u.sourceScopes,onChange:e=>h("sourceScopes",e),sourceOptions:r,namespaceOptions:s,supportedLanguages:p,dataIdPrefix:"instrumentation-rule",slim:!0,disabled:!o}),t(ye,{name:"ruleName",label:"Rule name",placeholder:"Use a name that describes the rule...",value:u.ruleName,onChange:({target:{value:e}})=>h("ruleName",e),errorMessage:m.ruleName,disabled:!o}),t(Ts,{ruleType:a.type,dynamicFields:a.fields,value:u,setValue:(e,t)=>h(e,t),formErrors:m,disabled:!o}),t(Ie,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:u.notes,onChange:({target:{value:e}})=>h("notes",e),errorMessage:m.notes,disabled:!o})]})},Is=()=>{const{pendingMerge:e,confirmMerge:n,cancelMerge:o}=Gl();if(!e)return null;const{existingName:i,editingName:a}=e;return t(qe,{isOpen:!0,onClose:o,title:"Merge with existing Data Stream?",description:Ze.DATA_STREAM_MERGE_WARNING(a,i),approveButton:{"data-id":"data-stream-merge-confirm",label:"Merge",variant:ve.Primary,onClick:n},denyButton:{"data-id":"data-stream-merge-cancel",label:"Cancel",variant:ve.Secondary,onClick:o}})},Ns=({autoFocus:n})=>{const{dataStreams:o}=Qe(),{genericForm:i,excludeName:a,editingName:l}=Gl(),{formData:r,formErrors:s,handleFormChange:d}=i,p=r.name,u=c(()=>o.find(e=>e.name===p&&e.name!==a),[o,p,a]);return e(ee,{$width:"100%",$gap:12,children:[t(ye,{name:"data-stream-name",label:Ze.STREAM_NAME,placeholder:Ze.NAME_YOUR_STREAM_PLACEHOLDER,tooltip:Ze.STREAM_DESCRIPTION,required:!0,autoFocus:n,value:p,onChange:e=>d("name",e.target.value),errorMessage:s.name}),u&&t(Ne,{status:Ee.Warning,message:Ze.DATA_STREAM_MERGE_WARNING(l,u.name),fullWidth:!0})]})},Es=()=>{const{selectedStreamName:e}=Qe(),{genericForm:n}=Wl();if(!n)return t(xe,{title:"No active form"});const{formData:o,handleFormChange:i,formErrors:a}=n;return t(ye,{name:"sourceName",label:Ze.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}})=>{i("otelServiceName",t),i("currentStreamName",e)},errorMessage:a.otelServiceName})},Os=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],$s=b.div`
56
+ `,$s=s(({isEdit:n},o)=>{const i=v(),{isK8s:r}=S(),{destinationsApi:s}=Gl(),{activeForm:d,genericForm:p,validateFormData:u,thisUnsavedDestination:h,addUnsavedDestination:m,updateUnsavedDestination:g,deleteUnsavedDestination:f}=Wl(),[b,y]=l(h?.testResult),[C,x]=l(!!h);a(()=>{h?(y(h.testResult),x(!0)):(y(void 0),x(!1))},[h]);const w=async()=>{if(!d?.option.testConnectionSupported||!p||!r)return;const e=await s.testConnection(Be(p.formData));return y(e),e};return c(o,()=>({testConnection:w,testConnectionSupported:!!d?.option.testConnectionSupported}),[d?.option.testConnectionSupported,p,s]),p&&d?e(ae,{$gap:24,style:{minHeight:"100%"},children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[b?b.succeeded?t(_e,{status:Pe.Success,message:b.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t(_e,{status:Pe.Error,message:b.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),e(oe,{$gap:12,children:[r&&t(ve,{options:[{icon:Xa,label:"Enabled",value:!1,selectedBgColor:i.v2.colors.green[800]},{icon:Ua,label:"Disabled",value:!0,selectedBgColor:i.v2.colors.red[800]}],size:Re.S,selected:p.formData.disabled,setSelected:e=>p.handleFormChange("disabled",e),disabled:C}),t(Te,{"data-id":"dest-form-docs",leftIcon:Va,variant:Ie.Secondary,size:ke.S,onClick:()=>window.open(`${Le}/backends/${d.option.type}`,"_blank","noopener noreferrer")})]})]}),t(fr,{title:"This connection will monitor:",allowedSignals:ze(d.option.supportedSignals),selectedSignals:Me(p.formData.exportedSignals),setSelectedSignals:e=>p.handleFormChange("exportedSignals",{logs:e.includes(Fe.Logs),metrics:e.includes(Fe.Metrics),traces:e.includes(Fe.Traces),profiles:e.includes(Fe.Profiles)}),disabled:C,errorMessage:p.formErrors.exportedSignals}),t(Ne,{name:"destinationName",label:"Destination name",placeholder:"Use a name that describes the destination...",value:p.formData.name,onChange:({target:{value:e}})=>p.handleFormChange("name",e),disabled:C,errorMessage:p.formErrors.name}),t(gr,{signals:Me(p.formData.exportedSignals),fields:d.option.fields,disabled:C,value:Object.fromEntries(p.formData.fields.map(e=>[e.key,e.value])),setValue:(e,t)=>{const n=p.formData.fields.some(t=>t.key===e);p.handleFormChange("fields",n?p.formData.fields.map(n=>n.key===e?{...n,value:t}:n):[...p.formData.fields,{key:e,value:t}]),e&&p.formErrors[e]&&p.handleErrorChange(e,void 0)},formErrors:p.formErrors,keyValuePersistAs:"array"}),!n&&e(Os,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(Te,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:Ha,variant:Ie.Secondary,textColor:i.v2.colors.red[500],onClick:()=>f(d.unsavedIdx)})}),r&&(!h||h.option.testConnectionSupported&&!C)&&t("div",{style:{width:"150px"},children:t(Te,{"data-id":"dest-form-test-connection",fullWidth:!0,label:"Test Connection",variant:Ie.Secondary,onClick:w})}),h&&t("div",C?{style:{width:"150px"},children:t(Te,{"data-id":"dest-form-edit",fullWidth:!0,label:"Edit",rightIcon:ja,variant:Ie.Secondary,onClick:()=>x(!1)})}:{style:{width:"150px"},children:t(Te,{"data-id":"dest-form-save",fullWidth:!0,label:"Save Changes",variant:Ie.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=u();if(!e){const e=await w(),n=!!e&&!e.succeeded;g(d.unsavedIdx,{formData:t,testResult:e},n)}}})}),!h&&t("div",{style:{width:"150px"},children:t(Te,{"data-id":"dest-form-add",fullWidth:!0,label:"Add Destination",variant:Ie.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=u();if(!e){const e=await w(),n=!!e&&!e.succeeded;m({formData:t,testResult:e},n)}}})})]})]}):t($e,{title:"No active form"})});$s.displayName="AddDestinationForm";const As=[{id:Xe.FilePath,label:"Collect file path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Xe.Function,label:"Collect function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Xe.LineNumber,label:"Collect line number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],Rs=[{id:Xe.Column,label:"Collect column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Xe.Namespace,label:"Collect namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Xe.StackTrace,label:"Collect stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],Ds=["*"],_s=[{id:He.HttpRequest,label:"Collect HTTP request",tooltip:""},{id:He.HttpResponse,label:"Collect HTTP response",tooltip:""},{id:He.DbQuery,label:"Collect DB query",tooltip:""},{id:He.Messaging,label:"Collect messaging",tooltip:""}],Ps={[Ke.Java]:[new Ge("","")],[Ke.Golang]:[new je("")],[Ke.Php]:[new We("","")]},Ls={[Je.CodeAttributes]:({value:o,setValue:l,formErrors:r,disabled:s})=>{const c=r.codeAttributes,d=i(()=>Object.entries(o.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[o]);a(()=>{if(!d.length&&!c){const e={[Xe.FilePath]:!0,[Xe.Function]:!0,[Xe.LineNumber]:!0,[Xe.Column]:null,[Xe.Namespace]:null,[Xe.StackTrace]:null};l("codeAttributes",e)}},[]);const p=(e,t)=>{const n=t?[...d,e]:d.filter(t=>t!==e),o=Object.values(Xe).reduce((e,t)=>(e[t]=!!n.includes(t)||null,e),{});l("codeAttributes",o)};return e(n,{children:[e(ae,{$gap:12,children:[t(ee,{size:te.XS,color:ne.Secondary,nowrap:!0,children:"Recommended data to collect"}),t(ae,{$gap:6,children:As.map(({id:e,label:n,tooltip:o})=>t(Ue,{text:o,withIcon:!0,children:t(Q,{label:n,value:d.includes(e),onChange:t=>p(e,t),disabled:s})},e))}),t(ue,{errorMessage:c})]}),e(ae,{$gap:12,children:[t(ee,{size:te.XS,color:ne.Secondary,nowrap:!0,children:"Verbose data to collect"}),t(ae,{$gap:6,children:Rs.map(({id:e,label:n,tooltip:o})=>t(Ue,{text:o,withIcon:!0,children:t(Q,{label:n,value:d.includes(e),onChange:t=>p(e,t),disabled:s})},e))}),t(ue,{errorMessage:c})]})]})},[Je.CustomInstrumentation]:({value:o,setValue:l,formErrors:r,disabled:s})=>{const c=r.customInstrumentations,d=i(()=>(o?.customInstrumentations?.[Ke.Golang]||[]).map(e=>new je(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[o]),p=i(()=>(o?.customInstrumentations?.[Ke.Java]||[]).map(e=>new Ge(e.className,e.methodName)),[o]),u=i(()=>(o?.customInstrumentations?.[Ke.Php]||[]).map(e=>new We(e.className,e.functionName)),[o]);return a(()=>{o?.customInstrumentations||c||l("customInstrumentations",{[Ke.Golang]:Ps[Ke.Golang],[Ke.Java]:Ps[Ke.Java],[Ke.Php]:Ps[Ke.Php]})},[]),e(n,{children:[e(ae,{children:[e(oe,{$gap:8,children:[t(Ga,{}),t(pe,{label:"Golang custom probes"})]}),t(he,{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:d,setValues:e=>{const t={};t[Ke.Golang]=e.map(e=>new je(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),t[Ke.Java]=p,t[Ke.Php]=u,l("customInstrumentations",t)},errorMessage:c,limitFieldsPerRow:2,disabled:s})]}),e(ae,{children:[e(oe,{$gap:8,children:[t(Wa,{}),t(pe,{label:"Java custom probes"})]}),t(he,{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:p,setValues:e=>{const t={};t[Ke.Golang]=d,t[Ke.Java]=e.map(e=>new Ge(e.className,e.methodName)),t[Ke.Php]=u,l("customInstrumentations",t)},errorMessage:c,limitFieldsPerRow:2,disabled:s})]}),e(ae,{children:[e(oe,{$gap:8,children:[t(Ka,{}),t(pe,{label:"PHP custom probes"})]}),t(_e,{status:Pe.Warning,message:Ye.PHP_CUSTOM_INSTRUMENTATION_RESTART,fullWidth:!0}),t(he,{name:"phpProbes",columns:[{keyName:"className",label:"Class name",placeholder:"e.g. App\\Service\\OrderService",tooltip:"The fully qualified class name to instrument. Leave empty for a global function."},{keyName:"functionName",label:"Function name",placeholder:"e.g. processOrder",tooltip:"The name of the function or method to instrument."}],values:u,setValues:e=>{const t={};t[Ke.Golang]=d,t[Ke.Java]=p,t[Ke.Php]=e.map(e=>new We(e.className,e.functionName)),l("customInstrumentations",t)},errorMessage:c,limitFieldsPerRow:2})]})]})},[Je.HeadersCollection]:({value:e,setValue:n,formErrors:o,disabled:l})=>{const r=o.headersCollection,s=i(()=>e?.headersCollection?.[Ve.HeaderKeys]||[],[e]),c=e=>{const t={[Ve.HeaderKeys]:e};n("headersCollection",t)};return a(()=>{s.length||r||c(Ds)},[]),t(be,{name:"headerKeys",label:"Header keys",tooltip:"Specify which headers you want to collect",helpMessage:"Asterisk (*) will collect all headers",values:s,setValues:c,errorMessage:r,disabled:l})},[Je.PayloadCollection]:({value:n,setValue:o,formErrors:l,disabled:r})=>{const s=l.payloadCollection,c=i(()=>Object.entries(n.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[n]);return a(()=>{if(!c.length&&!s){const e={[He.HttpRequest]:{},[He.HttpResponse]:{},[He.DbQuery]:{},[He.Messaging]:{}};o("payloadCollection",e)}},[]),e(ae,{$gap:12,children:[t(ee,{size:te.XS,color:ne.Secondary,nowrap:!0,children:"Type of data to collect"}),t(ae,{$gap:6,children:_s.map(({id:e,label:n,tooltip:i})=>t(Ue,{text:i,withIcon:!0,children:t(Q,{label:n,value:c.includes(e),onChange:t=>((e,t)=>{const n=t?[...c,e]:c.filter(t=>t!==e),i={[He.HttpRequest]:n.includes(He.HttpRequest)?{}:null,[He.HttpResponse]:n.includes(He.HttpResponse)?{}:null,[He.DbQuery]:n.includes(He.DbQuery)?{}:null,[He.Messaging]:n.includes(He.Messaging)?{}:null};o("payloadCollection",i)})(e,t),disabled:r})},e))}),t(ue,{errorMessage:s})]})},[Je.UnknownType]:null},Fs=({ruleType:e,value:n,setValue:o,formErrors:i,dynamicFields:a,disabled:l})=>{if(!e)return null;if(a?.length)return t(gr,{fields:a,value:n||{},setValue:o,formErrors:i||{},signals:[],seedInitialValues:!0,keyValuePersistAs:"map",disabled:l},e);const r=Ls[e];return r?t(r,{value:n,setValue:o,formErrors:i,disabled:l}):null},Ms=()=>{const n=v(),{isEnterprise:o,isK8s:a}=S(),{selectedOption:l,genericForm:r,sourceOptions:s,namespaceOptions:c}=Kl(),d=i(()=>qe(l?.supportedLanguages),[l?.supportedLanguages]),p=i(()=>{if(l)return l.type===Je.CustomInstrumentation?[]:Ze(l.supportedLanguages)},[l]);if(!r||!l)return t($e,{title:"No active form"});const{formData:u,handleFormChange:h,formErrors:m}=r;return e(ae,{$gap:24,children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[t(Ae,{size:te.XXXS,maxLines:2,children:l.description}),e(oe,{$gap:12,children:[t(ve,{options:[{icon:Xa,label:"Enabled",value:!1,selectedBgColor:n.v2.colors.green[800]},{icon:Ua,label:"Disabled",value:!0,selectedBgColor:n.v2.colors.red[800]}],size:Re.S,selected:u.disabled,setSelected:e=>h("disabled",e),disabled:!o}),t(Te,{leftIcon:Va,variant:Ie.Secondary,size:ke.S,onClick:()=>l.docsUrl&&window.open(l.docsUrl,"_blank","noopener noreferrer")})]})]}),t(br,{option:l,formState:u}),!!d.length&&e(oe,{$gap:12,children:[t(ee,{size:te.XS,color:ne.Secondary,nowrap:!0,children:"Supported Languages:"}),d.map(e=>t(ce,{label:et(e),leftIcon:Qe(e),backgroundColor:n.v2.colors.purple[900]},e))]}),a&&t(vr,{scopes:u.sourceScopes,onChange:e=>h("sourceScopes",e),sourceOptions:s,namespaceOptions:c,supportedLanguages:p,dataIdPrefix:"instrumentation-rule",slim:!0,disabled:!o}),t(Ne,{name:"ruleName",label:"Rule name",placeholder:"Use a name that describes the rule...",value:u.ruleName,onChange:({target:{value:e}})=>h("ruleName",e),errorMessage:m.ruleName,disabled:!o}),t(Fs,{ruleType:l.type,dynamicFields:l.fields,value:u,setValue:(e,t)=>h(e,t),formErrors:m,disabled:!o}),t(De,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:u.notes,onChange:({target:{value:e}})=>h("notes",e),errorMessage:m.notes,disabled:!o})]})},zs=()=>{const{pendingMerge:e,confirmMerge:n,cancelMerge:o}=Yl();if(!e)return null;const{existingName:i,editingName:a}=e;return t(tt,{isOpen:!0,onClose:o,title:"Merge with existing Data Stream?",description:nt.DATA_STREAM_MERGE_WARNING(a,i),approveButton:{"data-id":"data-stream-merge-confirm",label:"Merge",variant:Ie.Primary,onClick:n},denyButton:{"data-id":"data-stream-merge-cancel",label:"Cancel",variant:Ie.Secondary,onClick:o}})},Bs=({autoFocus:n})=>{const{dataStreams:o}=ot(),{genericForm:a,excludeName:l,editingName:r}=Yl(),{formData:s,formErrors:c,handleFormChange:d}=a,p=s.name,u=i(()=>o.find(e=>e.name===p&&e.name!==l),[o,p,l]);return e(ae,{$width:"100%",$gap:12,children:[t(Ne,{name:"data-stream-name",label:nt.STREAM_NAME,placeholder:nt.NAME_YOUR_STREAM_PLACEHOLDER,tooltip:nt.STREAM_DESCRIPTION,required:!0,autoFocus:n,value:p,onChange:e=>d("name",e.target.value),errorMessage:c.name}),u&&t(_e,{status:Pe.Warning,message:nt.DATA_STREAM_MERGE_WARNING(r,u.name),fullWidth:!0})]})},Xs=()=>{const{selectedStreamName:e}=ot(),{genericForm:n}=Jl();if(!n)return t($e,{title:"No active form"});const{formData:o,handleFormChange:i,formErrors:a}=n;return t(Ne,{name:"sourceName",label:nt.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}})=>{i("otelServiceName",t),i("currentStreamName",e)},errorMessage:a.otelServiceName})},Us=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],Vs=b.div`
27
57
  display: flex;
28
58
  flex-direction: column;
29
59
  gap: 24px;
30
- `,As=b.div`
60
+ `,Hs=b.div`
31
61
  display: contents;
32
62
  & > * {
33
63
  opacity: ${({$faded:e})=>e?.4:1};
34
64
  transition: opacity 0.2s ease;
35
65
  }
36
- `,Rs=({value:e})=>{const n=v();return t(Ke,e?{status:Ee.Success,label:lt,leftIcon:_a}:{label:rt,leftIcon:Pa,backgroundColor:n.v2.colors.silver[500],textColor:n.v2.colors.white[500]})},Ds=({value:e,onChange:n})=>{const o=v(),i=c(()=>[{icon:_a,label:lt,value:!0,selectedBgColor:o.v2.colors.green[800]},{icon:Pa,label:rt,value:!1,selectedBgColor:o.v2.colors.silver[500]}],[o]);return t(ce,{options:i,selected:e,setSelected:n??(()=>{}),disabled:!n})},_s=()=>{const e=Kl();switch(e.formType){case Yl.Create:return t(Ps,{category:e.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Ds,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})});case Yl.View:return e.data?e.isEditing?t(Ps,{category:e.data.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Ds,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})}):t(Ls,{data:e.data,renderAction:()=>t(Rs,{value:!e.data?.rule.disabled})}):null;case Yl.EditAutoNoisy:return t(Fs,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:at,sectionTitle:nt,sectionSubTitle:it,presetLabel:tt,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(Ds,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Yl.EditAutoCostReduction:return t(Fs,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:ot,sectionTitle:nt,presetLabel:tt,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(Ds,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Yl.EditAutoHighlyRelevant:return t($s,{children:t(fr,{title:e.localEnabled?void 0:et,summary:e.summary,renderAction:()=>t(Ds,{value:e.localEnabled,onChange:e.setLocalEnabled})})})}},Ps=({category:n,formData:o,onChange:i,sourceOptions:a,namespaceOptions:l,renderAction:r})=>e($s,{children:[t(yr,{category:n,formState:o,renderAction:r}),e(As,{$faded:!!o.disabled,children:[t(Cr,{category:n,formState:o,onChange:i}),t(gr,{scopes:o.sourceScopes,onChange:e=>i({sourceScopes:e}),sourceOptions:a,namespaceOptions:l,titleNumber:1,dataIdPrefix:"sampling"}),t(Sr,{category:n,formState:o,onChange:i}),"highlyRelevant"===n&&t(xr,{formState:o,onChange:i}),"highlyRelevant"===n&&t(wr,{ruleType:o.ruleType,formState:o,onChange:i}),t(Tr,{category:n,formState:o,onChange:i})]})]}),Ls=({data:n,renderAction:o})=>e($s,{children:[t(yr,{readOnly:!0,summary:n.summary,renderAction:o}),t(Cr,{readOnly:!0,data:n}),t(gr,{readOnly:!0,scopes:x(n.rule.sourceScopes)}),t(Sr,{readOnly:!0,data:n}),t(Tr,{readOnly:!0,data:n}),"highlyRelevant"===n.category&&t(wr,{readOnly:!0,rule:n.rule})]}),Fs=({enabled:n,summary:o,inactiveTitle:i,sectionTitle:a,sectionSubTitle:l,presetLabel:r,customInputName:s,showModeToggle:c=!0,percentageMode:p,setPercentageMode:u,percentagePreset:h,setPercentagePreset:m,customPercentage:g,setCustomPercentage:f,renderAction:b})=>{const v=d(e=>u(e),[u]),y=d(e=>m(e),[m]),C=d(e=>f(e.target.value),[f]),S=!c||"sample"===p;return e($s,{children:[t(fr,{title:n?void 0:i,summary:o,renderAction:b}),t(As,{$faded:!n,children:e(st,{richTitle:{title:a,subTitle:l},children:[c&&t(ee,{$alignItems:"flex-start",children:t(ce,{options:Os,selected:p,setSelected:v})}),S&&t(br,{description:r,options:vr,selected:h,onSelect:y,customName:s,customLabel:ct,customPlaceholder:"5%",customValue:g,onCustomChange:C})]})})]})},Ms=b.div`
37
- display: flex;
38
- align-items: center;
39
- justify-content: space-between;
40
- gap: 12px;
41
- padding: 8px 12px;
42
- border-radius: 12px;
43
- 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"};
44
- cursor: ${({$disabled:e})=>e?"not-allowed":"pointer"};
45
- opacity: ${({$disabled:e})=>e?.5:1};
46
- &:hover {
47
- background-color: ${({$isSelected:e,$purpleColors:t,theme:n})=>n.v2.colors[t?"purple":"silver"][e?"700":"800"]};
48
- }
49
- `,zs=b.div`
50
- display: flex;
51
- align-items: center;
52
- justify-content: center;
53
- padding: 8px;
54
- border-radius: 8px;
55
- background-color: ${({theme:e})=>e.v2.colors.white[500]+dt["004"]};
56
- `,Bs=b(ee)`
57
- flex: 1;
58
- min-width: 0;
59
- `,Xs=b(pe)`
60
- min-width: 0;
61
- width: 100%;
62
- `,Us=b(_e)`
63
- flex: 1;
64
- min-width: 0;
65
- `,Vs=b(pe)`
66
- flex-shrink: 0;
67
- `,Hs=({dataId:n,icon:o,title:i,description:a,withCarret:l,purpleColors:r,disabled:s,children:c,isSelected:d,onClick:p,isChecked:u,isPartiallyChecked:h,onCheckboxChange:m})=>e(Ms,{"data-id":n||`list-item-${i}`,$isSelected:d,$purpleColors:r,$disabled:s,onClick:()=>!d&&!s&&p(),children:[e(Bs,{$gap:4,children:[e(Xs,{$gap:12,children:[m&&t(ne,{partiallyChecked:h||!1,value:u||!1,onChange:e=>m(e)}),o&&t(zs,{children:t(o,{size:20})}),t(Us,{size:Te.XS,nowrap:!0,children:i})]}),a&&t(_e,{size:Te.XXXS,color:Pe.Secondary,nowrap:!0,children:a})]}),(l||c)&&e(Vs,{$gap:8,children:[c,l&&t(Ua,{size:18})]})]}),js=({onClose:e,selectedConnectionIds:n,setSelectedConnectionIds:o,withOverlay:i})=>{const{actionsApi:l}=Vl(),{platformType:r,version:s}=S(),[d,u]=a(""),h=p(null),{selectedOption:m,onSelectOption:g,genericForm:f,validateFormData:b}=Ul(),{options:v,loading:y}=l.useActionTypes(),C=c(()=>v.length?v:pt(r,s),[v,r,s]),x=c(()=>(d?C.filter(e=>e?.label?.toLowerCase().includes(d.toLowerCase())):C).filter(e=>!!e),[C,d]),w=c(()=>y?[t(ut,{$padding:"8px 12px",children:t(ht,{size:6})},"loading")]:x.map(e=>{const n=m?.type===e.type;return t(Hs,{dataId:e.type?`option-${e.type}`:void 0,title:e.label,description:e.description,withCarret:!0,isSelected:n,onClick:()=>{h.current?.clearErrors(),g(e)}},e.type)}),[y,m?.type,x,g]),T=c(()=>y?[t(ut,{$padding:"8px 12px",children:t(ht,{size:4})},"loading")]:m?[t(gs,{},m.type)]:[t(mt,{$height:"100%",children:t(xe,{icon:Va,title:"Action not selected",subTitle:"Please select an action to add"})},"no-data")],[y,m]);return t(kr,{ref:h,isOpen:!0,withOverlay:i,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=b();if(e)return!1;await l.create(t)},disableSave:!m||!f?.isFormDirty,isFormDirty:f?.isFormDirty,hideDirtyNote:!0,progress:{title:Ze.CREATING_ACTION,subTitle:Ze.CREATING_ACTION_SUBTITLE},header:{icon:Va,title:Ze.ADD_ACTION,subTitle:Ze.ADD_ACTION_DESCRIPTION},connectionIds:n&&o?{value:n,setValue:o}:void 0,search:{value:d,onChange:u},leftColumn:{width:"40%",list:w},rightColumn:{width:"60%",list:T}})},Gs=({destinationsByCategory:o,filters:i,setFilters:a})=>{const l=c(()=>Object.values(gt).map(e=>({id:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()})).filter(e=>o[e.id]?.length),[o]),r=c(()=>{const e=Object.values($e).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(ft,{placeholder:"Select category",options:l,values:i.categoryType?[i.categoryType]:[],setValues:e=>a({...i,categoryType:i.categoryType===e[0]?null:e[0]})}),t(ce,{options:r,selected:i.signalType,setSelected:e=>a({...i,signalType:e})})]})},Ws=b.div`
66
+ `,js=({value:e})=>{const n=v();return t(ce,e?{status:Pe.Success,label:dt,leftIcon:Xa}:{label:pt,leftIcon:Ua,backgroundColor:n.v2.colors.silver[500],textColor:n.v2.colors.white[500]})},Gs=({value:e,onChange:n})=>{const o=v(),a=i(()=>[{icon:Xa,label:dt,value:!0,selectedBgColor:o.v2.colors.green[800]},{icon:Ua,label:pt,value:!1,selectedBgColor:o.v2.colors.silver[500]}],[o]);return t(ve,{options:a,selected:e,setSelected:n??(()=>{}),disabled:!n})},Ws=()=>{const e=ql();switch(e.formType){case Zl.Create:return t(Ks,{category:e.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Gs,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})});case Zl.View:return e.data?e.isEditing?t(Ks,{category:e.data.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Gs,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})}):t(Ys,{data:e.data,renderAction:()=>t(js,{value:!e.data?.rule.disabled})}):null;case Zl.EditAutoNoisy:return t(Js,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:ct,sectionTitle:lt,sectionSubTitle:st,presetLabel:at,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(Gs,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Zl.EditAutoCostReduction:return t(Js,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:rt,sectionTitle:lt,presetLabel:at,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(Gs,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Zl.EditAutoHighlyRelevant:return t(Vs,{children:t(yr,{title:e.localEnabled?void 0:it,summary:e.summary,renderAction:()=>t(Gs,{value:e.localEnabled,onChange:e.setLocalEnabled})})})}},Ks=({category:n,formData:o,onChange:i,sourceOptions:a,namespaceOptions:l,renderAction:r})=>e(Vs,{children:[t(xr,{category:n,formState:o,renderAction:r}),e(Hs,{$faded:!!o.disabled,children:[t(wr,{category:n,formState:o,onChange:i}),t(vr,{scopes:o.sourceScopes,onChange:e=>i({sourceScopes:e}),sourceOptions:a,namespaceOptions:l,titleNumber:1,dataIdPrefix:"sampling"}),t(Tr,{category:n,formState:o,onChange:i}),"highlyRelevant"===n&&t(kr,{formState:o,onChange:i}),"highlyRelevant"===n&&t(Ir,{ruleType:o.ruleType,formState:o,onChange:i}),t(Nr,{category:n,formState:o,onChange:i})]})]}),Ys=({data:n,renderAction:o})=>e(Vs,{children:[t(xr,{readOnly:!0,summary:n.summary,renderAction:o}),t(wr,{readOnly:!0,data:n}),t(vr,{readOnly:!0,scopes:x(n.rule.sourceScopes)}),t(Tr,{readOnly:!0,data:n}),t(Nr,{readOnly:!0,data:n}),"highlyRelevant"===n.category&&t(Ir,{readOnly:!0,rule:n.rule})]}),Js=({enabled:n,summary:o,inactiveTitle:i,sectionTitle:a,sectionSubTitle:l,presetLabel:r,customInputName:s,showModeToggle:c=!0,percentageMode:p,setPercentageMode:u,percentagePreset:h,setPercentagePreset:m,customPercentage:g,setCustomPercentage:f,renderAction:b})=>{const v=d(e=>u(e),[u]),y=d(e=>m(e),[m]),C=d(e=>f(e.target.value),[f]),S=!c||"sample"===p;return e(Vs,{children:[t(yr,{title:n?void 0:i,summary:o,renderAction:b}),t(Hs,{$faded:!n,children:e(ut,{richTitle:{title:a,subTitle:l},children:[c&&t(ae,{$alignItems:"flex-start",children:t(ve,{options:Us,selected:p,setSelected:v})}),S&&t(Cr,{description:r,options:Sr,selected:h,onSelect:y,customName:s,customLabel:ht,customPlaceholder:"5%",customValue:g,onCustomChange:C})]})})]})},qs=({onClose:n,selectedConnectionIds:o,setSelectedConnectionIds:a,withOverlay:r})=>{const{actionsApi:s}=Gl(),{platformType:c,version:u}=S(),[h,m]=l(""),[g,f]=l(null),b=p(null),{selectedOption:v,onSelectOption:y,genericForm:C,validateFormData:x}=jl(),{options:w,loading:T}=s.useActionTypes(),k=i(()=>w.length?w:mt(c,u),[w,c,u]),I=i(()=>(h?k.filter(e=>e?.label?.toLowerCase().includes(h.toLowerCase())):k).filter(e=>!!e),[k,h]),N=d(e=>{b.current?.clearErrors(),y(e)},[y]),E=(({isLoading:e,options:n,selectedCategory:o,selectedType:a,onSelectOption:l})=>({width:"40%",list:i(()=>{if(e)return[t(le,{$padding:"8px 12px",children:t(re,{size:6})},"loading")];const i=n.reduce((e,t)=>{const n=t.category&&t.category in ls?t.category:as;return(e[n]||=[]).push(t),e},{});return Object.keys(ls).filter(e=>i[e]?.length&&(!o||o===e)).map(e=>t(ss,{bucket:e,options:i[e],selectedType:a,onSelectOption:l},e))},[e,n,o,a,l])}))({isLoading:T,options:I,selectedCategory:g,selectedType:v?.type,onSelectOption:N}),O=i(()=>{const e=new Set(k.map(e=>e.category));return[{value:null,label:"All Actions"},...Object.values(gt).filter(t=>e.has(t)).map(e=>({value:e,label:se[e].TITLE}))]},[k]),$=i(()=>T?[t(le,{$padding:"8px 12px",children:t(re,{size:4})},"loading")]:v?[t(Es,{},v.type)]:[t(ft,{$height:"100%",children:t($e,{icon:Fa,title:"Action not selected",subTitle:"Please select an action to add"})},"no-data")],[T,v]);return t(Er,{ref:b,isOpen:!0,withOverlay:r,onClose:n,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=x();if(e)return!1;await s.create(t)},disableSave:!v||!C?.isFormDirty,isFormDirty:C?.isFormDirty,hideDirtyNote:!0,progress:{title:nt.CREATING_ACTION,subTitle:nt.CREATING_ACTION_SUBTITLE},header:{icon:Fa,title:nt.ADD_ACTION,subTitle:nt.ADD_ACTION_DESCRIPTION},connectionIds:o&&a?{value:o,setValue:a}:void 0,search:{value:h,onChange:m,placeholder:"Search by action name",width:"370px"},filters:e(oe,{$gap:8,children:[t(ee,{size:te.XXS,color:ne.Secondary,nowrap:!0,children:"Show"}),t(ve,{options:O,selected:g,setSelected:f})]}),leftColumn:E,rightColumn:{width:"60%",list:$}})},Zs=({destinationsByCategory:o,filters:a,setFilters:l})=>{const r=i(()=>Object.values(bt).map(e=>({id:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()})).filter(e=>o[e.id]?.length),[o]),s=i(()=>{const e=Object.values(Fe).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(vt,{placeholder:"Select category",options:r,values:a.categoryType?[a.categoryType]:[],setValues:e=>l({...a,categoryType:a.categoryType===e[0]?null:e[0]})}),t(ve,{options:s,selected:a.signalType,setSelected:e=>l({...a,signalType:e})})]})},Qs=b.div`
68
67
  display: flex;
69
68
  flex-direction: column;
70
69
  padding: 8px;
71
70
  border-radius: 16px;
72
71
  border: ${({$purpleColors:e,theme:t})=>e?`1px solid ${t.v2.colors.purple[500]}`:"1px solid transparent"};
73
72
  background-color: ${({$noBgColor:e,$purpleColors:t,theme:n})=>e?"transparent":t?n.v2.colors.purple[900]:n.v2.colors.silver[800]};
74
- `,Ks=b.div`
73
+ `,ec=b.div`
75
74
  display: flex;
76
75
  align-items: center;
77
76
  justify-content: space-between;
78
77
  gap: 12px;
79
78
  padding: ${({$isOpen:e})=>e?"2px 12px 8px 12px":"2px 12px"};
80
- `,Ys=({title:n,tooltip:o,list:i,noBgColor:l,purpleColors:r})=>{const[s,c]=a(!0);return e(Ws,{"data-id":`collapse-${n}`,$noBgColor:l,$purpleColors:r,children:[e(Ks,{$isOpen:s,children:[e(pe,{$gap:10,children:[t(_e,{size:Te.XS,children:n}),o&&t(Fe,{text:o,withIcon:!0}),t(Ke,{label:i.length,status:r?Ee.Default:void 0})]}),t(bt,{icon:s?ja:Ga,size:vt.M,onClick:()=>c(e=>!e)})]}),s?t(ee,{children:i.length?u.toArray(i):t(mt,{$padding:"12px 0",children:t(xe,{})})}):null]})},Js=(e,t,n)=>t||n.signalType?e.filter(e=>e.displayName.toLowerCase().includes(t.toLowerCase())&&(!n.signalType||Re(e.supportedSignals).includes(n.signalType))):e,qs=({option:e,formData:n,testResult:o,isSelected:i,onSelect:a})=>t(Hs,{icon:St(e.type).icon,title:n?.name||e.displayName,withCarret:!0,purpleColors:!!n,isSelected:i,onClick:()=>a(),children:o&&t(Ke,{status:o.succeeded?Ee.Success:Ee.Error,leftIcon:o.succeeded?Wa:Ka})}),Zs=({listType:e,destinationOptions:n,unsavedDestinations:o})=>{const{activeForm:i,onChangeActiveForm:a}=Hl();return n?.length?t(Ys,{title:Ct[e].TITLE,tooltip:Ct[e].DESCRIPTION,list:n.map((n,o)=>t(qs,{option:n,isSelected:i?.listType===e&&"number"!=typeof i?.unsavedIdx&&(null!=n.id&&""!==n.id?i?.option.id===n.id:i?.option.type===n.type),onSelect:()=>a({listType:e,option:n})},`${e}-${n.id??n.type}-${o}`))}):o?.length?t(Ys,{purpleColors:!0,title:Ct[e].TITLE,tooltip:Ct[e].DESCRIPTION,list:o.map(({option:n,formData:o,testResult:l},r)=>t(qs,{option:n,formData:o,testResult:l,isSelected:i?.unsavedIdx===r&&i?.listType===e,onSelect:()=>a({listType:e,option:n,unsavedIdx:r})},`${e}-${r}`))},e):void 0};var Qs;(e=>{e.SELF_HOSTED="self hosted",e.MANAGED="managed"})(Qs||(Qs={}));const ec=(e,t)=>{const n=[],o=[],i=[];return e&&e.destinationCategories.categories.forEach(e=>{e.name===Qs.SELF_HOSTED?o.push(...e.items):e.name===Qs.MANAGED&&i.push(...e.items)}),t&&t?.potentialDestinations.forEach(t=>{for(const o of e?.destinationCategories?.categories||[]){const e=xt(o),i=e.items.findIndex(e=>e.type===t.type);if(-1!==i){const o=wt(t.fields,{});Object.keys(o).length&&(e.items[i].fields=e.items[i].fields.map(e=>({...e,initialValue:o[e.name]})),n.push(e.items[i]))}}}),{[gt.DETECTED]:n,[gt.SELF_HOSTED]:o,[gt.MANAGED]:i}},tc=({onClose:e,onBack:n,onNext:o,selectedConnectionIds:l,setSelectedConnectionIds:r,initialInputs:s,withOverlay:p,disableAnimation:u})=>{const{destinationsApi:h}=Vl(),[m,g]=a(""),[f,b]=a({categoryType:null,signalType:null}),{items:v}=h.useDestinations(),{data:y,loading:C}=h.useDestinationCategories(),{data:S,loading:x}=h.usePotentialDestinations(),{activeForm:w,genericForm:T,unsavedDestinations:k,setUnsavedDestinations:I}=Hl();i(()=>{s&&I(s)},[s]);const N=C||x,E=c(()=>y?.destinationCategories?.categories??[],[y]),[O,$]=a({[gt.ALL]:[],[gt.UNSAVED]:[],[gt.EXISTS]:[],[gt.DETECTED]:[],[gt.SELF_HOSTED]:[],[gt.MANAGED]:[]});i(()=>{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=wt(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})):[]}});$(t=>({...t,[gt.EXISTS]:e}))},[v,E]),i(()=>{(y||S)&&$(e=>({...e,...ec(y,S)}))},[y,S]);const A=d(async()=>{for(const{option:e,formData:t}of k){const n=De(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)}},[k,h]),R=(({isFetching:e,destinationsByCategory:n,searchText:o,filters:i})=>{const{unsavedDestinations:a}=Hl();return{width:"40%",list:c(()=>{const l=[];a.length&&l.push(t(Zs,{listType:gt.UNSAVED,unsavedDestinations:a},"unsaved"));for(const e of Object.values(gt)){if(i.categoryType&&i.categoryType!==e)continue;const a=Js(n[e],o,i);a.length&&l.push(t(Zs,{listType:e,destinationOptions:a},e))}return e&&l.push(t(mt,{$height:"100%",children:t(yt,{title:"Fetching destinations",withSpinner:!0})},"loading-more")),l},[a,n,o,i,e])}})({isFetching:N,destinationsByCategory:O,searchText:m,filters:f}),D=(()=>{const{activeForm:e}=Hl();return{width:"60%",list:e?[t(bs,{},e.option.type)]:[t(mt,{$height:"100%",children:t(xe,{icon:Ha,title:"Select destination from the list",subTitle:"Add destination so your data has somewhere to go."})},"no-data")]}})();return t(kr,{isOpen:!0,withOverlay:p,disableAnimation:u,onClose:e,onBack:n?()=>n(k):void 0,onNext:o?()=>o(k):void 0,nextIsSkip:!k.length,onSave:A,disableSave:!w&&!k.length,isFetching:N,isFormDirty:k.length>0||T?.isFormDirty,hideDirtyNote:!0,progress:{title:Ze.CREATING_DESTINATION,subTitle:Ze.CREATING_DESTINATION_SUBTITLE},header:{icon:Ha,title:Ze.ADD_DESTINATIONS,subTitle:Ze.ADD_DESTINATION_DRAWER_DESCRIPTION},connectionIds:l&&r?{value:l,setValue:r}:void 0,search:{value:m,onChange:g},filters:t(Gs,{destinationsByCategory:O,filters:f,setFilters:b}),leftColumn:R,rightColumn:D})},nc=({onClose:e,selectedConnectionIds:n,setSelectedConnectionIds:o,withOverlay:i})=>{const{isEnterprise:l}=S(),{instrumentationRulesApi:r}=Vl(),[s,d]=a(""),u=p(null),{selectedOption:h,onSelectOption:m,genericForm:g,validateFormData:f}=jl(),{options:b,loading:v}=r.useRuleTypes(),y=c(()=>b.length?b:Tt,[b]),C=c(()=>s?y.filter(e=>e.label.toLowerCase().includes(s.toLowerCase())):y,[y,s]),x=c(()=>v?[t(ut,{$padding:"8px 12px",children:t(ht,{size:4})},"loading")]:C.map(e=>{const n=h?.type===e.type;return t(Hs,{dataId:`option-${e.type}`,title:e.label,description:e.description,withCarret:!0,isSelected:n,onClick:()=>{u.current?.clearErrors(),m(e)}},e.type)}),[v,h?.type,C,m]),w=c(()=>v?[t(ut,{$padding:"8px 12px",children:t(ht,{size:4})},"loading")]:h?[t(ks,{},h.type)]:[t(mt,{$height:"100%",children:t(xe,{icon:Ya,title:"Instrumentation rule not selected",subTitle:"Please select an instrumentation rule to add"})},"no-data")],[v,h]);return t(kr,{ref:u,isOpen:!0,withOverlay:i,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=f();if(e)return!1;await r.create(t,h?.type)},disableSave:!h||!g?.isFormDirty||!l,isFormDirty:g?.isFormDirty,hideDirtyNote:!0,forcedNote:{fullWidth:!0,status:Ee.Warning,message:"This feature is only supported for OnPrem (Enterprise) installations"},progress:{title:Ze.CREATING_INSTRUMENTATION_RULE,subTitle:Ze.CREATING_INSTRUMENTATION_RULE_SUBTITLE},header:{icon:Ya,title:Ze.ADD_INSTRUMENTATION_RULE,subTitle:Ze.ADD_INSTRUMENTATION_RULE_DESCRIPTION},connectionIds:n&&o?{value:n,setValue:o}:void 0,search:{value:s,onChange:d},leftColumn:{width:"40%",list:x},rightColumn:{width:"60%",list:w}})},oc={groupSegmentLabel:"Namespace",itemSegmentLabel:"Source",searchPlaceholder:()=>{},groupColumnHeader:"Namespaces",fetchingGroups:{title:Ze.FETCHING_NAMESPACES,subTitle:Ze.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:Ze.SELECT_NAMESPACE,subTitle:Ze.SELECT_NAMESPACE_SUBTITLE},noItemsInGroupSubTitle:"No sources found in this namespace"},ic={groupSegmentLabel:"Kind",itemSegmentLabel:"Source",searchPlaceholder:e=>"Search by "+(e===kt.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"},ac=e=>e?ic:oc,lc="No matches",rc=e=>(e?"Unselect":"Select")+" all",sc="Selected",cc=b.div``,dc=b.div`
79
+ `,tc=({title:n,tooltip:o,list:i,noBgColor:a,purpleColors:r})=>{const[s,c]=l(!0);return e(Qs,{"data-id":`collapse-${n}`,$noBgColor:a,$purpleColors:r,children:[e(ec,{$isOpen:s,children:[e(oe,{$gap:10,children:[t(ee,{size:te.XS,children:n}),o&&t(Ue,{text:o,withIcon:!0}),t(ce,{label:i.length,status:r?Pe.Default:void 0})]}),t(yt,{icon:s?Ja:qa,size:Ct.M,onClick:()=>c(e=>!e)})]}),s?t(ae,{children:i.length?u.toArray(i):t(ft,{$padding:"12px 0",children:t($e,{})})}):null]})},nc=(e,t,n)=>t||n.signalType?e.filter(e=>e.displayName.toLowerCase().includes(t.toLowerCase())&&(!n.signalType||ze(e.supportedSignals).includes(n.signalType))):e,oc=({option:e,formData:n,testResult:o,isSelected:i,onSelect:a})=>t(is,{icon:wt(e.type).icon,title:n?.name||e.displayName,withCarret:!0,purpleColors:!!n,isSelected:i,onClick:()=>a(),children:o&&t(ce,{status:o.succeeded?Pe.Success:Pe.Error,leftIcon:o.succeeded?Za:Qa})}),ic=({listType:e,destinationOptions:n,unsavedDestinations:o})=>{const{activeForm:i,onChangeActiveForm:a}=Wl();return n?.length?t(tc,{title:xt[e].TITLE,tooltip:xt[e].DESCRIPTION,list:n.map((n,o)=>t(oc,{option:n,isSelected:i?.listType===e&&"number"!=typeof i?.unsavedIdx&&(null!=n.id&&""!==n.id?i?.option.id===n.id:i?.option.type===n.type),onSelect:()=>a({listType:e,option:n})},`${e}-${n.id??n.type}-${o}`))}):o?.length?t(tc,{purpleColors:!0,title:xt[e].TITLE,tooltip:xt[e].DESCRIPTION,list:o.map(({option:n,formData:o,testResult:l},r)=>t(oc,{option:n,formData:o,testResult:l,isSelected:i?.unsavedIdx===r&&i?.listType===e,onSelect:()=>a({listType:e,option:n,unsavedIdx:r})},`${e}-${r}`))},e):void 0};var ac;(e=>{e.SELF_HOSTED="self hosted",e.MANAGED="managed"})(ac||(ac={}));const lc=(e,t)=>{const n=[],o=[],i=[];return e&&e.destinationCategories.categories.forEach(e=>{e.name===ac.SELF_HOSTED?o.push(...e.items):e.name===ac.MANAGED&&i.push(...e.items)}),t&&t?.potentialDestinations.forEach(t=>{for(const o of e?.destinationCategories?.categories||[]){const e=Tt(o),i=e.items.findIndex(e=>e.type===t.type);if(-1!==i){const o=kt(t.fields,{});Object.keys(o).length&&(e.items[i].fields=e.items[i].fields.map(e=>({...e,initialValue:o[e.name]})),n.push(e.items[i]))}}}),{[bt.DETECTED]:n,[bt.SELF_HOSTED]:o,[bt.MANAGED]:i}},rc=({onClose:e,onBack:n,onNext:o,selectedConnectionIds:r,setSelectedConnectionIds:s,initialInputs:c,withOverlay:p,disableAnimation:u})=>{const{destinationsApi:h}=Gl(),[m,g]=l(""),[f,b]=l({categoryType:null,signalType:null}),{items:v}=h.useDestinations(),{data:y,loading:C}=h.useDestinationCategories(),{data:S,loading:x}=h.usePotentialDestinations(),{activeForm:w,genericForm:T,unsavedDestinations:k,setUnsavedDestinations:I}=Wl();a(()=>{c&&I(c)},[c]);const N=C||x,E=i(()=>y?.destinationCategories?.categories??[],[y]),[O,$]=l({[bt.ALL]:[],[bt.UNSAVED]:[],[bt.EXISTS]:[],[bt.DETECTED]:[],[bt.SELF_HOSTED]:[],[bt.MANAGED]:[]});a(()=>{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=kt(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})):[]}});$(t=>({...t,[bt.EXISTS]:e}))},[v,E]),a(()=>{(y||S)&&$(e=>({...e,...lc(y,S)}))},[y,S]);const A=d(async()=>{for(const{option:e,formData:t}of k){const n=Be(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)}},[k,h]),R=(({isFetching:e,destinationsByCategory:n,searchText:o,filters:a})=>{const{unsavedDestinations:l}=Wl();return{width:"40%",list:i(()=>{const i=[];l.length&&i.push(t(ic,{listType:bt.UNSAVED,unsavedDestinations:l},"unsaved"));for(const e of Object.values(bt)){if(a.categoryType&&a.categoryType!==e)continue;const l=nc(n[e],o,a);l.length&&i.push(t(ic,{listType:e,destinationOptions:l},e))}return e&&i.push(t(ft,{$height:"100%",children:t(St,{title:"Fetching destinations",withSpinner:!0})},"loading-more")),i},[l,n,o,a,e])}})({isFetching:N,destinationsByCategory:O,searchText:m,filters:f}),D=(()=>{const{activeForm:e}=Wl();return{width:"60%",list:e?[t($s,{},e.option.type)]:[t(ft,{$height:"100%",children:t($e,{icon:Ya,title:"Select destination from the list",subTitle:"Add destination so your data has somewhere to go."})},"no-data")]}})();return t(Er,{isOpen:!0,withOverlay:p,disableAnimation:u,onClose:e,onBack:n?()=>n(k):void 0,onNext:o?()=>o(k):void 0,nextIsSkip:!k.length,onSave:A,disableSave:!w&&!k.length,isFetching:N,isFormDirty:k.length>0||T?.isFormDirty,hideDirtyNote:!0,progress:{title:nt.CREATING_DESTINATION,subTitle:nt.CREATING_DESTINATION_SUBTITLE},header:{icon:Ya,title:nt.ADD_DESTINATIONS,subTitle:nt.ADD_DESTINATION_DRAWER_DESCRIPTION},connectionIds:r&&s?{value:r,setValue:s}:void 0,search:{value:m,onChange:g},filters:t(Zs,{destinationsByCategory:O,filters:f,setFilters:b}),leftColumn:R,rightColumn:D})},sc=({onClose:e,selectedConnectionIds:n,setSelectedConnectionIds:o,withOverlay:a})=>{const{isEnterprise:r}=S(),{instrumentationRulesApi:s}=Gl(),[c,d]=l(""),u=p(null),{selectedOption:h,onSelectOption:m,genericForm:g,validateFormData:f}=Kl(),{options:b,loading:v}=s.useRuleTypes(),y=i(()=>b.length?b:It,[b]),C=i(()=>c?y.filter(e=>e.label.toLowerCase().includes(c.toLowerCase())):y,[y,c]),x=i(()=>v?[t(le,{$padding:"8px 12px",children:t(re,{size:4})},"loading")]:C.map(e=>{const n=h?.type===e.type;return t(is,{dataId:`option-${e.type}`,title:e.label,description:e.description,withCarret:!0,isSelected:n,onClick:()=>{u.current?.clearErrors(),m(e)}},e.type)}),[v,h?.type,C,m]),w=i(()=>v?[t(le,{$padding:"8px 12px",children:t(re,{size:4})},"loading")]:h?[t(Ms,{},h.type)]:[t(ft,{$height:"100%",children:t($e,{icon:el,title:"Instrumentation rule not selected",subTitle:"Please select an instrumentation rule to add"})},"no-data")],[v,h]);return t(Er,{ref:u,isOpen:!0,withOverlay:a,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=f();if(e)return!1;await s.create(t,h?.type)},disableSave:!h||!g?.isFormDirty||!r,isFormDirty:g?.isFormDirty,hideDirtyNote:!0,forcedNote:{fullWidth:!0,status:Pe.Warning,message:"This feature is only supported for OnPrem (Enterprise) installations"},progress:{title:nt.CREATING_INSTRUMENTATION_RULE,subTitle:nt.CREATING_INSTRUMENTATION_RULE_SUBTITLE},header:{icon:el,title:nt.ADD_INSTRUMENTATION_RULE,subTitle:nt.ADD_INSTRUMENTATION_RULE_DESCRIPTION},connectionIds:n&&o?{value:n,setValue:o}:void 0,search:{value:c,onChange:d},leftColumn:{width:"40%",list:x},rightColumn:{width:"60%",list:w}})},cc={groupSegmentLabel:"Namespace",itemSegmentLabel:"Source",searchPlaceholder:()=>{},groupColumnHeader:"Namespaces",fetchingGroups:{title:nt.FETCHING_NAMESPACES,subTitle:nt.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:nt.SELECT_NAMESPACE,subTitle:nt.SELECT_NAMESPACE_SUBTITLE},noItemsInGroupSubTitle:"No sources found in this namespace"},dc={groupSegmentLabel:"Kind",itemSegmentLabel:"Source",searchPlaceholder:e=>"Search by "+(e===Nt.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"},pc=e=>e?dc:cc,uc="No matches",hc=e=>(e?"Unselect":"Select")+" all",mc="Selected",gc=b.div``,fc=b.div`
81
80
  visibility: hidden;
82
81
 
83
82
  transition: visibility 0s;
@@ -85,17 +84,17 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
85
84
  transition-duration: 0s;
86
85
  }
87
86
 
88
- ${cc}:hover & {
87
+ ${gc}:hover & {
89
88
  visibility: visible;
90
89
  }
91
- `,pc=({workloadName:e,workloadKind:n,isChecked:o,onToggle:i,disabled:a})=>{const l=v(),r=()=>{};return t(cc,{children:t(Hs,{dataId:`source-${e}`,title:e,disabled:a,onClick:a?r:i,isChecked:o,onCheckboxChange:a?r:i,children:a?t(Fe,{text:"Static pods can only be instrumented with Odigos Enterprise.",children:t(Ke,{label:"Enterprise only",status:Ee.Default,textSize:Te.XXXS})}):t(dc,{children:t(Ke,{label:n,status:Ee.Info,textSize:Te.XXXS,backgroundColor:l.v2.colors.blue[900]})})})})},uc=b.div``,hc=b.div`
90
+ `,bc=({workloadName:e,workloadKind:n,isChecked:o,onToggle:i,disabled:a})=>{const l=v(),r=()=>{};return t(gc,{children:t(is,{dataId:`source-${e}`,title:e,disabled:a,onClick:a?r:i,isChecked:o,onCheckboxChange:a?r:i,children:a?t(Ue,{text:"Static pods can only be instrumented with Odigos Enterprise.",children:t(ce,{label:"Enterprise only",status:Pe.Default,textSize:te.XXXS})}):t(fc,{children:t(ce,{label:n,status:Pe.Info,textSize:te.XXXS,backgroundColor:l.v2.colors.blue[900]})})})})},vc=b.div``,yc=b.div`
92
91
  display: grid;
93
92
  /* Auto: "Auto" label + S toggle ≈ 72px. Selected: label + count badge ≈ 110px. */
94
93
  grid-template-columns: ${({$withAuto:e})=>e?"72px 110px":"110px"};
95
94
  align-items: center;
96
95
  column-gap: 12px;
97
96
  flex-shrink: 0;
98
- `,mc=b.div`
97
+ `,Cc=b.div`
99
98
  display: flex;
100
99
  justify-content: flex-end;
101
100
  align-items: center;
@@ -110,17 +109,17 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
110
109
  transition: visibility 0s;
111
110
  ${({$visible:e})=>!e&&"& * {\n transition-duration: 0s !important;\n }"}
112
111
 
113
- ${uc}:hover & {
112
+ ${vc}:hover & {
114
113
  visibility: visible;
115
114
  pointer-events: auto;
116
115
  }
117
- `,gc=b(pe)`
116
+ `,Sc=b(oe)`
118
117
  width: 100%;
119
118
  gap: 8px;
120
119
  justify-content: flex-end;
121
120
  align-items: center;
122
121
  min-width: 0;
123
- `,fc=({clusterId:n,namespaceName:o,checkbox:i,isFutureApps:a,selectedCounts:l,isActive:r,onActive:s,handleSourceChange:c})=>{const{capabilities:d}=Vl(),p=d.canInstrumentNamespaces,u=e=>{s(),c({clusterId:n,workloadId:{namespace:o},auto:e.auto,selected:e.all})};return t(uc,{children:t(Hs,{dataId:`namespace-${o}`,withCarret:!0,title:o,isSelected:r,onClick:s,isPartiallyChecked:i.partial,isChecked:i.all,onCheckboxChange:e=>u({auto:e,all:e}),children:e(hc,{$withAuto:p,children:[p&&t(mc,{$visible:r||a,children:t(Fe,{text:"Automatically instrument all workloads currently in the namespace, and all workloads that will be deployed to this namespace in the future",children:t(le,{label:"Auto",labelAlign:re.Left,size:Nt.S,value:a,onChange:e=>u({auto:e,all:e||void 0})})})}),e(gc,{children:[t(_e,{variant:Et.Span,size:Te.XXXS,color:Pe.Secondary,align:"right",nowrap:!0,children:sc}),t(Ke,{label:`${l.sourced}/${l.total}`,status:r?Ee.Default:Ee.Unknown,minWidth:"42px"})]})]})})})},bc=({withCollapse:e,clusterId:n,clusterName:o,namespaces:i,selectedArea:a,setSelectedArea:l,handleSourceChange:r})=>{const s=c(()=>i.map(({name:e,totalWorkloads:i,selectedCount:s,isAllSourced:c,isSomeSourced:d,isFutureApps:p})=>t(fc,{clusterId:n,namespaceName:e,isFutureApps:p,checkbox:{all:c||p,partial:d},selectedCounts:{sourced:s,total:i},isActive:a.clusterId===n&&a.namespaceName===e,onActive:()=>l({clusterId:n,clusterName:o,namespaceName:e}),handleSourceChange:r},`${n}#${e}`)),[n,o,i,a]);return e?t(Ys,{title:o,list:s,noBgColor:!0}):s},vc=({onClose:n,onBack:o,onNext:l,selectedConnectionIds:r,setSelectedConnectionIds:s,withOverlay:d,disableAnimation:p})=>{const{isVm:u,isConnector:h}=S(),{sourcesApi:m,snapshotsApi:g,namespacesApi:f}=Vl(),{data:b,loading:v,refetch:y}=g.useSnapshots(),{items:C,loading:x,refetch:w}=f.useNamespaces(),T=ac(u||!!h),{selectedStreamName:k}=Qe(),{progress:I,resetProgress:N}=Ot(),{isFetching:E,setIsFetching:O,setSnapshots:$,formData:A,handleSourceChange:R,handleSelectAll:D,formDiff:_,isFormDirty:P}=er();i(()=>{y(),w()},[]);const L=c(()=>{if(b)return b;const e=C;return e.length?{clusters:[{clusterId:At,clusterName:$t,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,region:e.id.region,selected:(e.markedForInstrumentation?.markedForInstrumentation??!1)&&(e.dataStreamNames?.includes(k)??!1)}))||[]}))}]}:null},[b,C,k]);i(()=>{O(v||x),L&&$(L)},[L,v,x,O,$]);const[F,M]=a(""),[z,B]=a(kt.Namespace),[X,U]=a({showOnlySelected:!1}),[V,H]=a({clusterId:"",clusterName:"",namespaceName:""}),j=(({isFetching:n,formData:o,handleSourceChange:i,handleSelectAll:a,selectedArea:l,setSelectedArea:r,searchText:s,searchBy:d,filters:p})=>{const{isVm:u,isConnector:h}=S(),m=ac(u||!!h),g=c(()=>o.map(e=>{const t=[...e.namespaces].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Zl(e,s,p)).map(e=>({name:e.name,totalWorkloads:e.workloads.length,...Ql(e)}));return{clusterId:e.clusterId,clusterName:e.clusterName,visibleNamespaces:t}}),[o,s,p]),f=c(()=>{let e=!1;for(const{visibleNamespaces:t}of g)for(const{totalWorkloads:n,selectedCount:o}of t)if(e=!0,o!==n)return!1;return e},[g]),{list:b,withFilterCount:v,filteredCount:y,totalCount:C}=c(()=>{const e=g.map(({clusterId:e,clusterName:n,visibleNamespaces:o})=>o.length?t(bc,{withCollapse:g.length>1,clusterId:e,clusterName:n,namespaces:o,selectedArea:l,setSelectedArea:r,handleSourceChange:i},e):null).filter(e=>null!==e),n=g.reduce((e,{visibleNamespaces:t})=>e+t.length,0),a=o.reduce((e,{namespaces:t})=>e+t.length,0);return{list:e,withFilterCount:n!==a,filteredCount:n,totalCount:a}},[g,o,l]);return{width:"60%",header:e(pe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(pe,{$gap:8,children:[t(_e,{size:Te.XS,nowrap:!0,children:m.groupColumnHeader}),t(Fe,{text:v?Ze.FILTERED_COUNT_TOOLTIP:void 0,children:t(Ke,{label:`${v?`${y} / ${C}`:C}`,status:Ee.Unknown})})]}),t(_e,{"data-id":"namespaces-select-all",onClick:()=>a({boolean:!f,searchText:s,searchBy:d,filters:p}),disabled:!b.length,size:Te.XS,children:rc(f)})]}),list:b.length?b:n?[t(mt,{$height:"100%",children:t(yt,{title:m.fetchingGroups.title,subTitle:m.fetchingGroups.subTitle,withSpinner:!0})},"loading")]:[t(mt,{$height:"100%",children:t(xe,s?{icon:qa,title:lc,subTitle:m.noGroupMatchedFilter(s)}:{icon:qa,title:m.noGroups.title,subTitle:m.noGroups.subTitle})},"no-data")]}})({isFetching:E,formData:A,handleSourceChange:R,handleSelectAll:D,selectedArea:V,setSelectedArea:H,searchText:z===kt.Namespace?F:"",searchBy:z,filters:X}),G=(({formData:n,handleSourceChange:o,handleSelectAll:i,selectedArea:a,searchText:l,searchBy:r,filters:s})=>{const{tier:d,isVm:p,isConnector:u,isK8s:h}=S(),m=ac(p||!!u),g=d===It.Onprem,f=c(()=>a.value.namespaceName?n.find(({clusterId:e})=>e===a.value.clusterId)?.namespaces.find(({name:e})=>e===a.value.namespaceName):void 0,[n,a.value.clusterId,a.value.namespaceName]),b=c(()=>f?[...f.workloads].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Jl(e,l,s)):[],[f,l,s]),v=c(()=>!!b.length&&b.every(({selected:e})=>e),[b]),y=c(()=>{if(!f)return[];const{clusterId:e}=a.value,{name:n}=f;return b.map(({name:i,selected:a,kind:l,region:r})=>{const s=h&&!g&&ql.has(l);return t(pc,{workloadName:i,workloadKind:l,isChecked:!s&&(a||!1),onToggle:()=>o({clusterId:e,workloadId:{namespace:n,name:i,kind:l,region:r}}),disabled:s},`${e}#${n}#${i}#${l}#${r??""}`)})},[b,f,a.value.clusterId,o,h,g]),{withFilterCount:C,filteredCount:x,totalCount:w}=c(()=>{const e=f?.workloads.length??0;return{withFilterCount:b.length!==e,filteredCount:b.length,totalCount:e}},[b,f]);return{width:"40%",header:e(pe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(pe,{$gap:8,children:[t(_e,{size:Te.XS,nowrap:!0,children:a.value.namespaceName?`${a.value.namespaceName} > ${m.itemColumnHeader}`:m.itemColumnHeader}),t(Fe,{text:C?Ze.FILTERED_COUNT_TOOLTIP:void 0,children:t(Ke,{label:`${C?`${x} / ${w}`:w}`,status:Ee.Unknown})})]}),t(_e,{"data-id":"workloads-select-all",onClick:()=>i({clusterId:a.value.clusterId,namespaceName:a.value.namespaceName,boolean:!v,searchText:l,searchBy:r,filters:s}),disabled:!y.length,size:Te.XS,children:rc(v)})]}),list:y.length?y:[t(mt,{$height:"100%",children:t(xe,f?l?{icon:Ja,title:lc,subTitle:(T=l,`No sources matched the filter '${T}'`)}:{icon:Ja,title:"No sources",subTitle:m.noItemsInGroupSubTitle}:{icon:Ja,title:m.selectGroupPrompt.title,subTitle:m.selectGroupPrompt.subTitle})},"no-data")]};var T})({formData:A,handleSourceChange:R,handleSelectAll:D,selectedArea:{value:V},searchText:z===kt.Source?F:"",searchBy:z,filters:X});return t(kr,{isOpen:!0,withOverlay:d,disableAnimation:p,onClose:n?()=>{N(Rt.BulkInstrumenting),n()}:void 0,onBack:o?()=>o(_):void 0,onNext:l?()=>l(_):void 0,nextIsSkip:!P,onSave:()=>m.persistV2(_),header:{icon:Ja,title:Ze.ADD_SOURCE,subTitle:Ze.ADD_SOURCES_DESCRIPTION},connectionIds:r&&s?{value:r,setValue:s}:void 0,search:{value:F,onChange:e=>{M(e),z===kt.Namespace&&H({clusterId:"",clusterName:"",namespaceName:""})},placeholder:T.searchPlaceholder(z),segment:{options:[{label:T.groupSegmentLabel,value:kt.Namespace},{label:T.itemSegmentLabel,value:kt.Source}],selected:z,setSelected:B}},filters:e(pe,{$gap:8,children:[t(_e,{size:Te.XXXS,color:Pe.Secondary,nowrap:!0,children:"Show only:"}),t(le,{name:"filter-selected",size:Nt.S,label:sc,value:X.showOnlySelected,onChange:e=>U(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:P,isFetching:E,progress:{title:Ze.CREATING_SOURCES,subTitle:Ze.CREATING_SOURCES_SUBTITLE,percentage:I[Rt.BulkInstrumenting]?.percentage||0},leftColumn:j,rightColumn:G})},yc={aws:el,gcp:Qa,azure:Za},Cc={lambda:"Lambda","fargate-task":"ECS","fargate-cluster":"ECS","ecs-cluster":"ECS",eks:"EKS",ec2:"EC2"},Sc=e=>e.split(/[-_]/).map(e=>e?e[0].toUpperCase()+e.slice(1):e).join(" "),xc=e=>e.provider.toUpperCase(),wc=b.div`
122
+ `,xc=({clusterId:n,namespaceName:o,checkbox:i,isFutureApps:a,selectedCounts:l,isActive:r,onActive:s,handleSourceChange:c})=>{const{capabilities:d}=Gl(),p=d.canInstrumentNamespaces,u=e=>{s(),c({clusterId:n,workloadId:{namespace:o},auto:e.auto,selected:e.all})};return t(vc,{children:t(is,{dataId:`namespace-${o}`,withCarret:!0,title:o,isSelected:r,onClick:s,isPartiallyChecked:i.partial,isChecked:i.all,onCheckboxChange:e=>u({auto:e,all:e}),children:e(yc,{$withAuto:p,children:[p&&t(Cc,{$visible:r||a,children:t(Ue,{text:"Automatically instrument all workloads currently in the namespace, and all workloads that will be deployed to this namespace in the future",children:t(ge,{label:"Auto",labelAlign:fe.Left,size:Et.S,value:a,onChange:e=>u({auto:e,all:e||void 0})})})}),e(Sc,{children:[t(ee,{variant:Ot.Span,size:te.XXXS,color:ne.Secondary,align:"right",nowrap:!0,children:mc}),t(ce,{label:`${l.sourced}/${l.total}`,status:r?Pe.Default:Pe.Unknown,minWidth:"42px"})]})]})})})},wc=({withCollapse:e,clusterId:n,clusterName:o,namespaces:a,selectedArea:l,setSelectedArea:r,handleSourceChange:s})=>{const c=i(()=>a.map(({name:e,totalWorkloads:i,selectedCount:a,isAllSourced:c,isSomeSourced:d,isFutureApps:p})=>t(xc,{clusterId:n,namespaceName:e,isFutureApps:p,checkbox:{all:c||p,partial:d},selectedCounts:{sourced:a,total:i},isActive:l.clusterId===n&&l.namespaceName===e,onActive:()=>r({clusterId:n,clusterName:o,namespaceName:e}),handleSourceChange:s},`${n}#${e}`)),[n,o,a,l]);return e?t(tc,{title:o,list:c,noBgColor:!0}):c},Tc=({onClose:n,onBack:o,onNext:r,selectedConnectionIds:s,setSelectedConnectionIds:c,withOverlay:d,disableAnimation:p})=>{const{isK8s:u}=S(),{sourcesApi:h,snapshotsApi:m,namespacesApi:g}=Gl(),{data:f,loading:b,refetch:v}=m.useSnapshots(),{items:y,loading:C,refetch:x}=g.useNamespaces(),w=pc(!u),{selectedStreamName:T}=ot(),{progress:k,resetProgress:I}=$t(),{isFetching:N,setIsFetching:E,setSnapshots:O,formData:$,handleSourceChange:A,handleSelectAll:R,formDiff:D,isFormDirty:_}=or();a(()=>{v(),x()},[]);const P=i(()=>{if(f)return f;const e=y;return e.length?{clusters:[{clusterId:Rt,clusterName:At,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,region:e.id.region,selected:(e.markedForInstrumentation?.markedForInstrumentation??!1)&&(e.dataStreamNames?.includes(T)??!1)}))||[]}))}]}:null},[f,y,T]);a(()=>{E(b||C),P&&O(P)},[P,b,C,E,O]);const[L,F]=l(""),[M,z]=l(Nt.Namespace),[B,X]=l({showOnlySelected:!1}),[U,V]=l({clusterId:"",clusterName:"",namespaceName:""}),H=(({isFetching:n,formData:o,handleSourceChange:a,handleSelectAll:l,selectedArea:r,setSelectedArea:s,searchText:c,searchBy:d,filters:p})=>{const{isK8s:u}=S(),h=pc(!u),m=i(()=>o.map(e=>{const t=[...e.namespaces].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>tr(e,c,p)).map(e=>({name:e.name,totalWorkloads:e.workloads.length,...nr(e)}));return{clusterId:e.clusterId,clusterName:e.clusterName,visibleNamespaces:t}}),[o,c,p]),g=i(()=>{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:y}=i(()=>{const e=m.map(({clusterId:e,clusterName:n,visibleNamespaces:o})=>o.length?t(wc,{withCollapse:m.length>1,clusterId:e,clusterName:n,namespaces:o,selectedArea:r,setSelectedArea:s,handleSourceChange:a},e):null).filter(e=>null!==e),n=m.reduce((e,{visibleNamespaces:t})=>e+t.length,0),i=o.reduce((e,{namespaces:t})=>e+t.length,0);return{list:e,withFilterCount:n!==i,filteredCount:n,totalCount:i}},[m,o,r]);return{width:"60%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(ee,{size:te.XS,nowrap:!0,children:h.groupColumnHeader}),t(Ue,{text:b?nt.FILTERED_COUNT_TOOLTIP:void 0,children:t(ce,{label:`${b?`${v} / ${y}`:y}`,status:Pe.Unknown})})]}),t(ee,{"data-id":"namespaces-select-all",onClick:()=>l({boolean:!g,searchText:c,searchBy:d,filters:p}),disabled:!f.length,size:te.XS,children:hc(g)})]}),list:f.length?f:n?[t(ft,{$height:"100%",children:t(St,{title:h.fetchingGroups.title,subTitle:h.fetchingGroups.subTitle,withSpinner:!0})},"loading")]:[t(ft,{$height:"100%",children:t($e,c?{icon:nl,title:uc,subTitle:h.noGroupMatchedFilter(c)}:{icon:nl,title:h.noGroups.title,subTitle:h.noGroups.subTitle})},"no-data")]}})({isFetching:N,formData:$,handleSourceChange:A,handleSelectAll:R,selectedArea:U,setSelectedArea:V,searchText:M===Nt.Namespace?L:"",searchBy:M,filters:B}),j=(({formData:n,handleSourceChange:o,handleSelectAll:a,selectedArea:l,searchText:r,searchBy:s,filters:c})=>{const{isK8s:d,isEnterprise:p}=S(),u=pc(!d),h=i(()=>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]),m=i(()=>h?[...h.workloads].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Ql(e,r,c)):[],[h,r,c]),g=i(()=>!!m.length&&m.every(({selected:e})=>e),[m]),f=i(()=>{if(!h)return[];const{clusterId:e}=l.value,{name:n}=h;return m.map(({name:i,selected:a,kind:l,region:r})=>{const s=d&&!p&&er.has(l);return t(bc,{workloadName:i,workloadKind:l,isChecked:!s&&(a||!1),onToggle:()=>o({clusterId:e,workloadId:{namespace:n,name:i,kind:l,region:r}}),disabled:s},`${e}#${n}#${i}#${l}#${r??""}`)})},[m,h,l.value.clusterId,o,d,p]),{withFilterCount:b,filteredCount:v,totalCount:y}=i(()=>{const e=h?.workloads.length??0;return{withFilterCount:m.length!==e,filteredCount:m.length,totalCount:e}},[m,h]);return{width:"40%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(ee,{size:te.XS,nowrap:!0,children:l.value.namespaceName?`${l.value.namespaceName} > ${u.itemColumnHeader}`:u.itemColumnHeader}),t(Ue,{text:b?nt.FILTERED_COUNT_TOOLTIP:void 0,children:t(ce,{label:`${b?`${v} / ${y}`:y}`,status:Pe.Unknown})})]}),t(ee,{"data-id":"workloads-select-all",onClick:()=>a({clusterId:l.value.clusterId,namespaceName:l.value.namespaceName,boolean:!g,searchText:r,searchBy:s,filters:c}),disabled:!f.length,size:te.XS,children:hc(g)})]}),list:f.length?f:[t(ft,{$height:"100%",children:t($e,h?r?{icon:tl,title:uc,subTitle:(C=r,`No sources matched the filter '${C}'`)}:{icon:tl,title:"No sources",subTitle:u.noItemsInGroupSubTitle}:{icon:tl,title:u.selectGroupPrompt.title,subTitle:u.selectGroupPrompt.subTitle})},"no-data")]};var C})({formData:$,handleSourceChange:A,handleSelectAll:R,selectedArea:{value:U},searchText:M===Nt.Source?L:"",searchBy:M,filters:B});return t(Er,{isOpen:!0,withOverlay:d,disableAnimation:p,onClose:n?()=>{I(Dt.BulkInstrumenting),n()}:void 0,onBack:o?()=>o(D):void 0,onNext:r?()=>r(D):void 0,nextIsSkip:!_,onSave:()=>h.persistV2(D),header:{icon:tl,title:nt.ADD_SOURCE,subTitle:nt.ADD_SOURCES_DESCRIPTION},connectionIds:s&&c?{value:s,setValue:c}:void 0,search:{value:L,onChange:e=>{F(e),M===Nt.Namespace&&V({clusterId:"",clusterName:"",namespaceName:""})},placeholder:w.searchPlaceholder(M),segment:{options:[{label:w.groupSegmentLabel,value:Nt.Namespace},{label:w.itemSegmentLabel,value:Nt.Source}],selected:M,setSelected:z}},filters:e(oe,{$gap:8,children:[t(ee,{size:te.XXXS,color:ne.Secondary,nowrap:!0,children:"Show only:"}),t(ge,{name:"filter-selected",size:Et.S,label:mc,value:B.showOnlySelected,onChange:e=>X(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:_,isFetching:N,progress:{title:nt.CREATING_SOURCES,subTitle:nt.CREATING_SOURCES_SUBTITLE,percentage:k[Dt.BulkInstrumenting]?.percentage||0},leftColumn:H,rightColumn:j})},kc={aws:al,gcp:il,azure:ol},Ic={lambda:"Lambda","fargate-task":"ECS","fargate-cluster":"ECS","ecs-cluster":"ECS",eks:"EKS",ec2:"EC2"},Nc=e=>e.split(/[-_]/).map(e=>e?e[0].toUpperCase()+e.slice(1):e).join(" "),Ec=e=>e.provider.toUpperCase(),Oc=b.div`
124
123
  display: flex;
125
124
  flex-direction: column;
126
125
  gap: 8px;
@@ -128,7 +127,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
128
127
  padding: 8px 12px;
129
128
  border-radius: 16px 0 0 16px;
130
129
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
131
- `,Tc=b.button`
130
+ `,$c=b.button`
132
131
  display: flex;
133
132
  align-items: center;
134
133
  gap: 12px;
@@ -144,7 +143,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
144
143
  &:hover {
145
144
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
146
145
  }
147
- `,kc=b.div`
146
+ `,Ac=b.div`
148
147
  display: flex;
149
148
  align-items: center;
150
149
  justify-content: center;
@@ -153,13 +152,13 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
153
152
  border-radius: 8px;
154
153
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
155
154
  flex-shrink: 0;
156
- `,Ic=b.div`
155
+ `,Rc=b.div`
157
156
  display: flex;
158
157
  flex-direction: column;
159
158
  gap: 2px;
160
159
  flex: 1;
161
160
  min-width: 0;
162
- `,Nc=({providers:n,selectedProvider:o,onSelect:i})=>{const a=v();return n.length?t(wc,{children:n.map(n=>{const l=(e=>yc[e.provider]??tl)(n),r=n.provider===o,s=(e=>{const t=e.features.find(e=>e.key===Dt.Discovery);if(!t)return"";const n=[],o=new Set;for(const e of t.types){const t=e.name.includes(".")?e.name.slice(e.name.indexOf(".")+1):e.name,i=Cc[t]??Sc(t);o.has(i)||(o.add(i),n.push(i))}return n.join(", ")})(n);return e(Tc,{type:"button",$selected:r,onClick:()=>i(n.provider),"data-id":`cloud-connector-provider-${n.provider}`,children:[t(kc,{children:t(l,{size:24})}),e(Ic,{children:[t(_e,{size:Te.S,weight:400,lineHeight:"24px",color:Pe.Primary,children:xc(n)}),s&&t(_e,{size:Te.XXXS,weight:400,lineHeight:"normal",color:Pe.Secondary,children:s})]}),t(Ua,{size:18,fill:a.v2.colors.silver[300]})]},n.provider)})}):t(_e,{size:Te.XS,color:Pe.Secondary,children:"No providers available."})},Ec=b.div`
161
+ `,Dc=({providers:n,selectedProvider:o,onSelect:i})=>{const a=v();return n.length?t(Oc,{children:n.map(n=>{const l=(e=>kc[e.provider]??ll)(n),r=n.provider===o,s=(e=>{const t=e.features.find(e=>e.key===_t.Discovery);if(!t)return"";const n=[],o=new Set;for(const e of t.types){const t=e.name.includes(".")?e.name.slice(e.name.indexOf(".")+1):e.name,i=Ic[t]??Nc(t);o.has(i)||(o.add(i),n.push(i))}return n.join(", ")})(n);return e($c,{type:"button",$selected:r,onClick:()=>i(n.provider),"data-id":`cloud-connector-provider-${n.provider}`,children:[t(Ac,{children:t(l,{size:24})}),e(Rc,{children:[t(ee,{size:te.S,weight:400,lineHeight:"24px",color:ne.Primary,children:Ec(n)}),s&&t(ee,{size:te.XXXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:s})]}),t(La,{size:18,fill:a.v2.colors.silver[300]})]},n.provider)})}):t(ee,{size:te.XS,color:ne.Secondary,children:"No providers available."})},_c=b.div`
163
162
  display: flex;
164
163
  flex-direction: column;
165
164
  gap: 8px;
@@ -169,15 +168,15 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
169
168
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
170
169
  border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
171
170
  cursor: default;
172
- `,Oc=b.div`
171
+ `,Pc=b.div`
173
172
  display: flex;
174
173
  align-items: center;
175
174
  gap: 4px;
176
175
  width: 100%;
177
- `,$c=b.div`
176
+ `,Lc=b.div`
178
177
  flex: 1;
179
178
  min-width: 0;
180
- `,Ac=b.div`
179
+ `,Fc=b.div`
181
180
  width: 100%;
182
181
  max-height: 145px;
183
182
  overflow: auto;
@@ -199,39 +198,39 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
199
198
  transition: background-color 0.2s ease;
200
199
  }
201
200
 
202
- ${Ec}:hover & {
201
+ ${_c}:hover & {
203
202
  scrollbar-color: ${({theme:e})=>e.v2.colors.silver[300]} transparent;
204
203
  }
205
204
 
206
- ${Ec}:hover &::-webkit-scrollbar-thumb {
205
+ ${_c}:hover &::-webkit-scrollbar-thumb {
207
206
  background-color: ${({theme:e})=>e.v2.colors.silver[300]};
208
207
  }
209
- `,Rc=b.pre`
208
+ `,Mc=b.pre`
210
209
  margin: 0;
211
210
  font-family: ${({theme:e})=>e.font_family.code};
212
211
  font-size: 12px;
213
212
  line-height: 20px;
214
213
  color: ${({theme:e})=>e.v2.colors.green[400]};
215
214
  white-space: pre;
216
- `,Dc=({policy:n})=>{const o=v(),{CopyButton:i}=_t();return e(Ec,{children:[e(Oc,{children:[t(nl,{size:16,fill:o.v2.colors.silver[200]}),t($c,{children:t(_e,{size:Te.XXS,color:Pe.Primary,children:Ze.CLOUD_CONNECTOR_POLICY_PREVIEW})}),t(i,{value:n,size:vt.XS})]}),t(Ac,{children:t(Rc,{children:n})})]})};var _c;(e=>{e.DiscoveryOnly="discovery-only",e.DiscoveryInstrumentation="discovery-instrumentation",e.Custom="custom"})(_c||(_c={}));const Pc=[{id:_c.DiscoveryOnly,title:Ze.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_ONLY_TITLE,description:Ze.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_ONLY_DESC,featureKeys:[Dt.Discovery]},{id:_c.DiscoveryInstrumentation,title:Ze.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_INSTRUMENTATION_TITLE,description:Ze.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_INSTRUMENTATION_DESC,featureKeys:[Dt.Discovery,Dt.Instrumentation]},{id:_c.Custom,title:Ze.CLOUD_CONNECTOR_PERMISSION_CUSTOM_TITLE,description:Ze.CLOUD_CONNECTOR_PERMISSION_CUSTOM_DESC,featureKeys:[]}],Lc=(e,t)=>e.features?.find(e=>e.key===t),Fc=e=>{if(!e)return[];const t=Lc(e,Dt.Discovery),n=Lc(e,Dt.Instrumentation);return t?t.types.map(e=>{const t=n?.types.find(t=>t.name===e.name);return{typeName:e.name,displayName:e.displayName||e.name,discoveryPermissions:e.permissions??[],instrumentationPermissions:t?t.permissions??[]:void 0}}):[]},Mc=()=>{const e=new Set,t=[];return{out:t,add:n=>n?.forEach(n=>{n&&!e.has(n)&&(e.add(n),t.push(n))})}},zc=(e,t,n)=>{const o=t===_c.Custom?((e,t)=>{if(!e)return[];const n=Fc(e),o=Lc(e,Dt.Discovery),i=n.some(e=>t[e.typeName]?.discovery),{out:a,add:l}=Mc();return l(e.auth?.permissions),i&&l(o?.permissions),n.forEach(e=>{const n=t[e.typeName];n?.discovery&&l(e.discoveryPermissions),n?.instrumentation&&l(e.instrumentationPermissions)}),a})(e,n??{}):((e,t)=>{if(!e)return[];const n=Pc.find(e=>e.id===t)?.featureKeys??[],{out:o,add:i}=Mc();return i(e.auth?.permissions),e.features?.forEach(e=>{e.enabled&&n.includes(e.key)&&(i(e.permissions),e.types?.forEach(e=>{!1!==e.implemented&&i(e.permissions)}))}),o})(e,t),i={Version:"2012-10-17",Statement:[{Sid:"OdigosCloudConnector",Effect:"Allow",Action:o,Resource:"*"}]};return JSON.stringify(i,null,2)},Bc=b.div`
215
+ `,zc=({policy:n})=>{const o=v(),{CopyButton:i}=Pt();return e(_c,{children:[e(Pc,{children:[t(rl,{size:16,fill:o.v2.colors.silver[200]}),t(Lc,{children:t(ee,{size:te.XXS,color:ne.Primary,children:nt.CLOUD_CONNECTOR_POLICY_PREVIEW})}),t(i,{value:n,size:Ct.XS})]}),t(Fc,{children:t(Mc,{children:n})})]})};var Bc;(e=>{e.DiscoveryOnly="discovery-only",e.DiscoveryInstrumentation="discovery-instrumentation",e.Custom="custom"})(Bc||(Bc={}));const Xc=[{id:Bc.DiscoveryOnly,title:nt.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_ONLY_TITLE,description:nt.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_ONLY_DESC,featureKeys:[_t.Discovery]},{id:Bc.DiscoveryInstrumentation,title:nt.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_INSTRUMENTATION_TITLE,description:nt.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_INSTRUMENTATION_DESC,featureKeys:[_t.Discovery,_t.Instrumentation]},{id:Bc.Custom,title:nt.CLOUD_CONNECTOR_PERMISSION_CUSTOM_TITLE,description:nt.CLOUD_CONNECTOR_PERMISSION_CUSTOM_DESC,featureKeys:[]}],Uc=(e,t)=>e.features?.find(e=>e.key===t),Vc=e=>{if(!e)return[];const t=Uc(e,_t.Discovery),n=Uc(e,_t.Instrumentation);return t?t.types.map(e=>{const t=n?.types.find(t=>t.name===e.name);return{typeName:e.name,displayName:e.displayName||e.name,discoveryPermissions:e.permissions??[],instrumentationPermissions:t?t.permissions??[]:void 0}}):[]},Hc=()=>{const e=new Set,t=[];return{out:t,add:n=>n?.forEach(n=>{n&&!e.has(n)&&(e.add(n),t.push(n))})}},jc=(e,t,n)=>{const o=t===Bc.Custom?((e,t)=>{if(!e)return[];const n=Vc(e),o=Uc(e,_t.Discovery),i=n.some(e=>t[e.typeName]?.discovery),{out:a,add:l}=Hc();return l(e.auth?.permissions),i&&l(o?.permissions),n.forEach(e=>{const n=t[e.typeName];n?.discovery&&l(e.discoveryPermissions),n?.instrumentation&&l(e.instrumentationPermissions)}),a})(e,n??{}):((e,t)=>{if(!e)return[];const n=Xc.find(e=>e.id===t)?.featureKeys??[],{out:o,add:i}=Hc();return i(e.auth?.permissions),e.features?.forEach(e=>{e.enabled&&n.includes(e.key)&&(i(e.permissions),e.types?.forEach(e=>{!1!==e.implemented&&i(e.permissions)}))}),o})(e,t),i={Version:"2012-10-17",Statement:[{Sid:"OdigosCloudConnector",Effect:"Allow",Action:o,Resource:"*"}]};return JSON.stringify(i,null,2)},Gc=b.div`
217
216
  width: 100%;
218
217
  padding: 12px 16px;
219
218
  border-radius: 12px;
220
219
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
221
220
  border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
222
- `,Xc=b.div`
221
+ `,Wc=b.div`
223
222
  display: grid;
224
223
  grid-template-columns: minmax(0, 1fr) 120px 150px;
225
224
  align-items: center;
226
225
  row-gap: 16px;
227
226
  column-gap: 8px;
228
- `,Uc=b.div`
227
+ `,Kc=b.div`
229
228
  display: flex;
230
229
  align-items: center;
231
230
  min-width: 0;
232
- `,Vc=b(Uc)`
231
+ `,Yc=b(Kc)`
233
232
  justify-content: center;
234
- `,Hc={discovery:!1,instrumentation:!1},jc=({provider:n,capabilities:i,onCapabilitiesChange:a})=>{const l=Fc(n),r=(e,t)=>{a({...i,[e]:t})};return l.length?t(Bc,{children:e(Xc,{children:[t(Uc,{children:t(_e,{size:Te.XXS,color:Pe.Secondary,children:Ze.CLOUD_CONNECTOR_CUSTOM_COL_TYPE})}),t(Vc,{children:t(_e,{size:Te.XXS,color:Pe.Secondary,children:Ze.CLOUD_CONNECTOR_CUSTOM_COL_DISCOVERY})}),t(Vc,{children:t(_e,{size:Te.XXS,color:Pe.Secondary,children:Ze.CLOUD_CONNECTOR_CUSTOM_COL_INSTRUMENTATION})}),l.map(n=>{const a=i[n.typeName]??Hc,l=void 0!==n.instrumentationPermissions,s=a.instrumentation||a.discovery;return e(o.Fragment,{children:[t(Uc,{children:t(_e,{size:Te.XXS,weight:400,lineHeight:"normal",color:Pe.Primary,children:n.displayName})}),t(Vc,{children:t(le,{name:`cloud-connector-custom-${n.typeName}-discovery`,size:Nt.S,value:s,disabled:a.instrumentation,onChange:e=>r(n.typeName,{discovery:e,instrumentation:a.instrumentation})})}),t(Vc,{children:t(le,{name:`cloud-connector-custom-${n.typeName}-instrumentation`,size:Nt.S,value:a.instrumentation,disabled:!l,onChange:e=>r(n.typeName,{discovery:!!e||a.discovery,instrumentation:e})})})]},n.typeName)})]})}):null},Gc=b.div`
233
+ `,Jc={discovery:!1,instrumentation:!1},qc=({provider:n,capabilities:i,onCapabilitiesChange:a})=>{const l=Vc(n),r=(e,t)=>{a({...i,[e]:t})};return l.length?t(Gc,{children:e(Wc,{children:[t(Kc,{children:t(ee,{size:te.XXS,color:ne.Secondary,children:nt.CLOUD_CONNECTOR_CUSTOM_COL_TYPE})}),t(Yc,{children:t(ee,{size:te.XXS,color:ne.Secondary,children:nt.CLOUD_CONNECTOR_CUSTOM_COL_DISCOVERY})}),t(Yc,{children:t(ee,{size:te.XXS,color:ne.Secondary,children:nt.CLOUD_CONNECTOR_CUSTOM_COL_INSTRUMENTATION})}),l.map(n=>{const a=i[n.typeName]??Jc,l=void 0!==n.instrumentationPermissions,s=a.instrumentation||a.discovery;return e(o.Fragment,{children:[t(Kc,{children:t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ne.Primary,children:n.displayName})}),t(Yc,{children:t(ge,{name:`cloud-connector-custom-${n.typeName}-discovery`,size:Et.S,value:s,disabled:a.instrumentation,onChange:e=>r(n.typeName,{discovery:e,instrumentation:a.instrumentation})})}),t(Yc,{children:t(ge,{name:`cloud-connector-custom-${n.typeName}-instrumentation`,size:Et.S,value:a.instrumentation,disabled:!l,onChange:e=>r(n.typeName,{discovery:!!e||a.discovery,instrumentation:e})})})]},n.typeName)})]})}):null},Zc=b.div`
235
234
  display: flex;
236
235
  flex-direction: column;
237
236
  gap: 8px;
@@ -240,12 +239,12 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
240
239
  padding: 8px;
241
240
  border-radius: 0 16px 16px 0;
242
241
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
243
- `,Wc=b.div`
242
+ `,Qc=b.div`
244
243
  display: flex;
245
244
  flex-direction: column;
246
245
  gap: 8px;
247
246
  width: 100%;
248
- `,Kc=b.div`
247
+ `,ed=b.div`
249
248
  display: flex;
250
249
  align-items: center;
251
250
  gap: 10px;
@@ -253,7 +252,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
253
252
  padding: 4px 12px 4px 4px;
254
253
  border-radius: 8px;
255
254
  background-color: ${({theme:e})=>e.v2.colors.purple[900]};
256
- `,Yc=b.div`
255
+ `,td=b.div`
257
256
  display: flex;
258
257
  align-items: center;
259
258
  justify-content: center;
@@ -262,30 +261,30 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
262
261
  border-radius: 6px;
263
262
  flex-shrink: 0;
264
263
  background-color: ${({theme:e})=>e.v2.colors.purple[800]};
265
- `,Jc=({message:n})=>{const o=v();return e(Kc,{children:[t(Yc,{children:t(ol,{size:24})}),t(_e,{size:Te.XXS,color:o.v2.colors.purple[300],children:n})]})},qc=({provider:n,selectedPermission:o,onSelect:i,capabilities:a,onCapabilitiesChange:l})=>t(Gc,{children:Pc.map(r=>{const s=r.id===o,c=r.id===_c.Custom,d=s?e(Wc,{children:[c&&t(jc,{provider:n,capabilities:a,onCapabilitiesChange:l}),t(Dc,{policy:zc(n,r.id,a)})]}):void 0,p=s?t(Jc,{message:c?Ze.CLOUD_CONNECTOR_POLICY_NOTE_CUSTOM:Ze.CLOUD_CONNECTOR_POLICY_NOTE}):void 0;return t(Pt,{"data-id":`cloud-connector-permission-${r.id}`,title:r.title,description:r.description,checked:s,onChange:()=>i(r.id),body:d,footerNote:p},r.id)})}),Zc=b.div`
264
+ `,nd=({message:n})=>{const o=v();return e(ed,{children:[t(td,{children:t(sl,{fill:"#B08BFD",size:24})}),t(ee,{size:te.XXS,color:o.v2.colors.purple[300],children:n})]})},od=({provider:n,selectedPermission:o,onSelect:i,capabilities:a,onCapabilitiesChange:l})=>t(Zc,{children:Xc.map(r=>{const s=r.id===o,c=r.id===Bc.Custom,d=s?e(Qc,{children:[c&&t(qc,{provider:n,capabilities:a,onCapabilitiesChange:l}),t(zc,{policy:jc(n,r.id,a)})]}):void 0,p=s?t(nd,{message:c?nt.CLOUD_CONNECTOR_POLICY_NOTE_CUSTOM:nt.CLOUD_CONNECTOR_POLICY_NOTE}):void 0;return t(Lt,{"data-id":`cloud-connector-permission-${r.id}`,title:r.title,description:r.description,checked:s,onChange:()=>i(r.id),body:d,footerNote:p},r.id)})}),id=b.div`
266
265
  display: flex;
267
266
  flex-direction: column;
268
267
  padding: 16px;
269
- `,Qc=b.div`
268
+ `,ad=b.div`
270
269
  display: flex;
271
270
  flex-direction: column;
272
271
  gap: 16px;
273
272
  padding: 16px;
274
273
  border-radius: 16px;
275
274
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
276
- `,ed=b.div`
275
+ `,ld=b.div`
277
276
  display: flex;
278
277
  flex-direction: column;
279
278
  gap: 4px;
280
- `,td=b.div`
279
+ `,rd=b.div`
281
280
  display: flex;
282
281
  align-items: stretch;
283
282
  width: 100%;
284
- `,nd=b.div`
283
+ `,sd=b.div`
285
284
  display: flex;
286
285
  flex: 0 0 40%;
287
286
  min-width: 0;
288
- `,od=()=>{const{providers:n,genericForm:o}=tr(),[l,r]=a(!0),s=c(()=>n.find(e=>e.provider===o.formData.provider),[n,o.formData.provider]);return i(()=>{!o.formData.provider&&n.length>0&&o.handleFormChange("provider",n[0].provider)},[n,o.formData.provider,o]),i(()=>{o.formData.permission||o.handleFormChange("permission",_c.DiscoveryInstrumentation)},[o.formData.permission,o]),t(Zc,{children:e(Qc,{children:[e(ed,{children:[t(_e,{size:Te.S,weight:500,lineHeight:"24px",color:Pe.Primary,children:Ze.CLOUD_CONNECTOR_SELECT_PROVIDER_TITLE}),t(_e,{size:Te.XXS,weight:400,lineHeight:"normal",color:Pe.Secondary,children:Ze.CLOUD_CONNECTOR_SELECT_PROVIDER_SUBTITLE})]}),l&&t(Ne,{fullWidth:!0,smallIcon:!0,status:Ee.Info,message:Ze.CLOUD_CONNECTOR_PERMISSIONS_NOTE,action:{"data-id":"cloud-connector-permissions-note-close",label:Lt.CLOSE,onClick:()=>r(!1)}}),e(td,{children:[t(nd,{children:t(Nc,{providers:n,selectedProvider:o.formData.provider,onSelect:e=>o.handleFormChange("provider",e)})}),t(qc,{provider:s,selectedPermission:o.formData.permission,onSelect:e=>o.handleFormChange("permission",e),capabilities:o.formData.customCapabilities,onCapabilitiesChange:e=>o.handleFormChange("customCapabilities",e)})]})]})})},id=b.div`
287
+ `,cd=()=>{const{providers:n,genericForm:o}=ir(),[r,s]=l(!0),c=i(()=>n.find(e=>e.provider===o.formData.provider),[n,o.formData.provider]);return a(()=>{!o.formData.provider&&n.length>0&&o.handleFormChange("provider",n[0].provider)},[n,o.formData.provider,o]),a(()=>{o.formData.permission||o.handleFormChange("permission",Bc.DiscoveryInstrumentation)},[o.formData.permission,o]),t(id,{children:e(ad,{children:[e(ld,{children:[t(ee,{size:te.S,weight:500,lineHeight:"24px",color:ne.Primary,children:nt.CLOUD_CONNECTOR_SELECT_PROVIDER_TITLE}),t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:nt.CLOUD_CONNECTOR_SELECT_PROVIDER_SUBTITLE})]}),r&&t(_e,{fullWidth:!0,maxWidth:"800px",smallIcon:!0,status:Pe.Info,message:nt.CLOUD_CONNECTOR_PERMISSIONS_NOTE,action:{"data-id":"cloud-connector-permissions-note-close",label:Ft.CLOSE,onClick:()=>s(!1)}}),e(rd,{children:[t(sd,{children:t(Dc,{providers:n,selectedProvider:o.formData.provider,onSelect:e=>o.handleFormChange("provider",e)})}),t(od,{provider:c,selectedPermission:o.formData.permission,onSelect:e=>o.handleFormChange("permission",e),capabilities:o.formData.customCapabilities,onCapabilitiesChange:e=>o.handleFormChange("customCapabilities",e)})]})]})})},dd=b.div`
289
288
  display: flex;
290
289
  flex-direction: column;
291
290
  gap: 16px;
@@ -293,12 +292,12 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
293
292
  padding: 12px;
294
293
  border-radius: 8px;
295
294
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
296
- `,ad=b.div`
295
+ `,pd=b.div`
297
296
  display: flex;
298
297
  align-items: center;
299
298
  gap: 12px;
300
299
  width: 100%;
301
- `,ld=b.div`
300
+ `,ud=b.div`
302
301
  display: flex;
303
302
  align-items: center;
304
303
  justify-content: center;
@@ -307,41 +306,41 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
307
306
  height: 24px;
308
307
  border-radius: 16px;
309
308
  background-color: ${({theme:e})=>e.v2.colors.purple[500]};
310
- `,rd=b.div`
309
+ `,hd=b.div`
311
310
  display: flex;
312
311
  flex: 1;
313
312
  flex-direction: column;
314
313
  gap: 2px;
315
314
  min-width: 0;
316
- `,sd=b.div`
315
+ `,md=b.div`
317
316
  display: flex;
318
317
  flex-direction: column;
319
318
  gap: 10px;
320
319
  width: 100%;
321
320
  padding-left: 32px;
322
- `,cd=({"data-id":n,step:o,title:i,description:a,children:l})=>e(id,{"data-id":n,children:[e(ad,{children:[t(ld,{children:t(_e,{size:Te.XXS,weight:400,lineHeight:"20px",color:Pe.Primary,children:o})}),e(rd,{children:[t(_e,{size:Te.S,weight:400,lineHeight:"24px",color:Pe.Primary,children:i}),t(_e,{size:Te.XXS,weight:400,lineHeight:"normal",color:Pe.Secondary,children:a})]})]}),l&&t(sd,{children:l})]});var dd,pd;(e=>{e.AssumeRole="assume-role",e.StaticKeys="static-keys"})(dd||(dd={})),(e=>{e.CloudFormation="cloudformation",e.Terraform="terraform",e.AwsCli="aws-cli",e.Manual="manual"})(pd||(pd={}));const ud=[{id:dd.AssumeRole,label:Ze.CLOUD_CONNECTOR_AUTH_ASSUME_ROLE,note:Ze.CLOUD_CONNECTOR_AUTH_ASSUME_ROLE_NOTE},{id:dd.StaticKeys,label:Ze.CLOUD_CONNECTOR_AUTH_STATIC_KEYS,note:Ze.CLOUD_CONNECTOR_AUTH_STATIC_KEYS_NOTE}],hd=[{id:pd.CloudFormation,label:Ze.CLOUD_CONNECTOR_SETUP_METHOD_CLOUDFORMATION},{id:pd.Terraform,label:Ze.CLOUD_CONNECTOR_SETUP_METHOD_TERRAFORM},{id:pd.AwsCli,label:Ze.CLOUD_CONNECTOR_SETUP_METHOD_AWS_CLI},{id:pd.Manual,label:Ze.CLOUD_CONNECTOR_SETUP_METHOD_MANUAL}],md={[pd.CloudFormation]:{description:"Launch the stack in your AWS account. It creates the IAM role with the policy above and returns the Role ARN.",steps:["Open the AWS CloudFormation console.","Choose Create stack → With new resources.","Upload the template below as the stack template.","Review the permissions, then deploy the stack.","Open the stack's Outputs tab.","Copy the RoleArn value and paste it below."],code:["aws cloudformation deploy \\"," --stack-name odigos-connector \\"," --template-file odigos-connector.yaml \\"," --capabilities CAPABILITY_NAMED_IAM"].join("\n")},[pd.Terraform]:{description:"Run the Odigos connector module to provision the IAM role as code and expose the Role ARN as an output.",steps:["Add the odigos-connector module to your configuration.","Run terraform init to download the module.","Run terraform apply and confirm the plan.","Read the role_arn value from the apply output.","Copy the Role ARN and paste it below."],code:["terraform init","terraform apply","terraform output -raw role_arn"].join("\n")},[pd.AwsCli]:{description:"Create the IAM role from your terminal using the AWS CLI, then return the Role ARN.",steps:["Make sure the AWS CLI is configured (aws configure).","Create the role with the trust policy.","Attach the permissions policy to the role.","Copy the ARN from the create-role output and paste it below."],code:["aws iam get-role \\"," --role-name OdigosConnectorRole \\"," --query 'Role.Arn' \\"," --output text"].join("\n")},[pd.Manual]:{description:"Create the IAM role by hand in the AWS Console using the trust policy below, then return the Role ARN.",steps:["Open the AWS Console → IAM → Roles → Create role.","Select Custom trust policy.","Paste the trust policy below.","Attach the permissions policy from the previous step.","Name the role and create it.","Open the role summary and copy the Role ARN below."],code:["{",' "Version": "2012-10-17",',' "Statement": ['," {",' "Effect": "Allow",',' "Principal": { "AWS": "arn:aws:iam::657451249928:root" },',' "Action": "sts:AssumeRole",',' "Condition": {',' "StringEquals": { "sts:ExternalId": "odigos-connector" }'," }"," }"," ]","}"].join("\n")}},gd=b.div`
321
+ `,gd=({"data-id":n,step:o,title:i,description:a,children:l})=>e(dd,{"data-id":n,children:[e(pd,{children:[t(ud,{children:t(ee,{size:te.XXS,weight:400,lineHeight:"20px",color:ne.Primary,children:o})}),e(hd,{children:[t(ee,{size:te.S,weight:400,lineHeight:"24px",color:ne.Primary,children:i}),t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:a})]})]}),l&&t(md,{children:l})]});var fd,bd;(e=>{e.AssumeRole="assume-role",e.StaticKeys="static-keys"})(fd||(fd={})),(e=>{e.CloudFormation="cloudformation",e.Terraform="terraform",e.AwsCli="aws-cli",e.Manual="manual"})(bd||(bd={}));const vd=[{id:fd.AssumeRole,label:nt.CLOUD_CONNECTOR_AUTH_ASSUME_ROLE,note:nt.CLOUD_CONNECTOR_AUTH_ASSUME_ROLE_NOTE},{id:fd.StaticKeys,label:nt.CLOUD_CONNECTOR_AUTH_STATIC_KEYS,note:nt.CLOUD_CONNECTOR_AUTH_STATIC_KEYS_NOTE}],yd=[{id:bd.CloudFormation,label:nt.CLOUD_CONNECTOR_SETUP_METHOD_CLOUDFORMATION},{id:bd.Terraform,label:nt.CLOUD_CONNECTOR_SETUP_METHOD_TERRAFORM},{id:bd.AwsCli,label:nt.CLOUD_CONNECTOR_SETUP_METHOD_AWS_CLI},{id:bd.Manual,label:nt.CLOUD_CONNECTOR_SETUP_METHOD_MANUAL}],Cd={[bd.CloudFormation]:{description:"Launch the stack in your AWS account. It creates the IAM role with the policy above and returns the Role ARN.",steps:["Open the AWS CloudFormation console.","Choose Create stack → With new resources.","Upload the template below as the stack template.","Review the permissions, then deploy the stack.","Open the stack's Outputs tab.","Copy the RoleArn value and paste it below."],code:["aws cloudformation deploy \\"," --stack-name odigos-connector \\"," --template-file odigos-connector.yaml \\"," --capabilities CAPABILITY_NAMED_IAM"].join("\n")},[bd.Terraform]:{description:"Run the Odigos connector module to provision the IAM role as code and expose the Role ARN as an output.",steps:["Add the odigos-connector module to your configuration.","Run terraform init to download the module.","Run terraform apply and confirm the plan.","Read the role_arn value from the apply output.","Copy the Role ARN and paste it below."],code:["terraform init","terraform apply","terraform output -raw role_arn"].join("\n")},[bd.AwsCli]:{description:"Create the IAM role from your terminal using the AWS CLI, then return the Role ARN.",steps:["Make sure the AWS CLI is configured (aws configure).","Create the role with the trust policy.","Attach the permissions policy to the role.","Copy the ARN from the create-role output and paste it below."],code:["aws iam get-role \\"," --role-name OdigosConnectorRole \\"," --query 'Role.Arn' \\"," --output text"].join("\n")},[bd.Manual]:{description:"Create the IAM role by hand in the AWS Console using the trust policy below, then return the Role ARN.",steps:["Open the AWS Console → IAM → Roles → Create role.","Select Custom trust policy.","Paste the trust policy below.","Attach the permissions policy from the previous step.","Name the role and create it.","Open the role summary and copy the Role ARN below."],code:["{",' "Version": "2012-10-17",',' "Statement": ['," {",' "Effect": "Allow",',' "Principal": { "AWS": "arn:aws:iam::657451249928:root" },',' "Action": "sts:AssumeRole",',' "Condition": {',' "StringEquals": { "sts:ExternalId": "odigos-connector" }'," }"," }"," ]","}"].join("\n")}},Sd=b.div`
323
322
  display: flex;
324
323
  align-items: stretch;
325
324
  gap: 10px;
326
325
  width: 100%;
327
- `,fd=b.div`
326
+ `,xd=b.div`
328
327
  display: flex;
329
328
  flex: 2 1 0;
330
329
  flex-direction: column;
331
330
  gap: 12px;
332
331
  min-width: 0;
333
332
  padding: 12px 0;
334
- `,bd=b.div`
333
+ `,wd=b.div`
335
334
  display: flex;
336
335
  flex-direction: column;
337
336
  gap: 8px;
338
337
  width: 100%;
339
- `,vd=b.div`
338
+ `,Td=b.div`
340
339
  display: flex;
341
340
  align-items: center;
342
341
  gap: 12px;
343
342
  width: 100%;
344
- `,yd=b.div`
343
+ `,kd=b.div`
345
344
  display: flex;
346
345
  align-items: center;
347
346
  justify-content: center;
@@ -350,7 +349,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
350
349
  height: 24px;
351
350
  border-radius: 16px;
352
351
  background-color: ${({theme:e})=>e.v2.colors.purple[700]};
353
- `,Cd=b.div`
352
+ `,Id=b.div`
354
353
  display: flex;
355
354
  flex: 3 1 0;
356
355
  flex-direction: column;
@@ -359,60 +358,60 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
359
358
  border-radius: 12px;
360
359
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
361
360
  border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
362
- `,Sd=b.div`
361
+ `,Nd=b.div`
363
362
  display: flex;
364
363
  align-items: center;
365
364
  justify-content: flex-end;
366
365
  width: 100%;
367
- `,xd=b.div`
366
+ `,Ed=b.div`
368
367
  flex: 1;
369
368
  width: 100%;
370
369
  min-height: 200px;
371
370
  max-height: 260px;
372
371
  overflow: auto;
373
372
  padding: 0 12px 12px;
374
- `,wd=b.pre`
373
+ `,Od=b.pre`
375
374
  margin: 0;
376
375
  font-family: ${({theme:e})=>e.font_family.code};
377
376
  font-size: 12px;
378
377
  line-height: 20px;
379
378
  color: ${({theme:e})=>e.v2.colors.green[400]};
380
379
  white-space: pre;
381
- `,Td=({step:n,setupMethod:o})=>{const i=v(),{CopyButton:a}=_t(),{description:l,steps:r,code:s}=(e=>md[e]??md[pd.CloudFormation])(o);return t(cd,{"data-id":"cloud-connector-create-role",step:n,title:Ze.CLOUD_CONNECTOR_CREATE_ROLE_TITLE,description:l,children:e(gd,{children:[e(fd,{children:[t(_e,{size:Te.XXS,weight:400,lineHeight:"20px",color:Pe.Primary,children:Ze.CLOUD_CONNECTOR_CREATE_ROLE_STEPS_HEADING}),t(bd,{children:r.map((n,a)=>e(vd,{children:[t(yd,{children:t(_e,{size:Te.XXS,weight:400,lineHeight:"20px",color:i.v2.colors.purple[200],children:a+1})}),t(_e,{size:Te.XXS,weight:400,lineHeight:"20px",color:Pe.Primary,children:n})]},`${o}-step-${a}`))})]}),e(Cd,{children:[t(Sd,{children:t(a,{value:s,size:vt.XS})}),t(xd,{children:t(wd,{children:s})})]})]})})},kd=b.div`
380
+ `,$d=({step:n,setupMethod:o})=>{const i=v(),{CopyButton:a}=Pt(),{description:l,steps:r,code:s}=(e=>Cd[e]??Cd[bd.CloudFormation])(o);return t(gd,{"data-id":"cloud-connector-create-role",step:n,title:nt.CLOUD_CONNECTOR_CREATE_ROLE_TITLE,description:l,children:e(Sd,{children:[e(xd,{children:[t(ee,{size:te.XXS,weight:400,lineHeight:"20px",color:ne.Primary,children:nt.CLOUD_CONNECTOR_CREATE_ROLE_STEPS_HEADING}),t(wd,{children:r.map((n,a)=>e(Td,{children:[t(kd,{children:t(ee,{size:te.XXS,weight:400,lineHeight:"20px",color:i.v2.colors.purple[200],children:a+1})}),t(ee,{size:te.XXS,weight:400,lineHeight:"20px",color:ne.Primary,children:n})]},`${o}-step-${a}`))})]}),e(Id,{children:[t(Nd,{children:t(a,{value:s,size:Ct.XS})}),t(Ed,{children:t(Od,{children:s})})]})]})})},Ad=b.div`
382
381
  display: flex;
383
382
  flex-direction: column;
384
383
  gap: 16px;
385
384
  width: 100%;
386
- `,Id=b.div`
385
+ `,Rd=b.div`
387
386
  display: flex;
388
387
  flex-wrap: wrap;
389
388
  gap: 24px;
390
389
  width: 100%;
391
- `,Nd=b.div`
390
+ `,Dd=b.div`
392
391
  display: flex;
393
392
  flex: 1 1 calc(50% - 12px);
394
393
  min-width: 0;
395
- `,Ed=b.div`
394
+ `,_d=b.div`
396
395
  display: flex;
397
396
  width: 100%;
398
397
  max-width: 479px;
399
- `,Od=({step:n})=>{const{genericForm:o,providers:i}=tr(),{provider:a,authMethod:l,awsAccountId:r,credentials:s}=o.formData,d=c(()=>i.find(e=>e.provider===a),[i,a]),p=c(()=>((e,t)=>{const n=e?.auth?.methods?.find(e=>e.id===t);if(!n)return[];const o=new Map(e?.auth?.methods?.map(e=>[e.id,e])),i=new Set,a=[],l=e=>e?.forEach(e=>{e.name&&!i.has(e.name)&&(i.add(e.name),a.push(e))});return n.baseMethods?.forEach(e=>l(o.get(e)?.fields)),l(n.fields),a})(d,l),[d,l]);return t(cd,{"data-id":"cloud-connector-enter-arn",step:n,title:Ze.CLOUD_CONNECTOR_ENTER_ARN_TITLE,description:Ze.CLOUD_CONNECTOR_ENTER_ARN_SUBTITLE,children:e(kd,{children:[t(Ed,{children:t(ye,{name:"cloud-connector-aws-account-id",width:"100%",label:Ze.CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_LABEL,placeholder:Ze.CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_PLACEHOLDER,helpMessage:Ze.CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_HELP,value:r,onChange:e=>o.handleFormChange("awsAccountId",e.target.value)})}),p.length>0&&t(Id,{children:p.map(e=>t(Nd,{children:t(ye,{name:`cloud-connector-credential-${e.name}`,width:"100%",type:e.secret?Ft.Password:Ft.Text,label:e.displayName||e.name,required:e.required,tooltip:e.tooltip||void 0,helpMessage:e.tooltip||void 0,placeholder:e.displayName||e.name,value:s[e.name]??"",onChange:t=>{return n=e.name,i=t.target.value,void o.handleFormChange("credentials",{...s,[n]:i});var n,i}})},e.name))})]})})},$d=b.div`
398
+ `,Pd=({step:n})=>{const{genericForm:o,providers:a}=ir(),{provider:l,authMethod:r,awsAccountId:s,credentials:c}=o.formData,d=i(()=>a.find(e=>e.provider===l),[a,l]),p=i(()=>((e,t)=>{const n=e?.auth?.methods?.find(e=>e.id===t);if(!n)return[];const o=new Map(e?.auth?.methods?.map(e=>[e.id,e])),i=new Set,a=[],l=e=>e?.forEach(e=>{e.name&&!i.has(e.name)&&(i.add(e.name),a.push(e))});return n.baseMethods?.forEach(e=>l(o.get(e)?.fields)),l(n.fields),a})(d,r),[d,r]);return t(gd,{"data-id":"cloud-connector-enter-arn",step:n,title:nt.CLOUD_CONNECTOR_ENTER_ARN_TITLE,description:nt.CLOUD_CONNECTOR_ENTER_ARN_SUBTITLE,children:e(Ad,{children:[t(_d,{children:t(Ne,{name:"cloud-connector-aws-account-id",width:"100%",label:nt.CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_LABEL,placeholder:nt.CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_PLACEHOLDER,helpMessage:nt.CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_HELP,value:s,onChange:e=>o.handleFormChange("awsAccountId",e.target.value)})}),p.length>0&&t(Rd,{children:p.map(e=>t(Dd,{children:t(Ne,{name:`cloud-connector-credential-${e.name}`,width:"100%",type:e.secret?Mt.Password:Mt.Text,label:e.displayName||e.name,required:e.required,tooltip:e.tooltip||void 0,helpMessage:e.tooltip||void 0,placeholder:e.displayName||e.name,value:c[e.name]??"",onChange:t=>{return n=e.name,i=t.target.value,void o.handleFormChange("credentials",{...c,[n]:i});var n,i}})},e.name))})]})})},Ld=b.div`
400
399
  display: flex;
401
400
  flex-direction: column;
402
401
  padding: 16px;
403
- `,Ad=b.div`
402
+ `,Fd=b.div`
404
403
  display: flex;
405
404
  flex-direction: column;
406
405
  gap: 12px;
407
406
  padding: 16px 16px 12px;
408
407
  border-radius: 16px;
409
408
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
410
- `,Rd=b.div`
409
+ `,Md=b.div`
411
410
  display: flex;
412
411
  align-items: center;
413
412
  gap: 8px;
414
413
  width: 100%;
415
- `,Dd=b.button`
414
+ `,zd=b.button`
416
415
  display: flex;
417
416
  align-items: center;
418
417
  justify-content: center;
@@ -429,24 +428,24 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
429
428
  &:hover {
430
429
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
431
430
  }
432
- `,_d=b.div`
431
+ `,Bd=b.div`
433
432
  display: flex;
434
433
  flex: 1;
435
434
  flex-direction: column;
436
435
  gap: 4px;
437
436
  min-width: 0;
438
- `,Pd=b.div`
437
+ `,Xd=b.div`
439
438
  display: flex;
440
439
  align-items: center;
441
440
  gap: 4px;
442
441
  padding: 8px 0 8px 2px;
443
- `,Ld=({onBack:n})=>{const o=v(),{genericForm:a}=tr(),l=a.formData.authMethod,r=a.formData.setupMethod;i(()=>{l||a.handleFormChange("authMethod",dd.AssumeRole)},[l,a]),i(()=>{r||a.handleFormChange("setupMethod",pd.CloudFormation)},[r,a]);const s=ud.find(e=>e.id===l)?.note;return t($d,{children:e(Ad,{children:[e(Rd,{children:[t(Dd,{"data-id":"cloud-connector-setup-back",type:"button",onClick:n,"aria-label":Ze.CLOUD_CONNECTOR_SETUP_CREDENTIALS_TITLE,children:t(il,{size:24})}),e(_d,{children:[t(_e,{size:Te.S,weight:500,lineHeight:"24px",color:Pe.Primary,children:Ze.CLOUD_CONNECTOR_SETUP_CREDENTIALS_TITLE}),t(_e,{size:Te.XXS,weight:400,lineHeight:"normal",color:Pe.Secondary,children:Ze.CLOUD_CONNECTOR_SETUP_CREDENTIALS_SUBTITLE})]})]}),e(cd,{"data-id":"cloud-connector-auth-method",step:1,title:Ze.CLOUD_CONNECTOR_AUTH_TITLE,description:Ze.CLOUD_CONNECTOR_AUTH_SUBTITLE,children:[t(ce,{"data-id":"cloud-connector-auth-method-segment",size:ke.S,selected:l,setSelected:e=>a.handleFormChange("authMethod",e),options:ud.map(e=>({value:e.id,label:e.label}))}),s&&e(Pd,{children:[t(al,{size:16,fill:o.v2.colors.silver[200]}),t(_e,{size:Te.XXXS,weight:400,lineHeight:"normal",color:Pe.Secondary,children:s})]})]}),t(cd,{"data-id":"cloud-connector-setup-method",step:2,title:Ze.CLOUD_CONNECTOR_SETUP_METHOD_TITLE,description:Ze.CLOUD_CONNECTOR_SETUP_METHOD_SUBTITLE,children:t(ce,{"data-id":"cloud-connector-setup-method-segment",size:ke.S,selected:r,setSelected:e=>a.handleFormChange("setupMethod",e),options:hd.map(e=>({value:e.id,label:e.label}))})}),t(Td,{step:3,setupMethod:r}),t(Od,{step:4})]})})},Fd=b.div`
442
+ `,Ud=({onBack:n})=>{const o=v(),{genericForm:i}=ir(),l=i.formData.authMethod,r=i.formData.setupMethod;a(()=>{l||i.handleFormChange("authMethod",fd.AssumeRole)},[l,i]),a(()=>{r||i.handleFormChange("setupMethod",bd.CloudFormation)},[r,i]);const s=vd.find(e=>e.id===l)?.note;return t(Ld,{children:e(Fd,{children:[e(Md,{children:[t(zd,{"data-id":"cloud-connector-setup-back",type:"button",onClick:n,"aria-label":nt.CLOUD_CONNECTOR_SETUP_CREDENTIALS_TITLE,children:t(cl,{size:24})}),e(Bd,{children:[t(ee,{size:te.S,weight:500,lineHeight:"24px",color:ne.Primary,children:nt.CLOUD_CONNECTOR_SETUP_CREDENTIALS_TITLE}),t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:nt.CLOUD_CONNECTOR_SETUP_CREDENTIALS_SUBTITLE})]})]}),e(gd,{"data-id":"cloud-connector-auth-method",step:1,title:nt.CLOUD_CONNECTOR_AUTH_TITLE,description:nt.CLOUD_CONNECTOR_AUTH_SUBTITLE,children:[t(ve,{"data-id":"cloud-connector-auth-method-segment",size:Re.S,selected:l,setSelected:e=>i.handleFormChange("authMethod",e),options:vd.map(e=>({value:e.id,label:e.label}))}),s&&e(Xd,{children:[t(dl,{size:16,fill:o.v2.colors.silver[200]}),t(ee,{size:te.XXXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:s})]})]}),t(gd,{"data-id":"cloud-connector-setup-method",step:2,title:nt.CLOUD_CONNECTOR_SETUP_METHOD_TITLE,description:nt.CLOUD_CONNECTOR_SETUP_METHOD_SUBTITLE,children:t(ve,{"data-id":"cloud-connector-setup-method-segment",size:Re.S,selected:r,setSelected:e=>i.handleFormChange("setupMethod",e),options:yd.map(e=>({value:e.id,label:e.label}))})}),t($d,{step:3,setupMethod:r}),t(Pd,{step:4})]})})},Vd=b.div`
444
443
  display: flex;
445
444
  flex-direction: column;
446
445
  flex: 1;
447
446
  min-height: 0;
448
447
  padding: 16px;
449
- `,Md=b.div`
448
+ `,Hd=b.div`
450
449
  display: flex;
451
450
  flex-direction: column;
452
451
  flex: 1;
@@ -454,13 +453,13 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
454
453
  padding: 16px;
455
454
  border-radius: 16px;
456
455
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
457
- `,zd=b.div`
456
+ `,jd=b.div`
458
457
  display: flex;
459
458
  flex: 1;
460
459
  align-items: center;
461
460
  justify-content: center;
462
461
  width: 100%;
463
- `,Bd=b.div`
462
+ `,Gd=b.div`
464
463
  display: flex;
465
464
  flex-direction: column;
466
465
  align-items: center;
@@ -470,7 +469,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
470
469
  padding: 24px 8px;
471
470
  border-radius: 8px;
472
471
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
473
- `,Xd=b.div`
472
+ `,Wd=b.div`
474
473
  display: flex;
475
474
  flex-direction: column;
476
475
  align-items: center;
@@ -479,7 +478,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
479
478
  padding: 16px;
480
479
  border-radius: 12px;
481
480
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
482
- `,Ud=b.div`
481
+ `,Kd=b.div`
483
482
  display: flex;
484
483
  align-items: center;
485
484
  justify-content: center;
@@ -488,7 +487,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
488
487
  height: 39px;
489
488
  border-radius: 20px;
490
489
  background-color: ${({theme:e})=>e.v2.colors.red[500]};
491
- `,Vd=b.div`
490
+ `,Yd=b.div`
492
491
  display: flex;
493
492
  align-items: flex-start;
494
493
  gap: 8px;
@@ -498,7 +497,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
498
497
  padding: 12px;
499
498
  border-radius: 8px;
500
499
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
501
- `,Hd=b.pre`
500
+ `,Jd=b.pre`
502
501
  flex: 1;
503
502
  min-width: 0;
504
503
  margin: 0;
@@ -508,25 +507,25 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
508
507
  color: ${({theme:e})=>e.v2.colors.silver[200]};
509
508
  white-space: pre-wrap;
510
509
  word-break: break-word;
511
- `,jd=b.div`
510
+ `,qd=b.div`
512
511
  display: flex;
513
512
  flex-direction: column;
514
513
  gap: 12px;
515
514
  width: 100%;
516
- `,Gd=b.div`
515
+ `,Zd=b.div`
517
516
  display: flex;
518
517
  flex-wrap: wrap;
519
518
  gap: 24px;
520
519
  padding: 0 2px;
521
- `,Wd=b.div`
520
+ `,Qd=b.div`
522
521
  display: flex;
523
522
  gap: 6px;
524
523
  min-width: 0;
525
- `,Kd=b.div`
524
+ `,ep=b.div`
526
525
  display: flex;
527
526
  flex-direction: column;
528
527
  gap: 8px;
529
- `,Yd=b.div`
528
+ `,tp=b.div`
530
529
  display: flex;
531
530
  flex-direction: column;
532
531
  gap: 6px;
@@ -534,7 +533,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
534
533
  border-radius: 12px;
535
534
  border: 1px solid ${({theme:e,$passed:t})=>t?e.v2.colors.silver[700]:e.v2.colors.red[800]};
536
535
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
537
- `,Jd=({isTesting:n,error:o,result:i})=>{const a=v(),{CopyButton:l}=_t(),r=c(()=>i?.checks.filter(e=>!e.passed)??[],[i]),s=!(n||!o&&(!i||i.success)),d=o?Ze.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT:r[0]?.remediation||r[0]?.message||Ze.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT,p=o||r.map(e=>e.message).filter(Boolean).join("\n");return t(Fd,{children:t(Md,{children:n?t(zd,{children:t(Bd,{children:t(yt,{withVisual:!0,withGradient:!0,title:Ze.CLOUD_CONNECTOR_TESTING_TITLE,titleSize:Te.XS})})}):s?t(zd,{children:e(Xd,{children:[t(Ud,{children:t(Ka,{size:20,fill:a.v2.colors.black[500]})}),t(_e,{size:Te.XS,weight:400,lineHeight:"20px",color:Pe.Primary,children:Ze.CLOUD_CONNECTOR_CONNECTION_FAILED_TITLE}),t(_e,{align:"center",size:Te.XXXS,weight:400,lineHeight:"normal",color:Pe.Secondary,children:d}),p&&e(Vd,{children:[t(Hd,{children:p}),t(l,{value:p,size:vt.XS})]})]})}):i?e(jd,{children:[t(Ke,{status:Ee.Success,label:Ze.CLOUD_CONNECTOR_VALIDATE_SUCCESS,leftIcon:Wa,fullWidth:!0}),(i.accountId||i.identity)&&e(Gd,{children:[i.accountId&&e(Wd,{children:[e(_e,{size:Te.XXS,weight:500,color:Pe.Secondary,children:[Ze.CLOUD_CONNECTOR_VALIDATE_ACCOUNT,":"]}),t(_e,{size:Te.XXS,weight:400,color:Pe.Primary,children:i.accountId})]}),i.identity&&e(Wd,{children:[e(_e,{size:Te.XXS,weight:500,color:Pe.Secondary,children:[Ze.CLOUD_CONNECTOR_VALIDATE_IDENTITY,":"]}),t(_e,{size:Te.XXS,weight:400,color:Pe.Primary,children:i.identity})]})]}),i.checks.length>0&&t(Kd,{children:i.checks.map(n=>e(Yd,{$passed:n.passed,children:[t(Ke,{status:n.passed?Ee.Success:Ee.Error,label:n.displayName,leftIcon:n.passed?Wa:Ka}),n.message&&t(_e,{size:Te.XXS,weight:400,lineHeight:"normal",color:Pe.Secondary,children:n.message}),!n.passed&&n.remediation&&t(_e,{size:Te.XXS,weight:400,lineHeight:"normal",color:Pe.Primary,children:n.remediation})]},n.name))})]}):t(zd,{children:t(_e,{size:Te.XXS,weight:400,color:Pe.Secondary,children:Ze.CLOUD_CONNECTOR_VALIDATE_EMPTY})})})})};var qd;(e=>{e[e.SelectProvider=1]="SelectProvider",e[e.Config=2]="Config",e[e.Validate=3]="Validate"})(qd||(qd={}));const Zd=qd.SelectProvider,Qd=qd.Validate,ep=({onClose:n,withOverlay:o,onCreateCloudConnector:i,onCreated:l})=>{const{providers:r,genericForm:s}=tr(),[p,u]=a(Zd),[h,m]=a(!1),[g,f]=a(!1),[b,v]=a(void 0),[y,C]=a(void 0),[S,x]=a(void 0),w=s.isFormDirty,T=p===Zd,k=p===Qd,I=d(()=>{w&&!h?m(!0):(m(!1),n?.())},[w,h,n]),N=d(()=>{x(void 0),C(void 0),v(void 0),u(e=>e>Zd?e-1:e)},[]),E=d(()=>{if(x(void 0),p===qd.SelectProvider){if(!s.formData.provider)return void x("Please select a cloud provider");if(!s.formData.permission)return void x("Please select a permission level")}u(e=>e<Qd?e+1:e)},[p,s.formData.provider,s.formData.permission]),O=d(async()=>{if(x(void 0),C(void 0),v(void 0),u(qd.Validate),!i)return;const{provider:e,permission:t,customCapabilities:n,awsAccountId:o,credentials:a,name:c}=s.formData,d=((e,t,n)=>{const o=Fc(e),i=[];return o.forEach(e=>{const o=void 0!==e.instrumentationPermissions;let a=!1,l=!1;switch(t){case _c.DiscoveryOnly:a=!0;break;case _c.DiscoveryInstrumentation:a=!0,l=o;break;case _c.Custom:{const t=n[e.typeName];a=!!t?.discovery,l=!!t?.instrumentation;break}}(a||l)&&i.push({type:e.typeName,discovery:a,instrumentation:l,computePlatforms:!1})}),i})(r.find(t=>t.provider===e),t,n);f(!0);try{const t=await i({provider:e,displayName:c,credentials:a,expectedAccountId:o,capabilities:d});if(t.created)return void l?.(t.connectorId);v(t.test)}catch(e){C(e instanceof Error?e.message:"Failed to create connector")}finally{f(!1)}},[i,l,s.formData,r]),$=g,A=k&&!g&&(!!y||!!b&&!b.success),R=c(()=>S?{status:Ee.Error,message:S}:void 0,[S]),D=c(()=>T?{"data-id":"cloud-connector-cancel",label:Lt.CANCEL,variant:ve.Secondary,onClick:I,disabled:$}:{"data-id":"cloud-connector-back",label:Lt.BACK,variant:ve.Text,leftIcon:il,onClick:N,disabled:$},[T,I,N,$]),_=c(()=>{if(k){if(g)return;return A?{"data-id":"cloud-connector-retry",label:Lt.RETRY,variant:ve.Primary,rightIcon:ll,onClick:O}:void 0}return p===qd.Config?{"data-id":"cloud-connector-verify",label:Lt.VERIFY_AND_CREATE_CONNECTOR,variant:ve.Primary,onClick:O,disabled:$}:{"data-id":"cloud-connector-next",label:Lt.NEXT,variant:ve.Primary,onClick:E,disabled:$}},[k,g,A,p,O,E,$]),P=c(()=>[D,_].filter(Boolean),[D,_]);return e(Mt,{width:Ir,isOpen:!0,hideOverlay:!$&&!o,header:{icon:tl,title:Ze.CREATE_CLOUD_CONNECTOR,onClose:n?I:void 0,onCloseDisabled:$},footer:{note:R,actions:P},children:[p===qd.SelectProvider&&t(od,{}),p===qd.Config&&t(Ld,{onBack:N}),p===qd.Validate&&t(Jd,{isTesting:g,error:y,result:b}),t(Nr,{isOpen:h,onClose:()=>m(!1),onApprove:()=>n?.()})]})},tp=(e,t)=>{const n=[{id:"type",title:Ze.TYPE,label:t.label},{id:"status",title:Ze.STATUS,badge:{status:e.disabled?Ee.Unknown:Ee.Success,label:e.disabled?Ze.DISABLED:Ze.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:Ze.SIGNALS_FOR_PROCESSING,label:o}),e.name&&n.push({id:"name",title:Ze.NAME,label:e.name}),e.notes&&n.push({id:"notes",title:Ze.NOTES,label:e.notes}),n},np=({onClose:o,actionId:l})=>{const r=v(),{isVm:s}=S(),{actionsApi:p}=Vl(),{items:u,refetch:h}=p.useActions(),{options:m}=p.useActionTypes(),{selectedOption:g,loadAction:f,validateFormData:b,genericForm:y}=Ul();i(()=>{h()},[]);const[C,x]=a(!1),[w,T]=a(!1),[k,I]=a(null),N=C&&!!y?.isFormDirty,E=c(()=>u?.find(e=>Xt(e)===l),[l,u]),O=c(()=>m.find(({type:e})=>e===E?.type)??Ut.find(({type:e})=>e===E?.type)??null,[m,E?.type]);i(()=>{E&&f(E,O)},[E,O]);const $=d(()=>{E&&x(!0)},[E]),A=d(()=>{E&&(f(E,O),x(!1))},[E,O,f]),R=d(()=>{N?I("close"):o()},[N,o]),D=d(()=>{N?I("cancel"):A()},[N,A]),_=d(()=>{const e=k;I(null),"close"===e?(A(),o()):A()},[k,A,o]),P=d(async()=>{if(E){const{errorMessage:e,preparedFormData:t}=b();e||(await p.update(E.id,t),x(!1))}},[E,b,p]),L=d(()=>{E&&T(!0)},[E]),F=d(async()=>{E&&(await p.remove(E.id,E.type),o())},[E,p,o]);if(!E||!O)return null;const M=(z=E,B=O,B?.fields?.length?zt(z.fields||{},B.fields,{signals:z.signals||[],skipComponentTypes:[Bt.SourceScopes]}):[]);var z,B;const X=O.fields?.find(e=>e.componentType===Bt.SourceScopes),U=X?.name||Q.Scopes,V=E.fields?.[U]??null,H=!(s||!X&&void 0===E.fields?.scopes);return e(n,{children:[t(Mt,{isOpen:!0,header:{icon:jt(E.type),title:O.label,onClose:R,actions:[{id:"edit-action-btn-edit",label:Lt.EDIT,icon:Ma,active:C,onClick:$},{id:"edit-action-btn-delete",label:Lt.DELETE,icon:Aa,color:r.v2.colors.red[500],active:w,onClick:L}]},footer:{actions:C?[{"data-id":"edit-action-btn-cancel",label:Lt.CANCEL,variant:ve.Secondary,onClick:D},{"data-id":"edit-action-btn-save",label:Lt.SAVE,variant:ve.Primary,onClick:P}]:[]},children:t(ut,{$padding:"4px 12px 12px",children:C&&g?t(gs,{}):t(ee,{$gap:16,children:e(Vt,{bgTint:"1000",children:[e(Vt,{bgTint:"900",children:[!s&&t(Ht,{conditions:E.conditions||[]}),t(Vt,{bgTint:"800",cellsPerRow:2,items:tp(E,O)})]}),H&&t(gr,{readOnly:!0,scopes:V}),!!M?.length&&t(Vt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Vt,{bgTint:"800",cellsPerRow:2,items:M})})]})})})}),t(Er,{target:"action",isOpen:w,onClose:()=>T(!1),onApprove:F}),t(Nr,{isOpen:null!==k,onClose:()=>I(null),onApprove:_})]})},op=({onClose:n,connections:o,selectedConnectionIds:l,setSelectedConnectionIds:r})=>{const{configApi:s}=Vl(),[d,u]=a(""),[h,m]=a({showOnlySelected:!1}),g=c(()=>o.filter(e=>{const t=!d||e.name.toLowerCase().includes(d.toLowerCase()),n=!h.showOnlySelected||h.showOnlySelected&&l.includes(e.id);return t&&n}),[o.length,l.length,d,h]),f=e=>{r(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},b=1===l.length?l[0]:void 0,{data:v,loading:y}=s.useEffectiveConfig(b?{id:b}:void 0,{skip:!b}),C=c(()=>{if(b&&v)return{rollout:{automaticRolloutDisabled:v.rollout?.automaticRolloutDisabled??!1}}},[b,v]),{formData:S,handleFormChange:x,areFormValuesEqual:w,resetFormData:T}=Gt(C||{rollout:{automaticRolloutDisabled:!1}}),k=p(T);k.current=T,i(()=>{C&&k.current(C)},[C]);const I=c(()=>l.length>1||void 0!==C&&!w(C,S),[l.length,C,S]);return t(kr,{isOpen:!0,onClose:n,onSave:async()=>await(s.applyConfigurations?.(S,l))??void 0,header:{icon:rl,title:"Cluster Configuration"},connectionIds:{value:l,setValue:r},search:{placeholder:"Search by cluster name",value:d,onChange:u},filters:e(pe,{$gap:8,children:[t(_e,{size:Te.XXXS,color:Pe.Secondary,nowrap:!0,children:"Show only:"}),t(le,{size:Nt.S,label:"Selected",value:h.showOnlySelected,onChange:e=>m(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:I,isFetching:y,leftColumn:{width:"35%",header:e(pe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(pe,{$gap:8,children:[t(_e,{size:Te.XS,children:"Clusters"}),t(Ke,{label:g.length,status:Ee.Unknown})]}),e(pe,{$gap:8,children:[t(_e,{size:Te.XXXS,color:Pe.Secondary,align:"right",children:"Selected clusters"}),t(Ke,{label:`${l.length}/${g.length}`,status:Ee.Unknown})]})]}),list:g.map(e=>t(Hs,{title:e.name,isChecked:l.includes(e.id),onClick:()=>f(e.id),onCheckboxChange:()=>f(e.id)},e.id))},rightColumn:{width:"65%",header:t(_e,{size:Te.XS,children:"Configurations"}),list:[t(le,{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=>x("rollout.automaticRolloutDisabled",e)},"automatic-rollout-disabled")]}})},ip=e=>{const t=[{id:"type",title:Ze.TYPE,label:e.destinationType.displayName},{id:"status",title:Ze.STATUS,badge:{status:e.disabled?Ee.Unknown:Ee.Success,label:e.disabled?Ze.DISABLED:Ze.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:Ze.MONITORS,label:n}),e.name&&t.push({id:"name",title:Ze.NAME,label:e.name}),t},ap=({onClose:o,destinationId:l})=>{const r=v(),{isVm:s}=S(),{destinationsApi:u}=Vl(),{selectedStreamName:h}=Qe(),{items:m,refetch:g}=u.useDestinations(),{data:f,loading:b}=u.useDestinationCategories(),{activeForm:y,loadDestination:C,validateFormData:x,genericForm:w}=Hl();i(()=>{g()},[]);const T=p(null),[k,I]=a(!1),[N,E]=a(!1),[O,$]=a(null),A=k&&!!w?.isFormDirty,R=c(()=>Yt(m,h),[m,h]),D=c(()=>R?.find(e=>Xt(e)===l),[l,R]),_=f?.destinationCategories?.categories??null;i(()=>{D&&_&&C(D,_)},[D,_]);const P=c(()=>D&&_?Jt(_,D):[],[D,_]),L=d(()=>{D&&I(!0)},[D]),F=d(()=>{D&&_&&(C(D,_),I(!1))},[D,_,C]),M=d(()=>{A?$("close"):o()},[A,o]),z=d(()=>{A?$("cancel"):F()},[A,F]),B=d(()=>{const e=O;$(null),"close"===e?(F(),o()):F()},[O,F,o]),X=d(async()=>{if(D){const{errorMessage:e,preparedFormData:t}=x();e||(await u.update(D.id,De(t)),I(!1))}},[D,x,u]),U=d(()=>{D&&E(!0)},[D]),V=d(async()=>{D&&(await u.remove(D.id),o())},[D,u,o]);if(!D)return null;const{icon:H,iconSrc:j}=St(D.destinationType.type),G=((e,t)=>{const n=[],o=Wt(e,t),i=o.map(e=>({name:e.key,value:e.value})),a=Ae(e.exportedSignals);let l=[];const r=()=>{l.length&&(n.push({kind:"cells",id:`cells-${n.length}`,items:l}),l=[])};return o.forEach(({key:e,name:o,value:s})=>{const c=t.find(t=>t.name===e),{secret:d,componentType:p,componentProperties:u,hideFromReadData:h,customReadDataLabels:m}=c||{};if(h?.length&&Kt(h,a,i))return;const{type:g}=wt(u,{type:""}),f=d||"password"===g;if(m?.length)m.forEach(({condition:t,...n},o)=>{t==s&&l.push({id:`${e}-custom-${o}`,title:n.title,label:n.value})});else if(s)if(f)l.push({id:e,title:o,label:new Array(10).fill("•").join("")});else{if(p===Bt.MultiInput){const t=wt(s,null);if(Array.isArray(t)&&t.length)return r(),void n.push({kind:"list",id:e,title:o,items:t.map((t,n)=>({id:`${e}-${n}`,label:String(t)}))})}if(p===Bt.KeyValuePair){const t=wt(s,null);if(Array.isArray(t)&&t.length)return r(),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:s})}else l.push({id:e,title:o,label:"-"})}),r(),n})(D,P);return e(n,{children:[t(Mt,{isOpen:!0,header:{icon:H,iconSrc:j,title:D.name||D.destinationType.displayName,onClose:M,actions:[{id:"edit-destination-btn-edit",label:Lt.EDIT,icon:Ma,active:k,onClick:L},{id:"edit-destination-btn-delete",label:Lt.DELETE,icon:Aa,color:r.v2.colors.red[500],active:N,onClick:U}]},footer:{actions:k?[{"data-id":"edit-destination-btn-cancel",label:Lt.CANCEL,variant:ve.Secondary,onClick:z},...y?.option.testConnectionSupported&&!s?[{"data-id":"edit-destination-btn-test-connection",label:Lt.TEST_CONNECTION,variant:ve.Secondary,onClick:()=>T.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:Lt.SAVE,variant:ve.Primary,onClick:X}]:[]},children:t(ut,{$padding:"4px 12px 12px",children:b?t(mt,{$height:"50vh",children:t(yt,{withSpinner:!0})}):k&&y?t(bs,{ref:T,isEdit:!0}):t(ee,{$gap:16,children:e(Vt,{bgTint:"1000",children:[e(Vt,{bgTint:"900",children:[!s&&t(Ht,{conditions:D.conditions||[]}),t(Vt,{bgTint:"800",cellsPerRow:2,items:ip(D)})]}),!!G.length&&t(Vt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:G.map(e=>"cells"===e.kind?t(Vt,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t(Vt,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})})}),t(Er,{target:"destination",isOpen:N,onClose:()=>E(!1),onApprove:V}),t(Nr,{isOpen:null!==O,onClose:()=>$(null),onApprove:B})]})},lp=(e,t)=>{const n=[{id:"type",title:Ze.TYPE,label:t.label},{id:"status",title:Ze.STATUS,badge:{status:e.disabled?Ee.Unknown:Ee.Success,label:e.disabled?Ze.DISABLED:Ze.ENABLED}}];return e.ruleName&&n.push({id:"name",title:Ze.NAME,label:e.ruleName}),e.profileName&&n.push({id:"profile",title:Ze.MANAGED_BY_PROFILE,label:e.profileName}),e.notes&&n.push({id:"notes",title:Ze.NOTES,label:e.notes}),n},rp=({onClose:o,ruleId:l})=>{const r=v(),{addNotification:s}=qt(),{isVm:p}=S(),{instrumentationRulesApi:u}=Vl(),{items:h,refetch:m}=u.useRules(),{selectedOption:g,loadRule:f,validateFormData:b,genericForm:y}=jl();i(()=>{m()},[]);const[C,x]=a(!1),[w,T]=a(!1),[k,I]=a(null),N=C&&!!y?.isFormDirty,{options:E}=u.useRuleTypes(),O=c(()=>E.length?E:Tt,[E]),$=c(()=>h?.find(e=>Xt(e)===l),[l,h]),A=c(()=>O.find(({type:e})=>e===$?.type)??null,[O,$?.type]),R=c(()=>Ge(A?.supportedLanguages),[A?.supportedLanguages]);i(()=>{$&&A&&f($,A)},[$,A]);const D=d(()=>{if($){if(!$.mutable)return void s({type:Ee.Warning,title:He.FORBIDDEN,message:He.CANNOT_EDIT_RULE,crdType:kt.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});x(!0)}},[$,s]),_=d(()=>{$&&A&&(f($,A),x(!1))},[$,A,f]),P=d(()=>{N?I("close"):o()},[N,o]),L=d(()=>{N?I("cancel"):_()},[N,_]),F=d(()=>{const e=k;I(null),"close"===e?(_(),o()):_()},[k,_,o]),M=d(async()=>{if($){const{errorMessage:e,preparedFormData:t}=b();e||(await u.update($.ruleId,t,$.type),x(!1))}},[$,b,u]),z=d(()=>{if($){if(!$.mutable)return void s({type:Ee.Warning,title:He.FORBIDDEN,message:He.CANNOT_DELETE_RULE,crdType:kt.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});T(!0)}},[$,s]),B=d(async()=>{$&&(await u.remove($.ruleId,$.type),o())},[$,u,o]);if(!$||!A)return null;const X=(U=$,V=A,V?.fields?.length?zt(U,V.fields,{skipComponentTypes:[Bt.SourceScopes]}):[]);var U,V;return e(n,{children:[t(Mt,{isOpen:!0,header:{icon:Qt($.type),title:A.label,onClose:P,actions:[{id:"edit-rule-btn-edit",label:Lt.EDIT,icon:Ma,active:C,onClick:D},{id:"edit-rule-btn-delete",label:Lt.DELETE,icon:Aa,color:r.v2.colors.red[500],active:w,onClick:z}]},footer:{actions:C?[{"data-id":"edit-rule-btn-cancel",label:Lt.CANCEL,variant:ve.Secondary,onClick:L},{"data-id":"edit-rule-btn-save",label:Lt.SAVE,variant:ve.Primary,onClick:M}]:[]},children:t(ut,{$padding:"4px 12px 12px",children:C&&g?t(ks,{}):t(ee,{$gap:16,children:e(Vt,{bgTint:"1000",children:[e(Vt,{bgTint:"900",children:[!p&&t(Ht,{conditions:$.conditions||[]}),t(Vt,{bgTint:"800",cellsPerRow:2,items:lp($,A)})]}),!p&&t(gr,{readOnly:!0,scopes:$.sourceScopes??null}),A.type===je.CustomInstrumentation&&!!$.customInstrumentations?.[Ve.Php]?.length&&t(Ne,{status:Ee.Warning,message:He.PHP_CUSTOM_INSTRUMENTATION_RESTART,fullWidth:!0}),!!X?.length&&t(Vt,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Vt,{bgTint:"800",cellsPerRow:2,items:X})}),!!R.length&&t(Vt,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Vt,{bgTint:"800",children:t(pe,{$gap:12,$wrap:"wrap",children:R.map(e=>t(Zt,{label:Je(e),leftIcon:Ye(e),flex:R.length>1?"0.5":"1"},e))})})})]})})})}),t(Er,{target:"instrumentation rule",isOpen:w,onClose:()=>T(!1),onApprove:B}),t(Nr,{isOpen:null!==k,onClose:()=>I(null),onApprove:F})]})};var sp;(e=>{e.Overview="overview",e.Pods="pods",e.Libraries="libraries",e.PeerSources="peer-sources",e.Profiling="profiling",e.Sampling="sampling",e.Debug="debug"})(sp||(sp={}));const cp=({collapseIsDefaultOpen:e,isJumpToTarget:n,onClickRestartPod:o,namespace:i,podName:a,nodeName:l,startTime:r,agentInjectedStatus:s,odigosHealthStatus:d,k8sHealthStatus:p,children:u})=>{const{formatDurationAgo:h}=en(),m=tn(!!n),g=c(()=>({title:a,icon:sl,withCopy:!0}),[a]),f=c(()=>{const e=[],t=nn(s);t&&e.push(t);const n=nn(d,cl,"health");n&&e.push(n);const o=nn(p,dl,"health");return o&&e.push(o),e},[s,d,p]),b=c(()=>o?[{id:`restart-pod-${a}`,icon:ll,label:Lt.RESTART_POD,onClick:()=>o(i,a)}]:void 0,[o,i,a]),v=c(()=>[{id:"nodeName",title:Ze.NODE,label:l,withCopy:!0},{id:"age",title:Ze.AGE,label:r?h(r,{style:"short"}):Ze.NOT_RUNNING,labelTooltip:r}],[l,r,h]);return t("div",{ref:m,children:t(Vt,{bgTint:"900",richTitle:g,badges:f,dropDataActions:b,items:v,withCollapse:!0,collapseIsDefaultOpen:e,children:u})})},dp=b.div`
536
+ `,np=({isTesting:n,error:o,result:a})=>{const l=v(),{CopyButton:r}=Pt(),s=i(()=>a?.checks.filter(e=>!e.passed)??[],[a]),c=!(n||!o&&(!a||a.success)),d=o?nt.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT:s[0]?.remediation||s[0]?.message||nt.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT,p=o||s.map(e=>e.message).filter(Boolean).join("\n");return t(Vd,{children:t(Hd,{children:n?t(jd,{children:t(Gd,{children:t(St,{withVisual:!0,withGradient:!0,title:nt.CLOUD_CONNECTOR_TESTING_TITLE,titleSize:te.XS})})}):c?t(jd,{children:e(Wd,{children:[t(Kd,{children:t(Qa,{size:20,fill:l.v2.colors.black[500]})}),t(ee,{size:te.XS,weight:400,lineHeight:"20px",color:ne.Primary,children:nt.CLOUD_CONNECTOR_CONNECTION_FAILED_TITLE}),t(ee,{align:"center",size:te.XXXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:d}),p&&e(Yd,{children:[t(Jd,{children:p}),t(r,{value:p,size:Ct.XS})]})]})}):a?e(qd,{children:[t(ce,{status:Pe.Success,label:nt.CLOUD_CONNECTOR_VALIDATE_SUCCESS,leftIcon:Za,fullWidth:!0}),(a.accountId||a.identity)&&e(Zd,{children:[a.accountId&&e(Qd,{children:[e(ee,{size:te.XXS,weight:500,color:ne.Secondary,children:[nt.CLOUD_CONNECTOR_VALIDATE_ACCOUNT,":"]}),t(ee,{size:te.XXS,weight:400,color:ne.Primary,children:a.accountId})]}),a.identity&&e(Qd,{children:[e(ee,{size:te.XXS,weight:500,color:ne.Secondary,children:[nt.CLOUD_CONNECTOR_VALIDATE_IDENTITY,":"]}),t(ee,{size:te.XXS,weight:400,color:ne.Primary,children:a.identity})]})]}),a.checks.length>0&&t(ep,{children:a.checks.map(n=>e(tp,{$passed:n.passed,children:[t(ce,{status:n.passed?Pe.Success:Pe.Error,label:n.displayName,leftIcon:n.passed?Za:Qa}),n.message&&t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:n.message}),!n.passed&&n.remediation&&t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ne.Primary,children:n.remediation})]},n.name))})]}):t(jd,{children:t(ee,{size:te.XXS,weight:400,color:ne.Secondary,children:nt.CLOUD_CONNECTOR_VALIDATE_EMPTY})})})})};var op;(e=>{e[e.SelectProvider=1]="SelectProvider",e[e.Config=2]="Config",e[e.Validate=3]="Validate"})(op||(op={}));const ip=op.SelectProvider,ap=op.Validate,lp=({onClose:n,withOverlay:o,onCreateCloudConnector:a,onCreated:r})=>{const{providers:s,genericForm:c}=ir(),[p,u]=l(ip),[h,m]=l(!1),[g,f]=l(!1),[b,v]=l(void 0),[y,C]=l(void 0),[S,x]=l(void 0),w=c.isFormDirty,T=p===ip,k=p===ap,I=d(()=>{w&&!h?m(!0):(m(!1),n?.())},[w,h,n]),N=d(()=>{x(void 0),C(void 0),v(void 0),u(e=>e>ip?e-1:e)},[]),E=d(()=>{if(x(void 0),p===op.SelectProvider){if(!c.formData.provider)return void x("Please select a cloud provider");if(!c.formData.permission)return void x("Please select a permission level")}u(e=>e<ap?e+1:e)},[p,c.formData.provider,c.formData.permission]),O=d(async()=>{if(x(void 0),C(void 0),v(void 0),u(op.Validate),!a)return;const{provider:e,permission:t,customCapabilities:n,awsAccountId:o,credentials:i,name:l}=c.formData,d=((e,t,n)=>{const o=Vc(e),i=[];return o.forEach(e=>{const o=void 0!==e.instrumentationPermissions;let a=!1,l=!1;switch(t){case Bc.DiscoveryOnly:a=!0;break;case Bc.DiscoveryInstrumentation:a=!0,l=o;break;case Bc.Custom:{const t=n[e.typeName];a=!!t?.discovery,l=!!t?.instrumentation;break}}(a||l)&&i.push({type:e.typeName,discovery:a,instrumentation:l,computePlatforms:!1})}),i})(s.find(t=>t.provider===e),t,n);f(!0);try{const t=await a({provider:e,displayName:l,credentials:i,expectedAccountId:o,capabilities:d});if(t.created)return void r?.(t.connectorId);v(t.test)}catch(e){C(e instanceof Error?e.message:"Failed to create connector")}finally{f(!1)}},[a,r,c.formData,s]),$=g,A=k&&!g&&(!!y||!!b&&!b.success),R=i(()=>S?{status:Pe.Error,message:S}:void 0,[S]),D=i(()=>T?{"data-id":"cloud-connector-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:I,disabled:$}:{"data-id":"cloud-connector-back",label:Ft.BACK,variant:Ie.Text,leftIcon:cl,onClick:N,disabled:$},[T,I,N,$]),_=i(()=>{if(k){if(g)return;return A?{"data-id":"cloud-connector-retry",label:Ft.RETRY,variant:Ie.Primary,rightIcon:pl,onClick:O}:void 0}return p===op.Config?{"data-id":"cloud-connector-verify",label:Ft.VERIFY_AND_CREATE_CONNECTOR,variant:Ie.Primary,onClick:O,disabled:$}:{"data-id":"cloud-connector-next",label:Ft.NEXT,variant:Ie.Primary,onClick:E,disabled:$}},[k,g,A,p,O,E,$]),P=i(()=>[D,_].filter(Boolean),[D,_]);return e(zt,{width:Or,isOpen:!0,hideOverlay:!$&&!o,header:{icon:ll,title:nt.CREATE_CLOUD_CONNECTOR,onClose:n?I:void 0,onCloseDisabled:$},footer:{note:R,actions:P},children:[p===op.SelectProvider&&t(cd,{}),p===op.Config&&t(Ud,{onBack:N}),p===op.Validate&&t(np,{isTesting:g,error:y,result:b}),t($r,{isOpen:h,onClose:()=>m(!1),onApprove:()=>n?.()})]})},rp=({statuses:e})=>{const n=i(()=>Bt(e).map(({status:e,type:t,reason:n,message:o})=>({status:e,title:Xt(n||t),subTitle:o??void 0})),[e]);return n.length?t(ae,{$gap:12,children:n.map(e=>t(Ut,{invertColors:!0,slim:!0,width:"100%",...e},e.title))}):null},sp=(e,t)=>{const n=[{id:"type",title:nt.TYPE,label:t.label},{id:"status",title:nt.STATUS,badge:{status:e.disabled?Pe.Unknown:Pe.Success,label:e.disabled?nt.DISABLED:nt.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:nt.SIGNALS_FOR_PROCESSING,label:o}),e.name&&n.push({id:"name",title:nt.NAME,label:e.name}),e.notes&&n.push({id:"notes",title:nt.NOTES,label:e.notes}),n},cp=({onClose:o,actionId:r})=>{const s=v(),{isK8s:c}=S(),{actionsApi:u}=Gl(),{items:h,refetch:m}=u.useActions(),{options:g}=u.useActionTypes(),{selectedOption:f,loadAction:b,validateFormData:y,genericForm:C}=jl(),x=p(m);x.current=m,a(()=>{x.current()},[]);const[w,T]=l(!1),[k,I]=l(!1),[N,E]=l(null),O=w&&!!C?.isFormDirty;a(()=>{if(w)return;const e=setInterval(()=>x.current(),3e3);return()=>clearInterval(e)},[w]);const $=i(()=>h?.find(e=>jt(e)===r),[r,h]),A=i(()=>g.find(({type:e})=>e===$?.type)??Gt.find(({type:e})=>e===$?.type)??null,[g,$?.type]),R=$?.statuses&&Array.isArray($.statuses)?$.statuses:null;a(()=>{$&&b($,A)},[$,A]);const D=d(()=>{$&&T(!0)},[$]),_=d(()=>{$&&(b($,A),T(!1))},[$,A,b]),P=d(()=>{O?E("close"):o()},[O,o]),L=d(()=>{O?E("cancel"):_()},[O,_]),F=d(()=>{const e=N;E(null),"close"===e?(_(),o()):_()},[N,_,o]),M=d(async()=>{if($){const{errorMessage:e,preparedFormData:t}=y();e||(await u.update($.id,t),T(!1))}},[$,y,u]),z=d(()=>{$&&I(!0)},[$]),B=d(async()=>{$&&(await u.remove($.id,$.type),o())},[$,u,o]);if(!$||!A)return null;const X=(U=$,V=A,V?.fields?.length?Vt(U.fields||{},V.fields,{signals:U.signals||[],skipComponentTypes:[Ht.SourceScopes]}):[]);var U,V;const H=A.fields?.find(e=>e.componentType===Ht.SourceScopes),j=H?.name||de.Scopes,G=$.fields?.[j]??null,W=c&&(!!H||void 0!==$.fields?.scopes);return e(n,{children:[t(zt,{isOpen:!0,header:{icon:Yt($.type),title:A.label,onClose:P,actions:[{id:"edit-action-btn-edit",label:Ft.EDIT,icon:ja,active:w,onClick:D},{id:"edit-action-btn-delete",label:Ft.DELETE,icon:Ma,color:s.v2.colors.red[500],active:k,onClick:z}]},footer:{actions:w?[{"data-id":"edit-action-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:L},{"data-id":"edit-action-btn-save",label:Ft.SAVE,variant:Ie.Primary,onClick:M}]:[]},children:t(le,{$padding:"4px 12px 12px",children:w&&f?t(Es,{}):t(ae,{$gap:16,children:e(Wt,{bgTint:"1000",children:[e(Wt,{bgTint:"900",children:[c&&(R?t(rp,{statuses:R}):t(Kt,{conditions:$.conditions||[]})),t(Wt,{bgTint:"800",cellsPerRow:2,items:sp($,A)})]}),W&&t(vr,{readOnly:!0,scopes:G}),!!X?.length&&t(Wt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Wt,{bgTint:"800",cellsPerRow:2,items:X})})]})})})}),t(Ar,{target:"action",isOpen:k,onClose:()=>I(!1),onApprove:B}),t($r,{isOpen:null!==N,onClose:()=>E(null),onApprove:F})]})},dp=({onClose:n,connections:o,selectedConnectionIds:r,setSelectedConnectionIds:s})=>{const{configApi:c}=Gl(),[d,u]=l(""),[h,m]=l({showOnlySelected:!1}),g=i(()=>o.filter(e=>{const t=!d||e.name.toLowerCase().includes(d.toLowerCase()),n=!h.showOnlySelected||h.showOnlySelected&&r.includes(e.id);return t&&n}),[o.length,r.length,d,h]),f=e=>{s(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},b=1===r.length?r[0]:void 0,{data:v,loading:y}=c.useEffectiveConfig(b?{id:b}:void 0,{skip:!b}),C=i(()=>{if(b&&v)return{rollout:{automaticRolloutDisabled:v.rollout?.automaticRolloutDisabled??!1}}},[b,v]),{formData:S,handleFormChange:x,areFormValuesEqual:w,resetFormData:T}=Jt(C||{rollout:{automaticRolloutDisabled:!1}}),k=p(T);k.current=T,a(()=>{C&&k.current(C)},[C]);const I=i(()=>r.length>1||void 0!==C&&!w(C,S),[r.length,C,S]);return t(Er,{isOpen:!0,onClose:n,onSave:async()=>await(c.applyConfigurations?.(S,r))??void 0,header:{icon:ul,title:"Cluster Configuration"},connectionIds:{value:r,setValue:s},search:{placeholder:"Search by cluster name",value:d,onChange:u},filters:e(oe,{$gap:8,children:[t(ee,{size:te.XXXS,color:ne.Secondary,nowrap:!0,children:"Show only:"}),t(ge,{size:Et.S,label:"Selected",value:h.showOnlySelected,onChange:e=>m(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:I,isFetching:y,leftColumn:{width:"35%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(ee,{size:te.XS,children:"Clusters"}),t(ce,{label:g.length,status:Pe.Unknown})]}),e(oe,{$gap:8,children:[t(ee,{size:te.XXXS,color:ne.Secondary,align:"right",children:"Selected clusters"}),t(ce,{label:`${r.length}/${g.length}`,status:Pe.Unknown})]})]}),list:g.map(e=>t(is,{title:e.name,isChecked:r.includes(e.id),onClick:()=>f(e.id),onCheckboxChange:()=>f(e.id)},e.id))},rightColumn:{width:"65%",header:t(ee,{size:te.XS,children:"Configurations"}),list:[t(ge,{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=>x("rollout.automaticRolloutDisabled",e)},"automatic-rollout-disabled")]}})},pp=e=>{const t=[{id:"type",title:nt.TYPE,label:e.destinationType.displayName},{id:"status",title:nt.STATUS,badge:{status:e.disabled?Pe.Unknown:Pe.Success,label:e.disabled?nt.DISABLED:nt.ENABLED}}],n=Me(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:nt.MONITORS,label:n}),e.name&&t.push({id:"name",title:nt.NAME,label:e.name}),t},up=({onClose:o,destinationId:r})=>{const s=v(),{isK8s:c}=S(),{destinationsApi:u}=Gl(),{selectedStreamName:h}=ot(),{items:m,refetch:g}=u.useDestinations(),{data:f,loading:b}=u.useDestinationCategories(),{activeForm:y,loadDestination:C,validateFormData:x,genericForm:w}=Wl();a(()=>{g()},[]);const T=p(null),[k,I]=l(!1),[N,E]=l(!1),[O,$]=l(null),A=k&&!!w?.isFormDirty,R=i(()=>Qt(m,h),[m,h]),D=i(()=>R?.find(e=>jt(e)===r),[r,R]),_=f?.destinationCategories?.categories??null;a(()=>{D&&_&&C(D,_)},[D,_]);const P=i(()=>D&&_?en(_,D):[],[D,_]),L=d(()=>{D&&I(!0)},[D]),F=d(()=>{D&&_&&(C(D,_),I(!1))},[D,_,C]),M=d(()=>{A?$("close"):o()},[A,o]),z=d(()=>{A?$("cancel"):F()},[A,F]),B=d(()=>{const e=O;$(null),"close"===e?(F(),o()):F()},[O,F,o]),X=d(async()=>{if(D){const{errorMessage:e,preparedFormData:t}=x();e||(await u.update(D.id,Be(t)),I(!1))}},[D,x,u]),U=d(()=>{D&&E(!0)},[D]),V=d(async()=>{D&&(await u.remove(D.id),o())},[D,u,o]);if(!D)return null;const{icon:H,iconSrc:j}=wt(D.destinationType.type),G=((e,t)=>{const n=[],o=qt(e,t),i=o.map(e=>({name:e.key,value:e.value})),a=Me(e.exportedSignals);let l=[];const r=()=>{l.length&&(n.push({kind:"cells",id:`cells-${n.length}`,items:l}),l=[])};return o.forEach(({key:e,name:o,value:s})=>{const c=t.find(t=>t.name===e),{secret:d,componentType:p,componentProperties:u,hideFromReadData:h,customReadDataLabels:m}=c||{};if(h?.length&&Zt(h,a,i))return;const{type:g}=kt(u,{type:""}),f=d||"password"===g;if(m?.length)m.forEach(({condition:t,...n},o)=>{t==s&&l.push({id:`${e}-custom-${o}`,title:n.title,label:n.value})});else if(s)if(f)l.push({id:e,title:o,label:new Array(10).fill("•").join("")});else{if(p===Ht.MultiInput){const t=kt(s,null);if(Array.isArray(t)&&t.length)return r(),void n.push({kind:"list",id:e,title:o,items:t.map((t,n)=>({id:`${e}-${n}`,label:String(t)}))})}if(p===Ht.KeyValuePair){const t=kt(s,null);if(Array.isArray(t)&&t.length)return r(),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:s})}else l.push({id:e,title:o,label:"-"})}),r(),n})(D,P);return e(n,{children:[t(zt,{isOpen:!0,header:{icon:H,iconSrc:j,title:D.name||D.destinationType.displayName,onClose:M,actions:[{id:"edit-destination-btn-edit",label:Ft.EDIT,icon:ja,active:k,onClick:L},{id:"edit-destination-btn-delete",label:Ft.DELETE,icon:Ma,color:s.v2.colors.red[500],active:N,onClick:U}]},footer:{actions:k?[{"data-id":"edit-destination-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:z},...y?.option.testConnectionSupported&&c?[{"data-id":"edit-destination-btn-test-connection",label:Ft.TEST_CONNECTION,variant:Ie.Secondary,onClick:()=>T.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:Ft.SAVE,variant:Ie.Primary,onClick:X}]:[]},children:t(le,{$padding:"4px 12px 12px",children:b?t(ft,{$height:"50vh",children:t(St,{withSpinner:!0})}):k&&y?t($s,{ref:T,isEdit:!0}):t(ae,{$gap:16,children:e(Wt,{bgTint:"1000",children:[e(Wt,{bgTint:"900",children:[c&&t(Kt,{conditions:D.conditions||[]}),t(Wt,{bgTint:"800",cellsPerRow:2,items:pp(D)})]}),!!G.length&&t(Wt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:G.map(e=>"cells"===e.kind?t(Wt,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t(Wt,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})})}),t(Ar,{target:"destination",isOpen:N,onClose:()=>E(!1),onApprove:V}),t($r,{isOpen:null!==O,onClose:()=>$(null),onApprove:B})]})},hp=(e,t)=>{const n=[{id:"type",title:nt.TYPE,label:t.label},{id:"status",title:nt.STATUS,badge:{status:e.disabled?Pe.Unknown:Pe.Success,label:e.disabled?nt.DISABLED:nt.ENABLED}}];return e.ruleName&&n.push({id:"name",title:nt.NAME,label:e.ruleName}),e.profileName&&n.push({id:"profile",title:nt.MANAGED_BY_PROFILE,label:e.profileName}),e.notes&&n.push({id:"notes",title:nt.NOTES,label:e.notes}),n},mp=({onClose:o,ruleId:r})=>{const s=v(),{addNotification:c}=tn(),{isK8s:p}=S(),{instrumentationRulesApi:u}=Gl(),{items:h,refetch:m}=u.useRules(),{selectedOption:g,loadRule:f,validateFormData:b,genericForm:y}=Kl();a(()=>{m()},[]);const[C,x]=l(!1),[w,T]=l(!1),[k,I]=l(null),N=C&&!!y?.isFormDirty,{options:E}=u.useRuleTypes(),O=i(()=>E.length?E:It,[E]),$=i(()=>h?.find(e=>jt(e)===r),[r,h]),A=i(()=>O.find(({type:e})=>e===$?.type)??null,[O,$?.type]),R=i(()=>qe(A?.supportedLanguages),[A?.supportedLanguages]);a(()=>{$&&A&&f($,A)},[$,A]);const D=d(()=>{if($){if(!$.mutable)return void c({type:Pe.Warning,title:Ye.FORBIDDEN,message:Ye.CANNOT_EDIT_RULE,crdType:Nt.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});x(!0)}},[$,c]),_=d(()=>{$&&A&&(f($,A),x(!1))},[$,A,f]),P=d(()=>{N?I("close"):o()},[N,o]),L=d(()=>{N?I("cancel"):_()},[N,_]),F=d(()=>{const e=k;I(null),"close"===e?(_(),o()):_()},[k,_,o]),M=d(async()=>{if($){const{errorMessage:e,preparedFormData:t}=b();e||(await u.update($.ruleId,t,$.type),x(!1))}},[$,b,u]),z=d(()=>{if($){if(!$.mutable)return void c({type:Pe.Warning,title:Ye.FORBIDDEN,message:Ye.CANNOT_DELETE_RULE,crdType:Nt.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});T(!0)}},[$,c]),B=d(async()=>{$&&(await u.remove($.ruleId,$.type),o())},[$,u,o]);if(!$||!A)return null;const X=(U=$,V=A,V?.fields?.length?Vt(U,V.fields,{skipComponentTypes:[Ht.SourceScopes]}):[]);var U,V;return e(n,{children:[t(zt,{isOpen:!0,header:{icon:on($.type),title:A.label,onClose:P,actions:[{id:"edit-rule-btn-edit",label:Ft.EDIT,icon:ja,active:C,onClick:D},{id:"edit-rule-btn-delete",label:Ft.DELETE,icon:Ma,color:s.v2.colors.red[500],active:w,onClick:z}]},footer:{actions:C?[{"data-id":"edit-rule-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:L},{"data-id":"edit-rule-btn-save",label:Ft.SAVE,variant:Ie.Primary,onClick:M}]:[]},children:t(le,{$padding:"4px 12px 12px",children:C&&g?t(Ms,{}):t(ae,{$gap:16,children:e(Wt,{bgTint:"1000",children:[e(Wt,{bgTint:"900",children:[p&&t(Kt,{conditions:$.conditions||[]}),t(Wt,{bgTint:"800",cellsPerRow:2,items:hp($,A)})]}),p&&t(vr,{readOnly:!0,scopes:$.sourceScopes??null}),A.type===Je.CustomInstrumentation&&!!$.customInstrumentations?.[Ke.Php]?.length&&t(_e,{status:Pe.Warning,message:Ye.PHP_CUSTOM_INSTRUMENTATION_RESTART,fullWidth:!0}),!!X?.length&&t(Wt,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Wt,{bgTint:"800",cellsPerRow:2,items:X})}),!!R.length&&t(Wt,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Wt,{bgTint:"800",children:t(oe,{$gap:12,$wrap:"wrap",children:R.map(e=>t(nn,{label:et(e),leftIcon:Qe(e),flex:R.length>1?"0.5":"1"},e))})})})]})})})}),t(Ar,{target:"instrumentation rule",isOpen:w,onClose:()=>T(!1),onApprove:B}),t($r,{isOpen:null!==k,onClose:()=>I(null),onApprove:F})]})};var gp;(e=>{e.Overview="overview",e.Pods="pods",e.Libraries="libraries",e.PeerSources="peer-sources",e.Profiling="profiling",e.Sampling="sampling",e.Debug="debug"})(gp||(gp={}));const fp=({collapseIsDefaultOpen:e,isJumpToTarget:n,onClickRestartPod:o,namespace:a,podName:l,nodeName:r,startTime:s,agentInjectedStatus:c,odigosHealthStatus:d,k8sHealthStatus:p,children:u})=>{const{formatDurationAgo:h}=an(),m=ln(!!n),g=i(()=>({title:l,icon:hl,withCopy:!0}),[l]),f=i(()=>{const e=[],t=rn(c);t&&e.push(t);const n=rn(d,sl,"health");n&&e.push(n);const o=rn(p,ml,"health");return o&&e.push(o),e},[c,d,p]),b=i(()=>o?[{id:`restart-pod-${l}`,icon:pl,label:Ft.RESTART_POD,onClick:()=>o(a,l)}]:void 0,[o,a,l]),v=i(()=>[{id:"nodeName",title:nt.NODE,label:r,withCopy:!0},{id:"age",title:nt.AGE,label:s?h(s,{style:"short"}):nt.NOT_RUNNING,labelTooltip:s}],[r,s,h]);return t("div",{ref:m,children:t(Wt,{bgTint:"900",richTitle:g,badges:f,dropDataActions:b,items:v,withCollapse:!0,collapseIsDefaultOpen:e,children:u})})},bp=b.div`
538
537
  display: flex;
539
538
  align-items: center;
540
539
  justify-content: space-between;
@@ -542,7 +541,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
542
541
  padding: ${({$noPadding:e})=>e?"0":"12px"};
543
542
  border-radius: 12px;
544
543
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
545
- `,pp=({podsOdigosHealthStatus:n,pods:o,noPadding:i})=>{const a=rn(n?.status),l=on(n?.name),r=n?.message,{totalPodsCount:s,odigosHealthyPodsCount:d,k8sHealthyPodsCount:p}=c(()=>({totalPodsCount:o?.length||0,odigosHealthyPodsCount:o?.reduce((e,t)=>e+(t.odigosHealthStatus?.status===an.Success?1:0),0)||0,k8sHealthyPodsCount:o?.reduce((e,t)=>e+(t.k8sHealthStatus?.status===an.Success?1:0),0)||0}),[o]);return o?.length&&n&&a?e(dp,{$noPadding:i,children:[t(ln,{invertColors:!0,hideBackground:!0,status:a,title:l,subTitle:r}),e(pe,{$gap:8,children:[t(hp,{label:Ze.PODS,count:s}),t(hp,{label:Ze.ODIGOS_HEALTHY,icon:cl,count:d,total:s}),t(hp,{label:Ze.KUBERNETES_HEALTHY,icon:dl,count:p,total:s})]})]}):null},up=b.div`
544
+ `,vp=({podsOdigosHealthStatus:n,pods:o,noPadding:a})=>{const l=cn(n?.status),r=Xt(n?.name),s=n?.message,{totalPodsCount:c,odigosHealthyPodsCount:d,k8sHealthyPodsCount:p}=i(()=>({totalPodsCount:o?.length||0,odigosHealthyPodsCount:o?.reduce((e,t)=>e+(t.odigosHealthStatus?.status===sn.Success?1:0),0)||0,k8sHealthyPodsCount:o?.reduce((e,t)=>e+(t.k8sHealthStatus?.status===sn.Success?1:0),0)||0}),[o]);return o?.length&&n&&l?e(bp,{$noPadding:a,children:[t(Ut,{invertColors:!0,hideBackground:!0,status:l,title:r,subTitle:s}),e(oe,{$gap:8,children:[t(Cp,{label:nt.PODS,count:c}),t(Cp,{label:nt.ODIGOS_HEALTHY,icon:sl,count:d,total:c}),t(Cp,{label:nt.KUBERNETES_HEALTHY,icon:ml,count:p,total:c})]})]}):null},yp=b.div`
546
545
  display: flex;
547
546
  flex-direction: column;
548
547
  justify-content: center;
@@ -553,7 +552,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
553
552
  width: fit-content;
554
553
  border-radius: 8px;
555
554
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
556
- `,hp=({count:n,total:o,label:i,icon:a})=>{const l=v(),r=void 0===o?void 0:n===o?l.v2.colors.green[500]:l.v2.colors.red[500];return e(up,{children:[e(pe,{$gap:0,$alignItems:"flex-end",children:[t(_e,{size:Te.L,color:r,weight:500,nowrap:!0,children:n}),void 0!==o&&t(_e,{size:Te.S,color:r,weight:500,nowrap:!0,children:`/${o}`})]}),e(pe,{$alignItems:"center",$gap:4,children:[a&&t(a,{size:16}),t(_e,{size:Te.XXXS,nowrap:!0,children:i})]})]})},mp=e=>{if(e.overrideProcessNum)return e.overrideProcessNum.toString();const t=e.identifyingAttributes?.find(({name:e})=>e===sn.PID)??e.identifyingAttributes?.find(({name:e})=>e===sn.VPID);return t?.value??null};var gp;(e=>{e.IdentifyingAttributes="identifying-attributes",e.InstrumentationLibraries="instrumentation-libraries"})(gp||(gp={}));const fp=({overrideProcessNum:n,healthy:o,healthStatus:l,identifyingAttributes:r,instrumentations:s,isJumpToTarget:d})=>{const p=v(),[u,h]=a(gp.IdentifyingAttributes),m=tn(!!d),{tabOptions:g,firstTabValue:f,bothTabsDisabled:b}=c(()=>{const e=s?.some(e=>!1===e.healthy),n=[{value:gp.IdentifyingAttributes,label:Ze.IDENTIFYING_ATTRIBUTES,disabled:!r?.length,selectedBgColor:p.v2.colors.purple[500]},{value:gp.InstrumentationLibraries,label:Ze.INSTRUMENTATION_LIBRARIES,icon:e?e=>t(pl,{...e,fill:p.v2.colors.red[500]}):void 0,disabled:!s?.length,selectedBgColor:p.v2.colors.purple[500]}];return{tabOptions:n,firstTabValue:n.find(e=>!e.disabled)?.value||n[0].value,bothTabsDisabled:n.every(e=>e.disabled)}},[r,s]);i(()=>{f&&h(f)},[f]);const y=c(()=>{switch(u){case gp.IdentifyingAttributes:return t(ee,{children:r?.map((e,n)=>t(Sp,{label:e.name,value:e.value},`attr-${n}-${e.name}`))});case gp.InstrumentationLibraries:return t(ee,{children:s?.map((e,n)=>t(Sp,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},`instr-${n}-${e.name}`))});default:return null}},[u,r,s]),C=c(()=>mp({overrideProcessNum:n,identifyingAttributes:r}),[n,r]);return t("div",{ref:m,children:e(Vt,{bgTint:"800",richTitle:{title:C?`${Ze.PROCESS} ${Ze.PID(C)}`:Ze.PROCESS_FALLBACK_NAME},renderOnRightSide:t(_e,{color:o?Pe.Success:Pe.Error,size:Te.XXXS,children:l?.message}),badges:[{key:"odigos-healthy",status:o?Ee.Success:Ee.Error,leftIcon:cl,label:o?Ze.HEALTHY:Ze.NOT_HEALTHY,textSize:Te.XXXS,invertColors:!0,useSecondaryTone:!0}],withCollapse:!b,collapseIsDefaultOpen:d,children:[!b&&t(ce,{options:g,selected:u,setSelected:h}),!b&&y]})})},bp=b.div`
555
+ `,Cp=({count:n,total:o,label:i,icon:a})=>{const l=v(),r=void 0===o?void 0:n===o?l.v2.colors.green[500]:l.v2.colors.red[500];return e(yp,{children:[e(oe,{$gap:0,$alignItems:"flex-end",children:[t(ee,{size:te.L,color:r,weight:500,nowrap:!0,children:n}),void 0!==o&&t(ee,{size:te.S,color:r,weight:500,nowrap:!0,children:`/${o}`})]}),e(oe,{$alignItems:"center",$gap:4,children:[a&&t(a,{size:16}),t(ee,{size:te.XXXS,nowrap:!0,children:i})]})]})},Sp=e=>{if(e.overrideProcessNum)return e.overrideProcessNum.toString();const t=e.identifyingAttributes?.find(({name:e})=>e===dn.PID)??e.identifyingAttributes?.find(({name:e})=>e===dn.VPID);return t?.value??null};var xp;(e=>{e.IdentifyingAttributes="identifying-attributes",e.InstrumentationLibraries="instrumentation-libraries"})(xp||(xp={}));const wp=({overrideProcessNum:n,healthy:o,healthStatus:r,identifyingAttributes:s,instrumentations:c,isJumpToTarget:d})=>{const p=v(),[u,h]=l(xp.IdentifyingAttributes),m=ln(!!d),{tabOptions:g,firstTabValue:f,bothTabsDisabled:b}=i(()=>{const e=c?.some(e=>!1===e.healthy),n=[{value:xp.IdentifyingAttributes,label:nt.IDENTIFYING_ATTRIBUTES,disabled:!s?.length,selectedBgColor:p.v2.colors.purple[500]},{value:xp.InstrumentationLibraries,label:nt.INSTRUMENTATION_LIBRARIES,icon:e?e=>t(gl,{...e,fill:p.v2.colors.red[500]}):void 0,disabled:!c?.length,selectedBgColor:p.v2.colors.purple[500]}];return{tabOptions:n,firstTabValue:n.find(e=>!e.disabled)?.value||n[0].value,bothTabsDisabled:n.every(e=>e.disabled)}},[s,c]);a(()=>{f&&h(f)},[f]);const y=i(()=>{switch(u){case xp.IdentifyingAttributes:return t(ae,{children:s?.map((e,n)=>t(Ep,{label:e.name,value:e.value},`attr-${n}-${e.name}`))});case xp.InstrumentationLibraries:return t(ae,{children:c?.map((e,n)=>t(Ep,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},`instr-${n}-${e.name}`))});default:return null}},[u,s,c]),C=i(()=>Sp({overrideProcessNum:n,identifyingAttributes:s}),[n,s]);return t("div",{ref:m,children:e(Wt,{bgTint:"800",richTitle:{title:C?`${nt.PROCESS} ${nt.PID(C)}`:nt.PROCESS_FALLBACK_NAME},renderOnRightSide:t(ee,{color:o?ne.Success:ne.Error,size:te.XXXS,children:r?.message}),badges:[{key:"odigos-healthy",status:o?Pe.Success:Pe.Error,leftIcon:sl,label:o?nt.HEALTHY:nt.NOT_HEALTHY,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}],withCollapse:!b,collapseIsDefaultOpen:d,children:[!b&&t(ve,{options:g,selected:u,setSelected:h}),!b&&y]})})},Tp=b.div`
557
556
  display: flex;
558
557
  align-items: ${({$withHealthBadge:e})=>e?"center":"flex-start"};
559
558
  gap: 8px;
@@ -562,23 +561,23 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
562
561
  &:hover {
563
562
  background-color: ${({theme:e})=>e.v2.colors.silver[700]};
564
563
  }
565
- `,vp=b(_e)`
564
+ `,kp=b(ee)`
566
565
  flex: 0 0 ${({$withHealthBadge:e})=>e?"auto":"30%"};
567
- `,yp=b(_e)`
566
+ `,Ip=b(ee)`
568
567
  flex: 1 1 auto;
569
568
  min-width: 0;
570
- `,Cp=b(pe)`
569
+ `,Np=b(oe)`
571
570
  flex: 1 1 auto;
572
571
  justify-content: flex-end;
573
572
  min-width: 0;
574
- `,Sp=({label:n,value:o,isStandardLibrary:i,healthy:a,message:l})=>{const r="boolean"==typeof a;return e(bp,{$withHealthBadge:r,children:[t(vp,{size:Te.XXS,color:Pe.Secondary,$withHealthBadge:r,children:n}),o&&t(yp,{size:Te.XXS,color:Pe.Primary,align:"right",children:o}),(i||r)&&e(Cp,{children:[i&&t(Ke,{status:Ee.Info,label:Ze.STANDARD,textSize:Te.XXXS,invertColors:!0}),r&&e(pe,{$gap:4,children:[l&&t(yp,{size:Te.XXXS,color:Pe.Error,align:"right",children:l}),t(Ke,{status:a?Ee.Success:Ee.Error,label:a?Ze.HEALTHY:Ze.NOT_HEALTHY,leftIcon:cl,textSize:Te.XXXS,invertColors:!0,tooltip:l??void 0})]})]})]})},xp=h(null),wp=({value:e,children:n})=>t(xp.Provider,{value:e,children:n}),Tp=({podContainers:e,sourceContainers:n,jumpToTarget:o})=>{const i=e??[],a=c(()=>({title:Ze.CONTAINERS,titleSize:Te.XS,badge:{label:i.length}}),[i.length]),l=c(()=>{const e=new Map;return n?.forEach(t=>e.set(t.containerName,t)),e},[n]);return t(Vt,{bgTint:"800",richTitle:a,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(ee,{$gap:8,children:i.map(e=>{const n=o?.containerName===e.containerName;return t(Ip,{...e,language:cn(l.get(e.containerName)),jumpToTarget:n?o:null},`pod-container-${e.containerName}`)})})})},kp=b.div`
573
+ `,Ep=({label:n,value:o,isStandardLibrary:i,healthy:a,message:l})=>{const r="boolean"==typeof a;return e(Tp,{$withHealthBadge:r,children:[t(kp,{size:te.XXS,color:ne.Secondary,$withHealthBadge:r,children:n}),o&&t(Ip,{size:te.XXS,color:ne.Primary,align:"right",children:o}),(i||r)&&e(Np,{children:[i&&t(ce,{status:Pe.Info,label:nt.STANDARD,textSize:te.XXXS,invertColors:!0}),r&&e(oe,{$gap:4,children:[l&&t(Ip,{size:te.XXXS,color:ne.Error,align:"right",children:l}),t(ce,{status:a?Pe.Success:Pe.Error,label:a?nt.HEALTHY:nt.NOT_HEALTHY,leftIcon:sl,textSize:te.XXXS,invertColors:!0,tooltip:l??void 0})]})]})]})},Op=h(null),$p=({value:e,children:n})=>t(Op.Provider,{value:e,children:n}),Ap=({podContainers:e,sourceContainers:n,jumpToTarget:o})=>{const a=e??[],l=i(()=>({title:nt.CONTAINERS,titleSize:te.XS,badge:{label:a.length}}),[a.length]),r=i(()=>{const e=new Map;return n?.forEach(t=>e.set(t.containerName,t)),e},[n]);return t(Wt,{bgTint:"800",richTitle:l,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(ae,{$gap:8,children:a.map(e=>{const n=o?.containerName===e.containerName;return t(Dp,{...e,language:pn(r.get(e.containerName)),jumpToTarget:n?o:null},`pod-container-${e.containerName}`)})})})},Rp=b.div`
575
574
  display: flex;
576
575
  flex-direction: column;
577
576
  gap: 12px;
578
577
  padding: 8px 12px;
579
578
  border-radius: 8px;
580
579
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
581
- `,Ip=({language:n,containerName:o,otelDistroName:i,runningStartedTime:a,started:l,ready:r,restartCount:s,isCrashLoop:d,waitingReasonEnum:p,waitingMessage:u,odigosHealthStatus:h,k8sHealthStatus:m,processes:g,jumpToTarget:f})=>{const b=!!f,v=b&&!f?.processPid,{formatDurationAgo:y}=en(),C=tn(v),S=c(()=>({title:o,icon:n?dn(n):ul,iconWithWrapper:!0}),[o,n]),x=c(()=>{const e=[],t=nn({status:i?an.Success:an.Disabled,reasonEnum:i?Ze.INSTRUMENTED_WITH_DISTRO(i):Ze.UNINSTRUMENTED,message:""});t&&e.push(t);const n=nn(h,cl,"health");n&&e.push(n);const o=nn(m,dl,"health");return o&&e.push(o),e},[m,h,i]),w=c(()=>[{id:"runningTime",title:Ze.RUNNING_TIME,label:a?y(a,{style:"short"}):Ze.NOT_RUNNING,labelTooltip:`${Ze.RUNNING_TIME_TOOLTIP}. (${a})`},{id:"blank",spacer:!0},{id:"started",badge:{status:l?Ee.Success:Ee.Disabled,leftIcon:l?_a:Pa,label:l?Ze.STARTED:Ze.NOT_STARTED,textSize:Te.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"ready",badge:{status:r?Ee.Success:Ee.Disabled,leftIcon:r?_a:Pa,label:r?Ze.READY:Ze.NOT_READY,textSize:Te.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"isCrashLoop",badge:{status:d?Ee.Error:Ee.Success,leftIcon:d?Pa:_a,label:d?Ze.CRASHLOOP:Ze.NO_CRASHLOOP,textSize:Te.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"restartCount",title:Ze.RESTARTS,badge:{status:s?Ee.Error:void 0,label:s||0,textSize:Te.XXXS}}],[a,y,l,r,d,s]),T=c(()=>u?on(p):"",[u,p]);return t("div",{ref:C,children:e(Vt,{bgTint:"750",richTitle:S,badges:x,items:w,withCollapse:!0,collapseIsDefaultOpen:b,children:[u&&t(kp,{children:e(pe,{$gap:10,$alignItems:"center",children:[t(Zt,{variant:pn.Pink,leftIcon:dl,label:T}),t(_e,{size:Te.XXXS,color:Pe.Error,children:u})]})}),(g??[]).map((e,n)=>{const i=n+1,a=b&&(l=f,r=e,!!l?.processPid&&mp({identifyingAttributes:r.identifyingAttributes})===l.processPid);var l,r;return t(fp,{...e,overrideProcessNum:i,isJumpToTarget:a},`pod-container-${o}-process-${i}`)})]})})},Np=({podName:e,namespace:n,hasRestarted:o})=>{const i=c(()=>({title:Ze.DEBUG_COMMANDS,titleSize:Te.XS}),[]),a=c(()=>[{label:Ze.GET_POD_YAML,value:`kubectl get pod ${e} -n ${n} -o yaml`},{label:Ze.DESCRIBE_POD,value:`kubectl describe pod ${e} -n ${n}`},{label:Ze.GET_POD_LOGS,value:`kubectl logs ${e} -n ${n}${o?" -p":""}`}],[e,n,o]);return t(Vt,{bgTint:"800",richTitle:i,withCollapse:!0,children:a.map(({label:e,value:n})=>t(un,{bgTint:"700",label:e,value:n},e))})},Ep=({source:o,onClickRestartPod:i})=>{const{jumpToTarget:a}=(()=>{const e=m(xp);if(!e)throw new Error("useJumpToTargetContext must be used within a JumpToTargetContextProvider");return e})(),l=a?.tab===sp.Pods?a:null,r=o?.pods??[],s=r.length>0,d=c(()=>r.some(e=>e.containers?.some(e=>e.restartCount&&e.restartCount>0)),[r]),p=c(()=>({title:Ze.PODS,badge:{label:r.length}}),[r.length]);return t(ee,{$gap:12,children:s?e(n,{children:[t(pp,{podsOdigosHealthStatus:o.podsOdigosHealthStatus,pods:r}),t(Vt,{bgTint:"1000",richTitle:p,children:r.map(n=>{const a=l?.podName===n.podName,r=a&&!l?.containerName;return e(cp,{...n,namespace:o.id.namespace,onClickRestartPod:i,collapseIsDefaultOpen:a,isJumpToTarget:r,children:[t(Np,{podName:n.podName,namespace:o.id.namespace,hasRestarted:d}),t(Tp,{podContainers:n.containers,sourceContainers:o.containers,jumpToTarget:a?l:null})]},`pod-${n.podName}`)})})]}):t(mt,{$height:"70vh",children:t(xe,{title:Ze.NO_RUNNING_PODS,subTitle:Ze.NO_RUNNING_PODS_SUBTITLE})})})},Op="user",$p=({source:n})=>{const o=c(()=>n.serviceName||n.id.name,[n]),{sourcesApi:i}=Vl(),{data:a,loading:l,refetch:r}=i.usePeerSources({serviceName:o},{fetchPolicy:"network-only"}),s=a?.peerSources??null;return!s||l?t(mt,l?{$height:"70vh",children:t(yt,{withSpinner:!0})}:{$height:"70vh",children:t(xe,{subTitle:Ze.COULD_NOT_FETCH_PEER_SOURCES})}):e(pe,{$gap:16,$alignItems:"flex-start",children:[t(Ap,{icon:hl,title:Ze.INBOUND,subTitle:Ze.INBOUND_DESCRIPTION(o),onRefresh:r,items:s?.inbound??[]}),t(Ap,{icon:ml,title:Ze.OUTBOUND,subTitle:Ze.OUTBOUND_DESCRIPTION(o),onRefresh:r,items:s?.outbound??[]})]})},Ap=({icon:n,title:o,subTitle:i,onRefresh:l,items:r})=>{const[s,d]=a(""),p=c(()=>r.filter(e=>e.serviceName.toLowerCase().includes(s.toLowerCase())),[r,s]);return e(Vt,{bgTint:"1000",richTitle:{icon:n,title:o,titleSize:Te.XS,subTitle:i,subTitleSize:Te.XXXS,badge:{label:r.length}},actions:[{id:"refresh",type:hn.Button,buttonProps:{variant:ve.Secondary,size:be.S,leftIcon:ll,onClick:l}}],children:[t(mn,{value:s,onChange:d,width:"100%"}),t(gn,{height:"calc(100vh - 284px)",gap:4,elements:p.length||s?!p.length&&s?[t(mt,{$height:"50vh",children:t(xe,{icon:n,title:Ze.NO_RESULTS,subTitle:Ze.NO_RESULTS_FOR_FILTER(s)})},"no-results")]:p.map(e=>t(Dp,{...e},`${o}-${e.serviceName}`)):[t(mt,{$height:"50vh",children:t(xe,{icon:n,title:`No ${o} connections yet`,subTitle:o===Ze.INBOUND?Ze.NO_INBOUND_CONNECTIONS_DESCRIPTION:Ze.NO_OUTBOUND_CONNECTIONS_DESCRIPTION})},"no-data")]})]})},Rp=b.div`
580
+ `,Dp=({language:n,containerName:o,otelDistroName:a,runningStartedTime:l,started:r,ready:s,restartCount:c,isCrashLoop:d,waitingReasonEnum:p,waitingMessage:u,odigosHealthStatus:h,k8sHealthStatus:m,processes:g,jumpToTarget:f})=>{const b=!!f,v=b&&!f?.processPid,{formatDurationAgo:y}=an(),C=ln(v),S=i(()=>({title:o,icon:n?un(n):fl,iconWithWrapper:!0}),[o,n]),x=i(()=>{const e=[],t=rn({status:a?sn.Success:sn.Disabled,reasonEnum:a?nt.INSTRUMENTED_WITH_DISTRO(a):nt.UNINSTRUMENTED,message:""});t&&e.push(t);const n=rn(h,sl,"health");n&&e.push(n);const o=rn(m,ml,"health");return o&&e.push(o),e},[m,h,a]),w=i(()=>[{id:"runningTime",title:nt.RUNNING_TIME,label:l?y(l,{style:"short"}):nt.NOT_RUNNING,labelTooltip:`${nt.RUNNING_TIME_TOOLTIP}. (${l})`},{id:"blank",spacer:!0},{id:"started",badge:{status:r?Pe.Success:Pe.Disabled,leftIcon:r?Xa:Ua,label:r?nt.STARTED:nt.NOT_STARTED,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"ready",badge:{status:s?Pe.Success:Pe.Disabled,leftIcon:s?Xa:Ua,label:s?nt.READY:nt.NOT_READY,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"isCrashLoop",badge:{status:d?Pe.Error:Pe.Success,leftIcon:d?Ua:Xa,label:d?nt.CRASHLOOP:nt.NO_CRASHLOOP,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"restartCount",title:nt.RESTARTS,badge:{status:c?Pe.Error:void 0,label:c||0,textSize:te.XXXS}}],[l,y,r,s,d,c]),T=i(()=>u?Xt(p):"",[u,p]);return t("div",{ref:C,children:e(Wt,{bgTint:"750",richTitle:S,badges:x,items:w,withCollapse:!0,collapseIsDefaultOpen:b,children:[u&&t(Rp,{children:e(oe,{$gap:10,$alignItems:"center",children:[t(nn,{variant:hn.Pink,leftIcon:ml,label:T}),t(ee,{size:te.XXXS,color:ne.Error,children:u})]})}),(g??[]).map((e,n)=>{const i=n+1,a=b&&(l=f,r=e,!!l?.processPid&&Sp({identifyingAttributes:r.identifyingAttributes})===l.processPid);var l,r;return t(wp,{...e,overrideProcessNum:i,isJumpToTarget:a},`pod-container-${o}-process-${i}`)})]})})},_p=({podName:e,namespace:n,hasRestarted:o})=>{const a=i(()=>({title:nt.DEBUG_COMMANDS,titleSize:te.XS}),[]),l=i(()=>[{label:nt.GET_POD_YAML,value:`kubectl get pod ${e} -n ${n} -o yaml`},{label:nt.DESCRIBE_POD,value:`kubectl describe pod ${e} -n ${n}`},{label:nt.GET_POD_LOGS,value:`kubectl logs ${e} -n ${n}${o?" -p":""}`}],[e,n,o]);return t(Wt,{bgTint:"800",richTitle:a,withCollapse:!0,children:l.map(({label:e,value:n})=>t(mn,{bgTint:"700",label:e,value:n},e))})},Pp=({source:o,onClickRestartPod:a})=>{const{jumpToTarget:l}=(()=>{const e=m(Op);if(!e)throw new Error("useJumpToTargetContext must be used within a JumpToTargetContextProvider");return e})(),r=l?.tab===gp.Pods?l:null,s=o?.pods??[],c=s.length>0,d=i(()=>s.some(e=>e.containers?.some(e=>e.restartCount&&e.restartCount>0)),[s]),p=i(()=>({title:nt.PODS,badge:{label:s.length}}),[s.length]);return t(ae,{$gap:12,children:c?e(n,{children:[t(vp,{podsOdigosHealthStatus:o.podsOdigosHealthStatus,pods:s}),t(Wt,{bgTint:"1000",richTitle:p,children:s.map(n=>{const i=r?.podName===n.podName,l=i&&!r?.containerName;return e(fp,{...n,namespace:o.id.namespace,onClickRestartPod:a,collapseIsDefaultOpen:i,isJumpToTarget:l,children:[t(_p,{podName:n.podName,namespace:o.id.namespace,hasRestarted:d}),t(Ap,{podContainers:n.containers,sourceContainers:o.containers,jumpToTarget:i?r:null})]},`pod-${n.podName}`)})})]}):t(ft,{$height:"70vh",children:t($e,{title:nt.NO_RUNNING_PODS,subTitle:nt.NO_RUNNING_PODS_SUBTITLE})})})},Lp="user",Fp=({source:n})=>{const o=i(()=>n.serviceName||n.id.name,[n]),{sourcesApi:a}=Gl(),{data:l,loading:r,refetch:s}=a.usePeerSources({serviceName:o},{fetchPolicy:"network-only"}),c=l?.peerSources??null;return!c||r?t(ft,r?{$height:"70vh",children:t(St,{withSpinner:!0})}:{$height:"70vh",children:t($e,{subTitle:nt.COULD_NOT_FETCH_PEER_SOURCES})}):e(oe,{$gap:16,$alignItems:"flex-start",children:[t(Mp,{icon:bl,title:nt.INBOUND,subTitle:nt.INBOUND_DESCRIPTION(o),onRefresh:s,items:c?.inbound??[]}),t(Mp,{icon:vl,title:nt.OUTBOUND,subTitle:nt.OUTBOUND_DESCRIPTION(o),onRefresh:s,items:c?.outbound??[]})]})},Mp=({icon:n,title:o,subTitle:a,onRefresh:r,items:s})=>{const[c,d]=l(""),p=i(()=>s.filter(e=>e.serviceName.toLowerCase().includes(c.toLowerCase())),[s,c]);return e(Wt,{bgTint:"1000",richTitle:{icon:n,title:o,titleSize:te.XS,subTitle:a,subTitleSize:te.XXXS,badge:{label:s.length}},actions:[{id:"refresh",type:gn.Button,buttonProps:{variant:Ie.Secondary,size:ke.S,leftIcon:pl,onClick:r}}],children:[t(fn,{value:c,onChange:d,width:"100%"}),t(bn,{height:"calc(100vh - 284px)",gap:4,elements:p.length||c?!p.length&&c?[t(ft,{$height:"50vh",children:t($e,{icon:n,title:nt.NO_RESULTS,subTitle:nt.NO_RESULTS_FOR_FILTER(c)})},"no-results")]:p.map(e=>t(Bp,{...e},`${o}-${e.serviceName}`)):[t(ft,{$height:"50vh",children:t($e,{icon:n,title:`No ${o} connections yet`,subTitle:o===nt.INBOUND?nt.NO_INBOUND_CONNECTIONS_DESCRIPTION:nt.NO_OUTBOUND_CONNECTIONS_DESCRIPTION})},"no-data")]})]})},zp=b.div`
582
581
  display: flex;
583
582
  align-items: center;
584
583
  justify-content: space-between;
@@ -592,20 +591,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
592
591
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
593
592
  }
594
593
  `}
595
- `,Dp=({serviceName:n,isVirtual:o,nodeAttributes:i})=>{const a=fn(e=>e.drawerEntityId),{items:l}=Vl().sourcesApi.useSources(),r=c(()=>l.find(e=>e.id.name===n||e.serviceName===n),[l,n]),s=c(()=>r&&JSON.stringify(bn(r))!==JSON.stringify(bn(a)),[r,a]),d=c(()=>{if(o){const e=Object.fromEntries((i??[]).map(({key:e,value:t})=>[e,t]));return[vn({serviceName:n,attributes:e})]}if(n?.toLowerCase()===Op)return[gl];const e=r?yn(r):void 0;return e?.length?e:[ul]},[o,i,n,r]),p=s?()=>{const{setDrawerType:e,setDrawerEntityId:t}=fn.getState();e(Sn(kt.Source)),t({namespace:r?.id.namespace??"",name:r?.id.name??"",kind:r?.id.kind??"",region:r?.id.region??""})}:void 0;return e(Rp,{onClick:p,$withClick:!!p,children:[e(pe,{$gap:8,children:[t(Cn,{icons:d}),t(_e,{size:Te.XXS,children:n})]}),o&&t(Ke,{status:Ee.Info,label:Ze.VIRTUAL,textSize:Te.XXXS,invertColors:!0,tooltip:Ze.VIRTUAL_TOOLTIP})]})},_p=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}},Pp=({source:n})=>{const o=v(),{k8sManifestApi:l}=Vl(),[r,s]=a(!0),[d,p]=a(void 0),[u,h]=a(!0),[m,g]=a(void 0),[f,b]=a(!0),[y,C]=a({}),S=n.pods??[],x=S.map(e=>e.podName).join(",");i(()=>{l.fetch({namespace:n.id.namespace,kind:n.id.kind,name:n.id.name}).then(({data:e})=>p(_p(e))).finally(()=>s(!1)),l.fetch({namespace:n.id.namespace,kind:xn.InstrumentationConfig,name:`${n.id.kind}-${n.id.name}`.toLowerCase()}).then(({data:e})=>g(_p(e))).finally(()=>h(!1))},[l,n.id.namespace,n.id.kind,n.id.name]),i(()=>{const e=x?x.split(","):[];if(0===e.length)return C({}),void b(!1);let t=!1;return b(!0),Promise.all(e.map(async e=>{const{data:t}=await l.fetch({namespace:n.id.namespace,kind:xn.Pod,name:e});return[e,_p(t)]})).then(e=>{t||C(Object.fromEntries(e))}).finally(()=>{t||b(!1)}),()=>{t=!0}},[l,n.id.namespace,x]);const w=c(()=>[{label:Ze.DESCRIBE_POD,value:`kubectl describe ${n.id.kind} ${n.id.name} -n ${n.id.namespace}`},{label:Ze.GET_POD_YAML,value:`kubectl get ${n.id.kind} ${n.id.name} -n ${n.id.namespace} -o yaml`},{label:Ze.GET_POD_YAML,value:`kubectl get ${xn.InstrumentationConfig} ${n.id.kind}-${n.id.name} -n ${n.id.namespace} -o yaml`}],[n.id.kind,n.id.name,n.id.namespace]);return e(Vt,{bgTint:"1000",children:[t(Vt,{bgTint:"900",richTitle:{icon:fl,title:Ze.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:w.map(({label:e,value:n},o)=>t(un,{label:e,value:n},`debug-cmd-${o}-${e}`))}),r?t(ht,{size:1}):t(Or,{bgTint:"800",codeBgColor:o.v2.colors.silver[900],title:`${n.id.kind} YAML`,yaml:d}),u?t(ht,{size:1}):t(Or,{bgTint:"800",codeBgColor:o.v2.colors.silver[900],title:"Instrumentation Config YAML",yaml:m}),S.map(e=>f?t(ht,{size:1},e.podName):t(Or,{bgTint:"800",codeBgColor:o.v2.colors.silver[900],title:`Pod ${e.podName} YAML`,yaml:y[e.podName]},e.podName))]})},Lp=({title:n,children:o})=>e(ee,{$gap:8,children:[t(_e,{size:Te.XXXS,color:Pe.Secondary,children:n}),o]}),Fp=({source:n})=>{const o=c(()=>{const[e,t]=Tn(n.telemetryMetrics?.[0]?.throughputBytes||0).split(" ");return{value:e,units:t}},[n]);return t(Lp,{title:Ze.THROUGHPUT_LAST_10_SECONDS,children:e(pe,{$alignItems:"flex-end",$gap:4,children:[t(_e,{size:Te.L,children:o.value}),t(_e,{size:Te.XS,variant:Et.Span,children:o.units})]})})},Mp=({source:n})=>{const{CopyButton:o}=_t();return t(Lp,{title:Ze.NAMESPACE,children:e(pe,{children:[t(Zt,{variant:pn.Blue,label:n.id.namespace}),t(o,{value:n.id.namespace,size:vt.XS})]})})},zp=({source:n})=>{const{CopyButton:o}=_t(),i=n.id.region;return i?t(Lp,{title:Ze.REGION,children:e(pe,{children:[t(Zt,{variant:pn.Blue,label:i}),t(o,{value:i,size:vt.XS})]})}):null},Bp=({source:e})=>{const n=e.markedForInstrumentation?.markedForInstrumentation??!1;return t(Lp,{title:Ze.ENABLED,children:t(pe,{children:t(Zt,{variant:n?pn.Green:pn.Default,label:n?Ze.ENABLED:Ze.DISABLED})})})},Xp=({source:e,label:n})=>t(Lp,{title:Ze.KIND,children:t(pe,{children:t(Zt,{variant:pn.Blue,label:n||e.id.kind})})}),Up=({source:n})=>{const{CopyButton:o}=_t();return t(Lp,{title:Ze.NAME,children:e(pe,{children:[t(Zt,{variant:pn.Blue,label:n.id.name}),t(o,{value:n.id.name,size:vt.XS})]})})},Vp=({source:n})=>{const{CopyButton:o}=_t(),i=n.serviceName||n.id.name;return t(Lp,{title:Ze.SERVICE_NAME,children:e(pe,{children:[t(Zt,{variant:pn.Blue,label:i}),t(o,{value:i,size:vt.XS})]})})},Hp=({source:n})=>{const{isVm:o,isConnector:i,isK8s:a}=S(),l=c(()=>wn(n.id.kind),[n.id.kind]);return t(Vt,{children:e(pe,{$gap:24,$alignItems:"flex-start",$justifyContent:"flex-start",$wrap:"wrap",children:[a&&t(Fp,{source:n}),a&&t(Mp,{source:n}),i&&t(zp,{source:n}),i&&t(Bp,{source:n}),t(Xp,{source:n,label:l}),t(Up,{source:n}),(i||o)&&t(Vp,{source:n})]})})},jp=({source:e})=>e.pods?.length&&e.podsOdigosHealthStatus?t(Vt,{bgTint:"900",children:t(pp,{podsOdigosHealthStatus:e.podsOdigosHealthStatus,pods:e.pods,noPadding:!0})}):null,Gp=({source:e})=>{const n=c(()=>e.workloadOdigosHealthStatus?{status:e.workloadOdigosHealthStatus.status?kn(e.workloadOdigosHealthStatus.status):Ee.Unknown,title:on(e.workloadOdigosHealthStatus.reasonEnum),subTitle:e.workloadOdigosHealthStatus.message}:null,[e]);return n?t(ln,{...n,width:"100%"}):null},Wp="100%",Kp=b(pe)`
596
- @media (max-width: 1099px) {
597
- flex-direction: column;
598
-
599
- & > * {
600
- width: 100%;
601
- }
602
- }
603
- `,Yp=(e,t)=>e?e.toLowerCase().includes(t.toLowerCase())?on(e):`${t} ${on(e)}`:t,Jp=b(pe)`
604
- width: fit-content;
605
- padding: 2px 6px;
606
- border-radius: 8px;
607
- background-color: ${({theme:e})=>e.v2.colors.silver[750]};
608
- `,qp=({overview:n,status:o})=>{const i=v(),a=n?[{id:"applied",count:n.totalAgentAppliedPods,ok:n.agentAppliedOk,label:"Agent applied"},{id:"out-of-date",count:n.totalAgentOutOfDatePods,ok:n.agentOutOfDateOk,label:"Agent out of date"},{id:"not-applied",count:n.totalAgentNotAppliedPods,ok:n.agentNotAppliedOk,label:"No agent applied"}].filter(({count:e})=>e>0):[];return a.length?t(Jp,{$gap:12,$wrap:"wrap",children:a.map(({id:a,count:l,ok:r,label:s})=>{const c=r?Ee.Success:o,d=Nn(c,i);return e(pe,{$gap:2,children:[t(d,{size:16,fill:In(i,c,"300")}),t(_e,{size:Te.XXXS,color:Pe.Secondary,children:`${l}/${n?.totalPods??0} ${s}`})]},a)})}):null},Zp=({changedTime:e})=>{const{formatTimeAgo:n}=en();return t(_e,{size:Te.XXXS,color:Pe.Disable,nowrap:!0,children:`Agent Assignment Updated · ${n(e)}`})},Qp=({source:n,onClickRollout:o,onClickRollback:i})=>{const a=n.rollout?.podsManifestInjectionStatus??n.conditions?.rollout,l=c(()=>{const{status:e,reasonEnum:i,message:l,actionItems:r}=a||{},s=rn(e);if(!s)return null;const c=Yp(i,Ze.ROLLOUT),d=l,p=(r??[]).flatMap(e=>[{"data-id":`rollout-action-${e.type}`,label:e.buttonText,hideTooltipIcon:!0,leftIcon:bl,onClick:o}]);return{status:s,title:c,subTitle:d,details:t(qp,{overview:n.rollout?.podsManifestInjectionOverview,status:s}),actionDetails:n.rollout?.agentsMetaHashChangedTime?t(Zp,{changedTime:n.rollout.agentsMetaHashChangedTime}):void 0,actionButtons:p}},[n.rollout,a,o]),r=c(()=>{const{status:e,reasonEnum:t,message:o,actionItems:a}=n.autoRollback?.autoRollbackStatus||{},l=rn(e);if(!l)return null;const r=Yp(t,Ze.ROLLBACK),s=o,c=(a??[]).flatMap(e=>[{"data-id":`rollback-action-${e.type}`,label:e.buttonText,hideTooltipIcon:!0,leftIcon:ll,onClick:i}]);return c.length||l===Ee.Success||c.push({"data-id":"rollback-action",label:Ze.ROLLBACK,tooltip:"Recover the workload from the last rollback",hideTooltipIcon:!0,leftIcon:ll,onClick:i}),{status:l,title:r,subTitle:s,actionButtons:c}},[n,i]);return l||r?e(Kp,{$gap:12,$alignItems:"stretch",children:[l&&t(ln,{invertColors:!0,slim:!0,width:r?"calc(60% - 6px)":Wp,...l}),r&&t(ln,{invertColors:!0,slim:!0,width:l?"calc(40% - 6px)":Wp,...r})]}):null},eu=h(null),tu=b.div`
594
+ `,Bp=({serviceName:n,isVirtual:o,nodeAttributes:a})=>{const l=vn(e=>e.drawerEntityId),{items:r}=Gl().sourcesApi.useSources(),s=i(()=>r.find(e=>e.id.name===n||e.serviceName===n),[r,n]),c=i(()=>s&&JSON.stringify(yn(s))!==JSON.stringify(yn(l)),[s,l]),d=i(()=>{if(o){const e=Object.fromEntries((a??[]).map(({key:e,value:t})=>[e,t]));return[Cn({serviceName:n,attributes:e})]}if(n?.toLowerCase()===Lp)return[yl];const e=s?Sn(s):void 0;return e?.length?e:[fl]},[o,a,n,s]),p=c?()=>{const{setDrawerType:e,setDrawerEntityId:t}=vn.getState();e(wn(Nt.Source)),t({namespace:s?.id.namespace??"",name:s?.id.name??"",kind:s?.id.kind??"",region:s?.id.region??""})}:void 0;return e(zp,{onClick:p,$withClick:!!p,children:[e(oe,{$gap:8,children:[t(xn,{icons:d}),t(ee,{size:te.XXS,children:n})]}),o&&t(ce,{status:Pe.Info,label:nt.VIRTUAL,textSize:te.XXXS,invertColors:!0,tooltip:nt.VIRTUAL_TOOLTIP})]})},Xp=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}},Up=({source:n})=>{const o=v(),{k8sManifestApi:r}=Gl(),[s,c]=l(!0),[d,p]=l(void 0),[u,h]=l(!0),[m,g]=l(void 0),[f,b]=l(!0),[y,C]=l({}),S=n.pods??[],x=S.map(e=>e.podName).join(",");a(()=>{r.fetch({namespace:n.id.namespace,kind:n.id.kind,name:n.id.name}).then(({data:e})=>p(Xp(e))).finally(()=>c(!1)),r.fetch({namespace:n.id.namespace,kind:Tn.InstrumentationConfig,name:`${n.id.kind}-${n.id.name}`.toLowerCase()}).then(({data:e})=>g(Xp(e))).finally(()=>h(!1))},[r,n.id.namespace,n.id.kind,n.id.name]),a(()=>{const e=x?x.split(","):[];if(0===e.length)return C({}),void b(!1);let t=!1;return b(!0),Promise.all(e.map(async e=>{const{data:t}=await r.fetch({namespace:n.id.namespace,kind:Tn.Pod,name:e});return[e,Xp(t)]})).then(e=>{t||C(Object.fromEntries(e))}).finally(()=>{t||b(!1)}),()=>{t=!0}},[r,n.id.namespace,x]);const w=i(()=>[{label:nt.DESCRIBE_POD,value:`kubectl describe ${n.id.kind} ${n.id.name} -n ${n.id.namespace}`},{label:nt.GET_POD_YAML,value:`kubectl get ${n.id.kind} ${n.id.name} -n ${n.id.namespace} -o yaml`},{label:nt.GET_POD_YAML,value:`kubectl get ${Tn.InstrumentationConfig} ${n.id.kind}-${n.id.name} -n ${n.id.namespace} -o yaml`}],[n.id.kind,n.id.name,n.id.namespace]);return e(Wt,{bgTint:"1000",children:[t(Wt,{bgTint:"900",richTitle:{icon:Cl,title:nt.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:w.map(({label:e,value:n},o)=>t(mn,{label:e,value:n},`debug-cmd-${o}-${e}`))}),s?t(re,{size:1}):t(Rr,{bgTint:"800",codeBgColor:o.v2.colors.silver[900],title:`${n.id.kind} YAML`,yaml:d}),u?t(re,{size:1}):t(Rr,{bgTint:"800",codeBgColor:o.v2.colors.silver[900],title:"Instrumentation Config YAML",yaml:m}),S.map(e=>f?t(re,{size:1},e.podName):t(Rr,{bgTint:"800",codeBgColor:o.v2.colors.silver[900],title:`Pod ${e.podName} YAML`,yaml:y[e.podName]},e.podName))]})},Vp=({title:n,children:o})=>e(ae,{$gap:8,children:[t(ee,{size:te.XXXS,color:ne.Secondary,children:n}),o]}),Hp=({source:n})=>{const o=i(()=>{const[e,t]=In(n.telemetryMetrics?.[0]?.throughputBytes||0).split(" ");return{value:e,units:t}},[n]);return t(Vp,{title:nt.THROUGHPUT_LAST_10_SECONDS,children:e(oe,{$alignItems:"flex-end",$gap:4,children:[t(ee,{size:te.L,children:o.value}),t(ee,{size:te.XS,variant:Ot.Span,children:o.units})]})})},jp=({source:n})=>{const{CopyButton:o}=Pt();return t(Vp,{title:nt.NAMESPACE,children:e(oe,{children:[t(nn,{variant:hn.Blue,label:n.id.namespace}),t(o,{value:n.id.namespace,size:Ct.XS})]})})},Gp=({source:n})=>{const{CopyButton:o}=Pt(),i=n.id.region;return i?t(Vp,{title:nt.REGION,children:e(oe,{children:[t(nn,{variant:hn.Blue,label:i}),t(o,{value:i,size:Ct.XS})]})}):null},Wp=({source:e})=>{const n=e.markedForInstrumentation?.markedForInstrumentation??!1;return t(Vp,{title:nt.ENABLED,children:t(oe,{children:t(nn,{variant:n?hn.Green:hn.Default,label:n?nt.ENABLED:nt.DISABLED})})})},Kp=({source:e,label:n})=>t(Vp,{title:nt.KIND,children:t(oe,{children:t(nn,{variant:hn.Blue,label:n||e.id.kind})})}),Yp=({source:n})=>{const{CopyButton:o}=Pt();return t(Vp,{title:nt.NAME,children:e(oe,{children:[t(nn,{variant:hn.Blue,label:n.id.name}),t(o,{value:n.id.name,size:Ct.XS})]})})},Jp=({source:n})=>{const{CopyButton:o}=Pt(),i=n.serviceName||n.id.name;return t(Vp,{title:nt.SERVICE_NAME,children:e(oe,{children:[t(nn,{variant:hn.Blue,label:i}),t(o,{value:i,size:Ct.XS})]})})},qp=({source:n})=>{const{isK8s:o,isConnector:a}=S(),l=i(()=>kn(n.id.kind),[n.id.kind]);return t(Wt,{children:e(oe,{$gap:24,$alignItems:"flex-start",$justifyContent:"flex-start",$wrap:"wrap",children:[o&&t(Hp,{source:n}),o&&t(jp,{source:n}),a&&t(Gp,{source:n}),a&&t(Wp,{source:n}),t(Kp,{source:n,label:l}),t(Yp,{source:n}),!o&&t(Jp,{source:n})]})})},Zp=({source:e})=>e.pods?.length&&e.podsOdigosHealthStatus?t(Wt,{bgTint:"900",children:t(vp,{podsOdigosHealthStatus:e.podsOdigosHealthStatus,pods:e.pods,noPadding:!0})}):null,Qp=({source:e})=>{const n=i(()=>e.workloadOdigosHealthStatus?{status:e.workloadOdigosHealthStatus.status?Nn(e.workloadOdigosHealthStatus.status):Pe.Unknown,title:Xt(e.workloadOdigosHealthStatus.reasonEnum),subTitle:e.workloadOdigosHealthStatus.message}:null,[e]);return n?t(Ut,{...n,width:"100%"}):null},eu=h(null),tu=b.div`
609
595
  position: relative;
610
596
  `,nu=({children:e})=>{const n=p(null);return t(tu,{ref:n,children:t(eu.Provider,{value:n,children:e})})},ou=b.div`
611
597
  position: fixed;
@@ -628,7 +614,18 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
628
614
  gap: 8px;
629
615
  `,au=b.div`
630
616
  flex: 1;
631
- `,lu=({width:n,onClose:o,onSave:i,saveTooltip:l,onDelete:r,deleteTooltip:s,title:c,subTitle:d,warning:p,children:u,pushButtonsWith:h})=>{const f=v(),b=m(eu),[y,C]=a(null);return En(b??{current:null},o),g(()=>{const e=b?.current?.getBoundingClientRect();e&&C({top:e.bottom+4,right:window.innerWidth-e.left-24})},[b]),y?_r(e(ou,{$coords:y,$width:n,"data-ignore-outside-click":"true",children:[e(ee,{$gap:4,children:[t(_e,{size:Te.XXS,children:c}),t(_e,{size:Te.XXXS,color:Pe.Secondary,children:d})]}),e(iu,{children:[t(au,{children:u}),e(pe,{$gap:8,$width:"fit-content",$margin:`0 0 ${h||0} 0`,children:[t(fe,{variant:ve.Secondary,onClick:r,leftIcon:Aa,tooltip:s,hideTooltipIcon:!0,iconSize:16,size:be.S,textColor:f.v2.colors.red[500]}),t(fe,{variant:ve.Primary,onClick:i,leftIcon:Wa,tooltip:l,hideTooltipIcon:!0,iconSize:16,size:be.S})]})]}),t("div",{children:t(Ne,{status:Ee.Warning,message:p})})]}),document.body):null},ru=({language:n,overridden:o,onOverride:i,defaultValues:l})=>{const{tier:r}=S(),{formData:s,handleFormChange:d,resetFormData:p}=Gt(l),u=c(()=>{if(!n)return[];const e=On[n].community,t=r===It.Onprem?On[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]=a(!1),[g,f]=a(!1),b=()=>{h||(g&&p(),f(e=>!e))};return e(pe,{$gap:4,$alignItems:"center",children:[o?t(Ke,{status:Ee.Info,invertColors:!0,label:Ze.OVERIDDEN}):null,e(nu,{children:[t(Fe,{text:Ze.OVERRIDE_OTEL_DISTRO_NAME,children:t(bt,{icon:Ma,onClick:b})}),g&&t(lu,{width:"500px",onClose:b,onSave:async()=>{m(!0),await i(s),m(!1),b()},saveTooltip:Ze.OVERRIDE_OTEL_DISTRO_NAME_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await i({otelDistroName:null}),m(!1),b()},deleteTooltip:Ze.OVERRIDE_OTEL_DISTRO_NAME_DELETE_TOOLTIP,title:Ze.OVERRIDE_OTEL_DISTRO_NAME,subTitle:Ze.OVERRIDE_OTEL_DISTRO_NAME_SUBTITLE,warning:Ze.OVERRIDE_OTEL_DISTRO_NAME_WARNING,children:t(ft,{label:Ze.OTEL_DISTRO_NAME,options:u,values:s.otelDistroName?[s.otelDistroName]:[],setValues:e=>d("otelDistroName",e[0])})})]})]})},su=({overridden:n,onOverride:o,defaultValues:i,originalValues:l})=>{const{addNotification:r}=qt(),{formData:s,handleFormChange:d,resetFormData:p}=Gt(i),u=c(()=>$n.map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})),[]),[h,m]=a(!1),[g,f]=a(!1),b=()=>{h||(g&&p(),f(e=>!e))};return e(pe,{children:[n?t(Ke,{status:Ee.Info,invertColors:!0,label:Ze.OVERIDDEN}):null,e(nu,{children:[t(Fe,{text:Ze.OVERRIDE_RUNTIME_DETAILS,children:t(bt,{icon:Ma,onClick:b})}),g&&t(lu,{width:"500px",onClose:b,onSave:async()=>{!s.version||An(s.version)?(m(!0),await o(s),m(!1),b()):r({type:Ee.Warning,message:He.INVALID_VERSION,hideFromHistory:!0})},saveTooltip:Ze.OVERRIDE_RUNTIME_DETAILS_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await o({language:null,version:""}),m(!1),b()},deleteTooltip:Ze.OVERRIDE_RUNTIME_DETAILS_DELETE_TOOLTIP,title:Ze.OVERRIDE_RUNTIME_DETAILS,subTitle:Ze.OVERRIDE_RUNTIME_DETAILS_SUBTITLE,warning:Ze.OVERRIDE_RUNTIME_WARNING,pushButtonsWith:"20px",children:e(pe,{$gap:8,children:[t(ft,{label:Ze.LANGUAGE,options:u,values:s.language?[s.language]:[],setValues:e=>d("language",e[0]),helpMessage:`Auto-detected: ${l.language||"none"}`}),t(ye,{label:Ze.RUNTIME_VERSION,placeholder:Ze.VERSION_PLACEHOLDER,value:s.version,onChange:e=>d("version",e.target.value),helpMessage:`Auto-detected: ${l.version||"none"}`})]})})]})]})},cu=({source:e})=>{const{isVm:n}=S(),{containers:o,containersRichTitle:i}=c(()=>{const t=e?.conditions?.runtimeDetection;return{containers:e?.containers??[],containersRichTitle:{title:n?Ze.DETECTED_PROCESSES:`${e.id.kind} ${Ze.CONTAINERS}`,tooltip:t?.message||(n?Ze.DETECTED_PROCESSES_DESCRIPTION:Ze.DETECTED_CONTAINERS_DESCRIPTION),badge:rn(t?.status)===Ee.Loading?{status:Ee.Loading,backgroundColor:"transparent"}:{label:e?.containers?.length}}}},[e,n]);return t(Vt,{bgTint:"1000",richTitle:i,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(ee,{$gap:8,children:o.map(n=>n&&t(hu,{...n,sourceId:e.id},`source-container-${n.containerName}`))})})},du=b.div`
617
+ `,lu=({width:n,onClose:o,onSave:i,saveTooltip:a,onDelete:r,deleteTooltip:s,title:c,subTitle:d,warning:p,children:u,pushButtonsWith:h})=>{const f=v(),b=m(eu),[y,C]=l(null);return En(b??{current:null},o),g(()=>{const e=b?.current?.getBoundingClientRect();e&&C({top:e.bottom+4,right:window.innerWidth-e.left-24})},[b]),y?Fr(e(ou,{$coords:y,$width:n,"data-ignore-outside-click":"true",children:[e(ae,{$gap:4,children:[t(ee,{size:te.XXS,children:c}),t(ee,{size:te.XXXS,color:ne.Secondary,children:d})]}),e(iu,{children:[t(au,{children:u}),e(oe,{$gap:8,$width:"fit-content",$margin:`0 0 ${h||0} 0`,children:[t(Te,{variant:Ie.Secondary,onClick:r,leftIcon:Ma,tooltip:s,hideTooltipIcon:!0,iconSize:16,size:ke.S,textColor:f.v2.colors.red[500]}),t(Te,{variant:Ie.Primary,onClick:i,leftIcon:Za,tooltip:a,hideTooltipIcon:!0,iconSize:16,size:ke.S})]})]}),t("div",{children:t(_e,{status:Pe.Warning,message:p})})]}),document.body):null},ru=({language:n,overridden:o,onOverride:a,defaultValues:r})=>{const{tier:s}=S(),{formData:c,handleFormChange:d,resetFormData:p}=Jt(r),u=i(()=>{if(!n)return[];const e=On[n].community,t=s===$n.Onprem?On[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,s]),[h,m]=l(!1),[g,f]=l(!1),b=()=>{h||(g&&p(),f(e=>!e))};return e(oe,{$gap:4,$alignItems:"center",children:[o?t(ce,{status:Pe.Info,invertColors:!0,label:nt.OVERIDDEN}):null,e(nu,{children:[t(Ue,{text:nt.OVERRIDE_OTEL_DISTRO_NAME,children:t(yt,{icon:ja,onClick:b})}),g&&t(lu,{width:"500px",onClose:b,onSave:async()=>{m(!0),await a(c),m(!1),b()},saveTooltip:nt.OVERRIDE_OTEL_DISTRO_NAME_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await a({otelDistroName:null}),m(!1),b()},deleteTooltip:nt.OVERRIDE_OTEL_DISTRO_NAME_DELETE_TOOLTIP,title:nt.OVERRIDE_OTEL_DISTRO_NAME,subTitle:nt.OVERRIDE_OTEL_DISTRO_NAME_SUBTITLE,warning:nt.OVERRIDE_OTEL_DISTRO_NAME_WARNING,children:t(vt,{label:nt.OTEL_DISTRO_NAME,options:u,values:c.otelDistroName?[c.otelDistroName]:[],setValues:e=>d("otelDistroName",e[0])})})]})]})},su=({overridden:n,onOverride:o,defaultValues:a,originalValues:r})=>{const{addNotification:s}=tn(),{formData:c,handleFormChange:d,resetFormData:p}=Jt(a),u=i(()=>An.map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})),[]),[h,m]=l(!1),[g,f]=l(!1),b=()=>{h||(g&&p(),f(e=>!e))};return e(oe,{children:[n?t(ce,{status:Pe.Info,invertColors:!0,label:nt.OVERIDDEN}):null,e(nu,{children:[t(Ue,{text:nt.OVERRIDE_RUNTIME_DETAILS,children:t(yt,{icon:ja,onClick:b})}),g&&t(lu,{width:"500px",onClose:b,onSave:async()=>{!c.version||Rn(c.version)?(m(!0),await o(c),m(!1),b()):s({type:Pe.Warning,message:Ye.INVALID_VERSION,hideFromHistory:!0})},saveTooltip:nt.OVERRIDE_RUNTIME_DETAILS_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await o({language:null,version:""}),m(!1),b()},deleteTooltip:nt.OVERRIDE_RUNTIME_DETAILS_DELETE_TOOLTIP,title:nt.OVERRIDE_RUNTIME_DETAILS,subTitle:nt.OVERRIDE_RUNTIME_DETAILS_SUBTITLE,warning:nt.OVERRIDE_RUNTIME_WARNING,pushButtonsWith:"20px",children:e(oe,{$gap:8,children:[t(vt,{label:nt.LANGUAGE,options:u,values:c.language?[c.language]:[],setValues:e=>d("language",e[0]),helpMessage:`Auto-detected: ${r.language||"none"}`}),t(Ne,{label:nt.RUNTIME_VERSION,placeholder:nt.VERSION_PLACEHOLDER,value:c.version,onChange:e=>d("version",e.target.value),helpMessage:`Auto-detected: ${r.version||"none"}`})]})})]})]})},cu=b.div`
618
+ display: flex;
619
+ flex-direction: column;
620
+ gap: 10px;
621
+ padding: 10px 12px 10px 20px;
622
+ border-radius: 8px;
623
+ background-color: ${({theme:e})=>e.v2.colors.silver[800]};
624
+ `,du=b.div`
625
+ display: flex;
626
+ flex-wrap: wrap;
627
+ gap: 12px 24px;
628
+ `,pu=({title:n,children:o})=>e(ae,{$gap:4,children:[t(ee,{size:te.XXXS,color:ne.Secondary,children:n}),o]}),uu=({processes:n})=>{const o=i(()=>[...n].sort((e,t)=>e.pid-t.pid),[n]);return o.length?e(ae,{$gap:6,children:[t(ee,{size:te.XXXS,color:ne.Secondary,children:`${nt.PROCESSES} (${o.length})`}),o.map(n=>{const o=n.exe?.trim()||null,i=n.cmdline?.trim()||null;return e(cu,{children:[t(du,{children:t(pu,{title:nt.PROCESS_PID,children:t(ee,{size:te.XS,children:String(n.pid)})})}),o?t(mn,{label:nt.EXECUTABLE,value:o,bgTint:"900"}):null,i&&i!==o?t(mn,{label:nt.COMMAND,value:i,bgTint:"900"}):null]},n.pid)})]}):null},hu=b.div`
632
629
  display: flex;
633
630
  flex-direction: column;
634
631
  align-self: stretch;
@@ -636,32 +633,27 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
636
633
  padding: 8px 12px;
637
634
  border-radius: 8px;
638
635
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
639
- `,pu=b.div`
636
+ `,mu=b.div`
640
637
  display: flex;
641
638
  align-items: center;
642
639
  justify-content: center;
643
640
  padding: 8px;
644
641
  border-radius: 10px;
645
642
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
646
- `,uu=b.div`
647
- display: flex;
648
- flex-direction: column;
649
- gap: 12px;
650
- padding: 8px 12px;
651
- border-radius: 8px;
652
- background-color: ${({theme:e})=>e.v2.colors.silver[800]};
653
- `,hu=({sourceId:n,...o})=>{const{containerName:i,runtimeInfo:a,agentEnabled:l,overrides:r}=o,s=v(),{sourcesApi:d}=Vl(),p=c(()=>!!r?.runtimeInfo?.language||!!r?.runtimeInfo?.runtimeVersion,[r]),u=c(()=>({language:cn(o),version:Rn(o)||void 0}),[o]),h=c(()=>!!r?.otelDistroName,[r]),m=c(()=>({otelDistroName:r?.otelDistroName||o.agentEnabled?.otelDistroName}),[r,o]),g=c(()=>!a&&!p,[a,p]),f=c(()=>g?ul:dn(u.language),[g,u]),b=c(()=>{if(g)return"";const{language:e,version:t}=u;return`${e}${t?` • ${t}`:""}`},[g,u]),y=c(()=>g?{status:Ee.Loading,label:Ze.WAITING_FOR_RUNTIME_DETECTION}:{status:l?.otelDistroName?Ee.Success:Ee.Disabled,leftIcon:l?.otelDistroName?_a:Pa,label:l?.otelDistroName?`Instrumented | ${l.otelDistroName}`:"Uninstrumented",tooltip:l?.agentEnabledStatus?.message},[g,l]),C=e=>d.update(n,{containerName:i,...h?m:{},...p?u:{},...e}),S=c(()=>{const e=[];return o.agentConfig?.traces?.headSampling?.noisyOperations?.length&&e.push(Ze.HEAD_SAMPLING),(o.collectorConfig?.tailSampling?.noisyOperations?.length||o.collectorConfig?.tailSampling?.highlyRelevantOperations?.length||o.collectorConfig?.tailSampling?.costReductionRules?.length)&&e.push(Ze.TAIL_SAMPLING),e},[o]);return e(du,{children:[e(pe,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(pe,{$gap:8,$alignItems:"center",children:[t(pu,{children:t(f,{size:24,fill:a?void 0:s.v2.colors.grey[400]})}),t(_e,{children:i}),t(Zt,b?{variant:pn.Blue,label:b}:{variant:pn.Loader,label:Ze.DETECTING_RUNTIME_INFO}),t(su,{overridden:p,onOverride:C,defaultValues:u,originalValues:{language:o.runtimeInfo?.language,version:o.runtimeInfo?.runtimeVersion||""}})]}),e(pe,{$gap:8,$alignItems:"center",children:[t(Ke,{...y,textSize:Te.XXXS}),t(ru,{language:u.language,overridden:h,onOverride:C,defaultValues:m})]})]}),!l||l.agentEnabled||g?null:t(uu,{children:e(pe,{$gap:10,$alignItems:"center",children:[t(Zt,{variant:pn.Pink,label:on(l.agentEnabledStatus?.reasonEnum)||Ze.NO_AVAILABLE_AGENT}),t(_e,{size:Te.XXXS,color:Pe.Secondary,children:l?.agentEnabledStatus?.message})]})}),S.length>0&&t(uu,{children:t(pe,{$gap:16,$wrap:"wrap",children:S.map((e,n)=>t(Ke,{label:e,leftIcon:_a,status:Ee.Success,invertColors:!0,useSecondaryTone:!0},`${i}-rule-${n}`))})})]})},mu=b.div`
654
- display: flex;
655
- flex-direction: column;
656
- gap: 10px;
657
- padding: 10px 12px 10px 20px;
643
+ `,gu=e=>{if(!e)return Dn.Unknown;const t=e.trim().toLowerCase();return{go:Dn.Go,golang:Dn.Go,javascript:Dn.JavaScript,js:Dn.JavaScript,node:Dn.JavaScript,nodejs:Dn.JavaScript,typescript:Dn.JavaScript,python:Dn.Python,java:Dn.Java,dotnet:Dn.DotNet,csharp:Dn.CSharp,php:Dn.Php,ruby:Dn.Ruby,rust:Dn.Rust,swift:Dn.Swift,elixir:Dn.Elixir}[t]??Dn.Unknown},fu=({source:n})=>{const o=v(),{isK8s:a,isVm:l}=S(),{sourcesApi:r}=Gl(),s=n.instrumentationReport,c=n.sourceConfig,d=l?s?.processes:null,p=i(()=>!(!c?.runtimeOverride?.language&&!c?.runtimeOverride?.version),[c]),u=i(()=>{const e=gu(s?.runtimeLanguage);return e!==Dn.Unknown?e:n.runtimeInfo?.detectedLanguages?.[0]??Dn.Unknown},[s?.runtimeLanguage,n.runtimeInfo?.detectedLanguages]),h=s?.runtimeVersion?.trim()||"",m=i(()=>{const e=gu(c?.runtimeOverride?.language);return{language:e!==Dn.Unknown?e:u,version:c?.runtimeOverride?.version?.trim()||h||void 0}},[c,u,h]),g=i(()=>!!c?.distroOverride?.otelDistroName,[c]),f=i(()=>({otelDistroName:c?.distroOverride?.otelDistroName||void 0}),[c]),b=i(()=>{const{language:e,version:t}=m;return e!==Dn.Unknown||t?e!==Dn.Unknown&&t?`${e} • ${t}`:e!==Dn.Unknown?e:t||null:null},[m]),y=!b&&!p&&"Instrumenting"===s?.state,C=i(()=>y||m.language===Dn.Unknown?fl:un(m.language),[y,m.language]),x=i(()=>{const e=s?.state??"",t=s?.instrumented||"Instrumented"===e,n=c?.distroOverride?.otelDistroName?.trim()||s?.sdkType?.trim();return"Instrumenting"===e?{status:Pe.Loading,label:Xt(s?.progressStage||e)||e}:"NotImplemented"===e||"Unsupported"===e?{status:Pe.Disabled,leftIcon:Ua,label:Xt(e)||e}:"Error"===e?{status:Pe.Error,leftIcon:Ua,label:"Error"}:t?{status:Pe.Success,leftIcon:Xa,label:n?`Instrumented | ${n}`:"Instrumented"}:{status:Pe.Disabled,leftIcon:Ua,label:nt.UNINSTRUMENTED}},[s,c]),w=e=>r.update(n.id,{...g?f:{},...p?{language:m.language!==Dn.Unknown?m.language:void 0,version:m.version}:{},...e});return a?null:s?t(Wt,{bgTint:"1000",richTitle:{title:nt.INSTRUMENTATION,tooltip:nt.INSTRUMENTATION_DESCRIPTION,badge:{label:1}},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(ae,{$gap:8,children:e(hu,{children:[e(oe,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(oe,{$gap:8,$alignItems:"center",children:[t(mu,{children:t(C,{size:24,fill:y||m.language===Dn.Unknown?o.v2.colors.grey[400]:void 0})}),t(ee,{children:n.id.name}),y?t(nn,{variant:hn.Loader,label:nt.DETECTING_RUNTIME_INFO}):b?t(nn,{variant:hn.Blue,label:b}):null,t(su,{overridden:p,onOverride:w,defaultValues:{language:m.language!==Dn.Unknown?m.language:void 0,version:m.version||""},originalValues:{language:u!==Dn.Unknown?u:void 0,version:h}})]}),e(oe,{$gap:8,$alignItems:"center",children:[t(ce,{...x,textSize:te.XXXS}),t(ru,{language:m.language!==Dn.Unknown?m.language:null,overridden:g,onOverride:w,defaultValues:f})]})]}),d?.length?t(uu,{processes:d}):null]})})}):null},bu="100%",vu=b(oe)`
644
+ @media (max-width: 1099px) {
645
+ flex-direction: column;
646
+
647
+ & > * {
648
+ width: 100%;
649
+ }
650
+ }
651
+ `,yu=(e,t)=>e?e.toLowerCase().includes(t.toLowerCase())?Xt(e):`${t} ${Xt(e)}`:t,Cu=b(oe)`
652
+ width: fit-content;
653
+ padding: 2px 6px;
658
654
  border-radius: 8px;
659
- background-color: ${({theme:e})=>e.v2.colors.silver[800]};
660
- `,gu=b.div`
661
- display: flex;
662
- flex-wrap: wrap;
663
- gap: 12px 24px;
664
- `,fu=({title:n,children:o})=>e(ee,{$gap:4,children:[t(_e,{size:Te.XXXS,color:Pe.Secondary,children:n}),o]}),bu=({processes:n})=>{const o=c(()=>[...n].sort((e,t)=>e.pid-t.pid),[n]);return o.length?e(ee,{$gap:6,children:[t(_e,{size:Te.XXXS,color:Pe.Secondary,children:`${Ze.PROCESSES} (${o.length})`}),o.map(n=>{const o=n.exe?.trim()||null,i=n.cmdline?.trim()||null;return e(mu,{children:[t(gu,{children:t(fu,{title:Ze.PROCESS_PID,children:t(_e,{size:Te.XS,children:String(n.pid)})})}),o?t(un,{label:Ze.EXECUTABLE,value:o,bgTint:"900"}):null,i&&i!==o?t(un,{label:Ze.COMMAND,value:i,bgTint:"900"}):null]},n.pid)})]}):null},vu=b.div`
655
+ background-color: ${({theme:e})=>e.v2.colors.silver[750]};
656
+ `,Su=({overview:n,status:o})=>{const i=v(),a=n?[{id:"applied",count:n.totalAgentAppliedPods,ok:n.agentAppliedOk,label:"Agent applied"},{id:"out-of-date",count:n.totalAgentOutOfDatePods,ok:n.agentOutOfDateOk,label:"Agent out of date"},{id:"not-applied",count:n.totalAgentNotAppliedPods,ok:n.agentNotAppliedOk,label:"No agent applied"}].filter(({count:e})=>e>0):[];return a.length?t(Cu,{$gap:12,$wrap:"wrap",children:a.map(({id:a,count:l,ok:r,label:s})=>{const c=r?Pe.Success:o,d=Pn(c,i);return e(oe,{$gap:2,children:[t(d,{size:16,fill:_n(i,c,"300")}),t(ee,{size:te.XXXS,color:ne.Secondary,children:`${l}/${n?.totalPods??0} ${s}`})]},a)})}):null},xu=({changedTime:e})=>{const{formatTimeAgo:n}=an();return t(ee,{size:te.XXXS,color:ne.Disable,nowrap:!0,children:`Agent Assignment Updated · ${n(e)}`})},wu=({source:n,onClickRollout:o,onClickRollback:a})=>{const l=n.rollout?.podsManifestInjectionStatus??n.conditions?.rollout,r=i(()=>{const{status:e,reasonEnum:i,message:a,actionItems:r}=l||{},s=cn(e);if(!s)return null;const c=yu(i,nt.ROLLOUT),d=a,p=(r??[]).flatMap(e=>[{"data-id":`rollout-action-${e.type}`,label:e.buttonText,hideTooltipIcon:!0,leftIcon:Sl,onClick:o}]);return{status:s,title:c,subTitle:d,details:t(Su,{overview:n.rollout?.podsManifestInjectionOverview,status:s}),actionDetails:n.rollout?.agentsMetaHashChangedTime?t(xu,{changedTime:n.rollout.agentsMetaHashChangedTime}):void 0,actionButtons:p}},[n.rollout,l,o]),s=i(()=>{const{status:e,reasonEnum:t,message:o,actionItems:i}=n.autoRollback?.autoRollbackStatus||{},l=cn(e);if(!l)return null;const r=yu(t,nt.ROLLBACK),s=o,c=(i??[]).flatMap(e=>[{"data-id":`rollback-action-${e.type}`,label:e.buttonText,hideTooltipIcon:!0,leftIcon:pl,onClick:a}]);return c.length||l===Pe.Success||c.push({"data-id":"rollback-action",label:nt.ROLLBACK,tooltip:"Recover the workload from the last rollback",hideTooltipIcon:!0,leftIcon:pl,onClick:a}),{status:l,title:r,subTitle:s,actionButtons:c}},[n,a]);return r||s?e(vu,{$gap:12,$alignItems:"stretch",children:[r&&t(Ut,{invertColors:!0,slim:!0,width:s?"calc(60% - 6px)":bu,...r}),s&&t(Ut,{invertColors:!0,slim:!0,width:r?"calc(40% - 6px)":bu,...s})]}):null},Tu=({source:e})=>{const{isK8s:n}=S(),{containers:o,containersRichTitle:a}=i(()=>{const t=e?.conditions?.runtimeDetection;return{containers:e?.containers??[],containersRichTitle:{title:n?`${e.id.kind} ${nt.CONTAINERS}`:nt.DETECTED_PROCESSES,tooltip:t?.message||(n?nt.DETECTED_CONTAINERS_DESCRIPTION:nt.DETECTED_PROCESSES_DESCRIPTION),badge:cn(t?.status)===Pe.Loading?{status:Pe.Loading,backgroundColor:"transparent"}:{label:e?.containers?.length}}}},[e,n]);return t(Wt,{bgTint:"1000",richTitle:a,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(ae,{$gap:8,children:o.map(n=>n&&t(Eu,{...n,sourceId:e.id},`source-container-${n.containerName}`))})})},ku=b.div`
665
657
  display: flex;
666
658
  flex-direction: column;
667
659
  align-self: stretch;
@@ -669,19 +661,26 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
669
661
  padding: 8px 12px;
670
662
  border-radius: 8px;
671
663
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
672
- `,yu=b.div`
664
+ `,Iu=b.div`
673
665
  display: flex;
674
666
  align-items: center;
675
667
  justify-content: center;
676
668
  padding: 8px;
677
669
  border-radius: 10px;
678
670
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
679
- `,Cu=e=>{if(!e)return Dn.Unknown;const t=e.trim().toLowerCase();return{go:Dn.Go,golang:Dn.Go,javascript:Dn.JavaScript,js:Dn.JavaScript,node:Dn.JavaScript,nodejs:Dn.JavaScript,typescript:Dn.JavaScript,python:Dn.Python,java:Dn.Java,dotnet:Dn.DotNet,csharp:Dn.CSharp,php:Dn.Php,ruby:Dn.Ruby,rust:Dn.Rust,swift:Dn.Swift,elixir:Dn.Elixir}[t]??Dn.Unknown},Su=({source:n})=>{const o=v(),{isConnector:i,isVm:a}=S(),{sourcesApi:l}=Vl(),r=n.instrumentationReport,s=n.sourceConfig,d=a?r?.processes:null,p=c(()=>!(!s?.runtimeOverride?.language&&!s?.runtimeOverride?.version),[s]),u=c(()=>{const e=Cu(r?.runtimeLanguage);return e!==Dn.Unknown?e:n.runtimeInfo?.detectedLanguages?.[0]??Dn.Unknown},[r?.runtimeLanguage,n.runtimeInfo?.detectedLanguages]),h=r?.runtimeVersion?.trim()||"",m=c(()=>{const e=Cu(s?.runtimeOverride?.language);return{language:e!==Dn.Unknown?e:u,version:s?.runtimeOverride?.version?.trim()||h||void 0}},[s,u,h]),g=c(()=>!!s?.distroOverride?.otelDistroName,[s]),f=c(()=>({otelDistroName:s?.distroOverride?.otelDistroName||void 0}),[s]),b=c(()=>{const{language:e,version:t}=m;return e!==Dn.Unknown||t?e!==Dn.Unknown&&t?`${e} • ${t}`:e!==Dn.Unknown?e:t||null:null},[m]),y=!b&&!p&&"Instrumenting"===r?.state,C=c(()=>y||m.language===Dn.Unknown?ul:dn(m.language),[y,m.language]),x=c(()=>{const e=r?.state??"",t=r?.instrumented||"Instrumented"===e,n=s?.distroOverride?.otelDistroName?.trim()||r?.sdkType?.trim();return"Instrumenting"===e?{status:Ee.Loading,label:on(r?.progressStage||e)||e}:"NotImplemented"===e||"Unsupported"===e?{status:Ee.Disabled,leftIcon:Pa,label:on(e)||e}:"Error"===e?{status:Ee.Error,leftIcon:Pa,label:"Error"}:t?{status:Ee.Success,leftIcon:_a,label:n?`Instrumented | ${n}`:"Instrumented"}:{status:Ee.Disabled,leftIcon:Pa,label:Ze.UNINSTRUMENTED}},[r,s]),w=e=>l.update(n.id,{...g?f:{},...p?{language:m.language!==Dn.Unknown?m.language:void 0,version:m.version}:{},...e});return(i||a)&&r?t(Vt,{bgTint:"1000",richTitle:{title:Ze.INSTRUMENTATION,tooltip:Ze.INSTRUMENTATION_DESCRIPTION,badge:{label:1}},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(ee,{$gap:8,children:e(vu,{children:[e(pe,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(pe,{$gap:8,$alignItems:"center",children:[t(yu,{children:t(C,{size:24,fill:y||m.language===Dn.Unknown?o.v2.colors.grey[400]:void 0})}),t(_e,{children:n.id.name}),y?t(Zt,{variant:pn.Loader,label:Ze.DETECTING_RUNTIME_INFO}):b?t(Zt,{variant:pn.Blue,label:b}):null,t(su,{overridden:p,onOverride:w,defaultValues:{language:m.language!==Dn.Unknown?m.language:void 0,version:m.version||""},originalValues:{language:u!==Dn.Unknown?u:void 0,version:h}})]}),e(pe,{$gap:8,$alignItems:"center",children:[t(Ke,{...x,textSize:Te.XXXS}),t(ru,{language:m.language!==Dn.Unknown?m.language:null,overridden:g,onOverride:w,defaultValues:f})]})]}),d?.length?t(bu,{processes:d}):null]})})}):null},xu=({source:n,onClickRollout:o,onClickRollback:i})=>{const{isK8s:a,isConnector:l,isVm:r}=S();return e(ee,{$gap:12,children:[t(Hp,{source:n}),t(Gp,{source:n}),a&&t(Qp,{source:n,onClickRollout:o,onClickRollback:i}),a&&t(cu,{source:n}),(l||r)&&t(Su,{source:n}),a&&t(jp,{source:n})]})},wu=({source:e})=>{const n=e.containers||[];return t(Vt,{bgTint:"1000",richTitle:{title:Ze.INSTRUMENTED_LIBRARIES},children:n.length?n.map(e=>{const n=e.instrumentations||[];return t(Vt,{bgTint:"800",richTitle:{title:e.containerName,badge:{label:n.length}},withCollapse:!0,collapseIsDefaultOpen:!!n?.length,children:n?.length?t(ee,{children:n.map((e,n)=>t(Sp,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},`instr-${n}-${e.name}`))}):t(xe,{title:"No libraries found"})},e.containerName)}):t(xe,{title:"No containers found"})})},Tu=b(ee)`
671
+ `,Nu=b.div`
672
+ display: flex;
673
+ flex-direction: column;
674
+ gap: 12px;
675
+ padding: 8px 12px;
676
+ border-radius: 8px;
677
+ background-color: ${({theme:e})=>e.v2.colors.silver[800]};
678
+ `,Eu=({sourceId:n,...o})=>{const{containerName:a,runtimeInfo:l,agentEnabled:r,overrides:s}=o,c=v(),{sourcesApi:d}=Gl(),p=i(()=>!!s?.runtimeInfo?.language||!!s?.runtimeInfo?.runtimeVersion,[s]),u=i(()=>({language:pn(o),version:Ln(o)||void 0}),[o]),h=i(()=>!!s?.otelDistroName,[s]),m=i(()=>({otelDistroName:s?.otelDistroName||o.agentEnabled?.otelDistroName}),[s,o]),g=i(()=>!l&&!p,[l,p]),f=i(()=>g?fl:un(u.language),[g,u]),b=i(()=>{if(g)return"";const{language:e,version:t}=u;return`${e}${t?` • ${t}`:""}`},[g,u]),y=i(()=>g?{status:Pe.Loading,label:nt.WAITING_FOR_RUNTIME_DETECTION}:{status:r?.otelDistroName?Pe.Success:Pe.Disabled,leftIcon:r?.otelDistroName?Xa:Ua,label:r?.otelDistroName?`Instrumented | ${r.otelDistroName}`:"Uninstrumented",tooltip:r?.agentEnabledStatus?.message},[g,r]),C=e=>d.update(n,{containerName:a,...h?m:{},...p?u:{},...e}),S=i(()=>{const e=[];return o.agentConfig?.traces?.headSampling?.noisyOperations?.length&&e.push(nt.HEAD_SAMPLING),(o.collectorConfig?.tailSampling?.noisyOperations?.length||o.collectorConfig?.tailSampling?.highlyRelevantOperations?.length||o.collectorConfig?.tailSampling?.costReductionRules?.length)&&e.push(nt.TAIL_SAMPLING),e},[o]);return e(ku,{children:[e(oe,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(oe,{$gap:8,$alignItems:"center",children:[t(Iu,{children:t(f,{size:24,fill:l?void 0:c.v2.colors.grey[400]})}),t(ee,{children:a}),t(nn,b?{variant:hn.Blue,label:b}:{variant:hn.Loader,label:nt.DETECTING_RUNTIME_INFO}),t(su,{overridden:p,onOverride:C,defaultValues:u,originalValues:{language:o.runtimeInfo?.language,version:o.runtimeInfo?.runtimeVersion||""}})]}),e(oe,{$gap:8,$alignItems:"center",children:[t(ce,{...y,textSize:te.XXXS}),t(ru,{language:u.language,overridden:h,onOverride:C,defaultValues:m})]})]}),!r||r.agentEnabled||g?null:t(Nu,{children:e(oe,{$gap:10,$alignItems:"center",children:[t(nn,{variant:hn.Pink,label:Xt(r.agentEnabledStatus?.reasonEnum)||nt.NO_AVAILABLE_AGENT}),t(ee,{size:te.XXXS,color:ne.Secondary,children:r?.agentEnabledStatus?.message})]})}),S.length>0&&t(Nu,{children:t(oe,{$gap:16,$wrap:"wrap",children:S.map((e,n)=>t(ce,{label:e,leftIcon:Xa,status:Pe.Success,invertColors:!0,useSecondaryTone:!0},`${a}-rule-${n}`))})})]})},Ou=({source:n,onClickRollout:o,onClickRollback:i})=>{const{isK8s:a}=S();return e(ae,{$gap:12,children:[t(qp,{source:n}),t(Qp,{source:n}),a&&t(wu,{source:n,onClickRollout:o,onClickRollback:i}),a&&t(Tu,{source:n}),!a&&t(fu,{source:n}),a&&t(Zp,{source:n})]})},$u=({source:e})=>{const n=e.containers||[];return t(Wt,{bgTint:"1000",richTitle:{title:nt.INSTRUMENTED_LIBRARIES},children:n.length?n.map(e=>{const n=e.instrumentations||[];return t(Wt,{bgTint:"800",richTitle:{title:e.containerName,badge:{label:n.length}},withCollapse:!0,collapseIsDefaultOpen:!!n?.length,children:n?.length?t(ae,{children:n.map((e,n)=>t(Ep,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},`instr-${n}-${e.name}`))}):t($e,{title:"No libraries found"})},e.containerName)}):t($e,{title:"No containers found"})})},Au=b(ae)`
680
679
  width: 100%;
681
680
  max-height: 320px;
682
681
  overflow-y: auto;
683
682
  gap: 8px;
684
- `,ku=b(pe)`
683
+ `,Ru=b(oe)`
685
684
  width: 100%;
686
685
  align-items: center;
687
686
  gap: 8px;
@@ -691,14 +690,14 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
691
690
  & > * {
692
691
  font-family: monospace !important;
693
692
  }
694
- `,Iu=({pendingModify:n,onClose:o,onConfirm:i})=>{const a=v();return t(qe,{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:ve.Secondary,label:"Cancel",onClick:o},approveButton:{variant:ve.Primary,label:"Confirm",onClick:i},children:n&&e(Tu,{children:[n.add.map(n=>e(ku,{children:[t(Ke,{leftIcon:Ra,status:Ee.Success,useSecondaryTone:!0,textColor:a.v2.colors.white[500],textSize:Te.XXS}),t(_e,{size:Te.XS,color:Pe.Primary,children:n})]},`add-${n}`)),n.remove.map(n=>e(ku,{children:[t(Ke,{leftIcon:vl,status:Ee.Error,useSecondaryTone:!0,textColor:a.v2.colors.white[500],textSize:Te.XXS}),t(_e,{size:Te.XS,color:Pe.Primary,children:n})]},`remove-${n}`))]})})};function Nu(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 Eu(e){const t=Math.abs(e);return t>=1e9?`${Ou(e/1e9)}s`:t>=1e6?`${Ou(e/1e6)}ms`:t>=1e3?`${Ou(e/1e3)}μs`:String(Math.round(e))}function Ou(e){return e.toFixed(2).replace(/\.?0+$/,"")}function $u(e){const t=[];for(let n=0;n<e.levels.length;n++){const o=e.levels[n];let i=0;for(let e=0;e+3<o.length;e+=4){const a=o[e],l=o[e+1],r=o[e+2],s=o[e+3],c=i+a;t.push({level:n,offset:c,size:l,self:r,nameIndex:s}),i=c+l}}return t}function Au(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function Ru(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}function Du(e,t,n){return((e,t)=>{const n=[];for(let o=0;o<=t.level;o++){let i;for(const n of e)if(n.level===o&&t.offset>=n.offset&&t.offset+t.size<=n.offset+n.size){i=n;break}if(!i)return n;n.push(i)}return n})(t,n).map(t=>Nu(e,t.nameIndex))}function _u(e,t,n){if(0===n.length)return null;let o=null,i=null;for(let a=0;a<n.length;a++){const l=n[a];let r=null;for(const n of t)n.level===a&&Nu(e,n.nameIndex)===l&&(o&&(n.offset<o.offset||n.offset+n.size>o.offset+o.size)||(!r||n.size>r.size)&&(r=n));if(!r)return null;o=r,i=r}return i}function Pu(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 i=[t];for(let e=t.level+1;e<=n;e++){const t=i.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){i.push(e);break}}return i}function Lu(e,t){const n=t.trim().toLowerCase();return!n||e.toLowerCase().includes(n)}function Fu(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],i=[{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 i[n%i.length]}var Mu,zu;function Bu(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function Xu(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 Uu(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`}(e=>{e[e.Fit=1]="Fit",e[e.X10=10]="X10"})(Mu||(Mu={})),(e=>{e[e.Fit=1]="Fit",e[e.X10=10]="X10"})(zu||(zu={}));const Vu=({flamebearer:n,maxRowPx:o,searchQuery:l="",shouldKeepName:r,minHostHeight:s=200,onFullscreenChange:u,profilingSlots:h,onFrameClick:m,onZoomedSymbolsChange:f,onResetZoom:b})=>{const y=v(),C=p(null),S=p(null),x=p({x:0,y:0}),[w,T]=a({w:0,h:0}),[k,I]=a(""),[N,E]=a(null),[O,$]=a([]),[A,R]=a(!1),[D,_]=a(Mu.Fit),[P,L]=a(zu.Fit),[F,M]=a(!1),z=Math.max(1,Math.min(Math.floor(w.w*D),8192)),B=Math.max(1,Math.min(Math.floor(w.h*P),8192)),X=O.length>0?O[O.length-1]:null,U=X?.size??n.numTicks,V=c(()=>$u(n),[n]),H=p({fb:n,rects:V});i(()=>{const e=H.current;e.fb!==n&&(H.current={fb:n,rects:V},$(t=>{if(0===t.length)return t;const o=((e,t,n,o,i)=>{const a=[];for(const l of i){const i=Du(e,t,l);if(0===i.length)break;const r=_u(n,o,i);if(!r)break;a.push(r)}return a})(e.fb,e.rects,n,V,t);return o.length===t.length&&o.every((e,n)=>Ru(e,t[n]))?t:o}))},[n,V]),i(()=>{if(!f)return;if(!X)return void f(null);const e=Pu(V,X),t=new Set;for(const o of e){const e=Nu(n,o.nameIndex);e&&t.add(e)}f([...t])},[X,n,V,f]),g(()=>{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()},[]),i(()=>{if(!A)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[A]),i(()=>(u?.(A),()=>{A&&u?.(!1)}),[A,u]);const j=c(()=>function(e,t,n,o,i,a={}){if(0===e.levels.length||t<2||n<2)return null;const{zoomRoot:l=null,shouldKeepName:r,collapseRecursive:s=!1,allRects:c}=a,d=c??$u(e);let p=l?Pu(d,l):d;if(0===p.length)return null;if(r&&(p=p.filter(t=>r(Nu(e,t.nameIndex))),0===p.length))return null;if(s&&(p=((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 i=new Set;for(const t of n){const n=o.get(t.level+1);if(!n)continue;const a=n.filter(e=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);if(1!==a.length)continue;const l=a[0];l.size===t.size&&Nu(e,l.nameIndex)===Nu(e,t.nameIndex)&&i.add(Au(l))}if(0===i.size)return n;const a=[];for(const e of n){if(i.has(Au(e)))continue;let t=0;for(let n=0;n<e.level;n++){const a=o.get(n);if(!a)continue;const l=a.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);l&&i.has(Au(l))&&t++}a.push({...e,level:e.level-t})}return a})(e,p),0===p.length))return null;const u=l?.level??0,h=l?.offset??0,m=l?.size??e.numTicks;if(m<=0)return null;const g=p.reduce((e,t)=>Math.max(e,t.level-u),0)+1,f=o??Number.POSITIVE_INFINITY,b=Math.max(1,Math.min(n/g,f)),v=i.trim(),y=b>8?1:0;return p.map(n=>{const o=n.level-u,i=(n.offset-h)/m*t,a=Math.max(n.size/m*t,1),l=o*b,r=Math.max(b-y,1),s=Nu(e,n.nameIndex);return{...n,x:i,y:l,w:a,h:r,name:s,matchesSearch:Lu(s,v)}})}(n,z,B,o,l,{zoomRoot:X,shouldKeepName:r,collapseRecursive:F,allRects:V}),[n,o,l,B,z,X,r,F,V]),G=c(()=>(e=>[...e].sort((e,t)=>t.level-e.level))(j?.length?l.trim()?j.filter(e=>e.matchesSearch):j:[]),[j,l]),W=d(e=>{if(z<2||B<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const o=Xu((e.clientX-t.left)/t.width*z,(e.clientY-t.top)/t.height*B,G);if(o){const e=Au(o);E(e);const t=U>0?(100*o.size/U).toFixed(1):"0",i=n.numTicks>0?(100*o.size/n.numTicks).toFixed(1):"0";I(`${o.name}\ntotal ${Eu(o.size)} (${t}% of view, ${i}% of profile) · self ${Eu(o.self)}`)}else E(null),I("")},[G,n.numTicks,B,z,U]),K=d(e=>{W(e)},[W]),Y=d(()=>{E(null),I("")},[]),J=d(e=>{x.current={x:e.clientX,y:e.clientY}},[]),q=d(e=>{const{x:t,y:n}=x.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-n)>3)return;if(z<2||B<2)return;const o=e.currentTarget.getBoundingClientRect();if(o.width<1||o.height<1)return;const i=Xu((e.clientX-o.left)/o.width*z,(e.clientY-o.top)/o.height*B,G);if(!i)return;m?.(i.name);const a=(e=>({level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}))(i);$(e=>{const t=e.length>0?e[e.length-1]:null;return t&&Ru(a,t)?e.slice(0,-1):[...e,a]})},[G,B,z,m]);g(()=>{const e=S.current;if(!e||z<2||B<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,o=Math.max(z,B),i=Math.min(t,16384/o);e.width=Math.floor(z*i),e.height=Math.floor(B*i),e.style.width=`${z}px`,e.style.height=`${B}px`;const a=e.getContext("2d");a&&(a.setTransform(i,0,0,i,0,0),a.clearRect(0,0,z,B),j?.length?((e,t,n,o,i,a,l,r)=>{const s=a.v2.colors.silver[900];e.fillStyle=s,e.fillRect(0,0,t,n);const c=i.trim().length>0;e.textRendering="optimizeLegibility";for(const t of o){const{x:n,y:o,w:i,h:l,name:s,size:d,matchesSearch:p}=t;if(c&&!p)continue;const{fill:u,text:h}=Fu(s,a);e.fillStyle=u,e.fillRect(n,o,i,l),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(n+.5,o+.5),e.lineTo(n+i-.5,o+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(n+.5,o+.5,Math.max(i-1,0),Math.max(l-1,0));const m=Bu(d,r),g=`${s} (${Eu(d)}, ${m}%)`,f=a.v2.text.size.xs,b=8,v=5,y=26,C=Math.min(f,Math.floor(l-2));if(i>=y&&C>=b){e.font=`${C}px ${a.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>i-2*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=i-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(Au(t)!==l)continue;if(c&&!t.matchesSearch)continue;const{x:n,y:o,w:i,h:a}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(n+1,o+1,Math.max(i-2,0),Math.max(a-2,0));break}})(a,z,B,j,l,y,N,n.numTicks):(a.fillStyle=y.v2.colors.silver[900],a.fillRect(0,0,z,B)))},[j,n.numTicks,N,l,B,z,y]);const Z=d(()=>R(e=>!e),[]),Q=n.numTicks>0?Math.max(0,Math.min(100,Math.round(U/n.numTicks*100))):100,ee=c(()=>((e,t,n)=>{const o=n??$u(e),i=t?.offset??0,a=i+(t?.size??e.numTicks),l=(t?.level??-1)+1,r=t?.size??e.numTicks;let s=null;for(const e of o)e.level<l||e.offset<i||e.offset+e.size>a||e.size>=r||(!s||e.size>s.size||e.size===s.size&&e.level<s.level)&&(s=e);return s})(n,X,V),[n,X,V]),te=null!==ee,ne=O.length>0,oe=X?Nu(n,X.nameIndex):"",ie=d(()=>{$([]),b?.()},[b]),ae=d(()=>$(e=>e.slice(0,-1)),[]),se=d(()=>{ee&&$(e=>[...e,ee])},[ee]);return e("div",{style:A?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:y.v2.colors.silver[900]}:{flex:1,minHeight:s,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(pe,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(le,{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:re.Left,size:Nt.S,value:F,onChange:M}),e(pe,{$gap:8,children:[e(pe,{children:[t(fe,{variant:ve.Secondary,size:be.S,label:"Reset zoom",leftIcon:yl,onClick:ie,disabled:!O.length}),t(fe,{variant:ve.Secondary,size:be.S,iconSize:20,leftIcon:vl,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!ne,onClick:ae}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(_e,{size:Te.XXS,color:Pe.Secondary,nowrap:!0,align:"center",children:`${Q}%`})}),t(fe,{variant:ve.Secondary,size:be.S,iconSize:20,leftIcon:Ra,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!te,onClick:se})]}),e(pe,{children:[t(Fe,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(ce,{variant:_n.Filled,options:[{value:Mu.Fit,label:"W: Fit"},{value:Mu.X10,label:"10x"}],selected:D,setSelected:_})}),t(Fe,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(ce,{variant:_n.Filled,options:[{value:zu.Fit,label:"H: Fit"},{value:zu.X10,label:"10x"}],selected:P,setSelected:L})})]}),t(fe,{variant:ve.Secondary,size:be.S,iconSize:24,leftIcon:A?Ka:Cl,tooltip:A?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:Z})]})]}),t(Fe,{fullWidth:!0,keepAlive:!0,text:k,children:t("div",{ref:C,style:{flex:1,minWidth:0,width:"100%",height:A?"calc(100vh - 80px)":"calc(100vh - 364px)",position:"relative",overflow:"hidden"},children:t("div",{style:{position:"absolute",inset:0,overflowX:D>1?"auto":"hidden",overflowY:P>1?"auto":"hidden"},children:t("div",{style:{width:z||"100%",height:B||"100%",position:"relative"},children:t("canvas",{ref:S,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:N?"pointer":"default"},onPointerDown:J,onPointerMove:K,onPointerLeave:Y,onClick:q})})})})}),e(pe,{$justifyContent:"space-between",children:[t(_e,X?{size:Te.XXXS,color:y.v2.colors.silver[300],children:`Zoomed: ${oe} • ${Eu(U)} samples in view`}:{size:Te.XXXS,color:y.v2.colors.silver[300],children:m?"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(_e,{size:Te.XXXS,color:y.v2.colors.silver[300],children:`${h.activeKeys.length} / ${h.maxSlots} profiling slots · ${Uu(h.totalBytesUsed)} / ${Uu(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})},Hu=[Dn.Go,Dn.Java],ju="Profiling Symbols";function Gu(e,t){if(0===t.length)return null;const n=1===t.length?t[0]:(e=>e.includes("/")||/\.\(\*?[^)]+\)\./.test(e)?Dn.Go:e.includes(" ")||e.includes("(")?Dn.Java:Dn.Go)(e);if(n===Dn.Go){const t=(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 i=t.slice(0,o),a=t.slice(o+1);if(!i||!a)return null;const l=a.match(/^\(\*?([^)]+)\)\.(.+)$/);if(l){const e=new Be(i,"",l[1],l[2]);return e.Verify()?e:null}const r=new Be(i,a);return r.Verify()?r:null})(e);return t?{language:n,golang:t}:null}if(n===Dn.Java){const t=(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 i=t.lastIndexOf(".");if(-1===i)return null;const a=t.slice(0,i),l=t.slice(i+1),r=new Xe(a,l);return r.Verify()?r:null})(e);return t?{language:n,java:t}:null}return null}function Wu(e,t){return e.namespace===t.namespace&&e.name===t.name&&e.kind===t.kind}function Ku(e,t,n){if(!e)return!0;const{sources:o=[],namespaces:i=[],languages:a=[]}=e,l=!o.length||o.some(e=>Wu(e,t.id)),r=!i.length||i.includes(t.id.namespace),s=!a.length||null==n||a.includes(n);return l&&r&&s}function Yu(e,t){return e.packageName===t.packageName&&(e.functionName||"")===(t.functionName||"")&&(e.receiverName||"")===(t.receiverName||"")&&(e.receiverMethodName||"")===(t.receiverMethodName||"")}function Ju(e,t){return e.className===t.className&&e.methodName===t.methodName}function qu(e,t,n,o){const i=Gu(e,n);if(!i)return[];const a=[];for(const e of o){const n=e.customInstrumentations;if(!n)continue;if(!Ku(e.sourceScopes,t,i.language))continue;const o=!!i.golang&&!!n[Ve.Golang]?.some(e=>Yu(e,i.golang)),l=!!i.java&&!!n[Ve.Java]?.some(e=>Ju(e,i.java));(o||l)&&a.push({rule:e,resolved:i})}return a}var Zu,Qu,eh;(e=>{e.Symbol="symbol",e.Self="self",e.Total="total"})(Zu||(Zu={})),(e=>{e.OnlyInstrumentable="only-instrumentable"})(Qu||(Qu={})),(e=>{e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"})(eh||(eh={}));const th=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function nh(e,t){const n=(e=>e.split(" ")[0]??"")(e);return(!t.includes(eh.FilterOutVoid)||"void"!==n)&&!!(!t.includes(eh.OnlyWithReturnValues)||e.includes(" ")&&"void"!==n&&th.test(n))}const oh=({rows:e,languages:n,instrumentation:o,searchQuery:i,filters:a,onFiltersChange:l,zoomedSymbols:r,highlightSymbol:s,scrollSignal:p})=>{const u=!!n?.includes(Dn.Java),h=c(()=>{const t=r?new Set(r):null,n=i?.trim().toLowerCase();return e.filter(e=>(!t||t.has(e.name))&&(!n||e.name.toLowerCase().includes(n)))},[e,i,r]),m=c(()=>{const e=[];if(o.selectionEnabled&&e.push({id:Qu.OnlyInstrumentable,label:"Only show instrumentable symbols"}),u&&(e.push({id:eh.FilterOutVoid,label:"Filter out void symbols"}),e.push({id:eh.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===Zu.Symbol)?.rawValue?.toString()??"";return!(t.includes(Qu.OnlyInstrumentable)&&!o.getSymbolState(n).showCheckbox)&&nh(n,t)}}},[o,u]),g=c(()=>[{key:Zu.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:m,noFilter:!m},{key:Zu.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:Zu.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[m]),f=c(()=>h.map(e=>{const t=o.getSymbolState(e.name),n=t.showCheckbox;return{id:e.name,cells:[{key:Zu.Symbol,rawValue:e.name},{key:Zu.Self,rawValue:Eu(e.self)},{key:Zu.Total,rawValue:Eu(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=d(e=>{const t=e.cells[0].rawValue,n=o.getSymbolState(t),i=[];return n.inManagedRule?i.push({id:`remove-instrumentation-${t}`,label:"",leftIcon:Aa,tooltip:"Remove from the “Profiling Symbols” rule",onClick:()=>o.onRemove(t)}):i.push({id:`add-instrumentation-${t}`,label:"",leftIcon:Ra,tooltip:n.addTooltip,disabled:!n.addEnabled,onClick:()=>o.onAdd(t)}),i.push({id:`copy-${t}`,label:"",leftIcon:Sl,tooltip:"Copy symbol name",onClick:()=>{navigator.clipboard.writeText(t)}}),i},[o]);return t(Pn,{variant:Ln.Data,maxHeight:"calc(100vh - 306px)",columns:g,rows:f,withCheckboxes:o.selectionEnabled,filters:a,onFiltersChange:l,activeRowId:s,scrollSignal:p,getRowActions:b})};var ih;(e=>{e.Table="table",e.Flame="flame",e.Both="both"})(ih||(ih={}));const ah=b(ee)`
693
+ `,Du=({pendingModify:n,onClose:o,onConfirm:i})=>{const a=v();return t(tt,{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:Ie.Secondary,label:"Cancel",onClick:o},approveButton:{variant:Ie.Primary,label:"Confirm",onClick:i},children:n&&e(Au,{children:[n.add.map(n=>e(Ru,{children:[t(ce,{leftIcon:za,status:Pe.Success,useSecondaryTone:!0,textColor:a.v2.colors.white[500],textSize:te.XXS}),t(ee,{size:te.XS,color:ne.Primary,children:n})]},`add-${n}`)),n.remove.map(n=>e(Ru,{children:[t(ce,{leftIcon:xl,status:Pe.Error,useSecondaryTone:!0,textColor:a.v2.colors.white[500],textSize:te.XXS}),t(ee,{size:te.XS,color:ne.Primary,children:n})]},`remove-${n}`))]})})};function _u(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 Pu(e){const t=Math.abs(e);return t>=1e9?`${Lu(e/1e9)}s`:t>=1e6?`${Lu(e/1e6)}ms`:t>=1e3?`${Lu(e/1e3)}μs`:String(Math.round(e))}function Lu(e){return e.toFixed(2).replace(/\.?0+$/,"")}function Fu(e){const t=[];for(let n=0;n<e.levels.length;n++){const o=e.levels[n];let i=0;for(let e=0;e+3<o.length;e+=4){const a=o[e],l=o[e+1],r=o[e+2],s=o[e+3],c=i+a;t.push({level:n,offset:c,size:l,self:r,nameIndex:s}),i=c+l}}return t}function Mu(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function zu(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}function Bu(e,t,n){return((e,t)=>{const n=[];for(let o=0;o<=t.level;o++){let i;for(const n of e)if(n.level===o&&t.offset>=n.offset&&t.offset+t.size<=n.offset+n.size){i=n;break}if(!i)return n;n.push(i)}return n})(t,n).map(t=>_u(e,t.nameIndex))}function Xu(e,t,n){if(0===n.length)return null;let o=null,i=null;for(let a=0;a<n.length;a++){const l=n[a];let r=null;for(const n of t)n.level===a&&_u(e,n.nameIndex)===l&&(o&&(n.offset<o.offset||n.offset+n.size>o.offset+o.size)||(!r||n.size>r.size)&&(r=n));if(!r)return null;o=r,i=r}return i}function Uu(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 i=[t];for(let e=t.level+1;e<=n;e++){const t=i.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){i.push(e);break}}return i}function Vu(e,t){const n=t.trim().toLowerCase();return!n||e.toLowerCase().includes(n)}function Hu(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],i=[{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 i[n%i.length]}var ju,Gu;function Wu(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function Ku(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 Yu(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`}(e=>{e[e.Fit=1]="Fit",e[e.X10=10]="X10"})(ju||(ju={})),(e=>{e[e.Fit=1]="Fit",e[e.X10=10]="X10"})(Gu||(Gu={}));const Ju=({flamebearer:n,maxRowPx:o,searchQuery:r="",shouldKeepName:s,minHostHeight:c=200,onFullscreenChange:u,profilingSlots:h,onFrameClick:m,onZoomedSymbolsChange:f,onResetZoom:b})=>{const y=v(),C=p(null),S=p(null),x=p({x:0,y:0}),[w,T]=l({w:0,h:0}),[k,I]=l(""),[N,E]=l(null),[O,$]=l([]),[A,R]=l(!1),[D,_]=l(ju.Fit),[P,L]=l(Gu.Fit),[F,M]=l(!1),z=Math.max(1,Math.min(Math.floor(w.w*D),8192)),B=Math.max(1,Math.min(Math.floor(w.h*P),8192)),X=O.length>0?O[O.length-1]:null,U=X?.size??n.numTicks,V=i(()=>Fu(n),[n]),H=p({fb:n,rects:V});a(()=>{const e=H.current;e.fb!==n&&(H.current={fb:n,rects:V},$(t=>{if(0===t.length)return t;const o=((e,t,n,o,i)=>{const a=[];for(const l of i){const i=Bu(e,t,l);if(0===i.length)break;const r=Xu(n,o,i);if(!r)break;a.push(r)}return a})(e.fb,e.rects,n,V,t);return o.length===t.length&&o.every((e,n)=>zu(e,t[n]))?t:o}))},[n,V]),a(()=>{if(!f)return;if(!X)return void f(null);const e=Uu(V,X),t=new Set;for(const o of e){const e=_u(n,o.nameIndex);e&&t.add(e)}f([...t])},[X,n,V,f]),g(()=>{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()},[]),a(()=>{if(!A)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[A]),a(()=>(u?.(A),()=>{A&&u?.(!1)}),[A,u]);const j=i(()=>function(e,t,n,o,i,a={}){if(0===e.levels.length||t<2||n<2)return null;const{zoomRoot:l=null,shouldKeepName:r,collapseRecursive:s=!1,allRects:c}=a,d=c??Fu(e);let p=l?Uu(d,l):d;if(0===p.length)return null;if(r&&(p=p.filter(t=>r(_u(e,t.nameIndex))),0===p.length))return null;if(s&&(p=((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 i=new Set;for(const t of n){const n=o.get(t.level+1);if(!n)continue;const a=n.filter(e=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);if(1!==a.length)continue;const l=a[0];l.size===t.size&&_u(e,l.nameIndex)===_u(e,t.nameIndex)&&i.add(Mu(l))}if(0===i.size)return n;const a=[];for(const e of n){if(i.has(Mu(e)))continue;let t=0;for(let n=0;n<e.level;n++){const a=o.get(n);if(!a)continue;const l=a.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);l&&i.has(Mu(l))&&t++}a.push({...e,level:e.level-t})}return a})(e,p),0===p.length))return null;const u=l?.level??0,h=l?.offset??0,m=l?.size??e.numTicks;if(m<=0)return null;const g=p.reduce((e,t)=>Math.max(e,t.level-u),0)+1,f=o??Number.POSITIVE_INFINITY,b=Math.max(1,Math.min(n/g,f)),v=i.trim(),y=b>8?1:0;return p.map(n=>{const o=n.level-u,i=(n.offset-h)/m*t,a=Math.max(n.size/m*t,1),l=o*b,r=Math.max(b-y,1),s=_u(e,n.nameIndex);return{...n,x:i,y:l,w:a,h:r,name:s,matchesSearch:Vu(s,v)}})}(n,z,B,o,r,{zoomRoot:X,shouldKeepName:s,collapseRecursive:F,allRects:V}),[n,o,r,B,z,X,s,F,V]),G=i(()=>(e=>[...e].sort((e,t)=>t.level-e.level))(j?.length?r.trim()?j.filter(e=>e.matchesSearch):j:[]),[j,r]),W=d(e=>{if(z<2||B<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const o=Ku((e.clientX-t.left)/t.width*z,(e.clientY-t.top)/t.height*B,G);if(o){const e=Mu(o);E(e);const t=U>0?(100*o.size/U).toFixed(1):"0",i=n.numTicks>0?(100*o.size/n.numTicks).toFixed(1):"0";I(`${o.name}\ntotal ${Pu(o.size)} (${t}% of view, ${i}% of profile) · self ${Pu(o.self)}`)}else E(null),I("")},[G,n.numTicks,B,z,U]),K=d(e=>{W(e)},[W]),Y=d(()=>{E(null),I("")},[]),J=d(e=>{x.current={x:e.clientX,y:e.clientY}},[]),q=d(e=>{const{x:t,y:n}=x.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-n)>3)return;if(z<2||B<2)return;const o=e.currentTarget.getBoundingClientRect();if(o.width<1||o.height<1)return;const i=Ku((e.clientX-o.left)/o.width*z,(e.clientY-o.top)/o.height*B,G);if(!i)return;m?.(i.name);const a=(e=>({level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}))(i);$(e=>{const t=e.length>0?e[e.length-1]:null;return t&&zu(a,t)?e.slice(0,-1):[...e,a]})},[G,B,z,m]);g(()=>{const e=S.current;if(!e||z<2||B<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,o=Math.max(z,B),i=Math.min(t,16384/o);e.width=Math.floor(z*i),e.height=Math.floor(B*i),e.style.width=`${z}px`,e.style.height=`${B}px`;const a=e.getContext("2d");a&&(a.setTransform(i,0,0,i,0,0),a.clearRect(0,0,z,B),j?.length?((e,t,n,o,i,a,l,r)=>{const s=a.v2.colors.silver[900];e.fillStyle=s,e.fillRect(0,0,t,n);const c=i.trim().length>0;e.textRendering="optimizeLegibility";for(const t of o){const{x:n,y:o,w:i,h:l,name:s,size:d,matchesSearch:p}=t;if(c&&!p)continue;const{fill:u,text:h}=Hu(s,a);e.fillStyle=u,e.fillRect(n,o,i,l),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(n+.5,o+.5),e.lineTo(n+i-.5,o+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(n+.5,o+.5,Math.max(i-1,0),Math.max(l-1,0));const m=Wu(d,r),g=`${s} (${Pu(d)}, ${m}%)`,f=a.v2.text.size.xs,b=8,v=5,y=26,C=Math.min(f,Math.floor(l-2));if(i>=y&&C>=b){e.font=`${C}px ${a.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>i-2*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=i-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(Mu(t)!==l)continue;if(c&&!t.matchesSearch)continue;const{x:n,y:o,w:i,h:a}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(n+1,o+1,Math.max(i-2,0),Math.max(a-2,0));break}})(a,z,B,j,r,y,N,n.numTicks):(a.fillStyle=y.v2.colors.silver[900],a.fillRect(0,0,z,B)))},[j,n.numTicks,N,r,B,z,y]);const Z=d(()=>R(e=>!e),[]),Q=n.numTicks>0?Math.max(0,Math.min(100,Math.round(U/n.numTicks*100))):100,ie=i(()=>((e,t,n)=>{const o=n??Fu(e),i=t?.offset??0,a=i+(t?.size??e.numTicks),l=(t?.level??-1)+1,r=t?.size??e.numTicks;let s=null;for(const e of o)e.level<l||e.offset<i||e.offset+e.size>a||e.size>=r||(!s||e.size>s.size||e.size===s.size&&e.level<s.level)&&(s=e);return s})(n,X,V),[n,X,V]),ae=null!==ie,le=O.length>0,re=X?_u(n,X.nameIndex):"",se=d(()=>{$([]),b?.()},[b]),ce=d(()=>$(e=>e.slice(0,-1)),[]),de=d(()=>{ie&&$(e=>[...e,ie])},[ie]);return e("div",{style:A?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:y.v2.colors.silver[900]}:{flex:1,minHeight:c,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(oe,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(ge,{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:fe.Left,size:Et.S,value:F,onChange:M}),e(oe,{$gap:8,children:[e(oe,{children:[t(Te,{variant:Ie.Secondary,size:ke.S,label:"Reset zoom",leftIcon:wl,onClick:se,disabled:!O.length}),t(Te,{variant:Ie.Secondary,size:ke.S,iconSize:20,leftIcon:xl,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!le,onClick:ce}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(ee,{size:te.XXS,color:ne.Secondary,nowrap:!0,align:"center",children:`${Q}%`})}),t(Te,{variant:Ie.Secondary,size:ke.S,iconSize:20,leftIcon:za,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!ae,onClick:de})]}),e(oe,{children:[t(Ue,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(ve,{variant:Fn.Filled,options:[{value:ju.Fit,label:"W: Fit"},{value:ju.X10,label:"10x"}],selected:D,setSelected:_})}),t(Ue,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(ve,{variant:Fn.Filled,options:[{value:Gu.Fit,label:"H: Fit"},{value:Gu.X10,label:"10x"}],selected:P,setSelected:L})})]}),t(Te,{variant:Ie.Secondary,size:ke.S,iconSize:24,leftIcon:A?Qa:Tl,tooltip:A?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:Z})]})]}),t(Ue,{fullWidth:!0,keepAlive:!0,text:k,children:t("div",{ref:C,style:{flex:1,minWidth:0,width:"100%",height:A?"calc(100vh - 80px)":"calc(100vh - 364px)",position:"relative",overflow:"hidden"},children:t("div",{style:{position:"absolute",inset:0,overflowX:D>1?"auto":"hidden",overflowY:P>1?"auto":"hidden"},children:t("div",{style:{width:z||"100%",height:B||"100%",position:"relative"},children:t("canvas",{ref:S,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:N?"pointer":"default"},onPointerDown:J,onPointerMove:K,onPointerLeave:Y,onClick:q})})})})}),e(oe,{$justifyContent:"space-between",children:[t(ee,X?{size:te.XXXS,color:y.v2.colors.silver[300],children:`Zoomed: ${re} • ${Pu(U)} samples in view`}:{size:te.XXXS,color:y.v2.colors.silver[300],children:m?"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(ee,{size:te.XXXS,color:y.v2.colors.silver[300],children:`${h.activeKeys.length} / ${h.maxSlots} profiling slots · ${Yu(h.totalBytesUsed)} / ${Yu(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})},qu=[Dn.Go,Dn.Java],Zu="Profiling Symbols";function Qu(e,t){if(0===t.length)return null;const n=1===t.length?t[0]:(e=>e.includes("/")||/\.\(\*?[^)]+\)\./.test(e)?Dn.Go:e.includes(" ")||e.includes("(")?Dn.Java:Dn.Go)(e);if(n===Dn.Go){const t=(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 i=t.slice(0,o),a=t.slice(o+1);if(!i||!a)return null;const l=a.match(/^\(\*?([^)]+)\)\.(.+)$/);if(l){const e=new je(i,"",l[1],l[2]);return e.Verify()?e:null}const r=new je(i,a);return r.Verify()?r:null})(e);return t?{language:n,golang:t}:null}if(n===Dn.Java){const t=(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 i=t.lastIndexOf(".");if(-1===i)return null;const a=t.slice(0,i),l=t.slice(i+1),r=new Ge(a,l);return r.Verify()?r:null})(e);return t?{language:n,java:t}:null}return null}function eh(e,t){return e.namespace===t.namespace&&e.name===t.name&&e.kind===t.kind}function th(e,t,n){if(!e)return!0;const{sources:o=[],namespaces:i=[],languages:a=[]}=e,l=!o.length||o.some(e=>eh(e,t.id)),r=!i.length||i.includes(t.id.namespace),s=!a.length||null==n||a.includes(n);return l&&r&&s}function nh(e,t){return e.packageName===t.packageName&&(e.functionName||"")===(t.functionName||"")&&(e.receiverName||"")===(t.receiverName||"")&&(e.receiverMethodName||"")===(t.receiverMethodName||"")}function oh(e,t){return e.className===t.className&&e.methodName===t.methodName}function ih(e,t,n,o){const i=Qu(e,n);if(!i)return[];const a=[];for(const e of o){const n=e.customInstrumentations;if(!n)continue;if(!th(e.sourceScopes,t,i.language))continue;const o=!!i.golang&&!!n[Ke.Golang]?.some(e=>nh(e,i.golang)),l=!!i.java&&!!n[Ke.Java]?.some(e=>oh(e,i.java));(o||l)&&a.push({rule:e,resolved:i})}return a}var ah,lh,rh;(e=>{e.Symbol="symbol",e.Self="self",e.Total="total"})(ah||(ah={})),(e=>{e.OnlyInstrumentable="only-instrumentable"})(lh||(lh={})),(e=>{e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"})(rh||(rh={}));const sh=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function ch(e,t){const n=(e=>e.split(" ")[0]??"")(e);return(!t.includes(rh.FilterOutVoid)||"void"!==n)&&!!(!t.includes(rh.OnlyWithReturnValues)||e.includes(" ")&&"void"!==n&&sh.test(n))}const dh=({rows:e,languages:n,instrumentation:o,searchQuery:a,filters:l,onFiltersChange:r,zoomedSymbols:s,highlightSymbol:c,scrollSignal:p})=>{const u=!!n?.includes(Dn.Java),h=i(()=>{const t=s?new Set(s):null,n=a?.trim().toLowerCase();return e.filter(e=>(!t||t.has(e.name))&&(!n||e.name.toLowerCase().includes(n)))},[e,a,s]),m=i(()=>{const e=[];if(o.selectionEnabled&&e.push({id:lh.OnlyInstrumentable,label:"Only show instrumentable symbols"}),u&&(e.push({id:rh.FilterOutVoid,label:"Filter out void symbols"}),e.push({id:rh.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===ah.Symbol)?.rawValue?.toString()??"";return!(t.includes(lh.OnlyInstrumentable)&&!o.getSymbolState(n).showCheckbox)&&ch(n,t)}}},[o,u]),g=i(()=>[{key:ah.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:m,noFilter:!m},{key:ah.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:ah.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[m]),f=i(()=>h.map(e=>{const t=o.getSymbolState(e.name),n=t.showCheckbox;return{id:e.name,cells:[{key:ah.Symbol,rawValue:e.name},{key:ah.Self,rawValue:Pu(e.self)},{key:ah.Total,rawValue:Pu(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=d(e=>{const t=e.cells[0].rawValue,n=o.getSymbolState(t),i=[];return n.inManagedRule?i.push({id:`remove-instrumentation-${t}`,label:"",leftIcon:Ma,tooltip:"Remove from the “Profiling Symbols” rule",onClick:()=>o.onRemove(t)}):i.push({id:`add-instrumentation-${t}`,label:"",leftIcon:za,tooltip:n.addTooltip,disabled:!n.addEnabled,onClick:()=>o.onAdd(t)}),i.push({id:`copy-${t}`,label:"",leftIcon:kl,tooltip:"Copy symbol name",onClick:()=>{navigator.clipboard.writeText(t)}}),i},[o]);return t(Mn,{variant:zn.Data,maxHeight:"calc(100vh - 306px)",columns:g,rows:f,withCheckboxes:o.selectionEnabled,filters:l,onFiltersChange:r,activeRowId:c,scrollSignal:p,getRowActions:b})};var ph;(e=>{e.Table="table",e.Flame="flame",e.Both="both"})(ph||(ph={}));const uh=b(ae)`
695
694
  width: 100%;
696
695
  flex: 1;
697
696
  border-radius: 16px;
698
697
  overflow: hidden;
699
698
  background: ${({theme:e})=>e.v2.colors.silver[800]};
700
699
  box-shadow: 0 2px 14.1px 0 rgba(0, 0, 0, 0.25);
701
- `,lh=b.div`
700
+ `,hh=b.div`
702
701
  display: flex;
703
702
  align-items: center;
704
703
  gap: 10px;
@@ -706,11 +705,11 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
706
705
  padding: 12px 12px 8px;
707
706
  background: ${({theme:e})=>e.v2.colors.silver[800]};
708
707
  border-radius: 16px 16px 0 0;
709
- `,rh=b(pe)`
708
+ `,mh=b(oe)`
710
709
  flex-shrink: 0;
711
710
  align-items: center;
712
711
  gap: 4px;
713
- `,sh=b.div`
712
+ `,gh=b.div`
714
713
  flex: 1;
715
714
  display: flex;
716
715
  align-items: stretch;
@@ -718,20 +717,20 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
718
717
  padding: 16px;
719
718
  background: ${({theme:e})=>e.v2.colors.silver[800]};
720
719
  border-radius: 0 0 16px 16px;
721
- `,ch=b(ee)`
720
+ `,fh=b(ae)`
722
721
  flex: ${({$splitWithFlame:e})=>e?"0 0 min(413px, 42%)":"1 1 auto"};
723
722
  width: ${({$splitWithFlame:e})=>e?"auto":"100%"};
724
723
  max-width: ${({$splitWithFlame:e})=>e?"none":"100%"};
725
724
  gap: 10px;
726
- `,dh=b(ee)`
725
+ `,bh=b(ae)`
727
726
  flex: ${({$splitWithTable:e})=>e?"1":"1 1 auto"};
728
727
  width: ${({$splitWithTable:e})=>e?"auto":"100%"};
729
728
  gap: 10px;
730
- `,ph=b(pe)`
729
+ `,vh=b(oe)`
731
730
  width: 100%;
732
731
  min-height: 32px;
733
732
  flex-shrink: 0;
734
- `,uh=({source:n,onFlameFullscreenChange:o})=>{const r=v(),s=n.id,{profilingApi:u}=Vl(),[h,m]=a(!0),[g,f]=a(ih.Both),[b,y]=a(""),[C,S]=a({}),[x,w]=a(!1),T=p(!1);i(()=>{T.current||(T.current=!0,u.enableProfiling?.(s),w(!0))},[u,s]);const{data:k}=u.useSlots({skip:!x,pollInterval:h?3e3:0,fetchPolicy:"network-only"}),{data:I,loading:N,refetch:E}=u.useSourceProfiling(s,{skip:!x,pollInterval:h?3e3:0,fetchPolicy:"network-only"}),O=I?.profileJson??null,$=c(()=>(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}})(O),[O]),A=c(()=>$?(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 i=o[n+1],a=o[n+2],l=Nu(e,o[n+3]);if(!l)continue;const r=t.get(l);(!r||i>r.total)&&t.set(l,{self:a,total:i})}}return[...t.entries()].map(([e,t])=>({name:e,self:t.self,total:t.total})).sort((e,t)=>t.self-e.self)})($.flamebearer):[],[$]),R=g===ih.Table||g===ih.Both,D=g===ih.Flame||g===ih.Both,_=R&&D,P=n.runtimeInfo?.detectedLanguages?.join("\0")??"",L=n.containers?.map(e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??"").join("\0")??"",F=c(()=>P?P.split("\0"):L?L.split("\0"):void 0,[P,L]),M=c(()=>((e,t)=>{if(!t?.includes(Dn.Java))return;const n=(e?.[Zu.Symbol]?.filter(Boolean)??[]).filter(e=>e===eh.FilterOutVoid||e===eh.OnlyWithReturnValues);return 0!==n.length?e=>nh(e,n):void 0})(C,F),[C,F]),{instrumentation:z,pendingCount:B,pendingModify:X,closeModify:U,openBulkModify:V,resetSelection:H,confirmModify:j}=function({source:e,languages:t,rows:n}){const{instrumentationRulesApi:o,capabilities:i}=Vl(),{items:l}=o.useRules(),[r,s]=a(new Set),[p,u]=a(new Set),[h,m]=a(null),g=c(()=>(e=>{const t=new Set(e??[]);return Hu.filter(e=>t.has(e))})(t),[t]),f=i.canCreateInstrumentationRule,b=`${e.id.namespace}\0${e.id.kind}\0${e.id.name}`,v=c(()=>((e,t)=>{const n=e.filter(e=>e.type===je.CustomInstrumentation&&e.ruleName===ju&&Ku(e.sourceScopes,t));return n.find(e=>e.sourceScopes?.sources?.some(e=>Wu(e,t.id)))??n[0]??null})(l,e),[l,b]),y=f&&g.length>0,C=c(()=>{const t=new Map;for(const o of n){const n=!!Gu(o.name,g),i=qu(o.name,e,g,l),a=!!v&&i.some(e=>e.rule.ruleId===v.ruleId),r=i.filter(e=>e.rule.ruleId!==v?.ruleId),s=!a&&r.length>0,c=y&&n,d=s;let p;if(s){const e=[...new Set(r.map(e=>e.rule.ruleName))];p=`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 u=!1,h="Add this symbol to the “Profiling Symbols” rule";s?h=p??"Managed by another rule":0===i.length&&(0===g.length?h="Custom instrumentation is only available for Go and Java sources":f?n?u=!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:a,otherRules:r,showCheckbox:c,checkboxDisabled:d,checkboxTooltip:p,addEnabled:u,addTooltip:h})}return t},[n,l,b,g,f,y,v]),S=c(()=>{const e=new Set;return C.forEach((t,n)=>{t.inManagedRule&&e.add(n)}),e},[C]),x=c(()=>[...r].filter(e=>C.get(e)?.addEnabled&&!S.has(e)),[r,C,S]),w=c(()=>[...p].filter(e=>S.has(e)),[p,S]),T=x.length+w.length,k=d(e=>{const t=C.get(e);return t?.inManagedRule?!p.has(e):!!(t&&t.otherRules.length>0)||r.has(e)},[C,p,r]),I=d((e,t)=>{const n=C.get(e);n&&!n.checkboxDisabled&&(n.inManagedRule?u(n=>{const o=new Set(n);return t?o.delete(e):o.add(e),o}):s(n=>{const o=new Set(n);return t?o.add(e):o.delete(e),o}))},[C]),N=d(()=>{s(new Set),u(new Set)},[]),E=d(t=>{(async()=>{const n=t.add.map(e=>Gu(e,g)).filter(e=>!!e),i=t.remove.map(e=>Gu(e,g)).filter(e=>!!e);if(v){const{customInstrumentations:e,isEmpty:t}=((e,t,n)=>{const o=e.customInstrumentations??{};let i=[...o[Ve.Golang]??[]],a=[...o[Ve.Java]??[]];for(const e of n)e.golang&&(i=i.filter(t=>!Yu(t,e.golang))),e.java&&(a=a.filter(t=>!Ju(t,e.java)));for(const e of t)e.golang&&!i.some(t=>Yu(t,e.golang))&&i.push(e.golang),e.java&&!a.some(t=>Ju(t,e.java))&&a.push(e.java);return{customInstrumentations:{[Ve.Golang]:i,[Ve.Java]:a},isEmpty:0===i.length&&0===a.length}})(v,n,i);t?await o.remove(v.ruleId,je.CustomInstrumentation):await o.update(v.ruleId,((e,t)=>({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}))(v,e),je.CustomInstrumentation)}else n.length>0&&await o.create(((e,t)=>{const n=e.map(e=>e.golang).filter(e=>!!e),o=e.map(e=>e.java).filter(e=>!!e),i={sources:[{namespace:t.id.namespace,name:t.id.name,kind:t.id.kind}],namespaces:[],languages:[]};return{ruleName:ju,notes:"Symbols selected from the profiling tab.",disabled:!1,sourceScopes:i,workloads:null,instrumentationLibraries:null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:{[Ve.Golang]:n,[Ve.Java]:o}}})(n,e),je.CustomInstrumentation)})()},[v,g,e,o]),O=d(()=>{T&&m({add:x,remove:w})},[T,x,w]),$=d(e=>m({add:[e],remove:[]}),[]),A=d(e=>m({add:[],remove:[e]}),[]),R=d(()=>m(null),[]),D=d(()=>{h&&(E(h),m(null),N())},[h,E,N]),_=d(e=>C.get(e)??{parsable:!1,inManagedRule:!1,otherRules:[],showCheckbox:!1,checkboxDisabled:!1,addEnabled:!1,addTooltip:"Custom instrumentation is only available for Go and Java sources"},[C]);return{instrumentation:c(()=>({getSymbolState:_,onAdd:$,onRemove:A,selectionEnabled:y,isSelected:k,onToggleSymbol:I}),[_,$,A,y,k,I]),pendingCount:T,pendingModify:h,closeModify:R,openBulkModify:O,resetSelection:N,confirmModify:D}}({source:n,languages:F,rows:A}),[G,W]=a(null),[K,Y]=a(0),[J,q]=a(null),Z=d(e=>{W(e),Y(e=>e+1),f(e=>e===ih.Flame?ih.Both:e)},[]),Q=d(e=>{q(t=>{if(null===e)return null===t?t:null;if(t&&t.length===e.length){const n=new Set(t);if(e.every(e=>n.has(e)))return t}return e})},[]),te=d(()=>W(null),[]);return!O&&N?t(mt,{$height:"70vh",children:t(yt,{withSpinner:!0})}):e(ah,{$gap:0,$width:"100%",children:[e(lh,{children:[t(Fe,{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(rh,{children:t(_e,{size:Te.S,weight:500,color:Pe.Primary,nowrap:!0,children:"CPU Profiling"})})}),e(pe,{style:{flex:1,minWidth:200,gap:10,alignItems:"center",flexWrap:"wrap"},children:[t("div",{style:{flex:"1 1 220px",minWidth:180},children:t(mn,{value:b,onChange:y,placeholder:"Search by symbol name",width:"100%",idleBackgroundColor:r.v2.colors.silver[900],emphasizeBackgroundColor:r.v2.colors.silver[800]})}),t(ce,{variant:_n.Filled,options:[{value:ih.Table,label:"Top table"},{value:ih.Flame,label:"Flame graph"},{value:ih.Both,label:"Both"}],selected:g,setSelected:f}),t(fe,h?{variant:ve.Secondary,size:be.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(xl,{...e,size:8,fill:r.v2.colors.green[500]})}:{variant:ve.Secondary,size:be.S,label:"Paused",tooltip:"Odigos profiler is still collecting data, but the UI is not updating in real time",leftIcon:e=>t(xl,{...e,size:8,fill:r.v2.colors.red[500]})})]})]}),t(sh,{$gap:R&&D?16:0,children:$?e(l,{children:[R&&e(ch,{$splitWithFlame:_,children:[e(ph,{$justifyContent:"space-between",children:[e(ee,{$margin:"0 0 0 20px",children:[t(_e,{size:Te.XXXS,nowrap:!0,children:"Please select symbols to"}),e(pe,{$gap:8,children:[e(pe,{children:[t(wl,{size:24}),t(_e,{size:Te.S,color:Pe.Success,nowrap:!0,children:"Custom Instrument"})]}),t(fe,{leftIcon:La,variant:ve.Secondary,size:be.S,onClick:()=>window.open(`${Oe}/enterprise/pipeline/rules/custominstrumentation`,"_blank","noopener noreferrer")})]})]}),e(pe,{$gap:8,children:[J&&t(Fe,{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(Ke,{label:`Zoomed: ${J.length} symbols`,backgroundColor:r.v2.colors.silver[750],textColor:r.v2.colors.silver[200],textSize:Te.XXS})}),t(fe,{variant:ve.Secondary,size:be.S,label:"Download snapshot",rightIcon:Tl,onClick:()=>{if(!O)return;const e=new Blob([O],{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:!O})]})]}),t(oh,{rows:A,languages:F,instrumentation:z,searchQuery:b,filters:C,onFiltersChange:S,zoomedSymbols:J,highlightSymbol:G,scrollSignal:K})]}),D&&e(dh,{$splitWithTable:_,children:[e(ph,{$justifyContent:"space-between",children:[t(Ke,{label:$?`Total in view ${Eu($.flamebearer.numTicks)}`:"No profile sample yet",backgroundColor:r.v2.colors.silver[750],textColor:r.v2.colors.silver[200],textSize:Te.XXS}),e(pe,{$gap:12,children:[!h&&t(fe,{variant:ve.Secondary,size:be.S,label:"Refresh",leftIcon:ll,onClick:E}),t(le,{label:"Auto refresh",labelAlign:re.Left,size:Nt.S,value:h,onChange:m})]})]}),t(Vu,{flamebearer:$.flamebearer,maxRowPx:24,searchQuery:b,shouldKeepName:M,minHostHeight:280,onFullscreenChange:o,profilingSlots:k??null,onFrameClick:Z,onZoomedSymbolsChange:Q,onResetZoom:te})]})]}):t(mt,{children:t(xe,{title:"No profile samples yet",subTitle:"Dynamically collecting profiling samples — keep this tab open while the agent sends OTLP profiles."})})}),t(Iu,{pendingModify:X,onClose:U,onConfirm:j}),t(Fn,{isOpen:B>0,richTitle:{icon:Ya,title:"Profiling Symbols",badge:{label:B}},actions:[{id:"profiling-bulk-cancel",type:hn.Button,buttonProps:{variant:ve.Secondary,size:be.S,label:"Cancel",onClick:H}},{id:"profiling-bulk-apply",type:hn.Button,buttonProps:{variant:ve.Primary,size:be.S,label:"Modify Rule",leftIcon:Ma,onClick:V}}]})]})},hh=b.div`
733
+ `,yh=({source:n,onFlameFullscreenChange:o})=>{const s=v(),c=n.id,{profilingApi:u}=Gl(),[h,m]=l(!0),[g,f]=l(ph.Both),[b,y]=l(""),[C,S]=l({}),[x,w]=l(!1),T=p(!1);a(()=>{T.current||(T.current=!0,u.enableProfiling?.(c),w(!0))},[u,c]);const{data:k}=u.useSlots({skip:!x,pollInterval:h?3e3:0,fetchPolicy:"network-only"}),{data:I,loading:N,refetch:E}=u.useSourceProfiling(c,{skip:!x,pollInterval:h?3e3:0,fetchPolicy:"network-only"}),O=I?.profileJson??null,$=i(()=>(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}})(O),[O]),A=i(()=>$?(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 i=o[n+1],a=o[n+2],l=_u(e,o[n+3]);if(!l)continue;const r=t.get(l);(!r||i>r.total)&&t.set(l,{self:a,total:i})}}return[...t.entries()].map(([e,t])=>({name:e,self:t.self,total:t.total})).sort((e,t)=>t.self-e.self)})($.flamebearer):[],[$]),R=g===ph.Table||g===ph.Both,D=g===ph.Flame||g===ph.Both,_=R&&D,P=n.runtimeInfo?.detectedLanguages?.join("\0")??"",L=n.containers?.map(e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??"").join("\0")??"",F=i(()=>P?P.split("\0"):L?L.split("\0"):void 0,[P,L]),M=i(()=>((e,t)=>{if(!t?.includes(Dn.Java))return;const n=(e?.[ah.Symbol]?.filter(Boolean)??[]).filter(e=>e===rh.FilterOutVoid||e===rh.OnlyWithReturnValues);return 0!==n.length?e=>ch(e,n):void 0})(C,F),[C,F]),{instrumentation:z,pendingCount:B,pendingModify:X,closeModify:U,openBulkModify:V,resetSelection:H,confirmModify:j}=function({source:e,languages:t,rows:n}){const{instrumentationRulesApi:o,capabilities:a}=Gl(),{items:r}=o.useRules(),[s,c]=l(new Set),[p,u]=l(new Set),[h,m]=l(null),g=i(()=>(e=>{const t=new Set(e??[]);return qu.filter(e=>t.has(e))})(t),[t]),f=a.canCreateInstrumentationRule,b=`${e.id.namespace}\0${e.id.kind}\0${e.id.name}`,v=i(()=>((e,t)=>{const n=e.filter(e=>e.type===Je.CustomInstrumentation&&e.ruleName===Zu&&th(e.sourceScopes,t));return n.find(e=>e.sourceScopes?.sources?.some(e=>eh(e,t.id)))??n[0]??null})(r,e),[r,b]),y=f&&g.length>0,C=i(()=>{const t=new Map;for(const o of n){const n=!!Qu(o.name,g),i=ih(o.name,e,g,r),a=!!v&&i.some(e=>e.rule.ruleId===v.ruleId),l=i.filter(e=>e.rule.ruleId!==v?.ruleId),s=!a&&l.length>0,c=y&&n,d=s;let p;if(s){const e=[...new Set(l.map(e=>e.rule.ruleName))];p=`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 u=!1,h="Add this symbol to the “Profiling Symbols” rule";s?h=p??"Managed by another rule":0===i.length&&(0===g.length?h="Custom instrumentation is only available for Go and Java sources":f?n?u=!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:a,otherRules:l,showCheckbox:c,checkboxDisabled:d,checkboxTooltip:p,addEnabled:u,addTooltip:h})}return t},[n,r,b,g,f,y,v]),S=i(()=>{const e=new Set;return C.forEach((t,n)=>{t.inManagedRule&&e.add(n)}),e},[C]),x=i(()=>[...s].filter(e=>C.get(e)?.addEnabled&&!S.has(e)),[s,C,S]),w=i(()=>[...p].filter(e=>S.has(e)),[p,S]),T=x.length+w.length,k=d(e=>{const t=C.get(e);return t?.inManagedRule?!p.has(e):!!(t&&t.otherRules.length>0)||s.has(e)},[C,p,s]),I=d((e,t)=>{const n=C.get(e);n&&!n.checkboxDisabled&&(n.inManagedRule?u(n=>{const o=new Set(n);return t?o.delete(e):o.add(e),o}):c(n=>{const o=new Set(n);return t?o.add(e):o.delete(e),o}))},[C]),N=d(()=>{c(new Set),u(new Set)},[]),E=d(t=>{(async()=>{const n=t.add.map(e=>Qu(e,g)).filter(e=>!!e),i=t.remove.map(e=>Qu(e,g)).filter(e=>!!e);if(v){const{customInstrumentations:e,isEmpty:t}=((e,t,n)=>{const o=e.customInstrumentations??{};let i=[...o[Ke.Golang]??[]],a=[...o[Ke.Java]??[]];for(const e of n)e.golang&&(i=i.filter(t=>!nh(t,e.golang))),e.java&&(a=a.filter(t=>!oh(t,e.java)));for(const e of t)e.golang&&!i.some(t=>nh(t,e.golang))&&i.push(e.golang),e.java&&!a.some(t=>oh(t,e.java))&&a.push(e.java);return{customInstrumentations:{[Ke.Golang]:i,[Ke.Java]:a},isEmpty:0===i.length&&0===a.length}})(v,n,i);t?await o.remove(v.ruleId,Je.CustomInstrumentation):await o.update(v.ruleId,((e,t)=>({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}))(v,e),Je.CustomInstrumentation)}else n.length>0&&await o.create(((e,t)=>{const n=e.map(e=>e.golang).filter(e=>!!e),o=e.map(e=>e.java).filter(e=>!!e),i={sources:[{namespace:t.id.namespace,name:t.id.name,kind:t.id.kind}],namespaces:[],languages:[]};return{ruleName:Zu,notes:"Symbols selected from the profiling tab.",disabled:!1,sourceScopes:i,workloads:null,instrumentationLibraries:null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:{[Ke.Golang]:n,[Ke.Java]:o}}})(n,e),Je.CustomInstrumentation)})()},[v,g,e,o]),O=d(()=>{T&&m({add:x,remove:w})},[T,x,w]),$=d(e=>m({add:[e],remove:[]}),[]),A=d(e=>m({add:[],remove:[e]}),[]),R=d(()=>m(null),[]),D=d(()=>{h&&(E(h),m(null),N())},[h,E,N]),_=d(e=>C.get(e)??{parsable:!1,inManagedRule:!1,otherRules:[],showCheckbox:!1,checkboxDisabled:!1,addEnabled:!1,addTooltip:"Custom instrumentation is only available for Go and Java sources"},[C]);return{instrumentation:i(()=>({getSymbolState:_,onAdd:$,onRemove:A,selectionEnabled:y,isSelected:k,onToggleSymbol:I}),[_,$,A,y,k,I]),pendingCount:T,pendingModify:h,closeModify:R,openBulkModify:O,resetSelection:N,confirmModify:D}}({source:n,languages:F,rows:A}),[G,W]=l(null),[K,Y]=l(0),[J,q]=l(null),Z=d(e=>{W(e),Y(e=>e+1),f(e=>e===ph.Flame?ph.Both:e)},[]),Q=d(e=>{q(t=>{if(null===e)return null===t?t:null;if(t&&t.length===e.length){const n=new Set(t);if(e.every(e=>n.has(e)))return t}return e})},[]),ie=d(()=>W(null),[]);return!O&&N?t(ft,{$height:"70vh",children:t(St,{withSpinner:!0})}):e(uh,{$gap:0,$width:"100%",children:[e(hh,{children:[t(Ue,{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(mh,{children:t(ee,{size:te.S,weight:500,color:ne.Primary,nowrap:!0,children:"CPU Profiling"})})}),e(oe,{style:{flex:1,minWidth:200,gap:10,alignItems:"center",flexWrap:"wrap"},children:[t("div",{style:{flex:"1 1 220px",minWidth:180},children:t(fn,{value:b,onChange:y,placeholder:"Search by symbol name",width:"100%",idleBackgroundColor:s.v2.colors.silver[900],emphasizeBackgroundColor:s.v2.colors.silver[800]})}),t(ve,{variant:Fn.Filled,options:[{value:ph.Table,label:"Top table"},{value:ph.Flame,label:"Flame graph"},{value:ph.Both,label:"Both"}],selected:g,setSelected:f}),t(Te,h?{variant:Ie.Secondary,size:ke.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(Il,{...e,size:8,fill:s.v2.colors.green[500]})}:{variant:Ie.Secondary,size:ke.S,label:"Paused",tooltip:"Odigos profiler is still collecting data, but the UI is not updating in real time",leftIcon:e=>t(Il,{...e,size:8,fill:s.v2.colors.red[500]})})]})]}),t(gh,{$gap:R&&D?16:0,children:$?e(r,{children:[R&&e(fh,{$splitWithFlame:_,children:[e(vh,{$justifyContent:"space-between",children:[e(ae,{$margin:"0 0 0 20px",children:[t(ee,{size:te.XXXS,nowrap:!0,children:"Please select symbols to"}),e(oe,{$gap:8,children:[e(oe,{children:[t(Nl,{size:24}),t(ee,{size:te.S,color:ne.Success,nowrap:!0,children:"Custom Instrument"})]}),t(Te,{leftIcon:Va,variant:Ie.Secondary,size:ke.S,onClick:()=>window.open(`${Le}/enterprise/pipeline/rules/custominstrumentation`,"_blank","noopener noreferrer")})]})]}),e(oe,{$gap:8,children:[J&&t(Ue,{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(ce,{label:`Zoomed: ${J.length} symbols`,backgroundColor:s.v2.colors.silver[750],textColor:s.v2.colors.silver[200],textSize:te.XXS})}),t(Te,{variant:Ie.Secondary,size:ke.S,label:"Download snapshot",rightIcon:El,onClick:()=>{if(!O)return;const e=new Blob([O],{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:!O})]})]}),t(dh,{rows:A,languages:F,instrumentation:z,searchQuery:b,filters:C,onFiltersChange:S,zoomedSymbols:J,highlightSymbol:G,scrollSignal:K})]}),D&&e(bh,{$splitWithTable:_,children:[e(vh,{$justifyContent:"space-between",children:[t(ce,{label:$?`Total in view ${Pu($.flamebearer.numTicks)}`:"No profile sample yet",backgroundColor:s.v2.colors.silver[750],textColor:s.v2.colors.silver[200],textSize:te.XXS}),e(oe,{$gap:12,children:[!h&&t(Te,{variant:Ie.Secondary,size:ke.S,label:"Refresh",leftIcon:pl,onClick:E}),t(ge,{label:"Auto refresh",labelAlign:fe.Left,size:Et.S,value:h,onChange:m})]})]}),t(Ju,{flamebearer:$.flamebearer,maxRowPx:24,searchQuery:b,shouldKeepName:M,minHostHeight:280,onFullscreenChange:o,profilingSlots:k??null,onFrameClick:Z,onZoomedSymbolsChange:Q,onResetZoom:ie})]})]}):t(ft,{children:t($e,{title:"No profile samples yet",subTitle:"Dynamically collecting profiling samples — keep this tab open while the agent sends OTLP profiles."})})}),t(Du,{pendingModify:X,onClose:U,onConfirm:j}),t(Bn,{isOpen:B>0,richTitle:{icon:el,title:"Profiling Symbols",badge:{label:B}},actions:[{id:"profiling-bulk-cancel",type:gn.Button,buttonProps:{variant:Ie.Secondary,size:ke.S,label:"Cancel",onClick:H}},{id:"profiling-bulk-apply",type:gn.Button,buttonProps:{variant:Ie.Primary,size:ke.S,label:"Modify Rule",leftIcon:ja,onClick:V}}]})]})},Ch=b.div`
735
734
  position: relative;
736
735
  display: flex;
737
736
  align-items: center;
@@ -739,23 +738,23 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
739
738
  padding: 8px 16px;
740
739
  border-radius: 12px;
741
740
  background-color: ${({theme:e})=>e.v2.colors.silver[700]};
742
- `,mh=b.div`
741
+ `,Sh=b.div`
743
742
  display: flex;
744
743
  flex-direction: column;
745
744
  gap: 4px;
746
745
  flex: 1;
747
746
  min-width: 0;
748
747
  opacity: ${({$disabled:e})=>e?.4:1};
749
- `,gh=b.div`
748
+ `,xh=b.div`
750
749
  flex-shrink: 0;
751
750
  display: flex;
752
751
  align-items: center;
753
752
  margin-right: ${({$reserveJumpSpace:e})=>e?"32px":"0"};
754
- `,fh=b.div`
753
+ `,wh=b.div`
755
754
  min-width: 0;
756
755
  white-space: pre;
757
756
  overflow-x: auto;
758
- `,bh=b.div`
757
+ `,Th=b.div`
759
758
  position: absolute;
760
759
  top: 50%;
761
760
  right: 8px;
@@ -764,24 +763,24 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
764
763
  pointer-events: none;
765
764
  transition: opacity 0.15s ease;
766
765
 
767
- ${hh}:hover & {
766
+ ${Ch}:hover & {
768
767
  opacity: 1;
769
768
  pointer-events: auto;
770
769
  }
771
- `,vh=({name:n,summary:o,disabled:i=!1,onJumpToRule:a})=>{const l=v();return e(hh,{children:[e(mh,{$disabled:i,children:[n&&t(_e,{size:Te.XXXS,color:Pe.Secondary,nowrap:!0,children:n}),t(fh,{children:t(w,{parts:o})})]}),i&&t(gh,{$reserveJumpSpace:!!a,children:t(Ke,{label:Mn,textSize:Te.XXXS,backgroundColor:l.v2.colors.grey[700],textColor:l.v2.colors.grey[300]})}),a&&t(bh,{children:t(Fe,{text:Ze.OPEN_IN_SAMPLING_PAGE,children:t(fe,{"data-id":"sampling-rule-jump",variant:ve.Primary,size:be.S,leftIcon:Cl,onClick:a})})})]})},yh=b.div`
770
+ `,kh=({name:n,summary:o,disabled:i=!1,onJumpToRule:a})=>{const l=v();return e(Ch,{children:[e(Sh,{$disabled:i,children:[n&&t(ee,{size:te.XXXS,color:ne.Secondary,nowrap:!0,children:n}),t(wh,{children:t(w,{parts:o})})]}),i&&t(xh,{$reserveJumpSpace:!!a,children:t(ce,{label:Xn,textSize:te.XXXS,backgroundColor:l.v2.colors.grey[700],textColor:l.v2.colors.grey[300]})}),a&&t(Th,{children:t(Ue,{text:nt.OPEN_IN_SAMPLING_PAGE,children:t(Te,{"data-id":"sampling-rule-jump",variant:Ie.Primary,size:ke.S,leftIcon:Tl,onClick:a})})})]})},Ih=b.div`
772
771
  opacity: 0;
773
772
  pointer-events: none;
774
773
  transition: opacity 0.15s ease;
775
- `,Ch=b.div`
776
- &:hover ${yh} {
774
+ `,Nh=b.div`
775
+ &:hover ${Ih} {
777
776
  opacity: 1;
778
777
  pointer-events: auto;
779
778
  }
780
- `,Sh=b.div`
779
+ `,Eh=b.div`
781
780
  display: flex;
782
781
  align-items: center;
783
782
  padding: 4px 12px;
784
- `,xh=({source:e,onRedirectToSampling:n})=>t(Vt,{bgTint:"1000",richTitle:{title:Ze.CONTAINERS,badge:{label:e.containers?.length??0}},children:e.containers?.map(e=>t(kh,{container:e,onRedirectToSampling:n},e.containerName))});var wh;(e=>{e.All="all",e.Noisy="noisy",e.HighlyRelevant="highly-relevant",e.CostReduction="cost-reduction"})(wh||(wh={}));const Th=e=>"noisy"===e.type?T(e.rule,"source"):"highlyRelevant"===e.type?k(e.rule,"source"):"costReduction"===e.type?I(e.rule,"source"):[],kh=({container:n,onRedirectToSampling:o})=>{const[i,l]=a(wh.All),r=fn(e=>e.setPendingViewSamplingRule),s=n.agentConfig?.traces?.headSampling?.noisyOperations??[],d=c(()=>(n.collectorConfig?.tailSampling?.noisyOperations??[]).map(e=>({type:"noisy",rule:e})),[n.agentConfig?.traces?.headSampling?.noisyOperations]),p=c(()=>(n.collectorConfig?.tailSampling?.highlyRelevantOperations??[]).map(e=>({type:"highlyRelevant",rule:e})),[n.collectorConfig?.tailSampling?.highlyRelevantOperations]),u=c(()=>(n.collectorConfig?.tailSampling?.costReductionRules??[]).map(e=>({type:"costReduction",rule:e})),[n.collectorConfig?.tailSampling?.costReductionRules]),h=c(()=>i===wh.Noisy?d:i===wh.HighlyRelevant?p:i===wh.CostReduction?u:[...d,...p,...u],[i,p,u]),m=d.length+p.length+u.length,g=c(()=>(e,t)=>{r({ruleId:e,category:t}),o()},[o,r]),f=t(yh,{children:t(fe,{"data-id":"sampling-container-create-rule",variant:ve.Secondary,size:be.S,label:zn,rightIcon:Ra,onClick:e=>{e.stopPropagation(),o()}})});return t(Ch,{children:e(Vt,{bgTint:"900",richTitle:{title:n.containerName},renderOnRightSide:f,withCollapse:!0,collapseIsDefaultOpen:!0,children:[s.length?e(Vt,{bgTint:"800",richTitle:{title:Ze.HEAD_SAMPLING,badge:{label:s.length}},children:[t(_e,{size:Te.XXS,children:Ze.NOISY_OPERATIONS}),t(ee,{$gap:4,children:s.map(e=>t(vh,{name:e.name,summary:T(e),disabled:e.disabled,onJumpToRule:()=>g(e.ruleId,"noisy")},e.ruleId))})]}):t(Sh,{children:t(_e,{size:Te.XS,color:Pe.Secondary,children:Ze.HEAD_SAMPLING})}),m?e(Vt,{bgTint:"800",richTitle:{title:Ze.TAIL_SAMPLING,badge:{label:m}},children:[t(ce,{options:(b=d.length,v=p.length,y=u.length,[{value:wh.All,label:"All",badge:{label:b+v+y,textSize:Te.XXXS}},{value:wh.Noisy,label:Ze.NOISY_OPERATIONS,badge:{label:b,textSize:Te.XXXS}},{value:wh.HighlyRelevant,label:Ze.HIGHLY_RELEVANT_OPERATIONS,badge:{label:v,textSize:Te.XXXS}},{value:wh.CostReduction,label:Ze.COST_REDUCTION_OPERATIONS,badge:{label:y,textSize:Te.XXXS}}]),selected:i,setSelected:l}),t(ee,{$gap:4,children:h.length?h.map(e=>t(vh,{name:e.rule.name,summary:Th(e),disabled:e.rule.disabled,onJumpToRule:()=>g(e.rule.ruleId,e.type)},e.rule.ruleId)):t(xe,{title:`No ${i===wh.All?`${wh.Noisy}, ${wh.HighlyRelevant} and ${wh.CostReduction}`:i} operations`})})]}):t(Sh,{children:t(_e,{size:Te.XS,color:Pe.Secondary,children:Ze.TAIL_SAMPLING})})]})});var b,v,y},Ih=[xn.Deployment,xn.StatefulSet,xn.DaemonSet,xn.DeploymentConfig,xn.Rollout,xn.Pod];var Nh;(e=>{e.Workload="Workload",e.Pod="Pod"})(Nh||(Nh={}));const Eh=e=>!!e&&rn(e.status)===Ee.Error,Oh=e=>Eh(e.healthStatus),$h=e=>Eh(e.odigosHealthStatus)||(e.processes??[]).some(Oh),Ah=e=>Eh(e.agentInjectedStatus)||Eh(e.odigosHealthStatus)||(e.containers??[]).some($h),Rh=({onClose:n,sourceId:o,onRedirectToSampling:l})=>{const r=v(),{isVm:s,isConnector:u,isK8s:h}=S(),{sourcesApi:m,configApi:g}=Vl(),{selectedStreamName:f}=Qe(),{genericForm:b,loadSource:y,validateFormData:C}=Wl(),{data:x}=g.useEffectiveConfig(),[w,T]=a(!1),[k,I]=a(!1),[N,E]=a(!1),[O,$]=a(sp.Overview),[A,R]=a(null),[D,_]=a({openFor:null}),P=(()=>{const[e,t]=a(null),n=d(e=>{t({tab:sp.Pods,podName:e.podName})},[]),o=d((e,n)=>{t({tab:sp.Pods,podName:e.podName,containerName:n.containerName})},[]),i=d((e,n,o)=>{const i=mp({identifyingAttributes:o.identifyingAttributes});t({tab:sp.Pods,podName:e.podName,containerName:n.containerName,processPid:i})},[]),l=d(()=>t(null),[]);return c(()=>({jumpToTarget:e,jumpToPod:n,jumpToContainer:o,jumpToProcess:i,clearJumpToTarget:l}),[e,n,o,i,l])})();i(()=>{P.jumpToTarget&&$(P.jumpToTarget.tab)},[P.jumpToTarget]),i(()=>{A&&JSON.stringify(bn(o))!==JSON.stringify(bn(A))&&R(null)},[o,A]);const L=p(!1),F=d(async()=>R(await m.fetchById(o)||null),[o,m]);i(()=>{if(L.current||(F(),L.current=!0),!w){const e=setInterval(()=>F(),3e3);return()=>clearInterval(e)}},[F,w]),i(()=>{A&&y(A)},[A]);const M=A&&Ih.includes(A.id.kind),z=c(()=>{const e=[],n=(A?.pods??[]).some(Ah),o=(i=A,(i?.containers??[]).some(e=>(e.instrumentations??[]).some(e=>!1===e.healthy)));var i;const a=e=>t(pl,{...e,fill:r.v2.colors.red[500]});return e.push({value:sp.Overview,label:Ze.OVERVIEW}),h?(e.push({value:sp.Pods,label:Ze.PODS,icon:n?a:void 0}),e.push({value:sp.Libraries,label:Ze.LIBRARIES,icon:o?a:void 0}),e.push({value:sp.PeerSources,label:Ze.PEER_SOURCES}),x?.profiling?.enabled&&e.push({value:sp.Profiling,label:Ze.PROFILING}),e.push({value:sp.Sampling,label:Ze.SAMPLING}),e.push({value:sp.Debug,label:Ze.DEBUG}),e):e},[h,x,A?.pods,r]),B=d(()=>T(!0),[]),X=c(()=>()=>{n(),l()},[n,l]),U=d(()=>{A&&y(A),T(!1)},[A]),V=d(async()=>{if(!A||!b)return;const{errorMessage:e,preparedFormData:t}=C();if(e)return;const n=t.otelServiceName!==A.id.name?t.otelServiceName:"";await m.update(o,{...t,otelServiceName:n}),T(!1)},[A,b,C,o,m]),H=d(()=>I(!0),[]),j=d(async()=>{A&&(await m.persistV2({[At]:[{namespace:A.id.namespace,name:A.id.name,kind:A.id.kind,region:A.id.region??"",selected:!1,currentStreamName:f}]}),I(!1),n())},[A,m,f,n]),G=d(()=>{_({openFor:Nh.Workload})},[]),W=d(e=>{$(e),P.clearJumpToTarget()},[P]),K=d(async()=>{await m.recoverFromRollback(o)},[m,o]),Y=d(()=>_({openFor:null}),[]),J=d(async()=>{D.openFor===Nh.Workload?await m.restartWorkloads([o]):D.openFor===Nh.Pod&&D.podNamespace&&D.podName&&await m.restartPod(D.podNamespace,D.podName),Y()},[D,m,o,Y]),q=c(()=>{const{kind:e,name:t}=o;return{title:`Rollout ${e}`,description:`Are you sure you want to rollout the ${e.toLowerCase()} "${t}"?`}},[o]),Z=c(()=>{const e=[];return w||O===sp.Overview&&(e.push({id:"edit-source-btn-edit",label:Lt.EDIT,icon:Ma,active:w,onClick:B}),h&&M&&e.push({id:"edit-source-btn-restart",label:Ze.ROLLOUT_RESTART,icon:bl,onClick:G}),e.push({id:"edit-source-btn-delete",label:Lt.UNINSTRUMENT,icon:Aa,color:r.v2.colors.red[500],active:k,onClick:H})),e},[O,w,k,h,M,B,G,H,r]),Q=c(()=>{if(!A)return[];const e=[],t={backgroundColor:"transparent",textSize:Te.S};return e.push({...t,label:A.id.name,leftIcon:h?dl:void 0}),A.serviceName&&A.serviceName!==A.id.name&&e.push({...t,label:A.serviceName,leftIcon:cl,textColor:r.v2.colors.silver[200]}),e},[A,r,h]);if(!A)return t(Mt,{isOpen:!0,children:t(mt,{$height:"80vh",children:t(yt,{withSpinner:!0})})});const te=O===sp.Profiling?N?"95vw":"fit-content":w?void 0:"60vw",ne=s?kl:u?tl:Bn(A.containers)[0];return e(wp,{value:P,children:[t(Mt,{isOpen:!0,width:te,minWidth:"min(1100px, 100vw)",header:{icon:ne,titleBadges:Q,onClose:()=>{W(sp.Overview),R(null),E(!1),n()},actions:Z},footer:{actions:w?[{"data-id":"edit-source-btn-cancel",label:Lt.CANCEL,variant:ve.Secondary,onClick:U},{"data-id":"edit-source-btn-save",label:Lt.SAVE,variant:ve.Primary,onClick:V}]:[]},children:t(ut,{$padding:"4px 12px 12px",children:e(ee,{$gap:16,children:[!w&&z.length>1&&t(ce,{options:z,selected:O,setSelected:W}),(()=>{switch(O){case sp.Overview:return w?t(Es,{}):t(xu,{source:A,onClickRollout:G,onClickRollback:K});case sp.Pods:return t(Ep,{source:A,onClickRestartPod:M?(e,t)=>_({openFor:Nh.Pod,podNamespace:e,podName:t}):void 0});case sp.Libraries:return t(wu,{source:A});case sp.PeerSources:return t($p,{source:A});case sp.Profiling:return t(uh,{source:A,onFlameFullscreenChange:E});case sp.Sampling:return t(xh,{source:A,onRedirectToSampling:X});case sp.Debug:return t(Pp,{source:A});default:return null}})()]})})}),t(Er,{target:"source",action:"uninstrument",isOpen:k,onClose:()=>I(!1),onApprove:j}),t(qe,{isOpen:D.openFor===Nh.Workload,title:q.title,description:q.description,onClose:Y,denyButton:{label:"Go back",variant:ve.Secondary,onClick:Y},approveButton:{label:Lt.CONFIRM,variant:ve.Primary,onClick:J}}),t(Er,{target:"pod",action:"restart",description:Ze.ROLLOUT_RESTART_WORKLOADS_DESCRIPTION,isOpen:D.openFor===Nh.Pod,onClose:Y,onApprove:J,overrideApproveButtonLabel:Ze.DELETE_POD_TO_RESTART})]})},Dh=b.div`
783
+ `,Oh=({source:e,onRedirectToSampling:n})=>t(Wt,{bgTint:"1000",richTitle:{title:nt.CONTAINERS,badge:{label:e.containers?.length??0}},children:e.containers?.map(e=>t(Rh,{container:e,onRedirectToSampling:n},e.containerName))});var $h;(e=>{e.All="all",e.Noisy="noisy",e.HighlyRelevant="highly-relevant",e.CostReduction="cost-reduction"})($h||($h={}));const Ah=e=>"noisy"===e.type?T(e.rule,"source"):"highlyRelevant"===e.type?k(e.rule,"source"):"costReduction"===e.type?I(e.rule,"source"):[],Rh=({container:n,onRedirectToSampling:o})=>{const[a,r]=l($h.All),s=vn(e=>e.setPendingViewSamplingRule),c=n.agentConfig?.traces?.headSampling?.noisyOperations??[],d=i(()=>(n.collectorConfig?.tailSampling?.noisyOperations??[]).map(e=>({type:"noisy",rule:e})),[n.agentConfig?.traces?.headSampling?.noisyOperations]),p=i(()=>(n.collectorConfig?.tailSampling?.highlyRelevantOperations??[]).map(e=>({type:"highlyRelevant",rule:e})),[n.collectorConfig?.tailSampling?.highlyRelevantOperations]),u=i(()=>(n.collectorConfig?.tailSampling?.costReductionRules??[]).map(e=>({type:"costReduction",rule:e})),[n.collectorConfig?.tailSampling?.costReductionRules]),h=i(()=>a===$h.Noisy?d:a===$h.HighlyRelevant?p:a===$h.CostReduction?u:[...d,...p,...u],[a,p,u]),m=d.length+p.length+u.length,g=i(()=>(e,t)=>{s({ruleId:e,category:t}),o()},[o,s]),f=t(Ih,{children:t(Te,{"data-id":"sampling-container-create-rule",variant:Ie.Secondary,size:ke.S,label:Un,rightIcon:za,onClick:e=>{e.stopPropagation(),o()}})});return t(Nh,{children:e(Wt,{bgTint:"900",richTitle:{title:n.containerName},renderOnRightSide:f,withCollapse:!0,collapseIsDefaultOpen:!0,children:[c.length?e(Wt,{bgTint:"800",richTitle:{title:nt.HEAD_SAMPLING,badge:{label:c.length}},children:[t(ee,{size:te.XXS,children:nt.NOISY_OPERATIONS}),t(ae,{$gap:4,children:c.map(e=>t(kh,{name:e.name,summary:T(e),disabled:e.disabled,onJumpToRule:()=>g(e.ruleId,"noisy")},e.ruleId))})]}):t(Eh,{children:t(ee,{size:te.XS,color:ne.Secondary,children:nt.HEAD_SAMPLING})}),m?e(Wt,{bgTint:"800",richTitle:{title:nt.TAIL_SAMPLING,badge:{label:m}},children:[t(ve,{options:(b=d.length,v=p.length,y=u.length,[{value:$h.All,label:"All",badge:{label:b+v+y,textSize:te.XXXS}},{value:$h.Noisy,label:nt.NOISY_OPERATIONS,badge:{label:b,textSize:te.XXXS}},{value:$h.HighlyRelevant,label:nt.HIGHLY_RELEVANT_OPERATIONS,badge:{label:v,textSize:te.XXXS}},{value:$h.CostReduction,label:nt.COST_REDUCTION_OPERATIONS,badge:{label:y,textSize:te.XXXS}}]),selected:a,setSelected:r}),t(ae,{$gap:4,children:h.length?h.map(e=>t(kh,{name:e.rule.name,summary:Ah(e),disabled:e.rule.disabled,onJumpToRule:()=>g(e.rule.ruleId,e.type)},e.rule.ruleId)):t($e,{title:`No ${a===$h.All?`${$h.Noisy}, ${$h.HighlyRelevant} and ${$h.CostReduction}`:a} operations`})})]}):t(Eh,{children:t(ee,{size:te.XS,color:ne.Secondary,children:nt.TAIL_SAMPLING})})]})});var b,v,y},Dh=[Tn.Deployment,Tn.StatefulSet,Tn.DaemonSet,Tn.DeploymentConfig,Tn.Rollout,Tn.Pod];var _h;(e=>{e.Workload="Workload",e.Pod="Pod"})(_h||(_h={}));const Ph=e=>!!e&&cn(e.status)===Pe.Error,Lh=e=>Ph(e.healthStatus),Fh=e=>Ph(e.odigosHealthStatus)||(e.processes??[]).some(Lh),Mh=e=>Ph(e.agentInjectedStatus)||Ph(e.odigosHealthStatus)||(e.containers??[]).some(Fh),zh=({onClose:n,sourceId:o,onRedirectToSampling:r})=>{const s=v(),{isK8s:c,platformType:u}=S(),{sourcesApi:h,configApi:m}=Gl(),{selectedStreamName:g}=ot(),{genericForm:f,loadSource:b,validateFormData:y}=Jl(),{data:C}=m.useEffectiveConfig(),[x,w]=l(!1),[T,k]=l(!1),[I,N]=l(!1),[E,O]=l(gp.Overview),[$,A]=l(null),[R,D]=l({openFor:null}),_=(()=>{const[e,t]=l(null),n=d(e=>{t({tab:gp.Pods,podName:e.podName})},[]),o=d((e,n)=>{t({tab:gp.Pods,podName:e.podName,containerName:n.containerName})},[]),a=d((e,n,o)=>{const i=Sp({identifyingAttributes:o.identifyingAttributes});t({tab:gp.Pods,podName:e.podName,containerName:n.containerName,processPid:i})},[]),r=d(()=>t(null),[]);return i(()=>({jumpToTarget:e,jumpToPod:n,jumpToContainer:o,jumpToProcess:a,clearJumpToTarget:r}),[e,n,o,a,r])})();a(()=>{_.jumpToTarget&&O(_.jumpToTarget.tab)},[_.jumpToTarget]),a(()=>{$&&JSON.stringify(yn(o))!==JSON.stringify(yn($))&&A(null)},[o,$]);const P=p(!1),L=d(async()=>A(await h.fetchById(o)||null),[o,h]);a(()=>{if(P.current||(L(),P.current=!0),!x){const e=setInterval(()=>L(),3e3);return()=>clearInterval(e)}},[L,x]),a(()=>{$&&b($)},[$]);const F=$&&Dh.includes($.id.kind),M=i(()=>{const e=[],n=($?.pods??[]).some(Mh),o=(i=$,(i?.containers??[]).some(e=>(e.instrumentations??[]).some(e=>!1===e.healthy)));var i;const a=e=>t(gl,{...e,fill:s.v2.colors.red[500]});return e.push({value:gp.Overview,label:nt.OVERVIEW}),c?(e.push({value:gp.Pods,label:nt.PODS,icon:n?a:void 0}),e.push({value:gp.Libraries,label:nt.LIBRARIES,icon:o?a:void 0}),e.push({value:gp.PeerSources,label:nt.PEER_SOURCES}),C?.profiling?.enabled&&e.push({value:gp.Profiling,label:nt.PROFILING}),e.push({value:gp.Sampling,label:nt.SAMPLING}),e.push({value:gp.Debug,label:nt.DEBUG}),e):e},[c,C,$?.pods,s]),z=d(()=>w(!0),[]),B=i(()=>()=>{n(),r()},[n,r]),X=d(()=>{$&&b($),w(!1)},[$]),U=d(async()=>{if(!$||!f)return;const{errorMessage:e,preparedFormData:t}=y();if(e)return;const n=t.otelServiceName!==$.id.name?t.otelServiceName:"";await h.update(o,{...t,otelServiceName:n}),w(!1)},[$,f,y,o,h]),V=d(()=>k(!0),[]),H=d(async()=>{$&&(await h.persistV2({[Rt]:[{namespace:$.id.namespace,name:$.id.name,kind:$.id.kind,region:$.id.region??"",selected:!1,currentStreamName:g}]}),k(!1),n())},[$,h,g,n]),j=d(()=>{D({openFor:_h.Workload})},[]),G=d(e=>{O(e),_.clearJumpToTarget()},[_]),W=d(async()=>{await h.recoverFromRollback(o)},[h,o]),K=d(()=>D({openFor:null}),[]),Y=d(async()=>{R.openFor===_h.Workload?await h.restartWorkloads([o]):R.openFor===_h.Pod&&R.podNamespace&&R.podName&&await h.restartPod(R.podNamespace,R.podName),K()},[R,h,o,K]),J=i(()=>{const{kind:e,name:t}=o;return{title:`Rollout ${e}`,description:`Are you sure you want to rollout the ${e.toLowerCase()} "${t}"?`}},[o]),q=i(()=>{const e=[];return x||E===gp.Overview&&(e.push({id:"edit-source-btn-edit",label:Ft.EDIT,icon:ja,active:x,onClick:z}),c&&F&&e.push({id:"edit-source-btn-restart",label:nt.ROLLOUT_RESTART,icon:Sl,onClick:j}),e.push({id:"edit-source-btn-delete",label:Ft.UNINSTRUMENT,icon:Ma,color:s.v2.colors.red[500],active:T,onClick:V})),e},[E,x,T,c,F,z,j,V,s]),Z=i(()=>{if(!$)return[];const e=[],t={backgroundColor:"transparent",textSize:te.S};return e.push({...t,label:$.id.name,leftIcon:c?ml:void 0}),$.serviceName&&$.serviceName!==$.id.name&&e.push({...t,label:$.serviceName,leftIcon:sl,textColor:s.v2.colors.silver[200]}),e},[$,s,c]);if(!$)return t(zt,{isOpen:!0,children:t(ft,{$height:"80vh",children:t(St,{withSpinner:!0})})});const Q=E===gp.Profiling?I?"95vw":"fit-content":x?void 0:"60vw",ee=c?Hn($.containers)[0]:Vn(u);return e($p,{value:_,children:[t(zt,{isOpen:!0,width:Q,minWidth:"min(1100px, 100vw)",header:{icon:ee,titleBadges:Z,onClose:()=>{G(gp.Overview),A(null),N(!1),n()},actions:q},footer:{actions:x?[{"data-id":"edit-source-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:X},{"data-id":"edit-source-btn-save",label:Ft.SAVE,variant:Ie.Primary,onClick:U}]:[]},children:t(le,{$padding:"4px 12px 12px",children:e(ae,{$gap:16,children:[!x&&M.length>1&&t(ve,{options:M,selected:E,setSelected:G}),(()=>{switch(E){case gp.Overview:return x?t(Xs,{}):t(Ou,{source:$,onClickRollout:j,onClickRollback:W});case gp.Pods:return t(Pp,{source:$,onClickRestartPod:F?(e,t)=>D({openFor:_h.Pod,podNamespace:e,podName:t}):void 0});case gp.Libraries:return t($u,{source:$});case gp.PeerSources:return t(Fp,{source:$});case gp.Profiling:return t(yh,{source:$,onFlameFullscreenChange:N});case gp.Sampling:return t(Oh,{source:$,onRedirectToSampling:B});case gp.Debug:return t(Up,{source:$});default:return null}})()]})})}),t(Ar,{target:"source",action:"uninstrument",isOpen:T,onClose:()=>k(!1),onApprove:H}),t(tt,{isOpen:R.openFor===_h.Workload,title:J.title,description:J.description,onClose:K,denyButton:{label:"Go back",variant:Ie.Secondary,onClick:K},approveButton:{label:Ft.CONFIRM,variant:Ie.Primary,onClick:Y}}),t(Ar,{target:"pod",action:"restart",description:nt.ROLLOUT_RESTART_WORKLOADS_DESCRIPTION,isOpen:R.openFor===_h.Pod,onClose:K,onApprove:Y,overrideApproveButtonLabel:nt.DELETE_POD_TO_RESTART})]})},Bh=b.div`
785
784
  display: flex;
786
785
  align-items: center;
787
786
  gap: 8px;
@@ -791,9 +790,9 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
791
790
  &:hover {
792
791
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
793
792
  }
794
- `,_h=b.div`
793
+ `,Xh=b.div`
795
794
  flex: 1;
796
- `,Ph=({onClick:n})=>{const o=v().v2.colors.red[500];return e(Dh,{"data-id":"sampling-view-btn-delete",onClick:n,children:[t(_e,{size:Te.XS,weight:500,color:o,children:Hn}),t(Aa,{size:16,fill:o})]})};const Lh={[Yl.EditAutoNoisy]:{title:io,subTitle:oo,cancelId:"sampling-edit-auto-rule-btn-cancel",saveId:"sampling-edit-auto-rule-btn-save"},[Yl.EditAutoCostReduction]:{title:no,subTitle:to,cancelId:"sampling-edit-cost-reduction-auto-rule-btn-cancel",saveId:"sampling-edit-cost-reduction-auto-rule-btn-save"},[Yl.EditAutoHighlyRelevant]:{title:eo,subTitle:Qn,cancelId:"sampling-edit-highly-relevant-auto-rule-btn-cancel",saveId:"sampling-edit-highly-relevant-auto-rule-btn-save"}},Fh=({isOpen:e,title:n,subTitle:o,onClose:i,footer:a,renderBody:l})=>t(Mt,{isOpen:e,width:lo,header:{icon:Il,title:n,subTitle:o,onClose:i},footer:a,children:l?l():t(ut,{$padding:"12px",children:t(_s,{})})}),Mh=({isOpen:o,onClose:l,onSubmit:r,validateForm:s,onNavigateToDuplicate:p})=>{const{category:u,formData:h,resetForm:m,duplicateWarning:g,setDuplicateWarning:f}=Kl(Yl.Create),[b,v]=a(!1);i(()=>{o&&(m(),v(!1))},[o]);const y=d(()=>{v(!1),r(h)},[h,r]),C=d(()=>{if(s){const e=s(h);if(e)return void f(e)}((e,t)=>JSON.stringify(e)===JSON.stringify(N(t)))(h,u)?v(!0):y()},[h,u,s,f,y]),S=c(()=>b?((e,t)=>{switch(e){case"noisy":return T($(t));case"highlyRelevant":return k(O(t));case"costReduction":return I(E(t))}})(u,h):[],[b,u,h]),x={note:g?{status:Ee.Warning,message:g.message,action:p?{"data-id":"sampling-create-btn-view-duplicate",label:"View rule",onClick:()=>p(g.ruleId)}:void 0}:void 0,actions:[{"data-id":"sampling-create-btn-cancel",label:Xn,variant:ve.Secondary,size:be.S,onClick:l},{"data-id":"sampling-create-btn-submit",label:zn,variant:ve.Primary,size:be.S,onClick:C,disabled:!!g}]};return e(n,{children:[t(Fh,{isOpen:o,title:Kn[u],subTitle:jn[u],onClose:l,footer:x}),t(qe,{isOpen:b,title:qn,description:Jn,onClose:()=>v(!1),denyButton:{"data-id":"sampling-create-default-continue-editing",label:Yn,variant:ve.Secondary,onClick:()=>v(!1)},approveButton:{"data-id":"sampling-create-default-confirm",label:zn,variant:ve.Primary,onClick:y},children:e(ee,{$gap:8,$alignItems:"flex-start",style:{width:"100%"},children:[t(_e,{size:Te.XS,weight:500,color:Pe.Secondary,children:Zn}),t("div",{style:{width:"100%"},children:t(fr,{summary:S})})]})})]})},zh=({onClose:o,onDelete:i,onSaveEdit:a,validateForm:l,onNavigateToDuplicate:r})=>{const{data:s,isEditing:p,formData:u,handleEdit:h,handleCancelEdit:m,duplicateWarning:g,setDuplicateWarning:f}=Kl(Yl.View),b=s?.rule.name||Wn,v=p&&s?Gn[s.category]:`${b} preview`,y=d(()=>{if(s&&p){if(l){const e=l(u);if(e)return void f(e)}a(u,s.rule.ruleId,s.samplingId),m()}},[s,p,u,a,l,f,m]),C=d(()=>{s&&i(s.rule.ruleId,s.samplingId)},[s,i]),S=c(()=>{if(!s)return;const i=g?{message:g.message,onViewRule:r?()=>r(g.ruleId):void 0}:null;return function(o){if(o.isEditing){const{onCancelEdit:i,onSave:a,onDelete:l,duplicateWarning:r}=o;return{children:e(n,{children:[t(Ph,{onClick:l}),r&&t(Ne,{status:Ee.Warning,message:r.message,action:r.onViewRule?{"data-id":"sampling-view-edit-btn-view-duplicate",label:"View rule",onClick:r.onViewRule}:void 0}),t(_h,{}),t(fe,{"data-id":"sampling-view-edit-btn-cancel",label:Xn,variant:ve.Secondary,size:be.S,onClick:i}),t(fe,{"data-id":"sampling-view-edit-btn-save",label:Un,variant:ve.Primary,size:be.S,onClick:a,disabled:!!r})]})}}const{onDelete:i,onCancel:a,onEdit:l}=o;return{children:e(n,{children:[t(Ph,{onClick:i}),t(_h,{}),t(fe,{"data-id":"sampling-view-btn-cancel",label:Xn,variant:ve.Secondary,size:be.S,onClick:a}),t(fe,{"data-id":"sampling-view-btn-edit",label:Vn,variant:ve.Primary,size:be.S,onClick:l})]})}}(p?{isEditing:!0,onCancelEdit:m,onSave:y,onDelete:C,duplicateWarning:i}:{isEditing:!1,onDelete:C,onCancel:o,onEdit:h})},[s,p,g,m,y,C,h,o,r]);return t(Fh,{isOpen:!!s,title:v,subTitle:s?jn[s.category]:"",onClose:o,footer:S})},Bh=({isOpen:e,onClose:n,onSave:o})=>{const{localEnabled:i,resolvedPercentage:a}=Kl(Yl.EditAutoNoisy),l=d(()=>o(i,a),[o,i,a]);return t(Vh,{formType:Yl.EditAutoNoisy,isOpen:e,onClose:n,onSave:l})},Xh=({isOpen:e,onClose:n,onSave:o})=>{const{localEnabled:i,resolvedPercentage:a}=Kl(Yl.EditAutoCostReduction),l=d(()=>o(i,a),[o,i,a]);return t(Vh,{formType:Yl.EditAutoCostReduction,isOpen:e,onClose:n,onSave:l})},Uh=({isOpen:e,onClose:n,onSave:o})=>{const{localEnabled:i}=Kl(Yl.EditAutoHighlyRelevant),a=d(()=>o(i),[o,i]);return t(Vh,{formType:Yl.EditAutoHighlyRelevant,isOpen:e,onClose:n,onSave:a})},Vh=({formType:e,isOpen:n,onClose:o,onSave:i})=>{const a=Lh[e];return t(Fh,{isOpen:n,title:a.title,subTitle:a.subTitle,onClose:o,footer:{actions:[{"data-id":a.cancelId,label:Xn,variant:ve.Secondary,size:be.S,onClick:o},{"data-id":a.saveId,label:ao,variant:ve.Primary,size:be.S,onClick:i}]}})},Hh=e=>{switch(e.formType){case Yl.Create:return t(nr,{formType:Yl.Create,category:e.category,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(Mh,{...e})});case Yl.View:return t(nr,{formType:Yl.View,data:e.data,defaultEditMode:e.defaultEditMode,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(zh,{...e})});case Yl.EditAutoNoisy:return t(nr,{formType:Yl.EditAutoNoisy,enabled:e.enabled,keepPercentage:e.keepPercentage,children:t(Bh,{...e})});case Yl.EditAutoCostReduction:return t(nr,{formType:Yl.EditAutoCostReduction,enabled:e.enabled,dropPercentage:e.dropPercentage,children:t(Xh,{...e})});case Yl.EditAutoHighlyRelevant:return t(nr,{formType:Yl.EditAutoHighlyRelevant,enabled:e.enabled,children:t(Uh,{...e})})}},jh=({token:o,isLoading:i,isEditing:a,onEdit:l,onCancel:r,onSave:s,formData:c,handleFormChange:d,handleErrorChange:p,formErrors:u})=>{const{CopyButton:h}=_t(),m=!a||i||!c.newToken;return ro({key:"Enter",active:!m},s),e(pe,a?{$justifyContent:"space-between",$alignItems:"flex-start",$gap:12,children:[t(ye,{type:"password",value:c.newToken,onChange:e=>{d("newToken",e.target.value),p("newToken",void 0)},width:"430px",autoFocus:!0,errorMessage:u.newToken}),t(pe,{$margin:i?"8px 0 0 0":"2px 0 0 0",$alignItems:"center",children:i?t(yt,{title:"Saving...",withGradient:!0}):e(n,{children:[t(fe,{variant:ve.Secondary,size:be.S,leftIcon:Ka,onClick:r,disabled:i}),t(fe,{variant:ve.Primary,size:be.S,leftIcon:Wa,onClick:s,disabled:m})]})})]}:{$justifyContent:"space-between",$gap:12,children:[t(_e,{size:Te.XS,children:new Array(55).fill("•").join("")}),e(pe,{$alignItems:"center",$justifyContent:"space-between",children:[t(h,{value:o}),t(bt,{icon:Ma,onClick:l})]})]})},Gh=({expiresAt:e,callbackValid:n,callbackExpired:o})=>{const{formatTimeAgo:a}=en(),l=c(()=>a(e),[e,a]),r=c(()=>new Date(e).toDateString().split(" ").slice(1).join(" "),[e]),s=c(()=>so(e,0)?Ee.Error:so(e,2592e6)?Ee.Warning:Ee.Success,[e]),d=c(()=>s===Ee.Success?Wa:s===Ee.Warning?Nl:pl,[s]);return i(()=>{s===Ee.Success?n():s===Ee.Error&&o()},[s]),t(Fe,{text:r,children:t(Ke,{leftIcon:d,label:l,status:s,invertColors:!0,useSecondaryTone:!0})})},Wh=b.div`
795
+ `,Uh=({onClick:n})=>{const o=v().v2.colors.red[500];return e(Bh,{"data-id":"sampling-view-btn-delete",onClick:n,children:[t(ee,{size:te.XS,weight:500,color:o,children:Kn}),t(Ma,{size:16,fill:o})]})};const Vh={[Zl.EditAutoNoisy]:{title:so,subTitle:ro,cancelId:"sampling-edit-auto-rule-btn-cancel",saveId:"sampling-edit-auto-rule-btn-save"},[Zl.EditAutoCostReduction]:{title:lo,subTitle:ao,cancelId:"sampling-edit-cost-reduction-auto-rule-btn-cancel",saveId:"sampling-edit-cost-reduction-auto-rule-btn-save"},[Zl.EditAutoHighlyRelevant]:{title:io,subTitle:oo,cancelId:"sampling-edit-highly-relevant-auto-rule-btn-cancel",saveId:"sampling-edit-highly-relevant-auto-rule-btn-save"}},Hh=({isOpen:e,title:n,subTitle:o,onClose:i,footer:a,renderBody:l})=>t(zt,{isOpen:e,width:po,header:{icon:Ol,title:n,subTitle:o,onClose:i},footer:a,children:l?l():t(le,{$padding:"12px",children:t(Ws,{})})}),jh=({isOpen:o,onClose:r,onSubmit:s,validateForm:c,onNavigateToDuplicate:p})=>{const{category:u,formData:h,resetForm:m,duplicateWarning:g,setDuplicateWarning:f}=ql(Zl.Create),[b,v]=l(!1);a(()=>{o&&(m(),v(!1))},[o]);const y=d(()=>{v(!1),s(h)},[h,s]),C=d(()=>{if(c){const e=c(h);if(e)return void f(e)}((e,t)=>JSON.stringify(e)===JSON.stringify(N(t)))(h,u)?v(!0):y()},[h,u,c,f,y]),S=i(()=>b?((e,t)=>{switch(e){case"noisy":return T($(t));case"highlyRelevant":return k(O(t));case"costReduction":return I(E(t))}})(u,h):[],[b,u,h]),x={note:g?{status:Pe.Warning,message:g.message,action:p?{"data-id":"sampling-create-btn-view-duplicate",label:"View rule",onClick:()=>p(g.ruleId)}:void 0}:void 0,actions:[{"data-id":"sampling-create-btn-cancel",label:jn,variant:Ie.Secondary,size:ke.S,onClick:r},{"data-id":"sampling-create-btn-submit",label:Un,variant:Ie.Primary,size:ke.S,onClick:C,disabled:!!g}]};return e(n,{children:[t(Hh,{isOpen:o,title:Zn[u],subTitle:Yn[u],onClose:r,footer:x}),t(tt,{isOpen:b,title:to,description:eo,onClose:()=>v(!1),denyButton:{"data-id":"sampling-create-default-continue-editing",label:Qn,variant:Ie.Secondary,onClick:()=>v(!1)},approveButton:{"data-id":"sampling-create-default-confirm",label:Un,variant:Ie.Primary,onClick:y},children:e(ae,{$gap:8,$alignItems:"flex-start",style:{width:"100%"},children:[t(ee,{size:te.XS,weight:500,color:ne.Secondary,children:no}),t("div",{style:{width:"100%"},children:t(yr,{summary:S})})]})})]})},Gh=({onClose:o,onDelete:a,onSaveEdit:l,validateForm:r,onNavigateToDuplicate:s})=>{const{data:c,isEditing:p,formData:u,handleEdit:h,handleCancelEdit:m,duplicateWarning:g,setDuplicateWarning:f}=ql(Zl.View),b=c?.rule.name||qn,v=p&&c?Jn[c.category]:`${b} preview`,y=d(()=>{if(c&&p){if(r){const e=r(u);if(e)return void f(e)}l(u,c.rule.ruleId,c.samplingId),m()}},[c,p,u,l,r,f,m]),C=d(()=>{c&&a(c.rule.ruleId,c.samplingId)},[c,a]),S=i(()=>{if(!c)return;const i=g?{message:g.message,onViewRule:s?()=>s(g.ruleId):void 0}:null;return function(o){if(o.isEditing){const{onCancelEdit:i,onSave:a,onDelete:l,duplicateWarning:r}=o;return{children:e(n,{children:[t(Uh,{onClick:l}),r&&t(_e,{status:Pe.Warning,message:r.message,action:r.onViewRule?{"data-id":"sampling-view-edit-btn-view-duplicate",label:"View rule",onClick:r.onViewRule}:void 0}),t(Xh,{}),t(Te,{"data-id":"sampling-view-edit-btn-cancel",label:jn,variant:Ie.Secondary,size:ke.S,onClick:i}),t(Te,{"data-id":"sampling-view-edit-btn-save",label:Gn,variant:Ie.Primary,size:ke.S,onClick:a,disabled:!!r})]})}}const{onDelete:i,onCancel:a,onEdit:l}=o;return{children:e(n,{children:[t(Uh,{onClick:i}),t(Xh,{}),t(Te,{"data-id":"sampling-view-btn-cancel",label:jn,variant:Ie.Secondary,size:ke.S,onClick:a}),t(Te,{"data-id":"sampling-view-btn-edit",label:Wn,variant:Ie.Primary,size:ke.S,onClick:l})]})}}(p?{isEditing:!0,onCancelEdit:m,onSave:y,onDelete:C,duplicateWarning:i}:{isEditing:!1,onDelete:C,onCancel:o,onEdit:h})},[c,p,g,m,y,C,h,o,s]);return t(Hh,{isOpen:!!c,title:v,subTitle:c?Yn[c.category]:"",onClose:o,footer:S})},Wh=({isOpen:e,onClose:n,onSave:o})=>{const{localEnabled:i,resolvedPercentage:a}=ql(Zl.EditAutoNoisy),l=d(()=>o(i,a),[o,i,a]);return t(Jh,{formType:Zl.EditAutoNoisy,isOpen:e,onClose:n,onSave:l})},Kh=({isOpen:e,onClose:n,onSave:o})=>{const{localEnabled:i,resolvedPercentage:a}=ql(Zl.EditAutoCostReduction),l=d(()=>o(i,a),[o,i,a]);return t(Jh,{formType:Zl.EditAutoCostReduction,isOpen:e,onClose:n,onSave:l})},Yh=({isOpen:e,onClose:n,onSave:o})=>{const{localEnabled:i}=ql(Zl.EditAutoHighlyRelevant),a=d(()=>o(i),[o,i]);return t(Jh,{formType:Zl.EditAutoHighlyRelevant,isOpen:e,onClose:n,onSave:a})},Jh=({formType:e,isOpen:n,onClose:o,onSave:i})=>{const a=Vh[e];return t(Hh,{isOpen:n,title:a.title,subTitle:a.subTitle,onClose:o,footer:{actions:[{"data-id":a.cancelId,label:jn,variant:Ie.Secondary,size:ke.S,onClick:o},{"data-id":a.saveId,label:co,variant:Ie.Primary,size:ke.S,onClick:i}]}})},qh=e=>{switch(e.formType){case Zl.Create:return t(ar,{formType:Zl.Create,category:e.category,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(jh,{...e})});case Zl.View:return t(ar,{formType:Zl.View,data:e.data,defaultEditMode:e.defaultEditMode,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(Gh,{...e})});case Zl.EditAutoNoisy:return t(ar,{formType:Zl.EditAutoNoisy,enabled:e.enabled,keepPercentage:e.keepPercentage,children:t(Wh,{...e})});case Zl.EditAutoCostReduction:return t(ar,{formType:Zl.EditAutoCostReduction,enabled:e.enabled,dropPercentage:e.dropPercentage,children:t(Kh,{...e})});case Zl.EditAutoHighlyRelevant:return t(ar,{formType:Zl.EditAutoHighlyRelevant,enabled:e.enabled,children:t(Yh,{...e})})}},Zh=({token:o,isLoading:i,isEditing:a,onEdit:l,onCancel:r,onSave:s,formData:c,handleFormChange:d,handleErrorChange:p,formErrors:u})=>{const{CopyButton:h}=Pt(),m=!a||i||!c.newToken;return uo({key:"Enter",active:!m},s),e(oe,a?{$justifyContent:"space-between",$alignItems:"flex-start",$gap:12,children:[t(Ne,{type:"password",value:c.newToken,onChange:e=>{d("newToken",e.target.value),p("newToken",void 0)},width:"430px",autoFocus:!0,errorMessage:u.newToken}),t(oe,{$margin:i?"8px 0 0 0":"2px 0 0 0",$alignItems:"center",children:i?t(St,{title:"Saving...",withGradient:!0}):e(n,{children:[t(Te,{variant:Ie.Secondary,size:ke.S,leftIcon:Qa,onClick:r,disabled:i}),t(Te,{variant:Ie.Primary,size:ke.S,leftIcon:Za,onClick:s,disabled:m})]})})]}:{$justifyContent:"space-between",$gap:12,children:[t(ee,{size:te.XS,children:new Array(55).fill("•").join("")}),e(oe,{$alignItems:"center",$justifyContent:"space-between",children:[t(h,{value:o}),t(yt,{icon:ja,onClick:l})]})]})},Qh=({expiresAt:e,callbackValid:n,callbackExpired:o})=>{const{formatTimeAgo:l}=an(),r=i(()=>l(e),[e,l]),s=i(()=>new Date(e).toDateString().split(" ").slice(1).join(" "),[e]),c=i(()=>ho(e,0)?Pe.Error:ho(e,2592e6)?Pe.Warning:Pe.Success,[e]),d=i(()=>c===Pe.Success?Za:c===Pe.Warning?$l:gl,[c]);return a(()=>{c===Pe.Success?n():c===Pe.Error&&o()},[c]),t(Ue,{text:s,children:t(ce,{leftIcon:d,label:r,status:c,invertColors:!0,useSecondaryTone:!0})})},em=b.div`
797
796
  display: flex;
798
797
  flex-direction: column;
799
798
  gap: 12px;
@@ -801,7 +800,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
801
800
  border-radius: 12px;
802
801
  border: 1px solid ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[500]:e.v2.colors.silver[600]};
803
802
  background-color: ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[1e3]:e.v2.colors.silver[800]};
804
- `,Kh=({children:e})=>{const n=v();return t(_e,{size:Te.XXXS,color:n.v2.colors.grey[150],children:e})},Yh=({token:n})=>{const{tokensApi:o}=Vl(),[i,l]=a(!1),[r,s]=a(!1),[c,d]=a(!1),{formData:p,handleFormChange:u,formErrors:h,handleErrorChange:m,resetFormData:g}=Gt({newToken:""});return t(st,{richTitle:{icon:El,title:"Odigos Pro Token"},children:e(Wh,{$isExpired:c,children:[e(pe,{$justifyContent:"space-between",children:[e(ee,{$gap:4,children:[t(Kh,{children:"Issued for"}),t(_e,{size:Te.XS,children:n.name||"N/A"})]}),e(ee,{$gap:4,children:[t(Kh,{children:"Expiration"}),t(Gh,{expiresAt:n.expiresAt,callbackValid:()=>d(!1),callbackExpired:()=>d(!0)})]}),t(ee,{})]}),t(pe,{children:e(ee,{children:[t(Kh,{children:"Token"}),t(jh,{token:n.token,newToken:p.newToken,isLoading:i,isEditing:r,onEdit:()=>s(!0),onCancel:()=>(s(!1),void u("newToken","")),onSave:()=>(async()=>{if(!o.updateToken)return;l(!0);const e=await o.updateToken(p.newToken.trim());l(!1),e?.error?m("newToken",e.error):(s(!1),g())})(),formData:p,handleFormChange:u,handleErrorChange:m,formErrors:h})]})})]})})},Jh=b.div`
803
+ `,tm=({children:e})=>{const n=v();return t(ee,{size:te.XXXS,color:n.v2.colors.grey[150],children:e})},nm=({token:n})=>{const{tokensApi:o}=Gl(),[i,a]=l(!1),[r,s]=l(!1),[c,d]=l(!1),{formData:p,handleFormChange:u,formErrors:h,handleErrorChange:m,resetFormData:g}=Jt({newToken:""});return t(ut,{richTitle:{icon:Al,title:"Odigos Pro Token"},children:e(em,{$isExpired:c,children:[e(oe,{$justifyContent:"space-between",children:[e(ae,{$gap:4,children:[t(tm,{children:"Issued for"}),t(ee,{size:te.XS,children:n.name||"N/A"})]}),e(ae,{$gap:4,children:[t(tm,{children:"Expiration"}),t(Qh,{expiresAt:n.expiresAt,callbackValid:()=>d(!1),callbackExpired:()=>d(!0)})]}),t(ae,{})]}),t(oe,{children:e(ae,{children:[t(tm,{children:"Token"}),t(Zh,{token:n.token,newToken:p.newToken,isLoading:i,isEditing:r,onEdit:()=>s(!0),onCancel:()=>(s(!1),void u("newToken","")),onSave:()=>(async()=>{if(!o.updateToken)return;a(!0);const e=await o.updateToken(p.newToken.trim());a(!1),e?.error?m("newToken",e.error):(s(!1),g())})(),formData:p,handleFormChange:u,handleErrorChange:m,formErrors:h})]})})]})})},om=b.div`
805
804
  display: flex;
806
805
  flex-direction: column;
807
806
  align-items: center;
@@ -810,23 +809,23 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
810
809
  padding: 12px 24px;
811
810
  border-radius: 8px;
812
811
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
813
- `,qh=()=>{const{progress:n}=Ot(),{describeApi:o,namespacesApi:i}=Vl(),{items:l}=i.useNamespaces(),[r,s]=a(null),{formData:c,handleFormChange:d,resetFormData:p}=Gt({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(st,{richTitle:{icon:Ol,title:"Diagnose"},children:r?e(Jh,{children:[t(yt,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",withGradient:!0,withSpinner:"number"==typeof n[Rt.DownloadingDiagnose]?.percentage,percentage:n[Rt.DownloadingDiagnose]?.percentage,withVisual:"number"!=typeof n[Rt.DownloadingDiagnose]?.percentage,visualIcon:Tl,startedAt:r}),n[Rt.DownloadingDiagnose]?.list?.length&&t(ee,{$width:"100%",children:n[Rt.DownloadingDiagnose].list.map((n,o)=>e(pe,{$gap:4,$alignItems:"center",children:[n.status===Ee.Success?t(Wa,{size:16}):n.status===Ee.Error?t(Ka,{size:16}):t(yt,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(_e,{size:Te.XXXS,color:Pe.Secondary,children:n.label})]},`diagnose-item-${o}-${n.label}`))})]}):e(ee,{$gap:24,children:[t(_e,{size:Te.XXS,color:Pe.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(ee,{$gap:16,children:[e(pe,{$gap:8,children:[t(ne,{label:"Profiles",value:c.includeProfiles,onChange:e=>d("includeProfiles",e),tooltip:"Note: Adds 30s to diagnose download time to collect Profiles"}),t(_e,{size:Te.XXXS,color:Pe.Secondary,children:"Include pprof profiles"})]}),e(pe,{$gap:8,children:[t(ne,{label:"Metrics",value:c.includeMetrics,onChange:e=>d("includeMetrics",e)}),t(_e,{size:Te.XXXS,color:Pe.Secondary,children:"Include Prometheus metrics"})]}),e(pe,{$gap:8,children:[t(ne,{label:"Source Workloads",value:c.includeSourceWorkloads,onChange:e=>{d("includeSourceWorkloads",e),e&&d("sourceWorkloadNamespaces",[])}}),t(_e,{size:Te.XXXS,color:Pe.Secondary,children:"Include workload and pod manifests for instrumented sources"})]})]}),t(co,{alignX:uo.Left,alignY:po.Bottom,items:l.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:ve.Secondary,disabled:c.includeSourceWorkloads,leftIcon:c.sourceWorkloadNamespaces.length?()=>t(Ke,{label:c.sourceWorkloadNamespaces.length,status:Ee.Default}):void 0}}),t(pe,{$justifyContent:"flex-end",children:t(fe,{label:"Download Diagnose",rightIcon:Tl,variant:ve.Primary,onClick:async()=>{o.downloadDiagnose&&(s(Date.now()),await o.downloadDiagnose(c),s(null),p())},disabled:null!==r})})]})})},Zh=()=>{const{platformType:e,version:n,tier:o}=S(),{describeApi:l}=Vl(),[r,s]=a(null);return i(()=>{l.fetchDescribeOdigos&&l.fetchDescribeOdigos().then(({data:e})=>s(e?.describeOdigos??null))},[]),t(st,{richTitle:{icon:fl,title:"General Information"},children:t(Vt,{cellsPerRow:2,items:[{id:ho(),title:"Odigos Version",label:n},{id:ho(),title:`${e.toUpperCase()} Version`,label:r?.kubernetesVersion?.value||"-"},{id:ho(),title:"Installation Method",label:r?.installationMethod?.value||"-"},{id:ho(),title:"Tier",label:o}]})})},Qh=({isOpen:n,onClose:o})=>{const{describeApi:i,tokensApi:a}=Vl(),l=a.useTokens().items[0];return e(Mt,{isOpen:n,header:{icon:fl,title:"System Overview",onClose:o},children:[i.fetchDescribeOdigos&&t(Zh,{}),a.updateToken&&l&&t(Yh,{token:l}),i.downloadDiagnose&&t(qh,{})]})},em=({isOpen:o,onClose:i,onCloseEnd:a})=>{const{addDataStreams:l,setSelectedStreamName:r}=Qe(),{dataStreamsApi:s}=Vl(),{requestSubmit:c}=Gl(),p=d(async e=>{s.create?await s.create(e):(l([e]),r(e.name)),i()},[s,l,r,i]),u=d(()=>c(p),[c,p]);return ro({key:"Enter",active:o},u),e(n,{children:[t(qe,{isOpen:o,onClose:i,onCloseEnd:a,title:Ze.NAME_YOUR_STREAM,description:Ze.STREAM_DESCRIPTION,approveButton:{"data-id":"add-stream-btn-done",label:Lt.DONE,variant:ve.Primary,onClick:u},denyButton:{"data-id":"add-stream-btn-cancel",label:Lt.CANCEL,variant:ve.Secondary,onClick:i},children:t(Ns,{autoFocus:!0})}),t(Is,{})]})},tm=({isOpen:o,onClose:a,onCloseEnd:l,dataStreamName:r})=>{const{dataStreamsApi:s}=Vl(),{genericForm:c,loadDataStream:p,requestSubmit:u}=Gl();i(()=>{o&&r&&p(r)},[o,r]);const h=!!c?.isFormDirty,m=d(async e=>{await s.update(r,e),a()},[s,r,a]),g=d(()=>u(m),[u,m]);return ro({key:"Enter",active:o},g),e(n,{children:[t(qe,{isOpen:o,onClose:a,onCloseEnd:l,title:Ze.RENAME_STREAM(r),description:Ze.STREAM_DESCRIPTION,approveButton:{"data-id":"edit-stream-btn-save",label:Lt.SAVE,variant:ve.Primary,onClick:g,disabled:!h},denyButton:{"data-id":"edit-stream-btn-cancel",label:Lt.CANCEL,variant:ve.Secondary,onClick:a},children:t(Ns,{autoFocus:!0})}),t(Is,{})]})},nm=({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)"})})]})]}),om=b.div`
812
+ `,im=()=>{const{progress:n}=$t(),{describeApi:o,namespacesApi:i}=Gl(),{items:a}=i.useNamespaces(),[r,s]=l(null),{formData:c,handleFormChange:d,resetFormData:p}=Jt({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(ut,{richTitle:{icon:Rl,title:"Diagnose"},children:r?e(om,{children:[t(St,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",withGradient:!0,withSpinner:"number"==typeof n[Dt.DownloadingDiagnose]?.percentage,percentage:n[Dt.DownloadingDiagnose]?.percentage,withVisual:"number"!=typeof n[Dt.DownloadingDiagnose]?.percentage,visualIcon:El,startedAt:r}),n[Dt.DownloadingDiagnose]?.list?.length&&t(ae,{$width:"100%",children:n[Dt.DownloadingDiagnose].list.map((n,o)=>e(oe,{$gap:4,$alignItems:"center",children:[n.status===Pe.Success?t(Za,{size:16}):n.status===Pe.Error?t(Qa,{size:16}):t(St,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(ee,{size:te.XXXS,color:ne.Secondary,children:n.label})]},`diagnose-item-${o}-${n.label}`))})]}):e(ae,{$gap:24,children:[t(ee,{size:te.XXS,color:ne.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(ae,{$gap:16,children:[e(oe,{$gap:8,children:[t(Q,{label:"Profiles",value:c.includeProfiles,onChange:e=>d("includeProfiles",e),tooltip:"Note: Adds 30s to diagnose download time to collect Profiles"}),t(ee,{size:te.XXXS,color:ne.Secondary,children:"Include pprof profiles"})]}),e(oe,{$gap:8,children:[t(Q,{label:"Metrics",value:c.includeMetrics,onChange:e=>d("includeMetrics",e)}),t(ee,{size:te.XXXS,color:ne.Secondary,children:"Include Prometheus metrics"})]}),e(oe,{$gap:8,children:[t(Q,{label:"Source Workloads",value:c.includeSourceWorkloads,onChange:e=>d("includeSourceWorkloads",e)}),t(ee,{size:te.XXXS,color:ne.Secondary,children:"Include workload and pod manifests for instrumented sources"})]})]}),t(mo,{alignX:fo.Left,alignY:go.Bottom,items:a.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:Ie.Secondary,leftIcon:c.sourceWorkloadNamespaces.length?()=>t(ce,{label:c.sourceWorkloadNamespaces.length,status:Pe.Default}):void 0}}),t(oe,{$justifyContent:"flex-end",children:t(Te,{label:"Download Diagnose",rightIcon:El,variant:Ie.Primary,onClick:async()=>{o.downloadDiagnose&&(s(Date.now()),await o.downloadDiagnose(c),s(null),p())},disabled:null!==r})})]})})},am=()=>{const{platformType:e,version:n,tier:o}=S(),{describeApi:i}=Gl(),[r,s]=l(null);return a(()=>{i.fetchDescribeOdigos&&i.fetchDescribeOdigos().then(({data:e})=>s(e?.describeOdigos??null))},[]),t(ut,{richTitle:{icon:Cl,title:"General Information"},children:t(Wt,{cellsPerRow:2,items:[{id:bo(),title:"Odigos Version",label:n},{id:bo(),title:`${e.toUpperCase()} Version`,label:r?.kubernetesVersion?.value||"-"},{id:bo(),title:"Installation Method",label:r?.installationMethod?.value||"-"},{id:bo(),title:"Tier",label:o}]})})},lm=({isOpen:n,onClose:o})=>{const{describeApi:i,tokensApi:a}=Gl(),l=a.useTokens().items[0];return e(zt,{isOpen:n,header:{icon:Cl,title:"System Overview",onClose:o},children:[i.fetchDescribeOdigos&&t(am,{}),a.updateToken&&l&&t(nm,{token:l}),i.downloadDiagnose&&t(im,{})]})},rm=({isOpen:o,onClose:i,onCloseEnd:a})=>{const{addDataStreams:l,setSelectedStreamName:r}=ot(),{dataStreamsApi:s}=Gl(),{requestSubmit:c}=Yl(),p=d(async e=>{s.create?await s.create(e):(l([e]),r(e.name)),i()},[s,l,r,i]),u=d(()=>c(p),[c,p]);return uo({key:"Enter",active:o},u),e(n,{children:[t(tt,{isOpen:o,onClose:i,onCloseEnd:a,title:nt.NAME_YOUR_STREAM,description:nt.STREAM_DESCRIPTION,approveButton:{"data-id":"add-stream-btn-done",label:Ft.DONE,variant:Ie.Primary,onClick:u},denyButton:{"data-id":"add-stream-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:i},children:t(Bs,{autoFocus:!0})}),t(zs,{})]})},sm=({isOpen:o,onClose:i,onCloseEnd:l,dataStreamName:r})=>{const{dataStreamsApi:s}=Gl(),{genericForm:c,loadDataStream:p,requestSubmit:u}=Yl();a(()=>{o&&r&&p(r)},[o,r]);const h=!!c?.isFormDirty,m=d(async e=>{await s.update(r,e),i()},[s,r,i]),g=d(()=>u(m),[u,m]);return uo({key:"Enter",active:o},g),e(n,{children:[t(tt,{isOpen:o,onClose:i,onCloseEnd:l,title:nt.RENAME_STREAM(r),description:nt.STREAM_DESCRIPTION,approveButton:{"data-id":"edit-stream-btn-save",label:Ft.SAVE,variant:Ie.Primary,onClick:g,disabled:!h},denyButton:{"data-id":"edit-stream-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:i},children:t(Bs,{autoFocus:!0})}),t(zs,{})]})},cm=({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)"})})]})]}),dm=b.div`
814
813
  position: absolute;
815
814
  top: 50%;
816
815
  left: 50%;
817
816
  transform: translate(-50%, -50%);
818
817
  z-index: ${({theme:e})=>e.v2.zIndex.modal};
819
- `,im=()=>{const{drawerType:n,setDrawerType:o}=fn(),i=n===go.OnboardingDone,a=()=>o(null);return e(mo,{isOpen:i,onClose:a,children:[t(nm,{}),t(om,{children:e(ee,{$gap:32,$alignItems:"center",children:[e(ee,{$gap:24,$alignItems:"center",children:[t(_e,{size:Te.L,weight:500,children:"Welcome to"}),t($r,{size:260}),t(_e,{size:Te.S,weight:400,children:"Your observability control plane is ready."})]}),t(fe,{label:"Get Started",rightIcon:Da,onClick:a})]})})]})},am=b.div`
818
+ `,pm=()=>{const{drawerType:n,setDrawerType:o}=vn(),i=n===yo.OnboardingDone,a=()=>o(null);return e(vo,{isOpen:i,onClose:a,children:[t(cm,{}),t(dm,{children:e(ae,{$gap:32,$alignItems:"center",children:[e(ae,{$gap:24,$alignItems:"center",children:[t(ee,{size:te.L,weight:500,children:"Welcome to"}),t(Dr,{size:260}),t(ee,{size:te.S,weight:400,children:"Your observability control plane is ready."})]}),t(Te,{label:"Get Started",rightIcon:Ba,onClick:a})]})})]})},um=b.div`
820
819
  display: flex;
821
820
  flex-direction: column;
822
821
  gap: 8px;
823
822
  padding: 4px 8px;
824
823
  border-radius: 8px;
825
824
  width: 100%;
826
- `,lm=b.div`
825
+ `,hm=b.div`
827
826
  white-space: pre;
828
827
  overflow-x: auto;
829
- `,rm=({name:n,recommended:o,toggleLabel:i,enabled:a,onEnabledChange:l,summary:r,toggleName:s})=>{const c=v();return e(am,{children:[e(pe,{$gap:8,$justifyContent:"space-between",children:[e(pe,{$gap:4,children:[t(_e,{size:Te.XS,color:c.v2.colors.white[500],nowrap:!0,children:n}),o&&t(Ke,{label:fo,leftIcon:$l,backgroundColor:c.v2.colors.purple[700],textColor:c.v2.colors.white[500],textSize:Te.XXXS})]}),t(le,{name:s??`sampling-onboarding-toggle-${n}`,label:i,labelAlign:re.Left,value:a,onChange:l,size:Nt.S})]}),t(lm,{children:t(w,{parts:r})})]})},sm=b.div`
828
+ `,mm=({name:n,recommended:o,toggleLabel:i,enabled:a,onEnabledChange:l,summary:r,toggleName:s})=>{const c=v();return e(um,{children:[e(oe,{$gap:8,$justifyContent:"space-between",children:[e(oe,{$gap:4,children:[t(ee,{size:te.XS,color:c.v2.colors.white[500],nowrap:!0,children:n}),o&&t(ce,{label:Co,leftIcon:Dl,backgroundColor:c.v2.colors.purple[700],textColor:c.v2.colors.white[500],textSize:te.XXXS})]}),t(ge,{name:s??`sampling-onboarding-toggle-${n}`,label:i,labelAlign:fe.Left,value:a,onChange:l,size:Et.S})]}),t(hm,{children:t(w,{parts:r})})]})},gm=b.div`
830
829
  position: relative;
831
830
  display: flex;
832
831
  align-items: center;
@@ -836,18 +835,18 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
836
835
  background-color: ${({theme:e})=>e.v2.colors.black[500]};
837
836
  border-top-left-radius: 18px;
838
837
  border-top-right-radius: 18px;
839
- `,cm=b.div`
838
+ `,fm=b.div`
840
839
  position: absolute;
841
840
  left: 16px;
842
841
  top: 50%;
843
842
  transform: translateY(-50%);
844
- `,dm=b.div`
843
+ `,bm=b.div`
845
844
  height: 16px;
846
845
  width: 100%;
847
846
  background-color: ${({theme:e})=>e.v2.colors.black[500]};
848
847
  border-top-left-radius: 18px;
849
848
  border-top-right-radius: 18px;
850
- `,pm=b.div`
849
+ `,vm=b.div`
851
850
  width: ${({$width:e})=>e}px;
852
851
  display: flex;
853
852
  flex-direction: column;
@@ -855,7 +854,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
855
854
  gap: 22px;
856
855
  padding: 8px 32px 32px 32px;
857
856
  background-color: ${({theme:e})=>e.v2.colors.black[500]};
858
- `,um=e=>t(Al,{rotate:90,...e}),hm=({children:n,center:o,onNext:i,nextLabel:a=bo,nextLoading:l})=>e(pe,{$gap:8,$justifyContent:o?"center":"flex-end",$padding:"0 16px 16px 16px",children:[n,i&&t(fe,{"data-id":"sampling-onboarding-btn-next",label:a,rightIcon:um,variant:ve.Primary,size:be.M,onClick:i,loading:l})]}),mm=e=>t(Al,{rotate:-90,...e}),gm=({title:n,onBack:o})=>{const i=v();return e(sm,{$hasBack:!!o,children:[o&&t(cm,{children:t(bt,{"data-id":"sampling-onboarding-back",icon:mm,size:vt.M,onClick:o})}),t(_e,{size:Te.M,weight:500,color:i.v2.colors.white[500],align:"center",children:n})]})},fm=b.div`
857
+ `,ym=e=>t(_l,{rotate:90,...e}),Cm=({children:n,center:o,onNext:i,nextLabel:a=So,nextLoading:l})=>e(oe,{$gap:8,$justifyContent:o?"center":"flex-end",$padding:"0 16px 16px 16px",children:[n,i&&t(Te,{"data-id":"sampling-onboarding-btn-next",label:a,rightIcon:ym,variant:Ie.Primary,size:ke.M,onClick:i,loading:l})]}),Sm=e=>t(_l,{rotate:-90,...e}),xm=({title:n,onBack:o})=>{const i=v();return e(gm,{$hasBack:!!o,children:[o&&t(fm,{children:t(yt,{"data-id":"sampling-onboarding-back",icon:Sm,size:Ct.M,onClick:o})}),t(ee,{size:te.M,weight:500,color:i.v2.colors.white[500],align:"center",children:n})]})},wm=b.div`
859
858
  box-sizing: border-box;
860
859
  width: ${({$width:e})=>e??"100%"};
861
860
  ${({$fillHeight:e})=>e&&y`
@@ -868,16 +867,16 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
868
867
  padding: 16px;
869
868
  border-radius: 16px;
870
869
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
871
- `,bm=({children:e,fillHeight:n,width:o})=>t(fm,{$fillHeight:n,$width:o,children:e}),vm=b.ul`
870
+ `,Tm=({children:e,fillHeight:n,width:o})=>t(wm,{$fillHeight:n,$width:o,children:e}),km=b.ul`
872
871
  margin: 0;
873
872
  padding: 0;
874
873
  list-style: disc;
875
- `,ym=b.li`
874
+ `,Im=b.li`
876
875
  margin-left: 18px;
877
876
  & + & {
878
877
  margin-top: 6px;
879
878
  }
880
- `,Cm=({items:e,color:n})=>{const o=v(),i=n||o.v2.colors.silver[200];return t(vm,{children:e.map((e,n)=>t(ym,{style:{color:i},children:t(_e,{size:Te.XXS,color:i,children:e})},n))})},Sm=({items:n})=>{const o=v();return t(ee,{$gap:16,children:n.map((n,i)=>e(pe,{$gap:8,$alignItems:"flex-start",children:[e(_e,{size:Te.XS,color:o.v2.colors.silver[200],weight:400,children:[i+1,"."]}),e(ee,{$gap:2,children:[t(_e,{size:Te.XS,color:o.v2.colors.white[500],weight:500,children:n.title}),t(_e,{size:Te.XS,color:o.v2.colors.silver[200],children:n.description})]})]},i))})},xm=({message:e})=>t(Ne,{status:Ee.Default,message:e,fullWidth:!0,smallIcon:!0}),wm=b.div`
879
+ `,Nm=({items:e,color:n})=>{const o=v(),i=n||o.v2.colors.silver[200];return t(km,{children:e.map((e,n)=>t(Im,{style:{color:i},children:t(ee,{size:te.XXS,color:i,children:e})},n))})},Em=({items:n})=>{const o=v();return t(ae,{$gap:16,children:n.map((n,i)=>e(oe,{$gap:8,$alignItems:"flex-start",children:[e(ee,{size:te.XS,color:o.v2.colors.silver[200],weight:400,children:[i+1,"."]}),e(ae,{$gap:2,children:[t(ee,{size:te.XS,color:o.v2.colors.white[500],weight:500,children:n.title}),t(ee,{size:te.XS,color:o.v2.colors.silver[200],children:n.description})]})]},i))})},Om=({message:e})=>t(_e,{status:Pe.Default,message:e,fullWidth:!0,smallIcon:!0}),$m=b.div`
881
880
  width: 100%;
882
881
  padding: 8px;
883
882
  display: flex;
@@ -885,12 +884,12 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
885
884
  gap: 4px;
886
885
  border-radius: 16px;
887
886
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
888
- `,Tm=b.div`
887
+ `,Am=b.div`
889
888
  display: flex;
890
889
  align-items: center;
891
890
  gap: 8px;
892
891
  padding: 4px 8px 12px 8px;
893
- `,km=b.div`
892
+ `,Rm=b.div`
894
893
  width: 100%;
895
894
  display: flex;
896
895
  flex-direction: column;
@@ -898,20 +897,20 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
898
897
  padding: 8px;
899
898
  border-radius: 12px;
900
899
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
901
- `,Im=({children:e})=>{const n=v();return t(_e,{size:Te.S,weight:500,color:n.v2.colors.white[500],align:"center",children:e})},Nm=b.div`
900
+ `,Dm=({children:e})=>{const n=v();return t(ee,{size:te.S,weight:500,color:n.v2.colors.white[500],align:"center",children:e})},_m=b.div`
902
901
  white-space: pre-line;
903
- `,Em=({enabled:o,onEnabledChange:i,onBack:a,onNext:l})=>{const r=v(),s=c(()=>A({enabled:o,keepPercentage:0}),[o]);return e(n,{children:[t(gm,{title:vo,onBack:a}),e(pm,{$width:854,children:[t(Im,{children:yo}),e(ee,{$gap:8,$width:"100%",children:[t(bm,{children:t(Nm,{children:t(_e,{size:Te.XXS,color:r.v2.colors.silver[200],children:Co})})}),e(ee,{$gap:8,$width:"100%",children:[e(wm,{children:[t(Tm,{children:t(_e,{size:Te.S,weight:500,color:r.v2.colors.white[500],children:So})}),t(km,{children:t(rm,{name:wo,recommended:!0,toggleLabel:xo,enabled:o,onEnabledChange:i,summary:s,toggleName:"sampling-onboarding-noisy-toggle"})})]}),t(xm,{message:To})]})]})]}),t(hm,{onNext:l})]})},Om=e=>t(Al,{rotate:90,...e}),$m=({onClose:o})=>{const i=v();return e(n,{children:[t(dm,{}),e(pm,{$width:732,children:[t(ko,{icon:Il}),e(ee,{$gap:16,$alignItems:"center",$width:"100%",children:[t(_e,{size:Te.M,weight:500,color:i.v2.colors.white[500],children:Io}),No.split("\n").map((e,n)=>t(Im,{children:e},`subtitle-${n}-${e}`)),e(bm,{children:[t(_e,{size:Te.XS,color:i.v2.colors.silver[200],children:Eo}),t(Cm,{color:i.v2.colors.white[500],items:[Oo,$o,Ao]})]})]})]}),t(hm,{center:!0,children:t(fe,{"data-id":"sampling-onboarding-btn-go-to",label:Ro,rightIcon:Om,variant:ve.Primary,size:be.M,onClick:o})})]})},Am=e=>t(Al,{rotate:90,...e}),Rm=b.div`
902
+ `,Pm=({enabled:o,onEnabledChange:a,onBack:l,onNext:r})=>{const s=v(),c=i(()=>A({enabled:o,keepPercentage:0}),[o]);return e(n,{children:[t(xm,{title:xo,onBack:l}),e(vm,{$width:854,children:[t(Dm,{children:wo}),e(ae,{$gap:8,$width:"100%",children:[t(Tm,{children:t(_m,{children:t(ee,{size:te.XXS,color:s.v2.colors.silver[200],children:To})})}),e(ae,{$gap:8,$width:"100%",children:[e($m,{children:[t(Am,{children:t(ee,{size:te.S,weight:500,color:s.v2.colors.white[500],children:ko})}),t(Rm,{children:t(mm,{name:No,recommended:!0,toggleLabel:Io,enabled:o,onEnabledChange:a,summary:c,toggleName:"sampling-onboarding-noisy-toggle"})})]}),t(Om,{message:Eo})]})]})]}),t(Cm,{onNext:r})]})},Lm=e=>t(_l,{rotate:90,...e}),Fm=({onClose:o})=>{const i=v();return e(n,{children:[t(bm,{}),e(vm,{$width:732,children:[t(Oo,{icon:Ol}),e(ae,{$gap:16,$alignItems:"center",$width:"100%",children:[t(ee,{size:te.M,weight:500,color:i.v2.colors.white[500],children:$o}),Ao.split("\n").map((e,n)=>t(Dm,{children:e},`subtitle-${n}-${e}`)),e(Tm,{children:[t(ee,{size:te.XS,color:i.v2.colors.silver[200],children:Ro}),t(Nm,{color:i.v2.colors.white[500],items:[Do,_o,Po]})]})]})]}),t(Cm,{center:!0,children:t(Te,{"data-id":"sampling-onboarding-btn-go-to",label:Lo,rightIcon:Lm,variant:Ie.Primary,size:ke.M,onClick:o})})]})},Mm=e=>t(_l,{rotate:90,...e}),zm=b.div`
904
903
  display: flex;
905
904
  flex-direction: column;
906
905
  align-items: center;
907
906
  gap: 8px;
908
907
  width: 100%;
909
- `,Dm=({onSkip:o,onNext:i})=>{const a=v();return e(n,{children:[t(dm,{}),e(pm,{$width:732,children:[t(ko,{icon:Il}),e(ee,{$gap:16,$alignItems:"center",$width:"100%",children:[e(Rm,{children:[t(_e,{size:Te.M,weight:500,color:a.v2.colors.white[500],children:Do}),t(Im,{children:_o})]}),e(bm,{children:[t(_e,{size:Te.XS,color:a.v2.colors.silver[200],children:Po}),t(Sm,{items:[{title:Fo,description:Lo},{title:zo,description:Mo},{title:Xo,description:Bo}]}),t(xm,{message:Uo})]})]})]}),e(hm,{center:!0,children:[t(fe,{"data-id":"sampling-onboarding-btn-skip",label:Vo,variant:ve.Secondary,onClick:o}),t(fe,{"data-id":"sampling-onboarding-btn-start",label:Ho,rightIcon:Am,variant:ve.Primary,onClick:i})]})]})},_m=b.div`
908
+ `,Bm=({onSkip:o,onNext:i})=>{const a=v();return e(n,{children:[t(bm,{}),e(vm,{$width:732,children:[t(Oo,{icon:Ol}),e(ae,{$gap:16,$alignItems:"center",$width:"100%",children:[e(zm,{children:[t(ee,{size:te.M,weight:500,color:a.v2.colors.white[500],children:Fo}),t(Dm,{children:Mo})]}),e(Tm,{children:[t(ee,{size:te.XS,color:a.v2.colors.silver[200],children:zo}),t(Em,{items:[{title:Xo,description:Bo},{title:Vo,description:Uo},{title:jo,description:Ho}]}),t(Om,{message:Go})]})]})]}),e(Cm,{center:!0,children:[t(Te,{"data-id":"sampling-onboarding-btn-skip",label:Wo,variant:Ie.Secondary,onClick:o}),t(Te,{"data-id":"sampling-onboarding-btn-start",label:Ko,rightIcon:Mm,variant:Ie.Primary,onClick:i})]})]})},Xm=b.div`
910
909
  display: flex;
911
910
  align-items: stretch;
912
911
  gap: 16px;
913
912
  width: 100%;
914
- `,Pm=b.div`
913
+ `,Um=b.div`
915
914
  flex: 1;
916
915
  display: flex;
917
916
  flex-direction: column;
@@ -931,18 +930,18 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
931
930
  background-color: ${t.v2.colors.silver[700]};
932
931
  }
933
932
  `}
934
- `,Lm=b.div`
933
+ `,Vm=b.div`
935
934
  display: flex;
936
935
  align-items: center;
937
936
  gap: 8px;
938
937
  padding: 12px 16px;
939
- `,Fm=b.div`
938
+ `,Hm=b.div`
940
939
  flex: 1;
941
940
  padding: 8px;
942
941
  display: flex;
943
942
  flex-direction: column;
944
943
  gap: 8px;
945
- `,Mm=b.div`
944
+ `,jm=b.div`
946
945
  flex: 1;
947
946
  display: flex;
948
947
  flex-direction: column;
@@ -950,17 +949,17 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
950
949
  padding: 12px;
951
950
  border-radius: 12px;
952
951
  background-color: ${({theme:e,$selected:t})=>t?e.v2.colors.purple[900]:e.v2.colors.silver[900]};
953
- `,zm=b.div`
952
+ `,Gm=b.div`
954
953
  display: flex;
955
954
  justify-content: flex-end;
956
- `,Bm=b.div`
955
+ `,Wm=b.div`
957
956
  display: flex;
958
957
  align-items: center;
959
958
  gap: 8px;
960
959
  padding: 4px 12px 4px 4px;
961
960
  border-radius: 8px;
962
961
  background-color: ${({theme:e})=>e.v2.colors.yellow[1e3]};
963
- `,Xm=b.div`
962
+ `,Km=b.div`
964
963
  display: flex;
965
964
  align-items: center;
966
965
  justify-content: center;
@@ -968,13 +967,13 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
968
967
  height: 24px;
969
968
  border-radius: 6px;
970
969
  background-color: ${({theme:e})=>e.v2.colors.yellow[900]};
971
- `,Um=({selected:n,onSelect:o,name:i,description:a,badgeProps:l,bullets:r,warning:s,onReadMore:c})=>{const d=v(),p=n?d.v2.colors.white[500]:d.v2.colors.silver[200];return e(Pm,{$selected:n,onClick:o,children:[e(Lm,{children:[t(he,{"data-id":`sampling-onboarding-radio-${i}`,value:n,onChange:o,size:ge.L}),t(Il,{size:24,fill:d.v2.colors.white[500]}),t(_e,{size:Te.S,weight:500,color:d.v2.colors.white[500],children:i})]}),e(Fm,{children:[e(Mm,{$selected:n,children:[e(ee,{$gap:8,children:[t(Ke,{...l,textSize:Te.XXXS}),t(_e,{size:Te.XXS,color:p,children:a})]}),r&&r.length>0&&t(Cm,{color:p,items:r}),s&&e(Bm,{children:[t(Xm,{children:t(Nl,{size:18,fill:d.v2.colors.yellow[500]})}),t(_e,{size:Te.XXXS,color:d.v2.colors.yellow[500],children:s})]})]}),c&&t(zm,{children:t(fe,{"data-id":`sampling-onboarding-btn-read-more-${i}`,label:ri,rightIcon:La,variant:ve.Text,size:be.S,onClick:e=>{e.stopPropagation(),c()}})})]})]})},Vm=({strategy:o,onStrategyChange:i,onBack:a,onNext:l,docsUrl:r})=>{const s=v(),c=r?()=>window.open(r,"_blank"):void 0;return e(n,{children:[t(gm,{title:jo,onBack:a}),e(pm,{$width:854,children:[t(Im,{children:Go}),e(_m,{children:[t(Um,{selected:"keep-list"===o,onSelect:()=>i("keep-list"),name:Zo,description:qo,badgeProps:{label:Jo,backgroundColor:s.v2.colors.purple[500],textColor:s.v2.colors.white[500]},bullets:[Ko,Yo],warning:Wo,onReadMore:c}),t(Um,{selected:"drop-list"===o,onSelect:()=>i("drop-list"),name:oi,description:ni,badgeProps:{label:ti,backgroundColor:s.v2.colors.green[500],textColor:s.v2.colors.black[500]},bullets:[Qo,ei],onReadMore:c}),t(Um,{selected:"advanced"===o,onSelect:()=>i("advanced"),name:li,description:ai,badgeProps:{label:ii,backgroundColor:s.v2.colors.blue[700],textColor:s.v2.colors.white[500]},onReadMore:c})]})]}),t(hm,{onNext:l})]})},Hm=({onBack:o,onNext:i,submitting:a})=>{const l=v(),r=c(()=>[{title:pi,bullets:[si,ci,di]},{title:bi,bullets:[ui,hi,mi,gi,fi]}],[]);return e(n,{children:[t(gm,{title:vi,onBack:o}),e(pm,{$width:854,children:[t(Im,{children:yi}),t(pe,{$gap:16,$width:"100%",$alignItems:"stretch",children:r.map((n,o)=>e(bm,{fillHeight:!0,width:"50%",children:[t(_e,{size:Te.XS,color:l.v2.colors.white[500],children:n.title}),t(Cm,{items:n.bullets})]},o))}),t(xm,{message:Ci})]}),t(hm,{onNext:i,nextLoading:a})]})},jm=b.div`
970
+ `,Ym=({selected:n,onSelect:o,name:i,description:a,badgeProps:l,bullets:r,warning:s,onReadMore:c})=>{const d=v(),p=n?d.v2.colors.white[500]:d.v2.colors.silver[200];return e(Um,{$selected:n,onClick:o,children:[e(Vm,{children:[t(Se,{"data-id":`sampling-onboarding-radio-${i}`,value:n,onChange:o,size:we.L}),t(Ol,{size:24,fill:d.v2.colors.white[500]}),t(ee,{size:te.S,weight:500,color:d.v2.colors.white[500],children:i})]}),e(Hm,{children:[e(jm,{$selected:n,children:[e(ae,{$gap:8,children:[t(ce,{...l,textSize:te.XXXS}),t(ee,{size:te.XXS,color:p,children:a})]}),r&&r.length>0&&t(Nm,{color:p,items:r}),s&&e(Wm,{children:[t(Km,{children:t($l,{size:18,fill:d.v2.colors.yellow[500]})}),t(ee,{size:te.XXXS,color:d.v2.colors.yellow[500],children:s})]})]}),c&&t(Gm,{children:t(Te,{"data-id":`sampling-onboarding-btn-read-more-${i}`,label:pi,rightIcon:Va,variant:Ie.Text,size:ke.S,onClick:e=>{e.stopPropagation(),c()}})})]})]})},Jm=({strategy:o,onStrategyChange:i,onBack:a,onNext:l,docsUrl:r})=>{const s=v(),c=r?()=>window.open(r,"_blank"):void 0;return e(n,{children:[t(xm,{title:Yo,onBack:a}),e(vm,{$width:854,children:[t(Dm,{children:Jo}),e(Xm,{children:[t(Ym,{selected:"keep-list"===o,onSelect:()=>i("keep-list"),name:ni,description:ti,badgeProps:{label:ei,backgroundColor:s.v2.colors.purple[500],textColor:s.v2.colors.white[500]},bullets:[Zo,Qo],warning:qo,onReadMore:c}),t(Ym,{selected:"drop-list"===o,onSelect:()=>i("drop-list"),name:ri,description:li,badgeProps:{label:ai,backgroundColor:s.v2.colors.green[500],textColor:s.v2.colors.black[500]},bullets:[oi,ii],onReadMore:c}),t(Ym,{selected:"advanced"===o,onSelect:()=>i("advanced"),name:di,description:ci,badgeProps:{label:si,backgroundColor:s.v2.colors.blue[700],textColor:s.v2.colors.white[500]},onReadMore:c})]})]}),t(Cm,{onNext:l})]})},qm=({onBack:o,onNext:a,submitting:l})=>{const r=v(),s=i(()=>[{title:gi,bullets:[ui,hi,mi]},{title:Si,bullets:[fi,bi,vi,yi,Ci]}],[]);return e(n,{children:[t(xm,{title:xi,onBack:o}),e(vm,{$width:854,children:[t(Dm,{children:wi}),t(oe,{$gap:16,$width:"100%",$alignItems:"stretch",children:s.map((n,o)=>e(Tm,{fillHeight:!0,width:"50%",children:[t(ee,{size:te.XS,color:r.v2.colors.white[500],children:n.title}),t(Nm,{items:n.bullets})]},o))}),t(Om,{message:Ti})]}),t(Cm,{onNext:a,nextLoading:l})]})},Zm=b.div`
972
971
  white-space: pre-line;
973
- `,Gm=({errorPresetEnabled:o,onErrorPresetChange:i,onBack:a,onNext:l,submitting:r})=>{const s=v(),d=c(()=>R(o?{disabled:!1}:null),[o]);return e(n,{children:[t(gm,{title:Si,onBack:a}),e(pm,{$width:854,children:[t(Im,{children:xi}),e(ee,{$gap:8,$width:"100%",children:[e(bm,{children:[t(jm,{children:t(_e,{size:Te.XXS,color:s.v2.colors.silver[200],children:wi})}),t(xm,{message:Ci})]}),e(wm,{children:[e(Tm,{children:[t(_e,{size:Te.S,weight:500,color:s.v2.colors.white[500],children:Ti}),t(ul,{size:16,fill:s.v2.colors.silver[200]})]}),t(km,{children:t(rm,{name:Ii,recommended:!0,toggleLabel:ki,enabled:o,onEnabledChange:i,summary:d,toggleName:"sampling-onboarding-drop-error-preset-toggle"})})]})]})]}),t(hm,{onNext:l,nextLoading:r})]})},Wm=b.div`
972
+ `,Qm=({errorPresetEnabled:o,onErrorPresetChange:a,onBack:l,onNext:r,submitting:s})=>{const c=v(),d=i(()=>R(o?{disabled:!1}:null),[o]);return e(n,{children:[t(xm,{title:ki,onBack:l}),e(vm,{$width:854,children:[t(Dm,{children:Ii}),e(ae,{$gap:8,$width:"100%",children:[e(Tm,{children:[t(Zm,{children:t(ee,{size:te.XXS,color:c.v2.colors.silver[200],children:Ni})}),t(Om,{message:Ti})]}),e($m,{children:[e(Am,{children:[t(ee,{size:te.S,weight:500,color:c.v2.colors.white[500],children:Ei}),t(fl,{size:16,fill:c.v2.colors.silver[200]})]}),t(Rm,{children:t(mm,{name:$i,recommended:!0,toggleLabel:Oi,enabled:o,onEnabledChange:a,summary:d,toggleName:"sampling-onboarding-drop-error-preset-toggle"})})]})]})]}),t(Cm,{onNext:r,nextLoading:s})]})},eg=b.div`
974
973
  white-space: pre-line;
975
- `,Km=b.div`
974
+ `,tg=b.div`
976
975
  width: fit-content;
977
- `,Ym=["50","25","10","1","0.1"],Jm=({value:n,onChange:o,label:i})=>{const a=v(),l=c(()=>Ym.map(e=>({value:e,label:`${e}%`,selectedBgColor:a.v2.colors.purple[900],selectedBorderColor:a.v2.colors.purple[400]})),[a]);return e(ee,{$gap:8,children:[t(_e,{size:Te.XS,color:a.v2.colors.white[500],children:i}),t(Km,{children:t(ce,{"data-id":"sampling-onboarding-ambient",options:l,selected:n,setSelected:o})})]})},qm=({errorPresetEnabled:o,onErrorPresetChange:i,ambientPercentage:a,onAmbientPercentageChange:l,onBack:r,onNext:s,submitting:d})=>{const p=v(),u=c(()=>R(o?{disabled:!1}:null),[o]);return e(n,{children:[t(gm,{title:Ni,onBack:r}),e(pm,{$width:854,children:[t(Im,{children:Ei}),e(ee,{$gap:8,$width:"100%",children:[e(bm,{children:[t(Wm,{children:t(_e,{size:Te.XXS,color:p.v2.colors.silver[200],children:Oi})}),t(Cm,{items:[$i,Ai,Ri,Di,_i]}),t(xm,{message:Ci})]}),e(wm,{children:[e(Tm,{children:[t(_e,{size:Te.S,weight:500,color:p.v2.colors.white[500],children:Pi}),t(ul,{size:16,fill:p.v2.colors.silver[200]})]}),t(km,{children:t(rm,{name:Ii,recommended:!0,toggleLabel:ki,enabled:o,onEnabledChange:i,summary:u,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(km,{children:t(Jm,{value:a,onChange:l,label:Li})})]})]})]}),t(hm,{onNext:s,nextLoading:d})]})},Zm=({isOpen:e,onClose:n,k8sHealthProbesConfig:o,samplingId:l,docsUrl:r})=>{const{samplingApi:s}=Vl(),[c,p]=a("welcome"),[u,h]=a(!0),[m,g]=a("keep-list"),[f,b]=a(!0),[v,y]=a("25"),[C,S]=a(!1);i(()=>{e&&(p("welcome"),h(o?.enabled??!0),g("keep-list"),b(!0),y("25"),S(!1))},[e,o?.enabled]);const x=d(async()=>{const e=l??"default",t=[];if(u!==(o?.enabled??!1)){const e=s.updateK8sHealthProbesConfig;e&&t.push(e({enabled:u,keepPercentage:o?.keepPercentage??0}))}if("advanced"!==m&&f){const n=s.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=s.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),p("success")}catch{}finally{S(!1)}},[l,s,u,o?.enabled,o?.keepPercentage,m,f,v]);let w=null;switch(c){case"welcome":w=t(Dm,{onSkip:n,onNext:()=>p("noisy")});break;case"noisy":w=t(Em,{enabled:u,onEnabledChange:h,onBack:()=>p("welcome"),onNext:()=>p("strategy")});break;case"strategy":w=t(Vm,{strategy:m,onStrategyChange:g,onBack:()=>p("noisy"),onNext:()=>{p("keep-list"===m?"keep-list":"drop-list"===m?"drop-list":"advanced")},docsUrl:r});break;case"keep-list":w=t(qm,{errorPresetEnabled:f,onErrorPresetChange:b,ambientPercentage:v,onAmbientPercentageChange:y,onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"drop-list":w=t(Gm,{errorPresetEnabled:f,onErrorPresetChange:b,onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"advanced":w=t(Hm,{onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"success":w=t($m,{onClose:n})}return t(mo,{isOpen:e,onClose:n,children:w})};var Qm,eg;(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"})(Qm||(Qm={})),(e=>{e.K8s="k8s",e.VmAgent="vm-agent",e.CloudConnector="cloud-connector"})(eg||(eg={}));const tg=[{id:eg.CloudConnector,label:"Cloud Connector"}];var ng;(e=>{e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"})(ng||(ng={}));const og=[{key:ng.Name,label:"Name"},{key:ng.Type,label:"Type"},{key:ng.Status,label:"Status"},{key:ng.OdigosVersion,label:"Odigos Version"},{key:ng.ConnectedSince,label:"Connected Since"},{key:ng.LastActivity,label:"Last Activity"}],ig=(e,t)=>{const n=e.find(e=>e.key===ng.Id)?.rawValue;return t(n?.toString()||"")},ag={[Ee.Success]:"Connected",[Ee.Warning]:"Degraded",[Ee.Error]:"Error",[Ee.Disabled]:"Disabled",[Ee.Info]:"Pending"},lg={[Fi.K8s]:pn.Purple,[Fi.Vm]:pn.Blue,[Fi.Connector]:pn.Green},rg=({connections:n,getConnections:o,onClickConnection:l,deleteConnection:r,onCreateNew:s,cloudConnectorProviders:p,onCreateCloudConnector:u,configMinSupportedVersion:h=0,snapshotMinSupportedVersion:m=0})=>{const g=v(),{formatTimeAgo:f}=en(),{capabilities:b}=Vl(),[y,C]=a(!1),[S,x]=a(n||[]),w=d(async()=>{try{C(!0),x(await o()??[])}catch(e){}finally{C(!1)}},[]);i(()=>{S.length||w()},[]);const[T,k]=a(""),[I,N]=a(null),[E,O]=a([]),[$,A]=a(!1),[R,P]=a(!1),L=d(()=>{A(!1),P(!0),w()},[w]),F=d(e=>{e===eg.CloudConnector?A(!0):s?.(e)},[s]),M=c(()=>I===Qm.BulkConfig?h:I===Qm.BulkSource?m:0,[I,h,m]),{supportedConnections:z,supportedConnectionIds:B}=c(()=>{const e=((e,t)=>e.filter(e=>{const n=e.status===Ee.Success,o=D(e.odigosVersion,t,e.type);return n&&o}))(S,M);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[S,M]);i(()=>{if(!I||I===Qm.Delete)return;const e=E.filter(e=>!B.includes(e));e.length&&O(t=>t.filter(t=>!e.includes(t)))},[I,E.length,B.length]);const X=c(()=>S.filter(e=>!T||e.name.toLowerCase().includes(T.toLowerCase())).map(e=>({cells:[{key:ng.Id,rawValue:e.id},{key:ng.Name,rawValue:e.name},{key:ng.Type,rawValue:e.type,component:()=>t(Zt,{variant:lg[e.type]??pn.Default,label:Mi(e.type)})},{key:ng.Status,rawValue:e.status,component:()=>(e=>{if(e.type===Fi.Connector){const n=ag[e.status]??"Pending",o=e.status===Ee.Success?Wa:e.status===Ee.Error?Ka:void 0;return t(Ke,{status:e.status,label:n,leftIcon:o})}const n=e.status===Ee.Success?"Connection live":"Connection lost",o=e.status===Ee.Success?Wa:Ka;return t(Ke,{status:e.status,label:n,leftIcon:o})})(e)},{key:ng.OdigosVersion,rawValue:e.odigosVersion},{key:ng.ConnectedSince,rawValue:e.connectedAt?f(e.connectedAt):"-"},{key:ng.LastActivity,rawValue:e.lastSeenAt?f(e.lastSeenAt):"-"}],onClick:e.status!==Ee.Success||I?void 0:()=>l(e),isSelected:E.includes(e.id),onSelect:()=>O(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>O(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==Ee.Success||I===Qm.BulkConfig&&!D(e.odigosVersion,h,e.type)||I===Qm.BulkSource&&!D(e.odigosVersion,m,e.type)})),[S,E,T,I,h,m,f,l]),U=c(()=>S.length>0&&S.every(e=>e.type===Fi.K8s),[S]),V=c(()=>{const e=(e,t)=>{O([e]),N(t)};return(e=>{const{connections:t,configMinSupportedVersion:n,snapshotMinSupportedVersion:o,onDelete:i,onAddSource:a,onAddDestination:l,onAddAction:r,onAddInstrumentationRule:s,onEditConfiguration:c}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===ng.Status)?.rawValue===Ee.Success)(e))return[{id:ho(),label:"Delete Connection",rightIcon:Fa,onClick:()=>ig(e,i)}];const d=ig(e,e=>t.find(t=>t.id===e));if(d?.type!==Fi.K8s)return[];const p=!!d&&D(d.odigosVersion,n,d.type),u=!!d&&D(d.odigosVersion,o,d.type),h=_(n,d?.type),m=_(o,d?.type),g=[];return a&&g.push({id:ho(),tooltip:u?Ze.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${m} or later.`,rightIcon:Ja,disabled:!u,onClick:()=>ig(e,a)}),l&&g.push({id:ho(),tooltip:Ze.ADD_DESTINATION,rightIcon:Ha,onClick:()=>ig(e,l)}),r&&g.push({id:ho(),tooltip:Ze.ADD_ACTION,rightIcon:Va,onClick:()=>ig(e,r)}),s&&g.push({id:ho(),tooltip:Ze.ADD_INSTRUMENTATION_RULE,rightIcon:Ya,onClick:()=>ig(e,s)}),c&&g.push({id:ho(),tooltip:p?"Edit Configuration":`To use this feature, please upgrade to Odigos v${h} or later.`,rightIcon:rl,disabled:!p,onClick:()=>ig(e,c)}),g}})({connections:S,configMinSupportedVersion:h,snapshotMinSupportedVersion:m,onDelete:t=>e(t,Qm.Delete),onAddSource:b.canFetchSnapshots&&b.canBulkPersistSources?t=>e(t,Qm.BulkSource):void 0,onAddDestination:b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canCreateDestination?t=>e(t,Qm.BulkDestination):void 0,onAddAction:b.canCreateAction?t=>e(t,Qm.BulkAction):void 0,onAddInstrumentationRule:b.canCreateInstrumentationRule?t=>e(t,Qm.BulkInstrumentationRule):void 0,onEditConfiguration:b.canApplyEffectiveConfig?t=>e(t,Qm.BulkConfig):void 0})},[S,h,m,b]),H=c(()=>(e=>{const{onCancel:t,onAddSource:n,onAddDestination:o,onAddAction:i,onAddInstrumentationRule:a,onManageConfigurations:l}=e,r=[];n&&r.push({id:ho(),type:hn.Button,buttonProps:{variant:ve.Primary,size:be.S,label:"Add Sources",rightIcon:Ja,onClick:n}});const s=[o?{id:Qm.BulkDestination,label:Ze.ADD_DESTINATION,icon:Ha}:null,i?{id:Qm.BulkAction,label:Ze.ADD_ACTION,icon:Va}:null,a?{id:Qm.BulkInstrumentationRule,label:Ze.ADD_INSTRUMENTATION_RULE,icon:Ya}:null,l?{id:Qm.BulkConfig,label:"Manage Configurations",icon:rl}:null];return s.some(Boolean)&&r.push({id:ho(),type:hn.ButtonDropData,buttonProps:{variant:ve.Secondary,size:be.S,label:"Bulk Operations",onClick:e=>{e===Qm.BulkSource?n?.():e===Qm.BulkDestination?o?.():e===Qm.BulkAction?i?.():e===Qm.BulkInstrumentationRule?a?.():e===Qm.BulkConfig&&l?.()}},dropDataProps:{alignX:uo.Left,items:s}}),r.push({id:ho(),type:hn.Button,buttonProps:{variant:ve.Text,size:be.S,label:Lt.CANCEL,onClick:t}}),r})({onCancel:()=>O([]),onAddSource:b.canFetchSnapshots&&b.canBulkPersistSources?()=>N(Qm.BulkSource):void 0,onAddDestination:b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canCreateDestination?()=>N(Qm.BulkDestination):void 0,onAddAction:b.canCreateAction?()=>N(Qm.BulkAction):void 0,onAddInstrumentationRule:b.canCreateInstrumentationRule?()=>N(Qm.BulkInstrumentationRule):void 0,onManageConfigurations:b.canApplyEffectiveConfig?()=>N(Qm.BulkConfig):void 0}),[b]),j=c(()=>t(co,{items:tg,withMultiSelect:!1,selectedIds:[],setSelectedIds:e=>F(e[0]),buttonProps:{variant:ve.Primary,size:be.S,label:Lt.CREATE_NEW}}),[F]),G=c(()=>T.trim()&&S.length>0?{hideIcon:!0,title:Ze.NO_RESULTS,subTitle:Ze.NO_RESULTS_FOR_FILTER(T)}:{icon:Rl,title:Ze.NO_CONNECTIONS,action:j},[T,S.length,j]);return t(zi,{children:e(st,{fullHeight:!0,richTitle:{icon:Rl,title:Ze.CONNECTIONS,badge:{label:S.length.toString(),status:Ee.Unknown}},search:{placeholder:"Search by cluster name",value:T,onChange:e=>k(e),width:"300px"},actions:[{id:"connections-refresh",type:hn.Button,buttonProps:{variant:ve.Secondary,size:be.S,leftIcon:ll,onClick:w,disabled:y}},{id:"connections-create-new",type:hn.ButtonDropData,buttonProps:{variant:ve.Primary,size:be.S,label:Lt.CREATE_NEW,onClick:e=>F(e)},dropDataProps:{alignX:uo.Right,items:tg}}],children:[t(Pn,{variant:Ln.Pretty,headerBackgroundColor:g.v2.colors.silver[1e3],isLoading:y,withCheckboxes:U,columns:og,rows:X,noDataProps:G,rowActionsPushRightPosition:I?`calc(${Ir} - 24px)`:void 0,getRowActions:V}),I===Qm.BulkConfig&&b.canApplyEffectiveConfig&&t(or,{connectionIds:E,children:t(op,{onClose:()=>N(null),connections:z,selectedConnectionIds:E,setSelectedConnectionIds:O})}),I===Qm.BulkSource&&b.canFetchSnapshots&&b.canBulkPersistSources&&t(or,{connectionIds:E,children:t(ir,{selectedConnectionIds:E,children:t(vc,{onClose:()=>N(null),selectedConnectionIds:E,setSelectedConnectionIds:O})})}),I===Qm.BulkDestination&&b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canTestConnection&&b.canCreateDestination&&t(or,{connectionIds:E,children:t(ar,{children:t(tc,{onClose:()=>N(null),selectedConnectionIds:E,setSelectedConnectionIds:O})})}),I===Qm.BulkAction&&b.canCreateAction&&t(or,{connectionIds:E,children:t(lr,{children:t(js,{onClose:()=>N(null),selectedConnectionIds:E,setSelectedConnectionIds:O})})}),I===Qm.BulkInstrumentationRule&&b.canCreateInstrumentationRule&&t(or,{connectionIds:E,children:t(rr,{children:t(nc,{onClose:()=>N(null),selectedConnectionIds:E,setSelectedConnectionIds:O})})}),$&&t(sr,{providers:p,children:t(ep,{onClose:()=>A(!1),withOverlay:!0,onCreateCloudConnector:u,onCreated:L})}),t(Ar,{isOpen:R,onClose:()=>P(!1)}),t(Er,{target:"connection",isOpen:I===Qm.Delete,onClose:()=>{O([]),N(null)},onApprove:async()=>{const e=E[0];e&&(await r(e),await w())}}),t(Fn,{isOpen:!!E.length&&!I,richTitle:{icon:_a,title:"Selected Clusters",badge:{label:E.length}},actions:H})]})})},sg=b.div`
976
+ `,ng=["50","25","10","1","0.1"],og=({value:n,onChange:o,label:a})=>{const l=v(),r=i(()=>ng.map(e=>({value:e,label:`${e}%`,selectedBgColor:l.v2.colors.purple[900],selectedBorderColor:l.v2.colors.purple[400]})),[l]);return e(ae,{$gap:8,children:[t(ee,{size:te.XS,color:l.v2.colors.white[500],children:a}),t(tg,{children:t(ve,{"data-id":"sampling-onboarding-ambient",options:r,selected:n,setSelected:o})})]})},ig=({errorPresetEnabled:o,onErrorPresetChange:a,ambientPercentage:l,onAmbientPercentageChange:r,onBack:s,onNext:c,submitting:d})=>{const p=v(),u=i(()=>R(o?{disabled:!1}:null),[o]);return e(n,{children:[t(xm,{title:Ai,onBack:s}),e(vm,{$width:854,children:[t(Dm,{children:Ri}),e(ae,{$gap:8,$width:"100%",children:[e(Tm,{children:[t(eg,{children:t(ee,{size:te.XXS,color:p.v2.colors.silver[200],children:Di})}),t(Nm,{items:[_i,Pi,Li,Fi,Mi]}),t(Om,{message:Ti})]}),e($m,{children:[e(Am,{children:[t(ee,{size:te.S,weight:500,color:p.v2.colors.white[500],children:zi}),t(fl,{size:16,fill:p.v2.colors.silver[200]})]}),t(Rm,{children:t(mm,{name:$i,recommended:!0,toggleLabel:Oi,enabled:o,onEnabledChange:a,summary:u,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(Rm,{children:t(og,{value:l,onChange:r,label:Bi})})]})]})]}),t(Cm,{onNext:c,nextLoading:d})]})},ag=({isOpen:e,onClose:n,k8sHealthProbesConfig:o,samplingId:i,docsUrl:r})=>{const{samplingApi:s}=Gl(),[c,p]=l("welcome"),[u,h]=l(!0),[m,g]=l("keep-list"),[f,b]=l(!0),[v,y]=l("25"),[C,S]=l(!1);a(()=>{e&&(p("welcome"),h(o?.enabled??!0),g("keep-list"),b(!0),y("25"),S(!1))},[e,o?.enabled]);const x=d(async()=>{const e=i??"default",t=[];if(u!==(o?.enabled??!1)){const e=s.updateK8sHealthProbesConfig;e&&t.push(e({enabled:u,keepPercentage:o?.keepPercentage??0}))}if("advanced"!==m&&f){const n=s.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=s.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),p("success")}catch{}finally{S(!1)}},[i,s,u,o?.enabled,o?.keepPercentage,m,f,v]);let w=null;switch(c){case"welcome":w=t(Bm,{onSkip:n,onNext:()=>p("noisy")});break;case"noisy":w=t(Pm,{enabled:u,onEnabledChange:h,onBack:()=>p("welcome"),onNext:()=>p("strategy")});break;case"strategy":w=t(Jm,{strategy:m,onStrategyChange:g,onBack:()=>p("noisy"),onNext:()=>{p("keep-list"===m?"keep-list":"drop-list"===m?"drop-list":"advanced")},docsUrl:r});break;case"keep-list":w=t(ig,{errorPresetEnabled:f,onErrorPresetChange:b,ambientPercentage:v,onAmbientPercentageChange:y,onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"drop-list":w=t(Qm,{errorPresetEnabled:f,onErrorPresetChange:b,onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"advanced":w=t(qm,{onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"success":w=t(Fm,{onClose:n})}return t(vo,{isOpen:e,onClose:n,children:w})};var lg,rg;(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"})(lg||(lg={})),(e=>{e.K8s="k8s",e.VmAgent="vm-agent",e.CloudConnector="cloud-connector",e.AwsEcsAgent="aws-ecs-agent"})(rg||(rg={}));const sg=[{id:rg.CloudConnector,label:"Cloud Connector"}];var cg;(e=>{e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"})(cg||(cg={}));const dg=[{key:cg.Name,label:"Name"},{key:cg.Type,label:"Type"},{key:cg.Status,label:"Status"},{key:cg.OdigosVersion,label:"Odigos Version"},{key:cg.ConnectedSince,label:"Connected Since"},{key:cg.LastActivity,label:"Last Activity"}],pg=(e,t)=>{const n=e.find(e=>e.key===cg.Id)?.rawValue;return t(n?.toString()||"")},ug={[Pe.Success]:"Connected",[Pe.Warning]:"Degraded",[Pe.Error]:"Error",[Pe.Disabled]:"Disabled",[Pe.Info]:"Pending"},hg={[Xi.K8s]:hn.Purple,[Xi.Vm]:hn.Blue,[Xi.Connector]:hn.Green,[Xi.AwsEcs]:hn.Yellow},mg=({connections:n,getConnections:o,onClickConnection:r,deleteConnection:s,onCreateNew:c,cloudConnectorProviders:p,onCreateCloudConnector:u,configMinSupportedVersion:h=0,snapshotMinSupportedVersion:m=0})=>{const g=v(),{formatTimeAgo:f}=an(),{capabilities:b}=Gl(),[y,C]=l(!1),[S,x]=l(n||[]),w=d(async()=>{try{C(!0),x(await o()??[])}catch(e){}finally{C(!1)}},[]);a(()=>{S.length||w()},[]);const[T,k]=l(""),[I,N]=l(null),[E,O]=l([]),[$,A]=l(!1),[R,P]=l(!1),L=d(()=>{A(!1),P(!0),w()},[w]),F=d(e=>{e===rg.CloudConnector?A(!0):c?.(e)},[c]),M=i(()=>I===lg.BulkConfig?h:I===lg.BulkSource?m:0,[I,h,m]),{supportedConnections:z,supportedConnectionIds:B}=i(()=>{const e=((e,t)=>e.filter(e=>{const n=e.status===Pe.Success,o=D(e.odigosVersion,t,e.type);return n&&o}))(S,M);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[S,M]);a(()=>{if(!I||I===lg.Delete)return;const e=E.filter(e=>!B.includes(e));e.length&&O(t=>t.filter(t=>!e.includes(t)))},[I,E.length,B.length]);const X=i(()=>S.filter(e=>!T||e.name.toLowerCase().includes(T.toLowerCase())).map(e=>({cells:[{key:cg.Id,rawValue:e.id},{key:cg.Name,rawValue:e.name},{key:cg.Type,rawValue:e.type,component:()=>t(nn,{variant:hg[e.type]??hn.Default,label:Ui(e.type),leftIcon:Vn(e.type)})},{key:cg.Status,rawValue:e.status,component:()=>(e=>{if(e.type===Xi.Connector){const n=ug[e.status]??"Pending",o=e.status===Pe.Success?Za:e.status===Pe.Error?Qa:void 0;return t(ce,{status:e.status,label:n,leftIcon:o})}const n=e.status===Pe.Success?"Connection live":"Connection lost",o=e.status===Pe.Success?Za:Qa;return t(ce,{status:e.status,label:n,leftIcon:o})})(e)},{key:cg.OdigosVersion,rawValue:e.odigosVersion},{key:cg.ConnectedSince,rawValue:e.connectedAt?f(e.connectedAt):"-"},{key:cg.LastActivity,rawValue:e.lastSeenAt?f(e.lastSeenAt):"-"}],onClick:e.status!==Pe.Success||I?void 0:()=>r(e),isSelected:E.includes(e.id),onSelect:()=>O(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>O(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==Pe.Success||I===lg.BulkConfig&&!D(e.odigosVersion,h,e.type)||I===lg.BulkSource&&!D(e.odigosVersion,m,e.type)})),[S,E,T,I,h,m,f,r]),U=i(()=>S.length>0&&S.every(e=>e.type===Xi.K8s),[S]),V=i(()=>{const e=(e,t)=>{O([e]),N(t)};return(e=>{const{connections:t,configMinSupportedVersion:n,snapshotMinSupportedVersion:o,onDelete:i,onAddSource:a,onAddDestination:l,onAddAction:r,onAddInstrumentationRule:s,onEditConfiguration:c}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===cg.Status)?.rawValue===Pe.Success)(e))return[{id:bo(),label:"Delete Connection",rightIcon:Ha,onClick:()=>pg(e,i)}];const d=pg(e,e=>t.find(t=>t.id===e));if(d?.type!==Xi.K8s)return[];const p=!!d&&D(d.odigosVersion,n,d.type),u=!!d&&D(d.odigosVersion,o,d.type),h=_(n,d?.type),m=_(o,d?.type),g=[];return a&&g.push({id:bo(),tooltip:u?nt.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${m} or later.`,rightIcon:tl,disabled:!u,onClick:()=>pg(e,a)}),l&&g.push({id:bo(),tooltip:nt.ADD_DESTINATION,rightIcon:Ya,onClick:()=>pg(e,l)}),r&&g.push({id:bo(),tooltip:nt.ADD_ACTION,rightIcon:Fa,onClick:()=>pg(e,r)}),s&&g.push({id:bo(),tooltip:nt.ADD_INSTRUMENTATION_RULE,rightIcon:el,onClick:()=>pg(e,s)}),c&&g.push({id:bo(),tooltip:p?"Edit Configuration":`To use this feature, please upgrade to Odigos v${h} or later.`,rightIcon:ul,disabled:!p,onClick:()=>pg(e,c)}),g}})({connections:S,configMinSupportedVersion:h,snapshotMinSupportedVersion:m,onDelete:t=>e(t,lg.Delete),onAddSource:b.canFetchSnapshots&&b.canBulkPersistSources?t=>e(t,lg.BulkSource):void 0,onAddDestination:b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canCreateDestination?t=>e(t,lg.BulkDestination):void 0,onAddAction:b.canCreateAction?t=>e(t,lg.BulkAction):void 0,onAddInstrumentationRule:b.canCreateInstrumentationRule?t=>e(t,lg.BulkInstrumentationRule):void 0,onEditConfiguration:b.canApplyEffectiveConfig?t=>e(t,lg.BulkConfig):void 0})},[S,h,m,b]),H=i(()=>(e=>{const{onCancel:t,onAddSource:n,onAddDestination:o,onAddAction:i,onAddInstrumentationRule:a,onManageConfigurations:l}=e,r=[];n&&r.push({id:bo(),type:gn.Button,buttonProps:{variant:Ie.Primary,size:ke.S,label:"Add Sources",rightIcon:tl,onClick:n}});const s=[o?{id:lg.BulkDestination,label:nt.ADD_DESTINATION,icon:Ya}:null,i?{id:lg.BulkAction,label:nt.ADD_ACTION,icon:Fa}:null,a?{id:lg.BulkInstrumentationRule,label:nt.ADD_INSTRUMENTATION_RULE,icon:el}:null,l?{id:lg.BulkConfig,label:"Manage Configurations",icon:ul}:null];return s.some(Boolean)&&r.push({id:bo(),type:gn.ButtonDropData,buttonProps:{variant:Ie.Secondary,size:ke.S,label:"Bulk Operations",onClick:e=>{e===lg.BulkSource?n?.():e===lg.BulkDestination?o?.():e===lg.BulkAction?i?.():e===lg.BulkInstrumentationRule?a?.():e===lg.BulkConfig&&l?.()}},dropDataProps:{alignX:fo.Left,items:s}}),r.push({id:bo(),type:gn.Button,buttonProps:{variant:Ie.Text,size:ke.S,label:Ft.CANCEL,onClick:t}}),r})({onCancel:()=>O([]),onAddSource:b.canFetchSnapshots&&b.canBulkPersistSources?()=>N(lg.BulkSource):void 0,onAddDestination:b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canCreateDestination?()=>N(lg.BulkDestination):void 0,onAddAction:b.canCreateAction?()=>N(lg.BulkAction):void 0,onAddInstrumentationRule:b.canCreateInstrumentationRule?()=>N(lg.BulkInstrumentationRule):void 0,onManageConfigurations:b.canApplyEffectiveConfig?()=>N(lg.BulkConfig):void 0}),[b]),j=i(()=>t(mo,{items:sg,withMultiSelect:!1,selectedIds:[],setSelectedIds:e=>F(e[0]),buttonProps:{variant:Ie.Primary,size:ke.S,label:Ft.CREATE_NEW}}),[F]),G=i(()=>T.trim()&&S.length>0?{hideIcon:!0,title:nt.NO_RESULTS,subTitle:nt.NO_RESULTS_FOR_FILTER(T)}:{icon:Pl,title:nt.NO_CONNECTIONS,action:j},[T,S.length,j]);return t(Vi,{children:e(ut,{fullHeight:!0,richTitle:{icon:Pl,title:nt.CONNECTIONS,badge:{label:S.length.toString(),status:Pe.Unknown}},search:{placeholder:"Search by cluster name",value:T,onChange:e=>k(e),width:"300px"},actions:[{id:"connections-refresh",type:gn.Button,buttonProps:{variant:Ie.Secondary,size:ke.S,leftIcon:pl,onClick:w,disabled:y}},{id:"connections-create-new",type:gn.ButtonDropData,buttonProps:{variant:Ie.Primary,size:ke.S,label:Ft.CREATE_NEW,onClick:e=>F(e)},dropDataProps:{alignX:fo.Right,items:sg}}],children:[t(Mn,{variant:zn.Pretty,headerBackgroundColor:g.v2.colors.silver[1e3],isLoading:y,withCheckboxes:U,columns:dg,rows:X,noDataProps:G,rowActionsPushRightPosition:I?`calc(${Or} - 24px)`:void 0,getRowActions:V}),I===lg.BulkConfig&&b.canApplyEffectiveConfig&&t(lr,{connectionIds:E,children:t(dp,{onClose:()=>N(null),connections:z,selectedConnectionIds:E,setSelectedConnectionIds:O})}),I===lg.BulkSource&&b.canFetchSnapshots&&b.canBulkPersistSources&&t(lr,{connectionIds:E,children:t(rr,{selectedConnectionIds:E,children:t(Tc,{onClose:()=>N(null),selectedConnectionIds:E,setSelectedConnectionIds:O})})}),I===lg.BulkDestination&&b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canTestConnection&&b.canCreateDestination&&t(lr,{connectionIds:E,children:t(sr,{children:t(rc,{onClose:()=>N(null),selectedConnectionIds:E,setSelectedConnectionIds:O})})}),I===lg.BulkAction&&b.canCreateAction&&t(lr,{connectionIds:E,children:t(cr,{children:t(qs,{onClose:()=>N(null),selectedConnectionIds:E,setSelectedConnectionIds:O})})}),I===lg.BulkInstrumentationRule&&b.canCreateInstrumentationRule&&t(lr,{connectionIds:E,children:t(dr,{children:t(sc,{onClose:()=>N(null),selectedConnectionIds:E,setSelectedConnectionIds:O})})}),$&&t(pr,{providers:p,children:t(lp,{onClose:()=>A(!1),withOverlay:!0,onCreateCloudConnector:u,onCreated:L})}),t(_r,{isOpen:R,onClose:()=>P(!1)}),t(Ar,{target:"connection",isOpen:I===lg.Delete,onClose:()=>{O([]),N(null)},onApprove:async()=>{const e=E[0];e&&(await s(e),await w())}}),t(Bn,{isOpen:!!E.length&&!I,richTitle:{icon:Xa,title:"Selected Clusters",badge:{label:E.length}},actions:H})]})})},gg=b.div`
978
977
  display: flex;
979
978
  align-items: center;
980
979
  justify-content: space-between;
@@ -983,26 +982,26 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
983
982
  width: 100%;
984
983
  border-radius: 16px;
985
984
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
986
- `,cg=b.div`
985
+ `,fg=b.div`
987
986
  display: flex;
988
987
  align-items: center;
989
988
  justify-content: center;
990
989
  padding: 8px;
991
990
  border-radius: 8px;
992
- background-color: ${({theme:e})=>e.v2.colors.white[500]+dt["004"]};
993
- `,dg=({setStep:n,onSave:o,sourcesPayload:i,destinationsPayload:a,disableAnimation:l})=>{const r=v(),s=()=>n(2),d=()=>n(3),p=c(()=>Object.values(i||{}).flatMap((n,o)=>n.map((n,i)=>{if(!n.selected)return null;const a=n.kind||kt.Namespace,l=a===kt.Namespace?n.namespace:`${n.namespace} → ${n.name}`;return e(sg,{children:[t(_e,{nowrap:!0,children:l}),t(Ke,{label:a,status:Ee.Info,backgroundColor:r.v2.colors.blue[900]})]},`source-${o}-${i}`)})).filter(Boolean),[i]),u=c(()=>a?.map((n,o)=>{const i=St(n.option.type).icon;return e(sg,{children:[e(pe,{$gap:8,children:[i&&t(cg,{children:t(i,{size:24})}),t(_e,{nowrap:!0,children:n.formData.name||n.option.displayName})]}),void 0!==n.testResult&&t(Ke,{status:n.testResult.succeeded?Ee.Success:Ee.Error,leftIcon:n.testResult.succeeded?Wa:Ka})]},`destination-${o}`)})||[],[a]);return t(kr,{isOpen:!0,disableAnimation:l,onBack:()=>n(3),onSave:o,header:{icon:cl,title:Ze.SUMMARY,subTitle:Ze.REVIEW_SETUP},leftColumn:{width:"50%",header:e(pe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(pe,{$gap:8,children:[t(Ja,{size:24}),t(_e,{nowrap:!0,children:Ze.SELECTED_SOURCES}),t(Ke,{label:p.length})]}),t(fe,{"data-id":"summary-edit-sources",leftIcon:Ma,variant:ve.Secondary,size:be.S,onClick:s})]}),list:p.length?p:[t(mt,{$height:"100%",children:t(xe,{icon:Ja,title:Ze.NO_SOURCES_SELECTED,subTitle:Ze.ADD_SOURCE_PROMPT,button:{leftIcon:Ra,label:Ze.ADD_SOURCE,onClick:s}})},"no-sources-data")]},rightColumn:{width:"50%",header:e(pe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(pe,{$gap:8,children:[t(Ha,{size:24}),t(_e,{nowrap:!0,children:Ze.SELECTED_DESTINATIONS}),t(Ke,{label:u.length})]}),t(fe,{"data-id":"summary-edit-destinations",leftIcon:Ma,variant:ve.Secondary,size:be.S,onClick:d})]}),list:u.length?u:[t(mt,{"data-id":"summary-no-destinations",$height:"100%",children:t(xe,{icon:Ha,title:Ze.NO_DESTINATIONS_SELECTED,subTitle:Ze.ADD_DESTINATION_PROMPT,button:{leftIcon:Ra,label:Ze.ADD_DESTINATIONS,onClick:d}})},"no-destinations-data")]}})},pg=b.div`
991
+ background-color: ${({theme:e})=>e.v2.colors.white[500]+ie["004"]};
992
+ `,bg=({setStep:n,onSave:o,sourcesPayload:a,destinationsPayload:l,disableAnimation:r})=>{const s=v(),c=()=>n(2),d=()=>n(3),p=i(()=>Object.values(a||{}).flatMap((n,o)=>n.map((n,i)=>{if(!n.selected)return null;const a=n.kind||Nt.Namespace,l=a===Nt.Namespace?n.namespace:`${n.namespace} → ${n.name}`;return e(gg,{children:[t(ee,{nowrap:!0,children:l}),t(ce,{label:a,status:Pe.Info,backgroundColor:s.v2.colors.blue[900]})]},`source-${o}-${i}`)})).filter(Boolean),[a]),u=i(()=>l?.map((n,o)=>{const i=wt(n.option.type).icon;return e(gg,{children:[e(oe,{$gap:8,children:[i&&t(fg,{children:t(i,{size:24})}),t(ee,{nowrap:!0,children:n.formData.name||n.option.displayName})]}),void 0!==n.testResult&&t(ce,{status:n.testResult.succeeded?Pe.Success:Pe.Error,leftIcon:n.testResult.succeeded?Za:Qa})]},`destination-${o}`)})||[],[l]);return t(Er,{isOpen:!0,disableAnimation:r,onBack:()=>n(3),onSave:o,header:{icon:sl,title:nt.SUMMARY,subTitle:nt.REVIEW_SETUP},leftColumn:{width:"50%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(tl,{size:24}),t(ee,{nowrap:!0,children:nt.SELECTED_SOURCES}),t(ce,{label:p.length})]}),t(Te,{"data-id":"summary-edit-sources",leftIcon:ja,variant:Ie.Secondary,size:ke.S,onClick:c})]}),list:p.length?p:[t(ft,{$height:"100%",children:t($e,{icon:tl,title:nt.NO_SOURCES_SELECTED,subTitle:nt.ADD_SOURCE_PROMPT,button:{leftIcon:za,label:nt.ADD_SOURCE,onClick:c}})},"no-sources-data")]},rightColumn:{width:"50%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(Ya,{size:24}),t(ee,{nowrap:!0,children:nt.SELECTED_DESTINATIONS}),t(ce,{label:u.length})]}),t(Te,{"data-id":"summary-edit-destinations",leftIcon:ja,variant:Ie.Secondary,size:ke.S,onClick:d})]}),list:u.length?u:[t(ft,{"data-id":"summary-no-destinations",$height:"100%",children:t($e,{icon:Ya,title:nt.NO_DESTINATIONS_SELECTED,subTitle:nt.ADD_DESTINATION_PROMPT,button:{leftIcon:za,label:nt.ADD_DESTINATIONS,onClick:d}})},"no-destinations-data")]}})},vg=b.div`
994
993
  position: relative;
995
994
  overflow: hidden;
996
995
  width: 100vw;
997
996
  height: 100vh;
998
997
  box-sizing: border-box;
999
- `,ug=b.svg`
998
+ `,yg=b.svg`
1000
999
  position: absolute;
1001
1000
  top: 50%;
1002
1001
  left: 50%;
1003
1002
  transform: translate(-50%, -50%);
1004
1003
  z-index: -1;
1005
- `,hg=[{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"}],mg=[{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:hg},{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:hg},{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:hg}],gg=({paddingXAxis:n="0px",paddingYAxis:o="0px",children:l})=>{const[r,s]=a(window.innerWidth),d=c(()=>r/mg[0].width,[r]);return i(()=>{const e=()=>s(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e(pg,{$paddingXAxis:n,$paddingYAxis:o,children:[mg.map(({width:n,height:o,pathOpacity:i,path:a,gradientTransform:l,stops:r},s)=>{const c=`purple-ring-${s}`;return e(ug,{width:n*d,height:"100%",viewBox:`0 0 ${n} ${o}`,fill:"none",children:[t("path",{opacity:i,d:a,fill:`url(#${c})`}),t("defs",{children:t("radialGradient",{id:c,cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:l,children:r.map(({offset:e,opacity:n},o)=>t("stop",{offset:e,stopColor:"#7C3BFF",stopOpacity:n},o))})})]},c)}),l]})},fg=b.div`
1004
+ `,Cg=[{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"}],Sg=[{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:Cg},{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:Cg},{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:Cg}],xg=({paddingXAxis:n="0px",paddingYAxis:o="0px",children:r})=>{const[s,c]=l(window.innerWidth),d=i(()=>s/Sg[0].width,[s]);return a(()=>{const e=()=>c(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e(vg,{$paddingXAxis:n,$paddingYAxis:o,children:[Sg.map(({width:n,height:o,pathOpacity:i,path:a,gradientTransform:l,stops:r},s)=>{const c=`purple-ring-${s}`;return e(yg,{width:n*d,height:"100%",viewBox:`0 0 ${n} ${o}`,fill:"none",children:[t("path",{opacity:i,d:a,fill:`url(#${c})`}),t("defs",{children:t("radialGradient",{id:c,cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:l,children:r.map(({offset:e,opacity:n},o)=>t("stop",{offset:e,stopColor:"#7C3BFF",stopOpacity:n},o))})})]},c)}),r]})},wg=b.div`
1006
1005
  display: flex;
1007
1006
  flex-direction: column;
1008
1007
  align-items: center;
@@ -1013,7 +1012,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
1013
1012
  width: 50vw;
1014
1013
  border-radius: 16px;
1015
1014
  background: ${({theme:e})=>e.v2.colors.silver[900]};
1016
- `,bg=b.div`
1015
+ `,Tg=b.div`
1017
1016
  display: flex;
1018
1017
  flex-direction: column;
1019
1018
  align-items: center;
@@ -1023,15 +1022,15 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
1023
1022
  & * {
1024
1023
  text-align: center;
1025
1024
  }
1026
- `,vg=({onStart:n})=>t(Mt,{width:"75vw",isOpen:!0,hideOverlay:!0,disableAnimation:!0,children:t(mt,{$height:"100%",children:e(fg,{children:[e(bg,{children:[t(_e,{size:Te.L,weight:500,children:Ze.GET_STARTED_WITH}),t($r,{size:260}),t(_e,{size:Te.S,weight:400,children:Ze.GET_STARTED_DESCRIPTION})]}),t(fe,{"data-id":"onboarding-get-started",label:Lt.GET_STARTED,rightIcon:Da,size:be.L,onClick:n})]})})}),yg=[{step:1,label:Ze.INSTALLATION,forceDoneBadge:!0},{step:2,label:Ze.SOURCES_SETUP},{step:3,label:Ze.DESTINATIONS_SETUP},{step:4,label:Ze.SUMMARY}],Cg=b.div`
1025
+ `,kg=({onStart:n})=>t(zt,{width:"75vw",isOpen:!0,hideOverlay:!0,disableAnimation:!0,children:t(ft,{$height:"100%",children:e(wg,{children:[e(Tg,{children:[t(ee,{size:te.L,weight:500,children:nt.GET_STARTED_WITH}),t(Dr,{size:260}),t(ee,{size:te.S,weight:400,children:nt.GET_STARTED_DESCRIPTION})]}),t(Te,{"data-id":"onboarding-get-started",label:Ft.GET_STARTED,rightIcon:Ba,size:ke.L,onClick:n})]})})}),Ig=[{step:1,label:nt.INSTALLATION,forceDoneBadge:!0},{step:2,label:nt.SOURCES_SETUP},{step:3,label:nt.DESTINATIONS_SETUP},{step:4,label:nt.SUMMARY}],Ng=b.div`
1027
1026
  display: flex;
1028
1027
  flex-direction: column;
1029
1028
  gap: 32px;
1030
1029
  padding: 64px;
1031
- `,Sg=({pagePaddingXAxis:n,pagePaddingYAxis:o,onDone:i})=>{const{setDrawerType:l}=fn(),{sourcesApi:r,destinationsApi:s}=Vl(),[c,d]=a(1),[p,u]=a(!1),[h,m]=a(null),[g,f]=a(null),b=()=>d(e=>e+1),v=()=>d(e=>e-1);return e(gg,{paddingXAxis:n,paddingYAxis:o,children:[e(Cg,{children:[t($r,{useInline:!0}),t(Bi,{currentStep:c,data:yg,gap:32})]}),t(ir,{initialInputs:h,children:e(ar,{children:[1===c&&t(vg,{onStart:b}),2===c&&t(vc,{disableAnimation:!0,onBack:e=>{m(e),v()},onNext:e=>{m(e),b()}}),3===c&&t(tc,{disableAnimation:!0,onBack:e=>{f(e),v()},onNext:e=>{f(e),b()},initialInputs:g}),4===c&&t(dg,{disableAnimation:!0,setStep:d,onSave:async()=>{if(!p){u(!0);try{const e=[];h&&e.push(r.persistV2(h)),g&&e.push(...g.map(e=>s.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")};l(go.OnboardingDone),i()}catch(e){return u(!1),{error:e instanceof Error?e.message:String(e)}}}},sourcesPayload:h,destinationsPayload:g})]})})]})},xg=e=>(e||[]).filter(e=>!!e.id).map(e=>String(e.id)),wg=e=>e.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/\b\w/g,e=>e.toUpperCase()),Tg=e=>{let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)&&(t+=e.length)}),e.onlyErrors&&t++,t},kg=b.div`
1030
+ `,Eg=({pagePaddingXAxis:n,pagePaddingYAxis:o,onDone:i})=>{const{setDrawerType:a}=vn(),{sourcesApi:r,destinationsApi:s}=Gl(),[c,d]=l(1),[p,u]=l(!1),[h,m]=l(null),[g,f]=l(null),b=()=>d(e=>e+1),v=()=>d(e=>e-1);return e(xg,{paddingXAxis:n,paddingYAxis:o,children:[e(Ng,{children:[t(Dr,{useInline:!0}),t(Hi,{currentStep:c,data:Ig,gap:32})]}),t(rr,{initialInputs:h,children:e(sr,{children:[1===c&&t(kg,{onStart:b}),2===c&&t(Tc,{disableAnimation:!0,onBack:e=>{m(e),v()},onNext:e=>{m(e),b()}}),3===c&&t(rc,{disableAnimation:!0,onBack:e=>{f(e),v()},onNext:e=>{f(e),b()},initialInputs:g}),4===c&&t(bg,{disableAnimation:!0,setStep:d,onSave:async()=>{if(!p){u(!0);try{const e=[];h&&e.push(r.persistV2(h)),g&&e.push(...g.map(e=>s.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")};a(yo.OnboardingDone),i()}catch(e){return u(!1),{error:e instanceof Error?e.message:String(e)}}}},sourcesPayload:h,destinationsPayload:g})]})})]})},Og=e=>(e||[]).filter(e=>!!e.id).map(e=>String(e.id)),$g=e=>e.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/\b\w/g,e=>e.toUpperCase()),Ag=e=>{let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)&&(t+=e.length)}),e.onlyErrors&&t++,t},Rg=b.div`
1032
1031
  position: relative;
1033
1032
  display: inline-flex;
1034
- `,Ig=b.button`
1033
+ `,Dg=b.button`
1035
1034
  display: inline-flex;
1036
1035
  align-items: center;
1037
1036
  gap: 8px;
@@ -1044,7 +1043,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
1044
1043
  &:hover {
1045
1044
  background-color: ${({theme:e})=>e.v2.colors.silver[700]};
1046
1045
  }
1047
- `,Ng=b.div`
1046
+ `,_g=b.div`
1048
1047
  position: absolute;
1049
1048
  top: calc(100% + 8px);
1050
1049
  right: 0;
@@ -1057,25 +1056,25 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
1057
1056
  border-radius: 12px;
1058
1057
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
1059
1058
  box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
1060
- `,Eg=b.div`
1059
+ `,Pg=b.div`
1061
1060
  display: flex;
1062
1061
  flex-direction: column;
1063
1062
  gap: 12px;
1064
1063
  padding: 16px;
1065
1064
  max-height: 60vh;
1066
1065
  overflow-y: auto;
1067
- `,Og=b.div`
1066
+ `,Lg=b.div`
1068
1067
  display: flex;
1069
1068
  align-items: center;
1070
1069
  gap: 8px;
1071
1070
  padding: 12px 16px;
1072
1071
  border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
1073
- `,$g=b.div`
1072
+ `,Fg=b.div`
1074
1073
  display: flex;
1075
1074
  align-items: center;
1076
1075
  gap: 8px;
1077
1076
  margin-left: auto;
1078
- `,Ag=()=>{const n=v(),{sourcesApi:o,namespacesApi:l,capabilities:r}=Vl(),{isK8s:s,isVm:d,isConnector:u}=r,h=s?"k8s":d?"vm":"connector",m=o.useSources().items,g=l.useNamespaces().items,{selectedStreamName:f}=Qe(),{getItemSS:b,setItemSS:y,removeItemSS:C}=Gi(),{statuses:S,namespaces:x,regions:w,kinds:T,monitors:k,languages:I,onlyErrors:N,podsAgentInjectionStatus:E,setAll:O,clearFilters:$,getEmptyState:A}=Xi(),R=c(()=>Ui(m,f),[m,f]);i(()=>{const e=b(Vi.OVERVIEW_FILTERS,A());O(e)},[]);const[D,_]=a({statuses:S,namespaces:x,regions:w,kinds:T,monitors:k,languages:I,onlyErrors:N,podsAgentInjectionStatus:E}),[P,L]=a(Tg(D)),[F,M]=a(!1),z=p(h);i(()=>{if(!F){const e={statuses:S,namespaces:x,regions:w,kinds:T,monitors:k,languages:I,onlyErrors:N,podsAgentInjectionStatus:E};_(e),L(Tg(e))}},[F,S,x,w,T,k,I,N,E]),i(()=>{z.current!==h&&(z.current=h,C(Vi.OVERVIEW_FILTERS),$(),_(A()),L(0),M(!1))},[h]);const B=p(null);En(B,()=>M(!1)),ro({key:"Escape",active:F},()=>M(!1));const X=c(()=>{const e=new Set,t=[];return g.forEach(({name:n})=>{e.has(n)||(e.add(n),t.push({id:n,label:n,withCheckbox:!0}))}),t},[g]),U=c(()=>{const e=new Set,t=[];return R.forEach(({id:n})=>{const{kind:o}=n;e.has(o)||(e.add(o),t.push({id:o,label:wn(o),withCheckbox:!0}))}),t},[R]),V=c(()=>{const e=new Set,t=[];return R.forEach(({id:n})=>{const o=n.region?.trim();o&&!e.has(o)&&(e.add(o),t.push({id:o,label:o,withCheckbox:!0}))}),t.sort((e,t)=>e.id.localeCompare(t.id))},[R]),H=c(()=>{const e=new Set,t=[];return R.forEach(({runtimeInfo:n})=>{n?.detectedLanguages?.forEach(n=>{e.has(n)||(e.add(n),t.push({id:n,label:Hi[n]||n,withCheckbox:!0}))})}),t.sort((e,t)=>e.id.localeCompare(t.id))},[R]),j=c(()=>ji.map(({id:e,value:t})=>({id:e,label:t,withCheckbox:!0})),[]),G=c(()=>{const e=new Set,t=[];return R.forEach(({instrumentationReport:n})=>{const o=n?.state||n?.progressStage;o&&!e.has(o)&&(e.add(o),t.push({id:o,label:wg(o),withCheckbox:!0}))}),t.sort((e,t)=>e.label.localeCompare(t.label))},[R]),W=c(()=>{const e=new Set,t=[];return R.forEach(({podsAgentInjectionStatus:n})=>{const{reasonEnum:o,message:i}=n||{};if(o){if(e.has(o))return;e.add(o),t.push({id:o,label:on(o),withCheckbox:!0})}else if(i){if(e.has(i))return;e.add(i),t.push({id:i,label:i,withCheckbox:!0})}}),t},[R]),K=(e,t,n)=>{const o=t.filter(e=>n.includes(e.id));_(t=>{return{...t,[e]:(n=o,n.map(({id:e,label:t})=>({id:e,label:t})))};var n})},Y=F?ja:Ga,J=c(()=>xg(D.languages),[D.languages]);return e(kg,{ref:B,children:[e(Ig,{"data-id":"filters-trigger",$isOpen:F,type:"button",onClick:()=>M(e=>!e),children:[t(Dl,{size:16,fill:n.v2.colors.white[500]}),t(_e,{size:Te.XS,weight:500,nowrap:!0,children:"Filters"}),P>0&&t(Ke,{label:P,status:Ee.Unknown,textSize:Te.XXXS}),t(Y,{size:16,fill:n.v2.colors.silver[200]})]}),F&&e(Ng,{children:[e(Eg,{children:[s&&t(ft,{label:"Namespace",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!X.length,options:X,values:xg(D.namespaces),setValues:e=>K("namespaces",X,e)}),u&&t(ft,{label:"Region",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!V.length,options:V,values:xg(D.regions),setValues:e=>K("regions",V,e)}),t(ft,{label:"Kind",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!U.length,options:U,values:xg(D.kinds),setValues:e=>K("kinds",U,e)}),t(ft,{label:"Programming Language",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!H.length,options:H,values:J,setValues:e=>K("languages",H,e)}),t(ft,{label:"Monitors",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!j.length,options:j,values:xg(D.monitors),setValues:e=>K("monitors",j,e)}),t(ft,s?{label:"Agent Injection Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!W.length,options:W,values:xg(D.podsAgentInjectionStatus),setValues:e=>K("podsAgentInjectionStatus",W,e)}:{label:"Instrumentation Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!G.length,options:G,values:xg(D.statuses),setValues:e=>K("statuses",G,e)}),t(le,{label:"Show only sources with errors",size:Nt.L,value:!!D.onlyErrors,onChange:e=>_(t=>({...t,onlyErrors:e}))})]}),e(Og,{children:[t(fe,{"data-id":"filters-reset",size:be.S,variant:ve.Text,label:"Reset",onClick:()=>{C(Vi.OVERVIEW_FILTERS),$(),_(A()),L(0),M(!1)},textColor:n.v2.colors.red[500]}),e($g,{children:[t(fe,{"data-id":"filters-cancel",size:be.S,variant:ve.Secondary,label:"Cancel",onClick:()=>M(!1)}),t(fe,{"data-id":"filters-apply",size:be.S,variant:ve.Primary,label:"Apply",onClick:()=>{y(Vi.OVERVIEW_FILTERS,D),O(D),L(Tg(D)),M(!1)}})]})]})]})]})},Rg=b.div`
1077
+ `,Mg=()=>{const n=v(),{platformType:o,isK8s:r,isConnector:s}=S(),{sourcesApi:c,namespacesApi:d}=Gl(),u=c.useSources().items,h=d.useNamespaces().items,{selectedStreamName:m}=ot(),{getItemSS:g,setItemSS:f,removeItemSS:b}=Ji(),{statuses:y,namespaces:C,regions:x,kinds:w,monitors:T,languages:k,onlyErrors:I,podsAgentInjectionStatus:N,setAll:E,clearFilters:O,getEmptyState:$}=ji(),A=i(()=>Gi(u,m),[u,m]);a(()=>{const e=g(Wi.OVERVIEW_FILTERS,$());E(e)},[]);const[R,D]=l({statuses:y,namespaces:C,regions:x,kinds:w,monitors:T,languages:k,onlyErrors:I,podsAgentInjectionStatus:N}),[_,P]=l(Ag(R)),[L,F]=l(!1),M=p(o);a(()=>{if(!L){const e={statuses:y,namespaces:C,regions:x,kinds:w,monitors:T,languages:k,onlyErrors:I,podsAgentInjectionStatus:N};D(e),P(Ag(e))}},[L,y,C,x,w,T,k,I,N]),a(()=>{M.current!==o&&(M.current=o,b(Wi.OVERVIEW_FILTERS),O(),D($()),P(0),F(!1))},[o]);const z=p(null);En(z,()=>F(!1)),uo({key:"Escape",active:L},()=>F(!1));const B=i(()=>{const e=new Set,t=[];return h.forEach(({name:n})=>{e.has(n)||(e.add(n),t.push({id:n,label:n,withCheckbox:!0}))}),t},[h]),X=i(()=>{const e=new Set,t=[];return A.forEach(({id:n})=>{const{kind:o}=n;e.has(o)||(e.add(o),t.push({id:o,label:kn(o),withCheckbox:!0}))}),t},[A]),U=i(()=>{const e=new Set,t=[];return A.forEach(({id:n})=>{const o=n.region?.trim();o&&!e.has(o)&&(e.add(o),t.push({id:o,label:o,withCheckbox:!0}))}),t.sort((e,t)=>e.id.localeCompare(t.id))},[A]),V=i(()=>{const e=new Set,t=[];return A.forEach(({runtimeInfo:n})=>{n?.detectedLanguages?.forEach(n=>{e.has(n)||(e.add(n),t.push({id:n,label:Ki[n]||n,withCheckbox:!0}))})}),t.sort((e,t)=>e.id.localeCompare(t.id))},[A]),H=i(()=>Yi.map(({id:e,value:t})=>({id:e,label:t,withCheckbox:!0})),[]),j=i(()=>{const e=new Set,t=[];return A.forEach(({instrumentationReport:n})=>{const o=n?.state||n?.progressStage;o&&!e.has(o)&&(e.add(o),t.push({id:o,label:$g(o),withCheckbox:!0}))}),t.sort((e,t)=>e.label.localeCompare(t.label))},[A]),G=i(()=>{const e=new Set,t=[];return A.forEach(({podsAgentInjectionStatus:n})=>{const{reasonEnum:o,message:i}=n||{};if(o){if(e.has(o))return;e.add(o),t.push({id:o,label:Xt(o),withCheckbox:!0})}else if(i){if(e.has(i))return;e.add(i),t.push({id:i,label:i,withCheckbox:!0})}}),t},[A]),W=(e,t,n)=>{const o=t.filter(e=>n.includes(e.id));D(t=>{return{...t,[e]:(n=o,n.map(({id:e,label:t})=>({id:e,label:t})))};var n})},K=L?Ja:qa,Y=i(()=>Og(R.languages),[R.languages]);return e(Rg,{ref:z,children:[e(Dg,{"data-id":"filters-trigger",$isOpen:L,type:"button",onClick:()=>F(e=>!e),children:[t(Ll,{size:16,fill:n.v2.colors.white[500]}),t(ee,{size:te.XS,weight:500,nowrap:!0,children:"Filters"}),_>0&&t(ce,{label:_,status:Pe.Unknown,textSize:te.XXXS}),t(K,{size:16,fill:n.v2.colors.silver[200]})]}),L&&e(_g,{children:[e(Pg,{children:[r&&t(vt,{label:"Namespace",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!B.length,options:B,values:Og(R.namespaces),setValues:e=>W("namespaces",B,e)}),s&&t(vt,{label:"Region",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!U.length,options:U,values:Og(R.regions),setValues:e=>W("regions",U,e)}),t(vt,{label:"Kind",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!X.length,options:X,values:Og(R.kinds),setValues:e=>W("kinds",X,e)}),t(vt,{label:"Programming Language",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!V.length,options:V,values:Y,setValues:e=>W("languages",V,e)}),t(vt,{label:"Monitors",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!H.length,options:H,values:Og(R.monitors),setValues:e=>W("monitors",H,e)}),t(vt,r?{label:"Agent Injection Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!G.length,options:G,values:Og(R.podsAgentInjectionStatus),setValues:e=>W("podsAgentInjectionStatus",G,e)}:{label:"Instrumentation Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!j.length,options:j,values:Og(R.statuses),setValues:e=>W("statuses",j,e)}),t(ge,{label:"Show only sources with errors",size:Et.L,value:!!R.onlyErrors,onChange:e=>D(t=>({...t,onlyErrors:e}))})]}),e(Lg,{children:[t(Te,{"data-id":"filters-reset",size:ke.S,variant:Ie.Text,label:"Reset",onClick:()=>{b(Wi.OVERVIEW_FILTERS),O(),D($()),P(0),F(!1)},textColor:n.v2.colors.red[500]}),e(Fg,{children:[t(Te,{"data-id":"filters-cancel",size:ke.S,variant:Ie.Secondary,label:"Cancel",onClick:()=>F(!1)}),t(Te,{"data-id":"filters-apply",size:ke.S,variant:Ie.Primary,label:"Apply",onClick:()=>{f(Wi.OVERVIEW_FILTERS,R),E(R),P(Ag(R)),F(!1)}})]})]})]})]})},zg=b.div`
1079
1078
  position: relative;
1080
1079
  display: flex;
1081
1080
  align-items: center;
@@ -1086,7 +1085,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
1086
1085
  box-sizing: border-box;
1087
1086
  border-radius: 16px 16px 0 0;
1088
1087
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
1089
- `,Dg=b.div`
1088
+ `,Bg=b.div`
1090
1089
  position: absolute;
1091
1090
  bottom: 0;
1092
1091
  left: 0;
@@ -1095,7 +1094,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
1095
1094
  background-color: ${({theme:e})=>e.v2.colors.purple[500]};
1096
1095
  border-radius: 32px;
1097
1096
  transition: width 0.3s;
1098
- `,_g=({entityType:n,badge:o,badgeTooltip:i,isLoading:a,refetch:l,partiallySelected:r,allSelected:s,onSelectAll:c,progressPercent:d})=>{const{setDrawerType:p}=fn();return e(Rg,{children:[e(pe,{$gap:8,style:{flex:1,minWidth:0},children:[c&&t(ne,{size:Wi.S,partiallyChecked:r,value:!!s,onChange:c}),t(_e,{size:Te.S,nowrap:!0,children:`${on(n)}s`}),t(Ke,{label:o,tooltip:i,status:Ee.Unknown,textSize:Te.XXXS})]}),e(pe,{children:[t(bt,{"data-id":`add-${n}`,icon:Ra,onClick:()=>p(Ki(n))}),t(bt,{"data-id":`refresh-${n}`,icon:ll,onClick:l,disabled:a})]}),"number"==typeof d&&t(Dg,{$percent:d})]})},Pg=b(ee)`
1097
+ `,Xg=({entityType:n,badge:o,badgeTooltip:i,isLoading:a,refetch:l,partiallySelected:r,allSelected:s,onSelectAll:c,progressPercent:d})=>{const{setDrawerType:p}=vn();return e(zg,{children:[e(oe,{$gap:8,style:{flex:1,minWidth:0},children:[c&&t(Q,{size:qi.S,partiallyChecked:r,value:!!s,onChange:c}),t(ee,{size:te.S,nowrap:!0,children:`${Xt(n)}s`}),t(ce,{label:o,tooltip:i,status:Pe.Unknown,textSize:te.XXXS})]}),e(oe,{children:[t(yt,{"data-id":`add-${n}`,icon:za,onClick:()=>p(Zi(n))}),t(yt,{"data-id":`refresh-${n}`,icon:pl,onClick:l,disabled:a})]}),"number"==typeof d&&t(Bg,{$percent:d})]})},Ug=b(ae)`
1099
1098
  align-items: center !important;
1100
1099
  justify-content: center !important;
1101
1100
  align-self: stretch;
@@ -1110,7 +1109,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
1110
1109
  &:hover {
1111
1110
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
1112
1111
  }
1113
- `,Lg=({entityType:n,description:o})=>{const{setDrawerType:i}=fn();return e(Pg,{onClick:()=>i(Ki(n)),children:[e(pe,{$gap:4,children:[t(Ra,{size:16}),t(_e,{size:Te.S,children:`Add ${on(n)}`})]}),t(_e,{size:Te.XXS,align:"center",children:o})]})},Fg=b.div`
1112
+ `,Vg=({entityType:n,description:o})=>{const{setDrawerType:i}=vn();return e(Ug,{onClick:()=>i(Zi(n)),children:[e(oe,{$gap:4,children:[t(za,{size:16}),t(ee,{size:te.S,children:`Add ${Xt(n)}`})]}),t(ee,{size:te.XXS,align:"center",children:o})]})},Hg=b.div`
1114
1113
  display: flex;
1115
1114
  align-items: center;
1116
1115
  gap: 12px;
@@ -1125,10 +1124,10 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
1125
1124
  &:hover {
1126
1125
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
1127
1126
  }
1128
- `,Mg=b(pe)`
1127
+ `,jg=b(oe)`
1129
1128
  flex: 1;
1130
1129
  min-width: 0;
1131
- `,zg=({entityId:n,entityType:o,title:i,status:a,faded:l,tooltip:r,throughput:s,icon:d,icons:p,iconSrc:u,isActive:h,raw:m})=>{const g=v(),f=o===kt.Source,b="boolean"==typeof h,y=l||b&&!h,{setDrawerType:C,setDrawerEntityId:S}=fn(),{selectedSources:x,setSelectedSources:w}=Yi(),T=m,k=f?T.id.namespace:"",I=c(()=>{if(!f)return-1;const e=x[k];return e?.length?e.findIndex(e=>e.id.name===T.id.name&&e.id.kind===T.id.kind&&(e.id.region??"")===(T.id.region??"")):-1},[f,x,k,T.id]),N=b&&!h?Nn(Ee.Info,g):a?Nn(a,g):void 0,E=f&&"object"==typeof n?`${n.namespace}-${n.name}-${n.kind}${n.region?`-${n.region}`:""}`:n;return e(Fg,{"data-id":E,$faded:y,onClick:()=>{C(Sn(o)),S(n)},children:[f&&t(ne,{size:Wi.S,value:-1!==I,onChange:()=>{const e={...x};e[k]||(e[k]=[]),-1===I?e[k].push(T):e[k].splice(I,1),w(e)}}),t(Cn,{icons:p,icon:d,iconSrc:u}),e(Mg,{$gap:4,children:[t(we,{size:Te.XS,nowrap:!0,children:i}),t(pe,{$gap:6,$justifyContent:"flex-end",style:{marginLeft:"auto",flexShrink:0},children:s&&t(Fe,{text:r||"Heads up! The data-flow metrics you see are calculated over 10-second intervals.",children:t(Ke,{label:s,status:a&&[Ee.Error,Ee.Warning].includes(a)?a:Ee.Unknown,leftIcon:N,textSize:Te.XXXS})})})]})]})};function Bg(e){return Object.values(e.conditions??{}).filter(Boolean).some(({status:e})=>e===Ee.Loading)?e:{...e,workloadOdigosHealthStatus:{status:an.Pending,name:"WorkloadOdigosHealthStatus",reasonEnum:"Pending",message:""}}}function Xg(e){const t=Object.values(e.conditions??{}).filter(Boolean),n=t.filter(({status:e})=>e!==Ee.Loading);return n?.length===t?.length?e:{...e,conditions:n?.length?n.reduce((e,t)=>(e[t.name]=t,e),{}):{}}}const Ug=b.div`
1130
+ `,Gg=({entityId:n,entityType:o,title:a,status:l,faded:r,tooltip:s,throughput:c,icon:d,icons:p,iconSrc:u,isActive:h,raw:m})=>{const g=v(),f=o===Nt.Source,b="boolean"==typeof h,y=r||b&&!h,{setDrawerType:C,setDrawerEntityId:S}=vn(),{selectedSources:x,setSelectedSources:w}=Qi(),T=m,k=f?T.id.namespace:"",I=i(()=>{if(!f)return-1;const e=x[k];return e?.length?e.findIndex(e=>e.id.name===T.id.name&&e.id.kind===T.id.kind&&(e.id.region??"")===(T.id.region??"")):-1},[f,x,k,T.id]),N=b&&!h?Pn(Pe.Info,g):l?Pn(l,g):void 0,E=f&&"object"==typeof n?`${n.namespace}-${n.name}-${n.kind}${n.region?`-${n.region}`:""}`:n;return e(Hg,{"data-id":E,$faded:y,onClick:()=>{C(wn(o)),S(n)},children:[f&&t(Q,{size:qi.S,value:-1!==I,onChange:()=>{const e={...x};e[k]||(e[k]=[]),-1===I?e[k].push(T):e[k].splice(I,1),w(e)}}),t(xn,{icons:p,icon:d,iconSrc:u}),e(jg,{$gap:4,children:[t(Ae,{size:te.XS,nowrap:!0,children:a}),t(oe,{$gap:6,$justifyContent:"flex-end",style:{marginLeft:"auto",flexShrink:0},children:c&&t(Ue,{text:s||"Heads up! The data-flow metrics you see are calculated over 10-second intervals.",children:t(ce,{label:c,status:l&&[Pe.Error,Pe.Warning].includes(l)?l:Pe.Unknown,leftIcon:N,textSize:te.XXXS})})})]})]})};function Wg(e){return Object.values(e.conditions??{}).filter(Boolean).some(({status:e})=>e===Pe.Loading)?e:{...e,workloadOdigosHealthStatus:{status:sn.Pending,name:"WorkloadOdigosHealthStatus",reasonEnum:"Pending",message:""}}}function Kg(e){const t=Object.values(e.conditions??{}).filter(Boolean),n=t.filter(({status:e})=>e!==Pe.Loading);return n?.length===t?.length?e:{...e,conditions:n?.length?n.reduce((e,t)=>(e[t.name]=t,e),{}):{}}}const Yg=b.div`
1132
1131
  position: absolute;
1133
1132
  top: 0;
1134
1133
  left: 0;
@@ -1139,21 +1138,21 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
1139
1138
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
1140
1139
  border-bottom: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
1141
1140
  pointer-events: none;
1142
- `,Vg=b.div`
1141
+ `,Jg=b.div`
1143
1142
  display: flex;
1144
1143
  align-items: center;
1145
1144
  gap: 8px;
1146
1145
  padding: 4px 8px 0;
1147
- `,Hg=b.div`
1146
+ `,qg=b.div`
1148
1147
  flex: 1;
1149
1148
  height: 1px;
1150
1149
  background: ${({theme:e})=>e.v2.colors.silver[700]};
1151
- `,jg=({namespace:e})=>{const n=v();return t(Ug,{children:t(_e,{size:Te.XXS,nowrap:!0,color:n.v2.colors.grey[300],children:e})})},Gg=({namespace:n})=>{const o=v();return e(Vg,{children:[t(Hg,{}),t(_e,{size:Te.XXS,nowrap:!0,color:o.v2.colors.grey[300],children:n}),t(Hg,{})]})},Wg={[kt.InstrumentationRule]:Ze.NO_DATA_INSTRUMENTATION_RULES,[kt.Source]:Ze.NO_DATA_SOURCES,[kt.Action]:Ze.NO_DATA_ACTIONS,[kt.Destination]:Ze.NO_DATA_DESTINATIONS},Kg=b.div`
1150
+ `,Zg=({namespace:e})=>{const n=v();return t(Yg,{children:t(ee,{size:te.XXS,nowrap:!0,color:n.v2.colors.grey[300],children:e})})},Qg=({namespace:n})=>{const o=v();return e(Jg,{children:[t(qg,{}),t(ee,{size:te.XXS,nowrap:!0,color:o.v2.colors.grey[300],children:n}),t(qg,{})]})},ef={[Nt.InstrumentationRule]:nt.NO_DATA_INSTRUMENTATION_RULES,[Nt.Source]:nt.NO_DATA_SOURCES,[Nt.Action]:nt.NO_DATA_ACTIONS,[Nt.Destination]:nt.NO_DATA_DESTINATIONS},tf=b.div`
1152
1151
  display: flex;
1153
1152
  flex-direction: column;
1154
1153
  flex: 1 0 0;
1155
1154
  min-width: 0;
1156
- `,Yg=b.div`
1155
+ `,nf=b.div`
1157
1156
  display: flex;
1158
1157
  flex-direction: column;
1159
1158
  align-items: stretch;
@@ -1163,7 +1162,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
1163
1162
  border-radius: 0 0 16px 16px;
1164
1163
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
1165
1164
  overflow: hidden;
1166
- `,Jg=b.div`
1165
+ `,of=b.div`
1167
1166
  position: relative;
1168
1167
  display: flex;
1169
1168
  flex-direction: column;
@@ -1175,7 +1174,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
1175
1174
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
1176
1175
  height: ${({$height:e})=>e}px;
1177
1176
  overflow: hidden;
1178
- `,qg=({entityType:n,entities:o,unfilteredCount:l,metrics:r,loading:s,maxHeight:p,refetch:u})=>{const h=n===kt.Source,m=o.length!==l,g=Ot(e=>h?e.progress[Rt.Instrumenting]?.percentage:void 0),f=Ot(e=>h?e.progress[Rt.Uninstrumenting]?.percentage:void 0),b=!h||void 0===g&&void 0===f?void 0:g||f||0,{selectedSources:v,setSelectedSources:y}=Yi(),C=c(()=>h?Object.values(v).reduce((e,t)=>e+t.length,0):0,[h,v]),S=c(()=>{if(!r)return;const e=new Map,t=n===kt.Source?r.sources:n===kt.Destination?r.destinations:void 0;if(t)for(const n of t)e.set(Ji(n),n.throughput);return e},[r,n]),x=c(()=>o.map(e=>((e,t,n)=>{const o=Xt(e);if(!o)return null;const i=t===kt.Source;let a,l,r=!1,s=e;if(i){const t=(e=>{const t=e.workloadOdigosHealthStatus?.status;switch(t){case an.Failure:return{status:Ee.Error,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case an.Notice:return{status:Ee.Warning,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case an.Pending:case an.Waiting:return{status:void 0,faded:!1,displaySource:Bg(e)};case an.Unsupported:case an.Disabled:return{status:void 0,faded:!0,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};default:return{status:void 0,faded:!1,displaySource:Xg(e)}}})(e);a=t.status,r=t.faded,l=t.tooltip,s=t.displaySource}else{const{priorotizedStatus:t,hasDisableds:n}=qi(e.conditions);a=t,r=n}const c=Zi(e,t,{extended:i,prioritizeDisplayName:!i});let d,p,u,h,m;switch(t){case kt.Source:{d=yn(e),p=ea(kt.Source);const t=n?.get(Qi(o));h=Tn(t);break}case kt.Destination:{const t=St(e.destinationType.type);p=t.icon,u=t.iconSrc;const i=n?.get(Qi(o));h=Tn(i),m=!e.disabled;break}case kt.Action:p=jt(e.type),m=!e.disabled;break;case kt.InstrumentationRule:p=Qt(e.type),m=!e.disabled}return{key:Qi(o),entityId:o,namespace:i?e.id.namespace:void 0,raw:s,itemProps:{entityId:o,entityType:t,title:c,status:a,faded:r,tooltip:l,throughput:h,icon:p,icons:d,iconSrc:u,isActive:m,raw:s}}})(e,n,S)).filter(Boolean),[o,n,S]),[w,T]=a(""),{elements:k,indexToNamespace:I,multipleNs:N,dividerCount:E}=c(()=>{const e=[],n=[],o=new Set(x.map(e=>e.namespace).filter(Boolean)).size>1;o&&(n.push(""),e.push(t("div",{style:{height:24}},"ns-spacer")));let i=0,a="";for(const o of x)h&&o.namespace&&o.namespace!==a&&(""!==a&&(n.push(o.namespace),e.push(t(Gg,{namespace:o.namespace},`ns-divider-${o.namespace}`)),i+=1),a=o.namespace),n.push(o.namespace||""),e.push(t(zg,{...o.itemProps},o.key));return{elements:e,indexToNamespace:n,multipleNs:o,dividerCount:i}},[x,h]);i(()=>{if(h&&I.length&&!w){const e=I.find(Boolean);e&&T(e)}},[h,I]);const O=d(e=>{if(!I.length)return;const t=I[Math.min(e,I.length-1)];t&&t!==w&&T(t)},[I,w]),$=58*x.length+(N?28:0)+32*E,A=Math.max(0,p-52-16),R=Math.min(A,$)+8,D="number"==typeof b?`${b}%`:m?`${o.length}/${l}`:l;return e(Kg,{children:[t(_g,{entityType:n,badge:D,badgeTooltip:m?Ze.FILTERED_COUNT_TOOLTIP:void 0,isLoading:s,refetch:u,partiallySelected:C>0&&o?.length!==C,allSelected:C>0&&o?.length===C,onSelectAll:h?e=>{if(h)if(e){const e={};o?.forEach(t=>{const{namespace:n}=t.id;e[n]?e[n].push(t):e[n]=[t]}),y(e)}else y({})}:void 0,progressPercent:b}),t(Yg,{children:o.length?e(Jg,{$height:R,children:[N&&w&&t(jg,{namespace:w}),t(gn,{gap:4,elements:k,onTopIndexChange:N?O:void 0})]}):s?t(ht,{size:3}):t(Lg,{entityType:n,description:Wg[n]??Ze.TO_COLLECT_OTEL_DATA})})]})},Zg=b.div`
1177
+ `,af=({entityType:n,entities:o,unfilteredCount:r,metrics:s,loading:c,maxHeight:p,refetch:u})=>{const h=n===Nt.Source,m=o.length!==r,g=$t(e=>h?e.progress[Dt.Instrumenting]?.percentage:void 0),f=$t(e=>h?e.progress[Dt.Uninstrumenting]?.percentage:void 0),b=!h||void 0===g&&void 0===f?void 0:g||f||0,{selectedSources:v,setSelectedSources:y}=Qi(),C=i(()=>h?Object.values(v).reduce((e,t)=>e+t.length,0):0,[h,v]),S=i(()=>{if(!s)return;const e=new Map,t=n===Nt.Source?s.sources:n===Nt.Destination?s.destinations:void 0;if(t)for(const n of t)e.set(ea(n),n.throughput);return e},[s,n]),x=i(()=>o.map(e=>((e,t,n)=>{const o=jt(e);if(!o)return null;const i=t===Nt.Source;let a,l,r=!1,s=e;if(i){const t=(e=>{const t=e.workloadOdigosHealthStatus?.status;switch(t){case sn.Failure:return{status:Pe.Error,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case sn.Notice:return{status:Pe.Warning,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case sn.Pending:case sn.Waiting:return{status:void 0,faded:!1,displaySource:Wg(e)};case sn.Unsupported:case sn.Disabled:return{status:void 0,faded:!0,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};default:return{status:void 0,faded:!1,displaySource:Kg(e)}}})(e);a=t.status,r=t.faded,l=t.tooltip,s=t.displaySource}else{const n=t===Nt.Action?ta(e):e.conditions,{priorotizedStatus:o,hasDisableds:i}=na(n);a=o,r=i}const c=oa(e,t,{extended:i,prioritizeDisplayName:!i});let d,p,u,h,m;switch(t){case Nt.Source:{d=Sn(e),p=aa(Nt.Source);const t=n?.get(ia(o));h=In(t);break}case Nt.Destination:{const t=wt(e.destinationType.type);p=t.icon,u=t.iconSrc;const i=n?.get(ia(o));h=In(i),m=!e.disabled;break}case Nt.Action:p=Yt(e.type),m=!e.disabled;break;case Nt.InstrumentationRule:p=on(e.type),m=!e.disabled}return{key:ia(o),entityId:o,namespace:i?e.id.namespace:void 0,raw:s,itemProps:{entityId:o,entityType:t,title:c,status:a,faded:r,tooltip:l,throughput:h,icon:p,icons:d,iconSrc:u,isActive:m,raw:s}}})(e,n,S)).filter(Boolean),[o,n,S]),[w,T]=l(""),{elements:k,indexToNamespace:I,multipleNs:N,dividerCount:E}=i(()=>{const e=[],n=[],o=new Set(x.map(e=>e.namespace).filter(Boolean)).size>1;o&&(n.push(""),e.push(t("div",{style:{height:24}},"ns-spacer")));let i=0,a="";for(const o of x)h&&o.namespace&&o.namespace!==a&&(""!==a&&(n.push(o.namespace),e.push(t(Qg,{namespace:o.namespace},`ns-divider-${o.namespace}`)),i+=1),a=o.namespace),n.push(o.namespace||""),e.push(t(Gg,{...o.itemProps},o.key));return{elements:e,indexToNamespace:n,multipleNs:o,dividerCount:i}},[x,h]);a(()=>{if(h&&I.length&&!w){const e=I.find(Boolean);e&&T(e)}},[h,I]);const O=d(e=>{if(!I.length)return;const t=I[Math.min(e,I.length-1)];t&&t!==w&&T(t)},[I,w]),$=58*x.length+(N?28:0)+32*E,A=Math.max(0,p-52-16),R=Math.min(A,$)+8,D="number"==typeof b?`${b}%`:m?`${o.length}/${r}`:r;return e(tf,{children:[t(Xg,{entityType:n,badge:D,badgeTooltip:m?nt.FILTERED_COUNT_TOOLTIP:void 0,isLoading:c,refetch:u,partiallySelected:C>0&&o?.length!==C,allSelected:C>0&&o?.length===C,onSelectAll:h?e=>{if(h)if(e){const e={};o?.forEach(t=>{const{namespace:n}=t.id;e[n]?e[n].push(t):e[n]=[t]}),y(e)}else y({})}:void 0,progressPercent:b}),t(nf,{children:o.length?e(of,{$height:R,children:[N&&w&&t(Zg,{namespace:w}),t(bn,{gap:4,elements:k,onTopIndexChange:N?O:void 0})]}):c?t(re,{size:3}):t(Vg,{entityType:n,description:ef[n]??nt.TO_COLLECT_OTEL_DATA})})]})},lf=b.div`
1179
1178
  width: 100%;
1180
1179
  flex: 1;
1181
1180
  min-height: 0;
@@ -1183,10 +1182,10 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
1183
1182
  display: flex;
1184
1183
  align-items: stretch;
1185
1184
  gap: 16px;
1186
- `,Qg={sources:[],destinations:[]},ef=()=>{const n=Xi(),{selectedStreamName:o}=Qe(),{containerRef:i,containerHeight:a}=ta(),{sourcesApi:l,destinationsApi:r,actionsApi:s,instrumentationRulesApi:d,metricsApi:p}=Vl(),{items:u,loading:h}=l.useSources(),{items:m,loading:g}=r.useDestinations(),{items:f,loading:b}=s.useActions(),{items:v,loading:y}=d.useRules(),C=fn(e=>e.drawerType),{data:S}=p.useMetrics({skip:!u.length||!m.length||!!C,pollInterval:1e4,fetchPolicy:"network-only"}),x=S?.getOverviewMetrics??Qg,w=c(()=>Ui(u,o),[u,o]),T=c(()=>Yt(m,o),[m,o]),k=c(()=>na(w,n),[w,n]),I=c(()=>oa(T,n),[T,n]),N=c(()=>ia(f,n),[f,n]);return e(Zg,{ref:i,children:[t(qg,{entityType:kt.InstrumentationRule,entities:v,unfilteredCount:v.length,loading:y,maxHeight:a,refetch:d.fetchAll}),t(qg,{entityType:kt.Source,entities:k,unfilteredCount:w.length,metrics:x,loading:h,maxHeight:a,refetch:l.fetchAll}),t(qg,{entityType:kt.Action,entities:N,unfilteredCount:f.length,loading:b,maxHeight:a,refetch:s.fetchAll}),t(qg,{entityType:kt.Destination,entities:I,unfilteredCount:T.length,metrics:x,loading:g,maxHeight:a,refetch:r.fetchAll})]})},tf="40vw",nf=b.div`
1185
+ `,rf={sources:[],destinations:[]},sf=()=>{const n=ji(),{selectedStreamName:o}=ot(),{containerRef:a,containerHeight:l}=la(),{sourcesApi:r,destinationsApi:s,actionsApi:c,instrumentationRulesApi:d,metricsApi:p}=Gl(),{items:u,loading:h}=r.useSources(),{items:m,loading:g}=s.useDestinations(),{items:f,loading:b}=c.useActions(),{items:v,loading:y}=d.useRules(),C=vn(e=>e.drawerType),{data:S}=p.useMetrics({skip:!u.length||!m.length||!!C,pollInterval:1e4,fetchPolicy:"network-only"}),x=S?.getOverviewMetrics??rf,w=i(()=>Gi(u,o),[u,o]),T=i(()=>Qt(m,o),[m,o]),k=i(()=>ra(w,n),[w,n]),I=i(()=>sa(T,n),[T,n]),N=i(()=>ca(f,n),[f,n]);return e(lf,{ref:a,children:[t(af,{entityType:Nt.InstrumentationRule,entities:v,unfilteredCount:v.length,loading:y,maxHeight:l,refetch:d.fetchAll}),t(af,{entityType:Nt.Source,entities:k,unfilteredCount:w.length,metrics:x,loading:h,maxHeight:l,refetch:r.fetchAll}),t(af,{entityType:Nt.Action,entities:N,unfilteredCount:f.length,loading:b,maxHeight:l,refetch:c.fetchAll}),t(af,{entityType:Nt.Destination,entities:I,unfilteredCount:T.length,metrics:x,loading:g,maxHeight:l,refetch:s.fetchAll})]})},cf="40vw",df=b.div`
1187
1186
  position: relative;
1188
- width: ${tf};
1189
- `,of=b.div`
1187
+ width: ${cf};
1188
+ `,pf=b.div`
1190
1189
  position: absolute;
1191
1190
  top: calc(100% + 8px);
1192
1191
  left: 0;
@@ -1195,23 +1194,23 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
1195
1194
  flex-direction: column;
1196
1195
  gap: 8px;
1197
1196
  padding: 8px;
1198
- width: calc(${tf} - 16px);
1197
+ width: calc(${cf} - 16px);
1199
1198
  border-radius: 12px;
1200
1199
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
1201
1200
  box-shadow: 0 12px 24px 24px rgba(0, 0, 0, 0.5);
1202
- `,af=b.div`
1201
+ `,uf=b.div`
1203
1202
  display: flex;
1204
1203
  align-items: center;
1205
1204
  overflow-x: auto;
1206
- `,lf=b.div`
1205
+ `,hf=b.div`
1207
1206
  display: flex;
1208
1207
  flex-direction: column;
1209
1208
  gap: 0;
1210
1209
  max-height: 60vh;
1211
1210
  overflow-y: auto;
1212
- `,rf=b.div`
1211
+ `,mf=b.div`
1213
1212
  padding: 8px 12px 4px 12px;
1214
- `,sf=b.div`
1213
+ `,gf=b.div`
1215
1214
  display: flex;
1216
1215
  align-items: center;
1217
1216
  gap: 8px;
@@ -1221,12 +1220,12 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
1221
1220
  &:hover {
1222
1221
  background-color: ${({theme:e})=>e.v2.colors.silver[700]};
1223
1222
  }
1224
- `,cf=b.div`
1223
+ `,ff=b.div`
1225
1224
  padding: 16px 8px;
1226
- `,df=({preventPopup:n=!1})=>{const o=v(),{selectedStreamName:i}=Qe(),{searchText:r,setSearchText:s}=Xi(),{setDrawerType:d,setDrawerEntityId:u}=fn(),{sourcesApi:h,destinationsApi:m,actionsApi:g,instrumentationRulesApi:f}=Vl(),b=h.useSources().items,y=m.useDestinations().items,C=g.useActions().items,S=f.useRules().items,x=p(null),[w,T]=a(!1),[k,I]=a("all"),N=!n&&(!!r||w),E=()=>{s(""),T(!1),I("all")};En(x,()=>E()),ro({key:"Escape",active:N},E);const{categories:O,searchResults:$}=c(()=>(({instrumentationRules:e,sources:t,actions:n,destinations:o,searchText:i,selectedCategory:a})=>{const l=i?e.filter(e=>e.type?.toLowerCase().includes(i)||e.ruleName?.toLowerCase().includes(i)):e,r=i?t.filter(e=>e.id.name?.toLowerCase().includes(i)||e.serviceName?.toLowerCase().includes(i)||e.id.namespace?.toLowerCase().includes(i)):t,s=i?n.filter(e=>e.type?.toLowerCase().includes(i)||e.name?.toLowerCase().includes(i)):n,c=i?o.filter(e=>e.destinationType.displayName?.toLowerCase().includes(i)||e.name?.toLowerCase().includes(i)):o,d=[{category:kt.Source,label:"Sources",count:r.length,entities:[]},{category:kt.Action,label:"Actions",count:s.length,entities:[]},{category:kt.Destination,label:"Destinations",count:c.length,entities:[]},{category:kt.InstrumentationRule,label:"Instrumentation Rules",count:l.length,entities:[]}];d.unshift({category:"all",label:"All",count:l.length+r.length+s.length+c.length,entities:[]});const p=d.filter(({count:e,category:t})=>!!e&&"all"!==t&&["all",t].includes(a)).map(e=>({...e,entities:e.category===kt.InstrumentationRule?l:e.category===kt.Source?r:e.category===kt.Action?s:e.category===kt.Destination?c:[]}));return{categories:d,searchResults:p}})({instrumentationRules:S,sources:Ui(b,i),actions:C,destinations:Yt(y,i),searchText:r,selectedCategory:k}),[S,b,C,y,i,r,k]),A=c(()=>O.filter(({count:e,category:t})=>!!e||"all"===t).map(({category:e,label:t,count:n})=>({value:e,label:n?`${t} (${n})`:t})),[O]),R=$.some(({entities:e})=>e.length>0);return e(nf,{ref:x,children:[t(mn,{value:r,onChange:e=>s(e.toLowerCase()),onFocus:()=>T(!0),width:tf}),N&&e(of,{children:[A.length>1&&t(af,{children:t(ce,{options:A,selected:k,setSelected:I})}),R?t(lf,{children:$.map(({category:n,label:i,entities:a},r)=>{if(!a.length)return null;const s=ea(n);return e(l,{children:[t(rf,{children:t(_e,{size:Te.XXS,color:Pe.Secondary,children:i})}),a.map((i,a)=>e(sf,{onClick:()=>{const e=Xt(i);e&&(d(Sn(n)),u(e),E())},children:[s&&t(s,{size:16,fill:o.v2.colors.white[500]}),t(_e,{size:Te.XS,nowrap:!0,children:Zi(i,n,{extended:!0})})]},`entity-${r}-${a}`))]},`category-list-${n}`)})}):t(cf,{children:t(xe,{hideIcon:!0,title:"No results",subTitle:r?`No matches for "${r}"`:"Start typing to search"})})]})]})},pf=({onRedirectToSampling:o})=>{const{sourcesApi:i}=Vl(),{items:a}=i.useSources(),{drawerType:l,drawerEntityId:r,setDrawerType:s,setDrawerEntityId:d}=fn(),p=()=>{s(null),d(null)},u=c(()=>a.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[a]),h=c(()=>Array.from(new Set(a.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[a]);return e(n,{children:[t(im,{}),l===go.AddSource&&t(ir,{children:t(vc,{onClose:p,withOverlay:!0})}),l===go.AddDestination&&t(ar,{children:t(tc,{onClose:p,withOverlay:!0})}),l===go.AddInstrumentationRule&&t(rr,{sourceOptions:u,namespaceOptions:h,children:t(nc,{onClose:p,withOverlay:!0})}),l===go.AddAction&&t(lr,{sourceOptions:u,namespaceOptions:h,children:t(js,{onClose:p,withOverlay:!0})}),l===go.EditSource&&t(cr,{children:t(Rh,{onClose:p,sourceId:r,onRedirectToSampling:o})}),l===go.EditDestination&&t(ar,{children:t(ap,{onClose:p,destinationId:r})}),l===go.EditInstrumentationRule&&t(rr,{sourceOptions:u,namespaceOptions:h,children:t(rp,{onClose:p,ruleId:r})}),l===go.EditAction&&t(lr,{sourceOptions:u,namespaceOptions:h,children:t(np,{onClose:p,actionId:r})})]})},uf=b.div`
1225
+ `,bf=({preventPopup:n=!1})=>{const o=v(),{selectedStreamName:a}=ot(),{searchText:s,setSearchText:c}=ji(),{setDrawerType:d,setDrawerEntityId:u}=vn(),{sourcesApi:h,destinationsApi:m,actionsApi:g,instrumentationRulesApi:f}=Gl(),b=h.useSources().items,y=m.useDestinations().items,C=g.useActions().items,S=f.useRules().items,x=p(null),[w,T]=l(!1),[k,I]=l("all"),N=!n&&(!!s||w),E=()=>{c(""),T(!1),I("all")};En(x,()=>E()),uo({key:"Escape",active:N},E);const{categories:O,searchResults:$}=i(()=>(({instrumentationRules:e,sources:t,actions:n,destinations:o,searchText:i,selectedCategory:a})=>{const l=i?e.filter(e=>e.type?.toLowerCase().includes(i)||e.ruleName?.toLowerCase().includes(i)):e,r=i?t.filter(e=>e.id.name?.toLowerCase().includes(i)||e.serviceName?.toLowerCase().includes(i)||e.id.namespace?.toLowerCase().includes(i)):t,s=i?n.filter(e=>e.type?.toLowerCase().includes(i)||e.name?.toLowerCase().includes(i)):n,c=i?o.filter(e=>e.destinationType.displayName?.toLowerCase().includes(i)||e.name?.toLowerCase().includes(i)):o,d=[{category:Nt.Source,label:"Sources",count:r.length,entities:[]},{category:Nt.Action,label:"Actions",count:s.length,entities:[]},{category:Nt.Destination,label:"Destinations",count:c.length,entities:[]},{category:Nt.InstrumentationRule,label:"Instrumentation Rules",count:l.length,entities:[]}];d.unshift({category:"all",label:"All",count:l.length+r.length+s.length+c.length,entities:[]});const p=d.filter(({count:e,category:t})=>!!e&&"all"!==t&&["all",t].includes(a)).map(e=>({...e,entities:e.category===Nt.InstrumentationRule?l:e.category===Nt.Source?r:e.category===Nt.Action?s:e.category===Nt.Destination?c:[]}));return{categories:d,searchResults:p}})({instrumentationRules:S,sources:Gi(b,a),actions:C,destinations:Qt(y,a),searchText:s,selectedCategory:k}),[S,b,C,y,a,s,k]),A=i(()=>O.filter(({count:e,category:t})=>!!e||"all"===t).map(({category:e,label:t,count:n})=>({value:e,label:n?`${t} (${n})`:t})),[O]),R=$.some(({entities:e})=>e.length>0);return e(df,{ref:x,children:[t(fn,{value:s,onChange:e=>c(e.toLowerCase()),onFocus:()=>T(!0),width:cf}),N&&e(pf,{children:[A.length>1&&t(uf,{children:t(ve,{options:A,selected:k,setSelected:I})}),R?t(hf,{children:$.map(({category:n,label:i,entities:a},l)=>{if(!a.length)return null;const s=aa(n);return e(r,{children:[t(mf,{children:t(ee,{size:te.XXS,color:ne.Secondary,children:i})}),a.map((i,a)=>e(gf,{onClick:()=>{const e=jt(i);e&&(d(wn(n)),u(e),E())},children:[s&&t(s,{size:16,fill:o.v2.colors.white[500]}),t(ee,{size:te.XS,nowrap:!0,children:oa(i,n,{extended:!0})})]},`entity-${l}-${a}`))]},`category-list-${n}`)})}):t(ff,{children:t($e,{hideIcon:!0,title:"No results",subTitle:s?`No matches for "${s}"`:"Start typing to search"})})]})]})},vf=({onRedirectToSampling:o})=>{const{sourcesApi:a}=Gl(),{items:l}=a.useSources(),{drawerType:r,drawerEntityId:s,setDrawerType:c,setDrawerEntityId:d}=vn(),p=()=>{c(null),d(null)},u=i(()=>l.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[l]),h=i(()=>Array.from(new Set(l.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[l]);return e(n,{children:[t(pm,{}),r===yo.AddSource&&t(rr,{children:t(Tc,{onClose:p,withOverlay:!0})}),r===yo.AddDestination&&t(sr,{children:t(rc,{onClose:p,withOverlay:!0})}),r===yo.AddInstrumentationRule&&t(dr,{sourceOptions:u,namespaceOptions:h,children:t(sc,{onClose:p,withOverlay:!0})}),r===yo.AddAction&&t(cr,{sourceOptions:u,namespaceOptions:h,children:t(qs,{onClose:p,withOverlay:!0})}),r===yo.EditSource&&t(ur,{children:t(zh,{onClose:p,sourceId:s,onRedirectToSampling:o})}),r===yo.EditDestination&&t(sr,{children:t(up,{onClose:p,destinationId:s})}),r===yo.EditInstrumentationRule&&t(dr,{sourceOptions:u,namespaceOptions:h,children:t(mp,{onClose:p,ruleId:s})}),r===yo.EditAction&&t(cr,{sourceOptions:u,namespaceOptions:h,children:t(cp,{onClose:p,actionId:s})})]})},yf=b.div`
1227
1226
  position: relative;
1228
1227
  display: inline-flex;
1229
- `,hf=b.div`
1228
+ `,Cf=b.div`
1230
1229
  display: inline-flex;
1231
1230
  align-items: center;
1232
1231
  gap: 6px;
@@ -1237,7 +1236,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
1237
1236
  &:hover {
1238
1237
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
1239
1238
  }
1240
- `,mf=b.div`
1239
+ `,Sf=b.div`
1241
1240
  position: absolute;
1242
1241
  top: calc(100% + 8px);
1243
1242
  left: 0;
@@ -1251,18 +1250,18 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
1251
1250
  border-radius: 12px;
1252
1251
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
1253
1252
  box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
1254
- `,gf=b.div`
1253
+ `,xf=b.div`
1255
1254
  display: flex;
1256
1255
  align-items: center;
1257
1256
  gap: 8px;
1258
1257
  width: 100%;
1259
- `,ff=b.div`
1258
+ `,wf=b.div`
1260
1259
  display: flex;
1261
1260
  flex-direction: column;
1262
1261
  gap: 0;
1263
1262
  max-height: 240px;
1264
1263
  overflow-y: auto;
1265
- `,bf=b.div`
1264
+ `,Tf=b.div`
1266
1265
  display: flex;
1267
1266
  align-items: center;
1268
1267
  gap: 8px;
@@ -1273,29 +1272,29 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
1273
1272
  &:hover {
1274
1273
  background-color: ${({$selected:e,theme:t})=>e?t.v2.colors.silver[600]:t.v2.colors.silver[700]};
1275
1274
  }
1276
- `,vf=b.div`
1275
+ `,kf=b.div`
1277
1276
  flex: 1;
1278
1277
  min-width: 0;
1279
1278
  overflow: hidden;
1280
1279
  text-overflow: ellipsis;
1281
1280
  white-space: nowrap;
1282
- `,yf=b.div`
1281
+ `,If=b.div`
1283
1282
  display: flex;
1284
1283
  align-items: center;
1285
1284
  gap: 2px;
1286
1285
  flex-shrink: 0;
1287
- `,Cf=b.div`
1286
+ `,Nf=b.div`
1288
1287
  display: flex;
1289
1288
  padding-top: 4px;
1290
1289
  border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
1291
- `,Sf=()=>{const o=v(),{isVm:l}=S(),{clearStore:r}=aa(),{dataStreamsApi:s}=Vl();s.useDataStreams();const{dataStreams:d,selectedStreamName:u,setSelectedStreamName:h}=Qe(),m=p(null),[g,f]=a(!1),[b,y]=a(""),[C,x]=a(""),[w,T]=a(!1),[k,I]=a(!1),[N,E]=a(!1),[O,$]=a(""),[A,R]=a(!1);En(m,()=>f(!1)),i(()=>{g||y("")},[g]);const D=c(()=>{if(!b)return d;const e=b.toLowerCase();return d.filter(({name:t})=>t.toLowerCase().includes(e))},[d,b]),_=g?ja:Ga;return l?null:e(n,{children:[e(uf,{ref:m,children:[e(hf,{"data-id":"data-stream-select",$isOpen:g,onClick:()=>f(e=>!e),children:[t(_l,{size:24}),t(_e,{size:Te.S,weight:500,nowrap:!0,children:(P=u,`Data Stream: ${P}`)}),t(Ke,{label:d.length,status:Ee.Unknown,textSize:Te.XXXS}),t(_,{size:20,fill:o.v2.colors.silver[200]})]}),g&&e(mf,{children:[t(gf,{children:t(mn,{value:b,onChange:y,placeholder:"Search streams...",width:"100%"})}),t(ff,{children:0===D.length?t(bf,{children:t(_e,{size:Te.XS,color:Pe.Secondary,children:"No streams match"})}):D.map(({name:n})=>{const o=n===la;return e(bf,{"data-id":`stream-row-${n}`,$selected:n===u,onClick:()=>(e=>{e!==u&&(r(),h(e)),f(!1)})(n),children:[t(vf,{children:t(_e,{size:Te.XS,nowrap:!0,children:n})}),e(yf,{children:[t(bt,{"data-id":`stream-edit-${n}`,icon:Ma,size:vt.XS,onClick:e=>{e.stopPropagation(),f(!1),x(n),T(!0)}}),!o&&t(bt,{"data-id":`stream-delete-${n}`,icon:Aa,size:vt.XS,onClick:e=>{e.stopPropagation(),f(!1),$(n),R(!0)}})]})]},`stream-${n}`)})}),t(Cf,{children:t(fe,{"data-id":"add-stream-trigger",variant:ve.Secondary,size:be.S,leftIcon:Ra,label:`${Lt.NEW} ${Ze.STREAM_NAME}`,fullWidth:!0,onClick:()=>{f(!1),r(),E(!0),I(!0)}})})]})]}),N&&t(dr,{defaultExcludeName:u,children:t(em,{isOpen:k,onClose:()=>I(!1),onCloseEnd:()=>E(!1)})}),C&&t(dr,{children:t(tm,{isOpen:w,dataStreamName:C,onClose:()=>T(!1),onCloseEnd:()=>x("")})}),t(Er,{target:`${Ze.STREAM_NAME.toLowerCase()} "${O}"`,isOpen:A,onClose:()=>R(!1),onApprove:async()=>{O&&await s.remove(O)}})]});var P},xf=()=>{const{selectedStreamName:o}=Qe(),{selectedSources:l,setSelectedSources:r}=Yi(),{sourcesApi:s}=Vl(),[p,u]=a(!1),[h,m]=a(!1),g=c(()=>Object.values(l).reduce((e,t)=>e+t.length,0),[l]),f=d(()=>{r({})},[r]),b=d(()=>u(!1),[]),v=d(()=>m(!1),[]);i(()=>{f()},[o,f]);const y=d(()=>{s.restartWorkloads(Object.values(l).flat().filter(e=>e.id.kind!==xn.StaticPod).map(bn)),f()},[s,l,f]),C=d(()=>{s.persistV2(Object.fromEntries(Object.entries(l).map(([e,t])=>[e,t.map(({id:e})=>({namespace:e.namespace,name:e.name,kind:e.kind||void 0,region:e.region,selected:!1,currentStreamName:o}))]))),f()},[s,l,o,f]),S=c(()=>[{id:"multi-source-deselect",type:hn.Button,buttonProps:{variant:ve.Text,size:be.S,label:"Deselect",onClick:f}},{id:"multi-source-restart",type:hn.Button,buttonProps:{variant:ve.Secondary,size:be.S,label:"Restart",leftIcon:bl,onClick:()=>u(!0)}},{id:"multi-source-uninstrument",type:hn.Button,buttonProps:{variant:ve.Primary,size:be.S,label:"Uninstrument",leftIcon:Aa,onClick:()=>m(!0)}}],[f]);return e(n,{children:[t(Fn,{isOpen:g>0,richTitle:{icon:Ja,title:"Selected sources",badge:{label:g}},actions:S}),t(qe,{isOpen:p,title:"Rollout Restart Workloads",description:"Are you sure you want to rollout restart these workloads?",onClose:b,denyButton:{label:"Go Back",variant:ve.Secondary,onClick:b},approveButton:{label:"Confirm",variant:ve.Primary,onClick:()=>{y(),b()}}}),t(Er,{isOpen:h,action:"uninstrument",target:`${g} source${1===g?"":"s"}`,onClose:v,onDeny:v,onApprove:C})]})},wf=C`
1290
+ `,Ef=()=>{const o=v(),{isK8s:r}=S(),{clearStore:s}=da(),{dataStreamsApi:c}=Gl();c.useDataStreams();const{dataStreams:d,selectedStreamName:u,setSelectedStreamName:h}=ot(),m=p(null),[g,f]=l(!1),[b,y]=l(""),[C,x]=l(""),[w,T]=l(!1),[k,I]=l(!1),[N,E]=l(!1),[O,$]=l(""),[A,R]=l(!1);En(m,()=>f(!1)),a(()=>{g||y("")},[g]);const D=i(()=>{if(!b)return d;const e=b.toLowerCase();return d.filter(({name:t})=>t.toLowerCase().includes(e))},[d,b]),_=g?Ja:qa;return r?e(n,{children:[e(yf,{ref:m,children:[e(Cf,{"data-id":"data-stream-select",$isOpen:g,onClick:()=>f(e=>!e),children:[t(Fl,{size:24}),t(ee,{size:te.S,weight:500,nowrap:!0,children:(P=u,`Data Stream: ${P}`)}),t(ce,{label:d.length,status:Pe.Unknown,textSize:te.XXXS}),t(_,{size:20,fill:o.v2.colors.silver[200]})]}),g&&e(Sf,{children:[t(xf,{children:t(fn,{value:b,onChange:y,placeholder:"Search streams...",width:"100%"})}),t(wf,{children:0===D.length?t(Tf,{children:t(ee,{size:te.XS,color:ne.Secondary,children:"No streams match"})}):D.map(({name:n})=>{const o=n===pa;return e(Tf,{"data-id":`stream-row-${n}`,$selected:n===u,onClick:()=>(e=>{e!==u&&(s(),h(e)),f(!1)})(n),children:[t(kf,{children:t(ee,{size:te.XS,nowrap:!0,children:n})}),e(If,{children:[t(yt,{"data-id":`stream-edit-${n}`,icon:ja,size:Ct.XS,onClick:e=>{e.stopPropagation(),f(!1),x(n),T(!0)}}),!o&&t(yt,{"data-id":`stream-delete-${n}`,icon:Ma,size:Ct.XS,onClick:e=>{e.stopPropagation(),f(!1),$(n),R(!0)}})]})]},`stream-${n}`)})}),t(Nf,{children:t(Te,{"data-id":"add-stream-trigger",variant:Ie.Secondary,size:ke.S,leftIcon:za,label:`${Ft.NEW} ${nt.STREAM_NAME}`,fullWidth:!0,onClick:()=>{f(!1),s(),E(!0),I(!0)}})})]})]}),N&&t(hr,{defaultExcludeName:u,children:t(rm,{isOpen:k,onClose:()=>I(!1),onCloseEnd:()=>E(!1)})}),C&&t(hr,{children:t(sm,{isOpen:w,dataStreamName:C,onClose:()=>T(!1),onCloseEnd:()=>x("")})}),t(Ar,{target:`${nt.STREAM_NAME.toLowerCase()} "${O}"`,isOpen:A,onClose:()=>R(!1),onApprove:async()=>{O&&await c.remove(O)}})]}):null;var P},Of=()=>{const{selectedStreamName:o}=ot(),{selectedSources:r,setSelectedSources:s}=Qi(),{sourcesApi:c}=Gl(),[p,u]=l(!1),[h,m]=l(!1),g=i(()=>Object.values(r).reduce((e,t)=>e+t.length,0),[r]),f=d(()=>{s({})},[s]),b=d(()=>u(!1),[]),v=d(()=>m(!1),[]);a(()=>{f()},[o,f]);const y=d(()=>{c.restartWorkloads(Object.values(r).flat().filter(e=>e.id.kind!==Tn.StaticPod).map(yn)),f()},[c,r,f]),C=d(()=>{c.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,region:e.region,selected:!1,currentStreamName:o}))]))),f()},[c,r,o,f]),S=i(()=>[{id:"multi-source-deselect",type:gn.Button,buttonProps:{variant:Ie.Text,size:ke.S,label:"Deselect",onClick:f}},{id:"multi-source-restart",type:gn.Button,buttonProps:{variant:Ie.Secondary,size:ke.S,label:"Restart",leftIcon:Sl,onClick:()=>u(!0)}},{id:"multi-source-uninstrument",type:gn.Button,buttonProps:{variant:Ie.Primary,size:ke.S,label:"Uninstrument",leftIcon:Ma,onClick:()=>m(!0)}}],[f]);return e(n,{children:[t(Bn,{isOpen:g>0,richTitle:{icon:tl,title:"Selected sources",badge:{label:g}},actions:S}),t(tt,{isOpen:p,title:"Rollout Restart Workloads",description:"Are you sure you want to rollout restart these workloads?",onClose:b,denyButton:{label:"Go Back",variant:Ie.Secondary,onClick:b},approveButton:{label:"Confirm",variant:Ie.Primary,onClick:()=>{y(),b()}}}),t(Ar,{isOpen:h,action:"uninstrument",target:`${g} source${1===g?"":"s"}`,onClose:v,onDeny:v,onApprove:C})]})},$f=C`
1292
1291
  0% {
1293
1292
  background-position: 200% 50%;
1294
1293
  }
1295
1294
  100% {
1296
1295
  background-position: 0% 50%;
1297
1296
  }
1298
- `,Tf=b.div`
1297
+ `,Af=b.div`
1299
1298
  display: flex;
1300
1299
  align-items: center;
1301
1300
  justify-content: space-evenly;
@@ -1306,43 +1305,43 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
1306
1305
 
1307
1306
  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%)`};
1308
1307
  background-size: 200% 100%;
1309
- animation: ${wf} 15s linear infinite;
1310
- `,kf=[Ya,Ja,Va,Ha],If=({onRedirectToSampling:n})=>{const o=v();return e(zi,{children:[e(st,{fullHeight:!0,customTitle:t(Sf,{}),customSearch:t(df,{}),filters:t(Ag,{}),children:[t(Tf,{children:kf.map((n,i)=>e(l,{children:[t(n,{size:24}),i<kf.length-1&&t(Ua,{fill:o.v2.colors.white[500]+dt["020"],size:24})]},n.name))}),t(ef,{})]}),t(pf,{onRedirectToSampling:n}),t(xf,{})]})};var Nf;(e=>{e.Gateway="gateway",e.Node="node"})(Nf||(Nf={}));const Ef=({onClickDownloadDiagnose:n,onClickRefresh:o,loading:i,disabled:a})=>{const l=c(()=>{const e=[];return n&&e.push({id:ho(),type:hn.Button,buttonProps:{label:"Download Diagnose",leftIcon:Tl,size:be.S,variant:ve.Text,onClick:n,disabled:a}}),o&&e.push({id:ho(),type:hn.Button,buttonProps:{label:"Refresh",leftIcon:ll,size:be.S,variant:ve.Text,onClick:o,disabled:a,loading:i}}),e},[n,o,a,i]);return e(pe,{$alignItems:"center",$justifyContent:"space-between",children:[t(ra,{icon:Pl,title:"Collectors Pipeline"}),t(sa,{actions:l})]})},Of=({pod:n,onClose:o})=>{const{formatTimeAgo:i}=en(),{collectorsApi:a}=Vl(),{data:l}=a.usePodInfo(n?{namespace:n.namespace,name:n.name}:void 0,{skip:!n}),r=c(()=>[{id:ho(),title:"Node",label:l?.node??"-",withCopy:!0},{id:ho(),title:"Status",badge:{status:ca(l?.status),label:l?.status??"-"}}],[l]),s=c(()=>l?.containers?.map(e=>({id:ho(),items:[{id:ho(),title:"Container",label:e.name??"-"},{id:ho(),title:"Status",label:e.startedAt?`${e.status} (since ${i(e.startedAt)})`:e.status},{id:ho(),title:"Ready",badge:{status:e.ready?Ee.Success:Ee.Error,leftIcon:e.ready?_a:Pa,label:e.ready?"True":"False",invertColors:!0}},{id:ho(),title:"Started",badge:{status:e.started?Ee.Success:Ee.Error,leftIcon:e.started?_a:Pa,label:e.started?"True":"False",invertColors:!0}},{id:ho(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:ho(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:ho(),title:Ze.RESTARTS,label:e.restarts.toString()},{id:ho(),title:"State Reason",label:e.stateReason??"-"},{id:ho(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:ho(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[l]);return t(Mt,{isOpen:!!n,header:{icon:sl,title:"Pod Information",onClose:o},children:l?e(Vt,{bgTint:"1000",richTitle:{icon:sl,title:l.name,withCopy:!0},children:[t(Vt,{bgTint:"900",cellsPerRow:2,items:r}),e(Vt,{bgTint:"900",richTitle:{icon:fl,title:Ze.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:[t(un,{value:`kubectl get pod ${l.name} -n ${l.namespace} -o yaml`}),t(un,{value:`kubectl describe pod ${l.name} -n ${l.namespace}`}),t(un,{value:`kubectl logs ${l.name} -n ${l.namespace}`})]}),t(Vt,{bgTint:"900",richTitle:{title:"Containers Overview"},withCollapse:!0,collapseIsDefaultOpen:!0,children:s.length?s.map(({id:e,items:n})=>t(Vt,{bgTint:"800",cellsPerRow:2,items:n},e)):t(xe,{title:"No containers",subTitle:"Pod has no containers"})}),t(Or,{bgTint:"900",yaml:l.manifestYAML,defaultOpen:!0})]}):t(mt,{$height:"50vh",children:t(yt,{withSpinner:!0})})})};var $f;(e=>{e.PodName="podName",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.SpanDropRate="spanDropRate",e.Age="age",e.DockerImage="dockerImage"})($f||($f={}));const Af=e=>{const t=[{key:$f.PodName,label:"Pod Name"},{key:$f.Status,label:"Status"},{key:$f.Restarts,label:Ze.RESTARTS},{key:$f.NodeName,label:"Node Name"},{key:$f.Age,label:"Age"},{key:$f.DockerImage,label:"Collector Version"}];return e&&t.splice(4,0,{key:$f.SpanDropRate,label:"Span Drop Rate",noSort:!0,noFilter:!0}),t},Rf=({isLoading:n,pods:o,withSpanDropRate:i})=>{const l=v(),{formatTimeAgo:r}=en(),[s,d]=a(null),p=c(()=>o.map(n=>({onClick:()=>d(n),cells:[{key:$f.PodName,rawValue:n.name},{key:$f.Status,rawValue:n.status,component:()=>{return e=n.status,t(Ke,{status:ca(e),label:e});var e}},{key:$f.Restarts,rawValue:n.restartsCount.toString()},{key:$f.NodeName,rawValue:n.nodeName},{key:$f.SpanDropRate,rawValue:0,component:()=>{const{collectorMetrics:o}=n;if(!o)return t(_e,{children:"-"});const i=(o?.metricsAcceptedRps??0)+(o?.metricsDroppedRps??0),a=i>0?Math.round((o?.metricsDroppedRps??0)/i*100):0,l=a>0?Ee.Error:Ee.Success,r=(o?.exporterSuccessRps??0)+(o?.exporterFailedRps??0),s=r>0?Math.round((o?.exporterFailedRps??0)/r*100):0,c=s>0?Ee.Error:Ee.Success;return e(pe,{$gap:4,children:[t(Fe,{text:`Accepted: ${o.metricsAcceptedRps.toLocaleString()} spans/s\nDropped: ${o.metricsDroppedRps.toLocaleString()} spans/s`,children:t(Ke,{status:l,label:`Receiver ${a}%`,leftIcon:l===Ee.Error?Ll:Fl,useSecondaryTone:!0,invertColors:!0})}),t(Fe,{text:`Success: ${o.exporterSuccessRps.toLocaleString()} spans/s\nFailed: ${o.exporterFailedRps.toLocaleString()} spans/s`,children:t(Ke,{status:c,label:`Exporter ${s}%`,leftIcon:c===Ee.Error?Ll:Fl,useSecondaryTone:!0,invertColors:!0})})]})}},{key:$f.Age,rawValue:r(n.creationTimestamp)},{key:$f.DockerImage,rawValue:n.image}]})),[o,l]);return e(Vt,{fullHeight:!0,bgTint:"1000",moreSpacing:!0,richTitle:{icon:sl,title:"Pods"},children:[t(Pn,{variant:Ln.Data,isLoading:n,columns:Af(i),rows:p}),t(Of,{pod:s,onClose:()=>d(null)})]})},Df=({isOpen:e,onClose:n,title:o,yaml:i})=>t(Mt,{isOpen:e,header:{icon:Ml,title:o,onClose:n},children:t(Or,{yaml:i,defaultOpen:!0})}),_f=e=>{switch(e){case da.Healthy:return"All desired replicas are updated, available, and ready";case da.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case da.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case da.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case da.Down:return"No available replicas";case da.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}};var Pf;(e=>{e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"})(Pf||(Pf={}));const Lf=b.div`
1308
+ animation: ${$f} 15s linear infinite;
1309
+ `,Rf=[el,tl,Fa,Ya],Df=({onRedirectToSampling:n})=>{const o=v();return e(Vi,{children:[e(ut,{fullHeight:!0,customTitle:t(Ef,{}),customSearch:t(bf,{}),filters:t(Mg,{}),children:[t(Af,{children:Rf.map((n,i)=>e(r,{children:[t(n,{size:24}),i<Rf.length-1&&t(La,{fill:o.v2.colors.white[500]+ie["020"],size:24})]},n.name))}),t(sf,{})]}),t(vf,{onRedirectToSampling:n}),t(Of,{})]})};var _f;(e=>{e.Gateway="gateway",e.Node="node"})(_f||(_f={}));const Pf=({onClickDownloadDiagnose:n,onClickRefresh:o,loading:a,disabled:l})=>{const r=i(()=>{const e=[];return n&&e.push({id:bo(),type:gn.Button,buttonProps:{label:"Download Diagnose",leftIcon:El,size:ke.S,variant:Ie.Text,onClick:n,disabled:l}}),o&&e.push({id:bo(),type:gn.Button,buttonProps:{label:"Refresh",leftIcon:pl,size:ke.S,variant:Ie.Text,onClick:o,disabled:l,loading:a}}),e},[n,o,l,a]);return e(oe,{$alignItems:"center",$justifyContent:"space-between",children:[t(ua,{icon:Ml,title:"Collectors Pipeline"}),t(ha,{actions:r})]})},Lf=({pod:n,onClose:o})=>{const{formatTimeAgo:a}=an(),{collectorsApi:l}=Gl(),{data:r}=l.usePodInfo(n?{namespace:n.namespace,name:n.name}:void 0,{skip:!n}),s=i(()=>[{id:bo(),title:"Node",label:r?.node??"-",withCopy:!0},{id:bo(),title:"Status",badge:{status:ma(r?.status),label:r?.status??"-"}}],[r]),c=i(()=>r?.containers?.map(e=>({id:bo(),items:[{id:bo(),title:"Container",label:e.name??"-"},{id:bo(),title:"Status",label:e.startedAt?`${e.status} (since ${a(e.startedAt)})`:e.status},{id:bo(),title:"Ready",badge:{status:e.ready?Pe.Success:Pe.Error,leftIcon:e.ready?Xa:Ua,label:e.ready?"True":"False",invertColors:!0}},{id:bo(),title:"Started",badge:{status:e.started?Pe.Success:Pe.Error,leftIcon:e.started?Xa:Ua,label:e.started?"True":"False",invertColors:!0}},{id:bo(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:bo(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:bo(),title:nt.RESTARTS,label:e.restarts.toString()},{id:bo(),title:"State Reason",label:e.stateReason??"-"},{id:bo(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:bo(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[r]);return t(zt,{isOpen:!!n,header:{icon:hl,title:"Pod Information",onClose:o},children:r?e(Wt,{bgTint:"1000",richTitle:{icon:hl,title:r.name,withCopy:!0},children:[t(Wt,{bgTint:"900",cellsPerRow:2,items:s}),e(Wt,{bgTint:"900",richTitle:{icon:Cl,title:nt.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:[t(mn,{value:`kubectl get pod ${r.name} -n ${r.namespace} -o yaml`}),t(mn,{value:`kubectl describe pod ${r.name} -n ${r.namespace}`}),t(mn,{value:`kubectl logs ${r.name} -n ${r.namespace}`})]}),t(Wt,{bgTint:"900",richTitle:{title:"Containers Overview"},withCollapse:!0,collapseIsDefaultOpen:!0,children:c.length?c.map(({id:e,items:n})=>t(Wt,{bgTint:"800",cellsPerRow:2,items:n},e)):t($e,{title:"No containers",subTitle:"Pod has no containers"})}),t(Rr,{bgTint:"900",yaml:r.manifestYAML,defaultOpen:!0})]}):t(ft,{$height:"50vh",children:t(St,{withSpinner:!0})})})};var Ff;(e=>{e.PodName="podName",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.SpanDropRate="spanDropRate",e.Age="age",e.DockerImage="dockerImage"})(Ff||(Ff={}));const Mf=e=>{const t=[{key:Ff.PodName,label:"Pod Name"},{key:Ff.Status,label:"Status"},{key:Ff.Restarts,label:nt.RESTARTS},{key:Ff.NodeName,label:"Node Name"},{key:Ff.Age,label:"Age"},{key:Ff.DockerImage,label:"Collector Version"}];return e&&t.splice(4,0,{key:Ff.SpanDropRate,label:"Span Drop Rate",noSort:!0,noFilter:!0}),t},zf=({isLoading:n,pods:o,withSpanDropRate:a})=>{const r=v(),{formatTimeAgo:s}=an(),[c,d]=l(null),p=i(()=>o.map(n=>({onClick:()=>d(n),cells:[{key:Ff.PodName,rawValue:n.name},{key:Ff.Status,rawValue:n.status,component:()=>{return e=n.status,t(ce,{status:ma(e),label:e});var e}},{key:Ff.Restarts,rawValue:n.restartsCount.toString()},{key:Ff.NodeName,rawValue:n.nodeName},{key:Ff.SpanDropRate,rawValue:0,component:()=>{const{collectorMetrics:o}=n;if(!o)return t(ee,{children:"-"});const i=(o?.metricsAcceptedRps??0)+(o?.metricsDroppedRps??0),a=i>0?Math.round((o?.metricsDroppedRps??0)/i*100):0,l=a>0?Pe.Error:Pe.Success,r=(o?.exporterSuccessRps??0)+(o?.exporterFailedRps??0),s=r>0?Math.round((o?.exporterFailedRps??0)/r*100):0,c=s>0?Pe.Error:Pe.Success;return e(oe,{$gap:4,children:[t(Ue,{text:`Accepted: ${o.metricsAcceptedRps.toLocaleString()} spans/s\nDropped: ${o.metricsDroppedRps.toLocaleString()} spans/s`,children:t(ce,{status:l,label:`Receiver ${a}%`,leftIcon:l===Pe.Error?zl:Bl,useSecondaryTone:!0,invertColors:!0})}),t(Ue,{text:`Success: ${o.exporterSuccessRps.toLocaleString()} spans/s\nFailed: ${o.exporterFailedRps.toLocaleString()} spans/s`,children:t(ce,{status:c,label:`Exporter ${s}%`,leftIcon:c===Pe.Error?zl:Bl,useSecondaryTone:!0,invertColors:!0})})]})}},{key:Ff.Age,rawValue:s(n.creationTimestamp)},{key:Ff.DockerImage,rawValue:n.image}]})),[o,r]);return e(Wt,{fullHeight:!0,bgTint:"1000",moreSpacing:!0,richTitle:{icon:hl,title:"Pods"},children:[t(Mn,{variant:zn.Data,isLoading:n,columns:Mf(a),rows:p}),t(Lf,{pod:c,onClose:()=>d(null)})]})},Bf=({isOpen:e,onClose:n,title:o,yaml:i})=>t(zt,{isOpen:e,header:{icon:Xl,title:o,onClose:n},children:t(Rr,{yaml:i,defaultOpen:!0})}),Xf=e=>{switch(e){case ga.Healthy:return"All desired replicas are updated, available, and ready";case ga.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case ga.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case ga.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case ga.Down:return"No available replicas";case ga.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}};var Uf;(e=>{e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"})(Uf||(Uf={}));const Vf=b.div`
1311
1310
  flex: 0.5;
1312
1311
  padding: 12px;
1313
1312
  border-radius: 12px;
1314
1313
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
1315
- `,Ff=({selectedTab:n,gatewayInfo:o,nodeCollectorInfo:i,isLoading:l})=>{const{formatTimeAgo:r}=en(),[s,d]=a(null),p=c(()=>(e=>{switch(e){case Nf.Gateway:return"Deployment";case Nf.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(n),[n]),u=c(()=>((e,t,n,o)=>{const i={status:Ee.Disabled,label:"No rollouts yet"};let a=!1,l=null;switch(e){case Nf.Gateway:a=t?.rolloutInProgress??!1,l=t?.lastRolloutAt??null;break;case Nf.Node:a=n?.rolloutInProgress??!1,l=n?.lastRolloutAt??null;break;default:return i}return a?{status:Ee.Info,label:"Rollout in progress",rightIcon:ll,useSecondaryTone:!0}:l?{status:Ee.Disabled,label:`Last Rollout: ${o(l)}`}:i})(n,o,i,r),[o,i,n,r]),h=c(()=>((e,t,n,o)=>{let i=o?Ee.Info:Ee.Unknown,a=o?"Loading":da.Unknown,l=o?"Fetching data...":_f(da.Unknown);switch(e){case Nf.Gateway:i=t?.status?ca(t?.status):i,a=t?.status??a,l=t?.status?_f(t.status):l;break;case Nf.Node:i=n?.status?ca(n?.status):i,a=n?.status??a,l=n?.status?_f(n.status):l}return{status:i,title:a,description:l}})(n,o,i,l),[o,i,n,l]),m=c(()=>((e,t,n)=>{switch(e){case Nf.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 Nf.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=c(()=>((e,t,n,o)=>{switch(e){case Nf.Gateway:return[{title:"Data throughput",cells:[{label:"Traces data",value:Tn(t?.throughputTracesBytesPerSec??0),isLoading:o},{label:"Metrics data",value:Tn(t?.throughputMetricsBytesPerSec??0),isLoading:o},{label:"Logs data",value:Tn(t?.throughputLogsBytesPerSec??0),isLoading:o}]},{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 Nf.Node:return[{title:"Data Throughput",cells:[{label:"Traces data",value:Tn(n?.throughputTracesBytesPerSec??0),isLoading:o},{label:"Metrics data",value:Tn(n?.throughputMetricsBytesPerSec??0),isLoading:o},{label:"Logs data",value:Tn(n?.throughputLogsBytesPerSec??0),isLoading:o}]},{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=c(()=>(n===Nf.Gateway?o?.manifestYAML:i?.manifestYAML)??"",[o,i,n]),b=c(()=>(n===Nf.Gateway?o?.configMapYAML:i?.configMapYAML)??"",[o,i,n]);return e(Vt,{bgTint:"1000",moreSpacing:!0,richTitle:{icon:Ml,title:p,badge:u},actions:[{id:ho(),type:hn.ButtonDropData,buttonProps:{variant:ve.Secondary,size:be.S,label:"View YAML",onClick:e=>d(e)},dropDataProps:{items:[{id:Pf.ManifestYaml,label:p,icon:zl},{id:Pf.ConfigMapYaml,label:"ConfigMap",icon:zl}]}}],children:[e(pe,{$gap:16,children:[t("div",{children:t(pa,{...h})}),m.map(e=>t(Lf,{children:t("div",{children:t(ua,{...e})})},e.title)),g.map(e=>t(ha,{...e},e.title))]}),t(Df,{isOpen:s===Pf.ManifestYaml,onClose:()=>d(null),title:p,yaml:f}),t(Df,{isOpen:s===Pf.ConfigMapYaml,onClose:()=>d(null),title:"ConfigMap",yaml:b})]})},Mf=[{value:Nf.Gateway,label:"Gateway"},{value:Nf.Node,label:"Node Collector"}],zf=({minSupportedVersion:n})=>{const{isVersionSupported:o,version:i,minSupportedVersion:l}=S(n),[r,s]=a(Nf.Gateway),p=r===Nf.Gateway,u=r===Nf.Node,{collectorsApi:h,configApi:m}=Vl(),{data:g}=m.useEffectiveConfig(),{data:f,loading:b,refetch:v}=h.useGatewayInfo({skip:!p}),{data:y=[],loading:C,refetch:x}=h.useGatewayPods({skip:!p}),{data:w,loading:T,refetch:k}=h.useNodeCollectorInfo({skip:!u}),{data:I=[],loading:N,refetch:E}=h.useNodeCollectorPods({skip:!u}),O=p&&(b||C)||u&&(T||N),$=d(()=>{p?(v(),x()):u&&(k(),E())},[p,u,v,x,k,E]),A=c(()=>p?y:I,[y,I,p]);return e(zi,{children:[t(Ef,{disabled:!o,loading:O,onClickDownloadDiagnose:void 0,onClickRefresh:$}),e(ma,{children:[e(ee,{children:[t(ce,{variant:_n.Underline,size:ke.L,options:Mf,selected:r,setSelected:s}),t(Ff,{selectedTab:r,gatewayInfo:f??null,nodeCollectorInfo:w??null,isLoading:O})]}),t(Rf,{isLoading:O,pods:A,withSpanDropRate:!1===g?.odigosOwnTelemetryStore?.metricsStoreDisabled}),!o&&t(Rr,{minSupportedVersion:l,currentVersion:i||""})]})]})},Bf=b.div`
1314
+ `,Hf=({selectedTab:n,gatewayInfo:o,nodeCollectorInfo:a,isLoading:r})=>{const{formatTimeAgo:s}=an(),[c,d]=l(null),p=i(()=>(e=>{switch(e){case _f.Gateway:return"Deployment";case _f.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(n),[n]),u=i(()=>((e,t,n,o)=>{const i={status:Pe.Disabled,label:"No rollouts yet"};let a=!1,l=null;switch(e){case _f.Gateway:a=t?.rolloutInProgress??!1,l=t?.lastRolloutAt??null;break;case _f.Node:a=n?.rolloutInProgress??!1,l=n?.lastRolloutAt??null;break;default:return i}return a?{status:Pe.Info,label:"Rollout in progress",rightIcon:pl,useSecondaryTone:!0}:l?{status:Pe.Disabled,label:`Last Rollout: ${o(l)}`}:i})(n,o,a,s),[o,a,n,s]),h=i(()=>((e,t,n,o)=>{let i=o?Pe.Info:Pe.Unknown,a=o?"Loading":ga.Unknown,l=o?"Fetching data...":Xf(ga.Unknown);switch(e){case _f.Gateway:i=t?.status?ma(t?.status):i,a=t?.status??a,l=t?.status?Xf(t.status):l;break;case _f.Node:i=n?.status?ma(n?.status):i,a=n?.status??a,l=n?.status?Xf(n.status):l}return{status:i,title:a,description:l}})(n,o,a,r),[o,a,n,r]),m=i(()=>((e,t,n)=>{switch(e){case _f.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 _f.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,a),[o,a,n]),g=i(()=>((e,t,n,o)=>{switch(e){case _f.Gateway:return[{title:"Data throughput",cells:[{label:"Traces data",value:In(t?.throughputTracesBytesPerSec??0),isLoading:o},{label:"Metrics data",value:In(t?.throughputMetricsBytesPerSec??0),isLoading:o},{label:"Logs data",value:In(t?.throughputLogsBytesPerSec??0),isLoading:o}]},{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 _f.Node:return[{title:"Data Throughput",cells:[{label:"Traces data",value:In(n?.throughputTracesBytesPerSec??0),isLoading:o},{label:"Metrics data",value:In(n?.throughputMetricsBytesPerSec??0),isLoading:o},{label:"Logs data",value:In(n?.throughputLogsBytesPerSec??0),isLoading:o}]},{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,a,r),[o,a,n,r]),f=i(()=>(n===_f.Gateway?o?.manifestYAML:a?.manifestYAML)??"",[o,a,n]),b=i(()=>(n===_f.Gateway?o?.configMapYAML:a?.configMapYAML)??"",[o,a,n]);return e(Wt,{bgTint:"1000",moreSpacing:!0,richTitle:{icon:Xl,title:p,badge:u},actions:[{id:bo(),type:gn.ButtonDropData,buttonProps:{variant:Ie.Secondary,size:ke.S,label:"View YAML",onClick:e=>d(e)},dropDataProps:{items:[{id:Uf.ManifestYaml,label:p,icon:Ul},{id:Uf.ConfigMapYaml,label:"ConfigMap",icon:Ul}]}}],children:[e(oe,{$gap:16,children:[t("div",{children:t(fa,{...h})}),m.map(e=>t(Vf,{children:t("div",{children:t(ba,{...e})})},e.title)),g.map(e=>t(va,{...e},e.title))]}),t(Bf,{isOpen:c===Uf.ManifestYaml,onClose:()=>d(null),title:p,yaml:f}),t(Bf,{isOpen:c===Uf.ConfigMapYaml,onClose:()=>d(null),title:"ConfigMap",yaml:b})]})},jf=[{value:_f.Gateway,label:"Gateway"},{value:_f.Node,label:"Node Collector"}],Gf=({minSupportedVersion:n})=>{const{isVersionSupported:o,version:a,minSupportedVersion:r}=S(n),[s,c]=l(_f.Gateway),p=s===_f.Gateway,u=s===_f.Node,{collectorsApi:h,configApi:m}=Gl(),{data:g}=m.useEffectiveConfig(),{data:f,loading:b,refetch:v}=h.useGatewayInfo({skip:!p}),{data:y=[],loading:C,refetch:x}=h.useGatewayPods({skip:!p}),{data:w,loading:T,refetch:k}=h.useNodeCollectorInfo({skip:!u}),{data:I=[],loading:N,refetch:E}=h.useNodeCollectorPods({skip:!u}),O=p&&(b||C)||u&&(T||N),$=d(()=>{p?(v(),x()):u&&(k(),E())},[p,u,v,x,k,E]),A=i(()=>p?y:I,[y,I,p]);return e(Vi,{children:[t(Pf,{disabled:!o,loading:O,onClickDownloadDiagnose:void 0,onClickRefresh:$}),e(ya,{children:[e(ae,{children:[t(ve,{variant:Fn.Underline,size:Re.L,options:jf,selected:s,setSelected:c}),t(Hf,{selectedTab:s,gatewayInfo:f??null,nodeCollectorInfo:w??null,isLoading:O})]}),t(zf,{isLoading:O,pods:A,withSpanDropRate:!1===g?.odigosOwnTelemetryStore?.metricsStoreDisabled}),!o&&t(Pr,{minSupportedVersion:r,currentVersion:a||""})]})]})},Wf=b.div`
1316
1315
  display: inline-flex;
1317
1316
  align-items: center;
1318
1317
  min-width: 0;
1319
1318
  overflow: hidden;
1320
1319
  white-space: pre;
1321
1320
  text-overflow: ellipsis;
1322
- `,Xf=b.div`
1321
+ `,Kf=b.div`
1323
1322
  display: flex;
1324
1323
  flex-direction: column;
1325
1324
  gap: 4px;
1326
1325
  min-width: 0;
1327
1326
  flex: 1;
1328
1327
  opacity: ${({$disabled:e})=>e?.4:1};
1329
- `,Uf=b(pe)`
1328
+ `,Yf=b(oe)`
1330
1329
  flex-shrink: 0;
1331
1330
  gap: 6px;
1332
1331
  align-items: center;
1333
1332
  min-height: 22px;
1334
- `,Vf=[{key:"content",label:"Content",noSort:!0,noFilter:!0,flex:1},{key:"badges",label:"Type",noSort:!0,noFilter:!0,flex:"0 0 128px"}],Hf=[{value:"all",label:ga},{value:"Relevance",label:"Relevance"},{value:"Duration",label:"Duration"},{value:"Error",label:"Error"}],jf=({title:n,items:o,isLoading:i,showTypeFilter:l,onRuleClick:r,onCreateRule:s,onEditRule:p,onDeleteRule:u})=>{const h=v(),[m,g]=a(""),[f,b]=a("all"),y=c(()=>{let e=((e,t,n)=>n&&"all"!==t?e.filter(e=>e.typeBadge===t):e)(o,f,l);return e=((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,f,l,m]),C=c(()=>y.map(n=>{const o=n.typeBadge?((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(Xf,{$disabled:n.disabled,children:[t(Bf,{children:t(w,{parts:n.summary})}),n.name&&t(_e,{size:Te.XXS,color:Pe.Secondary,nowrap:!0,children:n.name})]})},{key:"badges",rawValue:n.typeBadge||"",component:()=>e(Uf,{children:[n.disabled&&t(Ke,{label:Mn,textSize:Te.XXXS,backgroundColor:h.v2.colors.grey[700],textColor:h.v2.colors.grey[300]}),n.typeBadge&&o&&t(Ke,{label:n.typeBadge,textSize:Te.XXXS,backgroundColor:o.bg,textColor:o.text})]})}],onClick:()=>r(n)}}),[y,h,r]),S=c(()=>{const e=e=>t(Fa,{...e,fill:h.v2.colors.red[500]});return e.displayName="RedDeleteIcon",e},[h]),x=d(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:Vn,leftIcon:Ma,onClick:()=>p(n.ruleId,n.samplingId)},{id:"delete","data-id":"sampling-rule-action-delete",label:"",leftIcon:S,onClick:()=>u(n.ruleId,n.samplingId)}]:[]},[C,y,p,u,S]);return t(st,{fullHeight:!0,richTitle:{icon:Il,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",...l?{segment:{"data-id":"sampling-segment-type-filter",options:Hf,selected:f,setSelected:b}}:{}},children:t(Pn,{variant:Ln.Pretty,hideHeader:!0,isLoading:i,noDataProps:m.trim()?{hideIcon:!0,title:fa,subTitle:ya(m)}:{hideIcon:!0,title:va,button:{label:ba,onClick:s}},columns:Vf,rows:C,getRowActions:x})})},Gf=({docsUrl:n})=>{const{samplingApi:o,sourcesApi:l}=Vl(),{items:r}=l.useSources(),s=c(()=>r.map(e=>({id:e.id})),[r]),{items:u,loading:h,k8sHealthProbesConfig:m,refetch:g}=o.useSamplingRules(),f=d((e,t)=>o.createNoisy?.({samplingId:e,rule:t}),[o]),b=d((e,t,n)=>o.updateNoisy?.(t,{samplingId:e,rule:n}),[o]),v=d((e,t)=>o.createHighlyRelevant?.({samplingId:e,rule:t}),[o]),y=d((e,t,n)=>o.updateHighlyRelevant?.(t,{samplingId:e,rule:n}),[o]),C=d((e,t)=>o.createCostReduction?.({samplingId:e,rule:t}),[o]),S=d((e,t,n)=>o.updateCostReduction?.(t,{samplingId:e,rule:n}),[o]),x=d((e,t,n)=>"noisy"===n?o.deleteNoisy?.(t,e):"highlyRelevant"===n?o.deleteHighlyRelevant?.(t,e):"costReduction"===n?o.deleteCostReduction?.(t,e):void 0,[o]),w=d((e,t)=>o.updateK8sHealthProbesConfig?.({enabled:e,keepPercentage:t}),[o]),T=c(()=>s.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[s]),k=c(()=>Array.from(new Set(s.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[s]),[I,N]=a(P.Noisy),[E,O]=a(null),[$,D]=a(!1),[_,Q]=a(!1),[te,ne]=a(null),[oe,ie]=a(!1),[ae,le]=a(!1),[re,se]=a(!1),[de,ue]=a(!1);p(!1),i(()=>{},[h,u]);const{pendingViewSamplingRule:he,setPendingViewSamplingRule:me}=fn();i(()=>{if(!he)return;if(h||0===u.length)return;me(null);const e=L(u,he.ruleId,he.category);e&&(N(F[he.category]),D(!1),O(e))},[h,u,he,me]);const ge=c(()=>A(m),[m]),ye=c(()=>M(u),[u]),Ce=c(()=>R(ye?.rule??null),[ye]),Se=c(()=>z(u),[u]),xe=c(()=>B(Se?.rule??null),[Se]),we=p(E);we.current=E,i(()=>{const e=we.current;if(!e)return;const t=X(u,e);t?O(t):(O(null),D(!1))},[u]);const Te=c(()=>{const e=new Set;return ye&&e.add(ye.rule.ruleId),Se&&e.add(Se.rule.ruleId),e},[ye,Se]),Ie=c(()=>U(u,I,Te),[u,I,Te]),Oe=d(()=>Q(!0),[]),$e=d(()=>Q(!1),[]);d(()=>ue(!1),[]);const Ae=d(async e=>{const t=u[0]?.id??"default";switch(K[I]){case"noisy":await f(t,j(e));break;case"highlyRelevant":await v(t,H(e));break;case"costReduction":await C(t,V(e))}Q(!1)},[u,I,f,v,C]),Re=d(e=>{const t=G(u,e);t&&(D(!1),O(t))},[u]),De=d(()=>{O(null),D(!1)},[]),_e=d((e,t)=>{const n=E;if(n&&n.rule.ruleId===e&&n.samplingId===t)D(!0),O({...n});else for(const n of u){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 D(!0),void O({category:o.category,rule:o.rule,samplingId:t,summary:W(o.category,o.rule)})}},[E,u]),Pe=d(async(e,t,n)=>{const o=E?.category;if(o){switch(o){case"noisy":await b(n,t,j(e));break;case"highlyRelevant":await y(n,t,H(e));break;case"costReduction":await S(n,t,V(e))}D(!1)}},[E,b,y,S]),Le=d((e,t)=>{ne({ruleId:e,samplingId:t})},[]),Fe=d(async()=>{if(!te)return;const{ruleId:e,samplingId:t}=te,n=E?.category||K[I];await x(t,e,n),O(null),D(!1),ne(null)},[te,E,I,x]),Me=d(()=>ne(null),[]),ze=d(async(e,t)=>{await w(e,t),ie(!1)},[w]),Be=d(async e=>{const t=u[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)},[u,ye,v,y]),Xe=d(async(e,t)=>{const n=u[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}),se(!1)},[u,Se,C,S]),Ue=d(e=>{const t=K[I];let n=null;switch(t){case"noisy":{const o=j(e);n=Y(u,t,{sourceScopes:o.sourceScopes,operation:o.operation});break}case"highlyRelevant":{const o=H(e);n=Y(u,t,{sourceScopes:o.sourceScopes,operation:o.operation,error:o.error??!1,durationAtLeastMs:o.durationAtLeastMs});break}case"costReduction":{const o=V(e);n=Y(u,t,{sourceScopes:o.sourceScopes,operation:o.operation});break}}return n?{message:Ca,ruleId:n}:null},[u,I]),Ve=d(e=>{const t=E?.category,n=E?.rule.ruleId;if(!t)return null;let o=null;switch(t){case"noisy":{const i=j(e);o=Y(u,t,{sourceScopes:i.sourceScopes,operation:i.operation},n);break}case"highlyRelevant":{const i=H(e);o=Y(u,t,{sourceScopes:i.sourceScopes,operation:i.operation,error:i.error??!1,durationAtLeastMs:i.durationAtLeastMs},n);break}case"costReduction":{const i=V(e);o=Y(u,t,{sourceScopes:i.sourceScopes,operation:i.operation},n);break}}return o?{message:Ca,ruleId:o}:null},[u,E]),He=d(e=>{Q(!1);for(const t of u){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 D(!0),void O({category:n.category,rule:n.rule,samplingId:t.id,summary:W(n.category,n.rule)})}},[u]),je=c(()=>{const e=[];return n&&e.push({id:ho(),type:hn.Button,buttonProps:{"data-id":"sampling-btn-docs",label:Sa,leftIcon:La,size:be.S,variant:ve.Text,onClick:()=>window.open(n,"_blank")}}),e.push({id:ho(),type:hn.Button,buttonProps:{"data-id":"sampling-btn-refresh",label:xa,leftIcon:ll,size:be.S,variant:ve.Text,onClick:g,loading:h}}),e.push({id:ho(),type:hn.Button,buttonProps:{"data-id":"sampling-btn-create-rule",label:wa,rightIcon:Ra,size:be.S,variant:ve.Primary,onClick:Oe}}),e},[n,g,h,Oe]);return e(zi,{children:[e(pe,{$gap:12,$justifyContent:"space-between",children:[t(ra,{icon:Il,title:ka,subTitle:Ta}),t(sa,{actions:je})]}),e(ee,{$gap:12,$fullHeight:!0,children:[t(ce,{variant:_n.Underline,size:ke.L,options:J,selected:I,setSelected:N}),e(pe,{$justifyContent:"space-between",children:[t(Ne,{status:Ee.Default,message:q[I]}),n&&t(fe,{"data-id":"sampling-btn-docs-banner",label:"Docs",leftIcon:La,size:be.S,variant:ve.Text,onClick:()=>window.open(n,"_blank")})]}),I===P.Noisy?t(fr,{title:at,summary:ge,onEdit:()=>ie(!0)}):I===P.HighlyRelevant?t(fr,{title:et,summary:Ce,onEdit:()=>le(!0)}):I===P.CostReduction?t(fr,{title:ot,summary:xe,onEdit:()=>se(!0)}):null,t(jf,{title:Z[I],items:Ie,isLoading:h,showTypeFilter:I===P.HighlyRelevant,onRuleClick:Re,onCreateRule:Oe,onEditRule:_e,onDeleteRule:Le})]}),t(Hh,{formType:Yl.View,data:E,defaultEditMode:$,onClose:De,onDelete:Le,onSaveEdit:Pe,sourceOptions:T,namespaceOptions:k,validateForm:Ve,onNavigateToDuplicate:He}),t(Hh,{formType:Yl.Create,isOpen:_,category:K[I],onClose:$e,onSubmit:Ae,sourceOptions:T,namespaceOptions:k,validateForm:Ue,onNavigateToDuplicate:He}),t(Hh,{formType:Yl.EditAutoNoisy,isOpen:oe,enabled:m?.enabled??!1,keepPercentage:m?.keepPercentage??0,onClose:()=>ie(!1),onSave:ze}),t(Hh,{formType:Yl.EditAutoHighlyRelevant,isOpen:ae,enabled:!!ye&&!ye.rule.disabled,onClose:()=>le(!1),onSave:Be}),t(Hh,{formType:Yl.EditAutoCostReduction,isOpen:re,enabled:!!Se&&!Se.rule.disabled,dropPercentage:Se?.rule.percentageAtMost??25,onClose:()=>se(!1),onSave:Xe}),t(qe,{title:Oa,description:Ea,isOpen:!!te,onClose:Me,denyButton:{label:Na,variant:ve.Secondary,onClick:Me},approveButton:{label:Ia,variant:ve.Primary,onClick:()=>{Fe(),Me()}}}),!1]})},Wf=b.div`
1333
+ `,Jf=[{key:"content",label:"Content",noSort:!0,noFilter:!0,flex:1},{key:"badges",label:"Type",noSort:!0,noFilter:!0,flex:"0 0 128px"}],qf=[{value:"all",label:Ca},{value:"Relevance",label:"Relevance"},{value:"Duration",label:"Duration"},{value:"Error",label:"Error"}],Zf=({title:n,items:o,isLoading:a,showTypeFilter:r,onRuleClick:s,onCreateRule:c,onEditRule:p,onDeleteRule:u})=>{const h=v(),[m,g]=l(""),[f,b]=l("all"),y=i(()=>{let e=((e,t,n)=>n&&"all"!==t?e.filter(e=>e.typeBadge===t):e)(o,f,r);return e=((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,f,r,m]),C=i(()=>y.map(n=>{const o=n.typeBadge?((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(Kf,{$disabled:n.disabled,children:[t(Wf,{children:t(w,{parts:n.summary})}),n.name&&t(ee,{size:te.XXS,color:ne.Secondary,nowrap:!0,children:n.name})]})},{key:"badges",rawValue:n.typeBadge||"",component:()=>e(Yf,{children:[n.disabled&&t(ce,{label:Xn,textSize:te.XXXS,backgroundColor:h.v2.colors.grey[700],textColor:h.v2.colors.grey[300]}),n.typeBadge&&o&&t(ce,{label:n.typeBadge,textSize:te.XXXS,backgroundColor:o.bg,textColor:o.text})]})}],onClick:()=>s(n)}}),[y,h,s]),S=i(()=>{const e=e=>t(Ha,{...e,fill:h.v2.colors.red[500]});return e.displayName="RedDeleteIcon",e},[h]),x=d(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:ja,onClick:()=>p(n.ruleId,n.samplingId)},{id:"delete","data-id":"sampling-rule-action-delete",label:"",leftIcon:S,onClick:()=>u(n.ruleId,n.samplingId)}]:[]},[C,y,p,u,S]);return t(ut,{fullHeight:!0,richTitle:{icon:Ol,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:qf,selected:f,setSelected:b}}:{}},children:t(Mn,{variant:zn.Pretty,hideHeader:!0,isLoading:a,noDataProps:m.trim()?{hideIcon:!0,title:Sa,subTitle:Ta(m)}:{hideIcon:!0,title:wa,button:{label:xa,onClick:c}},columns:Jf,rows:C,getRowActions:x})})},Qf=({docsUrl:n})=>{const{samplingApi:o,sourcesApi:r}=Gl(),{items:s}=r.useSources(),c=i(()=>s.map(e=>({id:e.id})),[s]),{items:u,loading:h,k8sHealthProbesConfig:m,refetch:g}=o.useSamplingRules(),f=d((e,t)=>o.createNoisy?.({samplingId:e,rule:t}),[o]),b=d((e,t,n)=>o.updateNoisy?.(t,{samplingId:e,rule:n}),[o]),v=d((e,t)=>o.createHighlyRelevant?.({samplingId:e,rule:t}),[o]),y=d((e,t,n)=>o.updateHighlyRelevant?.(t,{samplingId:e,rule:n}),[o]),C=d((e,t)=>o.createCostReduction?.({samplingId:e,rule:t}),[o]),S=d((e,t,n)=>o.updateCostReduction?.(t,{samplingId:e,rule:n}),[o]),x=d((e,t,n)=>"noisy"===n?o.deleteNoisy?.(t,e):"highlyRelevant"===n?o.deleteHighlyRelevant?.(t,e):"costReduction"===n?o.deleteCostReduction?.(t,e):void 0,[o]),w=d((e,t)=>o.updateK8sHealthProbesConfig?.({enabled:e,keepPercentage:t}),[o]),T=i(()=>c.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[c]),k=i(()=>Array.from(new Set(c.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[c]),[I,N]=l(P.Noisy),[E,O]=l(null),[$,D]=l(!1),[_,Q]=l(!1),[ee,te]=l(null),[ne,ie]=l(!1),[le,re]=l(!1),[se,ce]=l(!1),[de,pe]=l(!1);p(!1),a(()=>{},[h,u]);const{pendingViewSamplingRule:ue,setPendingViewSamplingRule:he}=vn();a(()=>{if(!ue)return;if(h||0===u.length)return;he(null);const e=L(u,ue.ruleId,ue.category);e&&(N(F[ue.category]),D(!1),O(e))},[h,u,ue,he]);const me=i(()=>A(m),[m]),ge=i(()=>M(u),[u]),fe=i(()=>R(ge?.rule??null),[ge]),be=i(()=>z(u),[u]),ye=i(()=>B(be?.rule??null),[be]),Ce=p(E);Ce.current=E,a(()=>{const e=Ce.current;if(!e)return;const t=X(u,e);t?O(t):(O(null),D(!1))},[u]);const Se=i(()=>{const e=new Set;return ge&&e.add(ge.rule.ruleId),be&&e.add(be.rule.ruleId),e},[ge,be]),xe=i(()=>U(u,I,Se),[u,I,Se]),we=d(()=>Q(!0),[]),Ne=d(()=>Q(!1),[]);d(()=>pe(!1),[]);const Ee=d(async e=>{const t=u[0]?.id??"default";switch(K[I]){case"noisy":await f(t,j(e));break;case"highlyRelevant":await v(t,H(e));break;case"costReduction":await C(t,V(e))}Q(!1)},[u,I,f,v,C]),Oe=d(e=>{const t=G(u,e);t&&(D(!1),O(t))},[u]),$e=d(()=>{O(null),D(!1)},[]),Ae=d((e,t)=>{const n=E;if(n&&n.rule.ruleId===e&&n.samplingId===t)D(!0),O({...n});else for(const n of u){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 D(!0),void O({category:o.category,rule:o.rule,samplingId:t,summary:W(o.category,o.rule)})}},[E,u]),De=d(async(e,t,n)=>{const o=E?.category;if(o){switch(o){case"noisy":await b(n,t,j(e));break;case"highlyRelevant":await y(n,t,H(e));break;case"costReduction":await S(n,t,V(e))}D(!1)}},[E,b,y,S]),Le=d((e,t)=>{te({ruleId:e,samplingId:t})},[]),Fe=d(async()=>{if(!ee)return;const{ruleId:e,samplingId:t}=ee,n=E?.category||K[I];await x(t,e,n),O(null),D(!1),te(null)},[ee,E,I,x]),Me=d(()=>te(null),[]),ze=d(async(e,t)=>{await w(e,t),ie(!1)},[w]),Be=d(async e=>{const t=u[0]?.id??"default",n=ge;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}),re(!1)},[u,ge,v,y]),Xe=d(async(e,t)=>{const n=u[0]?.id??"default",o=be;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}),ce(!1)},[u,be,C,S]),Ue=d(e=>{const t=K[I];let n=null;switch(t){case"noisy":{const o=j(e);n=Y(u,t,{sourceScopes:o.sourceScopes,operation:o.operation});break}case"highlyRelevant":{const o=H(e);n=Y(u,t,{sourceScopes:o.sourceScopes,operation:o.operation,error:o.error??!1,durationAtLeastMs:o.durationAtLeastMs});break}case"costReduction":{const o=V(e);n=Y(u,t,{sourceScopes:o.sourceScopes,operation:o.operation});break}}return n?{message:ka,ruleId:n}:null},[u,I]),Ve=d(e=>{const t=E?.category,n=E?.rule.ruleId;if(!t)return null;let o=null;switch(t){case"noisy":{const i=j(e);o=Y(u,t,{sourceScopes:i.sourceScopes,operation:i.operation},n);break}case"highlyRelevant":{const i=H(e);o=Y(u,t,{sourceScopes:i.sourceScopes,operation:i.operation,error:i.error??!1,durationAtLeastMs:i.durationAtLeastMs},n);break}case"costReduction":{const i=V(e);o=Y(u,t,{sourceScopes:i.sourceScopes,operation:i.operation},n);break}}return o?{message:ka,ruleId:o}:null},[u,E]),He=d(e=>{Q(!1);for(const t of u){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 D(!0),void O({category:n.category,rule:n.rule,samplingId:t.id,summary:W(n.category,n.rule)})}},[u]),je=i(()=>{const e=[];return n&&e.push({id:bo(),type:gn.Button,buttonProps:{"data-id":"sampling-btn-docs",label:Ia,leftIcon:Va,size:ke.S,variant:Ie.Text,onClick:()=>window.open(n,"_blank")}}),e.push({id:bo(),type:gn.Button,buttonProps:{"data-id":"sampling-btn-refresh",label:Na,leftIcon:pl,size:ke.S,variant:Ie.Text,onClick:g,loading:h}}),e.push({id:bo(),type:gn.Button,buttonProps:{"data-id":"sampling-btn-create-rule",label:Ea,rightIcon:za,size:ke.S,variant:Ie.Primary,onClick:we}}),e},[n,g,h,we]);return e(Vi,{children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[t(ua,{icon:Ol,title:$a,subTitle:Oa}),t(ha,{actions:je})]}),e(ae,{$gap:12,$fullHeight:!0,children:[t(ve,{variant:Fn.Underline,size:Re.L,options:J,selected:I,setSelected:N}),e(oe,{$justifyContent:"space-between",children:[t(_e,{status:Pe.Default,message:q[I]}),n&&t(Te,{"data-id":"sampling-btn-docs-banner",label:"Docs",leftIcon:Va,size:ke.S,variant:Ie.Text,onClick:()=>window.open(n,"_blank")})]}),I===P.Noisy?t(yr,{title:ct,summary:me,onEdit:()=>ie(!0)}):I===P.HighlyRelevant?t(yr,{title:it,summary:fe,onEdit:()=>re(!0)}):I===P.CostReduction?t(yr,{title:rt,summary:ye,onEdit:()=>ce(!0)}):null,t(Zf,{title:Z[I],items:xe,isLoading:h,showTypeFilter:I===P.HighlyRelevant,onRuleClick:Oe,onCreateRule:we,onEditRule:Ae,onDeleteRule:Le})]}),t(qh,{formType:Zl.View,data:E,defaultEditMode:$,onClose:$e,onDelete:Le,onSaveEdit:De,sourceOptions:T,namespaceOptions:k,validateForm:Ve,onNavigateToDuplicate:He}),t(qh,{formType:Zl.Create,isOpen:_,category:K[I],onClose:Ne,onSubmit:Ee,sourceOptions:T,namespaceOptions:k,validateForm:Ue,onNavigateToDuplicate:He}),t(qh,{formType:Zl.EditAutoNoisy,isOpen:ne,enabled:m?.enabled??!1,keepPercentage:m?.keepPercentage??0,onClose:()=>ie(!1),onSave:ze}),t(qh,{formType:Zl.EditAutoHighlyRelevant,isOpen:le,enabled:!!ge&&!ge.rule.disabled,onClose:()=>re(!1),onSave:Be}),t(qh,{formType:Zl.EditAutoCostReduction,isOpen:se,enabled:!!be&&!be.rule.disabled,dropPercentage:be?.rule.percentageAtMost??25,onClose:()=>ce(!1),onSave:Xe}),t(tt,{title:_a,description:Da,isOpen:!!ee,onClose:Me,denyButton:{label:Ra,variant:Ie.Secondary,onClick:Me},approveButton:{label:Aa,variant:Ie.Primary,onClick:()=>{Fe(),Me()}}}),!1]})},eb=b.div`
1335
1334
  padding: 12px;
1336
1335
  border-radius: 12px;
1337
1336
  background-color: ${({theme:e})=>e.v2.colors.silver[750]};
1338
- `,Kf=f(({id:e,data:n})=>t(Wf,{"data-id":e,children:t(xe,{...n})}));var Yf,Jf;Kf.displayName=Kf.name,(e=>{e.MapItem="map-item",e.NoData="no-data"})(Yf||(Yf={})),(e=>{e.AnimatedTraffic="animated-traffic"})(Jf||(Jf={}));const qf=(e,t,n)=>{if(n)return{icons:[gl],aggService:e,selected:!0};const o=e.isVirtual,i=o?[vn(e)]:t?yn(t):[Bl],{priorotizedStatus:a}=o?{priorotizedStatus:void 0}:qi(t?.conditions||[]);return{icons:i,status:a,isVirtual:o,aggService:e,selected:!0}},Zf=e=>!(!e||e.serviceName!==Op||e.id.namespace||e.id.name||e.id.kind),Qf=new Yr,eb={"elk.algorithm":"layered","elk.direction":"RIGHT","elk.layered.spacing.nodeNodeBetweenLayers":"150","elk.spacing.nodeNode":"120","elk.layered.nodePlacement.strategy":"NETWORK_SIMPLEX","elk.layered.spacing.edgeEdgeBetweenLayers":"30","elk.layered.spacing.edgeNodeBetweenLayers":"40"},tb=e=>{const t=e.lastIndexOf("|");return-1===t?{graphKey:e,detail:""}:{graphKey:e.substring(0,t),detail:e.substring(t+1)}},nb={id:{namespace:"",name:"",kind:""},serviceName:Op,markedForInstrumentation:{markedForInstrumentation:!0}},ob=h(null),ib=()=>{const e=m(ob);if(!e)throw new Error("useServiceMapContext must be used within a ServiceMapProvider");return e},ab=({serviceMap:e,children:n})=>{const o=v(),{sourcesApi:l}=Vl(),{items:r}=l.useSources(),[s,p,u]=Lr([]),[h,m,g]=Fr([]),[f,b]=a(0),y=d(()=>b(e=>e+1),[]),[C,S]=a(""),[x,w]=a(null),[T,k]=a(null),I=d(e=>k(t=>t===e?null:e),[]),N=d(()=>k(null),[]),E=d((e,t)=>{const n=new Set(e);p(e=>e.map(e=>e.type===Yf.MapItem&&n.has(e.id)?{...e,data:{...e.data,selected:t}}:e))},[p]);i(()=>{let t=!1;const n=(e=>{const t=new Map,n=new Set,o=(e,n,o=!1)=>{let i=t.get(e);return i||(i={serviceName:n,isVirtual:o,attributes:{},connectionMap:new Map},t.set(e,i)),i},i=(e,t)=>{if(t)for(const{key:n,value:o}of t)n in e||(e[n]=o)};for(const t of e){const{graphKey:e}=tb(t.nodeId),a=o(e,t.serviceName);a.isVirtual=!1;for(const e of t.services){const{graphKey:t,detail:l}=tb(e?.nodeId??"");e.isVirtual&&(n.add(t),i(o(t,e.serviceName,!0).attributes,e.nodeAttributes));let r=a.connectionMap.get(t);if(r||(r={targetGraphKey:t,targetServiceName:e.serviceName,totalRequests:0,lastDateTime:e.dateTime,details:[]},a.connectionMap.set(t,r)),r.totalRequests+=e.requests,e.dateTime>r.lastDateTime&&(r.lastDateTime=e.dateTime),l){const t=r.details.find(e=>e.value===l);t?(t.requests+=e.requests,e.dateTime>t.dateTime&&(t.dateTime=e.dateTime)):r.details.push({value:l,requests:e.requests,dateTime:e.dateTime})}}}const a=[...t.entries()];for(const[,{connectionMap:e}]of a)for(const[i,a]of e)t.has(i)||o(i,a.targetServiceName,n.has(i));const l=[];for(const[e,{serviceName:n,isVirtual:o,attributes:i,connectionMap:a}]of t){const t=[...a.values()];t.sort((e,t)=>e.targetGraphKey.localeCompare(t.targetGraphKey)),l.push({graphKey:e,serviceName:n,isVirtual:o,connections:t,attributes:i})}return l.sort((e,t)=>e.graphKey.localeCompare(t.graphKey)),l})(e),i=(({sources:e,aggregatedServiceMap:t})=>{const n=[],o={x:0,y:0};if(t.length&&e.length)for(const i of t){const t=e.find(e=>i.serviceName===e.serviceName||i.serviceName===e.id.name),a=Zf(t);n.push({id:i.graphKey,type:Yf.MapItem,position:o,data:qf(i,t,a),measured:{width:80,height:80}})}else n.push({id:Yf.NoData,type:Yf.NoData,position:o,data:{subTitle:Ze.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return n})({aggregatedServiceMap:n,sources:[nb].concat(r)});if(1===i.length&&i[0].id===Yf.NoData)return p(i),m([]),S(""),void y();const a=(({theme:e,nodes:t,aggregatedServiceMap:n})=>{const o=[],i=new Map(t.map(e=>[e.id,e]));for(const t of n){const n=t.graphKey,a=i.get(n);if(!a)continue;const l=a.data?.status===Ee.Error;for(const a of t.connections){const r=a.targetGraphKey;i.has(r)&&o.push({id:`${n}-to-${r}`,type:"smoothstep",source:n,target:r,data:{sourceGraphKey:t.graphKey,targetGraphKey:a.targetGraphKey},markerEnd:{type:Pr.ArrowClosed},style:{stroke:l?e?.colors.dark_red:e?.colors.border}})}}return o})({theme:o,nodes:i,aggregatedServiceMap:n});m(a);const l=i.map(e=>e.id).sort().join("|");if(l!==C)return(async(e,t,n={})=>{const o={id:"root",layoutOptions:{...eb,...n},children:e.map(e=>({id:e.id,width:80,height:80,...e.id===Op?{layoutOptions:{"elk.layered.layering.layerConstraint":"FIRST","elk.alignment":"CENTER"}}:{}})),edges:t.map(e=>({id:e.id,sources:[e.source],targets:[e.target]}))},i=await Qf.layout(o),a=new Map;return i.children?.forEach(e=>{a.set(e.id,{x:e.x??0,y:e.y??0})}),{nodes:e.map(e=>({...e,position:a.get(e.id)??e.position})),edges:t}})(i,a).then(({nodes:e})=>{t||(p(e),S(l),y())}),()=>{t=!0};p(e=>{const t=new Map(e.map(e=>[e.id,e]));return i.map(e=>{const n=t.get(e.id);return n?e.type===Yf.MapItem&&n.type===Yf.MapItem?{...e,position:n.position,data:{...e.data,selected:n.data.selected}}:{...e,position:n.position}:e})})},[o,e,r,C]);const O=c(()=>x||T?h.map(e=>{if(e.source===x||e.target===x||e.source===T||e.target===T)return{...e,type:Jf.AnimatedTraffic};const t={opacity:.3};return{...e,style:{...e.style,...t},labelStyle:{...e.labelStyle,...t},labelBgStyle:{...e.labelBgStyle,...t}}}):h,[h,x,T]),$=c(()=>({nodes:s,edges:O,onNodesChange:u,onEdgesChange:g,setNodesSelected:E,fitViewTrigger:f,hoveredNodeId:x,setHoveredNodeId:w,activeNodeId:T,toggleActiveNode:I,resetActiveNode:N}),[s,O,u,g,E,f,x,T,I,N]);return t(ob.Provider,{value:$,children:n})},lb=b.div`
1337
+ `,tb=f(({id:e,data:n})=>t(eb,{"data-id":e,children:t($e,{...n})}));var nb,ob;tb.displayName=tb.name,(e=>{e.MapItem="map-item",e.NoData="no-data"})(nb||(nb={})),(e=>{e.AnimatedTraffic="animated-traffic"})(ob||(ob={}));const ib=(e,t,n)=>{if(n)return{icons:[yl],aggService:e,selected:!0};const o=e.isVirtual,i=o?[Cn(e)]:t?Sn(t):[Vl],{priorotizedStatus:a}=o?{priorotizedStatus:void 0}:na(t?.conditions||[]);return{icons:i,status:a,isVirtual:o,aggService:e,selected:!0}},ab=e=>!(!e||e.serviceName!==Lp||e.id.namespace||e.id.name||e.id.kind),lb=new Zr,rb={"elk.algorithm":"layered","elk.direction":"RIGHT","elk.layered.spacing.nodeNodeBetweenLayers":"150","elk.spacing.nodeNode":"120","elk.layered.nodePlacement.strategy":"NETWORK_SIMPLEX","elk.layered.spacing.edgeEdgeBetweenLayers":"30","elk.layered.spacing.edgeNodeBetweenLayers":"40"},sb=e=>{const t=e.lastIndexOf("|");return-1===t?{graphKey:e,detail:""}:{graphKey:e.substring(0,t),detail:e.substring(t+1)}},cb={id:{namespace:"",name:"",kind:""},serviceName:Lp,markedForInstrumentation:{markedForInstrumentation:!0}},db=h(null),pb=()=>{const e=m(db);if(!e)throw new Error("useServiceMapContext must be used within a ServiceMapProvider");return e},ub=({serviceMap:e,children:n})=>{const o=v(),{sourcesApi:r}=Gl(),{items:s}=r.useSources(),[c,p,u]=zr([]),[h,m,g]=Br([]),[f,b]=l(0),y=d(()=>b(e=>e+1),[]),[C,S]=l(""),[x,w]=l(null),[T,k]=l(null),I=d(e=>k(t=>t===e?null:e),[]),N=d(()=>k(null),[]),E=d((e,t)=>{const n=new Set(e);p(e=>e.map(e=>e.type===nb.MapItem&&n.has(e.id)?{...e,data:{...e.data,selected:t}}:e))},[p]);a(()=>{let t=!1;const n=(e=>{const t=new Map,n=new Set,o=(e,n,o=!1)=>{let i=t.get(e);return i||(i={serviceName:n,isVirtual:o,attributes:{},connectionMap:new Map},t.set(e,i)),i},i=(e,t)=>{if(t)for(const{key:n,value:o}of t)n in e||(e[n]=o)};for(const t of e){const{graphKey:e}=sb(t.nodeId),a=o(e,t.serviceName);a.isVirtual=!1;for(const e of t.services){const{graphKey:t,detail:l}=sb(e?.nodeId??"");e.isVirtual&&(n.add(t),i(o(t,e.serviceName,!0).attributes,e.nodeAttributes));let r=a.connectionMap.get(t);if(r||(r={targetGraphKey:t,targetServiceName:e.serviceName,totalRequests:0,lastDateTime:e.dateTime,details:[]},a.connectionMap.set(t,r)),r.totalRequests+=e.requests,e.dateTime>r.lastDateTime&&(r.lastDateTime=e.dateTime),l){const t=r.details.find(e=>e.value===l);t?(t.requests+=e.requests,e.dateTime>t.dateTime&&(t.dateTime=e.dateTime)):r.details.push({value:l,requests:e.requests,dateTime:e.dateTime})}}}const a=[...t.entries()];for(const[,{connectionMap:e}]of a)for(const[i,a]of e)t.has(i)||o(i,a.targetServiceName,n.has(i));const l=[];for(const[e,{serviceName:n,isVirtual:o,attributes:i,connectionMap:a}]of t){const t=[...a.values()];t.sort((e,t)=>e.targetGraphKey.localeCompare(t.targetGraphKey)),l.push({graphKey:e,serviceName:n,isVirtual:o,connections:t,attributes:i})}return l.sort((e,t)=>e.graphKey.localeCompare(t.graphKey)),l})(e),i=(({sources:e,aggregatedServiceMap:t})=>{const n=[],o={x:0,y:0};if(t.length&&e.length)for(const i of t){const t=e.find(e=>i.serviceName===e.serviceName||i.serviceName===e.id.name),a=ab(t);n.push({id:i.graphKey,type:nb.MapItem,position:o,data:ib(i,t,a),measured:{width:80,height:80}})}else n.push({id:nb.NoData,type:nb.NoData,position:o,data:{subTitle:nt.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return n})({aggregatedServiceMap:n,sources:[cb].concat(s)});if(1===i.length&&i[0].id===nb.NoData)return p(i),m([]),S(""),void y();const a=(({theme:e,nodes:t,aggregatedServiceMap:n})=>{const o=[],i=new Map(t.map(e=>[e.id,e]));for(const t of n){const n=t.graphKey,a=i.get(n);if(!a)continue;const l=a.data?.status===Pe.Error;for(const a of t.connections){const r=a.targetGraphKey;i.has(r)&&o.push({id:`${n}-to-${r}`,type:"smoothstep",source:n,target:r,data:{sourceGraphKey:t.graphKey,targetGraphKey:a.targetGraphKey},markerEnd:{type:Mr.ArrowClosed},style:{stroke:l?e?.colors.dark_red:e?.colors.border}})}}return o})({theme:o,nodes:i,aggregatedServiceMap:n});m(a);const l=i.map(e=>e.id).sort().join("|");if(l!==C)return(async(e,t,n={})=>{const o={id:"root",layoutOptions:{...rb,...n},children:e.map(e=>({id:e.id,width:80,height:80,...e.id===Lp?{layoutOptions:{"elk.layered.layering.layerConstraint":"FIRST","elk.alignment":"CENTER"}}:{}})),edges:t.map(e=>({id:e.id,sources:[e.source],targets:[e.target]}))},i=await lb.layout(o),a=new Map;return i.children?.forEach(e=>{a.set(e.id,{x:e.x??0,y:e.y??0})}),{nodes:e.map(e=>({...e,position:a.get(e.id)??e.position})),edges:t}})(i,a).then(({nodes:e})=>{t||(p(e),S(l),y())}),()=>{t=!0};p(e=>{const t=new Map(e.map(e=>[e.id,e]));return i.map(e=>{const n=t.get(e.id);return n?e.type===nb.MapItem&&n.type===nb.MapItem?{...e,position:n.position,data:{...e.data,selected:n.data.selected}}:{...e,position:n.position}:e})})},[o,e,s,C]);const O=i(()=>x||T?h.map(e=>{if(e.source===x||e.target===x||e.source===T||e.target===T)return{...e,type:ob.AnimatedTraffic};const t={opacity:.3};return{...e,style:{...e.style,...t},labelStyle:{...e.labelStyle,...t},labelBgStyle:{...e.labelBgStyle,...t}}}):h,[h,x,T]),$=i(()=>({nodes:c,edges:O,onNodesChange:u,onEdgesChange:g,setNodesSelected:E,fitViewTrigger:f,hoveredNodeId:x,setHoveredNodeId:w,activeNodeId:T,toggleActiveNode:I,resetActiveNode:N}),[c,O,u,g,E,f,x,T,I,N]);return t(db.Provider,{value:$,children:n})},hb=b.div`
1339
1338
  border: 1px ${({theme:e,$isSelected:t,$isVirtual:n})=>t?`solid ${e.v2.colors.blue[300]}`:n?`dashed ${e.v2.colors.silver[300]}`:"solid transparent"};
1340
1339
  border-radius: 8px;
1341
1340
  cursor: pointer;
1342
1341
  opacity: ${({$isVirtual:e})=>e?.8:1};
1343
- `,rb=b.div`
1342
+ `,mb=b.div`
1344
1343
  position: relative;
1345
- `,sb=b.div`
1344
+ `,gb=b.div`
1346
1345
  position: absolute;
1347
1346
  top: 100%;
1348
1347
  left: 50%;
@@ -1351,7 +1350,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
1351
1350
  align-items: center;
1352
1351
  gap: 4px;
1353
1352
  margin-top: 4px;
1354
- `,cb=f(({id:o,data:i})=>{const{icons:a,status:l,isVirtual:r}=i,s=v(),{activeNodeId:d,hoveredNodeId:p}=ib(),{isUserSource:u,isNodeSelected:h,isHovered:m}=c(()=>({isUserSource:o===Op,isNodeSelected:d===o,isHovered:p===o}),[o,d,p,o]),{isSelected:g,isHighlighted:f}=c(()=>({isSelected:h||u,isHighlighted:h||m||u}),[h,m,u]),b=l?Nn(l,s):null;return e(n,{children:[t(Mr,{type:"source",position:zr.Right,style:{visibility:"hidden"}}),t(Mr,{type:"target",position:zr.Left,style:{visibility:"hidden"}}),e(rb,{"data-id":o,children:[t(lb,{$isSelected:g,$isVirtual:r,children:t(Cn,{padding:12,icons:a,status:f?Ee.Info:l})}),e(sb,{children:[b&&t(b,{}),t(_e,{size:Te.XXS,nowrap:!0,children:o})]})]})]})});cb.displayName=cb.name;const db=b.div`
1353
+ `,fb=f(({id:o,data:a})=>{const{icons:l,status:r,isVirtual:s}=a,c=v(),{activeNodeId:d,hoveredNodeId:p}=pb(),{isUserSource:u,isNodeSelected:h,isHovered:m}=i(()=>({isUserSource:o===Lp,isNodeSelected:d===o,isHovered:p===o}),[o,d,p,o]),{isSelected:g,isHighlighted:f}=i(()=>({isSelected:h||u,isHighlighted:h||m||u}),[h,m,u]),b=r?Pn(r,c):null;return e(n,{children:[t(Xr,{type:"source",position:Ur.Right,style:{visibility:"hidden"}}),t(Xr,{type:"target",position:Ur.Left,style:{visibility:"hidden"}}),e(mb,{"data-id":o,children:[t(hb,{$isSelected:g,$isVirtual:s,children:t(xn,{padding:12,icons:l,status:f?Pe.Info:r})}),e(gb,{children:[b&&t(b,{}),t(ee,{size:te.XXS,nowrap:!0,children:o})]})]})]})});fb.displayName=fb.name;const bb=b.div`
1355
1354
  display: flex;
1356
1355
  flex-direction: column;
1357
1356
  gap: 12px;
@@ -1364,10 +1363,10 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
1364
1363
  top: 16px;
1365
1364
  left: 8px;
1366
1365
  z-index: ${({theme:e})=>e.v2.zIndex.drawer};
1367
- `,pb=({children:e})=>t(db,{children:e});var ub,hb;(e=>{e.All="All",e.Inbound="Inbound",e.Outbound="Outbound"})(ub||(ub={})),(e=>{e.Inbound="Inbound",e.Outbound="Outbound"})(hb||(hb={}));const mb=b.div`
1366
+ `,vb=({children:e})=>t(bb,{children:e});var yb,Cb;(e=>{e.All="All",e.Inbound="Inbound",e.Outbound="Outbound"})(yb||(yb={})),(e=>{e.Inbound="Inbound",e.Outbound="Outbound"})(Cb||(Cb={}));const Sb=b.div`
1368
1367
  flex: 1 1 auto;
1369
1368
  min-height: 0;
1370
- `,gb=()=>{const{nodes:n,activeNodeId:o,resetActiveNode:i}=ib(),[l,r]=a(ub.All),s=c(()=>{const e=new Map;for(const t of n)t.type===Yf.MapItem&&e.set(t.id,t);return e},[n]),d=c(()=>s.get(o??""),[s,o]),{inbound:p,outbound:u}=c(()=>{const e=[],t=[];if(!d)return{inbound:e,outbound:t};for(const e of d.data.aggService?.connections??[])t.push({peerId:e.targetGraphKey,direction:hb.Outbound,totalRequests:e.totalRequests});for(const t of s.values())if(t.id!==d.id)for(const n of t.data.aggService?.connections??[])n.targetGraphKey===d.id&&e.push({peerId:t.id,direction:hb.Inbound,totalRequests:n.totalRequests});return e.sort((e,t)=>e.peerId.localeCompare(t.peerId)),t.sort((e,t)=>e.peerId.localeCompare(t.peerId)),{inbound:e,outbound:t}},[d,s]);if(!d)return null;const h=[ub.All,ub.Inbound].includes(l)&&p.length>0,m=[ub.All,ub.Outbound].includes(l)&&u.length>0;return e(pb,{children:[e(pe,{$width:"100%",$gap:8,children:[t(fe,{variant:ve.Text,size:be.S,leftIcon:il,onClick:i}),t(Cn,{icons:d.data.icons}),t(_e,{size:Te.XS,children:d.id})]}),t(ce,{fullWidth:!0,options:[{label:`${ub.All}`,value:ub.All,badge:{label:`${p.length+u.length}`}},{label:`${ub.Inbound}`,value:ub.Inbound,badge:{label:`${p.length}`}},{label:`${ub.Outbound}`,value:ub.Outbound,badge:{label:`${u.length}`}}],selected:l,setSelected:r}),h&&t(bb,{halfHeight:m,title:"Inbound",icon:hl,connections:p,mapNodesById:s}),m&&t(bb,{halfHeight:h,title:"Outbound",icon:ml,connections:u,mapNodesById:s})]})},fb=b.div`
1369
+ `,xb=()=>{const{nodes:n,activeNodeId:o,resetActiveNode:a}=pb(),[r,s]=l(yb.All),c=i(()=>{const e=new Map;for(const t of n)t.type===nb.MapItem&&e.set(t.id,t);return e},[n]),d=i(()=>c.get(o??""),[c,o]),{inbound:p,outbound:u}=i(()=>{const e=[],t=[];if(!d)return{inbound:e,outbound:t};for(const e of d.data.aggService?.connections??[])t.push({peerId:e.targetGraphKey,direction:Cb.Outbound,totalRequests:e.totalRequests});for(const t of c.values())if(t.id!==d.id)for(const n of t.data.aggService?.connections??[])n.targetGraphKey===d.id&&e.push({peerId:t.id,direction:Cb.Inbound,totalRequests:n.totalRequests});return e.sort((e,t)=>e.peerId.localeCompare(t.peerId)),t.sort((e,t)=>e.peerId.localeCompare(t.peerId)),{inbound:e,outbound:t}},[d,c]);if(!d)return null;const h=[yb.All,yb.Inbound].includes(r)&&p.length>0,m=[yb.All,yb.Outbound].includes(r)&&u.length>0;return e(vb,{children:[e(oe,{$width:"100%",$gap:8,children:[t(Te,{variant:Ie.Text,size:ke.S,leftIcon:cl,onClick:a}),t(xn,{icons:d.data.icons}),t(ee,{size:te.XS,children:d.id})]}),t(ve,{fullWidth:!0,options:[{label:`${yb.All}`,value:yb.All,badge:{label:`${p.length+u.length}`}},{label:`${yb.Inbound}`,value:yb.Inbound,badge:{label:`${p.length}`}},{label:`${yb.Outbound}`,value:yb.Outbound,badge:{label:`${u.length}`}}],selected:r,setSelected:s}),h&&t(Tb,{halfHeight:m,title:"Inbound",icon:bl,connections:p,mapNodesById:c}),m&&t(Tb,{halfHeight:h,title:"Outbound",icon:vl,connections:u,mapNodesById:c})]})},wb=b.div`
1371
1370
  display: flex;
1372
1371
  flex-direction: column;
1373
1372
  gap: 8px;
@@ -1375,17 +1374,17 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
1375
1374
  border-radius: 12px;
1376
1375
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
1377
1376
  height: ${({$halfHeight:e})=>e?"48%":"100%"};
1378
- `,bb=({halfHeight:n,title:o,icon:i,connections:a,mapNodesById:l})=>{const r=v();return e(fb,{$halfHeight:n,children:[e(pe,{children:[t(i,{size:16,fill:r.v2.colors.grey[300]}),t(_e,{size:Te.XXS,color:Pe.Secondary,children:o})]}),t(mb,{children:t(gn,{gap:4,elements:a.map(e=>t(yb,{connection:e,peerNode:l.get(e.peerId)},`${e.direction}-${e.peerId}`))})})]})},vb=b.div`
1377
+ `,Tb=({halfHeight:n,title:o,icon:i,connections:a,mapNodesById:l})=>{const r=v();return e(wb,{$halfHeight:n,children:[e(oe,{children:[t(i,{size:16,fill:r.v2.colors.grey[300]}),t(ee,{size:te.XXS,color:ne.Secondary,children:o})]}),t(Sb,{children:t(bn,{gap:4,elements:a.map(e=>t(Ib,{connection:e,peerNode:l.get(e.peerId)},`${e.direction}-${e.peerId}`))})})]})},kb=b.div`
1379
1378
  display: flex;
1380
1379
  align-items: center;
1381
1380
  gap: 8px;
1382
1381
  padding: 8px;
1383
1382
  border-radius: 8px;
1384
1383
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
1385
- `,yb=({connection:n,peerNode:o})=>e(vb,{children:[o&&t(Cn,{icons:o.data.icons}),e(pe,{$gap:4,$width:"100%",$justifyContent:"space-between",children:[t(_e,{size:Te.XXS,children:n.peerId}),t(Ke,{label:n.totalRequests,tooltip:"Total requests"})]})]}),Cb="0;0.5;1",Sb=f(({id:o,sourceX:i,sourceY:a,targetX:l,targetY:r,sourcePosition:s,targetPosition:c,markerEnd:d})=>{const p=v(),[u]=Br({sourceX:i,sourceY:a,targetX:l,targetY:r,sourcePosition:s,targetPosition:c}),h=`${o}__animated-traffic-motion`,m=p.v2.colors.blue[700],g=p.v2.colors.blue[900],f=p.v2.colors.blue[500],b="4s";return e(n,{children:[t(Xr,{id:o,path:u,markerEnd:d,style:{stroke:m,strokeWidth:1}}),t(Ur,{children:e("svg",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"visible",pointerEvents:"none"},children:[t("path",{id:h,d:u,fill:"none",stroke:"none"}),Array.from({length:5}).map((n,o)=>{const i=`-${(.8*o).toFixed(3)}s`;return e("circle",{r:0,fill:g,children:[t("animateMotion",{dur:b,begin:i,repeatCount:"indefinite",children:t("mpath",{href:`#${h}`})}),t("animate",{attributeName:"r",dur:b,begin:i,repeatCount:"indefinite",keyTimes:Cb,values:"0;3.5;3.5"}),t("animate",{attributeName:"fill",dur:b,begin:i,repeatCount:"indefinite",keyTimes:Cb,values:`${g};${f};${f}`})]},o)})]})})]})});Sb.displayName=Sb.name;const xb=b.div`
1384
+ `,Ib=({connection:n,peerNode:o})=>e(kb,{children:[o&&t(xn,{icons:o.data.icons}),e(oe,{$gap:4,$width:"100%",$justifyContent:"space-between",children:[t(ee,{size:te.XXS,children:n.peerId}),t(ce,{label:n.totalRequests,tooltip:"Total requests"})]})]}),Nb="0;0.5;1",Eb=f(({id:o,sourceX:i,sourceY:a,targetX:l,targetY:r,sourcePosition:s,targetPosition:c,markerEnd:d})=>{const p=v(),[u]=Vr({sourceX:i,sourceY:a,targetX:l,targetY:r,sourcePosition:s,targetPosition:c}),h=`${o}__animated-traffic-motion`,m=p.v2.colors.blue[700],g=p.v2.colors.blue[900],f=p.v2.colors.blue[500],b="4s";return e(n,{children:[t(Hr,{id:o,path:u,markerEnd:d,style:{stroke:m,strokeWidth:1}}),t(jr,{children:e("svg",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"visible",pointerEvents:"none"},children:[t("path",{id:h,d:u,fill:"none",stroke:"none"}),Array.from({length:5}).map((n,o)=>{const i=`-${(.8*o).toFixed(3)}s`;return e("circle",{r:0,fill:g,children:[t("animateMotion",{dur:b,begin:i,repeatCount:"indefinite",children:t("mpath",{href:`#${h}`})}),t("animate",{attributeName:"r",dur:b,begin:i,repeatCount:"indefinite",keyTimes:Nb,values:"0;3.5;3.5"}),t("animate",{attributeName:"fill",dur:b,begin:i,repeatCount:"indefinite",keyTimes:Nb,values:`${g};${f};${f}`})]},o)})]})})]})});Eb.displayName=Eb.name;const Ob=b.div`
1386
1385
  flex: 1 1 auto;
1387
1386
  min-height: 0;
1388
- `,wb=({})=>{const{nodes:n,setNodesSelected:o,resetActiveNode:i}=ib(),[l,r]=a(""),s=c(()=>n.filter(e=>e.type===Yf.MapItem).sort((e,t)=>e.id.localeCompare(t.id)),[n]),p=c(()=>s.filter(e=>e.data.selected),[s]),u=c(()=>s.filter(e=>e.id.toLowerCase().includes(l.toLowerCase())),[s,l]),h=c(()=>u.every(e=>e.data.selected),[u]),m=d(()=>{const e=!h;o(u.map(e=>e.id),e),e||i()},[u,h,o,i]);return s.length?e(pb,{children:[e(pe,{$width:"100%",$gap:8,children:[t(_e,{size:Te.XS,children:"Services"}),t(Ke,{label:s.length})]}),t(mn,{width:"100%",value:l,onChange:r}),e(pe,{$width:"100%",$justifyContent:"space-between",children:[t(_e,{size:Te.XXXS,children:`Showing ${p.length} out of ${s.length}`}),t(_e,{"data-id":"namespaces-select-all",onClick:m,disabled:!u.length,size:Te.XS,children:h?Ze.UNSELECT_ALL:Ze.SELECT_ALL})]}),t(xb,{children:t(gn,{gap:4,elements:u.map(e=>t(kb,{node:e},e.id))})})]}):null},Tb=b.div`
1387
+ `,$b=({})=>{const{nodes:n,setNodesSelected:o,resetActiveNode:a}=pb(),[r,s]=l(""),c=i(()=>n.filter(e=>e.type===nb.MapItem).sort((e,t)=>e.id.localeCompare(t.id)),[n]),p=i(()=>c.filter(e=>e.data.selected),[c]),u=i(()=>c.filter(e=>e.id.toLowerCase().includes(r.toLowerCase())),[c,r]),h=i(()=>u.every(e=>e.data.selected),[u]),m=d(()=>{const e=!h;o(u.map(e=>e.id),e),e||a()},[u,h,o,a]);return c.length?e(vb,{children:[e(oe,{$width:"100%",$gap:8,children:[t(ee,{size:te.XS,children:"Services"}),t(ce,{label:c.length})]}),t(fn,{width:"100%",value:r,onChange:s}),e(oe,{$width:"100%",$justifyContent:"space-between",children:[t(ee,{size:te.XXXS,children:`Showing ${p.length} out of ${c.length}`}),t(ee,{"data-id":"namespaces-select-all",onClick:m,disabled:!u.length,size:te.XS,children:h?nt.UNSELECT_ALL:nt.SELECT_ALL})]}),t(Ob,{children:t(bn,{gap:4,elements:u.map(e=>t(Rb,{node:e},e.id))})})]}):null},Ab=b.div`
1389
1388
  display: flex;
1390
1389
  align-items: center;
1391
1390
  gap: 8px;
@@ -1393,7 +1392,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
1393
1392
  border-radius: 8px;
1394
1393
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
1395
1394
  cursor: pointer;
1396
- `,kb=({node:n})=>{const{setNodesSelected:o,activeNodeId:i,resetActiveNode:a}=ib(),l=d(()=>{const e=!n.data.selected,t=i===n.id;o([n.id],e),!e&&t&&a()},[n,i,o,a]);return e(Tb,{onClick:l,children:[t(ne,{value:n.data.selected||!1,onChange:l}),t(Cn,{icons:n.data.icons}),t(_e,{size:Te.XXS,children:n.id})]},n.id)},Ib=b.div`
1395
+ `,Rb=({node:n})=>{const{setNodesSelected:o,activeNodeId:i,resetActiveNode:a}=pb(),l=d(()=>{const e=!n.data.selected,t=i===n.id;o([n.id],e),!e&&t&&a()},[n,i,o,a]);return e(Ab,{onClick:l,children:[t(Q,{value:n.data.selected||!1,onChange:l}),t(xn,{icons:n.data.icons}),t(ee,{size:te.XXS,children:n.id})]},n.id)},Db=b.div`
1397
1396
  position: relative;
1398
1397
  height: 100%;
1399
1398
  .react-flow__attribution {
@@ -1402,7 +1401,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
1402
1401
  * {
1403
1402
  transition: none;
1404
1403
  }
1405
- `,Nb=b.div`
1404
+ `,_b=b.div`
1406
1405
  .react-flow__controls {
1407
1406
  display: flex;
1408
1407
  align-items: center;
@@ -1428,33 +1427,33 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
1428
1427
  }
1429
1428
  }
1430
1429
  }
1431
- `,Eb={[Yf.MapItem]:cb,[Yf.NoData]:Kf},Ob={[Jf.AnimatedTraffic]:Sb},$b={duration:300,padding:.1,includeHiddenNodes:!0,maxZoom:1},Ab=({trigger:e})=>{const{fitView:t}=Kr(),n=p(!0);return i(()=>{n.current?n.current=!1:e>0&&requestAnimationFrame(()=>t($b))},[e,t]),null},Rb=({onRefresh:n})=>{const{nodes:o,edges:i,fitViewTrigger:a,onNodesChange:l,onEdgesChange:r,setHoveredNodeId:s,toggleActiveNode:d}=ib(),p=c(()=>{const e=new Set(o.filter(e=>e.type===Yf.MapItem&&e.data.selected).map(e=>e.id)),t=new Set;for(const n of i)e.has(n.source)&&t.add(n.target),e.has(n.target)&&t.add(n.source);return o.filter(e=>e.type!==Yf.MapItem||e.data.selected||t.has(e.id))},[o,i]);return e(Hr,{zoomOnScroll:!0,nodes:p,nodeTypes:Eb,edges:i,edgeTypes:Ob,onNodeClick:(e,t)=>d(t.id),onNodeMouseEnter:(e,t)=>s(t.id),onNodeMouseLeave:()=>s(null),onNodesChange:l,onEdgesChange:r,children:[t(jr,{}),t(Ab,{trigger:a}),t(Nb,{children:t(Gr,{position:"top-right",orientation:"horizontal",showInteractive:!1,showZoom:!0,showFitView:!0,fitViewOptions:$b,children:t(Wr,{onClick:n,children:t(ll,{})})})})]})},Db=n=>t(Vr,{children:e(Ib,{children:[t(Rb,{...n}),t(wb,{}),t(gb,{})]})}),_b=b.div`
1430
+ `,Pb={[nb.MapItem]:fb,[nb.NoData]:tb},Lb={[ob.AnimatedTraffic]:Eb},Fb={duration:300,padding:.1,includeHiddenNodes:!0,maxZoom:1},Mb=({trigger:e})=>{const{fitView:t}=qr(),n=p(!0);return a(()=>{n.current?n.current=!1:e>0&&requestAnimationFrame(()=>t(Fb))},[e,t]),null},zb=({onRefresh:n})=>{const{nodes:o,edges:a,fitViewTrigger:l,onNodesChange:r,onEdgesChange:s,setHoveredNodeId:c,toggleActiveNode:d}=pb(),p=i(()=>{const e=new Set(o.filter(e=>e.type===nb.MapItem&&e.data.selected).map(e=>e.id)),t=new Set;for(const n of a)e.has(n.source)&&t.add(n.target),e.has(n.target)&&t.add(n.source);return o.filter(e=>e.type!==nb.MapItem||e.data.selected||t.has(e.id))},[o,a]);return e(Wr,{zoomOnScroll:!0,nodes:p,nodeTypes:Pb,edges:a,edgeTypes:Lb,onNodeClick:(e,t)=>d(t.id),onNodeMouseEnter:(e,t)=>c(t.id),onNodeMouseLeave:()=>c(null),onNodesChange:r,onEdgesChange:s,children:[t(Kr,{}),t(Mb,{trigger:l}),t(_b,{children:t(Yr,{position:"top-right",orientation:"horizontal",showInteractive:!1,showZoom:!0,showFitView:!0,fitViewOptions:Fb,children:t(Jr,{onClick:n,children:t(pl,{})})})})]})},Bb=n=>t(Gr,{children:e(Db,{children:[t(zb,{...n}),t($b,{}),t(xb,{})]})}),Xb=b.div`
1432
1431
  width: 100%;
1433
1432
  flex: 1;
1434
1433
  align-self: stretch;
1435
1434
  min-height: 0;
1436
1435
  height: 100%;
1437
1436
  position: relative;
1438
- `,Pb=()=>{const{serviceMapApi:e}=Vl(),{data:n,refetch:o}=e.useServiceMap({pollInterval:5e3,fetchPolicy:"cache-and-network"});return t(ab,{serviceMap:n?.serviceMap??[],children:t(_b,{children:t(Db,{onRefresh:o})})})},Lb=b.div`
1437
+ `,Ub=()=>{const{serviceMapApi:e}=Gl(),{data:n,refetch:o}=e.useServiceMap({pollInterval:5e3,fetchPolicy:"cache-and-network"});return t(ub,{serviceMap:n?.serviceMap??[],children:t(Xb,{children:t(Bb,{onRefresh:o})})})},Vb=b.div`
1439
1438
  display: flex;
1440
1439
  align-items: center;
1441
1440
  justify-content: space-between;
1442
1441
  padding: 0 12px;
1443
- `,Fb=b.div`
1442
+ `,Hb=b.div`
1444
1443
  display: flex;
1445
1444
  align-items: center;
1446
1445
  gap: 8px;
1447
- `,Mb=b.div`
1446
+ `,jb=b.div`
1448
1447
  width: 1px;
1449
1448
  height: 20px;
1450
1449
  background-color: ${({theme:e})=>e.v2.colors.silver[500]};
1451
- `,zb=({disabled:n,loading:o,onClickShowYaml:i,onClickReset:l,onClickRefresh:r})=>{const s=v(),[d,p]=a(!1),u=c(()=>i?[{id:ho(),type:hn.Button,buttonProps:{label:"Show Config YAML",leftIcon:zl,size:be.S,variant:ve.Secondary,onClick:i,disabled:n}}]:[],[i,n]),h=c(()=>{const e=[];return r&&e.push({id:ho(),type:hn.Button,buttonProps:{leftIcon:ll,tooltip:"Refresh",hideTooltipIcon:!0,size:be.S,variant:ve.Text,onClick:r,disabled:n,loading:o}}),l&&e.push({id:ho(),type:hn.Button,buttonProps:{leftIcon:Aa,tooltip:"Reset to defaults",hideTooltipIcon:!0,size:be.S,variant:ve.Text,textColor:s.v2.colors.red[500],onClick:()=>p(!0),disabled:n}}),e},[n,o,l,r,s]),m=u.length>0,g=h.length>0;return e(Lb,{children:[t(ra,{icon:rl,title:"Odigos Settings"}),e(Fb,{children:[m&&t(sa,{actions:u}),m&&g&&t(Mb,{}),g&&t(sa,{actions:h})]}),t(qe,{isOpen:d,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:ve.Secondary,onClick:()=>p(!1)},approveButton:{label:"Approve",variant:ve.Primary,onClick:()=>{l?.(),p(!1)}}})]})},Bb=b(ee)`
1450
+ `,Gb=({disabled:n,loading:o,onClickShowYaml:a,onClickReset:r,onClickRefresh:s})=>{const c=v(),[d,p]=l(!1),u=i(()=>a?[{id:bo(),type:gn.Button,buttonProps:{label:"Show Config YAML",leftIcon:Ul,size:ke.S,variant:Ie.Secondary,onClick:a,disabled:n}}]:[],[a,n]),h=i(()=>{const e=[];return s&&e.push({id:bo(),type:gn.Button,buttonProps:{leftIcon:pl,tooltip:"Refresh",hideTooltipIcon:!0,size:ke.S,variant:Ie.Text,onClick:s,disabled:n,loading:o}}),r&&e.push({id:bo(),type:gn.Button,buttonProps:{leftIcon:Ma,tooltip:"Reset to defaults",hideTooltipIcon:!0,size:ke.S,variant:Ie.Text,textColor:c.v2.colors.red[500],onClick:()=>p(!0),disabled:n}}),e},[n,o,r,s,c]),m=u.length>0,g=h.length>0;return e(Vb,{children:[t(ua,{icon:ul,title:"Odigos Settings"}),e(Hb,{children:[m&&t(ha,{actions:u}),m&&g&&t(jb,{}),g&&t(ha,{actions:h})]}),t(tt,{isOpen:d,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:Ie.Secondary,onClick:()=>p(!1)},approveButton:{label:"Approve",variant:Ie.Primary,onClick:()=>{r?.(),p(!1)}}})]})},Wb=b(ae)`
1452
1451
  width: 220px;
1453
1452
  flex-shrink: 0;
1454
1453
  height: 100%;
1455
1454
  gap: 4px;
1456
1455
  overflow-y: auto;
1457
- `,Xb=({options:e,selected:n,setSelected:o,disabled:i})=>t(Bb,{children:e.map(e=>t(Hs,{dataId:`settings-nav-${e.id}`,title:e.label,isSelected:n===e.id,disabled:i,onClick:()=>o(e.id)},e.id))}),Ub=b(ee)`
1456
+ `,Kb=({options:e,selected:n,setSelected:o,disabled:i})=>t(Wb,{children:e.map(e=>t(is,{dataId:`settings-nav-${e.id}`,title:e.label,isSelected:n===e.id,disabled:i,onClick:()=>o(e.id)},e.id))}),Yb=b(ae)`
1458
1457
  width: 100%;
1459
1458
  /* side menu (220) + gap (24) + form (600) = 844, so content fills exactly with no dead space */
1460
1459
  max-width: 844px;
@@ -1464,25 +1463,25 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
1464
1463
  gap: 24px;
1465
1464
  flex: 1;
1466
1465
  min-height: 0;
1467
- `,Vb=b(pe)`
1466
+ `,Jb=b(oe)`
1468
1467
  flex: 1;
1469
1468
  min-height: 0;
1470
1469
  width: 100%;
1471
1470
  align-self: stretch;
1472
- `,Hb=b(ee)`
1471
+ `,qb=b(ae)`
1473
1472
  flex: 1;
1474
1473
  min-height: 0;
1475
1474
  height: 100%;
1476
1475
  max-width: 600px;
1477
1476
  overflow-y: auto;
1478
- `,jb=b(pe)`
1477
+ `,Zb=b(oe)`
1479
1478
  gap: 8px;
1480
1479
  width: 100%;
1481
1480
  align-items: center;
1482
- `,Gb=b.div`
1481
+ `,Qb=b.div`
1483
1482
  flex: 1;
1484
1483
  min-width: 0;
1485
- `,Wb=e=>"general"===e.name?0:"advanced"===e.name?2:1,Kb=({minSupportedVersion:o})=>{const{isVersionSupported:l,version:r,isEnterprise:s,minSupportedVersion:d}=S(o),{configApi:p}=Vl(),{data:u,loading:h}=p.useConfigYamls(),{data:m,loading:g,refetch:f}=p.useEffectiveConfig(),b=u?.configYamls??[],[v,y]=a(!1),C=c(()=>{if(!m)return{};const{manifestYAML:e,provenance:t,...n}=m;return n},[m]),{formData:x,handleFormChange:w,getNestedValue:T,getFormDiff:k,isFormDirty:I}=Gt(C);i(()=>{"{}"!==JSON.stringify(C)&&"{}"===JSON.stringify(x)&&w(void 0,void 0,C)},[C,x]);const N=c(()=>[...b].sort((e,t)=>Wb(e)-Wb(t)),[b]),E=c(()=>(e=>{if(!e)return{};const t={};for(const n of e)t[n.helmPath]=n.reconciledFrom;return t})(m?.provenance),[m?.provenance]),O=c(()=>{const e=new Set;for(const t of b)for(const n of t.fields)n.componentType===Bt.Dropdown&&e.add(n.helmValuePath);return e},[b]),$=c(()=>b.flatMap(e=>e.fields.map(e=>({name:e.helmValuePath,value:T("formData",e.helmValuePath)}))),[b,x,T]),[A,R]=a(!1),[D,_]=a(!1),P=c(()=>[{id:ho(),type:hn.Button,buttonProps:{"data-id":"settings-save",variant:ve.Primary,size:be.S,label:"Save Changes",leftIcon:Wa,loading:v,onClick:()=>R(!0)}},{id:ho(),type:hn.Button,buttonProps:{"data-id":"settings-cancel",variant:ve.Secondary,size:be.S,label:"Cancel",leftIcon:Ka,onClick:()=>w(void 0,void 0,C)}}],[v,k,C,x,w]),L=c(()=>N.map(e=>({id:e.name,label:e.displayName})),[N]),F=c(()=>N.map(e=>e.name),[N]),{selectedSection:M,setSelectedSection:z,setSectionRef:B,setScrollContainerRef:X}=$a({sectionNames:F});return t(zi,{$gap:24,children:e(Ub,{children:[t(zb,{disabled:!l,loading:h||g,onClickShowYaml:()=>_(!0),onClickReset:async()=>{await(async()=>{p.resetLocalUiConfigToDefaults&&await p.resetLocalUiConfigToDefaults()})(),await(f?.()),w(void 0,void 0,{})},onClickRefresh:f?()=>f():void 0}),e(ma,{children:[!l&&t(Rr,{minSupportedVersion:d,currentVersion:r||""}),t(Fn,{isOpen:I,richTitle:{icon:rl,title:"Config Settings"},actions:P}),t(qe,{isOpen:A,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:()=>R(!1),denyButton:{label:"Keep editing",variant:ve.Secondary,onClick:()=>R(!1)},approveButton:{label:"Save changes",variant:ve.Primary,onClick:()=>{(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 i=o;for(const e of t){if(null==i||"object"!=typeof i){i=void 0;break}i=i[e]}"string"==typeof i&&n(o,t,i.replaceAll("-","_"))}return o})(k(C,x),O);await(async e=>{p.updateLocalUiConfig&&(y(!0),await p.updateLocalUiConfig(e),y(!1),await f())})(e),w(void 0,void 0,{})})(),R(!1)}}}),e(Vb,{$gap:24,$alignItems:"stretch",children:[!!b.length&&t(Xb,{options:L,selected:M,setSelected:z,disabled:!l}),t(Hb,{ref:X,$gap:24,$width:"100%",children:b.length?N.map(o=>t(st,{id:o.name,bordered:!0,ref:e=>B(o.name,e),customTitle:t(_e,{size:Te.M,weight:500,color:Pe.Primary,children:o.displayName}),children:t(ee,{$gap:24,children:o.fields.map(o=>{if(o.isEnterpriseOnly&&!s)return null;if(o.renderCondition&&!Kt(o.renderCondition,[],$))return null;const i=wt(o.componentProps||"{}",{}),a=E[o.helmValuePath],l=o.componentType===Bt.Toggle,r=t(_e,{size:Te.XS,weight:500,color:Pe.Primary,children:o.displayName}),c=(e=>{if(e)return"odigos-local-ui-config"===e?{status:Ee.Warning,label:"Edited in UI",tooltip:`Reconciled from ${e}`}:"odigos-configuration"===e?{status:Ee.Unknown,useSecondaryTone:!0,label:"Cluster config",tooltip:`Reconciled from ${e}`}:{status:Ee.Unknown,useSecondaryTone:!0,label:e,tooltip:`Reconciled from ${e}`}})(a),d=c?t(Ke,{...c}):null,p=o.description?t(_e,{size:Te.XXS,color:Pe.Secondary,children:o.description}):null,u=e(ee,{$gap:4,children:[e(pe,{$gap:8,$alignItems:"center",children:[r,d]}),p]}),h=t(Dr,{componentType:o.componentType,inputType:i.type,name:o.helmValuePath,disabled:o.isHelmOnly||v,value:T("formData",o.helmValuePath),setValue:e=>w(o.helmValuePath,e),dropdownOptions:i.options?.map(e=>({id:e,label:e})),dropdownNoSearch:!0,dropdownNoCheckbox:!0,toggleSize:Nt.S},o.helmValuePath),m=o.isHelmOnly?t(Fe,{text:"This field can only be updated via the Helm values.yaml file",children:t(Xl,{})}):null;return t(ee,{$gap:8,children:l?e(pe,{$gap:12,$justifyContent:"space-between",$alignItems:"flex-start",children:[u,e(pe,{$gap:8,$alignItems:"center",children:[m,h]})]}):e(n,{children:[u,e(jb,{children:[t(Gb,{children:h}),m]})]})},o.helmValuePath)})})},o.name)):h?t(mt,{$height:"30vh",children:t(yt,{withSpinner:!0})}):t(st,{richTitle:{icon:rl,title:"Config Settings"},children:t(xe,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})})]}),t(Mt,{isOpen:D,width:"40vw",minWidth:"480px",header:{icon:zl,title:"Effective Config YAML",onClose:()=>_(!1)},children:g&&!m?.manifestYAML?t(mt,{$height:"30vh",children:t(yt,{withSpinner:!0})}):t(Or,{yaml:m?.manifestYAML?.replaceAll(" |",""),defaultOpen:!0,fullHeight:!0})})]})]})})},Yb=b.div`
1484
+ `,ev=e=>"general"===e.name?0:"advanced"===e.name?2:1,tv=({minSupportedVersion:o})=>{const{isVersionSupported:r,version:s,isEnterprise:c,minSupportedVersion:d}=S(o),{configApi:p}=Gl(),{data:u,loading:h}=p.useConfigYamls(),{data:m,loading:g,refetch:f}=p.useEffectiveConfig(),b=u?.configYamls??[],[v,y]=l(!1),C=i(()=>{if(!m)return{};const{manifestYAML:e,provenance:t,...n}=m;return n},[m]),{formData:x,handleFormChange:w,getNestedValue:T,getFormDiff:k,isFormDirty:I}=Jt(C);a(()=>{"{}"!==JSON.stringify(C)&&"{}"===JSON.stringify(x)&&w(void 0,void 0,C)},[C,x]);const N=i(()=>[...b].sort((e,t)=>ev(e)-ev(t)),[b]),E=i(()=>(e=>{if(!e)return{};const t={};for(const n of e)t[n.helmPath]=n.reconciledFrom;return t})(m?.provenance),[m?.provenance]),O=i(()=>{const e=new Set;for(const t of b)for(const n of t.fields)n.componentType===Ht.Dropdown&&e.add(n.helmValuePath);return e},[b]),$=i(()=>b.flatMap(e=>e.fields.map(e=>({name:e.helmValuePath,value:T("formData",e.helmValuePath)}))),[b,x,T]),[A,R]=l(!1),[D,_]=l(!1),P=i(()=>[{id:bo(),type:gn.Button,buttonProps:{"data-id":"settings-save",variant:Ie.Primary,size:ke.S,label:"Save Changes",leftIcon:Za,loading:v,onClick:()=>R(!0)}},{id:bo(),type:gn.Button,buttonProps:{"data-id":"settings-cancel",variant:Ie.Secondary,size:ke.S,label:"Cancel",leftIcon:Qa,onClick:()=>w(void 0,void 0,C)}}],[v,k,C,x,w]),L=i(()=>N.map(e=>({id:e.name,label:e.displayName})),[N]),F=i(()=>N.map(e=>e.name),[N]),{selectedSection:M,setSelectedSection:z,setSectionRef:B,setScrollContainerRef:X}=Pa({sectionNames:F});return t(Vi,{$gap:24,children:e(Yb,{children:[t(Gb,{disabled:!r,loading:h||g,onClickShowYaml:()=>_(!0),onClickReset:async()=>{await(async()=>{p.resetLocalUiConfigToDefaults&&await p.resetLocalUiConfigToDefaults()})(),await(f?.()),w(void 0,void 0,{})},onClickRefresh:f?()=>f():void 0}),e(ya,{children:[!r&&t(Pr,{minSupportedVersion:d,currentVersion:s||""}),t(Bn,{isOpen:I,richTitle:{icon:ul,title:"Config Settings"},actions:P}),t(tt,{isOpen:A,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:()=>R(!1),denyButton:{label:"Keep editing",variant:Ie.Secondary,onClick:()=>R(!1)},approveButton:{label:"Save changes",variant:Ie.Primary,onClick:()=>{(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 i=o;for(const e of t){if(null==i||"object"!=typeof i){i=void 0;break}i=i[e]}"string"==typeof i&&n(o,t,i.replaceAll("-","_"))}return o})(k(C,x),O);await(async e=>{p.updateLocalUiConfig&&(y(!0),await p.updateLocalUiConfig(e),y(!1),await f())})(e),w(void 0,void 0,{})})(),R(!1)}}}),e(Jb,{$gap:24,$alignItems:"stretch",children:[!!b.length&&t(Kb,{options:L,selected:M,setSelected:z,disabled:!r}),t(qb,{ref:X,$gap:24,$width:"100%",children:b.length?N.map(o=>t(ut,{id:o.name,bordered:!0,ref:e=>B(o.name,e),customTitle:t(ee,{size:te.M,weight:500,color:ne.Primary,children:o.displayName}),children:t(ae,{$gap:24,children:o.fields.map(o=>{if(o.isEnterpriseOnly&&!c)return null;if(o.renderCondition&&!Zt(o.renderCondition,[],$))return null;const i=kt(o.componentProps||"{}",{}),a=E[o.helmValuePath],l=o.componentType===Ht.Toggle,r=t(ee,{size:te.XS,weight:500,color:ne.Primary,children:o.displayName}),s=(e=>{if(e)return"odigos-local-ui-config"===e?{status:Pe.Warning,label:"Edited in UI",tooltip:`Reconciled from ${e}`}:"odigos-configuration"===e?{status:Pe.Unknown,useSecondaryTone:!0,label:"Cluster config",tooltip:`Reconciled from ${e}`}:{status:Pe.Unknown,useSecondaryTone:!0,label:e,tooltip:`Reconciled from ${e}`}})(a),d=s?t(ce,{...s}):null,p=o.description?t(ee,{size:te.XXS,color:ne.Secondary,children:o.description}):null,u=e(ae,{$gap:4,children:[e(oe,{$gap:8,$alignItems:"center",children:[r,d]}),p]}),h=t(Lr,{componentType:o.componentType,inputType:i.type,name:o.helmValuePath,disabled:o.isHelmOnly||v,value:T("formData",o.helmValuePath),setValue:e=>w(o.helmValuePath,e),dropdownOptions:i.options?.map(e=>({id:e,label:e})),dropdownNoSearch:!0,dropdownNoCheckbox:!0,toggleSize:Et.S},o.helmValuePath),m=o.isHelmOnly?t(Ue,{text:"This field can only be updated via the Helm values.yaml file",children:t(Hl,{})}):null;return t(ae,{$gap:8,children:l?e(oe,{$gap:12,$justifyContent:"space-between",$alignItems:"flex-start",children:[u,e(oe,{$gap:8,$alignItems:"center",children:[m,h]})]}):e(n,{children:[u,e(Zb,{children:[t(Qb,{children:h}),m]})]})},o.helmValuePath)})})},o.name)):h?t(ft,{$height:"30vh",children:t(St,{withSpinner:!0})}):t(ut,{richTitle:{icon:ul,title:"Config Settings"},children:t($e,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})})]}),t(zt,{isOpen:D,width:"40vw",minWidth:"480px",header:{icon:Ul,title:"Effective Config YAML",onClose:()=>_(!1)},children:g&&!m?.manifestYAML?t(ft,{$height:"30vh",children:t(St,{withSpinner:!0})}):t(Rr,{yaml:m?.manifestYAML?.replaceAll(" |",""),defaultOpen:!0,fullHeight:!0})})]})]})})},nv=b.div`
1486
1485
  position: fixed;
1487
1486
  bottom: 12px;
1488
1487
  left: 12px;
@@ -1491,4 +1490,4 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
1491
1490
  flex-direction: column-reverse;
1492
1491
  gap: 6px;
1493
1492
  max-width: 600px;
1494
- `,Jb=()=>{const{notifications:e,markAsDismissed:n,markAsSeen:o}=qt(),i=e.filter(({dismissed:e})=>!e);return t(Yb,{children:i.map(({id:e,type:a,title:l,message:r},s)=>{const c=r||l;if(!c)return null;const d=i.length-s;return t(Ne,{status:a,message:c,onClose:({asSeen:t})=>(({id:e,asSeen:t})=>{n(e),t&&o(e)})({id:e,asSeen:t}),zIndex:d},`toast-${e}`)})})};export{js as AddActionDrawer,gs as AddActionForm,em as AddDataStreamModal,tc as AddDestinationDrawer,bs as AddDestinationForm,nc as AddRuleDrawer,ks as AddRuleForm,vc as AddSourceDrawer,rg as CentralConnections,qd as CloudConnectorStep,ep as CreateCloudConnectorDrawer,eg as CreateNewType,Ns as DataStreamForm,Is as DataStreamMergeWarning,np as EditActionDrawer,op as EditConfigDrawer,tm as EditDataStreamModal,ap as EditDestinationDrawer,rp as EditRuleDrawer,Rh as EditSourceDrawer,Es as EditSourceForm,Sg as Onboarding,im as OnboardingDone,If as Overview,zf as PipelineCollectors,pr as RegexTesterDrawer,Zm as SamplingOnboardingModal,Hh as SamplingRuleDrawer,_s as SamplingRuleForm,Gf as SamplingRules,Pb as ServiceMap,Kb as Settings,Qh as SystemDrawer,Mf as TABS,Jb as ToastList};
1493
+ `,ov=()=>{const{notifications:e,markAsDismissed:n,markAsSeen:o}=tn(),i=e.filter(({dismissed:e})=>!e);return t(nv,{children:i.map(({id:e,type:a,title:l,message:r},s)=>{const c=r||l;if(!c)return null;const d=i.length-s;return t(_e,{status:a,message:c,onClose:({asSeen:t})=>(({id:e,asSeen:t})=>{n(e),t&&o(e)})({id:e,asSeen:t}),zIndex:d},`toast-${e}`)})})};export{qs as AddActionDrawer,Es as AddActionForm,rm as AddDataStreamModal,rc as AddDestinationDrawer,$s as AddDestinationForm,sc as AddRuleDrawer,Ms as AddRuleForm,Tc as AddSourceDrawer,mg as CentralConnections,op as CloudConnectorStep,lp as CreateCloudConnectorDrawer,rg as CreateNewType,Bs as DataStreamForm,zs as DataStreamMergeWarning,cp as EditActionDrawer,dp as EditConfigDrawer,sm as EditDataStreamModal,up as EditDestinationDrawer,mp as EditRuleDrawer,zh as EditSourceDrawer,Xs as EditSourceForm,Eg as Onboarding,pm as OnboardingDone,Df as Overview,Gf as PipelineCollectors,mr as RegexTesterDrawer,ag as SamplingOnboardingModal,qh as SamplingRuleDrawer,Ws as SamplingRuleForm,Qf as SamplingRules,Ub as ServiceMap,tv as Settings,lm as SystemDrawer,jf as TABS,ov as ToastList};