@odigos/ui-kit 0.0.99 → 0.0.101

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 o,forwardRef as i,useRef as a,useImperativeHandle as n,useMemo as l,Fragment as r,useCallback as s,Children as c}from"react";import d,{css as u}from"styled-components";import{D as p,a as m,A as h,F as g,C as y,b as v,c as b,I as f,d as x,i as C,e as $,f as S,K as k,g as w,h as D,j as N,T,S as I,k as E,l as O,M,m as A,u as F,n as R,o as L,p as P,B as q,q as K,r as H,s as z,E as W,t as B,v as j,w as V,x as U,y as _,z as G,G as J,H as Y,J as X,L as Q,N as Z,O as ee,P as te,Q as oe,R as ie,U as ae,V as ne,W as le,X as re,Y as se,Z as ce,_ as de,$ as ue,a0 as pe,a1 as me,a2 as he,a3 as ge,a4 as ye,a5 as ve,a6 as be,a7 as fe,a8 as xe,a9 as Ce,aa as $e,ab as Se,ac as ke,ad as we,ae as De,af as Ne,ag as Te,ah as Ie,ai as Ee,aj as Oe,ak as Me,al as Ae,am as Fe,an as Re,ao as Le,ap as Pe,aq as qe,ar as Ke,as as He,at as ze,au as We,av as Be,aw as je,ax as Ve,ay as Ue,az as _e,aA as Ge,aB as Je,aC as Ye,aD as Xe,aE as Qe,aF as Ze,aG as et,aH as tt,aI as ot,aJ as it,aK as at,aL as nt,aM as lt,aN as rt,aO as st,aP as ct,aQ as dt,aR as ut,aS as pt,aT as mt,aU as ht,aV as gt,aW as yt,aX as vt,aY as bt,aZ as ft,a_ as xt,a$ as Ct,b0 as $t,b1 as St,b2 as kt,b3 as wt,b4 as Dt,b5 as Nt,b6 as Tt,b7 as It,b8 as Et,b9 as Ot,ba as Mt,bb as At,bc as Ft,bd as Rt,be as Lt,bf as Pt,bg as qt,bh as Kt,bi as Ht,bj as zt,bk as Wt,bl as Bt,bm as jt,bn as Vt,bo as Ut,bp as _t,bq as Gt,br as Jt,bs as Yt,bt as Xt,bu as Qt,bv as Zt,bw as eo,bx as to,by as oo,bz as io,bA as ao,bB as no,bC as lo,bD as ro,bE as so,bF as co,bG as uo,bH as po,bI as mo,bJ as ho,bK as go,bL as yo}from"./chunks/ui-components-675457f7.js";import{CheckCircledIcon as vo,CrossCircledIcon as bo,EditIcon as fo,TrashIcon as xo,OdigosLogoText as Co,SearchIcon as $o,FilterIcon as So,DataStreamsIcon as ko,CheckIcon as wo,OdigosLogo as Do,ArrowIcon as No,PlusIcon as To,RefreshLeftArrowIcon as Io,NotificationIcon as Eo,UserIcon as Oo,ImageErrorIcon as Mo,OverviewIcon as Ao,RulesIcon as Fo,SourcesIcon as Ro,ActionsIcon as Lo,DestinationsIcon as Po,SlackLogo as qo,CopyIcon as Ko,KeyIcon as Ho,TerminalIcon as zo,GearIcon as Wo,WarningTriangleIcon as Bo,TraceViewIcon as jo,ErrorTriangleIcon as Vo}from"./icons.js";import{useNodesState as Uo,useEdgesState as _o,applyNodeChanges as Go,MarkerType as Jo}from"@xyflow/react";import"zustand";import"javascript-time-ago";import"./chunks/vendor-56978108.js";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";const Yo=e=>{const{type:t,spec:{actionName:o,notes:i,signals:a,disabled:n,collectContainerAttributes:l,collectReplicaSetAttributes:r,collectWorkloadId:s,collectClusterId:c,labelsAttributes:d,annotationsAttributes:u,clusterAttributes:g,overwriteExistingValues:y,attributeNamesToDelete:v,renames:b,piiCategories:f,fallbackSamplingRatio:x,samplingPercentage:C,endpointsFilters:$,servicesNameFilters:S,attributeFilters:k}}=e,w=[{title:p.TYPE,value:t},{type:m.ActiveStatus,title:p.STATUS,value:String(!n)},{type:m.Monitors,title:p.SIGNALS_FOR_PROCESSING,value:a.map(e=>e.toLowerCase()).join(", ")},{title:p.NAME,value:o},{title:p.NOTES,value:i},{type:m.Divider}];if(t===h.K8sAttributes&&(w.push({title:"Collect Container Attributes",value:String(l)}),w.push({title:"Collect ReplicaSet Attributes",value:String(r)}),w.push({title:"Collect Workload ID",value:String(s)}),w.push({title:"Collect Cluster ID",value:String(c)}),d?.length&&w.push({type:m.Divider}),d?.forEach(({labelKey:e,attributeKey:t},o)=>{let i="";i+=`Label Key: ${e}\n`,i+=`Attribute Key: ${t}`,w.push({title:"Label"+(d.length>1?` #${o+1}`:""),value:i})}),u?.length&&w.push({type:m.Divider}),u?.forEach(({annotationKey:e,attributeKey:t},o)=>{let i="";i+=`Annotation Key: ${e}\n`,i+=`Attribute Key: ${t}`,w.push({title:"Annotation"+(u.length>1?` #${o+1}`:""),value:i})})),t===h.AddClusterInfo){w.push({title:"Overwrite Existing Values",value:String(y||!1)});let e="";g?.forEach(({attributeName:t,attributeStringValue:o},i)=>{e+=`${t}: ${o}`,i<g.length-1&&(e+=", ")}),w.push({title:"Attributes",value:e})}if(t===h.DeleteAttributes){let e="";v?.forEach((t,o)=>{e+=t,o<v.length-1&&(e+=", ")}),w.push({title:"Attributes",value:e})}if(t===h.RenameAttributes){let e="";const t=Object.entries(b||{});t.forEach(([o,i],a)=>{e+=`${o}: ${i}`,a<t.length-1&&(e+=", ")}),w.push({title:"Attributes",value:e})}if(t===h.PiiMasking){let e="";f?.forEach((t,o)=>{e+=t,o<f.length-1&&(e+=", ")}),w.push({title:"Categories",value:e})}return t===h.ErrorSampler&&w.push({title:"Sampling Ratio",value:String(x)}),t===h.ProbabilisticSampler&&w.push({title:"Sampling Percentage",value:String(C)}),t===h.LatencySampler&&$?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:o,fallbackSamplingRatio:i},a)=>{let n="";n+=`Service Name: ${e}\n`,n+=`HTTP Route: ${t}\n`,n+=`Min. Latency: ${o}\n`,n+=`Fallback Sampling Ratio: ${i}`,w.push({title:"Endpoint"+($.length>1?` #${a+1}`:""),value:n})}),t===h.ServiceNameSampler&&S?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:o},i)=>{let a="";a+=`Service Name: ${e}\n`,a+=`Sampling Ratio: ${t}\n`,a+=`Fallback Sampling Ratio: ${o}`,w.push({title:"Filter"+(S.length>1?` #${i+1}`:""),value:a})}),t===h.SpanAttributeSampler&&k?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:o,condition:i},a)=>{let n="";n+=`Service Name: ${e}\n`,n+=`Attribute Key: ${t}\n`,n+=`Fallback Sampling Ratio: ${o}\n`;const l=Object.keys(i)[0];n+=`Condition: ${l}\n`,n+=`Operation: ${i[l]?.operation}\n`,n+=`Expected Value: ${i[l]?.expectedValue}`,"jsonCondition"===l&&(n+=`\nJSON Path: ${i[l].jsonPath}`),w.push({title:"Filter"+(k.length>1?` #${a+1}`:""),value:n})}),w},Xo=b.PiiCategories,Qo=d.div`
1
+ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperativeHandle as a,useMemo as l,Fragment as r,useCallback as s,Children as c}from"react";import d,{css as u}from"styled-components";import{D as p,a as m,A as h,K as g,F as y,C as v,b,c as f,I as x,d as C,i as $,e as S,f as k,g as w,h as D,j as N,k as T,T as I,S as E,l as O,m as M,M as A,n as F,u as R,o as L,p as q,q as P,B as K,r as H,s as z,t as W,E as B,v as j,w as V,x as U,y as _,z as G,G as J,H as Y,J as X,L as Q,N as Z,O as ee,P as te,Q as oe,R as ie,U as ne,V as ae,W as le,X as re,Y as se,Z as ce,_ as de,$ as ue,a0 as pe,a1 as me,a2 as he,a3 as ge,a4 as ye,a5 as ve,a6 as be,a7 as fe,a8 as xe,a9 as Ce,aa as $e,ab as Se,ac as ke,ad as we,ae as De,af as Ne,ag as Te,ah as Ie,ai as Ee,aj as Oe,ak as Me,al as Ae,am as Fe,an as Re,ao as Le,ap as qe,aq as Pe,ar as Ke,as as He,at as ze,au as We,av as Be,aw as je,ax as Ve,ay as Ue,az as _e,aA as Ge,aB as Je,aC as Ye,aD as Xe,aE as Qe,aF as Ze,aG as et,aH as tt,aI as ot,aJ as it,aK as nt,aL as at,aM as lt,aN as rt,aO as st,aP as ct,aQ as dt,aR as ut,aS as pt,aT as mt,aU as ht,aV as gt,aW as yt,aX as vt,aY as bt,aZ as ft,a_ as xt,a$ as Ct,b0 as $t,b1 as St,b2 as kt,b3 as wt,b4 as Dt,b5 as Nt,b6 as Tt,b7 as It,b8 as Et,b9 as Ot,ba as Mt,bb as At,bc as Ft,bd as Rt,be as Lt,bf as qt,bg as Pt,bh as Kt,bi as Ht,bj as zt,bk as Wt,bl as Bt,bm as jt,bn as Vt,bo as Ut,bp as _t,bq as Gt,br as Jt,bs as Yt,bt as Xt,bu as Qt,bv as Zt,bw as eo,bx as to,by as oo,bz as io,bA as no,bB as ao,bC as lo,bD as ro,bE as so,bF as co,bG as uo,bH as po,bI as mo,bJ as ho,bK as go,bL as yo,bM as vo}from"./chunks/ui-components-365e1848.js";import{CheckCircledIcon as bo,CrossCircledIcon as fo,EditIcon as xo,TrashIcon as Co,OdigosLogoText as $o,SearchIcon as So,FilterIcon as ko,DataStreamsIcon as wo,CheckIcon as Do,OdigosLogo as No,ArrowIcon as To,PlusIcon as Io,RefreshLeftArrowIcon as Eo,NotificationIcon as Oo,UserIcon as Mo,ImageErrorIcon as Ao,OverviewIcon as Fo,RulesIcon as Ro,SourcesIcon as Lo,ActionsIcon as qo,DestinationsIcon as Po,SlackLogo as Ko,CopyIcon as Ho,KeyIcon as zo,TerminalIcon as Wo,GearIcon as Bo,WarningTriangleIcon as jo,TraceViewIcon as Vo,ErrorTriangleIcon as Uo}from"./icons.js";import{useNodesState as _o,useEdgesState as Go,applyNodeChanges as Jo,MarkerType as Yo}from"@xyflow/react";import"zustand";import"javascript-time-ago";import"./chunks/vendor-1dea551d.js";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";const Xo=e=>{const{type:t,spec:{actionName:o,notes:i,signals:n,disabled:a,collectContainerAttributes:l,collectReplicaSetAttributes:r,collectWorkloadId:s,collectClusterId:c,labelsAttributes:d,annotationsAttributes:u,clusterAttributes:y,overwriteExistingValues:v,attributeNamesToDelete:b,renames:f,piiCategories:x,fallbackSamplingRatio:C,samplingPercentage:$,endpointsFilters:S,servicesNameFilters:k,attributeFilters:w}}=e,D=[{title:p.TYPE,value:t},{type:m.ActiveStatus,title:p.STATUS,value:String(!a)},{type:m.Monitors,title:p.SIGNALS_FOR_PROCESSING,value:n.map(e=>e.toLowerCase()).join(", ")},{title:p.NAME,value:o},{title:p.NOTES,value:i},{type:m.Divider}];if(t===h.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:m.Divider}),d?.forEach(({labelKey:e,attributeKey:t,from:o},i)=>{let n="";n+=`Label Key: ${e}\n`,n+=`Attribute Key: ${t}\n`,n+=`From: ${o||g.Pod}\n`,D.push({title:"Label"+(d.length>1?` #${i+1}`:""),value:n})}),u?.length&&D.push({type:m.Divider}),u?.forEach(({annotationKey:e,attributeKey:t,from:o},i)=>{let n="";n+=`Annotation Key: ${e}\n`,n+=`Attribute Key: ${t}\n`,n+=`From: ${o||g.Pod}\n`,D.push({title:"Annotation"+(u.length>1?` #${i+1}`:""),value:n})})),t===h.AddClusterInfo){D.push({title:"Overwrite Existing Values",value:String(v||!1)});let e="";y?.forEach(({attributeName:t,attributeStringValue:o},i)=>{e+=`${t}: ${o}`,i<y.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===h.DeleteAttributes){let e="";b?.forEach((t,o)=>{e+=t,o<b.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===h.RenameAttributes){let e="";const t=Object.entries(f||{});t.forEach(([o,i],n)=>{e+=`${o}: ${i}`,n<t.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===h.PiiMasking){let e="";x?.forEach((t,o)=>{e+=t,o<x.length-1&&(e+=", ")}),D.push({title:"Categories",value:e})}return t===h.ErrorSampler&&D.push({title:"Sampling Ratio",value:String(C)}),t===h.ProbabilisticSampler&&D.push({title:"Sampling Percentage",value:String($)}),t===h.LatencySampler&&S?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:o,fallbackSamplingRatio:i},n)=>{let a="";a+=`Service Name: ${e}\n`,a+=`HTTP Route: ${t}\n`,a+=`Min. Latency: ${o}\n`,a+=`Fallback Sampling Ratio: ${i}`,D.push({title:"Endpoint"+(S.length>1?` #${n+1}`:""),value:a})}),t===h.ServiceNameSampler&&k?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:o},i)=>{let n="";n+=`Service Name: ${e}\n`,n+=`Sampling Ratio: ${t}\n`,n+=`Fallback Sampling Ratio: ${o}`,D.push({title:"Filter"+(k.length>1?` #${i+1}`:""),value:n})}),t===h.SpanAttributeSampler&&w?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:o,condition:i},n)=>{let a="";a+=`Service Name: ${e}\n`,a+=`Attribute Key: ${t}\n`,a+=`Fallback Sampling Ratio: ${o}\n`;const l=Object.keys(i)[0];a+=`Condition: ${l}\n`,a+=`Operation: ${i[l]?.operation}\n`,a+=`Expected Value: ${i[l]?.expectedValue}`,"jsonCondition"===l&&(a+=`\nJSON Path: ${i[l].jsonPath}`),D.push({title:"Filter"+(w.length>1?` #${n+1}`:""),value:a})}),D},Qo=f.PiiCategories,Zo=d.div`
2
2
  display: flex;
3
3
  flex-direction: row;
4
4
  gap: 32px;
@@ -7,49 +7,49 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
7
7
  border-radius: 32px;
8
8
  padding: 8px;
9
9
  `}
10
- `,Zo=[{id:"CREDIT_CARD",label:"Credit Card"}],ei=b.FallbackSamplingRatio,ti=[{title:"Label Key",keyName:"labelKey",placeholder:"app.kubernetes.io/name",required:!0},{title:"Attribute Key",keyName:"attributeKey",placeholder:"app.kubernetes.name",required:!0}],oi=[{title:"Annotation Key",keyName:"annotationKey",placeholder:"kubectl.kubernetes.io/restartedAt",required:!0},{title:"Attribute Key",keyName:"attributeKey",placeholder:"kubectl.kubernetes.restartedAt",required:!0}],ii=b.EndpointsFilters,ai=[{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:x.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:x.Number}],ni=b.AttributeNamesToDelete,li=b.Renames,ri=b.ServicesNameFilters,si=[{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:x.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:x.Number}],ci=b.SamplingPercentage,di=b.AttributeFilters,ui=[{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:x.Number},{title:"Condition",keyName:"condition",tooltip:"An object representing the filters for span attributes filters.",required:!0,componentType:D.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:D.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}],pi={[h.K8sAttributes]:({value:t,setValue:i,formErrors:a})=>(o(()=>{t[b.CollectContainerAttributes]||t[b.CollectReplicaSetAttributes]||t[b.CollectWorkloadId]||t[b.CollectClusterId]||t[b.LabelsAttributes]?.length||t[b.AnnotationsAttributes]?.length||(i(b.CollectContainerAttributes,!0),i(b.CollectReplicaSetAttributes,!0),i(b.CollectWorkloadId,!0),i(b.CollectClusterId,!0),i(b.LabelsAttributes,[]),i(b.AnnotationsAttributes,[]))},[]),e.createElement(e.Fragment,null,e.createElement(y,{title:"Collect Container Attributes",value:t[b.CollectContainerAttributes]||!1,onChange:e=>i(b.CollectContainerAttributes,e),errorMessage:a[b.CollectContainerAttributes]}),e.createElement(y,{title:"Collect ReplicaSet Attributes",value:t[b.CollectReplicaSetAttributes]||!1,onChange:e=>i(b.CollectReplicaSetAttributes,e),errorMessage:a[b.CollectReplicaSetAttributes]}),e.createElement(y,{title:"Collect Workload ID",value:t[b.CollectWorkloadId]||!1,onChange:e=>i(b.CollectWorkloadId,e),errorMessage:a[b.CollectWorkloadId]}),e.createElement(y,{title:"Collect Cluster ID",value:t[b.CollectClusterId]||!1,onChange:e=>i(b.CollectClusterId,e),errorMessage:a[b.CollectClusterId]}),e.createElement($,{columns:ti,value:t[b.LabelsAttributes]||[],onChange:e=>i(b.LabelsAttributes,e),errorMessage:a[b.LabelsAttributes]}),e.createElement($,{columns:oi,value:t[b.AnnotationsAttributes]||[],onChange:e=>i(b.AnnotationsAttributes,e),errorMessage:a[b.AnnotationsAttributes]}))),[h.AddClusterInfo]:({value:t,setValue:o,formErrors:i})=>e.createElement(e.Fragment,null,e.createElement(S,{title:"Overwrite Existing Values",tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",initialValue:t[b.OverwriteExistingValues]||!1,onChange:e=>o(b.OverwriteExistingValues,e)}),e.createElement(k,{title:"Resource Attributes",value:t[b.ClusterAttributes]?.map(e=>({key:e.attributeName,value:e.attributeStringValue}))||[],onChange:e=>o(b.ClusterAttributes,e.map(e=>({attributeName:e.key,attributeStringValue:e.value}))),required:!0,errorMessage:i[b.ClusterAttributes]})),[h.DeleteAttributes]:({value:t,setValue:o,formErrors:i})=>{const a=i[ni],n=t[ni]||[];return e.createElement(w,{title:"Attributes to delete",value:n,onChange:e=>o(ni,e),required:!0,errorMessage:a})},[h.RenameAttributes]:({value:t,setValue:o,formErrors:i})=>{const a=i[li],n=Object.entries(t[li]||{}).map(([e,t])=>({key:e,value:t}));return e.createElement(k,{title:"Attributes to rename",value:n,onChange:e=>{const t={};e.forEach(e=>t[e.key]=e.value),o(li,t)},required:!0,errorMessage:a})},[h.PiiMasking]:({value:i,setValue:a,formErrors:n})=>{const l=n[Xo],r=i[Xo]||[],[s,c]=t(1===r.length);return o(()=>{if(!r.length){const e=Zo.map(({id:e})=>e);a(Xo,e),c(1===Zo.length)}},[]),e.createElement("div",null,e.createElement(g,{title:"Attributes to mask",required:!0}),e.createElement(Qo,{$hasError:!!l},Zo.map(({id:t,label:o})=>e.createElement(y,{key:t,title:o,disabled:s&&r.includes(t),value:r.includes(t),onChange:e=>((e,t)=>{const o=t?[...r,e]:r.filter(t=>t!==e);a(Xo,o),c(1===o.length)})(t,e)}))),!!l&&e.createElement(v,null,l))},[h.ErrorSampler]:({value:t,setValue:o,formErrors:i})=>{const a=i[ei],n=t[ei];return e.createElement(f,{title:"Fallback sampling ratio",required:!0,type:x.Number,min:0,max:100,value:C(n)?"":String(n),onChange:({target:{value:e}})=>{return t=e,o(ei,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:a})},[h.ProbabilisticSampler]:({value:t,setValue:o,formErrors:i})=>{const a=i[ci],n=t[ci];return e.createElement(f,{title:"Sampling percentage",required:!0,type:x.Number,min:0,max:100,value:C(n)?"":String(n),onChange:({target:{value:e}})=>{return t=e,o(ci,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:a})},[h.LatencySampler]:({value:t,setValue:o,formErrors:i})=>{const a=i[ii],n=t[ii]||[];return e.createElement($,{columns:ai,value:n,onChange:e=>{const t=e.map(({serviceName:e,httpRoute:t,minimumLatencyThreshold:o,fallbackSamplingRatio:i})=>({serviceName:e,httpRoute:t,minimumLatencyThreshold:Number(o),fallbackSamplingRatio:Number(i)}));o(ii,t)},errorMessage:a})},[h.ServiceNameSampler]:({value:t,setValue:o,formErrors:i})=>{const a=i[ri],n=t[ri]||[];return e.createElement($,{columns:si,value:n,onChange:e=>{const t=e.map(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:o})=>({serviceName:e,samplingRatio:Number(t),fallbackSamplingRatio:Number(o)}));o(ri,t)},errorMessage:a})},[h.SpanAttributeSampler]:({value:t,setValue:o,formErrors:i})=>{const a=i[di],n=(t[di]||[]).map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:o,condition:i})=>{const a=Object.entries(i).filter(([e,t])=>t)[0][0];return{serviceName:e,attributeKey:t,fallbackSamplingRatio:o,condition:a,operation:i[a]?.operation,expectedValue:i[a]?.expectedValue,jsonPath:i[a]?.jsonPath}});return e.createElement($,{columns:ui,value:n,onChange:e=>{const t=e.map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:o,condition:i,operation:a,expectedValue:n,jsonPath:l})=>{const r={serviceName:e,attributeKey:t,fallbackSamplingRatio:Number(o),condition:{[i]:{operation:a,expectedValue:n}}};return l&&(r.condition[i].jsonPath=l),r});o(di,t)},errorMessage:a,limitFieldsPerRow:3})}},mi=({actionType:t,value:o,setValue:i,formErrors:a})=>{if(!t)return null;const n=pi[t];return n?e.createElement(n,{value:o,setValue:i,formErrors:a}):null},hi=d.div`
10
+ `,ei=[{id:"CREDIT_CARD",label:"Credit Card"}],ti=f.FallbackSamplingRatio,oi=[{value:g.Pod,id:g.Pod},{value:g.Namespace,id:g.Namespace}],ii=[{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",keyName:"from",placeholder:oi[0].value,componentType:"dropdown",options:oi,required:!1}],ni=[{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",keyName:"from",placeholder:oi[0].value,componentType:"dropdown",options:oi,required:!1}],ai=f.EndpointsFilters,li=[{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:C.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:C.Number}],ri=f.AttributeNamesToDelete,si=f.Renames,ci=f.ServicesNameFilters,di=[{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:C.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:C.Number}],ui=f.SamplingPercentage,pi=f.AttributeFilters,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:"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:C.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}],hi={[h.K8sAttributes]:({value:t,setValue:i,formErrors:n})=>(o(()=>{t[f.CollectContainerAttributes]||t[f.CollectReplicaSetAttributes]||t[f.CollectWorkloadId]||t[f.CollectClusterId]||t[f.LabelsAttributes]?.length||t[f.AnnotationsAttributes]?.length||(i(f.CollectContainerAttributes,!0),i(f.CollectReplicaSetAttributes,!0),i(f.CollectWorkloadId,!0),i(f.CollectClusterId,!0),i(f.LabelsAttributes,[]),i(f.AnnotationsAttributes,[]))},[]),e.createElement(e.Fragment,null,e.createElement(v,{title:"Collect Container Attributes",value:t[f.CollectContainerAttributes]||!1,onChange:e=>i(f.CollectContainerAttributes,e),errorMessage:n[f.CollectContainerAttributes]}),e.createElement(v,{title:"Collect ReplicaSet Attributes",value:t[f.CollectReplicaSetAttributes]||!1,onChange:e=>i(f.CollectReplicaSetAttributes,e),errorMessage:n[f.CollectReplicaSetAttributes]}),e.createElement(v,{title:"Collect Workload ID",value:t[f.CollectWorkloadId]||!1,onChange:e=>i(f.CollectWorkloadId,e),errorMessage:n[f.CollectWorkloadId]}),e.createElement(v,{title:"Collect Cluster ID",value:t[f.CollectClusterId]||!1,onChange:e=>i(f.CollectClusterId,e),errorMessage:n[f.CollectClusterId]}),e.createElement(S,{columns:ii,value:t[f.LabelsAttributes]||[],onChange:e=>i(f.LabelsAttributes,e),errorMessage:n[f.LabelsAttributes]}),e.createElement(S,{columns:ni,value:t[f.AnnotationsAttributes]||[],onChange:e=>i(f.AnnotationsAttributes,e),errorMessage:n[f.AnnotationsAttributes]}))),[h.AddClusterInfo]:({value:t,setValue:o,formErrors:i})=>e.createElement(e.Fragment,null,e.createElement(k,{title:"Overwrite Existing Values",tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",initialValue:t[f.OverwriteExistingValues]||!1,onChange:e=>o(f.OverwriteExistingValues,e)}),e.createElement(w,{title:"Resource Attributes",value:t[f.ClusterAttributes]?.map(e=>({key:e.attributeName,value:e.attributeStringValue}))||[],onChange:e=>o(f.ClusterAttributes,e.map(e=>({attributeName:e.key,attributeStringValue:e.value}))),required:!0,errorMessage:i[f.ClusterAttributes]})),[h.DeleteAttributes]:({value:t,setValue:o,formErrors:i})=>{const n=i[ri],a=t[ri]||[];return e.createElement(D,{title:"Attributes to delete",value:a,onChange:e=>o(ri,e),required:!0,errorMessage:n})},[h.RenameAttributes]:({value:t,setValue:o,formErrors:i})=>{const n=i[si],a=Object.entries(t[si]||{}).map(([e,t])=>({key:e,value:t}));return e.createElement(w,{title:"Attributes to rename",value:a,onChange:e=>{const t={};e.forEach(e=>t[e.key]=e.value),o(si,t)},required:!0,errorMessage:n})},[h.PiiMasking]:({value:i,setValue:n,formErrors:a})=>{const l=a[Qo],r=i[Qo]||[],[s,c]=t(1===r.length);return o(()=>{if(!r.length){const e=ei.map(({id:e})=>e);n(Qo,e),c(1===ei.length)}},[]),e.createElement("div",null,e.createElement(y,{title:"Attributes to mask",required:!0}),e.createElement(Zo,{$hasError:!!l},ei.map(({id:t,label:o})=>e.createElement(v,{key:t,title:o,disabled:s&&r.includes(t),value:r.includes(t),onChange:e=>((e,t)=>{const o=t?[...r,e]:r.filter(t=>t!==e);n(Qo,o),c(1===o.length)})(t,e)}))),!!l&&e.createElement(b,null,l))},[h.ErrorSampler]:({value:t,setValue:o,formErrors:i})=>{const n=i[ti],a=t[ti];return e.createElement(x,{title:"Fallback sampling ratio",required:!0,type:C.Number,min:0,max:100,value:$(a)?"":String(a),onChange:({target:{value:e}})=>{return t=e,o(ti,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:n})},[h.ProbabilisticSampler]:({value:t,setValue:o,formErrors:i})=>{const n=i[ui],a=t[ui];return e.createElement(x,{title:"Sampling percentage",required:!0,type:C.Number,min:0,max:100,value:$(a)?"":String(a),onChange:({target:{value:e}})=>{return t=e,o(ui,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:n})},[h.LatencySampler]:({value:t,setValue:o,formErrors:i})=>{const n=i[ai],a=t[ai]||[];return e.createElement(S,{columns:li,value:a,onChange:e=>{const t=e.map(({serviceName:e,httpRoute:t,minimumLatencyThreshold:o,fallbackSamplingRatio:i})=>({serviceName:e,httpRoute:t,minimumLatencyThreshold:Number(o),fallbackSamplingRatio:Number(i)}));o(ai,t)},errorMessage:n})},[h.ServiceNameSampler]:({value:t,setValue:o,formErrors:i})=>{const n=i[ci],a=t[ci]||[];return e.createElement(S,{columns:di,value:a,onChange:e=>{const t=e.map(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:o})=>({serviceName:e,samplingRatio:Number(t),fallbackSamplingRatio:Number(o)}));o(ci,t)},errorMessage:n})},[h.SpanAttributeSampler]:({value:t,setValue:o,formErrors:i})=>{const n=i[pi],a=(t[pi]||[]).map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:o,condition:i})=>{const n=Object.entries(i).filter(([e,t])=>t)[0][0];return{serviceName:e,attributeKey:t,fallbackSamplingRatio:o,condition:n,operation:i[n]?.operation,expectedValue:i[n]?.expectedValue,jsonPath:i[n]?.jsonPath}});return e.createElement(S,{columns:mi,value:a,onChange:e=>{const t=e.map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:o,condition:i,operation:n,expectedValue:a,jsonPath:l})=>{const r={serviceName:e,attributeKey:t,fallbackSamplingRatio:Number(o),condition:{[i]:{operation:n,expectedValue:a}}};return l&&(r.condition[i].jsonPath=l),r});o(pi,t)},errorMessage:n,limitFieldsPerRow:3})}},gi=({actionType:t,value:o,setValue:i,formErrors:n})=>{if(!t)return null;const a=hi[t];return a?e.createElement(a,{value:o,setValue:i,formErrors:n}):null},yi=d.div`
11
11
  display: flex;
12
12
  flex-direction: column;
13
13
  gap: 24px;
14
14
  padding: 4px;
15
- `,gi=d(N)`
15
+ `,vi=d(T)`
16
16
  margin-bottom: 12px;
17
- `,yi=({isUpdate:t,action:o,formData:i,formErrors:a,handleFormChange:n})=>{const l=T.useTheme();return e.createElement(hi,null,t&&e.createElement("div",null,e.createElement(gi,null,"Status"),e.createElement(I,{options:[{icon:vo,label:p.ENABLED,value:!1,selectedBgColor:l.text.success+T.opacity.hex["050"]},{icon:bo,label:p.DISABLED,value:!0,selectedBgColor:l.text.error+T.opacity.hex["050"]}],selected:i.disabled,setSelected:e=>n("disabled",e)})),!t&&e.createElement(E,{title:"",description:o.docsDescription,actionButton:e.createElement(O,{endpoint:o.docsEndpoint})}),e.createElement(M,{title:"Signals for Processing",required:!0,allowedSignals:o.allowedSignals,selectedSignals:i.signals,setSelectedSignals:e=>n("signals",e),errorMessage:a.signals}),!t&&e.createElement(f,{title:"Action name",placeholder:"Use a name that describes the action",value:i.name,onChange:({target:{value:e}})=>n("name",e),errorMessage:a.name}),e.createElement(mi,{actionType:o.type,value:i,setValue:(e,t)=>n(e,t),formErrors:a}),e.createElement(A,{title:"Notes",value:i.notes,onChange:({target:{value:e}})=>n("notes",e),errorMessage:a.notes}))},vi=i(({children:o,width:i=640,title:r,titleTooltip:s,hideEditTitleFromEdit:c,icons:d,iconSrcs:u,isEdit:p=!1,isFormDirty:m=!1,isLastItem:h=!1,onClose:g,onEdit:y,onSave:v,onDelete:b,onCancel:f,tabs:x,headerActionButtons:C},$)=>{const S=T.useTheme(),{isThisPending:k}=F(),{addNotification:w}=R(),{drawerType:D,drawerEntityId:I,setDrawerType:E,setDrawerEntityId:O}=L();P({key:"Enter",active:p},()=>Z());const[M,A]=t(!1),[j,V]=t(!1),U=a(null),_=D===W.Source,G=()=>{A(!1),V(!1)},J=()=>{G(),y&&y(!1),E(null),O(null),g?.()};n($,()=>({closeDrawer:J}));const Y=()=>{U.current?.clearTitle(),f&&f(),G()},X=()=>{const e=U.current?.isTitleDirty();m||e?V(!0):Y()},Q=()=>{A(!0)},Z=()=>{v&&v(U.current?.getTitle()||"")},ee=l(()=>!!D&&k({entityType:D,entityId:I}),[D,I]),te=e=>{w({type:B.Warning,title:"Pending",message:`Cannot click ${e}, ${D} is pending`,hideFromHistory:!0})},oe=C||[];return y&&!p&&oe.push({"data-id":"drawer-edit",variant:"tertiary",onClick:ee?()=>te("edit"):()=>y(!0),children:e.createElement(e.Fragment,null,e.createElement(fo,null),e.createElement(N,{size:14,family:"secondary",decoration:"underline"},"Edit"))}),b&&!p&&oe.push({"data-id":"drawer-delete",variant:"tertiary",onClick:ee?()=>te(_?"uninstrument":"delete"):Q,children:e.createElement(e.Fragment,null,e.createElement(xo,null),e.createElement(N,{color:S.text.error,size:14,family:"secondary",decoration:"underline"},_?q.UNINSTRUMENT:q.DELETE))}),e.createElement(e.Fragment,null,e.createElement(K,{isOpen:!0,onClose:p?X:J,closeOnEscape:!M&&!j,width:`${i+64}px`,header:{icons:d,iconSrcs:u,title:r,titleTooltip:s,replaceTitleWith:!c&&p?e.createElement(bi,{ref:U,title:r}):void 0,actionButtons:oe,tabs:x},footer:{isOpen:p,leftButtons:[{"data-id":"drawer-save",variant:"primary",onClick:Z,children:q.SAVE},{"data-id":"drawer-cancel",variant:"secondary",onClick:X,children:q.CANCEL}],rightButtons:b?[{"data-id":"drawer-delete",variant:"tertiary",onClick:Q,children:e.createElement(e.Fragment,null,e.createElement(xo,null),e.createElement(N,{size:14,color:S.text.error,family:"secondary",decoration:"underline"},q.DELETE))}]:[]}},o),e.createElement(H,{isOpen:M,noOverlay:!0,name:`${D}${r?` (${r})`:""}`,type:D,isLastItem:h,onApprove:()=>{b&&b(),G()},onDeny:G}),e.createElement(z,{isOpen:j,noOverlay:!0,name:"edit mode",onApprove:Y,onDeny:G}))}),bi=i(({title:i},a)=>{const[l,r]=t(i);return o(()=>{r(i)},[i]),n(a,()=>({getTitle:()=>l||i,isTitleDirty:()=>l!==i,clearTitle:()=>r(i)})),e.createElement(f,{"data-id":"title",value:l,onChange:e=>r(e.target.value)})});bi.displayName=bi.name,vi.displayName=vi.name;const fi=d.div`
17
+ `,bi=({isUpdate:t,action:o,formData:i,formErrors:n,handleFormChange:a})=>{const l=I.useTheme();return e.createElement(yi,null,t&&e.createElement("div",null,e.createElement(vi,null,"Status"),e.createElement(E,{options:[{icon:bo,label:p.ENABLED,value:!1,selectedBgColor:l.text.success+I.opacity.hex["050"]},{icon:fo,label:p.DISABLED,value:!0,selectedBgColor:l.text.error+I.opacity.hex["050"]}],selected:i.disabled,setSelected:e=>a("disabled",e)})),!t&&e.createElement(O,{title:"",description:o.docsDescription,actionButton:e.createElement(M,{endpoint:o.docsEndpoint})}),e.createElement(A,{title:"Signals for Processing",required:!0,allowedSignals:o.allowedSignals,selectedSignals:i.signals,setSelectedSignals:e=>a("signals",e),errorMessage:n.signals}),!t&&e.createElement(x,{title:"Action name",placeholder:"Use a name that describes the action",value:i.name,onChange:({target:{value:e}})=>a("name",e),errorMessage:n.name}),e.createElement(gi,{actionType:o.type,value:i,setValue:(e,t)=>a(e,t),formErrors:n}),e.createElement(F,{title:"Notes",value:i.notes,onChange:({target:{value:e}})=>a("notes",e),errorMessage:n.notes}))},fi=i(({children:o,width:i=640,title:r,titleTooltip:s,hideEditTitleFromEdit:c,icons:d,iconSrcs:u,isEdit:p=!1,isFormDirty:m=!1,isLastItem:h=!1,onClose:g,onEdit:y,onSave:v,onDelete:b,onCancel:f,tabs:x,headerActionButtons:C},$)=>{const S=I.useTheme(),{isThisPending:k}=R(),{addNotification:w}=L(),{drawerType:D,drawerEntityId:N,setDrawerType:E,setDrawerEntityId:O}=q();P({key:"Enter",active:p},()=>Z());const[M,A]=t(!1),[F,V]=t(!1),U=n(null),_=D===B.Source,G=()=>{A(!1),V(!1)},J=()=>{G(),y&&y(!1),E(null),O(null),g?.()};a($,()=>({closeDrawer:J}));const Y=()=>{U.current?.clearTitle(),f&&f(),G()},X=()=>{const e=U.current?.isTitleDirty();m||e?V(!0):Y()},Q=()=>{A(!0)},Z=()=>{v&&v(U.current?.getTitle()||"")},ee=l(()=>!!D&&k({entityType:D,entityId:N}),[D,N]),te=e=>{w({type:j.Warning,title:"Pending",message:`Cannot click ${e}, ${D} is pending`,hideFromHistory:!0})},oe=C||[];return y&&!p&&oe.push({"data-id":"drawer-edit",variant:"tertiary",onClick:ee?()=>te("edit"):()=>y(!0),children:e.createElement(e.Fragment,null,e.createElement(xo,null),e.createElement(T,{size:14,family:"secondary",decoration:"underline"},"Edit"))}),b&&!p&&oe.push({"data-id":"drawer-delete",variant:"tertiary",onClick:ee?()=>te(_?"uninstrument":"delete"):Q,children:e.createElement(e.Fragment,null,e.createElement(Co,null),e.createElement(T,{color:S.text.error,size:14,family:"secondary",decoration:"underline"},_?K.UNINSTRUMENT:K.DELETE))}),e.createElement(e.Fragment,null,e.createElement(H,{isOpen:!0,onClose:p?X:J,closeOnEscape:!M&&!F,width:`${i+64}px`,header:{icons:d,iconSrcs:u,title:r,titleTooltip:s,replaceTitleWith:!c&&p?e.createElement(xi,{ref:U,title:r}):void 0,actionButtons:oe,tabs:x},footer:{isOpen:p,leftButtons:[{"data-id":"drawer-save",variant:"primary",onClick:Z,children:K.SAVE},{"data-id":"drawer-cancel",variant:"secondary",onClick:X,children:K.CANCEL}],rightButtons:b?[{"data-id":"drawer-delete",variant:"tertiary",onClick:Q,children:e.createElement(e.Fragment,null,e.createElement(Co,null),e.createElement(T,{size:14,color:S.text.error,family:"secondary",decoration:"underline"},K.DELETE))}]:[]}},o),e.createElement(z,{isOpen:M,noOverlay:!0,name:`${D}${r?` (${r})`:""}`,type:D,isLastItem:h,onApprove:()=>{b&&b(),G()},onDeny:G}),e.createElement(W,{isOpen:F,noOverlay:!0,name:"edit mode",onApprove:Y,onDeny:G}))}),xi=i(({title:i},n)=>{const[l,r]=t(i);return o(()=>{r(i)},[i]),a(n,()=>({getTitle:()=>l||i,isTitleDirty:()=>l!==i,clearTitle:()=>r(i)})),e.createElement(x,{"data-id":"title",value:l,onChange:e=>r(e.target.value)})});xi.displayName=xi.name,fi.displayName=fi.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
- `,xi=d.div`
23
+ `,$i=d.div`
24
24
  display: flex;
25
25
  flex-direction: column;
26
26
  gap: 12px;
27
- `,Ci=({updateAction:o,deleteAction:i})=>{const{actions:n}=j(),{drawerType:r,drawerEntityId:s}=L(),c=a(null),d=r!==W.Action,[u,m]=t(!1),[h,g]=t(!1),{formData:y,formErrors:v,handleFormChange:b,resetFormData:f,validateForm:x,loadFormWithDrawerItem:C}=V(),$=l(()=>{if(d)return null;const e=n?.find(e=>e.id===s);return e&&C(e),e},[d,s,n]);if(!$)return null;const S=U.find(({type:e})=>e===$.type)||U.find(({label:e})=>"Attributes"===e)?.items?.find(({type:e})=>e===$.type)||U.find(({label:e})=>"Samplers"===e)?.items?.find(({type:e})=>e===$.type);return e.createElement(vi,{ref:c,title:$.spec.actionName||$.type,icons:[_($.type)],isEdit:u,isFormDirty:h,onEdit:e=>{m("boolean"!=typeof e||e)},onSave:e=>{if(x({withAlert:!0,alertTitle:Y.Update})){const t=e!==$.type?e:"";b("name",t),o(s,{...y,name:t}),m(!1),g(!1)}},onDelete:()=>{i(s,$.type),m(!1),g(!1),f(),c.current?.closeDrawer()},onCancel:()=>{m(!1),g(!1),C($)}},u&&S?e.createElement(fi,null,e.createElement(yi,{isUpdate:!0,action:S,formData:y,formErrors:v,handleFormChange:(...e)=>{g(!0),b(...e)}})):e.createElement(xi,null,e.createElement(G,{conditions:$.conditions||[]}),e.createElement(J,{title:p.ACTION_DETAILS,data:$?Yo($):[]})))},$i=d(X)`
27
+ `,Si=({updateAction:o,deleteAction:i})=>{const{actions:a}=V(),{drawerType:r,drawerEntityId:s}=q(),c=n(null),d=r!==B.Action,[u,m]=t(!1),[h,g]=t(!1),{formData:y,formErrors:v,handleFormChange:b,resetFormData:f,validateForm:x,loadFormWithDrawerItem:C}=U(),$=l(()=>{if(d)return null;const e=a?.find(e=>e.id===s);return e&&C(e),e},[d,s,a]);if(!$)return null;const S=_.find(({type:e})=>e===$.type)||_.find(({label:e})=>"Attributes"===e)?.items?.find(({type:e})=>e===$.type)||_.find(({label:e})=>"Samplers"===e)?.items?.find(({type:e})=>e===$.type);return e.createElement(fi,{ref:c,title:$.spec.actionName||$.type,icons:[G($.type)],isEdit:u,isFormDirty:h,onEdit:e=>{m("boolean"!=typeof e||e)},onSave:e=>{if(x({withAlert:!0,alertTitle:X.Update})){const t=e!==$.type?e:"";b("name",t),o(s,{...y,name:t}),m(!1),g(!1)}},onDelete:()=>{i(s,$.type),m(!1),g(!1),f(),c.current?.closeDrawer()},onCancel:()=>{m(!1),g(!1),C($)}},u&&S?e.createElement(Ci,null,e.createElement(bi,{isUpdate:!0,action:S,formData:y,formErrors:v,handleFormChange:(...e)=>{g(!0),b(...e)}})):e.createElement($i,null,e.createElement(J,{conditions:$.conditions||[]}),e.createElement(Y,{title:p.ACTION_DETAILS,data:$?Xo($):[]})))},ki=d(Q)`
28
28
  margin-top: 24px;
29
29
  gap: 12px;
30
- `,Si=({createAction:o})=>{const{currentModal:i,setCurrentModal:a}=Q(),n=i===W.Action,{formData:l,formErrors:r,handleFormChange:s,resetFormData:c,validateForm:d}=V(),[u,m]=t(void 0),h=()=>{c(),m(void 0),a("")},g=()=>{if(!d({withAlert:!0,alertTitle:Y.Create}))return null;o(l),h()};return P({key:"Enter",active:n},()=>g()),e.createElement(Z,{isOpen:n,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(E,{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($i,null,e.createElement(oe,{type:B.Warning,message:ie.DEFINED_FOR_ALL_STREAMS(p.ACTIONS)}),e.createElement(ae,{options:U,selectedOption:u,onOptionSelect:e=>{return t=e,c(),s("type",t?.type||""),void m(t);var t},autoFocus:!u?.type})),u?.type?e.createElement("div",null,e.createElement(ne,{margin:"16px 0"}),e.createElement(yi,{action:u,formData:l,formErrors:r,handleFormChange:s})):null))},ki=e=>{const{type:t,spec:{collectContainerAttributes:o,collectReplicaSetAttributes:i,collectWorkloadId:a,collectClusterId:n,labelsAttributes:l,annotationsAttributes:r,clusterAttributes:s,overwriteExistingValues:c,attributeNamesToDelete:d,renames:u,piiCategories:p,fallbackSamplingRatio:m,samplingPercentage:g,endpointsFilters:y,attributeFilters:v,servicesNameFilters:b}}=e;let f="";if(t===h.K8sAttributes&&(o&&(f+="Container Attributes, "),i&&(f+="ReplicaSet Attributes, "),a&&(f+="Workload ID, "),n&&(f+="Cluster ID, "),l?.forEach(({labelKey:e,attributeKey:t},o)=>{f+=`Label: ${e} ${t} `,o===l.length-1&&(f+=", ")}),r?.forEach(({annotationKey:e,attributeKey:t},o)=>{f+=`Annotation: ${e} ${t} `,o===r.length-1&&(f+=", ")})),t===h.AddClusterInfo&&(f+=`Overwrite Existing: ${c}\n`,s?.forEach(({attributeName:e,attributeStringValue:t},o)=>{f+=`${e}: ${t}`,o<s.length-1&&(f+=", ")})),t===h.DeleteAttributes&&d?.forEach((e,t)=>{f+=e,t<d.length-1&&(f+=", ")}),t===h.RenameAttributes){const e=Object.entries(u||{});e.forEach(([t,o],i)=>{f+=`${t}: ${o}`,i<e.length-1&&(f+=", ")})}return t===h.PiiMasking&&p?.forEach((e,t)=>{f+=e,t<p.length-1&&(f+=", ")}),t===h.ErrorSampler&&(f+=String(m)),t===h.ProbabilisticSampler&&(f+=String(g),f+="%"),t===h.LatencySampler&&y?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:o,fallbackSamplingRatio:i},a)=>{f+=`Endpoint${y.length>1?` #${a+1}`:""}=${e}${t}\n`,f+=` Latency=${o}`,f+=` Sampling=${i}`,a<y.length-1&&(f+=", ")}),t===h.ServiceNameSampler&&b?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:o})=>{f+=`Service Name: ${e}, `,f+=`Sampling Ratio: ${t}, `,f+=`Fallback Sampling Ratio: ${o}\n`}),t===h.SpanAttributeSampler&&v?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:o})=>{f+=`Service Name: ${e}, `,f+=`Attribute Key: ${t}, `,f+=`Fallback Sampling Ratio: ${o}\n`}),f},wi=({conditions:t,id:o})=>{const{errors:i,warnings:a,disableds:n,hasLoadings:r}=l(()=>le(t),[t]),s=i.length>0?i:a.length>0?a:n.length>0?n:[];if(s.length>0)return e.createElement("div",{style:{lineHeight:1}},e.createElement(Di,{conditions:s,id:o}));const c=r?ue.Loading:B.Success;return e.createElement("div",{style:{lineHeight:1}},e.createElement(re,{status:c,title:c,withBorder:!0,withIcon:!0}))},Di=({conditions:t,id:o})=>{const i=T.useTheme();return e.createElement(se,null,ce(t).map(({status:t,type:a,reason:n,message:l,lastTransitionTime:r},s)=>{"loading"!==t&&"disabled"!==t||(t=B.Info);const c=pe(t,i);return e.createElement(de,{key:`condition-${o}-${t}-${a}-${s}`,titleIcon:c,title:a,text:l||n||"",timestamp:r},e.createElement(re,{status:t,title:n||a,withBorder:!0,withIcon:!0}))}))},Ni=({instrumentationRules:e,sources:t,actions:o,destinations:i,searchText:a,selectedCategory:n})=>{const l=a?e.filter(e=>e.type?.toLowerCase().includes(a)||e.ruleName?.toLowerCase().includes(a)):e,r=a?t.filter(e=>e.name?.toLowerCase().includes(a)||e.otelServiceName?.toLowerCase().includes(a)||e.namespace?.toLowerCase().includes(a)):t,s=a?o.filter(e=>e.type?.toLowerCase().includes(a)||e.spec.actionName?.toLowerCase().includes(a)):o,c=a?i.filter(e=>e.destinationType.displayName?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):i,d=[{category:W.Source,label:"Sources",count:r.length,entities:[]},{category:W.Action,label:"Actions",count:s.length,entities:[]},{category:W.Destination,label:"Destinations",count:c.length,entities:[]},{category:W.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(n)).map(e=>({...e,entities:e.category===W.InstrumentationRule?l:e.category===W.Source?r:e.category===W.Action?s:e.category===W.Destination?c:[]}));return{categories:d,searchResults:u}},Ti=[{key:"icon",title:""},{key:"name",title:p.NAME,sortable:!0},{key:"signals",title:p.MONITORS},{key:"active-status",title:p.STATUS},{key:"conditions",title:"Conditions"},{key:"type",title:p.TYPE,sortable:!0},{key:"spec",title:"Spec",sortable:!0},{key:"notes",title:p.NOTES,sortable:!0}],Ii=({maxHeight:t,maxWidth:o})=>{const i=T.useTheme(),a=me(),{actions:n,actionsLoading:r}=j(),{setDrawerType:s,setDrawerEntityId:c}=L(),d=l(()=>Ni({instrumentationRules:[],sources:[],actions:he(n,a),destinations:[],searchText:a.searchText,selectedCategory:W.Action}).searchResults.find(({category:e})=>e===W.Action)?.entities||[],[n,a]),u=l(()=>d.map(t=>{const{hasErrors:o,hasWarnings:a,hasDisableds:n}=le(t.conditions||[]);return{status:o?B.Error:a?B.Warning:void 0,faded:n,onClick:()=>{s(W.Action),c(t.id)},cells:[{columnKey:"icon",component:()=>e.createElement(ge,{icon:_(t.type)})},{columnKey:"name",value:ye(t,W.Action,{prioritizeDisplayName:!0})},{columnKey:"type",value:t.type,textColor:i.text.info},{columnKey:"notes",value:t.spec.notes,textColor:i.text.info,withTooltip:!0},{columnKey:"spec",value:ki(t),textColor:i.text.info,withTooltip:!0},{columnKey:"signals",component:()=>e.createElement(ve,{withLabels:!0,monitors:t.spec.signals})},{columnKey:"conditions",component:()=>e.createElement(wi,{conditions:t.conditions||[],id:t.id})},{columnKey:"active-status",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(re,{status:t.spec.disabled?B.Error:B.Success,title:t.spec.disabled?p.DISABLED:p.ENABLED,withIcon:!0,withBorder:!0}))}]}}),[d]),{badge:m,badgeTooltip:h}=l(()=>d.length!==n.length?{badge:`${d.length}/${n.length}`,badgeTooltip:p.FILTERED_COUNT_TOOLTIP}:{badge:n.length,badgeTooltip:void 0},[d,n]);return e.createElement(be,{$maxWidth:o},e.createElement(fe,null,e.createElement(xe,{icon:Ce(W.Action),title:p.ACTIONS,badge:m,badgeTooltip:h,loading:r})),e.createElement($e,{$maxHeight:t},e.createElement(Se,{columns:Ti,rows:u})),!d.length&&e.createElement(ke,{style:{marginTop:"2rem"}},e.createElement(we,null)))},Ei=d(X)`
30
+ `,wi=({createAction:o})=>{const{currentModal:i,setCurrentModal:n}=Z(),a=i===B.Action,{formData:l,formErrors:r,handleFormChange:s,resetFormData:c,validateForm:d}=U(),[u,m]=t(void 0),h=()=>{c(),m(void 0),n("")},g=()=>{if(!d({withAlert:!0,alertTitle:X.Create}))return null;o(l),h()};return P({key:"Enter",active:a},()=>g()),e.createElement(ee,{isOpen:a,onClose:h,header:{title:"Add Action"},actionComponent:e.createElement(te,{buttons:[{variant:"primary",label:"DONE",onClick:g,disabled:!u}]})},e.createElement(oe,null,e.createElement(O,{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(ki,null,e.createElement(ie,{type:j.Warning,message:ne.DEFINED_FOR_ALL_STREAMS(p.ACTIONS)}),e.createElement(ae,{options:_,selectedOption:u,onOptionSelect:e=>{return t=e,c(),s("type",t?.type||""),void m(t);var t},autoFocus:!u?.type})),u?.type?e.createElement("div",null,e.createElement(le,{margin:"16px 0"}),e.createElement(bi,{action:u,formData:l,formErrors:r,handleFormChange:s})):null))},Di=e=>{const{type:t,spec:{collectContainerAttributes:o,collectReplicaSetAttributes:i,collectWorkloadId:n,collectClusterId:a,labelsAttributes:l,annotationsAttributes:r,clusterAttributes:s,overwriteExistingValues:c,attributeNamesToDelete:d,renames:u,piiCategories:p,fallbackSamplingRatio:m,samplingPercentage:y,endpointsFilters:v,attributeFilters:b,servicesNameFilters:f}}=e;let x="";if(t===h.K8sAttributes&&(o&&(x+="Container Attributes, "),i&&(x+="ReplicaSet Attributes, "),n&&(x+="Workload ID, "),a&&(x+="Cluster ID, "),l?.forEach(({labelKey:e,attributeKey:t,from:o},i)=>{x+=`Label: ${e} ${t} ${o||g.Pod} `,i===l.length-1&&(x+=", ")}),r?.forEach(({annotationKey:e,attributeKey:t,from:o},i)=>{x+=`Annotation: ${e} ${t} ${o||g.Pod} `,i===r.length-1&&(x+=", ")})),t===h.AddClusterInfo&&(x+=`Overwrite Existing: ${c}\n`,s?.forEach(({attributeName:e,attributeStringValue:t},o)=>{x+=`${e}: ${t}`,o<s.length-1&&(x+=", ")})),t===h.DeleteAttributes&&d?.forEach((e,t)=>{x+=e,t<d.length-1&&(x+=", ")}),t===h.RenameAttributes){const e=Object.entries(u||{});e.forEach(([t,o],i)=>{x+=`${t}: ${o}`,i<e.length-1&&(x+=", ")})}return t===h.PiiMasking&&p?.forEach((e,t)=>{x+=e,t<p.length-1&&(x+=", ")}),t===h.ErrorSampler&&(x+=String(m)),t===h.ProbabilisticSampler&&(x+=String(y),x+="%"),t===h.LatencySampler&&v?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:o,fallbackSamplingRatio:i},n)=>{x+=`Endpoint${v.length>1?` #${n+1}`:""}=${e}${t}\n`,x+=` Latency=${o}`,x+=` Sampling=${i}`,n<v.length-1&&(x+=", ")}),t===h.ServiceNameSampler&&f?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:o})=>{x+=`Service Name: ${e}, `,x+=`Sampling Ratio: ${t}, `,x+=`Fallback Sampling Ratio: ${o}\n`}),t===h.SpanAttributeSampler&&b?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:o})=>{x+=`Service Name: ${e}, `,x+=`Attribute Key: ${t}, `,x+=`Fallback Sampling Ratio: ${o}\n`}),x},Ni=({conditions:t,id:o})=>{const{errors:i,warnings:n,disableds:a,hasLoadings:r}=l(()=>re(t),[t]),s=i.length>0?i:n.length>0?n:a.length>0?a:[];if(s.length>0)return e.createElement("div",{style:{lineHeight:1}},e.createElement(Ti,{conditions:s,id:o}));const c=r?pe.Loading:j.Success;return e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:c,title:c,withBorder:!0,withIcon:!0}))},Ti=({conditions:t,id:o})=>{const i=I.useTheme();return e.createElement(ce,null,de(t).map(({status:t,type:n,reason:a,message:l,lastTransitionTime:r},s)=>{"loading"!==t&&"disabled"!==t||(t=j.Info);const c=me(t,i);return e.createElement(ue,{key:`condition-${o}-${t}-${n}-${s}`,titleIcon:c,title:n,text:l||a||"",timestamp:r},e.createElement(se,{status:t,title:a||n,withBorder:!0,withIcon:!0}))}))},Ii=({instrumentationRules:e,sources:t,actions:o,destinations:i,searchText:n,selectedCategory:a})=>{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?o.filter(e=>e.type?.toLowerCase().includes(n)||e.spec.actionName?.toLowerCase().includes(n)):o,c=n?i.filter(e=>e.destinationType.displayName?.toLowerCase().includes(n)||e.name?.toLowerCase().includes(n)):i,d=[{category:B.Source,label:"Sources",count:r.length,entities:[]},{category:B.Action,label:"Actions",count:s.length,entities:[]},{category:B.Destination,label:"Destinations",count:c.length,entities:[]},{category:B.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(a)).map(e=>({...e,entities:e.category===B.InstrumentationRule?l:e.category===B.Source?r:e.category===B.Action?s:e.category===B.Destination?c:[]}));return{categories:d,searchResults:u}},Ei=[{key:"icon",title:""},{key:"name",title:p.NAME,sortable:!0},{key:"signals",title:p.MONITORS},{key:"active-status",title:p.STATUS},{key:"conditions",title:"Conditions"},{key:"type",title:p.TYPE,sortable:!0},{key:"spec",title:"Spec",sortable:!0},{key:"notes",title:p.NOTES,sortable:!0}],Oi=({maxHeight:t,maxWidth:o})=>{const i=I.useTheme(),n=he(),{actions:a,actionsLoading:r}=V(),{setDrawerType:s,setDrawerEntityId:c}=q(),d=l(()=>Ii({instrumentationRules:[],sources:[],actions:ge(a,n),destinations:[],searchText:n.searchText,selectedCategory:B.Action}).searchResults.find(({category:e})=>e===B.Action)?.entities||[],[a,n]),u=l(()=>d.map(t=>{const{hasErrors:o,hasWarnings:n,hasDisableds:a}=re(t.conditions||[]);return{status:o?j.Error:n?j.Warning:void 0,faded:a,onClick:()=>{s(B.Action),c(t.id)},cells:[{columnKey:"icon",component:()=>e.createElement(ye,{icon:G(t.type)})},{columnKey:"name",value:ve(t,B.Action,{prioritizeDisplayName:!0})},{columnKey:"type",value:t.type,textColor:i.text.info},{columnKey:"notes",value:t.spec.notes,textColor:i.text.info,withTooltip:!0},{columnKey:"spec",value:Di(t),textColor:i.text.info,withTooltip:!0},{columnKey:"signals",component:()=>e.createElement(be,{withLabels:!0,monitors:t.spec.signals})},{columnKey:"conditions",component:()=>e.createElement(Ni,{conditions:t.conditions||[],id:t.id})},{columnKey:"active-status",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:t.spec.disabled?j.Error:j.Success,title:t.spec.disabled?p.DISABLED:p.ENABLED,withIcon:!0,withBorder:!0}))}]}}),[d]),{badge:m,badgeTooltip:h}=l(()=>d.length!==a.length?{badge:`${d.length}/${a.length}`,badgeTooltip:p.FILTERED_COUNT_TOOLTIP}:{badge:a.length,badgeTooltip:void 0},[d,a]);return e.createElement(fe,{$maxWidth:o},e.createElement(xe,null,e.createElement(Ce,{icon:$e(B.Action),title:p.ACTIONS,badge:m,badgeTooltip:h,loading:r})),e.createElement(Se,{$maxHeight:t},e.createElement(ke,{columns:Ei,rows:u})),!d.length&&e.createElement(we,{style:{marginTop:"2rem"}},e.createElement(De,null)))},Mi=d(Q)`
31
31
  // width: 100vw;
32
32
  // height: 100vh;
33
33
  gap: 64px;
34
34
  align-items: center;
35
35
  justify-content: center;
36
- `,Oi=d(X)`
36
+ `,Ai=d(Q)`
37
37
  max-width: 400px;
38
38
  gap: 12px;
39
39
  align-items: center;
40
40
  justify-content: center;
41
- `,Mi=d(N)`
41
+ `,Fi=d(T)`
42
42
  text-align: center;
43
43
  font-size: 24px;
44
- `,Ai=d(N)`
44
+ `,Ri=d(T)`
45
45
  text-align: center;
46
46
  line-height: 26px;
47
47
  color: ${({theme:e})=>e.text.info};
48
- `,Fi=()=>{const[i,a]=t(0);return o(()=>{(async()=>{for(let e=0;e<=100;e+=5)await Te(500),a(e)})()},[]),e.createElement(Ei,null,e.createElement(Co,{size:100}),e.createElement(De,{width:400}),e.createElement(Oi,null,e.createElement(se,{$gap:16},e.createElement(Mi,null,"Preparing your workspace..."),e.createElement(Ne,{label:`${i}%`})),e.createElement(Ai,null,"It can take up to a few minutes. Grab a cup of coffee, look out a window, and enjoy your free moment!")))},{nodeHeight:Ri,framePadding:Li}=Me,Pi=(e,t)=>{const{theme:o,label:i,isMultiTarget:a,isError:n,animated:l}=t||{},[r,s]=e.split("-to-");return{id:e,type:i?Oe.Labeled:"default",source:r,target:s,animated:l,data:{label:i,isMultiTarget:a,isError:n},style:{stroke:n?o?.colors.dark_red:o?.colors.border}}},{nodeWidth:qi,nodeHeight:Ki,framePadding:Hi}=Me,zi=e=>({nodeWidth:qi,nodeHeight:Ki,id:e.ruleId,type:W.InstrumentationRule,status:void 0,title:ye(e,W.InstrumentationRule,{prioritizeDisplayName:!0}),subTitle:e.type,icon:Fe(e.type),isActive:!e.disabled,raw:e}),{nodeWidth:Wi,nodeHeight:Bi,framePadding:ji}=Me,Vi=e=>{const{hasDisableds:t,priorotizedStatus:o}=le(e.conditions||[]);return{nodeWidth:Wi,nodeHeight:Bi,id:e.id,type:W.Action,status:o,faded:t,title:ye(e,W.Action,{prioritizeDisplayName:!0}),subTitle:e.type,icon:_(e.type),monitors:e.spec.signals,isActive:!e.spec.disabled,raw:e}},{nodeWidth:Ui,nodeHeight:_i,framePadding:Gi}=Me,Ji=e=>{const{priorotizedStatus:t,hasDisableds:o}=le(e.conditions||[]);return{nodeWidth:Ui,nodeHeight:_i,id:{namespace:e.namespace,name:e.name,kind:e.kind},type:W.Source,status:t,faded:o,title:ye(e,W.Source,{extended:!0}),subTitle:`${e.namespace} • ${e.kind}`,icons:Re(e.containers),raw:e}},{nodeWidth:Yi,nodeHeight:Xi}=Me,{nodeWidth:Qi,nodeHeight:Zi,framePadding:ea}=Me,ta=e=>{const{hasDisableds:t,priorotizedStatus:o}=le(e.conditions||[]),{icon:i,iconSrc:a}=qe(e.destinationType.type);return{nodeWidth:Qi,nodeHeight:Zi,id:e.id,type:W.Destination,status:o,faded:t,title:ye(e,W.Destination,{prioritizeDisplayName:!0}),subTitle:e.destinationType.displayName,icon:i,iconSrc:a,monitors:Pe(e.exportedSignals),isActive:!e.disabled,raw:e}},oa=d.div`
48
+ `,Li=()=>{const[i,n]=t(0);return o(()=>{(async()=>{for(let e=0;e<=100;e+=5)await Ie(500),n(e)})()},[]),e.createElement(Mi,null,e.createElement($o,{size:100}),e.createElement(Ne,{width:400}),e.createElement(Ai,null,e.createElement(ce,{$gap:16},e.createElement(Fi,null,"Preparing your workspace..."),e.createElement(Te,{label:`${i}%`})),e.createElement(Ri,null,"It can take up to a few minutes. Grab a cup of coffee, look out a window, and enjoy your free moment!")))},{nodeHeight:qi,framePadding:Pi}=Ae,Ki=(e,t)=>{const{theme:o,label:i,isMultiTarget:n,isError:a,animated:l}=t||{},[r,s]=e.split("-to-");return{id:e,type:i?Me.Labeled:"default",source:r,target:s,animated:l,data:{label:i,isMultiTarget:n,isError:a},style:{stroke:a?o?.colors.dark_red:o?.colors.border}}},{nodeWidth:Hi,nodeHeight:zi,framePadding:Wi}=Ae,Bi=e=>({nodeWidth:Hi,nodeHeight:zi,id:e.ruleId,type:B.InstrumentationRule,status:void 0,title:ve(e,B.InstrumentationRule,{prioritizeDisplayName:!0}),subTitle:e.type,icon:Re(e.type),isActive:!e.disabled,raw:e}),{nodeWidth:ji,nodeHeight:Vi,framePadding:Ui}=Ae,_i=e=>{const{hasDisableds:t,priorotizedStatus:o}=re(e.conditions||[]);return{nodeWidth:ji,nodeHeight:Vi,id:e.id,type:B.Action,status:o,faded:t,title:ve(e,B.Action,{prioritizeDisplayName:!0}),subTitle:e.type,icon:G(e.type),monitors:e.spec.signals,isActive:!e.spec.disabled,raw:e}},{nodeWidth:Gi,nodeHeight:Ji,framePadding:Yi}=Ae,Xi=e=>{const{priorotizedStatus:t,hasDisableds:o}=re(e.conditions||[]);return{nodeWidth:Gi,nodeHeight:Ji,id:{namespace:e.namespace,name:e.name,kind:e.kind},type:B.Source,status:t,faded:o,title:ve(e,B.Source,{extended:!0}),subTitle:`${e.namespace} • ${e.kind}`,icons:Le(e.containers),raw:e}},{nodeWidth:Qi,nodeHeight:Zi}=Ae,{nodeWidth:en,nodeHeight:tn,framePadding:on}=Ae,nn=e=>{const{hasDisableds:t,priorotizedStatus:o}=re(e.conditions||[]),{icon:i,iconSrc:n}=Ke(e.destinationType.type);return{nodeWidth:en,nodeHeight:tn,id:e.id,type:B.Destination,status:o,faded:t,title:ve(e,B.Destination,{prioritizeDisplayName:!0}),subTitle:e.destinationType.displayName,icon:i,iconSrc:n,monitors:Pe(e.exportedSignals),isActive:!e.disabled,raw:e}},an=d.div`
49
49
  width: 100%;
50
50
  height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px)`};
51
51
  position: relative;
52
- `,ia=({heightToRemove:t,metrics:i})=>{const a=T.useTheme(),n=me(),{selectedStreamName:r}=Ke(),{isAwaitingInstrumentation:s}=He(),{containerRef:c,containerWidth:d,containerHeight:u}=ze(),{sources:m,sourcesLoading:h,destinations:g,destinationsLoading:y,actions:v,actionsLoading:b,instrumentationRules:f,instrumentationRulesLoading:x}=j(),[C,$,S]=Uo([]),[k,w,D]=_o([]);o(()=>w((({theme:e,nodes:t,metrics:o,containerHeight:i})=>{const a=[],n=t.find(({id:e})=>[`${W.Action}-${Ie.Frame}`,`${W.Action}-${Ie.Add}`].includes(e))?.id,l=-Ri/2+Li,r=Math.floor(i/Ri)*Ri-(Ri/2+Li),s=e=>e===Ie.Base||e===Ie.Edged;return t.forEach(({type:t,id:i,data:{type:c,id:d,status:u},position:p})=>{if(c===W.Source&&s(t)){const{namespace:t,name:s,kind:c}=d,m=o?.sources.find(e=>e.kind===c&&e.name===s&&e.namespace===t);p.y>=l&&p.y<=r&&a.push(Pi(`${i}-to-${n}`,{theme:e,animated:!1,isMultiTarget:!1,label:Ee(m?.throughput),isError:u===B.Error}))}if(c===W.Destination&&s(t)){const t=o?.destinations.find(e=>e.id===d);p.y>=l&&p.y<=r&&a.push(Pi(`${n}-to-${i}`,{theme:e,animated:!1,isMultiTarget:!0,label:Ee(t?.throughput),isError:u===B.Error}))}}),a})({theme:a,nodes:C,metrics:i,containerHeight:u})),[a,C,i,u]);const N=l(()=>(({containerWidth:e})=>{const t=(e<=1500?1500:e)-Yi-24,o=e=>Xi*((e||0)+1);return{[W.Namespace]:{x:0,y:()=>0},[W.InstrumentationRule]:{x:24,y:o},[W.Source]:{x:Le(e,[[0,1600,t/3.5],[1600,null,t/4]]),y:o},[W.Action]:{x:Le(e,[[0,1600,t/1.55],[1600,null,t/1.6]]),y:o},[W.Destination]:{x:t,y:o}}})({containerWidth:d}),[d]),I=(e,t)=>{$(o=>{const i=[...o].filter(({id:e})=>e.split("-")[0]!==t);return i.push(...e),i})},E=(e,t,o)=>{$(i=>Go(e.filter(e=>"parent"===e.extent&&e.parentId===`${t}-${Ie.Scroll}`).map(e=>({id:e.id,type:"position",position:{...e.position,y:e.position.y-o}})),i))};return o(()=>{const e=We(m,r),t=(({loading:e,entities:t,positions:o,unfilteredCount:i,containerHeight:a,onScroll:n})=>{const l=[],r=o[W.Source],s=t.length!==i;return l.push({id:`${W.Source}-${Ie.Header}`,type:Ie.Header,position:{x:o[W.Source].x,y:0},data:{nodeWidth:Ui,title:p.SOURCES,icon:Ce(W.Source),badge:s?`${t.length}/${i}`:i,badgeTooltip:s?p.FILTERED_COUNT_TOOLTIP:void 0,isFetching:e,sources:t}}),t.length?(l.push({id:`${W.Source}-${Ie.Scroll}`,type:Ie.Scroll,position:{x:r.x,y:r.y()-Gi},style:{zIndex:1},data:{nodeWidth:Ui,nodeHeight:a-_i+2*Gi,items:t.map((e,t)=>({id:`${W.Source}-${t}`,data:Ji(e)})),onScroll:n}}),t.forEach((e,t)=>{l.push({id:`${W.Source}-${t}-hidden`,type:Ie.Edged,extent:"parent",parentId:`${W.Source}-${Ie.Scroll}`,position:{x:Gi,y:r.y(t)-(_i-Gi/2)},style:{zIndex:-1},data:Ji(e)})})):e?l.push({id:`${W.Source}-${Ie.Skeleton}`,type:Ie.Skeleton,position:{x:r.x,y:r.y()},data:{nodeWidth:Ui}}):l.push({id:`${W.Source}-${Ie.Add}`,type:Ie.Add,position:{x:r.x,y:r.y()},data:{nodeWidth:Ui,type:Ae.AddSource,title:p.ADD_SOURCE,subTitle:p.TO_COLLECT_OTEL_DATA}}),l})({entities:Be(e,n),loading:h||s,unfilteredCount:e.length,positions:N,containerHeight:u,onScroll:({scrollTop:e})=>E(t,W.Source,e)});I(t,W.Source)},[r,m,h,s,N[W.Source],n,u]),o(()=>{const e=je(g,r),t=(({loading:e,entities:t,positions:o,unfilteredCount:i,containerHeight:a,onScroll:n})=>{const l=[],r=o[W.Destination];return l.push({id:`${W.Destination}-${Ie.Header}`,type:Ie.Header,position:{x:o[W.Destination].x,y:0},data:{nodeWidth:Qi,title:p.DESTINATIONS,icon:Ce(W.Destination),badge:i,isFetching:e}}),t.length?(l.push({id:`${W.Destination}-${Ie.Scroll}`,type:Ie.Scroll,position:{x:r.x,y:r.y()-ea},style:{zIndex:1},data:{nodeWidth:Qi,nodeHeight:a-Zi+2*ea,items:t.map((e,t)=>({id:`${W.Destination}-${t}`,data:ta(e)})),onScroll:n}}),t.forEach((e,t)=>{l.push({id:`${W.Destination}-${t}-hidden`,type:Ie.Edged,extent:"parent",parentId:`${W.Destination}-${Ie.Scroll}`,position:{x:ea,y:r.y(t)-(Zi-ea/2)},style:{zIndex:-1},data:ta(e)})})):e?l.push({id:`${W.Destination}-${Ie.Skeleton}`,type:Ie.Skeleton,position:{x:r.x,y:r.y()},data:{nodeWidth:Qi}}):l.push({id:`${W.Destination}-${Ie.Add}`,type:Ie.Add,position:{x:r.x,y:r.y()},data:{nodeWidth:Qi,type:Ae.AddDestination,title:p.ADD_DESTINATION,subTitle:p.TO_MONITOR_OTEL_DATA}}),l})({entities:Ve(e,n),loading:y,unfilteredCount:e.length,positions:N,containerHeight:u,onScroll:({scrollTop:e})=>E(t,W.Destination,e)});I(t,W.Destination)},[r,g,y,N[W.Destination],n,u]),o(()=>{const e=(({loading:e,entities:t,positions:o,unfilteredCount:i,containerHeight:a,onScroll:n})=>{const l=[],r=o[W.Action];return l.push({id:`${W.Action}-${Ie.Header}`,type:Ie.Header,position:{x:o[W.Action].x,y:0},data:{nodeWidth:Wi,title:p.ACTIONS,icon:Ce(W.Action),badge:i,isFetching:e}}),t.length?(l.push({id:`${W.Action}-${Ie.Scroll}`,type:Ie.Scroll,position:{x:r.x,y:r.y()-ji},style:{zIndex:1},data:{nodeWidth:Wi,nodeHeight:a-Bi+2*ji,items:t.map((e,t)=>({id:`${W.Action}-${t}`,data:Vi(e)})),onScroll:n}}),t.forEach((e,t)=>{l.push({id:`${W.Action}-${t}-hidden`,type:Ie.Edged,extent:"parent",parentId:`${W.Action}-${Ie.Scroll}`,position:{x:ji,y:r.y(t)-(Bi-ji/2)},style:{zIndex:-1},data:Vi(e)})}),l.push({id:`${W.Action}-${Ie.Frame}`,type:Ie.Frame,position:{x:r.x-ji,y:r.y()-ji},data:{nodeWidth:Wi+2*ji,nodeHeight:Math.min(a,Bi*t.length+ji)}})):e?l.push({id:`${W.Action}-${Ie.Skeleton}`,type:Ie.Skeleton,position:{x:r.x,y:r.y()},data:{nodeWidth:Wi}}):l.push({id:`${W.Action}-${Ie.Add}`,type:Ie.Add,position:{x:r.x,y:r.y()},data:{nodeWidth:Wi,type:Ae.AddAction,title:p.ADD_ACTION,subTitle:p.TO_MODIFY_OTEL_DATA}}),l})({entities:he(v,n),loading:b,unfilteredCount:v.length,positions:N,containerHeight:u,onScroll:({scrollTop:t})=>E(e,W.Action,t)});I(e,W.Action)},[v,b,N[W.Action],n,u]),o(()=>{const e=(({loading:e,entities:t,positions:o,unfilteredCount:i,containerHeight:a,onScroll:n})=>{const l=[],r=o[W.InstrumentationRule];return l.push({id:`${W.InstrumentationRule}-${Ie.Header}`,type:Ie.Header,position:{x:o[W.InstrumentationRule].x,y:0},data:{nodeWidth:qi,title:p.INSTRUMENTATION_RULES,icon:Ce(W.InstrumentationRule),badge:i,isFetching:e}}),t.length?(l.push({id:`${W.InstrumentationRule}-${Ie.Scroll}`,type:Ie.Scroll,position:{x:r.x,y:r.y()-Hi},style:{zIndex:1},data:{nodeWidth:qi,nodeHeight:a-Ki+2*Hi,items:t.map((e,t)=>({id:`${W.InstrumentationRule}-${t}`,data:zi(e)})),onScroll:n}}),t.forEach((e,t)=>{l.push({id:`${W.InstrumentationRule}-${t}-hidden`,type:Ie.Edged,extent:"parent",parentId:`${W.InstrumentationRule}-${Ie.Scroll}`,position:{x:Hi,y:r.y(t)-(Ki-Hi/2)},style:{zIndex:-1},data:zi(e)})})):e?l.push({id:`${W.InstrumentationRule}-${Ie.Skeleton}`,type:Ie.Skeleton,position:{x:r.x,y:r.y()},data:{nodeWidth:qi}}):l.push({id:`${W.InstrumentationRule}-${Ie.Add}`,type:Ie.Add,position:{x:r.x,y:r.y()},data:{nodeWidth:qi,type:Ae.AddRule,title:p.ADD_INSTRUMENTATION_RULE,subTitle:p.TO_MODIFY_OTEL_DATA}}),l})({entities:f,loading:x,unfilteredCount:f.length,positions:N,containerHeight:u,onScroll:({scrollTop:t})=>E(e,W.InstrumentationRule,t)});I(e,W.InstrumentationRule)},[f,x,N[W.InstrumentationRule],u]),e.createElement(oa,{ref:c,$heightToRemove:t},e.createElement(Ue,{nodes:C,edges:k,onNodesChange:S,onEdgesChange:D}))},aa=d.div`
52
+ `,ln=({heightToRemove:t,metrics:i})=>{const n=I.useTheme(),a=he(),{selectedStreamName:r}=He(),{isAwaitingInstrumentation:s}=ze(),{containerRef:c,containerWidth:d,containerHeight:u}=We(),{sources:m,sourcesLoading:h,destinations:g,destinationsLoading:y,actions:v,actionsLoading:b,instrumentationRules:f,instrumentationRulesLoading:x}=V(),[C,$,S]=_o([]),[k,w,D]=Go([]);o(()=>w((({theme:e,nodes:t,metrics:o,containerHeight:i})=>{const n=[],a=t.find(({id:e})=>[`${B.Action}-${Ee.Frame}`,`${B.Action}-${Ee.Add}`].includes(e))?.id,l=-qi/2+Pi,r=Math.floor(i/qi)*qi-(qi/2+Pi),s=e=>e===Ee.Base||e===Ee.Edged;return t.forEach(({type:t,id:i,data:{type:c,id:d,status:u},position:p})=>{if(c===B.Source&&s(t)){const{namespace:t,name:s,kind:c}=d,m=o?.sources.find(e=>e.kind===c&&e.name===s&&e.namespace===t);p.y>=l&&p.y<=r&&n.push(Ki(`${i}-to-${a}`,{theme:e,animated:!1,isMultiTarget:!1,label:Oe(m?.throughput),isError:u===j.Error}))}if(c===B.Destination&&s(t)){const t=o?.destinations.find(e=>e.id===d);p.y>=l&&p.y<=r&&n.push(Ki(`${a}-to-${i}`,{theme:e,animated:!1,isMultiTarget:!0,label:Oe(t?.throughput),isError:u===j.Error}))}}),n})({theme:n,nodes:C,metrics:i,containerHeight:u})),[n,C,i,u]);const N=l(()=>(({containerWidth:e})=>{const t=(e<=1500?1500:e)-Qi-24,o=e=>Zi*((e||0)+1);return{[B.Namespace]:{x:0,y:()=>0},[B.InstrumentationRule]:{x:24,y:o},[B.Source]:{x:qe(e,[[0,1600,t/3.5],[1600,null,t/4]]),y:o},[B.Action]:{x:qe(e,[[0,1600,t/1.55],[1600,null,t/1.6]]),y:o},[B.Destination]:{x:t,y:o}}})({containerWidth:d}),[d]),T=(e,t)=>{$(o=>{const i=[...o].filter(({id:e})=>e.split("-")[0]!==t);return i.push(...e),i})},E=(e,t,o)=>{$(i=>Jo(e.filter(e=>"parent"===e.extent&&e.parentId===`${t}-${Ee.Scroll}`).map(e=>({id:e.id,type:"position",position:{...e.position,y:e.position.y-o}})),i))};return o(()=>{const e=Be(m,r),t=(({loading:e,entities:t,positions:o,unfilteredCount:i,containerHeight:n,onScroll:a})=>{const l=[],r=o[B.Source],s=t.length!==i;return l.push({id:`${B.Source}-${Ee.Header}`,type:Ee.Header,position:{x:o[B.Source].x,y:0},data:{nodeWidth:Gi,title:p.SOURCES,icon:$e(B.Source),badge:s?`${t.length}/${i}`:i,badgeTooltip:s?p.FILTERED_COUNT_TOOLTIP:void 0,isFetching:e,sources:t}}),t.length?(l.push({id:`${B.Source}-${Ee.Scroll}`,type:Ee.Scroll,position:{x:r.x,y:r.y()-Yi},style:{zIndex:1},data:{nodeWidth:Gi,nodeHeight:n-Ji+2*Yi,items:t.map((e,t)=>({id:`${B.Source}-${t}`,data:Xi(e)})),onScroll:a}}),t.forEach((e,t)=>{l.push({id:`${B.Source}-${t}-hidden`,type:Ee.Edged,extent:"parent",parentId:`${B.Source}-${Ee.Scroll}`,position:{x:Yi,y:r.y(t)-(Ji-Yi/2)},style:{zIndex:-1},data:Xi(e)})})):e?l.push({id:`${B.Source}-${Ee.Skeleton}`,type:Ee.Skeleton,position:{x:r.x,y:r.y()},data:{nodeWidth:Gi}}):l.push({id:`${B.Source}-${Ee.Add}`,type:Ee.Add,position:{x:r.x,y:r.y()},data:{nodeWidth:Gi,type:Fe.AddSource,title:p.ADD_SOURCE,subTitle:p.TO_COLLECT_OTEL_DATA}}),l})({entities:je(e,a),loading:h||s,unfilteredCount:e.length,positions:N,containerHeight:u,onScroll:({scrollTop:e})=>E(t,B.Source,e)});T(t,B.Source)},[r,m,h,s,N[B.Source],a,u]),o(()=>{const e=Ve(g,r),t=(({loading:e,entities:t,positions:o,unfilteredCount:i,containerHeight:n,onScroll:a})=>{const l=[],r=o[B.Destination];return l.push({id:`${B.Destination}-${Ee.Header}`,type:Ee.Header,position:{x:o[B.Destination].x,y:0},data:{nodeWidth:en,title:p.DESTINATIONS,icon:$e(B.Destination),badge:i,isFetching:e}}),t.length?(l.push({id:`${B.Destination}-${Ee.Scroll}`,type:Ee.Scroll,position:{x:r.x,y:r.y()-on},style:{zIndex:1},data:{nodeWidth:en,nodeHeight:n-tn+2*on,items:t.map((e,t)=>({id:`${B.Destination}-${t}`,data:nn(e)})),onScroll:a}}),t.forEach((e,t)=>{l.push({id:`${B.Destination}-${t}-hidden`,type:Ee.Edged,extent:"parent",parentId:`${B.Destination}-${Ee.Scroll}`,position:{x:on,y:r.y(t)-(tn-on/2)},style:{zIndex:-1},data:nn(e)})})):e?l.push({id:`${B.Destination}-${Ee.Skeleton}`,type:Ee.Skeleton,position:{x:r.x,y:r.y()},data:{nodeWidth:en}}):l.push({id:`${B.Destination}-${Ee.Add}`,type:Ee.Add,position:{x:r.x,y:r.y()},data:{nodeWidth:en,type:Fe.AddDestination,title:p.ADD_DESTINATION,subTitle:p.TO_MONITOR_OTEL_DATA}}),l})({entities:Ue(e,a),loading:y,unfilteredCount:e.length,positions:N,containerHeight:u,onScroll:({scrollTop:e})=>E(t,B.Destination,e)});T(t,B.Destination)},[r,g,y,N[B.Destination],a,u]),o(()=>{const e=(({loading:e,entities:t,positions:o,unfilteredCount:i,containerHeight:n,onScroll:a})=>{const l=[],r=o[B.Action];return l.push({id:`${B.Action}-${Ee.Header}`,type:Ee.Header,position:{x:o[B.Action].x,y:0},data:{nodeWidth:ji,title:p.ACTIONS,icon:$e(B.Action),badge:i,isFetching:e}}),t.length?(l.push({id:`${B.Action}-${Ee.Scroll}`,type:Ee.Scroll,position:{x:r.x,y:r.y()-Ui},style:{zIndex:1},data:{nodeWidth:ji,nodeHeight:n-Vi+2*Ui,items:t.map((e,t)=>({id:`${B.Action}-${t}`,data:_i(e)})),onScroll:a}}),t.forEach((e,t)=>{l.push({id:`${B.Action}-${t}-hidden`,type:Ee.Edged,extent:"parent",parentId:`${B.Action}-${Ee.Scroll}`,position:{x:Ui,y:r.y(t)-(Vi-Ui/2)},style:{zIndex:-1},data:_i(e)})}),l.push({id:`${B.Action}-${Ee.Frame}`,type:Ee.Frame,position:{x:r.x-Ui,y:r.y()-Ui},data:{nodeWidth:ji+2*Ui,nodeHeight:Math.min(n,Vi*t.length+Ui)}})):e?l.push({id:`${B.Action}-${Ee.Skeleton}`,type:Ee.Skeleton,position:{x:r.x,y:r.y()},data:{nodeWidth:ji}}):l.push({id:`${B.Action}-${Ee.Add}`,type:Ee.Add,position:{x:r.x,y:r.y()},data:{nodeWidth:ji,type:Fe.AddAction,title:p.ADD_ACTION,subTitle:p.TO_MODIFY_OTEL_DATA}}),l})({entities:ge(v,a),loading:b,unfilteredCount:v.length,positions:N,containerHeight:u,onScroll:({scrollTop:t})=>E(e,B.Action,t)});T(e,B.Action)},[v,b,N[B.Action],a,u]),o(()=>{const e=(({loading:e,entities:t,positions:o,unfilteredCount:i,containerHeight:n,onScroll:a})=>{const l=[],r=o[B.InstrumentationRule];return l.push({id:`${B.InstrumentationRule}-${Ee.Header}`,type:Ee.Header,position:{x:o[B.InstrumentationRule].x,y:0},data:{nodeWidth:Hi,title:p.INSTRUMENTATION_RULES,icon:$e(B.InstrumentationRule),badge:i,isFetching:e}}),t.length?(l.push({id:`${B.InstrumentationRule}-${Ee.Scroll}`,type:Ee.Scroll,position:{x:r.x,y:r.y()-Wi},style:{zIndex:1},data:{nodeWidth:Hi,nodeHeight:n-zi+2*Wi,items:t.map((e,t)=>({id:`${B.InstrumentationRule}-${t}`,data:Bi(e)})),onScroll:a}}),t.forEach((e,t)=>{l.push({id:`${B.InstrumentationRule}-${t}-hidden`,type:Ee.Edged,extent:"parent",parentId:`${B.InstrumentationRule}-${Ee.Scroll}`,position:{x:Wi,y:r.y(t)-(zi-Wi/2)},style:{zIndex:-1},data:Bi(e)})})):e?l.push({id:`${B.InstrumentationRule}-${Ee.Skeleton}`,type:Ee.Skeleton,position:{x:r.x,y:r.y()},data:{nodeWidth:Hi}}):l.push({id:`${B.InstrumentationRule}-${Ee.Add}`,type:Ee.Add,position:{x:r.x,y:r.y()},data:{nodeWidth:Hi,type:Fe.AddRule,title:p.ADD_INSTRUMENTATION_RULE,subTitle:p.TO_MODIFY_OTEL_DATA}}),l})({entities:f,loading:x,unfilteredCount:f.length,positions:N,containerHeight:u,onScroll:({scrollTop:t})=>E(e,B.InstrumentationRule,t)});T(e,B.InstrumentationRule)},[f,x,N[B.InstrumentationRule],u]),e.createElement(an,{ref:c,$heightToRemove:t},e.createElement(_e,{nodes:C,edges:k,onNodesChange:S,onEdgesChange:D}))},rn=d.div`
53
53
  position: relative;
54
54
  max-width: 200px;
55
55
  `;d.div`
@@ -63,65 +63,65 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
63
63
  background-color: ${({theme:e})=>e.colors.dropdown_bg};
64
64
  border: ${({theme:e})=>`1px solid ${e.colors.border}`};
65
65
  border-radius: 24px;
66
- `;const na=d.div`
66
+ `;const sn=d.div`
67
67
  display: flex;
68
68
  align-items: center;
69
69
  overflow-x: scroll;
70
- `,la=({onClose:i})=>{const a=T.useTheme(),{onClickNode:n}=_e(),{searchText:s}=me(),{selectedStreamName:c}=Ke(),{sources:d,destinations:u,actions:p,instrumentationRules:m}=j(),{popupRef:h,popupOpen:g,setPopupOpen:y,popupPosition:v,handlePosition:b}=Ge();o(()=>{g||(b(0,50),y(!0))},[g]);const[f,x]=t("all"),{categories:C,searchResults:$}=l(()=>Ni({instrumentationRules:m,sources:We(d,c),actions:p,destinations:je(u,c),searchText:s,selectedCategory:f}),[m,d,p,u,c,s,f]);return $.length?e.createElement(Je,{ref:h,isOpen:g,top:v.top,left:v.left,maxWidth:"420px",header:e.createElement(na,null,C.map(({category:t,label:o,count:i})=>!!i&&e.createElement(Ye,{key:`category-select-${t}`,label:o,badgeLabel:i,isSelected:f===t,onClick:()=>x(t)})))},$.map(({category:t,label:o,entities:l},s)=>!!l.length&&e.createElement(r,{key:`category-list-${t}`},e.createElement(Xe,{style:{maxHeight:"all"!==f?"240px":"140px",padding:"12px 0"}},e.createElement(N,{size:12,family:"secondary",color:a.text.darker_grey,style:{marginLeft:"16px"}},o),l.map((o,a)=>e.createElement(Ye,{key:`entity-${s}-${a}`,icon:Ce(t),label:ye(o,t,{extended:!0}),onClick:()=>{const e=Qe(o);n(null,{data:{type:t,id:e}}),i()},style:{width:"100%",justifyContent:"flex-start"},color:"transparent"}))),e.createElement(ne,{thickness:s===$.length-1?0:1,length:"90%",margin:"8px auto"})))):e.createElement(Je,{ref:h,isOpen:g,top:v.top,left:v.left},e.createElement(we,null))},ra=({preventPopup:o=!1})=>{const{searchText:i,setSearchText:n}=me(),[l,r]=t(!1),s=!!i||l,c=()=>{n(""),r(!1)},d=a(null);return Ze(d,c),P({key:"Escape",active:s},c),e.createElement(aa,{ref:d},e.createElement(f,{placeholder:"Search",icon:$o,value:i,onChange:e=>n(e.target.value.toLowerCase()),onFocus:()=>r(!0)}),s&&!o?e.createElement(la,{onClose:c}):null)},sa=({sources:t,title:o="Condition",value:i,onSelect:a,onDeselect:n,...r})=>{const s=l(()=>{const e=[];return t.forEach(({conditions:t})=>{t?.forEach(({type:t,reason:o})=>{e.find(e=>e.id===`${t}#${o}`)||e.push({id:`${t}#${o}`,value:`${et(t)} - ${et(o)}`})})}),e.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[t]);return e.createElement(tt,{disabled:!s?.length,title:o,placeholder:"All",options:s,value:i,onSelect:a,onDeselect:n,...r})},ca=({sources:t,title:o="Error Message",value:i,onSelect:a,onDeselect:n,disabled:r,...s})=>{const c=l(()=>{const e=[];return t.forEach(({conditions:t})=>{ce(t||[]).forEach(({status:t,message:o,reason:i})=>{t!==B.Error||e.find(e=>e.id===o)||(o?e.find(e=>e.id===o)||e.push({id:o,value:o}):i&&(e.find(e=>e.id===i)||e.push({id:i,value:i})))})}),e},[t]);return e.createElement(tt,{disabled:r||!c?.length,title:o,placeholder:"All",options:c,value:i,onSelect:a,onDeselect:n,...s})},da=({sources:t,title:o="Programming Language",value:i,onSelect:a,onDeselect:n,...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(tt,{disabled:!s?.length,title:o,placeholder:"All",options:s,value:i,onSelect:a,onDeselect:n,...r})},ua=({title:t="Monitors",value:o,onSelect:i,onDeselect:a,...n})=>{const r=l(()=>{const e=[];return it.forEach(({id:t,value:o})=>{e.find(e=>e.id===t)||e.push({id:t,value:o})}),e},[]);return e.createElement(tt,{disabled:!r?.length,title:t,placeholder:"All",options:r,value:o,onSelect:i,onDeselect:a,...n})},pa=({namespaces:t,title:o="Namespace",value:i,onSelect:a,onDeselect:n,...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(tt,{disabled:!s?.length,title:o,placeholder:"Select namespace",options:s,value:i,onSelect:a,onDeselect:n,...r})},ma=({sources:t,title:o="Kind",value:i,onSelect:a,onDeselect:n,...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(tt,{disabled:!s?.length,title:o,placeholder:"All",options:s,value:i,onSelect:a,onDeselect:n,...r})},ha=d.div`
70
+ `,cn=({onClose:i})=>{const n=I.useTheme(),{onClickNode:a}=Ge(),{searchText:s}=he(),{selectedStreamName:c}=He(),{sources:d,destinations:u,actions:p,instrumentationRules:m}=V(),{popupRef:h,popupOpen:g,setPopupOpen:y,popupPosition:v,handlePosition:b}=Je();o(()=>{g||(b(0,50),y(!0))},[g]);const[f,x]=t("all"),{categories:C,searchResults:$}=l(()=>Ii({instrumentationRules:m,sources:Be(d,c),actions:p,destinations:Ve(u,c),searchText:s,selectedCategory:f}),[m,d,p,u,c,s,f]);return $.length?e.createElement(Ye,{ref:h,isOpen:g,top:v.top,left:v.left,maxWidth:"420px",header:e.createElement(sn,null,C.map(({category:t,label:o,count:i})=>!!i&&e.createElement(Xe,{key:`category-select-${t}`,label:o,badgeLabel:i,isSelected:f===t,onClick:()=>x(t)})))},$.map(({category:t,label:o,entities:l},s)=>!!l.length&&e.createElement(r,{key:`category-list-${t}`},e.createElement(Qe,{style:{maxHeight:"all"!==f?"240px":"140px",padding:"12px 0"}},e.createElement(T,{size:12,family:"secondary",color:n.text.darker_grey,style:{marginLeft:"16px"}},o),l.map((o,n)=>e.createElement(Xe,{key:`entity-${s}-${n}`,icon:$e(t),label:ve(o,t,{extended:!0}),onClick:()=>{const e=Ze(o);a(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(Ye,{ref:h,isOpen:g,top:v.top,left:v.left},e.createElement(De,null))},dn=({preventPopup:o=!1})=>{const{searchText:i,setSearchText:a}=he(),[l,r]=t(!1),s=!!i||l,c=()=>{a(""),r(!1)},d=n(null);return et(d,c),P({key:"Escape",active:s},c),e.createElement(rn,{ref:d},e.createElement(x,{placeholder:"Search",icon:So,value:i,onChange:e=>a(e.target.value.toLowerCase()),onFocus:()=>r(!0)}),s&&!o?e.createElement(cn,{onClose:c}):null)},un=({sources:t,title:o="Condition",value:i,onSelect:n,onDeselect:a,...r})=>{const s=l(()=>{const e=[];return t.forEach(({conditions:t})=>{t?.forEach(({type:t,reason:o})=>{e.find(e=>e.id===`${t}#${o}`)||e.push({id:`${t}#${o}`,value:`${tt(t)} - ${tt(o)}`})})}),e.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[t]);return e.createElement(ot,{disabled:!s?.length,title:o,placeholder:"All",options:s,value:i,onSelect:n,onDeselect:a,...r})},pn=({sources:t,title:o="Error Message",value:i,onSelect:n,onDeselect:a,disabled:r,...s})=>{const c=l(()=>{const e=[];return t.forEach(({conditions:t})=>{de(t||[]).forEach(({status:t,message:o,reason:i})=>{t!==j.Error||e.find(e=>e.id===o)||(o?e.find(e=>e.id===o)||e.push({id:o,value:o}):i&&(e.find(e=>e.id===i)||e.push({id:i,value:i})))})}),e},[t]);return e.createElement(ot,{disabled:r||!c?.length,title:o,placeholder:"All",options:c,value:i,onSelect:n,onDeselect:a,...s})},mn=({sources:t,title:o="Programming Language",value:i,onSelect:n,onDeselect:a,...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:it[t]||t})})}),e.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[t]);return e.createElement(ot,{disabled:!s?.length,title:o,placeholder:"All",options:s,value:i,onSelect:n,onDeselect:a,...r})},hn=({title:t="Monitors",value:o,onSelect:i,onDeselect:n,...a})=>{const r=l(()=>{const e=[];return nt.forEach(({id:t,value:o})=>{e.find(e=>e.id===t)||e.push({id:t,value:o})}),e},[]);return e.createElement(ot,{disabled:!r?.length,title:t,placeholder:"All",options:r,value:o,onSelect:i,onDeselect:n,...a})},gn=({namespaces:t,title:o="Namespace",value:i,onSelect:n,onDeselect:a,...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(ot,{disabled:!s?.length,title:o,placeholder:"Select namespace",options:s,value:i,onSelect:n,onDeselect:a,...r})},yn=({sources:t,title:o="Kind",value:i,onSelect:n,onDeselect:a,...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(ot,{disabled:!s?.length,title:o,placeholder:"All",options:s,value:i,onSelect:n,onDeselect:a,...r})},vn=d.div`
71
71
  display: flex;
72
72
  flex-direction: column;
73
73
  gap: 12px;
74
74
  padding: 12px;
75
- `,ga=d.div`
75
+ `,bn=d.div`
76
76
  padding: 12px 6px 6px 6px;
77
- `,ya=d(at)`
77
+ `,fn=d(at)`
78
78
  font-size: 14px;
79
79
  ${({$color:e})=>`color: ${e};`}
80
- `,va=d.div`
80
+ `,xn=d.div`
81
81
  margin-left: auto;
82
- `,ba=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},fa=()=>{const i=T.useTheme(),{namespaces:n,sources:r}=j(),{selectedStreamName:s}=Ke(),{getItemSS:c,setItemSS:d,removeItemSS:u}=lt(),{popupRef:p,popupOpen:m,setPopupOpen:h,popupPosition:g,handlePosition:y}=Ge(),{namespaces:v,kinds:b,monitors:f,languages:x,conditions:C,errors:$,onlyErrors:k,setAll:w,clearAll:D,getEmptyState:N}=me(),I=l(()=>We(r,s),[r,s]),[E,O]=t({namespaces:v,kinds:b,monitors:f,languages:x,conditions:C,errors:$,onlyErrors:k}),[M,A]=t(ba(E));o(()=>{const e=c(nt.OVERVIEW_FILTERS,N());w(e)},[]),o(()=>{if(!m){const e={namespaces:v,kinds:b,monitors:f,languages:x,conditions:C,errors:$,onlyErrors:k};O(e),A(ba(e))}},[m,v,b,f,x,C,$,k]);const F=()=>{h(!1)},R=a(null);return Ze(R,F),P({key:"Escape",active:m},F),e.createElement(aa,{ref:R},e.createElement(Ye,{label:"Filters",icon:So,badgeLabel:M,badgeFilled:!!M,withBorder:!0,color:"transparent",onClick:()=>{y(0,50),h(!0)}}),e.createElement(Je,{ref:p,isOpen:m,top:g.top,left:g.left,width:"420px",footer:e.createElement(se,null,e.createElement(ya,{variant:"primary",onClick:()=>{d(nt.OVERVIEW_FILTERS,E),w(E),A(ba(E)),h(!1)}},"Apply"),e.createElement(ya,{variant:"secondary",onClick:F},"Cancel"),e.createElement(va,null,e.createElement(ya,{variant:"tertiary",onClick:()=>{u(nt.OVERVIEW_FILTERS),D(),O(N()),A(0),h(!1)},$color:i.text.error},"Reset")))},e.createElement(ha,null,e.createElement(pa,{namespaces:n,value:E.namespaces,onSelect:e=>O(t=>({...t,namespaces:[...t.namespaces||[],e]})),onDeselect:e=>O(t=>({...t,namespaces:(t.namespaces||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(ma,{sources:I,value:E.kinds,onSelect:e=>O(t=>({...t,kinds:[...t.kinds||[],e]})),onDeselect:e=>O(t=>({...t,kinds:(t.kinds||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(da,{sources:I,value:E.languages,onSelect:e=>O(t=>({...t,languages:[...t.languages||[],e]})),onDeselect:e=>O(t=>({...t,languages:(t.languages||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(ua,{value:E.monitors,onSelect:e=>O(t=>({...t,monitors:[...t.monitors||[],e]})),onDeselect:e=>O(t=>({...t,monitors:(t.monitors||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(sa,{sources:I,value:E.conditions,onSelect:e=>O(t=>({...t,conditions:[...t.conditions||[],e]})),onDeselect:e=>O(t=>({...t,conditions:(t.conditions||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(ga,null,e.createElement(S,{title:"Show only sources with errors",initialValue:E.onlyErrors,onChange:e=>O(t=>({...t,errors:[],onlyErrors:e}))})),e.createElement(ca,{sources:I,value:E.errors,onSelect:e=>O(t=>({...t,errors:[...t.errors||[],e]})),onDeselect:e=>O(t=>({...t,errors:(t.errors||[]).filter(t=>t.id!==e.id)})),disabled:!E.onlyErrors,showSearch:!0,required:!0,isMulti:!0}))))},xa=d.div`
82
+ `,Cn=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},$n=()=>{const i=I.useTheme(),{namespaces:a,sources:r}=V(),{selectedStreamName:s}=He(),{getItemSS:c,setItemSS:d,removeItemSS:u}=rt(),{popupRef:p,popupOpen:m,setPopupOpen:h,popupPosition:g,handlePosition:y}=Je(),{namespaces:v,kinds:b,monitors:f,languages:x,conditions:C,errors:$,onlyErrors:S,setAll:w,clearAll:D,getEmptyState:N}=he(),T=l(()=>Be(r,s),[r,s]),[E,O]=t({namespaces:v,kinds:b,monitors:f,languages:x,conditions:C,errors:$,onlyErrors:S}),[M,A]=t(Cn(E));o(()=>{const e=c(lt.OVERVIEW_FILTERS,N());w(e)},[]),o(()=>{if(!m){const e={namespaces:v,kinds:b,monitors:f,languages:x,conditions:C,errors:$,onlyErrors:S};O(e),A(Cn(e))}},[m,v,b,f,x,C,$,S]);const F=()=>{h(!1)},R=n(null);return et(R,F),P({key:"Escape",active:m},F),e.createElement(rn,{ref:R},e.createElement(Xe,{label:"Filters",icon:ko,badgeLabel:M,badgeFilled:!!M,withBorder:!0,color:"transparent",onClick:()=>{y(0,50),h(!0)}}),e.createElement(Ye,{ref:p,isOpen:m,top:g.top,left:g.left,width:"420px",footer:e.createElement(ce,null,e.createElement(fn,{variant:"primary",onClick:()=>{d(lt.OVERVIEW_FILTERS,E),w(E),A(Cn(E)),h(!1)}},"Apply"),e.createElement(fn,{variant:"secondary",onClick:F},"Cancel"),e.createElement(xn,null,e.createElement(fn,{variant:"tertiary",onClick:()=>{u(lt.OVERVIEW_FILTERS),D(),O(N()),A(0),h(!1)},$color:i.text.error},"Reset")))},e.createElement(vn,null,e.createElement(gn,{namespaces:a,value:E.namespaces,onSelect:e=>O(t=>({...t,namespaces:[...t.namespaces||[],e]})),onDeselect:e=>O(t=>({...t,namespaces:(t.namespaces||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(yn,{sources:T,value:E.kinds,onSelect:e=>O(t=>({...t,kinds:[...t.kinds||[],e]})),onDeselect:e=>O(t=>({...t,kinds:(t.kinds||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(mn,{sources:T,value:E.languages,onSelect:e=>O(t=>({...t,languages:[...t.languages||[],e]})),onDeselect:e=>O(t=>({...t,languages:(t.languages||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(hn,{value:E.monitors,onSelect:e=>O(t=>({...t,monitors:[...t.monitors||[],e]})),onDeselect:e=>O(t=>({...t,monitors:(t.monitors||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(un,{sources:T,value:E.conditions,onSelect:e=>O(t=>({...t,conditions:[...t.conditions||[],e]})),onDeselect:e=>O(t=>({...t,conditions:(t.conditions||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(bn,null,e.createElement(k,{title:"Show only sources with errors",initialValue:E.onlyErrors,onChange:e=>O(t=>({...t,errors:[],onlyErrors:e}))})),e.createElement(pn,{sources:T,value:E.errors,onSelect:e=>O(t=>({...t,errors:[...t.errors||[],e]})),onDeselect:e=>O(t=>({...t,errors:(t.errors||[]).filter(t=>t.id!==e.id)})),disabled:!E.onlyErrors,showSearch:!0,required:!0,isMulti:!0}))))},Sn=d.div`
83
83
  display: flex;
84
84
  flex-direction: column;
85
85
  gap: 24px;
86
86
  padding: 4px;
87
- `,Ca=({formData:t,handleFormChange:o,formErrors:i})=>{const{dataStreams:a,selectedStreamName:n}=Ke(),r=l(()=>a.find(e=>e.name===t.name&&e.name!==n),[a,t.name,n]);return e.createElement(xa,null,e.createElement(f,{name:"name",title:p.STREAM_NAME,placeholder:p.NAME_YOUR_STREAM_PLACEHOLDER,required:!0,value:t.name,onChange:({target:{value:e}})=>o("name",e),errorMessage:i.name}),r&&e.createElement(oe,{type:B.Warning,message:p.DATA_STREAM_EXISTS_WARNING(n,r.name)}))},$a=d.div`
87
+ `,kn=({formData:t,handleFormChange:o,formErrors:i})=>{const{dataStreams:n,selectedStreamName:a}=He(),r=l(()=>n.find(e=>e.name===t.name&&e.name!==a),[n,t.name,a]);return e.createElement(Sn,null,e.createElement(x,{name:"name",title:p.STREAM_NAME,placeholder:p.NAME_YOUR_STREAM_PLACEHOLDER,required:!0,value:t.name,onChange:({target:{value:e}})=>o("name",e),errorMessage:i.name}),r&&e.createElement(ie,{type:j.Warning,message:p.DATA_STREAM_EXISTS_WARNING(a,r.name)}))},wn=d.div`
88
88
  width: 100%;
89
89
  height: 100%;
90
90
  max-height: calc(100vh - 220px);
91
91
  overflow: overlay;
92
92
  overflow-y: auto;
93
- `,Sa=({isOpen:o,onClose:i,dataStreamName:n,updateDataStream:r})=>{const{dataStreams:c}=Ke(),d=a(null),[u,p]=t(!1),{formData:m,handleFormChange:h,formErrors:g,validateForm:y,resetFormData:v,loadFormWithDrawerItem:b}=rt({name:n}),f=l(()=>{if(!o)return null;const e=c?.find(e=>e.name===n);return e&&b(e),e},[o,c,n]),x=s((e,t)=>{h(e,t),p(!0)},[h]);return f?e.createElement(vi,{ref:d,title:f.name,icons:[ko],hideEditTitleFromEdit:!0,isEdit:!0,isFormDirty:u,onSave:()=>{y({withAlert:!0,alertTitle:Y.Update})&&(r(n,m),p(!1),i())},onCancel:()=>{v(),p(!1),i()}},e.createElement($a,null,e.createElement(Ca,{formData:m,handleFormChange:x,formErrors:g}))):null},ka=d.div`
93
+ `,Dn=({isOpen:o,onClose:i,dataStreamName:a,updateDataStream:r})=>{const{dataStreams:c}=He(),d=n(null),[u,p]=t(!1),{formData:m,handleFormChange:h,formErrors:g,validateForm:y,resetFormData:v,loadFormWithDrawerItem:b}=st({name:a}),f=l(()=>{if(!o)return null;const e=c?.find(e=>e.name===a);return e&&b(e),e},[o,c,a]),x=s((e,t)=>{h(e,t),p(!0)},[h]);return f?e.createElement(fi,{ref:d,title:f.name,icons:[wo],hideEditTitleFromEdit:!0,isEdit:!0,isFormDirty:u,onSave:()=>{y({withAlert:!0,alertTitle:X.Update})&&(r(a,m),p(!1),i())},onCancel:()=>{v(),p(!1),i()}},e.createElement(wn,null,e.createElement(kn,{formData:m,handleFormChange:x,formErrors:g}))):null},Nn=d.div`
94
94
  position: relative;
95
- `,wa=d(se)`
95
+ `,Tn=d(ce)`
96
96
  border: 1px solid ${({theme:e})=>e.colors.border};
97
97
  border-radius: 32px;
98
98
 
99
99
  & button {
100
100
  max-height: 28px;
101
101
  }
102
- `,Da=d(N)`
102
+ `,In=d(T)`
103
103
  text-wrap: nowrap;
104
- `,Na=d(Xe)`
104
+ `,En=d(Qe)`
105
105
  max-height: 240px;
106
106
  padding: 0px !important;
107
- `,Ta=d(se)`
107
+ `,On=d(ce)`
108
108
  width: 100%;
109
- `,Ia=d.div`
109
+ `,Mn=d.div`
110
110
  width: 100%;
111
- `,Ea=({onClickNewDataStream:o,updateDataStream:i,deleteDataStream:a})=>{const n=T.useTheme(),{dataStreams:r,selectedStreamName:s,setSelectedStreamName:c}=Ke(),{popupRef:d,popupOpen:u,setPopupOpen:p,popupPosition:m,handlePosition:h}=Ge(),[g,y]=t(""),[v,b]=t(""),[x,C]=t(""),$=l(()=>r.filter(({name:e})=>!x||e.toLowerCase().includes(x.toLowerCase())).map(({name:t})=>e.createElement(Ta,{key:`stream-${t}`},e.createElement(Ia,null,e.createElement(Ye,{label:t,isSelected:s===t,onClick:()=>{c(t),p(!1)},color:"transparent",style:{width:"100%",justifyContent:"flex-start"}})),t!==st&&e.createElement(ct,{onClick:()=>b(t),tooltip:q.DELETE},e.createElement(xo,null)),e.createElement(ct,{onClick:()=>y(t),tooltip:q.EDIT},e.createElement(fo,null)))),[r,s,x]);return e.createElement(e.Fragment,null,e.createElement(ka,null,e.createElement(wa,{$gap:0},e.createElement(at,{variant:"tertiary",onClick:()=>{h(0,50),p(e=>!e)}},e.createElement(ko,{fill:n.text.info}),e.createElement(Da,null,"Data Stream: ",s),e.createElement(dt,{extend:u}),e.createElement(Ne,{label:r.length})),e.createElement(ne,{orientation:"vertical",length:"32px",thickness:2,margin:"0"}),e.createElement(ut,{onClick:()=>{c(""),o()},label:q.NEW})),e.createElement(Je,{ref:d,isOpen:u,top:m.top,left:m.left,header:e.createElement(f,{placeholder:"Search...",icon:$o,value:x,onChange:e=>C(e.target.value)})},e.createElement(Na,null,$))),e.createElement(H,{isOpen:""!==v,name:v,onApprove:()=>{a(v),b("")},onDeny:()=>{b("")}}),e.createElement(Sa,{isOpen:""!==g,onClose:()=>{y("")},dataStreamName:g,updateDataStream:i}))},Oa=d.div`
111
+ `,An=({onClickNewDataStream:o,updateDataStream:i,deleteDataStream:n})=>{const a=I.useTheme(),{dataStreams:r,selectedStreamName:s,setSelectedStreamName:c}=He(),{popupRef:d,popupOpen:u,setPopupOpen:p,popupPosition:m,handlePosition:h}=Je(),[g,y]=t(""),[v,b]=t(""),[f,C]=t(""),$=l(()=>r.filter(({name:e})=>!f||e.toLowerCase().includes(f.toLowerCase())).map(({name:t})=>e.createElement(On,{key:`stream-${t}`},e.createElement(Mn,null,e.createElement(Xe,{label:t,isSelected:s===t,onClick:()=>{c(t),p(!1)},color:"transparent",style:{width:"100%",justifyContent:"flex-start"}})),t!==ct&&e.createElement(dt,{onClick:()=>b(t),tooltip:K.DELETE},e.createElement(Co,null)),e.createElement(dt,{onClick:()=>y(t),tooltip:K.EDIT},e.createElement(xo,null)))),[r,s,f]);return e.createElement(e.Fragment,null,e.createElement(Nn,null,e.createElement(Tn,{$gap:0},e.createElement(at,{variant:"tertiary",onClick:()=>{h(0,50),p(e=>!e)}},e.createElement(wo,{fill:a.text.info}),e.createElement(In,null,"Data Stream: ",s),e.createElement(ut,{extend:u}),e.createElement(Te,{label:r.length})),e.createElement(le,{orientation:"vertical",length:"32px",thickness:2,margin:"0"}),e.createElement(pt,{onClick:()=>{c(""),o()},label:K.NEW})),e.createElement(Ye,{ref:d,isOpen:u,top:m.top,left:m.left,header:e.createElement(x,{placeholder:"Search...",icon:So,value:f,onChange:e=>C(e.target.value)})},e.createElement(En,null,$))),e.createElement(z,{isOpen:""!==v,name:v,onApprove:()=>{n(v),b("")},onDeny:()=>{b("")}}),e.createElement(Dn,{isOpen:""!==g,onClose:()=>{y("")},dataStreamName:g,updateDataStream:i}))},Fn=d.div`
112
112
  display: flex;
113
113
  align-items: center;
114
114
  margin: 20px 0;
115
115
  padding: 0 16px;
116
116
  gap: 8px;
117
- `,Ma=d.div`
117
+ `,Rn=d.div`
118
118
  margin-left: auto;
119
- `,Aa=({addEntity:t,preventSearchPopup:o,onClickNewDataStream:i,updateDataStream:a,deleteDataStream:n})=>{const{setCurrentModal:l}=Q();return e.createElement(Oa,null,e.createElement(Ea,{onClickNewDataStream:i,updateDataStream:a,deleteDataStream:n}),e.createElement(ra,{preventPopup:o}),e.createElement(fa,null),t&&e.createElement(Ma,null,e.createElement(ut,{"data-id":`add-${t}`,onClick:()=>l(t),label:`${q.ADD} ${t}`,variant:"primary"})))},Fa=i(({isModal:t,onClickSummary:o},i)=>{const{selectedStreamName:a}=Ke(),{formData:l,handleFormChange:r,formErrors:s,validateForm:c}=rt({name:a});return n(i,()=>({validateForm:c,getFormValues:()=>l})),e.createElement(te,{$isNotModal:!t},e.createElement(X,{$gap:24},o&&e.createElement(pt,{onClick:o}),e.createElement(E,{title:p.NAME_YOUR_STREAM,description:p.STREAM_DESCRIPTION}),e.createElement(Ca,{formData:l,handleFormChange:r,formErrors:s})))});Fa.displayName=Fa.name;const Ra=e=>Object.keys(e).filter(t=>e[t]).join(", "),La=(e,t)=>{const{destinationType:o,disabled:i,exportedSignals:a}=e,n=[{title:p.TYPE,value:o.type},{type:m.ActiveStatus,title:p.STATUS,value:String(!i)},{type:m.Monitors,title:p.MONITORS,value:Ra(a)},{title:p.NAME,value:o.displayName}],l=mt(e,t),r=l.map(e=>({name:e.key,value:e.value}));return l.map(({key:e,name:o,value:i})=>{const{secret:l,componentProperties:s,hideFromReadData:c,customReadDataLabels:d}=t.find(t=>t.name===e)||{};if(!c?.length||!ht(c,Pe(a),r)){const{type:e}=gt(s,{type:""}),t=(l||"password"===e)&&i.length?new Array(10).fill("•").join(""):"";n.push({type:m.Divider}),d?.length?d.forEach(({condition:e,...t})=>{e==i&&n.push({title:t.title,value:t.value})}):n.push({title:o,value:t||i})}}),n},Pa=({signals:t,fields:o,onChange:i,formErrors:a})=>o?.map(n=>{const{componentType:l,renderCondition:r,...s}=n;if(r&&!ht(r,t,o))return null;switch(l){case D.Input:return e.createElement(f,{key:n.name,...s,onChange:e=>i(n.name,e.target.value),errorMessage:a[n.name]});case D.Dropdown:return e.createElement(tt,{key:n.name,...s,showSearch:!0,value:{id:s.value||"",value:s.value||""},options:s.options||[],onSelect:e=>i(n.name,e.id),errorMessage:a[n.name]});case D.MultiInput:return e.createElement(w,{key:n.name,...s,value:"string"==typeof s.value?gt(s.value,[]):s.value,onChange:e=>i(n.name,JSON.stringify(e)),errorMessage:a[n.name]});case D.KeyValuePair:return e.createElement(k,{key:n.name,...s,value:"string"==typeof s.value?gt(s.value,[]):s.value,onChange:e=>i(n.name,JSON.stringify(e)),errorMessage:a[n.name]});case D.TextArea:return e.createElement(A,{key:n.name,...s,onChange:e=>i(n.name,e.target.value),errorMessage:a[n.name]});case D.Checkbox:return e.createElement(y,{key:n.name,...s,value:"true"==s.value,onChange:e=>i(n.name,String(e)),errorMessage:a[n.name]});default:return null}}),qa=d(at)`
119
+ `,Ln=({addEntity:t,preventSearchPopup:o,onClickNewDataStream:i,updateDataStream:n,deleteDataStream:a})=>{const{setCurrentModal:l}=Z();return e.createElement(Fn,null,e.createElement(An,{onClickNewDataStream:i,updateDataStream:n,deleteDataStream:a}),e.createElement(dn,{preventPopup:o}),e.createElement($n,null),t&&e.createElement(Rn,null,e.createElement(pt,{"data-id":`add-${t}`,onClick:()=>l(t),label:`${K.ADD} ${tt(t)}`,variant:"primary",textProps:{weight:900}})))},qn=i(({isModal:t,onClickSummary:o},i)=>{const{selectedStreamName:n}=He(),{formData:l,handleFormChange:r,formErrors:s,validateForm:c}=st({name:n});return a(i,()=>({validateForm:c,getFormValues:()=>l})),e.createElement(oe,{$isNotModal:!t},e.createElement(Q,{$gap:24},o&&e.createElement(mt,{onClick:o}),e.createElement(O,{title:p.NAME_YOUR_STREAM,description:p.STREAM_DESCRIPTION}),e.createElement(kn,{formData:l,handleFormChange:r,formErrors:s})))});qn.displayName=qn.name;const Pn=e=>Object.keys(e).filter(t=>e[t]).join(", "),Kn=(e,t)=>{const{destinationType:o,disabled:i,exportedSignals:n}=e,a=[{title:p.TYPE,value:o.type},{type:m.ActiveStatus,title:p.STATUS,value:String(!i)},{type:m.Monitors,title:p.MONITORS,value:Pn(n)},{title:p.NAME,value:o.displayName}],l=ht(e,t),r=l.map(e=>({name:e.key,value:e.value}));return l.map(({key:e,name:o,value:i})=>{const{secret:l,componentProperties:s,hideFromReadData:c,customReadDataLabels:d}=t.find(t=>t.name===e)||{};if(!c?.length||!gt(c,Pe(n),r)){const{type:e}=yt(s,{type:""}),t=(l||"password"===e)&&i.length?new Array(10).fill("•").join(""):"";a.push({type:m.Divider}),d?.length?d.forEach(({condition:e,...t})=>{e==i&&a.push({title:t.title,value:t.value})}):a.push({title:o,value:t||i})}}),a},Hn=({signals:t,fields:o,onChange:i,formErrors:n})=>o?.map(a=>{const{componentType:l,renderCondition:r,...s}=a;if(r&&!gt(r,t,o))return null;switch(l){case N.Input:return e.createElement(x,{key:a.name,...s,onChange:e=>i(a.name,e.target.value),errorMessage:n[a.name]});case N.Dropdown:return e.createElement(ot,{key:a.name,...s,showSearch:!0,value:{id:s.value||"",value:s.value||""},options:s.options||[],onSelect:e=>i(a.name,e.id),errorMessage:n[a.name]});case N.MultiInput:return e.createElement(D,{key:a.name,...s,value:"string"==typeof s.value?yt(s.value,[]):s.value,onChange:e=>i(a.name,JSON.stringify(e)),errorMessage:n[a.name]});case N.KeyValuePair:return e.createElement(w,{key:a.name,...s,value:"string"==typeof s.value?yt(s.value,[]):s.value,onChange:e=>i(a.name,JSON.stringify(e)),errorMessage:n[a.name]});case N.TextArea:return e.createElement(F,{key:a.name,...s,onChange:e=>i(a.name,e.target.value),errorMessage:n[a.name]});case N.Checkbox:return e.createElement(v,{key:a.name,...s,value:"true"==s.value,onChange:e=>i(a.name,String(e)),errorMessage:n[a.name]});default:return null}}),zn=d(at)`
120
120
  display: flex;
121
121
  align-items: center;
122
122
  gap: 8px;
123
123
 
124
- ${({$status:e,theme:t})=>e===B.Success?u`
124
+ ${({$status:e,theme:t})=>e===j.Success?u`
125
125
  border-color: transparent;
126
126
  background-color: ${t.colors.success};
127
127
  `:"error"===e?u`
@@ -130,43 +130,43 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
130
130
  `:u`
131
131
  background-color: transparent;
132
132
  `}
133
- `,Ka=({destination:o,validateForm:i,status:a,testConnection:n,onSuccess:l,onError:r})=>{const s=T.useTheme(),{selectedStreamName:c}=Ke(),[d,u]=t(!1),p=a?pe(a,s):void 0;return e.createElement(qa,{$status:a,variant:"secondary",onClick:async()=>{if(i()){u(!0);const e=await n({...o,currentStreamName:c});e&&(e.succeeded?l(e):r(e)),u(!1)}}},d?e.createElement(yt,null):p?e.createElement(p,null):null,e.createElement(N,{family:"secondary",decoration:"underline",size:14,color:a?s.text[a]:void 0},d?"Checking":a===B.Success?"Connection OK":"error"===a?"Connection Failed":"Test Connection"))},Ha=d(X)`
133
+ `,Wn=({destination:o,validateForm:i,status:n,testConnection:a,onSuccess:l,onError:r})=>{const s=I.useTheme(),{selectedStreamName:c}=He(),[d,u]=t(!1),p=n?me(n,s):void 0;return e.createElement(zn,{$status:n,variant:"secondary",onClick:async()=>{if(i()){u(!0);const e=await a({...o,currentStreamName:c});e&&(e.succeeded?l(e):r(e)),u(!1)}}},d?e.createElement(vt,null):p?e.createElement(p,null):null,e.createElement(T,{family:"secondary",decoration:"underline",size:14,color:n?s.text[n]:void 0},d?"Checking":n===j.Success?"Connection OK":"error"===n?"Connection Failed":"Test Connection"))},Bn=d(Q)`
134
134
  align-items: unset;
135
135
  padding: 0 4px;
136
- `,za=d.div`
136
+ `,jn=d.div`
137
137
  display: flex;
138
138
  flex-direction: column;
139
139
  gap: 12px;
140
- `,Wa=d(se)`
140
+ `,Vn=d(ce)`
141
141
  justify-content: space-between;
142
- `,Ba=d(N)`
142
+ `,Un=d(T)`
143
143
  margin-bottom: 12px;
144
- `,ja=({isUpdate:i,categoryItem:n,formData:r,formErrors:s,validateForm:c,handleFormChange:d,dynamicFields:u,setDynamicFields:m,testConnection:h})=>{const{type:g,displayName:y,supportedSignals:v,testConnectionSupported:b}=n||{},x=T.useTheme(),[C,$]=t(!1),[S,k]=t(!1),[w,D]=t(void 0),N=a(!1);o(()=>{if(u.length&&!N.current){N.current=!0;let e=!1;for(let t=0;t<u.length;t++){const{required:o,value:i}=u[t];if(o){if([void 0,null,""].includes(i)){e=!1;break}e=!0}}$(e)}},[u,S]);const A=l(()=>{const{logs:e,metrics:t,traces:o}=v||{},i=[];return e?.supported&&i.push(vt.Logs),t?.supported&&i.push(vt.Metrics),o?.supported&&i.push(vt.Traces),i},[v]),F=l(()=>{const{logs:e,metrics:t,traces:o}=r.exportedSignals||{},i=[];return e&&i.push(vt.Logs),t&&i.push(vt.Metrics),o&&i.push(vt.Traces),i},[r.exportedSignals]),R=()=>{$(!1),k(!0),D(void 0)};return e.createElement(Ha,{$gap:24},e.createElement(Ha,{$gap:12},e.createElement(E,{title:i?"Update destination":"Create destination",description:`Connect ${y} with Odigos.`,actionButton:b&&e.createElement(Ka,{destination:r,validateForm:c,status:w?.type,testConnection:h,onError:e=>{k(!1),D({type:B.Error,title:e?.reason||"Connection failed",message:e?.message||"Please check your input and try again."})},onSuccess:e=>{k(!1),D({type:B.Success,title:e?.reason||"Connection succeeded",message:e?.message||""})}})}),e.createElement(za,null,b&&w&&e.createElement(oe,{type:w.type,title:w.title,message:w.message}),C&&!w&&!i&&e.createElement(oe,{type:B.Default,message:`Odigos autocompleted ${y} destination details.`})),e.createElement(ne,null)),e.createElement(Wa,null,e.createElement(M,{title:i?"":"This connection will monitor:",required:!0,allowedSignals:A,selectedSignals:F,setSelectedSignals:e=>{R(),d("exportedSignals",{logs:e.includes(vt.Logs),metrics:e.includes(vt.Metrics),traces:e.includes(vt.Traces)})},errorMessage:s.exportedSignals}),!i&&e.createElement(O,{endpoint:`/backends/${g}`})),i&&e.createElement("div",null,e.createElement(Ba,null,"Status"),e.createElement(I,{options:[{icon:vo,label:p.ENABLED,value:!1,selectedBgColor:x.text.success+T.opacity.hex["050"]},{icon:bo,label:p.DISABLED,value:!0,selectedBgColor:x.text.error+T.opacity.hex["050"]}],selected:r.disabled,setSelected:e=>d("disabled",e)})),!i&&e.createElement(f,{title:"Destination name",placeholder:"Enter destination name",value:r.name,onChange:e=>{R(),d("name",e.target.value)},errorMessage:s.name}),e.createElement(Pa,{signals:F,fields:u,onChange:(e,t)=>{R(),m(o=>{const i=[...o],a=i.findIndex(t=>t.name===e);return-1!==a&&(i[a]={...i[a],value:t}),i})},formErrors:s}))},Va=d.div`
144
+ `,_n=({isUpdate:i,categoryItem:a,formData:r,formErrors:s,validateForm:c,handleFormChange:d,dynamicFields:u,setDynamicFields:m,testConnection:h})=>{const{type:g,displayName:y,supportedSignals:v,testConnectionSupported:b}=a||{},f=I.useTheme(),[C,$]=t(!1),[S,k]=t(!1),[w,D]=t(void 0),N=n(!1);o(()=>{if(u.length&&!N.current){N.current=!0;let e=!1;for(let t=0;t<u.length;t++){const{required:o,value:i}=u[t];if(o){if([void 0,null,""].includes(i)){e=!1;break}e=!0}}$(e)}},[u,S]);const T=l(()=>{const{logs:e,metrics:t,traces:o}=v||{},i=[];return e?.supported&&i.push(bt.Logs),t?.supported&&i.push(bt.Metrics),o?.supported&&i.push(bt.Traces),i},[v]),F=l(()=>{const{logs:e,metrics:t,traces:o}=r.exportedSignals||{},i=[];return e&&i.push(bt.Logs),t&&i.push(bt.Metrics),o&&i.push(bt.Traces),i},[r.exportedSignals]),R=()=>{$(!1),k(!0),D(void 0)};return e.createElement(Bn,{$gap:24},e.createElement(Bn,{$gap:12},e.createElement(O,{title:i?"Update destination":"Create destination",description:`Connect ${y} with Odigos.`,actionButton:b&&e.createElement(Wn,{destination:r,validateForm:c,status:w?.type,testConnection:h,onError:e=>{k(!1),D({type:j.Error,title:e?.reason||"Connection failed",message:e?.message||"Please check your input and try again."})},onSuccess:e=>{k(!1),D({type:j.Success,title:e?.reason||"Connection succeeded",message:e?.message||""})}})}),e.createElement(jn,null,b&&w&&e.createElement(ie,{type:w.type,title:w.title,message:w.message}),C&&!w&&!i&&e.createElement(ie,{type:j.Default,message:`Odigos autocompleted ${y} destination details.`})),e.createElement(le,null)),e.createElement(Vn,null,e.createElement(A,{title:i?"":"This connection will monitor:",required:!0,allowedSignals:T,selectedSignals:F,setSelectedSignals:e=>{R(),d("exportedSignals",{logs:e.includes(bt.Logs),metrics:e.includes(bt.Metrics),traces:e.includes(bt.Traces)})},errorMessage:s.exportedSignals}),!i&&e.createElement(M,{endpoint:`/backends/${g}`})),i&&e.createElement("div",null,e.createElement(Un,null,"Status"),e.createElement(E,{options:[{icon:bo,label:p.ENABLED,value:!1,selectedBgColor:f.text.success+I.opacity.hex["050"]},{icon:fo,label:p.DISABLED,value:!0,selectedBgColor:f.text.error+I.opacity.hex["050"]}],selected:r.disabled,setSelected:e=>d("disabled",e)})),!i&&e.createElement(x,{title:"Destination name",placeholder:"Enter destination name",value:r.name,onChange:e=>{R(),d("name",e.target.value)},errorMessage:s.name}),e.createElement(Hn,{signals:F,fields:u,onChange:(e,t)=>{R(),m(o=>{const i=[...o],n=i.findIndex(t=>t.name===e);return-1!==n&&(i[n]={...i[n],value:t}),i})},formErrors:s}))},Gn=d.div`
145
145
  width: 100%;
146
146
  height: 100%;
147
147
  max-height: calc(100vh - 220px);
148
148
  overflow: overlay;
149
149
  overflow-y: auto;
150
- `,Ua=d.div`
150
+ `,Jn=d.div`
151
151
  display: flex;
152
152
  flex-direction: column;
153
153
  gap: 12px;
154
- `,_a=({categories:o,updateDestination:i,deleteDestination:n,testConnection:r})=>{const{destinations:s}=j(),{selectedStreamName:c}=Ke(),{drawerType:d,drawerEntityId:u}=L(),m=l(()=>je(s,c),[s,c]),h=a(null),g=d!==W.Destination,[y,v]=t(!1),[b,f]=t(!1),{formData:x,formErrors:C,handleFormChange:$,resetFormData:S,validateForm:k,loadFormWithDrawerItem:w,yamlFields:D,setYamlFields:N,dynamicFields:T,setDynamicFields:I}=bt({}),E=l(()=>{if(g)return null;const e=m?.find(e=>e.id===u);return e&&(w(e),N(ft(o,e))),e},[g,u,m]);if(!E)return null;const O=o.flatMap(e=>e.items).find(e=>e.type===E.destinationType.type),{icon:M,iconSrc:A}=O?qe(O?.type):{icon:void 0,iconSrc:void 0};return e.createElement(vi,{ref:h,title:E.name||E.destinationType.displayName,icons:M?[M]:void 0,iconSrcs:A?[A]:void 0,isEdit:y,isFormDirty:b,onEdit:e=>{v("boolean"!=typeof e||e)},onSave:async e=>{if(k({withAlert:!0,alertTitle:Y.Update})){const t=e!==E.destinationType.displayName?e:"";$("name",t),i(u,{...x,name:t}),v(!1),f(!1)}},onDelete:async()=>{n(u),v(!1),f(!1),S(),h.current?.closeDrawer()},onCancel:()=>{v(!1),f(!1),w(E)},isLastItem:1===m.length},y?e.createElement(Va,null,e.createElement(ja,{isUpdate:!0,categoryItem:O,formData:x,formErrors:C,handleFormChange:(...e)=>{f(!0),$(...e)},dynamicFields:T,setDynamicFields:(...e)=>{f(!0),I(...e)},validateForm:k,testConnection:r})):e.createElement(Ua,null,E.conditions?.length?e.createElement(G,{conditions:E.conditions}):null,e.createElement(J,{title:p.DESTINATION_DETAILS,data:E?La(E,D):[]})))},Ga=d.div`
154
+ `,Yn=({categories:o,updateDestination:i,deleteDestination:a,testConnection:r})=>{const{destinations:s}=V(),{selectedStreamName:c}=He(),{drawerType:d,drawerEntityId:u}=q(),m=l(()=>Ve(s,c),[s,c]),h=n(null),g=d!==B.Destination,[y,v]=t(!1),[b,f]=t(!1),{formData:x,formErrors:C,handleFormChange:$,resetFormData:S,validateForm:k,loadFormWithDrawerItem:w,yamlFields:D,setYamlFields:N,dynamicFields:T,setDynamicFields:I}=ft({}),E=l(()=>{if(g)return null;const e=m?.find(e=>e.id===u);return e&&(w(e),N(xt(o,e))),e},[g,u,m]);if(!E)return null;const O=o.flatMap(e=>e.items).find(e=>e.type===E.destinationType.type),{icon:M,iconSrc:A}=O?Ke(O?.type):{icon:void 0,iconSrc:void 0};return e.createElement(fi,{ref:h,title:E.name||E.destinationType.displayName,icons:M?[M]:void 0,iconSrcs:A?[A]:void 0,isEdit:y,isFormDirty:b,onEdit:e=>{v("boolean"!=typeof e||e)},onSave:async e=>{if(k({withAlert:!0,alertTitle:X.Update})){const t=e!==E.destinationType.displayName?e:"";$("name",t),i(u,{...x,name:t}),v(!1),f(!1)}},onDelete:async()=>{a(u),v(!1),f(!1),S(),h.current?.closeDrawer()},onCancel:()=>{v(!1),f(!1),w(E)},isLastItem:1===m.length},y?e.createElement(Gn,null,e.createElement(_n,{isUpdate:!0,categoryItem:O,formData:x,formErrors:C,handleFormChange:(...e)=>{f(!0),$(...e)},dynamicFields:T,setDynamicFields:(...e)=>{f(!0),I(...e)},validateForm:k,testConnection:r})):e.createElement(Jn,null,E.conditions?.length?e.createElement(J,{conditions:E.conditions}):null,e.createElement(Y,{title:p.DESTINATION_DETAILS,data:E?Kn(E,D):[]})))},Xn=d.div`
155
155
  display: flex;
156
156
  flex-direction: column;
157
157
  gap: 12px;
158
- `,Ja=({items:t,onSelectNew:o,onSelectConfigured:i,isLoadingForDestinationIds:a})=>{const{configuredDestinationsUpdateOnly:n}=xt();return t.map(t=>{const l=t.name===St.EXISTS.TITLE;return e.createElement(Ga,{key:`category-${t.name}`},e.createElement(E,{size:"small",icon:t.icon,title:Ct(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}=qe(r.type),p=r.selected||n.some(e=>e.id===r.id),m=!!a.find(e=>e===r.id),h=l?()=>i(r.id):()=>o(r);return e.createElement($t,{key:s,"data-id":s,title:r.displayName,hoverText:q.SELECT,onClick:h,iconProps:{icon:d,iconSrc:u},visualProps:{monitors:c,monitorsWithLabels:!0},checkboxProps:{withCheckbox:l,isChecked:p,isLoading:m,onCheckboxChange:()=>i(r.id)}})}))})},Ya=d.div`
158
+ `,Qn=({items:t,onSelectNew:o,onSelectConfigured:i,isLoadingForDestinationIds:n})=>{const{configuredDestinationsUpdateOnly:a}=Ct();return t.map(t=>{const l=t.name===kt.EXISTS.TITLE;return e.createElement(Xn,{key:`category-${t.name}`},e.createElement(O,{size:"small",icon:t.icon,title:$t(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||a.some(e=>e.id===r.id),m=!!n.find(e=>e===r.id),h=l?()=>i(r.id):()=>o(r);return e.createElement(St,{key:s,"data-id":s,title:r.displayName,hoverText:K.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`
159
159
  display: flex;
160
160
  flex-direction: column;
161
161
  gap: 24px;
162
- `,Xa=d.div`
162
+ `,ea=d.div`
163
163
  display: flex;
164
164
  align-items: center;
165
165
  gap: 12px;
166
- `,Qa=d.div`
166
+ `,ta=d.div`
167
167
  width: 170px;
168
168
  margin-right: 8px;
169
- `,Za=d.div`
169
+ `,oa=d.div`
170
170
  display: flex;
171
171
  flex-direction: column;
172
172
  align-self: stretch;
@@ -177,18 +177,18 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
177
177
  @media (height < 800px) {
178
178
  max-height: calc(100vh - 400px);
179
179
  }
180
- `,en=d(Ya)`
180
+ `,ia=d(Zn)`
181
181
  margin-top: 80px;
182
- `,{MANAGED:tn,SELF_HOSTED:on,DETECTED:an,EXISTS:nn}=St,ln=[{value:"All types",id:"all"},{value:tn.TITLE,id:tn.TITLE},{value:on.TITLE,id:on.TITLE},{value:an.TITLE,id:an.TITLE},{value:nn.TITLE,id:nn.TITLE}],rn=ln[0],sn=[vt.Logs,vt.Metrics,vt.Traces],cn=(e,t,o)=>e.map(e=>{const{type:i,displayName:a}=e.destinationType,n=e.dataStreamNames?.includes(t),l=o.has(e.id);return{id:e.id,type:i,displayName:a,selected:n||l,fields:[],testConnectionSupported:!1,supportedSignals:{[vt.Logs]:{supported:e.exportedSignals.logs},[vt.Metrics]:{supported:e.exportedSignals.metrics},[vt.Traces]:{supported:e.exportedSignals.traces}}}}),dn=({hidden:o,categories:i,potentialDestinations:a,onSelectNew:n,onSelectConfigured:r,isLoadingForDestinationIds:s})=>{const{destinations:c}=j(),{selectedStreamName:d}=Ke(),{configuredDestinations:u,configuredDestinationsUpdateOnly:p}=xt(),[m,h]=t(""),[g,y]=t(rn),[v,b]=t(sn),x=l(()=>{const e=kt(i);return e.unshift({name:nn.TITLE,description:nn.DESCRIPTION,icon:wo,items:cn(c,d,new Set(u.concat(p).map(e=>e.id)))}),e.unshift({name:an.TITLE,description:an.DESCRIPTION,icon:Do,items:a}),e.map(e=>{const t=e.items.filter(t=>{const o=!m||t.displayName.toLowerCase().includes(m.toLowerCase()),i="all"===g.id||g.id===e.name,a=v.some(e=>t.supportedSignals[e.toLowerCase()]?.supported);return o&&i&&a});return{...e,items:t}}).filter(({items:e})=>!!e.length)},[i,a,c,m,g,v,d,u,p]);return o?null:e.createElement(Ya,null,e.createElement(E,{title:"Choose destination",description:"Add backend destination you want to connect with Odigos."}),e.createElement(Xa,null,e.createElement(Qa,null,e.createElement(f,{placeholder:"Search...",icon:$o,value:m,onChange:({target:{value:e}})=>h(e)})),e.createElement(Qa,null,e.createElement(tt,{options:ln,value:g,onSelect:y,onDeselect:()=>{}})),e.createElement(M,{title:"",selectedSignals:v,setSelectedSignals:b})),e.createElement(ne,null),x.length?e.createElement(Za,null,e.createElement(Ja,{items:x,onSelectNew:e=>n(e,v),onSelectConfigured:r,isLoadingForDestinationIds:s})):e.createElement(en,null,e.createElement(we,{title:"No destinations found"})))},un=d.div`
182
+ `,{MANAGED:na,SELF_HOSTED:aa,DETECTED:la,EXISTS:ra}=kt,sa=[{value:"All types",id:"all"},{value:na.TITLE,id:na.TITLE},{value:aa.TITLE,id:aa.TITLE},{value:la.TITLE,id:la.TITLE},{value:ra.TITLE,id:ra.TITLE}],ca=sa[0],da=[bt.Logs,bt.Metrics,bt.Traces],ua=(e,t,o)=>e.map(e=>{const{type:i,displayName:n}=e.destinationType,a=e.dataStreamNames?.includes(t),l=o.has(e.id);return{id:e.id,type:i,displayName:n,selected:a||l,fields:[],testConnectionSupported:!1,supportedSignals:{[bt.Logs]:{supported:e.exportedSignals.logs},[bt.Metrics]:{supported:e.exportedSignals.metrics},[bt.Traces]:{supported:e.exportedSignals.traces}}}}),pa=({hidden:o,categories:i,potentialDestinations:n,onSelectNew:a,onSelectConfigured:r,isLoadingForDestinationIds:s})=>{const{destinations:c}=V(),{selectedStreamName:d}=He(),{configuredDestinations:u,configuredDestinationsUpdateOnly:p}=Ct(),[m,h]=t(""),[g,y]=t(ca),[v,b]=t(da),f=l(()=>{const e=wt(i);return e.unshift({name:ra.TITLE,description:ra.DESCRIPTION,icon:Do,items:ua(c,d,new Set(u.concat(p).map(e=>e.id)))}),e.unshift({name:la.TITLE,description:la.DESCRIPTION,icon:No,items:n}),e.map(e=>{const t=e.items.filter(t=>{const o=!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 o&&i&&n});return{...e,items:t}}).filter(({items:e})=>!!e.length)},[i,n,c,m,g,v,d,u,p]);return o?null:e.createElement(Zn,null,e.createElement(O,{title:"Choose destination",description:"Add backend destination you want to connect with Odigos."}),e.createElement(ea,null,e.createElement(ta,null,e.createElement(x,{placeholder:"Search...",icon:So,value:m,onChange:({target:{value:e}})=>h(e)})),e.createElement(ta,null,e.createElement(ot,{options:sa,value:g,onSelect:y,onDeselect:()=>{}})),e.createElement(A,{title:"",selectedSignals:v,setSelectedSignals:b})),e.createElement(le,null),f.length?e.createElement(oa,null,e.createElement(Qn,{items:f,onSelectNew:e=>a(e,v),onSelectConfigured:r,isLoadingForDestinationIds:s})):e.createElement(ia,null,e.createElement(De,{title:"No destinations found"})))},ma=d.div`
183
183
  display: flex;
184
- `,pn=d.div`
184
+ `,ha=d.div`
185
185
  border-right: 1px solid ${({theme:e})=>e.colors.border};
186
186
  padding: 32px;
187
187
  width: 200px;
188
188
  @media (max-width: 1050px) {
189
189
  display: none;
190
190
  }
191
- `,mn=({isOnboarding:o,categories:i,potentialDestinations:a,createDestination:n,updateDestination:l,deleteDestination:r,testConnection:s})=>{const{destinations:c}=j(),{selectedStreamName:d}=Ke(),{currentModal:u,setCurrentModal:m}=Q(),{addConfiguredDestination:h,addConfiguredDestinationUpdateOnly:g,removeConfiguredDestinationUpdateOnly:y,configuredDestinationsUpdateOnly:v}=xt(),b=u===W.Destination,[f,x]=t(void 0),{formData:C,formErrors:$,handleFormChange:S,resetFormData:k,validateForm:w,setYamlFields:D,dynamicFields:N,setDynamicFields:T,loadFormWithDrawerItem:I}=bt({supportedSignals:f?.supportedSignals,preLoadedFields:f?.fields}),[E,O]=t([]),M=e=>{const t={};return e||N.forEach(e=>t[e.name]=e.value),{id:e?.id||"",name:e?.name||C.name,disabled:e?.disabled||C.disabled,dataStreamNames:e?.dataStreamNames||[],conditions:e?.conditions||[],exportedSignals:e?.exportedSignals||C.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}}}}},A=async e=>{if(o&&!e){const e=M();h(e)}else if(o&&e){const t=M(e);v.some(t=>t.id===e.id)?y(e):g(t)}else if(o||e){if(!o&&e){const t=M(e),o=t.dataStreamNames.some(e=>e===d);O(t=>[...t,e.id]),o?await r(e.id):await l(e.id,I(t)),O(t=>t.filter(t=>t!==e.id))}}else n(C)},F=()=>{k(),x(void 0),m("")},R=()=>{k(),x(void 0)},L=async()=>{if(f){if(!w({withAlert:!o,alertTitle:Y.Create}))return null;A()}F()};return P({key:"Enter",active:b},()=>L()),e.createElement(Z,{isOpen:b,onClose:F,header:{title:p.ADD_DESTINATION},actionComponent:e.createElement(ee,{buttons:(()=>{const e=[{label:"DONE",variant:"primary",onClick:L}];return f&&e.unshift({label:"BACK",icon:No,variant:"secondary",onClick:R}),e})()})},e.createElement(un,null,e.createElement(pn,null,e.createElement(wt,{currentStep:f?2:1,data:[{stepNumber:1,title:p.DESTINATIONS},{stepNumber:2,title:p.CONNECTION}]})),e.createElement(te,{style:{margin:"32px 24px 12px 24px"}},e.createElement(dn,{hidden:void 0!==f,categories:i,potentialDestinations:a,onSelectNew:(e,t)=>{k(),S("type",e?.type||""),S("currentStreamName",d);const o={logs:!1,metrics:!1,traces:!1};t.filter(t=>e.supportedSignals[t].supported).forEach(e=>o[e]=!0),S("exportedSignals",o),D(e?.fields||[]),x(e)},onSelectConfigured:e=>{const t=c.find(t=>t.id===e);t&&A(t)},isLoadingForDestinationIds:E}),f&&e.createElement(ja,{categoryItem:f,formData:C,formErrors:$,handleFormChange:S,dynamicFields:N,setDynamicFields:T,validateForm:w,testConnection:s}))))},hn=d.div`
191
+ `,ga=({isOnboarding:o,categories:i,potentialDestinations:n,createDestination:a,updateDestination:l,deleteDestination:r,testConnection:s})=>{const{destinations:c}=V(),{selectedStreamName:d}=He(),{currentModal:u,setCurrentModal:m}=Z(),{addConfiguredDestination:h,addConfiguredDestinationUpdateOnly:g,removeConfiguredDestinationUpdateOnly:y,configuredDestinationsUpdateOnly:v}=Ct(),b=u===B.Destination,[f,x]=t(void 0),{formData:C,formErrors:$,handleFormChange:S,resetFormData:k,validateForm:w,setYamlFields:D,dynamicFields:N,setDynamicFields:T,loadFormWithDrawerItem:I}=ft({supportedSignals:f?.supportedSignals,preLoadedFields:f?.fields}),[E,O]=t([]),M=e=>{const t={};return e||N.forEach(e=>t[e.name]=e.value),{id:e?.id||"",name:e?.name||C.name,disabled:e?.disabled||C.disabled,dataStreamNames:e?.dataStreamNames||[],conditions:e?.conditions||[],exportedSignals:e?.exportedSignals||C.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}}}}},A=async e=>{if(o&&!e){const e=M();h(e)}else if(o&&e){const t=M(e);v.some(t=>t.id===e.id)?y(e):g(t)}else if(o||e){if(!o&&e){const t=M(e),o=t.dataStreamNames.some(e=>e===d);O(t=>[...t,e.id]),o?await r(e.id):await l(e.id,I(t)),O(t=>t.filter(t=>t!==e.id))}}else a(C)},F=()=>{k(),x(void 0),m("")},R=()=>{k(),x(void 0)},L=async()=>{if(f){if(!w({withAlert:!o,alertTitle:X.Create}))return null;A()}F()};return P({key:"Enter",active:b},()=>L()),e.createElement(ee,{isOpen:b,onClose:F,header:{title:p.ADD_DESTINATION},actionComponent:e.createElement(te,{buttons:(()=>{const e=[{label:"DONE",variant:"primary",onClick:L}];return f&&e.unshift({label:"BACK",icon:To,variant:"secondary",onClick:R}),e})()})},e.createElement(ma,null,e.createElement(ha,null,e.createElement(Dt,{currentStep:f?2:1,data:[{stepNumber:1,title:p.DESTINATIONS},{stepNumber:2,title:p.CONNECTION}]})),e.createElement(oe,{style:{margin:"32px 24px 12px 24px"}},e.createElement(pa,{hidden:void 0!==f,categories:i,potentialDestinations:n,onSelectNew:(e,t)=>{k(),S("type",e?.type||""),S("currentStreamName",d);const o={logs:!1,metrics:!1,traces:!1};t.filter(t=>e.supportedSignals[t].supported).forEach(e=>o[e]=!0),S("exportedSignals",o),D(e?.fields||[]),x(e)},onSelectConfigured:e=>{const t=c.find(t=>t.id===e);t&&A(t)},isLoadingForDestinationIds:E}),f&&e.createElement(_n,{categoryItem:f,formData:C,formErrors:$,handleFormChange:S,dynamicFields:N,setDynamicFields:T,validateForm:w,testConnection:s}))))},ya=d.div`
192
192
  display: flex;
193
193
  flex-direction: column;
194
194
  align-items: center;
@@ -197,7 +197,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
197
197
  max-height: calc(100vh - 310px);
198
198
  height: fit-content;
199
199
  overflow-y: scroll;
200
- `,gn=({categories:t,withDelete:o})=>{const{configuredDestinations:i,configuredDestinationsUpdateOnly:a}=xt();return i.length||a.length?e.createElement(hn,null,i.concat(a).map((n,l)=>e.createElement(yn,{key:`configured-destination-${n.destinationType.type}-${l}`,"data-id":`configured-destination-${n.destinationType.type}`,item:n,yamlFields:ft(t,n),isLastItem:i.length+a.length===1,withDelete:o}))):e.createElement(ke,null,e.createElement(we,{title:"No destinations",subTitle:"Please add a destination"}))},yn=({item:o,yamlFields:i,isLastItem:a,withDelete:n})=>{const[r,s]=t(!1),{icon:c,iconSrc:d}=qe(o.destinationType.type),{removeConfiguredDestination:u,removeConfiguredDestinationUpdateOnly:p}=xt(),m=l(()=>mt(o,i).map(e=>({title:e.name,value:e.value})),[o,i]);return e.createElement(e.Fragment,null,e.createElement($t,{title:o.name||o.destinationType.displayName,subTitle:o.destinationType.type,iconProps:{icon:c,iconSrc:d},visualProps:{monitors:Pe(o.exportedSignals),monitorsWithLabels:!0},extendableProps:{withExtend:!0,renderExtended:()=>e.createElement(Dt,{data:m})},renderActions:n?()=>e.createElement(ct,{onClick:()=>s(!0)},e.createElement(xo,null)):void 0}),n&&e.createElement(H,{isOpen:r,name:o.destinationType.displayName||o.name,type:W.Destination,isLastItem:a,onApprove:()=>{o.id?p(o):u(o)},onDeny:()=>s(!1)}))},vn=d(at)`
200
+ `,va=({categories:t,withDelete:o})=>{const{configuredDestinations:i,configuredDestinationsUpdateOnly:n}=Ct();return i.length||n.length?e.createElement(ya,null,i.concat(n).map((a,l)=>e.createElement(ba,{key:`configured-destination-${a.destinationType.type}-${l}`,"data-id":`configured-destination-${a.destinationType.type}`,item:a,yamlFields:xt(t,a),isLastItem:i.length+n.length===1,withDelete:o}))):e.createElement(we,null,e.createElement(De,{title:"No destinations",subTitle:"Please add a destination"}))},ba=({item:o,yamlFields:i,isLastItem:n,withDelete:a})=>{const[r,s]=t(!1),{icon:c,iconSrc:d}=Ke(o.destinationType.type),{removeConfiguredDestination:u,removeConfiguredDestinationUpdateOnly:p}=Ct(),m=l(()=>ht(o,i).map(e=>({title:e.name,value:e.value})),[o,i]);return e.createElement(e.Fragment,null,e.createElement(St,{title:o.name||o.destinationType.displayName,subTitle:o.destinationType.type,iconProps:{icon:c,iconSrc:d},visualProps:{monitors:Pe(o.exportedSignals),monitorsWithLabels:!0},extendableProps:{withExtend:!0,renderExtended:()=>e.createElement(Nt,{data:m})},renderActions:a?()=>e.createElement(dt,{onClick:()=>s(!0)},e.createElement(Co,null)):void 0}),a&&e.createElement(z,{isOpen:r,name:o.destinationType.displayName||o.name,type:B.Destination,isLastItem:n,onApprove:()=>{o.id?p(o):u(o)},onDeny:()=>s(!1)}))},fa=d(at)`
201
201
  display: flex;
202
202
  align-items: center;
203
203
  justify-content: center;
@@ -206,7 +206,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
206
206
  padding: 32px;
207
207
  border-radius: 16px;
208
208
  border-style: dashed !important;
209
- `,bn=({isSourcesListEmpty:t,goToSources:o,categories:i,potentialDestinations:a,testConnection:n,onClickSummary:l})=>{const r=T.useTheme(),{setCurrentModal:s}=Q(),{configuredDestinations:c,configuredDestinationsUpdateOnly:d}=xt();return e.createElement(e.Fragment,null,e.createElement(te,{$isNotModal:!0},e.createElement(X,{$gap:12},e.createElement(X,{$gap:24},l&&e.createElement(pt,{onClick:l}),e.createElement(E,{title:p.ADD_DESTINATIONS,badgeLabel:c.length+d.length,description:p.ADD_DESTINATION_DESCRIPTION}),t&&e.createElement(oe,{type:B.Warning,message:p.NO_SOURCES_GO_BACK,action:{label:p.SELECT_SOURCES,onClick:o}}),e.createElement(vn,{variant:"secondary",onClick:()=>s(W.Destination)},e.createElement(To,null),e.createElement(N,{color:r.colors.secondary,size:14,decoration:"underline",family:"secondary"},p.ADD_DESTINATION))),e.createElement(gn,{categories:i,withDelete:!0}))),e.createElement(mn,{isOnboarding:!0,categories:i,potentialDestinations:a,updateDestination:async()=>{},createDestination:async()=>{},deleteDestination:async()=>{},testConnection:n}))},fn=[{key:"icon",title:""},{key:"name",title:p.NAME,sortable:!0},{key:"type",title:p.TYPE,sortable:!0},{key:"signals",title:p.MONITORS},{key:"active-status",title:p.STATUS},{key:"conditions",title:"Conditions"},{key:"throughput",title:"Throughput",sortable:!0}],xn=({metrics:t,maxHeight:o,maxWidth:i})=>{const a=T.useTheme(),n=me(),{selectedStreamName:r}=Ke(),{setDrawerType:s,setDrawerEntityId:c}=L(),{destinations:d,destinationsLoading:u}=j(),m=l(()=>je(d,r),[d,r]),h=l(()=>Ni({instrumentationRules:[],sources:[],actions:[],destinations:Ve(m,n),searchText:n.searchText,selectedCategory:W.Destination}).searchResults.find(({category:e})=>e===W.Destination)?.entities||[],[m,n]),g=l(()=>h.map(o=>{const{hasErrors:i,hasWarnings:n,hasDisableds:l}=le(o.conditions||[]),{icon:r,iconSrc:d}=qe(o.destinationType.type);return{status:i?B.Error:n?B.Warning:void 0,faded:l,onClick:()=>{s(W.Destination),c(o.id)},cells:[{columnKey:"icon",component:()=>e.createElement(ge,{icon:r,src:d})},{columnKey:"name",value:ye(o,W.Destination,{prioritizeDisplayName:!0})},{columnKey:"type",value:o.destinationType.type,textColor:a.text.info},{columnKey:"throughput",value:Ee(Nt(t,W.Destination,o.id).throughput),textColor:a.text.info},{columnKey:"signals",component:()=>e.createElement(ve,{withLabels:!0,monitors:Pe(o.exportedSignals)})},{columnKey:"conditions",component:()=>o.conditions?.length?e.createElement(wi,{conditions:o.conditions,id:o.id}):null},{columnKey:"active-status",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(re,{status:o.disabled?B.Error:B.Success,title:o.disabled?p.DISABLED:p.ENABLED,withIcon:!0,withBorder:!0}))}]}}),[h,t]),{badge:y,badgeTooltip:v}=l(()=>h.length!==m.length?{badge:`${h.length}/${m.length}`,badgeTooltip:p.FILTERED_COUNT_TOOLTIP}:{badge:m.length,badgeTooltip:void 0},[h,m]);return e.createElement(be,{$maxWidth:i},e.createElement(fe,null,e.createElement(xe,{icon:Ce(W.Destination),title:p.DESTINATIONS,badge:y,badgeTooltip:v,loading:u})),e.createElement($e,{$maxHeight:o},e.createElement(Se,{columns:fn,rows:g})),!h.length&&e.createElement(ke,{style:{marginTop:"2rem"}},e.createElement(we,null)))},Cn=e=>{const{type:t,ruleName:o,notes:i,disabled:a,profileName:n,payloadCollection:l,codeAttributes:r,headersCollection:s,customInstrumentations:c}=e,d=[{title:p.TYPE,value:t},{type:m.ActiveStatus,title:p.STATUS,value:String(!a)},{title:p.NAME,value:o},{title:p.NOTES,value:i},{title:p.MANAGED_BY_PROFILE,value:n},{type:m.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[Tt.HeaderKeys]||[]).filter(e=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(c){const e=(c[It.Probes]||[]).filter(e=>e.className&&e.methodName).map(e=>`${e.className}.${e.methodName}`).join(", ");e&&d.push({title:"Instrumented Methods",value:e})}return d},$n=d.div`
209
+ `,xa=({isSourcesListEmpty:t,goToSources:o,categories:i,potentialDestinations:n,testConnection:a,onClickSummary:l})=>{const r=I.useTheme(),{setCurrentModal:s}=Z(),{configuredDestinations:c,configuredDestinationsUpdateOnly:d}=Ct();return e.createElement(e.Fragment,null,e.createElement(oe,{$isNotModal:!0},e.createElement(Q,{$gap:12},e.createElement(Q,{$gap:24},l&&e.createElement(mt,{onClick:l}),e.createElement(O,{title:p.ADD_DESTINATIONS,badgeLabel:c.length+d.length,description:p.ADD_DESTINATION_DESCRIPTION}),t&&e.createElement(ie,{type:j.Warning,message:p.NO_SOURCES_GO_BACK,action:{label:p.SELECT_SOURCES,onClick:o}}),e.createElement(fa,{variant:"secondary",onClick:()=>s(B.Destination)},e.createElement(Io,null),e.createElement(T,{color:r.colors.secondary,size:14,decoration:"underline",family:"secondary"},p.ADD_DESTINATION))),e.createElement(va,{categories:i,withDelete:!0}))),e.createElement(ga,{isOnboarding:!0,categories:i,potentialDestinations:n,updateDestination:async()=>{},createDestination:async()=>{},deleteDestination:async()=>{},testConnection:a}))},Ca=[{key:"icon",title:""},{key:"name",title:p.NAME,sortable:!0},{key:"type",title:p.TYPE,sortable:!0},{key:"signals",title:p.MONITORS},{key:"active-status",title:p.STATUS},{key:"conditions",title:"Conditions"},{key:"throughput",title:"Throughput",sortable:!0}],$a=({metrics:t,maxHeight:o,maxWidth:i})=>{const n=I.useTheme(),a=he(),{selectedStreamName:r}=He(),{setDrawerType:s,setDrawerEntityId:c}=q(),{destinations:d,destinationsLoading:u}=V(),m=l(()=>Ve(d,r),[d,r]),h=l(()=>Ii({instrumentationRules:[],sources:[],actions:[],destinations:Ue(m,a),searchText:a.searchText,selectedCategory:B.Destination}).searchResults.find(({category:e})=>e===B.Destination)?.entities||[],[m,a]),g=l(()=>h.map(o=>{const{hasErrors:i,hasWarnings:a,hasDisableds:l}=re(o.conditions||[]),{icon:r,iconSrc:d}=Ke(o.destinationType.type);return{status:i?j.Error:a?j.Warning:void 0,faded:l,onClick:()=>{s(B.Destination),c(o.id)},cells:[{columnKey:"icon",component:()=>e.createElement(ye,{icon:r,src:d})},{columnKey:"name",value:ve(o,B.Destination,{prioritizeDisplayName:!0})},{columnKey:"type",value:o.destinationType.type,textColor:n.text.info},{columnKey:"throughput",value:Oe(Tt(t,B.Destination,o.id).throughput),textColor:n.text.info},{columnKey:"signals",component:()=>e.createElement(be,{withLabels:!0,monitors:Pe(o.exportedSignals)})},{columnKey:"conditions",component:()=>o.conditions?.length?e.createElement(Ni,{conditions:o.conditions,id:o.id}):null},{columnKey:"active-status",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:o.disabled?j.Error:j.Success,title:o.disabled?p.DISABLED:p.ENABLED,withIcon:!0,withBorder:!0}))}]}}),[h,t]),{badge:y,badgeTooltip:v}=l(()=>h.length!==m.length?{badge:`${h.length}/${m.length}`,badgeTooltip:p.FILTERED_COUNT_TOOLTIP}:{badge:m.length,badgeTooltip:void 0},[h,m]);return e.createElement(fe,{$maxWidth:i},e.createElement(xe,null,e.createElement(Ce,{icon:$e(B.Destination),title:p.DESTINATIONS,badge:y,badgeTooltip:v,loading:u})),e.createElement(Se,{$maxHeight:o},e.createElement(ke,{columns:Ca,rows:g})),!h.length&&e.createElement(we,{style:{marginTop:"2rem"}},e.createElement(De,null)))},Sa=e=>{const{type:t,ruleName:o,notes:i,disabled:n,profileName:a,payloadCollection:l,codeAttributes:r,headersCollection:s,customInstrumentations:c}=e,d=[{title:p.TYPE,value:t},{type:m.ActiveStatus,title:p.STATUS,value:String(!n)},{title:p.NAME,value:o},{title:p.NOTES,value:i},{title:p.MANAGED_BY_PROFILE,value:a},{type:m.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[It.HeaderKeys]||[]).filter(e=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(c){const e=(c[Et.Probes]||[]).filter(e=>e.className&&e.methodName).map(e=>`${e.className}.${e.methodName}`).join(", ");e&&d.push({title:"Instrumented Methods",value:e})}return d},ka=d.div`
210
210
  display: flex;
211
211
  flex-direction: column;
212
212
  gap: 12px;
@@ -216,7 +216,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
216
216
  border-radius: 16px;
217
217
  padding: 8px;
218
218
  `}
219
- `,Sn=[{id:Et.FilePath,label:"Collect File Path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Et.Function,label:"Collect Function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Et.LineNumber,label:"Collect Line Number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],kn=[{id:Et.Column,label:"Collect Column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Et.Namespace,label:"Collect Namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Et.StackTrace,label:"Collect Stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],wn=["*"],Dn=d.div`
219
+ `,wa=[{id:Ot.FilePath,label:"Collect File Path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Ot.Function,label:"Collect Function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Ot.LineNumber,label:"Collect Line Number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],Da=[{id:Ot.Column,label:"Collect Column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Ot.Namespace,label:"Collect Namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Ot.StackTrace,label:"Collect Stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],Na=["*"],Ta=d.div`
220
220
  display: flex;
221
221
  flex-direction: column;
222
222
  gap: 12px;
@@ -226,23 +226,23 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
226
226
  border-radius: 16px;
227
227
  padding: 8px;
228
228
  `}
229
- `,Nn=[{id:Ot.HttpRequest,label:"Collect HTTP Request"},{id:Ot.HttpResponse,label:"Collect HTTP Response"},{id:Ot.DbQuery,label:"Collect DB Query"},{id:Ot.Messaging,label:"Collect Messaging"}],Tn={[Mt.CodeAttributes]:({value:i,setValue:a,formErrors:n})=>{const r=n.codeAttributes,s=l(()=>Object.entries(i.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[i]),[c,d]=t(1===s.length);o(()=>{if(!s.length){const e={[Et.Column]:null,[Et.FilePath]:!0,[Et.Function]:!0,[Et.LineNumber]:!0,[Et.Namespace]:null,[Et.StackTrace]:null};a("codeAttributes",e),d(!1)}},[]);const u=(e,t)=>{const o=t?[...s,e]:s.filter(t=>t!==e),i=Object.values(Et).reduce((e,t)=>(e[t]=!!o.includes(t)||null,e),{});a("codeAttributes",i),d(1===o.length)};return e.createElement(e.Fragment,null,e.createElement("div",null,e.createElement(g,{title:"Recommended data to collect",required:!0}),e.createElement($n,{$hasError:!!r},Sn.map(({id:t,label:o,tooltip:i})=>e.createElement(de,{key:t,text:i,withIcon:!0},e.createElement(y,{title:o,disabled:c&&s.includes(t),value:s.includes(t),onChange:e=>u(t,e)})))),!!r&&e.createElement(v,null,r)),e.createElement("div",null,e.createElement(g,{title:"Verbose data to collect",required:!0}),e.createElement($n,{$hasError:!!r},kn.map(({id:t,label:o,tooltip:i})=>e.createElement(de,{key:t,text:i,withIcon:!0},e.createElement(y,{title:o,disabled:c&&s.includes(t),value:s.includes(t),onChange:e=>u(t,e)})))),!!r&&e.createElement(v,null,r)))},[Mt.CustomInstrumentation]:({value:t,setValue:i,formErrors:a})=>{const n=a.customInstrumentations,r=l(()=>(t?.customInstrumentations?.[It.Probes]||[]).map(e=>({key:e.className,value:e.methodName})),[t]),s=e=>{const t=e.map(e=>({className:e.key,methodName:e.value})),o={[It.Probes]:t};i("customInstrumentations",o)};return o(()=>{r.length||s([{key:"",value:""}])},[r]),e.createElement("div",null,e.createElement(k,{title:"Class and Method Pairs",tooltip:"Specify class name and method name pairs to instrument. Class name should be fully qualified (e.g., com.example.service.UserService) and method name should be exact (e.g., createUser).",value:r,onChange:s,errorMessage:n,required:!0,keyPlaceholder:"Class name",valuePlaceholder:"Method name"}))},[Mt.HeadersCollection]:({value:t,setValue:i,formErrors:a})=>{const n=a.headersCollection,r=l(()=>t?.headersCollection?.[Tt.HeaderKeys]||[],[t]),s=e=>{const t={[Tt.HeaderKeys]:e};i("headersCollection",t)};return o(()=>{r.length||s(wn)},[r]),e.createElement("div",null,r.length>0&&e.createElement(w,{title:"Header Keys",tooltip:"Specify which headers you want to collect, asterisk (*) will collect all headers.",value:r,onChange:e=>s(e),errorMessage:n}))},[Mt.PayloadCollection]:({value:i,setValue:a,formErrors:n})=>{const r=n.payloadCollection,s=l(()=>Object.entries(i.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[i]),[c,d]=t(1===s.length);return o(()=>{if(!s.length){const e={[Ot.HttpRequest]:{},[Ot.HttpResponse]:{},[Ot.DbQuery]:{},[Ot.Messaging]:{}};a("payloadCollection",e),d(!1)}},[]),e.createElement("div",null,e.createElement(g,{title:"Type of data to collect",required:!0}),e.createElement(Dn,{$hasError:!!r},Nn.map(({id:t,label:o})=>e.createElement(y,{key:t,title:o,disabled:c&&s.includes(t),value:s.includes(t),onChange:e=>((e,t)=>{const o=t?[...s,e]:s.filter(t=>t!==e),i={[Ot.HttpRequest]:o.includes(Ot.HttpRequest)?{}:null,[Ot.HttpResponse]:o.includes(Ot.HttpResponse)?{}:null,[Ot.DbQuery]:o.includes(Ot.DbQuery)?{}:null,[Ot.Messaging]:o.includes(Ot.Messaging)?{}:null};a("payloadCollection",i),d(1===o.length)})(t,e)}))),!!r&&e.createElement(v,null,r))},[Mt.UnknownType]:null},In=({ruleType:t,value:o,setValue:i,formErrors:a})=>{if(!t)return null;const n=Tn[t];return n?e.createElement(n,{value:o,setValue:i,formErrors:a}):null},En=d.div`
229
+ `,Ia=[{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"}],Ea={[At.CodeAttributes]:({value:i,setValue:n,formErrors:a})=>{const r=a.codeAttributes,s=l(()=>Object.entries(i.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[i]),[c,d]=t(1===s.length);o(()=>{if(!s.length){const e={[Ot.Column]:null,[Ot.FilePath]:!0,[Ot.Function]:!0,[Ot.LineNumber]:!0,[Ot.Namespace]:null,[Ot.StackTrace]:null};n("codeAttributes",e),d(!1)}},[]);const u=(e,t)=>{const o=t?[...s,e]:s.filter(t=>t!==e),i=Object.values(Ot).reduce((e,t)=>(e[t]=!!o.includes(t)||null,e),{});n("codeAttributes",i),d(1===o.length)};return e.createElement(e.Fragment,null,e.createElement("div",null,e.createElement(y,{title:"Recommended data to collect",required:!0}),e.createElement(ka,{$hasError:!!r},wa.map(({id:t,label:o,tooltip:i})=>e.createElement(ue,{key:t,text:i,withIcon:!0},e.createElement(v,{title:o,disabled:c&&s.includes(t),value:s.includes(t),onChange:e=>u(t,e)})))),!!r&&e.createElement(b,null,r)),e.createElement("div",null,e.createElement(y,{title:"Verbose data to collect",required:!0}),e.createElement(ka,{$hasError:!!r},Da.map(({id:t,label:o,tooltip:i})=>e.createElement(ue,{key:t,text:i,withIcon:!0},e.createElement(v,{title:o,disabled:c&&s.includes(t),value:s.includes(t),onChange:e=>u(t,e)})))),!!r&&e.createElement(b,null,r)))},[At.CustomInstrumentation]:({value:t,setValue:i,formErrors:n})=>{const a=n.customInstrumentations,r=l(()=>(t?.customInstrumentations?.[Et.Probes]||[]).map(e=>({key:e.className,value:e.methodName})),[t]),s=e=>{const t=e.map(e=>({className:e.key,methodName:e.value})),o={[Et.Probes]:t};i("customInstrumentations",o)};return o(()=>{r.length||s([{key:"",value:""}])},[r]),e.createElement("div",null,e.createElement(w,{title:"Class and Method Pairs",tooltip:"Specify class name and method name pairs to instrument. Class name should be fully qualified (e.g., com.example.service.UserService) and method name should be exact (e.g., createUser).",value:r,onChange:s,errorMessage:a,required:!0,keyPlaceholder:"Class name",valuePlaceholder:"Method name"}))},[At.HeadersCollection]:({value:t,setValue:i,formErrors:n})=>{const a=n.headersCollection,r=l(()=>t?.headersCollection?.[It.HeaderKeys]||[],[t]),s=e=>{const t={[It.HeaderKeys]:e};i("headersCollection",t)};return o(()=>{r.length||s(Na)},[r]),e.createElement("div",null,r.length>0&&e.createElement(D,{title:"Header Keys",tooltip:"Specify which headers you want to collect, asterisk (*) will collect all headers.",value:r,onChange:e=>s(e),errorMessage:a}))},[At.PayloadCollection]:({value:i,setValue:n,formErrors:a})=>{const r=a.payloadCollection,s=l(()=>Object.entries(i.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[i]),[c,d]=t(1===s.length);return o(()=>{if(!s.length){const e={[Mt.HttpRequest]:{},[Mt.HttpResponse]:{},[Mt.DbQuery]:{},[Mt.Messaging]:{}};n("payloadCollection",e),d(!1)}},[]),e.createElement("div",null,e.createElement(y,{title:"Type of data to collect",required:!0}),e.createElement(Ta,{$hasError:!!r},Ia.map(({id:t,label:o})=>e.createElement(v,{key:t,title:o,disabled:c&&s.includes(t),value:s.includes(t),onChange:e=>((e,t)=>{const o=t?[...s,e]:s.filter(t=>t!==e),i={[Mt.HttpRequest]:o.includes(Mt.HttpRequest)?{}:null,[Mt.HttpResponse]:o.includes(Mt.HttpResponse)?{}:null,[Mt.DbQuery]:o.includes(Mt.DbQuery)?{}:null,[Mt.Messaging]:o.includes(Mt.Messaging)?{}:null};n("payloadCollection",i),d(1===o.length)})(t,e)}))),!!r&&e.createElement(b,null,r))},[At.UnknownType]:null},Oa=({ruleType:t,value:o,setValue:i,formErrors:n})=>{if(!t)return null;const a=Ea[t];return a?e.createElement(a,{value:o,setValue:i,formErrors:n}):null},Ma=d.div`
230
230
  display: flex;
231
231
  flex-direction: column;
232
232
  gap: 24px;
233
233
  padding: 4px;
234
- `,On=d(N)`
234
+ `,Aa=d(T)`
235
235
  margin-bottom: 12px;
236
- `,Mn=({isUpdate:t,rule:o,formData:i,formErrors:a,handleFormChange:n})=>{const l=T.useTheme();return e.createElement(En,null,e.createElement(se,null,o.supportedLanguages.map(t=>e.createElement(At,{key:t,icon:Ft(t),type:B.Info},t))),t?e.createElement("div",null,e.createElement(On,null,"Status"),e.createElement(I,{options:[{icon:vo,label:p.ENABLED,value:!1,selectedBgColor:l.text.success+T.opacity.hex["050"]},{icon:bo,label:p.DISABLED,value:!0,selectedBgColor:l.text.error+T.opacity.hex["050"]}],selected:i.disabled,setSelected:e=>n("disabled",e)})):e.createElement(e.Fragment,null,e.createElement(E,{title:"",description:o.docsDescription,actionButton:e.createElement(O,{endpoint:o.docsEndpoint})}),e.createElement(f,{title:"Rule name",placeholder:"Use a name that describes the rule",value:i.ruleName,onChange:({target:{value:e}})=>n("ruleName",e),errorMessage:a.ruleName})),e.createElement(In,{ruleType:o.type,value:i,setValue:(e,t)=>n(e,t),formErrors:a}),e.createElement(A,{title:"Notes",value:i.notes,onChange:({target:{value:e}})=>n("notes",e),errorMessage:a.notes}))},An=d.div`
236
+ `,Fa=({isUpdate:t,rule:o,formData:i,formErrors:n,handleFormChange:a})=>{const l=I.useTheme();return e.createElement(Ma,null,e.createElement(ce,null,o.supportedLanguages.map(t=>e.createElement(Ft,{key:t,icon:Rt(t),type:j.Info},t))),t?e.createElement("div",null,e.createElement(Aa,null,"Status"),e.createElement(E,{options:[{icon:bo,label:p.ENABLED,value:!1,selectedBgColor:l.text.success+I.opacity.hex["050"]},{icon:fo,label:p.DISABLED,value:!0,selectedBgColor:l.text.error+I.opacity.hex["050"]}],selected:i.disabled,setSelected:e=>a("disabled",e)})):e.createElement(e.Fragment,null,e.createElement(O,{title:"",description:o.docsDescription,actionButton:e.createElement(M,{endpoint:o.docsEndpoint})}),e.createElement(x,{title:"Rule name",placeholder:"Use a name that describes the rule",value:i.ruleName,onChange:({target:{value:e}})=>a("ruleName",e),errorMessage:n.ruleName})),e.createElement(Oa,{ruleType:o.type,value:i,setValue:(e,t)=>a(e,t),formErrors:n}),e.createElement(F,{title:"Notes",value:i.notes,onChange:({target:{value:e}})=>a("notes",e),errorMessage:n.notes}))},Ra=d.div`
237
237
  width: 100%;
238
238
  height: 100%;
239
239
  max-height: calc(100vh - 220px);
240
240
  overflow: overlay;
241
241
  overflow-y: auto;
242
- `,Fn=({updateInstrumentationRule:o,deleteInstrumentationRule:i})=>{const{instrumentationRules:n}=j(),{addNotification:r}=R(),{drawerType:s,drawerEntityId:c}=L(),d=a(null),u=s!==W.InstrumentationRule,[p,m]=t(!1),[h,g]=t(!1),{formData:y,formErrors:v,handleFormChange:b,resetFormData:f,validateForm:x,loadFormWithDrawerItem:C}=Rt(),$=l(()=>{if(u)return null;const e=n?.find(e=>e.ruleId===c);return e&&C(e),e},[u,c,n]);if(!$)return null;const S=Lt.find(({type:e})=>e===$.type);return e.createElement(vi,{ref:d,title:$.ruleName||$.type,icons:[Fe($.type)],isEdit:p,isFormDirty:h,onEdit:e=>{$.mutable||!e&&void 0!==e?m("boolean"!=typeof e||e):r({type:B.Warning,title:ie.FORBIDDEN,message:ie.CANNOT_EDIT_RULE,crdType:W.InstrumentationRule,target:c,hideFromHistory:!0})},onSave:e=>{if(x()){const t=e!==$.type?e:"";b("ruleName",t),o(c,{...y,ruleName:t}),m(!1),g(!1)}},onDelete:()=>{$.mutable?(i(c),m(!1),g(!1),f(),d.current?.closeDrawer()):r({type:B.Warning,title:ie.FORBIDDEN,message:ie.CANNOT_DELETE_RULE,crdType:W.InstrumentationRule,target:c,hideFromHistory:!0})},onCancel:()=>{m(!1),g(!1),C($)}},p&&S?e.createElement(An,null,e.createElement(Mn,{isUpdate:!0,rule:S,formData:y,formErrors:v,handleFormChange:(...e)=>{g(!0),b(...e)}})):e.createElement(J,{title:"Instrumentation Rule Details",data:$?Cn($):[]}))},Rn=d(X)`
242
+ `,La=({updateInstrumentationRule:o,deleteInstrumentationRule:i})=>{const{instrumentationRules:a}=V(),{addNotification:r}=L(),{drawerType:s,drawerEntityId:c}=q(),d=n(null),u=s!==B.InstrumentationRule,[p,m]=t(!1),[h,g]=t(!1),{formData:y,formErrors:v,handleFormChange:b,resetFormData:f,validateForm:x,loadFormWithDrawerItem:C}=Lt(),$=l(()=>{if(u)return null;const e=a?.find(e=>e.ruleId===c);return e&&C(e),e},[u,c,a]);if(!$)return null;const S=qt.find(({type:e})=>e===$.type);return e.createElement(fi,{ref:d,title:$.ruleName||$.type,icons:[Re($.type)],isEdit:p,isFormDirty:h,onEdit:e=>{$.mutable||!e&&void 0!==e?m("boolean"!=typeof e||e):r({type:j.Warning,title:ne.FORBIDDEN,message:ne.CANNOT_EDIT_RULE,crdType:B.InstrumentationRule,target:c,hideFromHistory:!0})},onSave:e=>{if(x()){const t=e!==$.type?e:"";b("ruleName",t),o(c,{...y,ruleName:t}),m(!1),g(!1)}},onDelete:()=>{$.mutable?(i(c),m(!1),g(!1),f(),d.current?.closeDrawer()):r({type:j.Warning,title:ne.FORBIDDEN,message:ne.CANNOT_DELETE_RULE,crdType:B.InstrumentationRule,target:c,hideFromHistory:!0})},onCancel:()=>{m(!1),g(!1),C($)}},p&&S?e.createElement(Ra,null,e.createElement(Fa,{isUpdate:!0,rule:S,formData:y,formErrors:v,handleFormChange:(...e)=>{g(!0),b(...e)}})):e.createElement(Y,{title:"Instrumentation Rule Details",data:$?Sa($):[]}))},qa=d(Q)`
243
243
  margin-top: 24px;
244
244
  gap: 12px;
245
- `,Ln=Lt.filter(({type:e})=>e!==Mt.CustomInstrumentation),Pn=({isEnterprise:o,createInstrumentationRule:i})=>{const{currentModal:a,setCurrentModal:n}=Q(),l=a===W.InstrumentationRule,{formData:r,formErrors:s,handleFormChange:c,resetFormData:d,validateForm:u}=Rt(),[m,h]=t(void 0),g=()=>{d(),h(void 0),n("")},y=()=>{if(!u())return null;i(r),g()};return P({key:"Enter",active:l},()=>y()),e.createElement(Z,{isOpen:l,onClose:g,header:{title:"Add Instrumentation Rule"},actionComponent:e.createElement(ee,{buttons:[{variant:"primary",label:"DONE",onClick:y,disabled:!o||!m,tooltip:o?"":ie.ENTERPRISE_ONLY("Instrumentation Rules")}]})},e.createElement(te,null,e.createElement(E,{title:"Select Instrumentation Rule",description:"Define how telemetry is recorded from your application. Choose a rule type and configure the details."}),e.createElement(Rn,null,o?e.createElement(oe,{type:B.Warning,message:ie.DEFINED_FOR_ALL_STREAMS(p.INSTRUMENTATION_RULES)}):e.createElement(oe,{type:B.Default,message:ie.ENTERPRISE_ONLY(p.INSTRUMENTATION_RULES)}),e.createElement(ae,{options:Ln,selectedOption:m,onOptionSelect:e=>{return t=e,d(),void h(t);var t},autoFocus:!m?.type})),m?.type?e.createElement("div",null,e.createElement(ne,{margin:"16px 0"}),e.createElement(Mn,{rule:m,formData:r,formErrors:s,handleFormChange:c})):null))},qn=e=>{const{payloadCollection:t,codeAttributes:o,customInstrumentations:i}=e;let a="";if(t&&(a+=Object.entries(t).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),o&&(a+=Object.entries(o).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),i){const e=(i[It.Probes]||[]).filter(e=>e.className&&e.methodName).map(e=>`${e.className}.${e.methodName}`).join(", ");e&&(a+=a?`, ${e}`:e)}return a},Kn=[{key:"icon",title:""},{key:"name",title:p.NAME,sortable:!0},{key:"profile",title:p.MANAGED_BY_PROFILE,sortable:!0},{key:"active-status",title:p.STATUS},{key:"source-count",title:"Applicable Source"},{key:"type",title:p.TYPE,sortable:!0},{key:"spec",title:"Spec",sortable:!0},{key:"notes",title:p.NOTES,sortable:!0}],Hn=({maxHeight:t,maxWidth:o})=>{const i=T.useTheme(),a=me(),{setDrawerType:n,setDrawerEntityId:r}=L(),{instrumentationRules:s,instrumentationRulesLoading:c}=j(),d=l(()=>Ni({instrumentationRules:s,sources:[],actions:[],destinations:[],searchText:a.searchText,selectedCategory:W.InstrumentationRule}).searchResults.find(({category:e})=>e===W.InstrumentationRule)?.entities||[],[s,a]),u=l(()=>d.map(t=>({onClick:()=>{n(W.InstrumentationRule),r(t.ruleId)},cells:[{columnKey:"icon",component:()=>e.createElement(ge,{icon:Fe(t.type)})},{columnKey:"name",value:ye(t,W.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:qn(t),textColor:i.text.info,withTooltip:!0},{columnKey:"active-status",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(re,{status:t.disabled?B.Error:B.Success,title:t.disabled?p.DISABLED:p.ENABLED,withIcon:!0,withBorder:!0}))},{columnKey:"source-count",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(re,{status:B.Info,title:"all sources",withBorder:!0}))}]})),[d]),{badge:m,badgeTooltip:h}=l(()=>d.length!==s.length?{badge:`${d.length}/${s.length}`,badgeTooltip:p.FILTERED_COUNT_TOOLTIP}:{badge:s.length,badgeTooltip:void 0},[d,s]);return e.createElement(be,{$maxWidth:o},e.createElement(fe,null,e.createElement(xe,{icon:Ce(W.Action),title:p.INSTRUMENTATION_RULES,badge:m,badgeTooltip:h,loading:c})),e.createElement($e,{$maxHeight:t},e.createElement(Se,{columns:Kn,rows:u})),!d.length&&e.createElement(ke,{style:{marginTop:"2rem"}},e.createElement(we,null)))},zn=d.div`
245
+ `,Pa=qt.filter(({type:e})=>e!==At.CustomInstrumentation),Ka=({isEnterprise:o,createInstrumentationRule:i})=>{const{currentModal:n,setCurrentModal:a}=Z(),l=n===B.InstrumentationRule,{formData:r,formErrors:s,handleFormChange:c,resetFormData:d,validateForm:u}=Lt(),[m,h]=t(void 0),g=()=>{d(),h(void 0),a("")},y=()=>{if(!u())return null;i(r),g()};return P({key:"Enter",active:l},()=>y()),e.createElement(ee,{isOpen:l,onClose:g,header:{title:"Add Instrumentation Rule"},actionComponent:e.createElement(te,{buttons:[{variant:"primary",label:"DONE",onClick:y,disabled:!o||!m,tooltip:o?"":ne.ENTERPRISE_ONLY("Instrumentation Rules")}]})},e.createElement(oe,null,e.createElement(O,{title:"Select Instrumentation Rule",description:"Define how telemetry is recorded from your application. Choose a rule type and configure the details."}),e.createElement(qa,null,o?e.createElement(ie,{type:j.Warning,message:ne.DEFINED_FOR_ALL_STREAMS(p.INSTRUMENTATION_RULES)}):e.createElement(ie,{type:j.Default,message:ne.ENTERPRISE_ONLY(p.INSTRUMENTATION_RULES)}),e.createElement(ae,{options:Pa,selectedOption:m,onOptionSelect:e=>{return t=e,d(),void h(t);var t},autoFocus:!m?.type})),m?.type?e.createElement("div",null,e.createElement(le,{margin:"16px 0"}),e.createElement(Fa,{rule:m,formData:r,formErrors:s,handleFormChange:c})):null))},Ha=e=>{const{payloadCollection:t,codeAttributes:o,customInstrumentations:i}=e;let n="";if(t&&(n+=Object.entries(t).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),o&&(n+=Object.entries(o).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),i){const e=(i[Et.Probes]||[]).filter(e=>e.className&&e.methodName).map(e=>`${e.className}.${e.methodName}`).join(", ");e&&(n+=n?`, ${e}`:e)}return n},za=[{key:"icon",title:""},{key:"name",title:p.NAME,sortable:!0},{key:"profile",title:p.MANAGED_BY_PROFILE,sortable:!0},{key:"active-status",title:p.STATUS},{key:"source-count",title:"Applicable Source"},{key:"type",title:p.TYPE,sortable:!0},{key:"spec",title:"Spec",sortable:!0},{key:"notes",title:p.NOTES,sortable:!0}],Wa=({maxHeight:t,maxWidth:o})=>{const i=I.useTheme(),n=he(),{setDrawerType:a,setDrawerEntityId:r}=q(),{instrumentationRules:s,instrumentationRulesLoading:c}=V(),d=l(()=>Ii({instrumentationRules:s,sources:[],actions:[],destinations:[],searchText:n.searchText,selectedCategory:B.InstrumentationRule}).searchResults.find(({category:e})=>e===B.InstrumentationRule)?.entities||[],[s,n]),u=l(()=>d.map(t=>({onClick:()=>{a(B.InstrumentationRule),r(t.ruleId)},cells:[{columnKey:"icon",component:()=>e.createElement(ye,{icon:Re(t.type)})},{columnKey:"name",value:ve(t,B.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:Ha(t),textColor:i.text.info,withTooltip:!0},{columnKey:"active-status",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:t.disabled?j.Error:j.Success,title:t.disabled?p.DISABLED:p.ENABLED,withIcon:!0,withBorder:!0}))},{columnKey:"source-count",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:j.Info,title:"all sources",withBorder:!0}))}]})),[d]),{badge:m,badgeTooltip:h}=l(()=>d.length!==s.length?{badge:`${d.length}/${s.length}`,badgeTooltip:p.FILTERED_COUNT_TOOLTIP}:{badge:s.length,badgeTooltip:void 0},[d,s]);return e.createElement(fe,{$maxWidth:o},e.createElement(xe,null,e.createElement(Ce,{icon:$e(B.Action),title:p.INSTRUMENTATION_RULES,badge:m,badgeTooltip:h,loading:c})),e.createElement(Se,{$maxHeight:t},e.createElement(ke,{columns:za,rows:u})),!d.length&&e.createElement(we,{style:{marginTop:"2rem"}},e.createElement(De,null)))},Ba=d.div`
246
246
  position: fixed;
247
247
  bottom: 0;
248
248
  left: 50%;
@@ -255,17 +255,17 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
255
255
  border-radius: 32px;
256
256
  border: 1px solid ${({theme:e})=>e.colors.border};
257
257
  background-color: ${({theme:e})=>e.colors.dropdown_bg};
258
- `,Wn=({totalSourceCount:o,uninstrumentSources:i,restartWorkloads:a})=>{const n=T.useTheme(),s=Pt({container:zn,animateIn:T.animations.slide.in.center,animateOut:T.animations.slide.out.center}),{selectedSources:c,setSelectedSources:d}=qt(),[u,p]=t(!1),m=l(()=>{let e=0;return Object.values(c).forEach(t=>{e+=t.length}),e},[c]),h=()=>{d({})};return e.createElement(r,null,e.createElement(s,{"data-id":"multi-source-control",enter:!!m},e.createElement(N,null,"Selected sources"),e.createElement(Ne,{label:m,filled:!0}),e.createElement(ne,{orientation:"vertical",length:"16px"}),e.createElement(at,{variant:"tertiary",onClick:h},e.createElement(N,{family:"secondary",decoration:"underline"},"Deselect")),e.createElement(at,{variant:"tertiary",onClick:()=>{const e=[];Object.values(c).forEach(t=>{e.push(...t.map(e=>Kt(e)))}),a(e),h()}},e.createElement(Io,null),e.createElement(N,{family:"secondary",decoration:"underline"},"Restart")),e.createElement(at,{variant:"tertiary",onClick:()=>p(!0)},e.createElement(xo,null),e.createElement(N,{family:"secondary",decoration:"underline",color:n.text.error},"Uninstrument"))),e.createElement(H,{isOpen:u,name:`${m} sources`,type:W.Source,isLastItem:m===o,onApprove:()=>{const e={};Object.entries(c).forEach(([t,o])=>{e[t]=o.map(e=>({...e,selected:!1}))}),i(e),p(!1),h()},onDeny:()=>p(!1)}))},Bn=d.div`
258
+ `,ja=({totalSourceCount:o,uninstrumentSources:i,restartWorkloads:n})=>{const a=I.useTheme(),s=Pt({container:Ba,animateIn:I.animations.slide.in.center,animateOut:I.animations.slide.out.center}),{selectedSources:c,setSelectedSources:d}=Kt(),[u,p]=t(!1),m=l(()=>{let e=0;return Object.values(c).forEach(t=>{e+=t.length}),e},[c]),h=()=>{d({})};return e.createElement(r,null,e.createElement(s,{"data-id":"multi-source-control",enter:!!m},e.createElement(T,null,"Selected sources"),e.createElement(Te,{label:m,filled:!0}),e.createElement(le,{orientation:"vertical",length:"16px"}),e.createElement(at,{variant:"tertiary",onClick:h},e.createElement(T,{family:"secondary",decoration:"underline"},"Deselect")),e.createElement(at,{variant:"tertiary",onClick:()=>{const e=[];Object.values(c).forEach(t=>{e.push(...t.map(e=>Ht(e)))}),n(e),h()}},e.createElement(Eo,null),e.createElement(T,{family:"secondary",decoration:"underline"},"Restart")),e.createElement(at,{variant:"tertiary",onClick:()=>p(!0)},e.createElement(Co,null),e.createElement(T,{family:"secondary",decoration:"underline",color:a.text.error},"Uninstrument"))),e.createElement(z,{isOpen:u,name:`${m} sources`,type:B.Source,isLastItem:m===o,onApprove:()=>{const e={};Object.entries(c).forEach(([t,o])=>{e[t]=o.map(e=>({...e,selected:!1}))}),i(e),p(!1),h()},onDeny:()=>p(!1)}))},Va=d.div`
259
259
  position: relative;
260
260
  width: fit-content;
261
- `,jn=d(se)`
261
+ `,Ua=d(ce)`
262
262
  gap: 12px;
263
263
  padding: 0 12px;
264
- `,Vn=d(X)`
264
+ `,_a=d(Q)`
265
265
  gap: 12px;
266
266
  max-height: 400px;
267
267
  overflow-y: auto;
268
- `,Un=d.div`
268
+ `,Ga=d.div`
269
269
  position: absolute;
270
270
  bottom: 0;
271
271
  left: 0;
@@ -274,19 +274,19 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
274
274
  border-radius: 0 0 24px 24px;
275
275
  background: ${({theme:e})=>`linear-gradient(to top, ${e.colors.dropdown_bg}, transparent)`};
276
276
  pointer-events: none;
277
- `,_n=d(N)`
277
+ `,Ja=d(T)`
278
278
  background-color: ${({theme:e})=>e.colors.orange_soft};
279
279
  color: ${({theme:e})=>e.text.primary};
280
280
  border-radius: 32px;
281
281
  width: fit-content;
282
282
  padding: 2px 8px;
283
- `,Gn=()=>{const t=T.useTheme(),{notifications:o,markAsSeen:i}=R(),a=o.filter(({hideFromHistory:e})=>!e),n=a.filter(({seen:e})=>!e),l=n.length,{popupRef:r,popupOpen:s,setPopupOpen:c,popupPosition:d,handlePosition:u}=Ge({defaultClientHeight:420,defaultClientwidth:400,onClickOutside:()=>{l&&n.forEach(({id:e})=>i(e))}});return e.createElement(Bn,null,e.createElement(ct,{onClick:()=>{u(0,0),c(e=>!e)},tooltip:"Notifications",withPing:!!l,pingColor:t.colors.orange_og},e.createElement(Eo,{size:18})),e.createElement(Je,{ref:r,isOpen:s,right:d.left,maxWidth:"400px",header:e.createElement(jn,null,e.createElement(N,{size:20},"Notifications"),!!l&&e.createElement(_n,{size:12,family:"secondary"},l," new"))},e.createElement(Vn,null,a.length?a.map(t=>e.createElement(el,{key:`notification-${t.id}`,...t,onClick:()=>c(!1)})):e.createElement(we,{title:"No notifications",subTitle:""})),e.createElement(Un,null)))},Jn=d.div`
283
+ `,Ya=()=>{const t=I.useTheme(),{notifications:o,markAsSeen:i}=L(),n=o.filter(({hideFromHistory:e})=>!e),a=n.filter(({seen:e})=>!e),l=a.length,{popupRef:r,popupOpen:s,setPopupOpen:c,popupPosition:d,handlePosition:u}=Je({defaultClientHeight:420,defaultClientwidth:400,onClickOutside:()=>{l&&a.forEach(({id:e})=>i(e))}});return e.createElement(Va,null,e.createElement(dt,{onClick:()=>{u(0,0),c(e=>!e)},tooltip:"Notifications",withPing:!!l,pingColor:t.colors.orange_og},e.createElement(Oo,{size:18})),e.createElement(Ye,{ref:r,isOpen:s,right:d.left,maxWidth:"400px",header:e.createElement(Ua,null,e.createElement(T,{size:20},"Notifications"),!!l&&e.createElement(Ja,{size:12,family:"secondary"},l," new"))},e.createElement(_a,null,n.length?n.map(t=>e.createElement(ol,{key:`notification-${t.id}`,...t,onClick:()=>c(!1)})):e.createElement(De,{title:"No notifications",subTitle:""})),e.createElement(Ga,null)))},Xa=d.div`
284
284
  display: flex;
285
285
  align-items: flex-start;
286
286
  gap: 12px;
287
287
  padding: 16px;
288
288
  border-radius: 16px;
289
- background-color: ${({theme:e})=>e.colors.dropdown_bg_2+T.opacity.hex["080"]};
289
+ background-color: ${({theme:e})=>e.colors.dropdown_bg_2+I.opacity.hex["080"]};
290
290
  cursor: not-allowed;
291
291
  &.click-enabled {
292
292
  cursor: pointer;
@@ -294,27 +294,27 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
294
294
  background-color: ${({theme:e})=>e.colors.dropdown_bg_2};
295
295
  }
296
296
  }
297
- `,Yn=d.div`
298
- background-color: ${({$type:e,theme:t})=>t.text[e]+T.opacity.hex["015"]};
297
+ `,Qa=d.div`
298
+ background-color: ${({$type:e,theme:t})=>t.text[e]+I.opacity.hex["015"]};
299
299
  border-radius: 8px;
300
300
  width: 36px;
301
301
  height: 36px;
302
302
  display: flex;
303
303
  align-items: center;
304
304
  justify-content: center;
305
- `,Xn=d.div`
305
+ `,Za=d.div`
306
306
  width: 290px;
307
- `,Qn=d.div`
307
+ `,el=d.div`
308
308
  margin-bottom: 6px;
309
- `,Zn=d.div`
309
+ `,tl=d.div`
310
310
  display: flex;
311
311
  align-items: center;
312
312
  gap: 6px;
313
- `,el=({id:t,seen:o,type:i,title:a,message:n,time:l,crdType:r,target:s,onClick:c})=>{const d=T.useTheme(),u=Ht(),{onClickNotification:p}=zt(),m=!!r&&!!s,h=a?.toLowerCase().includes(Y.Delete.toLowerCase())||!1,g=pe(i,d);return e.createElement(Jn,{key:`notification-${t}`,className:m?"click-enabled":"",onClick:()=>{m&&(c(),p({id:t,crdType:r,target:s}))}},e.createElement(Yn,{$type:h?B.Error:i},h?e.createElement(xo,null):e.createElement(g,null)),e.createElement(Xn,null,e.createElement(Qn,null,e.createElement(N,{size:14},n)),e.createElement(Zn,null,e.createElement(N,{size:10,color:d.text.grey},u.format(new Date(l))),!o&&e.createElement(e.Fragment,null,e.createElement(N,{size:10},"·"),e.createElement(N,{size:10,color:d.colors.orange_soft},"new")))))},tl=(e,t,o)=>{const i=e?.serviceName||t?.otelServiceName||t?.name,a=o?[Oo]:Re(t?.containers||[]),{priorotizedStatus:n}=le(t?.conditions||[]);return{id:i,title:i,icons:a.length?a:[Mo],status:n,serviceMapEntry:e}},ol=e=>"user"===e?.otelServiceName&&!e?.namespace&&!e?.name&&!e?.kind,il=d.div`
313
+ `,ol=({id:t,seen:o,type:i,title:n,message:a,time:l,crdType:r,target:s,onClick:c})=>{const d=I.useTheme(),u=zt(),{onClickNotification:p}=Wt(),m=!!r&&!!s,h=n?.toLowerCase().includes(X.Delete.toLowerCase())||!1,g=me(i,d);return e.createElement(Xa,{key:`notification-${t}`,className:m?"click-enabled":"",onClick:()=>{m&&(c(),p({id:t,crdType:r,target:s}))}},e.createElement(Qa,{$type:h?j.Error:i},h?e.createElement(Co,null):e.createElement(g,null)),e.createElement(Za,null,e.createElement(el,null,e.createElement(T,{size:14},a)),e.createElement(tl,null,e.createElement(T,{size:10,color:d.text.grey},u.format(new Date(l))),!o&&e.createElement(e.Fragment,null,e.createElement(T,{size:10},"·"),e.createElement(T,{size:10,color:d.colors.orange_soft},"new")))))},il=(e,t,o)=>{const i=e?.serviceName||t?.otelServiceName||t?.name,n=o?[Mo]:Le(t?.containers||[]),{priorotizedStatus:a}=re(t?.conditions||[]);return{id:i,title:i,icons:n.length?n:[Ao],status:a,serviceMapEntry:e}},nl=e=>"user"===e?.otelServiceName&&!e?.namespace&&!e?.name&&!e?.kind,al=d.div`
314
314
  width: 100%;
315
315
  height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px)`};
316
316
  position: relative;
317
- `,al={namespace:"",name:"",kind:"",otelServiceName:"user",selected:!0,numberOfInstances:0,dataStreamNames:[],containers:[],conditions:[]},nl=({heightToRemove:t,serviceMap:i})=>{const a=T.useTheme(),{sources:n,sourcesLoading:l}=j(),{containerRef:r,containerHeight:s,containerWidth:c}=ze(),[d,u,m]=Uo([]),[h,g,y]=_o([]);return o(()=>{if(s&&c){const t=(({sources:e,serviceMap:t,containerHeight:o,containerWidth:i})=>{const a=[],n=new Map,l=((e,t)=>{const o=new Map,i=new Map,a=new Map,n=new Set;e.forEach(e=>{n.add(e.serviceName),e.services.forEach(e=>{n.add(e.serviceName)})}),n.forEach(e=>{i.set(e,[]),a.set(e,0)}),e.forEach(e=>{e.services.forEach(t=>{i.get(e.serviceName)?.push(t.serviceName);const o=a.get(t.serviceName)||0;a.set(t.serviceName,o+1)})});const l=[],r=[];for(n.forEach(e=>{0===(a.get(e)||0)&&r.push(e)});r.length>0;){const e=[],t=r.length;for(let o=0;o<t;o++){const t=r.shift();e.push(t),i.get(t)?.forEach(e=>{const t=a.get(e)||0;a.set(e,t-1),t-1==0&&r.push(e)})}e.length>0&&l.push(e)}return n.forEach(e=>{l.flat().includes(e)||(0===l.length?l.push([e]):l[l.length-1].push(e))}),l.forEach((e,i)=>{const a=100+150*i,n=150*(e.length-1),l=(t-n)/2;e.forEach((e,t)=>{const i=l+150*t,n=a;o.set(e,{x:i,y:n})})}),o})(t,i);if(t.length&&e.length){t.forEach(t=>{const o=t.serviceName;if(a.find(e=>e.id===`${W.Source}-${o}-${Ie.MapItem}`))return;const i=e.find(e=>o===e.otelServiceName||o===e.name);n.set(o,t),t.services.forEach(e=>n.set(e.serviceName,{serviceName:e.serviceName,services:[]})),a.push({id:`${W.Source}-${o}-${Ie.MapItem}`,type:Ie.MapItem,position:l.get(o),data:tl(t,i,ol(i))})}),n.forEach((t,o)=>{if(a.find(e=>e.id===`${W.Source}-${o}-${Ie.MapItem}`))return;const i=e.find(e=>o===e.otelServiceName||o===e.name);a.push({id:`${W.Source}-${o}-${Ie.MapItem}`,type:Ie.MapItem,position:l.get(o),data:tl(t,i,ol(i))})});let o=50;e.forEach(e=>{const t=e.otelServiceName||e.name;a.find(e=>e.id===`${W.Source}-${t}-${Ie.MapItem}`)||(a.push({id:`${W.Source}-${t}-${Ie.MapItem}`,type:Ie.MapItem,position:{x:o,y:10},data:tl(void 0,e,ol(e))}),o+=110)})}else a.push({id:`${W.Source}-${Ie.NoData}`,type:Ie.NoData,position:{x:i/2-150,y:o/2-50},data:{subTitle:p.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return a})({serviceMap:i,sources:[al].concat(n),sourcesLoading:l,containerHeight:s,containerWidth:c});d.length>1?(e=t,u(t=>{const o=e.map(e=>{const o=t.find(t=>t.id===e.id);return e.position=o?.position||e.position,{id:e.id,item:e,type:o?"replace":"add"}});return t.find(e=>e.id===`${W.Source}-${Ie.NoData}`)&&o.push({id:`${W.Source}-${Ie.NoData}`,type:"remove"}),Go(o,t)})):u(t)}var e},[i,n,l,s,c]),o(()=>{g((({theme:e,nodes:t,serviceMap:o})=>{const i=[];return t.forEach(({id:t,data:{id:a,status:n}})=>{const{services:l}=o.find(e=>e.serviceName===a)||{services:[]};l.forEach(o=>{const a=t,l=`${W.Source}-${o.serviceName}-${Ie.MapItem}`,r=n===B.Error;i.push({id:`${a}-to-${l}`,source:a,target:l,markerEnd:{type:Jo.ArrowClosed},style:{stroke:r?e?.colors.dark_red:e?.colors.border}})})}),i})({theme:a,nodes:d,serviceMap:i}))},[a,d,i]),e.createElement(il,{ref:r,$heightToRemove:t},e.createElement(Ue,{nodes:d,edges:h,onNodesChange:m,onEdgesChange:y,zoomOnScroll:!0}))},ll=d.div`
317
+ `,ll={namespace:"",name:"",kind:"",otelServiceName:"user",selected:!0,numberOfInstances:0,dataStreamNames:[],containers:[],conditions:[]},rl=({heightToRemove:t,serviceMap:i})=>{const n=I.useTheme(),{sources:a,sourcesLoading:l}=V(),{containerRef:r,containerHeight:s,containerWidth:c}=We(),[d,u,m]=_o([]),[h,g,y]=Go([]);return o(()=>{if(s&&c){const t=(({sources:e,serviceMap:t,containerHeight:o,containerWidth:i})=>{const n=[],a=new Map,l=((e,t)=>{const o=new Map,i=new Map,n=new Map,a=new Set;e.forEach(e=>{a.add(e.serviceName),e.services.forEach(e=>{a.add(e.serviceName)})}),a.forEach(e=>{i.set(e,[]),n.set(e,0)}),e.forEach(e=>{e.services.forEach(t=>{i.get(e.serviceName)?.push(t.serviceName);const o=n.get(t.serviceName)||0;n.set(t.serviceName,o+1)})});const l=[],r=[];for(a.forEach(e=>{0===(n.get(e)||0)&&r.push(e)});r.length>0;){const e=[],t=r.length;for(let o=0;o<t;o++){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 a.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,a=150*(e.length-1),l=(t-a)/2;e.forEach((e,t)=>{const i=l+150*t,a=n;o.set(e,{x:i,y:a})})}),o})(t,i);if(t.length&&e.length){t.forEach(t=>{const o=t.serviceName;if(n.find(e=>e.id===`${B.Source}-${o}-${Ee.MapItem}`))return;const i=e.find(e=>o===e.otelServiceName||o===e.name);a.set(o,t),t.services.forEach(e=>a.set(e.serviceName,{serviceName:e.serviceName,services:[]})),n.push({id:`${B.Source}-${o}-${Ee.MapItem}`,type:Ee.MapItem,position:l.get(o),data:il(t,i,nl(i))})}),a.forEach((t,o)=>{if(n.find(e=>e.id===`${B.Source}-${o}-${Ee.MapItem}`))return;const i=e.find(e=>o===e.otelServiceName||o===e.name);n.push({id:`${B.Source}-${o}-${Ee.MapItem}`,type:Ee.MapItem,position:l.get(o),data:il(t,i,nl(i))})});let o=50;e.forEach(e=>{const t=e.otelServiceName||e.name;n.find(e=>e.id===`${B.Source}-${t}-${Ee.MapItem}`)||(n.push({id:`${B.Source}-${t}-${Ee.MapItem}`,type:Ee.MapItem,position:{x:o,y:10},data:il(void 0,e,nl(e))}),o+=110)})}else n.push({id:`${B.Source}-${Ee.NoData}`,type:Ee.NoData,position:{x:i/2-150,y:o/4},data:{subTitle:p.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return n})({serviceMap:i,sources:[ll].concat(a),sourcesLoading:l,containerHeight:s,containerWidth:c});d.length>1?(e=t,u(t=>{const o=e.map(e=>{const o=t.find(t=>t.id===e.id);return e.position=o?.position||e.position,{id:e.id,item:e,type:o?"replace":"add"}});return t.find(e=>e.id===`${B.Source}-${Ee.NoData}`)&&o.push({id:`${B.Source}-${Ee.NoData}`,type:"remove"}),Jo(o,t)})):u(t)}var e},[i,a,l,s,c]),o(()=>{g((({theme:e,nodes:t,serviceMap:o})=>{const i=[];return t.forEach(({id:t,data:{id:n,status:a}})=>{const{services:l}=o.find(e=>e.serviceName===n)||{services:[]};l.forEach(o=>{const n=t,l=`${B.Source}-${o.serviceName}-${Ee.MapItem}`,r=a===j.Error;i.push({id:`${n}-to-${l}`,source:n,target:l,markerEnd:{type:Yo.ArrowClosed},style:{stroke:r?e?.colors.dark_red:e?.colors.border}})})}),i})({theme:n,nodes:d,serviceMap:i}))},[n,d,i]),e.createElement(al,{ref:r,$heightToRemove:t},e.createElement(_e,{nodes:d,edges:h,onNodesChange:m,onEdgesChange:y,zoomOnScroll:!0}))},sl=d.div`
318
318
  display: flex;
319
319
  flex-direction: column;
320
320
  align-items: center;
@@ -324,12 +324,12 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
324
324
  max-height: ${({$isModal:e})=>e?"calc(100vh - 510px)":"calc(100vh - 310px)"};
325
325
  height: fit-content;
326
326
  overflow-y: scroll;
327
- `,rl=d.div`
327
+ `,cl=d.div`
328
328
  width: 100%;
329
329
  padding-bottom: ${({$isOpen:e})=>e?"18px":"0"};
330
330
  border-radius: 16px;
331
- background-color: ${({$selected:e,theme:t})=>e?t.colors.majestic_blue+T.opacity.hex["024"]:t.colors.dropdown_bg_2+T.opacity.hex["040"]};
332
- `,sl=d.div`
331
+ background-color: ${({$selected:e,theme:t})=>e?t.colors.majestic_blue+I.opacity.hex["024"]:t.colors.dropdown_bg_2+I.opacity.hex["040"]};
332
+ `,dl=d.div`
333
333
  display: flex;
334
334
  justify-content: space-between;
335
335
  gap: 12px;
@@ -338,25 +338,25 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
338
338
  border-radius: 16px;
339
339
  cursor: ${({$withClick:e})=>e?"pointer":"unset"};
340
340
  &:hover {
341
- background-color: ${({$withClick:e,$selected:t,theme:o})=>e&&(t?o.colors.majestic_blue+T.opacity.hex["040"]:o.colors.dropdown_bg_2+T.opacity.hex["080"])};
341
+ background-color: ${({$withClick:e,$selected:t,theme:o})=>e&&(t?o.colors.majestic_blue+I.opacity.hex["040"]:o.colors.dropdown_bg_2+I.opacity.hex["080"])};
342
342
  transition: background-color 0.3s;
343
343
  }
344
- `,cl=d(sl)`
344
+ `,ul=d(dl)`
345
345
  width: calc(100% - 100px);
346
346
  margin: 0 auto;
347
347
  padding: 8px;
348
- `,dl=d.div`
348
+ `,pl=d.div`
349
349
  position: relative;
350
350
  padding-bottom: ${({$addPadding:e})=>e?"16px":"0"};
351
- `,ul=d.div`
351
+ `,ml=d.div`
352
352
  position: absolute;
353
353
  top: 6px;
354
354
  left: 18px;
355
- `,pl=d(ke)`
355
+ `,hl=d(we)`
356
356
  padding-bottom: ${({$addPadding:e})=>e?"16px":"0"};
357
- `,ml=d(N)`
357
+ `,gl=d(T)`
358
358
  width: 18px;
359
- `,hl=({isModal:t=!1,withInstances:o=!0,isFetchingEachNamespace:i,fetchedNamespaces:a,filteredNamespacesAndSources:n,selectedNamespace:l,onSelectNamespace:r,selectedSources:s,onSelectSource:c,selectedFutureApps:d,onSelectFutureApps:u})=>{const m=T.useTheme(),{namespacesLoading:h}=j(),g=Object.entries(n||{});if(!g?.length)return e.createElement(ke,null,h?e.createElement(yt,null):e.createElement(we,{title:p.NO_SOURCES,subTitle:r?p.PLEASE_MAKE_SURE_UNIGNORED_NAMESPACES:p.PLEASE_ADD_SOURCE}));const v=Ce(W.Namespace);return e.createElement(ll,{$isModal:t},i&&e.createElement(yt,{scale:1.2}),g.map(([t,n])=>{const g=s?.[t]||[],b=d?.[t]?.selected||!1,f=g.filter(({selected:e})=>e),x=g.length>0,C=l===t,$=f.length>0&&f.length===n.length,k=f.length>0&&f.length!==n.length,w=n.length>0,D=1===n.length;return r||w?e.createElement(rl,{key:`namespace-${t}`,"data-id":`namespace-${t}`,$selected:$,$isOpen:C},e.createElement(sl,{$selected:$,$withClick:!!r,onClick:()=>r?.(t)},e.createElement(se,{$gap:12},r&&e.createElement(y,{partiallyChecked:k,value:$,onChange:e=>r(t,e)}),e.createElement(v,null),e.createElement(N,null,t)),e.createElement(se,{$gap:12},u&&e.createElement(e.Fragment,null,e.createElement(S,{title:p.FUTURE_APPS_TITLE,tooltip:p.FUTURE_APPS_DESCRIPTION,initialValue:b,onChange:e=>u(e,t),flipHorizontally:!0}),e.createElement(ne,{orientation:"vertical",length:"12px",margin:"0"})),i&&!a?.includes(t)?e.createElement(yt,{scale:.8}):e.createElement(ml,{size:10,color:m.text.grey},x?`${f.length}/${n.length}`:null),r&&e.createElement(dt,{extend:C}))),(C||!r)&&(w?e.createElement(dl,{$addPadding:!c},e.createElement(ul,null,e.createElement(ne,{orientation:"vertical",length:(D?24:34*n.length)+"px"})),n.map(i=>{const a=f.some(({name:e})=>e===i.name);return e.createElement(gl,{key:`source-${i.name}`,withInstances:o,source:i,namespace:t,isSelected:a,onSelect:c})})):e.createElement(pl,{$addPadding:!c},h||i&&!a?.includes(t)?e.createElement(yt,null):e.createElement(we,{title:p.NO_SOURCES_NAMESPACE,subTitle:p.TRY_SEARCH_OR_OTHER_NAMESPACE})))):null}))},gl=({withInstances:t,source:o,namespace:i,isSelected:a,onSelect:n})=>e.createElement(cl,{"data-id":`source-${o.name}`,$selected:a,$withClick:!!n,onClick:()=>n?.(o)},e.createElement(se,{$gap:12},n&&e.createElement(y,{value:a,onChange:()=>n(o,i)}),e.createElement(se,{$gap:4},e.createElement(N,null,o.name),e.createElement(N,{opacity:.8,size:10},t?` • ${o.numberOfInstances||0} running instance${1!==o.numberOfInstances?"s":""}`:"",` • ${o.kind}`)))),yl=d.div`
359
+ `,yl=({isModal:t=!1,withInstances:o=!0,isFetchingEachNamespace:i,fetchedNamespaces:n,filteredNamespacesAndSources:a,selectedNamespace:l,onSelectNamespace:r,selectedSources:s,onSelectSource:c,selectedFutureApps:d,onSelectFutureApps:u})=>{const m=I.useTheme(),{namespacesLoading:h}=V(),g=Object.entries(a||{});if(!g?.length)return e.createElement(we,null,h?e.createElement(vt,null):e.createElement(De,{title:p.NO_SOURCES,subTitle:r?p.PLEASE_MAKE_SURE_UNIGNORED_NAMESPACES:p.PLEASE_ADD_SOURCE}));const y=$e(B.Namespace);return e.createElement(sl,{$isModal:t},i&&e.createElement(vt,{scale:1.2}),g.map(([t,a])=>{const g=s?.[t]||[],b=d?.[t]?.selected||!1,f=g.filter(({selected:e})=>e),x=g.length>0,C=l===t,$=f.length>0&&f.length===a.length,S=f.length>0&&f.length!==a.length,w=a.length>0,D=1===a.length;return r||w?e.createElement(cl,{key:`namespace-${t}`,"data-id":`namespace-${t}`,$selected:$,$isOpen:C},e.createElement(dl,{$selected:$,$withClick:!!r,onClick:()=>r?.(t)},e.createElement(ce,{$gap:12},r&&e.createElement(v,{partiallyChecked:S,value:$,onChange:e=>r(t,e)}),e.createElement(y,null),e.createElement(T,null,t)),e.createElement(ce,{$gap:12},u&&e.createElement(e.Fragment,null,e.createElement(k,{title:p.FUTURE_APPS_TITLE,tooltip:p.FUTURE_APPS_DESCRIPTION,initialValue:b,onChange:e=>u(e,t),flipHorizontally:!0}),e.createElement(le,{orientation:"vertical",length:"12px",margin:"0"})),i&&!n?.includes(t)?e.createElement(vt,{scale:.8}):e.createElement(gl,{size:10,color:m.text.grey},x?`${f.length}/${a.length}`:null),r&&e.createElement(ut,{extend:C}))),(C||!r)&&(w?e.createElement(pl,{$addPadding:!c},e.createElement(ml,null,e.createElement(le,{orientation:"vertical",length:(D?24:34*a.length)+"px"})),a.map(i=>{const n=f.some(({name:e})=>e===i.name);return e.createElement(vl,{key:`source-${i.name}`,withInstances:o,source:i,namespace:t,isSelected:n,onSelect:c})})):e.createElement(hl,{$addPadding:!c},h||i&&!n?.includes(t)?e.createElement(vt,null):e.createElement(De,{title:p.NO_SOURCES_NAMESPACE,subTitle:p.TRY_SEARCH_OR_OTHER_NAMESPACE})))):null}))},vl=({withInstances:t,source:o,namespace:i,isSelected:n,onSelect:a})=>e.createElement(ul,{"data-id":`source-${o.name}`,$selected:n,$withClick:!!a,onClick:()=>a?.(o)},e.createElement(ce,{$gap:12},a&&e.createElement(v,{value:n,onChange:()=>a(o,i)}),e.createElement(ce,{$gap:4},e.createElement(T,null,o.name),e.createElement(T,{opacity:.8,size:10},t?` • ${o.numberOfInstances||0} running instance${1!==o.numberOfInstances?"s":""}`:"",` • ${o.kind}`)))),bl=d.div`
360
360
  display: flex;
361
361
  flex-direction: column;
362
362
  align-items: center;
@@ -365,35 +365,35 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
365
365
  max-height: calc(100vh - 200px);
366
366
  height: fit-content;
367
367
  overflow-y: scroll;
368
- `,vl=({onEditStream:t,onEditSources:o,onEditDestinations:i,categories:a})=>{const{selectedStreamName:n}=Ke(),{configuredSources:r,configuredDestinations:s,configuredDestinationsUpdateOnly:c}=xt(),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(E,{title:p.SUMMARY,description:p.STREAM_CONFIRM}),e.createElement(yl,null,e.createElement(J,{title:p.STREAM_NAME,action:()=>e.createElement(Wt,{onClick:t}),data:[{title:"",value:n}]}),e.createElement(J,{title:p.SELECTED_SOURCES,titleBadge:d,action:()=>e.createElement(Wt,{onClick:o})},e.createElement(hl,{filteredNamespacesAndSources:r,withInstances:!1})),e.createElement(J,{title:p.SELECTED_DESTINATIONS,titleBadge:s.length+c.length,action:()=>e.createElement(Wt,{onClick:i})},e.createElement(gn,{categories:a})))))};var bl;!function(e){e.Overview="overview",e.InstrumentationRules="InstrumentationRule",e.Sources="Source",e.Actions="Action",e.Destinations="Destination"}(bl||(bl={}));const fl=({onClickId:o,defaultSelectedId:i,extendedNavIcons:a})=>{const[n,r]=t(i||""),s=l(()=>[{id:bl.Overview,icon:Ao,selected:n===bl.Overview,onClick:()=>{r(bl.Overview),o(bl.Overview)},tooltip:"Overview"},...(a||[]).map(e=>({...e,selected:n===e.id,onClick:()=>{r(e.id),e.onClick()}}))],[n]),c=l(()=>[bl.Overview,bl.InstrumentationRules,bl.Sources,bl.Actions,bl.Destinations].includes(n)?[{id:bl.InstrumentationRules,icon:Fo,selected:n===bl.InstrumentationRules,onClick:()=>{r(bl.InstrumentationRules),o(bl.InstrumentationRules)},tooltip:"Instrumentation Rules"},{id:bl.Sources,icon:Ro,selected:n===bl.Sources,onClick:()=>{r(bl.Sources),o(bl.Sources)},tooltip:"Sources"},{id:bl.Actions,icon:Lo,selected:n===bl.Actions,onClick:()=>{r(bl.Actions),o(bl.Actions)},tooltip:"Actions"},{id:bl.Destinations,icon:Po,selected:n===bl.Destinations,onClick:()=>{r(bl.Destinations),o(bl.Destinations)},tooltip:"Destinations"}]:[],[n]);return e.createElement(Bt,{orientation:"vertical",mainIcons:s,subIcons:c})},xl=({})=>e.createElement(ct,{onClick:()=>window.open("https://join.slack.com/t/odigos/shared_invite/zt-2wc6gm4j9-EhcVFYrLwHqvcIErO9sVzw","_blank","noopener noreferrer"),tooltip:"Join our Slack community"},e.createElement(qo,null)),Cl=e=>{const{name:t,kind:o,namespace:i}=e;return[{title:p.NAMESPACE,value:i},{title:p.KIND,value:o},{title:p.NAME,value:t,tooltip:"K8s resource name"},{type:m.Divider},{type:m.CopyText,value:`kubectl get ${o} ${t} -n ${i}`.toLowerCase()}]},$l=d.div`
368
+ `,fl=({onEditStream:t,onEditSources:o,onEditDestinations:i,categories:n})=>{const{selectedStreamName:a}=He(),{configuredSources:r,configuredDestinations:s,configuredDestinationsUpdateOnly:c}=Ct(),d=l(()=>Object.values(r).reduce((e,t)=>e+t.filter(e=>e.selected).length,0),[r]);return e.createElement(oe,{$isNotModal:!0},e.createElement(Q,{$gap:12},e.createElement(O,{title:p.SUMMARY,description:p.STREAM_CONFIRM}),e.createElement(bl,null,e.createElement(Y,{title:p.STREAM_NAME,action:()=>e.createElement(Bt,{onClick:t}),data:[{title:"",value:a}]}),e.createElement(Y,{title:p.SELECTED_SOURCES,titleBadge:d,action:()=>e.createElement(Bt,{onClick:o})},e.createElement(yl,{filteredNamespacesAndSources:r,withInstances:!1})),e.createElement(Y,{title:p.SELECTED_DESTINATIONS,titleBadge:s.length+c.length,action:()=>e.createElement(Bt,{onClick:i})},e.createElement(va,{categories:n})))))};var xl;!function(e){e.Overview="overview",e.InstrumentationRules="InstrumentationRule",e.Sources="Source",e.Actions="Action",e.Destinations="Destination"}(xl||(xl={}));const Cl=({onClickId:o,defaultSelectedId:i,extendedNavIcons:n})=>{const[a,r]=t(i||""),s=l(()=>[{id:xl.Overview,icon:Fo,selected:a===xl.Overview,onClick:()=>{r(xl.Overview),o(xl.Overview)},tooltip:"Overview"},...(n||[]).map(e=>({...e,selected:a===e.id,onClick:()=>{r(e.id),e.onClick()}}))],[a]),c=l(()=>[xl.Overview,xl.InstrumentationRules,xl.Sources,xl.Actions,xl.Destinations].includes(a)?[{id:xl.InstrumentationRules,icon:Ro,selected:a===xl.InstrumentationRules,onClick:()=>{r(xl.InstrumentationRules),o(xl.InstrumentationRules)},tooltip:"Instrumentation Rules"},{id:xl.Sources,icon:Lo,selected:a===xl.Sources,onClick:()=>{r(xl.Sources),o(xl.Sources)},tooltip:"Sources"},{id:xl.Actions,icon:qo,selected:a===xl.Actions,onClick:()=>{r(xl.Actions),o(xl.Actions)},tooltip:"Actions"},{id:xl.Destinations,icon:Po,selected:a===xl.Destinations,onClick:()=>{r(xl.Destinations),o(xl.Destinations)},tooltip:"Destinations"}]:[],[a]);return e.createElement(jt,{orientation:"vertical",mainIcons:s,subIcons:c})},$l=({})=>e.createElement(dt,{onClick:()=>window.open("https://join.slack.com/t/odigos/shared_invite/zt-2wc6gm4j9-EhcVFYrLwHqvcIErO9sVzw","_blank","noopener noreferrer"),tooltip:"Join our Slack community"},e.createElement(Ko,null)),Sl=e=>{const{name:t,kind:o,namespace:i}=e;return[{title:p.NAMESPACE,value:i},{title:p.KIND,value:o},{title:p.NAME,value:t,tooltip:"K8s resource name"},{type:m.Divider},{type:m.CopyText,value:`kubectl get ${o} ${t} -n ${i}`.toLowerCase()}]},kl=d.div`
369
369
  display: flex;
370
370
  flex-direction: column;
371
371
  gap: 24px;
372
372
  padding: 4px;
373
- `,Sl=({formData:t,handleFormChange:o})=>e.createElement($l,null,e.createElement(f,{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}})=>o("otelServiceName",e)})),kl=({source:i,fetchSourceDescribe:a})=>{const[n,l]=t(!1),[r,s]=t(null);return o(()=>{i&&a({variables:{namespace:i.namespace,name:i.name,kind:i.kind}}).then(({data:e})=>{e?.describeSource?s(e.describeSource):l(!0)})},[a,i]),r||n?e.createElement(X,{$gap:12},n?e.createElement(ke,{$height:"70vh"},e.createElement(we,{subTitle:"Could not fetch describe for this source"})):r?.pods?.length?r.pods.map(({podName:t,nodeName:o,phase:a,agentInjected:n,runningLatestWorkloadRevision:l,containers:s})=>{const d=a.status!==B.Success||jt(s)?B.Error:B.Success,u=[];return u.push(e.createElement(Vt,{value:`kubectl get pod ${t.value} -n ${r?.namespace?.value||i.namespace}`.toLowerCase()})),u.push(e.createElement(ne,{length:"100%",margin:"0"})),u.push(e.createElement(Ut,{title:o.name,tooltip:o.explain||"",value:{status:o.status||void 0,text:o.value}})),u.push(e.createElement(ne,{length:"100%",margin:"0"})),u.push(e.createElement(Ut,{title:a.name,tooltip:a.explain||"",value:{status:a.status||void 0,text:a.value}})),u.push(e.createElement(ne,{length:"100%",margin:"0"})),u.push(e.createElement(Ut,{title:n.name,tooltip:n.explain||"",value:{status:n.status||void 0,text:n.value}})),u.push(e.createElement(ne,{length:"100%",margin:"0"})),l?.name&&(u.push(e.createElement(Ut,{title:l.name,tooltip:l.explain||void 0,value:{status:l.status||void 0,text:l.value}})),u.push(e.createElement(ne,{length:"100%",margin:"0"}))),s.forEach(t=>{u.push(e.createElement(_t,{...t}))}),e.createElement(J,{key:`pod-${t.value}`,title:`Pod: ${t.value}`,withExtend:!0,action:()=>e.createElement(re,{status:d,title:d,withIcon:!0,withBorder:!0})},c.toArray(u))}):e.createElement(ke,{$height:"70vh"},e.createElement(we,{subTitle:"Check if you have any running pods and try again"}))):e.createElement(ke,{$height:"70vh"},e.createElement(yt,null))},wl=d(se)`
373
+ `,wl=({formData:t,handleFormChange:o})=>e.createElement(kl,null,e.createElement(x,{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}})=>o("otelServiceName",e)})),Dl=({source:i,fetchSourceDescribe:n})=>{const[a,l]=t(!1),[r,s]=t(null);return o(()=>{i&&n({variables:{namespace:i.namespace,name:i.name,kind:i.kind}}).then(({data:e})=>{e?.describeSource?s(e.describeSource):l(!0)})},[n,i]),r||a?e.createElement(Q,{$gap:12},a?e.createElement(we,{$height:"70vh"},e.createElement(De,{subTitle:"Could not fetch describe for this source"})):r?.pods?.length?r.pods.map(({podName:t,nodeName:o,phase:n,agentInjected:a,runningLatestWorkloadRevision:l,containers:s})=>{const d=n.status!==j.Success||Vt(s)?j.Error:j.Success,u=[];return u.push(e.createElement(Ut,{value:`kubectl get pod ${t.value} -n ${r?.namespace?.value||i.namespace}`.toLowerCase()})),u.push(e.createElement(le,{length:"100%",margin:"0"})),u.push(e.createElement(_t,{title:o.name,tooltip:o.explain||"",value:{status:o.status||void 0,text:o.value}})),u.push(e.createElement(le,{length:"100%",margin:"0"})),u.push(e.createElement(_t,{title:n.name,tooltip:n.explain||"",value:{status:n.status||void 0,text:n.value}})),u.push(e.createElement(le,{length:"100%",margin:"0"})),u.push(e.createElement(_t,{title:a.name,tooltip:a.explain||"",value:{status:a.status||void 0,text:a.value}})),u.push(e.createElement(le,{length:"100%",margin:"0"})),l?.name&&(u.push(e.createElement(_t,{title:l.name,tooltip:l.explain||void 0,value:{status:l.status||void 0,text:l.value}})),u.push(e.createElement(le,{length:"100%",margin:"0"}))),s.forEach(t=>{u.push(e.createElement(Gt,{...t}))}),e.createElement(Y,{key:`pod-${t.value}`,title:`Pod: ${t.value}`,withExtend:!0,action:()=>e.createElement(se,{status:d,title:d,withIcon:!0,withBorder:!0})},c.toArray(u))}):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(vt,null))},Nl=d(ce)`
374
374
  width: 100%;
375
375
  align-items: center;
376
376
  justify-content: space-between;
377
- `,Dl=({source:i,fetchSourceLibraries:a})=>{const n=T.useTheme(),[l,s]=t(!1),[c,d]=t(null);return o(()=>{i&&a({variables:{namespace:i.namespace,name:i.name,kind:i.kind}}).then(({data:e})=>{e?.instrumentationInstanceComponents?d(kt(e.instrumentationInstanceComponents).sort((e,t)=>e.name.localeCompare(t.name))):s(!0)})},[a,i]),c||l?e.createElement(X,{$gap:12},l?e.createElement(ke,{$height:"70vh"},e.createElement(we,{subTitle:"Could not fetch libraries for this source"})):c?.length?e.createElement(J,{title:"Instrumented Libraries"},c.map(({name:t,nonIdentifyingAttributes:o},i)=>e.createElement(r,{key:`library-${t}`},e.createElement(wl,null,e.createElement(N,{size:12,color:n.text.grey},t),e.createElement(se,{$gap:4},o.map(({key:o,value:i})=>Gt(i)&&Jt(i)&&"is_standard_lib"===o?e.createElement(re,{key:`${t}-${o}`,status:B.Default,title:"STANDARD",withBorder:!0}):null))),i!==c.length-1&&e.createElement(ne,{length:"100%",margin:"0"})))):e.createElement(ke,{$height:"70vh",$gap:12},e.createElement(we,{title:"No libraries found",subTitle:""}),e.createElement(oe,{type:B.Warning,message:"This feature is in early development, and has very limited support"}))):e.createElement(ke,{$height:"70vh"},e.createElement(yt,null))};var Nl;!function(e){e.Overview="Overview",e.Pods="Pods",e.Libraries="Libraries"}(Nl||(Nl={}));const Tl=[Qt.Deployment,Qt.StatefulSet,Qt.DaemonSet],Il=[Zt.Python],El=d.div`
377
+ `,Tl=({source:i,fetchSourceLibraries:n})=>{const a=I.useTheme(),[l,s]=t(!1),[c,d]=t(null);return o(()=>{i&&n({variables:{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)})},[n,i]),c||l?e.createElement(Q,{$gap:12},l?e.createElement(we,{$height:"70vh"},e.createElement(De,{subTitle:"Could not fetch libraries for this source"})):c?.length?e.createElement(Y,{title:"Instrumented Libraries"},c.map(({name:t,nonIdentifyingAttributes:o},i)=>e.createElement(r,{key:`library-${t}`},e.createElement(Nl,null,e.createElement(T,{size:12,color:a.text.grey},t),e.createElement(ce,{$gap:4},o.map(({key:o,value:i})=>Jt(i)&&Yt(i)&&"is_standard_lib"===o?e.createElement(se,{key:`${t}-${o}`,status:j.Default,title:"STANDARD",withBorder:!0}):null))),i!==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(ie,{type:j.Warning,message:"This feature is in early development, and has very limited support"}))):e.createElement(we,{$height:"70vh"},e.createElement(vt,null))};var Il;!function(e){e.Overview="Overview",e.Pods="Pods",e.Libraries="Libraries"}(Il||(Il={}));const El=[Zt.Deployment,Zt.StatefulSet,Zt.DaemonSet],Ol=[eo.Python],Ml=d.div`
378
378
  width: 100%;
379
379
  height: 100%;
380
380
  max-height: calc(100vh - 220px);
381
381
  overflow: overlay;
382
382
  overflow-y: auto;
383
- `,Ol=d.div`
383
+ `,Al=d.div`
384
384
  display: flex;
385
385
  flex-direction: column;
386
386
  gap: 12px;
387
- `,Ml=({persistSources:i,updateSource:n,restartWorkloads:r,fetchSourceById:s,fetchSourceDescribe:c,fetchSourceLibraries:d})=>{const{sources:u}=j(),{selectedStreamName:m}=Ke(),{drawerType:h,drawerEntityId:g}=L(),y=l(()=>We(u,m),[u,m]),v=a(null),b=h===W.Source,[f,x]=t(!1),[C,$]=t(!1),[S,k]=t(Nl.Overview),[w,D]=t(null);o(()=>{b&&g&&s(g).then(e=>D(e||null))},[b,g,w]);const{formData:T,handleFormChange:I,resetFormData:E,loadFormWithDrawerItem:O}=Yt(),M=l(()=>{if(!b)return null;const e=(w&&JSON.stringify(Kt(w))===JSON.stringify(Kt(g))?w:null)||y?.find(e=>e.namespace===g.namespace&&e.name===g.name&&e.kind===g.kind);return e&&O(e),e},[b,g,y,w]),A=l(()=>{const e=M?.conditions?.find(({type:e})=>"RuntimeDetection"===e);return{description:e?.message,isLoading:e?.status===ue.Loading,containers:M?.containers||[]}},[M]),F=l(()=>{const e=[{label:Nl.Overview,onClick:()=>k(Nl.Overview),selected:S===Nl.Overview}];return Tl.includes(M?.kind)&&e.push({label:Nl.Pods,onClick:()=>k(Nl.Pods),selected:S===Nl.Pods}),M?.containers?.some(({language:e})=>Il.includes(e))&&e.push({label:Nl.Libraries,onClick:()=>k(Nl.Libraries),selected:S===Nl.Libraries}),e},[S,M]);return M?e.createElement(vi,{ref:v,onClose:()=>{k(Nl.Overview),D(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:Re(M.containers),isEdit:f,isFormDirty:C,onEdit:S===Nl.Overview?e=>{x("boolean"!=typeof e||e)}:void 0,onSave:async()=>{const e=T.otelServiceName!==M.name?T.otelServiceName:"";I("otelServiceName",e),await n(g,{...T,otelServiceName:e}),D(null),$(!1),x(!1)},onDelete:S===Nl.Overview?async()=>{const{namespace:e}=M;i({[e]:[{...M,selected:!1,currentStreamName:m}]},{}),D(null),$(!1),x(!1),E(),v.current?.closeDrawer()}:void 0,onCancel:()=>{$(!1),x(!1),I("otelServiceName",M.otelServiceName||M.name||"")},isLastItem:1===y.length,tabs:F,headerActionButtons:[{"data-id":"rollout-restart",variant:"tertiary",onClick:()=>r([g]),children:e.createElement(e.Fragment,null,e.createElement(Io,null),e.createElement(N,{size:14,family:"secondary",decoration:"underline"},"Restart"))}]},S===Nl.Overview?f?e.createElement(El,null,e.createElement(Sl,{formData:T,handleFormChange:(...e)=>{$(!0),I(...e),I("currentStreamName",m)}})):e.createElement(Ol,null,e.createElement(G,{conditions:M.conditions||[]}),e.createElement(J,{title:p.SOURCE_DETAILS,data:M?Cl(M):[]}),e.createElement(J,{title:p.DETECTED_CONTAINERS,titleBadge:A.isLoading?ue.Loading:A.containers.length,description:A.description||p.DETECTED_CONTAINERS_DESCRIPTION},A.containers.map(t=>e.createElement(Xt,{key:`source-container-${t.containerName}`,...t,callbackRuntimeOverride:async e=>await n(g,e)})))):S===Nl.Pods?e.createElement(kl,{source:M,fetchSourceDescribe:c}):e.createElement(Dl,{source:M,fetchSourceLibraries:d})):null},Al=d.div`
387
+ `,Fl=({persistSources:i,updateSource:a,restartWorkloads:r,fetchSourceById:s,fetchSourceDescribe:c,fetchSourceLibraries:d})=>{const{sources:u}=V(),{selectedStreamName:m}=He(),{drawerType:h,drawerEntityId:g}=q(),y=l(()=>Be(u,m),[u,m]),v=n(null),b=h===B.Source,[f,x]=t(!1),[C,$]=t(!1),[S,k]=t(Il.Overview),[w,D]=t(null);o(()=>{b&&g&&s(g).then(e=>D(e||null))},[b,g,w]);const{formData:N,handleFormChange:I,resetFormData:E,loadFormWithDrawerItem:O}=Xt(),M=l(()=>{if(!b)return null;const e=(w&&JSON.stringify(Ht(w))===JSON.stringify(Ht(g))?w:null)||y?.find(e=>e.namespace===g.namespace&&e.name===g.name&&e.kind===g.kind);return e&&O(e),e},[b,g,y,w]),A=l(()=>{const e=M?.conditions?.find(({type:e})=>"RuntimeDetection"===e);return{description:e?.message,isLoading:e?.status===pe.Loading,containers:M?.containers||[]}},[M]),F=l(()=>{const e=[{label:Il.Overview,onClick:()=>k(Il.Overview),selected:S===Il.Overview}];return El.includes(M?.kind)&&e.push({label:Il.Pods,onClick:()=>k(Il.Pods),selected:S===Il.Pods}),M?.containers?.some(({language:e})=>Ol.includes(e))&&e.push({label:Il.Libraries,onClick:()=>k(Il.Libraries),selected:S===Il.Libraries}),e},[S,M]);return M?e.createElement(fi,{ref:v,onClose:()=>{k(Il.Overview),D(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:Le(M.containers),isEdit:f,isFormDirty:C,onEdit:S===Il.Overview?e=>{x("boolean"!=typeof e||e)}:void 0,onSave:async()=>{const e=N.otelServiceName!==M.name?N.otelServiceName:"";I("otelServiceName",e),await a(g,{...N,otelServiceName:e}),D(null),$(!1),x(!1)},onDelete:S===Il.Overview?async()=>{const{namespace:e}=M;i({[e]:[{...M,selected:!1,currentStreamName:m}]},{}),D(null),$(!1),x(!1),E(),v.current?.closeDrawer()}:void 0,onCancel:()=>{$(!1),x(!1),I("otelServiceName",M.otelServiceName||M.name||"")},isLastItem:1===y.length,tabs:F,headerActionButtons:[{"data-id":"rollout-restart",variant:"tertiary",onClick:()=>r([g]),children:e.createElement(e.Fragment,null,e.createElement(Eo,null),e.createElement(T,{size:14,family:"secondary",decoration:"underline"},"Restart"))}]},S===Il.Overview?f?e.createElement(Ml,null,e.createElement(wl,{formData:N,handleFormChange:(...e)=>{$(!0),I(...e),I("currentStreamName",m)}})):e.createElement(Al,null,e.createElement(J,{conditions:M.conditions||[]}),e.createElement(Y,{title:p.SOURCE_DETAILS,data:M?Sl(M):[]}),e.createElement(Y,{title:p.DETECTED_CONTAINERS,titleBadge:A.isLoading?pe.Loading:A.containers.length,description:A.description||p.DETECTED_CONTAINERS_DESCRIPTION},A.containers.map(t=>e.createElement(Qt,{key:`source-container-${t.containerName}`,...t,callbackRuntimeOverride:async e=>await a(g,e)})))):S===Il.Pods?e.createElement(Dl,{source:M,fetchSourceDescribe:c}):e.createElement(Tl,{source:M,fetchSourceLibraries:d})):null},Rl=d.div`
388
388
  max-width: 420px;
389
389
  width: 100%;
390
- `,Fl=i(({isModal:t,fetchSingleNamespace:o,onClickSummary:i},a)=>{const l=T.useTheme(),r=eo({fetchSingleNamespace:o}),{availableSources:s,selectedSources:c,isFetchingEachNamespace:d,selectedAllNamespaces:u,onSelectAllNamespaces:m,getApiSourcesPayload:h,getApiFutureAppsPayload:g,searchText:y,setSearchText:v,searchBy:b,setSearchBy:x,showSelectedOnly:C,setShowSelectedOnly:$,showRunningOnly:k,setShowRunningOnly:w}=r;n(a,()=>({getFormValues:()=>({initial:s,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(pt,{onClick:i}),e.createElement(E,{title:p.SELECT_SOURCES,badgeLabel:D,description:p.SELECT_SOURCES_DESCRIPTION}),e.createElement(se,{$justifyContent:"space-between"},e.createElement(Al,null,e.createElement(f,{placeholder:b===W.Source?p.SEARCH_SOURCES:p.SEARCH_NAMESPACES,icon:$o,value:y,onChange:e=>v(e.target.value.toLowerCase())})),e.createElement(I,{options:[{label:p.SOURCE,value:W.Source,selectedBgColor:l.text.secondary,selectedTextColor:l.text.primary},{label:p.NAMESPACE,value:W.Namespace,selectedBgColor:l.text.secondary,selectedTextColor:l.text.primary}],selected:b,setSelected:x})),e.createElement(se,{$gap:36},e.createElement(S,{title:p.SELECT_ALL,initialValue:u,onChange:m,disabled:d}),e.createElement(S,{title:p.ONLY_SELECTED,initialValue:C,onChange:$}),e.createElement(S,{title:p.ONLY_RUNNING_INSTANCES,initialValue:k,onChange:w}))),e.createElement(ne,null),e.createElement(hl,{isModal:t,...r})))});Fl.displayName=Fl.name;const Rl=({fetchSingleNamespace:t,persistSources:o})=>{const{currentModal:i,setCurrentModal:n}=Q(),l=i===W.Source,r=()=>{n("")},s=async()=>{if(c.current){const{apps:e,futureApps:t}=c.current.getFormValues();o(e,t),r()}},c=a(null);return P({key:"Enter",active:l},s),l?e.createElement(Z,{isOpen:l,onClose:r,header:{title:"Add Source"},actionComponent:e.createElement(ee,{buttons:[{label:"DONE",variant:"primary",onClick:s}]})},e.createElement(Fl,{ref:c,isModal:!0,fetchSingleNamespace:t})):null},Ll=[{key:"checkbox-and-icon",title:""},{key:"name",title:p.NAME,sortable:!0},{key:"type",title:"Kubernetes Type",sortable:!0},{key:"namespace",title:p.NAMESPACE,sortable:!0},{key:"containers",title:p.DETECTED_CONTAINERS},{key:"conditions",title:"Conditions"},{key:"throughput",title:"Throughput",sortable:!0}],Pl=({metrics:t,maxHeight:o,maxWidth:i})=>{const a=T.useTheme(),n=me(),{isThisPending:r}=F(),{selectedStreamName:c}=Ke(),{sources:d,sourcesLoading:u}=j(),{setDrawerType:m,setDrawerEntityId:h}=L(),{selectedSources:g,setSelectedSources:v}=qt(),{isAwaitingInstrumentation:b,sourcesToCreate:f,sourcesCreated:x,sourcesToDelete:C,sourcesDeleted:$}=He(),S=l(()=>{const e=(e,t)=>e>0&&Math.floor(100/e*t)||1;return f?e(f,x):C?e(C,$):1},[f,x,C,$]),k=l(()=>We(d,c),[d,c]),w=l(()=>Ni({instrumentationRules:[],sources:Be(k,n),actions:[],destinations:[],searchText:n.searchText,selectedCategory:W.Source}).searchResults.find(({category:e})=>e===W.Source)?.entities||[],[k,n]),[D,I]=l(()=>{let e=0;return Object.values(g).forEach(t=>{e+=t.length}),[0!==e,e]},[g]),E=s(e=>{if(e){const e={};w.forEach(t=>{const o={namespace:t.namespace,name:t.name,kind:t.kind};r({entityType:W.Source,entityId:o})||(e[t.namespace]?e[t.namespace].push(t):e[t.namespace]=[t])}),v(e)}else v({})},[w]),O=s(e=>{const{namespace:t,name:o,kind:i}=e,a={...g};a[t]||(a[t]=[]);const n=a[t].findIndex(e=>e.name===o&&e.kind===i);-1===n?a[t].push(e):a[t].splice(n,1),v(a)},[g]),M=l(()=>w.map(o=>{const i=Kt(o),n=JSON.stringify(i),{hasErrors:l,hasWarnings:s,hasDisableds:c}=le(o.conditions||[]),d=r({entityType:W.Source,entityId:i}),u=!!g[i.namespace]?.find(e=>e.namespace===i.namespace&&e.name===i.name&&e.kind===i.kind);return{status:l?B.Error:s?B.Warning:void 0,faded:c,onClick:()=>{m(W.Source),h(i)},cells:[{columnKey:"checkbox-and-icon",component:()=>e.createElement(se,{$gap:16},e.createElement(y,{disabled:d,value:u,onChange:()=>O(o)}),e.createElement(to,{icons:Re(o.containers),id:n}))},{columnKey:"name",value:ye(o,W.Source,{extended:!0})},{columnKey:"type",value:o.kind,textColor:a.text.info},{columnKey:"namespace",value:o.namespace,textColor:a.text.info},{columnKey:"throughput",value:Ee(Nt(t,W.Source,i).throughput),textColor:a.text.info},{columnKey:"conditions",component:()=>e.createElement(wi,{conditions:o.conditions||[],id:n})},{columnKey:"containers",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(re,{status:B.Info,title:oo(o.containers),withBorder:!0}))}]}}),[w,g,t,O]),{badge:A,badgeTooltip:R}=l(()=>w.length!==k.length?{badge:`${w.length}/${k.length}`,badgeTooltip:p.FILTERED_COUNT_TOOLTIP}:{badge:k.length,badgeTooltip:void 0},[w,k]);return e.createElement(be,{$maxWidth:i},e.createElement(fe,null,e.createElement(y,{partiallyChecked:D&&w?.length!==I,value:D&&w?.length===I,onChange:E,disabled:!w?.length}),e.createElement(xe,{icon:Ce(W.Source),title:p.SOURCES,badge:A,badgeTooltip:R,loading:u||b})),e.createElement($e,{$maxHeight:o},e.createElement(Se,{columns:Ll,rows:M})),b&&!M.length?e.createElement(ke,{style:{marginTop:"2rem",gap:"24px"}},e.createElement(De,{width:420}),e.createElement(se,{$gap:16},e.createElement(N,{color:a.text.info},f?"Instrumenting":"Uninstrumenting"," workloads..."),e.createElement(Ne,{label:`${S}%`}))):M.length?null:e.createElement(ke,{style:{marginTop:"2rem"}},e.createElement(we,null)))},ql=({expiresAt:t})=>{const o=T.useTheme(),i=Ht().format(t),a=new Date(t).toDateString().split(" ").slice(1).join(" "),n=io(t,0)?o.text.error:io(t,6048e5)?o.text.warning:o.text.success;return e.createElement(N,{size:14,color:n},i," (",a,")")},Kl=d.div`
390
+ `,Ll=i(({isModal:t,fetchSingleNamespace:o,onClickSummary:i},n)=>{const l=I.useTheme(),r=to({fetchSingleNamespace:o}),{availableSources:s,selectedSources:c,isFetchingEachNamespace:d,selectedAllNamespaces:u,onSelectAllNamespaces:m,getApiSourcesPayload:h,getApiFutureAppsPayload:g,searchText:y,setSearchText:v,searchBy:b,setSearchBy:f,showSelectedOnly:C,setShowSelectedOnly:$,showRunningOnly:S,setShowRunningOnly:w}=r;a(n,()=>({getFormValues:()=>({initial:s,apps:h(),futureApps:g()})}));const D=Object.values(c).reduce((e,t)=>e+t.filter(e=>e.selected).length,0);return e.createElement(oe,{$isNotModal:!t},e.createElement(Q,{$gap:12},e.createElement(Q,{$gap:24},i&&e.createElement(mt,{onClick:i}),e.createElement(O,{title:p.SELECT_SOURCES,badgeLabel:D,description:p.SELECT_SOURCES_DESCRIPTION}),e.createElement(ce,{$justifyContent:"space-between"},e.createElement(Rl,null,e.createElement(x,{placeholder:b===B.Source?p.SEARCH_SOURCES:p.SEARCH_NAMESPACES,icon:So,value:y,onChange:e=>v(e.target.value.toLowerCase())})),e.createElement(E,{options:[{label:p.SOURCE,value:B.Source,selectedBgColor:l.text.secondary,selectedTextColor:l.text.primary},{label:p.NAMESPACE,value:B.Namespace,selectedBgColor:l.text.secondary,selectedTextColor:l.text.primary}],selected:b,setSelected:f})),e.createElement(ce,{$gap:36},e.createElement(k,{title:p.SELECT_ALL,initialValue:u,onChange:m,disabled:d}),e.createElement(k,{title:p.ONLY_SELECTED,initialValue:C,onChange:$}),e.createElement(k,{title:p.ONLY_RUNNING_INSTANCES,initialValue:S,onChange:w}))),e.createElement(le,null),e.createElement(yl,{isModal:t,...r})))});Ll.displayName=Ll.name;const ql=({fetchSingleNamespace:t,persistSources:o})=>{const{currentModal:i,setCurrentModal:a}=Z(),l=i===B.Source,r=()=>{a("")},s=async()=>{if(c.current){const{apps:e,futureApps:t}=c.current.getFormValues();o(e,t),r()}},c=n(null);return P({key:"Enter",active:l},s),l?e.createElement(ee,{isOpen:l,onClose:r,header:{title:"Add Source"},actionComponent:e.createElement(te,{buttons:[{label:"DONE",variant:"primary",onClick:s}]})},e.createElement(Ll,{ref:c,isModal:!0,fetchSingleNamespace:t})):null},Pl=[{key:"checkbox-and-icon",title:""},{key:"name",title:p.NAME,sortable:!0},{key:"type",title:"Kubernetes Type",sortable:!0},{key:"namespace",title:p.NAMESPACE,sortable:!0},{key:"containers",title:p.DETECTED_CONTAINERS},{key:"conditions",title:"Conditions"},{key:"throughput",title:"Throughput",sortable:!0}],Kl=({metrics:t,maxHeight:o,maxWidth:i})=>{const n=I.useTheme(),a=he(),{isThisPending:r}=R(),{selectedStreamName:c}=He(),{sources:d,sourcesLoading:u}=V(),{setDrawerType:m,setDrawerEntityId:h}=q(),{selectedSources:g,setSelectedSources:y}=Kt(),{isAwaitingInstrumentation:b,sourcesToCreate:f,sourcesCreated:x,sourcesToDelete:C,sourcesDeleted:$}=ze(),S=l(()=>{const e=(e,t)=>e>0&&Math.floor(100/e*t)||1;return f?e(f,x):C?e(C,$):1},[f,x,C,$]),k=l(()=>Be(d,c),[d,c]),w=l(()=>Ii({instrumentationRules:[],sources:je(k,a),actions:[],destinations:[],searchText:a.searchText,selectedCategory:B.Source}).searchResults.find(({category:e})=>e===B.Source)?.entities||[],[k,a]),[D,N]=l(()=>{let e=0;return Object.values(g).forEach(t=>{e+=t.length}),[0!==e,e]},[g]),E=s(e=>{if(e){const e={};w.forEach(t=>{const o={namespace:t.namespace,name:t.name,kind:t.kind};r({entityType:B.Source,entityId:o})||(e[t.namespace]?e[t.namespace].push(t):e[t.namespace]=[t])}),y(e)}else y({})},[w]),O=s(e=>{const{namespace:t,name:o,kind:i}=e,n={...g};n[t]||(n[t]=[]);const a=n[t].findIndex(e=>e.name===o&&e.kind===i);-1===a?n[t].push(e):n[t].splice(a,1),y(n)},[g]),M=l(()=>w.map(o=>{const i=Ht(o),a=JSON.stringify(i),{hasErrors:l,hasWarnings:s,hasDisableds:c}=re(o.conditions||[]),d=r({entityType:B.Source,entityId:i}),u=!!g[i.namespace]?.find(e=>e.namespace===i.namespace&&e.name===i.name&&e.kind===i.kind);return{status:l?j.Error:s?j.Warning:void 0,faded:c,onClick:()=>{m(B.Source),h(i)},cells:[{columnKey:"checkbox-and-icon",component:()=>e.createElement(ce,{$gap:16},e.createElement(v,{disabled:d,value:u,onChange:()=>O(o)}),e.createElement(oo,{icons:Le(o.containers),id:a}))},{columnKey:"name",value:ve(o,B.Source,{extended:!0})},{columnKey:"type",value:o.kind,textColor:n.text.info},{columnKey:"namespace",value:o.namespace,textColor:n.text.info},{columnKey:"throughput",value:Oe(Tt(t,B.Source,i).throughput),textColor:n.text.info},{columnKey:"conditions",component:()=>e.createElement(Ni,{conditions:o.conditions||[],id:a})},{columnKey:"containers",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:j.Info,title:io(o.containers),withBorder:!0}))}]}}),[w,g,t,O]),{badge:A,badgeTooltip:F}=l(()=>w.length!==k.length?{badge:`${w.length}/${k.length}`,badgeTooltip:p.FILTERED_COUNT_TOOLTIP}:{badge:k.length,badgeTooltip:void 0},[w,k]);return e.createElement(fe,{$maxWidth:i},e.createElement(xe,null,e.createElement(v,{partiallyChecked:D&&w?.length!==N,value:D&&w?.length===N,onChange:E,disabled:!w?.length}),e.createElement(Ce,{icon:$e(B.Source),title:p.SOURCES,badge:A,badgeTooltip:F,loading:u||b})),e.createElement(Se,{$maxHeight:o},e.createElement(ke,{columns:Pl,rows:M})),b&&!M.length?e.createElement(we,{style:{marginTop:"2rem",gap:"24px"}},e.createElement(Ne,{width:420}),e.createElement(ce,{$gap:16},e.createElement(T,{color:n.text.info},f?"Instrumenting":"Uninstrumenting"," workloads..."),e.createElement(Te,{label:`${S}%`}))):M.length?null:e.createElement(we,{style:{marginTop:"2rem"}},e.createElement(De,null)))},Hl=({expiresAt:t})=>{const o=I.useTheme(),i=zt().format(t),n=new Date(t).toDateString().split(" ").slice(1).join(" "),a=no(t,0)?o.text.error:no(t,6048e5)?o.text.warning:o.text.success;return e.createElement(T,{size:14,color:a},i," (",n,")")},zl=d.div`
391
391
  position: relative;
392
- `,Hl=({token:o,saveToken:i})=>{const a=T.useTheme(),{isCopied:n,clickCopy:l}=ao(),{formData:r,handleFormChange:s,resetFormData:c}=no({token:o}),[d,u]=t(!1),p=()=>{u(!1),c()},m=pe(B.Success,a);return e.createElement(se,{$gap:0},e.createElement(ct,{size:32,onClick:()=>l(o)},n?e.createElement(m,null):e.createElement(Ko,null)),e.createElement(ne,{orientation:"vertical",length:"12px"}),e.createElement(Kl,null,e.createElement(ct,{size:32,onClick:()=>{u(!0)}},e.createElement(fo,null)),d&&e.createElement(lo,{flipX:!0,clientX:36,isOpen:d,onClose:p,onSave:()=>{i(r.token).then(p)},title:"Enter a new API Token",titleTooltip:"Contact us to generate a new one"},e.createElement(f,{placeholder:"API Token",type:"password",value:r.token,onChange:e=>s("token",e.target.value)}))))},zl=({tokens:t,saveToken:o})=>e.createElement(J,{title:"Authorization Tokens",titleBadge:t.length,data:[{type:m.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:a})=>({cells:[{columnKey:"icon",icon:Ho},{columnKey:"name",value:t},{columnKey:"token",value:`${new Array(15).fill("•").join("")}`},{columnKey:"expires_at",component:()=>e.createElement(ql,{expiresAt:a})},{columnKey:"actions",component:()=>e.createElement(Hl,{token:i,saveToken:o})}]}))}}]}),Wl=({fetchDescribeOdigos:i})=>{const[a,n]=t(null);if(o(()=>{i().then(({data:e})=>{n(e?.describeOdigos||null)})},[i]),!a)return e.createElement(ke,null,e.createElement(yt,null));const l=t=>t?.name?[e.createElement(ne,{key:`divider-${t.name}`}),e.createElement(Ut,{key:`describe-row-${t.name}`,title:t.name,subTitle:t.explain||void 0,value:{status:t.status||(Gt(t.value)?Jt(t.value)?B.Success:B.Error:B.Default),text:t.value}})]:[];return e.createElement(e.Fragment,null,e.createElement(J,{title:"General Information",withExtend:!0,initialExtended:!0,data:[{title:a?.odigosVersion?.name,value:a?.odigosVersion?.value},{title:a?.kubernetesVersion?.name,value:a?.kubernetesVersion?.value},{title:a?.installationMethod?.name,value:a?.installationMethod?.value},{title:a?.tier?.name,value:a?.tier?.value},{title:"# of sources",value:a?.numberOfSources?.toString()},{title:"# of destinations",value:a?.numberOfDestinations?.toString()}]}),e.createElement(J,{title:"Cluster Collector",withExtend:!0},Object.values(a?.clusterCollector||{}).map(l)),e.createElement(J,{title:"Node Collector",withExtend:!0},Object.values(a?.nodeCollector||{}).map(l)))},Bl=d.div`
392
+ `,Wl=({token:o,saveToken:i})=>{const n=I.useTheme(),{isCopied:a,clickCopy:l}=ao(),{formData:r,handleFormChange:s,resetFormData:c}=lo({token:o}),[d,u]=t(!1),p=()=>{u(!1),c()},m=me(j.Success,n);return e.createElement(ce,{$gap:0},e.createElement(dt,{size:32,onClick:()=>l(o)},a?e.createElement(m,null):e.createElement(Ho,null)),e.createElement(le,{orientation:"vertical",length:"12px"}),e.createElement(zl,null,e.createElement(dt,{size:32,onClick:()=>{u(!0)}},e.createElement(xo,null)),d&&e.createElement(ro,{flipX:!0,clientX:36,isOpen:d,onClose:p,onSave:()=>{i(r.token).then(p)},title:"Enter a new API Token",titleTooltip:"Contact us to generate a new one"},e.createElement(x,{placeholder:"API Token",type:"password",value:r.token,onChange:e=>s("token",e.target.value)}))))},Bl=({tokens:t,saveToken:o})=>e.createElement(Y,{title:"Authorization Tokens",titleBadge:t.length,data:[{type:m.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:zo},{columnKey:"name",value:t},{columnKey:"token",value:`${new Array(15).fill("•").join("")}`},{columnKey:"expires_at",component:()=>e.createElement(Hl,{expiresAt:n})},{columnKey:"actions",component:()=>e.createElement(Wl,{token:i,saveToken:o})}]}))}}]}),jl=({fetchDescribeOdigos:i})=>{const[n,a]=t(null);if(o(()=>{i().then(({data:e})=>{a(e?.describeOdigos||null)})},[i]),!n)return e.createElement(we,null,e.createElement(vt,null));const l=t=>t?.name?[e.createElement(le,{key:`divider-${t.name}`}),e.createElement(_t,{key:`describe-row-${t.name}`,title:t.name,subTitle:t.explain||void 0,value:{status:t.status||(Jt(t.value)?Yt(t.value)?j.Success:j.Error:j.Default),text:t.value}})]:[];return e.createElement(e.Fragment,null,e.createElement(Y,{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(Y,{title:"Cluster Collector",withExtend:!0},Object.values(n?.clusterCollector||{}).map(l)),e.createElement(Y,{title:"Node Collector",withExtend:!0},Object.values(n?.nodeCollector||{}).map(l)))},Vl=d.div`
393
393
  display: flex;
394
394
  flex-direction: column;
395
395
  gap: 12px;
396
- `,jl="System Overview",Vl=({tokens:o,saveToken:i,fetchDescribeOdigos:a})=>{const[n,l]=t(!1),r=()=>l(e=>!e);return e.createElement(e.Fragment,null,e.createElement(ct,{key:jl,onClick:r,tooltip:jl},e.createElement(zo,{size:18})),e.createElement(K,{width:"750px",isOpen:n,onClose:r,header:{icons:[zo],title:jl},footer:{isOpen:!1}},e.createElement(Bl,null,!!o?.length&&e.createElement(zl,{tokens:o,saveToken:i}),e.createElement(Wl,{fetchDescribeOdigos:a}))))};var Ul;!function(e){e.General="General",e.Ui="UI",e.Rollback="Rollback",e.CollectorNode="Collector Node",e.CollectorGateway="Collector Gateway"}(Ul||(Ul={}));const _l=d.div`
396
+ `,Ul="System Overview",_l=({tokens:o,saveToken:i,fetchDescribeOdigos:n})=>{const[a,l]=t(!1),r=()=>l(e=>!e);return e.createElement(e.Fragment,null,e.createElement(dt,{key:Ul,onClick:r,tooltip:Ul},e.createElement(Wo,{size:18})),e.createElement(H,{width:"750px",isOpen:a,onClose:r,header:{icons:[Wo],title:Ul},footer:{isOpen:!1}},e.createElement(Vl,null,!!o?.length&&e.createElement(Bl,{tokens:o,saveToken:i}),e.createElement(jl,{fetchDescribeOdigos:n}))))};var Gl;!function(e){e.General="General",e.Ui="UI",e.Rollback="Rollback",e.CollectorNode="Collector Node",e.CollectorGateway="Collector Gateway"}(Gl||(Gl={}));const Jl=d.div`
397
397
  align-self: stretch;
398
398
  display: flex;
399
399
  flex-direction: column;
@@ -401,26 +401,26 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
401
401
  gap: 16px;
402
402
  padding: 16px;
403
403
  border-radius: 24px;
404
- background: ${({theme:e})=>e.colors.secondary+T.opacity.hex["004"]};
405
- `,Gl=d(N)`
404
+ background: ${({theme:e})=>e.colors.secondary+I.opacity.hex["004"]};
405
+ `,Yl=d(T)`
406
406
  color: ${({theme:e})=>e.text.secondary};
407
407
  font-size: 18px;
408
408
  font-weight: 600;
409
409
  line-height: 20px;
410
- `,Jl=d(se)`
410
+ `,Xl=d(ce)`
411
411
  width: 100%;
412
412
  gap: 12px;
413
413
  align-items: flex-start;
414
414
  justify-content: space-between;
415
- `,Yl=i(({isAdvanced:t,formData:o,handleFormChange:i},a)=>e.createElement(_l,{ref:a,id:Ul.Ui},e.createElement(Jl,null,e.createElement(Gl,null,"UI")),e.createElement(f,{title:"Central Backend URL",tooltip:'When running the Centralized UI, you need to specify the URL of the central backend. <a href="https://docs.odigos.io/features/central">Learn more</a>.',required:!0,value:o.centralBackendURL||"",onChange:e=>{const{value:t}=e.target;i("centralBackendURL",t||null)}}),e.createElement(f,{title:"OIDC Tenant URL",tooltip:'If you need to restrict access to the Community UI, you can setup an OIDC provider. To do so you need to specify the URL of the OIDC tenant. <a href="https://docs.odigos.io/features/oidc">Learn more</a>.',required:!0,value:o.oidc?.tenantUrl||"",onChange:e=>{const{value:t}=e.target;i("oidc.tenantUrl",t||null)}}),e.createElement(f,{title:"OIDC Client ID",tooltip:'If you need to restrict access to the Community UI, you can setup an OIDC provider. To do so you need to specify the Client ID of the OIDC application. <a href="https://docs.odigos.io/features/oidc">Learn more</a>.',required:!0,value:o.oidc?.clientId||"",onChange:e=>{const{value:t}=e.target;i("oidc.clientId",t||null)}}),e.createElement(f,{title:"OIDC Client Secret",tooltip:'If you need to restrict access to the Community UI, you can setup an OIDC provider. To do so you need to specify the Client Secret of the OIDC application. <a href="https://docs.odigos.io/features/oidc">Learn more</a>.',type:"password",required:!0,value:o.oidc?.clientSecret||"",onChange:e=>{const{value:t}=e.target;i("oidc.clientSecret",t||null)}}),t&&e.createElement(f,{status:B.Warning,title:"(Advanced) UI Pagination Limit",tooltip:"The pagination limit for fetching data from the UI backend. A larger limit means more data will be fetched at once, reducing the number of requests to the backend. This might increase or decrease the performance of the UI - depending on your environment.",type:"number",required:!0,value:o.uiPaginationLimit?.toString()||"",onChange:e=>{const{value:t}=e.target;i("uiPaginationLimit",""===t?null:Number(t))}})));Yl.displayName=Yl.name;const Xl=[{id:ro.VirtualDevice,value:"Virtual Device"},{id:ro.HostPath,value:"Host Path"},{id:ro.InitContainer,value:"Init Container"}],Ql=[{id:so.Loader,value:"Loader"},{id:so.PodManifest,value:"Pod Manifest"},{id:so.LoaderFallbackToPodManifest,value:"Loader Fallback to Pod Manifest"}],Zl=[{id:co.CodeAttributes,value:"Code Attributes"},{id:co.FullPayloadCollection,value:"Full Payload Collection"},{id:co.DbPayloadCollection,value:"DB Payload Collection"},{id:co.QueryOperationDetector,value:"Query Operation Detector"},{id:co.AllowConcurrentAgents,value:"Allow Concurrent Agents"},{id:co.JavaEbpfInstrumentations,value:"Java EBPF Instrumentations"},{id:co.JavaNativeInstrumentations,value:"Java Native Instrumentations"},{id:co.SizeS,value:"Size S"},{id:co.SizeM,value:"Size M"},{id:co.SizeL,value:"Size L"}],er=i(({isAdvanced:t,formData:o,handleFormChange:i},a)=>e.createElement(_l,{ref:a,id:Ul.General},e.createElement(Jl,null,e.createElement(Gl,null,"General")),e.createElement(f,{title:"Cluster Name",tooltip:'Name of the cluster, this is optional, but required in the Centralized UI. <a href="https://docs.odigos.io/features/central">Learn more</a>.',required:!0,value:o.clusterName||"",onChange:e=>{const{value:t}=e.target;i("clusterName",t||null)}}),e.createElement(S,{title:"Enable the Karpenter Integration",tooltip:'<a href="https://docs.odigos.io/setup/odigos-with-karpenter">Learn how to configure Karpenter</a>. Once the Karpenter tainting setup is complete, inform Odigos to disable node affinity and rely on the taint mechanism.',initialValue:o.karpenterEnabled||!1,onChange:e=>i("karpenterEnabled",e)}),e.createElement(S,{title:"Allow Odigos Alongisde Other Agents",tooltip:"By default Odigos does not instrument applications that are already instrumented by other agents. If you want to allow Odigos to instrument applications that are already instrumented by other agents, enable this option. Note: this is not recommended and should be used only if you know what you are doing.",initialValue:o.allowConcurrentAgents||!1,onChange:e=>i("allowConcurrentAgents",e)}),e.createElement(S,{title:"Disable Automatic Rollout",tooltip:"By default, Odigos automatically rolls out the pods after the instrumentation is complete. If you want to disable rollouts and do it manually, toggle this option.",initialValue:o.rollout?.automaticRolloutDisabled||!1,onChange:e=>i("rollout.automaticRolloutDisabled",e)}),e.createElement(f,{title:"Image Prefix",tooltip:"Docker image prefix for all Odigos components. This is disabled because this setting requires a CLI update.",disabled:!0,required:!0,value:o.imagePrefix||"",onChange:e=>{const{value:t}=e.target;i("imagePrefix",t||null)}}),e.createElement(k,{title:"Node Selector",tooltip:"NodeSelector is a map of key-value Kubernetes NodeSelector labels to apply to all Odigos components. Note that Odigos will only be able to instrument applications on the same node. This setting can be applied only via the CLI.",disabled:!0,required:!0,value:Object.entries(o.nodeSelector||{}).map(([e,t])=>({key:e,value:t}))}),e.createElement(tt,{title:"Profiles",tooltip:"Enable custom profiles to customize the Odigos instrumentation.",isMulti:!0,options:Zl,value:Zl.filter(e=>o.profiles?.includes(e.id)),onSelect:e=>i("profiles",[...o.profiles||[],e.id]),onDeselect:e=>i("profiles",o.profiles?.filter(t=>t!==e.id)||[])}),e.createElement(Jl,null,e.createElement(w,{title:"Ignored Namespaces",tooltip:"List of namespaces to exclude from instrumentation. Note: you cannot remove the default namespaces from the list, but you are able to add more namespaces.",required:!0,value:o.ignoredNamespaces||[],onChange:e=>i("ignoredNamespaces",e)}),e.createElement(w,{title:"Ignored Containers",tooltip:"List of container names to exclude from instrumentation, this is a global setting and will be applied to all applications",required:!0,value:o.ignoredContainers||[],onChange:e=>i("ignoredContainers",e)})),t&&e.createElement(e.Fragment,null,e.createElement(tt,{status:B.Warning,title:"(Advanced) Mount Method",tooltip:'For Odigos agents to run inside instrumented pod containers, certain files must be mounted into the container. In Kubernetes, these files are mounted under `/var/odigos` directory, with subdirectories for each agent. <a href="https://docs.odigos.io/instrumentations/configuration/mount-method#agent-mount-method">Learn more</a>.',options:Xl,required:!0,value:Xl.find(e=>e.id===o.mountMethod)||void 0,onSelect:e=>i("mountMethod",e.id)}),e.createElement(tt,{status:B.Warning,title:"(Advanced) Agent Envs Injection Method",tooltip:"In order for Odigos to instrument applications, it needs to inject environment variables into the application. This setting controls how Odigos injects these environment variables.",options:Ql,required:!0,value:Ql.find(e=>e.id===o.agentEnvVarsInjectionMethod)||void 0,onSelect:e=>i("agentEnvVarsInjectionMethod",e.id)}),e.createElement(f,{status:B.Warning,title:"(Advanced) Odiglet Health Probe Port",tooltip:"If the Odiglet is running with a host network, it may conflict with the port of other processes. This setting allows you to specify a different port for the health probe.",type:"number",required:!0,value:o.odigletHealthProbeBindPort?.toString()||"",onChange:e=>{const{value:t}=e.target;i("odigletHealthProbeBindPort",""===t?null:Number(t))}}),e.createElement(f,{status:B.Warning,title:"(Advanced) Custom Container Runtime Socket Path",tooltip:"If containerd is located in a different path than the default supported path by Odigos, then you can specify the socket path here.",required:!0,value:o.customContainerRuntimeSocketPath||"",onChange:e=>{const{value:t}=e.target;i("customContainerRuntimeSocketPath",t||null)}}))));er.displayName=er.name;const tr=i(({formData:t,handleFormChange:o},i)=>e.createElement(_l,{ref:i,id:Ul.Rollback},e.createElement(Gl,null,"Rollback"),e.createElement(S,{title:"Rollback Disabled",tooltip:"Disable rollback",initialValue:t.rollbackDisabled||!1,onChange:e=>o("rollbackDisabled",e)}),e.createElement(Jl,null,e.createElement(f,{title:"Rollback Grace Time",tooltip:"This is the amount of time that a pod should be in the `CrashLoopBackoff` state before it is rolled back. Pods that are in the `CrashLoopBackoff` state for longer than this time will be rolled back.",required:!0,value:t.rollbackGraceTime||"",onChange:e=>{const{value:t}=e.target;o("rollbackGraceTime",t||null)}}),e.createElement(f,{title:"Rollback Stability Window",tooltip:"This is the time-window in which the pod should be in the `CrashLoopBackoff` state before it is rolled back. Pods that are in the `CrashLoopBackoff` state after this window will not be rolled back.",required:!0,value:t.rollbackStabilityWindow||"",onChange:e=>{const{value:t}=e.target;o("rollbackStabilityWindow",t||null)}}))));tr.displayName=tr.name;const or=i(({isAdvanced:t,formData:o,handleFormChange:i},a)=>e.createElement(_l,{ref:a,id:Ul.CollectorNode},e.createElement(Jl,null,e.createElement(Gl,null,"Collector Node")),e.createElement(Jl,null,e.createElement(f,{title:"Request Memory",tooltip:"You can optionally specify how much memory the collector node should request (in megabytes).",type:"number",required:!0,value:o.collectorNode?.requestMemoryMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.requestMemoryMiB",""===t?null:Number(t))}}),e.createElement(f,{title:"Limit Memory",tooltip:"You can optionally specify how much memory the collector node should limit (in megabytes).",type:"number",required:!0,value:o.collectorNode?.limitMemoryMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.limitMemoryMiB",""===t?null:Number(t))}})),e.createElement(Jl,null,e.createElement(f,{title:"Request CPU",tooltip:"You can optionally specify how much CPU the collector node should request (in millicores).",type:"number",required:!0,value:o.collectorNode?.requestCPUm?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.requestCPUm",""===t?null:Number(t))}}),e.createElement(f,{title:"Limit CPU",tooltip:"You can optionally specify how much CPU the collector node should limit (in millicores).",type:"number",required:!0,value:o.collectorNode?.limitCPUm?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.limitCPUm",""===t?null:Number(t))}})),t&&e.createElement(e.Fragment,null,e.createElement(f,{status:B.Warning,title:"(Advanced) K8s Node Logs Directory",tooltip:"If `/var/log` is a symlink, you can specify the target directory for Kubernetes logs here.",required:!0,value:o.collectorNode?.k8sNodeLogsDirectory||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.k8sNodeLogsDirectory",t||null)}}),e.createElement(f,{status:B.Warning,title:"(Advanced) Own Metrics Port",tooltip:"If the collector node is running with a host network, it may conflict with the port of other processes. This setting allows you to specify a different port for the own metrics.",type:"number",required:!0,value:o.collectorNode?.collectorOwnMetricsPort?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.collectorOwnMetricsPort",""===t?null:Number(t))}}),e.createElement(Jl,null,e.createElement(f,{status:B.Warning,title:"(Advanced) Memory Limiter Limit",tooltip:"You can optionally specify how much memory the collector node should limit (in megabytes).",type:"number",required:!0,value:o.collectorNode?.memoryLimiterLimitMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.memoryLimiterLimitMiB",""===t?null:Number(t))}}),e.createElement(f,{status:B.Warning,title:"(Advanced) Memory Limiter Spike Limit",tooltip:"You can optionally specify how much memory the collector node should limit (in megabytes).",type:"number",required:!0,value:o.collectorNode?.memoryLimiterSpikeLimitMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.memoryLimiterSpikeLimitMiB",""===t?null:Number(t))}})),e.createElement(f,{status:B.Warning,title:"(Advanced) Go Memory Limit",tooltip:"Sets the GOMEMLIMIT environment variable to control Go runtime memory usage. This soft memory limit helps the garbage collector prevent out-of-memory conditions in Kubernetes by triggering more aggressive garbage collection as memory usage approaches the limit (in megabytes).",type:"number",required:!0,value:o.collectorNode?.goMemLimitMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.goMemLimitMiB",""===t?null:Number(t))}}))));or.displayName=or.name;const ir=i(({isAdvanced:t,formData:o,handleFormChange:i},a)=>e.createElement(_l,{ref:a,id:Ul.CollectorGateway},e.createElement(Jl,null,e.createElement(Gl,null,"Collector Gateway")),e.createElement(Jl,null,e.createElement(f,{title:"Autoscaler Min. Replicas",tooltip:"You can optionally specify the minimum number of replicas for the collector gateway.",type:"number",required:!0,value:o.collectorGateway?.minReplicas?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.minReplicas",""===t?null:Number(t))}}),e.createElement(f,{title:"Autoscaler Max. Replicas",tooltip:"You can optionally specify the maximum number of replicas for the collector gateway.",type:"number",required:!0,value:o.collectorGateway?.maxReplicas?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.maxReplicas",""===t?null:Number(t))}})),e.createElement(Jl,null,e.createElement(f,{title:"Request Memory",tooltip:"You can optionally specify how much memory the collector gateway should request (in megabytes).",type:"number",required:!0,value:o.collectorGateway?.requestMemoryMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.requestMemoryMiB",""===t?null:Number(t))}}),e.createElement(f,{title:"Limit Memory",tooltip:"You can optionally specify how much memory the collector gateway should limit (in megabytes).",type:"number",required:!0,value:o.collectorGateway?.limitMemoryMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.limitMemoryMiB",""===t?null:Number(t))}})),e.createElement(Jl,null,e.createElement(f,{title:"Request CPU",tooltip:"You can optionally specify how much CPU the collector gateway should request (in millicores).",type:"number",required:!0,value:o.collectorGateway?.requestCPUm?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.requestCPUm",""===t?null:Number(t))}}),e.createElement(f,{title:"Limit CPU",tooltip:"You can optionally specify how much CPU the collector gateway should limit (in millicores).",type:"number",required:!0,value:o.collectorGateway?.limitCPUm?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.limitCPUm",""===t?null:Number(t))}})),t&&e.createElement(e.Fragment,null,e.createElement(Jl,null,e.createElement(f,{status:B.Warning,title:"(Advanced) Memory Limiter Limit",tooltip:"You can optionally specify how much memory the collector gateway should limit (in megabytes).",type:"number",required:!0,value:o.collectorGateway?.memoryLimiterLimitMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.memoryLimiterLimitMiB",""===t?null:Number(t))}}),e.createElement(f,{status:B.Warning,title:"(Advanced) Memory Limiter Spike Limit",tooltip:"You can optionally specify how much memory the collector gateway should limit (in megabytes).",type:"number",required:!0,value:o.collectorGateway?.memoryLimiterSpikeLimitMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.memoryLimiterSpikeLimitMiB",""===t?null:Number(t))}})),e.createElement(f,{status:B.Warning,title:"(Advanced) Go Memory Limit",tooltip:"Sets the GOMEMLIMIT environment variable to control Go runtime memory usage. This soft memory limit helps the garbage collector prevent out-of-memory conditions in Kubernetes by triggering more aggressive garbage collection as memory usage approaches the limit (in megabytes).",type:"number",required:!0,value:o.collectorGateway?.goMemLimitMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.goMemLimitMiB",""===t?null:Number(t))}}))));ir.displayName=ir.name;const ar=d.div`
415
+ `,Ql=i(({isAdvanced:t,formData:o,handleFormChange:i},n)=>e.createElement(Jl,{ref:n,id:Gl.Ui},e.createElement(Xl,null,e.createElement(Yl,null,"UI")),e.createElement(x,{title:"Central Backend URL",tooltip:'When running the Centralized UI, you need to specify the URL of the central backend. <a href="https://docs.odigos.io/features/central">Learn more</a>.',required:!0,value:o.centralBackendURL||"",onChange:e=>{const{value:t}=e.target;i("centralBackendURL",t||null)}}),e.createElement(x,{title:"OIDC Tenant URL",tooltip:'If you need to restrict access to the Community UI, you can setup an OIDC provider. To do so you need to specify the URL of the OIDC tenant. <a href="https://docs.odigos.io/features/oidc">Learn more</a>.',required:!0,value:o.oidc?.tenantUrl||"",onChange:e=>{const{value:t}=e.target;i("oidc.tenantUrl",t||null)}}),e.createElement(x,{title:"OIDC Client ID",tooltip:'If you need to restrict access to the Community UI, you can setup an OIDC provider. To do so you need to specify the Client ID of the OIDC application. <a href="https://docs.odigos.io/features/oidc">Learn more</a>.',required:!0,value:o.oidc?.clientId||"",onChange:e=>{const{value:t}=e.target;i("oidc.clientId",t||null)}}),e.createElement(x,{title:"OIDC Client Secret",tooltip:'If you need to restrict access to the Community UI, you can setup an OIDC provider. To do so you need to specify the Client Secret of the OIDC application. <a href="https://docs.odigos.io/features/oidc">Learn more</a>.',type:"password",required:!0,value:o.oidc?.clientSecret||"",onChange:e=>{const{value:t}=e.target;i("oidc.clientSecret",t||null)}}),t&&e.createElement(x,{status:j.Warning,title:"(Advanced) UI Pagination Limit",tooltip:"The pagination limit for fetching data from the UI backend. A larger limit means more data will be fetched at once, reducing the number of requests to the backend. This might increase or decrease the performance of the UI - depending on your environment.",type:"number",required:!0,value:o.uiPaginationLimit?.toString()||"",onChange:e=>{const{value:t}=e.target;i("uiPaginationLimit",""===t?null:Number(t))}})));Ql.displayName=Ql.name;const Zl=[{id:so.VirtualDevice,value:"Virtual Device"},{id:so.HostPath,value:"Host Path"},{id:so.InitContainer,value:"Init Container"}],er=[{id:co.Loader,value:"Loader"},{id:co.PodManifest,value:"Pod Manifest"},{id:co.LoaderFallbackToPodManifest,value:"Loader Fallback to Pod Manifest"}],tr=[{id:uo.CodeAttributes,value:"Code Attributes"},{id:uo.FullPayloadCollection,value:"Full Payload Collection"},{id:uo.DbPayloadCollection,value:"DB Payload Collection"},{id:uo.QueryOperationDetector,value:"Query Operation Detector"},{id:uo.AllowConcurrentAgents,value:"Allow Concurrent Agents"},{id:uo.JavaEbpfInstrumentations,value:"Java EBPF Instrumentations"},{id:uo.JavaNativeInstrumentations,value:"Java Native Instrumentations"},{id:uo.SizeS,value:"Size S"},{id:uo.SizeM,value:"Size M"},{id:uo.SizeL,value:"Size L"}],or=i(({isAdvanced:t,formData:o,handleFormChange:i},n)=>e.createElement(Jl,{ref:n,id:Gl.General},e.createElement(Xl,null,e.createElement(Yl,null,"General")),e.createElement(x,{title:"Cluster Name",tooltip:'Name of the cluster, this is optional, but required in the Centralized UI. <a href="https://docs.odigos.io/features/central">Learn more</a>.',required:!0,value:o.clusterName||"",onChange:e=>{const{value:t}=e.target;i("clusterName",t||null)}}),e.createElement(k,{title:"Enable the Karpenter Integration",tooltip:'<a href="https://docs.odigos.io/setup/odigos-with-karpenter">Learn how to configure Karpenter</a>. Once the Karpenter tainting setup is complete, inform Odigos to disable node affinity and rely on the taint mechanism.',initialValue:o.karpenterEnabled||!1,onChange:e=>i("karpenterEnabled",e)}),e.createElement(k,{title:"Allow Odigos Alongisde Other Agents",tooltip:"By default Odigos does not instrument applications that are already instrumented by other agents. If you want to allow Odigos to instrument applications that are already instrumented by other agents, enable this option. Note: this is not recommended and should be used only if you know what you are doing.",initialValue:o.allowConcurrentAgents||!1,onChange:e=>i("allowConcurrentAgents",e)}),e.createElement(k,{title:"Disable Automatic Rollout",tooltip:"By default, Odigos automatically rolls out the pods after the instrumentation is complete. If you want to disable rollouts and do it manually, toggle this option.",initialValue:o.rollout?.automaticRolloutDisabled||!1,onChange:e=>i("rollout.automaticRolloutDisabled",e)}),e.createElement(x,{title:"Image Prefix",tooltip:"Docker image prefix for all Odigos components. This is disabled because this setting requires a CLI update.",disabled:!0,required:!0,value:o.imagePrefix||"",onChange:e=>{const{value:t}=e.target;i("imagePrefix",t||null)}}),e.createElement(w,{title:"Node Selector",tooltip:"NodeSelector is a map of key-value Kubernetes NodeSelector labels to apply to all Odigos components. Note that Odigos will only be able to instrument applications on the same node. This setting can be applied only via the CLI.",disabled:!0,required:!0,value:Object.entries(o.nodeSelector||{}).map(([e,t])=>({key:e,value:t}))}),e.createElement(ot,{title:"Profiles",tooltip:"Enable custom profiles to customize the Odigos instrumentation.",isMulti:!0,options:tr,value:tr.filter(e=>o.profiles?.includes(e.id)),onSelect:e=>i("profiles",[...o.profiles||[],e.id]),onDeselect:e=>i("profiles",o.profiles?.filter(t=>t!==e.id)||[])}),e.createElement(Xl,null,e.createElement(D,{title:"Ignored Namespaces",tooltip:"List of namespaces to exclude from instrumentation. Note: you cannot remove the default namespaces from the list, but you are able to add more namespaces.",required:!0,value:o.ignoredNamespaces||[],onChange:e=>i("ignoredNamespaces",e)}),e.createElement(D,{title:"Ignored Containers",tooltip:"List of container names to exclude from instrumentation, this is a global setting and will be applied to all applications",required:!0,value:o.ignoredContainers||[],onChange:e=>i("ignoredContainers",e)})),t&&e.createElement(e.Fragment,null,e.createElement(ot,{status:j.Warning,title:"(Advanced) Mount Method",tooltip:'For Odigos agents to run inside instrumented pod containers, certain files must be mounted into the container. In Kubernetes, these files are mounted under `/var/odigos` directory, with subdirectories for each agent. <a href="https://docs.odigos.io/instrumentations/configuration/mount-method#agent-mount-method">Learn more</a>.',options:Zl,required:!0,value:Zl.find(e=>e.id===o.mountMethod)||void 0,onSelect:e=>i("mountMethod",e.id)}),e.createElement(ot,{status:j.Warning,title:"(Advanced) Agent Envs Injection Method",tooltip:"In order for Odigos to instrument applications, it needs to inject environment variables into the application. This setting controls how Odigos injects these environment variables.",options:er,required:!0,value:er.find(e=>e.id===o.agentEnvVarsInjectionMethod)||void 0,onSelect:e=>i("agentEnvVarsInjectionMethod",e.id)}),e.createElement(x,{status:j.Warning,title:"(Advanced) Odiglet Health Probe Port",tooltip:"If the Odiglet is running with a host network, it may conflict with the port of other processes. This setting allows you to specify a different port for the health probe.",type:"number",required:!0,value:o.odigletHealthProbeBindPort?.toString()||"",onChange:e=>{const{value:t}=e.target;i("odigletHealthProbeBindPort",""===t?null:Number(t))}}),e.createElement(x,{status:j.Warning,title:"(Advanced) Custom Container Runtime Socket Path",tooltip:"If containerd is located in a different path than the default supported path by Odigos, then you can specify the socket path here.",required:!0,value:o.customContainerRuntimeSocketPath||"",onChange:e=>{const{value:t}=e.target;i("customContainerRuntimeSocketPath",t||null)}}))));or.displayName=or.name;const ir=i(({formData:t,handleFormChange:o},i)=>e.createElement(Jl,{ref:i,id:Gl.Rollback},e.createElement(Yl,null,"Rollback"),e.createElement(k,{title:"Rollback Disabled",tooltip:"Disable rollback",initialValue:t.rollbackDisabled||!1,onChange:e=>o("rollbackDisabled",e)}),e.createElement(Xl,null,e.createElement(x,{title:"Rollback Grace Time",tooltip:"This is the amount of time that a pod should be in the `CrashLoopBackoff` state before it is rolled back. Pods that are in the `CrashLoopBackoff` state for longer than this time will be rolled back.",required:!0,value:t.rollbackGraceTime||"",onChange:e=>{const{value:t}=e.target;o("rollbackGraceTime",t||null)}}),e.createElement(x,{title:"Rollback Stability Window",tooltip:"This is the time-window in which the pod should be in the `CrashLoopBackoff` state before it is rolled back. Pods that are in the `CrashLoopBackoff` state after this window will not be rolled back.",required:!0,value:t.rollbackStabilityWindow||"",onChange:e=>{const{value:t}=e.target;o("rollbackStabilityWindow",t||null)}}))));ir.displayName=ir.name;const nr=i(({isAdvanced:t,formData:o,handleFormChange:i},n)=>e.createElement(Jl,{ref:n,id:Gl.CollectorNode},e.createElement(Xl,null,e.createElement(Yl,null,"Collector Node")),e.createElement(Xl,null,e.createElement(x,{title:"Request Memory",tooltip:"You can optionally specify how much memory the collector node should request (in megabytes).",type:"number",required:!0,value:o.collectorNode?.requestMemoryMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.requestMemoryMiB",""===t?null:Number(t))}}),e.createElement(x,{title:"Limit Memory",tooltip:"You can optionally specify how much memory the collector node should limit (in megabytes).",type:"number",required:!0,value:o.collectorNode?.limitMemoryMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.limitMemoryMiB",""===t?null:Number(t))}})),e.createElement(Xl,null,e.createElement(x,{title:"Request CPU",tooltip:"You can optionally specify how much CPU the collector node should request (in millicores).",type:"number",required:!0,value:o.collectorNode?.requestCPUm?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.requestCPUm",""===t?null:Number(t))}}),e.createElement(x,{title:"Limit CPU",tooltip:"You can optionally specify how much CPU the collector node should limit (in millicores).",type:"number",required:!0,value:o.collectorNode?.limitCPUm?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.limitCPUm",""===t?null:Number(t))}})),t&&e.createElement(e.Fragment,null,e.createElement(x,{status:j.Warning,title:"(Advanced) K8s Node Logs Directory",tooltip:"If `/var/log` is a symlink, you can specify the target directory for Kubernetes logs here.",required:!0,value:o.collectorNode?.k8sNodeLogsDirectory||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.k8sNodeLogsDirectory",t||null)}}),e.createElement(x,{status:j.Warning,title:"(Advanced) Own Metrics Port",tooltip:"If the collector node is running with a host network, it may conflict with the port of other processes. This setting allows you to specify a different port for the own metrics.",type:"number",required:!0,value:o.collectorNode?.collectorOwnMetricsPort?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.collectorOwnMetricsPort",""===t?null:Number(t))}}),e.createElement(Xl,null,e.createElement(x,{status:j.Warning,title:"(Advanced) Memory Limiter Limit",tooltip:"You can optionally specify how much memory the collector node should limit (in megabytes).",type:"number",required:!0,value:o.collectorNode?.memoryLimiterLimitMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.memoryLimiterLimitMiB",""===t?null:Number(t))}}),e.createElement(x,{status:j.Warning,title:"(Advanced) Memory Limiter Spike Limit",tooltip:"You can optionally specify how much memory the collector node should limit (in megabytes).",type:"number",required:!0,value:o.collectorNode?.memoryLimiterSpikeLimitMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.memoryLimiterSpikeLimitMiB",""===t?null:Number(t))}})),e.createElement(x,{status:j.Warning,title:"(Advanced) Go Memory Limit",tooltip:"Sets the GOMEMLIMIT environment variable to control Go runtime memory usage. This soft memory limit helps the garbage collector prevent out-of-memory conditions in Kubernetes by triggering more aggressive garbage collection as memory usage approaches the limit (in megabytes).",type:"number",required:!0,value:o.collectorNode?.goMemLimitMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.goMemLimitMiB",""===t?null:Number(t))}}))));nr.displayName=nr.name;const ar=i(({isAdvanced:t,formData:o,handleFormChange:i},n)=>e.createElement(Jl,{ref:n,id:Gl.CollectorGateway},e.createElement(Xl,null,e.createElement(Yl,null,"Collector Gateway")),e.createElement(Xl,null,e.createElement(x,{title:"Autoscaler Min. Replicas",tooltip:"You can optionally specify the minimum number of replicas for the collector gateway.",type:"number",required:!0,value:o.collectorGateway?.minReplicas?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.minReplicas",""===t?null:Number(t))}}),e.createElement(x,{title:"Autoscaler Max. Replicas",tooltip:"You can optionally specify the maximum number of replicas for the collector gateway.",type:"number",required:!0,value:o.collectorGateway?.maxReplicas?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.maxReplicas",""===t?null:Number(t))}})),e.createElement(Xl,null,e.createElement(x,{title:"Request Memory",tooltip:"You can optionally specify how much memory the collector gateway should request (in megabytes).",type:"number",required:!0,value:o.collectorGateway?.requestMemoryMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.requestMemoryMiB",""===t?null:Number(t))}}),e.createElement(x,{title:"Limit Memory",tooltip:"You can optionally specify how much memory the collector gateway should limit (in megabytes).",type:"number",required:!0,value:o.collectorGateway?.limitMemoryMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.limitMemoryMiB",""===t?null:Number(t))}})),e.createElement(Xl,null,e.createElement(x,{title:"Request CPU",tooltip:"You can optionally specify how much CPU the collector gateway should request (in millicores).",type:"number",required:!0,value:o.collectorGateway?.requestCPUm?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.requestCPUm",""===t?null:Number(t))}}),e.createElement(x,{title:"Limit CPU",tooltip:"You can optionally specify how much CPU the collector gateway should limit (in millicores).",type:"number",required:!0,value:o.collectorGateway?.limitCPUm?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.limitCPUm",""===t?null:Number(t))}})),t&&e.createElement(e.Fragment,null,e.createElement(Xl,null,e.createElement(x,{status:j.Warning,title:"(Advanced) Memory Limiter Limit",tooltip:"You can optionally specify how much memory the collector gateway should limit (in megabytes).",type:"number",required:!0,value:o.collectorGateway?.memoryLimiterLimitMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.memoryLimiterLimitMiB",""===t?null:Number(t))}}),e.createElement(x,{status:j.Warning,title:"(Advanced) Memory Limiter Spike Limit",tooltip:"You can optionally specify how much memory the collector gateway should limit (in megabytes).",type:"number",required:!0,value:o.collectorGateway?.memoryLimiterSpikeLimitMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.memoryLimiterSpikeLimitMiB",""===t?null:Number(t))}})),e.createElement(x,{status:j.Warning,title:"(Advanced) Go Memory Limit",tooltip:"Sets the GOMEMLIMIT environment variable to control Go runtime memory usage. This soft memory limit helps the garbage collector prevent out-of-memory conditions in Kubernetes by triggering more aggressive garbage collection as memory usage approaches the limit (in megabytes).",type:"number",required:!0,value:o.collectorGateway?.goMemLimitMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.goMemLimitMiB",""===t?null:Number(t))}}))));ar.displayName=ar.name;const lr=d.div`
416
416
  display: flex;
417
417
  flex-direction: column;
418
418
  gap: 12px;
419
419
  max-height: 100vh;
420
420
  overflow-y: auto;
421
- `,nr=d.div`
421
+ `,rr=d.div`
422
422
  position: relative;
423
- `,lr="System Settings",rr=({installationMethod:i,fetchSettings:n,onSave:l})=>{const[r,s]=t(void 0),[c,d]=t(!1),[u,p]=t(!1),[m,h]=t(!1),g=()=>h(e=>!e),{popupRef:y,popupOpen:v,setPopupOpen:b}=Ge(),{formData:f,handleFormChange:x,resetFormData:C,isFormDirty:$}=no(r);o(()=>{m?n().then(s):s(void 0)},[m]);const[k,w]=t(!1),[D,T]=t(null),I=e=>{$?(w(!0),T(()=>e)):e()},[E,O]=t(Ul.General),M=a(null),A=a(null),F=a(null),R=a(null),L=a(null),P=a(null),H=[A,F,R,L,P],W=[Ul.General,Ul.Ui,Ul.Rollback,Ul.CollectorNode,Ul.CollectorGateway];return e.createElement(e.Fragment,null,e.createElement(ct,{key:lr,onClick:g,tooltip:lr},e.createElement(Wo,{size:18})),e.createElement(K,{width:"750px",isOpen:m,onClose:()=>I(g),header:{icons:[Wo],title:lr,tabs:W.map(e=>({label:e,onClick:()=>(e=>{O(e),(e=>{const t=M.current;if(!t)return;let o=0;for(let i=0;i<H.length;i++){const a=H[i].current;if(a&&a.id===e){const e=t.getBoundingClientRect();o=a.getBoundingClientRect().top-e.top+t.scrollTop;break}}t.scrollTo({top:e===Ul.General?0:o,behavior:"smooth"})})(e)})(e),selected:E===e})),actions:[e.createElement(nr,{key:"actions"},e.createElement(ct,{withBorder:!0,onClick:()=>b(e=>!e)},e.createElement(N,{size:10},"•••")),e.createElement(Je,{ref:y,isOpen:v,top:36,right:0,padding:"24px",width:"270px"},e.createElement(S,{title:"Enable Advanced Mode",tooltip:"Show advanced settings. Note: these are not recommended to be changed unless you know what you are doing.",initialValue:u,onChange:()=>p(e=>!e),flipHorizontally:!0})))]},footer:{isOpen:$,centerButtons:[{"data-id":"drawer-cancel",variant:"secondary",onClick:()=>I(C),children:q.CANCEL},{"data-id":"drawer-save",variant:"primary",onClick:async()=>{d(!0),await l(f),s(await n()),d(!1),C(),g()},children:q.SAVE}]}},void 0===f?.imagePrefix||c?e.createElement(ke,null,e.createElement(yt,{scale:1.2})):e.createElement(ar,{ref:M},i===uo.Helm&&e.createElement(oe,{type:B.Warning,title:"Helm",message:"Changes won't persist unless you update the `values.yaml` file"}),e.createElement(er,{ref:A,isAdvanced:u,formData:f,handleFormChange:x}),e.createElement(Yl,{ref:F,isAdvanced:u,formData:f,handleFormChange:x}),e.createElement(tr,{ref:R,isAdvanced:u,formData:f,handleFormChange:x}),e.createElement(or,{ref:L,isAdvanced:u,formData:f,handleFormChange:x}),e.createElement(ir,{ref:P,isAdvanced:u,formData:f,handleFormChange:x}))),e.createElement(z,{isOpen:k,name:lr,onApprove:()=>{D?.(),w(!1)},onDeny:()=>{w(!1)}}))},sr=d.div`
423
+ `,sr="System Settings",cr=({installationMethod:i,fetchSettings:a,onSave:l})=>{const[r,s]=t(void 0),[c,d]=t(!1),[u,p]=t(!1),[m,h]=t(!1),g=()=>h(e=>!e),{popupRef:y,popupOpen:v,setPopupOpen:b}=Je(),{formData:f,handleFormChange:x,resetFormData:C,isFormDirty:$}=lo(r);o(()=>{m?a().then(s):s(void 0)},[m]);const[S,w]=t(!1),[D,N]=t(null),I=e=>{$?(w(!0),N(()=>e)):e()},[E,O]=t(Gl.General),M=n(null),A=n(null),F=n(null),R=n(null),L=n(null),q=n(null),P=[A,F,R,L,q],z=[Gl.General,Gl.Ui,Gl.Rollback,Gl.CollectorNode,Gl.CollectorGateway];return e.createElement(e.Fragment,null,e.createElement(dt,{key:sr,onClick:g,tooltip:sr},e.createElement(Bo,{size:18})),e.createElement(H,{width:"750px",isOpen:m,onClose:()=>I(g),header:{icons:[Bo],title:sr,tabs:z.map(e=>({label:e,onClick:()=>(e=>{O(e),(e=>{const t=M.current;if(!t)return;let o=0;for(let i=0;i<P.length;i++){const n=P[i].current;if(n&&n.id===e){const e=t.getBoundingClientRect();o=n.getBoundingClientRect().top-e.top+t.scrollTop;break}}t.scrollTo({top:e===Gl.General?0:o,behavior:"smooth"})})(e)})(e),selected:E===e})),actions:[e.createElement(rr,{key:"actions"},e.createElement(dt,{withBorder:!0,onClick:()=>b(e=>!e)},e.createElement(T,{size:10},"•••")),e.createElement(Ye,{ref:y,isOpen:v,top:36,right:0,padding:"24px",width:"270px"},e.createElement(k,{title:"Enable Advanced Mode",tooltip:"Show advanced settings. Note: these are not recommended to be changed unless you know what you are doing.",initialValue:u,onChange:()=>p(e=>!e),flipHorizontally:!0})))]},footer:{isOpen:$,centerButtons:[{"data-id":"drawer-cancel",variant:"secondary",onClick:()=>I(C),children:K.CANCEL},{"data-id":"drawer-save",variant:"primary",onClick:async()=>{d(!0),await l(f),s(await a()),d(!1),C(),g()},children:K.SAVE}]}},void 0===f?.imagePrefix||c?e.createElement(we,null,e.createElement(vt,{scale:1.2})):e.createElement(lr,{ref:M},i===po.Helm&&e.createElement(ie,{type:j.Warning,title:"Helm",message:"Changes won't persist unless you update the `values.yaml` file"}),e.createElement(or,{ref:A,isAdvanced:u,formData:f,handleFormChange:x}),e.createElement(Ql,{ref:F,isAdvanced:u,formData:f,handleFormChange:x}),e.createElement(ir,{ref:R,isAdvanced:u,formData:f,handleFormChange:x}),e.createElement(nr,{ref:L,isAdvanced:u,formData:f,handleFormChange:x}),e.createElement(ar,{ref:q,isAdvanced:u,formData:f,handleFormChange:x}))),e.createElement(W,{isOpen:S,name:sr,onApprove:()=>{D?.(),w(!1)},onDeny:()=>{w(!1)}}))},dr=d.div`
424
424
  position: fixed;
425
425
  bottom: 12px;
426
426
  left: 12px;
@@ -429,7 +429,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
429
429
  flex-direction: column-reverse;
430
430
  gap: 6px;
431
431
  max-width: 600px;
432
- `,cr=()=>{const{notifications:t,markAsDismissed:o,markAsSeen:i}=R(),{onClickNotification:a}=zt();return e.createElement(sr,null,t.filter(({dismissed:e})=>!e).map(({id:t,type:n,title:l,message:r,crdType:s,target:c})=>e.createElement(oe,{key:`toast-${t}`,id:t,type:n,title:l,message:r,action:s&&c?{label:"go to details",onClick:()=>a({id:t,crdType:s,target:c},{dismissToast:!0})}:void 0,onClose:()=>(({id:e,asSeen:t})=>{o(e),t&&i(e)})({id:t,asSeen:!0})})))},dr=d.div`
432
+ `,ur=()=>{const{notifications:t,markAsDismissed:o,markAsSeen:i}=L(),{onClickNotification:n}=Wt();return e.createElement(dr,null,t.filter(({dismissed:e})=>!e).map(({id:t,type:a,title:l,message:r,crdType:s,target:c})=>e.createElement(ie,{key:`toast-${t}`,id:t,type:a,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})=>{o(e),t&&i(e)})({id:t,asSeen:!0})})))},pr=d.div`
433
433
  position: relative;
434
434
  display: flex;
435
435
  align-items: center;
@@ -448,7 +448,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
448
448
  stroke: ${({theme:e})=>e.text.secondary};
449
449
  }
450
450
  }
451
- `,ur=d.div`
451
+ `,mr=d.div`
452
452
  position: absolute;
453
453
  top: 2px;
454
454
  left: ${({$darkMode:e})=>e?"2px":"calc(100% - 2px - 24px)"};
@@ -458,50 +458,50 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
458
458
  background-color: ${({theme:e})=>e.colors.border};
459
459
  border-radius: 100%;
460
460
  transition: all 0.3s;
461
- `,pr=({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})),mr=()=>{const{darkMode:t,setDarkMode:o}=po();return e.createElement(dr,{onClick:()=>o(!t)},e.createElement(pr,{path:"M14 7.977A4.333 4.333 0 1 1 8.023 2H8a6 6 0 1 0 6 6v-.023Z"}),e.createElement(pr,{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(ur,{$darkMode:t}))},hr=e=>{const{spans:t}=e,o=new Map;t.forEach(e=>{o.set(e.spanID,{...e,spans:[]})});const i=[];return t.forEach(e=>{const t=o.get(e.spanID);let a=!1;if(e.references.length){const t=e.references.find(e=>"CHILD_OF"===e.refType);t&&t.spanID&&o.has(t.spanID)||(a=!0)}else a=!0;if(a)i.push(t);else{const i=e.references.find(e=>"CHILD_OF"===e.refType);if(i){const e=o.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)},gr=(e,t)=>{const{tags:o}=e,i={},a=[];return o.forEach(e=>{i[e.key]=e.value}),a.push({type:m.Code,value:{language:"json",code:JSON.stringify(i,null,2),pretty:t}}),a},yr=e=>{const{logs:t}=e,o=[];return t.forEach((e,i)=>{e.fields.forEach(e=>{o.push({title:e.key,value:e.value})}),i!==t.length-1&&o.push({type:m.Divider})}),o},vr=e=>{const{traceID:t,spanID:o,processID:i,operationName:a,duration:n,startTime:l,warnings:r}=e,s=[];return s.push({type:m.CopyText,title:"Trace ID",value:t}),s.push({type:m.CopyText,title:"Span ID",value:o}),s.push({type:m.Divider}),s.push({title:"Service",value:i}),s.push({title:"Operation",value:a}),s.push({title:"Duration",value:mo(n)}),s.push({title:"Start time",value:new Date(l/1e3).toLocaleString()}),r.length&&(s.push({type:m.Divider}),s.push({title:"Warnings",titleIcon:Bo,value:r})),s},br=(e,t)=>{const{tags:o}=e,i={},a=[];return o.forEach(e=>{i[e.key]=e.value}),a.push({type:m.Code,value:{language:"json",code:JSON.stringify(i,null,2),pretty:t}}),a},fr=d.div`
461
+ `,hr=({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})),gr=()=>{const{darkMode:t,setDarkMode:o}=mo();return e.createElement(pr,{onClick:()=>o(!t)},e.createElement(hr,{path:"M14 7.977A4.333 4.333 0 1 1 8.023 2H8a6 6 0 1 0 6 6v-.023Z"}),e.createElement(hr,{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(mr,{$darkMode:t}))},yr=e=>{const{spans:t}=e,o=new Map;t.forEach(e=>{o.set(e.spanID,{...e,spans:[]})});const i=[];return t.forEach(e=>{const t=o.get(e.spanID);let n=!1;if(e.references.length){const t=e.references.find(e=>"CHILD_OF"===e.refType);t&&t.spanID&&o.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=o.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)},vr=(e,t)=>{const{tags:o}=e,i={},n=[];return o.forEach(e=>{i[e.key]=e.value}),n.push({type:m.Code,value:{language:"json",code:JSON.stringify(i,null,2),pretty:t}}),n},br=e=>{const{logs:t}=e,o=[];return t.forEach((e,i)=>{e.fields.forEach(e=>{o.push({title:e.key,value:e.value})}),i!==t.length-1&&o.push({type:m.Divider})}),o},fr=e=>{const{traceID:t,spanID:o,processID:i,operationName:n,duration:a,startTime:l,warnings:r}=e,s=[];return s.push({type:m.CopyText,title:"Trace ID",value:t}),s.push({type:m.CopyText,title:"Span ID",value:o}),s.push({type:m.Divider}),s.push({title:"Service",value:i}),s.push({title:"Operation",value:n}),s.push({title:"Duration",value:ho(a)}),s.push({title:"Start time",value:new Date(l/1e3).toLocaleString()}),r.length&&(s.push({type:m.Divider}),s.push({title:"Warnings",titleIcon:jo,value:r})),s},xr=(e,t)=>{const{tags:o}=e,i={},n=[];return o.forEach(e=>{i[e.key]=e.value}),n.push({type:m.Code,value:{language:"json",code:JSON.stringify(i,null,2),pretty:t}}),n},Cr=d.div`
462
462
  display: flex;
463
463
  flex-direction: column;
464
464
  gap: 12px;
465
465
  max-height: 100vh;
466
466
  overflow-y: auto;
467
- `,xr=({span:o,process:i,onClose:a})=>{const[n,l]=t(!0),[r,s]=t(!0);return e.createElement(K,{width:"750px",isOpen:!0,onClose:a,header:{icons:[jo],title:o.operationName},footer:{isOpen:!1}},e.createElement(fr,null,e.createElement(J,{title:"Details",data:vr(o)}),o.logs.length>0&&e.createElement(J,{title:"Errors",titleBadge:o.logs.length,titleIcon:Vo,data:yr(o)}),e.createElement(J,{title:"Tags",data:gr(o,n),action:e.createElement(ho,{isPrettyMode:n,setIsPrettyMode:l})}),i&&e.createElement(J,{title:`Process (${i.serviceName})`,data:br(i,r),action:e.createElement(ho,{isPrettyMode:r,setIsPrettyMode:s})})))},Cr=370,$r=["#33DCA7","#50F6E8","#444AD9","#8B55FF","#FF7CA9"].reverse(),Sr=d.div`
467
+ `,$r=({span:o,process:i,onClose:n})=>{const[a,l]=t(!0),[r,s]=t(!0);return e.createElement(H,{width:"750px",isOpen:!0,onClose:n,header:{icons:[Vo],title:o.operationName},footer:{isOpen:!1}},e.createElement(Cr,null,e.createElement(Y,{title:"Details",data:fr(o)}),o.logs.length>0&&e.createElement(Y,{title:"Errors",titleBadge:o.logs.length,titleIcon:Uo,data:br(o)}),e.createElement(Y,{title:"Tags",data:vr(o,a),action:e.createElement(go,{isPrettyMode:a,setIsPrettyMode:l})}),i&&e.createElement(Y,{title:`Process (${i.serviceName})`,data:xr(i,r),action:e.createElement(go,{isPrettyMode:r,setIsPrettyMode:s})})))},Sr=370,kr=["#33DCA7","#50F6E8","#444AD9","#8B55FF","#FF7CA9"].reverse(),wr=d.div`
468
468
  display: flex;
469
469
  align-items: center;
470
- width: ${Cr}px;
471
- background-color: ${({$withErrors:e,theme:t})=>e?t.colors.error+T.opacity.hex["042"]:t.colors.dark_grey};
470
+ width: ${Sr}px;
471
+ background-color: ${({$withErrors:e,theme:t})=>e?t.colors.error+I.opacity.hex["042"]:t.colors.dark_grey};
472
472
  &:hover {
473
- ${({$withErrors:e,$preventHover:t,theme:o})=>!t&&`background-color: ${e?o.colors.error:o.colors.secondary+T.opacity.hex["010"]};`}
473
+ ${({$withErrors:e,$preventHover:t,theme:o})=>!t&&`background-color: ${e?o.colors.error:o.colors.secondary+I.opacity.hex["010"]};`}
474
474
  cursor: ${({$preventHover:e})=>e?"default":"pointer"};
475
475
  }
476
- `,kr=d(se)`
476
+ `,Dr=d(ce)`
477
477
  align-items: center;
478
478
  justify-content: space-between;
479
479
  gap: 4px;
480
480
  padding: 12px;
481
481
  padding-left: ${({$depth:e})=>12*e||12}px;
482
- width: calc(${Cr}px - ${({$depth:e})=>12*e}px);
483
- `,wr=d(se)`
482
+ width: calc(${Sr}px - ${({$depth:e})=>12*e}px);
483
+ `,Nr=d(ce)`
484
484
  align-items: center;
485
485
  gap: 4px;
486
486
  position: absolute;
487
487
  right: 56px;
488
488
  width: calc(100% - ${434}px);
489
- `,Dr=d.div`
489
+ `,Tr=d.div`
490
490
  position: absolute;
491
491
  left: ${({$startTime:e,$minStartTime:t,$maxEndTime:o})=>(e-t)/(o-t)*100+"%"};
492
492
  width: ${({$duration:e,$maxDuration:t})=>e/t*100+"%"};
493
493
  height: 12px;
494
494
  border-radius: 32px;
495
- background-color: ${({$indexInMatrix:e})=>$r[e%$r.length]};
496
- `,Nr=d(N)`
495
+ background-color: ${({$indexInMatrix:e})=>kr[e%kr.length]};
496
+ `,Ir=d(T)`
497
497
  padding-left: calc(100% + 8px);
498
498
  font-size: 10px;
499
499
  color: ${({theme:e})=>e.text.darker_grey};
500
500
  font-family: ${({theme:e})=>e.font_family.secondary};
501
501
  white-space: nowrap;
502
- `,Tr=({span:o,depth:i,indexInMatrix:a,maxDuration:n,minStartTime:l,maxEndTime:r,withErrors:s,errorTooltip:c,isOpen:d,withToggle:u,onToggleOpen:p,onSelect:m})=>{const h=T.useTheme(),[g,y]=t(!1),v=Cr-12*i-20-(s?12:0),b=s&&(1===i||o.logs.length>0);return e.createElement(Sr,{className:"span-container",$withErrors:s,$preventHover:g,onClick:m},e.createElement(kr,{$depth:i,className:"span-left"},e.createElement(se,{$gap:4,$alignItems:"center"},u?e.createElement("div",{onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1)},e.createElement(ct,{onClick:e=>{e.stopPropagation(),p?.()},size:24},e.createElement(dt,{extend:d??!1}))):e.createElement("div",{style:{width:"24px"}}),e.createElement(yo,{maxWidth:v/2,text:o.processID,textSize:14}),e.createElement(N,{size:12,color:h.text.darker_grey},"•"),e.createElement(yo,{maxWidth:v/2,text:o.operationName,textSize:12,textColor:h.text.darker_grey})),s&&(b?e.createElement(de,{...c},e.createElement(Vo,{fill:h.text.error})):e.createElement("div",{style:{position:"relative"}},e.createElement("div",{style:{position:"absolute",top:"-24px",right:"8px"}},e.createElement(ne,{type:B.Error,orientation:"vertical",thickness:1,length:"48px",margin:"0",opacity:.5}))))),e.createElement(wr,{className:"span-right"},e.createElement(Dr,{$indexInMatrix:a,$duration:o.duration,$maxDuration:n,$startTime:o.startTime,$minStartTime:l,$maxEndTime:r},e.createElement(Nr,null,mo(o.duration)))))},Ir=({spans:t,logs:o,depth:i,indexInMatrix:a,maxDuration:n,minStartTime:l,maxEndTime:r,openSpanIdsState:s,selectedSpanState:c})=>{const d=T.useTheme();return t.map((t,u)=>{const p=t.spanID,m=s.value.includes(p),h=!!t.spans?.length,g=o.length?o:go(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(Tr,{span:t,depth:i,indexInMatrix:a+u+i,maxDuration:n,minStartTime:l,maxEndTime:r,withErrors:y,errorTooltip:{titleIcon:Vo,title:v,text:b},isOpen:m,withToggle:h,onToggleOpen:()=>s.set(e=>e.some(e=>e===p)?e.filter(e=>e!=p):[...e,p,...go(t,"spans","spanID")]),onSelect:()=>c.set(e=>e?.spanID===p?null:t)}),m&&h?e.createElement(Ir,{spans:t.spans||[],logs:g,depth:i+1,indexInMatrix:a+u,maxDuration:n,minStartTime:l,maxEndTime:r,openSpanIdsState:s,selectedSpanState:c}):null)})},Er=d.div`
502
+ `,Er=({span:o,depth:i,indexInMatrix:n,maxDuration:a,minStartTime:l,maxEndTime:r,withErrors:s,errorTooltip:c,isOpen:d,withToggle:u,onToggleOpen:p,onSelect:m})=>{const h=I.useTheme(),[g,y]=t(!1),v=Sr-12*i-20-(s?12:0),b=s&&(1===i||o.logs.length>0);return e.createElement(wr,{className:"span-container",$withErrors:s,$preventHover:g,onClick:m},e.createElement(Dr,{$depth:i,className:"span-left"},e.createElement(ce,{$gap:4,$alignItems:"center"},u?e.createElement("div",{onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1)},e.createElement(dt,{onClick:e=>{e.stopPropagation(),p?.()},size:24},e.createElement(ut,{extend:d??!1}))):e.createElement("div",{style:{width:"24px"}}),e.createElement(vo,{maxWidth:v/2,text:o.processID,textSize:14}),e.createElement(T,{size:12,color:h.text.darker_grey},"•"),e.createElement(vo,{maxWidth:v/2,text:o.operationName,textSize:12,textColor:h.text.darker_grey})),s&&(b?e.createElement(ue,{...c},e.createElement(Uo,{fill:h.text.error})):e.createElement("div",{style:{position:"relative"}},e.createElement("div",{style:{position:"absolute",top:"-24px",right:"8px"}},e.createElement(le,{type:j.Error,orientation:"vertical",thickness:1,length:"48px",margin:"0",opacity:.5}))))),e.createElement(Nr,{className:"span-right"},e.createElement(Tr,{$indexInMatrix:n,$duration:o.duration,$maxDuration:a,$startTime:o.startTime,$minStartTime:l,$maxEndTime:r},e.createElement(Ir,null,ho(o.duration)))))},Or=({spans:t,logs:o,depth:i,indexInMatrix:n,maxDuration:a,minStartTime:l,maxEndTime:r,openSpanIdsState:s,selectedSpanState:c})=>{const d=I.useTheme();return t.map((t,u)=>{const p=t.spanID,m=s.value.includes(p),h=!!t.spans?.length,g=o.length?o:yo(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(Er,{span:t,depth:i,indexInMatrix:n+u+i,maxDuration:a,minStartTime:l,maxEndTime:r,withErrors:y,errorTooltip:{titleIcon:Uo,title:v,text:b},isOpen:m,withToggle:h,onToggleOpen:()=>s.set(e=>e.some(e=>e===p)?e.filter(e=>e!=p):[...e,p,...yo(t,"spans","spanID")]),onSelect:()=>c.set(e=>e?.spanID===p?null:t)}),m&&h?e.createElement(Or,{spans:t.spans||[],logs:g,depth:i+1,indexInMatrix:n+u,maxDuration:a,minStartTime:l,maxEndTime:r,openSpanIdsState:s,selectedSpanState:c}):null)})},Mr=d.div`
503
503
  width: 100%;
504
- `,Or=d.div`
504
+ `,Ar=d.div`
505
505
  max-height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px + 2px)`};
506
506
  overflow: auto;
507
507
 
@@ -511,22 +511,22 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
511
511
  border-radius: 24px;
512
512
  border: 1px solid ${({theme:e})=>e.colors.dropdown_bg_2};
513
513
  position: relative;
514
- `,Mr=d.div`
514
+ `,Fr=d.div`
515
515
  padding: 12px 12px 12px 24px;
516
- width: calc(${Cr}px - 36px);
516
+ width: calc(${Sr}px - 36px);
517
517
  background-color: ${({theme:e})=>e.colors.dark_grey};
518
- `,Ar=d.div`
518
+ `,Rr=d.div`
519
519
  width: 1px;
520
520
  height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px + 2px)`};
521
521
  background: ${({theme:e})=>`linear-gradient(to bottom, ${e.colors.border}, transparent)`};
522
522
 
523
523
  position: absolute;
524
- left: calc(${Cr}px + ((100% - ${Cr}px) / ${5}) * ${({index:e})=>e});
525
- `,Fr=d(N)`
524
+ left: calc(${Sr}px + ((100% - ${Sr}px) / ${5}) * ${({index:e})=>e});
525
+ `,Lr=d(T)`
526
526
  color: ${({theme:e})=>e.text.darker_grey};
527
527
  font-size: 12px;
528
528
  font-family: ${({theme:e})=>e.font_family.secondary};
529
529
  padding-top: 12px;
530
530
  padding-left: 12px;
531
531
  white-space: nowrap;
532
- `,Rr=({heightToRemove:o,traces:i,isLoading:a})=>{const[n,r]=t([]),[s,c]=t(null),d=l(()=>kt(i).sort((e,t)=>t.spans[0].startTime-e.spans[0].startTime).map(e=>({...e,spans:hr(e)})),[i]),u=l(()=>d.reduce((e,t)=>Math.max(e,t.spans.reduce((e,t)=>e+t.duration,0)),0),[d]),m=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(Er,{$heightToRemove:o},a?e.createElement(ke,{$height:"50vh"},e.createElement(yt,{scale:1.5})):d.length?e.createElement(Or,{$heightToRemove:o},e.createElement(Mr,null,e.createElement(N,null,"Service & operation")),new Array(5).fill(null).map((t,i)=>e.createElement(Ar,{key:`${i}-divider`,$heightToRemove:o,index:i},e.createElement(Fr,null,mo(u/5*i)))),d.map((t,o)=>{const{spans:i}=t,a=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(Ir,{key:`recursive-spans-${t.traceID}`,spans:i,logs:[],depth:1,indexInMatrix:o,maxDuration:u,minStartTime:a,maxEndTime:l,openSpanIdsState:{value:n,set:r},selectedSpanState:{value:s,set:c}})})):e.createElement(ke,{$height:"50vh"},e.createElement(we,{title:p.NO_TRACES_FOUND,subTitle:p.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}))),s&&e.createElement(xr,{span:s,process:m,onClose:()=>c(null)}))};export{Ci as ActionDrawer,yi as ActionForm,Si as ActionModal,Ii as ActionTable,Fi as AwaitPipeline,sa as ConditionDropdown,ia as DataFlow,Aa as DataFlowActionsMenu,Sa as DataStreamDrawer,Ca as DataStreamForm,Fa as DataStreamSelectionForm,_a as DestinationDrawer,ja as DestinationForm,mn as DestinationModal,bn as DestinationSelectionForm,xn as DestinationTable,ca as ErrorDropdown,Fn as InstrumentationRuleDrawer,Mn as InstrumentationRuleForm,Pn as InstrumentationRuleModal,Hn as InstrumentationRuleTable,ma as KindDropdown,da as LanguageDropdown,ua as MonitorDropdown,Wn as MultiSourceControl,pa as NamespaceDropdown,bl as NavIconIds,Gn as NotificationManager,vi as OverviewDrawer,nl as ServiceMap,vl as SetupSummary,fl as SideNav,xl as SlackInvite,Ml as SourceDrawer,Sl as SourceForm,Rl as SourceModal,Fl as SourceSelectionForm,Pl as SourceTable,Vl as SystemOverview,rr as SystemSettings,wi as TableCellConditions,cr as ToastList,mr as ToggleDarkMode,Rr as TraceView};
532
+ `,qr=({heightToRemove:o,traces:i,isLoading:n})=>{const[a,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:yr(e)})),[i]),u=l(()=>d.reduce((e,t)=>Math.max(e,t.spans.reduce((e,t)=>e+t.duration,0)),0),[d]),m=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(Mr,{$heightToRemove:o},n?e.createElement(we,{$height:"50vh"},e.createElement(vt,{scale:1.5})):d.length?e.createElement(Ar,{$heightToRemove:o},e.createElement(Fr,null,e.createElement(T,null,"Service & operation")),new Array(5).fill(null).map((t,i)=>e.createElement(Rr,{key:`${i}-divider`,$heightToRemove:o,index:i},e.createElement(Lr,null,ho(u/5*i)))),d.map((t,o)=>{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(Or,{key:`recursive-spans-${t.traceID}`,spans:i,logs:[],depth:1,indexInMatrix:o,maxDuration:u,minStartTime:n,maxEndTime:l,openSpanIdsState:{value:a,set:r},selectedSpanState:{value:s,set:c}})})):e.createElement(we,{$height:"50vh"},e.createElement(De,{title:p.NO_TRACES_FOUND,subTitle:p.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}))),s&&e.createElement($r,{span:s,process:m,onClose:()=>c(null)}))};export{Si as ActionDrawer,bi as ActionForm,wi as ActionModal,Oi as ActionTable,Li as AwaitPipeline,un as ConditionDropdown,ln as DataFlow,Ln as DataFlowActionsMenu,Dn as DataStreamDrawer,kn as DataStreamForm,qn as DataStreamSelectionForm,Yn as DestinationDrawer,_n as DestinationForm,ga as DestinationModal,xa as DestinationSelectionForm,$a as DestinationTable,pn as ErrorDropdown,La as InstrumentationRuleDrawer,Fa as InstrumentationRuleForm,Ka as InstrumentationRuleModal,Wa as InstrumentationRuleTable,yn as KindDropdown,mn as LanguageDropdown,hn as MonitorDropdown,ja as MultiSourceControl,gn as NamespaceDropdown,xl as NavIconIds,Ya as NotificationManager,fi as OverviewDrawer,rl as ServiceMap,fl as SetupSummary,Cl as SideNav,$l as SlackInvite,Fl as SourceDrawer,wl as SourceForm,ql as SourceModal,Ll as SourceSelectionForm,Kl as SourceTable,_l as SystemOverview,cr as SystemSettings,Ni as TableCellConditions,ur as ToastList,gr as ToggleDarkMode,qr as TraceView};