@odigos/ui-kit 0.0.280 → 0.0.281

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.
package/lib/containers.js CHANGED
@@ -1,4 +1,4 @@
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 E,h as N,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 X,x as B,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-BCQhqBdU.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 Ee,a4 as Ne,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 Xe,af as Be,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,bP as tt,W as nt,m as ot,bb as it,bQ as at,bR as lt,bS as rt,bT as st,bU as ct,bV as dt,bW as pt,bX as ut,Q as ht,bY as mt,bZ as gt,b_ as ft,a$ as bt,br as vt,s as yt,b$ as Ct,c0 as St,b1 as xt,c1 as wt,c2 as Tt,aY as kt,v as It,bv as Et,ba as Nt,q as Ot,c3 as $t,bc as At,c4 as Rt,c5 as Dt,be as _t,c6 as Pt,b3 as Lt,c7 as Ft,l as Mt,y as zt,D as Xt,c8 as Bt,ag as Ut,c9 as Vt,ca as Ht,n as jt,bh as Gt,bm as Wt,z as Kt,cb as Yt,cc as Jt,bl as qt,cd as Zt,a3 as Qt,ce as en,cf as tn,b6 as nn,H as on,cg as an,ch as ln,ci as rn,cj as sn,ck as cn,cl as dn,cm as pn,cn as un,co as hn,O as mn,cp as gn,cq as fn,A as bn,b2 as vn,a_ as yn,cr as Cn,cs as Sn,ct as xn,cu as wn,cv as Tn,cw as kn,bw as In,cx as En,cy as Nn,cz as On,cA as $n,cB as An,b as Rn,cC as Dn,cD as _n,M as Pn,cE as Ln,cF as Fn,cG as Mn,cH as zn,cI as Xn,cJ as Bn,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,cT as qn,cU as Zn,cV as Qn,cW as eo,aO 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,d6 as mo,d7 as go,d8 as fo,d9 as bo,ax as vo,da as yo,db as Co,b4 as So,dc as xo,dd as wo,de as To,df as ko,dg as Io,dh as Eo,di as No,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 Xo,dw as Bo,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 Ei,e9 as Ni,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 Xi,em as Bi,en as Ui,eo as Vi,ep as Hi,P as ji,eq as Gi,er as Wi,es as Ki,et as Yi,eu as Ji,ev as qi,ew as Zi,aZ as Qi,ex as ea,$ 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,eG as da,eH as pa,eI as ua,eJ as ha,bd as ma,eK as ga,R as fa,a 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 Ea,eV as Na,eW as Oa,eX as $a,eY as Aa,eZ as Ra,e_ as Da,e$ as _a,f0 as Pa,f1 as La,f2 as Fa,f3 as Ma,f4 as za}from"./chunks/ui-components-D1sa0AJ8.js";import{ChevronRightIcon as Xa,ActionIcon as Ba,TrashIcon as Ua,PlusIcon as Va,ArrowRightIcon as Ha,VSquareIcon as ja,XSquareIcon as Ga,BookIcon as Wa,DeleteIcon as Ka,EditIcon as Ya,GoLogo as Ja,JavaLogo as qa,PhpLogo as Za,DestinationIcon as Qa,ChevronUpIcon as el,ChevronDownIcon as tl,VIcon as nl,XIcon as ol,InstrumentationRuleIcon as il,SourceIcon as al,NamespacesIcon as ll,AzureIcon as rl,GoogleCloudPlatformLogo as sl,AwsLogo as cl,CloudConnectorIcon as dl,EyeOpenIcon as pl,OdigosLogo as ul,ArrowLeftIcon as hl,ISquareIcon as ml,RefreshIcon as gl,SettingsIcon as fl,PodIcon as bl,K8sLogo as vl,ExclamationCircleIcon as yl,QuestionCircleIcon as Cl,InboundIcon as Sl,OutboundIcon as xl,UserIcon as wl,TerminalIcon as Tl,RefreshLeftArrowIcon as kl,MinusIcon as Il,SearchIcon as El,ExpandIcon as Nl,CopyIcon as Ol,DotIcon as $l,ArrowDownIcon as Al,DownloadIcon as Rl,SamplingIcon as Dl,ExclamationTriangleIcon as _l,KeyIcon as Pl,DiagnoseIcon as Ll,StarIcon as Fl,ArrowIcon as Ml,ConnectionsIcon as zl,FilterIcon as Xl,DataStreamIcon as Bl,PipelineCollectorIcon as Ul,ArrowDownSquareIcon as Vl,ArrowUpSquareIcon as Hl,GatewayIcon as jl,YamlIcon as Gl,ImageErrorIcon as Wl,LockIcon as Kl}from"./icons.js";import{n as Yl,f as Jl,k as ql,I as Zl,l as Ql,A as er,i as tr,P as nr,S as or,R as ir,g as ar,j as lr,c as rr,h as sr,m as cr,W as dr,C as pr,b as ur,Y as hr,O as mr,a as gr,U as fr,e as br}from"./chunks/index-CAqgZyIB.js";import{h as vr,o as yr,n as Cr,q as Sr,m as xr,t as wr,s as Tr,S as kr,w as Ir,E as Er,x as Nr,y as Or,v as $r,l as Ar,d as Rr,C as Dr,O as _r,f as Pr,b as Lr,R as Fr,A as Mr,e as zr,D as Xr}from"./chunks/source-instrument-form-context-Cng6X7Mt.js";import{createPortal as Br}from"react-dom";import{MarkerType as Ur,useNodesState as Vr,useEdgesState as Hr,Handle as jr,Position as Gr,getSmoothStepPath as Wr,BaseEdge as Kr,EdgeLabelRenderer as Yr,ReactFlowProvider as Jr,ReactFlow as qr,Background as Zr,Controls as Qr,ControlButton as es,useReactFlow as ts}from"@xyflow/react";import ns 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 os=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 P,S as _,s as L,R as F,t as M,w as z,o as X,x as B,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-BCQhqBdU.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 Pe,S as _e,bJ as Le,bt as Fe,bu as Me,bs as ze,bK as Xe,af as Be,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,bP as tt,W as nt,m as ot,bb as it,bQ as at,bR as lt,bS as rt,bT as st,bU as ct,bV as dt,bW as pt,bX as ut,Q as ht,bY as mt,bZ as gt,b_ as ft,a$ as bt,br as vt,s as yt,b$ as Ct,c0 as St,b1 as xt,c1 as wt,c2 as Tt,aY as kt,v as It,bv as Nt,ba as Et,q as Ot,c3 as $t,bc as At,c4 as Rt,c5 as Dt,be as Pt,c6 as _t,b3 as Lt,c7 as Ft,l as Mt,y as zt,D as Xt,c8 as Bt,ag as Ut,c9 as Vt,ca as Ht,n as jt,bh as Gt,bm as Wt,z as Kt,cb as Yt,cc as Jt,bl as qt,cd as Zt,a3 as Qt,ce as en,cf as tn,b6 as nn,H as on,cg as an,ch as ln,ci as rn,cj as sn,ck as cn,cl as dn,cm as pn,cn as un,co as hn,O as mn,cp as gn,cq as fn,A as bn,b2 as vn,a_ as yn,cr as Cn,cs as Sn,ct as xn,cu as wn,cv as Tn,cw as kn,bw as In,cx as Nn,cy as En,cz as On,cA as $n,cB as An,b as Rn,cC as Dn,cD as Pn,M as _n,cE as Ln,cF as Fn,cG as Mn,cH as zn,cI as Xn,cJ as Bn,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,cT as qn,cU as Zn,cV as Qn,cW as eo,aO 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,d6 as mo,d7 as go,d8 as fo,d9 as bo,ax as vo,da as yo,db as Co,b4 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 Po,dq as _o,dr as Lo,ds as Fo,dt as Mo,du as zo,dv as Xo,dw as Bo,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 Pi,eg as _i,eh as Li,ei as Fi,ej as Mi,ek as zi,el as Xi,em as Bi,en as Ui,eo as Vi,ep as Hi,P as ji,eq as Gi,er as Wi,es as Ki,et as Yi,eu as Ji,ev as qi,ew as Zi,aZ as Qi,ex as ea,$ 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,eG as da,eH as pa,eI as ua,eJ as ha,bd as ma,eK as ga,R as fa,a 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 Pa,f0 as _a,f1 as La,f2 as Fa,f3 as Ma,f4 as za}from"./chunks/ui-components-D1sa0AJ8.js";import{ChevronRightIcon as Xa,ActionIcon as Ba,TrashIcon as Ua,PlusIcon as Va,ArrowRightIcon as Ha,VSquareIcon as ja,XSquareIcon as Ga,BookIcon as Wa,DeleteIcon as Ka,EditIcon as Ya,GoLogo as Ja,JavaLogo as qa,PhpLogo as Za,DestinationIcon as Qa,ChevronUpIcon as el,ChevronDownIcon as tl,VIcon as nl,XIcon as ol,InstrumentationRuleIcon as il,SourceIcon as al,NamespacesIcon as ll,AzureIcon as rl,GoogleCloudPlatformLogo as sl,AwsLogo as cl,CloudConnectorIcon as dl,EyeOpenIcon as pl,OdigosLogo as ul,ArrowLeftIcon as hl,ISquareIcon as ml,RefreshIcon as gl,SettingsIcon as fl,PodIcon as bl,K8sLogo as vl,ExclamationCircleIcon as yl,QuestionCircleIcon as Cl,InboundIcon as Sl,OutboundIcon as xl,UserIcon as wl,TerminalIcon as Tl,RefreshLeftArrowIcon as kl,MinusIcon as Il,SearchIcon as Nl,ExpandIcon as El,CopyIcon as Ol,DotIcon as $l,ArrowDownIcon as Al,DownloadIcon as Rl,SamplingIcon as Dl,ExclamationTriangleIcon as Pl,KeyIcon as _l,DiagnoseIcon as Ll,StarIcon as Fl,ArrowIcon as Ml,ConnectionsIcon as zl,FilterIcon as Xl,DataStreamIcon as Bl,PipelineCollectorIcon as Ul,ArrowDownSquareIcon as Vl,ArrowUpSquareIcon as Hl,GatewayIcon as jl,YamlIcon as Gl,ImageErrorIcon as Wl,LockIcon as Kl}from"./icons.js";import{n as Yl,f as Jl,k as ql,I as Zl,l as Ql,A as er,i as tr,P as nr,S as or,R as ir,g as ar,j as lr,c as rr,h as sr,m as cr,W as dr,C as pr,b as ur,Y as hr,O as mr,a as gr,U as fr,e as br}from"./chunks/index-CAqgZyIB.js";import{h as vr,o as yr,n as Cr,q as Sr,m as xr,t as wr,s as Tr,S as kr,w as Ir,E as Nr,x as Er,y as Or,v as $r,l as Ar,d as Rr,C as Dr,O as Pr,f as _r,b as Lr,R as Fr,A as Mr,e as zr,D as Xr}from"./chunks/source-instrument-form-context-Cng6X7Mt.js";import{createPortal as Br}from"react-dom";import{MarkerType as Ur,useNodesState as Vr,useEdgesState as Hr,Handle as jr,Position as Gr,getSmoothStepPath as Wr,BaseEdge as Kr,EdgeLabelRenderer as Yr,ReactFlowProvider as Jr,ReactFlow as qr,Background as Zr,Controls as Qr,ControlButton as es,useReactFlow as ts}from"@xyflow/react";import ns 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 os=b.div`
2
2
  display: flex;
3
3
  align-items: center;
4
4
  justify-content: space-between;
@@ -42,7 +42,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
42
42
  `,ks=b.div`
43
43
  /* Pushes the arrow down to sit next to the inputs rather than the field titles. */
44
44
  padding-top: 24px;
45
- `,Is=e=>Object.entries(e||{}).map(([e,t])=>({oldKey:e,newKey:t})),Es=e=>{const t={};return e.forEach(({oldKey:e,newKey:n})=>{t[e]=n}),t},Ns=de.UrlTemplatizationRulesGroups,Os=[{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"}],$s={[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:ms.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:fs,values:o[de.LabelsAttributes]||[],setValues:e=>i(de.LabelsAttributes,e),errorMessage:l[de.LabelsAttributes]}),t(he,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:bs,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(()=>Is(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])})(Es(r),i||{})||s(Is(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,Es(t))},errorMessage:o[de.Renames]})},[Oe.PiiMasking]:({value:n,setValue:o,formErrors:i})=>(a(()=>{n[de.PiiCategories]?.length||o(de.PiiCategories,hs.map(({id:e})=>e))},[]),e(ae,{$gap:12,children:[t(pe,{label:"Attributes to mask"}),t(ae,{$gap:6,children:hs.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[Ns]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>i(Ns,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(Ne,{}),e(ae,{$gap:12,children:[e(oe,{$justifyContent:"space-between",$alignItems:"center",children:[t(pe,{label:`Rule Group ${o+1}`}),t(Te,{leftIcon:()=>t(Ua,{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(Ee,{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:Os,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[Ns]})]},`url-templatization-group-${o}`)),t(Te,{variant:Ie.Secondary,label:"Add rule group",leftIcon:Va,onClick:()=>c([...s,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(Ne,{})]})},[Oe.ExtractAttribute]:({value:n,setValue:o,formErrors:i})=>{const r=v(),s=i[vs],c=n[vs]?.extractions||[],[d,p]=l(()=>(e=>e.length&&e.some(xs)?ys.Regex:ys.Preset)(c)),[u,h]=l(null),m=e=>o(vs,{extractions:e});a(()=>{0===c.length&&m([d===ys.Preset?Ss():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},[]);const g=(e,t)=>{m(c.map((n,o)=>o===e?{...n,...t}:n))},f=()=>{m([...c,d===ys.Preset?Ss():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},b=d===ys.Preset,y=c.length?c:[b?Ss():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}],C=null!=u&&y[u]?.regex||"";return e(ae,{$gap:16,$width:"100%",children:[t(ve,{options:[{value:ys.Preset,label:ye.SEGMENT_PRESET_LABEL,tooltip:ye.SEGMENT_PRESET_TOOLTIP,selectedBgColor:r.v2.colors.purple[500]},{value:ys.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===ys.Preset?Ss():{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(ws,{"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:Cs.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(Ua,{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===ys.Preset?Ss():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])})(o)}),i&&t(Te,{"data-id":`extract-row-${o}-add`,leftIcon:Va,variant:Ie.Secondary,size:ke.S,onClick:f})]})]}),b?e(oe,{$gap:8,$alignItems:"flex-start",$width:"100%",children:[t(Ts,{children:t(Ee,{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(ks,{children:t(Ha,{size:24,fill:r.v2.colors.silver[200]})}),t(Ts,{children:t(Ee,{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(Ee,{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(Ee,{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(Yl,{isOpen:null!=u,regex:C,onClose:()=>h(null)})]})},[Oe.DbQueryTemplatization]:null,[Oe.InferDbAttributes]:null},As=({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(Jl,{fields:a,value:n||{},setValue:o,formErrors:i||{},signals:l||[],seedInitialValues:!0,keyValuePersistAs:"map",sourceOptions:r,namespaceOptions:s},e);const c=$s[e];return c?t(c,{value:n,setValue:o,formErrors:i}):null},Rs=()=>{const n=v(),{selectedOption:o,genericForm:i,sourceOptions:a,namespaceOptions:l}=vr();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:ja,label:"Enabled",value:!1,selectedBgColor:n.v2.colors.green[800]},{icon:Ga,label:"Disabled",value:!0,selectedBgColor:n.v2.colors.red[800]}],size:Re.S,selected:r.disabled,setSelected:e=>s("disabled",e)}),t(Te,{leftIcon:Wa,variant:Ie.Secondary,size:ke.S,onClick:()=>o.docsUrl&&window.open(o.docsUrl,"_blank","noopener noreferrer")})]})]}),t(ql,{title:"Signals for processing",allowedSignals:o.allowedSignals,selectedSignals:r.signals||[],setSelectedSignals:e=>s("signals",e),errorMessage:c.signals}),t(Ee,{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(As,{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})]})},Ds=b(oe)`
45
+ `,Is=e=>Object.entries(e||{}).map(([e,t])=>({oldKey:e,newKey:t})),Ns=e=>{const t={};return e.forEach(({oldKey:e,newKey:n})=>{t[e]=n}),t},Es=de.UrlTemplatizationRulesGroups,Os=[{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"}],$s={[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:ms.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:fs,values:o[de.LabelsAttributes]||[],setValues:e=>i(de.LabelsAttributes,e),errorMessage:l[de.LabelsAttributes]}),t(he,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:bs,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(()=>Is(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])})(Ns(r),i||{})||s(Is(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,Ns(t))},errorMessage:o[de.Renames]})},[Oe.PiiMasking]:({value:n,setValue:o,formErrors:i})=>(a(()=>{n[de.PiiCategories]?.length||o(de.PiiCategories,hs.map(({id:e})=>e))},[]),e(ae,{$gap:12,children:[t(pe,{label:"Attributes to mask"}),t(ae,{$gap:6,children:hs.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[Es]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>i(Es,e),d=(e,t)=>c(s.map((n,o)=>o===e?{...n,...t}:n));return e(n,{children:[s.map((n,o)=>e(r,{children:[t(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(Ua,{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:Os,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[Es]})]},`url-templatization-group-${o}`)),t(Te,{variant:Ie.Secondary,label:"Add rule group",leftIcon:Va,onClick:()=>c([...s,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(Ee,{})]})},[Oe.ExtractAttribute]:({value:n,setValue:o,formErrors:i})=>{const r=v(),s=i[vs],c=n[vs]?.extractions||[],[d,p]=l(()=>(e=>e.length&&e.some(xs)?ys.Regex:ys.Preset)(c)),[u,h]=l(null),m=e=>o(vs,{extractions:e});a(()=>{0===c.length&&m([d===ys.Preset?Ss():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},[]);const g=(e,t)=>{m(c.map((n,o)=>o===e?{...n,...t}:n))},f=()=>{m([...c,d===ys.Preset?Ss():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},b=d===ys.Preset,y=c.length?c:[b?Ss():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}],C=null!=u&&y[u]?.regex||"";return e(ae,{$gap:16,$width:"100%",children:[t(ve,{options:[{value:ys.Preset,label:ye.SEGMENT_PRESET_LABEL,tooltip:ye.SEGMENT_PRESET_TOOLTIP,selectedBgColor:r.v2.colors.purple[500]},{value:ys.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===ys.Preset?Ss():{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(ws,{"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:Cs.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(Ua,{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===ys.Preset?Ss():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])})(o)}),i&&t(Te,{"data-id":`extract-row-${o}-add`,leftIcon:Va,variant:Ie.Secondary,size:ke.S,onClick:f})]})]}),b?e(oe,{$gap:8,$alignItems:"flex-start",$width:"100%",children:[t(Ts,{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(ks,{children:t(Ha,{size:24,fill:r.v2.colors.silver[200]})}),t(Ts,{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(Yl,{isOpen:null!=u,regex:C,onClose:()=>h(null)})]})},[Oe.DbQueryTemplatization]:null,[Oe.InferDbAttributes]:null},As=({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(Jl,{fields:a,value:n||{},setValue:o,formErrors:i||{},signals:l||[],seedInitialValues:!0,keyValuePersistAs:"map",sourceOptions:r,namespaceOptions:s},e);const c=$s[e];return c?t(c,{value:n,setValue:o,formErrors:i}):null},Rs=()=>{const n=v(),{selectedOption:o,genericForm:i,sourceOptions:a,namespaceOptions:l}=vr();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:ja,label:"Enabled",value:!1,selectedBgColor:n.v2.colors.green[800]},{icon:Ga,label:"Disabled",value:!0,selectedBgColor:n.v2.colors.red[800]}],size:Re.S,selected:r.disabled,setSelected:e=>s("disabled",e)}),t(Te,{leftIcon:Wa,variant:Ie.Secondary,size:ke.S,onClick:()=>o.docsUrl&&window.open(o.docsUrl,"_blank","noopener noreferrer")})]})]}),t(ql,{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(As,{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})]})},Ds=b(oe)`
46
46
  position: sticky;
47
47
  bottom: 4px;
48
48
  align-self: center;
@@ -53,7 +53,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
53
53
  background-color: ${({theme:e})=>e.v2.colors.black[500]};
54
54
  box-shadow: 0 4px 16.7px 0 rgba(0, 0, 0, 0.83);
55
55
  z-index: 1;
56
- `,_s=s(({isEdit:n},o)=>{const i=v(),{isK8s:r}=S(),{destinationsApi:s}=yr(),{activeForm:d,genericForm:p,validateFormData:u,thisUnsavedDestination:h,addUnsavedDestination:m,updateUnsavedDestination:g,deleteUnsavedDestination:f}=Cr(),[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(Xe(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:ja,label:"Enabled",value:!1,selectedBgColor:i.v2.colors.green[800]},{icon:Ga,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:Wa,variant:Ie.Secondary,size:ke.S,onClick:()=>window.open(`${Le}/backends/${d.option.type}`,"_blank","noopener noreferrer")})]})]}),t(ql,{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(Ee,{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(Jl,{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(Ds,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(Te,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:Ka,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:Ya,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 Ps=[{id:Be.FilePath,label:"Collect file path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Be.Function,label:"Collect function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Be.LineNumber,label:"Collect line number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],Ls=[{id:Be.Column,label:"Collect column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Be.Namespace,label:"Collect namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Be.StackTrace,label:"Collect stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],Fs=["*"],Ms=[{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:""}],zs={[Ke.Java]:[new Ge("","")],[Ke.Golang]:[new je("")],[Ke.Php]:[new We("","")]},Xs={[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={[Be.FilePath]:!0,[Be.Function]:!0,[Be.LineNumber]:!0,[Be.Column]:null,[Be.Namespace]:null,[Be.StackTrace]:null};l("codeAttributes",e)}},[]);const p=(e,t)=>{const n=t?[...d,e]:d.filter(t=>t!==e),o=Object.values(Be).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:Ps.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:Ls.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]:zs[Ke.Golang],[Ke.Java]:zs[Ke.Java],[Ke.Php]:zs[Ke.Php]})},[]),e(n,{children:[e(ae,{children:[e(oe,{$gap:8,children:[t(Ja,{}),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(qa,{}),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(Za,{}),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(Fs)},[]),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:Ms.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},Bs=({ruleType:e,value:n,setValue:o,formErrors:i,dynamicFields:a,disabled:l})=>{if(!e)return null;if(a?.length)return t(Jl,{fields:a,value:n||{},setValue:o,formErrors:i||{},signals:[],seedInitialValues:!0,keyValuePersistAs:"map",disabled:l},e);const r=Xs[e];return r?t(r,{value:n,setValue:o,formErrors:i,disabled:l}):null},Us=()=>{const n=v(),{isEnterprise:o,platformType:a,version:l}=S(),r=qe(a,l),{selectedOption:s,genericForm:c,sourceOptions:d,namespaceOptions:p}=Sr(),u=i(()=>Ze(s?.supportedLanguages),[s?.supportedLanguages]),h=i(()=>{if(s)return s.type===Je.CustomInstrumentation?[]:Qe(s.supportedLanguages)},[s]);if(!c||!s)return t($e,{title:"No active form"});const{formData:m,handleFormChange:g,formErrors:f}=c;return e(ae,{$gap:24,children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[t(Ae,{size:te.XXXS,maxLines:2,children:s.description}),e(oe,{$gap:12,children:[t(ve,{options:[{icon:ja,label:"Enabled",value:!1,selectedBgColor:n.v2.colors.green[800]},{icon:Ga,label:"Disabled",value:!0,selectedBgColor:n.v2.colors.red[800]}],size:Re.S,selected:m.disabled,setSelected:e=>g("disabled",e),disabled:!o}),t(Te,{leftIcon:Wa,variant:Ie.Secondary,size:ke.S,onClick:()=>s.docsUrl&&window.open(s.docsUrl,"_blank","noopener noreferrer")})]})]}),t(Zl,{option:s,formState:m}),!!u.length&&e(oe,{$gap:12,children:[t(ee,{size:te.XS,color:ne.Secondary,nowrap:!0,children:"Supported Languages:"}),u.map(e=>t(ce,{label:tt(e),leftIcon:et(e),backgroundColor:n.v2.colors.purple[900]},e))]}),r&&t(Ql,{scopes:m.sourceScopes,onChange:e=>g("sourceScopes",e),sourceOptions:d,namespaceOptions:p,supportedLanguages:h,dataIdPrefix:"instrumentation-rule",slim:!0,disabled:!o}),t(Ee,{name:"ruleName",label:"Rule name",placeholder:"Use a name that describes the rule...",value:m.ruleName,onChange:({target:{value:e}})=>g("ruleName",e),errorMessage:f.ruleName,disabled:!o}),t(Bs,{ruleType:s.type,dynamicFields:s.fields,value:m,setValue:(e,t)=>g(e,t),formErrors:f,disabled:!o}),t(De,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:m.notes,onChange:({target:{value:e}})=>g("notes",e),errorMessage:f.notes,disabled:!o})]})},Vs=()=>{const{pendingMerge:e,confirmMerge:n,cancelMerge:o}=xr();if(!e)return null;const{existingName:i,editingName:a}=e;return t(nt,{isOpen:!0,onClose:o,title:"Merge with existing Data Stream?",description:ot.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}})},Hs=({autoFocus:n})=>{const{dataStreams:o}=it(),{genericForm:a,excludeName:l,editingName:r}=xr(),{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(Ee,{name:"data-stream-name",label:ot.STREAM_NAME,placeholder:ot.NAME_YOUR_STREAM_PLACEHOLDER,tooltip:ot.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:ot.DATA_STREAM_MERGE_WARNING(r,u.name),fullWidth:!0})]})},js=()=>{const{selectedStreamName:e}=it(),{genericForm:n}=wr();if(!n)return t($e,{title:"No active form"});const{formData:o,handleFormChange:i,formErrors:a}=n;return t(Ee,{name:"sourceName",label:ot.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})},Gs=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],Ws=b.div`
56
+ `,Ps=s(({isEdit:n},o)=>{const i=v(),{isK8s:r}=S(),{destinationsApi:s}=yr(),{activeForm:d,genericForm:p,validateFormData:u,thisUnsavedDestination:h,addUnsavedDestination:m,updateUnsavedDestination:g,deleteUnsavedDestination:f}=Cr(),[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(Xe(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(Pe,{status:_e.Success,message:b.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t(Pe,{status:_e.Error,message:b.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),e(oe,{$gap:12,children:[r&&t(ve,{options:[{icon:ja,label:"Enabled",value:!1,selectedBgColor:i.v2.colors.green[800]},{icon:Ga,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:Wa,variant:Ie.Secondary,size:ke.S,onClick:()=>window.open(`${Le}/backends/${d.option.type}`,"_blank","noopener noreferrer")})]})]}),t(ql,{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(Jl,{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(Ds,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(Te,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:Ka,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:Ya,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"})});Ps.displayName="AddDestinationForm";const _s=[{id:Be.FilePath,label:"Collect file path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Be.Function,label:"Collect function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Be.LineNumber,label:"Collect line number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],Ls=[{id:Be.Column,label:"Collect column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Be.Namespace,label:"Collect namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Be.StackTrace,label:"Collect stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],Fs=["*"],Ms=[{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:""}],zs={[Ke.Java]:[new Ge("","")],[Ke.Golang]:[new je("")],[Ke.Php]:[new We("","")]},Xs={[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={[Be.FilePath]:!0,[Be.Function]:!0,[Be.LineNumber]:!0,[Be.Column]:null,[Be.Namespace]:null,[Be.StackTrace]:null};l("codeAttributes",e)}},[]);const p=(e,t)=>{const n=t?[...d,e]:d.filter(t=>t!==e),o=Object.values(Be).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:_s.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:Ls.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]:zs[Ke.Golang],[Ke.Java]:zs[Ke.Java],[Ke.Php]:zs[Ke.Php]})},[]),e(n,{children:[e(ae,{children:[e(oe,{$gap:8,children:[t(Ja,{}),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(qa,{}),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(Za,{}),t(pe,{label:"PHP custom probes"})]}),t(Pe,{status:_e.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(Fs)},[]),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:Ms.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},Bs=({ruleType:e,value:n,setValue:o,formErrors:i,dynamicFields:a,disabled:l})=>{if(!e)return null;if(a?.length)return t(Jl,{fields:a,value:n||{},setValue:o,formErrors:i||{},signals:[],seedInitialValues:!0,keyValuePersistAs:"map",disabled:l},e);const r=Xs[e];return r?t(r,{value:n,setValue:o,formErrors:i,disabled:l}):null},Us=()=>{const n=v(),{isEnterprise:o,platformType:a,version:l}=S(),r=qe(a,l),{selectedOption:s,genericForm:c,sourceOptions:d,namespaceOptions:p}=Sr(),u=i(()=>Ze(s?.supportedLanguages),[s?.supportedLanguages]),h=i(()=>{if(s)return s.type===Je.CustomInstrumentation?[]:Qe(s.supportedLanguages)},[s]);if(!c||!s)return t($e,{title:"No active form"});const{formData:m,handleFormChange:g,formErrors:f}=c;return e(ae,{$gap:24,children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[t(Ae,{size:te.XXXS,maxLines:2,children:s.description}),e(oe,{$gap:12,children:[t(ve,{options:[{icon:ja,label:"Enabled",value:!1,selectedBgColor:n.v2.colors.green[800]},{icon:Ga,label:"Disabled",value:!0,selectedBgColor:n.v2.colors.red[800]}],size:Re.S,selected:m.disabled,setSelected:e=>g("disabled",e),disabled:!o}),t(Te,{leftIcon:Wa,variant:Ie.Secondary,size:ke.S,onClick:()=>s.docsUrl&&window.open(s.docsUrl,"_blank","noopener noreferrer")})]})]}),t(Zl,{option:s,formState:m}),!!u.length&&e(oe,{$gap:12,children:[t(ee,{size:te.XS,color:ne.Secondary,nowrap:!0,children:"Supported Languages:"}),u.map(e=>t(ce,{label:tt(e),leftIcon:et(e),backgroundColor:n.v2.colors.purple[900]},e))]}),r&&t(Ql,{scopes:m.sourceScopes,onChange:e=>g("sourceScopes",e),sourceOptions:d,namespaceOptions:p,supportedLanguages:h,dataIdPrefix:"instrumentation-rule",slim:!0,disabled:!o}),t(Ne,{name:"ruleName",label:"Rule name",placeholder:"Use a name that describes the rule...",value:m.ruleName,onChange:({target:{value:e}})=>g("ruleName",e),errorMessage:f.ruleName,disabled:!o}),t(Bs,{ruleType:s.type,dynamicFields:s.fields,value:m,setValue:(e,t)=>g(e,t),formErrors:f,disabled:!o}),t(De,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:m.notes,onChange:({target:{value:e}})=>g("notes",e),errorMessage:f.notes,disabled:!o})]})},Vs=()=>{const{pendingMerge:e,confirmMerge:n,cancelMerge:o}=xr();if(!e)return null;const{existingName:i,editingName:a}=e;return t(nt,{isOpen:!0,onClose:o,title:"Merge with existing Data Stream?",description:ot.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}})},Hs=({autoFocus:n})=>{const{dataStreams:o}=it(),{genericForm:a,excludeName:l,editingName:r}=xr(),{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:ot.STREAM_NAME,placeholder:ot.NAME_YOUR_STREAM_PLACEHOLDER,tooltip:ot.STREAM_DESCRIPTION,required:!0,autoFocus:n,value:p,onChange:e=>d("name",e.target.value),errorMessage:c.name}),u&&t(Pe,{status:_e.Warning,message:ot.DATA_STREAM_MERGE_WARNING(r,u.name),fullWidth:!0})]})},js=()=>{const{selectedStreamName:e}=it(),{genericForm:n}=wr();if(!n)return t($e,{title:"No active form"});const{formData:o,handleFormChange:i,formErrors:a}=n;return t(Ne,{name:"sourceName",label:ot.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})},Gs=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],Ws=b.div`
57
57
  display: flex;
58
58
  flex-direction: column;
59
59
  gap: 24px;
@@ -63,7 +63,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
63
63
  opacity: ${({$faded:e})=>e?.4:1};
64
64
  transition: opacity 0.2s ease;
65
65
  }
66
- `,Ys=({value:e})=>{const n=v();return t(ce,e?{status:Pe.Success,label:pt,leftIcon:ja}:{label:ut,leftIcon:Ga,backgroundColor:n.v2.colors.silver[500],textColor:n.v2.colors.white[500]})},Js=({value:e,onChange:n})=>{const o=v(),a=i(()=>[{icon:ja,label:pt,value:!0,selectedBgColor:o.v2.colors.green[800]},{icon:Ga,label:ut,value:!1,selectedBgColor:o.v2.colors.silver[500]}],[o]);return t(ve,{options:a,selected:e,setSelected:n??(()=>{}),disabled:!n})},qs=()=>{const e=Tr();switch(e.formType){case kr.Create:return t(Zs,{category:e.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Js,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})});case kr.View:return e.data?e.isEditing?t(Zs,{category:e.data.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Js,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})}):t(Qs,{data:e.data,renderAction:()=>t(Ys,{value:!e.data?.rule.disabled})}):null;case kr.EditAutoNoisy:return t(ec,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:dt,sectionTitle:rt,sectionSubTitle:ct,presetLabel:lt,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(Js,{value:e.localEnabled,onChange:e.setLocalEnabled})});case kr.EditAutoCostReduction:return t(ec,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:st,sectionTitle:rt,presetLabel:lt,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(Js,{value:e.localEnabled,onChange:e.setLocalEnabled})});case kr.EditAutoHighlyRelevant:return t(Ws,{children:t(er,{title:e.localEnabled?void 0:at,summary:e.summary,renderAction:()=>t(Js,{value:e.localEnabled,onChange:e.setLocalEnabled})})})}},Zs=({category:n,formData:o,onChange:i,sourceOptions:a,namespaceOptions:l,renderAction:r})=>e(Ws,{children:[t(or,{category:n,formState:o,renderAction:r}),e(Ks,{$faded:!!o.disabled,children:[t(ir,{category:n,formState:o,onChange:i}),t(Ql,{scopes:o.sourceScopes,onChange:e=>i({sourceScopes:e}),sourceOptions:a,namespaceOptions:l,titleNumber:1,dataIdPrefix:"sampling"}),t(ar,{category:n,formState:o,onChange:i}),"highlyRelevant"===n&&t(lr,{formState:o,onChange:i}),"highlyRelevant"===n&&t(rr,{ruleType:o.ruleType,formState:o,onChange:i}),t(sr,{category:n,formState:o,onChange:i})]})]}),Qs=({data:n,renderAction:o})=>e(Ws,{children:[t(or,{readOnly:!0,summary:n.summary,renderAction:o}),t(ir,{readOnly:!0,data:n}),t(Ql,{readOnly:!0,scopes:x(n.rule.sourceScopes)}),t(ar,{readOnly:!0,data:n}),t(sr,{readOnly:!0,data:n}),"highlyRelevant"===n.category&&t(rr,{readOnly:!0,rule:n.rule})]}),ec=({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(Ws,{children:[t(er,{title:n?void 0:i,summary:o,renderAction:b}),t(Ks,{$faded:!n,children:e(ht,{richTitle:{title:a,subTitle:l},children:[c&&t(ae,{$alignItems:"flex-start",children:t(ve,{options:Gs,selected:p,setSelected:v})}),S&&t(tr,{description:r,options:nr,selected:h,onSelect:y,customName:s,customLabel:mt,customPlaceholder:"5%",customValue:g,onCustomChange:C})]})})]})},tc=({onClose:n,selectedConnectionIds:o,setSelectedConnectionIds:a,withOverlay:r})=>{const{actionsApi:s}=yr(),{platformType:c,version:u}=S(),[h,m]=l(""),[g,f]=l(null),b=p(null),{selectedOption:v,onSelectOption:y,genericForm:C,validateFormData:x}=vr(),{options:w,loading:T}=s.useActionTypes(),k=i(()=>w.length?w:gt(c,u),[w,c,u]),I=i(()=>(h?k.filter(e=>e?.label?.toLowerCase().includes(h.toLowerCase())):k).filter(e=>!!e),[k,h]),E=d(e=>{b.current?.clearErrors(),y(e)},[y]),N=(({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 ds?t.category:cs;return(e[n]||=[]).push(t),e},{});return Object.keys(ds).filter(e=>i[e]?.length&&(!o||o===e)).map(e=>t(us,{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:E}),O=i(()=>{const e=new Set(k.map(e=>e.category));return[{value:null,label:"All Actions"},...Object.values(ft).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(Rs,{},v.type)]:[t(bt,{$height:"100%",children:t($e,{icon:Ba,title:"Action not selected",subTitle:"Please select an action to add"})},"no-data")],[T,v]);return t(cr,{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:ot.CREATING_ACTION,subTitle:ot.CREATING_ACTION_SUBTITLE},header:{icon:Ba,title:ot.ADD_ACTION,subTitle:ot.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:N,rightColumn:{width:"60%",list:$}})},nc=({destinationsByCategory:o,filters:a,setFilters:l})=>{const r=i(()=>Object.values(vt).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(yt,{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})})]})},oc=b.div`
66
+ `,Ys=({value:e})=>{const n=v();return t(ce,e?{status:_e.Success,label:pt,leftIcon:ja}:{label:ut,leftIcon:Ga,backgroundColor:n.v2.colors.silver[500],textColor:n.v2.colors.white[500]})},Js=({value:e,onChange:n})=>{const o=v(),a=i(()=>[{icon:ja,label:pt,value:!0,selectedBgColor:o.v2.colors.green[800]},{icon:Ga,label:ut,value:!1,selectedBgColor:o.v2.colors.silver[500]}],[o]);return t(ve,{options:a,selected:e,setSelected:n??(()=>{}),disabled:!n})},qs=()=>{const e=Tr();switch(e.formType){case kr.Create:return t(Zs,{category:e.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Js,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})});case kr.View:return e.data?e.isEditing?t(Zs,{category:e.data.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Js,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})}):t(Qs,{data:e.data,renderAction:()=>t(Ys,{value:!e.data?.rule.disabled})}):null;case kr.EditAutoNoisy:return t(ec,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:dt,sectionTitle:rt,sectionSubTitle:ct,presetLabel:lt,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(Js,{value:e.localEnabled,onChange:e.setLocalEnabled})});case kr.EditAutoCostReduction:return t(ec,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:st,sectionTitle:rt,presetLabel:lt,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(Js,{value:e.localEnabled,onChange:e.setLocalEnabled})});case kr.EditAutoHighlyRelevant:return t(Ws,{children:t(er,{title:e.localEnabled?void 0:at,summary:e.summary,renderAction:()=>t(Js,{value:e.localEnabled,onChange:e.setLocalEnabled})})})}},Zs=({category:n,formData:o,onChange:i,sourceOptions:a,namespaceOptions:l,renderAction:r})=>e(Ws,{children:[t(or,{category:n,formState:o,renderAction:r}),e(Ks,{$faded:!!o.disabled,children:[t(ir,{category:n,formState:o,onChange:i}),t(Ql,{scopes:o.sourceScopes,onChange:e=>i({sourceScopes:e}),sourceOptions:a,namespaceOptions:l,titleNumber:1,dataIdPrefix:"sampling"}),t(ar,{category:n,formState:o,onChange:i}),"highlyRelevant"===n&&t(lr,{formState:o,onChange:i}),"highlyRelevant"===n&&t(rr,{ruleType:o.ruleType,formState:o,onChange:i}),t(sr,{category:n,formState:o,onChange:i})]})]}),Qs=({data:n,renderAction:o})=>e(Ws,{children:[t(or,{readOnly:!0,summary:n.summary,renderAction:o}),t(ir,{readOnly:!0,data:n}),t(Ql,{readOnly:!0,scopes:x(n.rule.sourceScopes)}),t(ar,{readOnly:!0,data:n}),t(sr,{readOnly:!0,data:n}),"highlyRelevant"===n.category&&t(rr,{readOnly:!0,rule:n.rule})]}),ec=({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(Ws,{children:[t(er,{title:n?void 0:i,summary:o,renderAction:b}),t(Ks,{$faded:!n,children:e(ht,{richTitle:{title:a,subTitle:l},children:[c&&t(ae,{$alignItems:"flex-start",children:t(ve,{options:Gs,selected:p,setSelected:v})}),S&&t(tr,{description:r,options:nr,selected:h,onSelect:y,customName:s,customLabel:mt,customPlaceholder:"5%",customValue:g,onCustomChange:C})]})})]})},tc=({onClose:n,selectedConnectionIds:o,setSelectedConnectionIds:a,withOverlay:r})=>{const{actionsApi:s}=yr(),{platformType:c,version:u}=S(),[h,m]=l(""),[g,f]=l(null),b=p(null),{selectedOption:v,onSelectOption:y,genericForm:C,validateFormData:x}=vr(),{options:w,loading:T}=s.useActionTypes(),k=i(()=>w.length?w:gt(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 ds?t.category:cs;return(e[n]||=[]).push(t),e},{});return Object.keys(ds).filter(e=>i[e]?.length&&(!o||o===e)).map(e=>t(us,{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(ft).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(Rs,{},v.type)]:[t(bt,{$height:"100%",children:t($e,{icon:Ba,title:"Action not selected",subTitle:"Please select an action to add"})},"no-data")],[T,v]);return t(cr,{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:ot.CREATING_ACTION,subTitle:ot.CREATING_ACTION_SUBTITLE},header:{icon:Ba,title:ot.ADD_ACTION,subTitle:ot.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:$}})},nc=({destinationsByCategory:o,filters:a,setFilters:l})=>{const r=i(()=>Object.values(vt).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(yt,{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})})]})},oc=b.div`
67
67
  display: flex;
68
68
  flex-direction: column;
69
69
  padding: 8px;
@@ -76,7 +76,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
76
76
  justify-content: space-between;
77
77
  gap: 12px;
78
78
  padding: ${({$isOpen:e})=>e?"2px 12px 8px 12px":"2px 12px"};
79
- `,ac=({title:n,tooltip:o,list:i,noBgColor:a,purpleColors:r})=>{const[s,c]=l(!0);return e(oc,{"data-id":`collapse-${n}`,$noBgColor:a,$purpleColors:r,children:[e(ic,{$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(Ct,{icon:s?el:tl,size:St.M,onClick:()=>c(e=>!e)})]}),s?t(ae,{children:i.length?u.toArray(i):t(bt,{$padding:"12px 0",children:t($e,{})})}):null]})},lc=(e,t,n)=>t||n.signalType?e.filter(e=>e.displayName.toLowerCase().includes(t.toLowerCase())&&(!n.signalType||ze(e.supportedSignals).includes(n.signalType))):e,rc=({option:e,formData:n,testResult:o,isSelected:i,onSelect:a})=>t(ss,{icon:Tt(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?nl:ol})}),sc=({listType:e,destinationOptions:n,unsavedDestinations:o})=>{const{activeForm:i,onChangeActiveForm:a}=Cr();return n?.length?t(ac,{title:wt[e].TITLE,tooltip:wt[e].DESCRIPTION,list:n.map((n,o)=>t(rc,{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(ac,{purpleColors:!0,title:wt[e].TITLE,tooltip:wt[e].DESCRIPTION,list:o.map(({option:n,formData:o,testResult:l},r)=>t(rc,{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 cc;(e=>{e.SELF_HOSTED="self hosted",e.MANAGED="managed"})(cc||(cc={}));const dc=(e,t)=>{const n=[],o=[],i=[];return e&&e.destinationCategories.categories.forEach(e=>{e.name===cc.SELF_HOSTED?o.push(...e.items):e.name===cc.MANAGED&&i.push(...e.items)}),t&&t?.potentialDestinations.forEach(t=>{for(const o of e?.destinationCategories?.categories||[]){const e=kt(o),i=e.items.findIndex(e=>e.type===t.type);if(-1!==i){const o=It(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]))}}}),{[vt.DETECTED]:n,[vt.SELF_HOSTED]:o,[vt.MANAGED]:i}},pc=({onClose:e,onBack:n,onNext:o,selectedConnectionIds:r,setSelectedConnectionIds:s,initialInputs:c,withOverlay:p,disableAnimation:u})=>{const{destinationsApi:h}=yr(),[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}=Cr();a(()=>{c&&I(c)},[c]);const E=C||x,N=i(()=>y?.destinationCategories?.categories??[],[y]),[O,$]=l({[vt.ALL]:[],[vt.UNSAVED]:[],[vt.EXISTS]:[],[vt.DETECTED]:[],[vt.SELF_HOSTED]:[],[vt.MANAGED]:[]});a(()=>{const e=v.map(e=>{let t;for(const n of N){const o=n.items.find(t=>t.type===e.destinationType.type);if(o){t=o;break}}const n=It(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,[vt.EXISTS]:e}))},[v,N]),a(()=>{(y||S)&&$(e=>({...e,...dc(y,S)}))},[y,S]);const A=d(async()=>{for(const{option:e,formData:t}of k){const n=Xe(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}=Cr();return{width:"40%",list:i(()=>{const i=[];l.length&&i.push(t(sc,{listType:vt.UNSAVED,unsavedDestinations:l},"unsaved"));for(const e of Object.values(vt)){if(a.categoryType&&a.categoryType!==e)continue;const l=lc(n[e],o,a);l.length&&i.push(t(sc,{listType:e,destinationOptions:l},e))}return e&&i.push(t(bt,{$height:"100%",children:t(xt,{title:"Fetching destinations",withSpinner:!0})},"loading-more")),i},[l,n,o,a,e])}})({isFetching:E,destinationsByCategory:O,searchText:m,filters:f}),D=(()=>{const{activeForm:e}=Cr();return{width:"60%",list:e?[t(_s,{},e.option.type)]:[t(bt,{$height:"100%",children:t($e,{icon:Qa,title:"Select destination from the list",subTitle:"Add destination so your data has somewhere to go."})},"no-data")]}})();return t(cr,{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:E,isFormDirty:k.length>0||T?.isFormDirty,hideDirtyNote:!0,progress:{title:ot.CREATING_DESTINATION,subTitle:ot.CREATING_DESTINATION_SUBTITLE},header:{icon:Qa,title:ot.ADD_DESTINATIONS,subTitle:ot.ADD_DESTINATION_DRAWER_DESCRIPTION},connectionIds:r&&s?{value:r,setValue:s}:void 0,search:{value:m,onChange:g},filters:t(nc,{destinationsByCategory:O,filters:f,setFilters:b}),leftColumn:R,rightColumn:D})},uc=({onClose:e,selectedConnectionIds:n,setSelectedConnectionIds:o,withOverlay:a})=>{const{isEnterprise:r}=S(),{instrumentationRulesApi:s}=yr(),[c,d]=l(""),u=p(null),{selectedOption:h,onSelectOption:m,genericForm:g,validateFormData:f}=Sr(),{options:b,loading:v}=s.useRuleTypes(),y=i(()=>b.length?b:Et,[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(ss,{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(Us,{},h.type)]:[t(bt,{$height:"100%",children:t($e,{icon:il,title:"Instrumentation rule not selected",subTitle:"Please select an instrumentation rule to add"})},"no-data")],[v,h]);return t(cr,{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:r?void 0:{fullWidth:!0,status:Pe.Warning,message:"This feature is only supported for OnPrem (Enterprise) installations"},progress:{title:ot.CREATING_INSTRUMENTATION_RULE,subTitle:ot.CREATING_INSTRUMENTATION_RULE_SUBTITLE},header:{icon:il,title:ot.ADD_INSTRUMENTATION_RULE,subTitle:ot.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}})},hc={groupSegmentLabel:"Namespace",itemSegmentLabel:"Source",searchPlaceholder:()=>{},groupColumnHeader:"Namespaces",fetchingGroups:{title:ot.FETCHING_NAMESPACES,subTitle:ot.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:ot.SELECT_NAMESPACE,subTitle:ot.SELECT_NAMESPACE_SUBTITLE},noItemsInGroupSubTitle:"No sources found in this namespace"},mc={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"},gc=e=>e?mc:hc,fc="No matches",bc=e=>(e?"Unselect":"Select")+" all",vc="Selected",yc=b.div``,Cc=b.div`
79
+ `,ac=({title:n,tooltip:o,list:i,noBgColor:a,purpleColors:r})=>{const[s,c]=l(!0);return e(oc,{"data-id":`collapse-${n}`,$noBgColor:a,$purpleColors:r,children:[e(ic,{$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?_e.Default:void 0})]}),t(Ct,{icon:s?el:tl,size:St.M,onClick:()=>c(e=>!e)})]}),s?t(ae,{children:i.length?u.toArray(i):t(bt,{$padding:"12px 0",children:t($e,{})})}):null]})},lc=(e,t,n)=>t||n.signalType?e.filter(e=>e.displayName.toLowerCase().includes(t.toLowerCase())&&(!n.signalType||ze(e.supportedSignals).includes(n.signalType))):e,rc=({option:e,formData:n,testResult:o,isSelected:i,onSelect:a})=>t(ss,{icon:Tt(e.type).icon,title:n?.name||e.displayName,withCarret:!0,purpleColors:!!n,isSelected:i,onClick:()=>a(),children:o&&t(ce,{status:o.succeeded?_e.Success:_e.Error,leftIcon:o.succeeded?nl:ol})}),sc=({listType:e,destinationOptions:n,unsavedDestinations:o})=>{const{activeForm:i,onChangeActiveForm:a}=Cr();return n?.length?t(ac,{title:wt[e].TITLE,tooltip:wt[e].DESCRIPTION,list:n.map((n,o)=>t(rc,{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(ac,{purpleColors:!0,title:wt[e].TITLE,tooltip:wt[e].DESCRIPTION,list:o.map(({option:n,formData:o,testResult:l},r)=>t(rc,{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 cc;(e=>{e.SELF_HOSTED="self hosted",e.MANAGED="managed"})(cc||(cc={}));const dc=(e,t)=>{const n=[],o=[],i=[];return e&&e.destinationCategories.categories.forEach(e=>{e.name===cc.SELF_HOSTED?o.push(...e.items):e.name===cc.MANAGED&&i.push(...e.items)}),t&&t?.potentialDestinations.forEach(t=>{for(const o of e?.destinationCategories?.categories||[]){const e=kt(o),i=e.items.findIndex(e=>e.type===t.type);if(-1!==i){const o=It(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]))}}}),{[vt.DETECTED]:n,[vt.SELF_HOSTED]:o,[vt.MANAGED]:i}},pc=({onClose:e,onBack:n,onNext:o,selectedConnectionIds:r,setSelectedConnectionIds:s,initialInputs:c,withOverlay:p,disableAnimation:u})=>{const{destinationsApi:h}=yr(),[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}=Cr();a(()=>{c&&I(c)},[c]);const N=C||x,E=i(()=>y?.destinationCategories?.categories??[],[y]),[O,$]=l({[vt.ALL]:[],[vt.UNSAVED]:[],[vt.EXISTS]:[],[vt.DETECTED]:[],[vt.SELF_HOSTED]:[],[vt.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=It(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,[vt.EXISTS]:e}))},[v,E]),a(()=>{(y||S)&&$(e=>({...e,...dc(y,S)}))},[y,S]);const A=d(async()=>{for(const{option:e,formData:t}of k){const n=Xe(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}=Cr();return{width:"40%",list:i(()=>{const i=[];l.length&&i.push(t(sc,{listType:vt.UNSAVED,unsavedDestinations:l},"unsaved"));for(const e of Object.values(vt)){if(a.categoryType&&a.categoryType!==e)continue;const l=lc(n[e],o,a);l.length&&i.push(t(sc,{listType:e,destinationOptions:l},e))}return e&&i.push(t(bt,{$height:"100%",children:t(xt,{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}=Cr();return{width:"60%",list:e?[t(Ps,{},e.option.type)]:[t(bt,{$height:"100%",children:t($e,{icon:Qa,title:"Select destination from the list",subTitle:"Add destination so your data has somewhere to go."})},"no-data")]}})();return t(cr,{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:ot.CREATING_DESTINATION,subTitle:ot.CREATING_DESTINATION_SUBTITLE},header:{icon:Qa,title:ot.ADD_DESTINATIONS,subTitle:ot.ADD_DESTINATION_DRAWER_DESCRIPTION},connectionIds:r&&s?{value:r,setValue:s}:void 0,search:{value:m,onChange:g},filters:t(nc,{destinationsByCategory:O,filters:f,setFilters:b}),leftColumn:R,rightColumn:D})},uc=({onClose:e,selectedConnectionIds:n,setSelectedConnectionIds:o,withOverlay:a})=>{const{isEnterprise:r}=S(),{instrumentationRulesApi:s}=yr(),[c,d]=l(""),u=p(null),{selectedOption:h,onSelectOption:m,genericForm:g,validateFormData:f}=Sr(),{options:b,loading:v}=s.useRuleTypes(),y=i(()=>b.length?b:Nt,[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(ss,{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(Us,{},h.type)]:[t(bt,{$height:"100%",children:t($e,{icon:il,title:"Instrumentation rule not selected",subTitle:"Please select an instrumentation rule to add"})},"no-data")],[v,h]);return t(cr,{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:r?void 0:{fullWidth:!0,status:_e.Warning,message:"This feature is only supported for OnPrem (Enterprise) installations"},progress:{title:ot.CREATING_INSTRUMENTATION_RULE,subTitle:ot.CREATING_INSTRUMENTATION_RULE_SUBTITLE},header:{icon:il,title:ot.ADD_INSTRUMENTATION_RULE,subTitle:ot.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}})},hc={groupSegmentLabel:"Namespace",itemSegmentLabel:"Source",searchPlaceholder:()=>{},groupColumnHeader:"Namespaces",fetchingGroups:{title:ot.FETCHING_NAMESPACES,subTitle:ot.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:ot.SELECT_NAMESPACE,subTitle:ot.SELECT_NAMESPACE_SUBTITLE},noItemsInGroupSubTitle:"No sources found in this namespace"},mc={groupSegmentLabel:"Kind",itemSegmentLabel:"Source",searchPlaceholder:e=>"Search by "+(e===Et.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"},gc=e=>e?mc:hc,fc="No matches",bc=e=>(e?"Unselect":"Select")+" all",vc="Selected",yc=b.div``,Cc=b.div`
80
80
  visibility: hidden;
81
81
 
82
82
  transition: visibility 0s;
@@ -87,7 +87,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
87
87
  ${yc}:hover & {
88
88
  visibility: visible;
89
89
  }
90
- `,Sc=({workloadName:e,workloadKind:n,isChecked:o,onToggle:i,disabled:a})=>{const l=v(),r=()=>{};return t(yc,{children:t(ss,{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(Cc,{children:t(ce,{label:n,status:Pe.Info,textSize:te.XXXS,backgroundColor:l.v2.colors.blue[900]})})})})},xc=b.div``,wc=b.div`
90
+ `,Sc=({workloadName:e,workloadKind:n,isChecked:o,onToggle:i,disabled:a})=>{const l=v(),r=()=>{};return t(yc,{children:t(ss,{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:_e.Default,textSize:te.XXXS})}):t(Cc,{children:t(ce,{label:n,status:_e.Info,textSize:te.XXXS,backgroundColor:l.v2.colors.blue[900]})})})})},xc=b.div``,wc=b.div`
91
91
  display: grid;
92
92
  /* Auto: "Auto" label + S toggle ≈ 72px. Selected: label + count badge ≈ 110px. */
93
93
  grid-template-columns: ${({$withAuto:e})=>e?"72px 110px":"110px"};
@@ -119,7 +119,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
119
119
  justify-content: flex-end;
120
120
  align-items: center;
121
121
  min-width: 0;
122
- `,Ic=({clusterId:n,namespaceName:o,checkbox:i,isFutureApps:a,selectedCounts:l,isActive:r,onActive:s,handleSourceChange:c})=>{const{capabilities:d}=yr(),p=d.canInstrumentNamespaces,u=e=>{s(),c({clusterId:n,workloadId:{namespace:o},auto:e.auto,selected:e.all})};return t(xc,{children:t(ss,{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(wc,{$withAuto:p,children:[p&&t(Tc,{$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:Ot.S,value:a,onChange:e=>u({auto:e,all:e||void 0})})})}),e(kc,{children:[t(ee,{variant:$t.Span,size:te.XXXS,color:ne.Secondary,align:"right",nowrap:!0,children:vc}),t(ce,{label:`${l.sourced}/${l.total}`,status:r?Pe.Default:Pe.Unknown,minWidth:"42px"})]})]})})})},Ec=({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(Ic,{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(ac,{title:o,list:c,noBgColor:!0}):c},Nc=({onClose:n,onBack:o,onNext:r,selectedConnectionIds:s,setSelectedConnectionIds:c,withOverlay:d,disableAnimation:p})=>{const{isK8s:u}=S(),{sourcesApi:h,snapshotsApi:m,namespacesApi:g}=yr(),{data:f,loading:b,pending:v,refetch:y}=m.useSnapshots(),{items:C,loading:x}=g.useNamespaces({skip:v||!!f}),w=gc(!u),{selectedStreamName:T}=it(),{progress:k,resetProgress:I}=At(),{isFetching:E,setIsFetching:N,setSnapshots:O,formData:$,handleSourceChange:A,handleSelectAll:R,formDiff:D,isFormDirty:_}=$r();a(()=>{y()},[]);const P=i(()=>{if(f)return f;const e=C;return e.length?{clusters:[{clusterId:Dt,clusterName:Rt,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,C,T]);a(()=>{N(b||x),P&&O(P)},[P,b,x,N,O]);const[L,F]=l(""),[M,z]=l(Nt.Namespace),[X,B]=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=gc(!u),m=i(()=>o.map(e=>{const t=[...e.namespaces].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Nr(e,c,p)).map(e=>({name:e.name,totalWorkloads:e.workloads.length,...Or(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(Ec,{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?ot.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:bc(g)})]}),list:f.length?f:n?[t(bt,{$height:"100%",children:t(xt,{title:h.fetchingGroups.title,subTitle:h.fetchingGroups.subTitle,withSpinner:!0})},"loading")]:[t(bt,{$height:"100%",children:t($e,c?{icon:ll,title:fc,subTitle:h.noGroupMatchedFilter(c)}:{icon:ll,title:h.noGroups.title,subTitle:h.noGroups.subTitle})},"no-data")]}})({isFetching:E,formData:$,handleSourceChange:A,handleSelectAll:R,selectedArea:U,setSelectedArea:V,searchText:M===Nt.Namespace?L:"",searchBy:M,filters:X}),j=(({formData:n,handleSourceChange:o,handleSelectAll:a,selectedArea:l,searchText:r,searchBy:s,filters:c})=>{const{isK8s:d,isEnterprise:p}=S(),u=gc(!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=>Ir(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(Sc,{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?ot.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:bc(g)})]}),list:f.length?f:[t(bt,{$height:"100%",children:t($e,h?r?{icon:al,title:fc,subTitle:(C=r,`No sources matched the filter '${C}'`)}:{icon:al,title:"No sources",subTitle:u.noItemsInGroupSubTitle}:{icon:al,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:X});return t(cr,{isOpen:!0,withOverlay:d,disableAnimation:p,onClose:n?()=>{I(_t.BulkInstrumenting),n()}:void 0,onBack:o?()=>o(D):void 0,onNext:r?()=>r(D):void 0,nextIsSkip:!_,onSave:()=>h.persistV2(D),header:{icon:al,title:ot.ADD_SOURCE,subTitle:ot.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:Ot.S,label:vc,value:X.showOnlySelected,onChange:e=>B(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:_,isFetching:E,progress:{title:ot.CREATING_SOURCES,subTitle:ot.CREATING_SOURCES_SUBTITLE,percentage:k[_t.BulkInstrumenting]?.percentage||0},leftColumn:H,rightColumn:j})},Oc={aws:cl,gcp:sl,azure:rl},$c={lambda:"Lambda","fargate-task":"ECS","fargate-cluster":"ECS","ecs-cluster":"ECS",eks:"EKS",ec2:"EC2"},Ac=e=>e.split(/[-_]/).map(e=>e?e[0].toUpperCase()+e.slice(1):e).join(" "),Rc=e=>e.provider.toUpperCase(),Dc=b.div`
122
+ `,Ic=({clusterId:n,namespaceName:o,checkbox:i,isFutureApps:a,selectedCounts:l,isActive:r,onActive:s,handleSourceChange:c})=>{const{capabilities:d}=yr(),p=d.canInstrumentNamespaces,u=e=>{s(),c({clusterId:n,workloadId:{namespace:o},auto:e.auto,selected:e.all})};return t(xc,{children:t(ss,{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(wc,{$withAuto:p,children:[p&&t(Tc,{$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:Ot.S,value:a,onChange:e=>u({auto:e,all:e||void 0})})})}),e(kc,{children:[t(ee,{variant:$t.Span,size:te.XXXS,color:ne.Secondary,align:"right",nowrap:!0,children:vc}),t(ce,{label:`${l.sourced}/${l.total}`,status:r?_e.Default:_e.Unknown,minWidth:"42px"})]})]})})})},Nc=({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(Ic,{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(ac,{title:o,list:c,noBgColor:!0}):c},Ec=({onClose:n,onBack:o,onNext:r,selectedConnectionIds:s,setSelectedConnectionIds:c,withOverlay:d,disableAnimation:p})=>{const{isK8s:u}=S(),{sourcesApi:h,snapshotsApi:m,namespacesApi:g}=yr(),{data:f,loading:b,pending:v,refetch:y}=m.useSnapshots(),{items:C,loading:x}=g.useNamespaces({skip:v||!!f}),w=gc(!u),{selectedStreamName:T}=it(),{progress:k,resetProgress:I}=At(),{isFetching:N,setIsFetching:E,setSnapshots:O,formData:$,handleSourceChange:A,handleSelectAll:R,formDiff:D,isFormDirty:P}=$r();a(()=>{y()},[]);const _=i(()=>{if(f)return f;const e=C;return e.length?{clusters:[{clusterId:Dt,clusterName:Rt,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,C,T]);a(()=>{E(b||x),_&&O(_)},[_,b,x,E,O]);const[L,F]=l(""),[M,z]=l(Et.Namespace),[X,B]=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=gc(!u),m=i(()=>o.map(e=>{const t=[...e.namespaces].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Er(e,c,p)).map(e=>({name:e.name,totalWorkloads:e.workloads.length,...Or(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(Nc,{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?ot.FILTERED_COUNT_TOOLTIP:void 0,children:t(ce,{label:`${b?`${v} / ${y}`:y}`,status:_e.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:bc(g)})]}),list:f.length?f:n?[t(bt,{$height:"100%",children:t(xt,{title:h.fetchingGroups.title,subTitle:h.fetchingGroups.subTitle,withSpinner:!0})},"loading")]:[t(bt,{$height:"100%",children:t($e,c?{icon:ll,title:fc,subTitle:h.noGroupMatchedFilter(c)}:{icon:ll,title:h.noGroups.title,subTitle:h.noGroups.subTitle})},"no-data")]}})({isFetching:N,formData:$,handleSourceChange:A,handleSelectAll:R,selectedArea:U,setSelectedArea:V,searchText:M===Et.Namespace?L:"",searchBy:M,filters:X}),j=(({formData:n,handleSourceChange:o,handleSelectAll:a,selectedArea:l,searchText:r,searchBy:s,filters:c})=>{const{isK8s:d,isEnterprise:p}=S(),u=gc(!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=>Ir(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&&Nr.has(l);return t(Sc,{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?ot.FILTERED_COUNT_TOOLTIP:void 0,children:t(ce,{label:`${b?`${v} / ${y}`:y}`,status:_e.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:bc(g)})]}),list:f.length?f:[t(bt,{$height:"100%",children:t($e,h?r?{icon:al,title:fc,subTitle:(C=r,`No sources matched the filter '${C}'`)}:{icon:al,title:"No sources",subTitle:u.noItemsInGroupSubTitle}:{icon:al,title:u.selectGroupPrompt.title,subTitle:u.selectGroupPrompt.subTitle})},"no-data")]};var C})({formData:$,handleSourceChange:A,handleSelectAll:R,selectedArea:{value:U},searchText:M===Et.Source?L:"",searchBy:M,filters:X});return t(cr,{isOpen:!0,withOverlay:d,disableAnimation:p,onClose:n?()=>{I(Pt.BulkInstrumenting),n()}:void 0,onBack:o?()=>o(D):void 0,onNext:r?()=>r(D):void 0,nextIsSkip:!P,onSave:()=>h.persistV2(D),header:{icon:al,title:ot.ADD_SOURCE,subTitle:ot.ADD_SOURCES_DESCRIPTION},connectionIds:s&&c?{value:s,setValue:c}:void 0,search:{value:L,onChange:e=>{F(e),M===Et.Namespace&&V({clusterId:"",clusterName:"",namespaceName:""})},placeholder:w.searchPlaceholder(M),segment:{options:[{label:w.groupSegmentLabel,value:Et.Namespace},{label:w.itemSegmentLabel,value:Et.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:Ot.S,label:vc,value:X.showOnlySelected,onChange:e=>B(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:P,isFetching:N,progress:{title:ot.CREATING_SOURCES,subTitle:ot.CREATING_SOURCES_SUBTITLE,percentage:k[Pt.BulkInstrumenting]?.percentage||0},leftColumn:H,rightColumn:j})},Oc={aws:cl,gcp:sl,azure:rl},$c={lambda:"Lambda","fargate-task":"ECS","fargate-cluster":"ECS","ecs-cluster":"ECS",eks:"EKS",ec2:"EC2"},Ac=e=>e.split(/[-_]/).map(e=>e?e[0].toUpperCase()+e.slice(1):e).join(" "),Rc=e=>e.provider.toUpperCase(),Dc=b.div`
123
123
  display: flex;
124
124
  flex-direction: column;
125
125
  gap: 8px;
@@ -127,7 +127,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
127
127
  padding: 8px 12px;
128
128
  border-radius: 16px 0 0 16px;
129
129
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
130
- `,_c=b.button`
130
+ `,Pc=b.button`
131
131
  display: flex;
132
132
  align-items: center;
133
133
  gap: 12px;
@@ -143,7 +143,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
143
143
  &:hover {
144
144
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
145
145
  }
146
- `,Pc=b.div`
146
+ `,_c=b.div`
147
147
  display: flex;
148
148
  align-items: center;
149
149
  justify-content: center;
@@ -158,7 +158,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
158
158
  gap: 2px;
159
159
  flex: 1;
160
160
  min-width: 0;
161
- `,Fc=({providers:n,selectedProvider:o,onSelect:i})=>{const a=v();return n.length?t(Dc,{children:n.map(n=>{const l=(e=>Oc[e.provider]??dl)(n),r=n.provider===o,s=(e=>{const t=e.features.find(e=>e.key===Pt.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=$c[t]??Ac(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(Pc,{children:t(l,{size:24})}),e(Lc,{children:[t(ee,{size:te.S,weight:400,lineHeight:"24px",color:ne.Primary,children:Rc(n)}),s&&t(ee,{size:te.XXXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:s})]}),t(Xa,{size:18,fill:a.v2.colors.silver[300]})]},n.provider)})}):t(ee,{size:te.XS,color:ne.Secondary,children:"No providers available."})},Mc=b.div`
161
+ `,Fc=({providers:n,selectedProvider:o,onSelect:i})=>{const a=v();return n.length?t(Dc,{children:n.map(n=>{const l=(e=>Oc[e.provider]??dl)(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=$c[t]??Ac(t);o.has(i)||(o.add(i),n.push(i))}return n.join(", ")})(n);return e(Pc,{type:"button",$selected:r,onClick:()=>i(n.provider),"data-id":`cloud-connector-provider-${n.provider}`,children:[t(_c,{children:t(l,{size:24})}),e(Lc,{children:[t(ee,{size:te.S,weight:400,lineHeight:"24px",color:ne.Primary,children:Rc(n)}),s&&t(ee,{size:te.XXXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:s})]}),t(Xa,{size:18,fill:a.v2.colors.silver[300]})]},n.provider)})}):t(ee,{size:te.XS,color:ne.Secondary,children:"No providers available."})},Mc=b.div`
162
162
  display: flex;
163
163
  flex-direction: column;
164
164
  gap: 8px;
@@ -212,25 +212,25 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
212
212
  line-height: 20px;
213
213
  color: ${({theme:e})=>e.v2.colors.green[400]};
214
214
  white-space: pre;
215
- `,Vc=({policy:n})=>{const o=v(),{CopyButton:i}=Lt();return e(Mc,{children:[e(zc,{children:[t(pl,{size:16,fill:o.v2.colors.silver[200]}),t(Xc,{children:t(ee,{size:te.XXS,color:ne.Primary,children:ot.CLOUD_CONNECTOR_POLICY_PREVIEW})}),t(i,{value:n,size:St.XS})]}),t(Bc,{children:t(Uc,{children:n})})]})},Hc="{{permissions}}";var jc;(e=>{e.DiscoveryOnly="discovery-only",e.DiscoveryInstrumentation="discovery-instrumentation",e.Custom="custom"})(jc||(jc={}));const Gc=[{id:jc.DiscoveryOnly,title:ot.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_ONLY_TITLE,description:ot.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_ONLY_DESC,featureKeys:[Pt.Discovery]},{id:jc.DiscoveryInstrumentation,title:ot.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_INSTRUMENTATION_TITLE,description:ot.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_INSTRUMENTATION_DESC,featureKeys:[Pt.Discovery,Pt.Instrumentation]},{id:jc.Custom,title:ot.CLOUD_CONNECTOR_PERMISSION_CUSTOM_TITLE,description:ot.CLOUD_CONNECTOR_PERMISSION_CUSTOM_DESC,featureKeys:[]}],Wc=(e,t)=>e.features?.find(e=>e.key===t),Kc=e=>{if(!e)return[];const t=Wc(e,Pt.Discovery),n=Wc(e,Pt.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}}):[]},Yc=()=>{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===jc.Custom?((e,t)=>{if(!e)return[];const n=Kc(e),o=Wc(e,Pt.Discovery),i=n.some(e=>t[e.typeName]?.discovery),{out:a,add:l}=Yc();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=Gc.find(e=>e.id===t)?.featureKeys??[],{out:o,add:i}=Yc();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=(e=>(e?.setup?.artifacts??[]).find(e=>"permissions"===e.section&&"policy-preview"===e.id))(e);return i?((e,t)=>{const{template:n,itemTemplate:o,itemSeparator:i}=e,a=n.split("\n"),l=a.findIndex(e=>e.includes(Hc));if(-1===l)return n;const r=a[l],s=r.slice(0,r.indexOf(Hc));return 0===t.permissions.length?a.splice(l,1):a[l]=t.permissions.map(e=>{return s+(t=e,o.split("{{permission}}").join(t));var t}).join(i),a.join("\n")})(i,{permissions:o}):qc(o)},qc=e=>{const t={Version:"2012-10-17",Statement:[{Sid:"OdigosCloudConnector",Effect:"Allow",Action:e,Resource:"*"}]};return JSON.stringify(t,null,2)},Zc=b.div`
215
+ `,Vc=({policy:n})=>{const o=v(),{CopyButton:i}=Lt();return e(Mc,{children:[e(zc,{children:[t(pl,{size:16,fill:o.v2.colors.silver[200]}),t(Xc,{children:t(ee,{size:te.XXS,color:ne.Primary,children:ot.CLOUD_CONNECTOR_POLICY_PREVIEW})}),t(i,{value:n,size:St.XS})]}),t(Bc,{children:t(Uc,{children:n})})]})},Hc="{{permissions}}",jc=/\{\{(\w+)\}\}/g,Gc="create-role",Wc=(e,t,n)=>(e?.setup?.artifacts??[]).find(e=>e.section===t&&(!n||e.id===n)),Kc=(e,t)=>(e?.setup?.artifacts??[]).filter(e=>e.section===t),Yc=(e,t)=>{const n=new Set,o=[];return Kc(e,t).forEach(e=>{e.variant&&!n.has(e.variant)&&(n.add(e.variant),o.push({id:e.variant,label:e.variantLabel||e.variant}))}),o},Jc=(e,t,n)=>Kc(e,t).find(e=>e.variant===n),qc=(e,t={})=>{const n=((e,t,n)=>{const o=e.split("\n"),i=o.findIndex(e=>e.includes(Hc));if(-1===i)return e;const a=o[i],l=a.slice(0,a.indexOf(Hc)),r=t.itemTemplate||"{{permission}}",s=t.itemSeparator??"\n";return 0===n.length?o.splice(i,1):o[i]=n.map(e=>{return l+(t=e,r.split("{{permission}}").join(t));var t}).join(s),o.join("\n")})(e.template??"",e,t.permissions??[]);return((e,t)=>e.replace(jc,(e,n)=>Object.prototype.hasOwnProperty.call(t,n)?t[n]:e))(n,t.vars??{})};var Zc;(e=>{e.DiscoveryOnly="discovery-only",e.DiscoveryInstrumentation="discovery-instrumentation",e.Custom="custom"})(Zc||(Zc={}));const Qc=[{id:Zc.DiscoveryOnly,title:ot.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_ONLY_TITLE,description:ot.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_ONLY_DESC,featureKeys:[_t.Discovery]},{id:Zc.DiscoveryInstrumentation,title:ot.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_INSTRUMENTATION_TITLE,description:ot.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_INSTRUMENTATION_DESC,featureKeys:[_t.Discovery,_t.Instrumentation]},{id:Zc.Custom,title:ot.CLOUD_CONNECTOR_PERMISSION_CUSTOM_TITLE,description:ot.CLOUD_CONNECTOR_PERMISSION_CUSTOM_DESC,featureKeys:[]}],ed=(e,t)=>e.features?.find(e=>e.key===t),td=e=>{if(!e)return[];const t=ed(e,_t.Discovery),n=ed(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}}):[]},nd=()=>{const e=new Set,t=[];return{out:t,add:n=>n?.forEach(n=>{n&&!e.has(n)&&(e.add(n),t.push(n))})}},od=(e,t)=>{if(!e)return[];const n=Qc.find(e=>e.id===t)?.featureKeys??[],{out:o,add:i}=nd();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},id=(e,t)=>{if(!e)return[];const n=td(e),o=ed(e,_t.Discovery),i=n.some(e=>t[e.typeName]?.discovery),{out:a,add:l}=nd();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},ad=(e,t,n)=>{const o=t===Zc.Custom?id(e,n??{}):od(e,t),i=Wc(e,"permissions","policy-preview");return i?qc(i,{permissions:o}):""},ld=b.div`
216
216
  width: 100%;
217
217
  padding: 12px 16px;
218
218
  border-radius: 12px;
219
219
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
220
220
  border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
221
- `,Qc=b.div`
221
+ `,rd=b.div`
222
222
  display: grid;
223
223
  grid-template-columns: minmax(0, 1fr) 120px 150px;
224
224
  align-items: center;
225
225
  row-gap: 16px;
226
226
  column-gap: 8px;
227
- `,ed=b.div`
227
+ `,sd=b.div`
228
228
  display: flex;
229
229
  align-items: center;
230
230
  min-width: 0;
231
- `,td=b(ed)`
231
+ `,cd=b(sd)`
232
232
  justify-content: center;
233
- `,nd={discovery:!1,instrumentation:!1},od=({provider:n,capabilities:i,onCapabilitiesChange:a})=>{const l=Kc(n),r=(e,t)=>{a({...i,[e]:t})};return l.length?t(Zc,{children:e(Qc,{children:[t(ed,{children:t(ee,{size:te.XXS,color:ne.Secondary,children:ot.CLOUD_CONNECTOR_CUSTOM_COL_TYPE})}),t(td,{children:t(ee,{size:te.XXS,color:ne.Secondary,children:ot.CLOUD_CONNECTOR_CUSTOM_COL_DISCOVERY})}),t(td,{children:t(ee,{size:te.XXS,color:ne.Secondary,children:ot.CLOUD_CONNECTOR_CUSTOM_COL_INSTRUMENTATION})}),l.map(n=>{const a=i[n.typeName]??nd,l=void 0!==n.instrumentationPermissions,s=a.instrumentation||a.discovery;return e(o.Fragment,{children:[t(ed,{children:t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ne.Primary,children:n.displayName})}),t(td,{children:t(ge,{name:`cloud-connector-custom-${n.typeName}-discovery`,size:Ot.S,value:s,disabled:a.instrumentation,onChange:e=>r(n.typeName,{discovery:e,instrumentation:a.instrumentation})})}),t(td,{children:t(ge,{name:`cloud-connector-custom-${n.typeName}-instrumentation`,size:Ot.S,value:a.instrumentation,disabled:!l,onChange:e=>r(n.typeName,{discovery:!!e||a.discovery,instrumentation:e})})})]},n.typeName)})]})}):null},id=b.div`
233
+ `,dd={discovery:!1,instrumentation:!1},pd=({provider:n,capabilities:i,onCapabilitiesChange:a})=>{const l=td(n),r=(e,t)=>{a({...i,[e]:t})};return l.length?t(ld,{children:e(rd,{children:[t(sd,{children:t(ee,{size:te.XXS,color:ne.Secondary,children:ot.CLOUD_CONNECTOR_CUSTOM_COL_TYPE})}),t(cd,{children:t(ee,{size:te.XXS,color:ne.Secondary,children:ot.CLOUD_CONNECTOR_CUSTOM_COL_DISCOVERY})}),t(cd,{children:t(ee,{size:te.XXS,color:ne.Secondary,children:ot.CLOUD_CONNECTOR_CUSTOM_COL_INSTRUMENTATION})}),l.map(n=>{const a=i[n.typeName]??dd,l=void 0!==n.instrumentationPermissions,s=a.instrumentation||a.discovery;return e(o.Fragment,{children:[t(sd,{children:t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ne.Primary,children:n.displayName})}),t(cd,{children:t(ge,{name:`cloud-connector-custom-${n.typeName}-discovery`,size:Ot.S,value:s,disabled:a.instrumentation,onChange:e=>r(n.typeName,{discovery:e,instrumentation:a.instrumentation})})}),t(cd,{children:t(ge,{name:`cloud-connector-custom-${n.typeName}-instrumentation`,size:Ot.S,value:a.instrumentation,disabled:!l,onChange:e=>r(n.typeName,{discovery:!!e||a.discovery,instrumentation:e})})})]},n.typeName)})]})}):null},ud=b.div`
234
234
  display: flex;
235
235
  flex-direction: column;
236
236
  gap: 8px;
@@ -239,12 +239,12 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
239
239
  padding: 8px;
240
240
  border-radius: 0 16px 16px 0;
241
241
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
242
- `,ad=b.div`
242
+ `,hd=b.div`
243
243
  display: flex;
244
244
  flex-direction: column;
245
245
  gap: 8px;
246
246
  width: 100%;
247
- `,ld=b.div`
247
+ `,md=b.div`
248
248
  display: flex;
249
249
  align-items: center;
250
250
  gap: 10px;
@@ -252,7 +252,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
252
252
  padding: 4px 12px 4px 4px;
253
253
  border-radius: 8px;
254
254
  background-color: ${({theme:e})=>e.v2.colors.purple[900]};
255
- `,rd=b.div`
255
+ `,gd=b.div`
256
256
  display: flex;
257
257
  align-items: center;
258
258
  justify-content: center;
@@ -261,30 +261,30 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
261
261
  border-radius: 6px;
262
262
  flex-shrink: 0;
263
263
  background-color: ${({theme:e})=>e.v2.colors.purple[800]};
264
- `,sd=({message:n})=>{const o=v();return e(ld,{children:[t(rd,{children:t(ul,{fill:"#B08BFD",size:24})}),t(ee,{size:te.XXS,color:o.v2.colors.purple[300],children:n})]})},cd=({provider:n,selectedPermission:o,onSelect:i,capabilities:a,onCapabilitiesChange:l})=>t(id,{children:Gc.map(r=>{const s=r.id===o,c=r.id===jc.Custom,d=s?e(ad,{children:[c&&t(od,{provider:n,capabilities:a,onCapabilitiesChange:l}),t(Vc,{policy:Jc(n,r.id,a)})]}):void 0,p=s?t(sd,{message:c?ot.CLOUD_CONNECTOR_POLICY_NOTE_CUSTOM:ot.CLOUD_CONNECTOR_POLICY_NOTE}):void 0;return t(Ft,{"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)})}),dd=b.div`
264
+ `,fd=({message:n})=>{const o=v();return e(md,{children:[t(gd,{children:t(ul,{fill:"#B08BFD",size:24})}),t(ee,{size:te.XXS,color:o.v2.colors.purple[300],children:n})]})},bd=({provider:n,selectedPermission:o,onSelect:i,capabilities:a,onCapabilitiesChange:l})=>t(ud,{children:Qc.map(r=>{const s=r.id===o,c=r.id===Zc.Custom,d=s?e(hd,{children:[c&&t(pd,{provider:n,capabilities:a,onCapabilitiesChange:l}),t(Vc,{policy:ad(n,r.id,a)})]}):void 0,p=s?t(fd,{message:c?ot.CLOUD_CONNECTOR_POLICY_NOTE_CUSTOM:ot.CLOUD_CONNECTOR_POLICY_NOTE}):void 0;return t(Ft,{"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)})}),vd=b.div`
265
265
  display: flex;
266
266
  flex-direction: column;
267
267
  padding: 16px;
268
- `,pd=b.div`
268
+ `,yd=b.div`
269
269
  display: flex;
270
270
  flex-direction: column;
271
271
  gap: 16px;
272
272
  padding: 16px;
273
273
  border-radius: 16px;
274
274
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
275
- `,ud=b.div`
275
+ `,Cd=b.div`
276
276
  display: flex;
277
277
  flex-direction: column;
278
278
  gap: 4px;
279
- `,hd=b.div`
279
+ `,Sd=b.div`
280
280
  display: flex;
281
281
  align-items: stretch;
282
282
  width: 100%;
283
- `,md=b.div`
283
+ `,xd=b.div`
284
284
  display: flex;
285
285
  flex: 0 0 40%;
286
286
  min-width: 0;
287
- `,gd=()=>{const{providers:n,genericForm:o}=Ar(),[r,s]=l(!0),c=i(()=>n.find(e=>e.provider===o.formData.provider),[n,o.formData.provider]),p=d(e=>{e!==o.formData.provider&&o.handleFormChange(void 0,void 0,{...o.formData,provider:e,authMethod:"",setupMethod:"",accountId:"",credentials:{},customCapabilities:{}})},[o]);return a(()=>{!o.formData.provider&&n.length>0&&p(n[0].provider)},[n,o.formData.provider,p]),a(()=>{o.formData.permission||o.handleFormChange("permission",jc.DiscoveryInstrumentation)},[o.formData.permission,o]),t(dd,{children:e(pd,{children:[e(ud,{children:[t(ee,{size:te.S,weight:500,lineHeight:"24px",color:ne.Primary,children:ot.CLOUD_CONNECTOR_SELECT_PROVIDER_TITLE}),t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:ot.CLOUD_CONNECTOR_SELECT_PROVIDER_SUBTITLE})]}),r&&t(_e,{fullWidth:!0,maxWidth:"800px",smallIcon:!0,status:Pe.Info,message:ot.CLOUD_CONNECTOR_PERMISSIONS_NOTE,action:{"data-id":"cloud-connector-permissions-note-close",label:Mt.CLOSE,onClick:()=>s(!1)}}),e(hd,{children:[t(md,{children:t(Fc,{providers:n,selectedProvider:o.formData.provider,onSelect:p})}),t(cd,{provider:c,selectedPermission:o.formData.permission,onSelect:e=>o.handleFormChange("permission",e),capabilities:o.formData.customCapabilities,onCapabilitiesChange:e=>o.handleFormChange("customCapabilities",e)})]})]})})},fd=b.div`
287
+ `,wd=()=>{const{providers:n,genericForm:o}=Ar(),[r,s]=l(!0),c=i(()=>n.find(e=>e.provider===o.formData.provider),[n,o.formData.provider]),p=d(e=>{e!==o.formData.provider&&o.handleFormChange(void 0,void 0,{...o.formData,provider:e,authMethod:"",setupMethod:"",accountId:"",credentials:{},customCapabilities:{}})},[o]);return a(()=>{!o.formData.provider&&n.length>0&&p(n[0].provider)},[n,o.formData.provider,p]),a(()=>{o.formData.permission||o.handleFormChange("permission",Zc.DiscoveryInstrumentation)},[o.formData.permission,o]),t(vd,{children:e(yd,{children:[e(Cd,{children:[t(ee,{size:te.S,weight:500,lineHeight:"24px",color:ne.Primary,children:ot.CLOUD_CONNECTOR_SELECT_PROVIDER_TITLE}),t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:ot.CLOUD_CONNECTOR_SELECT_PROVIDER_SUBTITLE})]}),r&&t(Pe,{fullWidth:!0,maxWidth:"800px",smallIcon:!0,status:_e.Info,message:ot.CLOUD_CONNECTOR_PERMISSIONS_NOTE,action:{"data-id":"cloud-connector-permissions-note-close",label:Mt.CLOSE,onClick:()=>s(!1)}}),e(Sd,{children:[t(xd,{children:t(Fc,{providers:n,selectedProvider:o.formData.provider,onSelect:p})}),t(bd,{provider:c,selectedPermission:o.formData.permission,onSelect:e=>o.handleFormChange("permission",e),capabilities:o.formData.customCapabilities,onCapabilitiesChange:e=>o.handleFormChange("customCapabilities",e)})]})]})})},Td=b.div`
288
288
  display: flex;
289
289
  flex-direction: column;
290
290
  gap: 16px;
@@ -292,12 +292,12 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
292
292
  padding: 12px;
293
293
  border-radius: 8px;
294
294
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
295
- `,bd=b.div`
295
+ `,kd=b.div`
296
296
  display: flex;
297
297
  align-items: center;
298
298
  gap: 12px;
299
299
  width: 100%;
300
- `,vd=b.div`
300
+ `,Id=b.div`
301
301
  display: flex;
302
302
  align-items: center;
303
303
  justify-content: center;
@@ -306,59 +306,41 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
306
306
  height: 24px;
307
307
  border-radius: 16px;
308
308
  background-color: ${({theme:e})=>e.v2.colors.purple[500]};
309
- `,yd=b.div`
309
+ `,Nd=b.div`
310
310
  display: flex;
311
311
  flex: 1;
312
312
  flex-direction: column;
313
313
  gap: 2px;
314
314
  min-width: 0;
315
- `,Cd=b.div`
315
+ `,Ed=b.div`
316
316
  display: flex;
317
317
  flex-direction: column;
318
318
  gap: 10px;
319
319
  width: 100%;
320
320
  padding-left: 32px;
321
- `,Sd=({"data-id":n,step:o,title:i,description:a,children:l})=>e(fd,{"data-id":n,children:[e(bd,{children:[t(vd,{children:t(ee,{size:te.XXS,weight:400,lineHeight:"20px",color:ne.Primary,children:o})}),e(yd,{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(Cd,{children:l})]});var xd,wd;(e=>{e.AssumeRole="assume-role",e.StaticKeys="static-keys"})(xd||(xd={})),(e=>{e.CloudFormation="cloudformation",e.Terraform="terraform",e.AwsCli="aws-cli",e.Manual="manual"})(wd||(wd={}));const Td=[{id:xd.AssumeRole,label:ot.CLOUD_CONNECTOR_AUTH_ASSUME_ROLE,note:ot.CLOUD_CONNECTOR_AUTH_ASSUME_ROLE_NOTE},{id:xd.StaticKeys,label:ot.CLOUD_CONNECTOR_AUTH_STATIC_KEYS,note:ot.CLOUD_CONNECTOR_AUTH_STATIC_KEYS_NOTE}],kd=[{id:wd.CloudFormation,label:ot.CLOUD_CONNECTOR_SETUP_METHOD_CLOUDFORMATION},{id:wd.Terraform,label:ot.CLOUD_CONNECTOR_SETUP_METHOD_TERRAFORM},{id:wd.AwsCli,label:ot.CLOUD_CONNECTOR_SETUP_METHOD_AWS_CLI},{id:wd.Manual,label:ot.CLOUD_CONNECTOR_SETUP_METHOD_MANUAL}],Id={[wd.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")},[wd.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")},[wd.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")},[wd.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")}},Ed=(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},Nd=b.div`
322
- display: flex;
323
- flex-direction: column;
324
- gap: 16px;
325
- width: 100%;
326
- `,Od=b.div`
327
- display: flex;
328
- flex-wrap: wrap;
329
- gap: 24px;
330
- width: 100%;
331
- `,$d=b.div`
332
- display: flex;
333
- flex: 1 1 calc(50% - 12px);
334
- min-width: 0;
335
- `,Ad=b.div`
336
- display: flex;
337
- width: 100%;
338
- max-width: 479px;
339
- `,Rd=({step:n})=>{const{genericForm:o,providers:a}=Ar(),{provider:l,authMethod:r,accountId:s,credentials:c}=o.formData,d=i(()=>a.find(e=>e.provider===l),[a,l]),p=i(()=>Ed(d,r),[d,r]);return t(Sd,{"data-id":"cloud-connector-enter-arn",step:n,title:ot.CLOUD_CONNECTOR_ENTER_ARN_TITLE,description:ot.CLOUD_CONNECTOR_ENTER_ARN_SUBTITLE,children:e(Nd,{children:[t(Ad,{children:t(Ee,{name:"cloud-connector-aws-account-id",width:"100%",label:ot.CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_LABEL,placeholder:ot.CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_PLACEHOLDER,helpMessage:ot.CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_HELP,value:s,onChange:e=>o.handleFormChange("accountId",e.target.value)})}),p.length>0&&t(Od,{children:p.map(e=>t($d,{children:t(Ee,{name:`cloud-connector-credential-${e.name}`,width:"100%",type:e.secret?zt.Password:zt.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))})]})})},Dd=b.div`
321
+ `,Od=({"data-id":n,step:o,title:i,description:a,children:l})=>e(Td,{"data-id":n,children:[e(kd,{children:[t(Id,{children:t(ee,{size:te.XXS,weight:400,lineHeight:"20px",color:ne.Primary,children:o})}),e(Nd,{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(Ed,{children:l})]}),$d=b.div`
340
322
  display: flex;
341
323
  align-items: stretch;
342
324
  gap: 10px;
343
325
  width: 100%;
344
- `,_d=b.div`
326
+ `,Ad=b.div`
345
327
  display: flex;
346
328
  flex: 2 1 0;
347
329
  flex-direction: column;
348
330
  gap: 12px;
349
331
  min-width: 0;
350
332
  padding: 12px 0;
351
- `,Pd=b.div`
333
+ `,Rd=b.div`
352
334
  display: flex;
353
335
  flex-direction: column;
354
336
  gap: 8px;
355
337
  width: 100%;
356
- `,Ld=b.div`
338
+ `,Dd=b.div`
357
339
  display: flex;
358
340
  align-items: center;
359
341
  gap: 12px;
360
342
  width: 100%;
361
- `,Fd=b.div`
343
+ `,Pd=b.div`
362
344
  display: flex;
363
345
  align-items: center;
364
346
  justify-content: center;
@@ -367,7 +349,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
367
349
  height: 24px;
368
350
  border-radius: 16px;
369
351
  background-color: ${({theme:e})=>e.v2.colors.purple[700]};
370
- `,Md=b.div`
352
+ `,_d=b.div`
371
353
  display: flex;
372
354
  flex: 3 1 0;
373
355
  flex-direction: column;
@@ -376,42 +358,42 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
376
358
  border-radius: 12px;
377
359
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
378
360
  border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
379
- `,zd=b.div`
361
+ `,Ld=b.div`
380
362
  display: flex;
381
363
  align-items: center;
382
364
  justify-content: flex-end;
383
365
  width: 100%;
384
- `,Xd=b.div`
366
+ `,Fd=b.div`
385
367
  flex: 1;
386
368
  width: 100%;
387
369
  min-height: 200px;
388
370
  max-height: 260px;
389
371
  overflow: auto;
390
372
  padding: 0 12px 12px;
391
- `,Bd=b.pre`
373
+ `,Md=b.pre`
392
374
  margin: 0;
393
375
  font-family: ${({theme:e})=>e.font_family.code};
394
376
  font-size: 12px;
395
377
  line-height: 20px;
396
378
  color: ${({theme:e})=>e.v2.colors.green[400]};
397
379
  white-space: pre;
398
- `,Ud=({step:n,setupMethod:o})=>{const i=v(),{CopyButton:a}=Lt(),{description:l,steps:r,code:s}=(e=>Id[e]??Id[wd.CloudFormation])(o);return t(Sd,{"data-id":"cloud-connector-create-role",step:n,title:ot.CLOUD_CONNECTOR_CREATE_ROLE_TITLE,description:l,children:e(Dd,{children:[e(_d,{children:[t(ee,{size:te.XXS,weight:400,lineHeight:"20px",color:ne.Primary,children:ot.CLOUD_CONNECTOR_CREATE_ROLE_STEPS_HEADING}),t(Pd,{children:r.map((n,a)=>e(Ld,{children:[t(Fd,{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(Md,{children:[t(zd,{children:t(a,{value:s,size:St.XS})}),t(Xd,{children:t(Bd,{children:s})})]})]})})},Vd=b.div`
380
+ `,zd=({step:n,artifact:o,code:i})=>{const a=v(),{CopyButton:l}=Lt(),r=o.steps??[];return t(Od,{"data-id":"cloud-connector-create-role",step:n,title:o.title||ot.CLOUD_CONNECTOR_CREATE_ROLE_TITLE,description:o.description,children:e($d,{children:[r.length>0&&e(Ad,{children:[t(ee,{size:te.XXS,weight:400,lineHeight:"20px",color:ne.Primary,children:ot.CLOUD_CONNECTOR_CREATE_ROLE_STEPS_HEADING}),t(Rd,{children:r.map((n,i)=>e(Dd,{children:[t(Pd,{children:t(ee,{size:te.XXS,weight:400,lineHeight:"20px",color:a.v2.colors.purple[200],children:i+1})}),t(ee,{size:te.XXS,weight:400,lineHeight:"20px",color:ne.Primary,children:n})]},`${o.id}-step-${i}`))})]}),i&&e(_d,{children:[t(Ld,{children:t(l,{value:i,size:St.XS})}),t(Fd,{children:t(Md,{children:i})})]})]})})},Xd=b.div`
399
381
  display: flex;
400
382
  flex-direction: column;
401
383
  padding: 16px;
402
- `,Hd=b.div`
384
+ `,Bd=b.div`
403
385
  display: flex;
404
386
  flex-direction: column;
405
387
  gap: 12px;
406
388
  padding: 16px 16px 12px;
407
389
  border-radius: 16px;
408
390
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
409
- `,jd=b.div`
391
+ `,Ud=b.div`
410
392
  display: flex;
411
393
  align-items: center;
412
394
  gap: 8px;
413
395
  width: 100%;
414
- `,Gd=b.button`
396
+ `,Vd=b.button`
415
397
  display: flex;
416
398
  align-items: center;
417
399
  justify-content: center;
@@ -428,38 +410,38 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
428
410
  &:hover {
429
411
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
430
412
  }
431
- `,Wd=b.div`
413
+ `,Hd=b.div`
432
414
  display: flex;
433
415
  flex: 1;
434
416
  flex-direction: column;
435
417
  gap: 4px;
436
418
  min-width: 0;
437
- `,Kd=b.div`
419
+ `,jd=b.div`
438
420
  display: flex;
439
421
  align-items: center;
440
422
  gap: 4px;
441
423
  padding: 8px 0 8px 2px;
442
- `,Yd=b.div`
424
+ `,Gd=b.div`
443
425
  display: flex;
444
426
  flex-direction: column;
445
427
  gap: 16px;
446
428
  width: 100%;
447
- `,Jd=b.div`
429
+ `,Wd=b.div`
448
430
  display: flex;
449
431
  flex-wrap: wrap;
450
432
  gap: 24px;
451
433
  width: 100%;
452
- `,qd=b.div`
434
+ `,Kd=b.div`
453
435
  display: flex;
454
436
  flex: 1 1 calc(50% - 12px);
455
437
  min-width: 0;
456
- `,Zd=e=>{switch(e?.provider){case"azure":return{subtitle:"Configure the Azure subscription and the identity Odigos uses to access it.",accountTitle:"Enter Azure subscription",accountDescription:"Paste the subscription ID that contains the resources Odigos should discover.",authDescription:"Use a service principal for local Central, or choose workload identity only when it is configured on the connector pod.",credentialsTitle:"Enter service principal credentials",credentialsDescription:"Create an app in Microsoft Entra ID, grant its service principal the required role on this subscription, then paste its Directory ID, Application ID, and client secret."};case"gcp":return{subtitle:"Configure the Google Cloud project and the identity Odigos uses to access it.",accountTitle:"Enter Google Cloud project",accountDescription:"Paste the project ID that contains the resources Odigos should discover.",authDescription:"Use a service account key for local Central, or choose workload identity only when it is configured on the connector pod.",credentialsTitle:"Enter service account credentials",credentialsDescription:"Grant the service account the required roles on this project, then paste its complete JSON key."};default:return{subtitle:`Configure the ${e?.displayName??"cloud provider"} account and authentication details.`,accountTitle:"Enter account details",accountDescription:"Enter the provider account identifier that contains the resources Odigos should discover.",authDescription:"Choose how the connector authenticates with this provider.",credentialsTitle:"Enter credentials",credentialsDescription:"Enter the credentials required by the selected authentication method."}}},Qd=({field:e,value:n,onChange:o})=>{const i=`cloud-connector-credential-${e.name}`,a=e.displayName||e.name,l={name:i,label:a,required:e.required,tooltip:e.tooltip||void 0,helpMessage:e.tooltip||void 0,placeholder:a,value:n};return"textarea"===e.componentType||"credentialsJson"===e.name?t(De,{...l,minHeight:"120px",onChange:e=>o(e.target.value)}):t(Ee,{...l,width:"100%",type:e.secret?zt.Password:zt.Text,onChange:e=>o(e.target.value)})},ep=()=>{const o=v(),{genericForm:i}=Ar(),l=i.formData.authMethod,r=i.formData.setupMethod;a(()=>{l||i.handleFormChange("authMethod",xd.AssumeRole)},[l,i]),a(()=>{r||i.handleFormChange("setupMethod",wd.CloudFormation)},[r,i]);const s=Td.find(e=>e.id===l)?.note;return e(n,{children:[e(Sd,{"data-id":"cloud-connector-auth-method",step:1,title:ot.CLOUD_CONNECTOR_AUTH_TITLE,description:ot.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:Td.map(e=>({value:e.id,label:e.label}))}),s&&e(Kd,{children:[t(ml,{size:16,fill:o.v2.colors.silver[200]}),t(ee,{size:te.XXXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:s})]})]}),t(Sd,{"data-id":"cloud-connector-setup-method",step:2,title:ot.CLOUD_CONNECTOR_SETUP_METHOD_TITLE,description:ot.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:kd.map(e=>({value:e.id,label:e.label}))})}),t(Ud,{step:3,setupMethod:r}),t(Rd,{step:4})]})},tp=({provider:o})=>{const l=v(),{genericForm:r}=Ar(),{authMethod:s,accountId:c,credentials:d}=r.formData,p=i(()=>Zd(o),[o]),u=o?.connectorFields?.[0],h=i(()=>(e=>e?.auth?.methods?.find(e=>e.fields?.some(e=>e.required))?.id??e?.auth?.methods?.[0]?.id??"")(o),[o]),m=i(()=>o?.auth?.methods?.find(e=>e.id===s),[o,s]),g=i(()=>Ed(o,s),[o,s]);return a(()=>{if(!o)return;const e=o.auth?.methods?.some(e=>e.id===s);e||r.handleFormChange("authMethod",h)},[o,s,h,r]),e(n,{children:[t(Sd,{"data-id":"cloud-connector-account",step:1,title:p.accountTitle,description:p.accountDescription,children:u&&t(Ee,{name:`cloud-connector-account-${u.name}`,width:"100%",label:u.displayName||u.name,required:u.required,tooltip:u.tooltip||void 0,helpMessage:u.tooltip||void 0,placeholder:u.displayName||u.name,value:c,onChange:e=>r.handleFormChange("accountId",e.target.value)})}),e(Sd,{"data-id":"cloud-connector-auth-method",step:2,title:ot.CLOUD_CONNECTOR_AUTH_TITLE,description:p.authDescription,children:[t(ve,{"data-id":"cloud-connector-auth-method-segment",size:Re.S,selected:s,setSelected:e=>{r.handleFormChange(void 0,void 0,{...r.formData,authMethod:e,credentials:{}})},options:(o?.auth?.methods??[]).map(e=>({value:e.id,label:e.displayName}))}),m?.description&&e(Kd,{children:[t(ml,{size:16,fill:l.v2.colors.silver[200]}),t(ee,{size:te.XXXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:m.description})]})]}),t(Sd,{"data-id":"cloud-connector-provider-credentials",step:3,title:p.credentialsTitle,description:p.credentialsDescription,children:g.length>0?t(Yd,{children:t(Jd,{children:g.map(e=>{const n="textarea"===e.componentType||"credentialsJson"===e.name;return t(qd,{style:n?{flex:"1 1 100%"}:void 0,children:t(Qd,{field:e,value:d[e.name]??"",onChange:t=>((e,t)=>{r.handleFormChange("credentials",{...d,[e]:t})})(e.name,t)})},e.name)})})}):t(ee,{size:te.XXXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:"No stored credentials are required for this authentication method."})})]})},np=({onBack:n})=>{const{providers:o,genericForm:a}=Ar(),l=i(()=>o.find(e=>e.provider===a.formData.provider),[o,a.formData.provider]),r="aws"===l?.provider,s=i(()=>Zd(l),[l]);return t(Vd,{children:e(Hd,{children:[e(jd,{children:[t(Gd,{"data-id":"cloud-connector-setup-back",type:"button",onClick:n,"aria-label":ot.CLOUD_CONNECTOR_SETUP_CREDENTIALS_TITLE,children:t(hl,{size:24})}),e(Wd,{children:[t(ee,{size:te.S,weight:500,lineHeight:"24px",color:ne.Primary,children:ot.CLOUD_CONNECTOR_SETUP_CREDENTIALS_TITLE}),t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:r?ot.CLOUD_CONNECTOR_SETUP_CREDENTIALS_SUBTITLE:s.subtitle})]})]}),r?t(ep,{}):t(tp,{provider:l})]})})},op=b.div`
438
+ `,Yd=({field:e,value:n,onChange:o})=>{const i=`cloud-connector-credential-${e.name}`,a=e.displayName||e.name,l={name:i,label:a,required:e.required,tooltip:e.tooltip||void 0,helpMessage:e.tooltip||void 0,placeholder:a,value:n};return"textarea"===e.componentType||"credentialsJson"===e.name?t(De,{...l,minHeight:"120px",onChange:e=>o(e.target.value)}):t(Ne,{...l,width:"100%",type:e.secret?zt.Password:zt.Text,onChange:e=>o(e.target.value)})},Jd=({onBack:n})=>{const o=v(),{providers:l,genericForm:r}=Ar(),{provider:s,authMethod:c,setupMethod:d,accountId:p,credentials:u,permission:h,customCapabilities:m}=r.formData,g=i(()=>l.find(e=>e.provider===s),[l,s]),f=g?.connectorFields?.[0],b=i(()=>(e=>{const t=e?.auth?.defaultMethod?.trim();return t&&e?.auth?.methods?.some(e=>e.id===t)?t:e?.auth?.methods?.find(e=>e.fields?.some(e=>e.required))?.id??e?.auth?.methods?.[0]?.id??""})(g),[g]),y=i(()=>g?.auth?.methods?.find(e=>e.id===c),[g,c]),C=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})(g,c),[g,c]),S=i(()=>Yc(g,Gc),[g]),x=S.length>0,w=i(()=>{if(x)return Jc(g,Gc,d)??(e=>{const t=Yc(e,Gc);return t[0]?Jc(e,Gc,t[0].id):void 0})(g)},[g,d,x]),T=i(()=>Wc(g,"credentials"),[g]),k=i(()=>{const e=h;return e===Zc.Custom?id(g,m??{}):od(g,e)},[g,h,m]),I=i(()=>w?qc(w,{permissions:k,vars:{accountId:p??"",externalId:u.externalId?.trim()||"odigos-connector",projectId:p??"",subscriptionId:p??"",...u}}):"",[w,k,p,u]);a(()=>{if(!g)return;const e=g.auth?.methods?.some(e=>e.id===c);e||r.handleFormChange("authMethod",b)},[g,c,b,r]),a(()=>{x&&(S.some(e=>e.id===d)||r.handleFormChange("setupMethod",S[0].id))},[x,S,d,r]);let N=1;const E=f?N++:0,O=N++,$=x?N++:0,A=x?N++:0,R=N,D=g?.setup?.subtitle||(g?.displayName?`Configure the ${g.displayName} account and authentication details.`:"Configure the account and authentication details."),P=f?`Enter ${f.displayName||f.name}`:"Enter account details",_=f?.tooltip||"Enter the provider account identifier that contains the resources Odigos should discover.",L=T?.title||"Enter credentials",F=T?.description||y?.description||"Enter the credentials required by the selected authentication method.";return t(Xd,{children:e(Bd,{children:[e(Ud,{children:[t(Vd,{"data-id":"cloud-connector-setup-back",type:"button",onClick:n,"aria-label":ot.CLOUD_CONNECTOR_SETUP_CREDENTIALS_TITLE,children:t(hl,{size:24})}),e(Hd,{children:[t(ee,{size:te.S,weight:500,lineHeight:"24px",color:ne.Primary,children:ot.CLOUD_CONNECTOR_SETUP_CREDENTIALS_TITLE}),t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:D})]})]}),f&&t(Od,{"data-id":"cloud-connector-account",step:E,title:P,description:_,children:t(Ne,{name:`cloud-connector-account-${f.name}`,width:"100%",label:f.displayName||f.name,required:f.required,tooltip:f.tooltip||void 0,helpMessage:f.tooltip||void 0,placeholder:f.displayName||f.name,value:p,onChange:e=>r.handleFormChange("accountId",e.target.value)})}),e(Od,{"data-id":"cloud-connector-auth-method",step:O,title:ot.CLOUD_CONNECTOR_AUTH_TITLE,description:"Choose how the connector authenticates with this provider.",children:[t(ve,{"data-id":"cloud-connector-auth-method-segment",size:Re.S,selected:c,setSelected:e=>{r.handleFormChange(void 0,void 0,{...r.formData,authMethod:e,credentials:{}})},options:(g?.auth?.methods??[]).map(e=>({value:e.id,label:e.displayName}))}),y?.description&&e(jd,{children:[t(ml,{size:16,fill:o.v2.colors.silver[200]}),t(ee,{size:te.XXXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:y.description})]})]}),x&&t(Od,{"data-id":"cloud-connector-setup-method",step:$,title:ot.CLOUD_CONNECTOR_SETUP_METHOD_TITLE,description:ot.CLOUD_CONNECTOR_SETUP_METHOD_SUBTITLE,children:t(ve,{"data-id":"cloud-connector-setup-method-segment",size:Re.S,selected:d,setSelected:e=>r.handleFormChange("setupMethod",e),options:S.map(e=>({value:e.id,label:e.label}))})}),x&&w&&t(zd,{step:A,artifact:w,code:I}),t(Od,{"data-id":"cloud-connector-credentials",step:R,title:L,description:F,children:C.length>0?t(Gd,{children:t(Wd,{children:C.map(e=>{const n="textarea"===e.componentType||"credentialsJson"===e.name;return t(Kd,{style:n?{flex:"1 1 100%"}:void 0,children:t(Yd,{field:e,value:u[e.name]??"",onChange:t=>((e,t)=>{r.handleFormChange("credentials",{...u,[e]:t})})(e.name,t)})},e.name)})})}):t(ee,{size:te.XXXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:"No stored credentials are required for this authentication method."})})]})})},qd=b.div`
457
439
  display: flex;
458
440
  flex-direction: column;
459
441
  flex: 1;
460
442
  min-height: 0;
461
443
  padding: 16px;
462
- `,ip=b.div`
444
+ `,Zd=b.div`
463
445
  display: flex;
464
446
  flex-direction: column;
465
447
  flex: 1;
@@ -467,13 +449,13 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
467
449
  padding: 16px;
468
450
  border-radius: 16px;
469
451
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
470
- `,ap=b.div`
452
+ `,Qd=b.div`
471
453
  display: flex;
472
454
  flex: 1;
473
455
  align-items: center;
474
456
  justify-content: center;
475
457
  width: 100%;
476
- `,lp=b.div`
458
+ `,ep=b.div`
477
459
  display: flex;
478
460
  flex-direction: column;
479
461
  align-items: center;
@@ -483,7 +465,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
483
465
  padding: 24px 8px;
484
466
  border-radius: 8px;
485
467
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
486
- `,rp=b.div`
468
+ `,tp=b.div`
487
469
  display: flex;
488
470
  flex-direction: column;
489
471
  align-items: center;
@@ -492,7 +474,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
492
474
  padding: 16px;
493
475
  border-radius: 12px;
494
476
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
495
- `,sp=b.div`
477
+ `,np=b.div`
496
478
  display: flex;
497
479
  align-items: center;
498
480
  justify-content: center;
@@ -501,7 +483,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
501
483
  height: 39px;
502
484
  border-radius: 20px;
503
485
  background-color: ${({theme:e})=>e.v2.colors.red[500]};
504
- `,cp=b.div`
486
+ `,op=b.div`
505
487
  display: flex;
506
488
  align-items: flex-start;
507
489
  gap: 8px;
@@ -511,7 +493,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
511
493
  padding: 12px;
512
494
  border-radius: 8px;
513
495
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
514
- `,dp=b.pre`
496
+ `,ip=b.pre`
515
497
  flex: 1;
516
498
  min-width: 0;
517
499
  margin: 0;
@@ -521,25 +503,25 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
521
503
  color: ${({theme:e})=>e.v2.colors.silver[200]};
522
504
  white-space: pre-wrap;
523
505
  word-break: break-word;
524
- `,pp=b.div`
506
+ `,ap=b.div`
525
507
  display: flex;
526
508
  flex-direction: column;
527
509
  gap: 12px;
528
510
  width: 100%;
529
- `,up=b.div`
511
+ `,lp=b.div`
530
512
  display: flex;
531
513
  flex-wrap: wrap;
532
514
  gap: 24px;
533
515
  padding: 0 2px;
534
- `,hp=b.div`
516
+ `,rp=b.div`
535
517
  display: flex;
536
518
  gap: 6px;
537
519
  min-width: 0;
538
- `,mp=b.div`
520
+ `,sp=b.div`
539
521
  display: flex;
540
522
  flex-direction: column;
541
523
  gap: 8px;
542
- `,gp=b.div`
524
+ `,cp=b.div`
543
525
  display: flex;
544
526
  flex-direction: column;
545
527
  gap: 6px;
@@ -547,7 +529,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
547
529
  border-radius: 12px;
548
530
  border: 1px solid ${({theme:e,$passed:t})=>t?e.v2.colors.silver[700]:e.v2.colors.red[800]};
549
531
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
550
- `,fp=({isTesting:n,error:o,result:a})=>{const l=v(),{CopyButton:r}=Lt(),s=i(()=>a?.checks.filter(e=>!e.passed)??[],[a]),c=!(n||!o&&(!a||a.success)),d=o?ot.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT:s[0]?.remediation||s[0]?.message||ot.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT,p=o||s.map(e=>e.message).filter(Boolean).join("\n");return t(op,{children:t(ip,{children:n?t(ap,{children:t(lp,{children:t(xt,{withVisual:!0,withGradient:!0,title:ot.CLOUD_CONNECTOR_TESTING_TITLE,titleSize:te.XS})})}):c?t(ap,{children:e(rp,{children:[t(sp,{children:t(ol,{size:20,fill:l.v2.colors.black[500]})}),t(ee,{size:te.XS,weight:400,lineHeight:"20px",color:ne.Primary,children:ot.CLOUD_CONNECTOR_CONNECTION_FAILED_TITLE}),t(ee,{align:"center",size:te.XXXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:d}),p&&e(cp,{children:[t(dp,{children:p}),t(r,{value:p,size:St.XS})]})]})}):a?e(pp,{children:[t(ce,{status:Pe.Success,label:ot.CLOUD_CONNECTOR_VALIDATE_SUCCESS,leftIcon:nl,fullWidth:!0}),(a.accountId||a.identity)&&e(up,{children:[a.accountId&&e(hp,{children:[e(ee,{size:te.XXS,weight:500,color:ne.Secondary,children:[ot.CLOUD_CONNECTOR_VALIDATE_ACCOUNT,":"]}),t(ee,{size:te.XXS,weight:400,color:ne.Primary,children:a.accountId})]}),a.identity&&e(hp,{children:[e(ee,{size:te.XXS,weight:500,color:ne.Secondary,children:[ot.CLOUD_CONNECTOR_VALIDATE_IDENTITY,":"]}),t(ee,{size:te.XXS,weight:400,color:ne.Primary,children:a.identity})]})]}),a.checks.length>0&&t(mp,{children:a.checks.map(n=>e(gp,{$passed:n.passed,children:[t(ce,{status:n.passed?Pe.Success:Pe.Error,label:n.displayName,leftIcon:n.passed?nl:ol}),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(ap,{children:t(ee,{size:te.XXS,weight:400,color:ne.Secondary,children:ot.CLOUD_CONNECTOR_VALIDATE_EMPTY})})})})};var bp;(e=>{e[e.SelectProvider=1]="SelectProvider",e[e.Config=2]="Config",e[e.Validate=3]="Validate"})(bp||(bp={}));const vp=bp.SelectProvider,yp=bp.Validate,Cp=({onClose:n,withOverlay:o,onCreateCloudConnector:a,onCreated:r})=>{const{providers:s,genericForm:c}=Ar(),[p,u]=l(vp),[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===vp,k=p===yp,I=d(()=>{w&&!h?m(!0):(m(!1),n?.())},[w,h,n]),E=d(()=>{x(void 0),C(void 0),v(void 0),u(e=>e>vp?e-1:e)},[]),N=d(()=>{if(x(void 0),p===bp.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<yp?e+1:e)},[p,c.formData.provider,c.formData.permission]),O=d(async()=>{if(x(void 0),C(void 0),v(void 0),!a)return;const{provider:e,permission:t,customCapabilities:n,accountId:o,authMethod:i,credentials:l,name:d}=c.formData,p=s.find(t=>t.provider===e),h=p?.connectorFields?.[0];if(h?.required&&!o.trim())return void x(`Please enter ${h.displayName||h.name}`);if(!i)return void x("Please select an authentication method");const m=((e,t,n)=>{const o=e?.auth?.methods?.find(e=>e.id===t);if(!o)return;const i=e=>!!n[e]?.trim(),a=e=>e?.find(e=>e.required&&!i(e.name)),l=a(o.fields);if(l)return l;if(!o.baseMethods?.length)return;const r=new Map(e?.auth?.methods?.map(e=>[e.id,e])),s=o.baseMethods.some(e=>{const t=r.get(e);return!(!t||t.fields&&0!==t.fields.length)});for(const e of o.baseMethods){const t=r.get(e);if(t?.fields?.length&&(t.fields.some(e=>i(e.name))||!s)){const e=a(t.fields);if(e)return e}}})(p,i,l);if(m)return void x(`Please enter ${m.displayName||m.name}`);const g=((e,t,n)=>{const o=Kc(e),i=[];return o.forEach(e=>{const o=void 0!==e.instrumentationPermissions;let a=!1,l=!1;switch(t){case jc.DiscoveryOnly:a=!0;break;case jc.DiscoveryInstrumentation:a=!0,l=o;break;case jc.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})(p,t,n);u(bp.Validate),f(!0);try{const t=await a({provider:e,displayName:d,credentials:l,expectedAccountId:o.trim(),capabilities:g});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:Mt.CANCEL,variant:Ie.Secondary,onClick:I,disabled:$}:{"data-id":"cloud-connector-back",label:Mt.BACK,variant:Ie.Text,leftIcon:hl,onClick:E,disabled:$},[T,I,E,$]),_=i(()=>{if(k){if(g)return;return A?{"data-id":"cloud-connector-retry",label:Mt.RETRY,variant:Ie.Primary,rightIcon:gl,onClick:O}:void 0}return p===bp.Config?{"data-id":"cloud-connector-verify",label:Mt.VERIFY_AND_CREATE_CONNECTOR,variant:Ie.Primary,onClick:O,disabled:$}:{"data-id":"cloud-connector-next",label:Mt.NEXT,variant:Ie.Primary,onClick:N,disabled:$}},[k,g,A,p,O,N,$]),P=i(()=>[D,_].filter(Boolean),[D,_]);return e(Xt,{width:dr,isOpen:!0,hideOverlay:!$&&!o,header:{icon:dl,title:ot.CREATE_CLOUD_CONNECTOR,onClose:n?I:void 0,onCloseDisabled:$},footer:{note:R,actions:P},children:[p===bp.SelectProvider&&t(gd,{}),p===bp.Config&&t(np,{onBack:E}),p===bp.Validate&&t(fp,{isTesting:g,error:y,result:b}),t(pr,{isOpen:h,onClose:()=>m(!1),onApprove:()=>n?.()})]})},Sp=({statuses:e})=>{const n=i(()=>Bt(e).map(({status:e,type:t,reason:n,message:o})=>({status:e,title:Ut(n||t),subTitle:o??void 0})),[e]);return n.length?t(ae,{$gap:12,children:n.map(e=>t(Vt,{invertColors:!0,slim:!0,width:"100%",...e},e.title))}):null},xp=(e,t)=>{const n=[{id:"type",title:ot.TYPE,label:t.label},{id:"status",title:ot.STATUS,badge:{status:e.disabled?Pe.Unknown:Pe.Success,label:e.disabled?ot.DISABLED:ot.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:ot.SIGNALS_FOR_PROCESSING,label:o}),e.name&&n.push({id:"name",title:ot.NAME,label:e.name}),e.notes&&n.push({id:"notes",title:ot.NOTES,label:e.notes}),n},wp=({onClose:o,actionId:r})=>{const s=v(),{isK8s:c,platformType:u,version:h}=S(),{actionsApi:m}=yr(),{items:g,refetch:f}=m.useActions(),{options:b}=m.useActionTypes(),{selectedOption:y,loadAction:C,validateFormData:x,genericForm:w}=vr(),T=p(f);T.current=f,a(()=>{T.current()},[]);const[k,I]=l(!1),[E,N]=l(!1),[O,$]=l(null),A=k&&!!w?.isFormDirty;a(()=>{if(k)return;const e=setInterval(()=>T.current(),3e3);return()=>clearInterval(e)},[k]);const R=i(()=>g?.find(e=>Gt(e)===r),[r,g]),D=i(()=>b.find(({type:e})=>e===R?.type)??gt(u,h).find(({type:e})=>e===R?.type)??Wt.find(({type:e})=>e===R?.type)??null,[b,R?.type,u,h]),_=R?.statuses&&Array.isArray(R.statuses)?R.statuses:null;a(()=>{R&&C(R,D)},[R,D]);const P=d(()=>{R&&I(!0)},[R]),L=d(()=>{R&&(C(R,D),I(!1))},[R,D,C]),F=d(()=>{A?$("close"):o()},[A,o]),M=d(()=>{A?$("cancel"):L()},[A,L]),z=d(()=>{const e=O;$(null),"close"===e?(L(),o()):L()},[O,L,o]),X=d(async()=>{if(R){const{errorMessage:e,preparedFormData:t}=x();e||(await m.update(R.id,t),I(!1))}},[R,x,m]),B=d(()=>{R&&N(!0)},[R]),U=d(async()=>{R&&(await m.remove(R.id,R.type),o())},[R,m,o]);if(!R||!D)return null;const V=(H=R,j=D,j?.fields?.length?Ht(H.fields||{},j.fields,{signals:H.signals||[],skipComponentTypes:[jt.SourceScopes]}):[]);var H,j;const G=D.fields?.find(e=>e.componentType===jt.SourceScopes),W=G?.name||de.Scopes,K=R.fields?.[W]??null,Y=c&&(!!G||void 0!==R.fields?.scopes);return e(n,{children:[t(Xt,{isOpen:!0,header:{icon:Jt(R.type),title:D.label,onClose:F,actions:[{id:"edit-action-btn-edit",label:Mt.EDIT,icon:Ya,active:k,onClick:P},{id:"edit-action-btn-delete",label:Mt.DELETE,icon:Ua,color:s.v2.colors.red[500],active:E,onClick:B}]},footer:{actions:k?[{"data-id":"edit-action-btn-cancel",label:Mt.CANCEL,variant:Ie.Secondary,onClick:M},{"data-id":"edit-action-btn-save",label:Mt.SAVE,variant:Ie.Primary,onClick:X}]:[]},children:t(le,{$padding:"4px 12px 12px",children:k&&y?t(Rs,{}):t(ae,{$gap:16,children:e(Kt,{bgTint:"1000",children:[c&&(_?t(Sp,{statuses:_}):t(Yt,{conditions:R.conditions||[]})),t(Kt,{bgTint:"800",cellsPerRow:2,items:xp(R,D)}),Y&&t(Ql,{readOnly:!0,scopes:K}),!!V?.length&&t(Kt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Kt,{bgTint:"800",cellsPerRow:2,items:V})})]})})})}),t(ur,{target:"action",isOpen:E,onClose:()=>N(!1),onApprove:U}),t(pr,{isOpen:null!==O,onClose:()=>$(null),onApprove:z})]})},Tp=({onClose:n,connections:o,selectedConnectionIds:r,setSelectedConnectionIds:s})=>{const{configApi:c}=yr(),[d,p]=l(""),[u,h]=l({showOnlySelected:!1}),m=i(()=>o.filter(e=>{const t=!d||e.name.toLowerCase().includes(d.toLowerCase()),n=!u.showOnlySelected||u.showOnlySelected&&r.includes(e.id);return t&&n}),[o.length,r.length,d,u]),g=e=>{s(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},f=1===r.length?r[0]:void 0,{data:b,loading:v}=c.useEffectiveConfig({id:f},{skip:!f}),y=i(()=>({rollout:{automaticRolloutDisabled:b?.rollout?.automaticRolloutDisabled??!1}}),[b]),{formData:C,areFormValuesEqual:S,handleFormChange:x,resetFormData:w}=qt(y);a(()=>{y&&w(y)},[y]);const T=i(()=>r.length>1||!S(y,C),[r.length,y,C]);return t(cr,{isOpen:!0,onClose:n,onSave:async()=>await(c.applyConfigurations?.(C,r))??void 0,header:{icon:fl,title:"Cluster Configuration"},connectionIds:{value:r,setValue:s},search:{placeholder:"Search by cluster name",value:d,onChange:p},filters:e(oe,{$gap:8,children:[t(ee,{size:te.XXXS,color:ne.Secondary,nowrap:!0,children:"Show only:"}),t(ge,{size:Ot.S,label:"Selected",value:u.showOnlySelected,onChange:e=>h(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:T,isFetching:v,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:m.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}/${m.length}`,status:Pe.Unknown})]})]}),list:m.map(e=>t(ss,{title:e.name,isChecked:r.includes(e.id),onClick:()=>g(e.id),onCheckboxChange:()=>g(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:C.rollout?.automaticRolloutDisabled||!1,onChange:e=>x("rollout.automaticRolloutDisabled",e),size:Ot.S},"automatic-rollout-disabled")]}})},kp=e=>{const t=[{id:"type",title:ot.TYPE,label:e.destinationType.displayName},{id:"status",title:ot.STATUS,badge:{status:e.disabled?Pe.Unknown:Pe.Success,label:e.disabled?ot.DISABLED:ot.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:ot.MONITORS,label:n}),e.name&&t.push({id:"name",title:ot.NAME,label:e.name}),t},Ip=({onClose:o,destinationId:r})=>{const s=v(),{isK8s:c}=S(),{destinationsApi:u}=yr(),{selectedStreamName:h}=it(),{items:m,refetch:g}=u.useDestinations(),{data:f,loading:b}=u.useDestinationCategories(),{activeForm:y,loadDestination:C,validateFormData:x,genericForm:w}=Cr();a(()=>{g()},[]);const T=p(null),[k,I]=l(!1),[E,N]=l(!1),[O,$]=l(null),A=k&&!!w?.isFormDirty,R=i(()=>en(m,h),[m,h]),D=i(()=>R?.find(e=>Gt(e)===r),[r,R]),_=f?.destinationCategories?.categories??null;a(()=>{D&&_&&C(D,_)},[D,_]);const P=i(()=>D&&_?tn(_,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]),X=d(()=>{const e=O;$(null),"close"===e?(F(),o()):F()},[O,F,o]),B=d(async()=>{if(D){const{errorMessage:e,preparedFormData:t}=x();e||(await u.update(D.id,Xe(t)),I(!1))}},[D,x,u]),U=d(()=>{D&&N(!0)},[D]),V=d(async()=>{D&&(await u.remove(D.id),o())},[D,u,o]);if(!D)return null;const{icon:H,iconSrc:j}=Tt(D.destinationType.type),G=((e,t)=>{const n=[],o=Zt(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&&Qt(h,a,i))return;const{type:g}=It(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===jt.MultiInput){const t=It(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===jt.KeyValuePair){const t=It(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(Xt,{isOpen:!0,header:{icon:H,iconSrc:j,title:D.name||D.destinationType.displayName,onClose:M,actions:[{id:"edit-destination-btn-edit",label:Mt.EDIT,icon:Ya,active:k,onClick:L},{id:"edit-destination-btn-delete",label:Mt.DELETE,icon:Ua,color:s.v2.colors.red[500],active:E,onClick:U}]},footer:{actions:k?[{"data-id":"edit-destination-btn-cancel",label:Mt.CANCEL,variant:Ie.Secondary,onClick:z},...y?.option.testConnectionSupported&&c?[{"data-id":"edit-destination-btn-test-connection",label:Mt.TEST_CONNECTION,variant:Ie.Secondary,onClick:()=>T.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:Mt.SAVE,variant:Ie.Primary,onClick:B}]:[]},children:t(le,{$padding:"4px 12px 12px",children:b?t(bt,{$height:"50vh",children:t(xt,{withSpinner:!0})}):k&&y?t(_s,{ref:T,isEdit:!0}):t(ae,{$gap:16,children:e(Kt,{bgTint:"1000",children:[e(Kt,{bgTint:"900",children:[c&&t(Yt,{conditions:D.conditions||[]}),t(Kt,{bgTint:"800",cellsPerRow:2,items:kp(D)})]}),!!G.length&&t(Kt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:G.map(e=>"cells"===e.kind?t(Kt,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t(Kt,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})})}),t(ur,{target:"destination",isOpen:E,onClose:()=>N(!1),onApprove:V}),t(pr,{isOpen:null!==O,onClose:()=>$(null),onApprove:X})]})},Ep=(e,t)=>{const n=[{id:"type",title:ot.TYPE,label:t.label},{id:"status",title:ot.STATUS,badge:{status:e.disabled?Pe.Unknown:Pe.Success,label:e.disabled?ot.DISABLED:ot.ENABLED}}];return e.ruleName&&n.push({id:"name",title:ot.NAME,label:e.ruleName}),e.profileName&&n.push({id:"profile",title:ot.MANAGED_BY_PROFILE,label:e.profileName}),e.notes&&n.push({id:"notes",title:ot.NOTES,label:e.notes}),n},Np=({onClose:o,ruleId:r})=>{const s=v(),{addNotification:c}=nn(),{isK8s:p,platformType:u,version:h}=S(),m=qe(u,h),{instrumentationRulesApi:g}=yr(),{items:f,refetch:b}=g.useRules(),{selectedOption:y,loadRule:C,validateFormData:x,genericForm:w}=Sr();a(()=>{b()},[]);const[T,k]=l(!1),[I,E]=l(!1),[N,O]=l(null),$=T&&!!w?.isFormDirty,{options:A}=g.useRuleTypes(),R=i(()=>A.length?A:Et,[A]),D=i(()=>f?.find(e=>Gt(e)===r),[r,f]),_=i(()=>R.find(({type:e})=>e===D?.type)??null,[R,D?.type]),P=i(()=>Ze(_?.supportedLanguages),[_?.supportedLanguages]);a(()=>{D&&_&&C(D,_)},[D,_]);const L=d(()=>{if(D){if(!D.mutable)return void c({type:Pe.Warning,title:Ye.FORBIDDEN,message:Ye.CANNOT_EDIT_RULE,crdType:Nt.InstrumentationRule,target:D.ruleId,hideFromHistory:!0});k(!0)}},[D,c]),F=d(()=>{D&&_&&(C(D,_),k(!1))},[D,_,C]),M=d(()=>{$?O("close"):o()},[$,o]),z=d(()=>{$?O("cancel"):F()},[$,F]),X=d(()=>{const e=N;O(null),"close"===e?(F(),o()):F()},[N,F,o]),B=d(async()=>{if(D){const{errorMessage:e,preparedFormData:t}=x();e||(await g.update(D.ruleId,t,D.type),k(!1))}},[D,x,g]),U=d(()=>{if(D){if(!D.mutable)return void c({type:Pe.Warning,title:Ye.FORBIDDEN,message:Ye.CANNOT_DELETE_RULE,crdType:Nt.InstrumentationRule,target:D.ruleId,hideFromHistory:!0});E(!0)}},[D,c]),V=d(async()=>{D&&(await g.remove(D.ruleId,D.type),o())},[D,g,o]);if(!D||!_)return null;const H=(j=D,G=_,G?.fields?.length?Ht(j,G.fields,{skipComponentTypes:[jt.SourceScopes]}):[]);var j,G;return e(n,{children:[t(Xt,{isOpen:!0,header:{icon:an(D.type),title:_.label,onClose:M,actions:[{id:"edit-rule-btn-edit",label:Mt.EDIT,icon:Ya,active:T,onClick:L},{id:"edit-rule-btn-delete",label:Mt.DELETE,icon:Ua,color:s.v2.colors.red[500],active:I,onClick:U}]},footer:{actions:T?[{"data-id":"edit-rule-btn-cancel",label:Mt.CANCEL,variant:Ie.Secondary,onClick:z},{"data-id":"edit-rule-btn-save",label:Mt.SAVE,variant:Ie.Primary,onClick:B}]:[]},children:t(le,{$padding:"4px 12px 12px",children:T&&y?t(Us,{}):t(ae,{$gap:16,children:e(Kt,{bgTint:"1000",children:[p&&t(Yt,{conditions:D.conditions||[]}),t(Kt,{bgTint:"800",cellsPerRow:2,items:Ep(D,_)}),m&&t(Ql,{readOnly:!0,scopes:D.sourceScopes??null}),_.type===Je.CustomInstrumentation&&!!D.customInstrumentations?.[Ke.Php]?.length&&t(_e,{status:Pe.Warning,message:Ye.PHP_CUSTOM_INSTRUMENTATION_RESTART,fullWidth:!0}),!!H?.length&&t(Kt,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Kt,{bgTint:"800",cellsPerRow:2,items:H})}),!!P.length&&t(Kt,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Kt,{bgTint:"800",children:t(oe,{$gap:12,$wrap:"wrap",children:P.map(e=>t(on,{label:tt(e),leftIcon:et(e),flex:P.length>1?"0.5":"1"},e))})})})]})})})}),t(ur,{target:"instrumentation rule",isOpen:I,onClose:()=>E(!1),onApprove:V}),t(pr,{isOpen:null!==N,onClose:()=>O(null),onApprove:X})]})};var Op;(e=>{e.Overview="overview",e.Pods="pods",e.Libraries="libraries",e.PeerSources="peer-sources",e.Profiling="profiling",e.Sampling="sampling",e.Debug="debug"})(Op||(Op={}));const $p=({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}=ln(),{platformType:m,version:g}=S(),f=rn(m,g),b=sn(!!n),v=i(()=>({title:l,icon:bl,withCopy:!0}),[l]),y=i(()=>{const e=[],t=cn(c);t&&e.push(t);const n=cn(d,ul,"health");n&&e.push(n);const o=cn(p,vl,"health");return o&&e.push(o),e},[c,d,p]),C=i(()=>o?[{id:`restart-pod-${l}`,icon:gl,label:Mt.RESTART_POD,onClick:()=>o(a,l)}]:void 0,[o,a,l]),x=i(()=>[{id:"nodeName",title:ot.NODE,label:r,withCopy:!0},{id:"age",title:ot.AGE,label:s?h(s,{style:"short"}):f?ot.NOT_RUNNING:ot.UNKNOWN_VALUE,labelTooltip:s||(f?void 0:ot.START_TIME_UNAVAILABLE)}],[r,s,h,f]);return t("div",{ref:b,children:t(Kt,{bgTint:"900",richTitle:v,badges:y,dropDataActions:C,items:x,withCollapse:!0,collapseIsDefaultOpen:e,children:u})})},Ap=b.div`
532
+ `,dp=({isTesting:n,error:o,result:a})=>{const l=v(),{CopyButton:r}=Lt(),s=i(()=>a?.checks.filter(e=>!e.passed)??[],[a]),c=!(n||!o&&(!a||a.success)),d=o?ot.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT:s[0]?.remediation||s[0]?.message||ot.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT,p=o||s.map(e=>e.message).filter(Boolean).join("\n");return t(qd,{children:t(Zd,{children:n?t(Qd,{children:t(ep,{children:t(xt,{withVisual:!0,withGradient:!0,title:ot.CLOUD_CONNECTOR_TESTING_TITLE,titleSize:te.XS})})}):c?t(Qd,{children:e(tp,{children:[t(np,{children:t(ol,{size:20,fill:l.v2.colors.black[500]})}),t(ee,{size:te.XS,weight:400,lineHeight:"20px",color:ne.Primary,children:ot.CLOUD_CONNECTOR_CONNECTION_FAILED_TITLE}),t(ee,{align:"center",size:te.XXXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:d}),p&&e(op,{children:[t(ip,{children:p}),t(r,{value:p,size:St.XS})]})]})}):a?e(ap,{children:[t(ce,{status:_e.Success,label:ot.CLOUD_CONNECTOR_VALIDATE_SUCCESS,leftIcon:nl,fullWidth:!0}),(a.accountId||a.identity)&&e(lp,{children:[a.accountId&&e(rp,{children:[e(ee,{size:te.XXS,weight:500,color:ne.Secondary,children:[ot.CLOUD_CONNECTOR_VALIDATE_ACCOUNT,":"]}),t(ee,{size:te.XXS,weight:400,color:ne.Primary,children:a.accountId})]}),a.identity&&e(rp,{children:[e(ee,{size:te.XXS,weight:500,color:ne.Secondary,children:[ot.CLOUD_CONNECTOR_VALIDATE_IDENTITY,":"]}),t(ee,{size:te.XXS,weight:400,color:ne.Primary,children:a.identity})]})]}),a.checks.length>0&&t(sp,{children:a.checks.map(n=>e(cp,{$passed:n.passed,children:[t(ce,{status:n.passed?_e.Success:_e.Error,label:n.displayName,leftIcon:n.passed?nl:ol}),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(Qd,{children:t(ee,{size:te.XXS,weight:400,color:ne.Secondary,children:ot.CLOUD_CONNECTOR_VALIDATE_EMPTY})})})})};var pp;(e=>{e[e.SelectProvider=1]="SelectProvider",e[e.Config=2]="Config",e[e.Validate=3]="Validate"})(pp||(pp={}));const up=pp.SelectProvider,hp=pp.Validate,mp=({onClose:n,withOverlay:o,onCreateCloudConnector:a,onCreated:r})=>{const{providers:s,genericForm:c}=Ar(),[p,u]=l(up),[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===up,k=p===hp,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>up?e-1:e)},[]),E=d(()=>{if(x(void 0),p===pp.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<hp?e+1:e)},[p,c.formData.provider,c.formData.permission]),O=d(async()=>{if(x(void 0),C(void 0),v(void 0),!a)return;const{provider:e,permission:t,customCapabilities:n,accountId:o,authMethod:i,credentials:l,name:d}=c.formData,p=s.find(t=>t.provider===e),h=p?.connectorFields?.[0];if(h?.required&&!o.trim())return void x(`Please enter ${h.displayName||h.name}`);if(!i)return void x("Please select an authentication method");const m=((e,t,n)=>{const o=e?.auth?.methods?.find(e=>e.id===t);if(!o)return;const i=e=>!!n[e]?.trim(),a=e=>e?.find(e=>e.required&&!i(e.name)),l=a(o.fields);if(l)return l;if(!o.baseMethods?.length)return;const r=new Map(e?.auth?.methods?.map(e=>[e.id,e])),s=o.baseMethods.some(e=>{const t=r.get(e);return!(!t||t.fields&&0!==t.fields.length)});for(const e of o.baseMethods){const t=r.get(e);if(t?.fields?.length&&(t.fields.some(e=>i(e.name))||!s)){const e=a(t.fields);if(e)return e}}})(p,i,l);if(m)return void x(`Please enter ${m.displayName||m.name}`);const g=((e,t,n)=>{const o=td(e),i=[];return o.forEach(e=>{const o=void 0!==e.instrumentationPermissions;let a=!1,l=!1;switch(t){case Zc.DiscoveryOnly:a=!0;break;case Zc.DiscoveryInstrumentation:a=!0,l=o;break;case Zc.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})(p,t,n);u(pp.Validate),f(!0);try{const t=await a({provider:e,displayName:d,credentials:l,expectedAccountId:o.trim(),capabilities:g});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:_e.Error,message:S}:void 0,[S]),D=i(()=>T?{"data-id":"cloud-connector-cancel",label:Mt.CANCEL,variant:Ie.Secondary,onClick:I,disabled:$}:{"data-id":"cloud-connector-back",label:Mt.BACK,variant:Ie.Text,leftIcon:hl,onClick:N,disabled:$},[T,I,N,$]),P=i(()=>{if(k){if(g)return;return A?{"data-id":"cloud-connector-retry",label:Mt.RETRY,variant:Ie.Primary,rightIcon:gl,onClick:O}:void 0}return p===pp.Config?{"data-id":"cloud-connector-verify",label:Mt.VERIFY_AND_CREATE_CONNECTOR,variant:Ie.Primary,onClick:O,disabled:$}:{"data-id":"cloud-connector-next",label:Mt.NEXT,variant:Ie.Primary,onClick:E,disabled:$}},[k,g,A,p,O,E,$]),_=i(()=>[D,P].filter(Boolean),[D,P]);return e(Xt,{width:dr,isOpen:!0,hideOverlay:!$&&!o,header:{icon:dl,title:ot.CREATE_CLOUD_CONNECTOR,onClose:n?I:void 0,onCloseDisabled:$},footer:{note:R,actions:_},children:[p===pp.SelectProvider&&t(wd,{}),p===pp.Config&&t(Jd,{onBack:N}),p===pp.Validate&&t(dp,{isTesting:g,error:y,result:b}),t(pr,{isOpen:h,onClose:()=>m(!1),onApprove:()=>n?.()})]})},gp=({statuses:e})=>{const n=i(()=>Bt(e).map(({status:e,type:t,reason:n,message:o})=>({status:e,title:Ut(n||t),subTitle:o??void 0})),[e]);return n.length?t(ae,{$gap:12,children:n.map(e=>t(Vt,{invertColors:!0,slim:!0,width:"100%",...e},e.title))}):null},fp=(e,t)=>{const n=[{id:"type",title:ot.TYPE,label:t.label},{id:"status",title:ot.STATUS,badge:{status:e.disabled?_e.Unknown:_e.Success,label:e.disabled?ot.DISABLED:ot.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:ot.SIGNALS_FOR_PROCESSING,label:o}),e.name&&n.push({id:"name",title:ot.NAME,label:e.name}),e.notes&&n.push({id:"notes",title:ot.NOTES,label:e.notes}),n},bp=({onClose:o,actionId:r})=>{const s=v(),{isK8s:c,platformType:u,version:h}=S(),{actionsApi:m}=yr(),{items:g,refetch:f}=m.useActions(),{options:b}=m.useActionTypes(),{selectedOption:y,loadAction:C,validateFormData:x,genericForm:w}=vr(),T=p(f);T.current=f,a(()=>{T.current()},[]);const[k,I]=l(!1),[N,E]=l(!1),[O,$]=l(null),A=k&&!!w?.isFormDirty;a(()=>{if(k)return;const e=setInterval(()=>T.current(),3e3);return()=>clearInterval(e)},[k]);const R=i(()=>g?.find(e=>Gt(e)===r),[r,g]),D=i(()=>b.find(({type:e})=>e===R?.type)??gt(u,h).find(({type:e})=>e===R?.type)??Wt.find(({type:e})=>e===R?.type)??null,[b,R?.type,u,h]),P=R?.statuses&&Array.isArray(R.statuses)?R.statuses:null;a(()=>{R&&C(R,D)},[R,D]);const _=d(()=>{R&&I(!0)},[R]),L=d(()=>{R&&(C(R,D),I(!1))},[R,D,C]),F=d(()=>{A?$("close"):o()},[A,o]),M=d(()=>{A?$("cancel"):L()},[A,L]),z=d(()=>{const e=O;$(null),"close"===e?(L(),o()):L()},[O,L,o]),X=d(async()=>{if(R){const{errorMessage:e,preparedFormData:t}=x();e||(await m.update(R.id,t),I(!1))}},[R,x,m]),B=d(()=>{R&&E(!0)},[R]),U=d(async()=>{R&&(await m.remove(R.id,R.type),o())},[R,m,o]);if(!R||!D)return null;const V=(H=R,j=D,j?.fields?.length?Ht(H.fields||{},j.fields,{signals:H.signals||[],skipComponentTypes:[jt.SourceScopes]}):[]);var H,j;const G=D.fields?.find(e=>e.componentType===jt.SourceScopes),W=G?.name||de.Scopes,K=R.fields?.[W]??null,Y=c&&(!!G||void 0!==R.fields?.scopes);return e(n,{children:[t(Xt,{isOpen:!0,header:{icon:Jt(R.type),title:D.label,onClose:F,actions:[{id:"edit-action-btn-edit",label:Mt.EDIT,icon:Ya,active:k,onClick:_},{id:"edit-action-btn-delete",label:Mt.DELETE,icon:Ua,color:s.v2.colors.red[500],active:N,onClick:B}]},footer:{actions:k?[{"data-id":"edit-action-btn-cancel",label:Mt.CANCEL,variant:Ie.Secondary,onClick:M},{"data-id":"edit-action-btn-save",label:Mt.SAVE,variant:Ie.Primary,onClick:X}]:[]},children:t(le,{$padding:"4px 12px 12px",children:k&&y?t(Rs,{}):t(ae,{$gap:16,children:e(Kt,{bgTint:"1000",children:[c&&(P?t(gp,{statuses:P}):t(Yt,{conditions:R.conditions||[]})),t(Kt,{bgTint:"800",cellsPerRow:2,items:fp(R,D)}),Y&&t(Ql,{readOnly:!0,scopes:K}),!!V?.length&&t(Kt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Kt,{bgTint:"800",cellsPerRow:2,items:V})})]})})})}),t(ur,{target:"action",isOpen:N,onClose:()=>E(!1),onApprove:U}),t(pr,{isOpen:null!==O,onClose:()=>$(null),onApprove:z})]})},vp=({onClose:n,connections:o,selectedConnectionIds:r,setSelectedConnectionIds:s})=>{const{configApi:c}=yr(),[d,p]=l(""),[u,h]=l({showOnlySelected:!1}),m=i(()=>o.filter(e=>{const t=!d||e.name.toLowerCase().includes(d.toLowerCase()),n=!u.showOnlySelected||u.showOnlySelected&&r.includes(e.id);return t&&n}),[o.length,r.length,d,u]),g=e=>{s(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},f=1===r.length?r[0]:void 0,{data:b,loading:v}=c.useEffectiveConfig({id:f},{skip:!f}),y=i(()=>({rollout:{automaticRolloutDisabled:b?.rollout?.automaticRolloutDisabled??!1}}),[b]),{formData:C,areFormValuesEqual:S,handleFormChange:x,resetFormData:w}=qt(y);a(()=>{y&&w(y)},[y]);const T=i(()=>r.length>1||!S(y,C),[r.length,y,C]);return t(cr,{isOpen:!0,onClose:n,onSave:async()=>await(c.applyConfigurations?.(C,r))??void 0,header:{icon:fl,title:"Cluster Configuration"},connectionIds:{value:r,setValue:s},search:{placeholder:"Search by cluster name",value:d,onChange:p},filters:e(oe,{$gap:8,children:[t(ee,{size:te.XXXS,color:ne.Secondary,nowrap:!0,children:"Show only:"}),t(ge,{size:Ot.S,label:"Selected",value:u.showOnlySelected,onChange:e=>h(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:T,isFetching:v,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:m.length,status:_e.Unknown})]}),e(oe,{$gap:8,children:[t(ee,{size:te.XXXS,color:ne.Secondary,align:"right",children:"Selected clusters"}),t(ce,{label:`${r.length}/${m.length}`,status:_e.Unknown})]})]}),list:m.map(e=>t(ss,{title:e.name,isChecked:r.includes(e.id),onClick:()=>g(e.id),onCheckboxChange:()=>g(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:C.rollout?.automaticRolloutDisabled||!1,onChange:e=>x("rollout.automaticRolloutDisabled",e),size:Ot.S},"automatic-rollout-disabled")]}})},yp=e=>{const t=[{id:"type",title:ot.TYPE,label:e.destinationType.displayName},{id:"status",title:ot.STATUS,badge:{status:e.disabled?_e.Unknown:_e.Success,label:e.disabled?ot.DISABLED:ot.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:ot.MONITORS,label:n}),e.name&&t.push({id:"name",title:ot.NAME,label:e.name}),t},Cp=({onClose:o,destinationId:r})=>{const s=v(),{isK8s:c}=S(),{destinationsApi:u}=yr(),{selectedStreamName:h}=it(),{items:m,refetch:g}=u.useDestinations(),{data:f,loading:b}=u.useDestinationCategories(),{activeForm:y,loadDestination:C,validateFormData:x,genericForm:w}=Cr();a(()=>{g()},[]);const T=p(null),[k,I]=l(!1),[N,E]=l(!1),[O,$]=l(null),A=k&&!!w?.isFormDirty,R=i(()=>en(m,h),[m,h]),D=i(()=>R?.find(e=>Gt(e)===r),[r,R]),P=f?.destinationCategories?.categories??null;a(()=>{D&&P&&C(D,P)},[D,P]);const _=i(()=>D&&P?tn(P,D):[],[D,P]),L=d(()=>{D&&I(!0)},[D]),F=d(()=>{D&&P&&(C(D,P),I(!1))},[D,P,C]),M=d(()=>{A?$("close"):o()},[A,o]),z=d(()=>{A?$("cancel"):F()},[A,F]),X=d(()=>{const e=O;$(null),"close"===e?(F(),o()):F()},[O,F,o]),B=d(async()=>{if(D){const{errorMessage:e,preparedFormData:t}=x();e||(await u.update(D.id,Xe(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}=Tt(D.destinationType.type),G=((e,t)=>{const n=[],o=Zt(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&&Qt(h,a,i))return;const{type:g}=It(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===jt.MultiInput){const t=It(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===jt.KeyValuePair){const t=It(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,_);return e(n,{children:[t(Xt,{isOpen:!0,header:{icon:H,iconSrc:j,title:D.name||D.destinationType.displayName,onClose:M,actions:[{id:"edit-destination-btn-edit",label:Mt.EDIT,icon:Ya,active:k,onClick:L},{id:"edit-destination-btn-delete",label:Mt.DELETE,icon:Ua,color:s.v2.colors.red[500],active:N,onClick:U}]},footer:{actions:k?[{"data-id":"edit-destination-btn-cancel",label:Mt.CANCEL,variant:Ie.Secondary,onClick:z},...y?.option.testConnectionSupported&&c?[{"data-id":"edit-destination-btn-test-connection",label:Mt.TEST_CONNECTION,variant:Ie.Secondary,onClick:()=>T.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:Mt.SAVE,variant:Ie.Primary,onClick:B}]:[]},children:t(le,{$padding:"4px 12px 12px",children:b?t(bt,{$height:"50vh",children:t(xt,{withSpinner:!0})}):k&&y?t(Ps,{ref:T,isEdit:!0}):t(ae,{$gap:16,children:e(Kt,{bgTint:"1000",children:[e(Kt,{bgTint:"900",children:[c&&t(Yt,{conditions:D.conditions||[]}),t(Kt,{bgTint:"800",cellsPerRow:2,items:yp(D)})]}),!!G.length&&t(Kt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:G.map(e=>"cells"===e.kind?t(Kt,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t(Kt,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})})}),t(ur,{target:"destination",isOpen:N,onClose:()=>E(!1),onApprove:V}),t(pr,{isOpen:null!==O,onClose:()=>$(null),onApprove:X})]})},Sp=(e,t)=>{const n=[{id:"type",title:ot.TYPE,label:t.label},{id:"status",title:ot.STATUS,badge:{status:e.disabled?_e.Unknown:_e.Success,label:e.disabled?ot.DISABLED:ot.ENABLED}}];return e.ruleName&&n.push({id:"name",title:ot.NAME,label:e.ruleName}),e.profileName&&n.push({id:"profile",title:ot.MANAGED_BY_PROFILE,label:e.profileName}),e.notes&&n.push({id:"notes",title:ot.NOTES,label:e.notes}),n},xp=({onClose:o,ruleId:r})=>{const s=v(),{addNotification:c}=nn(),{isK8s:p,platformType:u,version:h}=S(),m=qe(u,h),{instrumentationRulesApi:g}=yr(),{items:f,refetch:b}=g.useRules(),{selectedOption:y,loadRule:C,validateFormData:x,genericForm:w}=Sr();a(()=>{b()},[]);const[T,k]=l(!1),[I,N]=l(!1),[E,O]=l(null),$=T&&!!w?.isFormDirty,{options:A}=g.useRuleTypes(),R=i(()=>A.length?A:Nt,[A]),D=i(()=>f?.find(e=>Gt(e)===r),[r,f]),P=i(()=>R.find(({type:e})=>e===D?.type)??null,[R,D?.type]),_=i(()=>Ze(P?.supportedLanguages),[P?.supportedLanguages]);a(()=>{D&&P&&C(D,P)},[D,P]);const L=d(()=>{if(D){if(!D.mutable)return void c({type:_e.Warning,title:Ye.FORBIDDEN,message:Ye.CANNOT_EDIT_RULE,crdType:Et.InstrumentationRule,target:D.ruleId,hideFromHistory:!0});k(!0)}},[D,c]),F=d(()=>{D&&P&&(C(D,P),k(!1))},[D,P,C]),M=d(()=>{$?O("close"):o()},[$,o]),z=d(()=>{$?O("cancel"):F()},[$,F]),X=d(()=>{const e=E;O(null),"close"===e?(F(),o()):F()},[E,F,o]),B=d(async()=>{if(D){const{errorMessage:e,preparedFormData:t}=x();e||(await g.update(D.ruleId,t,D.type),k(!1))}},[D,x,g]),U=d(()=>{if(D){if(!D.mutable)return void c({type:_e.Warning,title:Ye.FORBIDDEN,message:Ye.CANNOT_DELETE_RULE,crdType:Et.InstrumentationRule,target:D.ruleId,hideFromHistory:!0});N(!0)}},[D,c]),V=d(async()=>{D&&(await g.remove(D.ruleId,D.type),o())},[D,g,o]);if(!D||!P)return null;const H=(j=D,G=P,G?.fields?.length?Ht(j,G.fields,{skipComponentTypes:[jt.SourceScopes]}):[]);var j,G;return e(n,{children:[t(Xt,{isOpen:!0,header:{icon:an(D.type),title:P.label,onClose:M,actions:[{id:"edit-rule-btn-edit",label:Mt.EDIT,icon:Ya,active:T,onClick:L},{id:"edit-rule-btn-delete",label:Mt.DELETE,icon:Ua,color:s.v2.colors.red[500],active:I,onClick:U}]},footer:{actions:T?[{"data-id":"edit-rule-btn-cancel",label:Mt.CANCEL,variant:Ie.Secondary,onClick:z},{"data-id":"edit-rule-btn-save",label:Mt.SAVE,variant:Ie.Primary,onClick:B}]:[]},children:t(le,{$padding:"4px 12px 12px",children:T&&y?t(Us,{}):t(ae,{$gap:16,children:e(Kt,{bgTint:"1000",children:[p&&t(Yt,{conditions:D.conditions||[]}),t(Kt,{bgTint:"800",cellsPerRow:2,items:Sp(D,P)}),m&&t(Ql,{readOnly:!0,scopes:D.sourceScopes??null}),P.type===Je.CustomInstrumentation&&!!D.customInstrumentations?.[Ke.Php]?.length&&t(Pe,{status:_e.Warning,message:Ye.PHP_CUSTOM_INSTRUMENTATION_RESTART,fullWidth:!0}),!!H?.length&&t(Kt,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Kt,{bgTint:"800",cellsPerRow:2,items:H})}),!!_.length&&t(Kt,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Kt,{bgTint:"800",children:t(oe,{$gap:12,$wrap:"wrap",children:_.map(e=>t(on,{label:tt(e),leftIcon:et(e),flex:_.length>1?"0.5":"1"},e))})})})]})})})}),t(ur,{target:"instrumentation rule",isOpen:I,onClose:()=>N(!1),onApprove:V}),t(pr,{isOpen:null!==E,onClose:()=>O(null),onApprove:X})]})};var wp;(e=>{e.Overview="overview",e.Pods="pods",e.Libraries="libraries",e.PeerSources="peer-sources",e.Profiling="profiling",e.Sampling="sampling",e.Debug="debug"})(wp||(wp={}));const Tp=({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}=ln(),{platformType:m,version:g}=S(),f=rn(m,g),b=sn(!!n),v=i(()=>({title:l,icon:bl,withCopy:!0}),[l]),y=i(()=>{const e=[],t=cn(c);t&&e.push(t);const n=cn(d,ul,"health");n&&e.push(n);const o=cn(p,vl,"health");return o&&e.push(o),e},[c,d,p]),C=i(()=>o?[{id:`restart-pod-${l}`,icon:gl,label:Mt.RESTART_POD,onClick:()=>o(a,l)}]:void 0,[o,a,l]),x=i(()=>[{id:"nodeName",title:ot.NODE,label:r,withCopy:!0},{id:"age",title:ot.AGE,label:s?h(s,{style:"short"}):f?ot.NOT_RUNNING:ot.UNKNOWN_VALUE,labelTooltip:s||(f?void 0:ot.START_TIME_UNAVAILABLE)}],[r,s,h,f]);return t("div",{ref:b,children:t(Kt,{bgTint:"900",richTitle:v,badges:y,dropDataActions:C,items:x,withCollapse:!0,collapseIsDefaultOpen:e,children:u})})},kp=b.div`
551
533
  display: flex;
552
534
  align-items: center;
553
535
  justify-content: space-between;
@@ -555,7 +537,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
555
537
  padding: ${({$noPadding:e})=>e?"0":"12px"};
556
538
  border-radius: 12px;
557
539
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
558
- `,Rp=({podsOdigosHealthStatus:n,pods:o,noPadding:a})=>{const l=pn(n?.status),r=Ut(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===dn.Success?1:0),0)||0,k8sHealthyPodsCount:o?.reduce((e,t)=>e+(t.k8sHealthStatus?.status===dn.Success?1:0),0)||0}),[o]);return o?.length&&n&&l?e(Ap,{$noPadding:a,children:[t(Vt,{invertColors:!0,hideBackground:!0,status:l,title:r,subTitle:s}),e(oe,{$gap:8,children:[t(_p,{label:ot.PODS,count:c}),t(_p,{label:ot.ODIGOS_HEALTHY,icon:ul,count:d,total:c}),t(_p,{label:ot.KUBERNETES_HEALTHY,icon:vl,count:p,total:c})]})]}):null},Dp=b.div`
540
+ `,Ip=({podsOdigosHealthStatus:n,pods:o,noPadding:a})=>{const l=pn(n?.status),r=Ut(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===dn.Success?1:0),0)||0,k8sHealthyPodsCount:o?.reduce((e,t)=>e+(t.k8sHealthStatus?.status===dn.Success?1:0),0)||0}),[o]);return o?.length&&n&&l?e(kp,{$noPadding:a,children:[t(Vt,{invertColors:!0,hideBackground:!0,status:l,title:r,subTitle:s}),e(oe,{$gap:8,children:[t(Ep,{label:ot.PODS,count:c}),t(Ep,{label:ot.ODIGOS_HEALTHY,icon:ul,count:d,total:c}),t(Ep,{label:ot.KUBERNETES_HEALTHY,icon:vl,count:p,total:c})]})]}):null},Np=b.div`
559
541
  display: flex;
560
542
  flex-direction: column;
561
543
  justify-content: center;
@@ -566,7 +548,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
566
548
  width: fit-content;
567
549
  border-radius: 8px;
568
550
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
569
- `,_p=({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(Dp,{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})]})]})},Pp=e=>{if(e.overrideProcessNum)return e.overrideProcessNum.toString();const t=e.identifyingAttributes?.find(({name:e})=>e===un.PID)??e.identifyingAttributes?.find(({name:e})=>e===un.VPID);return t?.value??null};var Lp;(e=>{e.IdentifyingAttributes="identifying-attributes",e.InstrumentationLibraries="instrumentation-libraries"})(Lp||(Lp={}));const Fp=({overrideProcessNum:n,healthy:o,healthStatus:r,identifyingAttributes:s,instrumentations:c,isJumpToTarget:d})=>{const p=v(),[u,h]=l(Lp.IdentifyingAttributes),m=sn(!!d),{tabOptions:g,firstTabValue:f,bothTabsDisabled:b}=i(()=>{const e=c?.some(e=>!1===e.healthy),n=[{value:Lp.IdentifyingAttributes,label:ot.IDENTIFYING_ATTRIBUTES,disabled:!s?.length,selectedBgColor:p.v2.colors.purple[500]},{value:Lp.InstrumentationLibraries,label:ot.INSTRUMENTATION_LIBRARIES,icon:e?e=>t(yl,{...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 Lp.IdentifyingAttributes:return t(ae,{children:s?.map((e,n)=>t(Up,{label:e.name,value:e.value},`attr-${n}-${e.name}`))});case Lp.InstrumentationLibraries:return t(ae,{children:c?.map((e,n)=>t(Up,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},`instr-${n}-${e.name}`))});default:return null}},[u,s,c]),C=i(()=>Pp({overrideProcessNum:n,identifyingAttributes:s}),[n,s]);return t("div",{ref:m,children:e(Kt,{bgTint:"800",richTitle:{title:C?`${ot.PROCESS} ${ot.PID(C)}`:ot.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:ul,label:o?ot.HEALTHY:ot.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]})})},Mp=b.div`
551
+ `,Ep=({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(Np,{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})]})]})},Op=e=>{if(e.overrideProcessNum)return e.overrideProcessNum.toString();const t=e.identifyingAttributes?.find(({name:e})=>e===un.PID)??e.identifyingAttributes?.find(({name:e})=>e===un.VPID);return t?.value??null};var $p;(e=>{e.IdentifyingAttributes="identifying-attributes",e.InstrumentationLibraries="instrumentation-libraries"})($p||($p={}));const Ap=({overrideProcessNum:n,healthy:o,healthStatus:r,identifyingAttributes:s,instrumentations:c,isJumpToTarget:d})=>{const p=v(),[u,h]=l($p.IdentifyingAttributes),m=sn(!!d),{tabOptions:g,firstTabValue:f,bothTabsDisabled:b}=i(()=>{const e=c?.some(e=>!1===e.healthy),n=[{value:$p.IdentifyingAttributes,label:ot.IDENTIFYING_ATTRIBUTES,disabled:!s?.length,selectedBgColor:p.v2.colors.purple[500]},{value:$p.InstrumentationLibraries,label:ot.INSTRUMENTATION_LIBRARIES,icon:e?e=>t(yl,{...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 $p.IdentifyingAttributes:return t(ae,{children:s?.map((e,n)=>t(Lp,{label:e.name,value:e.value},`attr-${n}-${e.name}`))});case $p.InstrumentationLibraries:return t(ae,{children:c?.map((e,n)=>t(Lp,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},`instr-${n}-${e.name}`))});default:return null}},[u,s,c]),C=i(()=>Op({overrideProcessNum:n,identifyingAttributes:s}),[n,s]);return t("div",{ref:m,children:e(Kt,{bgTint:"800",richTitle:{title:C?`${ot.PROCESS} ${ot.PID(C)}`:ot.PROCESS_FALLBACK_NAME},renderOnRightSide:t(ee,{color:o?ne.Success:ne.Error,size:te.XXXS,children:r?.message}),badges:[{key:"odigos-healthy",status:o?_e.Success:_e.Error,leftIcon:ul,label:o?ot.HEALTHY:ot.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]})})},Rp=b.div`
570
552
  display: flex;
571
553
  align-items: ${({$withHealthBadge:e})=>e?"center":"flex-start"};
572
554
  gap: 8px;
@@ -575,23 +557,23 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
575
557
  &:hover {
576
558
  background-color: ${({theme:e})=>e.v2.colors.silver[700]};
577
559
  }
578
- `,zp=b(ee)`
560
+ `,Dp=b(ee)`
579
561
  flex: 0 0 ${({$withHealthBadge:e})=>e?"auto":"30%"};
580
- `,Xp=b(ee)`
562
+ `,Pp=b(ee)`
581
563
  flex: 1 1 auto;
582
564
  min-width: 0;
583
- `,Bp=b(oe)`
565
+ `,_p=b(oe)`
584
566
  flex: 1 1 auto;
585
567
  justify-content: flex-end;
586
568
  min-width: 0;
587
- `,Up=({label:n,value:o,isStandardLibrary:i,healthy:a,message:l})=>{const r="boolean"==typeof a;return e(Mp,{$withHealthBadge:r,children:[t(zp,{size:te.XXS,color:ne.Secondary,$withHealthBadge:r,children:n}),o&&t(Xp,{size:te.XXS,color:ne.Primary,align:"right",children:o}),(i||r)&&e(Bp,{children:[i&&t(ce,{status:Pe.Info,label:ot.STANDARD,textSize:te.XXXS,invertColors:!0}),r&&e(oe,{$gap:4,children:[l&&t(Xp,{size:te.XXXS,color:ne.Error,align:"right",children:l}),t(ce,{status:a?Pe.Success:Pe.Error,label:a?ot.HEALTHY:ot.NOT_HEALTHY,leftIcon:ul,textSize:te.XXXS,invertColors:!0,tooltip:l??void 0})]})]})]})},Vp=h(null),Hp=({value:e,children:n})=>t(Vp.Provider,{value:e,children:n}),jp=({podContainers:e,sourceContainers:n,jumpToTarget:o})=>{const a=e??[],l=i(()=>({title:ot.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(Kt,{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(Wp,{...e,language:hn(r.get(e.containerName)),jumpToTarget:n?o:null},`pod-container-${e.containerName}`)})})})},Gp=b.div`
569
+ `,Lp=({label:n,value:o,isStandardLibrary:i,healthy:a,message:l})=>{const r="boolean"==typeof a;return e(Rp,{$withHealthBadge:r,children:[t(Dp,{size:te.XXS,color:ne.Secondary,$withHealthBadge:r,children:n}),o&&t(Pp,{size:te.XXS,color:ne.Primary,align:"right",children:o}),(i||r)&&e(_p,{children:[i&&t(ce,{status:_e.Info,label:ot.STANDARD,textSize:te.XXXS,invertColors:!0}),r&&e(oe,{$gap:4,children:[l&&t(Pp,{size:te.XXXS,color:ne.Error,align:"right",children:l}),t(ce,{status:a?_e.Success:_e.Error,label:a?ot.HEALTHY:ot.NOT_HEALTHY,leftIcon:ul,textSize:te.XXXS,invertColors:!0,tooltip:l??void 0})]})]})]})},Fp=h(null),Mp=({value:e,children:n})=>t(Fp.Provider,{value:e,children:n}),zp=({podContainers:e,sourceContainers:n,jumpToTarget:o})=>{const a=e??[],l=i(()=>({title:ot.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(Kt,{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(Bp,{...e,language:hn(r.get(e.containerName)),jumpToTarget:n?o:null},`pod-container-${e.containerName}`)})})})},Xp=b.div`
588
570
  display: flex;
589
571
  flex-direction: column;
590
572
  gap: 12px;
591
573
  padding: 8px 12px;
592
574
  border-radius: 8px;
593
575
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
594
- `,Wp=({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}=ln(),{platformType:C,version:x}=S(),w=rn(C,x),T=sn(v),k=i(()=>({title:o,icon:n?mn(n):Cl,iconWithWrapper:!0}),[o,n]),I=i(()=>{const e=[],t=cn({status:a?dn.Success:dn.Disabled,reasonEnum:a?ot.INSTRUMENTED_WITH_DISTRO(a):ot.UNINSTRUMENTED,message:""});t&&e.push(t);const n=cn(h,ul,"health");n&&e.push(n);const o=cn(m,vl,"health");return o&&e.push(o),e},[m,h,a]),E=i(()=>{const e=[{id:"runningTime",title:ot.RUNNING_TIME,label:l?y(l,{style:"short"}):w?ot.NOT_RUNNING:ot.UNKNOWN_VALUE,labelTooltip:l?`${ot.RUNNING_TIME_TOOLTIP}. (${l})`:w?ot.RUNNING_TIME_TOOLTIP:ot.START_TIME_UNAVAILABLE},{id:"blank",spacer:!0},{id:"started",badge:{status:r?Pe.Success:Pe.Disabled,leftIcon:r?ja:Ga,label:r?ot.STARTED:ot.NOT_STARTED,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"ready",badge:{status:s?Pe.Success:Pe.Disabled,leftIcon:s?ja:Ga,label:s?ot.READY:ot.NOT_READY,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}}];return d&&e.push({id:"isCrashLoop",badge:{status:Pe.Error,leftIcon:Ga,label:ot.CRASHLOOP,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}}),e.push({id:"restartCount",title:ot.RESTARTS,badge:{status:c?Pe.Error:void 0,label:c||0,textSize:te.XXXS}}),e},[l,y,r,s,d,c,w]),N=i(()=>u?Ut(p):"",[u,p]);return t("div",{ref:T,children:e(Kt,{bgTint:"750",richTitle:k,badges:I,items:E,withCollapse:!0,collapseIsDefaultOpen:b,children:[u&&t(Gp,{children:e(oe,{$gap:10,$alignItems:"center",children:[t(on,{variant:gn.Pink,leftIcon:vl,label:N}),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&&Pp({identifyingAttributes:r.identifyingAttributes})===l.processPid);var l,r;return t(Fp,{...e,overrideProcessNum:i,isJumpToTarget:a},`pod-container-${o}-process-${i}`)})]})})},Kp=({podName:e,namespace:n,hasRestarted:o})=>{const a=i(()=>({title:ot.DEBUG_COMMANDS,titleSize:te.XS}),[]),l=i(()=>[{label:ot.GET_POD_YAML,value:`kubectl get pod ${e} -n ${n} -o yaml`},{label:ot.DESCRIBE_POD,value:`kubectl describe pod ${e} -n ${n}`},{label:ot.GET_POD_LOGS,value:`kubectl logs ${e} -n ${n}${o?" -p":""}`}],[e,n,o]);return t(Kt,{bgTint:"800",richTitle:a,withCollapse:!0,children:l.map(({label:e,value:n})=>t(fn,{bgTint:"700",label:e,value:n},e))})},Yp=({source:o,onClickRestartPod:a})=>{const{jumpToTarget:l}=(()=>{const e=m(Vp);if(!e)throw new Error("useJumpToTargetContext must be used within a JumpToTargetContextProvider");return e})(),r=l?.tab===Op.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:ot.PODS,badge:{label:s.length}}),[s.length]);return t(ae,{$gap:12,children:c?e(n,{children:[t(Rp,{podsOdigosHealthStatus:o.podsOdigosHealthStatus,pods:s}),t(Kt,{bgTint:"1000",richTitle:p,children:s.map(n=>{const i=r?.podName===n.podName,l=i&&!r?.containerName;return e($p,{...n,namespace:o.id.namespace,onClickRestartPod:a,collapseIsDefaultOpen:i,isJumpToTarget:l,children:[t(Kp,{podName:n.podName,namespace:o.id.namespace,hasRestarted:d}),t(jp,{podContainers:n.containers,sourceContainers:o.containers,jumpToTarget:i?r:null})]},`pod-${n.podName}`)})})]}):t(bt,{$height:"70vh",children:t($e,{title:ot.NO_RUNNING_PODS,subTitle:ot.NO_RUNNING_PODS_SUBTITLE})})})},Jp="user",qp=({source:n})=>{const o=i(()=>n.serviceName||n.id.name,[n]),{sourcesApi:a}=yr(),{data:l,loading:r,refetch:s}=a.usePeerSources({serviceName:o},{fetchPolicy:"network-only"}),c=l?.peerSources??null;return!c||r?t(bt,r?{$height:"70vh",children:t(xt,{withSpinner:!0})}:{$height:"70vh",children:t($e,{subTitle:ot.COULD_NOT_FETCH_PEER_SOURCES})}):e(oe,{$gap:16,$alignItems:"flex-start",children:[t(Zp,{icon:Sl,title:ot.INBOUND,subTitle:ot.INBOUND_DESCRIPTION(o),onRefresh:s,items:c?.inbound??[]}),t(Zp,{icon:xl,title:ot.OUTBOUND,subTitle:ot.OUTBOUND_DESCRIPTION(o),onRefresh:s,items:c?.outbound??[]})]})},Zp=({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(Kt,{bgTint:"1000",richTitle:{icon:n,title:o,titleSize:te.XS,subTitle:a,subTitleSize:te.XXXS,badge:{label:s.length}},actions:[{id:"refresh",type:bn.Button,buttonProps:{variant:Ie.Secondary,size:ke.S,leftIcon:gl,onClick:r}}],children:[t(vn,{value:c,onChange:d,width:"100%"}),t(yn,{height:"calc(100vh - 284px)",gap:4,elements:p.length||c?!p.length&&c?[t(bt,{$height:"50vh",children:t($e,{icon:n,title:ot.NO_RESULTS,subTitle:ot.NO_RESULTS_FOR_FILTER(c)})},"no-results")]:p.map(e=>t(eu,{...e},`${o}-${e.serviceName}`)):[t(bt,{$height:"50vh",children:t($e,{icon:n,title:`No ${o} connections yet`,subTitle:o===ot.INBOUND?ot.NO_INBOUND_CONNECTIONS_DESCRIPTION:ot.NO_OUTBOUND_CONNECTIONS_DESCRIPTION})},"no-data")]})]})},Qp=b.div`
576
+ `,Bp=({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}=ln(),{platformType:C,version:x}=S(),w=rn(C,x),T=sn(v),k=i(()=>({title:o,icon:n?mn(n):Cl,iconWithWrapper:!0}),[o,n]),I=i(()=>{const e=[],t=cn({status:a?dn.Success:dn.Disabled,reasonEnum:a?ot.INSTRUMENTED_WITH_DISTRO(a):ot.UNINSTRUMENTED,message:""});t&&e.push(t);const n=cn(h,ul,"health");n&&e.push(n);const o=cn(m,vl,"health");return o&&e.push(o),e},[m,h,a]),N=i(()=>{const e=[{id:"runningTime",title:ot.RUNNING_TIME,label:l?y(l,{style:"short"}):w?ot.NOT_RUNNING:ot.UNKNOWN_VALUE,labelTooltip:l?`${ot.RUNNING_TIME_TOOLTIP}. (${l})`:w?ot.RUNNING_TIME_TOOLTIP:ot.START_TIME_UNAVAILABLE},{id:"blank",spacer:!0},{id:"started",badge:{status:r?_e.Success:_e.Disabled,leftIcon:r?ja:Ga,label:r?ot.STARTED:ot.NOT_STARTED,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"ready",badge:{status:s?_e.Success:_e.Disabled,leftIcon:s?ja:Ga,label:s?ot.READY:ot.NOT_READY,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}}];return d&&e.push({id:"isCrashLoop",badge:{status:_e.Error,leftIcon:Ga,label:ot.CRASHLOOP,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}}),e.push({id:"restartCount",title:ot.RESTARTS,badge:{status:c?_e.Error:void 0,label:c||0,textSize:te.XXXS}}),e},[l,y,r,s,d,c,w]),E=i(()=>u?Ut(p):"",[u,p]);return t("div",{ref:T,children:e(Kt,{bgTint:"750",richTitle:k,badges:I,items:N,withCollapse:!0,collapseIsDefaultOpen:b,children:[u&&t(Xp,{children:e(oe,{$gap:10,$alignItems:"center",children:[t(on,{variant:gn.Pink,leftIcon:vl,label:E}),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&&Op({identifyingAttributes:r.identifyingAttributes})===l.processPid);var l,r;return t(Ap,{...e,overrideProcessNum:i,isJumpToTarget:a},`pod-container-${o}-process-${i}`)})]})})},Up=({podName:e,namespace:n,hasRestarted:o})=>{const a=i(()=>({title:ot.DEBUG_COMMANDS,titleSize:te.XS}),[]),l=i(()=>[{label:ot.GET_POD_YAML,value:`kubectl get pod ${e} -n ${n} -o yaml`},{label:ot.DESCRIBE_POD,value:`kubectl describe pod ${e} -n ${n}`},{label:ot.GET_POD_LOGS,value:`kubectl logs ${e} -n ${n}${o?" -p":""}`}],[e,n,o]);return t(Kt,{bgTint:"800",richTitle:a,withCollapse:!0,children:l.map(({label:e,value:n})=>t(fn,{bgTint:"700",label:e,value:n},e))})},Vp=({source:o,onClickRestartPod:a})=>{const{jumpToTarget:l}=(()=>{const e=m(Fp);if(!e)throw new Error("useJumpToTargetContext must be used within a JumpToTargetContextProvider");return e})(),r=l?.tab===wp.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:ot.PODS,badge:{label:s.length}}),[s.length]);return t(ae,{$gap:12,children:c?e(n,{children:[t(Ip,{podsOdigosHealthStatus:o.podsOdigosHealthStatus,pods:s}),t(Kt,{bgTint:"1000",richTitle:p,children:s.map(n=>{const i=r?.podName===n.podName,l=i&&!r?.containerName;return e(Tp,{...n,namespace:o.id.namespace,onClickRestartPod:a,collapseIsDefaultOpen:i,isJumpToTarget:l,children:[t(Up,{podName:n.podName,namespace:o.id.namespace,hasRestarted:d}),t(zp,{podContainers:n.containers,sourceContainers:o.containers,jumpToTarget:i?r:null})]},`pod-${n.podName}`)})})]}):t(bt,{$height:"70vh",children:t($e,{title:ot.NO_RUNNING_PODS,subTitle:ot.NO_RUNNING_PODS_SUBTITLE})})})},Hp="user",jp=({source:n})=>{const o=i(()=>n.serviceName||n.id.name,[n]),{sourcesApi:a}=yr(),{data:l,loading:r,refetch:s}=a.usePeerSources({serviceName:o},{fetchPolicy:"network-only"}),c=l?.peerSources??null;return!c||r?t(bt,r?{$height:"70vh",children:t(xt,{withSpinner:!0})}:{$height:"70vh",children:t($e,{subTitle:ot.COULD_NOT_FETCH_PEER_SOURCES})}):e(oe,{$gap:16,$alignItems:"flex-start",children:[t(Gp,{icon:Sl,title:ot.INBOUND,subTitle:ot.INBOUND_DESCRIPTION(o),onRefresh:s,items:c?.inbound??[]}),t(Gp,{icon:xl,title:ot.OUTBOUND,subTitle:ot.OUTBOUND_DESCRIPTION(o),onRefresh:s,items:c?.outbound??[]})]})},Gp=({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(Kt,{bgTint:"1000",richTitle:{icon:n,title:o,titleSize:te.XS,subTitle:a,subTitleSize:te.XXXS,badge:{label:s.length}},actions:[{id:"refresh",type:bn.Button,buttonProps:{variant:Ie.Secondary,size:ke.S,leftIcon:gl,onClick:r}}],children:[t(vn,{value:c,onChange:d,width:"100%"}),t(yn,{height:"calc(100vh - 284px)",gap:4,elements:p.length||c?!p.length&&c?[t(bt,{$height:"50vh",children:t($e,{icon:n,title:ot.NO_RESULTS,subTitle:ot.NO_RESULTS_FOR_FILTER(c)})},"no-results")]:p.map(e=>t(Kp,{...e},`${o}-${e.serviceName}`)):[t(bt,{$height:"50vh",children:t($e,{icon:n,title:`No ${o} connections yet`,subTitle:o===ot.INBOUND?ot.NO_INBOUND_CONNECTIONS_DESCRIPTION:ot.NO_OUTBOUND_CONNECTIONS_DESCRIPTION})},"no-data")]})]})},Wp=b.div`
595
577
  display: flex;
596
578
  align-items: center;
597
579
  justify-content: space-between;
@@ -605,9 +587,9 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
605
587
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
606
588
  }
607
589
  `}
608
- `,eu=({serviceName:n,isVirtual:o,nodeAttributes:a})=>{const l=Cn(e=>e.drawerEntityId),{items:r}=yr().sourcesApi.useSources(),s=i(()=>r.find(e=>e.id.name===n||e.serviceName===n),[r,n]),c=i(()=>s&&JSON.stringify(Sn(s))!==JSON.stringify(Sn(l)),[s,l]),d=i(()=>{if(o){const e=Object.fromEntries((a??[]).map(({key:e,value:t})=>[e,t]));return[xn({serviceName:n,attributes:e})]}if(n?.toLowerCase()===Jp)return[wl];const e=s?wn(s):void 0;return e?.length?e:[Cl]},[o,a,n,s]),p=c?()=>{const{setDrawerType:e,setDrawerEntityId:t}=Cn.getState();e(kn(Nt.Source)),t({namespace:s?.id.namespace??"",name:s?.id.name??"",kind:s?.id.kind??"",region:s?.id.region??""})}:void 0;return e(Qp,{onClick:p,$withClick:!!p,children:[e(oe,{$gap:8,children:[t(Tn,{icons:d}),t(ee,{size:te.XXS,children:n})]}),o&&t(ce,{status:Pe.Info,label:ot.VIRTUAL,textSize:te.XXXS,invertColors:!0,tooltip:ot.VIRTUAL_TOOLTIP})]})},tu=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}},nu=({source:n})=>{const o=v(),{k8sManifestApi:r}=yr(),[s,c]=l(!0),[d,u]=l(void 0),[h,m]=l(!0),[g,f]=l(void 0),[b,y]=l(!0),[C,S]=l({}),x=p(r);x.current=r,a(()=>{x.current.fetch({namespace:n.id.namespace,kind:n.id.kind,name:n.id.name}).then(({data:e})=>u(tu(e))).finally(()=>c(!1)),x.current.fetch({namespace:n.id.namespace,kind:In.InstrumentationConfig,name:`${n.id.kind}-${n.id.name}`.toLowerCase()}).then(({data:e})=>f(tu(e))).finally(()=>m(!1))},[n.id.namespace,n.id.kind,n.id.name]);const w=i(()=>(n.pods??[]).map(e=>e.podName).join(","),[n.pods]);a(()=>{if(Object.keys(C).length>0)return;const e=w?w.split(","):[];if(0===e.length)return S({}),void y(!1);let t=!1;return y(!0),Promise.all(e.map(async e=>{const{data:t}=await x.current.fetch({namespace:n.id.namespace,kind:In.Pod,name:e});return[e,tu(t)]})).then(e=>{t||S(Object.fromEntries(e))}).finally(()=>{t||y(!1)}),()=>{t=!0}},[C,w,n.id.namespace]);const T=i(()=>[{label:ot.DESCRIBE_POD,value:`kubectl describe ${n.id.kind} ${n.id.name} -n ${n.id.namespace}`},{label:ot.GET_POD_YAML,value:`kubectl get ${n.id.kind} ${n.id.name} -n ${n.id.namespace} -o yaml`},{label:ot.GET_POD_YAML,value:`kubectl get ${In.InstrumentationConfig} ${n.id.kind}-${n.id.name} -n ${n.id.namespace} -o yaml`}],[n.id.kind,n.id.name,n.id.namespace]);return e(Kt,{bgTint:"1000",children:[t(Kt,{bgTint:"900",richTitle:{icon:Tl,title:ot.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:T.map(({label:e,value:n},o)=>t(fn,{label:e,value:n},`debug-cmd-${o}-${e}`))}),s?t(re,{size:1}):t(hr,{bgTint:"800",codeBgColor:o.v2.colors.silver[900],title:`${n.id.kind} YAML`,yaml:d}),h?t(re,{size:1}):t(hr,{bgTint:"800",codeBgColor:o.v2.colors.silver[900],title:"Instrumentation Config YAML",yaml:g}),n.pods?.map(e=>b?t(re,{size:1},e.podName):t(hr,{bgTint:"800",codeBgColor:o.v2.colors.silver[900],title:`Pod ${e.podName} YAML`,yaml:C[e.podName]},e.podName))]})},ou=({title:n,children:o})=>e(ae,{$gap:8,children:[t(ee,{size:te.XXXS,color:ne.Secondary,children:n}),o]}),iu=({source:n})=>{const o=i(()=>{const[e,t]=Nn(n.telemetryMetrics?.[0]?.throughputBytes||0).split(" ");return{value:e,units:t}},[n]);return t(ou,{title:ot.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:$t.Span,children:o.units})]})})},au=({source:n})=>{const{CopyButton:o}=Lt();return t(ou,{title:ot.NAMESPACE,children:e(oe,{children:[t(on,{variant:gn.Blue,label:n.id.namespace}),t(o,{value:n.id.namespace,size:St.XS})]})})},lu=({source:n})=>{const{CopyButton:o}=Lt(),i=n.id.region;return i?t(ou,{title:ot.REGION,children:e(oe,{children:[t(on,{variant:gn.Blue,label:i}),t(o,{value:i,size:St.XS})]})}):null},ru=({source:e})=>{const n=e.markedForInstrumentation?.markedForInstrumentation??!1;return t(ou,{title:ot.ENABLED,children:t(oe,{children:t(on,{variant:n?gn.Green:gn.Default,label:n?ot.ENABLED:ot.DISABLED})})})},su=({source:e,label:n})=>t(ou,{title:ot.KIND,children:t(oe,{children:t(on,{variant:gn.Blue,label:n||e.id.kind})})}),cu=({source:n})=>{const{CopyButton:o}=Lt();return t(ou,{title:ot.NAME,children:e(oe,{children:[t(on,{variant:gn.Blue,label:n.id.name}),t(o,{value:n.id.name,size:St.XS})]})})},du=({source:n})=>{const{CopyButton:o}=Lt(),i=n.serviceName||n.id.name;return t(ou,{title:ot.SERVICE_NAME,children:e(oe,{children:[t(on,{variant:gn.Blue,label:i}),t(o,{value:i,size:St.XS})]})})},pu=({source:n})=>{const{isK8s:o,isConnector:a}=S(),l=i(()=>En(n.id.kind),[n.id.kind]);return t(Kt,{children:e(oe,{$gap:24,$alignItems:"flex-start",$justifyContent:"flex-start",$wrap:"wrap",children:[o&&t(iu,{source:n}),t(ru,{source:n}),a&&t(lu,{source:n}),o&&t(au,{source:n}),t(su,{source:n,label:l}),t(cu,{source:n}),!o&&t(du,{source:n})]})})},uu=({source:e})=>e.pods?.length&&e.podsOdigosHealthStatus?t(Kt,{bgTint:"900",children:t(Rp,{podsOdigosHealthStatus:e.podsOdigosHealthStatus,pods:e.pods,noPadding:!0})}):null,hu=({source:e})=>{const n=i(()=>e.workloadOdigosHealthStatus?{status:e.workloadOdigosHealthStatus.status?On(e.workloadOdigosHealthStatus.status):Pe.Unknown,title:Ut(e.workloadOdigosHealthStatus.reasonEnum),subTitle:e.workloadOdigosHealthStatus.message}:null,[e]);return n?t(Vt,{...n,width:"100%"}):null},mu=h(null),gu=b.div`
590
+ `,Kp=({serviceName:n,isVirtual:o,nodeAttributes:a})=>{const l=Cn(e=>e.drawerEntityId),{items:r}=yr().sourcesApi.useSources(),s=i(()=>r.find(e=>e.id.name===n||e.serviceName===n),[r,n]),c=i(()=>s&&JSON.stringify(Sn(s))!==JSON.stringify(Sn(l)),[s,l]),d=i(()=>{if(o){const e=Object.fromEntries((a??[]).map(({key:e,value:t})=>[e,t]));return[xn({serviceName:n,attributes:e})]}if(n?.toLowerCase()===Hp)return[wl];const e=s?wn(s):void 0;return e?.length?e:[Cl]},[o,a,n,s]),p=c?()=>{const{setDrawerType:e,setDrawerEntityId:t}=Cn.getState();e(kn(Et.Source)),t({namespace:s?.id.namespace??"",name:s?.id.name??"",kind:s?.id.kind??"",region:s?.id.region??""})}:void 0;return e(Wp,{onClick:p,$withClick:!!p,children:[e(oe,{$gap:8,children:[t(Tn,{icons:d}),t(ee,{size:te.XXS,children:n})]}),o&&t(ce,{status:_e.Info,label:ot.VIRTUAL,textSize:te.XXXS,invertColors:!0,tooltip:ot.VIRTUAL_TOOLTIP})]})},Yp=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}},Jp=({source:n})=>{const o=v(),{k8sManifestApi:r}=yr(),[s,c]=l(!0),[d,u]=l(void 0),[h,m]=l(!0),[g,f]=l(void 0),[b,y]=l(!0),[C,S]=l({}),x=p(r);x.current=r,a(()=>{x.current.fetch({namespace:n.id.namespace,kind:n.id.kind,name:n.id.name}).then(({data:e})=>u(Yp(e))).finally(()=>c(!1)),x.current.fetch({namespace:n.id.namespace,kind:In.InstrumentationConfig,name:`${n.id.kind}-${n.id.name}`.toLowerCase()}).then(({data:e})=>f(Yp(e))).finally(()=>m(!1))},[n.id.namespace,n.id.kind,n.id.name]);const w=i(()=>(n.pods??[]).map(e=>e.podName).join(","),[n.pods]);a(()=>{if(Object.keys(C).length>0)return;const e=w?w.split(","):[];if(0===e.length)return S({}),void y(!1);let t=!1;return y(!0),Promise.all(e.map(async e=>{const{data:t}=await x.current.fetch({namespace:n.id.namespace,kind:In.Pod,name:e});return[e,Yp(t)]})).then(e=>{t||S(Object.fromEntries(e))}).finally(()=>{t||y(!1)}),()=>{t=!0}},[C,w,n.id.namespace]);const T=i(()=>[{label:ot.DESCRIBE_POD,value:`kubectl describe ${n.id.kind} ${n.id.name} -n ${n.id.namespace}`},{label:ot.GET_POD_YAML,value:`kubectl get ${n.id.kind} ${n.id.name} -n ${n.id.namespace} -o yaml`},{label:ot.GET_POD_YAML,value:`kubectl get ${In.InstrumentationConfig} ${n.id.kind}-${n.id.name} -n ${n.id.namespace} -o yaml`}],[n.id.kind,n.id.name,n.id.namespace]);return e(Kt,{bgTint:"1000",children:[t(Kt,{bgTint:"900",richTitle:{icon:Tl,title:ot.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:T.map(({label:e,value:n},o)=>t(fn,{label:e,value:n},`debug-cmd-${o}-${e}`))}),s?t(re,{size:1}):t(hr,{bgTint:"800",codeBgColor:o.v2.colors.silver[900],title:`${n.id.kind} YAML`,yaml:d}),h?t(re,{size:1}):t(hr,{bgTint:"800",codeBgColor:o.v2.colors.silver[900],title:"Instrumentation Config YAML",yaml:g}),n.pods?.map(e=>b?t(re,{size:1},e.podName):t(hr,{bgTint:"800",codeBgColor:o.v2.colors.silver[900],title:`Pod ${e.podName} YAML`,yaml:C[e.podName]},e.podName))]})},qp=({title:n,children:o})=>e(ae,{$gap:8,children:[t(ee,{size:te.XXXS,color:ne.Secondary,children:n}),o]}),Zp=({source:n})=>{const o=i(()=>{const[e,t]=En(n.telemetryMetrics?.[0]?.throughputBytes||0).split(" ");return{value:e,units:t}},[n]);return t(qp,{title:ot.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:$t.Span,children:o.units})]})})},Qp=({source:n})=>{const{CopyButton:o}=Lt();return t(qp,{title:ot.NAMESPACE,children:e(oe,{children:[t(on,{variant:gn.Blue,label:n.id.namespace}),t(o,{value:n.id.namespace,size:St.XS})]})})},eu=({source:n})=>{const{CopyButton:o}=Lt(),i=n.id.region;return i?t(qp,{title:ot.REGION,children:e(oe,{children:[t(on,{variant:gn.Blue,label:i}),t(o,{value:i,size:St.XS})]})}):null},tu=({source:e})=>{const n=e.markedForInstrumentation?.markedForInstrumentation??!1;return t(qp,{title:ot.ENABLED,children:t(oe,{children:t(on,{variant:n?gn.Green:gn.Default,label:n?ot.ENABLED:ot.DISABLED})})})},nu=({source:e,label:n})=>t(qp,{title:ot.KIND,children:t(oe,{children:t(on,{variant:gn.Blue,label:n||e.id.kind})})}),ou=({source:n})=>{const{CopyButton:o}=Lt();return t(qp,{title:ot.NAME,children:e(oe,{children:[t(on,{variant:gn.Blue,label:n.id.name}),t(o,{value:n.id.name,size:St.XS})]})})},iu=({source:n})=>{const{CopyButton:o}=Lt(),i=n.serviceName||n.id.name;return t(qp,{title:ot.SERVICE_NAME,children:e(oe,{children:[t(on,{variant:gn.Blue,label:i}),t(o,{value:i,size:St.XS})]})})},au=({source:n})=>{const{isK8s:o,isConnector:a}=S(),l=i(()=>Nn(n.id.kind),[n.id.kind]);return t(Kt,{children:e(oe,{$gap:24,$alignItems:"flex-start",$justifyContent:"flex-start",$wrap:"wrap",children:[o&&t(Zp,{source:n}),t(tu,{source:n}),a&&t(eu,{source:n}),o&&t(Qp,{source:n}),t(nu,{source:n,label:l}),t(ou,{source:n}),!o&&t(iu,{source:n})]})})},lu=({source:e})=>e.pods?.length&&e.podsOdigosHealthStatus?t(Kt,{bgTint:"900",children:t(Ip,{podsOdigosHealthStatus:e.podsOdigosHealthStatus,pods:e.pods,noPadding:!0})}):null,ru=({source:e})=>{const n=i(()=>e.workloadOdigosHealthStatus?{status:e.workloadOdigosHealthStatus.status?On(e.workloadOdigosHealthStatus.status):_e.Unknown,title:Ut(e.workloadOdigosHealthStatus.reasonEnum),subTitle:e.workloadOdigosHealthStatus.message}:null,[e]);return n?t(Vt,{...n,width:"100%"}):null},su=h(null),cu=b.div`
609
591
  position: relative;
610
- `,fu=({children:e})=>{const n=p(null);return t(gu,{ref:n,children:t(mu.Provider,{value:n,children:e})})},bu=b.div`
592
+ `,du=({children:e})=>{const n=p(null);return t(cu,{ref:n,children:t(su.Provider,{value:n,children:e})})},pu=b.div`
611
593
  position: fixed;
612
594
  top: ${({$coords:e})=>e.top}px;
613
595
  right: ${({$coords:e})=>e.right}px;
@@ -621,25 +603,25 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
621
603
  padding: 12px 16px;
622
604
  border-radius: 12px;
623
605
  background-color: ${({theme:e})=>e.v2.colors.silver[750]};
624
- `,vu=b.div`
606
+ `,uu=b.div`
625
607
  display: flex;
626
608
  align-items: flex-end;
627
609
  justify-content: space-between;
628
610
  gap: 8px;
629
- `,yu=b.div`
611
+ `,hu=b.div`
630
612
  flex: 1;
631
- `,Cu=({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(mu),[y,C]=l(null);return $n(b??{current:null},o),g(()=>{const e=b?.current?.getBoundingClientRect();e&&C({top:e.bottom+4,right:window.innerWidth-e.left-24})},[b]),y?Br(e(bu,{$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(vu,{children:[t(yu,{children:u}),e(oe,{$gap:8,$width:"fit-content",$margin:`0 0 ${h||0} 0`,children:[t(Te,{variant:Ie.Secondary,onClick:r,leftIcon:Ua,tooltip:s,hideTooltipIcon:!0,iconSize:16,size:ke.S,textColor:f.v2.colors.red[500]}),t(Te,{variant:Ie.Primary,onClick:i,leftIcon:nl,tooltip:a,hideTooltipIcon:!0,iconSize:16,size:ke.S})]})]}),t("div",{children:t(_e,{status:Pe.Warning,message:p})})]}),document.body):null},Su=({language:n,overridden:o,onOverride:a,defaultValues:r})=>{const{tier:s}=S(),{formData:c,handleFormChange:d,resetFormData:p}=qt(r),u=i(()=>{if(!n)return[];const e=An[n].community,t=s===Rn.Onprem?An[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:ot.OVERIDDEN}):null,e(fu,{children:[t(Ue,{text:ot.OVERRIDE_OTEL_DISTRO_NAME,children:t(Ct,{icon:Ya,onClick:b})}),g&&t(Cu,{width:"500px",onClose:b,onSave:async()=>{m(!0),await a(c),m(!1),b()},saveTooltip:ot.OVERRIDE_OTEL_DISTRO_NAME_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await a({otelDistroName:null}),m(!1),b()},deleteTooltip:ot.OVERRIDE_OTEL_DISTRO_NAME_DELETE_TOOLTIP,title:ot.OVERRIDE_OTEL_DISTRO_NAME,subTitle:ot.OVERRIDE_OTEL_DISTRO_NAME_SUBTITLE,warning:ot.OVERRIDE_OTEL_DISTRO_NAME_WARNING,children:t(yt,{label:ot.OTEL_DISTRO_NAME,options:u,values:c.otelDistroName?[c.otelDistroName]:[],setValues:e=>d("otelDistroName",e[0])})})]})]})},xu=({overridden:n,onOverride:o,defaultValues:a,originalValues:r})=>{const{addNotification:s}=nn(),{formData:c,handleFormChange:d,resetFormData:p}=qt(a),u=i(()=>Dn.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:ot.OVERIDDEN}):null,e(fu,{children:[t(Ue,{text:ot.OVERRIDE_RUNTIME_DETAILS,children:t(Ct,{icon:Ya,onClick:b})}),g&&t(Cu,{width:"500px",onClose:b,onSave:async()=>{!c.version||_n(c.version)?(m(!0),await o(c),m(!1),b()):s({type:Pe.Warning,message:Ye.INVALID_VERSION,hideFromHistory:!0})},saveTooltip:ot.OVERRIDE_RUNTIME_DETAILS_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await o({language:null,version:""}),m(!1),b()},deleteTooltip:ot.OVERRIDE_RUNTIME_DETAILS_DELETE_TOOLTIP,title:ot.OVERRIDE_RUNTIME_DETAILS,subTitle:ot.OVERRIDE_RUNTIME_DETAILS_SUBTITLE,warning:ot.OVERRIDE_RUNTIME_WARNING,pushButtonsWith:"20px",children:e(oe,{$gap:8,children:[t(yt,{label:ot.LANGUAGE,options:u,values:c.language?[c.language]:[],setValues:e=>d("language",e[0]),helpMessage:`Auto-detected: ${r.language||"none"}`}),t(Ee,{label:ot.RUNTIME_VERSION,placeholder:ot.VERSION_PLACEHOLDER,value:c.version,onChange:e=>d("version",e.target.value),helpMessage:`Auto-detected: ${r.version||"none"}`})]})})]})]})},wu=b.div`
613
+ `,mu=({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(su),[y,C]=l(null);return $n(b??{current:null},o),g(()=>{const e=b?.current?.getBoundingClientRect();e&&C({top:e.bottom+4,right:window.innerWidth-e.left-24})},[b]),y?Br(e(pu,{$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(uu,{children:[t(hu,{children:u}),e(oe,{$gap:8,$width:"fit-content",$margin:`0 0 ${h||0} 0`,children:[t(Te,{variant:Ie.Secondary,onClick:r,leftIcon:Ua,tooltip:s,hideTooltipIcon:!0,iconSize:16,size:ke.S,textColor:f.v2.colors.red[500]}),t(Te,{variant:Ie.Primary,onClick:i,leftIcon:nl,tooltip:a,hideTooltipIcon:!0,iconSize:16,size:ke.S})]})]}),t("div",{children:t(Pe,{status:_e.Warning,message:p})})]}),document.body):null},gu=({language:n,overridden:o,onOverride:a,defaultValues:r})=>{const{tier:s}=S(),{formData:c,handleFormChange:d,resetFormData:p}=qt(r),u=i(()=>{if(!n)return[];const e=An[n].community,t=s===Rn.Onprem?An[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:_e.Info,invertColors:!0,label:ot.OVERIDDEN}):null,e(du,{children:[t(Ue,{text:ot.OVERRIDE_OTEL_DISTRO_NAME,children:t(Ct,{icon:Ya,onClick:b})}),g&&t(mu,{width:"500px",onClose:b,onSave:async()=>{m(!0),await a(c),m(!1),b()},saveTooltip:ot.OVERRIDE_OTEL_DISTRO_NAME_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await a({otelDistroName:null}),m(!1),b()},deleteTooltip:ot.OVERRIDE_OTEL_DISTRO_NAME_DELETE_TOOLTIP,title:ot.OVERRIDE_OTEL_DISTRO_NAME,subTitle:ot.OVERRIDE_OTEL_DISTRO_NAME_SUBTITLE,warning:ot.OVERRIDE_OTEL_DISTRO_NAME_WARNING,children:t(yt,{label:ot.OTEL_DISTRO_NAME,options:u,values:c.otelDistroName?[c.otelDistroName]:[],setValues:e=>d("otelDistroName",e[0])})})]})]})},fu=({overridden:n,onOverride:o,defaultValues:a,originalValues:r})=>{const{addNotification:s}=nn(),{formData:c,handleFormChange:d,resetFormData:p}=qt(a),u=i(()=>Dn.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:_e.Info,invertColors:!0,label:ot.OVERIDDEN}):null,e(du,{children:[t(Ue,{text:ot.OVERRIDE_RUNTIME_DETAILS,children:t(Ct,{icon:Ya,onClick:b})}),g&&t(mu,{width:"500px",onClose:b,onSave:async()=>{!c.version||Pn(c.version)?(m(!0),await o(c),m(!1),b()):s({type:_e.Warning,message:Ye.INVALID_VERSION,hideFromHistory:!0})},saveTooltip:ot.OVERRIDE_RUNTIME_DETAILS_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await o({language:null,version:""}),m(!1),b()},deleteTooltip:ot.OVERRIDE_RUNTIME_DETAILS_DELETE_TOOLTIP,title:ot.OVERRIDE_RUNTIME_DETAILS,subTitle:ot.OVERRIDE_RUNTIME_DETAILS_SUBTITLE,warning:ot.OVERRIDE_RUNTIME_WARNING,pushButtonsWith:"20px",children:e(oe,{$gap:8,children:[t(yt,{label:ot.LANGUAGE,options:u,values:c.language?[c.language]:[],setValues:e=>d("language",e[0]),helpMessage:`Auto-detected: ${r.language||"none"}`}),t(Ne,{label:ot.RUNTIME_VERSION,placeholder:ot.VERSION_PLACEHOLDER,value:c.version,onChange:e=>d("version",e.target.value),helpMessage:`Auto-detected: ${r.version||"none"}`})]})})]})]})},bu=b.div`
632
614
  display: flex;
633
615
  flex-direction: column;
634
616
  gap: 10px;
635
617
  padding: 10px 12px 10px 20px;
636
618
  border-radius: 8px;
637
619
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
638
- `,Tu=b.div`
620
+ `,vu=b.div`
639
621
  display: flex;
640
622
  flex-wrap: wrap;
641
623
  gap: 12px 24px;
642
- `,ku=({title:n,children:o})=>e(ae,{$gap:4,children:[t(ee,{size:te.XXXS,color:ne.Secondary,children:n}),o]}),Iu=({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:`${ot.PROCESSES} (${o.length})`}),o.map(n=>{const o=n.exe?.trim()||null,i=n.cmdline?.trim()||null;return e(wu,{children:[t(Tu,{children:t(ku,{title:ot.PROCESS_PID,children:t(ee,{size:te.XS,children:String(n.pid)})})}),o?t(fn,{label:ot.EXECUTABLE,value:o,bgTint:"900"}):null,i&&i!==o?t(fn,{label:ot.COMMAND,value:i,bgTint:"900"}):null]},n.pid)})]}):null},Eu=b.div`
624
+ `,yu=({title:n,children:o})=>e(ae,{$gap:4,children:[t(ee,{size:te.XXXS,color:ne.Secondary,children:n}),o]}),Cu=({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:`${ot.PROCESSES} (${o.length})`}),o.map(n=>{const o=n.exe?.trim()||null,i=n.cmdline?.trim()||null;return e(bu,{children:[t(vu,{children:t(yu,{title:ot.PROCESS_PID,children:t(ee,{size:te.XS,children:String(n.pid)})})}),o?t(fn,{label:ot.EXECUTABLE,value:o,bgTint:"900"}):null,i&&i!==o?t(fn,{label:ot.COMMAND,value:i,bgTint:"900"}):null]},n.pid)})]}):null},Su=b.div`
643
625
  display: flex;
644
626
  flex-direction: column;
645
627
  align-self: stretch;
@@ -647,14 +629,14 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
647
629
  padding: 8px 12px;
648
630
  border-radius: 8px;
649
631
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
650
- `,Nu=b.div`
632
+ `,xu=b.div`
651
633
  display: flex;
652
634
  align-items: center;
653
635
  justify-content: center;
654
636
  padding: 8px;
655
637
  border-radius: 10px;
656
638
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
657
- `,Ou=e=>{if(!e)return Pn.Unknown;const t=e.trim().toLowerCase();return{go:Pn.Go,golang:Pn.Go,javascript:Pn.JavaScript,js:Pn.JavaScript,node:Pn.JavaScript,nodejs:Pn.JavaScript,typescript:Pn.JavaScript,python:Pn.Python,java:Pn.Java,dotnet:Pn.DotNet,csharp:Pn.CSharp,php:Pn.Php,ruby:Pn.Ruby,rust:Pn.Rust,swift:Pn.Swift,elixir:Pn.Elixir}[t]??Pn.Unknown},$u=({source:n})=>{const o=v(),{isK8s:a,isVm:l}=S(),{sourcesApi:r}=yr(),s=n.instrumentationReport,c=n.sourceConfig,d=l?s?.processes:null,p=i(()=>!(!c?.runtimeOverride?.language&&!c?.runtimeOverride?.version),[c]),u=i(()=>{const e=Ou(s?.runtimeLanguage);return e!==Pn.Unknown?e:n.runtimeInfo?.detectedLanguages?.[0]??Pn.Unknown},[s?.runtimeLanguage,n.runtimeInfo?.detectedLanguages]),h=s?.runtimeVersion?.trim()||"",m=i(()=>{const e=Ou(c?.runtimeOverride?.language);return{language:e!==Pn.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!==Pn.Unknown||t?e!==Pn.Unknown&&t?`${e} • ${t}`:e!==Pn.Unknown?e:t||null:null},[m]),y=!b&&!p&&"Instrumenting"===s?.state,C=i(()=>y||m.language===Pn.Unknown?Cl:mn(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:Ut(s?.progressStage||e)||e}:"NotImplemented"===e||"Unsupported"===e?{status:Pe.Disabled,leftIcon:Ga,label:Ut(e)||e}:"Error"===e?{status:Pe.Error,leftIcon:Ga,label:"Error"}:t?{status:Pe.Success,leftIcon:ja,label:n?`Instrumented | ${n}`:"Instrumented"}:{status:Pe.Disabled,leftIcon:Ga,label:ot.UNINSTRUMENTED}},[s,c]),w=e=>r.update(n.id,{...g?f:{},...p?{language:m.language!==Pn.Unknown?m.language:void 0,version:m.version}:{},...e});return a?null:s?t(Kt,{bgTint:"1000",richTitle:{title:ot.INSTRUMENTATION,tooltip:ot.INSTRUMENTATION_DESCRIPTION,badge:{label:1}},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(ae,{$gap:8,children:e(Eu,{children:[e(oe,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(oe,{$gap:8,$alignItems:"center",children:[t(Nu,{children:t(C,{size:24,fill:y||m.language===Pn.Unknown?o.v2.colors.grey[400]:void 0})}),t(ee,{children:n.id.name}),y?t(on,{variant:gn.Loader,label:ot.DETECTING_RUNTIME_INFO}):b?t(on,{variant:gn.Blue,label:b}):null,t(xu,{overridden:p,onOverride:w,defaultValues:{language:m.language!==Pn.Unknown?m.language:void 0,version:m.version||""},originalValues:{language:u!==Pn.Unknown?u:void 0,version:h}})]}),e(oe,{$gap:8,$alignItems:"center",children:[t(ce,{...x,textSize:te.XXXS}),t(Su,{language:m.language!==Pn.Unknown?m.language:null,overridden:g,onOverride:w,defaultValues:f})]})]}),d?.length?t(Iu,{processes:d}):null]})})}):null},Au="100%",Ru=b(oe)`
639
+ `,wu=e=>{if(!e)return _n.Unknown;const t=e.trim().toLowerCase();return{go:_n.Go,golang:_n.Go,javascript:_n.JavaScript,js:_n.JavaScript,node:_n.JavaScript,nodejs:_n.JavaScript,typescript:_n.JavaScript,python:_n.Python,java:_n.Java,dotnet:_n.DotNet,csharp:_n.CSharp,php:_n.Php,ruby:_n.Ruby,rust:_n.Rust,swift:_n.Swift,elixir:_n.Elixir}[t]??_n.Unknown},Tu=({source:n})=>{const o=v(),{isK8s:a,isVm:l}=S(),{sourcesApi:r}=yr(),s=n.instrumentationReport,c=n.sourceConfig,d=l?s?.processes:null,p=i(()=>!(!c?.runtimeOverride?.language&&!c?.runtimeOverride?.version),[c]),u=i(()=>{const e=wu(s?.runtimeLanguage);return e!==_n.Unknown?e:n.runtimeInfo?.detectedLanguages?.[0]??_n.Unknown},[s?.runtimeLanguage,n.runtimeInfo?.detectedLanguages]),h=s?.runtimeVersion?.trim()||"",m=i(()=>{const e=wu(c?.runtimeOverride?.language);return{language:e!==_n.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!==_n.Unknown||t?e!==_n.Unknown&&t?`${e} • ${t}`:e!==_n.Unknown?e:t||null:null},[m]),y=!b&&!p&&"Instrumenting"===s?.state,C=i(()=>y||m.language===_n.Unknown?Cl:mn(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:_e.Loading,label:Ut(s?.progressStage||e)||e}:"NotImplemented"===e||"Unsupported"===e?{status:_e.Disabled,leftIcon:Ga,label:Ut(e)||e}:"Error"===e?{status:_e.Error,leftIcon:Ga,label:"Error"}:t?{status:_e.Success,leftIcon:ja,label:n?`Instrumented | ${n}`:"Instrumented"}:{status:_e.Disabled,leftIcon:Ga,label:ot.UNINSTRUMENTED}},[s,c]),w=e=>r.update(n.id,{...g?f:{},...p?{language:m.language!==_n.Unknown?m.language:void 0,version:m.version}:{},...e});return a?null:s?t(Kt,{bgTint:"1000",richTitle:{title:ot.INSTRUMENTATION,tooltip:ot.INSTRUMENTATION_DESCRIPTION,badge:{label:1}},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(ae,{$gap:8,children:e(Su,{children:[e(oe,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(oe,{$gap:8,$alignItems:"center",children:[t(xu,{children:t(C,{size:24,fill:y||m.language===_n.Unknown?o.v2.colors.grey[400]:void 0})}),t(ee,{children:n.id.name}),y?t(on,{variant:gn.Loader,label:ot.DETECTING_RUNTIME_INFO}):b?t(on,{variant:gn.Blue,label:b}):null,t(fu,{overridden:p,onOverride:w,defaultValues:{language:m.language!==_n.Unknown?m.language:void 0,version:m.version||""},originalValues:{language:u!==_n.Unknown?u:void 0,version:h}})]}),e(oe,{$gap:8,$alignItems:"center",children:[t(ce,{...x,textSize:te.XXXS}),t(gu,{language:m.language!==_n.Unknown?m.language:null,overridden:g,onOverride:w,defaultValues:f})]})]}),d?.length?t(Cu,{processes:d}):null]})})}):null},ku="100%",Iu=b(oe)`
658
640
  @media (max-width: 1099px) {
659
641
  flex-direction: column;
660
642
 
@@ -662,12 +644,12 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
662
644
  width: 100%;
663
645
  }
664
646
  }
665
- `,Du=(e,t)=>e?e.toLowerCase().includes(t.toLowerCase())?Ut(e):`${t} ${Ut(e)}`:t,_u=b(oe)`
647
+ `,Nu=(e,t)=>e?e.toLowerCase().includes(t.toLowerCase())?Ut(e):`${t} ${Ut(e)}`:t,Eu=b(oe)`
666
648
  width: fit-content;
667
649
  padding: 2px 6px;
668
650
  border-radius: 8px;
669
651
  background-color: ${({theme:e})=>e.v2.colors.silver[750]};
670
- `,Pu=({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(_u,{$gap:12,$wrap:"wrap",children:a.map(({id:a,count:l,ok:r,label:s})=>{const c=r?Pe.Success:o,d=Fn(c,i);return e(oe,{$gap:2,children:[t(d,{size:16,fill:Ln(i,c,"300")}),t(ee,{size:te.XXXS,color:ne.Secondary,children:`${l}/${n?.totalPods??0} ${s}`})]},a)})}):null},Lu=({changedTime:e})=>{const{formatTimeAgo:n}=ln();return t(ee,{size:te.XXXS,color:ne.Disable,nowrap:!0,children:`Agent Assignment Updated · ${n(e)}`})},Fu=({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=pn(e);if(!s)return null;const c=Du(i,ot.ROLLOUT),d=a,p=(r??[]).flatMap(e=>[{"data-id":`rollout-action-${e.type}`,label:e.buttonText,hideTooltipIcon:!0,leftIcon:kl,onClick:o}]);return{status:s,title:c,subTitle:d,details:t(Pu,{overview:n.rollout?.podsManifestInjectionOverview,status:s}),actionDetails:n.rollout?.agentsMetaHashChangedTime?t(Lu,{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=pn(e);if(!l)return null;const r=Du(t,ot.ROLLBACK),s=o,c=(i??[]).flatMap(e=>[{"data-id":`rollback-action-${e.type}`,label:e.buttonText,hideTooltipIcon:!0,leftIcon:gl,onClick:a}]);return c.length||l===Pe.Success||c.push({"data-id":"rollback-action",label:ot.ROLLBACK,tooltip:"Recover the workload from the last rollback",hideTooltipIcon:!0,leftIcon:gl,onClick:a}),{status:l,title:r,subTitle:s,actionButtons:c}},[n,a]);return r||s?e(Ru,{$gap:12,$alignItems:"stretch",children:[r&&t(Vt,{invertColors:!0,slim:!0,width:s?"calc(60% - 6px)":Au,...r}),s&&t(Vt,{invertColors:!0,slim:!0,width:r?"calc(40% - 6px)":Au,...s})]}):null},Mu=({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} ${ot.CONTAINERS}`:ot.DETECTED_PROCESSES,tooltip:t?.message||(n?ot.DETECTED_CONTAINERS_DESCRIPTION:ot.DETECTED_PROCESSES_DESCRIPTION),badge:pn(t?.status)===Pe.Loading?{status:Pe.Loading,backgroundColor:"transparent"}:{label:e?.containers?.length}}}},[e,n]);return o.length?t(Kt,{bgTint:"1000",richTitle:a,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(ae,{$gap:8,children:o.map(n=>n&&t(Uu,{...n,sourceId:e.id},`source-container-${n.containerName}`))})}):null},zu=b.div`
652
+ `,Ou=({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(Eu,{$gap:12,$wrap:"wrap",children:a.map(({id:a,count:l,ok:r,label:s})=>{const c=r?_e.Success:o,d=Fn(c,i);return e(oe,{$gap:2,children:[t(d,{size:16,fill:Ln(i,c,"300")}),t(ee,{size:te.XXXS,color:ne.Secondary,children:`${l}/${n?.totalPods??0} ${s}`})]},a)})}):null},$u=({changedTime:e})=>{const{formatTimeAgo:n}=ln();return t(ee,{size:te.XXXS,color:ne.Disable,nowrap:!0,children:`Agent Assignment Updated · ${n(e)}`})},Au=({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=pn(e);if(!s)return null;const c=Nu(i,ot.ROLLOUT),d=a,p=(r??[]).flatMap(e=>[{"data-id":`rollout-action-${e.type}`,label:e.buttonText,hideTooltipIcon:!0,leftIcon:kl,onClick:o}]);return{status:s,title:c,subTitle:d,details:t(Ou,{overview:n.rollout?.podsManifestInjectionOverview,status:s}),actionDetails:n.rollout?.agentsMetaHashChangedTime?t($u,{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=pn(e);if(!l)return null;const r=Nu(t,ot.ROLLBACK),s=o,c=(i??[]).flatMap(e=>[{"data-id":`rollback-action-${e.type}`,label:e.buttonText,hideTooltipIcon:!0,leftIcon:gl,onClick:a}]);return c.length||l===_e.Success||c.push({"data-id":"rollback-action",label:ot.ROLLBACK,tooltip:"Recover the workload from the last rollback",hideTooltipIcon:!0,leftIcon:gl,onClick:a}),{status:l,title:r,subTitle:s,actionButtons:c}},[n,a]);return r||s?e(Iu,{$gap:12,$alignItems:"stretch",children:[r&&t(Vt,{invertColors:!0,slim:!0,width:s?"calc(60% - 6px)":ku,...r}),s&&t(Vt,{invertColors:!0,slim:!0,width:r?"calc(40% - 6px)":ku,...s})]}):null},Ru=({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} ${ot.CONTAINERS}`:ot.DETECTED_PROCESSES,tooltip:t?.message||(n?ot.DETECTED_CONTAINERS_DESCRIPTION:ot.DETECTED_PROCESSES_DESCRIPTION),badge:pn(t?.status)===_e.Loading?{status:_e.Loading,backgroundColor:"transparent"}:{label:e?.containers?.length}}}},[e,n]);return o.length?t(Kt,{bgTint:"1000",richTitle:a,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(ae,{$gap:8,children:o.map(n=>n&&t(Lu,{...n,sourceId:e.id},`source-container-${n.containerName}`))})}):null},Du=b.div`
671
653
  display: flex;
672
654
  flex-direction: column;
673
655
  align-self: stretch;
@@ -675,26 +657,26 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
675
657
  padding: 8px 12px;
676
658
  border-radius: 8px;
677
659
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
678
- `,Xu=b.div`
660
+ `,Pu=b.div`
679
661
  display: flex;
680
662
  align-items: center;
681
663
  justify-content: center;
682
664
  padding: 8px;
683
665
  border-radius: 10px;
684
666
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
685
- `,Bu=b.div`
667
+ `,_u=b.div`
686
668
  display: flex;
687
669
  flex-direction: column;
688
670
  gap: 12px;
689
671
  padding: 8px 12px;
690
672
  border-radius: 8px;
691
673
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
692
- `,Uu=({sourceId:n,...o})=>{const{containerName:a,runtimeInfo:l,agentEnabled:r,overrides:s}=o,c=v(),{sourcesApi:d}=yr(),p=i(()=>!!s?.runtimeInfo?.language||!!s?.runtimeInfo?.runtimeVersion,[s]),u=i(()=>({language:hn(o),version:Mn(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?Cl:mn(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:ot.WAITING_FOR_RUNTIME_DETECTION}:{status:r?.otelDistroName?Pe.Success:Pe.Disabled,leftIcon:r?.otelDistroName?ja:Ga,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(ot.HEAD_SAMPLING),(o.collectorConfig?.tailSampling?.noisyOperations?.length||o.collectorConfig?.tailSampling?.highlyRelevantOperations?.length||o.collectorConfig?.tailSampling?.costReductionRules?.length)&&e.push(ot.TAIL_SAMPLING),e},[o]);return e(zu,{children:[e(oe,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(oe,{$gap:8,$alignItems:"center",children:[t(Xu,{children:t(f,{size:24,fill:l?void 0:c.v2.colors.grey[400]})}),t(ee,{children:a}),t(on,b?{variant:gn.Blue,label:b}:{variant:gn.Loader,label:ot.DETECTING_RUNTIME_INFO}),t(xu,{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(Su,{language:u.language,overridden:h,onOverride:C,defaultValues:m})]})]}),!r||r.agentEnabled||g?null:t(Bu,{children:e(oe,{$gap:10,$alignItems:"center",children:[t(on,{variant:gn.Pink,label:Ut(r.agentEnabledStatus?.reasonEnum)||ot.NO_AVAILABLE_AGENT}),t(ee,{size:te.XXXS,color:ne.Secondary,children:r?.agentEnabledStatus?.message})]})}),S.length>0&&t(Bu,{children:t(oe,{$gap:16,$wrap:"wrap",children:S.map((e,n)=>t(ce,{label:e,leftIcon:ja,status:Pe.Success,invertColors:!0,useSecondaryTone:!0},`${a}-rule-${n}`))})})]})},Vu=({source:n,onClickRollout:o,onClickRollback:a})=>{const{isK8s:l,platformType:r,version:s}=S(),c=i(()=>zn(r,s)?Bt(Xn(n.conditions)):[],[r,s,n.conditions]);return e(ae,{$gap:12,children:[t(pu,{source:n}),t(hu,{source:n}),l&&t(Fu,{source:n,onClickRollout:o,onClickRollback:a}),!!c.length&&t(Yt,{conditions:c,title:ot.INSTRUMENTATION_LIFECYCLE}),l&&t(Mu,{source:n}),!l&&t($u,{source:n}),l&&t(uu,{source:n})]})},Hu=({source:e})=>{const n=e.containers||[];return t(Kt,{bgTint:"1000",richTitle:{title:ot.INSTRUMENTED_LIBRARIES},children:n.length?n.map(e=>{const n=e.instrumentations||[];return t(Kt,{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(Up,{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"})})},ju=b(ae)`
674
+ `,Lu=({sourceId:n,...o})=>{const{containerName:a,runtimeInfo:l,agentEnabled:r,overrides:s}=o,c=v(),{sourcesApi:d}=yr(),p=i(()=>!!s?.runtimeInfo?.language||!!s?.runtimeInfo?.runtimeVersion,[s]),u=i(()=>({language:hn(o),version:Mn(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?Cl:mn(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:_e.Loading,label:ot.WAITING_FOR_RUNTIME_DETECTION}:{status:r?.otelDistroName?_e.Success:_e.Disabled,leftIcon:r?.otelDistroName?ja:Ga,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(ot.HEAD_SAMPLING),(o.collectorConfig?.tailSampling?.noisyOperations?.length||o.collectorConfig?.tailSampling?.highlyRelevantOperations?.length||o.collectorConfig?.tailSampling?.costReductionRules?.length)&&e.push(ot.TAIL_SAMPLING),e},[o]);return e(Du,{children:[e(oe,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(oe,{$gap:8,$alignItems:"center",children:[t(Pu,{children:t(f,{size:24,fill:l?void 0:c.v2.colors.grey[400]})}),t(ee,{children:a}),t(on,b?{variant:gn.Blue,label:b}:{variant:gn.Loader,label:ot.DETECTING_RUNTIME_INFO}),t(fu,{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(gu,{language:u.language,overridden:h,onOverride:C,defaultValues:m})]})]}),!r||r.agentEnabled||g?null:t(_u,{children:e(oe,{$gap:10,$alignItems:"center",children:[t(on,{variant:gn.Pink,label:Ut(r.agentEnabledStatus?.reasonEnum)||ot.NO_AVAILABLE_AGENT}),t(ee,{size:te.XXXS,color:ne.Secondary,children:r?.agentEnabledStatus?.message})]})}),S.length>0&&t(_u,{children:t(oe,{$gap:16,$wrap:"wrap",children:S.map((e,n)=>t(ce,{label:e,leftIcon:ja,status:_e.Success,invertColors:!0,useSecondaryTone:!0},`${a}-rule-${n}`))})})]})},Fu=({source:n,onClickRollout:o,onClickRollback:a})=>{const{isK8s:l,platformType:r,version:s}=S(),c=i(()=>zn(r,s)?Bt(Xn(n.conditions)):[],[r,s,n.conditions]);return e(ae,{$gap:12,children:[t(au,{source:n}),t(ru,{source:n}),l&&t(Au,{source:n,onClickRollout:o,onClickRollback:a}),!!c.length&&t(Yt,{conditions:c,title:ot.INSTRUMENTATION_LIFECYCLE}),l&&t(Ru,{source:n}),!l&&t(Tu,{source:n}),l&&t(lu,{source:n})]})},Mu=({source:e})=>{const n=e.containers||[];return t(Kt,{bgTint:"1000",richTitle:{title:ot.INSTRUMENTED_LIBRARIES},children:n.length?n.map(e=>{const n=e.instrumentations||[];return t(Kt,{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(Lp,{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"})})},zu=b(ae)`
693
675
  width: 100%;
694
676
  max-height: 320px;
695
677
  overflow-y: auto;
696
678
  gap: 8px;
697
- `,Gu=b(oe)`
679
+ `,Xu=b(oe)`
698
680
  width: 100%;
699
681
  align-items: center;
700
682
  gap: 8px;
@@ -704,14 +686,14 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
704
686
  & > * {
705
687
  font-family: monospace !important;
706
688
  }
707
- `,Wu=({pendingModify:n,onClose:o,onConfirm:i})=>{const a=v();return t(nt,{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(ju,{children:[n.add.map(n=>e(Gu,{children:[t(ce,{leftIcon:Va,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(Gu,{children:[t(ce,{leftIcon:Il,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 Ku(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 Yu(e){const t=Math.abs(e);return t>=1e9?`${Ju(e/1e9)}s`:t>=1e6?`${Ju(e/1e6)}ms`:t>=1e3?`${Ju(e/1e3)}μs`:String(Math.round(e))}function Ju(e){return e.toFixed(2).replace(/\.?0+$/,"")}function qu(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 Zu(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function Qu(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}function eh(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=>Ku(e,t.nameIndex))}function th(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&&Ku(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 nh(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 oh(e,t){const n=t.trim().toLowerCase();return!n||e.toLowerCase().includes(n)}function ih(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 ah,lh;function rh(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function sh(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 ch(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"})(ah||(ah={})),(e=>{e[e.Fit=1]="Fit",e[e.X10=10]="X10"})(lh||(lh={}));const dh=({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(""),[E,N]=l(null),[O,$]=l([]),[A,R]=l(!1),[D,_]=l(ah.Fit),[P,L]=l(lh.Fit),[F,M]=l(!1),z=Math.max(1,Math.min(Math.floor(w.w*D),8192)),X=Math.max(1,Math.min(Math.floor(w.h*P),8192)),B=O.length>0?O[O.length-1]:null,U=B?.size??n.numTicks,V=i(()=>qu(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=eh(e,t,l);if(0===i.length)break;const r=th(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)=>Qu(e,t[n]))?t:o}))},[n,V]),a(()=>{if(!f)return;if(!B)return void f(null);const e=nh(V,B),t=new Set;for(const o of e){const e=Ku(n,o.nameIndex);e&&t.add(e)}f([...t])},[B,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??qu(e);let p=l?nh(d,l):d;if(0===p.length)return null;if(r&&(p=p.filter(t=>r(Ku(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&&Ku(e,l.nameIndex)===Ku(e,t.nameIndex)&&i.add(Zu(l))}if(0===i.size)return n;const a=[];for(const e of n){if(i.has(Zu(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(Zu(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=Ku(e,n.nameIndex);return{...n,x:i,y:l,w:a,h:r,name:s,matchesSearch:oh(s,v)}})}(n,z,X,o,r,{zoomRoot:B,shouldKeepName:s,collapseRecursive:F,allRects:V}),[n,o,r,X,z,B,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||X<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const o=sh((e.clientX-t.left)/t.width*z,(e.clientY-t.top)/t.height*X,G);if(o){const e=Zu(o);N(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 ${Yu(o.size)} (${t}% of view, ${i}% of profile) · self ${Yu(o.self)}`)}else N(null),I("")},[G,n.numTicks,X,z,U]),K=d(e=>{W(e)},[W]),Y=d(()=>{N(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||X<2)return;const o=e.currentTarget.getBoundingClientRect();if(o.width<1||o.height<1)return;const i=sh((e.clientX-o.left)/o.width*z,(e.clientY-o.top)/o.height*X,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&&Qu(a,t)?e.slice(0,-1):[...e,a]})},[G,X,z,m]);g(()=>{const e=S.current;if(!e||z<2||X<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,o=Math.max(z,X),i=Math.min(t,16384/o);e.width=Math.floor(z*i),e.height=Math.floor(X*i),e.style.width=`${z}px`,e.style.height=`${X}px`;const a=e.getContext("2d");a&&(a.setTransform(i,0,0,i,0,0),a.clearRect(0,0,z,X),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}=ih(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=rh(d,r),g=`${s} (${Yu(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(Zu(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,X,j,r,y,E,n.numTicks):(a.fillStyle=y.v2.colors.silver[900],a.fillRect(0,0,z,X)))},[j,n.numTicks,E,r,X,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??qu(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,B,V),[n,B,V]),ae=null!==ie,le=O.length>0,re=B?Ku(n,B.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:Ot.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:El,onClick:se,disabled:!O.length}),t(Te,{variant:Ie.Secondary,size:ke.S,iconSize:20,leftIcon:Il,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:Va,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:Bn.Filled,options:[{value:ah.Fit,label:"W: Fit"},{value:ah.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:Bn.Filled,options:[{value:lh.Fit,label:"H: Fit"},{value:lh.X10,label:"10x"}],selected:P,setSelected:L})})]}),t(Te,{variant:Ie.Secondary,size:ke.S,iconSize:24,leftIcon:A?ol:Nl,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:X||"100%",position:"relative"},children:t("canvas",{ref:S,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:E?"pointer":"default"},onPointerDown:J,onPointerMove:K,onPointerLeave:Y,onClick:q})})})})}),e(oe,{$justifyContent:"space-between",children:[t(ee,B?{size:te.XXXS,color:y.v2.colors.silver[300],children:`Zoomed: ${re} • ${Yu(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 · ${ch(h.totalBytesUsed)} / ${ch(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})},ph=[Pn.Go,Pn.Java],uh="Profiling Symbols";function hh(e,t){if(0===t.length)return null;const n=1===t.length?t[0]:(e=>e.includes("/")||/\.\(\*?[^)]+\)\./.test(e)?Pn.Go:e.includes(" ")||e.includes("(")?Pn.Java:Pn.Go)(e);if(n===Pn.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===Pn.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 mh(e,t){return e.namespace===t.namespace&&e.name===t.name&&e.kind===t.kind}function gh(e,t,n){if(!e)return!0;const{sources:o=[],namespaces:i=[],languages:a=[]}=e,l=!o.length||o.some(e=>mh(e,t.id)),r=!i.length||i.includes(t.id.namespace),s=!a.length||null==n||a.includes(n);return l&&r&&s}function fh(e,t){return e.packageName===t.packageName&&(e.functionName||"")===(t.functionName||"")&&(e.receiverName||"")===(t.receiverName||"")&&(e.receiverMethodName||"")===(t.receiverMethodName||"")}function bh(e,t){return e.className===t.className&&e.methodName===t.methodName}function vh(e,t,n,o){const i=hh(e,n);if(!i)return[];const a=[];for(const e of o){const n=e.customInstrumentations;if(!n)continue;if(!gh(e.sourceScopes,t,i.language))continue;const o=!!i.golang&&!!n[Ke.Golang]?.some(e=>fh(e,i.golang)),l=!!i.java&&!!n[Ke.Java]?.some(e=>bh(e,i.java));(o||l)&&a.push({rule:e,resolved:i})}return a}var yh,Ch,Sh;(e=>{e.Symbol="symbol",e.Self="self",e.Total="total"})(yh||(yh={})),(e=>{e.OnlyInstrumentable="only-instrumentable"})(Ch||(Ch={})),(e=>{e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"})(Sh||(Sh={}));const xh=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function wh(e,t){const n=(e=>e.split(" ")[0]??"")(e);return(!t.includes(Sh.FilterOutVoid)||"void"!==n)&&!!(!t.includes(Sh.OnlyWithReturnValues)||e.includes(" ")&&"void"!==n&&xh.test(n))}const Th=({rows:e,languages:n,instrumentation:o,searchQuery:a,filters:l,onFiltersChange:r,zoomedSymbols:s,highlightSymbol:c,scrollSignal:p})=>{const u=!!n?.includes(Pn.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:Ch.OnlyInstrumentable,label:"Only show instrumentable symbols"}),u&&(e.push({id:Sh.FilterOutVoid,label:"Filter out void symbols"}),e.push({id:Sh.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===yh.Symbol)?.rawValue?.toString()??"";return!(t.includes(Ch.OnlyInstrumentable)&&!o.getSymbolState(n).showCheckbox)&&wh(n,t)}}},[o,u]),g=i(()=>[{key:yh.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:m,noFilter:!m},{key:yh.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:yh.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:yh.Symbol,rawValue:e.name},{key:yh.Self,rawValue:Yu(e.self)},{key:yh.Total,rawValue:Yu(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:Ua,tooltip:"Remove from the “Profiling Symbols” rule",onClick:()=>o.onRemove(t)}):i.push({id:`add-instrumentation-${t}`,label:"",leftIcon:Va,tooltip:n.addTooltip,disabled:!n.addEnabled,onClick:()=>o.onAdd(t)}),i.push({id:`copy-${t}`,label:"",leftIcon:Ol,tooltip:"Copy symbol name",onClick:()=>{navigator.clipboard.writeText(t)}}),i},[o]);return t(Un,{variant:Vn.Data,maxHeight:"calc(100vh - 306px)",columns:g,rows:f,withCheckboxes:o.selectionEnabled,filters:l,onFiltersChange:r,activeRowId:c,scrollSignal:p,getRowActions:b})};var kh;(e=>{e.Table="table",e.Flame="flame",e.Both="both"})(kh||(kh={}));const Ih=b(ae)`
689
+ `,Bu=({pendingModify:n,onClose:o,onConfirm:i})=>{const a=v();return t(nt,{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(zu,{children:[n.add.map(n=>e(Xu,{children:[t(ce,{leftIcon:Va,status:_e.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(Xu,{children:[t(ce,{leftIcon:Il,status:_e.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 Uu(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 Vu(e){const t=Math.abs(e);return t>=1e9?`${Hu(e/1e9)}s`:t>=1e6?`${Hu(e/1e6)}ms`:t>=1e3?`${Hu(e/1e3)}μs`:String(Math.round(e))}function Hu(e){return e.toFixed(2).replace(/\.?0+$/,"")}function ju(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 Gu(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function Wu(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}function Ku(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=>Uu(e,t.nameIndex))}function Yu(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&&Uu(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 Ju(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 qu(e,t){const n=t.trim().toLowerCase();return!n||e.toLowerCase().includes(n)}function Zu(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 Qu,eh;function th(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function nh(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 oh(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"})(Qu||(Qu={})),(e=>{e[e.Fit=1]="Fit",e[e.X10=10]="X10"})(eh||(eh={}));const ih=({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,P]=l(Qu.Fit),[_,L]=l(eh.Fit),[F,M]=l(!1),z=Math.max(1,Math.min(Math.floor(w.w*D),8192)),X=Math.max(1,Math.min(Math.floor(w.h*_),8192)),B=O.length>0?O[O.length-1]:null,U=B?.size??n.numTicks,V=i(()=>ju(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=Ku(e,t,l);if(0===i.length)break;const r=Yu(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)=>Wu(e,t[n]))?t:o}))},[n,V]),a(()=>{if(!f)return;if(!B)return void f(null);const e=Ju(V,B),t=new Set;for(const o of e){const e=Uu(n,o.nameIndex);e&&t.add(e)}f([...t])},[B,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??ju(e);let p=l?Ju(d,l):d;if(0===p.length)return null;if(r&&(p=p.filter(t=>r(Uu(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&&Uu(e,l.nameIndex)===Uu(e,t.nameIndex)&&i.add(Gu(l))}if(0===i.size)return n;const a=[];for(const e of n){if(i.has(Gu(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(Gu(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=Uu(e,n.nameIndex);return{...n,x:i,y:l,w:a,h:r,name:s,matchesSearch:qu(s,v)}})}(n,z,X,o,r,{zoomRoot:B,shouldKeepName:s,collapseRecursive:F,allRects:V}),[n,o,r,X,z,B,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||X<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const o=nh((e.clientX-t.left)/t.width*z,(e.clientY-t.top)/t.height*X,G);if(o){const e=Gu(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 ${Vu(o.size)} (${t}% of view, ${i}% of profile) · self ${Vu(o.self)}`)}else E(null),I("")},[G,n.numTicks,X,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||X<2)return;const o=e.currentTarget.getBoundingClientRect();if(o.width<1||o.height<1)return;const i=nh((e.clientX-o.left)/o.width*z,(e.clientY-o.top)/o.height*X,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&&Wu(a,t)?e.slice(0,-1):[...e,a]})},[G,X,z,m]);g(()=>{const e=S.current;if(!e||z<2||X<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,o=Math.max(z,X),i=Math.min(t,16384/o);e.width=Math.floor(z*i),e.height=Math.floor(X*i),e.style.width=`${z}px`,e.style.height=`${X}px`;const a=e.getContext("2d");a&&(a.setTransform(i,0,0,i,0,0),a.clearRect(0,0,z,X),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}=Zu(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=th(d,r),g=`${s} (${Vu(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(Gu(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,X,j,r,y,N,n.numTicks):(a.fillStyle=y.v2.colors.silver[900],a.fillRect(0,0,z,X)))},[j,n.numTicks,N,r,X,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??ju(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,B,V),[n,B,V]),ae=null!==ie,le=O.length>0,re=B?Uu(n,B.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:Ot.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:Nl,onClick:se,disabled:!O.length}),t(Te,{variant:Ie.Secondary,size:ke.S,iconSize:20,leftIcon:Il,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:Va,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:Bn.Filled,options:[{value:Qu.Fit,label:"W: Fit"},{value:Qu.X10,label:"10x"}],selected:D,setSelected:P})}),t(Ue,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(ve,{variant:Bn.Filled,options:[{value:eh.Fit,label:"H: Fit"},{value:eh.X10,label:"10x"}],selected:_,setSelected:L})})]}),t(Te,{variant:Ie.Secondary,size:ke.S,iconSize:24,leftIcon:A?ol:El,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:_>1?"auto":"hidden"},children:t("div",{style:{width:z||"100%",height:X||"100%",position:"relative"},children:t("canvas",{ref:S,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:N?"pointer":"default"},onPointerDown:J,onPointerMove:K,onPointerLeave:Y,onClick:q})})})})}),e(oe,{$justifyContent:"space-between",children:[t(ee,B?{size:te.XXXS,color:y.v2.colors.silver[300],children:`Zoomed: ${re} • ${Vu(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 · ${oh(h.totalBytesUsed)} / ${oh(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})},ah=[_n.Go,_n.Java],lh="Profiling Symbols";function rh(e,t){if(0===t.length)return null;const n=1===t.length?t[0]:(e=>e.includes("/")||/\.\(\*?[^)]+\)\./.test(e)?_n.Go:e.includes(" ")||e.includes("(")?_n.Java:_n.Go)(e);if(n===_n.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===_n.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 sh(e,t){return e.namespace===t.namespace&&e.name===t.name&&e.kind===t.kind}function ch(e,t,n){if(!e)return!0;const{sources:o=[],namespaces:i=[],languages:a=[]}=e,l=!o.length||o.some(e=>sh(e,t.id)),r=!i.length||i.includes(t.id.namespace),s=!a.length||null==n||a.includes(n);return l&&r&&s}function dh(e,t){return e.packageName===t.packageName&&(e.functionName||"")===(t.functionName||"")&&(e.receiverName||"")===(t.receiverName||"")&&(e.receiverMethodName||"")===(t.receiverMethodName||"")}function ph(e,t){return e.className===t.className&&e.methodName===t.methodName}function uh(e,t,n,o){const i=rh(e,n);if(!i)return[];const a=[];for(const e of o){const n=e.customInstrumentations;if(!n)continue;if(!ch(e.sourceScopes,t,i.language))continue;const o=!!i.golang&&!!n[Ke.Golang]?.some(e=>dh(e,i.golang)),l=!!i.java&&!!n[Ke.Java]?.some(e=>ph(e,i.java));(o||l)&&a.push({rule:e,resolved:i})}return a}var hh,mh,gh;(e=>{e.Symbol="symbol",e.Self="self",e.Total="total"})(hh||(hh={})),(e=>{e.OnlyInstrumentable="only-instrumentable"})(mh||(mh={})),(e=>{e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"})(gh||(gh={}));const fh=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function bh(e,t){const n=(e=>e.split(" ")[0]??"")(e);return(!t.includes(gh.FilterOutVoid)||"void"!==n)&&!!(!t.includes(gh.OnlyWithReturnValues)||e.includes(" ")&&"void"!==n&&fh.test(n))}const vh=({rows:e,languages:n,instrumentation:o,searchQuery:a,filters:l,onFiltersChange:r,zoomedSymbols:s,highlightSymbol:c,scrollSignal:p})=>{const u=!!n?.includes(_n.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:mh.OnlyInstrumentable,label:"Only show instrumentable symbols"}),u&&(e.push({id:gh.FilterOutVoid,label:"Filter out void symbols"}),e.push({id:gh.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===hh.Symbol)?.rawValue?.toString()??"";return!(t.includes(mh.OnlyInstrumentable)&&!o.getSymbolState(n).showCheckbox)&&bh(n,t)}}},[o,u]),g=i(()=>[{key:hh.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:m,noFilter:!m},{key:hh.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:hh.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:hh.Symbol,rawValue:e.name},{key:hh.Self,rawValue:Vu(e.self)},{key:hh.Total,rawValue:Vu(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:Ua,tooltip:"Remove from the “Profiling Symbols” rule",onClick:()=>o.onRemove(t)}):i.push({id:`add-instrumentation-${t}`,label:"",leftIcon:Va,tooltip:n.addTooltip,disabled:!n.addEnabled,onClick:()=>o.onAdd(t)}),i.push({id:`copy-${t}`,label:"",leftIcon:Ol,tooltip:"Copy symbol name",onClick:()=>{navigator.clipboard.writeText(t)}}),i},[o]);return t(Un,{variant:Vn.Data,maxHeight:"calc(100vh - 306px)",columns:g,rows:f,withCheckboxes:o.selectionEnabled,filters:l,onFiltersChange:r,activeRowId:c,scrollSignal:p,getRowActions:b})};var yh;(e=>{e.Table="table",e.Flame="flame",e.Both="both"})(yh||(yh={}));const Ch=b(ae)`
708
690
  width: 100%;
709
691
  flex: 1;
710
692
  border-radius: 16px;
711
693
  overflow: hidden;
712
694
  background: ${({theme:e})=>e.v2.colors.silver[800]};
713
695
  box-shadow: 0 2px 14.1px 0 rgba(0, 0, 0, 0.25);
714
- `,Eh=b.div`
696
+ `,Sh=b.div`
715
697
  display: flex;
716
698
  align-items: center;
717
699
  gap: 10px;
@@ -719,11 +701,11 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
719
701
  padding: 12px 12px 8px;
720
702
  background: ${({theme:e})=>e.v2.colors.silver[800]};
721
703
  border-radius: 16px 16px 0 0;
722
- `,Nh=b(oe)`
704
+ `,xh=b(oe)`
723
705
  flex-shrink: 0;
724
706
  align-items: center;
725
707
  gap: 4px;
726
- `,Oh=b.div`
708
+ `,wh=b.div`
727
709
  flex: 1;
728
710
  display: flex;
729
711
  align-items: stretch;
@@ -731,20 +713,20 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
731
713
  padding: 16px;
732
714
  background: ${({theme:e})=>e.v2.colors.silver[800]};
733
715
  border-radius: 0 0 16px 16px;
734
- `,$h=b(ae)`
716
+ `,Th=b(ae)`
735
717
  flex: ${({$splitWithFlame:e})=>e?"0 0 min(413px, 42%)":"1 1 auto"};
736
718
  width: ${({$splitWithFlame:e})=>e?"auto":"100%"};
737
719
  max-width: ${({$splitWithFlame:e})=>e?"none":"100%"};
738
720
  gap: 10px;
739
- `,Ah=b(ae)`
721
+ `,kh=b(ae)`
740
722
  flex: ${({$splitWithTable:e})=>e?"1":"1 1 auto"};
741
723
  width: ${({$splitWithTable:e})=>e?"auto":"100%"};
742
724
  gap: 10px;
743
- `,Rh=b(oe)`
725
+ `,Ih=b(oe)`
744
726
  width: 100%;
745
727
  min-height: 32px;
746
728
  flex-shrink: 0;
747
- `,Dh=({source:n,onFlameFullscreenChange:o})=>{const s=v(),c=n.id,{profilingApi:u}=yr(),[h,m]=l(!0),[g,f]=l(kh.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:E,refetch:N}=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=Ku(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===kh.Table||g===kh.Both,D=g===kh.Flame||g===kh.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(Pn.Java))return;const n=(e?.[yh.Symbol]?.filter(Boolean)??[]).filter(e=>e===Sh.FilterOutVoid||e===Sh.OnlyWithReturnValues);return 0!==n.length?e=>wh(e,n):void 0})(C,F),[C,F]),{instrumentation:z,pendingCount:X,pendingModify:B,closeModify:U,openBulkModify:V,resetSelection:H,confirmModify:j}=function({source:e,languages:t,rows:n}){const{instrumentationRulesApi:o,capabilities:a}=yr(),{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 ph.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===uh&&gh(e.sourceScopes,t));return n.find(e=>e.sourceScopes?.sources?.some(e=>mh(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=!!hh(o.name,g),i=vh(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]),E=d(()=>{c(new Set),u(new Set)},[]),N=d(t=>{(async()=>{const n=t.add.map(e=>hh(e,g)).filter(e=>!!e),i=t.remove.map(e=>hh(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=>!fh(t,e.golang))),e.java&&(a=a.filter(t=>!bh(t,e.java)));for(const e of t)e.golang&&!i.some(t=>fh(t,e.golang))&&i.push(e.golang),e.java&&!a.some(t=>bh(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:uh,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&&(N(h),m(null),E())},[h,N,E]),_=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:E,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===kh.Flame?kh.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&&E?t(bt,{$height:"70vh",children:t(xt,{withSpinner:!0})}):e(Ih,{$gap:0,$width:"100%",children:[e(Eh,{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(Nh,{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(vn,{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:Bn.Filled,options:[{value:kh.Table,label:"Top table"},{value:kh.Flame,label:"Flame graph"},{value:kh.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($l,{...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($l,{...e,size:8,fill:s.v2.colors.red[500]})})]})]}),t(Oh,{$gap:R&&D?16:0,children:$?e(r,{children:[R&&e($h,{$splitWithFlame:_,children:[e(Rh,{$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(Al,{size:24}),t(ee,{size:te.S,color:ne.Success,nowrap:!0,children:"Custom Instrument"})]}),t(Te,{leftIcon:Wa,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:Rl,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(Th,{rows:A,languages:F,instrumentation:z,searchQuery:b,filters:C,onFiltersChange:S,zoomedSymbols:J,highlightSymbol:G,scrollSignal:K})]}),D&&e(Ah,{$splitWithTable:_,children:[e(Rh,{$justifyContent:"space-between",children:[t(ce,{label:$?`Total in view ${Yu($.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:gl,onClick:N}),t(ge,{label:"Auto refresh",labelAlign:fe.Left,size:Ot.S,value:h,onChange:m})]})]}),t(dh,{flamebearer:$.flamebearer,maxRowPx:24,searchQuery:b,shouldKeepName:M,minHostHeight:280,onFullscreenChange:o,profilingSlots:k??null,onFrameClick:Z,onZoomedSymbolsChange:Q,onResetZoom:ie})]})]}):t(bt,{children:t($e,{title:"No profile samples yet",subTitle:"Dynamically collecting profiling samples — keep this tab open while the agent sends OTLP profiles."})})}),t(Wu,{pendingModify:B,onClose:U,onConfirm:j}),t(Hn,{isOpen:X>0,richTitle:{icon:il,title:"Profiling Symbols",badge:{label:X}},actions:[{id:"profiling-bulk-cancel",type:bn.Button,buttonProps:{variant:Ie.Secondary,size:ke.S,label:"Cancel",onClick:H}},{id:"profiling-bulk-apply",type:bn.Button,buttonProps:{variant:Ie.Primary,size:ke.S,label:"Modify Rule",leftIcon:Ya,onClick:V}}]})]})},_h=b.div`
729
+ `,Nh=({source:n,onFlameFullscreenChange:o})=>{const s=v(),c=n.id,{profilingApi:u}=yr(),[h,m]=l(!0),[g,f]=l(yh.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=Uu(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===yh.Table||g===yh.Both,D=g===yh.Flame||g===yh.Both,P=R&&D,_=n.runtimeInfo?.detectedLanguages?.join("\0")??"",L=n.containers?.map(e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??"").join("\0")??"",F=i(()=>_?_.split("\0"):L?L.split("\0"):void 0,[_,L]),M=i(()=>((e,t)=>{if(!t?.includes(_n.Java))return;const n=(e?.[hh.Symbol]?.filter(Boolean)??[]).filter(e=>e===gh.FilterOutVoid||e===gh.OnlyWithReturnValues);return 0!==n.length?e=>bh(e,n):void 0})(C,F),[C,F]),{instrumentation:z,pendingCount:X,pendingModify:B,closeModify:U,openBulkModify:V,resetSelection:H,confirmModify:j}=function({source:e,languages:t,rows:n}){const{instrumentationRulesApi:o,capabilities:a}=yr(),{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 ah.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===lh&&ch(e.sourceScopes,t));return n.find(e=>e.sourceScopes?.sources?.some(e=>sh(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=!!rh(o.name,g),i=uh(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=>rh(e,g)).filter(e=>!!e),i=t.remove.map(e=>rh(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=>!dh(t,e.golang))),e.java&&(a=a.filter(t=>!ph(t,e.java)));for(const e of t)e.golang&&!i.some(t=>dh(t,e.golang))&&i.push(e.golang),e.java&&!a.some(t=>ph(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:lh,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]),P=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:P,onAdd:$,onRemove:A,selectionEnabled:y,isSelected:k,onToggleSymbol:I}),[P,$,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===yh.Flame?yh.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(bt,{$height:"70vh",children:t(xt,{withSpinner:!0})}):e(Ch,{$gap:0,$width:"100%",children:[e(Sh,{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(xh,{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(vn,{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:Bn.Filled,options:[{value:yh.Table,label:"Top table"},{value:yh.Flame,label:"Flame graph"},{value:yh.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($l,{...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($l,{...e,size:8,fill:s.v2.colors.red[500]})})]})]}),t(wh,{$gap:R&&D?16:0,children:$?e(r,{children:[R&&e(Th,{$splitWithFlame:P,children:[e(Ih,{$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(Al,{size:24}),t(ee,{size:te.S,color:ne.Success,nowrap:!0,children:"Custom Instrument"})]}),t(Te,{leftIcon:Wa,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:Rl,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(vh,{rows:A,languages:F,instrumentation:z,searchQuery:b,filters:C,onFiltersChange:S,zoomedSymbols:J,highlightSymbol:G,scrollSignal:K})]}),D&&e(kh,{$splitWithTable:P,children:[e(Ih,{$justifyContent:"space-between",children:[t(ce,{label:$?`Total in view ${Vu($.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:gl,onClick:E}),t(ge,{label:"Auto refresh",labelAlign:fe.Left,size:Ot.S,value:h,onChange:m})]})]}),t(ih,{flamebearer:$.flamebearer,maxRowPx:24,searchQuery:b,shouldKeepName:M,minHostHeight:280,onFullscreenChange:o,profilingSlots:k??null,onFrameClick:Z,onZoomedSymbolsChange:Q,onResetZoom:ie})]})]}):t(bt,{children:t($e,{title:"No profile samples yet",subTitle:"Dynamically collecting profiling samples — keep this tab open while the agent sends OTLP profiles."})})}),t(Bu,{pendingModify:B,onClose:U,onConfirm:j}),t(Hn,{isOpen:X>0,richTitle:{icon:il,title:"Profiling Symbols",badge:{label:X}},actions:[{id:"profiling-bulk-cancel",type:bn.Button,buttonProps:{variant:Ie.Secondary,size:ke.S,label:"Cancel",onClick:H}},{id:"profiling-bulk-apply",type:bn.Button,buttonProps:{variant:Ie.Primary,size:ke.S,label:"Modify Rule",leftIcon:Ya,onClick:V}}]})]})},Eh=b.div`
748
730
  position: relative;
749
731
  display: flex;
750
732
  align-items: center;
@@ -752,23 +734,23 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
752
734
  padding: 8px 16px;
753
735
  border-radius: 12px;
754
736
  background-color: ${({theme:e})=>e.v2.colors.silver[700]};
755
- `,Ph=b.div`
737
+ `,Oh=b.div`
756
738
  display: flex;
757
739
  flex-direction: column;
758
740
  gap: 4px;
759
741
  flex: 1;
760
742
  min-width: 0;
761
743
  opacity: ${({$disabled:e})=>e?.4:1};
762
- `,Lh=b.div`
744
+ `,$h=b.div`
763
745
  flex-shrink: 0;
764
746
  display: flex;
765
747
  align-items: center;
766
748
  margin-right: ${({$reserveJumpSpace:e})=>e?"32px":"0"};
767
- `,Fh=b.div`
749
+ `,Ah=b.div`
768
750
  min-width: 0;
769
751
  white-space: pre;
770
752
  overflow-x: auto;
771
- `,Mh=b.div`
753
+ `,Rh=b.div`
772
754
  position: absolute;
773
755
  top: 50%;
774
756
  right: 8px;
@@ -777,24 +759,24 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
777
759
  pointer-events: none;
778
760
  transition: opacity 0.15s ease;
779
761
 
780
- ${_h}:hover & {
762
+ ${Eh}:hover & {
781
763
  opacity: 1;
782
764
  pointer-events: auto;
783
765
  }
784
- `,zh=({name:n,summary:o,disabled:i=!1,onJumpToRule:a})=>{const l=v();return e(_h,{children:[e(Ph,{$disabled:i,children:[n&&t(ee,{size:te.XXXS,color:ne.Secondary,nowrap:!0,children:n}),t(Fh,{children:t(w,{parts:o})})]}),i&&t(Lh,{$reserveJumpSpace:!!a,children:t(ce,{label:jn,textSize:te.XXXS,backgroundColor:l.v2.colors.grey[700],textColor:l.v2.colors.grey[300]})}),a&&t(Mh,{children:t(Ue,{text:ot.OPEN_IN_SAMPLING_PAGE,children:t(Te,{"data-id":"sampling-rule-jump",variant:Ie.Primary,size:ke.S,leftIcon:Nl,onClick:a})})})]})},Xh=b.div`
766
+ `,Dh=({name:n,summary:o,disabled:i=!1,onJumpToRule:a})=>{const l=v();return e(Eh,{children:[e(Oh,{$disabled:i,children:[n&&t(ee,{size:te.XXXS,color:ne.Secondary,nowrap:!0,children:n}),t(Ah,{children:t(w,{parts:o})})]}),i&&t($h,{$reserveJumpSpace:!!a,children:t(ce,{label:jn,textSize:te.XXXS,backgroundColor:l.v2.colors.grey[700],textColor:l.v2.colors.grey[300]})}),a&&t(Rh,{children:t(Ue,{text:ot.OPEN_IN_SAMPLING_PAGE,children:t(Te,{"data-id":"sampling-rule-jump",variant:Ie.Primary,size:ke.S,leftIcon:El,onClick:a})})})]})},Ph=b.div`
785
767
  opacity: 0;
786
768
  pointer-events: none;
787
769
  transition: opacity 0.15s ease;
788
- `,Bh=b.div`
789
- &:hover ${Xh} {
770
+ `,_h=b.div`
771
+ &:hover ${Ph} {
790
772
  opacity: 1;
791
773
  pointer-events: auto;
792
774
  }
793
- `,Uh=b.div`
775
+ `,Lh=b.div`
794
776
  display: flex;
795
777
  align-items: center;
796
778
  padding: 4px 12px;
797
- `,Vh=({source:e,onRedirectToSampling:n})=>t(Kt,{bgTint:"1000",richTitle:{title:ot.CONTAINERS,badge:{label:e.containers?.length??0}},children:e.containers?.map(e=>t(Gh,{container:e,onRedirectToSampling:n},e.containerName))});var Hh;(e=>{e.All="all",e.Noisy="noisy",e.HighlyRelevant="highly-relevant",e.CostReduction="cost-reduction"})(Hh||(Hh={}));const jh=e=>"noisy"===e.type?T(e.rule,"source"):"highlyRelevant"===e.type?k(e.rule,"source"):"costReduction"===e.type?I(e.rule,"source"):[],Gh=({container:n,onRedirectToSampling:o})=>{const[a,r]=l(Hh.All),s=Cn(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===Hh.Noisy?d:a===Hh.HighlyRelevant?p:a===Hh.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(Xh,{children:t(Te,{"data-id":"sampling-container-create-rule",variant:Ie.Secondary,size:ke.S,label:Gn,rightIcon:Va,onClick:e=>{e.stopPropagation(),o()}})});return t(Bh,{children:e(Kt,{bgTint:"900",richTitle:{title:n.containerName},renderOnRightSide:f,withCollapse:!0,collapseIsDefaultOpen:!0,children:[c.length?e(Kt,{bgTint:"800",richTitle:{title:ot.HEAD_SAMPLING,badge:{label:c.length}},children:[t(ee,{size:te.XXS,children:ot.NOISY_OPERATIONS}),t(ae,{$gap:4,children:c.map(e=>t(zh,{name:e.name,summary:T(e),disabled:e.disabled,onJumpToRule:()=>g(e.ruleId,"noisy")},e.ruleId))})]}):t(Uh,{children:t(ee,{size:te.XS,color:ne.Secondary,children:ot.HEAD_SAMPLING})}),m?e(Kt,{bgTint:"800",richTitle:{title:ot.TAIL_SAMPLING,badge:{label:m}},children:[t(ve,{options:(b=d.length,v=p.length,y=u.length,[{value:Hh.All,label:"All",badge:{label:b+v+y,textSize:te.XXXS}},{value:Hh.Noisy,label:ot.NOISY_OPERATIONS,badge:{label:b,textSize:te.XXXS}},{value:Hh.HighlyRelevant,label:ot.HIGHLY_RELEVANT_OPERATIONS,badge:{label:v,textSize:te.XXXS}},{value:Hh.CostReduction,label:ot.COST_REDUCTION_OPERATIONS,badge:{label:y,textSize:te.XXXS}}]),selected:a,setSelected:r}),t(ae,{$gap:4,children:h.length?h.map(e=>t(zh,{name:e.rule.name,summary:jh(e),disabled:e.rule.disabled,onJumpToRule:()=>g(e.rule.ruleId,e.type)},e.rule.ruleId)):t($e,{title:`No ${a===Hh.All?`${Hh.Noisy}, ${Hh.HighlyRelevant} and ${Hh.CostReduction}`:a} operations`})})]}):t(Uh,{children:t(ee,{size:te.XS,color:ne.Secondary,children:ot.TAIL_SAMPLING})})]})});var b,v,y},Wh=[In.Deployment,In.StatefulSet,In.DaemonSet,In.DeploymentConfig,In.Rollout,In.Pod];var Kh;(e=>{e.Workload="Workload",e.Pod="Pod"})(Kh||(Kh={}));const Yh=e=>!!e&&pn(e.status)===Pe.Error,Jh=e=>Yh(e.healthStatus),qh=e=>Yh(e.odigosHealthStatus)||(e.processes??[]).some(Jh),Zh=e=>Yh(e.agentInjectedStatus)||Yh(e.odigosHealthStatus)||(e.containers??[]).some(qh),Qh=({onClose:n,sourceId:o,onRedirectToSampling:r})=>{const s=v(),{isK8s:c,platformType:u}=S(),{sourcesApi:h,configApi:m}=yr(),{selectedStreamName:g}=it(),{genericForm:f,loadSource:b,validateFormData:y}=wr(),{data:C}=m.useEffectiveConfig(),[x,w]=l(!1),[T,k]=l(!1),[I,E]=l(!1),[N,O]=l(Op.Overview),[$,A]=l(null),[R,D]=l({openFor:null}),_=(()=>{const[e,t]=l(null),n=d(e=>{t({tab:Op.Pods,podName:e.podName})},[]),o=d((e,n)=>{t({tab:Op.Pods,podName:e.podName,containerName:n.containerName})},[]),a=d((e,n,o)=>{const i=Pp({identifyingAttributes:o.identifyingAttributes});t({tab:Op.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(Sn(o))!==JSON.stringify(Sn($))&&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=$&&Wh.includes($.id.kind),M=i(()=>{const e=[],n=($?.pods??[]).some(Zh),o=(i=$,(i?.containers??[]).some(e=>(e.instrumentations??[]).some(e=>!1===e.healthy)));var i;const a=e=>t(yl,{...e,fill:s.v2.colors.red[500]});return e.push({value:Op.Overview,label:ot.OVERVIEW}),c?(e.push({value:Op.Pods,label:ot.PODS,icon:n?a:void 0}),e.push({value:Op.Libraries,label:ot.LIBRARIES,icon:o?a:void 0}),e.push({value:Op.PeerSources,label:ot.PEER_SOURCES}),C?.profiling?.enabled&&e.push({value:Op.Profiling,label:ot.PROFILING}),e.push({value:Op.Sampling,label:ot.SAMPLING}),e.push({value:Op.Debug,label:ot.DEBUG}),e):e},[c,C,$?.pods,s]),z=d(()=>w(!0),[]),X=i(()=>()=>{n(),r()},[n,r]),B=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=!1===$?.markedForInstrumentation?.markedForInstrumentation,H=d(()=>k(!0),[]),j=d(async()=>{if(!$)return;const e=!1===$.markedForInstrumentation?.markedForInstrumentation;await h.persistV2({[Dt]:[{namespace:$.id.namespace,name:$.id.name,kind:$.id.kind,...$.id.region?{region:$.id.region}:{},selected:e,currentStreamName:g}]}),k(!1),e||n()},[$,h,g,n]),G=d(()=>{D({openFor:Kh.Workload})},[]),W=d(e=>{O(e),_.clearJumpToTarget()},[_]),K=d(async()=>{await h.recoverFromRollback(o)},[h,o]),Y=d(()=>D({openFor:null}),[]),J=d(async()=>{R.openFor===Kh.Workload?await h.restartWorkloads([o]):R.openFor===Kh.Pod&&R.podNamespace&&R.podName&&await h.restartPod(R.podNamespace,R.podName),Y()},[R,h,o,Y]),q=i(()=>{const{kind:e,name:t}=o;return{title:`Rollout ${e}`,description:`Are you sure you want to rollout the ${e.toLowerCase()} "${t}"?`}},[o]),Z=i(()=>{const e=[];return x||N===Op.Overview&&(e.push({id:"edit-source-btn-edit",label:Mt.EDIT,icon:Ya,active:x,onClick:z}),c&&F&&e.push({id:"edit-source-btn-restart",label:ot.ROLLOUT_RESTART,icon:kl,onClick:G}),e.push(V?{id:"edit-source-btn-instrument",label:Mt.INSTRUMENT,icon:Va,color:s.v2.colors.green[500],active:T,onClick:H}:{id:"edit-source-btn-delete",label:Mt.UNINSTRUMENT,icon:Ua,color:s.v2.colors.red[500],active:T,onClick:H})),e},[N,x,T,V,c,F,z,G,H,s]),Q=i(()=>{if(!$)return[];const e=[],t={backgroundColor:"transparent",textSize:te.S};return e.push({...t,label:$.id.name,leftIcon:c?vl:void 0}),$.serviceName&&$.serviceName!==$.id.name&&e.push({...t,label:$.serviceName,leftIcon:ul,textColor:s.v2.colors.silver[200]}),e},[$,s,c]);if(!$)return t(Xt,{isOpen:!0,children:t(bt,{$height:"80vh",children:t(xt,{withSpinner:!0})})});const ee=N===Op.Profiling?I?"95vw":"fit-content":x?void 0:"60vw",ne=c?Kn($.containers)[0]:Wn(u);return e(Hp,{value:_,children:[t(Xt,{isOpen:!0,width:ee,minWidth:"min(1100px, 100vw)",header:{icon:ne,titleBadges:Q,onClose:()=>{W(Op.Overview),A(null),E(!1),n()},actions:Z},footer:{actions:x?[{"data-id":"edit-source-btn-cancel",label:Mt.CANCEL,variant:Ie.Secondary,onClick:B},{"data-id":"edit-source-btn-save",label:Mt.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:N,setSelected:W}),(()=>{switch(N){case Op.Overview:return x?t(js,{}):t(Vu,{source:$,onClickRollout:G,onClickRollback:K});case Op.Pods:return t(Yp,{source:$,onClickRestartPod:F?(e,t)=>D({openFor:Kh.Pod,podNamespace:e,podName:t}):void 0});case Op.Libraries:return t(Hu,{source:$});case Op.PeerSources:return t(qp,{source:$});case Op.Profiling:return t(Dh,{source:$,onFlameFullscreenChange:E});case Op.Sampling:return t(Vh,{source:$,onRedirectToSampling:X});case Op.Debug:return t(nu,{source:$});default:return null}})()]})})}),t(ur,{target:"source",action:V?"instrument":"uninstrument",isOpen:T,onClose:()=>k(!1),onApprove:j}),t(nt,{isOpen:R.openFor===Kh.Workload,title:q.title,description:q.description,onClose:Y,denyButton:{label:"Go back",variant:Ie.Secondary,onClick:Y},approveButton:{label:Mt.CONFIRM,variant:Ie.Primary,onClick:J}}),t(ur,{target:"pod",action:"restart",description:ot.ROLLOUT_RESTART_WORKLOADS_DESCRIPTION,isOpen:R.openFor===Kh.Pod,onClose:Y,onApprove:J,overrideApproveButtonLabel:ot.DELETE_POD_TO_RESTART})]})},em=b.div`
779
+ `,Fh=({source:e,onRedirectToSampling:n})=>t(Kt,{bgTint:"1000",richTitle:{title:ot.CONTAINERS,badge:{label:e.containers?.length??0}},children:e.containers?.map(e=>t(Xh,{container:e,onRedirectToSampling:n},e.containerName))});var Mh;(e=>{e.All="all",e.Noisy="noisy",e.HighlyRelevant="highly-relevant",e.CostReduction="cost-reduction"})(Mh||(Mh={}));const zh=e=>"noisy"===e.type?T(e.rule,"source"):"highlyRelevant"===e.type?k(e.rule,"source"):"costReduction"===e.type?I(e.rule,"source"):[],Xh=({container:n,onRedirectToSampling:o})=>{const[a,r]=l(Mh.All),s=Cn(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===Mh.Noisy?d:a===Mh.HighlyRelevant?p:a===Mh.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(Ph,{children:t(Te,{"data-id":"sampling-container-create-rule",variant:Ie.Secondary,size:ke.S,label:Gn,rightIcon:Va,onClick:e=>{e.stopPropagation(),o()}})});return t(_h,{children:e(Kt,{bgTint:"900",richTitle:{title:n.containerName},renderOnRightSide:f,withCollapse:!0,collapseIsDefaultOpen:!0,children:[c.length?e(Kt,{bgTint:"800",richTitle:{title:ot.HEAD_SAMPLING,badge:{label:c.length}},children:[t(ee,{size:te.XXS,children:ot.NOISY_OPERATIONS}),t(ae,{$gap:4,children:c.map(e=>t(Dh,{name:e.name,summary:T(e),disabled:e.disabled,onJumpToRule:()=>g(e.ruleId,"noisy")},e.ruleId))})]}):t(Lh,{children:t(ee,{size:te.XS,color:ne.Secondary,children:ot.HEAD_SAMPLING})}),m?e(Kt,{bgTint:"800",richTitle:{title:ot.TAIL_SAMPLING,badge:{label:m}},children:[t(ve,{options:(b=d.length,v=p.length,y=u.length,[{value:Mh.All,label:"All",badge:{label:b+v+y,textSize:te.XXXS}},{value:Mh.Noisy,label:ot.NOISY_OPERATIONS,badge:{label:b,textSize:te.XXXS}},{value:Mh.HighlyRelevant,label:ot.HIGHLY_RELEVANT_OPERATIONS,badge:{label:v,textSize:te.XXXS}},{value:Mh.CostReduction,label:ot.COST_REDUCTION_OPERATIONS,badge:{label:y,textSize:te.XXXS}}]),selected:a,setSelected:r}),t(ae,{$gap:4,children:h.length?h.map(e=>t(Dh,{name:e.rule.name,summary:zh(e),disabled:e.rule.disabled,onJumpToRule:()=>g(e.rule.ruleId,e.type)},e.rule.ruleId)):t($e,{title:`No ${a===Mh.All?`${Mh.Noisy}, ${Mh.HighlyRelevant} and ${Mh.CostReduction}`:a} operations`})})]}):t(Lh,{children:t(ee,{size:te.XS,color:ne.Secondary,children:ot.TAIL_SAMPLING})})]})});var b,v,y},Bh=[In.Deployment,In.StatefulSet,In.DaemonSet,In.DeploymentConfig,In.Rollout,In.Pod];var Uh;(e=>{e.Workload="Workload",e.Pod="Pod"})(Uh||(Uh={}));const Vh=e=>!!e&&pn(e.status)===_e.Error,Hh=e=>Vh(e.healthStatus),jh=e=>Vh(e.odigosHealthStatus)||(e.processes??[]).some(Hh),Gh=e=>Vh(e.agentInjectedStatus)||Vh(e.odigosHealthStatus)||(e.containers??[]).some(jh),Wh=({onClose:n,sourceId:o,onRedirectToSampling:r})=>{const s=v(),{isK8s:c,platformType:u}=S(),{sourcesApi:h,configApi:m}=yr(),{selectedStreamName:g}=it(),{genericForm:f,loadSource:b,validateFormData:y}=wr(),{data:C}=m.useEffectiveConfig(),[x,w]=l(!1),[T,k]=l(!1),[I,N]=l(!1),[E,O]=l(wp.Overview),[$,A]=l(null),[R,D]=l({openFor:null}),P=(()=>{const[e,t]=l(null),n=d(e=>{t({tab:wp.Pods,podName:e.podName})},[]),o=d((e,n)=>{t({tab:wp.Pods,podName:e.podName,containerName:n.containerName})},[]),a=d((e,n,o)=>{const i=Op({identifyingAttributes:o.identifyingAttributes});t({tab:wp.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(()=>{P.jumpToTarget&&O(P.jumpToTarget.tab)},[P.jumpToTarget]),a(()=>{$&&JSON.stringify(Sn(o))!==JSON.stringify(Sn($))&&A(null)},[o,$]);const _=p(!1),L=d(async()=>A(await h.fetchById(o)||null),[o,h]);a(()=>{if(_.current||(L(),_.current=!0),!x){const e=setInterval(()=>L(),3e3);return()=>clearInterval(e)}},[L,x]),a(()=>{$&&b($)},[$]);const F=$&&Bh.includes($.id.kind),M=i(()=>{const e=[],n=($?.pods??[]).some(Gh),o=(i=$,(i?.containers??[]).some(e=>(e.instrumentations??[]).some(e=>!1===e.healthy)));var i;const a=e=>t(yl,{...e,fill:s.v2.colors.red[500]});return e.push({value:wp.Overview,label:ot.OVERVIEW}),c?(e.push({value:wp.Pods,label:ot.PODS,icon:n?a:void 0}),e.push({value:wp.Libraries,label:ot.LIBRARIES,icon:o?a:void 0}),e.push({value:wp.PeerSources,label:ot.PEER_SOURCES}),C?.profiling?.enabled&&e.push({value:wp.Profiling,label:ot.PROFILING}),e.push({value:wp.Sampling,label:ot.SAMPLING}),e.push({value:wp.Debug,label:ot.DEBUG}),e):e},[c,C,$?.pods,s]),z=d(()=>w(!0),[]),X=i(()=>()=>{n(),r()},[n,r]),B=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=!1===$?.markedForInstrumentation?.markedForInstrumentation,H=d(()=>k(!0),[]),j=d(async()=>{if(!$)return;const e=!1===$.markedForInstrumentation?.markedForInstrumentation;await h.persistV2({[Dt]:[{namespace:$.id.namespace,name:$.id.name,kind:$.id.kind,...$.id.region?{region:$.id.region}:{},selected:e,currentStreamName:g}]}),k(!1),e||n()},[$,h,g,n]),G=d(()=>{D({openFor:Uh.Workload})},[]),W=d(e=>{O(e),P.clearJumpToTarget()},[P]),K=d(async()=>{await h.recoverFromRollback(o)},[h,o]),Y=d(()=>D({openFor:null}),[]),J=d(async()=>{R.openFor===Uh.Workload?await h.restartWorkloads([o]):R.openFor===Uh.Pod&&R.podNamespace&&R.podName&&await h.restartPod(R.podNamespace,R.podName),Y()},[R,h,o,Y]),q=i(()=>{const{kind:e,name:t}=o;return{title:`Rollout ${e}`,description:`Are you sure you want to rollout the ${e.toLowerCase()} "${t}"?`}},[o]),Z=i(()=>{const e=[];return x||E===wp.Overview&&(e.push({id:"edit-source-btn-edit",label:Mt.EDIT,icon:Ya,active:x,onClick:z}),c&&F&&e.push({id:"edit-source-btn-restart",label:ot.ROLLOUT_RESTART,icon:kl,onClick:G}),e.push(V?{id:"edit-source-btn-instrument",label:Mt.INSTRUMENT,icon:Va,color:s.v2.colors.green[500],active:T,onClick:H}:{id:"edit-source-btn-delete",label:Mt.UNINSTRUMENT,icon:Ua,color:s.v2.colors.red[500],active:T,onClick:H})),e},[E,x,T,V,c,F,z,G,H,s]),Q=i(()=>{if(!$)return[];const e=[],t={backgroundColor:"transparent",textSize:te.S};return e.push({...t,label:$.id.name,leftIcon:c?vl:void 0}),$.serviceName&&$.serviceName!==$.id.name&&e.push({...t,label:$.serviceName,leftIcon:ul,textColor:s.v2.colors.silver[200]}),e},[$,s,c]);if(!$)return t(Xt,{isOpen:!0,children:t(bt,{$height:"80vh",children:t(xt,{withSpinner:!0})})});const ee=E===wp.Profiling?I?"95vw":"fit-content":x?void 0:"60vw",ne=c?Kn($.containers)[0]:Wn(u);return e(Mp,{value:P,children:[t(Xt,{isOpen:!0,width:ee,minWidth:"min(1100px, 100vw)",header:{icon:ne,titleBadges:Q,onClose:()=>{W(wp.Overview),A(null),N(!1),n()},actions:Z},footer:{actions:x?[{"data-id":"edit-source-btn-cancel",label:Mt.CANCEL,variant:Ie.Secondary,onClick:B},{"data-id":"edit-source-btn-save",label:Mt.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:W}),(()=>{switch(E){case wp.Overview:return x?t(js,{}):t(Fu,{source:$,onClickRollout:G,onClickRollback:K});case wp.Pods:return t(Vp,{source:$,onClickRestartPod:F?(e,t)=>D({openFor:Uh.Pod,podNamespace:e,podName:t}):void 0});case wp.Libraries:return t(Mu,{source:$});case wp.PeerSources:return t(jp,{source:$});case wp.Profiling:return t(Nh,{source:$,onFlameFullscreenChange:N});case wp.Sampling:return t(Fh,{source:$,onRedirectToSampling:X});case wp.Debug:return t(Jp,{source:$});default:return null}})()]})})}),t(ur,{target:"source",action:V?"instrument":"uninstrument",isOpen:T,onClose:()=>k(!1),onApprove:j}),t(nt,{isOpen:R.openFor===Uh.Workload,title:q.title,description:q.description,onClose:Y,denyButton:{label:"Go back",variant:Ie.Secondary,onClick:Y},approveButton:{label:Mt.CONFIRM,variant:Ie.Primary,onClick:J}}),t(ur,{target:"pod",action:"restart",description:ot.ROLLOUT_RESTART_WORKLOADS_DESCRIPTION,isOpen:R.openFor===Uh.Pod,onClose:Y,onApprove:J,overrideApproveButtonLabel:ot.DELETE_POD_TO_RESTART})]})},Kh=b.div`
798
780
  display: flex;
799
781
  align-items: center;
800
782
  gap: 8px;
@@ -804,9 +786,9 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
804
786
  &:hover {
805
787
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
806
788
  }
807
- `,tm=b.div`
789
+ `,Yh=b.div`
808
790
  flex: 1;
809
- `,nm=({onClick:n})=>{const o=v().v2.colors.red[500];return e(em,{"data-id":"sampling-view-btn-delete",onClick:n,children:[t(ee,{size:te.XS,weight:500,color:o,children:Zn}),t(Ua,{size:16,fill:o})]})};const om={[kr.EditAutoNoisy]:{title:ho,subTitle:uo,cancelId:"sampling-edit-auto-rule-btn-cancel",saveId:"sampling-edit-auto-rule-btn-save"},[kr.EditAutoCostReduction]:{title:po,subTitle:co,cancelId:"sampling-edit-cost-reduction-auto-rule-btn-cancel",saveId:"sampling-edit-cost-reduction-auto-rule-btn-save"},[kr.EditAutoHighlyRelevant]:{title:so,subTitle:ro,cancelId:"sampling-edit-highly-relevant-auto-rule-btn-cancel",saveId:"sampling-edit-highly-relevant-auto-rule-btn-save"}},im=({isOpen:e,title:n,subTitle:o,onClose:i,footer:a,renderBody:l})=>t(Xt,{isOpen:e,width:go,header:{icon:Dl,title:n,subTitle:o,onClose:i},footer:a,children:l?l():t(le,{$padding:"12px",children:t(qs,{})})}),am=({isOpen:o,onClose:r,onSubmit:s,validateForm:c,onNavigateToDuplicate:p})=>{const{category:u,formData:h,resetForm:m,duplicateWarning:g,setDuplicateWarning:f}=Tr(kr.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(E(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(N(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:Yn,variant:Ie.Secondary,size:ke.S,onClick:r},{"data-id":"sampling-create-btn-submit",label:Gn,variant:Ie.Primary,size:ke.S,onClick:C,disabled:!!g}]};return e(n,{children:[t(im,{isOpen:o,title:no[u],subTitle:Qn[u],onClose:r,footer:x}),t(nt,{isOpen:b,title:ao,description:io,onClose:()=>v(!1),denyButton:{"data-id":"sampling-create-default-continue-editing",label:oo,variant:Ie.Secondary,onClick:()=>v(!1)},approveButton:{"data-id":"sampling-create-default-confirm",label:Gn,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:lo}),t("div",{style:{width:"100%"},children:t(er,{summary:S})})]})})]})},lm=({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}=Tr(kr.View),b=c?.rule.name||to,v=p&&c?eo[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(nm,{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(tm,{}),t(Te,{"data-id":"sampling-view-edit-btn-cancel",label:Yn,variant:Ie.Secondary,size:ke.S,onClick:i}),t(Te,{"data-id":"sampling-view-edit-btn-save",label:Jn,variant:Ie.Primary,size:ke.S,onClick:a,disabled:!!r})]})}}const{onDelete:i,onCancel:a,onEdit:l}=o;return{children:e(n,{children:[t(nm,{onClick:i}),t(tm,{}),t(Te,{"data-id":"sampling-view-btn-cancel",label:Yn,variant:Ie.Secondary,size:ke.S,onClick:a}),t(Te,{"data-id":"sampling-view-btn-edit",label:qn,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(im,{isOpen:!!c,title:v,subTitle:c?Qn[c.category]:"",onClose:o,footer:S})},rm=({isOpen:e,onClose:n,onSave:o})=>{const{localEnabled:i,resolvedPercentage:a}=Tr(kr.EditAutoNoisy),l=d(()=>o(i,a),[o,i,a]);return t(dm,{formType:kr.EditAutoNoisy,isOpen:e,onClose:n,onSave:l})},sm=({isOpen:e,onClose:n,onSave:o})=>{const{localEnabled:i,resolvedPercentage:a}=Tr(kr.EditAutoCostReduction),l=d(()=>o(i,a),[o,i,a]);return t(dm,{formType:kr.EditAutoCostReduction,isOpen:e,onClose:n,onSave:l})},cm=({isOpen:e,onClose:n,onSave:o})=>{const{localEnabled:i}=Tr(kr.EditAutoHighlyRelevant),a=d(()=>o(i),[o,i]);return t(dm,{formType:kr.EditAutoHighlyRelevant,isOpen:e,onClose:n,onSave:a})},dm=({formType:e,isOpen:n,onClose:o,onSave:i})=>{const a=om[e];return t(im,{isOpen:n,title:a.title,subTitle:a.subTitle,onClose:o,footer:{actions:[{"data-id":a.cancelId,label:Yn,variant:Ie.Secondary,size:ke.S,onClick:o},{"data-id":a.saveId,label:mo,variant:Ie.Primary,size:ke.S,onClick:i}]}})},pm=e=>{switch(e.formType){case kr.Create:return t(Rr,{formType:kr.Create,category:e.category,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(am,{...e})});case kr.View:return t(Rr,{formType:kr.View,data:e.data,defaultEditMode:e.defaultEditMode,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(lm,{...e})});case kr.EditAutoNoisy:return t(Rr,{formType:kr.EditAutoNoisy,enabled:e.enabled,keepPercentage:e.keepPercentage,children:t(rm,{...e})});case kr.EditAutoCostReduction:return t(Rr,{formType:kr.EditAutoCostReduction,enabled:e.enabled,dropPercentage:e.dropPercentage,children:t(sm,{...e})});case kr.EditAutoHighlyRelevant:return t(Rr,{formType:kr.EditAutoHighlyRelevant,enabled:e.enabled,children:t(cm,{...e})})}},um=({token:o,isLoading:i,isEditing:a,onEdit:l,onCancel:r,onSave:s,formData:c,handleFormChange:d,handleErrorChange:p,formErrors:u})=>{const{CopyButton:h}=Lt(),m=!a||i||!c.newToken;return fo({key:"Enter",active:!m},s),e(oe,a?{$justifyContent:"space-between",$alignItems:"flex-start",$gap:12,children:[t(Ee,{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(xt,{title:"Saving...",withGradient:!0}):e(n,{children:[t(Te,{variant:Ie.Secondary,size:ke.S,leftIcon:ol,onClick:r,disabled:i}),t(Te,{variant:Ie.Primary,size:ke.S,leftIcon:nl,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(Ct,{icon:Ya,onClick:l})]})]})},hm=({expiresAt:e,callbackValid:n,callbackExpired:o})=>{const{formatTimeAgo:l}=ln(),r=i(()=>l(e),[e,l]),s=i(()=>new Date(e).toDateString().split(" ").slice(1).join(" "),[e]),c=i(()=>bo(e,0)?Pe.Error:bo(e,2592e6)?Pe.Warning:Pe.Success,[e]),d=i(()=>c===Pe.Success?nl:c===Pe.Warning?_l:yl,[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})})},mm=b.div`
791
+ `,Jh=({onClick:n})=>{const o=v().v2.colors.red[500];return e(Kh,{"data-id":"sampling-view-btn-delete",onClick:n,children:[t(ee,{size:te.XS,weight:500,color:o,children:Zn}),t(Ua,{size:16,fill:o})]})};const qh={[kr.EditAutoNoisy]:{title:ho,subTitle:uo,cancelId:"sampling-edit-auto-rule-btn-cancel",saveId:"sampling-edit-auto-rule-btn-save"},[kr.EditAutoCostReduction]:{title:po,subTitle:co,cancelId:"sampling-edit-cost-reduction-auto-rule-btn-cancel",saveId:"sampling-edit-cost-reduction-auto-rule-btn-save"},[kr.EditAutoHighlyRelevant]:{title:so,subTitle:ro,cancelId:"sampling-edit-highly-relevant-auto-rule-btn-cancel",saveId:"sampling-edit-highly-relevant-auto-rule-btn-save"}},Zh=({isOpen:e,title:n,subTitle:o,onClose:i,footer:a,renderBody:l})=>t(Xt,{isOpen:e,width:go,header:{icon:Dl,title:n,subTitle:o,onClose:i},footer:a,children:l?l():t(le,{$padding:"12px",children:t(qs,{})})}),Qh=({isOpen:o,onClose:r,onSubmit:s,validateForm:c,onNavigateToDuplicate:p})=>{const{category:u,formData:h,resetForm:m,duplicateWarning:g,setDuplicateWarning:f}=Tr(kr.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:_e.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:Yn,variant:Ie.Secondary,size:ke.S,onClick:r},{"data-id":"sampling-create-btn-submit",label:Gn,variant:Ie.Primary,size:ke.S,onClick:C,disabled:!!g}]};return e(n,{children:[t(Zh,{isOpen:o,title:no[u],subTitle:Qn[u],onClose:r,footer:x}),t(nt,{isOpen:b,title:ao,description:io,onClose:()=>v(!1),denyButton:{"data-id":"sampling-create-default-continue-editing",label:oo,variant:Ie.Secondary,onClick:()=>v(!1)},approveButton:{"data-id":"sampling-create-default-confirm",label:Gn,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:lo}),t("div",{style:{width:"100%"},children:t(er,{summary:S})})]})})]})},em=({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}=Tr(kr.View),b=c?.rule.name||to,v=p&&c?eo[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(Jh,{onClick:l}),r&&t(Pe,{status:_e.Warning,message:r.message,action:r.onViewRule?{"data-id":"sampling-view-edit-btn-view-duplicate",label:"View rule",onClick:r.onViewRule}:void 0}),t(Yh,{}),t(Te,{"data-id":"sampling-view-edit-btn-cancel",label:Yn,variant:Ie.Secondary,size:ke.S,onClick:i}),t(Te,{"data-id":"sampling-view-edit-btn-save",label:Jn,variant:Ie.Primary,size:ke.S,onClick:a,disabled:!!r})]})}}const{onDelete:i,onCancel:a,onEdit:l}=o;return{children:e(n,{children:[t(Jh,{onClick:i}),t(Yh,{}),t(Te,{"data-id":"sampling-view-btn-cancel",label:Yn,variant:Ie.Secondary,size:ke.S,onClick:a}),t(Te,{"data-id":"sampling-view-btn-edit",label:qn,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(Zh,{isOpen:!!c,title:v,subTitle:c?Qn[c.category]:"",onClose:o,footer:S})},tm=({isOpen:e,onClose:n,onSave:o})=>{const{localEnabled:i,resolvedPercentage:a}=Tr(kr.EditAutoNoisy),l=d(()=>o(i,a),[o,i,a]);return t(im,{formType:kr.EditAutoNoisy,isOpen:e,onClose:n,onSave:l})},nm=({isOpen:e,onClose:n,onSave:o})=>{const{localEnabled:i,resolvedPercentage:a}=Tr(kr.EditAutoCostReduction),l=d(()=>o(i,a),[o,i,a]);return t(im,{formType:kr.EditAutoCostReduction,isOpen:e,onClose:n,onSave:l})},om=({isOpen:e,onClose:n,onSave:o})=>{const{localEnabled:i}=Tr(kr.EditAutoHighlyRelevant),a=d(()=>o(i),[o,i]);return t(im,{formType:kr.EditAutoHighlyRelevant,isOpen:e,onClose:n,onSave:a})},im=({formType:e,isOpen:n,onClose:o,onSave:i})=>{const a=qh[e];return t(Zh,{isOpen:n,title:a.title,subTitle:a.subTitle,onClose:o,footer:{actions:[{"data-id":a.cancelId,label:Yn,variant:Ie.Secondary,size:ke.S,onClick:o},{"data-id":a.saveId,label:mo,variant:Ie.Primary,size:ke.S,onClick:i}]}})},am=e=>{switch(e.formType){case kr.Create:return t(Rr,{formType:kr.Create,category:e.category,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(Qh,{...e})});case kr.View:return t(Rr,{formType:kr.View,data:e.data,defaultEditMode:e.defaultEditMode,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(em,{...e})});case kr.EditAutoNoisy:return t(Rr,{formType:kr.EditAutoNoisy,enabled:e.enabled,keepPercentage:e.keepPercentage,children:t(tm,{...e})});case kr.EditAutoCostReduction:return t(Rr,{formType:kr.EditAutoCostReduction,enabled:e.enabled,dropPercentage:e.dropPercentage,children:t(nm,{...e})});case kr.EditAutoHighlyRelevant:return t(Rr,{formType:kr.EditAutoHighlyRelevant,enabled:e.enabled,children:t(om,{...e})})}},lm=({token:o,isLoading:i,isEditing:a,onEdit:l,onCancel:r,onSave:s,formData:c,handleFormChange:d,handleErrorChange:p,formErrors:u})=>{const{CopyButton:h}=Lt(),m=!a||i||!c.newToken;return fo({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(xt,{title:"Saving...",withGradient:!0}):e(n,{children:[t(Te,{variant:Ie.Secondary,size:ke.S,leftIcon:ol,onClick:r,disabled:i}),t(Te,{variant:Ie.Primary,size:ke.S,leftIcon:nl,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(Ct,{icon:Ya,onClick:l})]})]})},rm=({expiresAt:e,callbackValid:n,callbackExpired:o})=>{const{formatTimeAgo:l}=ln(),r=i(()=>l(e),[e,l]),s=i(()=>new Date(e).toDateString().split(" ").slice(1).join(" "),[e]),c=i(()=>bo(e,0)?_e.Error:bo(e,2592e6)?_e.Warning:_e.Success,[e]),d=i(()=>c===_e.Success?nl:c===_e.Warning?Pl:yl,[c]);return a(()=>{c===_e.Success?n():c===_e.Error&&o()},[c]),t(Ue,{text:s,children:t(ce,{leftIcon:d,label:r,status:c,invertColors:!0,useSecondaryTone:!0})})},sm=b.div`
810
792
  display: flex;
811
793
  flex-direction: column;
812
794
  gap: 12px;
@@ -814,7 +796,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
814
796
  border-radius: 12px;
815
797
  border: 1px solid ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[500]:e.v2.colors.silver[600]};
816
798
  background-color: ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[1e3]:e.v2.colors.silver[800]};
817
- `,gm=({children:e})=>{const n=v();return t(ee,{size:te.XXXS,color:n.v2.colors.grey[150],children:e})},fm=({token:n})=>{const{tokensApi:o}=yr(),[i,a]=l(!1),[r,s]=l(!1),[c,d]=l(!1),{formData:p,handleFormChange:u,formErrors:h,handleErrorChange:m,resetFormData:g}=qt({newToken:""});return t(ht,{richTitle:{icon:Pl,title:"Odigos Pro Token"},children:e(mm,{$isExpired:c,children:[e(oe,{$justifyContent:"space-between",children:[e(ae,{$gap:4,children:[t(gm,{children:"Issued for"}),t(ee,{size:te.XS,children:n.name||"N/A"})]}),e(ae,{$gap:4,children:[t(gm,{children:"Expiration"}),t(hm,{expiresAt:n.expiresAt,callbackValid:()=>d(!1),callbackExpired:()=>d(!0)})]}),t(ae,{})]}),t(oe,{children:e(ae,{children:[t(gm,{children:"Token"}),t(um,{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})]})})]})})},bm=b.div`
799
+ `,cm=({children:e})=>{const n=v();return t(ee,{size:te.XXXS,color:n.v2.colors.grey[150],children:e})},dm=({token:n})=>{const{tokensApi:o}=yr(),[i,a]=l(!1),[r,s]=l(!1),[c,d]=l(!1),{formData:p,handleFormChange:u,formErrors:h,handleErrorChange:m,resetFormData:g}=qt({newToken:""});return t(ht,{richTitle:{icon:_l,title:"Odigos Pro Token"},children:e(sm,{$isExpired:c,children:[e(oe,{$justifyContent:"space-between",children:[e(ae,{$gap:4,children:[t(cm,{children:"Issued for"}),t(ee,{size:te.XS,children:n.name||"N/A"})]}),e(ae,{$gap:4,children:[t(cm,{children:"Expiration"}),t(rm,{expiresAt:n.expiresAt,callbackValid:()=>d(!1),callbackExpired:()=>d(!0)})]}),t(ae,{})]}),t(oe,{children:e(ae,{children:[t(cm,{children:"Token"}),t(lm,{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})]})})]})})},pm=b.div`
818
800
  display: flex;
819
801
  flex-direction: column;
820
802
  align-items: center;
@@ -823,23 +805,23 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
823
805
  padding: 12px 24px;
824
806
  border-radius: 8px;
825
807
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
826
- `,vm=()=>{const{progress:n}=At(),{describeApi:o,namespacesApi:i}=yr(),{items:a}=i.useNamespaces(),[r,s]=l(null),{formData:c,handleFormChange:d,resetFormData:p}=qt({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(ht,{richTitle:{icon:Ll,title:"Diagnose"},children:r?e(bm,{children:[t(xt,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",withGradient:!0,withSpinner:"number"==typeof n[_t.DownloadingDiagnose]?.percentage,percentage:n[_t.DownloadingDiagnose]?.percentage,withVisual:"number"!=typeof n[_t.DownloadingDiagnose]?.percentage,visualIcon:Rl,startedAt:r}),n[_t.DownloadingDiagnose]?.list?.length&&t(ae,{$width:"100%",children:n[_t.DownloadingDiagnose].list.map((n,o)=>e(oe,{$gap:4,$alignItems:"center",children:[n.status===Pe.Success?t(nl,{size:16}):n.status===Pe.Error?t(ol,{size:16}):t(xt,{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(vo,{alignX:Co.Left,alignY:yo.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:Rl,variant:Ie.Primary,onClick:async()=>{o.downloadDiagnose&&(s(Date.now()),await o.downloadDiagnose(c),s(null),p())},disabled:null!==r})})]})})},ym=()=>{const{platformType:e,version:n,tier:o}=S(),{describeApi:i}=yr(),[r,s]=l(null);return a(()=>{i.fetchDescribeOdigos&&i.fetchDescribeOdigos().then(({data:e})=>s(e?.describeOdigos??null))},[]),t(ht,{richTitle:{icon:Tl,title:"General Information"},children:t(Kt,{cellsPerRow:2,items:[{id:So(),title:"Odigos Version",label:n},{id:So(),title:`${e.toUpperCase()} Version`,label:r?.kubernetesVersion?.value||"-"},{id:So(),title:"Installation Method",label:r?.installationMethod?.value||"-"},{id:So(),title:"Tier",label:o}]})})},Cm=({isOpen:n,onClose:o})=>{const{describeApi:i,tokensApi:a}=yr(),l=a.useTokens().items[0];return e(Xt,{isOpen:n,header:{icon:Tl,title:"System Overview",onClose:o},children:[i.fetchDescribeOdigos&&t(ym,{}),a.updateToken&&l&&t(fm,{token:l}),i.downloadDiagnose&&t(vm,{})]})},Sm=({isOpen:o,onClose:i,onCloseEnd:a})=>{const{addDataStreams:l,setSelectedStreamName:r}=it(),{dataStreamsApi:s}=yr(),{requestSubmit:c}=xr(),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 fo({key:"Enter",active:o},u),e(n,{children:[t(nt,{isOpen:o,onClose:i,onCloseEnd:a,title:ot.NAME_YOUR_STREAM,description:ot.STREAM_DESCRIPTION,approveButton:{"data-id":"add-stream-btn-done",label:Mt.DONE,variant:Ie.Primary,onClick:u},denyButton:{"data-id":"add-stream-btn-cancel",label:Mt.CANCEL,variant:Ie.Secondary,onClick:i},children:t(Hs,{autoFocus:!0})}),t(Vs,{})]})},xm=({isOpen:o,onClose:i,onCloseEnd:l,dataStreamName:r})=>{const{dataStreamsApi:s}=yr(),{genericForm:c,loadDataStream:p,requestSubmit:u}=xr();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 fo({key:"Enter",active:o},g),e(n,{children:[t(nt,{isOpen:o,onClose:i,onCloseEnd:l,title:ot.RENAME_STREAM(r),description:ot.STREAM_DESCRIPTION,approveButton:{"data-id":"edit-stream-btn-save",label:Mt.SAVE,variant:Ie.Primary,onClick:g,disabled:!h},denyButton:{"data-id":"edit-stream-btn-cancel",label:Mt.CANCEL,variant:Ie.Secondary,onClick:i},children:t(Hs,{autoFocus:!0})}),t(Vs,{})]})},wm=({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)"})})]})]}),Tm=b.div`
808
+ `,um=()=>{const{progress:n}=At(),{describeApi:o,namespacesApi:i}=yr(),{items:a}=i.useNamespaces(),[r,s]=l(null),{formData:c,handleFormChange:d,resetFormData:p}=qt({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(ht,{richTitle:{icon:Ll,title:"Diagnose"},children:r?e(pm,{children:[t(xt,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",withGradient:!0,withSpinner:"number"==typeof n[Pt.DownloadingDiagnose]?.percentage,percentage:n[Pt.DownloadingDiagnose]?.percentage,withVisual:"number"!=typeof n[Pt.DownloadingDiagnose]?.percentage,visualIcon:Rl,startedAt:r}),n[Pt.DownloadingDiagnose]?.list?.length&&t(ae,{$width:"100%",children:n[Pt.DownloadingDiagnose].list.map((n,o)=>e(oe,{$gap:4,$alignItems:"center",children:[n.status===_e.Success?t(nl,{size:16}):n.status===_e.Error?t(ol,{size:16}):t(xt,{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(vo,{alignX:Co.Left,alignY:yo.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:_e.Default}):void 0}}),t(oe,{$justifyContent:"flex-end",children:t(Te,{label:"Download Diagnose",rightIcon:Rl,variant:Ie.Primary,onClick:async()=>{o.downloadDiagnose&&(s(Date.now()),await o.downloadDiagnose(c),s(null),p())},disabled:null!==r})})]})})},hm=()=>{const{platformType:e,version:n,tier:o}=S(),{describeApi:i}=yr(),[r,s]=l(null);return a(()=>{i.fetchDescribeOdigos&&i.fetchDescribeOdigos().then(({data:e})=>s(e?.describeOdigos??null))},[]),t(ht,{richTitle:{icon:Tl,title:"General Information"},children:t(Kt,{cellsPerRow:2,items:[{id:So(),title:"Odigos Version",label:n},{id:So(),title:`${e.toUpperCase()} Version`,label:r?.kubernetesVersion?.value||"-"},{id:So(),title:"Installation Method",label:r?.installationMethod?.value||"-"},{id:So(),title:"Tier",label:o}]})})},mm=({isOpen:n,onClose:o})=>{const{describeApi:i,tokensApi:a}=yr(),l=a.useTokens().items[0];return e(Xt,{isOpen:n,header:{icon:Tl,title:"System Overview",onClose:o},children:[i.fetchDescribeOdigos&&t(hm,{}),a.updateToken&&l&&t(dm,{token:l}),i.downloadDiagnose&&t(um,{})]})},gm=({isOpen:o,onClose:i,onCloseEnd:a})=>{const{addDataStreams:l,setSelectedStreamName:r}=it(),{dataStreamsApi:s}=yr(),{requestSubmit:c}=xr(),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 fo({key:"Enter",active:o},u),e(n,{children:[t(nt,{isOpen:o,onClose:i,onCloseEnd:a,title:ot.NAME_YOUR_STREAM,description:ot.STREAM_DESCRIPTION,approveButton:{"data-id":"add-stream-btn-done",label:Mt.DONE,variant:Ie.Primary,onClick:u},denyButton:{"data-id":"add-stream-btn-cancel",label:Mt.CANCEL,variant:Ie.Secondary,onClick:i},children:t(Hs,{autoFocus:!0})}),t(Vs,{})]})},fm=({isOpen:o,onClose:i,onCloseEnd:l,dataStreamName:r})=>{const{dataStreamsApi:s}=yr(),{genericForm:c,loadDataStream:p,requestSubmit:u}=xr();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 fo({key:"Enter",active:o},g),e(n,{children:[t(nt,{isOpen:o,onClose:i,onCloseEnd:l,title:ot.RENAME_STREAM(r),description:ot.STREAM_DESCRIPTION,approveButton:{"data-id":"edit-stream-btn-save",label:Mt.SAVE,variant:Ie.Primary,onClick:g,disabled:!h},denyButton:{"data-id":"edit-stream-btn-cancel",label:Mt.CANCEL,variant:Ie.Secondary,onClick:i},children:t(Hs,{autoFocus:!0})}),t(Vs,{})]})},bm=({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)"})})]})]}),vm=b.div`
827
809
  position: absolute;
828
810
  top: 50%;
829
811
  left: 50%;
830
812
  transform: translate(-50%, -50%);
831
813
  z-index: ${({theme:e})=>e.v2.zIndex.modal};
832
- `,km=()=>{const{drawerType:n,setDrawerType:o}=Cn(),i=n===wo.OnboardingDone,a=()=>o(null);return e(xo,{isOpen:i,onClose:a,children:[t(wm,{}),t(Tm,{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(mr,{size:260}),t(ee,{size:te.S,weight:400,children:"Your observability control plane is ready."})]}),t(Te,{label:"Get Started",rightIcon:Ha,onClick:a})]})})]})},Im=b.div`
814
+ `,ym=()=>{const{drawerType:n,setDrawerType:o}=Cn(),i=n===wo.OnboardingDone,a=()=>o(null);return e(xo,{isOpen:i,onClose:a,children:[t(bm,{}),t(vm,{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(mr,{size:260}),t(ee,{size:te.S,weight:400,children:"Your observability control plane is ready."})]}),t(Te,{label:"Get Started",rightIcon:Ha,onClick:a})]})})]})},Cm=b.div`
833
815
  display: flex;
834
816
  flex-direction: column;
835
817
  gap: 8px;
836
818
  padding: 4px 8px;
837
819
  border-radius: 8px;
838
820
  width: 100%;
839
- `,Em=b.div`
821
+ `,Sm=b.div`
840
822
  white-space: pre;
841
823
  overflow-x: auto;
842
- `,Nm=({name:n,recommended:o,toggleLabel:i,enabled:a,onEnabledChange:l,summary:r,toggleName:s})=>{const c=v();return e(Im,{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:To,leftIcon:Fl,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:Ot.S})]}),t(Em,{children:t(w,{parts:r})})]})},Om=b.div`
824
+ `,xm=({name:n,recommended:o,toggleLabel:i,enabled:a,onEnabledChange:l,summary:r,toggleName:s})=>{const c=v();return e(Cm,{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:To,leftIcon:Fl,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:Ot.S})]}),t(Sm,{children:t(w,{parts:r})})]})},wm=b.div`
843
825
  position: relative;
844
826
  display: flex;
845
827
  align-items: center;
@@ -849,18 +831,18 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
849
831
  background-color: ${({theme:e})=>e.v2.colors.black[500]};
850
832
  border-top-left-radius: 18px;
851
833
  border-top-right-radius: 18px;
852
- `,$m=b.div`
834
+ `,Tm=b.div`
853
835
  position: absolute;
854
836
  left: 16px;
855
837
  top: 50%;
856
838
  transform: translateY(-50%);
857
- `,Am=b.div`
839
+ `,km=b.div`
858
840
  height: 16px;
859
841
  width: 100%;
860
842
  background-color: ${({theme:e})=>e.v2.colors.black[500]};
861
843
  border-top-left-radius: 18px;
862
844
  border-top-right-radius: 18px;
863
- `,Rm=b.div`
845
+ `,Im=b.div`
864
846
  width: ${({$width:e})=>e}px;
865
847
  display: flex;
866
848
  flex-direction: column;
@@ -868,7 +850,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
868
850
  gap: 22px;
869
851
  padding: 8px 32px 32px 32px;
870
852
  background-color: ${({theme:e})=>e.v2.colors.black[500]};
871
- `,Dm=e=>t(Ml,{rotate:90,...e}),_m=({children:n,center:o,onNext:i,nextLabel:a=ko,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:Dm,variant:Ie.Primary,size:ke.M,onClick:i,loading:l})]}),Pm=e=>t(Ml,{rotate:-90,...e}),Lm=({title:n,onBack:o})=>{const i=v();return e(Om,{$hasBack:!!o,children:[o&&t($m,{children:t(Ct,{"data-id":"sampling-onboarding-back",icon:Pm,size:St.M,onClick:o})}),t(ee,{size:te.M,weight:500,color:i.v2.colors.white[500],align:"center",children:n})]})},Fm=b.div`
853
+ `,Nm=e=>t(Ml,{rotate:90,...e}),Em=({children:n,center:o,onNext:i,nextLabel:a=ko,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:Nm,variant:Ie.Primary,size:ke.M,onClick:i,loading:l})]}),Om=e=>t(Ml,{rotate:-90,...e}),$m=({title:n,onBack:o})=>{const i=v();return e(wm,{$hasBack:!!o,children:[o&&t(Tm,{children:t(Ct,{"data-id":"sampling-onboarding-back",icon:Om,size:St.M,onClick:o})}),t(ee,{size:te.M,weight:500,color:i.v2.colors.white[500],align:"center",children:n})]})},Am=b.div`
872
854
  box-sizing: border-box;
873
855
  width: ${({$width:e})=>e??"100%"};
874
856
  ${({$fillHeight:e})=>e&&y`
@@ -881,16 +863,16 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
881
863
  padding: 16px;
882
864
  border-radius: 16px;
883
865
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
884
- `,Mm=({children:e,fillHeight:n,width:o})=>t(Fm,{$fillHeight:n,$width:o,children:e}),zm=b.ul`
866
+ `,Rm=({children:e,fillHeight:n,width:o})=>t(Am,{$fillHeight:n,$width:o,children:e}),Dm=b.ul`
885
867
  margin: 0;
886
868
  padding: 0;
887
869
  list-style: disc;
888
- `,Xm=b.li`
870
+ `,Pm=b.li`
889
871
  margin-left: 18px;
890
872
  & + & {
891
873
  margin-top: 6px;
892
874
  }
893
- `,Bm=({items:e,color:n})=>{const o=v(),i=n||o.v2.colors.silver[200];return t(zm,{children:e.map((e,n)=>t(Xm,{style:{color:i},children:t(ee,{size:te.XXS,color:i,children:e})},n))})},Um=({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))})},Vm=({message:e})=>t(_e,{status:Pe.Default,message:e,fullWidth:!0,smallIcon:!0}),Hm=b.div`
875
+ `,_m=({items:e,color:n})=>{const o=v(),i=n||o.v2.colors.silver[200];return t(Dm,{children:e.map((e,n)=>t(Pm,{style:{color:i},children:t(ee,{size:te.XXS,color:i,children:e})},n))})},Lm=({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))})},Fm=({message:e})=>t(Pe,{status:_e.Default,message:e,fullWidth:!0,smallIcon:!0}),Mm=b.div`
894
876
  width: 100%;
895
877
  padding: 8px;
896
878
  display: flex;
@@ -898,12 +880,12 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
898
880
  gap: 4px;
899
881
  border-radius: 16px;
900
882
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
901
- `,jm=b.div`
883
+ `,zm=b.div`
902
884
  display: flex;
903
885
  align-items: center;
904
886
  gap: 8px;
905
887
  padding: 4px 8px 12px 8px;
906
- `,Gm=b.div`
888
+ `,Xm=b.div`
907
889
  width: 100%;
908
890
  display: flex;
909
891
  flex-direction: column;
@@ -911,20 +893,20 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
911
893
  padding: 8px;
912
894
  border-radius: 12px;
913
895
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
914
- `,Wm=({children:e})=>{const n=v();return t(ee,{size:te.S,weight:500,color:n.v2.colors.white[500],align:"center",children:e})},Km=b.div`
896
+ `,Bm=({children:e})=>{const n=v();return t(ee,{size:te.S,weight:500,color:n.v2.colors.white[500],align:"center",children:e})},Um=b.div`
915
897
  white-space: pre-line;
916
- `,Ym=({enabled:o,onEnabledChange:a,onBack:l,onNext:r})=>{const s=v(),c=i(()=>A({enabled:o,keepPercentage:0}),[o]);return e(n,{children:[t(Lm,{title:Io,onBack:l}),e(Rm,{$width:854,children:[t(Wm,{children:Eo}),e(ae,{$gap:8,$width:"100%",children:[t(Mm,{children:t(Km,{children:t(ee,{size:te.XXS,color:s.v2.colors.silver[200],children:No})})}),e(ae,{$gap:8,$width:"100%",children:[e(Hm,{children:[t(jm,{children:t(ee,{size:te.S,weight:500,color:s.v2.colors.white[500],children:Oo})}),t(Gm,{children:t(Nm,{name:Ao,recommended:!0,toggleLabel:$o,enabled:o,onEnabledChange:a,summary:c,toggleName:"sampling-onboarding-noisy-toggle"})})]}),t(Vm,{message:Ro})]})]})]}),t(_m,{onNext:r})]})},Jm=e=>t(Ml,{rotate:90,...e}),qm=({onClose:o})=>{const i=v();return e(n,{children:[t(Am,{}),e(Rm,{$width:732,children:[t(Do,{icon:Dl}),e(ae,{$gap:16,$alignItems:"center",$width:"100%",children:[t(ee,{size:te.M,weight:500,color:i.v2.colors.white[500],children:_o}),Po.split("\n").map((e,n)=>t(Wm,{children:e},`subtitle-${n}-${e}`)),e(Mm,{children:[t(ee,{size:te.XS,color:i.v2.colors.silver[200],children:Lo}),t(Bm,{color:i.v2.colors.white[500],items:[Fo,Mo,zo]})]})]})]}),t(_m,{center:!0,children:t(Te,{"data-id":"sampling-onboarding-btn-go-to",label:Xo,rightIcon:Jm,variant:Ie.Primary,size:ke.M,onClick:o})})]})},Zm=e=>t(Ml,{rotate:90,...e}),Qm=b.div`
898
+ `,Vm=({enabled:o,onEnabledChange:a,onBack:l,onNext:r})=>{const s=v(),c=i(()=>A({enabled:o,keepPercentage:0}),[o]);return e(n,{children:[t($m,{title:Io,onBack:l}),e(Im,{$width:854,children:[t(Bm,{children:No}),e(ae,{$gap:8,$width:"100%",children:[t(Rm,{children:t(Um,{children:t(ee,{size:te.XXS,color:s.v2.colors.silver[200],children:Eo})})}),e(ae,{$gap:8,$width:"100%",children:[e(Mm,{children:[t(zm,{children:t(ee,{size:te.S,weight:500,color:s.v2.colors.white[500],children:Oo})}),t(Xm,{children:t(xm,{name:Ao,recommended:!0,toggleLabel:$o,enabled:o,onEnabledChange:a,summary:c,toggleName:"sampling-onboarding-noisy-toggle"})})]}),t(Fm,{message:Ro})]})]})]}),t(Em,{onNext:r})]})},Hm=e=>t(Ml,{rotate:90,...e}),jm=({onClose:o})=>{const i=v();return e(n,{children:[t(km,{}),e(Im,{$width:732,children:[t(Do,{icon:Dl}),e(ae,{$gap:16,$alignItems:"center",$width:"100%",children:[t(ee,{size:te.M,weight:500,color:i.v2.colors.white[500],children:Po}),_o.split("\n").map((e,n)=>t(Bm,{children:e},`subtitle-${n}-${e}`)),e(Rm,{children:[t(ee,{size:te.XS,color:i.v2.colors.silver[200],children:Lo}),t(_m,{color:i.v2.colors.white[500],items:[Fo,Mo,zo]})]})]})]}),t(Em,{center:!0,children:t(Te,{"data-id":"sampling-onboarding-btn-go-to",label:Xo,rightIcon:Hm,variant:Ie.Primary,size:ke.M,onClick:o})})]})},Gm=e=>t(Ml,{rotate:90,...e}),Wm=b.div`
917
899
  display: flex;
918
900
  flex-direction: column;
919
901
  align-items: center;
920
902
  gap: 8px;
921
903
  width: 100%;
922
- `,eg=({onSkip:o,onNext:i})=>{const a=v();return e(n,{children:[t(Am,{}),e(Rm,{$width:732,children:[t(Do,{icon:Dl}),e(ae,{$gap:16,$alignItems:"center",$width:"100%",children:[e(Qm,{children:[t(ee,{size:te.M,weight:500,color:a.v2.colors.white[500],children:Bo}),t(Wm,{children:Uo})]}),e(Mm,{children:[t(ee,{size:te.XS,color:a.v2.colors.silver[200],children:Vo}),t(Um,{items:[{title:jo,description:Ho},{title:Wo,description:Go},{title:Yo,description:Ko}]}),t(Vm,{message:Jo})]})]})]}),e(_m,{center:!0,children:[t(Te,{"data-id":"sampling-onboarding-btn-skip",label:qo,variant:Ie.Secondary,onClick:o}),t(Te,{"data-id":"sampling-onboarding-btn-start",label:Zo,rightIcon:Zm,variant:Ie.Primary,onClick:i})]})]})},tg=b.div`
904
+ `,Km=({onSkip:o,onNext:i})=>{const a=v();return e(n,{children:[t(km,{}),e(Im,{$width:732,children:[t(Do,{icon:Dl}),e(ae,{$gap:16,$alignItems:"center",$width:"100%",children:[e(Wm,{children:[t(ee,{size:te.M,weight:500,color:a.v2.colors.white[500],children:Bo}),t(Bm,{children:Uo})]}),e(Rm,{children:[t(ee,{size:te.XS,color:a.v2.colors.silver[200],children:Vo}),t(Lm,{items:[{title:jo,description:Ho},{title:Wo,description:Go},{title:Yo,description:Ko}]}),t(Fm,{message:Jo})]})]})]}),e(Em,{center:!0,children:[t(Te,{"data-id":"sampling-onboarding-btn-skip",label:qo,variant:Ie.Secondary,onClick:o}),t(Te,{"data-id":"sampling-onboarding-btn-start",label:Zo,rightIcon:Gm,variant:Ie.Primary,onClick:i})]})]})},Ym=b.div`
923
905
  display: flex;
924
906
  align-items: stretch;
925
907
  gap: 16px;
926
908
  width: 100%;
927
- `,ng=b.div`
909
+ `,Jm=b.div`
928
910
  flex: 1;
929
911
  display: flex;
930
912
  flex-direction: column;
@@ -944,18 +926,18 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
944
926
  background-color: ${t.v2.colors.silver[700]};
945
927
  }
946
928
  `}
947
- `,og=b.div`
929
+ `,qm=b.div`
948
930
  display: flex;
949
931
  align-items: center;
950
932
  gap: 8px;
951
933
  padding: 12px 16px;
952
- `,ig=b.div`
934
+ `,Zm=b.div`
953
935
  flex: 1;
954
936
  padding: 8px;
955
937
  display: flex;
956
938
  flex-direction: column;
957
939
  gap: 8px;
958
- `,ag=b.div`
940
+ `,Qm=b.div`
959
941
  flex: 1;
960
942
  display: flex;
961
943
  flex-direction: column;
@@ -963,17 +945,17 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
963
945
  padding: 12px;
964
946
  border-radius: 12px;
965
947
  background-color: ${({theme:e,$selected:t})=>t?e.v2.colors.purple[900]:e.v2.colors.silver[900]};
966
- `,lg=b.div`
948
+ `,eg=b.div`
967
949
  display: flex;
968
950
  justify-content: flex-end;
969
- `,rg=b.div`
951
+ `,tg=b.div`
970
952
  display: flex;
971
953
  align-items: center;
972
954
  gap: 8px;
973
955
  padding: 4px 12px 4px 4px;
974
956
  border-radius: 8px;
975
957
  background-color: ${({theme:e})=>e.v2.colors.yellow[1e3]};
976
- `,sg=b.div`
958
+ `,ng=b.div`
977
959
  display: flex;
978
960
  align-items: center;
979
961
  justify-content: center;
@@ -981,13 +963,13 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
981
963
  height: 24px;
982
964
  border-radius: 6px;
983
965
  background-color: ${({theme:e})=>e.v2.colors.yellow[900]};
984
- `,cg=({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(ng,{$selected:n,onClick:o,children:[e(og,{children:[t(Se,{"data-id":`sampling-onboarding-radio-${i}`,value:n,onChange:o,size:we.L}),t(Dl,{size:24,fill:d.v2.colors.white[500]}),t(ee,{size:te.S,weight:500,color:d.v2.colors.white[500],children:i})]}),e(ig,{children:[e(ag,{$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(Bm,{color:p,items:r}),s&&e(rg,{children:[t(sg,{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(lg,{children:t(Te,{"data-id":`sampling-onboarding-btn-read-more-${i}`,label:gi,rightIcon:Wa,variant:Ie.Text,size:ke.S,onClick:e=>{e.stopPropagation(),c()}})})]})]})},dg=({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(Lm,{title:Qo,onBack:a}),e(Rm,{$width:854,children:[t(Wm,{children:ei}),e(tg,{children:[t(cg,{selected:"keep-list"===o,onSelect:()=>i("keep-list"),name:li,description:ai,badgeProps:{label:ii,backgroundColor:s.v2.colors.purple[500],textColor:s.v2.colors.white[500]},bullets:[ni,oi],warning:ti,onReadMore:c}),t(cg,{selected:"drop-list"===o,onSelect:()=>i("drop-list"),name:pi,description:di,badgeProps:{label:ci,backgroundColor:s.v2.colors.green[500],textColor:s.v2.colors.black[500]},bullets:[ri,si],onReadMore:c}),t(cg,{selected:"advanced"===o,onSelect:()=>i("advanced"),name:mi,description:hi,badgeProps:{label:ui,backgroundColor:s.v2.colors.blue[700],textColor:s.v2.colors.white[500]},onReadMore:c})]})]}),t(_m,{onNext:l})]})},pg=({onBack:o,onNext:a,submitting:l})=>{const r=v(),s=i(()=>[{title:yi,bullets:[fi,bi,vi]},{title:ki,bullets:[Ci,Si,xi,wi,Ti]}],[]);return e(n,{children:[t(Lm,{title:Ii,onBack:o}),e(Rm,{$width:854,children:[t(Wm,{children:Ei}),t(oe,{$gap:16,$width:"100%",$alignItems:"stretch",children:s.map((n,o)=>e(Mm,{fillHeight:!0,width:"50%",children:[t(ee,{size:te.XS,color:r.v2.colors.white[500],children:n.title}),t(Bm,{items:n.bullets})]},o))}),t(Vm,{message:Ni})]}),t(_m,{onNext:a,nextLoading:l})]})},ug=b.div`
966
+ `,og=({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(Jm,{$selected:n,onClick:o,children:[e(qm,{children:[t(Se,{"data-id":`sampling-onboarding-radio-${i}`,value:n,onChange:o,size:we.L}),t(Dl,{size:24,fill:d.v2.colors.white[500]}),t(ee,{size:te.S,weight:500,color:d.v2.colors.white[500],children:i})]}),e(Zm,{children:[e(Qm,{$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(_m,{color:p,items:r}),s&&e(tg,{children:[t(ng,{children:t(Pl,{size:18,fill:d.v2.colors.yellow[500]})}),t(ee,{size:te.XXXS,color:d.v2.colors.yellow[500],children:s})]})]}),c&&t(eg,{children:t(Te,{"data-id":`sampling-onboarding-btn-read-more-${i}`,label:gi,rightIcon:Wa,variant:Ie.Text,size:ke.S,onClick:e=>{e.stopPropagation(),c()}})})]})]})},ig=({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($m,{title:Qo,onBack:a}),e(Im,{$width:854,children:[t(Bm,{children:ei}),e(Ym,{children:[t(og,{selected:"keep-list"===o,onSelect:()=>i("keep-list"),name:li,description:ai,badgeProps:{label:ii,backgroundColor:s.v2.colors.purple[500],textColor:s.v2.colors.white[500]},bullets:[ni,oi],warning:ti,onReadMore:c}),t(og,{selected:"drop-list"===o,onSelect:()=>i("drop-list"),name:pi,description:di,badgeProps:{label:ci,backgroundColor:s.v2.colors.green[500],textColor:s.v2.colors.black[500]},bullets:[ri,si],onReadMore:c}),t(og,{selected:"advanced"===o,onSelect:()=>i("advanced"),name:mi,description:hi,badgeProps:{label:ui,backgroundColor:s.v2.colors.blue[700],textColor:s.v2.colors.white[500]},onReadMore:c})]})]}),t(Em,{onNext:l})]})},ag=({onBack:o,onNext:a,submitting:l})=>{const r=v(),s=i(()=>[{title:yi,bullets:[fi,bi,vi]},{title:ki,bullets:[Ci,Si,xi,wi,Ti]}],[]);return e(n,{children:[t($m,{title:Ii,onBack:o}),e(Im,{$width:854,children:[t(Bm,{children:Ni}),t(oe,{$gap:16,$width:"100%",$alignItems:"stretch",children:s.map((n,o)=>e(Rm,{fillHeight:!0,width:"50%",children:[t(ee,{size:te.XS,color:r.v2.colors.white[500],children:n.title}),t(_m,{items:n.bullets})]},o))}),t(Fm,{message:Ei})]}),t(Em,{onNext:a,nextLoading:l})]})},lg=b.div`
985
967
  white-space: pre-line;
986
- `,hg=({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(Lm,{title:Oi,onBack:l}),e(Rm,{$width:854,children:[t(Wm,{children:$i}),e(ae,{$gap:8,$width:"100%",children:[e(Mm,{children:[t(ug,{children:t(ee,{size:te.XXS,color:c.v2.colors.silver[200],children:Ai})}),t(Vm,{message:Ni})]}),e(Hm,{children:[e(jm,{children:[t(ee,{size:te.S,weight:500,color:c.v2.colors.white[500],children:Ri}),t(Cl,{size:16,fill:c.v2.colors.silver[200]})]}),t(Gm,{children:t(Nm,{name:_i,recommended:!0,toggleLabel:Di,enabled:o,onEnabledChange:a,summary:d,toggleName:"sampling-onboarding-drop-error-preset-toggle"})})]})]})]}),t(_m,{onNext:r,nextLoading:s})]})},mg=b.div`
968
+ `,rg=({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($m,{title:Oi,onBack:l}),e(Im,{$width:854,children:[t(Bm,{children:$i}),e(ae,{$gap:8,$width:"100%",children:[e(Rm,{children:[t(lg,{children:t(ee,{size:te.XXS,color:c.v2.colors.silver[200],children:Ai})}),t(Fm,{message:Ei})]}),e(Mm,{children:[e(zm,{children:[t(ee,{size:te.S,weight:500,color:c.v2.colors.white[500],children:Ri}),t(Cl,{size:16,fill:c.v2.colors.silver[200]})]}),t(Xm,{children:t(xm,{name:Pi,recommended:!0,toggleLabel:Di,enabled:o,onEnabledChange:a,summary:d,toggleName:"sampling-onboarding-drop-error-preset-toggle"})})]})]})]}),t(Em,{onNext:r,nextLoading:s})]})},sg=b.div`
987
969
  white-space: pre-line;
988
- `,gg=b.div`
970
+ `,cg=b.div`
989
971
  width: fit-content;
990
- `,fg=["50","25","10","1","0.1"],bg=({value:n,onChange:o,label:a})=>{const l=v(),r=i(()=>fg.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(gg,{children:t(ve,{"data-id":"sampling-onboarding-ambient",options:r,selected:n,setSelected:o})})]})},vg=({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(Lm,{title:Pi,onBack:s}),e(Rm,{$width:854,children:[t(Wm,{children:Li}),e(ae,{$gap:8,$width:"100%",children:[e(Mm,{children:[t(mg,{children:t(ee,{size:te.XXS,color:p.v2.colors.silver[200],children:Fi})}),t(Bm,{items:[Mi,zi,Xi,Bi,Ui]}),t(Vm,{message:Ni})]}),e(Hm,{children:[e(jm,{children:[t(ee,{size:te.S,weight:500,color:p.v2.colors.white[500],children:Vi}),t(Cl,{size:16,fill:p.v2.colors.silver[200]})]}),t(Gm,{children:t(Nm,{name:_i,recommended:!0,toggleLabel:Di,enabled:o,onEnabledChange:a,summary:u,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(Gm,{children:t(bg,{value:l,onChange:r,label:Hi})})]})]})]}),t(_m,{onNext:c,nextLoading:d})]})},yg=({isOpen:e,onClose:n,k8sHealthProbesConfig:o,samplingId:i,docsUrl:r})=>{const{samplingApi:s}=yr(),[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(eg,{onSkip:n,onNext:()=>p("noisy")});break;case"noisy":w=t(Ym,{enabled:u,onEnabledChange:h,onBack:()=>p("welcome"),onNext:()=>p("strategy")});break;case"strategy":w=t(dg,{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(vg,{errorPresetEnabled:f,onErrorPresetChange:b,ambientPercentage:v,onAmbientPercentageChange:y,onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"drop-list":w=t(hg,{errorPresetEnabled:f,onErrorPresetChange:b,onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"advanced":w=t(pg,{onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"success":w=t(qm,{onClose:n})}return t(xo,{isOpen:e,onClose:n,children:w})};var Cg,Sg;(e=>{e.BulkConfig="bulk-config",e.Delete="delete"})(Cg||(Cg={})),(e=>{e.K8s="k8s",e.VmAgent="vm-agent",e.CloudConnector="cloud-connector",e.AwsEcsAgent="aws-ecs-agent"})(Sg||(Sg={}));const xg=[{id:Sg.CloudConnector,label:"Cloud Connector"}];var wg;(e=>{e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"})(wg||(wg={}));const Tg=[{key:wg.Name,label:"Name"},{key:wg.Type,label:"Type"},{key:wg.Status,label:"Status"},{key:wg.OdigosVersion,label:"Odigos Version"},{key:wg.ConnectedSince,label:"Connected Since"},{key:wg.LastActivity,label:"Last Activity"}],kg=(e,t)=>{const n=e.find(e=>e.key===wg.Id)?.rawValue;return t(n?.toString()||"")},Ig={[Pe.Success]:"Connected",[Pe.Warning]:"Degraded",[Pe.Error]:"Error",[Pe.Disabled]:"Disabled",[Pe.Info]:"Pending"},Eg={[ji.K8s]:gn.Purple,[ji.Vm]:gn.Blue,[ji.Connector]:gn.Green,[ji.AwsEcs]:gn.Yellow},Ng=({connections:n,getConnections:o,onClickConnection:r,deleteConnection:s,onCreateNew:c,cloudConnectorProviders:p,onCreateCloudConnector:u,configMinSupportedVersion:h=0})=>{const m=v(),{formatTimeAgo:g}=ln(),[f,b]=l(!n?.length),[y,C]=l(n||[]),S=d(async()=>{try{b(!0),C(await o()??[])}catch(e){}finally{b(!1)}},[]);a(()=>{y.length||S()},[]);const[x,w]=l(""),[T,k]=l(null),[I,E]=l([]),[N,O]=l(!1),[$,A]=l(!1),R=d(()=>{O(!1),A(!0),S()},[S]),P=d(e=>{e===Sg.CloudConnector?O(!0):c?.(e)},[c]),{supportedConnections:L,supportedConnectionIds:F}=i(()=>{const e=((e,t)=>e.filter(e=>{const n=e.status===Pe.Success,o=D(e.odigosVersion,t,e.type);return n&&o}))(y,h);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[y,h]),M=i(()=>I.map(e=>y.find(t=>t.id===e)).filter(e=>!!e),[y,I]);a(()=>{if(!T||T===Cg.Delete)return;const e=I.filter(e=>!F.includes(e));e.length&&E(t=>t.filter(t=>!e.includes(t)))},[T,I.length,F.length]);const z=i(()=>y.filter(e=>!x||e.name.toLowerCase().includes(x.toLowerCase())).map(e=>({cells:[{key:wg.Id,rawValue:e.id},{key:wg.Name,rawValue:e.name},{key:wg.Type,rawValue:e.type,component:()=>t(on,{variant:Eg[e.type]??gn.Default,label:Gi(e.type),leftIcon:Wn(e.type)})},{key:wg.Status,rawValue:e.status,component:()=>(e=>{if(e.type===ji.Connector){const n=Ig[e.status]??"Pending",o=e.status===Pe.Success?nl:e.status===Pe.Error?ol: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?nl:ol;return t(ce,{status:e.status,label:n,leftIcon:o})})(e)},{key:wg.OdigosVersion,rawValue:e.odigosVersion},{key:wg.ConnectedSince,rawValue:e.connectedAt?g(e.connectedAt):"-"},{key:wg.LastActivity,rawValue:e.lastSeenAt?g(e.lastSeenAt):"-"}],onClick:e.status!==Pe.Success||T?void 0:()=>r(e),isSelected:I.includes(e.id),onSelect:()=>E(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>E(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.type!==ji.K8s||e.status!==Pe.Success||!D(e.odigosVersion,h,e.type)})),[y,I,x,T,h,g,r]),X=i(()=>z.some(e=>!e.hideCheckbox),[z]),B=i(()=>{const e=(e,t)=>{E([e]),k(t)};return(e=>{const{connections:t,configMinSupportedVersion:n,onDelete:o,onEditConfiguration:i}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===wg.Status)?.rawValue===Pe.Success)(e))return[{id:So(),label:"Delete Connection",rightIcon:Ka,onClick:()=>kg(e,o)}];const a=kg(e,e=>t.find(t=>t.id===e));if(a?.type!==ji.K8s)return[];const l=!!a&&D(a.odigosVersion,n,a.type),r=_(n,a?.type),s=[];return i&&s.push({id:So(),tooltip:l?"Edit Configuration":`To use this feature, please upgrade to Odigos v${r} or later.`,rightIcon:fl,disabled:!l,onClick:()=>kg(e,i)}),s}})({connections:y,configMinSupportedVersion:h,onDelete:t=>e(t,Cg.Delete),onEditConfiguration:t=>e(t,Cg.BulkConfig)})},[y,h]),U=i(()=>(e=>{const{onCancel:t,onManageConfigurations:n}=e,o=[];return n&&o.push({id:Cg.BulkConfig,type:bn.Button,buttonProps:{variant:Ie.Secondary,size:ke.S,leftIcon:fl,label:"Manage Configurations",onClick:n}}),o.push({id:So(),type:bn.Button,buttonProps:{variant:Ie.Text,size:ke.S,label:Mt.CANCEL,onClick:t}}),o})({onCancel:()=>E([]),onManageConfigurations:()=>k(Cg.BulkConfig)}),[]),V=i(()=>t(vo,{items:xg,withMultiSelect:!1,selectedIds:[],setSelectedIds:e=>P(e[0]),buttonProps:{variant:Ie.Primary,size:ke.S,label:Mt.CREATE_NEW}}),[P]),H=i(()=>x.trim()&&y.length>0?{hideIcon:!0,title:ot.NO_RESULTS,subTitle:ot.NO_RESULTS_FOR_FILTER(x)}:{icon:zl,title:ot.NO_CONNECTIONS,action:V},[x,y.length,V]);return t(Wi,{children:e(ht,{fullHeight:!0,richTitle:{icon:zl,title:ot.CONNECTIONS,badge:{label:y.length.toString(),status:Pe.Unknown}},search:{placeholder:"Search by cluster name",value:x,onChange:e=>w(e),width:"300px"},actions:[{id:"connections-refresh",type:bn.Button,buttonProps:{variant:Ie.Secondary,size:ke.S,leftIcon:gl,onClick:S,disabled:f}},{id:"connections-create-new",type:bn.ButtonDropData,buttonProps:{variant:Ie.Primary,size:ke.S,label:Mt.CREATE_NEW,onClick:e=>P(e)},dropDataProps:{alignX:Co.Right,items:xg}}],children:[t(Un,{variant:Vn.Pretty,headerBackgroundColor:m.v2.colors.silver[1e3],isLoading:f,withCheckboxes:X,columns:Tg,rows:z,noDataProps:H,rowActionsPushRightPosition:T?`calc(${dr} - 24px)`:void 0,getRowActions:B}),N&&t(Dr,{providers:p,children:t(Cp,{onClose:()=>O(!1),withOverlay:!0,onCreateCloudConnector:u,onCreated:R})}),t(gr,{isOpen:$,onClose:()=>A(!1)}),t(Hn,{isOpen:!!I.length&&!T,richTitle:{icon:ja,title:"Selected Clusters",badge:{label:I.length}},actions:U}),T===Cg.BulkConfig&&t(_r,{connections:M,children:t(Tp,{onClose:()=>k(null),connections:L,selectedConnectionIds:I,setSelectedConnectionIds:E})}),t(ur,{target:"connection",isOpen:T===Cg.Delete,onClose:()=>{E([]),k(null)},onApprove:async()=>{const e=I[0];e&&(await s(e),await S())}})]})})},Og=b.div`
972
+ `,dg=["50","25","10","1","0.1"],pg=({value:n,onChange:o,label:a})=>{const l=v(),r=i(()=>dg.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(cg,{children:t(ve,{"data-id":"sampling-onboarding-ambient",options:r,selected:n,setSelected:o})})]})},ug=({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($m,{title:_i,onBack:s}),e(Im,{$width:854,children:[t(Bm,{children:Li}),e(ae,{$gap:8,$width:"100%",children:[e(Rm,{children:[t(sg,{children:t(ee,{size:te.XXS,color:p.v2.colors.silver[200],children:Fi})}),t(_m,{items:[Mi,zi,Xi,Bi,Ui]}),t(Fm,{message:Ei})]}),e(Mm,{children:[e(zm,{children:[t(ee,{size:te.S,weight:500,color:p.v2.colors.white[500],children:Vi}),t(Cl,{size:16,fill:p.v2.colors.silver[200]})]}),t(Xm,{children:t(xm,{name:Pi,recommended:!0,toggleLabel:Di,enabled:o,onEnabledChange:a,summary:u,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(Xm,{children:t(pg,{value:l,onChange:r,label:Hi})})]})]})]}),t(Em,{onNext:c,nextLoading:d})]})},hg=({isOpen:e,onClose:n,k8sHealthProbesConfig:o,samplingId:i,docsUrl:r})=>{const{samplingApi:s}=yr(),[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(Km,{onSkip:n,onNext:()=>p("noisy")});break;case"noisy":w=t(Vm,{enabled:u,onEnabledChange:h,onBack:()=>p("welcome"),onNext:()=>p("strategy")});break;case"strategy":w=t(ig,{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(ug,{errorPresetEnabled:f,onErrorPresetChange:b,ambientPercentage:v,onAmbientPercentageChange:y,onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"drop-list":w=t(rg,{errorPresetEnabled:f,onErrorPresetChange:b,onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"advanced":w=t(ag,{onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"success":w=t(jm,{onClose:n})}return t(xo,{isOpen:e,onClose:n,children:w})};var mg,gg;(e=>{e.BulkConfig="bulk-config",e.Delete="delete"})(mg||(mg={})),(e=>{e.K8s="k8s",e.VmAgent="vm-agent",e.CloudConnector="cloud-connector",e.AwsEcsAgent="aws-ecs-agent"})(gg||(gg={}));const fg=[{id:gg.CloudConnector,label:"Cloud Connector"}];var bg;(e=>{e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"})(bg||(bg={}));const vg=[{key:bg.Name,label:"Name"},{key:bg.Type,label:"Type"},{key:bg.Status,label:"Status"},{key:bg.OdigosVersion,label:"Odigos Version"},{key:bg.ConnectedSince,label:"Connected Since"},{key:bg.LastActivity,label:"Last Activity"}],yg=(e,t)=>{const n=e.find(e=>e.key===bg.Id)?.rawValue;return t(n?.toString()||"")},Cg={[_e.Success]:"Connected",[_e.Warning]:"Degraded",[_e.Error]:"Error",[_e.Disabled]:"Disabled",[_e.Info]:"Pending"},Sg={[ji.K8s]:gn.Purple,[ji.Vm]:gn.Blue,[ji.Connector]:gn.Green,[ji.AwsEcs]:gn.Yellow},xg=({connections:n,getConnections:o,onClickConnection:r,deleteConnection:s,onCreateNew:c,cloudConnectorProviders:p,onCreateCloudConnector:u,configMinSupportedVersion:h=0})=>{const m=v(),{formatTimeAgo:g}=ln(),[f,b]=l(!n?.length),[y,C]=l(n||[]),S=d(async()=>{try{b(!0),C(await o()??[])}catch(e){}finally{b(!1)}},[]);a(()=>{y.length||S()},[]);const[x,w]=l(""),[T,k]=l(null),[I,N]=l([]),[E,O]=l(!1),[$,A]=l(!1),R=d(()=>{O(!1),A(!0),S()},[S]),_=d(e=>{e===gg.CloudConnector?O(!0):c?.(e)},[c]),{supportedConnections:L,supportedConnectionIds:F}=i(()=>{const e=((e,t)=>e.filter(e=>{const n=e.status===_e.Success,o=D(e.odigosVersion,t,e.type);return n&&o}))(y,h);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[y,h]),M=i(()=>I.map(e=>y.find(t=>t.id===e)).filter(e=>!!e),[y,I]);a(()=>{if(!T||T===mg.Delete)return;const e=I.filter(e=>!F.includes(e));e.length&&N(t=>t.filter(t=>!e.includes(t)))},[T,I.length,F.length]);const z=i(()=>y.filter(e=>!x||e.name.toLowerCase().includes(x.toLowerCase())).map(e=>({cells:[{key:bg.Id,rawValue:e.id},{key:bg.Name,rawValue:e.name},{key:bg.Type,rawValue:e.type,component:()=>t(on,{variant:Sg[e.type]??gn.Default,label:Gi(e.type),leftIcon:Wn(e.type)})},{key:bg.Status,rawValue:e.status,component:()=>(e=>{if(e.type===ji.Connector){const n=Cg[e.status]??"Pending",o=e.status===_e.Success?nl:e.status===_e.Error?ol:void 0;return t(ce,{status:e.status,label:n,leftIcon:o})}const n=e.status===_e.Success?"Connection live":"Connection lost",o=e.status===_e.Success?nl:ol;return t(ce,{status:e.status,label:n,leftIcon:o})})(e)},{key:bg.OdigosVersion,rawValue:e.odigosVersion},{key:bg.ConnectedSince,rawValue:e.connectedAt?g(e.connectedAt):"-"},{key:bg.LastActivity,rawValue:e.lastSeenAt?g(e.lastSeenAt):"-"}],onClick:e.status!==_e.Success||T?void 0:()=>r(e),isSelected:I.includes(e.id),onSelect:()=>N(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>N(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.type!==ji.K8s||e.status!==_e.Success||!D(e.odigosVersion,h,e.type)})),[y,I,x,T,h,g,r]),X=i(()=>z.some(e=>!e.hideCheckbox),[z]),B=i(()=>{const e=(e,t)=>{N([e]),k(t)};return(e=>{const{connections:t,configMinSupportedVersion:n,onDelete:o,onEditConfiguration:i}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===bg.Status)?.rawValue===_e.Success)(e))return[{id:So(),label:"Delete Connection",rightIcon:Ka,onClick:()=>yg(e,o)}];const a=yg(e,e=>t.find(t=>t.id===e));if(a?.type!==ji.K8s)return[];const l=!!a&&D(a.odigosVersion,n,a.type),r=P(n,a?.type),s=[];return i&&s.push({id:So(),tooltip:l?"Edit Configuration":`To use this feature, please upgrade to Odigos v${r} or later.`,rightIcon:fl,disabled:!l,onClick:()=>yg(e,i)}),s}})({connections:y,configMinSupportedVersion:h,onDelete:t=>e(t,mg.Delete),onEditConfiguration:t=>e(t,mg.BulkConfig)})},[y,h]),U=i(()=>(e=>{const{onCancel:t,onManageConfigurations:n}=e,o=[];return n&&o.push({id:mg.BulkConfig,type:bn.Button,buttonProps:{variant:Ie.Secondary,size:ke.S,leftIcon:fl,label:"Manage Configurations",onClick:n}}),o.push({id:So(),type:bn.Button,buttonProps:{variant:Ie.Text,size:ke.S,label:Mt.CANCEL,onClick:t}}),o})({onCancel:()=>N([]),onManageConfigurations:()=>k(mg.BulkConfig)}),[]),V=i(()=>t(vo,{items:fg,withMultiSelect:!1,selectedIds:[],setSelectedIds:e=>_(e[0]),buttonProps:{variant:Ie.Primary,size:ke.S,label:Mt.CREATE_NEW}}),[_]),H=i(()=>x.trim()&&y.length>0?{hideIcon:!0,title:ot.NO_RESULTS,subTitle:ot.NO_RESULTS_FOR_FILTER(x)}:{icon:zl,title:ot.NO_CONNECTIONS,action:V},[x,y.length,V]);return t(Wi,{children:e(ht,{fullHeight:!0,richTitle:{icon:zl,title:ot.CONNECTIONS,badge:{label:y.length.toString(),status:_e.Unknown}},search:{placeholder:"Search by cluster name",value:x,onChange:e=>w(e),width:"300px"},actions:[{id:"connections-refresh",type:bn.Button,buttonProps:{variant:Ie.Secondary,size:ke.S,leftIcon:gl,onClick:S,disabled:f}},{id:"connections-create-new",type:bn.ButtonDropData,buttonProps:{variant:Ie.Primary,size:ke.S,label:Mt.CREATE_NEW,onClick:e=>_(e)},dropDataProps:{alignX:Co.Right,items:fg}}],children:[t(Un,{variant:Vn.Pretty,headerBackgroundColor:m.v2.colors.silver[1e3],isLoading:f,withCheckboxes:X,columns:vg,rows:z,noDataProps:H,rowActionsPushRightPosition:T?`calc(${dr} - 24px)`:void 0,getRowActions:B}),E&&t(Dr,{providers:p,children:t(mp,{onClose:()=>O(!1),withOverlay:!0,onCreateCloudConnector:u,onCreated:R})}),t(gr,{isOpen:$,onClose:()=>A(!1)}),t(Hn,{isOpen:!!I.length&&!T,richTitle:{icon:ja,title:"Selected Clusters",badge:{label:I.length}},actions:U}),T===mg.BulkConfig&&t(Pr,{connections:M,children:t(vp,{onClose:()=>k(null),connections:L,selectedConnectionIds:I,setSelectedConnectionIds:N})}),t(ur,{target:"connection",isOpen:T===mg.Delete,onClose:()=>{N([]),k(null)},onApprove:async()=>{const e=I[0];e&&(await s(e),await S())}})]})})},wg=b.div`
991
973
  display: flex;
992
974
  align-items: center;
993
975
  justify-content: space-between;
@@ -996,26 +978,26 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
996
978
  width: 100%;
997
979
  border-radius: 16px;
998
980
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
999
- `,$g=b.div`
981
+ `,Tg=b.div`
1000
982
  display: flex;
1001
983
  align-items: center;
1002
984
  justify-content: center;
1003
985
  padding: 8px;
1004
986
  border-radius: 8px;
1005
987
  background-color: ${({theme:e})=>e.v2.colors.white[500]+ie["004"]};
1006
- `,Ag=({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(Og,{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=Tt(n.option.type).icon;return e(Og,{children:[e(oe,{$gap:8,children:[i&&t($g,{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?nl:ol})]},`destination-${o}`)})||[],[l]);return t(cr,{isOpen:!0,disableAnimation:r,onBack:()=>n(3),onSave:o,header:{icon:ul,title:ot.SUMMARY,subTitle:ot.REVIEW_SETUP},leftColumn:{width:"50%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(al,{size:24}),t(ee,{nowrap:!0,children:ot.SELECTED_SOURCES}),t(ce,{label:p.length})]}),t(Te,{"data-id":"summary-edit-sources",leftIcon:Ya,variant:Ie.Secondary,size:ke.S,onClick:c})]}),list:p.length?p:[t(bt,{$height:"100%",children:t($e,{icon:al,title:ot.NO_SOURCES_SELECTED,subTitle:ot.ADD_SOURCE_PROMPT,button:{leftIcon:Va,label:ot.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(Qa,{size:24}),t(ee,{nowrap:!0,children:ot.SELECTED_DESTINATIONS}),t(ce,{label:u.length})]}),t(Te,{"data-id":"summary-edit-destinations",leftIcon:Ya,variant:Ie.Secondary,size:ke.S,onClick:d})]}),list:u.length?u:[t(bt,{"data-id":"summary-no-destinations",$height:"100%",children:t($e,{icon:Qa,title:ot.NO_DESTINATIONS_SELECTED,subTitle:ot.ADD_DESTINATION_PROMPT,button:{leftIcon:Va,label:ot.ADD_DESTINATIONS,onClick:d}})},"no-destinations-data")]}})},Rg=b.div`
988
+ `,kg=({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||Et.Namespace,l=a===Et.Namespace?n.namespace:`${n.namespace} → ${n.name}`;return e(wg,{children:[t(ee,{nowrap:!0,children:l}),t(ce,{label:a,status:_e.Info,backgroundColor:s.v2.colors.blue[900]})]},`source-${o}-${i}`)})).filter(Boolean),[a]),u=i(()=>l?.map((n,o)=>{const i=Tt(n.option.type).icon;return e(wg,{children:[e(oe,{$gap:8,children:[i&&t(Tg,{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?_e.Success:_e.Error,leftIcon:n.testResult.succeeded?nl:ol})]},`destination-${o}`)})||[],[l]);return t(cr,{isOpen:!0,disableAnimation:r,onBack:()=>n(3),onSave:o,header:{icon:ul,title:ot.SUMMARY,subTitle:ot.REVIEW_SETUP},leftColumn:{width:"50%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(al,{size:24}),t(ee,{nowrap:!0,children:ot.SELECTED_SOURCES}),t(ce,{label:p.length})]}),t(Te,{"data-id":"summary-edit-sources",leftIcon:Ya,variant:Ie.Secondary,size:ke.S,onClick:c})]}),list:p.length?p:[t(bt,{$height:"100%",children:t($e,{icon:al,title:ot.NO_SOURCES_SELECTED,subTitle:ot.ADD_SOURCE_PROMPT,button:{leftIcon:Va,label:ot.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(Qa,{size:24}),t(ee,{nowrap:!0,children:ot.SELECTED_DESTINATIONS}),t(ce,{label:u.length})]}),t(Te,{"data-id":"summary-edit-destinations",leftIcon:Ya,variant:Ie.Secondary,size:ke.S,onClick:d})]}),list:u.length?u:[t(bt,{"data-id":"summary-no-destinations",$height:"100%",children:t($e,{icon:Qa,title:ot.NO_DESTINATIONS_SELECTED,subTitle:ot.ADD_DESTINATION_PROMPT,button:{leftIcon:Va,label:ot.ADD_DESTINATIONS,onClick:d}})},"no-destinations-data")]}})},Ig=b.div`
1007
989
  position: relative;
1008
990
  overflow: hidden;
1009
991
  width: 100vw;
1010
992
  height: 100vh;
1011
993
  box-sizing: border-box;
1012
- `,Dg=b.svg`
994
+ `,Ng=b.svg`
1013
995
  position: absolute;
1014
996
  top: 50%;
1015
997
  left: 50%;
1016
998
  transform: translate(-50%, -50%);
1017
999
  z-index: -1;
1018
- `,_g=[{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"}],Pg=[{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:_g},{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:_g},{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:_g}],Lg=({paddingXAxis:n="0px",paddingYAxis:o="0px",children:r})=>{const[s,c]=l(window.innerWidth),d=i(()=>s/Pg[0].width,[s]);return a(()=>{const e=()=>c(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e(Rg,{$paddingXAxis:n,$paddingYAxis:o,children:[Pg.map(({width:n,height:o,pathOpacity:i,path:a,gradientTransform:l,stops:r},s)=>{const c=`purple-ring-${s}`;return e(Dg,{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]})},Fg=b.div`
1000
+ `,Eg=[{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"}],Og=[{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:Eg},{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:Eg},{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:Eg}],$g=({paddingXAxis:n="0px",paddingYAxis:o="0px",children:r})=>{const[s,c]=l(window.innerWidth),d=i(()=>s/Og[0].width,[s]);return a(()=>{const e=()=>c(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e(Ig,{$paddingXAxis:n,$paddingYAxis:o,children:[Og.map(({width:n,height:o,pathOpacity:i,path:a,gradientTransform:l,stops:r},s)=>{const c=`purple-ring-${s}`;return e(Ng,{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]})},Ag=b.div`
1019
1001
  display: flex;
1020
1002
  flex-direction: column;
1021
1003
  align-items: center;
@@ -1026,7 +1008,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
1026
1008
  width: 50vw;
1027
1009
  border-radius: 16px;
1028
1010
  background: ${({theme:e})=>e.v2.colors.silver[900]};
1029
- `,Mg=b.div`
1011
+ `,Rg=b.div`
1030
1012
  display: flex;
1031
1013
  flex-direction: column;
1032
1014
  align-items: center;
@@ -1036,15 +1018,15 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
1036
1018
  & * {
1037
1019
  text-align: center;
1038
1020
  }
1039
- `,zg=({onStart:n})=>t(Xt,{width:"75vw",isOpen:!0,hideOverlay:!0,disableAnimation:!0,children:t(bt,{$height:"100%",children:e(Fg,{children:[e(Mg,{children:[t(ee,{size:te.L,weight:500,children:ot.GET_STARTED_WITH}),t(mr,{size:260}),t(ee,{size:te.S,weight:400,children:ot.GET_STARTED_DESCRIPTION})]}),t(Te,{"data-id":"onboarding-get-started",label:Mt.GET_STARTED,rightIcon:Ha,size:ke.L,onClick:n})]})})}),Xg=[{step:1,label:ot.INSTALLATION,forceDoneBadge:!0},{step:2,label:ot.SOURCES_SETUP},{step:3,label:ot.DESTINATIONS_SETUP},{step:4,label:ot.SUMMARY}],Bg=b.div`
1021
+ `,Dg=({onStart:n})=>t(Xt,{width:"75vw",isOpen:!0,hideOverlay:!0,disableAnimation:!0,children:t(bt,{$height:"100%",children:e(Ag,{children:[e(Rg,{children:[t(ee,{size:te.L,weight:500,children:ot.GET_STARTED_WITH}),t(mr,{size:260}),t(ee,{size:te.S,weight:400,children:ot.GET_STARTED_DESCRIPTION})]}),t(Te,{"data-id":"onboarding-get-started",label:Mt.GET_STARTED,rightIcon:Ha,size:ke.L,onClick:n})]})})}),Pg=[{step:1,label:ot.INSTALLATION,forceDoneBadge:!0},{step:2,label:ot.SOURCES_SETUP},{step:3,label:ot.DESTINATIONS_SETUP},{step:4,label:ot.SUMMARY}],_g=b.div`
1040
1022
  display: flex;
1041
1023
  flex-direction: column;
1042
1024
  gap: 32px;
1043
1025
  padding: 64px;
1044
- `,Ug=({pagePaddingXAxis:n,pagePaddingYAxis:o,onDone:i})=>{const{setDrawerType:a}=Cn(),{sourcesApi:r,destinationsApi:s}=yr(),[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(Lg,{paddingXAxis:n,paddingYAxis:o,children:[e(Bg,{children:[t(mr,{useInline:!0}),t(Ki,{currentStep:c,data:Xg,gap:32})]}),t(Pr,{initialInputs:h,children:e(Lr,{children:[1===c&&t(zg,{onStart:b}),2===c&&t(Nc,{disableAnimation:!0,onBack:e=>{m(e),v()},onNext:e=>{m(e),b()}}),3===c&&t(pc,{disableAnimation:!0,onBack:e=>{f(e),v()},onNext:e=>{f(e),b()},initialInputs:g}),4===c&&t(Ag,{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(wo.OnboardingDone),i()}catch(e){return u(!1),{error:e instanceof Error?e.message:String(e)}}}},sourcesPayload:h,destinationsPayload:g})]})})]})},Vg=e=>(e||[]).filter(e=>!!e.id).map(e=>String(e.id)),Hg=e=>e.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/\b\w/g,e=>e.toUpperCase()),jg=e=>{let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)&&(t+=e.length)}),e.onlyErrors&&t++,t},Gg=b.div`
1026
+ `,Lg=({pagePaddingXAxis:n,pagePaddingYAxis:o,onDone:i})=>{const{setDrawerType:a}=Cn(),{sourcesApi:r,destinationsApi:s}=yr(),[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($g,{paddingXAxis:n,paddingYAxis:o,children:[e(_g,{children:[t(mr,{useInline:!0}),t(Ki,{currentStep:c,data:Pg,gap:32})]}),t(_r,{initialInputs:h,children:e(Lr,{children:[1===c&&t(Dg,{onStart:b}),2===c&&t(Ec,{disableAnimation:!0,onBack:e=>{m(e),v()},onNext:e=>{m(e),b()}}),3===c&&t(pc,{disableAnimation:!0,onBack:e=>{f(e),v()},onNext:e=>{f(e),b()},initialInputs:g}),4===c&&t(kg,{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(wo.OnboardingDone),i()}catch(e){return u(!1),{error:e instanceof Error?e.message:String(e)}}}},sourcesPayload:h,destinationsPayload:g})]})})]})},Fg=e=>(e||[]).filter(e=>!!e.id).map(e=>String(e.id)),Mg=e=>e.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/\b\w/g,e=>e.toUpperCase()),zg=e=>{let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)&&(t+=e.length)}),e.onlyErrors&&t++,t},Xg=b.div`
1045
1027
  position: relative;
1046
1028
  display: inline-flex;
1047
- `,Wg=b.button`
1029
+ `,Bg=b.button`
1048
1030
  display: inline-flex;
1049
1031
  align-items: center;
1050
1032
  gap: 8px;
@@ -1057,7 +1039,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
1057
1039
  &:hover {
1058
1040
  background-color: ${({theme:e})=>e.v2.colors.silver[700]};
1059
1041
  }
1060
- `,Kg=b.div`
1042
+ `,Ug=b.div`
1061
1043
  position: absolute;
1062
1044
  top: calc(100% + 8px);
1063
1045
  right: 0;
@@ -1070,25 +1052,25 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
1070
1052
  border-radius: 12px;
1071
1053
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
1072
1054
  box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
1073
- `,Yg=b.div`
1055
+ `,Vg=b.div`
1074
1056
  display: flex;
1075
1057
  flex-direction: column;
1076
1058
  gap: 12px;
1077
1059
  padding: 16px;
1078
1060
  max-height: 60vh;
1079
1061
  overflow-y: auto;
1080
- `,Jg=b.div`
1062
+ `,Hg=b.div`
1081
1063
  display: flex;
1082
1064
  align-items: center;
1083
1065
  gap: 8px;
1084
1066
  padding: 12px 16px;
1085
1067
  border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
1086
- `,qg=b.div`
1068
+ `,jg=b.div`
1087
1069
  display: flex;
1088
1070
  align-items: center;
1089
1071
  gap: 8px;
1090
1072
  margin-left: auto;
1091
- `,Zg=()=>{const n=v(),{platformType:o,isK8s:r,isConnector:s}=S(),{sourcesApi:c,namespacesApi:d}=yr(),u=c.useSources().items,h=d.useNamespaces().items,{selectedStreamName:m}=it(),{getItemSS:g,setItemSS:f,removeItemSS:b}=ea(),{statuses:y,namespaces:C,regions:x,kinds:w,monitors:T,languages:k,onlyErrors:I,podsAgentInjectionStatus:E,enabledStatuses:N,setAll:O,clearFilters:$,getEmptyState:A}=Yi(),R=i(()=>Ji(u,m),[u,m]);a(()=>{const e=g(qi.OVERVIEW_FILTERS,A());O(e)},[]);const[D,_]=l({statuses:y,namespaces:C,regions:x,kinds:w,monitors:T,languages:k,onlyErrors:I,podsAgentInjectionStatus:E,enabledStatuses:N}),[P,L]=l(jg(D)),[F,M]=l(!1),z=p(o);a(()=>{if(!F){const e={statuses:y,namespaces:C,regions:x,kinds:w,monitors:T,languages:k,onlyErrors:I,podsAgentInjectionStatus:E,enabledStatuses:N};_(e),L(jg(e))}},[F,y,C,x,w,T,k,I,E,N]),a(()=>{z.current!==o&&(z.current=o,b(qi.OVERVIEW_FILTERS),$(),_(A()),L(0),M(!1))},[o]);const X=p(null);$n(X,()=>M(!1)),fo({key:"Escape",active:F},()=>M(!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]),U=i(()=>{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:En(o),withCheckbox:!0}))}),t},[R]),V=i(()=>{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=i(()=>{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:Zi[n]||n,withCheckbox:!0}))})}),t.sort((e,t)=>e.id.localeCompare(t.id))},[R]),j=i(()=>Qi.map(({id:e,value:t})=>({id:e,label:t,withCheckbox:!0})),[]),G=i(()=>{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:Hg(o),withCheckbox:!0}))}),t.sort((e,t)=>e.label.localeCompare(t.label))},[R]),W=i(()=>{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:Ut(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=i(()=>[{id:"enabled",label:ot.ENABLED,withCheckbox:!0},{id:"disabled",label:ot.DISABLED,withCheckbox:!0}],[]),Y=(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})},J=F?el:tl,q=i(()=>Vg(D.languages),[D.languages]);return e(Gg,{ref:X,children:[e(Wg,{"data-id":"filters-trigger",$isOpen:F,type:"button",onClick:()=>M(e=>!e),children:[t(Xl,{size:16,fill:n.v2.colors.white[500]}),t(ee,{size:te.XS,weight:500,nowrap:!0,children:"Filters"}),P>0&&t(ce,{label:P,status:Pe.Unknown,textSize:te.XXXS}),t(J,{size:16,fill:n.v2.colors.silver[200]})]}),F&&e(Kg,{children:[e(Yg,{children:[r&&t(yt,{label:"Namespace",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!B.length,options:B,values:Vg(D.namespaces),setValues:e=>Y("namespaces",B,e)}),s&&t(yt,{label:"Region",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!V.length,options:V,values:Vg(D.regions),setValues:e=>Y("regions",V,e)}),t(yt,{label:"Kind",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!U.length,options:U,values:Vg(D.kinds),setValues:e=>Y("kinds",U,e)}),t(yt,{label:"Programming Language",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!H.length,options:H,values:q,setValues:e=>Y("languages",H,e)}),t(yt,{label:"Monitors",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!j.length,options:j,values:Vg(D.monitors),setValues:e=>Y("monitors",j,e)}),t(yt,r?{label:"Agent Injection Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!W.length,options:W,values:Vg(D.podsAgentInjectionStatus),setValues:e=>Y("podsAgentInjectionStatus",W,e)}:{label:"Instrumentation Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!G.length,options:G,values:Vg(D.statuses),setValues:e=>Y("statuses",G,e)}),t(yt,{label:"Enabled Status",placeholder:"All",withMultiSelect:!0,options:K,values:Vg(D.enabledStatuses),setValues:e=>Y("enabledStatuses",K,e)}),t(ge,{label:"Show only sources with errors",size:Ot.L,value:!!D.onlyErrors,onChange:e=>_(t=>({...t,onlyErrors:e}))})]}),e(Jg,{children:[t(Te,{"data-id":"filters-reset",size:ke.S,variant:Ie.Text,label:"Reset",onClick:()=>{b(qi.OVERVIEW_FILTERS),$(),_(A()),L(0),M(!1)},textColor:n.v2.colors.red[500]}),e(qg,{children:[t(Te,{"data-id":"filters-cancel",size:ke.S,variant:Ie.Secondary,label:"Cancel",onClick:()=>M(!1)}),t(Te,{"data-id":"filters-apply",size:ke.S,variant:Ie.Primary,label:"Apply",onClick:()=>{f(qi.OVERVIEW_FILTERS,D),O(D),L(jg(D)),M(!1)}})]})]})]})]})},Qg=b.div`
1073
+ `,Gg=()=>{const n=v(),{platformType:o,isK8s:r,isConnector:s}=S(),{sourcesApi:c,namespacesApi:d}=yr(),u=c.useSources().items,h=d.useNamespaces().items,{selectedStreamName:m}=it(),{getItemSS:g,setItemSS:f,removeItemSS:b}=ea(),{statuses:y,namespaces:C,regions:x,kinds:w,monitors:T,languages:k,onlyErrors:I,podsAgentInjectionStatus:N,enabledStatuses:E,setAll:O,clearFilters:$,getEmptyState:A}=Yi(),R=i(()=>Ji(u,m),[u,m]);a(()=>{const e=g(qi.OVERVIEW_FILTERS,A());O(e)},[]);const[D,P]=l({statuses:y,namespaces:C,regions:x,kinds:w,monitors:T,languages:k,onlyErrors:I,podsAgentInjectionStatus:N,enabledStatuses:E}),[_,L]=l(zg(D)),[F,M]=l(!1),z=p(o);a(()=>{if(!F){const e={statuses:y,namespaces:C,regions:x,kinds:w,monitors:T,languages:k,onlyErrors:I,podsAgentInjectionStatus:N,enabledStatuses:E};P(e),L(zg(e))}},[F,y,C,x,w,T,k,I,N,E]),a(()=>{z.current!==o&&(z.current=o,b(qi.OVERVIEW_FILTERS),$(),P(A()),L(0),M(!1))},[o]);const X=p(null);$n(X,()=>M(!1)),fo({key:"Escape",active:F},()=>M(!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]),U=i(()=>{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:Nn(o),withCheckbox:!0}))}),t},[R]),V=i(()=>{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=i(()=>{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:Zi[n]||n,withCheckbox:!0}))})}),t.sort((e,t)=>e.id.localeCompare(t.id))},[R]),j=i(()=>Qi.map(({id:e,value:t})=>({id:e,label:t,withCheckbox:!0})),[]),G=i(()=>{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:Mg(o),withCheckbox:!0}))}),t.sort((e,t)=>e.label.localeCompare(t.label))},[R]),W=i(()=>{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:Ut(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=i(()=>[{id:"enabled",label:ot.ENABLED,withCheckbox:!0},{id:"disabled",label:ot.DISABLED,withCheckbox:!0}],[]),Y=(e,t,n)=>{const o=t.filter(e=>n.includes(e.id));P(t=>{return{...t,[e]:(n=o,n.map(({id:e,label:t})=>({id:e,label:t})))};var n})},J=F?el:tl,q=i(()=>Fg(D.languages),[D.languages]);return e(Xg,{ref:X,children:[e(Bg,{"data-id":"filters-trigger",$isOpen:F,type:"button",onClick:()=>M(e=>!e),children:[t(Xl,{size:16,fill:n.v2.colors.white[500]}),t(ee,{size:te.XS,weight:500,nowrap:!0,children:"Filters"}),_>0&&t(ce,{label:_,status:_e.Unknown,textSize:te.XXXS}),t(J,{size:16,fill:n.v2.colors.silver[200]})]}),F&&e(Ug,{children:[e(Vg,{children:[r&&t(yt,{label:"Namespace",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!B.length,options:B,values:Fg(D.namespaces),setValues:e=>Y("namespaces",B,e)}),s&&t(yt,{label:"Region",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!V.length,options:V,values:Fg(D.regions),setValues:e=>Y("regions",V,e)}),t(yt,{label:"Kind",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!U.length,options:U,values:Fg(D.kinds),setValues:e=>Y("kinds",U,e)}),t(yt,{label:"Programming Language",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!H.length,options:H,values:q,setValues:e=>Y("languages",H,e)}),t(yt,{label:"Monitors",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!j.length,options:j,values:Fg(D.monitors),setValues:e=>Y("monitors",j,e)}),t(yt,r?{label:"Agent Injection Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!W.length,options:W,values:Fg(D.podsAgentInjectionStatus),setValues:e=>Y("podsAgentInjectionStatus",W,e)}:{label:"Instrumentation Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!G.length,options:G,values:Fg(D.statuses),setValues:e=>Y("statuses",G,e)}),t(yt,{label:"Enabled Status",placeholder:"All",withMultiSelect:!0,options:K,values:Fg(D.enabledStatuses),setValues:e=>Y("enabledStatuses",K,e)}),t(ge,{label:"Show only sources with errors",size:Ot.L,value:!!D.onlyErrors,onChange:e=>P(t=>({...t,onlyErrors:e}))})]}),e(Hg,{children:[t(Te,{"data-id":"filters-reset",size:ke.S,variant:Ie.Text,label:"Reset",onClick:()=>{b(qi.OVERVIEW_FILTERS),$(),P(A()),L(0),M(!1)},textColor:n.v2.colors.red[500]}),e(jg,{children:[t(Te,{"data-id":"filters-cancel",size:ke.S,variant:Ie.Secondary,label:"Cancel",onClick:()=>M(!1)}),t(Te,{"data-id":"filters-apply",size:ke.S,variant:Ie.Primary,label:"Apply",onClick:()=>{f(qi.OVERVIEW_FILTERS,D),O(D),L(zg(D)),M(!1)}})]})]})]})]})},Wg=b.div`
1092
1074
  position: relative;
1093
1075
  display: flex;
1094
1076
  align-items: center;
@@ -1099,7 +1081,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
1099
1081
  box-sizing: border-box;
1100
1082
  border-radius: 16px 16px 0 0;
1101
1083
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
1102
- `,ef=b.div`
1084
+ `,Kg=b.div`
1103
1085
  position: absolute;
1104
1086
  bottom: 0;
1105
1087
  left: 0;
@@ -1108,7 +1090,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
1108
1090
  background-color: ${({theme:e})=>e.v2.colors.purple[500]};
1109
1091
  border-radius: 32px;
1110
1092
  transition: width 0.3s;
1111
- `,tf=({entityType:n,badge:o,badgeTooltip:i,isLoading:a,refetch:l,partiallySelected:r,allSelected:s,onSelectAll:c,progressPercent:d})=>{const{setDrawerType:p}=Cn();return e(Qg,{children:[e(oe,{$gap:8,style:{flex:1,minWidth:0},children:[c&&t(Q,{size:ta.S,partiallyChecked:r,value:!!s,onChange:c}),t(ee,{size:te.S,nowrap:!0,children:`${Ut(n)}s`}),t(ce,{label:o,tooltip:i,status:Pe.Unknown,textSize:te.XXXS})]}),e(oe,{children:[t(Ct,{"data-id":`add-${n}`,icon:Va,onClick:()=>p(na(n))}),t(Ct,{"data-id":`refresh-${n}`,icon:gl,onClick:l,disabled:a})]}),"number"==typeof d&&t(ef,{$percent:d})]})},nf=b(ae)`
1093
+ `,Yg=({entityType:n,badge:o,badgeTooltip:i,isLoading:a,refetch:l,partiallySelected:r,allSelected:s,onSelectAll:c,progressPercent:d})=>{const{setDrawerType:p}=Cn();return e(Wg,{children:[e(oe,{$gap:8,style:{flex:1,minWidth:0},children:[c&&t(Q,{size:ta.S,partiallyChecked:r,value:!!s,onChange:c}),t(ee,{size:te.S,nowrap:!0,children:`${Ut(n)}s`}),t(ce,{label:o,tooltip:i,status:_e.Unknown,textSize:te.XXXS})]}),e(oe,{children:[t(Ct,{"data-id":`add-${n}`,icon:Va,onClick:()=>p(na(n))}),t(Ct,{"data-id":`refresh-${n}`,icon:gl,onClick:l,disabled:a})]}),"number"==typeof d&&t(Kg,{$percent:d})]})},Jg=b(ae)`
1112
1094
  align-items: center !important;
1113
1095
  justify-content: center !important;
1114
1096
  align-self: stretch;
@@ -1123,7 +1105,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
1123
1105
  &:hover {
1124
1106
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
1125
1107
  }
1126
- `,of=({entityType:n,description:o})=>{const{setDrawerType:i}=Cn();return e(nf,{onClick:()=>i(na(n)),children:[e(oe,{$gap:4,children:[t(Va,{size:16}),t(ee,{size:te.S,children:`Add ${Ut(n)}`})]}),t(ee,{size:te.XXS,align:"center",children:o})]})},af=b.div`
1108
+ `,qg=({entityType:n,description:o})=>{const{setDrawerType:i}=Cn();return e(Jg,{onClick:()=>i(na(n)),children:[e(oe,{$gap:4,children:[t(Va,{size:16}),t(ee,{size:te.S,children:`Add ${Ut(n)}`})]}),t(ee,{size:te.XXS,align:"center",children:o})]})},Zg=b.div`
1127
1109
  display: flex;
1128
1110
  align-items: center;
1129
1111
  gap: 12px;
@@ -1138,10 +1120,10 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
1138
1120
  &:hover {
1139
1121
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
1140
1122
  }
1141
- `,lf=b(oe)`
1123
+ `,Qg=b(oe)`
1142
1124
  flex: 1;
1143
1125
  min-width: 0;
1144
- `,rf=({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}=Cn(),{selectedSources:x,setSelectedSources:w}=oa(),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]),E=b&&!h?Fn(Pe.Info,g):l?Fn(l,g):void 0,N=f&&"object"==typeof n?`${n.namespace}-${n.name}-${n.kind}${n.region?`-${n.region}`:""}`:n;return e(af,{"data-id":N,$faded:y,onClick:()=>{C(kn(o)),S(n)},children:[f&&t(Q,{size:ta.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(Tn,{icons:p,icon:d,iconSrc:u}),e(lf,{$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||b&&!h)&&t(Ue,{text:s||(b&&!h?ot.DISABLED:"Heads up! The data-flow metrics you see are calculated over 10-second intervals."),children:t(ce,{label:c||ot.DISABLED,status:l&&[Pe.Error,Pe.Warning].includes(l)?l:Pe.Unknown,leftIcon:E,textSize:te.XXXS})})})]})]})};function sf(e){return Object.values(e.conditions??{}).filter(Boolean).some(({status:e})=>e===Pe.Loading)?e:{...e,workloadOdigosHealthStatus:{status:dn.Pending,name:"WorkloadOdigosHealthStatus",reasonEnum:"Pending",message:""}}}function cf(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 df=b.div`
1126
+ `,ef=({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===Et.Source,b="boolean"==typeof h,y=r||b&&!h,{setDrawerType:C,setDrawerEntityId:S}=Cn(),{selectedSources:x,setSelectedSources:w}=oa(),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?Fn(_e.Info,g):l?Fn(l,g):void 0,E=f&&"object"==typeof n?`${n.namespace}-${n.name}-${n.kind}${n.region?`-${n.region}`:""}`:n;return e(Zg,{"data-id":E,$faded:y,onClick:()=>{C(kn(o)),S(n)},children:[f&&t(Q,{size:ta.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(Tn,{icons:p,icon:d,iconSrc:u}),e(Qg,{$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||b&&!h)&&t(Ue,{text:s||(b&&!h?ot.DISABLED:"Heads up! The data-flow metrics you see are calculated over 10-second intervals."),children:t(ce,{label:c||ot.DISABLED,status:l&&[_e.Error,_e.Warning].includes(l)?l:_e.Unknown,leftIcon:N,textSize:te.XXXS})})})]})]})};function tf(e){return Object.values(e.conditions??{}).filter(Boolean).some(({status:e})=>e===_e.Loading)?e:{...e,workloadOdigosHealthStatus:{status:dn.Pending,name:"WorkloadOdigosHealthStatus",reasonEnum:"Pending",message:""}}}function nf(e){const t=Object.values(e.conditions??{}).filter(Boolean),n=t.filter(({status:e})=>e!==_e.Loading);return n?.length===t?.length?e:{...e,conditions:n?.length?n.reduce((e,t)=>(e[t.name]=t,e),{}):{}}}const of=b.div`
1145
1127
  position: absolute;
1146
1128
  top: 0;
1147
1129
  left: 0;
@@ -1152,21 +1134,21 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
1152
1134
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
1153
1135
  border-bottom: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
1154
1136
  pointer-events: none;
1155
- `,pf=b.div`
1137
+ `,af=b.div`
1156
1138
  display: flex;
1157
1139
  align-items: center;
1158
1140
  gap: 8px;
1159
1141
  padding: 4px 8px 0;
1160
- `,uf=b.div`
1142
+ `,lf=b.div`
1161
1143
  flex: 1;
1162
1144
  height: 1px;
1163
1145
  background: ${({theme:e})=>e.v2.colors.silver[700]};
1164
- `,hf=({namespace:e})=>{const n=v();return t(df,{children:t(ee,{size:te.XXS,nowrap:!0,color:n.v2.colors.grey[300],children:e})})},mf=({namespace:n})=>{const o=v();return e(pf,{children:[t(uf,{}),t(ee,{size:te.XXS,nowrap:!0,color:o.v2.colors.grey[300],children:n}),t(uf,{})]})},gf={[Nt.InstrumentationRule]:ot.NO_DATA_INSTRUMENTATION_RULES,[Nt.Source]:ot.NO_DATA_SOURCES,[Nt.Action]:ot.NO_DATA_ACTIONS,[Nt.Destination]:ot.NO_DATA_DESTINATIONS},ff=b.div`
1146
+ `,rf=({namespace:e})=>{const n=v();return t(of,{children:t(ee,{size:te.XXS,nowrap:!0,color:n.v2.colors.grey[300],children:e})})},sf=({namespace:n})=>{const o=v();return e(af,{children:[t(lf,{}),t(ee,{size:te.XXS,nowrap:!0,color:o.v2.colors.grey[300],children:n}),t(lf,{})]})},cf={[Et.InstrumentationRule]:ot.NO_DATA_INSTRUMENTATION_RULES,[Et.Source]:ot.NO_DATA_SOURCES,[Et.Action]:ot.NO_DATA_ACTIONS,[Et.Destination]:ot.NO_DATA_DESTINATIONS},df=b.div`
1165
1147
  display: flex;
1166
1148
  flex-direction: column;
1167
1149
  flex: 1 0 0;
1168
1150
  min-width: 0;
1169
- `,bf=b.div`
1151
+ `,pf=b.div`
1170
1152
  display: flex;
1171
1153
  flex-direction: column;
1172
1154
  align-items: stretch;
@@ -1176,7 +1158,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
1176
1158
  border-radius: 0 0 16px 16px;
1177
1159
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
1178
1160
  overflow: hidden;
1179
- `,vf=b.div`
1161
+ `,uf=b.div`
1180
1162
  position: relative;
1181
1163
  display: flex;
1182
1164
  flex-direction: column;
@@ -1188,7 +1170,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
1188
1170
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
1189
1171
  height: ${({$height:e})=>e}px;
1190
1172
  overflow: hidden;
1191
- `,yf=({entityType:n,entities:o,unfilteredCount:r,metrics:s,loading:c,maxHeight:p,refetch:u})=>{const h=n===Nt.Source,m=o.length!==r,g=At(e=>h?e.progress[_t.Instrumenting]?.percentage:void 0),f=At(e=>h?e.progress[_t.Uninstrumenting]?.percentage:void 0),b=!h||void 0===g&&void 0===f?void 0:g||f||0,{selectedSources:v,setSelectedSources:y}=oa(),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(ia(n),n.throughput);return e},[s,n]),x=i(()=>o.map(e=>((e,t,n)=>{const o=Gt(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,n=!1===e.markedForInstrumentation?.markedForInstrumentation;switch(t){case dn.Failure:return{status:Pe.Error,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case dn.Notice:return{status:Pe.Warning,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case dn.Pending:case dn.Waiting:return{status:void 0,faded:!1,displaySource:sf(e)};case dn.Unsupported:case dn.Disabled:return{status:void 0,faded:!0,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};default:return n?{status:void 0,faded:!0,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e}:{status:void 0,faded:!1,displaySource:cf(e)}}})(e);a=t.status,r=t.faded,l=t.tooltip,s=t.displaySource}else{const n=t===Nt.Action?aa(e):e.conditions,{priorotizedStatus:o,hasDisableds:i}=la(n);a=o,r=i}const c=ra(e,t,{extended:i,prioritizeDisplayName:!i});let d,p,u,h,m;switch(t){case Nt.Source:{d=wn(e),p=ca(Nt.Source);const t=n?.get(sa(o));h=Nn(t);const i=e.markedForInstrumentation?.markedForInstrumentation;"boolean"==typeof i&&(m=i);break}case Nt.Destination:{const t=Tt(e.destinationType.type);p=t.icon,u=t.iconSrc;const i=n?.get(sa(o));h=Nn(i),m=!e.disabled;break}case Nt.Action:p=Jt(e.type),m=!e.disabled;break;case Nt.InstrumentationRule:p=an(e.type),m=!e.disabled}return{key:sa(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:E,dividerCount:N}=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(mf,{namespace:o.namespace},`ns-divider-${o.namespace}`)),i+=1),a=o.namespace),n.push(o.namespace||""),e.push(t(rf,{...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+(E?28:0)+32*N,A=Math.max(0,p-52-16),R=Math.min(A,$)+8,D="number"==typeof b?`${b}%`:m?`${o.length}/${r}`:r;return e(ff,{children:[t(tf,{entityType:n,badge:D,badgeTooltip:m?ot.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(bf,{children:o.length?e(vf,{$height:R,children:[E&&w&&t(hf,{namespace:w}),t(yn,{gap:4,elements:k,onTopIndexChange:E?O:void 0})]}):c?t(re,{size:3}):t(of,{entityType:n,description:gf[n]??ot.TO_COLLECT_OTEL_DATA})})]})},Cf=b.div`
1173
+ `,hf=({entityType:n,entities:o,unfilteredCount:r,metrics:s,loading:c,maxHeight:p,refetch:u})=>{const h=n===Et.Source,m=o.length!==r,g=At(e=>h?e.progress[Pt.Instrumenting]?.percentage:void 0),f=At(e=>h?e.progress[Pt.Uninstrumenting]?.percentage:void 0),b=!h||void 0===g&&void 0===f?void 0:g||f||0,{selectedSources:v,setSelectedSources:y}=oa(),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===Et.Source?s.sources:n===Et.Destination?s.destinations:void 0;if(t)for(const n of t)e.set(ia(n),n.throughput);return e},[s,n]),x=i(()=>o.map(e=>((e,t,n)=>{const o=Gt(e);if(!o)return null;const i=t===Et.Source;let a,l,r=!1,s=e;if(i){const t=(e=>{const t=e.workloadOdigosHealthStatus?.status,n=!1===e.markedForInstrumentation?.markedForInstrumentation;switch(t){case dn.Failure:return{status:_e.Error,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case dn.Notice:return{status:_e.Warning,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case dn.Pending:case dn.Waiting:return{status:void 0,faded:!1,displaySource:tf(e)};case dn.Unsupported:case dn.Disabled:return{status:void 0,faded:!0,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};default:return n?{status:void 0,faded:!0,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e}:{status:void 0,faded:!1,displaySource:nf(e)}}})(e);a=t.status,r=t.faded,l=t.tooltip,s=t.displaySource}else{const n=t===Et.Action?aa(e):e.conditions,{priorotizedStatus:o,hasDisableds:i}=la(n);a=o,r=i}const c=ra(e,t,{extended:i,prioritizeDisplayName:!i});let d,p,u,h,m;switch(t){case Et.Source:{d=wn(e),p=ca(Et.Source);const t=n?.get(sa(o));h=En(t);const i=e.markedForInstrumentation?.markedForInstrumentation;"boolean"==typeof i&&(m=i);break}case Et.Destination:{const t=Tt(e.destinationType.type);p=t.icon,u=t.iconSrc;const i=n?.get(sa(o));h=En(i),m=!e.disabled;break}case Et.Action:p=Jt(e.type),m=!e.disabled;break;case Et.InstrumentationRule:p=an(e.type),m=!e.disabled}return{key:sa(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(sf,{namespace:o.namespace},`ns-divider-${o.namespace}`)),i+=1),a=o.namespace),n.push(o.namespace||""),e.push(t(ef,{...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(df,{children:[t(Yg,{entityType:n,badge:D,badgeTooltip:m?ot.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(pf,{children:o.length?e(uf,{$height:R,children:[N&&w&&t(rf,{namespace:w}),t(yn,{gap:4,elements:k,onTopIndexChange:N?O:void 0})]}):c?t(re,{size:3}):t(qg,{entityType:n,description:cf[n]??ot.TO_COLLECT_OTEL_DATA})})]})},mf=b.div`
1192
1174
  width: 100%;
1193
1175
  flex: 1;
1194
1176
  min-height: 0;
@@ -1196,10 +1178,10 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
1196
1178
  display: flex;
1197
1179
  align-items: stretch;
1198
1180
  gap: 16px;
1199
- `,Sf={sources:[],destinations:[]},xf=()=>{const n=Yi(),{selectedStreamName:o}=it(),{containerRef:a,containerHeight:l}=da(),{sourcesApi:r,destinationsApi:s,actionsApi:c,instrumentationRulesApi:d,metricsApi:p}=yr(),{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=Cn(e=>e.drawerType),{data:S}=p.useMetrics({skip:!u.length||!m.length||!!C,pollInterval:1e4,fetchPolicy:"network-only"}),x=S?.getOverviewMetrics??Sf,w=i(()=>Ji(u,o),[u,o]),T=i(()=>en(m,o),[m,o]),k=i(()=>pa(w,n),[w,n]),I=i(()=>ua(T,n),[T,n]),E=i(()=>ha(f,n),[f,n]);return e(Cf,{ref:a,children:[t(yf,{entityType:Nt.InstrumentationRule,entities:v,unfilteredCount:v.length,loading:y,maxHeight:l,refetch:d.fetchAll}),t(yf,{entityType:Nt.Source,entities:k,unfilteredCount:w.length,metrics:x,loading:h,maxHeight:l,refetch:r.fetchAll}),t(yf,{entityType:Nt.Action,entities:E,unfilteredCount:f.length,loading:b,maxHeight:l,refetch:c.fetchAll}),t(yf,{entityType:Nt.Destination,entities:I,unfilteredCount:T.length,metrics:x,loading:g,maxHeight:l,refetch:s.fetchAll})]})},wf="40vw",Tf=b.div`
1181
+ `,gf={sources:[],destinations:[]},ff=()=>{const n=Yi(),{selectedStreamName:o}=it(),{containerRef:a,containerHeight:l}=da(),{sourcesApi:r,destinationsApi:s,actionsApi:c,instrumentationRulesApi:d,metricsApi:p}=yr(),{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=Cn(e=>e.drawerType),{data:S}=p.useMetrics({skip:!u.length||!m.length||!!C,pollInterval:1e4,fetchPolicy:"network-only"}),x=S?.getOverviewMetrics??gf,w=i(()=>Ji(u,o),[u,o]),T=i(()=>en(m,o),[m,o]),k=i(()=>pa(w,n),[w,n]),I=i(()=>ua(T,n),[T,n]),N=i(()=>ha(f,n),[f,n]);return e(mf,{ref:a,children:[t(hf,{entityType:Et.InstrumentationRule,entities:v,unfilteredCount:v.length,loading:y,maxHeight:l,refetch:d.fetchAll}),t(hf,{entityType:Et.Source,entities:k,unfilteredCount:w.length,metrics:x,loading:h,maxHeight:l,refetch:r.fetchAll}),t(hf,{entityType:Et.Action,entities:N,unfilteredCount:f.length,loading:b,maxHeight:l,refetch:c.fetchAll}),t(hf,{entityType:Et.Destination,entities:I,unfilteredCount:T.length,metrics:x,loading:g,maxHeight:l,refetch:s.fetchAll})]})},bf="40vw",vf=b.div`
1200
1182
  position: relative;
1201
- width: ${wf};
1202
- `,kf=b.div`
1183
+ width: ${bf};
1184
+ `,yf=b.div`
1203
1185
  position: absolute;
1204
1186
  top: calc(100% + 8px);
1205
1187
  left: 0;
@@ -1208,23 +1190,23 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
1208
1190
  flex-direction: column;
1209
1191
  gap: 8px;
1210
1192
  padding: 8px;
1211
- width: calc(${wf} - 16px);
1193
+ width: calc(${bf} - 16px);
1212
1194
  border-radius: 12px;
1213
1195
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
1214
1196
  box-shadow: 0 12px 24px 24px rgba(0, 0, 0, 0.5);
1215
- `,If=b.div`
1197
+ `,Cf=b.div`
1216
1198
  display: flex;
1217
1199
  align-items: center;
1218
1200
  overflow-x: auto;
1219
- `,Ef=b.div`
1201
+ `,Sf=b.div`
1220
1202
  display: flex;
1221
1203
  flex-direction: column;
1222
1204
  gap: 0;
1223
1205
  max-height: 60vh;
1224
1206
  overflow-y: auto;
1225
- `,Nf=b.div`
1207
+ `,xf=b.div`
1226
1208
  padding: 8px 12px 4px 12px;
1227
- `,Of=b.div`
1209
+ `,wf=b.div`
1228
1210
  display: flex;
1229
1211
  align-items: center;
1230
1212
  gap: 8px;
@@ -1234,12 +1216,12 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
1234
1216
  &:hover {
1235
1217
  background-color: ${({theme:e})=>e.v2.colors.silver[700]};
1236
1218
  }
1237
- `,$f=b.div`
1219
+ `,Tf=b.div`
1238
1220
  padding: 16px 8px;
1239
- `,Af=({preventPopup:n=!1})=>{const o=v(),{selectedStreamName:a}=it(),{searchText:s,setSearchText:c}=Yi(),{setDrawerType:d,setDrawerEntityId:u}=Cn(),{sourcesApi:h,destinationsApi:m,actionsApi:g,instrumentationRulesApi:f}=yr(),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"),E=!n&&(!!s||w),N=()=>{c(""),T(!1),I("all")};$n(x,()=>N()),fo({key:"Escape",active:E},N);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:Ji(b,a),actions:C,destinations:en(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(Tf,{ref:x,children:[t(vn,{value:s,onChange:e=>c(e.toLowerCase()),onFocus:()=>T(!0),width:wf}),E&&e(kf,{children:[A.length>1&&t(If,{children:t(ve,{options:A,selected:k,setSelected:I})}),R?t(Ef,{children:$.map(({category:n,label:i,entities:a},l)=>{if(!a.length)return null;const s=ca(n);return e(r,{children:[t(Nf,{children:t(ee,{size:te.XXS,color:ne.Secondary,children:i})}),a.map((i,a)=>e(Of,{onClick:()=>{const e=Gt(i);e&&(d(kn(n)),u(e),N())},children:[s&&t(s,{size:16,fill:o.v2.colors.white[500]}),t(ee,{size:te.XS,nowrap:!0,children:ra(i,n,{extended:!0})})]},`entity-${l}-${a}`))]},`category-list-${n}`)})}):t($f,{children:t($e,{hideIcon:!0,title:"No results",subTitle:s?`No matches for "${s}"`:"Start typing to search"})})]})]})},Rf=({onRedirectToSampling:o})=>{const{sourcesApi:a}=yr(),{items:l}=a.useSources(),{drawerType:r,drawerEntityId:s,setDrawerType:c,setDrawerEntityId:d}=Cn(),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(km,{}),r===wo.AddSource&&t(Pr,{children:t(Nc,{onClose:p,withOverlay:!0})}),r===wo.AddDestination&&t(Lr,{children:t(pc,{onClose:p,withOverlay:!0})}),r===wo.AddInstrumentationRule&&t(Fr,{sourceOptions:u,namespaceOptions:h,children:t(uc,{onClose:p,withOverlay:!0})}),r===wo.AddAction&&t(Mr,{sourceOptions:u,namespaceOptions:h,children:t(tc,{onClose:p,withOverlay:!0})}),r===wo.EditSource&&t(zr,{children:t(Qh,{onClose:p,sourceId:s,onRedirectToSampling:o})}),r===wo.EditDestination&&t(Lr,{children:t(Ip,{onClose:p,destinationId:s})}),r===wo.EditInstrumentationRule&&t(Fr,{sourceOptions:u,namespaceOptions:h,children:t(Np,{onClose:p,ruleId:s})}),r===wo.EditAction&&t(Mr,{sourceOptions:u,namespaceOptions:h,children:t(wp,{onClose:p,actionId:s})})]})},Df=b.div`
1221
+ `,kf=({preventPopup:n=!1})=>{const o=v(),{selectedStreamName:a}=it(),{searchText:s,setSearchText:c}=Yi(),{setDrawerType:d,setDrawerEntityId:u}=Cn(),{sourcesApi:h,destinationsApi:m,actionsApi:g,instrumentationRulesApi:f}=yr(),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")};$n(x,()=>E()),fo({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:Et.Source,label:"Sources",count:r.length,entities:[]},{category:Et.Action,label:"Actions",count:s.length,entities:[]},{category:Et.Destination,label:"Destinations",count:c.length,entities:[]},{category:Et.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===Et.InstrumentationRule?l:e.category===Et.Source?r:e.category===Et.Action?s:e.category===Et.Destination?c:[]}));return{categories:d,searchResults:p}})({instrumentationRules:S,sources:Ji(b,a),actions:C,destinations:en(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(vf,{ref:x,children:[t(vn,{value:s,onChange:e=>c(e.toLowerCase()),onFocus:()=>T(!0),width:bf}),N&&e(yf,{children:[A.length>1&&t(Cf,{children:t(ve,{options:A,selected:k,setSelected:I})}),R?t(Sf,{children:$.map(({category:n,label:i,entities:a},l)=>{if(!a.length)return null;const s=ca(n);return e(r,{children:[t(xf,{children:t(ee,{size:te.XXS,color:ne.Secondary,children:i})}),a.map((i,a)=>e(wf,{onClick:()=>{const e=Gt(i);e&&(d(kn(n)),u(e),E())},children:[s&&t(s,{size:16,fill:o.v2.colors.white[500]}),t(ee,{size:te.XS,nowrap:!0,children:ra(i,n,{extended:!0})})]},`entity-${l}-${a}`))]},`category-list-${n}`)})}):t(Tf,{children:t($e,{hideIcon:!0,title:"No results",subTitle:s?`No matches for "${s}"`:"Start typing to search"})})]})]})},If=({onRedirectToSampling:o})=>{const{sourcesApi:a}=yr(),{items:l}=a.useSources(),{drawerType:r,drawerEntityId:s,setDrawerType:c,setDrawerEntityId:d}=Cn(),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(ym,{}),r===wo.AddSource&&t(_r,{children:t(Ec,{onClose:p,withOverlay:!0})}),r===wo.AddDestination&&t(Lr,{children:t(pc,{onClose:p,withOverlay:!0})}),r===wo.AddInstrumentationRule&&t(Fr,{sourceOptions:u,namespaceOptions:h,children:t(uc,{onClose:p,withOverlay:!0})}),r===wo.AddAction&&t(Mr,{sourceOptions:u,namespaceOptions:h,children:t(tc,{onClose:p,withOverlay:!0})}),r===wo.EditSource&&t(zr,{children:t(Wh,{onClose:p,sourceId:s,onRedirectToSampling:o})}),r===wo.EditDestination&&t(Lr,{children:t(Cp,{onClose:p,destinationId:s})}),r===wo.EditInstrumentationRule&&t(Fr,{sourceOptions:u,namespaceOptions:h,children:t(xp,{onClose:p,ruleId:s})}),r===wo.EditAction&&t(Mr,{sourceOptions:u,namespaceOptions:h,children:t(bp,{onClose:p,actionId:s})})]})},Nf=b.div`
1240
1222
  position: relative;
1241
1223
  display: inline-flex;
1242
- `,_f=b.div`
1224
+ `,Ef=b.div`
1243
1225
  display: inline-flex;
1244
1226
  align-items: center;
1245
1227
  gap: 6px;
@@ -1250,7 +1232,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
1250
1232
  &:hover {
1251
1233
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
1252
1234
  }
1253
- `,Pf=b.div`
1235
+ `,Of=b.div`
1254
1236
  position: absolute;
1255
1237
  top: calc(100% + 8px);
1256
1238
  left: 0;
@@ -1264,18 +1246,18 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
1264
1246
  border-radius: 12px;
1265
1247
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
1266
1248
  box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
1267
- `,Lf=b.div`
1249
+ `,$f=b.div`
1268
1250
  display: flex;
1269
1251
  align-items: center;
1270
1252
  gap: 8px;
1271
1253
  width: 100%;
1272
- `,Ff=b.div`
1254
+ `,Af=b.div`
1273
1255
  display: flex;
1274
1256
  flex-direction: column;
1275
1257
  gap: 0;
1276
1258
  max-height: 240px;
1277
1259
  overflow-y: auto;
1278
- `,Mf=b.div`
1260
+ `,Rf=b.div`
1279
1261
  display: flex;
1280
1262
  align-items: center;
1281
1263
  gap: 8px;
@@ -1286,41 +1268,41 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
1286
1268
  &:hover {
1287
1269
  background-color: ${({$selected:e,theme:t})=>e?t.v2.colors.silver[600]:t.v2.colors.silver[700]};
1288
1270
  }
1289
- `,zf=b.div`
1271
+ `,Df=b.div`
1290
1272
  flex: 1;
1291
1273
  min-width: 0;
1292
1274
  overflow: hidden;
1293
1275
  text-overflow: ellipsis;
1294
1276
  white-space: nowrap;
1295
- `,Xf=b.div`
1277
+ `,Pf=b.div`
1296
1278
  display: flex;
1297
1279
  align-items: center;
1298
1280
  gap: 2px;
1299
1281
  flex-shrink: 0;
1300
- `,Bf=b.div`
1282
+ `,_f=b.div`
1301
1283
  display: flex;
1302
1284
  padding-top: 4px;
1303
1285
  border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
1304
- `,Uf=()=>{const o=v(),{isK8s:r}=S(),{clearStore:s}=ma(),{dataStreamsApi:c}=yr();c.useDataStreams();const{dataStreams:d,selectedStreamName:u,setSelectedStreamName:h}=it(),m=p(null),[g,f]=l(!1),[b,y]=l(""),[C,x]=l(""),[w,T]=l(!1),[k,I]=l(!1),[E,N]=l(!1),[O,$]=l(""),[A,R]=l(!1);$n(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?el:tl;return r?e(n,{children:[e(Df,{ref:m,children:[e(_f,{"data-id":"data-stream-select",$isOpen:g,onClick:()=>f(e=>!e),children:[t(Bl,{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(Pf,{children:[t(Lf,{children:t(vn,{value:b,onChange:y,placeholder:"Search streams...",width:"100%"})}),t(Ff,{children:0===D.length?t(Mf,{children:t(ee,{size:te.XS,color:ne.Secondary,children:"No streams match"})}):D.map(({name:n})=>{const o=n===ga;return e(Mf,{"data-id":`stream-row-${n}`,$selected:n===u,onClick:()=>(e=>{e!==u&&(s(),h(e)),f(!1)})(n),children:[t(zf,{children:t(ee,{size:te.XS,nowrap:!0,children:n})}),e(Xf,{children:[t(Ct,{"data-id":`stream-edit-${n}`,icon:Ya,size:St.XS,onClick:e=>{e.stopPropagation(),f(!1),x(n),T(!0)}}),!o&&t(Ct,{"data-id":`stream-delete-${n}`,icon:Ua,size:St.XS,onClick:e=>{e.stopPropagation(),f(!1),$(n),R(!0)}})]})]},`stream-${n}`)})}),t(Bf,{children:t(Te,{"data-id":"add-stream-trigger",variant:Ie.Secondary,size:ke.S,leftIcon:Va,label:`${Mt.NEW} ${ot.STREAM_NAME}`,fullWidth:!0,onClick:()=>{f(!1),s(),N(!0),I(!0)}})})]})]}),E&&t(Xr,{defaultExcludeName:u,children:t(Sm,{isOpen:k,onClose:()=>I(!1),onCloseEnd:()=>N(!1)})}),C&&t(Xr,{children:t(xm,{isOpen:w,dataStreamName:C,onClose:()=>T(!1),onCloseEnd:()=>x("")})}),t(ur,{target:`${ot.STREAM_NAME.toLowerCase()} "${O}"`,isOpen:A,onClose:()=>R(!1),onApprove:async()=>{O&&await c.remove(O)}})]}):null;var P},Vf=b(ae)`
1286
+ `,Lf=()=>{const o=v(),{isK8s:r}=S(),{clearStore:s}=ma(),{dataStreamsApi:c}=yr();c.useDataStreams();const{dataStreams:d,selectedStreamName:u,setSelectedStreamName:h}=it(),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);$n(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]),P=g?el:tl;return r?e(n,{children:[e(Nf,{ref:m,children:[e(Ef,{"data-id":"data-stream-select",$isOpen:g,onClick:()=>f(e=>!e),children:[t(Bl,{size:24}),t(ee,{size:te.S,weight:500,nowrap:!0,children:(_=u,`Data Stream: ${_}`)}),t(ce,{label:d.length,status:_e.Unknown,textSize:te.XXXS}),t(P,{size:20,fill:o.v2.colors.silver[200]})]}),g&&e(Of,{children:[t($f,{children:t(vn,{value:b,onChange:y,placeholder:"Search streams...",width:"100%"})}),t(Af,{children:0===D.length?t(Rf,{children:t(ee,{size:te.XS,color:ne.Secondary,children:"No streams match"})}):D.map(({name:n})=>{const o=n===ga;return e(Rf,{"data-id":`stream-row-${n}`,$selected:n===u,onClick:()=>(e=>{e!==u&&(s(),h(e)),f(!1)})(n),children:[t(Df,{children:t(ee,{size:te.XS,nowrap:!0,children:n})}),e(Pf,{children:[t(Ct,{"data-id":`stream-edit-${n}`,icon:Ya,size:St.XS,onClick:e=>{e.stopPropagation(),f(!1),x(n),T(!0)}}),!o&&t(Ct,{"data-id":`stream-delete-${n}`,icon:Ua,size:St.XS,onClick:e=>{e.stopPropagation(),f(!1),$(n),R(!0)}})]})]},`stream-${n}`)})}),t(_f,{children:t(Te,{"data-id":"add-stream-trigger",variant:Ie.Secondary,size:ke.S,leftIcon:Va,label:`${Mt.NEW} ${ot.STREAM_NAME}`,fullWidth:!0,onClick:()=>{f(!1),s(),E(!0),I(!0)}})})]})]}),N&&t(Xr,{defaultExcludeName:u,children:t(gm,{isOpen:k,onClose:()=>I(!1),onCloseEnd:()=>E(!1)})}),C&&t(Xr,{children:t(fm,{isOpen:w,dataStreamName:C,onClose:()=>T(!1),onCloseEnd:()=>x("")})}),t(ur,{target:`${ot.STREAM_NAME.toLowerCase()} "${O}"`,isOpen:A,onClose:()=>R(!1),onApprove:async()=>{O&&await c.remove(O)}})]}):null;var _},Ff=b(ae)`
1305
1287
  width: 100%;
1306
1288
  max-height: 320px;
1307
1289
  overflow-y: auto;
1308
1290
  gap: 8px;
1309
- `,Hf=b(oe)`
1291
+ `,Mf=b(oe)`
1310
1292
  width: 100%;
1311
1293
  align-items: center;
1312
1294
  gap: 8px;
1313
1295
  padding: 8px 12px;
1314
1296
  border-radius: 8px;
1315
1297
  background: ${({theme:e})=>e.v2.colors.silver[900]};
1316
- `,jf=()=>{const o=v(),{selectedStreamName:r}=it(),{selectedSources:s,setSelectedSources:c}=oa(),{sourcesApi:p}=yr(),[u,h]=l(!1),[m,g]=l(!1),[f,b]=l(!1),[y,C]=l(!1),{toInstrument:S,toUninstrument:x,totalSelected:w}=i(()=>{const e=[],t=[];return Object.values(s).forEach(n=>{n.forEach(n=>{(e=>!1===e.markedForInstrumentation?.markedForInstrumentation)(n)?e.push(n):t.push(n)})}),{toInstrument:e,toUninstrument:t,totalSelected:e.length+t.length}},[s]),T=d(()=>{c({})},[c]),k=d(()=>h(!1),[]),I=d(()=>g(!1),[]),E=d(()=>b(!1),[]),N=d(()=>C(!1),[]);a(()=>{T()},[r,T]);const O=d((e,t)=>{if(!e.length)return;const n=new Map;e.forEach(e=>{const t=e.id.namespace,o=n.get(t)??[];o.push(e),n.set(t,o)}),p.persistV2(Object.fromEntries([...n.entries()].map(([e,n])=>[e,n.map(({id:e})=>({namespace:e.namespace,name:e.name,kind:e.kind||void 0,...e.region?{region:e.region}:{},selected:t,currentStreamName:r}))])))},[p,r]),$=d(()=>{p.restartWorkloads(Object.values(s).flat().filter(e=>e.id.kind!==In.StaticPod).map(Sn)),T()},[p,s,T]),A=d(()=>{O(S,!0),T()},[O,S,T]),R=d(()=>{O(x,!1),T()},[O,x,T]),D=d(()=>{O(S,!0),O(x,!1),T()},[O,S,x,T]),_=S.length>0,P=x.length>0,L=_&&P,F=i(()=>{const e=[{id:"multi-source-deselect",type:bn.Button,buttonProps:{variant:Ie.Text,size:ke.S,label:"Deselect",onClick:T}},{id:"multi-source-restart",type:bn.Button,buttonProps:{variant:Ie.Secondary,size:ke.S,label:"Restart",leftIcon:kl,onClick:()=>h(!0)}}];return L?e.push({id:"multi-source-apply",type:bn.Button,buttonProps:{variant:Ie.Primary,size:ke.S,label:"Apply Changes",leftIcon:Va,onClick:()=>C(!0)}}):_?e.push({id:"multi-source-instrument",type:bn.Button,buttonProps:{variant:Ie.Primary,size:ke.S,label:"Instrument",leftIcon:Va,onClick:()=>b(!0)}}):P&&e.push({id:"multi-source-uninstrument",type:bn.Button,buttonProps:{variant:Ie.Primary,size:ke.S,label:"Uninstrument",leftIcon:Ua,onClick:()=>g(!0)}}),e},[T,L,_,P]),M=e=>ra(e,Nt.Source,{extended:!0})||e.id.name;return e(n,{children:[t(Hn,{isOpen:w>0,richTitle:{icon:al,title:"Selected sources",badge:{label:w}},actions:F}),t(nt,{isOpen:u,title:"Rollout Restart Workloads",description:"Are you sure you want to rollout restart these workloads?",onClose:k,denyButton:{label:"Go Back",variant:Ie.Secondary,onClick:k},approveButton:{label:"Confirm",variant:Ie.Primary,onClick:()=>{$(),k()}}}),t(ur,{isOpen:f,action:"instrument",target:`${S.length} source${1===S.length?"":"s"}`,onClose:E,onDeny:E,onApprove:A}),t(ur,{isOpen:m,action:"uninstrument",target:`${x.length} source${1===x.length?"":"s"}`,onClose:I,onDeny:I,onApprove:R}),t(nt,{isOpen:y,title:"Modify selected sources",description:"These changes are applied immediately. Disabled sources are re-instrumented; enabled sources are uninstrumented.",onClose:N,denyButton:{variant:Ie.Secondary,label:"Cancel",onClick:N},approveButton:{variant:Ie.Primary,label:"Confirm",onClick:()=>{D(),N()}},children:e(Vf,{children:[S.map(n=>e(Hf,{children:[t(ce,{leftIcon:Va,status:Pe.Success,useSecondaryTone:!0,textColor:o.v2.colors.white[500],textSize:te.XXS}),t(ee,{size:te.XS,color:ne.Primary,children:M(n)})]},`instrument-${n.id.namespace}-${n.id.kind}-${n.id.name}-${n.id.region??""}`)),x.map(n=>e(Hf,{children:[t(ce,{leftIcon:Il,status:Pe.Error,useSecondaryTone:!0,textColor:o.v2.colors.white[500],textSize:te.XXS}),t(ee,{size:te.XS,color:ne.Primary,children:M(n)})]},`uninstrument-${n.id.namespace}-${n.id.kind}-${n.id.name}-${n.id.region??""}`))]})})]})},Gf=C`
1298
+ `,zf=()=>{const o=v(),{selectedStreamName:r}=it(),{selectedSources:s,setSelectedSources:c}=oa(),{sourcesApi:p}=yr(),[u,h]=l(!1),[m,g]=l(!1),[f,b]=l(!1),[y,C]=l(!1),{toInstrument:S,toUninstrument:x,totalSelected:w}=i(()=>{const e=[],t=[];return Object.values(s).forEach(n=>{n.forEach(n=>{(e=>!1===e.markedForInstrumentation?.markedForInstrumentation)(n)?e.push(n):t.push(n)})}),{toInstrument:e,toUninstrument:t,totalSelected:e.length+t.length}},[s]),T=d(()=>{c({})},[c]),k=d(()=>h(!1),[]),I=d(()=>g(!1),[]),N=d(()=>b(!1),[]),E=d(()=>C(!1),[]);a(()=>{T()},[r,T]);const O=d((e,t)=>{if(!e.length)return;const n=new Map;e.forEach(e=>{const t=e.id.namespace,o=n.get(t)??[];o.push(e),n.set(t,o)}),p.persistV2(Object.fromEntries([...n.entries()].map(([e,n])=>[e,n.map(({id:e})=>({namespace:e.namespace,name:e.name,kind:e.kind||void 0,...e.region?{region:e.region}:{},selected:t,currentStreamName:r}))])))},[p,r]),$=d(()=>{p.restartWorkloads(Object.values(s).flat().filter(e=>e.id.kind!==In.StaticPod).map(Sn)),T()},[p,s,T]),A=d(()=>{O(S,!0),T()},[O,S,T]),R=d(()=>{O(x,!1),T()},[O,x,T]),D=d(()=>{O(S,!0),O(x,!1),T()},[O,S,x,T]),P=S.length>0,_=x.length>0,L=P&&_,F=i(()=>{const e=[{id:"multi-source-deselect",type:bn.Button,buttonProps:{variant:Ie.Text,size:ke.S,label:"Deselect",onClick:T}},{id:"multi-source-restart",type:bn.Button,buttonProps:{variant:Ie.Secondary,size:ke.S,label:"Restart",leftIcon:kl,onClick:()=>h(!0)}}];return L?e.push({id:"multi-source-apply",type:bn.Button,buttonProps:{variant:Ie.Primary,size:ke.S,label:"Apply Changes",leftIcon:Va,onClick:()=>C(!0)}}):P?e.push({id:"multi-source-instrument",type:bn.Button,buttonProps:{variant:Ie.Primary,size:ke.S,label:"Instrument",leftIcon:Va,onClick:()=>b(!0)}}):_&&e.push({id:"multi-source-uninstrument",type:bn.Button,buttonProps:{variant:Ie.Primary,size:ke.S,label:"Uninstrument",leftIcon:Ua,onClick:()=>g(!0)}}),e},[T,L,P,_]),M=e=>ra(e,Et.Source,{extended:!0})||e.id.name;return e(n,{children:[t(Hn,{isOpen:w>0,richTitle:{icon:al,title:"Selected sources",badge:{label:w}},actions:F}),t(nt,{isOpen:u,title:"Rollout Restart Workloads",description:"Are you sure you want to rollout restart these workloads?",onClose:k,denyButton:{label:"Go Back",variant:Ie.Secondary,onClick:k},approveButton:{label:"Confirm",variant:Ie.Primary,onClick:()=>{$(),k()}}}),t(ur,{isOpen:f,action:"instrument",target:`${S.length} source${1===S.length?"":"s"}`,onClose:N,onDeny:N,onApprove:A}),t(ur,{isOpen:m,action:"uninstrument",target:`${x.length} source${1===x.length?"":"s"}`,onClose:I,onDeny:I,onApprove:R}),t(nt,{isOpen:y,title:"Modify selected sources",description:"These changes are applied immediately. Disabled sources are re-instrumented; enabled sources are uninstrumented.",onClose:E,denyButton:{variant:Ie.Secondary,label:"Cancel",onClick:E},approveButton:{variant:Ie.Primary,label:"Confirm",onClick:()=>{D(),E()}},children:e(Ff,{children:[S.map(n=>e(Mf,{children:[t(ce,{leftIcon:Va,status:_e.Success,useSecondaryTone:!0,textColor:o.v2.colors.white[500],textSize:te.XXS}),t(ee,{size:te.XS,color:ne.Primary,children:M(n)})]},`instrument-${n.id.namespace}-${n.id.kind}-${n.id.name}-${n.id.region??""}`)),x.map(n=>e(Mf,{children:[t(ce,{leftIcon:Il,status:_e.Error,useSecondaryTone:!0,textColor:o.v2.colors.white[500],textSize:te.XXS}),t(ee,{size:te.XS,color:ne.Primary,children:M(n)})]},`uninstrument-${n.id.namespace}-${n.id.kind}-${n.id.name}-${n.id.region??""}`))]})})]})},Xf=C`
1317
1299
  0% {
1318
1300
  background-position: 200% 50%;
1319
1301
  }
1320
1302
  100% {
1321
1303
  background-position: 0% 50%;
1322
1304
  }
1323
- `,Wf=b.div`
1305
+ `,Bf=b.div`
1324
1306
  display: flex;
1325
1307
  align-items: center;
1326
1308
  justify-content: space-evenly;
@@ -1331,43 +1313,43 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
1331
1313
 
1332
1314
  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%)`};
1333
1315
  background-size: 200% 100%;
1334
- animation: ${Gf} 15s linear infinite;
1335
- `,Kf=[il,al,Ba,Qa],Yf=({onRedirectToSampling:n})=>{const o=v();return e(Wi,{children:[e(ht,{fullHeight:!0,customTitle:t(Uf,{}),customSearch:t(Af,{}),filters:t(Zg,{}),children:[t(Wf,{children:Kf.map((n,i)=>e(r,{children:[t(n,{size:24}),i<Kf.length-1&&t(Xa,{fill:o.v2.colors.white[500]+ie["020"],size:24})]},n.name))}),t(xf,{})]}),t(Rf,{onRedirectToSampling:n}),t(jf,{})]})};var Jf;(e=>{e.Gateway="gateway",e.Node="node"})(Jf||(Jf={}));const qf=({onClickDownloadDiagnose:n,onClickRefresh:o,loading:a,disabled:l})=>{const r=i(()=>{const e=[];return n&&e.push({id:So(),type:bn.Button,buttonProps:{label:"Download Diagnose",leftIcon:Rl,size:ke.S,variant:Ie.Text,onClick:n,disabled:l}}),o&&e.push({id:So(),type:bn.Button,buttonProps:{label:"Refresh",leftIcon:gl,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(fa,{icon:Ul,title:"Collectors Pipeline"}),t(ba,{actions:r})]})},Zf=({pod:n,onClose:o})=>{const{formatTimeAgo:a}=ln(),{collectorsApi:l}=yr(),{data:r}=l.usePodInfo(n?{namespace:n.namespace,name:n.name}:void 0,{skip:!n}),s=i(()=>[{id:So(),title:"Node",label:r?.node??"-",withCopy:!0},{id:So(),title:"Status",badge:{status:va(r?.status),label:r?.status??"-"}}],[r]),c=i(()=>r?.containers?.map(e=>({id:So(),items:[{id:So(),title:"Container",label:e.name??"-"},{id:So(),title:"Status",label:e.startedAt?`${e.status} (since ${a(e.startedAt)})`:e.status},{id:So(),title:"Ready",badge:{status:e.ready?Pe.Success:Pe.Error,leftIcon:e.ready?ja:Ga,label:e.ready?"True":"False",invertColors:!0}},{id:So(),title:"Started",badge:{status:e.started?Pe.Success:Pe.Error,leftIcon:e.started?ja:Ga,label:e.started?"True":"False",invertColors:!0}},{id:So(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:So(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:So(),title:ot.RESTARTS,label:e.restarts.toString()},{id:So(),title:"State Reason",label:e.stateReason??"-"},{id:So(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:So(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[r]);return t(Xt,{isOpen:!!n,header:{icon:bl,title:"Pod Information",onClose:o},children:r?e(Kt,{bgTint:"1000",richTitle:{icon:bl,title:r.name,withCopy:!0},children:[t(Kt,{bgTint:"900",cellsPerRow:2,items:s}),e(Kt,{bgTint:"900",richTitle:{icon:Tl,title:ot.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:[t(fn,{value:`kubectl get pod ${r.name} -n ${r.namespace} -o yaml`}),t(fn,{value:`kubectl describe pod ${r.name} -n ${r.namespace}`}),t(fn,{value:`kubectl logs ${r.name} -n ${r.namespace}`})]}),t(Kt,{bgTint:"900",richTitle:{title:"Containers Overview"},withCollapse:!0,collapseIsDefaultOpen:!0,children:c.length?c.map(({id:e,items:n})=>t(Kt,{bgTint:"800",cellsPerRow:2,items:n},e)):t($e,{title:"No containers",subTitle:"Pod has no containers"})}),t(hr,{bgTint:"900",yaml:r.manifestYAML,defaultOpen:!0})]}):t(bt,{$height:"50vh",children:t(xt,{withSpinner:!0})})})};var Qf;(e=>{e.PodName="podName",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.SpanDropRate="spanDropRate",e.Age="age",e.DockerImage="dockerImage"})(Qf||(Qf={}));const eb=e=>{const t=[{key:Qf.PodName,label:"Pod Name"},{key:Qf.Status,label:"Status"},{key:Qf.Restarts,label:ot.RESTARTS},{key:Qf.NodeName,label:"Node Name"},{key:Qf.Age,label:"Age"},{key:Qf.DockerImage,label:"Collector Version"}];return e&&t.splice(4,0,{key:Qf.SpanDropRate,label:"Span Drop Rate",noSort:!0,noFilter:!0}),t},tb=({isLoading:n,pods:o,withSpanDropRate:a})=>{const r=v(),{formatTimeAgo:s}=ln(),[c,d]=l(null),p=i(()=>o.map(n=>({onClick:()=>d(n),cells:[{key:Qf.PodName,rawValue:n.name},{key:Qf.Status,rawValue:n.status,component:()=>{return e=n.status,t(ce,{status:va(e),label:e});var e}},{key:Qf.Restarts,rawValue:n.restartsCount.toString()},{key:Qf.NodeName,rawValue:n.nodeName},{key:Qf.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?Vl:Hl,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?Vl:Hl,useSecondaryTone:!0,invertColors:!0})})]})}},{key:Qf.Age,rawValue:s(n.creationTimestamp)},{key:Qf.DockerImage,rawValue:n.image}]})),[o,r]);return e(Kt,{fullHeight:!0,bgTint:"1000",moreSpacing:!0,richTitle:{icon:bl,title:"Pods"},children:[t(Un,{variant:Vn.Data,isLoading:n,columns:eb(a),rows:p}),t(Zf,{pod:c,onClose:()=>d(null)})]})},nb=({isOpen:e,onClose:n,title:o,yaml:i})=>t(Xt,{isOpen:e,header:{icon:jl,title:o,onClose:n},children:t(hr,{yaml:i,defaultOpen:!0})}),ob=e=>{switch(e){case ya.Healthy:return"All desired replicas are updated, available, and ready";case ya.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case ya.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case ya.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case ya.Down:return"No available replicas";case ya.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}};var ib;(e=>{e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"})(ib||(ib={}));const ab=b.div`
1316
+ animation: ${Xf} 15s linear infinite;
1317
+ `,Uf=[il,al,Ba,Qa],Vf=({onRedirectToSampling:n})=>{const o=v();return e(Wi,{children:[e(ht,{fullHeight:!0,customTitle:t(Lf,{}),customSearch:t(kf,{}),filters:t(Gg,{}),children:[t(Bf,{children:Uf.map((n,i)=>e(r,{children:[t(n,{size:24}),i<Uf.length-1&&t(Xa,{fill:o.v2.colors.white[500]+ie["020"],size:24})]},n.name))}),t(ff,{})]}),t(If,{onRedirectToSampling:n}),t(zf,{})]})};var Hf;(e=>{e.Gateway="gateway",e.Node="node"})(Hf||(Hf={}));const jf=({onClickDownloadDiagnose:n,onClickRefresh:o,loading:a,disabled:l})=>{const r=i(()=>{const e=[];return n&&e.push({id:So(),type:bn.Button,buttonProps:{label:"Download Diagnose",leftIcon:Rl,size:ke.S,variant:Ie.Text,onClick:n,disabled:l}}),o&&e.push({id:So(),type:bn.Button,buttonProps:{label:"Refresh",leftIcon:gl,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(fa,{icon:Ul,title:"Collectors Pipeline"}),t(ba,{actions:r})]})},Gf=({pod:n,onClose:o})=>{const{formatTimeAgo:a}=ln(),{collectorsApi:l}=yr(),{data:r}=l.usePodInfo(n?{namespace:n.namespace,name:n.name}:void 0,{skip:!n}),s=i(()=>[{id:So(),title:"Node",label:r?.node??"-",withCopy:!0},{id:So(),title:"Status",badge:{status:va(r?.status),label:r?.status??"-"}}],[r]),c=i(()=>r?.containers?.map(e=>({id:So(),items:[{id:So(),title:"Container",label:e.name??"-"},{id:So(),title:"Status",label:e.startedAt?`${e.status} (since ${a(e.startedAt)})`:e.status},{id:So(),title:"Ready",badge:{status:e.ready?_e.Success:_e.Error,leftIcon:e.ready?ja:Ga,label:e.ready?"True":"False",invertColors:!0}},{id:So(),title:"Started",badge:{status:e.started?_e.Success:_e.Error,leftIcon:e.started?ja:Ga,label:e.started?"True":"False",invertColors:!0}},{id:So(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:So(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:So(),title:ot.RESTARTS,label:e.restarts.toString()},{id:So(),title:"State Reason",label:e.stateReason??"-"},{id:So(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:So(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[r]);return t(Xt,{isOpen:!!n,header:{icon:bl,title:"Pod Information",onClose:o},children:r?e(Kt,{bgTint:"1000",richTitle:{icon:bl,title:r.name,withCopy:!0},children:[t(Kt,{bgTint:"900",cellsPerRow:2,items:s}),e(Kt,{bgTint:"900",richTitle:{icon:Tl,title:ot.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:[t(fn,{value:`kubectl get pod ${r.name} -n ${r.namespace} -o yaml`}),t(fn,{value:`kubectl describe pod ${r.name} -n ${r.namespace}`}),t(fn,{value:`kubectl logs ${r.name} -n ${r.namespace}`})]}),t(Kt,{bgTint:"900",richTitle:{title:"Containers Overview"},withCollapse:!0,collapseIsDefaultOpen:!0,children:c.length?c.map(({id:e,items:n})=>t(Kt,{bgTint:"800",cellsPerRow:2,items:n},e)):t($e,{title:"No containers",subTitle:"Pod has no containers"})}),t(hr,{bgTint:"900",yaml:r.manifestYAML,defaultOpen:!0})]}):t(bt,{$height:"50vh",children:t(xt,{withSpinner:!0})})})};var Wf;(e=>{e.PodName="podName",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.SpanDropRate="spanDropRate",e.Age="age",e.DockerImage="dockerImage"})(Wf||(Wf={}));const Kf=e=>{const t=[{key:Wf.PodName,label:"Pod Name"},{key:Wf.Status,label:"Status"},{key:Wf.Restarts,label:ot.RESTARTS},{key:Wf.NodeName,label:"Node Name"},{key:Wf.Age,label:"Age"},{key:Wf.DockerImage,label:"Collector Version"}];return e&&t.splice(4,0,{key:Wf.SpanDropRate,label:"Span Drop Rate",noSort:!0,noFilter:!0}),t},Yf=({isLoading:n,pods:o,withSpanDropRate:a})=>{const r=v(),{formatTimeAgo:s}=ln(),[c,d]=l(null),p=i(()=>o.map(n=>({onClick:()=>d(n),cells:[{key:Wf.PodName,rawValue:n.name},{key:Wf.Status,rawValue:n.status,component:()=>{return e=n.status,t(ce,{status:va(e),label:e});var e}},{key:Wf.Restarts,rawValue:n.restartsCount.toString()},{key:Wf.NodeName,rawValue:n.nodeName},{key:Wf.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?_e.Error:_e.Success,r=(o?.exporterSuccessRps??0)+(o?.exporterFailedRps??0),s=r>0?Math.round((o?.exporterFailedRps??0)/r*100):0,c=s>0?_e.Error:_e.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===_e.Error?Vl:Hl,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===_e.Error?Vl:Hl,useSecondaryTone:!0,invertColors:!0})})]})}},{key:Wf.Age,rawValue:s(n.creationTimestamp)},{key:Wf.DockerImage,rawValue:n.image}]})),[o,r]);return e(Kt,{fullHeight:!0,bgTint:"1000",moreSpacing:!0,richTitle:{icon:bl,title:"Pods"},children:[t(Un,{variant:Vn.Data,isLoading:n,columns:Kf(a),rows:p}),t(Gf,{pod:c,onClose:()=>d(null)})]})},Jf=({isOpen:e,onClose:n,title:o,yaml:i})=>t(Xt,{isOpen:e,header:{icon:jl,title:o,onClose:n},children:t(hr,{yaml:i,defaultOpen:!0})}),qf=e=>{switch(e){case ya.Healthy:return"All desired replicas are updated, available, and ready";case ya.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case ya.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case ya.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case ya.Down:return"No available replicas";case ya.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}};var Zf;(e=>{e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"})(Zf||(Zf={}));const Qf=b.div`
1336
1318
  flex: 0.5;
1337
1319
  padding: 12px;
1338
1320
  border-radius: 12px;
1339
1321
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
1340
- `,lb=({selectedTab:n,gatewayInfo:o,nodeCollectorInfo:a,isLoading:r})=>{const{formatTimeAgo:s}=ln(),[c,d]=l(null),p=i(()=>(e=>{switch(e){case Jf.Gateway:return"Deployment";case Jf.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 Jf.Gateway:a=t?.rolloutInProgress??!1,l=t?.lastRolloutAt??null;break;case Jf.Node:a=n?.rolloutInProgress??!1,l=n?.lastRolloutAt??null;break;default:return i}return a?{status:Pe.Info,label:"Rollout in progress",rightIcon:gl,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":ya.Unknown,l=o?"Fetching data...":ob(ya.Unknown);switch(e){case Jf.Gateway:i=t?.status?va(t?.status):i,a=t?.status??a,l=t?.status?ob(t.status):l;break;case Jf.Node:i=n?.status?va(n?.status):i,a=n?.status??a,l=n?.status?ob(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 Jf.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 Jf.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 Jf.Gateway:return[{title:"Data throughput",cells:[{label:"Traces data",value:Nn(t?.throughputTracesBytesPerSec??0),isLoading:o},{label:"Metrics data",value:Nn(t?.throughputMetricsBytesPerSec??0),isLoading:o},{label:"Logs data",value:Nn(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 Jf.Node:return[{title:"Data Throughput",cells:[{label:"Traces data",value:Nn(n?.throughputTracesBytesPerSec??0),isLoading:o},{label:"Metrics data",value:Nn(n?.throughputMetricsBytesPerSec??0),isLoading:o},{label:"Logs data",value:Nn(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===Jf.Gateway?o?.manifestYAML:a?.manifestYAML)??"",[o,a,n]),b=i(()=>(n===Jf.Gateway?o?.configMapYAML:a?.configMapYAML)??"",[o,a,n]);return e(Kt,{bgTint:"1000",moreSpacing:!0,richTitle:{icon:jl,title:p,badge:u},actions:[{id:So(),type:bn.ButtonDropData,buttonProps:{variant:Ie.Secondary,size:ke.S,label:"View YAML",onClick:e=>d(e)},dropDataProps:{items:[{id:ib.ManifestYaml,label:p,icon:Gl},{id:ib.ConfigMapYaml,label:"ConfigMap",icon:Gl}]}}],children:[e(oe,{$gap:16,children:[t("div",{children:t(Ca,{...h})}),m.map(e=>t(ab,{children:t("div",{children:t(Sa,{...e})})},e.title)),g.map(e=>t(xa,{...e},e.title))]}),t(nb,{isOpen:c===ib.ManifestYaml,onClose:()=>d(null),title:p,yaml:f}),t(nb,{isOpen:c===ib.ConfigMapYaml,onClose:()=>d(null),title:"ConfigMap",yaml:b})]})},rb=[{value:Jf.Gateway,label:"Gateway"},{value:Jf.Node,label:"Node Collector"}],sb=({minSupportedVersion:n})=>{const{isVersionSupported:o,version:a,minSupportedVersion:r}=S(n),[s,c]=l(Jf.Gateway),p=s===Jf.Gateway,u=s===Jf.Node,{collectorsApi:h,configApi:m}=yr(),{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:E,refetch:N}=h.useNodeCollectorPods({skip:!u}),O=p&&(b||C)||u&&(T||E),$=d(()=>{p?(v(),x()):u&&(k(),N())},[p,u,v,x,k,N]),A=i(()=>p?y:I,[y,I,p]);return e(Wi,{children:[t(qf,{disabled:!o,loading:O,onClickDownloadDiagnose:void 0,onClickRefresh:$}),e(wa,{children:[e(ae,{children:[t(ve,{variant:Bn.Underline,size:Re.L,options:rb,selected:s,setSelected:c}),t(lb,{selectedTab:s,gatewayInfo:f??null,nodeCollectorInfo:w??null,isLoading:O})]}),t(tb,{isLoading:O,pods:A,withSpanDropRate:!1===g?.odigosOwnTelemetryStore?.metricsStoreDisabled}),!o&&t(fr,{minSupportedVersion:r,currentVersion:a||""})]})]})},cb=b.div`
1322
+ `,eb=({selectedTab:n,gatewayInfo:o,nodeCollectorInfo:a,isLoading:r})=>{const{formatTimeAgo:s}=ln(),[c,d]=l(null),p=i(()=>(e=>{switch(e){case Hf.Gateway:return"Deployment";case Hf.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(n),[n]),u=i(()=>((e,t,n,o)=>{const i={status:_e.Disabled,label:"No rollouts yet"};let a=!1,l=null;switch(e){case Hf.Gateway:a=t?.rolloutInProgress??!1,l=t?.lastRolloutAt??null;break;case Hf.Node:a=n?.rolloutInProgress??!1,l=n?.lastRolloutAt??null;break;default:return i}return a?{status:_e.Info,label:"Rollout in progress",rightIcon:gl,useSecondaryTone:!0}:l?{status:_e.Disabled,label:`Last Rollout: ${o(l)}`}:i})(n,o,a,s),[o,a,n,s]),h=i(()=>((e,t,n,o)=>{let i=o?_e.Info:_e.Unknown,a=o?"Loading":ya.Unknown,l=o?"Fetching data...":qf(ya.Unknown);switch(e){case Hf.Gateway:i=t?.status?va(t?.status):i,a=t?.status??a,l=t?.status?qf(t.status):l;break;case Hf.Node:i=n?.status?va(n?.status):i,a=n?.status??a,l=n?.status?qf(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 Hf.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 Hf.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 Hf.Gateway:return[{title:"Data throughput",cells:[{label:"Traces data",value:En(t?.throughputTracesBytesPerSec??0),isLoading:o},{label:"Metrics data",value:En(t?.throughputMetricsBytesPerSec??0),isLoading:o},{label:"Logs data",value:En(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 Hf.Node:return[{title:"Data Throughput",cells:[{label:"Traces data",value:En(n?.throughputTracesBytesPerSec??0),isLoading:o},{label:"Metrics data",value:En(n?.throughputMetricsBytesPerSec??0),isLoading:o},{label:"Logs data",value:En(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===Hf.Gateway?o?.manifestYAML:a?.manifestYAML)??"",[o,a,n]),b=i(()=>(n===Hf.Gateway?o?.configMapYAML:a?.configMapYAML)??"",[o,a,n]);return e(Kt,{bgTint:"1000",moreSpacing:!0,richTitle:{icon:jl,title:p,badge:u},actions:[{id:So(),type:bn.ButtonDropData,buttonProps:{variant:Ie.Secondary,size:ke.S,label:"View YAML",onClick:e=>d(e)},dropDataProps:{items:[{id:Zf.ManifestYaml,label:p,icon:Gl},{id:Zf.ConfigMapYaml,label:"ConfigMap",icon:Gl}]}}],children:[e(oe,{$gap:16,children:[t("div",{children:t(Ca,{...h})}),m.map(e=>t(Qf,{children:t("div",{children:t(Sa,{...e})})},e.title)),g.map(e=>t(xa,{...e},e.title))]}),t(Jf,{isOpen:c===Zf.ManifestYaml,onClose:()=>d(null),title:p,yaml:f}),t(Jf,{isOpen:c===Zf.ConfigMapYaml,onClose:()=>d(null),title:"ConfigMap",yaml:b})]})},tb=[{value:Hf.Gateway,label:"Gateway"},{value:Hf.Node,label:"Node Collector"}],nb=({minSupportedVersion:n})=>{const{isVersionSupported:o,version:a,minSupportedVersion:r}=S(n),[s,c]=l(Hf.Gateway),p=s===Hf.Gateway,u=s===Hf.Node,{collectorsApi:h,configApi:m}=yr(),{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(Wi,{children:[t(jf,{disabled:!o,loading:O,onClickDownloadDiagnose:void 0,onClickRefresh:$}),e(wa,{children:[e(ae,{children:[t(ve,{variant:Bn.Underline,size:Re.L,options:tb,selected:s,setSelected:c}),t(eb,{selectedTab:s,gatewayInfo:f??null,nodeCollectorInfo:w??null,isLoading:O})]}),t(Yf,{isLoading:O,pods:A,withSpanDropRate:!1===g?.odigosOwnTelemetryStore?.metricsStoreDisabled}),!o&&t(fr,{minSupportedVersion:r,currentVersion:a||""})]})]})},ob=b.div`
1341
1323
  display: inline-flex;
1342
1324
  align-items: center;
1343
1325
  min-width: 0;
1344
1326
  overflow: hidden;
1345
1327
  white-space: pre;
1346
1328
  text-overflow: ellipsis;
1347
- `,db=b.div`
1329
+ `,ib=b.div`
1348
1330
  display: flex;
1349
1331
  flex-direction: column;
1350
1332
  gap: 4px;
1351
1333
  min-width: 0;
1352
1334
  flex: 1;
1353
1335
  opacity: ${({$disabled:e})=>e?.4:1};
1354
- `,pb=b(oe)`
1336
+ `,ab=b(oe)`
1355
1337
  flex-shrink: 0;
1356
1338
  gap: 6px;
1357
1339
  align-items: center;
1358
1340
  min-height: 22px;
1359
- `,ub=[{key:"content",label:"Content",noSort:!0,noFilter:!0,flex:1},{key:"badges",label:"Type",noSort:!0,noFilter:!0,flex:"0 0 128px"}],hb=[{value:"all",label:Ta},{value:"Relevance",label:"Relevance"},{value:"Duration",label:"Duration"},{value:"Error",label:"Error"}],mb=({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(db,{$disabled:n.disabled,children:[t(cb,{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(pb,{children:[n.disabled&&t(ce,{label:jn,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(Ka,{...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:qn,leftIcon:Ya,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(ht,{fullHeight:!0,richTitle:{icon:Dl,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:hb,selected:f,setSelected:b}}:{}},children:t(Un,{variant:Vn.Pretty,hideHeader:!0,isLoading:a,noDataProps:m.trim()?{hideIcon:!0,title:ka,subTitle:Na(m)}:{hideIcon:!0,title:Ea,button:{label:Ia,onClick:c}},columns:ub,rows:C,getRowActions:x})})},gb=({docsUrl:n})=>{const{samplingApi:o,sourcesApi:r}=yr(),{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,E]=l(P.Noisy),[N,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}=Cn();a(()=>{if(!ue)return;if(h||0===u.length)return;he(null);const e=L(u,ue.ruleId,ue.category);e&&(E(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(()=>X(be?.rule??null),[be]),Ce=p(N);Ce.current=N,a(()=>{const e=Ce.current;if(!e)return;const t=B(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),[]),Ee=d(()=>Q(!1),[]);d(()=>pe(!1),[]);const Ne=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=N;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)})}},[N,u]),De=d(async(e,t,n)=>{const o=N?.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)}},[N,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=N?.category||K[I];await x(t,e,n),O(null),D(!1),te(null)},[ee,N,I,x]),Me=d(()=>te(null),[]),ze=d(async(e,t)=>{await w(e,t),ie(!1)},[w]),Xe=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]),Be=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:Oa,ruleId:n}:null},[u,I]),Ve=d(e=>{const t=N?.category,n=N?.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:Oa,ruleId:o}:null},[u,N]),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:So(),type:bn.Button,buttonProps:{"data-id":"sampling-btn-docs",label:$a,leftIcon:Wa,size:ke.S,variant:Ie.Text,onClick:()=>window.open(n,"_blank")}}),e.push({id:So(),type:bn.Button,buttonProps:{"data-id":"sampling-btn-refresh",label:Aa,leftIcon:gl,size:ke.S,variant:Ie.Text,onClick:g,loading:h}}),e.push({id:So(),type:bn.Button,buttonProps:{"data-id":"sampling-btn-create-rule",label:Ra,rightIcon:Va,size:ke.S,variant:Ie.Primary,onClick:we}}),e},[n,g,h,we]);return e(Wi,{children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[t(fa,{icon:Dl,title:_a,subTitle:Da}),t(ba,{actions:je})]}),e(ae,{$gap:12,$fullHeight:!0,children:[t(ve,{variant:Bn.Underline,size:Re.L,options:J,selected:I,setSelected:E}),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:Wa,size:ke.S,variant:Ie.Text,onClick:()=>window.open(n,"_blank")})]}),I===P.Noisy?t(er,{title:dt,summary:me,onEdit:()=>ie(!0)}):I===P.HighlyRelevant?t(er,{title:at,summary:fe,onEdit:()=>re(!0)}):I===P.CostReduction?t(er,{title:st,summary:ye,onEdit:()=>ce(!0)}):null,t(mb,{title:Z[I],items:xe,isLoading:h,showTypeFilter:I===P.HighlyRelevant,onRuleClick:Oe,onCreateRule:we,onEditRule:Ae,onDeleteRule:Le})]}),t(pm,{formType:kr.View,data:N,defaultEditMode:$,onClose:$e,onDelete:Le,onSaveEdit:De,sourceOptions:T,namespaceOptions:k,validateForm:Ve,onNavigateToDuplicate:He}),t(pm,{formType:kr.Create,isOpen:_,category:K[I],onClose:Ee,onSubmit:Ne,sourceOptions:T,namespaceOptions:k,validateForm:Ue,onNavigateToDuplicate:He}),t(pm,{formType:kr.EditAutoNoisy,isOpen:ne,enabled:m?.enabled??!1,keepPercentage:m?.keepPercentage??0,onClose:()=>ie(!1),onSave:ze}),t(pm,{formType:kr.EditAutoHighlyRelevant,isOpen:le,enabled:!!ge&&!ge.rule.disabled,onClose:()=>re(!1),onSave:Xe}),t(pm,{formType:kr.EditAutoCostReduction,isOpen:se,enabled:!!be&&!be.rule.disabled,dropPercentage:be?.rule.percentageAtMost??25,onClose:()=>ce(!1),onSave:Be}),t(nt,{title:Ma,description:Fa,isOpen:!!ee,onClose:Me,denyButton:{label:La,variant:Ie.Secondary,onClick:Me},approveButton:{label:Pa,variant:Ie.Primary,onClick:()=>{Fe(),Me()}}}),!1]})},fb=b.div`
1341
+ `,lb=[{key:"content",label:"Content",noSort:!0,noFilter:!0,flex:1},{key:"badges",label:"Type",noSort:!0,noFilter:!0,flex:"0 0 128px"}],rb=[{value:"all",label:Ta},{value:"Relevance",label:"Relevance"},{value:"Duration",label:"Duration"},{value:"Error",label:"Error"}],sb=({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(ib,{$disabled:n.disabled,children:[t(ob,{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(ab,{children:[n.disabled&&t(ce,{label:jn,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(Ka,{...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:qn,leftIcon:Ya,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(ht,{fullHeight:!0,richTitle:{icon:Dl,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:rb,selected:f,setSelected:b}}:{}},children:t(Un,{variant:Vn.Pretty,hideHeader:!0,isLoading:a,noDataProps:m.trim()?{hideIcon:!0,title:ka,subTitle:Ea(m)}:{hideIcon:!0,title:Na,button:{label:Ia,onClick:c}},columns:lb,rows:C,getRowActions:x})})},cb=({docsUrl:n})=>{const{samplingApi:o,sourcesApi:r}=yr(),{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(_.Noisy),[E,O]=l(null),[$,D]=l(!1),[P,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}=Cn();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(()=>X(be?.rule??null),[be]),Ce=p(E);Ce.current=E,a(()=>{const e=Ce.current;if(!e)return;const t=B(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]),Xe=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]),Be=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:Oa,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:Oa,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:So(),type:bn.Button,buttonProps:{"data-id":"sampling-btn-docs",label:$a,leftIcon:Wa,size:ke.S,variant:Ie.Text,onClick:()=>window.open(n,"_blank")}}),e.push({id:So(),type:bn.Button,buttonProps:{"data-id":"sampling-btn-refresh",label:Aa,leftIcon:gl,size:ke.S,variant:Ie.Text,onClick:g,loading:h}}),e.push({id:So(),type:bn.Button,buttonProps:{"data-id":"sampling-btn-create-rule",label:Ra,rightIcon:Va,size:ke.S,variant:Ie.Primary,onClick:we}}),e},[n,g,h,we]);return e(Wi,{children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[t(fa,{icon:Dl,title:Pa,subTitle:Da}),t(ba,{actions:je})]}),e(ae,{$gap:12,$fullHeight:!0,children:[t(ve,{variant:Bn.Underline,size:Re.L,options:J,selected:I,setSelected:N}),e(oe,{$justifyContent:"space-between",children:[t(Pe,{status:_e.Default,message:q[I]}),n&&t(Te,{"data-id":"sampling-btn-docs-banner",label:"Docs",leftIcon:Wa,size:ke.S,variant:Ie.Text,onClick:()=>window.open(n,"_blank")})]}),I===_.Noisy?t(er,{title:dt,summary:me,onEdit:()=>ie(!0)}):I===_.HighlyRelevant?t(er,{title:at,summary:fe,onEdit:()=>re(!0)}):I===_.CostReduction?t(er,{title:st,summary:ye,onEdit:()=>ce(!0)}):null,t(sb,{title:Z[I],items:xe,isLoading:h,showTypeFilter:I===_.HighlyRelevant,onRuleClick:Oe,onCreateRule:we,onEditRule:Ae,onDeleteRule:Le})]}),t(am,{formType:kr.View,data:E,defaultEditMode:$,onClose:$e,onDelete:Le,onSaveEdit:De,sourceOptions:T,namespaceOptions:k,validateForm:Ve,onNavigateToDuplicate:He}),t(am,{formType:kr.Create,isOpen:P,category:K[I],onClose:Ne,onSubmit:Ee,sourceOptions:T,namespaceOptions:k,validateForm:Ue,onNavigateToDuplicate:He}),t(am,{formType:kr.EditAutoNoisy,isOpen:ne,enabled:m?.enabled??!1,keepPercentage:m?.keepPercentage??0,onClose:()=>ie(!1),onSave:ze}),t(am,{formType:kr.EditAutoHighlyRelevant,isOpen:le,enabled:!!ge&&!ge.rule.disabled,onClose:()=>re(!1),onSave:Xe}),t(am,{formType:kr.EditAutoCostReduction,isOpen:se,enabled:!!be&&!be.rule.disabled,dropPercentage:be?.rule.percentageAtMost??25,onClose:()=>ce(!1),onSave:Be}),t(nt,{title:Ma,description:Fa,isOpen:!!ee,onClose:Me,denyButton:{label:La,variant:Ie.Secondary,onClick:Me},approveButton:{label:_a,variant:Ie.Primary,onClick:()=>{Fe(),Me()}}}),!1]})},db=b.div`
1360
1342
  padding: 12px;
1361
1343
  border-radius: 12px;
1362
1344
  background-color: ${({theme:e})=>e.v2.colors.silver[750]};
1363
- `,bb=f(({id:e,data:n})=>t(fb,{"data-id":e,children:t($e,{...n})}));var vb,yb;bb.displayName=bb.name,(e=>{e.MapItem="map-item",e.NoData="no-data"})(vb||(vb={})),(e=>{e.AnimatedTraffic="animated-traffic"})(yb||(yb={}));const Cb=(e,t,n)=>{if(n)return{icons:[wl],aggService:e,selected:!0};const o=e.isVirtual,i=o?[xn(e)]:t?wn(t):[Wl],{priorotizedStatus:a}=o?{priorotizedStatus:void 0}:la(t?.conditions||[]);return{icons:i,status:a,isVirtual:o,aggService:e,selected:!0}},Sb=e=>!(!e||e.serviceName!==Jp||e.id.namespace||e.id.name||e.id.kind),xb=new ns,wb={"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)}},kb={id:{namespace:"",name:"",kind:""},serviceName:Jp,markedForInstrumentation:{markedForInstrumentation:!0}},Ib=h(null),Eb=()=>{const e=m(Ib);if(!e)throw new Error("useServiceMapContext must be used within a ServiceMapProvider");return e},Nb=({serviceMap:e,children:n})=>{const o=v(),{sourcesApi:r}=yr(),{items:s}=r.useSources(),[c,p,u]=Vr([]),[h,m,g]=Hr([]),[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),[]),E=d(()=>k(null),[]),N=d((e,t)=>{const n=new Set(e);p(e=>e.map(e=>e.type===vb.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}=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=Sb(t);n.push({id:i.graphKey,type:vb.MapItem,position:o,data:Cb(i,t,a),measured:{width:80,height:80}})}else n.push({id:vb.NoData,type:vb.NoData,position:o,data:{subTitle:ot.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return n})({aggregatedServiceMap:n,sources:[kb].concat(s)});if(1===i.length&&i[0].id===vb.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:Ur.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:{...wb,...n},children:e.map(e=>({id:e.id,width:80,height:80,...e.id===Jp?{layoutOptions:{"elk.layered.layering.layerConstraint":"FIRST","elk.alignment":"CENTER"}}:{}})),edges:t.map(e=>({id:e.id,sources:[e.source],targets:[e.target]}))},i=await xb.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===vb.MapItem&&n.type===vb.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:yb.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:N,fitViewTrigger:f,hoveredNodeId:x,setHoveredNodeId:w,activeNodeId:T,toggleActiveNode:I,resetActiveNode:E}),[c,O,u,g,N,f,x,T,I,E]);return t(Ib.Provider,{value:$,children:n})},Ob=b.div`
1345
+ `,pb=f(({id:e,data:n})=>t(db,{"data-id":e,children:t($e,{...n})}));var ub,hb;pb.displayName=pb.name,(e=>{e.MapItem="map-item",e.NoData="no-data"})(ub||(ub={})),(e=>{e.AnimatedTraffic="animated-traffic"})(hb||(hb={}));const mb=(e,t,n)=>{if(n)return{icons:[wl],aggService:e,selected:!0};const o=e.isVirtual,i=o?[xn(e)]:t?wn(t):[Wl],{priorotizedStatus:a}=o?{priorotizedStatus:void 0}:la(t?.conditions||[]);return{icons:i,status:a,isVirtual:o,aggService:e,selected:!0}},gb=e=>!(!e||e.serviceName!==Hp||e.id.namespace||e.id.name||e.id.kind),fb=new ns,bb={"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"},vb=e=>{const t=e.lastIndexOf("|");return-1===t?{graphKey:e,detail:""}:{graphKey:e.substring(0,t),detail:e.substring(t+1)}},yb={id:{namespace:"",name:"",kind:""},serviceName:Hp,markedForInstrumentation:{markedForInstrumentation:!0}},Cb=h(null),Sb=()=>{const e=m(Cb);if(!e)throw new Error("useServiceMapContext must be used within a ServiceMapProvider");return e},xb=({serviceMap:e,children:n})=>{const o=v(),{sourcesApi:r}=yr(),{items:s}=r.useSources(),[c,p,u]=Vr([]),[h,m,g]=Hr([]),[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===ub.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}=vb(t.nodeId),a=o(e,t.serviceName);a.isVirtual=!1;for(const e of t.services){const{graphKey:t,detail:l}=vb(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=gb(t);n.push({id:i.graphKey,type:ub.MapItem,position:o,data:mb(i,t,a),measured:{width:80,height:80}})}else n.push({id:ub.NoData,type:ub.NoData,position:o,data:{subTitle:ot.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return n})({aggregatedServiceMap:n,sources:[yb].concat(s)});if(1===i.length&&i[0].id===ub.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===_e.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:Ur.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:{...bb,...n},children:e.map(e=>({id:e.id,width:80,height:80,...e.id===Hp?{layoutOptions:{"elk.layered.layering.layerConstraint":"FIRST","elk.alignment":"CENTER"}}:{}})),edges:t.map(e=>({id:e.id,sources:[e.source],targets:[e.target]}))},i=await fb.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===ub.MapItem&&n.type===ub.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:hb.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(Cb.Provider,{value:$,children:n})},wb=b.div`
1364
1346
  border: 1px ${({theme:e,$isSelected:t,$isVirtual:n})=>t?`solid ${e.v2.colors.blue[300]}`:n?`dashed ${e.v2.colors.silver[300]}`:"solid transparent"};
1365
1347
  border-radius: 8px;
1366
1348
  cursor: pointer;
1367
1349
  opacity: ${({$isVirtual:e})=>e?.8:1};
1368
- `,$b=b.div`
1350
+ `,Tb=b.div`
1369
1351
  position: relative;
1370
- `,Ab=b.div`
1352
+ `,kb=b.div`
1371
1353
  position: absolute;
1372
1354
  top: 100%;
1373
1355
  left: 50%;
@@ -1376,7 +1358,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
1376
1358
  align-items: center;
1377
1359
  gap: 4px;
1378
1360
  margin-top: 4px;
1379
- `,Rb=f(({id:o,data:a})=>{const{icons:l,status:r,isVirtual:s}=a,c=v(),{activeNodeId:d,hoveredNodeId:p}=Eb(),{isUserSource:u,isNodeSelected:h,isHovered:m}=i(()=>({isUserSource:o===Jp,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?Fn(r,c):null;return e(n,{children:[t(jr,{type:"source",position:Gr.Right,style:{visibility:"hidden"}}),t(jr,{type:"target",position:Gr.Left,style:{visibility:"hidden"}}),e($b,{"data-id":o,children:[t(Ob,{$isSelected:g,$isVirtual:s,children:t(Tn,{padding:12,icons:l,status:f?Pe.Info:r})}),e(Ab,{children:[b&&t(b,{}),t(ee,{size:te.XXS,nowrap:!0,children:o})]})]})]})});Rb.displayName=Rb.name;const Db=b.div`
1361
+ `,Ib=f(({id:o,data:a})=>{const{icons:l,status:r,isVirtual:s}=a,c=v(),{activeNodeId:d,hoveredNodeId:p}=Sb(),{isUserSource:u,isNodeSelected:h,isHovered:m}=i(()=>({isUserSource:o===Hp,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?Fn(r,c):null;return e(n,{children:[t(jr,{type:"source",position:Gr.Right,style:{visibility:"hidden"}}),t(jr,{type:"target",position:Gr.Left,style:{visibility:"hidden"}}),e(Tb,{"data-id":o,children:[t(wb,{$isSelected:g,$isVirtual:s,children:t(Tn,{padding:12,icons:l,status:f?_e.Info:r})}),e(kb,{children:[b&&t(b,{}),t(ee,{size:te.XXS,nowrap:!0,children:o})]})]})]})});Ib.displayName=Ib.name;const Nb=b.div`
1380
1362
  display: flex;
1381
1363
  flex-direction: column;
1382
1364
  gap: 12px;
@@ -1389,10 +1371,10 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
1389
1371
  top: 16px;
1390
1372
  left: 8px;
1391
1373
  z-index: ${({theme:e})=>e.v2.zIndex.drawer};
1392
- `,_b=({children:e})=>t(Db,{children:e});var Pb,Lb;(e=>{e.All="All",e.Inbound="Inbound",e.Outbound="Outbound"})(Pb||(Pb={})),(e=>{e.Inbound="Inbound",e.Outbound="Outbound"})(Lb||(Lb={}));const Fb=b.div`
1374
+ `,Eb=({children:e})=>t(Nb,{children:e});var Ob,$b;(e=>{e.All="All",e.Inbound="Inbound",e.Outbound="Outbound"})(Ob||(Ob={})),(e=>{e.Inbound="Inbound",e.Outbound="Outbound"})($b||($b={}));const Ab=b.div`
1393
1375
  flex: 1 1 auto;
1394
1376
  min-height: 0;
1395
- `,Mb=()=>{const{nodes:n,activeNodeId:o,resetActiveNode:a}=Eb(),[r,s]=l(Pb.All),c=i(()=>{const e=new Map;for(const t of n)t.type===vb.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:Lb.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:Lb.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=[Pb.All,Pb.Inbound].includes(r)&&p.length>0,m=[Pb.All,Pb.Outbound].includes(r)&&u.length>0;return e(_b,{children:[e(oe,{$width:"100%",$gap:8,children:[t(Te,{variant:Ie.Text,size:ke.S,leftIcon:hl,onClick:a}),t(Tn,{icons:d.data.icons}),t(ee,{size:te.XS,children:d.id})]}),t(ve,{fullWidth:!0,options:[{label:`${Pb.All}`,value:Pb.All,badge:{label:`${p.length+u.length}`}},{label:`${Pb.Inbound}`,value:Pb.Inbound,badge:{label:`${p.length}`}},{label:`${Pb.Outbound}`,value:Pb.Outbound,badge:{label:`${u.length}`}}],selected:r,setSelected:s}),h&&t(Xb,{halfHeight:m,title:"Inbound",icon:Sl,connections:p,mapNodesById:c}),m&&t(Xb,{halfHeight:h,title:"Outbound",icon:xl,connections:u,mapNodesById:c})]})},zb=b.div`
1377
+ `,Rb=()=>{const{nodes:n,activeNodeId:o,resetActiveNode:a}=Sb(),[r,s]=l(Ob.All),c=i(()=>{const e=new Map;for(const t of n)t.type===ub.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:$b.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:$b.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=[Ob.All,Ob.Inbound].includes(r)&&p.length>0,m=[Ob.All,Ob.Outbound].includes(r)&&u.length>0;return e(Eb,{children:[e(oe,{$width:"100%",$gap:8,children:[t(Te,{variant:Ie.Text,size:ke.S,leftIcon:hl,onClick:a}),t(Tn,{icons:d.data.icons}),t(ee,{size:te.XS,children:d.id})]}),t(ve,{fullWidth:!0,options:[{label:`${Ob.All}`,value:Ob.All,badge:{label:`${p.length+u.length}`}},{label:`${Ob.Inbound}`,value:Ob.Inbound,badge:{label:`${p.length}`}},{label:`${Ob.Outbound}`,value:Ob.Outbound,badge:{label:`${u.length}`}}],selected:r,setSelected:s}),h&&t(Pb,{halfHeight:m,title:"Inbound",icon:Sl,connections:p,mapNodesById:c}),m&&t(Pb,{halfHeight:h,title:"Outbound",icon:xl,connections:u,mapNodesById:c})]})},Db=b.div`
1396
1378
  display: flex;
1397
1379
  flex-direction: column;
1398
1380
  gap: 8px;
@@ -1400,17 +1382,17 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
1400
1382
  border-radius: 12px;
1401
1383
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
1402
1384
  height: ${({$halfHeight:e})=>e?"48%":"100%"};
1403
- `,Xb=({halfHeight:n,title:o,icon:i,connections:a,mapNodesById:l})=>{const r=v();return e(zb,{$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(Fb,{children:t(yn,{gap:4,elements:a.map(e=>t(Ub,{connection:e,peerNode:l.get(e.peerId)},`${e.direction}-${e.peerId}`))})})]})},Bb=b.div`
1385
+ `,Pb=({halfHeight:n,title:o,icon:i,connections:a,mapNodesById:l})=>{const r=v();return e(Db,{$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(Ab,{children:t(yn,{gap:4,elements:a.map(e=>t(Lb,{connection:e,peerNode:l.get(e.peerId)},`${e.direction}-${e.peerId}`))})})]})},_b=b.div`
1404
1386
  display: flex;
1405
1387
  align-items: center;
1406
1388
  gap: 8px;
1407
1389
  padding: 8px;
1408
1390
  border-radius: 8px;
1409
1391
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
1410
- `,Ub=({connection:n,peerNode:o})=>e(Bb,{children:[o&&t(Tn,{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"})]})]}),Vb="0;0.5;1",Hb=f(({id:o,sourceX:i,sourceY:a,targetX:l,targetY:r,sourcePosition:s,targetPosition:c,markerEnd:d})=>{const p=v(),[u]=Wr({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(Kr,{id:o,path:u,markerEnd:d,style:{stroke:m,strokeWidth:1}}),t(Yr,{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:Vb,values:"0;3.5;3.5"}),t("animate",{attributeName:"fill",dur:b,begin:i,repeatCount:"indefinite",keyTimes:Vb,values:`${g};${f};${f}`})]},o)})]})})]})});Hb.displayName=Hb.name;const jb=b.div`
1392
+ `,Lb=({connection:n,peerNode:o})=>e(_b,{children:[o&&t(Tn,{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"})]})]}),Fb="0;0.5;1",Mb=f(({id:o,sourceX:i,sourceY:a,targetX:l,targetY:r,sourcePosition:s,targetPosition:c,markerEnd:d})=>{const p=v(),[u]=Wr({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(Kr,{id:o,path:u,markerEnd:d,style:{stroke:m,strokeWidth:1}}),t(Yr,{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:Fb,values:"0;3.5;3.5"}),t("animate",{attributeName:"fill",dur:b,begin:i,repeatCount:"indefinite",keyTimes:Fb,values:`${g};${f};${f}`})]},o)})]})})]})});Mb.displayName=Mb.name;const zb=b.div`
1411
1393
  flex: 1 1 auto;
1412
1394
  min-height: 0;
1413
- `,Gb=({})=>{const{nodes:n,setNodesSelected:o,resetActiveNode:a}=Eb(),[r,s]=l(""),c=i(()=>n.filter(e=>e.type===vb.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(_b,{children:[e(oe,{$width:"100%",$gap:8,children:[t(ee,{size:te.XS,children:"Services"}),t(ce,{label:c.length})]}),t(vn,{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?ot.UNSELECT_ALL:ot.SELECT_ALL})]}),t(jb,{children:t(yn,{gap:4,elements:u.map(e=>t(Kb,{node:e},e.id))})})]}):null},Wb=b.div`
1395
+ `,Xb=({})=>{const{nodes:n,setNodesSelected:o,resetActiveNode:a}=Sb(),[r,s]=l(""),c=i(()=>n.filter(e=>e.type===ub.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(Eb,{children:[e(oe,{$width:"100%",$gap:8,children:[t(ee,{size:te.XS,children:"Services"}),t(ce,{label:c.length})]}),t(vn,{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?ot.UNSELECT_ALL:ot.SELECT_ALL})]}),t(zb,{children:t(yn,{gap:4,elements:u.map(e=>t(Ub,{node:e},e.id))})})]}):null},Bb=b.div`
1414
1396
  display: flex;
1415
1397
  align-items: center;
1416
1398
  gap: 8px;
@@ -1418,7 +1400,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
1418
1400
  border-radius: 8px;
1419
1401
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
1420
1402
  cursor: pointer;
1421
- `,Kb=({node:n})=>{const{setNodesSelected:o,activeNodeId:i,resetActiveNode:a}=Eb(),l=d(()=>{const e=!n.data.selected,t=i===n.id;o([n.id],e),!e&&t&&a()},[n,i,o,a]);return e(Wb,{onClick:l,children:[t(Q,{value:n.data.selected||!1,onChange:l}),t(Tn,{icons:n.data.icons}),t(ee,{size:te.XXS,children:n.id})]},n.id)},Yb=b.div`
1403
+ `,Ub=({node:n})=>{const{setNodesSelected:o,activeNodeId:i,resetActiveNode:a}=Sb(),l=d(()=>{const e=!n.data.selected,t=i===n.id;o([n.id],e),!e&&t&&a()},[n,i,o,a]);return e(Bb,{onClick:l,children:[t(Q,{value:n.data.selected||!1,onChange:l}),t(Tn,{icons:n.data.icons}),t(ee,{size:te.XXS,children:n.id})]},n.id)},Vb=b.div`
1422
1404
  position: relative;
1423
1405
  height: 100%;
1424
1406
  .react-flow__attribution {
@@ -1427,7 +1409,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
1427
1409
  * {
1428
1410
  transition: none;
1429
1411
  }
1430
- `,Jb=b.div`
1412
+ `,Hb=b.div`
1431
1413
  .react-flow__controls {
1432
1414
  display: flex;
1433
1415
  align-items: center;
@@ -1453,33 +1435,33 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
1453
1435
  }
1454
1436
  }
1455
1437
  }
1456
- `,qb={[vb.MapItem]:Rb,[vb.NoData]:bb},Zb={[yb.AnimatedTraffic]:Hb},Qb={duration:300,padding:.1,includeHiddenNodes:!0,maxZoom:1},ev=({trigger:e})=>{const{fitView:t}=ts(),n=p(!0);return a(()=>{n.current?n.current=!1:e>0&&requestAnimationFrame(()=>t(Qb))},[e,t]),null},tv=({onRefresh:n})=>{const{nodes:o,edges:a,fitViewTrigger:l,onNodesChange:r,onEdgesChange:s,setHoveredNodeId:c,toggleActiveNode:d}=Eb(),p=i(()=>{const e=new Set(o.filter(e=>e.type===vb.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!==vb.MapItem||e.data.selected||t.has(e.id))},[o,a]);return e(qr,{zoomOnScroll:!0,nodes:p,nodeTypes:qb,edges:a,edgeTypes:Zb,onNodeClick:(e,t)=>d(t.id),onNodeMouseEnter:(e,t)=>c(t.id),onNodeMouseLeave:()=>c(null),onNodesChange:r,onEdgesChange:s,children:[t(Zr,{}),t(ev,{trigger:l}),t(Jb,{children:t(Qr,{position:"top-right",orientation:"horizontal",showInteractive:!1,showZoom:!0,showFitView:!0,fitViewOptions:Qb,children:t(es,{onClick:n,children:t(gl,{})})})})]})},nv=n=>t(Jr,{children:e(Yb,{children:[t(tv,{...n}),t(Gb,{}),t(Mb,{})]})}),ov=b.div`
1438
+ `,jb={[ub.MapItem]:Ib,[ub.NoData]:pb},Gb={[hb.AnimatedTraffic]:Mb},Wb={duration:300,padding:.1,includeHiddenNodes:!0,maxZoom:1},Kb=({trigger:e})=>{const{fitView:t}=ts(),n=p(!0);return a(()=>{n.current?n.current=!1:e>0&&requestAnimationFrame(()=>t(Wb))},[e,t]),null},Yb=({onRefresh:n})=>{const{nodes:o,edges:a,fitViewTrigger:l,onNodesChange:r,onEdgesChange:s,setHoveredNodeId:c,toggleActiveNode:d}=Sb(),p=i(()=>{const e=new Set(o.filter(e=>e.type===ub.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!==ub.MapItem||e.data.selected||t.has(e.id))},[o,a]);return e(qr,{zoomOnScroll:!0,nodes:p,nodeTypes:jb,edges:a,edgeTypes:Gb,onNodeClick:(e,t)=>d(t.id),onNodeMouseEnter:(e,t)=>c(t.id),onNodeMouseLeave:()=>c(null),onNodesChange:r,onEdgesChange:s,children:[t(Zr,{}),t(Kb,{trigger:l}),t(Hb,{children:t(Qr,{position:"top-right",orientation:"horizontal",showInteractive:!1,showZoom:!0,showFitView:!0,fitViewOptions:Wb,children:t(es,{onClick:n,children:t(gl,{})})})})]})},Jb=n=>t(Jr,{children:e(Vb,{children:[t(Yb,{...n}),t(Xb,{}),t(Rb,{})]})}),qb=b.div`
1457
1439
  width: 100%;
1458
1440
  flex: 1;
1459
1441
  align-self: stretch;
1460
1442
  min-height: 0;
1461
1443
  height: 100%;
1462
1444
  position: relative;
1463
- `,iv=()=>{const{serviceMapApi:e}=yr(),{data:n,refetch:o}=e.useServiceMap({pollInterval:5e3,fetchPolicy:"cache-and-network"});return t(Nb,{serviceMap:n?.serviceMap??[],children:t(ov,{children:t(nv,{onRefresh:o})})})},av=b.div`
1445
+ `,Zb=()=>{const{serviceMapApi:e}=yr(),{data:n,refetch:o}=e.useServiceMap({pollInterval:5e3,fetchPolicy:"cache-and-network"});return t(xb,{serviceMap:n?.serviceMap??[],children:t(qb,{children:t(Jb,{onRefresh:o})})})},Qb=b.div`
1464
1446
  display: flex;
1465
1447
  align-items: center;
1466
1448
  justify-content: space-between;
1467
1449
  padding: 0 12px;
1468
- `,lv=b.div`
1450
+ `,ev=b.div`
1469
1451
  display: flex;
1470
1452
  align-items: center;
1471
1453
  gap: 8px;
1472
- `,rv=b.div`
1454
+ `,tv=b.div`
1473
1455
  width: 1px;
1474
1456
  height: 20px;
1475
1457
  background-color: ${({theme:e})=>e.v2.colors.silver[500]};
1476
- `,sv=({disabled:n,loading:o,onClickShowYaml:a,onClickReset:r,onClickRefresh:s})=>{const c=v(),[d,p]=l(!1),u=i(()=>a?[{id:So(),type:bn.Button,buttonProps:{label:"Show Config YAML",leftIcon:Gl,size:ke.S,variant:Ie.Secondary,onClick:a,disabled:n}}]:[],[a,n]),h=i(()=>{const e=[];return s&&e.push({id:So(),type:bn.Button,buttonProps:{leftIcon:gl,tooltip:"Refresh",hideTooltipIcon:!0,size:ke.S,variant:Ie.Text,onClick:s,disabled:n,loading:o}}),r&&e.push({id:So(),type:bn.Button,buttonProps:{leftIcon:Ua,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(av,{children:[t(fa,{icon:fl,title:"Odigos Settings"}),e(lv,{children:[m&&t(ba,{actions:u}),m&&g&&t(rv,{}),g&&t(ba,{actions:h})]}),t(nt,{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)}}})]})},cv=b(ae)`
1458
+ `,nv=({disabled:n,loading:o,onClickShowYaml:a,onClickReset:r,onClickRefresh:s})=>{const c=v(),[d,p]=l(!1),u=i(()=>a?[{id:So(),type:bn.Button,buttonProps:{label:"Show Config YAML",leftIcon:Gl,size:ke.S,variant:Ie.Secondary,onClick:a,disabled:n}}]:[],[a,n]),h=i(()=>{const e=[];return s&&e.push({id:So(),type:bn.Button,buttonProps:{leftIcon:gl,tooltip:"Refresh",hideTooltipIcon:!0,size:ke.S,variant:Ie.Text,onClick:s,disabled:n,loading:o}}),r&&e.push({id:So(),type:bn.Button,buttonProps:{leftIcon:Ua,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(Qb,{children:[t(fa,{icon:fl,title:"Odigos Settings"}),e(ev,{children:[m&&t(ba,{actions:u}),m&&g&&t(tv,{}),g&&t(ba,{actions:h})]}),t(nt,{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)}}})]})},ov=b(ae)`
1477
1459
  width: 220px;
1478
1460
  flex-shrink: 0;
1479
1461
  height: 100%;
1480
1462
  gap: 4px;
1481
1463
  overflow-y: auto;
1482
- `,dv=({options:e,selected:n,setSelected:o,disabled:i})=>t(cv,{children:e.map(e=>t(ss,{dataId:`settings-nav-${e.id}`,title:e.label,isSelected:n===e.id,disabled:i,onClick:()=>o(e.id)},e.id))}),pv=b(ae)`
1464
+ `,iv=({options:e,selected:n,setSelected:o,disabled:i})=>t(ov,{children:e.map(e=>t(ss,{dataId:`settings-nav-${e.id}`,title:e.label,isSelected:n===e.id,disabled:i,onClick:()=>o(e.id)},e.id))}),av=b(ae)`
1483
1465
  width: 100%;
1484
1466
  /* side menu (220) + gap (24) + form (600) = 844, so content fills exactly with no dead space */
1485
1467
  max-width: 844px;
@@ -1489,25 +1471,25 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
1489
1471
  gap: 24px;
1490
1472
  flex: 1;
1491
1473
  min-height: 0;
1492
- `,uv=b(oe)`
1474
+ `,lv=b(oe)`
1493
1475
  flex: 1;
1494
1476
  min-height: 0;
1495
1477
  width: 100%;
1496
1478
  align-self: stretch;
1497
- `,hv=b(ae)`
1479
+ `,rv=b(ae)`
1498
1480
  flex: 1;
1499
1481
  min-height: 0;
1500
1482
  height: 100%;
1501
1483
  max-width: 600px;
1502
1484
  overflow-y: auto;
1503
- `,mv=b(oe)`
1485
+ `,sv=b(oe)`
1504
1486
  gap: 8px;
1505
1487
  width: 100%;
1506
1488
  align-items: center;
1507
- `,gv=b.div`
1489
+ `,cv=b.div`
1508
1490
  flex: 1;
1509
1491
  min-width: 0;
1510
- `,fv=e=>"general"===e.name?0:"advanced"===e.name?2:1,bv=({minSupportedVersion:o})=>{const{isVersionSupported:r,version:s,isEnterprise:c,minSupportedVersion:d}=S(o),{configApi:p}=yr(),{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}=qt(C);a(()=>{"{}"!==JSON.stringify(C)&&"{}"===JSON.stringify(x)&&w(void 0,void 0,C)},[C,x]);const E=i(()=>[...b].sort((e,t)=>fv(e)-fv(t)),[b]),N=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===jt.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:So(),type:bn.Button,buttonProps:{"data-id":"settings-save",variant:Ie.Primary,size:ke.S,label:"Save Changes",leftIcon:nl,loading:v,onClick:()=>R(!0)}},{id:So(),type:bn.Button,buttonProps:{"data-id":"settings-cancel",variant:Ie.Secondary,size:ke.S,label:"Cancel",leftIcon:ol,onClick:()=>w(void 0,void 0,C)}}],[v,k,C,x,w]),L=i(()=>E.map(e=>({id:e.name,label:e.displayName})),[E]),F=i(()=>E.map(e=>e.name),[E]),{selectedSection:M,setSelectedSection:z,setSectionRef:X,setScrollContainerRef:B}=za({sectionNames:F});return t(Wi,{$gap:24,children:e(pv,{children:[t(sv,{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(wa,{children:[!r&&t(fr,{minSupportedVersion:d,currentVersion:s||""}),t(Hn,{isOpen:I,richTitle:{icon:fl,title:"Config Settings"},actions:P}),t(nt,{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(uv,{$gap:24,$alignItems:"stretch",children:[!!b.length&&t(dv,{options:L,selected:M,setSelected:z,disabled:!r}),t(hv,{ref:B,$gap:24,$width:"100%",children:b.length?E.map(o=>t(ht,{id:o.name,bordered:!0,ref:e=>X(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&&!Qt(o.renderCondition,[],$))return null;const i=It(o.componentProps||"{}",{}),a=N[o.helmValuePath],l=o.componentType===jt.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(br,{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:Ot.S},o.helmValuePath),m=o.isHelmOnly?t(Ue,{text:"This field can only be updated via the Helm values.yaml file",children:t(Kl,{})}):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(mv,{children:[t(gv,{children:h}),m]})]})},o.helmValuePath)})})},o.name)):h?t(bt,{$height:"30vh",children:t(xt,{withSpinner:!0})}):t(ht,{richTitle:{icon:fl,title:"Config Settings"},children:t($e,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})})]}),t(Xt,{isOpen:D,width:"40vw",minWidth:"480px",header:{icon:Gl,title:"Effective Config YAML",onClose:()=>_(!1)},children:g&&!m?.manifestYAML?t(bt,{$height:"30vh",children:t(xt,{withSpinner:!0})}):t(hr,{yaml:m?.manifestYAML?.replaceAll(" |",""),defaultOpen:!0,fullHeight:!0})})]})]})})},vv=b.div`
1492
+ `,dv=e=>"general"===e.name?0:"advanced"===e.name?2:1,pv=({minSupportedVersion:o})=>{const{isVersionSupported:r,version:s,isEnterprise:c,minSupportedVersion:d}=S(o),{configApi:p}=yr(),{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}=qt(C);a(()=>{"{}"!==JSON.stringify(C)&&"{}"===JSON.stringify(x)&&w(void 0,void 0,C)},[C,x]);const N=i(()=>[...b].sort((e,t)=>dv(e)-dv(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===jt.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,P]=l(!1),_=i(()=>[{id:So(),type:bn.Button,buttonProps:{"data-id":"settings-save",variant:Ie.Primary,size:ke.S,label:"Save Changes",leftIcon:nl,loading:v,onClick:()=>R(!0)}},{id:So(),type:bn.Button,buttonProps:{"data-id":"settings-cancel",variant:Ie.Secondary,size:ke.S,label:"Cancel",leftIcon:ol,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:X,setScrollContainerRef:B}=za({sectionNames:F});return t(Wi,{$gap:24,children:e(av,{children:[t(nv,{disabled:!r,loading:h||g,onClickShowYaml:()=>P(!0),onClickReset:async()=>{await(async()=>{p.resetLocalUiConfigToDefaults&&await p.resetLocalUiConfigToDefaults()})(),await(f?.()),w(void 0,void 0,{})},onClickRefresh:f?()=>f():void 0}),e(wa,{children:[!r&&t(fr,{minSupportedVersion:d,currentVersion:s||""}),t(Hn,{isOpen:I,richTitle:{icon:fl,title:"Config Settings"},actions:_}),t(nt,{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(lv,{$gap:24,$alignItems:"stretch",children:[!!b.length&&t(iv,{options:L,selected:M,setSelected:z,disabled:!r}),t(rv,{ref:B,$gap:24,$width:"100%",children:b.length?N.map(o=>t(ht,{id:o.name,bordered:!0,ref:e=>X(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&&!Qt(o.renderCondition,[],$))return null;const i=It(o.componentProps||"{}",{}),a=E[o.helmValuePath],l=o.componentType===jt.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:_e.Warning,label:"Edited in UI",tooltip:`Reconciled from ${e}`}:"odigos-configuration"===e?{status:_e.Unknown,useSecondaryTone:!0,label:"Cluster config",tooltip:`Reconciled from ${e}`}:{status:_e.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(br,{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:Ot.S},o.helmValuePath),m=o.isHelmOnly?t(Ue,{text:"This field can only be updated via the Helm values.yaml file",children:t(Kl,{})}):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(sv,{children:[t(cv,{children:h}),m]})]})},o.helmValuePath)})})},o.name)):h?t(bt,{$height:"30vh",children:t(xt,{withSpinner:!0})}):t(ht,{richTitle:{icon:fl,title:"Config Settings"},children:t($e,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})})]}),t(Xt,{isOpen:D,width:"40vw",minWidth:"480px",header:{icon:Gl,title:"Effective Config YAML",onClose:()=>P(!1)},children:g&&!m?.manifestYAML?t(bt,{$height:"30vh",children:t(xt,{withSpinner:!0})}):t(hr,{yaml:m?.manifestYAML?.replaceAll(" |",""),defaultOpen:!0,fullHeight:!0})})]})]})})},uv=b.div`
1511
1493
  position: fixed;
1512
1494
  bottom: 12px;
1513
1495
  left: 12px;
@@ -1516,4 +1498,4 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
1516
1498
  flex-direction: column-reverse;
1517
1499
  gap: 6px;
1518
1500
  max-width: 600px;
1519
- `,yv=()=>{const{notifications:e,markAsDismissed:n,markAsSeen:o}=nn(),i=e.filter(({dismissed:e})=>!e);return t(vv,{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{tc as AddActionDrawer,Rs as AddActionForm,Sm as AddDataStreamModal,pc as AddDestinationDrawer,_s as AddDestinationForm,uc as AddRuleDrawer,Us as AddRuleForm,Nc as AddSourceDrawer,Ng as CentralConnections,bp as CloudConnectorStep,Cp as CreateCloudConnectorDrawer,Sg as CreateNewType,Hs as DataStreamForm,Vs as DataStreamMergeWarning,wp as EditActionDrawer,Tp as EditConfigDrawer,xm as EditDataStreamModal,Ip as EditDestinationDrawer,Np as EditRuleDrawer,Qh as EditSourceDrawer,js as EditSourceForm,Ug as Onboarding,km as OnboardingDone,Yf as Overview,sb as PipelineCollectors,Yl as RegexTesterDrawer,yg as SamplingOnboardingModal,pm as SamplingRuleDrawer,qs as SamplingRuleForm,gb as SamplingRules,iv as ServiceMap,bv as Settings,Cm as SystemDrawer,rb as TABS,yv as ToastList};
1501
+ `,hv=()=>{const{notifications:e,markAsDismissed:n,markAsSeen:o}=nn(),i=e.filter(({dismissed:e})=>!e);return t(uv,{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(Pe,{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{tc as AddActionDrawer,Rs as AddActionForm,gm as AddDataStreamModal,pc as AddDestinationDrawer,Ps as AddDestinationForm,uc as AddRuleDrawer,Us as AddRuleForm,Ec as AddSourceDrawer,xg as CentralConnections,pp as CloudConnectorStep,mp as CreateCloudConnectorDrawer,gg as CreateNewType,Hs as DataStreamForm,Vs as DataStreamMergeWarning,bp as EditActionDrawer,vp as EditConfigDrawer,fm as EditDataStreamModal,Cp as EditDestinationDrawer,xp as EditRuleDrawer,Wh as EditSourceDrawer,js as EditSourceForm,Lg as Onboarding,ym as OnboardingDone,Vf as Overview,nb as PipelineCollectors,Yl as RegexTesterDrawer,hg as SamplingOnboardingModal,am as SamplingRuleDrawer,qs as SamplingRuleForm,cb as SamplingRules,Zb as ServiceMap,pv as Settings,mm as SystemDrawer,tb as TABS,hv as ToastList};