@odigos/ui-kit 0.0.261 → 0.0.263-dev.519

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/lib/chunks/{connections-scope-DhNWocBO.js → connections-scope-DEVWbigK.js} +1 -1
  3. package/lib/chunks/index-BVtv0LGZ.js +155 -0
  4. package/lib/chunks/{odigos-context-BYgtdAtj.js → odigos-context-DGEWcwEQ.js} +1 -2
  5. package/lib/chunks/source-instrument-form-context-DMCdySjE.js +1 -0
  6. package/lib/chunks/ui-components-BDtk3K99.js +1742 -0
  7. package/lib/chunks/use-odigos-api-ZAJiPzPh.js +5 -0
  8. package/lib/components/_v2/cards/section-card/index.d.ts +2 -0
  9. package/lib/components/_v2/index.d.ts +1 -0
  10. package/lib/components/_v2/input-list/index.d.ts +2 -0
  11. package/lib/components/_v2/input-table/card-table.d.ts +10 -0
  12. package/lib/components/_v2/input-table/dynamic-field/index.d.ts +1 -0
  13. package/lib/components/_v2/input-table/index.d.ts +2 -0
  14. package/lib/components/_v2/input-table/types.d.ts +13 -1
  15. package/lib/components/_v2/radio-card/index.d.ts +16 -0
  16. package/lib/components/v2.js +1 -1
  17. package/lib/components.js +1 -1
  18. package/lib/constants/instrumentation-rules/index.d.ts +2 -1
  19. package/lib/constants/strings/index.d.ts +64 -0
  20. package/lib/constants.js +1 -1
  21. package/lib/containers/_v2/_drawers/add-source-drawer/strings.d.ts +1 -0
  22. package/lib/containers/_v2/_drawers/create-cloud-connector-drawer/index.d.ts +15 -0
  23. package/lib/containers/_v2/_drawers/create-cloud-connector-drawer/steps/select-provider/custom-resource-table.d.ts +9 -0
  24. package/lib/containers/_v2/_drawers/create-cloud-connector-drawer/steps/select-provider/helpers.d.ts +5 -0
  25. package/lib/containers/_v2/_drawers/create-cloud-connector-drawer/steps/select-provider/index.d.ts +2 -0
  26. package/lib/containers/_v2/_drawers/create-cloud-connector-drawer/steps/select-provider/permission-list.d.ts +12 -0
  27. package/lib/containers/_v2/_drawers/create-cloud-connector-drawer/steps/select-provider/permissions.d.ts +25 -0
  28. package/lib/containers/_v2/_drawers/create-cloud-connector-drawer/steps/select-provider/policy-preview.d.ts +5 -0
  29. package/lib/containers/_v2/_drawers/create-cloud-connector-drawer/steps/select-provider/provider-list.d.ts +8 -0
  30. package/lib/containers/_v2/_drawers/create-cloud-connector-drawer/steps/setup-credentials/create-role-section.d.ts +6 -0
  31. package/lib/containers/_v2/_drawers/create-cloud-connector-drawer/steps/setup-credentials/enter-arn-section.d.ts +5 -0
  32. package/lib/containers/_v2/_drawers/create-cloud-connector-drawer/steps/setup-credentials/index.d.ts +5 -0
  33. package/lib/containers/_v2/_drawers/create-cloud-connector-drawer/steps/setup-credentials/methods.d.ts +30 -0
  34. package/lib/containers/_v2/_drawers/create-cloud-connector-drawer/steps/setup-credentials/section.d.ts +9 -0
  35. package/lib/containers/_v2/_drawers/create-cloud-connector-drawer/steps/validate-connection/index.d.ts +8 -0
  36. package/lib/containers/_v2/_drawers/index.d.ts +1 -0
  37. package/lib/containers/_v2/_forms/add-action-form/dynamic-fields/index.d.ts +1 -0
  38. package/lib/containers/_v2/_forms/add-rule-form/custom-fields/index.d.ts +2 -1
  39. package/lib/containers/_v2/central-connections/helpers.d.ts +9 -0
  40. package/lib/containers/_v2/central-connections/index.d.ts +6 -1
  41. package/lib/containers/_v2/settings/side-menu/index.d.ts +12 -0
  42. package/lib/containers/_v2/settings/toolbar/index.d.ts +2 -5
  43. package/lib/containers/v2.js +598 -158
  44. package/lib/containers.js +1 -1
  45. package/lib/contexts/cloud-connector-form-context.d.ts +35 -0
  46. package/lib/contexts/index.d.ts +1 -0
  47. package/lib/contexts/odigos-api/capabilities.d.ts +1 -0
  48. package/lib/contexts/odigos-api/hooks/use-instrumentation-rules-api.d.ts +13 -1
  49. package/lib/contexts/odigos-api/types.d.ts +3 -1
  50. package/lib/contexts/odigos-api.js +1 -1
  51. package/lib/contexts/rule-form-context.d.ts +1 -1
  52. package/lib/contexts.js +1 -1
  53. package/lib/functions.js +1 -1
  54. package/lib/hooks.js +1 -1
  55. package/lib/icons/common/index.d.ts +1 -0
  56. package/lib/icons/common/lock-icon/index.d.ts +2 -0
  57. package/lib/icons/compute-platform/cloud-connector-icon/index.d.ts +2 -0
  58. package/lib/icons/compute-platform/cloud-connector-policy-icon/index.d.ts +2 -0
  59. package/lib/icons/compute-platform/index.d.ts +2 -0
  60. package/lib/icons.js +1 -1
  61. package/lib/snippets/_v2/connector-created-modal/index.d.ts +7 -0
  62. package/lib/snippets/_v2/dynamic-field/index.d.ts +2 -1
  63. package/lib/snippets/_v2/index.d.ts +1 -0
  64. package/lib/snippets/v2.js +1 -1
  65. package/lib/snippets.js +1 -1
  66. package/lib/store.js +1 -1
  67. package/lib/theme.js +1 -1
  68. package/lib/types/actions/index.d.ts +1 -4
  69. package/lib/types/cloud-connectors/index.d.ts +88 -0
  70. package/lib/types/common/index.d.ts +3 -1
  71. package/lib/types/index.d.ts +1 -0
  72. package/lib/types/instrumentation-rules/index.d.ts +22 -3
  73. package/lib/types/snapshot/index.d.ts +1 -0
  74. package/lib/types/sources/index.d.ts +1 -0
  75. package/lib/types/workload/index.d.ts +1 -0
  76. package/lib/types.js +1 -1
  77. package/lib/visuals.js +1 -1
  78. package/package.json +1 -1
  79. package/lib/chunks/index-DILEVYlK.js +0 -155
  80. package/lib/chunks/source-instrument-form-context-oDlfTrOD.js +0 -1
  81. package/lib/chunks/ui-components-BDSEcaSZ.js +0 -1692
  82. package/lib/chunks/use-odigos-api-DHCLONPK.js +0 -5
@@ -1,4 +1,4 @@
1
- import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect as o,useMemo as a,useRef as i,useCallback as l,useState as r,Fragment as s,forwardRef as c,useImperativeHandle as d,Children as u,createContext as p,useContext as h,useLayoutEffect as m}from"react";import g,{useTheme as f,css as b,keyframes as v}from"styled-components";import{u as y,n as C,C as S,e as w,f as x,h as k,g as T,j as $,k as I,l as E,d as A,b as N,c as O,S as R,o as D,R as P,p as F,q as L,a as _,r as M,s as z,t as B,w as X,x as V,y as U,z as G,A as H,B as j,D as W,E as K,F as Y}from"../chunks/odigos-context-BYgtdAtj.js";import{f as J,a7 as q,a8 as Z,V as Q,a9 as ee,aa as te,ab as ne,ac as oe,ad as ae,ae as ie,af as le,ag as re,T as se,O as ce,a as de,y as ue,B as pe,z as he,L as me,M as ge,ah as fe,ai as be,aj as ve,ak as ye,al as Ce,am as Se,an as we,ao as xe,l as ke,s as Te,g as $e,N as Ie,ap as Ee,aq as Ae,ar as Ne,Y as Oe,o as Re,as as De,S as Pe,k as Fe,m as Le,at as _e,au as Me,av as ze,H as Be,aw as Xe,G as Ve,J as Ue,C as Ge,n as He,R as je,ax as We,ay as Ke,az as Ye,p as Je,h as qe,aA as Ze,aB as Qe,aC as et,aD as tt,aE as nt,aF as ot,aG as at,aH as it,aI as lt,aJ as rt,aK as st,aL as ct,aM as dt,aN as ut,aO as pt,D as ht,aP as mt,aQ as gt,aR as ft,aS as bt,aT as vt,aU as yt,e as Ct,I as St,E as wt,b as xt,aV as kt,aW as Tt,$ as $t,aX as It,aY as Et,a1 as At,a4 as Nt,A as Ot,aZ as Rt,a_ as Dt,a$ as Pt,b0 as Ft,d as Lt,b1 as _t,b2 as Mt,b3 as zt,b4 as Bt,W as Xt,F as Vt,b5 as Ut,b6 as Gt,b7 as Ht,b8 as jt,b9 as Wt,ba as Kt,bb as Yt,bc as Jt,bd as qt,be as Zt,bf as Qt,bg as en,bh as tn,U as nn,Q as on,bi as an,bj as ln,q as rn,r as sn,w as cn,K as dn,bk as un,bl as pn,bm as hn,bn as mn,bo as gn,bp as fn,bq as bn,br as vn,bs as yn,bt as Cn,bu as Sn,bv as wn,bw as xn,bx as kn,by as Tn,bz as $n,bA as In,bB as En,bC as An,bD as Nn,bE as On,bF as Rn,bG as Dn,bH as Pn,bI as Fn,bJ as Ln,bK as _n,bL as Mn,bM as zn,bN as Bn,bO as Xn,bP as Vn,bQ as Un,bR as Gn,bS as Hn,bT as jn,bU as Wn,bV as Kn,bW as Yn,bX as Jn,bY as qn,bZ as Zn,b_ as Qn,b$ as eo,c0 as to,c1 as no,c2 as oo,c3 as ao,c4 as io,c5 as lo,c6 as ro,c7 as so,c8 as co,c9 as uo,ca as po,cb as ho,cc as mo,cd as go,ce as fo,cf as bo,cg as vo,ch as yo,ci as Co,cj as So,ck as wo,cl as xo,cm as ko,cn as To,co as $o,cp as Io,cq as Eo,cr as Ao,cs as No,ct as Oo,cu as Ro,cv as Do,cw as Po,cx as Fo,cy as Lo,cz as _o,cA as Mo,cB as zo,cC as Bo,cD as Xo,cE as Vo,cF as Uo,cG as Go,cH as Ho,cI as jo,cJ as Wo,cK as Ko,cL as Yo,cM as Jo,cN as qo,cO as Zo,cP as Qo,cQ as ea,cR as ta,cS as na,cT as oa,cU as aa,cV as ia,cW as la,cX as ra,cY as sa,cZ as ca,c_ as da,c$ as ua,d0 as pa,d1 as ha,d2 as ma,d3 as ga,d4 as fa,d5 as ba,d6 as va,d7 as ya,d8 as Ca,d9 as Sa,da as wa,db as xa,dc as ka,dd as Ta,de as $a,df as Ia,dg as Ea,dh as Aa,di as Na,x as Oa,dj as Ra,v as Da,dk as Pa,dl as Fa,dm as La,dn as _a,dp as Ma,dq as za,dr as Ba,ds as Xa,a0 as Va,dt as Ua,du as Ga,dv as Ha,dw as ja,dx as Wa,dy as Ka,dz as Ya,dA as Ja,dB as qa,dC as Za,dD as Qa,dE as ei,dF as ti,dG as ni,dH as oi,dI as ai,dJ as ii,dK as li,dL as ri,dM as si,dN as ci,dO as di,dP as ui,dQ as pi,dR as hi,dS as mi}from"../chunks/ui-components-BDSEcaSZ.js";import{TrashIcon as gi,PlusIcon as fi,ArrowRightIcon as bi,VSquareIcon as vi,XSquareIcon as yi,BookIcon as Ci,DeleteIcon as Si,EditIcon as wi,GoLogo as xi,JavaLogo as ki,ChevronRightIcon as Ti,ActionIcon as $i,DestinationIcon as Ii,ChevronUpIcon as Ei,ChevronDownIcon as Ai,VIcon as Ni,XIcon as Oi,InstrumentationRuleIcon as Ri,SourceIcon as Di,NamespacesIcon as Pi,SettingsIcon as Fi,PodIcon as Li,OdigosLogo as _i,K8sLogo as Mi,RefreshIcon as zi,ExclamationCircleIcon as Bi,QuestionCircleIcon as Xi,InboundIcon as Vi,OutboundIcon as Ui,UserIcon as Gi,TerminalIcon as Hi,MinusIcon as ji,SearchIcon as Wi,ExpandIcon as Ki,CopyIcon as Yi,DotIcon as Ji,ArrowDownIcon as qi,DownloadIcon as Zi,RefreshLeftArrowIcon as Qi,VmLogo as el,SamplingIcon as tl,ExclamationTriangleIcon as nl,KeyIcon as ol,DiagnoseIcon as al,StarIcon as il,ArrowIcon as ll,ConnectionsIcon as rl,FilterIcon as sl,DataStreamIcon as cl,PipelineCollectorIcon as dl,ArrowDownSquareIcon as ul,ArrowUpSquareIcon as pl,GatewayIcon as hl,YamlIcon as ml}from"../icons.js";import{d as gl}from"../chunks/use-odigos-api-DHCLONPK.js";import{D as fl,S as bl,I as vl,a as yl,A as Cl,P as Sl,b as wl,c as xl,R as kl,O as Tl,d as $l,e as Il,f as El,W as Al,g as Nl,C as Ol,Y as Rl,h as Dl,i as Pl,U as Fl}from"../chunks/index-DILEVYlK.js";import{O as Ll}from"../chunks/connections-scope-DhNWocBO.js";import{u as _l,f as Ml,g as zl,e as Bl,i as Xl,h as Vl,S as Ul,k as Gl,E as Hl,l as jl,m as Wl,j as Kl,b as Yl,d as Jl,a as ql,A as Zl,R as Ql,c as er,D as tr}from"../chunks/source-instrument-form-context-oDlfTrOD.js";import{U as nr}from"../chunks/consts-D6GCMJ6c.js";import{createPortal as or}from"react-dom";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"../chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"virtua";import"@apollo/client";import"@apollo/client/link/error";import"@apollo/client/link/context";import"@apollo/client/utilities";const ar=[{id:"CREDIT_CARD",label:"Credit card"}],ir=[{id:J.CollectContainerAttributes,label:"Collect container attributes"},{id:J.CollectReplicaSetAttributes,label:"Collect ReplicaSet attributes"},{id:J.CollectWorkloadId,label:"Collect workload ID"},{id:J.CollectClusterId,label:"Collect cluster ID"}],lr=[{id:ne.Pod,label:ne.Pod},{id:ne.Namespace,label:ne.Namespace},{id:ne.Node,label:ne.Node}],rr=[{label:"Label key",keyName:"labelKey",placeholder:"app.kubernetes.io/name"},{label:"Attribute key",keyName:"attributeKey",placeholder:"app.kubernetes.name"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:lr}],sr=[{label:"Annotation key",keyName:"annotationKey",placeholder:"kubectl.kubernetes.io/restartedAt"},{label:"Attribute key",keyName:"attributeKey",placeholder:"kubectl.kubernetes.restartedAt"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:lr}],cr=/^[a-zA-Z]$/,dr=new Set(["*","+","?"]),ur=new Set(["^","$"]),pr={group:"rgba(102, 242, 102, 0.5)","anchor-quantifier":"rgba(102, 191, 255, 0.5)","class-bracket":"rgba(255, 153, 153, 0.5)","class-content":"rgba(178, 1, 1, 0.5)",alternation:"rgba(255, 153, 153, 0.5)",literal:"transparent"},hr=g.div`
1
+ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEffect as i,useMemo as a,useRef as l,useCallback as r,useState as s,Fragment as c,forwardRef as d,useImperativeHandle as u,Children as p,createContext as h,useContext as m,useLayoutEffect as g}from"react";import f,{useTheme as b,css as v,keyframes as y}from"styled-components";import{u as C,n as S,C as x,e as w,f as T,h as k,g as E,j as I,k as O,l as N,d as $,b as A,c as R,S as D,o as _,R as P,p as L,q as F,a as M,r as z,s as B,t as X,w as U,x as V,y as H,z as j,A as G,B as W,D as K,E as Y,F as J}from"../chunks/odigos-context-DGEWcwEQ.js";import{f as q,a8 as Z,a9 as Q,V as ee,aa as te,ab as oe,ac as ne,ad as ie,ae,af as le,ag as re,ah as se,T as ce,O as de,a as ue,y as pe,B as he,z as me,L as ge,M as fe,ai as be,aj as ve,ak as ye,al as Ce,am as Se,an as xe,ao as we,l as Te,ap as ke,s as Ee,aq as Ie,ar as Oe,g as Ne,N as $e,as as Ae,at as Re,au as De,Y as _e,o as Pe,av as Le,S as Fe,k as Me,m as ze,aw as Be,ax as Xe,H as Ue,ay as Ve,G as He,J as je,C as Ge,n as We,R as Ke,az as Ye,aA as Je,aB as qe,p as Ze,h as Qe,aC as et,aD as tt,aE as ot,aF as nt,aG as it,aH as at,aI as lt,aJ as rt,aK as st,aL as ct,aM as dt,aN as ut,aO as pt,aP as ht,aQ as mt,D as gt,aR as ft,aS as bt,aT as vt,aU as yt,aV as Ct,aW as St,e as xt,I as wt,E as Tt,b as kt,aX as Et,aY as It,$ as Ot,aZ as Nt,a_ as $t,a1 as At,a$ as Rt,b0 as Dt,b1 as _t,b2 as Pt,b3 as Lt,a4 as Ft,A as Mt,b4 as zt,b5 as Bt,b6 as Xt,d as Ut,b7 as Vt,b8 as Ht,b9 as jt,ba as Gt,W as Wt,F as Kt,bb as Yt,bc as Jt,bd as qt,be as Zt,bf as Qt,bg as eo,bh as to,bi as oo,bj as no,bk as io,bl as ao,bm as lo,bn as ro,U as so,Q as co,bo as uo,bp as po,q as ho,r as mo,w as go,K as fo,bq as bo,br as vo,bs as yo,bt as Co,bu as So,bv as xo,bw as wo,bx as To,by as ko,bz as Eo,bA as Io,bB as Oo,bC as No,bD as $o,bE as Ao,bF as Ro,bG as Do,bH as _o,bI as Po,bJ as Lo,bK as Fo,bL as Mo,bM as zo,bN as Bo,bO as Xo,bP as Uo,bQ as Vo,bR as Ho,bS as jo,bT as Go,bU as Wo,bV as Ko,bW as Yo,bX as Jo,bY as qo,bZ as Zo,b_ as Qo,b$ as en,c0 as tn,c1 as on,c2 as nn,c3 as an,c4 as ln,c5 as rn,c6 as sn,c7 as cn,c8 as dn,c9 as un,ca as pn,cb as hn,cc as mn,cd as gn,ce as fn,cf as bn,cg as vn,ch as yn,ci as Cn,cj as Sn,ck as xn,cl as wn,cm as Tn,cn as kn,co as En,cp as In,cq as On,cr as Nn,cs as $n,ct as An,cu as Rn,cv as Dn,cw as _n,cx as Pn,cy as Ln,cz as Fn,cA as Mn,cB as zn,cC as Bn,cD as Xn,cE as Un,cF as Vn,cG as Hn,cH as jn,cI as Gn,cJ as Wn,cK as Kn,cL as Yn,cM as Jn,cN as qn,cO as Zn,cP as Qn,cQ as ei,cR as ti,cS as oi,cT as ni,cU as ii,cV as ai,cW as li,cX as ri,cY as si,cZ as ci,c_ as di,c$ as ui,d0 as pi,d1 as hi,d2 as mi,d3 as gi,d4 as fi,d5 as bi,d6 as vi,d7 as yi,d8 as Ci,d9 as Si,da as xi,db as wi,dc as Ti,dd as ki,de as Ei,c as Ii,df as Oi,dg as Ni,dh as $i,di as Ai,dj as Ri,dk as Di,dl as _i,dm as Pi,dn as Li,dp as Fi,x as Mi,dq as zi,v as Bi,dr as Xi,ds as Ui,dt as Vi,du as Hi,dv as ji,dw as Gi,dx as Wi,dy as Ki,a0 as Yi,dz as Ji,dA as qi,dB as Zi,dC as Qi,dD as ea,dE as ta,dF as oa,dG as na,dH as ia,dI as aa,dJ as la,dK as ra,dL as sa,dM as ca,dN as da,dO as ua,dP as pa,dQ as ha,dR as ma,dS as ga,dT as fa,dU as ba,dV as va,dW as ya,dX as Ca,dY as Sa}from"../chunks/ui-components-BDtk3K99.js";import{TrashIcon as xa,PlusIcon as wa,ArrowRightIcon as Ta,VSquareIcon as ka,XSquareIcon as Ea,BookIcon as Ia,DeleteIcon as Oa,EditIcon as Na,GoLogo as $a,JavaLogo as Aa,ChevronRightIcon as Ra,ActionIcon as Da,DestinationIcon as _a,ChevronUpIcon as Pa,ChevronDownIcon as La,VIcon as Fa,XIcon as Ma,InstrumentationRuleIcon as za,SourceIcon as Ba,NamespacesIcon as Xa,AwsLogo as Ua,CloudConnectorIcon as Va,EyeOpenIcon as Ha,CloudConnectorPolicyIcon as ja,ArrowLeftIcon as Ga,ISquareIcon as Wa,RefreshIcon as Ka,SettingsIcon as Ya,PodIcon as Ja,OdigosLogo as qa,K8sLogo as Za,ExclamationCircleIcon as Qa,QuestionCircleIcon as el,InboundIcon as tl,OutboundIcon as ol,UserIcon as nl,TerminalIcon as il,MinusIcon as al,SearchIcon as ll,ExpandIcon as rl,CopyIcon as sl,DotIcon as cl,ArrowDownIcon as dl,DownloadIcon as ul,RefreshLeftArrowIcon as pl,VmLogo as hl,SamplingIcon as ml,ExclamationTriangleIcon as gl,KeyIcon as fl,DiagnoseIcon as bl,StarIcon as vl,ArrowIcon as yl,ConnectionsIcon as Cl,FilterIcon as Sl,DataStreamIcon as xl,PipelineCollectorIcon as wl,ArrowDownSquareIcon as Tl,ArrowUpSquareIcon as kl,GatewayIcon as El,YamlIcon as Il,LockIcon as Ol}from"../icons.js";import{d as Nl}from"../chunks/use-odigos-api-ZAJiPzPh.js";import{D as $l,S as Al,I as Rl,a as Dl,A as _l,P as Pl,b as Ll,c as Fl,R as Ml,O as zl,d as Bl,e as Xl,f as Ul,W as Vl,g as Hl,C as jl,h as Gl,Y as Wl,i as Kl,j as Yl,U as Jl}from"../chunks/index-BVtv0LGZ.js";import{O as ql}from"../chunks/connections-scope-DEVWbigK.js";import{u as Zl,g as Ql,h as er,f as tr,j as or,i as nr,S as ir,l as ar,E as lr,m as rr,n as sr,k as cr,e as dr,b as ur,d as pr,a as hr,A as mr,R as gr,C as fr,c as br,D as vr}from"../chunks/source-instrument-form-context-DMCdySjE.js";import{U as yr}from"../chunks/consts-D6GCMJ6c.js";import{createPortal as Cr}from"react-dom";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"../chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"virtua";import"@apollo/client";import"@apollo/client/link/error";import"@apollo/client/link/context";import"@apollo/client/utilities";const Sr=[{id:"CREDIT_CARD",label:"Credit card"}],xr=[{id:q.CollectContainerAttributes,label:"Collect container attributes"},{id:q.CollectReplicaSetAttributes,label:"Collect ReplicaSet attributes"},{id:q.CollectWorkloadId,label:"Collect workload ID"},{id:q.CollectClusterId,label:"Collect cluster ID"}],wr=[{id:ne.Pod,label:ne.Pod},{id:ne.Namespace,label:ne.Namespace},{id:ne.Node,label:ne.Node}],Tr=[{label:"Label key",keyName:"labelKey",placeholder:"app.kubernetes.io/name"},{label:"Attribute key",keyName:"attributeKey",placeholder:"app.kubernetes.name"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:wr}],kr=[{label:"Annotation key",keyName:"annotationKey",placeholder:"kubectl.kubernetes.io/restartedAt"},{label:"Attribute key",keyName:"attributeKey",placeholder:"kubectl.kubernetes.restartedAt"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:wr}],Er=/^[a-zA-Z]$/,Ir=new Set(["*","+","?"]),Or=new Set(["^","$"]),Nr={group:"rgba(102, 242, 102, 0.5)","anchor-quantifier":"rgba(102, 191, 255, 0.5)","class-bracket":"rgba(255, 153, 153, 0.5)","class-content":"rgba(178, 1, 1, 0.5)",alternation:"rgba(255, 153, 153, 0.5)",literal:"transparent"},$r=f.div`
2
2
  padding: 8px 16px;
3
3
  border-radius: 6px;
4
4
  border: 1px solid ${({theme:e})=>e.v2.colors.silver[500]};
@@ -18,9 +18,9 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
18
18
  box-decoration-break: clone;
19
19
  -webkit-box-decoration-break: clone;
20
20
  }
21
- `,mr=g.span`
22
- background: ${({$kind:e})=>pr[e]};
23
- `,gr=({pattern:e,"data-id":n})=>{const o=a(()=>(e=>{const t=[];let n=0,o=!1;const a=(e,n)=>{const o=t[t.length-1];o&&o.kind===n?o.text+=e:t.push({text:e,kind:n})};for(;n<e.length;){const t=e[n];if(o){if("]"===t){a("]","class-bracket"),o=!1,n++;continue}if("\\"===t&&n+1<e.length){a(e.slice(n,n+2),"class-content"),n+=2;continue}a(t,"class-content"),n++}else{if("("===t&&"?"===e[n+1]){let t=2;const o=e[n+2];if(":"===o||"="===o||"!"===o)t=3;else if("<"===o){const o=e[n+3];if("="===o||"!"===o)t=4;else{const o=e.indexOf(">",n+2);-1!==o&&(t=o-n+1)}}a(e.slice(n,n+t),"group"),n+=t;continue}if("("!==t&&")"!==t)if("["!==t)if(dr.has(t)||ur.has(t))a(t,"anchor-quantifier"),n++;else{if("{"===t){const t=e.indexOf("}",n);if(t>n&&/^\{\d+,?\d*\}$/.test(e.slice(n,t+1))){a(e.slice(n,t+1),"anchor-quantifier"),n=t+1;continue}}if("\\"===t&&n+1<e.length){const t=e[n+1];cr.test(t)?a(e.slice(n,n+2),"anchor-quantifier"):a(e.slice(n,n+2),"literal"),n+=2;continue}"|"!==t?(a(t,"literal"),n++):(a("|","alternation"),n++)}else"^"===e[n+1]?(a("[^","class-bracket"),n+=2):(a("[","class-bracket"),n++),o=!0;else a(t,"group"),n++}}return t})(e),[e]);return t(hr,e?{"data-id":n,children:o.map((e,n)=>t(mr,{$kind:e.kind,children:e.text},n))}:{"data-id":n,children:" "})},fr="rgba(102, 191, 255, 0.5)",br=b`
21
+ `,Ar=f.span`
22
+ background: ${({$kind:e})=>Nr[e]};
23
+ `,Rr=({pattern:e,"data-id":o})=>{const n=a(()=>(e=>{const t=[];let o=0,n=!1;const i=(e,o)=>{const n=t[t.length-1];n&&n.kind===o?n.text+=e:t.push({text:e,kind:o})};for(;o<e.length;){const t=e[o];if(n){if("]"===t){i("]","class-bracket"),n=!1,o++;continue}if("\\"===t&&o+1<e.length){i(e.slice(o,o+2),"class-content"),o+=2;continue}i(t,"class-content"),o++}else{if("("===t&&"?"===e[o+1]){let t=2;const n=e[o+2];if(":"===n||"="===n||"!"===n)t=3;else if("<"===n){const n=e[o+3];if("="===n||"!"===n)t=4;else{const n=e.indexOf(">",o+2);-1!==n&&(t=n-o+1)}}i(e.slice(o,o+t),"group"),o+=t;continue}if("("!==t&&")"!==t)if("["!==t)if(Ir.has(t)||Or.has(t))i(t,"anchor-quantifier"),o++;else{if("{"===t){const t=e.indexOf("}",o);if(t>o&&/^\{\d+,?\d*\}$/.test(e.slice(o,t+1))){i(e.slice(o,t+1),"anchor-quantifier"),o=t+1;continue}}if("\\"===t&&o+1<e.length){const t=e[o+1];Er.test(t)?i(e.slice(o,o+2),"anchor-quantifier"):i(e.slice(o,o+2),"literal"),o+=2;continue}"|"!==t?(i(t,"literal"),o++):(i("|","alternation"),o++)}else"^"===e[o+1]?(i("[^","class-bracket"),o+=2):(i("[","class-bracket"),o++),n=!0;else i(t,"group"),o++}}return t})(e),[e]);return t($r,e?{"data-id":o,children:n.map((e,o)=>t(Ar,{$kind:e.kind,children:e.text},o))}:{"data-id":o,children:" "})},Dr="rgba(102, 191, 255, 0.5)",_r=v`
24
24
  font-family: ${({theme:e})=>e.font_family.code};
25
25
  font-size: 12px;
26
26
  line-height: 20px;
@@ -33,7 +33,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
33
33
  -moz-tab-size: 4;
34
34
  tab-size: 4;
35
35
  margin: 0;
36
- `,vr=g.div`
36
+ `,Pr=f.div`
37
37
  position: relative;
38
38
  width: 100%;
39
39
  min-height: ${({$minHeight:e})=>e}px;
@@ -45,8 +45,8 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
45
45
  &:focus-within {
46
46
  border-color: ${({theme:e})=>e.v2.colors.silver[300]};
47
47
  }
48
- `,yr=g.div`
49
- ${br}
48
+ `,Lr=f.div`
49
+ ${_r}
50
50
  position: absolute;
51
51
  inset: 0;
52
52
  padding: 12px;
@@ -59,8 +59,8 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
59
59
  box-decoration-break: clone;
60
60
  -webkit-box-decoration-break: clone;
61
61
  }
62
- `,Cr=g.textarea`
63
- ${br}
62
+ `,Fr=f.textarea`
63
+ ${_r}
64
64
  position: relative;
65
65
  z-index: 1;
66
66
  display: block;
@@ -78,18 +78,18 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
78
78
  &::placeholder {
79
79
  color: ${({theme:e})=>e.v2.colors.silver[600]};
80
80
  }
81
- `,Sr=e=>({before:e,matchPre:"",capture:"",matchPost:"",after:""}),wr=({regex:n,value:o,onChange:r,minHeight:s=240,...c})=>{const d=i(null),u=i(null),p=a(()=>((e,t)=>{if(!e||!t)return Sr(t);let n;try{n=new RegExp(e)}catch{return Sr(t)}const o=n.exec(t);if(!o)return Sr(t);const a=o.index,i=o.index+o[0].length;if(o.length<2||null==o[1])return{before:t.slice(0,a),matchPre:"",capture:t.slice(a,i),matchPost:"",after:t.slice(i)};const l=o[0].indexOf(o[1]),r=l>=0?a+l:a,s=r+o[1].length;return{before:t.slice(0,a),matchPre:t.slice(a,r),capture:t.slice(r,s),matchPost:t.slice(s,i),after:t.slice(i)}})(n,o),[n,o]),h=l(()=>{d.current&&u.current&&(d.current.scrollTop=u.current.scrollTop,d.current.scrollLeft=u.current.scrollLeft)},[]);return e(vr,{$minHeight:s,children:[e(yr,{ref:d,"aria-hidden":!0,children:[p.before,t("span",{style:{background:fr},children:p.matchPre}),t("span",{style:{background:"rgba(102, 242, 102, 0.5)"},children:p.capture}),t("span",{style:{background:fr},children:p.matchPost}),p.after,o.endsWith("\n")?" ":""]}),t(Cr,{ref:u,$minHeight:s,value:o,onChange:e=>r(e.target.value),onScroll:h,spellCheck:!1,...c})]})},xr=g.div`
81
+ `,Mr=e=>({before:e,matchPre:"",capture:"",matchPost:"",after:""}),zr=({regex:o,value:n,onChange:i,minHeight:s=240,...c})=>{const d=l(null),u=l(null),p=a(()=>((e,t)=>{if(!e||!t)return Mr(t);let o;try{o=new RegExp(e)}catch{return Mr(t)}const n=o.exec(t);if(!n)return Mr(t);const i=n.index,a=n.index+n[0].length;if(n.length<2||null==n[1])return{before:t.slice(0,i),matchPre:"",capture:t.slice(i,a),matchPost:"",after:t.slice(a)};const l=n[0].indexOf(n[1]),r=l>=0?i+l:i,s=r+n[1].length;return{before:t.slice(0,i),matchPre:t.slice(i,r),capture:t.slice(r,s),matchPost:t.slice(s,a),after:t.slice(a)}})(o,n),[o,n]),h=r(()=>{d.current&&u.current&&(d.current.scrollTop=u.current.scrollTop,d.current.scrollLeft=u.current.scrollLeft)},[]);return e(Pr,{$minHeight:s,children:[e(Lr,{ref:d,"aria-hidden":!0,children:[p.before,t("span",{style:{background:Dr},children:p.matchPre}),t("span",{style:{background:"rgba(102, 242, 102, 0.5)"},children:p.capture}),t("span",{style:{background:Dr},children:p.matchPost}),p.after,n.endsWith("\n")?" ":""]}),t(Fr,{ref:u,$minHeight:s,value:n,onChange:e=>i(e.target.value),onScroll:h,spellCheck:!1,...c})]})},Br=f.div`
82
82
  flex: 1;
83
83
  min-height: 0;
84
84
  overflow-y: auto;
85
- `,kr=g.div`
85
+ `,Xr=f.div`
86
86
  background: ${({theme:e})=>e.v2.colors.silver[900]};
87
87
  border-radius: 8px;
88
88
  padding: 8px;
89
89
  display: flex;
90
90
  flex-direction: column;
91
91
  gap: 12px;
92
- `,Tr=g.div`
92
+ `,Ur=f.div`
93
93
  padding: 8px 16px;
94
94
  border-radius: 8px;
95
95
  background: ${({theme:e})=>e.v2.colors.silver[800]};
@@ -100,7 +100,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
100
100
  word-break: break-all;
101
101
  white-space: pre-wrap;
102
102
  user-select: text;
103
- `,$r=({isOpen:n,regex:o,onClose:i,initialTestString:l=""})=>{const[s,c]=r(l),d=a(()=>((e,t)=>{if(!e)return{ok:!0,isMatch:!1,message:re.RESULT_EMPTY_REGEX};if(!t)return{ok:!0,isMatch:!1,message:re.RESULT_EMPTY_INPUT};let n;try{n=new RegExp(e)}catch(e){return{ok:!1,message:e instanceof Error?e.message:re.RESULT_INVALID_REGEX_FALLBACK}}const o=n.exec(t);return o?{ok:!0,isMatch:!0,message:o.length>1?o[1]:o[0]}:{ok:!0,isMatch:!1,message:re.RESULT_NO_MATCH}})(o,s),[o,s]),u=d.ok?d.isMatch?"match":"neutral":"error";return t(le,{isOpen:n,header:{title:re.TITLE,onClose:()=>{c(""),i()}},children:t(xr,{children:e(kr,{children:[e(q,{$gap:6,children:[t(Z,{label:re.REGEX_LABEL}),t(gr,{pattern:o,"data-id":"regex-tester-regex"}),!o&&t(se,{size:de.XXS,color:ce.Secondary,children:re.REGEX_EMPTY_HINT})]}),e(q,{$gap:6,children:[e(ue,{$width:"100%",$justifyContent:"space-between",$alignItems:"center",children:[t(Z,{label:re.TEST_STRING_LABEL}),t(pe,{"data-id":"regex-tester-unescape",label:re.UNESCAPE_LABEL,tooltip:re.UNESCAPE_TOOLTIP,variant:me.Secondary,size:he.S,onClick:()=>c(e=>(e=>{let t="";for(let n=0;n<e.length;n++){if("\\"===e[n]&&n+1<e.length){const o=e[n+1],a="n"===o?"\n":"t"===o?"\t":"r"===o?"\r":'"'===o?'"':"'"===o?"'":"\\"===o?"\\":null;if(null!=a){t+=a,n++;continue}}t+=e[n]}return t})(e)),disabled:(p=s,!/\\["'\\nrt]/.test(p))})]}),t(wr,{name:"regex-tester-test-string","data-id":"regex-tester-test-string",placeholder:re.TEST_STRING_PLACEHOLDER,regex:o,value:s,onChange:c,minHeight:240}),t(ee,{helpMessage:re.TEST_STRING_HELP})]}),e(q,{$gap:8,children:[t(Z,{label:re.RESULT_LABEL}),t(Tr,{$tone:u,"data-id":"regex-tester-result",children:d.message}),d.ok&&d.isMatch&&t(se,{size:de.XXS,color:ce.Secondary,children:re.RESULT_CAPTURE_HINT})]})]})})});var p},Ir=J.ExtractAttribute;var Er;!function(e){e.Preset="preset",e.Regex="regex"}(Er||(Er={}));const Ar=[be.JSON,be.SQL,be.ResourcePath],Nr=(e=be.JSON)=>({targetAttributeName:"",lookupKey:"",dataFormat:e,regex:""}),Or=e=>!!e.regex&&!e.lookupKey&&!e.dataFormat,Rr=g.div`
103
+ `,Vr=({isOpen:o,regex:n,onClose:i,initialTestString:l=""})=>{const[r,c]=s(l),d=a(()=>((e,t)=>{if(!e)return{ok:!0,isMatch:!1,message:se.RESULT_EMPTY_REGEX};if(!t)return{ok:!0,isMatch:!1,message:se.RESULT_EMPTY_INPUT};let o;try{o=new RegExp(e)}catch(e){return{ok:!1,message:e instanceof Error?e.message:se.RESULT_INVALID_REGEX_FALLBACK}}const n=o.exec(t);return n?{ok:!0,isMatch:!0,message:n.length>1?n[1]:n[0]}:{ok:!0,isMatch:!1,message:se.RESULT_NO_MATCH}})(n,r),[n,r]),u=d.ok?d.isMatch?"match":"neutral":"error";return t(re,{isOpen:o,header:{title:se.TITLE,onClose:()=>{c(""),i()}},children:t(Br,{children:e(Xr,{children:[e(Z,{$gap:6,children:[t(Q,{label:se.REGEX_LABEL}),t(Rr,{pattern:n,"data-id":"regex-tester-regex"}),!n&&t(ce,{size:ue.XXS,color:de.Secondary,children:se.REGEX_EMPTY_HINT})]}),e(Z,{$gap:6,children:[e(pe,{$width:"100%",$justifyContent:"space-between",$alignItems:"center",children:[t(Q,{label:se.TEST_STRING_LABEL}),t(he,{"data-id":"regex-tester-unescape",label:se.UNESCAPE_LABEL,tooltip:se.UNESCAPE_TOOLTIP,variant:ge.Secondary,size:me.S,onClick:()=>c(e=>(e=>{let t="";for(let o=0;o<e.length;o++){if("\\"===e[o]&&o+1<e.length){const n=e[o+1],i="n"===n?"\n":"t"===n?"\t":"r"===n?"\r":'"'===n?'"':"'"===n?"'":"\\"===n?"\\":null;if(null!=i){t+=i,o++;continue}}t+=e[o]}return t})(e)),disabled:(p=r,!/\\["'\\nrt]/.test(p))})]}),t(zr,{name:"regex-tester-test-string","data-id":"regex-tester-test-string",placeholder:se.TEST_STRING_PLACEHOLDER,regex:n,value:r,onChange:c,minHeight:240}),t(te,{helpMessage:se.TEST_STRING_HELP})]}),e(Z,{$gap:8,children:[t(Q,{label:se.RESULT_LABEL}),t(Ur,{$tone:u,"data-id":"regex-tester-result",children:d.message}),d.ok&&d.isMatch&&t(ce,{size:ue.XXS,color:de.Secondary,children:se.RESULT_CAPTURE_HINT})]})]})})});var p},Hr=q.ExtractAttribute;var jr;!function(e){e.Preset="preset",e.Regex="regex"}(jr||(jr={}));const Gr=[ve.JSON,ve.SQL,ve.ResourcePath],Wr=(e=ve.JSON)=>({targetAttributeName:"",lookupKey:"",dataFormat:e,regex:""}),Kr=e=>!!e.regex&&!e.lookupKey&&!e.dataFormat,Yr=f.div`
104
104
  width: 100%;
105
105
  background: ${({theme:e})=>e.v2.colors.silver[800]};
106
106
  border-radius: 8px;
@@ -108,13 +108,13 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
108
108
  display: flex;
109
109
  flex-direction: column;
110
110
  gap: 8px;
111
- `,Dr=g.div`
111
+ `,Jr=f.div`
112
112
  flex: 1;
113
113
  min-width: 0;
114
- `,Pr=g.div`
114
+ `,qr=f.div`
115
115
  /* Pushes the arrow down to sit next to the inputs rather than the field titles. */
116
116
  padding-top: 24px;
117
- `,Fr=e=>Object.entries(e||{}).map(([e,t])=>({oldKey:e,newKey:t})),Lr=e=>{const t={};return e.forEach(({oldKey:e,newKey:n})=>{t[e]=n}),t},_r=J.UrlTemplatizationRulesGroups,Mr=[{keyName:"kind",label:"Kind",placeholder:"Any kind",componentType:"dropdown",options:[{id:"Deployment",label:"Deployment"},{id:"StatefulSet",label:"StatefulSet"},{id:"DaemonSet",label:"DaemonSet"}]},{keyName:"name",label:"Name",placeholder:"Any name"}],zr=e=>{if(Array.isArray(e))return e.map(e=>"string"==typeof e?{id:e,label:e}:e)},Br=e=>{if(Array.isArray(e))return e.map(e=>{const t=e;return{keyName:String(t.keyName??t.name??""),label:t.label??t.displayName,placeholder:t.placeholder,componentType:t.componentType,options:zr(t.options??t.values)}})},Xr=e=>{const t="string"==typeof e.componentProperties?Te(e.componentProperties,{}):e.componentProps||{};return{name:e.name,componentType:e.componentType,title:e.displayName,tooltip:t.tooltip,placeholder:t.placeholder,required:t.required,initialValue:e.initialValue,renderCondition:e.renderCondition,options:zr(t.options??t.values),itemWrapperKey:t.itemWrapperKey,columns:Br(t.columns),wrapKey:t.wrapKey,fields:Array.isArray(t.fields)?t.fields.map(Xr):void 0,addLabel:t.addLabel,itemLabel:t.itemLabel}},Vr=e=>Array.isArray(e)?e:[],Ur=({field:e,value:n,setValue:o,errorMessage:a,disabled:i})=>{const{name:l,componentType:r,title:s,tooltip:c,placeholder:d,required:u,initialValue:p,options:h,itemWrapperKey:m,columns:g,wrapKey:f}=e;if(r===ke.MultiTabledInput){const e=Vr(f?n?.[f]:n);return t(te,{name:l,label:s,tooltip:c,required:u,disabled:i,columns:g||[],values:e,setValues:e=>o(f?{[f]:e}:e),errorMessage:a})}if(r===ke.MultiInput&&m){const e=Vr(n).map(e=>String(e?.[m]??""));return t(ie,{name:l,label:s,tooltip:c,required:u,disabled:i,placeholder:d,values:e,setValues:e=>o(e.map(e=>({[m]:e}))),errorMessage:a})}return t(fl,{componentType:r,name:l,label:s,tooltip:c,disabled:i,required:u,placeholder:d,errorMessage:a,dropdownOptions:h,value:(null==n?p:n)??"",setValue:o})},Gr=({field:o,value:a,setValue:i,disabled:l})=>{const r=f(),c=Vr(a),d=c.length?c:[{}],u=o.fields||[],p=e=>i(e);return e(n,{children:[d.map((n,a)=>e(s,{children:[t(we,{}),e(q,{$gap:12,children:[e(ue,{$justifyContent:"space-between",$alignItems:"center",children:[t(Z,{label:`${o.itemLabel||o.title||"Item"} ${a+1}`}),t(pe,{leftIcon:()=>t(gi,{fill:r.v2.colors.red[500]}),variant:me.Secondary,size:he.S,onClick:()=>(e=>{const t=d.filter((t,n)=>n!==e);p(t)})(a),disabled:l||1===d.length})]}),u.map(e=>t(Ur,{field:e,value:n[e.name],setValue:t=>((e,t,n)=>p(d.map((o,a)=>a===e?{...o,[t]:n}:o)))(a,e.name,t),disabled:l},`${o.name}-group-${a}-${e.name}`))]})]},`${o.name}-group-${a}`)),t(pe,{variant:me.Secondary,label:o.addLabel||"Add",leftIcon:fi,onClick:()=>p([...d,{}]),disabled:l}),t(we,{})]})},Hr=({signals:e,fields:o,value:a,setValue:i,formErrors:l,disabled:r})=>{const s=(o||[]).filter(e=>!!e).map(e=>Xr(e));return t(n,{children:s.map(n=>{const o=Object.entries(a||{}).map(([e,t])=>({name:e,value:t}));if(!(!n.renderCondition||xe(n.renderCondition,e,o)))return null;const s=a?.[n.name];return n.componentType===ke.FieldGroup?t(Gr,{field:n,value:s,setValue:e=>i(n.name,e),disabled:r},n.name):t(Ur,{field:n,value:s,setValue:e=>i(n.name,e),errorMessage:l[n.name],disabled:r},n.name)})})},jr={[$e.K8sAttributes]:({value:a,setValue:i,formErrors:l})=>(o(()=>{a[J.CollectContainerAttributes]||a[J.CollectReplicaSetAttributes]||a[J.CollectWorkloadId]||a[J.CollectClusterId]||a[J.LabelsAttributes]?.length||a[J.AnnotationsAttributes]?.length||(i(J.CollectContainerAttributes,!0),i(J.CollectReplicaSetAttributes,!0),i(J.CollectWorkloadId,!0),i(J.CollectClusterId,!0),i(J.LabelsAttributes,[]),i(J.AnnotationsAttributes,[]))},[]),e(n,{children:[t(q,{$gap:6,children:ir.map(({id:n,label:o})=>e(q,{children:[t(Q,{label:o,value:a[n]||!1,onChange:e=>i(n,e)}),t(ee,{errorMessage:l[n]})]},n))}),t(te,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:rr,values:a[J.LabelsAttributes]||[],setValues:e=>i(J.LabelsAttributes,e),errorMessage:l[J.LabelsAttributes]}),t(te,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:sr,values:a[J.AnnotationsAttributes]||[],setValues:e=>i(J.AnnotationsAttributes,e),errorMessage:l[J.AnnotationsAttributes]})]})),[$e.AddClusterInfo]:({value:o,setValue:a,formErrors:i})=>{const l=f();return e(n,{children:[t(oe,{label:"Overwrite existing values",labelAlign:ae.Left,labelColor:l.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:o[J.OverwriteExistingValues]||!1,onChange:e=>a(J.OverwriteExistingValues,e)}),t(te,{name:"clusterAttributes",label:"Resource attributes",limitFieldsPerRow:2,columns:[{keyName:"attributeName",label:"Attribute name",placeholder:"Attribute name"},{keyName:"attributeStringValue",label:"Attribute value",placeholder:"Attribute value"}],values:o[J.ClusterAttributes]||[],setValues:e=>a(J.ClusterAttributes,e),errorMessage:i[J.ClusterAttributes]})]})},[$e.DeleteAttributes]:({value:e,setValue:n,formErrors:o})=>t(ie,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[J.AttributeNamesToDelete]||[],setValues:e=>n(J.AttributeNamesToDelete,e),errorMessage:o[J.AttributeNamesToDelete]}),[$e.RenameAttributes]:({value:e,setValue:n,formErrors:a})=>{const i=e[J.Renames],[l,s]=r(()=>Fr(i));return o(()=>{((e,t)=>{const n=Object.keys(e),o=Object.keys(t);return n.length===o.length&&n.every(n=>Object.prototype.hasOwnProperty.call(t,n)&&t[n]===e[n])})(Lr(l),i||{})||s(Fr(i))},[i]),t(te,{name:"renames",label:"Attributes to rename",limitFieldsPerRow:2,columns:[{keyName:"oldKey",label:"Old key",placeholder:"Old key"},{keyName:"newKey",label:"New key",placeholder:"New key"}],values:l,setValues:e=>{const t=e.map(e=>({oldKey:String(e.oldKey??""),newKey:String(e.newKey??"")}));s(t),n(J.Renames,Lr(t))},errorMessage:a[J.Renames]})},[$e.PiiMasking]:({value:n,setValue:a,formErrors:i})=>(o(()=>{n[J.PiiCategories]?.length||a(J.PiiCategories,ar.map(({id:e})=>e))},[]),e(q,{$gap:12,children:[t(Z,{label:"Attributes to mask"}),t(q,{$gap:6,children:ar.map(({id:e,label:o})=>t(Q,{label:o,value:n[J.PiiCategories]?.includes(e)||!1,onChange:t=>{const o=n[J.PiiCategories]||[],i=t?[...o,e]:o.filter(t=>t!==e);a(J.PiiCategories,i)}},e))}),t(ee,{errorMessage:i[J.PiiCategories]})]})),[$e.URLTemplatization]:({value:o,setValue:a,formErrors:i})=>{const l=f(),r=o[_r]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>a(_r,e),d=(e,t)=>c(r.map((n,o)=>o===e?{...n,...t}:n));return e(n,{children:[r.map((n,o)=>e(s,{children:[t(we,{}),e(q,{$gap:12,children:[e(ue,{$justifyContent:"space-between",$alignItems:"center",children:[t(Z,{label:`Rule Group ${o+1}`}),t(pe,{leftIcon:()=>t(gi,{fill:l.v2.colors.red[500]}),variant:me.Secondary,size:he.S,onClick:()=>{return e=o,c(r.filter((t,n)=>n!==e));var e},disabled:1===r.length})]}),t(Se,{name:`urlGroup-${o}-namespace`,label:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:n.filterK8sNamespace||"",onChange:e=>d(o,{filterK8sNamespace:e.target.value})}),t(te,{name:`urlGroup-${o}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:Mr,values:n.workloadFilters||[],setValues:e=>d(o,{workloadFilters:e})}),t(ie,{name:`urlGroup-${o}-templates`,label:"Templates",required:!0,placeholder:"e.g. /user/{id}",values:n.templatizationRules.map(e=>e.template),setValues:e=>d(o,{templatizationRules:e.map(e=>({template:e}))})})]}),t(ee,{errorMessage:i[_r]})]},`url-templatization-group-${o}`)),t(pe,{variant:me.Secondary,label:"Add rule group",leftIcon:fi,onClick:()=>c([...r,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(we,{})]})},[$e.ExtractAttribute]:({value:n,setValue:a,formErrors:i})=>{const l=f(),s=i[Ir],c=n[Ir]?.extractions||[],[d,u]=r(()=>(e=>e.length&&e.some(Or)?Er.Regex:Er.Preset)(c)),[p,h]=r(null),m=e=>a(Ir,{extractions:e});o(()=>{0===c.length&&m([d===Er.Preset?Nr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},[]);const g=(e,t)=>{m(c.map((n,o)=>o===e?{...n,...t}:n))},b=()=>{m([...c,d===Er.Preset?Nr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},v=d===Er.Preset,y=c.length?c:[v?Nr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}],C=null!=p&&y[p]?.regex||"";return e(q,{$gap:16,$width:"100%",children:[t(ge,{options:[{value:Er.Preset,label:fe.SEGMENT_PRESET_LABEL,tooltip:fe.SEGMENT_PRESET_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]},{value:Er.Regex,label:fe.SEGMENT_REGEX_LABEL,tooltip:fe.SEGMENT_REGEX_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]}],selected:d,setSelected:e=>{u(e),m([e===Er.Preset?Nr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])}}),e(q,{$gap:8,$width:"100%",children:[y.map((n,o)=>{const a=o===y.length-1,i=n.dataFormat||be.JSON,r=ye[i];return e(Rr,{"data-id":`extract-row-${o}`,children:[e(ue,{$gap:10,$alignItems:"flex-start",$width:"100%",$justifyContent:"space-between",children:[e(q,{$gap:10,children:[t(Z,{label:v?fe.PRESET_ROW_TITLE(o):fe.REGEX_ROW_TITLE(o)}),v&&t(ue,{$gap:24,children:Ar.map(e=>t(ve,{"data-id":`extract-row-${o}-fmt-${e}`,size:Ce.L,label:ye[e].label,value:i===e,onChange:t=>t&&g(o,{dataFormat:e})},`extract-row-${o}-fmt-${e}`))})]}),e(ue,{$gap:4,$alignItems:"center",children:[!v&&t(pe,{"data-id":`extract-row-${o}-test-regex`,label:fe.TEST_REGEX_LABEL,variant:me.Secondary,size:he.S,onClick:()=>h(o),disabled:!n.regex?.trim()}),t(pe,{"data-id":`extract-row-${o}-delete`,leftIcon:()=>t(gi,{fill:l.v2.colors.red[500]}),variant:me.Secondary,size:he.S,onClick:()=>(e=>{const t=c.filter((t,n)=>n!==e);m(t.length?t:[d===Er.Preset?Nr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])})(o)}),a&&t(pe,{"data-id":`extract-row-${o}-add`,leftIcon:fi,variant:me.Secondary,size:he.S,onClick:b})]})]}),v?e(ue,{$gap:8,$alignItems:"flex-start",$width:"100%",children:[t(Dr,{children:t(Se,{name:`extract-row-${o}-lookupKey`,label:r.keyLabel,placeholder:r.placeholder,helpMessage:r.helpMessage,width:"100%",value:n.lookupKey||"",onChange:e=>g(o,{lookupKey:e.target.value})})}),t(Pr,{children:t(bi,{size:24,fill:l.v2.colors.silver[200]})}),t(Dr,{children:t(Se,{name:`extract-row-${o}-targetAttributeName`,label:fe.TARGET_LABEL,placeholder:fe.TARGET_PLACEHOLDER,helpMessage:fe.TARGET_HELP,width:"100%",value:n.targetAttributeName||"",onChange:e=>g(o,{targetAttributeName:e.target.value})})})]}):e(q,{$gap:12,$width:"100%",children:[t(Se,{name:`extract-row-${o}-regex`,label:fe.REGEX_LABEL,placeholder:fe.REGEX_PLACEHOLDER,helpMessage:fe.REGEX_HELP,width:"100%",value:n.regex||"",onChange:e=>g(o,{regex:e.target.value})}),t(Se,{name:`extract-row-${o}-targetAttributeName`,label:fe.TARGET_LABEL,placeholder:fe.TARGET_PLACEHOLDER,helpMessage:fe.TARGET_HELP,width:"100%",value:n.targetAttributeName||"",onChange:e=>g(o,{targetAttributeName:e.target.value})})]})]},`extract-row-${o}`)}),t(ee,{errorMessage:s})]}),t($r,{isOpen:null!=p,regex:C,onClose:()=>h(null)})]})}},Wr=({actionType:e,value:n,setValue:o,formErrors:a,dynamicFields:i,signals:l})=>{if(!e)return null;if(i?.length)return t(Hr,{fields:i,value:n,setValue:o,formErrors:a||{},signals:l||[]});const r=jr[e];return r?t(r,{value:n,setValue:o,formErrors:a}):null},Kr=()=>{const n=f(),{selectedOption:o,genericForm:a}=_l();if(!a||!o)return t(Ie,{title:"No active form"});const{formData:i,handleFormChange:l,formErrors:r}=a;return e(q,{$gap:24,children:[e(ue,{$gap:12,$justifyContent:"space-between",children:[t(Ee,{size:de.XXXS,maxLines:2,children:o.description}),e(ue,{$gap:12,children:[t(ge,{options:[{icon:vi,label:"Enabled",value:!1,selectedBgColor:n.v2.colors.green[800]},{icon:yi,label:"Disabled",value:!0,selectedBgColor:n.v2.colors.red[800]}],size:Ae.S,selected:i.disabled,setSelected:e=>l("disabled",e)}),t(pe,{leftIcon:Ci,variant:me.Secondary,size:he.S,onClick:()=>o.docsUrl&&window.open(o.docsUrl,"_blank","noopener noreferrer")})]})]}),t(bl,{title:"Signals for processing",allowedSignals:o.allowedSignals,selectedSignals:i.signals||[],setSelectedSignals:e=>l("signals",e),errorMessage:r.signals}),t(Se,{name:"actionName",label:"Action name",placeholder:"Use a name that describes the action...",value:i.name||"",onChange:({target:{value:e}})=>l("name",e),errorMessage:r.name}),t(Wr,{actionType:o.type,dynamicFields:o.fields,signals:i.signals||[],value:i.fields,setValue:(e,t)=>l(`fields.${e}`,t),formErrors:r}),t(Ne,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:i.notes||"",onChange:({target:{value:e}})=>l("notes",e),errorMessage:r.notes})]})},Yr=({signals:e,fields:n,disabled:o,formData:a,handleFormChange:i,formErrors:l})=>n?.map(({renderCondition:n,componentType:r,type:s,name:c,title:d,tooltip:u,placeholder:p,value:h,required:m,options:g})=>{if(!(!n||xe(n,e,a.fields)))return null;const f=c,b=a.fields.find(e=>e.key===f),v=b?b.value:h;return t(fl,{componentType:r,inputType:s,name:f,label:d,tooltip:u,disabled:o,required:m,placeholder:p,errorMessage:l[f],dropdownOptions:g,value:v||"",setValue:e=>i(f,e)},f)}),Jr=g(ue)`
117
+ `,Zr=e=>Object.entries(e||{}).map(([e,t])=>({oldKey:e,newKey:t})),Qr=e=>{const t={};return e.forEach(({oldKey:e,newKey:o})=>{t[e]=o}),t},es=q.UrlTemplatizationRulesGroups,ts=[{keyName:"kind",label:"Kind",placeholder:"Any kind",componentType:"dropdown",options:[{id:"Deployment",label:"Deployment"},{id:"StatefulSet",label:"StatefulSet"},{id:"DaemonSet",label:"DaemonSet"}]},{keyName:"name",label:"Name",placeholder:"Any name"}],os=e=>{if(Array.isArray(e))return e.map(e=>"string"==typeof e?{id:e,label:e}:e)},ns=e=>{if(!Array.isArray(e)||e.length<3)return;const[t,o,n]=e;return e=>{const i=null==e?.[t]?"":String(e[t]);switch(o){case"=":case"==":case"===":return i===n;case"!=":case"!==":return i!==n;default:return!0}}},is=e=>{if(Array.isArray(e))return e.map(e=>{const t=e;return{keyName:String(t.keyName??t.name??""),label:t.label??t.displayName,tooltip:t.tooltip,placeholder:t.placeholder,helpMessage:t.helpMessage,componentType:t.componentType,options:os(t.options??t.values),fullRow:t.fullRow,defaultValue:t.defaultValue,withRegexTester:t.withRegexTester,separator:t.separator,copyByColumn:t.copyByColumn,renderCondition:ns(t.renderCondition)}})},as=e=>{if(Array.isArray(e))return e.map(e=>{if("string"==typeof e)return{id:e,label:e};const t=e;return{id:String(t.id??t.keyName??t.name??""),label:t.label??t.displayName??String(t.id??""),tooltip:t.tooltip,fields:Array.isArray(t.fields)?t.fields.map(ls):void 0}})},ls=e=>{const t="string"==typeof e.componentProperties?Ee(e.componentProperties,{}):e.componentProps||{};return{name:e.name,componentType:e.componentType,inputType:e.inputType??t.inputType,title:e.displayName,tooltip:t.tooltip,placeholder:t.placeholder,helpMessage:t.helpMessage,required:t.required,initialValue:e.initialValue,renderCondition:e.renderCondition,options:os(t.options??t.values),itemWrapperKey:t.itemWrapperKey,columns:is(t.columns),limitFieldsPerRow:t.limitFieldsPerRow,variant:t.variant,wrapKey:t.wrapKey,checkboxOptions:as(t.options??t.values),checkedValue:t.checkedValue??"true",valueMode:t.valueMode??"object",fields:Array.isArray(t.fields)?t.fields.map(ls):void 0,addLabel:t.addLabel,itemLabel:t.itemLabel,keyLabel:t.titleKey??t.keyLabel,valueLabel:t.titleValue??t.valueLabel}},rs=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),ss=e=>Array.isArray(e)?e:[],cs=e=>{const t={};return e.forEach(e=>{t[String(e.key??"")]=String(e.value??"")}),t},ds=e=>rs(e)?Object.entries(e).map(([e,t])=>({key:e,value:String(t??"")})):[],us=({field:e,value:o,setValue:n,errorMessage:a,disabled:l})=>{const[r,c]=s(()=>ds(o));return i(()=>{const e=rs(o)?o:{};((e,t)=>{const o=Object.keys(e),n=Object.keys(t);return o.length===n.length&&o.every(o=>Object.prototype.hasOwnProperty.call(t,o)&&t[o]===e[o])})(cs(r),e)||c(ds(o))},[o]),t(oe,{name:e.name,label:e.title,tooltip:e.tooltip,helpMessage:e.helpMessage,required:e.required,disabled:l,limitFieldsPerRow:2,columns:[{keyName:"key",label:e.keyLabel||"Key",placeholder:e.keyLabel||"Key"},{keyName:"value",label:e.valueLabel||"Value",placeholder:e.valueLabel||"Value"}],values:r,setValues:e=>{c(e),n(cs(e))},errorMessage:a})},ps=({field:n,value:i,setValue:a,errorMessage:l,disabled:r})=>{const{name:c,componentType:d,inputType:u,title:p,tooltip:h,placeholder:m,helpMessage:g,required:f,initialValue:b,options:v,itemWrapperKey:y,columns:C,limitFieldsPerRow:S,variant:x,wrapKey:w,checkboxOptions:T}=n,[k,E]=s({open:!1,value:""});if(d===Te.CheckboxList&&"array"===n.valueMode){const o=ss(i),n=(e,t)=>a(t?[...o.filter(t=>t!==e),e]:o.filter(t=>t!==e));return e(Z,{$gap:12,children:[p&&t(Q,{label:p,tooltip:h,required:f}),t(Z,{$gap:8,children:(T||[]).map(e=>{const i=t(ee,{name:e.id,label:e.label,value:o.includes(e.id),disabled:r,onChange:t=>n(e.id,t)},e.id);return e.tooltip?t(Ie,{text:e.tooltip,withIcon:!0,children:i},e.id):i})}),t(te,{errorMessage:l,helpMessage:g})]})}if(d===Te.CheckboxList){const o=rs(i)?i:{},s=(e=>"emptyObject"!==e.checkedValue||{})(n),d=e=>"emptyObject"===n.checkedValue?rs(e):!!e;return e(Z,{$gap:12,children:[p&&t(ce,{size:ue.XS,color:de.Secondary,nowrap:!0,children:p}),t(Z,{$gap:12,children:(T||[]).map(n=>{const i=o[n.id],l=d(i),u=rs(i)?i:{},p=t(ee,{label:n.label,value:l,disabled:r,onChange:e=>a({...o,[n.id]:e?rs(i)?i:s:null})}),h=n.tooltip?t(Ie,{text:n.tooltip,withIcon:!0,children:p}):p,m=l&&n.fields?.length?t(Z,{$gap:12,$padding:"0 0 0 24px",children:n.fields.map(e=>t(ps,{field:e,value:u[e.name],setValue:t=>a({...o,[n.id]:{...u,[e.name]:t}}),disabled:r},`${c}-${n.id}-${e.name}`))}):null;return e(Z,{$gap:12,children:[h,m]},n.id)})}),t(te,{errorMessage:l,helpMessage:g})]})}if(d===Te.MultiTabledInput){const n=ss(w?i?.[w]:i),s=e=>a(w?{...rs(i)?i:{},[w]:e}:e),d=(C||[]).some(e=>e.withRegexTester);return e(o,{children:[t("cards"===x?Oe:oe,{name:c,label:p,tooltip:h,helpMessage:g,required:f,disabled:r,columns:C||[],limitFieldsPerRow:S,values:n,setValues:s,errorMessage:l,onTestRegex:d?e=>E({open:!0,value:e}):void 0}),d&&t(Vr,{isOpen:k.open,regex:k.value,onClose:()=>E({open:!1,value:""})})]})}if(d===Te.MultiInput&&w){const e=ss(i?.[w]);return t(le,{name:c,label:p,tooltip:h,helpMessage:g,required:f,disabled:r,placeholder:m,values:e,setValues:e=>a({...rs(i)?i:{},[w]:e}),errorMessage:l})}if(d===Te.MultiInput&&y){const e=ss(i).map(e=>String(e?.[y]??""));return t(le,{name:c,label:p,tooltip:h,helpMessage:g,required:f,disabled:r,placeholder:m,values:e,setValues:e=>a(e.map(e=>({[y]:e}))),errorMessage:l})}if(d===Te.KeyValuePair)return t(us,{field:n,value:i,setValue:a,errorMessage:l,disabled:r});return t($l,{componentType:d,inputType:u,name:c,label:p,tooltip:h,helpMessage:g,disabled:r,required:f,placeholder:m,errorMessage:l,dropdownOptions:v,value:(null==i?b:i)??"",setValue:a})},hs=({field:n,value:i,setValue:a,disabled:l})=>{const r=b(),s=ss(i),d=s.length?s:[{}],u=n.fields||[],p=e=>a(e);return e(o,{children:[d.map((o,i)=>e(c,{children:[t(we,{}),e(Z,{$gap:12,children:[e(pe,{$justifyContent:"space-between",$alignItems:"center",children:[t(Q,{label:`${n.itemLabel||n.title||"Item"} ${i+1}`}),t(he,{leftIcon:()=>t(xa,{fill:r.v2.colors.red[500]}),variant:ge.Secondary,size:me.S,onClick:()=>(e=>{const t=d.filter((t,o)=>o!==e);p(t)})(i),disabled:l||1===d.length})]}),u.map(e=>t(ps,{field:e,value:o[e.name],setValue:t=>((e,t,o)=>p(d.map((n,i)=>i===e?{...n,[t]:o}:n)))(i,e.name,t),disabled:l},`${n.name}-group-${i}-${e.name}`))]})]},`${n.name}-group-${i}`)),t(he,{variant:ge.Secondary,label:n.addLabel||"Add",leftIcon:wa,onClick:()=>p([...d,{}]),disabled:l}),t(we,{})]})},ms=({field:o,value:n,setValue:i,errorMessage:a,disabled:l})=>e(Z,{$gap:12,children:[o.title&&t(Q,{label:o.title,tooltip:o.tooltip,required:o.required}),t(Z,{$gap:8,children:(o.checkboxOptions||[]).map(e=>{const o=t(ee,{name:e.id,label:e.label,value:!0===n?.[e.id],disabled:l,onChange:t=>i(e.id,t)},e.id);return e.tooltip?t(Ie,{text:e.tooltip,withIcon:!0,children:o},e.id):o})}),t(te,{errorMessage:a,helpMessage:o.helpMessage})]}),gs=({signals:e,fields:n,value:a,setValue:l,formErrors:r,disabled:s,seedInitialValues:c})=>{const d=(n||[]).filter(e=>!!e).map(e=>ls(e));return i(()=>{if(!c)return;const e=a||{},t={};d.forEach(o=>{const n=(e=>{const t=e.initialValue;if(void 0!==t&&""!==t)return e.componentType===Te.CheckboxList?"array"===e.valueMode?Ee(t,[]):Ee(t,{}):e.componentType!==Te.MultiInput&&e.componentType!==Te.MultiTabledInput||!e.wrapKey?e.componentType===Te.MultiInput||e.componentType===Te.MultiTabledInput?Ee(t,[]):t:{[e.wrapKey]:Ee(t,[])}})(o);if(void 0===n)return;if(o.componentType===Te.CheckboxList&&"flatFields"===o.valueMode&&rs(n))return void Object.entries(n).forEach(([o,n])=>{void 0!==e[o]&&null!==e[o]||(t[o]=n)});const i=e[o.name];null==i&&(t[o.name]=rs(n)&&rs(t[o.name])?{...t[o.name],...n}:n)}),Object.entries(t).forEach(([e,t])=>l(e,t))},[]),t(o,{children:d.map(o=>{const n=Object.entries(a||{}).map(([e,t])=>({name:e,value:t}));if(!(!o.renderCondition||ke(o.renderCondition,e,n)))return null;const i=a?.[o.name];if(o.componentType===Te.FieldGroup)return t(hs,{field:o,value:i,setValue:e=>l(o.name,e),disabled:s},o.name);if(o.componentType===Te.CheckboxList&&"flatFields"===o.valueMode){const e=o.checkboxOptions?.map(e=>r[e.id]).find(Boolean);return t(ms,{field:o,value:a||{},setValue:l,errorMessage:e,disabled:s},o.name)}return t(ps,{field:o,value:i,setValue:e=>l(o.name,e),errorMessage:r[o.name],disabled:s},o.name)})})},fs={[Ne.K8sAttributes]:({value:n,setValue:a,formErrors:l})=>(i(()=>{n[q.CollectContainerAttributes]||n[q.CollectReplicaSetAttributes]||n[q.CollectWorkloadId]||n[q.CollectClusterId]||n[q.LabelsAttributes]?.length||n[q.AnnotationsAttributes]?.length||(a(q.CollectContainerAttributes,!0),a(q.CollectReplicaSetAttributes,!0),a(q.CollectWorkloadId,!0),a(q.CollectClusterId,!0),a(q.LabelsAttributes,[]),a(q.AnnotationsAttributes,[]))},[]),e(o,{children:[t(Z,{$gap:6,children:xr.map(({id:o,label:i})=>e(Z,{children:[t(ee,{label:i,value:n[o]||!1,onChange:e=>a(o,e)}),t(te,{errorMessage:l[o]})]},o))}),t(oe,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:Tr,values:n[q.LabelsAttributes]||[],setValues:e=>a(q.LabelsAttributes,e),errorMessage:l[q.LabelsAttributes]}),t(oe,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:kr,values:n[q.AnnotationsAttributes]||[],setValues:e=>a(q.AnnotationsAttributes,e),errorMessage:l[q.AnnotationsAttributes]})]})),[Ne.AddClusterInfo]:({value:n,setValue:i,formErrors:a})=>{const l=b();return e(o,{children:[t(ie,{label:"Overwrite existing values",labelAlign:ae.Left,labelColor:l.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:n[q.OverwriteExistingValues]||!1,onChange:e=>i(q.OverwriteExistingValues,e)}),t(oe,{name:"clusterAttributes",label:"Resource attributes",limitFieldsPerRow:2,columns:[{keyName:"attributeName",label:"Attribute name",placeholder:"Attribute name"},{keyName:"attributeStringValue",label:"Attribute value",placeholder:"Attribute value"}],values:n[q.ClusterAttributes]||[],setValues:e=>i(q.ClusterAttributes,e),errorMessage:a[q.ClusterAttributes]})]})},[Ne.DeleteAttributes]:({value:e,setValue:o,formErrors:n})=>t(le,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[q.AttributeNamesToDelete]||[],setValues:e=>o(q.AttributeNamesToDelete,e),errorMessage:n[q.AttributeNamesToDelete]}),[Ne.RenameAttributes]:({value:e,setValue:o,formErrors:n})=>{const a=e[q.Renames],[l,r]=s(()=>Zr(a));return i(()=>{((e,t)=>{const o=Object.keys(e),n=Object.keys(t);return o.length===n.length&&o.every(o=>Object.prototype.hasOwnProperty.call(t,o)&&t[o]===e[o])})(Qr(l),a||{})||r(Zr(a))},[a]),t(oe,{name:"renames",label:"Attributes to rename",limitFieldsPerRow:2,columns:[{keyName:"oldKey",label:"Old key",placeholder:"Old key"},{keyName:"newKey",label:"New key",placeholder:"New key"}],values:l,setValues:e=>{const t=e.map(e=>({oldKey:String(e.oldKey??""),newKey:String(e.newKey??"")}));r(t),o(q.Renames,Qr(t))},errorMessage:n[q.Renames]})},[Ne.PiiMasking]:({value:o,setValue:n,formErrors:a})=>(i(()=>{o[q.PiiCategories]?.length||n(q.PiiCategories,Sr.map(({id:e})=>e))},[]),e(Z,{$gap:12,children:[t(Q,{label:"Attributes to mask"}),t(Z,{$gap:6,children:Sr.map(({id:e,label:i})=>t(ee,{label:i,value:o[q.PiiCategories]?.includes(e)||!1,onChange:t=>{const i=o[q.PiiCategories]||[],a=t?[...i,e]:i.filter(t=>t!==e);n(q.PiiCategories,a)}},e))}),t(te,{errorMessage:a[q.PiiCategories]})]})),[Ne.URLTemplatization]:({value:n,setValue:i,formErrors:a})=>{const l=b(),r=n[es]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],s=e=>i(es,e),d=(e,t)=>s(r.map((o,n)=>n===e?{...o,...t}:o));return e(o,{children:[r.map((o,n)=>e(c,{children:[t(we,{}),e(Z,{$gap:12,children:[e(pe,{$justifyContent:"space-between",$alignItems:"center",children:[t(Q,{label:`Rule Group ${n+1}`}),t(he,{leftIcon:()=>t(xa,{fill:l.v2.colors.red[500]}),variant:ge.Secondary,size:me.S,onClick:()=>{return e=n,s(r.filter((t,o)=>o!==e));var e},disabled:1===r.length})]}),t(xe,{name:`urlGroup-${n}-namespace`,label:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:o.filterK8sNamespace||"",onChange:e=>d(n,{filterK8sNamespace:e.target.value})}),t(oe,{name:`urlGroup-${n}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:ts,values:o.workloadFilters||[],setValues:e=>d(n,{workloadFilters:e})}),t(le,{name:`urlGroup-${n}-templates`,label:"Templates",required:!0,placeholder:"e.g. /user/{id}",values:o.templatizationRules.map(e=>e.template),setValues:e=>d(n,{templatizationRules:e.map(e=>({template:e}))})})]}),t(te,{errorMessage:a[es]})]},`url-templatization-group-${n}`)),t(he,{variant:ge.Secondary,label:"Add rule group",leftIcon:wa,onClick:()=>s([...r,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(we,{})]})},[Ne.ExtractAttribute]:({value:o,setValue:n,formErrors:a})=>{const l=b(),r=a[Hr],c=o[Hr]?.extractions||[],[d,u]=s(()=>(e=>e.length&&e.some(Kr)?jr.Regex:jr.Preset)(c)),[p,h]=s(null),m=e=>n(Hr,{extractions:e});i(()=>{0===c.length&&m([d===jr.Preset?Wr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},[]);const g=(e,t)=>{m(c.map((o,n)=>n===e?{...o,...t}:o))},f=()=>{m([...c,d===jr.Preset?Wr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},v=d===jr.Preset,y=c.length?c:[v?Wr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}],C=null!=p&&y[p]?.regex||"";return e(Z,{$gap:16,$width:"100%",children:[t(fe,{options:[{value:jr.Preset,label:be.SEGMENT_PRESET_LABEL,tooltip:be.SEGMENT_PRESET_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]},{value:jr.Regex,label:be.SEGMENT_REGEX_LABEL,tooltip:be.SEGMENT_REGEX_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]}],selected:d,setSelected:e=>{u(e),m([e===jr.Preset?Wr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])}}),e(Z,{$gap:8,$width:"100%",children:[y.map((o,n)=>{const i=n===y.length-1,a=o.dataFormat||ve.JSON,r=Ce[a];return e(Yr,{"data-id":`extract-row-${n}`,children:[e(pe,{$gap:10,$alignItems:"flex-start",$width:"100%",$justifyContent:"space-between",children:[e(Z,{$gap:10,children:[t(Q,{label:v?be.PRESET_ROW_TITLE(n):be.REGEX_ROW_TITLE(n)}),v&&t(pe,{$gap:24,children:Gr.map(e=>t(ye,{"data-id":`extract-row-${n}-fmt-${e}`,size:Se.L,label:Ce[e].label,value:a===e,onChange:t=>t&&g(n,{dataFormat:e})},`extract-row-${n}-fmt-${e}`))})]}),e(pe,{$gap:4,$alignItems:"center",children:[!v&&t(he,{"data-id":`extract-row-${n}-test-regex`,label:be.TEST_REGEX_LABEL,variant:ge.Secondary,size:me.S,onClick:()=>h(n),disabled:!o.regex?.trim()}),t(he,{"data-id":`extract-row-${n}-delete`,leftIcon:()=>t(xa,{fill:l.v2.colors.red[500]}),variant:ge.Secondary,size:me.S,onClick:()=>(e=>{const t=c.filter((t,o)=>o!==e);m(t.length?t:[d===jr.Preset?Wr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])})(n)}),i&&t(he,{"data-id":`extract-row-${n}-add`,leftIcon:wa,variant:ge.Secondary,size:me.S,onClick:f})]})]}),v?e(pe,{$gap:8,$alignItems:"flex-start",$width:"100%",children:[t(Jr,{children:t(xe,{name:`extract-row-${n}-lookupKey`,label:r.keyLabel,placeholder:r.placeholder,helpMessage:r.helpMessage,width:"100%",value:o.lookupKey||"",onChange:e=>g(n,{lookupKey:e.target.value})})}),t(qr,{children:t(Ta,{size:24,fill:l.v2.colors.silver[200]})}),t(Jr,{children:t(xe,{name:`extract-row-${n}-targetAttributeName`,label:be.TARGET_LABEL,placeholder:be.TARGET_PLACEHOLDER,helpMessage:be.TARGET_HELP,width:"100%",value:o.targetAttributeName||"",onChange:e=>g(n,{targetAttributeName:e.target.value})})})]}):e(Z,{$gap:12,$width:"100%",children:[t(xe,{name:`extract-row-${n}-regex`,label:be.REGEX_LABEL,placeholder:be.REGEX_PLACEHOLDER,helpMessage:be.REGEX_HELP,width:"100%",value:o.regex||"",onChange:e=>g(n,{regex:e.target.value})}),t(xe,{name:`extract-row-${n}-targetAttributeName`,label:be.TARGET_LABEL,placeholder:be.TARGET_PLACEHOLDER,helpMessage:be.TARGET_HELP,width:"100%",value:o.targetAttributeName||"",onChange:e=>g(n,{targetAttributeName:e.target.value})})]})]},`extract-row-${n}`)}),t(te,{errorMessage:r})]}),t(Vr,{isOpen:null!=p,regex:C,onClose:()=>h(null)})]})}},bs=({actionType:e,value:o,setValue:n,formErrors:i,dynamicFields:a,signals:l})=>{if(!e)return null;if(a?.length)return t(gs,{fields:a,value:o,setValue:n,formErrors:i||{},signals:l||[],seedInitialValues:!0},e);const r=fs[e];return r?t(r,{value:o,setValue:n,formErrors:i}):null},vs=()=>{const o=b(),{selectedOption:n,genericForm:i}=Zl();if(!i||!n)return t($e,{title:"No active form"});const{formData:a,handleFormChange:l,formErrors:r}=i;return e(Z,{$gap:24,children:[e(pe,{$gap:12,$justifyContent:"space-between",children:[t(Ae,{size:ue.XXXS,maxLines:2,children:n.description}),e(pe,{$gap:12,children:[t(fe,{options:[{icon:ka,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:Ea,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],size:Re.S,selected:a.disabled,setSelected:e=>l("disabled",e)}),t(he,{leftIcon:Ia,variant:ge.Secondary,size:me.S,onClick:()=>n.docsUrl&&window.open(n.docsUrl,"_blank","noopener noreferrer")})]})]}),t(Al,{title:"Signals for processing",allowedSignals:n.allowedSignals,selectedSignals:a.signals||[],setSelectedSignals:e=>l("signals",e),errorMessage:r.signals}),t(xe,{name:"actionName",label:"Action name",placeholder:"Use a name that describes the action...",value:a.name||"",onChange:({target:{value:e}})=>l("name",e),errorMessage:r.name}),t(bs,{actionType:n.type,dynamicFields:n.fields,signals:a.signals||[],value:a.fields,setValue:(e,t)=>l(`fields.${e}`,t),formErrors:r}),t(De,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:a.notes||"",onChange:({target:{value:e}})=>l("notes",e),errorMessage:r.notes})]})},ys=({signals:e,fields:o,disabled:n,formData:i,handleFormChange:a,formErrors:l})=>o?.map(({renderCondition:o,componentType:r,type:s,name:c,title:d,tooltip:u,placeholder:p,value:h,required:m,options:g})=>{if(!(!o||ke(o,e,i.fields)))return null;const f=c,b=i.fields.find(e=>e.key===f),v=b?b.value:h;return t($l,{componentType:r,inputType:s,name:f,label:d,tooltip:u,disabled:n,required:m,placeholder:p,errorMessage:l[f],dropdownOptions:g,value:v||"",setValue:e=>a(f,e)},f)}),Cs=f(pe)`
118
118
  position: sticky;
119
119
  bottom: 4px;
120
120
  align-self: center;
@@ -125,50 +125,50 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
125
125
  background-color: ${({theme:e})=>e.v2.colors.black[500]};
126
126
  box-shadow: 0 4px 16.7px 0 rgba(0, 0, 0, 0.83);
127
127
  z-index: 1;
128
- `,qr=c(({isEdit:n},a)=>{const i=f(),{isVm:l}=y(),{destinationsApi:s}=gl(),{activeForm:c,genericForm:u,validateFormData:p,thisUnsavedDestination:h,addUnsavedDestination:m,updateUnsavedDestination:g,deleteUnsavedDestination:b}=Ml(),[v,C]=r(h?.testResult),[S,w]=r(!!h);o(()=>{h?(C(h.testResult),w(!0)):(C(void 0),w(!1))},[h]);const x=async()=>{if(!c?.option.testConnectionSupported||!u||l)return;const e=await s.testConnection(_e(u.formData));return C(e),e};return d(a,()=>({testConnection:x,testConnectionSupported:!!c?.option.testConnectionSupported}),[c?.option.testConnectionSupported,u,s]),u&&c?e(q,{$gap:24,style:{minHeight:"100%"},children:[e(ue,{$gap:12,$justifyContent:"space-between",children:[v?v.succeeded?t(Oe,{status:Re.Success,message:v.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t(Oe,{status:Re.Error,message:v.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),e(ue,{$gap:12,children:[!l&&t(ge,{options:[{icon:vi,label:"Enabled",value:!1,selectedBgColor:i.v2.colors.green[800]},{icon:yi,label:"Disabled",value:!0,selectedBgColor:i.v2.colors.red[800]}],size:Ae.S,selected:u.formData.disabled,setSelected:e=>u.handleFormChange("disabled",e),disabled:S}),t(pe,{"data-id":"dest-form-docs",leftIcon:Ci,variant:me.Secondary,size:he.S,onClick:()=>window.open(`${De}/backends/${c.option.type}`,"_blank","noopener noreferrer")})]})]}),t(bl,{title:"This connection will monitor:",allowedSignals:Le(c.option.supportedSignals),selectedSignals:Fe(u.formData.exportedSignals),setSelectedSignals:e=>u.handleFormChange("exportedSignals",{logs:e.includes(Pe.Logs),metrics:e.includes(Pe.Metrics),traces:e.includes(Pe.Traces),profiles:e.includes(Pe.Profiles)}),disabled:S,errorMessage:u.formErrors.exportedSignals}),t(Se,{name:"destinationName",label:"Destination name",placeholder:"Use a name that describes the destination...",value:u.formData.name,onChange:({target:{value:e}})=>u.handleFormChange("name",e),disabled:S,errorMessage:u.formErrors.name}),t(Yr,{signals:Fe(u.formData.exportedSignals),fields:c.dynamicFields,disabled:S,formData:u.formData,handleFormChange:(e,t)=>{u.handleFormChange("fields",u.formData.fields.map(n=>n.key===e?{...n,value:t}:n)),e&&u.formErrors[e]&&u.handleErrorChange(e,void 0)},formErrors:u.formErrors}),!n&&e(Jr,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(pe,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:Si,variant:me.Secondary,textColor:i.v2.colors.red[500],onClick:()=>b(c.unsavedIdx)})}),!l&&(!h||h.option.testConnectionSupported&&!S)&&t("div",{style:{width:"150px"},children:t(pe,{"data-id":"dest-form-test-connection",fullWidth:!0,label:"Test Connection",variant:me.Secondary,onClick:x})}),h&&t("div",S?{style:{width:"150px"},children:t(pe,{"data-id":"dest-form-edit",fullWidth:!0,label:"Edit",rightIcon:wi,variant:me.Secondary,onClick:()=>w(!1)})}:{style:{width:"150px"},children:t(pe,{"data-id":"dest-form-save",fullWidth:!0,label:"Save Changes",variant:me.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await x(),n=!!e&&!e.succeeded;g(c.unsavedIdx,{formData:t,testResult:e},n)}}})}),!h&&t("div",{style:{width:"150px"},children:t(pe,{"data-id":"dest-form-add",fullWidth:!0,label:"Add Destination",variant:me.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await x(),n=!!e&&!e.succeeded;m({formData:t,testResult:e},n)}}})})]})]}):t(Ie,{title:"No active form"})});qr.displayName="AddDestinationForm";const Zr=[{id:Me.FilePath,label:"Collect file path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Me.Function,label:"Collect function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Me.LineNumber,label:"Collect line number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],Qr=[{id:Me.Column,label:"Collect column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Me.Namespace,label:"Collect namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Me.StackTrace,label:"Collect stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],es=["*"],ts=[{id:Xe.HttpRequest,label:"Collect HTTP request",tooltip:""},{id:Xe.HttpResponse,label:"Collect HTTP response",tooltip:""},{id:Xe.DbQuery,label:"Collect DB query",tooltip:""},{id:Xe.Messaging,label:"Collect messaging",tooltip:""}],ns={[Ge.Java]:[new Ue("","")],[Ge.Golang]:[new Ve("")]},os={[He.CodeAttributes]:({value:i,setValue:l,formErrors:r})=>{const s=r.codeAttributes,c=a(()=>Object.entries(i.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[i]);o(()=>{if(!c.length&&!s){const e={[Me.FilePath]:!0,[Me.Function]:!0,[Me.LineNumber]:!0,[Me.Column]:null,[Me.Namespace]:null,[Me.StackTrace]:null};l("codeAttributes",e)}},[]);const d=(e,t)=>{const n=t?[...c,e]:c.filter(t=>t!==e),o=Object.values(Me).reduce((e,t)=>(e[t]=!!n.includes(t)||null,e),{});l("codeAttributes",o)};return e(n,{children:[e(q,{$gap:12,children:[t(se,{size:de.XS,color:ce.Secondary,nowrap:!0,children:"Recommended data to collect"}),t(q,{$gap:6,children:Zr.map(({id:e,label:n,tooltip:o})=>t(ze,{text:o,withIcon:!0,children:t(Q,{label:n,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(ee,{errorMessage:s})]}),e(q,{$gap:12,children:[t(se,{size:de.XS,color:ce.Secondary,nowrap:!0,children:"Verbose data to collect"}),t(q,{$gap:6,children:Qr.map(({id:e,label:n,tooltip:o})=>t(ze,{text:o,withIcon:!0,children:t(Q,{label:n,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(ee,{errorMessage:s})]})]})},[He.CustomInstrumentation]:({value:i,setValue:l,formErrors:r})=>{const s=r.customInstrumentations,c=a(()=>(i?.customInstrumentations?.[Ge.Golang]||[]).map(e=>new Ve(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[i]),d=a(()=>(i?.customInstrumentations?.[Ge.Java]||[]).map(e=>new Ue(e.className,e.methodName)),[i]);return o(()=>{i?.customInstrumentations||s||l("customInstrumentations",{[Ge.Golang]:ns[Ge.Golang],[Ge.Java]:ns[Ge.Java]})},[]),e(n,{children:[e(q,{children:[e(ue,{$gap:8,children:[t(xi,{}),t(Z,{label:"Golang custom probes"})]}),t(te,{name:"golangProbes",columns:[{keyName:"packageName",label:"Package name",placeholder:"e.g. github.com/my-org/my-package",tooltip:"The full import path of the package containing the function or method to be instrumented."},{keyName:"functionName",label:"Function name",placeholder:"e.g. myFunction",tooltip:"The name of the function to be instrumented. Leave empty if instrumenting a receiver method."},{keyName:"receiverName",label:"Receiver name",placeholder:"e.g. myReceiver",tooltip:"The name of the receiver type if instrumenting a method. Leave empty if instrumenting a standalone function."},{keyName:"receiverMethodName",label:"Receiver method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented. Leave empty if instrumenting a standalone function."}],values:c,setValues:e=>{const t={};t[Ge.Golang]=e.map(e=>new Ve(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),t[Ge.Java]=d,l("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]}),e(q,{children:[e(ue,{$gap:8,children:[t(ki,{}),t(Z,{label:"Java custom probes"})]}),t(te,{name:"javaProbes",columns:[{keyName:"className",label:"Class name",placeholder:"e.g. com.example.MyClass",tooltip:"The name of the class to be instrumented."},{keyName:"methodName",label:"Method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented."}],values:d,setValues:e=>{const t={};t[Ge.Golang]=c,t[Ge.Java]=e.map(e=>new Ue(e.className,e.methodName)),l("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]})]})},[He.HeadersCollection]:({value:e,setValue:n,formErrors:i})=>{const l=i.headersCollection,r=a(()=>e?.headersCollection?.[Be.HeaderKeys]||[],[e]),s=e=>{const t={[Be.HeaderKeys]:e};n("headersCollection",t)};return o(()=>{r.length||l||s(es)},[]),t(ie,{name:"headerKeys",label:"Header keys",tooltip:"Specify which headers you want to collect",helpMessage:"Asterisk (*) will collect all headers",values:r,setValues:s,errorMessage:l})},[He.PayloadCollection]:({value:n,setValue:i,formErrors:l})=>{const r=l.payloadCollection,s=a(()=>Object.entries(n.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[n]);o(()=>{if(!s.length&&!r){const e={[Xe.HttpRequest]:{},[Xe.HttpResponse]:{},[Xe.DbQuery]:{},[Xe.Messaging]:{}};i("payloadCollection",e)}},[]);return e(q,{$gap:12,children:[t(se,{size:de.XS,color:ce.Secondary,nowrap:!0,children:"Type of data to collect"}),t(q,{$gap:6,children:ts.map(({id:e,label:n,tooltip:o})=>t(ze,{text:o,withIcon:!0,children:t(Q,{label:n,value:s.includes(e),onChange:t=>((e,t)=>{const n=t?[...s,e]:s.filter(t=>t!==e),o={[Xe.HttpRequest]:n.includes(Xe.HttpRequest)?{}:null,[Xe.HttpResponse]:n.includes(Xe.HttpResponse)?{}:null,[Xe.DbQuery]:n.includes(Xe.DbQuery)?{}:null,[Xe.Messaging]:n.includes(Xe.Messaging)?{}:null};i("payloadCollection",o)})(e,t)})},e))}),t(ee,{errorMessage:r})]})},[He.UnknownType]:null},as=({ruleType:e,value:n,setValue:o,formErrors:a})=>{if(!e)return null;const i=os[e];return i?t(i,{value:n,setValue:o,formErrors:a}):null},is=()=>{const n=f(),{selectedOption:o,genericForm:a,sourceOptions:i,namespaceOptions:l}=zl();if(!a||!o)return t(Ie,{title:"No active form"});const{formData:r,handleFormChange:s,formErrors:c}=a;return e(q,{$gap:24,children:[e(ue,{$gap:12,$justifyContent:"space-between",children:[t(Ee,{size:de.XXXS,maxLines:2,children:o.docsDescription}),e(ue,{$gap:12,children:[t(ge,{options:[{icon:vi,label:"Enabled",value:!1,selectedBgColor:n.v2.colors.green[800]},{icon:yi,label:"Disabled",value:!0,selectedBgColor:n.v2.colors.red[800]}],size:Ae.S,selected:r.disabled,setSelected:e=>s("disabled",e)}),t(pe,{leftIcon:Ci,variant:me.Secondary,size:he.S,onClick:()=>window.open(`${De}${o.docsEndpoint}`,"_blank","noopener noreferrer")})]})]}),t(vl,{option:o,formState:r}),e(ue,{$gap:12,children:[t(se,{size:de.XS,color:ce.Secondary,nowrap:!0,children:"Supported Languages:"}),o.supportedLanguages.map(e=>t(je,{label:We[e],leftIcon:Ke(e),backgroundColor:n.v2.colors.purple[900]},e))]}),t(yl,{scopes:r.sourceScopes,onChange:e=>s("sourceScopes",e),sourceOptions:i,namespaceOptions:l,supportedLanguages:o.type===He.CustomInstrumentation?[]:o.supportedLanguages,dataIdPrefix:"instrumentation-rule",slim:!0}),t(Se,{name:"ruleName",label:"Rule name",placeholder:"Use a name that describes the rule...",value:r.ruleName,onChange:({target:{value:e}})=>s("ruleName",e),errorMessage:c.ruleName}),t(as,{ruleType:o.type,value:r,setValue:(e,t)=>s(e,t),formErrors:c}),t(Ne,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:r.notes,onChange:({target:{value:e}})=>s("notes",e),errorMessage:c.notes})]})},ls=()=>{const{pendingMerge:e,confirmMerge:n,cancelMerge:o}=Bl();if(!e)return null;const{existingName:a,editingName:i}=e;return t(Ye,{isOpen:!0,onClose:o,title:"Merge with existing Data Stream?",description:Je.DATA_STREAM_MERGE_WARNING(i,a),approveButton:{"data-id":"data-stream-merge-confirm",label:"Merge",variant:me.Primary,onClick:n},denyButton:{"data-id":"data-stream-merge-cancel",label:"Cancel",variant:me.Secondary,onClick:o}})},rs=({autoFocus:n})=>{const{dataStreams:o}=qe(),{genericForm:i,excludeName:l,editingName:r}=Bl(),{formData:s,formErrors:c,handleFormChange:d}=i,u=s.name,p=a(()=>o.find(e=>e.name===u&&e.name!==l),[o,u,l]);return e(q,{$width:"100%",$gap:12,children:[t(Se,{name:"data-stream-name",label:Je.STREAM_NAME,placeholder:Je.NAME_YOUR_STREAM_PLACEHOLDER,tooltip:Je.STREAM_DESCRIPTION,required:!0,autoFocus:n,value:u,onChange:e=>d("name",e.target.value),errorMessage:c.name}),p&&t(Oe,{status:Re.Warning,message:Je.DATA_STREAM_MERGE_WARNING(r,p.name),fullWidth:!0})]})},ss=()=>{const{selectedStreamName:e}=qe(),{genericForm:n}=Xl();if(!n)return t(Ie,{title:"No active form"});const{formData:o,handleFormChange:a,formErrors:i}=n;return t(Se,{name:"sourceName",label:Je.NAME,tooltip:"This overrides the default service name (service.name) reported in your telemetry.",placeholder:"Use a name that overrides the source name",value:o.otelServiceName,onChange:({target:{value:t}})=>{a("otelServiceName",t),a("currentStreamName",e)},errorMessage:i.otelServiceName})},cs=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],ds=g.div`
128
+ `,Ss=d(({isEdit:o},n)=>{const a=b(),{isVm:l}=C(),{destinationsApi:r}=Nl(),{activeForm:c,genericForm:d,validateFormData:p,thisUnsavedDestination:h,addUnsavedDestination:m,updateUnsavedDestination:g,deleteUnsavedDestination:f}=Ql(),[v,y]=s(h?.testResult),[S,x]=s(!!h);i(()=>{h?(y(h.testResult),x(!0)):(y(void 0),x(!1))},[h]);const w=async()=>{if(!c?.option.testConnectionSupported||!d||l)return;const e=await r.testConnection(Be(d.formData));return y(e),e};return u(n,()=>({testConnection:w,testConnectionSupported:!!c?.option.testConnectionSupported}),[c?.option.testConnectionSupported,d,r]),d&&c?e(Z,{$gap:24,style:{minHeight:"100%"},children:[e(pe,{$gap:12,$justifyContent:"space-between",children:[v?v.succeeded?t(_e,{status:Pe.Success,message:v.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t(_e,{status:Pe.Error,message:v.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),e(pe,{$gap:12,children:[!l&&t(fe,{options:[{icon:ka,label:"Enabled",value:!1,selectedBgColor:a.v2.colors.green[800]},{icon:Ea,label:"Disabled",value:!0,selectedBgColor:a.v2.colors.red[800]}],size:Re.S,selected:d.formData.disabled,setSelected:e=>d.handleFormChange("disabled",e),disabled:S}),t(he,{"data-id":"dest-form-docs",leftIcon:Ia,variant:ge.Secondary,size:me.S,onClick:()=>window.open(`${Le}/backends/${c.option.type}`,"_blank","noopener noreferrer")})]})]}),t(Al,{title:"This connection will monitor:",allowedSignals:ze(c.option.supportedSignals),selectedSignals:Me(d.formData.exportedSignals),setSelectedSignals:e=>d.handleFormChange("exportedSignals",{logs:e.includes(Fe.Logs),metrics:e.includes(Fe.Metrics),traces:e.includes(Fe.Traces),profiles:e.includes(Fe.Profiles)}),disabled:S,errorMessage:d.formErrors.exportedSignals}),t(xe,{name:"destinationName",label:"Destination name",placeholder:"Use a name that describes the destination...",value:d.formData.name,onChange:({target:{value:e}})=>d.handleFormChange("name",e),disabled:S,errorMessage:d.formErrors.name}),t(ys,{signals:Me(d.formData.exportedSignals),fields:c.dynamicFields,disabled:S,formData:d.formData,handleFormChange:(e,t)=>{d.handleFormChange("fields",d.formData.fields.map(o=>o.key===e?{...o,value:t}:o)),e&&d.formErrors[e]&&d.handleErrorChange(e,void 0)},formErrors:d.formErrors}),!o&&e(Cs,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(he,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:Oa,variant:ge.Secondary,textColor:a.v2.colors.red[500],onClick:()=>f(c.unsavedIdx)})}),!l&&(!h||h.option.testConnectionSupported&&!S)&&t("div",{style:{width:"150px"},children:t(he,{"data-id":"dest-form-test-connection",fullWidth:!0,label:"Test Connection",variant:ge.Secondary,onClick:w})}),h&&t("div",S?{style:{width:"150px"},children:t(he,{"data-id":"dest-form-edit",fullWidth:!0,label:"Edit",rightIcon:Na,variant:ge.Secondary,onClick:()=>x(!1)})}:{style:{width:"150px"},children:t(he,{"data-id":"dest-form-save",fullWidth:!0,label:"Save Changes",variant:ge.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await w(),o=!!e&&!e.succeeded;g(c.unsavedIdx,{formData:t,testResult:e},o)}}})}),!h&&t("div",{style:{width:"150px"},children:t(he,{"data-id":"dest-form-add",fullWidth:!0,label:"Add Destination",variant:ge.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await w(),o=!!e&&!e.succeeded;m({formData:t,testResult:e},o)}}})})]})]}):t($e,{title:"No active form"})});Ss.displayName="AddDestinationForm";const xs=[{id:Xe.FilePath,label:"Collect file path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Xe.Function,label:"Collect function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Xe.LineNumber,label:"Collect line number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],ws=[{id:Xe.Column,label:"Collect column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Xe.Namespace,label:"Collect namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Xe.StackTrace,label:"Collect stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],Ts=["*"],ks=[{id:Ve.HttpRequest,label:"Collect HTTP request",tooltip:""},{id:Ve.HttpResponse,label:"Collect HTTP response",tooltip:""},{id:Ve.DbQuery,label:"Collect DB query",tooltip:""},{id:Ve.Messaging,label:"Collect messaging",tooltip:""}],Es={[Ge.Java]:[new je("","")],[Ge.Golang]:[new He("")]},Is={[We.CodeAttributes]:({value:n,setValue:l,formErrors:r})=>{const s=r.codeAttributes,c=a(()=>Object.entries(n.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[n]);i(()=>{if(!c.length&&!s){const e={[Xe.FilePath]:!0,[Xe.Function]:!0,[Xe.LineNumber]:!0,[Xe.Column]:null,[Xe.Namespace]:null,[Xe.StackTrace]:null};l("codeAttributes",e)}},[]);const d=(e,t)=>{const o=t?[...c,e]:c.filter(t=>t!==e),n=Object.values(Xe).reduce((e,t)=>(e[t]=!!o.includes(t)||null,e),{});l("codeAttributes",n)};return e(o,{children:[e(Z,{$gap:12,children:[t(ce,{size:ue.XS,color:de.Secondary,nowrap:!0,children:"Recommended data to collect"}),t(Z,{$gap:6,children:xs.map(({id:e,label:o,tooltip:n})=>t(Ie,{text:n,withIcon:!0,children:t(ee,{label:o,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(te,{errorMessage:s})]}),e(Z,{$gap:12,children:[t(ce,{size:ue.XS,color:de.Secondary,nowrap:!0,children:"Verbose data to collect"}),t(Z,{$gap:6,children:ws.map(({id:e,label:o,tooltip:n})=>t(Ie,{text:n,withIcon:!0,children:t(ee,{label:o,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(te,{errorMessage:s})]})]})},[We.CustomInstrumentation]:({value:n,setValue:l,formErrors:r})=>{const s=r.customInstrumentations,c=a(()=>(n?.customInstrumentations?.[Ge.Golang]||[]).map(e=>new He(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[n]),d=a(()=>(n?.customInstrumentations?.[Ge.Java]||[]).map(e=>new je(e.className,e.methodName)),[n]);return i(()=>{n?.customInstrumentations||s||l("customInstrumentations",{[Ge.Golang]:Es[Ge.Golang],[Ge.Java]:Es[Ge.Java]})},[]),e(o,{children:[e(Z,{children:[e(pe,{$gap:8,children:[t($a,{}),t(Q,{label:"Golang custom probes"})]}),t(oe,{name:"golangProbes",columns:[{keyName:"packageName",label:"Package name",placeholder:"e.g. github.com/my-org/my-package",tooltip:"The full import path of the package containing the function or method to be instrumented."},{keyName:"functionName",label:"Function name",placeholder:"e.g. myFunction",tooltip:"The name of the function to be instrumented. Leave empty if instrumenting a receiver method."},{keyName:"receiverName",label:"Receiver name",placeholder:"e.g. myReceiver",tooltip:"The name of the receiver type if instrumenting a method. Leave empty if instrumenting a standalone function."},{keyName:"receiverMethodName",label:"Receiver method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented. Leave empty if instrumenting a standalone function."}],values:c,setValues:e=>{const t={};t[Ge.Golang]=e.map(e=>new He(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),t[Ge.Java]=d,l("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]}),e(Z,{children:[e(pe,{$gap:8,children:[t(Aa,{}),t(Q,{label:"Java custom probes"})]}),t(oe,{name:"javaProbes",columns:[{keyName:"className",label:"Class name",placeholder:"e.g. com.example.MyClass",tooltip:"The name of the class to be instrumented."},{keyName:"methodName",label:"Method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented."}],values:d,setValues:e=>{const t={};t[Ge.Golang]=c,t[Ge.Java]=e.map(e=>new je(e.className,e.methodName)),l("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]})]})},[We.HeadersCollection]:({value:e,setValue:o,formErrors:n})=>{const l=n.headersCollection,r=a(()=>e?.headersCollection?.[Ue.HeaderKeys]||[],[e]),s=e=>{const t={[Ue.HeaderKeys]:e};o("headersCollection",t)};return i(()=>{r.length||l||s(Ts)},[]),t(le,{name:"headerKeys",label:"Header keys",tooltip:"Specify which headers you want to collect",helpMessage:"Asterisk (*) will collect all headers",values:r,setValues:s,errorMessage:l})},[We.PayloadCollection]:({value:o,setValue:n,formErrors:l})=>{const r=l.payloadCollection,s=a(()=>Object.entries(o.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[o]);i(()=>{if(!s.length&&!r){const e={[Ve.HttpRequest]:{},[Ve.HttpResponse]:{},[Ve.DbQuery]:{},[Ve.Messaging]:{}};n("payloadCollection",e)}},[]);return e(Z,{$gap:12,children:[t(ce,{size:ue.XS,color:de.Secondary,nowrap:!0,children:"Type of data to collect"}),t(Z,{$gap:6,children:ks.map(({id:e,label:o,tooltip:i})=>t(Ie,{text:i,withIcon:!0,children:t(ee,{label:o,value:s.includes(e),onChange:t=>((e,t)=>{const o=t?[...s,e]:s.filter(t=>t!==e),i={[Ve.HttpRequest]:o.includes(Ve.HttpRequest)?{}:null,[Ve.HttpResponse]:o.includes(Ve.HttpResponse)?{}:null,[Ve.DbQuery]:o.includes(Ve.DbQuery)?{}:null,[Ve.Messaging]:o.includes(Ve.Messaging)?{}:null};n("payloadCollection",i)})(e,t)})},e))}),t(te,{errorMessage:r})]})},[We.UnknownType]:null},Os=({ruleType:e,value:o,setValue:n,formErrors:i,dynamicFields:a})=>{if(!e)return null;if(a?.length)return t(gs,{fields:a,value:o,setValue:n,formErrors:i||{},signals:[],seedInitialValues:!0});const l=Is[e];return l?t(l,{value:o,setValue:n,formErrors:i}):null},Ns=()=>{const o=b(),{isVm:n}=C(),{selectedOption:i,genericForm:a,sourceOptions:l,namespaceOptions:r}=er();if(!a||!i)return t($e,{title:"No active form"});const{formData:s,handleFormChange:c,formErrors:d}=a;return e(Z,{$gap:24,children:[e(pe,{$gap:12,$justifyContent:"space-between",children:[t(Ae,{size:ue.XXXS,maxLines:2,children:i.description}),e(pe,{$gap:12,children:[t(fe,{options:[{icon:ka,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:Ea,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],size:Re.S,selected:s.disabled,setSelected:e=>c("disabled",e)}),t(he,{leftIcon:Ia,variant:ge.Secondary,size:me.S,onClick:()=>i.docsUrl&&window.open(i.docsUrl,"_blank","noopener noreferrer")})]})]}),t(Rl,{option:i,formState:s}),e(pe,{$gap:12,children:[t(ce,{size:ue.XS,color:de.Secondary,nowrap:!0,children:"Supported Languages:"}),i.supportedLanguages.map(e=>t(Ke,{label:Ye[e],leftIcon:Je(e),backgroundColor:o.v2.colors.purple[900]},e))]}),!n&&t(Dl,{scopes:s.sourceScopes,onChange:e=>c("sourceScopes",e),sourceOptions:l,namespaceOptions:r,supportedLanguages:i.type===We.CustomInstrumentation?[]:i.supportedLanguages,dataIdPrefix:"instrumentation-rule",slim:!0}),t(xe,{name:"ruleName",label:"Rule name",placeholder:"Use a name that describes the rule...",value:s.ruleName,onChange:({target:{value:e}})=>c("ruleName",e),errorMessage:d.ruleName}),t(Os,{ruleType:i.type,dynamicFields:i.fields,value:s,setValue:(e,t)=>c(e,t),formErrors:d}),t(De,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:s.notes,onChange:({target:{value:e}})=>c("notes",e),errorMessage:d.notes})]})},$s=()=>{const{pendingMerge:e,confirmMerge:o,cancelMerge:n}=tr();if(!e)return null;const{existingName:i,editingName:a}=e;return t(qe,{isOpen:!0,onClose:n,title:"Merge with existing Data Stream?",description:Ze.DATA_STREAM_MERGE_WARNING(a,i),approveButton:{"data-id":"data-stream-merge-confirm",label:"Merge",variant:ge.Primary,onClick:o},denyButton:{"data-id":"data-stream-merge-cancel",label:"Cancel",variant:ge.Secondary,onClick:n}})},As=({autoFocus:o})=>{const{dataStreams:n}=Qe(),{genericForm:i,excludeName:l,editingName:r}=tr(),{formData:s,formErrors:c,handleFormChange:d}=i,u=s.name,p=a(()=>n.find(e=>e.name===u&&e.name!==l),[n,u,l]);return e(Z,{$width:"100%",$gap:12,children:[t(xe,{name:"data-stream-name",label:Ze.STREAM_NAME,placeholder:Ze.NAME_YOUR_STREAM_PLACEHOLDER,tooltip:Ze.STREAM_DESCRIPTION,required:!0,autoFocus:o,value:u,onChange:e=>d("name",e.target.value),errorMessage:c.name}),p&&t(_e,{status:Pe.Warning,message:Ze.DATA_STREAM_MERGE_WARNING(r,p.name),fullWidth:!0})]})},Rs=()=>{const{selectedStreamName:e}=Qe(),{genericForm:o}=or();if(!o)return t($e,{title:"No active form"});const{formData:n,handleFormChange:i,formErrors:a}=o;return t(xe,{name:"sourceName",label:Ze.NAME,tooltip:"This overrides the default service name (service.name) reported in your telemetry.",placeholder:"Use a name that overrides the source name",value:n.otelServiceName,onChange:({target:{value:t}})=>{i("otelServiceName",t),i("currentStreamName",e)},errorMessage:a.otelServiceName})},Ds=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],_s=f.div`
129
129
  display: flex;
130
130
  flex-direction: column;
131
131
  gap: 24px;
132
- `,us=g.div`
132
+ `,Ps=f.div`
133
133
  display: contents;
134
134
  & > * {
135
135
  opacity: ${({$faded:e})=>e?.4:1};
136
136
  transition: opacity 0.2s ease;
137
137
  }
138
- `,ps=({value:e})=>{const n=f();return t(je,e?{status:Re.Success,label:at,leftIcon:vi}:{label:it,leftIcon:yi,backgroundColor:n.v2.colors.silver[500],textColor:n.v2.colors.white[500]})},hs=({value:e,onChange:n})=>{const o=f(),i=a(()=>[{icon:vi,label:at,value:!0,selectedBgColor:o.v2.colors.green[800]},{icon:yi,label:it,value:!1,selectedBgColor:o.v2.colors.silver[500]}],[o]);return t(ge,{options:i,selected:e,setSelected:n??(()=>{}),disabled:!n})},ms=()=>{const e=Vl();switch(e.formType){case Ul.Create:return t(gs,{category:e.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(hs,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})});case Ul.View:return e.data?e.isEditing?t(gs,{category:e.data.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(hs,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})}):t(fs,{data:e.data,renderAction:()=>t(ps,{value:!e.data?.rule.disabled})}):null;case Ul.EditAutoNoisy:return t(bs,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:ot,sectionTitle:et,sectionSubTitle:nt,presetLabel:Qe,customInputName:"sampling-auto-input-custom-percentage",percentageMode:e.percentageMode,setPercentageMode:e.setPercentageMode,percentagePreset:e.percentagePreset,setPercentagePreset:e.setPercentagePreset,customPercentage:e.customPercentage,setCustomPercentage:e.setCustomPercentage,renderAction:()=>t(hs,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Ul.EditAutoCostReduction:return t(bs,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:tt,sectionTitle:et,presetLabel:Qe,customInputName:"sampling-cr-auto-input-custom-percentage",showModeToggle:!1,percentageMode:e.percentageMode,setPercentageMode:e.setPercentageMode,percentagePreset:e.percentagePreset,setPercentagePreset:e.setPercentagePreset,customPercentage:e.customPercentage,setCustomPercentage:e.setCustomPercentage,renderAction:()=>t(hs,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Ul.EditAutoHighlyRelevant:return t(ds,{children:t(Cl,{title:e.localEnabled?void 0:Ze,summary:e.summary,renderAction:()=>t(hs,{value:e.localEnabled,onChange:e.setLocalEnabled})})})}},gs=({category:n,formData:o,onChange:a,sourceOptions:i,namespaceOptions:l,renderAction:r})=>e(ds,{children:[t(xl,{category:n,formState:o,renderAction:r}),e(us,{$faded:!!o.disabled,children:[t(kl,{category:n,formState:o,onChange:a}),t(yl,{scopes:o.sourceScopes,onChange:e=>a({sourceScopes:e}),sourceOptions:i,namespaceOptions:l,titleNumber:1,dataIdPrefix:"sampling"}),t(Tl,{category:n,formState:o,onChange:a}),"highlyRelevant"===n&&t($l,{formState:o,onChange:a}),"highlyRelevant"===n&&t(Il,{ruleType:o.ruleType,formState:o,onChange:a}),t(El,{category:n,formState:o,onChange:a})]})]}),fs=({data:n,renderAction:o})=>e(ds,{children:[t(xl,{readOnly:!0,summary:n.summary,renderAction:o}),t(kl,{readOnly:!0,data:n}),t(yl,{readOnly:!0,scopes:C(n.rule.sourceScopes)}),t(Tl,{readOnly:!0,data:n}),t(El,{readOnly:!0,data:n}),"highlyRelevant"===n.category&&t(Il,{readOnly:!0,rule:n.rule})]}),bs=({enabled:n,summary:o,inactiveTitle:a,sectionTitle:i,sectionSubTitle:r,presetLabel:s,customInputName:c,showModeToggle:d=!0,percentageMode:u,setPercentageMode:p,percentagePreset:h,setPercentagePreset:m,customPercentage:g,setCustomPercentage:f,renderAction:b})=>{const v=l(e=>p(e),[p]),y=l(e=>m(e),[m]),C=l(e=>f(e.target.value),[f]),S=!d||"sample"===u;return e(ds,{children:[t(Cl,{title:n?void 0:a,summary:o,renderAction:b}),t(us,{$faded:!n,children:e(lt,{richTitle:{title:i,subTitle:r},children:[d&&t(q,{$alignItems:"flex-start",children:t(ge,{options:cs,selected:u,setSelected:v})}),S&&t(Sl,{description:s,options:wl,selected:h,onSelect:y,customName:c,customLabel:rt,customPlaceholder:"5%",customValue:g,onCustomChange:C})]})})]})},vs=g.div`
138
+ `,Ls=({value:e})=>{const o=b();return t(Ke,e?{status:Pe.Success,label:lt,leftIcon:ka}:{label:rt,leftIcon:Ea,backgroundColor:o.v2.colors.silver[500],textColor:o.v2.colors.white[500]})},Fs=({value:e,onChange:o})=>{const n=b(),i=a(()=>[{icon:ka,label:lt,value:!0,selectedBgColor:n.v2.colors.green[800]},{icon:Ea,label:rt,value:!1,selectedBgColor:n.v2.colors.silver[500]}],[n]);return t(fe,{options:i,selected:e,setSelected:o??(()=>{}),disabled:!o})},Ms=()=>{const e=nr();switch(e.formType){case ir.Create:return t(zs,{category:e.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Fs,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})});case ir.View:return e.data?e.isEditing?t(zs,{category:e.data.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Fs,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})}):t(Bs,{data:e.data,renderAction:()=>t(Ls,{value:!e.data?.rule.disabled})}):null;case ir.EditAutoNoisy:return t(Xs,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:at,sectionTitle:ot,sectionSubTitle:it,presetLabel:tt,customInputName:"sampling-auto-input-custom-percentage",percentageMode:e.percentageMode,setPercentageMode:e.setPercentageMode,percentagePreset:e.percentagePreset,setPercentagePreset:e.setPercentagePreset,customPercentage:e.customPercentage,setCustomPercentage:e.setCustomPercentage,renderAction:()=>t(Fs,{value:e.localEnabled,onChange:e.setLocalEnabled})});case ir.EditAutoCostReduction:return t(Xs,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:nt,sectionTitle:ot,presetLabel:tt,customInputName:"sampling-cr-auto-input-custom-percentage",showModeToggle:!1,percentageMode:e.percentageMode,setPercentageMode:e.setPercentageMode,percentagePreset:e.percentagePreset,setPercentagePreset:e.setPercentagePreset,customPercentage:e.customPercentage,setCustomPercentage:e.setCustomPercentage,renderAction:()=>t(Fs,{value:e.localEnabled,onChange:e.setLocalEnabled})});case ir.EditAutoHighlyRelevant:return t(_s,{children:t(_l,{title:e.localEnabled?void 0:et,summary:e.summary,renderAction:()=>t(Fs,{value:e.localEnabled,onChange:e.setLocalEnabled})})})}},zs=({category:o,formData:n,onChange:i,sourceOptions:a,namespaceOptions:l,renderAction:r})=>e(_s,{children:[t(Fl,{category:o,formState:n,renderAction:r}),e(Ps,{$faded:!!n.disabled,children:[t(Ml,{category:o,formState:n,onChange:i}),t(Dl,{scopes:n.sourceScopes,onChange:e=>i({sourceScopes:e}),sourceOptions:a,namespaceOptions:l,titleNumber:1,dataIdPrefix:"sampling"}),t(zl,{category:o,formState:n,onChange:i}),"highlyRelevant"===o&&t(Bl,{formState:n,onChange:i}),"highlyRelevant"===o&&t(Xl,{ruleType:n.ruleType,formState:n,onChange:i}),t(Ul,{category:o,formState:n,onChange:i})]})]}),Bs=({data:o,renderAction:n})=>e(_s,{children:[t(Fl,{readOnly:!0,summary:o.summary,renderAction:n}),t(Ml,{readOnly:!0,data:o}),t(Dl,{readOnly:!0,scopes:S(o.rule.sourceScopes)}),t(zl,{readOnly:!0,data:o}),t(Ul,{readOnly:!0,data:o}),"highlyRelevant"===o.category&&t(Xl,{readOnly:!0,rule:o.rule})]}),Xs=({enabled:o,summary:n,inactiveTitle:i,sectionTitle:a,sectionSubTitle:l,presetLabel:s,customInputName:c,showModeToggle:d=!0,percentageMode:u,setPercentageMode:p,percentagePreset:h,setPercentagePreset:m,customPercentage:g,setCustomPercentage:f,renderAction:b})=>{const v=r(e=>p(e),[p]),y=r(e=>m(e),[m]),C=r(e=>f(e.target.value),[f]),S=!d||"sample"===u;return e(_s,{children:[t(_l,{title:o?void 0:i,summary:n,renderAction:b}),t(Ps,{$faded:!o,children:e(st,{richTitle:{title:a,subTitle:l},children:[d&&t(Z,{$alignItems:"flex-start",children:t(fe,{options:Ds,selected:u,setSelected:v})}),S&&t(Pl,{description:s,options:Ll,selected:h,onSelect:y,customName:c,customLabel:ct,customPlaceholder:"5%",customValue:g,onCustomChange:C})]})})]})},Us=f.div`
139
139
  display: flex;
140
140
  align-items: center;
141
141
  justify-content: space-between;
142
142
  gap: 12px;
143
143
  padding: 8px 12px;
144
144
  border-radius: 12px;
145
- background-color: ${({$isSelected:e,$purpleColors:t,theme:n})=>e?t?n.v2.colors.purple[800]:n.v2.colors.silver[600]:t?n.v2.colors.purple[900]:"transparent"};
145
+ background-color: ${({$isSelected:e,$purpleColors:t,theme:o})=>e?t?o.v2.colors.purple[800]:o.v2.colors.silver[600]:t?o.v2.colors.purple[900]:"transparent"};
146
146
  cursor: ${({$disabled:e})=>e?"not-allowed":"pointer"};
147
147
  opacity: ${({$disabled:e})=>e?.5:1};
148
148
  &:hover {
149
- background-color: ${({$isSelected:e,$purpleColors:t,theme:n})=>n.v2.colors[t?"purple":"silver"][e?"700":"800"]};
149
+ background-color: ${({$isSelected:e,$purpleColors:t,theme:o})=>o.v2.colors[t?"purple":"silver"][e?"700":"800"]};
150
150
  }
151
- `,ys=g.div`
151
+ `,Vs=f.div`
152
152
  display: flex;
153
153
  align-items: center;
154
154
  justify-content: center;
155
155
  padding: 8px;
156
156
  border-radius: 8px;
157
- background-color: ${({theme:e})=>e.v2.colors.white[500]+st["004"]};
158
- `,Cs=({dataId:n,icon:o,title:a,description:i,withCarret:l,purpleColors:r,disabled:s,children:c,isSelected:d,onClick:u,isChecked:p,isPartiallyChecked:h,onCheckboxChange:m})=>e(vs,{"data-id":n||`list-item-${a}`,$isSelected:d,$purpleColors:r,$disabled:s,onClick:()=>!d&&!s&&u(),children:[e(q,{$gap:4,children:[e(ue,{$gap:12,children:[m&&t(Q,{partiallyChecked:h||!1,value:p||!1,onChange:e=>m(e)}),o&&t(ys,{children:t(o,{size:20})}),t(se,{size:de.XS,children:a})]}),i&&t(se,{size:de.XXXS,color:ce.Secondary,children:i})]}),(l||c)&&e(ue,{$gap:8,children:[c,l&&t(Ti,{size:18})]})]}),Ss=({onClose:e,selectedConnectionIds:n,setSelectedConnectionIds:o,withOverlay:l})=>{const{actionsApi:s}=gl(),{platformType:c,version:d}=y(),[u,p]=r(""),h=i(null),{selectedOption:m,onSelectOption:g,genericForm:f,validateFormData:b}=_l(),{options:v,loading:C}=s.useActionTypes(),S=a(()=>v.length?v:ct(c,d),[v,c,d]),w=a(()=>(u?S.filter(e=>e?.label?.toLowerCase().includes(u.toLowerCase())):S).filter(e=>!!e),[S,u]),x=a(()=>{if(C)return[t(dt,{$padding:"8px 12px",children:t(ut,{size:6})},"loading")];return w.map(e=>{const n=m?.type===e.type;return t(Cs,{dataId:e.type?`option-${e.type}`:void 0,title:e.label,description:e.description,withCarret:!0,isSelected:n,onClick:()=>{h.current?.clearErrors(),g(e)}},e.type)})},[C,m?.type,w,g]),k=a(()=>C?[t(dt,{$padding:"8px 12px",children:t(ut,{size:4})},"loading")]:m?[t(Kr,{},m.type)]:[t(pt,{$height:"100%",children:t(Ie,{icon:$i,title:"Action not selected",subTitle:"Please select an action to add"})},"no-data")],[C,m]);return t(Al,{ref:h,isOpen:!0,withOverlay:l,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=b();if(e)return!1;await s.create(t)},disableSave:!m||!f?.isFormDirty,isFormDirty:f?.isFormDirty,hideDirtyNote:!0,progress:{title:Je.CREATING_ACTION,subTitle:Je.CREATING_ACTION_SUBTITLE},header:{icon:$i,title:Je.ADD_ACTION,subTitle:Je.ADD_ACTION_DESCRIPTION},connectionIds:n&&o?{value:n,setValue:o}:void 0,search:{value:u,onChange:p},leftColumn:{width:"40%",list:x},rightColumn:{width:"60%",list:k}})},ws=({destinationsByCategory:o,filters:i,setFilters:l})=>{const r=a(()=>Object.values(ht).map(e=>({id:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()})).filter(e=>o[e.id]?.length),[o]),s=a(()=>{const e=Object.values(Pe).map(e=>({value:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}));return e.unshift({value:null,label:"All"}),e},[]);return e(n,{children:[t(mt,{placeholder:"Select category",options:r,values:i.categoryType?[i.categoryType]:[],setValues:e=>l({...i,categoryType:i.categoryType===e[0]?null:e[0]})}),t(ge,{options:s,selected:i.signalType,setSelected:e=>l({...i,signalType:e})})]})},xs=g.div`
157
+ background-color: ${({theme:e})=>e.v2.colors.white[500]+dt["004"]};
158
+ `,Hs=({dataId:o,icon:n,title:i,description:a,withCarret:l,purpleColors:r,disabled:s,children:c,isSelected:d,onClick:u,isChecked:p,isPartiallyChecked:h,onCheckboxChange:m})=>e(Us,{"data-id":o||`list-item-${i}`,$isSelected:d,$purpleColors:r,$disabled:s,onClick:()=>!d&&!s&&u(),children:[e(Z,{$gap:4,children:[e(pe,{$gap:12,children:[m&&t(ee,{partiallyChecked:h||!1,value:p||!1,onChange:e=>m(e)}),n&&t(Vs,{children:t(n,{size:20})}),t(ce,{size:ue.XS,children:i})]}),a&&t(ce,{size:ue.XXXS,color:de.Secondary,children:a})]}),(l||c)&&e(pe,{$gap:8,children:[c,l&&t(Ra,{size:18})]})]}),js=({onClose:e,selectedConnectionIds:o,setSelectedConnectionIds:n,withOverlay:i})=>{const{actionsApi:r}=Nl(),{platformType:c,version:d}=C(),[u,p]=s(""),h=l(null),{selectedOption:m,onSelectOption:g,genericForm:f,validateFormData:b}=Zl(),{options:v,loading:y}=r.useActionTypes(),S=a(()=>v.length?v:ut(c,d),[v,c,d]),x=a(()=>(u?S.filter(e=>e?.label?.toLowerCase().includes(u.toLowerCase())):S).filter(e=>!!e),[S,u]),w=a(()=>{if(y)return[t(pt,{$padding:"8px 12px",children:t(ht,{size:6})},"loading")];return x.map(e=>{const o=m?.type===e.type;return t(Hs,{dataId:e.type?`option-${e.type}`:void 0,title:e.label,description:e.description,withCarret:!0,isSelected:o,onClick:()=>{h.current?.clearErrors(),g(e)}},e.type)})},[y,m?.type,x,g]),T=a(()=>y?[t(pt,{$padding:"8px 12px",children:t(ht,{size:4})},"loading")]:m?[t(vs,{},m.type)]:[t(mt,{$height:"100%",children:t($e,{icon:Da,title:"Action not selected",subTitle:"Please select an action to add"})},"no-data")],[y,m]);return t(Vl,{ref:h,isOpen:!0,withOverlay:i,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=b();if(e)return!1;await r.create(t)},disableSave:!m||!f?.isFormDirty,isFormDirty:f?.isFormDirty,hideDirtyNote:!0,progress:{title:Ze.CREATING_ACTION,subTitle:Ze.CREATING_ACTION_SUBTITLE},header:{icon:Da,title:Ze.ADD_ACTION,subTitle:Ze.ADD_ACTION_DESCRIPTION},connectionIds:o&&n?{value:o,setValue:n}:void 0,search:{value:u,onChange:p},leftColumn:{width:"40%",list:w},rightColumn:{width:"60%",list:T}})},Gs=({destinationsByCategory:n,filters:i,setFilters:l})=>{const r=a(()=>Object.values(gt).map(e=>({id:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()})).filter(e=>n[e.id]?.length),[n]),s=a(()=>{const e=Object.values(Fe).map(e=>({value:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}));return e.unshift({value:null,label:"All"}),e},[]);return e(o,{children:[t(ft,{placeholder:"Select category",options:r,values:i.categoryType?[i.categoryType]:[],setValues:e=>l({...i,categoryType:i.categoryType===e[0]?null:e[0]})}),t(fe,{options:s,selected:i.signalType,setSelected:e=>l({...i,signalType:e})})]})},Ws=f.div`
159
159
  display: flex;
160
160
  flex-direction: column;
161
161
  padding: 8px;
162
162
  border-radius: 16px;
163
163
  border: ${({$purpleColors:e,theme:t})=>e?`1px solid ${t.v2.colors.purple[500]}`:"1px solid transparent"};
164
- background-color: ${({$noBgColor:e,$purpleColors:t,theme:n})=>e?"transparent":t?n.v2.colors.purple[900]:n.v2.colors.silver[800]};
165
- `,ks=g.div`
164
+ background-color: ${({$noBgColor:e,$purpleColors:t,theme:o})=>e?"transparent":t?o.v2.colors.purple[900]:o.v2.colors.silver[800]};
165
+ `,Ks=f.div`
166
166
  display: flex;
167
167
  align-items: center;
168
168
  justify-content: space-between;
169
169
  gap: 12px;
170
170
  padding: ${({$isOpen:e})=>e?"2px 12px 8px 12px":"2px 12px"};
171
- `,Ts=({title:n,tooltip:o,list:a,noBgColor:i,purpleColors:l})=>{const[s,c]=r(!0);return e(xs,{"data-id":`collapse-${n}`,$noBgColor:i,$purpleColors:l,children:[e(ks,{$isOpen:s,children:[e(ue,{$gap:10,children:[t(se,{size:de.XS,children:n}),o&&t(ze,{text:o,withIcon:!0}),t(je,{label:a.length,status:l?Re.Default:void 0})]}),t(gt,{icon:s?Ei:Ai,size:ft.M,onClick:()=>c(e=>!e)})]}),s?t(q,{children:a.length?u.toArray(a):t(pt,{$padding:"12px 0",children:t(Ie,{})})}):null]})},$s=(e,t,n)=>t||n.signalType?e.filter(e=>e.displayName.toLowerCase().includes(t.toLowerCase())&&(!n.signalType||Le(e.supportedSignals).includes(n.signalType))):e,Is=({option:e,formData:n,testResult:o,isSelected:a,onSelect:i})=>t(Cs,{icon:yt(e.type).icon,title:n?.name||e.displayName,withCarret:!0,purpleColors:!!n,isSelected:a,onClick:()=>i(),children:o&&t(je,{status:o.succeeded?Re.Success:Re.Error,leftIcon:o.succeeded?Ni:Oi})}),Es=({listType:e,destinationOptions:n,unsavedDestinations:o})=>{const{activeForm:a,onChangeActiveForm:i}=Ml();return n?.length?t(Ts,{title:vt[e].TITLE,tooltip:vt[e].DESCRIPTION,list:n.map((n,o)=>t(Is,{option:n,isSelected:a?.listType===e&&"number"!=typeof a?.unsavedIdx&&(null!=n.id&&""!==n.id?a?.option.id===n.id:a?.option.type===n.type),onSelect:()=>i({listType:e,option:n})},`${e}-${n.id??n.type}-${o}`))}):o?.length?t(Ts,{purpleColors:!0,title:vt[e].TITLE,tooltip:vt[e].DESCRIPTION,list:o.map(({option:n,formData:o,testResult:l},r)=>t(Is,{option:n,formData:o,testResult:l,isSelected:a?.unsavedIdx===r&&a?.listType===e,onSelect:()=>i({listType:e,option:n,unsavedIdx:r})},`${e}-${r}`))},e):void 0};var As;!function(e){e.SELF_HOSTED="self hosted",e.MANAGED="managed"}(As||(As={}));const Ns=(e,t)=>{const n=[],o=[],a=[];return e&&e.destinationCategories.categories.forEach(e=>{e.name===As.SELF_HOSTED?o.push(...e.items):e.name===As.MANAGED&&a.push(...e.items)}),t&&t?.potentialDestinations.forEach(t=>{for(const o of e?.destinationCategories?.categories||[]){const e=Ct(o),a=e.items.findIndex(e=>e.type===t.type);if(-1!==a){const o=Te(t.fields,{});Object.keys(o).length&&(e.items[a].fields=e.items[a].fields.map(e=>({...e,initialValue:o[e.name]})),n.push(e.items[a]))}}}),{[ht.DETECTED]:n,[ht.SELF_HOSTED]:o,[ht.MANAGED]:a}},Os=({onClose:e,onBack:n,onNext:i,selectedConnectionIds:s,setSelectedConnectionIds:c,initialInputs:d,withOverlay:u,disableAnimation:p})=>{const{destinationsApi:h}=gl(),[m,g]=r(""),[f,b]=r({categoryType:null,signalType:null}),{items:v}=h.useDestinations(),{data:y,loading:C}=h.useDestinationCategories(),{data:S,loading:w}=h.usePotentialDestinations(),{activeForm:x,genericForm:k,unsavedDestinations:T,setUnsavedDestinations:$}=Ml();o(()=>{d&&$(d)},[d]);const I=C||w,E=a(()=>y?.destinationCategories?.categories??[],[y]),[A,N]=r({[ht.ALL]:[],[ht.UNSAVED]:[],[ht.EXISTS]:[],[ht.DETECTED]:[],[ht.SELF_HOSTED]:[],[ht.MANAGED]:[]});o(()=>{const e=v.map(e=>{let t;for(const n of E){const o=n.items.find(t=>t.type===e.destinationType.type);if(o){t=o;break}}const n=Te(e.fields,{});return{id:e.id,type:e.destinationType.type,displayName:e.name||e.destinationType.displayName,selected:!0,testConnectionSupported:t?.testConnectionSupported??!1,supportedSignals:e.destinationType.supportedSignals,fields:t?t.fields.map(e=>({...e,initialValue:n[e.name]??e.initialValue})):[]}});N(t=>({...t,[ht.EXISTS]:e}))},[v,E]),o(()=>{(y||S)&&N(e=>({...e,...Ns(y,S)}))},[y,S]);const O=l(async()=>{for(const{option:e,formData:t}of T){const n=_e(t);if(e.id){const t=Object.fromEntries(e.fields.map(e=>[e.name,e.initialValue??""])),o=Object.fromEntries(n.fields.map(e=>[e.key,e.value??""]));if(!Object.keys(t).some(e=>t[e]!==o[e])){await h.update(e.id,n);continue}}await h.create(n)}},[T,h]),R=(({isFetching:e,destinationsByCategory:n,searchText:o,filters:i})=>{const{unsavedDestinations:l}=Ml();return{width:"40%",list:a(()=>{const a=[];l.length&&a.push(t(Es,{listType:ht.UNSAVED,unsavedDestinations:l},"unsaved"));for(const e of Object.values(ht)){if(i.categoryType&&i.categoryType!==e)continue;const l=$s(n[e],o,i);l.length&&a.push(t(Es,{listType:e,destinationOptions:l},e))}return e&&a.push(t(pt,{$height:"100%",children:t(bt,{title:"Fetching destinations",withSpinner:!0})},"loading-more")),a},[l,n,o,i,e])}})({isFetching:I,destinationsByCategory:A,searchText:m,filters:f}),D=(()=>{const{activeForm:e}=Ml();return{width:"60%",list:e?[t(qr,{},e.option.type)]:[t(pt,{$height:"100%",children:t(Ie,{icon:Ii,title:"Select destination from the list",subTitle:"Add destination so your data has somewhere to go."})},"no-data")]}})();return t(Al,{isOpen:!0,withOverlay:u,disableAnimation:p,onClose:e,onBack:n?()=>n(T):void 0,onNext:i?()=>i(T):void 0,nextIsSkip:!T.length,onSave:O,disableSave:!x&&!T.length,isFetching:I,isFormDirty:T.length>0||k?.isFormDirty,hideDirtyNote:!0,progress:{title:Je.CREATING_DESTINATION,subTitle:Je.CREATING_DESTINATION_SUBTITLE},header:{icon:Ii,title:Je.ADD_DESTINATIONS,subTitle:Je.ADD_DESTINATION_DRAWER_DESCRIPTION},connectionIds:s&&c?{value:s,setValue:c}:void 0,search:{value:m,onChange:g},filters:t(ws,{destinationsByCategory:A,filters:f,setFilters:b}),leftColumn:R,rightColumn:D})},Rs=({onClose:e,selectedConnectionIds:n,setSelectedConnectionIds:o,withOverlay:l})=>{const{instrumentationRulesApi:s}=gl(),[c,d]=r(""),u=i(null),{selectedOption:p,onSelectOption:h,genericForm:m,validateFormData:g}=zl(),f=a(()=>c?St.filter(e=>e.label.toLowerCase().includes(c.toLowerCase())):St,[c]),b=a(()=>f.map(e=>{const n=p?.type===e.type;return t(Cs,{dataId:`option-${e.type}`,title:e.label,description:e.description,withCarret:!0,isSelected:n,onClick:()=>{u.current?.clearErrors(),h(e)}},e.type)}),[p,f.length,h]),v=a(()=>p?[t(is,{},p.type)]:[t(pt,{$height:"100%",children:t(Ie,{icon:Ri,title:"Instrumentation rule not selected",subTitle:"Please select an instrumentation rule to add"})},"no-data")],[p]);return t(Al,{ref:u,isOpen:!0,withOverlay:l,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=g();if(e)return!1;await s.create(t,p?.type)},disableSave:!p||!m?.isFormDirty,isFormDirty:m?.isFormDirty,hideDirtyNote:!0,progress:{title:Je.CREATING_INSTRUMENTATION_RULE,subTitle:Je.CREATING_INSTRUMENTATION_RULE_SUBTITLE},header:{icon:Ri,title:Je.ADD_INSTRUMENTATION_RULE,subTitle:Je.ADD_INSTRUMENTATION_RULE_DESCRIPTION},connectionIds:n&&o?{value:n,setValue:o}:void 0,search:{value:c,onChange:d},leftColumn:{width:"40%",list:b},rightColumn:{width:"60%",list:v}})},Ds={groupSegmentLabel:"Namespace",itemSegmentLabel:"Source",searchPlaceholder:()=>{},groupColumnHeader:"Namespaces",fetchingGroups:{title:Je.FETCHING_NAMESPACES,subTitle:Je.FETCHING_NAMESPACES_SUBTITLE},noGroups:{title:"No namespaces",subTitle:"No namespaces found in this cluster"},noGroupMatchedFilter:e=>`No namespace matched the filter '${e}'`,itemColumnHeader:"Workloads",selectGroupPrompt:{title:Je.SELECT_NAMESPACE,subTitle:Je.SELECT_NAMESPACE_SUBTITLE},noItemsInGroupSubTitle:"No sources found in this namespace"},Ps={groupSegmentLabel:"Kind",itemSegmentLabel:"Source",searchPlaceholder:e=>"Search by "+(e===wt.Namespace?"kind":"source"),groupColumnHeader:"Kinds",fetchingGroups:{title:"Fetching kinds",subTitle:"Please wait while we fetch the kinds"},noGroups:{title:"No kinds",subTitle:"No kinds found on this host"},noGroupMatchedFilter:e=>`No kind matched the filter '${e}'`,itemColumnHeader:"Sources",selectGroupPrompt:{title:"Select kind from the list",subTitle:"Pick a kind so you can select sources from it."},noItemsInGroupSubTitle:"No sources found in this kind"},Fs=e=>e?Ps:Ds,Ls="No matches",_s="No sources",Ms=e=>`No sources matched the filter '${e}'`,zs=e=>(e?"Unselect":"Select")+" all",Bs="Show only:",Xs="Selected",Vs="Auto",Us="Automatically instrument all workloads currently in the namespace, and all workloads that will be deployed to this namespace in the future",Gs="Enterprise only",Hs=g.div``,js=g.div`
171
+ `,Ys=({title:o,tooltip:n,list:i,noBgColor:a,purpleColors:l})=>{const[r,c]=s(!0);return e(Ws,{"data-id":`collapse-${o}`,$noBgColor:a,$purpleColors:l,children:[e(Ks,{$isOpen:r,children:[e(pe,{$gap:10,children:[t(ce,{size:ue.XS,children:o}),n&&t(Ie,{text:n,withIcon:!0}),t(Ke,{label:i.length,status:l?Pe.Default:void 0})]}),t(bt,{icon:r?Pa:La,size:vt.M,onClick:()=>c(e=>!e)})]}),r?t(Z,{children:i.length?p.toArray(i):t(mt,{$padding:"12px 0",children:t($e,{})})}):null]})},Js=(e,t,o)=>t||o.signalType?e.filter(e=>e.displayName.toLowerCase().includes(t.toLowerCase())&&(!o.signalType||ze(e.supportedSignals).includes(o.signalType))):e,qs=({option:e,formData:o,testResult:n,isSelected:i,onSelect:a})=>t(Hs,{icon:St(e.type).icon,title:o?.name||e.displayName,withCarret:!0,purpleColors:!!o,isSelected:i,onClick:()=>a(),children:n&&t(Ke,{status:n.succeeded?Pe.Success:Pe.Error,leftIcon:n.succeeded?Fa:Ma})}),Zs=({listType:e,destinationOptions:o,unsavedDestinations:n})=>{const{activeForm:i,onChangeActiveForm:a}=Ql();return o?.length?t(Ys,{title:Ct[e].TITLE,tooltip:Ct[e].DESCRIPTION,list:o.map((o,n)=>t(qs,{option:o,isSelected:i?.listType===e&&"number"!=typeof i?.unsavedIdx&&(null!=o.id&&""!==o.id?i?.option.id===o.id:i?.option.type===o.type),onSelect:()=>a({listType:e,option:o})},`${e}-${o.id??o.type}-${n}`))}):n?.length?t(Ys,{purpleColors:!0,title:Ct[e].TITLE,tooltip:Ct[e].DESCRIPTION,list:n.map(({option:o,formData:n,testResult:l},r)=>t(qs,{option:o,formData:n,testResult:l,isSelected:i?.unsavedIdx===r&&i?.listType===e,onSelect:()=>a({listType:e,option:o,unsavedIdx:r})},`${e}-${r}`))},e):void 0};var Qs;!function(e){e.SELF_HOSTED="self hosted",e.MANAGED="managed"}(Qs||(Qs={}));const ec=(e,t)=>{const o=[],n=[],i=[];return e&&e.destinationCategories.categories.forEach(e=>{e.name===Qs.SELF_HOSTED?n.push(...e.items):e.name===Qs.MANAGED&&i.push(...e.items)}),t&&t?.potentialDestinations.forEach(t=>{for(const n of e?.destinationCategories?.categories||[]){const e=xt(n),i=e.items.findIndex(e=>e.type===t.type);if(-1!==i){const n=Ee(t.fields,{});Object.keys(n).length&&(e.items[i].fields=e.items[i].fields.map(e=>({...e,initialValue:n[e.name]})),o.push(e.items[i]))}}}),{[gt.DETECTED]:o,[gt.SELF_HOSTED]:n,[gt.MANAGED]:i}},tc=({onClose:e,onBack:o,onNext:n,selectedConnectionIds:l,setSelectedConnectionIds:c,initialInputs:d,withOverlay:u,disableAnimation:p})=>{const{destinationsApi:h}=Nl(),[m,g]=s(""),[f,b]=s({categoryType:null,signalType:null}),{items:v}=h.useDestinations(),{data:y,loading:C}=h.useDestinationCategories(),{data:S,loading:x}=h.usePotentialDestinations(),{activeForm:w,genericForm:T,unsavedDestinations:k,setUnsavedDestinations:E}=Ql();i(()=>{d&&E(d)},[d]);const I=C||x,O=a(()=>y?.destinationCategories?.categories??[],[y]),[N,$]=s({[gt.ALL]:[],[gt.UNSAVED]:[],[gt.EXISTS]:[],[gt.DETECTED]:[],[gt.SELF_HOSTED]:[],[gt.MANAGED]:[]});i(()=>{const e=v.map(e=>{let t;for(const o of O){const n=o.items.find(t=>t.type===e.destinationType.type);if(n){t=n;break}}const o=Ee(e.fields,{});return{id:e.id,type:e.destinationType.type,displayName:e.name||e.destinationType.displayName,selected:!0,testConnectionSupported:t?.testConnectionSupported??!1,supportedSignals:e.destinationType.supportedSignals,fields:t?t.fields.map(e=>({...e,initialValue:o[e.name]??e.initialValue})):[]}});$(t=>({...t,[gt.EXISTS]:e}))},[v,O]),i(()=>{(y||S)&&$(e=>({...e,...ec(y,S)}))},[y,S]);const A=r(async()=>{for(const{option:e,formData:t}of k){const o=Be(t);if(e.id){const t=Object.fromEntries(e.fields.map(e=>[e.name,e.initialValue??""])),n=Object.fromEntries(o.fields.map(e=>[e.key,e.value??""]));if(!Object.keys(t).some(e=>t[e]!==n[e])){await h.update(e.id,o);continue}}await h.create(o)}},[k,h]),R=(({isFetching:e,destinationsByCategory:o,searchText:n,filters:i})=>{const{unsavedDestinations:l}=Ql();return{width:"40%",list:a(()=>{const a=[];l.length&&a.push(t(Zs,{listType:gt.UNSAVED,unsavedDestinations:l},"unsaved"));for(const e of Object.values(gt)){if(i.categoryType&&i.categoryType!==e)continue;const l=Js(o[e],n,i);l.length&&a.push(t(Zs,{listType:e,destinationOptions:l},e))}return e&&a.push(t(mt,{$height:"100%",children:t(yt,{title:"Fetching destinations",withSpinner:!0})},"loading-more")),a},[l,o,n,i,e])}})({isFetching:I,destinationsByCategory:N,searchText:m,filters:f}),D=(()=>{const{activeForm:e}=Ql();return{width:"60%",list:e?[t(Ss,{},e.option.type)]:[t(mt,{$height:"100%",children:t($e,{icon:_a,title:"Select destination from the list",subTitle:"Add destination so your data has somewhere to go."})},"no-data")]}})();return t(Vl,{isOpen:!0,withOverlay:u,disableAnimation:p,onClose:e,onBack:o?()=>o(k):void 0,onNext:n?()=>n(k):void 0,nextIsSkip:!k.length,onSave:A,disableSave:!w&&!k.length,isFetching:I,isFormDirty:k.length>0||T?.isFormDirty,hideDirtyNote:!0,progress:{title:Ze.CREATING_DESTINATION,subTitle:Ze.CREATING_DESTINATION_SUBTITLE},header:{icon:_a,title:Ze.ADD_DESTINATIONS,subTitle:Ze.ADD_DESTINATION_DRAWER_DESCRIPTION},connectionIds:l&&c?{value:l,setValue:c}:void 0,search:{value:m,onChange:g},filters:t(Gs,{destinationsByCategory:N,filters:f,setFilters:b}),leftColumn:R,rightColumn:D})},oc=({onClose:e,selectedConnectionIds:o,setSelectedConnectionIds:n,withOverlay:i})=>{const{instrumentationRulesApi:r}=Nl(),[c,d]=s(""),u=l(null),{selectedOption:p,onSelectOption:h,genericForm:m,validateFormData:g}=er(),{options:f,loading:b}=r.useRuleTypes(),v=a(()=>f.length?f:wt,[f]),y=a(()=>c?v.filter(e=>e.label.toLowerCase().includes(c.toLowerCase())):v,[v,c]),C=a(()=>b?[t(pt,{$padding:"8px 12px",children:t(ht,{size:4})},"loading")]:y.map(e=>{const o=p?.type===e.type;return t(Hs,{dataId:`option-${e.type}`,title:e.label,description:e.description,withCarret:!0,isSelected:o,onClick:()=>{u.current?.clearErrors(),h(e)}},e.type)}),[b,p?.type,y,h]),S=a(()=>b?[t(pt,{$padding:"8px 12px",children:t(ht,{size:4})},"loading")]:p?[t(Ns,{},p.type)]:[t(mt,{$height:"100%",children:t($e,{icon:za,title:"Instrumentation rule not selected",subTitle:"Please select an instrumentation rule to add"})},"no-data")],[b,p]);return t(Vl,{ref:u,isOpen:!0,withOverlay:i,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=g();if(e)return!1;await r.create(t,p?.type)},disableSave:!p||!m?.isFormDirty,isFormDirty:m?.isFormDirty,hideDirtyNote:!0,progress:{title:Ze.CREATING_INSTRUMENTATION_RULE,subTitle:Ze.CREATING_INSTRUMENTATION_RULE_SUBTITLE},header:{icon:za,title:Ze.ADD_INSTRUMENTATION_RULE,subTitle:Ze.ADD_INSTRUMENTATION_RULE_DESCRIPTION},connectionIds:o&&n?{value:o,setValue:n}:void 0,search:{value:c,onChange:d},leftColumn:{width:"40%",list:C},rightColumn:{width:"60%",list:S}})},nc={groupSegmentLabel:"Namespace",itemSegmentLabel:"Source",searchPlaceholder:()=>{},groupColumnHeader:"Namespaces",fetchingGroups:{title:Ze.FETCHING_NAMESPACES,subTitle:Ze.FETCHING_NAMESPACES_SUBTITLE},noGroups:{title:"No namespaces",subTitle:"No namespaces found in this cluster"},noGroupMatchedFilter:e=>`No namespace matched the filter '${e}'`,itemColumnHeader:"Workloads",selectGroupPrompt:{title:Ze.SELECT_NAMESPACE,subTitle:Ze.SELECT_NAMESPACE_SUBTITLE},noItemsInGroupSubTitle:"No sources found in this namespace"},ic={groupSegmentLabel:"Kind",itemSegmentLabel:"Source",searchPlaceholder:e=>"Search by "+(e===Tt.Namespace?"kind":"source"),groupColumnHeader:"Kinds",fetchingGroups:{title:"Fetching kinds",subTitle:"Please wait while we fetch the kinds"},noGroups:{title:"No kinds",subTitle:"No kinds found on this host"},noGroupMatchedFilter:e=>`No kind matched the filter '${e}'`,itemColumnHeader:"Sources",selectGroupPrompt:{title:"Select kind from the list",subTitle:"Pick a kind so you can select sources from it."},noItemsInGroupSubTitle:"No sources found in this kind"},ac=e=>e?ic:nc,lc="No matches",rc="No sources",sc=e=>`No sources matched the filter '${e}'`,cc=e=>(e?"Unselect":"Select")+" all",dc="Show only:",uc="Selected",pc="Auto",hc="Automatically instrument all workloads currently in the namespace, and all workloads that will be deployed to this namespace in the future",mc="Enterprise only",gc="Static pods can only be instrumented with Odigos Enterprise.",fc=f.div``,bc=f.div`
172
172
  visibility: hidden;
173
173
 
174
174
  transition: visibility 0s;
@@ -176,19 +176,433 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
176
176
  transition-duration: 0s;
177
177
  }
178
178
 
179
- ${Hs}:hover & {
179
+ ${fc}:hover & {
180
180
  visibility: visible;
181
181
  }
182
- `,Ws=({workloadName:e,workloadKind:n,isChecked:o,onToggle:a,disabled:i,disabledReason:l})=>{const r=f(),s=()=>{};return t(Hs,{children:t(Cs,{dataId:`source-${e}`,title:e,disabled:i,onClick:i?s:a,isChecked:o,onCheckboxChange:i?s:a,children:i&&l?t(je,{label:l,status:Re.Default,textSize:de.XXXS}):t(js,{children:t(je,{label:n,status:Re.Info,textSize:de.XXXS,backgroundColor:r.v2.colors.blue[900]})})})})},Ks=g.div``,Ys=g.div`
182
+ `,vc=({workloadName:e,workloadKind:o,isChecked:n,onToggle:i,disabled:a})=>{const l=b(),r=()=>{};return t(fc,{children:t(Hs,{dataId:`source-${e}`,title:e,disabled:a,onClick:a?r:i,isChecked:n,onCheckboxChange:a?r:i,children:a?t(Ie,{text:gc,children:t(Ke,{label:mc,status:Pe.Default,textSize:ue.XXXS})}):t(bc,{children:t(Ke,{label:o,status:Pe.Info,textSize:ue.XXXS,backgroundColor:l.v2.colors.blue[900]})})})})},yc=f.div``,Cc=f.div`
183
183
  visibility: ${({$visible:e})=>e?"visible":"hidden"};
184
184
 
185
185
  transition: visibility 0s;
186
186
  ${({$visible:e})=>!e&&"& * {\n transition-duration: 0s !important;\n }"}
187
187
 
188
- ${Ks}:hover & {
188
+ ${yc}:hover & {
189
189
  visibility: visible;
190
190
  }
191
- `,Js=({clusterId:n,namespaceName:o,checkbox:a,isFutureApps:i,selectedCounts:l,isActive:r,onActive:s,handleSourceChange:c})=>{const{isVm:d}=y(),u=e=>{s(),c({clusterId:n,workloadId:{namespace:o},auto:e.auto,selected:e.all})};return t(Ks,{children:t(Cs,{dataId:`namespace-${o}`,withCarret:!0,title:o,isSelected:r,onClick:s,isPartiallyChecked:a.partial,isChecked:a.all,onCheckboxChange:e=>u({auto:e,all:e}),children:e(ue,{$gap:12,children:[!d&&t(Ys,{$visible:r||i,children:t(ze,{text:Us,children:t(oe,{label:Vs,labelAlign:ae.Left,size:kt.S,value:i,onChange:e=>u({auto:e,all:e||void 0})})})}),e(ue,{$gap:8,children:[t(se,{variant:Tt.Span,size:de.XXXS,color:ce.Secondary,align:"right",children:Xs}),t(je,{label:`${l.sourced}/${l.total}`,status:r?Re.Default:Re.Unknown,minWidth:"42px"})]})]})})})},qs=({withCollapse:e,clusterId:n,clusterName:o,namespaces:i,selectedArea:l,setSelectedArea:r,handleSourceChange:s})=>{const c=a(()=>i.map(({name:e,totalWorkloads:a,selectedCount:i,isAllSourced:c,isSomeSourced:d,isFutureApps:u})=>t(Js,{clusterId:n,namespaceName:e,isFutureApps:u,checkbox:{all:c||u,partial:d},selectedCounts:{sourced:i,total:a},isActive:l.clusterId===n&&l.namespaceName===e,onActive:()=>r({clusterId:n,clusterName:o,namespaceName:e}),handleSourceChange:s},`${n}#${e}`)),[n,o,i,l]);return e?t(Ts,{title:o,list:c,noBgColor:!0}):c},Zs=({onClose:n,onBack:i,onNext:l,selectedConnectionIds:s,setSelectedConnectionIds:c,withOverlay:d,disableAnimation:u})=>{const{isVm:p}=y(),{sourcesApi:h,snapshotsApi:m,namespacesApi:g}=gl(),{data:f,loading:b,refetch:v}=m.useSnapshots(),{items:C,loading:S,refetch:w}=g.useNamespaces(),x=Fs(p),{selectedStreamName:k}=qe(),{progress:T,resetProgress:$}=$t(),{isFetching:I,setIsFetching:E,setSnapshots:A,formData:N,handleSourceChange:O,handleSelectAll:R,formDiff:D,isFormDirty:P}=Kl();o(()=>{v(),w()},[]);const F=a(()=>{if(f)return f;const e=C;return e.length?{clusters:[{clusterId:Et,clusterName:It,namespaces:e.map(e=>({name:e.name,selected:e.markedForInstrumentation&&e.dataStreamNames.includes(k),workloads:e.workloads?.map(e=>({namespace:e.id.namespace,name:e.id.name,kind:e.id.kind,selected:(e.markedForInstrumentation?.markedForInstrumentation??!1)&&(e.dataStreamNames?.includes(k)??!1)}))||[]}))}]}:null},[f,C,k]);o(()=>{E(b||S),F&&A(F)},[F,b,S,E,A]);const[L,_]=r(""),[M,z]=r(wt.Namespace),[B,X]=r({showOnlySelected:!1}),[V,U]=r({clusterId:"",clusterName:"",namespaceName:""}),G=(({isFetching:n,formData:o,handleSourceChange:i,handleSelectAll:l,selectedArea:r,setSelectedArea:s,searchText:c,searchBy:d,filters:u})=>{const{isVm:p}=y(),h=Fs(p),m=a(()=>o.map(e=>{const t=[...e.namespaces].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>jl(e,c,u)).map(e=>({name:e.name,totalWorkloads:e.workloads.length,...Wl(e)}));return{clusterId:e.clusterId,clusterName:e.clusterName,visibleNamespaces:t}}),[o,c,u]),g=a(()=>{let e=!1;for(const{visibleNamespaces:t}of m)for(const{totalWorkloads:n,selectedCount:o}of t)if(e=!0,o!==n)return!1;return e},[m]),{list:f,withFilterCount:b,filteredCount:v,totalCount:C}=a(()=>{const e=m.map(({clusterId:e,clusterName:n,visibleNamespaces:o})=>o.length?t(qs,{withCollapse:m.length>1,clusterId:e,clusterName:n,namespaces:o,selectedArea:r,setSelectedArea:s,handleSourceChange:i},e):null).filter(e=>null!==e),n=m.reduce((e,{visibleNamespaces:t})=>e+t.length,0),a=o.reduce((e,{namespaces:t})=>e+t.length,0);return{list:e,withFilterCount:n!==a,filteredCount:n,totalCount:a}},[m,o,r]);return{width:"60%",header:e(ue,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(ue,{$gap:8,children:[t(se,{size:de.XS,nowrap:!0,children:h.groupColumnHeader}),t(ze,{text:b?Je.FILTERED_COUNT_TOOLTIP:void 0,children:t(je,{label:`${b?`${v} / ${C}`:C}`,status:Re.Unknown})})]}),t(se,{"data-id":"namespaces-select-all",onClick:()=>l({boolean:!g,searchText:c,searchBy:d,filters:u}),disabled:!f.length,size:de.XS,children:zs(g)})]}),list:f.length?f:n?[t(pt,{$height:"100%",children:t(bt,{title:h.fetchingGroups.title,subTitle:h.fetchingGroups.subTitle,withSpinner:!0})},"loading")]:[t(pt,{$height:"100%",children:t(Ie,c?{icon:Pi,title:Ls,subTitle:h.noGroupMatchedFilter(c)}:{icon:Pi,title:h.noGroups.title,subTitle:h.noGroups.subTitle})},"no-data")]}})({isFetching:I,formData:N,handleSourceChange:O,handleSelectAll:R,selectedArea:V,setSelectedArea:U,searchText:M===wt.Namespace?L:"",searchBy:M,filters:B}),H=(({formData:n,handleSourceChange:o,handleSelectAll:i,selectedArea:l,searchText:r,searchBy:s,filters:c})=>{const{tier:d,isVm:u}=y(),p=Fs(u),h=d===xt.Onprem,m=a(()=>l.value.namespaceName?n.find(({clusterId:e})=>e===l.value.clusterId)?.namespaces.find(({name:e})=>e===l.value.namespaceName):void 0,[n,l.value.clusterId,l.value.namespaceName]),g=a(()=>m?[...m.workloads].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Gl(e,r,c)):[],[m,r,c]),f=a(()=>!!g.length&&g.every(({selected:e})=>e),[g]),b=a(()=>{if(!m)return[];const{clusterId:e}=l.value,{name:n}=m;return g.map(({name:a,selected:i,kind:l})=>{const r=!u&&!h&&Hl.has(l);return t(Ws,{workloadName:a,workloadKind:l,isChecked:!r&&(i||!1),onToggle:()=>o({clusterId:e,workloadId:{namespace:n,name:a,kind:l}}),disabled:r,disabledReason:Gs},`${e}#${n}#${a}#${l}`)})},[g,m,l.value.clusterId]),{withFilterCount:v,filteredCount:C,totalCount:S}=a(()=>{const e=m?.workloads.length??0;return{withFilterCount:g.length!==e,filteredCount:g.length,totalCount:e}},[g,m]);return{width:"40%",header:e(ue,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(ue,{$gap:8,children:[t(se,{size:de.XS,nowrap:!0,children:l.value.namespaceName?`${l.value.namespaceName} > ${p.itemColumnHeader}`:p.itemColumnHeader}),t(ze,{text:v?Je.FILTERED_COUNT_TOOLTIP:void 0,children:t(je,{label:`${v?`${C} / ${S}`:S}`,status:Re.Unknown})})]}),t(se,{"data-id":"workloads-select-all",onClick:()=>i({clusterId:l.value.clusterId,namespaceName:l.value.namespaceName,boolean:!f,searchText:r,searchBy:s,filters:c}),disabled:!b.length,size:de.XS,children:zs(f)})]}),list:b.length?b:[t(pt,{$height:"100%",children:t(Ie,m?r?{icon:Di,title:Ls,subTitle:Ms(r)}:{icon:Di,title:_s,subTitle:p.noItemsInGroupSubTitle}:{icon:Di,title:p.selectGroupPrompt.title,subTitle:p.selectGroupPrompt.subTitle})},"no-data")]}})({formData:N,handleSourceChange:O,handleSelectAll:R,selectedArea:{value:V},searchText:M===wt.Source?L:"",searchBy:M,filters:B});return t(Al,{isOpen:!0,withOverlay:d,disableAnimation:u,onClose:n?()=>{$(At.BulkInstrumenting),n()}:void 0,onBack:i?()=>i(D):void 0,onNext:l?()=>l(D):void 0,nextIsSkip:!P,onSave:()=>h.persistV2(D),header:{icon:Di,title:Je.ADD_SOURCE,subTitle:Je.ADD_SOURCES_DESCRIPTION},connectionIds:s&&c?{value:s,setValue:c}:void 0,search:{value:L,onChange:e=>{_(e),M===wt.Namespace&&U({clusterId:"",clusterName:"",namespaceName:""})},placeholder:x.searchPlaceholder(M),segment:{options:[{label:x.groupSegmentLabel,value:wt.Namespace},{label:x.itemSegmentLabel,value:wt.Source}],selected:M,setSelected:z}},filters:e(ue,{$gap:8,children:[t(se,{size:de.XXXS,color:ce.Secondary,nowrap:!0,children:Bs}),t(oe,{name:"filter-selected",size:kt.S,label:Xs,value:B.showOnlySelected,onChange:e=>X(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:P,isFetching:I,progress:{title:Je.CREATING_SOURCES,subTitle:Je.CREATING_SOURCES_SUBTITLE,percentage:T[At.BulkInstrumenting]?.percentage||0},leftColumn:G,rightColumn:H})},Qs=(e,t)=>{const n=[{id:"type",title:Je.TYPE,label:t.label},{id:"status",title:Je.STATUS,badge:{status:e.disabled?Re.Unknown:Re.Success,label:e.disabled?Je.DISABLED:Je.ENABLED}}],o=e.signals?.map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return o&&n.push({id:"signals",title:Je.SIGNALS_FOR_PROCESSING,label:o}),e.name&&n.push({id:"name",title:Je.NAME,label:e.name}),e.notes&&n.push({id:"notes",title:Je.NOTES,label:e.notes}),n},ec=({onClose:i,actionId:s})=>{const c=f(),{actionsApi:d}=gl(),{items:u,refetch:p}=d.useActions(),{options:h}=d.useActionTypes(),{selectedOption:m,loadAction:g,validateFormData:b,genericForm:v}=_l();o(()=>{p()},[]);const[y,C]=r(!1),[S,w]=r(!1),[x,k]=r(null),T=y&&!!v?.isFormDirty,$=a(()=>u?.find(e=>Nt(e)===s),[s,u]),I=a(()=>h.find(({type:e})=>e===$?.type)??Ot.find(({type:e})=>e===$?.type)??null,[h,$?.type]);o(()=>{$&&g($,I)},[$,I]);const E=l(()=>{$&&C(!0)},[$]),A=l(()=>{$&&(g($,I),C(!1))},[$,I,g]),N=l(()=>{T?k("close"):i()},[T,i]),O=l(()=>{T?k("cancel"):A()},[T,A]),R=l(()=>{const e=x;k(null),"close"===e?(A(),i()):A()},[x,A,i]),D=l(async()=>{if($){const{errorMessage:e,preparedFormData:t}=b();e||(await d.update($.id,t),C(!1))}},[$,b,d]),P=l(()=>{$&&w(!0)},[$]),F=l(async()=>{$&&(await d.remove($.id,$.type),i())},[$,d,i]);if(!$||!I)return null;const L=(e=>{const t=[],{type:n,fields:o}=e,a=e=>({status:e?Re.Success:Re.Unknown,label:e?"True":"False",invertColors:!0});if(n===$e.K8sAttributes&&(t.push({id:"collectContainerAttributes",title:"Collect Container Attributes",badge:a(o.collectContainerAttributes)}),t.push({id:"collectReplicaSetAttributes",title:"Collect ReplicaSet Attributes",badge:a(o.collectReplicaSetAttributes)}),t.push({id:"collectWorkloadId",title:"Collect Workload ID",badge:a(o.collectWorkloadId)}),t.push({id:"collectClusterId",title:"Collect Cluster ID",badge:a(o.collectClusterId)}),o.labelsAttributes?.forEach(({labelKey:e,attributeKey:n,from:a,fromSources:i},l)=>{const r=i?.length?i.join(", "):a||ne.Pod,s=(o.labelsAttributes?.length??0)>1?`Label #${l+1} `:"Label ";t.push({id:`label-${l}-key`,title:`${s}Key`,label:e}),t.push({id:`label-${l}-attr`,title:`${s}Attribute Key`,label:n}),t.push({id:`label-${l}-from`,title:`${s}From`,label:r})}),o.annotationsAttributes?.forEach(({annotationKey:e,attributeKey:n,from:a,fromSources:i},l)=>{const r=i?.length?i.join(", "):a||ne.Pod,s=(o.annotationsAttributes?.length??0)>1?`Annotation #${l+1} `:"Annotation ";t.push({id:`annotation-${l}-key`,title:`${s}Key`,label:e}),t.push({id:`annotation-${l}-attr`,title:`${s}Attribute Key`,label:n}),t.push({id:`annotation-${l}-from`,title:`${s}From`,label:r})})),n===$e.AddClusterInfo&&(t.push({id:"overwriteExistingValues",title:"Overwrite Existing Values",badge:a(o.overwriteExistingValues)}),o.clusterAttributes?.forEach(({attributeName:e,attributeStringValue:n},o)=>{t.push({id:`cluster-attr-${o}`,title:e,label:n})})),n===$e.DeleteAttributes&&o.attributeNamesToDelete?.forEach((e,n)=>{t.push({id:`del-attr-${n}`,title:"Attribute"+((o.attributeNamesToDelete?.length??0)>1?` #${n+1}`:""),label:e})}),n===$e.RenameAttributes&&Object.entries(o.renames||{}).forEach(([e,n],o)=>{t.push({id:`rename-${o}`,title:e,label:n})}),n===$e.PiiMasking&&o.piiCategories?.forEach((e,n)=>{t.push({id:`pii-${n}`,title:"Category"+((o.piiCategories?.length??0)>1?` #${n+1}`:""),label:e})}),n===$e.ExtractAttribute){const e=o.extractAttribute?.extractions??[];e.forEach(({targetAttributeName:n,lookupKey:o,dataFormat:a,regex:i},l)=>{const r=e.length>1?`Extraction #${l+1} `:"Extraction ";t.push({id:`extract-${l}-target`,title:`${r}New Attribute Name`,label:n||"-"}),o&&t.push({id:`extract-${l}-lookupKey`,title:`${r}Lookup Key`,label:o}),a&&t.push({id:`extract-${l}-format`,title:`${r}Data Format`,label:a}),i&&t.push({id:`extract-${l}-regex`,title:`${r}Regex`,label:i})})}return n===$e.URLTemplatization&&o.urlTemplatizationRulesGroups?.forEach((e,n)=>{const a=(o.urlTemplatizationRulesGroups?.length??0)>1?`Group #${n+1} `:"Group ";e.filterK8sNamespace&&t.push({id:`group-${n}-ns`,title:`${a}Namespace`,label:e.filterK8sNamespace}),e.workloadFilters?.forEach((o,i)=>{const l=[o.kind,o.name].filter(Boolean).join("/");l&&t.push({id:`group-${n}-wf-${i}`,title:`${a}Workload${(e.workloadFilters?.length??0)>1?` #${i+1}`:""}`,label:l})});const i=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");i&&t.push({id:`group-${n}-templates`,title:`${a}Templates`,label:i}),e.notes&&t.push({id:`group-${n}-notes`,title:`${a}Notes`,label:e.notes})}),t})($);return e(n,{children:[t(le,{isOpen:!0,header:{icon:Ft($.type),title:I.label,onClose:N,actions:[{id:"edit-action-btn-edit",label:Rt.EDIT,icon:wi,active:y,onClick:E},{id:"edit-action-btn-delete",label:Rt.DELETE,icon:gi,color:c.v2.colors.red[500],active:S,onClick:P}]},footer:{actions:y?[{"data-id":"edit-action-btn-cancel",label:Rt.CANCEL,variant:me.Secondary,onClick:O},{"data-id":"edit-action-btn-save",label:Rt.SAVE,variant:me.Primary,onClick:D}]:[]},children:t(dt,{$padding:"4px 12px 12px",children:y&&m?t(Kr,{}):t(q,{$gap:16,children:e(Dt,{bgTint:"1000",children:[e(Dt,{bgTint:"900",children:[t(Pt,{conditions:$.conditions||[]}),t(Dt,{bgTint:"800",cellsPerRow:2,items:Qs($,I)})]}),!!L?.length&&t(Dt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Dt,{bgTint:"800",cellsPerRow:2,items:L})})]})})})}),t(Nl,{target:"action",isOpen:S,onClose:()=>w(!1),onApprove:F}),t(Ol,{isOpen:null!==x,onClose:()=>k(null),onApprove:R})]})},tc=({onClose:n,connections:l,selectedConnectionIds:s,setSelectedConnectionIds:c})=>{const{configApi:d}=gl(),[u,p]=r(""),[h,m]=r({showOnlySelected:!1}),g=a(()=>l.filter(e=>{const t=!u||e.name.toLowerCase().includes(u.toLowerCase()),n=!h.showOnlySelected||h.showOnlySelected&&s.includes(e.id);return t&&n}),[l.length,s.length,u,h]),f=e=>{c(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},b=1===s.length?s[0]:void 0,{data:v,loading:y}=d.useEffectiveConfig(b?{id:b}:void 0,{skip:!b}),C=a(()=>{if(b&&v)return{rollout:{automaticRolloutDisabled:v.rollout?.automaticRolloutDisabled??!1}}},[b,v]),{formData:S,handleFormChange:w,areFormValuesEqual:x,resetFormData:k}=Lt(C||{rollout:{automaticRolloutDisabled:!1}}),T=i(k);T.current=k,o(()=>{C&&T.current(C)},[C]);const $=a(()=>s.length>1||void 0!==C&&!x(C,S),[s.length,C,S]);return t(Al,{isOpen:!0,onClose:n,onSave:async()=>await(d.applyConfigurations?.(S,s))??void 0,header:{icon:Fi,title:"Cluster Configuration"},connectionIds:{value:s,setValue:c},search:{placeholder:"Search by cluster name",value:u,onChange:p},filters:e(ue,{$gap:8,children:[t(se,{size:de.XXXS,color:ce.Secondary,nowrap:!0,children:"Show only:"}),t(oe,{size:kt.S,label:"Selected",value:h.showOnlySelected,onChange:e=>m(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:$,isFetching:y,leftColumn:{width:"35%",header:e(ue,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(ue,{$gap:8,children:[t(se,{size:de.XS,children:"Clusters"}),t(je,{label:g.length,status:Re.Unknown})]}),e(ue,{$gap:8,children:[t(se,{size:de.XXXS,color:ce.Secondary,align:"right",children:"Selected clusters"}),t(je,{label:`${s.length}/${g.length}`,status:Re.Unknown})]})]}),list:g.map(e=>t(Cs,{title:e.name,isChecked:s.includes(e.id),onClick:()=>f(e.id),onCheckboxChange:()=>f(e.id)},e.id))},rightColumn:{width:"65%",header:t(se,{size:de.XS,children:"Configurations"}),list:[t(oe,{label:"Automatic rollout disabled",tooltip:"Odigos automatically triggers a one-time rollout for workloads when instrumenting or uninstrumenting, ensuring that changes are applied without requiring manual intervention. When automatic rollout is disabled, Odigos will not restart workloads, and users will need to manually trigger rollouts after adding or removing sources.",value:S.rollout?.automaticRolloutDisabled||!1,onChange:e=>w("rollout.automaticRolloutDisabled",e)},"automatic-rollout-disabled")]}})},nc=e=>{const t=[{id:"type",title:Je.TYPE,label:e.destinationType.displayName},{id:"status",title:Je.STATUS,badge:{status:e.disabled?Re.Unknown:Re.Success,label:e.disabled?Je.DISABLED:Je.ENABLED}}],n=Fe(e.exportedSignals).map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return n&&t.push({id:"monitors",title:Je.MONITORS,label:n}),e.name&&t.push({id:"name",title:Je.NAME,label:e.name}),t},oc=({onClose:s,destinationId:c})=>{const d=f(),{isVm:u}=y(),{destinationsApi:p}=gl(),{selectedStreamName:h}=qe(),{items:m,refetch:g}=p.useDestinations(),{data:b,loading:v}=p.useDestinationCategories(),{activeForm:C,loadDestination:S,validateFormData:w,genericForm:x}=Ml();o(()=>{g()},[]);const k=i(null),[T,$]=r(!1),[I,E]=r(!1),[A,N]=r(null),O=T&&!!x?.isFormDirty,R=a(()=>Mt(m,h),[m,h]),D=a(()=>R?.find(e=>Nt(e)===c),[c,R]),P=b?.destinationCategories?.categories??null;o(()=>{D&&P&&S(D,P)},[D,P]);const F=a(()=>D&&P?zt(P,D):[],[D,P]),L=l(()=>{D&&$(!0)},[D]),_=l(()=>{D&&P&&(S(D,P),$(!1))},[D,P,S]),M=l(()=>{O?N("close"):s()},[O,s]),z=l(()=>{O?N("cancel"):_()},[O,_]),B=l(()=>{const e=A;N(null),"close"===e?(_(),s()):_()},[A,_,s]),X=l(async()=>{if(D){const{errorMessage:e,preparedFormData:t}=w();e||(await p.update(D.id,_e(t)),$(!1))}},[D,w,p]),V=l(()=>{D&&E(!0)},[D]),U=l(async()=>{D&&(await p.remove(D.id),s())},[D,p,s]);if(!D)return null;const{icon:G,iconSrc:H}=yt(D.destinationType.type),j=((e,t)=>{const n=[],o=_t(e,t),a=o.map(e=>({name:e.key,value:e.value})),i=Fe(e.exportedSignals);let l=[];const r=()=>{l.length&&(n.push({kind:"cells",id:`cells-${n.length}`,items:l}),l=[])};return o.forEach(({key:e,name:o,value:s})=>{const c=t.find(t=>t.name===e),{secret:d,componentType:u,componentProperties:p,hideFromReadData:h,customReadDataLabels:m}=c||{};if(h?.length&&xe(h,i,a))return;const{type:g}=Te(p,{type:""}),f=d||"password"===g;if(m?.length)m.forEach(({condition:t,...n},o)=>{t==s&&l.push({id:`${e}-custom-${o}`,title:n.title,label:n.value})});else if(s)if(f)l.push({id:e,title:o,label:new Array(10).fill("•").join("")});else{if(u===ke.MultiInput){const t=Te(s,null);if(Array.isArray(t)&&t.length)return r(),void n.push({kind:"list",id:e,title:o,items:t.map((t,n)=>({id:`${e}-${n}`,label:String(t)}))})}if(u===ke.KeyValuePair){const t=Te(s,null);if(Array.isArray(t)&&t.length)return r(),void n.push({kind:"pairs",id:e,title:o,items:t.map((t,n)=>{const o=t&&"object"==typeof t?t:{};return{id:`${e}-${n}`,title:null!=o.key?String(o.key):"",label:null!=o.value?String(o.value):""}})})}l.push({id:e,title:o,label:s})}else l.push({id:e,title:o,label:"-"})}),r(),n})(D,F);return e(n,{children:[t(le,{isOpen:!0,header:{icon:G,iconSrc:H,title:D.name||D.destinationType.displayName,onClose:M,actions:[{id:"edit-destination-btn-edit",label:Rt.EDIT,icon:wi,active:T,onClick:L},{id:"edit-destination-btn-delete",label:Rt.DELETE,icon:gi,color:d.v2.colors.red[500],active:I,onClick:V}]},footer:{actions:T?[{"data-id":"edit-destination-btn-cancel",label:Rt.CANCEL,variant:me.Secondary,onClick:z},...C?.option.testConnectionSupported&&!u?[{"data-id":"edit-destination-btn-test-connection",label:Rt.TEST_CONNECTION,variant:me.Secondary,onClick:()=>k.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:Rt.SAVE,variant:me.Primary,onClick:X}]:[]},children:t(dt,{$padding:"4px 12px 12px",children:v?t(pt,{$height:"50vh",children:t(bt,{withSpinner:!0})}):T&&C?t(qr,{ref:k,isEdit:!0}):t(q,{$gap:16,children:e(Dt,{bgTint:"1000",children:[e(Dt,{bgTint:"900",children:[!u&&t(Pt,{conditions:D.conditions||[]}),t(Dt,{bgTint:"800",cellsPerRow:2,items:nc(D)})]}),!!j.length&&t(Dt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:j.map(e=>"cells"===e.kind?t(Dt,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t(Dt,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})})}),t(Nl,{target:"destination",isOpen:I,onClose:()=>E(!1),onApprove:U}),t(Ol,{isOpen:null!==A,onClose:()=>N(null),onApprove:B})]})},ac=(e,t)=>{const n=[{id:"type",title:Je.TYPE,label:t.label},{id:"status",title:Je.STATUS,badge:{status:e.disabled?Re.Unknown:Re.Success,label:e.disabled?Je.DISABLED:Je.ENABLED}}];return e.ruleName&&n.push({id:"name",title:Je.NAME,label:e.ruleName}),e.profileName&&n.push({id:"profile",title:Je.MANAGED_BY_PROFILE,label:e.profileName}),e.notes&&n.push({id:"notes",title:Je.NOTES,label:e.notes}),n},ic=({onClose:i,ruleId:s})=>{const c=f(),{addNotification:d}=Xt(),{instrumentationRulesApi:u}=gl(),{items:p,refetch:h}=u.useRules(),{selectedOption:m,loadRule:g,validateFormData:b,genericForm:v}=zl();o(()=>{h()},[]);const[y,C]=r(!1),[S,w]=r(!1),[x,k]=r(null),T=y&&!!v?.isFormDirty,$=a(()=>p?.find(e=>Nt(e)===s),[s,p]),I=a(()=>St.find(({type:e})=>e===$?.type)??null,[$?.type]);o(()=>{$&&g($)},[$]);const E=l(()=>{if($){if(!$.mutable)return void d({type:Re.Warning,title:Vt.FORBIDDEN,message:Vt.CANNOT_EDIT_RULE,crdType:wt.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});C(!0)}},[$,d]),A=l(()=>{$&&(g($),C(!1))},[$,g]),N=l(()=>{T?k("close"):i()},[T,i]),O=l(()=>{T?k("cancel"):A()},[T,A]),R=l(()=>{const e=x;k(null),"close"===e?(A(),i()):A()},[x,A,i]),D=l(async()=>{if($){const{errorMessage:e,preparedFormData:t}=b();e||(await u.update($.ruleId,t,$.type),C(!1))}},[$,b,u]),P=l(()=>{if($){if(!$.mutable)return void d({type:Re.Warning,title:Vt.FORBIDDEN,message:Vt.CANNOT_DELETE_RULE,crdType:wt.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});w(!0)}},[$,d]),F=l(async()=>{$&&(await u.remove($.ruleId,$.type),i())},[$,u,i]);if(!$||!I)return null;const L=((e,n)=>{const o=[];return e.payloadCollection&&Object.entries(e.payloadCollection).forEach(([e,n])=>{n&&o.push(t(se,{size:de.XS,children:`• ${Bt(e).toLowerCase()}`},`payload-${e}`))}),e.codeAttributes&&Object.entries(e.codeAttributes).forEach(([e,n])=>{n&&o.push(t(se,{size:de.XS,children:`• ${Bt(e).toLowerCase()}`},`code-${e}`))}),e.headersCollection?.[Be.HeaderKeys]?.length&&e.headersCollection[Be.HeaderKeys].forEach((e,n)=>{e&&o.push(t(se,{size:de.XS,children:e},`header-${n}-${e}`))}),e.customInstrumentations&&(e.customInstrumentations[Ge.Java]?.forEach((e,a)=>{const i=new Ue(e.className,e.methodName);if(i.Verify()){0===a&&o.push(t(se,{size:de.XS,children:"Java Custom Probes:"},"java-custom-probes"));const e=i.toString();o.push(t(se,{size:de.XXS,color:n.v2.colors.grey[200],children:`• ${e}`},`java-probe-${a}-${e}`))}}),e.customInstrumentations[Ge.Golang]?.forEach((e,a)=>{const i=new Ve(e.packageName,e.functionName,e.receiverName,e.receiverMethodName);if(i.Verify()){0===a&&o.push(t(se,{size:de.XS,children:"Golang Custom Probes:"},"golang-custom-probes"));const e=i.toString();o.push(t(se,{size:de.XXS,color:n.v2.colors.grey[200],children:`• ${e}`},`golang-probe-${a}-${e}`))}})),o})($,c);return e(n,{children:[t(le,{isOpen:!0,header:{icon:Gt($.type),title:I.label,onClose:N,actions:[{id:"edit-rule-btn-edit",label:Rt.EDIT,icon:wi,active:y,onClick:E},{id:"edit-rule-btn-delete",label:Rt.DELETE,icon:gi,color:c.v2.colors.red[500],active:S,onClick:P}]},footer:{actions:y?[{"data-id":"edit-rule-btn-cancel",label:Rt.CANCEL,variant:me.Secondary,onClick:O},{"data-id":"edit-rule-btn-save",label:Rt.SAVE,variant:me.Primary,onClick:D}]:[]},children:t(dt,{$padding:"4px 12px 12px",children:y&&m?t(is,{}):t(q,{$gap:16,children:e(Dt,{bgTint:"1000",children:[e(Dt,{bgTint:"900",children:[t(Pt,{conditions:$.conditions||[]}),t(Dt,{bgTint:"800",cellsPerRow:2,items:ac($,I)})]}),t(yl,{readOnly:!0,scopes:$.sourceScopes??null}),!!L.length&&t(Dt,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Dt,{bgTint:"800",children:L})}),!!I.supportedLanguages.length&&t(Dt,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Dt,{bgTint:"800",children:t(ue,{$gap:12,$wrap:"wrap",children:I.supportedLanguages.map(e=>t(Ut,{label:We[e],leftIcon:Ke(e),flex:"0.5"},e))})})})]})})})}),t(Nl,{target:"instrumentation rule",isOpen:S,onClose:()=>w(!1),onApprove:F}),t(Ol,{isOpen:null!==x,onClose:()=>k(null),onApprove:R})]})};var lc;!function(e){e.Overview="overview",e.Pods="pods",e.PeerSources="peer-sources",e.Profiling="profiling",e.Sampling="sampling",e.Debug="debug"}(lc||(lc={}));const rc=({collapseIsDefaultOpen:e,isJumpToTarget:n,onClickRestartPod:o,namespace:i,podName:l,nodeName:r,startTime:s,agentInjectedStatus:c,odigosHealthStatus:d,k8sHealthStatus:u,children:p})=>{const{formatDurationAgo:h}=Ht(),m=jt(!!n),g=a(()=>({title:l,icon:Li,withCopy:!0}),[l]),f=a(()=>{const e=[],t=Wt(c);t&&e.push(t);const n=Wt(d,_i,"health");n&&e.push(n);const o=Wt(u,Mi,"health");return o&&e.push(o),e},[c,d,u]),b=a(()=>o?[{id:`restart-pod-${l}`,icon:zi,label:Rt.RESTART_POD,onClick:()=>o(i,l)}]:void 0,[o,i,l]),v=a(()=>[{id:"nodeName",title:Je.NODE,label:r,withCopy:!0},{id:"age",title:Je.AGE,label:s?h(s,{style:"short"}):Je.NOT_RUNNING,labelTooltip:s}],[r,s,h]);return t("div",{ref:m,children:t(Dt,{bgTint:"900",richTitle:g,badges:f,dropDataActions:b,items:v,withCollapse:!0,collapseIsDefaultOpen:e,children:p})})},sc=g.div`
191
+ `,Sc=({clusterId:o,namespaceName:n,checkbox:i,isFutureApps:a,selectedCounts:l,isActive:r,onActive:s,handleSourceChange:c})=>{const{isVm:d}=C(),u=e=>{s(),c({clusterId:o,workloadId:{namespace:n},auto:e.auto,selected:e.all})};return t(yc,{children:t(Hs,{dataId:`namespace-${n}`,withCarret:!0,title:n,isSelected:r,onClick:s,isPartiallyChecked:i.partial,isChecked:i.all,onCheckboxChange:e=>u({auto:e,all:e}),children:e(pe,{$gap:12,children:[!d&&t(Cc,{$visible:r||a,children:t(Ie,{text:hc,children:t(ie,{label:pc,labelAlign:ae.Left,size:Et.S,value:a,onChange:e=>u({auto:e,all:e||void 0})})})}),e(pe,{$gap:8,children:[t(ce,{variant:It.Span,size:ue.XXXS,color:de.Secondary,align:"right",children:uc}),t(Ke,{label:`${l.sourced}/${l.total}`,status:r?Pe.Default:Pe.Unknown,minWidth:"42px"})]})]})})})},xc=({withCollapse:e,clusterId:o,clusterName:n,namespaces:i,selectedArea:l,setSelectedArea:r,handleSourceChange:s})=>{const c=a(()=>i.map(({name:e,totalWorkloads:i,selectedCount:a,isAllSourced:c,isSomeSourced:d,isFutureApps:u})=>t(Sc,{clusterId:o,namespaceName:e,isFutureApps:u,checkbox:{all:c||u,partial:d},selectedCounts:{sourced:a,total:i},isActive:l.clusterId===o&&l.namespaceName===e,onActive:()=>r({clusterId:o,clusterName:n,namespaceName:e}),handleSourceChange:s},`${o}#${e}`)),[o,n,i,l]);return e?t(Ys,{title:n,list:c,noBgColor:!0}):c},wc=({onClose:o,onBack:n,onNext:l,selectedConnectionIds:r,setSelectedConnectionIds:c,withOverlay:d,disableAnimation:u})=>{const{isVm:p}=C(),{sourcesApi:h,snapshotsApi:m,namespacesApi:g}=Nl(),{data:f,loading:b,refetch:v}=m.useSnapshots(),{items:y,loading:S,refetch:x}=g.useNamespaces(),w=ac(p),{selectedStreamName:T}=Qe(),{progress:k,resetProgress:E}=Ot(),{isFetching:I,setIsFetching:O,setSnapshots:N,formData:$,handleSourceChange:A,handleSelectAll:R,formDiff:D,isFormDirty:_}=cr();i(()=>{v(),x()},[]);const P=a(()=>{if(f)return f;const e=y;return e.length?{clusters:[{clusterId:$t,clusterName:Nt,namespaces:e.map(e=>({name:e.name,selected:e.markedForInstrumentation&&e.dataStreamNames.includes(T),workloads:e.workloads?.map(e=>({namespace:e.id.namespace,name:e.id.name,kind:e.id.kind,...e.id.region?{region:e.id.region}:{},selected:(e.markedForInstrumentation?.markedForInstrumentation??!1)&&(e.dataStreamNames?.includes(T)??!1)}))||[]}))}]}:null},[f,y,T]);i(()=>{O(b||S),P&&N(P)},[P,b,S,O,N]);const[L,F]=s(""),[M,z]=s(Tt.Namespace),[B,X]=s({showOnlySelected:!1}),[U,V]=s({clusterId:"",clusterName:"",namespaceName:""}),H=(({isFetching:o,formData:n,handleSourceChange:i,handleSelectAll:l,selectedArea:r,setSelectedArea:s,searchText:c,searchBy:d,filters:u})=>{const{isVm:p}=C(),h=ac(p),m=a(()=>n.map(e=>{const t=[...e.namespaces].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>rr(e,c,u)).map(e=>({name:e.name,totalWorkloads:e.workloads.length,...sr(e)}));return{clusterId:e.clusterId,clusterName:e.clusterName,visibleNamespaces:t}}),[n,c,u]),g=a(()=>{let e=!1;for(const{visibleNamespaces:t}of m)for(const{totalWorkloads:o,selectedCount:n}of t)if(e=!0,n!==o)return!1;return e},[m]),{list:f,withFilterCount:b,filteredCount:v,totalCount:y}=a(()=>{const e=m.map(({clusterId:e,clusterName:o,visibleNamespaces:n})=>n.length?t(xc,{withCollapse:m.length>1,clusterId:e,clusterName:o,namespaces:n,selectedArea:r,setSelectedArea:s,handleSourceChange:i},e):null).filter(e=>null!==e),o=m.reduce((e,{visibleNamespaces:t})=>e+t.length,0),a=n.reduce((e,{namespaces:t})=>e+t.length,0);return{list:e,withFilterCount:o!==a,filteredCount:o,totalCount:a}},[m,n,r]);return{width:"60%",header:e(pe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(pe,{$gap:8,children:[t(ce,{size:ue.XS,nowrap:!0,children:h.groupColumnHeader}),t(Ie,{text:b?Ze.FILTERED_COUNT_TOOLTIP:void 0,children:t(Ke,{label:`${b?`${v} / ${y}`:y}`,status:Pe.Unknown})})]}),t(ce,{"data-id":"namespaces-select-all",onClick:()=>l({boolean:!g,searchText:c,searchBy:d,filters:u}),disabled:!f.length,size:ue.XS,children:cc(g)})]}),list:f.length?f:o?[t(mt,{$height:"100%",children:t(yt,{title:h.fetchingGroups.title,subTitle:h.fetchingGroups.subTitle,withSpinner:!0})},"loading")]:[t(mt,{$height:"100%",children:t($e,c?{icon:Xa,title:lc,subTitle:h.noGroupMatchedFilter(c)}:{icon:Xa,title:h.noGroups.title,subTitle:h.noGroups.subTitle})},"no-data")]}})({isFetching:I,formData:$,handleSourceChange:A,handleSelectAll:R,selectedArea:U,setSelectedArea:V,searchText:M===Tt.Namespace?L:"",searchBy:M,filters:B}),j=(({formData:o,handleSourceChange:n,handleSelectAll:i,selectedArea:l,searchText:r,searchBy:s,filters:c})=>{const{tier:d,isVm:u}=C(),p=ac(u),h=d===kt.Onprem,m=a(()=>l.value.namespaceName?o.find(({clusterId:e})=>e===l.value.clusterId)?.namespaces.find(({name:e})=>e===l.value.namespaceName):void 0,[o,l.value.clusterId,l.value.namespaceName]),g=a(()=>m?[...m.workloads].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>ar(e,r,c)):[],[m,r,c]),f=a(()=>!!g.length&&g.every(({selected:e})=>e),[g]),b=a(()=>{if(!m)return[];const{clusterId:e}=l.value,{name:o}=m;return g.map(({name:i,selected:a,kind:l,region:r})=>{const s=!u&&!h&&lr.has(l);return t(vc,{workloadName:i,workloadKind:l,isChecked:!s&&(a||!1),onToggle:()=>n({clusterId:e,workloadId:{namespace:o,name:i,kind:l,...r?{region:r}:{}}}),disabled:s},`${e}#${o}#${i}#${l}#${r??""}`)})},[g,m,l.value.clusterId]),{withFilterCount:v,filteredCount:y,totalCount:S}=a(()=>{const e=m?.workloads.length??0;return{withFilterCount:g.length!==e,filteredCount:g.length,totalCount:e}},[g,m]);return{width:"40%",header:e(pe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(pe,{$gap:8,children:[t(ce,{size:ue.XS,nowrap:!0,children:l.value.namespaceName?`${l.value.namespaceName} > ${p.itemColumnHeader}`:p.itemColumnHeader}),t(Ie,{text:v?Ze.FILTERED_COUNT_TOOLTIP:void 0,children:t(Ke,{label:`${v?`${y} / ${S}`:S}`,status:Pe.Unknown})})]}),t(ce,{"data-id":"workloads-select-all",onClick:()=>i({clusterId:l.value.clusterId,namespaceName:l.value.namespaceName,boolean:!f,searchText:r,searchBy:s,filters:c}),disabled:!b.length,size:ue.XS,children:cc(f)})]}),list:b.length?b:[t(mt,{$height:"100%",children:t($e,m?r?{icon:Ba,title:lc,subTitle:sc(r)}:{icon:Ba,title:rc,subTitle:p.noItemsInGroupSubTitle}:{icon:Ba,title:p.selectGroupPrompt.title,subTitle:p.selectGroupPrompt.subTitle})},"no-data")]}})({formData:$,handleSourceChange:A,handleSelectAll:R,selectedArea:{value:U},searchText:M===Tt.Source?L:"",searchBy:M,filters:B});return t(Vl,{isOpen:!0,withOverlay:d,disableAnimation:u,onClose:o?()=>{E(At.BulkInstrumenting),o()}:void 0,onBack:n?()=>n(D):void 0,onNext:l?()=>l(D):void 0,nextIsSkip:!_,onSave:()=>h.persistV2(D),header:{icon:Ba,title:Ze.ADD_SOURCE,subTitle:Ze.ADD_SOURCES_DESCRIPTION},connectionIds:r&&c?{value:r,setValue:c}:void 0,search:{value:L,onChange:e=>{F(e),M===Tt.Namespace&&V({clusterId:"",clusterName:"",namespaceName:""})},placeholder:w.searchPlaceholder(M),segment:{options:[{label:w.groupSegmentLabel,value:Tt.Namespace},{label:w.itemSegmentLabel,value:Tt.Source}],selected:M,setSelected:z}},filters:e(pe,{$gap:8,children:[t(ce,{size:ue.XXXS,color:de.Secondary,nowrap:!0,children:dc}),t(ie,{name:"filter-selected",size:Et.S,label:uc,value:B.showOnlySelected,onChange:e=>X(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:_,isFetching:I,progress:{title:Ze.CREATING_SOURCES,subTitle:Ze.CREATING_SOURCES_SUBTITLE,percentage:k[At.BulkInstrumenting]?.percentage||0},leftColumn:H,rightColumn:j})},Tc={aws:Ua},kc={lambda:"Lambda","fargate-task":"ECS","fargate-cluster":"ECS","ecs-cluster":"ECS",eks:"EKS",ec2:"EC2"},Ec=e=>e.split(/[-_]/).map(e=>e?e[0].toUpperCase()+e.slice(1):e).join(" "),Ic=e=>e.provider.toUpperCase(),Oc=f.div`
192
+ display: flex;
193
+ flex-direction: column;
194
+ gap: 8px;
195
+ width: 100%;
196
+ padding: 8px 12px;
197
+ border-radius: 16px 0 0 16px;
198
+ background-color: ${({theme:e})=>e.v2.colors.silver[900]};
199
+ `,Nc=f.button`
200
+ display: flex;
201
+ align-items: center;
202
+ gap: 12px;
203
+ width: 100%;
204
+ padding: 12px 8px 12px 4px;
205
+ border: none;
206
+ border-radius: 8px;
207
+ cursor: pointer;
208
+ text-align: left;
209
+ background-color: ${({theme:e,$selected:t})=>Boolean(t)?e.v2.colors.silver[800]:e.v2.colors.silver[900]};
210
+ transition: background-color 0.15s ease;
211
+
212
+ &:hover {
213
+ background-color: ${({theme:e})=>e.v2.colors.silver[800]};
214
+ }
215
+ `,$c=f.div`
216
+ display: flex;
217
+ align-items: center;
218
+ justify-content: center;
219
+ width: 36px;
220
+ height: 36px;
221
+ border-radius: 8px;
222
+ background-color: ${({theme:e})=>e.v2.colors.silver[900]};
223
+ flex-shrink: 0;
224
+ `,Ac=f.div`
225
+ display: flex;
226
+ flex-direction: column;
227
+ gap: 2px;
228
+ flex: 1;
229
+ min-width: 0;
230
+ `,Rc=({providers:o,selectedProvider:n,onSelect:i})=>{const a=b();return o.length?t(Oc,{children:o.map(o=>{const l=(e=>Tc[e.provider]??Va)(o),r=o.provider===n,s=(e=>{const t=e.features.find(e=>e.key===Rt.Discovery);if(!t)return"";const o=[],n=new Set;for(const e of t.types){const t=e.name.includes(".")?e.name.slice(e.name.indexOf(".")+1):e.name,i=kc[t]??Ec(t);n.has(i)||(n.add(i),o.push(i))}return o.join(", ")})(o);return e(Nc,{type:"button",$selected:r,onClick:()=>i(o.provider),"data-id":`cloud-connector-provider-${o.provider}`,children:[t($c,{children:t(l,{size:24})}),e(Ac,{children:[t(ce,{size:ue.S,weight:400,lineHeight:"24px",color:de.Primary,children:Ic(o)}),s&&t(ce,{size:ue.XXXS,weight:400,lineHeight:"normal",color:de.Secondary,children:s})]}),t(Ra,{size:18,fill:a.v2.colors.silver[300]})]},o.provider)})}):t(ce,{size:ue.XS,color:de.Secondary,children:"No providers available."})},Dc=f.div`
231
+ display: flex;
232
+ flex-direction: column;
233
+ gap: 8px;
234
+ width: 100%;
235
+ padding: 8px;
236
+ border-radius: 12px;
237
+ background-color: ${({theme:e})=>e.v2.colors.silver[900]};
238
+ border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
239
+ cursor: default;
240
+ `,_c=f.div`
241
+ display: flex;
242
+ align-items: center;
243
+ gap: 4px;
244
+ width: 100%;
245
+ `,Pc=f.div`
246
+ flex: 1;
247
+ min-width: 0;
248
+ `,Lc=f.div`
249
+ width: 100%;
250
+ max-height: 145px;
251
+ overflow: auto;
252
+ padding: 0 12px;
253
+
254
+ scrollbar-width: thin;
255
+ scrollbar-color: transparent transparent;
256
+
257
+ &::-webkit-scrollbar {
258
+ width: 10px;
259
+ height: 10px;
260
+ }
261
+
262
+ &::-webkit-scrollbar-thumb {
263
+ border: 2px solid transparent;
264
+ border-radius: 8px;
265
+ background-color: transparent;
266
+ background-clip: padding-box;
267
+ transition: background-color 0.2s ease;
268
+ }
269
+
270
+ ${Dc}:hover & {
271
+ scrollbar-color: ${({theme:e})=>e.v2.colors.silver[300]} transparent;
272
+ }
273
+
274
+ ${Dc}:hover &::-webkit-scrollbar-thumb {
275
+ background-color: ${({theme:e})=>e.v2.colors.silver[300]};
276
+ }
277
+ `,Fc=f.pre`
278
+ margin: 0;
279
+ font-family: ${({theme:e})=>e.font_family.code};
280
+ font-size: 12px;
281
+ line-height: 20px;
282
+ color: ${({theme:e})=>e.v2.colors.green[400]};
283
+ white-space: pre;
284
+ `,Mc=({policy:o})=>{const n=b(),{CopyButton:i}=Dt();return e(Dc,{children:[e(_c,{children:[t(Ha,{size:16,fill:n.v2.colors.silver[200]}),t(Pc,{children:t(ce,{size:ue.XXS,color:de.Primary,children:Ze.CLOUD_CONNECTOR_POLICY_PREVIEW})}),t(i,{value:o,size:vt.XS})]}),t(Lc,{children:t(Fc,{children:o})})]})};var zc;!function(e){e.DiscoveryOnly="discovery-only",e.DiscoveryInstrumentation="discovery-instrumentation",e.Custom="custom"}(zc||(zc={}));const Bc=[{id:zc.DiscoveryOnly,title:Ze.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_ONLY_TITLE,description:Ze.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_ONLY_DESC,featureKeys:[Rt.Discovery]},{id:zc.DiscoveryInstrumentation,title:Ze.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_INSTRUMENTATION_TITLE,description:Ze.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_INSTRUMENTATION_DESC,featureKeys:[Rt.Discovery,Rt.Instrumentation]},{id:zc.Custom,title:Ze.CLOUD_CONNECTOR_PERMISSION_CUSTOM_TITLE,description:Ze.CLOUD_CONNECTOR_PERMISSION_CUSTOM_DESC,featureKeys:[]}],Xc=(e,t)=>e.features?.find(e=>e.key===t),Uc=e=>{if(!e)return[];const t=Xc(e,Rt.Discovery),o=Xc(e,Rt.Instrumentation);return t?t.types.map(e=>{const t=o?.types.find(t=>t.name===e.name);return{typeName:e.name,displayName:e.displayName||e.name,discoveryPermissions:e.permissions??[],instrumentationPermissions:t?t.permissions??[]:void 0}}):[]},Vc=()=>{const e=new Set,t=[];return{out:t,add:o=>o?.forEach(o=>{o&&!e.has(o)&&(e.add(o),t.push(o))})}},Hc=(e,t,o)=>{const n=t===zc.Custom?((e,t)=>{if(!e)return[];const o=Uc(e),n=Xc(e,Rt.Discovery),i=o.some(e=>t[e.typeName]?.discovery),{out:a,add:l}=Vc();return l(e.auth?.permissions),i&&l(n?.permissions),o.forEach(e=>{const o=t[e.typeName];o?.discovery&&l(e.discoveryPermissions),o?.instrumentation&&l(e.instrumentationPermissions)}),a})(e,o??{}):((e,t)=>{if(!e)return[];const o=Bc.find(e=>e.id===t)?.featureKeys??[],{out:n,add:i}=Vc();return i(e.auth?.permissions),e.features?.forEach(e=>{e.enabled&&o.includes(e.key)&&(i(e.permissions),e.types?.forEach(e=>{!1!==e.implemented&&i(e.permissions)}))}),n})(e,t),i={Version:"2012-10-17",Statement:[{Sid:"OdigosCloudConnector",Effect:"Allow",Action:n,Resource:"*"}]};return JSON.stringify(i,null,2)},jc=f.div`
285
+ width: 100%;
286
+ padding: 12px 16px;
287
+ border-radius: 12px;
288
+ background-color: ${({theme:e})=>e.v2.colors.silver[900]};
289
+ border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
290
+ `,Gc=f.div`
291
+ display: grid;
292
+ grid-template-columns: minmax(0, 1fr) 120px 150px;
293
+ align-items: center;
294
+ row-gap: 16px;
295
+ column-gap: 8px;
296
+ `,Wc=f.div`
297
+ display: flex;
298
+ align-items: center;
299
+ min-width: 0;
300
+ `,Kc=f(Wc)`
301
+ justify-content: center;
302
+ `,Yc={discovery:!1,instrumentation:!1},Jc=({provider:o,capabilities:i,onCapabilitiesChange:a})=>{const l=Uc(o),r=(e,t)=>{a({...i,[e]:t})};return l.length?t(jc,{children:e(Gc,{children:[t(Wc,{children:t(ce,{size:ue.XXS,color:de.Secondary,children:Ze.CLOUD_CONNECTOR_CUSTOM_COL_TYPE})}),t(Kc,{children:t(ce,{size:ue.XXS,color:de.Secondary,children:Ze.CLOUD_CONNECTOR_CUSTOM_COL_DISCOVERY})}),t(Kc,{children:t(ce,{size:ue.XXS,color:de.Secondary,children:Ze.CLOUD_CONNECTOR_CUSTOM_COL_INSTRUMENTATION})}),l.map(o=>{const a=i[o.typeName]??Yc,l=void 0!==o.instrumentationPermissions,s=a.instrumentation||a.discovery;return e(n.Fragment,{children:[t(Wc,{children:t(ce,{size:ue.XXS,weight:400,lineHeight:"normal",color:de.Primary,children:o.displayName})}),t(Kc,{children:t(ie,{name:`cloud-connector-custom-${o.typeName}-discovery`,size:Et.S,value:s,disabled:a.instrumentation,onChange:e=>r(o.typeName,{discovery:e,instrumentation:a.instrumentation})})}),t(Kc,{children:t(ie,{name:`cloud-connector-custom-${o.typeName}-instrumentation`,size:Et.S,value:a.instrumentation,disabled:!l,onChange:e=>r(o.typeName,{discovery:!!e||a.discovery,instrumentation:e})})})]},o.typeName)})]})}):null},qc=f.div`
303
+ display: flex;
304
+ flex-direction: column;
305
+ gap: 8px;
306
+ flex: 1;
307
+ min-width: 0;
308
+ padding: 8px;
309
+ border-radius: 0 16px 16px 0;
310
+ background-color: ${({theme:e})=>e.v2.colors.silver[900]};
311
+ `,Zc=f.div`
312
+ display: flex;
313
+ flex-direction: column;
314
+ gap: 8px;
315
+ width: 100%;
316
+ `,Qc=f.div`
317
+ display: flex;
318
+ align-items: center;
319
+ gap: 10px;
320
+ width: 100%;
321
+ padding: 4px 12px 4px 4px;
322
+ border-radius: 8px;
323
+ background-color: ${({theme:e})=>e.v2.colors.purple[900]};
324
+ `,ed=f.div`
325
+ display: flex;
326
+ align-items: center;
327
+ justify-content: center;
328
+ width: 36px;
329
+ height: 36px;
330
+ border-radius: 6px;
331
+ flex-shrink: 0;
332
+ background-color: ${({theme:e})=>e.v2.colors.purple[800]};
333
+ `,td=({message:o})=>{const n=b();return e(Qc,{children:[t(ed,{children:t(ja,{size:24})}),t(ce,{size:ue.XXS,color:n.v2.colors.purple[300],children:o})]})},od=({provider:o,selectedPermission:n,onSelect:i,capabilities:a,onCapabilitiesChange:l})=>t(qc,{children:Bc.map(r=>{const s=r.id===n,c=r.id===zc.Custom,d=s?e(Zc,{children:[c&&t(Jc,{provider:o,capabilities:a,onCapabilitiesChange:l}),t(Mc,{policy:Hc(o,r.id,a)})]}):void 0,u=s?t(td,{message:c?Ze.CLOUD_CONNECTOR_POLICY_NOTE_CUSTOM:Ze.CLOUD_CONNECTOR_POLICY_NOTE}):void 0;return t(_t,{"data-id":`cloud-connector-permission-${r.id}`,title:r.title,description:r.description,checked:s,onChange:()=>i(r.id),body:d,footerNote:u},r.id)})}),nd=f.div`
334
+ display: flex;
335
+ flex-direction: column;
336
+ padding: 16px;
337
+ `,id=f.div`
338
+ display: flex;
339
+ flex-direction: column;
340
+ gap: 16px;
341
+ padding: 16px;
342
+ border-radius: 16px;
343
+ background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
344
+ `,ad=f.div`
345
+ display: flex;
346
+ flex-direction: column;
347
+ gap: 4px;
348
+ `,ld=f.div`
349
+ display: flex;
350
+ align-items: stretch;
351
+ width: 100%;
352
+ `,rd=f.div`
353
+ display: flex;
354
+ flex: 0 0 40%;
355
+ min-width: 0;
356
+ `,sd=()=>{const{providers:o,genericForm:n}=dr(),[l,r]=s(!0),c=a(()=>o.find(e=>e.provider===n.formData.provider),[o,n.formData.provider]);return i(()=>{!n.formData.provider&&o.length>0&&n.handleFormChange("provider",o[0].provider)},[o,n.formData.provider,n]),i(()=>{n.formData.permission||n.handleFormChange("permission",zc.DiscoveryInstrumentation)},[n.formData.permission,n]),t(nd,{children:e(id,{children:[e(ad,{children:[t(ce,{size:ue.S,weight:500,lineHeight:"24px",color:de.Primary,children:Ze.CLOUD_CONNECTOR_SELECT_PROVIDER_TITLE}),t(ce,{size:ue.XXS,weight:400,lineHeight:"normal",color:de.Secondary,children:Ze.CLOUD_CONNECTOR_SELECT_PROVIDER_SUBTITLE})]}),l&&t(_e,{fullWidth:!0,smallIcon:!0,status:Pe.Info,message:Ze.CLOUD_CONNECTOR_PERMISSIONS_NOTE,action:{"data-id":"cloud-connector-permissions-note-close",label:Pt.CLOSE,onClick:()=>r(!1)}}),e(ld,{children:[t(rd,{children:t(Rc,{providers:o,selectedProvider:n.formData.provider,onSelect:e=>n.handleFormChange("provider",e)})}),t(od,{provider:c,selectedPermission:n.formData.permission,onSelect:e=>n.handleFormChange("permission",e),capabilities:n.formData.customCapabilities,onCapabilitiesChange:e=>n.handleFormChange("customCapabilities",e)})]})]})})},cd=f.div`
357
+ display: flex;
358
+ flex-direction: column;
359
+ gap: 16px;
360
+ width: 100%;
361
+ padding: 12px;
362
+ border-radius: 8px;
363
+ background-color: ${({theme:e})=>e.v2.colors.silver[900]};
364
+ `,dd=f.div`
365
+ display: flex;
366
+ align-items: center;
367
+ gap: 12px;
368
+ width: 100%;
369
+ `,ud=f.div`
370
+ display: flex;
371
+ align-items: center;
372
+ justify-content: center;
373
+ flex-shrink: 0;
374
+ width: 24px;
375
+ height: 24px;
376
+ border-radius: 16px;
377
+ background-color: ${({theme:e})=>e.v2.colors.purple[500]};
378
+ `,pd=f.div`
379
+ display: flex;
380
+ flex: 1;
381
+ flex-direction: column;
382
+ gap: 2px;
383
+ min-width: 0;
384
+ `,hd=f.div`
385
+ display: flex;
386
+ flex-direction: column;
387
+ gap: 10px;
388
+ width: 100%;
389
+ padding-left: 32px;
390
+ `,md=({"data-id":o,step:n,title:i,description:a,children:l})=>e(cd,{"data-id":o,children:[e(dd,{children:[t(ud,{children:t(ce,{size:ue.XXS,weight:400,lineHeight:"20px",color:de.Primary,children:n})}),e(pd,{children:[t(ce,{size:ue.S,weight:400,lineHeight:"24px",color:de.Primary,children:i}),t(ce,{size:ue.XXS,weight:400,lineHeight:"normal",color:de.Secondary,children:a})]})]}),l&&t(hd,{children:l})]});var gd,fd;!function(e){e.AssumeRole="assume-role",e.StaticKeys="static-keys"}(gd||(gd={})),function(e){e.CloudFormation="cloudformation",e.Terraform="terraform",e.AwsCli="aws-cli",e.Manual="manual"}(fd||(fd={}));const bd=[{id:gd.AssumeRole,label:Ze.CLOUD_CONNECTOR_AUTH_ASSUME_ROLE,note:Ze.CLOUD_CONNECTOR_AUTH_ASSUME_ROLE_NOTE},{id:gd.StaticKeys,label:Ze.CLOUD_CONNECTOR_AUTH_STATIC_KEYS,note:Ze.CLOUD_CONNECTOR_AUTH_STATIC_KEYS_NOTE}],vd=[{id:fd.CloudFormation,label:Ze.CLOUD_CONNECTOR_SETUP_METHOD_CLOUDFORMATION},{id:fd.Terraform,label:Ze.CLOUD_CONNECTOR_SETUP_METHOD_TERRAFORM},{id:fd.AwsCli,label:Ze.CLOUD_CONNECTOR_SETUP_METHOD_AWS_CLI},{id:fd.Manual,label:Ze.CLOUD_CONNECTOR_SETUP_METHOD_MANUAL}],yd={[fd.CloudFormation]:{description:"Launch the stack in your AWS account. It creates the IAM role with the policy above and returns the Role ARN.",steps:["Open the AWS CloudFormation console.","Choose Create stack → With new resources.","Upload the template below as the stack template.","Review the permissions, then deploy the stack.","Open the stack's Outputs tab.","Copy the RoleArn value and paste it below."],code:["aws cloudformation deploy \\"," --stack-name odigos-connector \\"," --template-file odigos-connector.yaml \\"," --capabilities CAPABILITY_NAMED_IAM"].join("\n")},[fd.Terraform]:{description:"Run the Odigos connector module to provision the IAM role as code and expose the Role ARN as an output.",steps:["Add the odigos-connector module to your configuration.","Run terraform init to download the module.","Run terraform apply and confirm the plan.","Read the role_arn value from the apply output.","Copy the Role ARN and paste it below."],code:["terraform init","terraform apply","terraform output -raw role_arn"].join("\n")},[fd.AwsCli]:{description:"Create the IAM role from your terminal using the AWS CLI, then return the Role ARN.",steps:["Make sure the AWS CLI is configured (aws configure).","Create the role with the trust policy.","Attach the permissions policy to the role.","Copy the ARN from the create-role output and paste it below."],code:["aws iam get-role \\"," --role-name OdigosConnectorRole \\"," --query 'Role.Arn' \\"," --output text"].join("\n")},[fd.Manual]:{description:"Create the IAM role by hand in the AWS Console using the trust policy below, then return the Role ARN.",steps:["Open the AWS Console → IAM → Roles → Create role.","Select Custom trust policy.","Paste the trust policy below.","Attach the permissions policy from the previous step.","Name the role and create it.","Open the role summary and copy the Role ARN below."],code:["{",' "Version": "2012-10-17",',' "Statement": ['," {",' "Effect": "Allow",',' "Principal": { "AWS": "arn:aws:iam::657451249928:root" },',' "Action": "sts:AssumeRole",',' "Condition": {',' "StringEquals": { "sts:ExternalId": "odigos-connector" }'," }"," }"," ]","}"].join("\n")}},Cd=f.div`
391
+ display: flex;
392
+ align-items: stretch;
393
+ gap: 10px;
394
+ width: 100%;
395
+ `,Sd=f.div`
396
+ display: flex;
397
+ flex: 2 1 0;
398
+ flex-direction: column;
399
+ gap: 12px;
400
+ min-width: 0;
401
+ padding: 12px 0;
402
+ `,xd=f.div`
403
+ display: flex;
404
+ flex-direction: column;
405
+ gap: 8px;
406
+ width: 100%;
407
+ `,wd=f.div`
408
+ display: flex;
409
+ align-items: center;
410
+ gap: 12px;
411
+ width: 100%;
412
+ `,Td=f.div`
413
+ display: flex;
414
+ align-items: center;
415
+ justify-content: center;
416
+ flex-shrink: 0;
417
+ width: 24px;
418
+ height: 24px;
419
+ border-radius: 16px;
420
+ background-color: ${({theme:e})=>e.v2.colors.purple[700]};
421
+ `,kd=f.div`
422
+ display: flex;
423
+ flex: 3 1 0;
424
+ flex-direction: column;
425
+ min-width: 0;
426
+ padding: 8px;
427
+ border-radius: 12px;
428
+ background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
429
+ border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
430
+ `,Ed=f.div`
431
+ display: flex;
432
+ align-items: center;
433
+ justify-content: flex-end;
434
+ width: 100%;
435
+ `,Id=f.div`
436
+ flex: 1;
437
+ width: 100%;
438
+ min-height: 200px;
439
+ max-height: 260px;
440
+ overflow: auto;
441
+ padding: 0 12px 12px;
442
+ `,Od=f.pre`
443
+ margin: 0;
444
+ font-family: ${({theme:e})=>e.font_family.code};
445
+ font-size: 12px;
446
+ line-height: 20px;
447
+ color: ${({theme:e})=>e.v2.colors.green[400]};
448
+ white-space: pre;
449
+ `,Nd=({step:o,setupMethod:n})=>{const i=b(),{CopyButton:a}=Dt(),{description:l,steps:r,code:s}=(e=>yd[e]??yd[fd.CloudFormation])(n);return t(md,{"data-id":"cloud-connector-create-role",step:o,title:Ze.CLOUD_CONNECTOR_CREATE_ROLE_TITLE,description:l,children:e(Cd,{children:[e(Sd,{children:[t(ce,{size:ue.XXS,weight:400,lineHeight:"20px",color:de.Primary,children:Ze.CLOUD_CONNECTOR_CREATE_ROLE_STEPS_HEADING}),t(xd,{children:r.map((o,a)=>e(wd,{children:[t(Td,{children:t(ce,{size:ue.XXS,weight:400,lineHeight:"20px",color:i.v2.colors.purple[200],children:a+1})}),t(ce,{size:ue.XXS,weight:400,lineHeight:"20px",color:de.Primary,children:o})]},`${n}-step-${a}`))})]}),e(kd,{children:[t(Ed,{children:t(a,{value:s,size:vt.XS})}),t(Id,{children:t(Od,{children:s})})]})]})})},$d=f.div`
450
+ display: flex;
451
+ flex-direction: column;
452
+ gap: 16px;
453
+ width: 100%;
454
+ `,Ad=f.div`
455
+ display: flex;
456
+ flex-wrap: wrap;
457
+ gap: 24px;
458
+ width: 100%;
459
+ `,Rd=f.div`
460
+ display: flex;
461
+ flex: 1 1 calc(50% - 12px);
462
+ min-width: 0;
463
+ `,Dd=f.div`
464
+ display: flex;
465
+ width: 100%;
466
+ max-width: 479px;
467
+ `,_d=({step:o})=>{const{genericForm:n,providers:i}=dr(),{provider:l,authMethod:r,awsAccountId:s,credentials:c}=n.formData,d=a(()=>i.find(e=>e.provider===l),[i,l]),u=a(()=>((e,t)=>{const o=e?.auth?.methods?.find(e=>e.id===t);if(!o)return[];const n=new Map(e?.auth?.methods?.map(e=>[e.id,e])),i=new Set,a=[],l=e=>e?.forEach(e=>{e.name&&!i.has(e.name)&&(i.add(e.name),a.push(e))});return o.baseMethods?.forEach(e=>l(n.get(e)?.fields)),l(o.fields),a})(d,r),[d,r]);return t(md,{"data-id":"cloud-connector-enter-arn",step:o,title:Ze.CLOUD_CONNECTOR_ENTER_ARN_TITLE,description:Ze.CLOUD_CONNECTOR_ENTER_ARN_SUBTITLE,children:e($d,{children:[t(Dd,{children:t(xe,{name:"cloud-connector-aws-account-id",width:"100%",label:Ze.CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_LABEL,placeholder:Ze.CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_PLACEHOLDER,helpMessage:Ze.CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_HELP,value:s,onChange:e=>n.handleFormChange("awsAccountId",e.target.value)})}),u.length>0&&t(Ad,{children:u.map(e=>t(Rd,{children:t(xe,{name:`cloud-connector-credential-${e.name}`,width:"100%",type:e.secret?Lt.Password:Lt.Text,label:e.displayName||e.name,required:e.required,tooltip:e.tooltip||void 0,helpMessage:e.tooltip||void 0,placeholder:e.displayName||e.name,value:c[e.name]??"",onChange:t=>{return o=e.name,i=t.target.value,void n.handleFormChange("credentials",{...c,[o]:i});var o,i}})},e.name))})]})})},Pd=f.div`
468
+ display: flex;
469
+ flex-direction: column;
470
+ padding: 16px;
471
+ `,Ld=f.div`
472
+ display: flex;
473
+ flex-direction: column;
474
+ gap: 12px;
475
+ padding: 16px 16px 12px;
476
+ border-radius: 16px;
477
+ background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
478
+ `,Fd=f.div`
479
+ display: flex;
480
+ align-items: center;
481
+ gap: 8px;
482
+ width: 100%;
483
+ `,Md=f.button`
484
+ display: flex;
485
+ align-items: center;
486
+ justify-content: center;
487
+ flex-shrink: 0;
488
+ width: 36px;
489
+ height: 36px;
490
+ padding: 0 8px;
491
+ border: none;
492
+ border-radius: 8px;
493
+ background-color: transparent;
494
+ cursor: pointer;
495
+ transition: background-color 0.15s ease;
496
+
497
+ &:hover {
498
+ background-color: ${({theme:e})=>e.v2.colors.silver[900]};
499
+ }
500
+ `,zd=f.div`
501
+ display: flex;
502
+ flex: 1;
503
+ flex-direction: column;
504
+ gap: 4px;
505
+ min-width: 0;
506
+ `,Bd=f.div`
507
+ display: flex;
508
+ align-items: center;
509
+ gap: 4px;
510
+ padding: 8px 0 8px 2px;
511
+ `,Xd=({onBack:o})=>{const n=b(),{genericForm:a}=dr(),l=a.formData.authMethod,r=a.formData.setupMethod;i(()=>{l||a.handleFormChange("authMethod",gd.AssumeRole)},[l,a]),i(()=>{r||a.handleFormChange("setupMethod",fd.CloudFormation)},[r,a]);const s=bd.find(e=>e.id===l)?.note;return t(Pd,{children:e(Ld,{children:[e(Fd,{children:[t(Md,{"data-id":"cloud-connector-setup-back",type:"button",onClick:o,"aria-label":Ze.CLOUD_CONNECTOR_SETUP_CREDENTIALS_TITLE,children:t(Ga,{size:24})}),e(zd,{children:[t(ce,{size:ue.S,weight:500,lineHeight:"24px",color:de.Primary,children:Ze.CLOUD_CONNECTOR_SETUP_CREDENTIALS_TITLE}),t(ce,{size:ue.XXS,weight:400,lineHeight:"normal",color:de.Secondary,children:Ze.CLOUD_CONNECTOR_SETUP_CREDENTIALS_SUBTITLE})]})]}),e(md,{"data-id":"cloud-connector-auth-method",step:1,title:Ze.CLOUD_CONNECTOR_AUTH_TITLE,description:Ze.CLOUD_CONNECTOR_AUTH_SUBTITLE,children:[t(fe,{"data-id":"cloud-connector-auth-method-segment",size:Re.S,selected:l,setSelected:e=>a.handleFormChange("authMethod",e),options:bd.map(e=>({value:e.id,label:e.label}))}),s&&e(Bd,{children:[t(Wa,{size:16,fill:n.v2.colors.silver[200]}),t(ce,{size:ue.XXXS,weight:400,lineHeight:"normal",color:de.Secondary,children:s})]})]}),t(md,{"data-id":"cloud-connector-setup-method",step:2,title:Ze.CLOUD_CONNECTOR_SETUP_METHOD_TITLE,description:Ze.CLOUD_CONNECTOR_SETUP_METHOD_SUBTITLE,children:t(fe,{"data-id":"cloud-connector-setup-method-segment",size:Re.S,selected:r,setSelected:e=>a.handleFormChange("setupMethod",e),options:vd.map(e=>({value:e.id,label:e.label}))})}),t(Nd,{step:3,setupMethod:r}),t(_d,{step:4})]})})},Ud=f.div`
512
+ display: flex;
513
+ flex-direction: column;
514
+ flex: 1;
515
+ min-height: 0;
516
+ padding: 16px;
517
+ `,Vd=f.div`
518
+ display: flex;
519
+ flex-direction: column;
520
+ flex: 1;
521
+ min-height: 0;
522
+ padding: 16px;
523
+ border-radius: 16px;
524
+ background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
525
+ `,Hd=f.div`
526
+ display: flex;
527
+ flex: 1;
528
+ align-items: center;
529
+ justify-content: center;
530
+ width: 100%;
531
+ `,jd=f.div`
532
+ display: flex;
533
+ flex-direction: column;
534
+ align-items: center;
535
+ justify-content: center;
536
+ gap: 12px;
537
+ width: 294px;
538
+ padding: 24px 8px;
539
+ border-radius: 8px;
540
+ background-color: ${({theme:e})=>e.v2.colors.silver[800]};
541
+ `,Gd=f.div`
542
+ display: flex;
543
+ flex-direction: column;
544
+ align-items: center;
545
+ gap: 12px;
546
+ width: 409px;
547
+ padding: 16px;
548
+ border-radius: 12px;
549
+ background-color: ${({theme:e})=>e.v2.colors.silver[900]};
550
+ `,Wd=f.div`
551
+ display: flex;
552
+ align-items: center;
553
+ justify-content: center;
554
+ flex-shrink: 0;
555
+ width: 39px;
556
+ height: 39px;
557
+ border-radius: 20px;
558
+ background-color: ${({theme:e})=>e.v2.colors.red[500]};
559
+ `,Kd=f.div`
560
+ display: flex;
561
+ align-items: flex-start;
562
+ gap: 8px;
563
+ width: 100%;
564
+ max-height: 112px;
565
+ overflow: auto;
566
+ padding: 12px;
567
+ border-radius: 8px;
568
+ background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
569
+ `,Yd=f.pre`
570
+ flex: 1;
571
+ min-width: 0;
572
+ margin: 0;
573
+ font-family: ${({theme:e})=>e.font_family.code};
574
+ font-size: 10px;
575
+ line-height: 14px;
576
+ color: ${({theme:e})=>e.v2.colors.silver[200]};
577
+ white-space: pre-wrap;
578
+ word-break: break-word;
579
+ `,Jd=f.div`
580
+ display: flex;
581
+ flex-direction: column;
582
+ gap: 12px;
583
+ width: 100%;
584
+ `,qd=f.div`
585
+ display: flex;
586
+ flex-wrap: wrap;
587
+ gap: 24px;
588
+ padding: 0 2px;
589
+ `,Zd=f.div`
590
+ display: flex;
591
+ gap: 6px;
592
+ min-width: 0;
593
+ `,Qd=f.div`
594
+ display: flex;
595
+ flex-direction: column;
596
+ gap: 8px;
597
+ `,eu=f.div`
598
+ display: flex;
599
+ flex-direction: column;
600
+ gap: 6px;
601
+ padding: 12px;
602
+ border-radius: 12px;
603
+ border: 1px solid ${({theme:e,$passed:t})=>t?e.v2.colors.silver[700]:e.v2.colors.red[800]};
604
+ background-color: ${({theme:e})=>e.v2.colors.silver[900]};
605
+ `,tu=({isTesting:o,error:n,result:i})=>{const l=b(),{CopyButton:r}=Dt(),s=a(()=>i?.checks.filter(e=>!e.passed)??[],[i]),c=!(o||!n&&(!i||i.success)),d=n?Ze.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT:s[0]?.remediation||s[0]?.message||Ze.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT,u=n||s.map(e=>e.message).filter(Boolean).join("\n");return t(Ud,{children:t(Vd,{children:o?t(Hd,{children:t(jd,{children:t(yt,{withVisual:!0,withGradient:!0,title:Ze.CLOUD_CONNECTOR_TESTING_TITLE,titleSize:ue.XS})})}):c?t(Hd,{children:e(Gd,{children:[t(Wd,{children:t(Ma,{size:20,fill:l.v2.colors.black[500]})}),t(ce,{size:ue.XS,weight:400,lineHeight:"20px",color:de.Primary,children:Ze.CLOUD_CONNECTOR_CONNECTION_FAILED_TITLE}),t(ce,{align:"center",size:ue.XXXS,weight:400,lineHeight:"normal",color:de.Secondary,children:d}),u&&e(Kd,{children:[t(Yd,{children:u}),t(r,{value:u,size:vt.XS})]})]})}):i?e(Jd,{children:[t(Ke,{status:Pe.Success,label:Ze.CLOUD_CONNECTOR_VALIDATE_SUCCESS,leftIcon:Fa,fullWidth:!0}),(i.accountId||i.identity)&&e(qd,{children:[i.accountId&&e(Zd,{children:[e(ce,{size:ue.XXS,weight:500,color:de.Secondary,children:[Ze.CLOUD_CONNECTOR_VALIDATE_ACCOUNT,":"]}),t(ce,{size:ue.XXS,weight:400,color:de.Primary,children:i.accountId})]}),i.identity&&e(Zd,{children:[e(ce,{size:ue.XXS,weight:500,color:de.Secondary,children:[Ze.CLOUD_CONNECTOR_VALIDATE_IDENTITY,":"]}),t(ce,{size:ue.XXS,weight:400,color:de.Primary,children:i.identity})]})]}),i.checks.length>0&&t(Qd,{children:i.checks.map(o=>e(eu,{$passed:o.passed,children:[t(Ke,{status:o.passed?Pe.Success:Pe.Error,label:o.displayName,leftIcon:o.passed?Fa:Ma}),o.message&&t(ce,{size:ue.XXS,weight:400,lineHeight:"normal",color:de.Secondary,children:o.message}),!o.passed&&o.remediation&&t(ce,{size:ue.XXS,weight:400,lineHeight:"normal",color:de.Primary,children:o.remediation})]},o.name))})]}):t(Hd,{children:t(ce,{size:ue.XXS,weight:400,color:de.Secondary,children:Ze.CLOUD_CONNECTOR_VALIDATE_EMPTY})})})})};var ou;!function(e){e[e.SelectProvider=1]="SelectProvider",e[e.Config=2]="Config",e[e.Validate=3]="Validate"}(ou||(ou={}));const nu=ou.SelectProvider,iu=ou.Validate,au=({onClose:o,withOverlay:n,onCreateCloudConnector:i,onCreated:l})=>{const{providers:c,genericForm:d}=dr(),[u,p]=s(nu),[h,m]=s(!1),[g,f]=s(!1),[b,v]=s(void 0),[y,C]=s(void 0),[S,x]=s(void 0),w=d.isFormDirty,T=u===nu,k=u===iu,E=r(()=>{w&&!h?m(!0):(m(!1),o?.())},[w,h,o]),I=r(()=>{x(void 0),C(void 0),v(void 0),p(e=>e>nu?e-1:e)},[]),O=r(()=>{if(x(void 0),u===ou.SelectProvider){if(!d.formData.provider)return void x("Please select a cloud provider");if(!d.formData.permission)return void x("Please select a permission level")}p(e=>e<iu?e+1:e)},[u,d.formData.provider,d.formData.permission]),N=r(async()=>{if(x(void 0),C(void 0),v(void 0),p(ou.Validate),!i)return;const{provider:e,permission:t,customCapabilities:o,awsAccountId:n,credentials:a,name:r}=d.formData,s=((e,t,o)=>{const n=Uc(e),i=[];return n.forEach(e=>{const n=void 0!==e.instrumentationPermissions;let a=!1,l=!1;switch(t){case zc.DiscoveryOnly:a=!0;break;case zc.DiscoveryInstrumentation:a=!0,l=n;break;case zc.Custom:{const t=o[e.typeName];a=!!t?.discovery,l=!!t?.instrumentation;break}}(a||l)&&i.push({type:e.typeName,discovery:a,instrumentation:l,computePlatforms:!1})}),i})(c.find(t=>t.provider===e),t,o);f(!0);try{const t=await i({provider:e,displayName:r,credentials:a,expectedAccountId:n,capabilities:s});if(t.created)return void l?.(t.connectorId);v(t.test)}catch(e){C(e instanceof Error?e.message:"Failed to create connector")}finally{f(!1)}},[i,l,d.formData,c]),$=g,A=k&&!g&&(!!y||!!b&&!b.success),R=a(()=>S?{status:Pe.Error,message:S}:void 0,[S]),D=a(()=>T?{"data-id":"cloud-connector-cancel",label:Pt.CANCEL,variant:ge.Secondary,onClick:E,disabled:$}:{"data-id":"cloud-connector-back",label:Pt.BACK,variant:ge.Text,leftIcon:Ga,onClick:I,disabled:$},[T,E,I,$]),_=a(()=>{if(k){if(g)return;return A?{"data-id":"cloud-connector-retry",label:Pt.RETRY,variant:ge.Primary,rightIcon:Ka,onClick:N}:void 0}return u===ou.Config?{"data-id":"cloud-connector-verify",label:Pt.VERIFY_AND_CREATE_CONNECTOR,variant:ge.Primary,onClick:N,disabled:$}:{"data-id":"cloud-connector-next",label:Pt.NEXT,variant:ge.Primary,onClick:O,disabled:$}},[k,g,A,u,N,O,$]),P=a(()=>[D,_].filter(Boolean),[D,_]);return e(re,{width:Hl,isOpen:!0,hideOverlay:!$&&!n,header:{icon:Va,title:Ze.CREATE_CLOUD_CONNECTOR,onClose:o?E:void 0,onCloseDisabled:$},footer:{note:R,actions:P},children:[u===ou.SelectProvider&&t(sd,{}),u===ou.Config&&t(Xd,{onBack:I}),u===ou.Validate&&t(tu,{isTesting:g,error:y,result:b}),t(jl,{isOpen:h,onClose:()=>m(!1),onApprove:()=>o?.()})]})},lu=(e,t)=>{const o=[{id:"type",title:Ze.TYPE,label:t.label},{id:"status",title:Ze.STATUS,badge:{status:e.disabled?Pe.Unknown:Pe.Success,label:e.disabled?Ze.DISABLED:Ze.ENABLED}}],n=e.signals?.map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return n&&o.push({id:"signals",title:Ze.SIGNALS_FOR_PROCESSING,label:n}),e.name&&o.push({id:"name",title:Ze.NAME,label:e.name}),e.notes&&o.push({id:"notes",title:Ze.NOTES,label:e.notes}),o},ru=({onClose:n,actionId:l})=>{const c=b(),{isVm:d}=C(),{actionsApi:u}=Nl(),{items:p,refetch:h}=u.useActions(),{options:m}=u.useActionTypes(),{selectedOption:g,loadAction:f,validateFormData:v,genericForm:y}=Zl();i(()=>{h()},[]);const[S,x]=s(!1),[w,T]=s(!1),[k,E]=s(null),I=S&&!!y?.isFormDirty,O=a(()=>p?.find(e=>Ft(e)===l),[l,p]),N=a(()=>m.find(({type:e})=>e===O?.type)??Mt.find(({type:e})=>e===O?.type)??null,[m,O?.type]);i(()=>{O&&f(O,N)},[O,N]);const $=r(()=>{O&&x(!0)},[O]),A=r(()=>{O&&(f(O,N),x(!1))},[O,N,f]),R=r(()=>{I?E("close"):n()},[I,n]),D=r(()=>{I?E("cancel"):A()},[I,A]),_=r(()=>{const e=k;E(null),"close"===e?(A(),n()):A()},[k,A,n]),P=r(async()=>{if(O){const{errorMessage:e,preparedFormData:t}=v();e||(await u.update(O.id,t),x(!1))}},[O,v,u]),L=r(()=>{O&&T(!0)},[O]),F=r(async()=>{O&&(await u.remove(O.id,O.type),n())},[O,u,n]);if(!O||!N)return null;const M=(e=>{const t=[],{type:o,fields:n}=e,i=e=>({status:e?Pe.Success:Pe.Unknown,label:e?"True":"False",invertColors:!0});if(o===Ne.K8sAttributes&&(t.push({id:"collectContainerAttributes",title:"Collect Container Attributes",badge:i(n.collectContainerAttributes)}),t.push({id:"collectReplicaSetAttributes",title:"Collect ReplicaSet Attributes",badge:i(n.collectReplicaSetAttributes)}),t.push({id:"collectWorkloadId",title:"Collect Workload ID",badge:i(n.collectWorkloadId)}),t.push({id:"collectClusterId",title:"Collect Cluster ID",badge:i(n.collectClusterId)}),n.labelsAttributes?.forEach(({labelKey:e,attributeKey:o,from:i,fromSources:a},l)=>{const r=a?.length?a.join(", "):i||ne.Pod,s=(n.labelsAttributes?.length??0)>1?`Label #${l+1} `:"Label ";t.push({id:`label-${l}-key`,title:`${s}Key`,label:e}),t.push({id:`label-${l}-attr`,title:`${s}Attribute Key`,label:o}),t.push({id:`label-${l}-from`,title:`${s}From`,label:r})}),n.annotationsAttributes?.forEach(({annotationKey:e,attributeKey:o,from:i,fromSources:a},l)=>{const r=a?.length?a.join(", "):i||ne.Pod,s=(n.annotationsAttributes?.length??0)>1?`Annotation #${l+1} `:"Annotation ";t.push({id:`annotation-${l}-key`,title:`${s}Key`,label:e}),t.push({id:`annotation-${l}-attr`,title:`${s}Attribute Key`,label:o}),t.push({id:`annotation-${l}-from`,title:`${s}From`,label:r})})),o===Ne.AddClusterInfo&&(t.push({id:"overwriteExistingValues",title:"Overwrite Existing Values",badge:i(n.overwriteExistingValues)}),n.clusterAttributes?.forEach(({attributeName:e,attributeStringValue:o},n)=>{t.push({id:`cluster-attr-${n}`,title:e,label:o})})),o===Ne.DeleteAttributes&&n.attributeNamesToDelete?.forEach((e,o)=>{t.push({id:`del-attr-${o}`,title:"Attribute"+((n.attributeNamesToDelete?.length??0)>1?` #${o+1}`:""),label:e})}),o===Ne.RenameAttributes&&Object.entries(n.renames||{}).forEach(([e,o],n)=>{t.push({id:`rename-${n}`,title:e,label:o})}),o===Ne.PiiMasking&&n.piiCategories?.forEach((e,o)=>{t.push({id:`pii-${o}`,title:"Category"+((n.piiCategories?.length??0)>1?` #${o+1}`:""),label:e})}),o===Ne.ExtractAttribute){const e=n.extractAttribute?.extractions??[];e.forEach(({targetAttributeName:o,lookupKey:n,dataFormat:i,regex:a},l)=>{const r=e.length>1?`Extraction #${l+1} `:"Extraction ";t.push({id:`extract-${l}-target`,title:`${r}New Attribute Name`,label:o||"-"}),n&&t.push({id:`extract-${l}-lookupKey`,title:`${r}Lookup Key`,label:n}),i&&t.push({id:`extract-${l}-format`,title:`${r}Data Format`,label:i}),a&&t.push({id:`extract-${l}-regex`,title:`${r}Regex`,label:a})})}return o===Ne.URLTemplatization&&n.urlTemplatizationRulesGroups?.forEach((e,o)=>{const i=(n.urlTemplatizationRulesGroups?.length??0)>1?`Group #${o+1} `:"Group ";e.filterK8sNamespace&&t.push({id:`group-${o}-ns`,title:`${i}Namespace`,label:e.filterK8sNamespace}),e.workloadFilters?.forEach((n,a)=>{const l=[n.kind,n.name].filter(Boolean).join("/");l&&t.push({id:`group-${o}-wf-${a}`,title:`${i}Workload${(e.workloadFilters?.length??0)>1?` #${a+1}`:""}`,label:l})});const a=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");a&&t.push({id:`group-${o}-templates`,title:`${i}Templates`,label:a}),e.notes&&t.push({id:`group-${o}-notes`,title:`${i}Notes`,label:e.notes})}),t})(O);return e(o,{children:[t(re,{isOpen:!0,header:{icon:Xt(O.type),title:N.label,onClose:R,actions:[{id:"edit-action-btn-edit",label:Pt.EDIT,icon:Na,active:S,onClick:$},{id:"edit-action-btn-delete",label:Pt.DELETE,icon:xa,color:c.v2.colors.red[500],active:w,onClick:L}]},footer:{actions:S?[{"data-id":"edit-action-btn-cancel",label:Pt.CANCEL,variant:ge.Secondary,onClick:D},{"data-id":"edit-action-btn-save",label:Pt.SAVE,variant:ge.Primary,onClick:P}]:[]},children:t(pt,{$padding:"4px 12px 12px",children:S&&g?t(vs,{}):t(Z,{$gap:16,children:e(zt,{bgTint:"1000",children:[e(zt,{bgTint:"900",children:[!d&&t(Bt,{conditions:O.conditions||[]}),t(zt,{bgTint:"800",cellsPerRow:2,items:lu(O,N)})]}),!!M?.length&&t(zt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(zt,{bgTint:"800",cellsPerRow:2,items:M})})]})})})}),t(Gl,{target:"action",isOpen:w,onClose:()=>T(!1),onApprove:F}),t(jl,{isOpen:null!==k,onClose:()=>E(null),onApprove:_})]})},su=({onClose:o,connections:n,selectedConnectionIds:r,setSelectedConnectionIds:c})=>{const{configApi:d}=Nl(),[u,p]=s(""),[h,m]=s({showOnlySelected:!1}),g=a(()=>n.filter(e=>{const t=!u||e.name.toLowerCase().includes(u.toLowerCase()),o=!h.showOnlySelected||h.showOnlySelected&&r.includes(e.id);return t&&o}),[n.length,r.length,u,h]),f=e=>{c(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},b=1===r.length?r[0]:void 0,{data:v,loading:y}=d.useEffectiveConfig(b?{id:b}:void 0,{skip:!b}),C=a(()=>{if(b&&v)return{rollout:{automaticRolloutDisabled:v.rollout?.automaticRolloutDisabled??!1}}},[b,v]),{formData:S,handleFormChange:x,areFormValuesEqual:w,resetFormData:T}=Ut(C||{rollout:{automaticRolloutDisabled:!1}}),k=l(T);k.current=T,i(()=>{C&&k.current(C)},[C]);const E=a(()=>r.length>1||void 0!==C&&!w(C,S),[r.length,C,S]);return t(Vl,{isOpen:!0,onClose:o,onSave:async()=>await(d.applyConfigurations?.(S,r))??void 0,header:{icon:Ya,title:"Cluster Configuration"},connectionIds:{value:r,setValue:c},search:{placeholder:"Search by cluster name",value:u,onChange:p},filters:e(pe,{$gap:8,children:[t(ce,{size:ue.XXXS,color:de.Secondary,nowrap:!0,children:"Show only:"}),t(ie,{size:Et.S,label:"Selected",value:h.showOnlySelected,onChange:e=>m(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:E,isFetching:y,leftColumn:{width:"35%",header:e(pe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(pe,{$gap:8,children:[t(ce,{size:ue.XS,children:"Clusters"}),t(Ke,{label:g.length,status:Pe.Unknown})]}),e(pe,{$gap:8,children:[t(ce,{size:ue.XXXS,color:de.Secondary,align:"right",children:"Selected clusters"}),t(Ke,{label:`${r.length}/${g.length}`,status:Pe.Unknown})]})]}),list:g.map(e=>t(Hs,{title:e.name,isChecked:r.includes(e.id),onClick:()=>f(e.id),onCheckboxChange:()=>f(e.id)},e.id))},rightColumn:{width:"65%",header:t(ce,{size:ue.XS,children:"Configurations"}),list:[t(ie,{label:"Automatic rollout disabled",tooltip:"Odigos automatically triggers a one-time rollout for workloads when instrumenting or uninstrumenting, ensuring that changes are applied without requiring manual intervention. When automatic rollout is disabled, Odigos will not restart workloads, and users will need to manually trigger rollouts after adding or removing sources.",value:S.rollout?.automaticRolloutDisabled||!1,onChange:e=>x("rollout.automaticRolloutDisabled",e)},"automatic-rollout-disabled")]}})},cu=e=>{const t=[{id:"type",title:Ze.TYPE,label:e.destinationType.displayName},{id:"status",title:Ze.STATUS,badge:{status:e.disabled?Pe.Unknown:Pe.Success,label:e.disabled?Ze.DISABLED:Ze.ENABLED}}],o=Me(e.exportedSignals).map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return o&&t.push({id:"monitors",title:Ze.MONITORS,label:o}),e.name&&t.push({id:"name",title:Ze.NAME,label:e.name}),t},du=({onClose:n,destinationId:c})=>{const d=b(),{isVm:u}=C(),{destinationsApi:p}=Nl(),{selectedStreamName:h}=Qe(),{items:m,refetch:g}=p.useDestinations(),{data:f,loading:v}=p.useDestinationCategories(),{activeForm:y,loadDestination:S,validateFormData:x,genericForm:w}=Ql();i(()=>{g()},[]);const T=l(null),[k,E]=s(!1),[I,O]=s(!1),[N,$]=s(null),A=k&&!!w?.isFormDirty,R=a(()=>Ht(m,h),[m,h]),D=a(()=>R?.find(e=>Ft(e)===c),[c,R]),_=f?.destinationCategories?.categories??null;i(()=>{D&&_&&S(D,_)},[D,_]);const P=a(()=>D&&_?jt(_,D):[],[D,_]),L=r(()=>{D&&E(!0)},[D]),F=r(()=>{D&&_&&(S(D,_),E(!1))},[D,_,S]),M=r(()=>{A?$("close"):n()},[A,n]),z=r(()=>{A?$("cancel"):F()},[A,F]),B=r(()=>{const e=N;$(null),"close"===e?(F(),n()):F()},[N,F,n]),X=r(async()=>{if(D){const{errorMessage:e,preparedFormData:t}=x();e||(await p.update(D.id,Be(t)),E(!1))}},[D,x,p]),U=r(()=>{D&&O(!0)},[D]),V=r(async()=>{D&&(await p.remove(D.id),n())},[D,p,n]);if(!D)return null;const{icon:H,iconSrc:j}=St(D.destinationType.type),G=((e,t)=>{const o=[],n=Vt(e,t),i=n.map(e=>({name:e.key,value:e.value})),a=Me(e.exportedSignals);let l=[];const r=()=>{l.length&&(o.push({kind:"cells",id:`cells-${o.length}`,items:l}),l=[])};return n.forEach(({key:e,name:n,value:s})=>{const c=t.find(t=>t.name===e),{secret:d,componentType:u,componentProperties:p,hideFromReadData:h,customReadDataLabels:m}=c||{};if(h?.length&&ke(h,a,i))return;const{type:g}=Ee(p,{type:""}),f=d||"password"===g;if(m?.length)m.forEach(({condition:t,...o},n)=>{t==s&&l.push({id:`${e}-custom-${n}`,title:o.title,label:o.value})});else if(s)if(f)l.push({id:e,title:n,label:new Array(10).fill("•").join("")});else{if(u===Te.MultiInput){const t=Ee(s,null);if(Array.isArray(t)&&t.length)return r(),void o.push({kind:"list",id:e,title:n,items:t.map((t,o)=>({id:`${e}-${o}`,label:String(t)}))})}if(u===Te.KeyValuePair){const t=Ee(s,null);if(Array.isArray(t)&&t.length)return r(),void o.push({kind:"pairs",id:e,title:n,items:t.map((t,o)=>{const n=t&&"object"==typeof t?t:{};return{id:`${e}-${o}`,title:null!=n.key?String(n.key):"",label:null!=n.value?String(n.value):""}})})}l.push({id:e,title:n,label:s})}else l.push({id:e,title:n,label:"-"})}),r(),o})(D,P);return e(o,{children:[t(re,{isOpen:!0,header:{icon:H,iconSrc:j,title:D.name||D.destinationType.displayName,onClose:M,actions:[{id:"edit-destination-btn-edit",label:Pt.EDIT,icon:Na,active:k,onClick:L},{id:"edit-destination-btn-delete",label:Pt.DELETE,icon:xa,color:d.v2.colors.red[500],active:I,onClick:U}]},footer:{actions:k?[{"data-id":"edit-destination-btn-cancel",label:Pt.CANCEL,variant:ge.Secondary,onClick:z},...y?.option.testConnectionSupported&&!u?[{"data-id":"edit-destination-btn-test-connection",label:Pt.TEST_CONNECTION,variant:ge.Secondary,onClick:()=>T.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:Pt.SAVE,variant:ge.Primary,onClick:X}]:[]},children:t(pt,{$padding:"4px 12px 12px",children:v?t(mt,{$height:"50vh",children:t(yt,{withSpinner:!0})}):k&&y?t(Ss,{ref:T,isEdit:!0}):t(Z,{$gap:16,children:e(zt,{bgTint:"1000",children:[e(zt,{bgTint:"900",children:[!u&&t(Bt,{conditions:D.conditions||[]}),t(zt,{bgTint:"800",cellsPerRow:2,items:cu(D)})]}),!!G.length&&t(zt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:G.map(e=>"cells"===e.kind?t(zt,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t(zt,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})})}),t(Gl,{target:"destination",isOpen:I,onClose:()=>O(!1),onApprove:V}),t(jl,{isOpen:null!==N,onClose:()=>$(null),onApprove:B})]})},uu=(e,t)=>{const o=[{id:"type",title:Ze.TYPE,label:t.label},{id:"status",title:Ze.STATUS,badge:{status:e.disabled?Pe.Unknown:Pe.Success,label:e.disabled?Ze.DISABLED:Ze.ENABLED}}];return e.ruleName&&o.push({id:"name",title:Ze.NAME,label:e.ruleName}),e.profileName&&o.push({id:"profile",title:Ze.MANAGED_BY_PROFILE,label:e.profileName}),e.notes&&o.push({id:"notes",title:Ze.NOTES,label:e.notes}),o},pu=({onClose:n,ruleId:l})=>{const c=b(),{addNotification:d}=Wt(),{isVm:u}=C(),{instrumentationRulesApi:p}=Nl(),{items:h,refetch:m}=p.useRules(),{selectedOption:g,loadRule:f,validateFormData:v,genericForm:y}=er();i(()=>{m()},[]);const[S,x]=s(!1),[w,T]=s(!1),[k,E]=s(null),I=S&&!!y?.isFormDirty,O=a(()=>h?.find(e=>Ft(e)===l),[l,h]),N=a(()=>wt.find(({type:e})=>e===O?.type)??null,[O?.type]);i(()=>{O&&f(O)},[O]);const $=r(()=>{if(O){if(!O.mutable)return void d({type:Pe.Warning,title:Kt.FORBIDDEN,message:Kt.CANNOT_EDIT_RULE,crdType:Tt.InstrumentationRule,target:O.ruleId,hideFromHistory:!0});x(!0)}},[O,d]),A=r(()=>{O&&(f(O),x(!1))},[O,f]),R=r(()=>{I?E("close"):n()},[I,n]),D=r(()=>{I?E("cancel"):A()},[I,A]),_=r(()=>{const e=k;E(null),"close"===e?(A(),n()):A()},[k,A,n]),P=r(async()=>{if(O){const{errorMessage:e,preparedFormData:t}=v();e||(await p.update(O.ruleId,t,O.type),x(!1))}},[O,v,p]),L=r(()=>{if(O){if(!O.mutable)return void d({type:Pe.Warning,title:Kt.FORBIDDEN,message:Kt.CANNOT_DELETE_RULE,crdType:Tt.InstrumentationRule,target:O.ruleId,hideFromHistory:!0});T(!0)}},[O,d]),F=r(async()=>{O&&(await p.remove(O.ruleId,O.type),n())},[O,p,n]);if(!O||!N)return null;const M=((e,o)=>{const n=[];return e.payloadCollection&&Object.entries(e.payloadCollection).forEach(([e,o])=>{o&&n.push(t(ce,{size:ue.XS,children:`• ${Gt(e).toLowerCase()}`},`payload-${e}`))}),e.codeAttributes&&Object.entries(e.codeAttributes).forEach(([e,o])=>{o&&n.push(t(ce,{size:ue.XS,children:`• ${Gt(e).toLowerCase()}`},`code-${e}`))}),e.headersCollection?.[Ue.HeaderKeys]?.length&&e.headersCollection[Ue.HeaderKeys].forEach((e,o)=>{e&&n.push(t(ce,{size:ue.XS,children:e},`header-${o}-${e}`))}),e.customInstrumentations&&(e.customInstrumentations[Ge.Java]?.forEach((e,i)=>{const a=new je(e.className,e.methodName);if(a.Verify()){0===i&&n.push(t(ce,{size:ue.XS,children:"Java Custom Probes:"},"java-custom-probes"));const e=a.toString();n.push(t(ce,{size:ue.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},`java-probe-${i}-${e}`))}}),e.customInstrumentations[Ge.Golang]?.forEach((e,i)=>{const a=new He(e.packageName,e.functionName,e.receiverName,e.receiverMethodName);if(a.Verify()){0===i&&n.push(t(ce,{size:ue.XS,children:"Golang Custom Probes:"},"golang-custom-probes"));const e=a.toString();n.push(t(ce,{size:ue.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},`golang-probe-${i}-${e}`))}})),n})(O,c);return e(o,{children:[t(re,{isOpen:!0,header:{icon:Jt(O.type),title:N.label,onClose:R,actions:[{id:"edit-rule-btn-edit",label:Pt.EDIT,icon:Na,active:S,onClick:$},{id:"edit-rule-btn-delete",label:Pt.DELETE,icon:xa,color:c.v2.colors.red[500],active:w,onClick:L}]},footer:{actions:S?[{"data-id":"edit-rule-btn-cancel",label:Pt.CANCEL,variant:ge.Secondary,onClick:D},{"data-id":"edit-rule-btn-save",label:Pt.SAVE,variant:ge.Primary,onClick:P}]:[]},children:t(pt,{$padding:"4px 12px 12px",children:S&&g?t(Ns,{}):t(Z,{$gap:16,children:e(zt,{bgTint:"1000",children:[e(zt,{bgTint:"900",children:[!u&&t(Bt,{conditions:O.conditions||[]}),t(zt,{bgTint:"800",cellsPerRow:2,items:uu(O,N)})]}),!u&&t(Dl,{readOnly:!0,scopes:O.sourceScopes??null}),!!M.length&&t(zt,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(zt,{bgTint:"800",children:M})}),!!N.supportedLanguages.length&&t(zt,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(zt,{bgTint:"800",children:t(pe,{$gap:12,$wrap:"wrap",children:N.supportedLanguages.map(e=>t(Yt,{label:Ye[e],leftIcon:Je(e),flex:"0.5"},e))})})})]})})})}),t(Gl,{target:"instrumentation rule",isOpen:w,onClose:()=>T(!1),onApprove:F}),t(jl,{isOpen:null!==k,onClose:()=>E(null),onApprove:_})]})};var hu;!function(e){e.Overview="overview",e.Pods="pods",e.PeerSources="peer-sources",e.Profiling="profiling",e.Sampling="sampling",e.Debug="debug"}(hu||(hu={}));const mu=({collapseIsDefaultOpen:e,isJumpToTarget:o,onClickRestartPod:n,namespace:i,podName:l,nodeName:r,startTime:s,agentInjectedStatus:c,odigosHealthStatus:d,k8sHealthStatus:u,children:p})=>{const{formatDurationAgo:h}=qt(),m=Zt(!!o),g=a(()=>({title:l,icon:Ja,withCopy:!0}),[l]),f=a(()=>{const e=[],t=Qt(c);t&&e.push(t);const o=Qt(d,qa,"health");o&&e.push(o);const n=Qt(u,Za,"health");return n&&e.push(n),e},[c,d,u]),b=a(()=>n?[{id:`restart-pod-${l}`,icon:Ka,label:Pt.RESTART_POD,onClick:()=>n(i,l)}]:void 0,[n,i,l]),v=a(()=>[{id:"nodeName",title:Ze.NODE,label:r,withCopy:!0},{id:"age",title:Ze.AGE,label:s?h(s,{style:"short"}):Ze.NOT_RUNNING,labelTooltip:s}],[r,s,h]);return t("div",{ref:m,children:t(zt,{bgTint:"900",richTitle:g,badges:f,dropDataActions:b,items:v,withCollapse:!0,collapseIsDefaultOpen:e,children:p})})},gu=f.div`
192
606
  display: flex;
193
607
  align-items: center;
194
608
  justify-content: space-between;
@@ -196,7 +610,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
196
610
  padding: ${({$noPadding:e})=>e?"0":"12px"};
197
611
  border-radius: 12px;
198
612
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
199
- `,cc=({podsOdigosHealthStatus:n,pods:o,noPadding:i})=>{const l=Jt(n?.status),r=Bt(n?.name),s=n?.message,{totalPodsCount:c,injectionsAsExpectedCount:d,odigosHealthyPodsCount:u,k8sHealthyPodsCount:p}=a(()=>({totalPodsCount:o?.length||0,injectionsAsExpectedCount:o?.reduce((e,t)=>e+(t.agentInjectedStatus?.status===Kt.Success?1:0),0)||0,odigosHealthyPodsCount:o?.reduce((e,t)=>e+(t.odigosHealthStatus?.status===Kt.Success?1:0),0)||0,k8sHealthyPodsCount:o?.reduce((e,t)=>e+(t.k8sHealthStatus?.status===Kt.Success?1:0),0)||0}),[o]);return o?.length&&n&&l?e(sc,{$noPadding:i,children:[t(Yt,{invertColors:!0,hideBackground:!0,status:l,title:r,subTitle:s}),e(ue,{$gap:8,children:[t(uc,{label:Je.PODS,count:c}),t(uc,{label:Je.INJECTIONS_AS_EXPECTED,count:d,total:c}),t(uc,{label:Je.ODIGOS_HEALTHY,icon:_i,count:u,total:c}),t(uc,{label:Je.KUBERNETES_HEALTHY,icon:Mi,count:p,total:c})]})]}):null},dc=g.div`
613
+ `,fu=({podsOdigosHealthStatus:o,pods:n,noPadding:i})=>{const l=oo(o?.status),r=Gt(o?.name),s=o?.message,{totalPodsCount:c,injectionsAsExpectedCount:d,odigosHealthyPodsCount:u,k8sHealthyPodsCount:p}=a(()=>({totalPodsCount:n?.length||0,injectionsAsExpectedCount:n?.reduce((e,t)=>e+(t.agentInjectedStatus?.status===eo.Success?1:0),0)||0,odigosHealthyPodsCount:n?.reduce((e,t)=>e+(t.odigosHealthStatus?.status===eo.Success?1:0),0)||0,k8sHealthyPodsCount:n?.reduce((e,t)=>e+(t.k8sHealthStatus?.status===eo.Success?1:0),0)||0}),[n]);return n?.length&&o&&l?e(gu,{$noPadding:i,children:[t(to,{invertColors:!0,hideBackground:!0,status:l,title:r,subTitle:s}),e(pe,{$gap:8,children:[t(vu,{label:Ze.PODS,count:c}),t(vu,{label:Ze.INJECTIONS_AS_EXPECTED,count:d,total:c}),t(vu,{label:Ze.ODIGOS_HEALTHY,icon:qa,count:u,total:c}),t(vu,{label:Ze.KUBERNETES_HEALTHY,icon:Za,count:p,total:c})]})]}):null},bu=f.div`
200
614
  display: flex;
201
615
  flex-direction: column;
202
616
  justify-content: center;
@@ -207,7 +621,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
207
621
  width: fit-content;
208
622
  border-radius: 8px;
209
623
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
210
- `,uc=({count:n,total:o,label:a,icon:i})=>{const l=f(),r=void 0===o?void 0:n===o?l.v2.colors.green[500]:l.v2.colors.red[500];return e(dc,{children:[e(ue,{$gap:0,$alignItems:"flex-end",children:[t(se,{size:de.L,color:r,weight:500,nowrap:!0,children:n}),void 0!==o&&t(se,{size:de.S,color:r,weight:500,nowrap:!0,children:`/${o}`})]}),e(ue,{$alignItems:"center",$gap:4,children:[i&&t(i,{size:16}),t(se,{size:de.XXXS,nowrap:!0,children:a})]})]})},pc=e=>{if(e.overrideProcessNum)return e.overrideProcessNum.toString();const t=e.identifyingAttributes?.find(({name:e})=>e===qt.PID)??e.identifyingAttributes?.find(({name:e})=>e===qt.VPID);return t?.value??null};var hc;!function(e){e.IdentifyingAttributes="identifying-attributes",e.InstrumentationLibraries="instrumentation-libraries"}(hc||(hc={}));const mc=({overrideProcessNum:n,healthy:i,healthStatus:l,identifyingAttributes:s,instrumentations:c,isJumpToTarget:d})=>{const u=f(),[p,h]=r(hc.IdentifyingAttributes),m=jt(!!d),{tabOptions:g,firstTabValue:b,bothTabsDisabled:v}=a(()=>{const e=c?.some(e=>!1===e.healthy),n=[{value:hc.IdentifyingAttributes,label:Je.IDENTIFYING_ATTRIBUTES,disabled:!s?.length,selectedBgColor:u.v2.colors.purple[500]},{value:hc.InstrumentationLibraries,label:Je.INSTRUMENTATION_LIBRARIES,icon:e?e=>t(Bi,{...e,fill:u.v2.colors.red[500]}):void 0,disabled:!c?.length,selectedBgColor:u.v2.colors.purple[500]}];return{tabOptions:n,firstTabValue:n.find(e=>!e.disabled)?.value||n[0].value,bothTabsDisabled:n.every(e=>e.disabled)}},[s,c]);o(()=>{b&&h(b)},[b]);const y=a(()=>{switch(p){case hc.IdentifyingAttributes:return t(q,{children:s?.map((e,n)=>t(yc,{label:e.name,value:e.value},`attr-${n}-${e.name}`))});case hc.InstrumentationLibraries:return t(q,{children:c?.map((e,n)=>t(yc,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},`instr-${n}-${e.name}`))});default:return null}},[p,s,c]),C=a(()=>pc({overrideProcessNum:n,identifyingAttributes:s}),[n,s]);return t("div",{ref:m,children:e(Dt,{bgTint:"800",richTitle:{title:C?`${Je.PROCESS} ${Je.PID(C)}`:Je.PROCESS_FALLBACK_NAME},renderOnRightSide:t(se,{color:i?ce.Success:ce.Error,size:de.XXXS,children:l?.message}),badges:[{key:"odigos-healthy",status:i?Re.Success:Re.Error,leftIcon:_i,label:i?Je.HEALTHY:Je.NOT_HEALTHY,textSize:de.XXXS,invertColors:!0,useSecondaryTone:!0}],withCollapse:!v,collapseIsDefaultOpen:d,children:[!v&&t(ge,{options:g,selected:p,setSelected:h}),!v&&y]})})},gc=g.div`
624
+ `,vu=({count:o,total:n,label:i,icon:a})=>{const l=b(),r=void 0===n?void 0:o===n?l.v2.colors.green[500]:l.v2.colors.red[500];return e(bu,{children:[e(pe,{$gap:0,$alignItems:"flex-end",children:[t(ce,{size:ue.L,color:r,weight:500,nowrap:!0,children:o}),void 0!==n&&t(ce,{size:ue.S,color:r,weight:500,nowrap:!0,children:`/${n}`})]}),e(pe,{$alignItems:"center",$gap:4,children:[a&&t(a,{size:16}),t(ce,{size:ue.XXXS,nowrap:!0,children:i})]})]})},yu=e=>{if(e.overrideProcessNum)return e.overrideProcessNum.toString();const t=e.identifyingAttributes?.find(({name:e})=>e===no.PID)??e.identifyingAttributes?.find(({name:e})=>e===no.VPID);return t?.value??null};var Cu;!function(e){e.IdentifyingAttributes="identifying-attributes",e.InstrumentationLibraries="instrumentation-libraries"}(Cu||(Cu={}));const Su=({overrideProcessNum:o,healthy:n,healthStatus:l,identifyingAttributes:r,instrumentations:c,isJumpToTarget:d})=>{const u=b(),[p,h]=s(Cu.IdentifyingAttributes),m=Zt(!!d),{tabOptions:g,firstTabValue:f,bothTabsDisabled:v}=a(()=>{const e=c?.some(e=>!1===e.healthy),o=[{value:Cu.IdentifyingAttributes,label:Ze.IDENTIFYING_ATTRIBUTES,disabled:!r?.length,selectedBgColor:u.v2.colors.purple[500]},{value:Cu.InstrumentationLibraries,label:Ze.INSTRUMENTATION_LIBRARIES,icon:e?e=>t(Qa,{...e,fill:u.v2.colors.red[500]}):void 0,disabled:!c?.length,selectedBgColor:u.v2.colors.purple[500]}];return{tabOptions:o,firstTabValue:o.find(e=>!e.disabled)?.value||o[0].value,bothTabsDisabled:o.every(e=>e.disabled)}},[r,c]);i(()=>{f&&h(f)},[f]);const y=a(()=>{switch(p){case Cu.IdentifyingAttributes:return t(Z,{children:r?.map((e,o)=>t(Eu,{label:e.name,value:e.value},`attr-${o}-${e.name}`))});case Cu.InstrumentationLibraries:return t(Z,{children:c?.map((e,o)=>t(Eu,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},`instr-${o}-${e.name}`))});default:return null}},[p,r,c]),C=a(()=>yu({overrideProcessNum:o,identifyingAttributes:r}),[o,r]);return t("div",{ref:m,children:e(zt,{bgTint:"800",richTitle:{title:C?`${Ze.PROCESS} ${Ze.PID(C)}`:Ze.PROCESS_FALLBACK_NAME},renderOnRightSide:t(ce,{color:n?de.Success:de.Error,size:ue.XXXS,children:l?.message}),badges:[{key:"odigos-healthy",status:n?Pe.Success:Pe.Error,leftIcon:qa,label:n?Ze.HEALTHY:Ze.NOT_HEALTHY,textSize:ue.XXXS,invertColors:!0,useSecondaryTone:!0}],withCollapse:!v,collapseIsDefaultOpen:d,children:[!v&&t(fe,{options:g,selected:p,setSelected:h}),!v&&y]})})},xu=f.div`
211
625
  display: flex;
212
626
  align-items: flex-start;
213
627
  gap: 8px;
@@ -216,23 +630,23 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
216
630
  &:hover {
217
631
  background-color: ${({theme:e})=>e.v2.colors.silver[700]};
218
632
  }
219
- `,fc=g(se)`
633
+ `,wu=f(ce)`
220
634
  flex: 0 0 30%;
221
- `,bc=g(se)`
635
+ `,Tu=f(ce)`
222
636
  flex: 1 1 auto;
223
637
  min-width: 0;
224
- `,vc=g(ue)`
638
+ `,ku=f(pe)`
225
639
  flex: 1 1 auto;
226
640
  justify-content: flex-end;
227
641
  min-width: 0;
228
- `,yc=({label:n,value:o,isStandardLibrary:a,healthy:i,message:l})=>{const r="boolean"==typeof i;return e(gc,{children:[t(fc,{size:de.XXS,color:ce.Secondary,children:n}),o&&t(bc,{size:de.XXS,color:ce.Primary,align:"right",children:o}),(r||a)&&e(vc,{children:[a&&t(je,{status:Re.Info,label:Je.STANDARD,textSize:de.XXXS,invertColors:!0}),r&&t(je,{status:i?Re.Success:Re.Error,label:i?Je.HEALTHY:Je.NOT_HEALTHY,textSize:de.XXXS,invertColors:!0,tooltip:l??void 0})]})]})},Cc=p(null),Sc=({value:e,children:n})=>t(Cc.Provider,{value:e,children:n}),wc=({podContainers:e,sourceContainers:n,jumpToTarget:o})=>{const i=e??[],l=a(()=>({title:Je.CONTAINERS,titleSize:de.XS,badge:{label:i.length}}),[i.length]),r=a(()=>{const e=new Map;return n?.forEach(t=>e.set(t.containerName,t)),e},[n]);return t(Dt,{bgTint:"800",richTitle:l,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(q,{$gap:8,children:i.map(e=>{const n=o?.containerName===e.containerName;return t(kc,{...e,language:Zt(r.get(e.containerName)),jumpToTarget:n?o:null},`pod-container-${e.containerName}`)})})})},xc=g.div`
642
+ `,Eu=({label:o,value:n,isStandardLibrary:i,healthy:a,message:l})=>{const r="boolean"==typeof a;return e(xu,{children:[t(wu,{size:ue.XXS,color:de.Secondary,children:o}),n&&t(Tu,{size:ue.XXS,color:de.Primary,align:"right",children:n}),(r||i)&&e(ku,{children:[i&&t(Ke,{status:Pe.Info,label:Ze.STANDARD,textSize:ue.XXXS,invertColors:!0}),r&&t(Ke,{status:a?Pe.Success:Pe.Error,label:a?Ze.HEALTHY:Ze.NOT_HEALTHY,textSize:ue.XXXS,invertColors:!0,tooltip:l??void 0})]})]})},Iu=h(null),Ou=({value:e,children:o})=>t(Iu.Provider,{value:e,children:o}),Nu=({podContainers:e,sourceContainers:o,jumpToTarget:n})=>{const i=e??[],l=a(()=>({title:Ze.CONTAINERS,titleSize:ue.XS,badge:{label:i.length}}),[i.length]),r=a(()=>{const e=new Map;return o?.forEach(t=>e.set(t.containerName,t)),e},[o]);return t(zt,{bgTint:"800",richTitle:l,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Z,{$gap:8,children:i.map(e=>{const o=n?.containerName===e.containerName;return t(Au,{...e,language:io(r.get(e.containerName)),jumpToTarget:o?n:null},`pod-container-${e.containerName}`)})})})},$u=f.div`
229
643
  display: flex;
230
644
  flex-direction: column;
231
645
  gap: 12px;
232
646
  padding: 8px 12px;
233
647
  border-radius: 8px;
234
648
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
235
- `,kc=({language:n,containerName:o,otelDistroName:i,runningStartedTime:l,started:r,ready:s,restartCount:c,isCrashLoop:d,waitingReasonEnum:u,waitingMessage:p,odigosHealthStatus:h,k8sHealthStatus:m,processes:g,jumpToTarget:f})=>{const b=!!f,v=b&&!f?.processPid,{formatDurationAgo:y}=Ht(),C=jt(v),S=a(()=>({title:o,icon:n?Ke(n):Xi,iconWithWrapper:!0}),[o,n]),w=a(()=>{const e=[],t=Wt({status:i?Kt.Success:Kt.Disabled,reasonEnum:i?Je.INSTRUMENTED_WITH_DISTRO(i):Je.UNINSTRUMENTED,message:""});t&&e.push(t);const n=Wt(h,_i,"health");n&&e.push(n);const o=Wt(m,Mi,"health");return o&&e.push(o),e},[m,h,i]),x=a(()=>[{id:"runningTime",title:Je.RUNNING_TIME,label:l?y(l,{style:"short"}):Je.NOT_RUNNING,labelTooltip:`${Je.RUNNING_TIME_TOOLTIP}. (${l})`},{id:"blank",spacer:!0},{id:"started",badge:{status:r?Re.Success:Re.Disabled,leftIcon:r?vi:yi,label:r?Je.STARTED:Je.NOT_STARTED,textSize:de.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"ready",badge:{status:s?Re.Success:Re.Disabled,leftIcon:s?vi:yi,label:s?Je.READY:Je.NOT_READY,textSize:de.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"isCrashLoop",badge:{status:d?Re.Error:Re.Success,leftIcon:d?yi:vi,label:d?Je.CRASHLOOP:Je.NO_CRASHLOOP,textSize:de.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"restartCount",title:Je.RESTARTS,badge:{status:c?Re.Error:void 0,label:c||0,textSize:de.XXXS}}],[l,y,r,s,d,c]),k=a(()=>p?Bt(u):"",[p,u]);return t("div",{ref:C,children:e(Dt,{bgTint:"750",richTitle:S,badges:w,items:x,withCollapse:!0,collapseIsDefaultOpen:b,children:[p&&t(xc,{children:e(ue,{$gap:10,$alignItems:"center",children:[t(Ut,{variant:Qt.Pink,leftIcon:Mi,label:k}),t(se,{size:de.XXXS,color:ce.Error,children:p})]})}),(g??[]).map((e,n)=>{const a=n+1,i=b&&(l=f,r=e,!!l?.processPid&&pc({identifyingAttributes:r.identifyingAttributes})===l.processPid);var l,r;return t(mc,{...e,overrideProcessNum:a,isJumpToTarget:i},`pod-container-${o}-process-${a}`)})]})})},Tc=({podName:e,namespace:n,hasRestarted:o})=>{const i=a(()=>({title:Je.DEBUG_COMMANDS,titleSize:de.XS}),[]),l=a(()=>[{label:Je.GET_POD_YAML,value:`kubectl get pod ${e} -n ${n} -o yaml`},{label:Je.DESCRIBE_POD,value:`kubectl describe pod ${e} -n ${n}`},{label:Je.GET_POD_LOGS,value:`kubectl logs ${e} -n ${n}${o?" -p":""}`}],[e,n,o]);return t(Dt,{bgTint:"800",richTitle:i,withCollapse:!0,children:l.map(({label:e,value:n})=>t(en,{bgTint:"700",label:e,value:n},e))})},$c=({source:o,onClickRestartPod:i})=>{const{jumpToTarget:l}=(()=>{const e=h(Cc);if(!e)throw new Error("useJumpToTargetContext must be used within a JumpToTargetContextProvider");return e})(),r=l?.tab===lc.Pods?l:null,s=o?.pods??[],c=s.length>0,d=a(()=>s.some(e=>e.containers?.some(e=>e.restartCount&&e.restartCount>0)),[s]),u=a(()=>({title:Je.PODS,badge:{label:s.length}}),[s.length]);return t(q,{$gap:12,children:c?e(n,{children:[t(cc,{podsOdigosHealthStatus:o.podsOdigosHealthStatus,pods:s}),t(Dt,{bgTint:"1000",richTitle:u,children:s.map(n=>{const a=r?.podName===n.podName,l=a&&!r?.containerName;return e(rc,{...n,namespace:o.id.namespace,onClickRestartPod:i,collapseIsDefaultOpen:a,isJumpToTarget:l,children:[t(Tc,{podName:n.podName,namespace:o.id.namespace,hasRestarted:d}),t(wc,{podContainers:n.containers,sourceContainers:o.containers,jumpToTarget:a?r:null})]},`pod-${n.podName}`)})})]}):t(pt,{$height:"70vh",children:t(Ie,{title:Je.NO_RUNNING_PODS,subTitle:Je.NO_RUNNING_PODS_SUBTITLE})})})},Ic=({source:n})=>{const o=a(()=>n.serviceName||n.id.name,[n]),{sourcesApi:i}=gl(),{data:l,loading:r,refetch:s}=i.usePeerSources({serviceName:o},{fetchPolicy:"network-only"}),c=l?.peerSources??null;return!c||r?t(pt,r?{$height:"70vh",children:t(bt,{withSpinner:!0})}:{$height:"70vh",children:t(Ie,{subTitle:Je.COULD_NOT_FETCH_PEER_SOURCES})}):e(ue,{$gap:16,$alignItems:"flex-start",children:[t(Ec,{icon:Vi,title:Je.INBOUND,subTitle:Je.INBOUND_DESCRIPTION(o),onRefresh:s,items:c?.inbound??[]}),t(Ec,{icon:Ui,title:Je.OUTBOUND,subTitle:Je.OUTBOUND_DESCRIPTION(o),onRefresh:s,items:c?.outbound??[]})]})},Ec=({icon:n,title:o,subTitle:i,onRefresh:l,items:s})=>{const[c,d]=r(""),u=a(()=>s.filter(e=>e.serviceName.toLowerCase().includes(c.toLowerCase())),[s,c]);return e(Dt,{bgTint:"1000",richTitle:{icon:n,title:o,titleSize:de.XS,subTitle:i,subTitleSize:de.XXXS,badge:{label:s.length}},actions:[{id:"refresh",type:tn.Button,buttonProps:{variant:me.Secondary,size:he.S,leftIcon:zi,onClick:l}}],children:[t(nn,{value:c,onChange:d,width:"100%"}),t(on,{height:"calc(100vh - 284px)",gap:4,elements:u.length||c?!u.length&&c?[t(pt,{$height:"50vh",children:t(Ie,{icon:n,title:Je.NO_RESULTS,subTitle:Je.NO_RESULTS_FOR_FILTER(c)})},"no-results")]:u.map(e=>t(Nc,{...e},`${o}-${e.serviceName}`)):[t(pt,{$height:"50vh",children:t(Ie,{icon:n,title:`No ${o} connections yet`,subTitle:o===Je.INBOUND?Je.NO_INBOUND_CONNECTIONS_DESCRIPTION:Je.NO_OUTBOUND_CONNECTIONS_DESCRIPTION})},"no-data")]})]})},Ac=g.div`
649
+ `,Au=({language:o,containerName:n,otelDistroName:i,runningStartedTime:l,started:r,ready:s,restartCount:c,isCrashLoop:d,waitingReasonEnum:u,waitingMessage:p,odigosHealthStatus:h,k8sHealthStatus:m,processes:g,jumpToTarget:f})=>{const b=!!f,v=b&&!f?.processPid,{formatDurationAgo:y}=qt(),C=Zt(v),S=a(()=>({title:n,icon:o?Je(o):el,iconWithWrapper:!0}),[n,o]),x=a(()=>{const e=[],t=Qt({status:i?eo.Success:eo.Disabled,reasonEnum:i?Ze.INSTRUMENTED_WITH_DISTRO(i):Ze.UNINSTRUMENTED,message:""});t&&e.push(t);const o=Qt(h,qa,"health");o&&e.push(o);const n=Qt(m,Za,"health");return n&&e.push(n),e},[m,h,i]),w=a(()=>[{id:"runningTime",title:Ze.RUNNING_TIME,label:l?y(l,{style:"short"}):Ze.NOT_RUNNING,labelTooltip:`${Ze.RUNNING_TIME_TOOLTIP}. (${l})`},{id:"blank",spacer:!0},{id:"started",badge:{status:r?Pe.Success:Pe.Disabled,leftIcon:r?ka:Ea,label:r?Ze.STARTED:Ze.NOT_STARTED,textSize:ue.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"ready",badge:{status:s?Pe.Success:Pe.Disabled,leftIcon:s?ka:Ea,label:s?Ze.READY:Ze.NOT_READY,textSize:ue.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"isCrashLoop",badge:{status:d?Pe.Error:Pe.Success,leftIcon:d?Ea:ka,label:d?Ze.CRASHLOOP:Ze.NO_CRASHLOOP,textSize:ue.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"restartCount",title:Ze.RESTARTS,badge:{status:c?Pe.Error:void 0,label:c||0,textSize:ue.XXXS}}],[l,y,r,s,d,c]),T=a(()=>p?Gt(u):"",[p,u]);return t("div",{ref:C,children:e(zt,{bgTint:"750",richTitle:S,badges:x,items:w,withCollapse:!0,collapseIsDefaultOpen:b,children:[p&&t($u,{children:e(pe,{$gap:10,$alignItems:"center",children:[t(Yt,{variant:ao.Pink,leftIcon:Za,label:T}),t(ce,{size:ue.XXXS,color:de.Error,children:p})]})}),(g??[]).map((e,o)=>{const i=o+1,a=b&&(l=f,r=e,!!l?.processPid&&yu({identifyingAttributes:r.identifyingAttributes})===l.processPid);var l,r;return t(Su,{...e,overrideProcessNum:i,isJumpToTarget:a},`pod-container-${n}-process-${i}`)})]})})},Ru=({podName:e,namespace:o,hasRestarted:n})=>{const i=a(()=>({title:Ze.DEBUG_COMMANDS,titleSize:ue.XS}),[]),l=a(()=>[{label:Ze.GET_POD_YAML,value:`kubectl get pod ${e} -n ${o} -o yaml`},{label:Ze.DESCRIBE_POD,value:`kubectl describe pod ${e} -n ${o}`},{label:Ze.GET_POD_LOGS,value:`kubectl logs ${e} -n ${o}${n?" -p":""}`}],[e,o,n]);return t(zt,{bgTint:"800",richTitle:i,withCollapse:!0,children:l.map(({label:e,value:o})=>t(lo,{bgTint:"700",label:e,value:o},e))})},Du=({source:n,onClickRestartPod:i})=>{const{jumpToTarget:l}=(()=>{const e=m(Iu);if(!e)throw new Error("useJumpToTargetContext must be used within a JumpToTargetContextProvider");return e})(),r=l?.tab===hu.Pods?l:null,s=n?.pods??[],c=s.length>0,d=a(()=>s.some(e=>e.containers?.some(e=>e.restartCount&&e.restartCount>0)),[s]),u=a(()=>({title:Ze.PODS,badge:{label:s.length}}),[s.length]);return t(Z,{$gap:12,children:c?e(o,{children:[t(fu,{podsOdigosHealthStatus:n.podsOdigosHealthStatus,pods:s}),t(zt,{bgTint:"1000",richTitle:u,children:s.map(o=>{const a=r?.podName===o.podName,l=a&&!r?.containerName;return e(mu,{...o,namespace:n.id.namespace,onClickRestartPod:i,collapseIsDefaultOpen:a,isJumpToTarget:l,children:[t(Ru,{podName:o.podName,namespace:n.id.namespace,hasRestarted:d}),t(Nu,{podContainers:o.containers,sourceContainers:n.containers,jumpToTarget:a?r:null})]},`pod-${o.podName}`)})})]}):t(mt,{$height:"70vh",children:t($e,{title:Ze.NO_RUNNING_PODS,subTitle:Ze.NO_RUNNING_PODS_SUBTITLE})})})},_u=({source:o})=>{const n=a(()=>o.serviceName||o.id.name,[o]),{sourcesApi:i}=Nl(),{data:l,loading:r,refetch:s}=i.usePeerSources({serviceName:n},{fetchPolicy:"network-only"}),c=l?.peerSources??null;return!c||r?t(mt,r?{$height:"70vh",children:t(yt,{withSpinner:!0})}:{$height:"70vh",children:t($e,{subTitle:Ze.COULD_NOT_FETCH_PEER_SOURCES})}):e(pe,{$gap:16,$alignItems:"flex-start",children:[t(Pu,{icon:tl,title:Ze.INBOUND,subTitle:Ze.INBOUND_DESCRIPTION(n),onRefresh:s,items:c?.inbound??[]}),t(Pu,{icon:ol,title:Ze.OUTBOUND,subTitle:Ze.OUTBOUND_DESCRIPTION(n),onRefresh:s,items:c?.outbound??[]})]})},Pu=({icon:o,title:n,subTitle:i,onRefresh:l,items:r})=>{const[c,d]=s(""),u=a(()=>r.filter(e=>e.serviceName.toLowerCase().includes(c.toLowerCase())),[r,c]);return e(zt,{bgTint:"1000",richTitle:{icon:o,title:n,titleSize:ue.XS,subTitle:i,subTitleSize:ue.XXXS,badge:{label:r.length}},actions:[{id:"refresh",type:ro.Button,buttonProps:{variant:ge.Secondary,size:me.S,leftIcon:Ka,onClick:l}}],children:[t(so,{value:c,onChange:d,width:"100%"}),t(co,{height:"calc(100vh - 284px)",gap:4,elements:u.length||c?!u.length&&c?[t(mt,{$height:"50vh",children:t($e,{icon:o,title:Ze.NO_RESULTS,subTitle:Ze.NO_RESULTS_FOR_FILTER(c)})},"no-results")]:u.map(e=>t(Fu,{...e},`${n}-${e.serviceName}`)):[t(mt,{$height:"50vh",children:t($e,{icon:o,title:`No ${n} connections yet`,subTitle:n===Ze.INBOUND?Ze.NO_INBOUND_CONNECTIONS_DESCRIPTION:Ze.NO_OUTBOUND_CONNECTIONS_DESCRIPTION})},"no-data")]})]})},Lu=f.div`
236
650
  display: flex;
237
651
  align-items: center;
238
652
  justify-content: space-between;
@@ -240,15 +654,15 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
240
654
  padding: 8px;
241
655
  border-radius: 8px;
242
656
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
243
- ${({$withClick:e})=>e&&b`
657
+ ${({$withClick:e})=>e&&v`
244
658
  cursor: pointer;
245
659
  &:hover {
246
660
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
247
661
  }
248
662
  `}
249
- `,Nc=({serviceName:n,isVirtual:o,nodeAttributes:i})=>{const l=an(e=>e.drawerEntityId),{items:r}=gl().sourcesApi.useSources(),s=a(()=>r.find(e=>e.id.name===n||e.serviceName===n),[r,n]),c=a(()=>s&&JSON.stringify(ln(s))!==JSON.stringify(ln(l)),[s,l]),d=a(()=>{if(o){const e=Object.fromEntries((i??[]).map(({key:e,value:t})=>[e,t]));return[rn({serviceName:n,attributes:e})]}if(n?.toLowerCase()===nr)return[Gi];const e=s?sn(s):void 0;return e?.length?e:[Xi]},[o,i,n,s]),u=c?()=>{const{setDrawerType:e,setDrawerEntityId:t}=an.getState();e(wt.Source),t({namespace:s?.id.namespace??"",name:s?.id.name??"",kind:s?.id.kind??""})}:void 0;return e(Ac,{onClick:u,$withClick:!!u,children:[e(ue,{$gap:8,children:[t(cn,{icons:d}),t(se,{size:de.XXS,children:n})]}),o&&t(je,{status:Re.Info,label:Je.VIRTUAL,textSize:de.XXXS,invertColors:!0,tooltip:Je.VIRTUAL_TOOLTIP})]})},Oc=e=>{if("string"==typeof e)return e;if(e&&"object"==typeof e){const t=e;if("string"==typeof t.k8sActualManifest)return t.k8sActualManifest;if("string"==typeof t.manifest)return t.manifest}},Rc=({source:n})=>{const i=f(),{k8sManifestApi:l}=gl(),[s,c]=r(!0),[d,u]=r(void 0),[p,h]=r(!0),[m,g]=r(void 0);o(()=>{l.fetch({namespace:n.id.namespace,kind:n.id.kind,name:n.id.name}).then(({data:e})=>u(Oc(e))).finally(()=>c(!1)),l.fetch({namespace:n.id.namespace,kind:dn.InstrumentationConfig,name:`${n.id.kind}-${n.id.name}`.toLowerCase()}).then(({data:e})=>g(Oc(e))).finally(()=>h(!1))},[l,n.id.namespace,n.id.kind,n.id.name]);const b=a(()=>[{label:Je.DESCRIBE_POD,value:`kubectl describe ${n.id.kind} ${n.id.name} -n ${n.id.namespace}`},{label:Je.GET_POD_YAML,value:`kubectl get ${n.id.kind} ${n.id.name} -n ${n.id.namespace} -o yaml`},{label:Je.GET_POD_YAML,value:`kubectl get ${dn.InstrumentationConfig} ${n.id.kind}-${n.id.name} -n ${n.id.namespace} -o yaml`}],[n.id.kind,n.id.name,n.id.namespace]);return e(Dt,{bgTint:"1000",children:[t(Dt,{bgTint:"900",richTitle:{icon:Hi,title:Je.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:b.map(({label:e,value:n},o)=>t(en,{label:e,value:n},`debug-cmd-${o}-${e}`))}),s?t(ut,{size:1}):t(Rl,{bgTint:"800",codeBgColor:i.v2.colors.silver[900],title:`${n.id.kind} YAML`,yaml:d}),p?t(ut,{size:1}):t(Rl,{bgTint:"800",codeBgColor:i.v2.colors.silver[900],title:"Instrumentation Config YAML",yaml:m})]})},Dc=({title:n,children:o})=>e(q,{$gap:8,children:[t(se,{size:de.XXXS,color:ce.Secondary,children:n}),o]}),Pc=({source:n})=>{const o=a(()=>{const[e,t]=un(n.telemetryMetrics?.[0]?.throughputBytes||0).split(" ");return{value:e,units:t}},[n]);return t(Dc,{title:Je.THROUGHPUT_LAST_10_SECONDS,children:e(ue,{$alignItems:"flex-end",$gap:4,children:[t(se,{size:de.L,children:o.value}),t(se,{size:de.XS,variant:Tt.Span,children:o.units})]})})},Fc=({source:n})=>{const{CopyButton:o}=pn();return t(Dc,{title:Je.NAMESPACE,children:e(ue,{children:[t(Ut,{variant:Qt.Blue,label:n.id.namespace}),t(o,{value:n.id.namespace,size:ft.XS})]})})},Lc=({source:e})=>t(Dc,{title:Je.KIND,children:t(ue,{children:t(Ut,{variant:Qt.Blue,label:e.id.kind})})}),_c=({source:n})=>{const{CopyButton:o}=pn();return t(Dc,{title:Je.NAME,children:e(ue,{children:[t(Ut,{variant:Qt.Blue,label:n.id.name}),t(o,{value:n.id.name,size:ft.XS})]})})},Mc=({source:n})=>{const{isVm:o}=y();return t(Dt,{children:e(ue,{$gap:24,$alignItems:"flex-start",$justifyContent:"flex-start",$wrap:"wrap",children:[!o&&t(Pc,{source:n}),!o&&t(Fc,{source:n}),t(Lc,{source:n}),t(_c,{source:n})]})})},zc=({source:e})=>e.pods?.length?t(Dt,{bgTint:"900",children:t(cc,{podsOdigosHealthStatus:e.podsOdigosHealthStatus,pods:e.pods,noPadding:!0})}):null,Bc=({source:e})=>{const n=a(()=>e.workloadOdigosHealthStatus?{status:e.workloadOdigosHealthStatus.status?hn(e.workloadOdigosHealthStatus.status):Re.Unknown,title:Bt(e.workloadOdigosHealthStatus.reasonEnum),subTitle:e.workloadOdigosHealthStatus.message}:null,[e]);return n?t(Yt,{...n,width:"100%"}):null},Xc="calc(50% - 6px)",Vc=({source:n,onClickRollout:o,onClickRollback:i})=>{const l=a(()=>{const{status:e,reasonEnum:t,message:a}=n.conditions?.rollout||{},i=Jt(e);if(!i)return null;return{status:i,title:t?.toLowerCase().includes("rollout")?Bt(t):`${Je.ROLLOUT} ${Bt(t)}`,subTitle:a,action:i!==Re.Success?{icon:zi,tooltip:Je.ROLLOUT_RESTART,onClick:o}:void 0}},[n]),r=a(()=>{const{status:e,reasonEnum:t,message:o}=n.autoRollback?.autoRollbackStatus||{},a=Jt(e);if(!a)return null;return{status:a,title:t?.toLowerCase().includes("rollback")?Bt(t):`${Je.ROLLBACK} ${Bt(t)}`,subTitle:o,action:a!==Re.Success?{icon:zi,tooltip:Je.ROLLBACK_RECOVER,onClick:i}:void 0}},[n]);return l||r?e(ue,{$gap:12,$alignItems:"stretch",children:[l&&t(Yt,{invertColors:!0,slim:!0,width:r?Xc:"100%",...l}),r&&t(Yt,{invertColors:!0,slim:!0,width:Xc,...r})]}):null},Uc=p(null),Gc=g.div`
663
+ `,Fu=({serviceName:o,isVirtual:n,nodeAttributes:i})=>{const l=uo(e=>e.drawerEntityId),{items:r}=Nl().sourcesApi.useSources(),s=a(()=>r.find(e=>e.id.name===o||e.serviceName===o),[r,o]),c=a(()=>s&&JSON.stringify(po(s))!==JSON.stringify(po(l)),[s,l]),d=a(()=>{if(n){const e=Object.fromEntries((i??[]).map(({key:e,value:t})=>[e,t]));return[ho({serviceName:o,attributes:e})]}if(o?.toLowerCase()===yr)return[nl];const e=s?mo(s):void 0;return e?.length?e:[el]},[n,i,o,s]),u=c?()=>{const{setDrawerType:e,setDrawerEntityId:t}=uo.getState();e(Tt.Source),t({namespace:s?.id.namespace??"",name:s?.id.name??"",kind:s?.id.kind??""})}:void 0;return e(Lu,{onClick:u,$withClick:!!u,children:[e(pe,{$gap:8,children:[t(go,{icons:d}),t(ce,{size:ue.XXS,children:o})]}),n&&t(Ke,{status:Pe.Info,label:Ze.VIRTUAL,textSize:ue.XXXS,invertColors:!0,tooltip:Ze.VIRTUAL_TOOLTIP})]})},Mu=e=>{if("string"==typeof e)return e;if(e&&"object"==typeof e){const t=e;if("string"==typeof t.k8sActualManifest)return t.k8sActualManifest;if("string"==typeof t.manifest)return t.manifest}},zu=({source:o})=>{const n=b(),{k8sManifestApi:l}=Nl(),[r,c]=s(!0),[d,u]=s(void 0),[p,h]=s(!0),[m,g]=s(void 0);i(()=>{l.fetch({namespace:o.id.namespace,kind:o.id.kind,name:o.id.name}).then(({data:e})=>u(Mu(e))).finally(()=>c(!1)),l.fetch({namespace:o.id.namespace,kind:fo.InstrumentationConfig,name:`${o.id.kind}-${o.id.name}`.toLowerCase()}).then(({data:e})=>g(Mu(e))).finally(()=>h(!1))},[l,o.id.namespace,o.id.kind,o.id.name]);const f=a(()=>[{label:Ze.DESCRIBE_POD,value:`kubectl describe ${o.id.kind} ${o.id.name} -n ${o.id.namespace}`},{label:Ze.GET_POD_YAML,value:`kubectl get ${o.id.kind} ${o.id.name} -n ${o.id.namespace} -o yaml`},{label:Ze.GET_POD_YAML,value:`kubectl get ${fo.InstrumentationConfig} ${o.id.kind}-${o.id.name} -n ${o.id.namespace} -o yaml`}],[o.id.kind,o.id.name,o.id.namespace]);return e(zt,{bgTint:"1000",children:[t(zt,{bgTint:"900",richTitle:{icon:il,title:Ze.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:f.map(({label:e,value:o},n)=>t(lo,{label:e,value:o},`debug-cmd-${n}-${e}`))}),r?t(ht,{size:1}):t(Wl,{bgTint:"800",codeBgColor:n.v2.colors.silver[900],title:`${o.id.kind} YAML`,yaml:d}),p?t(ht,{size:1}):t(Wl,{bgTint:"800",codeBgColor:n.v2.colors.silver[900],title:"Instrumentation Config YAML",yaml:m})]})},Bu=({title:o,children:n})=>e(Z,{$gap:8,children:[t(ce,{size:ue.XXXS,color:de.Secondary,children:o}),n]}),Xu=({source:o})=>{const n=a(()=>{const[e,t]=bo(o.telemetryMetrics?.[0]?.throughputBytes||0).split(" ");return{value:e,units:t}},[o]);return t(Bu,{title:Ze.THROUGHPUT_LAST_10_SECONDS,children:e(pe,{$alignItems:"flex-end",$gap:4,children:[t(ce,{size:ue.L,children:n.value}),t(ce,{size:ue.XS,variant:It.Span,children:n.units})]})})},Uu=({source:o})=>{const{CopyButton:n}=Dt();return t(Bu,{title:Ze.NAMESPACE,children:e(pe,{children:[t(Yt,{variant:ao.Blue,label:o.id.namespace}),t(n,{value:o.id.namespace,size:vt.XS})]})})},Vu=({source:e})=>t(Bu,{title:Ze.KIND,children:t(pe,{children:t(Yt,{variant:ao.Blue,label:e.id.kind})})}),Hu=({source:o})=>{const{CopyButton:n}=Dt();return t(Bu,{title:Ze.NAME,children:e(pe,{children:[t(Yt,{variant:ao.Blue,label:o.id.name}),t(n,{value:o.id.name,size:vt.XS})]})})},ju=({source:o})=>{const{isVm:n}=C();return t(zt,{children:e(pe,{$gap:24,$alignItems:"flex-start",$justifyContent:"flex-start",$wrap:"wrap",children:[!n&&t(Xu,{source:o}),!n&&t(Uu,{source:o}),t(Vu,{source:o}),t(Hu,{source:o})]})})},Gu=({source:e})=>e.pods?.length?t(zt,{bgTint:"900",children:t(fu,{podsOdigosHealthStatus:e.podsOdigosHealthStatus,pods:e.pods,noPadding:!0})}):null,Wu=({source:e})=>{const o=a(()=>e.workloadOdigosHealthStatus?{status:e.workloadOdigosHealthStatus.status?vo(e.workloadOdigosHealthStatus.status):Pe.Unknown,title:Gt(e.workloadOdigosHealthStatus.reasonEnum),subTitle:e.workloadOdigosHealthStatus.message}:null,[e]);return o?t(to,{...o,width:"100%"}):null},Ku="calc(50% - 6px)",Yu=({source:o,onClickRollout:n,onClickRollback:i})=>{const l=a(()=>{const{status:e,reasonEnum:t,message:i}=o.conditions?.rollout||{},a=oo(e);if(!a)return null;return{status:a,title:t?.toLowerCase().includes("rollout")?Gt(t):`${Ze.ROLLOUT} ${Gt(t)}`,subTitle:i,action:a!==Pe.Success?{icon:Ka,tooltip:Ze.ROLLOUT_RESTART,onClick:n}:void 0}},[o]),r=a(()=>{const{status:e,reasonEnum:t,message:n}=o.autoRollback?.autoRollbackStatus||{},a=oo(e);if(!a)return null;return{status:a,title:t?.toLowerCase().includes("rollback")?Gt(t):`${Ze.ROLLBACK} ${Gt(t)}`,subTitle:n,action:a!==Pe.Success?{icon:Ka,tooltip:Ze.ROLLBACK_RECOVER,onClick:i}:void 0}},[o]);return l||r?e(pe,{$gap:12,$alignItems:"stretch",children:[l&&t(to,{invertColors:!0,slim:!0,width:r?Ku:"100%",...l}),r&&t(to,{invertColors:!0,slim:!0,width:Ku,...r})]}):null},Ju=h(null),qu=f.div`
250
664
  position: relative;
251
- `,Hc=({children:e})=>{const n=i(null);return t(Gc,{ref:n,children:t(Uc.Provider,{value:n,children:e})})},jc=g.div`
665
+ `,Zu=({children:e})=>{const o=l(null);return t(qu,{ref:o,children:t(Ju.Provider,{value:o,children:e})})},Qu=f.div`
252
666
  position: fixed;
253
667
  top: ${({$coords:e})=>e.top}px;
254
668
  right: ${({$coords:e})=>e.right}px;
@@ -262,14 +676,14 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
262
676
  padding: 12px 16px;
263
677
  border-radius: 12px;
264
678
  background-color: ${({theme:e})=>e.v2.colors.silver[750]};
265
- `,Wc=g.div`
679
+ `,ep=f.div`
266
680
  display: flex;
267
681
  align-items: flex-end;
268
682
  justify-content: space-between;
269
683
  gap: 8px;
270
- `,Kc=g.div`
684
+ `,tp=f.div`
271
685
  flex: 1;
272
- `,Yc=({width:n,onClose:o,onSave:a,saveTooltip:i,onDelete:l,deleteTooltip:s,title:c,subTitle:d,warning:u,children:p,pushButtonsWith:g})=>{const b=f(),v=h(Uc),[y,C]=r(null);return mn(v??{current:null},o),m(()=>{const e=v?.current?.getBoundingClientRect();e&&C({top:e.bottom+4,right:window.innerWidth-e.left-24})},[v]),y?or(e(jc,{$coords:y,$width:n,"data-ignore-outside-click":"true",children:[e(q,{$gap:4,children:[t(se,{size:de.XXS,children:c}),t(se,{size:de.XXXS,color:ce.Secondary,children:d})]}),e(Wc,{children:[t(Kc,{children:p}),e(ue,{$gap:8,$width:"fit-content",$margin:`0 0 ${g||0} 0`,children:[t(pe,{variant:me.Secondary,onClick:l,leftIcon:gi,tooltip:s,hideTooltipIcon:!0,iconSize:16,size:he.S,textColor:b.v2.colors.red[500]}),t(pe,{variant:me.Primary,onClick:a,leftIcon:Ni,tooltip:i,hideTooltipIcon:!0,iconSize:16,size:he.S})]})]}),t("div",{children:t(Oe,{status:Re.Warning,message:u})})]}),document.body):null},Jc=({language:n,overridden:o,onOverride:i,defaultValues:l})=>{const{tier:s}=y(),{formData:c,handleFormChange:d,resetFormData:u}=Lt(l),p=a(()=>{if(!n)return[];const e=gn[n].community,t=s===xt.Onprem?gn[n].enterprise:[];return e.concat(t).map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})).sort((e,t)=>e.label.localeCompare(t.label))},[n,s]),[h,m]=r(!1),[g,f]=r(!1),b=()=>{h||(g&&u(),f(e=>!e))};return e(ue,{$gap:4,$alignItems:"center",children:[o?t(je,{status:Re.Info,invertColors:!0,label:Je.OVERIDDEN}):null,e(Hc,{children:[t(ze,{text:Je.OVERRIDE_OTEL_DISTRO_NAME,children:t(gt,{icon:wi,onClick:b})}),g&&t(Yc,{width:"500px",onClose:b,onSave:async()=>{m(!0),await i(c),m(!1),b()},saveTooltip:Je.OVERRIDE_OTEL_DISTRO_NAME_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await i({otelDistroName:null}),m(!1),b()},deleteTooltip:Je.OVERRIDE_OTEL_DISTRO_NAME_DELETE_TOOLTIP,title:Je.OVERRIDE_OTEL_DISTRO_NAME,subTitle:Je.OVERRIDE_OTEL_DISTRO_NAME_SUBTITLE,warning:Je.OVERRIDE_OTEL_DISTRO_NAME_WARNING,children:t(mt,{label:Je.OTEL_DISTRO_NAME,options:p,values:c.otelDistroName?[c.otelDistroName]:[],setValues:e=>d("otelDistroName",e[0])})})]})]})},qc=({overridden:n,onOverride:o,defaultValues:i,originalValues:l})=>{const{addNotification:s}=Xt(),{formData:c,handleFormChange:d,resetFormData:u}=Lt(i),p=a(()=>fn.map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})),[]),[h,m]=r(!1),[g,f]=r(!1),b=()=>{h||(g&&u(),f(e=>!e))};return e(ue,{children:[n?t(je,{status:Re.Info,invertColors:!0,label:Je.OVERIDDEN}):null,e(Hc,{children:[t(ze,{text:Je.OVERRIDE_RUNTIME_DETAILS,children:t(gt,{icon:wi,onClick:b})}),g&&t(Yc,{width:"500px",onClose:b,onSave:async()=>{!c.version||bn(c.version)?(m(!0),await o(c),m(!1),b()):s({type:Re.Warning,message:Vt.INVALID_VERSION,hideFromHistory:!0})},saveTooltip:Je.OVERRIDE_RUNTIME_DETAILS_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await o({language:null,version:""}),m(!1),b()},deleteTooltip:Je.OVERRIDE_RUNTIME_DETAILS_DELETE_TOOLTIP,title:Je.OVERRIDE_RUNTIME_DETAILS,subTitle:Je.OVERRIDE_RUNTIME_DETAILS_SUBTITLE,warning:Je.OVERRIDE_RUNTIME_WARNING,pushButtonsWith:"20px",children:e(ue,{$gap:8,children:[t(mt,{label:Je.LANGUAGE,options:p,values:c.language?[c.language]:[],setValues:e=>d("language",e[0]),helpMessage:`Auto-detected: ${l.language||"none"}`}),t(Se,{label:Je.RUNTIME_VERSION,placeholder:Je.VERSION_PLACEHOLDER,value:c.version,onChange:e=>d("version",e.target.value),helpMessage:`Auto-detected: ${l.version||"none"}`})]})})]})]})},Zc=({source:e})=>{const{isVm:n}=y(),{containers:o,containersRichTitle:i}=a(()=>{const t=e?.conditions?.runtimeDetection;return{containers:e?.containers??[],containersRichTitle:{title:n?Je.DETECTED_PROCESSES:`${e.id.kind} ${Je.CONTAINERS}`,tooltip:t?.message||(n?Je.DETECTED_PROCESSES_DESCRIPTION:Je.DETECTED_CONTAINERS_DESCRIPTION),badge:Jt(t?.status)===Re.Loading?{status:Re.Loading,backgroundColor:"transparent"}:{label:e?.containers?.length}}}},[e,n]);return t(Dt,{bgTint:"1000",richTitle:i,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(q,{$gap:8,children:o.map(n=>n&&t(nd,{...n,sourceId:e.id},`source-container-${n.containerName}`))})})},Qc=g.div`
686
+ `,op=({width:o,onClose:n,onSave:i,saveTooltip:a,onDelete:l,deleteTooltip:r,title:c,subTitle:d,warning:u,children:p,pushButtonsWith:h})=>{const f=b(),v=m(Ju),[y,C]=s(null);return yo(v??{current:null},n),g(()=>{const e=v?.current?.getBoundingClientRect();e&&C({top:e.bottom+4,right:window.innerWidth-e.left-24})},[v]),y?Cr(e(Qu,{$coords:y,$width:o,"data-ignore-outside-click":"true",children:[e(Z,{$gap:4,children:[t(ce,{size:ue.XXS,children:c}),t(ce,{size:ue.XXXS,color:de.Secondary,children:d})]}),e(ep,{children:[t(tp,{children:p}),e(pe,{$gap:8,$width:"fit-content",$margin:`0 0 ${h||0} 0`,children:[t(he,{variant:ge.Secondary,onClick:l,leftIcon:xa,tooltip:r,hideTooltipIcon:!0,iconSize:16,size:me.S,textColor:f.v2.colors.red[500]}),t(he,{variant:ge.Primary,onClick:i,leftIcon:Fa,tooltip:a,hideTooltipIcon:!0,iconSize:16,size:me.S})]})]}),t("div",{children:t(_e,{status:Pe.Warning,message:u})})]}),document.body):null},np=({language:o,overridden:n,onOverride:i,defaultValues:l})=>{const{tier:r}=C(),{formData:c,handleFormChange:d,resetFormData:u}=Ut(l),p=a(()=>{if(!o)return[];const e=Co[o].community,t=r===kt.Onprem?Co[o].enterprise:[];return e.concat(t).map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})).sort((e,t)=>e.label.localeCompare(t.label))},[o,r]),[h,m]=s(!1),[g,f]=s(!1),b=()=>{h||(g&&u(),f(e=>!e))};return e(pe,{$gap:4,$alignItems:"center",children:[n?t(Ke,{status:Pe.Info,invertColors:!0,label:Ze.OVERIDDEN}):null,e(Zu,{children:[t(Ie,{text:Ze.OVERRIDE_OTEL_DISTRO_NAME,children:t(bt,{icon:Na,onClick:b})}),g&&t(op,{width:"500px",onClose:b,onSave:async()=>{m(!0),await i(c),m(!1),b()},saveTooltip:Ze.OVERRIDE_OTEL_DISTRO_NAME_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await i({otelDistroName:null}),m(!1),b()},deleteTooltip:Ze.OVERRIDE_OTEL_DISTRO_NAME_DELETE_TOOLTIP,title:Ze.OVERRIDE_OTEL_DISTRO_NAME,subTitle:Ze.OVERRIDE_OTEL_DISTRO_NAME_SUBTITLE,warning:Ze.OVERRIDE_OTEL_DISTRO_NAME_WARNING,children:t(ft,{label:Ze.OTEL_DISTRO_NAME,options:p,values:c.otelDistroName?[c.otelDistroName]:[],setValues:e=>d("otelDistroName",e[0])})})]})]})},ip=({overridden:o,onOverride:n,defaultValues:i,originalValues:l})=>{const{addNotification:r}=Wt(),{formData:c,handleFormChange:d,resetFormData:u}=Ut(i),p=a(()=>So.map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})),[]),[h,m]=s(!1),[g,f]=s(!1),b=()=>{h||(g&&u(),f(e=>!e))};return e(pe,{children:[o?t(Ke,{status:Pe.Info,invertColors:!0,label:Ze.OVERIDDEN}):null,e(Zu,{children:[t(Ie,{text:Ze.OVERRIDE_RUNTIME_DETAILS,children:t(bt,{icon:Na,onClick:b})}),g&&t(op,{width:"500px",onClose:b,onSave:async()=>{!c.version||xo(c.version)?(m(!0),await n(c),m(!1),b()):r({type:Pe.Warning,message:Kt.INVALID_VERSION,hideFromHistory:!0})},saveTooltip:Ze.OVERRIDE_RUNTIME_DETAILS_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await n({language:null,version:""}),m(!1),b()},deleteTooltip:Ze.OVERRIDE_RUNTIME_DETAILS_DELETE_TOOLTIP,title:Ze.OVERRIDE_RUNTIME_DETAILS,subTitle:Ze.OVERRIDE_RUNTIME_DETAILS_SUBTITLE,warning:Ze.OVERRIDE_RUNTIME_WARNING,pushButtonsWith:"20px",children:e(pe,{$gap:8,children:[t(ft,{label:Ze.LANGUAGE,options:p,values:c.language?[c.language]:[],setValues:e=>d("language",e[0]),helpMessage:`Auto-detected: ${l.language||"none"}`}),t(xe,{label:Ze.RUNTIME_VERSION,placeholder:Ze.VERSION_PLACEHOLDER,value:c.version,onChange:e=>d("version",e.target.value),helpMessage:`Auto-detected: ${l.version||"none"}`})]})})]})]})},ap=({source:e})=>{const{isVm:o}=C(),{containers:n,containersRichTitle:i}=a(()=>{const t=e?.conditions?.runtimeDetection;return{containers:e?.containers??[],containersRichTitle:{title:o?Ze.DETECTED_PROCESSES:`${e.id.kind} ${Ze.CONTAINERS}`,tooltip:t?.message||(o?Ze.DETECTED_PROCESSES_DESCRIPTION:Ze.DETECTED_CONTAINERS_DESCRIPTION),badge:oo(t?.status)===Pe.Loading?{status:Pe.Loading,backgroundColor:"transparent"}:{label:e?.containers?.length}}}},[e,o]);return t(zt,{bgTint:"1000",richTitle:i,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Z,{$gap:8,children:n.map(o=>o&&t(cp,{...o,sourceId:e.id},`source-container-${o.containerName}`))})})},lp=f.div`
273
687
  display: flex;
274
688
  flex-direction: column;
275
689
  align-self: stretch;
@@ -277,26 +691,26 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
277
691
  padding: 8px 12px;
278
692
  border-radius: 8px;
279
693
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
280
- `,ed=g.div`
694
+ `,rp=f.div`
281
695
  display: flex;
282
696
  align-items: center;
283
697
  justify-content: center;
284
698
  padding: 8px;
285
699
  border-radius: 10px;
286
700
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
287
- `,td=g.div`
701
+ `,sp=f.div`
288
702
  display: flex;
289
703
  flex-direction: column;
290
704
  gap: 12px;
291
705
  padding: 8px 12px;
292
706
  border-radius: 8px;
293
707
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
294
- `,nd=({sourceId:n,...o})=>{const{containerName:i,runtimeInfo:l,agentEnabled:r,overrides:s}=o,c=f(),{sourcesApi:d}=gl(),u=a(()=>!!s?.runtimeInfo?.language||!!s?.runtimeInfo?.runtimeVersion,[s]),p=a(()=>({language:Zt(o),version:vn(o)||void 0}),[o]),h=a(()=>!!s?.otelDistroName,[s]),m=a(()=>({otelDistroName:s?.otelDistroName||o.agentEnabled?.otelDistroName}),[s,o]),g=a(()=>!l&&!u,[l,u]),b=a(()=>g?Xi:Ke(p.language),[g,p]),v=a(()=>{if(g)return"";const{language:e,version:t}=p;return`${e}${t?` • ${t}`:""}`},[g,p]),y=a(()=>g?{status:Re.Loading,label:Je.WAITING_FOR_RUNTIME_DETECTION}:{status:r?.otelDistroName?Re.Success:Re.Disabled,leftIcon:r?.otelDistroName?vi:yi,label:r?.otelDistroName?`Instrumented | ${r.otelDistroName}`:"Uninstrumented",tooltip:r?.agentEnabledStatus?.message},[g,r]),C=e=>d.update(n,{containerName:i,...h?m:{},...u?p:{},...e}),S=a(()=>{const e=[];return o.agentConfig?.traces?.headSampling?.noisyOperations?.length&&e.push(Je.HEAD_SAMPLING),(o.collectorConfig?.tailSampling?.noisyOperations?.length||o.collectorConfig?.tailSampling?.highlyRelevantOperations?.length||o.collectorConfig?.tailSampling?.costReductionRules?.length)&&e.push(Je.TAIL_SAMPLING),e},[o]);return e(Qc,{children:[e(ue,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(ue,{$gap:8,$alignItems:"center",children:[t(ed,{children:t(b,{size:24,fill:l?void 0:c.v2.colors.grey[400]})}),t(se,{children:i}),t(Ut,v?{variant:Qt.Blue,label:v}:{variant:Qt.Loader,label:Je.DETECTING_RUNTIME_INFO}),t(qc,{overridden:u,onOverride:C,defaultValues:p,originalValues:{language:o.runtimeInfo?.language,version:o.runtimeInfo?.runtimeVersion||""}})]}),e(ue,{$gap:8,$alignItems:"center",children:[t(je,{...y,textSize:de.XXXS}),t(Jc,{language:p.language,overridden:h,onOverride:C,defaultValues:m})]})]}),!r||r.agentEnabled||g?null:t(td,{children:e(ue,{$gap:10,$alignItems:"center",children:[t(Ut,{variant:Qt.Pink,label:Bt(r.agentEnabledStatus?.reasonEnum)||Je.NO_AVAILABLE_AGENT}),t(se,{size:de.XXXS,color:ce.Secondary,children:r?.agentEnabledStatus?.message})]})}),S.length>0&&t(td,{children:t(ue,{$gap:16,$wrap:"wrap",children:S.map((e,n)=>t(je,{label:e,leftIcon:vi,status:Re.Success,invertColors:!0,useSecondaryTone:!0},`${i}-rule-${n}`))})})]})},od=({source:n,onClickRollout:o,onClickRollback:a})=>{const{isVm:i}=y();return e(q,{$gap:12,children:[t(Mc,{source:n}),t(Bc,{source:n}),!i&&t(Vc,{source:n,onClickRollout:o,onClickRollback:a}),!i&&t(Zc,{source:n}),!i&&t(zc,{source:n})]})},ad=g(q)`
708
+ `,cp=({sourceId:o,...n})=>{const{containerName:i,runtimeInfo:l,agentEnabled:r,overrides:s}=n,c=b(),{sourcesApi:d}=Nl(),u=a(()=>!!s?.runtimeInfo?.language||!!s?.runtimeInfo?.runtimeVersion,[s]),p=a(()=>({language:io(n),version:wo(n)||void 0}),[n]),h=a(()=>!!s?.otelDistroName,[s]),m=a(()=>({otelDistroName:s?.otelDistroName||n.agentEnabled?.otelDistroName}),[s,n]),g=a(()=>!l&&!u,[l,u]),f=a(()=>g?el:Je(p.language),[g,p]),v=a(()=>{if(g)return"";const{language:e,version:t}=p;return`${e}${t?` • ${t}`:""}`},[g,p]),y=a(()=>g?{status:Pe.Loading,label:Ze.WAITING_FOR_RUNTIME_DETECTION}:{status:r?.otelDistroName?Pe.Success:Pe.Disabled,leftIcon:r?.otelDistroName?ka:Ea,label:r?.otelDistroName?`Instrumented | ${r.otelDistroName}`:"Uninstrumented",tooltip:r?.agentEnabledStatus?.message},[g,r]),C=e=>d.update(o,{containerName:i,...h?m:{},...u?p:{},...e}),S=a(()=>{const e=[];return n.agentConfig?.traces?.headSampling?.noisyOperations?.length&&e.push(Ze.HEAD_SAMPLING),(n.collectorConfig?.tailSampling?.noisyOperations?.length||n.collectorConfig?.tailSampling?.highlyRelevantOperations?.length||n.collectorConfig?.tailSampling?.costReductionRules?.length)&&e.push(Ze.TAIL_SAMPLING),e},[n]);return e(lp,{children:[e(pe,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(pe,{$gap:8,$alignItems:"center",children:[t(rp,{children:t(f,{size:24,fill:l?void 0:c.v2.colors.grey[400]})}),t(ce,{children:i}),t(Yt,v?{variant:ao.Blue,label:v}:{variant:ao.Loader,label:Ze.DETECTING_RUNTIME_INFO}),t(ip,{overridden:u,onOverride:C,defaultValues:p,originalValues:{language:n.runtimeInfo?.language,version:n.runtimeInfo?.runtimeVersion||""}})]}),e(pe,{$gap:8,$alignItems:"center",children:[t(Ke,{...y,textSize:ue.XXXS}),t(np,{language:p.language,overridden:h,onOverride:C,defaultValues:m})]})]}),!r||r.agentEnabled||g?null:t(sp,{children:e(pe,{$gap:10,$alignItems:"center",children:[t(Yt,{variant:ao.Pink,label:Gt(r.agentEnabledStatus?.reasonEnum)||Ze.NO_AVAILABLE_AGENT}),t(ce,{size:ue.XXXS,color:de.Secondary,children:r?.agentEnabledStatus?.message})]})}),S.length>0&&t(sp,{children:t(pe,{$gap:16,$wrap:"wrap",children:S.map((e,o)=>t(Ke,{label:e,leftIcon:ka,status:Pe.Success,invertColors:!0,useSecondaryTone:!0},`${i}-rule-${o}`))})})]})},dp=({source:o,onClickRollout:n,onClickRollback:i})=>{const{isVm:a}=C();return e(Z,{$gap:12,children:[t(ju,{source:o}),t(Wu,{source:o}),!a&&t(Yu,{source:o,onClickRollout:n,onClickRollback:i}),!a&&t(ap,{source:o}),!a&&t(Gu,{source:o})]})},up=f(Z)`
295
709
  width: 100%;
296
710
  max-height: 320px;
297
711
  overflow-y: auto;
298
712
  gap: 8px;
299
- `,id=g(ue)`
713
+ `,pp=f(pe)`
300
714
  width: 100%;
301
715
  align-items: center;
302
716
  gap: 8px;
@@ -306,14 +720,14 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
306
720
  & > * {
307
721
  font-family: monospace !important;
308
722
  }
309
- `,ld=({pendingModify:n,onClose:o,onConfirm:a})=>{const i=f();return t(Ye,{isOpen:!!n,title:'Modify the "Profiling Symbols" rule',description:'These changes are applied immediately to a single custom instrumentation rule named "Profiling Symbols".\nSelected symbols are added to it; unchecked symbols are removed from it (the rule is deleted once empty). Symbols managed by other rules are never touched.',onClose:o,denyButton:{variant:me.Secondary,label:"Cancel",onClick:o},approveButton:{variant:me.Primary,label:"Confirm",onClick:a},children:n&&e(ad,{children:[n.add.map(n=>e(id,{children:[t(je,{leftIcon:fi,status:Re.Success,useSecondaryTone:!0,textColor:i.v2.colors.white[500],textSize:de.XXS}),t(se,{size:de.XS,color:ce.Primary,children:n})]},`add-${n}`)),n.remove.map(n=>e(id,{children:[t(je,{leftIcon:ji,status:Re.Error,useSecondaryTone:!0,textColor:i.v2.colors.white[500],textSize:de.XXS}),t(se,{size:de.XS,color:ce.Primary,children:n})]},`remove-${n}`))]})})};function rd(e,t){const n=e.names[t];if(null==n)return"";if("string"==typeof n)return n;if("object"==typeof n&&"name"in n){const e=n.name;if("string"==typeof e)return e}return"number"==typeof n||"boolean"==typeof n?String(n):""}function sd(e){const t=Math.abs(e);return t>=1e9?`${cd(e/1e9)}s`:t>=1e6?`${cd(e/1e6)}ms`:t>=1e3?`${cd(e/1e3)}μs`:String(Math.round(e))}function cd(e){return e.toFixed(2).replace(/\.?0+$/,"")}function dd(e){const t=[];for(let n=0;n<e.levels.length;n++){const o=e.levels[n];let a=0;for(let e=0;e+3<o.length;e+=4){const i=o[e],l=o[e+1],r=o[e+2],s=o[e+3],c=a+i;t.push({level:n,offset:c,size:l,self:r,nameIndex:s}),a=c+l}}return t}function ud(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function pd(e,t){const n=e.reduce((e,t)=>Math.max(e,t.level),t.level),o=new Map;for(const t of e){const e=o.get(t.level);e?e.push(t):o.set(t.level,[t])}const a=[t];for(let e=t.level+1;e<=n;e++){const t=a.filter(t=>t.level===e-1);if(0===t.length)break;const n=o.get(e);if(n?.length)for(const e of n)for(const n of t)if(e.offset>=n.offset&&e.offset+e.size<=n.offset+n.size){a.push(e);break}}return a}function hd(e,t){const n=t.trim().toLowerCase();return!n||e.toLowerCase().includes(n)}function md(e,t,n,o,a,i={}){if(0===e.levels.length||t<2||n<2)return null;const{zoomRoot:l=null,shouldKeepName:r,collapseRecursive:s=!1,allRects:c}=i,d=c??dd(e);let u=l?pd(d,l):d;if(0===u.length)return null;if(r&&(u=u.filter(t=>r(rd(e,t.nameIndex))),0===u.length))return null;if(s&&(u=function(e,t){if(0===t.length)return t;const n=[...t].sort((e,t)=>e.level-t.level||e.offset-t.offset),o=new Map;for(const e of n){const t=o.get(e.level);t?t.push(e):o.set(e.level,[e])}const a=new Set;for(const t of n){const n=o.get(t.level+1);if(!n)continue;const i=n.filter(e=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);if(1!==i.length)continue;const l=i[0];l.size===t.size&&rd(e,l.nameIndex)===rd(e,t.nameIndex)&&a.add(ud(l))}if(0===a.size)return n;const i=[];for(const e of n){if(a.has(ud(e)))continue;let t=0;for(let n=0;n<e.level;n++){const i=o.get(n);if(!i)continue;const l=i.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);l&&a.has(ud(l))&&t++}i.push({...e,level:e.level-t})}return i}(e,u),0===u.length))return null;const p=l?.level??0,h=l?.offset??0,m=l?.size??e.numTicks;if(m<=0)return null;const g=u.reduce((e,t)=>Math.max(e,t.level-p),0)+1,f=o??Number.POSITIVE_INFINITY,b=Math.max(1,Math.min(n/g,f)),v=a.trim(),y=b>8?1:0;return u.map(n=>{const o=n.level-p,a=(n.offset-h)/m*t,i=Math.max(n.size/m*t,1),l=o*b,r=Math.max(b-y,1),s=rd(e,n.nameIndex);return{...n,x:a,y:l,w:i,h:r,name:s,matchesSearch:hd(s,v)}})}function gd(e,t){let n=0;for(let t=0;t<e.length;t++)n=31*n+e.charCodeAt(t)>>>0;const o=t.v2.colors.black[500],a=[{fill:t.v2.colors.purple[300],text:o},{fill:t.v2.colors.green[300],text:o},{fill:t.v2.colors.red[300],text:o},{fill:t.v2.colors.blue[300],text:o},{fill:t.v2.colors.yellow[300],text:o}];return a[n%a.length]}var fd,bd;!function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(fd||(fd={})),function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(bd||(bd={}));function vd(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function yd(e,t,n){for(const o of n)if(e>=o.x&&e<o.x+o.w&&t>=o.y&&t<o.y+o.h)return o;return null}function Cd(e){return e>=1073741824?`${(e/1073741824).toFixed(1)} GiB`:e>=1048576?`${(e/1048576).toFixed(1)} MiB`:e>=1024?`${(e/1024).toFixed(1)} KiB`:`${e} B`}const Sd=({flamebearer:n,maxRowPx:s,searchQuery:c="",shouldKeepName:d,minHostHeight:u=200,onFullscreenChange:p,profilingSlots:h,onFrameClick:g,onZoomedSymbolsChange:b,onResetZoom:v})=>{const y=f(),C=i(null),S=i(null),w=i({x:0,y:0}),x=i(n.numTicks),[k,T]=r({w:0,h:0}),[$,I]=r(""),[E,A]=r(null),[N,O]=r([]),[R,D]=r(!1),[P,F]=r(fd.Fit),[L,_]=r(bd.Fit),[M,z]=r(!1),B=Math.max(1,Math.min(Math.floor(k.w*P),8192)),X=Math.max(1,Math.min(Math.floor(k.h*L),8192)),V=N.length>0?N[N.length-1]:null,U=V?.size??n.numTicks,G=a(()=>dd(n),[n]);o(()=>{x.current!==n.numTicks&&(x.current=n.numTicks,O([]))},[n.numTicks]),o(()=>{if(!b)return;if(!V)return void b(null);const e=pd(G,V),t=new Set;for(const o of e){const e=rd(n,o.nameIndex);e&&t.add(e)}b([...t])},[V,n,G,b]),m(()=>{const e=C.current;if(!e)return;const t=new ResizeObserver(()=>{const t=e.getBoundingClientRect();T({w:Math.floor(t.width),h:Math.floor(t.height)})});return t.observe(e),()=>t.disconnect()},[]),o(()=>{if(!R)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[R]),o(()=>(p?.(R),()=>{R&&p?.(!1)}),[R,p]);const H=a(()=>md(n,B,X,s,c,{zoomRoot:V,shouldKeepName:d,collapseRecursive:M,allRects:G}),[n,s,c,X,B,V,d,M,G]),j=a(()=>function(e){return[...e].sort((e,t)=>t.level-e.level)}(H?.length?c.trim()?H.filter(e=>e.matchesSearch):H:[]),[H,c]),W=l(e=>{if(B<2||X<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const o=yd((e.clientX-t.left)/t.width*B,(e.clientY-t.top)/t.height*X,j);if(o){const e=ud(o);A(e);const t=U>0?(100*o.size/U).toFixed(1):"0",a=n.numTicks>0?(100*o.size/n.numTicks).toFixed(1):"0";I(`${o.name}\ntotal ${sd(o.size)} (${t}% of view, ${a}% of profile) · self ${sd(o.self)}`)}else A(null),I("")},[j,n.numTicks,X,B,U]),K=l(e=>{W(e)},[W]),Y=l(()=>{A(null),I("")},[]),J=l(e=>{w.current={x:e.clientX,y:e.clientY}},[]),q=l(e=>{const{x:t,y:n}=w.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-n)>3)return;if(B<2||X<2)return;const o=e.currentTarget.getBoundingClientRect();if(o.width<1||o.height<1)return;const a=yd((e.clientX-o.left)/o.width*B,(e.clientY-o.top)/o.height*X,j);if(!a)return;g?.(a.name);const i=function(e){return{level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}}(a);O(e=>{const t=e.length>0?e[e.length-1]:null;return t&&function(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}(i,t)?e.slice(0,-1):[...e,i]})},[j,X,B,g]);m(()=>{const e=S.current;if(!e||B<2||X<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,o=Math.max(B,X),a=Math.min(t,16384/o);e.width=Math.floor(B*a),e.height=Math.floor(X*a),e.style.width=`${B}px`,e.style.height=`${X}px`;const i=e.getContext("2d");i&&(i.setTransform(a,0,0,a,0,0),i.clearRect(0,0,B,X),H?.length?function(e,t,n,o,a,i,l,r){const s=i.v2.colors.silver[900];e.fillStyle=s,e.fillRect(0,0,t,n);const c=a.trim().length>0;e.textRendering="optimizeLegibility";for(const t of o){const{x:n,y:o,w:a,h:l,name:s,size:d,matchesSearch:u}=t;if(c&&!u)continue;const{fill:p,text:h}=gd(s,i);e.fillStyle=p,e.fillRect(n,o,a,l),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(n+.5,o+.5),e.lineTo(n+a-.5,o+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(n+.5,o+.5,Math.max(a-1,0),Math.max(l-1,0));const m=vd(d,r),g=`${s} (${sd(d)}, ${m}%)`,f=i.v2.text.size.xs,b=8,v=5,y=26,C=Math.min(f,Math.floor(l-2));if(a>=y&&C>=b){e.font=`${C}px ${i.font_family.primary}, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`,e.textBaseline="middle",e.textAlign="left";let t=g;for(;t.length>2&&e.measureText(t).width>a-2*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=a-2*v&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,n+v,o+l/2),e.fillStyle=h,e.fillText(t,n+v,o+l/2))}}if(l)for(const t of o){if(ud(t)!==l)continue;if(c&&!t.matchesSearch)continue;const{x:n,y:o,w:a,h:i}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(n+1,o+1,Math.max(a-2,0),Math.max(i-2,0));break}}(i,B,X,H,c,y,E,n.numTicks):(i.fillStyle=y.v2.colors.silver[900],i.fillRect(0,0,B,X)))},[H,n.numTicks,E,c,X,B,y]);const Z=l(()=>D(e=>!e),[]),Q=n.numTicks>0?Math.max(0,Math.min(100,Math.round(U/n.numTicks*100))):100,ee=a(()=>function(e,t,n){const o=n??dd(e),a=t?.offset??0,i=a+(t?.size??e.numTicks),l=(t?.level??-1)+1,r=t?.size??e.numTicks;let s=null;for(const e of o)e.level<l||e.offset<a||e.offset+e.size>i||e.size>=r||(!s||e.size>s.size||e.size===s.size&&e.level<s.level)&&(s=e);return s}(n,V,G),[n,V,G]),te=null!==ee,ne=N.length>0,ie=V?rd(n,V.nameIndex):"",le=l(()=>{O([]),v?.()},[v]),re=l(()=>O(e=>e.slice(0,-1)),[]),fe=l(()=>{ee&&O(e=>[...e,ee])},[ee]);return e("div",{style:R?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:y.v2.colors.silver[900]}:{flex:1,minHeight:u,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(ue,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(oe,{label:"Collapse recursive",tooltip:"Collapse straight-line recursion (parent → single same-name child of equal width) into a single bar. Helps deep recursive call chains fit on screen.",labelAlign:ae.Left,size:kt.S,value:M,onChange:z}),e(ue,{$gap:8,children:[e(ue,{children:[t(pe,{variant:me.Secondary,size:he.S,label:"Reset zoom",leftIcon:Wi,onClick:le,disabled:!N.length}),t(pe,{variant:me.Secondary,size:he.S,iconSize:20,leftIcon:ji,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!ne,onClick:re}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(se,{size:de.XXS,color:ce.Secondary,nowrap:!0,align:"center",children:`${Q}%`})}),t(pe,{variant:me.Secondary,size:he.S,iconSize:20,leftIcon:fi,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!te,onClick:fe})]}),e(ue,{children:[t(ze,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(ge,{variant:yn.Filled,options:[{value:fd.Fit,label:"W: Fit"},{value:fd.X10,label:"10x"}],selected:P,setSelected:F})}),t(ze,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(ge,{variant:yn.Filled,options:[{value:bd.Fit,label:"H: Fit"},{value:bd.X10,label:"10x"}],selected:L,setSelected:_})})]}),t(pe,{variant:me.Secondary,size:he.S,iconSize:24,leftIcon:R?Oi:Ki,tooltip:R?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:Z})]})]}),t(ze,{fullWidth:!0,keepAlive:!0,text:$,children:t("div",{ref:C,style:{flex:1,minWidth:0,width:"100%",height:R?"calc(100vh - 80px)":"calc(100vh - 364px)",position:"relative",overflow:"hidden"},children:t("div",{style:{position:"absolute",inset:0,overflowX:P>1?"auto":"hidden",overflowY:L>1?"auto":"hidden"},children:t("div",{style:{width:B||"100%",height:X||"100%",position:"relative"},children:t("canvas",{ref:S,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:E?"pointer":"default"},onPointerDown:J,onPointerMove:K,onPointerLeave:Y,onClick:q})})})})}),e(ue,{$justifyContent:"space-between",children:[t(se,V?{size:de.XXXS,color:y.v2.colors.silver[300],children:`Zoomed: ${ie} • ${sd(U)} samples in view`}:{size:de.XXXS,color:y.v2.colors.silver[300],children:g?"Click a frame to zoom in and jump to its row in the symbol table.":"Click a frame to zoom into its subtree (pprof-style)."}),h&&t(se,{size:de.XXXS,color:y.v2.colors.silver[300],children:`${h.activeKeys.length} / ${h.maxSlots} profiling slots · ${Cd(h.totalBytesUsed)} / ${Cd(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})},wd=[Cn.Go,Cn.Java],xd="Profiling Symbols";function kd(e,t){if(0===t.length)return null;const n=1===t.length?t[0]:function(e){return e.includes("/")||/\.\(\*?[^)]+\)\./.test(e)?Cn.Go:e.includes(" ")||e.includes("(")?Cn.Java:Cn.Go}(e);if(n===Cn.Go){const t=function(e){let t=e.trim();if(!t)return null;t=t.replace(/\[[^\]]*\]/g,"");const n=t.lastIndexOf("/"),o=t.indexOf(".",n+1);if(-1===o)return null;const a=t.slice(0,o),i=t.slice(o+1);if(!a||!i)return null;const l=i.match(/^\(\*?([^)]+)\)\.(.+)$/);if(l){const e=new Ve(a,"",l[1],l[2]);return e.Verify()?e:null}const r=new Ve(a,i);return r.Verify()?r:null}(e);return t?{language:n,golang:t}:null}if(n===Cn.Java){const t=function(e){let t=e.trim();if(!t)return null;const n=t.indexOf("(");-1!==n&&(t=t.slice(0,n).trim());const o=t.split(/\s+/);t=o[o.length-1]??"";const a=t.lastIndexOf(".");if(-1===a)return null;const i=t.slice(0,a),l=t.slice(a+1),r=new Ue(i,l);return r.Verify()?r:null}(e);return t?{language:n,java:t}:null}return null}function Td(e,t){return e.namespace===t.namespace&&e.name===t.name&&e.kind===t.kind}function $d(e,t,n){if(!e)return!0;const{sources:o=[],namespaces:a=[],languages:i=[]}=e,l=!o.length||o.some(e=>Td(e,t.id)),r=!a.length||a.includes(t.id.namespace),s=!i.length||null==n||i.includes(n);return l&&r&&s}function Id(e,t){return e.packageName===t.packageName&&(e.functionName||"")===(t.functionName||"")&&(e.receiverName||"")===(t.receiverName||"")&&(e.receiverMethodName||"")===(t.receiverMethodName||"")}function Ed(e,t){return e.className===t.className&&e.methodName===t.methodName}function Ad(e,t,n,o){const a=kd(e,n);if(!a)return[];const i=[];for(const e of o){const n=e.customInstrumentations;if(!n)continue;if(!$d(e.sourceScopes,t,a.language))continue;const o=!!a.golang&&!!n[Ge.Golang]?.some(e=>Id(e,a.golang)),l=!!a.java&&!!n[Ge.Java]?.some(e=>Ed(e,a.java));(o||l)&&i.push({rule:e,resolved:a})}return i}function Nd({source:e,languages:t,rows:n}){const{instrumentationRulesApi:o,capabilities:i}=gl(),{items:s}=o.useRules(),[c,d]=r(new Set),[u,p]=r(new Set),[h,m]=r(null),g=a(()=>function(e){const t=new Set(e??[]);return wd.filter(e=>t.has(e))}(t),[t]),f=i.canCreateInstrumentationRule,b=a(()=>function(e,t){const n=e.filter(e=>e.type===He.CustomInstrumentation&&e.ruleName===xd&&$d(e.sourceScopes,t));return n.find(e=>e.sourceScopes?.sources?.some(e=>Td(e,t.id)))??n[0]??null}(s,e),[s,e]),v=f&&g.length>0,y=a(()=>{const t=new Map;for(const o of n){const n=!!kd(o.name,g),a=Ad(o.name,e,g,s),i=!!b&&a.some(e=>e.rule.ruleId===b.ruleId),l=a.filter(e=>e.rule.ruleId!==b?.ruleId),r=!i&&l.length>0,c=v&&n,d=r;let u;if(r){const e=[...new Set(l.map(e=>e.rule.ruleName))];u=`Managed by ${e.length>1?"rules":"rule"} ${e.map(e=>`“${e}”`).join(", ")}. Edit ${e.length>1?"those rules":"that rule"} to change this symbol.`}let p=!1,h="Add this symbol to the “Profiling Symbols” rule";r?h=u??"Managed by another rule":0===a.length&&(0===g.length?h="Custom instrumentation is only available for Go and Java sources":f?n?p=!0:h="This symbol could not be parsed into a probe automatically":h="You don’t have permission to add custom instrumentation"),t.set(o.name,{parsable:n,inManagedRule:i,otherRules:l,showCheckbox:c,checkboxDisabled:d,checkboxTooltip:u,addEnabled:p,addTooltip:h})}return t},[n,s,e,g,f,v,b]),C=a(()=>{const e=new Set;return y.forEach((t,n)=>{t.inManagedRule&&e.add(n)}),e},[y]),S=a(()=>[...c].filter(e=>y.get(e)?.addEnabled&&!C.has(e)),[c,y,C]),w=a(()=>[...u].filter(e=>C.has(e)),[u,C]),x=S.length+w.length,k=l(e=>{const t=y.get(e);return t?.inManagedRule?!u.has(e):!!(t&&t.otherRules.length>0)||c.has(e)},[y,u,c]),T=l((e,t)=>{const n=y.get(e);n&&!n.checkboxDisabled&&(n.inManagedRule?p(n=>{const o=new Set(n);return t?o.delete(e):o.add(e),o}):d(n=>{const o=new Set(n);return t?o.add(e):o.delete(e),o}))},[y]),$=l(()=>{d(new Set),p(new Set)},[]),I=l(t=>{(async()=>{const n=t.add.map(e=>kd(e,g)).filter(e=>!!e),a=t.remove.map(e=>kd(e,g)).filter(e=>!!e);if(b){const{customInstrumentations:e,isEmpty:t}=function(e,t,n){const o=e.customInstrumentations??{};let a=[...o[Ge.Golang]??[]],i=[...o[Ge.Java]??[]];for(const e of n)e.golang&&(a=a.filter(t=>!Id(t,e.golang))),e.java&&(i=i.filter(t=>!Ed(t,e.java)));for(const e of t)e.golang&&!a.some(t=>Id(t,e.golang))&&a.push(e.golang),e.java&&!i.some(t=>Ed(t,e.java))&&i.push(e.java);return{customInstrumentations:{[Ge.Golang]:a,[Ge.Java]:i},isEmpty:0===a.length&&0===i.length}}(b,n,a);t?await o.remove(b.ruleId,He.CustomInstrumentation):await o.update(b.ruleId,function(e,t){return{ruleName:e.ruleName,notes:e.notes,disabled:e.disabled,sourceScopes:e.sourceScopes??null,workloads:null,instrumentationLibraries:e.instrumentationLibraries??null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:t}}(b,e),He.CustomInstrumentation)}else n.length>0&&await o.create(function(e,t){const n=e.map(e=>e.golang).filter(e=>!!e),o=e.map(e=>e.java).filter(e=>!!e),a={sources:[{namespace:t.id.namespace,name:t.id.name,kind:t.id.kind}],namespaces:[],languages:[]};return{ruleName:xd,notes:"Symbols selected from the profiling tab.",disabled:!1,sourceScopes:a,workloads:null,instrumentationLibraries:null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:{[Ge.Golang]:n,[Ge.Java]:o}}}(n,e),He.CustomInstrumentation)})()},[b,g,e,o]),E=l(()=>{x&&m({add:S,remove:w})},[x,S,w]),A=l(e=>m({add:[e],remove:[]}),[]),N=l(e=>m({add:[],remove:[e]}),[]),O=l(()=>m(null),[]),R=l(()=>{h&&(I(h),m(null),$())},[h,I,$]),D=l(e=>y.get(e)??{parsable:!1,inManagedRule:!1,otherRules:[],showCheckbox:!1,checkboxDisabled:!1,addEnabled:!1,addTooltip:"Custom instrumentation is only available for Go and Java sources"},[y]);return{instrumentation:a(()=>({getSymbolState:D,onAdd:A,onRemove:N,selectionEnabled:v,isSelected:k,onToggleSymbol:T}),[D,A,N,v,k,T]),pendingCount:x,pendingModify:h,closeModify:O,openBulkModify:E,resetSelection:$,confirmModify:R}}var Od,Rd,Dd;!function(e){e.Symbol="symbol",e.Self="self",e.Total="total"}(Od||(Od={})),function(e){e.OnlyInstrumentable="only-instrumentable"}(Rd||(Rd={})),function(e){e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"}(Dd||(Dd={}));const Pd=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function Fd(e,t){const n=function(e){return e.split(" ")[0]??""}(e);if(t.includes(Dd.FilterOutVoid)&&"void"===n)return!1;if(t.includes(Dd.OnlyWithReturnValues)){if(!(e.includes(" ")&&"void"!==n&&Pd.test(n)))return!1}return!0}const Ld=({rows:e,languages:n,instrumentation:o,searchQuery:i,filters:r,onFiltersChange:s,zoomedSymbols:c,highlightSymbol:d,scrollSignal:u})=>{const p=!!n?.includes(Cn.Java),h=a(()=>{const t=c?new Set(c):null,n=i?.trim().toLowerCase();return e.filter(e=>(!t||t.has(e.name))&&(!n||e.name.toLowerCase().includes(n)))},[e,i,c]),m=a(()=>{const e=[];if(o.selectionEnabled&&e.push({id:Rd.OnlyInstrumentable,label:"Only show instrumentable symbols"}),p&&(e.push({id:Dd.FilterOutVoid,label:"Filter out void symbols"}),e.push({id:Dd.OnlyWithReturnValues,label:"Only show functions with return values"})),0!==e.length)return{options:e,filterRow:(e,t)=>{const n=e.cells.find(e=>e.key===Od.Symbol)?.rawValue?.toString()??"";return!(t.includes(Rd.OnlyInstrumentable)&&!o.getSymbolState(n).showCheckbox)&&Fd(n,t)}}},[o,p]),g=a(()=>[{key:Od.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:m,noFilter:!m},{key:Od.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:Od.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[m]),f=a(()=>h.map(e=>{const t=o.getSymbolState(e.name),n=t.showCheckbox;return{id:e.name,cells:[{key:Od.Symbol,rawValue:e.name},{key:Od.Self,rawValue:sd(e.self)},{key:Od.Total,rawValue:sd(e.total)}],isSelected:n?o.isSelected(e.name):void 0,onSelect:n?()=>o.onToggleSymbol(e.name,!0):void 0,onDeselect:n?()=>o.onToggleSymbol(e.name,!1):void 0,hideCheckbox:!n,checkboxDisabled:n?t.checkboxDisabled:void 0,checkboxTooltip:n?t.checkboxTooltip:void 0}}),[h,o]),b=l(e=>{const t=e.cells[0].rawValue,n=o.getSymbolState(t),a=[];return n.inManagedRule?a.push({id:`remove-instrumentation-${t}`,label:"",leftIcon:gi,tooltip:"Remove from the “Profiling Symbols” rule",onClick:()=>o.onRemove(t)}):a.push({id:`add-instrumentation-${t}`,label:"",leftIcon:fi,tooltip:n.addTooltip,disabled:!n.addEnabled,onClick:()=>o.onAdd(t)}),a.push({id:`copy-${t}`,label:"",leftIcon:Yi,tooltip:"Copy symbol name",onClick:()=>{navigator.clipboard.writeText(t)}}),a},[o]);return t(Sn,{variant:wn.Data,maxHeight:"calc(100vh - 306px)",columns:g,rows:f,withCheckboxes:o.selectionEnabled,filters:r,onFiltersChange:s,activeRowId:d,scrollSignal:u,getRowActions:b})};var _d;!function(e){e.Table="table",e.Flame="flame",e.Both="both"}(_d||(_d={}));const Md=g(q)`
723
+ `,hp=({pendingModify:o,onClose:n,onConfirm:i})=>{const a=b();return t(qe,{isOpen:!!o,title:'Modify the "Profiling Symbols" rule',description:'These changes are applied immediately to a single custom instrumentation rule named "Profiling Symbols".\nSelected symbols are added to it; unchecked symbols are removed from it (the rule is deleted once empty). Symbols managed by other rules are never touched.',onClose:n,denyButton:{variant:ge.Secondary,label:"Cancel",onClick:n},approveButton:{variant:ge.Primary,label:"Confirm",onClick:i},children:o&&e(up,{children:[o.add.map(o=>e(pp,{children:[t(Ke,{leftIcon:wa,status:Pe.Success,useSecondaryTone:!0,textColor:a.v2.colors.white[500],textSize:ue.XXS}),t(ce,{size:ue.XS,color:de.Primary,children:o})]},`add-${o}`)),o.remove.map(o=>e(pp,{children:[t(Ke,{leftIcon:al,status:Pe.Error,useSecondaryTone:!0,textColor:a.v2.colors.white[500],textSize:ue.XXS}),t(ce,{size:ue.XS,color:de.Primary,children:o})]},`remove-${o}`))]})})};function mp(e,t){const o=e.names[t];if(null==o)return"";if("string"==typeof o)return o;if("object"==typeof o&&"name"in o){const e=o.name;if("string"==typeof e)return e}return"number"==typeof o||"boolean"==typeof o?String(o):""}function gp(e){const t=Math.abs(e);return t>=1e9?`${fp(e/1e9)}s`:t>=1e6?`${fp(e/1e6)}ms`:t>=1e3?`${fp(e/1e3)}μs`:String(Math.round(e))}function fp(e){return e.toFixed(2).replace(/\.?0+$/,"")}function bp(e){const t=[];for(let o=0;o<e.levels.length;o++){const n=e.levels[o];let i=0;for(let e=0;e+3<n.length;e+=4){const a=n[e],l=n[e+1],r=n[e+2],s=n[e+3],c=i+a;t.push({level:o,offset:c,size:l,self:r,nameIndex:s}),i=c+l}}return t}function vp(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function yp(e,t){const o=e.reduce((e,t)=>Math.max(e,t.level),t.level),n=new Map;for(const t of e){const e=n.get(t.level);e?e.push(t):n.set(t.level,[t])}const i=[t];for(let e=t.level+1;e<=o;e++){const t=i.filter(t=>t.level===e-1);if(0===t.length)break;const o=n.get(e);if(o?.length)for(const e of o)for(const o of t)if(e.offset>=o.offset&&e.offset+e.size<=o.offset+o.size){i.push(e);break}}return i}function Cp(e,t){const o=t.trim().toLowerCase();return!o||e.toLowerCase().includes(o)}function Sp(e,t,o,n,i,a={}){if(0===e.levels.length||t<2||o<2)return null;const{zoomRoot:l=null,shouldKeepName:r,collapseRecursive:s=!1,allRects:c}=a,d=c??bp(e);let u=l?yp(d,l):d;if(0===u.length)return null;if(r&&(u=u.filter(t=>r(mp(e,t.nameIndex))),0===u.length))return null;if(s&&(u=function(e,t){if(0===t.length)return t;const o=[...t].sort((e,t)=>e.level-t.level||e.offset-t.offset),n=new Map;for(const e of o){const t=n.get(e.level);t?t.push(e):n.set(e.level,[e])}const i=new Set;for(const t of o){const o=n.get(t.level+1);if(!o)continue;const a=o.filter(e=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);if(1!==a.length)continue;const l=a[0];l.size===t.size&&mp(e,l.nameIndex)===mp(e,t.nameIndex)&&i.add(vp(l))}if(0===i.size)return o;const a=[];for(const e of o){if(i.has(vp(e)))continue;let t=0;for(let o=0;o<e.level;o++){const a=n.get(o);if(!a)continue;const l=a.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);l&&i.has(vp(l))&&t++}a.push({...e,level:e.level-t})}return a}(e,u),0===u.length))return null;const p=l?.level??0,h=l?.offset??0,m=l?.size??e.numTicks;if(m<=0)return null;const g=u.reduce((e,t)=>Math.max(e,t.level-p),0)+1,f=n??Number.POSITIVE_INFINITY,b=Math.max(1,Math.min(o/g,f)),v=i.trim(),y=b>8?1:0;return u.map(o=>{const n=o.level-p,i=(o.offset-h)/m*t,a=Math.max(o.size/m*t,1),l=n*b,r=Math.max(b-y,1),s=mp(e,o.nameIndex);return{...o,x:i,y:l,w:a,h:r,name:s,matchesSearch:Cp(s,v)}})}function xp(e,t){let o=0;for(let t=0;t<e.length;t++)o=31*o+e.charCodeAt(t)>>>0;const n=t.v2.colors.black[500],i=[{fill:t.v2.colors.purple[300],text:n},{fill:t.v2.colors.green[300],text:n},{fill:t.v2.colors.red[300],text:n},{fill:t.v2.colors.blue[300],text:n},{fill:t.v2.colors.yellow[300],text:n}];return i[o%i.length]}var wp,Tp;!function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(wp||(wp={})),function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(Tp||(Tp={}));function kp(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function Ep(e,t,o){for(const n of o)if(e>=n.x&&e<n.x+n.w&&t>=n.y&&t<n.y+n.h)return n;return null}function Ip(e){return e>=1073741824?`${(e/1073741824).toFixed(1)} GiB`:e>=1048576?`${(e/1048576).toFixed(1)} MiB`:e>=1024?`${(e/1024).toFixed(1)} KiB`:`${e} B`}const Op=({flamebearer:o,maxRowPx:n,searchQuery:c="",shouldKeepName:d,minHostHeight:u=200,onFullscreenChange:p,profilingSlots:h,onFrameClick:m,onZoomedSymbolsChange:f,onResetZoom:v})=>{const y=b(),C=l(null),S=l(null),x=l({x:0,y:0}),w=l(o.numTicks),[T,k]=s({w:0,h:0}),[E,I]=s(""),[O,N]=s(null),[$,A]=s([]),[R,D]=s(!1),[_,P]=s(wp.Fit),[L,F]=s(Tp.Fit),[M,z]=s(!1),B=Math.max(1,Math.min(Math.floor(T.w*_),8192)),X=Math.max(1,Math.min(Math.floor(T.h*L),8192)),U=$.length>0?$[$.length-1]:null,V=U?.size??o.numTicks,H=a(()=>bp(o),[o]);i(()=>{w.current!==o.numTicks&&(w.current=o.numTicks,A([]))},[o.numTicks]),i(()=>{if(!f)return;if(!U)return void f(null);const e=yp(H,U),t=new Set;for(const n of e){const e=mp(o,n.nameIndex);e&&t.add(e)}f([...t])},[U,o,H,f]),g(()=>{const e=C.current;if(!e)return;const t=new ResizeObserver(()=>{const t=e.getBoundingClientRect();k({w:Math.floor(t.width),h:Math.floor(t.height)})});return t.observe(e),()=>t.disconnect()},[]),i(()=>{if(!R)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[R]),i(()=>(p?.(R),()=>{R&&p?.(!1)}),[R,p]);const j=a(()=>Sp(o,B,X,n,c,{zoomRoot:U,shouldKeepName:d,collapseRecursive:M,allRects:H}),[o,n,c,X,B,U,d,M,H]),G=a(()=>function(e){return[...e].sort((e,t)=>t.level-e.level)}(j?.length?c.trim()?j.filter(e=>e.matchesSearch):j:[]),[j,c]),W=r(e=>{if(B<2||X<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const n=Ep((e.clientX-t.left)/t.width*B,(e.clientY-t.top)/t.height*X,G);if(n){const e=vp(n);N(e);const t=V>0?(100*n.size/V).toFixed(1):"0",i=o.numTicks>0?(100*n.size/o.numTicks).toFixed(1):"0";I(`${n.name}\ntotal ${gp(n.size)} (${t}% of view, ${i}% of profile) · self ${gp(n.self)}`)}else N(null),I("")},[G,o.numTicks,X,B,V]),K=r(e=>{W(e)},[W]),Y=r(()=>{N(null),I("")},[]),J=r(e=>{x.current={x:e.clientX,y:e.clientY}},[]),q=r(e=>{const{x:t,y:o}=x.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-o)>3)return;if(B<2||X<2)return;const n=e.currentTarget.getBoundingClientRect();if(n.width<1||n.height<1)return;const i=Ep((e.clientX-n.left)/n.width*B,(e.clientY-n.top)/n.height*X,G);if(!i)return;m?.(i.name);const a=function(e){return{level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}}(i);A(e=>{const t=e.length>0?e[e.length-1]:null;return t&&function(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}(a,t)?e.slice(0,-1):[...e,a]})},[G,X,B,m]);g(()=>{const e=S.current;if(!e||B<2||X<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,n=Math.max(B,X),i=Math.min(t,16384/n);e.width=Math.floor(B*i),e.height=Math.floor(X*i),e.style.width=`${B}px`,e.style.height=`${X}px`;const a=e.getContext("2d");a&&(a.setTransform(i,0,0,i,0,0),a.clearRect(0,0,B,X),j?.length?function(e,t,o,n,i,a,l,r){const s=a.v2.colors.silver[900];e.fillStyle=s,e.fillRect(0,0,t,o);const c=i.trim().length>0;e.textRendering="optimizeLegibility";for(const t of n){const{x:o,y:n,w:i,h:l,name:s,size:d,matchesSearch:u}=t;if(c&&!u)continue;const{fill:p,text:h}=xp(s,a);e.fillStyle=p,e.fillRect(o,n,i,l),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(o+.5,n+.5),e.lineTo(o+i-.5,n+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(o+.5,n+.5,Math.max(i-1,0),Math.max(l-1,0));const m=kp(d,r),g=`${s} (${gp(d)}, ${m}%)`,f=a.v2.text.size.xs,b=8,v=5,y=26,C=Math.min(f,Math.floor(l-2));if(i>=y&&C>=b){e.font=`${C}px ${a.font_family.primary}, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`,e.textBaseline="middle",e.textAlign="left";let t=g;for(;t.length>2&&e.measureText(t).width>i-2*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=i-2*v&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,o+v,n+l/2),e.fillStyle=h,e.fillText(t,o+v,n+l/2))}}if(l)for(const t of n){if(vp(t)!==l)continue;if(c&&!t.matchesSearch)continue;const{x:o,y:n,w:i,h:a}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(o+1,n+1,Math.max(i-2,0),Math.max(a-2,0));break}}(a,B,X,j,c,y,O,o.numTicks):(a.fillStyle=y.v2.colors.silver[900],a.fillRect(0,0,B,X)))},[j,o.numTicks,O,c,X,B,y]);const Z=r(()=>D(e=>!e),[]),Q=o.numTicks>0?Math.max(0,Math.min(100,Math.round(V/o.numTicks*100))):100,ee=a(()=>function(e,t,o){const n=o??bp(e),i=t?.offset??0,a=i+(t?.size??e.numTicks),l=(t?.level??-1)+1,r=t?.size??e.numTicks;let s=null;for(const e of n)e.level<l||e.offset<i||e.offset+e.size>a||e.size>=r||(!s||e.size>s.size||e.size===s.size&&e.level<s.level)&&(s=e);return s}(o,U,H),[o,U,H]),te=null!==ee,oe=$.length>0,ne=U?mp(o,U.nameIndex):"",le=r(()=>{A([]),v?.()},[v]),re=r(()=>A(e=>e.slice(0,-1)),[]),se=r(()=>{ee&&A(e=>[...e,ee])},[ee]);return e("div",{style:R?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:y.v2.colors.silver[900]}:{flex:1,minHeight:u,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(pe,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(ie,{label:"Collapse recursive",tooltip:"Collapse straight-line recursion (parent → single same-name child of equal width) into a single bar. Helps deep recursive call chains fit on screen.",labelAlign:ae.Left,size:Et.S,value:M,onChange:z}),e(pe,{$gap:8,children:[e(pe,{children:[t(he,{variant:ge.Secondary,size:me.S,label:"Reset zoom",leftIcon:ll,onClick:le,disabled:!$.length}),t(he,{variant:ge.Secondary,size:me.S,iconSize:20,leftIcon:al,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!oe,onClick:re}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(ce,{size:ue.XXS,color:de.Secondary,nowrap:!0,align:"center",children:`${Q}%`})}),t(he,{variant:ge.Secondary,size:me.S,iconSize:20,leftIcon:wa,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!te,onClick:se})]}),e(pe,{children:[t(Ie,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(fe,{variant:To.Filled,options:[{value:wp.Fit,label:"W: Fit"},{value:wp.X10,label:"10x"}],selected:_,setSelected:P})}),t(Ie,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(fe,{variant:To.Filled,options:[{value:Tp.Fit,label:"H: Fit"},{value:Tp.X10,label:"10x"}],selected:L,setSelected:F})})]}),t(he,{variant:ge.Secondary,size:me.S,iconSize:24,leftIcon:R?Ma:rl,tooltip:R?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:Z})]})]}),t(Ie,{fullWidth:!0,keepAlive:!0,text:E,children:t("div",{ref:C,style:{flex:1,minWidth:0,width:"100%",height:R?"calc(100vh - 80px)":"calc(100vh - 364px)",position:"relative",overflow:"hidden"},children:t("div",{style:{position:"absolute",inset:0,overflowX:_>1?"auto":"hidden",overflowY:L>1?"auto":"hidden"},children:t("div",{style:{width:B||"100%",height:X||"100%",position:"relative"},children:t("canvas",{ref:S,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:O?"pointer":"default"},onPointerDown:J,onPointerMove:K,onPointerLeave:Y,onClick:q})})})})}),e(pe,{$justifyContent:"space-between",children:[t(ce,U?{size:ue.XXXS,color:y.v2.colors.silver[300],children:`Zoomed: ${ne} • ${gp(V)} samples in view`}:{size:ue.XXXS,color:y.v2.colors.silver[300],children:m?"Click a frame to zoom in and jump to its row in the symbol table.":"Click a frame to zoom into its subtree (pprof-style)."}),h&&t(ce,{size:ue.XXXS,color:y.v2.colors.silver[300],children:`${h.activeKeys.length} / ${h.maxSlots} profiling slots · ${Ip(h.totalBytesUsed)} / ${Ip(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})},Np=[ko.Go,ko.Java],$p="Profiling Symbols";function Ap(e,t){if(0===t.length)return null;const o=1===t.length?t[0]:function(e){return e.includes("/")||/\.\(\*?[^)]+\)\./.test(e)?ko.Go:e.includes(" ")||e.includes("(")?ko.Java:ko.Go}(e);if(o===ko.Go){const t=function(e){let t=e.trim();if(!t)return null;t=t.replace(/\[[^\]]*\]/g,"");const o=t.lastIndexOf("/"),n=t.indexOf(".",o+1);if(-1===n)return null;const i=t.slice(0,n),a=t.slice(n+1);if(!i||!a)return null;const l=a.match(/^\(\*?([^)]+)\)\.(.+)$/);if(l){const e=new He(i,"",l[1],l[2]);return e.Verify()?e:null}const r=new He(i,a);return r.Verify()?r:null}(e);return t?{language:o,golang:t}:null}if(o===ko.Java){const t=function(e){let t=e.trim();if(!t)return null;const o=t.indexOf("(");-1!==o&&(t=t.slice(0,o).trim());const n=t.split(/\s+/);t=n[n.length-1]??"";const i=t.lastIndexOf(".");if(-1===i)return null;const a=t.slice(0,i),l=t.slice(i+1),r=new je(a,l);return r.Verify()?r:null}(e);return t?{language:o,java:t}:null}return null}function Rp(e,t){return e.namespace===t.namespace&&e.name===t.name&&e.kind===t.kind}function Dp(e,t,o){if(!e)return!0;const{sources:n=[],namespaces:i=[],languages:a=[]}=e,l=!n.length||n.some(e=>Rp(e,t.id)),r=!i.length||i.includes(t.id.namespace),s=!a.length||null==o||a.includes(o);return l&&r&&s}function _p(e,t){return e.packageName===t.packageName&&(e.functionName||"")===(t.functionName||"")&&(e.receiverName||"")===(t.receiverName||"")&&(e.receiverMethodName||"")===(t.receiverMethodName||"")}function Pp(e,t){return e.className===t.className&&e.methodName===t.methodName}function Lp(e,t,o,n){const i=Ap(e,o);if(!i)return[];const a=[];for(const e of n){const o=e.customInstrumentations;if(!o)continue;if(!Dp(e.sourceScopes,t,i.language))continue;const n=!!i.golang&&!!o[Ge.Golang]?.some(e=>_p(e,i.golang)),l=!!i.java&&!!o[Ge.Java]?.some(e=>Pp(e,i.java));(n||l)&&a.push({rule:e,resolved:i})}return a}function Fp({source:e,languages:t,rows:o}){const{instrumentationRulesApi:n,capabilities:i}=Nl(),{items:l}=n.useRules(),[c,d]=s(new Set),[u,p]=s(new Set),[h,m]=s(null),g=a(()=>function(e){const t=new Set(e??[]);return Np.filter(e=>t.has(e))}(t),[t]),f=i.canCreateInstrumentationRule,b=a(()=>function(e,t){const o=e.filter(e=>e.type===We.CustomInstrumentation&&e.ruleName===$p&&Dp(e.sourceScopes,t));return o.find(e=>e.sourceScopes?.sources?.some(e=>Rp(e,t.id)))??o[0]??null}(l,e),[l,e]),v=f&&g.length>0,y=a(()=>{const t=new Map;for(const n of o){const o=!!Ap(n.name,g),i=Lp(n.name,e,g,l),a=!!b&&i.some(e=>e.rule.ruleId===b.ruleId),r=i.filter(e=>e.rule.ruleId!==b?.ruleId),s=!a&&r.length>0,c=v&&o,d=s;let u;if(s){const e=[...new Set(r.map(e=>e.rule.ruleName))];u=`Managed by ${e.length>1?"rules":"rule"} ${e.map(e=>`“${e}”`).join(", ")}. Edit ${e.length>1?"those rules":"that rule"} to change this symbol.`}let p=!1,h="Add this symbol to the “Profiling Symbols” rule";s?h=u??"Managed by another rule":0===i.length&&(0===g.length?h="Custom instrumentation is only available for Go and Java sources":f?o?p=!0:h="This symbol could not be parsed into a probe automatically":h="You don’t have permission to add custom instrumentation"),t.set(n.name,{parsable:o,inManagedRule:a,otherRules:r,showCheckbox:c,checkboxDisabled:d,checkboxTooltip:u,addEnabled:p,addTooltip:h})}return t},[o,l,e,g,f,v,b]),C=a(()=>{const e=new Set;return y.forEach((t,o)=>{t.inManagedRule&&e.add(o)}),e},[y]),S=a(()=>[...c].filter(e=>y.get(e)?.addEnabled&&!C.has(e)),[c,y,C]),x=a(()=>[...u].filter(e=>C.has(e)),[u,C]),w=S.length+x.length,T=r(e=>{const t=y.get(e);return t?.inManagedRule?!u.has(e):!!(t&&t.otherRules.length>0)||c.has(e)},[y,u,c]),k=r((e,t)=>{const o=y.get(e);o&&!o.checkboxDisabled&&(o.inManagedRule?p(o=>{const n=new Set(o);return t?n.delete(e):n.add(e),n}):d(o=>{const n=new Set(o);return t?n.add(e):n.delete(e),n}))},[y]),E=r(()=>{d(new Set),p(new Set)},[]),I=r(t=>{(async()=>{const o=t.add.map(e=>Ap(e,g)).filter(e=>!!e),i=t.remove.map(e=>Ap(e,g)).filter(e=>!!e);if(b){const{customInstrumentations:e,isEmpty:t}=function(e,t,o){const n=e.customInstrumentations??{};let i=[...n[Ge.Golang]??[]],a=[...n[Ge.Java]??[]];for(const e of o)e.golang&&(i=i.filter(t=>!_p(t,e.golang))),e.java&&(a=a.filter(t=>!Pp(t,e.java)));for(const e of t)e.golang&&!i.some(t=>_p(t,e.golang))&&i.push(e.golang),e.java&&!a.some(t=>Pp(t,e.java))&&a.push(e.java);return{customInstrumentations:{[Ge.Golang]:i,[Ge.Java]:a},isEmpty:0===i.length&&0===a.length}}(b,o,i);t?await n.remove(b.ruleId,We.CustomInstrumentation):await n.update(b.ruleId,function(e,t){return{ruleName:e.ruleName,notes:e.notes,disabled:e.disabled,sourceScopes:e.sourceScopes??null,workloads:null,instrumentationLibraries:e.instrumentationLibraries??null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:t}}(b,e),We.CustomInstrumentation)}else o.length>0&&await n.create(function(e,t){const o=e.map(e=>e.golang).filter(e=>!!e),n=e.map(e=>e.java).filter(e=>!!e),i={sources:[{namespace:t.id.namespace,name:t.id.name,kind:t.id.kind}],namespaces:[],languages:[]};return{ruleName:$p,notes:"Symbols selected from the profiling tab.",disabled:!1,sourceScopes:i,workloads:null,instrumentationLibraries:null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:{[Ge.Golang]:o,[Ge.Java]:n}}}(o,e),We.CustomInstrumentation)})()},[b,g,e,n]),O=r(()=>{w&&m({add:S,remove:x})},[w,S,x]),N=r(e=>m({add:[e],remove:[]}),[]),$=r(e=>m({add:[],remove:[e]}),[]),A=r(()=>m(null),[]),R=r(()=>{h&&(I(h),m(null),E())},[h,I,E]),D=r(e=>y.get(e)??{parsable:!1,inManagedRule:!1,otherRules:[],showCheckbox:!1,checkboxDisabled:!1,addEnabled:!1,addTooltip:"Custom instrumentation is only available for Go and Java sources"},[y]);return{instrumentation:a(()=>({getSymbolState:D,onAdd:N,onRemove:$,selectionEnabled:v,isSelected:T,onToggleSymbol:k}),[D,N,$,v,T,k]),pendingCount:w,pendingModify:h,closeModify:A,openBulkModify:O,resetSelection:E,confirmModify:R}}var Mp,zp,Bp;!function(e){e.Symbol="symbol",e.Self="self",e.Total="total"}(Mp||(Mp={})),function(e){e.OnlyInstrumentable="only-instrumentable"}(zp||(zp={})),function(e){e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"}(Bp||(Bp={}));const Xp=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function Up(e,t){const o=function(e){return e.split(" ")[0]??""}(e);if(t.includes(Bp.FilterOutVoid)&&"void"===o)return!1;if(t.includes(Bp.OnlyWithReturnValues)){if(!(e.includes(" ")&&"void"!==o&&Xp.test(o)))return!1}return!0}const Vp=({rows:e,languages:o,instrumentation:n,searchQuery:i,filters:l,onFiltersChange:s,zoomedSymbols:c,highlightSymbol:d,scrollSignal:u})=>{const p=!!o?.includes(ko.Java),h=a(()=>{const t=c?new Set(c):null,o=i?.trim().toLowerCase();return e.filter(e=>(!t||t.has(e.name))&&(!o||e.name.toLowerCase().includes(o)))},[e,i,c]),m=a(()=>{const e=[];if(n.selectionEnabled&&e.push({id:zp.OnlyInstrumentable,label:"Only show instrumentable symbols"}),p&&(e.push({id:Bp.FilterOutVoid,label:"Filter out void symbols"}),e.push({id:Bp.OnlyWithReturnValues,label:"Only show functions with return values"})),0!==e.length)return{options:e,filterRow:(e,t)=>{const o=e.cells.find(e=>e.key===Mp.Symbol)?.rawValue?.toString()??"";return!(t.includes(zp.OnlyInstrumentable)&&!n.getSymbolState(o).showCheckbox)&&Up(o,t)}}},[n,p]),g=a(()=>[{key:Mp.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:m,noFilter:!m},{key:Mp.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:Mp.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[m]),f=a(()=>h.map(e=>{const t=n.getSymbolState(e.name),o=t.showCheckbox;return{id:e.name,cells:[{key:Mp.Symbol,rawValue:e.name},{key:Mp.Self,rawValue:gp(e.self)},{key:Mp.Total,rawValue:gp(e.total)}],isSelected:o?n.isSelected(e.name):void 0,onSelect:o?()=>n.onToggleSymbol(e.name,!0):void 0,onDeselect:o?()=>n.onToggleSymbol(e.name,!1):void 0,hideCheckbox:!o,checkboxDisabled:o?t.checkboxDisabled:void 0,checkboxTooltip:o?t.checkboxTooltip:void 0}}),[h,n]),b=r(e=>{const t=e.cells[0].rawValue,o=n.getSymbolState(t),i=[];return o.inManagedRule?i.push({id:`remove-instrumentation-${t}`,label:"",leftIcon:xa,tooltip:"Remove from the “Profiling Symbols” rule",onClick:()=>n.onRemove(t)}):i.push({id:`add-instrumentation-${t}`,label:"",leftIcon:wa,tooltip:o.addTooltip,disabled:!o.addEnabled,onClick:()=>n.onAdd(t)}),i.push({id:`copy-${t}`,label:"",leftIcon:sl,tooltip:"Copy symbol name",onClick:()=>{navigator.clipboard.writeText(t)}}),i},[n]);return t(Eo,{variant:Io.Data,maxHeight:"calc(100vh - 306px)",columns:g,rows:f,withCheckboxes:n.selectionEnabled,filters:l,onFiltersChange:s,activeRowId:d,scrollSignal:u,getRowActions:b})};var Hp;!function(e){e.Table="table",e.Flame="flame",e.Both="both"}(Hp||(Hp={}));const jp=f(Z)`
310
724
  width: 100%;
311
725
  flex: 1;
312
726
  border-radius: 16px;
313
727
  overflow: hidden;
314
728
  background: ${({theme:e})=>e.v2.colors.silver[800]};
315
729
  box-shadow: 0 2px 14.1px 0 rgba(0, 0, 0, 0.25);
316
- `,zd=g.div`
730
+ `,Gp=f.div`
317
731
  display: flex;
318
732
  align-items: center;
319
733
  gap: 10px;
@@ -321,11 +735,11 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
321
735
  padding: 12px 12px 8px;
322
736
  background: ${({theme:e})=>e.v2.colors.silver[800]};
323
737
  border-radius: 16px 16px 0 0;
324
- `,Bd=g(ue)`
738
+ `,Wp=f(pe)`
325
739
  flex-shrink: 0;
326
740
  align-items: center;
327
741
  gap: 4px;
328
- `,Xd=g.div`
742
+ `,Kp=f.div`
329
743
  flex: 1;
330
744
  display: flex;
331
745
  align-items: stretch;
@@ -333,20 +747,20 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
333
747
  padding: 16px;
334
748
  background: ${({theme:e})=>e.v2.colors.silver[800]};
335
749
  border-radius: 0 0 16px 16px;
336
- `,Vd=g(q)`
750
+ `,Yp=f(Z)`
337
751
  flex: ${({$splitWithFlame:e})=>e?"0 0 min(413px, 42%)":"1 1 auto"};
338
752
  width: ${({$splitWithFlame:e})=>e?"auto":"100%"};
339
753
  max-width: ${({$splitWithFlame:e})=>e?"none":"100%"};
340
754
  gap: 10px;
341
- `,Ud=g(q)`
755
+ `,Jp=f(Z)`
342
756
  flex: ${({$splitWithTable:e})=>e?"1":"1 1 auto"};
343
757
  width: ${({$splitWithTable:e})=>e?"auto":"100%"};
344
758
  gap: 10px;
345
- `,Gd=g(ue)`
759
+ `,qp=f(pe)`
346
760
  width: 100%;
347
761
  min-height: 32px;
348
762
  flex-shrink: 0;
349
- `,Hd=({source:n,onFlameFullscreenChange:c})=>{const d=f(),u=n.id,{profilingApi:p}=gl(),[h,m]=r(!0),[g,b]=r(_d.Both),[v,y]=r(""),[C,S]=r({}),[w,x]=r(!1),k=i(!1);o(()=>{k.current||(k.current=!0,p.enableProfiling?.(u),x(!0))},[p,u]);const{data:T}=p.useSlots({skip:!w,pollInterval:3e3,fetchPolicy:"network-only"}),{data:$,loading:I,refetch:E}=p.useSourceProfiling(u,{skip:!w,pollInterval:h?3e3:0,fetchPolicy:"network-only"}),A=$?.profileJson??null,N=a(()=>function(e){if(!e?.trim())return null;try{const t=JSON.parse(e),n=t.flamebearer;return!n?.names?.length||!Array.isArray(n.levels)||"number"!=typeof n.numTicks||n.numTicks<=0?null:{flamebearer:n,units:t.metadata?.units}}catch{return null}}(A),[A]),O=a(()=>N?function(e){const t=new Map;for(let n=0;n<e.levels.length;n++){const o=e.levels[n];for(let n=0;n+3<o.length;n+=4){const a=o[n+1],i=o[n+2],l=rd(e,o[n+3]);if(!l)continue;const r=t.get(l);(!r||a>r.total)&&t.set(l,{self:i,total:a})}}return[...t.entries()].map(([e,t])=>({name:e,self:t.self,total:t.total})).sort((e,t)=>t.self-e.self)}(N.flamebearer):[],[N]),R=g===_d.Table||g===_d.Both,D=g===_d.Flame||g===_d.Both,P=R&&D,F=a(()=>n.runtimeInfo?.detectedLanguages||n.containers?.map(e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??""),[n]),L=a(()=>function(e,t){if(!t?.includes(Cn.Java))return;const n=(e?.[Od.Symbol]?.filter(Boolean)??[]).filter(e=>e===Dd.FilterOutVoid||e===Dd.OnlyWithReturnValues);return 0!==n.length?e=>Fd(e,n):void 0}(C,F),[C,F]),{instrumentation:_,pendingCount:M,pendingModify:z,closeModify:B,openBulkModify:X,resetSelection:V,confirmModify:U}=Nd({source:n,languages:F,rows:O}),[G,H]=r(null),[j,W]=r(0),[K,Y]=r(null),J=l(e=>{H(e),W(e=>e+1),b(e=>e===_d.Flame?_d.Both:e)},[]);return!A&&I?t(pt,{$height:"70vh",children:t(bt,{withSpinner:!0})}):e(Md,{$gap:0,$width:"100%",children:[e(zd,{children:[t(ze,{text:"Live CPU profile collected from the workload agent. Search symbols, switch between the table and flame graph, or download a JSON snapshot.",withIcon:!0,children:t(Bd,{children:t(se,{size:de.S,weight:500,color:ce.Primary,nowrap:!0,children:"CPU Profiling"})})}),e(ue,{style:{flex:1,minWidth:200,gap:10,alignItems:"center",flexWrap:"wrap"},children:[t("div",{style:{flex:"1 1 220px",minWidth:180},children:t(nn,{value:v,onChange:y,placeholder:"Search by symbol name",width:"100%",idleBackgroundColor:d.v2.colors.silver[900],emphasizeBackgroundColor:d.v2.colors.silver[800]})}),t(ge,{variant:yn.Filled,options:[{value:_d.Table,label:"Top table"},{value:_d.Flame,label:"Flame graph"},{value:_d.Both,label:"Both"}],selected:g,setSelected:b}),t(pe,h?{variant:me.Secondary,size:he.S,label:"Live",tooltip:"Odigos profiler works in-memory and doesn't store any data on disk, to keep minimum memory footprint we store only last 10 minutes of data on demand",leftIcon:e=>t(Ji,{...e,size:8,fill:d.v2.colors.green[500]})}:{variant:me.Secondary,size:he.S,label:"Paused",tooltip:"Odigos profiler is still collecting data, but the UI is not updating in real time",leftIcon:e=>t(Ji,{...e,size:8,fill:d.v2.colors.red[500]})})]})]}),t(Xd,{$gap:R&&D?16:0,children:N?e(s,{children:[R&&e(Vd,{$splitWithFlame:P,children:[e(Gd,{$justifyContent:"space-between",children:[e(q,{$margin:"0 0 0 20px",children:[t(se,{size:de.XXXS,nowrap:!0,children:"Please select symbols to"}),e(ue,{$gap:8,children:[e(ue,{children:[t(qi,{size:24}),t(se,{size:de.S,color:ce.Success,nowrap:!0,children:"Custom Instrument"})]}),t(pe,{leftIcon:Ci,variant:me.Secondary,size:he.S,onClick:()=>window.open(`${De}/enterprise/pipeline/rules/custominstrumentation`,"_blank","noopener noreferrer")})]})]}),e(ue,{$gap:8,children:[K&&t(ze,{text:"The table is scoped to the symbols inside the flame graph’s current zoom. Use “Reset zoom” on the flame graph to show all symbols again.",children:t(je,{label:`Zoomed: ${K.length} symbols`,backgroundColor:d.v2.colors.silver[750],textColor:d.v2.colors.silver[200],textSize:de.XXS})}),t(pe,{variant:me.Secondary,size:he.S,label:"Download snapshot",rightIcon:Zi,onClick:()=>{if(!A)return;const e=new Blob([A],{type:"application/json"}),t=URL.createObjectURL(e),o=document.createElement("a");o.href=t,o.download=`cpu-profile-${n.id.namespace}-${n.id.kind}-${n.id.name}.json`,o.click(),URL.revokeObjectURL(t)},disabled:!A})]})]}),t(Ld,{rows:O,languages:F,instrumentation:_,searchQuery:v,filters:C,onFiltersChange:S,zoomedSymbols:K,highlightSymbol:G,scrollSignal:j})]}),D&&e(Ud,{$splitWithTable:P,children:[e(Gd,{$justifyContent:"space-between",children:[t(je,{label:N?`Total in view ${sd(N.flamebearer.numTicks)}`:"No profile sample yet",backgroundColor:d.v2.colors.silver[750],textColor:d.v2.colors.silver[200],textSize:de.XXS}),e(ue,{$gap:12,children:[!h&&t(pe,{variant:me.Secondary,size:he.S,label:"Refresh",leftIcon:zi,onClick:E}),t(oe,{label:"Auto refresh",labelAlign:ae.Left,size:kt.S,value:h,onChange:m})]})]}),t(Sd,{flamebearer:N.flamebearer,maxRowPx:24,searchQuery:v,shouldKeepName:L,minHostHeight:280,onFullscreenChange:c,profilingSlots:T??null,onFrameClick:J,onZoomedSymbolsChange:Y,onResetZoom:()=>H(null)},g)]})]}):t(pt,{children:t(Ie,{title:"No profile samples yet",subTitle:"Dynamically collecting profiling samples — keep this tab open while the agent sends OTLP profiles."})})}),t(ld,{pendingModify:z,onClose:B,onConfirm:U}),t(xn,{isOpen:M>0,richTitle:{icon:Ri,title:"Profiling Symbols",badge:{label:M}},actions:[{id:"profiling-bulk-cancel",type:tn.Button,buttonProps:{variant:me.Secondary,size:he.S,label:"Cancel",onClick:V}},{id:"profiling-bulk-apply",type:tn.Button,buttonProps:{variant:me.Primary,size:he.S,label:"Modify Rule",leftIcon:wi,onClick:X}}]})]})},jd=g.div`
763
+ `,Zp=({source:o,onFlameFullscreenChange:n})=>{const d=b(),u=o.id,{profilingApi:p}=Nl(),[h,m]=s(!0),[g,f]=s(Hp.Both),[v,y]=s(""),[C,S]=s({}),[x,w]=s(!1),T=l(!1);i(()=>{T.current||(T.current=!0,p.enableProfiling?.(u),w(!0))},[p,u]);const{data:k}=p.useSlots({skip:!x,pollInterval:3e3,fetchPolicy:"network-only"}),{data:E,loading:I,refetch:O}=p.useSourceProfiling(u,{skip:!x,pollInterval:h?3e3:0,fetchPolicy:"network-only"}),N=E?.profileJson??null,$=a(()=>function(e){if(!e?.trim())return null;try{const t=JSON.parse(e),o=t.flamebearer;return!o?.names?.length||!Array.isArray(o.levels)||"number"!=typeof o.numTicks||o.numTicks<=0?null:{flamebearer:o,units:t.metadata?.units}}catch{return null}}(N),[N]),A=a(()=>$?function(e){const t=new Map;for(let o=0;o<e.levels.length;o++){const n=e.levels[o];for(let o=0;o+3<n.length;o+=4){const i=n[o+1],a=n[o+2],l=mp(e,n[o+3]);if(!l)continue;const r=t.get(l);(!r||i>r.total)&&t.set(l,{self:a,total:i})}}return[...t.entries()].map(([e,t])=>({name:e,self:t.self,total:t.total})).sort((e,t)=>t.self-e.self)}($.flamebearer):[],[$]),R=g===Hp.Table||g===Hp.Both,D=g===Hp.Flame||g===Hp.Both,_=R&&D,P=a(()=>o.runtimeInfo?.detectedLanguages||o.containers?.map(e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??""),[o]),L=a(()=>function(e,t){if(!t?.includes(ko.Java))return;const o=(e?.[Mp.Symbol]?.filter(Boolean)??[]).filter(e=>e===Bp.FilterOutVoid||e===Bp.OnlyWithReturnValues);return 0!==o.length?e=>Up(e,o):void 0}(C,P),[C,P]),{instrumentation:F,pendingCount:M,pendingModify:z,closeModify:B,openBulkModify:X,resetSelection:U,confirmModify:V}=Fp({source:o,languages:P,rows:A}),[H,j]=s(null),[G,W]=s(0),[K,Y]=s(null),J=r(e=>{j(e),W(e=>e+1),f(e=>e===Hp.Flame?Hp.Both:e)},[]);return!N&&I?t(mt,{$height:"70vh",children:t(yt,{withSpinner:!0})}):e(jp,{$gap:0,$width:"100%",children:[e(Gp,{children:[t(Ie,{text:"Live CPU profile collected from the workload agent. Search symbols, switch between the table and flame graph, or download a JSON snapshot.",withIcon:!0,children:t(Wp,{children:t(ce,{size:ue.S,weight:500,color:de.Primary,nowrap:!0,children:"CPU Profiling"})})}),e(pe,{style:{flex:1,minWidth:200,gap:10,alignItems:"center",flexWrap:"wrap"},children:[t("div",{style:{flex:"1 1 220px",minWidth:180},children:t(so,{value:v,onChange:y,placeholder:"Search by symbol name",width:"100%",idleBackgroundColor:d.v2.colors.silver[900],emphasizeBackgroundColor:d.v2.colors.silver[800]})}),t(fe,{variant:To.Filled,options:[{value:Hp.Table,label:"Top table"},{value:Hp.Flame,label:"Flame graph"},{value:Hp.Both,label:"Both"}],selected:g,setSelected:f}),t(he,h?{variant:ge.Secondary,size:me.S,label:"Live",tooltip:"Odigos profiler works in-memory and doesn't store any data on disk, to keep minimum memory footprint we store only last 10 minutes of data on demand",leftIcon:e=>t(cl,{...e,size:8,fill:d.v2.colors.green[500]})}:{variant:ge.Secondary,size:me.S,label:"Paused",tooltip:"Odigos profiler is still collecting data, but the UI is not updating in real time",leftIcon:e=>t(cl,{...e,size:8,fill:d.v2.colors.red[500]})})]})]}),t(Kp,{$gap:R&&D?16:0,children:$?e(c,{children:[R&&e(Yp,{$splitWithFlame:_,children:[e(qp,{$justifyContent:"space-between",children:[e(Z,{$margin:"0 0 0 20px",children:[t(ce,{size:ue.XXXS,nowrap:!0,children:"Please select symbols to"}),e(pe,{$gap:8,children:[e(pe,{children:[t(dl,{size:24}),t(ce,{size:ue.S,color:de.Success,nowrap:!0,children:"Custom Instrument"})]}),t(he,{leftIcon:Ia,variant:ge.Secondary,size:me.S,onClick:()=>window.open(`${Le}/enterprise/pipeline/rules/custominstrumentation`,"_blank","noopener noreferrer")})]})]}),e(pe,{$gap:8,children:[K&&t(Ie,{text:"The table is scoped to the symbols inside the flame graph’s current zoom. Use “Reset zoom” on the flame graph to show all symbols again.",children:t(Ke,{label:`Zoomed: ${K.length} symbols`,backgroundColor:d.v2.colors.silver[750],textColor:d.v2.colors.silver[200],textSize:ue.XXS})}),t(he,{variant:ge.Secondary,size:me.S,label:"Download snapshot",rightIcon:ul,onClick:()=>{if(!N)return;const e=new Blob([N],{type:"application/json"}),t=URL.createObjectURL(e),n=document.createElement("a");n.href=t,n.download=`cpu-profile-${o.id.namespace}-${o.id.kind}-${o.id.name}.json`,n.click(),URL.revokeObjectURL(t)},disabled:!N})]})]}),t(Vp,{rows:A,languages:P,instrumentation:F,searchQuery:v,filters:C,onFiltersChange:S,zoomedSymbols:K,highlightSymbol:H,scrollSignal:G})]}),D&&e(Jp,{$splitWithTable:_,children:[e(qp,{$justifyContent:"space-between",children:[t(Ke,{label:$?`Total in view ${gp($.flamebearer.numTicks)}`:"No profile sample yet",backgroundColor:d.v2.colors.silver[750],textColor:d.v2.colors.silver[200],textSize:ue.XXS}),e(pe,{$gap:12,children:[!h&&t(he,{variant:ge.Secondary,size:me.S,label:"Refresh",leftIcon:Ka,onClick:O}),t(ie,{label:"Auto refresh",labelAlign:ae.Left,size:Et.S,value:h,onChange:m})]})]}),t(Op,{flamebearer:$.flamebearer,maxRowPx:24,searchQuery:v,shouldKeepName:L,minHostHeight:280,onFullscreenChange:n,profilingSlots:k??null,onFrameClick:J,onZoomedSymbolsChange:Y,onResetZoom:()=>j(null)},g)]})]}):t(mt,{children:t($e,{title:"No profile samples yet",subTitle:"Dynamically collecting profiling samples — keep this tab open while the agent sends OTLP profiles."})})}),t(hp,{pendingModify:z,onClose:B,onConfirm:V}),t(Oo,{isOpen:M>0,richTitle:{icon:za,title:"Profiling Symbols",badge:{label:M}},actions:[{id:"profiling-bulk-cancel",type:ro.Button,buttonProps:{variant:ge.Secondary,size:me.S,label:"Cancel",onClick:U}},{id:"profiling-bulk-apply",type:ro.Button,buttonProps:{variant:ge.Primary,size:me.S,label:"Modify Rule",leftIcon:Na,onClick:X}}]})]})},Qp=f.div`
350
764
  position: relative;
351
765
  display: flex;
352
766
  align-items: center;
@@ -354,17 +768,17 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
354
768
  padding: 8px 16px;
355
769
  border-radius: 12px;
356
770
  background-color: ${({theme:e})=>e.v2.colors.silver[700]};
357
- `,Wd=g.div`
771
+ `,eh=f.div`
358
772
  display: flex;
359
773
  flex-direction: column;
360
774
  gap: 4px;
361
775
  flex: 1;
362
776
  min-width: 0;
363
- `,Kd=g.div`
777
+ `,th=f.div`
364
778
  min-width: 0;
365
779
  white-space: pre;
366
780
  overflow-x: auto;
367
- `,Yd=g.div`
781
+ `,oh=f.div`
368
782
  position: absolute;
369
783
  top: 50%;
370
784
  right: 8px;
@@ -373,24 +787,24 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
373
787
  pointer-events: none;
374
788
  transition: opacity 0.15s ease;
375
789
 
376
- ${jd}:hover & {
790
+ ${Qp}:hover & {
377
791
  opacity: 1;
378
792
  pointer-events: auto;
379
793
  }
380
- `,Jd=({name:n,summary:o,onJumpToRule:a})=>e(jd,{children:[e(Wd,{children:[n&&t(se,{size:de.XXXS,color:ce.Secondary,nowrap:!0,children:n}),t(Kd,{children:t(S,{parts:o})})]}),a&&t(Yd,{children:t(ze,{text:Je.OPEN_IN_SAMPLING_PAGE,children:t(pe,{"data-id":"sampling-rule-jump",variant:me.Primary,size:he.S,leftIcon:Ki,onClick:a})})})]}),qd=g.div`
794
+ `,nh=({name:o,summary:n,onJumpToRule:i})=>e(Qp,{children:[e(eh,{children:[o&&t(ce,{size:ue.XXXS,color:de.Secondary,nowrap:!0,children:o}),t(th,{children:t(x,{parts:n})})]}),i&&t(oh,{children:t(Ie,{text:Ze.OPEN_IN_SAMPLING_PAGE,children:t(he,{"data-id":"sampling-rule-jump",variant:ge.Primary,size:me.S,leftIcon:rl,onClick:i})})})]}),ih=f.div`
381
795
  opacity: 0;
382
796
  pointer-events: none;
383
797
  transition: opacity 0.15s ease;
384
- `,Zd=g.div`
385
- &:hover ${qd} {
798
+ `,ah=f.div`
799
+ &:hover ${ih} {
386
800
  opacity: 1;
387
801
  pointer-events: auto;
388
802
  }
389
- `,Qd=g.div`
803
+ `,lh=f.div`
390
804
  display: flex;
391
805
  align-items: center;
392
806
  padding: 4px 12px;
393
- `,eu=({source:e,onRedirectToSampling:n})=>t(Dt,{bgTint:"1000",richTitle:{title:Je.CONTAINERS,badge:{label:e.containers?.length??0}},children:e.containers?.map(e=>t(ou,{container:e,onRedirectToSampling:n},e.containerName))});var tu;!function(e){e.All="all",e.Noisy="noisy",e.HighlyRelevant="highly-relevant",e.CostReduction="cost-reduction"}(tu||(tu={}));const nu=e=>"noisy"===e.type?w(e.rule,"source"):"highlyRelevant"===e.type?x(e.rule,"source"):"costReduction"===e.type?k(e.rule,"source"):[],ou=({container:n,onRedirectToSampling:o})=>{const[i,l]=r(tu.All),s=an(e=>e.setPendingViewSamplingRule),c=n.agentConfig?.traces?.headSampling?.noisyOperations??[],d=a(()=>(n.collectorConfig?.tailSampling?.noisyOperations??[]).map(e=>({type:"noisy",rule:e})),[n.agentConfig?.traces?.headSampling?.noisyOperations]),u=a(()=>(n.collectorConfig?.tailSampling?.highlyRelevantOperations??[]).map(e=>({type:"highlyRelevant",rule:e})),[n.collectorConfig?.tailSampling?.highlyRelevantOperations]),p=a(()=>(n.collectorConfig?.tailSampling?.costReductionRules??[]).map(e=>({type:"costReduction",rule:e})),[n.collectorConfig?.tailSampling?.costReductionRules]),h=a(()=>i===tu.Noisy?d:i===tu.HighlyRelevant?u:i===tu.CostReduction?p:[...d,...u,...p],[i,u,p]),m=d.length+u.length+p.length,g=a(()=>(e,t)=>{s({ruleId:e,category:t}),o()},[o,s]),f=t(qd,{children:t(pe,{"data-id":"sampling-container-create-rule",variant:me.Secondary,size:he.S,label:kn,rightIcon:fi,onClick:e=>{e.stopPropagation(),o()}})});return t(Zd,{children:e(Dt,{bgTint:"900",richTitle:{title:n.containerName},renderOnRightSide:f,withCollapse:!0,collapseIsDefaultOpen:!0,children:[c.length?e(Dt,{bgTint:"800",richTitle:{title:Je.HEAD_SAMPLING,badge:{label:c.length}},children:[t(se,{size:de.XXS,children:Je.NOISY_OPERATIONS}),t(q,{$gap:4,children:c.map(e=>t(Jd,{name:e.name,summary:w(e),onJumpToRule:()=>g(e.ruleId,"noisy")},e.ruleId))})]}):t(Qd,{children:t(se,{size:de.XS,color:ce.Secondary,children:Je.HEAD_SAMPLING})}),m?e(Dt,{bgTint:"800",richTitle:{title:Je.TAIL_SAMPLING,badge:{label:m}},children:[t(ge,{options:(b=d.length,v=u.length,y=p.length,[{value:tu.All,label:"All",badge:{label:b+v+y,textSize:de.XXXS}},{value:tu.Noisy,label:Je.NOISY_OPERATIONS,badge:{label:b,textSize:de.XXXS}},{value:tu.HighlyRelevant,label:Je.HIGHLY_RELEVANT_OPERATIONS,badge:{label:v,textSize:de.XXXS}},{value:tu.CostReduction,label:Je.COST_REDUCTION_OPERATIONS,badge:{label:y,textSize:de.XXXS}}]),selected:i,setSelected:l}),t(q,{$gap:4,children:h.length?h.map(e=>t(Jd,{name:e.rule.name,summary:nu(e),onJumpToRule:()=>g(e.rule.ruleId,e.type)},e.rule.ruleId)):t(Ie,{title:`No ${i===tu.All?`${tu.Noisy}, ${tu.HighlyRelevant} and ${tu.CostReduction}`:i} operations`})})]}):t(Qd,{children:t(se,{size:de.XS,color:ce.Secondary,children:Je.TAIL_SAMPLING})})]})});var b,v,y},au=[dn.Deployment,dn.StatefulSet,dn.DaemonSet,dn.DeploymentConfig,dn.Rollout,dn.Pod];var iu;!function(e){e.Workload="Workload",e.Pod="Pod"}(iu||(iu={}));const lu=e=>!!e&&Jt(e.status)===Re.Error,ru=e=>lu(e.healthStatus),su=e=>lu(e.odigosHealthStatus)||(e.processes??[]).some(ru),cu=e=>lu(e.agentInjectedStatus)||lu(e.odigosHealthStatus)||(e.containers??[]).some(su),du=({onClose:n,sourceId:s,onRedirectToSampling:c})=>{const d=f(),{isVm:u}=y(),{sourcesApi:p,configApi:h}=gl(),{selectedStreamName:m}=qe(),{genericForm:g,loadSource:b,validateFormData:v}=Xl(),{data:C}=h.useEffectiveConfig(),[S,w]=r(!1),[x,k]=r(!1),[T,$]=r(!1),[I,E]=r(lc.Overview),[A,N]=r(null),[O,R]=r({openFor:null}),D=(()=>{const[e,t]=r(null),n=l(e=>{t({tab:lc.Pods,podName:e.podName})},[]),o=l((e,n)=>{t({tab:lc.Pods,podName:e.podName,containerName:n.containerName})},[]),i=l((e,n,o)=>{const a=pc({identifyingAttributes:o.identifyingAttributes});t({tab:lc.Pods,podName:e.podName,containerName:n.containerName,processPid:a})},[]),s=l(()=>t(null),[]);return a(()=>({jumpToTarget:e,jumpToPod:n,jumpToContainer:o,jumpToProcess:i,clearJumpToTarget:s}),[e,n,o,i,s])})();o(()=>{D.jumpToTarget&&E(D.jumpToTarget.tab)},[D.jumpToTarget]),o(()=>{A&&JSON.stringify(ln(s))!==JSON.stringify(ln(A))&&N(null)},[s,A]);const P=i(!1),F=l(async()=>N(await p.fetchById(s)||null),[s,p]);o(()=>{if(P.current||(F(),P.current=!0),!S){const e=setInterval(()=>F(),3e3);return()=>clearInterval(e)}},[F,S]),o(()=>{A&&b(A)},[A]);const L=A&&au.includes(A.id.kind),_=a(()=>{const e=[],n=(A?.pods??[]).some(cu);return e.push({value:lc.Overview,label:Je.OVERVIEW}),u||(e.push({value:lc.Pods,label:Je.PODS,icon:n?e=>t(Bi,{...e,fill:d.v2.colors.red[500]}):void 0}),e.push({value:lc.PeerSources,label:Je.PEER_SOURCES}),C?.profiling?.enabled&&e.push({value:lc.Profiling,label:Je.PROFILING}),e.push({value:lc.Sampling,label:Je.SAMPLING}),e.push({value:lc.Debug,label:Je.DEBUG})),e},[u,C,A?.pods]),M=l(()=>w(!0),[]),z=a(()=>()=>{n(),c()},[n,c]),B=l(()=>{A&&b(A),w(!1)},[A]),X=l(async()=>{if(!A||!g)return;const{errorMessage:e,preparedFormData:t}=v();if(e)return;const n=t.otelServiceName!==A.id.name?t.otelServiceName:"";await p.update(s,{...t,otelServiceName:n}),w(!1)},[A,g,v,s,p]),V=l(()=>k(!0),[]),U=l(async()=>{A&&(await p.persistV2({[Et]:[{namespace:A.id.namespace,name:A.id.name,kind:A.id.kind,selected:!1,currentStreamName:m}]}),k(!1),n())},[A,p,m,n]),G=l(()=>{R({openFor:iu.Workload})},[]),H=l(e=>{E(e),D.clearJumpToTarget()},[D]),j=l(async()=>{await p.recoverFromRollback(s)},[p,s]),W=l(()=>R({openFor:null}),[]),K=l(async()=>{O.openFor===iu.Workload?await p.restartWorkloads([s]):O.openFor===iu.Pod&&O.podNamespace&&O.podName&&await p.restartPod(O.podNamespace,O.podName),W()},[O,p,s,W]),Y=a(()=>{const{kind:e,name:t}=s;return{title:`Rollout ${e}`,description:`Are you sure you want to rollout the ${e.toLowerCase()} "${t}"?`}},[s]),J=a(()=>{const e=[];return S||I===lc.Overview&&(e.push({id:"edit-source-btn-edit",label:Rt.EDIT,icon:wi,active:S,onClick:M}),!u&&L&&e.push({id:"edit-source-btn-restart",label:Je.ROLLOUT,icon:Qi,onClick:G}),e.push({id:"edit-source-btn-delete",label:Rt.UNINSTRUMENT,icon:gi,color:d.v2.colors.red[500],active:x,onClick:V})),e},[I,S,x,u,L,M,G,V,d]),Z=a(()=>{if(!A)return[];const e=[],t={backgroundColor:"transparent",textSize:de.S};return e.push({...t,label:A.id.name,leftIcon:u?void 0:Mi}),A.serviceName&&A.serviceName!==A.id.name&&e.push({...t,label:A.serviceName,leftIcon:_i,textColor:d.v2.colors.silver[200]}),e},[A,d,u]);if(!A)return t(le,{isOpen:!0,children:t(pt,{$height:"80vh",children:t(bt,{withSpinner:!0})})});const Q=I===lc.Profiling?T?"95vw":"fit-content":S?void 0:"60vw";return e(Sc,{value:D,children:[t(le,{isOpen:!0,width:Q,minWidth:"777px",header:{icon:u?el:Tn(A.containers)[0],titleBadges:Z,onClose:()=>{H(lc.Overview),N(null),$(!1),n()},actions:J},footer:{actions:S?[{"data-id":"edit-source-btn-cancel",label:Rt.CANCEL,variant:me.Secondary,onClick:B},{"data-id":"edit-source-btn-save",label:Rt.SAVE,variant:me.Primary,onClick:X}]:[]},children:t(dt,{$padding:"4px 12px 12px",children:e(q,{$gap:16,children:[!S&&_.length>1&&t(ge,{options:_,selected:I,setSelected:H}),(()=>{switch(I){case lc.Overview:return S?t(ss,{}):t(od,{source:A,onClickRollout:G,onClickRollback:j});case lc.Pods:return t($c,{source:A,onClickRestartPod:L?(e,t)=>R({openFor:iu.Pod,podNamespace:e,podName:t}):void 0});case lc.PeerSources:return t(Ic,{source:A});case lc.Profiling:return t(Hd,{source:A,onFlameFullscreenChange:$});case lc.Sampling:return t(eu,{source:A,onRedirectToSampling:z});case lc.Debug:return t(Rc,{source:A});default:return null}})()]})})}),t(Nl,{target:"source",action:"uninstrument",isOpen:x,onClose:()=>k(!1),onApprove:U}),t(Ye,{isOpen:O.openFor===iu.Workload,title:Y.title,description:Y.description,onClose:W,denyButton:{label:"Go back",variant:me.Secondary,onClick:W},approveButton:{label:Rt.CONFIRM,variant:me.Primary,onClick:K}}),t(Nl,{target:"pod",action:"restart",description:Je.ROLLOUT_RESTART_WORKLOADS_DESCRIPTION,isOpen:O.openFor===iu.Pod,onClose:W,onApprove:K,overrideApproveButtonLabel:Je.DELETE_POD_TO_RESTART})]})},uu=g.div`
807
+ `,rh=({source:e,onRedirectToSampling:o})=>t(zt,{bgTint:"1000",richTitle:{title:Ze.CONTAINERS,badge:{label:e.containers?.length??0}},children:e.containers?.map(e=>t(dh,{container:e,onRedirectToSampling:o},e.containerName))});var sh;!function(e){e.All="all",e.Noisy="noisy",e.HighlyRelevant="highly-relevant",e.CostReduction="cost-reduction"}(sh||(sh={}));const ch=e=>"noisy"===e.type?w(e.rule,"source"):"highlyRelevant"===e.type?T(e.rule,"source"):"costReduction"===e.type?k(e.rule,"source"):[],dh=({container:o,onRedirectToSampling:n})=>{const[i,l]=s(sh.All),r=uo(e=>e.setPendingViewSamplingRule),c=o.agentConfig?.traces?.headSampling?.noisyOperations??[],d=a(()=>(o.collectorConfig?.tailSampling?.noisyOperations??[]).map(e=>({type:"noisy",rule:e})),[o.agentConfig?.traces?.headSampling?.noisyOperations]),u=a(()=>(o.collectorConfig?.tailSampling?.highlyRelevantOperations??[]).map(e=>({type:"highlyRelevant",rule:e})),[o.collectorConfig?.tailSampling?.highlyRelevantOperations]),p=a(()=>(o.collectorConfig?.tailSampling?.costReductionRules??[]).map(e=>({type:"costReduction",rule:e})),[o.collectorConfig?.tailSampling?.costReductionRules]),h=a(()=>i===sh.Noisy?d:i===sh.HighlyRelevant?u:i===sh.CostReduction?p:[...d,...u,...p],[i,u,p]),m=d.length+u.length+p.length,g=a(()=>(e,t)=>{r({ruleId:e,category:t}),n()},[n,r]),f=t(ih,{children:t(he,{"data-id":"sampling-container-create-rule",variant:ge.Secondary,size:me.S,label:No,rightIcon:wa,onClick:e=>{e.stopPropagation(),n()}})});return t(ah,{children:e(zt,{bgTint:"900",richTitle:{title:o.containerName},renderOnRightSide:f,withCollapse:!0,collapseIsDefaultOpen:!0,children:[c.length?e(zt,{bgTint:"800",richTitle:{title:Ze.HEAD_SAMPLING,badge:{label:c.length}},children:[t(ce,{size:ue.XXS,children:Ze.NOISY_OPERATIONS}),t(Z,{$gap:4,children:c.map(e=>t(nh,{name:e.name,summary:w(e),onJumpToRule:()=>g(e.ruleId,"noisy")},e.ruleId))})]}):t(lh,{children:t(ce,{size:ue.XS,color:de.Secondary,children:Ze.HEAD_SAMPLING})}),m?e(zt,{bgTint:"800",richTitle:{title:Ze.TAIL_SAMPLING,badge:{label:m}},children:[t(fe,{options:(b=d.length,v=u.length,y=p.length,[{value:sh.All,label:"All",badge:{label:b+v+y,textSize:ue.XXXS}},{value:sh.Noisy,label:Ze.NOISY_OPERATIONS,badge:{label:b,textSize:ue.XXXS}},{value:sh.HighlyRelevant,label:Ze.HIGHLY_RELEVANT_OPERATIONS,badge:{label:v,textSize:ue.XXXS}},{value:sh.CostReduction,label:Ze.COST_REDUCTION_OPERATIONS,badge:{label:y,textSize:ue.XXXS}}]),selected:i,setSelected:l}),t(Z,{$gap:4,children:h.length?h.map(e=>t(nh,{name:e.rule.name,summary:ch(e),onJumpToRule:()=>g(e.rule.ruleId,e.type)},e.rule.ruleId)):t($e,{title:`No ${i===sh.All?`${sh.Noisy}, ${sh.HighlyRelevant} and ${sh.CostReduction}`:i} operations`})})]}):t(lh,{children:t(ce,{size:ue.XS,color:de.Secondary,children:Ze.TAIL_SAMPLING})})]})});var b,v,y},uh=[fo.Deployment,fo.StatefulSet,fo.DaemonSet,fo.DeploymentConfig,fo.Rollout,fo.Pod];var ph;!function(e){e.Workload="Workload",e.Pod="Pod"}(ph||(ph={}));const hh=e=>!!e&&oo(e.status)===Pe.Error,mh=e=>hh(e.healthStatus),gh=e=>hh(e.odigosHealthStatus)||(e.processes??[]).some(mh),fh=e=>hh(e.agentInjectedStatus)||hh(e.odigosHealthStatus)||(e.containers??[]).some(gh),bh=({onClose:o,sourceId:n,onRedirectToSampling:c})=>{const d=b(),{isVm:u}=C(),{sourcesApi:p,configApi:h}=Nl(),{selectedStreamName:m}=Qe(),{genericForm:g,loadSource:f,validateFormData:v}=or(),{data:y}=h.useEffectiveConfig(),[S,x]=s(!1),[w,T]=s(!1),[k,E]=s(!1),[I,O]=s(hu.Overview),[N,$]=s(null),[A,R]=s({openFor:null}),D=(()=>{const[e,t]=s(null),o=r(e=>{t({tab:hu.Pods,podName:e.podName})},[]),n=r((e,o)=>{t({tab:hu.Pods,podName:e.podName,containerName:o.containerName})},[]),i=r((e,o,n)=>{const i=yu({identifyingAttributes:n.identifyingAttributes});t({tab:hu.Pods,podName:e.podName,containerName:o.containerName,processPid:i})},[]),l=r(()=>t(null),[]);return a(()=>({jumpToTarget:e,jumpToPod:o,jumpToContainer:n,jumpToProcess:i,clearJumpToTarget:l}),[e,o,n,i,l])})();i(()=>{D.jumpToTarget&&O(D.jumpToTarget.tab)},[D.jumpToTarget]),i(()=>{N&&JSON.stringify(po(n))!==JSON.stringify(po(N))&&$(null)},[n,N]);const _=l(!1),P=r(async()=>$(await p.fetchById(n)||null),[n,p]);i(()=>{if(_.current||(P(),_.current=!0),!S){const e=setInterval(()=>P(),3e3);return()=>clearInterval(e)}},[P,S]),i(()=>{N&&f(N)},[N]);const L=N&&uh.includes(N.id.kind),F=a(()=>{const e=[],o=(N?.pods??[]).some(fh);return e.push({value:hu.Overview,label:Ze.OVERVIEW}),u||(e.push({value:hu.Pods,label:Ze.PODS,icon:o?e=>t(Qa,{...e,fill:d.v2.colors.red[500]}):void 0}),e.push({value:hu.PeerSources,label:Ze.PEER_SOURCES}),y?.profiling?.enabled&&e.push({value:hu.Profiling,label:Ze.PROFILING}),e.push({value:hu.Sampling,label:Ze.SAMPLING}),e.push({value:hu.Debug,label:Ze.DEBUG})),e},[u,y,N?.pods]),M=r(()=>x(!0),[]),z=a(()=>()=>{o(),c()},[o,c]),B=r(()=>{N&&f(N),x(!1)},[N]),X=r(async()=>{if(!N||!g)return;const{errorMessage:e,preparedFormData:t}=v();if(e)return;const o=t.otelServiceName!==N.id.name?t.otelServiceName:"";await p.update(n,{...t,otelServiceName:o}),x(!1)},[N,g,v,n,p]),U=r(()=>T(!0),[]),V=r(async()=>{N&&(await p.persistV2({[$t]:[{namespace:N.id.namespace,name:N.id.name,kind:N.id.kind,...N.id.region?{region:N.id.region}:{},selected:!1,currentStreamName:m}]}),T(!1),o())},[N,p,m,o]),H=r(()=>{R({openFor:ph.Workload})},[]),j=r(e=>{O(e),D.clearJumpToTarget()},[D]),G=r(async()=>{await p.recoverFromRollback(n)},[p,n]),W=r(()=>R({openFor:null}),[]),K=r(async()=>{A.openFor===ph.Workload?await p.restartWorkloads([n]):A.openFor===ph.Pod&&A.podNamespace&&A.podName&&await p.restartPod(A.podNamespace,A.podName),W()},[A,p,n,W]),Y=a(()=>{const{kind:e,name:t}=n;return{title:`Rollout ${e}`,description:`Are you sure you want to rollout the ${e.toLowerCase()} "${t}"?`}},[n]),J=a(()=>{const e=[];return S||I===hu.Overview&&(e.push({id:"edit-source-btn-edit",label:Pt.EDIT,icon:Na,active:S,onClick:M}),!u&&L&&e.push({id:"edit-source-btn-restart",label:Ze.ROLLOUT,icon:pl,onClick:H}),e.push({id:"edit-source-btn-delete",label:Pt.UNINSTRUMENT,icon:xa,color:d.v2.colors.red[500],active:w,onClick:U})),e},[I,S,w,u,L,M,H,U,d]),q=a(()=>{if(!N)return[];const e=[],t={backgroundColor:"transparent",textSize:ue.S};return e.push({...t,label:N.id.name,leftIcon:u?void 0:Za}),N.serviceName&&N.serviceName!==N.id.name&&e.push({...t,label:N.serviceName,leftIcon:qa,textColor:d.v2.colors.silver[200]}),e},[N,d,u]);if(!N)return t(re,{isOpen:!0,children:t(mt,{$height:"80vh",children:t(yt,{withSpinner:!0})})});const Q=I===hu.Profiling?k?"95vw":"fit-content":S?void 0:"60vw";return e(Ou,{value:D,children:[t(re,{isOpen:!0,width:Q,minWidth:"777px",header:{icon:u?hl:$o(N.containers)[0],titleBadges:q,onClose:()=>{j(hu.Overview),$(null),E(!1),o()},actions:J},footer:{actions:S?[{"data-id":"edit-source-btn-cancel",label:Pt.CANCEL,variant:ge.Secondary,onClick:B},{"data-id":"edit-source-btn-save",label:Pt.SAVE,variant:ge.Primary,onClick:X}]:[]},children:t(pt,{$padding:"4px 12px 12px",children:e(Z,{$gap:16,children:[!S&&F.length>1&&t(fe,{options:F,selected:I,setSelected:j}),(()=>{switch(I){case hu.Overview:return S?t(Rs,{}):t(dp,{source:N,onClickRollout:H,onClickRollback:G});case hu.Pods:return t(Du,{source:N,onClickRestartPod:L?(e,t)=>R({openFor:ph.Pod,podNamespace:e,podName:t}):void 0});case hu.PeerSources:return t(_u,{source:N});case hu.Profiling:return t(Zp,{source:N,onFlameFullscreenChange:E});case hu.Sampling:return t(rh,{source:N,onRedirectToSampling:z});case hu.Debug:return t(zu,{source:N});default:return null}})()]})})}),t(Gl,{target:"source",action:"uninstrument",isOpen:w,onClose:()=>T(!1),onApprove:V}),t(qe,{isOpen:A.openFor===ph.Workload,title:Y.title,description:Y.description,onClose:W,denyButton:{label:"Go back",variant:ge.Secondary,onClick:W},approveButton:{label:Pt.CONFIRM,variant:ge.Primary,onClick:K}}),t(Gl,{target:"pod",action:"restart",description:Ze.ROLLOUT_RESTART_WORKLOADS_DESCRIPTION,isOpen:A.openFor===ph.Pod,onClose:W,onApprove:K,overrideApproveButtonLabel:Ze.DELETE_POD_TO_RESTART})]})},vh=f.div`
394
808
  display: flex;
395
809
  align-items: center;
396
810
  gap: 8px;
@@ -400,9 +814,9 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
400
814
  &:hover {
401
815
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
402
816
  }
403
- `,pu=g.div`
817
+ `,yh=f.div`
404
818
  flex: 1;
405
- `,hu=({onClick:n})=>{const o=f().v2.colors.red[500];return e(uu,{"data-id":"sampling-view-btn-delete",onClick:n,children:[t(se,{size:de.XS,weight:500,color:o,children:An}),t(gi,{size:16,fill:o})]})};function mu(o){if(o.isEditing){const{onCancelEdit:a,onSave:i,onDelete:l,duplicateWarning:r}=o;return{children:e(n,{children:[t(hu,{onClick:l}),r&&t(Oe,{status:Re.Warning,message:r.message,action:r.onViewRule?{"data-id":"sampling-view-edit-btn-view-duplicate",label:"View rule",onClick:r.onViewRule}:void 0}),t(pu,{}),t(pe,{"data-id":"sampling-view-edit-btn-cancel",label:$n,variant:me.Secondary,size:he.S,onClick:a}),t(pe,{"data-id":"sampling-view-edit-btn-save",label:In,variant:me.Primary,size:he.S,onClick:i,disabled:!!r})]})}}const{onDelete:a,onCancel:i,onEdit:l}=o;return{children:e(n,{children:[t(hu,{onClick:a}),t(pu,{}),t(pe,{"data-id":"sampling-view-btn-cancel",label:$n,variant:me.Secondary,size:he.S,onClick:i}),t(pe,{"data-id":"sampling-view-btn-edit",label:En,variant:me.Primary,size:he.S,onClick:l})]})}}const gu={[Ul.EditAutoNoisy]:{title:Un,subTitle:Vn,cancelId:"sampling-edit-auto-rule-btn-cancel",saveId:"sampling-edit-auto-rule-btn-save"},[Ul.EditAutoCostReduction]:{title:Xn,subTitle:Bn,cancelId:"sampling-edit-cost-reduction-auto-rule-btn-cancel",saveId:"sampling-edit-cost-reduction-auto-rule-btn-save"},[Ul.EditAutoHighlyRelevant]:{title:zn,subTitle:Mn,cancelId:"sampling-edit-highly-relevant-auto-rule-btn-cancel",saveId:"sampling-edit-highly-relevant-auto-rule-btn-save"}},fu=({isOpen:e,title:n,subTitle:o,onClose:a,footer:i,renderBody:l})=>t(le,{isOpen:e,width:Hn,header:{icon:tl,title:n,subTitle:o,onClose:a},footer:i,children:l?l():t(dt,{$padding:"12px",children:t(ms,{})})}),bu=({isOpen:i,onClose:s,onSubmit:c,validateForm:d,onNavigateToDuplicate:u})=>{const{category:p,formData:h,resetForm:m,duplicateWarning:g,setDuplicateWarning:f}=Vl(Ul.Create),[b,v]=r(!1);o(()=>{i&&(m(),v(!1))},[i]);const y=l(()=>{v(!1),c(h)},[h,c]),C=l(()=>{if(d){const e=d(h);if(e)return void f(e)}!function(e,t){return JSON.stringify(e)===JSON.stringify(T(t))}(h,p)?y():v(!0)},[h,p,d,f,y]),S=a(()=>b?function(e,t){switch(e){case"noisy":return w(E(t));case"highlyRelevant":return x(I(t));case"costReduction":return k($(t))}}(p,h):[],[b,p,h]),A={note:g?{status:Re.Warning,message:g.message,action:u?{"data-id":"sampling-create-btn-view-duplicate",label:"View rule",onClick:()=>u(g.ruleId)}:void 0}:void 0,actions:[{"data-id":"sampling-create-btn-cancel",label:$n,variant:me.Secondary,size:he.S,onClick:s},{"data-id":"sampling-create-btn-submit",label:kn,variant:me.Primary,size:he.S,onClick:C,disabled:!!g}]};return e(n,{children:[t(fu,{isOpen:i,title:Dn[p],subTitle:Nn[p],onClose:s,footer:A}),t(Ye,{isOpen:b,title:Ln,description:Fn,onClose:()=>v(!1),denyButton:{"data-id":"sampling-create-default-continue-editing",label:Pn,variant:me.Secondary,onClick:()=>v(!1)},approveButton:{"data-id":"sampling-create-default-confirm",label:kn,variant:me.Primary,onClick:y},children:e(q,{$gap:8,$alignItems:"flex-start",style:{width:"100%"},children:[t(se,{size:de.XS,weight:500,color:ce.Secondary,children:_n}),t("div",{style:{width:"100%"},children:t(Cl,{summary:S})})]})})]})},vu=({onClose:e,onDelete:n,onSaveEdit:o,validateForm:i,onNavigateToDuplicate:r})=>{const{data:s,isEditing:c,formData:d,handleEdit:u,handleCancelEdit:p,duplicateWarning:h,setDuplicateWarning:m}=Vl(Ul.View),g=s?.rule.name||Rn,f=c&&s?On[s.category]:`${g} preview`,b=l(()=>{if(s&&c){if(i){const e=i(d);if(e)return void m(e)}o(d,s.rule.ruleId,s.samplingId),p()}},[s,c,d,o,i,m,p]),v=l(()=>{s&&n(s.rule.ruleId,s.samplingId)},[s,n]),y=a(()=>{if(!s)return;const t=h?{message:h.message,onViewRule:r?()=>r(h.ruleId):void 0}:null;return mu(c?{isEditing:!0,onCancelEdit:p,onSave:b,onDelete:v,duplicateWarning:t}:{isEditing:!1,onDelete:v,onCancel:e,onEdit:u})},[s,c,h,p,b,v,u,e,r]);return t(fu,{isOpen:!!s,title:f,subTitle:s?Nn[s.category]:"",onClose:e,footer:y})},yu=({isOpen:e,onClose:n,onSave:o})=>{const{localEnabled:a,resolvedPercentage:i}=Vl(Ul.EditAutoNoisy),r=l(()=>o(a,i),[o,a,i]);return t(wu,{formType:Ul.EditAutoNoisy,isOpen:e,onClose:n,onSave:r})},Cu=({isOpen:e,onClose:n,onSave:o})=>{const{localEnabled:a,resolvedPercentage:i}=Vl(Ul.EditAutoCostReduction),r=l(()=>o(a,i),[o,a,i]);return t(wu,{formType:Ul.EditAutoCostReduction,isOpen:e,onClose:n,onSave:r})},Su=({isOpen:e,onClose:n,onSave:o})=>{const{localEnabled:a}=Vl(Ul.EditAutoHighlyRelevant),i=l(()=>o(a),[o,a]);return t(wu,{formType:Ul.EditAutoHighlyRelevant,isOpen:e,onClose:n,onSave:i})},wu=({formType:e,isOpen:n,onClose:o,onSave:a})=>{const i=gu[e];return t(fu,{isOpen:n,title:i.title,subTitle:i.subTitle,onClose:o,footer:{actions:[{"data-id":i.cancelId,label:$n,variant:me.Secondary,size:he.S,onClick:o},{"data-id":i.saveId,label:Gn,variant:me.Primary,size:he.S,onClick:a}]}})},xu=e=>{switch(e.formType){case Ul.Create:return t(Yl,{formType:Ul.Create,category:e.category,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(bu,{...e})});case Ul.View:return t(Yl,{formType:Ul.View,data:e.data,defaultEditMode:e.defaultEditMode,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(vu,{...e})});case Ul.EditAutoNoisy:return t(Yl,{formType:Ul.EditAutoNoisy,enabled:e.enabled,keepPercentage:e.keepPercentage,children:t(yu,{...e})});case Ul.EditAutoCostReduction:return t(Yl,{formType:Ul.EditAutoCostReduction,enabled:e.enabled,dropPercentage:e.dropPercentage,children:t(Cu,{...e})});case Ul.EditAutoHighlyRelevant:return t(Yl,{formType:Ul.EditAutoHighlyRelevant,enabled:e.enabled,children:t(Su,{...e})})}},ku=({token:o,isLoading:a,isEditing:i,onEdit:l,onCancel:r,onSave:s,formData:c,handleFormChange:d,handleErrorChange:u,formErrors:p})=>{const{CopyButton:h}=pn(),m=!i||a||!c.newToken;return jn({key:"Enter",active:!m},s),e(ue,i?{$justifyContent:"space-between",$alignItems:"flex-start",$gap:12,children:[t(Se,{type:"password",value:c.newToken,onChange:e=>{d("newToken",e.target.value),u("newToken",void 0)},width:"430px",autoFocus:!0,errorMessage:p.newToken}),t(ue,{$margin:a?"8px 0 0 0":"2px 0 0 0",$alignItems:"center",children:a?t(bt,{title:"Saving...",withGradient:!0}):e(n,{children:[t(pe,{variant:me.Secondary,size:he.S,leftIcon:Oi,onClick:r,disabled:a}),t(pe,{variant:me.Primary,size:he.S,leftIcon:Ni,onClick:s,disabled:m})]})})]}:{$justifyContent:"space-between",$gap:12,children:[t(se,{size:de.XS,children:new Array(55).fill("•").join("")}),e(ue,{$alignItems:"center",$justifyContent:"space-between",children:[t(h,{value:o}),t(gt,{icon:wi,onClick:l})]})]})},Tu=({expiresAt:e,callbackValid:n,callbackExpired:i})=>{const{formatTimeAgo:l}=Ht(),r=a(()=>l(e),[e,l]),s=a(()=>new Date(e).toDateString().split(" ").slice(1).join(" "),[e]),c=a(()=>Wn(e,0)?Re.Error:Wn(e,2592e6)?Re.Warning:Re.Success,[e]),d=a(()=>c===Re.Success?Ni:c===Re.Warning?nl:Bi,[c]);return o(()=>{c===Re.Success?n():c===Re.Error&&i()},[c]),t(ze,{text:s,children:t(je,{leftIcon:d,label:r,status:c,invertColors:!0,useSecondaryTone:!0})})},$u=g.div`
819
+ `,Ch=({onClick:o})=>{const n=b().v2.colors.red[500];return e(vh,{"data-id":"sampling-view-btn-delete",onClick:o,children:[t(ce,{size:ue.XS,weight:500,color:n,children:_o}),t(xa,{size:16,fill:n})]})};function Sh(n){if(n.isEditing){const{onCancelEdit:i,onSave:a,onDelete:l,duplicateWarning:r}=n;return{children:e(o,{children:[t(Ch,{onClick:l}),r&&t(_e,{status:Pe.Warning,message:r.message,action:r.onViewRule?{"data-id":"sampling-view-edit-btn-view-duplicate",label:"View rule",onClick:r.onViewRule}:void 0}),t(yh,{}),t(he,{"data-id":"sampling-view-edit-btn-cancel",label:Ao,variant:ge.Secondary,size:me.S,onClick:i}),t(he,{"data-id":"sampling-view-edit-btn-save",label:Ro,variant:ge.Primary,size:me.S,onClick:a,disabled:!!r})]})}}const{onDelete:i,onCancel:a,onEdit:l}=n;return{children:e(o,{children:[t(Ch,{onClick:i}),t(yh,{}),t(he,{"data-id":"sampling-view-btn-cancel",label:Ao,variant:ge.Secondary,size:me.S,onClick:a}),t(he,{"data-id":"sampling-view-btn-edit",label:Do,variant:ge.Primary,size:me.S,onClick:l})]})}}const xh={[ir.EditAutoNoisy]:{title:Ko,subTitle:Wo,cancelId:"sampling-edit-auto-rule-btn-cancel",saveId:"sampling-edit-auto-rule-btn-save"},[ir.EditAutoCostReduction]:{title:Go,subTitle:jo,cancelId:"sampling-edit-cost-reduction-auto-rule-btn-cancel",saveId:"sampling-edit-cost-reduction-auto-rule-btn-save"},[ir.EditAutoHighlyRelevant]:{title:Ho,subTitle:Vo,cancelId:"sampling-edit-highly-relevant-auto-rule-btn-cancel",saveId:"sampling-edit-highly-relevant-auto-rule-btn-save"}},wh=({isOpen:e,title:o,subTitle:n,onClose:i,footer:a,renderBody:l})=>t(re,{isOpen:e,width:Jo,header:{icon:ml,title:o,subTitle:n,onClose:i},footer:a,children:l?l():t(pt,{$padding:"12px",children:t(Ms,{})})}),Th=({isOpen:n,onClose:l,onSubmit:c,validateForm:d,onNavigateToDuplicate:u})=>{const{category:p,formData:h,resetForm:m,duplicateWarning:g,setDuplicateWarning:f}=nr(ir.Create),[b,v]=s(!1);i(()=>{n&&(m(),v(!1))},[n]);const y=r(()=>{v(!1),c(h)},[h,c]),C=r(()=>{if(d){const e=d(h);if(e)return void f(e)}!function(e,t){return JSON.stringify(e)===JSON.stringify(E(t))}(h,p)?y():v(!0)},[h,p,d,f,y]),S=a(()=>b?function(e,t){switch(e){case"noisy":return w(N(t));case"highlyRelevant":return T(O(t));case"costReduction":return k(I(t))}}(p,h):[],[b,p,h]),x={note:g?{status:Pe.Warning,message:g.message,action:u?{"data-id":"sampling-create-btn-view-duplicate",label:"View rule",onClick:()=>u(g.ruleId)}:void 0}:void 0,actions:[{"data-id":"sampling-create-btn-cancel",label:Ao,variant:ge.Secondary,size:me.S,onClick:l},{"data-id":"sampling-create-btn-submit",label:No,variant:ge.Primary,size:me.S,onClick:C,disabled:!!g}]};return e(o,{children:[t(wh,{isOpen:n,title:Mo[p],subTitle:Po[p],onClose:l,footer:x}),t(qe,{isOpen:b,title:Xo,description:Bo,onClose:()=>v(!1),denyButton:{"data-id":"sampling-create-default-continue-editing",label:zo,variant:ge.Secondary,onClick:()=>v(!1)},approveButton:{"data-id":"sampling-create-default-confirm",label:No,variant:ge.Primary,onClick:y},children:e(Z,{$gap:8,$alignItems:"flex-start",style:{width:"100%"},children:[t(ce,{size:ue.XS,weight:500,color:de.Secondary,children:Uo}),t("div",{style:{width:"100%"},children:t(_l,{summary:S})})]})})]})},kh=({onClose:e,onDelete:o,onSaveEdit:n,validateForm:i,onNavigateToDuplicate:l})=>{const{data:s,isEditing:c,formData:d,handleEdit:u,handleCancelEdit:p,duplicateWarning:h,setDuplicateWarning:m}=nr(ir.View),g=s?.rule.name||Fo,f=c&&s?Lo[s.category]:`${g} preview`,b=r(()=>{if(s&&c){if(i){const e=i(d);if(e)return void m(e)}n(d,s.rule.ruleId,s.samplingId),p()}},[s,c,d,n,i,m,p]),v=r(()=>{s&&o(s.rule.ruleId,s.samplingId)},[s,o]),y=a(()=>{if(!s)return;const t=h?{message:h.message,onViewRule:l?()=>l(h.ruleId):void 0}:null;return Sh(c?{isEditing:!0,onCancelEdit:p,onSave:b,onDelete:v,duplicateWarning:t}:{isEditing:!1,onDelete:v,onCancel:e,onEdit:u})},[s,c,h,p,b,v,u,e,l]);return t(wh,{isOpen:!!s,title:f,subTitle:s?Po[s.category]:"",onClose:e,footer:y})},Eh=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:i,resolvedPercentage:a}=nr(ir.EditAutoNoisy),l=r(()=>n(i,a),[n,i,a]);return t(Nh,{formType:ir.EditAutoNoisy,isOpen:e,onClose:o,onSave:l})},Ih=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:i,resolvedPercentage:a}=nr(ir.EditAutoCostReduction),l=r(()=>n(i,a),[n,i,a]);return t(Nh,{formType:ir.EditAutoCostReduction,isOpen:e,onClose:o,onSave:l})},Oh=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:i}=nr(ir.EditAutoHighlyRelevant),a=r(()=>n(i),[n,i]);return t(Nh,{formType:ir.EditAutoHighlyRelevant,isOpen:e,onClose:o,onSave:a})},Nh=({formType:e,isOpen:o,onClose:n,onSave:i})=>{const a=xh[e];return t(wh,{isOpen:o,title:a.title,subTitle:a.subTitle,onClose:n,footer:{actions:[{"data-id":a.cancelId,label:Ao,variant:ge.Secondary,size:me.S,onClick:n},{"data-id":a.saveId,label:Yo,variant:ge.Primary,size:me.S,onClick:i}]}})},$h=e=>{switch(e.formType){case ir.Create:return t(ur,{formType:ir.Create,category:e.category,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(Th,{...e})});case ir.View:return t(ur,{formType:ir.View,data:e.data,defaultEditMode:e.defaultEditMode,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(kh,{...e})});case ir.EditAutoNoisy:return t(ur,{formType:ir.EditAutoNoisy,enabled:e.enabled,keepPercentage:e.keepPercentage,children:t(Eh,{...e})});case ir.EditAutoCostReduction:return t(ur,{formType:ir.EditAutoCostReduction,enabled:e.enabled,dropPercentage:e.dropPercentage,children:t(Ih,{...e})});case ir.EditAutoHighlyRelevant:return t(ur,{formType:ir.EditAutoHighlyRelevant,enabled:e.enabled,children:t(Oh,{...e})})}},Ah=({token:n,isLoading:i,isEditing:a,onEdit:l,onCancel:r,onSave:s,formData:c,handleFormChange:d,handleErrorChange:u,formErrors:p})=>{const{CopyButton:h}=Dt(),m=!a||i||!c.newToken;return qo({key:"Enter",active:!m},s),e(pe,a?{$justifyContent:"space-between",$alignItems:"flex-start",$gap:12,children:[t(xe,{type:"password",value:c.newToken,onChange:e=>{d("newToken",e.target.value),u("newToken",void 0)},width:"430px",autoFocus:!0,errorMessage:p.newToken}),t(pe,{$margin:i?"8px 0 0 0":"2px 0 0 0",$alignItems:"center",children:i?t(yt,{title:"Saving...",withGradient:!0}):e(o,{children:[t(he,{variant:ge.Secondary,size:me.S,leftIcon:Ma,onClick:r,disabled:i}),t(he,{variant:ge.Primary,size:me.S,leftIcon:Fa,onClick:s,disabled:m})]})})]}:{$justifyContent:"space-between",$gap:12,children:[t(ce,{size:ue.XS,children:new Array(55).fill("•").join("")}),e(pe,{$alignItems:"center",$justifyContent:"space-between",children:[t(h,{value:n}),t(bt,{icon:Na,onClick:l})]})]})},Rh=({expiresAt:e,callbackValid:o,callbackExpired:n})=>{const{formatTimeAgo:l}=qt(),r=a(()=>l(e),[e,l]),s=a(()=>new Date(e).toDateString().split(" ").slice(1).join(" "),[e]),c=a(()=>Zo(e,0)?Pe.Error:Zo(e,2592e6)?Pe.Warning:Pe.Success,[e]),d=a(()=>c===Pe.Success?Fa:c===Pe.Warning?gl:Qa,[c]);return i(()=>{c===Pe.Success?o():c===Pe.Error&&n()},[c]),t(Ie,{text:s,children:t(Ke,{leftIcon:d,label:r,status:c,invertColors:!0,useSecondaryTone:!0})})},Dh=f.div`
406
820
  display: flex;
407
821
  flex-direction: column;
408
822
  gap: 12px;
@@ -410,7 +824,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
410
824
  border-radius: 12px;
411
825
  border: 1px solid ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[500]:e.v2.colors.silver[600]};
412
826
  background-color: ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[1e3]:e.v2.colors.silver[800]};
413
- `,Iu=({children:e})=>{const n=f();return t(se,{size:de.XXXS,color:n.v2.colors.grey[150],children:e})},Eu=({token:n})=>{const{tokensApi:o}=gl(),[a,i]=r(!1),[l,s]=r(!1),[c,d]=r(!1),{formData:u,handleFormChange:p,formErrors:h,handleErrorChange:m,resetFormData:g}=Lt({newToken:""});return t(lt,{richTitle:{icon:ol,title:"Odigos Pro Token"},children:e($u,{$isExpired:c,children:[e(ue,{$justifyContent:"space-between",children:[e(q,{$gap:4,children:[t(Iu,{children:"Issued for"}),t(se,{size:de.XS,children:n.name||"N/A"})]}),e(q,{$gap:4,children:[t(Iu,{children:"Expiration"}),t(Tu,{expiresAt:n.expiresAt,callbackValid:()=>d(!1),callbackExpired:()=>d(!0)})]}),t(q,{})]}),t(ue,{children:e(q,{children:[t(Iu,{children:"Token"}),t(ku,{token:n.token,newToken:u.newToken,isLoading:a,isEditing:l,onEdit:()=>s(!0),onCancel:()=>(s(!1),void p("newToken","")),onSave:()=>(async()=>{if(!o.updateToken)return;i(!0);const e=await o.updateToken(u.newToken.trim());i(!1),e?.error?m("newToken",e.error):(s(!1),g())})(),formData:u,handleFormChange:p,handleErrorChange:m,formErrors:h})]})})]})})},Au=g.div`
827
+ `,_h=({children:e})=>{const o=b();return t(ce,{size:ue.XXXS,color:o.v2.colors.grey[150],children:e})},Ph=({token:o})=>{const{tokensApi:n}=Nl(),[i,a]=s(!1),[l,r]=s(!1),[c,d]=s(!1),{formData:u,handleFormChange:p,formErrors:h,handleErrorChange:m,resetFormData:g}=Ut({newToken:""});return t(st,{richTitle:{icon:fl,title:"Odigos Pro Token"},children:e(Dh,{$isExpired:c,children:[e(pe,{$justifyContent:"space-between",children:[e(Z,{$gap:4,children:[t(_h,{children:"Issued for"}),t(ce,{size:ue.XS,children:o.name||"N/A"})]}),e(Z,{$gap:4,children:[t(_h,{children:"Expiration"}),t(Rh,{expiresAt:o.expiresAt,callbackValid:()=>d(!1),callbackExpired:()=>d(!0)})]}),t(Z,{})]}),t(pe,{children:e(Z,{children:[t(_h,{children:"Token"}),t(Ah,{token:o.token,newToken:u.newToken,isLoading:i,isEditing:l,onEdit:()=>r(!0),onCancel:()=>(r(!1),void p("newToken","")),onSave:()=>(async()=>{if(!n.updateToken)return;a(!0);const e=await n.updateToken(u.newToken.trim());a(!1),e?.error?m("newToken",e.error):(r(!1),g())})(),formData:u,handleFormChange:p,handleErrorChange:m,formErrors:h})]})})]})})},Lh=f.div`
414
828
  display: flex;
415
829
  flex-direction: column;
416
830
  align-items: center;
@@ -419,23 +833,23 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
419
833
  padding: 12px 24px;
420
834
  border-radius: 8px;
421
835
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
422
- `,Nu=()=>{const{progress:n}=$t(),{describeApi:o,namespacesApi:a}=gl(),{items:i}=a.useNamespaces(),[l,s]=r(null),{formData:c,handleFormChange:d,resetFormData:u}=Lt({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(lt,{richTitle:{icon:al,title:"Diagnose"},children:l?e(Au,{children:[t(bt,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",withGradient:!0,withSpinner:"number"==typeof n[At.DownloadingDiagnose]?.percentage,percentage:n[At.DownloadingDiagnose]?.percentage,withVisual:"number"!=typeof n[At.DownloadingDiagnose]?.percentage,visualIcon:Zi,startedAt:l}),n[At.DownloadingDiagnose]?.list?.length&&t(q,{$width:"100%",children:n[At.DownloadingDiagnose].list.map((n,o)=>e(ue,{$gap:4,$alignItems:"center",children:[n.status===Re.Success?t(Ni,{size:16}):n.status===Re.Error?t(Oi,{size:16}):t(bt,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(se,{size:de.XXXS,color:ce.Secondary,children:n.label})]},`diagnose-item-${o}-${n.label}`))})]}):e(q,{$gap:24,children:[t(se,{size:de.XXS,color:ce.Secondary,children:"Download a tar.gz file with diagnostics from this cluster. Select which data to include before downloading, and share the file with the Odigos support team for troubleshooting."}),e(q,{$gap:16,children:[e(ue,{$gap:8,children:[t(Q,{label:"Profiles",value:c.includeProfiles,onChange:e=>d("includeProfiles",e),tooltip:"Note: Adds 30s to diagnose download time to collect Profiles"}),t(se,{size:de.XXXS,color:ce.Secondary,children:"Include pprof profiles"})]}),e(ue,{$gap:8,children:[t(Q,{label:"Metrics",value:c.includeMetrics,onChange:e=>d("includeMetrics",e)}),t(se,{size:de.XXXS,color:ce.Secondary,children:"Include Prometheus metrics"})]}),e(ue,{$gap:8,children:[t(Q,{label:"Source Workloads",value:c.includeSourceWorkloads,onChange:e=>{d("includeSourceWorkloads",e),e&&d("sourceWorkloadNamespaces",[])}}),t(se,{size:de.XXXS,color:ce.Secondary,children:"Include workload and pod manifests for instrumented sources"})]})]}),t(Kn,{alignX:Jn.Left,alignY:Yn.Bottom,items:i.map(e=>({id:e.name,label:e.name,withCheckbox:!0})),selectedIds:c.sourceWorkloadNamespaces,setSelectedIds:e=>d("sourceWorkloadNamespaces",e),withMultiSelect:!0,withSearch:!0,fullWidth:!0,buttonProps:{label:(c.sourceWorkloadNamespaces.length?"Selected":"Select")+" Namespaces",variant:me.Secondary,disabled:c.includeSourceWorkloads,leftIcon:c.sourceWorkloadNamespaces.length?()=>t(je,{label:c.sourceWorkloadNamespaces.length,status:Re.Default}):void 0}}),t(ue,{$justifyContent:"flex-end",children:t(pe,{label:"Download Diagnose",rightIcon:Zi,variant:me.Primary,onClick:async()=>{o.downloadDiagnose&&(s(Date.now()),await o.downloadDiagnose(c),s(null),u())},disabled:null!==l})})]})})},Ou=()=>{const{platformType:e,version:n,tier:a}=y(),{describeApi:i}=gl(),[l,s]=r(null);return o(()=>{i.fetchDescribeOdigos&&i.fetchDescribeOdigos().then(({data:e})=>s(e?.describeOdigos??null))},[]),t(lt,{richTitle:{icon:Hi,title:"General Information"},children:t(Dt,{cellsPerRow:2,items:[{id:qn(),title:"Odigos Version",label:n},{id:qn(),title:`${e.toUpperCase()} Version`,label:l?.kubernetesVersion?.value||"-"},{id:qn(),title:"Installation Method",label:l?.installationMethod?.value||"-"},{id:qn(),title:"Tier",label:a}]})})},Ru=({isOpen:n,onClose:o})=>{const{describeApi:a,tokensApi:i}=gl(),l=i.useTokens().items[0];return e(le,{isOpen:n,header:{icon:Hi,title:"System Overview",onClose:o},children:[a.fetchDescribeOdigos&&t(Ou,{}),i.updateToken&&l&&t(Eu,{token:l}),a.downloadDiagnose&&t(Nu,{})]})},Du=({isOpen:o,onClose:a,onCloseEnd:i})=>{const{addDataStreams:r,setSelectedStreamName:s}=qe(),{dataStreamsApi:c}=gl(),{requestSubmit:d}=Bl(),u=l(async e=>{c.create?await c.create(e):(r([e]),s(e.name)),a()},[c,r,s,a]),p=l(()=>d(u),[d,u]);return jn({key:"Enter",active:o},p),e(n,{children:[t(Ye,{isOpen:o,onClose:a,onCloseEnd:i,title:Je.NAME_YOUR_STREAM,description:Je.STREAM_DESCRIPTION,approveButton:{"data-id":"add-stream-btn-done",label:Rt.DONE,variant:me.Primary,onClick:p},denyButton:{"data-id":"add-stream-btn-cancel",label:Rt.CANCEL,variant:me.Secondary,onClick:a},children:t(rs,{autoFocus:!0})}),t(ls,{})]})},Pu=({isOpen:a,onClose:i,onCloseEnd:r,dataStreamName:s})=>{const{dataStreamsApi:c}=gl(),{genericForm:d,loadDataStream:u,requestSubmit:p}=Bl();o(()=>{a&&s&&u(s)},[a,s]);const h=!!d?.isFormDirty,m=l(async e=>{await c.update(s,e),i()},[c,s,i]),g=l(()=>p(m),[p,m]);return jn({key:"Enter",active:a},g),e(n,{children:[t(Ye,{isOpen:a,onClose:i,onCloseEnd:r,title:Je.RENAME_STREAM(s),description:Je.STREAM_DESCRIPTION,approveButton:{"data-id":"edit-stream-btn-save",label:Rt.SAVE,variant:me.Primary,onClick:g,disabled:!h},denyButton:{"data-id":"edit-stream-btn-cancel",label:Rt.CANCEL,variant:me.Secondary,onClick:i},children:t(rs,{autoFocus:!0})}),t(ls,{})]})},Fu=({scale:n=1})=>e("svg",{width:742*n,height:533*n,viewBox:"0 0 742 533",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("path",{d:"M0 0H722C733.046 0 742 8.95431 742 20V513C742 524.046 733.046 533 722 533H0V0Z",fill:"url(#paint0_linear_1585_55266)"}),e("g",{clipPath:"url(#clip0_1585_55266)",children:[t("path",{opacity:"0.1",d:"M817.963 1364.02C1052.53 1129.46 1052.53 749.151 817.96 514.585C583.394 280.019 203.089 280.018 -31.4751 514.583C-266.039 749.147 -266.038 1129.45 -31.4725 1364.02C203.093 1598.58 583.398 1598.58 817.963 1364.02Z",fill:"url(#paint1_radial_1585_55266)"}),t("path",{opacity:"0.3",d:"M789.266 1335.32C1007.98 1116.61 1007.98 761.998 789.264 543.281C570.547 324.565 215.938 324.563 -2.7781 543.279C-221.494 761.995 -221.493 1116.6 -2.77577 1335.32C215.941 1554.04 570.55 1554.04 789.266 1335.32Z",fill:"url(#paint2_radial_1585_55266)"}),t("path",{opacity:"0.5",d:"M736.156 1282.21C925.539 1092.83 925.538 785.776 736.153 596.392C546.769 407.007 239.717 407.006 50.333 596.39C-139.05 785.773 -139.05 1092.83 50.3351 1282.21C239.72 1471.59 546.772 1471.6 736.156 1282.21Z",fill:"url(#paint3_radial_1585_55266)"}),t("path",{opacity:"0.7",d:"M628.365 1174.42C758.218 1044.57 758.217 834.036 628.364 704.182C498.51 574.329 287.977 574.328 158.124 704.181C28.2713 834.033 28.272 1044.57 158.125 1174.42C287.979 1304.27 498.512 1304.27 628.365 1174.42Z",fill:"url(#paint4_radial_1585_55266)"}),t("path",{opacity:"0.1",d:"M795.717 29.8993C1030.28 -204.665 1030.28 -584.97 795.714 -819.536C561.148 -1054.1 180.843 -1054.1 -53.7211 -819.539C-288.285 -584.974 -288.284 -204.669 -53.7185 29.8967C180.847 264.462 561.152 264.464 795.717 29.8993Z",fill:"url(#paint5_radial_1585_55266)"}),t("path",{opacity:"0.3",d:"M767.02 1.20219C985.736 -217.513 985.734 -572.123 767.017 -790.84C548.301 -1009.56 193.691 -1009.56 -25.0242 -790.842C-243.74 -572.126 -243.739 -217.517 -25.0219 1.19982C193.695 219.917 548.304 219.918 767.02 1.20219Z",fill:"url(#paint6_radial_1585_55266)"}),t("path",{opacity:"0.5",d:"M713.909 -51.908C903.293 -241.292 903.292 -548.344 713.907 -737.728C524.523 -927.113 217.47 -927.114 28.0869 -737.731C-161.297 -548.347 -161.296 -241.295 28.089 -51.91C217.474 137.475 524.526 137.476 713.909 -51.908Z",fill:"url(#paint7_radial_1585_55266)"}),t("path",{opacity:"0.7",d:"M606.119 -159.699C735.972 -289.552 735.971 -500.085 606.118 -629.939C476.264 -759.792 265.731 -759.793 135.878 -629.94C6.0252 -500.088 6.02586 -289.554 135.879 -159.701C265.733 -29.8472 476.266 -29.8465 606.119 -159.699Z",fill:"url(#paint8_radial_1585_55266)"})]}),e("defs",{children:[e("linearGradient",{id:"paint0_linear_1585_55266",x1:"371",y1:"0",x2:"371",y2:"533",gradientUnits:"userSpaceOnUse",children:[t("stop",{offset:"0.028197",stopColor:"#0B0517"}),t("stop",{offset:"1",stopColor:"#190D31"})]}),e("radialGradient",{id:"paint1_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(334.074 991.405) rotate(-45) scale(599.732 599.736)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.41",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.67",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.75",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.83",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.89",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.95",stopColor:"#7C3BFF",stopOpacity:"0.56"}),t("stop",{offset:"1",stopColor:"#7C3BFF",stopOpacity:"0.7"})]}),e("radialGradient",{id:"paint2_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(368.968 957.913) rotate(-45) scale(560.978 560.981)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.38",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.52",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.62",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.69",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.76",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.82",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.88",stopColor:"#7C3BFF",stopOpacity:"0.57"}),t("stop",{offset:"0.93",stopColor:"#7C3BFF",stopOpacity:"0.72"}),t("stop",{offset:"0.97",stopColor:"#7C3BFF",stopOpacity:"0.88"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint3_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(351.265 971.313) rotate(-45) scale(484.947 484.95)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint4_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(362.239 963.064) rotate(-45) scale(332.216 332.218)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint5_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(311.828 -342.716) rotate(-45) scale(599.733 599.736)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.41",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.67",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.75",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.83",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.89",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.95",stopColor:"#7C3BFF",stopOpacity:"0.56"}),t("stop",{offset:"1",stopColor:"#7C3BFF",stopOpacity:"0.7"})]}),e("radialGradient",{id:"paint6_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(346.722 -376.208) rotate(-45) scale(560.977 560.981)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.38",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.52",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.62",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.69",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.76",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.82",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.88",stopColor:"#7C3BFF",stopOpacity:"0.57"}),t("stop",{offset:"0.93",stopColor:"#7C3BFF",stopOpacity:"0.72"}),t("stop",{offset:"0.97",stopColor:"#7C3BFF",stopOpacity:"0.88"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint7_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(329.019 -362.807) rotate(-45) scale(484.947 484.95)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint8_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(339.993 -371.057) rotate(-45) scale(332.216 332.218)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),t("clipPath",{id:"clip0_1585_55266",children:t("rect",{width:"929.477",height:"667",fill:"white",transform:"translate(-93.7383 -134)"})})]})]}),Lu=g.div`
836
+ `,Fh=()=>{const{progress:o}=Ot(),{describeApi:n,namespacesApi:i}=Nl(),{items:a}=i.useNamespaces(),[l,r]=s(null),{formData:c,handleFormChange:d,resetFormData:u}=Ut({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(st,{richTitle:{icon:bl,title:"Diagnose"},children:l?e(Lh,{children:[t(yt,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",withGradient:!0,withSpinner:"number"==typeof o[At.DownloadingDiagnose]?.percentage,percentage:o[At.DownloadingDiagnose]?.percentage,withVisual:"number"!=typeof o[At.DownloadingDiagnose]?.percentage,visualIcon:ul,startedAt:l}),o[At.DownloadingDiagnose]?.list?.length&&t(Z,{$width:"100%",children:o[At.DownloadingDiagnose].list.map((o,n)=>e(pe,{$gap:4,$alignItems:"center",children:[o.status===Pe.Success?t(Fa,{size:16}):o.status===Pe.Error?t(Ma,{size:16}):t(yt,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(ce,{size:ue.XXXS,color:de.Secondary,children:o.label})]},`diagnose-item-${n}-${o.label}`))})]}):e(Z,{$gap:24,children:[t(ce,{size:ue.XXS,color:de.Secondary,children:"Download a tar.gz file with diagnostics from this cluster. Select which data to include before downloading, and share the file with the Odigos support team for troubleshooting."}),e(Z,{$gap:16,children:[e(pe,{$gap:8,children:[t(ee,{label:"Profiles",value:c.includeProfiles,onChange:e=>d("includeProfiles",e),tooltip:"Note: Adds 30s to diagnose download time to collect Profiles"}),t(ce,{size:ue.XXXS,color:de.Secondary,children:"Include pprof profiles"})]}),e(pe,{$gap:8,children:[t(ee,{label:"Metrics",value:c.includeMetrics,onChange:e=>d("includeMetrics",e)}),t(ce,{size:ue.XXXS,color:de.Secondary,children:"Include Prometheus metrics"})]}),e(pe,{$gap:8,children:[t(ee,{label:"Source Workloads",value:c.includeSourceWorkloads,onChange:e=>{d("includeSourceWorkloads",e),e&&d("sourceWorkloadNamespaces",[])}}),t(ce,{size:ue.XXXS,color:de.Secondary,children:"Include workload and pod manifests for instrumented sources"})]})]}),t(Qo,{alignX:tn.Left,alignY:en.Bottom,items:a.map(e=>({id:e.name,label:e.name,withCheckbox:!0})),selectedIds:c.sourceWorkloadNamespaces,setSelectedIds:e=>d("sourceWorkloadNamespaces",e),withMultiSelect:!0,withSearch:!0,fullWidth:!0,buttonProps:{label:(c.sourceWorkloadNamespaces.length?"Selected":"Select")+" Namespaces",variant:ge.Secondary,disabled:c.includeSourceWorkloads,leftIcon:c.sourceWorkloadNamespaces.length?()=>t(Ke,{label:c.sourceWorkloadNamespaces.length,status:Pe.Default}):void 0}}),t(pe,{$justifyContent:"flex-end",children:t(he,{label:"Download Diagnose",rightIcon:ul,variant:ge.Primary,onClick:async()=>{n.downloadDiagnose&&(r(Date.now()),await n.downloadDiagnose(c),r(null),u())},disabled:null!==l})})]})})},Mh=()=>{const{platformType:e,version:o,tier:n}=C(),{describeApi:a}=Nl(),[l,r]=s(null);return i(()=>{a.fetchDescribeOdigos&&a.fetchDescribeOdigos().then(({data:e})=>r(e?.describeOdigos??null))},[]),t(st,{richTitle:{icon:il,title:"General Information"},children:t(zt,{cellsPerRow:2,items:[{id:on(),title:"Odigos Version",label:o},{id:on(),title:`${e.toUpperCase()} Version`,label:l?.kubernetesVersion?.value||"-"},{id:on(),title:"Installation Method",label:l?.installationMethod?.value||"-"},{id:on(),title:"Tier",label:n}]})})},zh=({isOpen:o,onClose:n})=>{const{describeApi:i,tokensApi:a}=Nl(),l=a.useTokens().items[0];return e(re,{isOpen:o,header:{icon:il,title:"System Overview",onClose:n},children:[i.fetchDescribeOdigos&&t(Mh,{}),a.updateToken&&l&&t(Ph,{token:l}),i.downloadDiagnose&&t(Fh,{})]})},Bh=({isOpen:n,onClose:i,onCloseEnd:a})=>{const{addDataStreams:l,setSelectedStreamName:s}=Qe(),{dataStreamsApi:c}=Nl(),{requestSubmit:d}=tr(),u=r(async e=>{c.create?await c.create(e):(l([e]),s(e.name)),i()},[c,l,s,i]),p=r(()=>d(u),[d,u]);return qo({key:"Enter",active:n},p),e(o,{children:[t(qe,{isOpen:n,onClose:i,onCloseEnd:a,title:Ze.NAME_YOUR_STREAM,description:Ze.STREAM_DESCRIPTION,approveButton:{"data-id":"add-stream-btn-done",label:Pt.DONE,variant:ge.Primary,onClick:p},denyButton:{"data-id":"add-stream-btn-cancel",label:Pt.CANCEL,variant:ge.Secondary,onClick:i},children:t(As,{autoFocus:!0})}),t($s,{})]})},Xh=({isOpen:n,onClose:a,onCloseEnd:l,dataStreamName:s})=>{const{dataStreamsApi:c}=Nl(),{genericForm:d,loadDataStream:u,requestSubmit:p}=tr();i(()=>{n&&s&&u(s)},[n,s]);const h=!!d?.isFormDirty,m=r(async e=>{await c.update(s,e),a()},[c,s,a]),g=r(()=>p(m),[p,m]);return qo({key:"Enter",active:n},g),e(o,{children:[t(qe,{isOpen:n,onClose:a,onCloseEnd:l,title:Ze.RENAME_STREAM(s),description:Ze.STREAM_DESCRIPTION,approveButton:{"data-id":"edit-stream-btn-save",label:Pt.SAVE,variant:ge.Primary,onClick:g,disabled:!h},denyButton:{"data-id":"edit-stream-btn-cancel",label:Pt.CANCEL,variant:ge.Secondary,onClick:a},children:t(As,{autoFocus:!0})}),t($s,{})]})},Uh=({scale:o=1})=>e("svg",{width:742*o,height:533*o,viewBox:"0 0 742 533",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("path",{d:"M0 0H722C733.046 0 742 8.95431 742 20V513C742 524.046 733.046 533 722 533H0V0Z",fill:"url(#paint0_linear_1585_55266)"}),e("g",{clipPath:"url(#clip0_1585_55266)",children:[t("path",{opacity:"0.1",d:"M817.963 1364.02C1052.53 1129.46 1052.53 749.151 817.96 514.585C583.394 280.019 203.089 280.018 -31.4751 514.583C-266.039 749.147 -266.038 1129.45 -31.4725 1364.02C203.093 1598.58 583.398 1598.58 817.963 1364.02Z",fill:"url(#paint1_radial_1585_55266)"}),t("path",{opacity:"0.3",d:"M789.266 1335.32C1007.98 1116.61 1007.98 761.998 789.264 543.281C570.547 324.565 215.938 324.563 -2.7781 543.279C-221.494 761.995 -221.493 1116.6 -2.77577 1335.32C215.941 1554.04 570.55 1554.04 789.266 1335.32Z",fill:"url(#paint2_radial_1585_55266)"}),t("path",{opacity:"0.5",d:"M736.156 1282.21C925.539 1092.83 925.538 785.776 736.153 596.392C546.769 407.007 239.717 407.006 50.333 596.39C-139.05 785.773 -139.05 1092.83 50.3351 1282.21C239.72 1471.59 546.772 1471.6 736.156 1282.21Z",fill:"url(#paint3_radial_1585_55266)"}),t("path",{opacity:"0.7",d:"M628.365 1174.42C758.218 1044.57 758.217 834.036 628.364 704.182C498.51 574.329 287.977 574.328 158.124 704.181C28.2713 834.033 28.272 1044.57 158.125 1174.42C287.979 1304.27 498.512 1304.27 628.365 1174.42Z",fill:"url(#paint4_radial_1585_55266)"}),t("path",{opacity:"0.1",d:"M795.717 29.8993C1030.28 -204.665 1030.28 -584.97 795.714 -819.536C561.148 -1054.1 180.843 -1054.1 -53.7211 -819.539C-288.285 -584.974 -288.284 -204.669 -53.7185 29.8967C180.847 264.462 561.152 264.464 795.717 29.8993Z",fill:"url(#paint5_radial_1585_55266)"}),t("path",{opacity:"0.3",d:"M767.02 1.20219C985.736 -217.513 985.734 -572.123 767.017 -790.84C548.301 -1009.56 193.691 -1009.56 -25.0242 -790.842C-243.74 -572.126 -243.739 -217.517 -25.0219 1.19982C193.695 219.917 548.304 219.918 767.02 1.20219Z",fill:"url(#paint6_radial_1585_55266)"}),t("path",{opacity:"0.5",d:"M713.909 -51.908C903.293 -241.292 903.292 -548.344 713.907 -737.728C524.523 -927.113 217.47 -927.114 28.0869 -737.731C-161.297 -548.347 -161.296 -241.295 28.089 -51.91C217.474 137.475 524.526 137.476 713.909 -51.908Z",fill:"url(#paint7_radial_1585_55266)"}),t("path",{opacity:"0.7",d:"M606.119 -159.699C735.972 -289.552 735.971 -500.085 606.118 -629.939C476.264 -759.792 265.731 -759.793 135.878 -629.94C6.0252 -500.088 6.02586 -289.554 135.879 -159.701C265.733 -29.8472 476.266 -29.8465 606.119 -159.699Z",fill:"url(#paint8_radial_1585_55266)"})]}),e("defs",{children:[e("linearGradient",{id:"paint0_linear_1585_55266",x1:"371",y1:"0",x2:"371",y2:"533",gradientUnits:"userSpaceOnUse",children:[t("stop",{offset:"0.028197",stopColor:"#0B0517"}),t("stop",{offset:"1",stopColor:"#190D31"})]}),e("radialGradient",{id:"paint1_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(334.074 991.405) rotate(-45) scale(599.732 599.736)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.41",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.67",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.75",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.83",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.89",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.95",stopColor:"#7C3BFF",stopOpacity:"0.56"}),t("stop",{offset:"1",stopColor:"#7C3BFF",stopOpacity:"0.7"})]}),e("radialGradient",{id:"paint2_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(368.968 957.913) rotate(-45) scale(560.978 560.981)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.38",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.52",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.62",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.69",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.76",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.82",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.88",stopColor:"#7C3BFF",stopOpacity:"0.57"}),t("stop",{offset:"0.93",stopColor:"#7C3BFF",stopOpacity:"0.72"}),t("stop",{offset:"0.97",stopColor:"#7C3BFF",stopOpacity:"0.88"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint3_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(351.265 971.313) rotate(-45) scale(484.947 484.95)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint4_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(362.239 963.064) rotate(-45) scale(332.216 332.218)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint5_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(311.828 -342.716) rotate(-45) scale(599.733 599.736)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.41",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.67",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.75",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.83",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.89",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.95",stopColor:"#7C3BFF",stopOpacity:"0.56"}),t("stop",{offset:"1",stopColor:"#7C3BFF",stopOpacity:"0.7"})]}),e("radialGradient",{id:"paint6_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(346.722 -376.208) rotate(-45) scale(560.977 560.981)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.38",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.52",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.62",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.69",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.76",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.82",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.88",stopColor:"#7C3BFF",stopOpacity:"0.57"}),t("stop",{offset:"0.93",stopColor:"#7C3BFF",stopOpacity:"0.72"}),t("stop",{offset:"0.97",stopColor:"#7C3BFF",stopOpacity:"0.88"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint7_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(329.019 -362.807) rotate(-45) scale(484.947 484.95)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint8_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(339.993 -371.057) rotate(-45) scale(332.216 332.218)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),t("clipPath",{id:"clip0_1585_55266",children:t("rect",{width:"929.477",height:"667",fill:"white",transform:"translate(-93.7383 -134)"})})]})]}),Vh=f.div`
423
837
  position: absolute;
424
838
  top: 50%;
425
839
  left: 50%;
426
840
  transform: translate(-50%, -50%);
427
841
  z-index: ${({theme:e})=>e.v2.zIndex.modal};
428
- `,_u="onboarding-done",Mu=()=>{const{currentModal:n,setCurrentModal:o}=Zn(),a=()=>o("");return e(Qn,{isOpen:n===_u,onClose:a,children:[t(Fu,{}),t(Lu,{children:e(q,{$gap:32,$alignItems:"center",children:[e(q,{$gap:24,$alignItems:"center",children:[t(se,{size:de.L,weight:500,children:"Welcome to"}),t(Dl,{size:260}),t(se,{size:de.S,weight:400,children:"Your observability control plane is ready."})]}),t(pe,{label:"Get Started",rightIcon:bi,onClick:a})]})})]})},zu=g.div`
842
+ `,Hh="onboarding-done",jh=()=>{const{currentModal:o,setCurrentModal:n}=nn(),i=()=>n("");return e(an,{isOpen:o===Hh,onClose:i,children:[t(Uh,{}),t(Vh,{children:e(Z,{$gap:32,$alignItems:"center",children:[e(Z,{$gap:24,$alignItems:"center",children:[t(ce,{size:ue.L,weight:500,children:"Welcome to"}),t(Kl,{size:260}),t(ce,{size:ue.S,weight:400,children:"Your observability control plane is ready."})]}),t(he,{label:"Get Started",rightIcon:Ta,onClick:i})]})})]})},Gh=f.div`
429
843
  display: flex;
430
844
  flex-direction: column;
431
845
  gap: 8px;
432
846
  padding: 4px 8px;
433
847
  border-radius: 8px;
434
848
  width: 100%;
435
- `,Bu=g.div`
849
+ `,Wh=f.div`
436
850
  white-space: pre;
437
851
  overflow-x: auto;
438
- `,Xu=({name:n,recommended:o,toggleLabel:a,enabled:i,onEnabledChange:l,summary:r,toggleName:s})=>{const c=f();return e(zu,{children:[e(ue,{$gap:8,$justifyContent:"space-between",children:[e(ue,{$gap:4,children:[t(se,{size:de.XS,color:c.v2.colors.white[500],nowrap:!0,children:n}),o&&t(je,{label:eo,leftIcon:il,backgroundColor:c.v2.colors.purple[700],textColor:c.v2.colors.white[500],textSize:de.XXXS})]}),t(oe,{name:s??`sampling-onboarding-toggle-${n}`,label:a,labelAlign:ae.Left,value:i,onChange:l,size:kt.S})]}),t(Bu,{children:t(S,{parts:r})})]})},Vu=g.div`
852
+ `,Kh=({name:o,recommended:n,toggleLabel:i,enabled:a,onEnabledChange:l,summary:r,toggleName:s})=>{const c=b();return e(Gh,{children:[e(pe,{$gap:8,$justifyContent:"space-between",children:[e(pe,{$gap:4,children:[t(ce,{size:ue.XS,color:c.v2.colors.white[500],nowrap:!0,children:o}),n&&t(Ke,{label:ln,leftIcon:vl,backgroundColor:c.v2.colors.purple[700],textColor:c.v2.colors.white[500],textSize:ue.XXXS})]}),t(ie,{name:s??`sampling-onboarding-toggle-${o}`,label:i,labelAlign:ae.Left,value:a,onChange:l,size:Et.S})]}),t(Wh,{children:t(x,{parts:r})})]})},Yh=f.div`
439
853
  position: relative;
440
854
  display: flex;
441
855
  align-items: center;
@@ -445,18 +859,18 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
445
859
  background-color: ${({theme:e})=>e.v2.colors.black[500]};
446
860
  border-top-left-radius: 18px;
447
861
  border-top-right-radius: 18px;
448
- `,Uu=g.div`
862
+ `,Jh=f.div`
449
863
  position: absolute;
450
864
  left: 16px;
451
865
  top: 50%;
452
866
  transform: translateY(-50%);
453
- `,Gu=g.div`
867
+ `,qh=f.div`
454
868
  height: 16px;
455
869
  width: 100%;
456
870
  background-color: ${({theme:e})=>e.v2.colors.black[500]};
457
871
  border-top-left-radius: 18px;
458
872
  border-top-right-radius: 18px;
459
- `,Hu=g.div`
873
+ `,Zh=f.div`
460
874
  width: ${({$width:e})=>e}px;
461
875
  display: flex;
462
876
  flex-direction: column;
@@ -464,10 +878,10 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
464
878
  gap: 22px;
465
879
  padding: 8px 32px 32px 32px;
466
880
  background-color: ${({theme:e})=>e.v2.colors.black[500]};
467
- `,ju=e=>t(ll,{rotate:90,...e}),Wu=({children:n,center:o,onNext:a,nextLabel:i=to,nextLoading:l})=>e(ue,{$gap:8,$justifyContent:o?"center":"flex-end",$padding:"0 16px 16px 16px",children:[n,a&&t(pe,{"data-id":"sampling-onboarding-btn-next",label:i,rightIcon:ju,variant:me.Primary,size:he.M,onClick:a,loading:l})]}),Ku=e=>t(ll,{rotate:-90,...e}),Yu=({title:n,onBack:o})=>{const a=f();return e(Vu,{$hasBack:!!o,children:[o&&t(Uu,{children:t(gt,{"data-id":"sampling-onboarding-back",icon:Ku,size:ft.M,onClick:o})}),t(se,{size:de.M,weight:500,color:a.v2.colors.white[500],align:"center",children:n})]})},Ju=g.div`
881
+ `,Qh=e=>t(yl,{rotate:90,...e}),em=({children:o,center:n,onNext:i,nextLabel:a=rn,nextLoading:l})=>e(pe,{$gap:8,$justifyContent:n?"center":"flex-end",$padding:"0 16px 16px 16px",children:[o,i&&t(he,{"data-id":"sampling-onboarding-btn-next",label:a,rightIcon:Qh,variant:ge.Primary,size:me.M,onClick:i,loading:l})]}),tm=e=>t(yl,{rotate:-90,...e}),om=({title:o,onBack:n})=>{const i=b();return e(Yh,{$hasBack:!!n,children:[n&&t(Jh,{children:t(bt,{"data-id":"sampling-onboarding-back",icon:tm,size:vt.M,onClick:n})}),t(ce,{size:ue.M,weight:500,color:i.v2.colors.white[500],align:"center",children:o})]})},nm=f.div`
468
882
  box-sizing: border-box;
469
883
  width: ${({$width:e})=>e??"100%"};
470
- ${({$fillHeight:e})=>e&&b`
884
+ ${({$fillHeight:e})=>e&&v`
471
885
  align-self: stretch;
472
886
  height: auto;
473
887
  `}
@@ -477,16 +891,16 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
477
891
  padding: 16px;
478
892
  border-radius: 16px;
479
893
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
480
- `,qu=({children:e,fillHeight:n,width:o})=>t(Ju,{$fillHeight:n,$width:o,children:e}),Zu=g.ul`
894
+ `,im=({children:e,fillHeight:o,width:n})=>t(nm,{$fillHeight:o,$width:n,children:e}),am=f.ul`
481
895
  margin: 0;
482
896
  padding: 0;
483
897
  list-style: disc;
484
- `,Qu=g.li`
898
+ `,lm=f.li`
485
899
  margin-left: 18px;
486
900
  & + & {
487
901
  margin-top: 6px;
488
902
  }
489
- `,ep=({items:e,color:n})=>{const o=f(),a=n||o.v2.colors.silver[200];return t(Zu,{children:e.map((e,n)=>t(Qu,{style:{color:a},children:t(se,{size:de.XXS,color:a,children:e})},n))})},tp=({items:n})=>{const o=f();return t(q,{$gap:16,children:n.map((n,a)=>e(ue,{$gap:8,$alignItems:"flex-start",children:[e(se,{size:de.XS,color:o.v2.colors.silver[200],weight:400,children:[a+1,"."]}),e(q,{$gap:2,children:[t(se,{size:de.XS,color:o.v2.colors.white[500],weight:500,children:n.title}),t(se,{size:de.XS,color:o.v2.colors.silver[200],children:n.description})]})]},a))})},np=({message:e})=>t(Oe,{status:Re.Default,message:e,fullWidth:!0,smallIcon:!0}),op=g.div`
903
+ `,rm=({items:e,color:o})=>{const n=b(),i=o||n.v2.colors.silver[200];return t(am,{children:e.map((e,o)=>t(lm,{style:{color:i},children:t(ce,{size:ue.XXS,color:i,children:e})},o))})},sm=({items:o})=>{const n=b();return t(Z,{$gap:16,children:o.map((o,i)=>e(pe,{$gap:8,$alignItems:"flex-start",children:[e(ce,{size:ue.XS,color:n.v2.colors.silver[200],weight:400,children:[i+1,"."]}),e(Z,{$gap:2,children:[t(ce,{size:ue.XS,color:n.v2.colors.white[500],weight:500,children:o.title}),t(ce,{size:ue.XS,color:n.v2.colors.silver[200],children:o.description})]})]},i))})},cm=({message:e})=>t(_e,{status:Pe.Default,message:e,fullWidth:!0,smallIcon:!0}),dm=f.div`
490
904
  width: 100%;
491
905
  padding: 8px;
492
906
  display: flex;
@@ -494,12 +908,12 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
494
908
  gap: 4px;
495
909
  border-radius: 16px;
496
910
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
497
- `,ap=g.div`
911
+ `,um=f.div`
498
912
  display: flex;
499
913
  align-items: center;
500
914
  gap: 8px;
501
915
  padding: 4px 8px 12px 8px;
502
- `,ip=g.div`
916
+ `,pm=f.div`
503
917
  width: 100%;
504
918
  display: flex;
505
919
  flex-direction: column;
@@ -507,20 +921,20 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
507
921
  padding: 8px;
508
922
  border-radius: 12px;
509
923
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
510
- `,lp=({children:e})=>{const n=f();return t(se,{size:de.S,weight:500,color:n.v2.colors.white[500],align:"center",children:e})},rp=g.div`
924
+ `,hm=({children:e})=>{const o=b();return t(ce,{size:ue.S,weight:500,color:o.v2.colors.white[500],align:"center",children:e})},mm=f.div`
511
925
  white-space: pre-line;
512
- `,sp=({enabled:o,onEnabledChange:i,onBack:l,onNext:r})=>{const s=f(),c=a(()=>A({enabled:o,keepPercentage:0}),[o]);return e(n,{children:[t(Yu,{title:no,onBack:l}),e(Hu,{$width:854,children:[t(lp,{children:oo}),e(q,{$gap:8,$width:"100%",children:[t(qu,{children:t(rp,{children:t(se,{size:de.XXS,color:s.v2.colors.silver[200],children:ao})})}),e(q,{$gap:8,$width:"100%",children:[e(op,{children:[t(ap,{children:t(se,{size:de.S,weight:500,color:s.v2.colors.white[500],children:io})}),t(ip,{children:t(Xu,{name:ro,recommended:!0,toggleLabel:lo,enabled:o,onEnabledChange:i,summary:c,toggleName:"sampling-onboarding-noisy-toggle"})})]}),t(np,{message:so})]})]})]}),t(Wu,{onNext:r})]})},cp=e=>t(ll,{rotate:90,...e}),dp=({onClose:o})=>{const a=f();return e(n,{children:[t(Gu,{}),e(Hu,{$width:732,children:[t(co,{icon:tl}),e(q,{$gap:16,$alignItems:"center",$width:"100%",children:[t(se,{size:de.M,weight:500,color:a.v2.colors.white[500],children:uo}),po.split("\n").map((e,n)=>t(lp,{children:e},`subtitle-${n}-${e}`)),e(qu,{children:[t(se,{size:de.XS,color:a.v2.colors.silver[200],children:ho}),t(ep,{color:a.v2.colors.white[500],items:[mo,go,fo]})]})]})]}),t(Wu,{center:!0,children:t(pe,{"data-id":"sampling-onboarding-btn-go-to",label:bo,rightIcon:cp,variant:me.Primary,size:he.M,onClick:o})})]})},up=e=>t(ll,{rotate:90,...e}),pp=g.div`
926
+ `,gm=({enabled:n,onEnabledChange:i,onBack:l,onNext:r})=>{const s=b(),c=a(()=>$({enabled:n,keepPercentage:0}),[n]);return e(o,{children:[t(om,{title:sn,onBack:l}),e(Zh,{$width:854,children:[t(hm,{children:cn}),e(Z,{$gap:8,$width:"100%",children:[t(im,{children:t(mm,{children:t(ce,{size:ue.XXS,color:s.v2.colors.silver[200],children:dn})})}),e(Z,{$gap:8,$width:"100%",children:[e(dm,{children:[t(um,{children:t(ce,{size:ue.S,weight:500,color:s.v2.colors.white[500],children:un})}),t(pm,{children:t(Kh,{name:hn,recommended:!0,toggleLabel:pn,enabled:n,onEnabledChange:i,summary:c,toggleName:"sampling-onboarding-noisy-toggle"})})]}),t(cm,{message:mn})]})]})]}),t(em,{onNext:r})]})},fm=e=>t(yl,{rotate:90,...e}),bm=({onClose:n})=>{const i=b();return e(o,{children:[t(qh,{}),e(Zh,{$width:732,children:[t(gn,{icon:ml}),e(Z,{$gap:16,$alignItems:"center",$width:"100%",children:[t(ce,{size:ue.M,weight:500,color:i.v2.colors.white[500],children:fn}),bn.split("\n").map((e,o)=>t(hm,{children:e},`subtitle-${o}-${e}`)),e(im,{children:[t(ce,{size:ue.XS,color:i.v2.colors.silver[200],children:vn}),t(rm,{color:i.v2.colors.white[500],items:[yn,Cn,Sn]})]})]})]}),t(em,{center:!0,children:t(he,{"data-id":"sampling-onboarding-btn-go-to",label:xn,rightIcon:fm,variant:ge.Primary,size:me.M,onClick:n})})]})},vm=e=>t(yl,{rotate:90,...e}),ym=f.div`
513
927
  display: flex;
514
928
  flex-direction: column;
515
929
  align-items: center;
516
930
  gap: 8px;
517
931
  width: 100%;
518
- `,hp=({onSkip:o,onNext:a})=>{const i=f();return e(n,{children:[t(Gu,{}),e(Hu,{$width:732,children:[t(co,{icon:tl}),e(q,{$gap:16,$alignItems:"center",$width:"100%",children:[e(pp,{children:[t(se,{size:de.M,weight:500,color:i.v2.colors.white[500],children:vo}),t(lp,{children:yo})]}),e(qu,{children:[t(se,{size:de.XS,color:i.v2.colors.silver[200],children:Co}),t(tp,{items:[{title:wo,description:So},{title:ko,description:xo},{title:$o,description:To}]}),t(np,{message:Io})]})]})]}),e(Wu,{center:!0,children:[t(pe,{"data-id":"sampling-onboarding-btn-skip",label:Eo,variant:me.Secondary,onClick:o}),t(pe,{"data-id":"sampling-onboarding-btn-start",label:Ao,rightIcon:up,variant:me.Primary,onClick:a})]})]})},mp=g.div`
932
+ `,Cm=({onSkip:n,onNext:i})=>{const a=b();return e(o,{children:[t(qh,{}),e(Zh,{$width:732,children:[t(gn,{icon:ml}),e(Z,{$gap:16,$alignItems:"center",$width:"100%",children:[e(ym,{children:[t(ce,{size:ue.M,weight:500,color:a.v2.colors.white[500],children:wn}),t(hm,{children:Tn})]}),e(im,{children:[t(ce,{size:ue.XS,color:a.v2.colors.silver[200],children:kn}),t(sm,{items:[{title:In,description:En},{title:Nn,description:On},{title:An,description:$n}]}),t(cm,{message:Rn})]})]})]}),e(em,{center:!0,children:[t(he,{"data-id":"sampling-onboarding-btn-skip",label:Dn,variant:ge.Secondary,onClick:n}),t(he,{"data-id":"sampling-onboarding-btn-start",label:_n,rightIcon:vm,variant:ge.Primary,onClick:i})]})]})},Sm=f.div`
519
933
  display: flex;
520
934
  align-items: stretch;
521
935
  gap: 16px;
522
936
  width: 100%;
523
- `,gp=g.div`
937
+ `,xm=f.div`
524
938
  flex: 1;
525
939
  display: flex;
526
940
  flex-direction: column;
@@ -532,26 +946,26 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
532
946
  background-color 0.15s ease,
533
947
  border-color 0.15s ease;
534
948
 
535
- ${({$selected:e,theme:t})=>e?b`
949
+ ${({$selected:e,theme:t})=>e?v`
536
950
  background-color: ${t.v2.colors.purple[900]};
537
951
  border-color: ${t.v2.colors.purple[400]};
538
- `:b`
952
+ `:v`
539
953
  &:hover {
540
954
  background-color: ${t.v2.colors.silver[700]};
541
955
  }
542
956
  `}
543
- `,fp=g.div`
957
+ `,wm=f.div`
544
958
  display: flex;
545
959
  align-items: center;
546
960
  gap: 8px;
547
961
  padding: 12px 16px;
548
- `,bp=g.div`
962
+ `,Tm=f.div`
549
963
  flex: 1;
550
964
  padding: 8px;
551
965
  display: flex;
552
966
  flex-direction: column;
553
967
  gap: 8px;
554
- `,vp=g.div`
968
+ `,km=f.div`
555
969
  flex: 1;
556
970
  display: flex;
557
971
  flex-direction: column;
@@ -559,17 +973,17 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
559
973
  padding: 12px;
560
974
  border-radius: 12px;
561
975
  background-color: ${({theme:e,$selected:t})=>t?e.v2.colors.purple[900]:e.v2.colors.silver[900]};
562
- `,yp=g.div`
976
+ `,Em=f.div`
563
977
  display: flex;
564
978
  justify-content: flex-end;
565
- `,Cp=g.div`
979
+ `,Im=f.div`
566
980
  display: flex;
567
981
  align-items: center;
568
982
  gap: 8px;
569
983
  padding: 4px 12px 4px 4px;
570
984
  border-radius: 8px;
571
985
  background-color: ${({theme:e})=>e.v2.colors.yellow[1e3]};
572
- `,Sp=g.div`
986
+ `,Om=f.div`
573
987
  display: flex;
574
988
  align-items: center;
575
989
  justify-content: center;
@@ -577,13 +991,13 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
577
991
  height: 24px;
578
992
  border-radius: 6px;
579
993
  background-color: ${({theme:e})=>e.v2.colors.yellow[900]};
580
- `,wp=({selected:n,onSelect:o,name:a,description:i,badgeProps:l,bullets:r,warning:s,onReadMore:c})=>{const d=f(),u=n?d.v2.colors.white[500]:d.v2.colors.silver[200];return e(gp,{$selected:n,onClick:o,children:[e(fp,{children:[t(ve,{"data-id":`sampling-onboarding-radio-${a}`,value:n,onChange:o,size:Ce.L}),t(tl,{size:24,fill:d.v2.colors.white[500]}),t(se,{size:de.S,weight:500,color:d.v2.colors.white[500],children:a})]}),e(bp,{children:[e(vp,{$selected:n,children:[e(q,{$gap:8,children:[t(je,{...l,textSize:de.XXXS}),t(se,{size:de.XXS,color:u,children:i})]}),r&&r.length>0&&t(ep,{color:u,items:r}),s&&e(Cp,{children:[t(Sp,{children:t(nl,{size:18,fill:d.v2.colors.yellow[500]})}),t(se,{size:de.XXXS,color:d.v2.colors.yellow[500],children:s})]})]}),c&&t(yp,{children:t(pe,{"data-id":`sampling-onboarding-btn-read-more-${a}`,label:jo,rightIcon:Ci,variant:me.Text,size:he.S,onClick:e=>{e.stopPropagation(),c()}})})]})]})},xp=({strategy:o,onStrategyChange:a,onBack:i,onNext:l,docsUrl:r})=>{const s=f(),c=r?()=>window.open(r,"_blank"):void 0;return e(n,{children:[t(Yu,{title:No,onBack:i}),e(Hu,{$width:854,children:[t(lp,{children:Oo}),e(mp,{children:[t(wp,{selected:"keep-list"===o,onSelect:()=>a("keep-list"),name:_o,description:Lo,badgeProps:{label:Fo,backgroundColor:s.v2.colors.purple[500],textColor:s.v2.colors.white[500]},bullets:[Do,Po],warning:Ro,onReadMore:c}),t(wp,{selected:"drop-list"===o,onSelect:()=>a("drop-list"),name:Vo,description:Xo,badgeProps:{label:Bo,backgroundColor:s.v2.colors.green[500],textColor:s.v2.colors.black[500]},bullets:[Mo,zo],onReadMore:c}),t(wp,{selected:"advanced"===o,onSelect:()=>a("advanced"),name:Ho,description:Go,badgeProps:{label:Uo,backgroundColor:s.v2.colors.blue[700],textColor:s.v2.colors.white[500]},onReadMore:c})]})]}),t(Wu,{onNext:l})]})},kp=({onBack:o,onNext:i,submitting:l})=>{const r=f(),s=a(()=>[{title:Jo,bullets:[Wo,Ko,Yo]},{title:na,bullets:[qo,Zo,Qo,ea,ta]}],[]);return e(n,{children:[t(Yu,{title:oa,onBack:o}),e(Hu,{$width:854,children:[t(lp,{children:aa}),t(ue,{$gap:16,$width:"100%",$alignItems:"stretch",children:s.map((n,o)=>e(qu,{fillHeight:!0,width:"50%",children:[t(se,{size:de.XS,color:r.v2.colors.white[500],children:n.title}),t(ep,{items:n.bullets})]},o))}),t(np,{message:ia})]}),t(Wu,{onNext:i,nextLoading:l})]})},Tp=g.div`
994
+ `,Nm=({selected:o,onSelect:n,name:i,description:a,badgeProps:l,bullets:r,warning:s,onReadMore:c})=>{const d=b(),u=o?d.v2.colors.white[500]:d.v2.colors.silver[200];return e(xm,{$selected:o,onClick:n,children:[e(wm,{children:[t(ye,{"data-id":`sampling-onboarding-radio-${i}`,value:o,onChange:n,size:Se.L}),t(ml,{size:24,fill:d.v2.colors.white[500]}),t(ce,{size:ue.S,weight:500,color:d.v2.colors.white[500],children:i})]}),e(Tm,{children:[e(km,{$selected:o,children:[e(Z,{$gap:8,children:[t(Ke,{...l,textSize:ue.XXXS}),t(ce,{size:ue.XXS,color:u,children:a})]}),r&&r.length>0&&t(rm,{color:u,items:r}),s&&e(Im,{children:[t(Om,{children:t(gl,{size:18,fill:d.v2.colors.yellow[500]})}),t(ce,{size:ue.XXXS,color:d.v2.colors.yellow[500],children:s})]})]}),c&&t(Em,{children:t(he,{"data-id":`sampling-onboarding-btn-read-more-${i}`,label:qn,rightIcon:Ia,variant:ge.Text,size:me.S,onClick:e=>{e.stopPropagation(),c()}})})]})]})},$m=({strategy:n,onStrategyChange:i,onBack:a,onNext:l,docsUrl:r})=>{const s=b(),c=r?()=>window.open(r,"_blank"):void 0;return e(o,{children:[t(om,{title:Pn,onBack:a}),e(Zh,{$width:854,children:[t(hm,{children:Ln}),e(Sm,{children:[t(Nm,{selected:"keep-list"===n,onSelect:()=>i("keep-list"),name:Un,description:Xn,badgeProps:{label:Bn,backgroundColor:s.v2.colors.purple[500],textColor:s.v2.colors.white[500]},bullets:[Mn,zn],warning:Fn,onReadMore:c}),t(Nm,{selected:"drop-list"===n,onSelect:()=>i("drop-list"),name:Wn,description:Gn,badgeProps:{label:jn,backgroundColor:s.v2.colors.green[500],textColor:s.v2.colors.black[500]},bullets:[Vn,Hn],onReadMore:c}),t(Nm,{selected:"advanced"===n,onSelect:()=>i("advanced"),name:Jn,description:Yn,badgeProps:{label:Kn,backgroundColor:s.v2.colors.blue[700],textColor:s.v2.colors.white[500]},onReadMore:c})]})]}),t(em,{onNext:l})]})},Am=({onBack:n,onNext:i,submitting:l})=>{const r=b(),s=a(()=>[{title:ti,bullets:[Zn,Qn,ei]},{title:ri,bullets:[oi,ni,ii,ai,li]}],[]);return e(o,{children:[t(om,{title:si,onBack:n}),e(Zh,{$width:854,children:[t(hm,{children:ci}),t(pe,{$gap:16,$width:"100%",$alignItems:"stretch",children:s.map((o,n)=>e(im,{fillHeight:!0,width:"50%",children:[t(ce,{size:ue.XS,color:r.v2.colors.white[500],children:o.title}),t(rm,{items:o.bullets})]},n))}),t(cm,{message:di})]}),t(em,{onNext:i,nextLoading:l})]})},Rm=f.div`
581
995
  white-space: pre-line;
582
- `,$p=({errorPresetEnabled:o,onErrorPresetChange:i,onBack:l,onNext:r,submitting:s})=>{const c=f(),d=a(()=>N(o?{disabled:!1}:null),[o]);return e(n,{children:[t(Yu,{title:la,onBack:l}),e(Hu,{$width:854,children:[t(lp,{children:ra}),e(q,{$gap:8,$width:"100%",children:[e(qu,{children:[t(Tp,{children:t(se,{size:de.XXS,color:c.v2.colors.silver[200],children:sa})}),t(np,{message:ia})]}),e(op,{children:[e(ap,{children:[t(se,{size:de.S,weight:500,color:c.v2.colors.white[500],children:ca}),t(Xi,{size:16,fill:c.v2.colors.silver[200]})]}),t(ip,{children:t(Xu,{name:ua,recommended:!0,toggleLabel:da,enabled:o,onEnabledChange:i,summary:d,toggleName:"sampling-onboarding-drop-error-preset-toggle"})})]})]})]}),t(Wu,{onNext:r,nextLoading:s})]})},Ip=g.div`
996
+ `,Dm=({errorPresetEnabled:n,onErrorPresetChange:i,onBack:l,onNext:r,submitting:s})=>{const c=b(),d=a(()=>A(n?{disabled:!1}:null),[n]);return e(o,{children:[t(om,{title:ui,onBack:l}),e(Zh,{$width:854,children:[t(hm,{children:pi}),e(Z,{$gap:8,$width:"100%",children:[e(im,{children:[t(Rm,{children:t(ce,{size:ue.XXS,color:c.v2.colors.silver[200],children:hi})}),t(cm,{message:di})]}),e(dm,{children:[e(um,{children:[t(ce,{size:ue.S,weight:500,color:c.v2.colors.white[500],children:mi}),t(el,{size:16,fill:c.v2.colors.silver[200]})]}),t(pm,{children:t(Kh,{name:fi,recommended:!0,toggleLabel:gi,enabled:n,onEnabledChange:i,summary:d,toggleName:"sampling-onboarding-drop-error-preset-toggle"})})]})]})]}),t(em,{onNext:r,nextLoading:s})]})},_m=f.div`
583
997
  white-space: pre-line;
584
- `,Ep=g.div`
998
+ `,Pm=f.div`
585
999
  width: fit-content;
586
- `,Ap=["50","25","10","1","0.1"],Np=({value:n,onChange:o,label:i})=>{const l=f(),r=a(()=>Ap.map(e=>({value:e,label:`${e}%`,selectedBgColor:l.v2.colors.purple[900],selectedBorderColor:l.v2.colors.purple[400]})),[l]);return e(q,{$gap:8,children:[t(se,{size:de.XS,color:l.v2.colors.white[500],children:i}),t(Ep,{children:t(ge,{"data-id":"sampling-onboarding-ambient",options:r,selected:n,setSelected:o})})]})},Op=({errorPresetEnabled:o,onErrorPresetChange:i,ambientPercentage:l,onAmbientPercentageChange:r,onBack:s,onNext:c,submitting:d})=>{const u=f(),p=a(()=>N(o?{disabled:!1}:null),[o]);return e(n,{children:[t(Yu,{title:pa,onBack:s}),e(Hu,{$width:854,children:[t(lp,{children:ha}),e(q,{$gap:8,$width:"100%",children:[e(qu,{children:[t(Ip,{children:t(se,{size:de.XXS,color:u.v2.colors.silver[200],children:ma})}),t(ep,{items:[ga,fa,ba,va,ya]}),t(np,{message:ia})]}),e(op,{children:[e(ap,{children:[t(se,{size:de.S,weight:500,color:u.v2.colors.white[500],children:Ca}),t(Xi,{size:16,fill:u.v2.colors.silver[200]})]}),t(ip,{children:t(Xu,{name:ua,recommended:!0,toggleLabel:da,enabled:o,onEnabledChange:i,summary:p,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(ip,{children:t(Np,{value:l,onChange:r,label:Sa})})]})]})]}),t(Wu,{onNext:c,nextLoading:d})]})},Rp=({isOpen:e,onClose:n,k8sHealthProbesConfig:a,samplingId:i,docsUrl:s})=>{const{samplingApi:c}=gl(),[d,u]=r("welcome"),[p,h]=r(!0),[m,g]=r("keep-list"),[f,b]=r(!0),[v,y]=r("25"),[C,S]=r(!1);o(()=>{e&&(u("welcome"),h(a?.enabled??!0),g("keep-list"),b(!0),y("25"),S(!1))},[e,a?.enabled]);const w=l(async()=>{const e=i??"default",t=[];if(p!==(a?.enabled??!1)){const e=c.updateK8sHealthProbesConfig;e&&t.push(e({enabled:p,keepPercentage:a?.keepPercentage??0}))}if("advanced"!==m&&f){const n=c.createHighlyRelevant;n&&t.push(n({samplingId:e,rule:{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}}))}if("keep-list"===m){const n=c.createCostReduction;n&&t.push(n({samplingId:e,rule:{name:"Onboarding - Ambient sampling",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:parseFloat(v)}}))}S(!0);try{await Promise.all(t),u("success")}catch{}finally{S(!1)}},[i,c,p,a?.enabled,a?.keepPercentage,m,f,v]);let x=null;switch(d){case"welcome":x=t(hp,{onSkip:n,onNext:()=>u("noisy")});break;case"noisy":x=t(sp,{enabled:p,onEnabledChange:h,onBack:()=>u("welcome"),onNext:()=>u("strategy")});break;case"strategy":x=t(xp,{strategy:m,onStrategyChange:g,onBack:()=>u("noisy"),onNext:()=>{u("keep-list"===m?"keep-list":"drop-list"===m?"drop-list":"advanced")},docsUrl:s});break;case"keep-list":x=t(Op,{errorPresetEnabled:f,onErrorPresetChange:b,ambientPercentage:v,onAmbientPercentageChange:y,onBack:()=>u("strategy"),onNext:w,submitting:C});break;case"drop-list":x=t($p,{errorPresetEnabled:f,onErrorPresetChange:b,onBack:()=>u("strategy"),onNext:w,submitting:C});break;case"advanced":x=t(kp,{onBack:()=>u("strategy"),onNext:w,submitting:C});break;case"success":x=t(dp,{onClose:n})}return t(Qn,{isOpen:e,onClose:n,children:x})};var Dp,Pp;!function(e){e.BulkConfig="bulk-config",e.BulkSource="bulk-source",e.BulkDestination="bulk-destination",e.BulkAction="bulk-action",e.BulkInstrumentationRule="bulk-instrumentation-rule",e.Delete="delete"}(Dp||(Dp={})),function(e){e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"}(Pp||(Pp={}));const Fp=[{key:Pp.Name,label:"Name"},{key:Pp.Type,label:"Type",textAlign:"right"},{key:Pp.Status,label:"Status"},{key:Pp.OdigosVersion,label:"Odigos Version"},{key:Pp.ConnectedSince,label:"Connected Since"},{key:Pp.LastActivity,label:"Last Activity"}],Lp=(e,t)=>{const n=e.find(e=>e.key===Pp.Id)?.rawValue;return t(n?.toString()||"")},_p=e=>{const{connections:t,configMinSupportedVersion:n,snapshotMinSupportedVersion:o,onDelete:a,onAddSource:i,onAddDestination:l,onAddAction:r,onAddInstrumentationRule:s,onEditConfiguration:c}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===Pp.Status)?.rawValue===Re.Success)(e))return[{id:qn(),label:"Delete Connection",rightIcon:Si,onClick:()=>Lp(e,a)}];const d=Lp(e,e=>{const o=t.find(t=>t.id===e);return!!o&&O(o.odigosVersion,n)}),u=Lp(e,e=>{const n=t.find(t=>t.id===e);return!!n&&O(n.odigosVersion,o)}),p=[];return i&&p.push({id:qn(),tooltip:u?Je.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${o} or later.`,rightIcon:Di,disabled:!u,onClick:()=>Lp(e,i)}),l&&p.push({id:qn(),tooltip:Je.ADD_DESTINATION,rightIcon:Ii,onClick:()=>Lp(e,l)}),r&&p.push({id:qn(),tooltip:Je.ADD_ACTION,rightIcon:$i,onClick:()=>Lp(e,r)}),s&&p.push({id:qn(),tooltip:Je.ADD_INSTRUMENTATION_RULE,rightIcon:Ri,onClick:()=>Lp(e,s)}),c&&p.push({id:qn(),tooltip:d?"Edit Configuration":`To use this feature, please upgrade to Odigos v${n} or later.`,rightIcon:Fi,disabled:!d,onClick:()=>Lp(e,c)}),p}},Mp=({connections:n,getConnections:i,onClickConnection:s,deleteConnection:c,configMinSupportedVersion:d=0,snapshotMinSupportedVersion:u=0})=>{const p=f(),{formatTimeAgo:h}=Ht(),{capabilities:m}=gl(),[g,b]=r(!1),[v,y]=r(n||[]),C=l(async()=>{try{b(!0),y(await i()??[])}catch(e){}finally{b(!1)}},[]);o(()=>{v.length||C()},[]);const[S,w]=r(""),[x,k]=r(null),[T,$]=r([]),I=a(()=>x===Dp.BulkConfig?d:x===Dp.BulkSource?u:0,[x,d,u]),{supportedConnections:E,supportedConnectionIds:A}=a(()=>{const e=((e,t)=>e.filter(e=>{const n=e.status===Re.Success,o=O(e.odigosVersion,t);return n&&o}))(v,I);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[v,I]);o(()=>{if(!x||x===Dp.Delete)return;const e=T.filter(e=>!A.includes(e));e.length&&$(t=>t.filter(t=>!e.includes(t)))},[x,T.length,A.length]);const N=a(()=>v.filter(e=>!S||e.name.toLowerCase().includes(S.toLowerCase())).map(e=>({cells:[{key:Pp.Id,rawValue:e.id},{key:Pp.Name,rawValue:e.name},{key:Pp.Type,rawValue:e.type},{key:Pp.Status,rawValue:e.status,component:()=>(e=>{const n=e===Re.Success?"Connection live":"Connection lost",o=e===Re.Success?Ni:Oi;return t(je,{status:e,label:n,leftIcon:o})})(e.status)},{key:Pp.OdigosVersion,rawValue:e.odigosVersion},{key:Pp.ConnectedSince,rawValue:e.connectedAt?h(e.connectedAt):"-"},{key:Pp.LastActivity,rawValue:e.lastSeenAt?h(e.lastSeenAt):"-"}],onClick:e.status!==Re.Success||x?void 0:()=>s(e),isSelected:T.includes(e.id),onSelect:()=>$(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>$(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==Re.Success||x===Dp.BulkConfig&&!O(e.odigosVersion,d)||x===Dp.BulkSource&&!O(e.odigosVersion,u)})),[v,T,S,x,d,u,h,s]),R=a(()=>{const e=(e,t)=>{$([e]),k(t)};return _p({connections:v,configMinSupportedVersion:d,snapshotMinSupportedVersion:u,onDelete:t=>e(t,Dp.Delete),onAddSource:m.canFetchSnapshots&&m.canBulkPersistSources?t=>e(t,Dp.BulkSource):void 0,onAddDestination:m.canFetchDestinationCategories&&m.canFetchPotentialDestinations&&m.canCreateDestination?t=>e(t,Dp.BulkDestination):void 0,onAddAction:m.canCreateAction?t=>e(t,Dp.BulkAction):void 0,onAddInstrumentationRule:m.canCreateInstrumentationRule?t=>e(t,Dp.BulkInstrumentationRule):void 0,onEditConfiguration:m.canApplyEffectiveConfig?t=>e(t,Dp.BulkConfig):void 0})},[v,d,u,m]),D=a(()=>(e=>{const{onCancel:t,onAddSource:n,onAddDestination:o,onAddAction:a,onAddInstrumentationRule:i,onManageConfigurations:l}=e,r=[];n&&r.push({id:qn(),type:tn.Button,buttonProps:{variant:me.Primary,size:he.S,label:"Add Sources",rightIcon:Di,onClick:n}});const s=[o?{id:Dp.BulkDestination,label:Je.ADD_DESTINATION,icon:Ii}:null,a?{id:Dp.BulkAction,label:Je.ADD_ACTION,icon:$i}:null,i?{id:Dp.BulkInstrumentationRule,label:Je.ADD_INSTRUMENTATION_RULE,icon:Ri}:null,l?{id:Dp.BulkConfig,label:"Manage Configurations",icon:Fi}:null];return s.some(Boolean)&&r.push({id:qn(),type:tn.ButtonDropData,buttonProps:{variant:me.Secondary,size:he.S,label:"Bulk Operations",onClick:e=>{e===Dp.BulkSource?n?.():e===Dp.BulkDestination?o?.():e===Dp.BulkAction?a?.():e===Dp.BulkInstrumentationRule?i?.():e===Dp.BulkConfig&&l?.()}},dropDataProps:{alignX:Jn.Left,items:s}}),r.push({id:qn(),type:tn.Button,buttonProps:{variant:me.Text,size:he.S,label:Rt.CANCEL,onClick:t}}),r})({onCancel:()=>$([]),onAddSource:m.canFetchSnapshots&&m.canBulkPersistSources?()=>k(Dp.BulkSource):void 0,onAddDestination:m.canFetchDestinationCategories&&m.canFetchPotentialDestinations&&m.canCreateDestination?()=>k(Dp.BulkDestination):void 0,onAddAction:m.canCreateAction?()=>k(Dp.BulkAction):void 0,onAddInstrumentationRule:m.canCreateInstrumentationRule?()=>k(Dp.BulkInstrumentationRule):void 0,onManageConfigurations:m.canApplyEffectiveConfig?()=>k(Dp.BulkConfig):void 0}),[m]);return t(wa,{children:e(lt,{fullHeight:!0,richTitle:{icon:rl,title:Je.CONNECTIONS,badge:{label:v.length.toString(),status:Re.Unknown}},search:{placeholder:"Search by cluster name",value:S,onChange:e=>w(e),width:"300px"},actions:[{id:qn(),type:tn.Button,buttonProps:{variant:me.Secondary,size:he.S,leftIcon:zi,onClick:C,disabled:g}}],children:[t(Sn,{variant:wn.Pretty,headerBackgroundColor:p.v2.colors.silver[1e3],isLoading:g,withCheckboxes:!0,columns:Fp,rows:N,rowActionsPushRightPosition:x?`calc(${Pl} - 24px)`:void 0,getRowActions:R}),x===Dp.BulkConfig&&m.canApplyEffectiveConfig&&t(Ll,{connectionIds:T,children:t(tc,{onClose:()=>k(null),connections:E,selectedConnectionIds:T,setSelectedConnectionIds:$})}),x===Dp.BulkSource&&m.canFetchSnapshots&&m.canBulkPersistSources&&t(Ll,{connectionIds:T,children:t(Jl,{selectedConnectionIds:T,children:t(Zs,{onClose:()=>k(null),selectedConnectionIds:T,setSelectedConnectionIds:$})})}),x===Dp.BulkDestination&&m.canFetchDestinationCategories&&m.canFetchPotentialDestinations&&m.canTestConnection&&m.canCreateDestination&&t(Ll,{connectionIds:T,children:t(ql,{children:t(Os,{onClose:()=>k(null),selectedConnectionIds:T,setSelectedConnectionIds:$})})}),x===Dp.BulkAction&&m.canCreateAction&&t(Ll,{connectionIds:T,children:t(Zl,{children:t(Ss,{onClose:()=>k(null),selectedConnectionIds:T,setSelectedConnectionIds:$})})}),x===Dp.BulkInstrumentationRule&&m.canCreateInstrumentationRule&&t(Ll,{connectionIds:T,children:t(Ql,{children:t(Rs,{onClose:()=>k(null),selectedConnectionIds:T,setSelectedConnectionIds:$})})}),t(Nl,{target:"connection",isOpen:x===Dp.Delete,onClose:()=>{$([]),k(null)},onApprove:async()=>{const e=T[0];e&&(await c(e),await C())}}),t(xn,{isOpen:!!T.length&&!x,richTitle:{icon:vi,title:"Selected Clusters",badge:{label:T.length}},actions:D})]})})},zp=g.div`
1000
+ `,Lm=["50","25","10","1","0.1"],Fm=({value:o,onChange:n,label:i})=>{const l=b(),r=a(()=>Lm.map(e=>({value:e,label:`${e}%`,selectedBgColor:l.v2.colors.purple[900],selectedBorderColor:l.v2.colors.purple[400]})),[l]);return e(Z,{$gap:8,children:[t(ce,{size:ue.XS,color:l.v2.colors.white[500],children:i}),t(Pm,{children:t(fe,{"data-id":"sampling-onboarding-ambient",options:r,selected:o,setSelected:n})})]})},Mm=({errorPresetEnabled:n,onErrorPresetChange:i,ambientPercentage:l,onAmbientPercentageChange:r,onBack:s,onNext:c,submitting:d})=>{const u=b(),p=a(()=>A(n?{disabled:!1}:null),[n]);return e(o,{children:[t(om,{title:bi,onBack:s}),e(Zh,{$width:854,children:[t(hm,{children:vi}),e(Z,{$gap:8,$width:"100%",children:[e(im,{children:[t(_m,{children:t(ce,{size:ue.XXS,color:u.v2.colors.silver[200],children:yi})}),t(rm,{items:[Ci,Si,xi,wi,Ti]}),t(cm,{message:di})]}),e(dm,{children:[e(um,{children:[t(ce,{size:ue.S,weight:500,color:u.v2.colors.white[500],children:ki}),t(el,{size:16,fill:u.v2.colors.silver[200]})]}),t(pm,{children:t(Kh,{name:fi,recommended:!0,toggleLabel:gi,enabled:n,onEnabledChange:i,summary:p,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(pm,{children:t(Fm,{value:l,onChange:r,label:Ei})})]})]})]}),t(em,{onNext:c,nextLoading:d})]})},zm=({isOpen:e,onClose:o,k8sHealthProbesConfig:n,samplingId:a,docsUrl:l})=>{const{samplingApi:c}=Nl(),[d,u]=s("welcome"),[p,h]=s(!0),[m,g]=s("keep-list"),[f,b]=s(!0),[v,y]=s("25"),[C,S]=s(!1);i(()=>{e&&(u("welcome"),h(n?.enabled??!0),g("keep-list"),b(!0),y("25"),S(!1))},[e,n?.enabled]);const x=r(async()=>{const e=a??"default",t=[];if(p!==(n?.enabled??!1)){const e=c.updateK8sHealthProbesConfig;e&&t.push(e({enabled:p,keepPercentage:n?.keepPercentage??0}))}if("advanced"!==m&&f){const o=c.createHighlyRelevant;o&&t.push(o({samplingId:e,rule:{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}}))}if("keep-list"===m){const o=c.createCostReduction;o&&t.push(o({samplingId:e,rule:{name:"Onboarding - Ambient sampling",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:parseFloat(v)}}))}S(!0);try{await Promise.all(t),u("success")}catch{}finally{S(!1)}},[a,c,p,n?.enabled,n?.keepPercentage,m,f,v]);let w=null;switch(d){case"welcome":w=t(Cm,{onSkip:o,onNext:()=>u("noisy")});break;case"noisy":w=t(gm,{enabled:p,onEnabledChange:h,onBack:()=>u("welcome"),onNext:()=>u("strategy")});break;case"strategy":w=t($m,{strategy:m,onStrategyChange:g,onBack:()=>u("noisy"),onNext:()=>{u("keep-list"===m?"keep-list":"drop-list"===m?"drop-list":"advanced")},docsUrl:l});break;case"keep-list":w=t(Mm,{errorPresetEnabled:f,onErrorPresetChange:b,ambientPercentage:v,onAmbientPercentageChange:y,onBack:()=>u("strategy"),onNext:x,submitting:C});break;case"drop-list":w=t(Dm,{errorPresetEnabled:f,onErrorPresetChange:b,onBack:()=>u("strategy"),onNext:x,submitting:C});break;case"advanced":w=t(Am,{onBack:()=>u("strategy"),onNext:x,submitting:C});break;case"success":w=t(bm,{onClose:o})}return t(an,{isOpen:e,onClose:o,children:w})};var Bm,Xm;!function(e){e.BulkConfig="bulk-config",e.BulkSource="bulk-source",e.BulkDestination="bulk-destination",e.BulkAction="bulk-action",e.BulkInstrumentationRule="bulk-instrumentation-rule",e.Delete="delete"}(Bm||(Bm={})),function(e){e.K8s="k8s",e.VmAgent="vm-agent",e.CloudConnector="cloud-connector"}(Xm||(Xm={}));const Um=[{id:Xm.K8s,label:"K8s"},{id:Xm.VmAgent,label:"VM agent"},{id:Xm.CloudConnector,label:"Cloud Connector"}];var Vm;!function(e){e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"}(Vm||(Vm={}));const Hm=[{key:Vm.Name,label:"Name"},{key:Vm.Type,label:"Type"},{key:Vm.Status,label:"Status"},{key:Vm.OdigosVersion,label:"Odigos Version"},{key:Vm.ConnectedSince,label:"Connected Since"},{key:Vm.LastActivity,label:"Last Activity"}],jm=(e,t)=>{const o=e.find(e=>e.key===Vm.Id)?.rawValue;return t(o?.toString()||"")},Gm=e=>{const{connections:t,configMinSupportedVersion:o,snapshotMinSupportedVersion:n,onDelete:i,onAddSource:a,onAddDestination:l,onAddAction:r,onAddInstrumentationRule:s,onEditConfiguration:c}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===Vm.Status)?.rawValue===Pe.Success)(e))return[{id:on(),label:"Delete Connection",rightIcon:Oa,onClick:()=>jm(e,i)}];if(!jm(e,e=>{const o=t.find(t=>t.id===e);return o?.type===Ii.K8s}))return[];const d=jm(e,e=>{const n=t.find(t=>t.id===e);return!!n&&R(n.odigosVersion,o)}),u=jm(e,e=>{const o=t.find(t=>t.id===e);return!!o&&R(o.odigosVersion,n)}),p=[];return a&&p.push({id:on(),tooltip:u?Ze.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${n} or later.`,rightIcon:Ba,disabled:!u,onClick:()=>jm(e,a)}),l&&p.push({id:on(),tooltip:Ze.ADD_DESTINATION,rightIcon:_a,onClick:()=>jm(e,l)}),r&&p.push({id:on(),tooltip:Ze.ADD_ACTION,rightIcon:Da,onClick:()=>jm(e,r)}),s&&p.push({id:on(),tooltip:Ze.ADD_INSTRUMENTATION_RULE,rightIcon:za,onClick:()=>jm(e,s)}),c&&p.push({id:on(),tooltip:d?"Edit Configuration":`To use this feature, please upgrade to Odigos v${o} or later.`,rightIcon:Ya,disabled:!d,onClick:()=>jm(e,c)}),p}},Wm={[Pe.Success]:"Connected",[Pe.Warning]:"Degraded",[Pe.Error]:"Error",[Pe.Disabled]:"Disabled",[Pe.Info]:"Pending"},Km={[Ii.K8s]:ao.Purple,[Ii.Vm]:ao.Blue,[Ii.Connector]:ao.Green},Ym=({connections:o,getConnections:n,onClickConnection:l,deleteConnection:c,onCreateNew:d,cloudConnectorProviders:u,onCreateCloudConnector:p,configMinSupportedVersion:h=0,snapshotMinSupportedVersion:m=0})=>{const g=b(),{formatTimeAgo:f}=qt(),{capabilities:v}=Nl(),[y,C]=s(!1),[S,x]=s(o||[]),w=r(async()=>{try{C(!0),x(await n()??[])}catch(e){}finally{C(!1)}},[]);i(()=>{S.length||w()},[]);const[T,k]=s(""),[E,I]=s(null),[O,N]=s([]),[$,A]=s(!1),[D,_]=s(!1),P=r(()=>{A(!1),_(!0),w()},[w]),L=r(e=>{e===Xm.CloudConnector?A(!0):d?.(e)},[d]),F=a(()=>E===Bm.BulkConfig?h:E===Bm.BulkSource?m:0,[E,h,m]),{supportedConnections:M,supportedConnectionIds:z}=a(()=>{const e=((e,t)=>e.filter(e=>{const o=e.status===Pe.Success,n=R(e.odigosVersion,t);return o&&n}))(S,F);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[S,F]);i(()=>{if(!E||E===Bm.Delete)return;const e=O.filter(e=>!z.includes(e));e.length&&N(t=>t.filter(t=>!e.includes(t)))},[E,O.length,z.length]);const B=a(()=>S.filter(e=>!T||e.name.toLowerCase().includes(T.toLowerCase())).map(e=>({cells:[{key:Vm.Id,rawValue:e.id},{key:Vm.Name,rawValue:e.name},{key:Vm.Type,rawValue:e.type,component:()=>t(Yt,{variant:Km[e.type]??ao.Default,label:Oi(e.type)})},{key:Vm.Status,rawValue:e.status,component:()=>(e=>{if(e.type===Ii.Connector){const o=Wm[e.status]??"Pending",n=e.status===Pe.Success?Fa:e.status===Pe.Error?Ma:void 0;return t(Ke,{status:e.status,label:o,leftIcon:n})}const o=e.status===Pe.Success?"Connection live":"Connection lost",n=e.status===Pe.Success?Fa:Ma;return t(Ke,{status:e.status,label:o,leftIcon:n})})(e)},{key:Vm.OdigosVersion,rawValue:e.odigosVersion},{key:Vm.ConnectedSince,rawValue:e.connectedAt?f(e.connectedAt):"-"},{key:Vm.LastActivity,rawValue:e.lastSeenAt?f(e.lastSeenAt):"-"}],onClick:e.status!==Pe.Success||E?void 0:()=>l(e),isSelected:O.includes(e.id),onSelect:()=>N(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>N(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==Pe.Success||E===Bm.BulkConfig&&!R(e.odigosVersion,h)||E===Bm.BulkSource&&!R(e.odigosVersion,m)})),[S,O,T,E,h,m,f,l]),X=a(()=>S.length>0&&S.every(e=>e.type===Ii.K8s),[S]),U=a(()=>{const e=(e,t)=>{N([e]),I(t)};return Gm({connections:S,configMinSupportedVersion:h,snapshotMinSupportedVersion:m,onDelete:t=>e(t,Bm.Delete),onAddSource:v.canFetchSnapshots&&v.canBulkPersistSources?t=>e(t,Bm.BulkSource):void 0,onAddDestination:v.canFetchDestinationCategories&&v.canFetchPotentialDestinations&&v.canCreateDestination?t=>e(t,Bm.BulkDestination):void 0,onAddAction:v.canCreateAction?t=>e(t,Bm.BulkAction):void 0,onAddInstrumentationRule:v.canCreateInstrumentationRule?t=>e(t,Bm.BulkInstrumentationRule):void 0,onEditConfiguration:v.canApplyEffectiveConfig?t=>e(t,Bm.BulkConfig):void 0})},[S,h,m,v]),V=a(()=>(e=>{const{onCancel:t,onAddSource:o,onAddDestination:n,onAddAction:i,onAddInstrumentationRule:a,onManageConfigurations:l}=e,r=[];o&&r.push({id:on(),type:ro.Button,buttonProps:{variant:ge.Primary,size:me.S,label:"Add Sources",rightIcon:Ba,onClick:o}});const s=[n?{id:Bm.BulkDestination,label:Ze.ADD_DESTINATION,icon:_a}:null,i?{id:Bm.BulkAction,label:Ze.ADD_ACTION,icon:Da}:null,a?{id:Bm.BulkInstrumentationRule,label:Ze.ADD_INSTRUMENTATION_RULE,icon:za}:null,l?{id:Bm.BulkConfig,label:"Manage Configurations",icon:Ya}:null];return s.some(Boolean)&&r.push({id:on(),type:ro.ButtonDropData,buttonProps:{variant:ge.Secondary,size:me.S,label:"Bulk Operations",onClick:e=>{e===Bm.BulkSource?o?.():e===Bm.BulkDestination?n?.():e===Bm.BulkAction?i?.():e===Bm.BulkInstrumentationRule?a?.():e===Bm.BulkConfig&&l?.()}},dropDataProps:{alignX:tn.Left,items:s}}),r.push({id:on(),type:ro.Button,buttonProps:{variant:ge.Text,size:me.S,label:Pt.CANCEL,onClick:t}}),r})({onCancel:()=>N([]),onAddSource:v.canFetchSnapshots&&v.canBulkPersistSources?()=>I(Bm.BulkSource):void 0,onAddDestination:v.canFetchDestinationCategories&&v.canFetchPotentialDestinations&&v.canCreateDestination?()=>I(Bm.BulkDestination):void 0,onAddAction:v.canCreateAction?()=>I(Bm.BulkAction):void 0,onAddInstrumentationRule:v.canCreateInstrumentationRule?()=>I(Bm.BulkInstrumentationRule):void 0,onManageConfigurations:v.canApplyEffectiveConfig?()=>I(Bm.BulkConfig):void 0}),[v]);return t(Ni,{children:e(st,{fullHeight:!0,richTitle:{icon:Cl,title:Ze.CONNECTIONS,badge:{label:S.length.toString(),status:Pe.Unknown}},search:{placeholder:"Search by cluster name",value:T,onChange:e=>k(e),width:"300px"},actions:[{id:"connections-refresh",type:ro.Button,buttonProps:{variant:ge.Secondary,size:me.S,leftIcon:Ka,onClick:w,disabled:y}},{id:"connections-create-new",type:ro.ButtonDropData,buttonProps:{variant:ge.Primary,size:me.S,label:Pt.CREATE_NEW,onClick:e=>L(e)},dropDataProps:{alignX:tn.Right,items:Um}}],children:[t(Eo,{variant:Io.Pretty,headerBackgroundColor:g.v2.colors.silver[1e3],isLoading:y,withCheckboxes:X,columns:Hm,rows:B,rowActionsPushRightPosition:E?`calc(${Hl} - 24px)`:void 0,getRowActions:U}),E===Bm.BulkConfig&&v.canApplyEffectiveConfig&&t(ql,{connectionIds:O,children:t(su,{onClose:()=>I(null),connections:M,selectedConnectionIds:O,setSelectedConnectionIds:N})}),E===Bm.BulkSource&&v.canFetchSnapshots&&v.canBulkPersistSources&&t(ql,{connectionIds:O,children:t(pr,{selectedConnectionIds:O,children:t(wc,{onClose:()=>I(null),selectedConnectionIds:O,setSelectedConnectionIds:N})})}),E===Bm.BulkDestination&&v.canFetchDestinationCategories&&v.canFetchPotentialDestinations&&v.canTestConnection&&v.canCreateDestination&&t(ql,{connectionIds:O,children:t(hr,{children:t(tc,{onClose:()=>I(null),selectedConnectionIds:O,setSelectedConnectionIds:N})})}),E===Bm.BulkAction&&v.canCreateAction&&t(ql,{connectionIds:O,children:t(mr,{children:t(js,{onClose:()=>I(null),selectedConnectionIds:O,setSelectedConnectionIds:N})})}),E===Bm.BulkInstrumentationRule&&v.canCreateInstrumentationRule&&t(ql,{connectionIds:O,children:t(gr,{children:t(oc,{onClose:()=>I(null),selectedConnectionIds:O,setSelectedConnectionIds:N})})}),$&&t(fr,{providers:u,children:t(au,{onClose:()=>A(!1),withOverlay:!0,onCreateCloudConnector:p,onCreated:P})}),t(Yl,{isOpen:D,onClose:()=>_(!1)}),t(Gl,{target:"connection",isOpen:E===Bm.Delete,onClose:()=>{N([]),I(null)},onApprove:async()=>{const e=O[0];e&&(await c(e),await w())}}),t(Oo,{isOpen:!!O.length&&!E,richTitle:{icon:ka,title:"Selected Clusters",badge:{label:O.length}},actions:V})]})})},Jm=f.div`
587
1001
  display: flex;
588
1002
  align-items: center;
589
1003
  justify-content: space-between;
@@ -592,26 +1006,26 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
592
1006
  width: 100%;
593
1007
  border-radius: 16px;
594
1008
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
595
- `,Bp=g.div`
1009
+ `,qm=f.div`
596
1010
  display: flex;
597
1011
  align-items: center;
598
1012
  justify-content: center;
599
1013
  padding: 8px;
600
1014
  border-radius: 8px;
601
- background-color: ${({theme:e})=>e.v2.colors.white[500]+st["004"]};
602
- `,Xp=({setStep:n,onSave:o,sourcesPayload:i,destinationsPayload:l,disableAnimation:r})=>{const s=f(),c=()=>n(2),d=()=>n(3),u=a(()=>Object.values(i||{}).flatMap((n,o)=>n.map((n,a)=>{if(!n.selected)return null;const i=n.kind||wt.Namespace,l=i===wt.Namespace?n.namespace:`${n.namespace} → ${n.name}`;return e(zp,{children:[t(se,{nowrap:!0,children:l}),t(je,{label:i,status:Re.Info,backgroundColor:s.v2.colors.blue[900]})]},`source-${o}-${a}`)})).filter(Boolean),[i]),p=a(()=>l?.map((n,o)=>{const a=yt(n.option.type).icon;return e(zp,{children:[e(ue,{$gap:8,children:[a&&t(Bp,{children:t(a,{size:24})}),t(se,{nowrap:!0,children:n.formData.name||n.option.displayName})]}),void 0!==n.testResult&&t(je,{status:n.testResult.succeeded?Re.Success:Re.Error,leftIcon:n.testResult.succeeded?Ni:Oi})]},`destination-${o}`)})||[],[l]);return t(Al,{isOpen:!0,disableAnimation:r,onBack:()=>n(3),onSave:o,header:{icon:_i,title:Je.SUMMARY,subTitle:Je.REVIEW_SETUP},leftColumn:{width:"50%",header:e(ue,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(ue,{$gap:8,children:[t(Di,{size:24}),t(se,{nowrap:!0,children:Je.SELECTED_SOURCES}),t(je,{label:u.length})]}),t(pe,{"data-id":"summary-edit-sources",leftIcon:wi,variant:me.Secondary,size:he.S,onClick:c})]}),list:u.length?u:[t(pt,{$height:"100%",children:t(Ie,{icon:Di,title:Je.NO_SOURCES_SELECTED,subTitle:Je.ADD_SOURCE_PROMPT,button:{leftIcon:fi,label:Je.ADD_SOURCE,onClick:c}})},"no-sources-data")]},rightColumn:{width:"50%",header:e(ue,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(ue,{$gap:8,children:[t(Ii,{size:24}),t(se,{nowrap:!0,children:Je.SELECTED_DESTINATIONS}),t(je,{label:p.length})]}),t(pe,{"data-id":"summary-edit-destinations",leftIcon:wi,variant:me.Secondary,size:he.S,onClick:d})]}),list:p.length?p:[t(pt,{"data-id":"summary-no-destinations",$height:"100%",children:t(Ie,{icon:Ii,title:Je.NO_DESTINATIONS_SELECTED,subTitle:Je.ADD_DESTINATION_PROMPT,button:{leftIcon:fi,label:Je.ADD_DESTINATIONS,onClick:d}})},"no-destinations-data")]}})},Vp=g.div`
1015
+ background-color: ${({theme:e})=>e.v2.colors.white[500]+dt["004"]};
1016
+ `,Zm=({setStep:o,onSave:n,sourcesPayload:i,destinationsPayload:l,disableAnimation:r})=>{const s=b(),c=()=>o(2),d=()=>o(3),u=a(()=>Object.values(i||{}).flatMap((o,n)=>o.map((o,i)=>{if(!o.selected)return null;const a=o.kind||Tt.Namespace,l=a===Tt.Namespace?o.namespace:`${o.namespace} → ${o.name}`;return e(Jm,{children:[t(ce,{nowrap:!0,children:l}),t(Ke,{label:a,status:Pe.Info,backgroundColor:s.v2.colors.blue[900]})]},`source-${n}-${i}`)})).filter(Boolean),[i]),p=a(()=>l?.map((o,n)=>{const i=St(o.option.type).icon;return e(Jm,{children:[e(pe,{$gap:8,children:[i&&t(qm,{children:t(i,{size:24})}),t(ce,{nowrap:!0,children:o.formData.name||o.option.displayName})]}),void 0!==o.testResult&&t(Ke,{status:o.testResult.succeeded?Pe.Success:Pe.Error,leftIcon:o.testResult.succeeded?Fa:Ma})]},`destination-${n}`)})||[],[l]);return t(Vl,{isOpen:!0,disableAnimation:r,onBack:()=>o(3),onSave:n,header:{icon:qa,title:Ze.SUMMARY,subTitle:Ze.REVIEW_SETUP},leftColumn:{width:"50%",header:e(pe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(pe,{$gap:8,children:[t(Ba,{size:24}),t(ce,{nowrap:!0,children:Ze.SELECTED_SOURCES}),t(Ke,{label:u.length})]}),t(he,{"data-id":"summary-edit-sources",leftIcon:Na,variant:ge.Secondary,size:me.S,onClick:c})]}),list:u.length?u:[t(mt,{$height:"100%",children:t($e,{icon:Ba,title:Ze.NO_SOURCES_SELECTED,subTitle:Ze.ADD_SOURCE_PROMPT,button:{leftIcon:wa,label:Ze.ADD_SOURCE,onClick:c}})},"no-sources-data")]},rightColumn:{width:"50%",header:e(pe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(pe,{$gap:8,children:[t(_a,{size:24}),t(ce,{nowrap:!0,children:Ze.SELECTED_DESTINATIONS}),t(Ke,{label:p.length})]}),t(he,{"data-id":"summary-edit-destinations",leftIcon:Na,variant:ge.Secondary,size:me.S,onClick:d})]}),list:p.length?p:[t(mt,{"data-id":"summary-no-destinations",$height:"100%",children:t($e,{icon:_a,title:Ze.NO_DESTINATIONS_SELECTED,subTitle:Ze.ADD_DESTINATION_PROMPT,button:{leftIcon:wa,label:Ze.ADD_DESTINATIONS,onClick:d}})},"no-destinations-data")]}})},Qm=f.div`
603
1017
  position: relative;
604
1018
  overflow: hidden;
605
1019
  width: 100vw;
606
1020
  height: 100vh;
607
1021
  box-sizing: border-box;
608
- `,Up=g.svg`
1022
+ `,eg=f.svg`
609
1023
  position: absolute;
610
1024
  top: 50%;
611
1025
  left: 50%;
612
1026
  transform: translate(-50%, -50%);
613
1027
  z-index: -1;
614
- `,Gp=[{opacity:"0.1"},{offset:"0.31",opacity:"0.11"},{offset:"0.45",opacity:"0.14"},{offset:"0.56",opacity:"0.19"},{offset:"0.65",opacity:"0.26"},{offset:"0.73",opacity:"0.35"},{offset:"0.8",opacity:"0.46"},{offset:"0.86",opacity:"0.6"},{offset:"0.92",opacity:"0.76"},{offset:"0.98",opacity:"0.93"},{offset:"1"}],Hp=[{width:1440,height:900,pathOpacity:.1,path:"M719.992 1169.99C322.351 1169.99 0 847.64 0 450C0 52.3591 322.351 -269.992 719.992 -269.992C1117.63 -269.992 1439.98 52.3591 1439.98 450C1439.98 847.64 1117.63 1169.99 719.992 1169.99Z",gradientTransform:"translate(814.309 444.011) rotate(180) scale(718.904)",stops:[{opacity:"0.1"},{offset:"0.41",opacity:"0.11"},{offset:"0.56",opacity:"0.13"},{offset:"0.67",opacity:"0.18"},{offset:"0.75",opacity:"0.25"},{offset:"0.83",opacity:"0.33"},{offset:"0.89",opacity:"0.44"},{offset:"0.95",opacity:"0.56"},{offset:"1",opacity:"0.7"}]},{width:1343,height:900,pathOpacity:.3,path:"M671.344 1121.34C300.571 1121.34 0 820.773 0 450C0 79.2264 300.571 -221.345 671.344 -221.345C1042.12 -221.345 1342.69 79.2264 1342.69 450C1342.69 820.773 1042.12 1121.34 671.344 1121.34Z",gradientTransform:"translate(644.026 441.551) rotate(180) scale(581.31)",stops:Gp},{width:1163,height:900,pathOpacity:.5,path:"M581.31 1031.31C260.261 1031.31 0 771.048 0 449.999C0 128.951 260.261 -131.311 581.31 -131.311C902.358 -131.311 1162.62 128.951 1162.62 449.999C1162.62 771.048 902.358 1031.31 581.31 1031.31Z",gradientTransform:"translate(644.026 441.551) rotate(180) scale(581.31)",stops:Gp},{width:798,height:798,pathOpacity:.7,path:"M398.581 797.162C178.451 797.162 0 618.711 0 398.581C0 178.451 178.451 0 398.581 0C618.711 0 797.162 178.451 797.162 398.581C797.162 618.711 618.711 797.162 398.581 797.162Z",gradientTransform:"translate(445.003 392.441) rotate(180) scale(398.23)",stops:Gp}],jp=({paddingXAxis:n="0px",paddingYAxis:i="0px",children:l})=>{const[s,c]=r(window.innerWidth),d=a(()=>s/Hp[0].width,[s]);return o(()=>{const e=()=>c(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e(Vp,{$paddingXAxis:n,$paddingYAxis:i,children:[Hp.map(({width:n,height:o,pathOpacity:a,path:i,gradientTransform:l,stops:r},s)=>{const c=`purple-ring-${s}`;return e(Up,{width:n*d,height:"100%",viewBox:`0 0 ${n} ${o}`,fill:"none",children:[t("path",{opacity:a,d:i,fill:`url(#${c})`}),t("defs",{children:t("radialGradient",{id:c,cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:l,children:r.map(({offset:e,opacity:n},o)=>t("stop",{offset:e,stopColor:"#7C3BFF",stopOpacity:n},o))})})]},c)}),l]})},Wp=g.div`
1028
+ `,tg=[{opacity:"0.1"},{offset:"0.31",opacity:"0.11"},{offset:"0.45",opacity:"0.14"},{offset:"0.56",opacity:"0.19"},{offset:"0.65",opacity:"0.26"},{offset:"0.73",opacity:"0.35"},{offset:"0.8",opacity:"0.46"},{offset:"0.86",opacity:"0.6"},{offset:"0.92",opacity:"0.76"},{offset:"0.98",opacity:"0.93"},{offset:"1"}],og=[{width:1440,height:900,pathOpacity:.1,path:"M719.992 1169.99C322.351 1169.99 0 847.64 0 450C0 52.3591 322.351 -269.992 719.992 -269.992C1117.63 -269.992 1439.98 52.3591 1439.98 450C1439.98 847.64 1117.63 1169.99 719.992 1169.99Z",gradientTransform:"translate(814.309 444.011) rotate(180) scale(718.904)",stops:[{opacity:"0.1"},{offset:"0.41",opacity:"0.11"},{offset:"0.56",opacity:"0.13"},{offset:"0.67",opacity:"0.18"},{offset:"0.75",opacity:"0.25"},{offset:"0.83",opacity:"0.33"},{offset:"0.89",opacity:"0.44"},{offset:"0.95",opacity:"0.56"},{offset:"1",opacity:"0.7"}]},{width:1343,height:900,pathOpacity:.3,path:"M671.344 1121.34C300.571 1121.34 0 820.773 0 450C0 79.2264 300.571 -221.345 671.344 -221.345C1042.12 -221.345 1342.69 79.2264 1342.69 450C1342.69 820.773 1042.12 1121.34 671.344 1121.34Z",gradientTransform:"translate(644.026 441.551) rotate(180) scale(581.31)",stops:tg},{width:1163,height:900,pathOpacity:.5,path:"M581.31 1031.31C260.261 1031.31 0 771.048 0 449.999C0 128.951 260.261 -131.311 581.31 -131.311C902.358 -131.311 1162.62 128.951 1162.62 449.999C1162.62 771.048 902.358 1031.31 581.31 1031.31Z",gradientTransform:"translate(644.026 441.551) rotate(180) scale(581.31)",stops:tg},{width:798,height:798,pathOpacity:.7,path:"M398.581 797.162C178.451 797.162 0 618.711 0 398.581C0 178.451 178.451 0 398.581 0C618.711 0 797.162 178.451 797.162 398.581C797.162 618.711 618.711 797.162 398.581 797.162Z",gradientTransform:"translate(445.003 392.441) rotate(180) scale(398.23)",stops:tg}],ng=({paddingXAxis:o="0px",paddingYAxis:n="0px",children:l})=>{const[r,c]=s(window.innerWidth),d=a(()=>r/og[0].width,[r]);return i(()=>{const e=()=>c(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e(Qm,{$paddingXAxis:o,$paddingYAxis:n,children:[og.map(({width:o,height:n,pathOpacity:i,path:a,gradientTransform:l,stops:r},s)=>{const c=`purple-ring-${s}`;return e(eg,{width:o*d,height:"100%",viewBox:`0 0 ${o} ${n}`,fill:"none",children:[t("path",{opacity:i,d:a,fill:`url(#${c})`}),t("defs",{children:t("radialGradient",{id:c,cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:l,children:r.map(({offset:e,opacity:o},n)=>t("stop",{offset:e,stopColor:"#7C3BFF",stopOpacity:o},n))})})]},c)}),l]})},ig=f.div`
615
1029
  display: flex;
616
1030
  flex-direction: column;
617
1031
  align-items: center;
@@ -622,7 +1036,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
622
1036
  width: 50vw;
623
1037
  border-radius: 16px;
624
1038
  background: ${({theme:e})=>e.v2.colors.silver[900]};
625
- `,Kp=g.div`
1039
+ `,ag=f.div`
626
1040
  display: flex;
627
1041
  flex-direction: column;
628
1042
  align-items: center;
@@ -632,15 +1046,15 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
632
1046
  & * {
633
1047
  text-align: center;
634
1048
  }
635
- `,Yp=({onStart:n})=>t(le,{width:"75vw",isOpen:!0,hideOverlay:!0,disableAnimation:!0,children:t(pt,{$height:"100%",children:e(Wp,{children:[e(Kp,{children:[t(se,{size:de.L,weight:500,children:Je.GET_STARTED_WITH}),t(Dl,{size:260}),t(se,{size:de.S,weight:400,children:Je.GET_STARTED_DESCRIPTION})]}),t(pe,{"data-id":"onboarding-get-started",label:Rt.GET_STARTED,rightIcon:bi,size:he.L,onClick:n})]})})}),Jp=[{step:1,label:Je.INSTALLATION,forceDoneBadge:!0},{step:2,label:Je.SOURCES_SETUP},{step:3,label:Je.DESTINATIONS_SETUP},{step:4,label:Je.SUMMARY}],qp=g.div`
1049
+ `,lg=({onStart:o})=>t(re,{width:"75vw",isOpen:!0,hideOverlay:!0,disableAnimation:!0,children:t(mt,{$height:"100%",children:e(ig,{children:[e(ag,{children:[t(ce,{size:ue.L,weight:500,children:Ze.GET_STARTED_WITH}),t(Kl,{size:260}),t(ce,{size:ue.S,weight:400,children:Ze.GET_STARTED_DESCRIPTION})]}),t(he,{"data-id":"onboarding-get-started",label:Pt.GET_STARTED,rightIcon:Ta,size:me.L,onClick:o})]})})}),rg=[{step:1,label:Ze.INSTALLATION,forceDoneBadge:!0},{step:2,label:Ze.SOURCES_SETUP},{step:3,label:Ze.DESTINATIONS_SETUP},{step:4,label:Ze.SUMMARY}],sg=f.div`
636
1050
  display: flex;
637
1051
  flex-direction: column;
638
1052
  gap: 32px;
639
1053
  padding: 64px;
640
- `,Zp=({pagePaddingXAxis:n,pagePaddingYAxis:o,onDone:a})=>{const{setCurrentModal:i}=Zn(),{sourcesApi:l,destinationsApi:s}=gl(),[c,d]=r(1),[u,p]=r(!1),[h,m]=r(null),[g,f]=r(null),b=()=>d(e=>e+1),v=()=>d(e=>e-1);return e(jp,{paddingXAxis:n,paddingYAxis:o,children:[e(qp,{children:[t(Dl,{useInline:!0}),t(xa,{currentStep:c,data:Jp,gap:32})]}),t(Jl,{initialInputs:h,children:e(ql,{children:[1===c&&t(Yp,{onStart:b}),2===c&&t(Zs,{disableAnimation:!0,onBack:e=>{m(e),v()},onNext:e=>{m(e),b()}}),3===c&&t(Os,{disableAnimation:!0,onBack:e=>{f(e),v()},onNext:e=>{f(e),b()},initialInputs:g}),4===c&&t(Xp,{disableAnimation:!0,setStep:d,onSave:async()=>{if(!u){p(!0);try{const e=[];h&&e.push(l.persistV2(h)),g&&e.push(...g.map(e=>s.create(e.formData)));const t=await Promise.allSettled(e),n=[];for(const e of t)"rejected"===e.status?n.push(e.reason?.message||String(e.reason)):e.value&&"object"==typeof e.value&&"error"in e.value&&e.value.error&&n.push(e.value.error);if(n.length)return{error:n.join("\n")};i(_u),a()}catch(e){return p(!1),{error:e instanceof Error?e.message:String(e)}}}},sourcesPayload:h,destinationsPayload:g})]})})]})},Qp=e=>(e||[]).filter(e=>!!e.id).map(e=>String(e.id)),eh=e=>{let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)&&(t+=e.length)}),e.onlyErrors&&t++,t},th=g.div`
1054
+ `,cg=({pagePaddingXAxis:o,pagePaddingYAxis:n,onDone:i})=>{const{setCurrentModal:a}=nn(),{sourcesApi:l,destinationsApi:r}=Nl(),[c,d]=s(1),[u,p]=s(!1),[h,m]=s(null),[g,f]=s(null),b=()=>d(e=>e+1),v=()=>d(e=>e-1);return e(ng,{paddingXAxis:o,paddingYAxis:n,children:[e(sg,{children:[t(Kl,{useInline:!0}),t($i,{currentStep:c,data:rg,gap:32})]}),t(pr,{initialInputs:h,children:e(hr,{children:[1===c&&t(lg,{onStart:b}),2===c&&t(wc,{disableAnimation:!0,onBack:e=>{m(e),v()},onNext:e=>{m(e),b()}}),3===c&&t(tc,{disableAnimation:!0,onBack:e=>{f(e),v()},onNext:e=>{f(e),b()},initialInputs:g}),4===c&&t(Zm,{disableAnimation:!0,setStep:d,onSave:async()=>{if(!u){p(!0);try{const e=[];h&&e.push(l.persistV2(h)),g&&e.push(...g.map(e=>r.create(e.formData)));const t=await Promise.allSettled(e),o=[];for(const e of t)"rejected"===e.status?o.push(e.reason?.message||String(e.reason)):e.value&&"object"==typeof e.value&&"error"in e.value&&e.value.error&&o.push(e.value.error);if(o.length)return{error:o.join("\n")};a(Hh),i()}catch(e){return p(!1),{error:e instanceof Error?e.message:String(e)}}}},sourcesPayload:h,destinationsPayload:g})]})})]})},dg=e=>(e||[]).filter(e=>!!e.id).map(e=>String(e.id)),ug=e=>{let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)&&(t+=e.length)}),e.onlyErrors&&t++,t},pg=f.div`
641
1055
  position: relative;
642
1056
  display: inline-flex;
643
- `,nh=g.button`
1057
+ `,hg=f.button`
644
1058
  display: inline-flex;
645
1059
  align-items: center;
646
1060
  gap: 8px;
@@ -653,7 +1067,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
653
1067
  &:hover {
654
1068
  background-color: ${({theme:e})=>e.v2.colors.silver[700]};
655
1069
  }
656
- `,oh=g.div`
1070
+ `,mg=f.div`
657
1071
  position: absolute;
658
1072
  top: calc(100% + 8px);
659
1073
  right: 0;
@@ -666,25 +1080,25 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
666
1080
  border-radius: 12px;
667
1081
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
668
1082
  box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
669
- `,ah=g.div`
1083
+ `,gg=f.div`
670
1084
  display: flex;
671
1085
  flex-direction: column;
672
1086
  gap: 12px;
673
1087
  padding: 16px;
674
1088
  max-height: 60vh;
675
1089
  overflow-y: auto;
676
- `,ih=g.div`
1090
+ `,fg=f.div`
677
1091
  display: flex;
678
1092
  align-items: center;
679
1093
  gap: 8px;
680
1094
  padding: 12px 16px;
681
1095
  border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
682
- `,lh=g.div`
1096
+ `,bg=f.div`
683
1097
  display: flex;
684
1098
  align-items: center;
685
1099
  gap: 8px;
686
1100
  margin-left: auto;
687
- `,rh=()=>{const n=f(),{sourcesApi:l,namespacesApi:s}=gl(),c=l.useSources().items,d=s.useNamespaces().items,{selectedStreamName:u}=qe(),{getItemSS:p,setItemSS:h,removeItemSS:m}=Ea(),{namespaces:g,kinds:b,monitors:v,languages:y,onlyErrors:C,podsAgentInjectionStatus:S,setAll:w,clearAll:x,getEmptyState:k}=ka(),T=a(()=>Ta(c,u),[c,u]);o(()=>{const e=p($a.OVERVIEW_FILTERS,k());w(e)},[]);const[$,I]=r({namespaces:g,kinds:b,monitors:v,languages:y,onlyErrors:C,podsAgentInjectionStatus:S}),[E,A]=r(eh($)),[N,O]=r(!1);o(()=>{if(!N){const e={namespaces:g,kinds:b,monitors:v,languages:y,onlyErrors:C,podsAgentInjectionStatus:S};I(e),A(eh(e))}},[N,g,b,v,y,C,S]);const R=i(null);mn(R,()=>O(!1)),jn({key:"Escape",active:N},()=>O(!1));const D=a(()=>{const e=new Set,t=[];return d.forEach(({name:n})=>{e.has(n)||(e.add(n),t.push({id:n,label:n,withCheckbox:!0}))}),t},[d]),P=a(()=>{const e=new Set,t=[];return T.forEach(({id:n})=>{const{kind:o}=n;e.has(o)||(e.add(o),t.push({id:o,label:o,withCheckbox:!0}))}),t},[T]),F=a(()=>{const e=new Set,t=[];return T.forEach(({runtimeInfo:n})=>{n?.detectedLanguages?.forEach(n=>{e.has(n)||(e.add(n),t.push({id:n,label:We[n]||n,withCheckbox:!0}))})}),t.sort((e,t)=>e.id.localeCompare(t.id))},[T]),L=a(()=>Ia.map(({id:e,value:t})=>({id:e,label:t,withCheckbox:!0})),[]),_=a(()=>{const e=new Set,t=[];return T.forEach(({podsAgentInjectionStatus:n})=>{const{reasonEnum:o,message:a}=n||{};if(o){if(e.has(o))return;e.add(o),t.push({id:o,label:Bt(o)})}else if(a){if(e.has(a))return;e.add(a),t.push({id:a,label:a,withCheckbox:!0})}}),t},[T]),M=(e,t,n)=>{const o=t.filter(e=>n.includes(e.id));I(t=>{return{...t,[e]:(n=o,n.map(({id:e,label:t})=>({id:e,label:t})))};var n})},z=N?Ei:Ai,B=a(()=>Qp($.languages),[$.languages]);return e(th,{ref:R,children:[e(nh,{"data-id":"filters-trigger",$isOpen:N,type:"button",onClick:()=>O(e=>!e),children:[t(sl,{size:16,fill:n.v2.colors.white[500]}),t(se,{size:de.XS,weight:500,nowrap:!0,children:"Filters"}),E>0&&t(je,{label:E,status:Re.Unknown,textSize:de.XXXS}),t(z,{size:16,fill:n.v2.colors.silver[200]})]}),N&&e(oh,{children:[e(ah,{children:[t(mt,{label:"Namespace",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!D.length,options:D,values:Qp($.namespaces),setValues:e=>M("namespaces",D,e)}),t(mt,{label:"Kind",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!P.length,options:P,values:Qp($.kinds),setValues:e=>M("kinds",P,e)}),t(mt,{label:"Programming Language",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!F.length,options:F,values:B,setValues:e=>M("languages",F,e)}),t(mt,{label:"Monitors",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!L.length,options:L,values:Qp($.monitors),setValues:e=>M("monitors",L,e)}),t(mt,{label:"Agent Injection Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!_.length,options:_,values:Qp($.podsAgentInjectionStatus),setValues:e=>M("podsAgentInjectionStatus",_,e)}),t(oe,{label:"Show only sources with errors",size:kt.L,value:!!$.onlyErrors,onChange:e=>I(t=>({...t,onlyErrors:e}))})]}),e(ih,{children:[t(pe,{"data-id":"filters-reset",size:he.S,variant:me.Text,label:"Reset",onClick:()=>{m($a.OVERVIEW_FILTERS),x(),I(k()),A(0),O(!1)},textColor:n.v2.colors.red[500]}),e(lh,{children:[t(pe,{"data-id":"filters-cancel",size:he.S,variant:me.Secondary,label:"Cancel",onClick:()=>O(!1)}),t(pe,{"data-id":"filters-apply",size:he.S,variant:me.Primary,label:"Apply",onClick:()=>{h($a.OVERVIEW_FILTERS,$),w($),A(eh($)),O(!1)}})]})]})]})]})},sh=g.div`
1101
+ `,vg=()=>{const o=b(),{sourcesApi:n,namespacesApi:r}=Nl(),c=n.useSources().items,d=r.useNamespaces().items,{selectedStreamName:u}=Qe(),{getItemSS:p,setItemSS:h,removeItemSS:m}=Pi(),{namespaces:g,kinds:f,monitors:v,languages:y,onlyErrors:C,podsAgentInjectionStatus:S,setAll:x,clearAll:w,getEmptyState:T}=Ai(),k=a(()=>Ri(c,u),[c,u]);i(()=>{const e=p(Di.OVERVIEW_FILTERS,T());x(e)},[]);const[E,I]=s({namespaces:g,kinds:f,monitors:v,languages:y,onlyErrors:C,podsAgentInjectionStatus:S}),[O,N]=s(ug(E)),[$,A]=s(!1);i(()=>{if(!$){const e={namespaces:g,kinds:f,monitors:v,languages:y,onlyErrors:C,podsAgentInjectionStatus:S};I(e),N(ug(e))}},[$,g,f,v,y,C,S]);const R=l(null);yo(R,()=>A(!1)),qo({key:"Escape",active:$},()=>A(!1));const D=a(()=>{const e=new Set,t=[];return d.forEach(({name:o})=>{e.has(o)||(e.add(o),t.push({id:o,label:o,withCheckbox:!0}))}),t},[d]),_=a(()=>{const e=new Set,t=[];return k.forEach(({id:o})=>{const{kind:n}=o;e.has(n)||(e.add(n),t.push({id:n,label:n,withCheckbox:!0}))}),t},[k]),P=a(()=>{const e=new Set,t=[];return k.forEach(({runtimeInfo:o})=>{o?.detectedLanguages?.forEach(o=>{e.has(o)||(e.add(o),t.push({id:o,label:Ye[o]||o,withCheckbox:!0}))})}),t.sort((e,t)=>e.id.localeCompare(t.id))},[k]),L=a(()=>_i.map(({id:e,value:t})=>({id:e,label:t,withCheckbox:!0})),[]),F=a(()=>{const e=new Set,t=[];return k.forEach(({podsAgentInjectionStatus:o})=>{const{reasonEnum:n,message:i}=o||{};if(n){if(e.has(n))return;e.add(n),t.push({id:n,label:Gt(n)})}else if(i){if(e.has(i))return;e.add(i),t.push({id:i,label:i,withCheckbox:!0})}}),t},[k]),M=(e,t,o)=>{const n=t.filter(e=>o.includes(e.id));I(t=>{return{...t,[e]:(o=n,o.map(({id:e,label:t})=>({id:e,label:t})))};var o})},z=$?Pa:La,B=a(()=>dg(E.languages),[E.languages]);return e(pg,{ref:R,children:[e(hg,{"data-id":"filters-trigger",$isOpen:$,type:"button",onClick:()=>A(e=>!e),children:[t(Sl,{size:16,fill:o.v2.colors.white[500]}),t(ce,{size:ue.XS,weight:500,nowrap:!0,children:"Filters"}),O>0&&t(Ke,{label:O,status:Pe.Unknown,textSize:ue.XXXS}),t(z,{size:16,fill:o.v2.colors.silver[200]})]}),$&&e(mg,{children:[e(gg,{children:[t(ft,{label:"Namespace",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!D.length,options:D,values:dg(E.namespaces),setValues:e=>M("namespaces",D,e)}),t(ft,{label:"Kind",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!_.length,options:_,values:dg(E.kinds),setValues:e=>M("kinds",_,e)}),t(ft,{label:"Programming Language",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!P.length,options:P,values:B,setValues:e=>M("languages",P,e)}),t(ft,{label:"Monitors",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!L.length,options:L,values:dg(E.monitors),setValues:e=>M("monitors",L,e)}),t(ft,{label:"Agent Injection Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!F.length,options:F,values:dg(E.podsAgentInjectionStatus),setValues:e=>M("podsAgentInjectionStatus",F,e)}),t(ie,{label:"Show only sources with errors",size:Et.L,value:!!E.onlyErrors,onChange:e=>I(t=>({...t,onlyErrors:e}))})]}),e(fg,{children:[t(he,{"data-id":"filters-reset",size:me.S,variant:ge.Text,label:"Reset",onClick:()=>{m(Di.OVERVIEW_FILTERS),w(),I(T()),N(0),A(!1)},textColor:o.v2.colors.red[500]}),e(bg,{children:[t(he,{"data-id":"filters-cancel",size:me.S,variant:ge.Secondary,label:"Cancel",onClick:()=>A(!1)}),t(he,{"data-id":"filters-apply",size:me.S,variant:ge.Primary,label:"Apply",onClick:()=>{h(Di.OVERVIEW_FILTERS,E),x(E),N(ug(E)),A(!1)}})]})]})]})]})},yg=f.div`
688
1102
  position: relative;
689
1103
  display: flex;
690
1104
  align-items: center;
@@ -695,7 +1109,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
695
1109
  box-sizing: border-box;
696
1110
  border-radius: 16px 16px 0 0;
697
1111
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
698
- `,ch=g.div`
1112
+ `,Cg=f.div`
699
1113
  position: absolute;
700
1114
  bottom: 0;
701
1115
  left: 0;
@@ -704,7 +1118,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
704
1118
  background-color: ${({theme:e})=>e.v2.colors.purple[500]};
705
1119
  border-radius: 32px;
706
1120
  transition: width 0.3s;
707
- `,dh=({entityType:n,badge:o,badgeTooltip:a,isLoading:i,refetch:l,partiallySelected:r,allSelected:s,onSelectAll:c,progressPercent:d})=>{const{setCurrentModal:u}=Zn();return e(sh,{children:[e(ue,{$gap:8,style:{flex:1,minWidth:0},children:[c&&t(Q,{size:Aa.S,partiallyChecked:r,value:!!s,onChange:c}),t(se,{size:de.S,nowrap:!0,children:`${Bt(n)}s`}),t(je,{label:o,tooltip:a,status:Re.Unknown,textSize:de.XXXS})]}),e(ue,{children:[t(gt,{"data-id":`add-${n}`,icon:fi,onClick:()=>u(n)}),t(gt,{"data-id":`refresh-${n}`,icon:zi,onClick:l,disabled:i})]}),"number"==typeof d&&t(ch,{$percent:d})]})},uh=g(q)`
1121
+ `,Sg=({entityType:o,badge:n,badgeTooltip:i,isLoading:a,refetch:l,partiallySelected:r,allSelected:s,onSelectAll:c,progressPercent:d})=>{const{setCurrentModal:u}=nn();return e(yg,{children:[e(pe,{$gap:8,style:{flex:1,minWidth:0},children:[c&&t(ee,{size:Li.S,partiallyChecked:r,value:!!s,onChange:c}),t(ce,{size:ue.S,nowrap:!0,children:`${Gt(o)}s`}),t(Ke,{label:n,tooltip:i,status:Pe.Unknown,textSize:ue.XXXS})]}),e(pe,{children:[t(bt,{"data-id":`add-${o}`,icon:wa,onClick:()=>u(o)}),t(bt,{"data-id":`refresh-${o}`,icon:Ka,onClick:l,disabled:a})]}),"number"==typeof d&&t(Cg,{$percent:d})]})},xg=f(Z)`
708
1122
  align-items: center !important;
709
1123
  justify-content: center !important;
710
1124
  align-self: stretch;
@@ -719,7 +1133,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
719
1133
  &:hover {
720
1134
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
721
1135
  }
722
- `,ph=({entityType:n,description:o})=>{const{setCurrentModal:a}=Zn();return e(uh,{onClick:()=>a(n),children:[e(ue,{$gap:4,children:[t(fi,{size:16}),t(se,{size:de.S,children:`Add ${Bt(n)}`})]}),t(se,{size:de.XXS,align:"center",children:o})]})},hh=g.div`
1136
+ `,wg=({entityType:o,description:n})=>{const{setCurrentModal:i}=nn();return e(xg,{onClick:()=>i(o),children:[e(pe,{$gap:4,children:[t(wa,{size:16}),t(ce,{size:ue.S,children:`Add ${Gt(o)}`})]}),t(ce,{size:ue.XXS,align:"center",children:n})]})},Tg=f.div`
723
1137
  display: flex;
724
1138
  align-items: center;
725
1139
  gap: 12px;
@@ -734,10 +1148,10 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
734
1148
  &:hover {
735
1149
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
736
1150
  }
737
- `,mh=g(ue)`
1151
+ `,kg=f(pe)`
738
1152
  flex: 1;
739
1153
  min-width: 0;
740
- `,gh=({entityId:n,entityType:o,title:i,status:l,faded:r,tooltip:s,throughput:c,icon:d,icons:u,iconSrc:p,isActive:h,raw:m})=>{const g=f(),b=o===wt.Source,v="boolean"==typeof h,y=r||v&&!h,{setDrawerType:C,setDrawerEntityId:S}=an(),{selectedSources:w,setSelectedSources:x}=Na(),k=m,T=b?k.id.namespace:"",$=a(()=>{if(!b)return-1;const e=w[T];return e?.length?e.findIndex(e=>e.id.name===k.id.name&&e.id.kind===k.id.kind):-1},[b,w,T,k.id]),I=v&&!h?Oa(Re.Info,g):l?Oa(l,g):void 0,E=b&&"object"==typeof n?`${n.namespace}-${n.name}-${n.kind}`:n;return e(hh,{"data-id":E,$faded:y,onClick:()=>{C(o),S(n)},children:[b&&t(Q,{size:Aa.S,value:-1!==$,onChange:()=>{const e={...w};e[T]||(e[T]=[]),-1===$?e[T].push(k):e[T].splice($,1),x(e)}}),t(cn,{icons:u,icon:d,iconSrc:p}),e(mh,{$gap:4,children:[t(Ee,{size:de.XS,nowrap:!0,children:i}),t(ue,{$gap:6,$justifyContent:"flex-end",style:{marginLeft:"auto",flexShrink:0},children:c&&t(ze,{text:s||"Heads up! The data-flow metrics you see are calculated over 10-second intervals.",children:t(je,{label:c,status:l&&[Re.Error,Re.Warning].includes(l)?l:Re.Unknown,leftIcon:I,textSize:de.XXXS})})})]})]})};function fh(e){return Object.values(e.conditions??{}).filter(Boolean).some(({status:e})=>e===Re.Loading)?e:{...e,workloadOdigosHealthStatus:{status:Kt.Pending,name:"WorkloadOdigosHealthStatus",reasonEnum:"Pending",message:""}}}function bh(e){const t=Object.values(e.conditions??{}).filter(Boolean),n=t.filter(({status:e})=>e!==Re.Loading);return n?.length===t?.length?e:{...e,conditions:n?.length?n.reduce((e,t)=>(e[t.name]=t,e),{}):{}}}const vh=g.div`
1154
+ `,Eg=({entityId:o,entityType:n,title:i,status:l,faded:r,tooltip:s,throughput:c,icon:d,icons:u,iconSrc:p,isActive:h,raw:m})=>{const g=b(),f=n===Tt.Source,v="boolean"==typeof h,y=r||v&&!h,{setDrawerType:C,setDrawerEntityId:S}=uo(),{selectedSources:x,setSelectedSources:w}=Fi(),T=m,k=f?T.id.namespace:"",E=a(()=>{if(!f)return-1;const e=x[k];return e?.length?e.findIndex(e=>e.id.name===T.id.name&&e.id.kind===T.id.kind):-1},[f,x,k,T.id]),I=v&&!h?Mi(Pe.Info,g):l?Mi(l,g):void 0,O=f&&"object"==typeof o?`${o.namespace}-${o.name}-${o.kind}`:o;return e(Tg,{"data-id":O,$faded:y,onClick:()=>{C(n),S(o)},children:[f&&t(ee,{size:Li.S,value:-1!==E,onChange:()=>{const e={...x};e[k]||(e[k]=[]),-1===E?e[k].push(T):e[k].splice(E,1),w(e)}}),t(go,{icons:u,icon:d,iconSrc:p}),e(kg,{$gap:4,children:[t(Ae,{size:ue.XS,nowrap:!0,children:i}),t(pe,{$gap:6,$justifyContent:"flex-end",style:{marginLeft:"auto",flexShrink:0},children:c&&t(Ie,{text:s||"Heads up! The data-flow metrics you see are calculated over 10-second intervals.",children:t(Ke,{label:c,status:l&&[Pe.Error,Pe.Warning].includes(l)?l:Pe.Unknown,leftIcon:I,textSize:ue.XXXS})})})]})]})};function Ig(e){return Object.values(e.conditions??{}).filter(Boolean).some(({status:e})=>e===Pe.Loading)?e:{...e,workloadOdigosHealthStatus:{status:eo.Pending,name:"WorkloadOdigosHealthStatus",reasonEnum:"Pending",message:""}}}function Og(e){const t=Object.values(e.conditions??{}).filter(Boolean),o=t.filter(({status:e})=>e!==Pe.Loading);return o?.length===t?.length?e:{...e,conditions:o?.length?o.reduce((e,t)=>(e[t.name]=t,e),{}):{}}}const Ng=f.div`
741
1155
  position: absolute;
742
1156
  top: 0;
743
1157
  left: 0;
@@ -748,21 +1162,21 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
748
1162
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
749
1163
  border-bottom: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
750
1164
  pointer-events: none;
751
- `,yh=g.div`
1165
+ `,$g=f.div`
752
1166
  display: flex;
753
1167
  align-items: center;
754
1168
  gap: 8px;
755
1169
  padding: 4px 8px 0;
756
- `,Ch=g.div`
1170
+ `,Ag=f.div`
757
1171
  flex: 1;
758
1172
  height: 1px;
759
1173
  background: ${({theme:e})=>e.v2.colors.silver[700]};
760
- `,Sh=({namespace:e})=>{const n=f();return t(vh,{children:t(se,{size:de.XXS,nowrap:!0,color:n.v2.colors.grey[300],children:e})})},wh=({namespace:n})=>{const o=f();return e(yh,{children:[t(Ch,{}),t(se,{size:de.XXS,nowrap:!0,color:o.v2.colors.grey[300],children:n}),t(Ch,{})]})},xh={[wt.InstrumentationRule]:Je.NO_DATA_INSTRUMENTATION_RULES,[wt.Source]:Je.NO_DATA_SOURCES,[wt.Action]:Je.NO_DATA_ACTIONS,[wt.Destination]:Je.NO_DATA_DESTINATIONS},kh=g.div`
1174
+ `,Rg=({namespace:e})=>{const o=b();return t(Ng,{children:t(ce,{size:ue.XXS,nowrap:!0,color:o.v2.colors.grey[300],children:e})})},Dg=({namespace:o})=>{const n=b();return e($g,{children:[t(Ag,{}),t(ce,{size:ue.XXS,nowrap:!0,color:n.v2.colors.grey[300],children:o}),t(Ag,{})]})},_g={[Tt.InstrumentationRule]:Ze.NO_DATA_INSTRUMENTATION_RULES,[Tt.Source]:Ze.NO_DATA_SOURCES,[Tt.Action]:Ze.NO_DATA_ACTIONS,[Tt.Destination]:Ze.NO_DATA_DESTINATIONS},Pg=f.div`
761
1175
  display: flex;
762
1176
  flex-direction: column;
763
1177
  flex: 1 0 0;
764
1178
  min-width: 0;
765
- `,Th=g.div`
1179
+ `,Lg=f.div`
766
1180
  display: flex;
767
1181
  flex-direction: column;
768
1182
  align-items: stretch;
@@ -772,7 +1186,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
772
1186
  border-radius: 0 0 16px 16px;
773
1187
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
774
1188
  overflow: hidden;
775
- `,$h=g.div`
1189
+ `,Fg=f.div`
776
1190
  position: relative;
777
1191
  display: flex;
778
1192
  flex-direction: column;
@@ -784,7 +1198,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
784
1198
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
785
1199
  height: ${({$height:e})=>e}px;
786
1200
  overflow: hidden;
787
- `,Ih=(e,t,n)=>{const o=Nt(e);if(!o)return null;const a=t===wt.Source;let i,l,r=!1,s=e;if(a){const t=function(e){const t=e.workloadOdigosHealthStatus?.status;switch(t){case Kt.Failure:return{status:Re.Error,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case Kt.Notice:return{status:Re.Warning,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case Kt.Pending:case Kt.Waiting:return{status:void 0,faded:!1,displaySource:fh(e)};case Kt.Unsupported:case Kt.Disabled:return{status:void 0,faded:!0,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};default:return{status:void 0,faded:!1,displaySource:bh(e)}}}(e);i=t.status,r=t.faded,l=t.tooltip,s=t.displaySource}else{const{priorotizedStatus:t,hasDisableds:n}=Da(e.conditions);i=t,r=n}const c=Pa(e,t,{extended:a,prioritizeDisplayName:!a});let d,u,p,h,m;switch(t){case wt.Source:{d=sn(e),u=La(wt.Source);const t=n?.get(Fa(o));h=un(t);break}case wt.Destination:{const t=yt(e.destinationType.type);u=t.icon,p=t.iconSrc;const a=n?.get(Fa(o));h=un(a),m=!e.disabled;break}case wt.Action:u=Ft(e.type),m=!e.disabled;break;case wt.InstrumentationRule:u=Gt(e.type),m=!e.disabled}return{key:Fa(o),entityId:o,namespace:a?e.id.namespace:void 0,raw:s,itemProps:{entityId:o,entityType:t,title:c,status:i,faded:r,tooltip:l,throughput:h,icon:u,icons:d,iconSrc:p,isActive:m,raw:s}}},Eh=({entityType:n,entities:i,unfilteredCount:s,metrics:c,loading:d,maxHeight:u,refetch:p})=>{const h=n===wt.Source,m=i.length!==s,g=$t(e=>h?e.progress[At.Instrumenting]?.percentage:void 0),f=$t(e=>h?e.progress[At.Uninstrumenting]?.percentage:void 0),b=!h||void 0===g&&void 0===f?void 0:g||f||0,{selectedSources:v,setSelectedSources:y}=Na(),C=a(()=>h?Object.values(v).reduce((e,t)=>e+t.length,0):0,[h,v]),S=a(()=>{if(!c)return;const e=new Map,t=n===wt.Source?c.sources:n===wt.Destination?c.destinations:void 0;if(t)for(const n of t)e.set(Ra(n),n.throughput);return e},[c,n]),w=a(()=>i.map(e=>Ih(e,n,S)).filter(Boolean),[i,n,S]),[x,k]=r(""),{elements:T,indexToNamespace:$,multipleNs:I,dividerCount:E}=a(()=>{const e=[],n=[],o=new Set(w.map(e=>e.namespace).filter(Boolean)).size>1;o&&(n.push(""),e.push(t("div",{style:{height:24}},"ns-spacer")));let a=0,i="";for(const o of w)h&&o.namespace&&o.namespace!==i&&(""!==i&&(n.push(o.namespace),e.push(t(wh,{namespace:o.namespace},`ns-divider-${o.namespace}`)),a+=1),i=o.namespace),n.push(o.namespace||""),e.push(t(gh,{...o.itemProps},o.key));return{elements:e,indexToNamespace:n,multipleNs:o,dividerCount:a}},[w,h]);o(()=>{if(h&&$.length&&!x){const e=$.find(Boolean);e&&k(e)}},[h,$]);const A=l(e=>{if(!$.length)return;const t=$[Math.min(e,$.length-1)];t&&t!==x&&k(t)},[$,x]),N=58*w.length+(I?28:0)+32*E,O=Math.max(0,u-52-16),R=Math.min(O,N)+8,D="number"==typeof b?`${b}%`:m?`${i.length}/${s}`:s;return e(kh,{children:[t(dh,{entityType:n,badge:D,badgeTooltip:m?Je.FILTERED_COUNT_TOOLTIP:void 0,isLoading:d,refetch:p,partiallySelected:C>0&&i?.length!==C,allSelected:C>0&&i?.length===C,onSelectAll:h?e=>{if(h)if(e){const e={};i?.forEach(t=>{const{namespace:n}=t.id;e[n]?e[n].push(t):e[n]=[t]}),y(e)}else y({})}:void 0,progressPercent:b}),t(Th,{children:i.length?e($h,{$height:R,children:[I&&x&&t(Sh,{namespace:x}),t(on,{gap:4,elements:T,onTopIndexChange:I?A:void 0})]}):d?t(ut,{size:3}):t(ph,{entityType:n,description:xh[n]??Je.TO_COLLECT_OTEL_DATA})})]})},Ah=g.div`
1201
+ `,Mg=(e,t,o)=>{const n=Ft(e);if(!n)return null;const i=t===Tt.Source;let a,l,r=!1,s=e;if(i){const t=function(e){const t=e.workloadOdigosHealthStatus?.status;switch(t){case eo.Failure:return{status:Pe.Error,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case eo.Notice:return{status:Pe.Warning,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case eo.Pending:case eo.Waiting:return{status:void 0,faded:!1,displaySource:Ig(e)};case eo.Unsupported:case eo.Disabled:return{status:void 0,faded:!0,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};default:return{status:void 0,faded:!1,displaySource:Og(e)}}}(e);a=t.status,r=t.faded,l=t.tooltip,s=t.displaySource}else{const{priorotizedStatus:t,hasDisableds:o}=Bi(e.conditions);a=t,r=o}const c=Xi(e,t,{extended:i,prioritizeDisplayName:!i});let d,u,p,h,m;switch(t){case Tt.Source:{d=mo(e),u=Vi(Tt.Source);const t=o?.get(Ui(n));h=bo(t);break}case Tt.Destination:{const t=St(e.destinationType.type);u=t.icon,p=t.iconSrc;const i=o?.get(Ui(n));h=bo(i),m=!e.disabled;break}case Tt.Action:u=Xt(e.type),m=!e.disabled;break;case Tt.InstrumentationRule:u=Jt(e.type),m=!e.disabled}return{key:Ui(n),entityId:n,namespace:i?e.id.namespace:void 0,raw:s,itemProps:{entityId:n,entityType:t,title:c,status:a,faded:r,tooltip:l,throughput:h,icon:u,icons:d,iconSrc:p,isActive:m,raw:s}}},zg=({entityType:o,entities:n,unfilteredCount:l,metrics:c,loading:d,maxHeight:u,refetch:p})=>{const h=o===Tt.Source,m=n.length!==l,g=Ot(e=>h?e.progress[At.Instrumenting]?.percentage:void 0),f=Ot(e=>h?e.progress[At.Uninstrumenting]?.percentage:void 0),b=!h||void 0===g&&void 0===f?void 0:g||f||0,{selectedSources:v,setSelectedSources:y}=Fi(),C=a(()=>h?Object.values(v).reduce((e,t)=>e+t.length,0):0,[h,v]),S=a(()=>{if(!c)return;const e=new Map,t=o===Tt.Source?c.sources:o===Tt.Destination?c.destinations:void 0;if(t)for(const o of t)e.set(zi(o),o.throughput);return e},[c,o]),x=a(()=>n.map(e=>Mg(e,o,S)).filter(Boolean),[n,o,S]),[w,T]=s(""),{elements:k,indexToNamespace:E,multipleNs:I,dividerCount:O}=a(()=>{const e=[],o=[],n=new Set(x.map(e=>e.namespace).filter(Boolean)).size>1;n&&(o.push(""),e.push(t("div",{style:{height:24}},"ns-spacer")));let i=0,a="";for(const n of x)h&&n.namespace&&n.namespace!==a&&(""!==a&&(o.push(n.namespace),e.push(t(Dg,{namespace:n.namespace},`ns-divider-${n.namespace}`)),i+=1),a=n.namespace),o.push(n.namespace||""),e.push(t(Eg,{...n.itemProps},n.key));return{elements:e,indexToNamespace:o,multipleNs:n,dividerCount:i}},[x,h]);i(()=>{if(h&&E.length&&!w){const e=E.find(Boolean);e&&T(e)}},[h,E]);const N=r(e=>{if(!E.length)return;const t=E[Math.min(e,E.length-1)];t&&t!==w&&T(t)},[E,w]),$=58*x.length+(I?28:0)+32*O,A=Math.max(0,u-52-16),R=Math.min(A,$)+8,D="number"==typeof b?`${b}%`:m?`${n.length}/${l}`:l;return e(Pg,{children:[t(Sg,{entityType:o,badge:D,badgeTooltip:m?Ze.FILTERED_COUNT_TOOLTIP:void 0,isLoading:d,refetch:p,partiallySelected:C>0&&n?.length!==C,allSelected:C>0&&n?.length===C,onSelectAll:h?e=>{if(h)if(e){const e={};n?.forEach(t=>{const{namespace:o}=t.id;e[o]?e[o].push(t):e[o]=[t]}),y(e)}else y({})}:void 0,progressPercent:b}),t(Lg,{children:n.length?e(Fg,{$height:R,children:[I&&w&&t(Rg,{namespace:w}),t(co,{gap:4,elements:k,onTopIndexChange:I?N:void 0})]}):d?t(ht,{size:3}):t(wg,{entityType:o,description:_g[o]??Ze.TO_COLLECT_OTEL_DATA})})]})},Bg=f.div`
788
1202
  width: 100%;
789
1203
  flex: 1;
790
1204
  min-height: 0;
@@ -792,10 +1206,10 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
792
1206
  display: flex;
793
1207
  align-items: stretch;
794
1208
  gap: 16px;
795
- `,Nh={sources:[],destinations:[]},Oh=()=>{const n=ka(),{selectedStreamName:o}=qe(),{containerRef:i,containerHeight:l}=_a(),{sourcesApi:r,destinationsApi:s,actionsApi:c,instrumentationRulesApi:d,metricsApi:u}=gl(),{items:p,loading:h}=r.useSources(),{items:m,loading:g}=s.useDestinations(),{items:f,loading:b}=c.useActions(),{items:v,loading:y}=d.useRules(),C=an(e=>e.drawerType),S=Zn(e=>e.currentModal),{data:w}=u.useMetrics({skip:!(p.length&&m.length&&!C&&!S),pollInterval:1e4,fetchPolicy:"network-only"}),x=w?.getOverviewMetrics??Nh,k=a(()=>Ta(p,o),[p,o]),T=a(()=>Mt(m,o),[m,o]),$=a(()=>Ma(k,n),[k,n]),I=a(()=>za(T,n),[T,n]),E=a(()=>Ba(f,n),[f,n]);return e(Ah,{ref:i,children:[t(Eh,{entityType:wt.InstrumentationRule,entities:v,unfilteredCount:v.length,loading:y,maxHeight:l,refetch:d.fetchAll}),t(Eh,{entityType:wt.Source,entities:$,unfilteredCount:k.length,metrics:x,loading:h,maxHeight:l,refetch:r.fetchAll}),t(Eh,{entityType:wt.Action,entities:E,unfilteredCount:f.length,loading:b,maxHeight:l,refetch:c.fetchAll}),t(Eh,{entityType:wt.Destination,entities:I,unfilteredCount:T.length,metrics:x,loading:g,maxHeight:l,refetch:s.fetchAll})]})},Rh="40vw",Dh=g.div`
1209
+ `,Xg={sources:[],destinations:[]},Ug=()=>{const o=Ai(),{selectedStreamName:n}=Qe(),{containerRef:i,containerHeight:l}=Hi(),{sourcesApi:r,destinationsApi:s,actionsApi:c,instrumentationRulesApi:d,metricsApi:u}=Nl(),{items:p,loading:h}=r.useSources(),{items:m,loading:g}=s.useDestinations(),{items:f,loading:b}=c.useActions(),{items:v,loading:y}=d.useRules(),C=uo(e=>e.drawerType),S=nn(e=>e.currentModal),{data:x}=u.useMetrics({skip:!(p.length&&m.length&&!C&&!S),pollInterval:1e4,fetchPolicy:"network-only"}),w=x?.getOverviewMetrics??Xg,T=a(()=>Ri(p,n),[p,n]),k=a(()=>Ht(m,n),[m,n]),E=a(()=>ji(T,o),[T,o]),I=a(()=>Gi(k,o),[k,o]),O=a(()=>Wi(f,o),[f,o]);return e(Bg,{ref:i,children:[t(zg,{entityType:Tt.InstrumentationRule,entities:v,unfilteredCount:v.length,loading:y,maxHeight:l,refetch:d.fetchAll}),t(zg,{entityType:Tt.Source,entities:E,unfilteredCount:T.length,metrics:w,loading:h,maxHeight:l,refetch:r.fetchAll}),t(zg,{entityType:Tt.Action,entities:O,unfilteredCount:f.length,loading:b,maxHeight:l,refetch:c.fetchAll}),t(zg,{entityType:Tt.Destination,entities:I,unfilteredCount:k.length,metrics:w,loading:g,maxHeight:l,refetch:s.fetchAll})]})},Vg="40vw",Hg=f.div`
796
1210
  position: relative;
797
- width: ${Rh};
798
- `,Ph=g.div`
1211
+ width: ${Vg};
1212
+ `,jg=f.div`
799
1213
  position: absolute;
800
1214
  top: calc(100% + 8px);
801
1215
  left: 0;
@@ -804,23 +1218,23 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
804
1218
  flex-direction: column;
805
1219
  gap: 8px;
806
1220
  padding: 8px;
807
- width: calc(${Rh} - 16px);
1221
+ width: calc(${Vg} - 16px);
808
1222
  border-radius: 12px;
809
1223
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
810
1224
  box-shadow: 0 12px 24px 24px rgba(0, 0, 0, 0.5);
811
- `,Fh=g.div`
1225
+ `,Gg=f.div`
812
1226
  display: flex;
813
1227
  align-items: center;
814
1228
  overflow-x: auto;
815
- `,Lh=g.div`
1229
+ `,Wg=f.div`
816
1230
  display: flex;
817
1231
  flex-direction: column;
818
1232
  gap: 0;
819
1233
  max-height: 60vh;
820
1234
  overflow-y: auto;
821
- `,_h=g.div`
1235
+ `,Kg=f.div`
822
1236
  padding: 8px 12px 4px 12px;
823
- `,Mh=g.div`
1237
+ `,Yg=f.div`
824
1238
  display: flex;
825
1239
  align-items: center;
826
1240
  gap: 8px;
@@ -830,12 +1244,12 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
830
1244
  &:hover {
831
1245
  background-color: ${({theme:e})=>e.v2.colors.silver[700]};
832
1246
  }
833
- `,zh=g.div`
1247
+ `,Jg=f.div`
834
1248
  padding: 16px 8px;
835
- `,Bh=({preventPopup:n=!1})=>{const o=f(),{onClickNode:l}=Xa(),{searchText:c,setSearchText:d}=ka(),{selectedStreamName:u}=qe(),{sourcesApi:p,destinationsApi:h,actionsApi:m,instrumentationRulesApi:g}=gl(),b=p.useSources().items,v=h.useDestinations().items,y=m.useActions().items,C=g.useRules().items,S=i(null),[w,x]=r(!1),[k,T]=r("all"),$=!n&&(!!c||w),I=()=>{d(""),x(!1),T("all")};mn(S,()=>I()),jn({key:"Escape",active:$},I);const{categories:E,searchResults:A}=a(()=>(({instrumentationRules:e,sources:t,actions:n,destinations:o,searchText:a,selectedCategory:i})=>{const l=a?e.filter(e=>e.type?.toLowerCase().includes(a)||e.ruleName?.toLowerCase().includes(a)):e,r=a?t.filter(e=>e.id.name?.toLowerCase().includes(a)||e.serviceName?.toLowerCase().includes(a)||e.id.namespace?.toLowerCase().includes(a)):t,s=a?n.filter(e=>e.type?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):n,c=a?o.filter(e=>e.destinationType.displayName?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):o,d=[{category:wt.Source,label:"Sources",count:r.length,entities:[]},{category:wt.Action,label:"Actions",count:s.length,entities:[]},{category:wt.Destination,label:"Destinations",count:c.length,entities:[]},{category:wt.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(i)).map(e=>({...e,entities:e.category===wt.InstrumentationRule?l:e.category===wt.Source?r:e.category===wt.Action?s:e.category===wt.Destination?c:[]}));return{categories:d,searchResults:u}})({instrumentationRules:C,sources:Ta(b,u),actions:y,destinations:Mt(v,u),searchText:c,selectedCategory:k}),[C,b,y,v,u,c,k]),N=a(()=>E.filter(({count:e,category:t})=>!!e||"all"===t).map(({category:e,label:t,count:n})=>({value:e,label:n?`${t} (${n})`:t})),[E]),O=A.some(({entities:e})=>e.length>0);return e(Dh,{ref:S,children:[t(nn,{value:c,onChange:e=>d(e.toLowerCase()),onFocus:()=>x(!0),width:Rh}),$&&e(Ph,{children:[N.length>1&&t(Fh,{children:t(ge,{options:N,selected:k,setSelected:T})}),O?t(Lh,{children:A.map(({category:n,label:a,entities:i},r)=>{if(!i.length)return null;const c=La(n);return e(s,{children:[t(_h,{children:t(se,{size:de.XXS,color:ce.Secondary,children:a})}),i.map((a,i)=>e(Mh,{onClick:()=>{const e=Nt(a);l(null,{data:{type:n,id:e}}),I()},children:[c&&t(c,{size:16,fill:o.v2.colors.white[500]}),t(se,{size:de.XS,nowrap:!0,children:Pa(a,n,{extended:!0})})]},`entity-${r}-${i}`))]},`category-list-${n}`)})}):t(zh,{children:t(Ie,{hideIcon:!0,title:"No results",subTitle:c?`No matches for "${c}"`:"Start typing to search"})})]})]})},Xh=({onRedirectToSampling:o})=>{const{sourcesApi:i}=gl(),{items:l}=i.useSources(),{currentModal:r,setCurrentModal:s}=Zn(),{drawerType:c,drawerEntityId:d,setDrawerType:u,setDrawerEntityId:p}=an(),h=()=>{s("")},m=()=>{u(null),p(null)},g=a(()=>l.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[l]),f=a(()=>Array.from(new Set(l.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[l]);return e(n,{children:[t(Mu,{}),r===wt.Source&&t(Jl,{children:t(Zs,{onClose:h,withOverlay:!0})}),r===wt.Destination&&t(ql,{children:t(Os,{onClose:h,withOverlay:!0})}),r===wt.InstrumentationRule&&t(Ql,{sourceOptions:g,namespaceOptions:f,children:t(Rs,{onClose:h,withOverlay:!0})}),r===wt.Action&&t(Zl,{children:t(Ss,{onClose:h,withOverlay:!0})}),c===wt.Source&&d&&t(er,{children:t(du,{onClose:m,sourceId:d,onRedirectToSampling:o})}),c===wt.Destination&&d&&t(ql,{children:t(oc,{onClose:m,destinationId:d})}),c===wt.InstrumentationRule&&d&&t(Ql,{sourceOptions:g,namespaceOptions:f,children:t(ic,{onClose:m,ruleId:d})}),c===wt.Action&&d&&t(Zl,{children:t(ec,{onClose:m,actionId:d})})]})},Vh=e=>`Data Stream: ${e}`,Uh="Search streams...",Gh="No streams match",Hh=g.div`
1249
+ `,qg=({preventPopup:o=!1})=>{const n=b(),{onClickNode:i}=Ki(),{searchText:r,setSearchText:d}=Ai(),{selectedStreamName:u}=Qe(),{sourcesApi:p,destinationsApi:h,actionsApi:m,instrumentationRulesApi:g}=Nl(),f=p.useSources().items,v=h.useDestinations().items,y=m.useActions().items,C=g.useRules().items,S=l(null),[x,w]=s(!1),[T,k]=s("all"),E=!o&&(!!r||x),I=()=>{d(""),w(!1),k("all")};yo(S,()=>I()),qo({key:"Escape",active:E},I);const{categories:O,searchResults:N}=a(()=>(({instrumentationRules:e,sources:t,actions:o,destinations:n,searchText:i,selectedCategory:a})=>{const l=i?e.filter(e=>e.type?.toLowerCase().includes(i)||e.ruleName?.toLowerCase().includes(i)):e,r=i?t.filter(e=>e.id.name?.toLowerCase().includes(i)||e.serviceName?.toLowerCase().includes(i)||e.id.namespace?.toLowerCase().includes(i)):t,s=i?o.filter(e=>e.type?.toLowerCase().includes(i)||e.name?.toLowerCase().includes(i)):o,c=i?n.filter(e=>e.destinationType.displayName?.toLowerCase().includes(i)||e.name?.toLowerCase().includes(i)):n,d=[{category:Tt.Source,label:"Sources",count:r.length,entities:[]},{category:Tt.Action,label:"Actions",count:s.length,entities:[]},{category:Tt.Destination,label:"Destinations",count:c.length,entities:[]},{category:Tt.InstrumentationRule,label:"Instrumentation Rules",count:l.length,entities:[]}];d.unshift({category:"all",label:"All",count:l.length+r.length+s.length+c.length,entities:[]});const u=d.filter(({count:e,category:t})=>!!e&&"all"!==t&&["all",t].includes(a)).map(e=>({...e,entities:e.category===Tt.InstrumentationRule?l:e.category===Tt.Source?r:e.category===Tt.Action?s:e.category===Tt.Destination?c:[]}));return{categories:d,searchResults:u}})({instrumentationRules:C,sources:Ri(f,u),actions:y,destinations:Ht(v,u),searchText:r,selectedCategory:T}),[C,f,y,v,u,r,T]),$=a(()=>O.filter(({count:e,category:t})=>!!e||"all"===t).map(({category:e,label:t,count:o})=>({value:e,label:o?`${t} (${o})`:t})),[O]),A=N.some(({entities:e})=>e.length>0);return e(Hg,{ref:S,children:[t(so,{value:r,onChange:e=>d(e.toLowerCase()),onFocus:()=>w(!0),width:Vg}),E&&e(jg,{children:[$.length>1&&t(Gg,{children:t(fe,{options:$,selected:T,setSelected:k})}),A?t(Wg,{children:N.map(({category:o,label:a,entities:l},r)=>{if(!l.length)return null;const s=Vi(o);return e(c,{children:[t(Kg,{children:t(ce,{size:ue.XXS,color:de.Secondary,children:a})}),l.map((a,l)=>e(Yg,{onClick:()=>{const e=Ft(a);i(null,{data:{type:o,id:e}}),I()},children:[s&&t(s,{size:16,fill:n.v2.colors.white[500]}),t(ce,{size:ue.XS,nowrap:!0,children:Xi(a,o,{extended:!0})})]},`entity-${r}-${l}`))]},`category-list-${o}`)})}):t(Jg,{children:t($e,{hideIcon:!0,title:"No results",subTitle:r?`No matches for "${r}"`:"Start typing to search"})})]})]})},Zg=({onRedirectToSampling:n})=>{const{sourcesApi:i}=Nl(),{items:l}=i.useSources(),{currentModal:r,setCurrentModal:s}=nn(),{drawerType:c,drawerEntityId:d,setDrawerType:u,setDrawerEntityId:p}=uo(),h=()=>{s("")},m=()=>{u(null),p(null)},g=a(()=>l.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[l]),f=a(()=>Array.from(new Set(l.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[l]);return e(o,{children:[t(jh,{}),r===Tt.Source&&t(pr,{children:t(wc,{onClose:h,withOverlay:!0})}),r===Tt.Destination&&t(hr,{children:t(tc,{onClose:h,withOverlay:!0})}),r===Tt.InstrumentationRule&&t(gr,{sourceOptions:g,namespaceOptions:f,children:t(oc,{onClose:h,withOverlay:!0})}),r===Tt.Action&&t(mr,{children:t(js,{onClose:h,withOverlay:!0})}),c===Tt.Source&&d&&t(br,{children:t(bh,{onClose:m,sourceId:d,onRedirectToSampling:n})}),c===Tt.Destination&&d&&t(hr,{children:t(du,{onClose:m,destinationId:d})}),c===Tt.InstrumentationRule&&d&&t(gr,{sourceOptions:g,namespaceOptions:f,children:t(pu,{onClose:m,ruleId:d})}),c===Tt.Action&&d&&t(mr,{children:t(ru,{onClose:m,actionId:d})})]})},Qg=e=>`Data Stream: ${e}`,ef="Search streams...",tf="No streams match",of=f.div`
836
1250
  position: relative;
837
1251
  display: inline-flex;
838
- `,jh=g.div`
1252
+ `,nf=f.div`
839
1253
  display: inline-flex;
840
1254
  align-items: center;
841
1255
  gap: 6px;
@@ -846,7 +1260,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
846
1260
  &:hover {
847
1261
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
848
1262
  }
849
- `,Wh=g.div`
1263
+ `,af=f.div`
850
1264
  position: absolute;
851
1265
  top: calc(100% + 8px);
852
1266
  left: 0;
@@ -860,18 +1274,18 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
860
1274
  border-radius: 12px;
861
1275
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
862
1276
  box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
863
- `,Kh=g.div`
1277
+ `,lf=f.div`
864
1278
  display: flex;
865
1279
  align-items: center;
866
1280
  gap: 8px;
867
1281
  width: 100%;
868
- `,Yh=g.div`
1282
+ `,rf=f.div`
869
1283
  display: flex;
870
1284
  flex-direction: column;
871
1285
  gap: 0;
872
1286
  max-height: 240px;
873
1287
  overflow-y: auto;
874
- `,Jh=g.div`
1288
+ `,sf=f.div`
875
1289
  display: flex;
876
1290
  align-items: center;
877
1291
  gap: 8px;
@@ -882,29 +1296,29 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
882
1296
  &:hover {
883
1297
  background-color: ${({$selected:e,theme:t})=>e?t.v2.colors.silver[600]:t.v2.colors.silver[700]};
884
1298
  }
885
- `,qh=g.div`
1299
+ `,cf=f.div`
886
1300
  flex: 1;
887
1301
  min-width: 0;
888
1302
  overflow: hidden;
889
1303
  text-overflow: ellipsis;
890
1304
  white-space: nowrap;
891
- `,Zh=g.div`
1305
+ `,df=f.div`
892
1306
  display: flex;
893
1307
  align-items: center;
894
1308
  gap: 2px;
895
1309
  flex-shrink: 0;
896
- `,Qh=g.div`
1310
+ `,uf=f.div`
897
1311
  display: flex;
898
1312
  padding-top: 4px;
899
1313
  border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
900
- `,em=()=>{const l=f(),{isVm:s}=y(),{clearStore:c}=Va(),{dataStreamsApi:d}=gl();d.useDataStreams();const{dataStreams:u,selectedStreamName:p,setSelectedStreamName:h}=qe(),m=i(null),[g,b]=r(!1),[v,C]=r(""),[S,w]=r(""),[x,k]=r(!1),[T,$]=r(!1),[I,E]=r(!1),[A,N]=r(""),[O,R]=r(!1);mn(m,()=>b(!1)),o(()=>{g||C("")},[g]);const D=a(()=>{if(!v)return u;const e=v.toLowerCase();return u.filter(({name:t})=>t.toLowerCase().includes(e))},[u,v]),P=g?Ei:Ai;return s?null:e(n,{children:[e(Hh,{ref:m,children:[e(jh,{"data-id":"data-stream-select",$isOpen:g,onClick:()=>b(e=>!e),children:[t(cl,{size:24}),t(se,{size:de.S,weight:500,nowrap:!0,children:Vh(p)}),t(je,{label:u.length,status:Re.Unknown,textSize:de.XXXS}),t(P,{size:20,fill:l.v2.colors.silver[200]})]}),g&&e(Wh,{children:[t(Kh,{children:t(nn,{value:v,onChange:C,placeholder:Uh,width:"100%"})}),t(Yh,{children:0===D.length?t(Jh,{children:t(se,{size:de.XS,color:ce.Secondary,children:Gh})}):D.map(({name:n})=>{const o=n===Ua;return e(Jh,{"data-id":`stream-row-${n}`,$selected:n===p,onClick:()=>(e=>{e!==p&&(c(),h(e)),b(!1)})(n),children:[t(qh,{children:t(se,{size:de.XS,nowrap:!0,children:n})}),e(Zh,{children:[t(gt,{"data-id":`stream-edit-${n}`,icon:wi,size:ft.XS,onClick:e=>{e.stopPropagation(),b(!1),w(n),k(!0)}}),!o&&t(gt,{"data-id":`stream-delete-${n}`,icon:gi,size:ft.XS,onClick:e=>{e.stopPropagation(),b(!1),N(n),R(!0)}})]})]},`stream-${n}`)})}),t(Qh,{children:t(pe,{"data-id":"add-stream-trigger",variant:me.Secondary,size:he.S,leftIcon:fi,label:`${Rt.NEW} ${Je.STREAM_NAME}`,fullWidth:!0,onClick:()=>{b(!1),c(),E(!0),$(!0)}})})]})]}),I&&t(tr,{defaultExcludeName:p,children:t(Du,{isOpen:T,onClose:()=>$(!1),onCloseEnd:()=>E(!1)})}),S&&t(tr,{children:t(Pu,{isOpen:x,dataStreamName:S,onClose:()=>k(!1),onCloseEnd:()=>w("")})}),t(Nl,{target:`${Je.STREAM_NAME.toLowerCase()} "${A}"`,isOpen:O,onClose:()=>R(!1),onApprove:async()=>{A&&await d.remove(A)}})]})},tm="multi-source-deselect",nm="multi-source-restart",om="multi-source-uninstrument",am="Selected sources",im="Deselect",lm="Restart",rm="Uninstrument",sm="Rollout Restart Workloads",cm="Are you sure you want to rollout restart these workloads?",dm="Go Back",um="Confirm",pm=()=>{const{selectedStreamName:i}=qe(),{selectedSources:s,setSelectedSources:c}=Na(),{sourcesApi:d}=gl(),[u,p]=r(!1),[h,m]=r(!1),g=a(()=>Object.values(s).reduce((e,t)=>e+t.length,0),[s]),f=l(()=>{c({})},[c]),b=l(()=>p(!1),[]),v=l(()=>m(!1),[]);o(()=>{f()},[i,f]);const y=l(()=>{d.restartWorkloads(Object.values(s).flat().filter(e=>e.id.kind!==dn.StaticPod).map(ln)),f()},[d,s,f]),C=l(()=>{d.persistV2(Object.fromEntries(Object.entries(s).map(([e,t])=>[e,t.map(({id:e})=>({namespace:e.namespace,name:e.name,kind:e.kind||void 0,selected:!1,currentStreamName:i}))]))),f()},[d,s,i,f]),S=a(()=>[{id:tm,type:tn.Button,buttonProps:{variant:me.Text,size:he.S,label:im,onClick:f}},{id:nm,type:tn.Button,buttonProps:{variant:me.Secondary,size:he.S,label:lm,leftIcon:Qi,onClick:()=>p(!0)}},{id:om,type:tn.Button,buttonProps:{variant:me.Primary,size:he.S,label:rm,leftIcon:gi,onClick:()=>m(!0)}}],[f]);return e(n,{children:[t(xn,{isOpen:g>0,richTitle:{icon:Di,title:am,badge:{label:g}},actions:S}),t(Ye,{isOpen:u,title:sm,description:cm,onClose:b,denyButton:{label:dm,variant:me.Secondary,onClick:b},approveButton:{label:um,variant:me.Primary,onClick:()=>{y(),b()}}}),t(Nl,{isOpen:h,action:"uninstrument",target:`${g} source${1===g?"":"s"}`,onClose:v,onDeny:v,onApprove:C})]})},hm=v`
1314
+ `,pf=()=>{const n=b(),{isVm:r}=C(),{clearStore:c}=Yi(),{dataStreamsApi:d}=Nl();d.useDataStreams();const{dataStreams:u,selectedStreamName:p,setSelectedStreamName:h}=Qe(),m=l(null),[g,f]=s(!1),[v,y]=s(""),[S,x]=s(""),[w,T]=s(!1),[k,E]=s(!1),[I,O]=s(!1),[N,$]=s(""),[A,R]=s(!1);yo(m,()=>f(!1)),i(()=>{g||y("")},[g]);const D=a(()=>{if(!v)return u;const e=v.toLowerCase();return u.filter(({name:t})=>t.toLowerCase().includes(e))},[u,v]),_=g?Pa:La;return r?null:e(o,{children:[e(of,{ref:m,children:[e(nf,{"data-id":"data-stream-select",$isOpen:g,onClick:()=>f(e=>!e),children:[t(xl,{size:24}),t(ce,{size:ue.S,weight:500,nowrap:!0,children:Qg(p)}),t(Ke,{label:u.length,status:Pe.Unknown,textSize:ue.XXXS}),t(_,{size:20,fill:n.v2.colors.silver[200]})]}),g&&e(af,{children:[t(lf,{children:t(so,{value:v,onChange:y,placeholder:ef,width:"100%"})}),t(rf,{children:0===D.length?t(sf,{children:t(ce,{size:ue.XS,color:de.Secondary,children:tf})}):D.map(({name:o})=>{const n=o===Ji;return e(sf,{"data-id":`stream-row-${o}`,$selected:o===p,onClick:()=>(e=>{e!==p&&(c(),h(e)),f(!1)})(o),children:[t(cf,{children:t(ce,{size:ue.XS,nowrap:!0,children:o})}),e(df,{children:[t(bt,{"data-id":`stream-edit-${o}`,icon:Na,size:vt.XS,onClick:e=>{e.stopPropagation(),f(!1),x(o),T(!0)}}),!n&&t(bt,{"data-id":`stream-delete-${o}`,icon:xa,size:vt.XS,onClick:e=>{e.stopPropagation(),f(!1),$(o),R(!0)}})]})]},`stream-${o}`)})}),t(uf,{children:t(he,{"data-id":"add-stream-trigger",variant:ge.Secondary,size:me.S,leftIcon:wa,label:`${Pt.NEW} ${Ze.STREAM_NAME}`,fullWidth:!0,onClick:()=>{f(!1),c(),O(!0),E(!0)}})})]})]}),I&&t(vr,{defaultExcludeName:p,children:t(Bh,{isOpen:k,onClose:()=>E(!1),onCloseEnd:()=>O(!1)})}),S&&t(vr,{children:t(Xh,{isOpen:w,dataStreamName:S,onClose:()=>T(!1),onCloseEnd:()=>x("")})}),t(Gl,{target:`${Ze.STREAM_NAME.toLowerCase()} "${N}"`,isOpen:A,onClose:()=>R(!1),onApprove:async()=>{N&&await d.remove(N)}})]})},hf="multi-source-deselect",mf="multi-source-restart",gf="multi-source-uninstrument",ff="Selected sources",bf="Deselect",vf="Restart",yf="Uninstrument",Cf="Rollout Restart Workloads",Sf="Are you sure you want to rollout restart these workloads?",xf="Go Back",wf="Confirm",Tf=()=>{const{selectedStreamName:n}=Qe(),{selectedSources:l,setSelectedSources:c}=Fi(),{sourcesApi:d}=Nl(),[u,p]=s(!1),[h,m]=s(!1),g=a(()=>Object.values(l).reduce((e,t)=>e+t.length,0),[l]),f=r(()=>{c({})},[c]),b=r(()=>p(!1),[]),v=r(()=>m(!1),[]);i(()=>{f()},[n,f]);const y=r(()=>{d.restartWorkloads(Object.values(l).flat().filter(e=>e.id.kind!==fo.StaticPod).map(po)),f()},[d,l,f]),C=r(()=>{d.persistV2(Object.fromEntries(Object.entries(l).map(([e,t])=>[e,t.map(({id:e})=>({namespace:e.namespace,name:e.name,kind:e.kind||void 0,...e.region?{region:e.region}:{},selected:!1,currentStreamName:n}))]))),f()},[d,l,n,f]),S=a(()=>[{id:hf,type:ro.Button,buttonProps:{variant:ge.Text,size:me.S,label:bf,onClick:f}},{id:mf,type:ro.Button,buttonProps:{variant:ge.Secondary,size:me.S,label:vf,leftIcon:pl,onClick:()=>p(!0)}},{id:gf,type:ro.Button,buttonProps:{variant:ge.Primary,size:me.S,label:yf,leftIcon:xa,onClick:()=>m(!0)}}],[f]);return e(o,{children:[t(Oo,{isOpen:g>0,richTitle:{icon:Ba,title:ff,badge:{label:g}},actions:S}),t(qe,{isOpen:u,title:Cf,description:Sf,onClose:b,denyButton:{label:xf,variant:ge.Secondary,onClick:b},approveButton:{label:wf,variant:ge.Primary,onClick:()=>{y(),b()}}}),t(Gl,{isOpen:h,action:"uninstrument",target:`${g} source${1===g?"":"s"}`,onClose:v,onDeny:v,onApprove:C})]})},kf=y`
901
1315
  0% {
902
1316
  background-position: 200% 50%;
903
1317
  }
904
1318
  100% {
905
1319
  background-position: 0% 50%;
906
1320
  }
907
- `,mm=g.div`
1321
+ `,Ef=f.div`
908
1322
  display: flex;
909
1323
  align-items: center;
910
1324
  justify-content: space-evenly;
@@ -915,50 +1329,76 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
915
1329
 
916
1330
  background: ${({theme:e})=>`linear-gradient(90deg, ${e.v2.colors.pink[500]} 0%, ${e.v2.colors.purple[400]} 25%, ${e.v2.colors.green[500]} 50%, ${e.v2.colors.purple[400]} 75%, ${e.v2.colors.pink[500]} 100%)`};
917
1331
  background-size: 200% 100%;
918
- animation: ${hm} 15s linear infinite;
919
- `,gm=[Ri,Di,$i,Ii],fm=({onRedirectToSampling:n})=>{const o=f();return e(wa,{children:[e(lt,{fullHeight:!0,customTitle:t(em,{}),customSearch:t(Bh,{}),filters:t(rh,{}),children:[t(mm,{children:gm.map((n,a)=>e(s,{children:[t(n,{size:24}),a<gm.length-1&&t(Ti,{fill:o.v2.colors.white[500]+st["020"],size:24})]},n.name))}),t(Oh,{})]}),t(Xh,{onRedirectToSampling:n}),t(pm,{})]})};var bm;!function(e){e.Gateway="gateway",e.Node="node"}(bm||(bm={}));const vm=({onClickDownloadDiagnose:n,onClickRefresh:o,loading:i,disabled:l})=>{const r=a(()=>{const e=[];return n&&e.push({id:qn(),type:tn.Button,buttonProps:{label:"Download Diagnose",leftIcon:Zi,size:he.S,variant:me.Text,onClick:n,disabled:l}}),o&&e.push({id:qn(),type:tn.Button,buttonProps:{label:"Refresh",leftIcon:zi,size:he.S,variant:me.Text,onClick:o,disabled:l,loading:i}}),e},[n,o,l,i]);return e(ue,{$alignItems:"center",$justifyContent:"space-between",children:[t(Ga,{icon:dl,title:"Collectors Pipeline"}),t(Ha,{actions:r})]})},ym=({pod:n,onClose:o})=>{const{formatTimeAgo:i}=Ht(),{collectorsApi:l}=gl(),{data:r}=l.usePodInfo(n?{namespace:n.namespace,name:n.name}:void 0,{skip:!n}),s=a(()=>[{id:qn(),title:"Node",label:r?.node??"-",withCopy:!0},{id:qn(),title:"Status",badge:{status:ja(r?.status),label:r?.status??"-"}}],[r]),c=a(()=>r?.containers?.map(e=>({id:qn(),items:[{id:qn(),title:"Container",label:e.name??"-"},{id:qn(),title:"Status",label:e.startedAt?`${e.status} (since ${i(e.startedAt)})`:e.status},{id:qn(),title:"Ready",badge:{status:e.ready?Re.Success:Re.Error,leftIcon:e.ready?vi:yi,label:e.ready?"True":"False",invertColors:!0}},{id:qn(),title:"Started",badge:{status:e.started?Re.Success:Re.Error,leftIcon:e.started?vi:yi,label:e.started?"True":"False",invertColors:!0}},{id:qn(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:qn(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:qn(),title:Je.RESTARTS,label:e.restarts.toString()},{id:qn(),title:"State Reason",label:e.stateReason??"-"},{id:qn(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:qn(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[r]);return t(le,{isOpen:!!n,header:{icon:Li,title:"Pod Information",onClose:o},children:r?e(Dt,{bgTint:"1000",richTitle:{icon:Li,title:r.name,withCopy:!0},children:[t(Dt,{bgTint:"900",cellsPerRow:2,items:s}),e(Dt,{bgTint:"900",richTitle:{icon:Hi,title:Je.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:[t(en,{value:`kubectl get pod ${r.name} -n ${r.namespace} -o yaml`}),t(en,{value:`kubectl describe pod ${r.name} -n ${r.namespace}`}),t(en,{value:`kubectl logs ${r.name} -n ${r.namespace}`})]}),t(Dt,{bgTint:"900",richTitle:{title:"Containers Overview"},withCollapse:!0,collapseIsDefaultOpen:!0,children:c.length?c.map(({id:e,items:n})=>t(Dt,{bgTint:"800",cellsPerRow:2,items:n},e)):t(Ie,{title:"No containers",subTitle:"Pod has no containers"})}),t(Rl,{bgTint:"900",yaml:r.manifestYAML,defaultOpen:!0})]}):t(pt,{$height:"50vh",children:t(bt,{withSpinner:!0})})})};var Cm;!function(e){e.PodName="podName",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.SpanDropRate="spanDropRate",e.Age="age",e.DockerImage="dockerImage"}(Cm||(Cm={}));const Sm=e=>{const t=[{key:Cm.PodName,label:"Pod Name"},{key:Cm.Status,label:"Status"},{key:Cm.Restarts,label:Je.RESTARTS},{key:Cm.NodeName,label:"Node Name"},{key:Cm.Age,label:"Age"},{key:Cm.DockerImage,label:"Collector Version"}];return e&&t.splice(4,0,{key:Cm.SpanDropRate,label:"Span Drop Rate",noSort:!0,noFilter:!0}),t},wm=({isLoading:n,pods:o,withSpanDropRate:i})=>{const l=f(),{formatTimeAgo:s}=Ht(),[c,d]=r(null),u=a(()=>o.map(n=>({onClick:()=>d(n),cells:[{key:Cm.PodName,rawValue:n.name},{key:Cm.Status,rawValue:n.status,component:()=>{return e=n.status,t(je,{status:ja(e),label:e});var e}},{key:Cm.Restarts,rawValue:n.restartsCount.toString()},{key:Cm.NodeName,rawValue:n.nodeName},{key:Cm.SpanDropRate,rawValue:0,component:()=>{const{collectorMetrics:o}=n;if(!o)return t(se,{children:"-"});const a=(o?.metricsAcceptedRps??0)+(o?.metricsDroppedRps??0),i=a>0?Math.round((o?.metricsDroppedRps??0)/a*100):0,l=i>0?Re.Error:Re.Success,r=(o?.exporterSuccessRps??0)+(o?.exporterFailedRps??0),s=r>0?Math.round((o?.exporterFailedRps??0)/r*100):0,c=s>0?Re.Error:Re.Success;return e(ue,{$gap:4,children:[t(ze,{text:`Accepted: ${o.metricsAcceptedRps.toLocaleString()} spans/s\nDropped: ${o.metricsDroppedRps.toLocaleString()} spans/s`,children:t(je,{status:l,label:`Receiver ${i}%`,leftIcon:l===Re.Error?ul:pl,useSecondaryTone:!0,invertColors:!0})}),t(ze,{text:`Success: ${o.exporterSuccessRps.toLocaleString()} spans/s\nFailed: ${o.exporterFailedRps.toLocaleString()} spans/s`,children:t(je,{status:c,label:`Exporter ${s}%`,leftIcon:c===Re.Error?ul:pl,useSecondaryTone:!0,invertColors:!0})})]})}},{key:Cm.Age,rawValue:s(n.creationTimestamp)},{key:Cm.DockerImage,rawValue:n.image}]})),[o,l]);return e(Dt,{fullHeight:!0,bgTint:"1000",moreSpacing:!0,richTitle:{icon:Li,title:"Pods"},children:[t(Sn,{variant:wn.Data,isLoading:n,columns:Sm(i),rows:u}),t(ym,{pod:c,onClose:()=>d(null)})]})},xm=({isOpen:e,onClose:n,title:o,yaml:a})=>t(le,{isOpen:e,header:{icon:hl,title:o,onClose:n},children:t(Rl,{yaml:a,defaultOpen:!0})}),km=e=>{switch(e){case Wa.Healthy:return"All desired replicas are updated, available, and ready";case Wa.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case Wa.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case Wa.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case Wa.Down:return"No available replicas";case Wa.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}};var Tm;!function(e){e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"}(Tm||(Tm={}));const $m=g.div`
1332
+ animation: ${kf} 15s linear infinite;
1333
+ `,If=[za,Ba,Da,_a],Of=({onRedirectToSampling:o})=>{const n=b();return e(Ni,{children:[e(st,{fullHeight:!0,customTitle:t(pf,{}),customSearch:t(qg,{}),filters:t(vg,{}),children:[t(Ef,{children:If.map((o,i)=>e(c,{children:[t(o,{size:24}),i<If.length-1&&t(Ra,{fill:n.v2.colors.white[500]+dt["020"],size:24})]},o.name))}),t(Ug,{})]}),t(Zg,{onRedirectToSampling:o}),t(Tf,{})]})};var Nf;!function(e){e.Gateway="gateway",e.Node="node"}(Nf||(Nf={}));const $f=({onClickDownloadDiagnose:o,onClickRefresh:n,loading:i,disabled:l})=>{const r=a(()=>{const e=[];return o&&e.push({id:on(),type:ro.Button,buttonProps:{label:"Download Diagnose",leftIcon:ul,size:me.S,variant:ge.Text,onClick:o,disabled:l}}),n&&e.push({id:on(),type:ro.Button,buttonProps:{label:"Refresh",leftIcon:Ka,size:me.S,variant:ge.Text,onClick:n,disabled:l,loading:i}}),e},[o,n,l,i]);return e(pe,{$alignItems:"center",$justifyContent:"space-between",children:[t(qi,{icon:wl,title:"Collectors Pipeline"}),t(Zi,{actions:r})]})},Af=({pod:o,onClose:n})=>{const{formatTimeAgo:i}=qt(),{collectorsApi:l}=Nl(),{data:r}=l.usePodInfo(o?{namespace:o.namespace,name:o.name}:void 0,{skip:!o}),s=a(()=>[{id:on(),title:"Node",label:r?.node??"-",withCopy:!0},{id:on(),title:"Status",badge:{status:Qi(r?.status),label:r?.status??"-"}}],[r]),c=a(()=>r?.containers?.map(e=>({id:on(),items:[{id:on(),title:"Container",label:e.name??"-"},{id:on(),title:"Status",label:e.startedAt?`${e.status} (since ${i(e.startedAt)})`:e.status},{id:on(),title:"Ready",badge:{status:e.ready?Pe.Success:Pe.Error,leftIcon:e.ready?ka:Ea,label:e.ready?"True":"False",invertColors:!0}},{id:on(),title:"Started",badge:{status:e.started?Pe.Success:Pe.Error,leftIcon:e.started?ka:Ea,label:e.started?"True":"False",invertColors:!0}},{id:on(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:on(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:on(),title:Ze.RESTARTS,label:e.restarts.toString()},{id:on(),title:"State Reason",label:e.stateReason??"-"},{id:on(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:on(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[r]);return t(re,{isOpen:!!o,header:{icon:Ja,title:"Pod Information",onClose:n},children:r?e(zt,{bgTint:"1000",richTitle:{icon:Ja,title:r.name,withCopy:!0},children:[t(zt,{bgTint:"900",cellsPerRow:2,items:s}),e(zt,{bgTint:"900",richTitle:{icon:il,title:Ze.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:[t(lo,{value:`kubectl get pod ${r.name} -n ${r.namespace} -o yaml`}),t(lo,{value:`kubectl describe pod ${r.name} -n ${r.namespace}`}),t(lo,{value:`kubectl logs ${r.name} -n ${r.namespace}`})]}),t(zt,{bgTint:"900",richTitle:{title:"Containers Overview"},withCollapse:!0,collapseIsDefaultOpen:!0,children:c.length?c.map(({id:e,items:o})=>t(zt,{bgTint:"800",cellsPerRow:2,items:o},e)):t($e,{title:"No containers",subTitle:"Pod has no containers"})}),t(Wl,{bgTint:"900",yaml:r.manifestYAML,defaultOpen:!0})]}):t(mt,{$height:"50vh",children:t(yt,{withSpinner:!0})})})};var Rf;!function(e){e.PodName="podName",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.SpanDropRate="spanDropRate",e.Age="age",e.DockerImage="dockerImage"}(Rf||(Rf={}));const Df=e=>{const t=[{key:Rf.PodName,label:"Pod Name"},{key:Rf.Status,label:"Status"},{key:Rf.Restarts,label:Ze.RESTARTS},{key:Rf.NodeName,label:"Node Name"},{key:Rf.Age,label:"Age"},{key:Rf.DockerImage,label:"Collector Version"}];return e&&t.splice(4,0,{key:Rf.SpanDropRate,label:"Span Drop Rate",noSort:!0,noFilter:!0}),t},_f=({isLoading:o,pods:n,withSpanDropRate:i})=>{const l=b(),{formatTimeAgo:r}=qt(),[c,d]=s(null),u=a(()=>n.map(o=>({onClick:()=>d(o),cells:[{key:Rf.PodName,rawValue:o.name},{key:Rf.Status,rawValue:o.status,component:()=>{return e=o.status,t(Ke,{status:Qi(e),label:e});var e}},{key:Rf.Restarts,rawValue:o.restartsCount.toString()},{key:Rf.NodeName,rawValue:o.nodeName},{key:Rf.SpanDropRate,rawValue:0,component:()=>{const{collectorMetrics:n}=o;if(!n)return t(ce,{children:"-"});const i=(n?.metricsAcceptedRps??0)+(n?.metricsDroppedRps??0),a=i>0?Math.round((n?.metricsDroppedRps??0)/i*100):0,l=a>0?Pe.Error:Pe.Success,r=(n?.exporterSuccessRps??0)+(n?.exporterFailedRps??0),s=r>0?Math.round((n?.exporterFailedRps??0)/r*100):0,c=s>0?Pe.Error:Pe.Success;return e(pe,{$gap:4,children:[t(Ie,{text:`Accepted: ${n.metricsAcceptedRps.toLocaleString()} spans/s\nDropped: ${n.metricsDroppedRps.toLocaleString()} spans/s`,children:t(Ke,{status:l,label:`Receiver ${a}%`,leftIcon:l===Pe.Error?Tl:kl,useSecondaryTone:!0,invertColors:!0})}),t(Ie,{text:`Success: ${n.exporterSuccessRps.toLocaleString()} spans/s\nFailed: ${n.exporterFailedRps.toLocaleString()} spans/s`,children:t(Ke,{status:c,label:`Exporter ${s}%`,leftIcon:c===Pe.Error?Tl:kl,useSecondaryTone:!0,invertColors:!0})})]})}},{key:Rf.Age,rawValue:r(o.creationTimestamp)},{key:Rf.DockerImage,rawValue:o.image}]})),[n,l]);return e(zt,{fullHeight:!0,bgTint:"1000",moreSpacing:!0,richTitle:{icon:Ja,title:"Pods"},children:[t(Eo,{variant:Io.Data,isLoading:o,columns:Df(i),rows:u}),t(Af,{pod:c,onClose:()=>d(null)})]})},Pf=({isOpen:e,onClose:o,title:n,yaml:i})=>t(re,{isOpen:e,header:{icon:El,title:n,onClose:o},children:t(Wl,{yaml:i,defaultOpen:!0})}),Lf=e=>{switch(e){case ea.Healthy:return"All desired replicas are updated, available, and ready";case ea.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case ea.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case ea.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case ea.Down:return"No available replicas";case ea.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}};var Ff;!function(e){e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"}(Ff||(Ff={}));const Mf=f.div`
920
1334
  flex: 0.5;
921
1335
  padding: 12px;
922
1336
  border-radius: 12px;
923
1337
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
924
- `,Im=({selectedTab:n,gatewayInfo:o,nodeCollectorInfo:i,isLoading:l})=>{const{formatTimeAgo:s}=Ht(),[c,d]=r(null),u=a(()=>(e=>{switch(e){case bm.Gateway:return"Deployment";case bm.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(n),[n]),p=a(()=>((e,t,n,o)=>{const a={status:Re.Disabled,label:"No rollouts yet"};let i=!1,l=null;switch(e){case bm.Gateway:i=t?.rolloutInProgress??!1,l=t?.lastRolloutAt??null;break;case bm.Node:i=n?.rolloutInProgress??!1,l=n?.lastRolloutAt??null;break;default:return a}return i?{status:Re.Info,label:"Rollout in progress",rightIcon:zi,useSecondaryTone:!0}:l?{status:Re.Disabled,label:`Last Rollout: ${o(l)}`}:a})(n,o,i,s),[o,i,n,s]),h=a(()=>((e,t,n,o)=>{let a=o?Re.Info:Re.Unknown,i=o?"Loading":Wa.Unknown,l=o?"Fetching data...":km(Wa.Unknown);switch(e){case bm.Gateway:a=t?.status?ja(t?.status):a,i=t?.status??i,l=t?.status?km(t.status):l;break;case bm.Node:a=n?.status?ja(n?.status):a,i=n?.status??i,l=n?.status?km(n.status):l}return{status:a,title:i,description:l}})(n,o,i,l),[o,i,n,l]),m=a(()=>((e,t,n)=>{switch(e){case bm.Gateway:return[{gaugeWidth:128,min:0,max:t?.hpa?.max??0,current:t?.hpa?.current??0,title:"HPA Spec",primaryLabel:"Current replicas",secondaryLabel:"Max replicas"}];case bm.Node:return[{gaugeWidth:128,min:0,max:n?.nodes?.desired??0,current:n?.nodes?.ready??0,title:"Nodes",primaryLabel:"Ready nodes",secondaryLabel:"Desired nodes"}];default:return[]}})(n,o,i),[o,i,n]),g=a(()=>((e,t,n,o)=>{switch(e){case bm.Gateway:return[{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${t?.resources?.requests.cpu}/${t?.resources?.limits.cpu}`,isLoading:o},{label:"Memory",value:`${t?.resources?.requests.memory}/${t?.resources?.limits.memory}`,isLoading:o}]}];case bm.Node:return[{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${n?.resources?.requests.cpu}/${n?.resources?.limits.cpu}`,isLoading:o},{label:"Memory",value:`${n?.resources?.requests.memory}/${n?.resources?.limits.memory}`,isLoading:o}]}];default:return[]}})(n,o,i,l),[o,i,n,l]),f=a(()=>(n===bm.Gateway?o?.manifestYAML:i?.manifestYAML)??"",[o,i,n]),b=a(()=>(n===bm.Gateway?o?.configMapYAML:i?.configMapYAML)??"",[o,i,n]);return e(Dt,{bgTint:"1000",moreSpacing:!0,richTitle:{icon:hl,title:u,badge:p},actions:[{id:qn(),type:tn.ButtonDropData,buttonProps:{variant:me.Secondary,size:he.S,label:"View YAML",onClick:e=>d(e)},dropDataProps:{items:[{id:Tm.ManifestYaml,label:u,icon:ml},{id:Tm.ConfigMapYaml,label:"ConfigMap",icon:ml}]}}],children:[e(ue,{$gap:16,children:[t("div",{children:t(Ka,{...h})}),m.map(e=>t($m,{children:t("div",{children:t(Ya,{...e})})},e.title)),g.map(e=>t(Ja,{...e},e.title))]}),t(xm,{isOpen:c===Tm.ManifestYaml,onClose:()=>d(null),title:u,yaml:f}),t(xm,{isOpen:c===Tm.ConfigMapYaml,onClose:()=>d(null),title:"ConfigMap",yaml:b})]})},Em=[{value:bm.Gateway,label:"Gateway"},{value:bm.Node,label:"Node Collector"}],Am=({minSupportedVersion:n=0})=>{const{isVersionSupported:o,version:i}=y(n),[s,c]=r(bm.Gateway),d=s===bm.Gateway,u=s===bm.Node,{collectorsApi:p,configApi:h}=gl(),{data:m}=h.useEffectiveConfig(),{data:g,loading:f,refetch:b}=p.useGatewayInfo({skip:!d}),{data:v=[],loading:C,refetch:S}=p.useGatewayPods({skip:!d}),{data:w,loading:x,refetch:k}=p.useNodeCollectorInfo({skip:!u}),{data:T=[],loading:$,refetch:I}=p.useNodeCollectorPods({skip:!u}),E=d&&(f||C)||u&&(x||$),A=l(()=>{d?(b(),S()):u&&(k(),I())},[d,u,b,S,k,I]),N=a(()=>d?v:T,[v,T,d]);return e(wa,{children:[t(vm,{disabled:!o,loading:E,onClickDownloadDiagnose:void 0,onClickRefresh:A}),e(qa,{children:[e(q,{children:[t(ge,{variant:yn.Underline,size:Ae.L,options:Em,selected:s,setSelected:c}),t(Im,{selectedTab:s,gatewayInfo:g??null,nodeCollectorInfo:w??null,isLoading:E})]}),t(wm,{isLoading:E,pods:N,withSpanDropRate:!1===m?.odigosOwnTelemetryStore?.metricsStoreDisabled}),!o&&t(Fl,{minSupportedVersion:n,currentVersion:i||""})]})]})},Nm=g.div`
1338
+ `,zf=({selectedTab:o,gatewayInfo:n,nodeCollectorInfo:i,isLoading:l})=>{const{formatTimeAgo:r}=qt(),[c,d]=s(null),u=a(()=>(e=>{switch(e){case Nf.Gateway:return"Deployment";case Nf.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(o),[o]),p=a(()=>((e,t,o,n)=>{const i={status:Pe.Disabled,label:"No rollouts yet"};let a=!1,l=null;switch(e){case Nf.Gateway:a=t?.rolloutInProgress??!1,l=t?.lastRolloutAt??null;break;case Nf.Node:a=o?.rolloutInProgress??!1,l=o?.lastRolloutAt??null;break;default:return i}return a?{status:Pe.Info,label:"Rollout in progress",rightIcon:Ka,useSecondaryTone:!0}:l?{status:Pe.Disabled,label:`Last Rollout: ${n(l)}`}:i})(o,n,i,r),[n,i,o,r]),h=a(()=>((e,t,o,n)=>{let i=n?Pe.Info:Pe.Unknown,a=n?"Loading":ea.Unknown,l=n?"Fetching data...":Lf(ea.Unknown);switch(e){case Nf.Gateway:i=t?.status?Qi(t?.status):i,a=t?.status??a,l=t?.status?Lf(t.status):l;break;case Nf.Node:i=o?.status?Qi(o?.status):i,a=o?.status??a,l=o?.status?Lf(o.status):l}return{status:i,title:a,description:l}})(o,n,i,l),[n,i,o,l]),m=a(()=>((e,t,o)=>{switch(e){case Nf.Gateway:return[{gaugeWidth:128,min:0,max:t?.hpa?.max??0,current:t?.hpa?.current??0,title:"HPA Spec",primaryLabel:"Current replicas",secondaryLabel:"Max replicas"}];case Nf.Node:return[{gaugeWidth:128,min:0,max:o?.nodes?.desired??0,current:o?.nodes?.ready??0,title:"Nodes",primaryLabel:"Ready nodes",secondaryLabel:"Desired nodes"}];default:return[]}})(o,n,i),[n,i,o]),g=a(()=>((e,t,o,n)=>{switch(e){case Nf.Gateway:return[{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${t?.resources?.requests.cpu}/${t?.resources?.limits.cpu}`,isLoading:n},{label:"Memory",value:`${t?.resources?.requests.memory}/${t?.resources?.limits.memory}`,isLoading:n}]}];case Nf.Node:return[{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${o?.resources?.requests.cpu}/${o?.resources?.limits.cpu}`,isLoading:n},{label:"Memory",value:`${o?.resources?.requests.memory}/${o?.resources?.limits.memory}`,isLoading:n}]}];default:return[]}})(o,n,i,l),[n,i,o,l]),f=a(()=>(o===Nf.Gateway?n?.manifestYAML:i?.manifestYAML)??"",[n,i,o]),b=a(()=>(o===Nf.Gateway?n?.configMapYAML:i?.configMapYAML)??"",[n,i,o]);return e(zt,{bgTint:"1000",moreSpacing:!0,richTitle:{icon:El,title:u,badge:p},actions:[{id:on(),type:ro.ButtonDropData,buttonProps:{variant:ge.Secondary,size:me.S,label:"View YAML",onClick:e=>d(e)},dropDataProps:{items:[{id:Ff.ManifestYaml,label:u,icon:Il},{id:Ff.ConfigMapYaml,label:"ConfigMap",icon:Il}]}}],children:[e(pe,{$gap:16,children:[t("div",{children:t(ta,{...h})}),m.map(e=>t(Mf,{children:t("div",{children:t(oa,{...e})})},e.title)),g.map(e=>t(na,{...e},e.title))]}),t(Pf,{isOpen:c===Ff.ManifestYaml,onClose:()=>d(null),title:u,yaml:f}),t(Pf,{isOpen:c===Ff.ConfigMapYaml,onClose:()=>d(null),title:"ConfigMap",yaml:b})]})},Bf=[{value:Nf.Gateway,label:"Gateway"},{value:Nf.Node,label:"Node Collector"}],Xf=({minSupportedVersion:o=0})=>{const{isVersionSupported:n,version:i}=C(o),[l,c]=s(Nf.Gateway),d=l===Nf.Gateway,u=l===Nf.Node,{collectorsApi:p,configApi:h}=Nl(),{data:m}=h.useEffectiveConfig(),{data:g,loading:f,refetch:b}=p.useGatewayInfo({skip:!d}),{data:v=[],loading:y,refetch:S}=p.useGatewayPods({skip:!d}),{data:x,loading:w,refetch:T}=p.useNodeCollectorInfo({skip:!u}),{data:k=[],loading:E,refetch:I}=p.useNodeCollectorPods({skip:!u}),O=d&&(f||y)||u&&(w||E),N=r(()=>{d?(b(),S()):u&&(T(),I())},[d,u,b,S,T,I]),$=a(()=>d?v:k,[v,k,d]);return e(Ni,{children:[t($f,{disabled:!n,loading:O,onClickDownloadDiagnose:void 0,onClickRefresh:N}),e(ia,{children:[e(Z,{children:[t(fe,{variant:To.Underline,size:Re.L,options:Bf,selected:l,setSelected:c}),t(zf,{selectedTab:l,gatewayInfo:g??null,nodeCollectorInfo:x??null,isLoading:O})]}),t(_f,{isLoading:O,pods:$,withSpanDropRate:!1===m?.odigosOwnTelemetryStore?.metricsStoreDisabled}),!n&&t(Jl,{minSupportedVersion:o,currentVersion:i||""})]})]})},Uf=f.div`
925
1339
  display: inline-flex;
926
1340
  align-items: center;
927
1341
  min-width: 0;
928
1342
  overflow: hidden;
929
1343
  white-space: pre;
930
1344
  text-overflow: ellipsis;
931
- `,Om=g.div`
1345
+ `,Vf=f.div`
932
1346
  display: flex;
933
1347
  flex-direction: column;
934
1348
  gap: 4px;
935
1349
  min-width: 0;
936
1350
  flex: 1;
937
1351
  opacity: ${({$disabled:e})=>e?.4:1};
938
- `,Rm=g(ue)`
1352
+ `,Hf=f(pe)`
939
1353
  flex-shrink: 0;
940
1354
  gap: 6px;
941
1355
  align-items: center;
942
1356
  min-height: 22px;
943
- `;const Dm=[{key:"content",label:"Content",noSort:!0,noFilter:!0,flex:1},{key:"badges",label:"Type",noSort:!0,noFilter:!0,flex:"0 0 128px"}],Pm=[{value:"all",label:Qa},{value:"Relevance",label:"Relevance"},{value:"Duration",label:"Duration"},{value:"Error",label:"Error"}],Fm=({title:n,items:o,isLoading:i,showTypeFilter:s,onRuleClick:c,onCreateRule:d,onEditRule:u,onDeleteRule:p})=>{const h=f(),[m,g]=r(""),[b,v]=r("all"),y=a(()=>{let e=function(e,t,n){return n&&"all"!==t?e.filter(e=>e.typeBadge===t):e}(o,b,s);return e=function(e,t){if(!t.trim())return e;const n=t.toLowerCase();return e.filter(e=>{const t=e.name?.toLowerCase().includes(n),o=e.summary.map(e=>e.text).join("").toLowerCase();return t||o.includes(n)})}(e,m),e},[o,b,s,m]),C=a(()=>y.map(n=>{const o=n.typeBadge?function(e,t){const n=e.v2.colors;switch(t){case"Relevance":return{bg:n.blue[700],text:n.white[500]};case"Duration":return{bg:n.purple[700],text:n.white[500]};case"Error":return{bg:n.red[500],text:n.black[500]}}}(h,n.typeBadge):void 0;return{cells:[{key:"content",rawValue:n.summary.map(e=>e.text).join(""),component:()=>e(Om,{$disabled:n.disabled,children:[t(Nm,{children:t(S,{parts:n.summary})}),n.name&&t(se,{size:de.XXS,color:ce.Secondary,nowrap:!0,children:n.name})]})},{key:"badges",rawValue:n.typeBadge||"",component:()=>e(Rm,{children:[n.disabled&&t(je,{label:Za,textSize:de.XXXS,backgroundColor:h.v2.colors.grey[700],textColor:h.v2.colors.grey[300]}),n.typeBadge&&o&&t(je,{label:n.typeBadge,textSize:de.XXXS,backgroundColor:o.bg,textColor:o.text})]})}],onClick:()=>c(n)}}),[y,h,c]),w=a(()=>{const e=e=>t(Si,{...e,fill:h.v2.colors.red[500]});return e.displayName="RedDeleteIcon",e},[h]),x=l(e=>{const t=C.indexOf(e);if(t<0)return[];const n=y[t];return n?[{id:"edit","data-id":"sampling-rule-action-edit",label:En,leftIcon:wi,onClick:()=>u(n.ruleId,n.samplingId)},{id:"delete","data-id":"sampling-rule-action-delete",label:"",leftIcon:w,onClick:()=>p(n.ruleId,n.samplingId)}]:[]},[C,y,u,p,w]);return t(lt,{fullHeight:!0,richTitle:{icon:tl,title:n,badge:{label:o.length,backgroundColor:h.v2.colors.silver[600],textColor:h.v2.colors.white[500]}},search:{"data-id":"sampling-search-rules",value:m,onChange:g,placeholder:"Search..",width:"500px",...s?{segment:{"data-id":"sampling-segment-type-filter",options:Pm,selected:b,setSelected:v}}:{}},children:t(Sn,{variant:wn.Pretty,hideHeader:!0,isLoading:i,noDataProps:m.trim()?{hideIcon:!0,title:ei,subTitle:oi(m)}:{hideIcon:!0,title:ni,button:{label:ti,onClick:d}},columns:Dm,rows:C,getRowActions:x})})},Lm=({docsUrl:n})=>{const{samplingApi:s,sourcesApi:c}=gl(),{items:d}=c.useSources(),u=a(()=>d.map(e=>({id:e.id})),[d]),{items:p,loading:h,k8sHealthProbesConfig:m,refetch:g}=s.useSamplingRules(),f=l((e,t)=>s.createNoisy?.({samplingId:e,rule:t}),[s]),b=l((e,t,n)=>s.updateNoisy?.(t,{samplingId:e,rule:n}),[s]),v=l((e,t)=>s.createHighlyRelevant?.({samplingId:e,rule:t}),[s]),y=l((e,t,n)=>s.updateHighlyRelevant?.(t,{samplingId:e,rule:n}),[s]),C=l((e,t)=>s.createCostReduction?.({samplingId:e,rule:t}),[s]),S=l((e,t,n)=>s.updateCostReduction?.(t,{samplingId:e,rule:n}),[s]),w=l((e,t,n)=>"noisy"===n?s.deleteNoisy?.(t,e):"highlyRelevant"===n?s.deleteHighlyRelevant?.(t,e):"costReduction"===n?s.deleteCostReduction?.(t,e):void 0,[s]),x=l((e,t)=>s.updateK8sHealthProbesConfig?.({enabled:e,keepPercentage:t}),[s]),k=a(()=>u.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[u]),T=a(()=>Array.from(new Set(u.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[u]),[$,I]=r(R.Noisy),[E,O]=r(null),[J,Z]=r(!1),[Q,ee]=r(!1),[te,ne]=r(null),[oe,ae]=r(!1),[ie,le]=r(!1),[re,se]=r(!1),[ce,de]=r(!1);i(!1),o(()=>{},[h,p]);const{pendingViewSamplingRule:fe,setPendingViewSamplingRule:be}=an();o(()=>{if(!fe)return;if(h||0===p.length)return;be(null);const e=D(p,fe.ruleId,fe.category);e&&(I(P[fe.category]),Z(!1),O(e))},[h,p,fe,be]);const ve=a(()=>A(m),[m]),ye=a(()=>F(p),[p]),Ce=a(()=>N(ye?.rule??null),[ye]),Se=a(()=>L(p),[p]),we=a(()=>_(Se?.rule??null),[Se]),xe=i(E);xe.current=E,o(()=>{const e=xe.current;if(!e)return;const t=M(p,e);t?O(t):(O(null),Z(!1))},[p]);const ke=a(()=>{const e=new Set;return ye&&e.add(ye.rule.ruleId),Se&&e.add(Se.rule.ruleId),e},[ye,Se]),Te=a(()=>z(p,$,ke),[p,$,ke]),$e=l(()=>ee(!0),[]),Ie=l(()=>ee(!1),[]);l(()=>de(!1),[]);const Ee=l(async e=>{const t=p[0]?.id??"default";switch(H[$]){case"noisy":await f(t,V(e));break;case"highlyRelevant":await v(t,X(e));break;case"costReduction":await C(t,B(e))}ee(!1)},[p,$,f,v,C]),Ne=l(e=>{const t=U(p,e);t&&(Z(!1),O(t))},[p]),De=l(()=>{O(null),Z(!1)},[]),Pe=l((e,t)=>{const n=E;if(n&&n.rule.ruleId===e&&n.samplingId===t)Z(!0),O({...n});else for(const n of p){if(n.id!==t)continue;const o=[...n.noisyOperations.map(e=>({category:"noisy",rule:e})),...n.highlyRelevantOperations.map(e=>({category:"highlyRelevant",rule:e})),...n.costReductionRules.map(e=>({category:"costReduction",rule:e}))].find(t=>t.rule.ruleId===e);if(o)return Z(!0),void O({category:o.category,rule:o.rule,samplingId:t,summary:G(o.category,o.rule)})}},[E,p]),Fe=l(async(e,t,n)=>{const o=E?.category;if(o){switch(o){case"noisy":await b(n,t,V(e));break;case"highlyRelevant":await y(n,t,X(e));break;case"costReduction":await S(n,t,B(e))}Z(!1)}},[E,b,y,S]),Le=l((e,t)=>{ne({ruleId:e,samplingId:t})},[]),_e=l(async()=>{if(!te)return;const{ruleId:e,samplingId:t}=te,n=E?.category||H[$];await w(t,e,n),O(null),Z(!1),ne(null)},[te,E,$,w]),Me=l(()=>ne(null),[]),ze=l(async(e,t)=>{await x(e,t),ae(!1)},[x]),Be=l(async e=>{const t=p[0]?.id??"default",n=ye;n?await y(n.samplingId,n.rule.ruleId,{name:n.rule.name,disabled:!e,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null,notes:n.rule.notes}):e&&await v(t,{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}),le(!1)},[p,ye,v,y]),Xe=l(async(e,t)=>{const n=p[0]?.id??"default",o=Se;o?await S(o.samplingId,o.rule.ruleId,{name:o.rule.name,disabled:!e,sourceScopes:null,operation:null,percentageAtMost:t,notes:o.rule.notes}):e&&await C(n,{name:"Auto - Drop Traces Cluster-Wide",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:t}),se(!1)},[p,Se,C,S]),Ve=l(e=>{const t=H[$];let n=null;switch(t){case"noisy":{const o=V(e);n=j(p,t,{sourceScopes:o.sourceScopes,operation:o.operation});break}case"highlyRelevant":{const o=X(e);n=j(p,t,{sourceScopes:o.sourceScopes,operation:o.operation,error:o.error??!1,durationAtLeastMs:o.durationAtLeastMs});break}case"costReduction":{const o=B(e);n=j(p,t,{sourceScopes:o.sourceScopes,operation:o.operation});break}}return n?{message:ai,ruleId:n}:null},[p,$]),Ue=l(e=>{const t=E?.category,n=E?.rule.ruleId;if(!t)return null;let o=null;switch(t){case"noisy":{const a=V(e);o=j(p,t,{sourceScopes:a.sourceScopes,operation:a.operation},n);break}case"highlyRelevant":{const a=X(e);o=j(p,t,{sourceScopes:a.sourceScopes,operation:a.operation,error:a.error??!1,durationAtLeastMs:a.durationAtLeastMs},n);break}case"costReduction":{const a=B(e);o=j(p,t,{sourceScopes:a.sourceScopes,operation:a.operation},n);break}}return o?{message:ai,ruleId:o}:null},[p,E]),Ge=l(e=>{ee(!1);for(const t of p){const n=[...t.noisyOperations.map(e=>({category:"noisy",rule:e})),...t.highlyRelevantOperations.map(e=>({category:"highlyRelevant",rule:e})),...t.costReductionRules.map(e=>({category:"costReduction",rule:e}))].find(t=>t.rule.ruleId===e);if(n)return Z(!0),void O({category:n.category,rule:n.rule,samplingId:t.id,summary:G(n.category,n.rule)})}},[p]),He=a(()=>{const e=[];return n&&e.push({id:qn(),type:tn.Button,buttonProps:{"data-id":"sampling-btn-docs",label:ii,leftIcon:Ci,size:he.S,variant:me.Text,onClick:()=>window.open(n,"_blank")}}),e.push({id:qn(),type:tn.Button,buttonProps:{"data-id":"sampling-btn-refresh",label:li,leftIcon:zi,size:he.S,variant:me.Text,onClick:g,loading:h}}),e.push({id:qn(),type:tn.Button,buttonProps:{"data-id":"sampling-btn-create-rule",label:ri,rightIcon:fi,size:he.S,variant:me.Primary,onClick:$e}}),e},[n,g,h,$e]);return e(wa,{children:[e(ue,{$gap:12,$justifyContent:"space-between",children:[t(Ga,{icon:tl,title:ci,subTitle:si}),t(Ha,{actions:He})]}),e(q,{$gap:12,$fullHeight:!0,children:[t(ge,{variant:yn.Underline,size:Ae.L,options:W,selected:$,setSelected:I}),e(ue,{$justifyContent:"space-between",children:[t(Oe,{status:Re.Default,message:K[$]}),n&&t(pe,{"data-id":"sampling-btn-docs-banner",label:"Docs",leftIcon:Ci,size:he.S,variant:me.Text,onClick:()=>window.open(n,"_blank")})]}),$===R.Noisy?t(Cl,{title:ot,summary:ve,onEdit:()=>ae(!0)}):$===R.HighlyRelevant?t(Cl,{title:Ze,summary:Ce,onEdit:()=>le(!0)}):$===R.CostReduction?t(Cl,{title:tt,summary:we,onEdit:()=>se(!0)}):null,t(Fm,{title:Y[$],items:Te,isLoading:h,showTypeFilter:$===R.HighlyRelevant,onRuleClick:Ne,onCreateRule:$e,onEditRule:Pe,onDeleteRule:Le})]}),t(xu,{formType:Ul.View,data:E,defaultEditMode:J,onClose:De,onDelete:Le,onSaveEdit:Fe,sourceOptions:k,namespaceOptions:T,validateForm:Ue,onNavigateToDuplicate:Ge}),t(xu,{formType:Ul.Create,isOpen:Q,category:H[$],onClose:Ie,onSubmit:Ee,sourceOptions:k,namespaceOptions:T,validateForm:Ve,onNavigateToDuplicate:Ge}),t(xu,{formType:Ul.EditAutoNoisy,isOpen:oe,enabled:m?.enabled??!1,keepPercentage:m?.keepPercentage??0,onClose:()=>ae(!1),onSave:ze}),t(xu,{formType:Ul.EditAutoHighlyRelevant,isOpen:ie,enabled:!!ye&&!ye.rule.disabled,onClose:()=>le(!1),onSave:Be}),t(xu,{formType:Ul.EditAutoCostReduction,isOpen:re,enabled:!!Se&&!Se.rule.disabled,dropPercentage:Se?.rule.percentageAtMost??25,onClose:()=>se(!1),onSave:Xe}),t(Ye,{title:hi,description:pi,isOpen:!!te,onClose:Me,denyButton:{label:ui,variant:me.Secondary,onClick:Me},approveButton:{label:di,variant:me.Primary,onClick:()=>{_e(),Me()}}}),false]})},_m=g.div`
1357
+ `;const jf=[{key:"content",label:"Content",noSort:!0,noFilter:!0,flex:1},{key:"badges",label:"Type",noSort:!0,noFilter:!0,flex:"0 0 128px"}],Gf=[{value:"all",label:la},{value:"Relevance",label:"Relevance"},{value:"Duration",label:"Duration"},{value:"Error",label:"Error"}],Wf=({title:o,items:n,isLoading:i,showTypeFilter:l,onRuleClick:c,onCreateRule:d,onEditRule:u,onDeleteRule:p})=>{const h=b(),[m,g]=s(""),[f,v]=s("all"),y=a(()=>{let e=function(e,t,o){return o&&"all"!==t?e.filter(e=>e.typeBadge===t):e}(n,f,l);return e=function(e,t){if(!t.trim())return e;const o=t.toLowerCase();return e.filter(e=>{const t=e.name?.toLowerCase().includes(o),n=e.summary.map(e=>e.text).join("").toLowerCase();return t||n.includes(o)})}(e,m),e},[n,f,l,m]),C=a(()=>y.map(o=>{const n=o.typeBadge?function(e,t){const o=e.v2.colors;switch(t){case"Relevance":return{bg:o.blue[700],text:o.white[500]};case"Duration":return{bg:o.purple[700],text:o.white[500]};case"Error":return{bg:o.red[500],text:o.black[500]}}}(h,o.typeBadge):void 0;return{cells:[{key:"content",rawValue:o.summary.map(e=>e.text).join(""),component:()=>e(Vf,{$disabled:o.disabled,children:[t(Uf,{children:t(x,{parts:o.summary})}),o.name&&t(ce,{size:ue.XXS,color:de.Secondary,nowrap:!0,children:o.name})]})},{key:"badges",rawValue:o.typeBadge||"",component:()=>e(Hf,{children:[o.disabled&&t(Ke,{label:aa,textSize:ue.XXXS,backgroundColor:h.v2.colors.grey[700],textColor:h.v2.colors.grey[300]}),o.typeBadge&&n&&t(Ke,{label:o.typeBadge,textSize:ue.XXXS,backgroundColor:n.bg,textColor:n.text})]})}],onClick:()=>c(o)}}),[y,h,c]),S=a(()=>{const e=e=>t(Oa,{...e,fill:h.v2.colors.red[500]});return e.displayName="RedDeleteIcon",e},[h]),w=r(e=>{const t=C.indexOf(e);if(t<0)return[];const o=y[t];return o?[{id:"edit","data-id":"sampling-rule-action-edit",label:Do,leftIcon:Na,onClick:()=>u(o.ruleId,o.samplingId)},{id:"delete","data-id":"sampling-rule-action-delete",label:"",leftIcon:S,onClick:()=>p(o.ruleId,o.samplingId)}]:[]},[C,y,u,p,S]);return t(st,{fullHeight:!0,richTitle:{icon:ml,title:o,badge:{label:n.length,backgroundColor:h.v2.colors.silver[600],textColor:h.v2.colors.white[500]}},search:{"data-id":"sampling-search-rules",value:m,onChange:g,placeholder:"Search..",width:"500px",...l?{segment:{"data-id":"sampling-segment-type-filter",options:Gf,selected:f,setSelected:v}}:{}},children:t(Eo,{variant:Io.Pretty,hideHeader:!0,isLoading:i,noDataProps:m.trim()?{hideIcon:!0,title:ra,subTitle:da(m)}:{hideIcon:!0,title:ca,button:{label:sa,onClick:d}},columns:jf,rows:C,getRowActions:w})})},Kf=({docsUrl:o})=>{const{samplingApi:n,sourcesApi:c}=Nl(),{items:d}=c.useSources(),u=a(()=>d.map(e=>({id:e.id})),[d]),{items:p,loading:h,k8sHealthProbesConfig:m,refetch:g}=n.useSamplingRules(),f=r((e,t)=>n.createNoisy?.({samplingId:e,rule:t}),[n]),b=r((e,t,o)=>n.updateNoisy?.(t,{samplingId:e,rule:o}),[n]),v=r((e,t)=>n.createHighlyRelevant?.({samplingId:e,rule:t}),[n]),y=r((e,t,o)=>n.updateHighlyRelevant?.(t,{samplingId:e,rule:o}),[n]),C=r((e,t)=>n.createCostReduction?.({samplingId:e,rule:t}),[n]),S=r((e,t,o)=>n.updateCostReduction?.(t,{samplingId:e,rule:o}),[n]),x=r((e,t,o)=>"noisy"===o?n.deleteNoisy?.(t,e):"highlyRelevant"===o?n.deleteHighlyRelevant?.(t,e):"costReduction"===o?n.deleteCostReduction?.(t,e):void 0,[n]),w=r((e,t)=>n.updateK8sHealthProbesConfig?.({enabled:e,keepPercentage:t}),[n]),T=a(()=>u.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[u]),k=a(()=>Array.from(new Set(u.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[u]),[E,I]=s(D.Noisy),[O,N]=s(null),[R,q]=s(!1),[Q,ee]=s(!1),[te,oe]=s(null),[ne,ie]=s(!1),[ae,le]=s(!1),[re,se]=s(!1),[ce,de]=s(!1);l(!1),i(()=>{},[h,p]);const{pendingViewSamplingRule:ue,setPendingViewSamplingRule:be}=uo();i(()=>{if(!ue)return;if(h||0===p.length)return;be(null);const e=_(p,ue.ruleId,ue.category);e&&(I(P[ue.category]),q(!1),N(e))},[h,p,ue,be]);const ve=a(()=>$(m),[m]),ye=a(()=>L(p),[p]),Ce=a(()=>A(ye?.rule??null),[ye]),Se=a(()=>F(p),[p]),xe=a(()=>M(Se?.rule??null),[Se]),we=l(O);we.current=O,i(()=>{const e=we.current;if(!e)return;const t=z(p,e);t?N(t):(N(null),q(!1))},[p]);const Te=a(()=>{const e=new Set;return ye&&e.add(ye.rule.ruleId),Se&&e.add(Se.rule.ruleId),e},[ye,Se]),ke=a(()=>B(p,E,Te),[p,E,Te]),Ee=r(()=>ee(!0),[]),Ie=r(()=>ee(!1),[]);r(()=>de(!1),[]);const Oe=r(async e=>{const t=p[0]?.id??"default";switch(G[E]){case"noisy":await f(t,V(e));break;case"highlyRelevant":await v(t,U(e));break;case"costReduction":await C(t,X(e))}ee(!1)},[p,E,f,v,C]),Ne=r(e=>{const t=H(p,e);t&&(q(!1),N(t))},[p]),$e=r(()=>{N(null),q(!1)},[]),Ae=r((e,t)=>{const o=O;if(o&&o.rule.ruleId===e&&o.samplingId===t)q(!0),N({...o});else for(const o of p){if(o.id!==t)continue;const n=[...o.noisyOperations.map(e=>({category:"noisy",rule:e})),...o.highlyRelevantOperations.map(e=>({category:"highlyRelevant",rule:e})),...o.costReductionRules.map(e=>({category:"costReduction",rule:e}))].find(t=>t.rule.ruleId===e);if(n)return q(!0),void N({category:n.category,rule:n.rule,samplingId:t,summary:j(n.category,n.rule)})}},[O,p]),De=r(async(e,t,o)=>{const n=O?.category;if(n){switch(n){case"noisy":await b(o,t,V(e));break;case"highlyRelevant":await y(o,t,U(e));break;case"costReduction":await S(o,t,X(e))}q(!1)}},[O,b,y,S]),Le=r((e,t)=>{oe({ruleId:e,samplingId:t})},[]),Fe=r(async()=>{if(!te)return;const{ruleId:e,samplingId:t}=te,o=O?.category||G[E];await x(t,e,o),N(null),q(!1),oe(null)},[te,O,E,x]),Me=r(()=>oe(null),[]),ze=r(async(e,t)=>{await w(e,t),ie(!1)},[w]),Be=r(async e=>{const t=p[0]?.id??"default",o=ye;o?await y(o.samplingId,o.rule.ruleId,{name:o.rule.name,disabled:!e,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null,notes:o.rule.notes}):e&&await v(t,{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}),le(!1)},[p,ye,v,y]),Xe=r(async(e,t)=>{const o=p[0]?.id??"default",n=Se;n?await S(n.samplingId,n.rule.ruleId,{name:n.rule.name,disabled:!e,sourceScopes:null,operation:null,percentageAtMost:t,notes:n.rule.notes}):e&&await C(o,{name:"Auto - Drop Traces Cluster-Wide",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:t}),se(!1)},[p,Se,C,S]),Ue=r(e=>{const t=G[E];let o=null;switch(t){case"noisy":{const n=V(e);o=W(p,t,{sourceScopes:n.sourceScopes,operation:n.operation});break}case"highlyRelevant":{const n=U(e);o=W(p,t,{sourceScopes:n.sourceScopes,operation:n.operation,error:n.error??!1,durationAtLeastMs:n.durationAtLeastMs});break}case"costReduction":{const n=X(e);o=W(p,t,{sourceScopes:n.sourceScopes,operation:n.operation});break}}return o?{message:ua,ruleId:o}:null},[p,E]),Ve=r(e=>{const t=O?.category,o=O?.rule.ruleId;if(!t)return null;let n=null;switch(t){case"noisy":{const i=V(e);n=W(p,t,{sourceScopes:i.sourceScopes,operation:i.operation},o);break}case"highlyRelevant":{const i=U(e);n=W(p,t,{sourceScopes:i.sourceScopes,operation:i.operation,error:i.error??!1,durationAtLeastMs:i.durationAtLeastMs},o);break}case"costReduction":{const i=X(e);n=W(p,t,{sourceScopes:i.sourceScopes,operation:i.operation},o);break}}return n?{message:ua,ruleId:n}:null},[p,O]),He=r(e=>{ee(!1);for(const t of p){const o=[...t.noisyOperations.map(e=>({category:"noisy",rule:e})),...t.highlyRelevantOperations.map(e=>({category:"highlyRelevant",rule:e})),...t.costReductionRules.map(e=>({category:"costReduction",rule:e}))].find(t=>t.rule.ruleId===e);if(o)return q(!0),void N({category:o.category,rule:o.rule,samplingId:t.id,summary:j(o.category,o.rule)})}},[p]),je=a(()=>{const e=[];return o&&e.push({id:on(),type:ro.Button,buttonProps:{"data-id":"sampling-btn-docs",label:pa,leftIcon:Ia,size:me.S,variant:ge.Text,onClick:()=>window.open(o,"_blank")}}),e.push({id:on(),type:ro.Button,buttonProps:{"data-id":"sampling-btn-refresh",label:ha,leftIcon:Ka,size:me.S,variant:ge.Text,onClick:g,loading:h}}),e.push({id:on(),type:ro.Button,buttonProps:{"data-id":"sampling-btn-create-rule",label:ma,rightIcon:wa,size:me.S,variant:ge.Primary,onClick:Ee}}),e},[o,g,h,Ee]);return e(Ni,{children:[e(pe,{$gap:12,$justifyContent:"space-between",children:[t(qi,{icon:ml,title:fa,subTitle:ga}),t(Zi,{actions:je})]}),e(Z,{$gap:12,$fullHeight:!0,children:[t(fe,{variant:To.Underline,size:Re.L,options:K,selected:E,setSelected:I}),e(pe,{$justifyContent:"space-between",children:[t(_e,{status:Pe.Default,message:Y[E]}),o&&t(he,{"data-id":"sampling-btn-docs-banner",label:"Docs",leftIcon:Ia,size:me.S,variant:ge.Text,onClick:()=>window.open(o,"_blank")})]}),E===D.Noisy?t(_l,{title:at,summary:ve,onEdit:()=>ie(!0)}):E===D.HighlyRelevant?t(_l,{title:et,summary:Ce,onEdit:()=>le(!0)}):E===D.CostReduction?t(_l,{title:nt,summary:xe,onEdit:()=>se(!0)}):null,t(Wf,{title:J[E],items:ke,isLoading:h,showTypeFilter:E===D.HighlyRelevant,onRuleClick:Ne,onCreateRule:Ee,onEditRule:Ae,onDeleteRule:Le})]}),t($h,{formType:ir.View,data:O,defaultEditMode:R,onClose:$e,onDelete:Le,onSaveEdit:De,sourceOptions:T,namespaceOptions:k,validateForm:Ve,onNavigateToDuplicate:He}),t($h,{formType:ir.Create,isOpen:Q,category:G[E],onClose:Ie,onSubmit:Oe,sourceOptions:T,namespaceOptions:k,validateForm:Ue,onNavigateToDuplicate:He}),t($h,{formType:ir.EditAutoNoisy,isOpen:ne,enabled:m?.enabled??!1,keepPercentage:m?.keepPercentage??0,onClose:()=>ie(!1),onSave:ze}),t($h,{formType:ir.EditAutoHighlyRelevant,isOpen:ae,enabled:!!ye&&!ye.rule.disabled,onClose:()=>le(!1),onSave:Be}),t($h,{formType:ir.EditAutoCostReduction,isOpen:re,enabled:!!Se&&!Se.rule.disabled,dropPercentage:Se?.rule.percentageAtMost??25,onClose:()=>se(!1),onSave:Xe}),t(qe,{title:Ca,description:ya,isOpen:!!te,onClose:Me,denyButton:{label:va,variant:ge.Secondary,onClick:Me},approveButton:{label:ba,variant:ge.Primary,onClick:()=>{Fe(),Me()}}}),false]})},Yf=f.div`
944
1358
  display: flex;
945
1359
  align-items: center;
946
1360
  justify-content: space-between;
947
1361
  padding: 0 12px;
948
- `,Mm=({disabled:n,loading:o,tabs:i,selectedTab:l,setSelectedTab:s,onClickReset:c,onClickRefresh:d})=>{const[u,p]=r(!1),h=a(()=>{const e=[];return c&&e.push({id:qn(),type:tn.Button,buttonProps:{label:"Reset",leftIcon:gi,size:he.S,variant:me.Text,onClick:()=>p(!0),disabled:n}}),d&&e.push({id:qn(),type:tn.Button,buttonProps:{label:"Refresh",leftIcon:zi,size:he.S,variant:me.Text,onClick:d,disabled:n,loading:o}}),e},[n,o,d]);return e(_m,{children:[e(ue,{$gap:12,$alignItems:"center",children:[t(Ga,{icon:Fi,title:"Odigos Settings"}),t(mt,{width:"350px",options:i,values:[l],setValues:e=>s(e[0]),disabled:n})]}),t(Ha,{actions:h}),t(Ye,{isOpen:u,onClose:()=>p(!1),title:"Reset Settings",description:"Are you sure you want to reset the settings? This will clear the odigos-local-ui-config and reset the settings to the default values.",denyButton:{label:"Deny",variant:me.Secondary,onClick:()=>p(!1)},approveButton:{label:"Approve",variant:me.Primary,onClick:()=>{c?.(),p(!1)}}})]})},zm=g(ue)`
1362
+ `,Jf=f.div`
1363
+ display: flex;
1364
+ align-items: center;
1365
+ gap: 8px;
1366
+ `,qf=f.div`
1367
+ width: 1px;
1368
+ height: 20px;
1369
+ background-color: ${({theme:e})=>e.v2.colors.silver[500]};
1370
+ `,Zf=({disabled:o,loading:n,onClickShowYaml:i,onClickReset:l,onClickRefresh:r})=>{const c=b(),[d,u]=s(!1),p=a(()=>i?[{id:on(),type:ro.Button,buttonProps:{label:"Show Config YAML",leftIcon:Il,size:me.S,variant:ge.Secondary,onClick:i,disabled:o}}]:[],[i,o]),h=a(()=>{const e=[];return r&&e.push({id:on(),type:ro.Button,buttonProps:{leftIcon:Ka,tooltip:"Refresh",hideTooltipIcon:!0,size:me.S,variant:ge.Text,onClick:r,disabled:o,loading:n}}),l&&e.push({id:on(),type:ro.Button,buttonProps:{leftIcon:xa,tooltip:"Reset to defaults",hideTooltipIcon:!0,size:me.S,variant:ge.Text,textColor:c.v2.colors.red[500],onClick:()=>u(!0),disabled:o}}),e},[o,n,l,r,c]),m=p.length>0,g=h.length>0;return e(Yf,{children:[t(qi,{icon:Ya,title:"Odigos Settings"}),e(Jf,{children:[m&&t(Zi,{actions:p}),m&&g&&t(qf,{}),g&&t(Zi,{actions:h})]}),t(qe,{isOpen:d,onClose:()=>u(!1),title:"Reset Settings",description:"Are you sure you want to reset the settings? This will clear the odigos-local-ui-config and reset the settings to the default values.",denyButton:{label:"Deny",variant:ge.Secondary,onClick:()=>u(!1)},approveButton:{label:"Approve",variant:ge.Primary,onClick:()=>{l?.(),u(!1)}}})]})},Qf=f(Z)`
1371
+ width: 220px;
1372
+ flex-shrink: 0;
1373
+ height: 100%;
1374
+ gap: 4px;
1375
+ overflow-y: auto;
1376
+ `,eb=({options:e,selected:o,setSelected:n,disabled:i})=>t(Qf,{children:e.map(e=>t(Hs,{dataId:`settings-nav-${e.id}`,title:e.label,isSelected:o===e.id,disabled:i,onClick:()=>n(e.id)},e.id))}),tb=f(Z)`
1377
+ width: 100%;
1378
+ /* side menu (220) + gap (24) + form (600) = 844, so content fills exactly with no dead space */
1379
+ max-width: 844px;
1380
+ /* Bias the content toward the left on wide screens: ~30% of the free space sits on the left, 70% on the right. */
1381
+ margin-left: max(0px, calc((100% - 844px) * 0.3));
1382
+ margin-right: auto;
1383
+ gap: 24px;
1384
+ flex: 1;
1385
+ min-height: 0;
1386
+ `,ob=f(pe)`
949
1387
  flex: 1;
950
1388
  min-height: 0;
951
1389
  width: 100%;
952
1390
  align-self: stretch;
953
- `,Bm=g(q)`
1391
+ `,nb=f(Z)`
954
1392
  flex: 1;
955
1393
  min-height: 0;
956
1394
  height: 100%;
1395
+ max-width: 600px;
957
1396
  overflow-y: auto;
958
- `,Xm=g(Bm)`
959
- > section {
960
- min-height: 100%;
961
- box-sizing: border-box;
962
- flex-shrink: 0;
963
- }
964
- `,Vm=e=>"general"===e.name?0:"advanced"===e.name?2:1,Um=({minSupportedVersion:n=0})=>{const{isVersionSupported:i,version:l,isEnterprise:s}=y(n),{configApi:c}=gl(),{data:d,loading:u}=c.useConfigYamls(),{data:p,loading:h,refetch:m}=c.useEffectiveConfig(),g=d?.configYamls??[],[f,b]=r(!1),v=async()=>{c.resetLocalUiConfigToDefaults&&await c.resetLocalUiConfigToDefaults()},C=a(()=>{if(!p)return{};const{manifestYAML:e,provenance:t,...n}=p;return n},[p]),{formData:S,handleFormChange:w,getNestedValue:x,getFormDiff:k,isFormDirty:T}=Lt(C);o(()=>{"{}"!==JSON.stringify(C)&&"{}"===JSON.stringify(S)&&w(void 0,void 0,C)},[C,S]);const $=a(()=>[...g].sort((e,t)=>Vm(e)-Vm(t)),[g]),I=a(()=>(e=>{if(!e)return{};const t={};for(const n of e)t[n.helmPath]=n.reconciledFrom;return t})(p?.provenance),[p?.provenance]),E=a(()=>{const e=new Set;for(const t of g)for(const n of t.fields)n.componentType===ke.Dropdown&&e.add(n.helmValuePath);return e},[g]),A=a(()=>g.flatMap(e=>e.fields.map(e=>({name:e.helmValuePath,value:x("formData",e.helmValuePath)}))),[g,S,x]),[N,O]=r(!1),R=async()=>{const e=((e,t)=>{const n=(e,t,n)=>{for(let n=0;n<t.length-1;n++){const o=t[n];o in e&&"object"==typeof e[o]&&null!==e[o]||(e[o]={}),e=e[o]}e[t[t.length-1]]=n},o=JSON.parse(JSON.stringify(e));for(const e of t){const t=e.split(".");let a=o;for(const e of t){if(null==a||"object"!=typeof a){a=void 0;break}a=a[e]}"string"==typeof a&&n(o,t,a.replaceAll("-","_"))}return o})(k(C,S),E);await(async e=>{c.updateLocalUiConfig&&(b(!0),await c.updateLocalUiConfig(e),b(!1),await m())})(e),w(void 0,void 0,{})},D=a(()=>[{id:qn(),type:tn.Button,buttonProps:{"data-id":"settings-save",variant:me.Primary,size:he.S,label:"Save Changes",leftIcon:Ni,loading:f,onClick:()=>O(!0)}},{id:qn(),type:tn.Button,buttonProps:{"data-id":"settings-cancel",variant:me.Secondary,size:he.S,label:"Cancel",leftIcon:Oi,onClick:()=>w(void 0,void 0,C)}}],[f,k,C,S,w]),P=a(()=>$.map(e=>({id:e.name,label:e.displayName})),[$]),F=a(()=>$.map(e=>e.name),[$]),{selectedSection:L,setSelectedSection:_,setSectionRef:M,setScrollContainerRef:z}=mi({sectionNames:F});return e(wa,{$gap:12,children:[t(Mm,{disabled:!i,loading:u||h,tabs:P,selectedTab:L,setSelectedTab:_,onClickReset:v?()=>v().then(()=>m?.()):void 0,onClickRefresh:m?()=>m():void 0}),e(qa,{children:[!i&&t(Fl,{minSupportedVersion:n,currentVersion:l||""}),t(xn,{isOpen:T,richTitle:{icon:Fi,title:"Config Settings"},actions:D}),t(Ye,{isOpen:N,title:"Save Changes via UI?",description:"We recommend updating via your Helm values.yaml to ensure changes are version-controlled and go through a proper review process.",onClose:()=>O(!1),denyButton:{label:"Keep editing",variant:me.Secondary,onClick:()=>O(!1)},approveButton:{label:"Save changes",variant:me.Primary,onClick:()=>{R(),O(!1)}}}),e(zm,{$gap:24,$alignItems:"stretch",children:[t(Bm,{ref:z,$gap:24,$width:"100%",children:g.length?$.map(n=>t(lt,{id:n.name,ref:e=>M(n.name,e),richTitle:{icon:Fi,title:n.displayName},children:n.fields.map(n=>{if(n.isEnterpriseOnly&&!s)return null;if(n.renderCondition&&!xe(n.renderCondition,[],A))return null;const o=Te(n.componentProps||"{}",{}),a=I[n.helmValuePath];return e(q,{$gap:4,children:[t(fl,{componentType:n.componentType,inputType:o.type,name:n.helmValuePath,label:n.displayName,tooltip:n.description,badge:a?{status:"odigos-local-ui-config"===a?Re.Warning:Re.Unknown,label:a,tooltip:`This field is reconciled from the following resource: ${a}`}:void 0,disabled:n.isHelmOnly||f,value:x("formData",n.helmValuePath),setValue:e=>w(n.helmValuePath,e),dropdownOptions:o.options?.map(e=>({id:e,label:e})),dropdownNoSearch:!0,dropdownNoCheckbox:!0},n.helmValuePath),n.isHelmOnly?t(Oe,{status:Re.Info,smallIcon:!0,message:"This field can only be updated via Helm values.yaml file"}):null]},n.helmValuePath)})},n.name)):u?t(pt,{$height:"30vh",children:t(bt,{withSpinner:!0})}):t(lt,{richTitle:{icon:Fi,title:"Config Settings"},children:t(Ie,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})}),t(Xm,{children:h&&!p?.manifestYAML?t(pt,{$height:"30vh",children:t(bt,{withSpinner:!0})}):t(Rl,{title:"Effective Config YAML",yaml:p?.manifestYAML?.replaceAll(" |",""),defaultOpen:!0})})]})]})]})};export{Ss as AddActionDrawer,Kr as AddActionForm,Du as AddDataStreamModal,Os as AddDestinationDrawer,qr as AddDestinationForm,Rs as AddRuleDrawer,is as AddRuleForm,Zs as AddSourceDrawer,Mp as CentralConnections,rs as DataStreamForm,ls as DataStreamMergeWarning,ec as EditActionDrawer,tc as EditConfigDrawer,Pu as EditDataStreamModal,oc as EditDestinationDrawer,ic as EditRuleDrawer,du as EditSourceDrawer,ss as EditSourceForm,_u as ONBOARDING_DONE_MODAL_ID,Zp as Onboarding,Mu as OnboardingDone,fm as Overview,Am as PipelineCollectors,$r as RegexTesterDrawer,Rp as SamplingOnboardingModal,xu as SamplingRuleDrawer,ms as SamplingRuleForm,Lm as SamplingRules,Um as Settings,Ru as SystemDrawer,Em as TABS};
1397
+ `,ib=f(pe)`
1398
+ gap: 8px;
1399
+ width: 100%;
1400
+ align-items: center;
1401
+ `,ab=f.div`
1402
+ flex: 1;
1403
+ min-width: 0;
1404
+ `,lb=e=>"general"===e.name?0:"advanced"===e.name?2:1,rb=({minSupportedVersion:n=0})=>{const{isVersionSupported:l,version:r,isEnterprise:c}=C(n),{configApi:d}=Nl(),{data:u,loading:p}=d.useConfigYamls(),{data:h,loading:m,refetch:g}=d.useEffectiveConfig(),f=u?.configYamls??[],[b,v]=s(!1),y=a(()=>{if(!h)return{};const{manifestYAML:e,provenance:t,...o}=h;return o},[h]),{formData:S,handleFormChange:x,getNestedValue:w,getFormDiff:T,isFormDirty:k}=Ut(y);i(()=>{"{}"!==JSON.stringify(y)&&"{}"===JSON.stringify(S)&&x(void 0,void 0,y)},[y,S]);const E=a(()=>[...f].sort((e,t)=>lb(e)-lb(t)),[f]),I=a(()=>(e=>{if(!e)return{};const t={};for(const o of e)t[o.helmPath]=o.reconciledFrom;return t})(h?.provenance),[h?.provenance]),O=a(()=>{const e=new Set;for(const t of f)for(const o of t.fields)o.componentType===Te.Dropdown&&e.add(o.helmValuePath);return e},[f]),N=a(()=>f.flatMap(e=>e.fields.map(e=>({name:e.helmValuePath,value:w("formData",e.helmValuePath)}))),[f,S,w]),[$,A]=s(!1),[R,D]=s(!1),_=async()=>{const e=((e,t)=>{const o=(e,t,o)=>{for(let o=0;o<t.length-1;o++){const n=t[o];n in e&&"object"==typeof e[n]&&null!==e[n]||(e[n]={}),e=e[n]}e[t[t.length-1]]=o},n=JSON.parse(JSON.stringify(e));for(const e of t){const t=e.split(".");let i=n;for(const e of t){if(null==i||"object"!=typeof i){i=void 0;break}i=i[e]}"string"==typeof i&&o(n,t,i.replaceAll("-","_"))}return n})(T(y,S),O);await(async e=>{d.updateLocalUiConfig&&(v(!0),await d.updateLocalUiConfig(e),v(!1),await g())})(e),x(void 0,void 0,{})},P=a(()=>[{id:on(),type:ro.Button,buttonProps:{"data-id":"settings-save",variant:ge.Primary,size:me.S,label:"Save Changes",leftIcon:Fa,loading:b,onClick:()=>A(!0)}},{id:on(),type:ro.Button,buttonProps:{"data-id":"settings-cancel",variant:ge.Secondary,size:me.S,label:"Cancel",leftIcon:Ma,onClick:()=>x(void 0,void 0,y)}}],[b,T,y,S,x]),L=a(()=>E.map(e=>({id:e.name,label:e.displayName})),[E]),F=a(()=>E.map(e=>e.name),[E]),{selectedSection:M,setSelectedSection:z,setSectionRef:B,setScrollContainerRef:X}=Sa({sectionNames:F});return t(Ni,{$gap:24,children:e(tb,{children:[t(Zf,{disabled:!l,loading:p||m,onClickShowYaml:()=>D(!0),onClickReset:async()=>{await(async()=>{d.resetLocalUiConfigToDefaults&&await d.resetLocalUiConfigToDefaults()})(),await(g?.()),x(void 0,void 0,{})},onClickRefresh:g?()=>g():void 0}),e(ia,{children:[!l&&t(Jl,{minSupportedVersion:n,currentVersion:r||""}),t(Oo,{isOpen:k,richTitle:{icon:Ya,title:"Config Settings"},actions:P}),t(qe,{isOpen:$,title:"Save Changes via UI?",description:"We recommend updating via your Helm values.yaml to ensure changes are version-controlled and go through a proper review process.",onClose:()=>A(!1),denyButton:{label:"Keep editing",variant:ge.Secondary,onClick:()=>A(!1)},approveButton:{label:"Save changes",variant:ge.Primary,onClick:()=>{_(),A(!1)}}}),e(ob,{$gap:24,$alignItems:"stretch",children:[!!f.length&&t(eb,{options:L,selected:M,setSelected:z,disabled:!l}),t(nb,{ref:X,$gap:24,$width:"100%",children:f.length?E.map(n=>t(st,{id:n.name,bordered:!0,ref:e=>B(n.name,e),customTitle:t(ce,{size:ue.M,weight:500,color:de.Primary,children:n.displayName}),children:t(Z,{$gap:24,children:n.fields.map(n=>{if(n.isEnterpriseOnly&&!c)return null;if(n.renderCondition&&!ke(n.renderCondition,[],N))return null;const i=Ee(n.componentProps||"{}",{}),a=I[n.helmValuePath],l=n.componentType===Te.Toggle,r=t(ce,{size:ue.XS,weight:500,color:de.Primary,children:n.displayName}),s=(e=>{if(e)return"odigos-local-ui-config"===e?{status:Pe.Warning,label:"Edited in UI",tooltip:`Reconciled from ${e}`}:"odigos-configuration"===e?{status:Pe.Unknown,useSecondaryTone:!0,label:"Cluster config",tooltip:`Reconciled from ${e}`}:{status:Pe.Unknown,useSecondaryTone:!0,label:e,tooltip:`Reconciled from ${e}`}})(a),d=s?t(Ke,{...s}):null,u=n.description?t(ce,{size:ue.XXS,color:de.Secondary,children:n.description}):null,p=e(Z,{$gap:4,children:[e(pe,{$gap:8,$alignItems:"center",children:[r,d]}),u]}),h=t($l,{componentType:n.componentType,inputType:i.type,name:n.helmValuePath,disabled:n.isHelmOnly||b,value:w("formData",n.helmValuePath),setValue:e=>x(n.helmValuePath,e),dropdownOptions:i.options?.map(e=>({id:e,label:e})),dropdownNoSearch:!0,dropdownNoCheckbox:!0,toggleSize:Et.S},n.helmValuePath),m=n.isHelmOnly?t(Ie,{text:"This field can only be updated via the Helm values.yaml file",children:t(Ol,{})}):null;return t(Z,{$gap:8,children:l?e(pe,{$gap:12,$justifyContent:"space-between",$alignItems:"flex-start",children:[p,e(pe,{$gap:8,$alignItems:"center",children:[m,h]})]}):e(o,{children:[p,e(ib,{children:[t(ab,{children:h}),m]})]})},n.helmValuePath)})})},n.name)):p?t(mt,{$height:"30vh",children:t(yt,{withSpinner:!0})}):t(st,{richTitle:{icon:Ya,title:"Config Settings"},children:t($e,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})})]}),t(re,{isOpen:R,width:"40vw",minWidth:"480px",header:{icon:Il,title:"Effective Config YAML",onClose:()=>D(!1)},children:m&&!h?.manifestYAML?t(mt,{$height:"30vh",children:t(yt,{withSpinner:!0})}):t(Wl,{yaml:h?.manifestYAML?.replaceAll(" |",""),defaultOpen:!0,fullHeight:!0})})]})]})})};export{js as AddActionDrawer,vs as AddActionForm,Bh as AddDataStreamModal,tc as AddDestinationDrawer,Ss as AddDestinationForm,oc as AddRuleDrawer,Ns as AddRuleForm,wc as AddSourceDrawer,Ym as CentralConnections,ou as CloudConnectorStep,au as CreateCloudConnectorDrawer,Xm as CreateNewType,As as DataStreamForm,$s as DataStreamMergeWarning,ru as EditActionDrawer,su as EditConfigDrawer,Xh as EditDataStreamModal,du as EditDestinationDrawer,pu as EditRuleDrawer,bh as EditSourceDrawer,Rs as EditSourceForm,Hh as ONBOARDING_DONE_MODAL_ID,cg as Onboarding,jh as OnboardingDone,Of as Overview,Xf as PipelineCollectors,Vr as RegexTesterDrawer,zm as SamplingOnboardingModal,$h as SamplingRuleDrawer,Ms as SamplingRuleForm,Kf as SamplingRules,rb as Settings,zh as SystemDrawer,Bf as TABS};