@odigos/ui-kit 0.0.125 → 0.0.126

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.0.126](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.125...ui-kit-v0.0.126) (2025-11-17)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * data id for tests (sources) ([#471](https://github.com/odigos-io/ui-kit/issues/471)) ([8821c36](https://github.com/odigos-io/ui-kit/commit/8821c36bcc91a342793b9e0c1201054526cece56))
9
+
3
10
  ## [0.0.125](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.124...ui-kit-v0.0.125) (2025-11-17)
4
11
 
5
12
 
package/lib/containers.js CHANGED
@@ -1,4 +1,4 @@
1
- import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperativeHandle as n,useMemo as l,Fragment as r,useCallback as s,Children as c}from"react";import d,{css as u}from"styled-components";import{D as p,a as m,A as h,K as g,F as y,C as v,b as f,c as b,I as x,d as C,i as k,e as w,f as S,g as $,h as D,j as N,k as T,T as I,S as O,l as E,m as A,M,n as F,u as R,o as L,p as P,q,B as K,r as j,s as V,t as z,E as B,v as H,w as U,x as W,y as _,z as G,G as J,H as Y,J as Q,L as X,N as Z,O as ee,P as te,Q as oe,R as ie,U as ae,V as ne,W as le,X as re,Y as se,Z as ce,_ as de,$ as ue,a0 as pe,a1 as me,a2 as he,a3 as ge,a4 as ye,a5 as ve,a6 as fe,a7 as be,a8 as xe,a9 as Ce,aa as ke,ab as we,ac as Se,ad as $e,ae as De,af as Ne,ag as Te,ah as Ie,ai as Oe,aj as Ee,ak as Ae,al as Me,am as Fe,an as Re,ao as Le,ap as Pe,aq as qe,ar as Ke,as as je,at as Ve,au as ze,av as Be,aw as He,ax as Ue,ay as We,az as _e,aA as Ge,aB as Je,aC as Ye,aD as Qe,aE as Xe,aF as Ze,aG as et,aH as tt,aI as ot,aJ as it,aK as at,aL as nt,aM as lt,aN as rt,aO as st,aP as ct,aQ as dt,aR as ut,aS as pt,aT as mt,aU as ht,aV as gt,aW as yt,aX as vt,aY as ft,aZ as bt,a_ as xt,a$ as Ct,b0 as kt,b1 as wt,b2 as St,b3 as $t,b4 as Dt,b5 as Nt,b6 as Tt,b7 as It,b8 as Ot,b9 as Et,ba as At,bb as Mt,bc as Ft,bd as Rt,be as Lt,bf as Pt,bg as qt,bh as Kt,bi as jt,bj as Vt,bk as zt,bl as Bt,bm as Ht,bn as Ut,bo as Wt,bp as _t,bq as Gt,br as Jt,bs as Yt,bt as Qt,bu as Xt,bv as Zt,bw as eo,bx as to,by as oo,bz as io,bA as ao,bB as no,bC as lo,bD as ro,bE as so,bF as co,bG as uo,bH as po,bI as mo,bJ as ho,bK as go,bL as yo,bM as vo,bN as fo,bO as bo,bP as xo,bQ as Co}from"./chunks/ui-components-898f30d4.js";import{CheckCircledIcon as ko,CrossCircledIcon as wo,EditIcon as So,TrashIcon as $o,OdigosLogoText as Do,PlusIcon as No,SearchIcon as To,FilterIcon as Io,DataStreamsIcon as Oo,CheckIcon as Eo,OdigosLogo as Ao,ArrowIcon as Mo,RefreshLeftArrowIcon as Fo,NotificationIcon as Ro,UserIcon as Lo,ImageErrorIcon as Po,OverviewIcon as qo,RulesIcon as Ko,ActionsIcon as jo,SourcesIcon as Vo,DestinationsIcon as zo,SlackLogo as Bo,CopyIcon as Ho,KeyIcon as Uo,TerminalIcon as Wo,GearIcon as _o,WarningTriangleIcon as Go,TraceViewIcon as Jo,ErrorTriangleIcon as Yo}from"./icons.js";import{MarkerType as Qo,useNodesState as Xo,useEdgesState as Zo,applyNodeChanges as ei}from"@xyflow/react";import"zustand";import"javascript-time-ago";import"./chunks/vendor-f206ac21.js";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";const ti=e=>{const{type:t,name:o,notes:i,signals:a,disabled:n,fields:{collectContainerAttributes:l,collectReplicaSetAttributes:r,collectWorkloadId:s,collectClusterId:c,labelsAttributes:d,annotationsAttributes:u,clusterAttributes:y,overwriteExistingValues:v,attributeNamesToDelete:f,renames:b,piiCategories:x,fallbackSamplingRatio:C,samplingPercentage:k,endpointsFilters:w,servicesNameFilters:S,attributeFilters:$}}=e,D=[{title:p.TYPE,value:t},{type:m.ActiveStatus,title:p.STATUS,value:String(!n)},{type:m.Monitors,title:p.SIGNALS_FOR_PROCESSING,value:a?.map(e=>e.toLowerCase()).join(", ")||""},{title:p.NAME,value:o||""},{title:p.NOTES,value:i||""},{type:m.Divider}];if(t===h.K8sAttributes&&(D.push({title:"Collect Container Attributes",value:String(l)}),D.push({title:"Collect ReplicaSet Attributes",value:String(r)}),D.push({title:"Collect Workload ID",value:String(s)}),D.push({title:"Collect Cluster ID",value:String(c)}),d?.length&&D.push({type:m.Divider}),d?.forEach(({labelKey:e,attributeKey:t,from:o},i)=>{let a="";a+=`Label Key: ${e}\n`,a+=`Attribute Key: ${t}\n`,a+=`From: ${o||g.Pod}\n`,D.push({title:"Label"+(d.length>1?` #${i+1}`:""),value:a})}),u?.length&&D.push({type:m.Divider}),u?.forEach(({annotationKey:e,attributeKey:t,from:o},i)=>{let a="";a+=`Annotation Key: ${e}\n`,a+=`Attribute Key: ${t}\n`,a+=`From: ${o||g.Pod}\n`,D.push({title:"Annotation"+(u.length>1?` #${i+1}`:""),value:a})})),t===h.AddClusterInfo){D.push({title:"Overwrite Existing Values",value:String(v||!1)});let e="";y?.forEach(({attributeName:t,attributeStringValue:o},i)=>{e+=`${t}: ${o}`,i<y.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===h.DeleteAttributes){let e="";f?.forEach((t,o)=>{e+=t,o<f.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===h.RenameAttributes){let e="";const t=Object.entries(b||{});t.forEach(([o,i],a)=>{e+=`${o}: ${i}`,a<t.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===h.PiiMasking){let e="";x?.forEach((t,o)=>{e+=t,o<x.length-1&&(e+=", ")}),D.push({title:"Categories",value:e})}return t===h.ErrorSampler&&D.push({title:"Sampling Ratio",value:String(C)}),t===h.ProbabilisticSampler&&D.push({title:"Sampling Percentage",value:String(k)}),t===h.LatencySampler&&w?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:o,fallbackSamplingRatio:i},a)=>{let n="";n+=`Service Name: ${e}\n`,n+=`HTTP Route: ${t}\n`,n+=`Min. Latency: ${o}\n`,n+=`Fallback Sampling Ratio: ${i}`,D.push({title:"Endpoint"+(w.length>1?` #${a+1}`:""),value:n})}),t===h.ServiceNameSampler&&S?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:o},i)=>{let a="";a+=`Service Name: ${e}\n`,a+=`Sampling Ratio: ${t}\n`,a+=`Fallback Sampling Ratio: ${o}`,D.push({title:"Filter"+(S.length>1?` #${i+1}`:""),value:a})}),t===h.SpanAttributeSampler&&$?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:o,condition:i},a)=>{let n="";n+=`Service Name: ${e}\n`,n+=`Attribute Key: ${t}\n`,n+=`Fallback Sampling Ratio: ${o}\n`;const l=Object.keys(i)[0];n+=`Condition: ${l}\n`,n+=`Operation: ${i[l]?.operation}\n`,n+=`Expected Value: ${i[l]?.expectedValue}`,"jsonCondition"===l&&(n+=`\nJSON Path: ${i[l].jsonPath}`),D.push({title:"Filter"+($.length>1?` #${a+1}`:""),value:n})}),D},oi=b.PiiCategories,ii=d.div`
1
+ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperativeHandle as n,useMemo as l,Fragment as r,useCallback as s,Children as c}from"react";import d,{css as u}from"styled-components";import{D as p,a as m,A as h,K as g,F as y,C as v,b as f,c as b,I as x,d as C,i as k,e as w,f as S,g as $,h as D,j as N,k as T,T as I,S as E,l as O,m as A,M,n as F,u as R,o as L,p as P,q,B as K,r as j,s as V,t as z,E as B,v as H,w as U,x as W,y as _,z as G,G as J,H as Y,J as Q,L as X,N as Z,O as ee,P as te,Q as oe,R as ie,U as ae,V as ne,W as le,X as re,Y as se,Z as ce,_ as de,$ as ue,a0 as pe,a1 as me,a2 as he,a3 as ge,a4 as ye,a5 as ve,a6 as fe,a7 as be,a8 as xe,a9 as Ce,aa as ke,ab as we,ac as Se,ad as $e,ae as De,af as Ne,ag as Te,ah as Ie,ai as Ee,aj as Oe,ak as Ae,al as Me,am as Fe,an as Re,ao as Le,ap as Pe,aq as qe,ar as Ke,as as je,at as Ve,au as ze,av as Be,aw as He,ax as Ue,ay as We,az as _e,aA as Ge,aB as Je,aC as Ye,aD as Qe,aE as Xe,aF as Ze,aG as et,aH as tt,aI as ot,aJ as it,aK as at,aL as nt,aM as lt,aN as rt,aO as st,aP as ct,aQ as dt,aR as ut,aS as pt,aT as mt,aU as ht,aV as gt,aW as yt,aX as vt,aY as ft,aZ as bt,a_ as xt,a$ as Ct,b0 as kt,b1 as wt,b2 as St,b3 as $t,b4 as Dt,b5 as Nt,b6 as Tt,b7 as It,b8 as Et,b9 as Ot,ba as At,bb as Mt,bc as Ft,bd as Rt,be as Lt,bf as Pt,bg as qt,bh as Kt,bi as jt,bj as Vt,bk as zt,bl as Bt,bm as Ht,bn as Ut,bo as Wt,bp as _t,bq as Gt,br as Jt,bs as Yt,bt as Qt,bu as Xt,bv as Zt,bw as eo,bx as to,by as oo,bz as io,bA as ao,bB as no,bC as lo,bD as ro,bE as so,bF as co,bG as uo,bH as po,bI as mo,bJ as ho,bK as go,bL as yo,bM as vo,bN as fo,bO as bo,bP as xo,bQ as Co}from"./chunks/ui-components-898f30d4.js";import{CheckCircledIcon as ko,CrossCircledIcon as wo,EditIcon as So,TrashIcon as $o,OdigosLogoText as Do,PlusIcon as No,SearchIcon as To,FilterIcon as Io,DataStreamsIcon as Eo,CheckIcon as Oo,OdigosLogo as Ao,ArrowIcon as Mo,RefreshLeftArrowIcon as Fo,NotificationIcon as Ro,UserIcon as Lo,ImageErrorIcon as Po,OverviewIcon as qo,RulesIcon as Ko,ActionsIcon as jo,SourcesIcon as Vo,DestinationsIcon as zo,SlackLogo as Bo,CopyIcon as Ho,KeyIcon as Uo,TerminalIcon as Wo,GearIcon as _o,WarningTriangleIcon as Go,TraceViewIcon as Jo,ErrorTriangleIcon as Yo}from"./icons.js";import{MarkerType as Qo,useNodesState as Xo,useEdgesState as Zo,applyNodeChanges as ei}from"@xyflow/react";import"zustand";import"javascript-time-ago";import"./chunks/vendor-f206ac21.js";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";const ti=e=>{const{type:t,name:o,notes:i,signals:a,disabled:n,fields:{collectContainerAttributes:l,collectReplicaSetAttributes:r,collectWorkloadId:s,collectClusterId:c,labelsAttributes:d,annotationsAttributes:u,clusterAttributes:y,overwriteExistingValues:v,attributeNamesToDelete:f,renames:b,piiCategories:x,fallbackSamplingRatio:C,samplingPercentage:k,endpointsFilters:w,servicesNameFilters:S,attributeFilters:$}}=e,D=[{title:p.TYPE,value:t},{type:m.ActiveStatus,title:p.STATUS,value:String(!n)},{type:m.Monitors,title:p.SIGNALS_FOR_PROCESSING,value:a?.map(e=>e.toLowerCase()).join(", ")||""},{title:p.NAME,value:o||""},{title:p.NOTES,value:i||""},{type:m.Divider}];if(t===h.K8sAttributes&&(D.push({title:"Collect Container Attributes",value:String(l)}),D.push({title:"Collect ReplicaSet Attributes",value:String(r)}),D.push({title:"Collect Workload ID",value:String(s)}),D.push({title:"Collect Cluster ID",value:String(c)}),d?.length&&D.push({type:m.Divider}),d?.forEach(({labelKey:e,attributeKey:t,from:o},i)=>{let a="";a+=`Label Key: ${e}\n`,a+=`Attribute Key: ${t}\n`,a+=`From: ${o||g.Pod}\n`,D.push({title:"Label"+(d.length>1?` #${i+1}`:""),value:a})}),u?.length&&D.push({type:m.Divider}),u?.forEach(({annotationKey:e,attributeKey:t,from:o},i)=>{let a="";a+=`Annotation Key: ${e}\n`,a+=`Attribute Key: ${t}\n`,a+=`From: ${o||g.Pod}\n`,D.push({title:"Annotation"+(u.length>1?` #${i+1}`:""),value:a})})),t===h.AddClusterInfo){D.push({title:"Overwrite Existing Values",value:String(v||!1)});let e="";y?.forEach(({attributeName:t,attributeStringValue:o},i)=>{e+=`${t}: ${o}`,i<y.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===h.DeleteAttributes){let e="";f?.forEach((t,o)=>{e+=t,o<f.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===h.RenameAttributes){let e="";const t=Object.entries(b||{});t.forEach(([o,i],a)=>{e+=`${o}: ${i}`,a<t.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===h.PiiMasking){let e="";x?.forEach((t,o)=>{e+=t,o<x.length-1&&(e+=", ")}),D.push({title:"Categories",value:e})}return t===h.ErrorSampler&&D.push({title:"Sampling Ratio",value:String(C)}),t===h.ProbabilisticSampler&&D.push({title:"Sampling Percentage",value:String(k)}),t===h.LatencySampler&&w?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:o,fallbackSamplingRatio:i},a)=>{let n="";n+=`Service Name: ${e}\n`,n+=`HTTP Route: ${t}\n`,n+=`Min. Latency: ${o}\n`,n+=`Fallback Sampling Ratio: ${i}`,D.push({title:"Endpoint"+(w.length>1?` #${a+1}`:""),value:n})}),t===h.ServiceNameSampler&&S?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:o},i)=>{let a="";a+=`Service Name: ${e}\n`,a+=`Sampling Ratio: ${t}\n`,a+=`Fallback Sampling Ratio: ${o}`,D.push({title:"Filter"+(S.length>1?` #${i+1}`:""),value:a})}),t===h.SpanAttributeSampler&&$?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:o,condition:i},a)=>{let n="";n+=`Service Name: ${e}\n`,n+=`Attribute Key: ${t}\n`,n+=`Fallback Sampling Ratio: ${o}\n`;const l=Object.keys(i)[0];n+=`Condition: ${l}\n`,n+=`Operation: ${i[l]?.operation}\n`,n+=`Expected Value: ${i[l]?.expectedValue}`,"jsonCondition"===l&&(n+=`\nJSON Path: ${i[l].jsonPath}`),D.push({title:"Filter"+($.length>1?` #${a+1}`:""),value:n})}),D},oi=b.PiiCategories,ii=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 o,forwardRef as i,useRef as a,useImperative
14
14
  padding: 4px;
15
15
  `,Ci=d(T)`
16
16
  margin-bottom: 12px;
17
- `,ki=({isUpdate:t,action:o,formData:i,formErrors:a,handleFormChange:n})=>{const l=I.useTheme();return e.createElement(xi,null,t&&e.createElement("div",null,e.createElement(Ci,null,"Status"),e.createElement(O,{options:[{icon:ko,label:p.ENABLED,value:!1,selectedBgColor:l.text.success+I.opacity.hex["050"]},{icon:wo,label:p.DISABLED,value:!0,selectedBgColor:l.text.error+I.opacity.hex["050"]}],selected:i.disabled,setSelected:e=>n("disabled",e)})),!t&&e.createElement(E,{title:"",description:o.docsDescription,actionButton:e.createElement(A,{endpoint:o.docsEndpoint})}),e.createElement(M,{title:"Signals for Processing",required:!0,allowedSignals:o.allowedSignals,selectedSignals:i.signals||[],setSelectedSignals:e=>n("signals",e),errorMessage:a.signals}),!t&&e.createElement(x,{title:"Action name",placeholder:"Use a name that describes the action",value:i.name||"",onChange:({target:{value:e}})=>n("name",e),errorMessage:a.name}),e.createElement(bi,{actionType:o.type,value:i.fields,setValue:(e,t)=>n(`fields.${e}`,t),formErrors:a}),e.createElement(F,{title:"Notes",value:i.notes||"",onChange:({target:{value:e}})=>n("notes",e),errorMessage:a.notes}))},wi=i(({children:o,width:i=640,title:r,titleTooltip:s,hideEditTitleFromEdit:c,icons:d,iconSrcs:u,isEdit:p=!1,isFormDirty:m=!1,isLastItem:h=!1,onClose:g,onEdit:y,onSave:v,onDelete:f,onCancel:b,tabs:x,headerActionButtons:C},k)=>{const w=I.useTheme(),{isThisPending:S}=R(),{addNotification:$}=L(),{drawerType:D,drawerEntityId:N,setDrawerType:O,setDrawerEntityId:E}=P();q({key:"Enter",active:p},()=>Z());const[A,M]=t(!1),[F,U]=t(!1),W=a(null),_=D===B.Source,G=()=>{M(!1),U(!1)},J=()=>{G(),y&&y(!1),O(null),E(null),g?.()};n(k,()=>({closeDrawer:J}));const Y=()=>{W.current?.clearTitle(),b&&b(),G()},Q=()=>{const e=W.current?.isTitleDirty();m||e?U(!0):Y()},X=()=>{M(!0)},Z=()=>{v&&v(W.current?.getTitle()||"")},ee=l(()=>!!D&&S({entityType:D,entityId:N}),[D,N]),te=e=>{$({type:H.Warning,title:"Pending",message:`Cannot click ${e}, ${D} is pending`,hideFromHistory:!0})},oe=C||[];return y&&!p&&oe.push({"data-id":"drawer-edit",variant:"tertiary",onClick:ee?()=>te("edit"):()=>y(!0),children:e.createElement(e.Fragment,null,e.createElement(So,null),e.createElement(T,{size:14,family:"secondary",decoration:"underline"},"Edit"))}),f&&!p&&oe.push({"data-id":"drawer-delete",variant:"tertiary",onClick:ee?()=>te(_?"uninstrument":"delete"):X,children:e.createElement(e.Fragment,null,e.createElement($o,null),e.createElement(T,{color:w.text.error,size:14,family:"secondary",decoration:"underline"},_?K.UNINSTRUMENT:K.DELETE))}),e.createElement(e.Fragment,null,e.createElement(j,{isOpen:!0,onClose:p?Q:J,closeOnEscape:!A&&!F,width:`${i+64}px`,header:{icons:d,iconSrcs:u,title:r,titleTooltip:s,replaceTitleWith:!c&&p?e.createElement(Si,{ref:W,title:r}):void 0,actionButtons:oe,tabs:x},footer:{isOpen:p,leftButtons:[{"data-id":"drawer-save",variant:"primary",onClick:Z,children:K.SAVE},{"data-id":"drawer-cancel",variant:"secondary",onClick:Q,children:K.CANCEL}],rightButtons:f?[{"data-id":"drawer-delete",variant:"tertiary",onClick:X,children:e.createElement(e.Fragment,null,e.createElement($o,null),e.createElement(T,{size:14,color:w.text.error,family:"secondary",decoration:"underline"},K.DELETE))}]:[]}},o),e.createElement(V,{isOpen:A,noOverlay:!0,name:`${D}${r?` (${r})`:""}`,type:D,isLastItem:h,onApprove:()=>{f&&f(),G()},onDeny:G}),e.createElement(z,{isOpen:F,noOverlay:!0,name:"edit mode",onApprove:Y,onDeny:G}))}),Si=i(({title:i},a)=>{const[l,r]=t(i);return o(()=>{r(i)},[i]),n(a,()=>({getTitle:()=>l||i,isTitleDirty:()=>l!==i,clearTitle:()=>r(i)})),e.createElement(x,{"data-id":"title",value:l,onChange:e=>r(e.target.value)})});Si.displayName=Si.name,wi.displayName=wi.name;const $i=d.div`
17
+ `,ki=({isUpdate:t,action:o,formData:i,formErrors:a,handleFormChange:n})=>{const l=I.useTheme();return e.createElement(xi,null,t&&e.createElement("div",null,e.createElement(Ci,null,"Status"),e.createElement(E,{options:[{icon:ko,label:p.ENABLED,value:!1,selectedBgColor:l.text.success+I.opacity.hex["050"]},{icon:wo,label:p.DISABLED,value:!0,selectedBgColor:l.text.error+I.opacity.hex["050"]}],selected:i.disabled,setSelected:e=>n("disabled",e)})),!t&&e.createElement(O,{title:"",description:o.docsDescription,actionButton:e.createElement(A,{endpoint:o.docsEndpoint})}),e.createElement(M,{title:"Signals for Processing",required:!0,allowedSignals:o.allowedSignals,selectedSignals:i.signals||[],setSelectedSignals:e=>n("signals",e),errorMessage:a.signals}),!t&&e.createElement(x,{title:"Action name",placeholder:"Use a name that describes the action",value:i.name||"",onChange:({target:{value:e}})=>n("name",e),errorMessage:a.name}),e.createElement(bi,{actionType:o.type,value:i.fields,setValue:(e,t)=>n(`fields.${e}`,t),formErrors:a}),e.createElement(F,{title:"Notes",value:i.notes||"",onChange:({target:{value:e}})=>n("notes",e),errorMessage:a.notes}))},wi=i(({children:o,width:i=640,title:r,titleTooltip:s,hideEditTitleFromEdit:c,icons:d,iconSrcs:u,isEdit:p=!1,isFormDirty:m=!1,isLastItem:h=!1,onClose:g,onEdit:y,onSave:v,onDelete:f,onCancel:b,tabs:x,headerActionButtons:C},k)=>{const w=I.useTheme(),{isThisPending:S}=R(),{addNotification:$}=L(),{drawerType:D,drawerEntityId:N,setDrawerType:E,setDrawerEntityId:O}=P();q({key:"Enter",active:p},()=>Z());const[A,M]=t(!1),[F,U]=t(!1),W=a(null),_=D===B.Source,G=()=>{M(!1),U(!1)},J=()=>{G(),y&&y(!1),E(null),O(null),g?.()};n(k,()=>({closeDrawer:J}));const Y=()=>{W.current?.clearTitle(),b&&b(),G()},Q=()=>{const e=W.current?.isTitleDirty();m||e?U(!0):Y()},X=()=>{M(!0)},Z=()=>{v&&v(W.current?.getTitle()||"")},ee=l(()=>!!D&&S({entityType:D,entityId:N}),[D,N]),te=e=>{$({type:H.Warning,title:"Pending",message:`Cannot click ${e}, ${D} is pending`,hideFromHistory:!0})},oe=C||[];return y&&!p&&oe.push({"data-id":"drawer-edit",variant:"tertiary",onClick:ee?()=>te("edit"):()=>y(!0),children:e.createElement(e.Fragment,null,e.createElement(So,null),e.createElement(T,{size:14,family:"secondary",decoration:"underline"},"Edit"))}),f&&!p&&oe.push({"data-id":"drawer-delete",variant:"tertiary",onClick:ee?()=>te(_?"uninstrument":"delete"):X,children:e.createElement(e.Fragment,null,e.createElement($o,null),e.createElement(T,{color:w.text.error,size:14,family:"secondary",decoration:"underline"},_?K.UNINSTRUMENT:K.DELETE))}),e.createElement(e.Fragment,null,e.createElement(j,{isOpen:!0,onClose:p?Q:J,closeOnEscape:!A&&!F,width:`${i+64}px`,header:{icons:d,iconSrcs:u,title:r,titleTooltip:s,replaceTitleWith:!c&&p?e.createElement(Si,{ref:W,title:r}):void 0,actionButtons:oe,tabs:x},footer:{isOpen:p,leftButtons:[{"data-id":"drawer-save",variant:"primary",onClick:Z,children:K.SAVE},{"data-id":"drawer-cancel",variant:"secondary",onClick:Q,children:K.CANCEL}],rightButtons:f?[{"data-id":"drawer-delete",variant:"tertiary",onClick:X,children:e.createElement(e.Fragment,null,e.createElement($o,null),e.createElement(T,{size:14,color:w.text.error,family:"secondary",decoration:"underline"},K.DELETE))}]:[]}},o),e.createElement(V,{isOpen:A,noOverlay:!0,name:`${D}${r?` (${r})`:""}`,type:D,isLastItem:h,onApprove:()=>{f&&f(),G()},onDeny:G}),e.createElement(z,{isOpen:F,noOverlay:!0,name:"edit mode",onApprove:Y,onDeny:G}))}),Si=i(({title:i},a)=>{const[l,r]=t(i);return o(()=>{r(i)},[i]),n(a,()=>({getTitle:()=>l||i,isTitleDirty:()=>l!==i,clearTitle:()=>r(i)})),e.createElement(x,{"data-id":"title",value:l,onChange:e=>r(e.target.value)})});Si.displayName=Si.name,wi.displayName=wi.name;const $i=d.div`
18
18
  width: 100%;
19
19
  height: 100%;
20
20
  max-height: calc(100vh - 220px);
@@ -27,7 +27,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
27
27
  `,Ni=({updateAction:o,deleteAction:i})=>{const{actions:n}=U(),{drawerType:r,drawerEntityId:s}=P(),c=a(null),d=r!==B.Action,[u,m]=t(!1),[h,g]=t(!1),{formData:y,formErrors:v,handleFormChange:f,resetFormData:b,validateForm:x,loadFormWithDrawerItem:C}=W(),k=l(()=>{if(d)return b();const e=n?.find(e=>e.id===s);return e?C(e):b(),e},[d,s,n]);if(!k)return null;const w=_.find(({type:e})=>e===k.type)||_.find(({label:e})=>"Attributes"===e)?.items?.find(({type:e})=>e===k.type)||_.find(({label:e})=>"Samplers"===e)?.items?.find(({type:e})=>e===k.type);return e.createElement(wi,{ref:c,title:k.name||k.type,icons:[G(k.type)],isEdit:u,isFormDirty:h,onEdit:e=>{m("boolean"!=typeof e||e)},onSave:e=>{if(x({withAlert:!0,alertTitle:Q.Update})){const t=e!==k.type?e:"";f("name",t),o(s,{...y,name:t}),m(!1),g(!1)}},onDelete:()=>{i(s,k.type),m(!1),g(!1),c.current?.closeDrawer()},onCancel:()=>{m(!1),g(!1),C(k)}},u&&w?e.createElement($i,null,e.createElement(ki,{isUpdate:!0,action:w,formData:y,formErrors:v,handleFormChange:(...e)=>{g(!0),f(...e)}})):e.createElement(Di,null,e.createElement(J,{conditions:k.conditions||[]}),e.createElement(Y,{title:p.ACTION_DETAILS,data:k?ti(k):[]})))},Ti=d(X)`
28
28
  margin-top: 24px;
29
29
  gap: 12px;
30
- `,Ii=({createAction:o})=>{const{currentModal:i,setCurrentModal:a}=Z(),n=i===B.Action,{formData:l,formErrors:r,handleFormChange:s,resetFormData:c,validateForm:d}=W(),[u,m]=t(void 0),h=()=>{c(),m(void 0),a("")},g=()=>{if(!d({withAlert:!0,alertTitle:Q.Create}))return null;o(l),h()};return q({key:"Enter",active:n},()=>g()),e.createElement(ee,{isOpen:n,onClose:h,header:{title:"Add Action"},actionComponent:e.createElement(te,{buttons:[{variant:"primary",label:"DONE",onClick:g,disabled:!u}]})},e.createElement(oe,null,e.createElement(E,{title:"Select Action",description:"Select an action to modify telemetry data before it`s sent to destinations. Choose an action type and configure its details."}),e.createElement(Ti,null,e.createElement(ie,{type:H.Warning,message:ae.DEFINED_FOR_ALL_STREAMS(p.ACTIONS)}),e.createElement(ne,{options:_,selectedOption:u,onOptionSelect:e=>{return t=e,c(),s("type",t?.type||""),void m(t);var t},autoFocus:!u?.type})),u?.type?e.createElement("div",null,e.createElement(le,{margin:"16px 0"}),e.createElement(ki,{action:u,formData:l,formErrors:r,handleFormChange:s})):null))},Oi=e=>{const{type:t,fields:{collectContainerAttributes:o,collectReplicaSetAttributes:i,collectWorkloadId:a,collectClusterId:n,labelsAttributes:l,annotationsAttributes:r,clusterAttributes:s,overwriteExistingValues:c,attributeNamesToDelete:d,renames:u,piiCategories:p,fallbackSamplingRatio:m,samplingPercentage:y,endpointsFilters:v,attributeFilters:f,servicesNameFilters:b}}=e;let x="";if(t===h.K8sAttributes&&(o&&(x+="Container Attributes, "),i&&(x+="ReplicaSet Attributes, "),a&&(x+="Workload ID, "),n&&(x+="Cluster ID, "),l?.forEach(({labelKey:e,attributeKey:t,from:o},i)=>{x+=`Label: ${e} ${t} ${o||g.Pod} `,i===l.length-1&&(x+=", ")}),r?.forEach(({annotationKey:e,attributeKey:t,from:o},i)=>{x+=`Annotation: ${e} ${t} ${o||g.Pod} `,i===r.length-1&&(x+=", ")})),t===h.AddClusterInfo&&(x+=`Overwrite Existing: ${c}\n`,s?.forEach(({attributeName:e,attributeStringValue:t},o)=>{x+=`${e}: ${t}`,o<s.length-1&&(x+=", ")})),t===h.DeleteAttributes&&d?.forEach((e,t)=>{x+=e,t<d.length-1&&(x+=", ")}),t===h.RenameAttributes){const e=Object.entries(u||{});e.forEach(([t,o],i)=>{x+=`${t}: ${o}`,i<e.length-1&&(x+=", ")})}return t===h.PiiMasking&&p?.forEach((e,t)=>{x+=e,t<p.length-1&&(x+=", ")}),t===h.ErrorSampler&&(x+=String(m)),t===h.ProbabilisticSampler&&(x+=String(y),x+="%"),t===h.LatencySampler&&v?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:o,fallbackSamplingRatio:i},a)=>{x+=`Endpoint${v.length>1?` #${a+1}`:""}=${e}${t}\n`,x+=` Latency=${o}`,x+=` Sampling=${i}`,a<v.length-1&&(x+=", ")}),t===h.ServiceNameSampler&&b?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:o})=>{x+=`Service Name: ${e}, `,x+=`Sampling Ratio: ${t}, `,x+=`Fallback Sampling Ratio: ${o}\n`}),t===h.SpanAttributeSampler&&f?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:o})=>{x+=`Service Name: ${e}, `,x+=`Attribute Key: ${t}, `,x+=`Fallback Sampling Ratio: ${o}\n`}),x},Ei=({conditions:t,id:o})=>{const{errors:i,warnings:a,disableds:n,hasLoadings:r}=l(()=>re(t),[t]),s=i.length>0?i:a.length>0?a:n.length>0?n:[];if(s.length>0)return e.createElement("div",{style:{lineHeight:1}},e.createElement(Ai,{conditions:s,id:o}));const c=r?pe.Loading:H.Success;return e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:c,title:c,withBorder:!0,withIcon:!0}))},Ai=({conditions:t,id:o})=>{const i=I.useTheme();return e.createElement(ce,null,de(t).map(({status:t,type:a,reason:n,message:l,lastTransitionTime:r},s)=>{"loading"!==t&&"disabled"!==t||(t=H.Info);const c=me(t,i);return e.createElement(ue,{key:`condition-${o}-${t}-${a}-${s}`,titleIcon:c,title:a,text:l||n||"",timestamp:r},e.createElement(se,{status:t,title:n||a,withBorder:!0,withIcon:!0}))}))},Mi=({instrumentationRules:e,sources:t,actions:o,destinations:i,searchText:a,selectedCategory:n})=>{const l=a?e.filter(e=>e.type?.toLowerCase().includes(a)||e.ruleName?.toLowerCase().includes(a)):e,r=a?t.filter(e=>e.name?.toLowerCase().includes(a)||e.otelServiceName?.toLowerCase().includes(a)||e.namespace?.toLowerCase().includes(a)):t,s=a?o.filter(e=>e.type?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):o,c=a?i.filter(e=>e.destinationType.displayName?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):i,d=[{category:B.Source,label:"Sources",count:r.length,entities:[]},{category:B.Action,label:"Actions",count:s.length,entities:[]},{category:B.Destination,label:"Destinations",count:c.length,entities:[]},{category:B.InstrumentationRule,label:"Instrumentation Rules",count:l.length,entities:[]}];d.unshift({category:"all",label:"All",count:l.length+r.length+s.length+c.length,entities:[]});const u=d.filter(({count:e,category:t})=>!!e&&"all"!==t&&["all",t].includes(n)).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}},Fi=[{key:"icon",title:""},{key:"name",title:p.NAME,sortable:!0},{key:"signals",title:p.MONITORS},{key:"active-status",title:p.STATUS},{key:"conditions",title:"Conditions"},{key:"type",title:p.TYPE,sortable:!0},{key:"spec",title:"Spec",sortable:!0},{key:"notes",title:p.NOTES,sortable:!0}],Ri=({maxHeight:t,maxWidth:o})=>{const i=I.useTheme(),a=he(),{actions:n,actionsLoading:r}=U(),{setDrawerType:s,setDrawerEntityId:c}=P(),d=l(()=>Mi({instrumentationRules:[],sources:[],actions:ge(n,a),destinations:[],searchText:a.searchText,selectedCategory:B.Action}).searchResults.find(({category:e})=>e===B.Action)?.entities||[],[n,a]),u=l(()=>d.map(t=>{const{hasErrors:o,hasWarnings:a,hasDisableds:n}=re(t.conditions||[]);return{status:o?H.Error:a?H.Warning:void 0,faded:n,onClick:()=>{s(B.Action),c(t.id)},cells:[{columnKey:"icon",component:()=>e.createElement(ye,{icon:G(t.type)})},{columnKey:"name",value:ve(t,B.Action,{prioritizeDisplayName:!0})},{columnKey:"type",value:t.type,textColor:i.text.info},{columnKey:"notes",value:t.notes,textColor:i.text.info,withTooltip:!0},{columnKey:"spec",value:Oi(t),textColor:i.text.info,withTooltip:!0},{columnKey:"signals",component:()=>e.createElement(fe,{withLabels:!0,monitors:t.signals||[]})},{columnKey:"conditions",component:()=>e.createElement(Ei,{conditions:t.conditions||[],id:t.id})},{columnKey:"active-status",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:t.disabled?H.Error:H.Success,title:t.disabled?p.DISABLED:p.ENABLED,withIcon:!0,withBorder:!0}))}]}}),[d]),{badge:m,badgeTooltip:h}=l(()=>d.length!==n.length?{badge:`${d.length}/${n.length}`,badgeTooltip:p.FILTERED_COUNT_TOOLTIP}:{badge:n.length,badgeTooltip:void 0},[d,n]);return e.createElement(be,{$maxWidth:o},e.createElement(xe,null,e.createElement(Ce,{icon:ke(B.Action),title:p.ACTIONS,badge:m,badgeTooltip:h,loading:r})),e.createElement(we,{$maxHeight:t},e.createElement(Se,{columns:Fi,rows:u})),!d.length&&e.createElement($e,{style:{marginTop:"2rem"}},e.createElement(De,null)))},Li=d(X)`
30
+ `,Ii=({createAction:o})=>{const{currentModal:i,setCurrentModal:a}=Z(),n=i===B.Action,{formData:l,formErrors:r,handleFormChange:s,resetFormData:c,validateForm:d}=W(),[u,m]=t(void 0),h=()=>{c(),m(void 0),a("")},g=()=>{if(!d({withAlert:!0,alertTitle:Q.Create}))return null;o(l),h()};return q({key:"Enter",active:n},()=>g()),e.createElement(ee,{isOpen:n,onClose:h,header:{title:"Add Action"},actionComponent:e.createElement(te,{buttons:[{variant:"primary",label:"DONE",onClick:g,disabled:!u}]})},e.createElement(oe,null,e.createElement(O,{title:"Select Action",description:"Select an action to modify telemetry data before it`s sent to destinations. Choose an action type and configure its details."}),e.createElement(Ti,null,e.createElement(ie,{type:H.Warning,message:ae.DEFINED_FOR_ALL_STREAMS(p.ACTIONS)}),e.createElement(ne,{options:_,selectedOption:u,onOptionSelect:e=>{return t=e,c(),s("type",t?.type||""),void m(t);var t},autoFocus:!u?.type})),u?.type?e.createElement("div",null,e.createElement(le,{margin:"16px 0"}),e.createElement(ki,{action:u,formData:l,formErrors:r,handleFormChange:s})):null))},Ei=e=>{const{type:t,fields:{collectContainerAttributes:o,collectReplicaSetAttributes:i,collectWorkloadId:a,collectClusterId:n,labelsAttributes:l,annotationsAttributes:r,clusterAttributes:s,overwriteExistingValues:c,attributeNamesToDelete:d,renames:u,piiCategories:p,fallbackSamplingRatio:m,samplingPercentage:y,endpointsFilters:v,attributeFilters:f,servicesNameFilters:b}}=e;let x="";if(t===h.K8sAttributes&&(o&&(x+="Container Attributes, "),i&&(x+="ReplicaSet Attributes, "),a&&(x+="Workload ID, "),n&&(x+="Cluster ID, "),l?.forEach(({labelKey:e,attributeKey:t,from:o},i)=>{x+=`Label: ${e} ${t} ${o||g.Pod} `,i===l.length-1&&(x+=", ")}),r?.forEach(({annotationKey:e,attributeKey:t,from:o},i)=>{x+=`Annotation: ${e} ${t} ${o||g.Pod} `,i===r.length-1&&(x+=", ")})),t===h.AddClusterInfo&&(x+=`Overwrite Existing: ${c}\n`,s?.forEach(({attributeName:e,attributeStringValue:t},o)=>{x+=`${e}: ${t}`,o<s.length-1&&(x+=", ")})),t===h.DeleteAttributes&&d?.forEach((e,t)=>{x+=e,t<d.length-1&&(x+=", ")}),t===h.RenameAttributes){const e=Object.entries(u||{});e.forEach(([t,o],i)=>{x+=`${t}: ${o}`,i<e.length-1&&(x+=", ")})}return t===h.PiiMasking&&p?.forEach((e,t)=>{x+=e,t<p.length-1&&(x+=", ")}),t===h.ErrorSampler&&(x+=String(m)),t===h.ProbabilisticSampler&&(x+=String(y),x+="%"),t===h.LatencySampler&&v?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:o,fallbackSamplingRatio:i},a)=>{x+=`Endpoint${v.length>1?` #${a+1}`:""}=${e}${t}\n`,x+=` Latency=${o}`,x+=` Sampling=${i}`,a<v.length-1&&(x+=", ")}),t===h.ServiceNameSampler&&b?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:o})=>{x+=`Service Name: ${e}, `,x+=`Sampling Ratio: ${t}, `,x+=`Fallback Sampling Ratio: ${o}\n`}),t===h.SpanAttributeSampler&&f?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:o})=>{x+=`Service Name: ${e}, `,x+=`Attribute Key: ${t}, `,x+=`Fallback Sampling Ratio: ${o}\n`}),x},Oi=({conditions:t,id:o})=>{const{errors:i,warnings:a,disableds:n,hasLoadings:r}=l(()=>re(t),[t]),s=i.length>0?i:a.length>0?a:n.length>0?n:[];if(s.length>0)return e.createElement("div",{style:{lineHeight:1}},e.createElement(Ai,{conditions:s,id:o}));const c=r?pe.Loading:H.Success;return e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:c,title:c,withBorder:!0,withIcon:!0}))},Ai=({conditions:t,id:o})=>{const i=I.useTheme();return e.createElement(ce,null,de(t).map(({status:t,type:a,reason:n,message:l,lastTransitionTime:r},s)=>{"loading"!==t&&"disabled"!==t||(t=H.Info);const c=me(t,i);return e.createElement(ue,{key:`condition-${o}-${t}-${a}-${s}`,titleIcon:c,title:a,text:l||n||"",timestamp:r},e.createElement(se,{status:t,title:n||a,withBorder:!0,withIcon:!0}))}))},Mi=({instrumentationRules:e,sources:t,actions:o,destinations:i,searchText:a,selectedCategory:n})=>{const l=a?e.filter(e=>e.type?.toLowerCase().includes(a)||e.ruleName?.toLowerCase().includes(a)):e,r=a?t.filter(e=>e.name?.toLowerCase().includes(a)||e.otelServiceName?.toLowerCase().includes(a)||e.namespace?.toLowerCase().includes(a)):t,s=a?o.filter(e=>e.type?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):o,c=a?i.filter(e=>e.destinationType.displayName?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):i,d=[{category:B.Source,label:"Sources",count:r.length,entities:[]},{category:B.Action,label:"Actions",count:s.length,entities:[]},{category:B.Destination,label:"Destinations",count:c.length,entities:[]},{category:B.InstrumentationRule,label:"Instrumentation Rules",count:l.length,entities:[]}];d.unshift({category:"all",label:"All",count:l.length+r.length+s.length+c.length,entities:[]});const u=d.filter(({count:e,category:t})=>!!e&&"all"!==t&&["all",t].includes(n)).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}},Fi=[{key:"icon",title:""},{key:"name",title:p.NAME,sortable:!0},{key:"signals",title:p.MONITORS},{key:"active-status",title:p.STATUS},{key:"conditions",title:"Conditions"},{key:"type",title:p.TYPE,sortable:!0},{key:"spec",title:"Spec",sortable:!0},{key:"notes",title:p.NOTES,sortable:!0}],Ri=({maxHeight:t,maxWidth:o})=>{const i=I.useTheme(),a=he(),{actions:n,actionsLoading:r}=U(),{setDrawerType:s,setDrawerEntityId:c}=P(),d=l(()=>Mi({instrumentationRules:[],sources:[],actions:ge(n,a),destinations:[],searchText:a.searchText,selectedCategory:B.Action}).searchResults.find(({category:e})=>e===B.Action)?.entities||[],[n,a]),u=l(()=>d.map(t=>{const{hasErrors:o,hasWarnings:a,hasDisableds:n}=re(t.conditions||[]);return{status:o?H.Error:a?H.Warning:void 0,faded:n,onClick:()=>{s(B.Action),c(t.id)},cells:[{columnKey:"icon",component:()=>e.createElement(ye,{icon:G(t.type)})},{columnKey:"name",value:ve(t,B.Action,{prioritizeDisplayName:!0})},{columnKey:"type",value:t.type,textColor:i.text.info},{columnKey:"notes",value:t.notes,textColor:i.text.info,withTooltip:!0},{columnKey:"spec",value:Ei(t),textColor:i.text.info,withTooltip:!0},{columnKey:"signals",component:()=>e.createElement(fe,{withLabels:!0,monitors:t.signals||[]})},{columnKey:"conditions",component:()=>e.createElement(Oi,{conditions:t.conditions||[],id:t.id})},{columnKey:"active-status",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:t.disabled?H.Error:H.Success,title:t.disabled?p.DISABLED:p.ENABLED,withIcon:!0,withBorder:!0}))}]}}),[d]),{badge:m,badgeTooltip:h}=l(()=>d.length!==n.length?{badge:`${d.length}/${n.length}`,badgeTooltip:p.FILTERED_COUNT_TOOLTIP}:{badge:n.length,badgeTooltip:void 0},[d,n]);return e.createElement(be,{$maxWidth:o},e.createElement(xe,null,e.createElement(Ce,{icon:ke(B.Action),title:p.ACTIONS,badge:m,badgeTooltip:h,loading:r})),e.createElement(we,{$maxHeight:t},e.createElement(Se,{columns:Fi,rows:u})),!d.length&&e.createElement($e,{style:{marginTop:"2rem"}},e.createElement(De,null)))},Li=d(X)`
31
31
  // width: 100vw;
32
32
  // height: 100vh;
33
33
  gap: 64px;
@@ -63,7 +63,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
63
63
  &:hover {
64
64
  background-color: ${({theme:e})=>e.colors.dropdown_bg_2+I.opacity.hex["030"]};
65
65
  }
66
- `,zi=({entityType:t,description:o})=>{const{setCurrentModal:i}=Z(),{isThisPending:a}=R(),n=a({entityType:t});return e.createElement(Vi,{onClick:()=>i(t)},e.createElement(ce,{$gap:4},e.createElement(No,null),n?e.createElement(Oe,{size:14,weight:600,family:"secondary"},"Adding ",t):e.createElement(T,{size:14,weight:600,family:"secondary",decoration:"underline"},"Add ",t)),e.createElement(T,{size:12,align:"center"},n?"Just a few more seconds...":o))},Bi=d.div`
66
+ `,zi=({entityType:t,description:o})=>{const{setCurrentModal:i}=Z(),{isThisPending:a}=R(),n=a({entityType:t});return e.createElement(Vi,{onClick:()=>i(t)},e.createElement(ce,{$gap:4},e.createElement(No,null),n?e.createElement(Ee,{size:14,weight:600,family:"secondary"},"Adding ",t):e.createElement(T,{size:14,weight:600,family:"secondary",decoration:"underline"},"Add ",t)),e.createElement(T,{size:12,align:"center"},n?"Just a few more seconds...":o))},Bi=d.div`
67
67
  position: relative;
68
68
  width: 100%;
69
69
  padding: 12px 0;
@@ -73,7 +73,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
73
73
  border-bottom: 1px solid ${({theme:e})=>e.colors.border};
74
74
  `,Hi=d(ce)`
75
75
  margin-left: ${({$marginLeft:e})=>e};
76
- `,Ui=d(Ee)`
76
+ `,Ui=d(Oe)`
77
77
  width: 24px;
78
78
  height: 24px;
79
79
  padding: 0;
@@ -101,7 +101,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
101
101
  align-items: center;
102
102
  justify-content: center;
103
103
  white-space: nowrap;
104
- `,Ji=({entityId:t,entityType:o,status:i,faded:a,title:n,subTitle:l,label:r,icon:s,icons:c,iconSrc:d,iconSrcs:u,monitors:p,isActive:m,raw:h})=>{const g=I.useTheme(),y=o===B.Source,v="boolean"==typeof m,{setDrawerType:f,setDrawerEntityId:b}=P(),{isThisPending:x}=R(),C=x({entityType:o,entityId:t}),{selectedSources:k,setSelectedSources:w}=Ae(),S={...k},{namespace:$,name:D,kind:N}=h;y&&!S[$]&&(S[$]=[]);const T=y?S[$].findIndex(e=>e.name===D&&e.kind===N):-1;return e.createElement(Fe,{"data-id":JSON.stringify(t),title:n,subTitle:l,onClick:()=>{f(o),b(t)},renderActions:()=>{const t=y&&(!h.conditions?.length||h.conditions?.some(({status:e})=>"loading"===e)),o=v&&!m?me(H.Info,g):i?me(i,g):void 0,a=C||t?e.createElement(Re,{scale:.8}):o?e.createElement(o,{size:14}):null;return r?e.createElement(Gi,{$isError:i===H.Error},e.createElement(ue,{text:"Heads up! The data-flow metrics you see are calculated over 10-second intervals."},r),a):a||null},iconProps:{icon:s,icons:c,iconSrc:d,iconSrcs:u},visualProps:{status:i,faded:a||v&&!m,monitors:p||void 0},checkboxProps:{withCheckbox:y,isChecked:-1!==T,onCheckboxChange:()=>{-1===T?S[$].push(h):S[$].splice(T,1),w(S)},isCheckboxDisabled:C}})},Yi=d.div`
104
+ `,Ji=({entityId:t,entityType:o,status:i,faded:a,title:n,subTitle:l,label:r,icon:s,icons:c,iconSrc:d,iconSrcs:u,monitors:p,isActive:m,raw:h})=>{const g=I.useTheme(),y=o===B.Source,v="boolean"==typeof m,{setDrawerType:f,setDrawerEntityId:b}=P(),{isThisPending:x}=R(),C=x({entityType:o,entityId:t}),{selectedSources:k,setSelectedSources:w}=Ae(),S={...k},{namespace:$,name:D,kind:N}=h;y&&!S[$]&&(S[$]=[]);const T=y?S[$].findIndex(e=>e.name===D&&e.kind===N):-1;return e.createElement(Fe,{"data-id":o===B.Source?`${t.namespace}-${t.name}-${t.kind}`:t,title:n,subTitle:l,onClick:()=>{f(o),b(t)},renderActions:()=>{const t=y&&(!h.conditions?.length||h.conditions?.some(({status:e})=>"loading"===e)),o=v&&!m?me(H.Info,g):i?me(i,g):void 0,a=C||t?e.createElement(Re,{scale:.8}):o?e.createElement(o,{size:14}):null;return r?e.createElement(Gi,{$isError:i===H.Error},e.createElement(ue,{text:"Heads up! The data-flow metrics you see are calculated over 10-second intervals."},r),a):a||null},iconProps:{icon:s,icons:c,iconSrc:d,iconSrcs:u},visualProps:{status:i,faded:a||v&&!m,monitors:p||void 0},checkboxProps:{withCheckbox:y,isChecked:-1!==T,onCheckboxChange:()=>{-1===T?S[$].push(h):S[$].splice(T,1),w(S)},isCheckboxDisabled:C}})},Yi=d.div`
105
105
  height: calc(${({$height:e})=>e}px - 24px);
106
106
  width: calc(100% - 24px);
107
107
  padding: 12px;
@@ -162,12 +162,12 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
162
162
  padding: 12px;
163
163
  `,ha=d.div`
164
164
  padding: 12px 6px 6px 6px;
165
- `,ga=d(Ee)`
165
+ `,ga=d(Oe)`
166
166
  font-size: 14px;
167
167
  ${({$color:e})=>`color: ${e};`}
168
168
  `,ya=d.div`
169
169
  margin-left: auto;
170
- `,va=e=>{let t=0;return Object.values(e).forEach(e=>{e&&Array.isArray(e)&&e.length>0&&(t+=e.length)}),e.onlyErrors&&t++,e.searchText&&t++,t},fa=()=>{const i=I.useTheme(),{isVm:n}=He(),{namespaces:r,sources:s}=U(),{selectedStreamName:c}=Ue(),{getItemSS:d,setItemSS:u,removeItemSS:p}=st(),{popupRef:m,popupOpen:h,setPopupOpen:g,popupPosition:y,handlePosition:v}=Xe(),{namespaces:f,kinds:b,monitors:x,languages:C,conditions:k,errors:w,onlyErrors:$,setAll:D,clearAll:N,getEmptyState:T}=he(),O=l(()=>Ge(s,c),[s,c]),[E,A]=t({namespaces:f,kinds:b,monitors:x,languages:C,conditions:k,errors:w,onlyErrors:$}),[M,F]=t(va(E));o(()=>{const e=d(rt.OVERVIEW_FILTERS,T());D(e)},[]),o(()=>{if(!h){const e={namespaces:f,kinds:b,monitors:x,languages:C,conditions:k,errors:w,onlyErrors:$};A(e),F(va(e))}},[h,f,b,x,C,k,w,$]);const R=()=>{g(!1)},L=a(null);return ot(L,R),q({key:"Escape",active:h},R),e.createElement(ia,{ref:L},e.createElement(et,{label:"Filters",icon:Io,badgeLabel:M,badgeFilled:!!M,withBorder:!0,color:"transparent",onClick:()=>{v(0,50),g(!0)}}),e.createElement(Ze,{ref:m,isOpen:h,top:y.top,left:y.left,width:"420px",footer:e.createElement(ce,null,e.createElement(ga,{variant:"primary",onClick:()=>{u(rt.OVERVIEW_FILTERS,E),D(E),F(va(E)),g(!1)}},"Apply"),e.createElement(ga,{variant:"secondary",onClick:R},"Cancel"),e.createElement(ya,null,e.createElement(ga,{variant:"tertiary",onClick:()=>{p(rt.OVERVIEW_FILTERS),N(),A(T()),F(0),g(!1)},$color:i.text.error},"Reset")))},e.createElement(ma,null,!n&&e.createElement(ua,{namespaces:r,value:E.namespaces,onSelect:e=>A(t=>({...t,namespaces:[...t.namespaces||[],e]})),onDeselect:e=>A(t=>({...t,namespaces:(t.namespaces||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(pa,{sources:O,value:E.kinds,onSelect:e=>A(t=>({...t,kinds:[...t.kinds||[],e]})),onDeselect:e=>A(t=>({...t,kinds:(t.kinds||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(ca,{sources:O,value:E.languages,onSelect:e=>A(t=>({...t,languages:[...t.languages||[],e]})),onDeselect:e=>A(t=>({...t,languages:(t.languages||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(da,{value:E.monitors,onSelect:e=>A(t=>({...t,monitors:[...t.monitors||[],e]})),onDeselect:e=>A(t=>({...t,monitors:(t.monitors||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(ra,{sources:O,value:E.conditions,onSelect:e=>A(t=>({...t,conditions:[...t.conditions||[],e]})),onDeselect:e=>A(t=>({...t,conditions:(t.conditions||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(ha,null,e.createElement(S,{title:"Show only sources with errors",initialValue:E.onlyErrors,onChange:e=>A(t=>({...t,errors:[],onlyErrors:e}))})),e.createElement(sa,{sources:O,value:E.errors,onSelect:e=>A(t=>({...t,errors:[...t.errors||[],e]})),onDeselect:e=>A(t=>({...t,errors:(t.errors||[]).filter(t=>t.id!==e.id)})),disabled:!E.onlyErrors,showSearch:!0,required:!0,isMulti:!0}))))},ba=d.div`
170
+ `,va=e=>{let t=0;return Object.values(e).forEach(e=>{e&&Array.isArray(e)&&e.length>0&&(t+=e.length)}),e.onlyErrors&&t++,e.searchText&&t++,t},fa=()=>{const i=I.useTheme(),{isVm:n}=He(),{namespaces:r,sources:s}=U(),{selectedStreamName:c}=Ue(),{getItemSS:d,setItemSS:u,removeItemSS:p}=st(),{popupRef:m,popupOpen:h,setPopupOpen:g,popupPosition:y,handlePosition:v}=Xe(),{namespaces:f,kinds:b,monitors:x,languages:C,conditions:k,errors:w,onlyErrors:$,setAll:D,clearAll:N,getEmptyState:T}=he(),E=l(()=>Ge(s,c),[s,c]),[O,A]=t({namespaces:f,kinds:b,monitors:x,languages:C,conditions:k,errors:w,onlyErrors:$}),[M,F]=t(va(O));o(()=>{const e=d(rt.OVERVIEW_FILTERS,T());D(e)},[]),o(()=>{if(!h){const e={namespaces:f,kinds:b,monitors:x,languages:C,conditions:k,errors:w,onlyErrors:$};A(e),F(va(e))}},[h,f,b,x,C,k,w,$]);const R=()=>{g(!1)},L=a(null);return ot(L,R),q({key:"Escape",active:h},R),e.createElement(ia,{ref:L},e.createElement(et,{label:"Filters",icon:Io,badgeLabel:M,badgeFilled:!!M,withBorder:!0,color:"transparent",onClick:()=>{v(0,50),g(!0)}}),e.createElement(Ze,{ref:m,isOpen:h,top:y.top,left:y.left,width:"420px",footer:e.createElement(ce,null,e.createElement(ga,{variant:"primary",onClick:()=>{u(rt.OVERVIEW_FILTERS,O),D(O),F(va(O)),g(!1)}},"Apply"),e.createElement(ga,{variant:"secondary",onClick:R},"Cancel"),e.createElement(ya,null,e.createElement(ga,{variant:"tertiary",onClick:()=>{p(rt.OVERVIEW_FILTERS),N(),A(T()),F(0),g(!1)},$color:i.text.error},"Reset")))},e.createElement(ma,null,!n&&e.createElement(ua,{namespaces:r,value:O.namespaces,onSelect:e=>A(t=>({...t,namespaces:[...t.namespaces||[],e]})),onDeselect:e=>A(t=>({...t,namespaces:(t.namespaces||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(pa,{sources:E,value:O.kinds,onSelect:e=>A(t=>({...t,kinds:[...t.kinds||[],e]})),onDeselect:e=>A(t=>({...t,kinds:(t.kinds||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(ca,{sources:E,value:O.languages,onSelect:e=>A(t=>({...t,languages:[...t.languages||[],e]})),onDeselect:e=>A(t=>({...t,languages:(t.languages||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(da,{value:O.monitors,onSelect:e=>A(t=>({...t,monitors:[...t.monitors||[],e]})),onDeselect:e=>A(t=>({...t,monitors:(t.monitors||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(ra,{sources:E,value:O.conditions,onSelect:e=>A(t=>({...t,conditions:[...t.conditions||[],e]})),onDeselect:e=>A(t=>({...t,conditions:(t.conditions||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(ha,null,e.createElement(S,{title:"Show only sources with errors",initialValue:O.onlyErrors,onChange:e=>A(t=>({...t,errors:[],onlyErrors:e}))})),e.createElement(sa,{sources:E,value:O.errors,onSelect:e=>A(t=>({...t,errors:[...t.errors||[],e]})),onDeselect:e=>A(t=>({...t,errors:(t.errors||[]).filter(t=>t.id!==e.id)})),disabled:!O.onlyErrors,showSearch:!0,required:!0,isMulti:!0}))))},ba=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 o,forwardRef as i,useRef as a,useImperative
178
178
  max-height: calc(100vh - 220px);
179
179
  overflow: overlay;
180
180
  overflow-y: auto;
181
- `,ka=({isOpen:o,onClose:i,dataStreamName:n,updateDataStream:r})=>{const{dataStreams:c}=Ue(),d=a(null),[u,p]=t(!1),{formData:m,handleFormChange:h,formErrors:g,validateForm:y,resetFormData:v,loadFormWithDrawerItem:f}=ct({name:n}),b=l(()=>{if(!o)return v();const e=c?.find(e=>e.name===n);return e?f(e):v(),e},[o,c,n]),x=s((e,t)=>{h(e,t),p(!0)},[h]);return b?e.createElement(wi,{ref:d,title:b.name,icons:[Oo],hideEditTitleFromEdit:!0,isEdit:!0,isFormDirty:u,onSave:()=>{y({withAlert:!0,alertTitle:Q.Update})&&(r(n,m),p(!1),i())},onCancel:()=>{v(),p(!1),i()}},e.createElement(Ca,null,e.createElement(xa,{formData:m,handleFormChange:x,formErrors:g}))):null},wa=d.div`
181
+ `,ka=({isOpen:o,onClose:i,dataStreamName:n,updateDataStream:r})=>{const{dataStreams:c}=Ue(),d=a(null),[u,p]=t(!1),{formData:m,handleFormChange:h,formErrors:g,validateForm:y,resetFormData:v,loadFormWithDrawerItem:f}=ct({name:n}),b=l(()=>{if(!o)return v();const e=c?.find(e=>e.name===n);return e?f(e):v(),e},[o,c,n]),x=s((e,t)=>{h(e,t),p(!0)},[h]);return b?e.createElement(wi,{ref:d,title:b.name,icons:[Eo],hideEditTitleFromEdit:!0,isEdit:!0,isFormDirty:u,onSave:()=>{y({withAlert:!0,alertTitle:Q.Update})&&(r(n,m),p(!1),i())},onCancel:()=>{v(),p(!1),i()}},e.createElement(Ca,null,e.createElement(xa,{formData:m,handleFormChange:x,formErrors:g}))):null},wa=d.div`
182
182
  position: relative;
183
183
  `,Sa=d(ce)`
184
184
  border: 1px solid ${({theme:e})=>e.colors.border};
@@ -196,15 +196,15 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
196
196
  width: 100%;
197
197
  `,Ta=d.div`
198
198
  width: 100%;
199
- `,Ia=({onClickNewDataStream:o,updateDataStream:i,deleteDataStream:a})=>{const n=I.useTheme(),{popupRef:r,popupOpen:s,setPopupOpen:c,popupPosition:d,handlePosition:u}=Xe(),{dataStreams:p,selectedStreamName:m,setSelectedStreamName:h}=Ue(),{setFetchedAllNamespaces:g,setAvailableSources:y,setConfiguredSources:v,setConfiguredFutureApps:f}=dt(),[b,C]=t(""),[k,w]=t(""),[S,$]=t(""),D=()=>{g(!1),y({}),v({}),f({})},N=l(()=>p.filter(({name:e})=>!S||e.toLowerCase().includes(S.toLowerCase())).map(({name:t})=>e.createElement(Na,{key:`stream-${t}`},e.createElement(Ta,null,e.createElement(et,{label:t,isSelected:m===t,onClick:()=>{D(),h(t),c(!1)},color:"transparent",style:{width:"100%",justifyContent:"flex-start"}})),t!==ut&&e.createElement(pt,{onClick:()=>w(t),tooltip:K.DELETE},e.createElement($o,null)),e.createElement(pt,{onClick:()=>C(t),tooltip:K.EDIT},e.createElement(So,null)))),[p,m,S]);return e.createElement(e.Fragment,null,e.createElement(wa,null,e.createElement(Sa,{$gap:0},e.createElement(Ee,{variant:"tertiary",onClick:()=>{u(0,50),c(e=>!e)}},e.createElement(Oo,{fill:n.text.info}),e.createElement($a,null,"Data Stream: ",m),e.createElement(mt,{extend:s}),e.createElement(Te,{label:p.length})),e.createElement(le,{orientation:"vertical",length:"32px",thickness:2,margin:"0"}),e.createElement(ht,{onClick:()=>{D(),o()},label:K.NEW})),e.createElement(Ze,{ref:r,isOpen:s,top:d.top,left:d.left,header:e.createElement(x,{placeholder:"Search...",icon:To,value:S,onChange:e=>$(e.target.value)})},e.createElement(Da,null,N))),e.createElement(V,{isOpen:""!==k,name:k,onApprove:()=>{a(k),w("")},onDeny:()=>{w("")}}),e.createElement(ka,{isOpen:""!==b,onClose:()=>{C("")},dataStreamName:b,updateDataStream:i}))},Oa=d.div`
199
+ `,Ia=({onClickNewDataStream:o,updateDataStream:i,deleteDataStream:a})=>{const n=I.useTheme(),{popupRef:r,popupOpen:s,setPopupOpen:c,popupPosition:d,handlePosition:u}=Xe(),{dataStreams:p,selectedStreamName:m,setSelectedStreamName:h}=Ue(),{setFetchedAllNamespaces:g,setAvailableSources:y,setConfiguredSources:v,setConfiguredFutureApps:f}=dt(),[b,C]=t(""),[k,w]=t(""),[S,$]=t(""),D=()=>{g(!1),y({}),v({}),f({})},N=l(()=>p.filter(({name:e})=>!S||e.toLowerCase().includes(S.toLowerCase())).map(({name:t})=>e.createElement(Na,{key:`stream-${t}`},e.createElement(Ta,null,e.createElement(et,{label:t,isSelected:m===t,onClick:()=>{D(),h(t),c(!1)},color:"transparent",style:{width:"100%",justifyContent:"flex-start"}})),t!==ut&&e.createElement(pt,{onClick:()=>w(t),tooltip:K.DELETE},e.createElement($o,null)),e.createElement(pt,{onClick:()=>C(t),tooltip:K.EDIT},e.createElement(So,null)))),[p,m,S]);return e.createElement(e.Fragment,null,e.createElement(wa,null,e.createElement(Sa,{$gap:0},e.createElement(Oe,{variant:"tertiary",onClick:()=>{u(0,50),c(e=>!e)}},e.createElement(Eo,{fill:n.text.info}),e.createElement($a,null,"Data Stream: ",m),e.createElement(mt,{extend:s}),e.createElement(Te,{label:p.length})),e.createElement(le,{orientation:"vertical",length:"32px",thickness:2,margin:"0"}),e.createElement(ht,{onClick:()=>{D(),o()},label:K.NEW})),e.createElement(Ze,{ref:r,isOpen:s,top:d.top,left:d.left,header:e.createElement(x,{placeholder:"Search...",icon:To,value:S,onChange:e=>$(e.target.value)})},e.createElement(Da,null,N))),e.createElement(V,{isOpen:""!==k,name:k,onApprove:()=>{a(k),w("")},onDeny:()=>{w("")}}),e.createElement(ka,{isOpen:""!==b,onClose:()=>{C("")},dataStreamName:b,updateDataStream:i}))},Ea=d.div`
200
200
  display: flex;
201
201
  align-items: center;
202
202
  margin: 20px 0;
203
203
  padding: 0 16px;
204
204
  gap: 8px;
205
- `,Ea=d.div`
205
+ `,Oa=d.div`
206
206
  margin-left: auto;
207
- `,Aa=({addEntity:t,preventSearchPopup:o,onClickNewDataStream:i,updateDataStream:a,deleteDataStream:n})=>{const{setCurrentModal:l}=Z();return e.createElement(Oa,null,e.createElement(Ia,{onClickNewDataStream:i,updateDataStream:a,deleteDataStream:n}),e.createElement(la,{preventPopup:o}),e.createElement(fa,null),t&&e.createElement(Ea,null,e.createElement(ht,{"data-id":`add-${t}`,onClick:()=>l(t),label:`${K.ADD} ${it(t)}`,variant:"primary",textProps:{weight:900}})))},Ma=i(({isModal:t,onClickSummary:o},i)=>{const{selectedStreamName:a}=Ue(),{formData:l,handleFormChange:r,formErrors:s,validateForm:c}=ct({name:a});return n(i,()=>({validateForm:c,getFormValues:()=>l})),e.createElement(oe,{$isNotModal:!t},e.createElement(X,{$gap:24},o&&e.createElement(gt,{onClick:o}),e.createElement(E,{title:p.NAME_YOUR_STREAM,description:p.STREAM_DESCRIPTION}),e.createElement(xa,{formData:l,handleFormChange:r,formErrors:s})))});Ma.displayName=Ma.name;const Fa=({createDataStream:t})=>{const{currentModal:o,setCurrentModal:i}=Z(),{addDataStreams:n,setSelectedStreamName:l}=Ue(),r=o===yt.DataStream,s=()=>i(""),c=async()=>{if(d.current&&d.current.validateForm()){const e=d.current.getFormValues();t?t(e):(n([e]),l(e.name)),s()}},d=a(null);return q({key:"Enter",active:r},c),e.createElement(ee,{isOpen:r,onClose:s,header:{title:"Add Data Stream"},actionComponent:e.createElement(te,{buttons:[{label:"DONE",variant:"primary",onClick:c}]})},e.createElement(Ma,{ref:d,isModal:!0}))},Ra=e=>Object.keys(e).filter(t=>e[t]).join(", "),La=(e,t)=>{const{destinationType:o,disabled:i,exportedSignals:a}=e,n=[{title:p.TYPE,value:o.type},{type:m.ActiveStatus,title:p.STATUS,value:String(!i)},{type:m.Monitors,title:p.MONITORS,value:Ra(a)},{title:p.NAME,value:o.displayName}],l=vt(e,t),r=l.map(e=>({name:e.key,value:e.value}));return l.map(({key:e,name:o,value:i})=>{const{secret:l,componentProperties:s,hideFromReadData:c,customReadDataLabels:d}=t.find(t=>t.name===e)||{};if(!c?.length||!ft(c,Pe(a),r)){const{type:e}=bt(s,{type:""}),t=(l||"password"===e)&&i.length?new Array(10).fill("•").join(""):"";n.push({type:m.Divider}),d?.length?d.forEach(({condition:e,...t})=>{e==i&&n.push({title:t.title,value:t.value})}):n.push({title:o,value:t||i})}}),n},Pa=({signals:t,fields:o,onChange:i,formErrors:a})=>o?.map(n=>{const{componentType:l,renderCondition:r,...s}=n;if(r&&!ft(r,t,o))return null;switch(l){case N.Input:return e.createElement(x,{key:n.name,...s,onChange:e=>i(n.name,e.target.value),errorMessage:a[n.name]});case N.Dropdown:return e.createElement(at,{key:n.name,...s,showSearch:!0,value:{id:s.value||"",value:s.value||""},options:s.options||[],onSelect:e=>i(n.name,e.id),errorMessage:a[n.name]});case N.MultiInput:return e.createElement(D,{key:n.name,...s,value:"string"==typeof s.value?bt(s.value,[]):s.value,onChange:e=>i(n.name,JSON.stringify(e)),errorMessage:a[n.name]});case N.KeyValuePair:return e.createElement($,{key:n.name,...s,value:"string"==typeof s.value?bt(s.value,[]):s.value,onChange:e=>i(n.name,JSON.stringify(e)),errorMessage:a[n.name]});case N.TextArea:return e.createElement(F,{key:n.name,...s,onChange:e=>i(n.name,e.target.value),errorMessage:a[n.name]});case N.Checkbox:return e.createElement(v,{key:n.name,...s,value:"true"==s.value,onChange:e=>i(n.name,String(e)),errorMessage:a[n.name]});default:return null}}),qa=d(Ee)`
207
+ `,Aa=({addEntity:t,preventSearchPopup:o,onClickNewDataStream:i,updateDataStream:a,deleteDataStream:n})=>{const{setCurrentModal:l}=Z();return e.createElement(Ea,null,e.createElement(Ia,{onClickNewDataStream:i,updateDataStream:a,deleteDataStream:n}),e.createElement(la,{preventPopup:o}),e.createElement(fa,null),t&&e.createElement(Oa,null,e.createElement(ht,{"data-id":`add-${t}`,onClick:()=>l(t),label:`${K.ADD} ${it(t)}`,variant:"primary",textProps:{weight:900}})))},Ma=i(({isModal:t,onClickSummary:o},i)=>{const{selectedStreamName:a}=Ue(),{formData:l,handleFormChange:r,formErrors:s,validateForm:c}=ct({name:a});return n(i,()=>({validateForm:c,getFormValues:()=>l})),e.createElement(oe,{$isNotModal:!t},e.createElement(X,{$gap:24},o&&e.createElement(gt,{onClick:o}),e.createElement(O,{title:p.NAME_YOUR_STREAM,description:p.STREAM_DESCRIPTION}),e.createElement(xa,{formData:l,handleFormChange:r,formErrors:s})))});Ma.displayName=Ma.name;const Fa=({createDataStream:t})=>{const{currentModal:o,setCurrentModal:i}=Z(),{addDataStreams:n,setSelectedStreamName:l}=Ue(),r=o===yt.DataStream,s=()=>i(""),c=async()=>{if(d.current&&d.current.validateForm()){const e=d.current.getFormValues();t?t(e):(n([e]),l(e.name)),s()}},d=a(null);return q({key:"Enter",active:r},c),e.createElement(ee,{isOpen:r,onClose:s,header:{title:"Add Data Stream"},actionComponent:e.createElement(te,{buttons:[{label:"DONE",variant:"primary",onClick:c}]})},e.createElement(Ma,{ref:d,isModal:!0}))},Ra=e=>Object.keys(e).filter(t=>e[t]).join(", "),La=(e,t)=>{const{destinationType:o,disabled:i,exportedSignals:a}=e,n=[{title:p.TYPE,value:o.type},{type:m.ActiveStatus,title:p.STATUS,value:String(!i)},{type:m.Monitors,title:p.MONITORS,value:Ra(a)},{title:p.NAME,value:o.displayName}],l=vt(e,t),r=l.map(e=>({name:e.key,value:e.value}));return l.map(({key:e,name:o,value:i})=>{const{secret:l,componentProperties:s,hideFromReadData:c,customReadDataLabels:d}=t.find(t=>t.name===e)||{};if(!c?.length||!ft(c,Pe(a),r)){const{type:e}=bt(s,{type:""}),t=(l||"password"===e)&&i.length?new Array(10).fill("•").join(""):"";n.push({type:m.Divider}),d?.length?d.forEach(({condition:e,...t})=>{e==i&&n.push({title:t.title,value:t.value})}):n.push({title:o,value:t||i})}}),n},Pa=({signals:t,fields:o,onChange:i,formErrors:a})=>o?.map(n=>{const{componentType:l,renderCondition:r,...s}=n;if(r&&!ft(r,t,o))return null;switch(l){case N.Input:return e.createElement(x,{key:n.name,...s,onChange:e=>i(n.name,e.target.value),errorMessage:a[n.name]});case N.Dropdown:return e.createElement(at,{key:n.name,...s,showSearch:!0,value:{id:s.value||"",value:s.value||""},options:s.options||[],onSelect:e=>i(n.name,e.id),errorMessage:a[n.name]});case N.MultiInput:return e.createElement(D,{key:n.name,...s,value:"string"==typeof s.value?bt(s.value,[]):s.value,onChange:e=>i(n.name,JSON.stringify(e)),errorMessage:a[n.name]});case N.KeyValuePair:return e.createElement($,{key:n.name,...s,value:"string"==typeof s.value?bt(s.value,[]):s.value,onChange:e=>i(n.name,JSON.stringify(e)),errorMessage:a[n.name]});case N.TextArea:return e.createElement(F,{key:n.name,...s,onChange:e=>i(n.name,e.target.value),errorMessage:a[n.name]});case N.Checkbox:return e.createElement(v,{key:n.name,...s,value:"true"==s.value,onChange:e=>i(n.name,String(e)),errorMessage:a[n.name]});default:return null}}),qa=d(Oe)`
208
208
  display: flex;
209
209
  align-items: center;
210
210
  gap: 8px;
@@ -229,7 +229,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
229
229
  justify-content: space-between;
230
230
  `,Ba=d(T)`
231
231
  margin-bottom: 12px;
232
- `,Ha=({isUpdate:i,categoryItem:n,formData:r,formErrors:s,validateForm:c,handleFormChange:d,dynamicFields:u,setDynamicFields:m,testConnection:h})=>{const{type:g,displayName:y,supportedSignals:v,testConnectionSupported:f}=n||{},b=I.useTheme(),[C,k]=t(!1),[w,S]=t(!1),[$,D]=t(void 0),N=a(!1);o(()=>{if(u.length&&!N.current){N.current=!0;let e=!1;for(let t=0;t<u.length;t++){const{required:o,value:i}=u[t];if(o){if([void 0,null,""].includes(i)){e=!1;break}e=!0}}k(e)}},[u,w]);const T=l(()=>{const{logs:e,metrics:t,traces:o}=v||{},i=[];return e?.supported&&i.push(xt.Logs),t?.supported&&i.push(xt.Metrics),o?.supported&&i.push(xt.Traces),i},[v]),F=l(()=>{const{logs:e,metrics:t,traces:o}=r.exportedSignals||{},i=[];return e&&i.push(xt.Logs),t&&i.push(xt.Metrics),o&&i.push(xt.Traces),i},[r.exportedSignals]),R=()=>{k(!1),S(!0),D(void 0)};return e.createElement(ja,{$gap:24},e.createElement(ja,{$gap:12},e.createElement(E,{title:i?"Update destination":"Create destination",description:`Connect ${y} with Odigos.`,actionButton:f&&e.createElement(Ka,{destination:r,validateForm:c,status:$?.type,testConnection:h,onError:e=>{S(!1),D({type:H.Error,title:e?.reason||"Connection failed",message:e?.message||"Please check your input and try again."})},onSuccess:e=>{S(!1),D({type:H.Success,title:e?.reason||"Connection succeeded",message:e?.message||""})}})}),e.createElement(Va,null,f&&$&&e.createElement(ie,{type:$.type,title:$.title,message:$.message}),C&&!$&&!i&&e.createElement(ie,{type:H.Default,message:`Odigos autocompleted ${y} destination details.`})),e.createElement(le,null)),e.createElement(za,null,e.createElement(M,{title:i?"":"This connection will monitor:",required:!0,allowedSignals:T,selectedSignals:F,setSelectedSignals:e=>{R(),d("exportedSignals",{logs:e.includes(xt.Logs),metrics:e.includes(xt.Metrics),traces:e.includes(xt.Traces)})},errorMessage:s.exportedSignals}),!i&&e.createElement(A,{endpoint:`/backends/${g}`})),i&&e.createElement("div",null,e.createElement(Ba,null,"Status"),e.createElement(O,{options:[{icon:ko,label:p.ENABLED,value:!1,selectedBgColor:b.text.success+I.opacity.hex["050"]},{icon:wo,label:p.DISABLED,value:!0,selectedBgColor:b.text.error+I.opacity.hex["050"]}],selected:r.disabled,setSelected:e=>d("disabled",e)})),!i&&e.createElement(x,{title:"Destination name",placeholder:"Enter destination name",value:r.name,onChange:e=>{R(),d("name",e.target.value)},errorMessage:s.name}),e.createElement(Pa,{signals:F,fields:u,onChange:(e,t)=>{R(),m(o=>{const i=[...o],a=i.findIndex(t=>t.name===e);return-1!==a&&(i[a]={...i[a],value:t}),i})},formErrors:s}))},Ua=d.div`
232
+ `,Ha=({isUpdate:i,categoryItem:n,formData:r,formErrors:s,validateForm:c,handleFormChange:d,dynamicFields:u,setDynamicFields:m,testConnection:h})=>{const{type:g,displayName:y,supportedSignals:v,testConnectionSupported:f}=n||{},b=I.useTheme(),[C,k]=t(!1),[w,S]=t(!1),[$,D]=t(void 0),N=a(!1);o(()=>{if(u.length&&!N.current){N.current=!0;let e=!1;for(let t=0;t<u.length;t++){const{required:o,value:i}=u[t];if(o){if([void 0,null,""].includes(i)){e=!1;break}e=!0}}k(e)}},[u,w]);const T=l(()=>{const{logs:e,metrics:t,traces:o}=v||{},i=[];return e?.supported&&i.push(xt.Logs),t?.supported&&i.push(xt.Metrics),o?.supported&&i.push(xt.Traces),i},[v]),F=l(()=>{const{logs:e,metrics:t,traces:o}=r.exportedSignals||{},i=[];return e&&i.push(xt.Logs),t&&i.push(xt.Metrics),o&&i.push(xt.Traces),i},[r.exportedSignals]),R=()=>{k(!1),S(!0),D(void 0)};return e.createElement(ja,{$gap:24},e.createElement(ja,{$gap:12},e.createElement(O,{title:i?"Update destination":"Create destination",description:`Connect ${y} with Odigos.`,actionButton:f&&e.createElement(Ka,{destination:r,validateForm:c,status:$?.type,testConnection:h,onError:e=>{S(!1),D({type:H.Error,title:e?.reason||"Connection failed",message:e?.message||"Please check your input and try again."})},onSuccess:e=>{S(!1),D({type:H.Success,title:e?.reason||"Connection succeeded",message:e?.message||""})}})}),e.createElement(Va,null,f&&$&&e.createElement(ie,{type:$.type,title:$.title,message:$.message}),C&&!$&&!i&&e.createElement(ie,{type:H.Default,message:`Odigos autocompleted ${y} destination details.`})),e.createElement(le,null)),e.createElement(za,null,e.createElement(M,{title:i?"":"This connection will monitor:",required:!0,allowedSignals:T,selectedSignals:F,setSelectedSignals:e=>{R(),d("exportedSignals",{logs:e.includes(xt.Logs),metrics:e.includes(xt.Metrics),traces:e.includes(xt.Traces)})},errorMessage:s.exportedSignals}),!i&&e.createElement(A,{endpoint:`/backends/${g}`})),i&&e.createElement("div",null,e.createElement(Ba,null,"Status"),e.createElement(E,{options:[{icon:ko,label:p.ENABLED,value:!1,selectedBgColor:b.text.success+I.opacity.hex["050"]},{icon:wo,label:p.DISABLED,value:!0,selectedBgColor:b.text.error+I.opacity.hex["050"]}],selected:r.disabled,setSelected:e=>d("disabled",e)})),!i&&e.createElement(x,{title:"Destination name",placeholder:"Enter destination name",value:r.name,onChange:e=>{R(),d("name",e.target.value)},errorMessage:s.name}),e.createElement(Pa,{signals:F,fields:u,onChange:(e,t)=>{R(),m(o=>{const i=[...o],a=i.findIndex(t=>t.name===e);return-1!==a&&(i[a]={...i[a],value:t}),i})},formErrors:s}))},Ua=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 o,forwardRef as i,useRef as a,useImperative
239
239
  display: flex;
240
240
  flex-direction: column;
241
241
  gap: 12px;
242
- `,_a=({categories:o,updateDestination:i,deleteDestination:n,testConnection:r})=>{const{destinations:s}=U(),{selectedStreamName:c}=Ue(),{drawerType:d,drawerEntityId:u}=P(),m=l(()=>Ye(s,c),[s,c]),h=a(null),g=d!==B.Destination,[y,v]=t(!1),[f,b]=t(!1),{formData:x,formErrors:C,handleFormChange:k,resetFormData:w,validateForm:S,loadFormWithDrawerItem:$,yamlFields:D,setYamlFields:N,dynamicFields:T,setDynamicFields:I}=Ct({}),O=l(()=>{if(g)return w();const e=m?.find(e=>e.id===u);return e?($(e),N(kt(o,e))):w(),e},[g,u,m]);if(!O)return null;const E=o.flatMap(e=>e.items).find(e=>e.type===O.destinationType.type),{icon:A,iconSrc:M}=E?Ve(E?.type):{icon:void 0,iconSrc:void 0};return e.createElement(wi,{ref:h,title:O.name||O.destinationType.displayName,icons:A?[A]:void 0,iconSrcs:M?[M]:void 0,isEdit:y,isFormDirty:f,onEdit:e=>{v("boolean"!=typeof e||e)},onSave:async e=>{if(S({withAlert:!0,alertTitle:Q.Update})){const t=e!==O.destinationType.displayName?e:"";k("name",t),i(u,{...x,name:t}),v(!1),b(!1)}},onDelete:async()=>{n(u),v(!1),b(!1),h.current?.closeDrawer()},onCancel:()=>{v(!1),b(!1),$(O)},isLastItem:1===m.length},y?e.createElement(Ua,null,e.createElement(Ha,{isUpdate:!0,categoryItem:E,formData:x,formErrors:C,handleFormChange:(...e)=>{b(!0),k(...e)},dynamicFields:T,setDynamicFields:(...e)=>{b(!0),I(...e)},validateForm:S,testConnection:r})):e.createElement(Wa,null,O.conditions?.length?e.createElement(J,{conditions:O.conditions}):null,e.createElement(Y,{title:p.DESTINATION_DETAILS,data:O?La(O,D):[]})))},Ga=d.div`
242
+ `,_a=({categories:o,updateDestination:i,deleteDestination:n,testConnection:r})=>{const{destinations:s}=U(),{selectedStreamName:c}=Ue(),{drawerType:d,drawerEntityId:u}=P(),m=l(()=>Ye(s,c),[s,c]),h=a(null),g=d!==B.Destination,[y,v]=t(!1),[f,b]=t(!1),{formData:x,formErrors:C,handleFormChange:k,resetFormData:w,validateForm:S,loadFormWithDrawerItem:$,yamlFields:D,setYamlFields:N,dynamicFields:T,setDynamicFields:I}=Ct({}),E=l(()=>{if(g)return w();const e=m?.find(e=>e.id===u);return e?($(e),N(kt(o,e))):w(),e},[g,u,m]);if(!E)return null;const O=o.flatMap(e=>e.items).find(e=>e.type===E.destinationType.type),{icon:A,iconSrc:M}=O?Ve(O?.type):{icon:void 0,iconSrc:void 0};return e.createElement(wi,{ref:h,title:E.name||E.destinationType.displayName,icons:A?[A]:void 0,iconSrcs:M?[M]:void 0,isEdit:y,isFormDirty:f,onEdit:e=>{v("boolean"!=typeof e||e)},onSave:async e=>{if(S({withAlert:!0,alertTitle:Q.Update})){const t=e!==E.destinationType.displayName?e:"";k("name",t),i(u,{...x,name:t}),v(!1),b(!1)}},onDelete:async()=>{n(u),v(!1),b(!1),h.current?.closeDrawer()},onCancel:()=>{v(!1),b(!1),$(E)},isLastItem:1===m.length},y?e.createElement(Ua,null,e.createElement(Ha,{isUpdate:!0,categoryItem:O,formData:x,formErrors:C,handleFormChange:(...e)=>{b(!0),k(...e)},dynamicFields:T,setDynamicFields:(...e)=>{b(!0),I(...e)},validateForm:S,testConnection:r})):e.createElement(Wa,null,E.conditions?.length?e.createElement(J,{conditions:E.conditions}):null,e.createElement(Y,{title:p.DESTINATION_DETAILS,data:E?La(E,D):[]})))},Ga=d.div`
243
243
  display: flex;
244
244
  flex-direction: column;
245
245
  gap: 12px;
246
- `,Ja=({items:t,onSelectNew:o,onSelectConfigured:i,isLoadingForDestinationIds:a})=>{const{configuredDestinationsUpdateOnly:n}=dt();return t.map(t=>{const l=t.name===St.EXISTS.TITLE;return e.createElement(Ga,{key:`category-${t.name}`},e.createElement(E,{size:"small",icon:t.icon,title: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}=Ve(r.type),p=r.selected||n.some(e=>e.id===r.id),m=!!a.find(e=>e===r.id),h=l?()=>i(r.id):()=>o(r);return e.createElement(Fe,{key:s,"data-id":s,title:r.displayName,hoverText:K.SELECT,onClick:h,iconProps:{icon:d,iconSrc:u},visualProps:{monitors:c,monitorsWithLabels:!0},checkboxProps:{withCheckbox:l,isChecked:p,isLoading:m,onCheckboxChange:()=>i(r.id)}})}))})},Ya=d.div`
246
+ `,Ja=({items:t,onSelectNew:o,onSelectConfigured:i,isLoadingForDestinationIds:a})=>{const{configuredDestinationsUpdateOnly:n}=dt();return t.map(t=>{const l=t.name===St.EXISTS.TITLE;return e.createElement(Ga,{key:`category-${t.name}`},e.createElement(O,{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}=Ve(r.type),p=r.selected||n.some(e=>e.id===r.id),m=!!a.find(e=>e===r.id),h=l?()=>i(r.id):()=>o(r);return e.createElement(Fe,{key:s,"data-id":s,title:r.displayName,hoverText:K.SELECT,onClick:h,iconProps:{icon:d,iconSrc:u},visualProps:{monitors:c,monitorsWithLabels:!0},checkboxProps:{withCheckbox:l,isChecked:p,isLoading:m,onCheckboxChange:()=>i(r.id)}})}))})},Ya=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 o,forwardRef as i,useRef as a,useImperative
267
267
  }
268
268
  `,en=d(Ya)`
269
269
  margin-top: 80px;
270
- `,{MANAGED:tn,SELF_HOSTED:on,DETECTED:an,EXISTS:nn}=St,ln=[{value:"All types",id:"all"},{value:tn.TITLE,id:tn.TITLE},{value:on.TITLE,id:on.TITLE},{value:an.TITLE,id:an.TITLE},{value:nn.TITLE,id:nn.TITLE}],rn=ln[0],sn=[xt.Logs,xt.Metrics,xt.Traces],cn=(e,t,o)=>e.map(e=>{const{type:i,displayName:a}=e.destinationType,n=e.dataStreamNames?.includes(t),l=o.has(e.id);return{id:e.id,type:i,displayName:a,selected:n||l,fields:[],testConnectionSupported:!1,supportedSignals:{[xt.Logs]:{supported:e.exportedSignals.logs},[xt.Metrics]:{supported:e.exportedSignals.metrics},[xt.Traces]:{supported:e.exportedSignals.traces}}}}),dn=({hidden:o,categories:i,potentialDestinations:a,onSelectNew:n,onSelectConfigured:r,isLoadingForDestinationIds:s})=>{const{destinations:c}=U(),{selectedStreamName:d}=Ue(),{configuredDestinations:u,configuredDestinationsUpdateOnly:p}=dt(),[m,h]=t(""),[g,y]=t(rn),[v,f]=t(sn),b=l(()=>{const e=$t(i);return e.unshift({name:nn.TITLE,description:nn.DESCRIPTION,icon:Eo,items:cn(c,d,new Set(u.concat(p).map(e=>e.id)))}),e.unshift({name:an.TITLE,description:an.DESCRIPTION,icon:Ao,items:a}),e.map(e=>{const t=e.items.filter(t=>{const o=!m||t.displayName.toLowerCase().includes(m.toLowerCase()),i="all"===g.id||g.id===e.name,a=v.some(e=>t.supportedSignals[e.toLowerCase()]?.supported);return o&&i&&a});return{...e,items:t}}).filter(({items:e})=>!!e.length)},[i,a,c,m,g,v,d,u,p]);return o?null:e.createElement(Ya,null,e.createElement(E,{title:"Choose destination",description:"Add backend destination you want to connect with Odigos."}),e.createElement(Qa,null,e.createElement(Xa,null,e.createElement(x,{placeholder:"Search...",icon:To,value:m,onChange:({target:{value:e}})=>h(e)})),e.createElement(Xa,null,e.createElement(at,{options:ln,value:g,onSelect:y,onDeselect:()=>{}})),e.createElement(M,{title:"",selectedSignals:v,setSelectedSignals:f})),e.createElement(le,null),b.length?e.createElement(Za,null,e.createElement(Ja,{items:b,onSelectNew:e=>n(e,v),onSelectConfigured:r,isLoadingForDestinationIds:s})):e.createElement(en,null,e.createElement(De,{title:"No destinations found"})))},un=d.div`
270
+ `,{MANAGED:tn,SELF_HOSTED:on,DETECTED:an,EXISTS:nn}=St,ln=[{value:"All types",id:"all"},{value:tn.TITLE,id:tn.TITLE},{value:on.TITLE,id:on.TITLE},{value:an.TITLE,id:an.TITLE},{value:nn.TITLE,id:nn.TITLE}],rn=ln[0],sn=[xt.Logs,xt.Metrics,xt.Traces],cn=(e,t,o)=>e.map(e=>{const{type:i,displayName:a}=e.destinationType,n=e.dataStreamNames?.includes(t),l=o.has(e.id);return{id:e.id,type:i,displayName:a,selected:n||l,fields:[],testConnectionSupported:!1,supportedSignals:{[xt.Logs]:{supported:e.exportedSignals.logs},[xt.Metrics]:{supported:e.exportedSignals.metrics},[xt.Traces]:{supported:e.exportedSignals.traces}}}}),dn=({hidden:o,categories:i,potentialDestinations:a,onSelectNew:n,onSelectConfigured:r,isLoadingForDestinationIds:s})=>{const{destinations:c}=U(),{selectedStreamName:d}=Ue(),{configuredDestinations:u,configuredDestinationsUpdateOnly:p}=dt(),[m,h]=t(""),[g,y]=t(rn),[v,f]=t(sn),b=l(()=>{const e=$t(i);return e.unshift({name:nn.TITLE,description:nn.DESCRIPTION,icon:Oo,items:cn(c,d,new Set(u.concat(p).map(e=>e.id)))}),e.unshift({name:an.TITLE,description:an.DESCRIPTION,icon:Ao,items:a}),e.map(e=>{const t=e.items.filter(t=>{const o=!m||t.displayName.toLowerCase().includes(m.toLowerCase()),i="all"===g.id||g.id===e.name,a=v.some(e=>t.supportedSignals[e.toLowerCase()]?.supported);return o&&i&&a});return{...e,items:t}}).filter(({items:e})=>!!e.length)},[i,a,c,m,g,v,d,u,p]);return o?null:e.createElement(Ya,null,e.createElement(O,{title:"Choose destination",description:"Add backend destination you want to connect with Odigos."}),e.createElement(Qa,null,e.createElement(Xa,null,e.createElement(x,{placeholder:"Search...",icon:To,value:m,onChange:({target:{value:e}})=>h(e)})),e.createElement(Xa,null,e.createElement(at,{options:ln,value:g,onSelect:y,onDeselect:()=>{}})),e.createElement(M,{title:"",selectedSignals:v,setSelectedSignals:f})),e.createElement(le,null),b.length?e.createElement(Za,null,e.createElement(Ja,{items:b,onSelectNew:e=>n(e,v),onSelectConfigured:r,isLoadingForDestinationIds:s})):e.createElement(en,null,e.createElement(De,{title:"No destinations found"})))},un=d.div`
271
271
  display: flex;
272
272
  `,pn=d.div`
273
273
  border-right: 1px solid ${({theme:e})=>e.colors.border};
@@ -276,7 +276,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
276
276
  @media (max-width: 1050px) {
277
277
  display: none;
278
278
  }
279
- `,mn=({isOnboarding:o,categories:i,potentialDestinations:a,createDestination:n,updateDestination:l,deleteDestination:r,testConnection:s})=>{const{destinations:c}=U(),{selectedStreamName:d}=Ue(),{currentModal:u,setCurrentModal:m}=Z(),{addConfiguredDestination:h,addConfiguredDestinationUpdateOnly:g,removeConfiguredDestinationUpdateOnly:y,configuredDestinationsUpdateOnly:v}=dt(),f=u===B.Destination,[b,x]=t(void 0),{formData:C,formErrors:k,handleFormChange:w,resetFormData:S,validateForm:$,setYamlFields:D,dynamicFields:N,setDynamicFields:T,loadFormWithDrawerItem:I}=Ct({supportedSignals:b?.supportedSignals,preLoadedFields:b?.fields}),[O,E]=t([]),A=e=>{const t={};return e||N.forEach(e=>t[e.name]=e.value),{id:e?.id||"",name:e?.name||C.name,disabled:e?.disabled||C.disabled,dataStreamNames:e?.dataStreamNames||[],conditions:e?.conditions||[],exportedSignals:e?.exportedSignals||C.exportedSignals,fields:e?.fields||JSON.stringify(t),destinationType:e?.destinationType||{type:b.type,displayName:b.displayName,supportedSignals:{logs:{supported:!1},metrics:{supported:!1},traces:{supported:!1}}}}},M=async e=>{if(o&&!e){const e=A();h(e)}else if(o&&e){const t=A(e);v.some(t=>t.id===e.id)?y(e):g(t)}else if(o||e){if(!o&&e){const t=A(e),o=t.dataStreamNames.some(e=>e===d);E(t=>[...t,e.id]),o?await r(e.id):await l(e.id,I(t)),E(t=>t.filter(t=>t!==e.id))}}else n(C)},F=()=>{S(),x(void 0),m("")},R=()=>{S(),x(void 0)},L=async()=>{if(b){if(!$({withAlert:!o,alertTitle:Q.Create}))return null;M()}F()};return q({key:"Enter",active:f},()=>L()),e.createElement(ee,{isOpen:f,onClose:F,header:{title:p.ADD_DESTINATION},actionComponent:e.createElement(te,{buttons:(()=>{const e=[{label:"DONE",variant:"primary",onClick:L}];return b&&e.unshift({label:"BACK",icon:Mo,variant:"secondary",onClick:R}),e})()})},e.createElement(un,null,e.createElement(pn,null,e.createElement(Dt,{currentStep:b?2:1,data:[{stepNumber:1,title:p.DESTINATIONS},{stepNumber:2,title:p.CONNECTION}]})),e.createElement(oe,{style:{margin:"32px 24px 12px 24px"}},e.createElement(dn,{hidden:void 0!==b,categories:i,potentialDestinations:a,onSelectNew:(e,t)=>{S(),w("type",e?.type||""),w("currentStreamName",d);const o={logs:!1,metrics:!1,traces:!1};t.filter(t=>e.supportedSignals[t].supported).forEach(e=>o[e]=!0),w("exportedSignals",o),D(e?.fields||[]),x(e)},onSelectConfigured:e=>{const t=c.find(t=>t.id===e);t&&M(t)},isLoadingForDestinationIds:O}),b&&e.createElement(Ha,{categoryItem:b,formData:C,formErrors:k,handleFormChange:w,dynamicFields:N,setDynamicFields:T,validateForm:$,testConnection:s}))))},hn=d.div`
279
+ `,mn=({isOnboarding:o,categories:i,potentialDestinations:a,createDestination:n,updateDestination:l,deleteDestination:r,testConnection:s})=>{const{destinations:c}=U(),{selectedStreamName:d}=Ue(),{currentModal:u,setCurrentModal:m}=Z(),{addConfiguredDestination:h,addConfiguredDestinationUpdateOnly:g,removeConfiguredDestinationUpdateOnly:y,configuredDestinationsUpdateOnly:v}=dt(),f=u===B.Destination,[b,x]=t(void 0),{formData:C,formErrors:k,handleFormChange:w,resetFormData:S,validateForm:$,setYamlFields:D,dynamicFields:N,setDynamicFields:T,loadFormWithDrawerItem:I}=Ct({supportedSignals:b?.supportedSignals,preLoadedFields:b?.fields}),[E,O]=t([]),A=e=>{const t={};return e||N.forEach(e=>t[e.name]=e.value),{id:e?.id||"",name:e?.name||C.name,disabled:e?.disabled||C.disabled,dataStreamNames:e?.dataStreamNames||[],conditions:e?.conditions||[],exportedSignals:e?.exportedSignals||C.exportedSignals,fields:e?.fields||JSON.stringify(t),destinationType:e?.destinationType||{type:b.type,displayName:b.displayName,supportedSignals:{logs:{supported:!1},metrics:{supported:!1},traces:{supported:!1}}}}},M=async e=>{if(o&&!e){const e=A();h(e)}else if(o&&e){const t=A(e);v.some(t=>t.id===e.id)?y(e):g(t)}else if(o||e){if(!o&&e){const t=A(e),o=t.dataStreamNames.some(e=>e===d);O(t=>[...t,e.id]),o?await r(e.id):await l(e.id,I(t)),O(t=>t.filter(t=>t!==e.id))}}else n(C)},F=()=>{S(),x(void 0),m("")},R=()=>{S(),x(void 0)},L=async()=>{if(b){if(!$({withAlert:!o,alertTitle:Q.Create}))return null;M()}F()};return q({key:"Enter",active:f},()=>L()),e.createElement(ee,{isOpen:f,onClose:F,header:{title:p.ADD_DESTINATION},actionComponent:e.createElement(te,{buttons:(()=>{const e=[{label:"DONE",variant:"primary",onClick:L}];return b&&e.unshift({label:"BACK",icon:Mo,variant:"secondary",onClick:R}),e})()})},e.createElement(un,null,e.createElement(pn,null,e.createElement(Dt,{currentStep:b?2:1,data:[{stepNumber:1,title:p.DESTINATIONS},{stepNumber:2,title:p.CONNECTION}]})),e.createElement(oe,{style:{margin:"32px 24px 12px 24px"}},e.createElement(dn,{hidden:void 0!==b,categories:i,potentialDestinations:a,onSelectNew:(e,t)=>{S(),w("type",e?.type||""),w("currentStreamName",d);const o={logs:!1,metrics:!1,traces:!1};t.filter(t=>e.supportedSignals[t].supported).forEach(e=>o[e]=!0),w("exportedSignals",o),D(e?.fields||[]),x(e)},onSelectConfigured:e=>{const t=c.find(t=>t.id===e);t&&M(t)},isLoadingForDestinationIds:E}),b&&e.createElement(Ha,{categoryItem:b,formData:C,formErrors:k,handleFormChange:w,dynamicFields:N,setDynamicFields:T,validateForm:$,testConnection:s}))))},hn=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 o,forwardRef as i,useRef as a,useImperative
285
285
  max-height: calc(100vh - 310px);
286
286
  height: fit-content;
287
287
  overflow-y: scroll;
288
- `,gn=({categories:t,withDelete:o})=>{const{configuredDestinations:i,configuredDestinationsUpdateOnly:a}=dt();return i.length||a.length?e.createElement(hn,null,i.concat(a).map((n,l)=>e.createElement(yn,{key:`configured-destination-${n.destinationType.type}-${l}`,"data-id":`configured-destination-${n.destinationType.type}`,item:n,yamlFields:kt(t,n),isLastItem:i.length+a.length===1,withDelete:o}))):e.createElement($e,null,e.createElement(De,{title:"No destinations",subTitle:"Please add a destination"}))},yn=({item:o,yamlFields:i,isLastItem:a,withDelete:n})=>{const[r,s]=t(!1),{icon:c,iconSrc:d}=Ve(o.destinationType.type),{removeConfiguredDestination:u,removeConfiguredDestinationUpdateOnly:p}=dt(),m=l(()=>vt(o,i).map(e=>({title:e.name,value:e.value})),[o,i]);return e.createElement(e.Fragment,null,e.createElement(Fe,{title:o.name||o.destinationType.displayName,subTitle:o.destinationType.type,iconProps:{icon:c,iconSrc:d},visualProps:{monitors:Pe(o.exportedSignals),monitorsWithLabels:!0},extendableProps:{withExtend:!0,renderExtended:()=>e.createElement(Nt,{data:m})},renderActions:n?()=>e.createElement(pt,{onClick:()=>s(!0)},e.createElement($o,null)):void 0}),n&&e.createElement(V,{isOpen:r,name:o.destinationType.displayName||o.name,type:B.Destination,isLastItem:a,onApprove:()=>{o.id?p(o):u(o)},onDeny:()=>s(!1)}))},vn=d(Ee)`
288
+ `,gn=({categories:t,withDelete:o})=>{const{configuredDestinations:i,configuredDestinationsUpdateOnly:a}=dt();return i.length||a.length?e.createElement(hn,null,i.concat(a).map((n,l)=>e.createElement(yn,{key:`configured-destination-${n.destinationType.type}-${l}`,"data-id":`configured-destination-${n.destinationType.type}`,item:n,yamlFields:kt(t,n),isLastItem:i.length+a.length===1,withDelete:o}))):e.createElement($e,null,e.createElement(De,{title:"No destinations",subTitle:"Please add a destination"}))},yn=({item:o,yamlFields:i,isLastItem:a,withDelete:n})=>{const[r,s]=t(!1),{icon:c,iconSrc:d}=Ve(o.destinationType.type),{removeConfiguredDestination:u,removeConfiguredDestinationUpdateOnly:p}=dt(),m=l(()=>vt(o,i).map(e=>({title:e.name,value:e.value})),[o,i]);return e.createElement(e.Fragment,null,e.createElement(Fe,{title:o.name||o.destinationType.displayName,subTitle:o.destinationType.type,iconProps:{icon:c,iconSrc:d},visualProps:{monitors:Pe(o.exportedSignals),monitorsWithLabels:!0},extendableProps:{withExtend:!0,renderExtended:()=>e.createElement(Nt,{data:m})},renderActions:n?()=>e.createElement(pt,{onClick:()=>s(!0)},e.createElement($o,null)):void 0}),n&&e.createElement(V,{isOpen:r,name:o.destinationType.displayName||o.name,type:B.Destination,isLastItem:a,onApprove:()=>{o.id?p(o):u(o)},onDeny:()=>s(!1)}))},vn=d(Oe)`
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 o,forwardRef as i,useRef as a,useImperative
294
294
  padding: 32px;
295
295
  border-radius: 16px;
296
296
  border-style: dashed !important;
297
- `,fn=({isSourcesListEmpty:t,goToSources:o,categories:i,potentialDestinations:a,testConnection:n,onClickSummary:l})=>{const r=I.useTheme(),{setCurrentModal:s}=Z(),{configuredDestinations:c,configuredDestinationsUpdateOnly:d}=dt();return e.createElement(e.Fragment,null,e.createElement(oe,{$isNotModal:!0},e.createElement(X,{$gap:12},e.createElement(X,{$gap:24},l&&e.createElement(gt,{onClick:l}),e.createElement(E,{title:p.ADD_DESTINATIONS,badgeLabel:c.length+d.length,description:p.ADD_DESTINATION_DESCRIPTION}),t&&e.createElement(ie,{type:H.Warning,message:p.NO_SOURCES_GO_BACK,action:{label:p.SELECT_SOURCES,onClick:o}}),e.createElement(vn,{variant:"secondary",onClick:()=>s(B.Destination)},e.createElement(No,null),e.createElement(T,{color:r.colors.secondary,size:14,decoration:"underline",family:"secondary"},p.ADD_DESTINATION))),e.createElement(gn,{categories:i,withDelete:!0}))),e.createElement(mn,{isOnboarding:!0,categories:i,potentialDestinations:a,updateDestination:async()=>{},createDestination:async()=>{},deleteDestination:async()=>{},testConnection:n}))},bn=[{key:"icon",title:""},{key:"name",title:p.NAME,sortable:!0},{key:"type",title:p.TYPE,sortable:!0},{key:"signals",title:p.MONITORS},{key:"active-status",title:p.STATUS},{key:"conditions",title:"Conditions"},{key:"throughput",title:"Throughput",sortable:!0}],xn=({metrics:t,maxHeight:o,maxWidth:i})=>{const a=I.useTheme(),n=he(),{selectedStreamName:r}=Ue(),{setDrawerType:s,setDrawerEntityId:c}=P(),{destinations:d,destinationsLoading:u}=U(),m=l(()=>Ye(d,r),[d,r]),h=l(()=>Mi({instrumentationRules:[],sources:[],actions:[],destinations:Je(m,n),searchText:n.searchText,selectedCategory:B.Destination}).searchResults.find(({category:e})=>e===B.Destination)?.entities||[],[m,n]),g=l(()=>h.map(o=>{const{hasErrors:i,hasWarnings:n,hasDisableds:l}=re(o.conditions||[]),{icon:r,iconSrc:d}=Ve(o.destinationType.type);return{status:i?H.Error:n?H.Warning:void 0,faded:l,onClick:()=>{s(B.Destination),c(o.id)},cells:[{columnKey:"icon",component:()=>e.createElement(ye,{icon:r,src:d})},{columnKey:"name",value:ve(o,B.Destination,{prioritizeDisplayName:!0})},{columnKey:"type",value:o.destinationType.type,textColor:a.text.info},{columnKey:"throughput",value:qe(Tt(t,B.Destination,o.id).throughput),textColor:a.text.info},{columnKey:"signals",component:()=>e.createElement(fe,{withLabels:!0,monitors:Pe(o.exportedSignals)})},{columnKey:"conditions",component:()=>o.conditions?.length?e.createElement(Ei,{conditions:o.conditions,id:o.id}):null},{columnKey:"active-status",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:o.disabled?H.Error:H.Success,title:o.disabled?p.DISABLED:p.ENABLED,withIcon:!0,withBorder:!0}))}]}}),[h,t]),{badge:y,badgeTooltip:v}=l(()=>h.length!==m.length?{badge:`${h.length}/${m.length}`,badgeTooltip:p.FILTERED_COUNT_TOOLTIP}:{badge:m.length,badgeTooltip:void 0},[h,m]);return e.createElement(be,{$maxWidth:i},e.createElement(xe,null,e.createElement(Ce,{icon:ke(B.Destination),title:p.DESTINATIONS,badge:y,badgeTooltip:v,loading:u})),e.createElement(we,{$maxHeight:o},e.createElement(Se,{columns:bn,rows:g})),!h.length&&e.createElement($e,{style:{marginTop:"2rem"}},e.createElement(De,null)))},Cn=e=>{const{type:t,ruleName:o,notes:i,disabled:a,profileName:n,payloadCollection:l,codeAttributes:r,headersCollection:s,customInstrumentations:c}=e,d=[{title:p.TYPE,value:t},{type:m.ActiveStatus,title:p.STATUS,value:String(!a)},{title:p.NAME,value:o},{title:p.NOTES,value:i},{title:p.MANAGED_BY_PROFILE,value:n},{type:m.Divider}];if(l){const e=Object.entries(l).filter(([e,t])=>t).map(([e,t])=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(r){const e=Object.entries(r).filter(([e,t])=>t).map(([e,t])=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(s){const e=(s[It.HeaderKeys]||[]).filter(e=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(c){const e=(c[Et.Java]||[]).map(e=>new Ot(e.className,e.methodName)).map(e=>`• ${e.toString()}`).join("\r\n");e&&d.push({title:p.JAVA_CUSTOM_PROBES,value:e});const t=(c[Et.Golang]||[]).map(e=>new At(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)).map(e=>`• ${e.toString()}`).join("\r\n");t&&d.push({title:p.GOLANG_CUSTOM_PROBES,value:t})}return d},kn=d.div`
297
+ `,fn=({isSourcesListEmpty:t,goToSources:o,categories:i,potentialDestinations:a,testConnection:n,onClickSummary:l})=>{const r=I.useTheme(),{setCurrentModal:s}=Z(),{configuredDestinations:c,configuredDestinationsUpdateOnly:d}=dt();return e.createElement(e.Fragment,null,e.createElement(oe,{$isNotModal:!0},e.createElement(X,{$gap:12},e.createElement(X,{$gap:24},l&&e.createElement(gt,{onClick:l}),e.createElement(O,{title:p.ADD_DESTINATIONS,badgeLabel:c.length+d.length,description:p.ADD_DESTINATION_DESCRIPTION}),t&&e.createElement(ie,{type:H.Warning,message:p.NO_SOURCES_GO_BACK,action:{label:p.SELECT_SOURCES,onClick:o}}),e.createElement(vn,{variant:"secondary",onClick:()=>s(B.Destination)},e.createElement(No,null),e.createElement(T,{color:r.colors.secondary,size:14,decoration:"underline",family:"secondary"},p.ADD_DESTINATION))),e.createElement(gn,{categories:i,withDelete:!0}))),e.createElement(mn,{isOnboarding:!0,categories:i,potentialDestinations:a,updateDestination:async()=>{},createDestination:async()=>{},deleteDestination:async()=>{},testConnection:n}))},bn=[{key:"icon",title:""},{key:"name",title:p.NAME,sortable:!0},{key:"type",title:p.TYPE,sortable:!0},{key:"signals",title:p.MONITORS},{key:"active-status",title:p.STATUS},{key:"conditions",title:"Conditions"},{key:"throughput",title:"Throughput",sortable:!0}],xn=({metrics:t,maxHeight:o,maxWidth:i})=>{const a=I.useTheme(),n=he(),{selectedStreamName:r}=Ue(),{setDrawerType:s,setDrawerEntityId:c}=P(),{destinations:d,destinationsLoading:u}=U(),m=l(()=>Ye(d,r),[d,r]),h=l(()=>Mi({instrumentationRules:[],sources:[],actions:[],destinations:Je(m,n),searchText:n.searchText,selectedCategory:B.Destination}).searchResults.find(({category:e})=>e===B.Destination)?.entities||[],[m,n]),g=l(()=>h.map(o=>{const{hasErrors:i,hasWarnings:n,hasDisableds:l}=re(o.conditions||[]),{icon:r,iconSrc:d}=Ve(o.destinationType.type);return{status:i?H.Error:n?H.Warning:void 0,faded:l,onClick:()=>{s(B.Destination),c(o.id)},cells:[{columnKey:"icon",component:()=>e.createElement(ye,{icon:r,src:d})},{columnKey:"name",value:ve(o,B.Destination,{prioritizeDisplayName:!0})},{columnKey:"type",value:o.destinationType.type,textColor:a.text.info},{columnKey:"throughput",value:qe(Tt(t,B.Destination,o.id).throughput),textColor:a.text.info},{columnKey:"signals",component:()=>e.createElement(fe,{withLabels:!0,monitors:Pe(o.exportedSignals)})},{columnKey:"conditions",component:()=>o.conditions?.length?e.createElement(Oi,{conditions:o.conditions,id:o.id}):null},{columnKey:"active-status",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:o.disabled?H.Error:H.Success,title:o.disabled?p.DISABLED:p.ENABLED,withIcon:!0,withBorder:!0}))}]}}),[h,t]),{badge:y,badgeTooltip:v}=l(()=>h.length!==m.length?{badge:`${h.length}/${m.length}`,badgeTooltip:p.FILTERED_COUNT_TOOLTIP}:{badge:m.length,badgeTooltip:void 0},[h,m]);return e.createElement(be,{$maxWidth:i},e.createElement(xe,null,e.createElement(Ce,{icon:ke(B.Destination),title:p.DESTINATIONS,badge:y,badgeTooltip:v,loading:u})),e.createElement(we,{$maxHeight:o},e.createElement(Se,{columns:bn,rows:g})),!h.length&&e.createElement($e,{style:{marginTop:"2rem"}},e.createElement(De,null)))},Cn=e=>{const{type:t,ruleName:o,notes:i,disabled:a,profileName:n,payloadCollection:l,codeAttributes:r,headersCollection:s,customInstrumentations:c}=e,d=[{title:p.TYPE,value:t},{type:m.ActiveStatus,title:p.STATUS,value:String(!a)},{title:p.NAME,value:o},{title:p.NOTES,value:i},{title:p.MANAGED_BY_PROFILE,value:n},{type:m.Divider}];if(l){const e=Object.entries(l).filter(([e,t])=>t).map(([e,t])=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(r){const e=Object.entries(r).filter(([e,t])=>t).map(([e,t])=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(s){const e=(s[It.HeaderKeys]||[]).filter(e=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(c){const e=(c[Ot.Java]||[]).map(e=>new Et(e.className,e.methodName)).map(e=>`• ${e.toString()}`).join("\r\n");e&&d.push({title:p.JAVA_CUSTOM_PROBES,value:e});const t=(c[Ot.Golang]||[]).map(e=>new At(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)).map(e=>`• ${e.toString()}`).join("\r\n");t&&d.push({title:p.GOLANG_CUSTOM_PROBES,value:t})}return d},kn=d.div`
298
298
  display: flex;
299
299
  flex-direction: column;
300
300
  gap: 12px;
@@ -304,7 +304,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
304
304
  border-radius: 16px;
305
305
  padding: 8px;
306
306
  `}
307
- `,wn=[{id:Mt.FilePath,label:"Collect File Path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Mt.Function,label:"Collect Function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Mt.LineNumber,label:"Collect Line Number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],Sn=[{id:Mt.Column,label:"Collect Column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Mt.Namespace,label:"Collect Namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Mt.StackTrace,label:"Collect Stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],$n={[Et.Java]:[new Ot("","")],[Et.Golang]:[new At("")]},Dn=["*"],Nn=d.div`
307
+ `,wn=[{id:Mt.FilePath,label:"Collect File Path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Mt.Function,label:"Collect Function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Mt.LineNumber,label:"Collect Line Number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],Sn=[{id:Mt.Column,label:"Collect Column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Mt.Namespace,label:"Collect Namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Mt.StackTrace,label:"Collect Stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],$n={[Ot.Java]:[new Et("","")],[Ot.Golang]:[new At("")]},Dn=["*"],Nn=d.div`
308
308
  display: flex;
309
309
  flex-direction: column;
310
310
  gap: 12px;
@@ -314,14 +314,14 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
314
314
  border-radius: 16px;
315
315
  padding: 8px;
316
316
  `}
317
- `,Tn=[{id:Ft.HttpRequest,label:"Collect HTTP Request"},{id:Ft.HttpResponse,label:"Collect HTTP Response"},{id:Ft.DbQuery,label:"Collect DB Query"},{id:Ft.Messaging,label:"Collect Messaging"}],In={[Rt.CodeAttributes]:({value:i,setValue:a,formErrors:n})=>{const r=n.codeAttributes,s=l(()=>Object.entries(i.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[i]),[c,d]=t(1===s.length);o(()=>{if(!s.length){const e={[Mt.Column]:null,[Mt.FilePath]:!0,[Mt.Function]:!0,[Mt.LineNumber]:!0,[Mt.Namespace]:null,[Mt.StackTrace]:null};a("codeAttributes",e),d(!1)}},[]);const u=(e,t)=>{const o=t?[...s,e]:s.filter(t=>t!==e),i=Object.values(Mt).reduce((e,t)=>(e[t]=!!o.includes(t)||null,e),{});a("codeAttributes",i),d(1===o.length)};return e.createElement(e.Fragment,null,e.createElement("div",null,e.createElement(y,{title:"Recommended data to collect",required:!0}),e.createElement(kn,{$hasError:!!r},wn.map(({id:t,label:o,tooltip:i})=>e.createElement(ue,{key:t,text:i,withIcon:!0},e.createElement(v,{title:o,disabled:c&&s.includes(t),value:s.includes(t),onChange:e=>u(t,e)})))),!!r&&e.createElement(f,null,r)),e.createElement("div",null,e.createElement(y,{title:"Verbose data to collect",required:!0}),e.createElement(kn,{$hasError:!!r},Sn.map(({id:t,label:o,tooltip:i})=>e.createElement(ue,{key:t,text:i,withIcon:!0},e.createElement(v,{title:o,disabled:c&&s.includes(t),value:s.includes(t),onChange:e=>u(t,e)})))),!!r&&e.createElement(f,null,r)))},[Rt.CustomInstrumentation]:({value:t,setValue:i,formErrors:a})=>{const n=a.customInstrumentations,r=l(()=>(t?.customInstrumentations?.[Et.Java]||[]).map(e=>({key:e.className,value:e.methodName})),[t]),s=l(()=>(t?.customInstrumentations?.[Et.Golang]||[]).map(e=>new At(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[t]),c=(e,t)=>{const o={};switch(t){case"java":o[Et.Java]=e.map(e=>new Ot(e.className,e.methodName)),o[Et.Golang]=s.map(e=>new At(e.packageName,e.functionName,e.receiverName,e.receiverMethodName));break;case"golang":o[Et.Golang]=e.map(e=>new At(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),o[Et.Java]=r.map(({key:e,value:t})=>new Ot(e,t))}i("customInstrumentations",o)};return o(()=>{t?.customInstrumentations||i("customInstrumentations",{[Et.Golang]:$n[Et.Golang],[Et.Java]:$n[Et.Java]})},[i,t]),e.createElement("div",null,e.createElement(w,{title:"Golang Custom Probes",columns:[{title:"",keyName:"packageName",placeholder:"Package name",required:!0,tooltip:"The full import path of the package containing the function or method to be instrumented."},{title:"",keyName:"functionName",placeholder:"Function name",required:!1,tooltip:"The name of the function to be instrumented. Leave empty if instrumenting a receiver method."},{title:"",keyName:"receiverName",placeholder:"Receiver name",required:!1,tooltip:"The name of the receiver type if instrumenting a method. Leave empty if instrumenting a standalone function."},{title:"",keyName:"receiverMethodName",placeholder:"Receiver method name",required:!1,tooltip:"The name of the method to be instrumented. Leave empty if instrumenting a standalone function."}],value:s,onChange:e=>c(e,"golang"),errorMessage:n,limitFieldsPerRow:2}),e.createElement($,{title:"Java Custom Probes",tooltip:"Specify class name and method name pair to instrument.",value:r,onChange:(e=[])=>c(e.map(({key:e,value:t})=>({className:e,methodName:t})),"java"),errorMessage:n,keyPlaceholder:"Class name",valuePlaceholder:"Method name"}))},[Rt.HeadersCollection]:({value:t,setValue:i,formErrors:a})=>{const n=a.headersCollection,r=l(()=>t?.headersCollection?.[It.HeaderKeys]||[],[t]),s=e=>{const t={[It.HeaderKeys]:e};i("headersCollection",t)};return o(()=>{r.length||s(Dn)},[r]),e.createElement("div",null,r.length>0&&e.createElement(D,{title:"Header Keys",tooltip:"Specify which headers you want to collect, asterisk (*) will collect all headers.",value:r,onChange:e=>s(e),errorMessage:n}))},[Rt.PayloadCollection]:({value:i,setValue:a,formErrors:n})=>{const r=n.payloadCollection,s=l(()=>Object.entries(i.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[i]),[c,d]=t(1===s.length);return o(()=>{if(!s.length){const e={[Ft.HttpRequest]:{},[Ft.HttpResponse]:{},[Ft.DbQuery]:{},[Ft.Messaging]:{}};a("payloadCollection",e),d(!1)}},[]),e.createElement("div",null,e.createElement(y,{title:"Type of data to collect",required:!0}),e.createElement(Nn,{$hasError:!!r},Tn.map(({id:t,label:o})=>e.createElement(v,{key:t,title:o,disabled:c&&s.includes(t),value:s.includes(t),onChange:e=>((e,t)=>{const o=t?[...s,e]:s.filter(t=>t!==e),i={[Ft.HttpRequest]:o.includes(Ft.HttpRequest)?{}:null,[Ft.HttpResponse]:o.includes(Ft.HttpResponse)?{}:null,[Ft.DbQuery]:o.includes(Ft.DbQuery)?{}:null,[Ft.Messaging]:o.includes(Ft.Messaging)?{}:null};a("payloadCollection",i),d(1===o.length)})(t,e)}))),!!r&&e.createElement(f,null,r))},[Rt.UnknownType]:null},On=({ruleType:t,value:o,setValue:i,formErrors:a})=>{if(!t)return null;const n=In[t];return n?e.createElement(n,{value:o,setValue:i,formErrors:a}):null},En=d.div`
317
+ `,Tn=[{id:Ft.HttpRequest,label:"Collect HTTP Request"},{id:Ft.HttpResponse,label:"Collect HTTP Response"},{id:Ft.DbQuery,label:"Collect DB Query"},{id:Ft.Messaging,label:"Collect Messaging"}],In={[Rt.CodeAttributes]:({value:i,setValue:a,formErrors:n})=>{const r=n.codeAttributes,s=l(()=>Object.entries(i.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[i]),[c,d]=t(1===s.length);o(()=>{if(!s.length){const e={[Mt.Column]:null,[Mt.FilePath]:!0,[Mt.Function]:!0,[Mt.LineNumber]:!0,[Mt.Namespace]:null,[Mt.StackTrace]:null};a("codeAttributes",e),d(!1)}},[]);const u=(e,t)=>{const o=t?[...s,e]:s.filter(t=>t!==e),i=Object.values(Mt).reduce((e,t)=>(e[t]=!!o.includes(t)||null,e),{});a("codeAttributes",i),d(1===o.length)};return e.createElement(e.Fragment,null,e.createElement("div",null,e.createElement(y,{title:"Recommended data to collect",required:!0}),e.createElement(kn,{$hasError:!!r},wn.map(({id:t,label:o,tooltip:i})=>e.createElement(ue,{key:t,text:i,withIcon:!0},e.createElement(v,{title:o,disabled:c&&s.includes(t),value:s.includes(t),onChange:e=>u(t,e)})))),!!r&&e.createElement(f,null,r)),e.createElement("div",null,e.createElement(y,{title:"Verbose data to collect",required:!0}),e.createElement(kn,{$hasError:!!r},Sn.map(({id:t,label:o,tooltip:i})=>e.createElement(ue,{key:t,text:i,withIcon:!0},e.createElement(v,{title:o,disabled:c&&s.includes(t),value:s.includes(t),onChange:e=>u(t,e)})))),!!r&&e.createElement(f,null,r)))},[Rt.CustomInstrumentation]:({value:t,setValue:i,formErrors:a})=>{const n=a.customInstrumentations,r=l(()=>(t?.customInstrumentations?.[Ot.Java]||[]).map(e=>({key:e.className,value:e.methodName})),[t]),s=l(()=>(t?.customInstrumentations?.[Ot.Golang]||[]).map(e=>new At(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[t]),c=(e,t)=>{const o={};switch(t){case"java":o[Ot.Java]=e.map(e=>new Et(e.className,e.methodName)),o[Ot.Golang]=s.map(e=>new At(e.packageName,e.functionName,e.receiverName,e.receiverMethodName));break;case"golang":o[Ot.Golang]=e.map(e=>new At(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),o[Ot.Java]=r.map(({key:e,value:t})=>new Et(e,t))}i("customInstrumentations",o)};return o(()=>{t?.customInstrumentations||i("customInstrumentations",{[Ot.Golang]:$n[Ot.Golang],[Ot.Java]:$n[Ot.Java]})},[i,t]),e.createElement("div",null,e.createElement(w,{title:"Golang Custom Probes",columns:[{title:"",keyName:"packageName",placeholder:"Package name",required:!0,tooltip:"The full import path of the package containing the function or method to be instrumented."},{title:"",keyName:"functionName",placeholder:"Function name",required:!1,tooltip:"The name of the function to be instrumented. Leave empty if instrumenting a receiver method."},{title:"",keyName:"receiverName",placeholder:"Receiver name",required:!1,tooltip:"The name of the receiver type if instrumenting a method. Leave empty if instrumenting a standalone function."},{title:"",keyName:"receiverMethodName",placeholder:"Receiver method name",required:!1,tooltip:"The name of the method to be instrumented. Leave empty if instrumenting a standalone function."}],value:s,onChange:e=>c(e,"golang"),errorMessage:n,limitFieldsPerRow:2}),e.createElement($,{title:"Java Custom Probes",tooltip:"Specify class name and method name pair to instrument.",value:r,onChange:(e=[])=>c(e.map(({key:e,value:t})=>({className:e,methodName:t})),"java"),errorMessage:n,keyPlaceholder:"Class name",valuePlaceholder:"Method name"}))},[Rt.HeadersCollection]:({value:t,setValue:i,formErrors:a})=>{const n=a.headersCollection,r=l(()=>t?.headersCollection?.[It.HeaderKeys]||[],[t]),s=e=>{const t={[It.HeaderKeys]:e};i("headersCollection",t)};return o(()=>{r.length||s(Dn)},[r]),e.createElement("div",null,r.length>0&&e.createElement(D,{title:"Header Keys",tooltip:"Specify which headers you want to collect, asterisk (*) will collect all headers.",value:r,onChange:e=>s(e),errorMessage:n}))},[Rt.PayloadCollection]:({value:i,setValue:a,formErrors:n})=>{const r=n.payloadCollection,s=l(()=>Object.entries(i.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[i]),[c,d]=t(1===s.length);return o(()=>{if(!s.length){const e={[Ft.HttpRequest]:{},[Ft.HttpResponse]:{},[Ft.DbQuery]:{},[Ft.Messaging]:{}};a("payloadCollection",e),d(!1)}},[]),e.createElement("div",null,e.createElement(y,{title:"Type of data to collect",required:!0}),e.createElement(Nn,{$hasError:!!r},Tn.map(({id:t,label:o})=>e.createElement(v,{key:t,title:o,disabled:c&&s.includes(t),value:s.includes(t),onChange:e=>((e,t)=>{const o=t?[...s,e]:s.filter(t=>t!==e),i={[Ft.HttpRequest]:o.includes(Ft.HttpRequest)?{}:null,[Ft.HttpResponse]:o.includes(Ft.HttpResponse)?{}:null,[Ft.DbQuery]:o.includes(Ft.DbQuery)?{}:null,[Ft.Messaging]:o.includes(Ft.Messaging)?{}:null};a("payloadCollection",i),d(1===o.length)})(t,e)}))),!!r&&e.createElement(f,null,r))},[Rt.UnknownType]:null},En=({ruleType:t,value:o,setValue:i,formErrors:a})=>{if(!t)return null;const n=In[t];return n?e.createElement(n,{value:o,setValue:i,formErrors:a}):null},On=d.div`
318
318
  display: flex;
319
319
  flex-direction: column;
320
320
  gap: 24px;
321
321
  padding: 4px;
322
322
  `,An=d(T)`
323
323
  margin-bottom: 12px;
324
- `,Mn=({isUpdate:t,rule:o,formData:i,formErrors:a,handleFormChange:n})=>{const l=I.useTheme();return e.createElement(En,null,e.createElement(ce,null,o.supportedLanguages.map(t=>e.createElement(Lt,{key:t,icon:Pt(t),type:H.Info},nt[t]))),t?e.createElement("div",null,e.createElement(An,null,"Status"),e.createElement(O,{options:[{icon:ko,label:p.ENABLED,value:!1,selectedBgColor:l.text.success+I.opacity.hex["050"]},{icon:wo,label:p.DISABLED,value:!0,selectedBgColor:l.text.error+I.opacity.hex["050"]}],selected:i.disabled,setSelected:e=>n("disabled",e)})):e.createElement(e.Fragment,null,e.createElement(E,{title:"",description:o.docsDescription,actionButton:e.createElement(A,{endpoint:o.docsEndpoint})}),e.createElement(x,{title:"Rule name",placeholder:"Use a name that describes the rule",value:i.ruleName,onChange:({target:{value:e}})=>n("ruleName",e),errorMessage:a.ruleName})),e.createElement(On,{ruleType:o.type,value:i,setValue:(e,t)=>n(e,t),formErrors:a}),e.createElement(F,{title:"Notes",value:i.notes,onChange:({target:{value:e}})=>n("notes",e),errorMessage:a.notes}))},Fn=d.div`
324
+ `,Mn=({isUpdate:t,rule:o,formData:i,formErrors:a,handleFormChange:n})=>{const l=I.useTheme();return e.createElement(On,null,e.createElement(ce,null,o.supportedLanguages.map(t=>e.createElement(Lt,{key:t,icon:Pt(t),type:H.Info},nt[t]))),t?e.createElement("div",null,e.createElement(An,null,"Status"),e.createElement(E,{options:[{icon:ko,label:p.ENABLED,value:!1,selectedBgColor:l.text.success+I.opacity.hex["050"]},{icon:wo,label:p.DISABLED,value:!0,selectedBgColor:l.text.error+I.opacity.hex["050"]}],selected:i.disabled,setSelected:e=>n("disabled",e)})):e.createElement(e.Fragment,null,e.createElement(O,{title:"",description:o.docsDescription,actionButton:e.createElement(A,{endpoint:o.docsEndpoint})}),e.createElement(x,{title:"Rule name",placeholder:"Use a name that describes the rule",value:i.ruleName,onChange:({target:{value:e}})=>n("ruleName",e),errorMessage:a.ruleName})),e.createElement(En,{ruleType:o.type,value:i,setValue:(e,t)=>n(e,t),formErrors:a}),e.createElement(F,{title:"Notes",value:i.notes,onChange:({target:{value:e}})=>n("notes",e),errorMessage:a.notes}))},Fn=d.div`
325
325
  width: 100%;
326
326
  height: 100%;
327
327
  max-height: calc(100vh - 220px);
@@ -334,7 +334,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
334
334
  `,Ln=({updateInstrumentationRule:o,deleteInstrumentationRule:i})=>{const{instrumentationRules:n}=U(),{addNotification:r}=L(),{drawerType:s,drawerEntityId:c}=P(),d=a(null),u=s!==B.InstrumentationRule,[p,m]=t(!1),[h,g]=t(!1),{formData:y,formErrors:v,handleFormChange:f,resetFormData:b,validateForm:x,loadFormWithDrawerItem:C}=qt(),k=l(()=>{if(u)return b();const e=n?.find(e=>e.ruleId===c);return e?C(e):b(),e},[u,c,n]);if(!k)return null;const w=Kt.find(({type:e})=>e===k.type);return e.createElement(wi,{ref:d,title:k.ruleName||k.type,icons:[je(k.type)],isEdit:p,isFormDirty:h,onEdit:e=>{k.mutable||!e&&void 0!==e?m("boolean"!=typeof e||e):r({type:H.Warning,title:ae.FORBIDDEN,message:ae.CANNOT_EDIT_RULE,crdType:B.InstrumentationRule,target:c,hideFromHistory:!0})},onSave:e=>{if(x()){const t=e!==k.type?e:"";f("ruleName",t),o(c,{...y,ruleName:t}),m(!1),g(!1)}},onDelete:()=>{k.mutable?(i(c),m(!1),g(!1),d.current?.closeDrawer()):r({type:H.Warning,title:ae.FORBIDDEN,message:ae.CANNOT_DELETE_RULE,crdType:B.InstrumentationRule,target:c,hideFromHistory:!0})},onCancel:()=>{m(!1),g(!1),C(k)}},p&&w?e.createElement(Fn,null,e.createElement(Mn,{isUpdate:!0,rule:w,formData:y,formErrors:v,handleFormChange:(...e)=>{g(!0),f(...e)}})):e.createElement(Rn,null,e.createElement(J,{conditions:k.conditions||[]}),e.createElement(Y,{title:"Instrumentation Rule Details",data:k?Cn(k):[]})))},Pn=d(X)`
335
335
  margin-top: 24px;
336
336
  gap: 12px;
337
- `,qn=Kt,Kn=({isEnterprise:o,createInstrumentationRule:i})=>{const{currentModal:a,setCurrentModal:n}=Z(),l=a===B.InstrumentationRule,{formData:r,formErrors:s,handleFormChange:c,resetFormData:d,validateForm:u}=qt(),[m,h]=t(void 0),g=()=>{d(),h(void 0),n("")},y=()=>{if(!u())return null;i(r),g()};return q({key:"Enter",active:l},()=>y()),e.createElement(ee,{isOpen:l,onClose:g,header:{title:"Add Instrumentation Rule"},actionComponent:e.createElement(te,{buttons:[{variant:"primary",label:"DONE",onClick:y,disabled:!o||!m,tooltip:o?"":ae.ENTERPRISE_ONLY("Instrumentation Rules")}]})},e.createElement(oe,null,e.createElement(E,{title:"Select Instrumentation Rule",description:"Define how telemetry is recorded from your application. Choose a rule type and configure the details."}),e.createElement(Pn,null,o?e.createElement(ie,{type:H.Warning,message:ae.DEFINED_FOR_ALL_STREAMS(p.INSTRUMENTATION_RULES)}):e.createElement(ie,{type:H.Default,message:ae.ENTERPRISE_ONLY(p.INSTRUMENTATION_RULES)}),e.createElement(ne,{options:qn,selectedOption:m,onOptionSelect:e=>{return t=e,d(),void h(t);var t},autoFocus:!m?.type})),m?.type?e.createElement("div",null,e.createElement(le,{margin:"16px 0"}),e.createElement(Mn,{rule:m,formData:r,formErrors:s,handleFormChange:c})):null))},jn=e=>{const{payloadCollection:t,codeAttributes:o,customInstrumentations:i}=e;let a="";return t&&(a+=Object.entries(t).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),o&&(a+=Object.entries(o).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),i&&Object.values(Et).forEach(e=>{const t=(i[e]||[]).filter(e=>e).join(", ");t&&(a+=a?`, ${t}`:t)}),a},Vn=[{key:"icon",title:""},{key:"name",title:p.NAME,sortable:!0},{key:"profile",title:p.MANAGED_BY_PROFILE,sortable:!0},{key:"active-status",title:p.STATUS},{key:"conditions",title:"Conditions"},{key:"source-count",title:"Applicable Source"},{key:"type",title:p.TYPE,sortable:!0},{key:"spec",title:"Spec",sortable:!0},{key:"notes",title:p.NOTES,sortable:!0}],zn=({maxHeight:t,maxWidth:o})=>{const i=I.useTheme(),a=he(),{setDrawerType:n,setDrawerEntityId:r}=P(),{instrumentationRules:s,instrumentationRulesLoading:c}=U(),d=l(()=>Mi({instrumentationRules:s,sources:[],actions:[],destinations:[],searchText:a.searchText,selectedCategory:B.InstrumentationRule}).searchResults.find(({category:e})=>e===B.InstrumentationRule)?.entities||[],[s,a]),u=l(()=>d.map(t=>{const{hasErrors:o,hasWarnings:a,hasDisableds:l}=re(t.conditions||[]);return{status:o?H.Error:a?H.Warning:void 0,faded:l,onClick:()=>{n(B.InstrumentationRule),r(t.ruleId)},cells:[{columnKey:"icon",component:()=>e.createElement(ye,{icon:je(t.type)})},{columnKey:"name",value:ve(t,B.InstrumentationRule,{prioritizeDisplayName:!0})},{columnKey:"type",value:t.type,textColor:i.text.info},{columnKey:"profile",value:t.profileName,textColor:i.text.info},{columnKey:"notes",value:t.notes,textColor:i.text.info,withTooltip:!0},{columnKey:"spec",value:jn(t),textColor:i.text.info,withTooltip:!0},{columnKey:"conditions",component:()=>e.createElement(Ei,{conditions:t.conditions||[],id:t.ruleId})},{columnKey:"active-status",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:t.disabled?H.Error:H.Success,title:t.disabled?p.DISABLED:p.ENABLED,withIcon:!0,withBorder:!0}))},{columnKey:"source-count",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:H.Info,title:"all sources",withBorder:!0}))}]}}),[d]),{badge:m,badgeTooltip:h}=l(()=>d.length!==s.length?{badge:`${d.length}/${s.length}`,badgeTooltip:p.FILTERED_COUNT_TOOLTIP}:{badge:s.length,badgeTooltip:void 0},[d,s]);return e.createElement(be,{$maxWidth:o},e.createElement(xe,null,e.createElement(Ce,{icon:ke(B.Action),title:p.INSTRUMENTATION_RULES,badge:m,badgeTooltip:h,loading:c})),e.createElement(we,{$maxHeight:t},e.createElement(Se,{columns:Vn,rows:u})),!d.length&&e.createElement($e,{style:{marginTop:"2rem"}},e.createElement(De,null)))},Bn=d.div`
337
+ `,qn=Kt,Kn=({isEnterprise:o,createInstrumentationRule:i})=>{const{currentModal:a,setCurrentModal:n}=Z(),l=a===B.InstrumentationRule,{formData:r,formErrors:s,handleFormChange:c,resetFormData:d,validateForm:u}=qt(),[m,h]=t(void 0),g=()=>{d(),h(void 0),n("")},y=()=>{if(!u())return null;i(r),g()};return q({key:"Enter",active:l},()=>y()),e.createElement(ee,{isOpen:l,onClose:g,header:{title:"Add Instrumentation Rule"},actionComponent:e.createElement(te,{buttons:[{variant:"primary",label:"DONE",onClick:y,disabled:!o||!m,tooltip:o?"":ae.ENTERPRISE_ONLY("Instrumentation Rules")}]})},e.createElement(oe,null,e.createElement(O,{title:"Select Instrumentation Rule",description:"Define how telemetry is recorded from your application. Choose a rule type and configure the details."}),e.createElement(Pn,null,o?e.createElement(ie,{type:H.Warning,message:ae.DEFINED_FOR_ALL_STREAMS(p.INSTRUMENTATION_RULES)}):e.createElement(ie,{type:H.Default,message:ae.ENTERPRISE_ONLY(p.INSTRUMENTATION_RULES)}),e.createElement(ne,{options:qn,selectedOption:m,onOptionSelect:e=>{return t=e,d(),void h(t);var t},autoFocus:!m?.type})),m?.type?e.createElement("div",null,e.createElement(le,{margin:"16px 0"}),e.createElement(Mn,{rule:m,formData:r,formErrors:s,handleFormChange:c})):null))},jn=e=>{const{payloadCollection:t,codeAttributes:o,customInstrumentations:i}=e;let a="";return t&&(a+=Object.entries(t).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),o&&(a+=Object.entries(o).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),i&&Object.values(Ot).forEach(e=>{const t=(i[e]||[]).filter(e=>e).join(", ");t&&(a+=a?`, ${t}`:t)}),a},Vn=[{key:"icon",title:""},{key:"name",title:p.NAME,sortable:!0},{key:"profile",title:p.MANAGED_BY_PROFILE,sortable:!0},{key:"active-status",title:p.STATUS},{key:"conditions",title:"Conditions"},{key:"source-count",title:"Applicable Source"},{key:"type",title:p.TYPE,sortable:!0},{key:"spec",title:"Spec",sortable:!0},{key:"notes",title:p.NOTES,sortable:!0}],zn=({maxHeight:t,maxWidth:o})=>{const i=I.useTheme(),a=he(),{setDrawerType:n,setDrawerEntityId:r}=P(),{instrumentationRules:s,instrumentationRulesLoading:c}=U(),d=l(()=>Mi({instrumentationRules:s,sources:[],actions:[],destinations:[],searchText:a.searchText,selectedCategory:B.InstrumentationRule}).searchResults.find(({category:e})=>e===B.InstrumentationRule)?.entities||[],[s,a]),u=l(()=>d.map(t=>{const{hasErrors:o,hasWarnings:a,hasDisableds:l}=re(t.conditions||[]);return{status:o?H.Error:a?H.Warning:void 0,faded:l,onClick:()=>{n(B.InstrumentationRule),r(t.ruleId)},cells:[{columnKey:"icon",component:()=>e.createElement(ye,{icon:je(t.type)})},{columnKey:"name",value:ve(t,B.InstrumentationRule,{prioritizeDisplayName:!0})},{columnKey:"type",value:t.type,textColor:i.text.info},{columnKey:"profile",value:t.profileName,textColor:i.text.info},{columnKey:"notes",value:t.notes,textColor:i.text.info,withTooltip:!0},{columnKey:"spec",value:jn(t),textColor:i.text.info,withTooltip:!0},{columnKey:"conditions",component:()=>e.createElement(Oi,{conditions:t.conditions||[],id:t.ruleId})},{columnKey:"active-status",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:t.disabled?H.Error:H.Success,title:t.disabled?p.DISABLED:p.ENABLED,withIcon:!0,withBorder:!0}))},{columnKey:"source-count",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:H.Info,title:"all sources",withBorder:!0}))}]}}),[d]),{badge:m,badgeTooltip:h}=l(()=>d.length!==s.length?{badge:`${d.length}/${s.length}`,badgeTooltip:p.FILTERED_COUNT_TOOLTIP}:{badge:s.length,badgeTooltip:void 0},[d,s]);return e.createElement(be,{$maxWidth:o},e.createElement(xe,null,e.createElement(Ce,{icon:ke(B.Action),title:p.INSTRUMENTATION_RULES,badge:m,badgeTooltip:h,loading:c})),e.createElement(we,{$maxHeight:t},e.createElement(Se,{columns:Vn,rows:u})),!d.length&&e.createElement($e,{style:{marginTop:"2rem"}},e.createElement(De,null)))},Bn=d.div`
338
338
  position: fixed;
339
339
  bottom: 0;
340
340
  left: 50%;
@@ -347,7 +347,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
347
347
  border-radius: 32px;
348
348
  border: 1px solid ${({theme:e})=>e.colors.border};
349
349
  background-color: ${({theme:e})=>e.colors.dropdown_bg};
350
- `,Hn=({totalSourceCount:o,uninstrumentSources:i,restartWorkloads:a})=>{const n=I.useTheme(),s=jt({container:Bn,animateIn:I.animations.slide.in.center,animateOut:I.animations.slide.out.center}),{selectedSources:c,setSelectedSources:d}=Ae(),[u,p]=t(!1),m=l(()=>{let e=0;return Object.values(c).forEach(t=>{e+=t.length}),e},[c]),h=()=>{d({})};return e.createElement(r,null,e.createElement(s,{"data-id":"multi-source-control",enter:!!m},e.createElement(T,null,"Selected sources"),e.createElement(Te,{label:m,filled:!0}),e.createElement(le,{orientation:"vertical",length:"16px"}),e.createElement(Ee,{variant:"tertiary",onClick:h},e.createElement(T,{family:"secondary",decoration:"underline"},"Deselect")),e.createElement(Ee,{variant:"tertiary",onClick:()=>{const e=[];Object.values(c).forEach(t=>{e.push(...t.map(e=>Vt(e)))}),a(e),h()}},e.createElement(Fo,null),e.createElement(T,{family:"secondary",decoration:"underline"},"Restart")),e.createElement(Ee,{variant:"tertiary",onClick:()=>p(!0)},e.createElement($o,null),e.createElement(T,{family:"secondary",decoration:"underline",color:n.text.error},"Uninstrument"))),e.createElement(V,{isOpen:u,name:`${m} sources`,type:B.Source,isLastItem:m===o,onApprove:()=>{const e={};Object.entries(c).forEach(([t,o])=>{e[t]=o.map(e=>({...e,selected:!1}))}),i(e),p(!1),h()},onDeny:()=>p(!1)}))},Un=d.div`
350
+ `,Hn=({totalSourceCount:o,uninstrumentSources:i,restartWorkloads:a})=>{const n=I.useTheme(),s=jt({container:Bn,animateIn:I.animations.slide.in.center,animateOut:I.animations.slide.out.center}),{selectedSources:c,setSelectedSources:d}=Ae(),[u,p]=t(!1),m=l(()=>{let e=0;return Object.values(c).forEach(t=>{e+=t.length}),e},[c]),h=()=>{d({})};return e.createElement(r,null,e.createElement(s,{"data-id":"multi-source-control",enter:!!m},e.createElement(T,null,"Selected sources"),e.createElement(Te,{label:m,filled:!0}),e.createElement(le,{orientation:"vertical",length:"16px"}),e.createElement(Oe,{variant:"tertiary",onClick:h},e.createElement(T,{family:"secondary",decoration:"underline"},"Deselect")),e.createElement(Oe,{variant:"tertiary",onClick:()=>{const e=[];Object.values(c).forEach(t=>{e.push(...t.map(e=>Vt(e)))}),a(e),h()}},e.createElement(Fo,null),e.createElement(T,{family:"secondary",decoration:"underline"},"Restart")),e.createElement(Oe,{variant:"tertiary",onClick:()=>p(!0)},e.createElement($o,null),e.createElement(T,{family:"secondary",decoration:"underline",color:n.text.error},"Uninstrument"))),e.createElement(V,{isOpen:u,name:`${m} sources`,type:B.Source,isLastItem:m===o,onApprove:()=>{const e={};Object.entries(c).forEach(([t,o])=>{e[t]=o.map(e=>({...e,selected:!1}))}),i(e),p(!1),h()},onDeny:()=>p(!1)}))},Un=d.div`
351
351
  position: relative;
352
352
  width: fit-content;
353
353
  `,Wn=d(ce)`
@@ -452,7 +452,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
452
452
  align-items: center;
453
453
  justify-content: flex-end;
454
454
  text-align: right;
455
- `,yl=ke(B.Namespace),vl=({isModal:t=!1,withInstances:o=!0,fetchingNamespace:i,fetchedNamespaces:a,filteredNamespacesAndSources:n,selectedNamespace:l,onSelectNamespace:r,selectedSources:s,onSelectSource:c,selectedFutureApps:d,onSelectFutureApps:u})=>{const m=I.useTheme(),{isVm:h}=He(),{namespacesLoading:g}=U(),y=Object.entries(n||{});return y?.length?e.createElement(sl,{$isModal:t},y.map(([t,n])=>{const y=s?.[t]||[],f=d?.[t]?.selected||!1,b=y.filter(({selected:e})=>e),x=y.length>0,C=l===t,k=b.length>0&&b.length===n.length,w=b.length>0&&b.length!==n.length,$=n.length>0,D=1===n.length;return r||$?e.createElement(cl,{key:`namespace-${t}`,"data-id":`namespace-${t}`,$selected:k,$isOpen:C},e.createElement(dl,{$selected:k,$withClick:!!r,onClick:()=>r?.(t)},e.createElement(ce,{$gap:12},r&&e.createElement(v,{partiallyChecked:w,value:k,onChange:e=>r(t,e)}),e.createElement(yl,null),e.createElement(T,null,t)),e.createElement(ce,{$gap:24},!h&&u&&e.createElement(S,{title:p.FUTURE_APPS_TITLE,tooltip:p.FUTURE_APPS_DESCRIPTION,initialValue:f,onChange:e=>u(e,t),flipHorizontally:!0}),e.createElement(gl,{$width:108},i!==t||a?.includes(t)?null:e.createElement(Oe,{size:10},"Retrieving workloads...")),e.createElement(gl,null,e.createElement(T,{size:10,color:m.text.grey},x?`${b.length}/${n.length}`:null)),r&&e.createElement(mt,{extend:C}))),(C||!r)&&($?e.createElement(pl,{$addPadding:!c},e.createElement(ml,null,e.createElement(le,{orientation:"vertical",length:(D?24:34*n.length)+"px"})),n.map(i=>{const a=b.some(({name:e})=>e===i.name);return e.createElement(fl,{key:`source-${i.name}`,withInstances:o,source:i,namespace:t,isSelected:a,onSelect:c})})):e.createElement(hl,{$addPadding:!c},g||i===t&&!a?.includes(t)?e.createElement(Re,null):e.createElement(De,{title:p.NO_SOURCES_NAMESPACE,subTitle:p.TRY_SEARCH_OR_OTHER_NAMESPACE})))):null})):e.createElement($e,null,g||i?e.createElement(Re,null):e.createElement(De,{title:p.NO_SOURCES,subTitle:!h&&r?p.PLEASE_MAKE_SURE_UNIGNORED_NAMESPACES:p.PLEASE_ADD_SOURCE}))},fl=({withInstances:t,source:o,namespace:i,isSelected:a,onSelect:n})=>e.createElement(ul,{"data-id":`source-${o.name}`,$selected:a,$withClick:!!n,onClick:()=>n?.(o)},e.createElement(ce,{$gap:12},n&&e.createElement(v,{value:a,onChange:()=>n(o,i)}),e.createElement(ce,{$gap:4},e.createElement(T,null,o.name),e.createElement(T,{opacity:.8,size:10},t?` • ${o.numberOfInstances||0} running instance${1!==o.numberOfInstances?"s":""}`:"",` • ${o.kind}`)))),bl=d.div`
455
+ `,yl=ke(B.Namespace),vl=({isModal:t=!1,withInstances:o=!0,fetchingNamespace:i,fetchedNamespaces:a,filteredNamespacesAndSources:n,selectedNamespace:l,onSelectNamespace:r,selectedSources:s,onSelectSource:c,selectedFutureApps:d,onSelectFutureApps:u})=>{const m=I.useTheme(),{isVm:h}=He(),{namespacesLoading:g}=U(),y=Object.entries(n||{});return y?.length?e.createElement(sl,{$isModal:t},y.map(([t,n])=>{const y=s?.[t]||[],f=d?.[t]?.selected||!1,b=y.filter(({selected:e})=>e),x=y.length>0,C=l===t,k=b.length>0&&b.length===n.length,w=b.length>0&&b.length!==n.length,$=n.length>0,D=1===n.length;return r||$?e.createElement(cl,{key:`namespace-${t}`,"data-id":`namespace-${t}`,$selected:k,$isOpen:C},e.createElement(dl,{$selected:k,$withClick:!!r,onClick:()=>r?.(t)},e.createElement(ce,{$gap:12},r&&e.createElement(v,{partiallyChecked:w,value:k,onChange:e=>r(t,e)}),e.createElement(yl,null),e.createElement(T,null,t)),e.createElement(ce,{$gap:24},!h&&u&&e.createElement(S,{title:p.FUTURE_APPS_TITLE,tooltip:p.FUTURE_APPS_DESCRIPTION,initialValue:f,onChange:e=>u(e,t),flipHorizontally:!0}),e.createElement(gl,{$width:108},i!==t||a?.includes(t)?null:e.createElement(Ee,{size:10},"Retrieving workloads...")),e.createElement(gl,null,e.createElement(T,{size:10,color:m.text.grey},x?`${b.length}/${n.length}`:null)),r&&e.createElement(mt,{extend:C}))),(C||!r)&&($?e.createElement(pl,{$addPadding:!c},e.createElement(ml,null,e.createElement(le,{orientation:"vertical",length:(D?24:34*n.length)+"px"})),n.map(i=>{const a=b.some(({name:e})=>e===i.name);return e.createElement(fl,{key:`source-${i.name}`,withInstances:o,source:i,namespace:t,isSelected:a,onSelect:c})})):e.createElement(hl,{$addPadding:!c},g||i===t&&!a?.includes(t)?e.createElement(Re,null):e.createElement(De,{title:p.NO_SOURCES_NAMESPACE,subTitle:p.TRY_SEARCH_OR_OTHER_NAMESPACE})))):null})):e.createElement($e,null,g||i?e.createElement(Re,null):e.createElement(De,{title:p.NO_SOURCES,subTitle:!h&&r?p.PLEASE_MAKE_SURE_UNIGNORED_NAMESPACES:p.PLEASE_ADD_SOURCE}))},fl=({withInstances:t,source:o,namespace:i,isSelected:a,onSelect:n})=>e.createElement(ul,{"data-id":`source-${o.name}`,$selected:a,$withClick:!!n,onClick:()=>n?.(o)},e.createElement(ce,{$gap:12},n&&e.createElement(v,{value:a,onChange:()=>n(o,i)}),e.createElement(ce,{$gap:4},e.createElement(T,null,o.name),e.createElement(T,{opacity:.8,size:10},t?` • ${o.numberOfInstances||0} running instance${1!==o.numberOfInstances?"s":""}`:"",` • ${o.kind}`)))),bl=d.div`
456
456
  display: flex;
457
457
  flex-direction: column;
458
458
  align-items: center;
@@ -461,7 +461,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
461
461
  max-height: calc(100vh - 200px);
462
462
  height: fit-content;
463
463
  overflow-y: scroll;
464
- `,xl=({onEditStream:t,onEditSources:o,onEditDestinations:i,categories:a})=>{const{selectedStreamName:n}=Ue(),{configuredSources:r,configuredDestinations:s,configuredDestinationsUpdateOnly:c}=dt(),d=l(()=>Object.values(r).reduce((e,t)=>e+t.filter(e=>e.selected).length,0),[r]);return e.createElement(oe,{$isNotModal:!0},e.createElement(X,{$gap:12},e.createElement(E,{title:p.SUMMARY,description:p.STREAM_CONFIRM}),e.createElement(bl,null,e.createElement(Y,{title:p.STREAM_NAME,action:()=>e.createElement(Wt,{onClick:t}),data:[{title:"",value:n}]}),e.createElement(Y,{title:p.SELECTED_SOURCES,titleBadge:d,action:()=>e.createElement(Wt,{onClick:o})},e.createElement(vl,{filteredNamespacesAndSources:r,withInstances:!1})),e.createElement(Y,{title:p.SELECTED_DESTINATIONS,titleBadge:s.length+c.length,action:()=>e.createElement(Wt,{onClick:i})},e.createElement(gn,{categories:a})))))};var Cl;!function(e){e.Overview="overview",e.InstrumentationRules="InstrumentationRule",e.Sources="Source",e.Actions="Action",e.Destinations="Destination"}(Cl||(Cl={}));const kl=({onClickId:o,defaultSelectedId:i,extendedNavIcons:a})=>{const{isVm:n}=He(),[r,s]=t(i||""),c=l(()=>[{id:Cl.Overview,icon:qo,selected:r===Cl.Overview,onClick:()=>{s(Cl.Overview),o(Cl.Overview)},tooltip:"Overview"},...(a||[]).map(e=>({...e,selected:r===e.id,onClick:()=>{s(e.id),e.onClick()}}))],[r]),d=l(()=>{const e=[{id:Cl.Sources,icon:Vo,selected:r===Cl.Sources,onClick:()=>{s(Cl.Sources),o(Cl.Sources)},tooltip:"Sources"},{id:Cl.Destinations,icon:zo,selected:r===Cl.Destinations,onClick:()=>{s(Cl.Destinations),o(Cl.Destinations)},tooltip:"Destinations"}];return n||(e.push({id:Cl.InstrumentationRules,icon:Ko,selected:r===Cl.InstrumentationRules,onClick:()=>{s(Cl.InstrumentationRules),o(Cl.InstrumentationRules)},tooltip:"Instrumentation Rules"}),e.push({id:Cl.Actions,icon:jo,selected:r===Cl.Actions,onClick:()=>{s(Cl.Actions),o(Cl.Actions)},tooltip:"Actions"})),e},[n,r]);return e.createElement(_t,{orientation:"vertical",mainIcons:c,subIcons:d})},wl=({})=>e.createElement(pt,{onClick:()=>window.open("https://join.slack.com/t/odigos/shared_invite/zt-2wc6gm4j9-EhcVFYrLwHqvcIErO9sVzw","_blank","noopener noreferrer"),tooltip:"Join our Slack community"},e.createElement(Bo,null)),Sl=(e,t)=>{const{name:o,kind:i,namespace:a}=e,n=[{title:p.KIND,value:i},{title:p.NAME,value:o,tooltip:"Resource name"}];return t||(n.unshift({title:p.NAMESPACE,value:a}),n.push({type:m.Divider}),n.push({type:m.CopyText,value:`kubectl get ${i} ${o} -n ${a}`.toLowerCase()})),n},$l=d.div`
464
+ `,xl=({onEditStream:t,onEditSources:o,onEditDestinations:i,categories:a})=>{const{selectedStreamName:n}=Ue(),{configuredSources:r,configuredDestinations:s,configuredDestinationsUpdateOnly:c}=dt(),d=l(()=>Object.values(r).reduce((e,t)=>e+t.filter(e=>e.selected).length,0),[r]);return e.createElement(oe,{$isNotModal:!0},e.createElement(X,{$gap:12},e.createElement(O,{title:p.SUMMARY,description:p.STREAM_CONFIRM}),e.createElement(bl,null,e.createElement(Y,{title:p.STREAM_NAME,action:()=>e.createElement(Wt,{onClick:t}),data:[{title:"",value:n}]}),e.createElement(Y,{title:p.SELECTED_SOURCES,titleBadge:d,action:()=>e.createElement(Wt,{onClick:o})},e.createElement(vl,{filteredNamespacesAndSources:r,withInstances:!1})),e.createElement(Y,{title:p.SELECTED_DESTINATIONS,titleBadge:s.length+c.length,action:()=>e.createElement(Wt,{onClick:i})},e.createElement(gn,{categories:a})))))};var Cl;!function(e){e.Overview="overview",e.InstrumentationRules="InstrumentationRule",e.Sources="Source",e.Actions="Action",e.Destinations="Destination"}(Cl||(Cl={}));const kl=({onClickId:o,defaultSelectedId:i,extendedNavIcons:a})=>{const{isVm:n}=He(),[r,s]=t(i||""),c=l(()=>[{id:Cl.Overview,icon:qo,selected:r===Cl.Overview,onClick:()=>{s(Cl.Overview),o(Cl.Overview)},tooltip:"Overview"},...(a||[]).map(e=>({...e,selected:r===e.id,onClick:()=>{s(e.id),e.onClick()}}))],[r]),d=l(()=>{const e=[{id:Cl.Sources,icon:Vo,selected:r===Cl.Sources,onClick:()=>{s(Cl.Sources),o(Cl.Sources)},tooltip:"Sources"},{id:Cl.Destinations,icon:zo,selected:r===Cl.Destinations,onClick:()=>{s(Cl.Destinations),o(Cl.Destinations)},tooltip:"Destinations"}];return n||(e.push({id:Cl.InstrumentationRules,icon:Ko,selected:r===Cl.InstrumentationRules,onClick:()=>{s(Cl.InstrumentationRules),o(Cl.InstrumentationRules)},tooltip:"Instrumentation Rules"}),e.push({id:Cl.Actions,icon:jo,selected:r===Cl.Actions,onClick:()=>{s(Cl.Actions),o(Cl.Actions)},tooltip:"Actions"})),e},[n,r]);return e.createElement(_t,{orientation:"vertical",mainIcons:c,subIcons:d})},wl=({})=>e.createElement(pt,{onClick:()=>window.open("https://join.slack.com/t/odigos/shared_invite/zt-2wc6gm4j9-EhcVFYrLwHqvcIErO9sVzw","_blank","noopener noreferrer"),tooltip:"Join our Slack community"},e.createElement(Bo,null)),Sl=(e,t)=>{const{name:o,kind:i,namespace:a}=e,n=[{title:p.KIND,value:i},{title:p.NAME,value:o,tooltip:"Resource name"}];return t||(n.unshift({title:p.NAMESPACE,value:a}),n.push({type:m.Divider}),n.push({type:m.CopyText,value:`kubectl get ${i} ${o} -n ${a}`.toLowerCase()})),n},$l=d.div`
465
465
  display: flex;
466
466
  flex-direction: column;
467
467
  gap: 24px;
@@ -470,7 +470,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
470
470
  width: 100%;
471
471
  align-items: center;
472
472
  justify-content: space-between;
473
- `,Ol=({source:i,fetchSourceLibraries:a})=>{const n=I.useTheme(),[l,s]=t(!1),[c,d]=t(null);return o(()=>{i&&a({variables:{namespace:i.namespace,name:i.name,kind:i.kind}}).then(({data:e})=>{e?.instrumentationInstanceComponents?d($t(e.instrumentationInstanceComponents).sort((e,t)=>e.name.localeCompare(t.name))):s(!0)})},[a,i]),c||l?e.createElement(X,{$gap:12},l?e.createElement($e,{$height:"70vh"},e.createElement(De,{subTitle:"Could not fetch libraries for this source"})):c?.length?e.createElement(Y,{title:"Instrumented Libraries"},c.map(({name:t,nonIdentifyingAttributes:o},i)=>e.createElement(r,{key:`library-${t}`},e.createElement(Il,null,e.createElement(T,{size:12,color:n.text.grey},t),e.createElement(ce,{$gap:4},o.map(({key:o,value:i})=>Zt(i)&&eo(i)&&"is_standard_lib"===o?e.createElement(se,{key:`${t}-${o}`,status:H.Default,title:"STANDARD",withBorder:!0}):null))),i!==c.length-1&&e.createElement(le,{length:"100%",margin:"0"})))):e.createElement($e,{$height:"70vh",$gap:12},e.createElement(De,{title:"No libraries found",subTitle:""}),e.createElement(ie,{type:H.Warning,message:"This feature is in early development, and has very limited support"}))):e.createElement($e,{$height:"70vh"},e.createElement(Re,null))};var El;!function(e){e.Overview="Overview",e.Pods="Pods",e.Libraries="Libraries"}(El||(El={}));const Al=[io.Deployment,io.StatefulSet,io.DaemonSet,io.DeploymentConfig],Ml=[ao.Python,ao.Go],Fl=d.div`
473
+ `,El=({source:i,fetchSourceLibraries:a})=>{const n=I.useTheme(),[l,s]=t(!1),[c,d]=t(null);return o(()=>{i&&a({variables:{namespace:i.namespace,name:i.name,kind:i.kind}}).then(({data:e})=>{e?.instrumentationInstanceComponents?d($t(e.instrumentationInstanceComponents).sort((e,t)=>e.name.localeCompare(t.name))):s(!0)})},[a,i]),c||l?e.createElement(X,{$gap:12},l?e.createElement($e,{$height:"70vh"},e.createElement(De,{subTitle:"Could not fetch libraries for this source"})):c?.length?e.createElement(Y,{title:"Instrumented Libraries"},c.map(({name:t,nonIdentifyingAttributes:o},i)=>e.createElement(r,{key:`library-${t}`},e.createElement(Il,null,e.createElement(T,{size:12,color:n.text.grey},t),e.createElement(ce,{$gap:4},o.map(({key:o,value:i})=>Zt(i)&&eo(i)&&"is_standard_lib"===o?e.createElement(se,{key:`${t}-${o}`,status:H.Default,title:"STANDARD",withBorder:!0}):null))),i!==c.length-1&&e.createElement(le,{length:"100%",margin:"0"})))):e.createElement($e,{$height:"70vh",$gap:12},e.createElement(De,{title:"No libraries found",subTitle:""}),e.createElement(ie,{type:H.Warning,message:"This feature is in early development, and has very limited support"}))):e.createElement($e,{$height:"70vh"},e.createElement(Re,null))};var Ol;!function(e){e.Overview="Overview",e.Pods="Pods",e.Libraries="Libraries"}(Ol||(Ol={}));const Al=[io.Deployment,io.StatefulSet,io.DaemonSet,io.DeploymentConfig],Ml=[ao.Python,ao.Go],Fl=d.div`
474
474
  width: 100%;
475
475
  height: 100%;
476
476
  max-height: calc(100vh - 220px);
@@ -480,10 +480,10 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
480
480
  display: flex;
481
481
  flex-direction: column;
482
482
  gap: 12px;
483
- `,Ll=({persistSources:i,updateSource:n,restartWorkloads:r,fetchSourceById:s,fetchSourceDescribe:c,fetchSourceLibraries:d})=>{const{isVm:u}=He(),{sources:m}=U(),{selectedStreamName:h}=Ue(),{drawerType:g,drawerEntityId:y}=P(),v=l(()=>Ge(m,h),[m,h]),f=a(null),b=g===B.Source,[x,C]=t(!1),[k,w]=t(!1),[S,$]=t(El.Overview),[D,N]=t(null);o(()=>{b&&y&&s(y).then(e=>N(e||null))},[b,y]);const{formData:I,handleFormChange:O,resetFormData:E,loadFormWithDrawerItem:A}=to(),M=l(()=>{if(!b)return E();const e=(D&&JSON.stringify(Vt(D))===JSON.stringify(Vt(y))?D:null)||v?.find(e=>e.namespace===y.namespace&&e.name===y.name&&e.kind===y.kind);return e?A(e):E(),e},[b,y,v,D]),F=l(()=>{const e=M?.conditions?.find(({type:e})=>"RuntimeDetection"===e);return{description:e?.message,isLoading:e?.status===pe.Loading,containers:M?.containers||[]}},[M]),R=l(()=>{const e=[{label:El.Overview,onClick:()=>$(El.Overview),selected:S===El.Overview}];return Al.includes(M?.kind)&&e.push({label:El.Pods,onClick:()=>$(El.Pods),selected:S===El.Pods}),M?.containers?.some(({language:e})=>Ml.includes(e))&&e.push({label:El.Libraries,onClick:()=>$(El.Libraries),selected:S===El.Libraries}),e},[S,M]);return M?e.createElement(wi,{ref:f,onClose:()=>{$(El.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:x,isFormDirty:k,onEdit:S===El.Overview?e=>{C("boolean"!=typeof e||e)}:void 0,onSave:async()=>{const e=I.otelServiceName!==M.name?I.otelServiceName:"";O("otelServiceName",e),await n(y,{...I,otelServiceName:e}),N(null),w(!1),C(!1)},onDelete:S===El.Overview?async()=>{const{namespace:e}=M;i({[e]:[{...M,selected:!1,currentStreamName:h}]},{}),N(null),w(!1),C(!1),f.current?.closeDrawer()}:void 0,onCancel:()=>{w(!1),C(!1),O("otelServiceName",M.otelServiceName||M.name||"")},isLastItem:1===v.length,tabs:R,headerActionButtons:[{"data-id":"rollout-restart",variant:"tertiary",onClick:()=>r([y]),children:e.createElement(e.Fragment,null,e.createElement(Fo,null),e.createElement(T,{size:14,family:"secondary",decoration:"underline"},"Restart"))}]},S===El.Overview?x?e.createElement(Fl,null,e.createElement(Dl,{formData:I,handleFormChange:(...e)=>{w(!0),O(...e),O("currentStreamName",h)}})):e.createElement(Rl,null,e.createElement(Nl,{workloadOdigosHealthStatus:M.workloadOdigosHealthStatus}),e.createElement(J,{conditions:M.conditions||[]}),e.createElement(Y,{title:p.SOURCE_DETAILS,data:M?Sl(M,u):[]}),e.createElement(Y,{title:u?p.DETECTED_PROCESSES:p.DETECTED_CONTAINERS,titleBadge:F.isLoading?pe.Loading:F.containers.length,description:F.description||(u?p.DETECTED_PROCESSES_DESCRIPTION:p.DETECTED_CONTAINERS_DESCRIPTION)},F.containers.map(t=>e.createElement(oo,{key:`source-container-${t.containerName}`,...t,callbackRuntimeOverride:async e=>await n(y,e)})))):S===El.Pods?e.createElement(Tl,{source:M,fetchSourceDescribe:c}):e.createElement(Ol,{source:M,fetchSourceLibraries:d})):null},Pl=d.div`
483
+ `,Ll=({persistSources:i,updateSource:n,restartWorkloads:r,fetchSourceById:s,fetchSourceDescribe:c,fetchSourceLibraries:d})=>{const{isVm:u}=He(),{sources:m}=U(),{selectedStreamName:h}=Ue(),{drawerType:g,drawerEntityId:y}=P(),v=l(()=>Ge(m,h),[m,h]),f=a(null),b=g===B.Source,[x,C]=t(!1),[k,w]=t(!1),[S,$]=t(Ol.Overview),[D,N]=t(null);o(()=>{b&&y&&s(y).then(e=>N(e||null))},[b,y]);const{formData:I,handleFormChange:E,resetFormData:O,loadFormWithDrawerItem:A}=to(),M=l(()=>{if(!b)return O();const e=(D&&JSON.stringify(Vt(D))===JSON.stringify(Vt(y))?D:null)||v?.find(e=>e.namespace===y.namespace&&e.name===y.name&&e.kind===y.kind);return e?A(e):O(),e},[b,y,v,D]),F=l(()=>{const e=M?.conditions?.find(({type:e})=>"RuntimeDetection"===e);return{description:e?.message,isLoading:e?.status===pe.Loading,containers:M?.containers||[]}},[M]),R=l(()=>{const e=[{label:Ol.Overview,onClick:()=>$(Ol.Overview),selected:S===Ol.Overview}];return Al.includes(M?.kind)&&e.push({label:Ol.Pods,onClick:()=>$(Ol.Pods),selected:S===Ol.Pods}),M?.containers?.some(({language:e})=>Ml.includes(e))&&e.push({label:Ol.Libraries,onClick:()=>$(Ol.Libraries),selected:S===Ol.Libraries}),e},[S,M]);return M?e.createElement(wi,{ref:f,onClose:()=>{$(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:x,isFormDirty:k,onEdit:S===Ol.Overview?e=>{C("boolean"!=typeof e||e)}:void 0,onSave:async()=>{const e=I.otelServiceName!==M.name?I.otelServiceName:"";E("otelServiceName",e),await n(y,{...I,otelServiceName:e}),N(null),w(!1),C(!1)},onDelete:S===Ol.Overview?async()=>{const{namespace:e}=M;i({[e]:[{...M,selected:!1,currentStreamName:h}]},{}),N(null),w(!1),C(!1),f.current?.closeDrawer()}:void 0,onCancel:()=>{w(!1),C(!1),E("otelServiceName",M.otelServiceName||M.name||"")},isLastItem:1===v.length,tabs:R,headerActionButtons:[{"data-id":"rollout-restart",variant:"tertiary",onClick:()=>r([y]),children:e.createElement(e.Fragment,null,e.createElement(Fo,null),e.createElement(T,{size:14,family:"secondary",decoration:"underline"},"Restart"))}]},S===Ol.Overview?x?e.createElement(Fl,null,e.createElement(Dl,{formData:I,handleFormChange:(...e)=>{w(!0),E(...e),E("currentStreamName",h)}})):e.createElement(Rl,null,e.createElement(Nl,{workloadOdigosHealthStatus:M.workloadOdigosHealthStatus}),e.createElement(J,{conditions:M.conditions||[]}),e.createElement(Y,{title:p.SOURCE_DETAILS,data:M?Sl(M,u):[]}),e.createElement(Y,{title:u?p.DETECTED_PROCESSES:p.DETECTED_CONTAINERS,titleBadge:F.isLoading?pe.Loading:F.containers.length,description:F.description||(u?p.DETECTED_PROCESSES_DESCRIPTION:p.DETECTED_CONTAINERS_DESCRIPTION)},F.containers.map(t=>e.createElement(oo,{key:`source-container-${t.containerName}`,...t,callbackRuntimeOverride:async e=>await n(y,e)})))):S===Ol.Pods?e.createElement(Tl,{source:M,fetchSourceDescribe:c}):e.createElement(El,{source:M,fetchSourceLibraries:d})):null},Pl=d.div`
484
484
  max-width: ${({$fullWidth:e})=>e?"unset":"420px"};
485
485
  width: 100%;
486
- `,ql=i(({isModal:t,fetchSingleNamespace:o,onClickSummary:i},a)=>{const l=I.useTheme(),{isVm:r}=He(),s=no({fetchSingleNamespace:o}),{selectedSources:c,fetchingNamespace:d,selectedAllNamespaces:u,onSelectAllNamespaces:m,getApiSourcesPayload:h,getApiFutureAppsPayload:g,searchText:y,setSearchText:v,searchBy:f,setSearchBy:b,showSelectedOnly:C,setShowSelectedOnly:k,showRunningOnly:w,setShowRunningOnly:$}=s;n(a,()=>({getFormValues:()=>({apps:h(),futureApps:g()})}));const D=Object.values(c).reduce((e,t)=>e+t.filter(e=>e.selected).length,0);return e.createElement(oe,{$isNotModal:!t},e.createElement(X,{$gap:12},e.createElement(X,{$gap:24},i&&e.createElement(gt,{onClick:i}),e.createElement(E,{title:p.SELECT_SOURCES,badgeLabel:D,description:p.SELECT_SOURCES_DESCRIPTION}),e.createElement(ce,{$justifyContent:"space-between"},e.createElement(Pl,{$fullWidth:r},e.createElement(x,{placeholder:f===B.Source?p.SEARCH_SOURCES:p.SEARCH_NAMESPACES,icon:To,value:y,onChange:e=>v(e.target.value.toLowerCase())})),!r&&e.createElement(O,{options:[{label:p.SOURCE,value:B.Source,selectedBgColor:l.text.secondary,selectedTextColor:l.text.primary},{label:p.NAMESPACE,value:B.Namespace,selectedBgColor:l.text.secondary,selectedTextColor:l.text.primary}],selected:f,setSelected:b})),e.createElement(ce,{$gap:36},e.createElement(S,{title:p.SELECT_ALL,initialValue:u,onChange:m,disabled:!!d}),e.createElement(S,{title:p.ONLY_SELECTED,initialValue:C,onChange:k}),e.createElement(S,{title:p.ONLY_RUNNING_INSTANCES,initialValue:w,onChange:$}))),e.createElement(le,null),e.createElement(vl,{isModal:t,...s})))});ql.displayName=ql.name;const Kl=({fetchSingleNamespace:t,persistSources:o})=>{const{currentModal:i,setCurrentModal:n}=Z(),l=i===B.Source,r=()=>{n("")},s=async()=>{if(c.current){const{apps:e,futureApps:t}=c.current.getFormValues();o(e,t),r()}},c=a(null);return q({key:"Enter",active:l},s),l?e.createElement(ee,{isOpen:l,onClose:r,header:{title:"Add Source"},actionComponent:e.createElement(te,{buttons:[{label:"DONE",variant:"primary",onClick:s}]})},e.createElement(ql,{ref:c,isModal:!0,fetchSingleNamespace:t})):null},jl=e=>{const t=[{key:"checkbox-and-icon",title:""},{key:"name",title:p.NAME,sortable:!0},{key:"kind",title:"Kind",sortable:!0}];return e||t.push({key:"namespace",title:p.NAMESPACE,sortable:!0}),t.push({key:"containers",title:p.DETECTED_CONTAINERS}),t.push({key:"conditions",title:"Conditions"}),t.push({key:"throughput",title:"Throughput",sortable:!0}),t},Vl=({metrics:t,maxHeight:o,maxWidth:i})=>{const a=I.useTheme(),{isVm:n}=He(),r=he(),{isThisPending:c}=R(),{selectedStreamName:d}=Ue(),{sources:u,sourcesLoading:m}=U(),{setDrawerType:h,setDrawerEntityId:g}=P(),{selectedSources:y,setSelectedSources:f}=Ae(),{isAwaitingInstrumentation:b,sourcesToCreate:x,sourcesCreated:C,sourcesToDelete:k,sourcesDeleted:w}=Me(),S=l(()=>{const e=(e,t)=>e>0&&Math.floor(100/e*t)||1;return x?e(x,C):k?e(k,w):1},[x,C,k,w]),$=l(()=>Ge(u,d),[u,d]),D=l(()=>Mi({instrumentationRules:[],sources:_e($,r),actions:[],destinations:[],searchText:r.searchText,selectedCategory:B.Source}).searchResults.find(({category:e})=>e===B.Source)?.entities||[],[$,r]),[N,O]=l(()=>{let e=0;return Object.values(y).forEach(t=>{e+=t.length}),[0!==e,e]},[y]),E=s(e=>{if(e){const e={};D.forEach(t=>{const o={namespace:t.namespace,name:t.name,kind:t.kind};c({entityType:B.Source,entityId:o})||(e[t.namespace]?e[t.namespace].push(t):e[t.namespace]=[t])}),f(e)}else f({})},[D]),A=s(e=>{const{namespace:t,name:o,kind:i}=e,a={...y};a[t]||(a[t]=[]);const n=a[t].findIndex(e=>e.name===o&&e.kind===i);-1===n?a[t].push(e):a[t].splice(n,1),f(a)},[y]),M=l(()=>D.map(o=>{const i=Vt(o),n=JSON.stringify(i),{hasErrors:l,hasWarnings:r,hasDisableds:s}=re(o.conditions||[]),d=c({entityType:B.Source,entityId:i}),u=!!y[i.namespace]?.find(e=>e.namespace===i.namespace&&e.name===i.name&&e.kind===i.kind);return{status:l?H.Error:r?H.Warning:void 0,faded:s,onClick:()=>{h(B.Source),g(i)},cells:[{columnKey:"checkbox-and-icon",component:()=>e.createElement(ce,{$gap:16},e.createElement(v,{disabled:d,value:u,onChange:()=>A(o)}),e.createElement(lo,{icons:ze(o.containers),id:n}))},{columnKey:"name",value:ve(o,B.Source,{extended:!0})},{columnKey:"kind",value:o.kind,textColor:a.text.info},{columnKey:"namespace",value:o.namespace,textColor:a.text.info},{columnKey:"throughput",value:qe(Tt(t,B.Source,i).throughput),textColor:a.text.info},{columnKey:"conditions",component:()=>e.createElement(Ei,{conditions:o.conditions||[],id:n})},{columnKey:"containers",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:H.Info,title:ro(o.containers),withBorder:!0}))}]}}),[D,y,t,A]),{badge:F,badgeTooltip:L}=l(()=>D.length!==$.length?{badge:`${D.length}/${$.length}`,badgeTooltip:p.FILTERED_COUNT_TOOLTIP}:{badge:$.length,badgeTooltip:void 0},[D,$]);return e.createElement(be,{$maxWidth:i},e.createElement(xe,null,e.createElement(v,{partiallyChecked:N&&D?.length!==O,value:N&&D?.length===O,onChange:E,disabled:!D?.length}),e.createElement(Ce,{icon:ke(B.Source),title:p.SOURCES,badge:F,badgeTooltip:L,loading:m||b})),e.createElement(we,{$maxHeight:o},e.createElement(Se,{columns:jl(n),rows:M})),b&&!M.length?e.createElement($e,{style:{marginTop:"2rem",gap:"24px"}},e.createElement(Ne,{width:420}),e.createElement(ce,{$gap:16},e.createElement(T,{color:a.text.info},x?"Instrumenting":"Uninstrumenting"," workloads..."),e.createElement(Te,{label:`${S}%`}))):M.length?null:e.createElement($e,{style:{marginTop:"2rem"}},e.createElement(De,null)))},zl=({expiresAt:t})=>{const o=I.useTheme(),i=zt().format(t),a=new Date(t).toDateString().split(" ").slice(1).join(" "),n=so(t,0)?o.text.error:so(t,6048e5)?o.text.warning:o.text.success;return e.createElement(T,{size:14,color:n},i," (",a,")")},Bl=d.div`
486
+ `,ql=i(({isModal:t,fetchSingleNamespace:o,onClickSummary:i},a)=>{const l=I.useTheme(),{isVm:r}=He(),s=no({fetchSingleNamespace:o}),{selectedSources:c,fetchingNamespace:d,selectedAllNamespaces:u,onSelectAllNamespaces:m,getApiSourcesPayload:h,getApiFutureAppsPayload:g,searchText:y,setSearchText:v,searchBy:f,setSearchBy:b,showSelectedOnly:C,setShowSelectedOnly:k,showRunningOnly:w,setShowRunningOnly:$}=s;n(a,()=>({getFormValues:()=>({apps:h(),futureApps:g()})}));const D=Object.values(c).reduce((e,t)=>e+t.filter(e=>e.selected).length,0);return e.createElement(oe,{$isNotModal:!t},e.createElement(X,{$gap:12},e.createElement(X,{$gap:24},i&&e.createElement(gt,{onClick:i}),e.createElement(O,{title:p.SELECT_SOURCES,badgeLabel:D,description:p.SELECT_SOURCES_DESCRIPTION}),e.createElement(ce,{$justifyContent:"space-between"},e.createElement(Pl,{$fullWidth:r},e.createElement(x,{placeholder:f===B.Source?p.SEARCH_SOURCES:p.SEARCH_NAMESPACES,icon:To,value:y,onChange:e=>v(e.target.value.toLowerCase())})),!r&&e.createElement(E,{options:[{label:p.SOURCE,value:B.Source,selectedBgColor:l.text.secondary,selectedTextColor:l.text.primary},{label:p.NAMESPACE,value:B.Namespace,selectedBgColor:l.text.secondary,selectedTextColor:l.text.primary}],selected:f,setSelected:b})),e.createElement(ce,{$gap:36},e.createElement(S,{title:p.SELECT_ALL,initialValue:u,onChange:m,disabled:!!d}),e.createElement(S,{title:p.ONLY_SELECTED,initialValue:C,onChange:k}),e.createElement(S,{title:p.ONLY_RUNNING_INSTANCES,initialValue:w,onChange:$}))),e.createElement(le,null),e.createElement(vl,{isModal:t,...s})))});ql.displayName=ql.name;const Kl=({fetchSingleNamespace:t,persistSources:o})=>{const{currentModal:i,setCurrentModal:n}=Z(),l=i===B.Source,r=()=>{n("")},s=async()=>{if(c.current){const{apps:e,futureApps:t}=c.current.getFormValues();o(e,t),r()}},c=a(null);return q({key:"Enter",active:l},s),l?e.createElement(ee,{isOpen:l,onClose:r,header:{title:"Add Source"},actionComponent:e.createElement(te,{buttons:[{label:"DONE",variant:"primary",onClick:s}]})},e.createElement(ql,{ref:c,isModal:!0,fetchSingleNamespace:t})):null},jl=e=>{const t=[{key:"checkbox-and-icon",title:""},{key:"name",title:p.NAME,sortable:!0},{key:"kind",title:"Kind",sortable:!0}];return e||t.push({key:"namespace",title:p.NAMESPACE,sortable:!0}),t.push({key:"containers",title:p.DETECTED_CONTAINERS}),t.push({key:"conditions",title:"Conditions"}),t.push({key:"throughput",title:"Throughput",sortable:!0}),t},Vl=({metrics:t,maxHeight:o,maxWidth:i})=>{const a=I.useTheme(),{isVm:n}=He(),r=he(),{isThisPending:c}=R(),{selectedStreamName:d}=Ue(),{sources:u,sourcesLoading:m}=U(),{setDrawerType:h,setDrawerEntityId:g}=P(),{selectedSources:y,setSelectedSources:f}=Ae(),{isAwaitingInstrumentation:b,sourcesToCreate:x,sourcesCreated:C,sourcesToDelete:k,sourcesDeleted:w}=Me(),S=l(()=>{const e=(e,t)=>e>0&&Math.floor(100/e*t)||1;return x?e(x,C):k?e(k,w):1},[x,C,k,w]),$=l(()=>Ge(u,d),[u,d]),D=l(()=>Mi({instrumentationRules:[],sources:_e($,r),actions:[],destinations:[],searchText:r.searchText,selectedCategory:B.Source}).searchResults.find(({category:e})=>e===B.Source)?.entities||[],[$,r]),[N,E]=l(()=>{let e=0;return Object.values(y).forEach(t=>{e+=t.length}),[0!==e,e]},[y]),O=s(e=>{if(e){const e={};D.forEach(t=>{const o={namespace:t.namespace,name:t.name,kind:t.kind};c({entityType:B.Source,entityId:o})||(e[t.namespace]?e[t.namespace].push(t):e[t.namespace]=[t])}),f(e)}else f({})},[D]),A=s(e=>{const{namespace:t,name:o,kind:i}=e,a={...y};a[t]||(a[t]=[]);const n=a[t].findIndex(e=>e.name===o&&e.kind===i);-1===n?a[t].push(e):a[t].splice(n,1),f(a)},[y]),M=l(()=>D.map(o=>{const i=Vt(o),n=JSON.stringify(i),{hasErrors:l,hasWarnings:r,hasDisableds:s}=re(o.conditions||[]),d=c({entityType:B.Source,entityId:i}),u=!!y[i.namespace]?.find(e=>e.namespace===i.namespace&&e.name===i.name&&e.kind===i.kind);return{status:l?H.Error:r?H.Warning:void 0,faded:s,onClick:()=>{h(B.Source),g(i)},cells:[{columnKey:"checkbox-and-icon",component:()=>e.createElement(ce,{$gap:16},e.createElement(v,{disabled:d,value:u,onChange:()=>A(o)}),e.createElement(lo,{icons:ze(o.containers),id:n}))},{columnKey:"name",value:ve(o,B.Source,{extended:!0})},{columnKey:"kind",value:o.kind,textColor:a.text.info},{columnKey:"namespace",value:o.namespace,textColor:a.text.info},{columnKey:"throughput",value:qe(Tt(t,B.Source,i).throughput),textColor:a.text.info},{columnKey:"conditions",component:()=>e.createElement(Oi,{conditions:o.conditions||[],id:n})},{columnKey:"containers",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:H.Info,title:ro(o.containers),withBorder:!0}))}]}}),[D,y,t,A]),{badge:F,badgeTooltip:L}=l(()=>D.length!==$.length?{badge:`${D.length}/${$.length}`,badgeTooltip:p.FILTERED_COUNT_TOOLTIP}:{badge:$.length,badgeTooltip:void 0},[D,$]);return e.createElement(be,{$maxWidth:i},e.createElement(xe,null,e.createElement(v,{partiallyChecked:N&&D?.length!==E,value:N&&D?.length===E,onChange:O,disabled:!D?.length}),e.createElement(Ce,{icon:ke(B.Source),title:p.SOURCES,badge:F,badgeTooltip:L,loading:m||b})),e.createElement(we,{$maxHeight:o},e.createElement(Se,{columns:jl(n),rows:M})),b&&!M.length?e.createElement($e,{style:{marginTop:"2rem",gap:"24px"}},e.createElement(Ne,{width:420}),e.createElement(ce,{$gap:16},e.createElement(T,{color:a.text.info},x?"Instrumenting":"Uninstrumenting"," workloads..."),e.createElement(Te,{label:`${S}%`}))):M.length?null:e.createElement($e,{style:{marginTop:"2rem"}},e.createElement(De,null)))},zl=({expiresAt:t})=>{const o=I.useTheme(),i=zt().format(t),a=new Date(t).toDateString().split(" ").slice(1).join(" "),n=so(t,0)?o.text.error:so(t,6048e5)?o.text.warning:o.text.success;return e.createElement(T,{size:14,color:n},i," (",a,")")},Bl=d.div`
487
487
  position: relative;
488
488
  `,Hl=({token:o,saveToken:i})=>{const a=I.useTheme(),{isCopied:n,clickCopy:l}=co(),{formData:r,handleFormChange:s,resetFormData:c}=uo({token:o}),[d,u]=t(!1),p=()=>{u(!1),c()},m=me(H.Success,a);return e.createElement(ce,{$gap:0},e.createElement(pt,{size:32,onClick:()=>l(o)},n?e.createElement(m,null):e.createElement(Ho,null)),e.createElement(le,{orientation:"vertical",length:"12px"}),e.createElement(Bl,null,e.createElement(pt,{size:32,onClick:()=>{u(!0)}},e.createElement(So,null)),d&&e.createElement(po,{flipX:!0,clientX:36,isOpen:d,onClose:p,onSave:()=>{i(r.token).then(p)},title:"Enter a new API Token",titleTooltip:"Contact us to generate a new one"},e.createElement(x,{placeholder:"API Token",type:"password",value:r.token,onChange:e=>s("token",e.target.value)}))))},Ul=({tokens:t,saveToken:o})=>e.createElement(Y,{title:"Authorization Tokens",titleBadge:t.length,data:[{type:m.Table,value:{columns:[{key:"icon",title:""},{key:"name",title:"Name"},{key:"expires_at",title:"Expires"},{key:"token",title:"Token"},{key:"actions",title:""}],rows:t.map(({name:t,token:i,expiresAt:a})=>({cells:[{columnKey:"icon",icon:Uo},{columnKey:"name",value:t},{columnKey:"token",value:`${new Array(15).fill("•").join("")}`},{columnKey:"expires_at",component:()=>e.createElement(zl,{expiresAt:a})},{columnKey:"actions",component:()=>e.createElement(Hl,{token:i,saveToken:o})}]}))}}]}),Wl=({fetchDescribeOdigos:i})=>{const[a,n]=t(null);if(o(()=>{i().then(({data:e})=>{n(e?.describeOdigos||null)})},[i]),!a)return e.createElement($e,null,e.createElement(Re,null));const l=t=>t?.name?[e.createElement(le,{key:`divider-${t.name}`}),e.createElement(Qt,{key:`describe-row-${t.name}`,title:t.name,subTitle:t.explain||void 0,value:{status:t.status||(Zt(t.value)?eo(t.value)?H.Success:H.Error:H.Default),text:t.value}})]:[];return e.createElement(e.Fragment,null,e.createElement(Y,{title:"General Information",withExtend:!0,initialExtended:!0,data:[{title:a?.odigosVersion?.name,value:a?.odigosVersion?.value},{title:a?.kubernetesVersion?.name,value:a?.kubernetesVersion?.value},{title:a?.installationMethod?.name,value:a?.installationMethod?.value},{title:a?.tier?.name,value:a?.tier?.value},{title:"# of sources",value:a?.numberOfSources?.toString()},{title:"# of destinations",value:a?.numberOfDestinations?.toString()}]}),e.createElement(Y,{title:"Cluster Collector",withExtend:!0},Object.values(a?.clusterCollector||{}).map(l)),e.createElement(Y,{title:"Node Collector",withExtend:!0},Object.values(a?.nodeCollector||{}).map(l)))},_l=d.div`
489
489
  display: flex;
@@ -516,7 +516,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
516
516
  overflow-y: auto;
517
517
  `,cr=d.div`
518
518
  position: relative;
519
- `,dr="System Settings",ur=({installationMethod:i,fetchSettings:n,onSave:l})=>{const[r,s]=t(void 0),[c,d]=t(!1),[u,p]=t(!1),[m,h]=t(!1),g=()=>h(e=>!e),{popupRef:y,popupOpen:v,setPopupOpen:f}=Xe(),{formData:b,handleFormChange:x,resetFormData:C,isFormDirty:k}=uo(r);o(()=>{m?n().then(s):s(void 0)},[m]);const[w,$]=t(!1),[D,N]=t(null),I=e=>{k?($(!0),N(()=>e)):e()},[O,E]=t(Yl.General),A=a(null),M=a(null),F=a(null),R=a(null),L=a(null),P=a(null),q=[M,F,R,L,P],V=[Yl.General,Yl.Ui,Yl.Rollback,Yl.CollectorNode,Yl.CollectorGateway];return e.createElement(e.Fragment,null,e.createElement(pt,{key:dr,onClick:g,tooltip:dr},e.createElement(_o,{size:18})),e.createElement(j,{width:"750px",isOpen:m,onClose:()=>I(g),header:{icons:[_o],title:dr,tabs:V.map(e=>({label:e,onClick:()=>(e=>{E(e),(e=>{const t=A.current;if(!t)return;let o=0;for(let i=0;i<q.length;i++){const a=q[i].current;if(a&&a.id===e){const e=t.getBoundingClientRect();o=a.getBoundingClientRect().top-e.top+t.scrollTop;break}}t.scrollTo({top:e===Yl.General?0:o,behavior:"smooth"})})(e)})(e),selected:O===e})),actions:[e.createElement(cr,{key:"actions"},e.createElement(pt,{withBorder:!0,onClick:()=>f(e=>!e)},e.createElement(T,{size:10},"•••")),e.createElement(Ze,{ref:y,isOpen:v,top:36,right:0,padding:"24px",width:"270px"},e.createElement(S,{title:"Enable Advanced Mode",tooltip:"Show advanced settings. Note: these are not recommended to be changed unless you know what you are doing.",initialValue:u,onChange:()=>p(e=>!e),flipHorizontally:!0})))]},footer:{isOpen:k,centerButtons:[{"data-id":"drawer-cancel",variant:"secondary",onClick:()=>I(C),children:K.CANCEL},{"data-id":"drawer-save",variant:"primary",onClick:async()=>{d(!0),await l(b),s(await n()),d(!1),C(),g()},children:K.SAVE}]}},void 0===b?.imagePrefix||c?e.createElement($e,null,e.createElement(Re,{scale:1.2})):e.createElement(sr,{ref:A},i===yo.Helm&&e.createElement(ie,{type:H.Warning,title:"Helm",message:"Changes won't persist unless you update the `values.yaml` file"}),e.createElement(ar,{ref:M,isAdvanced:u,formData:b,handleFormChange:x}),e.createElement(er,{ref:F,isAdvanced:u,formData:b,handleFormChange:x}),e.createElement(nr,{ref:R,isAdvanced:u,formData:b,handleFormChange:x}),e.createElement(lr,{ref:L,isAdvanced:u,formData:b,handleFormChange:x}),e.createElement(rr,{ref:P,isAdvanced:u,formData:b,handleFormChange:x}))),e.createElement(z,{isOpen:w,name:dr,onApprove:()=>{D?.(),$(!1)},onDeny:()=>{$(!1)}}))},pr=d.div`
519
+ `,dr="System Settings",ur=({installationMethod:i,fetchSettings:n,onSave:l})=>{const[r,s]=t(void 0),[c,d]=t(!1),[u,p]=t(!1),[m,h]=t(!1),g=()=>h(e=>!e),{popupRef:y,popupOpen:v,setPopupOpen:f}=Xe(),{formData:b,handleFormChange:x,resetFormData:C,isFormDirty:k}=uo(r);o(()=>{m?n().then(s):s(void 0)},[m]);const[w,$]=t(!1),[D,N]=t(null),I=e=>{k?($(!0),N(()=>e)):e()},[E,O]=t(Yl.General),A=a(null),M=a(null),F=a(null),R=a(null),L=a(null),P=a(null),q=[M,F,R,L,P],V=[Yl.General,Yl.Ui,Yl.Rollback,Yl.CollectorNode,Yl.CollectorGateway];return e.createElement(e.Fragment,null,e.createElement(pt,{key:dr,onClick:g,tooltip:dr},e.createElement(_o,{size:18})),e.createElement(j,{width:"750px",isOpen:m,onClose:()=>I(g),header:{icons:[_o],title:dr,tabs:V.map(e=>({label:e,onClick:()=>(e=>{O(e),(e=>{const t=A.current;if(!t)return;let o=0;for(let i=0;i<q.length;i++){const a=q[i].current;if(a&&a.id===e){const e=t.getBoundingClientRect();o=a.getBoundingClientRect().top-e.top+t.scrollTop;break}}t.scrollTo({top:e===Yl.General?0:o,behavior:"smooth"})})(e)})(e),selected:E===e})),actions:[e.createElement(cr,{key:"actions"},e.createElement(pt,{withBorder:!0,onClick:()=>f(e=>!e)},e.createElement(T,{size:10},"•••")),e.createElement(Ze,{ref:y,isOpen:v,top:36,right:0,padding:"24px",width:"270px"},e.createElement(S,{title:"Enable Advanced Mode",tooltip:"Show advanced settings. Note: these are not recommended to be changed unless you know what you are doing.",initialValue:u,onChange:()=>p(e=>!e),flipHorizontally:!0})))]},footer:{isOpen:k,centerButtons:[{"data-id":"drawer-cancel",variant:"secondary",onClick:()=>I(C),children:K.CANCEL},{"data-id":"drawer-save",variant:"primary",onClick:async()=>{d(!0),await l(b),s(await n()),d(!1),C(),g()},children:K.SAVE}]}},void 0===b?.imagePrefix||c?e.createElement($e,null,e.createElement(Re,{scale:1.2})):e.createElement(sr,{ref:A},i===yo.Helm&&e.createElement(ie,{type:H.Warning,title:"Helm",message:"Changes won't persist unless you update the `values.yaml` file"}),e.createElement(ar,{ref:M,isAdvanced:u,formData:b,handleFormChange:x}),e.createElement(er,{ref:F,isAdvanced:u,formData:b,handleFormChange:x}),e.createElement(nr,{ref:R,isAdvanced:u,formData:b,handleFormChange:x}),e.createElement(lr,{ref:L,isAdvanced:u,formData:b,handleFormChange:x}),e.createElement(rr,{ref:P,isAdvanced:u,formData:b,handleFormChange:x}))),e.createElement(z,{isOpen:w,name:dr,onApprove:()=>{D?.(),$(!1)},onDeny:()=>{$(!1)}}))},pr=d.div`
520
520
  position: fixed;
521
521
  bottom: 12px;
522
522
  left: 12px;
@@ -582,20 +582,20 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
582
582
  position: absolute;
583
583
  right: 56px;
584
584
  width: calc(100% - ${434}px);
585
- `,Or=d.div`
585
+ `,Er=d.div`
586
586
  position: absolute;
587
587
  left: ${({$startTime:e,$minStartTime:t,$maxEndTime:o})=>(e-t)/(o-t)*100+"%"};
588
588
  width: ${({$duration:e,$maxDuration:t})=>e/t*100+"%"};
589
589
  height: 12px;
590
590
  border-radius: 32px;
591
591
  background-color: ${({$indexInMatrix:e})=>Dr[e%Dr.length]};
592
- `,Er=d(T)`
592
+ `,Or=d(T)`
593
593
  padding-left: calc(100% + 8px);
594
594
  font-size: 10px;
595
595
  color: ${({theme:e})=>e.text.darker_grey};
596
596
  font-family: ${({theme:e})=>e.font_family.secondary};
597
597
  white-space: nowrap;
598
- `,Ar=({span:o,depth:i,indexInMatrix:a,maxDuration:n,minStartTime:l,maxEndTime:r,withErrors:s,errorTooltip:c,isOpen:d,withToggle:u,onToggleOpen:p,onSelect:m})=>{const h=I.useTheme(),[g,y]=t(!1),v=$r-12*i-20-(s?12:0),f=s&&(1===i||o.logs.length>0);return e.createElement(Nr,{className:"span-container",$withErrors:s,$preventHover:g,onClick:m},e.createElement(Tr,{$depth:i,className:"span-left"},e.createElement(ce,{$gap:4,$alignItems:"center"},u?e.createElement("div",{onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1)},e.createElement(pt,{onClick:e=>{e.stopPropagation(),p?.()},size:24},e.createElement(mt,{extend:d??!1}))):e.createElement("div",{style:{width:"24px"}}),e.createElement(Co,{maxWidth:v/2,text:o.processID,textSize:14}),e.createElement(T,{size:12,color:h.text.darker_grey},"•"),e.createElement(Co,{maxWidth:v/2,text:o.operationName,textSize:12,textColor:h.text.darker_grey})),s&&(f?e.createElement(ue,{...c},e.createElement(Yo,{fill:h.text.error})):e.createElement("div",{style:{position:"relative"}},e.createElement("div",{style:{position:"absolute",top:"-24px",right:"8px"}},e.createElement(le,{type:H.Error,orientation:"vertical",thickness:1,length:"48px",margin:"0",opacity:.5}))))),e.createElement(Ir,{className:"span-right"},e.createElement(Or,{$indexInMatrix:a,$duration:o.duration,$maxDuration:n,$startTime:o.startTime,$minStartTime:l,$maxEndTime:r},e.createElement(Er,null,fo(o.duration)))))},Mr=({spans:t,logs:o,depth:i,indexInMatrix:a,maxDuration:n,minStartTime:l,maxEndTime:r,openSpanIdsState:s,selectedSpanState:c})=>{const d=I.useTheme();return t.map((t,u)=>{const p=t.spanID,m=s.value.includes(p),h=!!t.spans?.length,g=o.length?o:xo(t,"spans","logs"),y=g.length>0,v=y?g.length>1?`(${g.length}) errors`:g[0].fields.find(e=>"exception.message"===e.key)?.value:void 0,f=y?g.length>1?void 0:g[0].fields.find(e=>"exception.stacktrace"===e.key)?.value:void 0;return e.createElement("div",{key:`span-${p}`,style:{borderBottom:1===i?`1px dotted ${d.colors.border}`:"none"}},e.createElement(Ar,{span:t,depth:i,indexInMatrix:a+u+i,maxDuration:n,minStartTime:l,maxEndTime:r,withErrors:y,errorTooltip:{titleIcon:Yo,title:v,text:f},isOpen:m,withToggle:h,onToggleOpen:()=>s.set(e=>e.some(e=>e===p)?e.filter(e=>e!=p):[...e,p,...xo(t,"spans","spanID")]),onSelect:()=>c.set(e=>e?.spanID===p?null:t)}),m&&h?e.createElement(Mr,{spans:t.spans||[],logs:g,depth:i+1,indexInMatrix:a+u,maxDuration:n,minStartTime:l,maxEndTime:r,openSpanIdsState:s,selectedSpanState:c}):null)})},Fr=d.div`
598
+ `,Ar=({span:o,depth:i,indexInMatrix:a,maxDuration:n,minStartTime:l,maxEndTime:r,withErrors:s,errorTooltip:c,isOpen:d,withToggle:u,onToggleOpen:p,onSelect:m})=>{const h=I.useTheme(),[g,y]=t(!1),v=$r-12*i-20-(s?12:0),f=s&&(1===i||o.logs.length>0);return e.createElement(Nr,{className:"span-container",$withErrors:s,$preventHover:g,onClick:m},e.createElement(Tr,{$depth:i,className:"span-left"},e.createElement(ce,{$gap:4,$alignItems:"center"},u?e.createElement("div",{onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1)},e.createElement(pt,{onClick:e=>{e.stopPropagation(),p?.()},size:24},e.createElement(mt,{extend:d??!1}))):e.createElement("div",{style:{width:"24px"}}),e.createElement(Co,{maxWidth:v/2,text:o.processID,textSize:14}),e.createElement(T,{size:12,color:h.text.darker_grey},"•"),e.createElement(Co,{maxWidth:v/2,text:o.operationName,textSize:12,textColor:h.text.darker_grey})),s&&(f?e.createElement(ue,{...c},e.createElement(Yo,{fill:h.text.error})):e.createElement("div",{style:{position:"relative"}},e.createElement("div",{style:{position:"absolute",top:"-24px",right:"8px"}},e.createElement(le,{type:H.Error,orientation:"vertical",thickness:1,length:"48px",margin:"0",opacity:.5}))))),e.createElement(Ir,{className:"span-right"},e.createElement(Er,{$indexInMatrix:a,$duration:o.duration,$maxDuration:n,$startTime:o.startTime,$minStartTime:l,$maxEndTime:r},e.createElement(Or,null,fo(o.duration)))))},Mr=({spans:t,logs:o,depth:i,indexInMatrix:a,maxDuration:n,minStartTime:l,maxEndTime:r,openSpanIdsState:s,selectedSpanState:c})=>{const d=I.useTheme();return t.map((t,u)=>{const p=t.spanID,m=s.value.includes(p),h=!!t.spans?.length,g=o.length?o:xo(t,"spans","logs"),y=g.length>0,v=y?g.length>1?`(${g.length}) errors`:g[0].fields.find(e=>"exception.message"===e.key)?.value:void 0,f=y?g.length>1?void 0:g[0].fields.find(e=>"exception.stacktrace"===e.key)?.value:void 0;return e.createElement("div",{key:`span-${p}`,style:{borderBottom:1===i?`1px dotted ${d.colors.border}`:"none"}},e.createElement(Ar,{span:t,depth:i,indexInMatrix:a+u+i,maxDuration:n,minStartTime:l,maxEndTime:r,withErrors:y,errorTooltip:{titleIcon:Yo,title:v,text:f},isOpen:m,withToggle:h,onToggleOpen:()=>s.set(e=>e.some(e=>e===p)?e.filter(e=>e!=p):[...e,p,...xo(t,"spans","spanID")]),onSelect:()=>c.set(e=>e?.spanID===p?null:t)}),m&&h?e.createElement(Mr,{spans:t.spans||[],logs:g,depth:i+1,indexInMatrix:a+u,maxDuration:n,minStartTime:l,maxEndTime:r,openSpanIdsState:s,selectedSpanState:c}):null)})},Fr=d.div`
599
599
  width: 100%;
600
600
  `,Rr=d.div`
601
601
  max-height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px + 2px)`};
@@ -625,4 +625,4 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
625
625
  padding-top: 12px;
626
626
  padding-left: 12px;
627
627
  white-space: nowrap;
628
- `,Kr=({heightToRemove:o,traces:i,isLoading:a})=>{const[n,r]=t([]),[s,c]=t(null),d=l(()=>$t(i).sort((e,t)=>t.spans[0].startTime-e.spans[0].startTime).map(e=>({...e,spans:fr(e)})),[i]),u=l(()=>d.reduce((e,t)=>Math.max(e,t.spans.reduce((e,t)=>e+t.duration,0)),0),[d]),m=l(()=>{const e=d.find(e=>e.spans.some(e=>e.spanID===s?.spanID)),t=e?.processes.find(e=>e.serviceName===s?.processID);return t},[d,s]);return e.createElement(e.Fragment,null,e.createElement(Fr,{$heightToRemove:o},a?e.createElement($e,{$height:"50vh"},e.createElement(Re,{scale:1.5})):d.length?e.createElement(Rr,{$heightToRemove:o},e.createElement(Lr,null,e.createElement(T,null,"Service & operation")),new Array(5).fill(null).map((t,i)=>e.createElement(Pr,{key:`${i}-divider`,$heightToRemove:o,index:i},e.createElement(qr,null,fo(u/5*i)))),d.map((t,o)=>{const{spans:i}=t,a=i.reduce((e,t)=>Math.min(e,t.startTime),Number.MAX_SAFE_INTEGER),l=i.reduce((e,t)=>Math.max(e,t.startTime+t.duration),0);return e.createElement(Mr,{key:`recursive-spans-${t.traceID}`,spans:i,logs:[],depth:1,indexInMatrix:o,maxDuration:u,minStartTime:a,maxEndTime:l,openSpanIdsState:{value:n,set:r},selectedSpanState:{value:s,set:c}})})):e.createElement($e,{$height:"50vh"},e.createElement(De,{title:p.NO_TRACES_FOUND,subTitle:p.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}))),s&&e.createElement(Sr,{span:s,process:m,onClose:()=>c(null)}))};export{Ni as ActionDrawer,ki as ActionForm,Ii as ActionModal,Ri as ActionTable,ji as AwaitPipeline,ra as ConditionDropdown,oa as DataFlow,Aa as DataFlowActionsMenu,ka as DataStreamDrawer,xa as DataStreamForm,Fa as DataStreamModal,Ma as DataStreamSelectionForm,_a as DestinationDrawer,Ha as DestinationForm,mn as DestinationModal,fn as DestinationSelectionForm,xn as DestinationTable,sa as ErrorDropdown,Ln as InstrumentationRuleDrawer,Mn as InstrumentationRuleForm,Kn as InstrumentationRuleModal,zn as InstrumentationRuleTable,pa as KindDropdown,ca as LanguageDropdown,da as MonitorDropdown,Hn as MultiSourceControl,ua as NamespaceDropdown,Cl as NavIconIds,Yn as NotificationManager,wi as OverviewDrawer,rl as ServiceMap,xl as SetupSummary,kl as SideNav,wl as SlackInvite,Ll as SourceDrawer,Dl as SourceForm,Kl as SourceModal,ql as SourceSelectionForm,Vl as SourceTable,Jl as SystemOverview,ur as SystemSettings,Ei as TableCellConditions,mr as ToastList,vr as ToggleDarkMode,Kr as TraceView};
628
+ `,Kr=({heightToRemove:o,traces:i,isLoading:a})=>{const[n,r]=t([]),[s,c]=t(null),d=l(()=>$t(i).sort((e,t)=>t.spans[0].startTime-e.spans[0].startTime).map(e=>({...e,spans:fr(e)})),[i]),u=l(()=>d.reduce((e,t)=>Math.max(e,t.spans.reduce((e,t)=>e+t.duration,0)),0),[d]),m=l(()=>{const e=d.find(e=>e.spans.some(e=>e.spanID===s?.spanID)),t=e?.processes.find(e=>e.serviceName===s?.processID);return t},[d,s]);return e.createElement(e.Fragment,null,e.createElement(Fr,{$heightToRemove:o},a?e.createElement($e,{$height:"50vh"},e.createElement(Re,{scale:1.5})):d.length?e.createElement(Rr,{$heightToRemove:o},e.createElement(Lr,null,e.createElement(T,null,"Service & operation")),new Array(5).fill(null).map((t,i)=>e.createElement(Pr,{key:`${i}-divider`,$heightToRemove:o,index:i},e.createElement(qr,null,fo(u/5*i)))),d.map((t,o)=>{const{spans:i}=t,a=i.reduce((e,t)=>Math.min(e,t.startTime),Number.MAX_SAFE_INTEGER),l=i.reduce((e,t)=>Math.max(e,t.startTime+t.duration),0);return e.createElement(Mr,{key:`recursive-spans-${t.traceID}`,spans:i,logs:[],depth:1,indexInMatrix:o,maxDuration:u,minStartTime:a,maxEndTime:l,openSpanIdsState:{value:n,set:r},selectedSpanState:{value:s,set:c}})})):e.createElement($e,{$height:"50vh"},e.createElement(De,{title:p.NO_TRACES_FOUND,subTitle:p.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}))),s&&e.createElement(Sr,{span:s,process:m,onClose:()=>c(null)}))};export{Ni as ActionDrawer,ki as ActionForm,Ii as ActionModal,Ri as ActionTable,ji as AwaitPipeline,ra as ConditionDropdown,oa as DataFlow,Aa as DataFlowActionsMenu,ka as DataStreamDrawer,xa as DataStreamForm,Fa as DataStreamModal,Ma as DataStreamSelectionForm,_a as DestinationDrawer,Ha as DestinationForm,mn as DestinationModal,fn as DestinationSelectionForm,xn as DestinationTable,sa as ErrorDropdown,Ln as InstrumentationRuleDrawer,Mn as InstrumentationRuleForm,Kn as InstrumentationRuleModal,zn as InstrumentationRuleTable,pa as KindDropdown,ca as LanguageDropdown,da as MonitorDropdown,Hn as MultiSourceControl,ua as NamespaceDropdown,Cl as NavIconIds,Yn as NotificationManager,wi as OverviewDrawer,rl as ServiceMap,xl as SetupSummary,kl as SideNav,wl as SlackInvite,Ll as SourceDrawer,Dl as SourceForm,Kl as SourceModal,ql as SourceSelectionForm,Vl as SourceTable,Jl as SystemOverview,ur as SystemSettings,Oi as TableCellConditions,mr as ToastList,vr as ToggleDarkMode,Kr as TraceView};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odigos/ui-kit",
3
- "version": "0.0.125",
3
+ "version": "0.0.126",
4
4
  "author": "Odigos",
5
5
  "license": "MIT",
6
6
  "repository": {