@odigos/ui-kit 0.0.241 → 0.0.242

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.
@@ -1,4 +1,4 @@
1
- import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect as n,Fragment as a,forwardRef as i,useState as l,useImperativeHandle as s,useMemo as r,useCallback as c,useRef as d,Children as u,useContext as p,useLayoutEffect as h,createContext as m}from"react";import g,{useTheme as f,css as b,keyframes as v}from"styled-components";import{u as y,n as C,C as S,d as w,b as x,c as k,S as T,f as $,e as I,a as N,r as E,h as A,i as O,j as D,k as R,l as F,m as P,o as L,p as _,q as M,s as z,t as B}from"../chunks/helpers-L572q0MU.js";import{y as X,F as V,$ as U,a0 as H,a1 as j,a2 as W,a3 as G,G as K,a4 as Y,a5 as J,a6 as q,a7 as Z,a8 as Q,p as ee,h as te,a9 as oe,aa as ne,ab as ae,R as ie,z as le,N as se,b as re,c as ce,ac as de,ad as ue,ae as pe,af as he,ag as me,S as ge,M as fe,Q as be,L as ve,ah as ye,ai as Ce,aj as Se,ak as we,V as xe,al as ke,X as Te,Y as $e,W as Ie,Z as Ne,am as Ee,an as Ae,ao as Oe,ap as De,D as Re,H as Fe,aq as Pe,ar as Le,as as _e,at as Me,au as ze,av as Be,aw as Xe,ax as Ve,ay as Ue,az as He,i as je,A as We,x as Ge,aA as Ke,K as Ye,aB as Je,aC as qe,aD as Ze,aE as Qe,aF as et,aG as tt,w as ot,O as nt,q as at,U as it,E as lt,aH as st,T as rt,aI as ct,aJ as dt,aK as ut,aL as pt,aM as ht,aN as mt,aO as gt,o as ft,aP as bt,aQ as vt,aR as yt,aS as Ct,aT as St,v as wt,aU as xt,aV as kt,aW as Tt,aX as $t,d as It,B as Nt,aY as Et,aZ as At,f as Ot,a_ as Dt,a$ as Rt,b0 as Ft,b1 as Pt,b2 as Lt,b3 as _t,b4 as Mt,b5 as zt,b6 as Bt,b7 as Xt,b8 as Vt,b9 as Ut,ba as Ht,bb as jt,l as Wt,m as Gt,bc as Kt,bd as Yt,be as Jt,bf as qt,bg as Zt,bh as Qt,bi as eo,bj as to,bk as oo,bl as no,bm as ao,bn as io,bo as lo,bp as so,bq as ro,_ as co,br as uo,bs as po,bt as ho,bu as mo,bv as go,bw as fo,bx as bo,by as vo,bz as yo,bA as Co,bB as So,bC as wo,bD as xo,bE as ko,bF as To,bG as $o,bH as Io,bI as No,bJ as Eo,bK as Ao,bL as Oo,bM as Do,bN as Ro,bO as Fo,bP as Po,bQ as Lo,bR as _o,bS as Mo,bT as zo,bU as Bo,bV as Xo,bW as Vo,bX as Uo,bY as Ho,bZ as jo,b_ as Wo,b$ as Go,c0 as Ko,c1 as Yo,c2 as Jo,c3 as qo,c4 as Zo,c5 as Qo,c6 as en,c7 as tn,c8 as on,c9 as nn,ca as an,cb as ln,cc as sn,cd as rn,ce as cn,cf as dn,cg as un,ch as pn,ci as hn,cj as mn,ck as gn,cl as fn,cm as bn,cn as vn,co as yn,cp as Cn,cq as Sn,cr as wn,cs as xn,ct as kn,cu as Tn,cv as $n,cw as In,cx as Nn,cy as En,cz as An,cA as On,cB as Dn,cC as Rn,cD as Fn,cE as Pn,cF as Ln,cG as _n,cH as Mn,cI as zn,cJ as Bn,cK as Xn,cL as Vn,cM as Un,cN as Hn,cO as jn,cP as Wn,cQ as Gn,cR as Kn,cS as Yn,cT as Jn,cU as qn,cV as Zn,cW as Qn,cX as ea,cY as ta,cZ as oa,c_ as na,c$ as aa,d0 as ia,d1 as la,d2 as sa,d3 as ra,d4 as ca,d5 as da,d6 as ua,d7 as pa,d8 as ha,d9 as ma,da as ga,db as fa,dc as ba,dd as va,de as ya,j as Ca,df as Sa,dg as wa,n as xa,dh as ka,di as Ta,dj as $a,dk as Ia,dl as Na,dm as Ea,dn as Aa,dp as Oa,dq as Da,dr as Ra,ds as Fa,dt as Pa,du as La,dv as _a,dw as Ma,dx as za,dy as Ba,dz as Xa,dA as Va,dB as Ua,dC as Ha,dD as ja,dE as Wa,dF as Ga,dG as Ka,dH as Ya,dI as Ja,dJ as qa,dK as Za,dL as Qa,dM as ei,dN as ti,dO as oi}from"../chunks/ui-components-DeKNGyn7.js";import{TrashIcon as ni,PlusIcon as ai,BookIcon as ii,VSquareIcon as li,XSquareIcon as si,DeleteIcon as ri,EditIcon as ci,GoLogo as di,JavaLogo as ui,ChevronRightIcon as pi,ActionIcon as hi,DestinationIcon as mi,ChevronUpIcon as gi,ChevronDownIcon as fi,VIcon as bi,XIcon as vi,InstrumentationRuleIcon as yi,SourceIcon as Ci,NamespacesIcon as Si,SettingsIcon as wi,PodIcon as xi,OdigosLogo as ki,K8sLogo as Ti,RefreshIcon as $i,ExclamationCircleIcon as Ii,QuestionCircleIcon as Ni,InboundIcon as Ei,OutboundIcon as Ai,UserIcon as Oi,ExpandIcon as Di,SearchIcon as Ri,MinusIcon as Fi,CopyIcon as Pi,DotIcon as Li,DownloadIcon as _i,RefreshLeftArrowIcon as Mi,SamplingIcon as zi,ExclamationTriangleIcon as Bi,KeyIcon as Xi,DiagnoseIcon as Vi,TerminalIcon as Ui,ArrowRightIcon as Hi,StarIcon as ji,ArrowIcon as Wi,ConnectionsIcon as Gi,FilterIcon as Ki,DataStreamIcon as Yi,PipelineCollectorIcon as Ji,ArrowDownSquareIcon as qi,ArrowUpSquareIcon as Zi,GatewayIcon as Qi,YamlIcon as el}from"../icons.js";import{S as tl,D as ol,A as nl,P as al,a as il,b as ll,R as sl,c as rl,O as cl,d as dl,e as ul,f as pl,W as hl,g as ml,C as gl,Y as fl,h as bl,i as vl,U as yl}from"../chunks/index-DHcHiz_q.js";import{u as Cl,f as Sl,g as wl,e as xl,i as kl,h as Tl,S as $l,k as Il,E as Nl,l as El,m as Al,j as Ol,b as Dl,d as Rl,a as Fl,A as Pl,R as Ll,c as _l,D as Ml}from"../chunks/source-instrument-form-context-vq8DFX7f.js";import{createPortal as zl}from"react-dom";import"zustand";import"javascript-time-ago";import"../chunks/vendor-Be0cOokr.js";import"prism-react-renderer";import"react-error-boundary";import"virtua";const Bl=[{id:"CREDIT_CARD",label:"Credit card"}],Xl=[{id:X.CollectContainerAttributes,label:"Collect container attributes"},{id:X.CollectReplicaSetAttributes,label:"Collect ReplicaSet attributes"},{id:X.CollectWorkloadId,label:"Collect workload ID"},{id:X.CollectClusterId,label:"Collect cluster ID"}],Vl=[{id:J.Pod,label:J.Pod},{id:J.Namespace,label:J.Namespace},{id:J.Node,label:J.Node}],Ul=[{label:"Label key",keyName:"labelKey",placeholder:"app.kubernetes.io/name"},{label:"Attribute key",keyName:"attributeKey",placeholder:"app.kubernetes.name"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:Vl}],Hl=[{label:"Annotation key",keyName:"annotationKey",placeholder:"kubectl.kubernetes.io/restartedAt"},{label:"Attribute key",keyName:"attributeKey",placeholder:"kubectl.kubernetes.restartedAt"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:Vl}],jl=[{label:"Service",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Service name: The rule applies to a specific service name. Only traces originating from this service’s root span will be considered."},{label:"HTTP route",keyName:"httpRoute",placeholder:"e.g. /api/v1/users",tooltip:"HTTP route: The specific HTTP route prefix to match for sampling. Only traces with routes beginning with this prefix will be considered. For instance, configuring /buy will also match /buy/product."},{label:"Threshold",keyName:"minimumLatencyThreshold",placeholder:"e.g. 1000",tooltip:"Minimum latency threshold (ms): Specifies the minimum latency in milliseconds; traces with latency below this threshold are ignored.",inputType:G.Number,min:0},{label:"Fallback",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Fallback sampling ratio: Specifies the percentage of traces that meet the service/http_route filter but fall below the threshold that you still want to retain. For example, if a rule is set for service A and http_route B with a minimum latency threshold of 1 second, you might still want to keep some traces below this threshold. Setting the ratio to 20% ensures that 20% of these traces will be retained.",inputType:G.Number,min:0,max:100}],Wl=X.UrlTemplatizationRulesGroups,Gl=[{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"}],Kl=[{label:"Service name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (Across all available spans)."},{label:"Sampling ratio",keyName:"samplingRatio",placeholder:"e.g. 10",tooltip:"Specifies the sample rate for all traces.",inputType:G.Number,min:0,max:100},{label:"Fallback sampling ratio",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Specifies the percentage of traces that don’t meet the service name filter and that you still like to retain.",inputType:G.Number,min:0,max:100}],Yl=[{label:"Service name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (across all available spans)."},{label:"Attribute key",keyName:"attributeKey",placeholder:"e.g. http.request.method",tooltip:"Specifies the attribute key inside of the span."},{label:"Fallback sampling ratio",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Specifies the percentage of traces that don’t meet the service name filter and that you still like to retain.",inputType:G.Number,min:0,max:100},{label:"Condition",keyName:"condition",tooltip:"An object representing the filters for span attributes filters.",componentType:ie.Dropdown,options:[{id:"stringCondition",label:"String condition"},{id:"numberCondition",label:"Number condition"},{id:"booleanCondition",label:"Boolean condition"},{id:"jsonCondition",label:"JSON condition"}]},{label:"Operation",keyName:"operation",tooltip:"Specifies the operation to run against the attribute.",componentType:ie.Dropdown,options:[{id:"exists",label:"Exists"},{id:"equals",label:"Equals"},{id:"not_equals",label:"Not equals"},{id:"contains",label:"Contains"},{id:"not_contains",label:"Not contains"},{id:"regex",label:"Regex"},{id:"greater_than",label:"Greater than"},{id:"less_than",label:"Less than"},{id:"greater_than_or_equal",label:"Greater than or equal"},{id:"less_than_or_equal",label:"Less than or equal"},{id:"is_valid_json",label:"Is valid JSON"},{id:"is_invalid_json",label:"Is invalid JSON"},{id:"jsonpath_exists",label:"JSON path exists"},{id:"key_equals",label:"Key equals"},{id:"key_not_equals",label:"Key not equals"}]},{label:"Expected value",keyName:"expectedValue",placeholder:"e.g. GET",tooltip:"The values to test the attribute against."},{label:"JSON path",keyName:"jsonPath",placeholder:"e.g. $.user.role",tooltip:"An expression used to navigate the JSON structure.",renderCondition:e=>"jsonCondition"===e.condition}],Jl={[le.K8sAttributes]:({value:a,setValue:i,formErrors:l})=>(n(()=>{a[X.CollectContainerAttributes]||a[X.CollectReplicaSetAttributes]||a[X.CollectWorkloadId]||a[X.CollectClusterId]||a[X.LabelsAttributes]?.length||a[X.AnnotationsAttributes]?.length||(i(X.CollectContainerAttributes,!0),i(X.CollectReplicaSetAttributes,!0),i(X.CollectWorkloadId,!0),i(X.CollectClusterId,!0),i(X.LabelsAttributes,[]),i(X.AnnotationsAttributes,[]))},[]),e(o,{children:[t(V,{$gap:6,children:Xl.map(({id:o,label:n})=>e(V,{children:[t(H,{label:n,value:a[o]||!1,onChange:e=>i(o,e)}),t(j,{errorMessage:l[o]})]},o))}),t(Y,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:Ul,values:a[X.LabelsAttributes]||[],setValues:e=>i(X.LabelsAttributes,e),errorMessage:l[X.LabelsAttributes]}),t(Y,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:Hl,values:a[X.AnnotationsAttributes]||[],setValues:e=>i(X.AnnotationsAttributes,e),errorMessage:l[X.AnnotationsAttributes]})]})),[le.AddClusterInfo]:({value:n,setValue:a,formErrors:i})=>{const l=f();return e(o,{children:[t(q,{label:"Overwrite existing values",labelAlign:Z.Left,labelColor:l.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:n[X.OverwriteExistingValues]||!1,onChange:e=>a(X.OverwriteExistingValues,e)}),t(Y,{name:"clusterAttributes",label:"Resource attributes",limitFieldsPerRow:2,columns:[{keyName:"attributeName",label:"Attribute name"},{keyName:"attributeStringValue",label:"Attribute value"}],values:n[X.ClusterAttributes]||[],setValues:e=>a(X.ClusterAttributes,e),errorMessage:i[X.ClusterAttributes]})]})},[le.DeleteAttributes]:({value:e,setValue:o,formErrors:n})=>t(Q,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[X.AttributeNamesToDelete]||[],setValues:e=>o(X.AttributeNamesToDelete,e),errorMessage:n[X.AttributeNamesToDelete]}),[le.RenameAttributes]:({value:e,setValue:o,formErrors:n})=>t(Y,{name:"renames",label:"Attributes to rename",limitFieldsPerRow:2,columns:[{keyName:"oldKey",label:"Old key"},{keyName:"newKey",label:"New key"}],values:Object.entries(e[X.Renames]||{}).map(([e,t])=>({oldKey:e,newKey:t})),setValues:e=>{const t={};e.forEach(e=>t[e.oldKey]=e.newKey),o(X.Renames,t)},errorMessage:n[X.Renames]}),[le.PiiMasking]:({value:o,setValue:a,formErrors:i})=>(n(()=>{o[X.PiiCategories]?.length||a(X.PiiCategories,Bl.map(({id:e})=>e))},[]),e(V,{$gap:12,children:[t(U,{label:"Attributes to mask"}),t(V,{$gap:6,children:Bl.map(({id:e,label:n})=>t(H,{label:n,value:o[X.PiiCategories]?.includes(e)||!1,onChange:t=>{const n=o[X.PiiCategories]||[],i=t?[...n,e]:n.filter(t=>t!==e);a(X.PiiCategories,i)}},e))}),t(j,{errorMessage:i[X.PiiCategories]})]})),[le.ErrorSampler]:({value:e,setValue:o,formErrors:n})=>{const a=n[X.FallbackSamplingRatio],i=K(e[X.FallbackSamplingRatio])?"":String(e[X.FallbackSamplingRatio]);return t(W,{name:"fallbackSamplingRatio",label:"Fallback sampling ratio",type:G.Number,min:0,max:100,value:i,placeholder:"0-100",onChange:e=>{return t=e.target.value,o(X.FallbackSamplingRatio,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:a})},[le.ProbabilisticSampler]:({value:e,setValue:o,formErrors:n})=>{const a=n[X.SamplingPercentage],i=K(e[X.SamplingPercentage])?"":String(e[X.SamplingPercentage]);return t(W,{name:"samplingPercentage",label:"Sampling percentage",type:G.Number,min:0,max:100,value:i,placeholder:"0-100",onChange:e=>{return t=e.target.value,o(X.SamplingPercentage,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:a})},[le.LatencySampler]:({value:e,setValue:o,formErrors:n})=>{const a=n[X.EndpointsFilters],i=e[X.EndpointsFilters]||[];return t(Y,{name:"endpointsFilters",limitFieldsPerRow:2,columns:jl,values:i,setValues:e=>{o(X.EndpointsFilters,e.map(({serviceName:e,httpRoute:t,minimumLatencyThreshold:o,fallbackSamplingRatio:n})=>({serviceName:e,httpRoute:t,minimumLatencyThreshold:Number(o),fallbackSamplingRatio:Number(n)})))},errorMessage:a})},[le.ServiceNameSampler]:({value:e,setValue:o,formErrors:n})=>{const a=n[X.ServicesNameFilters],i=e[X.ServicesNameFilters]||[];return t(Y,{name:"servicesNameFilters",limitFieldsPerRow:2,columns:Kl,values:i,setValues:e=>{o(X.ServicesNameFilters,e.map(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:o})=>({serviceName:e,samplingRatio:Number(t),fallbackSamplingRatio:Number(o)})))},errorMessage:a})},[le.SpanAttributeSampler]:({value:e,setValue:o,formErrors:n})=>{const a=n[X.AttributeFilters],i=(e[X.AttributeFilters]||[]).map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:o,condition:n})=>{const a=Object.entries(n).filter(([e,t])=>t)[0][0];return{serviceName:e,attributeKey:t,fallbackSamplingRatio:o,condition:a,operation:n[a]?.operation,expectedValue:n[a]?.expectedValue,jsonPath:n[a]?.jsonPath}});return t(Y,{name:"attributeFilters",limitFieldsPerRow:2,columns:Yl,values:i,setValues:e=>{o(X.AttributeFilters,e.map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:o,condition:n,operation:a,expectedValue:i,jsonPath:l})=>{const s={serviceName:e,attributeKey:t,fallbackSamplingRatio:Number(o),condition:{[n]:{operation:a,expectedValue:i}}};return l&&(s.condition[n].jsonPath=l),s}))},errorMessage:a})},[le.URLTemplatization]:({value:n,setValue:i,formErrors:l})=>{const s=f(),r=n[Wl]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>i(Wl,e),d=(e,t)=>c(r.map((o,n)=>n===e?{...o,...t}:o));return e(o,{children:[r.map((o,n)=>e(a,{children:[t(ee,{}),e(V,{$gap:12,children:[e(te,{$justifyContent:"space-between",$alignItems:"center",children:[t(U,{label:`Rule Group ${n+1}`}),t(oe,{leftIcon:()=>t(ni,{fill:s.v2.colors.red[500]}),variant:ae.Secondary,size:ne.S,onClick:()=>{return e=n,c(r.filter((t,o)=>o!==e));var e},disabled:1===r.length})]}),t(W,{name:`urlGroup-${n}-namespace`,label:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:o.filterK8sNamespace||"",onChange:e=>d(n,{filterK8sNamespace:e.target.value})}),t(Y,{name:`urlGroup-${n}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:Gl,values:o.workloadFilters||[],setValues:e=>d(n,{workloadFilters:e})}),t(Q,{name:`urlGroup-${n}-templates`,label:"Templates",required:!0,placeholder:"e.g. /user/{id}",values:o.templatizationRules.map(e=>e.template),setValues:e=>d(n,{templatizationRules:e.map(e=>({template:e}))})})]}),t(j,{errorMessage:l[Wl]})]},`url-templatization-group-${n}`)),t(oe,{variant:ae.Secondary,label:"Add rule group",leftIcon:ai,onClick:()=>c([...r,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(ee,{})]})}},ql=({actionType:e,value:o,setValue:n,formErrors:a})=>{if(!e)return null;const i=Jl[e];return i?t(i,{value:o,setValue:n,formErrors:a}):null},Zl=()=>{const o=f(),{selectedOption:n,genericForm:a}=Cl();if(!a||!n)return t(se,{title:"No active form"});const{formData:i,handleFormChange:l,formErrors:s}=a;return e(V,{$gap:24,children:[e(te,{$gap:12,$justifyContent:"space-between",children:[t(re,{size:ce.XXS,children:n.docsDescription}),t(oe,{label:"Docs",leftIcon:ii,variant:ae.Text,size:ne.S,onClick:()=>window.open(`${de}${n.docsEndpoint}`,"_blank","noopener noreferrer")})]}),t(ue,{options:[{icon:li,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:si,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],selected:i.disabled,setSelected:e=>l("disabled",e)}),t(tl,{title:"Signals for processing",allowedSignals:n.allowedSignals,selectedSignals:i.signals||[],setSelectedSignals:e=>l("signals",e),errorMessage:s.signals}),t(W,{name:"actionName",label:"Action name",placeholder:"Use a name that describes the action...",value:i.name||"",onChange:({target:{value:e}})=>l("name",e),errorMessage:s.name}),t(ql,{actionType:n.type,value:i.fields,setValue:(e,t)=>l(`fields.${e}`,t),formErrors:s}),t(pe,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:i.notes||"",onChange:({target:{value:e}})=>l("notes",e),errorMessage:s.notes})]})},Ql=({signals:e,fields:o,disabled:n,formData:a,handleFormChange:i,formErrors:l})=>o?.map(({renderCondition:o,componentType:s,type:r,name:c,title:d,tooltip:u,placeholder:p,value:h,required:m,options:g})=>{if(!(!o||he(o,e,a.fields)))return null;const f=c,b=a.fields.find(e=>e.key===f),v=b?b.value:h;return t(ol,{componentType:s,inputType:r,name:f,label:d,tooltip:u,disabled:n,required:m,placeholder:p,errorMessage:l[f],dropdownOptions:g,value:v||"",setValue:e=>i(f,e)},f)}),es=g(te)`
1
+ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect as n,Fragment as a,forwardRef as i,useState as l,useImperativeHandle as s,useMemo as r,useCallback as c,useRef as d,Children as u,useContext as p,useLayoutEffect as h,createContext as m}from"react";import g,{useTheme as f,css as b,keyframes as v}from"styled-components";import{u as y,n as C,C as S,d as w,b as x,c as k,S as T,f as $,e as I,a as N,r as E,h as A,i as O,j as D,k as R,l as F,m as P,o as L,p as _,q as M,s as B,t as z}from"../chunks/helpers-flEStb5l.js";import{y as X,F as V,$ as U,a0 as H,a1 as j,a2 as W,a3 as G,G as K,a4 as Y,a5 as J,a6 as q,a7 as Z,a8 as Q,p as ee,h as te,a9 as oe,aa as ne,ab as ae,R as ie,z as le,N as se,b as re,c as ce,ac as de,ad as ue,ae as pe,af as he,ag as me,S as ge,M as fe,Q as be,L as ve,ah as ye,ai as Ce,aj as Se,ak as we,V as xe,al as ke,X as Te,Y as $e,W as Ie,Z as Ne,am as Ee,an as Ae,ao as Oe,ap as De,D as Re,H as Fe,aq as Pe,ar as Le,as as _e,at as Me,au as Be,av as ze,aw as Xe,ax as Ve,ay as Ue,az as He,i as je,A as We,x as Ge,aA as Ke,K as Ye,aB as Je,aC as qe,aD as Ze,aE as Qe,aF as et,aG as tt,w as ot,O as nt,q as at,U as it,E as lt,aH as st,T as rt,aI as ct,aJ as dt,aK as ut,aL as pt,aM as ht,aN as mt,aO as gt,o as ft,aP as bt,aQ as vt,aR as yt,aS as Ct,aT as St,v as wt,aU as xt,aV as kt,aW as Tt,aX as $t,d as It,B as Nt,aY as Et,aZ as At,f as Ot,a_ as Dt,a$ as Rt,b0 as Ft,b1 as Pt,b2 as Lt,b3 as _t,b4 as Mt,b5 as Bt,b6 as zt,b7 as Xt,b8 as Vt,b9 as Ut,ba as Ht,bb as jt,l as Wt,m as Gt,bc as Kt,bd as Yt,be as Jt,bf as qt,bg as Zt,bh as Qt,bi as eo,bj as to,bk as oo,bl as no,bm as ao,bn as io,bo as lo,bp as so,bq as ro,_ as co,br as uo,bs as po,bt as ho,bu as mo,bv as go,bw as fo,bx as bo,by as vo,bz as yo,bA as Co,bB as So,bC as wo,bD as xo,bE as ko,bF as To,bG as $o,bH as Io,bI as No,bJ as Eo,bK as Ao,bL as Oo,bM as Do,bN as Ro,bO as Fo,bP as Po,bQ as Lo,bR as _o,bS as Mo,bT as Bo,bU as zo,bV as Xo,bW as Vo,bX as Uo,bY as Ho,bZ as jo,b_ as Wo,b$ as Go,c0 as Ko,c1 as Yo,c2 as Jo,c3 as qo,c4 as Zo,c5 as Qo,c6 as en,c7 as tn,c8 as on,c9 as nn,ca as an,cb as ln,cc as sn,cd as rn,ce as cn,cf as dn,cg as un,ch as pn,ci as hn,cj as mn,ck as gn,cl as fn,cm as bn,cn as vn,co as yn,cp as Cn,cq as Sn,cr as wn,cs as xn,ct as kn,cu as Tn,cv as $n,cw as In,cx as Nn,cy as En,cz as An,cA as On,cB as Dn,cC as Rn,cD as Fn,cE as Pn,cF as Ln,cG as _n,cH as Mn,cI as Bn,cJ as zn,cK as Xn,cL as Vn,cM as Un,cN as Hn,cO as jn,cP as Wn,cQ as Gn,cR as Kn,cS as Yn,cT as Jn,cU as qn,cV as Zn,cW as Qn,cX as ea,cY as ta,cZ as oa,c_ as na,c$ as aa,d0 as ia,d1 as la,d2 as sa,d3 as ra,d4 as ca,d5 as da,d6 as ua,d7 as pa,d8 as ha,d9 as ma,da as ga,db as fa,dc as ba,dd as va,de as ya,j as Ca,df as Sa,dg as wa,n as xa,dh as ka,di as Ta,dj as $a,dk as Ia,dl as Na,dm as Ea,dn as Aa,dp as Oa,dq as Da,dr as Ra,ds as Fa,dt as Pa,du as La,dv as _a,dw as Ma,dx as Ba,dy as za,dz as Xa,dA as Va,dB as Ua,dC as Ha,dD as ja,dE as Wa,dF as Ga,dG as Ka,dH as Ya,dI as Ja,dJ as qa,dK as Za,dL as Qa,dM as ei,dN as ti,dO as oi}from"../chunks/ui-components-DofONrt0.js";import{TrashIcon as ni,PlusIcon as ai,BookIcon as ii,VSquareIcon as li,XSquareIcon as si,DeleteIcon as ri,EditIcon as ci,GoLogo as di,JavaLogo as ui,ChevronRightIcon as pi,ActionIcon as hi,DestinationIcon as mi,ChevronUpIcon as gi,ChevronDownIcon as fi,VIcon as bi,XIcon as vi,InstrumentationRuleIcon as yi,SourceIcon as Ci,NamespacesIcon as Si,SettingsIcon as wi,PodIcon as xi,OdigosLogo as ki,K8sLogo as Ti,RefreshIcon as $i,ExclamationCircleIcon as Ii,QuestionCircleIcon as Ni,InboundIcon as Ei,OutboundIcon as Ai,UserIcon as Oi,ExpandIcon as Di,SearchIcon as Ri,MinusIcon as Fi,CopyIcon as Pi,DotIcon as Li,DownloadIcon as _i,RefreshLeftArrowIcon as Mi,SamplingIcon as Bi,ExclamationTriangleIcon as zi,KeyIcon as Xi,DiagnoseIcon as Vi,TerminalIcon as Ui,ArrowRightIcon as Hi,StarIcon as ji,ArrowIcon as Wi,ConnectionsIcon as Gi,FilterIcon as Ki,DataStreamIcon as Yi,PipelineCollectorIcon as Ji,ArrowDownSquareIcon as qi,ArrowUpSquareIcon as Zi,GatewayIcon as Qi,YamlIcon as el}from"../icons.js";import{S as tl,D as ol,A as nl,P as al,a as il,b as ll,R as sl,c as rl,O as cl,d as dl,e as ul,f as pl,W as hl,g as ml,C as gl,Y as fl,h as bl,i as vl,U as yl}from"../chunks/index-9imbvR3P.js";import{u as Cl,f as Sl,g as wl,e as xl,i as kl,h as Tl,S as $l,k as Il,E as Nl,l as El,m as Al,j as Ol,b as Dl,d as Rl,a as Fl,A as Pl,R as Ll,c as _l,D as Ml}from"../chunks/source-instrument-form-context-4oj79EpI.js";import{createPortal as Bl}from"react-dom";import"zustand";import"javascript-time-ago";import"../chunks/vendor-Be0cOokr.js";import"prism-react-renderer";import"react-error-boundary";import"virtua";const zl=[{id:"CREDIT_CARD",label:"Credit card"}],Xl=[{id:X.CollectContainerAttributes,label:"Collect container attributes"},{id:X.CollectReplicaSetAttributes,label:"Collect ReplicaSet attributes"},{id:X.CollectWorkloadId,label:"Collect workload ID"},{id:X.CollectClusterId,label:"Collect cluster ID"}],Vl=[{id:J.Pod,label:J.Pod},{id:J.Namespace,label:J.Namespace},{id:J.Node,label:J.Node}],Ul=[{label:"Label key",keyName:"labelKey",placeholder:"app.kubernetes.io/name"},{label:"Attribute key",keyName:"attributeKey",placeholder:"app.kubernetes.name"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:Vl}],Hl=[{label:"Annotation key",keyName:"annotationKey",placeholder:"kubectl.kubernetes.io/restartedAt"},{label:"Attribute key",keyName:"attributeKey",placeholder:"kubectl.kubernetes.restartedAt"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:Vl}],jl=[{label:"Service",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Service name: The rule applies to a specific service name. Only traces originating from this service’s root span will be considered."},{label:"HTTP route",keyName:"httpRoute",placeholder:"e.g. /api/v1/users",tooltip:"HTTP route: The specific HTTP route prefix to match for sampling. Only traces with routes beginning with this prefix will be considered. For instance, configuring /buy will also match /buy/product."},{label:"Threshold",keyName:"minimumLatencyThreshold",placeholder:"e.g. 1000",tooltip:"Minimum latency threshold (ms): Specifies the minimum latency in milliseconds; traces with latency below this threshold are ignored.",inputType:G.Number,min:0},{label:"Fallback",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Fallback sampling ratio: Specifies the percentage of traces that meet the service/http_route filter but fall below the threshold that you still want to retain. For example, if a rule is set for service A and http_route B with a minimum latency threshold of 1 second, you might still want to keep some traces below this threshold. Setting the ratio to 20% ensures that 20% of these traces will be retained.",inputType:G.Number,min:0,max:100}],Wl=X.UrlTemplatizationRulesGroups,Gl=[{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"}],Kl=[{label:"Service name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (Across all available spans)."},{label:"Sampling ratio",keyName:"samplingRatio",placeholder:"e.g. 10",tooltip:"Specifies the sample rate for all traces.",inputType:G.Number,min:0,max:100},{label:"Fallback sampling ratio",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Specifies the percentage of traces that don’t meet the service name filter and that you still like to retain.",inputType:G.Number,min:0,max:100}],Yl=[{label:"Service name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (across all available spans)."},{label:"Attribute key",keyName:"attributeKey",placeholder:"e.g. http.request.method",tooltip:"Specifies the attribute key inside of the span."},{label:"Fallback sampling ratio",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Specifies the percentage of traces that don’t meet the service name filter and that you still like to retain.",inputType:G.Number,min:0,max:100},{label:"Condition",keyName:"condition",tooltip:"An object representing the filters for span attributes filters.",componentType:ie.Dropdown,options:[{id:"stringCondition",label:"String condition"},{id:"numberCondition",label:"Number condition"},{id:"booleanCondition",label:"Boolean condition"},{id:"jsonCondition",label:"JSON condition"}]},{label:"Operation",keyName:"operation",tooltip:"Specifies the operation to run against the attribute.",componentType:ie.Dropdown,options:[{id:"exists",label:"Exists"},{id:"equals",label:"Equals"},{id:"not_equals",label:"Not equals"},{id:"contains",label:"Contains"},{id:"not_contains",label:"Not contains"},{id:"regex",label:"Regex"},{id:"greater_than",label:"Greater than"},{id:"less_than",label:"Less than"},{id:"greater_than_or_equal",label:"Greater than or equal"},{id:"less_than_or_equal",label:"Less than or equal"},{id:"is_valid_json",label:"Is valid JSON"},{id:"is_invalid_json",label:"Is invalid JSON"},{id:"jsonpath_exists",label:"JSON path exists"},{id:"key_equals",label:"Key equals"},{id:"key_not_equals",label:"Key not equals"}]},{label:"Expected value",keyName:"expectedValue",placeholder:"e.g. GET",tooltip:"The values to test the attribute against."},{label:"JSON path",keyName:"jsonPath",placeholder:"e.g. $.user.role",tooltip:"An expression used to navigate the JSON structure.",renderCondition:e=>"jsonCondition"===e.condition}],Jl={[le.K8sAttributes]:({value:a,setValue:i,formErrors:l})=>(n(()=>{a[X.CollectContainerAttributes]||a[X.CollectReplicaSetAttributes]||a[X.CollectWorkloadId]||a[X.CollectClusterId]||a[X.LabelsAttributes]?.length||a[X.AnnotationsAttributes]?.length||(i(X.CollectContainerAttributes,!0),i(X.CollectReplicaSetAttributes,!0),i(X.CollectWorkloadId,!0),i(X.CollectClusterId,!0),i(X.LabelsAttributes,[]),i(X.AnnotationsAttributes,[]))},[]),e(o,{children:[t(V,{$gap:6,children:Xl.map(({id:o,label:n})=>e(V,{children:[t(H,{label:n,value:a[o]||!1,onChange:e=>i(o,e)}),t(j,{errorMessage:l[o]})]},o))}),t(Y,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:Ul,values:a[X.LabelsAttributes]||[],setValues:e=>i(X.LabelsAttributes,e),errorMessage:l[X.LabelsAttributes]}),t(Y,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:Hl,values:a[X.AnnotationsAttributes]||[],setValues:e=>i(X.AnnotationsAttributes,e),errorMessage:l[X.AnnotationsAttributes]})]})),[le.AddClusterInfo]:({value:n,setValue:a,formErrors:i})=>{const l=f();return e(o,{children:[t(q,{label:"Overwrite existing values",labelAlign:Z.Left,labelColor:l.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:n[X.OverwriteExistingValues]||!1,onChange:e=>a(X.OverwriteExistingValues,e)}),t(Y,{name:"clusterAttributes",label:"Resource attributes",limitFieldsPerRow:2,columns:[{keyName:"attributeName",label:"Attribute name"},{keyName:"attributeStringValue",label:"Attribute value"}],values:n[X.ClusterAttributes]||[],setValues:e=>a(X.ClusterAttributes,e),errorMessage:i[X.ClusterAttributes]})]})},[le.DeleteAttributes]:({value:e,setValue:o,formErrors:n})=>t(Q,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[X.AttributeNamesToDelete]||[],setValues:e=>o(X.AttributeNamesToDelete,e),errorMessage:n[X.AttributeNamesToDelete]}),[le.RenameAttributes]:({value:e,setValue:o,formErrors:n})=>t(Y,{name:"renames",label:"Attributes to rename",limitFieldsPerRow:2,columns:[{keyName:"oldKey",label:"Old key"},{keyName:"newKey",label:"New key"}],values:Object.entries(e[X.Renames]||{}).map(([e,t])=>({oldKey:e,newKey:t})),setValues:e=>{const t={};e.forEach(e=>t[e.oldKey]=e.newKey),o(X.Renames,t)},errorMessage:n[X.Renames]}),[le.PiiMasking]:({value:o,setValue:a,formErrors:i})=>(n(()=>{o[X.PiiCategories]?.length||a(X.PiiCategories,zl.map(({id:e})=>e))},[]),e(V,{$gap:12,children:[t(U,{label:"Attributes to mask"}),t(V,{$gap:6,children:zl.map(({id:e,label:n})=>t(H,{label:n,value:o[X.PiiCategories]?.includes(e)||!1,onChange:t=>{const n=o[X.PiiCategories]||[],i=t?[...n,e]:n.filter(t=>t!==e);a(X.PiiCategories,i)}},e))}),t(j,{errorMessage:i[X.PiiCategories]})]})),[le.ErrorSampler]:({value:e,setValue:o,formErrors:n})=>{const a=n[X.FallbackSamplingRatio],i=K(e[X.FallbackSamplingRatio])?"":String(e[X.FallbackSamplingRatio]);return t(W,{name:"fallbackSamplingRatio",label:"Fallback sampling ratio",type:G.Number,min:0,max:100,value:i,placeholder:"0-100",onChange:e=>{return t=e.target.value,o(X.FallbackSamplingRatio,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:a})},[le.ProbabilisticSampler]:({value:e,setValue:o,formErrors:n})=>{const a=n[X.SamplingPercentage],i=K(e[X.SamplingPercentage])?"":String(e[X.SamplingPercentage]);return t(W,{name:"samplingPercentage",label:"Sampling percentage",type:G.Number,min:0,max:100,value:i,placeholder:"0-100",onChange:e=>{return t=e.target.value,o(X.SamplingPercentage,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:a})},[le.LatencySampler]:({value:e,setValue:o,formErrors:n})=>{const a=n[X.EndpointsFilters],i=e[X.EndpointsFilters]||[];return t(Y,{name:"endpointsFilters",limitFieldsPerRow:2,columns:jl,values:i,setValues:e=>{o(X.EndpointsFilters,e.map(({serviceName:e,httpRoute:t,minimumLatencyThreshold:o,fallbackSamplingRatio:n})=>({serviceName:e,httpRoute:t,minimumLatencyThreshold:Number(o),fallbackSamplingRatio:Number(n)})))},errorMessage:a})},[le.ServiceNameSampler]:({value:e,setValue:o,formErrors:n})=>{const a=n[X.ServicesNameFilters],i=e[X.ServicesNameFilters]||[];return t(Y,{name:"servicesNameFilters",limitFieldsPerRow:2,columns:Kl,values:i,setValues:e=>{o(X.ServicesNameFilters,e.map(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:o})=>({serviceName:e,samplingRatio:Number(t),fallbackSamplingRatio:Number(o)})))},errorMessage:a})},[le.SpanAttributeSampler]:({value:e,setValue:o,formErrors:n})=>{const a=n[X.AttributeFilters],i=(e[X.AttributeFilters]||[]).map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:o,condition:n})=>{const a=Object.entries(n).filter(([e,t])=>t)[0][0];return{serviceName:e,attributeKey:t,fallbackSamplingRatio:o,condition:a,operation:n[a]?.operation,expectedValue:n[a]?.expectedValue,jsonPath:n[a]?.jsonPath}});return t(Y,{name:"attributeFilters",limitFieldsPerRow:2,columns:Yl,values:i,setValues:e=>{o(X.AttributeFilters,e.map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:o,condition:n,operation:a,expectedValue:i,jsonPath:l})=>{const s={serviceName:e,attributeKey:t,fallbackSamplingRatio:Number(o),condition:{[n]:{operation:a,expectedValue:i}}};return l&&(s.condition[n].jsonPath=l),s}))},errorMessage:a})},[le.URLTemplatization]:({value:n,setValue:i,formErrors:l})=>{const s=f(),r=n[Wl]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>i(Wl,e),d=(e,t)=>c(r.map((o,n)=>n===e?{...o,...t}:o));return e(o,{children:[r.map((o,n)=>e(a,{children:[t(ee,{}),e(V,{$gap:12,children:[e(te,{$justifyContent:"space-between",$alignItems:"center",children:[t(U,{label:`Rule Group ${n+1}`}),t(oe,{leftIcon:()=>t(ni,{fill:s.v2.colors.red[500]}),variant:ae.Secondary,size:ne.S,onClick:()=>{return e=n,c(r.filter((t,o)=>o!==e));var e},disabled:1===r.length})]}),t(W,{name:`urlGroup-${n}-namespace`,label:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:o.filterK8sNamespace||"",onChange:e=>d(n,{filterK8sNamespace:e.target.value})}),t(Y,{name:`urlGroup-${n}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:Gl,values:o.workloadFilters||[],setValues:e=>d(n,{workloadFilters:e})}),t(Q,{name:`urlGroup-${n}-templates`,label:"Templates",required:!0,placeholder:"e.g. /user/{id}",values:o.templatizationRules.map(e=>e.template),setValues:e=>d(n,{templatizationRules:e.map(e=>({template:e}))})})]}),t(j,{errorMessage:l[Wl]})]},`url-templatization-group-${n}`)),t(oe,{variant:ae.Secondary,label:"Add rule group",leftIcon:ai,onClick:()=>c([...r,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(ee,{})]})}},ql=({actionType:e,value:o,setValue:n,formErrors:a})=>{if(!e)return null;const i=Jl[e];return i?t(i,{value:o,setValue:n,formErrors:a}):null},Zl=()=>{const o=f(),{selectedOption:n,genericForm:a}=Cl();if(!a||!n)return t(se,{title:"No active form"});const{formData:i,handleFormChange:l,formErrors:s}=a;return e(V,{$gap:24,children:[e(te,{$gap:12,$justifyContent:"space-between",children:[t(re,{size:ce.XXS,children:n.docsDescription}),t(oe,{label:"Docs",leftIcon:ii,variant:ae.Text,size:ne.S,onClick:()=>window.open(`${de}${n.docsEndpoint}`,"_blank","noopener noreferrer")})]}),t(ue,{options:[{icon:li,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:si,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],selected:i.disabled,setSelected:e=>l("disabled",e)}),t(tl,{title:"Signals for processing",allowedSignals:n.allowedSignals,selectedSignals:i.signals||[],setSelectedSignals:e=>l("signals",e),errorMessage:s.signals}),t(W,{name:"actionName",label:"Action name",placeholder:"Use a name that describes the action...",value:i.name||"",onChange:({target:{value:e}})=>l("name",e),errorMessage:s.name}),t(ql,{actionType:n.type,value:i.fields,setValue:(e,t)=>l(`fields.${e}`,t),formErrors:s}),t(pe,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:i.notes||"",onChange:({target:{value:e}})=>l("notes",e),errorMessage:s.notes})]})},Ql=({signals:e,fields:o,disabled:n,formData:a,handleFormChange:i,formErrors:l})=>o?.map(({renderCondition:o,componentType:s,type:r,name:c,title:d,tooltip:u,placeholder:p,value:h,required:m,options:g})=>{if(!(!o||he(o,e,a.fields)))return null;const f=c,b=a.fields.find(e=>e.key===f),v=b?b.value:h;return t(ol,{componentType:s,inputType:r,name:f,label:d,tooltip:u,disabled:n,required:m,placeholder:p,errorMessage:l[f],dropdownOptions:g,value:v||"",setValue:e=>i(f,e)},f)}),es=g(te)`
2
2
  position: sticky;
3
3
  bottom: 4px;
4
4
  align-self: center;
@@ -19,7 +19,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
19
19
  opacity: ${({$faded:e})=>e?.4:1};
20
20
  transition: opacity 0.2s ease;
21
21
  }
22
- `,fs=({value:e})=>{const o=f();return t(Ee,e?{status:ge.Success,label:Xe,leftIcon:li}:{label:Ve,leftIcon:si,backgroundColor:o.v2.colors.silver[500],textColor:o.v2.colors.white[500]})},bs=({value:e,onChange:o})=>{const n=f(),a=r(()=>[{icon:li,label:Xe,value:!0,selectedBgColor:n.v2.colors.green[800]},{icon:si,label:Ve,value:!1,selectedBgColor:n.v2.colors.silver[500]}],[n]);return t(ue,{options:a,selected:e,setSelected:o??(()=>{}),disabled:!o})},vs=()=>{const e=Tl();switch(e.formType){case $l.Create:return t(ys,{category:e.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(bs,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})});case $l.View:return e.data?e.isEditing?t(ys,{category:e.data.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(bs,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})}):t(Cs,{data:e.data,renderAction:()=>t(fs,{value:!e.data?.rule.disabled})}):null;case $l.EditAutoNoisy:return t(Ss,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:Be,sectionTitle:_e,sectionSubTitle:ze,presetLabel:Le,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(bs,{value:e.localEnabled,onChange:e.setLocalEnabled})});case $l.EditAutoCostReduction:return t(Ss,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:Me,sectionTitle:_e,presetLabel:Le,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(bs,{value:e.localEnabled,onChange:e.setLocalEnabled})});case $l.EditAutoHighlyRelevant:return t(ms,{children:t(nl,{title:e.localEnabled?void 0:Pe,summary:e.summary,renderAction:()=>t(bs,{value:e.localEnabled,onChange:e.setLocalEnabled})})})}},ys=({category:o,formData:n,onChange:a,sourceOptions:i,namespaceOptions:l,renderAction:s})=>e(ms,{children:[t(ll,{category:o,formState:n,renderAction:s}),e(gs,{$faded:!!n.disabled,children:[t(sl,{category:o,formState:n,onChange:a}),t(rl,{formState:n,onChange:a,sourceOptions:i,namespaceOptions:l}),t(cl,{category:o,formState:n,onChange:a}),"highlyRelevant"===o&&t(dl,{formState:n,onChange:a}),"highlyRelevant"===o&&t(ul,{ruleType:n.ruleType,formState:n,onChange:a}),t(pl,{category:o,formState:n,onChange:a})]})]}),Cs=({data:o,renderAction:n})=>e(ms,{children:[t(ll,{readOnly:!0,summary:o.summary,renderAction:n}),t(sl,{readOnly:!0,data:o}),t(rl,{readOnly:!0,scopes:C(o.rule.sourceScopes)}),t(cl,{readOnly:!0,data:o}),t(pl,{readOnly:!0,data:o}),"highlyRelevant"===o.category&&t(ul,{readOnly:!0,rule:o.rule})]}),Ss=({enabled:o,summary:n,inactiveTitle:a,sectionTitle:i,sectionSubTitle:l,presetLabel:s,customInputName:r,showModeToggle:d=!0,percentageMode:u,setPercentageMode:p,percentagePreset:h,setPercentagePreset:m,customPercentage:g,setCustomPercentage:f,renderAction:b})=>{const v=c(e=>p(e),[p]),y=c(e=>m(e),[m]),C=c(e=>f(e.target.value),[f]),S=!d||"sample"===u;return e(ms,{children:[t(nl,{title:o?void 0:a,summary:n,renderAction:b}),t(gs,{$faded:!o,children:e(Ue,{richTitle:{title:i,subTitle:l},children:[d&&t(V,{$alignItems:"flex-start",children:t(ue,{options:hs,selected:u,setSelected:v})}),S&&t(al,{description:s,options:il,selected:h,onSelect:y,customName:r,customLabel:He,customPlaceholder:"5%",customValue:g,onCustomChange:C})]})})]})},ws=g.div`
22
+ `,fs=({value:e})=>{const o=f();return t(Ee,e?{status:ge.Success,label:Xe,leftIcon:li}:{label:Ve,leftIcon:si,backgroundColor:o.v2.colors.silver[500],textColor:o.v2.colors.white[500]})},bs=({value:e,onChange:o})=>{const n=f(),a=r(()=>[{icon:li,label:Xe,value:!0,selectedBgColor:n.v2.colors.green[800]},{icon:si,label:Ve,value:!1,selectedBgColor:n.v2.colors.silver[500]}],[n]);return t(ue,{options:a,selected:e,setSelected:o??(()=>{}),disabled:!o})},vs=()=>{const e=Tl();switch(e.formType){case $l.Create:return t(ys,{category:e.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(bs,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})});case $l.View:return e.data?e.isEditing?t(ys,{category:e.data.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(bs,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})}):t(Cs,{data:e.data,renderAction:()=>t(fs,{value:!e.data?.rule.disabled})}):null;case $l.EditAutoNoisy:return t(Ss,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:ze,sectionTitle:_e,sectionSubTitle:Be,presetLabel:Le,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(bs,{value:e.localEnabled,onChange:e.setLocalEnabled})});case $l.EditAutoCostReduction:return t(Ss,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:Me,sectionTitle:_e,presetLabel:Le,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(bs,{value:e.localEnabled,onChange:e.setLocalEnabled})});case $l.EditAutoHighlyRelevant:return t(ms,{children:t(nl,{title:e.localEnabled?void 0:Pe,summary:e.summary,renderAction:()=>t(bs,{value:e.localEnabled,onChange:e.setLocalEnabled})})})}},ys=({category:o,formData:n,onChange:a,sourceOptions:i,namespaceOptions:l,renderAction:s})=>e(ms,{children:[t(ll,{category:o,formState:n,renderAction:s}),e(gs,{$faded:!!n.disabled,children:[t(sl,{category:o,formState:n,onChange:a}),t(rl,{formState:n,onChange:a,sourceOptions:i,namespaceOptions:l}),t(cl,{category:o,formState:n,onChange:a}),"highlyRelevant"===o&&t(dl,{formState:n,onChange:a}),"highlyRelevant"===o&&t(ul,{ruleType:n.ruleType,formState:n,onChange:a}),t(pl,{category:o,formState:n,onChange:a})]})]}),Cs=({data:o,renderAction:n})=>e(ms,{children:[t(ll,{readOnly:!0,summary:o.summary,renderAction:n}),t(sl,{readOnly:!0,data:o}),t(rl,{readOnly:!0,scopes:C(o.rule.sourceScopes)}),t(cl,{readOnly:!0,data:o}),t(pl,{readOnly:!0,data:o}),"highlyRelevant"===o.category&&t(ul,{readOnly:!0,rule:o.rule})]}),Ss=({enabled:o,summary:n,inactiveTitle:a,sectionTitle:i,sectionSubTitle:l,presetLabel:s,customInputName:r,showModeToggle:d=!0,percentageMode:u,setPercentageMode:p,percentagePreset:h,setPercentagePreset:m,customPercentage:g,setCustomPercentage:f,renderAction:b})=>{const v=c(e=>p(e),[p]),y=c(e=>m(e),[m]),C=c(e=>f(e.target.value),[f]),S=!d||"sample"===u;return e(ms,{children:[t(nl,{title:o?void 0:a,summary:n,renderAction:b}),t(gs,{$faded:!o,children:e(Ue,{richTitle:{title:i,subTitle:l},children:[d&&t(V,{$alignItems:"flex-start",children:t(ue,{options:hs,selected:u,setSelected:v})}),S&&t(al,{description:s,options:il,selected:h,onSelect:y,customName:r,customLabel:He,customPlaceholder:"5%",customValue:g,onCustomChange:C})]})})]})},ws=g.div`
23
23
  display: flex;
24
24
  align-items: center;
25
25
  justify-content: space-between;
@@ -57,7 +57,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
57
57
  justify-content: space-between;
58
58
  gap: 12px;
59
59
  padding: ${({$isOpen:e})=>e?"2px 12px 8px 12px":"2px 12px"};
60
- `,As=({title:o,tooltip:n,list:a,noBgColor:i,purpleColors:s})=>{const[r,c]=l(!0);return e(Ns,{"data-id":`collapse-${o}`,$noBgColor:i,$purpleColors:s,children:[e(Es,{$isOpen:r,children:[e(te,{$gap:10,children:[t(re,{size:ce.XS,children:o}),n&&t(we,{text:n,withIcon:!0}),t(Ee,{label:a.length,status:s?ge.Default:void 0})]}),t(qe,{icon:r?gi:fi,size:Ze.M,onClick:()=>c(e=>!e)})]}),r?t(V,{children:a.length?u.toArray(a):t(Ke,{$padding:"12px 0",children:t(se,{})})}):null]})},Os=(e,t,o)=>t||o.signalType?e.filter(e=>e.displayName.toLowerCase().includes(t.toLowerCase())&&(!o.signalType||ve(e.supportedSignals).includes(o.signalType))):e,Ds=({option:e,formData:o,testResult:n,isSelected:a,onSelect:i})=>t(ks,{icon:tt(e.type).icon,title:o?.name||e.displayName,withCarret:!0,purpleColors:!!o,isSelected:a,onClick:()=>i(),children:n&&t(Ee,{status:n.succeeded?ge.Success:ge.Error,leftIcon:n.succeeded?bi:vi})}),Rs=({listType:e,destinationOptions:o,unsavedDestinations:n})=>{const{activeForm:a,onChangeActiveForm:i}=Sl();return o?.length?t(As,{title:et[e].TITLE,tooltip:et[e].DESCRIPTION,list:o.map((o,n)=>t(Ds,{option:o,isSelected:a?.listType===e&&"number"!=typeof a?.unsavedIdx&&(null!=o.id&&""!==o.id?a?.option.id===o.id:a?.option.type===o.type),onSelect:()=>i({listType:e,option:o})},`${e}-${o.id??o.type}-${n}`))}):n?.length?t(As,{purpleColors:!0,title:et[e].TITLE,tooltip:et[e].DESCRIPTION,list:n.map(({option:o,formData:n,testResult:l},s)=>t(Ds,{option:o,formData:n,testResult:l,isSelected:a?.unsavedIdx===s&&a?.listType===e,onSelect:()=>i({listType:e,option:o,unsavedIdx:s})},`${e}-${s}`))},e):void 0};var Fs;!function(e){e.SELF_HOSTED="self hosted",e.MANAGED="managed"}(Fs||(Fs={}));const Ps=(e,t)=>{const o=[],n=[],a=[];return e&&e.destinationCategories.categories.forEach(e=>{e.name===Fs.SELF_HOSTED?n.push(...e.items):e.name===Fs.MANAGED&&a.push(...e.items)}),t&&t?.potentialDestinations.forEach(t=>{for(const n of e?.destinationCategories?.categories||[]){const e=ot(n),a=e.items.findIndex(e=>e.type===t.type);if(-1!==a){const n=nt(t.fields,{});Object.keys(n).length&&(e.items[a].fields=e.items[a].fields.map(e=>({...e,initialValue:n[e.name]})),o.push(e.items[a]))}}}),{[Ye.DETECTED]:o,[Ye.SELF_HOSTED]:n,[Ye.MANAGED]:a}},Ls=({onClose:e,onBack:o,onNext:a,selectedConnectionIds:i,setSelectedConnectionIds:s,getDestinationCategories:d,getPotentialDestinations:u,initialInputs:p,testConnection:h,createDestination:m,updateDestination:g,withOverlay:f,disableAnimation:b})=>{const[v,y]=l(""),[C,S]=l({categoryType:null,signalType:null}),{destinations:w}=at(),{activeForm:x,genericForm:k,unsavedDestinations:T,setUnsavedDestinations:$}=Sl();n(()=>{p&&$(p)},[p]);const[I,N]=l(!0),[E,A]=l([]),[O,D]=l({[Ye.ALL]:[],[Ye.UNSAVED]:[],[Ye.EXISTS]:[],[Ye.DETECTED]:[],[Ye.SELF_HOSTED]:[],[Ye.MANAGED]:[]});n(()=>{const e=w.map(e=>{let t;for(const o of E){const n=o.items.find(t=>t.type===e.destinationType.type);if(n){t=n;break}}const o=nt(e.fields,{});return{id:e.id,type:e.destinationType.type,displayName:e.name||e.destinationType.displayName,selected:!0,testConnectionSupported:t?.testConnectionSupported??!1,supportedSignals:e.destinationType.supportedSignals,fields:t?t.fields.map(e=>({...e,initialValue:o[e.name]??e.initialValue})):[]}});D(t=>({...t,[Ye.EXISTS]:e}))},[w,E]);const R=c(async()=>{try{N(!0);const[e,t]=await Promise.all([d(),u()]);e&&A(e.destinationCategories.categories),D(o=>({...o,...Ps(e,t)}))}catch(e){}finally{N(!1)}},[]);n(()=>{R()},[]);const F=c(async()=>{const e=(await Promise.all(T.map(({option:e,formData:t})=>{const o=ye(t);if(e.id){const t=Object.fromEntries(e.fields.map(e=>[e.name,e.initialValue??""])),n=Object.fromEntries(o.fields.map(e=>[e.key,e.value??""]));if(!Object.keys(t).some(e=>t[e]!==n[e]))return g(e.id,o,i)}return m(o,i)}))).filter(e=>e?.error);if(e.length)return{error:e.map(e=>e?.error).join("\n")}},[T,i,m,g]),P=(({isFetching:e,destinationsByCategory:o,searchText:n,filters:a})=>{const{unsavedDestinations:i}=Sl();return{width:"40%",list:r(()=>{const l=[];i.length&&l.push(t(Rs,{listType:Ye.UNSAVED,unsavedDestinations:i},"unsaved"));for(const e of Object.values(Ye)){if(a.categoryType&&a.categoryType!==e)continue;const i=Os(o[e],n,a);i.length&&l.push(t(Rs,{listType:e,destinationOptions:i},e))}return e&&l.push(t(Ke,{$height:"100%",children:t(Qe,{title:"Fetching destinations",withSpinner:!0})},"loading-more")),l},[i,o,n,a,e])}})({isFetching:I,destinationsByCategory:O,searchText:v,filters:C}),L=(({testConnection:e})=>{const{activeForm:o}=Sl();return{width:"60%",list:o?[t(ts,{testConnection:e},o.option.type)]:[t(Ke,{$height:"100%",children:t(se,{icon:mi,title:"Select destination from the list",subTitle:"Add destination so your data has somewhere to go."})},"no-data")]}})({testConnection:h});return t(hl,{isOpen:!0,withOverlay:f,disableAnimation:b,onClose:e,onBack:o?()=>o(T):void 0,onNext:a?()=>a(T):void 0,nextIsSkip:!T.length,onSave:F,disableSave:!x&&!T.length,isFetching:I,isFormDirty:T.length>0||k?.isFormDirty,hideDirtyNote:!0,progress:{title:Re.CREATING_DESTINATION,subTitle:Re.CREATING_DESTINATION_SUBTITLE},header:{icon:mi,title:Re.ADD_DESTINATIONS,subTitle:Re.ADD_DESTINATION_DRAWER_DESCRIPTION},connectionIds:i&&s?{value:i,setValue:s}:void 0,search:{value:v,onChange:y},filters:t(Is,{destinationsByCategory:O,filters:C,setFilters:S}),leftColumn:P,rightColumn:L})},_s=({onClose:e,selectedConnectionIds:o,setSelectedConnectionIds:n,createInstrumentationRule:a,withOverlay:i})=>{const[s,c]=l(""),u=d(null),{selectedOption:p,onSelectOption:h,genericForm:m,validateFormData:g}=wl(),f=r(()=>s?it.filter(e=>e.label.toLowerCase().includes(s.toLowerCase())):it,[s]),b=r(()=>f.map(e=>{const o=p?.type===e.type;return t(ks,{dataId:`option-${e.type}`,title:e.label,description:e.description,withCarret:!0,isSelected:o,onClick:()=>{u.current?.clearErrors(),h(e)}},e.type)}),[p,f.length,h]),v=r(()=>p?[t(cs,{},p.type)]:[t(Ke,{$height:"100%",children:t(se,{icon:yi,title:"Instrumentation rule not selected",subTitle:"Please select an instrumentation rule to add"})},"no-data")],[p]);return t(hl,{ref:u,isOpen:!0,withOverlay:i,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=g();return!e&&await a(t)},disableSave:!p||!m?.isFormDirty,isFormDirty:m?.isFormDirty,hideDirtyNote:!0,progress:{title:Re.CREATING_INSTRUMENTATION_RULE,subTitle:Re.CREATING_INSTRUMENTATION_RULE_SUBTITLE},header:{icon:yi,title:Re.ADD_INSTRUMENTATION_RULE,subTitle:Re.ADD_INSTRUMENTATION_RULE_DESCRIPTION},connectionIds:o&&n?{value:o,setValue:n}:void 0,search:{value:s,onChange:c},leftColumn:{width:"40%",list:b},rightColumn:{width:"60%",list:v}})},Ms={groupSegmentLabel:"Namespace",itemSegmentLabel:"Source",searchPlaceholder:()=>{},groupColumnHeader:"Namespaces",fetchingGroups:{title:Re.FETCHING_NAMESPACES,subTitle:Re.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:Re.SELECT_NAMESPACE,subTitle:Re.SELECT_NAMESPACE_SUBTITLE},noItemsInGroupSubTitle:"No sources found in this namespace"},zs={groupSegmentLabel:"Kind",itemSegmentLabel:"Source",searchPlaceholder:e=>"Search by "+(e===lt.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"},Bs=e=>e?zs:Ms,Xs="No matches",Vs="No sources",Us=e=>`No sources matched the filter '${e}'`,Hs=e=>(e?"Unselect":"Select")+" all",js="Show only:",Ws="Selected",Gs="Auto",Ks="Automatically instrument all workloads currently in the namespace, and all workloads that will be deployed to this namespace in the future",Ys="Enterprise only",Js=g.div``,qs=g.div`
60
+ `,As=({title:o,tooltip:n,list:a,noBgColor:i,purpleColors:s})=>{const[r,c]=l(!0);return e(Ns,{"data-id":`collapse-${o}`,$noBgColor:i,$purpleColors:s,children:[e(Es,{$isOpen:r,children:[e(te,{$gap:10,children:[t(re,{size:ce.XS,children:o}),n&&t(we,{text:n,withIcon:!0}),t(Ee,{label:a.length,status:s?ge.Default:void 0})]}),t(qe,{icon:r?gi:fi,size:Ze.M,onClick:()=>c(e=>!e)})]}),r?t(V,{children:a.length?u.toArray(a):t(Ke,{$padding:"12px 0",children:t(se,{})})}):null]})},Os=(e,t,o)=>t||o.signalType?e.filter(e=>e.displayName.toLowerCase().includes(t.toLowerCase())&&(!o.signalType||ve(e.supportedSignals).includes(o.signalType))):e,Ds=({option:e,formData:o,testResult:n,isSelected:a,onSelect:i})=>t(ks,{icon:tt(e.type).icon,title:o?.name||e.displayName,withCarret:!0,purpleColors:!!o,isSelected:a,onClick:()=>i(),children:n&&t(Ee,{status:n.succeeded?ge.Success:ge.Error,leftIcon:n.succeeded?bi:vi})}),Rs=({listType:e,destinationOptions:o,unsavedDestinations:n})=>{const{activeForm:a,onChangeActiveForm:i}=Sl();return o?.length?t(As,{title:et[e].TITLE,tooltip:et[e].DESCRIPTION,list:o.map((o,n)=>t(Ds,{option:o,isSelected:a?.listType===e&&"number"!=typeof a?.unsavedIdx&&(null!=o.id&&""!==o.id?a?.option.id===o.id:a?.option.type===o.type),onSelect:()=>i({listType:e,option:o})},`${e}-${o.id??o.type}-${n}`))}):n?.length?t(As,{purpleColors:!0,title:et[e].TITLE,tooltip:et[e].DESCRIPTION,list:n.map(({option:o,formData:n,testResult:l},s)=>t(Ds,{option:o,formData:n,testResult:l,isSelected:a?.unsavedIdx===s&&a?.listType===e,onSelect:()=>i({listType:e,option:o,unsavedIdx:s})},`${e}-${s}`))},e):void 0};var Fs;!function(e){e.SELF_HOSTED="self hosted",e.MANAGED="managed"}(Fs||(Fs={}));const Ps=(e,t)=>{const o=[],n=[],a=[];return e&&e.destinationCategories.categories.forEach(e=>{e.name===Fs.SELF_HOSTED?n.push(...e.items):e.name===Fs.MANAGED&&a.push(...e.items)}),t&&t?.potentialDestinations.forEach(t=>{for(const n of e?.destinationCategories?.categories||[]){const e=ot(n),a=e.items.findIndex(e=>e.type===t.type);if(-1!==a){const n=nt(t.fields,{});Object.keys(n).length&&(e.items[a].fields=e.items[a].fields.map(e=>({...e,initialValue:n[e.name]})),o.push(e.items[a]))}}}),{[Ye.DETECTED]:o,[Ye.SELF_HOSTED]:n,[Ye.MANAGED]:a}},Ls=({onClose:e,onBack:o,onNext:a,selectedConnectionIds:i,setSelectedConnectionIds:s,getDestinationCategories:d,getPotentialDestinations:u,initialInputs:p,testConnection:h,createDestination:m,updateDestination:g,withOverlay:f,disableAnimation:b})=>{const[v,y]=l(""),[C,S]=l({categoryType:null,signalType:null}),{destinations:w}=at(),{activeForm:x,genericForm:k,unsavedDestinations:T,setUnsavedDestinations:$}=Sl();n(()=>{p&&$(p)},[p]);const[I,N]=l(!0),[E,A]=l([]),[O,D]=l({[Ye.ALL]:[],[Ye.UNSAVED]:[],[Ye.EXISTS]:[],[Ye.DETECTED]:[],[Ye.SELF_HOSTED]:[],[Ye.MANAGED]:[]});n(()=>{const e=w.map(e=>{let t;for(const o of E){const n=o.items.find(t=>t.type===e.destinationType.type);if(n){t=n;break}}const o=nt(e.fields,{});return{id:e.id,type:e.destinationType.type,displayName:e.name||e.destinationType.displayName,selected:!0,testConnectionSupported:t?.testConnectionSupported??!1,supportedSignals:e.destinationType.supportedSignals,fields:t?t.fields.map(e=>({...e,initialValue:o[e.name]??e.initialValue})):[]}});D(t=>({...t,[Ye.EXISTS]:e}))},[w,E]);const R=c(async()=>{try{N(!0);const[e,t]=await Promise.all([d(),u()]);e&&A(e.destinationCategories.categories),D(o=>({...o,...Ps(e,t)}))}catch(e){}finally{N(!1)}},[]);n(()=>{R()},[]);const F=c(async()=>{const e=(await Promise.all(T.map(({option:e,formData:t})=>{const o=ye(t);if(e.id){const t=Object.fromEntries(e.fields.map(e=>[e.name,e.initialValue??""])),n=Object.fromEntries(o.fields.map(e=>[e.key,e.value??""]));if(!Object.keys(t).some(e=>t[e]!==n[e]))return g(e.id,o,i)}return m(o,i)}))).filter(e=>e?.error);if(e.length)return{error:e.map(e=>e?.error).join("\n")}},[T,i,m,g]),P=(({isFetching:e,destinationsByCategory:o,searchText:n,filters:a})=>{const{unsavedDestinations:i}=Sl();return{width:"40%",list:r(()=>{const l=[];i.length&&l.push(t(Rs,{listType:Ye.UNSAVED,unsavedDestinations:i},"unsaved"));for(const e of Object.values(Ye)){if(a.categoryType&&a.categoryType!==e)continue;const i=Os(o[e],n,a);i.length&&l.push(t(Rs,{listType:e,destinationOptions:i},e))}return e&&l.push(t(Ke,{$height:"100%",children:t(Qe,{title:"Fetching destinations",withSpinner:!0})},"loading-more")),l},[i,o,n,a,e])}})({isFetching:I,destinationsByCategory:O,searchText:v,filters:C}),L=(({testConnection:e})=>{const{activeForm:o}=Sl();return{width:"60%",list:o?[t(ts,{testConnection:e},o.option.type)]:[t(Ke,{$height:"100%",children:t(se,{icon:mi,title:"Select destination from the list",subTitle:"Add destination so your data has somewhere to go."})},"no-data")]}})({testConnection:h});return t(hl,{isOpen:!0,withOverlay:f,disableAnimation:b,onClose:e,onBack:o?()=>o(T):void 0,onNext:a?()=>a(T):void 0,nextIsSkip:!T.length,onSave:F,disableSave:!x&&!T.length,isFetching:I,isFormDirty:T.length>0||k?.isFormDirty,hideDirtyNote:!0,progress:{title:Re.CREATING_DESTINATION,subTitle:Re.CREATING_DESTINATION_SUBTITLE},header:{icon:mi,title:Re.ADD_DESTINATIONS,subTitle:Re.ADD_DESTINATION_DRAWER_DESCRIPTION},connectionIds:i&&s?{value:i,setValue:s}:void 0,search:{value:v,onChange:y},filters:t(Is,{destinationsByCategory:O,filters:C,setFilters:S}),leftColumn:P,rightColumn:L})},_s=({onClose:e,selectedConnectionIds:o,setSelectedConnectionIds:n,createInstrumentationRule:a,withOverlay:i})=>{const[s,c]=l(""),u=d(null),{selectedOption:p,onSelectOption:h,genericForm:m,validateFormData:g}=wl(),f=r(()=>s?it.filter(e=>e.label.toLowerCase().includes(s.toLowerCase())):it,[s]),b=r(()=>f.map(e=>{const o=p?.type===e.type;return t(ks,{dataId:`option-${e.type}`,title:e.label,description:e.description,withCarret:!0,isSelected:o,onClick:()=>{u.current?.clearErrors(),h(e)}},e.type)}),[p,f.length,h]),v=r(()=>p?[t(cs,{},p.type)]:[t(Ke,{$height:"100%",children:t(se,{icon:yi,title:"Instrumentation rule not selected",subTitle:"Please select an instrumentation rule to add"})},"no-data")],[p]);return t(hl,{ref:u,isOpen:!0,withOverlay:i,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=g();return!e&&await a(t)},disableSave:!p||!m?.isFormDirty,isFormDirty:m?.isFormDirty,hideDirtyNote:!0,progress:{title:Re.CREATING_INSTRUMENTATION_RULE,subTitle:Re.CREATING_INSTRUMENTATION_RULE_SUBTITLE},header:{icon:yi,title:Re.ADD_INSTRUMENTATION_RULE,subTitle:Re.ADD_INSTRUMENTATION_RULE_DESCRIPTION},connectionIds:o&&n?{value:o,setValue:n}:void 0,search:{value:s,onChange:c},leftColumn:{width:"40%",list:b},rightColumn:{width:"60%",list:v}})},Ms={groupSegmentLabel:"Namespace",itemSegmentLabel:"Source",searchPlaceholder:()=>{},groupColumnHeader:"Namespaces",fetchingGroups:{title:Re.FETCHING_NAMESPACES,subTitle:Re.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:Re.SELECT_NAMESPACE,subTitle:Re.SELECT_NAMESPACE_SUBTITLE},noItemsInGroupSubTitle:"No sources found in this namespace"},Bs={groupSegmentLabel:"Kind",itemSegmentLabel:"Source",searchPlaceholder:e=>"Search by "+(e===lt.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"},zs=e=>e?Bs:Ms,Xs="No matches",Vs="No sources",Us=e=>`No sources matched the filter '${e}'`,Hs=e=>(e?"Unselect":"Select")+" all",js="Show only:",Ws="Selected",Gs="Auto",Ks="Automatically instrument all workloads currently in the namespace, and all workloads that will be deployed to this namespace in the future",Ys="Enterprise only",Js=g.div``,qs=g.div`
61
61
  visibility: hidden;
62
62
 
63
63
  transition: visibility 0s;
@@ -77,7 +77,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
77
77
  ${Qs}:hover & {
78
78
  visibility: visible;
79
79
  }
80
- `,tr=({clusterId:o,namespaceName:n,checkbox:a,isFutureApps:i,selectedCounts:l,isActive:s,onActive:r,handleSourceChange:c})=>{const{isVm:d}=y(),u=e=>{r(),c({clusterId:o,workloadId:{namespace:n},auto:e.auto,selected:e.all})};return t(Qs,{children:t(ks,{dataId:`namespace-${n}`,withCarret:!0,title:n,isSelected:s,onClick:r,isPartiallyChecked:a.partial,isChecked:a.all,onCheckboxChange:e=>u({auto:e,all:e}),children:e(te,{$gap:12,children:[!d&&t(er,{$visible:s||i,children:t(we,{text:Ks,children:t(q,{label:Gs,labelAlign:Z.Left,size:ct.S,value:i,onChange:e=>u({auto:e,all:e||void 0})})})}),e(te,{$gap:8,children:[t(re,{variant:dt.Span,size:ce.XXXS,color:Ce.Secondary,align:"right",children:Ws}),t(Ee,{label:`${l.sourced}/${l.total}`,status:s?ge.Default:st.Unknown,minWidth:"42px"})]})]})})})},or=({withCollapse:e,clusterId:o,clusterName:n,namespaces:a,selectedArea:i,setSelectedArea:l,handleSourceChange:s})=>{const c=r(()=>a.map(({name:e,totalWorkloads:a,selectedCount:r,isAllSourced:c,isSomeSourced:d,isFutureApps:u})=>t(tr,{clusterId:o,namespaceName:e,isFutureApps:u,checkbox:{all:c||u,partial:d},selectedCounts:{sourced:r,total:a},isActive:i.clusterId===o&&i.namespaceName===e,onActive:()=>l({clusterId:o,clusterName:n,namespaceName:e}),handleSourceChange:s},`${o}#${e}`)),[o,n,a,i]);return e?t(As,{title:n,list:c,noBgColor:!0}):c},nr=({onClose:o,onBack:a,onNext:i,selectedConnectionIds:s,setSelectedConnectionIds:c,persistSources:d,getAllClusterSnapshots:u,fetchNamespacesWithWorkloads:p,withOverlay:h,disableAnimation:m})=>{const{isVm:g}=y(),f=Bs(g),{selectedStreamName:b}=Fe(),{progress:v,resetProgress:C}=ut(),{isFetching:S,setIsFetching:w,setSnapshots:x,formData:k,handleSourceChange:T,handleSelectAll:$,formDiff:I,isFormDirty:N}=Ol();n(()=>{let e=!1;w(!0);return(async()=>{try{if(u){const t=await u();!e&&t&&x(t)}else if(p){const t=await p();if(!e&&t.data?.length){const e={clusters:[{clusterId:mt,clusterName:ht,namespaces:t.data.map(e=>({name:e.name,selected:e.markedForInstrumentation&&e.dataStreamNames.includes(b),workloads:e.workloads?.map(e=>({namespace:e.id.namespace,name:e.id.name,kind:e.id.kind,selected:e.markedForInstrumentation?.markedForInstrumentation??!1}))||[]}))}]};x(e)}}}catch(e){}finally{e||w(!1)}})(),()=>{e=!0}},[b]);const[E,A]=l(""),[O,D]=l(lt.Namespace),[R,F]=l({showOnlySelected:!1}),[P,L]=l({clusterId:"",clusterName:"",namespaceName:""}),_=(({isFetching:o,formData:n,handleSourceChange:a,handleSelectAll:i,selectedArea:l,setSelectedArea:s,searchText:c,searchBy:d,filters:u})=>{const{isVm:p}=y(),h=Bs(p),m=r(()=>n.map(e=>{const t=[...e.namespaces].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>El(e,c,u)).map(e=>({name:e.name,totalWorkloads:e.workloads.length,...Al(e)}));return{clusterId:e.clusterId,clusterName:e.clusterName,visibleNamespaces:t}}),[n,c,u]),g=r(()=>{let e=!1;for(const{visibleNamespaces:t}of m)for(const{totalWorkloads:o,selectedCount:n}of t)if(e=!0,n!==o)return!1;return e},[m]),{list:f,withFilterCount:b,filteredCount:v,totalCount:C}=r(()=>{const e=m.map(({clusterId:e,clusterName:o,visibleNamespaces:n})=>n.length?t(or,{withCollapse:m.length>1,clusterId:e,clusterName:o,namespaces:n,selectedArea:l,setSelectedArea:s,handleSourceChange:a},e):null),o=e.filter(e=>null!==e);return{list:o,withFilterCount:o.length!==e.length,filteredCount:o.length,totalCount:e.length}},[m,l]);return{width:"60%",header:e(te,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(te,{$gap:8,children:[t(re,{size:ce.XS,nowrap:!0,children:h.groupColumnHeader}),t(we,{text:b?Re.FILTERED_COUNT_TOOLTIP:void 0,children:t(Ee,{label:`${b?`${v} / ${C}`:C}`,status:st.Unknown})})]}),t(re,{"data-id":"namespaces-select-all",onClick:()=>i({boolean:!g,searchText:c,searchBy:d,filters:u}),disabled:!f.length,size:ce.XS,children:Hs(g)})]}),list:f.length?f:o?[t(Ke,{$height:"100%",children:t(Qe,{title:h.fetchingGroups.title,subTitle:h.fetchingGroups.subTitle,withSpinner:!0})},"loading")]:[t(Ke,{$height:"100%",children:t(se,c?{icon:Si,title:Xs,subTitle:h.noGroupMatchedFilter(c)}:{icon:Si,title:h.noGroups.title,subTitle:h.noGroups.subTitle})},"no-data")]}})({isFetching:S,formData:k,handleSourceChange:T,handleSelectAll:$,selectedArea:P,setSelectedArea:L,searchText:O===lt.Namespace?E:"",searchBy:O,filters:R}),M=(({formData:o,handleSourceChange:n,handleSelectAll:a,selectedArea:i,searchText:l,searchBy:s,filters:c})=>{const{tier:d,isVm:u}=y(),p=Bs(u),h=d===rt.Onprem,m=r(()=>i.value.namespaceName?o.find(({clusterId:e})=>e===i.value.clusterId)?.namespaces.find(({name:e})=>e===i.value.namespaceName):void 0,[o,i.value.clusterId,i.value.namespaceName]),g=r(()=>m?[...m.workloads].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Il(e,l,c)):[],[m,l,c]),f=r(()=>!!g.length&&g.every(({selected:e})=>e),[g]),b=r(()=>{if(!m)return[];const{clusterId:e}=i.value,{name:o}=m;return g.map(({name:a,selected:i,kind:l})=>{const s=!u&&!h&&Nl.has(l);return t(Zs,{workloadName:a,workloadKind:l,isChecked:!s&&(i||!1),onToggle:()=>n({clusterId:e,workloadId:{namespace:o,name:a,kind:l}}),disabled:s,disabledReason:Ys},`${e}#${o}#${a}#${l}`)})},[g,m,i.value.clusterId]),{withFilterCount:v,filteredCount:C,totalCount:S}=r(()=>{const e=m?.workloads.length??0;return{withFilterCount:g.length!==e,filteredCount:g.length,totalCount:e}},[g,m]);return{width:"40%",header:e(te,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(te,{$gap:8,children:[t(re,{size:ce.XS,nowrap:!0,children:i.value.namespaceName?`${i.value.namespaceName} > ${p.itemColumnHeader}`:p.itemColumnHeader}),t(we,{text:v?Re.FILTERED_COUNT_TOOLTIP:void 0,children:t(Ee,{label:`${v?`${C} / ${S}`:S}`,status:st.Unknown})})]}),t(re,{"data-id":"workloads-select-all",onClick:()=>a({clusterId:i.value.clusterId,namespaceName:i.value.namespaceName,boolean:!f,searchText:l,searchBy:s,filters:c}),disabled:!b.length,size:ce.XS,children:Hs(f)})]}),list:b.length?b:[t(Ke,{$height:"100%",children:t(se,m?l?{icon:Ci,title:Xs,subTitle:Us(l)}:{icon:Ci,title:Vs,subTitle:p.noItemsInGroupSubTitle}:{icon:Ci,title:p.selectGroupPrompt.title,subTitle:p.selectGroupPrompt.subTitle})},"no-data")]}})({formData:k,handleSourceChange:T,handleSelectAll:$,selectedArea:{value:P},searchText:O===lt.Source?E:"",searchBy:O,filters:R});return t(hl,{isOpen:!0,withOverlay:h,disableAnimation:m,onClose:o?()=>{C(pt.BulkInstrumenting),o()}:void 0,onBack:a?()=>a(I):void 0,onNext:i?()=>i(I):void 0,nextIsSkip:!N,onSave:()=>d(I),header:{icon:Ci,title:Re.ADD_SOURCE,subTitle:Re.ADD_SOURCES_DESCRIPTION},connectionIds:s&&c?{value:s,setValue:c}:void 0,search:{value:E,onChange:e=>{A(e),O===lt.Namespace&&L({clusterId:"",clusterName:"",namespaceName:""})},placeholder:f.searchPlaceholder(O),segment:{options:[{label:f.groupSegmentLabel,value:lt.Namespace},{label:f.itemSegmentLabel,value:lt.Source}],selected:O,setSelected:D}},filters:e(te,{$gap:8,children:[t(re,{size:ce.XXXS,color:Ce.Secondary,nowrap:!0,children:js}),t(q,{name:"filter-selected",size:ct.S,label:Ws,value:R.showOnlySelected,onChange:e=>F(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:N,isFetching:S,progress:{title:Re.CREATING_SOURCES,subTitle:Re.CREATING_SOURCES_SUBTITLE,percentage:v[pt.BulkInstrumenting]?.percentage||0},leftColumn:_,rightColumn:M})},ar=({onClose:a,actionId:i,updateAction:s,deleteAction:d})=>{const u=f(),{actions:p}=at(),{selectedOption:h,loadAction:m,validateFormData:g,genericForm:b}=Cl(),[v,y]=l(!1),[C,S]=l(!1),[w,x]=l(null),k=v&&!!b?.isFormDirty,T=r(()=>p?.find(e=>gt(e)===i),[i,p]),$=r(()=>We.find(({type:e})=>e===T?.type)??Ge.find(({type:e})=>e===T?.type)??null,[T?.type]);n(()=>{T&&m(T)},[T]);const I=c(()=>{T&&y(!0)},[T]),N=c(()=>{T&&(m(T),y(!1))},[T,m]),E=c(()=>{k?x("close"):a()},[k,a]),A=c(()=>{k?x("cancel"):N()},[k,N]),O=c(()=>{const e=w;x(null),"close"===e?(N(),a()):N()},[w,N,a]),D=c(async()=>{if(T){const{errorMessage:e,preparedFormData:t}=g();e||(await s(T.id,t),y(!1))}},[T,g,s]),R=c(()=>{T&&S(!0)},[T]),F=c(async()=>{T&&(await d(T.id,T.type),a())},[T,d,a]);if(!T||!$)return null;const P=(e=>{const t=[],{type:o,fields:n}=e,a=e=>({status:e?ge.Success:st.Unknown,label:e?"True":"False",invertColors:!0});return o===le.K8sAttributes&&(t.push({id:"collectContainerAttributes",title:"Collect Container Attributes",badge:a(n.collectContainerAttributes)}),t.push({id:"collectReplicaSetAttributes",title:"Collect ReplicaSet Attributes",badge:a(n.collectReplicaSetAttributes)}),t.push({id:"collectWorkloadId",title:"Collect Workload ID",badge:a(n.collectWorkloadId)}),t.push({id:"collectClusterId",title:"Collect Cluster ID",badge:a(n.collectClusterId)}),n.labelsAttributes?.forEach(({labelKey:e,attributeKey:o,from:a,fromSources:i},l)=>{const s=i?.length?i.join(", "):a||J.Pod,r=(n.labelsAttributes?.length??0)>1?`Label #${l+1} `:"Label ";t.push({id:`label-${l}-key`,title:`${r}Key`,label:e}),t.push({id:`label-${l}-attr`,title:`${r}Attribute Key`,label:o}),t.push({id:`label-${l}-from`,title:`${r}From`,label:s})}),n.annotationsAttributes?.forEach(({annotationKey:e,attributeKey:o,from:a,fromSources:i},l)=>{const s=i?.length?i.join(", "):a||J.Pod,r=(n.annotationsAttributes?.length??0)>1?`Annotation #${l+1} `:"Annotation ";t.push({id:`annotation-${l}-key`,title:`${r}Key`,label:e}),t.push({id:`annotation-${l}-attr`,title:`${r}Attribute Key`,label:o}),t.push({id:`annotation-${l}-from`,title:`${r}From`,label:s})})),o===le.AddClusterInfo&&(t.push({id:"overwriteExistingValues",title:"Overwrite Existing Values",badge:a(n.overwriteExistingValues)}),n.clusterAttributes?.forEach(({attributeName:e,attributeStringValue:o},n)=>{t.push({id:`cluster-attr-${n}`,title:e,label:o})})),o===le.DeleteAttributes&&n.attributeNamesToDelete?.forEach((e,o)=>{t.push({id:`del-attr-${o}`,title:"Attribute"+((n.attributeNamesToDelete?.length??0)>1?` #${o+1}`:""),label:e})}),o===le.RenameAttributes&&Object.entries(n.renames||{}).forEach(([e,o],n)=>{t.push({id:`rename-${n}`,title:e,label:o})}),o===le.PiiMasking&&n.piiCategories?.forEach((e,o)=>{t.push({id:`pii-${o}`,title:"Category"+((n.piiCategories?.length??0)>1?` #${o+1}`:""),label:e})}),o===le.ErrorSampler&&t.push({id:"fallbackSamplingRatio",title:"Sampling Ratio",label:String(n.fallbackSamplingRatio??"-")}),o===le.ProbabilisticSampler&&t.push({id:"samplingPercentage",title:"Sampling Percentage",label:String(n.samplingPercentage??"-")}),o===le.LatencySampler&&n.endpointsFilters?.forEach(({serviceName:e,httpRoute:o,minimumLatencyThreshold:a,fallbackSamplingRatio:i},l)=>{const s=(n.endpointsFilters?.length??0)>1?`Endpoint #${l+1} `:"Endpoint ";t.push({id:`endpoint-${l}-service`,title:`${s}Service Name`,label:e}),t.push({id:`endpoint-${l}-route`,title:`${s}HTTP Route`,label:o}),t.push({id:`endpoint-${l}-latency`,title:`${s}Min. Latency`,label:String(a)}),t.push({id:`endpoint-${l}-fallback`,title:`${s}Fallback Sampling Ratio`,label:String(i)})}),o===le.ServiceNameSampler&&n.servicesNameFilters?.forEach(({serviceName:e,samplingRatio:o,fallbackSamplingRatio:a},i)=>{const l=(n.servicesNameFilters?.length??0)>1?`Filter #${i+1} `:"Filter ";t.push({id:`service-${i}-name`,title:`${l}Service Name`,label:e}),t.push({id:`service-${i}-ratio`,title:`${l}Sampling Ratio`,label:String(o)}),t.push({id:`service-${i}-fallback`,title:`${l}Fallback Sampling Ratio`,label:String(a)})}),o===le.SpanAttributeSampler&&n.attributeFilters?.forEach(({serviceName:e,attributeKey:o,fallbackSamplingRatio:a,condition:i},l)=>{const s=Object.keys(i)[0],r=i[s],c=(n.attributeFilters?.length??0)>1?`Filter #${l+1} `:"Filter ";t.push({id:`attr-${l}-service`,title:`${c}Service Name`,label:e}),t.push({id:`attr-${l}-key`,title:`${c}Attribute Key`,label:o}),t.push({id:`attr-${l}-fallback`,title:`${c}Fallback Sampling Ratio`,label:String(a)}),t.push({id:`attr-${l}-condition`,title:`${c}Condition`,label:s}),t.push({id:`attr-${l}-operation`,title:`${c}Operation`,label:r?.operation??"-"}),t.push({id:`attr-${l}-expected`,title:`${c}Expected Value`,label:String(r?.expectedValue??"-")}),"jsonCondition"===s&&t.push({id:`attr-${l}-jsonpath`,title:`${c}JSON Path`,label:r?.jsonPath??"-"})}),o===le.URLTemplatization&&n.urlTemplatizationRulesGroups?.forEach((e,o)=>{const a=(n.urlTemplatizationRulesGroups?.length??0)>1?`Group #${o+1} `:"Group ";e.filterK8sNamespace&&t.push({id:`group-${o}-ns`,title:`${a}Namespace`,label:e.filterK8sNamespace}),e.workloadFilters?.forEach((n,i)=>{const l=[n.kind,n.name].filter(Boolean).join("/");l&&t.push({id:`group-${o}-wf-${i}`,title:`${a}Workload${(e.workloadFilters?.length??0)>1?` #${i+1}`:""}`,label:l})});const i=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");i&&t.push({id:`group-${o}-templates`,title:`${a}Templates`,label:i}),e.notes&&t.push({id:`group-${o}-notes`,title:`${a}Notes`,label:e.notes})}),t})(T);return e(o,{children:[t(ft,{isOpen:!0,header:{icon:St(T.type),title:$.label,onClose:E,actions:[{id:"edit-action-btn-edit",label:bt.EDIT,icon:ci,active:v,onClick:I},{id:"edit-action-btn-delete",label:bt.DELETE,icon:ni,color:u.v2.colors.red[500],active:C,onClick:R}]},footer:{actions:v?[{"data-id":"edit-action-btn-cancel",label:bt.CANCEL,variant:ae.Secondary,onClick:A},{"data-id":"edit-action-btn-save",label:bt.SAVE,variant:ae.Primary,onClick:D}]:[]},children:t(vt,{$padding:"4px 12px 12px",children:v&&h?t(Zl,{}):t(V,{$gap:16,children:e(yt,{bgTint:"1000",children:[e(yt,{bgTint:"900",children:[t(Ct,{conditions:T.conditions||[]}),t(yt,{bgTint:"800",cellsPerRow:2,items:(L=T,_=$,[{id:"type",title:Re.TYPE,label:_.label},{id:"status",title:Re.STATUS,badge:{status:L.disabled?st.Unknown:ge.Success,label:L.disabled?Re.DISABLED:Re.ENABLED}},{id:"signals",title:Re.SIGNALS_FOR_PROCESSING,label:L.signals?.map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ")||"-"},{id:"name",title:Re.NAME,label:L.name||"-"},{id:"notes",title:Re.NOTES,label:L.notes||"-"}])})]}),!!P?.length&&t(yt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(yt,{bgTint:"800",cellsPerRow:2,items:P})})]})})})}),t(ml,{target:"action",isOpen:C,onClose:()=>S(!1),onApprove:F}),t(gl,{isOpen:null!==w,onClose:()=>x(null),onApprove:O})]});var L,_},ir=({onClose:o,connections:a,selectedConnectionIds:i,setSelectedConnectionIds:s,getEffectiveConfig:c,onApply:d})=>{const[u,p]=l(""),[h,m]=l({showOnlySelected:!1}),g=r(()=>a.filter(e=>{const t=!u||e.name.toLowerCase().includes(u.toLowerCase()),o=!h.showOnlySelected||h.showOnlySelected&&i.includes(e.id);return t&&o}),[a.length,i.length,u,h]),f=e=>{s(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[b,v]=l(!1),[y,C]=l(void 0),{formData:S,handleFormChange:w,areFormValuesEqual:x,resetFormData:k}=wt(y||{rollout:{automaticRolloutDisabled:!1}}),T=r(()=>i.length>1||void 0!==y&&!x(y,S),[i.length,y,S]);return n(()=>{1===i.length?(async e=>{if(b)return;v(!0);const t=await c(e);if(t){const e={rollout:{automaticRolloutDisabled:t.rollout?.automaticRolloutDisabled??!1}};C(e),k(e)}v(!1)})(i[0]):C(void 0)},[i.length]),t(hl,{isOpen:!0,onClose:o,onSave:()=>d(S,i),header:{icon:wi,title:"Cluster Configuration"},connectionIds:{value:i,setValue:s},search:{placeholder:"Search by cluster name",value:u,onChange:p},filters:e(te,{$gap:8,children:[t(re,{size:ce.XXXS,color:Ce.Secondary,nowrap:!0,children:"Show only:"}),t(q,{size:ct.S,label:"Selected",value:h.showOnlySelected,onChange:e=>m(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:T,isFetching:b,leftColumn:{width:"35%",header:e(te,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(te,{$gap:8,children:[t(re,{size:ce.XS,children:"Clusters"}),t(Ee,{label:g.length,status:st.Unknown})]}),e(te,{$gap:8,children:[t(re,{size:ce.XXXS,color:Ce.Secondary,align:"right",children:"Selected clusters"}),t(Ee,{label:`${i.length}/${g.length}`,status:st.Unknown})]})]}),list:g.map(e=>t(ks,{title:e.name,isChecked:i.includes(e.id),onClick:()=>f(e.id),onCheckboxChange:()=>f(e.id)},e.id))},rightColumn:{width:"65%",header:t(re,{size:ce.XS,children:"Configurations"}),list:[t(q,{label:"Automatic rollout disabled",tooltip:"Odigos automatically triggers a one-time rollout for workloads when instrumenting or uninstrumenting, ensuring that changes are applied without requiring manual intervention. When automatic rollout is disabled, Odigos will not restart workloads, and users will need to manually trigger rollouts after adding or removing sources.",value:S.rollout?.automaticRolloutDisabled||!1,onChange:e=>w("rollout.automaticRolloutDisabled",e)},"automatic-rollout-disabled")]}})},lr=({onClose:a,destinationId:i,getDestinationCategories:s,testConnection:u,updateDestination:p,deleteDestination:h})=>{const m=f(),{isVm:g}=y(),{destinations:b}=at(),{selectedStreamName:v}=Fe(),{activeForm:C,loadDestination:S,validateFormData:w,genericForm:x}=Sl(),k=d(null),[T,$]=l(!1),[I,N]=l(!1),[E,A]=l(null),[O,D]=l(!0),[R,F]=l(null),P=T&&!!x?.isFormDirty,L=r(()=>kt(b,v),[b,v]),_=r(()=>L?.find(e=>gt(e)===i),[i,L]);n(()=>{let e=!1;return D(!0),s().then(t=>{e||A(t?.destinationCategories.categories??[])}).catch(t=>{e||A([])}).finally(()=>{e||D(!1)}),()=>{e=!0}},[]),n(()=>{_&&E&&S(_,E)},[_,E]);const M=r(()=>_&&E?Tt(E,_):[],[_,E]),z=c(()=>{_&&$(!0)},[_]),B=c(()=>{_&&E&&(S(_,E),$(!1))},[_,E,S]),X=c(()=>{P?F("close"):a()},[P,a]),U=c(()=>{P?F("cancel"):B()},[P,B]),H=c(()=>{const e=R;F(null),"close"===e?(B(),a()):B()},[R,B,a]),j=c(async()=>{if(_){const{errorMessage:e,preparedFormData:t}=w();e||(await p(_.id,ye(t)),$(!1))}},[_,w,p]),W=c(()=>{_&&N(!0)},[_]),G=c(async()=>{_&&(await h(_.id),a())},[_,h,a]);if(!_)return null;const{icon:K,iconSrc:Y}=tt(_.destinationType.type),J=((e,t)=>{const o=[],n=xt(e,t),a=n.map(e=>({name:e.key,value:e.value})),i=be(e.exportedSignals);let l=[];const s=()=>{l.length&&(o.push({kind:"cells",id:`cells-${o.length}`,items:l}),l=[])};return n.forEach(({key:e,name:n,value:r})=>{const c=t.find(t=>t.name===e),{secret:d,componentType:u,componentProperties:p,hideFromReadData:h,customReadDataLabels:m}=c||{};if(h?.length&&he(h,i,a))return;const{type:g}=nt(p,{type:""}),f=d||"password"===g;if(m?.length)m.forEach(({condition:t,...o},n)=>{t==r&&l.push({id:`${e}-custom-${n}`,title:o.title,label:o.value})});else if(r)if(f)l.push({id:e,title:n,label:new Array(10).fill("•").join("")});else{if(u===ie.MultiInput){const t=nt(r,null);if(Array.isArray(t)&&t.length)return s(),void o.push({kind:"list",id:e,title:n,items:t.map((t,o)=>({id:`${e}-${o}`,label:String(t)}))})}if(u===ie.KeyValuePair){const t=nt(r,null);if(Array.isArray(t)&&t.length)return s(),void o.push({kind:"pairs",id:e,title:n,items:t.map((t,o)=>{const n=t&&"object"==typeof t?t:{};return{id:`${e}-${o}`,title:null!=n.key?String(n.key):"",label:null!=n.value?String(n.value):""}})})}l.push({id:e,title:n,label:r})}else l.push({id:e,title:n,label:"-"})}),s(),o})(_,M);return e(o,{children:[t(ft,{isOpen:!0,header:{icon:K,iconSrc:Y,title:_.name||_.destinationType.displayName,onClose:X,actions:[{id:"edit-destination-btn-edit",label:bt.EDIT,icon:ci,active:T,onClick:z},{id:"edit-destination-btn-delete",label:bt.DELETE,icon:ni,color:m.v2.colors.red[500],active:I,onClick:W}]},footer:{actions:T?[{"data-id":"edit-destination-btn-cancel",label:bt.CANCEL,variant:ae.Secondary,onClick:U},...C?.option.testConnectionSupported&&!g?[{"data-id":"edit-destination-btn-test-connection",label:bt.TEST_CONNECTION,variant:ae.Secondary,onClick:()=>k.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:bt.SAVE,variant:ae.Primary,onClick:j}]:[]},children:t(vt,{$padding:"4px 12px 12px",children:O?t(Ke,{$height:"50vh",children:t(Qe,{withSpinner:!0})}):T&&C?t(ts,{ref:k,isEdit:!0,testConnection:u}):t(V,{$gap:16,children:e(yt,{bgTint:"1000",children:[e(yt,{bgTint:"900",children:[!g&&t(Ct,{conditions:_.conditions||[]}),t(yt,{bgTint:"800",cellsPerRow:2,items:(q=_,[{id:"type",title:Re.TYPE,label:q.destinationType.displayName},{id:"status",title:Re.STATUS,badge:{status:q.disabled?st.Unknown:ge.Success,label:q.disabled?Re.DISABLED:Re.ENABLED}},{id:"monitors",title:Re.MONITORS,label:be(q.exportedSignals).map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ")||"-"},{id:"name",title:Re.NAME,label:q.name||"-"}])})]}),!!J.length&&t(yt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:J.map(e=>"cells"===e.kind?t(yt,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t(yt,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})})}),t(ml,{target:"destination",isOpen:I,onClose:()=>N(!1),onApprove:G}),t(gl,{isOpen:null!==R,onClose:()=>F(null),onApprove:H})]});var q},sr=({onClose:a,ruleId:i,updateInstrumentationRule:s,deleteInstrumentationRule:d})=>{const u=f(),{instrumentationRules:p}=at(),{addNotification:h}=It(),{selectedOption:m,loadRule:g,validateFormData:b,genericForm:v}=wl(),[y,C]=l(!1),[S,w]=l(!1),[x,k]=l(null),T=y&&!!v?.isFormDirty,$=r(()=>p?.find(e=>gt(e)===i),[i,p]),I=r(()=>it.find(({type:e})=>e===$?.type)??null,[$?.type]);n(()=>{$&&g($)},[$]);const N=c(()=>{if($){if(!$.mutable)return void h({type:ge.Warning,title:Nt.FORBIDDEN,message:Nt.CANNOT_EDIT_RULE,crdType:lt.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});C(!0)}},[$,h]),E=c(()=>{$&&(g($),C(!1))},[$,g]),A=c(()=>{T?k("close"):a()},[T,a]),O=c(()=>{T?k("cancel"):E()},[T,E]),D=c(()=>{const e=x;k(null),"close"===e?(E(),a()):E()},[x,E,a]),R=c(async()=>{if($){const{errorMessage:e,preparedFormData:t}=b();e||(await s($.ruleId,t),C(!1))}},[$,b,s]),F=c(()=>{if($){if(!$.mutable)return void h({type:ge.Warning,title:Nt.FORBIDDEN,message:Nt.CANNOT_DELETE_RULE,crdType:lt.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});w(!0)}},[$,h]),P=c(async()=>{$&&(await d($.ruleId),a())},[$,d,a]);if(!$||!I)return null;const L=((e,o)=>{const n=[];return e.payloadCollection&&Object.entries(e.payloadCollection).forEach(([e,o])=>{o&&n.push(t(re,{size:ce.XS,children:`• ${$t(e).toLowerCase()}`},e))}),e.codeAttributes&&Object.entries(e.codeAttributes).forEach(([e,o])=>{o&&n.push(t(re,{size:ce.XS,children:`• ${$t(e).toLowerCase()}`},e))}),e.headersCollection?.[xe.HeaderKeys]?.length&&e.headersCollection[xe.HeaderKeys].forEach(e=>{e&&n.push(t(re,{size:ce.XS,children:e},e))}),e.customInstrumentations&&(e.customInstrumentations[Ie.Java]?.forEach((e,a)=>{const i=new $e(e.className,e.methodName);if(i.Verify()){0===a&&n.push(t(re,{size:ce.XS,children:"Java Custom Probes:"},"java-custom-probes"));const e=i.toString();n.push(t(re,{size:ce.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},e))}}),e.customInstrumentations[Ie.Golang]?.forEach((e,a)=>{const i=new Te(e.packageName,e.functionName,e.receiverName,e.receiverMethodName);if(i.Verify()){0===a&&n.push(t(re,{size:ce.XS,children:"Golang Custom Probes:"},"golang-custom-probes"));const e=i.toString();n.push(t(re,{size:ce.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},e))}})),n})($,u);return e(o,{children:[t(ft,{isOpen:!0,header:{icon:At($.type),title:I.label,onClose:A,actions:[{id:"edit-rule-btn-edit",label:bt.EDIT,icon:ci,active:y,onClick:N},{id:"edit-rule-btn-delete",label:bt.DELETE,icon:ni,color:u.v2.colors.red[500],active:S,onClick:F}]},footer:{actions:y?[{"data-id":"edit-rule-btn-cancel",label:bt.CANCEL,variant:ae.Secondary,onClick:O},{"data-id":"edit-rule-btn-save",label:bt.SAVE,variant:ae.Primary,onClick:R}]:[]},children:t(vt,{$padding:"4px 12px 12px",children:y&&m?t(cs,{}):t(V,{$gap:16,children:e(yt,{bgTint:"1000",children:[e(yt,{bgTint:"900",children:[t(Ct,{conditions:$.conditions||[]}),t(yt,{bgTint:"800",cellsPerRow:2,items:(_=$,M=I,[{id:"type",title:Re.TYPE,label:M.label},{id:"status",title:Re.STATUS,badge:{status:_.disabled?st.Unknown:ge.Success,label:_.disabled?Re.DISABLED:Re.ENABLED}},{id:"name",title:Re.NAME,label:_.ruleName||"-"},{id:"profile",title:Re.MANAGED_BY_PROFILE,label:_.profileName||"-"},{id:"notes",title:Re.NOTES,label:_.notes||"-"}])})]}),!!L.length&&t(yt,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(yt,{bgTint:"800",children:L})}),!!I.supportedLanguages.length&&t(yt,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(yt,{bgTint:"800",children:t(te,{$gap:12,$wrap:"wrap",children:I.supportedLanguages.map(e=>t(Et,{label:Ae[e],leftIcon:Oe(e),flex:"0.5"},e))})})})]})})})}),t(ml,{target:"instrumentation rule",isOpen:S,onClose:()=>w(!1),onApprove:P}),t(gl,{isOpen:null!==x,onClose:()=>k(null),onApprove:D})]});var _,M},rr=({onClickRestartPod:e,namespace:o,podName:n,nodeName:a,startTime:i,agentInjectedStatus:l,odigosHealthStatus:s,k8sHealthStatus:c,children:d})=>{const{formatDurationAgo:u}=Ot(),p=r(()=>({title:n,icon:xi,withCopy:!0}),[n]),h=r(()=>{const e=[],t=Dt(l);t&&e.push(t);const o=Dt(s,ki,"health");o&&e.push(o);const n=Dt(c,Ti,"health");return n&&e.push(n),e},[l,s,c]),m=r(()=>e?[{id:`restart-pod-${n}`,icon:$i,label:bt.RESTART_POD,onClick:()=>e(o,n)}]:void 0,[e,o,n]),g=r(()=>[{id:"nodeName",title:Re.NODE,label:a,withCopy:!0},{id:"startTime",title:Re.START_TIME,label:i?u(i,{style:"short"}):Re.NOT_RUNNING,labelTooltip:i}],[a,i,u]);return t(yt,{bgTint:"900",richTitle:p,badges:h,dropDataActions:m,items:g,withCollapse:!0,children:d})},cr=g.div`
80
+ `,tr=({clusterId:o,namespaceName:n,checkbox:a,isFutureApps:i,selectedCounts:l,isActive:s,onActive:r,handleSourceChange:c})=>{const{isVm:d}=y(),u=e=>{r(),c({clusterId:o,workloadId:{namespace:n},auto:e.auto,selected:e.all})};return t(Qs,{children:t(ks,{dataId:`namespace-${n}`,withCarret:!0,title:n,isSelected:s,onClick:r,isPartiallyChecked:a.partial,isChecked:a.all,onCheckboxChange:e=>u({auto:e,all:e}),children:e(te,{$gap:12,children:[!d&&t(er,{$visible:s||i,children:t(we,{text:Ks,children:t(q,{label:Gs,labelAlign:Z.Left,size:ct.S,value:i,onChange:e=>u({auto:e,all:e||void 0})})})}),e(te,{$gap:8,children:[t(re,{variant:dt.Span,size:ce.XXXS,color:Ce.Secondary,align:"right",children:Ws}),t(Ee,{label:`${l.sourced}/${l.total}`,status:s?ge.Default:st.Unknown,minWidth:"42px"})]})]})})})},or=({withCollapse:e,clusterId:o,clusterName:n,namespaces:a,selectedArea:i,setSelectedArea:l,handleSourceChange:s})=>{const c=r(()=>a.map(({name:e,totalWorkloads:a,selectedCount:r,isAllSourced:c,isSomeSourced:d,isFutureApps:u})=>t(tr,{clusterId:o,namespaceName:e,isFutureApps:u,checkbox:{all:c||u,partial:d},selectedCounts:{sourced:r,total:a},isActive:i.clusterId===o&&i.namespaceName===e,onActive:()=>l({clusterId:o,clusterName:n,namespaceName:e}),handleSourceChange:s},`${o}#${e}`)),[o,n,a,i]);return e?t(As,{title:n,list:c,noBgColor:!0}):c},nr=({onClose:o,onBack:a,onNext:i,selectedConnectionIds:s,setSelectedConnectionIds:c,persistSources:d,getAllClusterSnapshots:u,fetchNamespacesWithWorkloads:p,withOverlay:h,disableAnimation:m})=>{const{isVm:g}=y(),f=zs(g),{selectedStreamName:b}=Fe(),{progress:v,resetProgress:C}=ut(),{isFetching:S,setIsFetching:w,setSnapshots:x,formData:k,handleSourceChange:T,handleSelectAll:$,formDiff:I,isFormDirty:N}=Ol();n(()=>{let e=!1;w(!0);return(async()=>{try{if(u){const t=await u();!e&&t&&x(t)}else if(p){const t=await p();if(!e&&t.data?.length){const e={clusters:[{clusterId:mt,clusterName:ht,namespaces:t.data.map(e=>({name:e.name,selected:e.markedForInstrumentation&&e.dataStreamNames.includes(b),workloads:e.workloads?.map(e=>({namespace:e.id.namespace,name:e.id.name,kind:e.id.kind,selected:e.markedForInstrumentation?.markedForInstrumentation??!1}))||[]}))}]};x(e)}}}catch(e){}finally{e||w(!1)}})(),()=>{e=!0}},[b]);const[E,A]=l(""),[O,D]=l(lt.Namespace),[R,F]=l({showOnlySelected:!1}),[P,L]=l({clusterId:"",clusterName:"",namespaceName:""}),_=(({isFetching:o,formData:n,handleSourceChange:a,handleSelectAll:i,selectedArea:l,setSelectedArea:s,searchText:c,searchBy:d,filters:u})=>{const{isVm:p}=y(),h=zs(p),m=r(()=>n.map(e=>{const t=[...e.namespaces].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>El(e,c,u)).map(e=>({name:e.name,totalWorkloads:e.workloads.length,...Al(e)}));return{clusterId:e.clusterId,clusterName:e.clusterName,visibleNamespaces:t}}),[n,c,u]),g=r(()=>{let e=!1;for(const{visibleNamespaces:t}of m)for(const{totalWorkloads:o,selectedCount:n}of t)if(e=!0,n!==o)return!1;return e},[m]),{list:f,withFilterCount:b,filteredCount:v,totalCount:C}=r(()=>{const e=m.map(({clusterId:e,clusterName:o,visibleNamespaces:n})=>n.length?t(or,{withCollapse:m.length>1,clusterId:e,clusterName:o,namespaces:n,selectedArea:l,setSelectedArea:s,handleSourceChange:a},e):null),o=e.filter(e=>null!==e);return{list:o,withFilterCount:o.length!==e.length,filteredCount:o.length,totalCount:e.length}},[m,l]);return{width:"60%",header:e(te,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(te,{$gap:8,children:[t(re,{size:ce.XS,nowrap:!0,children:h.groupColumnHeader}),t(we,{text:b?Re.FILTERED_COUNT_TOOLTIP:void 0,children:t(Ee,{label:`${b?`${v} / ${C}`:C}`,status:st.Unknown})})]}),t(re,{"data-id":"namespaces-select-all",onClick:()=>i({boolean:!g,searchText:c,searchBy:d,filters:u}),disabled:!f.length,size:ce.XS,children:Hs(g)})]}),list:f.length?f:o?[t(Ke,{$height:"100%",children:t(Qe,{title:h.fetchingGroups.title,subTitle:h.fetchingGroups.subTitle,withSpinner:!0})},"loading")]:[t(Ke,{$height:"100%",children:t(se,c?{icon:Si,title:Xs,subTitle:h.noGroupMatchedFilter(c)}:{icon:Si,title:h.noGroups.title,subTitle:h.noGroups.subTitle})},"no-data")]}})({isFetching:S,formData:k,handleSourceChange:T,handleSelectAll:$,selectedArea:P,setSelectedArea:L,searchText:O===lt.Namespace?E:"",searchBy:O,filters:R}),M=(({formData:o,handleSourceChange:n,handleSelectAll:a,selectedArea:i,searchText:l,searchBy:s,filters:c})=>{const{tier:d,isVm:u}=y(),p=zs(u),h=d===rt.Onprem,m=r(()=>i.value.namespaceName?o.find(({clusterId:e})=>e===i.value.clusterId)?.namespaces.find(({name:e})=>e===i.value.namespaceName):void 0,[o,i.value.clusterId,i.value.namespaceName]),g=r(()=>m?[...m.workloads].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Il(e,l,c)):[],[m,l,c]),f=r(()=>!!g.length&&g.every(({selected:e})=>e),[g]),b=r(()=>{if(!m)return[];const{clusterId:e}=i.value,{name:o}=m;return g.map(({name:a,selected:i,kind:l})=>{const s=!u&&!h&&Nl.has(l);return t(Zs,{workloadName:a,workloadKind:l,isChecked:!s&&(i||!1),onToggle:()=>n({clusterId:e,workloadId:{namespace:o,name:a,kind:l}}),disabled:s,disabledReason:Ys},`${e}#${o}#${a}#${l}`)})},[g,m,i.value.clusterId]),{withFilterCount:v,filteredCount:C,totalCount:S}=r(()=>{const e=m?.workloads.length??0;return{withFilterCount:g.length!==e,filteredCount:g.length,totalCount:e}},[g,m]);return{width:"40%",header:e(te,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(te,{$gap:8,children:[t(re,{size:ce.XS,nowrap:!0,children:i.value.namespaceName?`${i.value.namespaceName} > ${p.itemColumnHeader}`:p.itemColumnHeader}),t(we,{text:v?Re.FILTERED_COUNT_TOOLTIP:void 0,children:t(Ee,{label:`${v?`${C} / ${S}`:S}`,status:st.Unknown})})]}),t(re,{"data-id":"workloads-select-all",onClick:()=>a({clusterId:i.value.clusterId,namespaceName:i.value.namespaceName,boolean:!f,searchText:l,searchBy:s,filters:c}),disabled:!b.length,size:ce.XS,children:Hs(f)})]}),list:b.length?b:[t(Ke,{$height:"100%",children:t(se,m?l?{icon:Ci,title:Xs,subTitle:Us(l)}:{icon:Ci,title:Vs,subTitle:p.noItemsInGroupSubTitle}:{icon:Ci,title:p.selectGroupPrompt.title,subTitle:p.selectGroupPrompt.subTitle})},"no-data")]}})({formData:k,handleSourceChange:T,handleSelectAll:$,selectedArea:{value:P},searchText:O===lt.Source?E:"",searchBy:O,filters:R});return t(hl,{isOpen:!0,withOverlay:h,disableAnimation:m,onClose:o?()=>{C(pt.BulkInstrumenting),o()}:void 0,onBack:a?()=>a(I):void 0,onNext:i?()=>i(I):void 0,nextIsSkip:!N,onSave:()=>d(I),header:{icon:Ci,title:Re.ADD_SOURCE,subTitle:Re.ADD_SOURCES_DESCRIPTION},connectionIds:s&&c?{value:s,setValue:c}:void 0,search:{value:E,onChange:e=>{A(e),O===lt.Namespace&&L({clusterId:"",clusterName:"",namespaceName:""})},placeholder:f.searchPlaceholder(O),segment:{options:[{label:f.groupSegmentLabel,value:lt.Namespace},{label:f.itemSegmentLabel,value:lt.Source}],selected:O,setSelected:D}},filters:e(te,{$gap:8,children:[t(re,{size:ce.XXXS,color:Ce.Secondary,nowrap:!0,children:js}),t(q,{name:"filter-selected",size:ct.S,label:Ws,value:R.showOnlySelected,onChange:e=>F(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:N,isFetching:S,progress:{title:Re.CREATING_SOURCES,subTitle:Re.CREATING_SOURCES_SUBTITLE,percentage:v[pt.BulkInstrumenting]?.percentage||0},leftColumn:_,rightColumn:M})},ar=({onClose:a,actionId:i,updateAction:s,deleteAction:d})=>{const u=f(),{actions:p}=at(),{selectedOption:h,loadAction:m,validateFormData:g,genericForm:b}=Cl(),[v,y]=l(!1),[C,S]=l(!1),[w,x]=l(null),k=v&&!!b?.isFormDirty,T=r(()=>p?.find(e=>gt(e)===i),[i,p]),$=r(()=>We.find(({type:e})=>e===T?.type)??Ge.find(({type:e})=>e===T?.type)??null,[T?.type]);n(()=>{T&&m(T)},[T]);const I=c(()=>{T&&y(!0)},[T]),N=c(()=>{T&&(m(T),y(!1))},[T,m]),E=c(()=>{k?x("close"):a()},[k,a]),A=c(()=>{k?x("cancel"):N()},[k,N]),O=c(()=>{const e=w;x(null),"close"===e?(N(),a()):N()},[w,N,a]),D=c(async()=>{if(T){const{errorMessage:e,preparedFormData:t}=g();e||(await s(T.id,t),y(!1))}},[T,g,s]),R=c(()=>{T&&S(!0)},[T]),F=c(async()=>{T&&(await d(T.id,T.type),a())},[T,d,a]);if(!T||!$)return null;const P=(e=>{const t=[],{type:o,fields:n}=e,a=e=>({status:e?ge.Success:st.Unknown,label:e?"True":"False",invertColors:!0});return o===le.K8sAttributes&&(t.push({id:"collectContainerAttributes",title:"Collect Container Attributes",badge:a(n.collectContainerAttributes)}),t.push({id:"collectReplicaSetAttributes",title:"Collect ReplicaSet Attributes",badge:a(n.collectReplicaSetAttributes)}),t.push({id:"collectWorkloadId",title:"Collect Workload ID",badge:a(n.collectWorkloadId)}),t.push({id:"collectClusterId",title:"Collect Cluster ID",badge:a(n.collectClusterId)}),n.labelsAttributes?.forEach(({labelKey:e,attributeKey:o,from:a,fromSources:i},l)=>{const s=i?.length?i.join(", "):a||J.Pod,r=(n.labelsAttributes?.length??0)>1?`Label #${l+1} `:"Label ";t.push({id:`label-${l}-key`,title:`${r}Key`,label:e}),t.push({id:`label-${l}-attr`,title:`${r}Attribute Key`,label:o}),t.push({id:`label-${l}-from`,title:`${r}From`,label:s})}),n.annotationsAttributes?.forEach(({annotationKey:e,attributeKey:o,from:a,fromSources:i},l)=>{const s=i?.length?i.join(", "):a||J.Pod,r=(n.annotationsAttributes?.length??0)>1?`Annotation #${l+1} `:"Annotation ";t.push({id:`annotation-${l}-key`,title:`${r}Key`,label:e}),t.push({id:`annotation-${l}-attr`,title:`${r}Attribute Key`,label:o}),t.push({id:`annotation-${l}-from`,title:`${r}From`,label:s})})),o===le.AddClusterInfo&&(t.push({id:"overwriteExistingValues",title:"Overwrite Existing Values",badge:a(n.overwriteExistingValues)}),n.clusterAttributes?.forEach(({attributeName:e,attributeStringValue:o},n)=>{t.push({id:`cluster-attr-${n}`,title:e,label:o})})),o===le.DeleteAttributes&&n.attributeNamesToDelete?.forEach((e,o)=>{t.push({id:`del-attr-${o}`,title:"Attribute"+((n.attributeNamesToDelete?.length??0)>1?` #${o+1}`:""),label:e})}),o===le.RenameAttributes&&Object.entries(n.renames||{}).forEach(([e,o],n)=>{t.push({id:`rename-${n}`,title:e,label:o})}),o===le.PiiMasking&&n.piiCategories?.forEach((e,o)=>{t.push({id:`pii-${o}`,title:"Category"+((n.piiCategories?.length??0)>1?` #${o+1}`:""),label:e})}),o===le.ErrorSampler&&t.push({id:"fallbackSamplingRatio",title:"Sampling Ratio",label:String(n.fallbackSamplingRatio??"-")}),o===le.ProbabilisticSampler&&t.push({id:"samplingPercentage",title:"Sampling Percentage",label:String(n.samplingPercentage??"-")}),o===le.LatencySampler&&n.endpointsFilters?.forEach(({serviceName:e,httpRoute:o,minimumLatencyThreshold:a,fallbackSamplingRatio:i},l)=>{const s=(n.endpointsFilters?.length??0)>1?`Endpoint #${l+1} `:"Endpoint ";t.push({id:`endpoint-${l}-service`,title:`${s}Service Name`,label:e}),t.push({id:`endpoint-${l}-route`,title:`${s}HTTP Route`,label:o}),t.push({id:`endpoint-${l}-latency`,title:`${s}Min. Latency`,label:String(a)}),t.push({id:`endpoint-${l}-fallback`,title:`${s}Fallback Sampling Ratio`,label:String(i)})}),o===le.ServiceNameSampler&&n.servicesNameFilters?.forEach(({serviceName:e,samplingRatio:o,fallbackSamplingRatio:a},i)=>{const l=(n.servicesNameFilters?.length??0)>1?`Filter #${i+1} `:"Filter ";t.push({id:`service-${i}-name`,title:`${l}Service Name`,label:e}),t.push({id:`service-${i}-ratio`,title:`${l}Sampling Ratio`,label:String(o)}),t.push({id:`service-${i}-fallback`,title:`${l}Fallback Sampling Ratio`,label:String(a)})}),o===le.SpanAttributeSampler&&n.attributeFilters?.forEach(({serviceName:e,attributeKey:o,fallbackSamplingRatio:a,condition:i},l)=>{const s=Object.keys(i)[0],r=i[s],c=(n.attributeFilters?.length??0)>1?`Filter #${l+1} `:"Filter ";t.push({id:`attr-${l}-service`,title:`${c}Service Name`,label:e}),t.push({id:`attr-${l}-key`,title:`${c}Attribute Key`,label:o}),t.push({id:`attr-${l}-fallback`,title:`${c}Fallback Sampling Ratio`,label:String(a)}),t.push({id:`attr-${l}-condition`,title:`${c}Condition`,label:s}),t.push({id:`attr-${l}-operation`,title:`${c}Operation`,label:r?.operation??"-"}),t.push({id:`attr-${l}-expected`,title:`${c}Expected Value`,label:String(r?.expectedValue??"-")}),"jsonCondition"===s&&t.push({id:`attr-${l}-jsonpath`,title:`${c}JSON Path`,label:r?.jsonPath??"-"})}),o===le.URLTemplatization&&n.urlTemplatizationRulesGroups?.forEach((e,o)=>{const a=(n.urlTemplatizationRulesGroups?.length??0)>1?`Group #${o+1} `:"Group ";e.filterK8sNamespace&&t.push({id:`group-${o}-ns`,title:`${a}Namespace`,label:e.filterK8sNamespace}),e.workloadFilters?.forEach((n,i)=>{const l=[n.kind,n.name].filter(Boolean).join("/");l&&t.push({id:`group-${o}-wf-${i}`,title:`${a}Workload${(e.workloadFilters?.length??0)>1?` #${i+1}`:""}`,label:l})});const i=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");i&&t.push({id:`group-${o}-templates`,title:`${a}Templates`,label:i}),e.notes&&t.push({id:`group-${o}-notes`,title:`${a}Notes`,label:e.notes})}),t})(T);return e(o,{children:[t(ft,{isOpen:!0,header:{icon:St(T.type),title:$.label,onClose:E,actions:[{id:"edit-action-btn-edit",label:bt.EDIT,icon:ci,active:v,onClick:I},{id:"edit-action-btn-delete",label:bt.DELETE,icon:ni,color:u.v2.colors.red[500],active:C,onClick:R}]},footer:{actions:v?[{"data-id":"edit-action-btn-cancel",label:bt.CANCEL,variant:ae.Secondary,onClick:A},{"data-id":"edit-action-btn-save",label:bt.SAVE,variant:ae.Primary,onClick:D}]:[]},children:t(vt,{$padding:"4px 12px 12px",children:v&&h?t(Zl,{}):t(V,{$gap:16,children:e(yt,{bgTint:"1000",children:[e(yt,{bgTint:"900",children:[t(Ct,{conditions:T.conditions||[]}),t(yt,{bgTint:"800",cellsPerRow:2,items:(L=T,_=$,[{id:"type",title:Re.TYPE,label:_.label},{id:"status",title:Re.STATUS,badge:{status:L.disabled?st.Unknown:ge.Success,label:L.disabled?Re.DISABLED:Re.ENABLED}},{id:"signals",title:Re.SIGNALS_FOR_PROCESSING,label:L.signals?.map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ")||"-"},{id:"name",title:Re.NAME,label:L.name||"-"},{id:"notes",title:Re.NOTES,label:L.notes||"-"}])})]}),!!P?.length&&t(yt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(yt,{bgTint:"800",cellsPerRow:2,items:P})})]})})})}),t(ml,{target:"action",isOpen:C,onClose:()=>S(!1),onApprove:F}),t(gl,{isOpen:null!==w,onClose:()=>x(null),onApprove:O})]});var L,_},ir=({onClose:o,connections:a,selectedConnectionIds:i,setSelectedConnectionIds:s,getEffectiveConfig:c,onApply:d})=>{const[u,p]=l(""),[h,m]=l({showOnlySelected:!1}),g=r(()=>a.filter(e=>{const t=!u||e.name.toLowerCase().includes(u.toLowerCase()),o=!h.showOnlySelected||h.showOnlySelected&&i.includes(e.id);return t&&o}),[a.length,i.length,u,h]),f=e=>{s(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[b,v]=l(!1),[y,C]=l(void 0),{formData:S,handleFormChange:w,areFormValuesEqual:x,resetFormData:k}=wt(y||{rollout:{automaticRolloutDisabled:!1}}),T=r(()=>i.length>1||void 0!==y&&!x(y,S),[i.length,y,S]);return n(()=>{1===i.length?(async e=>{if(b)return;v(!0);const t=await c(e);if(t){const e={rollout:{automaticRolloutDisabled:t.rollout?.automaticRolloutDisabled??!1}};C(e),k(e)}v(!1)})(i[0]):C(void 0)},[i.length]),t(hl,{isOpen:!0,onClose:o,onSave:()=>d(S,i),header:{icon:wi,title:"Cluster Configuration"},connectionIds:{value:i,setValue:s},search:{placeholder:"Search by cluster name",value:u,onChange:p},filters:e(te,{$gap:8,children:[t(re,{size:ce.XXXS,color:Ce.Secondary,nowrap:!0,children:"Show only:"}),t(q,{size:ct.S,label:"Selected",value:h.showOnlySelected,onChange:e=>m(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:T,isFetching:b,leftColumn:{width:"35%",header:e(te,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(te,{$gap:8,children:[t(re,{size:ce.XS,children:"Clusters"}),t(Ee,{label:g.length,status:st.Unknown})]}),e(te,{$gap:8,children:[t(re,{size:ce.XXXS,color:Ce.Secondary,align:"right",children:"Selected clusters"}),t(Ee,{label:`${i.length}/${g.length}`,status:st.Unknown})]})]}),list:g.map(e=>t(ks,{title:e.name,isChecked:i.includes(e.id),onClick:()=>f(e.id),onCheckboxChange:()=>f(e.id)},e.id))},rightColumn:{width:"65%",header:t(re,{size:ce.XS,children:"Configurations"}),list:[t(q,{label:"Automatic rollout disabled",tooltip:"Odigos automatically triggers a one-time rollout for workloads when instrumenting or uninstrumenting, ensuring that changes are applied without requiring manual intervention. When automatic rollout is disabled, Odigos will not restart workloads, and users will need to manually trigger rollouts after adding or removing sources.",value:S.rollout?.automaticRolloutDisabled||!1,onChange:e=>w("rollout.automaticRolloutDisabled",e)},"automatic-rollout-disabled")]}})},lr=({onClose:a,destinationId:i,getDestinationCategories:s,testConnection:u,updateDestination:p,deleteDestination:h})=>{const m=f(),{isVm:g}=y(),{destinations:b}=at(),{selectedStreamName:v}=Fe(),{activeForm:C,loadDestination:S,validateFormData:w,genericForm:x}=Sl(),k=d(null),[T,$]=l(!1),[I,N]=l(!1),[E,A]=l(null),[O,D]=l(!0),[R,F]=l(null),P=T&&!!x?.isFormDirty,L=r(()=>kt(b,v),[b,v]),_=r(()=>L?.find(e=>gt(e)===i),[i,L]);n(()=>{let e=!1;return D(!0),s().then(t=>{e||A(t?.destinationCategories.categories??[])}).catch(t=>{e||A([])}).finally(()=>{e||D(!1)}),()=>{e=!0}},[]),n(()=>{_&&E&&S(_,E)},[_,E]);const M=r(()=>_&&E?Tt(E,_):[],[_,E]),B=c(()=>{_&&$(!0)},[_]),z=c(()=>{_&&E&&(S(_,E),$(!1))},[_,E,S]),X=c(()=>{P?F("close"):a()},[P,a]),U=c(()=>{P?F("cancel"):z()},[P,z]),H=c(()=>{const e=R;F(null),"close"===e?(z(),a()):z()},[R,z,a]),j=c(async()=>{if(_){const{errorMessage:e,preparedFormData:t}=w();e||(await p(_.id,ye(t)),$(!1))}},[_,w,p]),W=c(()=>{_&&N(!0)},[_]),G=c(async()=>{_&&(await h(_.id),a())},[_,h,a]);if(!_)return null;const{icon:K,iconSrc:Y}=tt(_.destinationType.type),J=((e,t)=>{const o=[],n=xt(e,t),a=n.map(e=>({name:e.key,value:e.value})),i=be(e.exportedSignals);let l=[];const s=()=>{l.length&&(o.push({kind:"cells",id:`cells-${o.length}`,items:l}),l=[])};return n.forEach(({key:e,name:n,value:r})=>{const c=t.find(t=>t.name===e),{secret:d,componentType:u,componentProperties:p,hideFromReadData:h,customReadDataLabels:m}=c||{};if(h?.length&&he(h,i,a))return;const{type:g}=nt(p,{type:""}),f=d||"password"===g;if(m?.length)m.forEach(({condition:t,...o},n)=>{t==r&&l.push({id:`${e}-custom-${n}`,title:o.title,label:o.value})});else if(r)if(f)l.push({id:e,title:n,label:new Array(10).fill("•").join("")});else{if(u===ie.MultiInput){const t=nt(r,null);if(Array.isArray(t)&&t.length)return s(),void o.push({kind:"list",id:e,title:n,items:t.map((t,o)=>({id:`${e}-${o}`,label:String(t)}))})}if(u===ie.KeyValuePair){const t=nt(r,null);if(Array.isArray(t)&&t.length)return s(),void o.push({kind:"pairs",id:e,title:n,items:t.map((t,o)=>{const n=t&&"object"==typeof t?t:{};return{id:`${e}-${o}`,title:null!=n.key?String(n.key):"",label:null!=n.value?String(n.value):""}})})}l.push({id:e,title:n,label:r})}else l.push({id:e,title:n,label:"-"})}),s(),o})(_,M);return e(o,{children:[t(ft,{isOpen:!0,header:{icon:K,iconSrc:Y,title:_.name||_.destinationType.displayName,onClose:X,actions:[{id:"edit-destination-btn-edit",label:bt.EDIT,icon:ci,active:T,onClick:B},{id:"edit-destination-btn-delete",label:bt.DELETE,icon:ni,color:m.v2.colors.red[500],active:I,onClick:W}]},footer:{actions:T?[{"data-id":"edit-destination-btn-cancel",label:bt.CANCEL,variant:ae.Secondary,onClick:U},...C?.option.testConnectionSupported&&!g?[{"data-id":"edit-destination-btn-test-connection",label:bt.TEST_CONNECTION,variant:ae.Secondary,onClick:()=>k.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:bt.SAVE,variant:ae.Primary,onClick:j}]:[]},children:t(vt,{$padding:"4px 12px 12px",children:O?t(Ke,{$height:"50vh",children:t(Qe,{withSpinner:!0})}):T&&C?t(ts,{ref:k,isEdit:!0,testConnection:u}):t(V,{$gap:16,children:e(yt,{bgTint:"1000",children:[e(yt,{bgTint:"900",children:[!g&&t(Ct,{conditions:_.conditions||[]}),t(yt,{bgTint:"800",cellsPerRow:2,items:(q=_,[{id:"type",title:Re.TYPE,label:q.destinationType.displayName},{id:"status",title:Re.STATUS,badge:{status:q.disabled?st.Unknown:ge.Success,label:q.disabled?Re.DISABLED:Re.ENABLED}},{id:"monitors",title:Re.MONITORS,label:be(q.exportedSignals).map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ")||"-"},{id:"name",title:Re.NAME,label:q.name||"-"}])})]}),!!J.length&&t(yt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:J.map(e=>"cells"===e.kind?t(yt,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t(yt,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})})}),t(ml,{target:"destination",isOpen:I,onClose:()=>N(!1),onApprove:G}),t(gl,{isOpen:null!==R,onClose:()=>F(null),onApprove:H})]});var q},sr=({onClose:a,ruleId:i,updateInstrumentationRule:s,deleteInstrumentationRule:d})=>{const u=f(),{instrumentationRules:p}=at(),{addNotification:h}=It(),{selectedOption:m,loadRule:g,validateFormData:b,genericForm:v}=wl(),[y,C]=l(!1),[S,w]=l(!1),[x,k]=l(null),T=y&&!!v?.isFormDirty,$=r(()=>p?.find(e=>gt(e)===i),[i,p]),I=r(()=>it.find(({type:e})=>e===$?.type)??null,[$?.type]);n(()=>{$&&g($)},[$]);const N=c(()=>{if($){if(!$.mutable)return void h({type:ge.Warning,title:Nt.FORBIDDEN,message:Nt.CANNOT_EDIT_RULE,crdType:lt.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});C(!0)}},[$,h]),E=c(()=>{$&&(g($),C(!1))},[$,g]),A=c(()=>{T?k("close"):a()},[T,a]),O=c(()=>{T?k("cancel"):E()},[T,E]),D=c(()=>{const e=x;k(null),"close"===e?(E(),a()):E()},[x,E,a]),R=c(async()=>{if($){const{errorMessage:e,preparedFormData:t}=b();e||(await s($.ruleId,t),C(!1))}},[$,b,s]),F=c(()=>{if($){if(!$.mutable)return void h({type:ge.Warning,title:Nt.FORBIDDEN,message:Nt.CANNOT_DELETE_RULE,crdType:lt.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});w(!0)}},[$,h]),P=c(async()=>{$&&(await d($.ruleId),a())},[$,d,a]);if(!$||!I)return null;const L=((e,o)=>{const n=[];return e.payloadCollection&&Object.entries(e.payloadCollection).forEach(([e,o])=>{o&&n.push(t(re,{size:ce.XS,children:`• ${$t(e).toLowerCase()}`},e))}),e.codeAttributes&&Object.entries(e.codeAttributes).forEach(([e,o])=>{o&&n.push(t(re,{size:ce.XS,children:`• ${$t(e).toLowerCase()}`},e))}),e.headersCollection?.[xe.HeaderKeys]?.length&&e.headersCollection[xe.HeaderKeys].forEach(e=>{e&&n.push(t(re,{size:ce.XS,children:e},e))}),e.customInstrumentations&&(e.customInstrumentations[Ie.Java]?.forEach((e,a)=>{const i=new $e(e.className,e.methodName);if(i.Verify()){0===a&&n.push(t(re,{size:ce.XS,children:"Java Custom Probes:"},"java-custom-probes"));const e=i.toString();n.push(t(re,{size:ce.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},e))}}),e.customInstrumentations[Ie.Golang]?.forEach((e,a)=>{const i=new Te(e.packageName,e.functionName,e.receiverName,e.receiverMethodName);if(i.Verify()){0===a&&n.push(t(re,{size:ce.XS,children:"Golang Custom Probes:"},"golang-custom-probes"));const e=i.toString();n.push(t(re,{size:ce.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},e))}})),n})($,u);return e(o,{children:[t(ft,{isOpen:!0,header:{icon:At($.type),title:I.label,onClose:A,actions:[{id:"edit-rule-btn-edit",label:bt.EDIT,icon:ci,active:y,onClick:N},{id:"edit-rule-btn-delete",label:bt.DELETE,icon:ni,color:u.v2.colors.red[500],active:S,onClick:F}]},footer:{actions:y?[{"data-id":"edit-rule-btn-cancel",label:bt.CANCEL,variant:ae.Secondary,onClick:O},{"data-id":"edit-rule-btn-save",label:bt.SAVE,variant:ae.Primary,onClick:R}]:[]},children:t(vt,{$padding:"4px 12px 12px",children:y&&m?t(cs,{}):t(V,{$gap:16,children:e(yt,{bgTint:"1000",children:[e(yt,{bgTint:"900",children:[t(Ct,{conditions:$.conditions||[]}),t(yt,{bgTint:"800",cellsPerRow:2,items:(_=$,M=I,[{id:"type",title:Re.TYPE,label:M.label},{id:"status",title:Re.STATUS,badge:{status:_.disabled?st.Unknown:ge.Success,label:_.disabled?Re.DISABLED:Re.ENABLED}},{id:"name",title:Re.NAME,label:_.ruleName||"-"},{id:"profile",title:Re.MANAGED_BY_PROFILE,label:_.profileName||"-"},{id:"notes",title:Re.NOTES,label:_.notes||"-"}])})]}),!!L.length&&t(yt,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(yt,{bgTint:"800",children:L})}),!!I.supportedLanguages.length&&t(yt,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(yt,{bgTint:"800",children:t(te,{$gap:12,$wrap:"wrap",children:I.supportedLanguages.map(e=>t(Et,{label:Ae[e],leftIcon:Oe(e),flex:"0.5"},e))})})})]})})})}),t(ml,{target:"instrumentation rule",isOpen:S,onClose:()=>w(!1),onApprove:P}),t(gl,{isOpen:null!==x,onClose:()=>k(null),onApprove:D})]});var _,M},rr=({onClickRestartPod:e,namespace:o,podName:n,nodeName:a,startTime:i,agentInjectedStatus:l,odigosHealthStatus:s,k8sHealthStatus:c,children:d})=>{const{formatDurationAgo:u}=Ot(),p=r(()=>({title:n,icon:xi,withCopy:!0}),[n]),h=r(()=>{const e=[],t=Dt(l);t&&e.push(t);const o=Dt(s,ki,"health");o&&e.push(o);const n=Dt(c,Ti,"health");return n&&e.push(n),e},[l,s,c]),m=r(()=>e?[{id:`restart-pod-${n}`,icon:$i,label:bt.RESTART_POD,onClick:()=>e(o,n)}]:void 0,[e,o,n]),g=r(()=>[{id:"nodeName",title:Re.NODE,label:a,withCopy:!0},{id:"age",title:Re.AGE,label:i?u(i,{style:"short"}):Re.NOT_RUNNING,labelTooltip:i}],[a,i,u]);return t(yt,{bgTint:"900",richTitle:p,badges:h,dropDataActions:m,items:g,withCollapse:!0,children:d})},cr=g.div`
81
81
  display: flex;
82
82
  align-items: center;
83
83
  justify-content: space-between;
@@ -85,7 +85,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
85
85
  padding: ${({$noPadding:e})=>e?"0":"12px"};
86
86
  border-radius: 12px;
87
87
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
88
- `,dr=({podsOdigosHealthStatus:o,pods:n,noPadding:a})=>{const i=Ft(o?.status),l=$t(o?.name),s=o?.message,{totalPodsCount:c,injectedPodsCount:d,odigosHealthyPodsCount:u,k8sHealthyPodsCount:p}=r(()=>({totalPodsCount:n?.length||0,injectedPodsCount:n?.reduce((e,t)=>e+(Ft(t.agentInjectedStatus?.status)===ge.Success?1:0),0)||0,odigosHealthyPodsCount:n?.reduce((e,t)=>e+(t.odigosHealthStatus?.status===Rt.Success?1:0),0)||0,k8sHealthyPodsCount:n?.reduce((e,t)=>e+(t.k8sHealthStatus?.status===Rt.Success?1:0),0)||0}),[n]);return n?.length&&o&&i?e(cr,{$noPadding:a,children:[t(Pt,{invertColors:!0,hideBackground:!0,status:i,title:l,subTitle:s}),e(te,{$gap:8,children:[t(pr,{label:Re.PODS,count:c}),t(pr,{label:Re.INJECTIONS_HEALTHY,count:d,total:c}),t(pr,{label:Re.ODIGOS_HEALTHY,icon:ki,count:u,total:c}),t(pr,{label:Re.KUBERNETES_HEALTHY,icon:Ti,count:p,total:c})]})]}):null},ur=g.div`
88
+ `,dr=({podsOdigosHealthStatus:o,pods:n,noPadding:a})=>{const i=Pt(o?.status),l=$t(o?.name),s=o?.message,{totalPodsCount:c,injectionsAsExpectedCount:d,odigosHealthyPodsCount:u,k8sHealthyPodsCount:p}=r(()=>({totalPodsCount:n?.length||0,injectionsAsExpectedCount:n?.reduce((e,t)=>e+(t.agentInjectedStatus?.status===Rt.Success?1:0),0)||0,odigosHealthyPodsCount:n?.reduce((e,t)=>e+(t.odigosHealthStatus?.status===Rt.Success?1:0),0)||0,k8sHealthyPodsCount:n?.reduce((e,t)=>e+(t.k8sHealthStatus?.status===Rt.Success?1:0),0)||0}),[n]);return n?.length&&o&&i?e(cr,{$noPadding:a,children:[t(Ft,{invertColors:!0,hideBackground:!0,status:i,title:l,subTitle:s}),e(te,{$gap:8,children:[t(pr,{label:Re.PODS,count:c}),t(pr,{label:Re.INJECTIONS_AS_EXPECTED,count:d,total:c}),t(pr,{label:Re.ODIGOS_HEALTHY,icon:ki,count:u,total:c}),t(pr,{label:Re.KUBERNETES_HEALTHY,icon:Ti,count:p,total:c})]})]}):null},ur=g.div`
89
89
  display: flex;
90
90
  flex-direction: column;
91
91
  justify-content: center;
@@ -112,7 +112,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
112
112
  padding: 8px 12px;
113
113
  border-radius: 8px;
114
114
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
115
- `,Tr=({language:o,containerName:n,otelDistroName:a,runningStartedTime:i,started:l,ready:s,restartCount:c,isCrashLoop:d,waitingReasonEnum:u,waitingMessage:p,odigosHealthStatus:h,k8sHealthStatus:m,processes:g})=>{const{formatDurationAgo:f}=Ot(),b=r(()=>({title:n,icon:o?Oe(o):Ni,iconWithWrapper:!0}),[n,o]),v=r(()=>{const e=[],t=Dt({status:a?Rt.Success:Rt.Disabled,reasonEnum:a?Re.INSTRUMENTED_WITH_DISTRO(a):Re.UNINSTRUMENTED,message:""});t&&e.push(t);const o=Dt(h,ki,"health");o&&e.push(o);const n=Dt(m,Ti,"health");return n&&e.push(n),e},[m,h,a]),y=r(()=>[{id:"startTime",title:Re.START_TIME,label:i?f(i,{style:"short"}):Re.NOT_RUNNING,labelTooltip:i||""},{id:"blank",spacer:!0},{id:"started",badge:{status:l?ge.Success:Mt.Disabled,leftIcon:l?li:si,label:l?Re.STARTED:Re.NOT_STARTED,textSize:ce.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"ready",badge:{status:s?ge.Success:Mt.Disabled,leftIcon:s?li:si,label:s?Re.READY:Re.NOT_READY,textSize:ce.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"isCrashLoop",badge:{status:d?ge.Error:ge.Success,leftIcon:d?si:li,label:d?Re.CRASHLOOP:Re.NO_CRASHLOOP,textSize:ce.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"restartCount",title:Re.RESTARTS,badge:{status:c?ge.Error:void 0,label:c||0,textSize:ce.XXXS}}],[i,f,l,s,d,c]),C=r(()=>p?$t(u):"",[p,u]);return e(yt,{bgTint:"750",richTitle:b,badges:v,items:y,withCollapse:!0,children:[p&&t(kr,{children:e(te,{$gap:10,$alignItems:"center",children:[t(Et,{variant:zt.Pink,leftIcon:Ti,label:C}),t(re,{size:ce.XXXS,color:Ce.Error,children:p})]})}),(g??[]).map((e,o)=>{const a=o+1;return t(Cr,{...e,overrideProcessNum:a},`pod-container-${n}-process-${a}`)})]})},$r=({podName:e,namespace:o,hasRestarted:n})=>{const a=r(()=>({title:Re.DEBUG_COMMANDS,titleSize:ce.XS}),[]),i=r(()=>[{label:Re.GET_POD_YAML,value:`kubectl get pod ${e} -n ${o} -o yaml`},{label:Re.DESCRIBE_POD,value:`kubectl describe pod ${e} -n ${o}`},{label:Re.GET_POD_LOGS,value:`kubectl logs ${e} -n ${o}${n?" -p":""}`}],[e,o,n]);return t(yt,{bgTint:"800",richTitle:a,withCollapse:!0,children:i.map(({label:e,value:o})=>t(Bt,{bgTint:"700",label:e,value:o},e))})},Ir=({source:n,onClickRestartPod:a})=>{const i=n?.pods??[],l=i.length>0,s=r(()=>i.some(e=>e.containers?.some(e=>e.restartCount&&e.restartCount>0)),[i]),c=r(()=>({title:Re.PODS,badge:{label:i.length}}),[i.length]);return t(V,{$gap:12,children:l?e(o,{children:[t(dr,{podsOdigosHealthStatus:n.podsOdigosHealthStatus,pods:i}),t(yt,{bgTint:"1000",richTitle:c,children:i.map(o=>e(rr,{...o,namespace:n.id.namespace,onClickRestartPod:a,children:[t($r,{podName:o.podName,namespace:n.id.namespace,hasRestarted:s}),t(xr,{podContainers:o.containers,sourceContainers:n.containers})]},`pod-${o.podName}`))})]}):t(Ke,{$height:"70vh",children:t(se,{subTitle:Re.NO_RUNNING_PODS})})})},Nr=({source:o,fetchPeerSources:a})=>{const i=r(()=>o.serviceName||o.id.name,[o]),[s,d]=l(!1),[u,p]=l(null),h=c(()=>{d(!0),a(i).then(({data:e})=>p(e?.peerSources??null)).finally(()=>d(!1))},[i]);return n(()=>{h()},[h]),!u||s?t(Ke,s?{$height:"70vh",children:t(Qe,{withSpinner:!0})}:{$height:"70vh",children:t(se,{subTitle:Re.COULD_NOT_FETCH_PEER_SOURCES})}):e(te,{$gap:16,$alignItems:"flex-start",children:[t(Er,{icon:Ei,title:Re.INBOUND,subTitle:Re.INBOUND_DESCRIPTION(i),onRefresh:h,items:u?.inbound??[]}),t(Er,{icon:Ai,title:Re.OUTBOUND,subTitle:Re.OUTBOUND_DESCRIPTION(i),onRefresh:h,items:u?.outbound??[]})]})},Er=({icon:o,title:n,subTitle:a,onRefresh:i,items:s})=>{const[c,d]=l(""),u=r(()=>s.filter(e=>e.serviceName.toLowerCase().includes(c.toLowerCase())),[s,c]);return e(yt,{bgTint:"1000",richTitle:{icon:o,title:n,titleSize:ce.XS,subTitle:a,subTitleSize:ce.XXXS,badge:{label:s.length}},actions:[{id:"refresh",type:Xt.Button,buttonProps:{variant:ae.Secondary,size:ne.S,leftIcon:$i,onClick:i}}],children:[t(Vt,{value:c,onChange:d,width:"100%"}),t(Ut,{height:"calc(100vh - 284px)",gap:4,elements:u.length||c?!u.length&&c?[t(Ke,{$height:"50vh",children:t(se,{icon:o,title:Re.NO_RESULTS,subTitle:Re.NO_RESULTS_FOR_FILTER(c)})},"no-results")]:u.map(e=>t(Or,{...e},`${n}-${e.serviceName}`)):[t(Ke,{$height:"50vh",children:t(se,{icon:o,title:`No ${n} connections yet`,subTitle:n===Re.INBOUND?Re.NO_INBOUND_CONNECTIONS_DESCRIPTION:Re.NO_OUTBOUND_CONNECTIONS_DESCRIPTION})},"no-data")]})]})},Ar=g.div`
115
+ `,Tr=({language:o,containerName:n,otelDistroName:a,runningStartedTime:i,started:l,ready:s,restartCount:c,isCrashLoop:d,waitingReasonEnum:u,waitingMessage:p,odigosHealthStatus:h,k8sHealthStatus:m,processes:g})=>{const{formatDurationAgo:f}=Ot(),b=r(()=>({title:n,icon:o?Oe(o):Ni,iconWithWrapper:!0}),[n,o]),v=r(()=>{const e=[],t=Dt({status:a?Rt.Success:Rt.Disabled,reasonEnum:a?Re.INSTRUMENTED_WITH_DISTRO(a):Re.UNINSTRUMENTED,message:""});t&&e.push(t);const o=Dt(h,ki,"health");o&&e.push(o);const n=Dt(m,Ti,"health");return n&&e.push(n),e},[m,h,a]),y=r(()=>[{id:"runningTime",title:Re.RUNNING_TIME,label:i?f(i,{style:"short"}):Re.NOT_RUNNING,labelTooltip:`${Re.RUNNING_TIME_TOOLTIP}. (${i})`},{id:"blank",spacer:!0},{id:"started",badge:{status:l?ge.Success:Mt.Disabled,leftIcon:l?li:si,label:l?Re.STARTED:Re.NOT_STARTED,textSize:ce.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"ready",badge:{status:s?ge.Success:Mt.Disabled,leftIcon:s?li:si,label:s?Re.READY:Re.NOT_READY,textSize:ce.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"isCrashLoop",badge:{status:d?ge.Error:ge.Success,leftIcon:d?si:li,label:d?Re.CRASHLOOP:Re.NO_CRASHLOOP,textSize:ce.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"restartCount",title:Re.RESTARTS,badge:{status:c?ge.Error:void 0,label:c||0,textSize:ce.XXXS}}],[i,f,l,s,d,c]),C=r(()=>p?$t(u):"",[p,u]);return e(yt,{bgTint:"750",richTitle:b,badges:v,items:y,withCollapse:!0,children:[p&&t(kr,{children:e(te,{$gap:10,$alignItems:"center",children:[t(Et,{variant:Bt.Pink,leftIcon:Ti,label:C}),t(re,{size:ce.XXXS,color:Ce.Error,children:p})]})}),(g??[]).map((e,o)=>{const a=o+1;return t(Cr,{...e,overrideProcessNum:a},`pod-container-${n}-process-${a}`)})]})},$r=({podName:e,namespace:o,hasRestarted:n})=>{const a=r(()=>({title:Re.DEBUG_COMMANDS,titleSize:ce.XS}),[]),i=r(()=>[{label:Re.GET_POD_YAML,value:`kubectl get pod ${e} -n ${o} -o yaml`},{label:Re.DESCRIBE_POD,value:`kubectl describe pod ${e} -n ${o}`},{label:Re.GET_POD_LOGS,value:`kubectl logs ${e} -n ${o}${n?" -p":""}`}],[e,o,n]);return t(yt,{bgTint:"800",richTitle:a,withCollapse:!0,children:i.map(({label:e,value:o})=>t(zt,{bgTint:"700",label:e,value:o},e))})},Ir=({source:n,onClickRestartPod:a})=>{const i=n?.pods??[],l=i.length>0,s=r(()=>i.some(e=>e.containers?.some(e=>e.restartCount&&e.restartCount>0)),[i]),c=r(()=>({title:Re.PODS,badge:{label:i.length}}),[i.length]);return t(V,{$gap:12,children:l?e(o,{children:[t(dr,{podsOdigosHealthStatus:n.podsOdigosHealthStatus,pods:i}),t(yt,{bgTint:"1000",richTitle:c,children:i.map(o=>e(rr,{...o,namespace:n.id.namespace,onClickRestartPod:a,children:[t($r,{podName:o.podName,namespace:n.id.namespace,hasRestarted:s}),t(xr,{podContainers:o.containers,sourceContainers:n.containers})]},`pod-${o.podName}`))})]}):t(Ke,{$height:"70vh",children:t(se,{title:Re.NO_RUNNING_PODS,subTitle:Re.NO_RUNNING_PODS_SUBTITLE})})})},Nr=({source:o,fetchPeerSources:a})=>{const i=r(()=>o.serviceName||o.id.name,[o]),[s,d]=l(!1),[u,p]=l(null),h=c(()=>{d(!0),a(i).then(({data:e})=>p(e?.peerSources??null)).finally(()=>d(!1))},[i]);return n(()=>{h()},[h]),!u||s?t(Ke,s?{$height:"70vh",children:t(Qe,{withSpinner:!0})}:{$height:"70vh",children:t(se,{subTitle:Re.COULD_NOT_FETCH_PEER_SOURCES})}):e(te,{$gap:16,$alignItems:"flex-start",children:[t(Er,{icon:Ei,title:Re.INBOUND,subTitle:Re.INBOUND_DESCRIPTION(i),onRefresh:h,items:u?.inbound??[]}),t(Er,{icon:Ai,title:Re.OUTBOUND,subTitle:Re.OUTBOUND_DESCRIPTION(i),onRefresh:h,items:u?.outbound??[]})]})},Er=({icon:o,title:n,subTitle:a,onRefresh:i,items:s})=>{const[c,d]=l(""),u=r(()=>s.filter(e=>e.serviceName.toLowerCase().includes(c.toLowerCase())),[s,c]);return e(yt,{bgTint:"1000",richTitle:{icon:o,title:n,titleSize:ce.XS,subTitle:a,subTitleSize:ce.XXXS,badge:{label:s.length}},actions:[{id:"refresh",type:Xt.Button,buttonProps:{variant:ae.Secondary,size:ne.S,leftIcon:$i,onClick:i}}],children:[t(Vt,{value:c,onChange:d,width:"100%"}),t(Ut,{height:"calc(100vh - 284px)",gap:4,elements:u.length||c?!u.length&&c?[t(Ke,{$height:"50vh",children:t(se,{icon:o,title:Re.NO_RESULTS,subTitle:Re.NO_RESULTS_FOR_FILTER(c)})},"no-results")]:u.map(e=>t(Or,{...e},`${n}-${e.serviceName}`)):[t(Ke,{$height:"50vh",children:t(se,{icon:o,title:`No ${n} connections yet`,subTitle:n===Re.INBOUND?Re.NO_INBOUND_CONNECTIONS_DESCRIPTION:Re.NO_OUTBOUND_CONNECTIONS_DESCRIPTION})},"no-data")]})]})},Ar=g.div`
116
116
  display: flex;
117
117
  align-items: center;
118
118
  justify-content: space-between;
@@ -126,7 +126,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
126
126
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
127
127
  }
128
128
  `}
129
- `,Or=({serviceName:o,isVirtual:n,nodeAttributes:a})=>{const i=Ht(e=>e.drawerEntityId),l=at(e=>e.sources),s=r(()=>l.find(e=>e.id.name===o||e.serviceName===o),[l,o]),c=r(()=>s&&JSON.stringify(jt(s))!==JSON.stringify(jt(i)),[s,i]),d=r(()=>{if(n){const e=Object.fromEntries((a??[]).map(({key:e,value:t})=>[e,t]));return[Wt({serviceName:o,attributes:e})]}if("user"===o?.toLowerCase())return[Oi];const e=s?Gt(s):void 0;return e?.length?e:[Ni]},[n,a,o,s]),u=c?()=>{const{setDrawerType:e,setDrawerEntityId:t}=Ht.getState();e(lt.Source),t({namespace:s?.id.namespace??"",name:s?.id.name??"",kind:s?.id.kind??""})}:void 0;return e(Ar,{onClick:u,$withClick:!!u,children:[e(te,{$gap:8,children:[t(Kt,{icons:d}),t(re,{size:ce.XXS,children:o})]}),n&&t(Ee,{status:ge.Info,label:Re.VIRTUAL,textSize:ce.XXXS,invertColors:!0,tooltip:Re.VIRTUAL_TOOLTIP})]})},Dr=({title:o,children:n})=>e(V,{$gap:8,children:[t(re,{size:ce.XXXS,color:Ce.Secondary,children:o}),n]}),Rr=({source:o})=>{const n=r(()=>{const[e,t]=Yt(o.telemetryMetrics?.[0]?.throughputBytes||0).split(" ");return{value:e,units:t}},[o]);return t(Dr,{title:Re.THROUGHPUT_LAST_10_SECONDS,children:e(te,{$alignItems:"flex-end",$gap:4,children:[t(re,{size:ce.L,children:n.value}),t(re,{size:ce.XS,variant:dt.Span,children:n.units})]})})},Fr=({source:o})=>{const{CopyButton:n}=Jt();return t(Dr,{title:Re.NAMESPACE,children:e(te,{children:[t(Et,{variant:zt.Blue,label:o.id.namespace}),t(n,{value:o.id.namespace,size:Ze.XS})]})})},Pr=({source:e})=>t(Dr,{title:Re.KIND,children:t(te,{children:t(Et,{variant:zt.Blue,label:e.id.kind})})}),Lr=({source:o})=>{const{CopyButton:n}=Jt();return t(Dr,{title:Re.NAME,children:e(te,{children:[t(Et,{variant:zt.Blue,label:o.id.name}),t(n,{value:o.id.name,size:Ze.XS})]})})},_r=({source:o})=>t(yt,{children:e(te,{$gap:24,$alignItems:"flex-start",$justifyContent:"flex-start",$wrap:"wrap",children:[t(Rr,{source:o}),t(Fr,{source:o}),t(Pr,{source:o}),t(Lr,{source:o})]})}),Mr=g.div`
129
+ `,Or=({serviceName:o,isVirtual:n,nodeAttributes:a})=>{const i=Ht(e=>e.drawerEntityId),l=at(e=>e.sources),s=r(()=>l.find(e=>e.id.name===o||e.serviceName===o),[l,o]),c=r(()=>s&&JSON.stringify(jt(s))!==JSON.stringify(jt(i)),[s,i]),d=r(()=>{if(n){const e=Object.fromEntries((a??[]).map(({key:e,value:t})=>[e,t]));return[Wt({serviceName:o,attributes:e})]}if("user"===o?.toLowerCase())return[Oi];const e=s?Gt(s):void 0;return e?.length?e:[Ni]},[n,a,o,s]),u=c?()=>{const{setDrawerType:e,setDrawerEntityId:t}=Ht.getState();e(lt.Source),t({namespace:s?.id.namespace??"",name:s?.id.name??"",kind:s?.id.kind??""})}:void 0;return e(Ar,{onClick:u,$withClick:!!u,children:[e(te,{$gap:8,children:[t(Kt,{icons:d}),t(re,{size:ce.XXS,children:o})]}),n&&t(Ee,{status:ge.Info,label:Re.VIRTUAL,textSize:ce.XXXS,invertColors:!0,tooltip:Re.VIRTUAL_TOOLTIP})]})},Dr=({title:o,children:n})=>e(V,{$gap:8,children:[t(re,{size:ce.XXXS,color:Ce.Secondary,children:o}),n]}),Rr=({source:o})=>{const n=r(()=>{const[e,t]=Yt(o.telemetryMetrics?.[0]?.throughputBytes||0).split(" ");return{value:e,units:t}},[o]);return t(Dr,{title:Re.THROUGHPUT_LAST_10_SECONDS,children:e(te,{$alignItems:"flex-end",$gap:4,children:[t(re,{size:ce.L,children:n.value}),t(re,{size:ce.XS,variant:dt.Span,children:n.units})]})})},Fr=({source:o})=>{const{CopyButton:n}=Jt();return t(Dr,{title:Re.NAMESPACE,children:e(te,{children:[t(Et,{variant:Bt.Blue,label:o.id.namespace}),t(n,{value:o.id.namespace,size:Ze.XS})]})})},Pr=({source:e})=>t(Dr,{title:Re.KIND,children:t(te,{children:t(Et,{variant:Bt.Blue,label:e.id.kind})})}),Lr=({source:o})=>{const{CopyButton:n}=Jt();return t(Dr,{title:Re.NAME,children:e(te,{children:[t(Et,{variant:Bt.Blue,label:o.id.name}),t(n,{value:o.id.name,size:Ze.XS})]})})},_r=({source:o})=>t(yt,{children:e(te,{$gap:24,$alignItems:"flex-start",$justifyContent:"flex-start",$wrap:"wrap",children:[t(Rr,{source:o}),t(Fr,{source:o}),t(Pr,{source:o}),t(Lr,{source:o})]})}),Mr=g.div`
130
130
  display: flex;
131
131
  align-items: center;
132
132
  gap: 6px;
@@ -135,31 +135,31 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
135
135
  cursor: ${({$clickable:e})=>e?"pointer":"default"};
136
136
  transition: background-color 0.15s ease;
137
137
  ${({$clickable:e,theme:t})=>e&&`\n &:hover {\n background-color: ${t.v2.colors.silver[700]};\n }\n `}
138
- `,zr=g.div`
138
+ `,Br=g.div`
139
139
  display: flex;
140
140
  align-items: center;
141
141
  justify-content: center;
142
142
  flex-shrink: 0;
143
143
  width: 18px;
144
144
  height: 18px;
145
- `,Br=g.div`
145
+ `,zr=g.div`
146
146
  flex: 1;
147
147
  min-width: 0;
148
148
  display: flex;
149
- `,Xr=({chevron:o,onClick:n,label:a,name:i,badges:l,action:s,paddingLeft:r})=>{const c=f();return e(Mr,{$clickable:!!n,$paddingLeft:r,onClick:n,children:[o&&t(zr,{children:t(o,{size:18,fill:c.v2.colors.silver[200]})}),t(re,{size:ce.XXXS,color:Ce.Secondary,nowrap:!0,children:a}),t(Br,{children:t(re,{size:ce.XS,nowrap:!0,children:i})}),s&&t(we,{text:s.tooltip,children:t(qe,{icon:s.icon,size:Ze.XS,onClick:s.onClick})}),l.map(({key:e,...o})=>t(Vr,{...o},e))]})},Vr=({status:e,leftIcon:o,label:n,tooltip:a})=>{const i=o||(e===ge.Success?li:si);return t(Ee,{status:e,leftIcon:i,label:n,tooltip:a,textSize:ce.XXXS,invertColors:!0,useSecondaryTone:!0})},Ur=({overrideProcessNum:e,pod:o,container:n,process:a,onJumpToProcess:i})=>{const l=r(()=>vr({overrideProcessNum:e,identifyingAttributes:a.identifyingAttributes}),[e,a.identifyingAttributes]),s=r(()=>{const e=[],t=Dt(a.healthStatus,ki,"health");return t&&e.push(t),e},[]);return t(Xr,{label:Re.PROCESS,name:l?Re.PID(l):Re.PROCESS_FALLBACK_NAME,paddingLeft:br,action:i?{icon:Di,onClick:()=>i(o,n,a),tooltip:Re.OPEN_IN_POD_TAB}:void 0,badges:s})},Hr=g.div`
149
+ `,Xr=({chevron:o,onClick:n,label:a,name:i,badges:l,action:s,paddingLeft:r})=>{const c=f();return e(Mr,{$clickable:!!n,$paddingLeft:r,onClick:n,children:[o&&t(Br,{children:t(o,{size:18,fill:c.v2.colors.silver[200]})}),t(re,{size:ce.XXXS,color:Ce.Secondary,nowrap:!0,children:a}),t(zr,{children:t(re,{size:ce.XS,nowrap:!0,children:i})}),s&&t(we,{text:s.tooltip,children:t(qe,{icon:s.icon,size:Ze.XS,onClick:s.onClick})}),l.map(({key:e,...o})=>t(Vr,{...o},e))]})},Vr=({status:e,leftIcon:o,label:n,tooltip:a})=>{const i=o||(e===ge.Success?li:si);return t(Ee,{status:e,leftIcon:i,label:n,tooltip:a,textSize:ce.XXXS,invertColors:!0,useSecondaryTone:!0})},Ur=({overrideProcessNum:e,pod:o,container:n,process:a,onJumpToProcess:i})=>{const l=r(()=>vr({overrideProcessNum:e,identifyingAttributes:a.identifyingAttributes}),[e,a.identifyingAttributes]),s=r(()=>{const e=[],t=Dt(a.healthStatus,ki,"health");return t&&e.push(t),e},[]);return t(Xr,{label:Re.PROCESS,name:l?Re.PID(l):Re.PROCESS_FALLBACK_NAME,paddingLeft:br,action:i?{icon:Di,onClick:()=>i(o,n,a),tooltip:Re.OPEN_IN_POD_TAB}:void 0,badges:s})},Hr=g.div`
150
150
  display: flex;
151
151
  flex-direction: column;
152
152
  align-self: stretch;
153
153
  border-radius: 8px;
154
154
  background-color: ${({theme:e,$isExpanded:t})=>t?e.v2.colors.silver[750]:"transparent"};
155
- `,jr=({pod:o,container:n,onJumpToProcess:a})=>{const[i,s]=l(!1),c=r(()=>{const e=[],t=Ft(n.odigosHealthStatus?.status);t&&e.push({key:"odigos-health",status:t,leftIcon:ki,label:qt(t,n.odigosHealthStatus?.reasonEnum),tooltip:n.odigosHealthStatus?.message});const o=Ft(n.k8sHealthStatus?.status);return o&&e.push({key:"k8s-health",status:o,leftIcon:Ti,label:qt(o,n.k8sHealthStatus?.reasonEnum),tooltip:n.k8sHealthStatus?.message}),e},[]),d=n.processes??[],u=d.length>0;return e(Hr,{$isExpanded:i,children:[t(Xr,{chevron:u?i?fi:pi:void 0,onClick:u?()=>s(e=>!e):void 0,label:Re.CONTAINER,name:n.containerName,paddingLeft:fr+(u?0:24),badges:c}),u&&i&&t(V,{$gap:0,$padding:`0 ${mr}px`,children:d.map((e,i)=>{const l=i+1;return t(Ur,{overrideProcessNum:l,pod:o,container:n,process:e,onJumpToProcess:a},`pod-${o.podName}-container-${n.containerName}-process-${l}`)})})]})},Wr=g.div`
155
+ `,jr=({pod:o,container:n,onJumpToProcess:a})=>{const[i,s]=l(!1),c=r(()=>{const e=[],t=Pt(n.odigosHealthStatus?.status);t&&e.push({key:"odigos-health",status:t,leftIcon:ki,label:qt(t,n.odigosHealthStatus?.reasonEnum),tooltip:n.odigosHealthStatus?.message});const o=Pt(n.k8sHealthStatus?.status);return o&&e.push({key:"k8s-health",status:o,leftIcon:Ti,label:qt(o,n.k8sHealthStatus?.reasonEnum),tooltip:n.k8sHealthStatus?.message}),e},[]),d=n.processes??[],u=d.length>0;return e(Hr,{$isExpanded:i,children:[t(Xr,{chevron:u?i?fi:pi:void 0,onClick:u?()=>s(e=>!e):void 0,label:Re.CONTAINER,name:n.containerName,paddingLeft:fr+(u?0:24),badges:c}),u&&i&&t(V,{$gap:0,$padding:`0 ${mr}px`,children:d.map((e,i)=>{const l=i+1;return t(Ur,{overrideProcessNum:l,pod:o,container:n,process:e,onJumpToProcess:a},`pod-${o.podName}-container-${n.containerName}-process-${l}`)})})]})},Wr=g.div`
156
156
  display: flex;
157
157
  flex-direction: column;
158
158
  align-self: stretch;
159
159
  border-radius: 8px;
160
160
  background-color: ${({theme:e,$isExpanded:t})=>t?e.v2.colors.silver[800]:"transparent"};
161
161
  padding-bottom: ${({$isExpanded:e})=>e?"12px":"0"};
162
- `,Gr=({pod:o,onJumpToProcess:n})=>{const[a,i]=l(!1),s=o.containers??[],c=s.length>0,d=r(()=>{const e=[],t=Dt(o.agentInjectedStatus);t&&e.push(t);const n=Dt(o.odigosHealthStatus,ki,"health");n&&e.push(n);const a=Dt(o.k8sHealthStatus,Ti,"health");return a&&e.push(a),e},[o.k8sHealthStatus,o.odigosHealthStatus,o.agentInjectedStatus]);return e(Wr,{$isExpanded:a,children:[t(Xr,{chevron:c?a?fi:pi:void 0,onClick:c?()=>i(e=>!e):void 0,label:Re.POD,name:o.podName,paddingLeft:gr+(c?0:24),badges:d}),a&&c&&t(V,{$gap:0,$padding:`0 ${hr}px`,children:s.map(e=>t(jr,{pod:o,container:e,onJumpToProcess:n},`pod-${o.podName}-container-${e.containerName}`))})]})},Kr=({pods:e,onJumpToProcess:o})=>e?.length?t(V,{$gap:4,children:e.map(e=>t(Gr,{pod:e,onJumpToProcess:o},`pod-${e.podName}`))}):null,Yr=({source:o})=>t(yt,{bgTint:"1000",richTitle:{title:Re.PODS,badge:{label:o.pods?.length||0}},withCollapse:!0,collapseIsDefaultOpen:!0,children:e(yt,{bgTint:"900",children:[t(dr,{podsOdigosHealthStatus:o.podsOdigosHealthStatus,pods:o.pods,noPadding:!0}),t(Kr,{pods:o.pods})]})}),Jr=({source:e})=>{const o=r(()=>e.workloadOdigosHealthStatus?{status:e.workloadOdigosHealthStatus.status?Zt(e.workloadOdigosHealthStatus.status):st.Unknown,title:$t(e.workloadOdigosHealthStatus.reasonEnum),subTitle:e.workloadOdigosHealthStatus.message}:null,[e]);return o?t(Pt,{...o,width:"calc(100% - 32px)"}):null},qr="calc(50% - 6px)",Zr=({source:o,onClickRollout:n,onClickRollback:a})=>{const i=r(()=>{const{status:e,reasonEnum:t,message:a}=o.conditions?.rollout||{},i=Ft(e);if(!i)return null;return{status:i,title:t?.toLowerCase().includes("rollout")?$t(t):`${Re.ROLLOUT} ${$t(t)}`,subTitle:a,action:i!==ge.Success?{icon:$i,tooltip:Re.ROLLOUT_RESTART,onClick:n}:void 0}},[o]),l=r(()=>{const{status:e,reasonEnum:t,message:n}=o.autoRollback?.autoRollbackStatus||{},i=Ft(e);if(!i)return null;return{status:i,title:t?.toLowerCase().includes("rollback")?$t(t):`${Re.ROLLBACK} ${$t(t)}`,subTitle:n,action:i!==ge.Success?{icon:$i,tooltip:Re.ROLLBACK_RECOVER,onClick:a}:void 0}},[o]);return i||l?t(yt,{bgTint:"1000",children:e(te,{$gap:12,$alignItems:"stretch",children:[i&&t(Pt,{invertColors:!0,slim:!0,width:l?qr:"100%",...i}),l&&t(Pt,{invertColors:!0,slim:!0,width:qr,...l})]})}):null},Qr=m(null),ec=g.div`
162
+ `,Gr=({pod:o,onJumpToProcess:n})=>{const[a,i]=l(!1),s=o.containers??[],c=s.length>0,d=r(()=>{const e=[],t=Dt(o.agentInjectedStatus);t&&e.push(t);const n=Dt(o.odigosHealthStatus,ki,"health");n&&e.push(n);const a=Dt(o.k8sHealthStatus,Ti,"health");return a&&e.push(a),e},[o.k8sHealthStatus,o.odigosHealthStatus,o.agentInjectedStatus]);return e(Wr,{$isExpanded:a,children:[t(Xr,{chevron:c?a?fi:pi:void 0,onClick:c?()=>i(e=>!e):void 0,label:Re.POD,name:o.podName,paddingLeft:gr+(c?0:24),badges:d}),a&&c&&t(V,{$gap:0,$padding:`0 ${hr}px`,children:s.map(e=>t(jr,{pod:o,container:e,onJumpToProcess:n},`pod-${o.podName}-container-${e.containerName}`))})]})},Kr=({pods:e,onJumpToProcess:o})=>e?.length?t(V,{$gap:4,children:e.map(e=>t(Gr,{pod:e,onJumpToProcess:o},`pod-${e.podName}`))}):t(Ke,{children:t(se,{title:Re.NO_RUNNING_PODS,subTitle:Re.NO_RUNNING_PODS_SUBTITLE})}),Yr=({source:o})=>t(yt,{bgTint:"1000",richTitle:{title:Re.PODS,badge:{label:o.pods?.length||0}},withCollapse:!0,collapseIsDefaultOpen:!0,children:e(yt,{bgTint:"900",children:[t(dr,{podsOdigosHealthStatus:o.podsOdigosHealthStatus,pods:o.pods,noPadding:!0}),t(Kr,{pods:o.pods})]})}),Jr=({source:e})=>{const o=r(()=>e.workloadOdigosHealthStatus?{status:e.workloadOdigosHealthStatus.status?Zt(e.workloadOdigosHealthStatus.status):st.Unknown,title:$t(e.workloadOdigosHealthStatus.reasonEnum),subTitle:e.workloadOdigosHealthStatus.message}:null,[e]);return o?t(Ft,{...o,width:"calc(100% - 32px)"}):null},qr="calc(50% - 6px)",Zr=({source:o,onClickRollout:n,onClickRollback:a})=>{const i=r(()=>{const{status:e,reasonEnum:t,message:a}=o.conditions?.rollout||{},i=Pt(e);if(!i)return null;return{status:i,title:t?.toLowerCase().includes("rollout")?$t(t):`${Re.ROLLOUT} ${$t(t)}`,subTitle:a,action:i!==ge.Success?{icon:$i,tooltip:Re.ROLLOUT_RESTART,onClick:n}:void 0}},[o]),l=r(()=>{const{status:e,reasonEnum:t,message:n}=o.autoRollback?.autoRollbackStatus||{},i=Pt(e);if(!i)return null;return{status:i,title:t?.toLowerCase().includes("rollback")?$t(t):`${Re.ROLLBACK} ${$t(t)}`,subTitle:n,action:i!==ge.Success?{icon:$i,tooltip:Re.ROLLBACK_RECOVER,onClick:a}:void 0}},[o]);return i||l?t(yt,{bgTint:"1000",children:e(te,{$gap:12,$alignItems:"stretch",children:[i&&t(Ft,{invertColors:!0,slim:!0,width:l?qr:"100%",...i}),l&&t(Ft,{invertColors:!0,slim:!0,width:qr,...l})]})}):null},Qr=m(null),ec=g.div`
163
163
  position: relative;
164
164
  `,tc=({children:e})=>{const o=d(null);return t(ec,{ref:o,children:t(Qr.Provider,{value:o,children:e})})},oc=g.div`
165
165
  position: fixed;
@@ -182,7 +182,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
182
182
  gap: 8px;
183
183
  `,ac=g.div`
184
184
  flex: 1;
185
- `,ic=({width:o,onClose:n,onSave:a,saveTooltip:i,onDelete:s,deleteTooltip:r,title:c,subTitle:d,warning:u,children:m,pushButtonsWith:g})=>{const b=f(),v=p(Qr),[y,C]=l(null);return Qt(v??{current:null},n),h(()=>{const e=v?.current?.getBoundingClientRect();e&&C({top:e.bottom+4,right:window.innerWidth-e.left-24})},[v]),y?zl(e(oc,{$coords:y,$width:o,"data-ignore-outside-click":"true",children:[e(V,{$gap:4,children:[t(re,{size:ce.XXS,children:c}),t(re,{size:ce.XXXS,color:Ce.Secondary,children:d})]}),e(nc,{children:[t(ac,{children:m}),e(te,{$gap:8,$width:"fit-content",$margin:`0 0 ${g||0} 0`,children:[t(oe,{variant:ae.Secondary,onClick:s,leftIcon:ni,tooltip:r,hideTooltipIcon:!0,iconSize:16,size:ne.S,textColor:b.v2.colors.red[500]}),t(oe,{variant:ae.Primary,onClick:a,leftIcon:bi,tooltip:i,hideTooltipIcon:!0,iconSize:16,size:ne.S})]})]}),t("div",{children:t(me,{status:ge.Warning,message:u})})]}),document.body):null},lc=({language:o,overridden:n,onOverride:a,defaultValues:i})=>{const{tier:s}=y(),{formData:c,handleFormChange:d,resetFormData:u}=wt(i),p=r(()=>{if(!o)return[];const e=eo[o].community,t=s===rt.Onprem?eo[o].enterprise:[];return e.concat(t).map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})).sort((e,t)=>e.label.localeCompare(t.label))},[o,s]),[h,m]=l(!1),[g,f]=l(!1),b=()=>{h||(g&&u(),f(e=>!e))};return e(te,{$gap:4,$alignItems:"center",children:[n?t(Ee,{status:ge.Info,invertColors:!0,label:Re.OVERIDDEN}):null,e(tc,{children:[t(we,{text:Re.OVERRIDE_OTEL_DISTRO_NAME,children:t(qe,{icon:ci,onClick:b})}),g&&t(ic,{width:"500px",onClose:b,onSave:async()=>{m(!0),await a(c),m(!1),b()},saveTooltip:Re.OVERRIDE_OTEL_DISTRO_NAME_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await a({otelDistroName:null}),m(!1),b()},deleteTooltip:Re.OVERRIDE_OTEL_DISTRO_NAME_DELETE_TOOLTIP,title:Re.OVERRIDE_OTEL_DISTRO_NAME,subTitle:Re.OVERRIDE_OTEL_DISTRO_NAME_SUBTITLE,warning:Re.OVERRIDE_OTEL_DISTRO_NAME_WARNING,children:t(Je,{label:Re.OTEL_DISTRO_NAME,options:p,values:c.otelDistroName?[c.otelDistroName]:[],setValues:e=>d("otelDistroName",e[0])})})]})]})},sc=({overridden:o,onOverride:n,defaultValues:a,originalValues:i})=>{const{addNotification:s}=It(),{formData:c,handleFormChange:d,resetFormData:u}=wt(a),p=r(()=>to.map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})),[]),[h,m]=l(!1),[g,f]=l(!1),b=()=>{h||(g&&u(),f(e=>!e))};return e(te,{children:[o?t(Ee,{status:ge.Info,invertColors:!0,label:Re.OVERIDDEN}):null,e(tc,{children:[t(we,{text:Re.OVERRIDE_RUNTIME_DETAILS,children:t(qe,{icon:ci,onClick:b})}),g&&t(ic,{width:"500px",onClose:b,onSave:async()=>{!c.version||oo(c.version)?(m(!0),await n(c),m(!1),b()):s({type:ge.Warning,message:Nt.INVALID_VERSION,hideFromHistory:!0})},saveTooltip:Re.OVERRIDE_RUNTIME_DETAILS_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await n({language:null,version:""}),m(!1),b()},deleteTooltip:Re.OVERRIDE_RUNTIME_DETAILS_DELETE_TOOLTIP,title:Re.OVERRIDE_RUNTIME_DETAILS,subTitle:Re.OVERRIDE_RUNTIME_DETAILS_SUBTITLE,warning:Re.OVERRIDE_RUNTIME_WARNING,pushButtonsWith:"20px",children:e(te,{$gap:8,children:[t(Je,{label:Re.LANGUAGE,options:p,values:c.language?[c.language]:[],setValues:e=>d("language",e[0]),helpMessage:`Auto-detected: ${i.language||"none"}`}),t(W,{label:Re.RUNTIME_VERSION,placeholder:Re.VERSION_PLACEHOLDER,value:c.version,onChange:e=>d("version",e.target.value),helpMessage:`Auto-detected: ${i.version||"none"}`})]})})]})]})},rc=({source:e,onOverride:o})=>{const{isVm:n}=y(),{containers:a,containersRichTitle:i}=r(()=>{const t=e?.conditions?.runtimeDetection;return{containers:e?.containers??[],containersRichTitle:{title:n?Re.DETECTED_PROCESSES:`${e.id.kind} ${Re.CONTAINERS}`,tooltip:t?.message||(n?Re.DETECTED_PROCESSES_DESCRIPTION:Re.DETECTED_CONTAINERS_DESCRIPTION),badge:Ft(t?.status)===Mt.Loading?{status:Mt.Loading,backgroundColor:"transparent"}:{label:e?.containers?.length}}}},[e,n]);return t(yt,{bgTint:"1000",richTitle:i,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(V,{$gap:8,children:a.map(e=>e&&t(pc,{...e,onOverride:o},`source-container-${e.containerName}`))})})},cc=g.div`
185
+ `,ic=({width:o,onClose:n,onSave:a,saveTooltip:i,onDelete:s,deleteTooltip:r,title:c,subTitle:d,warning:u,children:m,pushButtonsWith:g})=>{const b=f(),v=p(Qr),[y,C]=l(null);return Qt(v??{current:null},n),h(()=>{const e=v?.current?.getBoundingClientRect();e&&C({top:e.bottom+4,right:window.innerWidth-e.left-24})},[v]),y?Bl(e(oc,{$coords:y,$width:o,"data-ignore-outside-click":"true",children:[e(V,{$gap:4,children:[t(re,{size:ce.XXS,children:c}),t(re,{size:ce.XXXS,color:Ce.Secondary,children:d})]}),e(nc,{children:[t(ac,{children:m}),e(te,{$gap:8,$width:"fit-content",$margin:`0 0 ${g||0} 0`,children:[t(oe,{variant:ae.Secondary,onClick:s,leftIcon:ni,tooltip:r,hideTooltipIcon:!0,iconSize:16,size:ne.S,textColor:b.v2.colors.red[500]}),t(oe,{variant:ae.Primary,onClick:a,leftIcon:bi,tooltip:i,hideTooltipIcon:!0,iconSize:16,size:ne.S})]})]}),t("div",{children:t(me,{status:ge.Warning,message:u})})]}),document.body):null},lc=({language:o,overridden:n,onOverride:a,defaultValues:i})=>{const{tier:s}=y(),{formData:c,handleFormChange:d,resetFormData:u}=wt(i),p=r(()=>{if(!o)return[];const e=eo[o].community,t=s===rt.Onprem?eo[o].enterprise:[];return e.concat(t).map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})).sort((e,t)=>e.label.localeCompare(t.label))},[o,s]),[h,m]=l(!1),[g,f]=l(!1),b=()=>{h||(g&&u(),f(e=>!e))};return e(te,{$gap:4,$alignItems:"center",children:[n?t(Ee,{status:ge.Info,invertColors:!0,label:Re.OVERIDDEN}):null,e(tc,{children:[t(we,{text:Re.OVERRIDE_OTEL_DISTRO_NAME,children:t(qe,{icon:ci,onClick:b})}),g&&t(ic,{width:"500px",onClose:b,onSave:async()=>{m(!0),await a(c),m(!1),b()},saveTooltip:Re.OVERRIDE_OTEL_DISTRO_NAME_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await a({otelDistroName:null}),m(!1),b()},deleteTooltip:Re.OVERRIDE_OTEL_DISTRO_NAME_DELETE_TOOLTIP,title:Re.OVERRIDE_OTEL_DISTRO_NAME,subTitle:Re.OVERRIDE_OTEL_DISTRO_NAME_SUBTITLE,warning:Re.OVERRIDE_OTEL_DISTRO_NAME_WARNING,children:t(Je,{label:Re.OTEL_DISTRO_NAME,options:p,values:c.otelDistroName?[c.otelDistroName]:[],setValues:e=>d("otelDistroName",e[0])})})]})]})},sc=({overridden:o,onOverride:n,defaultValues:a,originalValues:i})=>{const{addNotification:s}=It(),{formData:c,handleFormChange:d,resetFormData:u}=wt(a),p=r(()=>to.map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})),[]),[h,m]=l(!1),[g,f]=l(!1),b=()=>{h||(g&&u(),f(e=>!e))};return e(te,{children:[o?t(Ee,{status:ge.Info,invertColors:!0,label:Re.OVERIDDEN}):null,e(tc,{children:[t(we,{text:Re.OVERRIDE_RUNTIME_DETAILS,children:t(qe,{icon:ci,onClick:b})}),g&&t(ic,{width:"500px",onClose:b,onSave:async()=>{!c.version||oo(c.version)?(m(!0),await n(c),m(!1),b()):s({type:ge.Warning,message:Nt.INVALID_VERSION,hideFromHistory:!0})},saveTooltip:Re.OVERRIDE_RUNTIME_DETAILS_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await n({language:null,version:""}),m(!1),b()},deleteTooltip:Re.OVERRIDE_RUNTIME_DETAILS_DELETE_TOOLTIP,title:Re.OVERRIDE_RUNTIME_DETAILS,subTitle:Re.OVERRIDE_RUNTIME_DETAILS_SUBTITLE,warning:Re.OVERRIDE_RUNTIME_WARNING,pushButtonsWith:"20px",children:e(te,{$gap:8,children:[t(Je,{label:Re.LANGUAGE,options:p,values:c.language?[c.language]:[],setValues:e=>d("language",e[0]),helpMessage:`Auto-detected: ${i.language||"none"}`}),t(W,{label:Re.RUNTIME_VERSION,placeholder:Re.VERSION_PLACEHOLDER,value:c.version,onChange:e=>d("version",e.target.value),helpMessage:`Auto-detected: ${i.version||"none"}`})]})})]})]})},rc=({source:e,onOverride:o})=>{const{isVm:n}=y(),{containers:a,containersRichTitle:i}=r(()=>{const t=e?.conditions?.runtimeDetection;return{containers:e?.containers??[],containersRichTitle:{title:n?Re.DETECTED_PROCESSES:`${e.id.kind} ${Re.CONTAINERS}`,tooltip:t?.message||(n?Re.DETECTED_PROCESSES_DESCRIPTION:Re.DETECTED_CONTAINERS_DESCRIPTION),badge:Pt(t?.status)===Mt.Loading?{status:Mt.Loading,backgroundColor:"transparent"}:{label:e?.containers?.length}}}},[e,n]);return t(yt,{bgTint:"1000",richTitle:i,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(V,{$gap:8,children:a.map(e=>e&&t(pc,{...e,onOverride:o},`source-container-${e.containerName}`))})})},cc=g.div`
186
186
  display: flex;
187
187
  flex-direction: column;
188
188
  align-self: stretch;
@@ -204,7 +204,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
204
204
  padding: 8px 12px;
205
205
  border-radius: 8px;
206
206
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
207
- `,pc=({onOverride:o,...n})=>{const{containerName:a,runtimeInfo:i,agentEnabled:l,overrides:s}=n,c=f(),d=r(()=>!!s?.runtimeInfo?.language||!!s?.runtimeInfo?.runtimeVersion,[s]),u=r(()=>({language:_t(n),version:no(n)||void 0}),[n]),p=r(()=>!!s?.otelDistroName,[s]),h=r(()=>({otelDistroName:s?.otelDistroName||n.agentEnabled?.otelDistroName}),[s,n]),m=r(()=>!i&&!d,[i,d]),g=r(()=>m?Ni:Oe(u.language),[m,u]),b=r(()=>{if(m)return"";const{language:e,version:t}=u;return`${e}${t?` • ${t}`:""}`},[m,u]),v=r(()=>m?{status:Mt.Loading,label:Re.WAITING_FOR_RUNTIME_DETECTION}:{status:l?.otelDistroName?ge.Success:Mt.Disabled,leftIcon:l?.otelDistroName?li:si,label:l?.otelDistroName?`Instrumented | ${l.otelDistroName}`:"Uninstrumented",tooltip:l?.agentEnabledStatus?.message},[m,l]),y=e=>o({containerName:a,...p?h:{},...d?u:{},...e});return e(cc,{children:[e(te,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(te,{$gap:8,$alignItems:"center",children:[t(dc,{children:t(g,{size:24,fill:i?void 0:c.v2.colors.grey[400]})}),t(re,{children:a}),t(Et,b?{variant:zt.Blue,label:b}:{variant:zt.Loader,label:Re.DETECTING_RUNTIME_INFO}),t(sc,{overridden:d,onOverride:y,defaultValues:u,originalValues:{language:n.runtimeInfo?.language,version:n.runtimeInfo?.runtimeVersion||""}})]}),e(te,{$gap:8,$alignItems:"center",children:[t(Ee,{...v,textSize:ce.XXXS}),t(lc,{language:u.language,overridden:p,onOverride:y,defaultValues:h})]})]}),!l||l.agentEnabled||m?null:t(uc,{children:e(te,{$gap:10,$alignItems:"center",children:[t(Et,{variant:zt.Pink,label:$t(l.agentEnabledStatus?.reasonEnum)||Re.NO_AVAILABLE_AGENT}),t(re,{size:ce.XXXS,color:Ce.Secondary,children:l?.agentEnabledStatus?.message})]})})]})},hc=({source:o,onClickRollout:n,onClickRollback:a,onOverride:i})=>e(V,{$gap:12,children:[t(_r,{source:o}),t(Jr,{source:o}),t(Zr,{source:o,onClickRollout:n,onClickRollback:a}),t(rc,{source:o,onOverride:i}),t(Yr,{source:o})]});function mc(e,t){const o=e.names[t];if(null==o)return"";if("string"==typeof o)return o;if("object"==typeof o&&"name"in o){const e=o.name;if("string"==typeof e)return e}return"number"==typeof o||"boolean"==typeof o?String(o):""}function gc(e){const t=Math.abs(e);return t>=1e9?`${fc(e/1e9)}s`:t>=1e6?`${fc(e/1e6)}ms`:t>=1e3?`${fc(e/1e3)}μs`:String(Math.round(e))}function fc(e){return e.toFixed(2).replace(/\.?0+$/,"")}function bc(e){const t=[];for(let o=0;o<e.levels.length;o++){const n=e.levels[o];let a=0;for(let e=0;e+3<n.length;e+=4){const i=n[e],l=n[e+1],s=n[e+2],r=n[e+3],c=a+i;t.push({level:o,offset:c,size:l,self:s,nameIndex:r}),a=c+l}}return t}function vc(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function yc(e,t){const o=t.trim().toLowerCase();return!o||e.toLowerCase().includes(o)}function Cc(e,t,o,n,a,i={}){if(0===e.levels.length||t<2||o<2)return null;const{zoomRoot:l=null,shouldKeepName:s,collapseRecursive:r=!1}=i,c=bc(e);let d=l?function(e,t){const o=e.reduce((e,t)=>Math.max(e,t.level),t.level),n=new Map;for(const t of e){const e=n.get(t.level);e?e.push(t):n.set(t.level,[t])}const a=[t];for(let e=t.level+1;e<=o;e++){const t=a.filter(t=>t.level===e-1);if(0===t.length)break;const o=n.get(e);if(o?.length)for(const e of o)for(const o of t)if(e.offset>=o.offset&&e.offset+e.size<=o.offset+o.size){a.push(e);break}}return a}(c,l):c;if(0===d.length)return null;if(s&&(d=d.filter(t=>s(mc(e,t.nameIndex))),0===d.length))return null;if(r&&(d=function(e,t){if(0===t.length)return t;const o=[...t].sort((e,t)=>e.level-t.level||e.offset-t.offset),n=new Map;for(const e of o){const t=n.get(e.level);t?t.push(e):n.set(e.level,[e])}const a=new Set;for(const t of o){const o=n.get(t.level+1);if(!o)continue;const i=o.filter(e=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);if(1!==i.length)continue;const l=i[0];l.size===t.size&&mc(e,l.nameIndex)===mc(e,t.nameIndex)&&a.add(vc(l))}if(0===a.size)return o;const i=[];for(const e of o){if(a.has(vc(e)))continue;let t=0;for(let o=0;o<e.level;o++){const i=n.get(o);if(!i)continue;const l=i.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);l&&a.has(vc(l))&&t++}i.push({...e,level:e.level-t})}return i}(e,d),0===d.length))return null;const u=l?.level??0,p=l?.offset??0,h=l?.size??e.numTicks;if(h<=0)return null;const m=d.reduce((e,t)=>Math.max(e,t.level-u),0)+1,g=n??Number.POSITIVE_INFINITY,f=Math.max(1,Math.min(o/m,g)),b=a.trim(),v=f>8?1:0;return d.map(o=>{const n=o.level-u,a=(o.offset-p)/h*t,i=Math.max(o.size/h*t,1),l=n*f,s=Math.max(f-v,1),r=mc(e,o.nameIndex);return{...o,x:a,y:l,w:i,h:s,name:r,matchesSearch:yc(r,b)}})}function Sc(e,t){let o=0;for(let t=0;t<e.length;t++)o=31*o+e.charCodeAt(t)>>>0;const n=t.v2.colors.black[500],a=[{fill:t.v2.colors.purple[300],text:n},{fill:t.v2.colors.green[300],text:n},{fill:t.v2.colors.red[300],text:n},{fill:t.v2.colors.blue[300],text:n},{fill:t.v2.colors.yellow[300],text:n}];return a[o%a.length]}var wc,xc;!function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(wc||(wc={})),function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(xc||(xc={}));function kc(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function Tc(e,t,o){for(const n of o)if(e>=n.x&&e<n.x+n.w&&t>=n.y&&t<n.y+n.h)return n;return null}function $c(e){return e>=1073741824?`${(e/1073741824).toFixed(1)} GiB`:e>=1048576?`${(e/1048576).toFixed(1)} MiB`:e>=1024?`${(e/1024).toFixed(1)} KiB`:`${e} B`}const Ic=({flamebearer:o,maxRowPx:a,searchQuery:i="",shouldKeepName:s,minHostHeight:u=200,onFullscreenChange:p,profilingSlots:m})=>{const g=f(),b=d(null),v=d(null),y=d({x:0,y:0}),C=d(o.numTicks),[S,w]=l({w:0,h:0}),[x,k]=l(""),[T,$]=l(null),[I,N]=l([]),[E,A]=l(!1),[O,D]=l(wc.Fit),[R,F]=l(xc.Fit),[P,L]=l(!1),_=Math.max(1,Math.min(Math.floor(S.w*O),8192)),M=Math.max(1,Math.min(Math.floor(S.h*R),8192)),z=I.length>0?I[I.length-1]:null,B=z?.size??o.numTicks;n(()=>{C.current!==o.numTicks&&(C.current=o.numTicks,N([]))},[o.numTicks]),h(()=>{const e=b.current;if(!e)return;const t=new ResizeObserver(()=>{const t=e.getBoundingClientRect();w({w:Math.floor(t.width),h:Math.floor(t.height)})});return t.observe(e),()=>t.disconnect()},[]),n(()=>{if(!E)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[E]),n(()=>(p?.(E),()=>{E&&p?.(!1)}),[E,p]);const X=r(()=>Cc(o,_,M,a,i,{zoomRoot:z,shouldKeepName:s,collapseRecursive:P}),[o,a,i,M,_,z,s,P]),V=r(()=>function(e){return[...e].sort((e,t)=>t.level-e.level)}(X?.length?i.trim()?X.filter(e=>e.matchesSearch):X:[]),[X,i]),U=c(e=>{if(_<2||M<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const n=Tc((e.clientX-t.left)/t.width*_,(e.clientY-t.top)/t.height*M,V);if(n){const e=vc(n);$(e);const t=B>0?(100*n.size/B).toFixed(1):"0",a=o.numTicks>0?(100*n.size/o.numTicks).toFixed(1):"0";k(`${n.name}\ntotal ${gc(n.size)} (${t}% of view, ${a}% of profile) · self ${gc(n.self)}`)}else $(null),k("")},[V,o.numTicks,M,_,B]),H=c(e=>{U(e)},[U]),j=c(()=>{$(null),k("")},[]),W=c(e=>{y.current={x:e.clientX,y:e.clientY}},[]),G=c(e=>{const{x:t,y:o}=y.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-o)>3)return;if(_<2||M<2)return;const n=e.currentTarget.getBoundingClientRect();if(n.width<1||n.height<1)return;const a=Tc((e.clientX-n.left)/n.width*_,(e.clientY-n.top)/n.height*M,V);if(!a)return;const i=function(e){return{level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}}(a);N(e=>{const t=e.length>0?e[e.length-1]:null;return t&&function(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}(i,t)?e.slice(0,-1):[...e,i]})},[V,M,_]);h(()=>{const e=v.current;if(!e||_<2||M<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,n=Math.max(_,M),a=Math.min(t,16384/n);e.width=Math.floor(_*a),e.height=Math.floor(M*a),e.style.width=`${_}px`,e.style.height=`${M}px`;const l=e.getContext("2d");l&&(l.setTransform(a,0,0,a,0,0),l.clearRect(0,0,_,M),X?.length?function(e,t,o,n,a,i,l,s){const r=i.v2.colors.silver[900];e.fillStyle=r,e.fillRect(0,0,t,o);const c=a.trim().length>0;e.textRendering="optimizeLegibility";for(const t of n){const{x:o,y:n,w:a,h:l,name:r,size:d,matchesSearch:u}=t;if(c&&!u)continue;const{fill:p,text:h}=Sc(r,i);e.fillStyle=p,e.fillRect(o,n,a,l),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(o+.5,n+.5),e.lineTo(o+a-.5,n+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(o+.5,n+.5,Math.max(a-1,0),Math.max(l-1,0));const m=kc(d,s),g=`${r} (${gc(d)}, ${m}%)`,f=i.v2.text.size.xs,b=8,v=5,y=26,C=Math.min(f,Math.floor(l-2));if(a>=y&&C>=b){e.font=`${C}px ${i.font_family.primary}, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`,e.textBaseline="middle",e.textAlign="left";let t=g;for(;t.length>2&&e.measureText(t).width>a-2*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=a-2*v&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,o+v,n+l/2),e.fillStyle=h,e.fillText(t,o+v,n+l/2))}}if(l)for(const t of n){if(vc(t)!==l)continue;if(c&&!t.matchesSearch)continue;const{x:o,y:n,w:a,h:i}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(o+1,n+1,Math.max(a-2,0),Math.max(i-2,0));break}}(l,_,M,X,i,g,T,o.numTicks):(l.fillStyle=g.v2.colors.silver[900],l.fillRect(0,0,_,M)))},[X,o.numTicks,T,i,M,_,g]);const K=c(()=>A(e=>!e),[]),Y=o.numTicks>0?Math.max(0,Math.min(100,Math.round(B/o.numTicks*100))):100,J=r(()=>function(e,t){const o=bc(e),n=t?.offset??0,a=n+(t?.size??e.numTicks),i=(t?.level??-1)+1,l=t?.size??e.numTicks;let s=null;for(const e of o)e.level<i||e.offset<n||e.offset+e.size>a||e.size>=l||(!s||e.size>s.size||e.size===s.size&&e.level<s.level)&&(s=e);return s}(o,z),[o,z]),Q=null!==J,ee=I.length>0,ie=z?mc(o,z.nameIndex):"",le=c(()=>N([]),[]),se=c(()=>N(e=>e.slice(0,-1)),[]),de=c(()=>{J&&N(e=>[...e,J])},[J]);return e("div",{style:E?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:g.v2.colors.silver[900]}:{flex:1,minHeight:u,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(te,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(q,{label:"Collapse recursive",tooltip:"Collapse straight-line recursion (parent → single same-name child of equal width) into a single bar. Helps deep recursive call chains fit on screen.",labelAlign:Z.Left,size:ct.S,value:P,onChange:L}),e(te,{$gap:8,children:[e(te,{children:[t(oe,{variant:ae.Secondary,size:ne.S,label:"Reset zoom",leftIcon:Ri,onClick:le,disabled:!I.length}),t(oe,{variant:ae.Secondary,size:ne.S,iconSize:20,leftIcon:Fi,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!ee,onClick:se}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(re,{size:ce.XXS,color:Ce.Secondary,nowrap:!0,align:"center",children:`${Y}%`})}),t(oe,{variant:ae.Secondary,size:ne.S,iconSize:20,leftIcon:ai,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!Q,onClick:de})]}),e(te,{children:[t(we,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(ue,{variant:ao.Filled,options:[{value:wc.Fit,label:"W: Fit"},{value:wc.X10,label:"10x"}],selected:O,setSelected:D})}),t(we,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(ue,{variant:ao.Filled,options:[{value:xc.Fit,label:"H: Fit"},{value:xc.X10,label:"10x"}],selected:R,setSelected:F})})]}),t(oe,{variant:ae.Secondary,size:ne.S,iconSize:24,leftIcon:E?vi:Di,tooltip:E?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:K})]})]}),t(we,{fullWidth:!0,keepAlive:!0,text:x,children:t("div",{ref:b,style:{flex:1,minWidth:0,width:"100%",height:E?"calc(100vh - 80px)":"calc(100vh - 364px)",position:"relative",overflowX:O>1?"auto":"hidden",overflowY:R>1?"auto":"hidden"},children:t("div",{style:{width:_||"100%",height:M||"100%",position:"relative"},children:t("canvas",{ref:v,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:T?"pointer":"default"},onPointerDown:W,onPointerMove:H,onPointerLeave:j,onClick:G})})})}),e(te,{$justifyContent:"space-between",children:[t(re,z?{size:ce.XXXS,color:g.v2.colors.silver[300],children:`Zoomed: ${ie} • ${gc(B)} samples in view`}:{size:ce.XXXS,color:g.v2.colors.silver[300],children:"Click a frame to zoom into its subtree (pprof-style)."}),m&&t(re,{size:ce.XXXS,color:g.v2.colors.silver[300],children:`${m.activeKeys.length} / ${m.maxSlots} profiling slots · ${$c(m.totalBytesUsed)} / ${$c(m.maxTotalBytesBudget)} budget · TTL ${m.slotTtlSeconds}s`})]})]})};var Nc,Ec;!function(e){e.Symbol="symbol",e.Self="self",e.Total="total"}(Nc||(Nc={})),function(e){e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"}(Ec||(Ec={}));const Ac=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function Oc(e,t){const o=function(e){return e.split(" ")[0]??""}(e);if(t.includes(Ec.FilterOutVoid)&&"void"===o)return!1;if(t.includes(Ec.OnlyWithReturnValues)){if(!(e.includes(" ")&&"void"!==o&&Ac.test(o)))return!1}return!0}const Dc={options:[{id:Ec.FilterOutVoid,label:"Filter out void symbols"},{id:Ec.OnlyWithReturnValues,label:"Only show functions with return values"}],filterRow:(e,t)=>Oc(e.cells.find(e=>e.key===Nc.Symbol)?.rawValue?.toString()??"",t)},Rc=({rows:e,languages:o,filters:n,onFiltersChange:a})=>{const i=r(()=>[{key:Nc.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:o?.includes(io.Java)?Dc:void 0,noFilter:!o?.includes(io.Java)},{key:Nc.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:Nc.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[o]),l=r(()=>e.map(e=>({cells:[{key:Nc.Symbol,rawValue:e.name},{key:Nc.Self,rawValue:gc(e.self)},{key:Nc.Total,rawValue:gc(e.total)}]})),[e]);return t(lo,{variant:so.Data,maxHeight:"calc(100vh - 306px)",columns:i,rows:l,filters:n,onFiltersChange:a,rowActionsPushLeftPosition:"12px",getRowActions:e=>[{id:`copy-${e.cells[0].rawValue}`,label:"",rightIcon:Pi,onClick:()=>{navigator.clipboard.writeText(e.cells[0].rawValue)}}]})};var Fc;!function(e){e.Table="table",e.Flame="flame",e.Both="both"}(Fc||(Fc={}));const Pc=g(V)`
207
+ `,pc=({onOverride:o,...n})=>{const{containerName:a,runtimeInfo:i,agentEnabled:l,overrides:s}=n,c=f(),d=r(()=>!!s?.runtimeInfo?.language||!!s?.runtimeInfo?.runtimeVersion,[s]),u=r(()=>({language:_t(n),version:no(n)||void 0}),[n]),p=r(()=>!!s?.otelDistroName,[s]),h=r(()=>({otelDistroName:s?.otelDistroName||n.agentEnabled?.otelDistroName}),[s,n]),m=r(()=>!i&&!d,[i,d]),g=r(()=>m?Ni:Oe(u.language),[m,u]),b=r(()=>{if(m)return"";const{language:e,version:t}=u;return`${e}${t?` • ${t}`:""}`},[m,u]),v=r(()=>m?{status:Mt.Loading,label:Re.WAITING_FOR_RUNTIME_DETECTION}:{status:l?.otelDistroName?ge.Success:Mt.Disabled,leftIcon:l?.otelDistroName?li:si,label:l?.otelDistroName?`Instrumented | ${l.otelDistroName}`:"Uninstrumented",tooltip:l?.agentEnabledStatus?.message},[m,l]),y=e=>o({containerName:a,...p?h:{},...d?u:{},...e});return e(cc,{children:[e(te,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(te,{$gap:8,$alignItems:"center",children:[t(dc,{children:t(g,{size:24,fill:i?void 0:c.v2.colors.grey[400]})}),t(re,{children:a}),t(Et,b?{variant:Bt.Blue,label:b}:{variant:Bt.Loader,label:Re.DETECTING_RUNTIME_INFO}),t(sc,{overridden:d,onOverride:y,defaultValues:u,originalValues:{language:n.runtimeInfo?.language,version:n.runtimeInfo?.runtimeVersion||""}})]}),e(te,{$gap:8,$alignItems:"center",children:[t(Ee,{...v,textSize:ce.XXXS}),t(lc,{language:u.language,overridden:p,onOverride:y,defaultValues:h})]})]}),!l||l.agentEnabled||m?null:t(uc,{children:e(te,{$gap:10,$alignItems:"center",children:[t(Et,{variant:Bt.Pink,label:$t(l.agentEnabledStatus?.reasonEnum)||Re.NO_AVAILABLE_AGENT}),t(re,{size:ce.XXXS,color:Ce.Secondary,children:l?.agentEnabledStatus?.message})]})})]})},hc=({source:o,onClickRollout:n,onClickRollback:a,onOverride:i})=>e(V,{$gap:12,children:[t(_r,{source:o}),t(Jr,{source:o}),t(Zr,{source:o,onClickRollout:n,onClickRollback:a}),t(rc,{source:o,onOverride:i}),t(Yr,{source:o})]});function mc(e,t){const o=e.names[t];if(null==o)return"";if("string"==typeof o)return o;if("object"==typeof o&&"name"in o){const e=o.name;if("string"==typeof e)return e}return"number"==typeof o||"boolean"==typeof o?String(o):""}function gc(e){const t=Math.abs(e);return t>=1e9?`${fc(e/1e9)}s`:t>=1e6?`${fc(e/1e6)}ms`:t>=1e3?`${fc(e/1e3)}μs`:String(Math.round(e))}function fc(e){return e.toFixed(2).replace(/\.?0+$/,"")}function bc(e){const t=[];for(let o=0;o<e.levels.length;o++){const n=e.levels[o];let a=0;for(let e=0;e+3<n.length;e+=4){const i=n[e],l=n[e+1],s=n[e+2],r=n[e+3],c=a+i;t.push({level:o,offset:c,size:l,self:s,nameIndex:r}),a=c+l}}return t}function vc(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function yc(e,t){const o=t.trim().toLowerCase();return!o||e.toLowerCase().includes(o)}function Cc(e,t,o,n,a,i={}){if(0===e.levels.length||t<2||o<2)return null;const{zoomRoot:l=null,shouldKeepName:s,collapseRecursive:r=!1}=i,c=bc(e);let d=l?function(e,t){const o=e.reduce((e,t)=>Math.max(e,t.level),t.level),n=new Map;for(const t of e){const e=n.get(t.level);e?e.push(t):n.set(t.level,[t])}const a=[t];for(let e=t.level+1;e<=o;e++){const t=a.filter(t=>t.level===e-1);if(0===t.length)break;const o=n.get(e);if(o?.length)for(const e of o)for(const o of t)if(e.offset>=o.offset&&e.offset+e.size<=o.offset+o.size){a.push(e);break}}return a}(c,l):c;if(0===d.length)return null;if(s&&(d=d.filter(t=>s(mc(e,t.nameIndex))),0===d.length))return null;if(r&&(d=function(e,t){if(0===t.length)return t;const o=[...t].sort((e,t)=>e.level-t.level||e.offset-t.offset),n=new Map;for(const e of o){const t=n.get(e.level);t?t.push(e):n.set(e.level,[e])}const a=new Set;for(const t of o){const o=n.get(t.level+1);if(!o)continue;const i=o.filter(e=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);if(1!==i.length)continue;const l=i[0];l.size===t.size&&mc(e,l.nameIndex)===mc(e,t.nameIndex)&&a.add(vc(l))}if(0===a.size)return o;const i=[];for(const e of o){if(a.has(vc(e)))continue;let t=0;for(let o=0;o<e.level;o++){const i=n.get(o);if(!i)continue;const l=i.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);l&&a.has(vc(l))&&t++}i.push({...e,level:e.level-t})}return i}(e,d),0===d.length))return null;const u=l?.level??0,p=l?.offset??0,h=l?.size??e.numTicks;if(h<=0)return null;const m=d.reduce((e,t)=>Math.max(e,t.level-u),0)+1,g=n??Number.POSITIVE_INFINITY,f=Math.max(1,Math.min(o/m,g)),b=a.trim(),v=f>8?1:0;return d.map(o=>{const n=o.level-u,a=(o.offset-p)/h*t,i=Math.max(o.size/h*t,1),l=n*f,s=Math.max(f-v,1),r=mc(e,o.nameIndex);return{...o,x:a,y:l,w:i,h:s,name:r,matchesSearch:yc(r,b)}})}function Sc(e,t){let o=0;for(let t=0;t<e.length;t++)o=31*o+e.charCodeAt(t)>>>0;const n=t.v2.colors.black[500],a=[{fill:t.v2.colors.purple[300],text:n},{fill:t.v2.colors.green[300],text:n},{fill:t.v2.colors.red[300],text:n},{fill:t.v2.colors.blue[300],text:n},{fill:t.v2.colors.yellow[300],text:n}];return a[o%a.length]}var wc,xc;!function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(wc||(wc={})),function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(xc||(xc={}));function kc(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function Tc(e,t,o){for(const n of o)if(e>=n.x&&e<n.x+n.w&&t>=n.y&&t<n.y+n.h)return n;return null}function $c(e){return e>=1073741824?`${(e/1073741824).toFixed(1)} GiB`:e>=1048576?`${(e/1048576).toFixed(1)} MiB`:e>=1024?`${(e/1024).toFixed(1)} KiB`:`${e} B`}const Ic=({flamebearer:o,maxRowPx:a,searchQuery:i="",shouldKeepName:s,minHostHeight:u=200,onFullscreenChange:p,profilingSlots:m})=>{const g=f(),b=d(null),v=d(null),y=d({x:0,y:0}),C=d(o.numTicks),[S,w]=l({w:0,h:0}),[x,k]=l(""),[T,$]=l(null),[I,N]=l([]),[E,A]=l(!1),[O,D]=l(wc.Fit),[R,F]=l(xc.Fit),[P,L]=l(!1),_=Math.max(1,Math.min(Math.floor(S.w*O),8192)),M=Math.max(1,Math.min(Math.floor(S.h*R),8192)),B=I.length>0?I[I.length-1]:null,z=B?.size??o.numTicks;n(()=>{C.current!==o.numTicks&&(C.current=o.numTicks,N([]))},[o.numTicks]),h(()=>{const e=b.current;if(!e)return;const t=new ResizeObserver(()=>{const t=e.getBoundingClientRect();w({w:Math.floor(t.width),h:Math.floor(t.height)})});return t.observe(e),()=>t.disconnect()},[]),n(()=>{if(!E)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[E]),n(()=>(p?.(E),()=>{E&&p?.(!1)}),[E,p]);const X=r(()=>Cc(o,_,M,a,i,{zoomRoot:B,shouldKeepName:s,collapseRecursive:P}),[o,a,i,M,_,B,s,P]),V=r(()=>function(e){return[...e].sort((e,t)=>t.level-e.level)}(X?.length?i.trim()?X.filter(e=>e.matchesSearch):X:[]),[X,i]),U=c(e=>{if(_<2||M<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const n=Tc((e.clientX-t.left)/t.width*_,(e.clientY-t.top)/t.height*M,V);if(n){const e=vc(n);$(e);const t=z>0?(100*n.size/z).toFixed(1):"0",a=o.numTicks>0?(100*n.size/o.numTicks).toFixed(1):"0";k(`${n.name}\ntotal ${gc(n.size)} (${t}% of view, ${a}% of profile) · self ${gc(n.self)}`)}else $(null),k("")},[V,o.numTicks,M,_,z]),H=c(e=>{U(e)},[U]),j=c(()=>{$(null),k("")},[]),W=c(e=>{y.current={x:e.clientX,y:e.clientY}},[]),G=c(e=>{const{x:t,y:o}=y.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-o)>3)return;if(_<2||M<2)return;const n=e.currentTarget.getBoundingClientRect();if(n.width<1||n.height<1)return;const a=Tc((e.clientX-n.left)/n.width*_,(e.clientY-n.top)/n.height*M,V);if(!a)return;const i=function(e){return{level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}}(a);N(e=>{const t=e.length>0?e[e.length-1]:null;return t&&function(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}(i,t)?e.slice(0,-1):[...e,i]})},[V,M,_]);h(()=>{const e=v.current;if(!e||_<2||M<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,n=Math.max(_,M),a=Math.min(t,16384/n);e.width=Math.floor(_*a),e.height=Math.floor(M*a),e.style.width=`${_}px`,e.style.height=`${M}px`;const l=e.getContext("2d");l&&(l.setTransform(a,0,0,a,0,0),l.clearRect(0,0,_,M),X?.length?function(e,t,o,n,a,i,l,s){const r=i.v2.colors.silver[900];e.fillStyle=r,e.fillRect(0,0,t,o);const c=a.trim().length>0;e.textRendering="optimizeLegibility";for(const t of n){const{x:o,y:n,w:a,h:l,name:r,size:d,matchesSearch:u}=t;if(c&&!u)continue;const{fill:p,text:h}=Sc(r,i);e.fillStyle=p,e.fillRect(o,n,a,l),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(o+.5,n+.5),e.lineTo(o+a-.5,n+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(o+.5,n+.5,Math.max(a-1,0),Math.max(l-1,0));const m=kc(d,s),g=`${r} (${gc(d)}, ${m}%)`,f=i.v2.text.size.xs,b=8,v=5,y=26,C=Math.min(f,Math.floor(l-2));if(a>=y&&C>=b){e.font=`${C}px ${i.font_family.primary}, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`,e.textBaseline="middle",e.textAlign="left";let t=g;for(;t.length>2&&e.measureText(t).width>a-2*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=a-2*v&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,o+v,n+l/2),e.fillStyle=h,e.fillText(t,o+v,n+l/2))}}if(l)for(const t of n){if(vc(t)!==l)continue;if(c&&!t.matchesSearch)continue;const{x:o,y:n,w:a,h:i}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(o+1,n+1,Math.max(a-2,0),Math.max(i-2,0));break}}(l,_,M,X,i,g,T,o.numTicks):(l.fillStyle=g.v2.colors.silver[900],l.fillRect(0,0,_,M)))},[X,o.numTicks,T,i,M,_,g]);const K=c(()=>A(e=>!e),[]),Y=o.numTicks>0?Math.max(0,Math.min(100,Math.round(z/o.numTicks*100))):100,J=r(()=>function(e,t){const o=bc(e),n=t?.offset??0,a=n+(t?.size??e.numTicks),i=(t?.level??-1)+1,l=t?.size??e.numTicks;let s=null;for(const e of o)e.level<i||e.offset<n||e.offset+e.size>a||e.size>=l||(!s||e.size>s.size||e.size===s.size&&e.level<s.level)&&(s=e);return s}(o,B),[o,B]),Q=null!==J,ee=I.length>0,ie=B?mc(o,B.nameIndex):"",le=c(()=>N([]),[]),se=c(()=>N(e=>e.slice(0,-1)),[]),de=c(()=>{J&&N(e=>[...e,J])},[J]);return e("div",{style:E?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:g.v2.colors.silver[900]}:{flex:1,minHeight:u,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(te,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(q,{label:"Collapse recursive",tooltip:"Collapse straight-line recursion (parent → single same-name child of equal width) into a single bar. Helps deep recursive call chains fit on screen.",labelAlign:Z.Left,size:ct.S,value:P,onChange:L}),e(te,{$gap:8,children:[e(te,{children:[t(oe,{variant:ae.Secondary,size:ne.S,label:"Reset zoom",leftIcon:Ri,onClick:le,disabled:!I.length}),t(oe,{variant:ae.Secondary,size:ne.S,iconSize:20,leftIcon:Fi,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!ee,onClick:se}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(re,{size:ce.XXS,color:Ce.Secondary,nowrap:!0,align:"center",children:`${Y}%`})}),t(oe,{variant:ae.Secondary,size:ne.S,iconSize:20,leftIcon:ai,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!Q,onClick:de})]}),e(te,{children:[t(we,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(ue,{variant:ao.Filled,options:[{value:wc.Fit,label:"W: Fit"},{value:wc.X10,label:"10x"}],selected:O,setSelected:D})}),t(we,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(ue,{variant:ao.Filled,options:[{value:xc.Fit,label:"H: Fit"},{value:xc.X10,label:"10x"}],selected:R,setSelected:F})})]}),t(oe,{variant:ae.Secondary,size:ne.S,iconSize:24,leftIcon:E?vi:Di,tooltip:E?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:K})]})]}),t(we,{fullWidth:!0,keepAlive:!0,text:x,children:t("div",{ref:b,style:{flex:1,minWidth:0,width:"100%",height:E?"calc(100vh - 80px)":"calc(100vh - 364px)",position:"relative",overflowX:O>1?"auto":"hidden",overflowY:R>1?"auto":"hidden"},children:t("div",{style:{width:_||"100%",height:M||"100%",position:"relative"},children:t("canvas",{ref:v,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:T?"pointer":"default"},onPointerDown:W,onPointerMove:H,onPointerLeave:j,onClick:G})})})}),e(te,{$justifyContent:"space-between",children:[t(re,B?{size:ce.XXXS,color:g.v2.colors.silver[300],children:`Zoomed: ${ie} • ${gc(z)} samples in view`}:{size:ce.XXXS,color:g.v2.colors.silver[300],children:"Click a frame to zoom into its subtree (pprof-style)."}),m&&t(re,{size:ce.XXXS,color:g.v2.colors.silver[300],children:`${m.activeKeys.length} / ${m.maxSlots} profiling slots · ${$c(m.totalBytesUsed)} / ${$c(m.maxTotalBytesBudget)} budget · TTL ${m.slotTtlSeconds}s`})]})]})};var Nc,Ec;!function(e){e.Symbol="symbol",e.Self="self",e.Total="total"}(Nc||(Nc={})),function(e){e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"}(Ec||(Ec={}));const Ac=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function Oc(e,t){const o=function(e){return e.split(" ")[0]??""}(e);if(t.includes(Ec.FilterOutVoid)&&"void"===o)return!1;if(t.includes(Ec.OnlyWithReturnValues)){if(!(e.includes(" ")&&"void"!==o&&Ac.test(o)))return!1}return!0}const Dc={options:[{id:Ec.FilterOutVoid,label:"Filter out void symbols"},{id:Ec.OnlyWithReturnValues,label:"Only show functions with return values"}],filterRow:(e,t)=>Oc(e.cells.find(e=>e.key===Nc.Symbol)?.rawValue?.toString()??"",t)},Rc=({rows:e,languages:o,filters:n,onFiltersChange:a})=>{const i=r(()=>[{key:Nc.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:o?.includes(io.Java)?Dc:void 0,noFilter:!o?.includes(io.Java)},{key:Nc.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:Nc.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[o]),l=r(()=>e.map(e=>({cells:[{key:Nc.Symbol,rawValue:e.name},{key:Nc.Self,rawValue:gc(e.self)},{key:Nc.Total,rawValue:gc(e.total)}]})),[e]);return t(lo,{variant:so.Data,maxHeight:"calc(100vh - 306px)",columns:i,rows:l,filters:n,onFiltersChange:a,rowActionsPushLeftPosition:"12px",getRowActions:e=>[{id:`copy-${e.cells[0].rawValue}`,label:"",rightIcon:Pi,onClick:()=>{navigator.clipboard.writeText(e.cells[0].rawValue)}}]})};var Fc;!function(e){e.Table="table",e.Flame="flame",e.Both="both"}(Fc||(Fc={}));const Pc=g(V)`
208
208
  width: 100%;
209
209
  flex: 1;
210
210
  border-radius: 16px;
@@ -231,12 +231,12 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
231
231
  padding: 16px;
232
232
  background: ${({theme:e})=>e.v2.colors.silver[800]};
233
233
  border-radius: 0 0 16px 16px;
234
- `,zc=g(V)`
234
+ `,Bc=g(V)`
235
235
  flex: ${({$splitWithFlame:e})=>e?"0 0 min(413px, 42%)":"1 1 auto"};
236
236
  width: ${({$splitWithFlame:e})=>e?"auto":"100%"};
237
237
  max-width: ${({$splitWithFlame:e})=>e?"none":"100%"};
238
238
  gap: 10px;
239
- `,Bc=g(V)`
239
+ `,zc=g(V)`
240
240
  flex: ${({$splitWithTable:e})=>e?"1":"1 1 auto"};
241
241
  width: ${({$splitWithTable:e})=>e?"auto":"100%"};
242
242
  gap: 10px;
@@ -244,7 +244,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
244
244
  width: 100%;
245
245
  min-height: 32px;
246
246
  flex-shrink: 0;
247
- `,Vc=({source:o,fetchProfilingSlots:i,enableProfiling:s,fetchSourceProfiling:u,onFlameFullscreenChange:p})=>{const h=f(),m=o.id,[g,b]=l(!0),[v,y]=l(null),[C,S]=l(null),[w,x]=l(0),[k,T]=l(Fc.Both),[$,I]=l(""),[N,E]=l({}),A=d(null),O=c(async()=>{try{const e=[i()];g&&e.push(u(m));const[t,o]=await Promise.all(e);t&&y(t),o?.profileJson&&S(o.profileJson)}finally{x(e=>e+1)}},[i,u,m]);n(()=>{let e=!1;return(async()=>{await s(m),e||(await O(),e||(A.current=setInterval(O,3e3)))})(),()=>{e=!0,A.current&&clearInterval(A.current)}},[s,O,m]);const D=r(()=>function(e){if(!e?.trim())return null;try{const t=JSON.parse(e),o=t.flamebearer;return!o?.names?.length||!Array.isArray(o.levels)||"number"!=typeof o.numTicks||o.numTicks<=0?null:{flamebearer:o,units:t.metadata?.units}}catch{return null}}(C),[C]),R=r(()=>D?function(e){const t=new Map;for(let o=0;o<e.levels.length;o++){const n=e.levels[o];for(let o=0;o+3<n.length;o+=4){const a=n[o+1],i=n[o+2],l=mc(e,n[o+3]);if(!l)continue;const s=t.get(l);(!s||a>s.total)&&t.set(l,{self:i,total:a})}}return[...t.entries()].map(([e,t])=>({name:e,self:t.self,total:t.total})).sort((e,t)=>t.self-e.self)}(D.flamebearer):[],[D]),F=r(()=>{const e=$.trim().toLowerCase();return e?R.filter(t=>t.name.toLowerCase().includes(e)):R},[R,$]),P=k===Fc.Table||k===Fc.Both,L=k===Fc.Flame||k===Fc.Both,_=P&&L,M=o.runtimeInfo?.detectedLanguages||o.containers?.map(e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??""),z=r(()=>function(e,t){if(!t?.includes(io.Java))return;const o=e?.[Nc.Symbol]?.filter(Boolean)??[];return 0!==o.length?e=>Oc(e,o):void 0}(N,M),[N,M]);return!C&&w<2?t(Ke,{$height:"70vh",children:t(Qe,{withSpinner:!0})}):e(Pc,{$gap:0,$width:"100%",children:[e(Lc,{children:[t(we,{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(_c,{children:t(re,{size:ce.S,weight:500,color:Ce.Primary,nowrap:!0,children:"CPU Profiling"})})}),e(te,{style:{flex:1,minWidth:200,gap:10,alignItems:"center",flexWrap:"wrap"},children:[t("div",{style:{flex:"1 1 220px",minWidth:180},children:t(Vt,{value:$,onChange:I,placeholder:"Search by symbol name",width:"100%",idleBackgroundColor:h.v2.colors.silver[900],emphasizeBackgroundColor:h.v2.colors.silver[800]})}),t(ue,{variant:ao.Filled,options:[{value:Fc.Table,label:"Top table"},{value:Fc.Flame,label:"Flame graph"},{value:Fc.Both,label:"Both"}],selected:k,setSelected:T}),t(oe,g?{variant:ae.Secondary,size:ne.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(Li,{...e,size:8,fill:h.v2.colors.green[500]})}:{variant:ae.Secondary,size:ne.S,label:"Paused",tooltip:"Odigos profiler is still collecting data, but the UI is not updating in real time",leftIcon:e=>t(Li,{...e,size:8,fill:h.v2.colors.red[500]})})]})]}),t(Mc,{$gap:P&&L?16:0,children:D?e(a,{children:[P&&e(zc,{$splitWithFlame:_,children:[t(Xc,{$justifyContent:"flex-end",children:t(oe,{variant:ae.Secondary,size:ne.S,label:"Download snapshot",rightIcon:_i,onClick:()=>{if(!C)return;const e=new Blob([C],{type:"application/json"}),t=URL.createObjectURL(e),n=document.createElement("a");n.href=t,n.download=`cpu-profile-${o.id.namespace}-${o.id.kind}-${o.id.name}.json`,n.click(),URL.revokeObjectURL(t)},disabled:!C})}),t(Rc,{rows:F,languages:M,filters:N,onFiltersChange:E})]}),L&&e(Bc,{$splitWithTable:_,children:[e(Xc,{$justifyContent:"space-between",children:[t(Ee,{label:D?`Total in view ${gc(D.flamebearer.numTicks)}`:"No profile sample yet",backgroundColor:h.v2.colors.silver[750],textColor:h.v2.colors.silver[200],textSize:ce.XXS}),e(te,{$gap:12,children:[!g&&t(oe,{variant:ae.Secondary,size:ne.S,label:"Refresh",leftIcon:$i,onClick:O}),t(q,{label:"Auto refresh",labelAlign:Z.Left,size:ct.S,value:g,onChange:b})]})]}),t(Ic,{flamebearer:D.flamebearer,maxRowPx:24,searchQuery:$,shouldKeepName:z,minHostHeight:280,onFullscreenChange:p,profilingSlots:v},k)]})]}):t(Ke,{children:t(se,{title:"No profile samples yet",subTitle:"Dynamically collecting profiling samples — keep this tab open while the agent sends OTLP profiles."})})})]})},Uc=({source:o})=>{const n=f();return e(yt,{bgTint:"1000",children:[o.manifestYAML&&t(fl,{bgTint:"800",codeBgColor:n.v2.colors.silver[900],title:`${o.id.kind} YAML`,yaml:o.manifestYAML}),o.instrumentationConfigYAML&&t(fl,{bgTint:"800",codeBgColor:n.v2.colors.silver[900],title:"Instrumentation Config YAML",yaml:o.instrumentationConfigYAML})]})};var Hc;!function(e){e.Overview="overview",e.Pods="pods",e.PeerSources="peer-sources",e.Profiling="profiling",e.Debug="debug"}(Hc||(Hc={}));const jc=[co.Deployment,co.StatefulSet,co.DaemonSet,co.DeploymentConfig,co.Rollout,co.Pod];var Wc;!function(e){e.Workload="Workload",e.Pod="Pod"}(Wc||(Wc={}));const Gc=e=>!!e&&Ft(e.status)===ge.Error,Kc=e=>Gc(e.healthStatus),Yc=e=>Gc(e.odigosHealthStatus)||(e.processes??[]).some(Kc),Jc=e=>Gc(e.agentInjectedStatus)||Gc(e.odigosHealthStatus)||(e.containers??[]).some(Yc),qc=({onClose:a,effectiveConfig:i,sourceId:s,fetchSourceById:u,persistSources:p,updateSource:h,restartWorkloads:m,restartPod:g,recoverFromRollback:b,fetchPeerSources:v,enableProfiling:C,fetchProfilingSlots:S,fetchSourceProfiling:w})=>{const x=f(),{isVm:k}=y(),{selectedStreamName:T}=Fe(),{genericForm:$,loadSource:I,validateFormData:N}=kl(),[E,A]=l(!1),[O,D]=l(!1),[R,F]=l(!1),[P,L]=l(Hc.Overview),[_,M]=l(null),[z,B]=l({openFor:null});n(()=>{_&&JSON.stringify(jt(s))!==JSON.stringify(jt(_))&&M(null)},[s,_]);const X=d(!1),U=c(async()=>M(await u(s)||null),[s]);n(()=>{if(X.current||(U(),X.current=!0),!E){const e=setInterval(()=>U(),3e3);return()=>clearInterval(e)}},[U,E]),n(()=>{_&&I(_)},[_]);const H=_&&jc.includes(_.id.kind),j=r(()=>{const e=[],o=(_?.pods??[]).some(Jc);return e.push({value:Hc.Overview,label:Re.OVERVIEW}),e.push({value:Hc.Pods,label:Re.PODS,icon:o?e=>t(Ii,{...e,fill:x.v2.colors.red[500]}):void 0}),k||e.push({value:Hc.PeerSources,label:Re.PEER_SOURCES}),i?.profiling?.enabled&&e.push({value:Hc.Profiling,label:Re.PROFILING}),(_?.manifestYAML||_?.instrumentationConfigYAML)&&e.push({value:Hc.Debug,label:Re.DEBUG}),e},[k,i,_?.pods,_?.manifestYAML,_?.instrumentationConfigYAML]),W=c(()=>A(!0),[]),G=c(()=>{_&&I(_),A(!1)},[_]),K=c(async()=>{if(!_||!$)return;const{errorMessage:e,preparedFormData:t}=N();if(e)return;const o=t.otelServiceName!==_.id.name?t.otelServiceName:"";await h(s,{...t,otelServiceName:o}),A(!1)},[_,$,N,s,h]),Y=c(()=>D(!0),[]),J=c(async()=>{_&&(await p({[mt]:[{namespace:_.id.namespace,name:_.id.name,kind:_.id.kind,selected:!1,currentStreamName:T}]}),D(!1),a())},[_,p,T,a]),q=c(()=>{B({openFor:Wc.Workload})},[]),Z=c(async()=>{await b(s)},[b,s]),Q=c(async()=>{z.openFor===Wc.Workload?await m([s]):z.openFor===Wc.Pod&&z.podNamespace&&z.podName&&await g(z.podNamespace,z.podName),B({openFor:null})},[z,m,g,s]),ee=r(()=>{const e=[];return E||P===Hc.Overview&&(e.push({id:"edit-source-btn-edit",label:bt.EDIT,icon:ci,active:E,onClick:W}),!k&&H&&e.push({id:"edit-source-btn-restart",label:bt.RESTART,icon:Mi,onClick:q}),e.push({id:"edit-source-btn-delete",label:bt.DELETE,icon:ni,color:x.v2.colors.red[500],active:O,onClick:Y})),e},[P,E,O,k,H,W,q,Y,x]),te=r(()=>{if(!_)return[];const e=[],t={backgroundColor:"transparent",textSize:ce.S};return e.push({...t,label:_.id.name,leftIcon:Ti}),_.serviceName&&_.serviceName!==_.id.name&&e.push({...t,label:_.serviceName,leftIcon:ki,textColor:x.v2.colors.silver[200]}),e},[_,x]);if(!_)return t(ft,{isOpen:!0,children:t(Ke,{$height:"80vh",children:t(Qe,{withSpinner:!0})})});const oe=P===Hc.Profiling?R?"95vw":"80vw":E?void 0:"60vw";return e(o,{children:[t(ft,{isOpen:!0,width:oe,header:{icon:ro(_.containers)[0],titleBadges:te,onClose:()=>{L(Hc.Overview),M(null),F(!1),a()},actions:ee},footer:{actions:E?[{"data-id":"edit-source-btn-cancel",label:bt.CANCEL,variant:ae.Secondary,onClick:G},{"data-id":"edit-source-btn-save",label:bt.SAVE,variant:ae.Primary,onClick:K}]:[]},children:t(vt,{$padding:"4px 12px 12px",children:e(V,{$gap:16,children:[!E&&j.length>1&&t(ue,{options:j,selected:P,setSelected:L}),(()=>{switch(P){case Hc.Overview:return E?t(ps,{}):t(hc,{source:_,onClickRollout:q,onClickRollback:Z,onOverride:e=>h(s,e)});case Hc.Pods:return t(Ir,{source:_,onClickRestartPod:H?(e,t)=>B({openFor:Wc.Pod,podNamespace:e,podName:t}):void 0});case Hc.PeerSources:return t(Nr,{source:_,fetchPeerSources:v});case Hc.Profiling:return t(Vc,{source:_,fetchProfilingSlots:S,enableProfiling:C,fetchSourceProfiling:w,onFlameFullscreenChange:F});case Hc.Debug:return t(Uc,{source:_});default:return null}})()]})})}),t(ml,{target:"source",action:"uninstrument",isOpen:O,onClose:()=>D(!1),onApprove:J}),t(ml,{target:`${z.openFor?.toLowerCase()??""}`,action:"restart",description:Re.RESTART_POD_DESCRIPTION,isOpen:!!z.openFor,onClose:()=>B({openFor:null}),onApprove:Q,overrideApproveButtonLabel:Re.DELETE_POD_TO_RESTART})]})},Zc=g.div`
247
+ `,Vc=({source:o,fetchProfilingSlots:i,enableProfiling:s,fetchSourceProfiling:u,onFlameFullscreenChange:p})=>{const h=f(),m=o.id,[g,b]=l(!0),[v,y]=l(null),[C,S]=l(null),[w,x]=l(0),[k,T]=l(Fc.Both),[$,I]=l(""),[N,E]=l({}),A=d(null),O=c(async()=>{try{const e=[i()];g&&e.push(u(m));const[t,o]=await Promise.all(e);t&&y(t),o?.profileJson&&S(o.profileJson)}finally{x(e=>e+1)}},[i,u,m]);n(()=>{let e=!1;return(async()=>{await s(m),e||(await O(),e||(A.current=setInterval(O,3e3)))})(),()=>{e=!0,A.current&&clearInterval(A.current)}},[s,O,m]);const D=r(()=>function(e){if(!e?.trim())return null;try{const t=JSON.parse(e),o=t.flamebearer;return!o?.names?.length||!Array.isArray(o.levels)||"number"!=typeof o.numTicks||o.numTicks<=0?null:{flamebearer:o,units:t.metadata?.units}}catch{return null}}(C),[C]),R=r(()=>D?function(e){const t=new Map;for(let o=0;o<e.levels.length;o++){const n=e.levels[o];for(let o=0;o+3<n.length;o+=4){const a=n[o+1],i=n[o+2],l=mc(e,n[o+3]);if(!l)continue;const s=t.get(l);(!s||a>s.total)&&t.set(l,{self:i,total:a})}}return[...t.entries()].map(([e,t])=>({name:e,self:t.self,total:t.total})).sort((e,t)=>t.self-e.self)}(D.flamebearer):[],[D]),F=r(()=>{const e=$.trim().toLowerCase();return e?R.filter(t=>t.name.toLowerCase().includes(e)):R},[R,$]),P=k===Fc.Table||k===Fc.Both,L=k===Fc.Flame||k===Fc.Both,_=P&&L,M=o.runtimeInfo?.detectedLanguages||o.containers?.map(e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??""),B=r(()=>function(e,t){if(!t?.includes(io.Java))return;const o=e?.[Nc.Symbol]?.filter(Boolean)??[];return 0!==o.length?e=>Oc(e,o):void 0}(N,M),[N,M]);return!C&&w<2?t(Ke,{$height:"70vh",children:t(Qe,{withSpinner:!0})}):e(Pc,{$gap:0,$width:"100%",children:[e(Lc,{children:[t(we,{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(_c,{children:t(re,{size:ce.S,weight:500,color:Ce.Primary,nowrap:!0,children:"CPU Profiling"})})}),e(te,{style:{flex:1,minWidth:200,gap:10,alignItems:"center",flexWrap:"wrap"},children:[t("div",{style:{flex:"1 1 220px",minWidth:180},children:t(Vt,{value:$,onChange:I,placeholder:"Search by symbol name",width:"100%",idleBackgroundColor:h.v2.colors.silver[900],emphasizeBackgroundColor:h.v2.colors.silver[800]})}),t(ue,{variant:ao.Filled,options:[{value:Fc.Table,label:"Top table"},{value:Fc.Flame,label:"Flame graph"},{value:Fc.Both,label:"Both"}],selected:k,setSelected:T}),t(oe,g?{variant:ae.Secondary,size:ne.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(Li,{...e,size:8,fill:h.v2.colors.green[500]})}:{variant:ae.Secondary,size:ne.S,label:"Paused",tooltip:"Odigos profiler is still collecting data, but the UI is not updating in real time",leftIcon:e=>t(Li,{...e,size:8,fill:h.v2.colors.red[500]})})]})]}),t(Mc,{$gap:P&&L?16:0,children:D?e(a,{children:[P&&e(Bc,{$splitWithFlame:_,children:[t(Xc,{$justifyContent:"flex-end",children:t(oe,{variant:ae.Secondary,size:ne.S,label:"Download snapshot",rightIcon:_i,onClick:()=>{if(!C)return;const e=new Blob([C],{type:"application/json"}),t=URL.createObjectURL(e),n=document.createElement("a");n.href=t,n.download=`cpu-profile-${o.id.namespace}-${o.id.kind}-${o.id.name}.json`,n.click(),URL.revokeObjectURL(t)},disabled:!C})}),t(Rc,{rows:F,languages:M,filters:N,onFiltersChange:E})]}),L&&e(zc,{$splitWithTable:_,children:[e(Xc,{$justifyContent:"space-between",children:[t(Ee,{label:D?`Total in view ${gc(D.flamebearer.numTicks)}`:"No profile sample yet",backgroundColor:h.v2.colors.silver[750],textColor:h.v2.colors.silver[200],textSize:ce.XXS}),e(te,{$gap:12,children:[!g&&t(oe,{variant:ae.Secondary,size:ne.S,label:"Refresh",leftIcon:$i,onClick:O}),t(q,{label:"Auto refresh",labelAlign:Z.Left,size:ct.S,value:g,onChange:b})]})]}),t(Ic,{flamebearer:D.flamebearer,maxRowPx:24,searchQuery:$,shouldKeepName:B,minHostHeight:280,onFullscreenChange:p,profilingSlots:v},k)]})]}):t(Ke,{children:t(se,{title:"No profile samples yet",subTitle:"Dynamically collecting profiling samples — keep this tab open while the agent sends OTLP profiles."})})})]})},Uc=({source:o})=>{const n=f();return e(yt,{bgTint:"1000",children:[o.manifestYAML&&t(fl,{bgTint:"800",codeBgColor:n.v2.colors.silver[900],title:`${o.id.kind} YAML`,yaml:o.manifestYAML}),o.instrumentationConfigYAML&&t(fl,{bgTint:"800",codeBgColor:n.v2.colors.silver[900],title:"Instrumentation Config YAML",yaml:o.instrumentationConfigYAML})]})};var Hc;!function(e){e.Overview="overview",e.Pods="pods",e.PeerSources="peer-sources",e.Profiling="profiling",e.Debug="debug"}(Hc||(Hc={}));const jc=[co.Deployment,co.StatefulSet,co.DaemonSet,co.DeploymentConfig,co.Rollout,co.Pod];var Wc;!function(e){e.Workload="Workload",e.Pod="Pod"}(Wc||(Wc={}));const Gc=e=>!!e&&Pt(e.status)===ge.Error,Kc=e=>Gc(e.healthStatus),Yc=e=>Gc(e.odigosHealthStatus)||(e.processes??[]).some(Kc),Jc=e=>Gc(e.agentInjectedStatus)||Gc(e.odigosHealthStatus)||(e.containers??[]).some(Yc),qc=({onClose:a,effectiveConfig:i,sourceId:s,fetchSourceById:u,persistSources:p,updateSource:h,restartWorkloads:m,restartPod:g,recoverFromRollback:b,fetchPeerSources:v,enableProfiling:C,fetchProfilingSlots:S,fetchSourceProfiling:w})=>{const x=f(),{isVm:k}=y(),{selectedStreamName:T}=Fe(),{genericForm:$,loadSource:I,validateFormData:N}=kl(),[E,A]=l(!1),[O,D]=l(!1),[R,F]=l(!1),[P,L]=l(Hc.Overview),[_,M]=l(null),[B,z]=l({openFor:null});n(()=>{_&&JSON.stringify(jt(s))!==JSON.stringify(jt(_))&&M(null)},[s,_]);const X=d(!1),U=c(async()=>M(await u(s)||null),[s]);n(()=>{if(X.current||(U(),X.current=!0),!E){const e=setInterval(()=>U(),3e3);return()=>clearInterval(e)}},[U,E]),n(()=>{_&&I(_)},[_]);const H=_&&jc.includes(_.id.kind),j=r(()=>{const e=[],o=(_?.pods??[]).some(Jc);return e.push({value:Hc.Overview,label:Re.OVERVIEW}),e.push({value:Hc.Pods,label:Re.PODS,icon:o?e=>t(Ii,{...e,fill:x.v2.colors.red[500]}):void 0}),k||e.push({value:Hc.PeerSources,label:Re.PEER_SOURCES}),i?.profiling?.enabled&&e.push({value:Hc.Profiling,label:Re.PROFILING}),(_?.manifestYAML||_?.instrumentationConfigYAML)&&e.push({value:Hc.Debug,label:Re.DEBUG}),e},[k,i,_?.pods,_?.manifestYAML,_?.instrumentationConfigYAML]),W=c(()=>A(!0),[]),G=c(()=>{_&&I(_),A(!1)},[_]),K=c(async()=>{if(!_||!$)return;const{errorMessage:e,preparedFormData:t}=N();if(e)return;const o=t.otelServiceName!==_.id.name?t.otelServiceName:"";await h(s,{...t,otelServiceName:o}),A(!1)},[_,$,N,s,h]),Y=c(()=>D(!0),[]),J=c(async()=>{_&&(await p({[mt]:[{namespace:_.id.namespace,name:_.id.name,kind:_.id.kind,selected:!1,currentStreamName:T}]}),D(!1),a())},[_,p,T,a]),q=c(()=>{z({openFor:Wc.Workload})},[]),Z=c(async()=>{await b(s)},[b,s]),Q=c(async()=>{B.openFor===Wc.Workload?await m([s]):B.openFor===Wc.Pod&&B.podNamespace&&B.podName&&await g(B.podNamespace,B.podName),z({openFor:null})},[B,m,g,s]),ee=r(()=>{const e=[];return E||P===Hc.Overview&&(e.push({id:"edit-source-btn-edit",label:bt.EDIT,icon:ci,active:E,onClick:W}),!k&&H&&e.push({id:"edit-source-btn-restart",label:bt.RESTART,icon:Mi,onClick:q}),e.push({id:"edit-source-btn-delete",label:bt.DELETE,icon:ni,color:x.v2.colors.red[500],active:O,onClick:Y})),e},[P,E,O,k,H,W,q,Y,x]),te=r(()=>{if(!_)return[];const e=[],t={backgroundColor:"transparent",textSize:ce.S};return e.push({...t,label:_.id.name,leftIcon:Ti}),_.serviceName&&_.serviceName!==_.id.name&&e.push({...t,label:_.serviceName,leftIcon:ki,textColor:x.v2.colors.silver[200]}),e},[_,x]);if(!_)return t(ft,{isOpen:!0,children:t(Ke,{$height:"80vh",children:t(Qe,{withSpinner:!0})})});const oe=P===Hc.Profiling?R?"95vw":"80vw":E?void 0:"60vw";return e(o,{children:[t(ft,{isOpen:!0,width:oe,header:{icon:ro(_.containers)[0],titleBadges:te,onClose:()=>{L(Hc.Overview),M(null),F(!1),a()},actions:ee},footer:{actions:E?[{"data-id":"edit-source-btn-cancel",label:bt.CANCEL,variant:ae.Secondary,onClick:G},{"data-id":"edit-source-btn-save",label:bt.SAVE,variant:ae.Primary,onClick:K}]:[]},children:t(vt,{$padding:"4px 12px 12px",children:e(V,{$gap:16,children:[!E&&j.length>1&&t(ue,{options:j,selected:P,setSelected:L}),(()=>{switch(P){case Hc.Overview:return E?t(ps,{}):t(hc,{source:_,onClickRollout:q,onClickRollback:Z,onOverride:e=>h(s,e)});case Hc.Pods:return t(Ir,{source:_,onClickRestartPod:H?(e,t)=>z({openFor:Wc.Pod,podNamespace:e,podName:t}):void 0});case Hc.PeerSources:return t(Nr,{source:_,fetchPeerSources:v});case Hc.Profiling:return t(Vc,{source:_,fetchProfilingSlots:S,enableProfiling:C,fetchSourceProfiling:w,onFlameFullscreenChange:F});case Hc.Debug:return t(Uc,{source:_});default:return null}})()]})})}),t(ml,{target:"source",action:"uninstrument",isOpen:O,onClose:()=>D(!1),onApprove:J}),t(ml,{target:`${B.openFor?.toLowerCase()??""}`,action:"restart",description:Re.RESTART_POD_DESCRIPTION,isOpen:!!B.openFor,onClose:()=>z({openFor:null}),onApprove:Q,overrideApproveButtonLabel:Re.DELETE_POD_TO_RESTART})]})},Zc=g.div`
248
248
  display: flex;
249
249
  align-items: center;
250
250
  gap: 8px;
@@ -256,7 +256,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
256
256
  }
257
257
  `,Qc=g.div`
258
258
  flex: 1;
259
- `,ed=({onClick:o})=>{const n=f().v2.colors.red[500];return e(Zc,{"data-id":"sampling-view-btn-delete",onClick:o,children:[t(re,{size:ce.XS,weight:500,color:n,children:mo}),t(ni,{size:16,fill:n})]})};function td(n){if(n.isEditing){const{onCancelEdit:a,onSave:i,onDelete:l,duplicateWarning:s}=n;return{children:e(o,{children:[t(ed,{onClick:l}),s&&t(me,{status:ge.Warning,message:s.message,action:s.onViewRule?{"data-id":"sampling-view-edit-btn-view-duplicate",label:"View rule",onClick:s.onViewRule}:void 0}),t(Qc,{}),t(oe,{"data-id":"sampling-view-edit-btn-cancel",label:uo,variant:ae.Secondary,size:ne.S,onClick:a}),t(oe,{"data-id":"sampling-view-edit-btn-save",label:po,variant:ae.Primary,size:ne.S,onClick:i,disabled:!!s})]})}}const{onDelete:a,onCancel:i,onEdit:l}=n;return{children:e(o,{children:[t(ed,{onClick:a}),t(Qc,{}),t(oe,{"data-id":"sampling-view-btn-cancel",label:uo,variant:ae.Secondary,size:ne.S,onClick:i}),t(oe,{"data-id":"sampling-view-btn-edit",label:ho,variant:ae.Primary,size:ne.S,onClick:l})]})}}const od={[$l.EditAutoNoisy]:{title:To,subTitle:ko,cancelId:"sampling-edit-auto-rule-btn-cancel",saveId:"sampling-edit-auto-rule-btn-save"},[$l.EditAutoCostReduction]:{title:xo,subTitle:wo,cancelId:"sampling-edit-cost-reduction-auto-rule-btn-cancel",saveId:"sampling-edit-cost-reduction-auto-rule-btn-save"},[$l.EditAutoHighlyRelevant]:{title:So,subTitle:Co,cancelId:"sampling-edit-highly-relevant-auto-rule-btn-cancel",saveId:"sampling-edit-highly-relevant-auto-rule-btn-save"}},nd=({isOpen:e,title:o,subTitle:n,onClose:a,footer:i,renderBody:l})=>t(ft,{isOpen:e,width:Io,header:{icon:zi,title:o,subTitle:n,onClose:a},footer:i,children:l?l():t(vt,{$padding:"12px",children:t(vs,{})})}),ad=({isOpen:e,onClose:o,onSubmit:a,validateForm:i,onNavigateToDuplicate:l})=>{const{category:s,formData:r,resetForm:d,duplicateWarning:u,setDuplicateWarning:p}=Tl($l.Create);n(()=>{e&&d()},[e]);const h=c(()=>{if(i){const e=i(r);if(e)return void p(e)}a(r)},[r,a,i,p]),m={note:u?{status:ge.Warning,message:u.message,action:l?{"data-id":"sampling-create-btn-view-duplicate",label:"View rule",onClick:()=>l(u.ruleId)}:void 0}:void 0,actions:[{"data-id":"sampling-create-btn-cancel",label:uo,variant:ae.Secondary,size:ne.S,onClick:o},{"data-id":"sampling-create-btn-submit",label:vo,variant:ae.Primary,size:ne.S,onClick:h,disabled:!!u}]};return t(nd,{isOpen:e,title:yo[s],subTitle:go[s],onClose:o,footer:m})},id=({onClose:e,onDelete:o,onSaveEdit:n,validateForm:a,onNavigateToDuplicate:i})=>{const{data:l,isEditing:s,formData:d,handleEdit:u,handleCancelEdit:p,duplicateWarning:h,setDuplicateWarning:m}=Tl($l.View),g=l?.rule.name||bo,f=s&&l?fo[l.category]:`${g} preview`,b=c(()=>{if(l&&s){if(a){const e=a(d);if(e)return void m(e)}n(d,l.rule.ruleId,l.samplingId)}},[l,s,d,n,a,m]),v=c(()=>{l&&o(l.rule.ruleId,l.samplingId)},[l,o]),y=r(()=>{if(!l)return;const t=h?{message:h.message,onViewRule:i?()=>i(h.ruleId):void 0}:null;return td(s?{isEditing:!0,onCancelEdit:p,onSave:b,onDelete:v,duplicateWarning:t}:{isEditing:!1,onDelete:v,onCancel:e,onEdit:u})},[l,s,h,p,b,v,u,e,i]);return t(nd,{isOpen:!!l,title:f,subTitle:l?go[l.category]:"",onClose:e,footer:y})},ld=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:a,resolvedPercentage:i}=Tl($l.EditAutoNoisy),l=c(()=>n(a,i),[n,a,i]);return t(cd,{formType:$l.EditAutoNoisy,isOpen:e,onClose:o,onSave:l})},sd=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:a,resolvedPercentage:i}=Tl($l.EditAutoCostReduction),l=c(()=>n(a,i),[n,a,i]);return t(cd,{formType:$l.EditAutoCostReduction,isOpen:e,onClose:o,onSave:l})},rd=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:a}=Tl($l.EditAutoHighlyRelevant),i=c(()=>n(a),[n,a]);return t(cd,{formType:$l.EditAutoHighlyRelevant,isOpen:e,onClose:o,onSave:i})},cd=({formType:e,isOpen:o,onClose:n,onSave:a})=>{const i=od[e];return t(nd,{isOpen:o,title:i.title,subTitle:i.subTitle,onClose:n,footer:{actions:[{"data-id":i.cancelId,label:uo,variant:ae.Secondary,size:ne.S,onClick:n},{"data-id":i.saveId,label:$o,variant:ae.Primary,size:ne.S,onClick:a}]}})},dd=e=>{switch(e.formType){case $l.Create:return t(Dl,{formType:$l.Create,category:e.category,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(ad,{...e})});case $l.View:return t(Dl,{formType:$l.View,data:e.data,defaultEditMode:e.defaultEditMode,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(id,{...e})});case $l.EditAutoNoisy:return t(Dl,{formType:$l.EditAutoNoisy,enabled:e.enabled,keepPercentage:e.keepPercentage,children:t(ld,{...e})});case $l.EditAutoCostReduction:return t(Dl,{formType:$l.EditAutoCostReduction,enabled:e.enabled,dropPercentage:e.dropPercentage,children:t(sd,{...e})});case $l.EditAutoHighlyRelevant:return t(Dl,{formType:$l.EditAutoHighlyRelevant,enabled:e.enabled,children:t(rd,{...e})})}},ud=({token:n,isLoading:a,isEditing:i,onEdit:l,onCancel:s,onSave:r,formData:c,handleFormChange:d,handleErrorChange:u,formErrors:p})=>{const{CopyButton:h}=Jt(),m=!i||a||!c.newToken;return No({key:"Enter",active:!m},r),e(te,i?{$justifyContent:"space-between",$alignItems:"flex-start",$gap:12,children:[t(W,{type:"password",value:c.newToken,onChange:e=>{d("newToken",e.target.value),u("newToken",void 0)},width:"430px",autoFocus:!0,errorMessage:p.newToken}),t(te,{$margin:a?"8px 0 0 0":"2px 0 0 0",$alignItems:"center",children:a?t(Qe,{title:"Saving...",withGradient:!0}):e(o,{children:[t(oe,{variant:ae.Secondary,size:ne.S,leftIcon:vi,onClick:s,disabled:a}),t(oe,{variant:ae.Primary,size:ne.S,leftIcon:bi,onClick:r,disabled:m})]})})]}:{$justifyContent:"space-between",$gap:12,children:[t(re,{size:ce.XS,children:new Array(55).fill("•").join("")}),e(te,{$alignItems:"center",$justifyContent:"space-between",children:[t(h,{value:n}),t(qe,{icon:ci,onClick:l})]})]})},pd=({expiresAt:e,callbackValid:o,callbackExpired:a})=>{const{formatTimeAgo:i}=Ot(),l=r(()=>i(e),[e,i]),s=r(()=>new Date(e).toDateString().split(" ").slice(1).join(" "),[e]),c=r(()=>Eo(e,0)?ge.Error:Eo(e,2592e6)?ge.Warning:ge.Success,[e]),d=r(()=>c===ge.Success?bi:c===ge.Warning?Bi:Ii,[c]);return n(()=>{c===ge.Success?o():c===ge.Error&&a()},[c]),t(we,{text:s,children:t(Ee,{leftIcon:d,label:l,status:c,invertColors:!0,useSecondaryTone:!0})})},hd=g.div`
259
+ `,ed=({onClick:o})=>{const n=f().v2.colors.red[500];return e(Zc,{"data-id":"sampling-view-btn-delete",onClick:o,children:[t(re,{size:ce.XS,weight:500,color:n,children:mo}),t(ni,{size:16,fill:n})]})};function td(n){if(n.isEditing){const{onCancelEdit:a,onSave:i,onDelete:l,duplicateWarning:s}=n;return{children:e(o,{children:[t(ed,{onClick:l}),s&&t(me,{status:ge.Warning,message:s.message,action:s.onViewRule?{"data-id":"sampling-view-edit-btn-view-duplicate",label:"View rule",onClick:s.onViewRule}:void 0}),t(Qc,{}),t(oe,{"data-id":"sampling-view-edit-btn-cancel",label:uo,variant:ae.Secondary,size:ne.S,onClick:a}),t(oe,{"data-id":"sampling-view-edit-btn-save",label:po,variant:ae.Primary,size:ne.S,onClick:i,disabled:!!s})]})}}const{onDelete:a,onCancel:i,onEdit:l}=n;return{children:e(o,{children:[t(ed,{onClick:a}),t(Qc,{}),t(oe,{"data-id":"sampling-view-btn-cancel",label:uo,variant:ae.Secondary,size:ne.S,onClick:i}),t(oe,{"data-id":"sampling-view-btn-edit",label:ho,variant:ae.Primary,size:ne.S,onClick:l})]})}}const od={[$l.EditAutoNoisy]:{title:To,subTitle:ko,cancelId:"sampling-edit-auto-rule-btn-cancel",saveId:"sampling-edit-auto-rule-btn-save"},[$l.EditAutoCostReduction]:{title:xo,subTitle:wo,cancelId:"sampling-edit-cost-reduction-auto-rule-btn-cancel",saveId:"sampling-edit-cost-reduction-auto-rule-btn-save"},[$l.EditAutoHighlyRelevant]:{title:So,subTitle:Co,cancelId:"sampling-edit-highly-relevant-auto-rule-btn-cancel",saveId:"sampling-edit-highly-relevant-auto-rule-btn-save"}},nd=({isOpen:e,title:o,subTitle:n,onClose:a,footer:i,renderBody:l})=>t(ft,{isOpen:e,width:Io,header:{icon:Bi,title:o,subTitle:n,onClose:a},footer:i,children:l?l():t(vt,{$padding:"12px",children:t(vs,{})})}),ad=({isOpen:e,onClose:o,onSubmit:a,validateForm:i,onNavigateToDuplicate:l})=>{const{category:s,formData:r,resetForm:d,duplicateWarning:u,setDuplicateWarning:p}=Tl($l.Create);n(()=>{e&&d()},[e]);const h=c(()=>{if(i){const e=i(r);if(e)return void p(e)}a(r)},[r,a,i,p]),m={note:u?{status:ge.Warning,message:u.message,action:l?{"data-id":"sampling-create-btn-view-duplicate",label:"View rule",onClick:()=>l(u.ruleId)}:void 0}:void 0,actions:[{"data-id":"sampling-create-btn-cancel",label:uo,variant:ae.Secondary,size:ne.S,onClick:o},{"data-id":"sampling-create-btn-submit",label:vo,variant:ae.Primary,size:ne.S,onClick:h,disabled:!!u}]};return t(nd,{isOpen:e,title:yo[s],subTitle:go[s],onClose:o,footer:m})},id=({onClose:e,onDelete:o,onSaveEdit:n,validateForm:a,onNavigateToDuplicate:i})=>{const{data:l,isEditing:s,formData:d,handleEdit:u,handleCancelEdit:p,duplicateWarning:h,setDuplicateWarning:m}=Tl($l.View),g=l?.rule.name||bo,f=s&&l?fo[l.category]:`${g} preview`,b=c(()=>{if(l&&s){if(a){const e=a(d);if(e)return void m(e)}n(d,l.rule.ruleId,l.samplingId)}},[l,s,d,n,a,m]),v=c(()=>{l&&o(l.rule.ruleId,l.samplingId)},[l,o]),y=r(()=>{if(!l)return;const t=h?{message:h.message,onViewRule:i?()=>i(h.ruleId):void 0}:null;return td(s?{isEditing:!0,onCancelEdit:p,onSave:b,onDelete:v,duplicateWarning:t}:{isEditing:!1,onDelete:v,onCancel:e,onEdit:u})},[l,s,h,p,b,v,u,e,i]);return t(nd,{isOpen:!!l,title:f,subTitle:l?go[l.category]:"",onClose:e,footer:y})},ld=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:a,resolvedPercentage:i}=Tl($l.EditAutoNoisy),l=c(()=>n(a,i),[n,a,i]);return t(cd,{formType:$l.EditAutoNoisy,isOpen:e,onClose:o,onSave:l})},sd=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:a,resolvedPercentage:i}=Tl($l.EditAutoCostReduction),l=c(()=>n(a,i),[n,a,i]);return t(cd,{formType:$l.EditAutoCostReduction,isOpen:e,onClose:o,onSave:l})},rd=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:a}=Tl($l.EditAutoHighlyRelevant),i=c(()=>n(a),[n,a]);return t(cd,{formType:$l.EditAutoHighlyRelevant,isOpen:e,onClose:o,onSave:i})},cd=({formType:e,isOpen:o,onClose:n,onSave:a})=>{const i=od[e];return t(nd,{isOpen:o,title:i.title,subTitle:i.subTitle,onClose:n,footer:{actions:[{"data-id":i.cancelId,label:uo,variant:ae.Secondary,size:ne.S,onClick:n},{"data-id":i.saveId,label:$o,variant:ae.Primary,size:ne.S,onClick:a}]}})},dd=e=>{switch(e.formType){case $l.Create:return t(Dl,{formType:$l.Create,category:e.category,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(ad,{...e})});case $l.View:return t(Dl,{formType:$l.View,data:e.data,defaultEditMode:e.defaultEditMode,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(id,{...e})});case $l.EditAutoNoisy:return t(Dl,{formType:$l.EditAutoNoisy,enabled:e.enabled,keepPercentage:e.keepPercentage,children:t(ld,{...e})});case $l.EditAutoCostReduction:return t(Dl,{formType:$l.EditAutoCostReduction,enabled:e.enabled,dropPercentage:e.dropPercentage,children:t(sd,{...e})});case $l.EditAutoHighlyRelevant:return t(Dl,{formType:$l.EditAutoHighlyRelevant,enabled:e.enabled,children:t(rd,{...e})})}},ud=({token:n,isLoading:a,isEditing:i,onEdit:l,onCancel:s,onSave:r,formData:c,handleFormChange:d,handleErrorChange:u,formErrors:p})=>{const{CopyButton:h}=Jt(),m=!i||a||!c.newToken;return No({key:"Enter",active:!m},r),e(te,i?{$justifyContent:"space-between",$alignItems:"flex-start",$gap:12,children:[t(W,{type:"password",value:c.newToken,onChange:e=>{d("newToken",e.target.value),u("newToken",void 0)},width:"430px",autoFocus:!0,errorMessage:p.newToken}),t(te,{$margin:a?"8px 0 0 0":"2px 0 0 0",$alignItems:"center",children:a?t(Qe,{title:"Saving...",withGradient:!0}):e(o,{children:[t(oe,{variant:ae.Secondary,size:ne.S,leftIcon:vi,onClick:s,disabled:a}),t(oe,{variant:ae.Primary,size:ne.S,leftIcon:bi,onClick:r,disabled:m})]})})]}:{$justifyContent:"space-between",$gap:12,children:[t(re,{size:ce.XS,children:new Array(55).fill("•").join("")}),e(te,{$alignItems:"center",$justifyContent:"space-between",children:[t(h,{value:n}),t(qe,{icon:ci,onClick:l})]})]})},pd=({expiresAt:e,callbackValid:o,callbackExpired:a})=>{const{formatTimeAgo:i}=Ot(),l=r(()=>i(e),[e,i]),s=r(()=>new Date(e).toDateString().split(" ").slice(1).join(" "),[e]),c=r(()=>Eo(e,0)?ge.Error:Eo(e,2592e6)?ge.Warning:ge.Success,[e]),d=r(()=>c===ge.Success?bi:c===ge.Warning?zi:Ii,[c]);return n(()=>{c===ge.Success?o():c===ge.Error&&a()},[c]),t(we,{text:s,children:t(Ee,{leftIcon:d,label:l,status:c,invertColors:!0,useSecondaryTone:!0})})},hd=g.div`
260
260
  display: flex;
261
261
  flex-direction: column;
262
262
  gap: 12px;
@@ -331,16 +331,16 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
331
331
  padding: 16px;
332
332
  border-radius: 16px;
333
333
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
334
- `,Md=({children:e,fillHeight:o,width:n})=>t(_d,{$fillHeight:o,$width:n,children:e}),zd=g.ul`
334
+ `,Md=({children:e,fillHeight:o,width:n})=>t(_d,{$fillHeight:o,$width:n,children:e}),Bd=g.ul`
335
335
  margin: 0;
336
336
  padding: 0;
337
337
  list-style: disc;
338
- `,Bd=g.li`
338
+ `,zd=g.li`
339
339
  margin-left: 18px;
340
340
  & + & {
341
341
  margin-top: 6px;
342
342
  }
343
- `,Xd=({items:e,color:o})=>{const n=f(),a=o||n.v2.colors.silver[200];return t(zd,{children:e.map((e,o)=>t(Bd,{style:{color:a},children:t(re,{size:ce.XXS,color:a,children:e})},o))})},Vd=({items:o})=>{const n=f();return t(V,{$gap:16,children:o.map((o,a)=>e(te,{$gap:8,$alignItems:"flex-start",children:[e(re,{size:ce.XS,color:n.v2.colors.silver[200],weight:400,children:[a+1,"."]}),e(V,{$gap:2,children:[t(re,{size:ce.XS,color:n.v2.colors.white[500],weight:500,children:o.title}),t(re,{size:ce.XS,color:n.v2.colors.silver[200],children:o.description})]})]},a))})},Ud=({message:e})=>t(me,{status:ge.Default,message:e,fullWidth:!0,smallIcon:!0}),Hd=g.div`
343
+ `,Xd=({items:e,color:o})=>{const n=f(),a=o||n.v2.colors.silver[200];return t(Bd,{children:e.map((e,o)=>t(zd,{style:{color:a},children:t(re,{size:ce.XXS,color:a,children:e})},o))})},Vd=({items:o})=>{const n=f();return t(V,{$gap:16,children:o.map((o,a)=>e(te,{$gap:8,$alignItems:"flex-start",children:[e(re,{size:ce.XS,color:n.v2.colors.silver[200],weight:400,children:[a+1,"."]}),e(V,{$gap:2,children:[t(re,{size:ce.XS,color:n.v2.colors.white[500],weight:500,children:o.title}),t(re,{size:ce.XS,color:n.v2.colors.silver[200],children:o.description})]})]},a))})},Ud=({message:e})=>t(me,{status:ge.Default,message:e,fullWidth:!0,smallIcon:!0}),Hd=g.div`
344
344
  width: calc(100% - 16px);
345
345
  padding: 8px;
346
346
  display: flex;
@@ -363,13 +363,13 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
363
363
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
364
364
  `,Gd=({children:e})=>{const o=f();return t(re,{size:ce.S,weight:500,color:o.v2.colors.white[500],align:"center",children:e})},Kd=g.div`
365
365
  white-space: pre-line;
366
- `,Yd=({enabled:n,onEnabledChange:a,onBack:i,onNext:l})=>{const s=f(),c=r(()=>w({enabled:n,keepPercentage:0}),[n]);return e(o,{children:[t(Ld,{title:Mo,onBack:i}),e(Dd,{$width:854,children:[t(Gd,{children:zo}),e(V,{$gap:8,$width:"100%",children:[t(Md,{children:t(Kd,{children:t(re,{size:ce.XXS,color:s.v2.colors.silver[200],children:Bo})})}),e(V,{$gap:8,$width:"100%",children:[e(Hd,{children:[t(jd,{children:t(re,{size:ce.S,weight:500,color:s.v2.colors.white[500],children:Xo})}),t(Wd,{children:t(Nd,{name:Uo,recommended:!0,toggleLabel:Vo,enabled:n,onEnabledChange:a,summary:c,toggleName:"sampling-onboarding-noisy-toggle"})})]}),t(Ud,{message:Ho})]})]})]}),t(Fd,{onNext:l})]})},Jd=e=>t(Wi,{rotate:90,...e}),qd=({onClose:n})=>{const a=f();return e(o,{children:[t(Od,{}),e(Dd,{$width:732,children:[t(jo,{icon:zi}),e(V,{$gap:16,$alignItems:"center",$width:"100%",children:[t(re,{size:ce.M,weight:500,color:a.v2.colors.white[500],children:Wo}),Go.split("\n").map(e=>t(Gd,{children:e},e)),e(Md,{children:[t(re,{size:ce.XS,color:a.v2.colors.silver[200],children:Ko}),t(Xd,{color:a.v2.colors.white[500],items:[Yo,Jo,qo]})]})]})]}),t(Fd,{center:!0,children:t(oe,{"data-id":"sampling-onboarding-btn-go-to",label:Zo,rightIcon:Jd,variant:ae.Primary,size:ne.M,onClick:n})})]})},Zd=e=>t(Wi,{rotate:90,...e}),Qd=g.div`
366
+ `,Yd=({enabled:n,onEnabledChange:a,onBack:i,onNext:l})=>{const s=f(),c=r(()=>w({enabled:n,keepPercentage:0}),[n]);return e(o,{children:[t(Ld,{title:Mo,onBack:i}),e(Dd,{$width:854,children:[t(Gd,{children:Bo}),e(V,{$gap:8,$width:"100%",children:[t(Md,{children:t(Kd,{children:t(re,{size:ce.XXS,color:s.v2.colors.silver[200],children:zo})})}),e(V,{$gap:8,$width:"100%",children:[e(Hd,{children:[t(jd,{children:t(re,{size:ce.S,weight:500,color:s.v2.colors.white[500],children:Xo})}),t(Wd,{children:t(Nd,{name:Uo,recommended:!0,toggleLabel:Vo,enabled:n,onEnabledChange:a,summary:c,toggleName:"sampling-onboarding-noisy-toggle"})})]}),t(Ud,{message:Ho})]})]})]}),t(Fd,{onNext:l})]})},Jd=e=>t(Wi,{rotate:90,...e}),qd=({onClose:n})=>{const a=f();return e(o,{children:[t(Od,{}),e(Dd,{$width:732,children:[t(jo,{icon:Bi}),e(V,{$gap:16,$alignItems:"center",$width:"100%",children:[t(re,{size:ce.M,weight:500,color:a.v2.colors.white[500],children:Wo}),Go.split("\n").map(e=>t(Gd,{children:e},e)),e(Md,{children:[t(re,{size:ce.XS,color:a.v2.colors.silver[200],children:Ko}),t(Xd,{color:a.v2.colors.white[500],items:[Yo,Jo,qo]})]})]})]}),t(Fd,{center:!0,children:t(oe,{"data-id":"sampling-onboarding-btn-go-to",label:Zo,rightIcon:Jd,variant:ae.Primary,size:ne.M,onClick:n})})]})},Zd=e=>t(Wi,{rotate:90,...e}),Qd=g.div`
367
367
  display: flex;
368
368
  flex-direction: column;
369
369
  align-items: center;
370
370
  gap: 8px;
371
371
  width: 100%;
372
- `,eu=({onSkip:n,onNext:a})=>{const i=f();return e(o,{children:[t(Od,{}),e(Dd,{$width:732,children:[t(jo,{icon:zi}),e(V,{$gap:16,$alignItems:"center",$width:"100%",children:[e(Qd,{children:[t(re,{size:ce.M,weight:500,color:i.v2.colors.white[500],children:Qo}),t(Gd,{children:en})]}),e(Md,{children:[t(re,{size:ce.XS,color:i.v2.colors.silver[200],children:tn}),t(Vd,{items:[{title:nn,description:on},{title:ln,description:an},{title:rn,description:sn}]}),t(Ud,{message:cn})]})]})]}),e(Fd,{center:!0,children:[t(oe,{"data-id":"sampling-onboarding-btn-skip",label:dn,variant:ae.Secondary,onClick:n}),t(oe,{"data-id":"sampling-onboarding-btn-start",label:un,rightIcon:Zd,variant:ae.Primary,onClick:a})]})]})},tu=g.div`
372
+ `,eu=({onSkip:n,onNext:a})=>{const i=f();return e(o,{children:[t(Od,{}),e(Dd,{$width:732,children:[t(jo,{icon:Bi}),e(V,{$gap:16,$alignItems:"center",$width:"100%",children:[e(Qd,{children:[t(re,{size:ce.M,weight:500,color:i.v2.colors.white[500],children:Qo}),t(Gd,{children:en})]}),e(Md,{children:[t(re,{size:ce.XS,color:i.v2.colors.silver[200],children:tn}),t(Vd,{items:[{title:nn,description:on},{title:ln,description:an},{title:rn,description:sn}]}),t(Ud,{message:cn})]})]})]}),e(Fd,{center:!0,children:[t(oe,{"data-id":"sampling-onboarding-btn-skip",label:dn,variant:ae.Secondary,onClick:n}),t(oe,{"data-id":"sampling-onboarding-btn-start",label:un,rightIcon:Zd,variant:ae.Primary,onClick:a})]})]})},tu=g.div`
373
373
  display: flex;
374
374
  align-items: stretch;
375
375
  gap: 16px;
@@ -431,13 +431,13 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
431
431
  height: 24px;
432
432
  border-radius: 6px;
433
433
  background-color: ${({theme:e})=>e.v2.colors.yellow[900]};
434
- `,cu=({selected:o,onSelect:n,name:a,description:i,badgeProps:l,bullets:s,warning:r,onReadMore:c})=>{const d=f(),u=o?d.v2.colors.white[500]:d.v2.colors.silver[200];return e(ou,{$selected:o,onClick:n,children:[e(nu,{children:[t(Nn,{"data-id":`sampling-onboarding-radio-${a}`,value:o,onChange:n,size:En.L}),t(zi,{size:24,fill:d.v2.colors.white[500]}),t(re,{size:ce.S,weight:500,color:d.v2.colors.white[500],children:a})]}),e(au,{children:[e(iu,{$selected:o,children:[e(V,{$gap:8,children:[t(Ee,{...l,textSize:ce.XXXS}),t(re,{size:ce.XXS,color:u,children:i})]}),s&&s.length>0&&t(Xd,{color:u,items:s}),r&&e(su,{children:[t(ru,{children:t(Bi,{size:18,fill:d.v2.colors.yellow[500]})}),t(re,{size:ce.XXXS,color:d.v2.colors.yellow[500],children:r})]})]}),c&&t(lu,{children:t(oe,{"data-id":`sampling-onboarding-btn-read-more-${a}`,label:An,rightIcon:ii,variant:ae.Text,size:ne.S,onClick:e=>{e.stopPropagation(),c()}})})]})]})},du=({strategy:n,onStrategyChange:a,onBack:i,onNext:l,docsUrl:s})=>{const r=f(),c=s?()=>window.open(s,"_blank"):void 0;return e(o,{children:[t(Ld,{title:pn,onBack:i}),e(Dd,{$width:854,children:[t(Gd,{children:hn}),e(tu,{children:[t(cu,{selected:"keep-list"===n,onSelect:()=>a("keep-list"),name:yn,description:vn,badgeProps:{label:bn,backgroundColor:r.v2.colors.purple[500],textColor:r.v2.colors.white[500]},bullets:[gn,fn],warning:mn,onReadMore:c}),t(cu,{selected:"drop-list"===n,onSelect:()=>a("drop-list"),name:kn,description:xn,badgeProps:{label:wn,backgroundColor:r.v2.colors.green[500],textColor:r.v2.colors.black[500]},bullets:[Cn,Sn],onReadMore:c}),t(cu,{selected:"advanced"===n,onSelect:()=>a("advanced"),name:In,description:$n,badgeProps:{label:Tn,backgroundColor:r.v2.colors.blue[700],textColor:r.v2.colors.white[500]},onReadMore:c})]})]}),t(Fd,{onNext:l})]})},uu=({onBack:n,onNext:a,submitting:i})=>{const l=f(),s=r(()=>[{title:Fn,bullets:[On,Dn,Rn]},{title:Bn,bullets:[Pn,Ln,_n,Mn,zn]}],[]);return e(o,{children:[t(Ld,{title:Xn,onBack:n}),e(Dd,{$width:854,children:[t(Gd,{children:Vn}),t(te,{$gap:16,$width:"100%",$alignItems:"stretch",children:s.map((o,n)=>e(Md,{fillHeight:!0,width:"50%",children:[t(re,{size:ce.XS,color:l.v2.colors.white[500],children:o.title}),t(Xd,{items:o.bullets})]},n))}),t(Ud,{message:Un})]}),t(Fd,{onNext:a,nextLoading:i})]})},pu=g.div`
434
+ `,cu=({selected:o,onSelect:n,name:a,description:i,badgeProps:l,bullets:s,warning:r,onReadMore:c})=>{const d=f(),u=o?d.v2.colors.white[500]:d.v2.colors.silver[200];return e(ou,{$selected:o,onClick:n,children:[e(nu,{children:[t(Nn,{"data-id":`sampling-onboarding-radio-${a}`,value:o,onChange:n,size:En.L}),t(Bi,{size:24,fill:d.v2.colors.white[500]}),t(re,{size:ce.S,weight:500,color:d.v2.colors.white[500],children:a})]}),e(au,{children:[e(iu,{$selected:o,children:[e(V,{$gap:8,children:[t(Ee,{...l,textSize:ce.XXXS}),t(re,{size:ce.XXS,color:u,children:i})]}),s&&s.length>0&&t(Xd,{color:u,items:s}),r&&e(su,{children:[t(ru,{children:t(zi,{size:18,fill:d.v2.colors.yellow[500]})}),t(re,{size:ce.XXXS,color:d.v2.colors.yellow[500],children:r})]})]}),c&&t(lu,{children:t(oe,{"data-id":`sampling-onboarding-btn-read-more-${a}`,label:An,rightIcon:ii,variant:ae.Text,size:ne.S,onClick:e=>{e.stopPropagation(),c()}})})]})]})},du=({strategy:n,onStrategyChange:a,onBack:i,onNext:l,docsUrl:s})=>{const r=f(),c=s?()=>window.open(s,"_blank"):void 0;return e(o,{children:[t(Ld,{title:pn,onBack:i}),e(Dd,{$width:854,children:[t(Gd,{children:hn}),e(tu,{children:[t(cu,{selected:"keep-list"===n,onSelect:()=>a("keep-list"),name:yn,description:vn,badgeProps:{label:bn,backgroundColor:r.v2.colors.purple[500],textColor:r.v2.colors.white[500]},bullets:[gn,fn],warning:mn,onReadMore:c}),t(cu,{selected:"drop-list"===n,onSelect:()=>a("drop-list"),name:kn,description:xn,badgeProps:{label:wn,backgroundColor:r.v2.colors.green[500],textColor:r.v2.colors.black[500]},bullets:[Cn,Sn],onReadMore:c}),t(cu,{selected:"advanced"===n,onSelect:()=>a("advanced"),name:In,description:$n,badgeProps:{label:Tn,backgroundColor:r.v2.colors.blue[700],textColor:r.v2.colors.white[500]},onReadMore:c})]})]}),t(Fd,{onNext:l})]})},uu=({onBack:n,onNext:a,submitting:i})=>{const l=f(),s=r(()=>[{title:Fn,bullets:[On,Dn,Rn]},{title:zn,bullets:[Pn,Ln,_n,Mn,Bn]}],[]);return e(o,{children:[t(Ld,{title:Xn,onBack:n}),e(Dd,{$width:854,children:[t(Gd,{children:Vn}),t(te,{$gap:16,$width:"100%",$alignItems:"stretch",children:s.map((o,n)=>e(Md,{fillHeight:!0,width:"50%",children:[t(re,{size:ce.XS,color:l.v2.colors.white[500],children:o.title}),t(Xd,{items:o.bullets})]},n))}),t(Ud,{message:Un})]}),t(Fd,{onNext:a,nextLoading:i})]})},pu=g.div`
435
435
  white-space: pre-line;
436
436
  `,hu=({errorPresetEnabled:n,onErrorPresetChange:a,onBack:i,onNext:l,submitting:s})=>{const c=f(),d=r(()=>x(n?{disabled:!1}:null),[n]);return e(o,{children:[t(Ld,{title:Hn,onBack:i}),e(Dd,{$width:854,children:[t(Gd,{children:jn}),e(V,{$gap:8,$width:"100%",children:[e(Md,{children:[t(pu,{children:t(re,{size:ce.XXS,color:c.v2.colors.silver[200],children:Wn})}),t(Ud,{message:Un})]}),e(Hd,{children:[e(jd,{children:[t(re,{size:ce.S,weight:500,color:c.v2.colors.white[500],children:Gn}),t(Ni,{size:16,fill:c.v2.colors.silver[200]})]}),t(Wd,{children:t(Nd,{name:Yn,recommended:!0,toggleLabel:Kn,enabled:n,onEnabledChange:a,summary:d,toggleName:"sampling-onboarding-drop-error-preset-toggle"})})]})]})]}),t(Fd,{onNext:l,nextLoading:s})]})},mu=g.div`
437
437
  white-space: pre-line;
438
438
  `,gu=g.div`
439
439
  width: fit-content;
440
- `,fu=["50","25","10","1","0.1"],bu=({value:o,onChange:n,label:a})=>{const i=f(),l=r(()=>fu.map(e=>({value:e,label:`${e}%`,selectedBgColor:i.v2.colors.purple[900],selectedBorderColor:i.v2.colors.purple[400]})),[i]);return e(V,{$gap:8,children:[t(re,{size:ce.XS,color:i.v2.colors.white[500],children:a}),t(gu,{children:t(ue,{"data-id":"sampling-onboarding-ambient",options:l,selected:o,setSelected:n})})]})},vu=({errorPresetEnabled:n,onErrorPresetChange:a,ambientPercentage:i,onAmbientPercentageChange:l,onBack:s,onNext:c,submitting:d})=>{const u=f(),p=r(()=>x(n?{disabled:!1}:null),[n]);return e(o,{children:[t(Ld,{title:Jn,onBack:s}),e(Dd,{$width:854,children:[t(Gd,{children:qn}),e(V,{$gap:8,$width:"100%",children:[e(Md,{children:[t(mu,{children:t(re,{size:ce.XXS,color:u.v2.colors.silver[200],children:Zn})}),t(Xd,{items:[Qn,ea,ta,oa,na]}),t(Ud,{message:Un})]}),e(Hd,{children:[e(jd,{children:[t(re,{size:ce.S,weight:500,color:u.v2.colors.white[500],children:aa}),t(Ni,{size:16,fill:u.v2.colors.silver[200]})]}),t(Wd,{children:t(Nd,{name:Yn,recommended:!0,toggleLabel:Kn,enabled:n,onEnabledChange:a,summary:p,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(Wd,{children:t(bu,{value:i,onChange:l,label:ia})})]})]})]}),t(Fd,{onNext:c,nextLoading:d})]})},yu=({isOpen:e,onClose:o,k8sHealthProbesConfig:a,samplingId:i,docsUrl:s,updateK8sHealthProbesConfig:r,createHighlyRelevantOperationRule:d,createCostReductionRule:u})=>{const[p,h]=l("welcome"),[m,g]=l(!0),[f,b]=l("keep-list"),[v,y]=l(!0),[C,S]=l("25"),[w,x]=l(!1);n(()=>{e&&(h("welcome"),g(a?.enabled??!0),b("keep-list"),y(!0),S("25"),x(!1))},[e,a?.enabled]);const k=c(async()=>{const e=i??"default",t=[];m!==(a?.enabled??!1)&&t.push(r(m,a?.keepPercentage??0)),"advanced"!==f&&v&&t.push(d(e,{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null})),"keep-list"===f&&t.push(u(e,{name:"Onboarding - Ambient sampling",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:parseFloat(C)})),x(!0);try{await Promise.all(t),h("success")}catch{}finally{x(!1)}},[i,r,m,a?.enabled,a?.keepPercentage,f,v,C,d,u]);let T=null;switch(p){case"welcome":T=t(eu,{onSkip:o,onNext:()=>h("noisy")});break;case"noisy":T=t(Yd,{enabled:m,onEnabledChange:g,onBack:()=>h("welcome"),onNext:()=>h("strategy")});break;case"strategy":T=t(du,{strategy:f,onStrategyChange:b,onBack:()=>h("noisy"),onNext:()=>{h("keep-list"===f?"keep-list":"drop-list"===f?"drop-list":"advanced")},docsUrl:s});break;case"keep-list":T=t(vu,{errorPresetEnabled:v,onErrorPresetChange:y,ambientPercentage:C,onAmbientPercentageChange:S,onBack:()=>h("strategy"),onNext:k,submitting:w});break;case"drop-list":T=t(hu,{errorPresetEnabled:v,onErrorPresetChange:y,onBack:()=>h("strategy"),onNext:k,submitting:w});break;case"advanced":T=t(uu,{onBack:()=>h("strategy"),onNext:k,submitting:w});break;case"success":T=t(qd,{onClose:o})}return t(Po,{isOpen:e,onClose:o,children:T})};var Cu,Su;!function(e){e.BulkConfig="bulk-config",e.BulkSource="bulk-source",e.BulkDestination="bulk-destination",e.BulkAction="bulk-action",e.BulkInstrumentationRule="bulk-instrumentation-rule",e.Delete="delete"}(Cu||(Cu={})),function(e){e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"}(Su||(Su={}));const wu=[{key:Su.Name,label:"Name"},{key:Su.Type,label:"Type",textAlign:"right"},{key:Su.Status,label:"Status"},{key:Su.OdigosVersion,label:"Odigos Version"},{key:Su.ConnectedSince,label:"Connected Since"},{key:Su.LastActivity,label:"Last Activity"}],xu=(e,t)=>{const o=e.find(e=>e.key===Su.Id)?.rawValue;return t(o?.toString()||"")},ku=e=>{const{connections:t,configMinSupportedVersion:o,snapshotMinSupportedVersion:n,onDelete:a,onAddSource:i,onAddDestination:l,onAddAction:s,onAddInstrumentationRule:r,onEditConfiguration:c}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===Su.Status)?.rawValue===ge.Success)(e))return[{id:Ro(),label:"Delete Connection",rightIcon:ri,onClick:()=>xu(e,a)}];const d=xu(e,e=>{const n=t.find(t=>t.id===e);return!!n&&k(n.odigosVersion,o)}),u=xu(e,e=>{const o=t.find(t=>t.id===e);return!!o&&k(o.odigosVersion,n)}),p=[];return i&&p.push({id:Ro(),tooltip:u?Re.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${n} or later.`,rightIcon:Ci,disabled:!u,onClick:()=>xu(e,i)}),l&&p.push({id:Ro(),tooltip:Re.ADD_DESTINATION,rightIcon:mi,onClick:()=>xu(e,l)}),s&&p.push({id:Ro(),tooltip:Re.ADD_ACTION,rightIcon:hi,onClick:()=>xu(e,s)}),r&&p.push({id:Ro(),tooltip:Re.ADD_INSTRUMENTATION_RULE,rightIcon:yi,onClick:()=>xu(e,r)}),c&&p.push({id:Ro(),tooltip:d?"Edit Configuration":`To use this feature, please upgrade to Odigos v${o} or later.`,rightIcon:wi,disabled:!d,onClick:()=>xu(e,c)}),p}},Tu=({tableRowsMaxHeight:o,connections:a,getConnections:i,onClickConnection:s,deleteConnection:d,configMinSupportedVersion:u=0,getEffectiveConfig:p,applyConfigurations:h,snapshotMinSupportedVersion:m=0,getAllClusterSnapshots:g,persistSources:b,getDestinationCategories:v,getPotentialDestinations:C,testConnection:S,createDestination:w,updateDestination:x,createAction:T,createInstrumentationRule:$})=>{const I=f(),{isVm:N}=y(),{formatTimeAgo:E}=Ot(),[A,O]=l(!1),[D,R]=l(a||[]),F=c(async()=>{try{O(!0),R(await i()??[])}catch(e){}finally{O(!1)}},[]);n(()=>{D.length||F()},[]);const[P,L]=l(""),[_,M]=l(null),[z,B]=l([]),X=r(()=>_===Cu.BulkConfig?u:_===Cu.BulkSource?m:0,[_,u,m]),{supportedConnections:V,supportedConnectionIds:U}=r(()=>{const e=((e,t)=>e.filter(e=>{const o=e.status===ge.Success,n=k(e.odigosVersion,t);return o&&n}))(D,X);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[D.length,X]);n(()=>{if(!_||_===Cu.Delete)return;const e=z.filter(e=>!U.includes(e));e.length&&B(t=>t.filter(t=>!e.includes(t)))},[_,z.length,U.length]);const H=r(()=>D.filter(e=>!P||e.name.toLowerCase().includes(P.toLowerCase())).map(e=>({cells:[{key:Su.Id,rawValue:e.id},{key:Su.Name,rawValue:e.name},{key:Su.Type,rawValue:e.type},{key:Su.Status,rawValue:e.status,component:()=>(e=>{const o=e===ge.Success?"Connection live":"Connection lost",n=e===ge.Success?bi:vi;return t(Ee,{status:e,label:o,leftIcon:n})})(e.status)},{key:Su.OdigosVersion,rawValue:e.odigosVersion},{key:Su.ConnectedSince,rawValue:e.connectedAt?E(e.connectedAt):"-"},{key:Su.LastActivity,rawValue:e.lastSeenAt?E(e.lastSeenAt):"-"}],onClick:e.status!==ge.Success||_?void 0:()=>s(e),isSelected:z.includes(e.id),onSelect:()=>B(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>B(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==ge.Success||_===Cu.BulkConfig&&!k(e.odigosVersion,u)||_===Cu.BulkSource&&!k(e.odigosVersion,m)})),[D,z,P,_,u,m]),j=r(()=>{const e=(e,t)=>{B([e]),M(t)};return ku({connections:D,configMinSupportedVersion:u,snapshotMinSupportedVersion:m,onDelete:t=>e(t,Cu.Delete),onAddSource:!N&&g&&b?t=>e(t,Cu.BulkSource):void 0,onAddDestination:!N&&v&&C&&w?t=>e(t,Cu.BulkDestination):void 0,onAddAction:!N&&T?t=>e(t,Cu.BulkAction):void 0,onAddInstrumentationRule:!N&&$?t=>e(t,Cu.BulkInstrumentationRule):void 0,onEditConfiguration:!N&&p&&h?t=>e(t,Cu.BulkConfig):void 0})},[N,D,u,p,h,m,g,b,v,C,w,T,$]),W=r(()=>(e=>{const{onCancel:t,onAddSource:o,onAddDestination:n,onAddAction:a,onAddInstrumentationRule:i,onManageConfigurations:l}=e,s=[];o&&s.push({id:Ro(),type:Xt.Button,buttonProps:{variant:ae.Primary,size:ne.S,label:"Add Sources",rightIcon:Ci,onClick:o}});const r=[n?{id:Cu.BulkDestination,label:Re.ADD_DESTINATION,icon:mi}:null,a?{id:Cu.BulkAction,label:Re.ADD_ACTION,icon:hi}:null,i?{id:Cu.BulkInstrumentationRule,label:Re.ADD_INSTRUMENTATION_RULE,icon:yi}:null,l?{id:Cu.BulkConfig,label:"Manage Configurations",icon:wi}:null];return r.some(Boolean)&&s.push({id:Ro(),type:Xt.ButtonDropData,buttonProps:{variant:ae.Secondary,size:ne.S,label:"Bulk Operations",onClick:e=>{e===Cu.BulkSource?o?.():e===Cu.BulkDestination?n?.():e===Cu.BulkAction?a?.():e===Cu.BulkInstrumentationRule?i?.():e===Cu.BulkConfig&&l?.()}},dropDataProps:{alignX:Do.Left,items:r}}),s.push({id:Ro(),type:Xt.Button,buttonProps:{variant:ae.Text,size:ne.S,label:bt.CANCEL,onClick:t}}),s})({onCancel:()=>B([]),onAddSource:!N&&g&&b?()=>M(Cu.BulkSource):void 0,onAddDestination:!N&&v&&C&&w?()=>M(Cu.BulkDestination):void 0,onAddAction:!N&&T?()=>M(Cu.BulkAction):void 0,onAddInstrumentationRule:!N&&$?()=>M(Cu.BulkInstrumentationRule):void 0,onManageConfigurations:!N&&p&&h?()=>M(Cu.BulkConfig):void 0}),[N,p,h,g,b,v,C,w,T,$]);return t(la,{children:e(Ue,{richTitle:{icon:Gi,title:Re.CONNECTIONS,badge:{label:D.length.toString(),status:st.Unknown}},search:{placeholder:"Search by cluster name",value:P,onChange:e=>L(e),width:"300px"},actions:[{id:Ro(),type:Xt.Button,buttonProps:{variant:ae.Secondary,size:ne.S,leftIcon:$i,onClick:F,disabled:A}}],children:[t(lo,{variant:so.Pretty,maxHeight:o,headerBackgroundColor:I.v2.colors.silver[1e3],isLoading:A,withCheckboxes:!0,columns:wu,rows:H,rowActionsPushRightPosition:_?`calc(${vl} - 24px)`:void 0,getRowActions:j}),_===Cu.BulkConfig&&p&&h&&t(ir,{onClose:()=>M(null),connections:V,selectedConnectionIds:z,setSelectedConnectionIds:B,getEffectiveConfig:p,onApply:h}),_===Cu.BulkSource&&g&&b&&t(Rl,{selectedConnectionIds:z,children:t(nr,{onClose:()=>M(null),selectedConnectionIds:z,setSelectedConnectionIds:B,getAllClusterSnapshots:g,persistSources:async e=>await(b?.(e))})}),_===Cu.BulkDestination&&v&&C&&S&&w&&x&&t(Fl,{children:t(Ls,{onClose:()=>M(null),selectedConnectionIds:z,setSelectedConnectionIds:B,getDestinationCategories:v,getPotentialDestinations:C,testConnection:e=>S(e,z),createDestination:e=>w(e,z),updateDestination:(e,t)=>x(e,t,z)})}),_===Cu.BulkAction&&T&&t(Pl,{children:t($s,{onClose:()=>M(null),selectedConnectionIds:z,setSelectedConnectionIds:B,createAction:e=>T(e,z)})}),_===Cu.BulkInstrumentationRule&&$&&t(Ll,{children:t(_s,{onClose:()=>M(null),selectedConnectionIds:z,setSelectedConnectionIds:B,createInstrumentationRule:e=>$(e,z)})}),t(ml,{target:"connection",isOpen:_===Cu.Delete,onClose:()=>{B([]),M(null)},onApprove:async()=>{const e=z[0];e&&(await d(e),await F())}}),t(sa,{isOpen:!!z.length&&!_,richTitle:{icon:li,title:"Selected Clusters",badge:{label:z.length}},actions:W})]})})},$u=g.div`
440
+ `,fu=["50","25","10","1","0.1"],bu=({value:o,onChange:n,label:a})=>{const i=f(),l=r(()=>fu.map(e=>({value:e,label:`${e}%`,selectedBgColor:i.v2.colors.purple[900],selectedBorderColor:i.v2.colors.purple[400]})),[i]);return e(V,{$gap:8,children:[t(re,{size:ce.XS,color:i.v2.colors.white[500],children:a}),t(gu,{children:t(ue,{"data-id":"sampling-onboarding-ambient",options:l,selected:o,setSelected:n})})]})},vu=({errorPresetEnabled:n,onErrorPresetChange:a,ambientPercentage:i,onAmbientPercentageChange:l,onBack:s,onNext:c,submitting:d})=>{const u=f(),p=r(()=>x(n?{disabled:!1}:null),[n]);return e(o,{children:[t(Ld,{title:Jn,onBack:s}),e(Dd,{$width:854,children:[t(Gd,{children:qn}),e(V,{$gap:8,$width:"100%",children:[e(Md,{children:[t(mu,{children:t(re,{size:ce.XXS,color:u.v2.colors.silver[200],children:Zn})}),t(Xd,{items:[Qn,ea,ta,oa,na]}),t(Ud,{message:Un})]}),e(Hd,{children:[e(jd,{children:[t(re,{size:ce.S,weight:500,color:u.v2.colors.white[500],children:aa}),t(Ni,{size:16,fill:u.v2.colors.silver[200]})]}),t(Wd,{children:t(Nd,{name:Yn,recommended:!0,toggleLabel:Kn,enabled:n,onEnabledChange:a,summary:p,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(Wd,{children:t(bu,{value:i,onChange:l,label:ia})})]})]})]}),t(Fd,{onNext:c,nextLoading:d})]})},yu=({isOpen:e,onClose:o,k8sHealthProbesConfig:a,samplingId:i,docsUrl:s,updateK8sHealthProbesConfig:r,createHighlyRelevantOperationRule:d,createCostReductionRule:u})=>{const[p,h]=l("welcome"),[m,g]=l(!0),[f,b]=l("keep-list"),[v,y]=l(!0),[C,S]=l("25"),[w,x]=l(!1);n(()=>{e&&(h("welcome"),g(a?.enabled??!0),b("keep-list"),y(!0),S("25"),x(!1))},[e,a?.enabled]);const k=c(async()=>{const e=i??"default",t=[];m!==(a?.enabled??!1)&&t.push(r(m,a?.keepPercentage??0)),"advanced"!==f&&v&&t.push(d(e,{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null})),"keep-list"===f&&t.push(u(e,{name:"Onboarding - Ambient sampling",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:parseFloat(C)})),x(!0);try{await Promise.all(t),h("success")}catch{}finally{x(!1)}},[i,r,m,a?.enabled,a?.keepPercentage,f,v,C,d,u]);let T=null;switch(p){case"welcome":T=t(eu,{onSkip:o,onNext:()=>h("noisy")});break;case"noisy":T=t(Yd,{enabled:m,onEnabledChange:g,onBack:()=>h("welcome"),onNext:()=>h("strategy")});break;case"strategy":T=t(du,{strategy:f,onStrategyChange:b,onBack:()=>h("noisy"),onNext:()=>{h("keep-list"===f?"keep-list":"drop-list"===f?"drop-list":"advanced")},docsUrl:s});break;case"keep-list":T=t(vu,{errorPresetEnabled:v,onErrorPresetChange:y,ambientPercentage:C,onAmbientPercentageChange:S,onBack:()=>h("strategy"),onNext:k,submitting:w});break;case"drop-list":T=t(hu,{errorPresetEnabled:v,onErrorPresetChange:y,onBack:()=>h("strategy"),onNext:k,submitting:w});break;case"advanced":T=t(uu,{onBack:()=>h("strategy"),onNext:k,submitting:w});break;case"success":T=t(qd,{onClose:o})}return t(Po,{isOpen:e,onClose:o,children:T})};var Cu,Su;!function(e){e.BulkConfig="bulk-config",e.BulkSource="bulk-source",e.BulkDestination="bulk-destination",e.BulkAction="bulk-action",e.BulkInstrumentationRule="bulk-instrumentation-rule",e.Delete="delete"}(Cu||(Cu={})),function(e){e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"}(Su||(Su={}));const wu=[{key:Su.Name,label:"Name"},{key:Su.Type,label:"Type",textAlign:"right"},{key:Su.Status,label:"Status"},{key:Su.OdigosVersion,label:"Odigos Version"},{key:Su.ConnectedSince,label:"Connected Since"},{key:Su.LastActivity,label:"Last Activity"}],xu=(e,t)=>{const o=e.find(e=>e.key===Su.Id)?.rawValue;return t(o?.toString()||"")},ku=e=>{const{connections:t,configMinSupportedVersion:o,snapshotMinSupportedVersion:n,onDelete:a,onAddSource:i,onAddDestination:l,onAddAction:s,onAddInstrumentationRule:r,onEditConfiguration:c}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===Su.Status)?.rawValue===ge.Success)(e))return[{id:Ro(),label:"Delete Connection",rightIcon:ri,onClick:()=>xu(e,a)}];const d=xu(e,e=>{const n=t.find(t=>t.id===e);return!!n&&k(n.odigosVersion,o)}),u=xu(e,e=>{const o=t.find(t=>t.id===e);return!!o&&k(o.odigosVersion,n)}),p=[];return i&&p.push({id:Ro(),tooltip:u?Re.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${n} or later.`,rightIcon:Ci,disabled:!u,onClick:()=>xu(e,i)}),l&&p.push({id:Ro(),tooltip:Re.ADD_DESTINATION,rightIcon:mi,onClick:()=>xu(e,l)}),s&&p.push({id:Ro(),tooltip:Re.ADD_ACTION,rightIcon:hi,onClick:()=>xu(e,s)}),r&&p.push({id:Ro(),tooltip:Re.ADD_INSTRUMENTATION_RULE,rightIcon:yi,onClick:()=>xu(e,r)}),c&&p.push({id:Ro(),tooltip:d?"Edit Configuration":`To use this feature, please upgrade to Odigos v${o} or later.`,rightIcon:wi,disabled:!d,onClick:()=>xu(e,c)}),p}},Tu=({tableRowsMaxHeight:o,connections:a,getConnections:i,onClickConnection:s,deleteConnection:d,configMinSupportedVersion:u=0,getEffectiveConfig:p,applyConfigurations:h,snapshotMinSupportedVersion:m=0,getAllClusterSnapshots:g,persistSources:b,getDestinationCategories:v,getPotentialDestinations:C,testConnection:S,createDestination:w,updateDestination:x,createAction:T,createInstrumentationRule:$})=>{const I=f(),{isVm:N}=y(),{formatTimeAgo:E}=Ot(),[A,O]=l(!1),[D,R]=l(a||[]),F=c(async()=>{try{O(!0),R(await i()??[])}catch(e){}finally{O(!1)}},[]);n(()=>{D.length||F()},[]);const[P,L]=l(""),[_,M]=l(null),[B,z]=l([]),X=r(()=>_===Cu.BulkConfig?u:_===Cu.BulkSource?m:0,[_,u,m]),{supportedConnections:V,supportedConnectionIds:U}=r(()=>{const e=((e,t)=>e.filter(e=>{const o=e.status===ge.Success,n=k(e.odigosVersion,t);return o&&n}))(D,X);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[D.length,X]);n(()=>{if(!_||_===Cu.Delete)return;const e=B.filter(e=>!U.includes(e));e.length&&z(t=>t.filter(t=>!e.includes(t)))},[_,B.length,U.length]);const H=r(()=>D.filter(e=>!P||e.name.toLowerCase().includes(P.toLowerCase())).map(e=>({cells:[{key:Su.Id,rawValue:e.id},{key:Su.Name,rawValue:e.name},{key:Su.Type,rawValue:e.type},{key:Su.Status,rawValue:e.status,component:()=>(e=>{const o=e===ge.Success?"Connection live":"Connection lost",n=e===ge.Success?bi:vi;return t(Ee,{status:e,label:o,leftIcon:n})})(e.status)},{key:Su.OdigosVersion,rawValue:e.odigosVersion},{key:Su.ConnectedSince,rawValue:e.connectedAt?E(e.connectedAt):"-"},{key:Su.LastActivity,rawValue:e.lastSeenAt?E(e.lastSeenAt):"-"}],onClick:e.status!==ge.Success||_?void 0:()=>s(e),isSelected:B.includes(e.id),onSelect:()=>z(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>z(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==ge.Success||_===Cu.BulkConfig&&!k(e.odigosVersion,u)||_===Cu.BulkSource&&!k(e.odigosVersion,m)})),[D,B,P,_,u,m]),j=r(()=>{const e=(e,t)=>{z([e]),M(t)};return ku({connections:D,configMinSupportedVersion:u,snapshotMinSupportedVersion:m,onDelete:t=>e(t,Cu.Delete),onAddSource:!N&&g&&b?t=>e(t,Cu.BulkSource):void 0,onAddDestination:!N&&v&&C&&w?t=>e(t,Cu.BulkDestination):void 0,onAddAction:!N&&T?t=>e(t,Cu.BulkAction):void 0,onAddInstrumentationRule:!N&&$?t=>e(t,Cu.BulkInstrumentationRule):void 0,onEditConfiguration:!N&&p&&h?t=>e(t,Cu.BulkConfig):void 0})},[N,D,u,p,h,m,g,b,v,C,w,T,$]),W=r(()=>(e=>{const{onCancel:t,onAddSource:o,onAddDestination:n,onAddAction:a,onAddInstrumentationRule:i,onManageConfigurations:l}=e,s=[];o&&s.push({id:Ro(),type:Xt.Button,buttonProps:{variant:ae.Primary,size:ne.S,label:"Add Sources",rightIcon:Ci,onClick:o}});const r=[n?{id:Cu.BulkDestination,label:Re.ADD_DESTINATION,icon:mi}:null,a?{id:Cu.BulkAction,label:Re.ADD_ACTION,icon:hi}:null,i?{id:Cu.BulkInstrumentationRule,label:Re.ADD_INSTRUMENTATION_RULE,icon:yi}:null,l?{id:Cu.BulkConfig,label:"Manage Configurations",icon:wi}:null];return r.some(Boolean)&&s.push({id:Ro(),type:Xt.ButtonDropData,buttonProps:{variant:ae.Secondary,size:ne.S,label:"Bulk Operations",onClick:e=>{e===Cu.BulkSource?o?.():e===Cu.BulkDestination?n?.():e===Cu.BulkAction?a?.():e===Cu.BulkInstrumentationRule?i?.():e===Cu.BulkConfig&&l?.()}},dropDataProps:{alignX:Do.Left,items:r}}),s.push({id:Ro(),type:Xt.Button,buttonProps:{variant:ae.Text,size:ne.S,label:bt.CANCEL,onClick:t}}),s})({onCancel:()=>z([]),onAddSource:!N&&g&&b?()=>M(Cu.BulkSource):void 0,onAddDestination:!N&&v&&C&&w?()=>M(Cu.BulkDestination):void 0,onAddAction:!N&&T?()=>M(Cu.BulkAction):void 0,onAddInstrumentationRule:!N&&$?()=>M(Cu.BulkInstrumentationRule):void 0,onManageConfigurations:!N&&p&&h?()=>M(Cu.BulkConfig):void 0}),[N,p,h,g,b,v,C,w,T,$]);return t(la,{children:e(Ue,{richTitle:{icon:Gi,title:Re.CONNECTIONS,badge:{label:D.length.toString(),status:st.Unknown}},search:{placeholder:"Search by cluster name",value:P,onChange:e=>L(e),width:"300px"},actions:[{id:Ro(),type:Xt.Button,buttonProps:{variant:ae.Secondary,size:ne.S,leftIcon:$i,onClick:F,disabled:A}}],children:[t(lo,{variant:so.Pretty,maxHeight:o,headerBackgroundColor:I.v2.colors.silver[1e3],isLoading:A,withCheckboxes:!0,columns:wu,rows:H,rowActionsPushRightPosition:_?`calc(${vl} - 24px)`:void 0,getRowActions:j}),_===Cu.BulkConfig&&p&&h&&t(ir,{onClose:()=>M(null),connections:V,selectedConnectionIds:B,setSelectedConnectionIds:z,getEffectiveConfig:p,onApply:h}),_===Cu.BulkSource&&g&&b&&t(Rl,{selectedConnectionIds:B,children:t(nr,{onClose:()=>M(null),selectedConnectionIds:B,setSelectedConnectionIds:z,getAllClusterSnapshots:g,persistSources:async e=>await(b?.(e))})}),_===Cu.BulkDestination&&v&&C&&S&&w&&x&&t(Fl,{children:t(Ls,{onClose:()=>M(null),selectedConnectionIds:B,setSelectedConnectionIds:z,getDestinationCategories:v,getPotentialDestinations:C,testConnection:e=>S(e,B),createDestination:e=>w(e,B),updateDestination:(e,t)=>x(e,t,B)})}),_===Cu.BulkAction&&T&&t(Pl,{children:t($s,{onClose:()=>M(null),selectedConnectionIds:B,setSelectedConnectionIds:z,createAction:e=>T(e,B)})}),_===Cu.BulkInstrumentationRule&&$&&t(Ll,{children:t(_s,{onClose:()=>M(null),selectedConnectionIds:B,setSelectedConnectionIds:z,createInstrumentationRule:e=>$(e,B)})}),t(ml,{target:"connection",isOpen:_===Cu.Delete,onClose:()=>{z([]),M(null)},onApprove:async()=>{const e=B[0];e&&(await d(e),await F())}}),t(sa,{isOpen:!!B.length&&!_,richTitle:{icon:li,title:"Selected Clusters",badge:{label:B.length}},actions:W})]})})},$u=g.div`
441
441
  display: flex;
442
442
  align-items: center;
443
443
  justify-content: space-between;
@@ -491,7 +491,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
491
491
  flex-direction: column;
492
492
  gap: 32px;
493
493
  padding: 64px;
494
- `,zu=({pagePaddingXAxis:o,pagePaddingYAxis:n,fetchNamespacesWithWorkloads:a,persistSources:i,getDestinationCategories:s,getPotentialDestinations:r,testConnection:c,createDestination:d,updateDestination:u,onDone:p})=>{const{setCurrentModal:h}=Fo(),[m,g]=l(1),[f,b]=l(!1),[v,y]=l(null),[C,S]=l(null),w=()=>g(e=>e+1),x=()=>g(e=>e-1);return e(Ru,{paddingXAxis:o,paddingYAxis:n,children:[e(Mu,{children:[t(bl,{useInline:!0}),t(ra,{currentStep:m,data:_u,gap:32})]}),t(Rl,{initialInputs:v,children:e(Fl,{children:[1===m&&t(Lu,{onStart:w}),2===m&&t(nr,{disableAnimation:!0,onBack:e=>{y(e),x()},onNext:e=>{y(e),w()},fetchNamespacesWithWorkloads:a,persistSources:i}),3===m&&t(Ls,{disableAnimation:!0,onBack:e=>{S(e),x()},onNext:e=>{S(e),w()},getDestinationCategories:s,getPotentialDestinations:r,initialInputs:C,testConnection:c,createDestination:d,updateDestination:u}),4===m&&t(Nu,{disableAnimation:!0,setStep:g,onSave:async()=>{if(!f){b(!0);try{const e=[];v&&e.push(i(v)),C&&e.push(...C.map(e=>d(e.formData)));const t=await Promise.allSettled(e),o=[];for(const e of t)"rejected"===e.status?o.push(e.reason?.message||String(e.reason)):e.value?.error&&o.push(e.value.error);if(o.length)return{error:o.join("\n")};h(kd),p()}catch(e){return b(!1),{error:e instanceof Error?e.message:String(e)}}}},sourcesPayload:v,destinationsPayload:C})]})})]})},Bu=e=>(e||[]).filter(e=>!!e.id).map(e=>String(e.id)),Xu=e=>{let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)&&(t+=e.length)}),e.onlyErrors&&t++,t},Vu=g.div`
494
+ `,Bu=({pagePaddingXAxis:o,pagePaddingYAxis:n,fetchNamespacesWithWorkloads:a,persistSources:i,getDestinationCategories:s,getPotentialDestinations:r,testConnection:c,createDestination:d,updateDestination:u,onDone:p})=>{const{setCurrentModal:h}=Fo(),[m,g]=l(1),[f,b]=l(!1),[v,y]=l(null),[C,S]=l(null),w=()=>g(e=>e+1),x=()=>g(e=>e-1);return e(Ru,{paddingXAxis:o,paddingYAxis:n,children:[e(Mu,{children:[t(bl,{useInline:!0}),t(ra,{currentStep:m,data:_u,gap:32})]}),t(Rl,{initialInputs:v,children:e(Fl,{children:[1===m&&t(Lu,{onStart:w}),2===m&&t(nr,{disableAnimation:!0,onBack:e=>{y(e),x()},onNext:e=>{y(e),w()},fetchNamespacesWithWorkloads:a,persistSources:i}),3===m&&t(Ls,{disableAnimation:!0,onBack:e=>{S(e),x()},onNext:e=>{S(e),w()},getDestinationCategories:s,getPotentialDestinations:r,initialInputs:C,testConnection:c,createDestination:d,updateDestination:u}),4===m&&t(Nu,{disableAnimation:!0,setStep:g,onSave:async()=>{if(!f){b(!0);try{const e=[];v&&e.push(i(v)),C&&e.push(...C.map(e=>d(e.formData)));const t=await Promise.allSettled(e),o=[];for(const e of t)"rejected"===e.status?o.push(e.reason?.message||String(e.reason)):e.value?.error&&o.push(e.value.error);if(o.length)return{error:o.join("\n")};h(kd),p()}catch(e){return b(!1),{error:e instanceof Error?e.message:String(e)}}}},sourcesPayload:v,destinationsPayload:C})]})})]})},zu=e=>(e||[]).filter(e=>!!e.id).map(e=>String(e.id)),Xu=e=>{let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)&&(t+=e.length)}),e.onlyErrors&&t++,t},Vu=g.div`
495
495
  position: relative;
496
496
  display: inline-flex;
497
497
  `,Uu=g.button`
@@ -538,7 +538,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
538
538
  align-items: center;
539
539
  gap: 8px;
540
540
  margin-left: auto;
541
- `,Ku=()=>{const o=f(),a=at(e=>e.sources),i=at(e=>e.namespaces),{selectedStreamName:s}=Fe(),{getItemSS:c,setItemSS:u,removeItemSS:p}=ha(),{namespaces:h,kinds:m,monitors:g,languages:b,onlyErrors:v,podsAgentInjectionStatus:y,setAll:C,clearAll:S,getEmptyState:w}=ca(),x=r(()=>da(a,s),[a,s]);n(()=>{const e=c(ua.OVERVIEW_FILTERS,w());C(e)},[]);const[k,T]=l({namespaces:h,kinds:m,monitors:g,languages:b,onlyErrors:v,podsAgentInjectionStatus:y}),[$,I]=l(Xu(k)),[N,E]=l(!1);n(()=>{if(!N){const e={namespaces:h,kinds:m,monitors:g,languages:b,onlyErrors:v,podsAgentInjectionStatus:y};T(e),I(Xu(e))}},[N,h,m,g,b,v,y]);const A=d(null);Qt(A,()=>E(!1)),No({key:"Escape",active:N},()=>E(!1));const O=r(()=>{const e=new Set,t=[];return i.forEach(({name:o})=>{e.has(o)||(e.add(o),t.push({id:o,label:o,withCheckbox:!0}))}),t},[i]),D=r(()=>{const e=new Set,t=[];return x.forEach(({id:o})=>{const{kind:n}=o;e.has(n)||(e.add(n),t.push({id:n,label:n,withCheckbox:!0}))}),t},[x]),R=r(()=>{const e=new Set,t=[];return x.forEach(({runtimeInfo:o})=>{o?.detectedLanguages?.forEach(o=>{e.has(o)||(e.add(o),t.push({id:o,label:Ae[o]||o,withCheckbox:!0}))})}),t.sort((e,t)=>e.id.localeCompare(t.id))},[x]),F=r(()=>pa.map(({id:e,value:t})=>({id:e,label:t,withCheckbox:!0})),[]),P=r(()=>{const e=new Set,t=[];return x.forEach(({podsAgentInjectionStatus:o})=>{const{reasonEnum:n,message:a}=o||{};if(n){if(e.has(n))return;e.add(n),t.push({id:n,label:$t(n)})}else if(a){if(e.has(a))return;e.add(a),t.push({id:a,label:a,withCheckbox:!0})}}),t},[x]),L=(e,t,o)=>{const n=t.filter(e=>o.includes(e.id));T(t=>{return{...t,[e]:(o=n,o.map(({id:e,label:t})=>({id:e,label:t})))};var o})},_=N?gi:fi,M=r(()=>Bu(k.languages),[k.languages]);return e(Vu,{ref:A,children:[e(Uu,{"data-id":"filters-trigger",$isOpen:N,type:"button",onClick:()=>E(e=>!e),children:[t(Ki,{size:16,fill:o.v2.colors.white[500]}),t(re,{size:ce.XS,weight:500,nowrap:!0,children:"Filters"}),$>0&&t(Ee,{label:$,status:st.Unknown,textSize:ce.XXXS}),t(_,{size:16,fill:o.v2.colors.silver[200]})]}),N&&e(Hu,{children:[e(ju,{children:[t(Je,{label:"Namespace",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!O.length,options:O,values:Bu(k.namespaces),setValues:e=>L("namespaces",O,e)}),t(Je,{label:"Kind",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!D.length,options:D,values:Bu(k.kinds),setValues:e=>L("kinds",D,e)}),t(Je,{label:"Programming Language",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!R.length,options:R,values:M,setValues:e=>L("languages",R,e)}),t(Je,{label:"Monitors",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!F.length,options:F,values:Bu(k.monitors),setValues:e=>L("monitors",F,e)}),t(Je,{label:"Agent Injection Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!P.length,options:P,values:Bu(k.podsAgentInjectionStatus),setValues:e=>L("podsAgentInjectionStatus",P,e)}),t(q,{label:"Show only sources with errors",size:ct.L,value:!!k.onlyErrors,onChange:e=>T(t=>({...t,onlyErrors:e}))})]}),e(Wu,{children:[t(oe,{"data-id":"filters-reset",size:ne.S,variant:ae.Text,label:"Reset",onClick:()=>{p(ua.OVERVIEW_FILTERS),S(),T(w()),I(0),E(!1)},textColor:o.v2.colors.red[500]}),e(Gu,{children:[t(oe,{"data-id":"filters-cancel",size:ne.S,variant:ae.Secondary,label:"Cancel",onClick:()=>E(!1)}),t(oe,{"data-id":"filters-apply",size:ne.S,variant:ae.Primary,label:"Apply",onClick:()=>{u(ua.OVERVIEW_FILTERS,k),C(k),I(Xu(k)),E(!1)}})]})]})]})]})},Yu="40vw",Ju=g.div`
541
+ `,Ku=()=>{const o=f(),a=at(e=>e.sources),i=at(e=>e.namespaces),{selectedStreamName:s}=Fe(),{getItemSS:c,setItemSS:u,removeItemSS:p}=ha(),{namespaces:h,kinds:m,monitors:g,languages:b,onlyErrors:v,podsAgentInjectionStatus:y,setAll:C,clearAll:S,getEmptyState:w}=ca(),x=r(()=>da(a,s),[a,s]);n(()=>{const e=c(ua.OVERVIEW_FILTERS,w());C(e)},[]);const[k,T]=l({namespaces:h,kinds:m,monitors:g,languages:b,onlyErrors:v,podsAgentInjectionStatus:y}),[$,I]=l(Xu(k)),[N,E]=l(!1);n(()=>{if(!N){const e={namespaces:h,kinds:m,monitors:g,languages:b,onlyErrors:v,podsAgentInjectionStatus:y};T(e),I(Xu(e))}},[N,h,m,g,b,v,y]);const A=d(null);Qt(A,()=>E(!1)),No({key:"Escape",active:N},()=>E(!1));const O=r(()=>{const e=new Set,t=[];return i.forEach(({name:o})=>{e.has(o)||(e.add(o),t.push({id:o,label:o,withCheckbox:!0}))}),t},[i]),D=r(()=>{const e=new Set,t=[];return x.forEach(({id:o})=>{const{kind:n}=o;e.has(n)||(e.add(n),t.push({id:n,label:n,withCheckbox:!0}))}),t},[x]),R=r(()=>{const e=new Set,t=[];return x.forEach(({runtimeInfo:o})=>{o?.detectedLanguages?.forEach(o=>{e.has(o)||(e.add(o),t.push({id:o,label:Ae[o]||o,withCheckbox:!0}))})}),t.sort((e,t)=>e.id.localeCompare(t.id))},[x]),F=r(()=>pa.map(({id:e,value:t})=>({id:e,label:t,withCheckbox:!0})),[]),P=r(()=>{const e=new Set,t=[];return x.forEach(({podsAgentInjectionStatus:o})=>{const{reasonEnum:n,message:a}=o||{};if(n){if(e.has(n))return;e.add(n),t.push({id:n,label:$t(n)})}else if(a){if(e.has(a))return;e.add(a),t.push({id:a,label:a,withCheckbox:!0})}}),t},[x]),L=(e,t,o)=>{const n=t.filter(e=>o.includes(e.id));T(t=>{return{...t,[e]:(o=n,o.map(({id:e,label:t})=>({id:e,label:t})))};var o})},_=N?gi:fi,M=r(()=>zu(k.languages),[k.languages]);return e(Vu,{ref:A,children:[e(Uu,{"data-id":"filters-trigger",$isOpen:N,type:"button",onClick:()=>E(e=>!e),children:[t(Ki,{size:16,fill:o.v2.colors.white[500]}),t(re,{size:ce.XS,weight:500,nowrap:!0,children:"Filters"}),$>0&&t(Ee,{label:$,status:st.Unknown,textSize:ce.XXXS}),t(_,{size:16,fill:o.v2.colors.silver[200]})]}),N&&e(Hu,{children:[e(ju,{children:[t(Je,{label:"Namespace",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!O.length,options:O,values:zu(k.namespaces),setValues:e=>L("namespaces",O,e)}),t(Je,{label:"Kind",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!D.length,options:D,values:zu(k.kinds),setValues:e=>L("kinds",D,e)}),t(Je,{label:"Programming Language",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!R.length,options:R,values:M,setValues:e=>L("languages",R,e)}),t(Je,{label:"Monitors",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!F.length,options:F,values:zu(k.monitors),setValues:e=>L("monitors",F,e)}),t(Je,{label:"Agent Injection Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!P.length,options:P,values:zu(k.podsAgentInjectionStatus),setValues:e=>L("podsAgentInjectionStatus",P,e)}),t(q,{label:"Show only sources with errors",size:ct.L,value:!!k.onlyErrors,onChange:e=>T(t=>({...t,onlyErrors:e}))})]}),e(Wu,{children:[t(oe,{"data-id":"filters-reset",size:ne.S,variant:ae.Text,label:"Reset",onClick:()=>{p(ua.OVERVIEW_FILTERS),S(),T(w()),I(0),E(!1)},textColor:o.v2.colors.red[500]}),e(Gu,{children:[t(oe,{"data-id":"filters-cancel",size:ne.S,variant:ae.Secondary,label:"Cancel",onClick:()=>E(!1)}),t(oe,{"data-id":"filters-apply",size:ne.S,variant:ae.Primary,label:"Apply",onClick:()=>{u(ua.OVERVIEW_FILTERS,k),C(k),I(Xu(k)),E(!1)}})]})]})]})]})},Yu="40vw",Ju=g.div`
542
542
  position: relative;
543
543
  width: ${Yu};
544
544
  `,qu=g.div`
@@ -685,7 +685,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
685
685
  display: flex;
686
686
  align-items: stretch;
687
687
  gap: 16px;
688
- `,$p=({height:o,metrics:n,refetchSources:a,refetchDestinations:i,refetchActions:l,refetchInstrumentationRules:s})=>{const c=ca(),{selectedStreamName:d}=Fe(),{containerRef:u,containerHeight:p}=Ta(),h=at(e=>e.sources),m=at(e=>e.sourcesLoading),g=at(e=>e.destinations),f=at(e=>e.destinationsLoading),b=at(e=>e.actions),v=at(e=>e.actionsLoading),y=at(e=>e.instrumentationRules),C=at(e=>e.instrumentationRulesLoading),S=r(()=>da(h,d),[h,d]),w=r(()=>kt(g,d),[g,d]),x=r(()=>$a(S,c),[S,c]),k=r(()=>Ia(w,c),[w,c]),T=r(()=>Na(b,c),[b,c]);return e(Tp,{ref:u,$height:o,children:[t(kp,{entityType:lt.InstrumentationRule,entities:y,unfilteredCount:y.length,loading:C,maxHeight:p,refetch:s}),t(kp,{entityType:lt.Source,entities:x,unfilteredCount:S.length,metrics:n,loading:m,maxHeight:p,refetch:a}),t(kp,{entityType:lt.Action,entities:T,unfilteredCount:b.length,loading:v,maxHeight:p,refetch:l}),t(kp,{entityType:lt.Destination,entities:k,unfilteredCount:w.length,metrics:n,loading:f,maxHeight:p,refetch:i})]})},Ip=({effectiveConfig:n,fetchNamespacesWithWorkloads:a,persistSources:i,restartWorkloads:l,restartPod:s,recoverFromRollback:r,updateSource:c,fetchSourceById:d,fetchPeerSources:u,enableProfiling:p,fetchProfilingSlots:h,fetchSourceProfiling:m,getDestinationCategories:g,getPotentialDestinations:f,testConnection:b,createDestination:v,updateDestination:y,deleteDestination:C,createInstrumentationRule:S,updateInstrumentationRule:w,deleteInstrumentationRule:x,createAction:k,updateAction:T,deleteAction:$})=>{const{currentModal:I,setCurrentModal:N}=Fo(),{drawerType:E,drawerEntityId:A,setDrawerType:O,setDrawerEntityId:D}=Ht(),R=()=>{N(""),O(null),D(null)};return e(o,{children:[t(Td,{}),I===lt.Source&&t(Rl,{children:t(nr,{onClose:R,fetchNamespacesWithWorkloads:a,persistSources:i,withOverlay:!0})}),I===lt.Destination&&t(Fl,{children:t(Ls,{onClose:R,getDestinationCategories:g,getPotentialDestinations:f,testConnection:b,createDestination:v,updateDestination:y,withOverlay:!0})}),I===lt.InstrumentationRule&&t(Ll,{children:t(_s,{onClose:R,createInstrumentationRule:S,withOverlay:!0})}),I===lt.Action&&t(Pl,{children:t($s,{onClose:R,createAction:k,withOverlay:!0})}),E===lt.Source&&A&&t(_l,{children:t(qc,{onClose:R,effectiveConfig:n,sourceId:A,persistSources:i,restartWorkloads:l,restartPod:s,recoverFromRollback:r,updateSource:c,fetchSourceById:d,fetchPeerSources:u,enableProfiling:p,fetchSourceProfiling:m,fetchProfilingSlots:h})}),E===lt.Destination&&A&&t(Fl,{children:t(lr,{onClose:R,destinationId:A,getDestinationCategories:g,testConnection:b,updateDestination:y,deleteDestination:C})}),E===lt.InstrumentationRule&&A&&t(Ll,{children:t(sr,{onClose:R,ruleId:A,updateInstrumentationRule:w,deleteInstrumentationRule:x})}),E===lt.Action&&A&&t(Pl,{children:t(ar,{onClose:R,actionId:A,updateAction:T,deleteAction:$})})]})},Np="multi-source-deselect",Ep="multi-source-restart",Ap="multi-source-uninstrument",Op="Selected sources",Dp="Deselect",Rp="Restart",Fp="Uninstrument",Pp="Rollout Restart Workloads",Lp="Are you sure you want to rollout restart these workloads?",_p="Go Back",Mp="Confirm",zp=({restartWorkloads:a,persistSources:i})=>{const{selectedStreamName:s}=Fe(),{selectedSources:d,setSelectedSources:u}=va(),[p,h]=l(!1),[m,g]=l(!1),f=r(()=>Object.values(d).reduce((e,t)=>e+t.length,0),[d]),b=c(()=>{u({})},[u]),v=c(()=>h(!1),[]),y=c(()=>g(!1),[]);n(()=>{b()},[s,b]);const C=c(()=>{a(Object.values(d).flat().filter(e=>e.id.kind!==co.StaticPod).map(jt)),b()},[a,d,b]),S=c(()=>{i(Object.fromEntries(Object.entries(d).map(([e,t])=>[e,t.map(({id:e})=>({namespace:e.namespace,name:e.name,kind:e.kind||void 0,selected:!1,currentStreamName:s}))]))),b()},[i,d,s,b]),w=r(()=>[{id:Np,type:Xt.Button,buttonProps:{variant:ae.Text,size:ne.S,label:Dp,onClick:b}},{id:Ep,type:Xt.Button,buttonProps:{variant:ae.Secondary,size:ne.S,label:Rp,leftIcon:Mi,onClick:()=>h(!0)}},{id:Ap,type:Xt.Button,buttonProps:{variant:ae.Primary,size:ne.S,label:Fp,leftIcon:ni,onClick:()=>g(!0)}}],[b]);return e(o,{children:[t(sa,{isOpen:f>0,richTitle:{icon:Ci,title:Op,badge:{label:f}},actions:w}),t(De,{isOpen:p,title:Pp,description:Lp,onClose:v,denyButton:{label:_p,variant:ae.Secondary,onClick:v},approveButton:{label:Mp,variant:ae.Primary,onClick:()=>{C(),v()}}}),t(ml,{isOpen:m,action:"uninstrument",target:`${f} source${1===f?"":"s"}`,onClose:y,onDeny:y,onApprove:S})]})},Bp=e=>`Data Stream: ${e}`,Xp="Search streams...",Vp="No streams match",Up=g.div`
688
+ `,$p=({height:o,metrics:n,refetchSources:a,refetchDestinations:i,refetchActions:l,refetchInstrumentationRules:s})=>{const c=ca(),{selectedStreamName:d}=Fe(),{containerRef:u,containerHeight:p}=Ta(),h=at(e=>e.sources),m=at(e=>e.sourcesLoading),g=at(e=>e.destinations),f=at(e=>e.destinationsLoading),b=at(e=>e.actions),v=at(e=>e.actionsLoading),y=at(e=>e.instrumentationRules),C=at(e=>e.instrumentationRulesLoading),S=r(()=>da(h,d),[h,d]),w=r(()=>kt(g,d),[g,d]),x=r(()=>$a(S,c),[S,c]),k=r(()=>Ia(w,c),[w,c]),T=r(()=>Na(b,c),[b,c]);return e(Tp,{ref:u,$height:o,children:[t(kp,{entityType:lt.InstrumentationRule,entities:y,unfilteredCount:y.length,loading:C,maxHeight:p,refetch:s}),t(kp,{entityType:lt.Source,entities:x,unfilteredCount:S.length,metrics:n,loading:m,maxHeight:p,refetch:a}),t(kp,{entityType:lt.Action,entities:T,unfilteredCount:b.length,loading:v,maxHeight:p,refetch:l}),t(kp,{entityType:lt.Destination,entities:k,unfilteredCount:w.length,metrics:n,loading:f,maxHeight:p,refetch:i})]})},Ip=({effectiveConfig:n,fetchNamespacesWithWorkloads:a,persistSources:i,restartWorkloads:l,restartPod:s,recoverFromRollback:r,updateSource:c,fetchSourceById:d,fetchPeerSources:u,enableProfiling:p,fetchProfilingSlots:h,fetchSourceProfiling:m,getDestinationCategories:g,getPotentialDestinations:f,testConnection:b,createDestination:v,updateDestination:y,deleteDestination:C,createInstrumentationRule:S,updateInstrumentationRule:w,deleteInstrumentationRule:x,createAction:k,updateAction:T,deleteAction:$})=>{const{currentModal:I,setCurrentModal:N}=Fo(),{drawerType:E,drawerEntityId:A,setDrawerType:O,setDrawerEntityId:D}=Ht(),R=()=>{N(""),O(null),D(null)};return e(o,{children:[t(Td,{}),I===lt.Source&&t(Rl,{children:t(nr,{onClose:R,fetchNamespacesWithWorkloads:a,persistSources:i,withOverlay:!0})}),I===lt.Destination&&t(Fl,{children:t(Ls,{onClose:R,getDestinationCategories:g,getPotentialDestinations:f,testConnection:b,createDestination:v,updateDestination:y,withOverlay:!0})}),I===lt.InstrumentationRule&&t(Ll,{children:t(_s,{onClose:R,createInstrumentationRule:S,withOverlay:!0})}),I===lt.Action&&t(Pl,{children:t($s,{onClose:R,createAction:k,withOverlay:!0})}),E===lt.Source&&A&&t(_l,{children:t(qc,{onClose:R,effectiveConfig:n,sourceId:A,persistSources:i,restartWorkloads:l,restartPod:s,recoverFromRollback:r,updateSource:c,fetchSourceById:d,fetchPeerSources:u,enableProfiling:p,fetchSourceProfiling:m,fetchProfilingSlots:h})}),E===lt.Destination&&A&&t(Fl,{children:t(lr,{onClose:R,destinationId:A,getDestinationCategories:g,testConnection:b,updateDestination:y,deleteDestination:C})}),E===lt.InstrumentationRule&&A&&t(Ll,{children:t(sr,{onClose:R,ruleId:A,updateInstrumentationRule:w,deleteInstrumentationRule:x})}),E===lt.Action&&A&&t(Pl,{children:t(ar,{onClose:R,actionId:A,updateAction:T,deleteAction:$})})]})},Np="multi-source-deselect",Ep="multi-source-restart",Ap="multi-source-uninstrument",Op="Selected sources",Dp="Deselect",Rp="Restart",Fp="Uninstrument",Pp="Rollout Restart Workloads",Lp="Are you sure you want to rollout restart these workloads?",_p="Go Back",Mp="Confirm",Bp=({restartWorkloads:a,persistSources:i})=>{const{selectedStreamName:s}=Fe(),{selectedSources:d,setSelectedSources:u}=va(),[p,h]=l(!1),[m,g]=l(!1),f=r(()=>Object.values(d).reduce((e,t)=>e+t.length,0),[d]),b=c(()=>{u({})},[u]),v=c(()=>h(!1),[]),y=c(()=>g(!1),[]);n(()=>{b()},[s,b]);const C=c(()=>{a(Object.values(d).flat().filter(e=>e.id.kind!==co.StaticPod).map(jt)),b()},[a,d,b]),S=c(()=>{i(Object.fromEntries(Object.entries(d).map(([e,t])=>[e,t.map(({id:e})=>({namespace:e.namespace,name:e.name,kind:e.kind||void 0,selected:!1,currentStreamName:s}))]))),b()},[i,d,s,b]),w=r(()=>[{id:Np,type:Xt.Button,buttonProps:{variant:ae.Text,size:ne.S,label:Dp,onClick:b}},{id:Ep,type:Xt.Button,buttonProps:{variant:ae.Secondary,size:ne.S,label:Rp,leftIcon:Mi,onClick:()=>h(!0)}},{id:Ap,type:Xt.Button,buttonProps:{variant:ae.Primary,size:ne.S,label:Fp,leftIcon:ni,onClick:()=>g(!0)}}],[b]);return e(o,{children:[t(sa,{isOpen:f>0,richTitle:{icon:Ci,title:Op,badge:{label:f}},actions:w}),t(De,{isOpen:p,title:Pp,description:Lp,onClose:v,denyButton:{label:_p,variant:ae.Secondary,onClick:v},approveButton:{label:Mp,variant:ae.Primary,onClick:()=>{C(),v()}}}),t(ml,{isOpen:m,action:"uninstrument",target:`${f} source${1===f?"":"s"}`,onClose:y,onDeny:y,onApprove:S})]})},zp=e=>`Data Stream: ${e}`,Xp="Search streams...",Vp="No streams match",Up=g.div`
689
689
  position: relative;
690
690
  display: inline-flex;
691
691
  `,Hp=g.div`
@@ -750,7 +750,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
750
750
  display: flex;
751
751
  padding-top: 4px;
752
752
  border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
753
- `,Zp=({updateDataStream:a,deleteDataStream:i,createDataStream:s})=>{const c=f(),{isVm:u}=y(),{clearStore:p}=Ea(),{dataStreams:h,selectedStreamName:m,setSelectedStreamName:g}=Fe(),b=d(null),[v,C]=l(!1),[S,w]=l(""),[x,k]=l(""),[T,$]=l(!1),[I,N]=l(!1),[E,A]=l(!1),[O,D]=l(""),[R,F]=l(!1);Qt(b,()=>C(!1)),n(()=>{v||w("")},[v]);const P=r(()=>{if(!S)return h;const e=S.toLowerCase();return h.filter(({name:t})=>t.toLowerCase().includes(e))},[h,S]),L=v?gi:fi;return u?null:e(o,{children:[e(Up,{ref:b,children:[e(Hp,{"data-id":"data-stream-select",$isOpen:v,onClick:()=>C(e=>!e),children:[t(Yi,{size:24}),t(re,{size:ce.S,weight:500,nowrap:!0,children:Bp(m)}),t(Ee,{label:h.length,status:st.Unknown,textSize:ce.XXXS}),t(L,{size:20,fill:c.v2.colors.silver[200]})]}),v&&e(jp,{children:[t(Wp,{children:t(Vt,{value:S,onChange:w,placeholder:Xp,width:"100%"})}),t(Gp,{children:0===P.length?t(Kp,{children:t(re,{size:ce.XS,color:Ce.Secondary,children:Vp})}):P.map(({name:o})=>{const n=o===Aa;return e(Kp,{"data-id":`stream-row-${o}`,$selected:o===m,onClick:()=>(e=>{e!==m&&(p(),g(e)),C(!1)})(o),children:[t(Yp,{children:t(re,{size:ce.XS,nowrap:!0,children:o})}),e(Jp,{children:[t(qe,{"data-id":`stream-edit-${o}`,icon:ci,size:Ze.XS,onClick:e=>{e.stopPropagation(),C(!1),k(o),$(!0)}}),!n&&t(qe,{"data-id":`stream-delete-${o}`,icon:ni,size:Ze.XS,onClick:e=>{e.stopPropagation(),C(!1),D(o),F(!0)}})]})]},`stream-${o}`)})}),t(qp,{children:t(oe,{"data-id":"add-stream-trigger",variant:ae.Secondary,size:ne.S,leftIcon:ai,label:`${bt.NEW} ${Re.STREAM_NAME}`,fullWidth:!0,onClick:()=>{C(!1),p(),A(!0),N(!0)}})})]})]}),E&&t(Ml,{defaultExcludeName:m,children:t(Cd,{isOpen:I,onClose:()=>N(!1),onCloseEnd:()=>A(!1),createDataStream:s})}),x&&t(Ml,{children:t(Sd,{isOpen:T,dataStreamName:x,onClose:()=>$(!1),onCloseEnd:()=>k(""),updateDataStream:a})}),t(ml,{target:`${Re.STREAM_NAME.toLowerCase()} "${O}"`,isOpen:R,onClose:()=>F(!1),onApprove:async()=>{O&&await i(O)}})]})},Qp=v`
753
+ `,Zp=({updateDataStream:a,deleteDataStream:i,createDataStream:s})=>{const c=f(),{isVm:u}=y(),{clearStore:p}=Ea(),{dataStreams:h,selectedStreamName:m,setSelectedStreamName:g}=Fe(),b=d(null),[v,C]=l(!1),[S,w]=l(""),[x,k]=l(""),[T,$]=l(!1),[I,N]=l(!1),[E,A]=l(!1),[O,D]=l(""),[R,F]=l(!1);Qt(b,()=>C(!1)),n(()=>{v||w("")},[v]);const P=r(()=>{if(!S)return h;const e=S.toLowerCase();return h.filter(({name:t})=>t.toLowerCase().includes(e))},[h,S]),L=v?gi:fi;return u?null:e(o,{children:[e(Up,{ref:b,children:[e(Hp,{"data-id":"data-stream-select",$isOpen:v,onClick:()=>C(e=>!e),children:[t(Yi,{size:24}),t(re,{size:ce.S,weight:500,nowrap:!0,children:zp(m)}),t(Ee,{label:h.length,status:st.Unknown,textSize:ce.XXXS}),t(L,{size:20,fill:c.v2.colors.silver[200]})]}),v&&e(jp,{children:[t(Wp,{children:t(Vt,{value:S,onChange:w,placeholder:Xp,width:"100%"})}),t(Gp,{children:0===P.length?t(Kp,{children:t(re,{size:ce.XS,color:Ce.Secondary,children:Vp})}):P.map(({name:o})=>{const n=o===Aa;return e(Kp,{"data-id":`stream-row-${o}`,$selected:o===m,onClick:()=>(e=>{e!==m&&(p(),g(e)),C(!1)})(o),children:[t(Yp,{children:t(re,{size:ce.XS,nowrap:!0,children:o})}),e(Jp,{children:[t(qe,{"data-id":`stream-edit-${o}`,icon:ci,size:Ze.XS,onClick:e=>{e.stopPropagation(),C(!1),k(o),$(!0)}}),!n&&t(qe,{"data-id":`stream-delete-${o}`,icon:ni,size:Ze.XS,onClick:e=>{e.stopPropagation(),C(!1),D(o),F(!0)}})]})]},`stream-${o}`)})}),t(qp,{children:t(oe,{"data-id":"add-stream-trigger",variant:ae.Secondary,size:ne.S,leftIcon:ai,label:`${bt.NEW} ${Re.STREAM_NAME}`,fullWidth:!0,onClick:()=>{C(!1),p(),A(!0),N(!0)}})})]})]}),E&&t(Ml,{defaultExcludeName:m,children:t(Cd,{isOpen:I,onClose:()=>N(!1),onCloseEnd:()=>A(!1),createDataStream:s})}),x&&t(Ml,{children:t(Sd,{isOpen:T,dataStreamName:x,onClose:()=>$(!1),onCloseEnd:()=>k(""),updateDataStream:a})}),t(ml,{target:`${Re.STREAM_NAME.toLowerCase()} "${O}"`,isOpen:R,onClose:()=>F(!1),onApprove:async()=>{O&&await i(O)}})]})},Qp=v`
754
754
  0% {
755
755
  background-position: 200% 50%;
756
756
  }
@@ -769,12 +769,12 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
769
769
  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%)`};
770
770
  background-size: 200% 100%;
771
771
  animation: ${Qp} 15s linear infinite;
772
- `,th=[yi,Ci,hi,mi],oh=({columnsMaxHeight:o,metrics:n,refetchSources:i,refetchDestinations:l,refetchActions:s,refetchInstrumentationRules:r,updateDataStream:c,deleteDataStream:d,createDataStream:u,...p})=>{const h=f();return e(la,{children:[e(Ue,{customTitle:t(Zp,{updateDataStream:c,deleteDataStream:d,createDataStream:u}),customSearch:t(np,{}),filters:t(Ku,{}),children:[t(eh,{children:th.map((o,n)=>e(a,{children:[t(o,{size:24}),n<th.length-1&&t(pi,{fill:h.v2.colors.white[500]+je["020"],size:24})]},o.name))}),t($p,{height:o,metrics:n,refetchSources:i,refetchDestinations:l,refetchActions:s,refetchInstrumentationRules:r})]}),t(Ip,{...p}),t(zp,{restartWorkloads:p.restartWorkloads,persistSources:p.persistSources})]})};var nh;!function(e){e.Gateway="gateway",e.Node="node"}(nh||(nh={}));const ah=({onClickDownloadDiagnose:o,onClickRefresh:n,loading:a,disabled:i})=>{const l=r(()=>{const e=[];return o&&e.push({id:Ro(),type:Xt.Button,buttonProps:{label:"Download Diagnose",leftIcon:_i,size:ne.S,variant:ae.Text,onClick:o,disabled:i}}),n&&e.push({id:Ro(),type:Xt.Button,buttonProps:{label:"Refresh",leftIcon:$i,size:ne.S,variant:ae.Text,onClick:n,disabled:i,loading:a}}),e},[o,n,i,a]);return e(te,{$alignItems:"center",$justifyContent:"space-between",children:[t(Oa,{icon:Ji,title:"Collectors Pipeline"}),t(Da,{actions:l})]})},ih=({pod:o,getExtendedPodInfo:a,onClose:i})=>{const{formatTimeAgo:s}=Ot(),[c,d]=l(null);n(()=>{o?a(o.namespace,o.name).then(e=>d(e??null)):d(null)},[o]);const u=r(()=>[{id:Ro(),title:"Node",label:c?.node??"-",withCopy:!0},{id:Ro(),title:"Status",badge:{status:Ra(c?.status),label:c?.status??"-"}}],[c]),p=r(()=>c?.containers?.map(e=>({id:Ro(),items:[{id:Ro(),title:"Container",label:e.name??"-"},{id:Ro(),title:"Status",label:e.startedAt?`${e.status} (since ${s(e.startedAt)})`:e.status},{id:Ro(),title:"Ready",badge:{status:e.ready?ge.Success:ge.Error,leftIcon:e.ready?li:si,label:e.ready?"True":"False",invertColors:!0}},{id:Ro(),title:"Started",badge:{status:e.started?ge.Success:ge.Error,leftIcon:e.started?li:si,label:e.started?"True":"False",invertColors:!0}},{id:Ro(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:Ro(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:Ro(),title:Re.RESTARTS,label:e.restarts.toString()},{id:Ro(),title:"State Reason",label:e.stateReason??"-"},{id:Ro(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:Ro(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[c]);return t(ft,{isOpen:!!o,header:{icon:xi,title:"Pod Information",onClose:i},children:c?e(yt,{bgTint:"1000",richTitle:{icon:xi,title:c.name,withCopy:!0},children:[t(yt,{bgTint:"900",cellsPerRow:2,items:u}),e(yt,{bgTint:"900",richTitle:{icon:Ui,title:"Kubectl Commands"},withCollapse:!0,collapseIsDefaultOpen:!0,children:[t(Bt,{value:`kubectl get pod ${c.name} -n ${c.namespace} -o yaml`}),t(Bt,{value:`kubectl describe pod ${c.name} -n ${c.namespace}`}),t(Bt,{value:`kubectl logs ${c.name} -n ${c.namespace}`})]}),t(yt,{bgTint:"900",richTitle:{title:"Containers Overview"},withCollapse:!0,collapseIsDefaultOpen:!0,children:p.length?p.map(({id:e,items:o})=>t(yt,{bgTint:"800",cellsPerRow:2,items:o},e)):t(se,{title:"No containers",subTitle:"Pod has no containers"})}),t(fl,{bgTint:"900",yaml:c.manifestYAML,defaultOpen:!0})]}):t(Ke,{$height:"50vh",children:t(Qe,{withSpinner:!0})})})};var lh;!function(e){e.PodName="podName",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.SpanDropDrate="spanDropDrate",e.Age="age",e.DockerImage="dockerImage"}(lh||(lh={}));const sh=[{key:lh.PodName,label:"Pod Name"},{key:lh.Status,label:"Status"},{key:lh.Restarts,label:Re.RESTARTS},{key:lh.NodeName,label:"Node Name"},{key:lh.Age,label:"Age"},{key:lh.DockerImage,label:"Collector Version"}],rh=({isLoading:o,tableRowsMaxHeight:n,pods:a,getExtendedPodInfo:i})=>{const s=f(),{formatTimeAgo:c}=Ot(),[d,u]=l(null),p=r(()=>a.map(o=>({onClick:()=>u(o),cells:[{key:lh.PodName,rawValue:o.name},{key:lh.Status,rawValue:o.status,component:()=>{return e=o.status,t(Ee,{status:Ra(e),label:e});var e}},{key:lh.Restarts,rawValue:o.restartsCount.toString()},{key:lh.NodeName,rawValue:o.nodeName},{key:lh.SpanDropDrate,rawValue:0,component:()=>{const{collectorMetrics:n}=o;if(!n)return t(re,{children:"-"});const a=(n?.metricsAcceptedRps??0)+(n?.metricsDroppedRps??0),i=a>0?Math.round((n?.metricsDroppedRps??0)/a*100):0,l=i>0?ge.Error:ge.Success,s=(n?.exporterSuccessRps??0)+(n?.exporterFailedRps??0),r=s>0?Math.round((n?.exporterFailedRps??0)/s*100):0,c=r>0?ge.Error:ge.Success;return e(te,{$gap:4,children:[t(we,{text:`Accepted: ${n.metricsAcceptedRps.toLocaleString()}, Dropped: ${n.metricsDroppedRps.toLocaleString()}`,children:t(Ee,{status:l,label:`Receiver ${i}%`,leftIcon:l===ge.Error?qi:Zi,useSecondaryTone:!0,invertColors:!0})}),t(we,{text:`Success: ${n.exporterSuccessRps.toLocaleString()}, Failed: ${n.exporterFailedRps.toLocaleString()}`,children:t(Ee,{status:c,label:`Exporter ${r}%`,leftIcon:c===ge.Error?qi:Zi,useSecondaryTone:!0,invertColors:!0})})]})}},{key:lh.Age,rawValue:c(o.creationTimestamp)},{key:lh.DockerImage,rawValue:o.image}]})),[a,s]);return e(yt,{bgTint:"1000",moreSpacing:!0,richTitle:{icon:xi,title:"Pods"},children:[t(lo,{variant:so.Data,maxHeight:n,isLoading:o,columns:sh,rows:p}),t(ih,{pod:d,getExtendedPodInfo:i,onClose:()=>u(null)})]})},ch=({isOpen:e,onClose:o,title:n,yaml:a})=>t(ft,{isOpen:e,header:{icon:Qi,title:n,onClose:o},children:t(fl,{yaml:a,defaultOpen:!0})}),dh=e=>{switch(e){case Fa.Healthy:return"All desired replicas are updated, available, and ready";case Fa.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case Fa.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case Fa.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case Fa.Down:return"No available replicas";case Fa.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}};var uh;!function(e){e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"}(uh||(uh={}));const ph=g.div`
772
+ `,th=[yi,Ci,hi,mi],oh=({columnsMaxHeight:o,metrics:n,refetchSources:i,refetchDestinations:l,refetchActions:s,refetchInstrumentationRules:r,updateDataStream:c,deleteDataStream:d,createDataStream:u,...p})=>{const h=f();return e(la,{children:[e(Ue,{customTitle:t(Zp,{updateDataStream:c,deleteDataStream:d,createDataStream:u}),customSearch:t(np,{}),filters:t(Ku,{}),children:[t(eh,{children:th.map((o,n)=>e(a,{children:[t(o,{size:24}),n<th.length-1&&t(pi,{fill:h.v2.colors.white[500]+je["020"],size:24})]},o.name))}),t($p,{height:o,metrics:n,refetchSources:i,refetchDestinations:l,refetchActions:s,refetchInstrumentationRules:r})]}),t(Ip,{...p}),t(Bp,{restartWorkloads:p.restartWorkloads,persistSources:p.persistSources})]})};var nh;!function(e){e.Gateway="gateway",e.Node="node"}(nh||(nh={}));const ah=({onClickDownloadDiagnose:o,onClickRefresh:n,loading:a,disabled:i})=>{const l=r(()=>{const e=[];return o&&e.push({id:Ro(),type:Xt.Button,buttonProps:{label:"Download Diagnose",leftIcon:_i,size:ne.S,variant:ae.Text,onClick:o,disabled:i}}),n&&e.push({id:Ro(),type:Xt.Button,buttonProps:{label:"Refresh",leftIcon:$i,size:ne.S,variant:ae.Text,onClick:n,disabled:i,loading:a}}),e},[o,n,i,a]);return e(te,{$alignItems:"center",$justifyContent:"space-between",children:[t(Oa,{icon:Ji,title:"Collectors Pipeline"}),t(Da,{actions:l})]})},ih=({pod:o,getExtendedPodInfo:a,onClose:i})=>{const{formatTimeAgo:s}=Ot(),[c,d]=l(null);n(()=>{o?a(o.namespace,o.name).then(e=>d(e??null)):d(null)},[o]);const u=r(()=>[{id:Ro(),title:"Node",label:c?.node??"-",withCopy:!0},{id:Ro(),title:"Status",badge:{status:Ra(c?.status),label:c?.status??"-"}}],[c]),p=r(()=>c?.containers?.map(e=>({id:Ro(),items:[{id:Ro(),title:"Container",label:e.name??"-"},{id:Ro(),title:"Status",label:e.startedAt?`${e.status} (since ${s(e.startedAt)})`:e.status},{id:Ro(),title:"Ready",badge:{status:e.ready?ge.Success:ge.Error,leftIcon:e.ready?li:si,label:e.ready?"True":"False",invertColors:!0}},{id:Ro(),title:"Started",badge:{status:e.started?ge.Success:ge.Error,leftIcon:e.started?li:si,label:e.started?"True":"False",invertColors:!0}},{id:Ro(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:Ro(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:Ro(),title:Re.RESTARTS,label:e.restarts.toString()},{id:Ro(),title:"State Reason",label:e.stateReason??"-"},{id:Ro(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:Ro(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[c]);return t(ft,{isOpen:!!o,header:{icon:xi,title:"Pod Information",onClose:i},children:c?e(yt,{bgTint:"1000",richTitle:{icon:xi,title:c.name,withCopy:!0},children:[t(yt,{bgTint:"900",cellsPerRow:2,items:u}),e(yt,{bgTint:"900",richTitle:{icon:Ui,title:"Kubectl Commands"},withCollapse:!0,collapseIsDefaultOpen:!0,children:[t(zt,{value:`kubectl get pod ${c.name} -n ${c.namespace} -o yaml`}),t(zt,{value:`kubectl describe pod ${c.name} -n ${c.namespace}`}),t(zt,{value:`kubectl logs ${c.name} -n ${c.namespace}`})]}),t(yt,{bgTint:"900",richTitle:{title:"Containers Overview"},withCollapse:!0,collapseIsDefaultOpen:!0,children:p.length?p.map(({id:e,items:o})=>t(yt,{bgTint:"800",cellsPerRow:2,items:o},e)):t(se,{title:"No containers",subTitle:"Pod has no containers"})}),t(fl,{bgTint:"900",yaml:c.manifestYAML,defaultOpen:!0})]}):t(Ke,{$height:"50vh",children:t(Qe,{withSpinner:!0})})})};var lh;!function(e){e.PodName="podName",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.SpanDropDrate="spanDropDrate",e.Age="age",e.DockerImage="dockerImage"}(lh||(lh={}));const sh=[{key:lh.PodName,label:"Pod Name"},{key:lh.Status,label:"Status"},{key:lh.Restarts,label:Re.RESTARTS},{key:lh.NodeName,label:"Node Name"},{key:lh.Age,label:"Age"},{key:lh.DockerImage,label:"Collector Version"}],rh=({isLoading:o,tableRowsMaxHeight:n,pods:a,getExtendedPodInfo:i})=>{const s=f(),{formatTimeAgo:c}=Ot(),[d,u]=l(null),p=r(()=>a.map(o=>({onClick:()=>u(o),cells:[{key:lh.PodName,rawValue:o.name},{key:lh.Status,rawValue:o.status,component:()=>{return e=o.status,t(Ee,{status:Ra(e),label:e});var e}},{key:lh.Restarts,rawValue:o.restartsCount.toString()},{key:lh.NodeName,rawValue:o.nodeName},{key:lh.SpanDropDrate,rawValue:0,component:()=>{const{collectorMetrics:n}=o;if(!n)return t(re,{children:"-"});const a=(n?.metricsAcceptedRps??0)+(n?.metricsDroppedRps??0),i=a>0?Math.round((n?.metricsDroppedRps??0)/a*100):0,l=i>0?ge.Error:ge.Success,s=(n?.exporterSuccessRps??0)+(n?.exporterFailedRps??0),r=s>0?Math.round((n?.exporterFailedRps??0)/s*100):0,c=r>0?ge.Error:ge.Success;return e(te,{$gap:4,children:[t(we,{text:`Accepted: ${n.metricsAcceptedRps.toLocaleString()}, Dropped: ${n.metricsDroppedRps.toLocaleString()}`,children:t(Ee,{status:l,label:`Receiver ${i}%`,leftIcon:l===ge.Error?qi:Zi,useSecondaryTone:!0,invertColors:!0})}),t(we,{text:`Success: ${n.exporterSuccessRps.toLocaleString()}, Failed: ${n.exporterFailedRps.toLocaleString()}`,children:t(Ee,{status:c,label:`Exporter ${r}%`,leftIcon:c===ge.Error?qi:Zi,useSecondaryTone:!0,invertColors:!0})})]})}},{key:lh.Age,rawValue:c(o.creationTimestamp)},{key:lh.DockerImage,rawValue:o.image}]})),[a,s]);return e(yt,{bgTint:"1000",moreSpacing:!0,richTitle:{icon:xi,title:"Pods"},children:[t(lo,{variant:so.Data,maxHeight:n,isLoading:o,columns:sh,rows:p}),t(ih,{pod:d,getExtendedPodInfo:i,onClose:()=>u(null)})]})},ch=({isOpen:e,onClose:o,title:n,yaml:a})=>t(ft,{isOpen:e,header:{icon:Qi,title:n,onClose:o},children:t(fl,{yaml:a,defaultOpen:!0})}),dh=e=>{switch(e){case Fa.Healthy:return"All desired replicas are updated, available, and ready";case Fa.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case Fa.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case Fa.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case Fa.Down:return"No available replicas";case Fa.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}};var uh;!function(e){e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"}(uh||(uh={}));const ph=g.div`
773
773
  flex: 0.5;
774
774
  padding: 12px;
775
775
  border-radius: 12px;
776
776
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
777
- `,hh=({selectedTab:o,gatewayInfo:n,nodeCollectorInfo:a,isLoading:i})=>{const{formatTimeAgo:s}=Ot(),[c,d]=l(null),u=r(()=>(e=>{switch(e){case nh.Gateway:return"Deployment";case nh.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(o),[o]),p=r(()=>((e,t,o,n)=>{const a={status:st.Disabled,label:"No rollouts yet"};let i=!1,l=null;switch(e){case nh.Gateway:i=t?.rolloutInProgress??!1,l=t?.lastRolloutAt??null;break;case nh.Node:i=o?.rolloutInProgress??!1,l=o?.lastRolloutAt??null;break;default:return a}return i?{status:ge.Info,label:"Rollout in progress",rightIcon:$i,useSecondaryTone:!0}:l?{status:st.Disabled,label:`Last Rollout: ${n(l)}`}:a})(o,n,a,s),[n,a,o,s]),h=r(()=>((e,t,o,n)=>{let a=n?ge.Info:st.Unknown,i=n?"Loading":Fa.Unknown,l=n?"Fetching data...":dh(Fa.Unknown);switch(e){case nh.Gateway:a=t?.status?Ra(t?.status):a,i=t?.status??i,l=t?.status?dh(t.status):l;break;case nh.Node:a=o?.status?Ra(o?.status):a,i=o?.status??i,l=o?.status?dh(o.status):l}return{status:a,title:i,description:l}})(o,n,a,i),[n,a,o,i]),m=r(()=>((e,t,o)=>{switch(e){case nh.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 nh.Node:return[{gaugeWidth:128,min:0,max:o?.nodes?.desired??0,current:o?.nodes?.ready??0,title:"Nodes",primaryLabel:"Ready nodes",secondaryLabel:"Desired nodes"}];default:return[]}})(o,n,a),[n,a,o]),g=r(()=>((e,t,o,n)=>{switch(e){case nh.Gateway:return[{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${t?.resources?.requests.cpu}/${t?.resources?.limits.cpu}`,isLoading:n},{label:"Memory",value:`${t?.resources?.requests.memory}/${t?.resources?.limits.memory}`,isLoading:n}]}];case nh.Node:return[{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${o?.resources?.requests.cpu}/${o?.resources?.limits.cpu}`,isLoading:n},{label:"Memory",value:`${o?.resources?.requests.memory}/${o?.resources?.limits.memory}`,isLoading:n}]}];default:return[]}})(o,n,a,i),[n,a,o,i]),f=r(()=>(o===nh.Gateway?n?.manifestYAML:a?.manifestYAML)??"",[n,a,o]),b=r(()=>(o===nh.Gateway?n?.configMapYAML:a?.configMapYAML)??"",[n,a,o]);return e(yt,{bgTint:"1000",moreSpacing:!0,richTitle:{icon:Qi,title:u,badge:p},actions:[{id:Ro(),type:Xt.ButtonDropData,buttonProps:{variant:ae.Secondary,size:ne.S,label:"View YAML",onClick:e=>d(e)},dropDataProps:{items:[{id:uh.ManifestYaml,label:u,icon:el},{id:uh.ConfigMapYaml,label:"ConfigMap",icon:el}]}}],children:[e(te,{$gap:16,children:[t("div",{children:t(Pa,{...h})}),m.map(e=>t(ph,{children:t("div",{children:t(La,{...e})})},e.title)),g.map(e=>t(_a,{...e},e.title))]}),t(ch,{isOpen:c===uh.ManifestYaml,onClose:()=>d(null),title:u,yaml:f}),t(ch,{isOpen:c===uh.ConfigMapYaml,onClose:()=>d(null),title:"ConfigMap",yaml:b})]})},mh=[{value:nh.Gateway,label:"Gateway"},{value:nh.Node,label:"Node Collector"}],gh=({minSupportedVersion:o=0,tableRowsMaxHeight:a,getGatewayInfo:i,getGatewayPods:s,getNodeCollectorInfo:d,getNodeCollectorPods:u,getExtendedPodInfo:p})=>{const{isVersionSupported:h,version:m}=y(o),[g,f]=l(!1),[b,v]=l(nh.Gateway),[C,S]=l(null),[w,x]=l([]),[k,T]=l(null),[$,I]=l([]),N=c(async()=>{f(!0);try{switch(b){case nh.Gateway:S(await i()??null),x(await s()??[]);break;case nh.Node:T(await d()??null),I(await u()??[])}}catch(e){}f(!1)},[b]);n(()=>{N()},[N]);const E=r(()=>b===nh.Gateway?w:$,[w,$,b]);return e(la,{children:[t(ah,{disabled:!h,loading:g,onClickDownloadDiagnose:void 0,onClickRefresh:N}),e(Ma,{children:[e(V,{children:[t(ue,{variant:ao.Underline,size:za.L,options:mh,selected:b,setSelected:v}),t(hh,{selectedTab:b,gatewayInfo:C,nodeCollectorInfo:k,isLoading:g})]}),t(rh,{isLoading:g,tableRowsMaxHeight:a,pods:E,getExtendedPodInfo:p}),!h&&t(yl,{minSupportedVersion:o,currentVersion:m||""})]})]})},fh=g.div`
777
+ `,hh=({selectedTab:o,gatewayInfo:n,nodeCollectorInfo:a,isLoading:i})=>{const{formatTimeAgo:s}=Ot(),[c,d]=l(null),u=r(()=>(e=>{switch(e){case nh.Gateway:return"Deployment";case nh.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(o),[o]),p=r(()=>((e,t,o,n)=>{const a={status:st.Disabled,label:"No rollouts yet"};let i=!1,l=null;switch(e){case nh.Gateway:i=t?.rolloutInProgress??!1,l=t?.lastRolloutAt??null;break;case nh.Node:i=o?.rolloutInProgress??!1,l=o?.lastRolloutAt??null;break;default:return a}return i?{status:ge.Info,label:"Rollout in progress",rightIcon:$i,useSecondaryTone:!0}:l?{status:st.Disabled,label:`Last Rollout: ${n(l)}`}:a})(o,n,a,s),[n,a,o,s]),h=r(()=>((e,t,o,n)=>{let a=n?ge.Info:st.Unknown,i=n?"Loading":Fa.Unknown,l=n?"Fetching data...":dh(Fa.Unknown);switch(e){case nh.Gateway:a=t?.status?Ra(t?.status):a,i=t?.status??i,l=t?.status?dh(t.status):l;break;case nh.Node:a=o?.status?Ra(o?.status):a,i=o?.status??i,l=o?.status?dh(o.status):l}return{status:a,title:i,description:l}})(o,n,a,i),[n,a,o,i]),m=r(()=>((e,t,o)=>{switch(e){case nh.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 nh.Node:return[{gaugeWidth:128,min:0,max:o?.nodes?.desired??0,current:o?.nodes?.ready??0,title:"Nodes",primaryLabel:"Ready nodes",secondaryLabel:"Desired nodes"}];default:return[]}})(o,n,a),[n,a,o]),g=r(()=>((e,t,o,n)=>{switch(e){case nh.Gateway:return[{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${t?.resources?.requests.cpu}/${t?.resources?.limits.cpu}`,isLoading:n},{label:"Memory",value:`${t?.resources?.requests.memory}/${t?.resources?.limits.memory}`,isLoading:n}]}];case nh.Node:return[{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${o?.resources?.requests.cpu}/${o?.resources?.limits.cpu}`,isLoading:n},{label:"Memory",value:`${o?.resources?.requests.memory}/${o?.resources?.limits.memory}`,isLoading:n}]}];default:return[]}})(o,n,a,i),[n,a,o,i]),f=r(()=>(o===nh.Gateway?n?.manifestYAML:a?.manifestYAML)??"",[n,a,o]),b=r(()=>(o===nh.Gateway?n?.configMapYAML:a?.configMapYAML)??"",[n,a,o]);return e(yt,{bgTint:"1000",moreSpacing:!0,richTitle:{icon:Qi,title:u,badge:p},actions:[{id:Ro(),type:Xt.ButtonDropData,buttonProps:{variant:ae.Secondary,size:ne.S,label:"View YAML",onClick:e=>d(e)},dropDataProps:{items:[{id:uh.ManifestYaml,label:u,icon:el},{id:uh.ConfigMapYaml,label:"ConfigMap",icon:el}]}}],children:[e(te,{$gap:16,children:[t("div",{children:t(Pa,{...h})}),m.map(e=>t(ph,{children:t("div",{children:t(La,{...e})})},e.title)),g.map(e=>t(_a,{...e},e.title))]}),t(ch,{isOpen:c===uh.ManifestYaml,onClose:()=>d(null),title:u,yaml:f}),t(ch,{isOpen:c===uh.ConfigMapYaml,onClose:()=>d(null),title:"ConfigMap",yaml:b})]})},mh=[{value:nh.Gateway,label:"Gateway"},{value:nh.Node,label:"Node Collector"}],gh=({minSupportedVersion:o=0,tableRowsMaxHeight:a,getGatewayInfo:i,getGatewayPods:s,getNodeCollectorInfo:d,getNodeCollectorPods:u,getExtendedPodInfo:p})=>{const{isVersionSupported:h,version:m}=y(o),[g,f]=l(!1),[b,v]=l(nh.Gateway),[C,S]=l(null),[w,x]=l([]),[k,T]=l(null),[$,I]=l([]),N=c(async()=>{f(!0);try{switch(b){case nh.Gateway:S(await i()??null),x(await s()??[]);break;case nh.Node:T(await d()??null),I(await u()??[])}}catch(e){}f(!1)},[b]);n(()=>{N()},[N]);const E=r(()=>b===nh.Gateway?w:$,[w,$,b]);return e(la,{children:[t(ah,{disabled:!h,loading:g,onClickDownloadDiagnose:void 0,onClickRefresh:N}),e(Ma,{children:[e(V,{children:[t(ue,{variant:ao.Underline,size:Ba.L,options:mh,selected:b,setSelected:v}),t(hh,{selectedTab:b,gatewayInfo:C,nodeCollectorInfo:k,isLoading:g})]}),t(rh,{isLoading:g,tableRowsMaxHeight:a,pods:E,getExtendedPodInfo:p}),!h&&t(yl,{minSupportedVersion:o,currentVersion:m||""})]})]})},fh=g.div`
778
778
  display: inline-flex;
779
779
  align-items: center;
780
780
  min-width: 0;
@@ -793,7 +793,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
793
793
  gap: 6px;
794
794
  align-items: center;
795
795
  min-height: 22px;
796
- `;const yh=[{key:"content",label:"Content",noSort:!0,noFilter:!0},{key:"badges",label:"Type",noSort:!0,noFilter:!0,flex:"0 0 128px"}],Ch=[{value:"all",label:Xa},{value:"Relevance",label:"Relevance"},{value:"Duration",label:"Duration"},{value:"Error",label:"Error"}],Sh=({title:o,items:n,isLoading:a,showTypeFilter:i,tableRowsMaxHeight:s,onRuleClick:d,onCreateRule:u,onEditRule:p,onDeleteRule:h})=>{const m=f(),[g,b]=l(""),[v,y]=l("all"),C=r(()=>{let e=function(e,t,o){return o&&"all"!==t?e.filter(e=>e.typeBadge===t):e}(n,v,i);return e=function(e,t){if(!t.trim())return e;const o=t.toLowerCase();return e.filter(e=>{const t=e.name?.toLowerCase().includes(o),n=e.summary.map(e=>e.text).join("").toLowerCase();return t||n.includes(o)})}(e,g),e},[n,v,i,g]),w=r(()=>C.map(o=>{const n=o.typeBadge?function(e,t){const o=e.v2.colors;switch(t){case"Relevance":return{bg:o.blue[700],text:o.white[500]};case"Duration":return{bg:o.purple[700],text:o.white[500]};case"Error":return{bg:o.red[500],text:o.black[500]}}}(m,o.typeBadge):void 0;return{cells:[{key:"content",rawValue:o.summary.map(e=>e.text).join(""),component:()=>e(bh,{$disabled:o.disabled,children:[t(fh,{children:t(S,{parts:o.summary})}),o.name&&t(re,{size:ce.XXS,color:Ce.Secondary,nowrap:!0,children:o.name})]})},{key:"badges",rawValue:o.typeBadge||"",component:()=>e(vh,{children:[o.disabled&&t(Ee,{label:Ba,textSize:ce.XXXS,backgroundColor:m.v2.colors.grey[700],textColor:m.v2.colors.grey[300]}),o.typeBadge&&n&&t(Ee,{label:o.typeBadge,textSize:ce.XXXS,backgroundColor:n.bg,textColor:n.text})]})}],onClick:()=>d(o)}}),[C,m,d]),x=r(()=>{const e=e=>t(ri,{...e,fill:m.v2.colors.red[500]});return e.displayName="RedDeleteIcon",e},[m]),k=c(e=>{const t=w.indexOf(e);if(t<0)return[];const o=C[t];return o?[{id:"edit","data-id":"sampling-rule-action-edit",label:ho,leftIcon:ci,onClick:()=>p(o.ruleId,o.samplingId)},{id:"delete","data-id":"sampling-rule-action-delete",label:"",leftIcon:x,onClick:()=>h(o.ruleId,o.samplingId)}]:[]},[w,C,p,h,x]);return t(Ue,{fullHeight:!0,richTitle:{icon:zi,title:o,badge:{label:n.length,backgroundColor:m.v2.colors.silver[600],textColor:m.v2.colors.white[500]}},search:{"data-id":"sampling-search-rules",value:g,onChange:b,placeholder:"Search..",width:"500px",...i?{segment:{"data-id":"sampling-segment-type-filter",options:Ch,selected:v,setSelected:y}}:{}},children:t(lo,{variant:so.Pretty,hideHeader:!0,maxHeight:s,isLoading:a,noDataProps:g.trim()?{hideIcon:!0,title:Va,subTitle:ja(g)}:{hideIcon:!0,title:Ha,button:{label:Ua,onClick:u}},columns:yh,rows:w,getRowActions:k})})},wh=({workloads:o,samplingRules:a,k8sHealthProbesConfig:i,loading:s,docsUrl:u,tableRowsMaxHeight:p,fetchSamplingRules:h,createNoisyOperationRule:m,updateNoisyOperationRule:g,createHighlyRelevantOperationRule:f,updateHighlyRelevantOperationRule:b,createCostReductionRule:v,updateCostReductionRule:y,deleteSamplingRule:C,updateK8sHealthProbesConfig:S})=>{const k=r(()=>o.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:`${e.namespace} / ${e.kind} / ${e.name}`})),[o]),X=r(()=>Array.from(new Set(o.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[o]),[U,H]=l(T.Noisy),[j,W]=l(null),[G,K]=l(!1),[Y,J]=l(!1),[q,Z]=l(null),[Q,ee]=l(!1),[ie,le]=l(!1),[se,re]=l(!1),[ce,de]=l(!1),pe=d(!1);n(()=>{pe.current||s||(pe.current=!0,0===a.length&&de(!0))},[s,a]);const he=r(()=>w(i),[i]),fe=r(()=>$(a),[a]),be=r(()=>x(fe?.rule??null),[fe]),ve=r(()=>I(a),[a]),ye=r(()=>N(ve?.rule??null),[ve]),Ce=d(j);Ce.current=j,n(()=>{const e=Ce.current;if(!e)return;const t=E(a,e);t?W(t):(W(null),K(!1))},[a]);const Se=r(()=>{const e=new Set;return fe&&e.add(fe.rule.ruleId),ve&&e.add(ve.rule.ruleId),e},[fe,ve]),we=r(()=>A(a,U,Se),[a,U,Se]),xe=c(()=>J(!0),[]),ke=c(()=>J(!1),[]),Te=c(()=>de(!1),[]),$e=c(async e=>{const t=a[0]?.id??"default";switch(L[U]){case"noisy":await m(t,R(e));break;case"highlyRelevant":await f(t,D(e));break;case"costReduction":await v(t,O(e))}J(!1)},[a,U,m,f,v]),Ie=c(e=>{const t=F(a,e);t&&(K(!1),W(t))},[a]),Ne=c(()=>{W(null),K(!1)},[]),Ee=c((e,t)=>{const o=j;if(o&&o.rule.ruleId===e&&o.samplingId===t)K(!0),W({...o});else for(const o of a){if(o.id!==t)continue;const n=[...o.noisyOperations.map(e=>({category:"noisy",rule:e})),...o.highlyRelevantOperations.map(e=>({category:"highlyRelevant",rule:e})),...o.costReductionRules.map(e=>({category:"costReduction",rule:e}))].find(t=>t.rule.ruleId===e);if(n)return K(!0),void W({category:n.category,rule:n.rule,samplingId:t,summary:P(n.category,n.rule)})}},[j,a]),Ae=c(async(e,t,o)=>{const n=j?.category;if(n){switch(n){case"noisy":await g(o,t,R(e));break;case"highlyRelevant":await b(o,t,D(e));break;case"costReduction":await y(o,t,O(e))}K(!1)}},[j,g,b,y]),Oe=c((e,t)=>{Z({ruleId:e,samplingId:t})},[]),Re=c(async()=>{if(!q)return;const{ruleId:e,samplingId:t}=q,o=j?.category||L[U];await C(t,e,o),W(null),K(!1),Z(null)},[q,j,U,C]),Fe=c(()=>Z(null),[]),Le=c(async(e,t)=>{await S(e,t),ee(!1)},[S]),_e=c(async e=>{const t=a[0]?.id??"default",o=fe;o?await b(o.samplingId,o.rule.ruleId,{name:o.rule.name,disabled:!e,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null,notes:o.rule.notes}):e&&await f(t,{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}),le(!1)},[a,fe,f,b]),ze=c(async(e,t)=>{const o=a[0]?.id??"default",n=ve;n?await y(n.samplingId,n.rule.ruleId,{name:n.rule.name,disabled:!e,sourceScopes:null,operation:null,percentageAtMost:t,notes:n.rule.notes}):e&&await v(o,{name:"Auto - Drop Traces Cluster-Wide",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:t}),re(!1)},[a,ve,v,y]),Xe=c(e=>{const t=L[U];let o=null;switch(t){case"noisy":{const n=R(e);o=_(a,t,{sourceScopes:n.sourceScopes,operation:n.operation});break}case"highlyRelevant":{const n=D(e);o=_(a,t,{sourceScopes:n.sourceScopes,operation:n.operation,error:n.error??!1,durationAtLeastMs:n.durationAtLeastMs});break}case"costReduction":{const n=O(e);o=_(a,t,{sourceScopes:n.sourceScopes,operation:n.operation});break}}return o?{message:Wa,ruleId:o}:null},[a,U]),Ve=c(e=>{const t=j?.category,o=j?.rule.ruleId;if(!t)return null;let n=null;switch(t){case"noisy":{const i=R(e);n=_(a,t,{sourceScopes:i.sourceScopes,operation:i.operation},o);break}case"highlyRelevant":{const i=D(e);n=_(a,t,{sourceScopes:i.sourceScopes,operation:i.operation,error:i.error??!1,durationAtLeastMs:i.durationAtLeastMs},o);break}case"costReduction":{const i=O(e);n=_(a,t,{sourceScopes:i.sourceScopes,operation:i.operation},o);break}}return n?{message:Wa,ruleId:n}:null},[a,j]),Ue=c(e=>{J(!1);for(const t of a){const o=[...t.noisyOperations.map(e=>({category:"noisy",rule:e})),...t.highlyRelevantOperations.map(e=>({category:"highlyRelevant",rule:e})),...t.costReductionRules.map(e=>({category:"costReduction",rule:e}))].find(t=>t.rule.ruleId===e);if(o)return K(!0),void W({category:o.category,rule:o.rule,samplingId:t.id,summary:P(o.category,o.rule)})}},[a]),He=r(()=>{const e=[];return u&&e.push({id:Ro(),type:Xt.Button,buttonProps:{"data-id":"sampling-btn-docs",label:Ga,leftIcon:ii,size:ne.S,variant:ae.Text,onClick:()=>window.open(u,"_blank")}}),e.push({id:Ro(),type:Xt.Button,buttonProps:{"data-id":"sampling-btn-refresh",label:Ka,leftIcon:$i,size:ne.S,variant:ae.Text,onClick:h,loading:s}}),e.push({id:Ro(),type:Xt.Button,buttonProps:{"data-id":"sampling-btn-create-rule",label:Ya,rightIcon:ai,size:ne.S,variant:ae.Primary,onClick:xe}}),e},[u,h,s,xe]);return e(la,{children:[e(te,{$gap:12,$justifyContent:"space-between",children:[t(Oa,{icon:zi,title:qa,subTitle:Ja}),t(Da,{actions:He})]}),e(V,{$gap:12,children:[t(ue,{variant:ao.Underline,size:za.L,options:M,selected:U,setSelected:H}),e(te,{$justifyContent:"space-between",children:[t(me,{status:ge.Default,message:z[U]}),u&&t(oe,{"data-id":"sampling-btn-docs-banner",label:"Docs",leftIcon:ii,size:ne.S,variant:ae.Text,onClick:()=>window.open(u,"_blank")})]}),U===T.Noisy?t(nl,{title:Be,summary:he,onEdit:()=>ee(!0)}):U===T.HighlyRelevant?t(nl,{title:Pe,summary:be,onEdit:()=>le(!0)}):U===T.CostReduction?t(nl,{title:Me,summary:ye,onEdit:()=>re(!0)}):null,t(Sh,{title:B[U],items:we,isLoading:s,showTypeFilter:U===T.HighlyRelevant,tableRowsMaxHeight:p,onRuleClick:Ie,onCreateRule:xe,onEditRule:Ee,onDeleteRule:Oe})]}),t(dd,{formType:$l.View,data:j,defaultEditMode:G,onClose:Ne,onDelete:Oe,onSaveEdit:Ae,sourceOptions:k,namespaceOptions:X,validateForm:Ve,onNavigateToDuplicate:Ue}),t(dd,{formType:$l.Create,isOpen:Y,category:L[U],onClose:ke,onSubmit:$e,sourceOptions:k,namespaceOptions:X,validateForm:Xe,onNavigateToDuplicate:Ue}),t(dd,{formType:$l.EditAutoNoisy,isOpen:Q,enabled:i?.enabled??!1,keepPercentage:i?.keepPercentage??0,onClose:()=>ee(!1),onSave:Le}),t(dd,{formType:$l.EditAutoHighlyRelevant,isOpen:ie,enabled:!!fe&&!fe.rule.disabled,onClose:()=>le(!1),onSave:_e}),t(dd,{formType:$l.EditAutoCostReduction,isOpen:se,enabled:!!ve&&!ve.rule.disabled,dropPercentage:ve?.rule.percentageAtMost??25,onClose:()=>re(!1),onSave:ze}),t(De,{title:ti,description:ei,isOpen:!!q,onClose:Fe,denyButton:{label:Qa,variant:ae.Secondary,onClick:Fe},approveButton:{label:Za,variant:ae.Primary,onClick:()=>{Re(),Fe()}}}),t(yu,{isOpen:ce,onClose:Te,k8sHealthProbesConfig:i,samplingId:a[0]?.id,docsUrl:u,updateK8sHealthProbesConfig:S,createHighlyRelevantOperationRule:f,createCostReductionRule:v})]})},xh=g.div`
796
+ `;const yh=[{key:"content",label:"Content",noSort:!0,noFilter:!0},{key:"badges",label:"Type",noSort:!0,noFilter:!0,flex:"0 0 128px"}],Ch=[{value:"all",label:Xa},{value:"Relevance",label:"Relevance"},{value:"Duration",label:"Duration"},{value:"Error",label:"Error"}],Sh=({title:o,items:n,isLoading:a,showTypeFilter:i,tableRowsMaxHeight:s,onRuleClick:d,onCreateRule:u,onEditRule:p,onDeleteRule:h})=>{const m=f(),[g,b]=l(""),[v,y]=l("all"),C=r(()=>{let e=function(e,t,o){return o&&"all"!==t?e.filter(e=>e.typeBadge===t):e}(n,v,i);return e=function(e,t){if(!t.trim())return e;const o=t.toLowerCase();return e.filter(e=>{const t=e.name?.toLowerCase().includes(o),n=e.summary.map(e=>e.text).join("").toLowerCase();return t||n.includes(o)})}(e,g),e},[n,v,i,g]),w=r(()=>C.map(o=>{const n=o.typeBadge?function(e,t){const o=e.v2.colors;switch(t){case"Relevance":return{bg:o.blue[700],text:o.white[500]};case"Duration":return{bg:o.purple[700],text:o.white[500]};case"Error":return{bg:o.red[500],text:o.black[500]}}}(m,o.typeBadge):void 0;return{cells:[{key:"content",rawValue:o.summary.map(e=>e.text).join(""),component:()=>e(bh,{$disabled:o.disabled,children:[t(fh,{children:t(S,{parts:o.summary})}),o.name&&t(re,{size:ce.XXS,color:Ce.Secondary,nowrap:!0,children:o.name})]})},{key:"badges",rawValue:o.typeBadge||"",component:()=>e(vh,{children:[o.disabled&&t(Ee,{label:za,textSize:ce.XXXS,backgroundColor:m.v2.colors.grey[700],textColor:m.v2.colors.grey[300]}),o.typeBadge&&n&&t(Ee,{label:o.typeBadge,textSize:ce.XXXS,backgroundColor:n.bg,textColor:n.text})]})}],onClick:()=>d(o)}}),[C,m,d]),x=r(()=>{const e=e=>t(ri,{...e,fill:m.v2.colors.red[500]});return e.displayName="RedDeleteIcon",e},[m]),k=c(e=>{const t=w.indexOf(e);if(t<0)return[];const o=C[t];return o?[{id:"edit","data-id":"sampling-rule-action-edit",label:ho,leftIcon:ci,onClick:()=>p(o.ruleId,o.samplingId)},{id:"delete","data-id":"sampling-rule-action-delete",label:"",leftIcon:x,onClick:()=>h(o.ruleId,o.samplingId)}]:[]},[w,C,p,h,x]);return t(Ue,{fullHeight:!0,richTitle:{icon:Bi,title:o,badge:{label:n.length,backgroundColor:m.v2.colors.silver[600],textColor:m.v2.colors.white[500]}},search:{"data-id":"sampling-search-rules",value:g,onChange:b,placeholder:"Search..",width:"500px",...i?{segment:{"data-id":"sampling-segment-type-filter",options:Ch,selected:v,setSelected:y}}:{}},children:t(lo,{variant:so.Pretty,hideHeader:!0,maxHeight:s,isLoading:a,noDataProps:g.trim()?{hideIcon:!0,title:Va,subTitle:ja(g)}:{hideIcon:!0,title:Ha,button:{label:Ua,onClick:u}},columns:yh,rows:w,getRowActions:k})})},wh=({workloads:o,samplingRules:a,k8sHealthProbesConfig:i,loading:s,docsUrl:u,tableRowsMaxHeight:p,fetchSamplingRules:h,createNoisyOperationRule:m,updateNoisyOperationRule:g,createHighlyRelevantOperationRule:f,updateHighlyRelevantOperationRule:b,createCostReductionRule:v,updateCostReductionRule:y,deleteSamplingRule:C,updateK8sHealthProbesConfig:S})=>{const k=r(()=>o.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:`${e.namespace} / ${e.kind} / ${e.name}`})),[o]),X=r(()=>Array.from(new Set(o.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[o]),[U,H]=l(T.Noisy),[j,W]=l(null),[G,K]=l(!1),[Y,J]=l(!1),[q,Z]=l(null),[Q,ee]=l(!1),[ie,le]=l(!1),[se,re]=l(!1),[ce,de]=l(!1),pe=d(!1);n(()=>{pe.current||s||(pe.current=!0,0===a.length&&de(!0))},[s,a]);const he=r(()=>w(i),[i]),fe=r(()=>$(a),[a]),be=r(()=>x(fe?.rule??null),[fe]),ve=r(()=>I(a),[a]),ye=r(()=>N(ve?.rule??null),[ve]),Ce=d(j);Ce.current=j,n(()=>{const e=Ce.current;if(!e)return;const t=E(a,e);t?W(t):(W(null),K(!1))},[a]);const Se=r(()=>{const e=new Set;return fe&&e.add(fe.rule.ruleId),ve&&e.add(ve.rule.ruleId),e},[fe,ve]),we=r(()=>A(a,U,Se),[a,U,Se]),xe=c(()=>J(!0),[]),ke=c(()=>J(!1),[]),Te=c(()=>de(!1),[]),$e=c(async e=>{const t=a[0]?.id??"default";switch(L[U]){case"noisy":await m(t,R(e));break;case"highlyRelevant":await f(t,D(e));break;case"costReduction":await v(t,O(e))}J(!1)},[a,U,m,f,v]),Ie=c(e=>{const t=F(a,e);t&&(K(!1),W(t))},[a]),Ne=c(()=>{W(null),K(!1)},[]),Ee=c((e,t)=>{const o=j;if(o&&o.rule.ruleId===e&&o.samplingId===t)K(!0),W({...o});else for(const o of a){if(o.id!==t)continue;const n=[...o.noisyOperations.map(e=>({category:"noisy",rule:e})),...o.highlyRelevantOperations.map(e=>({category:"highlyRelevant",rule:e})),...o.costReductionRules.map(e=>({category:"costReduction",rule:e}))].find(t=>t.rule.ruleId===e);if(n)return K(!0),void W({category:n.category,rule:n.rule,samplingId:t,summary:P(n.category,n.rule)})}},[j,a]),Ae=c(async(e,t,o)=>{const n=j?.category;if(n){switch(n){case"noisy":await g(o,t,R(e));break;case"highlyRelevant":await b(o,t,D(e));break;case"costReduction":await y(o,t,O(e))}K(!1)}},[j,g,b,y]),Oe=c((e,t)=>{Z({ruleId:e,samplingId:t})},[]),Re=c(async()=>{if(!q)return;const{ruleId:e,samplingId:t}=q,o=j?.category||L[U];await C(t,e,o),W(null),K(!1),Z(null)},[q,j,U,C]),Fe=c(()=>Z(null),[]),Le=c(async(e,t)=>{await S(e,t),ee(!1)},[S]),_e=c(async e=>{const t=a[0]?.id??"default",o=fe;o?await b(o.samplingId,o.rule.ruleId,{name:o.rule.name,disabled:!e,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null,notes:o.rule.notes}):e&&await f(t,{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}),le(!1)},[a,fe,f,b]),Be=c(async(e,t)=>{const o=a[0]?.id??"default",n=ve;n?await y(n.samplingId,n.rule.ruleId,{name:n.rule.name,disabled:!e,sourceScopes:null,operation:null,percentageAtMost:t,notes:n.rule.notes}):e&&await v(o,{name:"Auto - Drop Traces Cluster-Wide",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:t}),re(!1)},[a,ve,v,y]),Xe=c(e=>{const t=L[U];let o=null;switch(t){case"noisy":{const n=R(e);o=_(a,t,{sourceScopes:n.sourceScopes,operation:n.operation});break}case"highlyRelevant":{const n=D(e);o=_(a,t,{sourceScopes:n.sourceScopes,operation:n.operation,error:n.error??!1,durationAtLeastMs:n.durationAtLeastMs});break}case"costReduction":{const n=O(e);o=_(a,t,{sourceScopes:n.sourceScopes,operation:n.operation});break}}return o?{message:Wa,ruleId:o}:null},[a,U]),Ve=c(e=>{const t=j?.category,o=j?.rule.ruleId;if(!t)return null;let n=null;switch(t){case"noisy":{const i=R(e);n=_(a,t,{sourceScopes:i.sourceScopes,operation:i.operation},o);break}case"highlyRelevant":{const i=D(e);n=_(a,t,{sourceScopes:i.sourceScopes,operation:i.operation,error:i.error??!1,durationAtLeastMs:i.durationAtLeastMs},o);break}case"costReduction":{const i=O(e);n=_(a,t,{sourceScopes:i.sourceScopes,operation:i.operation},o);break}}return n?{message:Wa,ruleId:n}:null},[a,j]),Ue=c(e=>{J(!1);for(const t of a){const o=[...t.noisyOperations.map(e=>({category:"noisy",rule:e})),...t.highlyRelevantOperations.map(e=>({category:"highlyRelevant",rule:e})),...t.costReductionRules.map(e=>({category:"costReduction",rule:e}))].find(t=>t.rule.ruleId===e);if(o)return K(!0),void W({category:o.category,rule:o.rule,samplingId:t.id,summary:P(o.category,o.rule)})}},[a]),He=r(()=>{const e=[];return u&&e.push({id:Ro(),type:Xt.Button,buttonProps:{"data-id":"sampling-btn-docs",label:Ga,leftIcon:ii,size:ne.S,variant:ae.Text,onClick:()=>window.open(u,"_blank")}}),e.push({id:Ro(),type:Xt.Button,buttonProps:{"data-id":"sampling-btn-refresh",label:Ka,leftIcon:$i,size:ne.S,variant:ae.Text,onClick:h,loading:s}}),e.push({id:Ro(),type:Xt.Button,buttonProps:{"data-id":"sampling-btn-create-rule",label:Ya,rightIcon:ai,size:ne.S,variant:ae.Primary,onClick:xe}}),e},[u,h,s,xe]);return e(la,{children:[e(te,{$gap:12,$justifyContent:"space-between",children:[t(Oa,{icon:Bi,title:qa,subTitle:Ja}),t(Da,{actions:He})]}),e(V,{$gap:12,children:[t(ue,{variant:ao.Underline,size:Ba.L,options:M,selected:U,setSelected:H}),e(te,{$justifyContent:"space-between",children:[t(me,{status:ge.Default,message:B[U]}),u&&t(oe,{"data-id":"sampling-btn-docs-banner",label:"Docs",leftIcon:ii,size:ne.S,variant:ae.Text,onClick:()=>window.open(u,"_blank")})]}),U===T.Noisy?t(nl,{title:ze,summary:he,onEdit:()=>ee(!0)}):U===T.HighlyRelevant?t(nl,{title:Pe,summary:be,onEdit:()=>le(!0)}):U===T.CostReduction?t(nl,{title:Me,summary:ye,onEdit:()=>re(!0)}):null,t(Sh,{title:z[U],items:we,isLoading:s,showTypeFilter:U===T.HighlyRelevant,tableRowsMaxHeight:p,onRuleClick:Ie,onCreateRule:xe,onEditRule:Ee,onDeleteRule:Oe})]}),t(dd,{formType:$l.View,data:j,defaultEditMode:G,onClose:Ne,onDelete:Oe,onSaveEdit:Ae,sourceOptions:k,namespaceOptions:X,validateForm:Ve,onNavigateToDuplicate:Ue}),t(dd,{formType:$l.Create,isOpen:Y,category:L[U],onClose:ke,onSubmit:$e,sourceOptions:k,namespaceOptions:X,validateForm:Xe,onNavigateToDuplicate:Ue}),t(dd,{formType:$l.EditAutoNoisy,isOpen:Q,enabled:i?.enabled??!1,keepPercentage:i?.keepPercentage??0,onClose:()=>ee(!1),onSave:Le}),t(dd,{formType:$l.EditAutoHighlyRelevant,isOpen:ie,enabled:!!fe&&!fe.rule.disabled,onClose:()=>le(!1),onSave:_e}),t(dd,{formType:$l.EditAutoCostReduction,isOpen:se,enabled:!!ve&&!ve.rule.disabled,dropPercentage:ve?.rule.percentageAtMost??25,onClose:()=>re(!1),onSave:Be}),t(De,{title:ti,description:ei,isOpen:!!q,onClose:Fe,denyButton:{label:Qa,variant:ae.Secondary,onClick:Fe},approveButton:{label:Za,variant:ae.Primary,onClick:()=>{Re(),Fe()}}}),t(yu,{isOpen:ce,onClose:Te,k8sHealthProbesConfig:i,samplingId:a[0]?.id,docsUrl:u,updateK8sHealthProbesConfig:S,createHighlyRelevantOperationRule:f,createCostReductionRule:v})]})},xh=g.div`
797
797
  display: flex;
798
798
  align-items: center;
799
799
  justify-content: space-between;
@@ -808,4 +808,4 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
808
808
  min-height: 0;
809
809
  height: 100%;
810
810
  overflow-y: auto;
811
- `,Ih=e=>"general"===e.name?0:"advanced"===e.name?2:1,Nh=({minSupportedVersion:o=0,pageHeightOffset:a=0,configYamls:i,configYamlsLoading:s,effectiveConfig:c,effectiveConfigLoading:d,refetch:u,factoryReset:p,onSave:h,saveLoading:m})=>{const{isVersionSupported:g,version:f,isEnterprise:b}=y(o),v=r(()=>{if(!c)return{};const{manifestYAML:e,provenance:t,...o}=c;return o},[c]),{formData:C,handleFormChange:S,getNestedValue:w,getFormDiff:x,isFormDirty:k}=wt(v);n(()=>{"{}"!==JSON.stringify(v)&&"{}"===JSON.stringify(C)&&S(void 0,void 0,v)},[v,C]);const T=r(()=>[...i].sort((e,t)=>Ih(e)-Ih(t)),[i]),$=r(()=>(e=>{if(!e)return{};const t={};for(const o of e)t[o.helmPath]=o.reconciledFrom;return t})(c?.provenance),[c?.provenance]),I=r(()=>{const e=new Set;for(const t of i)for(const o of t.fields)o.componentType===ie.Dropdown&&e.add(o.helmValuePath);return e},[i]),N=r(()=>i.flatMap(e=>e.fields.map(e=>({name:e.helmValuePath,value:w("formData",e.helmValuePath)}))),[i,C,w]),[E,A]=l(!1),O=async()=>{const e=((e,t)=>{const o=(e,t,o)=>{for(let o=0;o<t.length-1;o++){const n=t[o];n in e&&"object"==typeof e[n]&&null!==e[n]||(e[n]={}),e=e[n]}e[t[t.length-1]]=o},n=JSON.parse(JSON.stringify(e));for(const e of t){const t=e.split(".");let a=n;for(const e of t){if(null==a||"object"!=typeof a){a=void 0;break}a=a[e]}"string"==typeof a&&o(n,t,a.replaceAll("-","_"))}return n})(x(v,C),I);await(h?.(e)),S(void 0,void 0,{})},D=r(()=>[{id:Ro(),type:Xt.Button,buttonProps:{"data-id":"settings-save",variant:ae.Primary,size:ne.S,label:"Save Changes",leftIcon:bi,loading:m,onClick:()=>A(!0)}},{id:Ro(),type:Xt.Button,buttonProps:{"data-id":"settings-cancel",variant:ae.Secondary,size:ne.S,label:"Cancel",leftIcon:vi,onClick:()=>S(void 0,void 0,v)}}],[m,x,v,C,S]),R=r(()=>T.map(e=>({id:e.name,label:e.displayName})),[T]),F=r(()=>T.map(e=>e.name),[T]),{selectedSection:P,setSelectedSection:L,setSectionRef:_,setScrollContainerRef:M}=oi({sectionNames:F});return e(la,{$heightOffset:a,$gap:12,children:[t(kh,{disabled:!g,loading:s||d,tabs:R,selectedTab:P,setSelectedTab:L,onClickReset:p?()=>p().then(()=>u?.()):void 0,onClickRefresh:u?()=>u():void 0}),e(Ma,{children:[!g&&t(yl,{minSupportedVersion:o,currentVersion:f||""}),t(sa,{isOpen:k,richTitle:{icon:wi,title:"Config Settings"},actions:D}),t(De,{isOpen:E,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:()=>A(!1),denyButton:{label:"Keep editing",variant:ae.Secondary,onClick:()=>A(!1)},approveButton:{label:"Save changes",variant:ae.Primary,onClick:()=>{O(),A(!1)}}}),e(Th,{$gap:24,$alignItems:"stretch",children:[t($h,{ref:M,$gap:24,$width:"100%",children:i.length?T.map(o=>t(Ue,{id:o.name,ref:e=>_(o.name,e),richTitle:{icon:wi,title:o.displayName},children:o.fields.map(o=>{if(o.isEnterpriseOnly&&!b)return null;if(o.renderCondition&&!he(o.renderCondition,[],N))return null;const n=nt(o.componentProps||"{}",{}),a=$[o.helmValuePath];return e(V,{$gap:4,children:[t(ol,{componentType:o.componentType,inputType:n.type,name:o.helmValuePath,label:o.displayName,tooltip:o.description,badge:a?{status:"odigos-local-ui-config"===a?ge.Warning:st.Unknown,label:a,tooltip:`This field is reconciled from the following resource: ${a}`}:void 0,disabled:o.isHelmOnly||m,value:w("formData",o.helmValuePath),setValue:e=>S(o.helmValuePath,e),dropdownOptions:n.options?.map(e=>({id:e,label:e})),dropdownNoSearch:!0,dropdownNoCheckbox:!0},o.helmValuePath),o.isHelmOnly?t(me,{status:ge.Info,smallIcon:!0,message:"This field can only be updated via Helm values.yaml file"}):null]},o.helmValuePath)})},o.name)):s?t(Ke,{$height:"30vh",children:t(Qe,{withSpinner:!0})}):t(Ue,{richTitle:{icon:wi,title:"Config Settings"},children:t(se,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})}),t($h,{children:d&&!c?.manifestYAML?t(Ke,{$height:"30vh",children:t(Qe,{withSpinner:!0})}):t(fl,{title:"Effective Config YAML",yaml:c?.manifestYAML?.replaceAll(" |",""),defaultOpen:!0,fullHeight:!0})})]})]})]})};export{$s as AddActionDrawer,Zl as AddActionForm,Cd as AddDataStreamModal,Ls as AddDestinationDrawer,ts as AddDestinationForm,_s as AddRuleDrawer,cs as AddRuleForm,nr as AddSourceDrawer,Tu as CentralConnections,us as DataStreamForm,ds as DataStreamMergeWarning,ar as EditActionDrawer,ir as EditConfigDrawer,Sd as EditDataStreamModal,lr as EditDestinationDrawer,sr as EditRuleDrawer,qc as EditSourceDrawer,ps as EditSourceForm,kd as ONBOARDING_DONE_MODAL_ID,zu as Onboarding,Td as OnboardingDone,oh as Overview,gh as PipelineCollectors,yu as SamplingOnboardingModal,dd as SamplingRuleDrawer,vs as SamplingRuleForm,wh as SamplingRules,Nh as Settings,yd as SystemDrawer,mh as TABS};
811
+ `,Ih=e=>"general"===e.name?0:"advanced"===e.name?2:1,Nh=({minSupportedVersion:o=0,pageHeightOffset:a=0,configYamls:i,configYamlsLoading:s,effectiveConfig:c,effectiveConfigLoading:d,refetch:u,factoryReset:p,onSave:h,saveLoading:m})=>{const{isVersionSupported:g,version:f,isEnterprise:b}=y(o),v=r(()=>{if(!c)return{};const{manifestYAML:e,provenance:t,...o}=c;return o},[c]),{formData:C,handleFormChange:S,getNestedValue:w,getFormDiff:x,isFormDirty:k}=wt(v);n(()=>{"{}"!==JSON.stringify(v)&&"{}"===JSON.stringify(C)&&S(void 0,void 0,v)},[v,C]);const T=r(()=>[...i].sort((e,t)=>Ih(e)-Ih(t)),[i]),$=r(()=>(e=>{if(!e)return{};const t={};for(const o of e)t[o.helmPath]=o.reconciledFrom;return t})(c?.provenance),[c?.provenance]),I=r(()=>{const e=new Set;for(const t of i)for(const o of t.fields)o.componentType===ie.Dropdown&&e.add(o.helmValuePath);return e},[i]),N=r(()=>i.flatMap(e=>e.fields.map(e=>({name:e.helmValuePath,value:w("formData",e.helmValuePath)}))),[i,C,w]),[E,A]=l(!1),O=async()=>{const e=((e,t)=>{const o=(e,t,o)=>{for(let o=0;o<t.length-1;o++){const n=t[o];n in e&&"object"==typeof e[n]&&null!==e[n]||(e[n]={}),e=e[n]}e[t[t.length-1]]=o},n=JSON.parse(JSON.stringify(e));for(const e of t){const t=e.split(".");let a=n;for(const e of t){if(null==a||"object"!=typeof a){a=void 0;break}a=a[e]}"string"==typeof a&&o(n,t,a.replaceAll("-","_"))}return n})(x(v,C),I);await(h?.(e)),S(void 0,void 0,{})},D=r(()=>[{id:Ro(),type:Xt.Button,buttonProps:{"data-id":"settings-save",variant:ae.Primary,size:ne.S,label:"Save Changes",leftIcon:bi,loading:m,onClick:()=>A(!0)}},{id:Ro(),type:Xt.Button,buttonProps:{"data-id":"settings-cancel",variant:ae.Secondary,size:ne.S,label:"Cancel",leftIcon:vi,onClick:()=>S(void 0,void 0,v)}}],[m,x,v,C,S]),R=r(()=>T.map(e=>({id:e.name,label:e.displayName})),[T]),F=r(()=>T.map(e=>e.name),[T]),{selectedSection:P,setSelectedSection:L,setSectionRef:_,setScrollContainerRef:M}=oi({sectionNames:F});return e(la,{$heightOffset:a,$gap:12,children:[t(kh,{disabled:!g,loading:s||d,tabs:R,selectedTab:P,setSelectedTab:L,onClickReset:p?()=>p().then(()=>u?.()):void 0,onClickRefresh:u?()=>u():void 0}),e(Ma,{children:[!g&&t(yl,{minSupportedVersion:o,currentVersion:f||""}),t(sa,{isOpen:k,richTitle:{icon:wi,title:"Config Settings"},actions:D}),t(De,{isOpen:E,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:()=>A(!1),denyButton:{label:"Keep editing",variant:ae.Secondary,onClick:()=>A(!1)},approveButton:{label:"Save changes",variant:ae.Primary,onClick:()=>{O(),A(!1)}}}),e(Th,{$gap:24,$alignItems:"stretch",children:[t($h,{ref:M,$gap:24,$width:"100%",children:i.length?T.map(o=>t(Ue,{id:o.name,ref:e=>_(o.name,e),richTitle:{icon:wi,title:o.displayName},children:o.fields.map(o=>{if(o.isEnterpriseOnly&&!b)return null;if(o.renderCondition&&!he(o.renderCondition,[],N))return null;const n=nt(o.componentProps||"{}",{}),a=$[o.helmValuePath];return e(V,{$gap:4,children:[t(ol,{componentType:o.componentType,inputType:n.type,name:o.helmValuePath,label:o.displayName,tooltip:o.description,badge:a?{status:"odigos-local-ui-config"===a?ge.Warning:st.Unknown,label:a,tooltip:`This field is reconciled from the following resource: ${a}`}:void 0,disabled:o.isHelmOnly||m,value:w("formData",o.helmValuePath),setValue:e=>S(o.helmValuePath,e),dropdownOptions:n.options?.map(e=>({id:e,label:e})),dropdownNoSearch:!0,dropdownNoCheckbox:!0},o.helmValuePath),o.isHelmOnly?t(me,{status:ge.Info,smallIcon:!0,message:"This field can only be updated via Helm values.yaml file"}):null]},o.helmValuePath)})},o.name)):s?t(Ke,{$height:"30vh",children:t(Qe,{withSpinner:!0})}):t(Ue,{richTitle:{icon:wi,title:"Config Settings"},children:t(se,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})}),t($h,{children:d&&!c?.manifestYAML?t(Ke,{$height:"30vh",children:t(Qe,{withSpinner:!0})}):t(fl,{title:"Effective Config YAML",yaml:c?.manifestYAML?.replaceAll(" |",""),defaultOpen:!0,fullHeight:!0})})]})]})]})};export{$s as AddActionDrawer,Zl as AddActionForm,Cd as AddDataStreamModal,Ls as AddDestinationDrawer,ts as AddDestinationForm,_s as AddRuleDrawer,cs as AddRuleForm,nr as AddSourceDrawer,Tu as CentralConnections,us as DataStreamForm,ds as DataStreamMergeWarning,ar as EditActionDrawer,ir as EditConfigDrawer,Sd as EditDataStreamModal,lr as EditDestinationDrawer,sr as EditRuleDrawer,qc as EditSourceDrawer,ps as EditSourceForm,kd as ONBOARDING_DONE_MODAL_ID,Bu as Onboarding,Td as OnboardingDone,oh as Overview,gh as PipelineCollectors,yu as SamplingOnboardingModal,dd as SamplingRuleDrawer,vs as SamplingRuleForm,wh as SamplingRules,Nh as Settings,yd as SystemDrawer,mh as TABS};