@odigos/ui-kit 0.0.209 → 0.0.211

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/containers.js CHANGED
@@ -1,4 +1,4 @@
1
- import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState as n,useEffect as o,Fragment as a,forwardRef as r,useRef as l,useImperativeHandle as s,useMemo as c,useCallback as d,Children as u}from"react";import p,{css as h,useTheme as m}from"styled-components";import{a5 as g,aT as y,l as v,K as f,A as b,aU as x,aV as $,aW as S,aX as C,c as k,i as w,aY as D,aZ as T,a_ as N,a$ as E,D as A,F,g as O,b0 as I,b1 as M,k as R,b2 as P,a1 as L,b3 as K,b4 as j,b5 as z,b6 as q,b7 as B,b8 as V,at as H,aF as W,b9 as _,ba as J,bb as U,aq as G,ax as Y,bc as X,bd as Z,be as Q,bf as ee,bg as te,bh as ie,bi as ne,af as oe,bj as ae,bk as re,bl as le,bm as se,bn as ce,s as de,a6 as ue,bo as pe,bp as he,bq as me,br as ge,bs as ye,bt as ve,O as fe,bu as be,bv as xe,bw as $e,bx as Se,by as Ce,bz as ke,bA as we,bB as De,bC as Te,bD as Ne,bE as Ee,bF as Ae,n as Fe,bG as Oe,bH as Ie,bI as Me,bJ as Re,aL as Pe,bK as Le,bL as Ke,bM as je,bN as ze,S as qe,H as Be,bO as Ve,bP as He,ab as We,bQ as _e,ao as Je,ar as Ue,bR as Ge,ad as Ye,bS as Xe,bT as Ze,bU as Qe,bV as et,bW as tt,bX as it,bY as nt,bZ as ot,b_ as at,b$ as rt,c0 as lt,c1 as st,c2 as ct,$ as dt,M as ut,c3 as pt,c4 as ht,c5 as mt,c6 as gt,ap as yt,c7 as vt,c8 as ft,c9 as bt,ca as xt,x as $t,z as St,G as Ct,cb as kt,cc as wt,cd as Dt,E as Tt,a9 as Nt,m as Et,aa as At,ce as Ft,cf as Ot,cg as It,ch as Mt,P as Rt,X as Pt,Y as Lt,U as Kt,J as jt,Q as zt,Z as qt,ci as Bt,a0 as Vt,cj as Ht,ck as Wt,ae as _t,aj as Jt,cl as Ut,cm as Gt,cn as Yt,au as Xt,co as Zt,cp as Qt,cq as ei,ah as ti,cr as ii,cs as ni,ct as oi,cu as ai,cv as ri,cw as li,cx as si,cy as ci,aC as di,cz as ui,cA as pi,cB as hi,cC as mi,cD as gi,cE as yi,cF as vi,cG as fi,cH as bi,cI as xi,av as $i,as as Si,a4 as Ci,a8 as ki,cJ as wi,cK as Di,cL as Ti,cM as Ni,cN as Ei,cO as Ai}from"./chunks/ui-components-CwVshImz.js";import{TrashIcon as Fi,VSquareIcon as Oi,XSquareIcon as Ii,EditIcon as Mi,OdigosLogoText as Ri,PlusIcon as Pi,RefreshIcon as Li,SearchIcon as Ki,FilterIcon as ji,DataStreamIcon as zi,VIcon as qi,OdigosLogo as Bi,ArrowIcon as Vi,RefreshLeftArrowIcon as Hi,NotificationIcon as Wi,UserIcon as _i,ImageErrorIcon as Ji,OverviewIcon as Ui,SourceIcon as Gi,DestinationIcon as Yi,InstrumentationRuleIcon as Xi,ActionIcon as Zi,SlackLogo as Qi,KeyIcon as en,TerminalIcon as tn,ExclamationTriangleIcon as nn,TraceViewIcon as on}from"./icons.js";import{MarkerType as an,useNodesState as rn,useEdgesState as ln}from"@xyflow/react";import{E as sn}from"./chunks/vendor-D99eCWta.js";import{Y as cn}from"./chunks/index-pLAVCKXo.js";import"zustand";import"javascript-time-ago";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";const dn=e=>{const{type:t,name:i,notes:n,signals:o,disabled:a,fields:{collectContainerAttributes:r,collectReplicaSetAttributes:l,collectWorkloadId:s,collectClusterId:c,labelsAttributes:d,annotationsAttributes:u,clusterAttributes:p,overwriteExistingValues:h,attributeNamesToDelete:m,renames:b,piiCategories:x,fallbackSamplingRatio:$,samplingPercentage:S,endpointsFilters:C,servicesNameFilters:k,attributeFilters:w,urlTemplatizationRulesGroups:D}}=e,T=[{title:g.TYPE,value:t},{type:y.ActiveStatus,title:g.STATUS,value:String(!a)},{type:y.Monitors,title:g.SIGNALS_FOR_PROCESSING,value:o?.join(", ")||""},{title:g.NAME,value:i||""},{title:g.NOTES,value:n||""},{type:y.Divider}];if(t===v.K8sAttributes&&(T.push({title:"Collect Container Attributes",value:String(r)}),T.push({title:"Collect ReplicaSet Attributes",value:String(l)}),T.push({title:"Collect Workload ID",value:String(s)}),T.push({title:"Collect Cluster ID",value:String(c)}),d?.length&&T.push({type:y.Divider}),d?.forEach(({labelKey:e,attributeKey:t,from:i,fromSources:n},o)=>{let a="";a+=`Label Key: ${e}\n`,a+=`Attribute Key: ${t}\n`,a+=`From: ${n?.length?n.join(", "):i||f.Pod}\n`,T.push({title:"Label"+(d.length>1?` #${o+1}`:""),value:a})}),u?.length&&T.push({type:y.Divider}),u?.forEach(({annotationKey:e,attributeKey:t,from:i,fromSources:n},o)=>{let a="";a+=`Annotation Key: ${e}\n`,a+=`Attribute Key: ${t}\n`,a+=`From: ${n?.length?n.join(", "):i||f.Pod}\n`,T.push({title:"Annotation"+(u.length>1?` #${o+1}`:""),value:a})})),t===v.AddClusterInfo){T.push({title:"Overwrite Existing Values",value:String(h||!1)});let e="";p?.forEach(({attributeName:t,attributeStringValue:i},n)=>{e+=`${t}: ${i}`,n<p.length-1&&(e+=", ")}),T.push({title:"Attributes",value:e})}if(t===v.DeleteAttributes){let e="";m?.forEach((t,i)=>{e+=t,i<m.length-1&&(e+=", ")}),T.push({title:"Attributes",value:e})}if(t===v.RenameAttributes){let e="";const t=Object.entries(b||{});t.forEach(([i,n],o)=>{e+=`${i}: ${n}`,o<t.length-1&&(e+=", ")}),T.push({title:"Attributes",value:e})}if(t===v.PiiMasking){let e="";x?.forEach((t,i)=>{e+=t,i<x.length-1&&(e+=", ")}),T.push({title:"Categories",value:e})}return t===v.ErrorSampler&&T.push({title:"Sampling Ratio",value:String($)}),t===v.ProbabilisticSampler&&T.push({title:"Sampling Percentage",value:String(S)}),t===v.LatencySampler&&C?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:i,fallbackSamplingRatio:n},o)=>{let a="";a+=`Service Name: ${e}\n`,a+=`HTTP Route: ${t}\n`,a+=`Min. Latency: ${i}\n`,a+=`Fallback Sampling Ratio: ${n}`,T.push({title:"Endpoint"+(C.length>1?` #${o+1}`:""),value:a})}),t===v.ServiceNameSampler&&k?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:i},n)=>{let o="";o+=`Service Name: ${e}\n`,o+=`Sampling Ratio: ${t}\n`,o+=`Fallback Sampling Ratio: ${i}`,T.push({title:"Filter"+(k.length>1?` #${n+1}`:""),value:o})}),t===v.SpanAttributeSampler&&w?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:i,condition:n},o)=>{let a="";a+=`Service Name: ${e}\n`,a+=`Attribute Key: ${t}\n`,a+=`Fallback Sampling Ratio: ${i}\n`;const r=Object.keys(n)[0];a+=`Condition: ${r}\n`,a+=`Operation: ${n[r]?.operation}\n`,a+=`Expected Value: ${n[r]?.expectedValue}`,"jsonCondition"===r&&(a+=`\nJSON Path: ${n[r].jsonPath}`),T.push({title:"Filter"+(w.length>1?` #${o+1}`:""),value:a})}),t===v.URLTemplatization&&D?.forEach((e,t)=>{let i="";e.filterK8sNamespace&&(i+=`Namespace: ${e.filterK8sNamespace}\n`),e.workloadFilters?.length&&e.workloadFilters.forEach(e=>{const t=[e.kind,e.name].filter(Boolean).join("/");t&&(i+=`Workload: ${t}\n`)});const n=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");i+=`Templates: ${n}`,e.notes&&(i+=`\nNotes: ${e.notes}`),T.push({title:"Group"+(D.length>1?` #${t+1}`:""),value:i})}),T},un=b.PiiCategories,pn=p.div`
1
+ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState as n,useEffect as o,Fragment as a,forwardRef as r,useRef as l,useImperativeHandle as s,useMemo as c,useCallback as d,Children as u}from"react";import p,{css as h,useTheme as m}from"styled-components";import{a5 as g,aT as y,l as v,K as f,A as b,aU as x,aV as S,aW as $,aX as C,c as k,i as w,aY as N,aZ as T,a_ as D,a$ as E,D as A,F as O,g as F,b0 as I,b1 as M,k as R,b2 as K,a1 as P,b3 as L,b4 as z,b5 as j,b6 as q,b7 as V,b8 as B,at as H,aF as W,b9 as _,ba as J,bb as U,aq as G,ax as Y,bc as X,bd as Z,be as Q,bf as ee,bg as te,bh as ie,bi as ne,af as oe,bj as ae,bk as re,bl as le,bm as se,bn as ce,s as de,a6 as ue,bo as pe,bp as he,bq as me,br as ge,bs as ye,bt as ve,O as fe,bu as be,bv as xe,bw as Se,bx as $e,by as Ce,bz as ke,bA as we,bB as Ne,bC as Te,bD as De,bE as Ee,bF as Ae,n as Oe,bG as Fe,bH as Ie,bI as Me,bJ as Re,aL as Ke,bK as Pe,bL as Le,bM as ze,bN as je,S as qe,H as Ve,bO as Be,bP as He,ab as We,bQ as _e,ao as Je,ar as Ue,bR as Ge,ad as Ye,bS as Xe,bT as Ze,bU as Qe,bV as et,bW as tt,bX as it,bY as nt,bZ as ot,b_ as at,b$ as rt,c0 as lt,c1 as st,c2 as ct,$ as dt,M as ut,c3 as pt,c4 as ht,c5 as mt,c6 as gt,ap as yt,c7 as vt,c8 as ft,c9 as bt,ca as xt,x as St,z as $t,G as Ct,cb as kt,cc as wt,cd as Nt,E as Tt,a9 as Dt,m as Et,aa as At,ce as Ot,cf as Ft,cg as It,ch as Mt,P as Rt,X as Kt,Y as Pt,U as Lt,J as zt,Q as jt,Z as qt,ci as Vt,a0 as Bt,cj as Ht,ck as Wt,ae as _t,aj as Jt,cl as Ut,cm as Gt,cn as Yt,au as Xt,co as Zt,cp as Qt,o as ei,cq as ti,cr as ii,ah as ni,cs as oi,ct as ai,cu as ri,cv as li,cw as si,cx as ci,cy as di,cz as ui,aC as pi,cA as hi,cB as mi,cC as gi,cD as yi,cE as vi,cF as fi,cG as bi,cH as xi,cI as Si,cJ as $i,av as Ci,as as ki,a4 as wi,a8 as Ni,cK as Ti,cL as Di,cM as Ei,cN as Ai,cO as Oi,cP as Fi}from"./chunks/ui-components-B5U474B5.js";import{TrashIcon as Ii,VSquareIcon as Mi,XSquareIcon as Ri,EditIcon as Ki,OdigosLogoText as Pi,PlusIcon as Li,RefreshIcon as zi,SearchIcon as ji,FilterIcon as qi,DataStreamIcon as Vi,VIcon as Bi,OdigosLogo as Hi,ArrowIcon as Wi,RefreshLeftArrowIcon as _i,NotificationIcon as Ji,UserIcon as Ui,DestinationIcon as Gi,ImageErrorIcon as Yi,ChevronDownIcon as Xi,ChevronRightIcon as Zi,OverviewIcon as Qi,SourceIcon as en,InstrumentationRuleIcon as tn,ActionIcon as nn,SlackLogo as on,KeyIcon as an,TerminalIcon as rn,ExclamationTriangleIcon as ln,TraceViewIcon as sn}from"./icons.js";import{MarkerType as cn,useNodesState as dn,useEdgesState as un}from"@xyflow/react";import{E as pn}from"./chunks/vendor-D99eCWta.js";import{Y as hn}from"./chunks/index-BURQQLWb.js";import"zustand";import"javascript-time-ago";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";const mn=e=>{const{type:t,name:i,notes:n,signals:o,disabled:a,fields:{collectContainerAttributes:r,collectReplicaSetAttributes:l,collectWorkloadId:s,collectClusterId:c,labelsAttributes:d,annotationsAttributes:u,clusterAttributes:p,overwriteExistingValues:h,attributeNamesToDelete:m,renames:b,piiCategories:x,fallbackSamplingRatio:S,samplingPercentage:$,endpointsFilters:C,servicesNameFilters:k,attributeFilters:w,urlTemplatizationRulesGroups:N}}=e,T=[{title:g.TYPE,value:t},{type:y.ActiveStatus,title:g.STATUS,value:String(!a)},{type:y.Monitors,title:g.SIGNALS_FOR_PROCESSING,value:o?.join(", ")||""},{title:g.NAME,value:i||""},{title:g.NOTES,value:n||""},{type:y.Divider}];if(t===v.K8sAttributes&&(T.push({title:"Collect Container Attributes",value:String(r)}),T.push({title:"Collect ReplicaSet Attributes",value:String(l)}),T.push({title:"Collect Workload ID",value:String(s)}),T.push({title:"Collect Cluster ID",value:String(c)}),d?.length&&T.push({type:y.Divider}),d?.forEach(({labelKey:e,attributeKey:t,from:i,fromSources:n},o)=>{let a="";a+=`Label Key: ${e}\n`,a+=`Attribute Key: ${t}\n`,a+=`From: ${n?.length?n.join(", "):i||f.Pod}\n`,T.push({title:"Label"+(d.length>1?` #${o+1}`:""),value:a})}),u?.length&&T.push({type:y.Divider}),u?.forEach(({annotationKey:e,attributeKey:t,from:i,fromSources:n},o)=>{let a="";a+=`Annotation Key: ${e}\n`,a+=`Attribute Key: ${t}\n`,a+=`From: ${n?.length?n.join(", "):i||f.Pod}\n`,T.push({title:"Annotation"+(u.length>1?` #${o+1}`:""),value:a})})),t===v.AddClusterInfo){T.push({title:"Overwrite Existing Values",value:String(h||!1)});let e="";p?.forEach(({attributeName:t,attributeStringValue:i},n)=>{e+=`${t}: ${i}`,n<p.length-1&&(e+=", ")}),T.push({title:"Attributes",value:e})}if(t===v.DeleteAttributes){let e="";m?.forEach((t,i)=>{e+=t,i<m.length-1&&(e+=", ")}),T.push({title:"Attributes",value:e})}if(t===v.RenameAttributes){let e="";const t=Object.entries(b||{});t.forEach(([i,n],o)=>{e+=`${i}: ${n}`,o<t.length-1&&(e+=", ")}),T.push({title:"Attributes",value:e})}if(t===v.PiiMasking){let e="";x?.forEach((t,i)=>{e+=t,i<x.length-1&&(e+=", ")}),T.push({title:"Categories",value:e})}return t===v.ErrorSampler&&T.push({title:"Sampling Ratio",value:String(S)}),t===v.ProbabilisticSampler&&T.push({title:"Sampling Percentage",value:String($)}),t===v.LatencySampler&&C?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:i,fallbackSamplingRatio:n},o)=>{let a="";a+=`Service Name: ${e}\n`,a+=`HTTP Route: ${t}\n`,a+=`Min. Latency: ${i}\n`,a+=`Fallback Sampling Ratio: ${n}`,T.push({title:"Endpoint"+(C.length>1?` #${o+1}`:""),value:a})}),t===v.ServiceNameSampler&&k?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:i},n)=>{let o="";o+=`Service Name: ${e}\n`,o+=`Sampling Ratio: ${t}\n`,o+=`Fallback Sampling Ratio: ${i}`,T.push({title:"Filter"+(k.length>1?` #${n+1}`:""),value:o})}),t===v.SpanAttributeSampler&&w?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:i,condition:n},o)=>{let a="";a+=`Service Name: ${e}\n`,a+=`Attribute Key: ${t}\n`,a+=`Fallback Sampling Ratio: ${i}\n`;const r=Object.keys(n)[0];a+=`Condition: ${r}\n`,a+=`Operation: ${n[r]?.operation}\n`,a+=`Expected Value: ${n[r]?.expectedValue}`,"jsonCondition"===r&&(a+=`\nJSON Path: ${n[r].jsonPath}`),T.push({title:"Filter"+(w.length>1?` #${o+1}`:""),value:a})}),t===v.URLTemplatization&&N?.forEach((e,t)=>{let i="";e.filterK8sNamespace&&(i+=`Namespace: ${e.filterK8sNamespace}\n`),e.workloadFilters?.length&&e.workloadFilters.forEach(e=>{const t=[e.kind,e.name].filter(Boolean).join("/");t&&(i+=`Workload: ${t}\n`)});const n=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");i+=`Templates: ${n}`,e.notes&&(i+=`\nNotes: ${e.notes}`),T.push({title:"Group"+(N.length>1?` #${t+1}`:""),value:i})}),T},gn=b.PiiCategories,yn=p.div`
2
2
  display: flex;
3
3
  flex-direction: row;
4
4
  gap: 32px;
@@ -7,45 +7,45 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
7
7
  border-radius: 32px;
8
8
  padding: 8px;
9
9
  `}
10
- `,hn=[{id:"CREDIT_CARD",label:"Credit Card"}],mn=b.FallbackSamplingRatio,gn=[{value:f.Pod,id:f.Pod},{value:f.Namespace,id:f.Namespace},{value:f.Node,id:f.Node}],yn=[{title:"Label Key",keyName:"labelKey",placeholder:"app.kubernetes.io/name",required:!0},{title:"Attribute Key",keyName:"attributeKey",placeholder:"app.kubernetes.name",required:!0},{title:"From Sources",keyName:"fromSources",placeholder:"pod, namespace",componentType:"multi-dropdown",options:gn,required:!0,tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones."}],vn=[{title:"Annotation Key",keyName:"annotationKey",placeholder:"kubectl.kubernetes.io/restartedAt",required:!0},{title:"Attribute Key",keyName:"attributeKey",placeholder:"kubectl.kubernetes.restartedAt",required:!0},{title:"From Sources",keyName:"fromSources",placeholder:"pod, namespace",componentType:"multi-dropdown",options:gn,required:!1,tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones."}],fn=b.EndpointsFilters,bn=[{title:"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.",required:!0},{title:"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.",required:!0},{title:"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.",required:!0,type:k.Number},{title:"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.",required:!0,type:k.Number}],xn=b.AttributeNamesToDelete,$n=b.Renames,Sn=b.UrlTemplatizationRulesGroups,Cn=[{keyName:"kind",title:"Kind",placeholder:"Any kind",componentType:"dropdown",options:[{id:"Deployment",value:"Deployment"},{id:"StatefulSet",value:"StatefulSet"},{id:"DaemonSet",value:"DaemonSet"}]},{keyName:"name",title:"Name",placeholder:"Any name"}],kn=b.ServicesNameFilters,wn=[{title:"Service Name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (Across all available spans).",required:!0},{title:"Sampling Ratio",keyName:"samplingRatio",placeholder:"e.g. 10",tooltip:"Specifies the sample rate for all traces.",required:!0,type:k.Number},{title:"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.",required:!0,type:k.Number}],Dn=b.SamplingPercentage,Tn=b.AttributeFilters,Nn=[{title:"Service Name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (across all available spans).",required:!0},{title:"Attribute Key",keyName:"attributeKey",placeholder:"e.g. http.request.method",tooltip:"Specifies the attribute key inside of the span.",required:!0},{title:"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.",required:!0,type:k.Number},{title:"Condition",keyName:"condition",tooltip:"An object representing the filters for span attributes filters.",required:!0,componentType:R.Dropdown,options:[{id:"stringCondition",value:"String Condition"},{id:"numberCondition",value:"Number Condition"},{id:"booleanCondition",value:"Boolean Condition"},{id:"jsonCondition",value:"JSON Condition"}]},{title:"Operation",keyName:"operation",tooltip:"Specifies the operation to run against the attribute.",required:!0,componentType:R.Dropdown,options:[{id:"exists",value:"Exists"},{id:"equals",value:"Equals"},{id:"not_equals",value:"Not Equals"},{id:"contains",value:"Contains"},{id:"not_contains",value:"Not Contains"},{id:"regex",value:"Regex"},{id:"greater_than",value:"Greater Than"},{id:"less_than",value:"Less Than"},{id:"greater_than_or_equal",value:"Greater Than Or Equal"},{id:"less_than_or_equal",value:"Less Than Or Equal"},{id:"is_valid_json",value:"Is Valid JSON"},{id:"is_invalid_json",value:"Is Invalid JSON"},{id:"jsonpath_exists",value:"JSON Path Exists"},{id:"key_equals",value:"Key Equals"},{id:"key_not_equals",value:"Key Not Equals"}]},{title:"Expected Value",keyName:"expectedValue",placeholder:"e.g. GET",tooltip:"The values to test the attribute against.",required:!0},{title:"JSON Path",keyName:"jsonPath",placeholder:"e.g. $.user.role",tooltip:"An expression used to navigate the JSON structure.",required:!1,renderCondition:e=>"jsonCondition"===e.condition}],En={[v.K8sAttributes]:({value:n,setValue:a,formErrors:r})=>(o(()=>{n[b.CollectContainerAttributes]||n[b.CollectReplicaSetAttributes]||n[b.CollectWorkloadId]||n[b.CollectClusterId]||n[b.LabelsAttributes]?.length||n[b.AnnotationsAttributes]?.length||(a(b.CollectContainerAttributes,!0),a(b.CollectReplicaSetAttributes,!0),a(b.CollectWorkloadId,!0),a(b.CollectClusterId,!0),a(b.LabelsAttributes,[]),a(b.AnnotationsAttributes,[]))},[]),e(i,{children:[t($,{title:"Collect Container Attributes",value:n[b.CollectContainerAttributes]||!1,onChange:e=>a(b.CollectContainerAttributes,e),errorMessage:r[b.CollectContainerAttributes]}),t($,{title:"Collect ReplicaSet Attributes",value:n[b.CollectReplicaSetAttributes]||!1,onChange:e=>a(b.CollectReplicaSetAttributes,e),errorMessage:r[b.CollectReplicaSetAttributes]}),t($,{title:"Collect Workload ID",value:n[b.CollectWorkloadId]||!1,onChange:e=>a(b.CollectWorkloadId,e),errorMessage:r[b.CollectWorkloadId]}),t($,{title:"Collect Cluster ID",value:n[b.CollectClusterId]||!1,onChange:e=>a(b.CollectClusterId,e),errorMessage:r[b.CollectClusterId]}),t(D,{columns:yn,value:n[b.LabelsAttributes]||[],onChange:e=>a(b.LabelsAttributes,e),errorMessage:r[b.LabelsAttributes]}),t(D,{columns:vn,value:n[b.AnnotationsAttributes]||[],onChange:e=>a(b.AnnotationsAttributes,e),errorMessage:r[b.AnnotationsAttributes]})]})),[v.AddClusterInfo]:({value:n,setValue:o,formErrors:a})=>e(i,{children:[t(T,{title:"Overwrite Existing Values",tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",initialValue:n[b.OverwriteExistingValues]||!1,onChange:e=>o(b.OverwriteExistingValues,e)}),t(N,{title:"Resource Attributes",value:n[b.ClusterAttributes]?.map(e=>({key:e.attributeName,value:e.attributeStringValue}))||[],onChange:e=>o(b.ClusterAttributes,e.map(e=>({attributeName:e.key,attributeStringValue:e.value}))),required:!0,errorMessage:a[b.ClusterAttributes]})]}),[v.DeleteAttributes]:({value:e,setValue:i,formErrors:n})=>{const o=n[xn],a=e[xn]||[];return t(E,{title:"Attributes to delete",value:a,onChange:e=>i(xn,e),required:!0,errorMessage:o})},[v.RenameAttributes]:({value:e,setValue:i,formErrors:n})=>{const o=n[$n],a=Object.entries(e[$n]||{}).map(([e,t])=>({key:e,value:t}));return t(N,{title:"Attributes to rename",value:a,onChange:e=>{const t={};e.forEach(e=>t[e.key]=e.value),i($n,t)},required:!0,errorMessage:o})},[v.PiiMasking]:({value:i,setValue:a,formErrors:r})=>{const l=r[un],s=i[un]||[],[c,d]=n(1===s.length);return o(()=>{if(!s.length){const e=hn.map(({id:e})=>e);a(un,e),d(1===hn.length)}},[]),e("div",{children:[t(x,{title:"Attributes to mask",required:!0}),t(pn,{$hasError:!!l,children:hn.map(({id:e,label:i})=>t($,{title:i,disabled:c&&s.includes(e),value:s.includes(e),onChange:t=>((e,t)=>{const i=t?[...s,e]:s.filter(t=>t!==e);a(un,i),d(1===i.length)})(e,t)},e))}),!!l&&t(S,{children:l})]})},[v.ErrorSampler]:({value:e,setValue:i,formErrors:n})=>{const o=n[mn],a=e[mn];return t(C,{title:"Fallback sampling ratio",required:!0,type:k.Number,min:0,max:100,value:w(a)?"":String(a),onChange:({target:{value:e}})=>{return t=e,i(mn,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:o})},[v.ProbabilisticSampler]:({value:e,setValue:i,formErrors:n})=>{const o=n[Dn],a=e[Dn];return t(C,{title:"Sampling percentage",required:!0,type:k.Number,min:0,max:100,value:w(a)?"":String(a),onChange:({target:{value:e}})=>{return t=e,i(Dn,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:o})},[v.LatencySampler]:({value:e,setValue:i,formErrors:n})=>{const o=n[fn],a=e[fn]||[];return t(D,{columns:bn,value:a,onChange:e=>{const t=e.map(({serviceName:e,httpRoute:t,minimumLatencyThreshold:i,fallbackSamplingRatio:n})=>({serviceName:e,httpRoute:t,minimumLatencyThreshold:Number(i),fallbackSamplingRatio:Number(n)}));i(fn,t)},errorMessage:o})},[v.ServiceNameSampler]:({value:e,setValue:i,formErrors:n})=>{const o=n[kn],a=e[kn]||[];return t(D,{columns:wn,value:a,onChange:e=>{const t=e.map(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:i})=>({serviceName:e,samplingRatio:Number(t),fallbackSamplingRatio:Number(i)}));i(kn,t)},errorMessage:o})},[v.SpanAttributeSampler]:({value:e,setValue:i,formErrors:n})=>{const o=n[Tn],a=(e[Tn]||[]).map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:i,condition:n})=>{const o=Object.entries(n).filter(([e,t])=>t)[0][0];return{serviceName:e,attributeKey:t,fallbackSamplingRatio:i,condition:o,operation:n[o]?.operation,expectedValue:n[o]?.expectedValue,jsonPath:n[o]?.jsonPath}});return t(D,{columns:Nn,value:a,onChange:e=>{const t=e.map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:i,condition:n,operation:o,expectedValue:a,jsonPath:r})=>{const l={serviceName:e,attributeKey:t,fallbackSamplingRatio:Number(i),condition:{[n]:{operation:o,expectedValue:a}}};return r&&(l.condition[n].jsonPath=r),l});i(Tn,t)},errorMessage:o,limitFieldsPerRow:3})},[v.URLTemplatization]:({value:n,setValue:o,formErrors:r})=>{const l=r[Sn],s=n[Sn]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>o(Sn,e),d=(e,t)=>c(s.map((i,n)=>n===e?{...i,...t}:i));return e(i,{children:[s.map((i,n)=>e(a,{children:[t(A,{}),e(F,{$gap:12,children:[e(O,{$justifyContent:"space-between",$alignItems:"center",children:[t(x,{title:`Rule Group ${n+1}`}),s.length>1&&t(I,{size:30,onClick:()=>{return e=n,c(s.filter((t,i)=>i!==e));var e},children:t(Fi,{})})]}),t(C,{title:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:i.filterK8sNamespace||"",onChange:e=>d(n,{filterK8sNamespace:e.target.value})}),t(D,{title:"Workload Filters",columns:Cn,value:i.workloadFilters||[],onChange:e=>d(n,{workloadFilters:e})}),t(E,{title:"Templates",required:!0,value:i.templatizationRules.map(e=>e.template),onChange:e=>d(n,{templatizationRules:e.map(e=>({template:e}))})})]}),!!l&&t(S,{children:l})]},`url-templatization-group-${n}`)),t(M,{label:"Add Rule Group",onClick:()=>c([...s,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(A,{})]})}},An=({actionType:e,value:i,setValue:n,formErrors:o})=>{if(!e)return null;const a=En[e];return a?t(a,{value:i,setValue:n,formErrors:o}):null},Fn=p.div`
10
+ `,vn=[{id:"CREDIT_CARD",label:"Credit Card"}],fn=b.FallbackSamplingRatio,bn=[{value:f.Pod,id:f.Pod},{value:f.Namespace,id:f.Namespace},{value:f.Node,id:f.Node}],xn=[{title:"Label Key",keyName:"labelKey",placeholder:"app.kubernetes.io/name",required:!0},{title:"Attribute Key",keyName:"attributeKey",placeholder:"app.kubernetes.name",required:!0},{title:"From Sources",keyName:"fromSources",placeholder:"pod, namespace",componentType:"multi-dropdown",options:bn,required:!0,tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones."}],Sn=[{title:"Annotation Key",keyName:"annotationKey",placeholder:"kubectl.kubernetes.io/restartedAt",required:!0},{title:"Attribute Key",keyName:"attributeKey",placeholder:"kubectl.kubernetes.restartedAt",required:!0},{title:"From Sources",keyName:"fromSources",placeholder:"pod, namespace",componentType:"multi-dropdown",options:bn,required:!1,tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones."}],$n=b.EndpointsFilters,Cn=[{title:"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.",required:!0},{title:"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.",required:!0},{title:"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.",required:!0,type:k.Number},{title:"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.",required:!0,type:k.Number}],kn=b.AttributeNamesToDelete,wn=b.Renames,Nn=b.UrlTemplatizationRulesGroups,Tn=[{keyName:"kind",title:"Kind",placeholder:"Any kind",componentType:"dropdown",options:[{id:"Deployment",value:"Deployment"},{id:"StatefulSet",value:"StatefulSet"},{id:"DaemonSet",value:"DaemonSet"}]},{keyName:"name",title:"Name",placeholder:"Any name"}],Dn=b.ServicesNameFilters,En=[{title:"Service Name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (Across all available spans).",required:!0},{title:"Sampling Ratio",keyName:"samplingRatio",placeholder:"e.g. 10",tooltip:"Specifies the sample rate for all traces.",required:!0,type:k.Number},{title:"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.",required:!0,type:k.Number}],An=b.SamplingPercentage,On=b.AttributeFilters,Fn=[{title:"Service Name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (across all available spans).",required:!0},{title:"Attribute Key",keyName:"attributeKey",placeholder:"e.g. http.request.method",tooltip:"Specifies the attribute key inside of the span.",required:!0},{title:"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.",required:!0,type:k.Number},{title:"Condition",keyName:"condition",tooltip:"An object representing the filters for span attributes filters.",required:!0,componentType:R.Dropdown,options:[{id:"stringCondition",value:"String Condition"},{id:"numberCondition",value:"Number Condition"},{id:"booleanCondition",value:"Boolean Condition"},{id:"jsonCondition",value:"JSON Condition"}]},{title:"Operation",keyName:"operation",tooltip:"Specifies the operation to run against the attribute.",required:!0,componentType:R.Dropdown,options:[{id:"exists",value:"Exists"},{id:"equals",value:"Equals"},{id:"not_equals",value:"Not Equals"},{id:"contains",value:"Contains"},{id:"not_contains",value:"Not Contains"},{id:"regex",value:"Regex"},{id:"greater_than",value:"Greater Than"},{id:"less_than",value:"Less Than"},{id:"greater_than_or_equal",value:"Greater Than Or Equal"},{id:"less_than_or_equal",value:"Less Than Or Equal"},{id:"is_valid_json",value:"Is Valid JSON"},{id:"is_invalid_json",value:"Is Invalid JSON"},{id:"jsonpath_exists",value:"JSON Path Exists"},{id:"key_equals",value:"Key Equals"},{id:"key_not_equals",value:"Key Not Equals"}]},{title:"Expected Value",keyName:"expectedValue",placeholder:"e.g. GET",tooltip:"The values to test the attribute against.",required:!0},{title:"JSON Path",keyName:"jsonPath",placeholder:"e.g. $.user.role",tooltip:"An expression used to navigate the JSON structure.",required:!1,renderCondition:e=>"jsonCondition"===e.condition}],In={[v.K8sAttributes]:({value:n,setValue:a,formErrors:r})=>(o(()=>{n[b.CollectContainerAttributes]||n[b.CollectReplicaSetAttributes]||n[b.CollectWorkloadId]||n[b.CollectClusterId]||n[b.LabelsAttributes]?.length||n[b.AnnotationsAttributes]?.length||(a(b.CollectContainerAttributes,!0),a(b.CollectReplicaSetAttributes,!0),a(b.CollectWorkloadId,!0),a(b.CollectClusterId,!0),a(b.LabelsAttributes,[]),a(b.AnnotationsAttributes,[]))},[]),e(i,{children:[t(S,{title:"Collect Container Attributes",value:n[b.CollectContainerAttributes]||!1,onChange:e=>a(b.CollectContainerAttributes,e),errorMessage:r[b.CollectContainerAttributes]}),t(S,{title:"Collect ReplicaSet Attributes",value:n[b.CollectReplicaSetAttributes]||!1,onChange:e=>a(b.CollectReplicaSetAttributes,e),errorMessage:r[b.CollectReplicaSetAttributes]}),t(S,{title:"Collect Workload ID",value:n[b.CollectWorkloadId]||!1,onChange:e=>a(b.CollectWorkloadId,e),errorMessage:r[b.CollectWorkloadId]}),t(S,{title:"Collect Cluster ID",value:n[b.CollectClusterId]||!1,onChange:e=>a(b.CollectClusterId,e),errorMessage:r[b.CollectClusterId]}),t(N,{columns:xn,value:n[b.LabelsAttributes]||[],onChange:e=>a(b.LabelsAttributes,e),errorMessage:r[b.LabelsAttributes]}),t(N,{columns:Sn,value:n[b.AnnotationsAttributes]||[],onChange:e=>a(b.AnnotationsAttributes,e),errorMessage:r[b.AnnotationsAttributes]})]})),[v.AddClusterInfo]:({value:n,setValue:o,formErrors:a})=>e(i,{children:[t(T,{title:"Overwrite Existing Values",tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",initialValue:n[b.OverwriteExistingValues]||!1,onChange:e=>o(b.OverwriteExistingValues,e)}),t(D,{title:"Resource Attributes",value:n[b.ClusterAttributes]?.map(e=>({key:e.attributeName,value:e.attributeStringValue}))||[],onChange:e=>o(b.ClusterAttributes,e.map(e=>({attributeName:e.key,attributeStringValue:e.value}))),required:!0,errorMessage:a[b.ClusterAttributes]})]}),[v.DeleteAttributes]:({value:e,setValue:i,formErrors:n})=>{const o=n[kn],a=e[kn]||[];return t(E,{title:"Attributes to delete",value:a,onChange:e=>i(kn,e),required:!0,errorMessage:o})},[v.RenameAttributes]:({value:e,setValue:i,formErrors:n})=>{const o=n[wn],a=Object.entries(e[wn]||{}).map(([e,t])=>({key:e,value:t}));return t(D,{title:"Attributes to rename",value:a,onChange:e=>{const t={};e.forEach(e=>t[e.key]=e.value),i(wn,t)},required:!0,errorMessage:o})},[v.PiiMasking]:({value:i,setValue:a,formErrors:r})=>{const l=r[gn],s=i[gn]||[],[c,d]=n(1===s.length);return o(()=>{if(!s.length){const e=vn.map(({id:e})=>e);a(gn,e),d(1===vn.length)}},[]),e("div",{children:[t(x,{title:"Attributes to mask",required:!0}),t(yn,{$hasError:!!l,children:vn.map(({id:e,label:i})=>t(S,{title:i,disabled:c&&s.includes(e),value:s.includes(e),onChange:t=>((e,t)=>{const i=t?[...s,e]:s.filter(t=>t!==e);a(gn,i),d(1===i.length)})(e,t)},e))}),!!l&&t($,{children:l})]})},[v.ErrorSampler]:({value:e,setValue:i,formErrors:n})=>{const o=n[fn],a=e[fn];return t(C,{title:"Fallback sampling ratio",required:!0,type:k.Number,min:0,max:100,value:w(a)?"":String(a),onChange:({target:{value:e}})=>{return t=e,i(fn,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:o})},[v.ProbabilisticSampler]:({value:e,setValue:i,formErrors:n})=>{const o=n[An],a=e[An];return t(C,{title:"Sampling percentage",required:!0,type:k.Number,min:0,max:100,value:w(a)?"":String(a),onChange:({target:{value:e}})=>{return t=e,i(An,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:o})},[v.LatencySampler]:({value:e,setValue:i,formErrors:n})=>{const o=n[$n],a=e[$n]||[];return t(N,{columns:Cn,value:a,onChange:e=>{const t=e.map(({serviceName:e,httpRoute:t,minimumLatencyThreshold:i,fallbackSamplingRatio:n})=>({serviceName:e,httpRoute:t,minimumLatencyThreshold:Number(i),fallbackSamplingRatio:Number(n)}));i($n,t)},errorMessage:o})},[v.ServiceNameSampler]:({value:e,setValue:i,formErrors:n})=>{const o=n[Dn],a=e[Dn]||[];return t(N,{columns:En,value:a,onChange:e=>{const t=e.map(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:i})=>({serviceName:e,samplingRatio:Number(t),fallbackSamplingRatio:Number(i)}));i(Dn,t)},errorMessage:o})},[v.SpanAttributeSampler]:({value:e,setValue:i,formErrors:n})=>{const o=n[On],a=(e[On]||[]).map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:i,condition:n})=>{const o=Object.entries(n).filter(([e,t])=>t)[0][0];return{serviceName:e,attributeKey:t,fallbackSamplingRatio:i,condition:o,operation:n[o]?.operation,expectedValue:n[o]?.expectedValue,jsonPath:n[o]?.jsonPath}});return t(N,{columns:Fn,value:a,onChange:e=>{const t=e.map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:i,condition:n,operation:o,expectedValue:a,jsonPath:r})=>{const l={serviceName:e,attributeKey:t,fallbackSamplingRatio:Number(i),condition:{[n]:{operation:o,expectedValue:a}}};return r&&(l.condition[n].jsonPath=r),l});i(On,t)},errorMessage:o,limitFieldsPerRow:3})},[v.URLTemplatization]:({value:n,setValue:o,formErrors:r})=>{const l=r[Nn],s=n[Nn]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>o(Nn,e),d=(e,t)=>c(s.map((i,n)=>n===e?{...i,...t}:i));return e(i,{children:[s.map((i,n)=>e(a,{children:[t(A,{}),e(O,{$gap:12,children:[e(F,{$justifyContent:"space-between",$alignItems:"center",children:[t(x,{title:`Rule Group ${n+1}`}),s.length>1&&t(I,{size:30,onClick:()=>{return e=n,c(s.filter((t,i)=>i!==e));var e},children:t(Ii,{})})]}),t(C,{title:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:i.filterK8sNamespace||"",onChange:e=>d(n,{filterK8sNamespace:e.target.value})}),t(N,{title:"Workload Filters",columns:Tn,value:i.workloadFilters||[],onChange:e=>d(n,{workloadFilters:e})}),t(E,{title:"Templates",required:!0,value:i.templatizationRules.map(e=>e.template),onChange:e=>d(n,{templatizationRules:e.map(e=>({template:e}))})})]}),!!l&&t($,{children:l})]},`url-templatization-group-${n}`)),t(M,{label:"Add Rule Group",onClick:()=>c([...s,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(A,{})]})}},Mn=({actionType:e,value:i,setValue:n,formErrors:o})=>{if(!e)return null;const a=In[e];return a?t(a,{value:i,setValue:n,formErrors:o}):null},Rn=p.div`
11
11
  display: flex;
12
12
  flex-direction: column;
13
13
  gap: 24px;
14
14
  padding: 4px;
15
- `,On=p(B)`
15
+ `,Kn=p(V)`
16
16
  margin-bottom: 12px;
17
- `,In=({isUpdate:i,action:n,formData:o,formErrors:a,handleFormChange:r})=>{const l=m();return e(Fn,{children:[i&&e("div",{children:[t(On,{children:"Status"}),t(P,{options:[{icon:Oi,label:g.ENABLED,value:!1,selectedBgColor:l.text.success+L["050"]},{icon:Ii,label:g.DISABLED,value:!0,selectedBgColor:l.text.error+L["050"]}],selected:o.disabled,setSelected:e=>r("disabled",e)})]}),!i&&t(K,{title:"",description:n.docsDescription,actionButton:t(j,{endpoint:n.docsEndpoint})}),t(z,{title:"Signals for Processing",required:!0,allowedSignals:n.allowedSignals,selectedSignals:o.signals||[],setSelectedSignals:e=>r("signals",e),errorMessage:a.signals}),!i&&t(C,{title:"Action name",placeholder:"Use a name that describes the action",value:o.name||"",onChange:({target:{value:e}})=>r("name",e),errorMessage:a.name}),t(An,{actionType:n.type,value:o.fields,setValue:(e,t)=>r(`fields.${e}`,t),formErrors:a}),t(q,{title:"Notes",value:o.notes||"",onChange:({target:{value:e}})=>r("notes",e),errorMessage:a.notes})]})},Mn=r(({children:o,width:a=640,title:r,titleTooltip:c,hideEditTitleFromEdit:d,icons:u,iconSrcs:p,isEdit:h=!1,isFormDirty:g=!1,isLastItem:y=!1,onClose:v,onEdit:f,onSave:b,onDelete:x,onCancel:$,tabs:S,headerActionButtons:C},k)=>{const w=m(),{drawerType:D,setDrawerType:T,setDrawerEntityId:N}=V();H({key:"Enter",active:h},()=>z());const[E,A]=n(!1),[F,O]=n(!1),I=l(null),M=D===G.Source,R=()=>{A(!1),O(!1)},P=()=>{R(),f&&f(!1),T(null),N(null),v?.()};s(k,()=>({closeDrawer:P}));const L=()=>{I.current?.clearTitle(),$&&$(),R()},K=()=>{const e=I.current?.isTitleDirty();g||e?O(!0):L()},j=()=>{A(!0)},z=()=>{b&&b(I.current?.getTitle()||"")},q=C||[];return f&&!h&&q.push({"data-id":"drawer-edit",variant:"tertiary",onClick:()=>f(!0),children:e(i,{children:[t(Mi,{}),t(B,{size:14,family:"secondary",decoration:"underline",children:"Edit"})]})}),x&&!h&&q.push({"data-id":"drawer-delete",variant:"tertiary",onClick:j,children:e(i,{children:[t(Fi,{}),t(B,{color:w.text.error,size:14,family:"secondary",decoration:"underline",children:M?W.UNINSTRUMENT:W.DELETE})]})}),e(i,{children:[t(_,{isOpen:!0,onClose:h?K:P,closeOnEscape:!E&&!F,width:`${a+64}px`,header:{icons:u,iconSrcs:p,title:r,titleTooltip:c,replaceTitleWith:!d&&h?t(Rn,{ref:I,title:r}):void 0,actionButtons:q,tabs:S},footer:{isOpen:h,leftButtons:[{"data-id":"drawer-save",variant:"primary",onClick:z,children:W.SAVE},{"data-id":"drawer-cancel",variant:"secondary",onClick:K,children:W.CANCEL}],rightButtons:x?[{"data-id":"drawer-delete",variant:"tertiary",onClick:j,children:e(i,{children:[t(Fi,{}),t(B,{size:14,color:w.text.error,family:"secondary",decoration:"underline",children:W.DELETE})]})}]:[]},children:o}),t(J,{isOpen:E,noOverlay:!0,name:`${D}${r?` (${r})`:""}`,type:D,isLastItem:y,onApprove:()=>{x&&x(),R()},onDeny:R}),t(U,{isOpen:F,noOverlay:!0,name:"edit mode",onApprove:L,onDeny:R})]})}),Rn=r(({title:e},i)=>{const[a,r]=n(e);return o(()=>{r(e)},[e]),s(i,()=>({getTitle:()=>a||e,isTitleDirty:()=>a!==e,clearTitle:()=>r(e)})),t(C,{"data-id":"title",value:a,onChange:e=>r(e.target.value)})});Rn.displayName=Rn.name,Mn.displayName=Mn.name;const Pn=p.div`
17
+ `,Pn=({isUpdate:i,action:n,formData:o,formErrors:a,handleFormChange:r})=>{const l=m();return e(Rn,{children:[i&&e("div",{children:[t(Kn,{children:"Status"}),t(K,{options:[{icon:Mi,label:g.ENABLED,value:!1,selectedBgColor:l.text.success+P["050"]},{icon:Ri,label:g.DISABLED,value:!0,selectedBgColor:l.text.error+P["050"]}],selected:o.disabled,setSelected:e=>r("disabled",e)})]}),!i&&t(L,{title:"",description:n.docsDescription,actionButton:t(z,{endpoint:n.docsEndpoint})}),t(j,{title:"Signals for Processing",required:!0,allowedSignals:n.allowedSignals,selectedSignals:o.signals||[],setSelectedSignals:e=>r("signals",e),errorMessage:a.signals}),!i&&t(C,{title:"Action name",placeholder:"Use a name that describes the action",value:o.name||"",onChange:({target:{value:e}})=>r("name",e),errorMessage:a.name}),t(Mn,{actionType:n.type,value:o.fields,setValue:(e,t)=>r(`fields.${e}`,t),formErrors:a}),t(q,{title:"Notes",value:o.notes||"",onChange:({target:{value:e}})=>r("notes",e),errorMessage:a.notes})]})},Ln=r(({children:o,width:a=640,title:r,titleTooltip:c,hideEditTitleFromEdit:d,icons:u,iconSrcs:p,isEdit:h=!1,isFormDirty:g=!1,isLastItem:y=!1,onClose:v,onEdit:f,onSave:b,onDelete:x,onCancel:S,tabs:$,headerActionButtons:C},k)=>{const w=m(),{drawerType:N,setDrawerType:T,setDrawerEntityId:D}=B();H({key:"Enter",active:h},()=>j());const[E,A]=n(!1),[O,F]=n(!1),I=l(null),M=N===G.Source,R=()=>{A(!1),F(!1)},K=()=>{R(),f&&f(!1),T(null),D(null),v?.()};s(k,()=>({closeDrawer:K}));const P=()=>{I.current?.clearTitle(),S&&S(),R()},L=()=>{const e=I.current?.isTitleDirty();g||e?F(!0):P()},z=()=>{A(!0)},j=()=>{b&&b(I.current?.getTitle()||"")},q=C||[];return f&&!h&&q.push({"data-id":"drawer-edit",variant:"tertiary",onClick:()=>f(!0),children:e(i,{children:[t(Ki,{}),t(V,{size:14,family:"secondary",decoration:"underline",children:"Edit"})]})}),x&&!h&&q.push({"data-id":"drawer-delete",variant:"tertiary",onClick:z,children:e(i,{children:[t(Ii,{}),t(V,{color:w.text.error,size:14,family:"secondary",decoration:"underline",children:M?W.UNINSTRUMENT:W.DELETE})]})}),e(i,{children:[t(_,{isOpen:!0,onClose:h?L:K,closeOnEscape:!E&&!O,width:`${a+64}px`,header:{icons:u,iconSrcs:p,title:r,titleTooltip:c,replaceTitleWith:!d&&h?t(zn,{ref:I,title:r}):void 0,actionButtons:q,tabs:$},footer:{isOpen:h,leftButtons:[{"data-id":"drawer-save",variant:"primary",onClick:j,children:W.SAVE},{"data-id":"drawer-cancel",variant:"secondary",onClick:L,children:W.CANCEL}],rightButtons:x?[{"data-id":"drawer-delete",variant:"tertiary",onClick:z,children:e(i,{children:[t(Ii,{}),t(V,{size:14,color:w.text.error,family:"secondary",decoration:"underline",children:W.DELETE})]})}]:[]},children:o}),t(J,{isOpen:E,noOverlay:!0,name:`${N}${r?` (${r})`:""}`,type:N,isLastItem:y,onApprove:()=>{x&&x(),R()},onDeny:R}),t(U,{isOpen:O,noOverlay:!0,name:"edit mode",onApprove:P,onDeny:R})]})}),zn=r(({title:e},i)=>{const[a,r]=n(e);return o(()=>{r(e)},[e]),s(i,()=>({getTitle:()=>a||e,isTitleDirty:()=>a!==e,clearTitle:()=>r(e)})),t(C,{"data-id":"title",value:a,onChange:e=>r(e.target.value)})});zn.displayName=zn.name,Ln.displayName=Ln.name;const jn=p.div`
18
18
  width: 100%;
19
19
  height: 100%;
20
20
  max-height: calc(100vh - 220px);
21
21
  overflow: overlay;
22
22
  overflow-y: auto;
23
- `,Ln=p.div`
23
+ `,qn=p.div`
24
24
  display: flex;
25
25
  flex-direction: column;
26
26
  gap: 12px;
27
- `,Kn=({updateAction:i,deleteAction:a})=>{const{actions:r}=Y(),{drawerType:s,drawerEntityId:d}=V(),u=l(null),p=s===G.Action,[h,m]=n(!1),[y,v]=n(!1),{formData:f,formErrors:b,handleFormChange:x,resetFormData:$,validateForm:S,loadFormWithDrawerItem:C}=X(),k=c(()=>{if(d)return r?.find(e=>Z(e)===d)},[d,r]);if(o(()=>{p&&k?C(k):$()},[p,k]),!k)return null;const w=Q.find(({type:e})=>e===k.type)||Q.find(({label:e})=>"Attributes"===e)?.items?.find(({type:e})=>e===k.type)||Q.find(({label:e})=>"Samplers"===e)?.items?.find(({type:e})=>e===k.type);return t(Mn,{ref:u,title:k.name||k.type,icons:[ie(k.type)],isEdit:h,isFormDirty:y,onEdit:e=>{m("boolean"!=typeof e||e)},onSave:e=>{if(S({withAlert:!0,alertTitle:ne.Update})){const t=e!==k.type?e:"";x("name",t),i(d,{...f,name:t}),m(!1),v(!1)}},onDelete:()=>{a(d,k.type),m(!1),v(!1),u.current?.closeDrawer()},onCancel:()=>{m(!1),v(!1),C(k)},children:h&&w?t(Pn,{children:t(In,{isUpdate:!0,action:w,formData:f,formErrors:b,handleFormChange:(...e)=>{v(!0),x(...e)}})}):e(Ln,{children:[t(ee,{conditions:k.conditions||[]}),t(te,{title:g.ACTION_DETAILS,data:k?dn(k):[]})]})})},jn=p(F)`
27
+ `,Vn=({updateAction:i,deleteAction:a})=>{const{actions:r}=Y(),{drawerType:s,drawerEntityId:d}=B(),u=l(null),p=s===G.Action,[h,m]=n(!1),[y,v]=n(!1),{formData:f,formErrors:b,handleFormChange:x,resetFormData:S,validateForm:$,loadFormWithDrawerItem:C}=X(),k=c(()=>{if(d)return r?.find(e=>Z(e)===d)},[d,r]);if(o(()=>{p&&k?C(k):S()},[p,k]),!k)return null;const w=Q.find(({type:e})=>e===k.type)||Q.find(({label:e})=>"Attributes"===e)?.items?.find(({type:e})=>e===k.type)||Q.find(({label:e})=>"Samplers"===e)?.items?.find(({type:e})=>e===k.type);return t(Ln,{ref:u,title:k.name||k.type,icons:[ie(k.type)],isEdit:h,isFormDirty:y,onEdit:e=>{m("boolean"!=typeof e||e)},onSave:e=>{if($({withAlert:!0,alertTitle:ne.Update})){const t=e!==k.type?e:"";x("name",t),i(d,{...f,name:t}),m(!1),v(!1)}},onDelete:()=>{a(d,k.type),m(!1),v(!1),u.current?.closeDrawer()},onCancel:()=>{m(!1),v(!1),C(k)},children:h&&w?t(jn,{children:t(Pn,{isUpdate:!0,action:w,formData:f,formErrors:b,handleFormChange:(...e)=>{v(!0),x(...e)}})}):e(qn,{children:[t(ee,{conditions:k.conditions||[]}),t(te,{title:g.ACTION_DETAILS,data:k?mn(k):[]})]})})},Bn=p(O)`
28
28
  margin-top: 24px;
29
29
  gap: 12px;
30
- `,zn=({createAction:i})=>{const{version:o}=oe(),{currentModal:a,setCurrentModal:r}=ae(),l=a===G.Action,{formData:s,formErrors:d,handleFormChange:u,resetFormData:p,validateForm:h}=X(),m=c(()=>{if(!o)return Q;const e=re(o);return Q.map(t=>({...t,items:t.items?.filter(t=>!t.minVersion||t.minVersion<=e)}))},[o]),[y,v]=n(void 0),f=()=>{p(),v(void 0),r("")},b=()=>{if(!h({withAlert:!0,alertTitle:ne.Create}))return null;i(s),f()};return H({key:"Enter",active:l},()=>b()),t(le,{isOpen:l,onClose:f,header:{title:"Add Action"},actionComponent:t(he,{buttons:[{variant:"primary",label:"DONE",onClick:b,disabled:!y}]}),children:e(se,{children:[t(K,{title:"Select Action",description:"Select an action to modify telemetry data before it`s sent to destinations. Choose an action type and configure its details."}),e(jn,{children:[t(ce,{type:de.Warning,message:ue.DEFINED_FOR_ALL_STREAMS(g.ACTIONS)}),t(pe,{options:m,selectedOption:y,onOptionSelect:e=>{return t=e,p(),u("type",t?.type||""),void v(t);var t},autoFocus:!y?.type})]}),y?.type?e("div",{children:[t(A,{margin:"16px 0"}),t(In,{action:y,formData:s,formErrors:d,handleFormChange:u})]}):null]})})},qn=e=>{const{type:t,fields:{collectContainerAttributes:i,collectReplicaSetAttributes:n,collectWorkloadId:o,collectClusterId:a,labelsAttributes:r,annotationsAttributes:l,clusterAttributes:s,overwriteExistingValues:c,attributeNamesToDelete:d,renames:u,piiCategories:p,fallbackSamplingRatio:h,samplingPercentage:m,endpointsFilters:g,attributeFilters:y,servicesNameFilters:b,urlTemplatizationRulesGroups:x}}=e;let $="";if(t===v.K8sAttributes&&(i&&($+="Container Attributes, "),n&&($+="ReplicaSet Attributes, "),o&&($+="Workload ID, "),a&&($+="Cluster ID, "),r?.forEach(({labelKey:e,attributeKey:t,from:i,fromSources:n},o)=>{const a=n?.length?n.join(","):i||f.Pod;$+=`Label: ${e} ${t} ${a} `,o===r.length-1&&($+=", ")}),l?.forEach(({annotationKey:e,attributeKey:t,from:i,fromSources:n},o)=>{const a=n?.length?n.join(","):i||f.Pod;$+=`Annotation: ${e} ${t} ${a} `,o===l.length-1&&($+=", ")})),t===v.AddClusterInfo&&($+=`Overwrite Existing: ${c}\n`,s?.forEach(({attributeName:e,attributeStringValue:t},i)=>{$+=`${e}: ${t}`,i<s.length-1&&($+=", ")})),t===v.DeleteAttributes&&d?.forEach((e,t)=>{$+=e,t<d.length-1&&($+=", ")}),t===v.RenameAttributes){const e=Object.entries(u||{});e.forEach(([t,i],n)=>{$+=`${t}: ${i}`,n<e.length-1&&($+=", ")})}return t===v.PiiMasking&&p?.forEach((e,t)=>{$+=e,t<p.length-1&&($+=", ")}),t===v.ErrorSampler&&($+=String(h)),t===v.ProbabilisticSampler&&($+=String(m),$+="%"),t===v.LatencySampler&&g?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:i,fallbackSamplingRatio:n},o)=>{$+=`Endpoint${g.length>1?` #${o+1}`:""}=${e}${t}\n`,$+=` Latency=${i}`,$+=` Sampling=${n}`,o<g.length-1&&($+=", ")}),t===v.ServiceNameSampler&&b?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:i})=>{$+=`Service Name: ${e}, `,$+=`Sampling Ratio: ${t}, `,$+=`Fallback Sampling Ratio: ${i}\n`}),t===v.SpanAttributeSampler&&y?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:i})=>{$+=`Service Name: ${e}, `,$+=`Attribute Key: ${t}, `,$+=`Fallback Sampling Ratio: ${i}\n`}),t===v.URLTemplatization&&x?.forEach((e,t)=>{const i=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");$+=`Group ${t+1}: ${i}`,t<x.length-1&&($+="; ")}),$},Bn=({conditions:e,id:i})=>{const{errors:n,warnings:o,disableds:a,hasLoadings:r}=c(()=>me(e),[e]),l=n.length>0?n:o.length>0?o:a.length>0?a:[];if(l.length>0)return t("div",{style:{lineHeight:1},children:t(Vn,{conditions:l,id:i})});const s=r?ye.Loading:de.Success;return t("div",{style:{lineHeight:1},children:t(ge,{status:s,title:s,withBorder:!0,withIcon:!0})})},Vn=({conditions:e,id:i})=>{const n=m();return t(O,{children:ve(e).map(({status:e,type:o,reason:a,message:r},l)=>{"loading"!==e&&"disabled"!==e||(e=de.Info);const s=be(e,n);return t(fe,{titleIcon:s,title:o,text:r||a||"",children:t(ge,{status:e,title:a||o,withBorder:!0,withIcon:!0})},`condition-${i}-${e}-${o}-${l}`)})})},Hn=({instrumentationRules:e,sources:t,actions:i,destinations:n,searchText:o,selectedCategory:a})=>{const r=o?e.filter(e=>e.type?.toLowerCase().includes(o)||e.ruleName?.toLowerCase().includes(o)):e,l=o?t.filter(e=>e.name?.toLowerCase().includes(o)||e.otelServiceName?.toLowerCase().includes(o)||e.namespace?.toLowerCase().includes(o)):t,s=o?i.filter(e=>e.type?.toLowerCase().includes(o)||e.name?.toLowerCase().includes(o)):i,c=o?n.filter(e=>e.destinationType.displayName?.toLowerCase().includes(o)||e.name?.toLowerCase().includes(o)):n,d=[{category:G.Source,label:"Sources",count:l.length,entities:[]},{category:G.Action,label:"Actions",count:s.length,entities:[]},{category:G.Destination,label:"Destinations",count:c.length,entities:[]},{category:G.InstrumentationRule,label:"Instrumentation Rules",count:r.length,entities:[]}];d.unshift({category:"all",label:"All",count:r.length+l.length+s.length+c.length,entities:[]});const u=d.filter(({count:e,category:t})=>!!e&&"all"!==t&&["all",t].includes(a)).map(e=>({...e,entities:e.category===G.InstrumentationRule?r:e.category===G.Source?l:e.category===G.Action?s:e.category===G.Destination?c:[]}));return{categories:d,searchResults:u}},Wn=[{key:"icon",title:""},{key:"name",title:g.NAME,sortable:!0},{key:"signals",title:g.MONITORS},{key:"active-status",title:g.STATUS},{key:"conditions",title:"Conditions"},{key:"type",title:g.TYPE,sortable:!0},{key:"spec",title:"Spec",sortable:!0},{key:"notes",title:g.NOTES,sortable:!0}],_n=({maxHeight:i,maxWidth:n})=>{const o=m(),a=xe(),{actions:r,actionsLoading:l}=Y(),{setDrawerType:s,setDrawerEntityId:d}=V(),u=c(()=>Hn({instrumentationRules:[],sources:[],actions:$e(r,a),destinations:[],searchText:a.searchText,selectedCategory:G.Action}).searchResults.find(({category:e})=>e===G.Action)?.entities||[],[r,a]),p=c(()=>u.map(e=>{const{hasErrors:i,hasWarnings:n,hasDisableds:a}=me(e.conditions||[]);return{status:i?de.Error:n?de.Warning:void 0,faded:a,onClick:()=>{s(G.Action),d(e.id)},cells:[{columnKey:"icon",component:()=>t(Se,{icon:ie(e.type)})},{columnKey:"name",value:Ce(e,G.Action,{prioritizeDisplayName:!0})},{columnKey:"type",value:e.type,textColor:o.text.info},{columnKey:"notes",value:e.notes,textColor:o.text.info,withTooltip:!0},{columnKey:"spec",value:qn(e),textColor:o.text.info,withTooltip:!0},{columnKey:"signals",component:()=>t(ke,{withLabels:!0,monitors:e.signals||[]})},{columnKey:"conditions",component:()=>t(Bn,{conditions:e.conditions||[],id:e.id})},{columnKey:"active-status",component:()=>t("div",{style:{lineHeight:1},children:t(ge,{status:e.disabled?de.Error:de.Success,title:e.disabled?g.DISABLED:g.ENABLED,withIcon:!0,withBorder:!0})})}]}}),[u]),{badge:h,badgeTooltip:y}=c(()=>u.length!==r.length?{badge:`${u.length}/${r.length}`,badgeTooltip:g.FILTERED_COUNT_TOOLTIP}:{badge:r.length,badgeTooltip:void 0},[u,r]);return e(we,{$maxWidth:n,children:[t(De,{children:t(Te,{icon:Ne(G.Action),title:g.ACTIONS,badge:h,badgeTooltip:y,loading:l})}),t(Ee,{$maxHeight:i,children:t(Ae,{columns:Wn,rows:p})}),!u.length&&t(Fe,{style:{marginTop:"2rem"},children:t(Oe,{})})]})},Jn=p(F)`
30
+ `,Hn=({createAction:i})=>{const{version:o}=oe(),{currentModal:a,setCurrentModal:r}=ae(),l=a===G.Action,{formData:s,formErrors:d,handleFormChange:u,resetFormData:p,validateForm:h}=X(),m=c(()=>{if(!o)return Q;const e=re(o);return Q.map(t=>({...t,items:t.items?.filter(t=>!t.minVersion||t.minVersion<=e)}))},[o]),[y,v]=n(void 0),f=()=>{p(),v(void 0),r("")},b=()=>{if(!h({withAlert:!0,alertTitle:ne.Create}))return null;i(s),f()};return H({key:"Enter",active:l},()=>b()),t(le,{isOpen:l,onClose:f,header:{title:"Add Action"},actionComponent:t(he,{buttons:[{variant:"primary",label:"DONE",onClick:b,disabled:!y}]}),children:e(se,{children:[t(L,{title:"Select Action",description:"Select an action to modify telemetry data before it`s sent to destinations. Choose an action type and configure its details."}),e(Bn,{children:[t(ce,{type:de.Warning,message:ue.DEFINED_FOR_ALL_STREAMS(g.ACTIONS)}),t(pe,{options:m,selectedOption:y,onOptionSelect:e=>{return t=e,p(),u("type",t?.type||""),void v(t);var t},autoFocus:!y?.type})]}),y?.type?e("div",{children:[t(A,{margin:"16px 0"}),t(Pn,{action:y,formData:s,formErrors:d,handleFormChange:u})]}):null]})})},Wn=e=>{const{type:t,fields:{collectContainerAttributes:i,collectReplicaSetAttributes:n,collectWorkloadId:o,collectClusterId:a,labelsAttributes:r,annotationsAttributes:l,clusterAttributes:s,overwriteExistingValues:c,attributeNamesToDelete:d,renames:u,piiCategories:p,fallbackSamplingRatio:h,samplingPercentage:m,endpointsFilters:g,attributeFilters:y,servicesNameFilters:b,urlTemplatizationRulesGroups:x}}=e;let S="";if(t===v.K8sAttributes&&(i&&(S+="Container Attributes, "),n&&(S+="ReplicaSet Attributes, "),o&&(S+="Workload ID, "),a&&(S+="Cluster ID, "),r?.forEach(({labelKey:e,attributeKey:t,from:i,fromSources:n},o)=>{const a=n?.length?n.join(","):i||f.Pod;S+=`Label: ${e} ${t} ${a} `,o===r.length-1&&(S+=", ")}),l?.forEach(({annotationKey:e,attributeKey:t,from:i,fromSources:n},o)=>{const a=n?.length?n.join(","):i||f.Pod;S+=`Annotation: ${e} ${t} ${a} `,o===l.length-1&&(S+=", ")})),t===v.AddClusterInfo&&(S+=`Overwrite Existing: ${c}\n`,s?.forEach(({attributeName:e,attributeStringValue:t},i)=>{S+=`${e}: ${t}`,i<s.length-1&&(S+=", ")})),t===v.DeleteAttributes&&d?.forEach((e,t)=>{S+=e,t<d.length-1&&(S+=", ")}),t===v.RenameAttributes){const e=Object.entries(u||{});e.forEach(([t,i],n)=>{S+=`${t}: ${i}`,n<e.length-1&&(S+=", ")})}return t===v.PiiMasking&&p?.forEach((e,t)=>{S+=e,t<p.length-1&&(S+=", ")}),t===v.ErrorSampler&&(S+=String(h)),t===v.ProbabilisticSampler&&(S+=String(m),S+="%"),t===v.LatencySampler&&g?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:i,fallbackSamplingRatio:n},o)=>{S+=`Endpoint${g.length>1?` #${o+1}`:""}=${e}${t}\n`,S+=` Latency=${i}`,S+=` Sampling=${n}`,o<g.length-1&&(S+=", ")}),t===v.ServiceNameSampler&&b?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:i})=>{S+=`Service Name: ${e}, `,S+=`Sampling Ratio: ${t}, `,S+=`Fallback Sampling Ratio: ${i}\n`}),t===v.SpanAttributeSampler&&y?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:i})=>{S+=`Service Name: ${e}, `,S+=`Attribute Key: ${t}, `,S+=`Fallback Sampling Ratio: ${i}\n`}),t===v.URLTemplatization&&x?.forEach((e,t)=>{const i=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");S+=`Group ${t+1}: ${i}`,t<x.length-1&&(S+="; ")}),S},_n=({conditions:e,id:i})=>{const{errors:n,warnings:o,disableds:a,hasLoadings:r}=c(()=>me(e),[e]),l=n.length>0?n:o.length>0?o:a.length>0?a:[];if(l.length>0)return t("div",{style:{lineHeight:1},children:t(Jn,{conditions:l,id:i})});const s=r?ye.Loading:de.Success;return t("div",{style:{lineHeight:1},children:t(ge,{status:s,title:s,withBorder:!0,withIcon:!0})})},Jn=({conditions:e,id:i})=>{const n=m();return t(F,{children:ve(e).map(({status:e,type:o,reason:a,message:r},l)=>{"loading"!==e&&"disabled"!==e||(e=de.Info);const s=be(e,n);return t(fe,{titleIcon:s,title:o,text:r||a||"",children:t(ge,{status:e,title:a||o,withBorder:!0,withIcon:!0})},`condition-${i}-${e}-${o}-${l}`)})})},Un=({instrumentationRules:e,sources:t,actions:i,destinations:n,searchText:o,selectedCategory:a})=>{const r=o?e.filter(e=>e.type?.toLowerCase().includes(o)||e.ruleName?.toLowerCase().includes(o)):e,l=o?t.filter(e=>e.name?.toLowerCase().includes(o)||e.otelServiceName?.toLowerCase().includes(o)||e.namespace?.toLowerCase().includes(o)):t,s=o?i.filter(e=>e.type?.toLowerCase().includes(o)||e.name?.toLowerCase().includes(o)):i,c=o?n.filter(e=>e.destinationType.displayName?.toLowerCase().includes(o)||e.name?.toLowerCase().includes(o)):n,d=[{category:G.Source,label:"Sources",count:l.length,entities:[]},{category:G.Action,label:"Actions",count:s.length,entities:[]},{category:G.Destination,label:"Destinations",count:c.length,entities:[]},{category:G.InstrumentationRule,label:"Instrumentation Rules",count:r.length,entities:[]}];d.unshift({category:"all",label:"All",count:r.length+l.length+s.length+c.length,entities:[]});const u=d.filter(({count:e,category:t})=>!!e&&"all"!==t&&["all",t].includes(a)).map(e=>({...e,entities:e.category===G.InstrumentationRule?r:e.category===G.Source?l:e.category===G.Action?s:e.category===G.Destination?c:[]}));return{categories:d,searchResults:u}},Gn=[{key:"icon",title:""},{key:"name",title:g.NAME,sortable:!0},{key:"signals",title:g.MONITORS},{key:"active-status",title:g.STATUS},{key:"conditions",title:"Conditions"},{key:"type",title:g.TYPE,sortable:!0},{key:"spec",title:"Spec",sortable:!0},{key:"notes",title:g.NOTES,sortable:!0}],Yn=({maxHeight:i,maxWidth:n})=>{const o=m(),a=xe(),{actions:r,actionsLoading:l}=Y(),{setDrawerType:s,setDrawerEntityId:d}=B(),u=c(()=>Un({instrumentationRules:[],sources:[],actions:Se(r,a),destinations:[],searchText:a.searchText,selectedCategory:G.Action}).searchResults.find(({category:e})=>e===G.Action)?.entities||[],[r,a]),p=c(()=>u.map(e=>{const{hasErrors:i,hasWarnings:n,hasDisableds:a}=me(e.conditions||[]);return{status:i?de.Error:n?de.Warning:void 0,faded:a,onClick:()=>{s(G.Action),d(e.id)},cells:[{columnKey:"icon",component:()=>t($e,{icon:ie(e.type)})},{columnKey:"name",value:Ce(e,G.Action,{prioritizeDisplayName:!0})},{columnKey:"type",value:e.type,textColor:o.text.info},{columnKey:"notes",value:e.notes,textColor:o.text.info,withTooltip:!0},{columnKey:"spec",value:Wn(e),textColor:o.text.info,withTooltip:!0},{columnKey:"signals",component:()=>t(ke,{withLabels:!0,monitors:e.signals||[]})},{columnKey:"conditions",component:()=>t(_n,{conditions:e.conditions||[],id:e.id})},{columnKey:"active-status",component:()=>t("div",{style:{lineHeight:1},children:t(ge,{status:e.disabled?de.Error:de.Success,title:e.disabled?g.DISABLED:g.ENABLED,withIcon:!0,withBorder:!0})})}]}}),[u]),{badge:h,badgeTooltip:y}=c(()=>u.length!==r.length?{badge:`${u.length}/${r.length}`,badgeTooltip:g.FILTERED_COUNT_TOOLTIP}:{badge:r.length,badgeTooltip:void 0},[u,r]);return e(we,{$maxWidth:n,children:[t(Ne,{children:t(Te,{icon:De(G.Action),title:g.ACTIONS,badge:h,badgeTooltip:y,loading:l})}),t(Ee,{$maxHeight:i,children:t(Ae,{columns:Gn,rows:p})}),!u.length&&t(Oe,{style:{marginTop:"2rem"},children:t(Fe,{})})]})},Xn=p(O)`
31
31
  // width: 100vw;
32
32
  // height: 100vh;
33
33
  gap: 64px;
34
34
  align-items: center;
35
35
  justify-content: center;
36
- `,Un=p(F)`
36
+ `,Zn=p(O)`
37
37
  max-width: 400px;
38
38
  gap: 12px;
39
39
  align-items: center;
40
40
  justify-content: center;
41
- `,Gn=p(B)`
41
+ `,Qn=p(V)`
42
42
  text-align: center;
43
43
  font-size: 24px;
44
- `,Yn=p(B)`
44
+ `,eo=p(V)`
45
45
  text-align: center;
46
46
  line-height: 26px;
47
47
  color: ${({theme:e})=>e.text.info};
48
- `,Xn=()=>{const[i,a]=n(0);return o(()=>{(async()=>{for(let e=0;e<=100;e+=5)await Re(500),a(e)})()},[]),e(Jn,{children:[t(Ri,{size:100}),t(Ie,{width:400}),e(Un,{children:[e(O,{$gap:16,children:[t(Gn,{children:"Preparing your workspace..."}),t(Me,{label:`${i}%`})]}),t(Yn,{children:"It can take up to a few minutes. Grab a cup of coffee, look out a window, and enjoy your free moment!"})]})]})},Zn=p(F)`
48
+ `,to=()=>{const[i,a]=n(0);return o(()=>{(async()=>{for(let e=0;e<=100;e+=5)await Re(500),a(e)})()},[]),e(Xn,{children:[t(Pi,{size:100}),t(Ie,{width:400}),e(Zn,{children:[e(F,{$gap:16,children:[t(Qn,{children:"Preparing your workspace..."}),t(Me,{label:`${i}%`})]}),t(eo,{children:"It can take up to a few minutes. Grab a cup of coffee, look out a window, and enjoy your free moment!"})]})]})},io=p(O)`
49
49
  align-items: center !important;
50
50
  justify-content: center !important;
51
51
  align-self: stretch;
@@ -61,9 +61,9 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
61
61
  cursor: pointer;
62
62
 
63
63
  &:hover {
64
- background-color: ${({theme:e})=>e.colors.dropdown_bg_2+L["030"]};
64
+ background-color: ${({theme:e})=>e.colors.dropdown_bg_2+P["030"]};
65
65
  }
66
- `,Qn=({entityType:i,description:n})=>{const{setCurrentModal:o}=ae();return e(Zn,{onClick:()=>o(i),children:[e(O,{$gap:4,children:[t(Pi,{}),e(B,{size:14,weight:600,family:"secondary",decoration:"underline",children:["Add ",i]})]}),t(B,{size:12,align:"center",children:n})]})},eo=p.div`
66
+ `,no=({entityType:i,description:n})=>{const{setCurrentModal:o}=ae();return e(io,{onClick:()=>o(i),children:[e(F,{$gap:4,children:[t(Li,{}),e(V,{size:14,weight:600,family:"secondary",decoration:"underline",children:["Add ",i]})]}),t(V,{size:12,align:"center",children:n})]})},oo=p.div`
67
67
  position: relative;
68
68
  width: 100%;
69
69
  padding: 12px 0;
@@ -71,13 +71,13 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
71
71
  display: flex;
72
72
  align-items: center;
73
73
  border-bottom: 1px solid ${({theme:e})=>e.colors.border};
74
- `,to=p(O)`
74
+ `,ao=p(F)`
75
75
  margin-left: ${({$marginLeft:e})=>e};
76
- `,io=p(Le)`
76
+ `,ro=p(Pe)`
77
77
  width: 24px;
78
78
  height: 24px;
79
79
  padding: 0;
80
- `,no=p.div`
80
+ `,lo=p.div`
81
81
  position: absolute;
82
82
  bottom: -2px;
83
83
  left: 0;
@@ -86,7 +86,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
86
86
  height: 4px;
87
87
  width: ${({percent:e})=>`${e}%`};
88
88
  transition: width 0.3s;
89
- `,oo=({entityType:i,badge:n,badgeTooltip:o,isLoading:a,refetch:r,partiallySelected:l,allSelected:s,onSelectAll:c,progressPercent:d})=>{const u=m(),{setCurrentModal:p}=ae(),h=Ne(i);return e(eo,{children:[c&&t(to,{$marginLeft:"28px",children:t($,{partiallyChecked:l,value:s,onChange:c})}),t(to,{$marginLeft:i===G.Source?"0":"28px",children:t(Te,{icon:h,title:`${i}s`,badge:n,badgeTooltip:o,loading:!1})}),e(to,{$marginLeft:"auto",children:[t(io,{"data-id":`refresh-${i}`,variant:"secondary",onClick:r,disabled:a,children:a?t(Pe,{scale:.8}):t(Li,{fill:u.colors.secondary,size:18})}),t(io,{"data-id":`add-${i}`,variant:"primary",onClick:()=>p(i),children:t(Pi,{fill:u.colors.primary,size:18})})]}),"number"==typeof d&&t(no,{percent:d})]})},ao=p.div`
89
+ `,so=({entityType:i,badge:n,badgeTooltip:o,isLoading:a,refetch:r,partiallySelected:l,allSelected:s,onSelectAll:c,progressPercent:d})=>{const u=m(),{setCurrentModal:p}=ae(),h=De(i);return e(oo,{children:[c&&t(ao,{$marginLeft:"28px",children:t(S,{partiallyChecked:l,value:s,onChange:c})}),t(ao,{$marginLeft:i===G.Source?"0":"28px",children:t(Te,{icon:h,title:`${i}s`,badge:n,badgeTooltip:o,loading:!1})}),e(ao,{$marginLeft:"auto",children:[t(ro,{"data-id":`refresh-${i}`,variant:"secondary",onClick:r,disabled:a,children:a?t(Ke,{scale:.8}):t(zi,{fill:u.colors.secondary,size:18})}),t(ro,{"data-id":`add-${i}`,variant:"primary",onClick:()=>p(i),children:t(Li,{fill:u.colors.primary,size:18})})]}),"number"==typeof d&&t(lo,{percent:d})]})},co=p.div`
90
90
  padding: 2px 6px;
91
91
  background-color: ${({theme:e})=>e.colors.primary};
92
92
  border-radius: 360px;
@@ -101,7 +101,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
101
101
  align-items: center;
102
102
  justify-content: center;
103
103
  white-space: nowrap;
104
- `,ro=({entityId:i,entityType:n,status:o,faded:a,title:r,subTitle:l,tooltip:s,label:c,icon:d,icons:u,iconSrc:p,iconSrcs:h,monitors:g,isActive:y,raw:v})=>{const f=m(),b=n===G.Source,x="boolean"==typeof y,{setDrawerType:$,setDrawerEntityId:S}=V(),{selectedSources:C,setSelectedSources:k}=Ke(),w={...C},{namespace:D,name:T,kind:N}=v;b&&!w[D]&&(w[D]=[]);const E=b?w[D].findIndex(e=>e.name===T&&e.kind===N):-1;return t(je,{"data-id":n===G.Source?`${i.namespace}-${i.name}-${i.kind}`:i,title:r,subTitle:l,onClick:()=>{$(n),S(i)},renderActions:()=>{const i=b&&(!v.conditions?.length||v.conditions?.some(({status:e})=>"loading"===e)),n=x&&!y?be(de.Info,f):o?be(o,f):void 0,a=i?t(Pe,{scale:.8}):n?t(n,{size:14}):null;return c?e(ao,{$isError:o===de.Error,children:[t(fe,{text:s||"Heads up! The data-flow metrics you see are calculated over 10-second intervals.",children:c}),a]}):a||null},iconProps:{icon:d,icons:u,iconSrc:p,iconSrcs:h},visualProps:{status:o,faded:a||x&&!y,monitors:g||void 0},checkboxProps:{withCheckbox:b,isChecked:-1!==E,onCheckboxChange:()=>{-1===E?w[D].push(v):w[D].splice(E,1),k(w)}}})};function lo(e){const t=e.conditions?.some(({status:e})=>e===ye.Loading);return t?e:{...e,conditions:[{status:ye.Loading,type:"Pending",message:""}]}}function so(e){const t=e.conditions?.filter(({status:e})=>e!==ye.Loading);return t?.length===e.conditions?.length?e:{...e,conditions:t?.length?t:[{status:de.Success,type:"Healthy",message:""}]}}const co=p.div`
104
+ `,uo=({entityId:i,entityType:n,status:o,faded:a,title:r,subTitle:l,tooltip:s,label:c,icon:d,icons:u,iconSrc:p,iconSrcs:h,monitors:g,isActive:y,raw:v})=>{const f=m(),b=n===G.Source,x="boolean"==typeof y,{setDrawerType:S,setDrawerEntityId:$}=B(),{selectedSources:C,setSelectedSources:k}=Le(),w={...C},{namespace:N,name:T,kind:D}=v;b&&!w[N]&&(w[N]=[]);const E=b?w[N].findIndex(e=>e.name===T&&e.kind===D):-1;return t(ze,{"data-id":n===G.Source?`${i.namespace}-${i.name}-${i.kind}`:i,title:r,subTitle:l,onClick:()=>{S(n),$(i)},renderActions:()=>{const i=b&&(!v.conditions?.length||v.conditions?.some(({status:e})=>"loading"===e)),n=x&&!y?be(de.Info,f):o?be(o,f):void 0,a=i?t(Ke,{scale:.8}):n?t(n,{size:14}):null;return c?e(co,{$isError:o===de.Error,children:[t(fe,{text:s||"Heads up! The data-flow metrics you see are calculated over 10-second intervals.",children:c}),a]}):a||null},iconProps:{icon:d,icons:u,iconSrc:p,iconSrcs:h},visualProps:{status:o,faded:a||x&&!y,monitors:g||void 0},checkboxProps:{withCheckbox:b,isChecked:-1!==E,onCheckboxChange:()=>{-1===E?w[N].push(v):w[N].splice(E,1),k(w)}}})};function po(e){const t=e.conditions?.some(({status:e})=>e===ye.Loading);return t?e:{...e,conditions:[{status:ye.Loading,type:"Pending",message:""}]}}function ho(e){const t=e.conditions?.filter(({status:e})=>e!==ye.Loading);return t?.length===e.conditions?.length?e:{...e,conditions:t?.length?t:[{status:de.Success,type:"Healthy",message:""}]}}const mo=p.div`
105
105
  position: absolute;
106
106
  top: 12px;
107
107
  left: 12px;
@@ -112,23 +112,23 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
112
112
  border-bottom: 1px solid ${({theme:e})=>e.colors.border};
113
113
  border-radius: 12px 12px 0 0;
114
114
  pointer-events: none;
115
- `,uo=p.span`
115
+ `,go=p.span`
116
116
  font-family: ${({theme:e})=>e.font_family.primary};
117
117
  font-size: 11px;
118
118
  font-weight: 600;
119
119
  color: ${({theme:e})=>e.text.grey};
120
120
  text-transform: uppercase;
121
121
  letter-spacing: 0.5px;
122
- `,po=p.div`
122
+ `,yo=p.div`
123
123
  display: flex;
124
124
  align-items: center;
125
125
  gap: 8px;
126
126
  padding: 4px 8px 0;
127
- `,ho=p.div`
127
+ `,vo=p.div`
128
128
  flex: 1;
129
129
  height: 1px;
130
130
  background: ${({theme:e})=>e.colors.border};
131
- `,mo=p.span`
131
+ `,fo=p.span`
132
132
  font-family: ${({theme:e})=>e.font_family.secondary};
133
133
  font-size: 10px;
134
134
  font-weight: 600;
@@ -136,7 +136,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
136
136
  text-transform: uppercase;
137
137
  letter-spacing: 0.5px;
138
138
  white-space: nowrap;
139
- `,go=({namespace:e})=>t(co,{children:t(uo,{children:e})}),yo=({namespace:i})=>e(po,{children:[t(ho,{}),t(mo,{children:i}),t(ho,{})]}),vo=p.div`
139
+ `,bo=({namespace:e})=>t(mo,{children:t(go,{children:e})}),xo=({namespace:i})=>e(yo,{children:[t(vo,{}),t(fo,{children:i}),t(vo,{})]}),So=p.div`
140
140
  height: calc(${({$height:e})=>e}px - 24px);
141
141
  width: calc(100% - 24px);
142
142
  padding: 12px;
@@ -144,7 +144,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
144
144
  border: 1px dashed ${({theme:e})=>e.colors.border};
145
145
  border-radius: 24px;
146
146
  position: relative;
147
- `,fo=p.div`
147
+ `,$o=p.div`
148
148
  position: absolute;
149
149
  bottom: 0;
150
150
  left: 0;
@@ -159,18 +159,18 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
159
159
  justify-content: center;
160
160
 
161
161
  pointer-events: none;
162
- `,bo={[G.Source]:{subTitle:(e,t)=>t?e.kind:`${e.namespace} • ${e.kind}`,icons:e=>({icons:_e(e),icon:Ne(G.Source)}),withMetrics:!0},[G.Destination]:{subTitle:e=>e.destinationType.displayName,icons:e=>We(e.destinationType.type),withMetrics:!0,withMonitors:!0,withActive:!0},[G.Action]:{subTitle:e=>e.type,icons:e=>({icon:ie(e.type)}),withMonitors:!0,withActive:!0},[G.InstrumentationRule]:{subTitle:e=>e.type,icons:e=>({icon:He(e.type)}),withActive:!0},[G.Namespace]:{subTitle:()=>"",icons:()=>({icon:Ne(G.Namespace)})}};const xo=({height:i,entityType:a,entities:r,metrics:l})=>{const{isVm:s}=oe(),u=a===G.Source,[p,h]=n(""),m=c(()=>r.map(e=>function(e,t,i,n){const o=Z(e);if(!o)return null;const a=bo[t],r=t===G.Source,l=a.withMonitors?t===G.Destination?Be(e.exportedSignals):e.signals:void 0,s=a.withMetrics?n?.[`${t.toLowerCase()}s`]?.find(e=>JSON.stringify(Z(e))===JSON.stringify(o)):void 0,c=a.withActive?!e.disabled:void 0;let d,u,p=!1,h=e;if(r){const t=function(e){const t=e.workloadOdigosHealthStatus?.status;switch(t){case ze.Failure:return{status:de.Error,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message??void 0,displaySource:e};case ze.Notice:return{status:de.Warning,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message??void 0,displaySource:e};case ze.Pending:case ze.Waiting:return{status:void 0,faded:!1,displaySource:lo(e)};case ze.Unsupported:case ze.Disabled:return{status:void 0,faded:!0,displaySource:e};default:return{status:void 0,faded:!1,displaySource:so(e)}}}(e);d=t.status,p=t.faded,u=t.tooltip,h=t.displaySource}else{const{priorotizedStatus:t,hasDisableds:i}=me(e.conditions||[]);d=t,p=i}return{entityId:o,namespace:r?e.namespace:void 0,title:Ce(e,t,{extended:r,prioritizeDisplayName:!r}),subTitle:a.subTitle(e,i),status:d,faded:p,tooltip:u,label:a.withMetrics?Ve(s?.throughput):void 0,...a.icons(e),monitors:l,isActive:c,raw:h}}(e,a,s,l)).filter(Boolean),[r,a,l,s]),{elements:g,indexToNamespace:y,multipleNs:v}=c(()=>{const e=[],i=[],n=new Set(m.map(e=>e.namespace).filter(Boolean)).size>1;n&&(i.push(""),e.push(t("div",{style:{height:28}},"ns-spacer")));let o="";for(const n of m)u&&n.namespace&&n.namespace!==o&&(""!==o&&(i.push(n.namespace),e.push(t(yo,{namespace:n.namespace},`ns-divider-${n.namespace}`))),o=n.namespace),i.push(n.namespace||""),e.push(t(ro,{entityType:a,entityId:n.entityId,raw:n.raw,title:n.title,subTitle:n.subTitle,faded:n.faded,status:n.status,tooltip:n.tooltip,label:n.label,icons:n.icons,icon:n.icon,iconSrc:n.iconSrc,monitors:n.monitors,isActive:n.isActive},JSON.stringify(n.entityId)));return{elements:e,indexToNamespace:i,multipleNs:n}},[m,a,u]);o(()=>{if(u&&y.length&&!p){const e=y.find(Boolean);e&&h(e)}},[u,y]);const f=d(e=>{if(!y.length)return;const t=y[Math.min(e,y.length-1)];t&&t!==p&&h(t)},[y,p]);return e(vo,{$height:i,children:[v&&p&&t(go,{namespace:p}),t(qe,{gap:8,elements:g,onTopIndexChange:v?f:void 0}),t(fo,{$hide:!0})]})},$o=p.div`
162
+ `,Co={[G.Source]:{subTitle:(e,t)=>t?e.kind:`${e.namespace} • ${e.kind}`,icons:e=>({icons:_e(e),icon:De(G.Source)}),withMetrics:!0},[G.Destination]:{subTitle:e=>e.destinationType.displayName,icons:e=>We(e.destinationType.type),withMetrics:!0,withMonitors:!0,withActive:!0},[G.Action]:{subTitle:e=>e.type,icons:e=>({icon:ie(e.type)}),withMonitors:!0,withActive:!0},[G.InstrumentationRule]:{subTitle:e=>e.type,icons:e=>({icon:He(e.type)}),withActive:!0},[G.Namespace]:{subTitle:()=>"",icons:()=>({icon:De(G.Namespace)})}};const ko=({height:i,entityType:a,entities:r,metrics:l})=>{const{isVm:s}=oe(),u=a===G.Source,[p,h]=n(""),m=c(()=>r.map(e=>function(e,t,i,n){const o=Z(e);if(!o)return null;const a=Co[t],r=t===G.Source,l=a.withMonitors?t===G.Destination?Ve(e.exportedSignals):e.signals:void 0,s=a.withMetrics?n?.[`${t.toLowerCase()}s`]?.find(e=>JSON.stringify(Z(e))===JSON.stringify(o)):void 0,c=a.withActive?!e.disabled:void 0;let d,u,p=!1,h=e;if(r){const t=function(e){const t=e.workloadOdigosHealthStatus?.status;switch(t){case je.Failure:return{status:de.Error,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message??void 0,displaySource:e};case je.Notice:return{status:de.Warning,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message??void 0,displaySource:e};case je.Pending:case je.Waiting:return{status:void 0,faded:!1,displaySource:po(e)};case je.Unsupported:case je.Disabled:return{status:void 0,faded:!0,displaySource:e};default:return{status:void 0,faded:!1,displaySource:ho(e)}}}(e);d=t.status,p=t.faded,u=t.tooltip,h=t.displaySource}else{const{priorotizedStatus:t,hasDisableds:i}=me(e.conditions||[]);d=t,p=i}return{entityId:o,namespace:r?e.namespace:void 0,title:Ce(e,t,{extended:r,prioritizeDisplayName:!r}),subTitle:a.subTitle(e,i),status:d,faded:p,tooltip:u,label:a.withMetrics?Be(s?.throughput):void 0,...a.icons(e),monitors:l,isActive:c,raw:h}}(e,a,s,l)).filter(Boolean),[r,a,l,s]),{elements:g,indexToNamespace:y,multipleNs:v}=c(()=>{const e=[],i=[],n=new Set(m.map(e=>e.namespace).filter(Boolean)).size>1;n&&(i.push(""),e.push(t("div",{style:{height:28}},"ns-spacer")));let o="";for(const n of m)u&&n.namespace&&n.namespace!==o&&(""!==o&&(i.push(n.namespace),e.push(t(xo,{namespace:n.namespace},`ns-divider-${n.namespace}`))),o=n.namespace),i.push(n.namespace||""),e.push(t(uo,{entityType:a,entityId:n.entityId,raw:n.raw,title:n.title,subTitle:n.subTitle,faded:n.faded,status:n.status,tooltip:n.tooltip,label:n.label,icons:n.icons,icon:n.icon,iconSrc:n.iconSrc,monitors:n.monitors,isActive:n.isActive},JSON.stringify(n.entityId)));return{elements:e,indexToNamespace:i,multipleNs:n}},[m,a,u]);o(()=>{if(u&&y.length&&!p){const e=y.find(Boolean);e&&h(e)}},[u,y]);const f=d(e=>{if(!y.length)return;const t=y[Math.min(e,y.length-1)];t&&t!==p&&h(t)},[y,p]);return e(So,{$height:i,children:[v&&p&&t(bo,{namespace:p}),t(qe,{gap:8,elements:g,onTopIndexChange:v?f:void 0}),t($o,{$hide:!0})]})},wo=p.div`
163
163
  width: ${({$isVm:e})=>e?"45vw":"22vw"};
164
164
  display: flex;
165
165
  flex-direction: column;
166
166
  gap: 12px;
167
- `,So=({entityType:i,entities:n,unfilteredCount:o,metrics:a,loading:r,maxHeight:l,refetch:s})=>{const{isVm:d}=oe(),{frameHeight:u,hasFiltersApplied:p,isSources:h}=c(()=>({frameHeight:Math.min(l,80*n.length+12),hasFiltersApplied:n.length!==o,isSources:i===G.Source}),[i,n.length,l,o]),{progress:m}=Je(),y=c(()=>h&&(m[Ue.Instrumenting]||m[Ue.Uninstrumenting])?m[Ue.Instrumenting]?.percentage||m[Ue.Uninstrumenting]?.percentage||0:void 0,[h,m[Ue.Instrumenting],m[Ue.Uninstrumenting]]),{selectedSources:v,setSelectedSources:f}=Ke(),b=c(()=>h?Object.values(v).reduce((e,t)=>e+t.length,0):0,[h,v]);return d&&[G.InstrumentationRule,G.Action].includes(i)?null:e($o,{$isVm:d,children:[t(oo,{entityType:i,badge:"number"==typeof y?`${y}%`:p?`${n.length}/${o}`:o,badgeTooltip:p?g.FILTERED_COUNT_TOOLTIP:void 0,isLoading:r,refetch:s,partiallySelected:b>0&&n?.length!==b,allSelected:b>0&&n?.length===b,onSelectAll:h?e=>{if(h)if(e){const e={};n?.forEach(t=>{const{namespace:i}=t;e[i]?e[i].push(t):e[i]=[t]}),f(e)}else f({})}:void 0,progressPercent:y}),n.length?t(xo,{height:u,entityType:i,entities:n,metrics:a}):r?t(Ge,{size:3}):t(Qn,{entityType:i,description:g.TO_COLLECT_OTEL_DATA})]})},Co=p.div`
167
+ `,No=({entityType:i,entities:n,unfilteredCount:o,metrics:a,loading:r,maxHeight:l,refetch:s})=>{const{isVm:d}=oe(),{frameHeight:u,hasFiltersApplied:p,isSources:h}=c(()=>({frameHeight:Math.min(l,80*n.length+12),hasFiltersApplied:n.length!==o,isSources:i===G.Source}),[i,n.length,l,o]),{progress:m}=Je(),y=c(()=>h&&(m[Ue.Instrumenting]||m[Ue.Uninstrumenting])?m[Ue.Instrumenting]?.percentage||m[Ue.Uninstrumenting]?.percentage||0:void 0,[h,m[Ue.Instrumenting],m[Ue.Uninstrumenting]]),{selectedSources:v,setSelectedSources:f}=Le(),b=c(()=>h?Object.values(v).reduce((e,t)=>e+t.length,0):0,[h,v]);return d&&[G.InstrumentationRule,G.Action].includes(i)?null:e(wo,{$isVm:d,children:[t(so,{entityType:i,badge:"number"==typeof y?`${y}%`:p?`${n.length}/${o}`:o,badgeTooltip:p?g.FILTERED_COUNT_TOOLTIP:void 0,isLoading:r,refetch:s,partiallySelected:b>0&&n?.length!==b,allSelected:b>0&&n?.length===b,onSelectAll:h?e=>{if(h)if(e){const e={};n?.forEach(t=>{const{namespace:i}=t;e[i]?e[i].push(t):e[i]=[t]}),f(e)}else f({})}:void 0,progressPercent:y}),n.length?t(ko,{height:u,entityType:i,entities:n,metrics:a}):r?t(Ge,{size:3}):t(no,{entityType:i,description:g.TO_COLLECT_OTEL_DATA})]})},To=p.div`
168
168
  width: 100%;
169
169
  height: ${({$height:e})=>e};
170
170
  display: flex;
171
171
  justify-content: space-evenly;
172
172
  gap: 24px;
173
- `,ko=({height:i,metrics:a,refetchSources:r,refetchDestinations:l,refetchActions:s,refetchInstrumentationRules:d})=>{const u=xe(),{selectedStreamName:p}=Ye(),{containerRef:h,containerHeight:m}=Xe(),{sources:g,sourcesLoading:y,destinations:v,destinationsLoading:f,actions:b,actionsLoading:x,instrumentationRules:$,instrumentationRulesLoading:S}=Y(),C=c(()=>Ze(g,p),[g,p]),k=c(()=>Qe(v,p),[v,p]),[w,D]=n([]),[T,N]=n([]),[E,A]=n([]),[F,O]=n([]);return o(()=>{D(et(C,u))},[C,u]),o(()=>{N(tt(k,u))},[k,u]),o(()=>{A($e(b,u))},[b,u]),o(()=>{O($)},[$]),e(Co,{ref:h,$height:i,children:[t(So,{entityType:G.InstrumentationRule,entities:F,unfilteredCount:$.length,loading:S,maxHeight:m,refetch:d}),t(So,{entityType:G.Source,entities:w,unfilteredCount:C.length,metrics:a,loading:y,maxHeight:m,refetch:r}),t(So,{entityType:G.Action,entities:E,unfilteredCount:b.length,loading:x,maxHeight:m,refetch:s}),t(So,{entityType:G.Destination,entities:T,unfilteredCount:k.length,metrics:a,loading:f,maxHeight:m,refetch:l})]})},wo=p.div`
173
+ `,Do=({height:i,metrics:a,refetchSources:r,refetchDestinations:l,refetchActions:s,refetchInstrumentationRules:d})=>{const u=xe(),{selectedStreamName:p}=Ye(),{containerRef:h,containerHeight:m}=Xe(),{sources:g,sourcesLoading:y,destinations:v,destinationsLoading:f,actions:b,actionsLoading:x,instrumentationRules:S,instrumentationRulesLoading:$}=Y(),C=c(()=>Ze(g,p),[g,p]),k=c(()=>Qe(v,p),[v,p]),[w,N]=n([]),[T,D]=n([]),[E,A]=n([]),[O,F]=n([]);return o(()=>{N(et(C,u))},[C,u]),o(()=>{D(tt(k,u))},[k,u]),o(()=>{A(Se(b,u))},[b,u]),o(()=>{F(S)},[S]),e(To,{ref:h,$height:i,children:[t(No,{entityType:G.InstrumentationRule,entities:O,unfilteredCount:S.length,loading:$,maxHeight:m,refetch:d}),t(No,{entityType:G.Source,entities:w,unfilteredCount:C.length,metrics:a,loading:y,maxHeight:m,refetch:r}),t(No,{entityType:G.Action,entities:E,unfilteredCount:b.length,loading:x,maxHeight:m,refetch:s}),t(No,{entityType:G.Destination,entities:T,unfilteredCount:k.length,metrics:a,loading:f,maxHeight:m,refetch:l})]})},Eo=p.div`
174
174
  position: relative;
175
175
  max-width: 200px;
176
176
  `;p.div`
@@ -184,60 +184,60 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
184
184
  background-color: ${({theme:e})=>e.colors.dropdown_bg};
185
185
  border: ${({theme:e})=>`1px solid ${e.colors.border}`};
186
186
  border-radius: 24px;
187
- `;const Do=p.div`
187
+ `;const Ao=p.div`
188
188
  display: flex;
189
189
  align-items: center;
190
190
  overflow-x: scroll;
191
- `,To=({onClose:i})=>{const r=m(),{onClickNode:l}=it(),{searchText:s}=xe(),{selectedStreamName:d}=Ye(),{sources:u,destinations:p,actions:h,instrumentationRules:g}=Y(),{popupRef:y,popupOpen:v,setPopupOpen:f,popupPosition:b,handlePosition:x}=nt();o(()=>{v||(x(0,50),f(!0))},[v]);const[$,S]=n("all"),{categories:C,searchResults:k}=c(()=>Hn({instrumentationRules:g,sources:Ze(u,d),actions:h,destinations:Qe(p,d),searchText:s,selectedCategory:$}),[g,u,h,p,d,s,$]);return k.length?t(ot,{ref:y,isOpen:v,top:b.top,left:b.left,maxWidth:"420px",header:t(Do,{children:C.map(({category:e,label:i,count:n})=>!!n&&t(rt,{label:i,badgeLabel:n,isSelected:$===e,onClick:()=>S(e)},`category-select-${e}`))}),children:k.map(({category:n,label:o,entities:s},c)=>!!s.length&&e(a,{children:[e(at,{style:{maxHeight:"all"!==$?"240px":"140px",padding:"12px 0"},children:[t(B,{size:12,family:"secondary",color:r.text.darker_grey,style:{marginLeft:"16px"},children:o}),s.map((e,o)=>t(rt,{icon:Ne(n),label:Ce(e,n,{extended:!0}),onClick:()=>{const t=Z(e);l(null,{data:{type:n,id:t}}),i()},style:{width:"100%",justifyContent:"flex-start"},color:"transparent"},`entity-${c}-${o}`))]}),t(A,{thickness:c===k.length-1?0:1,length:"90%",margin:"8px auto"})]},`category-list-${n}`))}):t(ot,{ref:y,isOpen:v,top:b.top,left:b.left,children:t(Oe,{})})},No=({preventPopup:i=!1})=>{const{searchText:o,setSearchText:a}=xe(),[r,s]=n(!1),c=!!o||r,d=()=>{a(""),s(!1)},u=l(null);return lt(u,d),H({key:"Escape",active:c},d),e(wo,{ref:u,children:[t(C,{placeholder:"Search",icon:Ki,value:o,onChange:e=>a(e.target.value.toLowerCase()),onFocus:()=>s(!0)}),c&&!i?t(To,{onClose:d}):null]})},Eo=({sources:e,title:i="Condition",value:n,onSelect:o,onDeselect:a,...r})=>{const l=c(()=>{const t=[];return e.forEach(({conditions:e})=>{e?.forEach(({type:e,reason:i})=>{t.find(t=>t.id===`${e}#${i}`)||t.push({id:`${e}#${i}`,value:`${st(e)} - ${st(i)}`})})}),t.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[e]);return t(ct,{disabled:!l?.length,title:i,placeholder:"All",options:l,value:n,onSelect:o,onDeselect:a,...r})},Ao=({sources:e,title:i="Error Message",value:n,onSelect:o,onDeselect:a,disabled:r,...l})=>{const s=c(()=>{const t=[];return e.forEach(({conditions:e})=>{ve(e||[]).forEach(({status:e,message:i,reason:n})=>{e!==de.Error||t.find(e=>e.id===i)||(i?t.find(e=>e.id===i)||t.push({id:i,value:i}):n&&(t.find(e=>e.id===n)||t.push({id:n,value:n})))})}),t},[e]);return t(ct,{disabled:r||!s?.length,title:i,placeholder:"All",options:s,value:n,onSelect:o,onDeselect:a,...l})},Fo=({sources:e,title:i="Programming Language",value:n,onSelect:o,onDeselect:a,...r})=>{const l=c(()=>{const t=[];return e.forEach(({containers:e})=>{e?.forEach(({language:e})=>{t.find(t=>t.id===e)||t.push({id:e,value:dt[e]||e})})}),t.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[e]);return t(ct,{disabled:!l?.length,title:i,placeholder:"All",options:l,value:n,onSelect:o,onDeselect:a,...r})},Oo=({title:e="Monitors",value:i,onSelect:n,onDeselect:o,...a})=>{const r=c(()=>{const e=[];return ut.forEach(({id:t,value:i})=>{e.find(e=>e.id===t)||e.push({id:t,value:i})}),e},[]);return t(ct,{disabled:!r?.length,title:e,placeholder:"All",options:r,value:i,onSelect:n,onDeselect:o,...a})},Io=({namespaces:e,title:i="Namespace",value:n,onSelect:o,onDeselect:a,...r})=>{const l=c(()=>{const t=[];return e?.forEach(({name:e})=>{t.find(t=>t.id===e)||t.push({id:e,value:e})}),t},[e]);return t(ct,{disabled:!l?.length,title:i,placeholder:"Select namespace",options:l,value:n,onSelect:o,onDeselect:a,...r})},Mo=({sources:e,title:i="Kind",value:n,onSelect:o,onDeselect:a,...r})=>{const l=c(()=>{const t=[];return e.forEach(({kind:e})=>{t.find(t=>t.id===e)||t.push({id:e,value:e})}),t},[e]);return t(ct,{disabled:!l?.length,title:i,placeholder:"All",options:l,value:n,onSelect:o,onDeselect:a,...r})},Ro=({sources:e,title:i="Agent Injection Status",value:n,onSelect:o,onDeselect:a,disabled:r,...l})=>{const s=c(()=>{const t=[];return e.forEach(({podsAgentInjectionStatus:e})=>{const{reasonEnum:i,message:n}=e||{};i?t.find(e=>e.id===i)||t.push({id:i,value:st(i)}):n&&(t.find(e=>e.id===n)||t.push({id:n,value:n}))}),t},[e]);return t(ct,{disabled:r||!s?.length,title:i,placeholder:"All",options:s,value:n,onSelect:o,onDeselect:a,...l})},Po=p.div`
191
+ `,Oo=({onClose:i})=>{const r=m(),{onClickNode:l}=it(),{searchText:s}=xe(),{selectedStreamName:d}=Ye(),{sources:u,destinations:p,actions:h,instrumentationRules:g}=Y(),{popupRef:y,popupOpen:v,setPopupOpen:f,popupPosition:b,handlePosition:x}=nt();o(()=>{v||(x(0,50),f(!0))},[v]);const[S,$]=n("all"),{categories:C,searchResults:k}=c(()=>Un({instrumentationRules:g,sources:Ze(u,d),actions:h,destinations:Qe(p,d),searchText:s,selectedCategory:S}),[g,u,h,p,d,s,S]);return k.length?t(ot,{ref:y,isOpen:v,top:b.top,left:b.left,maxWidth:"420px",header:t(Ao,{children:C.map(({category:e,label:i,count:n})=>!!n&&t(rt,{label:i,badgeLabel:n,isSelected:S===e,onClick:()=>$(e)},`category-select-${e}`))}),children:k.map(({category:n,label:o,entities:s},c)=>!!s.length&&e(a,{children:[e(at,{style:{maxHeight:"all"!==S?"240px":"140px",padding:"12px 0"},children:[t(V,{size:12,family:"secondary",color:r.text.darker_grey,style:{marginLeft:"16px"},children:o}),s.map((e,o)=>t(rt,{icon:De(n),label:Ce(e,n,{extended:!0}),onClick:()=>{const t=Z(e);l(null,{data:{type:n,id:t}}),i()},style:{width:"100%",justifyContent:"flex-start"},color:"transparent"},`entity-${c}-${o}`))]}),t(A,{thickness:c===k.length-1?0:1,length:"90%",margin:"8px auto"})]},`category-list-${n}`))}):t(ot,{ref:y,isOpen:v,top:b.top,left:b.left,children:t(Fe,{})})},Fo=({preventPopup:i=!1})=>{const{searchText:o,setSearchText:a}=xe(),[r,s]=n(!1),c=!!o||r,d=()=>{a(""),s(!1)},u=l(null);return lt(u,d),H({key:"Escape",active:c},d),e(Eo,{ref:u,children:[t(C,{placeholder:"Search",icon:ji,value:o,onChange:e=>a(e.target.value.toLowerCase()),onFocus:()=>s(!0)}),c&&!i?t(Oo,{onClose:d}):null]})},Io=({sources:e,title:i="Condition",value:n,onSelect:o,onDeselect:a,...r})=>{const l=c(()=>{const t=[];return e.forEach(({conditions:e})=>{e?.forEach(({type:e,reason:i})=>{t.find(t=>t.id===`${e}#${i}`)||t.push({id:`${e}#${i}`,value:`${st(e)} - ${st(i)}`})})}),t.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[e]);return t(ct,{disabled:!l?.length,title:i,placeholder:"All",options:l,value:n,onSelect:o,onDeselect:a,...r})},Mo=({sources:e,title:i="Error Message",value:n,onSelect:o,onDeselect:a,disabled:r,...l})=>{const s=c(()=>{const t=[];return e.forEach(({conditions:e})=>{ve(e||[]).forEach(({status:e,message:i,reason:n})=>{e!==de.Error||t.find(e=>e.id===i)||(i?t.find(e=>e.id===i)||t.push({id:i,value:i}):n&&(t.find(e=>e.id===n)||t.push({id:n,value:n})))})}),t},[e]);return t(ct,{disabled:r||!s?.length,title:i,placeholder:"All",options:s,value:n,onSelect:o,onDeselect:a,...l})},Ro=({sources:e,title:i="Programming Language",value:n,onSelect:o,onDeselect:a,...r})=>{const l=c(()=>{const t=[];return e.forEach(({containers:e})=>{e?.forEach(({language:e})=>{t.find(t=>t.id===e)||t.push({id:e,value:dt[e]||e})})}),t.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[e]);return t(ct,{disabled:!l?.length,title:i,placeholder:"All",options:l,value:n,onSelect:o,onDeselect:a,...r})},Ko=({title:e="Monitors",value:i,onSelect:n,onDeselect:o,...a})=>{const r=c(()=>{const e=[];return ut.forEach(({id:t,value:i})=>{e.find(e=>e.id===t)||e.push({id:t,value:i})}),e},[]);return t(ct,{disabled:!r?.length,title:e,placeholder:"All",options:r,value:i,onSelect:n,onDeselect:o,...a})},Po=({namespaces:e,title:i="Namespace",value:n,onSelect:o,onDeselect:a,...r})=>{const l=c(()=>{const t=[];return e?.forEach(({name:e})=>{t.find(t=>t.id===e)||t.push({id:e,value:e})}),t},[e]);return t(ct,{disabled:!l?.length,title:i,placeholder:"Select namespace",options:l,value:n,onSelect:o,onDeselect:a,...r})},Lo=({sources:e,title:i="Kind",value:n,onSelect:o,onDeselect:a,...r})=>{const l=c(()=>{const t=[];return e.forEach(({kind:e})=>{t.find(t=>t.id===e)||t.push({id:e,value:e})}),t},[e]);return t(ct,{disabled:!l?.length,title:i,placeholder:"All",options:l,value:n,onSelect:o,onDeselect:a,...r})},zo=({sources:e,title:i="Agent Injection Status",value:n,onSelect:o,onDeselect:a,disabled:r,...l})=>{const s=c(()=>{const t=[];return e.forEach(({podsAgentInjectionStatus:e})=>{const{reasonEnum:i,message:n}=e||{};i?t.find(e=>e.id===i)||t.push({id:i,value:st(i)}):n&&(t.find(e=>e.id===n)||t.push({id:n,value:n}))}),t},[e]);return t(ct,{disabled:r||!s?.length,title:i,placeholder:"All",options:s,value:n,onSelect:o,onDeselect:a,...l})},jo=p.div`
192
192
  display: flex;
193
193
  flex-direction: column;
194
194
  gap: 12px;
195
195
  padding: 12px;
196
- `,Lo=p.div`
196
+ `,qo=p.div`
197
197
  padding: 12px 6px 6px 6px;
198
- `,Ko=p(Le)`
198
+ `,Vo=p(Pe)`
199
199
  font-size: 14px;
200
200
  ${({$color:e})=>`color: ${e};`}
201
- `,jo=p.div`
201
+ `,Bo=p.div`
202
202
  margin-left: auto;
203
- `,zo=e=>{let t=0;return Object.values(e).forEach(e=>{e&&Array.isArray(e)&&e.length>0&&(t+=e.length)}),e.onlyErrors&&t++,e.searchText&&t++,t},qo=()=>{const i=m(),{namespaces:a,sources:r}=Y(),{selectedStreamName:s}=Ye(),{getItemSS:d,setItemSS:u,removeItemSS:p}=ht(),{popupRef:h,popupOpen:g,setPopupOpen:y,popupPosition:v,handlePosition:f}=nt(),{namespaces:b,kinds:x,monitors:$,languages:S,conditions:C,errors:k,onlyErrors:w,podsAgentInjectionStatus:D,setAll:N,clearAll:E,getEmptyState:A}=xe(),F=c(()=>Ze(r,s),[r,s]),[I,M]=n({namespaces:b,kinds:x,monitors:$,languages:S,conditions:C,errors:k,onlyErrors:w,podsAgentInjectionStatus:D}),[R,P]=n(zo(I));o(()=>{const e=d(pt.OVERVIEW_FILTERS,A());N(e)},[]),o(()=>{if(!g){const e={namespaces:b,kinds:x,monitors:$,languages:S,conditions:C,errors:k,onlyErrors:w,podsAgentInjectionStatus:D};M(e),P(zo(e))}},[g,b,x,$,S,C,k,w,D]);const L=()=>{y(!1)},K=l(null);return lt(K,L),H({key:"Escape",active:g},L),e(wo,{ref:K,children:[t(rt,{label:"Filters",icon:ji,badgeLabel:R,badgeFilled:!!R,withBorder:!0,color:"transparent",onClick:()=>{f(0,50),y(!0)}}),t(ot,{ref:h,isOpen:g,top:v.top,left:v.left,width:"420px",footer:e(O,{children:[t(Ko,{variant:"primary",onClick:()=>{u(pt.OVERVIEW_FILTERS,I),N(I),P(zo(I)),y(!1)},children:"Apply"}),t(Ko,{variant:"secondary",onClick:L,children:"Cancel"}),t(jo,{children:t(Ko,{variant:"tertiary",onClick:()=>{p(pt.OVERVIEW_FILTERS),E(),M(A()),P(0),y(!1)},$color:i.text.error,children:"Reset"})})]}),children:e(Po,{children:[t(Io,{namespaces:a,value:I.namespaces,onSelect:e=>M(t=>({...t,namespaces:[...t.namespaces||[],e]})),onDeselect:e=>M(t=>({...t,namespaces:(t.namespaces||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(Mo,{sources:F,value:I.kinds,onSelect:e=>M(t=>({...t,kinds:[...t.kinds||[],e]})),onDeselect:e=>M(t=>({...t,kinds:(t.kinds||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(Fo,{sources:F,value:I.languages,onSelect:e=>M(t=>({...t,languages:[...t.languages||[],e]})),onDeselect:e=>M(t=>({...t,languages:(t.languages||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(Oo,{value:I.monitors,onSelect:e=>M(t=>({...t,monitors:[...t.monitors||[],e]})),onDeselect:e=>M(t=>({...t,monitors:(t.monitors||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(Eo,{sources:F,value:I.conditions,onSelect:e=>M(t=>({...t,conditions:[...t.conditions||[],e]})),onDeselect:e=>M(t=>({...t,conditions:(t.conditions||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(Ro,{sources:F,value:I.podsAgentInjectionStatus,onSelect:e=>M(t=>({...t,podsAgentInjectionStatus:[...t.podsAgentInjectionStatus||[],e]})),onDeselect:e=>M(t=>({...t,podsAgentInjectionStatus:(t.podsAgentInjectionStatus||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(Lo,{children:t(T,{title:"Show only sources with errors",initialValue:I.onlyErrors,onChange:e=>M(t=>({...t,errors:[],onlyErrors:e}))})}),t(Ao,{sources:F,value:I.errors,onSelect:e=>M(t=>({...t,errors:[...t.errors||[],e]})),onDeselect:e=>M(t=>({...t,errors:(t.errors||[]).filter(t=>t.id!==e.id)})),disabled:!I.onlyErrors,showSearch:!0,required:!0,isMulti:!0})]})})]})},Bo=p.div`
203
+ `,Ho=e=>{let t=0;return Object.values(e).forEach(e=>{e&&Array.isArray(e)&&e.length>0&&(t+=e.length)}),e.onlyErrors&&t++,e.searchText&&t++,t},Wo=()=>{const i=m(),{namespaces:a,sources:r}=Y(),{selectedStreamName:s}=Ye(),{getItemSS:d,setItemSS:u,removeItemSS:p}=ht(),{popupRef:h,popupOpen:g,setPopupOpen:y,popupPosition:v,handlePosition:f}=nt(),{namespaces:b,kinds:x,monitors:S,languages:$,conditions:C,errors:k,onlyErrors:w,podsAgentInjectionStatus:N,setAll:D,clearAll:E,getEmptyState:A}=xe(),O=c(()=>Ze(r,s),[r,s]),[I,M]=n({namespaces:b,kinds:x,monitors:S,languages:$,conditions:C,errors:k,onlyErrors:w,podsAgentInjectionStatus:N}),[R,K]=n(Ho(I));o(()=>{const e=d(pt.OVERVIEW_FILTERS,A());D(e)},[]),o(()=>{if(!g){const e={namespaces:b,kinds:x,monitors:S,languages:$,conditions:C,errors:k,onlyErrors:w,podsAgentInjectionStatus:N};M(e),K(Ho(e))}},[g,b,x,S,$,C,k,w,N]);const P=()=>{y(!1)},L=l(null);return lt(L,P),H({key:"Escape",active:g},P),e(Eo,{ref:L,children:[t(rt,{label:"Filters",icon:qi,badgeLabel:R,badgeFilled:!!R,withBorder:!0,color:"transparent",onClick:()=>{f(0,50),y(!0)}}),t(ot,{ref:h,isOpen:g,top:v.top,left:v.left,width:"420px",footer:e(F,{children:[t(Vo,{variant:"primary",onClick:()=>{u(pt.OVERVIEW_FILTERS,I),D(I),K(Ho(I)),y(!1)},children:"Apply"}),t(Vo,{variant:"secondary",onClick:P,children:"Cancel"}),t(Bo,{children:t(Vo,{variant:"tertiary",onClick:()=>{p(pt.OVERVIEW_FILTERS),E(),M(A()),K(0),y(!1)},$color:i.text.error,children:"Reset"})})]}),children:e(jo,{children:[t(Po,{namespaces:a,value:I.namespaces,onSelect:e=>M(t=>({...t,namespaces:[...t.namespaces||[],e]})),onDeselect:e=>M(t=>({...t,namespaces:(t.namespaces||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(Lo,{sources:O,value:I.kinds,onSelect:e=>M(t=>({...t,kinds:[...t.kinds||[],e]})),onDeselect:e=>M(t=>({...t,kinds:(t.kinds||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(Ro,{sources:O,value:I.languages,onSelect:e=>M(t=>({...t,languages:[...t.languages||[],e]})),onDeselect:e=>M(t=>({...t,languages:(t.languages||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(Ko,{value:I.monitors,onSelect:e=>M(t=>({...t,monitors:[...t.monitors||[],e]})),onDeselect:e=>M(t=>({...t,monitors:(t.monitors||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(Io,{sources:O,value:I.conditions,onSelect:e=>M(t=>({...t,conditions:[...t.conditions||[],e]})),onDeselect:e=>M(t=>({...t,conditions:(t.conditions||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(zo,{sources:O,value:I.podsAgentInjectionStatus,onSelect:e=>M(t=>({...t,podsAgentInjectionStatus:[...t.podsAgentInjectionStatus||[],e]})),onDeselect:e=>M(t=>({...t,podsAgentInjectionStatus:(t.podsAgentInjectionStatus||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(qo,{children:t(T,{title:"Show only sources with errors",initialValue:I.onlyErrors,onChange:e=>M(t=>({...t,errors:[],onlyErrors:e}))})}),t(Mo,{sources:O,value:I.errors,onSelect:e=>M(t=>({...t,errors:[...t.errors||[],e]})),onDeselect:e=>M(t=>({...t,errors:(t.errors||[]).filter(t=>t.id!==e.id)})),disabled:!I.onlyErrors,showSearch:!0,required:!0,isMulti:!0})]})})]})},_o=p.div`
204
204
  display: flex;
205
205
  flex-direction: column;
206
206
  gap: 24px;
207
207
  padding: 4px;
208
- `,Vo=({formData:i,handleFormChange:n,formErrors:o,editingStreamName:a})=>{const{dataStreams:r,selectedStreamName:l}=Ye(),s=a||l,d=c(()=>r.find(e=>e.name===i.name&&e.name!==s),[r,i.name,s]);return e(Bo,{children:[t(C,{name:"name",title:g.STREAM_NAME,placeholder:g.NAME_YOUR_STREAM_PLACEHOLDER,required:!0,value:i.name,onChange:({target:{value:e}})=>n("name",e),errorMessage:o.name}),d&&t(ce,{type:de.Warning,message:g.DATA_STREAM_EXISTS_WARNING(s,d.name)})]})},Ho=p.div`
208
+ `,Jo=({formData:i,handleFormChange:n,formErrors:o,editingStreamName:a})=>{const{dataStreams:r,selectedStreamName:l}=Ye(),s=a||l,d=c(()=>r.find(e=>e.name===i.name&&e.name!==s),[r,i.name,s]);return e(_o,{children:[t(C,{name:"name",title:g.STREAM_NAME,placeholder:g.NAME_YOUR_STREAM_PLACEHOLDER,required:!0,value:i.name,onChange:({target:{value:e}})=>n("name",e),errorMessage:o.name}),d&&t(ce,{type:de.Warning,message:g.DATA_STREAM_EXISTS_WARNING(s,d.name)})]})},Uo=p.div`
209
209
  width: 100%;
210
210
  height: 100%;
211
211
  max-height: calc(100vh - 220px);
212
212
  overflow: overlay;
213
213
  overflow-y: auto;
214
- `,Wo=({isOpen:e,onClose:i,dataStreamName:o,updateDataStream:a})=>{const{dataStreams:r}=Ye(),s=l(null),[u,p]=n(!1),{formData:h,handleFormChange:m,formErrors:g,validateForm:y,resetFormData:v,loadFormWithDrawerItem:f}=mt({name:o}),b=c(()=>{if(!e)return v();const t=r?.find(e=>e.name===o);return t?f(t):v(),t},[e,r,o]),x=d((e,t)=>{m(e,t),p(!0)},[m]);return b?t(Mn,{ref:s,title:b.name,icons:[zi],hideEditTitleFromEdit:!0,isEdit:!0,isFormDirty:u,onSave:()=>{y({withAlert:!0,alertTitle:ne.Update})&&(a(o,h),p(!1),i())},onCancel:()=>{v(),p(!1),i()},children:t(Ho,{children:t(Vo,{formData:h,handleFormChange:x,formErrors:g,editingStreamName:o})})}):null},_o=p.div`
214
+ `,Go=({isOpen:e,onClose:i,dataStreamName:o,updateDataStream:a})=>{const{dataStreams:r}=Ye(),s=l(null),[u,p]=n(!1),{formData:h,handleFormChange:m,formErrors:g,validateForm:y,resetFormData:v,loadFormWithDrawerItem:f}=mt({name:o}),b=c(()=>{if(!e)return v();const t=r?.find(e=>e.name===o);return t?f(t):v(),t},[e,r,o]),x=d((e,t)=>{m(e,t),p(!0)},[m]);return b?t(Ln,{ref:s,title:b.name,icons:[Vi],hideEditTitleFromEdit:!0,isEdit:!0,isFormDirty:u,onSave:()=>{y({withAlert:!0,alertTitle:ne.Update})&&(a(o,h),p(!1),i())},onCancel:()=>{v(),p(!1),i()},children:t(Uo,{children:t(Jo,{formData:h,handleFormChange:x,formErrors:g,editingStreamName:o})})}):null},Yo=p.div`
215
215
  position: relative;
216
- `,Jo=p(O)`
216
+ `,Xo=p(F)`
217
217
  border: 1px solid ${({theme:e})=>e.colors.border};
218
218
  border-radius: 32px;
219
219
 
220
220
  & button {
221
221
  max-height: 28px;
222
222
  }
223
- `,Uo=p(B)`
223
+ `,Zo=p(V)`
224
224
  text-wrap: nowrap;
225
- `,Go=p(at)`
225
+ `,Qo=p(at)`
226
226
  max-height: 240px;
227
227
  padding: 0px !important;
228
- `,Yo=p(O)`
228
+ `,ea=p(F)`
229
229
  width: 100%;
230
- `,Xo=p.div`
230
+ `,ta=p.div`
231
231
  width: 100%;
232
- `,Zo=({onClickNewDataStream:o,updateDataStream:a,deleteDataStream:r})=>{const l=m(),{clearStore:s}=gt(),{popupRef:d,popupOpen:u,setPopupOpen:p,popupPosition:h,handlePosition:g}=nt(),{dataStreams:y,selectedStreamName:v,setSelectedStreamName:f}=Ye(),[b,x]=n(""),[$,S]=n(""),[k,w]=n(""),D=c(()=>y.filter(({name:e})=>!k||e.toLowerCase().includes(k.toLowerCase())).map(({name:i})=>e(Yo,{children:[t(Xo,{children:t(rt,{label:i,isSelected:v===i,onClick:()=>{s(),f(i),p(!1)},color:"transparent",style:{width:"100%",justifyContent:"flex-start"}})}),i!==yt&&t(I,{onClick:()=>S(i),tooltip:W.DELETE,children:t(Fi,{})}),t(I,{onClick:()=>x(i),tooltip:W.EDIT,children:t(Mi,{})})]},`stream-${i}`)),[y,v,k]);return e(i,{children:[e(_o,{children:[e(Jo,{$gap:0,children:[e(Le,{variant:"tertiary",onClick:()=>{g(0,50),p(e=>!e)},children:[t(zi,{fill:l.text.info}),e(Uo,{children:["Data Stream: ",v]}),t(vt,{extend:u}),t(Me,{label:y.length})]}),t(A,{orientation:"vertical",length:"32px",thickness:2,margin:"0"}),t(M,{onClick:()=>{s(),o()},label:W.NEW})]}),t(ot,{ref:d,isOpen:u,top:h.top,left:h.left,header:t(C,{placeholder:"Search...",icon:Ki,value:k,onChange:e=>w(e.target.value)}),children:t(Go,{children:D})})]}),t(J,{isOpen:""!==$,name:$,onApprove:()=>{r($),S("")},onDeny:()=>{S("")}}),t(Wo,{isOpen:""!==b,onClose:()=>{x("")},dataStreamName:b,updateDataStream:a})]})},Qo=p.div`
232
+ `,ia=({onClickNewDataStream:o,updateDataStream:a,deleteDataStream:r})=>{const l=m(),{clearStore:s}=gt(),{popupRef:d,popupOpen:u,setPopupOpen:p,popupPosition:h,handlePosition:g}=nt(),{dataStreams:y,selectedStreamName:v,setSelectedStreamName:f}=Ye(),[b,x]=n(""),[S,$]=n(""),[k,w]=n(""),N=c(()=>y.filter(({name:e})=>!k||e.toLowerCase().includes(k.toLowerCase())).map(({name:i})=>e(ea,{children:[t(ta,{children:t(rt,{label:i,isSelected:v===i,onClick:()=>{s(),f(i),p(!1)},color:"transparent",style:{width:"100%",justifyContent:"flex-start"}})}),i!==yt&&t(I,{onClick:()=>$(i),tooltip:W.DELETE,children:t(Ii,{})}),t(I,{onClick:()=>x(i),tooltip:W.EDIT,children:t(Ki,{})})]},`stream-${i}`)),[y,v,k]);return e(i,{children:[e(Yo,{children:[e(Xo,{$gap:0,children:[e(Pe,{variant:"tertiary",onClick:()=>{g(0,50),p(e=>!e)},children:[t(Vi,{fill:l.text.info}),e(Zo,{children:["Data Stream: ",v]}),t(vt,{extend:u}),t(Me,{label:y.length})]}),t(A,{orientation:"vertical",length:"32px",thickness:2,margin:"0"}),t(M,{onClick:()=>{s(),o()},label:W.NEW})]}),t(ot,{ref:d,isOpen:u,top:h.top,left:h.left,header:t(C,{placeholder:"Search...",icon:ji,value:k,onChange:e=>w(e.target.value)}),children:t(Qo,{children:N})})]}),t(J,{isOpen:""!==S,name:S,onApprove:()=>{r(S),$("")},onDeny:()=>{$("")}}),t(Go,{isOpen:""!==b,onClose:()=>{x("")},dataStreamName:b,updateDataStream:a})]})},na=p.div`
233
233
  display: flex;
234
234
  align-items: center;
235
235
  margin: 20px 0;
236
236
  padding: 0 16px;
237
237
  gap: 8px;
238
- `,ea=p.div`
238
+ `,oa=p.div`
239
239
  margin-left: auto;
240
- `,ta=({addEntity:i,preventSearchPopup:n,onClickNewDataStream:o,updateDataStream:a,deleteDataStream:r})=>{const{isVm:l}=oe(),{setCurrentModal:s}=ae();return e(Qo,{children:[!l&&t(Zo,{onClickNewDataStream:o,updateDataStream:a,deleteDataStream:r}),t(No,{preventPopup:n}),t(qo,{}),i&&t(ea,{children:t(M,{"data-id":`add-${i}`,onClick:()=>s(i),label:`${W.ADD} ${st(i)}`,variant:"primary",textProps:{weight:900}})})]})},ia=r(({isModal:i,onClickSummary:n},o)=>{const{selectedStreamName:a}=Ye(),{formData:r,handleFormChange:l,formErrors:c,validateForm:d}=mt({name:a});return s(o,()=>({validateForm:d,getFormValues:()=>r})),t(se,{$isNotModal:!i,children:e(F,{$gap:24,children:[n&&t(ft,{onClick:n}),t(K,{title:g.NAME_YOUR_STREAM,description:g.STREAM_DESCRIPTION}),t(Vo,{formData:r,handleFormChange:l,formErrors:c})]})})});ia.displayName=ia.name;const na=({createDataStream:e})=>{const{currentModal:i,setCurrentModal:n}=ae(),{addDataStreams:o,setSelectedStreamName:a}=Ye(),r=i===bt.DataStream,s=()=>n(""),c=async()=>{if(d.current&&d.current.validateForm()){const t=d.current.getFormValues();e?e(t):(o([t]),a(t.name)),s()}},d=l(null);return H({key:"Enter",active:r},c),t(le,{isOpen:r,onClose:s,header:{title:"Add Data Stream"},actionComponent:t(he,{buttons:[{label:"DONE",variant:"primary",onClick:c}]}),children:t(ia,{ref:d,isModal:!0})})},oa=(e,t)=>{const{destinationType:i,disabled:n,exportedSignals:o}=e,a=[{title:g.TYPE,value:i.type},{type:y.ActiveStatus,title:g.STATUS,value:String(!n)},{type:y.Monitors,title:g.MONITORS,value:Be(o).join(", ")},{title:g.NAME,value:i.displayName}],r=xt(e,t),l=r.map(e=>({name:e.key,value:e.value}));return r.map(({key:e,name:i,value:n})=>{const{secret:r,componentProperties:s,hideFromReadData:c,customReadDataLabels:d}=t.find(t=>t.name===e)||{};if(!c?.length||!$t(c,Be(o),l)){const{type:e}=St(s,{type:""}),t=(r||"password"===e)&&n.length?new Array(10).fill("•").join(""):"";a.push({type:y.Divider}),d?.length?d.forEach(({condition:e,...t})=>{e==n&&a.push({title:t.title,value:t.value})}):a.push({title:i,value:t||n})}}),a},aa=({signals:e,fields:i,onChange:n,formErrors:o})=>i?.map(a=>{const{componentType:r,renderCondition:l,...s}=a;if(l&&!$t(l,e,i))return null;switch(r){case R.Input:return t(C,{...s,onChange:e=>n(a.name,e.target.value),errorMessage:o[a.name]},a.name);case R.Dropdown:return t(ct,{...s,showSearch:!0,value:{id:s.value||"",value:s.value||""},options:s.options||[],onSelect:e=>n(a.name,e.id),errorMessage:o[a.name]},a.name);case R.MultiInput:return t(E,{...s,value:"string"==typeof s.value?St(s.value,[]):s.value,onChange:e=>n(a.name,JSON.stringify(e)),errorMessage:o[a.name]},a.name);case R.KeyValuePair:return t(N,{...s,value:"string"==typeof s.value?St(s.value,[]):s.value,onChange:e=>n(a.name,JSON.stringify(e)),errorMessage:o[a.name]},a.name);case R.TextArea:return t(q,{...s,onChange:e=>n(a.name,e.target.value),errorMessage:o[a.name]},a.name);case R.Checkbox:return t($,{...s,value:"true"==s.value,onChange:e=>n(a.name,String(e)),errorMessage:o[a.name]},a.name);default:return null}}),ra=p(Le)`
240
+ `,aa=({addEntity:i,preventSearchPopup:n,onClickNewDataStream:o,updateDataStream:a,deleteDataStream:r})=>{const{isVm:l}=oe(),{setCurrentModal:s}=ae();return e(na,{children:[!l&&t(ia,{onClickNewDataStream:o,updateDataStream:a,deleteDataStream:r}),t(Fo,{preventPopup:n}),t(Wo,{}),i&&t(oa,{children:t(M,{"data-id":`add-${i}`,onClick:()=>s(i),label:`${W.ADD} ${st(i)}`,variant:"primary",textProps:{weight:900}})})]})},ra=r(({isModal:i,onClickSummary:n},o)=>{const{selectedStreamName:a}=Ye(),{formData:r,handleFormChange:l,formErrors:c,validateForm:d}=mt({name:a});return s(o,()=>({validateForm:d,getFormValues:()=>r})),t(se,{$isNotModal:!i,children:e(O,{$gap:24,children:[n&&t(ft,{onClick:n}),t(L,{title:g.NAME_YOUR_STREAM,description:g.STREAM_DESCRIPTION}),t(Jo,{formData:r,handleFormChange:l,formErrors:c})]})})});ra.displayName=ra.name;const la=({createDataStream:e})=>{const{currentModal:i,setCurrentModal:n}=ae(),{addDataStreams:o,setSelectedStreamName:a}=Ye(),r=i===bt.DataStream,s=()=>n(""),c=async()=>{if(d.current&&d.current.validateForm()){const t=d.current.getFormValues();e?e(t):(o([t]),a(t.name)),s()}},d=l(null);return H({key:"Enter",active:r},c),t(le,{isOpen:r,onClose:s,header:{title:"Add Data Stream"},actionComponent:t(he,{buttons:[{label:"DONE",variant:"primary",onClick:c}]}),children:t(ra,{ref:d,isModal:!0})})},sa=(e,t)=>{const{destinationType:i,disabled:n,exportedSignals:o}=e,a=[{title:g.TYPE,value:i.type},{type:y.ActiveStatus,title:g.STATUS,value:String(!n)},{type:y.Monitors,title:g.MONITORS,value:Ve(o).join(", ")},{title:g.NAME,value:i.displayName}],r=xt(e,t),l=r.map(e=>({name:e.key,value:e.value}));return r.map(({key:e,name:i,value:n})=>{const{secret:r,componentProperties:s,hideFromReadData:c,customReadDataLabels:d}=t.find(t=>t.name===e)||{};if(!c?.length||!St(c,Ve(o),l)){const{type:e}=$t(s,{type:""}),t=(r||"password"===e)&&n.length?new Array(10).fill("•").join(""):"";a.push({type:y.Divider}),d?.length?d.forEach(({condition:e,...t})=>{e==n&&a.push({title:t.title,value:t.value})}):a.push({title:i,value:t||n})}}),a},ca=({signals:e,fields:i,onChange:n,formErrors:o})=>i?.map(a=>{const{componentType:r,renderCondition:l,...s}=a;if(l&&!St(l,e,i))return null;switch(r){case R.Input:return t(C,{...s,onChange:e=>n(a.name,e.target.value),errorMessage:o[a.name]},a.name);case R.Dropdown:return t(ct,{...s,showSearch:!0,value:{id:s.value||"",value:s.value||""},options:s.options||[],onSelect:e=>n(a.name,e.id),errorMessage:o[a.name]},a.name);case R.MultiInput:return t(E,{...s,value:"string"==typeof s.value?$t(s.value,[]):s.value,onChange:e=>n(a.name,JSON.stringify(e)),errorMessage:o[a.name]},a.name);case R.KeyValuePair:return t(D,{...s,value:"string"==typeof s.value?$t(s.value,[]):s.value,onChange:e=>n(a.name,JSON.stringify(e)),errorMessage:o[a.name]},a.name);case R.TextArea:return t(q,{...s,onChange:e=>n(a.name,e.target.value),errorMessage:o[a.name]},a.name);case R.Checkbox:return t(S,{...s,value:"true"==s.value,onChange:e=>n(a.name,String(e)),errorMessage:o[a.name]},a.name);default:return null}}),da=p(Pe)`
241
241
  display: flex;
242
242
  align-items: center;
243
243
  gap: 8px;
@@ -251,43 +251,43 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
251
251
  `:h`
252
252
  background-color: transparent;
253
253
  `}
254
- `,la=({destination:i,validateForm:o,status:a,testConnection:r,onSuccess:l,onError:s})=>{const c=m(),{selectedStreamName:d}=Ye(),[u,p]=n(!1),h=a?be(a,c):void 0;return e(ra,{$status:a,variant:"secondary",onClick:async()=>{if(o()){p(!0);const e=await r({...i,currentStreamName:d});e&&(e.succeeded?l(e):s(e)),p(!1)}},children:[u?t(Pe,{}):h?t(h,{}):null,t(B,{family:"secondary",decoration:"underline",size:14,color:a?c.text[a]:void 0,children:u?"Checking":a===de.Success?"Connection OK":"error"===a?"Connection Failed":"Test Connection"})]})},sa=p(F)`
254
+ `,ua=({destination:i,validateForm:o,status:a,testConnection:r,onSuccess:l,onError:s})=>{const c=m(),{selectedStreamName:d}=Ye(),[u,p]=n(!1),h=a?be(a,c):void 0;return e(da,{$status:a,variant:"secondary",onClick:async()=>{if(o()){p(!0);const e=await r({...i,currentStreamName:d});e&&(e.succeeded?l(e):s(e)),p(!1)}},children:[u?t(Ke,{}):h?t(h,{}):null,t(V,{family:"secondary",decoration:"underline",size:14,color:a?c.text[a]:void 0,children:u?"Checking":a===de.Success?"Connection OK":"error"===a?"Connection Failed":"Test Connection"})]})},pa=p(O)`
255
255
  align-items: unset;
256
256
  padding: 0 4px;
257
- `,ca=p.div`
257
+ `,ha=p.div`
258
258
  display: flex;
259
259
  flex-direction: column;
260
260
  gap: 12px;
261
- `,da=p(O)`
261
+ `,ma=p(F)`
262
262
  justify-content: space-between;
263
- `,ua=p(B)`
263
+ `,ga=p(V)`
264
264
  margin-bottom: 12px;
265
- `,pa=({isUpdate:i,categoryItem:a,formData:r,formErrors:s,validateForm:d,handleFormChange:u,dynamicFields:p,setDynamicFields:h,testConnection:y})=>{const{type:v,displayName:f,supportedSignals:b,testConnectionSupported:x}=a||{},$=m(),[S,k]=n(!1),[w,D]=n(!1),[T,N]=n(void 0),E=l(!1);o(()=>{if(p.length&&!E.current){E.current=!0;let e=!1;for(let t=0;t<p.length;t++){const{required:i,value:n}=p[t];if(i){if([void 0,null,""].includes(n)){e=!1;break}e=!0}}k(e)}},[p,w]);const F=c(()=>{const{logs:e,metrics:t,traces:i}=b||{},n=[];return e?.supported&&n.push(Ct.Logs),t?.supported&&n.push(Ct.Metrics),i?.supported&&n.push(Ct.Traces),n},[b]),O=c(()=>{const{logs:e,metrics:t,traces:i}=r.exportedSignals||{},n=[];return e&&n.push(Ct.Logs),t&&n.push(Ct.Metrics),i&&n.push(Ct.Traces),n},[r.exportedSignals]),I=()=>{k(!1),D(!0),N(void 0)};return e(sa,{$gap:24,children:[e(sa,{$gap:12,children:[t(K,{title:i?"Update destination":"Create destination",description:`Connect ${f} with Odigos.`,actionButton:x&&t(la,{destination:r,validateForm:d,status:T?.type,testConnection:y,onError:e=>{D(!1),N({type:de.Error,title:e?.reason||"Connection failed",message:e?.message||"Please check your input and try again."})},onSuccess:e=>{D(!1),N({type:de.Success,title:e?.reason||"Connection succeeded",message:e?.message||""})}})}),e(ca,{children:[x&&T&&t(ce,{type:T.type,title:T.title,message:T.message}),S&&!T&&!i&&t(ce,{type:de.Default,message:`Odigos autocompleted ${f} destination details.`})]}),t(A,{})]}),e(da,{children:[t(z,{title:i?"":"This connection will monitor:",required:!0,allowedSignals:F,selectedSignals:O,setSelectedSignals:e=>{I(),u("exportedSignals",{logs:e.includes(Ct.Logs),metrics:e.includes(Ct.Metrics),traces:e.includes(Ct.Traces)})},errorMessage:s.exportedSignals}),!i&&t(j,{endpoint:`/backends/${v}`})]}),i&&e("div",{children:[t(ua,{children:"Status"}),t(P,{options:[{icon:Oi,label:g.ENABLED,value:!1,selectedBgColor:$.text.success+L["050"]},{icon:Ii,label:g.DISABLED,value:!0,selectedBgColor:$.text.error+L["050"]}],selected:r.disabled,setSelected:e=>u("disabled",e)})]}),!i&&t(C,{title:"Destination name",placeholder:"Enter destination name",value:r.name,onChange:e=>{I(),u("name",e.target.value)},errorMessage:s.name}),t(aa,{signals:O,fields:p,onChange:(e,t)=>{I(),h(i=>{const n=[...i],o=n.findIndex(t=>t.name===e);return-1!==o&&(n[o]={...n[o],value:t}),n})},formErrors:s})]})},ha=p.div`
265
+ `,ya=({isUpdate:i,categoryItem:a,formData:r,formErrors:s,validateForm:d,handleFormChange:u,dynamicFields:p,setDynamicFields:h,testConnection:y})=>{const{type:v,displayName:f,supportedSignals:b,testConnectionSupported:x}=a||{},S=m(),[$,k]=n(!1),[w,N]=n(!1),[T,D]=n(void 0),E=l(!1);o(()=>{if(p.length&&!E.current){E.current=!0;let e=!1;for(let t=0;t<p.length;t++){const{required:i,value:n}=p[t];if(i){if([void 0,null,""].includes(n)){e=!1;break}e=!0}}k(e)}},[p,w]);const O=c(()=>{const{logs:e,metrics:t,traces:i}=b||{},n=[];return e?.supported&&n.push(Ct.Logs),t?.supported&&n.push(Ct.Metrics),i?.supported&&n.push(Ct.Traces),n},[b]),F=c(()=>{const{logs:e,metrics:t,traces:i}=r.exportedSignals||{},n=[];return e&&n.push(Ct.Logs),t&&n.push(Ct.Metrics),i&&n.push(Ct.Traces),n},[r.exportedSignals]),I=()=>{k(!1),N(!0),D(void 0)};return e(pa,{$gap:24,children:[e(pa,{$gap:12,children:[t(L,{title:i?"Update destination":"Create destination",description:`Connect ${f} with Odigos.`,actionButton:x&&t(ua,{destination:r,validateForm:d,status:T?.type,testConnection:y,onError:e=>{N(!1),D({type:de.Error,title:e?.reason||"Connection failed",message:e?.message||"Please check your input and try again."})},onSuccess:e=>{N(!1),D({type:de.Success,title:e?.reason||"Connection succeeded",message:e?.message||""})}})}),e(ha,{children:[x&&T&&t(ce,{type:T.type,title:T.title,message:T.message}),$&&!T&&!i&&t(ce,{type:de.Default,message:`Odigos autocompleted ${f} destination details.`})]}),t(A,{})]}),e(ma,{children:[t(j,{title:i?"":"This connection will monitor:",required:!0,allowedSignals:O,selectedSignals:F,setSelectedSignals:e=>{I(),u("exportedSignals",{logs:e.includes(Ct.Logs),metrics:e.includes(Ct.Metrics),traces:e.includes(Ct.Traces)})},errorMessage:s.exportedSignals}),!i&&t(z,{endpoint:`/backends/${v}`})]}),i&&e("div",{children:[t(ga,{children:"Status"}),t(K,{options:[{icon:Mi,label:g.ENABLED,value:!1,selectedBgColor:S.text.success+P["050"]},{icon:Ri,label:g.DISABLED,value:!0,selectedBgColor:S.text.error+P["050"]}],selected:r.disabled,setSelected:e=>u("disabled",e)})]}),!i&&t(C,{title:"Destination name",placeholder:"Enter destination name",value:r.name,onChange:e=>{I(),u("name",e.target.value)},errorMessage:s.name}),t(ca,{signals:F,fields:p,onChange:(e,t)=>{I(),h(i=>{const n=[...i],o=n.findIndex(t=>t.name===e);return-1!==o&&(n[o]={...n[o],value:t}),n})},formErrors:s})]})},va=p.div`
266
266
  width: 100%;
267
267
  height: 100%;
268
268
  max-height: calc(100vh - 220px);
269
269
  overflow: overlay;
270
270
  overflow-y: auto;
271
- `,ma=p.div`
271
+ `,fa=p.div`
272
272
  display: flex;
273
273
  flex-direction: column;
274
274
  gap: 12px;
275
- `,ga=({categories:i,updateDestination:a,deleteDestination:r,testConnection:s})=>{const{destinations:d}=Y(),{selectedStreamName:u}=Ye(),{drawerType:p,drawerEntityId:h}=V(),m=c(()=>Qe(d,u),[d,u]),y=l(null),v=p===G.Destination,[f,b]=n(!1),[x,$]=n(!1),{formData:S,formErrors:C,handleFormChange:k,resetFormData:w,validateForm:D,loadFormWithDrawerItem:T,yamlFields:N,setYamlFields:E,dynamicFields:A,setDynamicFields:F}=kt({}),O=c(()=>{if(h)return m?.find(e=>Z(e)===h)},[h,m]);if(o(()=>{v&&O?(E(wt(i,O)),T(O)):w()},[v,O,i]),!O)return null;const I=i.flatMap(e=>e.items).find(e=>e.type===O.destinationType.type),{icon:M,iconSrc:R}=I?We(I?.type):{icon:void 0,iconSrc:void 0};return t(Mn,{ref:y,title:O.name||O.destinationType.displayName,icons:M?[M]:void 0,iconSrcs:R?[R]:void 0,isEdit:f,isFormDirty:x,onEdit:e=>{b("boolean"!=typeof e||e)},onSave:async e=>{if(D({withAlert:!0,alertTitle:ne.Update})){const t=e!==O.destinationType.displayName?e:"";k("name",t),a(h,{...S,name:t}),b(!1),$(!1)}},onDelete:async()=>{r(h),b(!1),$(!1),y.current?.closeDrawer()},onCancel:()=>{b(!1),$(!1),T(O)},isLastItem:1===m.length,children:f?t(ha,{children:t(pa,{isUpdate:!0,categoryItem:I,formData:S,formErrors:C,handleFormChange:(...e)=>{$(!0),k(...e)},dynamicFields:A,setDynamicFields:(...e)=>{$(!0),F(...e)},validateForm:D,testConnection:s})}):e(ma,{children:[O.conditions?.length?t(ee,{conditions:O.conditions}):null,t(te,{title:g.DESTINATION_DETAILS,data:O?oa(O,N):[]})]})})},ya=p.div`
275
+ `,ba=({categories:i,updateDestination:a,deleteDestination:r,testConnection:s})=>{const{destinations:d}=Y(),{selectedStreamName:u}=Ye(),{drawerType:p,drawerEntityId:h}=B(),m=c(()=>Qe(d,u),[d,u]),y=l(null),v=p===G.Destination,[f,b]=n(!1),[x,S]=n(!1),{formData:$,formErrors:C,handleFormChange:k,resetFormData:w,validateForm:N,loadFormWithDrawerItem:T,yamlFields:D,setYamlFields:E,dynamicFields:A,setDynamicFields:O}=kt({}),F=c(()=>{if(h)return m?.find(e=>Z(e)===h)},[h,m]);if(o(()=>{v&&F?(E(wt(i,F)),T(F)):w()},[v,F,i]),!F)return null;const I=i.flatMap(e=>e.items).find(e=>e.type===F.destinationType.type),{icon:M,iconSrc:R}=I?We(I?.type):{icon:void 0,iconSrc:void 0};return t(Ln,{ref:y,title:F.name||F.destinationType.displayName,icons:M?[M]:void 0,iconSrcs:R?[R]:void 0,isEdit:f,isFormDirty:x,onEdit:e=>{b("boolean"!=typeof e||e)},onSave:async e=>{if(N({withAlert:!0,alertTitle:ne.Update})){const t=e!==F.destinationType.displayName?e:"";k("name",t),a(h,{...$,name:t}),b(!1),S(!1)}},onDelete:async()=>{r(h),b(!1),S(!1),y.current?.closeDrawer()},onCancel:()=>{b(!1),S(!1),T(F)},isLastItem:1===m.length,children:f?t(va,{children:t(ya,{isUpdate:!0,categoryItem:I,formData:$,formErrors:C,handleFormChange:(...e)=>{S(!0),k(...e)},dynamicFields:A,setDynamicFields:(...e)=>{S(!0),O(...e)},validateForm:N,testConnection:s})}):e(fa,{children:[F.conditions?.length?t(ee,{conditions:F.conditions}):null,t(te,{title:g.DESTINATION_DETAILS,data:F?sa(F,D):[]})]})})},xa=p.div`
276
276
  display: flex;
277
277
  flex-direction: column;
278
278
  gap: 12px;
279
- `,va=({items:i,onSelectNew:n,onSelectConfigured:o,isLoadingForDestinationIds:a})=>{const{configuredDestinationsUpdateOnly:r}=gt();return i.map(i=>{const l=i.name===Nt.EXISTS;return e(ya,{children:[t(K,{size:"small",icon:i.icon,title:Dt(i.name),description:i.description}),i.items.map(e=>{const s=`select-${i.name.replaceAll(" ","")}-destination-${e.type}-${e.id||""}`,c=Tt(e.supportedSignals),{icon:d,iconSrc:u}=We(e.type),p=e.selected||r.some(t=>t.id===e.id),h=!!a.find(t=>t===e.id),m=l?()=>o(e.id):()=>n(e);return t(je,{"data-id":s,title:e.displayName,hoverText:W.SELECT,onClick:m,iconProps:{icon:d,iconSrc:u},visualProps:{monitors:c,monitorsWithLabels:!0},checkboxProps:{withCheckbox:l,isChecked:p,isLoading:h,onCheckboxChange:()=>o(e.id)}},s)})]},`category-${i.name}`)})},fa=p.div`
279
+ `,Sa=({items:i,onSelectNew:n,onSelectConfigured:o,isLoadingForDestinationIds:a})=>{const{configuredDestinationsUpdateOnly:r}=gt();return i.map(i=>{const l=i.name===Dt.EXISTS;return e(xa,{children:[t(L,{size:"small",icon:i.icon,title:Nt(i.name),description:i.description}),i.items.map(e=>{const s=`select-${i.name.replaceAll(" ","")}-destination-${e.type}-${e.id||""}`,c=Tt(e.supportedSignals),{icon:d,iconSrc:u}=We(e.type),p=e.selected||r.some(t=>t.id===e.id),h=!!a.find(t=>t===e.id),m=l?()=>o(e.id):()=>n(e);return t(ze,{"data-id":s,title:e.displayName,hoverText:W.SELECT,onClick:m,iconProps:{icon:d,iconSrc:u},visualProps:{monitors:c,monitorsWithLabels:!0},checkboxProps:{withCheckbox:l,isChecked:p,isLoading:h,onCheckboxChange:()=>o(e.id)}},s)})]},`category-${i.name}`)})},$a=p.div`
280
280
  display: flex;
281
281
  flex-direction: column;
282
282
  gap: 24px;
283
- `,ba=p.div`
283
+ `,Ca=p.div`
284
284
  display: flex;
285
285
  align-items: center;
286
286
  gap: 12px;
287
- `,xa=p.div`
287
+ `,ka=p.div`
288
288
  width: 170px;
289
289
  margin-right: 8px;
290
- `,$a=p.div`
290
+ `,wa=p.div`
291
291
  display: flex;
292
292
  flex-direction: column;
293
293
  align-self: stretch;
@@ -298,18 +298,18 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
298
298
  @media (height < 800px) {
299
299
  max-height: calc(100vh - 400px);
300
300
  }
301
- `,Sa=p(fa)`
301
+ `,Na=p($a)`
302
302
  margin-top: 80px;
303
- `,Ca=Object.values(Nt).map(e=>({value:At[e].TITLE,id:e})),ka=Ca[0],wa=[Ct.Logs,Ct.Metrics,Ct.Traces],Da=(e,t,i)=>e.map(e=>{const{type:n,displayName:o}=e.destinationType,a=e.dataStreamNames?.includes(t),r=i.has(e.id);return{id:e.id,type:n,displayName:o,selected:a||r,fields:[],testConnectionSupported:!1,supportedSignals:{logs:{supported:e.exportedSignals.logs},metrics:{supported:e.exportedSignals.metrics},traces:{supported:e.exportedSignals.traces}}}}),Ta=({hidden:i,categories:o,potentialDestinations:a,onSelectNew:r,onSelectConfigured:l,isLoadingForDestinationIds:s})=>{const{destinations:d}=Y(),{selectedStreamName:u}=Ye(),{configuredDestinations:p,configuredDestinationsUpdateOnly:h}=gt(),[m,g]=n(""),[y,v]=n(ka),[f,b]=n(wa),x=c(()=>{const e=Et(o);return e.unshift({name:Nt.EXISTS,description:At[Nt.EXISTS].DESCRIPTION,icon:qi,items:Da(d,u,new Set(p.concat(h).map(e=>e.id)))}),e.unshift({name:Nt.DETECTED,description:At[Nt.DETECTED].DESCRIPTION,icon:Bi,items:a}),e.map(e=>{const t=e.items.filter(t=>{const i=!m||t.displayName.toLowerCase().includes(m.toLowerCase()),n="all"===y.id||y.id?.toLowerCase()?.replaceAll("-"," ")===e.name.toLowerCase()?.replaceAll("-"," "),o=f.some(e=>t.supportedSignals[Ft[e]]?.supported);return i&&n&&o});return{...e,items:t}}).filter(({items:e})=>!!e.length)},[o,a,d,m,y,f,u,p,h]);return i?null:e(fa,{children:[t(K,{title:"Choose destination",description:"Add backend destination you want to connect with Odigos."}),e(ba,{children:[t(xa,{children:t(C,{placeholder:"Search...",icon:Ki,value:m,onChange:({target:{value:e}})=>g(e)})}),t(xa,{children:t(ct,{options:Ca,value:y,onSelect:v,onDeselect:()=>{}})}),t(z,{title:"",selectedSignals:f,setSelectedSignals:b})]}),t(A,{}),x.length?t($a,{children:t(va,{items:x,onSelectNew:e=>r(e,f),onSelectConfigured:l,isLoadingForDestinationIds:s})}):t(Sa,{children:t(Oe,{title:"No destinations found"})})]})},Na=p.div`
303
+ `,Ta=Object.values(Dt).map(e=>({value:At[e].TITLE,id:e})),Da=Ta[0],Ea=[Ct.Logs,Ct.Metrics,Ct.Traces],Aa=(e,t,i)=>e.map(e=>{const{type:n,displayName:o}=e.destinationType,a=e.dataStreamNames?.includes(t),r=i.has(e.id);return{id:e.id,type:n,displayName:o,selected:a||r,fields:[],testConnectionSupported:!1,supportedSignals:{logs:{supported:e.exportedSignals.logs},metrics:{supported:e.exportedSignals.metrics},traces:{supported:e.exportedSignals.traces}}}}),Oa=({hidden:i,categories:o,potentialDestinations:a,onSelectNew:r,onSelectConfigured:l,isLoadingForDestinationIds:s})=>{const{destinations:d}=Y(),{selectedStreamName:u}=Ye(),{configuredDestinations:p,configuredDestinationsUpdateOnly:h}=gt(),[m,g]=n(""),[y,v]=n(Da),[f,b]=n(Ea),x=c(()=>{const e=Et(o);return e.unshift({name:Dt.EXISTS,description:At[Dt.EXISTS].DESCRIPTION,icon:Bi,items:Aa(d,u,new Set(p.concat(h).map(e=>e.id)))}),e.unshift({name:Dt.DETECTED,description:At[Dt.DETECTED].DESCRIPTION,icon:Hi,items:a}),e.map(e=>{const t=e.items.filter(t=>{const i=!m||t.displayName.toLowerCase().includes(m.toLowerCase()),n="all"===y.id||y.id?.toLowerCase()?.replaceAll("-"," ")===e.name.toLowerCase()?.replaceAll("-"," "),o=f.some(e=>t.supportedSignals[Ot[e]]?.supported);return i&&n&&o});return{...e,items:t}}).filter(({items:e})=>!!e.length)},[o,a,d,m,y,f,u,p,h]);return i?null:e($a,{children:[t(L,{title:"Choose destination",description:"Add backend destination you want to connect with Odigos."}),e(Ca,{children:[t(ka,{children:t(C,{placeholder:"Search...",icon:ji,value:m,onChange:({target:{value:e}})=>g(e)})}),t(ka,{children:t(ct,{options:Ta,value:y,onSelect:v,onDeselect:()=>{}})}),t(j,{title:"",selectedSignals:f,setSelectedSignals:b})]}),t(A,{}),x.length?t(wa,{children:t(Sa,{items:x,onSelectNew:e=>r(e,f),onSelectConfigured:l,isLoadingForDestinationIds:s})}):t(Na,{children:t(Fe,{title:"No destinations found"})})]})},Fa=p.div`
304
304
  display: flex;
305
- `,Ea=p.div`
305
+ `,Ia=p.div`
306
306
  border-right: 1px solid ${({theme:e})=>e.colors.border};
307
307
  padding: 32px;
308
308
  width: 200px;
309
309
  @media (max-width: 1050px) {
310
310
  display: none;
311
311
  }
312
- `,Aa=({isOnboarding:i,categories:o,potentialDestinations:a,createDestination:r,updateDestination:l,deleteDestination:s,testConnection:c})=>{const{destinations:d}=Y(),{selectedStreamName:u}=Ye(),{currentModal:p,setCurrentModal:h}=ae(),{addConfiguredDestination:m,addConfiguredDestinationUpdateOnly:y,removeConfiguredDestinationUpdateOnly:v,configuredDestinationsUpdateOnly:f}=gt(),b=p===G.Destination,[x,$]=n(void 0),{formData:S,formErrors:C,handleFormChange:k,resetFormData:w,validateForm:D,setYamlFields:T,dynamicFields:N,setDynamicFields:E,loadFormWithDrawerItem:A}=kt({supportedSignals:x?.supportedSignals,preLoadedFields:x?.fields}),[F,O]=n([]),I=e=>{const t={};return e||N.forEach(e=>t[e.name]=e.value),{id:e?.id||"",name:e?.name||S.name,disabled:e?.disabled||S.disabled,dataStreamNames:e?.dataStreamNames||[],conditions:e?.conditions||[],exportedSignals:e?.exportedSignals||S.exportedSignals,fields:e?.fields||JSON.stringify(t),destinationType:e?.destinationType||{type:x.type,displayName:x.displayName,supportedSignals:{logs:{supported:!1},metrics:{supported:!1},traces:{supported:!1}}}}},M=async e=>{if(i&&!e){const e=I();m(e)}else if(i&&e){const t=I(e);f.some(t=>t.id===e.id)?v(e):y(t)}else if(i||e){if(!i&&e){const t=I(e),i=t.dataStreamNames.some(e=>e===u);O(t=>[...t,e.id]),i?await s(e.id):await l(e.id,A(t)),O(t=>t.filter(t=>t!==e.id))}}else r(S)},R=()=>{w(),$(void 0),h("")},P=()=>{w(),$(void 0)},L=async()=>{if(x){if(!D({withAlert:!i,alertTitle:ne.Create}))return null;M()}R()};return H({key:"Enter",active:b},()=>L()),t(le,{isOpen:b,onClose:R,header:{title:g.ADD_DESTINATION},actionComponent:t(he,{buttons:(()=>{const e=[{label:"DONE",variant:"primary",onClick:L}];return x&&e.unshift({label:"BACK",icon:()=>t(Vi,{rotate:-90}),variant:"secondary",onClick:P}),e})()}),children:e(Na,{children:[t(Ea,{children:t(Ot,{currentStep:x?2:1,data:[{stepNumber:1,title:g.DESTINATIONS},{stepNumber:2,title:g.CONNECTION}]})}),e(se,{style:{margin:"32px 24px 12px 24px"},children:[t(Ta,{hidden:void 0!==x,categories:o,potentialDestinations:a,onSelectNew:(e,t)=>{w(),k("type",e?.type||""),k("currentStreamName",u);const i={logs:!1,metrics:!1,traces:!1};t.filter(t=>e.supportedSignals[Ft[t]].supported).forEach(e=>i[Ft[e]]=!0),k("exportedSignals",i),T(e?.fields||[]),$(e)},onSelectConfigured:e=>{const t=d.find(t=>t.id===e);t&&M(t)},isLoadingForDestinationIds:F}),x&&t(pa,{categoryItem:x,formData:S,formErrors:C,handleFormChange:k,dynamicFields:N,setDynamicFields:E,validateForm:D,testConnection:c})]})]})})},Fa=p.div`
312
+ `,Ma=({isOnboarding:i,categories:o,potentialDestinations:a,createDestination:r,updateDestination:l,deleteDestination:s,testConnection:c})=>{const{destinations:d}=Y(),{selectedStreamName:u}=Ye(),{currentModal:p,setCurrentModal:h}=ae(),{addConfiguredDestination:m,addConfiguredDestinationUpdateOnly:y,removeConfiguredDestinationUpdateOnly:v,configuredDestinationsUpdateOnly:f}=gt(),b=p===G.Destination,[x,S]=n(void 0),{formData:$,formErrors:C,handleFormChange:k,resetFormData:w,validateForm:N,setYamlFields:T,dynamicFields:D,setDynamicFields:E,loadFormWithDrawerItem:A}=kt({supportedSignals:x?.supportedSignals,preLoadedFields:x?.fields}),[O,F]=n([]),I=e=>{const t={};return e||D.forEach(e=>t[e.name]=e.value),{id:e?.id||"",name:e?.name||$.name,disabled:e?.disabled||$.disabled,dataStreamNames:e?.dataStreamNames||[],conditions:e?.conditions||[],exportedSignals:e?.exportedSignals||$.exportedSignals,fields:e?.fields||JSON.stringify(t),destinationType:e?.destinationType||{type:x.type,displayName:x.displayName,supportedSignals:{logs:{supported:!1},metrics:{supported:!1},traces:{supported:!1}}}}},M=async e=>{if(i&&!e){const e=I();m(e)}else if(i&&e){const t=I(e);f.some(t=>t.id===e.id)?v(e):y(t)}else if(i||e){if(!i&&e){const t=I(e),i=t.dataStreamNames.some(e=>e===u);F(t=>[...t,e.id]),i?await s(e.id):await l(e.id,A(t)),F(t=>t.filter(t=>t!==e.id))}}else r($)},R=()=>{w(),S(void 0),h("")},K=()=>{w(),S(void 0)},P=async()=>{if(x){if(!N({withAlert:!i,alertTitle:ne.Create}))return null;M()}R()};return H({key:"Enter",active:b},()=>P()),t(le,{isOpen:b,onClose:R,header:{title:g.ADD_DESTINATION},actionComponent:t(he,{buttons:(()=>{const e=[{label:"DONE",variant:"primary",onClick:P}];return x&&e.unshift({label:"BACK",icon:()=>t(Wi,{rotate:-90}),variant:"secondary",onClick:K}),e})()}),children:e(Fa,{children:[t(Ia,{children:t(Ft,{currentStep:x?2:1,data:[{stepNumber:1,title:g.DESTINATIONS},{stepNumber:2,title:g.CONNECTION}]})}),e(se,{style:{margin:"32px 24px 12px 24px"},children:[t(Oa,{hidden:void 0!==x,categories:o,potentialDestinations:a,onSelectNew:(e,t)=>{w(),k("type",e?.type||""),k("currentStreamName",u);const i={logs:!1,metrics:!1,traces:!1};t.filter(t=>e.supportedSignals[Ot[t]].supported).forEach(e=>i[Ot[e]]=!0),k("exportedSignals",i),T(e?.fields||[]),S(e)},onSelectConfigured:e=>{const t=d.find(t=>t.id===e);t&&M(t)},isLoadingForDestinationIds:O}),x&&t(ya,{categoryItem:x,formData:$,formErrors:C,handleFormChange:k,dynamicFields:D,setDynamicFields:E,validateForm:N,testConnection:c})]})]})})},Ra=p.div`
313
313
  display: flex;
314
314
  flex-direction: column;
315
315
  align-items: center;
@@ -318,7 +318,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
318
318
  max-height: calc(100vh - 310px);
319
319
  height: fit-content;
320
320
  overflow-y: scroll;
321
- `,Oa=({categories:e,withDelete:i})=>{const{configuredDestinations:n,configuredDestinationsUpdateOnly:o}=gt();return n.length||o.length?t(Fa,{children:n.concat(o).map((a,r)=>t(Ia,{"data-id":`configured-destination-${a.destinationType.type}`,item:a,yamlFields:wt(e,a),isLastItem:n.length+o.length===1,withDelete:i},`configured-destination-${a.destinationType.type}-${r}`))}):t(Fe,{children:t(Oe,{title:"No destinations",subTitle:"Please add a destination"})})},Ia=({item:o,yamlFields:a,isLastItem:r,withDelete:l})=>{const[s,d]=n(!1),{icon:u,iconSrc:p}=We(o.destinationType.type),{removeConfiguredDestination:h,removeConfiguredDestinationUpdateOnly:m}=gt(),g=c(()=>xt(o,a).map(e=>({title:e.name,value:e.value})),[o,a]);return e(i,{children:[t(je,{title:o.name||o.destinationType.displayName,subTitle:o.destinationType.type,iconProps:{icon:u,iconSrc:p},visualProps:{monitors:Be(o.exportedSignals),monitorsWithLabels:!0},extendableProps:{withExtend:!0,renderExtended:()=>t(It,{data:g})},renderActions:l?()=>t(I,{onClick:()=>d(!0),children:t(Fi,{})}):void 0}),l&&t(J,{isOpen:s,name:o.destinationType.displayName||o.name,type:G.Destination,isLastItem:r,onApprove:()=>{o.id?m(o):h(o)},onDeny:()=>d(!1)})]})},Ma=p(Le)`
321
+ `,Ka=({categories:e,withDelete:i})=>{const{configuredDestinations:n,configuredDestinationsUpdateOnly:o}=gt();return n.length||o.length?t(Ra,{children:n.concat(o).map((a,r)=>t(Pa,{"data-id":`configured-destination-${a.destinationType.type}`,item:a,yamlFields:wt(e,a),isLastItem:n.length+o.length===1,withDelete:i},`configured-destination-${a.destinationType.type}-${r}`))}):t(Oe,{children:t(Fe,{title:"No destinations",subTitle:"Please add a destination"})})},Pa=({item:o,yamlFields:a,isLastItem:r,withDelete:l})=>{const[s,d]=n(!1),{icon:u,iconSrc:p}=We(o.destinationType.type),{removeConfiguredDestination:h,removeConfiguredDestinationUpdateOnly:m}=gt(),g=c(()=>xt(o,a).map(e=>({title:e.name,value:e.value})),[o,a]);return e(i,{children:[t(ze,{title:o.name||o.destinationType.displayName,subTitle:o.destinationType.type,iconProps:{icon:u,iconSrc:p},visualProps:{monitors:Ve(o.exportedSignals),monitorsWithLabels:!0},extendableProps:{withExtend:!0,renderExtended:()=>t(It,{data:g})},renderActions:l?()=>t(I,{onClick:()=>d(!0),children:t(Ii,{})}):void 0}),l&&t(J,{isOpen:s,name:o.destinationType.displayName||o.name,type:G.Destination,isLastItem:r,onApprove:()=>{o.id?m(o):h(o)},onDeny:()=>d(!1)})]})},La=p(Pe)`
322
322
  display: flex;
323
323
  align-items: center;
324
324
  justify-content: center;
@@ -327,7 +327,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
327
327
  padding: 32px;
328
328
  border-radius: 16px;
329
329
  border-style: dashed !important;
330
- `,Ra=({isSourcesListEmpty:n,goToSources:o,categories:a,potentialDestinations:r,testConnection:l,onClickSummary:s})=>{const c=m(),{setCurrentModal:d}=ae(),{configuredDestinations:u,configuredDestinationsUpdateOnly:p}=gt();return e(i,{children:[t(se,{$isNotModal:!0,children:e(F,{$gap:12,children:[e(F,{$gap:24,children:[s&&t(ft,{onClick:s}),t(K,{title:g.ADD_DESTINATIONS,badgeLabel:u.length+p.length,description:g.ADD_DESTINATION_DESCRIPTION}),n&&t(ce,{type:de.Warning,message:g.NO_SOURCES_GO_BACK,action:{label:g.SELECT_SOURCES,onClick:o}}),e(Ma,{variant:"secondary",onClick:()=>d(G.Destination),children:[t(Pi,{}),t(B,{color:c.colors.secondary,size:14,decoration:"underline",family:"secondary",children:g.ADD_DESTINATION})]})]}),t(Oa,{categories:a,withDelete:!0})]})}),t(Aa,{isOnboarding:!0,categories:a,potentialDestinations:r,updateDestination:async()=>{},createDestination:async()=>{},deleteDestination:async()=>{},testConnection:l})]})},Pa=[{key:"icon",title:""},{key:"name",title:g.NAME,sortable:!0},{key:"type",title:g.TYPE,sortable:!0},{key:"signals",title:g.MONITORS},{key:"active-status",title:g.STATUS},{key:"conditions",title:"Conditions"},{key:"throughput",title:"Throughput",sortable:!0}],La=({metrics:i,maxHeight:n,maxWidth:o})=>{const a=m(),r=xe(),{selectedStreamName:l}=Ye(),{setDrawerType:s,setDrawerEntityId:d}=V(),{destinations:u,destinationsLoading:p}=Y(),h=c(()=>Qe(u,l),[u,l]),y=c(()=>Hn({instrumentationRules:[],sources:[],actions:[],destinations:tt(h,r),searchText:r.searchText,selectedCategory:G.Destination}).searchResults.find(({category:e})=>e===G.Destination)?.entities||[],[h,r]),v=c(()=>y.map(e=>{const{hasErrors:n,hasWarnings:o,hasDisableds:r}=me(e.conditions||[]),{icon:l,iconSrc:c}=We(e.destinationType.type);return{status:n?de.Error:o?de.Warning:void 0,faded:r,onClick:()=>{s(G.Destination),d(e.id)},cells:[{columnKey:"icon",component:()=>t(Se,{icon:l,src:c})},{columnKey:"name",value:Ce(e,G.Destination,{prioritizeDisplayName:!0})},{columnKey:"type",value:e.destinationType.type,textColor:a.text.info},{columnKey:"throughput",value:Ve(Mt(i,G.Destination,e.id).throughput),textColor:a.text.info},{columnKey:"signals",component:()=>t(ke,{withLabels:!0,monitors:Be(e.exportedSignals)})},{columnKey:"conditions",component:()=>e.conditions?.length?t(Bn,{conditions:e.conditions,id:e.id}):null},{columnKey:"active-status",component:()=>t("div",{style:{lineHeight:1},children:t(ge,{status:e.disabled?de.Error:de.Success,title:e.disabled?g.DISABLED:g.ENABLED,withIcon:!0,withBorder:!0})})}]}}),[y,i]),{badge:f,badgeTooltip:b}=c(()=>y.length!==h.length?{badge:`${y.length}/${h.length}`,badgeTooltip:g.FILTERED_COUNT_TOOLTIP}:{badge:h.length,badgeTooltip:void 0},[y,h]);return e(we,{$maxWidth:o,children:[t(De,{children:t(Te,{icon:Ne(G.Destination),title:g.DESTINATIONS,badge:f,badgeTooltip:b,loading:p})}),t(Ee,{$maxHeight:n,children:t(Ae,{columns:Pa,rows:v})}),!y.length&&t(Fe,{style:{marginTop:"2rem"},children:t(Oe,{})})]})},Ka=e=>{const{type:t,ruleName:i,notes:n,disabled:o,profileName:a,payloadCollection:r,codeAttributes:l,headersCollection:s,customInstrumentations:c}=e,d=[{title:g.TYPE,value:t},{type:y.ActiveStatus,title:g.STATUS,value:String(!o)},{title:g.NAME,value:i},{title:g.NOTES,value:n},{title:g.MANAGED_BY_PROFILE,value:a},{type:y.Divider}];if(r){const e=Object.entries(r).filter(([e,t])=>t).map(([e,t])=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(l){const e=Object.entries(l).filter(([e,t])=>t).map(([e,t])=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(s){const e=(s[Rt.HeaderKeys]||[]).filter(e=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(c){const e=(c[Lt.Java]||[]).map(e=>new Pt(e.className,e.methodName)).map(e=>`• ${e.toString()}`).join("\r\n");e&&d.push({title:g.JAVA_CUSTOM_PROBES,value:e});const t=(c[Lt.Golang]||[]).map(e=>new Kt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)).map(e=>`• ${e.toString()}`).join("\r\n");t&&d.push({title:g.GOLANG_CUSTOM_PROBES,value:t})}return d},ja=p.div`
330
+ `,za=({isSourcesListEmpty:n,goToSources:o,categories:a,potentialDestinations:r,testConnection:l,onClickSummary:s})=>{const c=m(),{setCurrentModal:d}=ae(),{configuredDestinations:u,configuredDestinationsUpdateOnly:p}=gt();return e(i,{children:[t(se,{$isNotModal:!0,children:e(O,{$gap:12,children:[e(O,{$gap:24,children:[s&&t(ft,{onClick:s}),t(L,{title:g.ADD_DESTINATIONS,badgeLabel:u.length+p.length,description:g.ADD_DESTINATION_DESCRIPTION}),n&&t(ce,{type:de.Warning,message:g.NO_SOURCES_GO_BACK,action:{label:g.SELECT_SOURCES,onClick:o}}),e(La,{variant:"secondary",onClick:()=>d(G.Destination),children:[t(Li,{}),t(V,{color:c.colors.secondary,size:14,decoration:"underline",family:"secondary",children:g.ADD_DESTINATION})]})]}),t(Ka,{categories:a,withDelete:!0})]})}),t(Ma,{isOnboarding:!0,categories:a,potentialDestinations:r,updateDestination:async()=>{},createDestination:async()=>{},deleteDestination:async()=>{},testConnection:l})]})},ja=[{key:"icon",title:""},{key:"name",title:g.NAME,sortable:!0},{key:"type",title:g.TYPE,sortable:!0},{key:"signals",title:g.MONITORS},{key:"active-status",title:g.STATUS},{key:"conditions",title:"Conditions"},{key:"throughput",title:"Throughput",sortable:!0}],qa=({metrics:i,maxHeight:n,maxWidth:o})=>{const a=m(),r=xe(),{selectedStreamName:l}=Ye(),{setDrawerType:s,setDrawerEntityId:d}=B(),{destinations:u,destinationsLoading:p}=Y(),h=c(()=>Qe(u,l),[u,l]),y=c(()=>Un({instrumentationRules:[],sources:[],actions:[],destinations:tt(h,r),searchText:r.searchText,selectedCategory:G.Destination}).searchResults.find(({category:e})=>e===G.Destination)?.entities||[],[h,r]),v=c(()=>y.map(e=>{const{hasErrors:n,hasWarnings:o,hasDisableds:r}=me(e.conditions||[]),{icon:l,iconSrc:c}=We(e.destinationType.type);return{status:n?de.Error:o?de.Warning:void 0,faded:r,onClick:()=>{s(G.Destination),d(e.id)},cells:[{columnKey:"icon",component:()=>t($e,{icon:l,src:c})},{columnKey:"name",value:Ce(e,G.Destination,{prioritizeDisplayName:!0})},{columnKey:"type",value:e.destinationType.type,textColor:a.text.info},{columnKey:"throughput",value:Be(Mt(i,G.Destination,e.id).throughput),textColor:a.text.info},{columnKey:"signals",component:()=>t(ke,{withLabels:!0,monitors:Ve(e.exportedSignals)})},{columnKey:"conditions",component:()=>e.conditions?.length?t(_n,{conditions:e.conditions,id:e.id}):null},{columnKey:"active-status",component:()=>t("div",{style:{lineHeight:1},children:t(ge,{status:e.disabled?de.Error:de.Success,title:e.disabled?g.DISABLED:g.ENABLED,withIcon:!0,withBorder:!0})})}]}}),[y,i]),{badge:f,badgeTooltip:b}=c(()=>y.length!==h.length?{badge:`${y.length}/${h.length}`,badgeTooltip:g.FILTERED_COUNT_TOOLTIP}:{badge:h.length,badgeTooltip:void 0},[y,h]);return e(we,{$maxWidth:o,children:[t(Ne,{children:t(Te,{icon:De(G.Destination),title:g.DESTINATIONS,badge:f,badgeTooltip:b,loading:p})}),t(Ee,{$maxHeight:n,children:t(Ae,{columns:ja,rows:v})}),!y.length&&t(Oe,{style:{marginTop:"2rem"},children:t(Fe,{})})]})},Va=e=>{const{type:t,ruleName:i,notes:n,disabled:o,profileName:a,payloadCollection:r,codeAttributes:l,headersCollection:s,customInstrumentations:c}=e,d=[{title:g.TYPE,value:t},{type:y.ActiveStatus,title:g.STATUS,value:String(!o)},{title:g.NAME,value:i},{title:g.NOTES,value:n},{title:g.MANAGED_BY_PROFILE,value:a},{type:y.Divider}];if(r){const e=Object.entries(r).filter(([e,t])=>t).map(([e,t])=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(l){const e=Object.entries(l).filter(([e,t])=>t).map(([e,t])=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(s){const e=(s[Rt.HeaderKeys]||[]).filter(e=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(c){const e=(c[Pt.Java]||[]).map(e=>new Kt(e.className,e.methodName)).map(e=>`• ${e.toString()}`).join("\r\n");e&&d.push({title:g.JAVA_CUSTOM_PROBES,value:e});const t=(c[Pt.Golang]||[]).map(e=>new Lt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)).map(e=>`• ${e.toString()}`).join("\r\n");t&&d.push({title:g.GOLANG_CUSTOM_PROBES,value:t})}return d},Ba=p.div`
331
331
  display: flex;
332
332
  flex-direction: column;
333
333
  gap: 12px;
@@ -337,7 +337,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
337
337
  border-radius: 16px;
338
338
  padding: 8px;
339
339
  `}
340
- `,za=[{id:jt.FilePath,label:"Collect File Path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:jt.Function,label:"Collect Function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:jt.LineNumber,label:"Collect Line Number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],qa=[{id:jt.Column,label:"Collect Column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:jt.Namespace,label:"Collect Namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:jt.StackTrace,label:"Collect Stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],Ba={[Lt.Java]:[new Pt("","")],[Lt.Golang]:[new Kt("")]},Va=["*"],Ha=p.div`
340
+ `,Ha=[{id:zt.FilePath,label:"Collect File Path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:zt.Function,label:"Collect Function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:zt.LineNumber,label:"Collect Line Number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],Wa=[{id:zt.Column,label:"Collect Column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:zt.Namespace,label:"Collect Namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:zt.StackTrace,label:"Collect Stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],_a={[Pt.Java]:[new Kt("","")],[Pt.Golang]:[new Lt("")]},Ja=["*"],Ua=p.div`
341
341
  display: flex;
342
342
  flex-direction: column;
343
343
  gap: 12px;
@@ -347,27 +347,27 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
347
347
  border-radius: 16px;
348
348
  padding: 8px;
349
349
  `}
350
- `,Wa=[{id:zt.HttpRequest,label:"Collect HTTP Request"},{id:zt.HttpResponse,label:"Collect HTTP Response"},{id:zt.DbQuery,label:"Collect DB Query"},{id:zt.Messaging,label:"Collect Messaging"}],_a={[qt.CodeAttributes]:({value:a,setValue:r,formErrors:l})=>{const s=l.codeAttributes,d=c(()=>Object.entries(a.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[a]),[u,p]=n(1===d.length);o(()=>{if(!d.length){const e={[jt.Column]:null,[jt.FilePath]:!0,[jt.Function]:!0,[jt.LineNumber]:!0,[jt.Namespace]:null,[jt.StackTrace]:null};r("codeAttributes",e),p(!1)}},[]);const h=(e,t)=>{const i=t?[...d,e]:d.filter(t=>t!==e),n=Object.values(jt).reduce((e,t)=>(e[t]=!!i.includes(t)||null,e),{});r("codeAttributes",n),p(1===i.length)};return e(i,{children:[e("div",{children:[t(x,{title:"Recommended data to collect",required:!0}),t(ja,{$hasError:!!s,children:za.map(({id:e,label:i,tooltip:n})=>t(fe,{text:n,withIcon:!0,children:t($,{title:i,disabled:u&&d.includes(e),value:d.includes(e),onChange:t=>h(e,t)})},e))}),!!s&&t(S,{children:s})]}),e("div",{children:[t(x,{title:"Verbose data to collect",required:!0}),t(ja,{$hasError:!!s,children:qa.map(({id:e,label:i,tooltip:n})=>t(fe,{text:n,withIcon:!0,children:t($,{title:i,disabled:u&&d.includes(e),value:d.includes(e),onChange:t=>h(e,t)})},e))}),!!s&&t(S,{children:s})]})]})},[qt.CustomInstrumentation]:({value:i,setValue:n,formErrors:a})=>{const r=a.customInstrumentations,l=c(()=>(i?.customInstrumentations?.[Lt.Java]||[]).map(e=>({key:e.className,value:e.methodName})),[i]),s=c(()=>(i?.customInstrumentations?.[Lt.Golang]||[]).map(e=>new Kt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[i]),d=(e,t)=>{const i={};switch(t){case"java":i[Lt.Java]=e.map(e=>new Pt(e.className,e.methodName)),i[Lt.Golang]=s.map(e=>new Kt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName));break;case"golang":i[Lt.Golang]=e.map(e=>new Kt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),i[Lt.Java]=l.map(({key:e,value:t})=>new Pt(e,t))}n("customInstrumentations",i)};return o(()=>{i?.customInstrumentations||n("customInstrumentations",{[Lt.Golang]:Ba[Lt.Golang],[Lt.Java]:Ba[Lt.Java]})},[n,i]),e("div",{children:[t(D,{title:"Golang Custom Probes",columns:[{title:"",keyName:"packageName",placeholder:"Package name",required:!0,tooltip:"The full import path of the package containing the function or method to be instrumented."},{title:"",keyName:"functionName",placeholder:"Function name",required:!1,tooltip:"The name of the function to be instrumented. Leave empty if instrumenting a receiver method."},{title:"",keyName:"receiverName",placeholder:"Receiver name",required:!1,tooltip:"The name of the receiver type if instrumenting a method. Leave empty if instrumenting a standalone function."},{title:"",keyName:"receiverMethodName",placeholder:"Receiver method name",required:!1,tooltip:"The name of the method to be instrumented. Leave empty if instrumenting a standalone function."}],value:s,onChange:e=>d(e,"golang"),errorMessage:r,limitFieldsPerRow:2}),t(N,{title:"Java Custom Probes",tooltip:"Specify class name and method name pair to instrument.",value:l,onChange:(e=[])=>d(e.map(({key:e,value:t})=>({className:e,methodName:t})),"java"),errorMessage:r,keyPlaceholder:"Class name",valuePlaceholder:"Method name"})]})},[qt.HeadersCollection]:({value:e,setValue:i,formErrors:n})=>{const a=n.headersCollection,r=c(()=>e?.headersCollection?.[Rt.HeaderKeys]||[],[e]),l=e=>{const t={[Rt.HeaderKeys]:e};i("headersCollection",t)};return o(()=>{r.length||l(Va)},[r]),t("div",{children:r.length>0&&t(E,{title:"Header Keys",tooltip:"Specify which headers you want to collect, asterisk (*) will collect all headers.",value:r,onChange:e=>l(e),errorMessage:a})})},[qt.PayloadCollection]:({value:i,setValue:a,formErrors:r})=>{const l=r.payloadCollection,s=c(()=>Object.entries(i.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[i]),[d,u]=n(1===s.length);return o(()=>{if(!s.length){const e={[zt.HttpRequest]:{},[zt.HttpResponse]:{},[zt.DbQuery]:{},[zt.Messaging]:{}};a("payloadCollection",e),u(!1)}},[]),e("div",{children:[t(x,{title:"Type of data to collect",required:!0}),t(Ha,{$hasError:!!l,children:Wa.map(({id:e,label:i})=>t($,{title:i,disabled:d&&s.includes(e),value:s.includes(e),onChange:t=>((e,t)=>{const i=t?[...s,e]:s.filter(t=>t!==e),n={[zt.HttpRequest]:i.includes(zt.HttpRequest)?{}:null,[zt.HttpResponse]:i.includes(zt.HttpResponse)?{}:null,[zt.DbQuery]:i.includes(zt.DbQuery)?{}:null,[zt.Messaging]:i.includes(zt.Messaging)?{}:null};a("payloadCollection",n),u(1===i.length)})(e,t)},e))}),!!l&&t(S,{children:l})]})},[qt.UnknownType]:null},Ja=({ruleType:e,value:i,setValue:n,formErrors:o})=>{if(!e)return null;const a=_a[e];return a?t(a,{value:i,setValue:n,formErrors:o}):null},Ua=p.div`
350
+ `,Ga=[{id:jt.HttpRequest,label:"Collect HTTP Request"},{id:jt.HttpResponse,label:"Collect HTTP Response"},{id:jt.DbQuery,label:"Collect DB Query"},{id:jt.Messaging,label:"Collect Messaging"}],Ya={[qt.CodeAttributes]:({value:a,setValue:r,formErrors:l})=>{const s=l.codeAttributes,d=c(()=>Object.entries(a.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[a]),[u,p]=n(1===d.length);o(()=>{if(!d.length){const e={[zt.Column]:null,[zt.FilePath]:!0,[zt.Function]:!0,[zt.LineNumber]:!0,[zt.Namespace]:null,[zt.StackTrace]:null};r("codeAttributes",e),p(!1)}},[]);const h=(e,t)=>{const i=t?[...d,e]:d.filter(t=>t!==e),n=Object.values(zt).reduce((e,t)=>(e[t]=!!i.includes(t)||null,e),{});r("codeAttributes",n),p(1===i.length)};return e(i,{children:[e("div",{children:[t(x,{title:"Recommended data to collect",required:!0}),t(Ba,{$hasError:!!s,children:Ha.map(({id:e,label:i,tooltip:n})=>t(fe,{text:n,withIcon:!0,children:t(S,{title:i,disabled:u&&d.includes(e),value:d.includes(e),onChange:t=>h(e,t)})},e))}),!!s&&t($,{children:s})]}),e("div",{children:[t(x,{title:"Verbose data to collect",required:!0}),t(Ba,{$hasError:!!s,children:Wa.map(({id:e,label:i,tooltip:n})=>t(fe,{text:n,withIcon:!0,children:t(S,{title:i,disabled:u&&d.includes(e),value:d.includes(e),onChange:t=>h(e,t)})},e))}),!!s&&t($,{children:s})]})]})},[qt.CustomInstrumentation]:({value:i,setValue:n,formErrors:a})=>{const r=a.customInstrumentations,l=c(()=>(i?.customInstrumentations?.[Pt.Java]||[]).map(e=>({key:e.className,value:e.methodName})),[i]),s=c(()=>(i?.customInstrumentations?.[Pt.Golang]||[]).map(e=>new Lt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[i]),d=(e,t)=>{const i={};switch(t){case"java":i[Pt.Java]=e.map(e=>new Kt(e.className,e.methodName)),i[Pt.Golang]=s.map(e=>new Lt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName));break;case"golang":i[Pt.Golang]=e.map(e=>new Lt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),i[Pt.Java]=l.map(({key:e,value:t})=>new Kt(e,t))}n("customInstrumentations",i)};return o(()=>{i?.customInstrumentations||n("customInstrumentations",{[Pt.Golang]:_a[Pt.Golang],[Pt.Java]:_a[Pt.Java]})},[n,i]),e("div",{children:[t(N,{title:"Golang Custom Probes",columns:[{title:"",keyName:"packageName",placeholder:"Package name",required:!0,tooltip:"The full import path of the package containing the function or method to be instrumented."},{title:"",keyName:"functionName",placeholder:"Function name",required:!1,tooltip:"The name of the function to be instrumented. Leave empty if instrumenting a receiver method."},{title:"",keyName:"receiverName",placeholder:"Receiver name",required:!1,tooltip:"The name of the receiver type if instrumenting a method. Leave empty if instrumenting a standalone function."},{title:"",keyName:"receiverMethodName",placeholder:"Receiver method name",required:!1,tooltip:"The name of the method to be instrumented. Leave empty if instrumenting a standalone function."}],value:s,onChange:e=>d(e,"golang"),errorMessage:r,limitFieldsPerRow:2}),t(D,{title:"Java Custom Probes",tooltip:"Specify class name and method name pair to instrument.",value:l,onChange:(e=[])=>d(e.map(({key:e,value:t})=>({className:e,methodName:t})),"java"),errorMessage:r,keyPlaceholder:"Class name",valuePlaceholder:"Method name"})]})},[qt.HeadersCollection]:({value:e,setValue:i,formErrors:n})=>{const a=n.headersCollection,r=c(()=>e?.headersCollection?.[Rt.HeaderKeys]||[],[e]),l=e=>{const t={[Rt.HeaderKeys]:e};i("headersCollection",t)};return o(()=>{r.length||l(Ja)},[r]),t("div",{children:r.length>0&&t(E,{title:"Header Keys",tooltip:"Specify which headers you want to collect, asterisk (*) will collect all headers.",value:r,onChange:e=>l(e),errorMessage:a})})},[qt.PayloadCollection]:({value:i,setValue:a,formErrors:r})=>{const l=r.payloadCollection,s=c(()=>Object.entries(i.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[i]),[d,u]=n(1===s.length);return o(()=>{if(!s.length){const e={[jt.HttpRequest]:{},[jt.HttpResponse]:{},[jt.DbQuery]:{},[jt.Messaging]:{}};a("payloadCollection",e),u(!1)}},[]),e("div",{children:[t(x,{title:"Type of data to collect",required:!0}),t(Ua,{$hasError:!!l,children:Ga.map(({id:e,label:i})=>t(S,{title:i,disabled:d&&s.includes(e),value:s.includes(e),onChange:t=>((e,t)=>{const i=t?[...s,e]:s.filter(t=>t!==e),n={[jt.HttpRequest]:i.includes(jt.HttpRequest)?{}:null,[jt.HttpResponse]:i.includes(jt.HttpResponse)?{}:null,[jt.DbQuery]:i.includes(jt.DbQuery)?{}:null,[jt.Messaging]:i.includes(jt.Messaging)?{}:null};a("payloadCollection",n),u(1===i.length)})(e,t)},e))}),!!l&&t($,{children:l})]})},[qt.UnknownType]:null},Xa=({ruleType:e,value:i,setValue:n,formErrors:o})=>{if(!e)return null;const a=Ya[e];return a?t(a,{value:i,setValue:n,formErrors:o}):null},Za=p.div`
351
351
  display: flex;
352
352
  flex-direction: column;
353
353
  gap: 24px;
354
354
  padding: 4px;
355
- `,Ga=p(B)`
355
+ `,Qa=p(V)`
356
356
  margin-bottom: 12px;
357
- `,Ya=({isUpdate:n,rule:o,formData:a,formErrors:r,handleFormChange:l})=>{const s=m();return e(Ua,{children:[t(O,{children:o.supportedLanguages.map(e=>t(Bt,{icon:Vt(e),type:de.Info,children:dt[e]},e))}),n?e("div",{children:[t(Ga,{children:"Status"}),t(P,{options:[{icon:Oi,label:g.ENABLED,value:!1,selectedBgColor:s.text.success+L["050"]},{icon:Ii,label:g.DISABLED,value:!0,selectedBgColor:s.text.error+L["050"]}],selected:a.disabled,setSelected:e=>l("disabled",e)})]}):e(i,{children:[t(K,{title:"",description:o.docsDescription,actionButton:t(j,{endpoint:o.docsEndpoint})}),t(C,{title:"Rule name",placeholder:"Use a name that describes the rule",value:a.ruleName,onChange:({target:{value:e}})=>l("ruleName",e),errorMessage:r.ruleName})]}),t(Ja,{ruleType:o.type,value:a,setValue:(e,t)=>l(e,t),formErrors:r}),t(q,{title:"Notes",value:a.notes,onChange:({target:{value:e}})=>l("notes",e),errorMessage:r.notes})]})},Xa=p.div`
357
+ `,er=({isUpdate:n,rule:o,formData:a,formErrors:r,handleFormChange:l})=>{const s=m();return e(Za,{children:[t(F,{children:o.supportedLanguages.map(e=>t(Vt,{icon:Bt(e),type:de.Info,children:dt[e]},e))}),n?e("div",{children:[t(Qa,{children:"Status"}),t(K,{options:[{icon:Mi,label:g.ENABLED,value:!1,selectedBgColor:s.text.success+P["050"]},{icon:Ri,label:g.DISABLED,value:!0,selectedBgColor:s.text.error+P["050"]}],selected:a.disabled,setSelected:e=>l("disabled",e)})]}):e(i,{children:[t(L,{title:"",description:o.docsDescription,actionButton:t(z,{endpoint:o.docsEndpoint})}),t(C,{title:"Rule name",placeholder:"Use a name that describes the rule",value:a.ruleName,onChange:({target:{value:e}})=>l("ruleName",e),errorMessage:r.ruleName})]}),t(Xa,{ruleType:o.type,value:a,setValue:(e,t)=>l(e,t),formErrors:r}),t(q,{title:"Notes",value:a.notes,onChange:({target:{value:e}})=>l("notes",e),errorMessage:r.notes})]})},tr=p.div`
358
358
  width: 100%;
359
359
  height: 100%;
360
360
  max-height: calc(100vh - 220px);
361
361
  overflow: overlay;
362
362
  overflow-y: auto;
363
- `,Za=p.div`
363
+ `,ir=p.div`
364
364
  display: flex;
365
365
  flex-direction: column;
366
366
  gap: 12px;
367
- `,Qa=({updateInstrumentationRule:i,deleteInstrumentationRule:a})=>{const{instrumentationRules:r}=Y(),{addNotification:s}=Ht(),{drawerType:d,drawerEntityId:u}=V(),p=l(null),h=d===G.InstrumentationRule,[m,g]=n(!1),[y,v]=n(!1),{formData:f,formErrors:b,handleFormChange:x,resetFormData:$,validateForm:S,loadFormWithDrawerItem:C}=Wt(),k=c(()=>{if(u)return r?.find(e=>Z(e)===u)},[u,r]);if(o(()=>{h&&k?C(k):$()},[h,k]),!k)return null;const w=_t.find(({type:e})=>e===k.type);return t(Mn,{ref:p,title:k.ruleName||k.type,icons:[He(k.type)],isEdit:m,isFormDirty:y,onEdit:e=>{k.mutable||!e&&void 0!==e?g("boolean"!=typeof e||e):s({type:de.Warning,title:ue.FORBIDDEN,message:ue.CANNOT_EDIT_RULE,crdType:G.InstrumentationRule,target:u,hideFromHistory:!0})},onSave:e=>{if(S()){const t=e!==k.type?e:"";x("ruleName",t),i(u,{...f,ruleName:t}),g(!1),v(!1)}},onDelete:()=>{k.mutable?(a(u),g(!1),v(!1),p.current?.closeDrawer()):s({type:de.Warning,title:ue.FORBIDDEN,message:ue.CANNOT_DELETE_RULE,crdType:G.InstrumentationRule,target:u,hideFromHistory:!0})},onCancel:()=>{g(!1),v(!1),C(k)},children:m&&w?t(Xa,{children:t(Ya,{isUpdate:!0,rule:w,formData:f,formErrors:b,handleFormChange:(...e)=>{v(!0),x(...e)}})}):e(Za,{children:[t(ee,{conditions:k.conditions||[]}),t(te,{title:"Instrumentation Rule Details",data:k?Ka(k):[]})]})})},er=p(F)`
367
+ `,nr=({updateInstrumentationRule:i,deleteInstrumentationRule:a})=>{const{instrumentationRules:r}=Y(),{addNotification:s}=Ht(),{drawerType:d,drawerEntityId:u}=B(),p=l(null),h=d===G.InstrumentationRule,[m,g]=n(!1),[y,v]=n(!1),{formData:f,formErrors:b,handleFormChange:x,resetFormData:S,validateForm:$,loadFormWithDrawerItem:C}=Wt(),k=c(()=>{if(u)return r?.find(e=>Z(e)===u)},[u,r]);if(o(()=>{h&&k?C(k):S()},[h,k]),!k)return null;const w=_t.find(({type:e})=>e===k.type);return t(Ln,{ref:p,title:k.ruleName||k.type,icons:[He(k.type)],isEdit:m,isFormDirty:y,onEdit:e=>{k.mutable||!e&&void 0!==e?g("boolean"!=typeof e||e):s({type:de.Warning,title:ue.FORBIDDEN,message:ue.CANNOT_EDIT_RULE,crdType:G.InstrumentationRule,target:u,hideFromHistory:!0})},onSave:e=>{if($()){const t=e!==k.type?e:"";x("ruleName",t),i(u,{...f,ruleName:t}),g(!1),v(!1)}},onDelete:()=>{k.mutable?(a(u),g(!1),v(!1),p.current?.closeDrawer()):s({type:de.Warning,title:ue.FORBIDDEN,message:ue.CANNOT_DELETE_RULE,crdType:G.InstrumentationRule,target:u,hideFromHistory:!0})},onCancel:()=>{g(!1),v(!1),C(k)},children:m&&w?t(tr,{children:t(er,{isUpdate:!0,rule:w,formData:f,formErrors:b,handleFormChange:(...e)=>{v(!0),x(...e)}})}):e(ir,{children:[t(ee,{conditions:k.conditions||[]}),t(te,{title:"Instrumentation Rule Details",data:k?Va(k):[]})]})})},or=p(O)`
368
368
  margin-top: 24px;
369
369
  gap: 12px;
370
- `,tr=_t,ir=({createInstrumentationRule:i})=>{const{tier:o}=oe(),a=o===Jt.Onprem,{currentModal:r,setCurrentModal:l}=ae(),s=r===G.InstrumentationRule,{formData:c,formErrors:d,handleFormChange:u,resetFormData:p,validateForm:h}=Wt(),[m,y]=n(void 0),v=()=>{p(),y(void 0),l("")},f=()=>{if(!h())return null;i(c),v()};return H({key:"Enter",active:s},()=>f()),t(le,{isOpen:s,onClose:v,header:{title:"Add Instrumentation Rule"},actionComponent:t(he,{buttons:[{variant:"primary",label:"DONE",onClick:f,disabled:!a||!m,tooltip:a?"":ue.ENTERPRISE_ONLY("Instrumentation Rules")}]}),children:e(se,{children:[t(K,{title:"Select Instrumentation Rule",description:"Define how telemetry is recorded from your application. Choose a rule type and configure the details."}),e(er,{children:[t(ce,a?{type:de.Warning,message:ue.DEFINED_FOR_ALL_STREAMS(g.INSTRUMENTATION_RULES)}:{type:de.Default,message:ue.ENTERPRISE_ONLY(g.INSTRUMENTATION_RULES)}),t(pe,{options:tr,selectedOption:m,onOptionSelect:e=>{return t=e,p(),void y(t);var t},autoFocus:!m?.type})]}),m?.type?e("div",{children:[t(A,{margin:"16px 0"}),t(Ya,{rule:m,formData:c,formErrors:d,handleFormChange:u})]}):null]})})},nr=e=>{const{payloadCollection:t,codeAttributes:i,customInstrumentations:n}=e;let o="";return t&&(o+=Object.entries(t).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),i&&(o+=Object.entries(i).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),n&&Object.values(Lt).forEach(e=>{const t=(n[e]||[]).filter(e=>e).join(", ");t&&(o+=o?`, ${t}`:t)}),o},or=[{key:"icon",title:""},{key:"name",title:g.NAME,sortable:!0},{key:"profile",title:g.MANAGED_BY_PROFILE,sortable:!0},{key:"active-status",title:g.STATUS},{key:"conditions",title:"Conditions"},{key:"source-count",title:"Applicable Source"},{key:"type",title:g.TYPE,sortable:!0},{key:"spec",title:"Spec",sortable:!0},{key:"notes",title:g.NOTES,sortable:!0}],ar=({maxHeight:i,maxWidth:n})=>{const o=m(),a=xe(),{setDrawerType:r,setDrawerEntityId:l}=V(),{instrumentationRules:s,instrumentationRulesLoading:d}=Y(),u=c(()=>Hn({instrumentationRules:s,sources:[],actions:[],destinations:[],searchText:a.searchText,selectedCategory:G.InstrumentationRule}).searchResults.find(({category:e})=>e===G.InstrumentationRule)?.entities||[],[s,a]),p=c(()=>u.map(e=>{const{hasErrors:i,hasWarnings:n,hasDisableds:a}=me(e.conditions||[]);return{status:i?de.Error:n?de.Warning:void 0,faded:a,onClick:()=>{r(G.InstrumentationRule),l(e.ruleId)},cells:[{columnKey:"icon",component:()=>t(Se,{icon:He(e.type)})},{columnKey:"name",value:Ce(e,G.InstrumentationRule,{prioritizeDisplayName:!0})},{columnKey:"type",value:e.type,textColor:o.text.info},{columnKey:"profile",value:e.profileName,textColor:o.text.info},{columnKey:"notes",value:e.notes,textColor:o.text.info,withTooltip:!0},{columnKey:"spec",value:nr(e),textColor:o.text.info,withTooltip:!0},{columnKey:"conditions",component:()=>t(Bn,{conditions:e.conditions||[],id:e.ruleId})},{columnKey:"active-status",component:()=>t("div",{style:{lineHeight:1},children:t(ge,{status:e.disabled?de.Error:de.Success,title:e.disabled?g.DISABLED:g.ENABLED,withIcon:!0,withBorder:!0})})},{columnKey:"source-count",component:()=>t("div",{style:{lineHeight:1},children:t(ge,{status:de.Info,title:"all sources",withBorder:!0})})}]}}),[u]),{badge:h,badgeTooltip:y}=c(()=>u.length!==s.length?{badge:`${u.length}/${s.length}`,badgeTooltip:g.FILTERED_COUNT_TOOLTIP}:{badge:s.length,badgeTooltip:void 0},[u,s]);return e(we,{$maxWidth:n,children:[t(De,{children:t(Te,{icon:Ne(G.Action),title:g.INSTRUMENTATION_RULES,badge:h,badgeTooltip:y,loading:d})}),t(Ee,{$maxHeight:i,children:t(Ae,{columns:or,rows:p})}),!u.length&&t(Fe,{style:{marginTop:"2rem"},children:t(Oe,{})})]})},rr=p.div`
370
+ `,ar=_t,rr=({createInstrumentationRule:i})=>{const{tier:o}=oe(),a=o===Jt.Onprem,{currentModal:r,setCurrentModal:l}=ae(),s=r===G.InstrumentationRule,{formData:c,formErrors:d,handleFormChange:u,resetFormData:p,validateForm:h}=Wt(),[m,y]=n(void 0),v=()=>{p(),y(void 0),l("")},f=()=>{if(!h())return null;i(c),v()};return H({key:"Enter",active:s},()=>f()),t(le,{isOpen:s,onClose:v,header:{title:"Add Instrumentation Rule"},actionComponent:t(he,{buttons:[{variant:"primary",label:"DONE",onClick:f,disabled:!a||!m,tooltip:a?"":ue.ENTERPRISE_ONLY("Instrumentation Rules")}]}),children:e(se,{children:[t(L,{title:"Select Instrumentation Rule",description:"Define how telemetry is recorded from your application. Choose a rule type and configure the details."}),e(or,{children:[t(ce,a?{type:de.Warning,message:ue.DEFINED_FOR_ALL_STREAMS(g.INSTRUMENTATION_RULES)}:{type:de.Default,message:ue.ENTERPRISE_ONLY(g.INSTRUMENTATION_RULES)}),t(pe,{options:ar,selectedOption:m,onOptionSelect:e=>{return t=e,p(),void y(t);var t},autoFocus:!m?.type})]}),m?.type?e("div",{children:[t(A,{margin:"16px 0"}),t(er,{rule:m,formData:c,formErrors:d,handleFormChange:u})]}):null]})})},lr=e=>{const{payloadCollection:t,codeAttributes:i,customInstrumentations:n}=e;let o="";return t&&(o+=Object.entries(t).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),i&&(o+=Object.entries(i).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),n&&Object.values(Pt).forEach(e=>{const t=(n[e]||[]).filter(e=>e).join(", ");t&&(o+=o?`, ${t}`:t)}),o},sr=[{key:"icon",title:""},{key:"name",title:g.NAME,sortable:!0},{key:"profile",title:g.MANAGED_BY_PROFILE,sortable:!0},{key:"active-status",title:g.STATUS},{key:"conditions",title:"Conditions"},{key:"source-count",title:"Applicable Source"},{key:"type",title:g.TYPE,sortable:!0},{key:"spec",title:"Spec",sortable:!0},{key:"notes",title:g.NOTES,sortable:!0}],cr=({maxHeight:i,maxWidth:n})=>{const o=m(),a=xe(),{setDrawerType:r,setDrawerEntityId:l}=B(),{instrumentationRules:s,instrumentationRulesLoading:d}=Y(),u=c(()=>Un({instrumentationRules:s,sources:[],actions:[],destinations:[],searchText:a.searchText,selectedCategory:G.InstrumentationRule}).searchResults.find(({category:e})=>e===G.InstrumentationRule)?.entities||[],[s,a]),p=c(()=>u.map(e=>{const{hasErrors:i,hasWarnings:n,hasDisableds:a}=me(e.conditions||[]);return{status:i?de.Error:n?de.Warning:void 0,faded:a,onClick:()=>{r(G.InstrumentationRule),l(e.ruleId)},cells:[{columnKey:"icon",component:()=>t($e,{icon:He(e.type)})},{columnKey:"name",value:Ce(e,G.InstrumentationRule,{prioritizeDisplayName:!0})},{columnKey:"type",value:e.type,textColor:o.text.info},{columnKey:"profile",value:e.profileName,textColor:o.text.info},{columnKey:"notes",value:e.notes,textColor:o.text.info,withTooltip:!0},{columnKey:"spec",value:lr(e),textColor:o.text.info,withTooltip:!0},{columnKey:"conditions",component:()=>t(_n,{conditions:e.conditions||[],id:e.ruleId})},{columnKey:"active-status",component:()=>t("div",{style:{lineHeight:1},children:t(ge,{status:e.disabled?de.Error:de.Success,title:e.disabled?g.DISABLED:g.ENABLED,withIcon:!0,withBorder:!0})})},{columnKey:"source-count",component:()=>t("div",{style:{lineHeight:1},children:t(ge,{status:de.Info,title:"all sources",withBorder:!0})})}]}}),[u]),{badge:h,badgeTooltip:y}=c(()=>u.length!==s.length?{badge:`${u.length}/${s.length}`,badgeTooltip:g.FILTERED_COUNT_TOOLTIP}:{badge:s.length,badgeTooltip:void 0},[u,s]);return e(we,{$maxWidth:n,children:[t(Ne,{children:t(Te,{icon:De(G.Action),title:g.INSTRUMENTATION_RULES,badge:h,badgeTooltip:y,loading:d})}),t(Ee,{$maxHeight:i,children:t(Ae,{columns:sr,rows:p})}),!u.length&&t(Oe,{style:{marginTop:"2rem"},children:t(Fe,{})})]})},dr=p.div`
371
371
  position: fixed;
372
372
  bottom: 0;
373
373
  left: 50%;
@@ -381,17 +381,17 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
381
381
  border: 1px solid ${({theme:e})=>e.colors.border};
382
382
  background-color: ${({theme:e})=>e.colors.dropdown_bg};
383
383
  animation-name: ${Gt.in.center};
384
- `,lr=({totalSourceCount:i,uninstrumentSources:o,restartWorkloads:r})=>{const l=m(),{selectedSources:s,setSelectedSources:d}=Ke(),[u,p]=n(!1),[h,g]=n(!1),y=c(()=>{let e=0;return Object.values(s).forEach(t=>{e+=t.length}),e},[s]),v=()=>{d({})};return y?e(a,{children:[e(rr,{"data-id":"multi-source-control",children:[t(B,{children:"Selected sources"}),t(Me,{label:y,filled:!0}),t(A,{orientation:"vertical",length:"16px"}),t(Le,{variant:"tertiary",onClick:v,children:t(B,{family:"secondary",decoration:"underline",children:"Deselect"})}),e(Le,{variant:"tertiary",onClick:()=>g(!0),children:[t(Hi,{}),t(B,{family:"secondary",decoration:"underline",children:"Restart"})]}),e(Le,{variant:"tertiary",onClick:()=>p(!0),children:[t(Fi,{}),t(B,{family:"secondary",decoration:"underline",color:l.text.error,children:"Uninstrument"})]})]}),t(J,{isOpen:u,name:`${y} sources`,type:G.Source,isLastItem:y===i,onApprove:()=>{const e={};Object.entries(s).forEach(([t,i])=>{e[t]=i.map(e=>({...e,selected:!1}))}),o(e),p(!1),v()},onDeny:()=>p(!1)}),t(Ut,{isOpen:h,title:"Rollout Restart Workloads",description:"Are you sure you want to rollout restart these workloads?",approveButton:{text:"Confirm",variant:de.Warning,onClick:()=>{const e=[];Object.values(s).forEach(t=>{e.push(...t.map(e=>Yt(e)))}),r(e),v()}},denyButton:{text:"Go Back",onClick:()=>g(!1)}})]}):null},sr=p.div`
384
+ `,ur=({totalSourceCount:i,uninstrumentSources:o,restartWorkloads:r})=>{const l=m(),{selectedSources:s,setSelectedSources:d}=Le(),[u,p]=n(!1),[h,g]=n(!1),y=c(()=>{let e=0;return Object.values(s).forEach(t=>{e+=t.length}),e},[s]),v=()=>{d({})};return y?e(a,{children:[e(dr,{"data-id":"multi-source-control",children:[t(V,{children:"Selected sources"}),t(Me,{label:y,filled:!0}),t(A,{orientation:"vertical",length:"16px"}),t(Pe,{variant:"tertiary",onClick:v,children:t(V,{family:"secondary",decoration:"underline",children:"Deselect"})}),e(Pe,{variant:"tertiary",onClick:()=>g(!0),children:[t(_i,{}),t(V,{family:"secondary",decoration:"underline",children:"Restart"})]}),e(Pe,{variant:"tertiary",onClick:()=>p(!0),children:[t(Ii,{}),t(V,{family:"secondary",decoration:"underline",color:l.text.error,children:"Uninstrument"})]})]}),t(J,{isOpen:u,name:`${y} sources`,type:G.Source,isLastItem:y===i,onApprove:()=>{const e={};Object.entries(s).forEach(([t,i])=>{e[t]=i.map(e=>({...e,selected:!1}))}),o(e),p(!1),v()},onDeny:()=>p(!1)}),t(Ut,{isOpen:h,title:"Rollout Restart Workloads",description:"Are you sure you want to rollout restart these workloads?",approveButton:{text:"Confirm",variant:de.Warning,onClick:()=>{const e=[];Object.values(s).forEach(t=>{e.push(...t.map(e=>Yt(e)))}),r(e),v()}},denyButton:{text:"Go Back",onClick:()=>g(!1)}})]}):null},pr=p.div`
385
385
  position: relative;
386
386
  width: fit-content;
387
- `,cr=p(O)`
387
+ `,hr=p(F)`
388
388
  gap: 12px;
389
389
  padding: 0 12px;
390
- `,dr=p(F)`
390
+ `,mr=p(O)`
391
391
  gap: 12px;
392
392
  max-height: 400px;
393
393
  overflow-y: auto;
394
- `,ur=p.div`
394
+ `,gr=p.div`
395
395
  position: absolute;
396
396
  bottom: 0;
397
397
  left: 0;
@@ -400,19 +400,19 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
400
400
  border-radius: 0 0 24px 24px;
401
401
  background: ${({theme:e})=>`linear-gradient(to top, ${e.colors.dropdown_bg}, transparent)`};
402
402
  pointer-events: none;
403
- `,pr=p(B)`
403
+ `,yr=p(V)`
404
404
  background-color: ${({theme:e})=>e.colors.orange_soft};
405
405
  color: ${({theme:e})=>e.text.primary};
406
406
  border-radius: 32px;
407
407
  width: fit-content;
408
408
  padding: 2px 8px;
409
- `,hr=()=>{const i=m(),{notifications:n,markAsSeen:o}=Ht(),a=n.filter(({hideFromHistory:e})=>!e),r=a.filter(({seen:e})=>!e),l=r.length,{popupRef:s,popupOpen:c,setPopupOpen:d,popupPosition:u,handlePosition:p}=nt({defaultClientHeight:420,defaultClientwidth:400,onClickOutside:()=>{l&&r.forEach(({id:e})=>o(e))}});return e(sr,{children:[t(I,{onClick:()=>{p(0,0),d(e=>!e)},tooltip:"Notifications",withPing:!!l,pingColor:i.colors.orange_og,children:t(Wi,{size:18})}),e(ot,{ref:s,isOpen:c,right:u.left,maxWidth:"400px",header:e(cr,{children:[t(B,{size:20,children:"Notifications"}),!!l&&e(pr,{size:12,family:"secondary",children:[l," new"]})]}),children:[t(dr,{children:a.length?a.map(e=>t(br,{...e,onClick:()=>d(!1)},`notification-${e.id}`)):t(Oe,{title:"No notifications",subTitle:""})}),t(ur,{})]})]})},mr=p.div`
409
+ `,vr=()=>{const i=m(),{notifications:n,markAsSeen:o}=Ht(),a=n.filter(({hideFromHistory:e})=>!e),r=a.filter(({seen:e})=>!e),l=r.length,{popupRef:s,popupOpen:c,setPopupOpen:d,popupPosition:u,handlePosition:p}=nt({defaultClientHeight:420,defaultClientwidth:400,onClickOutside:()=>{l&&r.forEach(({id:e})=>o(e))}});return e(pr,{children:[t(I,{onClick:()=>{p(0,0),d(e=>!e)},tooltip:"Notifications",withPing:!!l,pingColor:i.colors.orange_og,children:t(Ji,{size:18})}),e(ot,{ref:s,isOpen:c,right:u.left,maxWidth:"400px",header:e(hr,{children:[t(V,{size:20,children:"Notifications"}),!!l&&e(yr,{size:12,family:"secondary",children:[l," new"]})]}),children:[t(mr,{children:a.length?a.map(e=>t(Cr,{...e,onClick:()=>d(!1)},`notification-${e.id}`)):t(Fe,{title:"No notifications",subTitle:""})}),t(gr,{})]})]})},fr=p.div`
410
410
  display: flex;
411
411
  align-items: flex-start;
412
412
  gap: 12px;
413
413
  padding: 16px;
414
414
  border-radius: 16px;
415
- background-color: ${({theme:e})=>e.colors.dropdown_bg_2+L["080"]};
415
+ background-color: ${({theme:e})=>e.colors.dropdown_bg_2+P["080"]};
416
416
  cursor: not-allowed;
417
417
  &.click-enabled {
418
418
  cursor: pointer;
@@ -420,32 +420,55 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
420
420
  background-color: ${({theme:e})=>e.colors.dropdown_bg_2};
421
421
  }
422
422
  }
423
- `,gr=p.div`
424
- background-color: ${({$type:e,theme:t})=>t.text[e]+L["015"]};
423
+ `,br=p.div`
424
+ background-color: ${({$type:e,theme:t})=>t.text[e]+P["015"]};
425
425
  border-radius: 8px;
426
426
  width: 36px;
427
427
  height: 36px;
428
428
  display: flex;
429
429
  align-items: center;
430
430
  justify-content: center;
431
- `,yr=p.div`
431
+ `,xr=p.div`
432
432
  width: 290px;
433
- `,vr=p.div`
433
+ `,Sr=p.div`
434
434
  margin-bottom: 6px;
435
- `,fr=p.div`
435
+ `,$r=p.div`
436
436
  display: flex;
437
437
  align-items: center;
438
438
  gap: 6px;
439
- `,br=({id:n,seen:o,type:a,title:r,message:l,time:s,crdType:c,target:d,onClick:u})=>{const p=m(),{formatTimeAgo:h}=Xt(),{onClickNotification:g}=Zt(),y=!!c&&!!d,v=r?.toLowerCase().includes(ne.Delete.toLowerCase())||!1,f=be(a,p);return e(mr,{className:y?"click-enabled":"",onClick:()=>{y&&(u(),g({id:n,crdType:c,target:d}))},children:[t(gr,{$type:v?de.Error:a,children:t(v?Fi:f,{})}),e(yr,{children:[t(vr,{children:t(B,{size:14,children:l})}),e(fr,{children:[t(B,{size:10,color:p.text.grey,children:h(s)}),!o&&e(i,{children:[t(B,{size:10,children:"·"}),t(B,{size:10,color:p.colors.orange_soft,children:"new"})]})]})]})]},`notification-${n}`)},xr=({theme:e,nodes:t,serviceMap:i})=>{const n=[],o=new Map(i.map(e=>[e.serviceName,e]));return t.forEach(({id:t,data:{id:i,status:a}})=>{const{services:r}=o.get(i)??{services:[]};r.forEach(i=>{const o=`${G.Source}-${i.serviceName}-${Qt.MapItem}`,r=a===de.Error;n.push({id:`${t}-to-${o}`,source:t,target:o,markerEnd:{type:an.ArrowClosed},style:{stroke:r?e?.colors.dark_red:e?.colors.border}})})}),n},$r=(e,t,i)=>{const n=e?.serviceName||t?.otelServiceName||t?.name,o=i?[_i]:t?_e(t):[],{priorotizedStatus:a}=me(t?.conditions||[]);return{id:n,title:n,icons:o.length?o:[Ji],status:a,serviceMapEntry:e}},Sr=e=>"user"===e?.otelServiceName&&!e?.namespace&&!e?.name&&!e?.kind,Cr=new sn,kr={"elk.algorithm":"layered","elk.direction":"DOWN","elk.layered.spacing.nodeNodeBetweenLayers":"100","elk.spacing.nodeNode":"80"},wr=p.div`
439
+ `,Cr=({id:n,seen:o,type:a,title:r,message:l,time:s,crdType:c,target:d,onClick:u})=>{const p=m(),{formatTimeAgo:h}=Xt(),{onClickNotification:g}=Zt(),y=!!c&&!!d,v=r?.toLowerCase().includes(ne.Delete.toLowerCase())||!1,f=be(a,p);return e(fr,{className:y?"click-enabled":"",onClick:()=>{y&&(u(),g({id:n,crdType:c,target:d}))},children:[t(br,{$type:v?de.Error:a,children:t(v?Ii:f,{})}),e(xr,{children:[t(Sr,{children:t(V,{size:14,children:l})}),e($r,{children:[t(V,{size:10,color:p.text.grey,children:h(s)}),!o&&e(i,{children:[t(V,{size:10,children:"·"}),t(V,{size:10,color:p.colors.orange_soft,children:"new"})]})]})]})]},`notification-${n}`)},kr=e=>`${G.Source}-${e}-${Qt.MapItem}`,wr=(e,t,i)=>{const n=e.isVirtual,o=i?[Ui]:n?[Gi]:t?_e(t):[Yi],{priorotizedStatus:a}=n?{priorotizedStatus:void 0}:me(t?.conditions||[]);return{id:e.graphKey,title:e.serviceName,icons:o,isVirtual:n,status:a,aggService:e}},Nr=e=>!(!e||"user"!==e.otelServiceName||e.namespace||e.name||e.kind),Tr=({theme:e,nodes:t,aggregatedServiceMap:i})=>{const n=[],o=new Map(t.map(e=>[e.id,e]));for(const t of i){const i=kr(t.graphKey),a=o.get(i);if(!a)continue;const r=a.data?.status===de.Error;for(const a of t.connections){const l=kr(a.targetGraphKey);o.has(l)&&n.push({id:`${i}-to-${l}`,type:"smoothstep",source:i,target:l,data:{sourceGraphKey:t.graphKey,targetGraphKey:a.targetGraphKey},markerEnd:{type:cn.ArrowClosed},style:{stroke:r?e?.colors.dark_red:e?.colors.border}})}}return n},Dr=e=>{const t=e.lastIndexOf("|");return-1===t?{graphKey:e,detail:""}:{graphKey:e.substring(0,t),detail:e.substring(t+1)}},Er=new pn,Ar=`${G.Source}-user-${Qt.MapItem}`,Or={"elk.algorithm":"layered","elk.direction":"RIGHT","elk.layered.spacing.nodeNodeBetweenLayers":"150","elk.spacing.nodeNode":"120","elk.layered.nodePlacement.strategy":"NETWORK_SIMPLEX","elk.layered.spacing.edgeEdgeBetweenLayers":"30","elk.layered.spacing.edgeNodeBetweenLayers":"40"},Fr=p.div`
440
+ padding: 8px 0;
441
+ `,Ir=p.div`
442
+ display: flex;
443
+ justify-content: space-between;
444
+ align-items: center;
445
+ padding: 4px 0 4px 16px;
446
+ `,Mr=p.button`
447
+ display: flex;
448
+ align-items: center;
449
+ gap: 4px;
450
+ background: none;
451
+ border: none;
452
+ cursor: pointer;
453
+ padding: 0;
454
+ color: ${({theme:e})=>e.text.info};
455
+ font-size: 12px;
456
+ font-family: ${({theme:e})=>e.font_family.primary};
457
+ &:hover {
458
+ text-decoration: underline;
459
+ }
460
+ `,Rr=p.div`
461
+ padding: 4px 0 8px;
462
+ `,Kr=({conn:i,onToggle:n,isExpanded:o})=>{const a=i.details.length>0;return t(Fr,{children:e(F,{$justifyContent:"space-between",$alignItems:"center",children:[t(V,{size:14,weight:500,children:i.targetServiceName}),a&&e(Mr,{onClick:n,children:[t(o?Xi:Zi,{size:12}),o?"hide attributes":`${i.details.length} attribute${i.details.length>1?"s":""}`]})]})})},Pr=({conn:e})=>{const n=m();return t(i,{children:e.details.map(e=>t(Ir,{children:t(V,{size:12,color:n.text.secondary,style:{flex:1},children:e.value})},e.value))})},Lr=({connections:o,isVirtual:a})=>{const[r,l]=n(new Set),s=m();return a?t(V,{size:12,color:s.text.info,children:"This service is not instrumented. It was detected from client-side spans of services that communicate with it."}):o.length?e(i,{children:[t(Rr,{children:t(V,{size:11,color:s.text.info,children:"Connected services"})}),o.map(i=>e("div",{children:[t(Kr,{conn:i,isExpanded:r.has(i.targetGraphKey),onToggle:()=>{return e=i.targetGraphKey,void l(t=>{const i=new Set(t);return i.has(e)?i.delete(e):i.add(e),i});var e}}),r.has(i.targetGraphKey)&&t(Pr,{conn:i}),t(A,{})]},i.targetGraphKey))]}):t(V,{size:12,color:s.text.info,children:"No outgoing connections"})},zr=({conn:n})=>{const o=m();return n?t(i,{children:n.details.length>0?e(i,{children:[t(Rr,{children:t(V,{size:11,color:o.text.info,children:"Attribute breakdown"})}),n.details.map(e=>t(Ir,{children:t(V,{size:12,style:{flex:1},children:e.value})},e.value))]}):t(V,{size:12,color:o.text.info,style:{padding:"8px 0"},children:"No attribute breakdown"})}):t(V,{size:12,color:o.text.info,children:"No data for this connection"})},jr=({drawerState:e,aggregatedData:i,onClose:n})=>{if(!e)return null;const o=new Map(i.map(e=>[e.graphKey,e]));let a="",r="",l=null;if("node"===e.type){const i=o.get(e.graphKey);a=i?.serviceName||e.graphKey,r=i?.isVirtual?"Virtual service (uninstrumented)":"Outgoing connections",l=t(Lr,{connections:i?.connections||[],isVirtual:i?.isVirtual})}else{const i=o.get(e.sourceKey),n=i?.connections.find(t=>t.targetGraphKey===e.targetKey);a=`${i?.serviceName||e.sourceKey} → ${n?.targetServiceName||e.targetKey}`,r="Connection details",l=t(zr,{conn:n})}return t(ei,{isOpen:!0,width:"420px",position:"right",header:{title:a,subTitle:r,onClose:n},children:l})},qr=p.div`
440
463
  width: 100%;
441
464
  height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px)`};
442
465
  position: relative;
443
- `,Dr={namespace:"",name:"",kind:"",otelServiceName:"user",selected:!0,numberOfInstances:0,dataStreamNames:[],containers:[],conditions:[]},Tr=({heightToRemove:e,serviceMap:i})=>{const n=m(),{sources:a}=Y(),[r,s,c]=rn([]),[d,u,p]=ln([]),h=l([]);h.current=r;const y=l(n);return y.current=n,o(()=>{let e=!1;const t=[Dr].concat(a),n=(({sources:e,serviceMap:t})=>{const i=[],n=new Set,o=new Map,a={x:0,y:0};return t.length&&e.length?(t.forEach(t=>{const r=t.serviceName,l=`${G.Source}-${r}-${Qt.MapItem}`;if(n.has(l))return;const s=e.find(e=>r===e.otelServiceName||r===e.name);o.set(r,t),t.services.forEach(e=>o.set(e.serviceName,{serviceName:e.serviceName,services:[]})),n.add(l),i.push({id:l,type:Qt.MapItem,position:a,data:$r(t,s,Sr(s))})}),o.forEach((t,o)=>{const r=`${G.Source}-${o}-${Qt.MapItem}`;if(n.has(r))return;const l=e.find(e=>o===e.otelServiceName||o===e.name);n.add(r),i.push({id:r,type:Qt.MapItem,position:a,data:$r(t,l,Sr(l))})}),e.forEach(e=>{const t=e.otelServiceName||e.name,o=`${G.Source}-${t}-${Qt.MapItem}`;n.has(o)||(n.add(o),i.push({id:o,type:Qt.MapItem,position:a,data:$r(void 0,e,Sr(e))}))})):i.push({id:`${G.Source}-${Qt.NoData}`,type:Qt.NoData,position:a,data:{subTitle:g.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}}),i})({serviceMap:i,sources:t});if(1===n.length&&n[0].id===`${G.Source}-${Qt.NoData}`)return s(n),void u([]);const o=new Map(h.current.map(e=>[e.id,e.position]));if(!n.some(e=>!o.has(e.id)))return s(n.map(e=>({...e,position:o.get(e.id)??e.position}))),void u(xr({theme:y.current,nodes:n,serviceMap:i}));const r=xr({theme:y.current,nodes:n,serviceMap:i});return(async(e,t,i={})=>{const n={id:"root",layoutOptions:{...kr,...i},children:e.map(e=>({id:e.id,width:80,height:80})),edges:t.map(e=>({id:e.id,sources:[e.source],targets:[e.target]}))},o=await Cr.layout(n),a=new Map;return o.children?.forEach(e=>{a.set(e.id,{x:e.x??0,y:e.y??0})}),{nodes:e.map(e=>({...e,position:a.get(e.id)??e.position})),edges:t}})(n,r).then(({nodes:t})=>{if(e)return;const o=new Map(h.current.map(e=>[e.id,e.position]));s(t.map(e=>({...e,position:o.get(e.id)??e.position}))),u(xr({theme:y.current,nodes:n,serviceMap:i}))}),()=>{e=!0}},[i,a]),o(()=>{h.current.length&&u(xr({theme:n,nodes:h.current,serviceMap:i}))},[n,i]),t(wr,{$heightToRemove:e,children:t(ei,{nodes:r,edges:d,onNodesChange:c,onEdgesChange:p,zoomOnScroll:!0})})},Nr=p.div`
466
+ `,Vr={namespace:"",name:"",kind:"",otelServiceName:"user",selected:!0,numberOfInstances:0,dataStreamNames:[],containers:[],conditions:[]},Br=`${G.Source}-`,Hr=`-${Qt.MapItem}`,Wr=.15,_r=({heightToRemove:i,serviceMap:a})=>{const r=m(),{sources:s}=Y(),[c,u,p]=dn([]),[h,y,v]=un([]),[f,b]=n(0),[x,S]=n(null),$=l([]);$.current=c;const C=l(r);C.current=r;const k=l([]),w=l([]),N=d(()=>b(e=>e+1),[]),T=l(""),{activeNodeId:D,setActiveNodeType:E,setActiveNodeId:A}=ti();o(()=>{if(!D)return;const e=(t=D).startsWith(Br)&&t.endsWith(Hr)?t.slice(Br.length,-Hr.length):null;var t;e&&S({type:"node",graphKey:e})},[D]);const O=d((e,t)=>{const{sourceGraphKey:i,targetGraphKey:n}=t.data||{};i&&n&&(E(null),A(null),S({type:"edge",sourceKey:i,targetKey:n}))},[E,A]),F=d(()=>{S(null),E(null),A(null)},[E,A]),I=d((e,t)=>{const i=t.id;y(e=>e.map(e=>e.source===i||e.target===i?{...e,animated:!0,style:{...e.style,strokeWidth:2.5},labelStyle:{...e.labelStyle,opacity:1},labelBgStyle:{...e.labelBgStyle,opacity:1}}:{...e,style:{...e.style,opacity:Wr},labelStyle:{...e.labelStyle,opacity:Wr},labelBgStyle:{...e.labelBgStyle,opacity:Wr}}))},[y]),M=d(()=>{y(w.current)},[y]);return o(()=>{const e=JSON.stringify(a);if(e===T.current)return;T.current=e;let t=!1;const i=(e=>{const t=new Map,i=new Set,n=(e,i,n=!1)=>{let o=t.get(e);return o||(o={serviceName:i,isVirtual:n,connectionMap:new Map},t.set(e,o)),o};for(const t of e){const{graphKey:e}=Dr(t.nodeId),o=n(e,t.serviceName);for(const e of t.services){const{graphKey:t,detail:n}=Dr(e.nodeId);e.isVirtual&&i.add(t);let a=o.connectionMap.get(t);if(a||(a={targetGraphKey:t,targetServiceName:e.serviceName,totalRequests:0,lastDateTime:e.dateTime,details:[]},o.connectionMap.set(t,a)),a.totalRequests+=e.requests,e.dateTime>a.lastDateTime&&(a.lastDateTime=e.dateTime),n){const t=a.details.find(e=>e.value===n);t?(t.requests+=e.requests,e.dateTime>t.dateTime&&(t.dateTime=e.dateTime)):a.details.push({value:n,requests:e.requests,dateTime:e.dateTime})}}}const o=[...t.entries()];for(const[,{connectionMap:e}]of o)for(const[o,a]of e)t.has(o)||n(o,a.targetServiceName,i.has(o));const a=[];for(const[e,{serviceName:i,isVirtual:n,connectionMap:o}]of t){const t=[...o.values()];a.push({graphKey:e,serviceName:i,isVirtual:n,connections:t})}return a})(a);k.current=i;const n=[Vr].concat(s),o=(({sources:e,aggregatedServiceMap:t})=>{const i=[],n={x:0,y:0};if(t.length&&e.length)for(const o of t){const t=kr(o.graphKey),a=e.find(e=>o.serviceName===e.otelServiceName||o.serviceName===e.name);i.push({id:t,type:Qt.MapItem,position:n,data:wr(o,a,Nr(a))})}else i.push({id:`${G.Source}-${Qt.NoData}`,type:Qt.NoData,position:n,data:{subTitle:g.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return i})({aggregatedServiceMap:i,sources:n});if(1===o.length&&o[0].id===`${G.Source}-${Qt.NoData}`)return u(o),y([]),void(w.current=[]);const r=new Map($.current.map(e=>[e.id,e.position]));if(!o.some(e=>!r.has(e.id))){u(o.map(e=>({...e,position:r.get(e.id)??e.position})));const e=Tr({theme:C.current,nodes:o,aggregatedServiceMap:i});return w.current=e,void y(e)}const l=Tr({theme:C.current,nodes:o,aggregatedServiceMap:i});return(async(e,t,i={})=>{const n={id:"root",layoutOptions:{...Or,...i},children:e.map(e=>({id:e.id,width:80,height:80,...e.id===Ar?{layoutOptions:{"elk.layered.layering.layerConstraint":"FIRST","elk.alignment":"CENTER"}}:{}})),edges:t.map(e=>({id:e.id,sources:[e.source],targets:[e.target]}))},o=await Er.layout(n),a=new Map;return o.children?.forEach(e=>{a.set(e.id,{x:e.x??0,y:e.y??0})}),{nodes:e.map(e=>({...e,position:a.get(e.id)??e.position})),edges:t}})(o,l).then(({nodes:e})=>{if(t)return;const n=new Map($.current.map(e=>[e.id,e.position]));u(e.map(e=>({...e,position:n.get(e.id)??e.position})));const a=Tr({theme:C.current,nodes:o,aggregatedServiceMap:i});w.current=a,y(a),N()}),()=>{t=!0}},[a,s]),o(()=>{if(!$.current.length)return;const e=Tr({theme:r,nodes:$.current,aggregatedServiceMap:k.current});w.current=e,y(e)},[r]),e(qr,{$heightToRemove:i,children:[t(ii,{nodes:c,edges:h,onNodesChange:p,onEdgesChange:v,onEdgeClick:O,onNodeMouseEnter:I,onNodeMouseLeave:M,fitViewTrigger:f,zoomOnScroll:!0}),t(jr,{drawerState:x,aggregatedData:k.current,onClose:F})]})},Jr=p.div`
444
467
  width: 100%;
445
468
  padding-bottom: ${({$isOpen:e})=>e?"18px":"0"};
446
469
  border-radius: 16px;
447
- background-color: ${({$selected:e,theme:t})=>e?t.colors.majestic_blue+L["024"]:t.colors.dropdown_bg_2+L["040"]};
448
- `,Er=p.div`
470
+ background-color: ${({$selected:e,theme:t})=>e?t.colors.majestic_blue+P["024"]:t.colors.dropdown_bg_2+P["040"]};
471
+ `,Ur=p.div`
449
472
  display: flex;
450
473
  justify-content: space-between;
451
474
  gap: 12px;
@@ -454,29 +477,29 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
454
477
  border-radius: 16px;
455
478
  cursor: ${({$withClick:e})=>e?"pointer":"unset"};
456
479
  &:hover {
457
- background-color: ${({$withClick:e,$selected:t,theme:i})=>e&&(t?i.colors.majestic_blue+L["040"]:i.colors.dropdown_bg_2+L["080"])};
480
+ background-color: ${({$withClick:e,$selected:t,theme:i})=>e&&(t?i.colors.majestic_blue+P["040"]:i.colors.dropdown_bg_2+P["080"])};
458
481
  transition: background-color 0.3s;
459
482
  }
460
- `,Ar=p(Er)`
483
+ `,Gr=p(Ur)`
461
484
  width: calc(100% - 100px);
462
485
  margin: 0 auto;
463
486
  padding: 8px;
464
- `,Fr=p.div`
487
+ `,Yr=p.div`
465
488
  position: relative;
466
489
  padding-bottom: ${({$addPadding:e})=>e?"16px":"0"};
467
- `,Or=p.div`
490
+ `,Xr=p.div`
468
491
  position: absolute;
469
492
  top: 6px;
470
493
  left: 18px;
471
- `,Ir=p(Fe)`
494
+ `,Zr=p(Oe)`
472
495
  padding-bottom: ${({$addPadding:e})=>e?"16px":"0"};
473
- `,Mr=p.div`
496
+ `,Qr=p.div`
474
497
  width: ${({$width:e})=>`${e||42}px`};
475
498
  display: flex;
476
499
  align-items: center;
477
500
  justify-content: flex-end;
478
501
  text-align: right;
479
- `,Rr=Ne(G.Namespace),Pr=({isModal:i=!1,withInstances:n=!0,loading:o,filteredNamespacesAndSources:a,selectedNamespace:r,onSelectNamespace:l,selectedSources:s,onSelectSource:c,selectedFutureApps:d,onSelectFutureApps:u})=>{const p=m(),{isVm:h}=oe(),{namespacesLoading:y}=Y(),v=Object.entries(a||{});return v?.length?t(qe,{height:i?"calc(100vh - 510px)":"calc(100vh - 310px)",gap:12,noAnimation:!0,elements:v.map(([i,a])=>{const m=s?.[i]||[],v=d?.[i]?.selected||!1,f=m.filter(({selected:e})=>e),b=m.length>0,x=r===i,S=f.length>0&&f.length===a.length,C=f.length>0&&f.length!==a.length,k=a.length>0,w=1===a.length;return l||k?e(Nr,{"data-id":`namespace-${i}`,$selected:S,$isOpen:x,children:[e(Er,{$selected:S,$withClick:!!l,onClick:()=>l?.(i),children:[e(O,{$gap:12,children:[l&&t($,{partiallyChecked:C,value:S,onChange:e=>l(i,e)}),t(Rr,{}),t(B,{children:i})]}),e(O,{$gap:24,children:[!h&&u&&t(T,{title:g.FUTURE_APPS_TITLE,tooltip:g.FUTURE_APPS_DESCRIPTION,initialValue:v,onChange:e=>u(e,i),flipHorizontally:!0}),t(Mr,{children:t(B,{size:10,color:p.text.grey,children:b?`${f.length}/${a.length}`:null})}),l&&t(vt,{extend:x})]})]}),(x||!l)&&(k?e(Fr,{$addPadding:!c,children:[t(Or,{children:t(A,{orientation:"vertical",length:(w?24:34*a.length)+"px"})}),a.map(e=>{const o=f.some(({name:t})=>t===e.name);return t(Lr,{withInstances:n,source:e,namespace:i,isSelected:o,onSelect:c},`source-${e.name}`)})]}):t(Ir,{$addPadding:!c,children:y||o?t(Pe,{}):t(Oe,{title:g.NO_SOURCES_NAMESPACE,subTitle:g.TRY_SEARCH_OR_OTHER_NAMESPACE})}))]},`namespace-${i}`):null})}):t(Fe,{children:y||o?t(Pe,{}):t(Oe,{title:g.NO_SOURCES,subTitle:!h&&l?g.PLEASE_MAKE_SURE_UNIGNORED_NAMESPACES:g.PLEASE_ADD_SOURCE})})},Lr=({withInstances:i,source:n,namespace:o,isSelected:a,onSelect:r})=>{const{tier:l}=oe(),s=l!==Jt.Onprem&&!!n.kind&&ti.has(n.kind);return t(Ar,{"data-id":`source-${n.name}`,$selected:!s&&a,$withClick:!s&&!!r,onClick:()=>!s&&r?.(n),style:s?{opacity:.5,cursor:"not-allowed"}:void 0,children:e(O,{$gap:12,children:[r&&t($,{value:!s&&a,onChange:()=>!s&&r(n,o)}),e(O,{$gap:4,children:[t(B,{children:n.name}),e(B,{opacity:.8,size:10,children:[i?` • ${n.numberOfInstances||0} running instance${1!==n.numberOfInstances?"s":""}`:"",` • ${n.kind}`,s?" • Enterprise only":""]})]})]})})},Kr=p.div`
502
+ `,el=De(G.Namespace),tl=({isModal:i=!1,withInstances:n=!0,loading:o,filteredNamespacesAndSources:a,selectedNamespace:r,onSelectNamespace:l,selectedSources:s,onSelectSource:c,selectedFutureApps:d,onSelectFutureApps:u})=>{const p=m(),{isVm:h}=oe(),{namespacesLoading:y}=Y(),v=Object.entries(a||{});return v?.length?t(qe,{height:i?"calc(100vh - 510px)":"calc(100vh - 310px)",gap:12,noAnimation:!0,elements:v.map(([i,a])=>{const m=s?.[i]||[],v=d?.[i]?.selected||!1,f=m.filter(({selected:e})=>e),b=m.length>0,x=r===i,$=f.length>0&&f.length===a.length,C=f.length>0&&f.length!==a.length,k=a.length>0,w=1===a.length;return l||k?e(Jr,{"data-id":`namespace-${i}`,$selected:$,$isOpen:x,children:[e(Ur,{$selected:$,$withClick:!!l,onClick:()=>l?.(i),children:[e(F,{$gap:12,children:[l&&t(S,{partiallyChecked:C,value:$,onChange:e=>l(i,e)}),t(el,{}),t(V,{children:i})]}),e(F,{$gap:24,children:[!h&&u&&t(T,{title:g.FUTURE_APPS_TITLE,tooltip:g.FUTURE_APPS_DESCRIPTION,initialValue:v,onChange:e=>u(e,i),flipHorizontally:!0}),t(Qr,{children:t(V,{size:10,color:p.text.grey,children:b?`${f.length}/${a.length}`:null})}),l&&t(vt,{extend:x})]})]}),(x||!l)&&(k?e(Yr,{$addPadding:!c,children:[t(Xr,{children:t(A,{orientation:"vertical",length:(w?24:34*a.length)+"px"})}),a.map(e=>{const o=f.some(({name:t})=>t===e.name);return t(il,{withInstances:n,source:e,namespace:i,isSelected:o,onSelect:c},`source-${e.name}`)})]}):t(Zr,{$addPadding:!c,children:y||o?t(Ke,{}):t(Fe,{title:g.NO_SOURCES_NAMESPACE,subTitle:g.TRY_SEARCH_OR_OTHER_NAMESPACE})}))]},`namespace-${i}`):null})}):t(Oe,{children:y||o?t(Ke,{}):t(Fe,{title:g.NO_SOURCES,subTitle:!h&&l?g.PLEASE_MAKE_SURE_UNIGNORED_NAMESPACES:g.PLEASE_ADD_SOURCE})})},il=({withInstances:i,source:n,namespace:o,isSelected:a,onSelect:r})=>{const{tier:l}=oe(),s=l!==Jt.Onprem&&!!n.kind&&ni.has(n.kind);return t(Gr,{"data-id":`source-${n.name}`,$selected:!s&&a,$withClick:!s&&!!r,onClick:()=>!s&&r?.(n),style:s?{opacity:.5,cursor:"not-allowed"}:void 0,children:e(F,{$gap:12,children:[r&&t(S,{value:!s&&a,onChange:()=>!s&&r(n,o)}),e(F,{$gap:4,children:[t(V,{children:n.name}),e(V,{opacity:.8,size:10,children:[i?` • ${n.numberOfInstances||0} running instance${1!==n.numberOfInstances?"s":""}`:"",` • ${n.kind}`,s?" • Enterprise only":""]})]})]})})},nl=p.div`
480
503
  display: flex;
481
504
  flex-direction: column;
482
505
  align-items: center;
@@ -485,46 +508,46 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
485
508
  max-height: calc(100vh - 200px);
486
509
  height: fit-content;
487
510
  overflow-y: scroll;
488
- `,jr=({onEditStream:i,onEditSources:n,onEditDestinations:o,categories:a})=>{const{selectedStreamName:r}=Ye(),{configuredSources:l,configuredDestinations:s,configuredDestinationsUpdateOnly:d}=gt(),u=c(()=>Object.values(l).reduce((e,t)=>e+t.filter(e=>e.selected).length,0),[l]);return t(se,{$isNotModal:!0,children:e(F,{$gap:12,children:[t(K,{title:g.SUMMARY,description:g.STREAM_CONFIRM}),e(Kr,{children:[t(te,{title:g.STREAM_NAME,action:()=>t(ii,{onClick:i}),data:[{title:"",value:r}]}),t(te,{title:g.SELECTED_SOURCES,titleBadge:u,action:()=>t(ii,{onClick:n}),children:t(Pr,{filteredNamespacesAndSources:l,withInstances:!1})}),t(te,{title:g.SELECTED_DESTINATIONS,titleBadge:s.length+d.length,action:()=>t(ii,{onClick:o}),children:t(Oa,{categories:a})})]})]})})};var zr;!function(e){e.Overview="overview",e.InstrumentationRules="InstrumentationRule",e.Sources="Source",e.Actions="Action",e.Destinations="Destination"}(zr||(zr={}));const qr=({onClickId:e,defaultSelectedId:i,extendedNavIcons:o})=>{const{isVm:a}=oe(),[r,l]=n(i||""),s=c(()=>[{id:zr.Overview,icon:Ui,selected:r===zr.Overview,onClick:()=>{l(zr.Overview),e(zr.Overview)},tooltip:"Overview"},...(o||[]).map(e=>({...e,selected:r===e.id,onClick:()=>{l(e.id),e.onClick()}}))],[r]),d=c(()=>{const t=[{id:zr.Sources,icon:Gi,selected:r===zr.Sources,onClick:()=>{l(zr.Sources),e(zr.Sources)},tooltip:"Sources"},{id:zr.Destinations,icon:Yi,selected:r===zr.Destinations,onClick:()=>{l(zr.Destinations),e(zr.Destinations)},tooltip:"Destinations"}];return a||(t.push({id:zr.InstrumentationRules,icon:Xi,selected:r===zr.InstrumentationRules,onClick:()=>{l(zr.InstrumentationRules),e(zr.InstrumentationRules)},tooltip:"Instrumentation Rules"}),t.push({id:zr.Actions,icon:Zi,selected:r===zr.Actions,onClick:()=>{l(zr.Actions),e(zr.Actions)},tooltip:"Actions"})),t},[a,r]);return t(ni,{orientation:"vertical",mainIcons:s,subIcons:d})},Br=({})=>t(I,{onClick:()=>window.open("https://join.slack.com/t/odigos/shared_invite/zt-2wc6gm4j9-EhcVFYrLwHqvcIErO9sVzw","_blank","noopener noreferrer"),tooltip:"Join our Slack community",children:t(Qi,{})}),Vr=(e,t)=>{const{name:i,kind:n,namespace:o}=e,a=[{title:g.KIND,value:n},{title:g.NAME,value:i,tooltip:"Resource name"}];return t||(a.unshift({title:g.NAMESPACE,value:o}),a.push({type:y.Divider}),a.push({type:y.CopyText,value:`kubectl get ${n} ${i} -n ${o}`.toLowerCase()})),a},Hr=p.div`
511
+ `,ol=({onEditStream:i,onEditSources:n,onEditDestinations:o,categories:a})=>{const{selectedStreamName:r}=Ye(),{configuredSources:l,configuredDestinations:s,configuredDestinationsUpdateOnly:d}=gt(),u=c(()=>Object.values(l).reduce((e,t)=>e+t.filter(e=>e.selected).length,0),[l]);return t(se,{$isNotModal:!0,children:e(O,{$gap:12,children:[t(L,{title:g.SUMMARY,description:g.STREAM_CONFIRM}),e(nl,{children:[t(te,{title:g.STREAM_NAME,action:()=>t(oi,{onClick:i}),data:[{title:"",value:r}]}),t(te,{title:g.SELECTED_SOURCES,titleBadge:u,action:()=>t(oi,{onClick:n}),children:t(tl,{filteredNamespacesAndSources:l,withInstances:!1})}),t(te,{title:g.SELECTED_DESTINATIONS,titleBadge:s.length+d.length,action:()=>t(oi,{onClick:o}),children:t(Ka,{categories:a})})]})]})})};var al;!function(e){e.Overview="overview",e.InstrumentationRules="InstrumentationRule",e.Sources="Source",e.Actions="Action",e.Destinations="Destination"}(al||(al={}));const rl=({onClickId:e,defaultSelectedId:i,extendedNavIcons:o})=>{const{isVm:a}=oe(),[r,l]=n(i||""),s=c(()=>[{id:al.Overview,icon:Qi,selected:r===al.Overview,onClick:()=>{l(al.Overview),e(al.Overview)},tooltip:"Overview"},...(o||[]).map(e=>({...e,selected:r===e.id,onClick:()=>{l(e.id),e.onClick()}}))],[r]),d=c(()=>{const t=[{id:al.Sources,icon:en,selected:r===al.Sources,onClick:()=>{l(al.Sources),e(al.Sources)},tooltip:"Sources"},{id:al.Destinations,icon:Gi,selected:r===al.Destinations,onClick:()=>{l(al.Destinations),e(al.Destinations)},tooltip:"Destinations"}];return a||(t.push({id:al.InstrumentationRules,icon:tn,selected:r===al.InstrumentationRules,onClick:()=>{l(al.InstrumentationRules),e(al.InstrumentationRules)},tooltip:"Instrumentation Rules"}),t.push({id:al.Actions,icon:nn,selected:r===al.Actions,onClick:()=>{l(al.Actions),e(al.Actions)},tooltip:"Actions"})),t},[a,r]);return t(ai,{orientation:"vertical",mainIcons:s,subIcons:d})},ll=({})=>t(I,{onClick:()=>window.open("https://join.slack.com/t/odigos/shared_invite/zt-2wc6gm4j9-EhcVFYrLwHqvcIErO9sVzw","_blank","noopener noreferrer"),tooltip:"Join our Slack community",children:t(on,{})}),sl=(e,t)=>{const{name:i,kind:n,namespace:o}=e,a=[{title:g.KIND,value:n},{title:g.NAME,value:i,tooltip:"Resource name"}];return t||(a.unshift({title:g.NAMESPACE,value:o}),a.push({type:y.Divider}),a.push({type:y.CopyText,value:`kubectl get ${n} ${i} -n ${o}`.toLowerCase()})),a},cl=p.div`
489
512
  display: flex;
490
513
  flex-direction: column;
491
514
  gap: 24px;
492
515
  padding: 4px;
493
- `,Wr=({formData:e,handleFormChange:i})=>t(Hr,{children:t(C,{name:"sourceName",title:"Source name",tooltip:"This overrides the default service name that runs in your cluster.",placeholder:"Use a name that overrides the source name",value:e.otelServiceName,onChange:({target:{value:e}})=>i("otelServiceName",e)})}),_r=({workloadOdigosHealthStatus:e})=>{if(!e)return null;const i=oi(e?.status),n=st(e?.reasonEnum),o=e?.message;return t(O,{$alignItems:"center",$justifyContent:"center",children:t(ge,{status:i,title:n,subtitle:o,withBackground:i!==ye.Disabled,withBorder:!0,withIcon:!0,width:"calc(100% - 24px)"})})},Jr=({source:i,fetchSourceDescribe:a,onClickRestartPod:r})=>{const[l,s]=n(!1),[c,d]=n(null);return o(()=>{i&&a({namespace:i.namespace,name:i.name,kind:i.kind}).then(({data:e})=>{e?.describeSource?d(e.describeSource):s(!0)})},[i.namespace,i.name,i.kind]),c||l?t(F,{$gap:12,children:l?t(Fe,{$height:"70vh",children:t(Oe,{subTitle:"Could not fetch describe for this source"})}):c?.pods?.length?c.pods.map(({podName:n,nodeName:o,phase:a,agentInjected:l,runningLatestWorkloadRevision:s,containers:d,manifestYAML:p})=>{const h=a.status!==de.Success||ai(d)?de.Error:de.Success,m=[];return m.push(t(ri,{value:`kubectl get pod ${n.value} -n ${c?.namespace?.value||i.namespace}`.toLowerCase()},"copy-text")),m.push(t(A,{length:"100%",margin:"0"},"divider-1")),m.push(t(li,{title:o.name,tooltip:o.explain||"",value:{status:o.status||void 0,text:o.value}},"describe-row-1")),m.push(t(A,{length:"100%",margin:"0"},"divider-2")),m.push(t(li,{title:a.name,tooltip:a.explain||"",value:{status:a.status||void 0,text:a.value}},"describe-row-2")),m.push(t(A,{length:"100%",margin:"0"},"divider-3")),m.push(t(li,{title:l.name,tooltip:l.explain||"",value:{status:l.status||void 0,text:l.value}},"describe-row-3")),m.push(t(A,{length:"100%",margin:"0"},"divider-4")),s?.name&&(m.push(t(li,{title:s.name,tooltip:s.explain||void 0,value:{status:s.status||void 0,text:s.value}},"describe-row-4")),m.push(t(A,{length:"100%",margin:"0"},"divider-5"))),d.forEach(e=>{m.push(t(si,{...e},`pod-container-${e.containerName.value}`))}),p&&(m.push(t(A,{length:"100%",margin:"0"},"divider-6")),m.push(t(cn,{yaml:p},"yaml-section-card"))),t(te,{title:`Pod: ${n.value}`,withExtend:!0,action:({hovered:o})=>e("div",{style:{position:"relative"},children:[t(ge,{status:h,title:h,withIcon:!0,withBorder:!0},"status"),o&&t(ci,{isOpen:!0,positionRight:"calc(100% + 12px)",actions:r?[{id:di(),label:"Restart",rightIcon:Li,onClick:()=>r(c?.namespace?.value||i.namespace,n.value)}]:[]},"hover-actions")]}),children:u.toArray(m)},`pod-${n.value}`)}):t(Fe,{$height:"70vh",children:t(Oe,{subTitle:"Check if you have any running pods and try again"})})}):t(Fe,{$height:"70vh",children:t(Pe,{})})},Ur=p(O)`
516
+ `,dl=({formData:e,handleFormChange:i})=>t(cl,{children:t(C,{name:"sourceName",title:"Source name",tooltip:"This overrides the default service name that runs in your cluster.",placeholder:"Use a name that overrides the source name",value:e.otelServiceName,onChange:({target:{value:e}})=>i("otelServiceName",e)})}),ul=({workloadOdigosHealthStatus:e})=>{if(!e)return null;const i=ri(e?.status),n=st(e?.reasonEnum),o=e?.message;return t(F,{$alignItems:"center",$justifyContent:"center",children:t(ge,{status:i,title:n,subtitle:o,withBackground:i!==ye.Disabled,withBorder:!0,withIcon:!0,width:"calc(100% - 24px)"})})},pl=({source:i,fetchSourceDescribe:a,onClickRestartPod:r})=>{const[l,s]=n(!1),[c,d]=n(null);return o(()=>{i&&a({namespace:i.namespace,name:i.name,kind:i.kind}).then(({data:e})=>{e?.describeSource?d(e.describeSource):s(!0)})},[i.namespace,i.name,i.kind]),c||l?t(O,{$gap:12,children:l?t(Oe,{$height:"70vh",children:t(Fe,{subTitle:"Could not fetch describe for this source"})}):c?.pods?.length?c.pods.map(({podName:n,nodeName:o,phase:a,agentInjected:l,runningLatestWorkloadRevision:s,containers:d,manifestYAML:p})=>{const h=a.status!==de.Success||li(d)?de.Error:de.Success,m=[];return m.push(t(si,{value:`kubectl get pod ${n.value} -n ${c?.namespace?.value||i.namespace}`.toLowerCase()},"copy-text")),m.push(t(A,{length:"100%",margin:"0"},"divider-1")),m.push(t(ci,{title:o.name,tooltip:o.explain||"",value:{status:o.status||void 0,text:o.value}},"describe-row-1")),m.push(t(A,{length:"100%",margin:"0"},"divider-2")),m.push(t(ci,{title:a.name,tooltip:a.explain||"",value:{status:a.status||void 0,text:a.value}},"describe-row-2")),m.push(t(A,{length:"100%",margin:"0"},"divider-3")),m.push(t(ci,{title:l.name,tooltip:l.explain||"",value:{status:l.status||void 0,text:l.value}},"describe-row-3")),m.push(t(A,{length:"100%",margin:"0"},"divider-4")),s?.name&&(m.push(t(ci,{title:s.name,tooltip:s.explain||void 0,value:{status:s.status||void 0,text:s.value}},"describe-row-4")),m.push(t(A,{length:"100%",margin:"0"},"divider-5"))),d.forEach(e=>{m.push(t(di,{...e},`pod-container-${e.containerName.value}`))}),p&&(m.push(t(A,{length:"100%",margin:"0"},"divider-6")),m.push(t(hn,{yaml:p},"yaml-section-card"))),t(te,{title:`Pod: ${n.value}`,withExtend:!0,action:({hovered:o})=>e("div",{style:{position:"relative"},children:[t(ge,{status:h,title:h,withIcon:!0,withBorder:!0},"status"),o&&t(ui,{isOpen:!0,positionRight:"calc(100% + 12px)",actions:r?[{id:pi(),label:"Restart",rightIcon:zi,onClick:()=>r(c?.namespace?.value||i.namespace,n.value)}]:[]},"hover-actions")]}),children:u.toArray(m)},`pod-${n.value}`)}):t(Oe,{$height:"70vh",children:t(Fe,{subTitle:"Check if you have any running pods and try again"})})}):t(Oe,{$height:"70vh",children:t(Ke,{})})},hl=p(F)`
494
517
  width: 100%;
495
518
  align-items: center;
496
519
  justify-content: space-between;
497
- `,Gr=({source:i,fetchSourceLibraries:r})=>{const l=m(),[s,c]=n(!1),[d,u]=n(null);return o(()=>{i&&r({namespace:i.namespace,name:i.name,kind:i.kind}).then(({data:e})=>{e?.instrumentationInstanceComponents?u(Et(e.instrumentationInstanceComponents).sort((e,t)=>e.name.localeCompare(t.name))):c(!0)})},[i.namespace,i.name,i.kind]),d||s?t(F,{$gap:12,children:s?t(Fe,{$height:"70vh",children:t(Oe,{subTitle:"Could not fetch libraries for this source"})}):d?.length?t(te,{title:"Instrumented Libraries",children:d.map(({name:i,healthy:n,message:o,nonIdentifyingAttributes:r},s)=>e(a,{children:[e(F,{$gap:4,$width:"100%",children:[e(Ur,{$width:"100%",children:[t(B,{size:12,color:l.text.grey,children:i}),e(O,{$gap:4,children:[r.map(({key:e,value:n})=>ui(n)&&pi(n)&&"is_standard_lib"===e?t(ge,{status:de.Default,title:"STANDARD",withBorder:!0},`${i}-${e}`):null),"boolean"==typeof n&&t(ge,{status:n?de.Success:de.Error,title:n?"HEALTHY":"UNHEALTHY",withBorder:!0})]})]}),o&&t(B,{size:10,color:l.text.error,align:"right",children:o})]}),s!==d.length-1&&t(A,{length:"100%",margin:"0"})]},`library-${i}`))}):e(Fe,{$height:"70vh",$gap:12,children:[t(Oe,{title:"No libraries found",subTitle:""}),t(ce,{type:de.Warning,message:"This feature is in early development, and has very limited support"})]})}):t(Fe,{$height:"70vh",children:t(Pe,{})})},Yr="70vh",Xr=(e,t)=>e.serviceName.localeCompare(t.serviceName),Zr=p(B)`
520
+ `,ml=({source:i,fetchSourceLibraries:r})=>{const l=m(),[s,c]=n(!1),[d,u]=n(null);return o(()=>{i&&r({namespace:i.namespace,name:i.name,kind:i.kind}).then(({data:e})=>{e?.instrumentationInstanceComponents?u(Et(e.instrumentationInstanceComponents).sort((e,t)=>e.name.localeCompare(t.name))):c(!0)})},[i.namespace,i.name,i.kind]),d||s?t(O,{$gap:12,children:s?t(Oe,{$height:"70vh",children:t(Fe,{subTitle:"Could not fetch libraries for this source"})}):d?.length?t(te,{title:"Instrumented Libraries",children:d.map(({name:i,healthy:n,message:o,nonIdentifyingAttributes:r},s)=>e(a,{children:[e(O,{$gap:4,$width:"100%",children:[e(hl,{$width:"100%",children:[t(V,{size:12,color:l.text.grey,children:i}),e(F,{$gap:4,children:[r.map(({key:e,value:n})=>hi(n)&&mi(n)&&"is_standard_lib"===e?t(ge,{status:de.Default,title:"STANDARD",withBorder:!0},`${i}-${e}`):null),"boolean"==typeof n&&t(ge,{status:n?de.Success:de.Error,title:n?"HEALTHY":"UNHEALTHY",withBorder:!0})]})]}),o&&t(V,{size:10,color:l.text.error,align:"right",children:o})]}),s!==d.length-1&&t(A,{length:"100%",margin:"0"})]},`library-${i}`))}):e(Oe,{$height:"70vh",$gap:12,children:[t(Fe,{title:"No libraries found",subTitle:""}),t(ce,{type:de.Warning,message:"This feature is in early development, and has very limited support"})]})}):t(Oe,{$height:"70vh",children:t(Ke,{})})},gl="70vh",yl=(e,t)=>e.serviceName.localeCompare(t.serviceName),vl=p(V)`
498
521
  cursor: ${({$clickable:e})=>e?"pointer":"default"};
499
522
  text-decoration: ${({$clickable:e})=>e?"underline":"none"};
500
523
  &:hover {
501
524
  opacity: ${({$clickable:e})=>e?.7:1};
502
525
  }
503
- `,Qr=p(O)`
526
+ `,fl=p(F)`
504
527
  justify-content: flex-end;
505
528
  align-items: center;
506
529
  gap: 6px;
507
530
  cursor: pointer;
508
- `,el=({items:n,emptyMessage:o,keyPrefix:r,findSource:l,onNavigate:s})=>{const c=m();return n.length?t(i,{children:n.map(({serviceName:i},o)=>{const d=!!l(i);return e(a,{children:[t(Zr,{size:13,color:d?c.text.secondary:c.text.grey,$clickable:d,onClick:()=>s(i),children:i}),o!==n.length-1&&t(A,{length:"100%",margin:"0"})]},`${r}-${i}`)})}):t(B,{size:13,color:c.text.grey,children:o})},tl=({source:i,fetchPeerSources:a})=>{const r=m(),{setDrawerType:s,setDrawerEntityId:c}=V(),u=Y(e=>e.sources),[p,h]=n(!1),[g,y]=n(!1),[v,f]=n(null),b=i.otelServiceName||i.name,x=l(a);x.current=a;const $=d(()=>{b&&(y(!0),h(!1),x.current(b).then(({data:e})=>{e?.peerSources?f(e.peerSources):h(!0)}).finally(()=>y(!1)))},[b]);o(()=>{$()},[$]);const S=d(e=>u.find(t=>t.otelServiceName===e||t.name===e),[u]),C=d(e=>{const t=S(e);t&&(s(G.Source),c({namespace:t.namespace,name:t.name,kind:t.kind}))},[S,s,c]);if(!v&&!p&&g)return t(Fe,{$height:Yr,children:t(Pe,{})});if(p)return t(Fe,{$height:Yr,children:t(Oe,{subTitle:"Could not fetch peer sources"})});const k=v?.inbound?[...v.inbound].sort(Xr):[],w=v?.outbound?[...v.outbound].sort(Xr):[];return e(F,{$gap:12,children:[t(te,{title:"Inbound",titleBadge:k.length,description:`Services that send requests to ${b}`,children:t(el,{items:k,emptyMessage:"No inbound connections",keyPrefix:"inbound",findSource:S,onNavigate:C})}),t(te,{title:"Outbound",titleBadge:w.length,description:`Services that ${b} sends requests to`,children:t(el,{items:w,emptyMessage:"No outbound connections",keyPrefix:"outbound",findSource:S,onNavigate:C})}),e(Qr,{onClick:$,children:[t(Li,{size:14}),t(B,{size:12,color:r.text.grey,decoration:"underline",children:"Refresh"})]})]})};var il;!function(e){e.Overview="Overview",e.Pods="Pods",e.Libraries="Libraries",e.PeerSources="Peer Sources"}(il||(il={}));const nl=[mi.Deployment,mi.StatefulSet,mi.DaemonSet,mi.DeploymentConfig,mi.Rollout,mi.StaticPod],ol=[mi.Deployment,mi.StatefulSet,mi.DaemonSet,mi.DeploymentConfig,mi.Rollout,mi.Pod],al=[gi.Python,gi.Go,gi.Java],rl=p.div`
531
+ `,bl=({items:n,emptyMessage:o,keyPrefix:r,findSource:l,onNavigate:s})=>{const c=m();return n.length?t(i,{children:n.map(({serviceName:i},o)=>{const d=!!l(i);return e(a,{children:[t(vl,{size:13,color:d?c.text.secondary:c.text.grey,$clickable:d,onClick:()=>s(i),children:i}),o!==n.length-1&&t(A,{length:"100%",margin:"0"})]},`${r}-${i}`)})}):t(V,{size:13,color:c.text.grey,children:o})},xl=({source:i,fetchPeerSources:a})=>{const r=m(),{setDrawerType:s,setDrawerEntityId:c}=B(),u=Y(e=>e.sources),[p,h]=n(!1),[g,y]=n(!1),[v,f]=n(null),b=i.otelServiceName||i.name,x=l(a);x.current=a;const S=d(()=>{b&&(y(!0),h(!1),x.current(b).then(({data:e})=>{e?.peerSources?f(e.peerSources):h(!0)}).finally(()=>y(!1)))},[b]);o(()=>{S()},[S]);const $=d(e=>u.find(t=>t.otelServiceName===e||t.name===e),[u]),C=d(e=>{const t=$(e);t&&(s(G.Source),c({namespace:t.namespace,name:t.name,kind:t.kind}))},[$,s,c]);if(!v&&!p&&g)return t(Oe,{$height:gl,children:t(Ke,{})});if(p)return t(Oe,{$height:gl,children:t(Fe,{subTitle:"Could not fetch peer sources"})});const k=v?.inbound?[...v.inbound].sort(yl):[],w=v?.outbound?[...v.outbound].sort(yl):[];return e(O,{$gap:12,children:[t(te,{title:"Inbound",titleBadge:k.length,description:`Services that send requests to ${b}`,children:t(bl,{items:k,emptyMessage:"No inbound connections",keyPrefix:"inbound",findSource:$,onNavigate:C})}),t(te,{title:"Outbound",titleBadge:w.length,description:`Services that ${b} sends requests to`,children:t(bl,{items:w,emptyMessage:"No outbound connections",keyPrefix:"outbound",findSource:$,onNavigate:C})}),e(fl,{onClick:S,children:[t(zi,{size:14}),t(V,{size:12,color:r.text.grey,decoration:"underline",children:"Refresh"})]})]})};var Sl;!function(e){e.Overview="Overview",e.Pods="Pods",e.Libraries="Libraries",e.PeerSources="Peer Sources"}(Sl||(Sl={}));const $l=[yi.Deployment,yi.StatefulSet,yi.DaemonSet,yi.DeploymentConfig,yi.Rollout,yi.StaticPod],Cl=[yi.Deployment,yi.StatefulSet,yi.DaemonSet,yi.DeploymentConfig,yi.Rollout,yi.Pod],kl=[vi.Python,vi.Go,vi.Java],wl=p.div`
509
532
  width: 100%;
510
533
  height: 100%;
511
534
  max-height: calc(100vh - 220px);
512
535
  overflow: overlay;
513
536
  overflow-y: auto;
514
- `,ll=p.div`
537
+ `,Nl=p.div`
515
538
  display: flex;
516
539
  flex-direction: column;
517
540
  gap: 12px;
518
- `;var sl;!function(e){e.Workload="Workload",e.Pod="Pod"}(sl||(sl={}));const cl=({persistSources:a,updateSource:r,restartWorkloads:s,fetchSourceById:d,fetchSourceDescribe:u,fetchSourceLibraries:p,fetchPeerSources:h,restartPod:m,recoverFromRollback:y})=>{const{isVm:v}=oe(),{sources:f}=Y(),{selectedStreamName:b}=Ye(),{drawerType:x,drawerEntityId:$}=V(),S=c(()=>Ze(f,b),[f,b]),C=l(null),k=x===G.Source,[w,D]=n(!1),[T,N]=n(!1),[E,A]=n(il.Overview),[F,O]=n(null);o(()=>{k&&$&&d($).then(e=>O(e||null))},[k,$]);const{formData:I,handleFormChange:M,resetFormData:R,loadFormWithDrawerItem:P}=hi(),L=c(()=>{if($)return F&&JSON.stringify(Yt(F))===JSON.stringify(Yt($))?F:S?.find(e=>JSON.stringify(Yt(e))===JSON.stringify(Yt($)))},[$,S,F]);o(()=>{k&&L?P(L):R()},[k,L]);const K=c(()=>{const e=L?.conditions?.find(({type:e})=>"RuntimeDetection"===e);return{description:e?.message,isLoading:e?.status===ye.Loading,containers:L?.containers||[]}},[L]),j=c(()=>!!L?.rollbackOccurred,[L?.rollbackOccurred]),z=c(()=>{const e=[{label:il.Overview,onClick:()=>A(il.Overview),selected:E===il.Overview}];return v||(nl.includes(L?.kind)&&e.push({label:il.Pods,onClick:()=>A(il.Pods),selected:E===il.Pods}),L?.containers?.some(({language:e})=>al.includes(e))&&e.push({label:il.Libraries,onClick:()=>A(il.Libraries),selected:E===il.Libraries}),e.push({label:il.PeerSources,onClick:()=>A(il.PeerSources),selected:E===il.PeerSources})),e},[E,L,v]),q=ol.includes(L?.kind),[H,W]=n({openFor:null,workloadId:void 0,podNamespace:void 0,podName:void 0});return L?e(Mn,{ref:C,onClose:()=>{A(il.Overview),O(null)},title:L.otelServiceName||L.name,titleTooltip:"This attribute is used to identify the name of the service (service.name) that is generating telemetry data.",hideEditTitleFromEdit:!0,icons:vi(L.containers),isEdit:w,isFormDirty:T,onEdit:E===il.Overview?e=>{D("boolean"!=typeof e||e)}:void 0,onSave:async()=>{const e=I.otelServiceName!==L.name?I.otelServiceName:"";M("otelServiceName",e),await r($,{...I,otelServiceName:e}),O(null),N(!1),D(!1)},onDelete:E===il.Overview?async()=>{const{namespace:e}=L;a({[e]:[{...L,selected:!1,currentStreamName:b}]},{}),O(null),N(!1),D(!1),C.current?.closeDrawer()}:void 0,onCancel:()=>{N(!1),D(!1),M("otelServiceName",L.otelServiceName||L.name||"")},isLastItem:1===S.length,tabs:z,headerActionButtons:v?[]:q?[{"data-id":"rollout-restart",variant:"tertiary",onClick:()=>W({openFor:sl.Workload,workloadId:$}),children:e(i,{children:[t(Hi,{}),t(B,{size:14,family:"secondary",decoration:"underline",children:"Restart"})]})}]:[],children:[E===il.Overview?w?t(rl,{children:t(Wr,{formData:I,handleFormChange:(...e)=>{N(!0),M(...e),M("currentStreamName",b)}})}):e(ll,{children:[t(_r,{workloadOdigosHealthStatus:L.workloadOdigosHealthStatus}),j&&t(ce,{type:de.Warning,message:g.ROLLBACK_OCCURRED_MESSAGE,action:{label:g.ROLLBACK_RECOVER,onClick:async()=>{await y($);const e=await d($);e&&O(e)}}}),t(ee,{conditions:L.conditions||[]}),t(te,{title:g.SOURCE_DETAILS,data:L?Vr(L,v):[]}),t(te,{title:v?g.DETECTED_PROCESSES:g.DETECTED_CONTAINERS,titleBadge:K.isLoading?ye.Loading:K.containers.length,description:K.description||(v?g.DETECTED_PROCESSES_DESCRIPTION:g.DETECTED_CONTAINERS_DESCRIPTION),children:K.containers.map(e=>t(yi,{...e,callbackRuntimeOverride:e=>r($,e)},`source-container-${e.containerName}`))}),L.manifestYAML&&t(cn,{title:`${L.kind} YAML`,yaml:L.manifestYAML,defaultOpen:!L.instrumentationConfigYAML}),L.instrumentationConfigYAML&&t(cn,{title:"Instrumentation Config YAML",yaml:L.instrumentationConfigYAML,defaultOpen:!L.manifestYAML})]}):E===il.Pods?t(Jr,{source:L,fetchSourceDescribe:u,onClickRestartPod:q?(e,t)=>W({openFor:sl.Pod,podNamespace:e,podName:t}):void 0}):E===il.PeerSources?t(tl,{source:L,fetchPeerSources:h}):t(Gr,{source:L,fetchSourceLibraries:p}),t(Ut,{isOpen:!!H.openFor,title:`Rollout Restart ${H.openFor}`,description:`Are you sure you want to rollout restart this ${H.openFor?.toLowerCase()}?`,approveButton:{text:"Confirm",variant:de.Warning,onClick:()=>{H.openFor===sl.Workload&&H.workloadId?s([H.workloadId]):H.openFor===sl.Pod&&H.podNamespace&&H.podName&&m(H.podNamespace,H.podName),W({openFor:null})}},denyButton:{text:"Go Back",onClick:()=>{W({openFor:null})}}})]}):null},dl=p.div`
541
+ `;var Tl;!function(e){e.Workload="Workload",e.Pod="Pod"}(Tl||(Tl={}));const Dl=({persistSources:a,updateSource:r,restartWorkloads:s,fetchSourceById:d,fetchSourceDescribe:u,fetchSourceLibraries:p,fetchPeerSources:h,restartPod:m,recoverFromRollback:y})=>{const{isVm:v}=oe(),{sources:f}=Y(),{selectedStreamName:b}=Ye(),{drawerType:x,drawerEntityId:S}=B(),$=c(()=>Ze(f,b),[f,b]),C=l(null),k=x===G.Source,[w,N]=n(!1),[T,D]=n(!1),[E,A]=n(Sl.Overview),[O,F]=n(null);o(()=>{k&&S&&d(S).then(e=>F(e||null))},[k,S]);const{formData:I,handleFormChange:M,resetFormData:R,loadFormWithDrawerItem:K}=gi(),P=c(()=>{if(S)return O&&JSON.stringify(Yt(O))===JSON.stringify(Yt(S))?O:$?.find(e=>JSON.stringify(Yt(e))===JSON.stringify(Yt(S)))},[S,$,O]);o(()=>{k&&P?K(P):R()},[k,P]);const L=c(()=>{const e=P?.conditions?.find(({type:e})=>"RuntimeDetection"===e);return{description:e?.message,isLoading:e?.status===ye.Loading,containers:P?.containers||[]}},[P]),z=c(()=>!!P?.rollbackOccurred,[P?.rollbackOccurred]),j=c(()=>{const e=[{label:Sl.Overview,onClick:()=>A(Sl.Overview),selected:E===Sl.Overview}];return v||($l.includes(P?.kind)&&e.push({label:Sl.Pods,onClick:()=>A(Sl.Pods),selected:E===Sl.Pods}),P?.containers?.some(({language:e})=>kl.includes(e))&&e.push({label:Sl.Libraries,onClick:()=>A(Sl.Libraries),selected:E===Sl.Libraries}),e.push({label:Sl.PeerSources,onClick:()=>A(Sl.PeerSources),selected:E===Sl.PeerSources})),e},[E,P,v]),q=Cl.includes(P?.kind),[H,W]=n({openFor:null,workloadId:void 0,podNamespace:void 0,podName:void 0});return P?e(Ln,{ref:C,onClose:()=>{A(Sl.Overview),F(null)},title:P.otelServiceName||P.name,titleTooltip:"This attribute is used to identify the name of the service (service.name) that is generating telemetry data.",hideEditTitleFromEdit:!0,icons:bi(P.containers),isEdit:w,isFormDirty:T,onEdit:E===Sl.Overview?e=>{N("boolean"!=typeof e||e)}:void 0,onSave:async()=>{const e=I.otelServiceName!==P.name?I.otelServiceName:"";M("otelServiceName",e),await r(S,{...I,otelServiceName:e}),F(null),D(!1),N(!1)},onDelete:E===Sl.Overview?async()=>{const{namespace:e}=P;a({[e]:[{...P,selected:!1,currentStreamName:b}]},{}),F(null),D(!1),N(!1),C.current?.closeDrawer()}:void 0,onCancel:()=>{D(!1),N(!1),M("otelServiceName",P.otelServiceName||P.name||"")},isLastItem:1===$.length,tabs:j,headerActionButtons:v?[]:q?[{"data-id":"rollout-restart",variant:"tertiary",onClick:()=>W({openFor:Tl.Workload,workloadId:S}),children:e(i,{children:[t(_i,{}),t(V,{size:14,family:"secondary",decoration:"underline",children:"Restart"})]})}]:[],children:[E===Sl.Overview?w?t(wl,{children:t(dl,{formData:I,handleFormChange:(...e)=>{D(!0),M(...e),M("currentStreamName",b)}})}):e(Nl,{children:[t(ul,{workloadOdigosHealthStatus:P.workloadOdigosHealthStatus}),z&&t(ce,{type:de.Warning,message:g.ROLLBACK_OCCURRED_MESSAGE,action:{label:g.ROLLBACK_RECOVER,onClick:async()=>{await y(S);const e=await d(S);e&&F(e)}}}),t(ee,{conditions:P.conditions||[]}),t(te,{title:g.SOURCE_DETAILS,data:P?sl(P,v):[]}),t(te,{title:v?g.DETECTED_PROCESSES:g.DETECTED_CONTAINERS,titleBadge:L.isLoading?ye.Loading:L.containers.length,description:L.description||(v?g.DETECTED_PROCESSES_DESCRIPTION:g.DETECTED_CONTAINERS_DESCRIPTION),children:L.containers.map(e=>t(fi,{...e,callbackRuntimeOverride:e=>r(S,e)},`source-container-${e.containerName}`))}),P.manifestYAML&&t(hn,{title:`${P.kind} YAML`,yaml:P.manifestYAML,defaultOpen:!P.instrumentationConfigYAML}),P.instrumentationConfigYAML&&t(hn,{title:"Instrumentation Config YAML",yaml:P.instrumentationConfigYAML,defaultOpen:!P.manifestYAML})]}):E===Sl.Pods?t(pl,{source:P,fetchSourceDescribe:u,onClickRestartPod:q?(e,t)=>W({openFor:Tl.Pod,podNamespace:e,podName:t}):void 0}):E===Sl.PeerSources?t(xl,{source:P,fetchPeerSources:h}):t(ml,{source:P,fetchSourceLibraries:p}),t(Ut,{isOpen:!!H.openFor,title:`Rollout Restart ${H.openFor}`,description:`Are you sure you want to rollout restart this ${H.openFor?.toLowerCase()}?`,approveButton:{text:"Confirm",variant:de.Warning,onClick:()=>{H.openFor===Tl.Workload&&H.workloadId?s([H.workloadId]):H.openFor===Tl.Pod&&H.podNamespace&&H.podName&&m(H.podNamespace,H.podName),W({openFor:null})}},denyButton:{text:"Go Back",onClick:()=>{W({openFor:null})}}})]}):null},El=p.div`
519
542
  max-width: ${({$fullWidth:e})=>e?"unset":"420px"};
520
543
  width: 100%;
521
- `,ul=r(({isModal:i,fetchNamespacesWithWorkloads:n,onClickSummary:o},a)=>{const r=m(),{isVm:l}=oe(),c=fi({fetchNamespacesWithWorkloads:n}),{selectedSources:d,loading:u,selectedAllNamespaces:p,onSelectAllNamespaces:h,getApiSourcesPayload:y,getApiFutureAppsPayload:v,searchText:f,setSearchText:b,searchBy:x,setSearchBy:$,showSelectedOnly:S,setShowSelectedOnly:k,showRunningOnly:w,setShowRunningOnly:D}=c;s(a,()=>({getFormValues:()=>({apps:y(),futureApps:v()})}));const N=Object.values(d).reduce((e,t)=>e+t.filter(e=>e.selected).length,0);return t(se,{$isNotModal:!i,children:e(F,{$gap:12,children:[e(F,{$gap:24,children:[o&&t(ft,{onClick:o}),t(K,{title:g.SELECT_SOURCES,badgeLabel:N,description:g.SELECT_SOURCES_DESCRIPTION}),e(O,{$justifyContent:"space-between",children:[t(dl,{$fullWidth:l,children:t(C,{placeholder:x===G.Source?g.SEARCH_SOURCES:g.SEARCH_NAMESPACES,icon:Ki,value:f,onChange:e=>b(e.target.value.toLowerCase())})}),!l&&t(P,{options:[{label:g.SOURCE,value:G.Source,selectedBgColor:r.text.secondary,selectedTextColor:r.text.primary},{label:g.NAMESPACE,value:G.Namespace,selectedBgColor:r.text.secondary,selectedTextColor:r.text.primary}],selected:x,setSelected:$})]}),e(O,{$gap:36,children:[t(T,{title:g.SELECT_ALL,initialValue:p,onChange:h,disabled:u}),t(T,{title:g.ONLY_SELECTED,initialValue:S,onChange:k}),t(T,{title:g.ONLY_RUNNING_INSTANCES,initialValue:w,onChange:D})]})]}),t(A,{}),t(Pr,{isModal:i,...c})]})})});ul.displayName=ul.name;const pl=({fetchNamespacesWithWorkloads:e,persistSources:i})=>{const{currentModal:n,setCurrentModal:o}=ae(),a=n===G.Source,r=()=>{o("")},s=async()=>{if(c.current){const{apps:e,futureApps:t}=c.current.getFormValues();i(e,t),r()}},c=l(null);return H({key:"Enter",active:a},s),a?t(le,{isOpen:a,onClose:r,header:{title:"Add Source"},actionComponent:t(he,{buttons:[{label:"DONE",variant:"primary",onClick:s}]}),children:t(ul,{ref:c,isModal:!0,fetchNamespacesWithWorkloads:e})}):null},hl=e=>{const t=[{key:"checkbox-and-icon",title:""},{key:"name",title:g.NAME,sortable:!0},{key:"kind",title:"Kind",sortable:!0}];return e||t.push({key:"namespace",title:g.NAMESPACE,sortable:!0}),t.push({key:"containers",title:g.DETECTED_CONTAINERS}),t.push({key:"conditions",title:"Conditions"}),t.push({key:"throughput",title:"Throughput",sortable:!0}),t},ml=({metrics:i,maxHeight:n,maxWidth:o})=>{const a=m(),{isVm:r}=oe(),l=xe(),{selectedStreamName:s}=Ye(),{sources:u,sourcesLoading:p}=Y(),{setDrawerType:h,setDrawerEntityId:y}=V(),{selectedSources:v,setSelectedSources:f}=Ke(),{progress:b}=Je(),x=c(()=>b[Ue.Instrumenting]||b[Ue.Uninstrumenting]?b[Ue.Instrumenting]?.percentage||b[Ue.Uninstrumenting]?.percentage||0:void 0,[b[Ue.Instrumenting],b[Ue.Uninstrumenting]]),S=c(()=>Ze(u,s),[u,s]),C=c(()=>Hn({instrumentationRules:[],sources:et(S,l),actions:[],destinations:[],searchText:l.searchText,selectedCategory:G.Source}).searchResults.find(({category:e})=>e===G.Source)?.entities||[],[S,l]),[k,w]=c(()=>{let e=0;return Object.values(v).forEach(t=>{e+=t.length}),[0!==e,e]},[v]),D=d(e=>{if(e){const e={};C.forEach(t=>{const{namespace:i}=t;e[i]?e[i].push(t):e[i]=[t]}),f(e)}else f({})},[C]),T=d(e=>{const{namespace:t,name:i,kind:n}=e,o={...v};o[t]||(o[t]=[]);const a=o[t].findIndex(e=>e.name===i&&e.kind===n);-1===a?o[t].push(e):o[t].splice(a,1),f(o)},[v]),N=c(()=>C.map(n=>{const o=Yt(n),r=JSON.stringify(o),{hasErrors:l,hasWarnings:s,hasDisableds:c}=me(n.conditions||[]),d=!!v[o.namespace]?.find(e=>e.namespace===o.namespace&&e.name===o.name&&e.kind===o.kind);return{status:l?de.Error:s?de.Warning:void 0,faded:c,onClick:()=>{h(G.Source),y(o)},cells:[{columnKey:"checkbox-and-icon",component:()=>e(O,{$gap:16,children:[t($,{value:d,onChange:()=>T(n)}),t(bi,{icons:_e(n),id:r})]})},{columnKey:"name",value:Ce(n,G.Source,{extended:!0})},{columnKey:"kind",value:n.kind,textColor:a.text.info},{columnKey:"namespace",value:n.namespace,textColor:a.text.info},{columnKey:"throughput",value:Ve(Mt(i,G.Source,o).throughput),textColor:a.text.info},{columnKey:"conditions",component:()=>t(Bn,{conditions:n.conditions||[],id:r})},{columnKey:"containers",component:()=>t("div",{style:{lineHeight:1},children:t(ge,{status:de.Info,title:xi(n.containers),withBorder:!0})})}]}}),[C,v,i,T]),{badge:E,badgeTooltip:A}=c(()=>C.length!==S.length?{badge:`${C.length}/${S.length}`,badgeTooltip:g.FILTERED_COUNT_TOOLTIP}:{badge:S.length,badgeTooltip:void 0},[C,S]);return e(we,{$maxWidth:o,children:[e(De,{children:[t($,{partiallyChecked:k&&C?.length!==w,value:k&&C?.length===w,onChange:D,disabled:!C?.length}),t(Te,{icon:Ne(G.Source),title:g.SOURCES,badge:E,badgeTooltip:A,loading:p||"number"==typeof x})]}),t(Ee,{$maxHeight:n,children:t(Ae,{columns:hl(r),rows:N})}),"number"!=typeof x||N.length?N.length?null:t(Fe,{style:{marginTop:"2rem"},children:t(Oe,{})}):e(Fe,{style:{marginTop:"2rem",gap:"24px"},children:[t(Ie,{width:420}),e(O,{$gap:16,children:[e(B,{color:a.text.info,children:[b[Ue.Instrumenting]?"Instrumenting":"Uninstrumenting"," workloads..."]}),t(Me,{label:`${x}%`})]})]})]})},gl=({expiresAt:t})=>{const i=m(),{formatTimeAgo:n}=Xt(),o=n(t),a=new Date(t).toDateString().split(" ").slice(1).join(" "),r=$i(t,0)?i.text.error:$i(t,6048e5)?i.text.warning:i.text.success;return e(B,{size:14,color:r,children:[o," (",a,")"]})},yl=p.div`
544
+ `,Al=r(({isModal:i,fetchNamespacesWithWorkloads:n,onClickSummary:o},a)=>{const r=m(),{isVm:l}=oe(),c=xi({fetchNamespacesWithWorkloads:n}),{selectedSources:d,loading:u,selectedAllNamespaces:p,onSelectAllNamespaces:h,getApiSourcesPayload:y,getApiFutureAppsPayload:v,searchText:f,setSearchText:b,searchBy:x,setSearchBy:S,showSelectedOnly:$,setShowSelectedOnly:k,showRunningOnly:w,setShowRunningOnly:N}=c;s(a,()=>({getFormValues:()=>({apps:y(),futureApps:v()})}));const D=Object.values(d).reduce((e,t)=>e+t.filter(e=>e.selected).length,0);return t(se,{$isNotModal:!i,children:e(O,{$gap:12,children:[e(O,{$gap:24,children:[o&&t(ft,{onClick:o}),t(L,{title:g.SELECT_SOURCES,badgeLabel:D,description:g.SELECT_SOURCES_DESCRIPTION}),e(F,{$justifyContent:"space-between",children:[t(El,{$fullWidth:l,children:t(C,{placeholder:x===G.Source?g.SEARCH_SOURCES:g.SEARCH_NAMESPACES,icon:ji,value:f,onChange:e=>b(e.target.value.toLowerCase())})}),!l&&t(K,{options:[{label:g.SOURCE,value:G.Source,selectedBgColor:r.text.secondary,selectedTextColor:r.text.primary},{label:g.NAMESPACE,value:G.Namespace,selectedBgColor:r.text.secondary,selectedTextColor:r.text.primary}],selected:x,setSelected:S})]}),e(F,{$gap:36,children:[t(T,{title:g.SELECT_ALL,initialValue:p,onChange:h,disabled:u}),t(T,{title:g.ONLY_SELECTED,initialValue:$,onChange:k}),t(T,{title:g.ONLY_RUNNING_INSTANCES,initialValue:w,onChange:N})]})]}),t(A,{}),t(tl,{isModal:i,...c})]})})});Al.displayName=Al.name;const Ol=({fetchNamespacesWithWorkloads:e,persistSources:i})=>{const{currentModal:n,setCurrentModal:o}=ae(),a=n===G.Source,r=()=>{o("")},s=async()=>{if(c.current){const{apps:e,futureApps:t}=c.current.getFormValues();i(e,t),r()}},c=l(null);return H({key:"Enter",active:a},s),a?t(le,{isOpen:a,onClose:r,header:{title:"Add Source"},actionComponent:t(he,{buttons:[{label:"DONE",variant:"primary",onClick:s}]}),children:t(Al,{ref:c,isModal:!0,fetchNamespacesWithWorkloads:e})}):null},Fl=e=>{const t=[{key:"checkbox-and-icon",title:""},{key:"name",title:g.NAME,sortable:!0},{key:"kind",title:"Kind",sortable:!0}];return e||t.push({key:"namespace",title:g.NAMESPACE,sortable:!0}),t.push({key:"containers",title:g.DETECTED_CONTAINERS}),t.push({key:"conditions",title:"Conditions"}),t.push({key:"throughput",title:"Throughput",sortable:!0}),t},Il=({metrics:i,maxHeight:n,maxWidth:o})=>{const a=m(),{isVm:r}=oe(),l=xe(),{selectedStreamName:s}=Ye(),{sources:u,sourcesLoading:p}=Y(),{setDrawerType:h,setDrawerEntityId:y}=B(),{selectedSources:v,setSelectedSources:f}=Le(),{progress:b}=Je(),x=c(()=>b[Ue.Instrumenting]||b[Ue.Uninstrumenting]?b[Ue.Instrumenting]?.percentage||b[Ue.Uninstrumenting]?.percentage||0:void 0,[b[Ue.Instrumenting],b[Ue.Uninstrumenting]]),$=c(()=>Ze(u,s),[u,s]),C=c(()=>Un({instrumentationRules:[],sources:et($,l),actions:[],destinations:[],searchText:l.searchText,selectedCategory:G.Source}).searchResults.find(({category:e})=>e===G.Source)?.entities||[],[$,l]),[k,w]=c(()=>{let e=0;return Object.values(v).forEach(t=>{e+=t.length}),[0!==e,e]},[v]),N=d(e=>{if(e){const e={};C.forEach(t=>{const{namespace:i}=t;e[i]?e[i].push(t):e[i]=[t]}),f(e)}else f({})},[C]),T=d(e=>{const{namespace:t,name:i,kind:n}=e,o={...v};o[t]||(o[t]=[]);const a=o[t].findIndex(e=>e.name===i&&e.kind===n);-1===a?o[t].push(e):o[t].splice(a,1),f(o)},[v]),D=c(()=>C.map(n=>{const o=Yt(n),r=JSON.stringify(o),{hasErrors:l,hasWarnings:s,hasDisableds:c}=me(n.conditions||[]),d=!!v[o.namespace]?.find(e=>e.namespace===o.namespace&&e.name===o.name&&e.kind===o.kind);return{status:l?de.Error:s?de.Warning:void 0,faded:c,onClick:()=>{h(G.Source),y(o)},cells:[{columnKey:"checkbox-and-icon",component:()=>e(F,{$gap:16,children:[t(S,{value:d,onChange:()=>T(n)}),t(Si,{icons:_e(n),id:r})]})},{columnKey:"name",value:Ce(n,G.Source,{extended:!0})},{columnKey:"kind",value:n.kind,textColor:a.text.info},{columnKey:"namespace",value:n.namespace,textColor:a.text.info},{columnKey:"throughput",value:Be(Mt(i,G.Source,o).throughput),textColor:a.text.info},{columnKey:"conditions",component:()=>t(_n,{conditions:n.conditions||[],id:r})},{columnKey:"containers",component:()=>t("div",{style:{lineHeight:1},children:t(ge,{status:de.Info,title:$i(n.containers),withBorder:!0})})}]}}),[C,v,i,T]),{badge:E,badgeTooltip:A}=c(()=>C.length!==$.length?{badge:`${C.length}/${$.length}`,badgeTooltip:g.FILTERED_COUNT_TOOLTIP}:{badge:$.length,badgeTooltip:void 0},[C,$]);return e(we,{$maxWidth:o,children:[e(Ne,{children:[t(S,{partiallyChecked:k&&C?.length!==w,value:k&&C?.length===w,onChange:N,disabled:!C?.length}),t(Te,{icon:De(G.Source),title:g.SOURCES,badge:E,badgeTooltip:A,loading:p||"number"==typeof x})]}),t(Ee,{$maxHeight:n,children:t(Ae,{columns:Fl(r),rows:D})}),"number"!=typeof x||D.length?D.length?null:t(Oe,{style:{marginTop:"2rem"},children:t(Fe,{})}):e(Oe,{style:{marginTop:"2rem",gap:"24px"},children:[t(Ie,{width:420}),e(F,{$gap:16,children:[e(V,{color:a.text.info,children:[b[Ue.Instrumenting]?"Instrumenting":"Uninstrumenting"," workloads..."]}),t(Me,{label:`${x}%`})]})]})]})},Ml=({expiresAt:t})=>{const i=m(),{formatTimeAgo:n}=Xt(),o=n(t),a=new Date(t).toDateString().split(" ").slice(1).join(" "),r=Ci(t,0)?i.text.error:Ci(t,6048e5)?i.text.warning:i.text.success;return e(V,{size:14,color:r,children:[o," (",a,")"]})},Rl=p.div`
522
545
  position: relative;
523
- `,vl=({token:i,saveToken:o})=>{const{CopyButton:a}=Si(),{formData:r,handleFormChange:l,resetFormData:s}=Ci({token:i}),[c,d]=n(!1),u=()=>{d(!1),s()};return e(O,{$gap:0,children:[t(a,{value:i,size:ki.L}),t(A,{orientation:"vertical",length:"12px"}),e(yl,{children:[t(I,{size:32,onClick:()=>{d(!0)},children:t(Mi,{})}),c&&t(wi,{flipX:!0,clientX:36,isOpen:c,onClose:u,onSave:()=>{o(r.token).then(u)},title:"Enter a new API Token",titleTooltip:"Contact us to generate a new one",children:t(C,{placeholder:"API Token",type:"password",value:r.token,onChange:e=>l("token",e.target.value)})})]})]})},fl=({tokens:e,saveToken:i})=>t(te,{title:"Authorization Tokens",titleBadge:e.length,data:[{type:y.Table,value:{columns:[{key:"icon",title:""},{key:"name",title:"Name"},{key:"expires_at",title:"Expires"},{key:"token",title:"Token"},{key:"actions",title:""}],rows:e.map(({name:e,token:n,expiresAt:o})=>({cells:[{columnKey:"icon",icon:en},{columnKey:"name",value:e},{columnKey:"token",value:`${new Array(15).fill("•").join("")}`},{columnKey:"expires_at",component:()=>t(gl,{expiresAt:o})},{columnKey:"actions",component:()=>t(vl,{token:n,saveToken:i})}]}))}}]}),bl=({fetchDescribeOdigos:a})=>{const[r,l]=n(null);if(o(()=>{a().then(({data:e})=>l(e?.describeOdigos||null))},[]),!r)return t(Fe,{children:t(Pe,{})});const s=e=>e?.name?[t(A,{},`divider-${e.name}`),t(li,{title:e.name,subTitle:e.explain||void 0,value:{status:e.status||(ui(e.value)?pi(e.value)?de.Success:de.Error:de.Default),text:e.value}},`describe-row-${e.name}`)]:[];return e(i,{children:[t(te,{title:"General Information",withExtend:!0,initialExtended:!0,data:[{title:r?.odigosVersion?.name,value:r?.odigosVersion?.value},{title:r?.kubernetesVersion?.name,value:r?.kubernetesVersion?.value},{title:r?.installationMethod?.name,value:r?.installationMethod?.value},{title:r?.tier?.name,value:r?.tier?.value},{title:"# of sources",value:r?.numberOfSources?.toString()},{title:"# of destinations",value:r?.numberOfDestinations?.toString()}]}),t(te,{title:"Cluster Collector",withExtend:!0,children:Object.values(r?.clusterCollector||{}).map(s)}),t(te,{title:"Node Collector",withExtend:!0,children:Object.values(r?.nodeCollector||{}).map(s)})]})},xl=p.div`
546
+ `,Kl=({token:i,saveToken:o})=>{const{CopyButton:a}=ki(),{formData:r,handleFormChange:l,resetFormData:s}=wi({token:i}),[c,d]=n(!1),u=()=>{d(!1),s()};return e(F,{$gap:0,children:[t(a,{value:i,size:Ni.L}),t(A,{orientation:"vertical",length:"12px"}),e(Rl,{children:[t(I,{size:32,onClick:()=>{d(!0)},children:t(Ki,{})}),c&&t(Ti,{flipX:!0,clientX:36,isOpen:c,onClose:u,onSave:()=>{o(r.token).then(u)},title:"Enter a new API Token",titleTooltip:"Contact us to generate a new one",children:t(C,{placeholder:"API Token",type:"password",value:r.token,onChange:e=>l("token",e.target.value)})})]})]})},Pl=({tokens:e,saveToken:i})=>t(te,{title:"Authorization Tokens",titleBadge:e.length,data:[{type:y.Table,value:{columns:[{key:"icon",title:""},{key:"name",title:"Name"},{key:"expires_at",title:"Expires"},{key:"token",title:"Token"},{key:"actions",title:""}],rows:e.map(({name:e,token:n,expiresAt:o})=>({cells:[{columnKey:"icon",icon:an},{columnKey:"name",value:e},{columnKey:"token",value:`${new Array(15).fill("•").join("")}`},{columnKey:"expires_at",component:()=>t(Ml,{expiresAt:o})},{columnKey:"actions",component:()=>t(Kl,{token:n,saveToken:i})}]}))}}]}),Ll=({fetchDescribeOdigos:a})=>{const[r,l]=n(null);if(o(()=>{a().then(({data:e})=>l(e?.describeOdigos||null))},[]),!r)return t(Oe,{children:t(Ke,{})});const s=e=>e?.name?[t(A,{},`divider-${e.name}`),t(ci,{title:e.name,subTitle:e.explain||void 0,value:{status:e.status||(hi(e.value)?mi(e.value)?de.Success:de.Error:de.Default),text:e.value}},`describe-row-${e.name}`)]:[];return e(i,{children:[t(te,{title:"General Information",withExtend:!0,initialExtended:!0,data:[{title:r?.odigosVersion?.name,value:r?.odigosVersion?.value},{title:r?.kubernetesVersion?.name,value:r?.kubernetesVersion?.value},{title:r?.installationMethod?.name,value:r?.installationMethod?.value},{title:r?.tier?.name,value:r?.tier?.value},{title:"# of sources",value:r?.numberOfSources?.toString()},{title:"# of destinations",value:r?.numberOfDestinations?.toString()}]}),t(te,{title:"Cluster Collector",withExtend:!0,children:Object.values(r?.clusterCollector||{}).map(s)}),t(te,{title:"Node Collector",withExtend:!0,children:Object.values(r?.nodeCollector||{}).map(s)})]})},zl=p.div`
524
547
  display: flex;
525
548
  flex-direction: column;
526
549
  gap: 12px;
527
- `,$l="System Overview",Sl=({tokens:o,saveToken:a,fetchDescribeOdigos:r})=>{const[l,s]=n(!1),c=()=>s(e=>!e);return e(i,{children:[t(I,{onClick:c,tooltip:$l,children:t(tn,{size:18})},$l),t(_,{width:"750px",isOpen:l,onClose:c,header:{icons:[tn],title:$l},footer:{isOpen:!1},children:e(xl,{children:[!!o?.length&&t(fl,{tokens:o,saveToken:a}),t(bl,{fetchDescribeOdigos:r})]})})]})},Cl=p.div`
550
+ `,jl="System Overview",ql=({tokens:o,saveToken:a,fetchDescribeOdigos:r})=>{const[l,s]=n(!1),c=()=>s(e=>!e);return e(i,{children:[t(I,{onClick:c,tooltip:jl,children:t(rn,{size:18})},jl),t(_,{width:"750px",isOpen:l,onClose:c,header:{icons:[rn],title:jl},footer:{isOpen:!1},children:e(zl,{children:[!!o?.length&&t(Pl,{tokens:o,saveToken:a}),t(Ll,{fetchDescribeOdigos:r})]})})]})},Vl=p.div`
528
551
  position: fixed;
529
552
  bottom: 12px;
530
553
  left: 12px;
@@ -533,7 +556,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
533
556
  flex-direction: column-reverse;
534
557
  gap: 6px;
535
558
  max-width: 600px;
536
- `,kl=()=>{const{notifications:e,markAsDismissed:i,markAsSeen:n}=Ht(),{onClickNotification:o}=Zt();return t(Cl,{children:e.filter(({dismissed:e})=>!e).map(({id:e,type:a,title:r,message:l,crdType:s,target:c})=>t(ce,{id:e,type:a,title:r,message:l,action:s&&c?{label:"go to details",onClick:()=>o({id:e,crdType:s,target:c},{dismissToast:!0})}:void 0,onClose:()=>(({id:e,asSeen:t})=>{i(e),n(e)})({id:e,asSeen:!0})},`toast-${e}`))})},wl=p.div`
559
+ `,Bl=()=>{const{notifications:e,markAsDismissed:i,markAsSeen:n}=Ht(),{onClickNotification:o}=Zt();return t(Vl,{children:e.filter(({dismissed:e})=>!e).map(({id:e,type:a,title:r,message:l,crdType:s,target:c})=>t(ce,{id:e,type:a,title:r,message:l,action:s&&c?{label:"go to details",onClick:()=>o({id:e,crdType:s,target:c},{dismissToast:!0})}:void 0,onClose:()=>(({id:e,asSeen:t})=>{i(e),n(e)})({id:e,asSeen:!0})},`toast-${e}`))})},Hl=p.div`
537
560
  position: relative;
538
561
  display: flex;
539
562
  align-items: center;
@@ -552,7 +575,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
552
575
  stroke: ${({theme:e})=>e.text.secondary};
553
576
  }
554
577
  }
555
- `,Dl=p.div`
578
+ `,Wl=p.div`
556
579
  position: absolute;
557
580
  top: 2px;
558
581
  left: ${({$darkMode:e})=>e?"2px":"calc(100% - 2px - 24px)"};
@@ -562,50 +585,50 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
562
585
  background-color: ${({theme:e})=>e.colors.border};
563
586
  border-radius: 100%;
564
587
  transition: all 0.3s;
565
- `,Tl=({path:e})=>t("svg",{width:16,height:16,viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",fill:"none",children:t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})}),Nl=()=>{const{darkMode:i,setDarkMode:n}=Di();return e(wl,{onClick:()=>n(!i),children:[t(Tl,{path:"M14 7.977A4.333 4.333 0 1 1 8.023 2H8a6 6 0 1 0 6 6v-.023Z"}),t(Tl,{path:"M8 15.333v-.666m-5.185-1.482.471-.471M.666 8h.667m1.482-5.185.471.47M8 1.334V.667m4.714 2.619.471-.471M14.667 8h.666m-2.619 4.714.471.471M12 8a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z"}),t(Dl,{$darkMode:i})]})},El=e=>{const{spans:t}=e,i=new Map;t.forEach(e=>{i.set(e.spanID,{...e,spans:[]})});const n=[];return t.forEach(e=>{const t=i.get(e.spanID);let o=!1;if(e.references.length){const t=e.references.find(e=>"CHILD_OF"===e.refType);t&&t.spanID&&i.has(t.spanID)||(o=!0)}else o=!0;if(o)n.push(t);else{const n=e.references.find(e=>"CHILD_OF"===e.refType);if(n){const e=i.get(n.spanID);e&&(e.spans=e.spans||[],e.spans.push(t),e.spans=e.spans.sort((e,t)=>e.startTime-t.startTime))}}}),n.sort((e,t)=>e.startTime-t.startTime)},Al=(e,t)=>{const{tags:i}=e,n={},o=[];return i.forEach(e=>{n[e.key]=e.value}),o.push({type:y.Code,value:{language:"json",code:JSON.stringify(n,null,2),pretty:t}}),o},Fl=e=>{const{logs:t}=e,i=[];return t.forEach((e,n)=>{e.fields.forEach(e=>{i.push({title:e.key,value:e.value})}),n!==t.length-1&&i.push({type:y.Divider})}),i},Ol=e=>{const{traceID:t,spanID:i,processID:n,operationName:o,duration:a,startTime:r,warnings:l}=e,s=[];return s.push({type:y.CopyText,title:"Trace ID",value:t}),s.push({type:y.CopyText,title:"Span ID",value:i}),s.push({type:y.Divider}),s.push({title:"Service",value:n}),s.push({title:"Operation",value:o}),s.push({title:"Duration",value:Ti(a)}),s.push({title:"Start time",value:new Date(r/1e3).toLocaleString()}),l.length&&(s.push({type:y.Divider}),s.push({title:"Warnings",titleIcon:nn,value:l})),s},Il=(e,t)=>{const{tags:i}=e,n={},o=[];return i.forEach(e=>{n[e.key]=e.value}),o.push({type:y.Code,value:{language:"json",code:JSON.stringify(n,null,2),pretty:t}}),o},Ml=p.div`
588
+ `,_l=({path:e})=>t("svg",{width:16,height:16,viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",fill:"none",children:t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})}),Jl=()=>{const{darkMode:i,setDarkMode:n}=Di();return e(Hl,{onClick:()=>n(!i),children:[t(_l,{path:"M14 7.977A4.333 4.333 0 1 1 8.023 2H8a6 6 0 1 0 6 6v-.023Z"}),t(_l,{path:"M8 15.333v-.666m-5.185-1.482.471-.471M.666 8h.667m1.482-5.185.471.47M8 1.334V.667m4.714 2.619.471-.471M14.667 8h.666m-2.619 4.714.471.471M12 8a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z"}),t(Wl,{$darkMode:i})]})},Ul=e=>{const{spans:t}=e,i=new Map;t.forEach(e=>{i.set(e.spanID,{...e,spans:[]})});const n=[];return t.forEach(e=>{const t=i.get(e.spanID);let o=!1;if(e.references.length){const t=e.references.find(e=>"CHILD_OF"===e.refType);t&&t.spanID&&i.has(t.spanID)||(o=!0)}else o=!0;if(o)n.push(t);else{const n=e.references.find(e=>"CHILD_OF"===e.refType);if(n){const e=i.get(n.spanID);e&&(e.spans=e.spans||[],e.spans.push(t),e.spans=e.spans.sort((e,t)=>e.startTime-t.startTime))}}}),n.sort((e,t)=>e.startTime-t.startTime)},Gl=(e,t)=>{const{tags:i}=e,n={},o=[];return i.forEach(e=>{n[e.key]=e.value}),o.push({type:y.Code,value:{language:"json",code:JSON.stringify(n,null,2),pretty:t}}),o},Yl=e=>{const{logs:t}=e,i=[];return t.forEach((e,n)=>{e.fields.forEach(e=>{i.push({title:e.key,value:e.value})}),n!==t.length-1&&i.push({type:y.Divider})}),i},Xl=e=>{const{traceID:t,spanID:i,processID:n,operationName:o,duration:a,startTime:r,warnings:l}=e,s=[];return s.push({type:y.CopyText,title:"Trace ID",value:t}),s.push({type:y.CopyText,title:"Span ID",value:i}),s.push({type:y.Divider}),s.push({title:"Service",value:n}),s.push({title:"Operation",value:o}),s.push({title:"Duration",value:Ei(a)}),s.push({title:"Start time",value:new Date(r/1e3).toLocaleString()}),l.length&&(s.push({type:y.Divider}),s.push({title:"Warnings",titleIcon:ln,value:l})),s},Zl=(e,t)=>{const{tags:i}=e,n={},o=[];return i.forEach(e=>{n[e.key]=e.value}),o.push({type:y.Code,value:{language:"json",code:JSON.stringify(n,null,2),pretty:t}}),o},Ql=p.div`
566
589
  display: flex;
567
590
  flex-direction: column;
568
591
  gap: 12px;
569
592
  max-height: 100vh;
570
593
  overflow-y: auto;
571
- `,Rl=({span:i,process:o,onClose:a})=>{const[r,l]=n(!0),[s,c]=n(!0);return t(_,{width:"750px",isOpen:!0,onClose:a,header:{icons:[on],title:i.operationName},footer:{isOpen:!1},children:e(Ml,{children:[t(te,{title:"Details",data:Ol(i)}),i.logs.length>0&&t(te,{title:"Errors",titleBadge:i.logs.length,titleIcon:nn,data:Fl(i)}),t(te,{title:"Tags",data:Al(i,r),action:t(Ni,{isPrettyMode:r,setIsPrettyMode:l})}),o&&t(te,{title:`Process (${o.serviceName})`,data:Il(o,s),action:t(Ni,{isPrettyMode:s,setIsPrettyMode:c})})]})})},Pl=370,Ll=["#33DCA7","#50F6E8","#444AD9","#8B55FF","#FF7CA9"].reverse(),Kl=p.div`
594
+ `,es=({span:i,process:o,onClose:a})=>{const[r,l]=n(!0),[s,c]=n(!0);return t(_,{width:"750px",isOpen:!0,onClose:a,header:{icons:[sn],title:i.operationName},footer:{isOpen:!1},children:e(Ql,{children:[t(te,{title:"Details",data:Xl(i)}),i.logs.length>0&&t(te,{title:"Errors",titleBadge:i.logs.length,titleIcon:ln,data:Yl(i)}),t(te,{title:"Tags",data:Gl(i,r),action:t(Ai,{isPrettyMode:r,setIsPrettyMode:l})}),o&&t(te,{title:`Process (${o.serviceName})`,data:Zl(o,s),action:t(Ai,{isPrettyMode:s,setIsPrettyMode:c})})]})})},ts=370,is=["#33DCA7","#50F6E8","#444AD9","#8B55FF","#FF7CA9"].reverse(),ns=p.div`
572
595
  display: flex;
573
596
  align-items: center;
574
- width: ${Pl}px;
575
- background-color: ${({$withErrors:e,theme:t})=>e?t.colors.error+L["042"]:t.colors.dark_grey};
597
+ width: ${ts}px;
598
+ background-color: ${({$withErrors:e,theme:t})=>e?t.colors.error+P["042"]:t.colors.dark_grey};
576
599
  &:hover {
577
- ${({$withErrors:e,$preventHover:t,theme:i})=>!t&&`background-color: ${e?i.colors.error:i.colors.secondary+L["010"]};`}
600
+ ${({$withErrors:e,$preventHover:t,theme:i})=>!t&&`background-color: ${e?i.colors.error:i.colors.secondary+P["010"]};`}
578
601
  cursor: ${({$preventHover:e})=>e?"default":"pointer"};
579
602
  }
580
- `,jl=p(O)`
603
+ `,os=p(F)`
581
604
  align-items: center;
582
605
  justify-content: space-between;
583
606
  gap: 4px;
584
607
  padding: 12px;
585
608
  padding-left: ${({$depth:e})=>12*e||12}px;
586
- width: calc(${Pl}px - ${({$depth:e})=>12*e}px);
587
- `,zl=p(O)`
609
+ width: calc(${ts}px - ${({$depth:e})=>12*e}px);
610
+ `,as=p(F)`
588
611
  align-items: center;
589
612
  gap: 4px;
590
613
  position: absolute;
591
614
  right: 56px;
592
615
  width: calc(100% - ${434}px);
593
- `,ql=p.div`
616
+ `,rs=p.div`
594
617
  position: absolute;
595
618
  left: ${({$startTime:e,$minStartTime:t,$maxEndTime:i})=>(e-t)/(i-t)*100+"%"};
596
619
  width: ${({$duration:e,$maxDuration:t})=>e/t*100+"%"};
597
620
  height: 12px;
598
621
  border-radius: 32px;
599
- background-color: ${({$indexInMatrix:e})=>Ll[e%Ll.length]};
600
- `,Bl=p(B)`
622
+ background-color: ${({$indexInMatrix:e})=>is[e%is.length]};
623
+ `,ls=p(V)`
601
624
  padding-left: calc(100% + 8px);
602
625
  font-size: 10px;
603
626
  color: ${({theme:e})=>e.text.darker_grey};
604
627
  font-family: ${({theme:e})=>e.font_family.secondary};
605
628
  white-space: nowrap;
606
- `,Vl=({span:i,depth:o,indexInMatrix:a,maxDuration:r,minStartTime:l,maxEndTime:s,withErrors:c,errorTooltip:d,isOpen:u,withToggle:p,onToggleOpen:h,onSelect:g})=>{const y=m(),[v,f]=n(!1),b=Pl-12*o-20-(c?12:0),x=c&&(1===o||i.logs.length>0);return e(Kl,{className:"span-container",$withErrors:c,$preventHover:v,onClick:g,children:[e(jl,{$depth:o,className:"span-left",children:[e(O,{$gap:4,$alignItems:"center",children:[t("div",p?{onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),children:t(I,{onClick:e=>{e.stopPropagation(),h?.()},size:24,children:t(vt,{extend:u??!1})})}:{style:{width:"24px"}}),t(Ai,{maxWidth:b/2,text:i.processID,textSize:14}),t(B,{size:12,color:y.text.darker_grey,children:"•"}),t(Ai,{maxWidth:b/2,text:i.operationName,textSize:12,textColor:y.text.darker_grey})]}),c&&(x?t(fe,{...d,children:t(nn,{fill:y.text.error})}):t("div",{style:{position:"relative"},children:t("div",{style:{position:"absolute",top:"-24px",right:"8px"},children:t(A,{type:de.Error,orientation:"vertical",thickness:1,length:"48px",margin:"0",opacity:.5})})}))]}),t(zl,{className:"span-right",children:t(ql,{$indexInMatrix:a,$duration:i.duration,$maxDuration:r,$startTime:i.startTime,$minStartTime:l,$maxEndTime:s,children:t(Bl,{children:Ti(i.duration)})})})]})},Hl=({spans:i,logs:n,depth:o,indexInMatrix:a,maxDuration:r,minStartTime:l,maxEndTime:s,openSpanIdsState:c,selectedSpanState:d})=>{const u=m();return i.map((i,p)=>{const h=i.spanID,m=c.value.includes(h),g=!!i.spans?.length,y=n.length?n:Ei(i,"spans","logs"),v=y.length>0,f=v?y.length>1?`(${y.length}) errors`:y[0].fields.find(e=>"exception.message"===e.key)?.value:void 0,b=v?y.length>1?void 0:y[0].fields.find(e=>"exception.stacktrace"===e.key)?.value:void 0;return e("div",{style:{borderBottom:1===o?`1px dotted ${u.colors.border}`:"none"},children:[t(Vl,{span:i,depth:o,indexInMatrix:a+p+o,maxDuration:r,minStartTime:l,maxEndTime:s,withErrors:v,errorTooltip:{titleIcon:nn,title:f,text:b},isOpen:m,withToggle:g,onToggleOpen:()=>c.set(e=>e.some(e=>e===h)?e.filter(e=>e!=h):[...e,h,...Ei(i,"spans","spanID")]),onSelect:()=>d.set(e=>e?.spanID===h?null:i)}),m&&g?t(Hl,{spans:i.spans||[],logs:y,depth:o+1,indexInMatrix:a+p,maxDuration:r,minStartTime:l,maxEndTime:s,openSpanIdsState:c,selectedSpanState:d}):null]},`span-${h}`)})},Wl=p.div`
629
+ `,ss=({span:i,depth:o,indexInMatrix:a,maxDuration:r,minStartTime:l,maxEndTime:s,withErrors:c,errorTooltip:d,isOpen:u,withToggle:p,onToggleOpen:h,onSelect:g})=>{const y=m(),[v,f]=n(!1),b=ts-12*o-20-(c?12:0),x=c&&(1===o||i.logs.length>0);return e(ns,{className:"span-container",$withErrors:c,$preventHover:v,onClick:g,children:[e(os,{$depth:o,className:"span-left",children:[e(F,{$gap:4,$alignItems:"center",children:[t("div",p?{onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),children:t(I,{onClick:e=>{e.stopPropagation(),h?.()},size:24,children:t(vt,{extend:u??!1})})}:{style:{width:"24px"}}),t(Fi,{maxWidth:b/2,text:i.processID,textSize:14}),t(V,{size:12,color:y.text.darker_grey,children:"•"}),t(Fi,{maxWidth:b/2,text:i.operationName,textSize:12,textColor:y.text.darker_grey})]}),c&&(x?t(fe,{...d,children:t(ln,{fill:y.text.error})}):t("div",{style:{position:"relative"},children:t("div",{style:{position:"absolute",top:"-24px",right:"8px"},children:t(A,{type:de.Error,orientation:"vertical",thickness:1,length:"48px",margin:"0",opacity:.5})})}))]}),t(as,{className:"span-right",children:t(rs,{$indexInMatrix:a,$duration:i.duration,$maxDuration:r,$startTime:i.startTime,$minStartTime:l,$maxEndTime:s,children:t(ls,{children:Ei(i.duration)})})})]})},cs=({spans:i,logs:n,depth:o,indexInMatrix:a,maxDuration:r,minStartTime:l,maxEndTime:s,openSpanIdsState:c,selectedSpanState:d})=>{const u=m();return i.map((i,p)=>{const h=i.spanID,m=c.value.includes(h),g=!!i.spans?.length,y=n.length?n:Oi(i,"spans","logs"),v=y.length>0,f=v?y.length>1?`(${y.length}) errors`:y[0].fields.find(e=>"exception.message"===e.key)?.value:void 0,b=v?y.length>1?void 0:y[0].fields.find(e=>"exception.stacktrace"===e.key)?.value:void 0;return e("div",{style:{borderBottom:1===o?`1px dotted ${u.colors.border}`:"none"},children:[t(ss,{span:i,depth:o,indexInMatrix:a+p+o,maxDuration:r,minStartTime:l,maxEndTime:s,withErrors:v,errorTooltip:{titleIcon:ln,title:f,text:b},isOpen:m,withToggle:g,onToggleOpen:()=>c.set(e=>e.some(e=>e===h)?e.filter(e=>e!=h):[...e,h,...Oi(i,"spans","spanID")]),onSelect:()=>d.set(e=>e?.spanID===h?null:i)}),m&&g?t(cs,{spans:i.spans||[],logs:y,depth:o+1,indexInMatrix:a+p,maxDuration:r,minStartTime:l,maxEndTime:s,openSpanIdsState:c,selectedSpanState:d}):null]},`span-${h}`)})},ds=p.div`
607
630
  width: 100%;
608
- `,_l=p.div`
631
+ `,us=p.div`
609
632
  max-height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px + 2px)`};
610
633
  overflow: auto;
611
634
 
@@ -615,22 +638,22 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
615
638
  border-radius: 24px;
616
639
  border: 1px solid ${({theme:e})=>e.colors.dropdown_bg_2};
617
640
  position: relative;
618
- `,Jl=p.div`
641
+ `,ps=p.div`
619
642
  padding: 12px 12px 12px 24px;
620
- width: calc(${Pl}px - 36px);
643
+ width: calc(${ts}px - 36px);
621
644
  background-color: ${({theme:e})=>e.colors.dark_grey};
622
- `,Ul=p.div`
645
+ `,hs=p.div`
623
646
  width: 1px;
624
647
  height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px + 2px)`};
625
648
  background: ${({theme:e})=>`linear-gradient(to bottom, ${e.colors.border}, transparent)`};
626
649
 
627
650
  position: absolute;
628
- left: calc(${Pl}px + ((100% - ${Pl}px) / ${5}) * ${({index:e})=>e});
629
- `,Gl=p(B)`
651
+ left: calc(${ts}px + ((100% - ${ts}px) / ${5}) * ${({index:e})=>e});
652
+ `,ms=p(V)`
630
653
  color: ${({theme:e})=>e.text.darker_grey};
631
654
  font-size: 12px;
632
655
  font-family: ${({theme:e})=>e.font_family.secondary};
633
656
  padding-top: 12px;
634
657
  padding-left: 12px;
635
658
  white-space: nowrap;
636
- `,Yl=({heightToRemove:o,traces:a,isLoading:r})=>{const[l,s]=n([]),[d,u]=n(null),p=c(()=>Et(a).sort((e,t)=>t.spans[0].startTime-e.spans[0].startTime).map(e=>({...e,spans:El(e)})),[a]),h=c(()=>p.reduce((e,t)=>Math.max(e,t.spans.reduce((e,t)=>e+t.duration,0)),0),[p]),m=c(()=>{const e=p.find(e=>e.spans.some(e=>e.spanID===d?.spanID)),t=e?.processes.find(e=>e.serviceName===d?.processID);return t},[p,d]);return e(i,{children:[t(Wl,{$heightToRemove:o,children:r?t(Fe,{$height:"50vh",children:t(Pe,{scale:1.5})}):p.length?e(_l,{$heightToRemove:o,children:[t(Jl,{children:t(B,{children:"Service & operation"})}),new Array(5).fill(null).map((e,i)=>t(Ul,{$heightToRemove:o,index:i,children:t(Gl,{children:Ti(h/5*i)})},`${i}-divider`)),p.map((e,i)=>{const{spans:n}=e,o=n.reduce((e,t)=>Math.min(e,t.startTime),Number.MAX_SAFE_INTEGER),a=n.reduce((e,t)=>Math.max(e,t.startTime+t.duration),0);return t(Hl,{spans:n,logs:[],depth:1,indexInMatrix:i,maxDuration:h,minStartTime:o,maxEndTime:a,openSpanIdsState:{value:l,set:s},selectedSpanState:{value:d,set:u}},`recursive-spans-${e.traceID}`)})]}):t(Fe,{$height:"50vh",children:t(Oe,{title:g.NO_TRACES_FOUND,subTitle:g.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC})})}),d&&t(Rl,{span:d,process:m,onClose:()=>u(null)})]})};export{Kn as ActionDrawer,In as ActionForm,zn as ActionModal,_n as ActionTable,Xn as AwaitPipeline,Eo as ConditionDropdown,ko as DataFlow,ta as DataFlowActionsMenu,Wo as DataStreamDrawer,Vo as DataStreamForm,na as DataStreamModal,ia as DataStreamSelectionForm,ga as DestinationDrawer,pa as DestinationForm,Aa as DestinationModal,Ra as DestinationSelectionForm,La as DestinationTable,Ao as ErrorDropdown,Qa as InstrumentationRuleDrawer,Ya as InstrumentationRuleForm,ir as InstrumentationRuleModal,ar as InstrumentationRuleTable,Mo as KindDropdown,Fo as LanguageDropdown,Oo as MonitorDropdown,lr as MultiSourceControl,Io as NamespaceDropdown,zr as NavIconIds,hr as NotificationManager,Mn as OverviewDrawer,Ro as PodsAgentInjectionStatusDropdown,Tr as ServiceMap,jr as SetupSummary,qr as SideNav,Br as SlackInvite,cl as SourceDrawer,Wr as SourceForm,pl as SourceModal,ul as SourceSelectionForm,ml as SourceTable,Sl as SystemOverview,Bn as TableCellConditions,kl as ToastList,Nl as ToggleDarkMode,Yl as TraceView};
659
+ `,gs=({heightToRemove:o,traces:a,isLoading:r})=>{const[l,s]=n([]),[d,u]=n(null),p=c(()=>Et(a).sort((e,t)=>t.spans[0].startTime-e.spans[0].startTime).map(e=>({...e,spans:Ul(e)})),[a]),h=c(()=>p.reduce((e,t)=>Math.max(e,t.spans.reduce((e,t)=>e+t.duration,0)),0),[p]),m=c(()=>{const e=p.find(e=>e.spans.some(e=>e.spanID===d?.spanID)),t=e?.processes.find(e=>e.serviceName===d?.processID);return t},[p,d]);return e(i,{children:[t(ds,{$heightToRemove:o,children:r?t(Oe,{$height:"50vh",children:t(Ke,{scale:1.5})}):p.length?e(us,{$heightToRemove:o,children:[t(ps,{children:t(V,{children:"Service & operation"})}),new Array(5).fill(null).map((e,i)=>t(hs,{$heightToRemove:o,index:i,children:t(ms,{children:Ei(h/5*i)})},`${i}-divider`)),p.map((e,i)=>{const{spans:n}=e,o=n.reduce((e,t)=>Math.min(e,t.startTime),Number.MAX_SAFE_INTEGER),a=n.reduce((e,t)=>Math.max(e,t.startTime+t.duration),0);return t(cs,{spans:n,logs:[],depth:1,indexInMatrix:i,maxDuration:h,minStartTime:o,maxEndTime:a,openSpanIdsState:{value:l,set:s},selectedSpanState:{value:d,set:u}},`recursive-spans-${e.traceID}`)})]}):t(Oe,{$height:"50vh",children:t(Fe,{title:g.NO_TRACES_FOUND,subTitle:g.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC})})}),d&&t(es,{span:d,process:m,onClose:()=>u(null)})]})};export{Vn as ActionDrawer,Pn as ActionForm,Hn as ActionModal,Yn as ActionTable,to as AwaitPipeline,Io as ConditionDropdown,Do as DataFlow,aa as DataFlowActionsMenu,Go as DataStreamDrawer,Jo as DataStreamForm,la as DataStreamModal,ra as DataStreamSelectionForm,ba as DestinationDrawer,ya as DestinationForm,Ma as DestinationModal,za as DestinationSelectionForm,qa as DestinationTable,Mo as ErrorDropdown,nr as InstrumentationRuleDrawer,er as InstrumentationRuleForm,rr as InstrumentationRuleModal,cr as InstrumentationRuleTable,Lo as KindDropdown,Ro as LanguageDropdown,Ko as MonitorDropdown,ur as MultiSourceControl,Po as NamespaceDropdown,al as NavIconIds,vr as NotificationManager,Ln as OverviewDrawer,zo as PodsAgentInjectionStatusDropdown,_r as ServiceMap,ol as SetupSummary,rl as SideNav,ll as SlackInvite,Dl as SourceDrawer,dl as SourceForm,Ol as SourceModal,Al as SourceSelectionForm,Il as SourceTable,ql as SystemOverview,_n as TableCellConditions,Bl as ToastList,Jl as ToggleDarkMode,gs as TraceView};