@odigos/ui-kit 0.0.175 → 0.0.176

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 e,{useState as t,useEffect as a,forwardRef as i,useRef as n,useImperativeHandle as o,useMemo as l,Fragment as r,useCallback as s,Children as c}from"react";import d,{css as u,useTheme as p}from"styled-components";import{a2 as m,a3 as h,a4 as g,a5 as y,a6 as v,a7 as b,a8 as f,a9 as x,aa as S,ab as $,ac as k,ad as C,ae as w,af as D,ag as T,ah as N,ai as E,J as O,aj as A,ak as F,al as I,am as M,an as R,ao as L,ap as P,aq as j,ar as K,as as V,at as q,E as H,au as z,av as B,aw as W,ax as _,ay as J,az as U,aA as G,aB as Y,F as X,aC as Z,aD as Q,aE as ee,aF as te,aG as ae,S as ie,aH as ne,aI as oe,aJ as le,aK as re,aL as se,a as ce,aM as de,c as ue,aN as pe,aO as me,aP as he,aQ as ge,aR as ye,aS as ve,aT as be,aU as fe,aV as xe,aW as Se,aX as $e,aY as ke,aZ as Ce,j as we,N as De,a_ as Te,a$ as Ne,b0 as Ee,b1 as Oe,r as Ae,b2 as Fe,b3 as Ie,b4 as Me,b5 as Re,b6 as Le,b7 as Pe,b8 as je,b9 as Ke,ba as Ve,g as qe,P as He,bb as ze,bc as Be,u as We,bd as _e,be as Je,bf as Ue,bg as Ge,bh as Ye,bi as Xe,bj as Ze,bk as Qe,bl as et,bm as tt,bn as at,bo as it,bp as nt,bq as ot,br as lt,bs as rt,bt as st,bu as ct,bv as dt,D as ut,bw as pt,bx as mt,by as ht,bz as gt,bA as yt,bB as vt,bC as bt,bD as ft,bE as xt,bF as St,bG as $t,bH as kt,bI as Ct,h as wt,bJ as Dt,bK as Tt,bL as Nt,bM as Et,bN as Ot,bO as At,bP as Ft,bQ as It,bR as Mt,bS as Rt,bT as Lt,bU as Pt,bV as jt,bW as Kt,bX as Vt,$ as qt,bY as Ht,bZ as zt,s as Bt,b_ as Wt,b$ as _t,c0 as Jt,c1 as Ut,c2 as Gt,c3 as Yt,c4 as Xt,c5 as Zt,c6 as Qt,c7 as ea,c8 as ta,Y as aa,c9 as ia,t as na,ca as oa,cb as la,cc as ra,cd as sa,ce as ca,cf as da,cg as ua,ch as pa,ci as ma,cj as ha,ck as ga,q as ya,cl as va,cm as ba,cn as fa,co as xa,cp as Sa,cq as $a,cr as ka}from"./chunks/ui-components-368e8b78.js";import{VSquareIcon as Ca,XSquareIcon as wa,EditIcon as Da,TrashIcon as Ta,OdigosLogoText as Na,PlusIcon as Ea,RefreshIcon as Oa,SearchIcon as Aa,FilterIcon as Fa,DataStreamIcon as Ia,VIcon as Ma,OdigosLogo as Ra,ArrowIcon as La,RefreshLeftArrowIcon as Pa,NotificationIcon as ja,UserIcon as Ka,ImageErrorIcon as Va,OverviewIcon as qa,InstrumentationRuleIcon as Ha,ActionIcon as za,SourceIcon as Ba,DestinationIcon as Wa,SlackLogo as _a,KeyIcon as Ja,TerminalIcon as Ua,ExclamationTriangleIcon as Ga,TraceViewIcon as Ya}from"./icons.js";import{MarkerType as Xa,useNodesState as Za,useEdgesState as Qa,applyNodeChanges as ei}from"@xyflow/react";import"zustand";import"javascript-time-ago";import"./chunks/vendor-0965fadc.js";import"react-dom";import"react-error-boundary";import"lottie-react";import"prism-react-renderer";const ti=e=>{const{type:t,name:a,notes:i,signals:n,disabled:o,fields:{collectContainerAttributes:l,collectReplicaSetAttributes:r,collectWorkloadId:s,collectClusterId:c,labelsAttributes:d,annotationsAttributes:u,clusterAttributes:p,overwriteExistingValues:v,attributeNamesToDelete:b,renames:f,piiCategories:x,fallbackSamplingRatio:S,samplingPercentage:$,endpointsFilters:k,servicesNameFilters:C,attributeFilters:w}}=e,D=[{title:m.TYPE,value:t},{type:h.ActiveStatus,title:m.STATUS,value:String(!o)},{type:h.Monitors,title:m.SIGNALS_FOR_PROCESSING,value:n?.map(e=>e.toLowerCase()).join(", ")||""},{title:m.NAME,value:a||""},{title:m.NOTES,value:i||""},{type:h.Divider}];if(t===g.K8sAttributes&&(D.push({title:"Collect Container Attributes",value:String(l)}),D.push({title:"Collect ReplicaSet Attributes",value:String(r)}),D.push({title:"Collect Workload ID",value:String(s)}),D.push({title:"Collect Cluster ID",value:String(c)}),d?.length&&D.push({type:h.Divider}),d?.forEach(({labelKey:e,attributeKey:t,from:a,fromSources:i},n)=>{let o="";o+=`Label Key: ${e}\n`,o+=`Attribute Key: ${t}\n`,o+=`From: ${i?.length?i.join(", "):a||y.Pod}\n`,D.push({title:"Label"+(d.length>1?` #${n+1}`:""),value:o})}),u?.length&&D.push({type:h.Divider}),u?.forEach(({annotationKey:e,attributeKey:t,from:a,fromSources:i},n)=>{let o="";o+=`Annotation Key: ${e}\n`,o+=`Attribute Key: ${t}\n`,o+=`From: ${i?.length?i.join(", "):a||y.Pod}\n`,D.push({title:"Annotation"+(u.length>1?` #${n+1}`:""),value:o})})),t===g.AddClusterInfo){D.push({title:"Overwrite Existing Values",value:String(v||!1)});let e="";p?.forEach(({attributeName:t,attributeStringValue:a},i)=>{e+=`${t}: ${a}`,i<p.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===g.DeleteAttributes){let e="";b?.forEach((t,a)=>{e+=t,a<b.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===g.RenameAttributes){let e="";const t=Object.entries(f||{});t.forEach(([a,i],n)=>{e+=`${a}: ${i}`,n<t.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===g.PiiMasking){let e="";x?.forEach((t,a)=>{e+=t,a<x.length-1&&(e+=", ")}),D.push({title:"Categories",value:e})}return t===g.ErrorSampler&&D.push({title:"Sampling Ratio",value:String(S)}),t===g.ProbabilisticSampler&&D.push({title:"Sampling Percentage",value:String($)}),t===g.LatencySampler&&k?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:a,fallbackSamplingRatio:i},n)=>{let o="";o+=`Service Name: ${e}\n`,o+=`HTTP Route: ${t}\n`,o+=`Min. Latency: ${a}\n`,o+=`Fallback Sampling Ratio: ${i}`,D.push({title:"Endpoint"+(k.length>1?` #${n+1}`:""),value:o})}),t===g.ServiceNameSampler&&C?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:a},i)=>{let n="";n+=`Service Name: ${e}\n`,n+=`Sampling Ratio: ${t}\n`,n+=`Fallback Sampling Ratio: ${a}`,D.push({title:"Filter"+(C.length>1?` #${i+1}`:""),value:n})}),t===g.SpanAttributeSampler&&w?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:a,condition:i},n)=>{let o="";o+=`Service Name: ${e}\n`,o+=`Attribute Key: ${t}\n`,o+=`Fallback Sampling Ratio: ${a}\n`;const l=Object.keys(i)[0];o+=`Condition: ${l}\n`,o+=`Operation: ${i[l]?.operation}\n`,o+=`Expected Value: ${i[l]?.expectedValue}`,"jsonCondition"===l&&(o+=`\nJSON Path: ${i[l].jsonPath}`),D.push({title:"Filter"+(w.length>1?` #${n+1}`:""),value:o})}),D},ai=x.PiiCategories,ii=d.div`
1
+ import e,{useState as t,useEffect as a,forwardRef as i,useRef as n,useImperativeHandle as o,useMemo as l,Fragment as r,useCallback as s,Children as c}from"react";import d,{css as u,useTheme as p}from"styled-components";import{a2 as m,a3 as h,a4 as g,a5 as y,a6 as v,a7 as b,a8 as f,a9 as x,aa as S,ab as $,ac as k,ad as C,ae as w,af as D,ag as T,ah as N,ai as E,J as O,aj as A,ak as F,al as I,am as M,an as R,ao as L,ap as P,aq as j,ar as K,as as q,at as H,E as z,au as V,av as B,aw as W,ax as _,ay as J,az as U,aA as G,aB as Y,F as X,aC as Z,aD as Q,aE as ee,aF as te,aG as ae,S as ie,aH as ne,aI as oe,aJ as le,aK as re,aL as se,a as ce,aM as de,c as ue,aN as pe,aO as me,aP as he,aQ as ge,aR as ye,aS as ve,aT as be,aU as fe,aV as xe,aW as Se,aX as $e,aY as ke,aZ as Ce,j as we,N as De,a_ as Te,a$ as Ne,b0 as Ee,b1 as Oe,r as Ae,b2 as Fe,b3 as Ie,$ as Me,b4 as Re,b5 as Le,b6 as Pe,b7 as je,b8 as Ke,b9 as qe,ba as He,g as ze,P as Ve,bb as Be,u as We,bc as _e,bd as Je,be as Ue,bf as Ge,bg as Ye,bh as Xe,bi as Ze,bj as Qe,bk as et,bl as tt,bm as at,bn as it,bo as nt,bp as ot,bq as lt,br as rt,bs as st,bt as ct,bu as dt,D as ut,bv as pt,bw as mt,bx as ht,by as gt,bz as yt,bA as vt,bB as bt,bC as ft,bD as xt,bE as St,bF as $t,bG as kt,bH as Ct,h as wt,bI as Dt,bJ as Tt,bK as Nt,bL as Et,bM as Ot,bN as At,bO as Ft,bP as It,bQ as Mt,bR as Rt,bS as Lt,bT as Pt,bU as jt,bV as Kt,bW as qt,bX as Ht,bY as zt,s as Vt,bZ as Bt,b_ as Wt,b$ as _t,c0 as Jt,c1 as Ut,c2 as Gt,c3 as Yt,c4 as Xt,c5 as Zt,c6 as Qt,c7 as ea,Y as ta,c8 as aa,t as ia,c9 as na,ca as oa,cb as la,cc as ra,cd as sa,ce as ca,cf as da,cg as ua,ch as pa,ci as ma,cj as ha,q as ga,ck as ya,cl as va,cm as ba,cn as fa,co as xa,cp as Sa,cq as $a}from"./chunks/ui-components-849a6a02.js";import{VSquareIcon as ka,XSquareIcon as Ca,EditIcon as wa,TrashIcon as Da,OdigosLogoText as Ta,PlusIcon as Na,RefreshIcon as Ea,SearchIcon as Oa,FilterIcon as Aa,DataStreamIcon as Fa,VIcon as Ia,OdigosLogo as Ma,ArrowIcon as Ra,RefreshLeftArrowIcon as La,NotificationIcon as Pa,UserIcon as ja,ImageErrorIcon as Ka,OverviewIcon as qa,InstrumentationRuleIcon as Ha,ActionIcon as za,SourceIcon as Va,DestinationIcon as Ba,SlackLogo as Wa,KeyIcon as _a,TerminalIcon as Ja,ExclamationTriangleIcon as Ua,TraceViewIcon as Ga}from"./icons.js";import{MarkerType as Ya,useNodesState as Xa,useEdgesState as Za,applyNodeChanges as Qa}from"@xyflow/react";import"zustand";import"javascript-time-ago";import"./chunks/vendor-0965fadc.js";import"react-dom";import"react-error-boundary";import"lottie-react";import"prism-react-renderer";const ei=e=>{const{type:t,name:a,notes:i,signals:n,disabled:o,fields:{collectContainerAttributes:l,collectReplicaSetAttributes:r,collectWorkloadId:s,collectClusterId:c,labelsAttributes:d,annotationsAttributes:u,clusterAttributes:p,overwriteExistingValues:v,attributeNamesToDelete:b,renames:f,piiCategories:x,fallbackSamplingRatio:S,samplingPercentage:$,endpointsFilters:k,servicesNameFilters:C,attributeFilters:w}}=e,D=[{title:m.TYPE,value:t},{type:h.ActiveStatus,title:m.STATUS,value:String(!o)},{type:h.Monitors,title:m.SIGNALS_FOR_PROCESSING,value:n?.map(e=>e.toLowerCase()).join(", ")||""},{title:m.NAME,value:a||""},{title:m.NOTES,value:i||""},{type:h.Divider}];if(t===g.K8sAttributes&&(D.push({title:"Collect Container Attributes",value:String(l)}),D.push({title:"Collect ReplicaSet Attributes",value:String(r)}),D.push({title:"Collect Workload ID",value:String(s)}),D.push({title:"Collect Cluster ID",value:String(c)}),d?.length&&D.push({type:h.Divider}),d?.forEach(({labelKey:e,attributeKey:t,from:a,fromSources:i},n)=>{let o="";o+=`Label Key: ${e}\n`,o+=`Attribute Key: ${t}\n`,o+=`From: ${i?.length?i.join(", "):a||y.Pod}\n`,D.push({title:"Label"+(d.length>1?` #${n+1}`:""),value:o})}),u?.length&&D.push({type:h.Divider}),u?.forEach(({annotationKey:e,attributeKey:t,from:a,fromSources:i},n)=>{let o="";o+=`Annotation Key: ${e}\n`,o+=`Attribute Key: ${t}\n`,o+=`From: ${i?.length?i.join(", "):a||y.Pod}\n`,D.push({title:"Annotation"+(u.length>1?` #${n+1}`:""),value:o})})),t===g.AddClusterInfo){D.push({title:"Overwrite Existing Values",value:String(v||!1)});let e="";p?.forEach(({attributeName:t,attributeStringValue:a},i)=>{e+=`${t}: ${a}`,i<p.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===g.DeleteAttributes){let e="";b?.forEach((t,a)=>{e+=t,a<b.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===g.RenameAttributes){let e="";const t=Object.entries(f||{});t.forEach(([a,i],n)=>{e+=`${a}: ${i}`,n<t.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===g.PiiMasking){let e="";x?.forEach((t,a)=>{e+=t,a<x.length-1&&(e+=", ")}),D.push({title:"Categories",value:e})}return t===g.ErrorSampler&&D.push({title:"Sampling Ratio",value:String(S)}),t===g.ProbabilisticSampler&&D.push({title:"Sampling Percentage",value:String($)}),t===g.LatencySampler&&k?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:a,fallbackSamplingRatio:i},n)=>{let o="";o+=`Service Name: ${e}\n`,o+=`HTTP Route: ${t}\n`,o+=`Min. Latency: ${a}\n`,o+=`Fallback Sampling Ratio: ${i}`,D.push({title:"Endpoint"+(k.length>1?` #${n+1}`:""),value:o})}),t===g.ServiceNameSampler&&C?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:a},i)=>{let n="";n+=`Service Name: ${e}\n`,n+=`Sampling Ratio: ${t}\n`,n+=`Fallback Sampling Ratio: ${a}`,D.push({title:"Filter"+(C.length>1?` #${i+1}`:""),value:n})}),t===g.SpanAttributeSampler&&w?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:a,condition:i},n)=>{let o="";o+=`Service Name: ${e}\n`,o+=`Attribute Key: ${t}\n`,o+=`Fallback Sampling Ratio: ${a}\n`;const l=Object.keys(i)[0];o+=`Condition: ${l}\n`,o+=`Operation: ${i[l]?.operation}\n`,o+=`Expected Value: ${i[l]?.expectedValue}`,"jsonCondition"===l&&(o+=`\nJSON Path: ${i[l].jsonPath}`),D.push({title:"Filter"+(w.length>1?` #${n+1}`:""),value:o})}),D},ti=x.PiiCategories,ai=d.div`
2
2
  display: flex;
3
3
  flex-direction: row;
4
4
  gap: 32px;
@@ -7,45 +7,45 @@ import e,{useState as t,useEffect as a,forwardRef as i,useRef as n,useImperative
7
7
  border-radius: 32px;
8
8
  padding: 8px;
9
9
  `}
10
- `,ni=[{id:"CREDIT_CARD",label:"Credit Card"}],oi=x.FallbackSamplingRatio,li=[{value:y.Pod,id:y.Pod},{value:y.Namespace,id:y.Namespace},{value:y.Node,id:y.Node}],ri=[{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:li,required:!1,tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones."}],si=[{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:li,required:!1,tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones."}],ci=x.EndpointsFilters,di=[{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:$.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:$.Number}],ui=x.AttributeNamesToDelete,pi=x.Renames,mi=x.ServicesNameFilters,hi=[{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:$.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:$.Number}],gi=x.SamplingPercentage,yi=x.AttributeFilters,vi=[{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:$.Number},{title:"Condition",keyName:"condition",tooltip:"An object representing the filters for span attributes filters.",required:!0,componentType:N.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:N.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}],bi={[g.K8sAttributes]:({value:t,setValue:i,formErrors:n})=>(a(()=>{t[x.CollectContainerAttributes]||t[x.CollectReplicaSetAttributes]||t[x.CollectWorkloadId]||t[x.CollectClusterId]||t[x.LabelsAttributes]?.length||t[x.AnnotationsAttributes]?.length||(i(x.CollectContainerAttributes,!0),i(x.CollectReplicaSetAttributes,!0),i(x.CollectWorkloadId,!0),i(x.CollectClusterId,!0),i(x.LabelsAttributes,[]),i(x.AnnotationsAttributes,[]))},[]),e.createElement(e.Fragment,null,e.createElement(b,{title:"Collect Container Attributes",value:t[x.CollectContainerAttributes]||!1,onChange:e=>i(x.CollectContainerAttributes,e),errorMessage:n[x.CollectContainerAttributes]}),e.createElement(b,{title:"Collect ReplicaSet Attributes",value:t[x.CollectReplicaSetAttributes]||!1,onChange:e=>i(x.CollectReplicaSetAttributes,e),errorMessage:n[x.CollectReplicaSetAttributes]}),e.createElement(b,{title:"Collect Workload ID",value:t[x.CollectWorkloadId]||!1,onChange:e=>i(x.CollectWorkloadId,e),errorMessage:n[x.CollectWorkloadId]}),e.createElement(b,{title:"Collect Cluster ID",value:t[x.CollectClusterId]||!1,onChange:e=>i(x.CollectClusterId,e),errorMessage:n[x.CollectClusterId]}),e.createElement(C,{columns:ri,value:t[x.LabelsAttributes]||[],onChange:e=>i(x.LabelsAttributes,e),errorMessage:n[x.LabelsAttributes]}),e.createElement(C,{columns:si,value:t[x.AnnotationsAttributes]||[],onChange:e=>i(x.AnnotationsAttributes,e),errorMessage:n[x.AnnotationsAttributes]}))),[g.AddClusterInfo]:({value:t,setValue:a,formErrors:i})=>e.createElement(e.Fragment,null,e.createElement(w,{title:"Overwrite Existing Values",tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",initialValue:t[x.OverwriteExistingValues]||!1,onChange:e=>a(x.OverwriteExistingValues,e)}),e.createElement(D,{title:"Resource Attributes",value:t[x.ClusterAttributes]?.map(e=>({key:e.attributeName,value:e.attributeStringValue}))||[],onChange:e=>a(x.ClusterAttributes,e.map(e=>({attributeName:e.key,attributeStringValue:e.value}))),required:!0,errorMessage:i[x.ClusterAttributes]})),[g.DeleteAttributes]:({value:t,setValue:a,formErrors:i})=>{const n=i[ui],o=t[ui]||[];return e.createElement(T,{title:"Attributes to delete",value:o,onChange:e=>a(ui,e),required:!0,errorMessage:n})},[g.RenameAttributes]:({value:t,setValue:a,formErrors:i})=>{const n=i[pi],o=Object.entries(t[pi]||{}).map(([e,t])=>({key:e,value:t}));return e.createElement(D,{title:"Attributes to rename",value:o,onChange:e=>{const t={};e.forEach(e=>t[e.key]=e.value),a(pi,t)},required:!0,errorMessage:n})},[g.PiiMasking]:({value:i,setValue:n,formErrors:o})=>{const l=o[ai],r=i[ai]||[],[s,c]=t(1===r.length);return a(()=>{if(!r.length){const e=ni.map(({id:e})=>e);n(ai,e),c(1===ni.length)}},[]),e.createElement("div",null,e.createElement(v,{title:"Attributes to mask",required:!0}),e.createElement(ii,{$hasError:!!l},ni.map(({id:t,label:a})=>e.createElement(b,{key:t,title:a,disabled:s&&r.includes(t),value:r.includes(t),onChange:e=>((e,t)=>{const a=t?[...r,e]:r.filter(t=>t!==e);n(ai,a),c(1===a.length)})(t,e)}))),!!l&&e.createElement(f,null,l))},[g.ErrorSampler]:({value:t,setValue:a,formErrors:i})=>{const n=i[oi],o=t[oi];return e.createElement(S,{title:"Fallback sampling ratio",required:!0,type:$.Number,min:0,max:100,value:k(o)?"":String(o),onChange:({target:{value:e}})=>{return t=e,a(oi,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:n})},[g.ProbabilisticSampler]:({value:t,setValue:a,formErrors:i})=>{const n=i[gi],o=t[gi];return e.createElement(S,{title:"Sampling percentage",required:!0,type:$.Number,min:0,max:100,value:k(o)?"":String(o),onChange:({target:{value:e}})=>{return t=e,a(gi,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:n})},[g.LatencySampler]:({value:t,setValue:a,formErrors:i})=>{const n=i[ci],o=t[ci]||[];return e.createElement(C,{columns:di,value:o,onChange:e=>{const t=e.map(({serviceName:e,httpRoute:t,minimumLatencyThreshold:a,fallbackSamplingRatio:i})=>({serviceName:e,httpRoute:t,minimumLatencyThreshold:Number(a),fallbackSamplingRatio:Number(i)}));a(ci,t)},errorMessage:n})},[g.ServiceNameSampler]:({value:t,setValue:a,formErrors:i})=>{const n=i[mi],o=t[mi]||[];return e.createElement(C,{columns:hi,value:o,onChange:e=>{const t=e.map(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:a})=>({serviceName:e,samplingRatio:Number(t),fallbackSamplingRatio:Number(a)}));a(mi,t)},errorMessage:n})},[g.SpanAttributeSampler]:({value:t,setValue:a,formErrors:i})=>{const n=i[yi],o=(t[yi]||[]).map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:a,condition:i})=>{const n=Object.entries(i).filter(([e,t])=>t)[0][0];return{serviceName:e,attributeKey:t,fallbackSamplingRatio:a,condition:n,operation:i[n]?.operation,expectedValue:i[n]?.expectedValue,jsonPath:i[n]?.jsonPath}});return e.createElement(C,{columns:vi,value:o,onChange:e=>{const t=e.map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:a,condition:i,operation:n,expectedValue:o,jsonPath:l})=>{const r={serviceName:e,attributeKey:t,fallbackSamplingRatio:Number(a),condition:{[i]:{operation:n,expectedValue:o}}};return l&&(r.condition[i].jsonPath=l),r});a(yi,t)},errorMessage:n,limitFieldsPerRow:3})}},fi=({actionType:t,value:a,setValue:i,formErrors:n})=>{if(!t)return null;const o=bi[t];return o?e.createElement(o,{value:a,setValue:i,formErrors:n}):null},xi=d.div`
10
+ `,ii=[{id:"CREDIT_CARD",label:"Credit Card"}],ni=x.FallbackSamplingRatio,oi=[{value:y.Pod,id:y.Pod},{value:y.Namespace,id:y.Namespace},{value:y.Node,id:y.Node}],li=[{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:oi,required:!1,tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones."}],ri=[{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:oi,required:!1,tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones."}],si=x.EndpointsFilters,ci=[{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:$.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:$.Number}],di=x.AttributeNamesToDelete,ui=x.Renames,pi=x.ServicesNameFilters,mi=[{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:$.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:$.Number}],hi=x.SamplingPercentage,gi=x.AttributeFilters,yi=[{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:$.Number},{title:"Condition",keyName:"condition",tooltip:"An object representing the filters for span attributes filters.",required:!0,componentType:N.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:N.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}],vi={[g.K8sAttributes]:({value:t,setValue:i,formErrors:n})=>(a(()=>{t[x.CollectContainerAttributes]||t[x.CollectReplicaSetAttributes]||t[x.CollectWorkloadId]||t[x.CollectClusterId]||t[x.LabelsAttributes]?.length||t[x.AnnotationsAttributes]?.length||(i(x.CollectContainerAttributes,!0),i(x.CollectReplicaSetAttributes,!0),i(x.CollectWorkloadId,!0),i(x.CollectClusterId,!0),i(x.LabelsAttributes,[]),i(x.AnnotationsAttributes,[]))},[]),e.createElement(e.Fragment,null,e.createElement(b,{title:"Collect Container Attributes",value:t[x.CollectContainerAttributes]||!1,onChange:e=>i(x.CollectContainerAttributes,e),errorMessage:n[x.CollectContainerAttributes]}),e.createElement(b,{title:"Collect ReplicaSet Attributes",value:t[x.CollectReplicaSetAttributes]||!1,onChange:e=>i(x.CollectReplicaSetAttributes,e),errorMessage:n[x.CollectReplicaSetAttributes]}),e.createElement(b,{title:"Collect Workload ID",value:t[x.CollectWorkloadId]||!1,onChange:e=>i(x.CollectWorkloadId,e),errorMessage:n[x.CollectWorkloadId]}),e.createElement(b,{title:"Collect Cluster ID",value:t[x.CollectClusterId]||!1,onChange:e=>i(x.CollectClusterId,e),errorMessage:n[x.CollectClusterId]}),e.createElement(C,{columns:li,value:t[x.LabelsAttributes]||[],onChange:e=>i(x.LabelsAttributes,e),errorMessage:n[x.LabelsAttributes]}),e.createElement(C,{columns:ri,value:t[x.AnnotationsAttributes]||[],onChange:e=>i(x.AnnotationsAttributes,e),errorMessage:n[x.AnnotationsAttributes]}))),[g.AddClusterInfo]:({value:t,setValue:a,formErrors:i})=>e.createElement(e.Fragment,null,e.createElement(w,{title:"Overwrite Existing Values",tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",initialValue:t[x.OverwriteExistingValues]||!1,onChange:e=>a(x.OverwriteExistingValues,e)}),e.createElement(D,{title:"Resource Attributes",value:t[x.ClusterAttributes]?.map(e=>({key:e.attributeName,value:e.attributeStringValue}))||[],onChange:e=>a(x.ClusterAttributes,e.map(e=>({attributeName:e.key,attributeStringValue:e.value}))),required:!0,errorMessage:i[x.ClusterAttributes]})),[g.DeleteAttributes]:({value:t,setValue:a,formErrors:i})=>{const n=i[di],o=t[di]||[];return e.createElement(T,{title:"Attributes to delete",value:o,onChange:e=>a(di,e),required:!0,errorMessage:n})},[g.RenameAttributes]:({value:t,setValue:a,formErrors:i})=>{const n=i[ui],o=Object.entries(t[ui]||{}).map(([e,t])=>({key:e,value:t}));return e.createElement(D,{title:"Attributes to rename",value:o,onChange:e=>{const t={};e.forEach(e=>t[e.key]=e.value),a(ui,t)},required:!0,errorMessage:n})},[g.PiiMasking]:({value:i,setValue:n,formErrors:o})=>{const l=o[ti],r=i[ti]||[],[s,c]=t(1===r.length);return a(()=>{if(!r.length){const e=ii.map(({id:e})=>e);n(ti,e),c(1===ii.length)}},[]),e.createElement("div",null,e.createElement(v,{title:"Attributes to mask",required:!0}),e.createElement(ai,{$hasError:!!l},ii.map(({id:t,label:a})=>e.createElement(b,{key:t,title:a,disabled:s&&r.includes(t),value:r.includes(t),onChange:e=>((e,t)=>{const a=t?[...r,e]:r.filter(t=>t!==e);n(ti,a),c(1===a.length)})(t,e)}))),!!l&&e.createElement(f,null,l))},[g.ErrorSampler]:({value:t,setValue:a,formErrors:i})=>{const n=i[ni],o=t[ni];return e.createElement(S,{title:"Fallback sampling ratio",required:!0,type:$.Number,min:0,max:100,value:k(o)?"":String(o),onChange:({target:{value:e}})=>{return t=e,a(ni,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:n})},[g.ProbabilisticSampler]:({value:t,setValue:a,formErrors:i})=>{const n=i[hi],o=t[hi];return e.createElement(S,{title:"Sampling percentage",required:!0,type:$.Number,min:0,max:100,value:k(o)?"":String(o),onChange:({target:{value:e}})=>{return t=e,a(hi,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:n})},[g.LatencySampler]:({value:t,setValue:a,formErrors:i})=>{const n=i[si],o=t[si]||[];return e.createElement(C,{columns:ci,value:o,onChange:e=>{const t=e.map(({serviceName:e,httpRoute:t,minimumLatencyThreshold:a,fallbackSamplingRatio:i})=>({serviceName:e,httpRoute:t,minimumLatencyThreshold:Number(a),fallbackSamplingRatio:Number(i)}));a(si,t)},errorMessage:n})},[g.ServiceNameSampler]:({value:t,setValue:a,formErrors:i})=>{const n=i[pi],o=t[pi]||[];return e.createElement(C,{columns:mi,value:o,onChange:e=>{const t=e.map(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:a})=>({serviceName:e,samplingRatio:Number(t),fallbackSamplingRatio:Number(a)}));a(pi,t)},errorMessage:n})},[g.SpanAttributeSampler]:({value:t,setValue:a,formErrors:i})=>{const n=i[gi],o=(t[gi]||[]).map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:a,condition:i})=>{const n=Object.entries(i).filter(([e,t])=>t)[0][0];return{serviceName:e,attributeKey:t,fallbackSamplingRatio:a,condition:n,operation:i[n]?.operation,expectedValue:i[n]?.expectedValue,jsonPath:i[n]?.jsonPath}});return e.createElement(C,{columns:yi,value:o,onChange:e=>{const t=e.map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:a,condition:i,operation:n,expectedValue:o,jsonPath:l})=>{const r={serviceName:e,attributeKey:t,fallbackSamplingRatio:Number(a),condition:{[i]:{operation:n,expectedValue:o}}};return l&&(r.condition[i].jsonPath=l),r});a(gi,t)},errorMessage:n,limitFieldsPerRow:3})}},bi=({actionType:t,value:a,setValue:i,formErrors:n})=>{if(!t)return null;const o=vi[t];return o?e.createElement(o,{value:a,setValue:i,formErrors:n}):null},fi=d.div`
11
11
  display: flex;
12
12
  flex-direction: column;
13
13
  gap: 24px;
14
14
  padding: 4px;
15
- `,Si=d(E)`
15
+ `,xi=d(E)`
16
16
  margin-bottom: 12px;
17
- `,$i=({isUpdate:t,action:a,formData:i,formErrors:n,handleFormChange:o})=>{const l=O.useTheme();return e.createElement(xi,null,t&&e.createElement("div",null,e.createElement(Si,null,"Status"),e.createElement(A,{options:[{icon:Ca,label:m.ENABLED,value:!1,selectedBgColor:l.text.success+O.opacity.hex["050"]},{icon:wa,label:m.DISABLED,value:!0,selectedBgColor:l.text.error+O.opacity.hex["050"]}],selected:i.disabled,setSelected:e=>o("disabled",e)})),!t&&e.createElement(F,{title:"",description:a.docsDescription,actionButton:e.createElement(I,{endpoint:a.docsEndpoint})}),e.createElement(M,{title:"Signals for Processing",required:!0,allowedSignals:a.allowedSignals,selectedSignals:i.signals||[],setSelectedSignals:e=>o("signals",e),errorMessage:n.signals}),!t&&e.createElement(S,{title:"Action name",placeholder:"Use a name that describes the action",value:i.name||"",onChange:({target:{value:e}})=>o("name",e),errorMessage:n.name}),e.createElement(fi,{actionType:a.type,value:i.fields,setValue:(e,t)=>o(`fields.${e}`,t),formErrors:n}),e.createElement(R,{title:"Notes",value:i.notes||"",onChange:({target:{value:e}})=>o("notes",e),errorMessage:n.notes}))},ki=i(({children:a,width:i=640,title:l,titleTooltip:r,hideEditTitleFromEdit:s,icons:c,iconSrcs:d,isEdit:u=!1,isFormDirty:m=!1,isLastItem:h=!1,onClose:g,onEdit:y,onSave:v,onDelete:b,onCancel:f,tabs:x,headerActionButtons:S},$)=>{const k=p(),{drawerType:C,setDrawerType:w,setDrawerEntityId:D}=L();P({key:"Enter",active:u},()=>_());const[T,N]=t(!1),[O,A]=t(!1),F=n(null),I=C===H.Source,M=()=>{N(!1),A(!1)},R=()=>{M(),y&&y(!1),w(null),D(null),g?.()};o($,()=>({closeDrawer:R}));const z=()=>{F.current?.clearTitle(),f&&f(),M()},B=()=>{const e=F.current?.isTitleDirty();m||e?A(!0):z()},W=()=>{N(!0)},_=()=>{v&&v(F.current?.getTitle()||"")},J=S||[];return y&&!u&&J.push({"data-id":"drawer-edit",variant:"tertiary",onClick:()=>y(!0),children:e.createElement(e.Fragment,null,e.createElement(Da,null),e.createElement(E,{size:14,family:"secondary",decoration:"underline"},"Edit"))}),b&&!u&&J.push({"data-id":"drawer-delete",variant:"tertiary",onClick:W,children:e.createElement(e.Fragment,null,e.createElement(Ta,null),e.createElement(E,{color:k.text.error,size:14,family:"secondary",decoration:"underline"},I?j.UNINSTRUMENT:j.DELETE))}),e.createElement(e.Fragment,null,e.createElement(K,{isOpen:!0,onClose:u?B:R,closeOnEscape:!T&&!O,width:`${i+64}px`,header:{icons:c,iconSrcs:d,title:l,titleTooltip:r,replaceTitleWith:!s&&u?e.createElement(Ci,{ref:F,title:l}):void 0,actionButtons:J,tabs:x},footer:{isOpen:u,leftButtons:[{"data-id":"drawer-save",variant:"primary",onClick:_,children:j.SAVE},{"data-id":"drawer-cancel",variant:"secondary",onClick:B,children:j.CANCEL}],rightButtons:b?[{"data-id":"drawer-delete",variant:"tertiary",onClick:W,children:e.createElement(e.Fragment,null,e.createElement(Ta,null),e.createElement(E,{size:14,color:k.text.error,family:"secondary",decoration:"underline"},j.DELETE))}]:[]}},a),e.createElement(V,{isOpen:T,noOverlay:!0,name:`${C}${l?` (${l})`:""}`,type:C,isLastItem:h,onApprove:()=>{b&&b(),M()},onDeny:M}),e.createElement(q,{isOpen:O,noOverlay:!0,name:"edit mode",onApprove:z,onDeny:M}))}),Ci=i(({title:i},n)=>{const[l,r]=t(i);return a(()=>{r(i)},[i]),o(n,()=>({getTitle:()=>l||i,isTitleDirty:()=>l!==i,clearTitle:()=>r(i)})),e.createElement(S,{"data-id":"title",value:l,onChange:e=>r(e.target.value)})});Ci.displayName=Ci.name,ki.displayName=ki.name;const wi=d.div`
17
+ `,Si=({isUpdate:t,action:a,formData:i,formErrors:n,handleFormChange:o})=>{const l=O.useTheme();return e.createElement(fi,null,t&&e.createElement("div",null,e.createElement(xi,null,"Status"),e.createElement(A,{options:[{icon:ka,label:m.ENABLED,value:!1,selectedBgColor:l.text.success+O.opacity.hex["050"]},{icon:Ca,label:m.DISABLED,value:!0,selectedBgColor:l.text.error+O.opacity.hex["050"]}],selected:i.disabled,setSelected:e=>o("disabled",e)})),!t&&e.createElement(F,{title:"",description:a.docsDescription,actionButton:e.createElement(I,{endpoint:a.docsEndpoint})}),e.createElement(M,{title:"Signals for Processing",required:!0,allowedSignals:a.allowedSignals,selectedSignals:i.signals||[],setSelectedSignals:e=>o("signals",e),errorMessage:n.signals}),!t&&e.createElement(S,{title:"Action name",placeholder:"Use a name that describes the action",value:i.name||"",onChange:({target:{value:e}})=>o("name",e),errorMessage:n.name}),e.createElement(bi,{actionType:a.type,value:i.fields,setValue:(e,t)=>o(`fields.${e}`,t),formErrors:n}),e.createElement(R,{title:"Notes",value:i.notes||"",onChange:({target:{value:e}})=>o("notes",e),errorMessage:n.notes}))},$i=i(({children:a,width:i=640,title:l,titleTooltip:r,hideEditTitleFromEdit:s,icons:c,iconSrcs:d,isEdit:u=!1,isFormDirty:m=!1,isLastItem:h=!1,onClose:g,onEdit:y,onSave:v,onDelete:b,onCancel:f,tabs:x,headerActionButtons:S},$)=>{const k=p(),{drawerType:C,setDrawerType:w,setDrawerEntityId:D}=L();P({key:"Enter",active:u},()=>_());const[T,N]=t(!1),[O,A]=t(!1),F=n(null),I=C===z.Source,M=()=>{N(!1),A(!1)},R=()=>{M(),y&&y(!1),w(null),D(null),g?.()};o($,()=>({closeDrawer:R}));const V=()=>{F.current?.clearTitle(),f&&f(),M()},B=()=>{const e=F.current?.isTitleDirty();m||e?A(!0):V()},W=()=>{N(!0)},_=()=>{v&&v(F.current?.getTitle()||"")},J=S||[];return y&&!u&&J.push({"data-id":"drawer-edit",variant:"tertiary",onClick:()=>y(!0),children:e.createElement(e.Fragment,null,e.createElement(wa,null),e.createElement(E,{size:14,family:"secondary",decoration:"underline"},"Edit"))}),b&&!u&&J.push({"data-id":"drawer-delete",variant:"tertiary",onClick:W,children:e.createElement(e.Fragment,null,e.createElement(Da,null),e.createElement(E,{color:k.text.error,size:14,family:"secondary",decoration:"underline"},I?j.UNINSTRUMENT:j.DELETE))}),e.createElement(e.Fragment,null,e.createElement(K,{isOpen:!0,onClose:u?B:R,closeOnEscape:!T&&!O,width:`${i+64}px`,header:{icons:c,iconSrcs:d,title:l,titleTooltip:r,replaceTitleWith:!s&&u?e.createElement(ki,{ref:F,title:l}):void 0,actionButtons:J,tabs:x},footer:{isOpen:u,leftButtons:[{"data-id":"drawer-save",variant:"primary",onClick:_,children:j.SAVE},{"data-id":"drawer-cancel",variant:"secondary",onClick:B,children:j.CANCEL}],rightButtons:b?[{"data-id":"drawer-delete",variant:"tertiary",onClick:W,children:e.createElement(e.Fragment,null,e.createElement(Da,null),e.createElement(E,{size:14,color:k.text.error,family:"secondary",decoration:"underline"},j.DELETE))}]:[]}},a),e.createElement(q,{isOpen:T,noOverlay:!0,name:`${C}${l?` (${l})`:""}`,type:C,isLastItem:h,onApprove:()=>{b&&b(),M()},onDeny:M}),e.createElement(H,{isOpen:O,noOverlay:!0,name:"edit mode",onApprove:V,onDeny:M}))}),ki=i(({title:i},n)=>{const[l,r]=t(i);return a(()=>{r(i)},[i]),o(n,()=>({getTitle:()=>l||i,isTitleDirty:()=>l!==i,clearTitle:()=>r(i)})),e.createElement(S,{"data-id":"title",value:l,onChange:e=>r(e.target.value)})});ki.displayName=ki.name,$i.displayName=$i.name;const Ci=d.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
- `,Di=d.div`
23
+ `,wi=d.div`
24
24
  display: flex;
25
25
  flex-direction: column;
26
26
  gap: 12px;
27
- `,Ti=({updateAction:i,deleteAction:o})=>{const{actions:r}=z(),{drawerType:s,drawerEntityId:c}=L(),d=n(null),u=s===H.Action,[p,h]=t(!1),[g,y]=t(!1),{formData:v,formErrors:b,handleFormChange:f,resetFormData:x,validateForm:S,loadFormWithDrawerItem:$}=B(),k=l(()=>{if(c)return r?.find(e=>W(e)===c)},[c,r]);if(a(()=>{u&&k?$(k):x()},[u,k]),!k)return null;const C=_.find(({type:e})=>e===k.type)||_.find(({label:e})=>"Attributes"===e)?.items?.find(({type:e})=>e===k.type)||_.find(({label:e})=>"Samplers"===e)?.items?.find(({type:e})=>e===k.type);return e.createElement(ki,{ref:d,title:k.name||k.type,icons:[J(k.type)],isEdit:p,isFormDirty:g,onEdit:e=>{h("boolean"!=typeof e||e)},onSave:e=>{if(S({withAlert:!0,alertTitle:Y.Update})){const t=e!==k.type?e:"";f("name",t),i(c,{...v,name:t}),h(!1),y(!1)}},onDelete:()=>{o(c,k.type),h(!1),y(!1),d.current?.closeDrawer()},onCancel:()=>{h(!1),y(!1),$(k)}},p&&C?e.createElement(wi,null,e.createElement($i,{isUpdate:!0,action:C,formData:v,formErrors:b,handleFormChange:(...e)=>{y(!0),f(...e)}})):e.createElement(Di,null,e.createElement(U,{conditions:k.conditions||[]}),e.createElement(G,{title:m.ACTION_DETAILS,data:k?ti(k):[]})))},Ni=d(X)`
27
+ `,Di=({updateAction:i,deleteAction:o})=>{const{actions:r}=V(),{drawerType:s,drawerEntityId:c}=L(),d=n(null),u=s===z.Action,[p,h]=t(!1),[g,y]=t(!1),{formData:v,formErrors:b,handleFormChange:f,resetFormData:x,validateForm:S,loadFormWithDrawerItem:$}=B(),k=l(()=>{if(c)return r?.find(e=>W(e)===c)},[c,r]);if(a(()=>{u&&k?$(k):x()},[u,k]),!k)return null;const C=_.find(({type:e})=>e===k.type)||_.find(({label:e})=>"Attributes"===e)?.items?.find(({type:e})=>e===k.type)||_.find(({label:e})=>"Samplers"===e)?.items?.find(({type:e})=>e===k.type);return e.createElement($i,{ref:d,title:k.name||k.type,icons:[J(k.type)],isEdit:p,isFormDirty:g,onEdit:e=>{h("boolean"!=typeof e||e)},onSave:e=>{if(S({withAlert:!0,alertTitle:Y.Update})){const t=e!==k.type?e:"";f("name",t),i(c,{...v,name:t}),h(!1),y(!1)}},onDelete:()=>{o(c,k.type),h(!1),y(!1),d.current?.closeDrawer()},onCancel:()=>{h(!1),y(!1),$(k)}},p&&C?e.createElement(Ci,null,e.createElement(Si,{isUpdate:!0,action:C,formData:v,formErrors:b,handleFormChange:(...e)=>{y(!0),f(...e)}})):e.createElement(wi,null,e.createElement(U,{conditions:k.conditions||[]}),e.createElement(G,{title:m.ACTION_DETAILS,data:k?ei(k):[]})))},Ti=d(X)`
28
28
  margin-top: 24px;
29
29
  gap: 12px;
30
- `,Ei=({createAction:a})=>{const{currentModal:i,setCurrentModal:n}=Z(),o=i===H.Action,{formData:l,formErrors:r,handleFormChange:s,resetFormData:c,validateForm:d}=B(),[u,p]=t(void 0),h=()=>{c(),p(void 0),n("")},g=()=>{if(!d({withAlert:!0,alertTitle:Y.Create}))return null;a(l),h()};return P({key:"Enter",active:o},()=>g()),e.createElement(Q,{isOpen:o,onClose:h,header:{title:"Add Action"},actionComponent:e.createElement(ee,{buttons:[{variant:"primary",label:"DONE",onClick:g,disabled:!u}]})},e.createElement(te,null,e.createElement(F,{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.createElement(Ni,null,e.createElement(ae,{type:ie.Warning,message:ne.DEFINED_FOR_ALL_STREAMS(m.ACTIONS)}),e.createElement(oe,{options:_,selectedOption:u,onOptionSelect:e=>{return t=e,c(),s("type",t?.type||""),void p(t);var t},autoFocus:!u?.type})),u?.type?e.createElement("div",null,e.createElement(le,{margin:"16px 0"}),e.createElement($i,{action:u,formData:l,formErrors:r,handleFormChange:s})):null))},Oi=e=>{const{type:t,fields:{collectContainerAttributes:a,collectReplicaSetAttributes:i,collectWorkloadId:n,collectClusterId:o,labelsAttributes:l,annotationsAttributes:r,clusterAttributes:s,overwriteExistingValues:c,attributeNamesToDelete:d,renames:u,piiCategories:p,fallbackSamplingRatio:m,samplingPercentage:h,endpointsFilters:v,attributeFilters:b,servicesNameFilters:f}}=e;let x="";if(t===g.K8sAttributes&&(a&&(x+="Container Attributes, "),i&&(x+="ReplicaSet Attributes, "),n&&(x+="Workload ID, "),o&&(x+="Cluster ID, "),l?.forEach(({labelKey:e,attributeKey:t,from:a,fromSources:i},n)=>{const o=i?.length?i.join(","):a||y.Pod;x+=`Label: ${e} ${t} ${o} `,n===l.length-1&&(x+=", ")}),r?.forEach(({annotationKey:e,attributeKey:t,from:a,fromSources:i},n)=>{const o=i?.length?i.join(","):a||y.Pod;x+=`Annotation: ${e} ${t} ${o} `,n===r.length-1&&(x+=", ")})),t===g.AddClusterInfo&&(x+=`Overwrite Existing: ${c}\n`,s?.forEach(({attributeName:e,attributeStringValue:t},a)=>{x+=`${e}: ${t}`,a<s.length-1&&(x+=", ")})),t===g.DeleteAttributes&&d?.forEach((e,t)=>{x+=e,t<d.length-1&&(x+=", ")}),t===g.RenameAttributes){const e=Object.entries(u||{});e.forEach(([t,a],i)=>{x+=`${t}: ${a}`,i<e.length-1&&(x+=", ")})}return t===g.PiiMasking&&p?.forEach((e,t)=>{x+=e,t<p.length-1&&(x+=", ")}),t===g.ErrorSampler&&(x+=String(m)),t===g.ProbabilisticSampler&&(x+=String(h),x+="%"),t===g.LatencySampler&&v?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:a,fallbackSamplingRatio:i},n)=>{x+=`Endpoint${v.length>1?` #${n+1}`:""}=${e}${t}\n`,x+=` Latency=${a}`,x+=` Sampling=${i}`,n<v.length-1&&(x+=", ")}),t===g.ServiceNameSampler&&f?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:a})=>{x+=`Service Name: ${e}, `,x+=`Sampling Ratio: ${t}, `,x+=`Fallback Sampling Ratio: ${a}\n`}),t===g.SpanAttributeSampler&&b?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:a})=>{x+=`Service Name: ${e}, `,x+=`Attribute Key: ${t}, `,x+=`Fallback Sampling Ratio: ${a}\n`}),x},Ai=({conditions:t,id:a})=>{const{errors:i,warnings:n,disableds:o,hasLoadings:r}=l(()=>re(t),[t]),s=i.length>0?i:n.length>0?n:o.length>0?o:[];if(s.length>0)return e.createElement("div",{style:{lineHeight:1}},e.createElement(Fi,{conditions:s,id:a}));const c=r?pe.Loading:ie.Success;return e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:c,title:c,withBorder:!0,withIcon:!0}))},Fi=({conditions:t,id:a})=>{const i=O.useTheme();return e.createElement(ce,null,de(t).map(({status:t,type:n,reason:o,message:l,lastTransitionTime:r},s)=>{"loading"!==t&&"disabled"!==t||(t=ie.Info);const c=me(t,i);return e.createElement(ue,{key:`condition-${a}-${t}-${n}-${s}`,titleIcon:c,title:n,text:l||o||"",timestamp:r},e.createElement(se,{status:t,title:o||n,withBorder:!0,withIcon:!0}))}))},Ii=({instrumentationRules:e,sources:t,actions:a,destinations:i,searchText:n,selectedCategory:o})=>{const l=n?e.filter(e=>e.type?.toLowerCase().includes(n)||e.ruleName?.toLowerCase().includes(n)):e,r=n?t.filter(e=>e.name?.toLowerCase().includes(n)||e.otelServiceName?.toLowerCase().includes(n)||e.namespace?.toLowerCase().includes(n)):t,s=n?a.filter(e=>e.type?.toLowerCase().includes(n)||e.name?.toLowerCase().includes(n)):a,c=n?i.filter(e=>e.destinationType.displayName?.toLowerCase().includes(n)||e.name?.toLowerCase().includes(n)):i,d=[{category:H.Source,label:"Sources",count:r.length,entities:[]},{category:H.Action,label:"Actions",count:s.length,entities:[]},{category:H.Destination,label:"Destinations",count:c.length,entities:[]},{category:H.InstrumentationRule,label:"Instrumentation Rules",count:l.length,entities:[]}];d.unshift({category:"all",label:"All",count:l.length+r.length+s.length+c.length,entities:[]});const u=d.filter(({count:e,category:t})=>!!e&&"all"!==t&&["all",t].includes(o)).map(e=>({...e,entities:e.category===H.InstrumentationRule?l:e.category===H.Source?r:e.category===H.Action?s:e.category===H.Destination?c:[]}));return{categories:d,searchResults:u}},Mi=[{key:"icon",title:""},{key:"name",title:m.NAME,sortable:!0},{key:"signals",title:m.MONITORS},{key:"active-status",title:m.STATUS},{key:"conditions",title:"Conditions"},{key:"type",title:m.TYPE,sortable:!0},{key:"spec",title:"Spec",sortable:!0},{key:"notes",title:m.NOTES,sortable:!0}],Ri=({maxHeight:t,maxWidth:a})=>{const i=O.useTheme(),n=he(),{actions:o,actionsLoading:r}=z(),{setDrawerType:s,setDrawerEntityId:c}=L(),d=l(()=>Ii({instrumentationRules:[],sources:[],actions:ge(o,n),destinations:[],searchText:n.searchText,selectedCategory:H.Action}).searchResults.find(({category:e})=>e===H.Action)?.entities||[],[o,n]),u=l(()=>d.map(t=>{const{hasErrors:a,hasWarnings:n,hasDisableds:o}=re(t.conditions||[]);return{status:a?ie.Error:n?ie.Warning:void 0,faded:o,onClick:()=>{s(H.Action),c(t.id)},cells:[{columnKey:"icon",component:()=>e.createElement(ye,{icon:J(t.type)})},{columnKey:"name",value:ve(t,H.Action,{prioritizeDisplayName:!0})},{columnKey:"type",value:t.type,textColor:i.text.info},{columnKey:"notes",value:t.notes,textColor:i.text.info,withTooltip:!0},{columnKey:"spec",value:Oi(t),textColor:i.text.info,withTooltip:!0},{columnKey:"signals",component:()=>e.createElement(be,{withLabels:!0,monitors:t.signals||[]})},{columnKey:"conditions",component:()=>e.createElement(Ai,{conditions:t.conditions||[],id:t.id})},{columnKey:"active-status",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:t.disabled?ie.Error:ie.Success,title:t.disabled?m.DISABLED:m.ENABLED,withIcon:!0,withBorder:!0}))}]}}),[d]),{badge:p,badgeTooltip:h}=l(()=>d.length!==o.length?{badge:`${d.length}/${o.length}`,badgeTooltip:m.FILTERED_COUNT_TOOLTIP}:{badge:o.length,badgeTooltip:void 0},[d,o]);return e.createElement(fe,{$maxWidth:a},e.createElement(xe,null,e.createElement(Se,{icon:$e(H.Action),title:m.ACTIONS,badge:p,badgeTooltip:h,loading:r})),e.createElement(ke,{$maxHeight:t},e.createElement(Ce,{columns:Mi,rows:u})),!d.length&&e.createElement(we,{style:{marginTop:"2rem"}},e.createElement(De,null)))},Li=d(X)`
30
+ `,Ni=({createAction:a})=>{const{currentModal:i,setCurrentModal:n}=Z(),o=i===z.Action,{formData:l,formErrors:r,handleFormChange:s,resetFormData:c,validateForm:d}=B(),[u,p]=t(void 0),h=()=>{c(),p(void 0),n("")},g=()=>{if(!d({withAlert:!0,alertTitle:Y.Create}))return null;a(l),h()};return P({key:"Enter",active:o},()=>g()),e.createElement(Q,{isOpen:o,onClose:h,header:{title:"Add Action"},actionComponent:e.createElement(ee,{buttons:[{variant:"primary",label:"DONE",onClick:g,disabled:!u}]})},e.createElement(te,null,e.createElement(F,{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.createElement(Ti,null,e.createElement(ae,{type:ie.Warning,message:ne.DEFINED_FOR_ALL_STREAMS(m.ACTIONS)}),e.createElement(oe,{options:_,selectedOption:u,onOptionSelect:e=>{return t=e,c(),s("type",t?.type||""),void p(t);var t},autoFocus:!u?.type})),u?.type?e.createElement("div",null,e.createElement(le,{margin:"16px 0"}),e.createElement(Si,{action:u,formData:l,formErrors:r,handleFormChange:s})):null))},Ei=e=>{const{type:t,fields:{collectContainerAttributes:a,collectReplicaSetAttributes:i,collectWorkloadId:n,collectClusterId:o,labelsAttributes:l,annotationsAttributes:r,clusterAttributes:s,overwriteExistingValues:c,attributeNamesToDelete:d,renames:u,piiCategories:p,fallbackSamplingRatio:m,samplingPercentage:h,endpointsFilters:v,attributeFilters:b,servicesNameFilters:f}}=e;let x="";if(t===g.K8sAttributes&&(a&&(x+="Container Attributes, "),i&&(x+="ReplicaSet Attributes, "),n&&(x+="Workload ID, "),o&&(x+="Cluster ID, "),l?.forEach(({labelKey:e,attributeKey:t,from:a,fromSources:i},n)=>{const o=i?.length?i.join(","):a||y.Pod;x+=`Label: ${e} ${t} ${o} `,n===l.length-1&&(x+=", ")}),r?.forEach(({annotationKey:e,attributeKey:t,from:a,fromSources:i},n)=>{const o=i?.length?i.join(","):a||y.Pod;x+=`Annotation: ${e} ${t} ${o} `,n===r.length-1&&(x+=", ")})),t===g.AddClusterInfo&&(x+=`Overwrite Existing: ${c}\n`,s?.forEach(({attributeName:e,attributeStringValue:t},a)=>{x+=`${e}: ${t}`,a<s.length-1&&(x+=", ")})),t===g.DeleteAttributes&&d?.forEach((e,t)=>{x+=e,t<d.length-1&&(x+=", ")}),t===g.RenameAttributes){const e=Object.entries(u||{});e.forEach(([t,a],i)=>{x+=`${t}: ${a}`,i<e.length-1&&(x+=", ")})}return t===g.PiiMasking&&p?.forEach((e,t)=>{x+=e,t<p.length-1&&(x+=", ")}),t===g.ErrorSampler&&(x+=String(m)),t===g.ProbabilisticSampler&&(x+=String(h),x+="%"),t===g.LatencySampler&&v?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:a,fallbackSamplingRatio:i},n)=>{x+=`Endpoint${v.length>1?` #${n+1}`:""}=${e}${t}\n`,x+=` Latency=${a}`,x+=` Sampling=${i}`,n<v.length-1&&(x+=", ")}),t===g.ServiceNameSampler&&f?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:a})=>{x+=`Service Name: ${e}, `,x+=`Sampling Ratio: ${t}, `,x+=`Fallback Sampling Ratio: ${a}\n`}),t===g.SpanAttributeSampler&&b?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:a})=>{x+=`Service Name: ${e}, `,x+=`Attribute Key: ${t}, `,x+=`Fallback Sampling Ratio: ${a}\n`}),x},Oi=({conditions:t,id:a})=>{const{errors:i,warnings:n,disableds:o,hasLoadings:r}=l(()=>re(t),[t]),s=i.length>0?i:n.length>0?n:o.length>0?o:[];if(s.length>0)return e.createElement("div",{style:{lineHeight:1}},e.createElement(Ai,{conditions:s,id:a}));const c=r?pe.Loading:ie.Success;return e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:c,title:c,withBorder:!0,withIcon:!0}))},Ai=({conditions:t,id:a})=>{const i=O.useTheme();return e.createElement(ce,null,de(t).map(({status:t,type:n,reason:o,message:l,lastTransitionTime:r},s)=>{"loading"!==t&&"disabled"!==t||(t=ie.Info);const c=me(t,i);return e.createElement(ue,{key:`condition-${a}-${t}-${n}-${s}`,titleIcon:c,title:n,text:l||o||"",timestamp:r},e.createElement(se,{status:t,title:o||n,withBorder:!0,withIcon:!0}))}))},Fi=({instrumentationRules:e,sources:t,actions:a,destinations:i,searchText:n,selectedCategory:o})=>{const l=n?e.filter(e=>e.type?.toLowerCase().includes(n)||e.ruleName?.toLowerCase().includes(n)):e,r=n?t.filter(e=>e.name?.toLowerCase().includes(n)||e.otelServiceName?.toLowerCase().includes(n)||e.namespace?.toLowerCase().includes(n)):t,s=n?a.filter(e=>e.type?.toLowerCase().includes(n)||e.name?.toLowerCase().includes(n)):a,c=n?i.filter(e=>e.destinationType.displayName?.toLowerCase().includes(n)||e.name?.toLowerCase().includes(n)):i,d=[{category:z.Source,label:"Sources",count:r.length,entities:[]},{category:z.Action,label:"Actions",count:s.length,entities:[]},{category:z.Destination,label:"Destinations",count:c.length,entities:[]},{category:z.InstrumentationRule,label:"Instrumentation Rules",count:l.length,entities:[]}];d.unshift({category:"all",label:"All",count:l.length+r.length+s.length+c.length,entities:[]});const u=d.filter(({count:e,category:t})=>!!e&&"all"!==t&&["all",t].includes(o)).map(e=>({...e,entities:e.category===z.InstrumentationRule?l:e.category===z.Source?r:e.category===z.Action?s:e.category===z.Destination?c:[]}));return{categories:d,searchResults:u}},Ii=[{key:"icon",title:""},{key:"name",title:m.NAME,sortable:!0},{key:"signals",title:m.MONITORS},{key:"active-status",title:m.STATUS},{key:"conditions",title:"Conditions"},{key:"type",title:m.TYPE,sortable:!0},{key:"spec",title:"Spec",sortable:!0},{key:"notes",title:m.NOTES,sortable:!0}],Mi=({maxHeight:t,maxWidth:a})=>{const i=O.useTheme(),n=he(),{actions:o,actionsLoading:r}=V(),{setDrawerType:s,setDrawerEntityId:c}=L(),d=l(()=>Fi({instrumentationRules:[],sources:[],actions:ge(o,n),destinations:[],searchText:n.searchText,selectedCategory:z.Action}).searchResults.find(({category:e})=>e===z.Action)?.entities||[],[o,n]),u=l(()=>d.map(t=>{const{hasErrors:a,hasWarnings:n,hasDisableds:o}=re(t.conditions||[]);return{status:a?ie.Error:n?ie.Warning:void 0,faded:o,onClick:()=>{s(z.Action),c(t.id)},cells:[{columnKey:"icon",component:()=>e.createElement(ye,{icon:J(t.type)})},{columnKey:"name",value:ve(t,z.Action,{prioritizeDisplayName:!0})},{columnKey:"type",value:t.type,textColor:i.text.info},{columnKey:"notes",value:t.notes,textColor:i.text.info,withTooltip:!0},{columnKey:"spec",value:Ei(t),textColor:i.text.info,withTooltip:!0},{columnKey:"signals",component:()=>e.createElement(be,{withLabels:!0,monitors:t.signals||[]})},{columnKey:"conditions",component:()=>e.createElement(Oi,{conditions:t.conditions||[],id:t.id})},{columnKey:"active-status",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:t.disabled?ie.Error:ie.Success,title:t.disabled?m.DISABLED:m.ENABLED,withIcon:!0,withBorder:!0}))}]}}),[d]),{badge:p,badgeTooltip:h}=l(()=>d.length!==o.length?{badge:`${d.length}/${o.length}`,badgeTooltip:m.FILTERED_COUNT_TOOLTIP}:{badge:o.length,badgeTooltip:void 0},[d,o]);return e.createElement(fe,{$maxWidth:a},e.createElement(xe,null,e.createElement(Se,{icon:$e(z.Action),title:m.ACTIONS,badge:p,badgeTooltip:h,loading:r})),e.createElement(ke,{$maxHeight:t},e.createElement(Ce,{columns:Ii,rows:u})),!d.length&&e.createElement(we,{style:{marginTop:"2rem"}},e.createElement(De,null)))},Ri=d(X)`
31
31
  // width: 100vw;
32
32
  // height: 100vh;
33
33
  gap: 64px;
34
34
  align-items: center;
35
35
  justify-content: center;
36
- `,Pi=d(X)`
36
+ `,Li=d(X)`
37
37
  max-width: 400px;
38
38
  gap: 12px;
39
39
  align-items: center;
40
40
  justify-content: center;
41
- `,ji=d(E)`
41
+ `,Pi=d(E)`
42
42
  text-align: center;
43
43
  font-size: 24px;
44
- `,Ki=d(E)`
44
+ `,ji=d(E)`
45
45
  text-align: center;
46
46
  line-height: 26px;
47
47
  color: ${({theme:e})=>e.text.info};
48
- `,Vi=()=>{const[i,n]=t(0);return a(()=>{(async()=>{for(let e=0;e<=100;e+=5)await Ee(500),n(e)})()},[]),e.createElement(Li,null,e.createElement(Na,{size:100}),e.createElement(Te,{width:400}),e.createElement(Pi,null,e.createElement(ce,{$gap:16},e.createElement(ji,null,"Preparing your workspace..."),e.createElement(Ne,{label:`${i}%`})),e.createElement(Ki,null,"It can take up to a few minutes. Grab a cup of coffee, look out a window, and enjoy your free moment!")))},qi=d(X)`
48
+ `,Ki=()=>{const[i,n]=t(0);return a(()=>{(async()=>{for(let e=0;e<=100;e+=5)await Ee(500),n(e)})()},[]),e.createElement(Ri,null,e.createElement(Ta,{size:100}),e.createElement(Te,{width:400}),e.createElement(Li,null,e.createElement(ce,{$gap:16},e.createElement(Pi,null,"Preparing your workspace..."),e.createElement(Ne,{label:`${i}%`})),e.createElement(ji,null,"It can take up to a few minutes. Grab a cup of coffee, look out a window, and enjoy your free moment!")))},qi=d(X)`
49
49
  align-items: center !important;
50
50
  justify-content: center !important;
51
51
  align-self: stretch;
@@ -63,7 +63,7 @@ import e,{useState as t,useEffect as a,forwardRef as i,useRef as n,useImperative
63
63
  &:hover {
64
64
  background-color: ${({theme:e})=>e.colors.dropdown_bg_2+O.opacity.hex["030"]};
65
65
  }
66
- `,Hi=({entityType:t,description:a})=>{const{setCurrentModal:i}=Z();return e.createElement(qi,{onClick:()=>i(t)},e.createElement(ce,{$gap:4},e.createElement(Ea,null),e.createElement(E,{size:14,weight:600,family:"secondary",decoration:"underline"},"Add ",t)),e.createElement(E,{size:12,align:"center"},a))},zi=d.div`
66
+ `,Hi=({entityType:t,description:a})=>{const{setCurrentModal:i}=Z();return e.createElement(qi,{onClick:()=>i(t)},e.createElement(ce,{$gap:4},e.createElement(Na,null),e.createElement(E,{size:14,weight:600,family:"secondary",decoration:"underline"},"Add ",t)),e.createElement(E,{size:12,align:"center"},a))},zi=d.div`
67
67
  position: relative;
68
68
  width: 100%;
69
69
  padding: 12px 0;
@@ -71,13 +71,13 @@ import e,{useState as t,useEffect as a,forwardRef as i,useRef as n,useImperative
71
71
  display: flex;
72
72
  align-items: center;
73
73
  border-bottom: 1px solid ${({theme:e})=>e.colors.border};
74
- `,Bi=d(ce)`
74
+ `,Vi=d(ce)`
75
75
  margin-left: ${({$marginLeft:e})=>e};
76
- `,Wi=d(Oe)`
76
+ `,Bi=d(Oe)`
77
77
  width: 24px;
78
78
  height: 24px;
79
79
  padding: 0;
80
- `,_i=d.div`
80
+ `,Wi=d.div`
81
81
  position: absolute;
82
82
  bottom: -2px;
83
83
  left: 0;
@@ -86,7 +86,7 @@ import e,{useState as t,useEffect as a,forwardRef as i,useRef as n,useImperative
86
86
  height: 4px;
87
87
  width: ${({percent:e})=>`${e}%`};
88
88
  transition: width 0.3s;
89
- `,Ji=({entityType:t,badge:a,badgeTooltip:i,isLoading:n,refetch:o,partiallySelected:l,allSelected:r,onSelectAll:s,progressPercent:c})=>{const d=p(),{setCurrentModal:u}=Z(),m=$e(t);return e.createElement(zi,null,s&&e.createElement(Bi,{$marginLeft:"28px"},e.createElement(b,{partiallyChecked:l,value:r,onChange:s})),e.createElement(Bi,{$marginLeft:t===H.Source?"0":"28px"},e.createElement(Se,{icon:m,title:`${t}s`,badge:a,badgeTooltip:i,loading:!1})),e.createElement(Bi,{$marginLeft:"auto"},e.createElement(Wi,{"data-id":`refresh-${t}`,variant:"secondary",onClick:o,disabled:n},n?e.createElement(Ae,{scale:.8}):e.createElement(Oa,{fill:d.colors.secondary,size:18})),e.createElement(Wi,{"data-id":`add-${t}`,variant:"primary",onClick:()=>u(t)},e.createElement(Ea,{fill:d.colors.primary,size:18}))),"number"==typeof c&&e.createElement(_i,{percent:c}))},Ui=d.div`
89
+ `,_i=({entityType:t,badge:a,badgeTooltip:i,isLoading:n,refetch:o,partiallySelected:l,allSelected:r,onSelectAll:s,progressPercent:c})=>{const d=p(),{setCurrentModal:u}=Z(),m=$e(t);return e.createElement(zi,null,s&&e.createElement(Vi,{$marginLeft:"28px"},e.createElement(b,{partiallyChecked:l,value:r,onChange:s})),e.createElement(Vi,{$marginLeft:t===z.Source?"0":"28px"},e.createElement(Se,{icon:m,title:`${t}s`,badge:a,badgeTooltip:i,loading:!1})),e.createElement(Vi,{$marginLeft:"auto"},e.createElement(Bi,{"data-id":`refresh-${t}`,variant:"secondary",onClick:o,disabled:n},n?e.createElement(Ae,{scale:.8}):e.createElement(Ea,{fill:d.colors.secondary,size:18})),e.createElement(Bi,{"data-id":`add-${t}`,variant:"primary",onClick:()=>u(t)},e.createElement(Na,{fill:d.colors.primary,size:18}))),"number"==typeof c&&e.createElement(Wi,{percent:c}))},Ji=d.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 e,{useState as t,useEffect as a,forwardRef as i,useRef as n,useImperative
101
101
  align-items: center;
102
102
  justify-content: center;
103
103
  white-space: nowrap;
104
- `,Gi=({entityId:t,entityType:a,status:i,faded:n,title:o,subTitle:l,tooltip:r,label:s,icon:c,icons:d,iconSrc:u,iconSrcs:m,monitors:h,isActive:g,raw:y})=>{const v=p(),b=a===H.Source,f="boolean"==typeof g,{setDrawerType:x,setDrawerEntityId:S}=L(),{selectedSources:$,setSelectedSources:k}=Fe(),C={...$},{namespace:w,name:D,kind:T}=y;b&&!C[w]&&(C[w]=[]);const N=b?C[w].findIndex(e=>e.name===D&&e.kind===T):-1;return e.createElement(Ie,{"data-id":a===H.Source?`${t.namespace}-${t.name}-${t.kind}`:t,title:o,subTitle:l,onClick:()=>{x(a),S(t)},renderActions:()=>{const t=b&&(!y.conditions?.length||y.conditions?.some(({status:e})=>"loading"===e)),a=f&&!g?me(ie.Info,v):i?me(i,v):void 0,n=t?e.createElement(Ae,{scale:.8}):a?e.createElement(a,{size:14}):null;return s?e.createElement(Ui,{$isError:i===ie.Error},e.createElement(ue,{text:r||"Heads up! The data-flow metrics you see are calculated over 10-second intervals."},s),n):n||null},iconProps:{icon:c,icons:d,iconSrc:u,iconSrcs:m},visualProps:{status:i,faded:n||f&&!g,monitors:h||void 0},checkboxProps:{withCheckbox:b,isChecked:-1!==N,onCheckboxChange:()=>{-1===N?C[w].push(y):C[w].splice(N,1),k(C)}}})},Yi=d.div`
104
+ `,Ui=({entityId:t,entityType:a,status:i,faded:n,title:o,subTitle:l,tooltip:r,label:s,icon:c,icons:d,iconSrc:u,iconSrcs:m,monitors:h,isActive:g,raw:y})=>{const v=p(),b=a===z.Source,f="boolean"==typeof g,{setDrawerType:x,setDrawerEntityId:S}=L(),{selectedSources:$,setSelectedSources:k}=Fe(),C={...$},{namespace:w,name:D,kind:T}=y;b&&!C[w]&&(C[w]=[]);const N=b?C[w].findIndex(e=>e.name===D&&e.kind===T):-1;return e.createElement(Ie,{"data-id":a===z.Source?`${t.namespace}-${t.name}-${t.kind}`:t,title:o,subTitle:l,onClick:()=>{x(a),S(t)},renderActions:()=>{const t=b&&(!y.conditions?.length||y.conditions?.some(({status:e})=>"loading"===e)),a=f&&!g?me(ie.Info,v):i?me(i,v):void 0,n=t?e.createElement(Ae,{scale:.8}):a?e.createElement(a,{size:14}):null;return s?e.createElement(Ji,{$isError:i===ie.Error},e.createElement(ue,{text:r||"Heads up! The data-flow metrics you see are calculated over 10-second intervals."},s),n):n||null},iconProps:{icon:c,icons:d,iconSrc:u,iconSrcs:m},visualProps:{status:i,faded:n||f&&!g,monitors:h||void 0},checkboxProps:{withCheckbox:b,isChecked:-1!==N,onCheckboxChange:()=>{-1===N?C[w].push(y):C[w].splice(N,1),k(C)}}})},Gi=d.div`
105
105
  height: calc(${({$height:e})=>e}px - 24px);
106
106
  width: calc(100% - 24px);
107
107
  padding: 12px;
@@ -109,7 +109,7 @@ import e,{useState as t,useEffect as a,forwardRef as i,useRef as n,useImperative
109
109
  border: 1px dashed ${({theme:e})=>e.colors.border};
110
110
  border-radius: 24px;
111
111
  position: relative;
112
- `,Xi=d.div`
112
+ `,Yi=d.div`
113
113
  position: absolute;
114
114
  bottom: 0;
115
115
  left: 0;
@@ -124,20 +124,18 @@ import e,{useState as t,useEffect as a,forwardRef as i,useRef as n,useImperative
124
124
  justify-content: center;
125
125
 
126
126
  pointer-events: none;
127
- `,Zi=({height:t,entityType:a,entities:i,metrics:n,isVm:o})=>{const r=l(()=>i.map(t=>{const i=W(t);if(!i)return null;const l=[H.Source,H.Destination].includes(a),r=[H.Destination,H.Action].includes(a),s=[H.Destination,H.Action,H.InstrumentationRule].includes(a),c=r?a==H.Destination?Me(t.exportedSignals):t.signals:void 0,d=l?n?.[`${a.toLowerCase()}s`]?.find(e=>JSON.stringify(W(e))===JSON.stringify(i)):void 0,u=s?!t.disabled:void 0,p=ve(t,a,{extended:a===H.Source,prioritizeDisplayName:a!==H.Source}),m=((e,t,a)=>{switch(e){case H.Source:return a?`${t.kind}`:`${t.namespace} • ${t.kind}`;case H.Destination:return t.destinationType.displayName;case H.Action:case H.InstrumentationRule:return t.type;default:return""}})(a,t,o),h=l?Re(d?.throughput):void 0,{priorotizedStatus:g,hasDisableds:y}=re(t.conditions||[]),{icons:v,icon:b,iconSrc:f}=((e,t)=>{switch(e){case H.Source:return{icons:Ke(t.containers),icon:$e(e)};case H.Destination:return je(t.destinationType.type);case H.Action:return{icon:J(t.type)};case H.InstrumentationRule:return{icon:Pe(t.type)};default:return{icon:$e(e)}}})(a,t),x=a===H.Source?t.podsAgentInjectionStatus:void 0,S=x?(e=>{switch(e){case Ve.Error:return ie.Error;case Ve.Notice:return ie.Warning;case Ve.Waiting:return ie.Info}})(x.status):void 0,$=x&&S?x.message:void 0;return e.createElement(Gi,{key:JSON.stringify(i),entityType:a,entityId:i,raw:t,title:p,subTitle:m,faded:y,status:S||g,tooltip:$,label:h,icons:v,icon:b,iconSrc:f,monitors:c,isActive:u})}),[i,a,n,o]);return e.createElement(Yi,{$height:t},e.createElement(Le,{containerHeight:t-24,elementHeight:80,elements:r}),e.createElement(Xi,{$hide:!0}))},Qi=d.div`
127
+ `,Xi=({height:t,entityType:a,entities:i,metrics:n})=>{const{isVm:o}=Me(),r=l(()=>i.map(t=>{const i=W(t);if(!i)return null;const l=[z.Source,z.Destination].includes(a),r=[z.Destination,z.Action].includes(a),s=[z.Destination,z.Action,z.InstrumentationRule].includes(a),c=r?a==z.Destination?Re(t.exportedSignals):t.signals:void 0,d=l?n?.[`${a.toLowerCase()}s`]?.find(e=>JSON.stringify(W(e))===JSON.stringify(i)):void 0,u=s?!t.disabled:void 0,p=ve(t,a,{extended:a===z.Source,prioritizeDisplayName:a!==z.Source}),m=((e,t,a)=>{switch(e){case z.Source:return a?`${t.kind}`:`${t.namespace} • ${t.kind}`;case z.Destination:return t.destinationType.displayName;case z.Action:case z.InstrumentationRule:return t.type;default:return""}})(a,t,o),h=l?Le(d?.throughput):void 0,{priorotizedStatus:g,hasDisableds:y}=re(t.conditions||[]),{icons:v,icon:b,iconSrc:f}=((e,t)=>{switch(e){case z.Source:return{icons:qe(t.containers),icon:$e(e)};case z.Destination:return Ke(t.destinationType.type);case z.Action:return{icon:J(t.type)};case z.InstrumentationRule:return{icon:je(t.type)};default:return{icon:$e(e)}}})(a,t),x=a===z.Source?t.podsAgentInjectionStatus:void 0,S=x?(e=>{switch(e){case He.Error:return ie.Error;case He.Notice:return ie.Warning;case He.Waiting:return ie.Info}})(x.status):void 0,$=x&&S?x.message:void 0;return e.createElement(Ui,{key:JSON.stringify(i),entityType:a,entityId:i,raw:t,title:p,subTitle:m,faded:y,status:S||g,tooltip:$,label:h,icons:v,icon:b,iconSrc:f,monitors:c,isActive:u})}),[i,a,n,o]);return e.createElement(Gi,{$height:t},e.createElement(Pe,{containerHeight:t-24,elementHeight:80,elements:r}),e.createElement(Yi,{$hide:!0}))},Zi=d.div`
128
128
  width: ${({$isVm:e})=>e?"45vw":"22vw"};
129
-
130
129
  display: flex;
131
130
  flex-direction: column;
132
131
  gap: 12px;
133
- `,en=({entityType:t,entities:a,unfilteredCount:i,metrics:n,loading:o,maxHeight:r,isVm:s,refetch:c})=>{const{frameHeight:d,hasFiltersApplied:u,isSources:p}=l(()=>({frameHeight:Math.min(r,80*a.length+12),hasFiltersApplied:a.length!==i,isSources:t===H.Source}),[t,a.length,r,i]),{progress:h}=qe(),g=l(()=>p&&(h[He.Instrumenting]||h[He.Uninstrumenting])?h[He.Instrumenting]?.percentage||h[He.Uninstrumenting]?.percentage||0:void 0,[p,h[He.Instrumenting],h[He.Uninstrumenting]]),{selectedSources:y,setSelectedSources:v}=Fe(),b=l(()=>p?Object.values(y).reduce((e,t)=>e+t.length,0):0,[p,y]);return s&&[H.InstrumentationRule,H.Action].includes(t)?null:e.createElement(Qi,{$isVm:s},e.createElement(Ji,{entityType:t,badge:"number"==typeof g?`${g}%`:u?`${a.length}/${i}`:i,badgeTooltip:u?m.FILTERED_COUNT_TOOLTIP:void 0,isLoading:o,refetch:c,partiallySelected:b>0&&a?.length!==b,allSelected:b>0&&a?.length===b,onSelectAll:p?e=>{if(p)if(e){const e={};a?.forEach(t=>{const{namespace:a}=t;e[a]?e[a].push(t):e[a]=[t]}),v(e)}else v({})}:void 0,progressPercent:g}),a.length?e.createElement(Zi,{height:d,entityType:t,entities:a,metrics:n,isVm:s}):o?e.createElement(ze,{size:3}):e.createElement(Hi,{entityType:t,description:m.TO_COLLECT_OTEL_DATA}))},tn=d.div`
132
+ `,Qi=({entityType:t,entities:a,unfilteredCount:i,metrics:n,loading:o,maxHeight:r,refetch:s})=>{const{isVm:c}=Me(),{frameHeight:d,hasFiltersApplied:u,isSources:p}=l(()=>({frameHeight:Math.min(r,80*a.length+12),hasFiltersApplied:a.length!==i,isSources:t===z.Source}),[t,a.length,r,i]),{progress:h}=ze(),g=l(()=>p&&(h[Ve.Instrumenting]||h[Ve.Uninstrumenting])?h[Ve.Instrumenting]?.percentage||h[Ve.Uninstrumenting]?.percentage||0:void 0,[p,h[Ve.Instrumenting],h[Ve.Uninstrumenting]]),{selectedSources:y,setSelectedSources:v}=Fe(),b=l(()=>p?Object.values(y).reduce((e,t)=>e+t.length,0):0,[p,y]);return c&&[z.InstrumentationRule,z.Action].includes(t)?null:e.createElement(Zi,{$isVm:c},e.createElement(_i,{entityType:t,badge:"number"==typeof g?`${g}%`:u?`${a.length}/${i}`:i,badgeTooltip:u?m.FILTERED_COUNT_TOOLTIP:void 0,isLoading:o,refetch:s,partiallySelected:b>0&&a?.length!==b,allSelected:b>0&&a?.length===b,onSelectAll:p?e=>{if(p)if(e){const e={};a?.forEach(t=>{const{namespace:a}=t;e[a]?e[a].push(t):e[a]=[t]}),v(e)}else v({})}:void 0,progressPercent:g}),a.length?e.createElement(Xi,{height:d,entityType:t,entities:a,metrics:n}):o?e.createElement(Be,{size:3}):e.createElement(Hi,{entityType:t,description:m.TO_COLLECT_OTEL_DATA}))},en=d.div`
134
133
  width: 100%;
135
134
  height: ${({$height:e})=>e};
136
-
137
135
  display: flex;
138
136
  justify-content: space-evenly;
139
137
  gap: 24px;
140
- `,an=({height:i,metrics:n,refetchSources:o,refetchDestinations:l,refetchActions:r,refetchInstrumentationRules:s})=>{const{isVm:c}=Be(),d=he(),{selectedStreamName:u}=We(),{containerRef:p,containerHeight:m}=_e(),{sources:h,sourcesLoading:g,destinations:y,destinationsLoading:v,actions:b,actionsLoading:f,instrumentationRules:x,instrumentationRulesLoading:S}=z(),[$,k]=t([]),[C,w]=t([]),[D,T]=t([]),[N,E]=t([]);return a(()=>{k(Je(Ue(h,u),d))},[h,u,d]),a(()=>{w(Ge(Ye(y,u),d))},[y,u,d]),a(()=>{T(ge(b,d))},[b,d]),a(()=>{E(x)},[x]),e.createElement(tn,{ref:p,$height:i},e.createElement(en,{entityType:H.InstrumentationRule,entities:N,unfilteredCount:x.length,loading:S,maxHeight:m,isVm:c,refetch:s}),e.createElement(en,{entityType:H.Source,entities:$,unfilteredCount:h.length,metrics:n,loading:g,maxHeight:m,isVm:c,refetch:o}),e.createElement(en,{entityType:H.Action,entities:D,unfilteredCount:b.length,loading:f,maxHeight:m,isVm:c,refetch:r}),e.createElement(en,{entityType:H.Destination,entities:C,unfilteredCount:y.length,metrics:n,loading:v,maxHeight:m,isVm:c,refetch:l}))},nn=d.div`
138
+ `,tn=({height:i,metrics:n,refetchSources:o,refetchDestinations:l,refetchActions:r,refetchInstrumentationRules:s})=>{const c=he(),{selectedStreamName:d}=We(),{containerRef:u,containerHeight:p}=_e(),{sources:m,sourcesLoading:h,destinations:g,destinationsLoading:y,actions:v,actionsLoading:b,instrumentationRules:f,instrumentationRulesLoading:x}=V(),[S,$]=t([]),[k,C]=t([]),[w,D]=t([]),[T,N]=t([]);return a(()=>{$(Je(Ue(m,d),c))},[m,d,c]),a(()=>{C(Ge(Ye(g,d),c))},[g,d,c]),a(()=>{D(ge(v,c))},[v,c]),a(()=>{N(f)},[f]),e.createElement(en,{ref:u,$height:i},e.createElement(Qi,{entityType:z.InstrumentationRule,entities:T,unfilteredCount:f.length,loading:x,maxHeight:p,refetch:s}),e.createElement(Qi,{entityType:z.Source,entities:S,unfilteredCount:m.length,metrics:n,loading:h,maxHeight:p,refetch:o}),e.createElement(Qi,{entityType:z.Action,entities:w,unfilteredCount:v.length,loading:b,maxHeight:p,refetch:r}),e.createElement(Qi,{entityType:z.Destination,entities:k,unfilteredCount:g.length,metrics:n,loading:y,maxHeight:p,refetch:l}))},an=d.div`
141
139
  position: relative;
142
140
  max-width: 200px;
143
141
  `;d.div`
@@ -151,60 +149,60 @@ import e,{useState as t,useEffect as a,forwardRef as i,useRef as n,useImperative
151
149
  background-color: ${({theme:e})=>e.colors.dropdown_bg};
152
150
  border: ${({theme:e})=>`1px solid ${e.colors.border}`};
153
151
  border-radius: 24px;
154
- `;const on=d.div`
152
+ `;const nn=d.div`
155
153
  display: flex;
156
154
  align-items: center;
157
155
  overflow-x: scroll;
158
- `,ln=({onClose:i})=>{const n=O.useTheme(),{onClickNode:o}=Xe(),{searchText:s}=he(),{selectedStreamName:c}=We(),{sources:d,destinations:u,actions:p,instrumentationRules:m}=z(),{popupRef:h,popupOpen:g,setPopupOpen:y,popupPosition:v,handlePosition:b}=Ze();a(()=>{g||(b(0,50),y(!0))},[g]);const[f,x]=t("all"),{categories:S,searchResults:$}=l(()=>Ii({instrumentationRules:m,sources:Ue(d,c),actions:p,destinations:Ye(u,c),searchText:s,selectedCategory:f}),[m,d,p,u,c,s,f]);return $.length?e.createElement(Qe,{ref:h,isOpen:g,top:v.top,left:v.left,maxWidth:"420px",header:e.createElement(on,null,S.map(({category:t,label:a,count:i})=>!!i&&e.createElement(et,{key:`category-select-${t}`,label:a,badgeLabel:i,isSelected:f===t,onClick:()=>x(t)})))},$.map(({category:t,label:a,entities:l},s)=>!!l.length&&e.createElement(r,{key:`category-list-${t}`},e.createElement(tt,{style:{maxHeight:"all"!==f?"240px":"140px",padding:"12px 0"}},e.createElement(E,{size:12,family:"secondary",color:n.text.darker_grey,style:{marginLeft:"16px"}},a),l.map((a,n)=>e.createElement(et,{key:`entity-${s}-${n}`,icon:$e(t),label:ve(a,t,{extended:!0}),onClick:()=>{const e=W(a);o(null,{data:{type:t,id:e}}),i()},style:{width:"100%",justifyContent:"flex-start"},color:"transparent"}))),e.createElement(le,{thickness:s===$.length-1?0:1,length:"90%",margin:"8px auto"})))):e.createElement(Qe,{ref:h,isOpen:g,top:v.top,left:v.left},e.createElement(De,null))},rn=({preventPopup:a=!1})=>{const{searchText:i,setSearchText:o}=he(),[l,r]=t(!1),s=!!i||l,c=()=>{o(""),r(!1)},d=n(null);return at(d,c),P({key:"Escape",active:s},c),e.createElement(nn,{ref:d},e.createElement(S,{placeholder:"Search",icon:Aa,value:i,onChange:e=>o(e.target.value.toLowerCase()),onFocus:()=>r(!0)}),s&&!a?e.createElement(ln,{onClose:c}):null)},sn=({sources:t,title:a="Condition",value:i,onSelect:n,onDeselect:o,...r})=>{const s=l(()=>{const e=[];return t.forEach(({conditions:t})=>{t?.forEach(({type:t,reason:a})=>{e.find(e=>e.id===`${t}#${a}`)||e.push({id:`${t}#${a}`,value:`${it(t)} - ${it(a)}`})})}),e.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[t]);return e.createElement(nt,{disabled:!s?.length,title:a,placeholder:"All",options:s,value:i,onSelect:n,onDeselect:o,...r})},cn=({sources:t,title:a="Error Message",value:i,onSelect:n,onDeselect:o,disabled:r,...s})=>{const c=l(()=>{const e=[];return t.forEach(({conditions:t})=>{de(t||[]).forEach(({status:t,message:a,reason:i})=>{t!==ie.Error||e.find(e=>e.id===a)||(a?e.find(e=>e.id===a)||e.push({id:a,value:a}):i&&(e.find(e=>e.id===i)||e.push({id:i,value:i})))})}),e},[t]);return e.createElement(nt,{disabled:r||!c?.length,title:a,placeholder:"All",options:c,value:i,onSelect:n,onDeselect:o,...s})},dn=({sources:t,title:a="Programming Language",value:i,onSelect:n,onDeselect:o,...r})=>{const s=l(()=>{const e=[];return t.forEach(({containers:t})=>{t?.forEach(({language:t})=>{e.find(e=>e.id===t)||e.push({id:t,value:ot[t]||t})})}),e.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[t]);return e.createElement(nt,{disabled:!s?.length,title:a,placeholder:"All",options:s,value:i,onSelect:n,onDeselect:o,...r})},un=({title:t="Monitors",value:a,onSelect:i,onDeselect:n,...o})=>{const r=l(()=>{const e=[];return lt.forEach(({id:t,value:a})=>{e.find(e=>e.id===t)||e.push({id:t,value:a})}),e},[]);return e.createElement(nt,{disabled:!r?.length,title:t,placeholder:"All",options:r,value:a,onSelect:i,onDeselect:n,...o})},pn=({namespaces:t,title:a="Namespace",value:i,onSelect:n,onDeselect:o,...r})=>{const s=l(()=>{const e=[];return t?.forEach(({name:t})=>{e.find(e=>e.id===t)||e.push({id:t,value:t})}),e},[t]);return e.createElement(nt,{disabled:!s?.length,title:a,placeholder:"Select namespace",options:s,value:i,onSelect:n,onDeselect:o,...r})},mn=({sources:t,title:a="Kind",value:i,onSelect:n,onDeselect:o,...r})=>{const s=l(()=>{const e=[];return t.forEach(({kind:t})=>{e.find(e=>e.id===t)||e.push({id:t,value:t})}),e},[t]);return e.createElement(nt,{disabled:!s?.length,title:a,placeholder:"All",options:s,value:i,onSelect:n,onDeselect:o,...r})},hn=({sources:t,title:a="Agent Injection Status",value:i,onSelect:n,onDeselect:o,disabled:r,...s})=>{const c=l(()=>{const e=[];return t.forEach(({podsAgentInjectionStatus:t})=>{const{reasonEnum:a,message:i}=t||{};a?e.find(e=>e.id===a)||e.push({id:a,value:it(a)}):i&&(e.find(e=>e.id===i)||e.push({id:i,value:i}))}),e},[t]);return e.createElement(nt,{disabled:r||!c?.length,title:a,placeholder:"All",options:c,value:i,onSelect:n,onDeselect:o,...s})},gn=d.div`
156
+ `,on=({onClose:i})=>{const n=O.useTheme(),{onClickNode:o}=Xe(),{searchText:s}=he(),{selectedStreamName:c}=We(),{sources:d,destinations:u,actions:p,instrumentationRules:m}=V(),{popupRef:h,popupOpen:g,setPopupOpen:y,popupPosition:v,handlePosition:b}=Ze();a(()=>{g||(b(0,50),y(!0))},[g]);const[f,x]=t("all"),{categories:S,searchResults:$}=l(()=>Fi({instrumentationRules:m,sources:Ue(d,c),actions:p,destinations:Ye(u,c),searchText:s,selectedCategory:f}),[m,d,p,u,c,s,f]);return $.length?e.createElement(Qe,{ref:h,isOpen:g,top:v.top,left:v.left,maxWidth:"420px",header:e.createElement(nn,null,S.map(({category:t,label:a,count:i})=>!!i&&e.createElement(et,{key:`category-select-${t}`,label:a,badgeLabel:i,isSelected:f===t,onClick:()=>x(t)})))},$.map(({category:t,label:a,entities:l},s)=>!!l.length&&e.createElement(r,{key:`category-list-${t}`},e.createElement(tt,{style:{maxHeight:"all"!==f?"240px":"140px",padding:"12px 0"}},e.createElement(E,{size:12,family:"secondary",color:n.text.darker_grey,style:{marginLeft:"16px"}},a),l.map((a,n)=>e.createElement(et,{key:`entity-${s}-${n}`,icon:$e(t),label:ve(a,t,{extended:!0}),onClick:()=>{const e=W(a);o(null,{data:{type:t,id:e}}),i()},style:{width:"100%",justifyContent:"flex-start"},color:"transparent"}))),e.createElement(le,{thickness:s===$.length-1?0:1,length:"90%",margin:"8px auto"})))):e.createElement(Qe,{ref:h,isOpen:g,top:v.top,left:v.left},e.createElement(De,null))},ln=({preventPopup:a=!1})=>{const{searchText:i,setSearchText:o}=he(),[l,r]=t(!1),s=!!i||l,c=()=>{o(""),r(!1)},d=n(null);return at(d,c),P({key:"Escape",active:s},c),e.createElement(an,{ref:d},e.createElement(S,{placeholder:"Search",icon:Oa,value:i,onChange:e=>o(e.target.value.toLowerCase()),onFocus:()=>r(!0)}),s&&!a?e.createElement(on,{onClose:c}):null)},rn=({sources:t,title:a="Condition",value:i,onSelect:n,onDeselect:o,...r})=>{const s=l(()=>{const e=[];return t.forEach(({conditions:t})=>{t?.forEach(({type:t,reason:a})=>{e.find(e=>e.id===`${t}#${a}`)||e.push({id:`${t}#${a}`,value:`${it(t)} - ${it(a)}`})})}),e.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[t]);return e.createElement(nt,{disabled:!s?.length,title:a,placeholder:"All",options:s,value:i,onSelect:n,onDeselect:o,...r})},sn=({sources:t,title:a="Error Message",value:i,onSelect:n,onDeselect:o,disabled:r,...s})=>{const c=l(()=>{const e=[];return t.forEach(({conditions:t})=>{de(t||[]).forEach(({status:t,message:a,reason:i})=>{t!==ie.Error||e.find(e=>e.id===a)||(a?e.find(e=>e.id===a)||e.push({id:a,value:a}):i&&(e.find(e=>e.id===i)||e.push({id:i,value:i})))})}),e},[t]);return e.createElement(nt,{disabled:r||!c?.length,title:a,placeholder:"All",options:c,value:i,onSelect:n,onDeselect:o,...s})},cn=({sources:t,title:a="Programming Language",value:i,onSelect:n,onDeselect:o,...r})=>{const s=l(()=>{const e=[];return t.forEach(({containers:t})=>{t?.forEach(({language:t})=>{e.find(e=>e.id===t)||e.push({id:t,value:ot[t]||t})})}),e.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[t]);return e.createElement(nt,{disabled:!s?.length,title:a,placeholder:"All",options:s,value:i,onSelect:n,onDeselect:o,...r})},dn=({title:t="Monitors",value:a,onSelect:i,onDeselect:n,...o})=>{const r=l(()=>{const e=[];return lt.forEach(({id:t,value:a})=>{e.find(e=>e.id===t)||e.push({id:t,value:a})}),e},[]);return e.createElement(nt,{disabled:!r?.length,title:t,placeholder:"All",options:r,value:a,onSelect:i,onDeselect:n,...o})},un=({namespaces:t,title:a="Namespace",value:i,onSelect:n,onDeselect:o,...r})=>{const s=l(()=>{const e=[];return t?.forEach(({name:t})=>{e.find(e=>e.id===t)||e.push({id:t,value:t})}),e},[t]);return e.createElement(nt,{disabled:!s?.length,title:a,placeholder:"Select namespace",options:s,value:i,onSelect:n,onDeselect:o,...r})},pn=({sources:t,title:a="Kind",value:i,onSelect:n,onDeselect:o,...r})=>{const s=l(()=>{const e=[];return t.forEach(({kind:t})=>{e.find(e=>e.id===t)||e.push({id:t,value:t})}),e},[t]);return e.createElement(nt,{disabled:!s?.length,title:a,placeholder:"All",options:s,value:i,onSelect:n,onDeselect:o,...r})},mn=({sources:t,title:a="Agent Injection Status",value:i,onSelect:n,onDeselect:o,disabled:r,...s})=>{const c=l(()=>{const e=[];return t.forEach(({podsAgentInjectionStatus:t})=>{const{reasonEnum:a,message:i}=t||{};a?e.find(e=>e.id===a)||e.push({id:a,value:it(a)}):i&&(e.find(e=>e.id===i)||e.push({id:i,value:i}))}),e},[t]);return e.createElement(nt,{disabled:r||!c?.length,title:a,placeholder:"All",options:c,value:i,onSelect:n,onDeselect:o,...s})},hn=d.div`
159
157
  display: flex;
160
158
  flex-direction: column;
161
159
  gap: 12px;
162
160
  padding: 12px;
163
- `,yn=d.div`
161
+ `,gn=d.div`
164
162
  padding: 12px 6px 6px 6px;
165
- `,vn=d(Oe)`
163
+ `,yn=d(Oe)`
166
164
  font-size: 14px;
167
165
  ${({$color:e})=>`color: ${e};`}
168
- `,bn=d.div`
166
+ `,vn=d.div`
169
167
  margin-left: auto;
170
- `,fn=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},xn=()=>{const i=O.useTheme(),{isVm:o}=Be(),{namespaces:r,sources:s}=z(),{selectedStreamName:c}=We(),{getItemSS:d,setItemSS:u,removeItemSS:p}=st(),{popupRef:m,popupOpen:h,setPopupOpen:g,popupPosition:y,handlePosition:v}=Ze(),{namespaces:b,kinds:f,monitors:x,languages:S,conditions:$,errors:k,onlyErrors:C,podsAgentInjectionStatus:D,setAll:T,clearAll:N,getEmptyState:E}=he(),A=l(()=>Ue(s,c),[s,c]),[F,I]=t({namespaces:b,kinds:f,monitors:x,languages:S,conditions:$,errors:k,onlyErrors:C,podsAgentInjectionStatus:D}),[M,R]=t(fn(F));a(()=>{const e=d(rt.OVERVIEW_FILTERS,E());T(e)},[]),a(()=>{if(!h){const e={namespaces:b,kinds:f,monitors:x,languages:S,conditions:$,errors:k,onlyErrors:C};I(e),R(fn(e))}},[h,b,f,x,S,$,k,C]);const L=()=>{g(!1)},j=n(null);return at(j,L),P({key:"Escape",active:h},L),e.createElement(nn,{ref:j},e.createElement(et,{label:"Filters",icon:Fa,badgeLabel:M,badgeFilled:!!M,withBorder:!0,color:"transparent",onClick:()=>{v(0,50),g(!0)}}),e.createElement(Qe,{ref:m,isOpen:h,top:y.top,left:y.left,width:"420px",footer:e.createElement(ce,null,e.createElement(vn,{variant:"primary",onClick:()=>{u(rt.OVERVIEW_FILTERS,F),T(F),R(fn(F)),g(!1)}},"Apply"),e.createElement(vn,{variant:"secondary",onClick:L},"Cancel"),e.createElement(bn,null,e.createElement(vn,{variant:"tertiary",onClick:()=>{p(rt.OVERVIEW_FILTERS),N(),I(E()),R(0),g(!1)},$color:i.text.error},"Reset")))},e.createElement(gn,null,!o&&e.createElement(pn,{namespaces:r,value:F.namespaces,onSelect:e=>I(t=>({...t,namespaces:[...t.namespaces||[],e]})),onDeselect:e=>I(t=>({...t,namespaces:(t.namespaces||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(mn,{sources:A,value:F.kinds,onSelect:e=>I(t=>({...t,kinds:[...t.kinds||[],e]})),onDeselect:e=>I(t=>({...t,kinds:(t.kinds||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(dn,{sources:A,value:F.languages,onSelect:e=>I(t=>({...t,languages:[...t.languages||[],e]})),onDeselect:e=>I(t=>({...t,languages:(t.languages||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(un,{value:F.monitors,onSelect:e=>I(t=>({...t,monitors:[...t.monitors||[],e]})),onDeselect:e=>I(t=>({...t,monitors:(t.monitors||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(sn,{sources:A,value:F.conditions,onSelect:e=>I(t=>({...t,conditions:[...t.conditions||[],e]})),onDeselect:e=>I(t=>({...t,conditions:(t.conditions||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(hn,{sources:A,value:F.podsAgentInjectionStatus,onSelect:e=>I(t=>({...t,podsAgentInjectionStatus:[...t.podsAgentInjectionStatus||[],e]})),onDeselect:e=>I(t=>({...t,podsAgentInjectionStatus:(t.podsAgentInjectionStatus||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(yn,null,e.createElement(w,{title:"Show only sources with errors",initialValue:F.onlyErrors,onChange:e=>I(t=>({...t,errors:[],onlyErrors:e}))})),e.createElement(cn,{sources:A,value:F.errors,onSelect:e=>I(t=>({...t,errors:[...t.errors||[],e]})),onDeselect:e=>I(t=>({...t,errors:(t.errors||[]).filter(t=>t.id!==e.id)})),disabled:!F.onlyErrors,showSearch:!0,required:!0,isMulti:!0}))))},Sn=d.div`
168
+ `,bn=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},fn=()=>{const i=p(),{namespaces:o,sources:r}=V(),{selectedStreamName:s}=We(),{getItemSS:c,setItemSS:d,removeItemSS:u}=st(),{popupRef:m,popupOpen:h,setPopupOpen:g,popupPosition:y,handlePosition:v}=Ze(),{namespaces:b,kinds:f,monitors:x,languages:S,conditions:$,errors:k,onlyErrors:C,podsAgentInjectionStatus:D,setAll:T,clearAll:N,getEmptyState:E}=he(),O=l(()=>Ue(r,s),[r,s]),[A,F]=t({namespaces:b,kinds:f,monitors:x,languages:S,conditions:$,errors:k,onlyErrors:C,podsAgentInjectionStatus:D}),[I,M]=t(bn(A));a(()=>{const e=c(rt.OVERVIEW_FILTERS,E());T(e)},[]),a(()=>{if(!h){const e={namespaces:b,kinds:f,monitors:x,languages:S,conditions:$,errors:k,onlyErrors:C};F(e),M(bn(e))}},[h,b,f,x,S,$,k,C]);const R=()=>{g(!1)},L=n(null);return at(L,R),P({key:"Escape",active:h},R),e.createElement(an,{ref:L},e.createElement(et,{label:"Filters",icon:Aa,badgeLabel:I,badgeFilled:!!I,withBorder:!0,color:"transparent",onClick:()=>{v(0,50),g(!0)}}),e.createElement(Qe,{ref:m,isOpen:h,top:y.top,left:y.left,width:"420px",footer:e.createElement(ce,null,e.createElement(yn,{variant:"primary",onClick:()=>{d(rt.OVERVIEW_FILTERS,A),T(A),M(bn(A)),g(!1)}},"Apply"),e.createElement(yn,{variant:"secondary",onClick:R},"Cancel"),e.createElement(vn,null,e.createElement(yn,{variant:"tertiary",onClick:()=>{u(rt.OVERVIEW_FILTERS),N(),F(E()),M(0),g(!1)},$color:i.text.error},"Reset")))},e.createElement(hn,null,e.createElement(un,{namespaces:o,value:A.namespaces,onSelect:e=>F(t=>({...t,namespaces:[...t.namespaces||[],e]})),onDeselect:e=>F(t=>({...t,namespaces:(t.namespaces||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(pn,{sources:O,value:A.kinds,onSelect:e=>F(t=>({...t,kinds:[...t.kinds||[],e]})),onDeselect:e=>F(t=>({...t,kinds:(t.kinds||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(cn,{sources:O,value:A.languages,onSelect:e=>F(t=>({...t,languages:[...t.languages||[],e]})),onDeselect:e=>F(t=>({...t,languages:(t.languages||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(dn,{value:A.monitors,onSelect:e=>F(t=>({...t,monitors:[...t.monitors||[],e]})),onDeselect:e=>F(t=>({...t,monitors:(t.monitors||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(rn,{sources:O,value:A.conditions,onSelect:e=>F(t=>({...t,conditions:[...t.conditions||[],e]})),onDeselect:e=>F(t=>({...t,conditions:(t.conditions||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(mn,{sources:O,value:A.podsAgentInjectionStatus,onSelect:e=>F(t=>({...t,podsAgentInjectionStatus:[...t.podsAgentInjectionStatus||[],e]})),onDeselect:e=>F(t=>({...t,podsAgentInjectionStatus:(t.podsAgentInjectionStatus||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(gn,null,e.createElement(w,{title:"Show only sources with errors",initialValue:A.onlyErrors,onChange:e=>F(t=>({...t,errors:[],onlyErrors:e}))})),e.createElement(sn,{sources:O,value:A.errors,onSelect:e=>F(t=>({...t,errors:[...t.errors||[],e]})),onDeselect:e=>F(t=>({...t,errors:(t.errors||[]).filter(t=>t.id!==e.id)})),disabled:!A.onlyErrors,showSearch:!0,required:!0,isMulti:!0}))))},xn=d.div`
171
169
  display: flex;
172
170
  flex-direction: column;
173
171
  gap: 24px;
174
172
  padding: 4px;
175
- `,$n=({formData:t,handleFormChange:a,formErrors:i})=>{const{dataStreams:n,selectedStreamName:o}=We(),r=l(()=>n.find(e=>e.name===t.name&&e.name!==o),[n,t.name,o]);return e.createElement(Sn,null,e.createElement(S,{name:"name",title:m.STREAM_NAME,placeholder:m.NAME_YOUR_STREAM_PLACEHOLDER,required:!0,value:t.name,onChange:({target:{value:e}})=>a("name",e),errorMessage:i.name}),r&&e.createElement(ae,{type:ie.Warning,message:m.DATA_STREAM_EXISTS_WARNING(o,r.name)}))},kn=d.div`
173
+ `,Sn=({formData:t,handleFormChange:a,formErrors:i})=>{const{dataStreams:n,selectedStreamName:o}=We(),r=l(()=>n.find(e=>e.name===t.name&&e.name!==o),[n,t.name,o]);return e.createElement(xn,null,e.createElement(S,{name:"name",title:m.STREAM_NAME,placeholder:m.NAME_YOUR_STREAM_PLACEHOLDER,required:!0,value:t.name,onChange:({target:{value:e}})=>a("name",e),errorMessage:i.name}),r&&e.createElement(ae,{type:ie.Warning,message:m.DATA_STREAM_EXISTS_WARNING(o,r.name)}))},$n=d.div`
176
174
  width: 100%;
177
175
  height: 100%;
178
176
  max-height: calc(100vh - 220px);
179
177
  overflow: overlay;
180
178
  overflow-y: auto;
181
- `,Cn=({isOpen:a,onClose:i,dataStreamName:o,updateDataStream:r})=>{const{dataStreams:c}=We(),d=n(null),[u,p]=t(!1),{formData:m,handleFormChange:h,formErrors:g,validateForm:y,resetFormData:v,loadFormWithDrawerItem:b}=ct({name:o}),f=l(()=>{if(!a)return v();const e=c?.find(e=>e.name===o);return e?b(e):v(),e},[a,c,o]),x=s((e,t)=>{h(e,t),p(!0)},[h]);return f?e.createElement(ki,{ref:d,title:f.name,icons:[Ia],hideEditTitleFromEdit:!0,isEdit:!0,isFormDirty:u,onSave:()=>{y({withAlert:!0,alertTitle:Y.Update})&&(r(o,m),p(!1),i())},onCancel:()=>{v(),p(!1),i()}},e.createElement(kn,null,e.createElement($n,{formData:m,handleFormChange:x,formErrors:g}))):null},wn=d.div`
179
+ `,kn=({isOpen:a,onClose:i,dataStreamName:o,updateDataStream:r})=>{const{dataStreams:c}=We(),d=n(null),[u,p]=t(!1),{formData:m,handleFormChange:h,formErrors:g,validateForm:y,resetFormData:v,loadFormWithDrawerItem:b}=ct({name:o}),f=l(()=>{if(!a)return v();const e=c?.find(e=>e.name===o);return e?b(e):v(),e},[a,c,o]),x=s((e,t)=>{h(e,t),p(!0)},[h]);return f?e.createElement($i,{ref:d,title:f.name,icons:[Fa],hideEditTitleFromEdit:!0,isEdit:!0,isFormDirty:u,onSave:()=>{y({withAlert:!0,alertTitle:Y.Update})&&(r(o,m),p(!1),i())},onCancel:()=>{v(),p(!1),i()}},e.createElement($n,null,e.createElement(Sn,{formData:m,handleFormChange:x,formErrors:g}))):null},Cn=d.div`
182
180
  position: relative;
183
- `,Dn=d(ce)`
181
+ `,wn=d(ce)`
184
182
  border: 1px solid ${({theme:e})=>e.colors.border};
185
183
  border-radius: 32px;
186
184
 
187
185
  & button {
188
186
  max-height: 28px;
189
187
  }
190
- `,Tn=d(E)`
188
+ `,Dn=d(E)`
191
189
  text-wrap: nowrap;
192
- `,Nn=d(tt)`
190
+ `,Tn=d(tt)`
193
191
  max-height: 240px;
194
192
  padding: 0px !important;
195
- `,En=d(ce)`
193
+ `,Nn=d(ce)`
196
194
  width: 100%;
197
- `,On=d.div`
195
+ `,En=d.div`
198
196
  width: 100%;
199
- `,An=({onClickNewDataStream:a,updateDataStream:i,deleteDataStream:n})=>{const o=O.useTheme(),{clearStore:r}=dt(),{popupRef:s,popupOpen:c,setPopupOpen:d,popupPosition:u,handlePosition:p}=Ze(),{dataStreams:m,selectedStreamName:h,setSelectedStreamName:g}=We(),[y,v]=t(""),[b,f]=t(""),[x,$]=t(""),k=l(()=>m.filter(({name:e})=>!x||e.toLowerCase().includes(x.toLowerCase())).map(({name:t})=>e.createElement(En,{key:`stream-${t}`},e.createElement(On,null,e.createElement(et,{label:t,isSelected:h===t,onClick:()=>{r(),g(t),d(!1)},color:"transparent",style:{width:"100%",justifyContent:"flex-start"}})),t!==ut&&e.createElement(pt,{onClick:()=>f(t),tooltip:j.DELETE},e.createElement(Ta,null)),e.createElement(pt,{onClick:()=>v(t),tooltip:j.EDIT},e.createElement(Da,null)))),[m,h,x]);return e.createElement(e.Fragment,null,e.createElement(wn,null,e.createElement(Dn,{$gap:0},e.createElement(Oe,{variant:"tertiary",onClick:()=>{p(0,50),d(e=>!e)}},e.createElement(Ia,{fill:o.text.info}),e.createElement(Tn,null,"Data Stream: ",h),e.createElement(mt,{extend:c}),e.createElement(Ne,{label:m.length})),e.createElement(le,{orientation:"vertical",length:"32px",thickness:2,margin:"0"}),e.createElement(ht,{onClick:()=>{r(),a()},label:j.NEW})),e.createElement(Qe,{ref:s,isOpen:c,top:u.top,left:u.left,header:e.createElement(S,{placeholder:"Search...",icon:Aa,value:x,onChange:e=>$(e.target.value)})},e.createElement(Nn,null,k))),e.createElement(V,{isOpen:""!==b,name:b,onApprove:()=>{n(b),f("")},onDeny:()=>{f("")}}),e.createElement(Cn,{isOpen:""!==y,onClose:()=>{v("")},dataStreamName:y,updateDataStream:i}))},Fn=d.div`
197
+ `,On=({onClickNewDataStream:a,updateDataStream:i,deleteDataStream:n})=>{const o=O.useTheme(),{clearStore:r}=dt(),{popupRef:s,popupOpen:c,setPopupOpen:d,popupPosition:u,handlePosition:p}=Ze(),{dataStreams:m,selectedStreamName:h,setSelectedStreamName:g}=We(),[y,v]=t(""),[b,f]=t(""),[x,$]=t(""),k=l(()=>m.filter(({name:e})=>!x||e.toLowerCase().includes(x.toLowerCase())).map(({name:t})=>e.createElement(Nn,{key:`stream-${t}`},e.createElement(En,null,e.createElement(et,{label:t,isSelected:h===t,onClick:()=>{r(),g(t),d(!1)},color:"transparent",style:{width:"100%",justifyContent:"flex-start"}})),t!==ut&&e.createElement(pt,{onClick:()=>f(t),tooltip:j.DELETE},e.createElement(Da,null)),e.createElement(pt,{onClick:()=>v(t),tooltip:j.EDIT},e.createElement(wa,null)))),[m,h,x]);return e.createElement(e.Fragment,null,e.createElement(Cn,null,e.createElement(wn,{$gap:0},e.createElement(Oe,{variant:"tertiary",onClick:()=>{p(0,50),d(e=>!e)}},e.createElement(Fa,{fill:o.text.info}),e.createElement(Dn,null,"Data Stream: ",h),e.createElement(mt,{extend:c}),e.createElement(Ne,{label:m.length})),e.createElement(le,{orientation:"vertical",length:"32px",thickness:2,margin:"0"}),e.createElement(ht,{onClick:()=>{r(),a()},label:j.NEW})),e.createElement(Qe,{ref:s,isOpen:c,top:u.top,left:u.left,header:e.createElement(S,{placeholder:"Search...",icon:Oa,value:x,onChange:e=>$(e.target.value)})},e.createElement(Tn,null,k))),e.createElement(q,{isOpen:""!==b,name:b,onApprove:()=>{n(b),f("")},onDeny:()=>{f("")}}),e.createElement(kn,{isOpen:""!==y,onClose:()=>{v("")},dataStreamName:y,updateDataStream:i}))},An=d.div`
200
198
  display: flex;
201
199
  align-items: center;
202
200
  margin: 20px 0;
203
201
  padding: 0 16px;
204
202
  gap: 8px;
205
- `,In=d.div`
203
+ `,Fn=d.div`
206
204
  margin-left: auto;
207
- `,Mn=({addEntity:t,preventSearchPopup:a,onClickNewDataStream:i,updateDataStream:n,deleteDataStream:o})=>{const{setCurrentModal:l}=Z();return e.createElement(Fn,null,e.createElement(An,{onClickNewDataStream:i,updateDataStream:n,deleteDataStream:o}),e.createElement(rn,{preventPopup:a}),e.createElement(xn,null),t&&e.createElement(In,null,e.createElement(ht,{"data-id":`add-${t}`,onClick:()=>l(t),label:`${j.ADD} ${it(t)}`,variant:"primary",textProps:{weight:900}})))},Rn=i(({isModal:t,onClickSummary:a},i)=>{const{selectedStreamName:n}=We(),{formData:l,handleFormChange:r,formErrors:s,validateForm:c}=ct({name:n});return o(i,()=>({validateForm:c,getFormValues:()=>l})),e.createElement(te,{$isNotModal:!t},e.createElement(X,{$gap:24},a&&e.createElement(gt,{onClick:a}),e.createElement(F,{title:m.NAME_YOUR_STREAM,description:m.STREAM_DESCRIPTION}),e.createElement($n,{formData:l,handleFormChange:r,formErrors:s})))});Rn.displayName=Rn.name;const Ln=({createDataStream:t})=>{const{currentModal:a,setCurrentModal:i}=Z(),{addDataStreams:o,setSelectedStreamName:l}=We(),r=a===yt.DataStream,s=()=>i(""),c=async()=>{if(d.current&&d.current.validateForm()){const e=d.current.getFormValues();t?t(e):(o([e]),l(e.name)),s()}},d=n(null);return P({key:"Enter",active:r},c),e.createElement(Q,{isOpen:r,onClose:s,header:{title:"Add Data Stream"},actionComponent:e.createElement(ee,{buttons:[{label:"DONE",variant:"primary",onClick:c}]})},e.createElement(Rn,{ref:d,isModal:!0}))},Pn=e=>Object.keys(e).filter(t=>e[t]).join(", "),jn=(e,t)=>{const{destinationType:a,disabled:i,exportedSignals:n}=e,o=[{title:m.TYPE,value:a.type},{type:h.ActiveStatus,title:m.STATUS,value:String(!i)},{type:h.Monitors,title:m.MONITORS,value:Pn(n)},{title:m.NAME,value:a.displayName}],l=vt(e,t),r=l.map(e=>({name:e.key,value:e.value}));return l.map(({key:e,name:a,value:i})=>{const{secret:l,componentProperties:s,hideFromReadData:c,customReadDataLabels:d}=t.find(t=>t.name===e)||{};if(!c?.length||!bt(c,Me(n),r)){const{type:e}=ft(s,{type:""}),t=(l||"password"===e)&&i.length?new Array(10).fill("•").join(""):"";o.push({type:h.Divider}),d?.length?d.forEach(({condition:e,...t})=>{e==i&&o.push({title:t.title,value:t.value})}):o.push({title:a,value:t||i})}}),o},Kn=({signals:t,fields:a,onChange:i,formErrors:n})=>a?.map(o=>{const{componentType:l,renderCondition:r,...s}=o;if(r&&!bt(r,t,a))return null;switch(l){case N.Input:return e.createElement(S,{key:o.name,...s,onChange:e=>i(o.name,e.target.value),errorMessage:n[o.name]});case N.Dropdown:return e.createElement(nt,{key:o.name,...s,showSearch:!0,value:{id:s.value||"",value:s.value||""},options:s.options||[],onSelect:e=>i(o.name,e.id),errorMessage:n[o.name]});case N.MultiInput:return e.createElement(T,{key:o.name,...s,value:"string"==typeof s.value?ft(s.value,[]):s.value,onChange:e=>i(o.name,JSON.stringify(e)),errorMessage:n[o.name]});case N.KeyValuePair:return e.createElement(D,{key:o.name,...s,value:"string"==typeof s.value?ft(s.value,[]):s.value,onChange:e=>i(o.name,JSON.stringify(e)),errorMessage:n[o.name]});case N.TextArea:return e.createElement(R,{key:o.name,...s,onChange:e=>i(o.name,e.target.value),errorMessage:n[o.name]});case N.Checkbox:return e.createElement(b,{key:o.name,...s,value:"true"==s.value,onChange:e=>i(o.name,String(e)),errorMessage:n[o.name]});default:return null}}),Vn=d(Oe)`
205
+ `,In=({addEntity:t,preventSearchPopup:a,onClickNewDataStream:i,updateDataStream:n,deleteDataStream:o})=>{const{isVm:l}=Me(),{setCurrentModal:r}=Z();return e.createElement(An,null,!l&&e.createElement(On,{onClickNewDataStream:i,updateDataStream:n,deleteDataStream:o}),e.createElement(ln,{preventPopup:a}),e.createElement(fn,null),t&&e.createElement(Fn,null,e.createElement(ht,{"data-id":`add-${t}`,onClick:()=>r(t),label:`${j.ADD} ${it(t)}`,variant:"primary",textProps:{weight:900}})))},Mn=i(({isModal:t,onClickSummary:a},i)=>{const{selectedStreamName:n}=We(),{formData:l,handleFormChange:r,formErrors:s,validateForm:c}=ct({name:n});return o(i,()=>({validateForm:c,getFormValues:()=>l})),e.createElement(te,{$isNotModal:!t},e.createElement(X,{$gap:24},a&&e.createElement(gt,{onClick:a}),e.createElement(F,{title:m.NAME_YOUR_STREAM,description:m.STREAM_DESCRIPTION}),e.createElement(Sn,{formData:l,handleFormChange:r,formErrors:s})))});Mn.displayName=Mn.name;const Rn=({createDataStream:t})=>{const{currentModal:a,setCurrentModal:i}=Z(),{addDataStreams:o,setSelectedStreamName:l}=We(),r=a===yt.DataStream,s=()=>i(""),c=async()=>{if(d.current&&d.current.validateForm()){const e=d.current.getFormValues();t?t(e):(o([e]),l(e.name)),s()}},d=n(null);return P({key:"Enter",active:r},c),e.createElement(Q,{isOpen:r,onClose:s,header:{title:"Add Data Stream"},actionComponent:e.createElement(ee,{buttons:[{label:"DONE",variant:"primary",onClick:c}]})},e.createElement(Mn,{ref:d,isModal:!0}))},Ln=e=>Object.keys(e).filter(t=>e[t]).join(", "),Pn=(e,t)=>{const{destinationType:a,disabled:i,exportedSignals:n}=e,o=[{title:m.TYPE,value:a.type},{type:h.ActiveStatus,title:m.STATUS,value:String(!i)},{type:h.Monitors,title:m.MONITORS,value:Ln(n)},{title:m.NAME,value:a.displayName}],l=vt(e,t),r=l.map(e=>({name:e.key,value:e.value}));return l.map(({key:e,name:a,value:i})=>{const{secret:l,componentProperties:s,hideFromReadData:c,customReadDataLabels:d}=t.find(t=>t.name===e)||{};if(!c?.length||!bt(c,Re(n),r)){const{type:e}=ft(s,{type:""}),t=(l||"password"===e)&&i.length?new Array(10).fill("•").join(""):"";o.push({type:h.Divider}),d?.length?d.forEach(({condition:e,...t})=>{e==i&&o.push({title:t.title,value:t.value})}):o.push({title:a,value:t||i})}}),o},jn=({signals:t,fields:a,onChange:i,formErrors:n})=>a?.map(o=>{const{componentType:l,renderCondition:r,...s}=o;if(r&&!bt(r,t,a))return null;switch(l){case N.Input:return e.createElement(S,{key:o.name,...s,onChange:e=>i(o.name,e.target.value),errorMessage:n[o.name]});case N.Dropdown:return e.createElement(nt,{key:o.name,...s,showSearch:!0,value:{id:s.value||"",value:s.value||""},options:s.options||[],onSelect:e=>i(o.name,e.id),errorMessage:n[o.name]});case N.MultiInput:return e.createElement(T,{key:o.name,...s,value:"string"==typeof s.value?ft(s.value,[]):s.value,onChange:e=>i(o.name,JSON.stringify(e)),errorMessage:n[o.name]});case N.KeyValuePair:return e.createElement(D,{key:o.name,...s,value:"string"==typeof s.value?ft(s.value,[]):s.value,onChange:e=>i(o.name,JSON.stringify(e)),errorMessage:n[o.name]});case N.TextArea:return e.createElement(R,{key:o.name,...s,onChange:e=>i(o.name,e.target.value),errorMessage:n[o.name]});case N.Checkbox:return e.createElement(b,{key:o.name,...s,value:"true"==s.value,onChange:e=>i(o.name,String(e)),errorMessage:n[o.name]});default:return null}}),Kn=d(Oe)`
208
206
  display: flex;
209
207
  align-items: center;
210
208
  gap: 8px;
@@ -218,43 +216,43 @@ import e,{useState as t,useEffect as a,forwardRef as i,useRef as n,useImperative
218
216
  `:u`
219
217
  background-color: transparent;
220
218
  `}
221
- `,qn=({destination:a,validateForm:i,status:n,testConnection:o,onSuccess:l,onError:r})=>{const s=O.useTheme(),{selectedStreamName:c}=We(),[d,u]=t(!1),p=n?me(n,s):void 0;return e.createElement(Vn,{$status:n,variant:"secondary",onClick:async()=>{if(i()){u(!0);const e=await o({...a,currentStreamName:c});e&&(e.succeeded?l(e):r(e)),u(!1)}}},d?e.createElement(Ae,null):p?e.createElement(p,null):null,e.createElement(E,{family:"secondary",decoration:"underline",size:14,color:n?s.text[n]:void 0},d?"Checking":n===ie.Success?"Connection OK":"error"===n?"Connection Failed":"Test Connection"))},Hn=d(X)`
219
+ `,qn=({destination:a,validateForm:i,status:n,testConnection:o,onSuccess:l,onError:r})=>{const s=O.useTheme(),{selectedStreamName:c}=We(),[d,u]=t(!1),p=n?me(n,s):void 0;return e.createElement(Kn,{$status:n,variant:"secondary",onClick:async()=>{if(i()){u(!0);const e=await o({...a,currentStreamName:c});e&&(e.succeeded?l(e):r(e)),u(!1)}}},d?e.createElement(Ae,null):p?e.createElement(p,null):null,e.createElement(E,{family:"secondary",decoration:"underline",size:14,color:n?s.text[n]:void 0},d?"Checking":n===ie.Success?"Connection OK":"error"===n?"Connection Failed":"Test Connection"))},Hn=d(X)`
222
220
  align-items: unset;
223
221
  padding: 0 4px;
224
222
  `,zn=d.div`
225
223
  display: flex;
226
224
  flex-direction: column;
227
225
  gap: 12px;
228
- `,Bn=d(ce)`
226
+ `,Vn=d(ce)`
229
227
  justify-content: space-between;
230
- `,Wn=d(E)`
228
+ `,Bn=d(E)`
231
229
  margin-bottom: 12px;
232
- `,_n=({isUpdate:i,categoryItem:o,formData:r,formErrors:s,validateForm:c,handleFormChange:d,dynamicFields:u,setDynamicFields:p,testConnection:h})=>{const{type:g,displayName:y,supportedSignals:v,testConnectionSupported:b}=o||{},f=O.useTheme(),[x,$]=t(!1),[k,C]=t(!1),[w,D]=t(void 0),T=n(!1);a(()=>{if(u.length&&!T.current){T.current=!0;let e=!1;for(let t=0;t<u.length;t++){const{required:a,value:i}=u[t];if(a){if([void 0,null,""].includes(i)){e=!1;break}e=!0}}$(e)}},[u,k]);const N=l(()=>{const{logs:e,metrics:t,traces:a}=v||{},i=[];return e?.supported&&i.push(xt.Logs),t?.supported&&i.push(xt.Metrics),a?.supported&&i.push(xt.Traces),i},[v]),E=l(()=>{const{logs:e,metrics:t,traces:a}=r.exportedSignals||{},i=[];return e&&i.push(xt.Logs),t&&i.push(xt.Metrics),a&&i.push(xt.Traces),i},[r.exportedSignals]),R=()=>{$(!1),C(!0),D(void 0)};return e.createElement(Hn,{$gap:24},e.createElement(Hn,{$gap:12},e.createElement(F,{title:i?"Update destination":"Create destination",description:`Connect ${y} with Odigos.`,actionButton:b&&e.createElement(qn,{destination:r,validateForm:c,status:w?.type,testConnection:h,onError:e=>{C(!1),D({type:ie.Error,title:e?.reason||"Connection failed",message:e?.message||"Please check your input and try again."})},onSuccess:e=>{C(!1),D({type:ie.Success,title:e?.reason||"Connection succeeded",message:e?.message||""})}})}),e.createElement(zn,null,b&&w&&e.createElement(ae,{type:w.type,title:w.title,message:w.message}),x&&!w&&!i&&e.createElement(ae,{type:ie.Default,message:`Odigos autocompleted ${y} destination details.`})),e.createElement(le,null)),e.createElement(Bn,null,e.createElement(M,{title:i?"":"This connection will monitor:",required:!0,allowedSignals:N,selectedSignals:E,setSelectedSignals:e=>{R(),d("exportedSignals",{logs:e.includes(xt.Logs),metrics:e.includes(xt.Metrics),traces:e.includes(xt.Traces)})},errorMessage:s.exportedSignals}),!i&&e.createElement(I,{endpoint:`/backends/${g}`})),i&&e.createElement("div",null,e.createElement(Wn,null,"Status"),e.createElement(A,{options:[{icon:Ca,label:m.ENABLED,value:!1,selectedBgColor:f.text.success+O.opacity.hex["050"]},{icon:wa,label:m.DISABLED,value:!0,selectedBgColor:f.text.error+O.opacity.hex["050"]}],selected:r.disabled,setSelected:e=>d("disabled",e)})),!i&&e.createElement(S,{title:"Destination name",placeholder:"Enter destination name",value:r.name,onChange:e=>{R(),d("name",e.target.value)},errorMessage:s.name}),e.createElement(Kn,{signals:E,fields:u,onChange:(e,t)=>{R(),p(a=>{const i=[...a],n=i.findIndex(t=>t.name===e);return-1!==n&&(i[n]={...i[n],value:t}),i})},formErrors:s}))},Jn=d.div`
230
+ `,Wn=({isUpdate:i,categoryItem:o,formData:r,formErrors:s,validateForm:c,handleFormChange:d,dynamicFields:u,setDynamicFields:p,testConnection:h})=>{const{type:g,displayName:y,supportedSignals:v,testConnectionSupported:b}=o||{},f=O.useTheme(),[x,$]=t(!1),[k,C]=t(!1),[w,D]=t(void 0),T=n(!1);a(()=>{if(u.length&&!T.current){T.current=!0;let e=!1;for(let t=0;t<u.length;t++){const{required:a,value:i}=u[t];if(a){if([void 0,null,""].includes(i)){e=!1;break}e=!0}}$(e)}},[u,k]);const N=l(()=>{const{logs:e,metrics:t,traces:a}=v||{},i=[];return e?.supported&&i.push(xt.Logs),t?.supported&&i.push(xt.Metrics),a?.supported&&i.push(xt.Traces),i},[v]),E=l(()=>{const{logs:e,metrics:t,traces:a}=r.exportedSignals||{},i=[];return e&&i.push(xt.Logs),t&&i.push(xt.Metrics),a&&i.push(xt.Traces),i},[r.exportedSignals]),R=()=>{$(!1),C(!0),D(void 0)};return e.createElement(Hn,{$gap:24},e.createElement(Hn,{$gap:12},e.createElement(F,{title:i?"Update destination":"Create destination",description:`Connect ${y} with Odigos.`,actionButton:b&&e.createElement(qn,{destination:r,validateForm:c,status:w?.type,testConnection:h,onError:e=>{C(!1),D({type:ie.Error,title:e?.reason||"Connection failed",message:e?.message||"Please check your input and try again."})},onSuccess:e=>{C(!1),D({type:ie.Success,title:e?.reason||"Connection succeeded",message:e?.message||""})}})}),e.createElement(zn,null,b&&w&&e.createElement(ae,{type:w.type,title:w.title,message:w.message}),x&&!w&&!i&&e.createElement(ae,{type:ie.Default,message:`Odigos autocompleted ${y} destination details.`})),e.createElement(le,null)),e.createElement(Vn,null,e.createElement(M,{title:i?"":"This connection will monitor:",required:!0,allowedSignals:N,selectedSignals:E,setSelectedSignals:e=>{R(),d("exportedSignals",{logs:e.includes(xt.Logs),metrics:e.includes(xt.Metrics),traces:e.includes(xt.Traces)})},errorMessage:s.exportedSignals}),!i&&e.createElement(I,{endpoint:`/backends/${g}`})),i&&e.createElement("div",null,e.createElement(Bn,null,"Status"),e.createElement(A,{options:[{icon:ka,label:m.ENABLED,value:!1,selectedBgColor:f.text.success+O.opacity.hex["050"]},{icon:Ca,label:m.DISABLED,value:!0,selectedBgColor:f.text.error+O.opacity.hex["050"]}],selected:r.disabled,setSelected:e=>d("disabled",e)})),!i&&e.createElement(S,{title:"Destination name",placeholder:"Enter destination name",value:r.name,onChange:e=>{R(),d("name",e.target.value)},errorMessage:s.name}),e.createElement(jn,{signals:E,fields:u,onChange:(e,t)=>{R(),p(a=>{const i=[...a],n=i.findIndex(t=>t.name===e);return-1!==n&&(i[n]={...i[n],value:t}),i})},formErrors:s}))},_n=d.div`
233
231
  width: 100%;
234
232
  height: 100%;
235
233
  max-height: calc(100vh - 220px);
236
234
  overflow: overlay;
237
235
  overflow-y: auto;
238
- `,Un=d.div`
236
+ `,Jn=d.div`
239
237
  display: flex;
240
238
  flex-direction: column;
241
239
  gap: 12px;
242
- `,Gn=({categories:i,updateDestination:o,deleteDestination:r,testConnection:s})=>{const{destinations:c}=z(),{selectedStreamName:d}=We(),{drawerType:u,drawerEntityId:p}=L(),h=l(()=>Ye(c,d),[c,d]),g=n(null),y=u===H.Destination,[v,b]=t(!1),[f,x]=t(!1),{formData:S,formErrors:$,handleFormChange:k,resetFormData:C,validateForm:w,loadFormWithDrawerItem:D,yamlFields:T,setYamlFields:N,dynamicFields:E,setDynamicFields:O}=St({}),A=l(()=>{if(p)return h?.find(e=>W(e)===p)},[p,h]);if(a(()=>{y&&A?(N($t(i,A)),D(A)):C()},[y,A,i]),!A)return null;const F=i.flatMap(e=>e.items).find(e=>e.type===A.destinationType.type),{icon:I,iconSrc:M}=F?je(F?.type):{icon:void 0,iconSrc:void 0};return e.createElement(ki,{ref:g,title:A.name||A.destinationType.displayName,icons:I?[I]:void 0,iconSrcs:M?[M]:void 0,isEdit:v,isFormDirty:f,onEdit:e=>{b("boolean"!=typeof e||e)},onSave:async e=>{if(w({withAlert:!0,alertTitle:Y.Update})){const t=e!==A.destinationType.displayName?e:"";k("name",t),o(p,{...S,name:t}),b(!1),x(!1)}},onDelete:async()=>{r(p),b(!1),x(!1),g.current?.closeDrawer()},onCancel:()=>{b(!1),x(!1),D(A)},isLastItem:1===h.length},v?e.createElement(Jn,null,e.createElement(_n,{isUpdate:!0,categoryItem:F,formData:S,formErrors:$,handleFormChange:(...e)=>{x(!0),k(...e)},dynamicFields:E,setDynamicFields:(...e)=>{x(!0),O(...e)},validateForm:w,testConnection:s})):e.createElement(Un,null,A.conditions?.length?e.createElement(U,{conditions:A.conditions}):null,e.createElement(G,{title:m.DESTINATION_DETAILS,data:A?jn(A,T):[]})))},Yn=d.div`
240
+ `,Un=({categories:i,updateDestination:o,deleteDestination:r,testConnection:s})=>{const{destinations:c}=V(),{selectedStreamName:d}=We(),{drawerType:u,drawerEntityId:p}=L(),h=l(()=>Ye(c,d),[c,d]),g=n(null),y=u===z.Destination,[v,b]=t(!1),[f,x]=t(!1),{formData:S,formErrors:$,handleFormChange:k,resetFormData:C,validateForm:w,loadFormWithDrawerItem:D,yamlFields:T,setYamlFields:N,dynamicFields:E,setDynamicFields:O}=St({}),A=l(()=>{if(p)return h?.find(e=>W(e)===p)},[p,h]);if(a(()=>{y&&A?(N($t(i,A)),D(A)):C()},[y,A,i]),!A)return null;const F=i.flatMap(e=>e.items).find(e=>e.type===A.destinationType.type),{icon:I,iconSrc:M}=F?Ke(F?.type):{icon:void 0,iconSrc:void 0};return e.createElement($i,{ref:g,title:A.name||A.destinationType.displayName,icons:I?[I]:void 0,iconSrcs:M?[M]:void 0,isEdit:v,isFormDirty:f,onEdit:e=>{b("boolean"!=typeof e||e)},onSave:async e=>{if(w({withAlert:!0,alertTitle:Y.Update})){const t=e!==A.destinationType.displayName?e:"";k("name",t),o(p,{...S,name:t}),b(!1),x(!1)}},onDelete:async()=>{r(p),b(!1),x(!1),g.current?.closeDrawer()},onCancel:()=>{b(!1),x(!1),D(A)},isLastItem:1===h.length},v?e.createElement(_n,null,e.createElement(Wn,{isUpdate:!0,categoryItem:F,formData:S,formErrors:$,handleFormChange:(...e)=>{x(!0),k(...e)},dynamicFields:E,setDynamicFields:(...e)=>{x(!0),O(...e)},validateForm:w,testConnection:s})):e.createElement(Jn,null,A.conditions?.length?e.createElement(U,{conditions:A.conditions}):null,e.createElement(G,{title:m.DESTINATION_DETAILS,data:A?Pn(A,T):[]})))},Gn=d.div`
243
241
  display: flex;
244
242
  flex-direction: column;
245
243
  gap: 12px;
246
- `,Xn=({items:t,onSelectNew:a,onSelectConfigured:i,isLoadingForDestinationIds:n})=>{const{configuredDestinationsUpdateOnly:o}=dt();return t.map(t=>{const l=t.name===Ct.EXISTS.TITLE;return e.createElement(Yn,{key:`category-${t.name}`},e.createElement(F,{size:"small",icon:t.icon,title:kt(t.name),description:t.description}),t.items.map(r=>{const s=`select-${t.name.replaceAll(" ","")}-destination-${r.type}`,c=Object.keys(r.supportedSignals).filter(e=>r.supportedSignals[e].supported),{icon:d,iconSrc:u}=je(r.type),p=r.selected||o.some(e=>e.id===r.id),m=!!n.find(e=>e===r.id),h=l?()=>i(r.id):()=>a(r);return e.createElement(Ie,{key:s,"data-id":s,title:r.displayName,hoverText:j.SELECT,onClick:h,iconProps:{icon:d,iconSrc:u},visualProps:{monitors:c,monitorsWithLabels:!0},checkboxProps:{withCheckbox:l,isChecked:p,isLoading:m,onCheckboxChange:()=>i(r.id)}})}))})},Zn=d.div`
244
+ `,Yn=({items:t,onSelectNew:a,onSelectConfigured:i,isLoadingForDestinationIds:n})=>{const{configuredDestinationsUpdateOnly:o}=dt();return t.map(t=>{const l=t.name===Ct.EXISTS.TITLE;return e.createElement(Gn,{key:`category-${t.name}`},e.createElement(F,{size:"small",icon:t.icon,title:kt(t.name),description:t.description}),t.items.map(r=>{const s=`select-${t.name.replaceAll(" ","")}-destination-${r.type}`,c=Object.keys(r.supportedSignals).filter(e=>r.supportedSignals[e].supported),{icon:d,iconSrc:u}=Ke(r.type),p=r.selected||o.some(e=>e.id===r.id),m=!!n.find(e=>e===r.id),h=l?()=>i(r.id):()=>a(r);return e.createElement(Ie,{key:s,"data-id":s,title:r.displayName,hoverText:j.SELECT,onClick:h,iconProps:{icon:d,iconSrc:u},visualProps:{monitors:c,monitorsWithLabels:!0},checkboxProps:{withCheckbox:l,isChecked:p,isLoading:m,onCheckboxChange:()=>i(r.id)}})}))})},Xn=d.div`
247
245
  display: flex;
248
246
  flex-direction: column;
249
247
  gap: 24px;
250
- `,Qn=d.div`
248
+ `,Zn=d.div`
251
249
  display: flex;
252
250
  align-items: center;
253
251
  gap: 12px;
254
- `,eo=d.div`
252
+ `,Qn=d.div`
255
253
  width: 170px;
256
254
  margin-right: 8px;
257
- `,to=d.div`
255
+ `,eo=d.div`
258
256
  display: flex;
259
257
  flex-direction: column;
260
258
  align-self: stretch;
@@ -265,18 +263,18 @@ import e,{useState as t,useEffect as a,forwardRef as i,useRef as n,useImperative
265
263
  @media (height < 800px) {
266
264
  max-height: calc(100vh - 400px);
267
265
  }
268
- `,ao=d(Zn)`
266
+ `,to=d(Xn)`
269
267
  margin-top: 80px;
270
- `,{MANAGED:io,SELF_HOSTED:no,DETECTED:oo,EXISTS:lo}=Ct,ro=[{value:"All types",id:"all"},{value:io.TITLE,id:io.TITLE},{value:no.TITLE,id:no.TITLE},{value:oo.TITLE,id:oo.TITLE},{value:lo.TITLE,id:lo.TITLE}],so=ro[0],co=[xt.Logs,xt.Metrics,xt.Traces],uo=(e,t,a)=>e.map(e=>{const{type:i,displayName:n}=e.destinationType,o=e.dataStreamNames?.includes(t),l=a.has(e.id);return{id:e.id,type:i,displayName:n,selected:o||l,fields:[],testConnectionSupported:!1,supportedSignals:{[xt.Logs]:{supported:e.exportedSignals.logs},[xt.Metrics]:{supported:e.exportedSignals.metrics},[xt.Traces]:{supported:e.exportedSignals.traces}}}}),po=({hidden:a,categories:i,potentialDestinations:n,onSelectNew:o,onSelectConfigured:r,isLoadingForDestinationIds:s})=>{const{destinations:c}=z(),{selectedStreamName:d}=We(),{configuredDestinations:u,configuredDestinationsUpdateOnly:p}=dt(),[m,h]=t(""),[g,y]=t(so),[v,b]=t(co),f=l(()=>{const e=wt(i);return e.unshift({name:lo.TITLE,description:lo.DESCRIPTION,icon:Ma,items:uo(c,d,new Set(u.concat(p).map(e=>e.id)))}),e.unshift({name:oo.TITLE,description:oo.DESCRIPTION,icon:Ra,items:n}),e.map(e=>{const t=e.items.filter(t=>{const a=!m||t.displayName.toLowerCase().includes(m.toLowerCase()),i="all"===g.id||g.id===e.name,n=v.some(e=>t.supportedSignals[e.toLowerCase()]?.supported);return a&&i&&n});return{...e,items:t}}).filter(({items:e})=>!!e.length)},[i,n,c,m,g,v,d,u,p]);return a?null:e.createElement(Zn,null,e.createElement(F,{title:"Choose destination",description:"Add backend destination you want to connect with Odigos."}),e.createElement(Qn,null,e.createElement(eo,null,e.createElement(S,{placeholder:"Search...",icon:Aa,value:m,onChange:({target:{value:e}})=>h(e)})),e.createElement(eo,null,e.createElement(nt,{options:ro,value:g,onSelect:y,onDeselect:()=>{}})),e.createElement(M,{title:"",selectedSignals:v,setSelectedSignals:b})),e.createElement(le,null),f.length?e.createElement(to,null,e.createElement(Xn,{items:f,onSelectNew:e=>o(e,v),onSelectConfigured:r,isLoadingForDestinationIds:s})):e.createElement(ao,null,e.createElement(De,{title:"No destinations found"})))},mo=d.div`
268
+ `,{MANAGED:ao,SELF_HOSTED:io,DETECTED:no,EXISTS:oo}=Ct,lo=[{value:"All types",id:"all"},{value:ao.TITLE,id:ao.TITLE},{value:io.TITLE,id:io.TITLE},{value:no.TITLE,id:no.TITLE},{value:oo.TITLE,id:oo.TITLE}],ro=lo[0],so=[xt.Logs,xt.Metrics,xt.Traces],co=(e,t,a)=>e.map(e=>{const{type:i,displayName:n}=e.destinationType,o=e.dataStreamNames?.includes(t),l=a.has(e.id);return{id:e.id,type:i,displayName:n,selected:o||l,fields:[],testConnectionSupported:!1,supportedSignals:{[xt.Logs]:{supported:e.exportedSignals.logs},[xt.Metrics]:{supported:e.exportedSignals.metrics},[xt.Traces]:{supported:e.exportedSignals.traces}}}}),uo=({hidden:a,categories:i,potentialDestinations:n,onSelectNew:o,onSelectConfigured:r,isLoadingForDestinationIds:s})=>{const{destinations:c}=V(),{selectedStreamName:d}=We(),{configuredDestinations:u,configuredDestinationsUpdateOnly:p}=dt(),[m,h]=t(""),[g,y]=t(ro),[v,b]=t(so),f=l(()=>{const e=wt(i);return e.unshift({name:oo.TITLE,description:oo.DESCRIPTION,icon:Ia,items:co(c,d,new Set(u.concat(p).map(e=>e.id)))}),e.unshift({name:no.TITLE,description:no.DESCRIPTION,icon:Ma,items:n}),e.map(e=>{const t=e.items.filter(t=>{const a=!m||t.displayName.toLowerCase().includes(m.toLowerCase()),i="all"===g.id||g.id===e.name,n=v.some(e=>t.supportedSignals[e.toLowerCase()]?.supported);return a&&i&&n});return{...e,items:t}}).filter(({items:e})=>!!e.length)},[i,n,c,m,g,v,d,u,p]);return a?null:e.createElement(Xn,null,e.createElement(F,{title:"Choose destination",description:"Add backend destination you want to connect with Odigos."}),e.createElement(Zn,null,e.createElement(Qn,null,e.createElement(S,{placeholder:"Search...",icon:Oa,value:m,onChange:({target:{value:e}})=>h(e)})),e.createElement(Qn,null,e.createElement(nt,{options:lo,value:g,onSelect:y,onDeselect:()=>{}})),e.createElement(M,{title:"",selectedSignals:v,setSelectedSignals:b})),e.createElement(le,null),f.length?e.createElement(eo,null,e.createElement(Yn,{items:f,onSelectNew:e=>o(e,v),onSelectConfigured:r,isLoadingForDestinationIds:s})):e.createElement(to,null,e.createElement(De,{title:"No destinations found"})))},po=d.div`
271
269
  display: flex;
272
- `,ho=d.div`
270
+ `,mo=d.div`
273
271
  border-right: 1px solid ${({theme:e})=>e.colors.border};
274
272
  padding: 32px;
275
273
  width: 200px;
276
274
  @media (max-width: 1050px) {
277
275
  display: none;
278
276
  }
279
- `,go=({isOnboarding:a,categories:i,potentialDestinations:n,createDestination:o,updateDestination:l,deleteDestination:r,testConnection:s})=>{const{destinations:c}=z(),{selectedStreamName:d}=We(),{currentModal:u,setCurrentModal:p}=Z(),{addConfiguredDestination:h,addConfiguredDestinationUpdateOnly:g,removeConfiguredDestinationUpdateOnly:y,configuredDestinationsUpdateOnly:v}=dt(),b=u===H.Destination,[f,x]=t(void 0),{formData:S,formErrors:$,handleFormChange:k,resetFormData:C,validateForm:w,setYamlFields:D,dynamicFields:T,setDynamicFields:N,loadFormWithDrawerItem:E}=St({supportedSignals:f?.supportedSignals,preLoadedFields:f?.fields}),[O,A]=t([]),F=e=>{const t={};return e||T.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:f.type,displayName:f.displayName,supportedSignals:{logs:{supported:!1},metrics:{supported:!1},traces:{supported:!1}}}}},I=async e=>{if(a&&!e){const e=F();h(e)}else if(a&&e){const t=F(e);v.some(t=>t.id===e.id)?y(e):g(t)}else if(a||e){if(!a&&e){const t=F(e),a=t.dataStreamNames.some(e=>e===d);A(t=>[...t,e.id]),a?await r(e.id):await l(e.id,E(t)),A(t=>t.filter(t=>t!==e.id))}}else o(S)},M=()=>{C(),x(void 0),p("")},R=()=>{C(),x(void 0)},L=async()=>{if(f){if(!w({withAlert:!a,alertTitle:Y.Create}))return null;I()}M()};return P({key:"Enter",active:b},()=>L()),e.createElement(Q,{isOpen:b,onClose:M,header:{title:m.ADD_DESTINATION},actionComponent:e.createElement(ee,{buttons:(()=>{const t=[{label:"DONE",variant:"primary",onClick:L}];return f&&t.unshift({label:"BACK",icon:()=>e.createElement(La,{rotate:-90}),variant:"secondary",onClick:R}),t})()})},e.createElement(mo,null,e.createElement(ho,null,e.createElement(Dt,{currentStep:f?2:1,data:[{stepNumber:1,title:m.DESTINATIONS},{stepNumber:2,title:m.CONNECTION}]})),e.createElement(te,{style:{margin:"32px 24px 12px 24px"}},e.createElement(po,{hidden:void 0!==f,categories:i,potentialDestinations:n,onSelectNew:(e,t)=>{C(),k("type",e?.type||""),k("currentStreamName",d);const a={logs:!1,metrics:!1,traces:!1};t.filter(t=>e.supportedSignals[t].supported).forEach(e=>a[e]=!0),k("exportedSignals",a),D(e?.fields||[]),x(e)},onSelectConfigured:e=>{const t=c.find(t=>t.id===e);t&&I(t)},isLoadingForDestinationIds:O}),f&&e.createElement(_n,{categoryItem:f,formData:S,formErrors:$,handleFormChange:k,dynamicFields:T,setDynamicFields:N,validateForm:w,testConnection:s}))))},yo=d.div`
277
+ `,ho=({isOnboarding:a,categories:i,potentialDestinations:n,createDestination:o,updateDestination:l,deleteDestination:r,testConnection:s})=>{const{destinations:c}=V(),{selectedStreamName:d}=We(),{currentModal:u,setCurrentModal:p}=Z(),{addConfiguredDestination:h,addConfiguredDestinationUpdateOnly:g,removeConfiguredDestinationUpdateOnly:y,configuredDestinationsUpdateOnly:v}=dt(),b=u===z.Destination,[f,x]=t(void 0),{formData:S,formErrors:$,handleFormChange:k,resetFormData:C,validateForm:w,setYamlFields:D,dynamicFields:T,setDynamicFields:N,loadFormWithDrawerItem:E}=St({supportedSignals:f?.supportedSignals,preLoadedFields:f?.fields}),[O,A]=t([]),F=e=>{const t={};return e||T.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:f.type,displayName:f.displayName,supportedSignals:{logs:{supported:!1},metrics:{supported:!1},traces:{supported:!1}}}}},I=async e=>{if(a&&!e){const e=F();h(e)}else if(a&&e){const t=F(e);v.some(t=>t.id===e.id)?y(e):g(t)}else if(a||e){if(!a&&e){const t=F(e),a=t.dataStreamNames.some(e=>e===d);A(t=>[...t,e.id]),a?await r(e.id):await l(e.id,E(t)),A(t=>t.filter(t=>t!==e.id))}}else o(S)},M=()=>{C(),x(void 0),p("")},R=()=>{C(),x(void 0)},L=async()=>{if(f){if(!w({withAlert:!a,alertTitle:Y.Create}))return null;I()}M()};return P({key:"Enter",active:b},()=>L()),e.createElement(Q,{isOpen:b,onClose:M,header:{title:m.ADD_DESTINATION},actionComponent:e.createElement(ee,{buttons:(()=>{const t=[{label:"DONE",variant:"primary",onClick:L}];return f&&t.unshift({label:"BACK",icon:()=>e.createElement(Ra,{rotate:-90}),variant:"secondary",onClick:R}),t})()})},e.createElement(po,null,e.createElement(mo,null,e.createElement(Dt,{currentStep:f?2:1,data:[{stepNumber:1,title:m.DESTINATIONS},{stepNumber:2,title:m.CONNECTION}]})),e.createElement(te,{style:{margin:"32px 24px 12px 24px"}},e.createElement(uo,{hidden:void 0!==f,categories:i,potentialDestinations:n,onSelectNew:(e,t)=>{C(),k("type",e?.type||""),k("currentStreamName",d);const a={logs:!1,metrics:!1,traces:!1};t.filter(t=>e.supportedSignals[t].supported).forEach(e=>a[e]=!0),k("exportedSignals",a),D(e?.fields||[]),x(e)},onSelectConfigured:e=>{const t=c.find(t=>t.id===e);t&&I(t)},isLoadingForDestinationIds:O}),f&&e.createElement(Wn,{categoryItem:f,formData:S,formErrors:$,handleFormChange:k,dynamicFields:T,setDynamicFields:N,validateForm:w,testConnection:s}))))},go=d.div`
280
278
  display: flex;
281
279
  flex-direction: column;
282
280
  align-items: center;
@@ -285,7 +283,7 @@ import e,{useState as t,useEffect as a,forwardRef as i,useRef as n,useImperative
285
283
  max-height: calc(100vh - 310px);
286
284
  height: fit-content;
287
285
  overflow-y: scroll;
288
- `,vo=({categories:t,withDelete:a})=>{const{configuredDestinations:i,configuredDestinationsUpdateOnly:n}=dt();return i.length||n.length?e.createElement(yo,null,i.concat(n).map((o,l)=>e.createElement(bo,{key:`configured-destination-${o.destinationType.type}-${l}`,"data-id":`configured-destination-${o.destinationType.type}`,item:o,yamlFields:$t(t,o),isLastItem:i.length+n.length===1,withDelete:a}))):e.createElement(we,null,e.createElement(De,{title:"No destinations",subTitle:"Please add a destination"}))},bo=({item:a,yamlFields:i,isLastItem:n,withDelete:o})=>{const[r,s]=t(!1),{icon:c,iconSrc:d}=je(a.destinationType.type),{removeConfiguredDestination:u,removeConfiguredDestinationUpdateOnly:p}=dt(),m=l(()=>vt(a,i).map(e=>({title:e.name,value:e.value})),[a,i]);return e.createElement(e.Fragment,null,e.createElement(Ie,{title:a.name||a.destinationType.displayName,subTitle:a.destinationType.type,iconProps:{icon:c,iconSrc:d},visualProps:{monitors:Me(a.exportedSignals),monitorsWithLabels:!0},extendableProps:{withExtend:!0,renderExtended:()=>e.createElement(Tt,{data:m})},renderActions:o?()=>e.createElement(pt,{onClick:()=>s(!0)},e.createElement(Ta,null)):void 0}),o&&e.createElement(V,{isOpen:r,name:a.destinationType.displayName||a.name,type:H.Destination,isLastItem:n,onApprove:()=>{a.id?p(a):u(a)},onDeny:()=>s(!1)}))},fo=d(Oe)`
286
+ `,yo=({categories:t,withDelete:a})=>{const{configuredDestinations:i,configuredDestinationsUpdateOnly:n}=dt();return i.length||n.length?e.createElement(go,null,i.concat(n).map((o,l)=>e.createElement(vo,{key:`configured-destination-${o.destinationType.type}-${l}`,"data-id":`configured-destination-${o.destinationType.type}`,item:o,yamlFields:$t(t,o),isLastItem:i.length+n.length===1,withDelete:a}))):e.createElement(we,null,e.createElement(De,{title:"No destinations",subTitle:"Please add a destination"}))},vo=({item:a,yamlFields:i,isLastItem:n,withDelete:o})=>{const[r,s]=t(!1),{icon:c,iconSrc:d}=Ke(a.destinationType.type),{removeConfiguredDestination:u,removeConfiguredDestinationUpdateOnly:p}=dt(),m=l(()=>vt(a,i).map(e=>({title:e.name,value:e.value})),[a,i]);return e.createElement(e.Fragment,null,e.createElement(Ie,{title:a.name||a.destinationType.displayName,subTitle:a.destinationType.type,iconProps:{icon:c,iconSrc:d},visualProps:{monitors:Re(a.exportedSignals),monitorsWithLabels:!0},extendableProps:{withExtend:!0,renderExtended:()=>e.createElement(Tt,{data:m})},renderActions:o?()=>e.createElement(pt,{onClick:()=>s(!0)},e.createElement(Da,null)):void 0}),o&&e.createElement(q,{isOpen:r,name:a.destinationType.displayName||a.name,type:z.Destination,isLastItem:n,onApprove:()=>{a.id?p(a):u(a)},onDeny:()=>s(!1)}))},bo=d(Oe)`
289
287
  display: flex;
290
288
  align-items: center;
291
289
  justify-content: center;
@@ -294,7 +292,7 @@ import e,{useState as t,useEffect as a,forwardRef as i,useRef as n,useImperative
294
292
  padding: 32px;
295
293
  border-radius: 16px;
296
294
  border-style: dashed !important;
297
- `,xo=({isSourcesListEmpty:t,goToSources:a,categories:i,potentialDestinations:n,testConnection:o,onClickSummary:l})=>{const r=O.useTheme(),{setCurrentModal:s}=Z(),{configuredDestinations:c,configuredDestinationsUpdateOnly:d}=dt();return e.createElement(e.Fragment,null,e.createElement(te,{$isNotModal:!0},e.createElement(X,{$gap:12},e.createElement(X,{$gap:24},l&&e.createElement(gt,{onClick:l}),e.createElement(F,{title:m.ADD_DESTINATIONS,badgeLabel:c.length+d.length,description:m.ADD_DESTINATION_DESCRIPTION}),t&&e.createElement(ae,{type:ie.Warning,message:m.NO_SOURCES_GO_BACK,action:{label:m.SELECT_SOURCES,onClick:a}}),e.createElement(fo,{variant:"secondary",onClick:()=>s(H.Destination)},e.createElement(Ea,null),e.createElement(E,{color:r.colors.secondary,size:14,decoration:"underline",family:"secondary"},m.ADD_DESTINATION))),e.createElement(vo,{categories:i,withDelete:!0}))),e.createElement(go,{isOnboarding:!0,categories:i,potentialDestinations:n,updateDestination:async()=>{},createDestination:async()=>{},deleteDestination:async()=>{},testConnection:o}))},So=[{key:"icon",title:""},{key:"name",title:m.NAME,sortable:!0},{key:"type",title:m.TYPE,sortable:!0},{key:"signals",title:m.MONITORS},{key:"active-status",title:m.STATUS},{key:"conditions",title:"Conditions"},{key:"throughput",title:"Throughput",sortable:!0}],$o=({metrics:t,maxHeight:a,maxWidth:i})=>{const n=O.useTheme(),o=he(),{selectedStreamName:r}=We(),{setDrawerType:s,setDrawerEntityId:c}=L(),{destinations:d,destinationsLoading:u}=z(),p=l(()=>Ye(d,r),[d,r]),h=l(()=>Ii({instrumentationRules:[],sources:[],actions:[],destinations:Ge(p,o),searchText:o.searchText,selectedCategory:H.Destination}).searchResults.find(({category:e})=>e===H.Destination)?.entities||[],[p,o]),g=l(()=>h.map(a=>{const{hasErrors:i,hasWarnings:o,hasDisableds:l}=re(a.conditions||[]),{icon:r,iconSrc:d}=je(a.destinationType.type);return{status:i?ie.Error:o?ie.Warning:void 0,faded:l,onClick:()=>{s(H.Destination),c(a.id)},cells:[{columnKey:"icon",component:()=>e.createElement(ye,{icon:r,src:d})},{columnKey:"name",value:ve(a,H.Destination,{prioritizeDisplayName:!0})},{columnKey:"type",value:a.destinationType.type,textColor:n.text.info},{columnKey:"throughput",value:Re(Nt(t,H.Destination,a.id).throughput),textColor:n.text.info},{columnKey:"signals",component:()=>e.createElement(be,{withLabels:!0,monitors:Me(a.exportedSignals)})},{columnKey:"conditions",component:()=>a.conditions?.length?e.createElement(Ai,{conditions:a.conditions,id:a.id}):null},{columnKey:"active-status",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:a.disabled?ie.Error:ie.Success,title:a.disabled?m.DISABLED:m.ENABLED,withIcon:!0,withBorder:!0}))}]}}),[h,t]),{badge:y,badgeTooltip:v}=l(()=>h.length!==p.length?{badge:`${h.length}/${p.length}`,badgeTooltip:m.FILTERED_COUNT_TOOLTIP}:{badge:p.length,badgeTooltip:void 0},[h,p]);return e.createElement(fe,{$maxWidth:i},e.createElement(xe,null,e.createElement(Se,{icon:$e(H.Destination),title:m.DESTINATIONS,badge:y,badgeTooltip:v,loading:u})),e.createElement(ke,{$maxHeight:a},e.createElement(Ce,{columns:So,rows:g})),!h.length&&e.createElement(we,{style:{marginTop:"2rem"}},e.createElement(De,null)))},ko=e=>{const{type:t,ruleName:a,notes:i,disabled:n,profileName:o,payloadCollection:l,codeAttributes:r,headersCollection:s,customInstrumentations:c}=e,d=[{title:m.TYPE,value:t},{type:h.ActiveStatus,title:m.STATUS,value:String(!n)},{title:m.NAME,value:a},{title:m.NOTES,value:i},{title:m.MANAGED_BY_PROFILE,value:o},{type:h.Divider}];if(l){const e=Object.entries(l).filter(([e,t])=>t).map(([e,t])=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(r){const e=Object.entries(r).filter(([e,t])=>t).map(([e,t])=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(s){const e=(s[Et.HeaderKeys]||[]).filter(e=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(c){const e=(c[At.Java]||[]).map(e=>new Ot(e.className,e.methodName)).map(e=>`• ${e.toString()}`).join("\r\n");e&&d.push({title:m.JAVA_CUSTOM_PROBES,value:e});const t=(c[At.Golang]||[]).map(e=>new Ft(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)).map(e=>`• ${e.toString()}`).join("\r\n");t&&d.push({title:m.GOLANG_CUSTOM_PROBES,value:t})}return d},Co=d.div`
295
+ `,fo=({isSourcesListEmpty:t,goToSources:a,categories:i,potentialDestinations:n,testConnection:o,onClickSummary:l})=>{const r=O.useTheme(),{setCurrentModal:s}=Z(),{configuredDestinations:c,configuredDestinationsUpdateOnly:d}=dt();return e.createElement(e.Fragment,null,e.createElement(te,{$isNotModal:!0},e.createElement(X,{$gap:12},e.createElement(X,{$gap:24},l&&e.createElement(gt,{onClick:l}),e.createElement(F,{title:m.ADD_DESTINATIONS,badgeLabel:c.length+d.length,description:m.ADD_DESTINATION_DESCRIPTION}),t&&e.createElement(ae,{type:ie.Warning,message:m.NO_SOURCES_GO_BACK,action:{label:m.SELECT_SOURCES,onClick:a}}),e.createElement(bo,{variant:"secondary",onClick:()=>s(z.Destination)},e.createElement(Na,null),e.createElement(E,{color:r.colors.secondary,size:14,decoration:"underline",family:"secondary"},m.ADD_DESTINATION))),e.createElement(yo,{categories:i,withDelete:!0}))),e.createElement(ho,{isOnboarding:!0,categories:i,potentialDestinations:n,updateDestination:async()=>{},createDestination:async()=>{},deleteDestination:async()=>{},testConnection:o}))},xo=[{key:"icon",title:""},{key:"name",title:m.NAME,sortable:!0},{key:"type",title:m.TYPE,sortable:!0},{key:"signals",title:m.MONITORS},{key:"active-status",title:m.STATUS},{key:"conditions",title:"Conditions"},{key:"throughput",title:"Throughput",sortable:!0}],So=({metrics:t,maxHeight:a,maxWidth:i})=>{const n=O.useTheme(),o=he(),{selectedStreamName:r}=We(),{setDrawerType:s,setDrawerEntityId:c}=L(),{destinations:d,destinationsLoading:u}=V(),p=l(()=>Ye(d,r),[d,r]),h=l(()=>Fi({instrumentationRules:[],sources:[],actions:[],destinations:Ge(p,o),searchText:o.searchText,selectedCategory:z.Destination}).searchResults.find(({category:e})=>e===z.Destination)?.entities||[],[p,o]),g=l(()=>h.map(a=>{const{hasErrors:i,hasWarnings:o,hasDisableds:l}=re(a.conditions||[]),{icon:r,iconSrc:d}=Ke(a.destinationType.type);return{status:i?ie.Error:o?ie.Warning:void 0,faded:l,onClick:()=>{s(z.Destination),c(a.id)},cells:[{columnKey:"icon",component:()=>e.createElement(ye,{icon:r,src:d})},{columnKey:"name",value:ve(a,z.Destination,{prioritizeDisplayName:!0})},{columnKey:"type",value:a.destinationType.type,textColor:n.text.info},{columnKey:"throughput",value:Le(Nt(t,z.Destination,a.id).throughput),textColor:n.text.info},{columnKey:"signals",component:()=>e.createElement(be,{withLabels:!0,monitors:Re(a.exportedSignals)})},{columnKey:"conditions",component:()=>a.conditions?.length?e.createElement(Oi,{conditions:a.conditions,id:a.id}):null},{columnKey:"active-status",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:a.disabled?ie.Error:ie.Success,title:a.disabled?m.DISABLED:m.ENABLED,withIcon:!0,withBorder:!0}))}]}}),[h,t]),{badge:y,badgeTooltip:v}=l(()=>h.length!==p.length?{badge:`${h.length}/${p.length}`,badgeTooltip:m.FILTERED_COUNT_TOOLTIP}:{badge:p.length,badgeTooltip:void 0},[h,p]);return e.createElement(fe,{$maxWidth:i},e.createElement(xe,null,e.createElement(Se,{icon:$e(z.Destination),title:m.DESTINATIONS,badge:y,badgeTooltip:v,loading:u})),e.createElement(ke,{$maxHeight:a},e.createElement(Ce,{columns:xo,rows:g})),!h.length&&e.createElement(we,{style:{marginTop:"2rem"}},e.createElement(De,null)))},$o=e=>{const{type:t,ruleName:a,notes:i,disabled:n,profileName:o,payloadCollection:l,codeAttributes:r,headersCollection:s,customInstrumentations:c}=e,d=[{title:m.TYPE,value:t},{type:h.ActiveStatus,title:m.STATUS,value:String(!n)},{title:m.NAME,value:a},{title:m.NOTES,value:i},{title:m.MANAGED_BY_PROFILE,value:o},{type:h.Divider}];if(l){const e=Object.entries(l).filter(([e,t])=>t).map(([e,t])=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(r){const e=Object.entries(r).filter(([e,t])=>t).map(([e,t])=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(s){const e=(s[Et.HeaderKeys]||[]).filter(e=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(c){const e=(c[At.Java]||[]).map(e=>new Ot(e.className,e.methodName)).map(e=>`• ${e.toString()}`).join("\r\n");e&&d.push({title:m.JAVA_CUSTOM_PROBES,value:e});const t=(c[At.Golang]||[]).map(e=>new Ft(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)).map(e=>`• ${e.toString()}`).join("\r\n");t&&d.push({title:m.GOLANG_CUSTOM_PROBES,value:t})}return d},ko=d.div`
298
296
  display: flex;
299
297
  flex-direction: column;
300
298
  gap: 12px;
@@ -304,7 +302,7 @@ import e,{useState as t,useEffect as a,forwardRef as i,useRef as n,useImperative
304
302
  border-radius: 16px;
305
303
  padding: 8px;
306
304
  `}
307
- `,wo=[{id:It.FilePath,label:"Collect File Path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:It.Function,label:"Collect Function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:It.LineNumber,label:"Collect Line Number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],Do=[{id:It.Column,label:"Collect Column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:It.Namespace,label:"Collect Namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:It.StackTrace,label:"Collect Stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],To={[At.Java]:[new Ot("","")],[At.Golang]:[new Ft("")]},No=["*"],Eo=d.div`
305
+ `,Co=[{id:It.FilePath,label:"Collect File Path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:It.Function,label:"Collect Function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:It.LineNumber,label:"Collect Line Number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],wo=[{id:It.Column,label:"Collect Column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:It.Namespace,label:"Collect Namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:It.StackTrace,label:"Collect Stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],Do={[At.Java]:[new Ot("","")],[At.Golang]:[new Ft("")]},To=["*"],No=d.div`
308
306
  display: flex;
309
307
  flex-direction: column;
310
308
  gap: 12px;
@@ -314,27 +312,27 @@ import e,{useState as t,useEffect as a,forwardRef as i,useRef as n,useImperative
314
312
  border-radius: 16px;
315
313
  padding: 8px;
316
314
  `}
317
- `,Oo=[{id:Mt.HttpRequest,label:"Collect HTTP Request"},{id:Mt.HttpResponse,label:"Collect HTTP Response"},{id:Mt.DbQuery,label:"Collect DB Query"},{id:Mt.Messaging,label:"Collect Messaging"}],Ao={[Rt.CodeAttributes]:({value:i,setValue:n,formErrors:o})=>{const r=o.codeAttributes,s=l(()=>Object.entries(i.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[i]),[c,d]=t(1===s.length);a(()=>{if(!s.length){const e={[It.Column]:null,[It.FilePath]:!0,[It.Function]:!0,[It.LineNumber]:!0,[It.Namespace]:null,[It.StackTrace]:null};n("codeAttributes",e),d(!1)}},[]);const u=(e,t)=>{const a=t?[...s,e]:s.filter(t=>t!==e),i=Object.values(It).reduce((e,t)=>(e[t]=!!a.includes(t)||null,e),{});n("codeAttributes",i),d(1===a.length)};return e.createElement(e.Fragment,null,e.createElement("div",null,e.createElement(v,{title:"Recommended data to collect",required:!0}),e.createElement(Co,{$hasError:!!r},wo.map(({id:t,label:a,tooltip:i})=>e.createElement(ue,{key:t,text:i,withIcon:!0},e.createElement(b,{title:a,disabled:c&&s.includes(t),value:s.includes(t),onChange:e=>u(t,e)})))),!!r&&e.createElement(f,null,r)),e.createElement("div",null,e.createElement(v,{title:"Verbose data to collect",required:!0}),e.createElement(Co,{$hasError:!!r},Do.map(({id:t,label:a,tooltip:i})=>e.createElement(ue,{key:t,text:i,withIcon:!0},e.createElement(b,{title:a,disabled:c&&s.includes(t),value:s.includes(t),onChange:e=>u(t,e)})))),!!r&&e.createElement(f,null,r)))},[Rt.CustomInstrumentation]:({value:t,setValue:i,formErrors:n})=>{const o=n.customInstrumentations,r=l(()=>(t?.customInstrumentations?.[At.Java]||[]).map(e=>({key:e.className,value:e.methodName})),[t]),s=l(()=>(t?.customInstrumentations?.[At.Golang]||[]).map(e=>new Ft(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[t]),c=(e,t)=>{const a={};switch(t){case"java":a[At.Java]=e.map(e=>new Ot(e.className,e.methodName)),a[At.Golang]=s.map(e=>new Ft(e.packageName,e.functionName,e.receiverName,e.receiverMethodName));break;case"golang":a[At.Golang]=e.map(e=>new Ft(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),a[At.Java]=r.map(({key:e,value:t})=>new Ot(e,t))}i("customInstrumentations",a)};return a(()=>{t?.customInstrumentations||i("customInstrumentations",{[At.Golang]:To[At.Golang],[At.Java]:To[At.Java]})},[i,t]),e.createElement("div",null,e.createElement(C,{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=>c(e,"golang"),errorMessage:o,limitFieldsPerRow:2}),e.createElement(D,{title:"Java Custom Probes",tooltip:"Specify class name and method name pair to instrument.",value:r,onChange:(e=[])=>c(e.map(({key:e,value:t})=>({className:e,methodName:t})),"java"),errorMessage:o,keyPlaceholder:"Class name",valuePlaceholder:"Method name"}))},[Rt.HeadersCollection]:({value:t,setValue:i,formErrors:n})=>{const o=n.headersCollection,r=l(()=>t?.headersCollection?.[Et.HeaderKeys]||[],[t]),s=e=>{const t={[Et.HeaderKeys]:e};i("headersCollection",t)};return a(()=>{r.length||s(No)},[r]),e.createElement("div",null,r.length>0&&e.createElement(T,{title:"Header Keys",tooltip:"Specify which headers you want to collect, asterisk (*) will collect all headers.",value:r,onChange:e=>s(e),errorMessage:o}))},[Rt.PayloadCollection]:({value:i,setValue:n,formErrors:o})=>{const r=o.payloadCollection,s=l(()=>Object.entries(i.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[i]),[c,d]=t(1===s.length);return a(()=>{if(!s.length){const e={[Mt.HttpRequest]:{},[Mt.HttpResponse]:{},[Mt.DbQuery]:{},[Mt.Messaging]:{}};n("payloadCollection",e),d(!1)}},[]),e.createElement("div",null,e.createElement(v,{title:"Type of data to collect",required:!0}),e.createElement(Eo,{$hasError:!!r},Oo.map(({id:t,label:a})=>e.createElement(b,{key:t,title:a,disabled:c&&s.includes(t),value:s.includes(t),onChange:e=>((e,t)=>{const a=t?[...s,e]:s.filter(t=>t!==e),i={[Mt.HttpRequest]:a.includes(Mt.HttpRequest)?{}:null,[Mt.HttpResponse]:a.includes(Mt.HttpResponse)?{}:null,[Mt.DbQuery]:a.includes(Mt.DbQuery)?{}:null,[Mt.Messaging]:a.includes(Mt.Messaging)?{}:null};n("payloadCollection",i),d(1===a.length)})(t,e)}))),!!r&&e.createElement(f,null,r))},[Rt.UnknownType]:null},Fo=({ruleType:t,value:a,setValue:i,formErrors:n})=>{if(!t)return null;const o=Ao[t];return o?e.createElement(o,{value:a,setValue:i,formErrors:n}):null},Io=d.div`
315
+ `,Eo=[{id:Mt.HttpRequest,label:"Collect HTTP Request"},{id:Mt.HttpResponse,label:"Collect HTTP Response"},{id:Mt.DbQuery,label:"Collect DB Query"},{id:Mt.Messaging,label:"Collect Messaging"}],Oo={[Rt.CodeAttributes]:({value:i,setValue:n,formErrors:o})=>{const r=o.codeAttributes,s=l(()=>Object.entries(i.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[i]),[c,d]=t(1===s.length);a(()=>{if(!s.length){const e={[It.Column]:null,[It.FilePath]:!0,[It.Function]:!0,[It.LineNumber]:!0,[It.Namespace]:null,[It.StackTrace]:null};n("codeAttributes",e),d(!1)}},[]);const u=(e,t)=>{const a=t?[...s,e]:s.filter(t=>t!==e),i=Object.values(It).reduce((e,t)=>(e[t]=!!a.includes(t)||null,e),{});n("codeAttributes",i),d(1===a.length)};return e.createElement(e.Fragment,null,e.createElement("div",null,e.createElement(v,{title:"Recommended data to collect",required:!0}),e.createElement(ko,{$hasError:!!r},Co.map(({id:t,label:a,tooltip:i})=>e.createElement(ue,{key:t,text:i,withIcon:!0},e.createElement(b,{title:a,disabled:c&&s.includes(t),value:s.includes(t),onChange:e=>u(t,e)})))),!!r&&e.createElement(f,null,r)),e.createElement("div",null,e.createElement(v,{title:"Verbose data to collect",required:!0}),e.createElement(ko,{$hasError:!!r},wo.map(({id:t,label:a,tooltip:i})=>e.createElement(ue,{key:t,text:i,withIcon:!0},e.createElement(b,{title:a,disabled:c&&s.includes(t),value:s.includes(t),onChange:e=>u(t,e)})))),!!r&&e.createElement(f,null,r)))},[Rt.CustomInstrumentation]:({value:t,setValue:i,formErrors:n})=>{const o=n.customInstrumentations,r=l(()=>(t?.customInstrumentations?.[At.Java]||[]).map(e=>({key:e.className,value:e.methodName})),[t]),s=l(()=>(t?.customInstrumentations?.[At.Golang]||[]).map(e=>new Ft(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[t]),c=(e,t)=>{const a={};switch(t){case"java":a[At.Java]=e.map(e=>new Ot(e.className,e.methodName)),a[At.Golang]=s.map(e=>new Ft(e.packageName,e.functionName,e.receiverName,e.receiverMethodName));break;case"golang":a[At.Golang]=e.map(e=>new Ft(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),a[At.Java]=r.map(({key:e,value:t})=>new Ot(e,t))}i("customInstrumentations",a)};return a(()=>{t?.customInstrumentations||i("customInstrumentations",{[At.Golang]:Do[At.Golang],[At.Java]:Do[At.Java]})},[i,t]),e.createElement("div",null,e.createElement(C,{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=>c(e,"golang"),errorMessage:o,limitFieldsPerRow:2}),e.createElement(D,{title:"Java Custom Probes",tooltip:"Specify class name and method name pair to instrument.",value:r,onChange:(e=[])=>c(e.map(({key:e,value:t})=>({className:e,methodName:t})),"java"),errorMessage:o,keyPlaceholder:"Class name",valuePlaceholder:"Method name"}))},[Rt.HeadersCollection]:({value:t,setValue:i,formErrors:n})=>{const o=n.headersCollection,r=l(()=>t?.headersCollection?.[Et.HeaderKeys]||[],[t]),s=e=>{const t={[Et.HeaderKeys]:e};i("headersCollection",t)};return a(()=>{r.length||s(To)},[r]),e.createElement("div",null,r.length>0&&e.createElement(T,{title:"Header Keys",tooltip:"Specify which headers you want to collect, asterisk (*) will collect all headers.",value:r,onChange:e=>s(e),errorMessage:o}))},[Rt.PayloadCollection]:({value:i,setValue:n,formErrors:o})=>{const r=o.payloadCollection,s=l(()=>Object.entries(i.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[i]),[c,d]=t(1===s.length);return a(()=>{if(!s.length){const e={[Mt.HttpRequest]:{},[Mt.HttpResponse]:{},[Mt.DbQuery]:{},[Mt.Messaging]:{}};n("payloadCollection",e),d(!1)}},[]),e.createElement("div",null,e.createElement(v,{title:"Type of data to collect",required:!0}),e.createElement(No,{$hasError:!!r},Eo.map(({id:t,label:a})=>e.createElement(b,{key:t,title:a,disabled:c&&s.includes(t),value:s.includes(t),onChange:e=>((e,t)=>{const a=t?[...s,e]:s.filter(t=>t!==e),i={[Mt.HttpRequest]:a.includes(Mt.HttpRequest)?{}:null,[Mt.HttpResponse]:a.includes(Mt.HttpResponse)?{}:null,[Mt.DbQuery]:a.includes(Mt.DbQuery)?{}:null,[Mt.Messaging]:a.includes(Mt.Messaging)?{}:null};n("payloadCollection",i),d(1===a.length)})(t,e)}))),!!r&&e.createElement(f,null,r))},[Rt.UnknownType]:null},Ao=({ruleType:t,value:a,setValue:i,formErrors:n})=>{if(!t)return null;const o=Oo[t];return o?e.createElement(o,{value:a,setValue:i,formErrors:n}):null},Fo=d.div`
318
316
  display: flex;
319
317
  flex-direction: column;
320
318
  gap: 24px;
321
319
  padding: 4px;
322
- `,Mo=d(E)`
320
+ `,Io=d(E)`
323
321
  margin-bottom: 12px;
324
- `,Ro=({isUpdate:t,rule:a,formData:i,formErrors:n,handleFormChange:o})=>{const l=O.useTheme();return e.createElement(Io,null,e.createElement(ce,null,a.supportedLanguages.map(t=>e.createElement(Lt,{key:t,icon:Pt(t),type:ie.Info},ot[t]))),t?e.createElement("div",null,e.createElement(Mo,null,"Status"),e.createElement(A,{options:[{icon:Ca,label:m.ENABLED,value:!1,selectedBgColor:l.text.success+O.opacity.hex["050"]},{icon:wa,label:m.DISABLED,value:!0,selectedBgColor:l.text.error+O.opacity.hex["050"]}],selected:i.disabled,setSelected:e=>o("disabled",e)})):e.createElement(e.Fragment,null,e.createElement(F,{title:"",description:a.docsDescription,actionButton:e.createElement(I,{endpoint:a.docsEndpoint})}),e.createElement(S,{title:"Rule name",placeholder:"Use a name that describes the rule",value:i.ruleName,onChange:({target:{value:e}})=>o("ruleName",e),errorMessage:n.ruleName})),e.createElement(Fo,{ruleType:a.type,value:i,setValue:(e,t)=>o(e,t),formErrors:n}),e.createElement(R,{title:"Notes",value:i.notes,onChange:({target:{value:e}})=>o("notes",e),errorMessage:n.notes}))},Lo=d.div`
322
+ `,Mo=({isUpdate:t,rule:a,formData:i,formErrors:n,handleFormChange:o})=>{const l=O.useTheme();return e.createElement(Fo,null,e.createElement(ce,null,a.supportedLanguages.map(t=>e.createElement(Lt,{key:t,icon:Pt(t),type:ie.Info},ot[t]))),t?e.createElement("div",null,e.createElement(Io,null,"Status"),e.createElement(A,{options:[{icon:ka,label:m.ENABLED,value:!1,selectedBgColor:l.text.success+O.opacity.hex["050"]},{icon:Ca,label:m.DISABLED,value:!0,selectedBgColor:l.text.error+O.opacity.hex["050"]}],selected:i.disabled,setSelected:e=>o("disabled",e)})):e.createElement(e.Fragment,null,e.createElement(F,{title:"",description:a.docsDescription,actionButton:e.createElement(I,{endpoint:a.docsEndpoint})}),e.createElement(S,{title:"Rule name",placeholder:"Use a name that describes the rule",value:i.ruleName,onChange:({target:{value:e}})=>o("ruleName",e),errorMessage:n.ruleName})),e.createElement(Ao,{ruleType:a.type,value:i,setValue:(e,t)=>o(e,t),formErrors:n}),e.createElement(R,{title:"Notes",value:i.notes,onChange:({target:{value:e}})=>o("notes",e),errorMessage:n.notes}))},Ro=d.div`
325
323
  width: 100%;
326
324
  height: 100%;
327
325
  max-height: calc(100vh - 220px);
328
326
  overflow: overlay;
329
327
  overflow-y: auto;
330
- `,Po=d.div`
328
+ `,Lo=d.div`
331
329
  display: flex;
332
330
  flex-direction: column;
333
331
  gap: 12px;
334
- `,jo=({updateInstrumentationRule:i,deleteInstrumentationRule:o})=>{const{instrumentationRules:r}=z(),{addNotification:s}=jt(),{drawerType:c,drawerEntityId:d}=L(),u=n(null),p=c===H.InstrumentationRule,[m,h]=t(!1),[g,y]=t(!1),{formData:v,formErrors:b,handleFormChange:f,resetFormData:x,validateForm:S,loadFormWithDrawerItem:$}=Kt(),k=l(()=>{if(d)return r?.find(e=>W(e)===d)},[d,r]);if(a(()=>{p&&k?$(k):x()},[p,k]),!k)return null;const C=Vt.find(({type:e})=>e===k.type);return e.createElement(ki,{ref:u,title:k.ruleName||k.type,icons:[Pe(k.type)],isEdit:m,isFormDirty:g,onEdit:e=>{k.mutable||!e&&void 0!==e?h("boolean"!=typeof e||e):s({type:ie.Warning,title:ne.FORBIDDEN,message:ne.CANNOT_EDIT_RULE,crdType:H.InstrumentationRule,target:d,hideFromHistory:!0})},onSave:e=>{if(S()){const t=e!==k.type?e:"";f("ruleName",t),i(d,{...v,ruleName:t}),h(!1),y(!1)}},onDelete:()=>{k.mutable?(o(d),h(!1),y(!1),u.current?.closeDrawer()):s({type:ie.Warning,title:ne.FORBIDDEN,message:ne.CANNOT_DELETE_RULE,crdType:H.InstrumentationRule,target:d,hideFromHistory:!0})},onCancel:()=>{h(!1),y(!1),$(k)}},m&&C?e.createElement(Lo,null,e.createElement(Ro,{isUpdate:!0,rule:C,formData:v,formErrors:b,handleFormChange:(...e)=>{y(!0),f(...e)}})):e.createElement(Po,null,e.createElement(U,{conditions:k.conditions||[]}),e.createElement(G,{title:"Instrumentation Rule Details",data:k?ko(k):[]})))},Ko=d(X)`
332
+ `,Po=({updateInstrumentationRule:i,deleteInstrumentationRule:o})=>{const{instrumentationRules:r}=V(),{addNotification:s}=jt(),{drawerType:c,drawerEntityId:d}=L(),u=n(null),p=c===z.InstrumentationRule,[m,h]=t(!1),[g,y]=t(!1),{formData:v,formErrors:b,handleFormChange:f,resetFormData:x,validateForm:S,loadFormWithDrawerItem:$}=Kt(),k=l(()=>{if(d)return r?.find(e=>W(e)===d)},[d,r]);if(a(()=>{p&&k?$(k):x()},[p,k]),!k)return null;const C=qt.find(({type:e})=>e===k.type);return e.createElement($i,{ref:u,title:k.ruleName||k.type,icons:[je(k.type)],isEdit:m,isFormDirty:g,onEdit:e=>{k.mutable||!e&&void 0!==e?h("boolean"!=typeof e||e):s({type:ie.Warning,title:ne.FORBIDDEN,message:ne.CANNOT_EDIT_RULE,crdType:z.InstrumentationRule,target:d,hideFromHistory:!0})},onSave:e=>{if(S()){const t=e!==k.type?e:"";f("ruleName",t),i(d,{...v,ruleName:t}),h(!1),y(!1)}},onDelete:()=>{k.mutable?(o(d),h(!1),y(!1),u.current?.closeDrawer()):s({type:ie.Warning,title:ne.FORBIDDEN,message:ne.CANNOT_DELETE_RULE,crdType:z.InstrumentationRule,target:d,hideFromHistory:!0})},onCancel:()=>{h(!1),y(!1),$(k)}},m&&C?e.createElement(Ro,null,e.createElement(Mo,{isUpdate:!0,rule:C,formData:v,formErrors:b,handleFormChange:(...e)=>{y(!0),f(...e)}})):e.createElement(Lo,null,e.createElement(U,{conditions:k.conditions||[]}),e.createElement(G,{title:"Instrumentation Rule Details",data:k?$o(k):[]})))},jo=d(X)`
335
333
  margin-top: 24px;
336
334
  gap: 12px;
337
- `,Vo=Vt,qo=({createInstrumentationRule:a})=>{const{tier:i}=qt(),n=i===Ht.Onprem,{currentModal:o,setCurrentModal:l}=Z(),r=o===H.InstrumentationRule,{formData:s,formErrors:c,handleFormChange:d,resetFormData:u,validateForm:p}=Kt(),[h,g]=t(void 0),y=()=>{u(),g(void 0),l("")},v=()=>{if(!p())return null;a(s),y()};return P({key:"Enter",active:r},()=>v()),e.createElement(Q,{isOpen:r,onClose:y,header:{title:"Add Instrumentation Rule"},actionComponent:e.createElement(ee,{buttons:[{variant:"primary",label:"DONE",onClick:v,disabled:!n||!h,tooltip:n?"":ne.ENTERPRISE_ONLY("Instrumentation Rules")}]})},e.createElement(te,null,e.createElement(F,{title:"Select Instrumentation Rule",description:"Define how telemetry is recorded from your application. Choose a rule type and configure the details."}),e.createElement(Ko,null,n?e.createElement(ae,{type:ie.Warning,message:ne.DEFINED_FOR_ALL_STREAMS(m.INSTRUMENTATION_RULES)}):e.createElement(ae,{type:ie.Default,message:ne.ENTERPRISE_ONLY(m.INSTRUMENTATION_RULES)}),e.createElement(oe,{options:Vo,selectedOption:h,onOptionSelect:e=>{return t=e,u(),void g(t);var t},autoFocus:!h?.type})),h?.type?e.createElement("div",null,e.createElement(le,{margin:"16px 0"}),e.createElement(Ro,{rule:h,formData:s,formErrors:c,handleFormChange:d})):null))},Ho=e=>{const{payloadCollection:t,codeAttributes:a,customInstrumentations:i}=e;let n="";return t&&(n+=Object.entries(t).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),a&&(n+=Object.entries(a).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),i&&Object.values(At).forEach(e=>{const t=(i[e]||[]).filter(e=>e).join(", ");t&&(n+=n?`, ${t}`:t)}),n},zo=[{key:"icon",title:""},{key:"name",title:m.NAME,sortable:!0},{key:"profile",title:m.MANAGED_BY_PROFILE,sortable:!0},{key:"active-status",title:m.STATUS},{key:"conditions",title:"Conditions"},{key:"source-count",title:"Applicable Source"},{key:"type",title:m.TYPE,sortable:!0},{key:"spec",title:"Spec",sortable:!0},{key:"notes",title:m.NOTES,sortable:!0}],Bo=({maxHeight:t,maxWidth:a})=>{const i=p(),n=he(),{setDrawerType:o,setDrawerEntityId:r}=L(),{instrumentationRules:s,instrumentationRulesLoading:c}=z(),d=l(()=>Ii({instrumentationRules:s,sources:[],actions:[],destinations:[],searchText:n.searchText,selectedCategory:H.InstrumentationRule}).searchResults.find(({category:e})=>e===H.InstrumentationRule)?.entities||[],[s,n]),u=l(()=>d.map(t=>{const{hasErrors:a,hasWarnings:n,hasDisableds:l}=re(t.conditions||[]);return{status:a?ie.Error:n?ie.Warning:void 0,faded:l,onClick:()=>{o(H.InstrumentationRule),r(t.ruleId)},cells:[{columnKey:"icon",component:()=>e.createElement(ye,{icon:Pe(t.type)})},{columnKey:"name",value:ve(t,H.InstrumentationRule,{prioritizeDisplayName:!0})},{columnKey:"type",value:t.type,textColor:i.text.info},{columnKey:"profile",value:t.profileName,textColor:i.text.info},{columnKey:"notes",value:t.notes,textColor:i.text.info,withTooltip:!0},{columnKey:"spec",value:Ho(t),textColor:i.text.info,withTooltip:!0},{columnKey:"conditions",component:()=>e.createElement(Ai,{conditions:t.conditions||[],id:t.ruleId})},{columnKey:"active-status",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:t.disabled?ie.Error:ie.Success,title:t.disabled?m.DISABLED:m.ENABLED,withIcon:!0,withBorder:!0}))},{columnKey:"source-count",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:ie.Info,title:"all sources",withBorder:!0}))}]}}),[d]),{badge:h,badgeTooltip:g}=l(()=>d.length!==s.length?{badge:`${d.length}/${s.length}`,badgeTooltip:m.FILTERED_COUNT_TOOLTIP}:{badge:s.length,badgeTooltip:void 0},[d,s]);return e.createElement(fe,{$maxWidth:a},e.createElement(xe,null,e.createElement(Se,{icon:$e(H.Action),title:m.INSTRUMENTATION_RULES,badge:h,badgeTooltip:g,loading:c})),e.createElement(ke,{$maxHeight:t},e.createElement(Ce,{columns:zo,rows:u})),!d.length&&e.createElement(we,{style:{marginTop:"2rem"}},e.createElement(De,null)))},Wo=d.div`
335
+ `,Ko=qt,qo=({createInstrumentationRule:a})=>{const{tier:i}=Me(),n=i===Ht.Onprem,{currentModal:o,setCurrentModal:l}=Z(),r=o===z.InstrumentationRule,{formData:s,formErrors:c,handleFormChange:d,resetFormData:u,validateForm:p}=Kt(),[h,g]=t(void 0),y=()=>{u(),g(void 0),l("")},v=()=>{if(!p())return null;a(s),y()};return P({key:"Enter",active:r},()=>v()),e.createElement(Q,{isOpen:r,onClose:y,header:{title:"Add Instrumentation Rule"},actionComponent:e.createElement(ee,{buttons:[{variant:"primary",label:"DONE",onClick:v,disabled:!n||!h,tooltip:n?"":ne.ENTERPRISE_ONLY("Instrumentation Rules")}]})},e.createElement(te,null,e.createElement(F,{title:"Select Instrumentation Rule",description:"Define how telemetry is recorded from your application. Choose a rule type and configure the details."}),e.createElement(jo,null,n?e.createElement(ae,{type:ie.Warning,message:ne.DEFINED_FOR_ALL_STREAMS(m.INSTRUMENTATION_RULES)}):e.createElement(ae,{type:ie.Default,message:ne.ENTERPRISE_ONLY(m.INSTRUMENTATION_RULES)}),e.createElement(oe,{options:Ko,selectedOption:h,onOptionSelect:e=>{return t=e,u(),void g(t);var t},autoFocus:!h?.type})),h?.type?e.createElement("div",null,e.createElement(le,{margin:"16px 0"}),e.createElement(Mo,{rule:h,formData:s,formErrors:c,handleFormChange:d})):null))},Ho=e=>{const{payloadCollection:t,codeAttributes:a,customInstrumentations:i}=e;let n="";return t&&(n+=Object.entries(t).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),a&&(n+=Object.entries(a).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),i&&Object.values(At).forEach(e=>{const t=(i[e]||[]).filter(e=>e).join(", ");t&&(n+=n?`, ${t}`:t)}),n},zo=[{key:"icon",title:""},{key:"name",title:m.NAME,sortable:!0},{key:"profile",title:m.MANAGED_BY_PROFILE,sortable:!0},{key:"active-status",title:m.STATUS},{key:"conditions",title:"Conditions"},{key:"source-count",title:"Applicable Source"},{key:"type",title:m.TYPE,sortable:!0},{key:"spec",title:"Spec",sortable:!0},{key:"notes",title:m.NOTES,sortable:!0}],Vo=({maxHeight:t,maxWidth:a})=>{const i=p(),n=he(),{setDrawerType:o,setDrawerEntityId:r}=L(),{instrumentationRules:s,instrumentationRulesLoading:c}=V(),d=l(()=>Fi({instrumentationRules:s,sources:[],actions:[],destinations:[],searchText:n.searchText,selectedCategory:z.InstrumentationRule}).searchResults.find(({category:e})=>e===z.InstrumentationRule)?.entities||[],[s,n]),u=l(()=>d.map(t=>{const{hasErrors:a,hasWarnings:n,hasDisableds:l}=re(t.conditions||[]);return{status:a?ie.Error:n?ie.Warning:void 0,faded:l,onClick:()=>{o(z.InstrumentationRule),r(t.ruleId)},cells:[{columnKey:"icon",component:()=>e.createElement(ye,{icon:je(t.type)})},{columnKey:"name",value:ve(t,z.InstrumentationRule,{prioritizeDisplayName:!0})},{columnKey:"type",value:t.type,textColor:i.text.info},{columnKey:"profile",value:t.profileName,textColor:i.text.info},{columnKey:"notes",value:t.notes,textColor:i.text.info,withTooltip:!0},{columnKey:"spec",value:Ho(t),textColor:i.text.info,withTooltip:!0},{columnKey:"conditions",component:()=>e.createElement(Oi,{conditions:t.conditions||[],id:t.ruleId})},{columnKey:"active-status",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:t.disabled?ie.Error:ie.Success,title:t.disabled?m.DISABLED:m.ENABLED,withIcon:!0,withBorder:!0}))},{columnKey:"source-count",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:ie.Info,title:"all sources",withBorder:!0}))}]}}),[d]),{badge:h,badgeTooltip:g}=l(()=>d.length!==s.length?{badge:`${d.length}/${s.length}`,badgeTooltip:m.FILTERED_COUNT_TOOLTIP}:{badge:s.length,badgeTooltip:void 0},[d,s]);return e.createElement(fe,{$maxWidth:a},e.createElement(xe,null,e.createElement(Se,{icon:$e(z.Action),title:m.INSTRUMENTATION_RULES,badge:h,badgeTooltip:g,loading:c})),e.createElement(ke,{$maxHeight:t},e.createElement(Ce,{columns:zo,rows:u})),!d.length&&e.createElement(we,{style:{marginTop:"2rem"}},e.createElement(De,null)))},Bo=d.div`
338
336
  position: fixed;
339
337
  bottom: 0;
340
338
  left: 50%;
@@ -348,17 +346,17 @@ import e,{useState as t,useEffect as a,forwardRef as i,useRef as n,useImperative
348
346
  border: 1px solid ${({theme:e})=>e.colors.border};
349
347
  background-color: ${({theme:e})=>e.colors.dropdown_bg};
350
348
  animation-name: ${O.animations.slide.in.center};
351
- `,_o=({totalSourceCount:a,uninstrumentSources:i,restartWorkloads:n})=>{const o=O.useTheme(),{selectedSources:s,setSelectedSources:c}=Fe(),[d,u]=t(!1),p=l(()=>{let e=0;return Object.values(s).forEach(t=>{e+=t.length}),e},[s]),m=()=>{c({})};return p?e.createElement(r,null,e.createElement(Wo,{"data-id":"multi-source-control"},e.createElement(E,null,"Selected sources"),e.createElement(Ne,{label:p,filled:!0}),e.createElement(le,{orientation:"vertical",length:"16px"}),e.createElement(Oe,{variant:"tertiary",onClick:m},e.createElement(E,{family:"secondary",decoration:"underline"},"Deselect")),e.createElement(Oe,{variant:"tertiary",onClick:()=>{const e=[];Object.values(s).forEach(t=>{e.push(...t.map(e=>zt(e)))}),n(e),m()}},e.createElement(Pa,null),e.createElement(E,{family:"secondary",decoration:"underline"},"Restart")),e.createElement(Oe,{variant:"tertiary",onClick:()=>u(!0)},e.createElement(Ta,null),e.createElement(E,{family:"secondary",decoration:"underline",color:o.text.error},"Uninstrument"))),e.createElement(V,{isOpen:d,name:`${p} sources`,type:H.Source,isLastItem:p===a,onApprove:()=>{const e={};Object.entries(s).forEach(([t,a])=>{e[t]=a.map(e=>({...e,selected:!1}))}),i(e),u(!1),m()},onDeny:()=>u(!1)})):null},Jo=d.div`
349
+ `,Wo=({totalSourceCount:a,uninstrumentSources:i,restartWorkloads:n})=>{const o=O.useTheme(),{selectedSources:s,setSelectedSources:c}=Fe(),[d,u]=t(!1),p=l(()=>{let e=0;return Object.values(s).forEach(t=>{e+=t.length}),e},[s]),m=()=>{c({})};return p?e.createElement(r,null,e.createElement(Bo,{"data-id":"multi-source-control"},e.createElement(E,null,"Selected sources"),e.createElement(Ne,{label:p,filled:!0}),e.createElement(le,{orientation:"vertical",length:"16px"}),e.createElement(Oe,{variant:"tertiary",onClick:m},e.createElement(E,{family:"secondary",decoration:"underline"},"Deselect")),e.createElement(Oe,{variant:"tertiary",onClick:()=>{const e=[];Object.values(s).forEach(t=>{e.push(...t.map(e=>zt(e)))}),n(e),m()}},e.createElement(La,null),e.createElement(E,{family:"secondary",decoration:"underline"},"Restart")),e.createElement(Oe,{variant:"tertiary",onClick:()=>u(!0)},e.createElement(Da,null),e.createElement(E,{family:"secondary",decoration:"underline",color:o.text.error},"Uninstrument"))),e.createElement(q,{isOpen:d,name:`${p} sources`,type:z.Source,isLastItem:p===a,onApprove:()=>{const e={};Object.entries(s).forEach(([t,a])=>{e[t]=a.map(e=>({...e,selected:!1}))}),i(e),u(!1),m()},onDeny:()=>u(!1)})):null},_o=d.div`
352
350
  position: relative;
353
351
  width: fit-content;
354
- `,Uo=d(ce)`
352
+ `,Jo=d(ce)`
355
353
  gap: 12px;
356
354
  padding: 0 12px;
357
- `,Go=d(X)`
355
+ `,Uo=d(X)`
358
356
  gap: 12px;
359
357
  max-height: 400px;
360
358
  overflow-y: auto;
361
- `,Yo=d.div`
359
+ `,Go=d.div`
362
360
  position: absolute;
363
361
  bottom: 0;
364
362
  left: 0;
@@ -367,13 +365,13 @@ import e,{useState as t,useEffect as a,forwardRef as i,useRef as n,useImperative
367
365
  border-radius: 0 0 24px 24px;
368
366
  background: ${({theme:e})=>`linear-gradient(to top, ${e.colors.dropdown_bg}, transparent)`};
369
367
  pointer-events: none;
370
- `,Xo=d(E)`
368
+ `,Yo=d(E)`
371
369
  background-color: ${({theme:e})=>e.colors.orange_soft};
372
370
  color: ${({theme:e})=>e.text.primary};
373
371
  border-radius: 32px;
374
372
  width: fit-content;
375
373
  padding: 2px 8px;
376
- `,Zo=()=>{const t=O.useTheme(),{notifications:a,markAsSeen:i}=jt(),n=a.filter(({hideFromHistory:e})=>!e),o=n.filter(({seen:e})=>!e),l=o.length,{popupRef:r,popupOpen:s,setPopupOpen:c,popupPosition:d,handlePosition:u}=Ze({defaultClientHeight:420,defaultClientwidth:400,onClickOutside:()=>{l&&o.forEach(({id:e})=>i(e))}});return e.createElement(Jo,null,e.createElement(pt,{onClick:()=>{u(0,0),c(e=>!e)},tooltip:"Notifications",withPing:!!l,pingColor:t.colors.orange_og},e.createElement(ja,{size:18})),e.createElement(Qe,{ref:r,isOpen:s,right:d.left,maxWidth:"400px",header:e.createElement(Uo,null,e.createElement(E,{size:20},"Notifications"),!!l&&e.createElement(Xo,{size:12,family:"secondary"},l," new"))},e.createElement(Go,null,n.length?n.map(t=>e.createElement(nl,{key:`notification-${t.id}`,...t,onClick:()=>c(!1)})):e.createElement(De,{title:"No notifications",subTitle:""})),e.createElement(Yo,null)))},Qo=d.div`
374
+ `,Xo=()=>{const t=O.useTheme(),{notifications:a,markAsSeen:i}=jt(),n=a.filter(({hideFromHistory:e})=>!e),o=n.filter(({seen:e})=>!e),l=o.length,{popupRef:r,popupOpen:s,setPopupOpen:c,popupPosition:d,handlePosition:u}=Ze({defaultClientHeight:420,defaultClientwidth:400,onClickOutside:()=>{l&&o.forEach(({id:e})=>i(e))}});return e.createElement(_o,null,e.createElement(pt,{onClick:()=>{u(0,0),c(e=>!e)},tooltip:"Notifications",withPing:!!l,pingColor:t.colors.orange_og},e.createElement(Pa,{size:18})),e.createElement(Qe,{ref:r,isOpen:s,right:d.left,maxWidth:"400px",header:e.createElement(Jo,null,e.createElement(E,{size:20},"Notifications"),!!l&&e.createElement(Yo,{size:12,family:"secondary"},l," new"))},e.createElement(Uo,null,n.length?n.map(t=>e.createElement(il,{key:`notification-${t.id}`,...t,onClick:()=>c(!1)})):e.createElement(De,{title:"No notifications",subTitle:""})),e.createElement(Go,null)))},Zo=d.div`
377
375
  display: flex;
378
376
  align-items: flex-start;
379
377
  gap: 12px;
@@ -387,7 +385,7 @@ import e,{useState as t,useEffect as a,forwardRef as i,useRef as n,useImperative
387
385
  background-color: ${({theme:e})=>e.colors.dropdown_bg_2};
388
386
  }
389
387
  }
390
- `,el=d.div`
388
+ `,Qo=d.div`
391
389
  background-color: ${({$type:e,theme:t})=>t.text[e]+O.opacity.hex["015"]};
392
390
  border-radius: 8px;
393
391
  width: 36px;
@@ -395,19 +393,19 @@ import e,{useState as t,useEffect as a,forwardRef as i,useRef as n,useImperative
395
393
  display: flex;
396
394
  align-items: center;
397
395
  justify-content: center;
398
- `,tl=d.div`
396
+ `,el=d.div`
399
397
  width: 290px;
400
- `,al=d.div`
398
+ `,tl=d.div`
401
399
  margin-bottom: 6px;
402
- `,il=d.div`
400
+ `,al=d.div`
403
401
  display: flex;
404
402
  align-items: center;
405
403
  gap: 6px;
406
- `,nl=({id:t,seen:a,type:i,title:n,message:o,time:l,crdType:r,target:s,onClick:c})=>{const d=O.useTheme(),{formatTimeAgo:u}=Bt(),{onClickNotification:p}=Wt(),m=!!r&&!!s,h=n?.toLowerCase().includes(Y.Delete.toLowerCase())||!1,g=me(i,d);return e.createElement(Qo,{key:`notification-${t}`,className:m?"click-enabled":"",onClick:()=>{m&&(c(),p({id:t,crdType:r,target:s}))}},e.createElement(el,{$type:h?ie.Error:i},h?e.createElement(Ta,null):e.createElement(g,null)),e.createElement(tl,null,e.createElement(al,null,e.createElement(E,{size:14},o)),e.createElement(il,null,e.createElement(E,{size:10,color:d.text.grey},u(l)),!a&&e.createElement(e.Fragment,null,e.createElement(E,{size:10},"·"),e.createElement(E,{size:10,color:d.colors.orange_soft},"new")))))},ol=(e,t,a)=>{const i=e?.serviceName||t?.otelServiceName||t?.name,n=a?[Ka]:Ke(t?.containers||[]),{priorotizedStatus:o}=re(t?.conditions||[]);return{id:i,title:i,icons:n.length?n:[Va],status:o,serviceMapEntry:e}},ll=e=>"user"===e?.otelServiceName&&!e?.namespace&&!e?.name&&!e?.kind,rl=d.div`
404
+ `,il=({id:t,seen:a,type:i,title:n,message:o,time:l,crdType:r,target:s,onClick:c})=>{const d=O.useTheme(),{formatTimeAgo:u}=Vt(),{onClickNotification:p}=Bt(),m=!!r&&!!s,h=n?.toLowerCase().includes(Y.Delete.toLowerCase())||!1,g=me(i,d);return e.createElement(Zo,{key:`notification-${t}`,className:m?"click-enabled":"",onClick:()=>{m&&(c(),p({id:t,crdType:r,target:s}))}},e.createElement(Qo,{$type:h?ie.Error:i},h?e.createElement(Da,null):e.createElement(g,null)),e.createElement(el,null,e.createElement(tl,null,e.createElement(E,{size:14},o)),e.createElement(al,null,e.createElement(E,{size:10,color:d.text.grey},u(l)),!a&&e.createElement(e.Fragment,null,e.createElement(E,{size:10},"·"),e.createElement(E,{size:10,color:d.colors.orange_soft},"new")))))},nl=(e,t,a)=>{const i=e?.serviceName||t?.otelServiceName||t?.name,n=a?[ja]:qe(t?.containers||[]),{priorotizedStatus:o}=re(t?.conditions||[]);return{id:i,title:i,icons:n.length?n:[Ka],status:o,serviceMapEntry:e}},ol=e=>"user"===e?.otelServiceName&&!e?.namespace&&!e?.name&&!e?.kind,ll=d.div`
407
405
  width: 100%;
408
406
  height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px)`};
409
407
  position: relative;
410
- `,sl={namespace:"",name:"",kind:"",otelServiceName:"user",selected:!0,numberOfInstances:0,dataStreamNames:[],containers:[],conditions:[]},cl=({heightToRemove:t,serviceMap:i})=>{const n=O.useTheme(),{sources:o,sourcesLoading:l}=z(),{containerRef:r,containerHeight:s,containerWidth:c}=_e(),[d,u,p]=Za([]),[h,g,y]=Qa([]);return a(()=>{if(s&&c){const t=(({sources:e,serviceMap:t,containerHeight:a,containerWidth:i})=>{const n=[],o=new Map,l=((e,t)=>{const a=new Map,i=new Map,n=new Map,o=new Set;e.forEach(e=>{o.add(e.serviceName),e.services.forEach(e=>{o.add(e.serviceName)})}),o.forEach(e=>{i.set(e,[]),n.set(e,0)}),e.forEach(e=>{e.services.forEach(t=>{i.get(e.serviceName)?.push(t.serviceName);const a=n.get(t.serviceName)||0;n.set(t.serviceName,a+1)})});const l=[],r=[];for(o.forEach(e=>{0===(n.get(e)||0)&&r.push(e)});r.length>0;){const e=[],t=r.length;for(let a=0;a<t;a++){const t=r.shift();e.push(t),i.get(t)?.forEach(e=>{const t=n.get(e)||0;n.set(e,t-1),t-1==0&&r.push(e)})}e.length>0&&l.push(e)}return o.forEach(e=>{l.flat().includes(e)||(0===l.length?l.push([e]):l[l.length-1].push(e))}),l.forEach((e,i)=>{const n=100+150*i,o=150*(e.length-1),l=(t-o)/2;e.forEach((e,t)=>{const i=l+150*t,o=n;a.set(e,{x:i,y:o})})}),a})(t,i);if(t.length&&e.length){t.forEach(t=>{const a=t.serviceName;if(n.find(e=>e.id===`${H.Source}-${a}-${_t.MapItem}`))return;const i=e.find(e=>a===e.otelServiceName||a===e.name);o.set(a,t),t.services.forEach(e=>o.set(e.serviceName,{serviceName:e.serviceName,services:[]})),n.push({id:`${H.Source}-${a}-${_t.MapItem}`,type:_t.MapItem,position:l.get(a),data:ol(t,i,ll(i))})}),o.forEach((t,a)=>{if(n.find(e=>e.id===`${H.Source}-${a}-${_t.MapItem}`))return;const i=e.find(e=>a===e.otelServiceName||a===e.name);n.push({id:`${H.Source}-${a}-${_t.MapItem}`,type:_t.MapItem,position:l.get(a),data:ol(t,i,ll(i))})});let a=50;e.forEach(e=>{const t=e.otelServiceName||e.name;n.find(e=>e.id===`${H.Source}-${t}-${_t.MapItem}`)||(n.push({id:`${H.Source}-${t}-${_t.MapItem}`,type:_t.MapItem,position:{x:a,y:10},data:ol(void 0,e,ll(e))}),a+=110)})}else n.push({id:`${H.Source}-${_t.NoData}`,type:_t.NoData,position:{x:i/2-150,y:a/4},data:{subTitle:m.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return n})({serviceMap:i,sources:[sl].concat(o),sourcesLoading:l,containerHeight:s,containerWidth:c});d.length>1?(e=t,u(t=>{const a=e.map(e=>{const a=t.find(t=>t.id===e.id);return e.position=a?.position||e.position,{id:e.id,item:e,type:a?"replace":"add"}});return t.find(e=>e.id===`${H.Source}-${_t.NoData}`)&&a.push({id:`${H.Source}-${_t.NoData}`,type:"remove"}),ei(a,t)})):u(t)}var e},[i,o,l,s,c]),a(()=>{g((({theme:e,nodes:t,serviceMap:a})=>{const i=[];return t.forEach(({id:t,data:{id:n,status:o}})=>{const{services:l}=a.find(e=>e.serviceName===n)||{services:[]};l.forEach(a=>{const n=t,l=`${H.Source}-${a.serviceName}-${_t.MapItem}`,r=o===ie.Error;i.push({id:`${n}-to-${l}`,source:n,target:l,markerEnd:{type:Xa.ArrowClosed},style:{stroke:r?e?.colors.dark_red:e?.colors.border}})})}),i})({theme:n,nodes:d,serviceMap:i}))},[n,d,i]),e.createElement(rl,{ref:r,$heightToRemove:t},e.createElement(Jt,{nodes:d,edges:h,onNodesChange:p,onEdgesChange:y,zoomOnScroll:!0}))},dl=d.div`
408
+ `,rl={namespace:"",name:"",kind:"",otelServiceName:"user",selected:!0,numberOfInstances:0,dataStreamNames:[],containers:[],conditions:[]},sl=({heightToRemove:t,serviceMap:i})=>{const n=O.useTheme(),{sources:o,sourcesLoading:l}=V(),{containerRef:r,containerHeight:s,containerWidth:c}=_e(),[d,u,p]=Xa([]),[h,g,y]=Za([]);return a(()=>{if(s&&c){const t=(({sources:e,serviceMap:t,containerHeight:a,containerWidth:i})=>{const n=[],o=new Map,l=((e,t)=>{const a=new Map,i=new Map,n=new Map,o=new Set;e.forEach(e=>{o.add(e.serviceName),e.services.forEach(e=>{o.add(e.serviceName)})}),o.forEach(e=>{i.set(e,[]),n.set(e,0)}),e.forEach(e=>{e.services.forEach(t=>{i.get(e.serviceName)?.push(t.serviceName);const a=n.get(t.serviceName)||0;n.set(t.serviceName,a+1)})});const l=[],r=[];for(o.forEach(e=>{0===(n.get(e)||0)&&r.push(e)});r.length>0;){const e=[],t=r.length;for(let a=0;a<t;a++){const t=r.shift();e.push(t),i.get(t)?.forEach(e=>{const t=n.get(e)||0;n.set(e,t-1),t-1==0&&r.push(e)})}e.length>0&&l.push(e)}return o.forEach(e=>{l.flat().includes(e)||(0===l.length?l.push([e]):l[l.length-1].push(e))}),l.forEach((e,i)=>{const n=100+150*i,o=150*(e.length-1),l=(t-o)/2;e.forEach((e,t)=>{const i=l+150*t,o=n;a.set(e,{x:i,y:o})})}),a})(t,i);if(t.length&&e.length){t.forEach(t=>{const a=t.serviceName;if(n.find(e=>e.id===`${z.Source}-${a}-${Wt.MapItem}`))return;const i=e.find(e=>a===e.otelServiceName||a===e.name);o.set(a,t),t.services.forEach(e=>o.set(e.serviceName,{serviceName:e.serviceName,services:[]})),n.push({id:`${z.Source}-${a}-${Wt.MapItem}`,type:Wt.MapItem,position:l.get(a),data:nl(t,i,ol(i))})}),o.forEach((t,a)=>{if(n.find(e=>e.id===`${z.Source}-${a}-${Wt.MapItem}`))return;const i=e.find(e=>a===e.otelServiceName||a===e.name);n.push({id:`${z.Source}-${a}-${Wt.MapItem}`,type:Wt.MapItem,position:l.get(a),data:nl(t,i,ol(i))})});let a=50;e.forEach(e=>{const t=e.otelServiceName||e.name;n.find(e=>e.id===`${z.Source}-${t}-${Wt.MapItem}`)||(n.push({id:`${z.Source}-${t}-${Wt.MapItem}`,type:Wt.MapItem,position:{x:a,y:10},data:nl(void 0,e,ol(e))}),a+=110)})}else n.push({id:`${z.Source}-${Wt.NoData}`,type:Wt.NoData,position:{x:i/2-150,y:a/4},data:{subTitle:m.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return n})({serviceMap:i,sources:[rl].concat(o),sourcesLoading:l,containerHeight:s,containerWidth:c});d.length>1?(e=t,u(t=>{const a=e.map(e=>{const a=t.find(t=>t.id===e.id);return e.position=a?.position||e.position,{id:e.id,item:e,type:a?"replace":"add"}});return t.find(e=>e.id===`${z.Source}-${Wt.NoData}`)&&a.push({id:`${z.Source}-${Wt.NoData}`,type:"remove"}),Qa(a,t)})):u(t)}var e},[i,o,l,s,c]),a(()=>{g((({theme:e,nodes:t,serviceMap:a})=>{const i=[];return t.forEach(({id:t,data:{id:n,status:o}})=>{const{services:l}=a.find(e=>e.serviceName===n)||{services:[]};l.forEach(a=>{const n=t,l=`${z.Source}-${a.serviceName}-${Wt.MapItem}`,r=o===ie.Error;i.push({id:`${n}-to-${l}`,source:n,target:l,markerEnd:{type:Ya.ArrowClosed},style:{stroke:r?e?.colors.dark_red:e?.colors.border}})})}),i})({theme:n,nodes:d,serviceMap:i}))},[n,d,i]),e.createElement(ll,{ref:r,$heightToRemove:t},e.createElement(_t,{nodes:d,edges:h,onNodesChange:p,onEdgesChange:y,zoomOnScroll:!0}))},cl=d.div`
411
409
  display: flex;
412
410
  flex-direction: column;
413
411
  align-items: center;
@@ -417,12 +415,12 @@ import e,{useState as t,useEffect as a,forwardRef as i,useRef as n,useImperative
417
415
  max-height: ${({$isModal:e})=>e?"calc(100vh - 510px)":"calc(100vh - 310px)"};
418
416
  height: fit-content;
419
417
  overflow-y: scroll;
420
- `,ul=d.div`
418
+ `,dl=d.div`
421
419
  width: 100%;
422
420
  padding-bottom: ${({$isOpen:e})=>e?"18px":"0"};
423
421
  border-radius: 16px;
424
422
  background-color: ${({$selected:e,theme:t})=>e?t.colors.majestic_blue+O.opacity.hex["024"]:t.colors.dropdown_bg_2+O.opacity.hex["040"]};
425
- `,pl=d.div`
423
+ `,ul=d.div`
426
424
  display: flex;
427
425
  justify-content: space-between;
428
426
  gap: 12px;
@@ -434,26 +432,26 @@ import e,{useState as t,useEffect as a,forwardRef as i,useRef as n,useImperative
434
432
  background-color: ${({$withClick:e,$selected:t,theme:a})=>e&&(t?a.colors.majestic_blue+O.opacity.hex["040"]:a.colors.dropdown_bg_2+O.opacity.hex["080"])};
435
433
  transition: background-color 0.3s;
436
434
  }
437
- `,ml=d(pl)`
435
+ `,pl=d(ul)`
438
436
  width: calc(100% - 100px);
439
437
  margin: 0 auto;
440
438
  padding: 8px;
441
- `,hl=d.div`
439
+ `,ml=d.div`
442
440
  position: relative;
443
441
  padding-bottom: ${({$addPadding:e})=>e?"16px":"0"};
444
- `,gl=d.div`
442
+ `,hl=d.div`
445
443
  position: absolute;
446
444
  top: 6px;
447
445
  left: 18px;
448
- `,yl=d(we)`
446
+ `,gl=d(we)`
449
447
  padding-bottom: ${({$addPadding:e})=>e?"16px":"0"};
450
- `,vl=d.div`
448
+ `,yl=d.div`
451
449
  width: ${({$width:e})=>`${e||42}px`};
452
450
  display: flex;
453
451
  align-items: center;
454
452
  justify-content: flex-end;
455
453
  text-align: right;
456
- `,bl=$e(H.Namespace),fl=({isModal:t=!1,withInstances:a=!0,fetchingNamespace:i,fetchedNamespaces:n,filteredNamespacesAndSources:o,selectedNamespace:l,onSelectNamespace:r,selectedSources:s,onSelectSource:c,selectedFutureApps:d,onSelectFutureApps:u})=>{const p=O.useTheme(),{isVm:h}=Be(),{namespacesLoading:g}=z(),y=Object.entries(o||{});return y?.length?e.createElement(dl,{$isModal:t},y.map(([t,o])=>{const y=s?.[t]||[],v=d?.[t]?.selected||!1,f=y.filter(({selected:e})=>e),x=y.length>0,S=l===t,$=f.length>0&&f.length===o.length,k=f.length>0&&f.length!==o.length,C=o.length>0,D=1===o.length;return r||C?e.createElement(ul,{key:`namespace-${t}`,"data-id":`namespace-${t}`,$selected:$,$isOpen:S},e.createElement(pl,{$selected:$,$withClick:!!r,onClick:()=>r?.(t)},e.createElement(ce,{$gap:12},r&&e.createElement(b,{partiallyChecked:k,value:$,onChange:e=>r(t,e)}),e.createElement(bl,null),e.createElement(E,null,t)),e.createElement(ce,{$gap:24},!h&&u&&e.createElement(w,{title:m.FUTURE_APPS_TITLE,tooltip:m.FUTURE_APPS_DESCRIPTION,initialValue:v,onChange:e=>u(e,t),flipHorizontally:!0}),e.createElement(vl,{$width:108},i!==t||n?.includes(t)?null:e.createElement(Ut,{size:10},"Retrieving workloads...")),e.createElement(vl,null,e.createElement(E,{size:10,color:p.text.grey},x?`${f.length}/${o.length}`:null)),r&&e.createElement(mt,{extend:S}))),(S||!r)&&(C?e.createElement(hl,{$addPadding:!c},e.createElement(gl,null,e.createElement(le,{orientation:"vertical",length:(D?24:34*o.length)+"px"})),o.map(i=>{const n=f.some(({name:e})=>e===i.name);return e.createElement(xl,{key:`source-${i.name}`,withInstances:a,source:i,namespace:t,isSelected:n,onSelect:c})})):e.createElement(yl,{$addPadding:!c},g||i===t&&!n?.includes(t)?e.createElement(Ae,null):e.createElement(De,{title:m.NO_SOURCES_NAMESPACE,subTitle:m.TRY_SEARCH_OR_OTHER_NAMESPACE})))):null})):e.createElement(we,null,g||i?e.createElement(Ae,null):e.createElement(De,{title:m.NO_SOURCES,subTitle:!h&&r?m.PLEASE_MAKE_SURE_UNIGNORED_NAMESPACES:m.PLEASE_ADD_SOURCE}))},xl=({withInstances:t,source:a,namespace:i,isSelected:n,onSelect:o})=>e.createElement(ml,{"data-id":`source-${a.name}`,$selected:n,$withClick:!!o,onClick:()=>o?.(a)},e.createElement(ce,{$gap:12},o&&e.createElement(b,{value:n,onChange:()=>o(a,i)}),e.createElement(ce,{$gap:4},e.createElement(E,null,a.name),e.createElement(E,{opacity:.8,size:10},t?` • ${a.numberOfInstances||0} running instance${1!==a.numberOfInstances?"s":""}`:"",` • ${a.kind}`)))),Sl=d.div`
454
+ `,vl=$e(z.Namespace),bl=({isModal:t=!1,withInstances:a=!0,fetchingNamespace:i,fetchedNamespaces:n,filteredNamespacesAndSources:o,selectedNamespace:l,onSelectNamespace:r,selectedSources:s,onSelectSource:c,selectedFutureApps:d,onSelectFutureApps:u})=>{const h=p(),{isVm:g}=Me(),{namespacesLoading:y}=V(),v=Object.entries(o||{});return v?.length?e.createElement(cl,{$isModal:t},v.map(([t,o])=>{const p=s?.[t]||[],v=d?.[t]?.selected||!1,f=p.filter(({selected:e})=>e),x=p.length>0,S=l===t,$=f.length>0&&f.length===o.length,k=f.length>0&&f.length!==o.length,C=o.length>0,D=1===o.length;return r||C?e.createElement(dl,{key:`namespace-${t}`,"data-id":`namespace-${t}`,$selected:$,$isOpen:S},e.createElement(ul,{$selected:$,$withClick:!!r,onClick:()=>r?.(t)},e.createElement(ce,{$gap:12},r&&e.createElement(b,{partiallyChecked:k,value:$,onChange:e=>r(t,e)}),e.createElement(vl,null),e.createElement(E,null,t)),e.createElement(ce,{$gap:24},!g&&u&&e.createElement(w,{title:m.FUTURE_APPS_TITLE,tooltip:m.FUTURE_APPS_DESCRIPTION,initialValue:v,onChange:e=>u(e,t),flipHorizontally:!0}),e.createElement(yl,{$width:108},i!==t||n?.includes(t)?null:e.createElement(Jt,{size:10},"Retrieving workloads...")),e.createElement(yl,null,e.createElement(E,{size:10,color:h.text.grey},x?`${f.length}/${o.length}`:null)),r&&e.createElement(mt,{extend:S}))),(S||!r)&&(C?e.createElement(ml,{$addPadding:!c},e.createElement(hl,null,e.createElement(le,{orientation:"vertical",length:(D?24:34*o.length)+"px"})),o.map(i=>{const n=f.some(({name:e})=>e===i.name);return e.createElement(fl,{key:`source-${i.name}`,withInstances:a,source:i,namespace:t,isSelected:n,onSelect:c})})):e.createElement(gl,{$addPadding:!c},y||i===t&&!n?.includes(t)?e.createElement(Ae,null):e.createElement(De,{title:m.NO_SOURCES_NAMESPACE,subTitle:m.TRY_SEARCH_OR_OTHER_NAMESPACE})))):null})):e.createElement(we,null,y||i?e.createElement(Ae,null):e.createElement(De,{title:m.NO_SOURCES,subTitle:!g&&r?m.PLEASE_MAKE_SURE_UNIGNORED_NAMESPACES:m.PLEASE_ADD_SOURCE}))},fl=({withInstances:t,source:a,namespace:i,isSelected:n,onSelect:o})=>e.createElement(pl,{"data-id":`source-${a.name}`,$selected:n,$withClick:!!o,onClick:()=>o?.(a)},e.createElement(ce,{$gap:12},o&&e.createElement(b,{value:n,onChange:()=>o(a,i)}),e.createElement(ce,{$gap:4},e.createElement(E,null,a.name),e.createElement(E,{opacity:.8,size:10},t?` • ${a.numberOfInstances||0} running instance${1!==a.numberOfInstances?"s":""}`:"",` • ${a.kind}`)))),xl=d.div`
457
455
  display: flex;
458
456
  flex-direction: column;
459
457
  align-items: center;
@@ -462,35 +460,35 @@ import e,{useState as t,useEffect as a,forwardRef as i,useRef as n,useImperative
462
460
  max-height: calc(100vh - 200px);
463
461
  height: fit-content;
464
462
  overflow-y: scroll;
465
- `,$l=({onEditStream:t,onEditSources:a,onEditDestinations:i,categories:n})=>{const{selectedStreamName:o}=We(),{configuredSources:r,configuredDestinations:s,configuredDestinationsUpdateOnly:c}=dt(),d=l(()=>Object.values(r).reduce((e,t)=>e+t.filter(e=>e.selected).length,0),[r]);return e.createElement(te,{$isNotModal:!0},e.createElement(X,{$gap:12},e.createElement(F,{title:m.SUMMARY,description:m.STREAM_CONFIRM}),e.createElement(Sl,null,e.createElement(G,{title:m.STREAM_NAME,action:()=>e.createElement(Gt,{onClick:t}),data:[{title:"",value:o}]}),e.createElement(G,{title:m.SELECTED_SOURCES,titleBadge:d,action:()=>e.createElement(Gt,{onClick:a})},e.createElement(fl,{filteredNamespacesAndSources:r,withInstances:!1})),e.createElement(G,{title:m.SELECTED_DESTINATIONS,titleBadge:s.length+c.length,action:()=>e.createElement(Gt,{onClick:i})},e.createElement(vo,{categories:n})))))};var kl;!function(e){e.Overview="overview",e.InstrumentationRules="InstrumentationRule",e.Sources="Source",e.Actions="Action",e.Destinations="Destination"}(kl||(kl={}));const Cl=({onClickId:a,defaultSelectedId:i,extendedNavIcons:n})=>{const{isVm:o}=Be(),[r,s]=t(i||""),c=l(()=>[{id:kl.Overview,icon:qa,selected:r===kl.Overview,onClick:()=>{s(kl.Overview),a(kl.Overview)},tooltip:"Overview"},...(n||[]).map(e=>({...e,selected:r===e.id,onClick:()=>{s(e.id),e.onClick()}}))],[r]),d=l(()=>{const e=[{id:kl.Sources,icon:Ba,selected:r===kl.Sources,onClick:()=>{s(kl.Sources),a(kl.Sources)},tooltip:"Sources"},{id:kl.Destinations,icon:Wa,selected:r===kl.Destinations,onClick:()=>{s(kl.Destinations),a(kl.Destinations)},tooltip:"Destinations"}];return o||(e.push({id:kl.InstrumentationRules,icon:Ha,selected:r===kl.InstrumentationRules,onClick:()=>{s(kl.InstrumentationRules),a(kl.InstrumentationRules)},tooltip:"Instrumentation Rules"}),e.push({id:kl.Actions,icon:za,selected:r===kl.Actions,onClick:()=>{s(kl.Actions),a(kl.Actions)},tooltip:"Actions"})),e},[o,r]);return e.createElement(Yt,{orientation:"vertical",mainIcons:c,subIcons:d})},wl=({})=>e.createElement(pt,{onClick:()=>window.open("https://join.slack.com/t/odigos/shared_invite/zt-2wc6gm4j9-EhcVFYrLwHqvcIErO9sVzw","_blank","noopener noreferrer"),tooltip:"Join our Slack community"},e.createElement(_a,null)),Dl=(e,t)=>{const{name:a,kind:i,namespace:n}=e,o=[{title:m.KIND,value:i},{title:m.NAME,value:a,tooltip:"Resource name"}];return t||(o.unshift({title:m.NAMESPACE,value:n}),o.push({type:h.Divider}),o.push({type:h.CopyText,value:`kubectl get ${i} ${a} -n ${n}`.toLowerCase()})),o},Tl=d.div`
463
+ `,Sl=({onEditStream:t,onEditSources:a,onEditDestinations:i,categories:n})=>{const{selectedStreamName:o}=We(),{configuredSources:r,configuredDestinations:s,configuredDestinationsUpdateOnly:c}=dt(),d=l(()=>Object.values(r).reduce((e,t)=>e+t.filter(e=>e.selected).length,0),[r]);return e.createElement(te,{$isNotModal:!0},e.createElement(X,{$gap:12},e.createElement(F,{title:m.SUMMARY,description:m.STREAM_CONFIRM}),e.createElement(xl,null,e.createElement(G,{title:m.STREAM_NAME,action:()=>e.createElement(Ut,{onClick:t}),data:[{title:"",value:o}]}),e.createElement(G,{title:m.SELECTED_SOURCES,titleBadge:d,action:()=>e.createElement(Ut,{onClick:a})},e.createElement(bl,{filteredNamespacesAndSources:r,withInstances:!1})),e.createElement(G,{title:m.SELECTED_DESTINATIONS,titleBadge:s.length+c.length,action:()=>e.createElement(Ut,{onClick:i})},e.createElement(yo,{categories:n})))))};var $l;!function(e){e.Overview="overview",e.InstrumentationRules="InstrumentationRule",e.Sources="Source",e.Actions="Action",e.Destinations="Destination"}($l||($l={}));const kl=({onClickId:a,defaultSelectedId:i,extendedNavIcons:n})=>{const{isVm:o}=Me(),[r,s]=t(i||""),c=l(()=>[{id:$l.Overview,icon:qa,selected:r===$l.Overview,onClick:()=>{s($l.Overview),a($l.Overview)},tooltip:"Overview"},...(n||[]).map(e=>({...e,selected:r===e.id,onClick:()=>{s(e.id),e.onClick()}}))],[r]),d=l(()=>{const e=[{id:$l.Sources,icon:Va,selected:r===$l.Sources,onClick:()=>{s($l.Sources),a($l.Sources)},tooltip:"Sources"},{id:$l.Destinations,icon:Ba,selected:r===$l.Destinations,onClick:()=>{s($l.Destinations),a($l.Destinations)},tooltip:"Destinations"}];return o||(e.push({id:$l.InstrumentationRules,icon:Ha,selected:r===$l.InstrumentationRules,onClick:()=>{s($l.InstrumentationRules),a($l.InstrumentationRules)},tooltip:"Instrumentation Rules"}),e.push({id:$l.Actions,icon:za,selected:r===$l.Actions,onClick:()=>{s($l.Actions),a($l.Actions)},tooltip:"Actions"})),e},[o,r]);return e.createElement(Gt,{orientation:"vertical",mainIcons:c,subIcons:d})},Cl=({})=>e.createElement(pt,{onClick:()=>window.open("https://join.slack.com/t/odigos/shared_invite/zt-2wc6gm4j9-EhcVFYrLwHqvcIErO9sVzw","_blank","noopener noreferrer"),tooltip:"Join our Slack community"},e.createElement(Wa,null)),wl=(e,t)=>{const{name:a,kind:i,namespace:n}=e,o=[{title:m.KIND,value:i},{title:m.NAME,value:a,tooltip:"Resource name"}];return t||(o.unshift({title:m.NAMESPACE,value:n}),o.push({type:h.Divider}),o.push({type:h.CopyText,value:`kubectl get ${i} ${a} -n ${n}`.toLowerCase()})),o},Dl=d.div`
466
464
  display: flex;
467
465
  flex-direction: column;
468
466
  gap: 24px;
469
467
  padding: 4px;
470
- `,Nl=({formData:t,handleFormChange:a})=>e.createElement(Tl,null,e.createElement(S,{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:t.otelServiceName,onChange:({target:{value:e}})=>a("otelServiceName",e)})),El=({workloadOdigosHealthStatus:t})=>{if(!t)return null;const a=Xt(t?.status),i=it(t?.reasonEnum),n=t?.message;return e.createElement(ce,{$alignItems:"center",$justifyContent:"center"},e.createElement(se,{status:a,title:i,subtitle:n,withBackground:a!==pe.Disabled,withBorder:!0,withIcon:!0,width:"calc(100% - 24px)"}))},Ol=({source:i,fetchSourceDescribe:n,restartPod:o})=>{const[l,r]=t(!1),[s,d]=t(null);return a(()=>{i&&n({namespace:i.namespace,name:i.name,kind:i.kind}).then(({data:e})=>{e?.describeSource?d(e.describeSource):r(!0)})},[i.namespace,i.name,i.kind]),s||l?e.createElement(X,{$gap:12},l?e.createElement(we,{$height:"70vh"},e.createElement(De,{subTitle:"Could not fetch describe for this source"})):s?.pods?.length?s.pods.map(({podName:t,nodeName:a,phase:n,agentInjected:l,runningLatestWorkloadRevision:r,containers:d,manifestYAML:u})=>{const p=n.status!==ie.Success||Zt(d)?ie.Error:ie.Success,m=[];return m.push(e.createElement(Qt,{key:"copy-text",value:`kubectl get pod ${t.value} -n ${s?.namespace?.value||i.namespace}`.toLowerCase()})),m.push(e.createElement(le,{key:"divider-1",length:"100%",margin:"0"})),m.push(e.createElement(ea,{key:"describe-row-1",title:a.name,tooltip:a.explain||"",value:{status:a.status||void 0,text:a.value}})),m.push(e.createElement(le,{key:"divider-2",length:"100%",margin:"0"})),m.push(e.createElement(ea,{key:"describe-row-2",title:n.name,tooltip:n.explain||"",value:{status:n.status||void 0,text:n.value}})),m.push(e.createElement(le,{key:"divider-3",length:"100%",margin:"0"})),m.push(e.createElement(ea,{key:"describe-row-3",title:l.name,tooltip:l.explain||"",value:{status:l.status||void 0,text:l.value}})),m.push(e.createElement(le,{key:"divider-4",length:"100%",margin:"0"})),r?.name&&(m.push(e.createElement(ea,{key:"describe-row-4",title:r.name,tooltip:r.explain||void 0,value:{status:r.status||void 0,text:r.value}})),m.push(e.createElement(le,{key:"divider-5",length:"100%",margin:"0"}))),d.forEach(t=>{m.push(e.createElement(ta,{key:`pod-container-${t.containerName.value}`,...t}))}),u&&(m.push(e.createElement(le,{key:"divider-6",length:"100%",margin:"0"})),m.push(e.createElement(aa,{key:"yaml-section-card",yaml:u}))),e.createElement(G,{key:`pod-${t.value}`,title:`Pod: ${t.value}`,withExtend:!0,action:({hovered:a})=>e.createElement("div",{style:{position:"relative"}},e.createElement(se,{key:"status",status:p,title:p,withIcon:!0,withBorder:!0}),a&&e.createElement(ia,{key:"hover-actions",isOpen:!0,positionRight:"calc(100% + 12px)",actions:[{id:na(),label:"Restart",rightIcon:Oa,onClick:()=>o(s?.namespace?.value||i.namespace,t.value)}]}))},c.toArray(m))}):e.createElement(we,{$height:"70vh"},e.createElement(De,{subTitle:"Check if you have any running pods and try again"}))):e.createElement(we,{$height:"70vh"},e.createElement(Ae,null))},Al=d(ce)`
468
+ `,Tl=({formData:t,handleFormChange:a})=>e.createElement(Dl,null,e.createElement(S,{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:t.otelServiceName,onChange:({target:{value:e}})=>a("otelServiceName",e)})),Nl=({workloadOdigosHealthStatus:t})=>{if(!t)return null;const a=Yt(t?.status),i=it(t?.reasonEnum),n=t?.message;return e.createElement(ce,{$alignItems:"center",$justifyContent:"center"},e.createElement(se,{status:a,title:i,subtitle:n,withBackground:a!==pe.Disabled,withBorder:!0,withIcon:!0,width:"calc(100% - 24px)"}))},El=({source:i,fetchSourceDescribe:n,restartPod:o})=>{const[l,r]=t(!1),[s,d]=t(null);return a(()=>{i&&n({namespace:i.namespace,name:i.name,kind:i.kind}).then(({data:e})=>{e?.describeSource?d(e.describeSource):r(!0)})},[i.namespace,i.name,i.kind]),s||l?e.createElement(X,{$gap:12},l?e.createElement(we,{$height:"70vh"},e.createElement(De,{subTitle:"Could not fetch describe for this source"})):s?.pods?.length?s.pods.map(({podName:t,nodeName:a,phase:n,agentInjected:l,runningLatestWorkloadRevision:r,containers:d,manifestYAML:u})=>{const p=n.status!==ie.Success||Xt(d)?ie.Error:ie.Success,m=[];return m.push(e.createElement(Zt,{key:"copy-text",value:`kubectl get pod ${t.value} -n ${s?.namespace?.value||i.namespace}`.toLowerCase()})),m.push(e.createElement(le,{key:"divider-1",length:"100%",margin:"0"})),m.push(e.createElement(Qt,{key:"describe-row-1",title:a.name,tooltip:a.explain||"",value:{status:a.status||void 0,text:a.value}})),m.push(e.createElement(le,{key:"divider-2",length:"100%",margin:"0"})),m.push(e.createElement(Qt,{key:"describe-row-2",title:n.name,tooltip:n.explain||"",value:{status:n.status||void 0,text:n.value}})),m.push(e.createElement(le,{key:"divider-3",length:"100%",margin:"0"})),m.push(e.createElement(Qt,{key:"describe-row-3",title:l.name,tooltip:l.explain||"",value:{status:l.status||void 0,text:l.value}})),m.push(e.createElement(le,{key:"divider-4",length:"100%",margin:"0"})),r?.name&&(m.push(e.createElement(Qt,{key:"describe-row-4",title:r.name,tooltip:r.explain||void 0,value:{status:r.status||void 0,text:r.value}})),m.push(e.createElement(le,{key:"divider-5",length:"100%",margin:"0"}))),d.forEach(t=>{m.push(e.createElement(ea,{key:`pod-container-${t.containerName.value}`,...t}))}),u&&(m.push(e.createElement(le,{key:"divider-6",length:"100%",margin:"0"})),m.push(e.createElement(ta,{key:"yaml-section-card",yaml:u}))),e.createElement(G,{key:`pod-${t.value}`,title:`Pod: ${t.value}`,withExtend:!0,action:({hovered:a})=>e.createElement("div",{style:{position:"relative"}},e.createElement(se,{key:"status",status:p,title:p,withIcon:!0,withBorder:!0}),a&&e.createElement(aa,{key:"hover-actions",isOpen:!0,positionRight:"calc(100% + 12px)",actions:[{id:ia(),label:"Restart",rightIcon:Ea,onClick:()=>o(s?.namespace?.value||i.namespace,t.value)}]}))},c.toArray(m))}):e.createElement(we,{$height:"70vh"},e.createElement(De,{subTitle:"Check if you have any running pods and try again"}))):e.createElement(we,{$height:"70vh"},e.createElement(Ae,null))},Ol=d(ce)`
471
469
  width: 100%;
472
470
  align-items: center;
473
471
  justify-content: space-between;
474
- `,Fl=({source:i,fetchSourceLibraries:n})=>{const o=O.useTheme(),[l,s]=t(!1),[c,d]=t(null);return a(()=>{i&&n({namespace:i.namespace,name:i.name,kind:i.kind}).then(({data:e})=>{e?.instrumentationInstanceComponents?d(wt(e.instrumentationInstanceComponents).sort((e,t)=>e.name.localeCompare(t.name))):s(!0)})},[i.namespace,i.name,i.kind]),c||l?e.createElement(X,{$gap:12},l?e.createElement(we,{$height:"70vh"},e.createElement(De,{subTitle:"Could not fetch libraries for this source"})):c?.length?e.createElement(G,{title:"Instrumented Libraries"},c.map(({name:t,healthy:a,message:i,nonIdentifyingAttributes:n},l)=>e.createElement(r,{key:`library-${t}`},e.createElement(X,{$gap:4,$width:"100%"},e.createElement(Al,{$width:"100%"},e.createElement(E,{size:12,color:o.text.grey},t),e.createElement(ce,{$gap:4},n.map(({key:a,value:i})=>oa(i)&&la(i)&&"is_standard_lib"===a?e.createElement(se,{key:`${t}-${a}`,status:ie.Default,title:"STANDARD",withBorder:!0}):null),"boolean"==typeof a&&e.createElement(se,{status:a?ie.Success:ie.Error,title:a?"HEALTHY":"UNHEALTHY",withBorder:!0}))),i&&e.createElement(E,{size:10,color:o.text.error,align:"right"},i)),l!==c.length-1&&e.createElement(le,{length:"100%",margin:"0"})))):e.createElement(we,{$height:"70vh",$gap:12},e.createElement(De,{title:"No libraries found",subTitle:""}),e.createElement(ae,{type:ie.Warning,message:"This feature is in early development, and has very limited support"}))):e.createElement(we,{$height:"70vh"},e.createElement(Ae,null))};var Il;!function(e){e.Overview="Overview",e.Pods="Pods",e.Libraries="Libraries"}(Il||(Il={}));const Ml=[ca.Deployment,ca.StatefulSet,ca.DaemonSet,ca.DeploymentConfig,ca.Rollout,ca.StaticPod],Rl=[da.Python,da.Go,da.Java],Ll=d.div`
472
+ `,Al=({source:i,fetchSourceLibraries:n})=>{const o=O.useTheme(),[l,s]=t(!1),[c,d]=t(null);return a(()=>{i&&n({namespace:i.namespace,name:i.name,kind:i.kind}).then(({data:e})=>{e?.instrumentationInstanceComponents?d(wt(e.instrumentationInstanceComponents).sort((e,t)=>e.name.localeCompare(t.name))):s(!0)})},[i.namespace,i.name,i.kind]),c||l?e.createElement(X,{$gap:12},l?e.createElement(we,{$height:"70vh"},e.createElement(De,{subTitle:"Could not fetch libraries for this source"})):c?.length?e.createElement(G,{title:"Instrumented Libraries"},c.map(({name:t,healthy:a,message:i,nonIdentifyingAttributes:n},l)=>e.createElement(r,{key:`library-${t}`},e.createElement(X,{$gap:4,$width:"100%"},e.createElement(Ol,{$width:"100%"},e.createElement(E,{size:12,color:o.text.grey},t),e.createElement(ce,{$gap:4},n.map(({key:a,value:i})=>na(i)&&oa(i)&&"is_standard_lib"===a?e.createElement(se,{key:`${t}-${a}`,status:ie.Default,title:"STANDARD",withBorder:!0}):null),"boolean"==typeof a&&e.createElement(se,{status:a?ie.Success:ie.Error,title:a?"HEALTHY":"UNHEALTHY",withBorder:!0}))),i&&e.createElement(E,{size:10,color:o.text.error,align:"right"},i)),l!==c.length-1&&e.createElement(le,{length:"100%",margin:"0"})))):e.createElement(we,{$height:"70vh",$gap:12},e.createElement(De,{title:"No libraries found",subTitle:""}),e.createElement(ae,{type:ie.Warning,message:"This feature is in early development, and has very limited support"}))):e.createElement(we,{$height:"70vh"},e.createElement(Ae,null))};var Fl;!function(e){e.Overview="Overview",e.Pods="Pods",e.Libraries="Libraries"}(Fl||(Fl={}));const Il=[sa.Deployment,sa.StatefulSet,sa.DaemonSet,sa.DeploymentConfig,sa.Rollout,sa.StaticPod],Ml=[ca.Python,ca.Go,ca.Java],Rl=d.div`
475
473
  width: 100%;
476
474
  height: 100%;
477
475
  max-height: calc(100vh - 220px);
478
476
  overflow: overlay;
479
477
  overflow-y: auto;
480
- `,Pl=d.div`
478
+ `,Ll=d.div`
481
479
  display: flex;
482
480
  flex-direction: column;
483
481
  gap: 12px;
484
- `,jl=({persistSources:i,updateSource:o,restartWorkloads:r,fetchSourceById:s,fetchSourceDescribe:c,fetchSourceLibraries:d,restartPod:u})=>{const{isVm:p}=Be(),{sources:h}=z(),{selectedStreamName:g}=We(),{drawerType:y,drawerEntityId:v}=L(),b=l(()=>Ue(h,g),[h,g]),f=n(null),x=y===H.Source,[S,$]=t(!1),[k,C]=t(!1),[w,D]=t(Il.Overview),[T,N]=t(null);a(()=>{x&&v&&s(v).then(e=>N(e||null))},[x,v]);const{formData:O,handleFormChange:A,resetFormData:F,loadFormWithDrawerItem:I}=ra(),M=l(()=>{if(v)return T&&JSON.stringify(zt(T))===JSON.stringify(zt(v))?T:b?.find(e=>JSON.stringify(zt(e))===JSON.stringify(zt(v)))},[v,b,T]);a(()=>{x&&M?I(M):F()},[x,M]);const R=l(()=>{const e=M?.conditions?.find(({type:e})=>"RuntimeDetection"===e);return{description:e?.message,isLoading:e?.status===pe.Loading,containers:M?.containers||[]}},[M]),P=l(()=>{const e=[{label:Il.Overview,onClick:()=>D(Il.Overview),selected:w===Il.Overview}];return Ml.includes(M?.kind)&&e.push({label:Il.Pods,onClick:()=>D(Il.Pods),selected:w===Il.Pods}),M?.containers?.some(({language:e})=>Rl.includes(e))&&e.push({label:Il.Libraries,onClick:()=>D(Il.Libraries),selected:w===Il.Libraries}),e},[w,M]);return M?e.createElement(ki,{ref:f,onClose:()=>{D(Il.Overview),N(null)},title:M.otelServiceName||M.name,titleTooltip:"This attribute is used to identify the name of the service (service.name) that is generating telemetry data.",hideEditTitleFromEdit:!0,icons:Ke(M.containers),isEdit:S,isFormDirty:k,onEdit:w===Il.Overview?e=>{$("boolean"!=typeof e||e)}:void 0,onSave:async()=>{const e=O.otelServiceName!==M.name?O.otelServiceName:"";A("otelServiceName",e),await o(v,{...O,otelServiceName:e}),N(null),C(!1),$(!1)},onDelete:w===Il.Overview?async()=>{const{namespace:e}=M;i({[e]:[{...M,selected:!1,currentStreamName:g}]},{}),N(null),C(!1),$(!1),f.current?.closeDrawer()}:void 0,onCancel:()=>{C(!1),$(!1),A("otelServiceName",M.otelServiceName||M.name||"")},isLastItem:1===b.length,tabs:P,headerActionButtons:[{"data-id":"rollout-restart",variant:"tertiary",onClick:()=>r([v]),children:e.createElement(e.Fragment,null,e.createElement(Pa,null),e.createElement(E,{size:14,family:"secondary",decoration:"underline"},"Restart"))}]},w===Il.Overview?S?e.createElement(Ll,null,e.createElement(Nl,{formData:O,handleFormChange:(...e)=>{C(!0),A(...e),A("currentStreamName",g)}})):e.createElement(Pl,null,e.createElement(El,{workloadOdigosHealthStatus:M.workloadOdigosHealthStatus}),e.createElement(U,{conditions:M.conditions||[]}),e.createElement(G,{title:m.SOURCE_DETAILS,data:M?Dl(M,p):[]}),e.createElement(G,{title:p?m.DETECTED_PROCESSES:m.DETECTED_CONTAINERS,titleBadge:R.isLoading?pe.Loading:R.containers.length,description:R.description||(p?m.DETECTED_PROCESSES_DESCRIPTION:m.DETECTED_CONTAINERS_DESCRIPTION)},R.containers.map(t=>e.createElement(sa,{key:`source-container-${t.containerName}`,...t,callbackRuntimeOverride:e=>o(v,e)}))),e.createElement(aa,{yaml:M.manifestYAML})):w===Il.Pods?e.createElement(Ol,{source:M,fetchSourceDescribe:c,restartPod:u}):e.createElement(Fl,{source:M,fetchSourceLibraries:d})):null},Kl=d.div`
482
+ `,Pl=({persistSources:i,updateSource:o,restartWorkloads:r,fetchSourceById:s,fetchSourceDescribe:c,fetchSourceLibraries:d,restartPod:u})=>{const{isVm:p}=Me(),{sources:h}=V(),{selectedStreamName:g}=We(),{drawerType:y,drawerEntityId:v}=L(),b=l(()=>Ue(h,g),[h,g]),f=n(null),x=y===z.Source,[S,$]=t(!1),[k,C]=t(!1),[w,D]=t(Fl.Overview),[T,N]=t(null);a(()=>{x&&v&&s(v).then(e=>N(e||null))},[x,v]);const{formData:O,handleFormChange:A,resetFormData:F,loadFormWithDrawerItem:I}=la(),M=l(()=>{if(v)return T&&JSON.stringify(zt(T))===JSON.stringify(zt(v))?T:b?.find(e=>JSON.stringify(zt(e))===JSON.stringify(zt(v)))},[v,b,T]);a(()=>{x&&M?I(M):F()},[x,M]);const R=l(()=>{const e=M?.conditions?.find(({type:e})=>"RuntimeDetection"===e);return{description:e?.message,isLoading:e?.status===pe.Loading,containers:M?.containers||[]}},[M]),P=l(()=>{const e=[{label:Fl.Overview,onClick:()=>D(Fl.Overview),selected:w===Fl.Overview}];return p||(Il.includes(M?.kind)&&e.push({label:Fl.Pods,onClick:()=>D(Fl.Pods),selected:w===Fl.Pods}),M?.containers?.some(({language:e})=>Ml.includes(e))&&e.push({label:Fl.Libraries,onClick:()=>D(Fl.Libraries),selected:w===Fl.Libraries})),e},[w,M,p]);return M?e.createElement($i,{ref:f,onClose:()=>{D(Fl.Overview),N(null)},title:M.otelServiceName||M.name,titleTooltip:"This attribute is used to identify the name of the service (service.name) that is generating telemetry data.",hideEditTitleFromEdit:!0,icons:qe(M.containers),isEdit:S,isFormDirty:k,onEdit:w===Fl.Overview?e=>{$("boolean"!=typeof e||e)}:void 0,onSave:async()=>{const e=O.otelServiceName!==M.name?O.otelServiceName:"";A("otelServiceName",e),await o(v,{...O,otelServiceName:e}),N(null),C(!1),$(!1)},onDelete:w===Fl.Overview?async()=>{const{namespace:e}=M;i({[e]:[{...M,selected:!1,currentStreamName:g}]},{}),N(null),C(!1),$(!1),f.current?.closeDrawer()}:void 0,onCancel:()=>{C(!1),$(!1),A("otelServiceName",M.otelServiceName||M.name||"")},isLastItem:1===b.length,tabs:P,headerActionButtons:p?[]:[{"data-id":"rollout-restart",variant:"tertiary",onClick:()=>r([v]),children:e.createElement(e.Fragment,null,e.createElement(La,null),e.createElement(E,{size:14,family:"secondary",decoration:"underline"},"Restart"))}]},w===Fl.Overview?S?e.createElement(Rl,null,e.createElement(Tl,{formData:O,handleFormChange:(...e)=>{C(!0),A(...e),A("currentStreamName",g)}})):e.createElement(Ll,null,e.createElement(Nl,{workloadOdigosHealthStatus:M.workloadOdigosHealthStatus}),e.createElement(U,{conditions:M.conditions||[]}),e.createElement(G,{title:m.SOURCE_DETAILS,data:M?wl(M,p):[]}),e.createElement(G,{title:p?m.DETECTED_PROCESSES:m.DETECTED_CONTAINERS,titleBadge:R.isLoading?pe.Loading:R.containers.length,description:R.description||(p?m.DETECTED_PROCESSES_DESCRIPTION:m.DETECTED_CONTAINERS_DESCRIPTION)},R.containers.map(t=>e.createElement(ra,{key:`source-container-${t.containerName}`,...t,callbackRuntimeOverride:e=>o(v,e)}))),e.createElement(ta,{yaml:M.manifestYAML})):w===Fl.Pods?e.createElement(El,{source:M,fetchSourceDescribe:c,restartPod:u}):e.createElement(Al,{source:M,fetchSourceLibraries:d})):null},jl=d.div`
485
483
  max-width: ${({$fullWidth:e})=>e?"unset":"420px"};
486
484
  width: 100%;
487
- `,Vl=i(({isModal:t,fetchSingleNamespace:a,onClickSummary:i},n)=>{const l=O.useTheme(),{isVm:r}=Be(),s=ua({fetchSingleNamespace:a}),{selectedSources:c,fetchingNamespace:d,selectedAllNamespaces:u,onSelectAllNamespaces:p,getApiSourcesPayload:h,getApiFutureAppsPayload:g,searchText:y,setSearchText:v,searchBy:b,setSearchBy:f,showSelectedOnly:x,setShowSelectedOnly:$,showRunningOnly:k,setShowRunningOnly:C}=s;o(n,()=>({getFormValues:()=>({apps:h(),futureApps:g()})}));const D=Object.values(c).reduce((e,t)=>e+t.filter(e=>e.selected).length,0);return e.createElement(te,{$isNotModal:!t},e.createElement(X,{$gap:12},e.createElement(X,{$gap:24},i&&e.createElement(gt,{onClick:i}),e.createElement(F,{title:m.SELECT_SOURCES,badgeLabel:D,description:m.SELECT_SOURCES_DESCRIPTION}),e.createElement(ce,{$justifyContent:"space-between"},e.createElement(Kl,{$fullWidth:r},e.createElement(S,{placeholder:b===H.Source?m.SEARCH_SOURCES:m.SEARCH_NAMESPACES,icon:Aa,value:y,onChange:e=>v(e.target.value.toLowerCase())})),!r&&e.createElement(A,{options:[{label:m.SOURCE,value:H.Source,selectedBgColor:l.text.secondary,selectedTextColor:l.text.primary},{label:m.NAMESPACE,value:H.Namespace,selectedBgColor:l.text.secondary,selectedTextColor:l.text.primary}],selected:b,setSelected:f})),e.createElement(ce,{$gap:36},e.createElement(w,{title:m.SELECT_ALL,initialValue:u,onChange:p,disabled:!!d}),e.createElement(w,{title:m.ONLY_SELECTED,initialValue:x,onChange:$}),e.createElement(w,{title:m.ONLY_RUNNING_INSTANCES,initialValue:k,onChange:C}))),e.createElement(le,null),e.createElement(fl,{isModal:t,...s})))});Vl.displayName=Vl.name;const ql=({fetchSingleNamespace:t,persistSources:a})=>{const{currentModal:i,setCurrentModal:o}=Z(),l=i===H.Source,r=()=>{o("")},s=async()=>{if(c.current){const{apps:e,futureApps:t}=c.current.getFormValues();a(e,t),r()}},c=n(null);return P({key:"Enter",active:l},s),l?e.createElement(Q,{isOpen:l,onClose:r,header:{title:"Add Source"},actionComponent:e.createElement(ee,{buttons:[{label:"DONE",variant:"primary",onClick:s}]})},e.createElement(Vl,{ref:c,isModal:!0,fetchSingleNamespace:t})):null},Hl=e=>{const t=[{key:"checkbox-and-icon",title:""},{key:"name",title:m.NAME,sortable:!0},{key:"kind",title:"Kind",sortable:!0}];return e||t.push({key:"namespace",title:m.NAMESPACE,sortable:!0}),t.push({key:"containers",title:m.DETECTED_CONTAINERS}),t.push({key:"conditions",title:"Conditions"}),t.push({key:"throughput",title:"Throughput",sortable:!0}),t},zl=({metrics:t,maxHeight:a,maxWidth:i})=>{const n=p(),{isVm:o}=Be(),r=he(),{selectedStreamName:c}=We(),{sources:d,sourcesLoading:u}=z(),{setDrawerType:h,setDrawerEntityId:g}=L(),{selectedSources:y,setSelectedSources:v}=Fe(),{progress:f}=qe(),x=l(()=>f[He.Instrumenting]||f[He.Uninstrumenting]?f[He.Instrumenting]?.percentage||f[He.Uninstrumenting]?.percentage||0:void 0,[f[He.Instrumenting],f[He.Uninstrumenting]]),S=l(()=>Ue(d,c),[d,c]),$=l(()=>Ii({instrumentationRules:[],sources:Je(S,r),actions:[],destinations:[],searchText:r.searchText,selectedCategory:H.Source}).searchResults.find(({category:e})=>e===H.Source)?.entities||[],[S,r]),[k,C]=l(()=>{let e=0;return Object.values(y).forEach(t=>{e+=t.length}),[0!==e,e]},[y]),w=s(e=>{if(e){const e={};$.forEach(t=>{const{namespace:a}=t;e[a]?e[a].push(t):e[a]=[t]}),v(e)}else v({})},[$]),D=s(e=>{const{namespace:t,name:a,kind:i}=e,n={...y};n[t]||(n[t]=[]);const o=n[t].findIndex(e=>e.name===a&&e.kind===i);-1===o?n[t].push(e):n[t].splice(o,1),v(n)},[y]),T=l(()=>$.map(a=>{const i=zt(a),o=JSON.stringify(i),{hasErrors:l,hasWarnings:r,hasDisableds:s}=re(a.conditions||[]),c=!!y[i.namespace]?.find(e=>e.namespace===i.namespace&&e.name===i.name&&e.kind===i.kind);return{status:l?ie.Error:r?ie.Warning:void 0,faded:s,onClick:()=>{h(H.Source),g(i)},cells:[{columnKey:"checkbox-and-icon",component:()=>e.createElement(ce,{$gap:16},e.createElement(b,{value:c,onChange:()=>D(a)}),e.createElement(pa,{icons:Ke(a.containers),id:o}))},{columnKey:"name",value:ve(a,H.Source,{extended:!0})},{columnKey:"kind",value:a.kind,textColor:n.text.info},{columnKey:"namespace",value:a.namespace,textColor:n.text.info},{columnKey:"throughput",value:Re(Nt(t,H.Source,i).throughput),textColor:n.text.info},{columnKey:"conditions",component:()=>e.createElement(Ai,{conditions:a.conditions||[],id:o})},{columnKey:"containers",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:ie.Info,title:ma(a.containers),withBorder:!0}))}]}}),[$,y,t,D]),{badge:N,badgeTooltip:O}=l(()=>$.length!==S.length?{badge:`${$.length}/${S.length}`,badgeTooltip:m.FILTERED_COUNT_TOOLTIP}:{badge:S.length,badgeTooltip:void 0},[$,S]);return e.createElement(fe,{$maxWidth:i},e.createElement(xe,null,e.createElement(b,{partiallyChecked:k&&$?.length!==C,value:k&&$?.length===C,onChange:w,disabled:!$?.length}),e.createElement(Se,{icon:$e(H.Source),title:m.SOURCES,badge:N,badgeTooltip:O,loading:u||"number"==typeof x})),e.createElement(ke,{$maxHeight:a},e.createElement(Ce,{columns:Hl(o),rows:T})),"number"!=typeof x||T.length?T.length?null:e.createElement(we,{style:{marginTop:"2rem"}},e.createElement(De,null)):e.createElement(we,{style:{marginTop:"2rem",gap:"24px"}},e.createElement(Te,{width:420}),e.createElement(ce,{$gap:16},e.createElement(E,{color:n.text.info},f[He.Instrumenting]?"Instrumenting":"Uninstrumenting"," workloads..."),e.createElement(Ne,{label:`${x}%`}))))},Bl=({expiresAt:t})=>{const a=O.useTheme(),{formatTimeAgo:i}=Bt(),n=i(t),o=new Date(t).toDateString().split(" ").slice(1).join(" "),l=ha(t,0)?a.text.error:ha(t,6048e5)?a.text.warning:a.text.success;return e.createElement(E,{size:14,color:l},n," (",o,")")},Wl=d.div`
485
+ `,Kl=i(({isModal:t,fetchSingleNamespace:a,onClickSummary:i},n)=>{const l=p(),{isVm:r}=Me(),s=da({fetchSingleNamespace:a}),{selectedSources:c,fetchingNamespace:d,selectedAllNamespaces:u,onSelectAllNamespaces:h,getApiSourcesPayload:g,getApiFutureAppsPayload:y,searchText:v,setSearchText:b,searchBy:f,setSearchBy:x,showSelectedOnly:$,setShowSelectedOnly:k,showRunningOnly:C,setShowRunningOnly:D}=s;o(n,()=>({getFormValues:()=>({apps:g(),futureApps:y()})}));const T=Object.values(c).reduce((e,t)=>e+t.filter(e=>e.selected).length,0);return e.createElement(te,{$isNotModal:!t},e.createElement(X,{$gap:12},e.createElement(X,{$gap:24},i&&e.createElement(gt,{onClick:i}),e.createElement(F,{title:m.SELECT_SOURCES,badgeLabel:T,description:m.SELECT_SOURCES_DESCRIPTION}),e.createElement(ce,{$justifyContent:"space-between"},e.createElement(jl,{$fullWidth:r},e.createElement(S,{placeholder:f===z.Source?m.SEARCH_SOURCES:m.SEARCH_NAMESPACES,icon:Oa,value:v,onChange:e=>b(e.target.value.toLowerCase())})),!r&&e.createElement(A,{options:[{label:m.SOURCE,value:z.Source,selectedBgColor:l.text.secondary,selectedTextColor:l.text.primary},{label:m.NAMESPACE,value:z.Namespace,selectedBgColor:l.text.secondary,selectedTextColor:l.text.primary}],selected:f,setSelected:x})),e.createElement(ce,{$gap:36},e.createElement(w,{title:m.SELECT_ALL,initialValue:u,onChange:h,disabled:!!d}),e.createElement(w,{title:m.ONLY_SELECTED,initialValue:$,onChange:k}),e.createElement(w,{title:m.ONLY_RUNNING_INSTANCES,initialValue:C,onChange:D}))),e.createElement(le,null),e.createElement(bl,{isModal:t,...s})))});Kl.displayName=Kl.name;const ql=({fetchSingleNamespace:t,persistSources:a})=>{const{currentModal:i,setCurrentModal:o}=Z(),l=i===z.Source,r=()=>{o("")},s=async()=>{if(c.current){const{apps:e,futureApps:t}=c.current.getFormValues();a(e,t),r()}},c=n(null);return P({key:"Enter",active:l},s),l?e.createElement(Q,{isOpen:l,onClose:r,header:{title:"Add Source"},actionComponent:e.createElement(ee,{buttons:[{label:"DONE",variant:"primary",onClick:s}]})},e.createElement(Kl,{ref:c,isModal:!0,fetchSingleNamespace:t})):null},Hl=e=>{const t=[{key:"checkbox-and-icon",title:""},{key:"name",title:m.NAME,sortable:!0},{key:"kind",title:"Kind",sortable:!0}];return e||t.push({key:"namespace",title:m.NAMESPACE,sortable:!0}),t.push({key:"containers",title:m.DETECTED_CONTAINERS}),t.push({key:"conditions",title:"Conditions"}),t.push({key:"throughput",title:"Throughput",sortable:!0}),t},zl=({metrics:t,maxHeight:a,maxWidth:i})=>{const n=p(),{isVm:o}=Me(),r=he(),{selectedStreamName:c}=We(),{sources:d,sourcesLoading:u}=V(),{setDrawerType:h,setDrawerEntityId:g}=L(),{selectedSources:y,setSelectedSources:v}=Fe(),{progress:f}=ze(),x=l(()=>f[Ve.Instrumenting]||f[Ve.Uninstrumenting]?f[Ve.Instrumenting]?.percentage||f[Ve.Uninstrumenting]?.percentage||0:void 0,[f[Ve.Instrumenting],f[Ve.Uninstrumenting]]),S=l(()=>Ue(d,c),[d,c]),$=l(()=>Fi({instrumentationRules:[],sources:Je(S,r),actions:[],destinations:[],searchText:r.searchText,selectedCategory:z.Source}).searchResults.find(({category:e})=>e===z.Source)?.entities||[],[S,r]),[k,C]=l(()=>{let e=0;return Object.values(y).forEach(t=>{e+=t.length}),[0!==e,e]},[y]),w=s(e=>{if(e){const e={};$.forEach(t=>{const{namespace:a}=t;e[a]?e[a].push(t):e[a]=[t]}),v(e)}else v({})},[$]),D=s(e=>{const{namespace:t,name:a,kind:i}=e,n={...y};n[t]||(n[t]=[]);const o=n[t].findIndex(e=>e.name===a&&e.kind===i);-1===o?n[t].push(e):n[t].splice(o,1),v(n)},[y]),T=l(()=>$.map(a=>{const i=zt(a),o=JSON.stringify(i),{hasErrors:l,hasWarnings:r,hasDisableds:s}=re(a.conditions||[]),c=!!y[i.namespace]?.find(e=>e.namespace===i.namespace&&e.name===i.name&&e.kind===i.kind);return{status:l?ie.Error:r?ie.Warning:void 0,faded:s,onClick:()=>{h(z.Source),g(i)},cells:[{columnKey:"checkbox-and-icon",component:()=>e.createElement(ce,{$gap:16},e.createElement(b,{value:c,onChange:()=>D(a)}),e.createElement(ua,{icons:qe(a.containers),id:o}))},{columnKey:"name",value:ve(a,z.Source,{extended:!0})},{columnKey:"kind",value:a.kind,textColor:n.text.info},{columnKey:"namespace",value:a.namespace,textColor:n.text.info},{columnKey:"throughput",value:Le(Nt(t,z.Source,i).throughput),textColor:n.text.info},{columnKey:"conditions",component:()=>e.createElement(Oi,{conditions:a.conditions||[],id:o})},{columnKey:"containers",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:ie.Info,title:pa(a.containers),withBorder:!0}))}]}}),[$,y,t,D]),{badge:N,badgeTooltip:O}=l(()=>$.length!==S.length?{badge:`${$.length}/${S.length}`,badgeTooltip:m.FILTERED_COUNT_TOOLTIP}:{badge:S.length,badgeTooltip:void 0},[$,S]);return e.createElement(fe,{$maxWidth:i},e.createElement(xe,null,e.createElement(b,{partiallyChecked:k&&$?.length!==C,value:k&&$?.length===C,onChange:w,disabled:!$?.length}),e.createElement(Se,{icon:$e(z.Source),title:m.SOURCES,badge:N,badgeTooltip:O,loading:u||"number"==typeof x})),e.createElement(ke,{$maxHeight:a},e.createElement(Ce,{columns:Hl(o),rows:T})),"number"!=typeof x||T.length?T.length?null:e.createElement(we,{style:{marginTop:"2rem"}},e.createElement(De,null)):e.createElement(we,{style:{marginTop:"2rem",gap:"24px"}},e.createElement(Te,{width:420}),e.createElement(ce,{$gap:16},e.createElement(E,{color:n.text.info},f[Ve.Instrumenting]?"Instrumenting":"Uninstrumenting"," workloads..."),e.createElement(Ne,{label:`${x}%`}))))},Vl=({expiresAt:t})=>{const a=O.useTheme(),{formatTimeAgo:i}=Vt(),n=i(t),o=new Date(t).toDateString().split(" ").slice(1).join(" "),l=ma(t,0)?a.text.error:ma(t,6048e5)?a.text.warning:a.text.success;return e.createElement(E,{size:14,color:l},n," (",o,")")},Bl=d.div`
488
486
  position: relative;
489
- `,_l=({token:a,saveToken:i})=>{const{CopyButton:n}=ga(),{formData:o,handleFormChange:l,resetFormData:r}=ya({token:a}),[s,c]=t(!1),d=()=>{c(!1),r()};return e.createElement(ce,{$gap:0},e.createElement(n,{value:a,size:va.L}),e.createElement(le,{orientation:"vertical",length:"12px"}),e.createElement(Wl,null,e.createElement(pt,{size:32,onClick:()=>{c(!0)}},e.createElement(Da,null)),s&&e.createElement(ba,{flipX:!0,clientX:36,isOpen:s,onClose:d,onSave:()=>{i(o.token).then(d)},title:"Enter a new API Token",titleTooltip:"Contact us to generate a new one"},e.createElement(S,{placeholder:"API Token",type:"password",value:o.token,onChange:e=>l("token",e.target.value)}))))},Jl=({tokens:t,saveToken:a})=>e.createElement(G,{title:"Authorization Tokens",titleBadge:t.length,data:[{type:h.Table,value:{columns:[{key:"icon",title:""},{key:"name",title:"Name"},{key:"expires_at",title:"Expires"},{key:"token",title:"Token"},{key:"actions",title:""}],rows:t.map(({name:t,token:i,expiresAt:n})=>({cells:[{columnKey:"icon",icon:Ja},{columnKey:"name",value:t},{columnKey:"token",value:`${new Array(15).fill("•").join("")}`},{columnKey:"expires_at",component:()=>e.createElement(Bl,{expiresAt:n})},{columnKey:"actions",component:()=>e.createElement(_l,{token:i,saveToken:a})}]}))}}]}),Ul=({fetchDescribeOdigos:i})=>{const[n,o]=t(null);if(a(()=>{i().then(({data:e})=>o(e?.describeOdigos||null))},[]),!n)return e.createElement(we,null,e.createElement(Ae,null));const l=t=>t?.name?[e.createElement(le,{key:`divider-${t.name}`}),e.createElement(ea,{key:`describe-row-${t.name}`,title:t.name,subTitle:t.explain||void 0,value:{status:t.status||(oa(t.value)?la(t.value)?ie.Success:ie.Error:ie.Default),text:t.value}})]:[];return e.createElement(e.Fragment,null,e.createElement(G,{title:"General Information",withExtend:!0,initialExtended:!0,data:[{title:n?.odigosVersion?.name,value:n?.odigosVersion?.value},{title:n?.kubernetesVersion?.name,value:n?.kubernetesVersion?.value},{title:n?.installationMethod?.name,value:n?.installationMethod?.value},{title:n?.tier?.name,value:n?.tier?.value},{title:"# of sources",value:n?.numberOfSources?.toString()},{title:"# of destinations",value:n?.numberOfDestinations?.toString()}]}),e.createElement(G,{title:"Cluster Collector",withExtend:!0},Object.values(n?.clusterCollector||{}).map(l)),e.createElement(G,{title:"Node Collector",withExtend:!0},Object.values(n?.nodeCollector||{}).map(l)))},Gl=d.div`
487
+ `,Wl=({token:a,saveToken:i})=>{const{CopyButton:n}=ha(),{formData:o,handleFormChange:l,resetFormData:r}=ga({token:a}),[s,c]=t(!1),d=()=>{c(!1),r()};return e.createElement(ce,{$gap:0},e.createElement(n,{value:a,size:ya.L}),e.createElement(le,{orientation:"vertical",length:"12px"}),e.createElement(Bl,null,e.createElement(pt,{size:32,onClick:()=>{c(!0)}},e.createElement(wa,null)),s&&e.createElement(va,{flipX:!0,clientX:36,isOpen:s,onClose:d,onSave:()=>{i(o.token).then(d)},title:"Enter a new API Token",titleTooltip:"Contact us to generate a new one"},e.createElement(S,{placeholder:"API Token",type:"password",value:o.token,onChange:e=>l("token",e.target.value)}))))},_l=({tokens:t,saveToken:a})=>e.createElement(G,{title:"Authorization Tokens",titleBadge:t.length,data:[{type:h.Table,value:{columns:[{key:"icon",title:""},{key:"name",title:"Name"},{key:"expires_at",title:"Expires"},{key:"token",title:"Token"},{key:"actions",title:""}],rows:t.map(({name:t,token:i,expiresAt:n})=>({cells:[{columnKey:"icon",icon:_a},{columnKey:"name",value:t},{columnKey:"token",value:`${new Array(15).fill("•").join("")}`},{columnKey:"expires_at",component:()=>e.createElement(Vl,{expiresAt:n})},{columnKey:"actions",component:()=>e.createElement(Wl,{token:i,saveToken:a})}]}))}}]}),Jl=({fetchDescribeOdigos:i})=>{const[n,o]=t(null);if(a(()=>{i().then(({data:e})=>o(e?.describeOdigos||null))},[]),!n)return e.createElement(we,null,e.createElement(Ae,null));const l=t=>t?.name?[e.createElement(le,{key:`divider-${t.name}`}),e.createElement(Qt,{key:`describe-row-${t.name}`,title:t.name,subTitle:t.explain||void 0,value:{status:t.status||(na(t.value)?oa(t.value)?ie.Success:ie.Error:ie.Default),text:t.value}})]:[];return e.createElement(e.Fragment,null,e.createElement(G,{title:"General Information",withExtend:!0,initialExtended:!0,data:[{title:n?.odigosVersion?.name,value:n?.odigosVersion?.value},{title:n?.kubernetesVersion?.name,value:n?.kubernetesVersion?.value},{title:n?.installationMethod?.name,value:n?.installationMethod?.value},{title:n?.tier?.name,value:n?.tier?.value},{title:"# of sources",value:n?.numberOfSources?.toString()},{title:"# of destinations",value:n?.numberOfDestinations?.toString()}]}),e.createElement(G,{title:"Cluster Collector",withExtend:!0},Object.values(n?.clusterCollector||{}).map(l)),e.createElement(G,{title:"Node Collector",withExtend:!0},Object.values(n?.nodeCollector||{}).map(l)))},Ul=d.div`
490
488
  display: flex;
491
489
  flex-direction: column;
492
490
  gap: 12px;
493
- `,Yl="System Overview",Xl=({tokens:a,saveToken:i,fetchDescribeOdigos:n})=>{const[o,l]=t(!1),r=()=>l(e=>!e);return e.createElement(e.Fragment,null,e.createElement(pt,{key:Yl,onClick:r,tooltip:Yl},e.createElement(Ua,{size:18})),e.createElement(K,{width:"750px",isOpen:o,onClose:r,header:{icons:[Ua],title:Yl},footer:{isOpen:!1}},e.createElement(Gl,null,!!a?.length&&e.createElement(Jl,{tokens:a,saveToken:i}),e.createElement(Ul,{fetchDescribeOdigos:n}))))},Zl=d.div`
491
+ `,Gl="System Overview",Yl=({tokens:a,saveToken:i,fetchDescribeOdigos:n})=>{const[o,l]=t(!1),r=()=>l(e=>!e);return e.createElement(e.Fragment,null,e.createElement(pt,{key:Gl,onClick:r,tooltip:Gl},e.createElement(Ja,{size:18})),e.createElement(K,{width:"750px",isOpen:o,onClose:r,header:{icons:[Ja],title:Gl},footer:{isOpen:!1}},e.createElement(Ul,null,!!a?.length&&e.createElement(_l,{tokens:a,saveToken:i}),e.createElement(Jl,{fetchDescribeOdigos:n}))))},Xl=d.div`
494
492
  position: fixed;
495
493
  bottom: 12px;
496
494
  left: 12px;
@@ -499,7 +497,7 @@ import e,{useState as t,useEffect as a,forwardRef as i,useRef as n,useImperative
499
497
  flex-direction: column-reverse;
500
498
  gap: 6px;
501
499
  max-width: 600px;
502
- `,Ql=()=>{const{notifications:t,markAsDismissed:a,markAsSeen:i}=jt(),{onClickNotification:n}=Wt();return e.createElement(Zl,null,t.filter(({dismissed:e})=>!e).map(({id:t,type:o,title:l,message:r,crdType:s,target:c})=>e.createElement(ae,{key:`toast-${t}`,id:t,type:o,title:l,message:r,action:s&&c?{label:"go to details",onClick:()=>n({id:t,crdType:s,target:c},{dismissToast:!0})}:void 0,onClose:()=>(({id:e,asSeen:t})=>{a(e),t&&i(e)})({id:t,asSeen:!0})})))},er=d.div`
500
+ `,Zl=()=>{const{notifications:t,markAsDismissed:a,markAsSeen:i}=jt(),{onClickNotification:n}=Bt();return e.createElement(Xl,null,t.filter(({dismissed:e})=>!e).map(({id:t,type:o,title:l,message:r,crdType:s,target:c})=>e.createElement(ae,{key:`toast-${t}`,id:t,type:o,title:l,message:r,action:s&&c?{label:"go to details",onClick:()=>n({id:t,crdType:s,target:c},{dismissToast:!0})}:void 0,onClose:()=>(({id:e,asSeen:t})=>{a(e),t&&i(e)})({id:t,asSeen:!0})})))},Ql=d.div`
503
501
  position: relative;
504
502
  display: flex;
505
503
  align-items: center;
@@ -518,7 +516,7 @@ import e,{useState as t,useEffect as a,forwardRef as i,useRef as n,useImperative
518
516
  stroke: ${({theme:e})=>e.text.secondary};
519
517
  }
520
518
  }
521
- `,tr=d.div`
519
+ `,er=d.div`
522
520
  position: absolute;
523
521
  top: 2px;
524
522
  left: ${({$darkMode:e})=>e?"2px":"calc(100% - 2px - 24px)"};
@@ -528,50 +526,50 @@ import e,{useState as t,useEffect as a,forwardRef as i,useRef as n,useImperative
528
526
  background-color: ${({theme:e})=>e.colors.border};
529
527
  border-radius: 100%;
530
528
  transition: all 0.3s;
531
- `,ar=({path:t})=>e.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",fill:"none"},e.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:t})),ir=()=>{const{darkMode:t,setDarkMode:a}=fa();return e.createElement(er,{onClick:()=>a(!t)},e.createElement(ar,{path:"M14 7.977A4.333 4.333 0 1 1 8.023 2H8a6 6 0 1 0 6 6v-.023Z"}),e.createElement(ar,{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"}),e.createElement(tr,{$darkMode:t}))},nr=e=>{const{spans:t}=e,a=new Map;t.forEach(e=>{a.set(e.spanID,{...e,spans:[]})});const i=[];return t.forEach(e=>{const t=a.get(e.spanID);let n=!1;if(e.references.length){const t=e.references.find(e=>"CHILD_OF"===e.refType);t&&t.spanID&&a.has(t.spanID)||(n=!0)}else n=!0;if(n)i.push(t);else{const i=e.references.find(e=>"CHILD_OF"===e.refType);if(i){const e=a.get(i.spanID);e&&(e.spans=e.spans||[],e.spans.push(t),e.spans=e.spans.sort((e,t)=>e.startTime-t.startTime))}}}),i.sort((e,t)=>e.startTime-t.startTime)},or=(e,t)=>{const{tags:a}=e,i={},n=[];return a.forEach(e=>{i[e.key]=e.value}),n.push({type:h.Code,value:{language:"json",code:JSON.stringify(i,null,2),pretty:t}}),n},lr=e=>{const{logs:t}=e,a=[];return t.forEach((e,i)=>{e.fields.forEach(e=>{a.push({title:e.key,value:e.value})}),i!==t.length-1&&a.push({type:h.Divider})}),a},rr=e=>{const{traceID:t,spanID:a,processID:i,operationName:n,duration:o,startTime:l,warnings:r}=e,s=[];return s.push({type:h.CopyText,title:"Trace ID",value:t}),s.push({type:h.CopyText,title:"Span ID",value:a}),s.push({type:h.Divider}),s.push({title:"Service",value:i}),s.push({title:"Operation",value:n}),s.push({title:"Duration",value:xa(o)}),s.push({title:"Start time",value:new Date(l/1e3).toLocaleString()}),r.length&&(s.push({type:h.Divider}),s.push({title:"Warnings",titleIcon:Ga,value:r})),s},sr=(e,t)=>{const{tags:a}=e,i={},n=[];return a.forEach(e=>{i[e.key]=e.value}),n.push({type:h.Code,value:{language:"json",code:JSON.stringify(i,null,2),pretty:t}}),n},cr=d.div`
529
+ `,tr=({path:t})=>e.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",fill:"none"},e.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:t})),ar=()=>{const{darkMode:t,setDarkMode:a}=ba();return e.createElement(Ql,{onClick:()=>a(!t)},e.createElement(tr,{path:"M14 7.977A4.333 4.333 0 1 1 8.023 2H8a6 6 0 1 0 6 6v-.023Z"}),e.createElement(tr,{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"}),e.createElement(er,{$darkMode:t}))},ir=e=>{const{spans:t}=e,a=new Map;t.forEach(e=>{a.set(e.spanID,{...e,spans:[]})});const i=[];return t.forEach(e=>{const t=a.get(e.spanID);let n=!1;if(e.references.length){const t=e.references.find(e=>"CHILD_OF"===e.refType);t&&t.spanID&&a.has(t.spanID)||(n=!0)}else n=!0;if(n)i.push(t);else{const i=e.references.find(e=>"CHILD_OF"===e.refType);if(i){const e=a.get(i.spanID);e&&(e.spans=e.spans||[],e.spans.push(t),e.spans=e.spans.sort((e,t)=>e.startTime-t.startTime))}}}),i.sort((e,t)=>e.startTime-t.startTime)},nr=(e,t)=>{const{tags:a}=e,i={},n=[];return a.forEach(e=>{i[e.key]=e.value}),n.push({type:h.Code,value:{language:"json",code:JSON.stringify(i,null,2),pretty:t}}),n},or=e=>{const{logs:t}=e,a=[];return t.forEach((e,i)=>{e.fields.forEach(e=>{a.push({title:e.key,value:e.value})}),i!==t.length-1&&a.push({type:h.Divider})}),a},lr=e=>{const{traceID:t,spanID:a,processID:i,operationName:n,duration:o,startTime:l,warnings:r}=e,s=[];return s.push({type:h.CopyText,title:"Trace ID",value:t}),s.push({type:h.CopyText,title:"Span ID",value:a}),s.push({type:h.Divider}),s.push({title:"Service",value:i}),s.push({title:"Operation",value:n}),s.push({title:"Duration",value:fa(o)}),s.push({title:"Start time",value:new Date(l/1e3).toLocaleString()}),r.length&&(s.push({type:h.Divider}),s.push({title:"Warnings",titleIcon:Ua,value:r})),s},rr=(e,t)=>{const{tags:a}=e,i={},n=[];return a.forEach(e=>{i[e.key]=e.value}),n.push({type:h.Code,value:{language:"json",code:JSON.stringify(i,null,2),pretty:t}}),n},sr=d.div`
532
530
  display: flex;
533
531
  flex-direction: column;
534
532
  gap: 12px;
535
533
  max-height: 100vh;
536
534
  overflow-y: auto;
537
- `,dr=({span:a,process:i,onClose:n})=>{const[o,l]=t(!0),[r,s]=t(!0);return e.createElement(K,{width:"750px",isOpen:!0,onClose:n,header:{icons:[Ya],title:a.operationName},footer:{isOpen:!1}},e.createElement(cr,null,e.createElement(G,{title:"Details",data:rr(a)}),a.logs.length>0&&e.createElement(G,{title:"Errors",titleBadge:a.logs.length,titleIcon:Ga,data:lr(a)}),e.createElement(G,{title:"Tags",data:or(a,o),action:e.createElement(Sa,{isPrettyMode:o,setIsPrettyMode:l})}),i&&e.createElement(G,{title:`Process (${i.serviceName})`,data:sr(i,r),action:e.createElement(Sa,{isPrettyMode:r,setIsPrettyMode:s})})))},ur=370,pr=["#33DCA7","#50F6E8","#444AD9","#8B55FF","#FF7CA9"].reverse(),mr=d.div`
535
+ `,cr=({span:a,process:i,onClose:n})=>{const[o,l]=t(!0),[r,s]=t(!0);return e.createElement(K,{width:"750px",isOpen:!0,onClose:n,header:{icons:[Ga],title:a.operationName},footer:{isOpen:!1}},e.createElement(sr,null,e.createElement(G,{title:"Details",data:lr(a)}),a.logs.length>0&&e.createElement(G,{title:"Errors",titleBadge:a.logs.length,titleIcon:Ua,data:or(a)}),e.createElement(G,{title:"Tags",data:nr(a,o),action:e.createElement(xa,{isPrettyMode:o,setIsPrettyMode:l})}),i&&e.createElement(G,{title:`Process (${i.serviceName})`,data:rr(i,r),action:e.createElement(xa,{isPrettyMode:r,setIsPrettyMode:s})})))},dr=370,ur=["#33DCA7","#50F6E8","#444AD9","#8B55FF","#FF7CA9"].reverse(),pr=d.div`
538
536
  display: flex;
539
537
  align-items: center;
540
- width: ${ur}px;
538
+ width: ${dr}px;
541
539
  background-color: ${({$withErrors:e,theme:t})=>e?t.colors.error+O.opacity.hex["042"]:t.colors.dark_grey};
542
540
  &:hover {
543
541
  ${({$withErrors:e,$preventHover:t,theme:a})=>!t&&`background-color: ${e?a.colors.error:a.colors.secondary+O.opacity.hex["010"]};`}
544
542
  cursor: ${({$preventHover:e})=>e?"default":"pointer"};
545
543
  }
546
- `,hr=d(ce)`
544
+ `,mr=d(ce)`
547
545
  align-items: center;
548
546
  justify-content: space-between;
549
547
  gap: 4px;
550
548
  padding: 12px;
551
549
  padding-left: ${({$depth:e})=>12*e||12}px;
552
- width: calc(${ur}px - ${({$depth:e})=>12*e}px);
553
- `,gr=d(ce)`
550
+ width: calc(${dr}px - ${({$depth:e})=>12*e}px);
551
+ `,hr=d(ce)`
554
552
  align-items: center;
555
553
  gap: 4px;
556
554
  position: absolute;
557
555
  right: 56px;
558
556
  width: calc(100% - ${434}px);
559
- `,yr=d.div`
557
+ `,gr=d.div`
560
558
  position: absolute;
561
559
  left: ${({$startTime:e,$minStartTime:t,$maxEndTime:a})=>(e-t)/(a-t)*100+"%"};
562
560
  width: ${({$duration:e,$maxDuration:t})=>e/t*100+"%"};
563
561
  height: 12px;
564
562
  border-radius: 32px;
565
- background-color: ${({$indexInMatrix:e})=>pr[e%pr.length]};
566
- `,vr=d(E)`
563
+ background-color: ${({$indexInMatrix:e})=>ur[e%ur.length]};
564
+ `,yr=d(E)`
567
565
  padding-left: calc(100% + 8px);
568
566
  font-size: 10px;
569
567
  color: ${({theme:e})=>e.text.darker_grey};
570
568
  font-family: ${({theme:e})=>e.font_family.secondary};
571
569
  white-space: nowrap;
572
- `,br=({span:a,depth:i,indexInMatrix:n,maxDuration:o,minStartTime:l,maxEndTime:r,withErrors:s,errorTooltip:c,isOpen:d,withToggle:u,onToggleOpen:p,onSelect:m})=>{const h=O.useTheme(),[g,y]=t(!1),v=ur-12*i-20-(s?12:0),b=s&&(1===i||a.logs.length>0);return e.createElement(mr,{className:"span-container",$withErrors:s,$preventHover:g,onClick:m},e.createElement(hr,{$depth:i,className:"span-left"},e.createElement(ce,{$gap:4,$alignItems:"center"},u?e.createElement("div",{onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1)},e.createElement(pt,{onClick:e=>{e.stopPropagation(),p?.()},size:24},e.createElement(mt,{extend:d??!1}))):e.createElement("div",{style:{width:"24px"}}),e.createElement(ka,{maxWidth:v/2,text:a.processID,textSize:14}),e.createElement(E,{size:12,color:h.text.darker_grey},"•"),e.createElement(ka,{maxWidth:v/2,text:a.operationName,textSize:12,textColor:h.text.darker_grey})),s&&(b?e.createElement(ue,{...c},e.createElement(Ga,{fill:h.text.error})):e.createElement("div",{style:{position:"relative"}},e.createElement("div",{style:{position:"absolute",top:"-24px",right:"8px"}},e.createElement(le,{type:ie.Error,orientation:"vertical",thickness:1,length:"48px",margin:"0",opacity:.5}))))),e.createElement(gr,{className:"span-right"},e.createElement(yr,{$indexInMatrix:n,$duration:a.duration,$maxDuration:o,$startTime:a.startTime,$minStartTime:l,$maxEndTime:r},e.createElement(vr,null,xa(a.duration)))))},fr=({spans:t,logs:a,depth:i,indexInMatrix:n,maxDuration:o,minStartTime:l,maxEndTime:r,openSpanIdsState:s,selectedSpanState:c})=>{const d=O.useTheme();return t.map((t,u)=>{const p=t.spanID,m=s.value.includes(p),h=!!t.spans?.length,g=a.length?a:$a(t,"spans","logs"),y=g.length>0,v=y?g.length>1?`(${g.length}) errors`:g[0].fields.find(e=>"exception.message"===e.key)?.value:void 0,b=y?g.length>1?void 0:g[0].fields.find(e=>"exception.stacktrace"===e.key)?.value:void 0;return e.createElement("div",{key:`span-${p}`,style:{borderBottom:1===i?`1px dotted ${d.colors.border}`:"none"}},e.createElement(br,{span:t,depth:i,indexInMatrix:n+u+i,maxDuration:o,minStartTime:l,maxEndTime:r,withErrors:y,errorTooltip:{titleIcon:Ga,title:v,text:b},isOpen:m,withToggle:h,onToggleOpen:()=>s.set(e=>e.some(e=>e===p)?e.filter(e=>e!=p):[...e,p,...$a(t,"spans","spanID")]),onSelect:()=>c.set(e=>e?.spanID===p?null:t)}),m&&h?e.createElement(fr,{spans:t.spans||[],logs:g,depth:i+1,indexInMatrix:n+u,maxDuration:o,minStartTime:l,maxEndTime:r,openSpanIdsState:s,selectedSpanState:c}):null)})},xr=d.div`
570
+ `,vr=({span:a,depth:i,indexInMatrix:n,maxDuration:o,minStartTime:l,maxEndTime:r,withErrors:s,errorTooltip:c,isOpen:d,withToggle:u,onToggleOpen:p,onSelect:m})=>{const h=O.useTheme(),[g,y]=t(!1),v=dr-12*i-20-(s?12:0),b=s&&(1===i||a.logs.length>0);return e.createElement(pr,{className:"span-container",$withErrors:s,$preventHover:g,onClick:m},e.createElement(mr,{$depth:i,className:"span-left"},e.createElement(ce,{$gap:4,$alignItems:"center"},u?e.createElement("div",{onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1)},e.createElement(pt,{onClick:e=>{e.stopPropagation(),p?.()},size:24},e.createElement(mt,{extend:d??!1}))):e.createElement("div",{style:{width:"24px"}}),e.createElement($a,{maxWidth:v/2,text:a.processID,textSize:14}),e.createElement(E,{size:12,color:h.text.darker_grey},"•"),e.createElement($a,{maxWidth:v/2,text:a.operationName,textSize:12,textColor:h.text.darker_grey})),s&&(b?e.createElement(ue,{...c},e.createElement(Ua,{fill:h.text.error})):e.createElement("div",{style:{position:"relative"}},e.createElement("div",{style:{position:"absolute",top:"-24px",right:"8px"}},e.createElement(le,{type:ie.Error,orientation:"vertical",thickness:1,length:"48px",margin:"0",opacity:.5}))))),e.createElement(hr,{className:"span-right"},e.createElement(gr,{$indexInMatrix:n,$duration:a.duration,$maxDuration:o,$startTime:a.startTime,$minStartTime:l,$maxEndTime:r},e.createElement(yr,null,fa(a.duration)))))},br=({spans:t,logs:a,depth:i,indexInMatrix:n,maxDuration:o,minStartTime:l,maxEndTime:r,openSpanIdsState:s,selectedSpanState:c})=>{const d=O.useTheme();return t.map((t,u)=>{const p=t.spanID,m=s.value.includes(p),h=!!t.spans?.length,g=a.length?a:Sa(t,"spans","logs"),y=g.length>0,v=y?g.length>1?`(${g.length}) errors`:g[0].fields.find(e=>"exception.message"===e.key)?.value:void 0,b=y?g.length>1?void 0:g[0].fields.find(e=>"exception.stacktrace"===e.key)?.value:void 0;return e.createElement("div",{key:`span-${p}`,style:{borderBottom:1===i?`1px dotted ${d.colors.border}`:"none"}},e.createElement(vr,{span:t,depth:i,indexInMatrix:n+u+i,maxDuration:o,minStartTime:l,maxEndTime:r,withErrors:y,errorTooltip:{titleIcon:Ua,title:v,text:b},isOpen:m,withToggle:h,onToggleOpen:()=>s.set(e=>e.some(e=>e===p)?e.filter(e=>e!=p):[...e,p,...Sa(t,"spans","spanID")]),onSelect:()=>c.set(e=>e?.spanID===p?null:t)}),m&&h?e.createElement(br,{spans:t.spans||[],logs:g,depth:i+1,indexInMatrix:n+u,maxDuration:o,minStartTime:l,maxEndTime:r,openSpanIdsState:s,selectedSpanState:c}):null)})},fr=d.div`
573
571
  width: 100%;
574
- `,Sr=d.div`
572
+ `,xr=d.div`
575
573
  max-height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px + 2px)`};
576
574
  overflow: auto;
577
575
 
@@ -581,22 +579,22 @@ import e,{useState as t,useEffect as a,forwardRef as i,useRef as n,useImperative
581
579
  border-radius: 24px;
582
580
  border: 1px solid ${({theme:e})=>e.colors.dropdown_bg_2};
583
581
  position: relative;
584
- `,$r=d.div`
582
+ `,Sr=d.div`
585
583
  padding: 12px 12px 12px 24px;
586
- width: calc(${ur}px - 36px);
584
+ width: calc(${dr}px - 36px);
587
585
  background-color: ${({theme:e})=>e.colors.dark_grey};
588
- `,kr=d.div`
586
+ `,$r=d.div`
589
587
  width: 1px;
590
588
  height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px + 2px)`};
591
589
  background: ${({theme:e})=>`linear-gradient(to bottom, ${e.colors.border}, transparent)`};
592
590
 
593
591
  position: absolute;
594
- left: calc(${ur}px + ((100% - ${ur}px) / ${5}) * ${({index:e})=>e});
595
- `,Cr=d(E)`
592
+ left: calc(${dr}px + ((100% - ${dr}px) / ${5}) * ${({index:e})=>e});
593
+ `,kr=d(E)`
596
594
  color: ${({theme:e})=>e.text.darker_grey};
597
595
  font-size: 12px;
598
596
  font-family: ${({theme:e})=>e.font_family.secondary};
599
597
  padding-top: 12px;
600
598
  padding-left: 12px;
601
599
  white-space: nowrap;
602
- `,wr=({heightToRemove:a,traces:i,isLoading:n})=>{const[o,r]=t([]),[s,c]=t(null),d=l(()=>wt(i).sort((e,t)=>t.spans[0].startTime-e.spans[0].startTime).map(e=>({...e,spans:nr(e)})),[i]),u=l(()=>d.reduce((e,t)=>Math.max(e,t.spans.reduce((e,t)=>e+t.duration,0)),0),[d]),p=l(()=>{const e=d.find(e=>e.spans.some(e=>e.spanID===s?.spanID)),t=e?.processes.find(e=>e.serviceName===s?.processID);return t},[d,s]);return e.createElement(e.Fragment,null,e.createElement(xr,{$heightToRemove:a},n?e.createElement(we,{$height:"50vh"},e.createElement(Ae,{scale:1.5})):d.length?e.createElement(Sr,{$heightToRemove:a},e.createElement($r,null,e.createElement(E,null,"Service & operation")),new Array(5).fill(null).map((t,i)=>e.createElement(kr,{key:`${i}-divider`,$heightToRemove:a,index:i},e.createElement(Cr,null,xa(u/5*i)))),d.map((t,a)=>{const{spans:i}=t,n=i.reduce((e,t)=>Math.min(e,t.startTime),Number.MAX_SAFE_INTEGER),l=i.reduce((e,t)=>Math.max(e,t.startTime+t.duration),0);return e.createElement(fr,{key:`recursive-spans-${t.traceID}`,spans:i,logs:[],depth:1,indexInMatrix:a,maxDuration:u,minStartTime:n,maxEndTime:l,openSpanIdsState:{value:o,set:r},selectedSpanState:{value:s,set:c}})})):e.createElement(we,{$height:"50vh"},e.createElement(De,{title:m.NO_TRACES_FOUND,subTitle:m.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}))),s&&e.createElement(dr,{span:s,process:p,onClose:()=>c(null)}))};export{Ti as ActionDrawer,$i as ActionForm,Ei as ActionModal,Ri as ActionTable,Vi as AwaitPipeline,sn as ConditionDropdown,an as DataFlow,Mn as DataFlowActionsMenu,Cn as DataStreamDrawer,$n as DataStreamForm,Ln as DataStreamModal,Rn as DataStreamSelectionForm,Gn as DestinationDrawer,_n as DestinationForm,go as DestinationModal,xo as DestinationSelectionForm,$o as DestinationTable,cn as ErrorDropdown,jo as InstrumentationRuleDrawer,Ro as InstrumentationRuleForm,qo as InstrumentationRuleModal,Bo as InstrumentationRuleTable,mn as KindDropdown,dn as LanguageDropdown,un as MonitorDropdown,_o as MultiSourceControl,pn as NamespaceDropdown,kl as NavIconIds,Zo as NotificationManager,ki as OverviewDrawer,hn as PodsAgentInjectionStatusDropdown,cl as ServiceMap,$l as SetupSummary,Cl as SideNav,wl as SlackInvite,jl as SourceDrawer,Nl as SourceForm,ql as SourceModal,Vl as SourceSelectionForm,zl as SourceTable,Xl as SystemOverview,Ai as TableCellConditions,Ql as ToastList,ir as ToggleDarkMode,wr as TraceView};
600
+ `,Cr=({heightToRemove:a,traces:i,isLoading:n})=>{const[o,r]=t([]),[s,c]=t(null),d=l(()=>wt(i).sort((e,t)=>t.spans[0].startTime-e.spans[0].startTime).map(e=>({...e,spans:ir(e)})),[i]),u=l(()=>d.reduce((e,t)=>Math.max(e,t.spans.reduce((e,t)=>e+t.duration,0)),0),[d]),p=l(()=>{const e=d.find(e=>e.spans.some(e=>e.spanID===s?.spanID)),t=e?.processes.find(e=>e.serviceName===s?.processID);return t},[d,s]);return e.createElement(e.Fragment,null,e.createElement(fr,{$heightToRemove:a},n?e.createElement(we,{$height:"50vh"},e.createElement(Ae,{scale:1.5})):d.length?e.createElement(xr,{$heightToRemove:a},e.createElement(Sr,null,e.createElement(E,null,"Service & operation")),new Array(5).fill(null).map((t,i)=>e.createElement($r,{key:`${i}-divider`,$heightToRemove:a,index:i},e.createElement(kr,null,fa(u/5*i)))),d.map((t,a)=>{const{spans:i}=t,n=i.reduce((e,t)=>Math.min(e,t.startTime),Number.MAX_SAFE_INTEGER),l=i.reduce((e,t)=>Math.max(e,t.startTime+t.duration),0);return e.createElement(br,{key:`recursive-spans-${t.traceID}`,spans:i,logs:[],depth:1,indexInMatrix:a,maxDuration:u,minStartTime:n,maxEndTime:l,openSpanIdsState:{value:o,set:r},selectedSpanState:{value:s,set:c}})})):e.createElement(we,{$height:"50vh"},e.createElement(De,{title:m.NO_TRACES_FOUND,subTitle:m.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}))),s&&e.createElement(cr,{span:s,process:p,onClose:()=>c(null)}))};export{Di as ActionDrawer,Si as ActionForm,Ni as ActionModal,Mi as ActionTable,Ki as AwaitPipeline,rn as ConditionDropdown,tn as DataFlow,In as DataFlowActionsMenu,kn as DataStreamDrawer,Sn as DataStreamForm,Rn as DataStreamModal,Mn as DataStreamSelectionForm,Un as DestinationDrawer,Wn as DestinationForm,ho as DestinationModal,fo as DestinationSelectionForm,So as DestinationTable,sn as ErrorDropdown,Po as InstrumentationRuleDrawer,Mo as InstrumentationRuleForm,qo as InstrumentationRuleModal,Vo as InstrumentationRuleTable,pn as KindDropdown,cn as LanguageDropdown,dn as MonitorDropdown,Wo as MultiSourceControl,un as NamespaceDropdown,$l as NavIconIds,Xo as NotificationManager,$i as OverviewDrawer,mn as PodsAgentInjectionStatusDropdown,sl as ServiceMap,Sl as SetupSummary,kl as SideNav,Cl as SlackInvite,Pl as SourceDrawer,Tl as SourceForm,ql as SourceModal,Kl as SourceSelectionForm,zl as SourceTable,Yl as SystemOverview,Oi as TableCellConditions,Zl as ToastList,ar as ToggleDarkMode,Cr as TraceView};