@odigos/ui-kit 0.0.116 → 0.0.118-dev.383

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 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 as f,c as b,I as x,d as C,i as $,e as k,f as S,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 P,q,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 fe,a7 as be,a8 as xe,a9 as Ce,aa as $e,ab as ke,ac as Se,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 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 ft,aZ as bt,a_ as xt,a$ as Ct,b0 as $t,b1 as kt,b2 as St,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 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,bN as fo,bO as bo}from"./chunks/ui-components-1cfa212a.js";import{CheckCircledIcon as xo,CrossCircledIcon as Co,EditIcon as $o,TrashIcon as ko,OdigosLogoText as So,SearchIcon as wo,FilterIcon as Do,DataStreamsIcon as No,CheckIcon as To,OdigosLogo as Io,ArrowIcon as Eo,PlusIcon as Oo,RefreshLeftArrowIcon as Mo,NotificationIcon as Ao,UserIcon as Fo,ImageErrorIcon as Ro,OverviewIcon as Lo,RulesIcon as Po,SourcesIcon as qo,ActionsIcon as Ko,DestinationsIcon as Ho,SlackLogo as zo,CopyIcon as Wo,KeyIcon as Bo,TerminalIcon as jo,GearIcon as Vo,WarningTriangleIcon as Uo,TraceViewIcon as _o,ErrorTriangleIcon as Go}from"./icons.js";import{useNodesState as Jo,useEdgesState as Yo,applyNodeChanges as Xo,MarkerType as Qo}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 Zo=e=>{const{type:t,name:o,notes:i,signals:n,disabled:a,fields:{collectContainerAttributes:l,collectReplicaSetAttributes:r,collectWorkloadId:s,collectClusterId:c,labelsAttributes:d,annotationsAttributes:u,clusterAttributes:y,overwriteExistingValues:v,attributeNamesToDelete:f,renames:b,piiCategories:x,fallbackSamplingRatio:C,samplingPercentage:$,endpointsFilters:k,servicesNameFilters:S,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="";f?.forEach((t,o)=>{e+=t,o<f.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===h.RenameAttributes){let e="";const t=Object.entries(b||{});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&&k?.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"+(k.length>1?` #${n+1}`:""),value:a})}),t===h.ServiceNameSampler&&S?.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"+(S.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},ei=b.PiiCategories,ti=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 k,f as S,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 P,q,B as K,r as H,s as z,t as W,E as j,v as B,w as V,x as U,y as _,z as G,G as J,H as Y,J as Q,L as X,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 ke,ac as Se,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 je,aw as Be,ax as Ve,ay as Ue,az as _e,aA as Ge,aB as Je,aC as Ye,aD as Qe,aE as Xe,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 kt,b2 as St,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 jt,bm as Bt,bn as Vt,bo as Ut,bp as _t,bq as Gt,br as Jt,bs as Yt,bt as Qt,bu as Xt,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,bN as bo,bO as fo,bP as xo,bQ as Co}from"./chunks/ui-components-41888152.js";import{CheckCircledIcon as $o,CrossCircledIcon as ko,EditIcon as So,TrashIcon as wo,OdigosLogoText as Do,SearchIcon as No,FilterIcon as To,DataStreamsIcon as Io,CheckIcon as Eo,OdigosLogo as Oo,ArrowIcon as Mo,PlusIcon as Ao,RefreshLeftArrowIcon as Fo,NotificationIcon as Ro,UserIcon as Lo,ImageErrorIcon as Po,OverviewIcon as qo,RulesIcon as Ko,SourcesIcon as Ho,ActionsIcon as zo,DestinationsIcon as Wo,SlackLogo as jo,CopyIcon as Bo,KeyIcon as Vo,TerminalIcon as Uo,GearIcon as _o,WarningTriangleIcon as Go,TraceViewIcon as Jo,ErrorTriangleIcon as Yo}from"./icons.js";import{useNodesState as Qo,useEdgesState as Xo,applyNodeChanges as Zo,MarkerType as ei}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 ti=e=>{const{type:t,name:o,notes:i,signals:n,disabled:a,fields:{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:k,servicesNameFilters:S,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&&k?.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"+(k.length>1?` #${n+1}`:""),value:a})}),t===h.ServiceNameSampler&&S?.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"+(S.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},oi=f.PiiCategories,ii=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 n,useImperative
7
7
  border-radius: 32px;
8
8
  padding: 8px;
9
9
  `}
10
- `,oi=[{id:"CREDIT_CARD",label:"Credit Card"}],ii=b.FallbackSamplingRatio,ni=[{value:g.Pod,id:g.Pod},{value:g.Namespace,id:g.Namespace}],ai=[{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:ni[0].value,componentType:"dropdown",options:ni,required:!1}],li=[{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:ni[0].value,componentType:"dropdown",options:ni,required:!1}],ri=b.EndpointsFilters,si=[{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}],ci=b.AttributeNamesToDelete,di=b.Renames,ui=b.ServicesNameFilters,pi=[{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}],mi=b.SamplingPercentage,hi=b.AttributeFilters,gi=[{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}],yi={[h.K8sAttributes]:({value:t,setValue:i,formErrors:n})=>(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(v,{title:"Collect Container Attributes",value:t[b.CollectContainerAttributes]||!1,onChange:e=>i(b.CollectContainerAttributes,e),errorMessage:n[b.CollectContainerAttributes]}),e.createElement(v,{title:"Collect ReplicaSet Attributes",value:t[b.CollectReplicaSetAttributes]||!1,onChange:e=>i(b.CollectReplicaSetAttributes,e),errorMessage:n[b.CollectReplicaSetAttributes]}),e.createElement(v,{title:"Collect Workload ID",value:t[b.CollectWorkloadId]||!1,onChange:e=>i(b.CollectWorkloadId,e),errorMessage:n[b.CollectWorkloadId]}),e.createElement(v,{title:"Collect Cluster ID",value:t[b.CollectClusterId]||!1,onChange:e=>i(b.CollectClusterId,e),errorMessage:n[b.CollectClusterId]}),e.createElement(k,{columns:ai,value:t[b.LabelsAttributes]||[],onChange:e=>i(b.LabelsAttributes,e),errorMessage:n[b.LabelsAttributes]}),e.createElement(k,{columns:li,value:t[b.AnnotationsAttributes]||[],onChange:e=>i(b.AnnotationsAttributes,e),errorMessage:n[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(w,{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 n=i[ci],a=t[ci]||[];return e.createElement(D,{title:"Attributes to delete",value:a,onChange:e=>o(ci,e),required:!0,errorMessage:n})},[h.RenameAttributes]:({value:t,setValue:o,formErrors:i})=>{const n=i[di],a=Object.entries(t[di]||{}).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(di,t)},required:!0,errorMessage:n})},[h.PiiMasking]:({value:i,setValue:n,formErrors:a})=>{const l=a[ei],r=i[ei]||[],[s,c]=t(1===r.length);return o(()=>{if(!r.length){const e=oi.map(({id:e})=>e);n(ei,e),c(1===oi.length)}},[]),e.createElement("div",null,e.createElement(y,{title:"Attributes to mask",required:!0}),e.createElement(ti,{$hasError:!!l},oi.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(ei,o),c(1===o.length)})(t,e)}))),!!l&&e.createElement(f,null,l))},[h.ErrorSampler]:({value:t,setValue:o,formErrors:i})=>{const n=i[ii],a=t[ii];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(ii,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:n})},[h.ProbabilisticSampler]:({value:t,setValue:o,formErrors:i})=>{const n=i[mi],a=t[mi];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(mi,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:n})},[h.LatencySampler]:({value:t,setValue:o,formErrors:i})=>{const n=i[ri],a=t[ri]||[];return e.createElement(k,{columns:si,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(ri,t)},errorMessage:n})},[h.ServiceNameSampler]:({value:t,setValue:o,formErrors:i})=>{const n=i[ui],a=t[ui]||[];return e.createElement(k,{columns:pi,value:a,onChange:e=>{const t=e.map(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:o})=>({serviceName:e,samplingRatio:Number(t),fallbackSamplingRatio:Number(o)}));o(ui,t)},errorMessage:n})},[h.SpanAttributeSampler]:({value:t,setValue:o,formErrors:i})=>{const n=i[hi],a=(t[hi]||[]).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(k,{columns:gi,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(hi,t)},errorMessage:n,limitFieldsPerRow:3})}},vi=({actionType:t,value:o,setValue:i,formErrors:n})=>{if(!t)return null;const a=yi[t];return a?e.createElement(a,{value:o,setValue:i,formErrors:n}):null},fi=d.div`
10
+ `,ni=[{id:"CREDIT_CARD",label:"Credit Card"}],ai=f.FallbackSamplingRatio,li=[{value:g.Pod,id:g.Pod},{value:g.Namespace,id:g.Namespace}],ri=[{title:"Label Key",keyName:"labelKey",placeholder:"app.kubernetes.io/name",required:!0},{title:"Attribute Key",keyName:"attributeKey",placeholder:"app.kubernetes.name",required:!0},{title:"From",keyName:"from",placeholder:li[0].value,componentType:"dropdown",options:li,required:!1}],si=[{title:"Annotation Key",keyName:"annotationKey",placeholder:"kubectl.kubernetes.io/restartedAt",required:!0},{title:"Attribute Key",keyName:"attributeKey",placeholder:"kubectl.kubernetes.restartedAt",required:!0},{title:"From",keyName:"from",placeholder:li[0].value,componentType:"dropdown",options:li,required:!1}],ci=f.EndpointsFilters,di=[{title:"Service",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Service name: The rule applies to a specific service name. Only traces originating from this service’s root span will be considered.",required:!0},{title:"HTTP route",keyName:"httpRoute",placeholder:"e.g. /api/v1/users",tooltip:"HTTP route: The specific HTTP route prefix to match for sampling. Only traces with routes beginning with this prefix will be considered. For instance, configuring /buy will also match /buy/product.",required:!0},{title:"Threshold",keyName:"minimumLatencyThreshold",placeholder:"e.g. 1000",tooltip:"Minimum latency threshold (ms): Specifies the minimum latency in milliseconds; traces with latency below this threshold are ignored.",required:!0,type: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}],ui=f.AttributeNamesToDelete,pi=f.Renames,mi=f.ServicesNameFilters,hi=[{title:"Service Name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (Across all available spans).",required:!0},{title:"Sampling Ratio",keyName:"samplingRatio",placeholder:"e.g. 10",tooltip:"Specifies the sample rate for all traces.",required:!0,type: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}],gi=f.SamplingPercentage,yi=f.AttributeFilters,vi=[{title:"Service Name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (across all available spans).",required:!0},{title:"Attribute Key",keyName:"attributeKey",placeholder:"e.g. http.request.method",tooltip:"Specifies the attribute key inside of the span.",required:!0},{title:"Fallback Sampling Ratio",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Specifies the percentage of traces that don’t meet the service name filter and that you still like to retain.",required:!0,type: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}],bi={[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(k,{columns:ri,value:t[f.LabelsAttributes]||[],onChange:e=>i(f.LabelsAttributes,e),errorMessage:n[f.LabelsAttributes]}),e.createElement(k,{columns:si,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(S,{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[ui],a=t[ui]||[];return e.createElement(D,{title:"Attributes to delete",value:a,onChange:e=>o(ui,e),required:!0,errorMessage:n})},[h.RenameAttributes]:({value:t,setValue:o,formErrors:i})=>{const n=i[pi],a=Object.entries(t[pi]||{}).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(pi,t)},required:!0,errorMessage:n})},[h.PiiMasking]:({value:i,setValue:n,formErrors:a})=>{const l=a[oi],r=i[oi]||[],[s,c]=t(1===r.length);return o(()=>{if(!r.length){const e=ni.map(({id:e})=>e);n(oi,e),c(1===ni.length)}},[]),e.createElement("div",null,e.createElement(y,{title:"Attributes to mask",required:!0}),e.createElement(ii,{$hasError:!!l},ni.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(oi,o),c(1===o.length)})(t,e)}))),!!l&&e.createElement(b,null,l))},[h.ErrorSampler]:({value:t,setValue:o,formErrors:i})=>{const n=i[ai],a=t[ai];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(ai,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:n})},[h.ProbabilisticSampler]:({value:t,setValue:o,formErrors:i})=>{const n=i[gi],a=t[gi];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(gi,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:n})},[h.LatencySampler]:({value:t,setValue:o,formErrors:i})=>{const n=i[ci],a=t[ci]||[];return e.createElement(k,{columns:di,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(ci,t)},errorMessage:n})},[h.ServiceNameSampler]:({value:t,setValue:o,formErrors:i})=>{const n=i[mi],a=t[mi]||[];return e.createElement(k,{columns:hi,value:a,onChange:e=>{const t=e.map(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:o})=>({serviceName:e,samplingRatio:Number(t),fallbackSamplingRatio:Number(o)}));o(mi,t)},errorMessage:n})},[h.SpanAttributeSampler]:({value:t,setValue:o,formErrors:i})=>{const n=i[yi],a=(t[yi]||[]).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(k,{columns:vi,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(yi,t)},errorMessage:n,limitFieldsPerRow:3})}},fi=({actionType:t,value:o,setValue:i,formErrors:n})=>{if(!t)return null;const a=bi[t];return a?e.createElement(a,{value:o,setValue:i,formErrors:n}):null},xi=d.div`
11
11
  display: flex;
12
12
  flex-direction: column;
13
13
  gap: 24px;
14
14
  padding: 4px;
15
- `,bi=d(T)`
15
+ `,Ci=d(T)`
16
16
  margin-bottom: 12px;
17
- `,xi=({isUpdate:t,action:o,formData:i,formErrors:n,handleFormChange:a})=>{const l=I.useTheme();return e.createElement(fi,null,t&&e.createElement("div",null,e.createElement(bi,null,"Status"),e.createElement(E,{options:[{icon:xo,label:p.ENABLED,value:!1,selectedBgColor:l.text.success+I.opacity.hex["050"]},{icon:Co,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(vi,{actionType:o.type,value:i.fields,setValue:(e,t)=>a(`fields.${e}`,t),formErrors:n}),e.createElement(F,{title:"Notes",value:i.notes||"",onChange:({target:{value:e}})=>a("notes",e),errorMessage:n.notes}))},Ci=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:f,onCancel:b,tabs:x,headerActionButtons:C},$)=>{const k=I.useTheme(),{isThisPending:S}=R(),{addNotification:w}=L(),{drawerType:D,drawerEntityId:N,setDrawerType:E,setDrawerEntityId:O}=P();q({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(),b&&b(),G()},X=()=>{const e=U.current?.isTitleDirty();m||e?V(!0):Y()},Q=()=>{A(!0)},Z=()=>{v&&v(U.current?.getTitle()||"")},ee=l(()=>!!D&&S({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($o,null),e.createElement(T,{size:14,family:"secondary",decoration:"underline"},"Edit"))}),f&&!p&&oe.push({"data-id":"drawer-delete",variant:"tertiary",onClick:ee?()=>te(_?"uninstrument":"delete"):Q,children:e.createElement(e.Fragment,null,e.createElement(ko,null),e.createElement(T,{color:k.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($i,{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:f?[{"data-id":"drawer-delete",variant:"tertiary",onClick:Q,children:e.createElement(e.Fragment,null,e.createElement(ko,null),e.createElement(T,{size:14,color:k.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:()=>{f&&f(),G()},onDeny:G}),e.createElement(W,{isOpen:F,noOverlay:!0,name:"edit mode",onApprove:Y,onDeny:G}))}),$i=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)})});$i.displayName=$i.name,Ci.displayName=Ci.name;const ki=d.div`
17
+ `,$i=({isUpdate:t,action:o,formData:i,formErrors:n,handleFormChange:a})=>{const l=I.useTheme();return e.createElement(xi,null,t&&e.createElement("div",null,e.createElement(Ci,null,"Status"),e.createElement(E,{options:[{icon:$o,label:p.ENABLED,value:!1,selectedBgColor:l.text.success+I.opacity.hex["050"]},{icon:ko,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(fi,{actionType:o.type,value:i.fields,setValue:(e,t)=>a(`fields.${e}`,t),formErrors:n}),e.createElement(F,{title:"Notes",value:i.notes||"",onChange:({target:{value:e}})=>a("notes",e),errorMessage:n.notes}))},ki=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 k=I.useTheme(),{isThisPending:S}=R(),{addNotification:w}=L(),{drawerType:D,drawerEntityId:N,setDrawerType:E,setDrawerEntityId:O}=P();q({key:"Enter",active:p},()=>Z());const[M,A]=t(!1),[F,V]=t(!1),U=n(null),_=D===j.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()},Q=()=>{const e=U.current?.isTitleDirty();m||e?V(!0):Y()},X=()=>{A(!0)},Z=()=>{v&&v(U.current?.getTitle()||"")},ee=l(()=>!!D&&S({entityType:D,entityId:N}),[D,N]),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(So,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"):X,children:e.createElement(e.Fragment,null,e.createElement(wo,null),e.createElement(T,{color:k.text.error,size:14,family:"secondary",decoration:"underline"},_?K.UNINSTRUMENT:K.DELETE))}),e.createElement(e.Fragment,null,e.createElement(H,{isOpen:!0,onClose:p?Q:J,closeOnEscape:!M&&!F,width:`${i+64}px`,header:{icons:d,iconSrcs:u,title:r,titleTooltip:s,replaceTitleWith:!c&&p?e.createElement(Si,{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:Q,children:K.CANCEL}],rightButtons:b?[{"data-id":"drawer-delete",variant:"tertiary",onClick:X,children:e.createElement(e.Fragment,null,e.createElement(wo,null),e.createElement(T,{size:14,color:k.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}))}),Si=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)})});Si.displayName=Si.name,ki.displayName=ki.name;const wi=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
- `,Si=d.div`
23
+ `,Di=d.div`
24
24
  display: flex;
25
25
  flex-direction: column;
26
26
  gap: 12px;
27
- `,wi=({updateAction:o,deleteAction:i})=>{const{actions:a}=V(),{drawerType:r,drawerEntityId:s}=P(),c=n(null),d=r!==B.Action,[u,m]=t(!1),[h,g]=t(!1),{formData:y,formErrors:v,handleFormChange:f,resetFormData:b,validateForm:x,loadFormWithDrawerItem:C}=U(),$=l(()=>{if(d)return b();const e=a?.find(e=>e.id===s);return e?C(e):b(),e},[d,s,a]);if(!$)return null;const k=_.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(Ci,{ref:c,title:$.name||$.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:"";f("name",t),o(s,{...y,name:t}),m(!1),g(!1)}},onDelete:()=>{i(s,$.type),m(!1),g(!1),c.current?.closeDrawer()},onCancel:()=>{m(!1),g(!1),C($)}},u&&k?e.createElement(ki,null,e.createElement(xi,{isUpdate:!0,action:k,formData:y,formErrors:v,handleFormChange:(...e)=>{g(!0),f(...e)}})):e.createElement(Si,null,e.createElement(J,{conditions:$.conditions||[]}),e.createElement(Y,{title:p.ACTION_DETAILS,data:$?Zo($):[]})))},Di=d(Q)`
27
+ `,Ni=({updateAction:o,deleteAction:i})=>{const{actions:a}=V(),{drawerType:r,drawerEntityId:s}=P(),c=n(null),d=r!==j.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 f();const e=a?.find(e=>e.id===s);return e?C(e):f(),e},[d,s,a]);if(!$)return null;const k=_.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(ki,{ref:c,title:$.name||$.type,icons:[G($.type)],isEdit:u,isFormDirty:h,onEdit:e=>{m("boolean"!=typeof e||e)},onSave:e=>{if(x({withAlert:!0,alertTitle:Q.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),c.current?.closeDrawer()},onCancel:()=>{m(!1),g(!1),C($)}},u&&k?e.createElement(wi,null,e.createElement($i,{isUpdate:!0,action:k,formData:y,formErrors:v,handleFormChange:(...e)=>{g(!0),b(...e)}})):e.createElement(Di,null,e.createElement(J,{conditions:$.conditions||[]}),e.createElement(Y,{title:p.ACTION_DETAILS,data:$?ti($):[]})))},Ti=d(X)`
28
28
  margin-top: 24px;
29
29
  gap: 12px;
30
- `,Ni=({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 q({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(Di,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(xi,{action:u,formData:l,formErrors:r,handleFormChange:s})):null))},Ti=e=>{const{type:t,fields:{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:f,servicesNameFilters:b}}=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&&b?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:o})=>{x+=`Service Name: ${e}, `,x+=`Sampling Ratio: ${t}, `,x+=`Fallback Sampling Ratio: ${o}\n`}),t===h.SpanAttributeSampler&&f?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:o})=>{x+=`Service Name: ${e}, `,x+=`Attribute Key: ${t}, `,x+=`Fallback Sampling Ratio: ${o}\n`}),x},Ii=({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(Ei,{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}))},Ei=({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}))}))},Oi=({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.name?.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}},Mi=[{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}],Ai=({maxHeight:t,maxWidth:o})=>{const i=I.useTheme(),n=he(),{actions:a,actionsLoading:r}=V(),{setDrawerType:s,setDrawerEntityId:c}=P(),d=l(()=>Oi({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.notes,textColor:i.text.info,withTooltip:!0},{columnKey:"spec",value:Ti(t),textColor:i.text.info,withTooltip:!0},{columnKey:"signals",component:()=>e.createElement(fe,{withLabels:!0,monitors:t.signals||[]})},{columnKey:"conditions",component:()=>e.createElement(Ii,{conditions:t.conditions||[],id:t.id})},{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}))}]}}),[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(be,{$maxWidth:o},e.createElement(xe,null,e.createElement(Ce,{icon:$e(B.Action),title:p.ACTIONS,badge:m,badgeTooltip:h,loading:r})),e.createElement(ke,{$maxHeight:t},e.createElement(Se,{columns:Mi,rows:u})),!d.length&&e.createElement(we,{style:{marginTop:"2rem"}},e.createElement(De,null)))},Fi=d(Q)`
30
+ `,Ii=({createAction:o})=>{const{currentModal:i,setCurrentModal:n}=Z(),a=i===j.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:Q.Create}))return null;o(l),h()};return q({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(Ti,null,e.createElement(ie,{type:B.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($i,{action:u,formData:l,formErrors:r,handleFormChange:s})):null))},Ei=e=>{const{type:t,fields:{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},Oi=({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(Mi,{conditions:s,id:o}));const c=r?pe.Loading:B.Success;return e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:c,title:c,withBorder:!0,withIcon:!0}))},Mi=({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=B.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}))}))},Ai=({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.name?.toLowerCase().includes(n)):o,c=n?i.filter(e=>e.destinationType.displayName?.toLowerCase().includes(n)||e.name?.toLowerCase().includes(n)):i,d=[{category:j.Source,label:"Sources",count:r.length,entities:[]},{category:j.Action,label:"Actions",count:s.length,entities:[]},{category:j.Destination,label:"Destinations",count:c.length,entities:[]},{category:j.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===j.InstrumentationRule?l:e.category===j.Source?r:e.category===j.Action?s:e.category===j.Destination?c:[]}));return{categories:d,searchResults:u}},Fi=[{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}],Ri=({maxHeight:t,maxWidth:o})=>{const i=I.useTheme(),n=he(),{actions:a,actionsLoading:r}=V(),{setDrawerType:s,setDrawerEntityId:c}=P(),d=l(()=>Ai({instrumentationRules:[],sources:[],actions:ge(a,n),destinations:[],searchText:n.searchText,selectedCategory:j.Action}).searchResults.find(({category:e})=>e===j.Action)?.entities||[],[a,n]),u=l(()=>d.map(t=>{const{hasErrors:o,hasWarnings:n,hasDisableds:a}=re(t.conditions||[]);return{status:o?B.Error:n?B.Warning:void 0,faded:a,onClick:()=>{s(j.Action),c(t.id)},cells:[{columnKey:"icon",component:()=>e.createElement(ye,{icon:G(t.type)})},{columnKey:"name",value:ve(t,j.Action,{prioritizeDisplayName:!0})},{columnKey:"type",value:t.type,textColor:i.text.info},{columnKey:"notes",value:t.notes,textColor:i.text.info,withTooltip:!0},{columnKey:"spec",value:Ei(t),textColor:i.text.info,withTooltip:!0},{columnKey:"signals",component:()=>e.createElement(be,{withLabels:!0,monitors:t.signals||[]})},{columnKey:"conditions",component:()=>e.createElement(Oi,{conditions:t.conditions||[],id:t.id})},{columnKey:"active-status",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:t.disabled?B.Error:B.Success,title:t.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(j.Action),title:p.ACTIONS,badge:m,badgeTooltip:h,loading:r})),e.createElement(ke,{$maxHeight:t},e.createElement(Se,{columns:Fi,rows:u})),!d.length&&e.createElement(we,{style:{marginTop:"2rem"}},e.createElement(De,null)))},Li=d(X)`
31
31
  // width: 100vw;
32
32
  // height: 100vh;
33
33
  gap: 64px;
34
34
  align-items: center;
35
35
  justify-content: center;
36
- `,Ri=d(Q)`
36
+ `,Pi=d(X)`
37
37
  max-width: 400px;
38
38
  gap: 12px;
39
39
  align-items: center;
40
40
  justify-content: center;
41
- `,Li=d(T)`
41
+ `,qi=d(T)`
42
42
  text-align: center;
43
43
  font-size: 24px;
44
- `,Pi=d(T)`
44
+ `,Ki=d(T)`
45
45
  text-align: center;
46
46
  line-height: 26px;
47
47
  color: ${({theme:e})=>e.text.info};
48
- `,qi=()=>{const[i,n]=t(0);return o(()=>{(async()=>{for(let e=0;e<=100;e+=5)await Ie(500),n(e)})()},[]),e.createElement(Fi,null,e.createElement(So,{size:100}),e.createElement(Ne,{width:400}),e.createElement(Ri,null,e.createElement(ce,{$gap:16},e.createElement(Li,null,"Preparing your workspace..."),e.createElement(Te,{label:`${i}%`})),e.createElement(Pi,null,"It can take up to a few minutes. Grab a cup of coffee, look out a window, and enjoy your free moment!")))},{nodeHeight:Ki,framePadding:Hi}=Ae,zi=(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:Wi,nodeHeight:Bi,framePadding:ji}=Ae,Vi=e=>{const{hasDisableds:t,priorotizedStatus:o}=re(e.conditions||[]);return{nodeWidth:Wi,nodeHeight:Bi,id:e.ruleId,type:B.InstrumentationRule,status:o,faded:t,title:ve(e,B.InstrumentationRule,{prioritizeDisplayName:!0}),subTitle:e.type,icon:Re(e.type),isActive:!e.disabled,raw:e}},{nodeWidth:Ui,nodeHeight:_i,framePadding:Gi}=Ae,Ji=e=>{const{hasDisableds:t,priorotizedStatus:o}=re(e.conditions||[]);return{nodeWidth:Ui,nodeHeight:_i,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.signals,isActive:!e.disabled,raw:e}},{nodeWidth:Yi,nodeHeight:Xi,framePadding:Qi}=Ae,Zi=e=>{const{priorotizedStatus:t,hasDisableds:o}=re(e.conditions||[]);return{nodeWidth:Yi,nodeHeight:Xi,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:en,nodeHeight:tn}=Ae,{nodeWidth:on,nodeHeight:nn,framePadding:an}=Ae,ln=e=>{const{hasDisableds:t,priorotizedStatus:o}=re(e.conditions||[]),{icon:i,iconSrc:n}=Ke(e.destinationType.type);return{nodeWidth:on,nodeHeight:nn,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:qe(e.exportedSignals),isActive:!e.disabled,raw:e}},rn=d.div`
48
+ `,Hi=()=>{const[i,n]=t(0);return o(()=>{(async()=>{for(let e=0;e<=100;e+=5)await Ie(500),n(e)})()},[]),e.createElement(Li,null,e.createElement(Do,{size:100}),e.createElement(Ne,{width:400}),e.createElement(Pi,null,e.createElement(ce,{$gap:16},e.createElement(qi,null,"Preparing your workspace..."),e.createElement(Te,{label:`${i}%`})),e.createElement(Ki,null,"It can take up to a few minutes. Grab a cup of coffee, look out a window, and enjoy your free moment!")))},{nodeHeight:zi,framePadding:Wi}=Ae,ji=(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:Bi,nodeHeight:Vi,framePadding:Ui}=Ae,_i=e=>{const{hasDisableds:t,priorotizedStatus:o}=re(e.conditions||[]);return{nodeWidth:Bi,nodeHeight:Vi,id:e.ruleId,type:j.InstrumentationRule,status:o,faded:t,title:ve(e,j.InstrumentationRule,{prioritizeDisplayName:!0}),subTitle:e.type,icon:Re(e.type),isActive:!e.disabled,raw:e}},{nodeWidth:Gi,nodeHeight:Ji,framePadding:Yi}=Ae,Qi=e=>{const{hasDisableds:t,priorotizedStatus:o}=re(e.conditions||[]);return{nodeWidth:Gi,nodeHeight:Ji,id:e.id,type:j.Action,status:o,faded:t,title:ve(e,j.Action,{prioritizeDisplayName:!0}),subTitle:e.type,icon:G(e.type),monitors:e.signals,isActive:!e.disabled,raw:e}},{nodeWidth:Xi,nodeHeight:Zi,framePadding:en}=Ae,tn=e=>{const{priorotizedStatus:t,hasDisableds:o}=re(e.conditions||[]);return{nodeWidth:Xi,nodeHeight:Zi,id:{namespace:e.namespace,name:e.name,kind:e.kind},type:j.Source,status:t,faded:o,title:ve(e,j.Source,{extended:!0}),subTitle:`${e.namespace} • ${e.kind}`,icons:Le(e.containers),raw:e}},{nodeWidth:on,nodeHeight:nn}=Ae,{nodeWidth:an,nodeHeight:ln,framePadding:rn}=Ae,sn=e=>{const{hasDisableds:t,priorotizedStatus:o}=re(e.conditions||[]),{icon:i,iconSrc:n}=Ke(e.destinationType.type);return{nodeWidth:an,nodeHeight:ln,id:e.id,type:j.Destination,status:o,faded:t,title:ve(e,j.Destination,{prioritizeDisplayName:!0}),subTitle:e.destinationType.displayName,icon:i,iconSrc:n,monitors:qe(e.exportedSignals),isActive:!e.disabled,raw:e}},cn=d.div`
49
49
  width: 100%;
50
50
  height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px)`};
51
51
  position: relative;
52
- `,sn=({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:f,instrumentationRules:b,instrumentationRulesLoading:x}=V(),[C,$,k]=Jo([]),[S,w,D]=Yo([]);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=-Ki/2+Hi,r=Math.floor(i/Ki)*Ki-(Ki/2+Hi),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(zi(`${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(zi(`${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)-en-24,o=e=>tn*((e||0)+1);return{[B.Namespace]:{x:0,y:()=>0},[B.InstrumentationRule]:{x:24,y:o},[B.Source]:{x:Pe(e,[[0,1600,t/3.5],[1600,null,t/4]]),y:o},[B.Action]:{x:Pe(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=>Xo(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:Yi,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()-Qi},style:{zIndex:1},data:{nodeWidth:Yi,nodeHeight:n-Xi+2*Qi,items:t.map((e,t)=>({id:`${B.Source}-${t}`,data:Zi(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:Qi,y:r.y(t)-(Xi-Qi/2)},style:{zIndex:-1},data:Zi(e)})})):e?l.push({id:`${B.Source}-${Ee.Skeleton}`,type:Ee.Skeleton,position:{x:r.x,y:r.y()},data:{nodeWidth:Yi}}):l.push({id:`${B.Source}-${Ee.Add}`,type:Ee.Add,position:{x:r.x,y:r.y()},data:{nodeWidth:Yi,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:on,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()-an},style:{zIndex:1},data:{nodeWidth:on,nodeHeight:n-nn+2*an,items:t.map((e,t)=>({id:`${B.Destination}-${t}`,data:ln(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:an,y:r.y(t)-(nn-an/2)},style:{zIndex:-1},data:ln(e)})})):e?l.push({id:`${B.Destination}-${Ee.Skeleton}`,type:Ee.Skeleton,position:{x:r.x,y:r.y()},data:{nodeWidth:on}}):l.push({id:`${B.Destination}-${Ee.Add}`,type:Ee.Add,position:{x:r.x,y:r.y()},data:{nodeWidth:on,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:Ui,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()-Gi},style:{zIndex:1},data:{nodeWidth:Ui,nodeHeight:n-_i+2*Gi,items:t.map((e,t)=>({id:`${B.Action}-${t}`,data:Ji(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:Gi,y:r.y(t)-(_i-Gi/2)},style:{zIndex:-1},data:Ji(e)})}),l.push({id:`${B.Action}-${Ee.Frame}`,type:Ee.Frame,position:{x:r.x-Gi,y:r.y()-Gi},data:{nodeWidth:Ui+2*Gi,nodeHeight:Math.min(n,_i*t.length+Gi)}})):e?l.push({id:`${B.Action}-${Ee.Skeleton}`,type:Ee.Skeleton,position:{x:r.x,y:r.y()},data:{nodeWidth:Ui}}):l.push({id:`${B.Action}-${Ee.Add}`,type:Ee.Add,position:{x:r.x,y:r.y()},data:{nodeWidth:Ui,type:Fe.AddAction,title:p.ADD_ACTION,subTitle:p.TO_MODIFY_OTEL_DATA}}),l})({entities:ge(v,a),loading:f,unfilteredCount:v.length,positions:N,containerHeight:u,onScroll:({scrollTop:t})=>E(e,B.Action,t)});T(e,B.Action)},[v,f,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:Wi,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()-ji},style:{zIndex:1},data:{nodeWidth:Wi,nodeHeight:n-Bi+2*ji,items:t.map((e,t)=>({id:`${B.InstrumentationRule}-${t}`,data:Vi(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:ji,y:r.y(t)-(Bi-ji/2)},style:{zIndex:-1},data:Vi(e)})})):e?l.push({id:`${B.InstrumentationRule}-${Ee.Skeleton}`,type:Ee.Skeleton,position:{x:r.x,y:r.y()},data:{nodeWidth:Wi}}):l.push({id:`${B.InstrumentationRule}-${Ee.Add}`,type:Ee.Add,position:{x:r.x,y:r.y()},data:{nodeWidth:Wi,type:Fe.AddRule,title:p.ADD_INSTRUMENTATION_RULE,subTitle:p.TO_MODIFY_OTEL_DATA}}),l})({entities:b,loading:x,unfilteredCount:b.length,positions:N,containerHeight:u,onScroll:({scrollTop:t})=>E(e,B.InstrumentationRule,t)});T(e,B.InstrumentationRule)},[b,x,N[B.InstrumentationRule],u]),e.createElement(rn,{ref:c,$heightToRemove:t},e.createElement(_e,{nodes:C,edges:S,onNodesChange:k,onEdgesChange:D}))},cn=d.div`
52
+ `,dn=({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,$,k]=Qo([]),[S,w,D]=Xo([]);o(()=>w((({theme:e,nodes:t,metrics:o,containerHeight:i})=>{const n=[],a=t.find(({id:e})=>[`${j.Action}-${Ee.Frame}`,`${j.Action}-${Ee.Add}`].includes(e))?.id,l=-zi/2+Wi,r=Math.floor(i/zi)*zi-(zi/2+Wi),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===j.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(ji(`${i}-to-${a}`,{theme:e,animated:!1,isMultiTarget:!1,label:Oe(m?.throughput),isError:u===B.Error}))}if(c===j.Destination&&s(t)){const t=o?.destinations.find(e=>e.id===d);p.y>=l&&p.y<=r&&n.push(ji(`${a}-to-${i}`,{theme:e,animated:!1,isMultiTarget:!0,label:Oe(t?.throughput),isError:u===B.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)-on-24,o=e=>nn*((e||0)+1);return{[j.Namespace]:{x:0,y:()=>0},[j.InstrumentationRule]:{x:24,y:o},[j.Source]:{x:Pe(e,[[0,1600,t/3.5],[1600,null,t/4]]),y:o},[j.Action]:{x:Pe(e,[[0,1600,t/1.55],[1600,null,t/1.6]]),y:o},[j.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=>Zo(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=je(m,r),t=(({loading:e,entities:t,positions:o,unfilteredCount:i,containerHeight:n,onScroll:a})=>{const l=[],r=o[j.Source],s=t.length!==i;return l.push({id:`${j.Source}-${Ee.Header}`,type:Ee.Header,position:{x:o[j.Source].x,y:0},data:{nodeWidth:Xi,title:p.SOURCES,icon:$e(j.Source),badge:s?`${t.length}/${i}`:i,badgeTooltip:s?p.FILTERED_COUNT_TOOLTIP:void 0,isFetching:e,sources:t}}),t.length?(l.push({id:`${j.Source}-${Ee.Scroll}`,type:Ee.Scroll,position:{x:r.x,y:r.y()-en},style:{zIndex:1},data:{nodeWidth:Xi,nodeHeight:n-Zi+2*en,items:t.map((e,t)=>({id:`${j.Source}-${t}`,data:tn(e)})),onScroll:a}}),t.forEach((e,t)=>{l.push({id:`${j.Source}-${t}-hidden`,type:Ee.Edged,extent:"parent",parentId:`${j.Source}-${Ee.Scroll}`,position:{x:en,y:r.y(t)-(Zi-en/2)},style:{zIndex:-1},data:tn(e)})})):e?l.push({id:`${j.Source}-${Ee.Skeleton}`,type:Ee.Skeleton,position:{x:r.x,y:r.y()},data:{nodeWidth:Xi}}):l.push({id:`${j.Source}-${Ee.Add}`,type:Ee.Add,position:{x:r.x,y:r.y()},data:{nodeWidth:Xi,type:Fe.AddSource,title:p.ADD_SOURCE,subTitle:p.TO_COLLECT_OTEL_DATA}}),l})({entities:Be(e,a),loading:h||s,unfilteredCount:e.length,positions:N,containerHeight:u,onScroll:({scrollTop:e})=>E(t,j.Source,e)});T(t,j.Source)},[r,m,h,s,N[j.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[j.Destination];return l.push({id:`${j.Destination}-${Ee.Header}`,type:Ee.Header,position:{x:o[j.Destination].x,y:0},data:{nodeWidth:an,title:p.DESTINATIONS,icon:$e(j.Destination),badge:i,isFetching:e}}),t.length?(l.push({id:`${j.Destination}-${Ee.Scroll}`,type:Ee.Scroll,position:{x:r.x,y:r.y()-rn},style:{zIndex:1},data:{nodeWidth:an,nodeHeight:n-ln+2*rn,items:t.map((e,t)=>({id:`${j.Destination}-${t}`,data:sn(e)})),onScroll:a}}),t.forEach((e,t)=>{l.push({id:`${j.Destination}-${t}-hidden`,type:Ee.Edged,extent:"parent",parentId:`${j.Destination}-${Ee.Scroll}`,position:{x:rn,y:r.y(t)-(ln-rn/2)},style:{zIndex:-1},data:sn(e)})})):e?l.push({id:`${j.Destination}-${Ee.Skeleton}`,type:Ee.Skeleton,position:{x:r.x,y:r.y()},data:{nodeWidth:an}}):l.push({id:`${j.Destination}-${Ee.Add}`,type:Ee.Add,position:{x:r.x,y:r.y()},data:{nodeWidth:an,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,j.Destination,e)});T(t,j.Destination)},[r,g,y,N[j.Destination],a,u]),o(()=>{const e=(({loading:e,entities:t,positions:o,unfilteredCount:i,containerHeight:n,onScroll:a})=>{const l=[],r=o[j.Action];return l.push({id:`${j.Action}-${Ee.Header}`,type:Ee.Header,position:{x:o[j.Action].x,y:0},data:{nodeWidth:Gi,title:p.ACTIONS,icon:$e(j.Action),badge:i,isFetching:e}}),t.length?(l.push({id:`${j.Action}-${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:`${j.Action}-${t}`,data:Qi(e)})),onScroll:a}}),t.forEach((e,t)=>{l.push({id:`${j.Action}-${t}-hidden`,type:Ee.Edged,extent:"parent",parentId:`${j.Action}-${Ee.Scroll}`,position:{x:Yi,y:r.y(t)-(Ji-Yi/2)},style:{zIndex:-1},data:Qi(e)})}),l.push({id:`${j.Action}-${Ee.Frame}`,type:Ee.Frame,position:{x:r.x-Yi,y:r.y()-Yi},data:{nodeWidth:Gi+2*Yi,nodeHeight:Math.min(n,Ji*t.length+Yi)}})):e?l.push({id:`${j.Action}-${Ee.Skeleton}`,type:Ee.Skeleton,position:{x:r.x,y:r.y()},data:{nodeWidth:Gi}}):l.push({id:`${j.Action}-${Ee.Add}`,type:Ee.Add,position:{x:r.x,y:r.y()},data:{nodeWidth:Gi,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,j.Action,t)});T(e,j.Action)},[v,b,N[j.Action],a,u]),o(()=>{const e=(({loading:e,entities:t,positions:o,unfilteredCount:i,containerHeight:n,onScroll:a})=>{const l=[],r=o[j.InstrumentationRule];return l.push({id:`${j.InstrumentationRule}-${Ee.Header}`,type:Ee.Header,position:{x:o[j.InstrumentationRule].x,y:0},data:{nodeWidth:Bi,title:p.INSTRUMENTATION_RULES,icon:$e(j.InstrumentationRule),badge:i,isFetching:e}}),t.length?(l.push({id:`${j.InstrumentationRule}-${Ee.Scroll}`,type:Ee.Scroll,position:{x:r.x,y:r.y()-Ui},style:{zIndex:1},data:{nodeWidth:Bi,nodeHeight:n-Vi+2*Ui,items:t.map((e,t)=>({id:`${j.InstrumentationRule}-${t}`,data:_i(e)})),onScroll:a}}),t.forEach((e,t)=>{l.push({id:`${j.InstrumentationRule}-${t}-hidden`,type:Ee.Edged,extent:"parent",parentId:`${j.InstrumentationRule}-${Ee.Scroll}`,position:{x:Ui,y:r.y(t)-(Vi-Ui/2)},style:{zIndex:-1},data:_i(e)})})):e?l.push({id:`${j.InstrumentationRule}-${Ee.Skeleton}`,type:Ee.Skeleton,position:{x:r.x,y:r.y()},data:{nodeWidth:Bi}}):l.push({id:`${j.InstrumentationRule}-${Ee.Add}`,type:Ee.Add,position:{x:r.x,y:r.y()},data:{nodeWidth:Bi,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,j.InstrumentationRule,t)});T(e,j.InstrumentationRule)},[f,x,N[j.InstrumentationRule],u]),e.createElement(cn,{ref:c,$heightToRemove:t},e.createElement(_e,{nodes:C,edges:S,onNodesChange:k,onEdgesChange:D}))},un=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 n,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 dn=d.div`
66
+ `;const pn=d.div`
67
67
  display: flex;
68
68
  align-items: center;
69
69
  overflow-x: scroll;
70
- `,un=({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:f}=Je();o(()=>{g||(f(0,50),y(!0))},[g]);const[b,x]=t("all"),{categories:C,searchResults:$}=l(()=>Oi({instrumentationRules:m,sources:Be(d,c),actions:p,destinations:Ve(u,c),searchText:s,selectedCategory:b}),[m,d,p,u,c,s,b]);return $.length?e.createElement(Ye,{ref:h,isOpen:g,top:v.top,left:v.left,maxWidth:"420px",header:e.createElement(dn,null,C.map(({category:t,label:o,count:i})=>!!i&&e.createElement(Xe,{key:`category-select-${t}`,label:o,badgeLabel:i,isSelected:b===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"!==b?"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))},pn=({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),q({key:"Escape",active:s},c),e.createElement(cn,{ref:d},e.createElement(x,{placeholder:"Search",icon:wo,value:i,onChange:e=>a(e.target.value.toLowerCase()),onFocus:()=>r(!0)}),s&&!o?e.createElement(un,{onClose:c}):null)},mn=({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})},hn=({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})},gn=({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})},yn=({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})},vn=({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})},fn=({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})},bn=d.div`
70
+ `,mn=({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(()=>Ai({instrumentationRules:m,sources:je(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(pn,null,C.map(({category:t,label:o,count:i})=>!!i&&e.createElement(Qe,{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(T,{size:12,family:"secondary",color:n.text.darker_grey,style:{marginLeft:"16px"}},o),l.map((o,n)=>e.createElement(Qe,{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))},hn=({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),q({key:"Escape",active:s},c),e.createElement(un,{ref:d},e.createElement(x,{placeholder:"Search",icon:No,value:i,onChange:e=>a(e.target.value.toLowerCase()),onFocus:()=>r(!0)}),s&&!o?e.createElement(mn,{onClose:c}):null)},gn=({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})},yn=({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!==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(ot,{disabled:r||!c?.length,title:o,placeholder:"All",options:c,value:i,onSelect:n,onDeselect:a,...s})},vn=({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})},bn=({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})},fn=({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})},xn=({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})},Cn=d.div`
71
71
  display: flex;
72
72
  flex-direction: column;
73
73
  gap: 12px;
74
74
  padding: 12px;
75
- `,xn=d.div`
75
+ `,$n=d.div`
76
76
  padding: 12px 6px 6px 6px;
77
- `,Cn=d(at)`
77
+ `,kn=d(at)`
78
78
  font-size: 14px;
79
79
  ${({$color:e})=>`color: ${e};`}
80
- `,$n=d.div`
80
+ `,Sn=d.div`
81
81
  margin-left: auto;
82
- `,kn=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},Sn=()=>{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:f,monitors:b,languages:x,conditions:C,errors:$,onlyErrors:k,setAll:w,clearAll:D,getEmptyState:N}=he(),T=l(()=>Be(r,s),[r,s]),[E,O]=t({namespaces:v,kinds:f,monitors:b,languages:x,conditions:C,errors:$,onlyErrors:k}),[M,A]=t(kn(E));o(()=>{const e=c(lt.OVERVIEW_FILTERS,N());w(e)},[]),o(()=>{if(!m){const e={namespaces:v,kinds:f,monitors:b,languages:x,conditions:C,errors:$,onlyErrors:k};O(e),A(kn(e))}},[m,v,f,b,x,C,$,k]);const F=()=>{h(!1)},R=n(null);return et(R,F),q({key:"Escape",active:m},F),e.createElement(cn,{ref:R},e.createElement(Xe,{label:"Filters",icon:Do,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(Cn,{variant:"primary",onClick:()=>{d(lt.OVERVIEW_FILTERS,E),w(E),A(kn(E)),h(!1)}},"Apply"),e.createElement(Cn,{variant:"secondary",onClick:F},"Cancel"),e.createElement($n,null,e.createElement(Cn,{variant:"tertiary",onClick:()=>{u(lt.OVERVIEW_FILTERS),D(),O(N()),A(0),h(!1)},$color:i.text.error},"Reset")))},e.createElement(bn,null,e.createElement(vn,{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(fn,{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(gn,{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(yn,{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(mn,{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(xn,null,e.createElement(S,{title:"Show only sources with errors",initialValue:E.onlyErrors,onChange:e=>O(t=>({...t,errors:[],onlyErrors:e}))})),e.createElement(hn,{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}))))},wn=d.div`
82
+ `,wn=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},Dn=()=>{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:k,setAll:w,clearAll:D,getEmptyState:N}=he(),T=l(()=>je(r,s),[r,s]),[E,O]=t({namespaces:v,kinds:b,monitors:f,languages:x,conditions:C,errors:$,onlyErrors:k}),[M,A]=t(wn(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:k};O(e),A(wn(e))}},[m,v,b,f,x,C,$,k]);const F=()=>{h(!1)},R=n(null);return et(R,F),q({key:"Escape",active:m},F),e.createElement(un,{ref:R},e.createElement(Qe,{label:"Filters",icon:To,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(kn,{variant:"primary",onClick:()=>{d(lt.OVERVIEW_FILTERS,E),w(E),A(wn(E)),h(!1)}},"Apply"),e.createElement(kn,{variant:"secondary",onClick:F},"Cancel"),e.createElement(Sn,null,e.createElement(kn,{variant:"tertiary",onClick:()=>{u(lt.OVERVIEW_FILTERS),D(),O(N()),A(0),h(!1)},$color:i.text.error},"Reset")))},e.createElement(Cn,null,e.createElement(fn,{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(xn,{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(vn,{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(bn,{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(gn,{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($n,null,e.createElement(S,{title:"Show only sources with errors",initialValue:E.onlyErrors,onChange:e=>O(t=>({...t,errors:[],onlyErrors:e}))})),e.createElement(yn,{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}))))},Nn=d.div`
83
83
  display: flex;
84
84
  flex-direction: column;
85
85
  gap: 24px;
86
86
  padding: 4px;
87
- `,Dn=({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(wn,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)}))},Nn=d.div`
87
+ `,Tn=({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(Nn,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:B.Warning,message:p.DATA_STREAM_EXISTS_WARNING(a,r.name)}))},In=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
- `,Tn=({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:f}=st({name:a}),b=l(()=>{if(!o)return v();const e=c?.find(e=>e.name===a);return e?f(e):v(),e},[o,c,a]),x=s((e,t)=>{h(e,t),p(!0)},[h]);return b?e.createElement(Ci,{ref:d,title:b.name,icons:[No],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(Nn,null,e.createElement(Dn,{formData:m,handleFormChange:x,formErrors:g}))):null},In=d.div`
93
+ `,En=({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 v();const e=c?.find(e=>e.name===a);return e?b(e):v(),e},[o,c,a]),x=s((e,t)=>{h(e,t),p(!0)},[h]);return f?e.createElement(ki,{ref:d,title:f.name,icons:[Io],hideEditTitleFromEdit:!0,isEdit:!0,isFormDirty:u,onSave:()=>{y({withAlert:!0,alertTitle:Q.Update})&&(r(a,m),p(!1),i())},onCancel:()=>{v(),p(!1),i()}},e.createElement(In,null,e.createElement(Tn,{formData:m,handleFormChange:x,formErrors:g}))):null},On=d.div`
94
94
  position: relative;
95
- `,En=d(ce)`
95
+ `,Mn=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
- `,On=d(T)`
102
+ `,An=d(T)`
103
103
  text-wrap: nowrap;
104
- `,Mn=d(Qe)`
104
+ `,Fn=d(Xe)`
105
105
  max-height: 240px;
106
106
  padding: 0px !important;
107
- `,An=d(ce)`
107
+ `,Rn=d(ce)`
108
108
  width: 100%;
109
- `,Fn=d.div`
109
+ `,Ln=d.div`
110
110
  width: 100%;
111
- `,Rn=({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,f]=t(""),[b,C]=t(""),$=l(()=>r.filter(({name:e})=>!b||e.toLowerCase().includes(b.toLowerCase())).map(({name:t})=>e.createElement(An,{key:`stream-${t}`},e.createElement(Fn,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:()=>f(t),tooltip:K.DELETE},e.createElement(ko,null)),e.createElement(dt,{onClick:()=>y(t),tooltip:K.EDIT},e.createElement($o,null)))),[r,s,b]);return e.createElement(e.Fragment,null,e.createElement(In,null,e.createElement(En,{$gap:0},e.createElement(at,{variant:"tertiary",onClick:()=>{h(0,50),p(e=>!e)}},e.createElement(No,{fill:a.text.info}),e.createElement(On,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:()=>o(),label:K.NEW})),e.createElement(Ye,{ref:d,isOpen:u,top:m.top,left:m.left,header:e.createElement(x,{placeholder:"Search...",icon:wo,value:b,onChange:e=>C(e.target.value)})},e.createElement(Mn,null,$))),e.createElement(z,{isOpen:""!==v,name:v,onApprove:()=>{n(v),f("")},onDeny:()=>{f("")}}),e.createElement(Tn,{isOpen:""!==g,onClose:()=>{y("")},dataStreamName:g,updateDataStream:i}))},Ln=d.div`
111
+ `,Pn=({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(Rn,{key:`stream-${t}`},e.createElement(Ln,null,e.createElement(Qe,{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(wo,null)),e.createElement(dt,{onClick:()=>y(t),tooltip:K.EDIT},e.createElement(So,null)))),[r,s,f]);return e.createElement(e.Fragment,null,e.createElement(On,null,e.createElement(Mn,{$gap:0},e.createElement(at,{variant:"tertiary",onClick:()=>{h(0,50),p(e=>!e)}},e.createElement(Io,{fill:a.text.info}),e.createElement(An,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:()=>o(),label:K.NEW})),e.createElement(Ye,{ref:d,isOpen:u,top:m.top,left:m.left,header:e.createElement(x,{placeholder:"Search...",icon:No,value:f,onChange:e=>C(e.target.value)})},e.createElement(Fn,null,$))),e.createElement(z,{isOpen:""!==v,name:v,onApprove:()=>{n(v),b("")},onDeny:()=>{b("")}}),e.createElement(En,{isOpen:""!==g,onClose:()=>{y("")},dataStreamName:g,updateDataStream:i}))},qn=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
- `,Pn=d.div`
117
+ `,Kn=d.div`
118
118
  margin-left: auto;
119
- `,qn=({addEntity:t,preventSearchPopup:o,onClickNewDataStream:i,updateDataStream:n,deleteDataStream:a})=>{const{setCurrentModal:l}=Z();return e.createElement(Ln,null,e.createElement(Rn,{onClickNewDataStream:i,updateDataStream:n,deleteDataStream:a}),e.createElement(pn,{preventPopup:o}),e.createElement(Sn,null),t&&e.createElement(Pn,null,e.createElement(pt,{"data-id":`add-${t}`,onClick:()=>l(t),label:`${K.ADD} ${tt(t)}`,variant:"primary",textProps:{weight:900}})))},Kn=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(Dn,{formData:l,handleFormChange:r,formErrors:s})))});Kn.displayName=Kn.name;const Hn=({createDataStream:t})=>{const{currentModal:o,setCurrentModal:i}=Z(),{addDataStreams:a,setSelectedStreamName:l}=He(),r=o===ht.DataStream,s=()=>i(""),c=async()=>{if(d.current&&d.current.validateForm()){const e=d.current.getFormValues();t?t(e):(a([e]),l(e.name)),s()}},d=n(null);return q({key:"Enter",active:r},c),e.createElement(ee,{isOpen:r,onClose:s,header:{title:"Add Data Stream"},actionComponent:e.createElement(te,{buttons:[{label:"DONE",variant:"primary",onClick:c}]})},e.createElement(Kn,{ref:d,isModal:!0}))},zn=e=>Object.keys(e).filter(t=>e[t]).join(", "),Wn=(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:zn(n)},{title:p.NAME,value:o.displayName}],l=gt(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||!yt(c,qe(n),r)){const{type:e}=vt(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},Bn=({signals:t,fields:o,onChange:i,formErrors:n})=>o?.map(a=>{const{componentType:l,renderCondition:r,...s}=a;if(r&&!yt(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?vt(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?vt(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}}),jn=d(at)`
119
+ `,Hn=({addEntity:t,preventSearchPopup:o,onClickNewDataStream:i,updateDataStream:n,deleteDataStream:a})=>{const{setCurrentModal:l}=Z();return e.createElement(qn,null,e.createElement(Pn,{onClickNewDataStream:i,updateDataStream:n,deleteDataStream:a}),e.createElement(hn,{preventPopup:o}),e.createElement(Dn,null),t&&e.createElement(Kn,null,e.createElement(pt,{"data-id":`add-${t}`,onClick:()=>l(t),label:`${K.ADD} ${tt(t)}`,variant:"primary",textProps:{weight:900}})))},zn=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(X,{$gap:24},o&&e.createElement(mt,{onClick:o}),e.createElement(O,{title:p.NAME_YOUR_STREAM,description:p.STREAM_DESCRIPTION}),e.createElement(Tn,{formData:l,handleFormChange:r,formErrors:s})))});zn.displayName=zn.name;const Wn=({createDataStream:t})=>{const{currentModal:o,setCurrentModal:i}=Z(),{addDataStreams:a,setSelectedStreamName:l}=He(),r=o===ht.DataStream,s=()=>i(""),c=async()=>{if(d.current&&d.current.validateForm()){const e=d.current.getFormValues();t?t(e):(a([e]),l(e.name)),s()}},d=n(null);return q({key:"Enter",active:r},c),e.createElement(ee,{isOpen:r,onClose:s,header:{title:"Add Data Stream"},actionComponent:e.createElement(te,{buttons:[{label:"DONE",variant:"primary",onClick:c}]})},e.createElement(zn,{ref:d,isModal:!0}))},jn=e=>Object.keys(e).filter(t=>e[t]).join(", "),Bn=(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:jn(n)},{title:p.NAME,value:o.displayName}],l=gt(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||!yt(c,qe(n),r)){const{type:e}=vt(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},Vn=({signals:t,fields:o,onChange:i,formErrors:n})=>o?.map(a=>{const{componentType:l,renderCondition:r,...s}=a;if(r&&!yt(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?vt(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?vt(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}}),Un=d(at)`
120
120
  display: flex;
121
121
  align-items: center;
122
122
  gap: 8px;
123
123
 
124
- ${({$status:e,theme:t})=>e===j.Success?u`
124
+ ${({$status:e,theme:t})=>e===B.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 n,useImperative
130
130
  `:u`
131
131
  background-color: transparent;
132
132
  `}
133
- `,Vn=({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(jn,{$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(ft,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"))},Un=d(Q)`
133
+ `,_n=({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(Un,{$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(bt,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===B.Success?"Connection OK":"error"===n?"Connection Failed":"Test Connection"))},Gn=d(X)`
134
134
  align-items: unset;
135
135
  padding: 0 4px;
136
- `,_n=d.div`
136
+ `,Jn=d.div`
137
137
  display: flex;
138
138
  flex-direction: column;
139
139
  gap: 12px;
140
- `,Gn=d(ce)`
140
+ `,Yn=d(ce)`
141
141
  justify-content: space-between;
142
- `,Jn=d(T)`
142
+ `,Qn=d(T)`
143
143
  margin-bottom: 12px;
144
- `,Yn=({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:f}=a||{},b=I.useTheme(),[C,$]=t(!1),[k,S]=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,k]);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),S(!0),D(void 0)};return e.createElement(Un,{$gap:24},e.createElement(Un,{$gap:12},e.createElement(O,{title:i?"Update destination":"Create destination",description:`Connect ${y} with Odigos.`,actionButton:f&&e.createElement(Vn,{destination:r,validateForm:c,status:w?.type,testConnection:h,onError:e=>{S(!1),D({type:j.Error,title:e?.reason||"Connection failed",message:e?.message||"Please check your input and try again."})},onSuccess:e=>{S(!1),D({type:j.Success,title:e?.reason||"Connection succeeded",message:e?.message||""})}})}),e.createElement(_n,null,f&&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(Gn,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(Jn,null,"Status"),e.createElement(E,{options:[{icon:xo,label:p.ENABLED,value:!1,selectedBgColor:b.text.success+I.opacity.hex["050"]},{icon:Co,label:p.DISABLED,value:!0,selectedBgColor:b.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(Bn,{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}))},Xn=d.div`
144
+ `,Xn=({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),[k,S]=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,k]);const T=l(()=>{const{logs:e,metrics:t,traces:o}=v||{},i=[];return e?.supported&&i.push(ft.Logs),t?.supported&&i.push(ft.Metrics),o?.supported&&i.push(ft.Traces),i},[v]),F=l(()=>{const{logs:e,metrics:t,traces:o}=r.exportedSignals||{},i=[];return e&&i.push(ft.Logs),t&&i.push(ft.Metrics),o&&i.push(ft.Traces),i},[r.exportedSignals]),R=()=>{$(!1),S(!0),D(void 0)};return e.createElement(Gn,{$gap:24},e.createElement(Gn,{$gap:12},e.createElement(O,{title:i?"Update destination":"Create destination",description:`Connect ${y} with Odigos.`,actionButton:b&&e.createElement(_n,{destination:r,validateForm:c,status:w?.type,testConnection:h,onError:e=>{S(!1),D({type:B.Error,title:e?.reason||"Connection failed",message:e?.message||"Please check your input and try again."})},onSuccess:e=>{S(!1),D({type:B.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:B.Default,message:`Odigos autocompleted ${y} destination details.`})),e.createElement(le,null)),e.createElement(Yn,null,e.createElement(A,{title:i?"":"This connection will monitor:",required:!0,allowedSignals:T,selectedSignals:F,setSelectedSignals:e=>{R(),d("exportedSignals",{logs:e.includes(ft.Logs),metrics:e.includes(ft.Metrics),traces:e.includes(ft.Traces)})},errorMessage:s.exportedSignals}),!i&&e.createElement(M,{endpoint:`/backends/${g}`})),i&&e.createElement("div",null,e.createElement(Qn,null,"Status"),e.createElement(E,{options:[{icon:$o,label:p.ENABLED,value:!1,selectedBgColor:f.text.success+I.opacity.hex["050"]},{icon:ko,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(Vn,{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}))},Zn=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
- `,Qn=d.div`
150
+ `,ea=d.div`
151
151
  display: flex;
152
152
  flex-direction: column;
153
153
  gap: 12px;
154
- `,Zn=({categories:o,updateDestination:i,deleteDestination:a,testConnection:r})=>{const{destinations:s}=V(),{selectedStreamName:c}=He(),{drawerType:d,drawerEntityId:u}=P(),m=l(()=>Ve(s,c),[s,c]),h=n(null),g=d!==B.Destination,[y,v]=t(!1),[f,b]=t(!1),{formData:x,formErrors:C,handleFormChange:$,resetFormData:k,validateForm:S,loadFormWithDrawerItem:w,yamlFields:D,setYamlFields:N,dynamicFields:T,setDynamicFields:I}=xt({}),E=l(()=>{if(g)return k();const e=m?.find(e=>e.id===u);return e?(w(e),N(Ct(o,e))):k(),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(Ci,{ref:h,title:E.name||E.destinationType.displayName,icons:M?[M]:void 0,iconSrcs:A?[A]:void 0,isEdit:y,isFormDirty:f,onEdit:e=>{v("boolean"!=typeof e||e)},onSave:async e=>{if(S({withAlert:!0,alertTitle:X.Update})){const t=e!==E.destinationType.displayName?e:"";$("name",t),i(u,{...x,name:t}),v(!1),b(!1)}},onDelete:async()=>{a(u),v(!1),b(!1),h.current?.closeDrawer()},onCancel:()=>{v(!1),b(!1),w(E)},isLastItem:1===m.length},y?e.createElement(Xn,null,e.createElement(Yn,{isUpdate:!0,categoryItem:O,formData:x,formErrors:C,handleFormChange:(...e)=>{b(!0),$(...e)},dynamicFields:T,setDynamicFields:(...e)=>{b(!0),I(...e)},validateForm:S,testConnection:r})):e.createElement(Qn,null,E.conditions?.length?e.createElement(J,{conditions:E.conditions}):null,e.createElement(Y,{title:p.DESTINATION_DETAILS,data:E?Wn(E,D):[]})))},ea=d.div`
154
+ `,ta=({categories:o,updateDestination:i,deleteDestination:a,testConnection:r})=>{const{destinations:s}=V(),{selectedStreamName:c}=He(),{drawerType:d,drawerEntityId:u}=P(),m=l(()=>Ve(s,c),[s,c]),h=n(null),g=d!==j.Destination,[y,v]=t(!1),[b,f]=t(!1),{formData:x,formErrors:C,handleFormChange:$,resetFormData:k,validateForm:S,loadFormWithDrawerItem:w,yamlFields:D,setYamlFields:N,dynamicFields:T,setDynamicFields:I}=xt({}),E=l(()=>{if(g)return k();const e=m?.find(e=>e.id===u);return e?(w(e),N(Ct(o,e))):k(),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(ki,{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(S({withAlert:!0,alertTitle:Q.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),h.current?.closeDrawer()},onCancel:()=>{v(!1),f(!1),w(E)},isLastItem:1===m.length},y?e.createElement(Zn,null,e.createElement(Xn,{isUpdate:!0,categoryItem:O,formData:x,formErrors:C,handleFormChange:(...e)=>{f(!0),$(...e)},dynamicFields:T,setDynamicFields:(...e)=>{f(!0),I(...e)},validateForm:S,testConnection:r})):e.createElement(ea,null,E.conditions?.length?e.createElement(J,{conditions:E.conditions}):null,e.createElement(Y,{title:p.DESTINATION_DETAILS,data:E?Bn(E,D):[]})))},oa=d.div`
155
155
  display: flex;
156
156
  flex-direction: column;
157
157
  gap: 12px;
158
- `,ta=({items:t,onSelectNew:o,onSelectConfigured:i,isLoadingForDestinationIds:n})=>{const{configuredDestinationsUpdateOnly:a}=$t();return t.map(t=>{const l=t.name===wt.EXISTS.TITLE;return e.createElement(ea,{key:`category-${t.name}`},e.createElement(O,{size:"small",icon:t.icon,title:kt(t.name),description:t.description}),t.items.map(r=>{const s=`select-${t.name.replaceAll(" ","")}-destination-${r.type}`,c=Object.keys(r.supportedSignals).filter(e=>r.supportedSignals[e].supported),{icon:d,iconSrc:u}=Ke(r.type),p=r.selected||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)}})}))})},oa=d.div`
158
+ `,ia=({items:t,onSelectNew:o,onSelectConfigured:i,isLoadingForDestinationIds:n})=>{const{configuredDestinationsUpdateOnly:a}=$t();return t.map(t=>{const l=t.name===wt.EXISTS.TITLE;return e.createElement(oa,{key:`category-${t.name}`},e.createElement(O,{size:"small",icon:t.icon,title:kt(t.name),description:t.description}),t.items.map(r=>{const s=`select-${t.name.replaceAll(" ","")}-destination-${r.type}`,c=Object.keys(r.supportedSignals).filter(e=>r.supportedSignals[e].supported),{icon:d,iconSrc:u}=Ke(r.type),p=r.selected||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)}})}))})},na=d.div`
159
159
  display: flex;
160
160
  flex-direction: column;
161
161
  gap: 24px;
162
- `,ia=d.div`
162
+ `,aa=d.div`
163
163
  display: flex;
164
164
  align-items: center;
165
165
  gap: 12px;
166
- `,na=d.div`
166
+ `,la=d.div`
167
167
  width: 170px;
168
168
  margin-right: 8px;
169
- `,aa=d.div`
169
+ `,ra=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 n,useImperative
177
177
  @media (height < 800px) {
178
178
  max-height: calc(100vh - 400px);
179
179
  }
180
- `,la=d(oa)`
180
+ `,sa=d(na)`
181
181
  margin-top: 80px;
182
- `,{MANAGED:ra,SELF_HOSTED:sa,DETECTED:ca,EXISTS:da}=wt,ua=[{value:"All types",id:"all"},{value:ra.TITLE,id:ra.TITLE},{value:sa.TITLE,id:sa.TITLE},{value:ca.TITLE,id:ca.TITLE},{value:da.TITLE,id:da.TITLE}],pa=ua[0],ma=[bt.Logs,bt.Metrics,bt.Traces],ha=(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}}}}),ga=({hidden:o,categories:i,potentialDestinations:n,onSelectNew:a,onSelectConfigured:r,isLoadingForDestinationIds:s})=>{const{destinations:c}=V(),{selectedStreamName:d}=He(),{configuredDestinations:u,configuredDestinationsUpdateOnly:p}=$t(),[m,h]=t(""),[g,y]=t(pa),[v,f]=t(ma),b=l(()=>{const e=Dt(i);return e.unshift({name:da.TITLE,description:da.DESCRIPTION,icon:To,items:ha(c,d,new Set(u.concat(p).map(e=>e.id)))}),e.unshift({name:ca.TITLE,description:ca.DESCRIPTION,icon:Io,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(oa,null,e.createElement(O,{title:"Choose destination",description:"Add backend destination you want to connect with Odigos."}),e.createElement(ia,null,e.createElement(na,null,e.createElement(x,{placeholder:"Search...",icon:wo,value:m,onChange:({target:{value:e}})=>h(e)})),e.createElement(na,null,e.createElement(ot,{options:ua,value:g,onSelect:y,onDeselect:()=>{}})),e.createElement(A,{title:"",selectedSignals:v,setSelectedSignals:f})),e.createElement(le,null),b.length?e.createElement(aa,null,e.createElement(ta,{items:b,onSelectNew:e=>a(e,v),onSelectConfigured:r,isLoadingForDestinationIds:s})):e.createElement(la,null,e.createElement(De,{title:"No destinations found"})))},ya=d.div`
182
+ `,{MANAGED:ca,SELF_HOSTED:da,DETECTED:ua,EXISTS:pa}=wt,ma=[{value:"All types",id:"all"},{value:ca.TITLE,id:ca.TITLE},{value:da.TITLE,id:da.TITLE},{value:ua.TITLE,id:ua.TITLE},{value:pa.TITLE,id:pa.TITLE}],ha=ma[0],ga=[ft.Logs,ft.Metrics,ft.Traces],ya=(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:{[ft.Logs]:{supported:e.exportedSignals.logs},[ft.Metrics]:{supported:e.exportedSignals.metrics},[ft.Traces]:{supported:e.exportedSignals.traces}}}}),va=({hidden:o,categories:i,potentialDestinations:n,onSelectNew:a,onSelectConfigured:r,isLoadingForDestinationIds:s})=>{const{destinations:c}=V(),{selectedStreamName:d}=He(),{configuredDestinations:u,configuredDestinationsUpdateOnly:p}=$t(),[m,h]=t(""),[g,y]=t(ha),[v,b]=t(ga),f=l(()=>{const e=Dt(i);return e.unshift({name:pa.TITLE,description:pa.DESCRIPTION,icon:Eo,items:ya(c,d,new Set(u.concat(p).map(e=>e.id)))}),e.unshift({name:ua.TITLE,description:ua.DESCRIPTION,icon:Oo,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(na,null,e.createElement(O,{title:"Choose destination",description:"Add backend destination you want to connect with Odigos."}),e.createElement(aa,null,e.createElement(la,null,e.createElement(x,{placeholder:"Search...",icon:No,value:m,onChange:({target:{value:e}})=>h(e)})),e.createElement(la,null,e.createElement(ot,{options:ma,value:g,onSelect:y,onDeselect:()=>{}})),e.createElement(A,{title:"",selectedSignals:v,setSelectedSignals:b})),e.createElement(le,null),f.length?e.createElement(ra,null,e.createElement(ia,{items:f,onSelectNew:e=>a(e,v),onSelectConfigured:r,isLoadingForDestinationIds:s})):e.createElement(sa,null,e.createElement(De,{title:"No destinations found"})))},ba=d.div`
183
183
  display: flex;
184
- `,va=d.div`
184
+ `,fa=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
- `,fa=({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}=$t(),f=u===B.Destination,[b,x]=t(void 0),{formData:C,formErrors:$,handleFormChange:k,resetFormData:S,validateForm:w,setYamlFields:D,dynamicFields:N,setDynamicFields:T,loadFormWithDrawerItem:I}=xt({supportedSignals:b?.supportedSignals,preLoadedFields:b?.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:b.type,displayName:b.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=()=>{S(),x(void 0),m("")},R=()=>{S(),x(void 0)},L=async()=>{if(b){if(!w({withAlert:!o,alertTitle:X.Create}))return null;A()}F()};return q({key:"Enter",active:f},()=>L()),e.createElement(ee,{isOpen:f,onClose:F,header:{title:p.ADD_DESTINATION},actionComponent:e.createElement(te,{buttons:(()=>{const e=[{label:"DONE",variant:"primary",onClick:L}];return b&&e.unshift({label:"BACK",icon:Eo,variant:"secondary",onClick:R}),e})()})},e.createElement(ya,null,e.createElement(va,null,e.createElement(Nt,{currentStep:b?2:1,data:[{stepNumber:1,title:p.DESTINATIONS},{stepNumber:2,title:p.CONNECTION}]})),e.createElement(oe,{style:{margin:"32px 24px 12px 24px"}},e.createElement(ga,{hidden:void 0!==b,categories:i,potentialDestinations:n,onSelectNew:(e,t)=>{S(),k("type",e?.type||""),k("currentStreamName",d);const o={logs:!1,metrics:!1,traces:!1};t.filter(t=>e.supportedSignals[t].supported).forEach(e=>o[e]=!0),k("exportedSignals",o),D(e?.fields||[]),x(e)},onSelectConfigured:e=>{const t=c.find(t=>t.id===e);t&&A(t)},isLoadingForDestinationIds:E}),b&&e.createElement(Yn,{categoryItem:b,formData:C,formErrors:$,handleFormChange:k,dynamicFields:N,setDynamicFields:T,validateForm:w,testConnection:s}))))},ba=d.div`
191
+ `,xa=({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}=$t(),b=u===j.Destination,[f,x]=t(void 0),{formData:C,formErrors:$,handleFormChange:k,resetFormData:S,validateForm:w,setYamlFields:D,dynamicFields:N,setDynamicFields:T,loadFormWithDrawerItem:I}=xt({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=()=>{S(),x(void 0),m("")},R=()=>{S(),x(void 0)},L=async()=>{if(f){if(!w({withAlert:!o,alertTitle:Q.Create}))return null;A()}F()};return q({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:Mo,variant:"secondary",onClick:R}),e})()})},e.createElement(ba,null,e.createElement(fa,null,e.createElement(Nt,{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(va,{hidden:void 0!==f,categories:i,potentialDestinations:n,onSelectNew:(e,t)=>{S(),k("type",e?.type||""),k("currentStreamName",d);const o={logs:!1,metrics:!1,traces:!1};t.filter(t=>e.supportedSignals[t].supported).forEach(e=>o[e]=!0),k("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(Xn,{categoryItem:f,formData:C,formErrors:$,handleFormChange:k,dynamicFields:N,setDynamicFields:T,validateForm:w,testConnection:s}))))},Ca=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 n,useImperative
197
197
  max-height: calc(100vh - 310px);
198
198
  height: fit-content;
199
199
  overflow-y: scroll;
200
- `,xa=({categories:t,withDelete:o})=>{const{configuredDestinations:i,configuredDestinationsUpdateOnly:n}=$t();return i.length||n.length?e.createElement(ba,null,i.concat(n).map((a,l)=>e.createElement(Ca,{key:`configured-destination-${a.destinationType.type}-${l}`,"data-id":`configured-destination-${a.destinationType.type}`,item:a,yamlFields:Ct(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"}))},Ca=({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}=$t(),m=l(()=>gt(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:qe(o.exportedSignals),monitorsWithLabels:!0},extendableProps:{withExtend:!0,renderExtended:()=>e.createElement(Tt,{data:m})},renderActions:a?()=>e.createElement(dt,{onClick:()=>s(!0)},e.createElement(ko,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)}))},$a=d(at)`
200
+ `,$a=({categories:t,withDelete:o})=>{const{configuredDestinations:i,configuredDestinationsUpdateOnly:n}=$t();return i.length||n.length?e.createElement(Ca,null,i.concat(n).map((a,l)=>e.createElement(ka,{key:`configured-destination-${a.destinationType.type}-${l}`,"data-id":`configured-destination-${a.destinationType.type}`,item:a,yamlFields:Ct(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"}))},ka=({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}=$t(),m=l(()=>gt(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:qe(o.exportedSignals),monitorsWithLabels:!0},extendableProps:{withExtend:!0,renderExtended:()=>e.createElement(Tt,{data:m})},renderActions:a?()=>e.createElement(dt,{onClick:()=>s(!0)},e.createElement(wo,null)):void 0}),a&&e.createElement(z,{isOpen:r,name:o.destinationType.displayName||o.name,type:j.Destination,isLastItem:n,onApprove:()=>{o.id?p(o):u(o)},onDeny:()=>s(!1)}))},Sa=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 n,useImperative
206
206
  padding: 32px;
207
207
  border-radius: 16px;
208
208
  border-style: dashed !important;
209
- `,ka=({isSourcesListEmpty:t,goToSources:o,categories:i,potentialDestinations:n,testConnection:a,onClickSummary:l})=>{const r=I.useTheme(),{setCurrentModal:s}=Z(),{configuredDestinations:c,configuredDestinationsUpdateOnly:d}=$t();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($a,{variant:"secondary",onClick:()=>s(B.Destination)},e.createElement(Oo,null),e.createElement(T,{color:r.colors.secondary,size:14,decoration:"underline",family:"secondary"},p.ADD_DESTINATION))),e.createElement(xa,{categories:i,withDelete:!0}))),e.createElement(fa,{isOnboarding:!0,categories:i,potentialDestinations:n,updateDestination:async()=>{},createDestination:async()=>{},deleteDestination:async()=>{},testConnection:a}))},Sa=[{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}],wa=({metrics:t,maxHeight:o,maxWidth:i})=>{const n=I.useTheme(),a=he(),{selectedStreamName:r}=He(),{setDrawerType:s,setDrawerEntityId:c}=P(),{destinations:d,destinationsLoading:u}=V(),m=l(()=>Ve(d,r),[d,r]),h=l(()=>Oi({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(It(t,B.Destination,o.id).throughput),textColor:n.text.info},{columnKey:"signals",component:()=>e.createElement(fe,{withLabels:!0,monitors:qe(o.exportedSignals)})},{columnKey:"conditions",component:()=>o.conditions?.length?e.createElement(Ii,{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(be,{$maxWidth:i},e.createElement(xe,null,e.createElement(Ce,{icon:$e(B.Destination),title:p.DESTINATIONS,badge:y,badgeTooltip:v,loading:u})),e.createElement(ke,{$maxHeight:o},e.createElement(Se,{columns:Sa,rows:g})),!h.length&&e.createElement(we,{style:{marginTop:"2rem"}},e.createElement(De,null)))},Da=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[Et.HeaderKeys]||[]).filter(e=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(c){const e=(c[Ot.Java]||[]).map(e=>`${e.className}.${e.methodName}`).join("\r\n");e&&d.push({title:p.JAVA_CUSTOM_PROBES,value:e});const t=(c[Ot.Golang]||[]).map(e=>{const t=e.packageName;return e.functionName?`${t}.${e.functionName}`:e.receiverName&&e.receiverMethodName?`${t}.(${e.receiverName}).${e.receiverMethodName}`:null}).filter(Boolean).join("\r\n");t&&d.push({title:p.GOLANG_CUSTOM_PROBES,value:t})}return d},Na=d.div`
209
+ `,wa=({isSourcesListEmpty:t,goToSources:o,categories:i,potentialDestinations:n,testConnection:a,onClickSummary:l})=>{const r=I.useTheme(),{setCurrentModal:s}=Z(),{configuredDestinations:c,configuredDestinationsUpdateOnly:d}=$t();return e.createElement(e.Fragment,null,e.createElement(oe,{$isNotModal:!0},e.createElement(X,{$gap:12},e.createElement(X,{$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:B.Warning,message:p.NO_SOURCES_GO_BACK,action:{label:p.SELECT_SOURCES,onClick:o}}),e.createElement(Sa,{variant:"secondary",onClick:()=>s(j.Destination)},e.createElement(Ao,null),e.createElement(T,{color:r.colors.secondary,size:14,decoration:"underline",family:"secondary"},p.ADD_DESTINATION))),e.createElement($a,{categories:i,withDelete:!0}))),e.createElement(xa,{isOnboarding:!0,categories:i,potentialDestinations:n,updateDestination:async()=>{},createDestination:async()=>{},deleteDestination:async()=>{},testConnection:a}))},Da=[{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}],Na=({metrics:t,maxHeight:o,maxWidth:i})=>{const n=I.useTheme(),a=he(),{selectedStreamName:r}=He(),{setDrawerType:s,setDrawerEntityId:c}=P(),{destinations:d,destinationsLoading:u}=V(),m=l(()=>Ve(d,r),[d,r]),h=l(()=>Ai({instrumentationRules:[],sources:[],actions:[],destinations:Ue(m,a),searchText:a.searchText,selectedCategory:j.Destination}).searchResults.find(({category:e})=>e===j.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?B.Error:a?B.Warning:void 0,faded:l,onClick:()=>{s(j.Destination),c(o.id)},cells:[{columnKey:"icon",component:()=>e.createElement(ye,{icon:r,src:d})},{columnKey:"name",value:ve(o,j.Destination,{prioritizeDisplayName:!0})},{columnKey:"type",value:o.destinationType.type,textColor:n.text.info},{columnKey:"throughput",value:Oe(It(t,j.Destination,o.id).throughput),textColor:n.text.info},{columnKey:"signals",component:()=>e.createElement(be,{withLabels:!0,monitors:qe(o.exportedSignals)})},{columnKey:"conditions",component:()=>o.conditions?.length?e.createElement(Oi,{conditions:o.conditions,id:o.id}):null},{columnKey:"active-status",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{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(fe,{$maxWidth:i},e.createElement(xe,null,e.createElement(Ce,{icon:$e(j.Destination),title:p.DESTINATIONS,badge:y,badgeTooltip:v,loading:u})),e.createElement(ke,{$maxHeight:o},e.createElement(Se,{columns:Da,rows:g})),!h.length&&e.createElement(we,{style:{marginTop:"2rem"}},e.createElement(De,null)))},Ta=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[Et.HeaderKeys]||[]).filter(e=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(c){const e=(c[Mt.Java]||[]).map(e=>new Ot(e.className,e.methodName)).map(e=>`• ${e.toString()}`).join("\r\n");e&&d.push({title:p.JAVA_CUSTOM_PROBES,value:e});const t=(c[Mt.Golang]||[]).map(e=>new At(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)).map(e=>`• ${e.toString()}`).join("\r\n");t&&d.push({title:p.GOLANG_CUSTOM_PROBES,value:t})}return d},Ia=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 n,useImperative
216
216
  border-radius: 16px;
217
217
  padding: 8px;
218
218
  `}
219
- `,Ta=[{id:Mt.FilePath,label:"Collect File Path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Mt.Function,label:"Collect Function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Mt.LineNumber,label:"Collect Line Number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],Ia=[{id:Mt.Column,label:"Collect Column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Mt.Namespace,label:"Collect Namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Mt.StackTrace,label:"Collect Stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],Ea={[Ot.Java]:[{className:"",methodName:""}],[Ot.Golang]:[{packageName:"",functionName:"",receiverName:"",receiverMethodName:""}]},Oa=["*"],Ma=d.div`
219
+ `,Ea=[{id:Ft.FilePath,label:"Collect File Path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Ft.Function,label:"Collect Function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Ft.LineNumber,label:"Collect Line Number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],Oa=[{id:Ft.Column,label:"Collect Column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Ft.Namespace,label:"Collect Namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Ft.StackTrace,label:"Collect Stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],Ma={[Mt.Java]:[new Ot("","")],[Mt.Golang]:[new At("")]},Aa=["*"],Fa=d.div`
220
220
  display: flex;
221
221
  flex-direction: column;
222
222
  gap: 12px;
@@ -226,27 +226,27 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
226
226
  border-radius: 16px;
227
227
  padding: 8px;
228
228
  `}
229
- `,Aa=[{id:At.HttpRequest,label:"Collect HTTP Request"},{id:At.HttpResponse,label:"Collect HTTP Response"},{id:At.DbQuery,label:"Collect DB Query"},{id:At.Messaging,label:"Collect Messaging"}],Fa={[Ft.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={[Mt.Column]:null,[Mt.FilePath]:!0,[Mt.Function]:!0,[Mt.LineNumber]:!0,[Mt.Namespace]:null,[Mt.StackTrace]:null};n("codeAttributes",e),d(!1)}},[]);const u=(e,t)=>{const o=t?[...s,e]:s.filter(t=>t!==e),i=Object.values(Mt).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(Na,{$hasError:!!r},Ta.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(f,null,r)),e.createElement("div",null,e.createElement(y,{title:"Verbose data to collect",required:!0}),e.createElement(Na,{$hasError:!!r},Ia.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(f,null,r)))},[Ft.CustomInstrumentation]:({value:t,setValue:i,formErrors:n})=>{const a=n.customInstrumentations,r=l(()=>(t?.customInstrumentations?.[Ot.Java]||[]).filter(e=>e.className&&e.methodName).map(e=>({key:e.className,value:e.methodName})),[t]),s=l(()=>(t?.customInstrumentations?.[Ot.Golang]||[]).filter(e=>e.packageName&&(e.functionName||e.receiverMethodName&&e.receiverName)),[t]),c=(e,t)=>{const o={};switch(t){case"java":o[Ot.Java]=e,o[Ot.Golang]=s;break;case"golang":o[Ot.Golang]=e,o[Ot.Java]=r.map(({key:e,value:t})=>({className:e,methodName:t}))}i("customInstrumentations",o)};return o(()=>{t?.customInstrumentations||i("customInstrumentations",{[Ot.Golang]:Ea[Ot.Golang],[Ot.Java]:Ea[Ot.Java]})},[i,t]),e.createElement("div",null,e.createElement(k,{title:"Golang Custom Probes",columns:[{title:"",keyName:"packageName",placeholder:"Package name",required:!0,tooltip:"The full import path of the package containing the function or method to be instrumented."},{title:"",keyName:"functionName",placeholder:"Function name",required:!1,tooltip:"The name of the function to be instrumented. Leave empty if instrumenting a receiver method."},{title:"",keyName:"receiverName",placeholder:"Receiver name",required:!1,tooltip:"The name of the receiver type if instrumenting a method. Leave empty if instrumenting a standalone function."},{title:"",keyName:"receiverMethodName",placeholder:"Receiver method name",required:!1,tooltip:"The name of the method to be instrumented. Leave empty if instrumenting a standalone function."}],value:s,onChange:e=>c(e,"golang"),errorMessage:a,limitFieldsPerRow:2}),e.createElement(w,{title:"Java Custom Probes",tooltip:"Specify class name and method name pair to instrument.",value:r,onChange:(e=[])=>c(e.map(({key:e,value:t})=>({className:e,methodName:t})),"java"),errorMessage:a,keyPlaceholder:"Class name",valuePlaceholder:"Method name"}))},[Ft.HeadersCollection]:({value:t,setValue:i,formErrors:n})=>{const a=n.headersCollection,r=l(()=>t?.headersCollection?.[Et.HeaderKeys]||[],[t]),s=e=>{const t={[Et.HeaderKeys]:e};i("headersCollection",t)};return o(()=>{r.length||s(Oa)},[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}))},[Ft.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={[At.HttpRequest]:{},[At.HttpResponse]:{},[At.DbQuery]:{},[At.Messaging]:{}};n("payloadCollection",e),d(!1)}},[]),e.createElement("div",null,e.createElement(y,{title:"Type of data to collect",required:!0}),e.createElement(Ma,{$hasError:!!r},Aa.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={[At.HttpRequest]:o.includes(At.HttpRequest)?{}:null,[At.HttpResponse]:o.includes(At.HttpResponse)?{}:null,[At.DbQuery]:o.includes(At.DbQuery)?{}:null,[At.Messaging]:o.includes(At.Messaging)?{}:null};n("payloadCollection",i),d(1===o.length)})(t,e)}))),!!r&&e.createElement(f,null,r))},[Ft.UnknownType]:null},Ra=({ruleType:t,value:o,setValue:i,formErrors:n})=>{if(!t)return null;const a=Fa[t];return a?e.createElement(a,{value:o,setValue:i,formErrors:n}):null},La=d.div`
229
+ `,Ra=[{id:Rt.HttpRequest,label:"Collect HTTP Request"},{id:Rt.HttpResponse,label:"Collect HTTP Response"},{id:Rt.DbQuery,label:"Collect DB Query"},{id:Rt.Messaging,label:"Collect Messaging"}],La={[Lt.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={[Ft.Column]:null,[Ft.FilePath]:!0,[Ft.Function]:!0,[Ft.LineNumber]:!0,[Ft.Namespace]:null,[Ft.StackTrace]:null};n("codeAttributes",e),d(!1)}},[]);const u=(e,t)=>{const o=t?[...s,e]:s.filter(t=>t!==e),i=Object.values(Ft).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(Ia,{$hasError:!!r},Ea.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(Ia,{$hasError:!!r},Oa.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)))},[Lt.CustomInstrumentation]:({value:t,setValue:i,formErrors:n})=>{const a=n.customInstrumentations,r=l(()=>(t?.customInstrumentations?.[Mt.Java]||[]).map(e=>({key:e.className,value:e.methodName})),[t]),s=l(()=>(t?.customInstrumentations?.[Mt.Golang]||[]).map(e=>new At(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[t]),c=(e,t)=>{const o={};switch(t){case"java":o[Mt.Java]=e.map(e=>new Ot(e.className,e.methodName)),o[Mt.Golang]=s.map(e=>new At(e.packageName,e.functionName,e.receiverName,e.receiverMethodName));break;case"golang":o[Mt.Golang]=e.map(e=>new At(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),o[Mt.Java]=r.map(({key:e,value:t})=>new Ot(e,t))}i("customInstrumentations",o)};return o(()=>{t?.customInstrumentations||i("customInstrumentations",{[Mt.Golang]:Ma[Mt.Golang],[Mt.Java]:Ma[Mt.Java]})},[i,t]),e.createElement("div",null,e.createElement(k,{title:"Golang Custom Probes",columns:[{title:"",keyName:"packageName",placeholder:"Package name",required:!0,tooltip:"The full import path of the package containing the function or method to be instrumented."},{title:"",keyName:"functionName",placeholder:"Function name",required:!1,tooltip:"The name of the function to be instrumented. Leave empty if instrumenting a receiver method."},{title:"",keyName:"receiverName",placeholder:"Receiver name",required:!1,tooltip:"The name of the receiver type if instrumenting a method. Leave empty if instrumenting a standalone function."},{title:"",keyName:"receiverMethodName",placeholder:"Receiver method name",required:!1,tooltip:"The name of the method to be instrumented. Leave empty if instrumenting a standalone function."}],value:s,onChange:e=>c(e,"golang"),errorMessage:a,limitFieldsPerRow:2}),e.createElement(w,{title:"Java Custom Probes",tooltip:"Specify class name and method name pair to instrument.",value:r,onChange:(e=[])=>c(e.map(({key:e,value:t})=>({className:e,methodName:t})),"java"),errorMessage:a,keyPlaceholder:"Class name",valuePlaceholder:"Method name"}))},[Lt.HeadersCollection]:({value:t,setValue:i,formErrors:n})=>{const a=n.headersCollection,r=l(()=>t?.headersCollection?.[Et.HeaderKeys]||[],[t]),s=e=>{const t={[Et.HeaderKeys]:e};i("headersCollection",t)};return o(()=>{r.length||s(Aa)},[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}))},[Lt.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={[Rt.HttpRequest]:{},[Rt.HttpResponse]:{},[Rt.DbQuery]:{},[Rt.Messaging]:{}};n("payloadCollection",e),d(!1)}},[]),e.createElement("div",null,e.createElement(y,{title:"Type of data to collect",required:!0}),e.createElement(Fa,{$hasError:!!r},Ra.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={[Rt.HttpRequest]:o.includes(Rt.HttpRequest)?{}:null,[Rt.HttpResponse]:o.includes(Rt.HttpResponse)?{}:null,[Rt.DbQuery]:o.includes(Rt.DbQuery)?{}:null,[Rt.Messaging]:o.includes(Rt.Messaging)?{}:null};n("payloadCollection",i),d(1===o.length)})(t,e)}))),!!r&&e.createElement(b,null,r))},[Lt.UnknownType]:null},Pa=({ruleType:t,value:o,setValue:i,formErrors:n})=>{if(!t)return null;const a=La[t];return a?e.createElement(a,{value:o,setValue:i,formErrors:n}):null},qa=d.div`
230
230
  display: flex;
231
231
  flex-direction: column;
232
232
  gap: 24px;
233
233
  padding: 4px;
234
- `,Pa=d(T)`
234
+ `,Ka=d(T)`
235
235
  margin-bottom: 12px;
236
- `,qa=({isUpdate:t,rule:o,formData:i,formErrors:n,handleFormChange:a})=>{const l=I.useTheme();return e.createElement(La,null,e.createElement(ce,null,o.supportedLanguages.map(t=>e.createElement(Rt,{key:t,icon:Lt(t),type:j.Info},it[t]))),t?e.createElement("div",null,e.createElement(Pa,null,"Status"),e.createElement(E,{options:[{icon:xo,label:p.ENABLED,value:!1,selectedBgColor:l.text.success+I.opacity.hex["050"]},{icon:Co,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(Ra,{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}))},Ka=d.div`
236
+ `,Ha=({isUpdate:t,rule:o,formData:i,formErrors:n,handleFormChange:a})=>{const l=I.useTheme();return e.createElement(qa,null,e.createElement(ce,null,o.supportedLanguages.map(t=>e.createElement(Pt,{key:t,icon:qt(t),type:B.Info},it[t]))),t?e.createElement("div",null,e.createElement(Ka,null,"Status"),e.createElement(E,{options:[{icon:$o,label:p.ENABLED,value:!1,selectedBgColor:l.text.success+I.opacity.hex["050"]},{icon:ko,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(Pa,{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}))},za=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
- `,Ha=d.div`
242
+ `,Wa=d.div`
243
243
  display: flex;
244
244
  flex-direction: column;
245
245
  gap: 12px;
246
- `,za=({updateInstrumentationRule:o,deleteInstrumentationRule:i})=>{const{instrumentationRules:a}=V(),{addNotification:r}=L(),{drawerType:s,drawerEntityId:c}=P(),d=n(null),u=s!==B.InstrumentationRule,[p,m]=t(!1),[h,g]=t(!1),{formData:y,formErrors:v,handleFormChange:f,resetFormData:b,validateForm:x,loadFormWithDrawerItem:C}=Pt(),$=l(()=>{if(u)return b();const e=a?.find(e=>e.ruleId===c);return e?C(e):b(),e},[u,c,a]);if(!$)return null;const k=qt.find(({type:e})=>e===$.type);return e.createElement(Ci,{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:"";f("ruleName",t),o(c,{...y,ruleName:t}),m(!1),g(!1)}},onDelete:()=>{$.mutable?(i(c),m(!1),g(!1),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&&k?e.createElement(Ka,null,e.createElement(qa,{isUpdate:!0,rule:k,formData:y,formErrors:v,handleFormChange:(...e)=>{g(!0),f(...e)}})):e.createElement(Ha,null,e.createElement(J,{conditions:$.conditions||[]}),e.createElement(Y,{title:"Instrumentation Rule Details",data:$?Da($):[]})))},Wa=d(Q)`
246
+ `,ja=({updateInstrumentationRule:o,deleteInstrumentationRule:i})=>{const{instrumentationRules:a}=V(),{addNotification:r}=L(),{drawerType:s,drawerEntityId:c}=P(),d=n(null),u=s!==j.InstrumentationRule,[p,m]=t(!1),[h,g]=t(!1),{formData:y,formErrors:v,handleFormChange:b,resetFormData:f,validateForm:x,loadFormWithDrawerItem:C}=Kt(),$=l(()=>{if(u)return f();const e=a?.find(e=>e.ruleId===c);return e?C(e):f(),e},[u,c,a]);if(!$)return null;const k=Ht.find(({type:e})=>e===$.type);return e.createElement(ki,{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:B.Warning,title:ne.FORBIDDEN,message:ne.CANNOT_EDIT_RULE,crdType:j.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),d.current?.closeDrawer()):r({type:B.Warning,title:ne.FORBIDDEN,message:ne.CANNOT_DELETE_RULE,crdType:j.InstrumentationRule,target:c,hideFromHistory:!0})},onCancel:()=>{m(!1),g(!1),C($)}},p&&k?e.createElement(za,null,e.createElement(Ha,{isUpdate:!0,rule:k,formData:y,formErrors:v,handleFormChange:(...e)=>{g(!0),b(...e)}})):e.createElement(Wa,null,e.createElement(J,{conditions:$.conditions||[]}),e.createElement(Y,{title:"Instrumentation Rule Details",data:$?Ta($):[]})))},Ba=d(X)`
247
247
  margin-top: 24px;
248
248
  gap: 12px;
249
- `,Ba=qt,ja=({isEnterprise:o,createInstrumentationRule:i})=>{const{currentModal:n,setCurrentModal:a}=Z(),l=n===B.InstrumentationRule,{formData:r,formErrors:s,handleFormChange:c,resetFormData:d,validateForm:u}=Pt(),[m,h]=t(void 0),g=()=>{d(),h(void 0),a("")},y=()=>{if(!u())return null;i(r),g()};return q({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(Wa,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:Ba,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(qa,{rule:m,formData:r,formErrors:s,handleFormChange:c})):null))},Va=e=>{const{payloadCollection:t,codeAttributes:o,customInstrumentations:i}=e;let n="";return 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&&Object.values(Ot).forEach(e=>{const t=(i[e]||[]).map(t=>{if(e===Ot.Java){const e=t;return`${e.className}.${e.methodName}`}if(e===Ot.Golang){const e=t;if(e.functionName)return`${e.packageName}.${e.functionName}()`;if(e.receiverMethodName&&e.receiverName)return`${e.packageName}.(${e.receiverName}).${e.receiverMethodName}()`}return""}).filter(e=>e).join(", ");t&&(n+=n?`, ${t}`:t)}),n},Ua=[{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:"conditions",title:"Conditions"},{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}],_a=({maxHeight:t,maxWidth:o})=>{const i=I.useTheme(),n=he(),{setDrawerType:a,setDrawerEntityId:r}=P(),{instrumentationRules:s,instrumentationRulesLoading:c}=V(),d=l(()=>Oi({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=>{const{hasErrors:o,hasWarnings:n,hasDisableds:l}=re(t.conditions||[]);return{status:o?j.Error:n?j.Warning:void 0,faded:l,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:Va(t),textColor:i.text.info,withTooltip:!0},{columnKey:"conditions",component:()=>e.createElement(Ii,{conditions:t.conditions||[],id:t.ruleId})},{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(be,{$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(ke,{$maxHeight:t},e.createElement(Se,{columns:Ua,rows:u})),!d.length&&e.createElement(we,{style:{marginTop:"2rem"}},e.createElement(De,null)))},Ga=d.div`
249
+ `,Va=Ht,Ua=({isEnterprise:o,createInstrumentationRule:i})=>{const{currentModal:n,setCurrentModal:a}=Z(),l=n===j.InstrumentationRule,{formData:r,formErrors:s,handleFormChange:c,resetFormData:d,validateForm:u}=Kt(),[m,h]=t(void 0),g=()=>{d(),h(void 0),a("")},y=()=>{if(!u())return null;i(r),g()};return q({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(Ba,null,o?e.createElement(ie,{type:B.Warning,message:ne.DEFINED_FOR_ALL_STREAMS(p.INSTRUMENTATION_RULES)}):e.createElement(ie,{type:B.Default,message:ne.ENTERPRISE_ONLY(p.INSTRUMENTATION_RULES)}),e.createElement(ae,{options:Va,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(Ha,{rule:m,formData:r,formErrors:s,handleFormChange:c})):null))},_a=e=>{const{payloadCollection:t,codeAttributes:o,customInstrumentations:i}=e;let n="";return 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&&Object.values(Mt).forEach(e=>{const t=(i[e]||[]).filter(e=>e).join(", ");t&&(n+=n?`, ${t}`:t)}),n},Ga=[{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:"conditions",title:"Conditions"},{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}],Ja=({maxHeight:t,maxWidth:o})=>{const i=I.useTheme(),n=he(),{setDrawerType:a,setDrawerEntityId:r}=P(),{instrumentationRules:s,instrumentationRulesLoading:c}=V(),d=l(()=>Ai({instrumentationRules:s,sources:[],actions:[],destinations:[],searchText:n.searchText,selectedCategory:j.InstrumentationRule}).searchResults.find(({category:e})=>e===j.InstrumentationRule)?.entities||[],[s,n]),u=l(()=>d.map(t=>{const{hasErrors:o,hasWarnings:n,hasDisableds:l}=re(t.conditions||[]);return{status:o?B.Error:n?B.Warning:void 0,faded:l,onClick:()=>{a(j.InstrumentationRule),r(t.ruleId)},cells:[{columnKey:"icon",component:()=>e.createElement(ye,{icon:Re(t.type)})},{columnKey:"name",value:ve(t,j.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:_a(t),textColor:i.text.info,withTooltip:!0},{columnKey:"conditions",component:()=>e.createElement(Oi,{conditions:t.conditions||[],id:t.ruleId})},{columnKey:"active-status",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:t.disabled?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(se,{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(fe,{$maxWidth:o},e.createElement(xe,null,e.createElement(Ce,{icon:$e(j.Action),title:p.INSTRUMENTATION_RULES,badge:m,badgeTooltip:h,loading:c})),e.createElement(ke,{$maxHeight:t},e.createElement(Se,{columns:Ga,rows:u})),!d.length&&e.createElement(we,{style:{marginTop:"2rem"}},e.createElement(De,null)))},Ya=d.div`
250
250
  position: fixed;
251
251
  bottom: 0;
252
252
  left: 50%;
@@ -259,17 +259,17 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
259
259
  border-radius: 32px;
260
260
  border: 1px solid ${({theme:e})=>e.colors.border};
261
261
  background-color: ${({theme:e})=>e.colors.dropdown_bg};
262
- `,Ja=({totalSourceCount:o,uninstrumentSources:i,restartWorkloads:n})=>{const a=I.useTheme(),s=Kt({container:Ga,animateIn:I.animations.slide.in.center,animateOut:I.animations.slide.out.center}),{selectedSources:c,setSelectedSources:d}=Ht(),[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=>zt(e)))}),n(e),h()}},e.createElement(Mo,null),e.createElement(T,{family:"secondary",decoration:"underline"},"Restart")),e.createElement(at,{variant:"tertiary",onClick:()=>p(!0)},e.createElement(ko,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)}))},Ya=d.div`
262
+ `,Qa=({totalSourceCount:o,uninstrumentSources:i,restartWorkloads:n})=>{const a=I.useTheme(),s=zt({container:Ya,animateIn:I.animations.slide.in.center,animateOut:I.animations.slide.out.center}),{selectedSources:c,setSelectedSources:d}=Wt(),[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=>jt(e)))}),n(e),h()}},e.createElement(Fo,null),e.createElement(T,{family:"secondary",decoration:"underline"},"Restart")),e.createElement(at,{variant:"tertiary",onClick:()=>p(!0)},e.createElement(wo,null),e.createElement(T,{family:"secondary",decoration:"underline",color:a.text.error},"Uninstrument"))),e.createElement(z,{isOpen:u,name:`${m} sources`,type:j.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)}))},Xa=d.div`
263
263
  position: relative;
264
264
  width: fit-content;
265
- `,Xa=d(ce)`
265
+ `,Za=d(ce)`
266
266
  gap: 12px;
267
267
  padding: 0 12px;
268
- `,Qa=d(Q)`
268
+ `,el=d(X)`
269
269
  gap: 12px;
270
270
  max-height: 400px;
271
271
  overflow-y: auto;
272
- `,Za=d.div`
272
+ `,tl=d.div`
273
273
  position: absolute;
274
274
  bottom: 0;
275
275
  left: 0;
@@ -278,13 +278,13 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
278
278
  border-radius: 0 0 24px 24px;
279
279
  background: ${({theme:e})=>`linear-gradient(to top, ${e.colors.dropdown_bg}, transparent)`};
280
280
  pointer-events: none;
281
- `,el=d(T)`
281
+ `,ol=d(T)`
282
282
  background-color: ${({theme:e})=>e.colors.orange_soft};
283
283
  color: ${({theme:e})=>e.text.primary};
284
284
  border-radius: 32px;
285
285
  width: fit-content;
286
286
  padding: 2px 8px;
287
- `,tl=()=>{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(Ya,null,e.createElement(dt,{onClick:()=>{u(0,0),c(e=>!e)},tooltip:"Notifications",withPing:!!l,pingColor:t.colors.orange_og},e.createElement(Ao,{size:18})),e.createElement(Ye,{ref:r,isOpen:s,right:d.left,maxWidth:"400px",header:e.createElement(Xa,null,e.createElement(T,{size:20},"Notifications"),!!l&&e.createElement(el,{size:12,family:"secondary"},l," new"))},e.createElement(Qa,null,n.length?n.map(t=>e.createElement(rl,{key:`notification-${t.id}`,...t,onClick:()=>c(!1)})):e.createElement(De,{title:"No notifications",subTitle:""})),e.createElement(Za,null)))},ol=d.div`
287
+ `,il=()=>{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(Xa,null,e.createElement(dt,{onClick:()=>{u(0,0),c(e=>!e)},tooltip:"Notifications",withPing:!!l,pingColor:t.colors.orange_og},e.createElement(Ro,{size:18})),e.createElement(Ye,{ref:r,isOpen:s,right:d.left,maxWidth:"400px",header:e.createElement(Za,null,e.createElement(T,{size:20},"Notifications"),!!l&&e.createElement(ol,{size:12,family:"secondary"},l," new"))},e.createElement(el,null,n.length?n.map(t=>e.createElement(cl,{key:`notification-${t.id}`,...t,onClick:()=>c(!1)})):e.createElement(De,{title:"No notifications",subTitle:""})),e.createElement(tl,null)))},nl=d.div`
288
288
  display: flex;
289
289
  align-items: flex-start;
290
290
  gap: 12px;
@@ -298,7 +298,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
298
298
  background-color: ${({theme:e})=>e.colors.dropdown_bg_2};
299
299
  }
300
300
  }
301
- `,il=d.div`
301
+ `,al=d.div`
302
302
  background-color: ${({$type:e,theme:t})=>t.text[e]+I.opacity.hex["015"]};
303
303
  border-radius: 8px;
304
304
  width: 36px;
@@ -306,19 +306,19 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
306
306
  display: flex;
307
307
  align-items: center;
308
308
  justify-content: center;
309
- `,nl=d.div`
309
+ `,ll=d.div`
310
310
  width: 290px;
311
- `,al=d.div`
311
+ `,rl=d.div`
312
312
  margin-bottom: 6px;
313
- `,ll=d.div`
313
+ `,sl=d.div`
314
314
  display: flex;
315
315
  align-items: center;
316
316
  gap: 6px;
317
- `,rl=({id:t,seen:o,type:i,title:n,message:a,time:l,crdType:r,target:s,onClick:c})=>{const d=I.useTheme(),u=Wt(),{onClickNotification:p}=Bt(),m=!!r&&!!s,h=n?.toLowerCase().includes(X.Delete.toLowerCase())||!1,g=me(i,d);return e.createElement(ol,{key:`notification-${t}`,className:m?"click-enabled":"",onClick:()=>{m&&(c(),p({id:t,crdType:r,target:s}))}},e.createElement(il,{$type:h?j.Error:i},h?e.createElement(ko,null):e.createElement(g,null)),e.createElement(nl,null,e.createElement(al,null,e.createElement(T,{size:14},a)),e.createElement(ll,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")))))},sl=(e,t,o)=>{const i=e?.serviceName||t?.otelServiceName||t?.name,n=o?[Fo]:Le(t?.containers||[]),{priorotizedStatus:a}=re(t?.conditions||[]);return{id:i,title:i,icons:n.length?n:[Ro],status:a,serviceMapEntry:e}},cl=e=>"user"===e?.otelServiceName&&!e?.namespace&&!e?.name&&!e?.kind,dl=d.div`
317
+ `,cl=({id:t,seen:o,type:i,title:n,message:a,time:l,crdType:r,target:s,onClick:c})=>{const d=I.useTheme(),u=Bt(),{onClickNotification:p}=Vt(),m=!!r&&!!s,h=n?.toLowerCase().includes(Q.Delete.toLowerCase())||!1,g=me(i,d);return e.createElement(nl,{key:`notification-${t}`,className:m?"click-enabled":"",onClick:()=>{m&&(c(),p({id:t,crdType:r,target:s}))}},e.createElement(al,{$type:h?B.Error:i},h?e.createElement(wo,null):e.createElement(g,null)),e.createElement(ll,null,e.createElement(rl,null,e.createElement(T,{size:14},a)),e.createElement(sl,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")))))},dl=(e,t,o)=>{const i=e?.serviceName||t?.otelServiceName||t?.name,n=o?[Lo]:Le(t?.containers||[]),{priorotizedStatus:a}=re(t?.conditions||[]);return{id:i,title:i,icons:n.length?n:[Po],status:a,serviceMapEntry:e}},ul=e=>"user"===e?.otelServiceName&&!e?.namespace&&!e?.name&&!e?.kind,pl=d.div`
318
318
  width: 100%;
319
319
  height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px)`};
320
320
  position: relative;
321
- `,ul={namespace:"",name:"",kind:"",otelServiceName:"user",selected:!0,numberOfInstances:0,dataStreamNames:[],containers:[],conditions:[]},pl=({heightToRemove:t,serviceMap:i})=>{const n=I.useTheme(),{sources:a,sourcesLoading:l}=V(),{containerRef:r,containerHeight:s,containerWidth:c}=We(),[d,u,m]=Jo([]),[h,g,y]=Yo([]);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:sl(t,i,cl(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:sl(t,i,cl(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:sl(void 0,e,cl(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:[ul].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"}),Xo(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:Qo.ArrowClosed},style:{stroke:r?e?.colors.dark_red:e?.colors.border}})})}),i})({theme:n,nodes:d,serviceMap:i}))},[n,d,i]),e.createElement(dl,{ref:r,$heightToRemove:t},e.createElement(_e,{nodes:d,edges:h,onNodesChange:m,onEdgesChange:y,zoomOnScroll:!0}))},ml=d.div`
321
+ `,ml={namespace:"",name:"",kind:"",otelServiceName:"user",selected:!0,numberOfInstances:0,dataStreamNames:[],containers:[],conditions:[]},hl=({heightToRemove:t,serviceMap:i})=>{const n=I.useTheme(),{sources:a,sourcesLoading:l}=V(),{containerRef:r,containerHeight:s,containerWidth:c}=We(),[d,u,m]=Qo([]),[h,g,y]=Xo([]);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===`${j.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:`${j.Source}-${o}-${Ee.MapItem}`,type:Ee.MapItem,position:l.get(o),data:dl(t,i,ul(i))})}),a.forEach((t,o)=>{if(n.find(e=>e.id===`${j.Source}-${o}-${Ee.MapItem}`))return;const i=e.find(e=>o===e.otelServiceName||o===e.name);n.push({id:`${j.Source}-${o}-${Ee.MapItem}`,type:Ee.MapItem,position:l.get(o),data:dl(t,i,ul(i))})});let o=50;e.forEach(e=>{const t=e.otelServiceName||e.name;n.find(e=>e.id===`${j.Source}-${t}-${Ee.MapItem}`)||(n.push({id:`${j.Source}-${t}-${Ee.MapItem}`,type:Ee.MapItem,position:{x:o,y:10},data:dl(void 0,e,ul(e))}),o+=110)})}else n.push({id:`${j.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:[ml].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===`${j.Source}-${Ee.NoData}`)&&o.push({id:`${j.Source}-${Ee.NoData}`,type:"remove"}),Zo(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=`${j.Source}-${o.serviceName}-${Ee.MapItem}`,r=a===B.Error;i.push({id:`${n}-to-${l}`,source:n,target:l,markerEnd:{type:ei.ArrowClosed},style:{stroke:r?e?.colors.dark_red:e?.colors.border}})})}),i})({theme:n,nodes:d,serviceMap:i}))},[n,d,i]),e.createElement(pl,{ref:r,$heightToRemove:t},e.createElement(_e,{nodes:d,edges:h,onNodesChange:m,onEdgesChange:y,zoomOnScroll:!0}))},gl=d.div`
322
322
  display: flex;
323
323
  flex-direction: column;
324
324
  align-items: center;
@@ -328,12 +328,12 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
328
328
  max-height: ${({$isModal:e})=>e?"calc(100vh - 510px)":"calc(100vh - 310px)"};
329
329
  height: fit-content;
330
330
  overflow-y: scroll;
331
- `,hl=d.div`
331
+ `,yl=d.div`
332
332
  width: 100%;
333
333
  padding-bottom: ${({$isOpen:e})=>e?"18px":"0"};
334
334
  border-radius: 16px;
335
335
  background-color: ${({$selected:e,theme:t})=>e?t.colors.majestic_blue+I.opacity.hex["024"]:t.colors.dropdown_bg_2+I.opacity.hex["040"]};
336
- `,gl=d.div`
336
+ `,vl=d.div`
337
337
  display: flex;
338
338
  justify-content: space-between;
339
339
  gap: 12px;
@@ -345,23 +345,23 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
345
345
  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"])};
346
346
  transition: background-color 0.3s;
347
347
  }
348
- `,yl=d(gl)`
348
+ `,bl=d(vl)`
349
349
  width: calc(100% - 100px);
350
350
  margin: 0 auto;
351
351
  padding: 8px;
352
- `,vl=d.div`
352
+ `,fl=d.div`
353
353
  position: relative;
354
354
  padding-bottom: ${({$addPadding:e})=>e?"16px":"0"};
355
- `,fl=d.div`
355
+ `,xl=d.div`
356
356
  position: absolute;
357
357
  top: 6px;
358
358
  left: 18px;
359
- `,bl=d(we)`
359
+ `,Cl=d(we)`
360
360
  padding-bottom: ${({$addPadding:e})=>e?"16px":"0"};
361
- `,xl=d(T)`
361
+ `,$l=d(T)`
362
362
  width: 42px;
363
363
  text-align: right;
364
- `,Cl=({isModal:t=!1,withInstances:o=!0,fetchingNamespace: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||i?e.createElement(ft,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(ml,{$isModal:t},g.map(([t,a])=>{const g=s?.[t]||[],f=d?.[t]?.selected||!1,b=g.filter(({selected:e})=>e),x=g.length>0,C=l===t,$=b.length>0&&b.length===a.length,k=b.length>0&&b.length!==a.length,w=a.length>0,D=1===a.length;return r||w?e.createElement(hl,{key:`namespace-${t}`,"data-id":`namespace-${t}`,$selected:$,$isOpen:C},e.createElement(gl,{$selected:$,$withClick:!!r,onClick:()=>r?.(t)},e.createElement(ce,{$gap:12},r&&e.createElement(v,{partiallyChecked:k,value:$,onChange:e=>r(t,e)}),e.createElement(y,null),e.createElement(T,null,t)),e.createElement(ce,{$gap:12},u&&e.createElement(S,{title:p.FUTURE_APPS_TITLE,tooltip:p.FUTURE_APPS_DESCRIPTION,initialValue:f,onChange:e=>u(e,t),flipHorizontally:!0}),i!==t||n?.includes(t)?e.createElement(xl,{size:10,color:m.text.grey},x?`${b.length}/${a.length}`:null):e.createElement(ft,{scale:.8}),r&&e.createElement(ut,{extend:C}))),(C||!r)&&(w?e.createElement(vl,{$addPadding:!c},e.createElement(fl,null,e.createElement(le,{orientation:"vertical",length:(D?24:34*a.length)+"px"})),a.map(i=>{const n=b.some(({name:e})=>e===i.name);return e.createElement($l,{key:`source-${i.name}`,withInstances:o,source:i,namespace:t,isSelected:n,onSelect:c})})):e.createElement(bl,{$addPadding:!c},h||i===t&&!n?.includes(t)?e.createElement(ft,null):e.createElement(De,{title:p.NO_SOURCES_NAMESPACE,subTitle:p.TRY_SEARCH_OR_OTHER_NAMESPACE})))):null}))},$l=({withInstances:t,source:o,namespace:i,isSelected:n,onSelect:a})=>e.createElement(yl,{"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}`)))),kl=d.div`
364
+ `,kl=({isModal:t=!1,withInstances:o=!0,fetchingNamespace: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||i?e.createElement(bt,null):e.createElement(De,{title:p.NO_SOURCES,subTitle:r?p.PLEASE_MAKE_SURE_UNIGNORED_NAMESPACES:p.PLEASE_ADD_SOURCE}));const y=$e(j.Namespace);return e.createElement(gl,{$isModal:t},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,k=f.length>0&&f.length!==a.length,w=a.length>0,D=1===a.length;return r||w?e.createElement(yl,{key:`namespace-${t}`,"data-id":`namespace-${t}`,$selected:$,$isOpen:C},e.createElement(vl,{$selected:$,$withClick:!!r,onClick:()=>r?.(t)},e.createElement(ce,{$gap:12},r&&e.createElement(v,{partiallyChecked:k,value:$,onChange:e=>r(t,e)}),e.createElement(y,null),e.createElement(T,null,t)),e.createElement(ce,{$gap:12},u&&e.createElement(S,{title:p.FUTURE_APPS_TITLE,tooltip:p.FUTURE_APPS_DESCRIPTION,initialValue:b,onChange:e=>u(e,t),flipHorizontally:!0}),i!==t||n?.includes(t)?e.createElement($l,{size:10,color:m.text.grey},x?`${f.length}/${a.length}`:null):e.createElement(bt,{scale:.8}),r&&e.createElement(ut,{extend:C}))),(C||!r)&&(w?e.createElement(fl,{$addPadding:!c},e.createElement(xl,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(Sl,{key:`source-${i.name}`,withInstances:o,source:i,namespace:t,isSelected:n,onSelect:c})})):e.createElement(Cl,{$addPadding:!c},h||i===t&&!n?.includes(t)?e.createElement(bt,null):e.createElement(De,{title:p.NO_SOURCES_NAMESPACE,subTitle:p.TRY_SEARCH_OR_OTHER_NAMESPACE})))):null}))},Sl=({withInstances:t,source:o,namespace:i,isSelected:n,onSelect:a})=>e.createElement(bl,{"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}`)))),wl=d.div`
365
365
  display: flex;
366
366
  flex-direction: column;
367
367
  align-items: center;
@@ -370,35 +370,35 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
370
370
  max-height: calc(100vh - 200px);
371
371
  height: fit-content;
372
372
  overflow-y: scroll;
373
- `,Sl=({onEditStream:t,onEditSources:o,onEditDestinations:i,categories:n})=>{const{selectedStreamName:a}=He(),{configuredSources:r,configuredDestinations:s,configuredDestinationsUpdateOnly:c}=$t(),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(kl,null,e.createElement(Y,{title:p.STREAM_NAME,action:()=>e.createElement(jt,{onClick:t}),data:[{title:"",value:a}]}),e.createElement(Y,{title:p.SELECTED_SOURCES,titleBadge:d,action:()=>e.createElement(jt,{onClick:o})},e.createElement(Cl,{filteredNamespacesAndSources:r,withInstances:!1})),e.createElement(Y,{title:p.SELECTED_DESTINATIONS,titleBadge:s.length+c.length,action:()=>e.createElement(jt,{onClick:i})},e.createElement(xa,{categories:n})))))};var wl;!function(e){e.Overview="overview",e.InstrumentationRules="InstrumentationRule",e.Sources="Source",e.Actions="Action",e.Destinations="Destination"}(wl||(wl={}));const Dl=({onClickId:o,defaultSelectedId:i,extendedNavIcons:n})=>{const[a,r]=t(i||""),s=l(()=>[{id:wl.Overview,icon:Lo,selected:a===wl.Overview,onClick:()=>{r(wl.Overview),o(wl.Overview)},tooltip:"Overview"},...(n||[]).map(e=>({...e,selected:a===e.id,onClick:()=>{r(e.id),e.onClick()}}))],[a]),c=l(()=>[wl.Overview,wl.InstrumentationRules,wl.Sources,wl.Actions,wl.Destinations].includes(a)?[{id:wl.InstrumentationRules,icon:Po,selected:a===wl.InstrumentationRules,onClick:()=>{r(wl.InstrumentationRules),o(wl.InstrumentationRules)},tooltip:"Instrumentation Rules"},{id:wl.Sources,icon:qo,selected:a===wl.Sources,onClick:()=>{r(wl.Sources),o(wl.Sources)},tooltip:"Sources"},{id:wl.Actions,icon:Ko,selected:a===wl.Actions,onClick:()=>{r(wl.Actions),o(wl.Actions)},tooltip:"Actions"},{id:wl.Destinations,icon:Ho,selected:a===wl.Destinations,onClick:()=>{r(wl.Destinations),o(wl.Destinations)},tooltip:"Destinations"}]:[],[a]);return e.createElement(Vt,{orientation:"vertical",mainIcons:s,subIcons:c})},Nl=({})=>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(zo,null)),Tl=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()}]},Il=d.div`
373
+ `,Dl=({onEditStream:t,onEditSources:o,onEditDestinations:i,categories:n})=>{const{selectedStreamName:a}=He(),{configuredSources:r,configuredDestinations:s,configuredDestinationsUpdateOnly:c}=$t(),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(X,{$gap:12},e.createElement(O,{title:p.SUMMARY,description:p.STREAM_CONFIRM}),e.createElement(wl,null,e.createElement(Y,{title:p.STREAM_NAME,action:()=>e.createElement(Ut,{onClick:t}),data:[{title:"",value:a}]}),e.createElement(Y,{title:p.SELECTED_SOURCES,titleBadge:d,action:()=>e.createElement(Ut,{onClick:o})},e.createElement(kl,{filteredNamespacesAndSources:r,withInstances:!1})),e.createElement(Y,{title:p.SELECTED_DESTINATIONS,titleBadge:s.length+c.length,action:()=>e.createElement(Ut,{onClick:i})},e.createElement($a,{categories:n})))))};var Nl;!function(e){e.Overview="overview",e.InstrumentationRules="InstrumentationRule",e.Sources="Source",e.Actions="Action",e.Destinations="Destination"}(Nl||(Nl={}));const Tl=({onClickId:o,defaultSelectedId:i,extendedNavIcons:n})=>{const[a,r]=t(i||""),s=l(()=>[{id:Nl.Overview,icon:qo,selected:a===Nl.Overview,onClick:()=>{r(Nl.Overview),o(Nl.Overview)},tooltip:"Overview"},...(n||[]).map(e=>({...e,selected:a===e.id,onClick:()=>{r(e.id),e.onClick()}}))],[a]),c=l(()=>[Nl.Overview,Nl.InstrumentationRules,Nl.Sources,Nl.Actions,Nl.Destinations].includes(a)?[{id:Nl.InstrumentationRules,icon:Ko,selected:a===Nl.InstrumentationRules,onClick:()=>{r(Nl.InstrumentationRules),o(Nl.InstrumentationRules)},tooltip:"Instrumentation Rules"},{id:Nl.Sources,icon:Ho,selected:a===Nl.Sources,onClick:()=>{r(Nl.Sources),o(Nl.Sources)},tooltip:"Sources"},{id:Nl.Actions,icon:zo,selected:a===Nl.Actions,onClick:()=>{r(Nl.Actions),o(Nl.Actions)},tooltip:"Actions"},{id:Nl.Destinations,icon:Wo,selected:a===Nl.Destinations,onClick:()=>{r(Nl.Destinations),o(Nl.Destinations)},tooltip:"Destinations"}]:[],[a]);return e.createElement(_t,{orientation:"vertical",mainIcons:s,subIcons:c})},Il=({})=>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(jo,null)),El=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()}]},Ol=d.div`
374
374
  display: flex;
375
375
  flex-direction: column;
376
376
  gap: 24px;
377
377
  padding: 4px;
378
- `,El=({formData:t,handleFormChange:o})=>e.createElement(Il,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)})),Ol=({workloadOdigosHealthStatus:t})=>{if(!t)return null;const o=Ut(t.status),i=tt(t.reasonEnum),n=t.message;return e.createElement(ce,{$alignItems:"center",$justifyContent:"center"},e.createElement(se,{status:o,title:i,subtitle:n,withBackground:o!==pe.Disabled,withBorder:!0,withIcon:!0,width:"calc(100% - 24px)"}))},Ml=({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||_t(s)?j.Error:j.Success,u=[];return u.push(e.createElement(Gt,{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(Jt,{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(Jt,{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(Jt,{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(Jt,{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(Yt,{...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(ft,null))},Al=d(ce)`
378
+ `,Ml=({formData:t,handleFormChange:o})=>e.createElement(Ol,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)})),Al=({workloadOdigosHealthStatus:t})=>{if(!t)return null;const o=Gt(t.status),i=tt(t.reasonEnum),n=t.message;return e.createElement(ce,{$alignItems:"center",$justifyContent:"center"},e.createElement(se,{status:o,title:i,subtitle:n,withBackground:o!==pe.Disabled,withBorder:!0,withIcon:!0,width:"calc(100% - 24px)"}))},Fl=({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(X,{$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!==B.Success||Jt(s)?B.Error:B.Success,u=[];return u.push(e.createElement(Yt,{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(Qt,{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(Qt,{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(Qt,{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(Qt,{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(Xt,{...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(bt,null))},Rl=d(ce)`
379
379
  width: 100%;
380
380
  align-items: center;
381
381
  justify-content: space-between;
382
- `,Fl=({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(Dt(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(Al,null,e.createElement(T,{size:12,color:a.text.grey},t),e.createElement(ce,{$gap:4},o.map(({key:o,value:i})=>Xt(i)&&Qt(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(ft,null))};var Rl;!function(e){e.Overview="Overview",e.Pods="Pods",e.Libraries="Libraries"}(Rl||(Rl={}));const Ll=[to.Deployment,to.StatefulSet,to.DaemonSet],Pl=[oo.Python,oo.Go],ql=d.div`
382
+ `,Ll=({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(Dt(e.instrumentationInstanceComponents).sort((e,t)=>e.name.localeCompare(t.name))):s(!0)})},[n,i]),c||l?e.createElement(X,{$gap:12},l?e.createElement(we,{$height:"70vh"},e.createElement(De,{subTitle:"Could not fetch libraries for this source"})):c?.length?e.createElement(Y,{title:"Instrumented Libraries"},c.map(({name:t,nonIdentifyingAttributes:o},i)=>e.createElement(r,{key:`library-${t}`},e.createElement(Rl,null,e.createElement(T,{size:12,color:a.text.grey},t),e.createElement(ce,{$gap:4},o.map(({key:o,value:i})=>Zt(i)&&eo(i)&&"is_standard_lib"===o?e.createElement(se,{key:`${t}-${o}`,status:B.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:B.Warning,message:"This feature is in early development, and has very limited support"}))):e.createElement(we,{$height:"70vh"},e.createElement(bt,null))};var Pl;!function(e){e.Overview="Overview",e.Pods="Pods",e.Libraries="Libraries"}(Pl||(Pl={}));const ql=[io.Deployment,io.StatefulSet,io.DaemonSet],Kl=[no.Python,no.Go],Hl=d.div`
383
383
  width: 100%;
384
384
  height: 100%;
385
385
  max-height: calc(100vh - 220px);
386
386
  overflow: overlay;
387
387
  overflow-y: auto;
388
- `,Kl=d.div`
388
+ `,zl=d.div`
389
389
  display: flex;
390
390
  flex-direction: column;
391
391
  gap: 12px;
392
- `,Hl=({persistSources:i,updateSource:a,restartWorkloads:r,fetchSourceById:s,fetchSourceDescribe:c,fetchSourceLibraries:d})=>{const{sources:u}=V(),{selectedStreamName:m}=He(),{drawerType:h,drawerEntityId:g}=P(),y=l(()=>Be(u,m),[u,m]),v=n(null),f=h===B.Source,[b,x]=t(!1),[C,$]=t(!1),[k,S]=t(Rl.Overview),[w,D]=t(null);o(()=>{f&&g&&s(g).then(e=>D(e||null))},[f,g]);const{formData:N,handleFormChange:I,resetFormData:E,loadFormWithDrawerItem:O}=Zt(),M=l(()=>{if(!f)return E();const e=(w&&JSON.stringify(zt(w))===JSON.stringify(zt(g))?w:null)||y?.find(e=>e.namespace===g.namespace&&e.name===g.name&&e.kind===g.kind);return e?O(e):E(),e},[f,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:Rl.Overview,onClick:()=>S(Rl.Overview),selected:k===Rl.Overview}];return Ll.includes(M?.kind)&&e.push({label:Rl.Pods,onClick:()=>S(Rl.Pods),selected:k===Rl.Pods}),M?.containers?.some(({language:e})=>Pl.includes(e))&&e.push({label:Rl.Libraries,onClick:()=>S(Rl.Libraries),selected:k===Rl.Libraries}),e},[k,M]);return M?e.createElement(Ci,{ref:v,onClose:()=>{S(Rl.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:b,isFormDirty:C,onEdit:k===Rl.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:k===Rl.Overview?async()=>{const{namespace:e}=M;i({[e]:[{...M,selected:!1,currentStreamName:m}]},{}),D(null),$(!1),x(!1),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(Mo,null),e.createElement(T,{size:14,family:"secondary",decoration:"underline"},"Restart"))}]},k===Rl.Overview?b?e.createElement(ql,null,e.createElement(El,{formData:N,handleFormChange:(...e)=>{$(!0),I(...e),I("currentStreamName",m)}})):e.createElement(Kl,null,e.createElement(Ol,{workloadOdigosHealthStatus:M.workloadOdigosHealthStatus}),e.createElement(J,{conditions:M.conditions||[]}),e.createElement(Y,{title:p.SOURCE_DETAILS,data:M?Tl(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(eo,{key:`source-container-${t.containerName}`,...t,callbackRuntimeOverride:async e=>await a(g,e)})))):k===Rl.Pods?e.createElement(Ml,{source:M,fetchSourceDescribe:c}):e.createElement(Fl,{source:M,fetchSourceLibraries:d})):null},zl=d.div`
392
+ `,Wl=({persistSources:i,updateSource:a,restartWorkloads:r,fetchSourceById:s,fetchSourceDescribe:c,fetchSourceLibraries:d})=>{const{sources:u}=V(),{selectedStreamName:m}=He(),{drawerType:h,drawerEntityId:g}=P(),y=l(()=>je(u,m),[u,m]),v=n(null),b=h===j.Source,[f,x]=t(!1),[C,$]=t(!1),[k,S]=t(Pl.Overview),[w,D]=t(null);o(()=>{b&&g&&s(g).then(e=>D(e||null))},[b,g]);const{formData:N,handleFormChange:I,resetFormData:E,loadFormWithDrawerItem:O}=to(),M=l(()=>{if(!b)return E();const e=(w&&JSON.stringify(jt(w))===JSON.stringify(jt(g))?w:null)||y?.find(e=>e.namespace===g.namespace&&e.name===g.name&&e.kind===g.kind);return e?O(e):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:Pl.Overview,onClick:()=>S(Pl.Overview),selected:k===Pl.Overview}];return ql.includes(M?.kind)&&e.push({label:Pl.Pods,onClick:()=>S(Pl.Pods),selected:k===Pl.Pods}),M?.containers?.some(({language:e})=>Kl.includes(e))&&e.push({label:Pl.Libraries,onClick:()=>S(Pl.Libraries),selected:k===Pl.Libraries}),e},[k,M]);return M?e.createElement(ki,{ref:v,onClose:()=>{S(Pl.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:k===Pl.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:k===Pl.Overview?async()=>{const{namespace:e}=M;i({[e]:[{...M,selected:!1,currentStreamName:m}]},{}),D(null),$(!1),x(!1),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(Fo,null),e.createElement(T,{size:14,family:"secondary",decoration:"underline"},"Restart"))}]},k===Pl.Overview?f?e.createElement(Hl,null,e.createElement(Ml,{formData:N,handleFormChange:(...e)=>{$(!0),I(...e),I("currentStreamName",m)}})):e.createElement(zl,null,e.createElement(Al,{workloadOdigosHealthStatus:M.workloadOdigosHealthStatus}),e.createElement(J,{conditions:M.conditions||[]}),e.createElement(Y,{title:p.SOURCE_DETAILS,data:M?El(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(oo,{key:`source-container-${t.containerName}`,...t,callbackRuntimeOverride:async e=>await a(g,e)})))):k===Pl.Pods?e.createElement(Fl,{source:M,fetchSourceDescribe:c}):e.createElement(Ll,{source:M,fetchSourceLibraries:d})):null},jl=d.div`
393
393
  max-width: 420px;
394
394
  width: 100%;
395
- `,Wl=i(({isModal:t,fetchSingleNamespace:o,onClickSummary:i},n)=>{const l=I.useTheme(),r=io({fetchSingleNamespace:o}),{availableSources:s,selectedSources:c,fetchingNamespace:d,selectedAllNamespaces:u,onSelectAllNamespaces:m,getApiSourcesPayload:h,getApiFutureAppsPayload:g,searchText:y,setSearchText:v,searchBy:f,setSearchBy:b,showSelectedOnly:C,setShowSelectedOnly:$,showRunningOnly:k,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(zl,null,e.createElement(x,{placeholder:f===B.Source?p.SEARCH_SOURCES:p.SEARCH_NAMESPACES,icon:wo,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:f,setSelected:b})),e.createElement(ce,{$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(le,null),e.createElement(Cl,{isModal:t,...r})))});Wl.displayName=Wl.name;const Bl=({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 q({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(Wl,{ref:c,isModal:!0,fetchSingleNamespace:t})):null},jl=[{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}],Vl=({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}=P(),{selectedSources:g,setSelectedSources:y}=Ht(),{isAwaitingInstrumentation:f,sourcesToCreate:b,sourcesCreated:x,sourcesToDelete:C,sourcesDeleted:$}=ze(),k=l(()=>{const e=(e,t)=>e>0&&Math.floor(100/e*t)||1;return b?e(b,x):C?e(C,$):1},[b,x,C,$]),S=l(()=>Be(d,c),[d,c]),w=l(()=>Oi({instrumentationRules:[],sources:je(S,a),actions:[],destinations:[],searchText:a.searchText,selectedCategory:B.Source}).searchResults.find(({category:e})=>e===B.Source)?.entities||[],[S,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=zt(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(no,{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(It(t,B.Source,i).throughput),textColor:n.text.info},{columnKey:"conditions",component:()=>e.createElement(Ii,{conditions:o.conditions||[],id:a})},{columnKey:"containers",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:j.Info,title:ao(o.containers),withBorder:!0}))}]}}),[w,g,t,O]),{badge:A,badgeTooltip:F}=l(()=>w.length!==S.length?{badge:`${w.length}/${S.length}`,badgeTooltip:p.FILTERED_COUNT_TOOLTIP}:{badge:S.length,badgeTooltip:void 0},[w,S]);return e.createElement(be,{$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||f})),e.createElement(ke,{$maxHeight:o},e.createElement(Se,{columns:jl,rows:M})),f&&!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},b?"Instrumenting":"Uninstrumenting"," workloads..."),e.createElement(Te,{label:`${k}%`}))):M.length?null:e.createElement(we,{style:{marginTop:"2rem"}},e.createElement(De,null)))},Ul=({expiresAt:t})=>{const o=I.useTheme(),i=Wt().format(t),n=new Date(t).toDateString().split(" ").slice(1).join(" "),a=lo(t,0)?o.text.error:lo(t,6048e5)?o.text.warning:o.text.success;return e.createElement(T,{size:14,color:a},i," (",n,")")},_l=d.div`
395
+ `,Bl=i(({isModal:t,fetchSingleNamespace:o,onClickSummary:i},n)=>{const l=I.useTheme(),r=ao({fetchSingleNamespace:o}),{availableSources:s,selectedSources:c,fetchingNamespace:d,selectedAllNamespaces:u,onSelectAllNamespaces:m,getApiSourcesPayload:h,getApiFutureAppsPayload:g,searchText:y,setSearchText:v,searchBy:b,setSearchBy:f,showSelectedOnly:C,setShowSelectedOnly:$,showRunningOnly:k,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(X,{$gap:12},e.createElement(X,{$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(jl,null,e.createElement(x,{placeholder:b===j.Source?p.SEARCH_SOURCES:p.SEARCH_NAMESPACES,icon:No,value:y,onChange:e=>v(e.target.value.toLowerCase())})),e.createElement(E,{options:[{label:p.SOURCE,value:j.Source,selectedBgColor:l.text.secondary,selectedTextColor:l.text.primary},{label:p.NAMESPACE,value:j.Namespace,selectedBgColor:l.text.secondary,selectedTextColor:l.text.primary}],selected:b,setSelected:f})),e.createElement(ce,{$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(le,null),e.createElement(kl,{isModal:t,...r})))});Bl.displayName=Bl.name;const Vl=({fetchSingleNamespace:t,persistSources:o})=>{const{currentModal:i,setCurrentModal:a}=Z(),l=i===j.Source,r=()=>{a("")},s=async()=>{if(c.current){const{apps:e,futureApps:t}=c.current.getFormValues();o(e,t),r()}},c=n(null);return q({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(Bl,{ref:c,isModal:!0,fetchSingleNamespace:t})):null},Ul=[{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}],_l=({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}=P(),{selectedSources:g,setSelectedSources:y}=Wt(),{isAwaitingInstrumentation:b,sourcesToCreate:f,sourcesCreated:x,sourcesToDelete:C,sourcesDeleted:$}=ze(),k=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,$]),S=l(()=>je(d,c),[d,c]),w=l(()=>Ai({instrumentationRules:[],sources:Be(S,a),actions:[],destinations:[],searchText:a.searchText,selectedCategory:j.Source}).searchResults.find(({category:e})=>e===j.Source)?.entities||[],[S,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:j.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=jt(o),a=JSON.stringify(i),{hasErrors:l,hasWarnings:s,hasDisableds:c}=re(o.conditions||[]),d=r({entityType:j.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(j.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(lo,{icons:Le(o.containers),id:a}))},{columnKey:"name",value:ve(o,j.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(It(t,j.Source,i).throughput),textColor:n.text.info},{columnKey:"conditions",component:()=>e.createElement(Oi,{conditions:o.conditions||[],id:a})},{columnKey:"containers",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:B.Info,title:ro(o.containers),withBorder:!0}))}]}}),[w,g,t,O]),{badge:A,badgeTooltip:F}=l(()=>w.length!==S.length?{badge:`${w.length}/${S.length}`,badgeTooltip:p.FILTERED_COUNT_TOOLTIP}:{badge:S.length,badgeTooltip:void 0},[w,S]);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(j.Source),title:p.SOURCES,badge:A,badgeTooltip:F,loading:u||b})),e.createElement(ke,{$maxHeight:o},e.createElement(Se,{columns:Ul,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:`${k}%`}))):M.length?null:e.createElement(we,{style:{marginTop:"2rem"}},e.createElement(De,null)))},Gl=({expiresAt:t})=>{const o=I.useTheme(),i=Bt().format(t),n=new Date(t).toDateString().split(" ").slice(1).join(" "),a=so(t,0)?o.text.error:so(t,6048e5)?o.text.warning:o.text.success;return e.createElement(T,{size:14,color:a},i," (",n,")")},Jl=d.div`
396
396
  position: relative;
397
- `,Gl=({token:o,saveToken:i})=>{const n=I.useTheme(),{isCopied:a,clickCopy:l}=ro(),{formData:r,handleFormChange:s,resetFormData:c}=so({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(Wo,null)),e.createElement(le,{orientation:"vertical",length:"12px"}),e.createElement(_l,null,e.createElement(dt,{size:32,onClick:()=>{u(!0)}},e.createElement($o,null)),d&&e.createElement(co,{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)}))))},Jl=({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:Bo},{columnKey:"name",value:t},{columnKey:"token",value:`${new Array(15).fill("•").join("")}`},{columnKey:"expires_at",component:()=>e.createElement(Ul,{expiresAt:n})},{columnKey:"actions",component:()=>e.createElement(Gl,{token:i,saveToken:o})}]}))}}]}),Yl=({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(ft,null));const l=t=>t?.name?[e.createElement(le,{key:`divider-${t.name}`}),e.createElement(Jt,{key:`describe-row-${t.name}`,title:t.name,subTitle:t.explain||void 0,value:{status:t.status||(Xt(t.value)?Qt(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)))},Xl=d.div`
397
+ `,Yl=({token:o,saveToken:i})=>{const n=I.useTheme(),{isCopied:a,clickCopy:l}=co(),{formData:r,handleFormChange:s,resetFormData:c}=uo({token:o}),[d,u]=t(!1),p=()=>{u(!1),c()},m=me(B.Success,n);return e.createElement(ce,{$gap:0},e.createElement(dt,{size:32,onClick:()=>l(o)},a?e.createElement(m,null):e.createElement(Bo,null)),e.createElement(le,{orientation:"vertical",length:"12px"}),e.createElement(Jl,null,e.createElement(dt,{size:32,onClick:()=>{u(!0)}},e.createElement(So,null)),d&&e.createElement(po,{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)}))))},Ql=({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:Vo},{columnKey:"name",value:t},{columnKey:"token",value:`${new Array(15).fill("•").join("")}`},{columnKey:"expires_at",component:()=>e.createElement(Gl,{expiresAt:n})},{columnKey:"actions",component:()=>e.createElement(Yl,{token:i,saveToken:o})}]}))}}]}),Xl=({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(bt,null));const l=t=>t?.name?[e.createElement(le,{key:`divider-${t.name}`}),e.createElement(Qt,{key:`describe-row-${t.name}`,title:t.name,subTitle:t.explain||void 0,value:{status:t.status||(Zt(t.value)?eo(t.value)?B.Success:B.Error:B.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)))},Zl=d.div`
398
398
  display: flex;
399
399
  flex-direction: column;
400
400
  gap: 12px;
401
- `,Ql="System Overview",Zl=({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:Ql,onClick:r,tooltip:Ql},e.createElement(jo,{size:18})),e.createElement(H,{width:"750px",isOpen:a,onClose:r,header:{icons:[jo],title:Ql},footer:{isOpen:!1}},e.createElement(Xl,null,!!o?.length&&e.createElement(Jl,{tokens:o,saveToken:i}),e.createElement(Yl,{fetchDescribeOdigos:n}))))};var er;!function(e){e.General="General",e.Ui="UI",e.Rollback="Rollback",e.CollectorNode="Collector Node",e.CollectorGateway="Collector Gateway"}(er||(er={}));const tr=d.div`
401
+ `,er="System Overview",tr=({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:er,onClick:r,tooltip:er},e.createElement(Uo,{size:18})),e.createElement(H,{width:"750px",isOpen:a,onClose:r,header:{icons:[Uo],title:er},footer:{isOpen:!1}},e.createElement(Zl,null,!!o?.length&&e.createElement(Ql,{tokens:o,saveToken:i}),e.createElement(Xl,{fetchDescribeOdigos:n}))))};var or;!function(e){e.General="General",e.Ui="UI",e.Rollback="Rollback",e.CollectorNode="Collector Node",e.CollectorGateway="Collector Gateway"}(or||(or={}));const ir=d.div`
402
402
  align-self: stretch;
403
403
  display: flex;
404
404
  flex-direction: column;
@@ -407,25 +407,25 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
407
407
  padding: 16px;
408
408
  border-radius: 24px;
409
409
  background: ${({theme:e})=>e.colors.secondary+I.opacity.hex["004"]};
410
- `,or=d(T)`
410
+ `,nr=d(T)`
411
411
  color: ${({theme:e})=>e.text.secondary};
412
412
  font-size: 18px;
413
413
  font-weight: 600;
414
414
  line-height: 20px;
415
- `,ir=d(ce)`
415
+ `,ar=d(ce)`
416
416
  width: 100%;
417
417
  gap: 12px;
418
418
  align-items: flex-start;
419
419
  justify-content: space-between;
420
- `,nr=i(({isAdvanced:t,formData:o,handleFormChange:i},n)=>e.createElement(tr,{ref:n,id:er.Ui},e.createElement(ir,null,e.createElement(or,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))}})));nr.displayName=nr.name;const ar=[{id:uo.VirtualDevice,value:"Virtual Device"},{id:uo.HostPath,value:"Host Path"},{id:uo.InitContainer,value:"Init Container"}],lr=[{id:po.Loader,value:"Loader"},{id:po.PodManifest,value:"Pod Manifest"},{id:po.LoaderFallbackToPodManifest,value:"Loader Fallback to Pod Manifest"}],rr=[{id:mo.CodeAttributes,value:"Code Attributes"},{id:mo.FullPayloadCollection,value:"Full Payload Collection"},{id:mo.DbPayloadCollection,value:"DB Payload Collection"},{id:mo.QueryOperationDetector,value:"Query Operation Detector"},{id:mo.AllowConcurrentAgents,value:"Allow Concurrent Agents"},{id:mo.JavaEbpfInstrumentations,value:"Java EBPF Instrumentations"},{id:mo.JavaNativeInstrumentations,value:"Java Native Instrumentations"},{id:mo.SizeS,value:"Size S"},{id:mo.SizeM,value:"Size M"},{id:mo.SizeL,value:"Size L"}],sr=i(({isAdvanced:t,formData:o,handleFormChange:i},n)=>e.createElement(tr,{ref:n,id:er.General},e.createElement(ir,null,e.createElement(or,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(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(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:rr,value:rr.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(ir,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:ar,required:!0,value:ar.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:lr,required:!0,value:lr.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)}}))));sr.displayName=sr.name;const cr=i(({formData:t,handleFormChange:o},i)=>e.createElement(tr,{ref:i,id:er.Rollback},e.createElement(or,null,"Rollback"),e.createElement(S,{title:"Rollback Disabled",tooltip:"Disable rollback",initialValue:t.rollbackDisabled||!1,onChange:e=>o("rollbackDisabled",e)}),e.createElement(ir,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)}}))));cr.displayName=cr.name;const dr=i(({isAdvanced:t,formData:o,handleFormChange:i},n)=>e.createElement(tr,{ref:n,id:er.CollectorNode},e.createElement(ir,null,e.createElement(or,null,"Collector Node")),e.createElement(ir,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(ir,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(ir,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))}}))));dr.displayName=dr.name;const ur=i(({isAdvanced:t,formData:o,handleFormChange:i},n)=>e.createElement(tr,{ref:n,id:er.CollectorGateway},e.createElement(ir,null,e.createElement(or,null,"Collector Gateway")),e.createElement(ir,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(ir,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(ir,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(ir,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))}}))));ur.displayName=ur.name;const pr=d.div`
420
+ `,lr=i(({isAdvanced:t,formData:o,handleFormChange:i},n)=>e.createElement(ir,{ref:n,id:or.Ui},e.createElement(ar,null,e.createElement(nr,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: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))}})));lr.displayName=lr.name;const rr=[{id:mo.VirtualDevice,value:"Virtual Device"},{id:mo.HostPath,value:"Host Path"},{id:mo.InitContainer,value:"Init Container"}],sr=[{id:ho.Loader,value:"Loader"},{id:ho.PodManifest,value:"Pod Manifest"},{id:ho.LoaderFallbackToPodManifest,value:"Loader Fallback to Pod Manifest"}],cr=[{id:go.CodeAttributes,value:"Code Attributes"},{id:go.FullPayloadCollection,value:"Full Payload Collection"},{id:go.DbPayloadCollection,value:"DB Payload Collection"},{id:go.QueryOperationDetector,value:"Query Operation Detector"},{id:go.AllowConcurrentAgents,value:"Allow Concurrent Agents"},{id:go.JavaEbpfInstrumentations,value:"Java EBPF Instrumentations"},{id:go.JavaNativeInstrumentations,value:"Java Native Instrumentations"},{id:go.SizeS,value:"Size S"},{id:go.SizeM,value:"Size M"},{id:go.SizeL,value:"Size L"}],dr=i(({isAdvanced:t,formData:o,handleFormChange:i},n)=>e.createElement(ir,{ref:n,id:or.General},e.createElement(ar,null,e.createElement(nr,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(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(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:cr,value:cr.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(ar,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: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:rr,required:!0,value:rr.find(e=>e.id===o.mountMethod)||void 0,onSelect:e=>i("mountMethod",e.id)}),e.createElement(ot,{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:sr,required:!0,value:sr.find(e=>e.id===o.agentEnvVarsInjectionMethod)||void 0,onSelect:e=>i("agentEnvVarsInjectionMethod",e.id)}),e.createElement(x,{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(x,{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)}}))));dr.displayName=dr.name;const ur=i(({formData:t,handleFormChange:o},i)=>e.createElement(ir,{ref:i,id:or.Rollback},e.createElement(nr,null,"Rollback"),e.createElement(S,{title:"Rollback Disabled",tooltip:"Disable rollback",initialValue:t.rollbackDisabled||!1,onChange:e=>o("rollbackDisabled",e)}),e.createElement(ar,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)}}))));ur.displayName=ur.name;const pr=i(({isAdvanced:t,formData:o,handleFormChange:i},n)=>e.createElement(ir,{ref:n,id:or.CollectorNode},e.createElement(ar,null,e.createElement(nr,null,"Collector Node")),e.createElement(ar,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(ar,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: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(x,{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(ar,null,e.createElement(x,{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(x,{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(x,{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))}}))));pr.displayName=pr.name;const mr=i(({isAdvanced:t,formData:o,handleFormChange:i},n)=>e.createElement(ir,{ref:n,id:or.CollectorGateway},e.createElement(ar,null,e.createElement(nr,null,"Collector Gateway")),e.createElement(ar,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(ar,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(ar,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(ar,null,e.createElement(x,{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(x,{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(x,{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))}}))));mr.displayName=mr.name;const hr=d.div`
421
421
  display: flex;
422
422
  flex-direction: column;
423
423
  gap: 12px;
424
424
  max-height: 100vh;
425
425
  overflow-y: auto;
426
- `,mr=d.div`
426
+ `,gr=d.div`
427
427
  position: relative;
428
- `,hr="System Settings",gr=({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:f}=Je(),{formData:b,handleFormChange:x,resetFormData:C,isFormDirty:$}=so(r);o(()=>{m?a().then(s):s(void 0)},[m]);const[k,w]=t(!1),[D,N]=t(null),I=e=>{$?(w(!0),N(()=>e)):e()},[E,O]=t(er.General),M=n(null),A=n(null),F=n(null),R=n(null),L=n(null),P=n(null),q=[A,F,R,L,P],z=[er.General,er.Ui,er.Rollback,er.CollectorNode,er.CollectorGateway];return e.createElement(e.Fragment,null,e.createElement(dt,{key:hr,onClick:g,tooltip:hr},e.createElement(Vo,{size:18})),e.createElement(H,{width:"750px",isOpen:m,onClose:()=>I(g),header:{icons:[Vo],title:hr,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<q.length;i++){const n=q[i].current;if(n&&n.id===e){const e=t.getBoundingClientRect();o=n.getBoundingClientRect().top-e.top+t.scrollTop;break}}t.scrollTo({top:e===er.General?0:o,behavior:"smooth"})})(e)})(e),selected:E===e})),actions:[e.createElement(mr,{key:"actions"},e.createElement(dt,{withBorder:!0,onClick:()=>f(e=>!e)},e.createElement(T,{size:10},"•••")),e.createElement(Ye,{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:K.CANCEL},{"data-id":"drawer-save",variant:"primary",onClick:async()=>{d(!0),await l(b),s(await a()),d(!1),C(),g()},children:K.SAVE}]}},void 0===b?.imagePrefix||c?e.createElement(we,null,e.createElement(ft,{scale:1.2})):e.createElement(pr,{ref:M},i===ho.Helm&&e.createElement(ie,{type:j.Warning,title:"Helm",message:"Changes won't persist unless you update the `values.yaml` file"}),e.createElement(sr,{ref:A,isAdvanced:u,formData:b,handleFormChange:x}),e.createElement(nr,{ref:F,isAdvanced:u,formData:b,handleFormChange:x}),e.createElement(cr,{ref:R,isAdvanced:u,formData:b,handleFormChange:x}),e.createElement(dr,{ref:L,isAdvanced:u,formData:b,handleFormChange:x}),e.createElement(ur,{ref:P,isAdvanced:u,formData:b,handleFormChange:x}))),e.createElement(W,{isOpen:k,name:hr,onApprove:()=>{D?.(),w(!1)},onDeny:()=>{w(!1)}}))},yr=d.div`
428
+ `,yr="System Settings",vr=({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:$}=uo(r);o(()=>{m?a().then(s):s(void 0)},[m]);const[k,w]=t(!1),[D,N]=t(null),I=e=>{$?(w(!0),N(()=>e)):e()},[E,O]=t(or.General),M=n(null),A=n(null),F=n(null),R=n(null),L=n(null),P=n(null),q=[A,F,R,L,P],z=[or.General,or.Ui,or.Rollback,or.CollectorNode,or.CollectorGateway];return e.createElement(e.Fragment,null,e.createElement(dt,{key:yr,onClick:g,tooltip:yr},e.createElement(_o,{size:18})),e.createElement(H,{width:"750px",isOpen:m,onClose:()=>I(g),header:{icons:[_o],title:yr,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<q.length;i++){const n=q[i].current;if(n&&n.id===e){const e=t.getBoundingClientRect();o=n.getBoundingClientRect().top-e.top+t.scrollTop;break}}t.scrollTo({top:e===or.General?0:o,behavior:"smooth"})})(e)})(e),selected:E===e})),actions:[e.createElement(gr,{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(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: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(bt,{scale:1.2})):e.createElement(hr,{ref:M},i===yo.Helm&&e.createElement(ie,{type:B.Warning,title:"Helm",message:"Changes won't persist unless you update the `values.yaml` file"}),e.createElement(dr,{ref:A,isAdvanced:u,formData:f,handleFormChange:x}),e.createElement(lr,{ref:F,isAdvanced:u,formData:f,handleFormChange:x}),e.createElement(ur,{ref:R,isAdvanced:u,formData:f,handleFormChange:x}),e.createElement(pr,{ref:L,isAdvanced:u,formData:f,handleFormChange:x}),e.createElement(mr,{ref:P,isAdvanced:u,formData:f,handleFormChange:x}))),e.createElement(W,{isOpen:k,name:yr,onApprove:()=>{D?.(),w(!1)},onDeny:()=>{w(!1)}}))},br=d.div`
429
429
  position: fixed;
430
430
  bottom: 12px;
431
431
  left: 12px;
@@ -434,7 +434,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
434
434
  flex-direction: column-reverse;
435
435
  gap: 6px;
436
436
  max-width: 600px;
437
- `,vr=()=>{const{notifications:t,markAsDismissed:o,markAsSeen:i}=L(),{onClickNotification:n}=Bt();return e.createElement(yr,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})})))},fr=d.div`
437
+ `,fr=()=>{const{notifications:t,markAsDismissed:o,markAsSeen:i}=L(),{onClickNotification:n}=Vt();return e.createElement(br,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})})))},xr=d.div`
438
438
  position: relative;
439
439
  display: flex;
440
440
  align-items: center;
@@ -453,7 +453,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
453
453
  stroke: ${({theme:e})=>e.text.secondary};
454
454
  }
455
455
  }
456
- `,br=d.div`
456
+ `,Cr=d.div`
457
457
  position: absolute;
458
458
  top: 2px;
459
459
  left: ${({$darkMode:e})=>e?"2px":"calc(100% - 2px - 24px)"};
@@ -463,50 +463,50 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
463
463
  background-color: ${({theme:e})=>e.colors.border};
464
464
  border-radius: 100%;
465
465
  transition: all 0.3s;
466
- `,xr=({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})),Cr=()=>{const{darkMode:t,setDarkMode:o}=go();return e.createElement(fr,{onClick:()=>o(!t)},e.createElement(xr,{path:"M14 7.977A4.333 4.333 0 1 1 8.023 2H8a6 6 0 1 0 6 6v-.023Z"}),e.createElement(xr,{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(br,{$darkMode:t}))},$r=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)},kr=(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},Sr=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},wr=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:yo(a)}),s.push({title:"Start time",value:new Date(l/1e3).toLocaleString()}),r.length&&(s.push({type:m.Divider}),s.push({title:"Warnings",titleIcon:Uo,value:r})),s},Dr=(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},Nr=d.div`
466
+ `,$r=({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})),kr=()=>{const{darkMode:t,setDarkMode:o}=vo();return e.createElement(xr,{onClick:()=>o(!t)},e.createElement($r,{path:"M14 7.977A4.333 4.333 0 1 1 8.023 2H8a6 6 0 1 0 6 6v-.023Z"}),e.createElement($r,{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(Cr,{$darkMode:t}))},Sr=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)},wr=(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},Dr=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},Nr=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:bo(a)}),s.push({title:"Start time",value:new Date(l/1e3).toLocaleString()}),r.length&&(s.push({type:m.Divider}),s.push({title:"Warnings",titleIcon:Go,value:r})),s},Tr=(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},Ir=d.div`
467
467
  display: flex;
468
468
  flex-direction: column;
469
469
  gap: 12px;
470
470
  max-height: 100vh;
471
471
  overflow-y: auto;
472
- `,Tr=({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:[_o],title:o.operationName},footer:{isOpen:!1}},e.createElement(Nr,null,e.createElement(Y,{title:"Details",data:wr(o)}),o.logs.length>0&&e.createElement(Y,{title:"Errors",titleBadge:o.logs.length,titleIcon:Go,data:Sr(o)}),e.createElement(Y,{title:"Tags",data:kr(o,a),action:e.createElement(vo,{isPrettyMode:a,setIsPrettyMode:l})}),i&&e.createElement(Y,{title:`Process (${i.serviceName})`,data:Dr(i,r),action:e.createElement(vo,{isPrettyMode:r,setIsPrettyMode:s})})))},Ir=370,Er=["#33DCA7","#50F6E8","#444AD9","#8B55FF","#FF7CA9"].reverse(),Or=d.div`
472
+ `,Er=({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:[Jo],title:o.operationName},footer:{isOpen:!1}},e.createElement(Ir,null,e.createElement(Y,{title:"Details",data:Nr(o)}),o.logs.length>0&&e.createElement(Y,{title:"Errors",titleBadge:o.logs.length,titleIcon:Yo,data:Dr(o)}),e.createElement(Y,{title:"Tags",data:wr(o,a),action:e.createElement(fo,{isPrettyMode:a,setIsPrettyMode:l})}),i&&e.createElement(Y,{title:`Process (${i.serviceName})`,data:Tr(i,r),action:e.createElement(fo,{isPrettyMode:r,setIsPrettyMode:s})})))},Or=370,Mr=["#33DCA7","#50F6E8","#444AD9","#8B55FF","#FF7CA9"].reverse(),Ar=d.div`
473
473
  display: flex;
474
474
  align-items: center;
475
- width: ${Ir}px;
475
+ width: ${Or}px;
476
476
  background-color: ${({$withErrors:e,theme:t})=>e?t.colors.error+I.opacity.hex["042"]:t.colors.dark_grey};
477
477
  &:hover {
478
478
  ${({$withErrors:e,$preventHover:t,theme:o})=>!t&&`background-color: ${e?o.colors.error:o.colors.secondary+I.opacity.hex["010"]};`}
479
479
  cursor: ${({$preventHover:e})=>e?"default":"pointer"};
480
480
  }
481
- `,Mr=d(ce)`
481
+ `,Fr=d(ce)`
482
482
  align-items: center;
483
483
  justify-content: space-between;
484
484
  gap: 4px;
485
485
  padding: 12px;
486
486
  padding-left: ${({$depth:e})=>12*e||12}px;
487
- width: calc(${Ir}px - ${({$depth:e})=>12*e}px);
488
- `,Ar=d(ce)`
487
+ width: calc(${Or}px - ${({$depth:e})=>12*e}px);
488
+ `,Rr=d(ce)`
489
489
  align-items: center;
490
490
  gap: 4px;
491
491
  position: absolute;
492
492
  right: 56px;
493
493
  width: calc(100% - ${434}px);
494
- `,Fr=d.div`
494
+ `,Lr=d.div`
495
495
  position: absolute;
496
496
  left: ${({$startTime:e,$minStartTime:t,$maxEndTime:o})=>(e-t)/(o-t)*100+"%"};
497
497
  width: ${({$duration:e,$maxDuration:t})=>e/t*100+"%"};
498
498
  height: 12px;
499
499
  border-radius: 32px;
500
- background-color: ${({$indexInMatrix:e})=>Er[e%Er.length]};
501
- `,Rr=d(T)`
500
+ background-color: ${({$indexInMatrix:e})=>Mr[e%Mr.length]};
501
+ `,Pr=d(T)`
502
502
  padding-left: calc(100% + 8px);
503
503
  font-size: 10px;
504
504
  color: ${({theme:e})=>e.text.darker_grey};
505
505
  font-family: ${({theme:e})=>e.font_family.secondary};
506
506
  white-space: nowrap;
507
- `,Lr=({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=Ir-12*i-20-(s?12:0),f=s&&(1===i||o.logs.length>0);return e.createElement(Or,{className:"span-container",$withErrors:s,$preventHover:g,onClick:m},e.createElement(Mr,{$depth:i,className:"span-left"},e.createElement(ce,{$gap:4,$alignItems:"center"},u?e.createElement("div",{onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1)},e.createElement(dt,{onClick:e=>{e.stopPropagation(),p?.()},size:24},e.createElement(ut,{extend:d??!1}))):e.createElement("div",{style:{width:"24px"}}),e.createElement(bo,{maxWidth:v/2,text:o.processID,textSize:14}),e.createElement(T,{size:12,color:h.text.darker_grey},"•"),e.createElement(bo,{maxWidth:v/2,text:o.operationName,textSize:12,textColor:h.text.darker_grey})),s&&(f?e.createElement(ue,{...c},e.createElement(Go,{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(Ar,{className:"span-right"},e.createElement(Fr,{$indexInMatrix:n,$duration:o.duration,$maxDuration:a,$startTime:o.startTime,$minStartTime:l,$maxEndTime:r},e.createElement(Rr,null,yo(o.duration)))))},Pr=({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:fo(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,f=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(Lr,{span:t,depth:i,indexInMatrix:n+u+i,maxDuration:a,minStartTime:l,maxEndTime:r,withErrors:y,errorTooltip:{titleIcon:Go,title:v,text:f},isOpen:m,withToggle:h,onToggleOpen:()=>s.set(e=>e.some(e=>e===p)?e.filter(e=>e!=p):[...e,p,...fo(t,"spans","spanID")]),onSelect:()=>c.set(e=>e?.spanID===p?null:t)}),m&&h?e.createElement(Pr,{spans:t.spans||[],logs:g,depth:i+1,indexInMatrix:n+u,maxDuration:a,minStartTime:l,maxEndTime:r,openSpanIdsState:s,selectedSpanState:c}):null)})},qr=d.div`
507
+ `,qr=({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=Or-12*i-20-(s?12:0),b=s&&(1===i||o.logs.length>0);return e.createElement(Ar,{className:"span-container",$withErrors:s,$preventHover:g,onClick:m},e.createElement(Fr,{$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(Co,{maxWidth:v/2,text:o.processID,textSize:14}),e.createElement(T,{size:12,color:h.text.darker_grey},"•"),e.createElement(Co,{maxWidth:v/2,text:o.operationName,textSize:12,textColor:h.text.darker_grey})),s&&(b?e.createElement(ue,{...c},e.createElement(Yo,{fill:h.text.error})):e.createElement("div",{style:{position:"relative"}},e.createElement("div",{style:{position:"absolute",top:"-24px",right:"8px"}},e.createElement(le,{type:B.Error,orientation:"vertical",thickness:1,length:"48px",margin:"0",opacity:.5}))))),e.createElement(Rr,{className:"span-right"},e.createElement(Lr,{$indexInMatrix:n,$duration:o.duration,$maxDuration:a,$startTime:o.startTime,$minStartTime:l,$maxEndTime:r},e.createElement(Pr,null,bo(o.duration)))))},Kr=({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:xo(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(qr,{span:t,depth:i,indexInMatrix:n+u+i,maxDuration:a,minStartTime:l,maxEndTime:r,withErrors:y,errorTooltip:{titleIcon:Yo,title:v,text:b},isOpen:m,withToggle:h,onToggleOpen:()=>s.set(e=>e.some(e=>e===p)?e.filter(e=>e!=p):[...e,p,...xo(t,"spans","spanID")]),onSelect:()=>c.set(e=>e?.spanID===p?null:t)}),m&&h?e.createElement(Kr,{spans:t.spans||[],logs:g,depth:i+1,indexInMatrix:n+u,maxDuration:a,minStartTime:l,maxEndTime:r,openSpanIdsState:s,selectedSpanState:c}):null)})},Hr=d.div`
508
508
  width: 100%;
509
- `,Kr=d.div`
509
+ `,zr=d.div`
510
510
  max-height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px + 2px)`};
511
511
  overflow: auto;
512
512
 
@@ -516,22 +516,22 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
516
516
  border-radius: 24px;
517
517
  border: 1px solid ${({theme:e})=>e.colors.dropdown_bg_2};
518
518
  position: relative;
519
- `,Hr=d.div`
519
+ `,Wr=d.div`
520
520
  padding: 12px 12px 12px 24px;
521
- width: calc(${Ir}px - 36px);
521
+ width: calc(${Or}px - 36px);
522
522
  background-color: ${({theme:e})=>e.colors.dark_grey};
523
- `,zr=d.div`
523
+ `,jr=d.div`
524
524
  width: 1px;
525
525
  height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px + 2px)`};
526
526
  background: ${({theme:e})=>`linear-gradient(to bottom, ${e.colors.border}, transparent)`};
527
527
 
528
528
  position: absolute;
529
- left: calc(${Ir}px + ((100% - ${Ir}px) / ${5}) * ${({index:e})=>e});
530
- `,Wr=d(T)`
529
+ left: calc(${Or}px + ((100% - ${Or}px) / ${5}) * ${({index:e})=>e});
530
+ `,Br=d(T)`
531
531
  color: ${({theme:e})=>e.text.darker_grey};
532
532
  font-size: 12px;
533
533
  font-family: ${({theme:e})=>e.font_family.secondary};
534
534
  padding-top: 12px;
535
535
  padding-left: 12px;
536
536
  white-space: nowrap;
537
- `,Br=({heightToRemove:o,traces:i,isLoading:n})=>{const[a,r]=t([]),[s,c]=t(null),d=l(()=>Dt(i).sort((e,t)=>t.spans[0].startTime-e.spans[0].startTime).map(e=>({...e,spans:$r(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(qr,{$heightToRemove:o},n?e.createElement(we,{$height:"50vh"},e.createElement(ft,{scale:1.5})):d.length?e.createElement(Kr,{$heightToRemove:o},e.createElement(Hr,null,e.createElement(T,null,"Service & operation")),new Array(5).fill(null).map((t,i)=>e.createElement(zr,{key:`${i}-divider`,$heightToRemove:o,index:i},e.createElement(Wr,null,yo(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(Pr,{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(Tr,{span:s,process:m,onClose:()=>c(null)}))};export{wi as ActionDrawer,xi as ActionForm,Ni as ActionModal,Ai as ActionTable,qi as AwaitPipeline,mn as ConditionDropdown,sn as DataFlow,qn as DataFlowActionsMenu,Tn as DataStreamDrawer,Dn as DataStreamForm,Hn as DataStreamModal,Kn as DataStreamSelectionForm,Zn as DestinationDrawer,Yn as DestinationForm,fa as DestinationModal,ka as DestinationSelectionForm,wa as DestinationTable,hn as ErrorDropdown,za as InstrumentationRuleDrawer,qa as InstrumentationRuleForm,ja as InstrumentationRuleModal,_a as InstrumentationRuleTable,fn as KindDropdown,gn as LanguageDropdown,yn as MonitorDropdown,Ja as MultiSourceControl,vn as NamespaceDropdown,wl as NavIconIds,tl as NotificationManager,Ci as OverviewDrawer,pl as ServiceMap,Sl as SetupSummary,Dl as SideNav,Nl as SlackInvite,Hl as SourceDrawer,El as SourceForm,Bl as SourceModal,Wl as SourceSelectionForm,Vl as SourceTable,Zl as SystemOverview,gr as SystemSettings,Ii as TableCellConditions,vr as ToastList,Cr as ToggleDarkMode,Br as TraceView};
537
+ `,Vr=({heightToRemove:o,traces:i,isLoading:n})=>{const[a,r]=t([]),[s,c]=t(null),d=l(()=>Dt(i).sort((e,t)=>t.spans[0].startTime-e.spans[0].startTime).map(e=>({...e,spans:Sr(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(Hr,{$heightToRemove:o},n?e.createElement(we,{$height:"50vh"},e.createElement(bt,{scale:1.5})):d.length?e.createElement(zr,{$heightToRemove:o},e.createElement(Wr,null,e.createElement(T,null,"Service & operation")),new Array(5).fill(null).map((t,i)=>e.createElement(jr,{key:`${i}-divider`,$heightToRemove:o,index:i},e.createElement(Br,null,bo(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(Kr,{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(Er,{span:s,process:m,onClose:()=>c(null)}))};export{Ni as ActionDrawer,$i as ActionForm,Ii as ActionModal,Ri as ActionTable,Hi as AwaitPipeline,gn as ConditionDropdown,dn as DataFlow,Hn as DataFlowActionsMenu,En as DataStreamDrawer,Tn as DataStreamForm,Wn as DataStreamModal,zn as DataStreamSelectionForm,ta as DestinationDrawer,Xn as DestinationForm,xa as DestinationModal,wa as DestinationSelectionForm,Na as DestinationTable,yn as ErrorDropdown,ja as InstrumentationRuleDrawer,Ha as InstrumentationRuleForm,Ua as InstrumentationRuleModal,Ja as InstrumentationRuleTable,xn as KindDropdown,vn as LanguageDropdown,bn as MonitorDropdown,Qa as MultiSourceControl,fn as NamespaceDropdown,Nl as NavIconIds,il as NotificationManager,ki as OverviewDrawer,hl as ServiceMap,Dl as SetupSummary,Tl as SideNav,Il as SlackInvite,Wl as SourceDrawer,Ml as SourceForm,Vl as SourceModal,Bl as SourceSelectionForm,_l as SourceTable,tr as SystemOverview,vr as SystemSettings,Oi as TableCellConditions,fr as ToastList,kr as ToggleDarkMode,Vr as TraceView};