@odigos/ui-kit 0.0.164 → 0.0.165

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.
Files changed (40) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/lib/chunks/ui-components-76a424df.js +2266 -0
  3. package/lib/components/_v2/badge/index.d.ts +5 -1
  4. package/lib/components/_v2/cards/section-card/index.d.ts +3 -20
  5. package/lib/components/_v2/drop-data/index.d.ts +8 -3
  6. package/lib/components/_v2/hover-actions/index.d.ts +1 -1
  7. package/lib/components/_v2/index.d.ts +1 -0
  8. package/lib/components/_v2/island/index.d.ts +9 -0
  9. package/lib/components/_v2/table/index.d.ts +1 -1
  10. package/lib/components/_v2/table/table-rows/index.d.ts +1 -1
  11. package/lib/components/_v2/table/types.d.ts +2 -1
  12. package/lib/components/no-data-found/index.d.ts +2 -3
  13. package/lib/components/v2.js +1 -1
  14. package/lib/components.js +1 -1
  15. package/lib/constants.js +1 -1
  16. package/lib/containers/_v2/central-connections/index.d.ts +7 -5
  17. package/lib/containers/_v2/central-connections/source-drawer/index.d.ts +4 -7
  18. package/lib/containers/_v2/central-connections/source-drawer/namespaces-column/index.d.ts +14 -0
  19. package/lib/containers/_v2/central-connections/source-drawer/styled.d.ts +17 -0
  20. package/lib/containers/_v2/central-connections/source-drawer/types.d.ts +21 -0
  21. package/lib/containers/_v2/central-connections/source-drawer/workloads-column/index.d.ts +14 -0
  22. package/lib/containers/v2.js +37 -36
  23. package/lib/containers.js +44 -44
  24. package/lib/contexts.js +1 -1
  25. package/lib/functions.js +1 -1
  26. package/lib/hooks.js +1 -1
  27. package/lib/snippets/_v2/actions/index.d.ts +20 -0
  28. package/lib/snippets/_v2/index.d.ts +2 -0
  29. package/lib/snippets/_v2/rich-title/index.d.ts +11 -0
  30. package/lib/snippets.js +1 -1
  31. package/lib/store.js +1 -1
  32. package/lib/theme.js +1 -1
  33. package/lib/types/snapshot/index.d.ts +2 -1
  34. package/lib/types/sources/index.d.ts +13 -0
  35. package/lib/types.js +1 -1
  36. package/lib/visuals.js +1 -24
  37. package/package.json +1 -1
  38. package/lib/chunks/index-53f81cb1.js +0 -3
  39. package/lib/chunks/index-64bb5a64.js +0 -9
  40. package/lib/chunks/ui-components-fabd01fd.js +0 -2235
package/lib/containers.js CHANGED
@@ -1,4 +1,4 @@
1
- import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperativeHandle as o,useMemo as l,Fragment as r,useCallback as s,Children as c}from"react";import d,{css as u,useTheme as p}from"styled-components";import{A as m,E as h,G as g,K as y,H as v,J as b,M as f,Q as x,R as $,V as S,X as k,Y as C,Z as w,_ as T,$ as D,a0 as N,a1 as E,p as I,a2 as O,a3 as A,a4 as F,a5 as M,a6 as R,a7 as L,a8 as P,a9 as K,aa as j,ab as V,ac as q,ad as H,ae as z,af as B,f as W,ag as _,ah as J,ai as U,aj as G,ak as Y,al as X,am as Z,an as Q,F as ee,ao as te,ap as ie,aq as ae,ar as ne,as as oe,at as le,au as re,av as se,aw as ce,ax as de,a as ue,ay as pe,az as me,aA as he,aB as ge,aC as ye,aD as ve,aE as be,aF as fe,aG as xe,aH as $e,aI as Se,aJ as ke,aK as Ce,aL as we,aM as Te,r as De,aN as Ne,aO as Ee,aP as Ie,aQ as Oe,aR as Ae,aS as Fe,aT as Me,aU as Re,e as Le,aV as Pe,aW as Ke,aX as je,aY as Ve,aZ as qe,a_ as He,a$ as ze,b0 as Be,b1 as We,b2 as _e,b3 as Je,b4 as Ue,b5 as Ge,b6 as Ye,b7 as Xe,b8 as Ze,b9 as Qe,ba as et,bb as tt,bc as it,bd as at,be as nt,bf as ot,bg as lt,bh as rt,bi as st,bj as ct,bk as dt,bl as ut,bm as pt,bn as mt,bo as ht,bp as gt,bq as yt,br as vt,bs as bt,bt as ft,bu as xt,bv as $t,bw as St,bx as kt,by as Ct,bz as wt,bA as Tt,bB as Dt,bC as Nt,bD as Et,bE as It,bF as Ot,bG as At,bH as Ft,bI as Mt,bJ as Rt,bK as Lt,bL as Pt,bM as Kt,bN as jt,bO as Vt,bP as qt,bQ as Ht,i as zt,bR as Bt,bS as Wt,bT as _t,bU as Jt,bV as Ut,bW as Gt,bX as Yt,bY as Xt,bZ as Zt,b_ as Qt,b$ as ei,k as ti,c0 as ii,c1 as ai,c2 as ni,c3 as oi,c4 as li,c5 as ri,c6 as si,c7 as ci,c8 as di,c9 as ui,ca as pi,u as mi,cb as hi,cc as gi,cd as yi,ce as vi,cf as bi,cg as fi,ch as xi}from"./chunks/ui-components-fabd01fd.js";import{VSquareIcon as $i,XSquareIcon as Si,EditIcon as ki,TrashIcon as Ci,OdigosLogoText as wi,PlusIcon as Ti,RefreshIcon as Di,SearchIcon as Ni,FilterIcon as Ei,DataStreamIcon as Ii,VIcon as Oi,OdigosLogo as Ai,ArrowIcon as Fi,RefreshLeftArrowIcon as Mi,NotificationIcon as Ri,UserIcon as Li,ImageErrorIcon as Pi,OverviewIcon as Ki,InstrumentationRuleIcon as ji,ActionIcon as Vi,SourceIcon as qi,DestinationIcon as Hi,SlackLogo as zi,KeyIcon as Bi,TerminalIcon as Wi,ExclamationTriangleIcon as _i,TraceViewIcon as Ji}from"./icons.js";import{MarkerType as Ui,useNodesState as Gi,useEdgesState as Yi,applyNodeChanges as Xi}from"@xyflow/react";import{Y as Zi}from"./chunks/index-53f81cb1.js";import"zustand";import"javascript-time-ago";import"./chunks/vendor-55cc654c.js";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";const Qi=e=>{const{type:t,name:i,notes:a,signals:n,disabled:o,fields:{collectContainerAttributes:l,collectReplicaSetAttributes:r,collectWorkloadId:s,collectClusterId:c,labelsAttributes:d,annotationsAttributes:u,clusterAttributes:p,overwriteExistingValues:v,attributeNamesToDelete:b,renames:f,piiCategories:x,fallbackSamplingRatio:$,samplingPercentage:S,endpointsFilters:k,servicesNameFilters:C,attributeFilters:w}}=e,T=[{title:m.TYPE,value:t},{type:h.ActiveStatus,title:m.STATUS,value:String(!o)},{type:h.Monitors,title:m.SIGNALS_FOR_PROCESSING,value:n?.map(e=>e.toLowerCase()).join(", ")||""},{title:m.NAME,value:i||""},{title:m.NOTES,value:a||""},{type:h.Divider}];if(t===g.K8sAttributes&&(T.push({title:"Collect Container Attributes",value:String(l)}),T.push({title:"Collect ReplicaSet Attributes",value:String(r)}),T.push({title:"Collect Workload ID",value:String(s)}),T.push({title:"Collect Cluster ID",value:String(c)}),d?.length&&T.push({type:h.Divider}),d?.forEach(({labelKey:e,attributeKey:t,from:i,fromSources:a},n)=>{let o="";o+=`Label Key: ${e}\n`,o+=`Attribute Key: ${t}\n`,o+=`From: ${a?.length?a.join(", "):i||y.Pod}\n`,T.push({title:"Label"+(d.length>1?` #${n+1}`:""),value:o})}),u?.length&&T.push({type:h.Divider}),u?.forEach(({annotationKey:e,attributeKey:t,from:i,fromSources:a},n)=>{let o="";o+=`Annotation Key: ${e}\n`,o+=`Attribute Key: ${t}\n`,o+=`From: ${a?.length?a.join(", "):i||y.Pod}\n`,T.push({title:"Annotation"+(u.length>1?` #${n+1}`:""),value:o})})),t===g.AddClusterInfo){T.push({title:"Overwrite Existing Values",value:String(v||!1)});let e="";p?.forEach(({attributeName:t,attributeStringValue:i},a)=>{e+=`${t}: ${i}`,a<p.length-1&&(e+=", ")}),T.push({title:"Attributes",value:e})}if(t===g.DeleteAttributes){let e="";b?.forEach((t,i)=>{e+=t,i<b.length-1&&(e+=", ")}),T.push({title:"Attributes",value:e})}if(t===g.RenameAttributes){let e="";const t=Object.entries(f||{});t.forEach(([i,a],n)=>{e+=`${i}: ${a}`,n<t.length-1&&(e+=", ")}),T.push({title:"Attributes",value:e})}if(t===g.PiiMasking){let e="";x?.forEach((t,i)=>{e+=t,i<x.length-1&&(e+=", ")}),T.push({title:"Categories",value:e})}return t===g.ErrorSampler&&T.push({title:"Sampling Ratio",value:String($)}),t===g.ProbabilisticSampler&&T.push({title:"Sampling Percentage",value:String(S)}),t===g.LatencySampler&&k?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:i,fallbackSamplingRatio:a},n)=>{let o="";o+=`Service Name: ${e}\n`,o+=`HTTP Route: ${t}\n`,o+=`Min. Latency: ${i}\n`,o+=`Fallback Sampling Ratio: ${a}`,T.push({title:"Endpoint"+(k.length>1?` #${n+1}`:""),value:o})}),t===g.ServiceNameSampler&&C?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:i},a)=>{let n="";n+=`Service Name: ${e}\n`,n+=`Sampling Ratio: ${t}\n`,n+=`Fallback Sampling Ratio: ${i}`,T.push({title:"Filter"+(C.length>1?` #${a+1}`:""),value:n})}),t===g.SpanAttributeSampler&&w?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:i,condition:a},n)=>{let o="";o+=`Service Name: ${e}\n`,o+=`Attribute Key: ${t}\n`,o+=`Fallback Sampling Ratio: ${i}\n`;const l=Object.keys(a)[0];o+=`Condition: ${l}\n`,o+=`Operation: ${a[l]?.operation}\n`,o+=`Expected Value: ${a[l]?.expectedValue}`,"jsonCondition"===l&&(o+=`\nJSON Path: ${a[l].jsonPath}`),T.push({title:"Filter"+(w.length>1?` #${n+1}`:""),value:o})}),T},ea=x.PiiCategories,ta=d.div`
1
+ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperativeHandle as o,useMemo as l,Fragment as r,useCallback as s,Children as c}from"react";import d,{css as u,useTheme as p}from"styled-components";import{_ as m,$ as h,a0 as g,a1 as y,a2 as v,a3 as b,a4 as f,a5 as x,a6 as $,a7 as S,a8 as k,a9 as C,aa as w,ab as T,ac as D,ad as N,ae as E,x as I,af as O,ag as A,ah as F,ai as M,aj as R,ak as L,al as P,am as j,an as K,ao as V,ap as q,aq as z,ar as H,E as B,S as W,as as _,at as J,au as U,av as G,aw as Y,ax as X,ay as Z,az as Q,F as ee,aA as te,aB as ie,aC as ae,aD as ne,aE as oe,aF as le,aG as re,aH as se,aI as ce,aJ as de,a as ue,aK as pe,c as me,aL as he,aM as ge,aN as ye,aO as ve,aP as be,aQ as fe,aR as xe,aS as $e,aT as Se,aU as ke,aV as Ce,aW as we,aX as Te,z as De,N as Ne,aY as Ee,aZ as Ie,a_ as Oe,a$ as Ae,b0 as Fe,b1 as Me,b2 as Re,n as Le,b3 as Pe,b4 as je,b5 as Ke,b6 as Ve,b7 as qe,b8 as ze,b9 as He,ba as Be,bb as We,bc as _e,u as Je,bd as Ue,be as Ge,bf as Ye,bg as Xe,bh as Ze,bi as Qe,bj as et,bk as tt,bl as it,bm as at,bn as nt,bo as ot,bp as lt,bq as rt,br as st,bs as ct,bt as dt,bu as ut,bv as pt,D as mt,bw as ht,bx as gt,by as yt,bz as vt,bA as bt,bB as ft,bC as xt,bD as $t,bE as St,bF as kt,bG as Ct,bH as wt,bI as Tt,f as Dt,bJ as Nt,bK as Et,bL as It,bM as Ot,bN as At,bO as Ft,bP as Mt,bQ as Rt,bR as Lt,bS as Pt,bT as jt,bU as Kt,bV as Vt,bW as qt,bX as zt,o as Ht,bY as Bt,bZ as Wt,b_ as _t,b$ as Jt,c0 as Ut,c1 as Gt,c2 as Yt,c3 as Xt,c4 as Zt,c5 as Qt,Y as ei,c6 as ti,q as ii,c7 as ai,c8 as ni,c9 as oi,ca as li,cb as ri,cc as si,cd as ci,ce as di,cf as ui,cg as pi,ch as mi,m as hi,ci as gi,cj as yi,ck as vi,cl as bi,cm as fi,cn as xi,co as $i}from"./chunks/ui-components-76a424df.js";import{VSquareIcon as Si,XSquareIcon as ki,EditIcon as Ci,TrashIcon as wi,OdigosLogoText as Ti,PlusIcon as Di,RefreshIcon as Ni,SearchIcon as Ei,FilterIcon as Ii,DataStreamIcon as Oi,VIcon as Ai,OdigosLogo as Fi,ArrowIcon as Mi,RefreshLeftArrowIcon as Ri,NotificationIcon as Li,UserIcon as Pi,ImageErrorIcon as ji,OverviewIcon as Ki,InstrumentationRuleIcon as Vi,ActionIcon as qi,SourceIcon as zi,DestinationIcon as Hi,SlackLogo as Bi,KeyIcon as Wi,TerminalIcon as _i,ExclamationTriangleIcon as Ji,TraceViewIcon as Ui}from"./icons.js";import{MarkerType as Gi,useNodesState as Yi,useEdgesState as Xi,applyNodeChanges as Zi}from"@xyflow/react";import"zustand";import"javascript-time-ago";import"./chunks/vendor-55cc654c.js";import"react-dom";import"react-error-boundary";import"lottie-react";import"prism-react-renderer";const Qi=e=>{const{type:t,name:i,notes:a,signals:n,disabled:o,fields:{collectContainerAttributes:l,collectReplicaSetAttributes:r,collectWorkloadId:s,collectClusterId:c,labelsAttributes:d,annotationsAttributes:u,clusterAttributes:p,overwriteExistingValues:v,attributeNamesToDelete:b,renames:f,piiCategories:x,fallbackSamplingRatio:$,samplingPercentage:S,endpointsFilters:k,servicesNameFilters:C,attributeFilters:w}}=e,T=[{title:m.TYPE,value:t},{type:h.ActiveStatus,title:m.STATUS,value:String(!o)},{type:h.Monitors,title:m.SIGNALS_FOR_PROCESSING,value:n?.map(e=>e.toLowerCase()).join(", ")||""},{title:m.NAME,value:i||""},{title:m.NOTES,value:a||""},{type:h.Divider}];if(t===g.K8sAttributes&&(T.push({title:"Collect Container Attributes",value:String(l)}),T.push({title:"Collect ReplicaSet Attributes",value:String(r)}),T.push({title:"Collect Workload ID",value:String(s)}),T.push({title:"Collect Cluster ID",value:String(c)}),d?.length&&T.push({type:h.Divider}),d?.forEach(({labelKey:e,attributeKey:t,from:i,fromSources:a},n)=>{let o="";o+=`Label Key: ${e}\n`,o+=`Attribute Key: ${t}\n`,o+=`From: ${a?.length?a.join(", "):i||y.Pod}\n`,T.push({title:"Label"+(d.length>1?` #${n+1}`:""),value:o})}),u?.length&&T.push({type:h.Divider}),u?.forEach(({annotationKey:e,attributeKey:t,from:i,fromSources:a},n)=>{let o="";o+=`Annotation Key: ${e}\n`,o+=`Attribute Key: ${t}\n`,o+=`From: ${a?.length?a.join(", "):i||y.Pod}\n`,T.push({title:"Annotation"+(u.length>1?` #${n+1}`:""),value:o})})),t===g.AddClusterInfo){T.push({title:"Overwrite Existing Values",value:String(v||!1)});let e="";p?.forEach(({attributeName:t,attributeStringValue:i},a)=>{e+=`${t}: ${i}`,a<p.length-1&&(e+=", ")}),T.push({title:"Attributes",value:e})}if(t===g.DeleteAttributes){let e="";b?.forEach((t,i)=>{e+=t,i<b.length-1&&(e+=", ")}),T.push({title:"Attributes",value:e})}if(t===g.RenameAttributes){let e="";const t=Object.entries(f||{});t.forEach(([i,a],n)=>{e+=`${i}: ${a}`,n<t.length-1&&(e+=", ")}),T.push({title:"Attributes",value:e})}if(t===g.PiiMasking){let e="";x?.forEach((t,i)=>{e+=t,i<x.length-1&&(e+=", ")}),T.push({title:"Categories",value:e})}return t===g.ErrorSampler&&T.push({title:"Sampling Ratio",value:String($)}),t===g.ProbabilisticSampler&&T.push({title:"Sampling Percentage",value:String(S)}),t===g.LatencySampler&&k?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:i,fallbackSamplingRatio:a},n)=>{let o="";o+=`Service Name: ${e}\n`,o+=`HTTP Route: ${t}\n`,o+=`Min. Latency: ${i}\n`,o+=`Fallback Sampling Ratio: ${a}`,T.push({title:"Endpoint"+(k.length>1?` #${n+1}`:""),value:o})}),t===g.ServiceNameSampler&&C?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:i},a)=>{let n="";n+=`Service Name: ${e}\n`,n+=`Sampling Ratio: ${t}\n`,n+=`Fallback Sampling Ratio: ${i}`,T.push({title:"Filter"+(C.length>1?` #${a+1}`:""),value:n})}),t===g.SpanAttributeSampler&&w?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:i,condition:a},n)=>{let o="";o+=`Service Name: ${e}\n`,o+=`Attribute Key: ${t}\n`,o+=`Fallback Sampling Ratio: ${i}\n`;const l=Object.keys(a)[0];o+=`Condition: ${l}\n`,o+=`Operation: ${a[l]?.operation}\n`,o+=`Expected Value: ${a[l]?.expectedValue}`,"jsonCondition"===l&&(o+=`\nJSON Path: ${a[l].jsonPath}`),T.push({title:"Filter"+(w.length>1?` #${n+1}`:""),value:o})}),T},ea=x.PiiCategories,ta=d.div`
2
2
  display: flex;
3
3
  flex-direction: row;
4
4
  gap: 32px;
@@ -14,7 +14,7 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
14
14
  padding: 4px;
15
15
  `,fa=d(E)`
16
16
  margin-bottom: 12px;
17
- `,xa=({isUpdate:t,action:i,formData:a,formErrors:n,handleFormChange:o})=>{const l=I.useTheme();return e.createElement(ba,null,t&&e.createElement("div",null,e.createElement(fa,null,"Status"),e.createElement(O,{options:[{icon:$i,label:m.ENABLED,value:!1,selectedBgColor:l.text.success+I.opacity.hex["050"]},{icon:Si,label:m.DISABLED,value:!0,selectedBgColor:l.text.error+I.opacity.hex["050"]}],selected:a.disabled,setSelected:e=>o("disabled",e)})),!t&&e.createElement(A,{title:"",description:i.docsDescription,actionButton:e.createElement(F,{endpoint:i.docsEndpoint})}),e.createElement(M,{title:"Signals for Processing",required:!0,allowedSignals:i.allowedSignals,selectedSignals:a.signals||[],setSelectedSignals:e=>o("signals",e),errorMessage:n.signals}),!t&&e.createElement($,{title:"Action name",placeholder:"Use a name that describes the action",value:a.name||"",onChange:({target:{value:e}})=>o("name",e),errorMessage:n.name}),e.createElement(va,{actionType:i.type,value:a.fields,setValue:(e,t)=>o(`fields.${e}`,t),formErrors:n}),e.createElement(R,{title:"Notes",value:a.notes||"",onChange:({target:{value:e}})=>o("notes",e),errorMessage:n.notes}))},$a=a(({children:i,width:a=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:$},S)=>{const k=I.useTheme(),{isThisPending:C}=L(),{addNotification:w}=P(),{drawerType:T,drawerEntityId:D,setDrawerType:N,setDrawerEntityId:O}=K();j({key:"Enter",active:p},()=>Q());const[A,F]=t(!1),[M,R]=t(!1),_=n(null),J=T===B.Source,U=()=>{F(!1),R(!1)},G=()=>{U(),y&&y(!1),N(null),O(null),g?.()};o(S,()=>({closeDrawer:G}));const Y=()=>{_.current?.clearTitle(),f&&f(),U()},X=()=>{const e=_.current?.isTitleDirty();m||e?R(!0):Y()},Z=()=>{F(!0)},Q=()=>{v&&v(_.current?.getTitle()||"")},ee=l(()=>!!T&&C({entityType:T,entityId:D}),[T,D]),te=e=>{w({type:W.Warning,title:"Pending",message:`Cannot click ${e}, ${T} is pending`,hideFromHistory:!0})},ie=$||[];return y&&!p&&ie.push({"data-id":"drawer-edit",variant:"tertiary",onClick:ee?()=>te("edit"):()=>y(!0),children:e.createElement(e.Fragment,null,e.createElement(ki,null),e.createElement(E,{size:14,family:"secondary",decoration:"underline"},"Edit"))}),b&&!p&&ie.push({"data-id":"drawer-delete",variant:"tertiary",onClick:ee?()=>te(J?"uninstrument":"delete"):Z,children:e.createElement(e.Fragment,null,e.createElement(Ci,null),e.createElement(E,{color:k.text.error,size:14,family:"secondary",decoration:"underline"},J?V.UNINSTRUMENT:V.DELETE))}),e.createElement(e.Fragment,null,e.createElement(q,{isOpen:!0,onClose:p?X:G,closeOnEscape:!A&&!M,width:`${a+64}px`,header:{icons:d,iconSrcs:u,title:r,titleTooltip:s,replaceTitleWith:!c&&p?e.createElement(Sa,{ref:_,title:r}):void 0,actionButtons:ie,tabs:x},footer:{isOpen:p,leftButtons:[{"data-id":"drawer-save",variant:"primary",onClick:Q,children:V.SAVE},{"data-id":"drawer-cancel",variant:"secondary",onClick:X,children:V.CANCEL}],rightButtons:b?[{"data-id":"drawer-delete",variant:"tertiary",onClick:Z,children:e.createElement(e.Fragment,null,e.createElement(Ci,null),e.createElement(E,{size:14,color:k.text.error,family:"secondary",decoration:"underline"},V.DELETE))}]:[]}},i),e.createElement(H,{isOpen:A,noOverlay:!0,name:`${T}${r?` (${r})`:""}`,type:T,isLastItem:h,onApprove:()=>{b&&b(),U()},onDeny:U}),e.createElement(z,{isOpen:M,noOverlay:!0,name:"edit mode",onApprove:Y,onDeny:U}))}),Sa=a(({title:a},n)=>{const[l,r]=t(a);return i(()=>{r(a)},[a]),o(n,()=>({getTitle:()=>l||a,isTitleDirty:()=>l!==a,clearTitle:()=>r(a)})),e.createElement($,{"data-id":"title",value:l,onChange:e=>r(e.target.value)})});Sa.displayName=Sa.name,$a.displayName=$a.name;const ka=d.div`
17
+ `,xa=({isUpdate:t,action:i,formData:a,formErrors:n,handleFormChange:o})=>{const l=I.useTheme();return e.createElement(ba,null,t&&e.createElement("div",null,e.createElement(fa,null,"Status"),e.createElement(O,{options:[{icon:Si,label:m.ENABLED,value:!1,selectedBgColor:l.text.success+I.opacity.hex["050"]},{icon:ki,label:m.DISABLED,value:!0,selectedBgColor:l.text.error+I.opacity.hex["050"]}],selected:a.disabled,setSelected:e=>o("disabled",e)})),!t&&e.createElement(A,{title:"",description:i.docsDescription,actionButton:e.createElement(F,{endpoint:i.docsEndpoint})}),e.createElement(M,{title:"Signals for Processing",required:!0,allowedSignals:i.allowedSignals,selectedSignals:a.signals||[],setSelectedSignals:e=>o("signals",e),errorMessage:n.signals}),!t&&e.createElement($,{title:"Action name",placeholder:"Use a name that describes the action",value:a.name||"",onChange:({target:{value:e}})=>o("name",e),errorMessage:n.name}),e.createElement(va,{actionType:i.type,value:a.fields,setValue:(e,t)=>o(`fields.${e}`,t),formErrors:n}),e.createElement(R,{title:"Notes",value:a.notes||"",onChange:({target:{value:e}})=>o("notes",e),errorMessage:n.notes}))},$a=a(({children:i,width:a=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:$},S)=>{const k=I.useTheme(),{isThisPending:C}=L(),{addNotification:w}=P(),{drawerType:T,drawerEntityId:D,setDrawerType:N,setDrawerEntityId:O}=j();K({key:"Enter",active:p},()=>Q());const[A,F]=t(!1),[M,R]=t(!1),_=n(null),J=T===B.Source,U=()=>{F(!1),R(!1)},G=()=>{U(),y&&y(!1),N(null),O(null),g?.()};o(S,()=>({closeDrawer:G}));const Y=()=>{_.current?.clearTitle(),f&&f(),U()},X=()=>{const e=_.current?.isTitleDirty();m||e?R(!0):Y()},Z=()=>{F(!0)},Q=()=>{v&&v(_.current?.getTitle()||"")},ee=l(()=>!!T&&C({entityType:T,entityId:D}),[T,D]),te=e=>{w({type:W.Warning,title:"Pending",message:`Cannot click ${e}, ${T} is pending`,hideFromHistory:!0})},ie=$||[];return y&&!p&&ie.push({"data-id":"drawer-edit",variant:"tertiary",onClick:ee?()=>te("edit"):()=>y(!0),children:e.createElement(e.Fragment,null,e.createElement(Ci,null),e.createElement(E,{size:14,family:"secondary",decoration:"underline"},"Edit"))}),b&&!p&&ie.push({"data-id":"drawer-delete",variant:"tertiary",onClick:ee?()=>te(J?"uninstrument":"delete"):Z,children:e.createElement(e.Fragment,null,e.createElement(wi,null),e.createElement(E,{color:k.text.error,size:14,family:"secondary",decoration:"underline"},J?V.UNINSTRUMENT:V.DELETE))}),e.createElement(e.Fragment,null,e.createElement(q,{isOpen:!0,onClose:p?X:G,closeOnEscape:!A&&!M,width:`${a+64}px`,header:{icons:d,iconSrcs:u,title:r,titleTooltip:s,replaceTitleWith:!c&&p?e.createElement(Sa,{ref:_,title:r}):void 0,actionButtons:ie,tabs:x},footer:{isOpen:p,leftButtons:[{"data-id":"drawer-save",variant:"primary",onClick:Q,children:V.SAVE},{"data-id":"drawer-cancel",variant:"secondary",onClick:X,children:V.CANCEL}],rightButtons:b?[{"data-id":"drawer-delete",variant:"tertiary",onClick:Z,children:e.createElement(e.Fragment,null,e.createElement(wi,null),e.createElement(E,{size:14,color:k.text.error,family:"secondary",decoration:"underline"},V.DELETE))}]:[]}},i),e.createElement(z,{isOpen:A,noOverlay:!0,name:`${T}${r?` (${r})`:""}`,type:T,isLastItem:h,onApprove:()=>{b&&b(),U()},onDeny:U}),e.createElement(H,{isOpen:M,noOverlay:!0,name:"edit mode",onApprove:Y,onDeny:U}))}),Sa=a(({title:a},n)=>{const[l,r]=t(a);return i(()=>{r(a)},[a]),o(n,()=>({getTitle:()=>l||a,isTitleDirty:()=>l!==a,clearTitle:()=>r(a)})),e.createElement($,{"data-id":"title",value:l,onChange:e=>r(e.target.value)})});Sa.displayName=Sa.name,$a.displayName=$a.name;const ka=d.div`
18
18
  width: 100%;
19
19
  height: 100%;
20
20
  max-height: calc(100vh - 220px);
@@ -24,10 +24,10 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
24
24
  display: flex;
25
25
  flex-direction: column;
26
26
  gap: 12px;
27
- `,wa=({updateAction:a,deleteAction:o})=>{const{actions:r}=_(),{drawerType:s,drawerEntityId:c}=K(),d=n(null),u=s===B.Action,[p,h]=t(!1),[g,y]=t(!1),{formData:v,formErrors:b,handleFormChange:f,resetFormData:x,validateForm:$,loadFormWithDrawerItem:S}=J(),k=l(()=>{if(c)return r?.find(e=>U(e)===c)},[c,r]);if(i(()=>{u&&k?S(k):x()},[u,k]),!k)return null;const C=G.find(({type:e})=>e===k.type)||G.find(({label:e})=>"Attributes"===e)?.items?.find(({type:e})=>e===k.type)||G.find(({label:e})=>"Samplers"===e)?.items?.find(({type:e})=>e===k.type);return e.createElement($a,{ref:d,title:k.name||k.type,icons:[Y(k.type)],isEdit:p,isFormDirty:g,onEdit:e=>{h("boolean"!=typeof e||e)},onSave:e=>{if($({withAlert:!0,alertTitle:Q.Update})){const t=e!==k.type?e:"";f("name",t),a(c,{...v,name:t}),h(!1),y(!1)}},onDelete:()=>{o(c,k.type),h(!1),y(!1),d.current?.closeDrawer()},onCancel:()=>{h(!1),y(!1),S(k)}},p&&C?e.createElement(ka,null,e.createElement(xa,{isUpdate:!0,action:C,formData:v,formErrors:b,handleFormChange:(...e)=>{y(!0),f(...e)}})):e.createElement(Ca,null,e.createElement(X,{conditions:k.conditions||[]}),e.createElement(Z,{title:m.ACTION_DETAILS,data:k?Qi(k):[]})))},Ta=d(ee)`
27
+ `,wa=({updateAction:a,deleteAction:o})=>{const{actions:r}=_(),{drawerType:s,drawerEntityId:c}=j(),d=n(null),u=s===B.Action,[p,h]=t(!1),[g,y]=t(!1),{formData:v,formErrors:b,handleFormChange:f,resetFormData:x,validateForm:$,loadFormWithDrawerItem:S}=J(),k=l(()=>{if(c)return r?.find(e=>U(e)===c)},[c,r]);if(i(()=>{u&&k?S(k):x()},[u,k]),!k)return null;const C=G.find(({type:e})=>e===k.type)||G.find(({label:e})=>"Attributes"===e)?.items?.find(({type:e})=>e===k.type)||G.find(({label:e})=>"Samplers"===e)?.items?.find(({type:e})=>e===k.type);return e.createElement($a,{ref:d,title:k.name||k.type,icons:[Y(k.type)],isEdit:p,isFormDirty:g,onEdit:e=>{h("boolean"!=typeof e||e)},onSave:e=>{if($({withAlert:!0,alertTitle:Q.Update})){const t=e!==k.type?e:"";f("name",t),a(c,{...v,name:t}),h(!1),y(!1)}},onDelete:()=>{o(c,k.type),h(!1),y(!1),d.current?.closeDrawer()},onCancel:()=>{h(!1),y(!1),S(k)}},p&&C?e.createElement(ka,null,e.createElement(xa,{isUpdate:!0,action:C,formData:v,formErrors:b,handleFormChange:(...e)=>{y(!0),f(...e)}})):e.createElement(Ca,null,e.createElement(X,{conditions:k.conditions||[]}),e.createElement(Z,{title:m.ACTION_DETAILS,data:k?Qi(k):[]})))},Ta=d(ee)`
28
28
  margin-top: 24px;
29
29
  gap: 12px;
30
- `,Da=({createAction:i})=>{const{currentModal:a,setCurrentModal:n}=te(),o=a===B.Action,{formData:l,formErrors:r,handleFormChange:s,resetFormData:c,validateForm:d}=J(),[u,p]=t(void 0),h=()=>{c(),p(void 0),n("")},g=()=>{if(!d({withAlert:!0,alertTitle:Q.Create}))return null;i(l),h()};return j({key:"Enter",active:o},()=>g()),e.createElement(ie,{isOpen:o,onClose:h,header:{title:"Add Action"},actionComponent:e.createElement(ae,{buttons:[{variant:"primary",label:"DONE",onClick:g,disabled:!u}]})},e.createElement(ne,null,e.createElement(A,{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(Ta,null,e.createElement(oe,{type:W.Warning,message:le.DEFINED_FOR_ALL_STREAMS(m.ACTIONS)}),e.createElement(re,{options:G,selectedOption:u,onOptionSelect:e=>{return t=e,c(),s("type",t?.type||""),void p(t);var t},autoFocus:!u?.type})),u?.type?e.createElement("div",null,e.createElement(se,{margin:"16px 0"}),e.createElement(xa,{action:u,formData:l,formErrors:r,handleFormChange:s})):null))},Na=e=>{const{type:t,fields:{collectContainerAttributes:i,collectReplicaSetAttributes:a,collectWorkloadId:n,collectClusterId:o,labelsAttributes:l,annotationsAttributes:r,clusterAttributes:s,overwriteExistingValues:c,attributeNamesToDelete:d,renames:u,piiCategories:p,fallbackSamplingRatio:m,samplingPercentage:h,endpointsFilters:v,attributeFilters:b,servicesNameFilters:f}}=e;let x="";if(t===g.K8sAttributes&&(i&&(x+="Container Attributes, "),a&&(x+="ReplicaSet Attributes, "),n&&(x+="Workload ID, "),o&&(x+="Cluster ID, "),l?.forEach(({labelKey:e,attributeKey:t,from:i,fromSources:a},n)=>{const o=a?.length?a.join(","):i||y.Pod;x+=`Label: ${e} ${t} ${o} `,n===l.length-1&&(x+=", ")}),r?.forEach(({annotationKey:e,attributeKey:t,from:i,fromSources:a},n)=>{const o=a?.length?a.join(","):i||y.Pod;x+=`Annotation: ${e} ${t} ${o} `,n===r.length-1&&(x+=", ")})),t===g.AddClusterInfo&&(x+=`Overwrite Existing: ${c}\n`,s?.forEach(({attributeName:e,attributeStringValue:t},i)=>{x+=`${e}: ${t}`,i<s.length-1&&(x+=", ")})),t===g.DeleteAttributes&&d?.forEach((e,t)=>{x+=e,t<d.length-1&&(x+=", ")}),t===g.RenameAttributes){const e=Object.entries(u||{});e.forEach(([t,i],a)=>{x+=`${t}: ${i}`,a<e.length-1&&(x+=", ")})}return t===g.PiiMasking&&p?.forEach((e,t)=>{x+=e,t<p.length-1&&(x+=", ")}),t===g.ErrorSampler&&(x+=String(m)),t===g.ProbabilisticSampler&&(x+=String(h),x+="%"),t===g.LatencySampler&&v?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:i,fallbackSamplingRatio:a},n)=>{x+=`Endpoint${v.length>1?` #${n+1}`:""}=${e}${t}\n`,x+=` Latency=${i}`,x+=` Sampling=${a}`,n<v.length-1&&(x+=", ")}),t===g.ServiceNameSampler&&f?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:i})=>{x+=`Service Name: ${e}, `,x+=`Sampling Ratio: ${t}, `,x+=`Fallback Sampling Ratio: ${i}\n`}),t===g.SpanAttributeSampler&&b?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:i})=>{x+=`Service Name: ${e}, `,x+=`Attribute Key: ${t}, `,x+=`Fallback Sampling Ratio: ${i}\n`}),x},Ea=({conditions:t,id:i})=>{const{errors:a,warnings:n,disableds:o,hasLoadings:r}=l(()=>ce(t),[t]),s=a.length>0?a:n.length>0?n:o.length>0?o:[];if(s.length>0)return e.createElement("div",{style:{lineHeight:1}},e.createElement(Ia,{conditions:s,id:i}));const c=r?he.Loading:W.Success;return e.createElement("div",{style:{lineHeight:1}},e.createElement(de,{status:c,title:c,withBorder:!0,withIcon:!0}))},Ia=({conditions:t,id:i})=>{const a=I.useTheme();return e.createElement(ue,null,pe(t).map(({status:t,type:n,reason:o,message:l,lastTransitionTime:r},s)=>{"loading"!==t&&"disabled"!==t||(t=W.Info);const c=ge(t,a);return e.createElement(me,{key:`condition-${i}-${t}-${n}-${s}`,titleIcon:c,title:n,text:l||o||"",timestamp:r},e.createElement(de,{status:t,title:o||n,withBorder:!0,withIcon:!0}))}))},Oa=({instrumentationRules:e,sources:t,actions:i,destinations:a,searchText:n,selectedCategory:o})=>{const l=n?e.filter(e=>e.type?.toLowerCase().includes(n)||e.ruleName?.toLowerCase().includes(n)):e,r=n?t.filter(e=>e.name?.toLowerCase().includes(n)||e.otelServiceName?.toLowerCase().includes(n)||e.namespace?.toLowerCase().includes(n)):t,s=n?i.filter(e=>e.type?.toLowerCase().includes(n)||e.name?.toLowerCase().includes(n)):i,c=n?a.filter(e=>e.destinationType.displayName?.toLowerCase().includes(n)||e.name?.toLowerCase().includes(n)):a,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(o)).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}},Aa=[{key:"icon",title:""},{key:"name",title:m.NAME,sortable:!0},{key:"signals",title:m.MONITORS},{key:"active-status",title:m.STATUS},{key:"conditions",title:"Conditions"},{key:"type",title:m.TYPE,sortable:!0},{key:"spec",title:"Spec",sortable:!0},{key:"notes",title:m.NOTES,sortable:!0}],Fa=({maxHeight:t,maxWidth:i})=>{const a=I.useTheme(),n=ye(),{actions:o,actionsLoading:r}=_(),{setDrawerType:s,setDrawerEntityId:c}=K(),d=l(()=>Oa({instrumentationRules:[],sources:[],actions:ve(o,n),destinations:[],searchText:n.searchText,selectedCategory:B.Action}).searchResults.find(({category:e})=>e===B.Action)?.entities||[],[o,n]),u=l(()=>d.map(t=>{const{hasErrors:i,hasWarnings:n,hasDisableds:o}=ce(t.conditions||[]);return{status:i?W.Error:n?W.Warning:void 0,faded:o,onClick:()=>{s(B.Action),c(t.id)},cells:[{columnKey:"icon",component:()=>e.createElement(be,{icon:Y(t.type)})},{columnKey:"name",value:fe(t,B.Action,{prioritizeDisplayName:!0})},{columnKey:"type",value:t.type,textColor:a.text.info},{columnKey:"notes",value:t.notes,textColor:a.text.info,withTooltip:!0},{columnKey:"spec",value:Na(t),textColor:a.text.info,withTooltip:!0},{columnKey:"signals",component:()=>e.createElement(xe,{withLabels:!0,monitors:t.signals||[]})},{columnKey:"conditions",component:()=>e.createElement(Ea,{conditions:t.conditions||[],id:t.id})},{columnKey:"active-status",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(de,{status:t.disabled?W.Error:W.Success,title:t.disabled?m.DISABLED:m.ENABLED,withIcon:!0,withBorder:!0}))}]}}),[d]),{badge:p,badgeTooltip:h}=l(()=>d.length!==o.length?{badge:`${d.length}/${o.length}`,badgeTooltip:m.FILTERED_COUNT_TOOLTIP}:{badge:o.length,badgeTooltip:void 0},[d,o]);return e.createElement($e,{$maxWidth:i},e.createElement(Se,null,e.createElement(ke,{icon:Ce(B.Action),title:m.ACTIONS,badge:p,badgeTooltip:h,loading:r})),e.createElement(we,{$maxHeight:t},e.createElement(Te,{columns:Aa,rows:u})),!d.length&&e.createElement(De,{style:{marginTop:"2rem"}},e.createElement(Ne,null)))},Ma=d(ee)`
30
+ `,Da=({createAction:i})=>{const{currentModal:a,setCurrentModal:n}=te(),o=a===B.Action,{formData:l,formErrors:r,handleFormChange:s,resetFormData:c,validateForm:d}=J(),[u,p]=t(void 0),h=()=>{c(),p(void 0),n("")},g=()=>{if(!d({withAlert:!0,alertTitle:Q.Create}))return null;i(l),h()};return K({key:"Enter",active:o},()=>g()),e.createElement(ie,{isOpen:o,onClose:h,header:{title:"Add Action"},actionComponent:e.createElement(ae,{buttons:[{variant:"primary",label:"DONE",onClick:g,disabled:!u}]})},e.createElement(ne,null,e.createElement(A,{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(Ta,null,e.createElement(oe,{type:W.Warning,message:le.DEFINED_FOR_ALL_STREAMS(m.ACTIONS)}),e.createElement(re,{options:G,selectedOption:u,onOptionSelect:e=>{return t=e,c(),s("type",t?.type||""),void p(t);var t},autoFocus:!u?.type})),u?.type?e.createElement("div",null,e.createElement(se,{margin:"16px 0"}),e.createElement(xa,{action:u,formData:l,formErrors:r,handleFormChange:s})):null))},Na=e=>{const{type:t,fields:{collectContainerAttributes:i,collectReplicaSetAttributes:a,collectWorkloadId:n,collectClusterId:o,labelsAttributes:l,annotationsAttributes:r,clusterAttributes:s,overwriteExistingValues:c,attributeNamesToDelete:d,renames:u,piiCategories:p,fallbackSamplingRatio:m,samplingPercentage:h,endpointsFilters:v,attributeFilters:b,servicesNameFilters:f}}=e;let x="";if(t===g.K8sAttributes&&(i&&(x+="Container Attributes, "),a&&(x+="ReplicaSet Attributes, "),n&&(x+="Workload ID, "),o&&(x+="Cluster ID, "),l?.forEach(({labelKey:e,attributeKey:t,from:i,fromSources:a},n)=>{const o=a?.length?a.join(","):i||y.Pod;x+=`Label: ${e} ${t} ${o} `,n===l.length-1&&(x+=", ")}),r?.forEach(({annotationKey:e,attributeKey:t,from:i,fromSources:a},n)=>{const o=a?.length?a.join(","):i||y.Pod;x+=`Annotation: ${e} ${t} ${o} `,n===r.length-1&&(x+=", ")})),t===g.AddClusterInfo&&(x+=`Overwrite Existing: ${c}\n`,s?.forEach(({attributeName:e,attributeStringValue:t},i)=>{x+=`${e}: ${t}`,i<s.length-1&&(x+=", ")})),t===g.DeleteAttributes&&d?.forEach((e,t)=>{x+=e,t<d.length-1&&(x+=", ")}),t===g.RenameAttributes){const e=Object.entries(u||{});e.forEach(([t,i],a)=>{x+=`${t}: ${i}`,a<e.length-1&&(x+=", ")})}return t===g.PiiMasking&&p?.forEach((e,t)=>{x+=e,t<p.length-1&&(x+=", ")}),t===g.ErrorSampler&&(x+=String(m)),t===g.ProbabilisticSampler&&(x+=String(h),x+="%"),t===g.LatencySampler&&v?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:i,fallbackSamplingRatio:a},n)=>{x+=`Endpoint${v.length>1?` #${n+1}`:""}=${e}${t}\n`,x+=` Latency=${i}`,x+=` Sampling=${a}`,n<v.length-1&&(x+=", ")}),t===g.ServiceNameSampler&&f?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:i})=>{x+=`Service Name: ${e}, `,x+=`Sampling Ratio: ${t}, `,x+=`Fallback Sampling Ratio: ${i}\n`}),t===g.SpanAttributeSampler&&b?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:i})=>{x+=`Service Name: ${e}, `,x+=`Attribute Key: ${t}, `,x+=`Fallback Sampling Ratio: ${i}\n`}),x},Ea=({conditions:t,id:i})=>{const{errors:a,warnings:n,disableds:o,hasLoadings:r}=l(()=>ce(t),[t]),s=a.length>0?a:n.length>0?n:o.length>0?o:[];if(s.length>0)return e.createElement("div",{style:{lineHeight:1}},e.createElement(Ia,{conditions:s,id:i}));const c=r?he.Loading:W.Success;return e.createElement("div",{style:{lineHeight:1}},e.createElement(de,{status:c,title:c,withBorder:!0,withIcon:!0}))},Ia=({conditions:t,id:i})=>{const a=I.useTheme();return e.createElement(ue,null,pe(t).map(({status:t,type:n,reason:o,message:l,lastTransitionTime:r},s)=>{"loading"!==t&&"disabled"!==t||(t=W.Info);const c=ge(t,a);return e.createElement(me,{key:`condition-${i}-${t}-${n}-${s}`,titleIcon:c,title:n,text:l||o||"",timestamp:r},e.createElement(de,{status:t,title:o||n,withBorder:!0,withIcon:!0}))}))},Oa=({instrumentationRules:e,sources:t,actions:i,destinations:a,searchText:n,selectedCategory:o})=>{const l=n?e.filter(e=>e.type?.toLowerCase().includes(n)||e.ruleName?.toLowerCase().includes(n)):e,r=n?t.filter(e=>e.name?.toLowerCase().includes(n)||e.otelServiceName?.toLowerCase().includes(n)||e.namespace?.toLowerCase().includes(n)):t,s=n?i.filter(e=>e.type?.toLowerCase().includes(n)||e.name?.toLowerCase().includes(n)):i,c=n?a.filter(e=>e.destinationType.displayName?.toLowerCase().includes(n)||e.name?.toLowerCase().includes(n)):a,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(o)).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}},Aa=[{key:"icon",title:""},{key:"name",title:m.NAME,sortable:!0},{key:"signals",title:m.MONITORS},{key:"active-status",title:m.STATUS},{key:"conditions",title:"Conditions"},{key:"type",title:m.TYPE,sortable:!0},{key:"spec",title:"Spec",sortable:!0},{key:"notes",title:m.NOTES,sortable:!0}],Fa=({maxHeight:t,maxWidth:i})=>{const a=I.useTheme(),n=ye(),{actions:o,actionsLoading:r}=_(),{setDrawerType:s,setDrawerEntityId:c}=j(),d=l(()=>Oa({instrumentationRules:[],sources:[],actions:ve(o,n),destinations:[],searchText:n.searchText,selectedCategory:B.Action}).searchResults.find(({category:e})=>e===B.Action)?.entities||[],[o,n]),u=l(()=>d.map(t=>{const{hasErrors:i,hasWarnings:n,hasDisableds:o}=ce(t.conditions||[]);return{status:i?W.Error:n?W.Warning:void 0,faded:o,onClick:()=>{s(B.Action),c(t.id)},cells:[{columnKey:"icon",component:()=>e.createElement(be,{icon:Y(t.type)})},{columnKey:"name",value:fe(t,B.Action,{prioritizeDisplayName:!0})},{columnKey:"type",value:t.type,textColor:a.text.info},{columnKey:"notes",value:t.notes,textColor:a.text.info,withTooltip:!0},{columnKey:"spec",value:Na(t),textColor:a.text.info,withTooltip:!0},{columnKey:"signals",component:()=>e.createElement(xe,{withLabels:!0,monitors:t.signals||[]})},{columnKey:"conditions",component:()=>e.createElement(Ea,{conditions:t.conditions||[],id:t.id})},{columnKey:"active-status",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(de,{status:t.disabled?W.Error:W.Success,title:t.disabled?m.DISABLED:m.ENABLED,withIcon:!0,withBorder:!0}))}]}}),[d]),{badge:p,badgeTooltip:h}=l(()=>d.length!==o.length?{badge:`${d.length}/${o.length}`,badgeTooltip:m.FILTERED_COUNT_TOOLTIP}:{badge:o.length,badgeTooltip:void 0},[d,o]);return e.createElement($e,{$maxWidth:i},e.createElement(Se,null,e.createElement(ke,{icon:Ce(B.Action),title:m.ACTIONS,badge:p,badgeTooltip:h,loading:r})),e.createElement(we,{$maxHeight:t},e.createElement(Te,{columns:Aa,rows:u})),!d.length&&e.createElement(De,{style:{marginTop:"2rem"}},e.createElement(Ne,null)))},Ma=d(ee)`
31
31
  // width: 100vw;
32
32
  // height: 100vh;
33
33
  gap: 64px;
@@ -45,7 +45,7 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
45
45
  text-align: center;
46
46
  line-height: 26px;
47
47
  color: ${({theme:e})=>e.text.info};
48
- `,Ka=()=>{const[a,n]=t(0);return i(()=>{(async()=>{for(let e=0;e<=100;e+=5)await Oe(500),n(e)})()},[]),e.createElement(Ma,null,e.createElement(wi,{size:100}),e.createElement(Ee,{width:400}),e.createElement(Ra,null,e.createElement(ue,{$gap:16},e.createElement(La,null,"Preparing your workspace..."),e.createElement(Ie,{label:`${a}%`})),e.createElement(Pa,null,"It can take up to a few minutes. Grab a cup of coffee, look out a window, and enjoy your free moment!")))},ja=d(ee)`
48
+ `,ja=()=>{const[a,n]=t(0);return i(()=>{(async()=>{for(let e=0;e<=100;e+=5)await Oe(500),n(e)})()},[]),e.createElement(Ma,null,e.createElement(Ti,{size:100}),e.createElement(Ee,{width:400}),e.createElement(Ra,null,e.createElement(ue,{$gap:16},e.createElement(La,null,"Preparing your workspace..."),e.createElement(Ie,{label:`${a}%`})),e.createElement(Pa,null,"It can take up to a few minutes. Grab a cup of coffee, look out a window, and enjoy your free moment!")))},Ka=d(ee)`
49
49
  align-items: center !important;
50
50
  justify-content: center !important;
51
51
  align-self: stretch;
@@ -63,7 +63,7 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
63
63
  &:hover {
64
64
  background-color: ${({theme:e})=>e.colors.dropdown_bg_2+I.opacity.hex["030"]};
65
65
  }
66
- `,Va=({entityType:t,description:i})=>{const{setCurrentModal:a}=te(),{isThisPending:n}=L(),o=n({entityType:t});return e.createElement(ja,{onClick:()=>a(t)},e.createElement(ue,{$gap:4},e.createElement(Ti,null),o?e.createElement(Ae,{size:14,weight:600,family:"secondary"},"Adding ",t):e.createElement(E,{size:14,weight:600,family:"secondary",decoration:"underline"},"Add ",t)),e.createElement(E,{size:12,align:"center"},o?"Just a few more seconds...":i))},qa=d.div`
66
+ `,Va=({entityType:t,description:i})=>{const{setCurrentModal:a}=te(),{isThisPending:n}=L(),o=n({entityType:t});return e.createElement(Ka,{onClick:()=>a(t)},e.createElement(ue,{$gap:4},e.createElement(Di,null),o?e.createElement(Ae,{size:14,weight:600,family:"secondary"},"Adding ",t):e.createElement(E,{size:14,weight:600,family:"secondary",decoration:"underline"},"Add ",t)),e.createElement(E,{size:12,align:"center"},o?"Just a few more seconds...":i))},qa=d.div`
67
67
  position: relative;
68
68
  width: 100%;
69
69
  padding: 12px 0;
@@ -71,9 +71,9 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
71
71
  display: flex;
72
72
  align-items: center;
73
73
  border-bottom: 1px solid ${({theme:e})=>e.colors.border};
74
- `,Ha=d(ue)`
74
+ `,za=d(ue)`
75
75
  margin-left: ${({$marginLeft:e})=>e};
76
- `,za=d(Fe)`
76
+ `,Ha=d(Fe)`
77
77
  width: 24px;
78
78
  height: 24px;
79
79
  padding: 0;
@@ -86,7 +86,7 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
86
86
  height: 4px;
87
87
  width: ${({percent:e})=>`${e}%`};
88
88
  transition: width 0.3s;
89
- `,Wa=({entityType:t,badge:i,badgeTooltip:a,isLoading:n,refetch:o})=>{const r=I.useTheme(),{sources:s}=_(),{isThisPending:c}=L(),{setCurrentModal:d}=te(),{selectedSources:u,setSelectedSources:p}=Me(),{isAwaitingInstrumentation:m,sourcesToCreate:h,sourcesCreated:g,sourcesToDelete:y,sourcesDeleted:v}=Re(),f=Ce(t),x=t===B.Source&&m,$=(h?Math.floor(100/h*g):y?Math.floor(100/y*v):0)||1,[S,k]=l(()=>{let e=0;return Object.values(u).forEach(t=>e+=t.length),[0!==e,e]},[u]);return e.createElement(qa,null,t===B.Source&&e.createElement(Ha,{$marginLeft:"28px"},e.createElement(b,{partiallyChecked:S&&s?.length!==k,value:S&&s?.length===k,onChange:e=>{if(e){const e={};s?.forEach(t=>{const i={namespace:t.namespace,name:t.name,kind:t.kind};c({entityType:B.Source,entityId:i})||(e[t.namespace]?e[t.namespace].push(t):e[t.namespace]=[t])}),p(e)}else p({})},disabled:!s?.length})),e.createElement(Ha,{$marginLeft:t===B.Source?"0":"28px"},e.createElement(ke,{icon:f,title:`${t}s`,badge:x?`${$}%`:i,badgeTooltip:a,loading:!1})),e.createElement(Ha,{$marginLeft:"auto"},e.createElement(za,{"data-id":`refresh-${t}`,variant:"secondary",onClick:o,disabled:n},n?e.createElement(Le,{scale:.8}):e.createElement(Di,{fill:r.colors.secondary,size:18})),e.createElement(za,{"data-id":`add-${t}`,variant:"primary",onClick:()=>d(t)},e.createElement(Ti,{fill:r.colors.primary,size:18}))),x&&e.createElement(Ba,{percent:$}))},_a=d.div`
89
+ `,Wa=({entityType:t,badge:i,badgeTooltip:a,isLoading:n,refetch:o})=>{const r=I.useTheme(),{sources:s}=_(),{isThisPending:c}=L(),{setCurrentModal:d}=te(),{selectedSources:u,setSelectedSources:p}=Me(),{isAwaitingInstrumentation:m,sourcesToCreate:h,sourcesCreated:g,sourcesToDelete:y,sourcesDeleted:v}=Re(),f=Ce(t),x=t===B.Source&&m,$=(h?Math.floor(100/h*g):y?Math.floor(100/y*v):0)||1,[S,k]=l(()=>{let e=0;return Object.values(u).forEach(t=>e+=t.length),[0!==e,e]},[u]);return e.createElement(qa,null,t===B.Source&&e.createElement(za,{$marginLeft:"28px"},e.createElement(b,{partiallyChecked:S&&s?.length!==k,value:S&&s?.length===k,onChange:e=>{if(e){const e={};s?.forEach(t=>{const i={namespace:t.namespace,name:t.name,kind:t.kind};c({entityType:B.Source,entityId:i})||(e[t.namespace]?e[t.namespace].push(t):e[t.namespace]=[t])}),p(e)}else p({})},disabled:!s?.length})),e.createElement(za,{$marginLeft:t===B.Source?"0":"28px"},e.createElement(ke,{icon:f,title:`${t}s`,badge:x?`${$}%`:i,badgeTooltip:a,loading:!1})),e.createElement(za,{$marginLeft:"auto"},e.createElement(Ha,{"data-id":`refresh-${t}`,variant:"secondary",onClick:o,disabled:n},n?e.createElement(Le,{scale:.8}):e.createElement(Ni,{fill:r.colors.secondary,size:18})),e.createElement(Ha,{"data-id":`add-${t}`,variant:"primary",onClick:()=>d(t)},e.createElement(Di,{fill:r.colors.primary,size:18}))),x&&e.createElement(Ba,{percent:$}))},_a=d.div`
90
90
  padding: 2px 6px;
91
91
  background-color: ${({theme:e})=>e.colors.primary};
92
92
  border-radius: 360px;
@@ -101,7 +101,7 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
101
101
  align-items: center;
102
102
  justify-content: center;
103
103
  white-space: nowrap;
104
- `,Ja=({entityId:t,entityType:i,status:a,faded:n,title:o,subTitle:l,tooltip:r,label:s,icon:c,icons:d,iconSrc:u,iconSrcs:p,monitors:m,isActive:h,raw:g})=>{const y=I.useTheme(),v=i===B.Source,b="boolean"==typeof h,{setDrawerType:f,setDrawerEntityId:x}=K(),{isThisPending:$}=L(),S=$({entityType:i,entityId:t}),{selectedSources:k,setSelectedSources:C}=Me(),w={...k},{namespace:T,name:D,kind:N}=g;v&&!w[T]&&(w[T]=[]);const E=v?w[T].findIndex(e=>e.name===D&&e.kind===N):-1;return e.createElement(Pe,{"data-id":i===B.Source?`${t.namespace}-${t.name}-${t.kind}`:t,title:o,subTitle:l,onClick:()=>{f(i),x(t)},renderActions:()=>{const t=v&&(!g.conditions?.length||g.conditions?.some(({status:e})=>"loading"===e)),i=b&&!h?ge(W.Info,y):a?ge(a,y):void 0,n=S||t?e.createElement(Le,{scale:.8}):i?e.createElement(i,{size:14}):null;return s?e.createElement(_a,{$isError:a===W.Error},e.createElement(me,{text:r||"Heads up! The data-flow metrics you see are calculated over 10-second intervals."},s),n):n||null},iconProps:{icon:c,icons:d,iconSrc:u,iconSrcs:p},visualProps:{status:a,faded:n||b&&!h,monitors:m||void 0},checkboxProps:{withCheckbox:v,isChecked:-1!==E,onCheckboxChange:()=>{-1===E?w[T].push(g):w[T].splice(E,1),C(w)},isCheckboxDisabled:S}})},Ua=d.div`
104
+ `,Ja=({entityId:t,entityType:i,status:a,faded:n,title:o,subTitle:l,tooltip:r,label:s,icon:c,icons:d,iconSrc:u,iconSrcs:p,monitors:m,isActive:h,raw:g})=>{const y=I.useTheme(),v=i===B.Source,b="boolean"==typeof h,{setDrawerType:f,setDrawerEntityId:x}=j(),{isThisPending:$}=L(),S=$({entityType:i,entityId:t}),{selectedSources:k,setSelectedSources:C}=Me(),w={...k},{namespace:T,name:D,kind:N}=g;v&&!w[T]&&(w[T]=[]);const E=v?w[T].findIndex(e=>e.name===D&&e.kind===N):-1;return e.createElement(Pe,{"data-id":i===B.Source?`${t.namespace}-${t.name}-${t.kind}`:t,title:o,subTitle:l,onClick:()=>{f(i),x(t)},renderActions:()=>{const t=v&&(!g.conditions?.length||g.conditions?.some(({status:e})=>"loading"===e)),i=b&&!h?ge(W.Info,y):a?ge(a,y):void 0,n=S||t?e.createElement(Le,{scale:.8}):i?e.createElement(i,{size:14}):null;return s?e.createElement(_a,{$isError:a===W.Error},e.createElement(me,{text:r||"Heads up! The data-flow metrics you see are calculated over 10-second intervals."},s),n):n||null},iconProps:{icon:c,icons:d,iconSrc:u,iconSrcs:p},visualProps:{status:a,faded:n||b&&!h,monitors:m||void 0},checkboxProps:{withCheckbox:v,isChecked:-1!==E,onCheckboxChange:()=>{-1===E?w[T].push(g):w[T].splice(E,1),C(w)},isCheckboxDisabled:S}})},Ua=d.div`
105
105
  height: calc(${({$height:e})=>e}px - 24px);
106
106
  width: calc(100% - 24px);
107
107
  padding: 12px;
@@ -124,7 +124,7 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
124
124
  justify-content: center;
125
125
 
126
126
  pointer-events: none;
127
- `,Ya=({height:t,entityType:i,entities:a,metrics:n,isVm:o})=>{const r=l(()=>a.map(t=>{const a=U(t);if(!a)return null;const l=[B.Source,B.Destination].includes(i),r=[B.Destination,B.Action].includes(i),s=[B.Destination,B.Action,B.InstrumentationRule].includes(i),c=r?i==B.Destination?Ke(t.exportedSignals):t.signals:void 0,d=l?n?.[`${i.toLowerCase()}s`]?.find(e=>JSON.stringify(U(e))===JSON.stringify(a)):void 0,u=s?!t.disabled:void 0,p=fe(t,i,{extended:i===B.Source,prioritizeDisplayName:i!==B.Source}),m=((e,t,i)=>{switch(e){case B.Source:return i?`${t.kind}`:`${t.namespace} • ${t.kind}`;case B.Destination:return t.destinationType.displayName;case B.Action:case B.InstrumentationRule:return t.type;default:return""}})(i,t,o),h=l?je(d?.throughput):void 0,{priorotizedStatus:g,hasDisableds:y}=ce(t.conditions||[]),{icons:v,icon:b,iconSrc:f}=((e,t)=>{switch(e){case B.Source:return{icons:ze(t.containers),icon:Ce(e)};case B.Destination:return He(t.destinationType.type);case B.Action:return{icon:Y(t.type)};case B.InstrumentationRule:return{icon:qe(t.type)};default:return{icon:Ce(e)}}})(i,t),x=i===B.Source?t.podsAgentInjectionStatus:void 0,$=x?(e=>{switch(e){case Be.Error:return W.Error;case Be.Notice:return W.Warning;case Be.Waiting:return W.Info}})(x.status):void 0,S=x&&$?x.message:void 0;return e.createElement(Ja,{key:JSON.stringify(a),entityType:i,entityId:a,raw:t,title:p,subTitle:m,faded:y,status:$||g,tooltip:S,label:h,icons:v,icon:b,iconSrc:f,monitors:c,isActive:u})}),[a,i,n,o]);return e.createElement(Ua,{$height:t},e.createElement(Ve,{containerHeight:t-24,elementHeight:80,elements:r}),e.createElement(Ga,{$hide:!0}))},Xa=d.div`
127
+ `,Ya=({height:t,entityType:i,entities:a,metrics:n,isVm:o})=>{const r=l(()=>a.map(t=>{const a=U(t);if(!a)return null;const l=[B.Source,B.Destination].includes(i),r=[B.Destination,B.Action].includes(i),s=[B.Destination,B.Action,B.InstrumentationRule].includes(i),c=r?i==B.Destination?je(t.exportedSignals):t.signals:void 0,d=l?n?.[`${i.toLowerCase()}s`]?.find(e=>JSON.stringify(U(e))===JSON.stringify(a)):void 0,u=s?!t.disabled:void 0,p=fe(t,i,{extended:i===B.Source,prioritizeDisplayName:i!==B.Source}),m=((e,t,i)=>{switch(e){case B.Source:return i?`${t.kind}`:`${t.namespace} • ${t.kind}`;case B.Destination:return t.destinationType.displayName;case B.Action:case B.InstrumentationRule:return t.type;default:return""}})(i,t,o),h=l?Ke(d?.throughput):void 0,{priorotizedStatus:g,hasDisableds:y}=ce(t.conditions||[]),{icons:v,icon:b,iconSrc:f}=((e,t)=>{switch(e){case B.Source:return{icons:He(t.containers),icon:Ce(e)};case B.Destination:return ze(t.destinationType.type);case B.Action:return{icon:Y(t.type)};case B.InstrumentationRule:return{icon:qe(t.type)};default:return{icon:Ce(e)}}})(i,t),x=i===B.Source?t.podsAgentInjectionStatus:void 0,$=x?(e=>{switch(e){case Be.Error:return W.Error;case Be.Notice:return W.Warning;case Be.Waiting:return W.Info}})(x.status):void 0,S=x&&$?x.message:void 0;return e.createElement(Ja,{key:JSON.stringify(a),entityType:i,entityId:a,raw:t,title:p,subTitle:m,faded:y,status:$||g,tooltip:S,label:h,icons:v,icon:b,iconSrc:f,monitors:c,isActive:u})}),[a,i,n,o]);return e.createElement(Ua,{$height:t},e.createElement(Ve,{containerHeight:t-24,elementHeight:80,elements:r}),e.createElement(Ga,{$hide:!0}))},Xa=d.div`
128
128
  width: ${({$isVm:e})=>e?"45vw":"22vw"};
129
129
 
130
130
  display: flex;
@@ -155,7 +155,7 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
155
155
  display: flex;
156
156
  align-items: center;
157
157
  overflow-x: scroll;
158
- `,nn=({onClose:a})=>{const n=I.useTheme(),{onClickNode:o}=Qe(),{searchText:s}=ye(),{selectedStreamName:c}=Je(),{sources:d,destinations:u,actions:p,instrumentationRules:m}=_(),{popupRef:h,popupOpen:g,setPopupOpen:y,popupPosition:v,handlePosition:b}=et();i(()=>{g||(b(0,50),y(!0))},[g]);const[f,x]=t("all"),{categories:$,searchResults:S}=l(()=>Oa({instrumentationRules:m,sources:Ye(d,c),actions:p,destinations:Ze(u,c),searchText:s,selectedCategory:f}),[m,d,p,u,c,s,f]);return S.length?e.createElement(tt,{ref:h,isOpen:g,top:v.top,left:v.left,maxWidth:"420px",header:e.createElement(an,null,$.map(({category:t,label:i,count:a})=>!!a&&e.createElement(it,{key:`category-select-${t}`,label:i,badgeLabel:a,isSelected:f===t,onClick:()=>x(t)})))},S.map(({category:t,label:i,entities:l},s)=>!!l.length&&e.createElement(r,{key:`category-list-${t}`},e.createElement(at,{style:{maxHeight:"all"!==f?"240px":"140px",padding:"12px 0"}},e.createElement(E,{size:12,family:"secondary",color:n.text.darker_grey,style:{marginLeft:"16px"}},i),l.map((i,n)=>e.createElement(it,{key:`entity-${s}-${n}`,icon:Ce(t),label:fe(i,t,{extended:!0}),onClick:()=>{const e=U(i);o(null,{data:{type:t,id:e}}),a()},style:{width:"100%",justifyContent:"flex-start"},color:"transparent"}))),e.createElement(se,{thickness:s===S.length-1?0:1,length:"90%",margin:"8px auto"})))):e.createElement(tt,{ref:h,isOpen:g,top:v.top,left:v.left},e.createElement(Ne,null))},on=({preventPopup:i=!1})=>{const{searchText:a,setSearchText:o}=ye(),[l,r]=t(!1),s=!!a||l,c=()=>{o(""),r(!1)},d=n(null);return nt(d,c),j({key:"Escape",active:s},c),e.createElement(tn,{ref:d},e.createElement($,{placeholder:"Search",icon:Ni,value:a,onChange:e=>o(e.target.value.toLowerCase()),onFocus:()=>r(!0)}),s&&!i?e.createElement(nn,{onClose:c}):null)},ln=({sources:t,title:i="Condition",value:a,onSelect:n,onDeselect:o,...r})=>{const s=l(()=>{const e=[];return t.forEach(({conditions:t})=>{t?.forEach(({type:t,reason:i})=>{e.find(e=>e.id===`${t}#${i}`)||e.push({id:`${t}#${i}`,value:`${ot(t)} - ${ot(i)}`})})}),e.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[t]);return e.createElement(lt,{disabled:!s?.length,title:i,placeholder:"All",options:s,value:a,onSelect:n,onDeselect:o,...r})},rn=({sources:t,title:i="Error Message",value:a,onSelect:n,onDeselect:o,disabled:r,...s})=>{const c=l(()=>{const e=[];return t.forEach(({conditions:t})=>{pe(t||[]).forEach(({status:t,message:i,reason:a})=>{t!==W.Error||e.find(e=>e.id===i)||(i?e.find(e=>e.id===i)||e.push({id:i,value:i}):a&&(e.find(e=>e.id===a)||e.push({id:a,value:a})))})}),e},[t]);return e.createElement(lt,{disabled:r||!c?.length,title:i,placeholder:"All",options:c,value:a,onSelect:n,onDeselect:o,...s})},sn=({sources:t,title:i="Programming Language",value:a,onSelect:n,onDeselect:o,...r})=>{const s=l(()=>{const e=[];return t.forEach(({containers:t})=>{t?.forEach(({language:t})=>{e.find(e=>e.id===t)||e.push({id:t,value:rt[t]||t})})}),e.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[t]);return e.createElement(lt,{disabled:!s?.length,title:i,placeholder:"All",options:s,value:a,onSelect:n,onDeselect:o,...r})},cn=({title:t="Monitors",value:i,onSelect:a,onDeselect:n,...o})=>{const r=l(()=>{const e=[];return st.forEach(({id:t,value:i})=>{e.find(e=>e.id===t)||e.push({id:t,value:i})}),e},[]);return e.createElement(lt,{disabled:!r?.length,title:t,placeholder:"All",options:r,value:i,onSelect:a,onDeselect:n,...o})},dn=({namespaces:t,title:i="Namespace",value:a,onSelect:n,onDeselect:o,...r})=>{const s=l(()=>{const e=[];return t?.forEach(({name:t})=>{e.find(e=>e.id===t)||e.push({id:t,value:t})}),e},[t]);return e.createElement(lt,{disabled:!s?.length,title:i,placeholder:"Select namespace",options:s,value:a,onSelect:n,onDeselect:o,...r})},un=({sources:t,title:i="Kind",value:a,onSelect:n,onDeselect:o,...r})=>{const s=l(()=>{const e=[];return t.forEach(({kind:t})=>{e.find(e=>e.id===t)||e.push({id:t,value:t})}),e},[t]);return e.createElement(lt,{disabled:!s?.length,title:i,placeholder:"All",options:s,value:a,onSelect:n,onDeselect:o,...r})},pn=({sources:t,title:i="Agent Injection Status",value:a,onSelect:n,onDeselect:o,disabled:r,...s})=>{const c=l(()=>{const e=[];return t.forEach(({podsAgentInjectionStatus:t})=>{const{status:i,message:a}=t||{};a&&!e.find(e=>e.id===a)&&e.push({id:a,value:`${i} - ${a}`})}),e},[t]);return e.createElement(lt,{disabled:r||!c?.length,title:i,placeholder:"All",options:c,value:a,onSelect:n,onDeselect:o,...s})},mn=d.div`
158
+ `,nn=({onClose:a})=>{const n=I.useTheme(),{onClickNode:o}=Qe(),{searchText:s}=ye(),{selectedStreamName:c}=Je(),{sources:d,destinations:u,actions:p,instrumentationRules:m}=_(),{popupRef:h,popupOpen:g,setPopupOpen:y,popupPosition:v,handlePosition:b}=et();i(()=>{g||(b(0,50),y(!0))},[g]);const[f,x]=t("all"),{categories:$,searchResults:S}=l(()=>Oa({instrumentationRules:m,sources:Ye(d,c),actions:p,destinations:Ze(u,c),searchText:s,selectedCategory:f}),[m,d,p,u,c,s,f]);return S.length?e.createElement(tt,{ref:h,isOpen:g,top:v.top,left:v.left,maxWidth:"420px",header:e.createElement(an,null,$.map(({category:t,label:i,count:a})=>!!a&&e.createElement(it,{key:`category-select-${t}`,label:i,badgeLabel:a,isSelected:f===t,onClick:()=>x(t)})))},S.map(({category:t,label:i,entities:l},s)=>!!l.length&&e.createElement(r,{key:`category-list-${t}`},e.createElement(at,{style:{maxHeight:"all"!==f?"240px":"140px",padding:"12px 0"}},e.createElement(E,{size:12,family:"secondary",color:n.text.darker_grey,style:{marginLeft:"16px"}},i),l.map((i,n)=>e.createElement(it,{key:`entity-${s}-${n}`,icon:Ce(t),label:fe(i,t,{extended:!0}),onClick:()=>{const e=U(i);o(null,{data:{type:t,id:e}}),a()},style:{width:"100%",justifyContent:"flex-start"},color:"transparent"}))),e.createElement(se,{thickness:s===S.length-1?0:1,length:"90%",margin:"8px auto"})))):e.createElement(tt,{ref:h,isOpen:g,top:v.top,left:v.left},e.createElement(Ne,null))},on=({preventPopup:i=!1})=>{const{searchText:a,setSearchText:o}=ye(),[l,r]=t(!1),s=!!a||l,c=()=>{o(""),r(!1)},d=n(null);return nt(d,c),K({key:"Escape",active:s},c),e.createElement(tn,{ref:d},e.createElement($,{placeholder:"Search",icon:Ei,value:a,onChange:e=>o(e.target.value.toLowerCase()),onFocus:()=>r(!0)}),s&&!i?e.createElement(nn,{onClose:c}):null)},ln=({sources:t,title:i="Condition",value:a,onSelect:n,onDeselect:o,...r})=>{const s=l(()=>{const e=[];return t.forEach(({conditions:t})=>{t?.forEach(({type:t,reason:i})=>{e.find(e=>e.id===`${t}#${i}`)||e.push({id:`${t}#${i}`,value:`${ot(t)} - ${ot(i)}`})})}),e.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[t]);return e.createElement(lt,{disabled:!s?.length,title:i,placeholder:"All",options:s,value:a,onSelect:n,onDeselect:o,...r})},rn=({sources:t,title:i="Error Message",value:a,onSelect:n,onDeselect:o,disabled:r,...s})=>{const c=l(()=>{const e=[];return t.forEach(({conditions:t})=>{pe(t||[]).forEach(({status:t,message:i,reason:a})=>{t!==W.Error||e.find(e=>e.id===i)||(i?e.find(e=>e.id===i)||e.push({id:i,value:i}):a&&(e.find(e=>e.id===a)||e.push({id:a,value:a})))})}),e},[t]);return e.createElement(lt,{disabled:r||!c?.length,title:i,placeholder:"All",options:c,value:a,onSelect:n,onDeselect:o,...s})},sn=({sources:t,title:i="Programming Language",value:a,onSelect:n,onDeselect:o,...r})=>{const s=l(()=>{const e=[];return t.forEach(({containers:t})=>{t?.forEach(({language:t})=>{e.find(e=>e.id===t)||e.push({id:t,value:rt[t]||t})})}),e.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[t]);return e.createElement(lt,{disabled:!s?.length,title:i,placeholder:"All",options:s,value:a,onSelect:n,onDeselect:o,...r})},cn=({title:t="Monitors",value:i,onSelect:a,onDeselect:n,...o})=>{const r=l(()=>{const e=[];return st.forEach(({id:t,value:i})=>{e.find(e=>e.id===t)||e.push({id:t,value:i})}),e},[]);return e.createElement(lt,{disabled:!r?.length,title:t,placeholder:"All",options:r,value:i,onSelect:a,onDeselect:n,...o})},dn=({namespaces:t,title:i="Namespace",value:a,onSelect:n,onDeselect:o,...r})=>{const s=l(()=>{const e=[];return t?.forEach(({name:t})=>{e.find(e=>e.id===t)||e.push({id:t,value:t})}),e},[t]);return e.createElement(lt,{disabled:!s?.length,title:i,placeholder:"Select namespace",options:s,value:a,onSelect:n,onDeselect:o,...r})},un=({sources:t,title:i="Kind",value:a,onSelect:n,onDeselect:o,...r})=>{const s=l(()=>{const e=[];return t.forEach(({kind:t})=>{e.find(e=>e.id===t)||e.push({id:t,value:t})}),e},[t]);return e.createElement(lt,{disabled:!s?.length,title:i,placeholder:"All",options:s,value:a,onSelect:n,onDeselect:o,...r})},pn=({sources:t,title:i="Agent Injection Status",value:a,onSelect:n,onDeselect:o,disabled:r,...s})=>{const c=l(()=>{const e=[];return t.forEach(({podsAgentInjectionStatus:t})=>{const{status:i,message:a}=t||{};a&&!e.find(e=>e.id===a)&&e.push({id:a,value:`${i} - ${a}`})}),e},[t]);return e.createElement(lt,{disabled:r||!c?.length,title:i,placeholder:"All",options:c,value:a,onSelect:n,onDeselect:o,...s})},mn=d.div`
159
159
  display: flex;
160
160
  flex-direction: column;
161
161
  gap: 12px;
@@ -167,7 +167,7 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
167
167
  ${({$color:e})=>`color: ${e};`}
168
168
  `,yn=d.div`
169
169
  margin-left: auto;
170
- `,vn=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},bn=()=>{const a=I.useTheme(),{isVm:o}=_e(),{namespaces:r,sources:s}=_(),{selectedStreamName:c}=Je(),{getItemSS:d,setItemSS:u,removeItemSS:p}=dt(),{popupRef:m,popupOpen:h,setPopupOpen:g,popupPosition:y,handlePosition:v}=et(),{namespaces:b,kinds:f,monitors:x,languages:$,conditions:S,errors:k,onlyErrors:C,podsAgentInjectionStatus:T,setAll:D,clearAll:N,getEmptyState:E}=ye(),O=l(()=>Ye(s,c),[s,c]),[A,F]=t({namespaces:b,kinds:f,monitors:x,languages:$,conditions:S,errors:k,onlyErrors:C,podsAgentInjectionStatus:T}),[M,R]=t(vn(A));i(()=>{const e=d(ct.OVERVIEW_FILTERS,E());D(e)},[]),i(()=>{if(!h){const e={namespaces:b,kinds:f,monitors:x,languages:$,conditions:S,errors:k,onlyErrors:C};F(e),R(vn(e))}},[h,b,f,x,$,S,k,C]);const L=()=>{g(!1)},P=n(null);return nt(P,L),j({key:"Escape",active:h},L),e.createElement(tn,{ref:P},e.createElement(it,{label:"Filters",icon:Ei,badgeLabel:M,badgeFilled:!!M,withBorder:!0,color:"transparent",onClick:()=>{v(0,50),g(!0)}}),e.createElement(tt,{ref:m,isOpen:h,top:y.top,left:y.left,width:"420px",footer:e.createElement(ue,null,e.createElement(gn,{variant:"primary",onClick:()=>{u(ct.OVERVIEW_FILTERS,A),D(A),R(vn(A)),g(!1)}},"Apply"),e.createElement(gn,{variant:"secondary",onClick:L},"Cancel"),e.createElement(yn,null,e.createElement(gn,{variant:"tertiary",onClick:()=>{p(ct.OVERVIEW_FILTERS),N(),F(E()),R(0),g(!1)},$color:a.text.error},"Reset")))},e.createElement(mn,null,!o&&e.createElement(dn,{namespaces:r,value:A.namespaces,onSelect:e=>F(t=>({...t,namespaces:[...t.namespaces||[],e]})),onDeselect:e=>F(t=>({...t,namespaces:(t.namespaces||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(un,{sources:O,value:A.kinds,onSelect:e=>F(t=>({...t,kinds:[...t.kinds||[],e]})),onDeselect:e=>F(t=>({...t,kinds:(t.kinds||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(sn,{sources:O,value:A.languages,onSelect:e=>F(t=>({...t,languages:[...t.languages||[],e]})),onDeselect:e=>F(t=>({...t,languages:(t.languages||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(cn,{value:A.monitors,onSelect:e=>F(t=>({...t,monitors:[...t.monitors||[],e]})),onDeselect:e=>F(t=>({...t,monitors:(t.monitors||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(ln,{sources:O,value:A.conditions,onSelect:e=>F(t=>({...t,conditions:[...t.conditions||[],e]})),onDeselect:e=>F(t=>({...t,conditions:(t.conditions||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(pn,{sources:O,value:A.podsAgentInjectionStatus,onSelect:e=>F(t=>({...t,podsAgentInjectionStatus:[...t.podsAgentInjectionStatus||[],e]})),onDeselect:e=>F(t=>({...t,podsAgentInjectionStatus:(t.podsAgentInjectionStatus||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(hn,null,e.createElement(w,{title:"Show only sources with errors",initialValue:A.onlyErrors,onChange:e=>F(t=>({...t,errors:[],onlyErrors:e}))})),e.createElement(rn,{sources:O,value:A.errors,onSelect:e=>F(t=>({...t,errors:[...t.errors||[],e]})),onDeselect:e=>F(t=>({...t,errors:(t.errors||[]).filter(t=>t.id!==e.id)})),disabled:!A.onlyErrors,showSearch:!0,required:!0,isMulti:!0}))))},fn=d.div`
170
+ `,vn=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},bn=()=>{const a=I.useTheme(),{isVm:o}=_e(),{namespaces:r,sources:s}=_(),{selectedStreamName:c}=Je(),{getItemSS:d,setItemSS:u,removeItemSS:p}=dt(),{popupRef:m,popupOpen:h,setPopupOpen:g,popupPosition:y,handlePosition:v}=et(),{namespaces:b,kinds:f,monitors:x,languages:$,conditions:S,errors:k,onlyErrors:C,podsAgentInjectionStatus:T,setAll:D,clearAll:N,getEmptyState:E}=ye(),O=l(()=>Ye(s,c),[s,c]),[A,F]=t({namespaces:b,kinds:f,monitors:x,languages:$,conditions:S,errors:k,onlyErrors:C,podsAgentInjectionStatus:T}),[M,R]=t(vn(A));i(()=>{const e=d(ct.OVERVIEW_FILTERS,E());D(e)},[]),i(()=>{if(!h){const e={namespaces:b,kinds:f,monitors:x,languages:$,conditions:S,errors:k,onlyErrors:C};F(e),R(vn(e))}},[h,b,f,x,$,S,k,C]);const L=()=>{g(!1)},P=n(null);return nt(P,L),K({key:"Escape",active:h},L),e.createElement(tn,{ref:P},e.createElement(it,{label:"Filters",icon:Ii,badgeLabel:M,badgeFilled:!!M,withBorder:!0,color:"transparent",onClick:()=>{v(0,50),g(!0)}}),e.createElement(tt,{ref:m,isOpen:h,top:y.top,left:y.left,width:"420px",footer:e.createElement(ue,null,e.createElement(gn,{variant:"primary",onClick:()=>{u(ct.OVERVIEW_FILTERS,A),D(A),R(vn(A)),g(!1)}},"Apply"),e.createElement(gn,{variant:"secondary",onClick:L},"Cancel"),e.createElement(yn,null,e.createElement(gn,{variant:"tertiary",onClick:()=>{p(ct.OVERVIEW_FILTERS),N(),F(E()),R(0),g(!1)},$color:a.text.error},"Reset")))},e.createElement(mn,null,!o&&e.createElement(dn,{namespaces:r,value:A.namespaces,onSelect:e=>F(t=>({...t,namespaces:[...t.namespaces||[],e]})),onDeselect:e=>F(t=>({...t,namespaces:(t.namespaces||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(un,{sources:O,value:A.kinds,onSelect:e=>F(t=>({...t,kinds:[...t.kinds||[],e]})),onDeselect:e=>F(t=>({...t,kinds:(t.kinds||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(sn,{sources:O,value:A.languages,onSelect:e=>F(t=>({...t,languages:[...t.languages||[],e]})),onDeselect:e=>F(t=>({...t,languages:(t.languages||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(cn,{value:A.monitors,onSelect:e=>F(t=>({...t,monitors:[...t.monitors||[],e]})),onDeselect:e=>F(t=>({...t,monitors:(t.monitors||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(ln,{sources:O,value:A.conditions,onSelect:e=>F(t=>({...t,conditions:[...t.conditions||[],e]})),onDeselect:e=>F(t=>({...t,conditions:(t.conditions||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(pn,{sources:O,value:A.podsAgentInjectionStatus,onSelect:e=>F(t=>({...t,podsAgentInjectionStatus:[...t.podsAgentInjectionStatus||[],e]})),onDeselect:e=>F(t=>({...t,podsAgentInjectionStatus:(t.podsAgentInjectionStatus||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(hn,null,e.createElement(w,{title:"Show only sources with errors",initialValue:A.onlyErrors,onChange:e=>F(t=>({...t,errors:[],onlyErrors:e}))})),e.createElement(rn,{sources:O,value:A.errors,onSelect:e=>F(t=>({...t,errors:[...t.errors||[],e]})),onDeselect:e=>F(t=>({...t,errors:(t.errors||[]).filter(t=>t.id!==e.id)})),disabled:!A.onlyErrors,showSearch:!0,required:!0,isMulti:!0}))))},fn=d.div`
171
171
  display: flex;
172
172
  flex-direction: column;
173
173
  gap: 24px;
@@ -178,7 +178,7 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
178
178
  max-height: calc(100vh - 220px);
179
179
  overflow: overlay;
180
180
  overflow-y: auto;
181
- `,Sn=({isOpen:i,onClose:a,dataStreamName:o,updateDataStream:r})=>{const{dataStreams:c}=Je(),d=n(null),[u,p]=t(!1),{formData:m,handleFormChange:h,formErrors:g,validateForm:y,resetFormData:v,loadFormWithDrawerItem:b}=ut({name:o}),f=l(()=>{if(!i)return v();const e=c?.find(e=>e.name===o);return e?b(e):v(),e},[i,c,o]),x=s((e,t)=>{h(e,t),p(!0)},[h]);return f?e.createElement($a,{ref:d,title:f.name,icons:[Ii],hideEditTitleFromEdit:!0,isEdit:!0,isFormDirty:u,onSave:()=>{y({withAlert:!0,alertTitle:Q.Update})&&(r(o,m),p(!1),a())},onCancel:()=>{v(),p(!1),a()}},e.createElement($n,null,e.createElement(xn,{formData:m,handleFormChange:x,formErrors:g}))):null},kn=d.div`
181
+ `,Sn=({isOpen:i,onClose:a,dataStreamName:o,updateDataStream:r})=>{const{dataStreams:c}=Je(),d=n(null),[u,p]=t(!1),{formData:m,handleFormChange:h,formErrors:g,validateForm:y,resetFormData:v,loadFormWithDrawerItem:b}=ut({name:o}),f=l(()=>{if(!i)return v();const e=c?.find(e=>e.name===o);return e?b(e):v(),e},[i,c,o]),x=s((e,t)=>{h(e,t),p(!0)},[h]);return f?e.createElement($a,{ref:d,title:f.name,icons:[Oi],hideEditTitleFromEdit:!0,isEdit:!0,isFormDirty:u,onSave:()=>{y({withAlert:!0,alertTitle:Q.Update})&&(r(o,m),p(!1),a())},onCancel:()=>{v(),p(!1),a()}},e.createElement($n,null,e.createElement(xn,{formData:m,handleFormChange:x,formErrors:g}))):null},kn=d.div`
182
182
  position: relative;
183
183
  `,Cn=d(ue)`
184
184
  border: 1px solid ${({theme:e})=>e.colors.border};
@@ -196,7 +196,7 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
196
196
  width: 100%;
197
197
  `,Nn=d.div`
198
198
  width: 100%;
199
- `,En=({onClickNewDataStream:i,updateDataStream:a,deleteDataStream:n})=>{const o=I.useTheme(),{clearStore:r}=pt(),{popupRef:s,popupOpen:c,setPopupOpen:d,popupPosition:u,handlePosition:p}=et(),{dataStreams:m,selectedStreamName:h,setSelectedStreamName:g}=Je(),[y,v]=t(""),[b,f]=t(""),[x,S]=t(""),k=l(()=>m.filter(({name:e})=>!x||e.toLowerCase().includes(x.toLowerCase())).map(({name:t})=>e.createElement(Dn,{key:`stream-${t}`},e.createElement(Nn,null,e.createElement(it,{label:t,isSelected:h===t,onClick:()=>{r(),g(t),d(!1)},color:"transparent",style:{width:"100%",justifyContent:"flex-start"}})),t!==mt&&e.createElement(ht,{onClick:()=>f(t),tooltip:V.DELETE},e.createElement(Ci,null)),e.createElement(ht,{onClick:()=>v(t),tooltip:V.EDIT},e.createElement(ki,null)))),[m,h,x]);return e.createElement(e.Fragment,null,e.createElement(kn,null,e.createElement(Cn,{$gap:0},e.createElement(Fe,{variant:"tertiary",onClick:()=>{p(0,50),d(e=>!e)}},e.createElement(Ii,{fill:o.text.info}),e.createElement(wn,null,"Data Stream: ",h),e.createElement(gt,{extend:c}),e.createElement(Ie,{label:m.length})),e.createElement(se,{orientation:"vertical",length:"32px",thickness:2,margin:"0"}),e.createElement(yt,{onClick:()=>{r(),i()},label:V.NEW})),e.createElement(tt,{ref:s,isOpen:c,top:u.top,left:u.left,header:e.createElement($,{placeholder:"Search...",icon:Ni,value:x,onChange:e=>S(e.target.value)})},e.createElement(Tn,null,k))),e.createElement(H,{isOpen:""!==b,name:b,onApprove:()=>{n(b),f("")},onDeny:()=>{f("")}}),e.createElement(Sn,{isOpen:""!==y,onClose:()=>{v("")},dataStreamName:y,updateDataStream:a}))},In=d.div`
199
+ `,En=({onClickNewDataStream:i,updateDataStream:a,deleteDataStream:n})=>{const o=I.useTheme(),{clearStore:r}=pt(),{popupRef:s,popupOpen:c,setPopupOpen:d,popupPosition:u,handlePosition:p}=et(),{dataStreams:m,selectedStreamName:h,setSelectedStreamName:g}=Je(),[y,v]=t(""),[b,f]=t(""),[x,S]=t(""),k=l(()=>m.filter(({name:e})=>!x||e.toLowerCase().includes(x.toLowerCase())).map(({name:t})=>e.createElement(Dn,{key:`stream-${t}`},e.createElement(Nn,null,e.createElement(it,{label:t,isSelected:h===t,onClick:()=>{r(),g(t),d(!1)},color:"transparent",style:{width:"100%",justifyContent:"flex-start"}})),t!==mt&&e.createElement(ht,{onClick:()=>f(t),tooltip:V.DELETE},e.createElement(wi,null)),e.createElement(ht,{onClick:()=>v(t),tooltip:V.EDIT},e.createElement(Ci,null)))),[m,h,x]);return e.createElement(e.Fragment,null,e.createElement(kn,null,e.createElement(Cn,{$gap:0},e.createElement(Fe,{variant:"tertiary",onClick:()=>{p(0,50),d(e=>!e)}},e.createElement(Oi,{fill:o.text.info}),e.createElement(wn,null,"Data Stream: ",h),e.createElement(gt,{extend:c}),e.createElement(Ie,{label:m.length})),e.createElement(se,{orientation:"vertical",length:"32px",thickness:2,margin:"0"}),e.createElement(yt,{onClick:()=>{r(),i()},label:V.NEW})),e.createElement(tt,{ref:s,isOpen:c,top:u.top,left:u.left,header:e.createElement($,{placeholder:"Search...",icon:Ei,value:x,onChange:e=>S(e.target.value)})},e.createElement(Tn,null,k))),e.createElement(z,{isOpen:""!==b,name:b,onApprove:()=>{n(b),f("")},onDeny:()=>{f("")}}),e.createElement(Sn,{isOpen:""!==y,onClose:()=>{v("")},dataStreamName:y,updateDataStream:a}))},In=d.div`
200
200
  display: flex;
201
201
  align-items: center;
202
202
  margin: 20px 0;
@@ -204,7 +204,7 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
204
204
  gap: 8px;
205
205
  `,On=d.div`
206
206
  margin-left: auto;
207
- `,An=({addEntity:t,preventSearchPopup:i,onClickNewDataStream:a,updateDataStream:n,deleteDataStream:o})=>{const{setCurrentModal:l}=te();return e.createElement(In,null,e.createElement(En,{onClickNewDataStream:a,updateDataStream:n,deleteDataStream:o}),e.createElement(on,{preventPopup:i}),e.createElement(bn,null),t&&e.createElement(On,null,e.createElement(yt,{"data-id":`add-${t}`,onClick:()=>l(t),label:`${V.ADD} ${ot(t)}`,variant:"primary",textProps:{weight:900}})))},Fn=a(({isModal:t,onClickSummary:i},a)=>{const{selectedStreamName:n}=Je(),{formData:l,handleFormChange:r,formErrors:s,validateForm:c}=ut({name:n});return o(a,()=>({validateForm:c,getFormValues:()=>l})),e.createElement(ne,{$isNotModal:!t},e.createElement(ee,{$gap:24},i&&e.createElement(vt,{onClick:i}),e.createElement(A,{title:m.NAME_YOUR_STREAM,description:m.STREAM_DESCRIPTION}),e.createElement(xn,{formData:l,handleFormChange:r,formErrors:s})))});Fn.displayName=Fn.name;const Mn=({createDataStream:t})=>{const{currentModal:i,setCurrentModal:a}=te(),{addDataStreams:o,setSelectedStreamName:l}=Je(),r=i===bt.DataStream,s=()=>a(""),c=async()=>{if(d.current&&d.current.validateForm()){const e=d.current.getFormValues();t?t(e):(o([e]),l(e.name)),s()}},d=n(null);return j({key:"Enter",active:r},c),e.createElement(ie,{isOpen:r,onClose:s,header:{title:"Add Data Stream"},actionComponent:e.createElement(ae,{buttons:[{label:"DONE",variant:"primary",onClick:c}]})},e.createElement(Fn,{ref:d,isModal:!0}))},Rn=e=>Object.keys(e).filter(t=>e[t]).join(", "),Ln=(e,t)=>{const{destinationType:i,disabled:a,exportedSignals:n}=e,o=[{title:m.TYPE,value:i.type},{type:h.ActiveStatus,title:m.STATUS,value:String(!a)},{type:h.Monitors,title:m.MONITORS,value:Rn(n)},{title:m.NAME,value:i.displayName}],l=ft(e,t),r=l.map(e=>({name:e.key,value:e.value}));return l.map(({key:e,name:i,value:a})=>{const{secret:l,componentProperties:s,hideFromReadData:c,customReadDataLabels:d}=t.find(t=>t.name===e)||{};if(!c?.length||!xt(c,Ke(n),r)){const{type:e}=$t(s,{type:""}),t=(l||"password"===e)&&a.length?new Array(10).fill("•").join(""):"";o.push({type:h.Divider}),d?.length?d.forEach(({condition:e,...t})=>{e==a&&o.push({title:t.title,value:t.value})}):o.push({title:i,value:t||a})}}),o},Pn=({signals:t,fields:i,onChange:a,formErrors:n})=>i?.map(o=>{const{componentType:l,renderCondition:r,...s}=o;if(r&&!xt(r,t,i))return null;switch(l){case N.Input:return e.createElement($,{key:o.name,...s,onChange:e=>a(o.name,e.target.value),errorMessage:n[o.name]});case N.Dropdown:return e.createElement(lt,{key:o.name,...s,showSearch:!0,value:{id:s.value||"",value:s.value||""},options:s.options||[],onSelect:e=>a(o.name,e.id),errorMessage:n[o.name]});case N.MultiInput:return e.createElement(D,{key:o.name,...s,value:"string"==typeof s.value?$t(s.value,[]):s.value,onChange:e=>a(o.name,JSON.stringify(e)),errorMessage:n[o.name]});case N.KeyValuePair:return e.createElement(T,{key:o.name,...s,value:"string"==typeof s.value?$t(s.value,[]):s.value,onChange:e=>a(o.name,JSON.stringify(e)),errorMessage:n[o.name]});case N.TextArea:return e.createElement(R,{key:o.name,...s,onChange:e=>a(o.name,e.target.value),errorMessage:n[o.name]});case N.Checkbox:return e.createElement(b,{key:o.name,...s,value:"true"==s.value,onChange:e=>a(o.name,String(e)),errorMessage:n[o.name]});default:return null}}),Kn=d(Fe)`
207
+ `,An=({addEntity:t,preventSearchPopup:i,onClickNewDataStream:a,updateDataStream:n,deleteDataStream:o})=>{const{setCurrentModal:l}=te();return e.createElement(In,null,e.createElement(En,{onClickNewDataStream:a,updateDataStream:n,deleteDataStream:o}),e.createElement(on,{preventPopup:i}),e.createElement(bn,null),t&&e.createElement(On,null,e.createElement(yt,{"data-id":`add-${t}`,onClick:()=>l(t),label:`${V.ADD} ${ot(t)}`,variant:"primary",textProps:{weight:900}})))},Fn=a(({isModal:t,onClickSummary:i},a)=>{const{selectedStreamName:n}=Je(),{formData:l,handleFormChange:r,formErrors:s,validateForm:c}=ut({name:n});return o(a,()=>({validateForm:c,getFormValues:()=>l})),e.createElement(ne,{$isNotModal:!t},e.createElement(ee,{$gap:24},i&&e.createElement(vt,{onClick:i}),e.createElement(A,{title:m.NAME_YOUR_STREAM,description:m.STREAM_DESCRIPTION}),e.createElement(xn,{formData:l,handleFormChange:r,formErrors:s})))});Fn.displayName=Fn.name;const Mn=({createDataStream:t})=>{const{currentModal:i,setCurrentModal:a}=te(),{addDataStreams:o,setSelectedStreamName:l}=Je(),r=i===bt.DataStream,s=()=>a(""),c=async()=>{if(d.current&&d.current.validateForm()){const e=d.current.getFormValues();t?t(e):(o([e]),l(e.name)),s()}},d=n(null);return K({key:"Enter",active:r},c),e.createElement(ie,{isOpen:r,onClose:s,header:{title:"Add Data Stream"},actionComponent:e.createElement(ae,{buttons:[{label:"DONE",variant:"primary",onClick:c}]})},e.createElement(Fn,{ref:d,isModal:!0}))},Rn=e=>Object.keys(e).filter(t=>e[t]).join(", "),Ln=(e,t)=>{const{destinationType:i,disabled:a,exportedSignals:n}=e,o=[{title:m.TYPE,value:i.type},{type:h.ActiveStatus,title:m.STATUS,value:String(!a)},{type:h.Monitors,title:m.MONITORS,value:Rn(n)},{title:m.NAME,value:i.displayName}],l=ft(e,t),r=l.map(e=>({name:e.key,value:e.value}));return l.map(({key:e,name:i,value:a})=>{const{secret:l,componentProperties:s,hideFromReadData:c,customReadDataLabels:d}=t.find(t=>t.name===e)||{};if(!c?.length||!xt(c,je(n),r)){const{type:e}=$t(s,{type:""}),t=(l||"password"===e)&&a.length?new Array(10).fill("•").join(""):"";o.push({type:h.Divider}),d?.length?d.forEach(({condition:e,...t})=>{e==a&&o.push({title:t.title,value:t.value})}):o.push({title:i,value:t||a})}}),o},Pn=({signals:t,fields:i,onChange:a,formErrors:n})=>i?.map(o=>{const{componentType:l,renderCondition:r,...s}=o;if(r&&!xt(r,t,i))return null;switch(l){case N.Input:return e.createElement($,{key:o.name,...s,onChange:e=>a(o.name,e.target.value),errorMessage:n[o.name]});case N.Dropdown:return e.createElement(lt,{key:o.name,...s,showSearch:!0,value:{id:s.value||"",value:s.value||""},options:s.options||[],onSelect:e=>a(o.name,e.id),errorMessage:n[o.name]});case N.MultiInput:return e.createElement(D,{key:o.name,...s,value:"string"==typeof s.value?$t(s.value,[]):s.value,onChange:e=>a(o.name,JSON.stringify(e)),errorMessage:n[o.name]});case N.KeyValuePair:return e.createElement(T,{key:o.name,...s,value:"string"==typeof s.value?$t(s.value,[]):s.value,onChange:e=>a(o.name,JSON.stringify(e)),errorMessage:n[o.name]});case N.TextArea:return e.createElement(R,{key:o.name,...s,onChange:e=>a(o.name,e.target.value),errorMessage:n[o.name]});case N.Checkbox:return e.createElement(b,{key:o.name,...s,value:"true"==s.value,onChange:e=>a(o.name,String(e)),errorMessage:n[o.name]});default:return null}}),jn=d(Fe)`
208
208
  display: flex;
209
209
  align-items: center;
210
210
  gap: 8px;
@@ -218,18 +218,18 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
218
218
  `:u`
219
219
  background-color: transparent;
220
220
  `}
221
- `,jn=({destination:i,validateForm:a,status:n,testConnection:o,onSuccess:l,onError:r})=>{const s=I.useTheme(),{selectedStreamName:c}=Je(),[d,u]=t(!1),p=n?ge(n,s):void 0;return e.createElement(Kn,{$status:n,variant:"secondary",onClick:async()=>{if(a()){u(!0);const e=await o({...i,currentStreamName:c});e&&(e.succeeded?l(e):r(e)),u(!1)}}},d?e.createElement(Le,null):p?e.createElement(p,null):null,e.createElement(E,{family:"secondary",decoration:"underline",size:14,color:n?s.text[n]:void 0},d?"Checking":n===W.Success?"Connection OK":"error"===n?"Connection Failed":"Test Connection"))},Vn=d(ee)`
221
+ `,Kn=({destination:i,validateForm:a,status:n,testConnection:o,onSuccess:l,onError:r})=>{const s=I.useTheme(),{selectedStreamName:c}=Je(),[d,u]=t(!1),p=n?ge(n,s):void 0;return e.createElement(jn,{$status:n,variant:"secondary",onClick:async()=>{if(a()){u(!0);const e=await o({...i,currentStreamName:c});e&&(e.succeeded?l(e):r(e)),u(!1)}}},d?e.createElement(Le,null):p?e.createElement(p,null):null,e.createElement(E,{family:"secondary",decoration:"underline",size:14,color:n?s.text[n]:void 0},d?"Checking":n===W.Success?"Connection OK":"error"===n?"Connection Failed":"Test Connection"))},Vn=d(ee)`
222
222
  align-items: unset;
223
223
  padding: 0 4px;
224
224
  `,qn=d.div`
225
225
  display: flex;
226
226
  flex-direction: column;
227
227
  gap: 12px;
228
- `,Hn=d(ue)`
228
+ `,zn=d(ue)`
229
229
  justify-content: space-between;
230
- `,zn=d(E)`
230
+ `,Hn=d(E)`
231
231
  margin-bottom: 12px;
232
- `,Bn=({isUpdate:a,categoryItem:o,formData:r,formErrors:s,validateForm:c,handleFormChange:d,dynamicFields:u,setDynamicFields:p,testConnection:h})=>{const{type:g,displayName:y,supportedSignals:v,testConnectionSupported:b}=o||{},f=I.useTheme(),[x,S]=t(!1),[k,C]=t(!1),[w,T]=t(void 0),D=n(!1);i(()=>{if(u.length&&!D.current){D.current=!0;let e=!1;for(let t=0;t<u.length;t++){const{required:i,value:a}=u[t];if(i){if([void 0,null,""].includes(a)){e=!1;break}e=!0}}S(e)}},[u,k]);const N=l(()=>{const{logs:e,metrics:t,traces:i}=v||{},a=[];return e?.supported&&a.push(St.Logs),t?.supported&&a.push(St.Metrics),i?.supported&&a.push(St.Traces),a},[v]),E=l(()=>{const{logs:e,metrics:t,traces:i}=r.exportedSignals||{},a=[];return e&&a.push(St.Logs),t&&a.push(St.Metrics),i&&a.push(St.Traces),a},[r.exportedSignals]),R=()=>{S(!1),C(!0),T(void 0)};return e.createElement(Vn,{$gap:24},e.createElement(Vn,{$gap:12},e.createElement(A,{title:a?"Update destination":"Create destination",description:`Connect ${y} with Odigos.`,actionButton:b&&e.createElement(jn,{destination:r,validateForm:c,status:w?.type,testConnection:h,onError:e=>{C(!1),T({type:W.Error,title:e?.reason||"Connection failed",message:e?.message||"Please check your input and try again."})},onSuccess:e=>{C(!1),T({type:W.Success,title:e?.reason||"Connection succeeded",message:e?.message||""})}})}),e.createElement(qn,null,b&&w&&e.createElement(oe,{type:w.type,title:w.title,message:w.message}),x&&!w&&!a&&e.createElement(oe,{type:W.Default,message:`Odigos autocompleted ${y} destination details.`})),e.createElement(se,null)),e.createElement(Hn,null,e.createElement(M,{title:a?"":"This connection will monitor:",required:!0,allowedSignals:N,selectedSignals:E,setSelectedSignals:e=>{R(),d("exportedSignals",{logs:e.includes(St.Logs),metrics:e.includes(St.Metrics),traces:e.includes(St.Traces)})},errorMessage:s.exportedSignals}),!a&&e.createElement(F,{endpoint:`/backends/${g}`})),a&&e.createElement("div",null,e.createElement(zn,null,"Status"),e.createElement(O,{options:[{icon:$i,label:m.ENABLED,value:!1,selectedBgColor:f.text.success+I.opacity.hex["050"]},{icon:Si,label:m.DISABLED,value:!0,selectedBgColor:f.text.error+I.opacity.hex["050"]}],selected:r.disabled,setSelected:e=>d("disabled",e)})),!a&&e.createElement($,{title:"Destination name",placeholder:"Enter destination name",value:r.name,onChange:e=>{R(),d("name",e.target.value)},errorMessage:s.name}),e.createElement(Pn,{signals:E,fields:u,onChange:(e,t)=>{R(),p(i=>{const a=[...i],n=a.findIndex(t=>t.name===e);return-1!==n&&(a[n]={...a[n],value:t}),a})},formErrors:s}))},Wn=d.div`
232
+ `,Bn=({isUpdate:a,categoryItem:o,formData:r,formErrors:s,validateForm:c,handleFormChange:d,dynamicFields:u,setDynamicFields:p,testConnection:h})=>{const{type:g,displayName:y,supportedSignals:v,testConnectionSupported:b}=o||{},f=I.useTheme(),[x,S]=t(!1),[k,C]=t(!1),[w,T]=t(void 0),D=n(!1);i(()=>{if(u.length&&!D.current){D.current=!0;let e=!1;for(let t=0;t<u.length;t++){const{required:i,value:a}=u[t];if(i){if([void 0,null,""].includes(a)){e=!1;break}e=!0}}S(e)}},[u,k]);const N=l(()=>{const{logs:e,metrics:t,traces:i}=v||{},a=[];return e?.supported&&a.push(St.Logs),t?.supported&&a.push(St.Metrics),i?.supported&&a.push(St.Traces),a},[v]),E=l(()=>{const{logs:e,metrics:t,traces:i}=r.exportedSignals||{},a=[];return e&&a.push(St.Logs),t&&a.push(St.Metrics),i&&a.push(St.Traces),a},[r.exportedSignals]),R=()=>{S(!1),C(!0),T(void 0)};return e.createElement(Vn,{$gap:24},e.createElement(Vn,{$gap:12},e.createElement(A,{title:a?"Update destination":"Create destination",description:`Connect ${y} with Odigos.`,actionButton:b&&e.createElement(Kn,{destination:r,validateForm:c,status:w?.type,testConnection:h,onError:e=>{C(!1),T({type:W.Error,title:e?.reason||"Connection failed",message:e?.message||"Please check your input and try again."})},onSuccess:e=>{C(!1),T({type:W.Success,title:e?.reason||"Connection succeeded",message:e?.message||""})}})}),e.createElement(qn,null,b&&w&&e.createElement(oe,{type:w.type,title:w.title,message:w.message}),x&&!w&&!a&&e.createElement(oe,{type:W.Default,message:`Odigos autocompleted ${y} destination details.`})),e.createElement(se,null)),e.createElement(zn,null,e.createElement(M,{title:a?"":"This connection will monitor:",required:!0,allowedSignals:N,selectedSignals:E,setSelectedSignals:e=>{R(),d("exportedSignals",{logs:e.includes(St.Logs),metrics:e.includes(St.Metrics),traces:e.includes(St.Traces)})},errorMessage:s.exportedSignals}),!a&&e.createElement(F,{endpoint:`/backends/${g}`})),a&&e.createElement("div",null,e.createElement(Hn,null,"Status"),e.createElement(O,{options:[{icon:Si,label:m.ENABLED,value:!1,selectedBgColor:f.text.success+I.opacity.hex["050"]},{icon:ki,label:m.DISABLED,value:!0,selectedBgColor:f.text.error+I.opacity.hex["050"]}],selected:r.disabled,setSelected:e=>d("disabled",e)})),!a&&e.createElement($,{title:"Destination name",placeholder:"Enter destination name",value:r.name,onChange:e=>{R(),d("name",e.target.value)},errorMessage:s.name}),e.createElement(Pn,{signals:E,fields:u,onChange:(e,t)=>{R(),p(i=>{const a=[...i],n=a.findIndex(t=>t.name===e);return-1!==n&&(a[n]={...a[n],value:t}),a})},formErrors:s}))},Wn=d.div`
233
233
  width: 100%;
234
234
  height: 100%;
235
235
  max-height: calc(100vh - 220px);
@@ -239,11 +239,11 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
239
239
  display: flex;
240
240
  flex-direction: column;
241
241
  gap: 12px;
242
- `,Jn=({categories:a,updateDestination:o,deleteDestination:r,testConnection:s})=>{const{destinations:c}=_(),{selectedStreamName:d}=Je(),{drawerType:u,drawerEntityId:p}=K(),h=l(()=>Ze(c,d),[c,d]),g=n(null),y=u===B.Destination,[v,b]=t(!1),[f,x]=t(!1),{formData:$,formErrors:S,handleFormChange:k,resetFormData:C,validateForm:w,loadFormWithDrawerItem:T,yamlFields:D,setYamlFields:N,dynamicFields:E,setDynamicFields:I}=kt({}),O=l(()=>{if(p)return h?.find(e=>U(e)===p)},[p,h]);if(i(()=>{y&&O?(N(Ct(a,O)),T(O)):C()},[y,O,a]),!O)return null;const A=a.flatMap(e=>e.items).find(e=>e.type===O.destinationType.type),{icon:F,iconSrc:M}=A?He(A?.type):{icon:void 0,iconSrc:void 0};return e.createElement($a,{ref:g,title:O.name||O.destinationType.displayName,icons:F?[F]:void 0,iconSrcs:M?[M]:void 0,isEdit:v,isFormDirty:f,onEdit:e=>{b("boolean"!=typeof e||e)},onSave:async e=>{if(w({withAlert:!0,alertTitle:Q.Update})){const t=e!==O.destinationType.displayName?e:"";k("name",t),o(p,{...$,name:t}),b(!1),x(!1)}},onDelete:async()=>{r(p),b(!1),x(!1),g.current?.closeDrawer()},onCancel:()=>{b(!1),x(!1),T(O)},isLastItem:1===h.length},v?e.createElement(Wn,null,e.createElement(Bn,{isUpdate:!0,categoryItem:A,formData:$,formErrors:S,handleFormChange:(...e)=>{x(!0),k(...e)},dynamicFields:E,setDynamicFields:(...e)=>{x(!0),I(...e)},validateForm:w,testConnection:s})):e.createElement(_n,null,O.conditions?.length?e.createElement(X,{conditions:O.conditions}):null,e.createElement(Z,{title:m.DESTINATION_DETAILS,data:O?Ln(O,D):[]})))},Un=d.div`
242
+ `,Jn=({categories:a,updateDestination:o,deleteDestination:r,testConnection:s})=>{const{destinations:c}=_(),{selectedStreamName:d}=Je(),{drawerType:u,drawerEntityId:p}=j(),h=l(()=>Ze(c,d),[c,d]),g=n(null),y=u===B.Destination,[v,b]=t(!1),[f,x]=t(!1),{formData:$,formErrors:S,handleFormChange:k,resetFormData:C,validateForm:w,loadFormWithDrawerItem:T,yamlFields:D,setYamlFields:N,dynamicFields:E,setDynamicFields:I}=kt({}),O=l(()=>{if(p)return h?.find(e=>U(e)===p)},[p,h]);if(i(()=>{y&&O?(N(Ct(a,O)),T(O)):C()},[y,O,a]),!O)return null;const A=a.flatMap(e=>e.items).find(e=>e.type===O.destinationType.type),{icon:F,iconSrc:M}=A?ze(A?.type):{icon:void 0,iconSrc:void 0};return e.createElement($a,{ref:g,title:O.name||O.destinationType.displayName,icons:F?[F]:void 0,iconSrcs:M?[M]:void 0,isEdit:v,isFormDirty:f,onEdit:e=>{b("boolean"!=typeof e||e)},onSave:async e=>{if(w({withAlert:!0,alertTitle:Q.Update})){const t=e!==O.destinationType.displayName?e:"";k("name",t),o(p,{...$,name:t}),b(!1),x(!1)}},onDelete:async()=>{r(p),b(!1),x(!1),g.current?.closeDrawer()},onCancel:()=>{b(!1),x(!1),T(O)},isLastItem:1===h.length},v?e.createElement(Wn,null,e.createElement(Bn,{isUpdate:!0,categoryItem:A,formData:$,formErrors:S,handleFormChange:(...e)=>{x(!0),k(...e)},dynamicFields:E,setDynamicFields:(...e)=>{x(!0),I(...e)},validateForm:w,testConnection:s})):e.createElement(_n,null,O.conditions?.length?e.createElement(X,{conditions:O.conditions}):null,e.createElement(Z,{title:m.DESTINATION_DETAILS,data:O?Ln(O,D):[]})))},Un=d.div`
243
243
  display: flex;
244
244
  flex-direction: column;
245
245
  gap: 12px;
246
- `,Gn=({items:t,onSelectNew:i,onSelectConfigured:a,isLoadingForDestinationIds:n})=>{const{configuredDestinationsUpdateOnly:o}=pt();return t.map(t=>{const l=t.name===Tt.EXISTS.TITLE;return e.createElement(Un,{key:`category-${t.name}`},e.createElement(A,{size:"small",icon:t.icon,title:wt(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}=He(r.type),p=r.selected||o.some(e=>e.id===r.id),m=!!n.find(e=>e===r.id),h=l?()=>a(r.id):()=>i(r);return e.createElement(Pe,{key:s,"data-id":s,title:r.displayName,hoverText:V.SELECT,onClick:h,iconProps:{icon:d,iconSrc:u},visualProps:{monitors:c,monitorsWithLabels:!0},checkboxProps:{withCheckbox:l,isChecked:p,isLoading:m,onCheckboxChange:()=>a(r.id)}})}))})},Yn=d.div`
246
+ `,Gn=({items:t,onSelectNew:i,onSelectConfigured:a,isLoadingForDestinationIds:n})=>{const{configuredDestinationsUpdateOnly:o}=pt();return t.map(t=>{const l=t.name===Tt.EXISTS.TITLE;return e.createElement(Un,{key:`category-${t.name}`},e.createElement(A,{size:"small",icon:t.icon,title:wt(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}=ze(r.type),p=r.selected||o.some(e=>e.id===r.id),m=!!n.find(e=>e===r.id),h=l?()=>a(r.id):()=>i(r);return e.createElement(Pe,{key:s,"data-id":s,title:r.displayName,hoverText:V.SELECT,onClick:h,iconProps:{icon:d,iconSrc:u},visualProps:{monitors:c,monitorsWithLabels:!0},checkboxProps:{withCheckbox:l,isChecked:p,isLoading:m,onCheckboxChange:()=>a(r.id)}})}))})},Yn=d.div`
247
247
  display: flex;
248
248
  flex-direction: column;
249
249
  gap: 24px;
@@ -267,7 +267,7 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
267
267
  }
268
268
  `,eo=d(Yn)`
269
269
  margin-top: 80px;
270
- `,{MANAGED:to,SELF_HOSTED:io,DETECTED:ao,EXISTS:no}=Tt,oo=[{value:"All types",id:"all"},{value:to.TITLE,id:to.TITLE},{value:io.TITLE,id:io.TITLE},{value:ao.TITLE,id:ao.TITLE},{value:no.TITLE,id:no.TITLE}],lo=oo[0],ro=[St.Logs,St.Metrics,St.Traces],so=(e,t,i)=>e.map(e=>{const{type:a,displayName:n}=e.destinationType,o=e.dataStreamNames?.includes(t),l=i.has(e.id);return{id:e.id,type:a,displayName:n,selected:o||l,fields:[],testConnectionSupported:!1,supportedSignals:{[St.Logs]:{supported:e.exportedSignals.logs},[St.Metrics]:{supported:e.exportedSignals.metrics},[St.Traces]:{supported:e.exportedSignals.traces}}}}),co=({hidden:i,categories:a,potentialDestinations:n,onSelectNew:o,onSelectConfigured:r,isLoadingForDestinationIds:s})=>{const{destinations:c}=_(),{selectedStreamName:d}=Je(),{configuredDestinations:u,configuredDestinationsUpdateOnly:p}=pt(),[m,h]=t(""),[g,y]=t(lo),[v,b]=t(ro),f=l(()=>{const e=Dt(a);return e.unshift({name:no.TITLE,description:no.DESCRIPTION,icon:Oi,items:so(c,d,new Set(u.concat(p).map(e=>e.id)))}),e.unshift({name:ao.TITLE,description:ao.DESCRIPTION,icon:Ai,items:n}),e.map(e=>{const t=e.items.filter(t=>{const i=!m||t.displayName.toLowerCase().includes(m.toLowerCase()),a="all"===g.id||g.id===e.name,n=v.some(e=>t.supportedSignals[e.toLowerCase()]?.supported);return i&&a&&n});return{...e,items:t}}).filter(({items:e})=>!!e.length)},[a,n,c,m,g,v,d,u,p]);return i?null:e.createElement(Yn,null,e.createElement(A,{title:"Choose destination",description:"Add backend destination you want to connect with Odigos."}),e.createElement(Xn,null,e.createElement(Zn,null,e.createElement($,{placeholder:"Search...",icon:Ni,value:m,onChange:({target:{value:e}})=>h(e)})),e.createElement(Zn,null,e.createElement(lt,{options:oo,value:g,onSelect:y,onDeselect:()=>{}})),e.createElement(M,{title:"",selectedSignals:v,setSelectedSignals:b})),e.createElement(se,null),f.length?e.createElement(Qn,null,e.createElement(Gn,{items:f,onSelectNew:e=>o(e,v),onSelectConfigured:r,isLoadingForDestinationIds:s})):e.createElement(eo,null,e.createElement(Ne,{title:"No destinations found"})))},uo=d.div`
270
+ `,{MANAGED:to,SELF_HOSTED:io,DETECTED:ao,EXISTS:no}=Tt,oo=[{value:"All types",id:"all"},{value:to.TITLE,id:to.TITLE},{value:io.TITLE,id:io.TITLE},{value:ao.TITLE,id:ao.TITLE},{value:no.TITLE,id:no.TITLE}],lo=oo[0],ro=[St.Logs,St.Metrics,St.Traces],so=(e,t,i)=>e.map(e=>{const{type:a,displayName:n}=e.destinationType,o=e.dataStreamNames?.includes(t),l=i.has(e.id);return{id:e.id,type:a,displayName:n,selected:o||l,fields:[],testConnectionSupported:!1,supportedSignals:{[St.Logs]:{supported:e.exportedSignals.logs},[St.Metrics]:{supported:e.exportedSignals.metrics},[St.Traces]:{supported:e.exportedSignals.traces}}}}),co=({hidden:i,categories:a,potentialDestinations:n,onSelectNew:o,onSelectConfigured:r,isLoadingForDestinationIds:s})=>{const{destinations:c}=_(),{selectedStreamName:d}=Je(),{configuredDestinations:u,configuredDestinationsUpdateOnly:p}=pt(),[m,h]=t(""),[g,y]=t(lo),[v,b]=t(ro),f=l(()=>{const e=Dt(a);return e.unshift({name:no.TITLE,description:no.DESCRIPTION,icon:Ai,items:so(c,d,new Set(u.concat(p).map(e=>e.id)))}),e.unshift({name:ao.TITLE,description:ao.DESCRIPTION,icon:Fi,items:n}),e.map(e=>{const t=e.items.filter(t=>{const i=!m||t.displayName.toLowerCase().includes(m.toLowerCase()),a="all"===g.id||g.id===e.name,n=v.some(e=>t.supportedSignals[e.toLowerCase()]?.supported);return i&&a&&n});return{...e,items:t}}).filter(({items:e})=>!!e.length)},[a,n,c,m,g,v,d,u,p]);return i?null:e.createElement(Yn,null,e.createElement(A,{title:"Choose destination",description:"Add backend destination you want to connect with Odigos."}),e.createElement(Xn,null,e.createElement(Zn,null,e.createElement($,{placeholder:"Search...",icon:Ei,value:m,onChange:({target:{value:e}})=>h(e)})),e.createElement(Zn,null,e.createElement(lt,{options:oo,value:g,onSelect:y,onDeselect:()=>{}})),e.createElement(M,{title:"",selectedSignals:v,setSelectedSignals:b})),e.createElement(se,null),f.length?e.createElement(Qn,null,e.createElement(Gn,{items:f,onSelectNew:e=>o(e,v),onSelectConfigured:r,isLoadingForDestinationIds:s})):e.createElement(eo,null,e.createElement(Ne,{title:"No destinations found"})))},uo=d.div`
271
271
  display: flex;
272
272
  `,po=d.div`
273
273
  border-right: 1px solid ${({theme:e})=>e.colors.border};
@@ -276,7 +276,7 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
276
276
  @media (max-width: 1050px) {
277
277
  display: none;
278
278
  }
279
- `,mo=({isOnboarding:i,categories:a,potentialDestinations:n,createDestination:o,updateDestination:l,deleteDestination:r,testConnection:s})=>{const{destinations:c}=_(),{selectedStreamName:d}=Je(),{currentModal:u,setCurrentModal:p}=te(),{addConfiguredDestination:h,addConfiguredDestinationUpdateOnly:g,removeConfiguredDestinationUpdateOnly:y,configuredDestinationsUpdateOnly:v}=pt(),b=u===B.Destination,[f,x]=t(void 0),{formData:$,formErrors:S,handleFormChange:k,resetFormData:C,validateForm:w,setYamlFields:T,dynamicFields:D,setDynamicFields:N,loadFormWithDrawerItem:E}=kt({supportedSignals:f?.supportedSignals,preLoadedFields:f?.fields}),[I,O]=t([]),A=e=>{const t={};return e||D.forEach(e=>t[e.name]=e.value),{id:e?.id||"",name:e?.name||$.name,disabled:e?.disabled||$.disabled,dataStreamNames:e?.dataStreamNames||[],conditions:e?.conditions||[],exportedSignals:e?.exportedSignals||$.exportedSignals,fields:e?.fields||JSON.stringify(t),destinationType:e?.destinationType||{type:f.type,displayName:f.displayName,supportedSignals:{logs:{supported:!1},metrics:{supported:!1},traces:{supported:!1}}}}},F=async e=>{if(i&&!e){const e=A();h(e)}else if(i&&e){const t=A(e);v.some(t=>t.id===e.id)?y(e):g(t)}else if(i||e){if(!i&&e){const t=A(e),i=t.dataStreamNames.some(e=>e===d);O(t=>[...t,e.id]),i?await r(e.id):await l(e.id,E(t)),O(t=>t.filter(t=>t!==e.id))}}else o($)},M=()=>{C(),x(void 0),p("")},R=()=>{C(),x(void 0)},L=async()=>{if(f){if(!w({withAlert:!i,alertTitle:Q.Create}))return null;F()}M()};return j({key:"Enter",active:b},()=>L()),e.createElement(ie,{isOpen:b,onClose:M,header:{title:m.ADD_DESTINATION},actionComponent:e.createElement(ae,{buttons:(()=>{const t=[{label:"DONE",variant:"primary",onClick:L}];return f&&t.unshift({label:"BACK",icon:()=>e.createElement(Fi,{rotate:-90}),variant:"secondary",onClick:R}),t})()})},e.createElement(uo,null,e.createElement(po,null,e.createElement(Nt,{currentStep:f?2:1,data:[{stepNumber:1,title:m.DESTINATIONS},{stepNumber:2,title:m.CONNECTION}]})),e.createElement(ne,{style:{margin:"32px 24px 12px 24px"}},e.createElement(co,{hidden:void 0!==f,categories:a,potentialDestinations:n,onSelectNew:(e,t)=>{C(),k("type",e?.type||""),k("currentStreamName",d);const i={logs:!1,metrics:!1,traces:!1};t.filter(t=>e.supportedSignals[t].supported).forEach(e=>i[e]=!0),k("exportedSignals",i),T(e?.fields||[]),x(e)},onSelectConfigured:e=>{const t=c.find(t=>t.id===e);t&&F(t)},isLoadingForDestinationIds:I}),f&&e.createElement(Bn,{categoryItem:f,formData:$,formErrors:S,handleFormChange:k,dynamicFields:D,setDynamicFields:N,validateForm:w,testConnection:s}))))},ho=d.div`
279
+ `,mo=({isOnboarding:i,categories:a,potentialDestinations:n,createDestination:o,updateDestination:l,deleteDestination:r,testConnection:s})=>{const{destinations:c}=_(),{selectedStreamName:d}=Je(),{currentModal:u,setCurrentModal:p}=te(),{addConfiguredDestination:h,addConfiguredDestinationUpdateOnly:g,removeConfiguredDestinationUpdateOnly:y,configuredDestinationsUpdateOnly:v}=pt(),b=u===B.Destination,[f,x]=t(void 0),{formData:$,formErrors:S,handleFormChange:k,resetFormData:C,validateForm:w,setYamlFields:T,dynamicFields:D,setDynamicFields:N,loadFormWithDrawerItem:E}=kt({supportedSignals:f?.supportedSignals,preLoadedFields:f?.fields}),[I,O]=t([]),A=e=>{const t={};return e||D.forEach(e=>t[e.name]=e.value),{id:e?.id||"",name:e?.name||$.name,disabled:e?.disabled||$.disabled,dataStreamNames:e?.dataStreamNames||[],conditions:e?.conditions||[],exportedSignals:e?.exportedSignals||$.exportedSignals,fields:e?.fields||JSON.stringify(t),destinationType:e?.destinationType||{type:f.type,displayName:f.displayName,supportedSignals:{logs:{supported:!1},metrics:{supported:!1},traces:{supported:!1}}}}},F=async e=>{if(i&&!e){const e=A();h(e)}else if(i&&e){const t=A(e);v.some(t=>t.id===e.id)?y(e):g(t)}else if(i||e){if(!i&&e){const t=A(e),i=t.dataStreamNames.some(e=>e===d);O(t=>[...t,e.id]),i?await r(e.id):await l(e.id,E(t)),O(t=>t.filter(t=>t!==e.id))}}else o($)},M=()=>{C(),x(void 0),p("")},R=()=>{C(),x(void 0)},L=async()=>{if(f){if(!w({withAlert:!i,alertTitle:Q.Create}))return null;F()}M()};return K({key:"Enter",active:b},()=>L()),e.createElement(ie,{isOpen:b,onClose:M,header:{title:m.ADD_DESTINATION},actionComponent:e.createElement(ae,{buttons:(()=>{const t=[{label:"DONE",variant:"primary",onClick:L}];return f&&t.unshift({label:"BACK",icon:()=>e.createElement(Mi,{rotate:-90}),variant:"secondary",onClick:R}),t})()})},e.createElement(uo,null,e.createElement(po,null,e.createElement(Nt,{currentStep:f?2:1,data:[{stepNumber:1,title:m.DESTINATIONS},{stepNumber:2,title:m.CONNECTION}]})),e.createElement(ne,{style:{margin:"32px 24px 12px 24px"}},e.createElement(co,{hidden:void 0!==f,categories:a,potentialDestinations:n,onSelectNew:(e,t)=>{C(),k("type",e?.type||""),k("currentStreamName",d);const i={logs:!1,metrics:!1,traces:!1};t.filter(t=>e.supportedSignals[t].supported).forEach(e=>i[e]=!0),k("exportedSignals",i),T(e?.fields||[]),x(e)},onSelectConfigured:e=>{const t=c.find(t=>t.id===e);t&&F(t)},isLoadingForDestinationIds:I}),f&&e.createElement(Bn,{categoryItem:f,formData:$,formErrors:S,handleFormChange:k,dynamicFields:D,setDynamicFields:N,validateForm:w,testConnection:s}))))},ho=d.div`
280
280
  display: flex;
281
281
  flex-direction: column;
282
282
  align-items: center;
@@ -285,7 +285,7 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
285
285
  max-height: calc(100vh - 310px);
286
286
  height: fit-content;
287
287
  overflow-y: scroll;
288
- `,go=({categories:t,withDelete:i})=>{const{configuredDestinations:a,configuredDestinationsUpdateOnly:n}=pt();return a.length||n.length?e.createElement(ho,null,a.concat(n).map((o,l)=>e.createElement(yo,{key:`configured-destination-${o.destinationType.type}-${l}`,"data-id":`configured-destination-${o.destinationType.type}`,item:o,yamlFields:Ct(t,o),isLastItem:a.length+n.length===1,withDelete:i}))):e.createElement(De,null,e.createElement(Ne,{title:"No destinations",subTitle:"Please add a destination"}))},yo=({item:i,yamlFields:a,isLastItem:n,withDelete:o})=>{const[r,s]=t(!1),{icon:c,iconSrc:d}=He(i.destinationType.type),{removeConfiguredDestination:u,removeConfiguredDestinationUpdateOnly:p}=pt(),m=l(()=>ft(i,a).map(e=>({title:e.name,value:e.value})),[i,a]);return e.createElement(e.Fragment,null,e.createElement(Pe,{title:i.name||i.destinationType.displayName,subTitle:i.destinationType.type,iconProps:{icon:c,iconSrc:d},visualProps:{monitors:Ke(i.exportedSignals),monitorsWithLabels:!0},extendableProps:{withExtend:!0,renderExtended:()=>e.createElement(Et,{data:m})},renderActions:o?()=>e.createElement(ht,{onClick:()=>s(!0)},e.createElement(Ci,null)):void 0}),o&&e.createElement(H,{isOpen:r,name:i.destinationType.displayName||i.name,type:B.Destination,isLastItem:n,onApprove:()=>{i.id?p(i):u(i)},onDeny:()=>s(!1)}))},vo=d(Fe)`
288
+ `,go=({categories:t,withDelete:i})=>{const{configuredDestinations:a,configuredDestinationsUpdateOnly:n}=pt();return a.length||n.length?e.createElement(ho,null,a.concat(n).map((o,l)=>e.createElement(yo,{key:`configured-destination-${o.destinationType.type}-${l}`,"data-id":`configured-destination-${o.destinationType.type}`,item:o,yamlFields:Ct(t,o),isLastItem:a.length+n.length===1,withDelete:i}))):e.createElement(De,null,e.createElement(Ne,{title:"No destinations",subTitle:"Please add a destination"}))},yo=({item:i,yamlFields:a,isLastItem:n,withDelete:o})=>{const[r,s]=t(!1),{icon:c,iconSrc:d}=ze(i.destinationType.type),{removeConfiguredDestination:u,removeConfiguredDestinationUpdateOnly:p}=pt(),m=l(()=>ft(i,a).map(e=>({title:e.name,value:e.value})),[i,a]);return e.createElement(e.Fragment,null,e.createElement(Pe,{title:i.name||i.destinationType.displayName,subTitle:i.destinationType.type,iconProps:{icon:c,iconSrc:d},visualProps:{monitors:je(i.exportedSignals),monitorsWithLabels:!0},extendableProps:{withExtend:!0,renderExtended:()=>e.createElement(Et,{data:m})},renderActions:o?()=>e.createElement(ht,{onClick:()=>s(!0)},e.createElement(wi,null)):void 0}),o&&e.createElement(z,{isOpen:r,name:i.destinationType.displayName||i.name,type:B.Destination,isLastItem:n,onApprove:()=>{i.id?p(i):u(i)},onDeny:()=>s(!1)}))},vo=d(Fe)`
289
289
  display: flex;
290
290
  align-items: center;
291
291
  justify-content: center;
@@ -294,7 +294,7 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
294
294
  padding: 32px;
295
295
  border-radius: 16px;
296
296
  border-style: dashed !important;
297
- `,bo=({isSourcesListEmpty:t,goToSources:i,categories:a,potentialDestinations:n,testConnection:o,onClickSummary:l})=>{const r=I.useTheme(),{setCurrentModal:s}=te(),{configuredDestinations:c,configuredDestinationsUpdateOnly:d}=pt();return e.createElement(e.Fragment,null,e.createElement(ne,{$isNotModal:!0},e.createElement(ee,{$gap:12},e.createElement(ee,{$gap:24},l&&e.createElement(vt,{onClick:l}),e.createElement(A,{title:m.ADD_DESTINATIONS,badgeLabel:c.length+d.length,description:m.ADD_DESTINATION_DESCRIPTION}),t&&e.createElement(oe,{type:W.Warning,message:m.NO_SOURCES_GO_BACK,action:{label:m.SELECT_SOURCES,onClick:i}}),e.createElement(vo,{variant:"secondary",onClick:()=>s(B.Destination)},e.createElement(Ti,null),e.createElement(E,{color:r.colors.secondary,size:14,decoration:"underline",family:"secondary"},m.ADD_DESTINATION))),e.createElement(go,{categories:a,withDelete:!0}))),e.createElement(mo,{isOnboarding:!0,categories:a,potentialDestinations:n,updateDestination:async()=>{},createDestination:async()=>{},deleteDestination:async()=>{},testConnection:o}))},fo=[{key:"icon",title:""},{key:"name",title:m.NAME,sortable:!0},{key:"type",title:m.TYPE,sortable:!0},{key:"signals",title:m.MONITORS},{key:"active-status",title:m.STATUS},{key:"conditions",title:"Conditions"},{key:"throughput",title:"Throughput",sortable:!0}],xo=({metrics:t,maxHeight:i,maxWidth:a})=>{const n=I.useTheme(),o=ye(),{selectedStreamName:r}=Je(),{setDrawerType:s,setDrawerEntityId:c}=K(),{destinations:d,destinationsLoading:u}=_(),p=l(()=>Ze(d,r),[d,r]),h=l(()=>Oa({instrumentationRules:[],sources:[],actions:[],destinations:Xe(p,o),searchText:o.searchText,selectedCategory:B.Destination}).searchResults.find(({category:e})=>e===B.Destination)?.entities||[],[p,o]),g=l(()=>h.map(i=>{const{hasErrors:a,hasWarnings:o,hasDisableds:l}=ce(i.conditions||[]),{icon:r,iconSrc:d}=He(i.destinationType.type);return{status:a?W.Error:o?W.Warning:void 0,faded:l,onClick:()=>{s(B.Destination),c(i.id)},cells:[{columnKey:"icon",component:()=>e.createElement(be,{icon:r,src:d})},{columnKey:"name",value:fe(i,B.Destination,{prioritizeDisplayName:!0})},{columnKey:"type",value:i.destinationType.type,textColor:n.text.info},{columnKey:"throughput",value:je(It(t,B.Destination,i.id).throughput),textColor:n.text.info},{columnKey:"signals",component:()=>e.createElement(xe,{withLabels:!0,monitors:Ke(i.exportedSignals)})},{columnKey:"conditions",component:()=>i.conditions?.length?e.createElement(Ea,{conditions:i.conditions,id:i.id}):null},{columnKey:"active-status",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(de,{status:i.disabled?W.Error:W.Success,title:i.disabled?m.DISABLED:m.ENABLED,withIcon:!0,withBorder:!0}))}]}}),[h,t]),{badge:y,badgeTooltip:v}=l(()=>h.length!==p.length?{badge:`${h.length}/${p.length}`,badgeTooltip:m.FILTERED_COUNT_TOOLTIP}:{badge:p.length,badgeTooltip:void 0},[h,p]);return e.createElement($e,{$maxWidth:a},e.createElement(Se,null,e.createElement(ke,{icon:Ce(B.Destination),title:m.DESTINATIONS,badge:y,badgeTooltip:v,loading:u})),e.createElement(we,{$maxHeight:i},e.createElement(Te,{columns:fo,rows:g})),!h.length&&e.createElement(De,{style:{marginTop:"2rem"}},e.createElement(Ne,null)))},$o=e=>{const{type:t,ruleName:i,notes:a,disabled:n,profileName:o,payloadCollection:l,codeAttributes:r,headersCollection:s,customInstrumentations:c}=e,d=[{title:m.TYPE,value:t},{type:h.ActiveStatus,title:m.STATUS,value:String(!n)},{title:m.NAME,value:i},{title:m.NOTES,value:a},{title:m.MANAGED_BY_PROFILE,value:o},{type:h.Divider}];if(l){const e=Object.entries(l).filter(([e,t])=>t).map(([e,t])=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(r){const e=Object.entries(r).filter(([e,t])=>t).map(([e,t])=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(s){const e=(s[Ot.HeaderKeys]||[]).filter(e=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(c){const e=(c[Ft.Java]||[]).map(e=>new At(e.className,e.methodName)).map(e=>`• ${e.toString()}`).join("\r\n");e&&d.push({title:m.JAVA_CUSTOM_PROBES,value:e});const t=(c[Ft.Golang]||[]).map(e=>new Mt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)).map(e=>`• ${e.toString()}`).join("\r\n");t&&d.push({title:m.GOLANG_CUSTOM_PROBES,value:t})}return d},So=d.div`
297
+ `,bo=({isSourcesListEmpty:t,goToSources:i,categories:a,potentialDestinations:n,testConnection:o,onClickSummary:l})=>{const r=I.useTheme(),{setCurrentModal:s}=te(),{configuredDestinations:c,configuredDestinationsUpdateOnly:d}=pt();return e.createElement(e.Fragment,null,e.createElement(ne,{$isNotModal:!0},e.createElement(ee,{$gap:12},e.createElement(ee,{$gap:24},l&&e.createElement(vt,{onClick:l}),e.createElement(A,{title:m.ADD_DESTINATIONS,badgeLabel:c.length+d.length,description:m.ADD_DESTINATION_DESCRIPTION}),t&&e.createElement(oe,{type:W.Warning,message:m.NO_SOURCES_GO_BACK,action:{label:m.SELECT_SOURCES,onClick:i}}),e.createElement(vo,{variant:"secondary",onClick:()=>s(B.Destination)},e.createElement(Di,null),e.createElement(E,{color:r.colors.secondary,size:14,decoration:"underline",family:"secondary"},m.ADD_DESTINATION))),e.createElement(go,{categories:a,withDelete:!0}))),e.createElement(mo,{isOnboarding:!0,categories:a,potentialDestinations:n,updateDestination:async()=>{},createDestination:async()=>{},deleteDestination:async()=>{},testConnection:o}))},fo=[{key:"icon",title:""},{key:"name",title:m.NAME,sortable:!0},{key:"type",title:m.TYPE,sortable:!0},{key:"signals",title:m.MONITORS},{key:"active-status",title:m.STATUS},{key:"conditions",title:"Conditions"},{key:"throughput",title:"Throughput",sortable:!0}],xo=({metrics:t,maxHeight:i,maxWidth:a})=>{const n=I.useTheme(),o=ye(),{selectedStreamName:r}=Je(),{setDrawerType:s,setDrawerEntityId:c}=j(),{destinations:d,destinationsLoading:u}=_(),p=l(()=>Ze(d,r),[d,r]),h=l(()=>Oa({instrumentationRules:[],sources:[],actions:[],destinations:Xe(p,o),searchText:o.searchText,selectedCategory:B.Destination}).searchResults.find(({category:e})=>e===B.Destination)?.entities||[],[p,o]),g=l(()=>h.map(i=>{const{hasErrors:a,hasWarnings:o,hasDisableds:l}=ce(i.conditions||[]),{icon:r,iconSrc:d}=ze(i.destinationType.type);return{status:a?W.Error:o?W.Warning:void 0,faded:l,onClick:()=>{s(B.Destination),c(i.id)},cells:[{columnKey:"icon",component:()=>e.createElement(be,{icon:r,src:d})},{columnKey:"name",value:fe(i,B.Destination,{prioritizeDisplayName:!0})},{columnKey:"type",value:i.destinationType.type,textColor:n.text.info},{columnKey:"throughput",value:Ke(It(t,B.Destination,i.id).throughput),textColor:n.text.info},{columnKey:"signals",component:()=>e.createElement(xe,{withLabels:!0,monitors:je(i.exportedSignals)})},{columnKey:"conditions",component:()=>i.conditions?.length?e.createElement(Ea,{conditions:i.conditions,id:i.id}):null},{columnKey:"active-status",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(de,{status:i.disabled?W.Error:W.Success,title:i.disabled?m.DISABLED:m.ENABLED,withIcon:!0,withBorder:!0}))}]}}),[h,t]),{badge:y,badgeTooltip:v}=l(()=>h.length!==p.length?{badge:`${h.length}/${p.length}`,badgeTooltip:m.FILTERED_COUNT_TOOLTIP}:{badge:p.length,badgeTooltip:void 0},[h,p]);return e.createElement($e,{$maxWidth:a},e.createElement(Se,null,e.createElement(ke,{icon:Ce(B.Destination),title:m.DESTINATIONS,badge:y,badgeTooltip:v,loading:u})),e.createElement(we,{$maxHeight:i},e.createElement(Te,{columns:fo,rows:g})),!h.length&&e.createElement(De,{style:{marginTop:"2rem"}},e.createElement(Ne,null)))},$o=e=>{const{type:t,ruleName:i,notes:a,disabled:n,profileName:o,payloadCollection:l,codeAttributes:r,headersCollection:s,customInstrumentations:c}=e,d=[{title:m.TYPE,value:t},{type:h.ActiveStatus,title:m.STATUS,value:String(!n)},{title:m.NAME,value:i},{title:m.NOTES,value:a},{title:m.MANAGED_BY_PROFILE,value:o},{type:h.Divider}];if(l){const e=Object.entries(l).filter(([e,t])=>t).map(([e,t])=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(r){const e=Object.entries(r).filter(([e,t])=>t).map(([e,t])=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(s){const e=(s[Ot.HeaderKeys]||[]).filter(e=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(c){const e=(c[Ft.Java]||[]).map(e=>new At(e.className,e.methodName)).map(e=>`• ${e.toString()}`).join("\r\n");e&&d.push({title:m.JAVA_CUSTOM_PROBES,value:e});const t=(c[Ft.Golang]||[]).map(e=>new Mt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)).map(e=>`• ${e.toString()}`).join("\r\n");t&&d.push({title:m.GOLANG_CUSTOM_PROBES,value:t})}return d},So=d.div`
298
298
  display: flex;
299
299
  flex-direction: column;
300
300
  gap: 12px;
@@ -321,7 +321,7 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
321
321
  padding: 4px;
322
322
  `,Ao=d(E)`
323
323
  margin-bottom: 12px;
324
- `,Fo=({isUpdate:t,rule:i,formData:a,formErrors:n,handleFormChange:o})=>{const l=I.useTheme();return e.createElement(Oo,null,e.createElement(ue,null,i.supportedLanguages.map(t=>e.createElement(Kt,{key:t,icon:jt(t),type:W.Info},rt[t]))),t?e.createElement("div",null,e.createElement(Ao,null,"Status"),e.createElement(O,{options:[{icon:$i,label:m.ENABLED,value:!1,selectedBgColor:l.text.success+I.opacity.hex["050"]},{icon:Si,label:m.DISABLED,value:!0,selectedBgColor:l.text.error+I.opacity.hex["050"]}],selected:a.disabled,setSelected:e=>o("disabled",e)})):e.createElement(e.Fragment,null,e.createElement(A,{title:"",description:i.docsDescription,actionButton:e.createElement(F,{endpoint:i.docsEndpoint})}),e.createElement($,{title:"Rule name",placeholder:"Use a name that describes the rule",value:a.ruleName,onChange:({target:{value:e}})=>o("ruleName",e),errorMessage:n.ruleName})),e.createElement(Io,{ruleType:i.type,value:a,setValue:(e,t)=>o(e,t),formErrors:n}),e.createElement(R,{title:"Notes",value:a.notes,onChange:({target:{value:e}})=>o("notes",e),errorMessage:n.notes}))},Mo=d.div`
324
+ `,Fo=({isUpdate:t,rule:i,formData:a,formErrors:n,handleFormChange:o})=>{const l=I.useTheme();return e.createElement(Oo,null,e.createElement(ue,null,i.supportedLanguages.map(t=>e.createElement(jt,{key:t,icon:Kt(t),type:W.Info},rt[t]))),t?e.createElement("div",null,e.createElement(Ao,null,"Status"),e.createElement(O,{options:[{icon:Si,label:m.ENABLED,value:!1,selectedBgColor:l.text.success+I.opacity.hex["050"]},{icon:ki,label:m.DISABLED,value:!0,selectedBgColor:l.text.error+I.opacity.hex["050"]}],selected:a.disabled,setSelected:e=>o("disabled",e)})):e.createElement(e.Fragment,null,e.createElement(A,{title:"",description:i.docsDescription,actionButton:e.createElement(F,{endpoint:i.docsEndpoint})}),e.createElement($,{title:"Rule name",placeholder:"Use a name that describes the rule",value:a.ruleName,onChange:({target:{value:e}})=>o("ruleName",e),errorMessage:n.ruleName})),e.createElement(Io,{ruleType:i.type,value:a,setValue:(e,t)=>o(e,t),formErrors:n}),e.createElement(R,{title:"Notes",value:a.notes,onChange:({target:{value:e}})=>o("notes",e),errorMessage:n.notes}))},Mo=d.div`
325
325
  width: 100%;
326
326
  height: 100%;
327
327
  max-height: calc(100vh - 220px);
@@ -331,10 +331,10 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
331
331
  display: flex;
332
332
  flex-direction: column;
333
333
  gap: 12px;
334
- `,Lo=({updateInstrumentationRule:a,deleteInstrumentationRule:o})=>{const{instrumentationRules:r}=_(),{addNotification:s}=P(),{drawerType:c,drawerEntityId:d}=K(),u=n(null),p=c===B.InstrumentationRule,[m,h]=t(!1),[g,y]=t(!1),{formData:v,formErrors:b,handleFormChange:f,resetFormData:x,validateForm:$,loadFormWithDrawerItem:S}=Vt(),k=l(()=>{if(d)return r?.find(e=>U(e)===d)},[d,r]);if(i(()=>{p&&k?S(k):x()},[p,k]),!k)return null;const C=qt.find(({type:e})=>e===k.type);return e.createElement($a,{ref:u,title:k.ruleName||k.type,icons:[qe(k.type)],isEdit:m,isFormDirty:g,onEdit:e=>{k.mutable||!e&&void 0!==e?h("boolean"!=typeof e||e):s({type:W.Warning,title:le.FORBIDDEN,message:le.CANNOT_EDIT_RULE,crdType:B.InstrumentationRule,target:d,hideFromHistory:!0})},onSave:e=>{if($()){const t=e!==k.type?e:"";f("ruleName",t),a(d,{...v,ruleName:t}),h(!1),y(!1)}},onDelete:()=>{k.mutable?(o(d),h(!1),y(!1),u.current?.closeDrawer()):s({type:W.Warning,title:le.FORBIDDEN,message:le.CANNOT_DELETE_RULE,crdType:B.InstrumentationRule,target:d,hideFromHistory:!0})},onCancel:()=>{h(!1),y(!1),S(k)}},m&&C?e.createElement(Mo,null,e.createElement(Fo,{isUpdate:!0,rule:C,formData:v,formErrors:b,handleFormChange:(...e)=>{y(!0),f(...e)}})):e.createElement(Ro,null,e.createElement(X,{conditions:k.conditions||[]}),e.createElement(Z,{title:"Instrumentation Rule Details",data:k?$o(k):[]})))},Po=d(ee)`
334
+ `,Lo=({updateInstrumentationRule:a,deleteInstrumentationRule:o})=>{const{instrumentationRules:r}=_(),{addNotification:s}=P(),{drawerType:c,drawerEntityId:d}=j(),u=n(null),p=c===B.InstrumentationRule,[m,h]=t(!1),[g,y]=t(!1),{formData:v,formErrors:b,handleFormChange:f,resetFormData:x,validateForm:$,loadFormWithDrawerItem:S}=Vt(),k=l(()=>{if(d)return r?.find(e=>U(e)===d)},[d,r]);if(i(()=>{p&&k?S(k):x()},[p,k]),!k)return null;const C=qt.find(({type:e})=>e===k.type);return e.createElement($a,{ref:u,title:k.ruleName||k.type,icons:[qe(k.type)],isEdit:m,isFormDirty:g,onEdit:e=>{k.mutable||!e&&void 0!==e?h("boolean"!=typeof e||e):s({type:W.Warning,title:le.FORBIDDEN,message:le.CANNOT_EDIT_RULE,crdType:B.InstrumentationRule,target:d,hideFromHistory:!0})},onSave:e=>{if($()){const t=e!==k.type?e:"";f("ruleName",t),a(d,{...v,ruleName:t}),h(!1),y(!1)}},onDelete:()=>{k.mutable?(o(d),h(!1),y(!1),u.current?.closeDrawer()):s({type:W.Warning,title:le.FORBIDDEN,message:le.CANNOT_DELETE_RULE,crdType:B.InstrumentationRule,target:d,hideFromHistory:!0})},onCancel:()=>{h(!1),y(!1),S(k)}},m&&C?e.createElement(Mo,null,e.createElement(Fo,{isUpdate:!0,rule:C,formData:v,formErrors:b,handleFormChange:(...e)=>{y(!0),f(...e)}})):e.createElement(Ro,null,e.createElement(X,{conditions:k.conditions||[]}),e.createElement(Z,{title:"Instrumentation Rule Details",data:k?$o(k):[]})))},Po=d(ee)`
335
335
  margin-top: 24px;
336
336
  gap: 12px;
337
- `,Ko=qt,jo=({isEnterprise:i,createInstrumentationRule:a})=>{const{currentModal:n,setCurrentModal:o}=te(),l=n===B.InstrumentationRule,{formData:r,formErrors:s,handleFormChange:c,resetFormData:d,validateForm:u}=Vt(),[p,h]=t(void 0),g=()=>{d(),h(void 0),o("")},y=()=>{if(!u())return null;a(r),g()};return j({key:"Enter",active:l},()=>y()),e.createElement(ie,{isOpen:l,onClose:g,header:{title:"Add Instrumentation Rule"},actionComponent:e.createElement(ae,{buttons:[{variant:"primary",label:"DONE",onClick:y,disabled:!i||!p,tooltip:i?"":le.ENTERPRISE_ONLY("Instrumentation Rules")}]})},e.createElement(ne,null,e.createElement(A,{title:"Select Instrumentation Rule",description:"Define how telemetry is recorded from your application. Choose a rule type and configure the details."}),e.createElement(Po,null,i?e.createElement(oe,{type:W.Warning,message:le.DEFINED_FOR_ALL_STREAMS(m.INSTRUMENTATION_RULES)}):e.createElement(oe,{type:W.Default,message:le.ENTERPRISE_ONLY(m.INSTRUMENTATION_RULES)}),e.createElement(re,{options:Ko,selectedOption:p,onOptionSelect:e=>{return t=e,d(),void h(t);var t},autoFocus:!p?.type})),p?.type?e.createElement("div",null,e.createElement(se,{margin:"16px 0"}),e.createElement(Fo,{rule:p,formData:r,formErrors:s,handleFormChange:c})):null))},Vo=e=>{const{payloadCollection:t,codeAttributes:i,customInstrumentations:a}=e;let n="";return t&&(n+=Object.entries(t).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),i&&(n+=Object.entries(i).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),a&&Object.values(Ft).forEach(e=>{const t=(a[e]||[]).filter(e=>e).join(", ");t&&(n+=n?`, ${t}`:t)}),n},qo=[{key:"icon",title:""},{key:"name",title:m.NAME,sortable:!0},{key:"profile",title:m.MANAGED_BY_PROFILE,sortable:!0},{key:"active-status",title:m.STATUS},{key:"conditions",title:"Conditions"},{key:"source-count",title:"Applicable Source"},{key:"type",title:m.TYPE,sortable:!0},{key:"spec",title:"Spec",sortable:!0},{key:"notes",title:m.NOTES,sortable:!0}],Ho=({maxHeight:t,maxWidth:i})=>{const a=p(),n=ye(),{setDrawerType:o,setDrawerEntityId:r}=K(),{instrumentationRules:s,instrumentationRulesLoading:c}=_(),d=l(()=>Oa({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:i,hasWarnings:n,hasDisableds:l}=ce(t.conditions||[]);return{status:i?W.Error:n?W.Warning:void 0,faded:l,onClick:()=>{o(B.InstrumentationRule),r(t.ruleId)},cells:[{columnKey:"icon",component:()=>e.createElement(be,{icon:qe(t.type)})},{columnKey:"name",value:fe(t,B.InstrumentationRule,{prioritizeDisplayName:!0})},{columnKey:"type",value:t.type,textColor:a.text.info},{columnKey:"profile",value:t.profileName,textColor:a.text.info},{columnKey:"notes",value:t.notes,textColor:a.text.info,withTooltip:!0},{columnKey:"spec",value:Vo(t),textColor:a.text.info,withTooltip:!0},{columnKey:"conditions",component:()=>e.createElement(Ea,{conditions:t.conditions||[],id:t.ruleId})},{columnKey:"active-status",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(de,{status:t.disabled?W.Error:W.Success,title:t.disabled?m.DISABLED:m.ENABLED,withIcon:!0,withBorder:!0}))},{columnKey:"source-count",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(de,{status:W.Info,title:"all sources",withBorder:!0}))}]}}),[d]),{badge:h,badgeTooltip:g}=l(()=>d.length!==s.length?{badge:`${d.length}/${s.length}`,badgeTooltip:m.FILTERED_COUNT_TOOLTIP}:{badge:s.length,badgeTooltip:void 0},[d,s]);return e.createElement($e,{$maxWidth:i},e.createElement(Se,null,e.createElement(ke,{icon:Ce(B.Action),title:m.INSTRUMENTATION_RULES,badge:h,badgeTooltip:g,loading:c})),e.createElement(we,{$maxHeight:t},e.createElement(Te,{columns:qo,rows:u})),!d.length&&e.createElement(De,{style:{marginTop:"2rem"}},e.createElement(Ne,null)))},zo=d.div`
337
+ `,jo=qt,Ko=({isEnterprise:i,createInstrumentationRule:a})=>{const{currentModal:n,setCurrentModal:o}=te(),l=n===B.InstrumentationRule,{formData:r,formErrors:s,handleFormChange:c,resetFormData:d,validateForm:u}=Vt(),[p,h]=t(void 0),g=()=>{d(),h(void 0),o("")},y=()=>{if(!u())return null;a(r),g()};return K({key:"Enter",active:l},()=>y()),e.createElement(ie,{isOpen:l,onClose:g,header:{title:"Add Instrumentation Rule"},actionComponent:e.createElement(ae,{buttons:[{variant:"primary",label:"DONE",onClick:y,disabled:!i||!p,tooltip:i?"":le.ENTERPRISE_ONLY("Instrumentation Rules")}]})},e.createElement(ne,null,e.createElement(A,{title:"Select Instrumentation Rule",description:"Define how telemetry is recorded from your application. Choose a rule type and configure the details."}),e.createElement(Po,null,i?e.createElement(oe,{type:W.Warning,message:le.DEFINED_FOR_ALL_STREAMS(m.INSTRUMENTATION_RULES)}):e.createElement(oe,{type:W.Default,message:le.ENTERPRISE_ONLY(m.INSTRUMENTATION_RULES)}),e.createElement(re,{options:jo,selectedOption:p,onOptionSelect:e=>{return t=e,d(),void h(t);var t},autoFocus:!p?.type})),p?.type?e.createElement("div",null,e.createElement(se,{margin:"16px 0"}),e.createElement(Fo,{rule:p,formData:r,formErrors:s,handleFormChange:c})):null))},Vo=e=>{const{payloadCollection:t,codeAttributes:i,customInstrumentations:a}=e;let n="";return t&&(n+=Object.entries(t).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),i&&(n+=Object.entries(i).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),a&&Object.values(Ft).forEach(e=>{const t=(a[e]||[]).filter(e=>e).join(", ");t&&(n+=n?`, ${t}`:t)}),n},qo=[{key:"icon",title:""},{key:"name",title:m.NAME,sortable:!0},{key:"profile",title:m.MANAGED_BY_PROFILE,sortable:!0},{key:"active-status",title:m.STATUS},{key:"conditions",title:"Conditions"},{key:"source-count",title:"Applicable Source"},{key:"type",title:m.TYPE,sortable:!0},{key:"spec",title:"Spec",sortable:!0},{key:"notes",title:m.NOTES,sortable:!0}],zo=({maxHeight:t,maxWidth:i})=>{const a=p(),n=ye(),{setDrawerType:o,setDrawerEntityId:r}=j(),{instrumentationRules:s,instrumentationRulesLoading:c}=_(),d=l(()=>Oa({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:i,hasWarnings:n,hasDisableds:l}=ce(t.conditions||[]);return{status:i?W.Error:n?W.Warning:void 0,faded:l,onClick:()=>{o(B.InstrumentationRule),r(t.ruleId)},cells:[{columnKey:"icon",component:()=>e.createElement(be,{icon:qe(t.type)})},{columnKey:"name",value:fe(t,B.InstrumentationRule,{prioritizeDisplayName:!0})},{columnKey:"type",value:t.type,textColor:a.text.info},{columnKey:"profile",value:t.profileName,textColor:a.text.info},{columnKey:"notes",value:t.notes,textColor:a.text.info,withTooltip:!0},{columnKey:"spec",value:Vo(t),textColor:a.text.info,withTooltip:!0},{columnKey:"conditions",component:()=>e.createElement(Ea,{conditions:t.conditions||[],id:t.ruleId})},{columnKey:"active-status",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(de,{status:t.disabled?W.Error:W.Success,title:t.disabled?m.DISABLED:m.ENABLED,withIcon:!0,withBorder:!0}))},{columnKey:"source-count",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(de,{status:W.Info,title:"all sources",withBorder:!0}))}]}}),[d]),{badge:h,badgeTooltip:g}=l(()=>d.length!==s.length?{badge:`${d.length}/${s.length}`,badgeTooltip:m.FILTERED_COUNT_TOOLTIP}:{badge:s.length,badgeTooltip:void 0},[d,s]);return e.createElement($e,{$maxWidth:i},e.createElement(Se,null,e.createElement(ke,{icon:Ce(B.Action),title:m.INSTRUMENTATION_RULES,badge:h,badgeTooltip:g,loading:c})),e.createElement(we,{$maxHeight:t},e.createElement(Te,{columns:qo,rows:u})),!d.length&&e.createElement(De,{style:{marginTop:"2rem"}},e.createElement(Ne,null)))},Ho=d.div`
338
338
  position: fixed;
339
339
  bottom: 0;
340
340
  left: 50%;
@@ -348,7 +348,7 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
348
348
  border: 1px solid ${({theme:e})=>e.colors.border};
349
349
  background-color: ${({theme:e})=>e.colors.dropdown_bg};
350
350
  animation-name: ${I.animations.slide.in.center};
351
- `,Bo=({totalSourceCount:i,uninstrumentSources:a,restartWorkloads:n})=>{const o=I.useTheme(),{selectedSources:s,setSelectedSources:c}=Me(),[d,u]=t(!1),p=l(()=>{let e=0;return Object.values(s).forEach(t=>{e+=t.length}),e},[s]),m=()=>{c({})};return p?e.createElement(r,null,e.createElement(zo,{"data-id":"multi-source-control"},e.createElement(E,null,"Selected sources"),e.createElement(Ie,{label:p,filled:!0}),e.createElement(se,{orientation:"vertical",length:"16px"}),e.createElement(Fe,{variant:"tertiary",onClick:m},e.createElement(E,{family:"secondary",decoration:"underline"},"Deselect")),e.createElement(Fe,{variant:"tertiary",onClick:()=>{const e=[];Object.values(s).forEach(t=>{e.push(...t.map(e=>Ht(e)))}),n(e),m()}},e.createElement(Mi,null),e.createElement(E,{family:"secondary",decoration:"underline"},"Restart")),e.createElement(Fe,{variant:"tertiary",onClick:()=>u(!0)},e.createElement(Ci,null),e.createElement(E,{family:"secondary",decoration:"underline",color:o.text.error},"Uninstrument"))),e.createElement(H,{isOpen:d,name:`${p} sources`,type:B.Source,isLastItem:p===i,onApprove:()=>{const e={};Object.entries(s).forEach(([t,i])=>{e[t]=i.map(e=>({...e,selected:!1}))}),a(e),u(!1),m()},onDeny:()=>u(!1)})):null},Wo=d.div`
351
+ `,Bo=({totalSourceCount:i,uninstrumentSources:a,restartWorkloads:n})=>{const o=I.useTheme(),{selectedSources:s,setSelectedSources:c}=Me(),[d,u]=t(!1),p=l(()=>{let e=0;return Object.values(s).forEach(t=>{e+=t.length}),e},[s]),m=()=>{c({})};return p?e.createElement(r,null,e.createElement(Ho,{"data-id":"multi-source-control"},e.createElement(E,null,"Selected sources"),e.createElement(Ie,{label:p,filled:!0}),e.createElement(se,{orientation:"vertical",length:"16px"}),e.createElement(Fe,{variant:"tertiary",onClick:m},e.createElement(E,{family:"secondary",decoration:"underline"},"Deselect")),e.createElement(Fe,{variant:"tertiary",onClick:()=>{const e=[];Object.values(s).forEach(t=>{e.push(...t.map(e=>zt(e)))}),n(e),m()}},e.createElement(Ri,null),e.createElement(E,{family:"secondary",decoration:"underline"},"Restart")),e.createElement(Fe,{variant:"tertiary",onClick:()=>u(!0)},e.createElement(wi,null),e.createElement(E,{family:"secondary",decoration:"underline",color:o.text.error},"Uninstrument"))),e.createElement(z,{isOpen:d,name:`${p} sources`,type:B.Source,isLastItem:p===i,onApprove:()=>{const e={};Object.entries(s).forEach(([t,i])=>{e[t]=i.map(e=>({...e,selected:!1}))}),a(e),u(!1),m()},onDeny:()=>u(!1)})):null},Wo=d.div`
352
352
  position: relative;
353
353
  width: fit-content;
354
354
  `,_o=d(ue)`
@@ -373,7 +373,7 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
373
373
  border-radius: 32px;
374
374
  width: fit-content;
375
375
  padding: 2px 8px;
376
- `,Yo=()=>{const t=I.useTheme(),{notifications:i,markAsSeen:a}=P(),n=i.filter(({hideFromHistory:e})=>!e),o=n.filter(({seen:e})=>!e),l=o.length,{popupRef:r,popupOpen:s,setPopupOpen:c,popupPosition:d,handlePosition:u}=et({defaultClientHeight:420,defaultClientwidth:400,onClickOutside:()=>{l&&o.forEach(({id:e})=>a(e))}});return e.createElement(Wo,null,e.createElement(ht,{onClick:()=>{u(0,0),c(e=>!e)},tooltip:"Notifications",withPing:!!l,pingColor:t.colors.orange_og},e.createElement(Ri,{size:18})),e.createElement(tt,{ref:r,isOpen:s,right:d.left,maxWidth:"400px",header:e.createElement(_o,null,e.createElement(E,{size:20},"Notifications"),!!l&&e.createElement(Go,{size:12,family:"secondary"},l," new"))},e.createElement(Jo,null,n.length?n.map(t=>e.createElement(il,{key:`notification-${t.id}`,...t,onClick:()=>c(!1)})):e.createElement(Ne,{title:"No notifications",subTitle:""})),e.createElement(Uo,null)))},Xo=d.div`
376
+ `,Yo=()=>{const t=I.useTheme(),{notifications:i,markAsSeen:a}=P(),n=i.filter(({hideFromHistory:e})=>!e),o=n.filter(({seen:e})=>!e),l=o.length,{popupRef:r,popupOpen:s,setPopupOpen:c,popupPosition:d,handlePosition:u}=et({defaultClientHeight:420,defaultClientwidth:400,onClickOutside:()=>{l&&o.forEach(({id:e})=>a(e))}});return e.createElement(Wo,null,e.createElement(ht,{onClick:()=>{u(0,0),c(e=>!e)},tooltip:"Notifications",withPing:!!l,pingColor:t.colors.orange_og},e.createElement(Li,{size:18})),e.createElement(tt,{ref:r,isOpen:s,right:d.left,maxWidth:"400px",header:e.createElement(_o,null,e.createElement(E,{size:20},"Notifications"),!!l&&e.createElement(Go,{size:12,family:"secondary"},l," new"))},e.createElement(Jo,null,n.length?n.map(t=>e.createElement(il,{key:`notification-${t.id}`,...t,onClick:()=>c(!1)})):e.createElement(Ne,{title:"No notifications",subTitle:""})),e.createElement(Uo,null)))},Xo=d.div`
377
377
  display: flex;
378
378
  align-items: flex-start;
379
379
  gap: 12px;
@@ -403,11 +403,11 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
403
403
  display: flex;
404
404
  align-items: center;
405
405
  gap: 6px;
406
- `,il=({id:t,seen:i,type:a,title:n,message:o,time:l,crdType:r,target:s,onClick:c})=>{const d=I.useTheme(),{formatTimeAgo:u}=zt(),{onClickNotification:p}=Bt(),m=!!r&&!!s,h=n?.toLowerCase().includes(Q.Delete.toLowerCase())||!1,g=ge(a,d);return e.createElement(Xo,{key:`notification-${t}`,className:m?"click-enabled":"",onClick:()=>{m&&(c(),p({id:t,crdType:r,target:s}))}},e.createElement(Zo,{$type:h?W.Error:a},h?e.createElement(Ci,null):e.createElement(g,null)),e.createElement(Qo,null,e.createElement(el,null,e.createElement(E,{size:14},o)),e.createElement(tl,null,e.createElement(E,{size:10,color:d.text.grey},u(l)),!i&&e.createElement(e.Fragment,null,e.createElement(E,{size:10},"·"),e.createElement(E,{size:10,color:d.colors.orange_soft},"new")))))},al=(e,t,i)=>{const a=e?.serviceName||t?.otelServiceName||t?.name,n=i?[Li]:ze(t?.containers||[]),{priorotizedStatus:o}=ce(t?.conditions||[]);return{id:a,title:a,icons:n.length?n:[Pi],status:o,serviceMapEntry:e}},nl=e=>"user"===e?.otelServiceName&&!e?.namespace&&!e?.name&&!e?.kind,ol=d.div`
406
+ `,il=({id:t,seen:i,type:a,title:n,message:o,time:l,crdType:r,target:s,onClick:c})=>{const d=I.useTheme(),{formatTimeAgo:u}=Ht(),{onClickNotification:p}=Bt(),m=!!r&&!!s,h=n?.toLowerCase().includes(Q.Delete.toLowerCase())||!1,g=ge(a,d);return e.createElement(Xo,{key:`notification-${t}`,className:m?"click-enabled":"",onClick:()=>{m&&(c(),p({id:t,crdType:r,target:s}))}},e.createElement(Zo,{$type:h?W.Error:a},h?e.createElement(wi,null):e.createElement(g,null)),e.createElement(Qo,null,e.createElement(el,null,e.createElement(E,{size:14},o)),e.createElement(tl,null,e.createElement(E,{size:10,color:d.text.grey},u(l)),!i&&e.createElement(e.Fragment,null,e.createElement(E,{size:10},"·"),e.createElement(E,{size:10,color:d.colors.orange_soft},"new")))))},al=(e,t,i)=>{const a=e?.serviceName||t?.otelServiceName||t?.name,n=i?[Pi]:He(t?.containers||[]),{priorotizedStatus:o}=ce(t?.conditions||[]);return{id:a,title:a,icons:n.length?n:[ji],status:o,serviceMapEntry:e}},nl=e=>"user"===e?.otelServiceName&&!e?.namespace&&!e?.name&&!e?.kind,ol=d.div`
407
407
  width: 100%;
408
408
  height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px)`};
409
409
  position: relative;
410
- `,ll={namespace:"",name:"",kind:"",otelServiceName:"user",selected:!0,numberOfInstances:0,dataStreamNames:[],containers:[],conditions:[]},rl=({heightToRemove:t,serviceMap:a})=>{const n=I.useTheme(),{sources:o,sourcesLoading:l}=_(),{containerRef:r,containerHeight:s,containerWidth:c}=Ue(),[d,u,p]=Gi([]),[h,g,y]=Yi([]);return i(()=>{if(s&&c){const t=(({sources:e,serviceMap:t,containerHeight:i,containerWidth:a})=>{const n=[],o=new Map,l=((e,t)=>{const i=new Map,a=new Map,n=new Map,o=new Set;e.forEach(e=>{o.add(e.serviceName),e.services.forEach(e=>{o.add(e.serviceName)})}),o.forEach(e=>{a.set(e,[]),n.set(e,0)}),e.forEach(e=>{e.services.forEach(t=>{a.get(e.serviceName)?.push(t.serviceName);const i=n.get(t.serviceName)||0;n.set(t.serviceName,i+1)})});const l=[],r=[];for(o.forEach(e=>{0===(n.get(e)||0)&&r.push(e)});r.length>0;){const e=[],t=r.length;for(let i=0;i<t;i++){const t=r.shift();e.push(t),a.get(t)?.forEach(e=>{const t=n.get(e)||0;n.set(e,t-1),t-1==0&&r.push(e)})}e.length>0&&l.push(e)}return o.forEach(e=>{l.flat().includes(e)||(0===l.length?l.push([e]):l[l.length-1].push(e))}),l.forEach((e,a)=>{const n=100+150*a,o=150*(e.length-1),l=(t-o)/2;e.forEach((e,t)=>{const a=l+150*t,o=n;i.set(e,{x:a,y:o})})}),i})(t,a);if(t.length&&e.length){t.forEach(t=>{const i=t.serviceName;if(n.find(e=>e.id===`${B.Source}-${i}-${Wt.MapItem}`))return;const a=e.find(e=>i===e.otelServiceName||i===e.name);o.set(i,t),t.services.forEach(e=>o.set(e.serviceName,{serviceName:e.serviceName,services:[]})),n.push({id:`${B.Source}-${i}-${Wt.MapItem}`,type:Wt.MapItem,position:l.get(i),data:al(t,a,nl(a))})}),o.forEach((t,i)=>{if(n.find(e=>e.id===`${B.Source}-${i}-${Wt.MapItem}`))return;const a=e.find(e=>i===e.otelServiceName||i===e.name);n.push({id:`${B.Source}-${i}-${Wt.MapItem}`,type:Wt.MapItem,position:l.get(i),data:al(t,a,nl(a))})});let i=50;e.forEach(e=>{const t=e.otelServiceName||e.name;n.find(e=>e.id===`${B.Source}-${t}-${Wt.MapItem}`)||(n.push({id:`${B.Source}-${t}-${Wt.MapItem}`,type:Wt.MapItem,position:{x:i,y:10},data:al(void 0,e,nl(e))}),i+=110)})}else n.push({id:`${B.Source}-${Wt.NoData}`,type:Wt.NoData,position:{x:a/2-150,y:i/4},data:{subTitle:m.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return n})({serviceMap:a,sources:[ll].concat(o),sourcesLoading:l,containerHeight:s,containerWidth:c});d.length>1?(e=t,u(t=>{const i=e.map(e=>{const i=t.find(t=>t.id===e.id);return e.position=i?.position||e.position,{id:e.id,item:e,type:i?"replace":"add"}});return t.find(e=>e.id===`${B.Source}-${Wt.NoData}`)&&i.push({id:`${B.Source}-${Wt.NoData}`,type:"remove"}),Xi(i,t)})):u(t)}var e},[a,o,l,s,c]),i(()=>{g((({theme:e,nodes:t,serviceMap:i})=>{const a=[];return t.forEach(({id:t,data:{id:n,status:o}})=>{const{services:l}=i.find(e=>e.serviceName===n)||{services:[]};l.forEach(i=>{const n=t,l=`${B.Source}-${i.serviceName}-${Wt.MapItem}`,r=o===W.Error;a.push({id:`${n}-to-${l}`,source:n,target:l,markerEnd:{type:Ui.ArrowClosed},style:{stroke:r?e?.colors.dark_red:e?.colors.border}})})}),a})({theme:n,nodes:d,serviceMap:a}))},[n,d,a]),e.createElement(ol,{ref:r,$heightToRemove:t},e.createElement(_t,{nodes:d,edges:h,onNodesChange:p,onEdgesChange:y,zoomOnScroll:!0}))},sl=d.div`
410
+ `,ll={namespace:"",name:"",kind:"",otelServiceName:"user",selected:!0,numberOfInstances:0,dataStreamNames:[],containers:[],conditions:[]},rl=({heightToRemove:t,serviceMap:a})=>{const n=I.useTheme(),{sources:o,sourcesLoading:l}=_(),{containerRef:r,containerHeight:s,containerWidth:c}=Ue(),[d,u,p]=Yi([]),[h,g,y]=Xi([]);return i(()=>{if(s&&c){const t=(({sources:e,serviceMap:t,containerHeight:i,containerWidth:a})=>{const n=[],o=new Map,l=((e,t)=>{const i=new Map,a=new Map,n=new Map,o=new Set;e.forEach(e=>{o.add(e.serviceName),e.services.forEach(e=>{o.add(e.serviceName)})}),o.forEach(e=>{a.set(e,[]),n.set(e,0)}),e.forEach(e=>{e.services.forEach(t=>{a.get(e.serviceName)?.push(t.serviceName);const i=n.get(t.serviceName)||0;n.set(t.serviceName,i+1)})});const l=[],r=[];for(o.forEach(e=>{0===(n.get(e)||0)&&r.push(e)});r.length>0;){const e=[],t=r.length;for(let i=0;i<t;i++){const t=r.shift();e.push(t),a.get(t)?.forEach(e=>{const t=n.get(e)||0;n.set(e,t-1),t-1==0&&r.push(e)})}e.length>0&&l.push(e)}return o.forEach(e=>{l.flat().includes(e)||(0===l.length?l.push([e]):l[l.length-1].push(e))}),l.forEach((e,a)=>{const n=100+150*a,o=150*(e.length-1),l=(t-o)/2;e.forEach((e,t)=>{const a=l+150*t,o=n;i.set(e,{x:a,y:o})})}),i})(t,a);if(t.length&&e.length){t.forEach(t=>{const i=t.serviceName;if(n.find(e=>e.id===`${B.Source}-${i}-${Wt.MapItem}`))return;const a=e.find(e=>i===e.otelServiceName||i===e.name);o.set(i,t),t.services.forEach(e=>o.set(e.serviceName,{serviceName:e.serviceName,services:[]})),n.push({id:`${B.Source}-${i}-${Wt.MapItem}`,type:Wt.MapItem,position:l.get(i),data:al(t,a,nl(a))})}),o.forEach((t,i)=>{if(n.find(e=>e.id===`${B.Source}-${i}-${Wt.MapItem}`))return;const a=e.find(e=>i===e.otelServiceName||i===e.name);n.push({id:`${B.Source}-${i}-${Wt.MapItem}`,type:Wt.MapItem,position:l.get(i),data:al(t,a,nl(a))})});let i=50;e.forEach(e=>{const t=e.otelServiceName||e.name;n.find(e=>e.id===`${B.Source}-${t}-${Wt.MapItem}`)||(n.push({id:`${B.Source}-${t}-${Wt.MapItem}`,type:Wt.MapItem,position:{x:i,y:10},data:al(void 0,e,nl(e))}),i+=110)})}else n.push({id:`${B.Source}-${Wt.NoData}`,type:Wt.NoData,position:{x:a/2-150,y:i/4},data:{subTitle:m.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return n})({serviceMap:a,sources:[ll].concat(o),sourcesLoading:l,containerHeight:s,containerWidth:c});d.length>1?(e=t,u(t=>{const i=e.map(e=>{const i=t.find(t=>t.id===e.id);return e.position=i?.position||e.position,{id:e.id,item:e,type:i?"replace":"add"}});return t.find(e=>e.id===`${B.Source}-${Wt.NoData}`)&&i.push({id:`${B.Source}-${Wt.NoData}`,type:"remove"}),Zi(i,t)})):u(t)}var e},[a,o,l,s,c]),i(()=>{g((({theme:e,nodes:t,serviceMap:i})=>{const a=[];return t.forEach(({id:t,data:{id:n,status:o}})=>{const{services:l}=i.find(e=>e.serviceName===n)||{services:[]};l.forEach(i=>{const n=t,l=`${B.Source}-${i.serviceName}-${Wt.MapItem}`,r=o===W.Error;a.push({id:`${n}-to-${l}`,source:n,target:l,markerEnd:{type:Gi.ArrowClosed},style:{stroke:r?e?.colors.dark_red:e?.colors.border}})})}),a})({theme:n,nodes:d,serviceMap:a}))},[n,d,a]),e.createElement(ol,{ref:r,$heightToRemove:t},e.createElement(_t,{nodes:d,edges:h,onNodesChange:p,onEdgesChange:y,zoomOnScroll:!0}))},sl=d.div`
411
411
  display: flex;
412
412
  flex-direction: column;
413
413
  align-items: center;
@@ -462,16 +462,16 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
462
462
  max-height: calc(100vh - 200px);
463
463
  height: fit-content;
464
464
  overflow-y: scroll;
465
- `,xl=({onEditStream:t,onEditSources:i,onEditDestinations:a,categories:n})=>{const{selectedStreamName:o}=Je(),{configuredSources:r,configuredDestinations:s,configuredDestinationsUpdateOnly:c}=pt(),d=l(()=>Object.values(r).reduce((e,t)=>e+t.filter(e=>e.selected).length,0),[r]);return e.createElement(ne,{$isNotModal:!0},e.createElement(ee,{$gap:12},e.createElement(A,{title:m.SUMMARY,description:m.STREAM_CONFIRM}),e.createElement(fl,null,e.createElement(Z,{title:m.STREAM_NAME,action:()=>e.createElement(Jt,{onClick:t}),data:[{title:"",value:o}]}),e.createElement(Z,{title:m.SELECTED_SOURCES,titleBadge:d,action:()=>e.createElement(Jt,{onClick:i})},e.createElement(vl,{filteredNamespacesAndSources:r,withInstances:!1})),e.createElement(Z,{title:m.SELECTED_DESTINATIONS,titleBadge:s.length+c.length,action:()=>e.createElement(Jt,{onClick:a})},e.createElement(go,{categories:n})))))};var $l;!function(e){e.Overview="overview",e.InstrumentationRules="InstrumentationRule",e.Sources="Source",e.Actions="Action",e.Destinations="Destination"}($l||($l={}));const Sl=({onClickId:i,defaultSelectedId:a,extendedNavIcons:n})=>{const{isVm:o}=_e(),[r,s]=t(a||""),c=l(()=>[{id:$l.Overview,icon:Ki,selected:r===$l.Overview,onClick:()=>{s($l.Overview),i($l.Overview)},tooltip:"Overview"},...(n||[]).map(e=>({...e,selected:r===e.id,onClick:()=>{s(e.id),e.onClick()}}))],[r]),d=l(()=>{const e=[{id:$l.Sources,icon:qi,selected:r===$l.Sources,onClick:()=>{s($l.Sources),i($l.Sources)},tooltip:"Sources"},{id:$l.Destinations,icon:Hi,selected:r===$l.Destinations,onClick:()=>{s($l.Destinations),i($l.Destinations)},tooltip:"Destinations"}];return o||(e.push({id:$l.InstrumentationRules,icon:ji,selected:r===$l.InstrumentationRules,onClick:()=>{s($l.InstrumentationRules),i($l.InstrumentationRules)},tooltip:"Instrumentation Rules"}),e.push({id:$l.Actions,icon:Vi,selected:r===$l.Actions,onClick:()=>{s($l.Actions),i($l.Actions)},tooltip:"Actions"})),e},[o,r]);return e.createElement(Ut,{orientation:"vertical",mainIcons:c,subIcons:d})},kl=({})=>e.createElement(ht,{onClick:()=>window.open("https://join.slack.com/t/odigos/shared_invite/zt-2wc6gm4j9-EhcVFYrLwHqvcIErO9sVzw","_blank","noopener noreferrer"),tooltip:"Join our Slack community"},e.createElement(zi,null)),Cl=(e,t)=>{const{name:i,kind:a,namespace:n}=e,o=[{title:m.KIND,value:a},{title:m.NAME,value:i,tooltip:"Resource name"}];return t||(o.unshift({title:m.NAMESPACE,value:n}),o.push({type:h.Divider}),o.push({type:h.CopyText,value:`kubectl get ${a} ${i} -n ${n}`.toLowerCase()})),o},wl=d.div`
465
+ `,xl=({onEditStream:t,onEditSources:i,onEditDestinations:a,categories:n})=>{const{selectedStreamName:o}=Je(),{configuredSources:r,configuredDestinations:s,configuredDestinationsUpdateOnly:c}=pt(),d=l(()=>Object.values(r).reduce((e,t)=>e+t.filter(e=>e.selected).length,0),[r]);return e.createElement(ne,{$isNotModal:!0},e.createElement(ee,{$gap:12},e.createElement(A,{title:m.SUMMARY,description:m.STREAM_CONFIRM}),e.createElement(fl,null,e.createElement(Z,{title:m.STREAM_NAME,action:()=>e.createElement(Jt,{onClick:t}),data:[{title:"",value:o}]}),e.createElement(Z,{title:m.SELECTED_SOURCES,titleBadge:d,action:()=>e.createElement(Jt,{onClick:i})},e.createElement(vl,{filteredNamespacesAndSources:r,withInstances:!1})),e.createElement(Z,{title:m.SELECTED_DESTINATIONS,titleBadge:s.length+c.length,action:()=>e.createElement(Jt,{onClick:a})},e.createElement(go,{categories:n})))))};var $l;!function(e){e.Overview="overview",e.InstrumentationRules="InstrumentationRule",e.Sources="Source",e.Actions="Action",e.Destinations="Destination"}($l||($l={}));const Sl=({onClickId:i,defaultSelectedId:a,extendedNavIcons:n})=>{const{isVm:o}=_e(),[r,s]=t(a||""),c=l(()=>[{id:$l.Overview,icon:Ki,selected:r===$l.Overview,onClick:()=>{s($l.Overview),i($l.Overview)},tooltip:"Overview"},...(n||[]).map(e=>({...e,selected:r===e.id,onClick:()=>{s(e.id),e.onClick()}}))],[r]),d=l(()=>{const e=[{id:$l.Sources,icon:zi,selected:r===$l.Sources,onClick:()=>{s($l.Sources),i($l.Sources)},tooltip:"Sources"},{id:$l.Destinations,icon:Hi,selected:r===$l.Destinations,onClick:()=>{s($l.Destinations),i($l.Destinations)},tooltip:"Destinations"}];return o||(e.push({id:$l.InstrumentationRules,icon:Vi,selected:r===$l.InstrumentationRules,onClick:()=>{s($l.InstrumentationRules),i($l.InstrumentationRules)},tooltip:"Instrumentation Rules"}),e.push({id:$l.Actions,icon:qi,selected:r===$l.Actions,onClick:()=>{s($l.Actions),i($l.Actions)},tooltip:"Actions"})),e},[o,r]);return e.createElement(Ut,{orientation:"vertical",mainIcons:c,subIcons:d})},kl=({})=>e.createElement(ht,{onClick:()=>window.open("https://join.slack.com/t/odigos/shared_invite/zt-2wc6gm4j9-EhcVFYrLwHqvcIErO9sVzw","_blank","noopener noreferrer"),tooltip:"Join our Slack community"},e.createElement(Bi,null)),Cl=(e,t)=>{const{name:i,kind:a,namespace:n}=e,o=[{title:m.KIND,value:a},{title:m.NAME,value:i,tooltip:"Resource name"}];return t||(o.unshift({title:m.NAMESPACE,value:n}),o.push({type:h.Divider}),o.push({type:h.CopyText,value:`kubectl get ${a} ${i} -n ${n}`.toLowerCase()})),o},wl=d.div`
466
466
  display: flex;
467
467
  flex-direction: column;
468
468
  gap: 24px;
469
469
  padding: 4px;
470
- `,Tl=({formData:t,handleFormChange:i})=>e.createElement(wl,null,e.createElement($,{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}})=>i("otelServiceName",e)})),Dl=({workloadOdigosHealthStatus:t})=>{if(!t)return null;const i=Gt(t?.status),a=ot(t?.reasonEnum),n=t?.message;return e.createElement(ue,{$alignItems:"center",$justifyContent:"center"},e.createElement(de,{status:i,title:a,subtitle:n,withBackground:i!==he.Disabled,withBorder:!0,withIcon:!0,width:"calc(100% - 24px)"}))},Nl=({source:a,fetchSourceDescribe:n,restartPod:o})=>{const[l,r]=t(!1),[s,d]=t(null);return i(()=>{a&&n({namespace:a.namespace,name:a.name,kind:a.kind}).then(({data:e})=>{e?.describeSource?d(e.describeSource):r(!0)})},[a.namespace,a.name,a.kind]),s||l?e.createElement(ee,{$gap:12},l?e.createElement(De,{$height:"70vh"},e.createElement(Ne,{subTitle:"Could not fetch describe for this source"})):s?.pods?.length?s.pods.map(({podName:t,nodeName:i,phase:n,agentInjected:l,runningLatestWorkloadRevision:r,containers:d,manifestYAML:u})=>{const p=n.status!==W.Success||Yt(d)?W.Error:W.Success,m=[];return m.push(e.createElement(Xt,{key:"copy-text",value:`kubectl get pod ${t.value} -n ${s?.namespace?.value||a.namespace}`.toLowerCase()})),m.push(e.createElement(se,{key:"divider-1",length:"100%",margin:"0"})),m.push(e.createElement(Zt,{key:"describe-row-1",title:i.name,tooltip:i.explain||"",value:{status:i.status||void 0,text:i.value}})),m.push(e.createElement(se,{key:"divider-2",length:"100%",margin:"0"})),m.push(e.createElement(Zt,{key:"describe-row-2",title:n.name,tooltip:n.explain||"",value:{status:n.status||void 0,text:n.value}})),m.push(e.createElement(se,{key:"divider-3",length:"100%",margin:"0"})),m.push(e.createElement(Zt,{key:"describe-row-3",title:l.name,tooltip:l.explain||"",value:{status:l.status||void 0,text:l.value}})),m.push(e.createElement(se,{key:"divider-4",length:"100%",margin:"0"})),r?.name&&(m.push(e.createElement(Zt,{key:"describe-row-4",title:r.name,tooltip:r.explain||void 0,value:{status:r.status||void 0,text:r.value}})),m.push(e.createElement(se,{key:"divider-5",length:"100%",margin:"0"}))),d.forEach(t=>{m.push(e.createElement(Qt,{key:`pod-container-${t.containerName.value}`,...t}))}),u&&(m.push(e.createElement(se,{key:"divider-6",length:"100%",margin:"0"})),m.push(e.createElement(Zi,{key:"yaml-section-card",yaml:u}))),e.createElement(Z,{key:`pod-${t.value}`,title:`Pod: ${t.value}`,withExtend:!0,action:({hovered:i})=>e.createElement("div",{style:{position:"relative"}},e.createElement(de,{key:"status",status:p,title:p,withIcon:!0,withBorder:!0}),i&&e.createElement(ei,{key:"hover-actions",isOpen:!0,positionRight:"calc(100% + 12px)",actions:[{id:ti(),label:"Restart",rightIcon:Di,onClick:()=>o(s?.namespace?.value||a.namespace,t.value)}]}))},c.toArray(m))}):e.createElement(De,{$height:"70vh"},e.createElement(Ne,{subTitle:"Check if you have any running pods and try again"}))):e.createElement(De,{$height:"70vh"},e.createElement(Le,null))},El=d(ue)`
470
+ `,Tl=({formData:t,handleFormChange:i})=>e.createElement(wl,null,e.createElement($,{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}})=>i("otelServiceName",e)})),Dl=({workloadOdigosHealthStatus:t})=>{if(!t)return null;const i=Gt(t?.status),a=ot(t?.reasonEnum),n=t?.message;return e.createElement(ue,{$alignItems:"center",$justifyContent:"center"},e.createElement(de,{status:i,title:a,subtitle:n,withBackground:i!==he.Disabled,withBorder:!0,withIcon:!0,width:"calc(100% - 24px)"}))},Nl=({source:a,fetchSourceDescribe:n,restartPod:o})=>{const[l,r]=t(!1),[s,d]=t(null);return i(()=>{a&&n({namespace:a.namespace,name:a.name,kind:a.kind}).then(({data:e})=>{e?.describeSource?d(e.describeSource):r(!0)})},[a.namespace,a.name,a.kind]),s||l?e.createElement(ee,{$gap:12},l?e.createElement(De,{$height:"70vh"},e.createElement(Ne,{subTitle:"Could not fetch describe for this source"})):s?.pods?.length?s.pods.map(({podName:t,nodeName:i,phase:n,agentInjected:l,runningLatestWorkloadRevision:r,containers:d,manifestYAML:u})=>{const p=n.status!==W.Success||Yt(d)?W.Error:W.Success,m=[];return m.push(e.createElement(Xt,{key:"copy-text",value:`kubectl get pod ${t.value} -n ${s?.namespace?.value||a.namespace}`.toLowerCase()})),m.push(e.createElement(se,{key:"divider-1",length:"100%",margin:"0"})),m.push(e.createElement(Zt,{key:"describe-row-1",title:i.name,tooltip:i.explain||"",value:{status:i.status||void 0,text:i.value}})),m.push(e.createElement(se,{key:"divider-2",length:"100%",margin:"0"})),m.push(e.createElement(Zt,{key:"describe-row-2",title:n.name,tooltip:n.explain||"",value:{status:n.status||void 0,text:n.value}})),m.push(e.createElement(se,{key:"divider-3",length:"100%",margin:"0"})),m.push(e.createElement(Zt,{key:"describe-row-3",title:l.name,tooltip:l.explain||"",value:{status:l.status||void 0,text:l.value}})),m.push(e.createElement(se,{key:"divider-4",length:"100%",margin:"0"})),r?.name&&(m.push(e.createElement(Zt,{key:"describe-row-4",title:r.name,tooltip:r.explain||void 0,value:{status:r.status||void 0,text:r.value}})),m.push(e.createElement(se,{key:"divider-5",length:"100%",margin:"0"}))),d.forEach(t=>{m.push(e.createElement(Qt,{key:`pod-container-${t.containerName.value}`,...t}))}),u&&(m.push(e.createElement(se,{key:"divider-6",length:"100%",margin:"0"})),m.push(e.createElement(ei,{key:"yaml-section-card",yaml:u}))),e.createElement(Z,{key:`pod-${t.value}`,title:`Pod: ${t.value}`,withExtend:!0,action:({hovered:i})=>e.createElement("div",{style:{position:"relative"}},e.createElement(de,{key:"status",status:p,title:p,withIcon:!0,withBorder:!0}),i&&e.createElement(ti,{key:"hover-actions",isOpen:!0,positionRight:"calc(100% + 12px)",actions:[{id:ii(),label:"Restart",rightIcon:Ni,onClick:()=>o(s?.namespace?.value||a.namespace,t.value)}]}))},c.toArray(m))}):e.createElement(De,{$height:"70vh"},e.createElement(Ne,{subTitle:"Check if you have any running pods and try again"}))):e.createElement(De,{$height:"70vh"},e.createElement(Le,null))},El=d(ue)`
471
471
  width: 100%;
472
472
  align-items: center;
473
473
  justify-content: space-between;
474
- `,Il=({source:a,fetchSourceLibraries:n})=>{const o=I.useTheme(),[l,s]=t(!1),[c,d]=t(null);return i(()=>{a&&n({namespace:a.namespace,name:a.name,kind:a.kind}).then(({data:e})=>{e?.instrumentationInstanceComponents?d(Dt(e.instrumentationInstanceComponents).sort((e,t)=>e.name.localeCompare(t.name))):s(!0)})},[a.namespace,a.name,a.kind]),c||l?e.createElement(ee,{$gap:12},l?e.createElement(De,{$height:"70vh"},e.createElement(Ne,{subTitle:"Could not fetch libraries for this source"})):c?.length?e.createElement(Z,{title:"Instrumented Libraries"},c.map(({name:t,healthy:i,nonIdentifyingAttributes:a},n)=>e.createElement(r,{key:`library-${t}`},e.createElement(El,null,e.createElement(E,{size:12,color:o.text.grey},t),e.createElement(ue,{$gap:4},a.map(({key:i,value:a})=>ii(a)&&ai(a)&&"is_standard_lib"===i?e.createElement(de,{key:`${t}-${i}`,status:W.Default,title:"STANDARD",withBorder:!0}):null),"boolean"==typeof i&&e.createElement(de,{status:i?W.Success:W.Error,title:i?"HEALTHY":"UNHEALTHY",withBorder:!0}))),n!==c.length-1&&e.createElement(se,{length:"100%",margin:"0"})))):e.createElement(De,{$height:"70vh",$gap:12},e.createElement(Ne,{title:"No libraries found",subTitle:""}),e.createElement(oe,{type:W.Warning,message:"This feature is in early development, and has very limited support"}))):e.createElement(De,{$height:"70vh"},e.createElement(Le,null))};var Ol;!function(e){e.Overview="Overview",e.Pods="Pods",e.Libraries="Libraries"}(Ol||(Ol={}));const Al=[li.Deployment,li.StatefulSet,li.DaemonSet,li.DeploymentConfig],Fl=[ri.Python,ri.Go,ri.Java],Ml=d.div`
474
+ `,Il=({source:a,fetchSourceLibraries:n})=>{const o=I.useTheme(),[l,s]=t(!1),[c,d]=t(null);return i(()=>{a&&n({namespace:a.namespace,name:a.name,kind:a.kind}).then(({data:e})=>{e?.instrumentationInstanceComponents?d(Dt(e.instrumentationInstanceComponents).sort((e,t)=>e.name.localeCompare(t.name))):s(!0)})},[a.namespace,a.name,a.kind]),c||l?e.createElement(ee,{$gap:12},l?e.createElement(De,{$height:"70vh"},e.createElement(Ne,{subTitle:"Could not fetch libraries for this source"})):c?.length?e.createElement(Z,{title:"Instrumented Libraries"},c.map(({name:t,healthy:i,nonIdentifyingAttributes:a},n)=>e.createElement(r,{key:`library-${t}`},e.createElement(El,null,e.createElement(E,{size:12,color:o.text.grey},t),e.createElement(ue,{$gap:4},a.map(({key:i,value:a})=>ai(a)&&ni(a)&&"is_standard_lib"===i?e.createElement(de,{key:`${t}-${i}`,status:W.Default,title:"STANDARD",withBorder:!0}):null),"boolean"==typeof i&&e.createElement(de,{status:i?W.Success:W.Error,title:i?"HEALTHY":"UNHEALTHY",withBorder:!0}))),n!==c.length-1&&e.createElement(se,{length:"100%",margin:"0"})))):e.createElement(De,{$height:"70vh",$gap:12},e.createElement(Ne,{title:"No libraries found",subTitle:""}),e.createElement(oe,{type:W.Warning,message:"This feature is in early development, and has very limited support"}))):e.createElement(De,{$height:"70vh"},e.createElement(Le,null))};var Ol;!function(e){e.Overview="Overview",e.Pods="Pods",e.Libraries="Libraries"}(Ol||(Ol={}));const Al=[ri.Deployment,ri.StatefulSet,ri.DaemonSet,ri.DeploymentConfig],Fl=[si.Python,si.Go,si.Java],Ml=d.div`
475
475
  width: 100%;
476
476
  height: 100%;
477
477
  max-height: calc(100vh - 220px);
@@ -481,16 +481,16 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
481
481
  display: flex;
482
482
  flex-direction: column;
483
483
  gap: 12px;
484
- `,Ll=({persistSources:a,updateSource:o,restartWorkloads:r,fetchSourceById:s,fetchSourceDescribe:c,fetchSourceLibraries:d,restartPod:u})=>{const{isVm:p}=_e(),{sources:h}=_(),{selectedStreamName:g}=Je(),{drawerType:y,drawerEntityId:v}=K(),b=l(()=>Ye(h,g),[h,g]),f=n(null),x=y===B.Source,[$,S]=t(!1),[k,C]=t(!1),[w,T]=t(Ol.Overview),[D,N]=t(null);i(()=>{x&&v&&s(v).then(e=>N(e||null))},[x,v]);const{formData:I,handleFormChange:O,resetFormData:A,loadFormWithDrawerItem:F}=ni(),M=l(()=>{if(v)return D&&JSON.stringify(Ht(D))===JSON.stringify(Ht(v))?D:b?.find(e=>JSON.stringify(Ht(e))===JSON.stringify(Ht(v)))},[v,b,D]);i(()=>{x&&M?F(M):A()},[x,M]);const R=l(()=>{const e=M?.conditions?.find(({type:e})=>"RuntimeDetection"===e);return{description:e?.message,isLoading:e?.status===he.Loading,containers:M?.containers||[]}},[M]),L=l(()=>{const e=[{label:Ol.Overview,onClick:()=>T(Ol.Overview),selected:w===Ol.Overview}];return Al.includes(M?.kind)&&e.push({label:Ol.Pods,onClick:()=>T(Ol.Pods),selected:w===Ol.Pods}),M?.containers?.some(({language:e})=>Fl.includes(e))&&e.push({label:Ol.Libraries,onClick:()=>T(Ol.Libraries),selected:w===Ol.Libraries}),e},[w,M]);return M?e.createElement($a,{ref:f,onClose:()=>{T(Ol.Overview),N(null)},title:M.otelServiceName||M.name,titleTooltip:"This attribute is used to identify the name of the service (service.name) that is generating telemetry data.",hideEditTitleFromEdit:!0,icons:ze(M.containers),isEdit:$,isFormDirty:k,onEdit:w===Ol.Overview?e=>{S("boolean"!=typeof e||e)}:void 0,onSave:async()=>{const e=I.otelServiceName!==M.name?I.otelServiceName:"";O("otelServiceName",e),await o(v,{...I,otelServiceName:e}),N(null),C(!1),S(!1)},onDelete:w===Ol.Overview?async()=>{const{namespace:e}=M;a({[e]:[{...M,selected:!1,currentStreamName:g}]},{}),N(null),C(!1),S(!1),f.current?.closeDrawer()}:void 0,onCancel:()=>{C(!1),S(!1),O("otelServiceName",M.otelServiceName||M.name||"")},isLastItem:1===b.length,tabs:L,headerActionButtons:[{"data-id":"rollout-restart",variant:"tertiary",onClick:()=>r([v]),children:e.createElement(e.Fragment,null,e.createElement(Mi,null),e.createElement(E,{size:14,family:"secondary",decoration:"underline"},"Restart"))}]},w===Ol.Overview?$?e.createElement(Ml,null,e.createElement(Tl,{formData:I,handleFormChange:(...e)=>{C(!0),O(...e),O("currentStreamName",g)}})):e.createElement(Rl,null,e.createElement(Dl,{workloadOdigosHealthStatus:M.workloadOdigosHealthStatus}),e.createElement(X,{conditions:M.conditions||[]}),e.createElement(Z,{title:m.SOURCE_DETAILS,data:M?Cl(M,p):[]}),e.createElement(Z,{title:p?m.DETECTED_PROCESSES:m.DETECTED_CONTAINERS,titleBadge:R.isLoading?he.Loading:R.containers.length,description:R.description||(p?m.DETECTED_PROCESSES_DESCRIPTION:m.DETECTED_CONTAINERS_DESCRIPTION)},R.containers.map(t=>e.createElement(oi,{key:`source-container-${t.containerName}`,...t,callbackRuntimeOverride:async e=>await o(v,e)}))),e.createElement(Zi,{yaml:M.manifestYAML})):w===Ol.Pods?e.createElement(Nl,{source:M,fetchSourceDescribe:c,restartPod:u}):e.createElement(Il,{source:M,fetchSourceLibraries:d})):null},Pl=d.div`
484
+ `,Ll=({persistSources:a,updateSource:o,restartWorkloads:r,fetchSourceById:s,fetchSourceDescribe:c,fetchSourceLibraries:d,restartPod:u})=>{const{isVm:p}=_e(),{sources:h}=_(),{selectedStreamName:g}=Je(),{drawerType:y,drawerEntityId:v}=j(),b=l(()=>Ye(h,g),[h,g]),f=n(null),x=y===B.Source,[$,S]=t(!1),[k,C]=t(!1),[w,T]=t(Ol.Overview),[D,N]=t(null);i(()=>{x&&v&&s(v).then(e=>N(e||null))},[x,v]);const{formData:I,handleFormChange:O,resetFormData:A,loadFormWithDrawerItem:F}=oi(),M=l(()=>{if(v)return D&&JSON.stringify(zt(D))===JSON.stringify(zt(v))?D:b?.find(e=>JSON.stringify(zt(e))===JSON.stringify(zt(v)))},[v,b,D]);i(()=>{x&&M?F(M):A()},[x,M]);const R=l(()=>{const e=M?.conditions?.find(({type:e})=>"RuntimeDetection"===e);return{description:e?.message,isLoading:e?.status===he.Loading,containers:M?.containers||[]}},[M]),L=l(()=>{const e=[{label:Ol.Overview,onClick:()=>T(Ol.Overview),selected:w===Ol.Overview}];return Al.includes(M?.kind)&&e.push({label:Ol.Pods,onClick:()=>T(Ol.Pods),selected:w===Ol.Pods}),M?.containers?.some(({language:e})=>Fl.includes(e))&&e.push({label:Ol.Libraries,onClick:()=>T(Ol.Libraries),selected:w===Ol.Libraries}),e},[w,M]);return M?e.createElement($a,{ref:f,onClose:()=>{T(Ol.Overview),N(null)},title:M.otelServiceName||M.name,titleTooltip:"This attribute is used to identify the name of the service (service.name) that is generating telemetry data.",hideEditTitleFromEdit:!0,icons:He(M.containers),isEdit:$,isFormDirty:k,onEdit:w===Ol.Overview?e=>{S("boolean"!=typeof e||e)}:void 0,onSave:async()=>{const e=I.otelServiceName!==M.name?I.otelServiceName:"";O("otelServiceName",e),await o(v,{...I,otelServiceName:e}),N(null),C(!1),S(!1)},onDelete:w===Ol.Overview?async()=>{const{namespace:e}=M;a({[e]:[{...M,selected:!1,currentStreamName:g}]},{}),N(null),C(!1),S(!1),f.current?.closeDrawer()}:void 0,onCancel:()=>{C(!1),S(!1),O("otelServiceName",M.otelServiceName||M.name||"")},isLastItem:1===b.length,tabs:L,headerActionButtons:[{"data-id":"rollout-restart",variant:"tertiary",onClick:()=>r([v]),children:e.createElement(e.Fragment,null,e.createElement(Ri,null),e.createElement(E,{size:14,family:"secondary",decoration:"underline"},"Restart"))}]},w===Ol.Overview?$?e.createElement(Ml,null,e.createElement(Tl,{formData:I,handleFormChange:(...e)=>{C(!0),O(...e),O("currentStreamName",g)}})):e.createElement(Rl,null,e.createElement(Dl,{workloadOdigosHealthStatus:M.workloadOdigosHealthStatus}),e.createElement(X,{conditions:M.conditions||[]}),e.createElement(Z,{title:m.SOURCE_DETAILS,data:M?Cl(M,p):[]}),e.createElement(Z,{title:p?m.DETECTED_PROCESSES:m.DETECTED_CONTAINERS,titleBadge:R.isLoading?he.Loading:R.containers.length,description:R.description||(p?m.DETECTED_PROCESSES_DESCRIPTION:m.DETECTED_CONTAINERS_DESCRIPTION)},R.containers.map(t=>e.createElement(li,{key:`source-container-${t.containerName}`,...t,callbackRuntimeOverride:async e=>await o(v,e)}))),e.createElement(ei,{yaml:M.manifestYAML})):w===Ol.Pods?e.createElement(Nl,{source:M,fetchSourceDescribe:c,restartPod:u}):e.createElement(Il,{source:M,fetchSourceLibraries:d})):null},Pl=d.div`
485
485
  max-width: ${({$fullWidth:e})=>e?"unset":"420px"};
486
486
  width: 100%;
487
- `,Kl=a(({isModal:t,fetchSingleNamespace:i,onClickSummary:a},n)=>{const l=I.useTheme(),{isVm:r}=_e(),s=si({fetchSingleNamespace:i}),{selectedSources:c,fetchingNamespace:d,selectedAllNamespaces:u,onSelectAllNamespaces:p,getApiSourcesPayload:h,getApiFutureAppsPayload:g,searchText:y,setSearchText:v,searchBy:b,setSearchBy:f,showSelectedOnly:x,setShowSelectedOnly:S,showRunningOnly:k,setShowRunningOnly:C}=s;o(n,()=>({getFormValues:()=>({apps:h(),futureApps:g()})}));const T=Object.values(c).reduce((e,t)=>e+t.filter(e=>e.selected).length,0);return e.createElement(ne,{$isNotModal:!t},e.createElement(ee,{$gap:12},e.createElement(ee,{$gap:24},a&&e.createElement(vt,{onClick:a}),e.createElement(A,{title:m.SELECT_SOURCES,badgeLabel:T,description:m.SELECT_SOURCES_DESCRIPTION}),e.createElement(ue,{$justifyContent:"space-between"},e.createElement(Pl,{$fullWidth:r},e.createElement($,{placeholder:b===B.Source?m.SEARCH_SOURCES:m.SEARCH_NAMESPACES,icon:Ni,value:y,onChange:e=>v(e.target.value.toLowerCase())})),!r&&e.createElement(O,{options:[{label:m.SOURCE,value:B.Source,selectedBgColor:l.text.secondary,selectedTextColor:l.text.primary},{label:m.NAMESPACE,value:B.Namespace,selectedBgColor:l.text.secondary,selectedTextColor:l.text.primary}],selected:b,setSelected:f})),e.createElement(ue,{$gap:36},e.createElement(w,{title:m.SELECT_ALL,initialValue:u,onChange:p,disabled:!!d}),e.createElement(w,{title:m.ONLY_SELECTED,initialValue:x,onChange:S}),e.createElement(w,{title:m.ONLY_RUNNING_INSTANCES,initialValue:k,onChange:C}))),e.createElement(se,null),e.createElement(vl,{isModal:t,...s})))});Kl.displayName=Kl.name;const jl=({fetchSingleNamespace:t,persistSources:i})=>{const{currentModal:a,setCurrentModal:o}=te(),l=a===B.Source,r=()=>{o("")},s=async()=>{if(c.current){const{apps:e,futureApps:t}=c.current.getFormValues();i(e,t),r()}},c=n(null);return j({key:"Enter",active:l},s),l?e.createElement(ie,{isOpen:l,onClose:r,header:{title:"Add Source"},actionComponent:e.createElement(ae,{buttons:[{label:"DONE",variant:"primary",onClick:s}]})},e.createElement(Kl,{ref:c,isModal:!0,fetchSingleNamespace:t})):null},Vl=e=>{const t=[{key:"checkbox-and-icon",title:""},{key:"name",title:m.NAME,sortable:!0},{key:"kind",title:"Kind",sortable:!0}];return e||t.push({key:"namespace",title:m.NAMESPACE,sortable:!0}),t.push({key:"containers",title:m.DETECTED_CONTAINERS}),t.push({key:"conditions",title:"Conditions"}),t.push({key:"throughput",title:"Throughput",sortable:!0}),t},ql=({metrics:t,maxHeight:i,maxWidth:a})=>{const n=I.useTheme(),{isVm:o}=_e(),r=ye(),{isThisPending:c}=L(),{selectedStreamName:d}=Je(),{sources:u,sourcesLoading:p}=_(),{setDrawerType:h,setDrawerEntityId:g}=K(),{selectedSources:y,setSelectedSources:v}=Me(),{isAwaitingInstrumentation:f,sourcesToCreate:x,sourcesCreated:$,sourcesToDelete:S,sourcesDeleted:k}=Re(),C=l(()=>{const e=(e,t)=>e>0&&Math.floor(100/e*t)||1;return x?e(x,$):S?e(S,k):1},[x,$,S,k]),w=l(()=>Ye(u,d),[u,d]),T=l(()=>Oa({instrumentationRules:[],sources:Ge(w,r),actions:[],destinations:[],searchText:r.searchText,selectedCategory:B.Source}).searchResults.find(({category:e})=>e===B.Source)?.entities||[],[w,r]),[D,N]=l(()=>{let e=0;return Object.values(y).forEach(t=>{e+=t.length}),[0!==e,e]},[y]),O=s(e=>{if(e){const e={};T.forEach(t=>{const i={namespace:t.namespace,name:t.name,kind:t.kind};c({entityType:B.Source,entityId:i})||(e[t.namespace]?e[t.namespace].push(t):e[t.namespace]=[t])}),v(e)}else v({})},[T]),A=s(e=>{const{namespace:t,name:i,kind:a}=e,n={...y};n[t]||(n[t]=[]);const o=n[t].findIndex(e=>e.name===i&&e.kind===a);-1===o?n[t].push(e):n[t].splice(o,1),v(n)},[y]),F=l(()=>T.map(i=>{const a=Ht(i),o=JSON.stringify(a),{hasErrors:l,hasWarnings:r,hasDisableds:s}=ce(i.conditions||[]),d=c({entityType:B.Source,entityId:a}),u=!!y[a.namespace]?.find(e=>e.namespace===a.namespace&&e.name===a.name&&e.kind===a.kind);return{status:l?W.Error:r?W.Warning:void 0,faded:s,onClick:()=>{h(B.Source),g(a)},cells:[{columnKey:"checkbox-and-icon",component:()=>e.createElement(ue,{$gap:16},e.createElement(b,{disabled:d,value:u,onChange:()=>A(i)}),e.createElement(ci,{icons:ze(i.containers),id:o}))},{columnKey:"name",value:fe(i,B.Source,{extended:!0})},{columnKey:"kind",value:i.kind,textColor:n.text.info},{columnKey:"namespace",value:i.namespace,textColor:n.text.info},{columnKey:"throughput",value:je(It(t,B.Source,a).throughput),textColor:n.text.info},{columnKey:"conditions",component:()=>e.createElement(Ea,{conditions:i.conditions||[],id:o})},{columnKey:"containers",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(de,{status:W.Info,title:di(i.containers),withBorder:!0}))}]}}),[T,y,t,A]),{badge:M,badgeTooltip:R}=l(()=>T.length!==w.length?{badge:`${T.length}/${w.length}`,badgeTooltip:m.FILTERED_COUNT_TOOLTIP}:{badge:w.length,badgeTooltip:void 0},[T,w]);return e.createElement($e,{$maxWidth:a},e.createElement(Se,null,e.createElement(b,{partiallyChecked:D&&T?.length!==N,value:D&&T?.length===N,onChange:O,disabled:!T?.length}),e.createElement(ke,{icon:Ce(B.Source),title:m.SOURCES,badge:M,badgeTooltip:R,loading:p||f})),e.createElement(we,{$maxHeight:i},e.createElement(Te,{columns:Vl(o),rows:F})),f&&!F.length?e.createElement(De,{style:{marginTop:"2rem",gap:"24px"}},e.createElement(Ee,{width:420}),e.createElement(ue,{$gap:16},e.createElement(E,{color:n.text.info},x?"Instrumenting":"Uninstrumenting"," workloads..."),e.createElement(Ie,{label:`${C}%`}))):F.length?null:e.createElement(De,{style:{marginTop:"2rem"}},e.createElement(Ne,null)))},Hl=({expiresAt:t})=>{const i=I.useTheme(),{formatTimeAgo:a}=zt(),n=a(t),o=new Date(t).toDateString().split(" ").slice(1).join(" "),l=ui(t,0)?i.text.error:ui(t,6048e5)?i.text.warning:i.text.success;return e.createElement(E,{size:14,color:l},n," (",o,")")},zl=d.div`
487
+ `,jl=a(({isModal:t,fetchSingleNamespace:i,onClickSummary:a},n)=>{const l=I.useTheme(),{isVm:r}=_e(),s=ci({fetchSingleNamespace:i}),{selectedSources:c,fetchingNamespace:d,selectedAllNamespaces:u,onSelectAllNamespaces:p,getApiSourcesPayload:h,getApiFutureAppsPayload:g,searchText:y,setSearchText:v,searchBy:b,setSearchBy:f,showSelectedOnly:x,setShowSelectedOnly:S,showRunningOnly:k,setShowRunningOnly:C}=s;o(n,()=>({getFormValues:()=>({apps:h(),futureApps:g()})}));const T=Object.values(c).reduce((e,t)=>e+t.filter(e=>e.selected).length,0);return e.createElement(ne,{$isNotModal:!t},e.createElement(ee,{$gap:12},e.createElement(ee,{$gap:24},a&&e.createElement(vt,{onClick:a}),e.createElement(A,{title:m.SELECT_SOURCES,badgeLabel:T,description:m.SELECT_SOURCES_DESCRIPTION}),e.createElement(ue,{$justifyContent:"space-between"},e.createElement(Pl,{$fullWidth:r},e.createElement($,{placeholder:b===B.Source?m.SEARCH_SOURCES:m.SEARCH_NAMESPACES,icon:Ei,value:y,onChange:e=>v(e.target.value.toLowerCase())})),!r&&e.createElement(O,{options:[{label:m.SOURCE,value:B.Source,selectedBgColor:l.text.secondary,selectedTextColor:l.text.primary},{label:m.NAMESPACE,value:B.Namespace,selectedBgColor:l.text.secondary,selectedTextColor:l.text.primary}],selected:b,setSelected:f})),e.createElement(ue,{$gap:36},e.createElement(w,{title:m.SELECT_ALL,initialValue:u,onChange:p,disabled:!!d}),e.createElement(w,{title:m.ONLY_SELECTED,initialValue:x,onChange:S}),e.createElement(w,{title:m.ONLY_RUNNING_INSTANCES,initialValue:k,onChange:C}))),e.createElement(se,null),e.createElement(vl,{isModal:t,...s})))});jl.displayName=jl.name;const Kl=({fetchSingleNamespace:t,persistSources:i})=>{const{currentModal:a,setCurrentModal:o}=te(),l=a===B.Source,r=()=>{o("")},s=async()=>{if(c.current){const{apps:e,futureApps:t}=c.current.getFormValues();i(e,t),r()}},c=n(null);return K({key:"Enter",active:l},s),l?e.createElement(ie,{isOpen:l,onClose:r,header:{title:"Add Source"},actionComponent:e.createElement(ae,{buttons:[{label:"DONE",variant:"primary",onClick:s}]})},e.createElement(jl,{ref:c,isModal:!0,fetchSingleNamespace:t})):null},Vl=e=>{const t=[{key:"checkbox-and-icon",title:""},{key:"name",title:m.NAME,sortable:!0},{key:"kind",title:"Kind",sortable:!0}];return e||t.push({key:"namespace",title:m.NAMESPACE,sortable:!0}),t.push({key:"containers",title:m.DETECTED_CONTAINERS}),t.push({key:"conditions",title:"Conditions"}),t.push({key:"throughput",title:"Throughput",sortable:!0}),t},ql=({metrics:t,maxHeight:i,maxWidth:a})=>{const n=I.useTheme(),{isVm:o}=_e(),r=ye(),{isThisPending:c}=L(),{selectedStreamName:d}=Je(),{sources:u,sourcesLoading:p}=_(),{setDrawerType:h,setDrawerEntityId:g}=j(),{selectedSources:y,setSelectedSources:v}=Me(),{isAwaitingInstrumentation:f,sourcesToCreate:x,sourcesCreated:$,sourcesToDelete:S,sourcesDeleted:k}=Re(),C=l(()=>{const e=(e,t)=>e>0&&Math.floor(100/e*t)||1;return x?e(x,$):S?e(S,k):1},[x,$,S,k]),w=l(()=>Ye(u,d),[u,d]),T=l(()=>Oa({instrumentationRules:[],sources:Ge(w,r),actions:[],destinations:[],searchText:r.searchText,selectedCategory:B.Source}).searchResults.find(({category:e})=>e===B.Source)?.entities||[],[w,r]),[D,N]=l(()=>{let e=0;return Object.values(y).forEach(t=>{e+=t.length}),[0!==e,e]},[y]),O=s(e=>{if(e){const e={};T.forEach(t=>{const i={namespace:t.namespace,name:t.name,kind:t.kind};c({entityType:B.Source,entityId:i})||(e[t.namespace]?e[t.namespace].push(t):e[t.namespace]=[t])}),v(e)}else v({})},[T]),A=s(e=>{const{namespace:t,name:i,kind:a}=e,n={...y};n[t]||(n[t]=[]);const o=n[t].findIndex(e=>e.name===i&&e.kind===a);-1===o?n[t].push(e):n[t].splice(o,1),v(n)},[y]),F=l(()=>T.map(i=>{const a=zt(i),o=JSON.stringify(a),{hasErrors:l,hasWarnings:r,hasDisableds:s}=ce(i.conditions||[]),d=c({entityType:B.Source,entityId:a}),u=!!y[a.namespace]?.find(e=>e.namespace===a.namespace&&e.name===a.name&&e.kind===a.kind);return{status:l?W.Error:r?W.Warning:void 0,faded:s,onClick:()=>{h(B.Source),g(a)},cells:[{columnKey:"checkbox-and-icon",component:()=>e.createElement(ue,{$gap:16},e.createElement(b,{disabled:d,value:u,onChange:()=>A(i)}),e.createElement(di,{icons:He(i.containers),id:o}))},{columnKey:"name",value:fe(i,B.Source,{extended:!0})},{columnKey:"kind",value:i.kind,textColor:n.text.info},{columnKey:"namespace",value:i.namespace,textColor:n.text.info},{columnKey:"throughput",value:Ke(It(t,B.Source,a).throughput),textColor:n.text.info},{columnKey:"conditions",component:()=>e.createElement(Ea,{conditions:i.conditions||[],id:o})},{columnKey:"containers",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(de,{status:W.Info,title:ui(i.containers),withBorder:!0}))}]}}),[T,y,t,A]),{badge:M,badgeTooltip:R}=l(()=>T.length!==w.length?{badge:`${T.length}/${w.length}`,badgeTooltip:m.FILTERED_COUNT_TOOLTIP}:{badge:w.length,badgeTooltip:void 0},[T,w]);return e.createElement($e,{$maxWidth:a},e.createElement(Se,null,e.createElement(b,{partiallyChecked:D&&T?.length!==N,value:D&&T?.length===N,onChange:O,disabled:!T?.length}),e.createElement(ke,{icon:Ce(B.Source),title:m.SOURCES,badge:M,badgeTooltip:R,loading:p||f})),e.createElement(we,{$maxHeight:i},e.createElement(Te,{columns:Vl(o),rows:F})),f&&!F.length?e.createElement(De,{style:{marginTop:"2rem",gap:"24px"}},e.createElement(Ee,{width:420}),e.createElement(ue,{$gap:16},e.createElement(E,{color:n.text.info},x?"Instrumenting":"Uninstrumenting"," workloads..."),e.createElement(Ie,{label:`${C}%`}))):F.length?null:e.createElement(De,{style:{marginTop:"2rem"}},e.createElement(Ne,null)))},zl=({expiresAt:t})=>{const i=I.useTheme(),{formatTimeAgo:a}=Ht(),n=a(t),o=new Date(t).toDateString().split(" ").slice(1).join(" "),l=pi(t,0)?i.text.error:pi(t,6048e5)?i.text.warning:i.text.success;return e.createElement(E,{size:14,color:l},n," (",o,")")},Hl=d.div`
488
488
  position: relative;
489
- `,Bl=({token:i,saveToken:a})=>{const{CopyButton:n}=pi(),{formData:o,handleFormChange:l,resetFormData:r}=mi({token:i}),[s,c]=t(!1),d=()=>{c(!1),r()};return e.createElement(ue,{$gap:0},e.createElement(n,{value:i,size:hi.L}),e.createElement(se,{orientation:"vertical",length:"12px"}),e.createElement(zl,null,e.createElement(ht,{size:32,onClick:()=>{c(!0)}},e.createElement(ki,null)),s&&e.createElement(gi,{flipX:!0,clientX:36,isOpen:s,onClose:d,onSave:()=>{a(o.token).then(d)},title:"Enter a new API Token",titleTooltip:"Contact us to generate a new one"},e.createElement($,{placeholder:"API Token",type:"password",value:o.token,onChange:e=>l("token",e.target.value)}))))},Wl=({tokens:t,saveToken:i})=>e.createElement(Z,{title:"Authorization Tokens",titleBadge:t.length,data:[{type:h.Table,value:{columns:[{key:"icon",title:""},{key:"name",title:"Name"},{key:"expires_at",title:"Expires"},{key:"token",title:"Token"},{key:"actions",title:""}],rows:t.map(({name:t,token:a,expiresAt:n})=>({cells:[{columnKey:"icon",icon:Bi},{columnKey:"name",value:t},{columnKey:"token",value:`${new Array(15).fill("•").join("")}`},{columnKey:"expires_at",component:()=>e.createElement(Hl,{expiresAt:n})},{columnKey:"actions",component:()=>e.createElement(Bl,{token:a,saveToken:i})}]}))}}]}),_l=({fetchDescribeOdigos:a})=>{const[n,o]=t(null);if(i(()=>{a().then(({data:e})=>o(e?.describeOdigos||null))},[]),!n)return e.createElement(De,null,e.createElement(Le,null));const l=t=>t?.name?[e.createElement(se,{key:`divider-${t.name}`}),e.createElement(Zt,{key:`describe-row-${t.name}`,title:t.name,subTitle:t.explain||void 0,value:{status:t.status||(ii(t.value)?ai(t.value)?W.Success:W.Error:W.Default),text:t.value}})]:[];return e.createElement(e.Fragment,null,e.createElement(Z,{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(Z,{title:"Cluster Collector",withExtend:!0},Object.values(n?.clusterCollector||{}).map(l)),e.createElement(Z,{title:"Node Collector",withExtend:!0},Object.values(n?.nodeCollector||{}).map(l)))},Jl=d.div`
489
+ `,Bl=({token:i,saveToken:a})=>{const{CopyButton:n}=mi(),{formData:o,handleFormChange:l,resetFormData:r}=hi({token:i}),[s,c]=t(!1),d=()=>{c(!1),r()};return e.createElement(ue,{$gap:0},e.createElement(n,{value:i,size:gi.L}),e.createElement(se,{orientation:"vertical",length:"12px"}),e.createElement(Hl,null,e.createElement(ht,{size:32,onClick:()=>{c(!0)}},e.createElement(Ci,null)),s&&e.createElement(yi,{flipX:!0,clientX:36,isOpen:s,onClose:d,onSave:()=>{a(o.token).then(d)},title:"Enter a new API Token",titleTooltip:"Contact us to generate a new one"},e.createElement($,{placeholder:"API Token",type:"password",value:o.token,onChange:e=>l("token",e.target.value)}))))},Wl=({tokens:t,saveToken:i})=>e.createElement(Z,{title:"Authorization Tokens",titleBadge:t.length,data:[{type:h.Table,value:{columns:[{key:"icon",title:""},{key:"name",title:"Name"},{key:"expires_at",title:"Expires"},{key:"token",title:"Token"},{key:"actions",title:""}],rows:t.map(({name:t,token:a,expiresAt:n})=>({cells:[{columnKey:"icon",icon:Wi},{columnKey:"name",value:t},{columnKey:"token",value:`${new Array(15).fill("•").join("")}`},{columnKey:"expires_at",component:()=>e.createElement(zl,{expiresAt:n})},{columnKey:"actions",component:()=>e.createElement(Bl,{token:a,saveToken:i})}]}))}}]}),_l=({fetchDescribeOdigos:a})=>{const[n,o]=t(null);if(i(()=>{a().then(({data:e})=>o(e?.describeOdigos||null))},[]),!n)return e.createElement(De,null,e.createElement(Le,null));const l=t=>t?.name?[e.createElement(se,{key:`divider-${t.name}`}),e.createElement(Zt,{key:`describe-row-${t.name}`,title:t.name,subTitle:t.explain||void 0,value:{status:t.status||(ai(t.value)?ni(t.value)?W.Success:W.Error:W.Default),text:t.value}})]:[];return e.createElement(e.Fragment,null,e.createElement(Z,{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(Z,{title:"Cluster Collector",withExtend:!0},Object.values(n?.clusterCollector||{}).map(l)),e.createElement(Z,{title:"Node Collector",withExtend:!0},Object.values(n?.nodeCollector||{}).map(l)))},Jl=d.div`
490
490
  display: flex;
491
491
  flex-direction: column;
492
492
  gap: 12px;
493
- `,Ul="System Overview",Gl=({tokens:i,saveToken:a,fetchDescribeOdigos:n})=>{const[o,l]=t(!1),r=()=>l(e=>!e);return e.createElement(e.Fragment,null,e.createElement(ht,{key:Ul,onClick:r,tooltip:Ul},e.createElement(Wi,{size:18})),e.createElement(q,{width:"750px",isOpen:o,onClose:r,header:{icons:[Wi],title:Ul},footer:{isOpen:!1}},e.createElement(Jl,null,!!i?.length&&e.createElement(Wl,{tokens:i,saveToken:a}),e.createElement(_l,{fetchDescribeOdigos:n}))))},Yl=d.div`
493
+ `,Ul="System Overview",Gl=({tokens:i,saveToken:a,fetchDescribeOdigos:n})=>{const[o,l]=t(!1),r=()=>l(e=>!e);return e.createElement(e.Fragment,null,e.createElement(ht,{key:Ul,onClick:r,tooltip:Ul},e.createElement(_i,{size:18})),e.createElement(q,{width:"750px",isOpen:o,onClose:r,header:{icons:[_i],title:Ul},footer:{isOpen:!1}},e.createElement(Jl,null,!!i?.length&&e.createElement(Wl,{tokens:i,saveToken:a}),e.createElement(_l,{fetchDescribeOdigos:n}))))},Yl=d.div`
494
494
  position: fixed;
495
495
  bottom: 12px;
496
496
  left: 12px;
@@ -528,13 +528,13 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
528
528
  background-color: ${({theme:e})=>e.colors.border};
529
529
  border-radius: 100%;
530
530
  transition: all 0.3s;
531
- `,er=({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})),tr=()=>{const{darkMode:t,setDarkMode:i}=yi();return e.createElement(Zl,{onClick:()=>i(!t)},e.createElement(er,{path:"M14 7.977A4.333 4.333 0 1 1 8.023 2H8a6 6 0 1 0 6 6v-.023Z"}),e.createElement(er,{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(Ql,{$darkMode:t}))},ir=e=>{const{spans:t}=e,i=new Map;t.forEach(e=>{i.set(e.spanID,{...e,spans:[]})});const a=[];return t.forEach(e=>{const t=i.get(e.spanID);let n=!1;if(e.references.length){const t=e.references.find(e=>"CHILD_OF"===e.refType);t&&t.spanID&&i.has(t.spanID)||(n=!0)}else n=!0;if(n)a.push(t);else{const a=e.references.find(e=>"CHILD_OF"===e.refType);if(a){const e=i.get(a.spanID);e&&(e.spans=e.spans||[],e.spans.push(t),e.spans=e.spans.sort((e,t)=>e.startTime-t.startTime))}}}),a.sort((e,t)=>e.startTime-t.startTime)},ar=(e,t)=>{const{tags:i}=e,a={},n=[];return i.forEach(e=>{a[e.key]=e.value}),n.push({type:h.Code,value:{language:"json",code:JSON.stringify(a,null,2),pretty:t}}),n},nr=e=>{const{logs:t}=e,i=[];return t.forEach((e,a)=>{e.fields.forEach(e=>{i.push({title:e.key,value:e.value})}),a!==t.length-1&&i.push({type:h.Divider})}),i},or=e=>{const{traceID:t,spanID:i,processID:a,operationName:n,duration:o,startTime:l,warnings:r}=e,s=[];return s.push({type:h.CopyText,title:"Trace ID",value:t}),s.push({type:h.CopyText,title:"Span ID",value:i}),s.push({type:h.Divider}),s.push({title:"Service",value:a}),s.push({title:"Operation",value:n}),s.push({title:"Duration",value:vi(o)}),s.push({title:"Start time",value:new Date(l/1e3).toLocaleString()}),r.length&&(s.push({type:h.Divider}),s.push({title:"Warnings",titleIcon:_i,value:r})),s},lr=(e,t)=>{const{tags:i}=e,a={},n=[];return i.forEach(e=>{a[e.key]=e.value}),n.push({type:h.Code,value:{language:"json",code:JSON.stringify(a,null,2),pretty:t}}),n},rr=d.div`
531
+ `,er=({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})),tr=()=>{const{darkMode:t,setDarkMode:i}=vi();return e.createElement(Zl,{onClick:()=>i(!t)},e.createElement(er,{path:"M14 7.977A4.333 4.333 0 1 1 8.023 2H8a6 6 0 1 0 6 6v-.023Z"}),e.createElement(er,{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(Ql,{$darkMode:t}))},ir=e=>{const{spans:t}=e,i=new Map;t.forEach(e=>{i.set(e.spanID,{...e,spans:[]})});const a=[];return t.forEach(e=>{const t=i.get(e.spanID);let n=!1;if(e.references.length){const t=e.references.find(e=>"CHILD_OF"===e.refType);t&&t.spanID&&i.has(t.spanID)||(n=!0)}else n=!0;if(n)a.push(t);else{const a=e.references.find(e=>"CHILD_OF"===e.refType);if(a){const e=i.get(a.spanID);e&&(e.spans=e.spans||[],e.spans.push(t),e.spans=e.spans.sort((e,t)=>e.startTime-t.startTime))}}}),a.sort((e,t)=>e.startTime-t.startTime)},ar=(e,t)=>{const{tags:i}=e,a={},n=[];return i.forEach(e=>{a[e.key]=e.value}),n.push({type:h.Code,value:{language:"json",code:JSON.stringify(a,null,2),pretty:t}}),n},nr=e=>{const{logs:t}=e,i=[];return t.forEach((e,a)=>{e.fields.forEach(e=>{i.push({title:e.key,value:e.value})}),a!==t.length-1&&i.push({type:h.Divider})}),i},or=e=>{const{traceID:t,spanID:i,processID:a,operationName:n,duration:o,startTime:l,warnings:r}=e,s=[];return s.push({type:h.CopyText,title:"Trace ID",value:t}),s.push({type:h.CopyText,title:"Span ID",value:i}),s.push({type:h.Divider}),s.push({title:"Service",value:a}),s.push({title:"Operation",value:n}),s.push({title:"Duration",value:bi(o)}),s.push({title:"Start time",value:new Date(l/1e3).toLocaleString()}),r.length&&(s.push({type:h.Divider}),s.push({title:"Warnings",titleIcon:Ji,value:r})),s},lr=(e,t)=>{const{tags:i}=e,a={},n=[];return i.forEach(e=>{a[e.key]=e.value}),n.push({type:h.Code,value:{language:"json",code:JSON.stringify(a,null,2),pretty:t}}),n},rr=d.div`
532
532
  display: flex;
533
533
  flex-direction: column;
534
534
  gap: 12px;
535
535
  max-height: 100vh;
536
536
  overflow-y: auto;
537
- `,sr=({span:i,process:a,onClose:n})=>{const[o,l]=t(!0),[r,s]=t(!0);return e.createElement(q,{width:"750px",isOpen:!0,onClose:n,header:{icons:[Ji],title:i.operationName},footer:{isOpen:!1}},e.createElement(rr,null,e.createElement(Z,{title:"Details",data:or(i)}),i.logs.length>0&&e.createElement(Z,{title:"Errors",titleBadge:i.logs.length,titleIcon:_i,data:nr(i)}),e.createElement(Z,{title:"Tags",data:ar(i,o),action:e.createElement(bi,{isPrettyMode:o,setIsPrettyMode:l})}),a&&e.createElement(Z,{title:`Process (${a.serviceName})`,data:lr(a,r),action:e.createElement(bi,{isPrettyMode:r,setIsPrettyMode:s})})))},cr=370,dr=["#33DCA7","#50F6E8","#444AD9","#8B55FF","#FF7CA9"].reverse(),ur=d.div`
537
+ `,sr=({span:i,process:a,onClose:n})=>{const[o,l]=t(!0),[r,s]=t(!0);return e.createElement(q,{width:"750px",isOpen:!0,onClose:n,header:{icons:[Ui],title:i.operationName},footer:{isOpen:!1}},e.createElement(rr,null,e.createElement(Z,{title:"Details",data:or(i)}),i.logs.length>0&&e.createElement(Z,{title:"Errors",titleBadge:i.logs.length,titleIcon:Ji,data:nr(i)}),e.createElement(Z,{title:"Tags",data:ar(i,o),action:e.createElement(fi,{isPrettyMode:o,setIsPrettyMode:l})}),a&&e.createElement(Z,{title:`Process (${a.serviceName})`,data:lr(a,r),action:e.createElement(fi,{isPrettyMode:r,setIsPrettyMode:s})})))},cr=370,dr=["#33DCA7","#50F6E8","#444AD9","#8B55FF","#FF7CA9"].reverse(),ur=d.div`
538
538
  display: flex;
539
539
  align-items: center;
540
540
  width: ${cr}px;
@@ -569,7 +569,7 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
569
569
  color: ${({theme:e})=>e.text.darker_grey};
570
570
  font-family: ${({theme:e})=>e.font_family.secondary};
571
571
  white-space: nowrap;
572
- `,yr=({span:i,depth:a,indexInMatrix:n,maxDuration:o,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=cr-12*a-20-(s?12:0),b=s&&(1===a||i.logs.length>0);return e.createElement(ur,{className:"span-container",$withErrors:s,$preventHover:g,onClick:m},e.createElement(pr,{$depth:a,className:"span-left"},e.createElement(ue,{$gap:4,$alignItems:"center"},u?e.createElement("div",{onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1)},e.createElement(ht,{onClick:e=>{e.stopPropagation(),p?.()},size:24},e.createElement(gt,{extend:d??!1}))):e.createElement("div",{style:{width:"24px"}}),e.createElement(xi,{maxWidth:v/2,text:i.processID,textSize:14}),e.createElement(E,{size:12,color:h.text.darker_grey},"•"),e.createElement(xi,{maxWidth:v/2,text:i.operationName,textSize:12,textColor:h.text.darker_grey})),s&&(b?e.createElement(me,{...c},e.createElement(_i,{fill:h.text.error})):e.createElement("div",{style:{position:"relative"}},e.createElement("div",{style:{position:"absolute",top:"-24px",right:"8px"}},e.createElement(se,{type:W.Error,orientation:"vertical",thickness:1,length:"48px",margin:"0",opacity:.5}))))),e.createElement(mr,{className:"span-right"},e.createElement(hr,{$indexInMatrix:n,$duration:i.duration,$maxDuration:o,$startTime:i.startTime,$minStartTime:l,$maxEndTime:r},e.createElement(gr,null,vi(i.duration)))))},vr=({spans:t,logs:i,depth:a,indexInMatrix:n,maxDuration:o,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=i.length?i:fi(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===a?`1px dotted ${d.colors.border}`:"none"}},e.createElement(yr,{span:t,depth:a,indexInMatrix:n+u+a,maxDuration:o,minStartTime:l,maxEndTime:r,withErrors:y,errorTooltip:{titleIcon:_i,title:v,text:b},isOpen:m,withToggle:h,onToggleOpen:()=>s.set(e=>e.some(e=>e===p)?e.filter(e=>e!=p):[...e,p,...fi(t,"spans","spanID")]),onSelect:()=>c.set(e=>e?.spanID===p?null:t)}),m&&h?e.createElement(vr,{spans:t.spans||[],logs:g,depth:a+1,indexInMatrix:n+u,maxDuration:o,minStartTime:l,maxEndTime:r,openSpanIdsState:s,selectedSpanState:c}):null)})},br=d.div`
572
+ `,yr=({span:i,depth:a,indexInMatrix:n,maxDuration:o,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=cr-12*a-20-(s?12:0),b=s&&(1===a||i.logs.length>0);return e.createElement(ur,{className:"span-container",$withErrors:s,$preventHover:g,onClick:m},e.createElement(pr,{$depth:a,className:"span-left"},e.createElement(ue,{$gap:4,$alignItems:"center"},u?e.createElement("div",{onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1)},e.createElement(ht,{onClick:e=>{e.stopPropagation(),p?.()},size:24},e.createElement(gt,{extend:d??!1}))):e.createElement("div",{style:{width:"24px"}}),e.createElement($i,{maxWidth:v/2,text:i.processID,textSize:14}),e.createElement(E,{size:12,color:h.text.darker_grey},"•"),e.createElement($i,{maxWidth:v/2,text:i.operationName,textSize:12,textColor:h.text.darker_grey})),s&&(b?e.createElement(me,{...c},e.createElement(Ji,{fill:h.text.error})):e.createElement("div",{style:{position:"relative"}},e.createElement("div",{style:{position:"absolute",top:"-24px",right:"8px"}},e.createElement(se,{type:W.Error,orientation:"vertical",thickness:1,length:"48px",margin:"0",opacity:.5}))))),e.createElement(mr,{className:"span-right"},e.createElement(hr,{$indexInMatrix:n,$duration:i.duration,$maxDuration:o,$startTime:i.startTime,$minStartTime:l,$maxEndTime:r},e.createElement(gr,null,bi(i.duration)))))},vr=({spans:t,logs:i,depth:a,indexInMatrix:n,maxDuration:o,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=i.length?i:xi(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===a?`1px dotted ${d.colors.border}`:"none"}},e.createElement(yr,{span:t,depth:a,indexInMatrix:n+u+a,maxDuration:o,minStartTime:l,maxEndTime:r,withErrors:y,errorTooltip:{titleIcon:Ji,title:v,text:b},isOpen:m,withToggle:h,onToggleOpen:()=>s.set(e=>e.some(e=>e===p)?e.filter(e=>e!=p):[...e,p,...xi(t,"spans","spanID")]),onSelect:()=>c.set(e=>e?.spanID===p?null:t)}),m&&h?e.createElement(vr,{spans:t.spans||[],logs:g,depth:a+1,indexInMatrix:n+u,maxDuration:o,minStartTime:l,maxEndTime:r,openSpanIdsState:s,selectedSpanState:c}):null)})},br=d.div`
573
573
  width: 100%;
574
574
  `,fr=d.div`
575
575
  max-height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px + 2px)`};
@@ -599,4 +599,4 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
599
599
  padding-top: 12px;
600
600
  padding-left: 12px;
601
601
  white-space: nowrap;
602
- `,kr=({heightToRemove:i,traces:a,isLoading:n})=>{const[o,r]=t([]),[s,c]=t(null),d=l(()=>Dt(a).sort((e,t)=>t.spans[0].startTime-e.spans[0].startTime).map(e=>({...e,spans:ir(e)})),[a]),u=l(()=>d.reduce((e,t)=>Math.max(e,t.spans.reduce((e,t)=>e+t.duration,0)),0),[d]),p=l(()=>{const e=d.find(e=>e.spans.some(e=>e.spanID===s?.spanID)),t=e?.processes.find(e=>e.serviceName===s?.processID);return t},[d,s]);return e.createElement(e.Fragment,null,e.createElement(br,{$heightToRemove:i},n?e.createElement(De,{$height:"50vh"},e.createElement(Le,{scale:1.5})):d.length?e.createElement(fr,{$heightToRemove:i},e.createElement(xr,null,e.createElement(E,null,"Service & operation")),new Array(5).fill(null).map((t,a)=>e.createElement($r,{key:`${a}-divider`,$heightToRemove:i,index:a},e.createElement(Sr,null,vi(u/5*a)))),d.map((t,i)=>{const{spans:a}=t,n=a.reduce((e,t)=>Math.min(e,t.startTime),Number.MAX_SAFE_INTEGER),l=a.reduce((e,t)=>Math.max(e,t.startTime+t.duration),0);return e.createElement(vr,{key:`recursive-spans-${t.traceID}`,spans:a,logs:[],depth:1,indexInMatrix:i,maxDuration:u,minStartTime:n,maxEndTime:l,openSpanIdsState:{value:o,set:r},selectedSpanState:{value:s,set:c}})})):e.createElement(De,{$height:"50vh"},e.createElement(Ne,{title:m.NO_TRACES_FOUND,subTitle:m.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}))),s&&e.createElement(sr,{span:s,process:p,onClose:()=>c(null)}))};export{wa as ActionDrawer,xa as ActionForm,Da as ActionModal,Fa as ActionTable,Ka as AwaitPipeline,ln as ConditionDropdown,en as DataFlow,An as DataFlowActionsMenu,Sn as DataStreamDrawer,xn as DataStreamForm,Mn as DataStreamModal,Fn as DataStreamSelectionForm,Jn as DestinationDrawer,Bn as DestinationForm,mo as DestinationModal,bo as DestinationSelectionForm,xo as DestinationTable,rn as ErrorDropdown,Lo as InstrumentationRuleDrawer,Fo as InstrumentationRuleForm,jo as InstrumentationRuleModal,Ho as InstrumentationRuleTable,un as KindDropdown,sn as LanguageDropdown,cn as MonitorDropdown,Bo as MultiSourceControl,dn as NamespaceDropdown,$l as NavIconIds,Yo as NotificationManager,$a as OverviewDrawer,pn as PodsAgentInjectionStatusDropdown,rl as ServiceMap,xl as SetupSummary,Sl as SideNav,kl as SlackInvite,Ll as SourceDrawer,Tl as SourceForm,jl as SourceModal,Kl as SourceSelectionForm,ql as SourceTable,Gl as SystemOverview,Ea as TableCellConditions,Xl as ToastList,tr as ToggleDarkMode,kr as TraceView};
602
+ `,kr=({heightToRemove:i,traces:a,isLoading:n})=>{const[o,r]=t([]),[s,c]=t(null),d=l(()=>Dt(a).sort((e,t)=>t.spans[0].startTime-e.spans[0].startTime).map(e=>({...e,spans:ir(e)})),[a]),u=l(()=>d.reduce((e,t)=>Math.max(e,t.spans.reduce((e,t)=>e+t.duration,0)),0),[d]),p=l(()=>{const e=d.find(e=>e.spans.some(e=>e.spanID===s?.spanID)),t=e?.processes.find(e=>e.serviceName===s?.processID);return t},[d,s]);return e.createElement(e.Fragment,null,e.createElement(br,{$heightToRemove:i},n?e.createElement(De,{$height:"50vh"},e.createElement(Le,{scale:1.5})):d.length?e.createElement(fr,{$heightToRemove:i},e.createElement(xr,null,e.createElement(E,null,"Service & operation")),new Array(5).fill(null).map((t,a)=>e.createElement($r,{key:`${a}-divider`,$heightToRemove:i,index:a},e.createElement(Sr,null,bi(u/5*a)))),d.map((t,i)=>{const{spans:a}=t,n=a.reduce((e,t)=>Math.min(e,t.startTime),Number.MAX_SAFE_INTEGER),l=a.reduce((e,t)=>Math.max(e,t.startTime+t.duration),0);return e.createElement(vr,{key:`recursive-spans-${t.traceID}`,spans:a,logs:[],depth:1,indexInMatrix:i,maxDuration:u,minStartTime:n,maxEndTime:l,openSpanIdsState:{value:o,set:r},selectedSpanState:{value:s,set:c}})})):e.createElement(De,{$height:"50vh"},e.createElement(Ne,{title:m.NO_TRACES_FOUND,subTitle:m.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}))),s&&e.createElement(sr,{span:s,process:p,onClose:()=>c(null)}))};export{wa as ActionDrawer,xa as ActionForm,Da as ActionModal,Fa as ActionTable,ja as AwaitPipeline,ln as ConditionDropdown,en as DataFlow,An as DataFlowActionsMenu,Sn as DataStreamDrawer,xn as DataStreamForm,Mn as DataStreamModal,Fn as DataStreamSelectionForm,Jn as DestinationDrawer,Bn as DestinationForm,mo as DestinationModal,bo as DestinationSelectionForm,xo as DestinationTable,rn as ErrorDropdown,Lo as InstrumentationRuleDrawer,Fo as InstrumentationRuleForm,Ko as InstrumentationRuleModal,zo as InstrumentationRuleTable,un as KindDropdown,sn as LanguageDropdown,cn as MonitorDropdown,Bo as MultiSourceControl,dn as NamespaceDropdown,$l as NavIconIds,Yo as NotificationManager,$a as OverviewDrawer,pn as PodsAgentInjectionStatusDropdown,rl as ServiceMap,xl as SetupSummary,Sl as SideNav,kl as SlackInvite,Ll as SourceDrawer,Tl as SourceForm,Kl as SourceModal,jl as SourceSelectionForm,ql as SourceTable,Gl as SystemOverview,Ea as TableCellConditions,Xl as ToastList,tr as ToggleDarkMode,kr as TraceView};