@odigos/ui-kit 0.0.243 → 0.0.245
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/lib/chunks/{helpers-DlRedD4d.js → helpers-D-CznSVG.js} +1 -1
- package/lib/chunks/{index-Cl1o9W_f.js → index-CA2MiIDy.js} +15 -15
- package/lib/chunks/source-instrument-form-context-C002ZZ9a.js +1 -0
- package/lib/chunks/ui-components-CFTFbtTq.js +1614 -0
- package/lib/components/_v2/input-table/dynamic-field/index.d.ts +1 -0
- package/lib/components/_v2/input-table/types.d.ts +2 -1
- package/lib/components/_v2/note/index.d.ts +6 -0
- package/lib/components/_v2/typography/index.d.ts +8 -0
- package/lib/components/_v2/typography-truncatable/index.d.ts +18 -10
- package/lib/components/v2.js +1 -1
- package/lib/components.js +1 -1
- package/lib/constants/actions/index.d.ts +0 -2
- package/lib/constants/index.d.ts +1 -0
- package/lib/constants/regex.d.ts +40 -0
- package/lib/constants.js +1 -1
- package/lib/containers/_v2/_drawers/index.d.ts +1 -0
- package/lib/containers/_v2/_drawers/regex-tester-drawer/highlighter.d.ts +20 -0
- package/lib/containers/_v2/_drawers/regex-tester-drawer/index.d.ts +13 -0
- package/lib/containers/_v2/_forms/add-action-form/custom-fields/extract-attribute/index.d.ts +5 -0
- package/lib/containers/index.d.ts +0 -1
- package/lib/containers/v2.js +237 -126
- package/lib/containers.js +7 -62
- package/lib/contexts.js +1 -1
- package/lib/functions/get-action-icon/index.d.ts +2 -2
- package/lib/functions.js +1 -1
- package/lib/hooks/index.d.ts +1 -0
- package/lib/hooks/useOverflow.d.ts +26 -0
- package/lib/hooks.js +1 -1
- package/lib/snippets/v2.js +1 -1
- package/lib/snippets.js +6 -6
- package/lib/store.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/types/actions/index.d.ts +16 -21
- package/lib/types.js +1 -1
- package/lib/visuals.js +1 -1
- package/package.json +1 -1
- package/lib/chunks/source-instrument-form-context-0FWO95UV.js +0 -1
- package/lib/chunks/ui-components-D8ipj0yK.js +0 -1570
- package/lib/containers/_v2/_forms/add-action-form/custom-fields/error-sampler/index.d.ts +0 -5
- package/lib/containers/_v2/_forms/add-action-form/custom-fields/latency-sampler/index.d.ts +0 -5
- package/lib/containers/_v2/_forms/add-action-form/custom-fields/probabilistic-sampler/index.d.ts +0 -5
- package/lib/containers/_v2/_forms/add-action-form/custom-fields/service-name-sampler/index.d.ts +0 -5
- package/lib/containers/_v2/_forms/add-action-form/custom-fields/span-attribute-sampler/index.d.ts +0 -5
- package/lib/containers/notification-manager/index.d.ts +0 -4
package/lib/containers.js
CHANGED
|
@@ -1,66 +1,11 @@
|
|
|
1
|
-
import{
|
|
2
|
-
position: relative;
|
|
3
|
-
width: fit-content;
|
|
4
|
-
`,W=i(y)`
|
|
5
|
-
gap: 12px;
|
|
6
|
-
padding: 0 12px;
|
|
7
|
-
`,H=i(p)`
|
|
8
|
-
gap: 12px;
|
|
9
|
-
max-height: 400px;
|
|
10
|
-
overflow-y: auto;
|
|
11
|
-
`,U=i.div`
|
|
12
|
-
position: absolute;
|
|
13
|
-
bottom: 0;
|
|
14
|
-
left: 0;
|
|
15
|
-
width: 100%;
|
|
16
|
-
height: 45px;
|
|
17
|
-
border-radius: 0 0 24px 24px;
|
|
18
|
-
background: ${({theme:e})=>`linear-gradient(to top, ${e.colors.dropdown_bg}, transparent)`};
|
|
19
|
-
pointer-events: none;
|
|
20
|
-
`,X=i(l)`
|
|
21
|
-
background-color: ${({theme:e})=>e.colors.orange_soft};
|
|
22
|
-
color: ${({theme:e})=>e.text.primary};
|
|
23
|
-
border-radius: 32px;
|
|
24
|
-
width: fit-content;
|
|
25
|
-
padding: 2px 8px;
|
|
26
|
-
`,J=()=>{const r=n(),{notifications:i,markAsSeen:p}=o(),g=i.filter(({hideFromHistory:e})=>!e),h=g.filter(({seen:e})=>!e),u=h.length,{popupRef:m,popupOpen:y,setPopupOpen:f,popupPosition:v,handlePosition:x}=a({defaultClientHeight:420,defaultClientwidth:400,onClickOutside:()=>{u&&h.forEach(({id:e})=>p(e))}});return e(P,{children:[t(s,{onClick:()=>{x(0,0),f(e=>!e)},tooltip:"Notifications",withPing:!!u,pingColor:r.colors.orange_og,children:t(z,{size:18})}),e(c,{ref:m,isOpen:y,right:v.left,maxWidth:"400px",header:e(W,{children:[t(l,{size:20,children:"Notifications"}),!!u&&e(X,{size:12,family:"secondary",children:[u," new"]})]}),children:[t(H,{children:g.length?g.map(e=>t(re,{...e,onClick:()=>f(!1)},`notification-${e.id}`)):t(d,{title:"No notifications",subTitle:""})}),t(U,{})]})]})},Q=i.div`
|
|
27
|
-
display: flex;
|
|
28
|
-
align-items: flex-start;
|
|
29
|
-
gap: 12px;
|
|
30
|
-
padding: 16px;
|
|
31
|
-
border-radius: 16px;
|
|
32
|
-
background-color: ${({theme:e})=>e.colors.dropdown_bg_2+f["080"]};
|
|
33
|
-
cursor: not-allowed;
|
|
34
|
-
&.click-enabled {
|
|
35
|
-
cursor: pointer;
|
|
36
|
-
&:hover {
|
|
37
|
-
background-color: ${({theme:e})=>e.colors.dropdown_bg_2};
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
`,Y=i.div`
|
|
41
|
-
background-color: ${({$type:e,theme:t})=>t.text[e]+f["015"]};
|
|
42
|
-
border-radius: 8px;
|
|
43
|
-
width: 36px;
|
|
44
|
-
height: 36px;
|
|
45
|
-
display: flex;
|
|
46
|
-
align-items: center;
|
|
47
|
-
justify-content: center;
|
|
48
|
-
`,Z=i.div`
|
|
49
|
-
width: 290px;
|
|
50
|
-
`,ee=i.div`
|
|
51
|
-
margin-bottom: 6px;
|
|
52
|
-
`,te=i.div`
|
|
53
|
-
display: flex;
|
|
54
|
-
align-items: center;
|
|
55
|
-
gap: 6px;
|
|
56
|
-
`,re=({id:i,seen:o,type:a,title:s,message:c,time:d,crdType:p,target:y,onClick:f})=>{const x=n(),{formatTimeAgo:b}=g(),{onClickNotification:w}=h(),N=!!p&&!!y,S=s?.toLowerCase().includes(u.Delete.toLowerCase())||!1,k=v(a,x);return e(Q,{className:N?"click-enabled":"",onClick:()=>{N&&(f(),w({id:i,crdType:p,target:y}))},children:[t(Y,{$type:S?m.Error:a,children:t(S?E:k,{})}),e(Z,{children:[t(ee,{children:t(l,{size:14,children:c})}),e(te,{children:[t(l,{size:10,color:x.text.grey,children:b(d)}),!o&&e(r,{children:[t(l,{size:10,children:"·"}),t(l,{size:10,color:x.colors.orange_soft,children:"new"})]})]})]})]},`notification-${i}`)},ie=e=>`${w.Source}-${e}-${x.MapItem}`,ne=(e,t,r)=>{const i=e.isVirtual,n=r?[I]:i?[N(e)]:t?S(t):[R],{priorotizedStatus:o}=i?{priorotizedStatus:void 0}:k(t?.conditions||[]);return{id:e.graphKey,title:e.serviceName,icons:n,isVirtual:i,status:o,aggService:e}},oe=e=>!(!e||"user"!==e.serviceName||e.id.namespace||e.id.name||e.id.kind),ae=({theme:e,nodes:t,aggregatedServiceMap:r})=>{const i=[],n=new Map(t.map(e=>[e.id,e]));for(const t of r){const r=ie(t.graphKey),o=n.get(r);if(!o)continue;const a=o.data?.status===m.Error;for(const o of t.connections){const s=ie(o.targetGraphKey);n.has(s)&&i.push({id:`${r}-to-${s}`,type:"smoothstep",source:r,target:s,data:{sourceGraphKey:t.graphKey,targetGraphKey:o.targetGraphKey},markerEnd:{type:j.ArrowClosed},style:{stroke:a?e?.colors.dark_red:e?.colors.border}})}}return i},se=e=>{const t=e.lastIndexOf("|");return-1===t?{graphKey:e,detail:""}:{graphKey:e.substring(0,t),detail:e.substring(t+1)}},ce=new F,de=`${w.Source}-user-${x.MapItem}`,le={"elk.algorithm":"layered","elk.direction":"RIGHT","elk.layered.spacing.nodeNodeBetweenLayers":"150","elk.spacing.nodeNode":"120","elk.layered.nodePlacement.strategy":"NETWORK_SIMPLEX","elk.layered.spacing.edgeEdgeBetweenLayers":"30","elk.layered.spacing.edgeNodeBetweenLayers":"40"},pe=i.div`
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import{useState as n,useRef as i,useCallback as a,useEffect as o}from"react";import{MarkerType as s,useNodesState as c,useEdgesState as d}from"@xyflow/react";import{N as l,D as p,E as u,g,d as h,e as m,S as y,f,h as v,i as x,F as S,j as N,k as b,l as K,m as T,n as w}from"./chunks/ui-components-CFTFbtTq.js";import{UserIcon as k,ImageErrorIcon as M,ChevronDownIcon as $,ChevronRightIcon as C}from"./icons.js";import I,{useTheme as z}from"styled-components";import{E}from"./chunks/vendor-Be0cOokr.js";import{Flow as G}from"./snippets.js";import"zustand";import"javascript-time-ago";import"prism-react-renderer";import"react-error-boundary";import"react-dom";import"virtua";const R=e=>`${u.Source}-${e}-${l.MapItem}`,V=(e,t,r)=>{const n=e.isVirtual,i=r?[k]:n?[g(e)]:t?h(t):[M],{priorotizedStatus:a}=n?{priorotizedStatus:void 0}:m(t?.conditions||[]);return{id:e.graphKey,title:e.serviceName,icons:i,isVirtual:n,status:a,aggService:e}},D=e=>!(!e||"user"!==e.serviceName||e.id.namespace||e.id.name||e.id.kind),A=({theme:e,nodes:t,aggregatedServiceMap:r})=>{const n=[],i=new Map(t.map(e=>[e.id,e]));for(const t of r){const r=R(t.graphKey),a=i.get(r);if(!a)continue;const o=a.data?.status===y.Error;for(const a of t.connections){const c=R(a.targetGraphKey);i.has(c)&&n.push({id:`${r}-to-${c}`,type:"smoothstep",source:r,target:c,data:{sourceGraphKey:t.graphKey,targetGraphKey:a.targetGraphKey},markerEnd:{type:s.ArrowClosed},style:{stroke:o?e?.colors.dark_red:e?.colors.border}})}}return n},j=e=>{const t=e.lastIndexOf("|");return-1===t?{graphKey:e,detail:""}:{graphKey:e.substring(0,t),detail:e.substring(t+1)}},O=new E,_=`${u.Source}-user-${l.MapItem}`,q={"elk.algorithm":"layered","elk.direction":"RIGHT","elk.layered.spacing.nodeNodeBetweenLayers":"150","elk.spacing.nodeNode":"120","elk.layered.nodePlacement.strategy":"NETWORK_SIMPLEX","elk.layered.spacing.edgeEdgeBetweenLayers":"30","elk.layered.spacing.edgeNodeBetweenLayers":"40"},B=I.div`
|
|
57
2
|
padding: 8px 0;
|
|
58
|
-
`,
|
|
3
|
+
`,F=I.div`
|
|
59
4
|
display: flex;
|
|
60
5
|
gap: 12px;
|
|
61
6
|
align-items: center;
|
|
62
7
|
padding: 4px 0 4px 16px;
|
|
63
|
-
`,
|
|
8
|
+
`,L=I.button`
|
|
64
9
|
display: flex;
|
|
65
10
|
align-items: center;
|
|
66
11
|
gap: 4px;
|
|
@@ -74,13 +19,13 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import i,{useThe
|
|
|
74
19
|
&:hover {
|
|
75
20
|
text-decoration: underline;
|
|
76
21
|
}
|
|
77
|
-
`,
|
|
22
|
+
`,W=I.div`
|
|
78
23
|
padding: 4px 0 8px;
|
|
79
|
-
`,
|
|
24
|
+
`,P=({conn:r,onToggle:n,isExpanded:i})=>{const a=r.details.length>0;return e(B,{children:t(S,{$justifyContent:"space-between",$alignItems:"center",children:[e(v,{size:14,weight:500,children:r.targetServiceName}),a&&t(L,{onClick:n,children:[e(i?$:C,{size:12}),i?"hide attributes":`${r.details.length} attribute${r.details.length>1?"s":""}`]})]})})},U=({conn:t})=>{const n=z();return e(r,{children:t.details.map(t=>e(F,{children:e(v,{size:12,color:n.text.secondary,style:{flex:1},children:t.value})},t.value))})},H=({connections:i,isVirtual:a,attributes:o})=>{const[s,c]=n(new Set),d=z();if(a){const n=Object.entries(o||{});return t(r,{children:[e(v,{size:12,color:d.text.info,children:"This service is not instrumented. It was detected from client-side spans of services that communicate with it."}),n.length>0&&t(r,{children:[e(W,{style:{paddingTop:16},children:e(v,{size:11,color:d.text.info,children:"Attributes"})}),n.map(([r,n])=>t(F,{children:[e(v,{size:12,color:d.text.secondary,children:r}),e(v,{size:12,children:n})]},r))]})]})}return i.length?t(r,{children:[e(W,{children:e(v,{size:11,color:d.text.info,children:"Connected services"})}),i.map(r=>t("div",{children:[e(P,{conn:r,isExpanded:s.has(r.targetGraphKey),onToggle:()=>{return e=r.targetGraphKey,void c(t=>{const r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r});var e}}),s.has(r.targetGraphKey)&&e(U,{conn:r}),e(x,{})]},r.targetGraphKey))]}):e(v,{size:12,color:d.text.info,children:"No outgoing connections"})},X=({conn:n})=>{const i=z();return n?e(r,{children:n.details.length>0?t(r,{children:[e(W,{children:e(v,{size:11,color:i.text.info,children:"Attribute breakdown"})}),n.details.map(t=>e(F,{children:e(v,{size:12,style:{flex:1},children:t.value})},t.value))]}):e(v,{size:12,color:i.text.info,style:{padding:"8px 0"},children:"No attribute breakdown"})}):e(v,{size:12,color:i.text.info,children:"No data for this connection"})},J=({drawerState:t,aggregatedData:r,onClose:n})=>{if(!t)return null;const i=new Map(r.map(e=>[e.graphKey,e]));let a="",o="",s=null;if("node"===t.type){const r=i.get(t.graphKey);a=r?.serviceName||t.graphKey,o=r?.isVirtual?"Virtual service (uninstrumented)":"Outgoing connections",s=e(H,{connections:r?.connections||[],isVirtual:r?.isVirtual,attributes:r?.attributes})}else{const r=i.get(t.sourceKey),n=r?.connections.find(e=>e.targetGraphKey===t.targetKey);a=`${r?.serviceName||t.sourceKey} → ${n?.targetServiceName||t.targetKey}`,o="Connection details",s=e(X,{conn:n})}return e(f,{isOpen:!0,width:"420px",position:"right",header:{title:a,subTitle:o,onClose:n},children:s})},Q=I.div`
|
|
80
25
|
width: 100%;
|
|
81
26
|
height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px)`};
|
|
82
27
|
position: relative;
|
|
83
|
-
`,
|
|
28
|
+
`,Y={id:{namespace:"",name:"",kind:""},serviceName:"user",markedForInstrumentation:{markedForInstrumentation:!0}},Z=`${u.Source}-`,ee=`-${l.MapItem}`,te=.15,re=({heightToRemove:r,serviceMap:s,onRefresh:g})=>{const h=z(),m=N(e=>e.sources),[y,f,v]=c([]),[x,S,K]=d([]),[T,w]=n(0),[k,M]=n(null),$=i([]);$.current=y;const C=i(h);C.current=h;const I=i([]),E=i([]),B=a(()=>w(e=>e+1),[]),{activeNodeId:F,setActiveNodeType:L,setActiveNodeId:W}=b();o(()=>{if(!F)return;const e=(t=F).startsWith(Z)&&t.endsWith(ee)?t.slice(Z.length,-ee.length):null;var t;e&&M({type:"node",graphKey:e})},[F]);const P=a((e,t)=>{const{sourceGraphKey:r,targetGraphKey:n}=t.data||{};r&&n&&(L(null),W(null),M({type:"edge",sourceKey:r,targetKey:n}))},[L,W]),U=a(()=>{M(null),L(null),W(null)},[L,W]),H=a((e,t)=>{const r=t.id;S(e=>e.map(e=>e.source===r||e.target===r?{...e,animated:!0,style:{...e.style,strokeWidth:2.5},labelStyle:{...e.labelStyle,opacity:1},labelBgStyle:{...e.labelBgStyle,opacity:1}}:{...e,style:{...e.style,opacity:te},labelStyle:{...e.labelStyle,opacity:te},labelBgStyle:{...e.labelBgStyle,opacity:te}}))},[S]),X=a(()=>{S(E.current)},[S]);return o(()=>{let e=!1;const t=(e=>{const t=new Map,r=new Set,n=(e,r,n=!1)=>{let i=t.get(e);return i||(i={serviceName:r,isVirtual:n,attributes:{},connectionMap:new Map},t.set(e,i)),i},i=(e,t)=>{if(t)for(const{key:r,value:n}of t)r in e||(e[r]=n)};for(const t of e){const{graphKey:e}=j(t.nodeId),a=n(e,t.serviceName);a.isVirtual=!1;for(const e of t.services){const{graphKey:t,detail:o}=j(e?.nodeId??"");e.isVirtual&&(r.add(t),i(n(t,e.serviceName,!0).attributes,e.nodeAttributes));let s=a.connectionMap.get(t);if(s||(s={targetGraphKey:t,targetServiceName:e.serviceName,totalRequests:0,lastDateTime:e.dateTime,details:[]},a.connectionMap.set(t,s)),s.totalRequests+=e.requests,e.dateTime>s.lastDateTime&&(s.lastDateTime=e.dateTime),o){const t=s.details.find(e=>e.value===o);t?(t.requests+=e.requests,e.dateTime>t.dateTime&&(t.dateTime=e.dateTime)):s.details.push({value:o,requests:e.requests,dateTime:e.dateTime})}}}const a=[...t.entries()];for(const[,{connectionMap:e}]of a)for(const[i,a]of e)t.has(i)||n(i,a.targetServiceName,r.has(i));const o=[];for(const[e,{serviceName:r,isVirtual:n,attributes:i,connectionMap:a}]of t){const t=[...a.values()];t.sort((e,t)=>e.targetGraphKey.localeCompare(t.targetGraphKey)),o.push({graphKey:e,serviceName:r,isVirtual:n,connections:t,attributes:i})}return o.sort((e,t)=>e.graphKey.localeCompare(t.graphKey)),o})(s);I.current=t;const r=(({sources:e,aggregatedServiceMap:t})=>{const r=[],n={x:0,y:0};if(t.length&&e.length)for(const i of t){const t=R(i.graphKey),a=e.find(e=>i.serviceName===e.serviceName||i.serviceName===e.id.name);r.push({id:t,type:l.MapItem,position:n,data:V(i,a,D(a)),measured:{width:80,height:80}})}else r.push({id:`${u.Source}-${l.NoData}`,type:l.NoData,position:n,data:{subTitle:p.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return r})({aggregatedServiceMap:t,sources:[Y].concat(m)});if(1===r.length&&r[0].id===`${u.Source}-${l.NoData}`)return f(r),S([]),void(E.current=[]);const n=new Set($.current.map(e=>e.id)),i=new Set(r.map(e=>e.id)),a=r.some(e=>!n.has(e.id)),o=$.current.some(e=>!i.has(e.id));if(!(a||o)){const e=new Map($.current.map(e=>[e.id,e.position]));f(r.map(t=>({...t,position:e.get(t.id)??t.position})));const n=A({theme:C.current,nodes:r,aggregatedServiceMap:t});return E.current=n,void S(n)}return(async(e,t,r={})=>{const n={id:"root",layoutOptions:{...q,...r},children:e.map(e=>({id:e.id,width:80,height:80,...e.id===_?{layoutOptions:{"elk.layered.layering.layerConstraint":"FIRST","elk.alignment":"CENTER"}}:{}})),edges:t.map(e=>({id:e.id,sources:[e.source],targets:[e.target]}))},i=await O.layout(n),a=new Map;return i.children?.forEach(e=>{a.set(e.id,{x:e.x??0,y:e.y??0})}),{nodes:e.map(e=>({...e,position:a.get(e.id)??e.position})),edges:t}})(r,A({theme:C.current,nodes:r,aggregatedServiceMap:t})).then(({nodes:t})=>{if(e)return;f(t);const r=A({theme:C.current,nodes:t,aggregatedServiceMap:I.current});E.current=r,S(r),B()}),()=>{e=!0}},[s,m]),o(()=>{if(!$.current.length)return;const e=A({theme:h,nodes:$.current,aggregatedServiceMap:I.current});E.current=e,S(e)},[h]),t(Q,{$heightToRemove:r,children:[e(G,{nodes:y,edges:x,onNodesChange:v,onEdgesChange:K,onEdgeClick:P,onNodeMouseEnter:H,onNodeMouseLeave:X,onRefresh:g,fitViewTrigger:T,zoomOnScroll:!0}),e(J,{drawerState:k,aggregatedData:I.current,onClose:U})]})},ne=I.div`
|
|
84
29
|
position: fixed;
|
|
85
30
|
bottom: 12px;
|
|
86
31
|
left: 12px;
|
|
@@ -89,4 +34,4 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import i,{useThe
|
|
|
89
34
|
flex-direction: column-reverse;
|
|
90
35
|
gap: 6px;
|
|
91
36
|
max-width: 600px;
|
|
92
|
-
`,
|
|
37
|
+
`,ie=()=>{const{notifications:t,markAsDismissed:r,markAsSeen:n}=K(),{onClickNotification:i}=T(),a=t.filter(({dismissed:e})=>!e);return e(ne,{children:a.map(({id:t,type:o,title:s,message:c,crdType:d,target:l},p)=>{const u=c||s;if(!u)return null;const g=a.length-p;return e(w,{status:o,message:u,action:d&&l?{label:"go to details",onClick:()=>i({id:t,crdType:d,target:l},{dismissToast:!0})}:void 0,onClose:({asSeen:e})=>(({id:e,asSeen:t})=>{r(e),t&&n(e)})({id:t,asSeen:e}),zIndex:g},`toast-${t}`)})})};export{re as ServiceMap,ie as ToastList};
|
package/lib/contexts.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{A as ActionFormContextProvider,D as DataStreamFormContextProvider,a as DestinationFormContextProvider,R as RuleFormContextProvider,S as SamplingRuleFormType,b as SamplingRulesFormProvider,c as SourceEditFormContextProvider,d as SourceInstrumentFormContextProvider,u as useActionFormContext,e as useDataStreamFormContext,f as useDestinationFormContext,g as useRuleFormContext,h as useSamplingRulesFormContext,i as useSourceEditFormContext,j as useSourceInstrumentFormContext}from"./chunks/source-instrument-form-context-
|
|
1
|
+
export{A as ActionFormContextProvider,D as DataStreamFormContextProvider,a as DestinationFormContextProvider,R as RuleFormContextProvider,S as SamplingRuleFormType,b as SamplingRulesFormProvider,c as SourceEditFormContextProvider,d as SourceInstrumentFormContextProvider,u as useActionFormContext,e as useDataStreamFormContext,f as useDestinationFormContext,g as useRuleFormContext,h as useSamplingRulesFormContext,i as useSourceEditFormContext,j as useSourceInstrumentFormContext}from"./chunks/source-instrument-form-context-C002ZZ9a.js";export{O as OdigosProvider,c as checkVersionSupport,u as useOdigos}from"./chunks/helpers-D-CznSVG.js";import{jsx as r}from"react/jsx-runtime";import{useMemo as o,useContext as t,createContext as s}from"react";import"./chunks/ui-components-CFTFbtTq.js";import"styled-components";import"./icons.js";import"zustand";import"javascript-time-ago";import"./chunks/vendor-Be0cOokr.js";import"prism-react-renderer";import"react-error-boundary";import"react-dom";import"virtua";const m=s({formType:void 0}),n=({children:e,formType:t})=>{const s=o(()=>({formType:t}),[t]);return r(m.Provider,{value:s,children:e})},p=()=>t(m);export{n as StorybookProvider,p as useStorybook};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const getActionIcon: (type: ActionType
|
|
1
|
+
import { ActionType, type SVG } from '@/types';
|
|
2
|
+
export declare const getActionIcon: (type: ActionType) => SVG;
|
package/lib/functions.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{b1 as buildBadgeForDesiredStatus,f6 as capitalizeFirstLetter,f7 as cleanObjectEmptyStringsValues,ah as compareCondition,f8 as decimalsOnly,p as deepClone,di as entityIdKey,dm as filterActions,dl as filterDestinations,aW as filterDestinationsByStream,dk as filterSources,d7 as filterSourcesByStream,f9 as flattenObjectKeys,bg as formatBytes,fa as formatDuration,bR as generateId,aU as getActionIcon,e as getConditionsBooleans,bu as getContainersIcons,fb as getContainersInstrumentedCount,fc as getDeepValue,aH as getDestinationIcon,fd as getDetectedLanguageIcons,b6 as getEffectiveLanguage,bo as getEffectiveRuntimeVersion,dd as getEntityIcon,aP as getEntityId,dh as getEntityIdKey,dc as getEntityLabel,bi as getHealthBadgeLabel,fe as getIdFromSseTarget,a_ as getInstrumentationRuleIcon,ff as getMainContainerLanguage,fg as getMetricForEntity,fh as getMonitorIcon,fi as getPlatformIcon,fj as getPlatformLabel,ao as getProgrammingLanguageIcon,fk as getRecursiveValues,d as getSourceLanguageIcons,fl as getSseTargetFromId,fm as getStatusColor,ds as getStatusFromPodStatus,dg as getStatusIcon,bj as getStatusTypeFromOdigosHealth,fn as getValueForRange,g as getVirtualServiceIcon,be as getWorkloadId,aX as getYamlFieldsForDestination,fo as hasUnhealthyInstances,s as isEmpty,x as isLegalK8sLabel,bN as isOverTime,fp as isStringABoolean,fq as isTimeElapsed,bn as isValidVersion,fr as mapConditions,b4 as mapDesiredStatusToConditionStatus,aV as mapDestinationFieldsForDisplay,G as mapExportedSignals,z as mapSupportedSignals,fs as numbersOnly,ft as parseBooleanFromString,fu as parseJsonStringToPrettyString,ai as prepareDestinationFormData,fv as removeEmptyValuesFromObject,C as safeJsonParse,fw as safeJsonStringify,fx as setDeepValue,fy as sleep,aY as splitCamelString,fz as stringifyNonStringValues,t as trimVersion}from"./chunks/ui-components-CFTFbtTq.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-Be0cOokr.js";import"prism-react-renderer";import"react-error-boundary";import"react-dom";import"virtua";
|
package/lib/hooks/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export * from './useGenericForm';
|
|
|
10
10
|
export * from './useInstrumentationRuleFormData';
|
|
11
11
|
export * from './useKeyDown';
|
|
12
12
|
export * from './useOnClickOutside';
|
|
13
|
+
export * from './useOverflow';
|
|
13
14
|
export * from './useScrollIntoViewWhen';
|
|
14
15
|
export * from './useScrollTo';
|
|
15
16
|
export * from './usePopup';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type DependencyList, type RefObject } from 'react';
|
|
2
|
+
type OverflowAxis = 'horizontal' | 'vertical';
|
|
3
|
+
interface UseOverflowOptions {
|
|
4
|
+
/**
|
|
5
|
+
* Which axis to measure. `'horizontal'` checks `scrollWidth > clientWidth` (single-line
|
|
6
|
+
* ellipsis); `'vertical'` checks `scrollHeight > clientHeight` (multi-line `-webkit-line-clamp`).
|
|
7
|
+
* Defaults to `'horizontal'`.
|
|
8
|
+
*/
|
|
9
|
+
axis?: OverflowAxis;
|
|
10
|
+
/**
|
|
11
|
+
* Re-measure whenever any of these change (e.g. the rendered text). Size changes are
|
|
12
|
+
* already covered by `ResizeObserver`, so only pass values that affect content, not layout.
|
|
13
|
+
*/
|
|
14
|
+
deps?: DependencyList;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Reports whether the referenced element's content overflows along the given axis.
|
|
18
|
+
*
|
|
19
|
+
* - Reacts to size changes via `ResizeObserver`.
|
|
20
|
+
* - Re-checks after `document.fonts.ready` because custom fonts can shift text metrics
|
|
21
|
+
* between first paint and font-ready, leading to false negatives initially.
|
|
22
|
+
* - Uses a `+1` subpixel guard so rounding doesn't report overflow when there is no
|
|
23
|
+
* visual truncation.
|
|
24
|
+
*/
|
|
25
|
+
export declare const useOverflow: <T extends HTMLElement>(ref: RefObject<T | null>, { axis, deps }?: UseOverflowOptions) => boolean;
|
|
26
|
+
export {};
|
package/lib/hooks.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{fK as IGNORE_OUTSIDE_CLICK_ATTR,fL as useActionFormData,fM as useBodyScroll,db as useClickNode,m as useClickNotification,dj as useContainerSize,bh as useCopy,fN as useDataStreamFormData,fO as useDestinationFormData,o as useGenericForm,fP as useInstrumentationRuleFormData,bM as useKeyDown,bk as useOnClickOutside,fQ as useOverflow,u as usePopup,b0 as useScrollIntoViewWhen,dO as useScrollTo,da as useSessionStorage,fR as useSourceFormData,a$ as useTimeAgo}from"./chunks/ui-components-CFTFbtTq.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-Be0cOokr.js";import"prism-react-renderer";import"react-error-boundary";import"react-dom";import"virtua";
|
package/lib/snippets/v2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{ba as ActionType,dr as Actions,dq as RichTitle}from"../chunks/ui-components-CFTFbtTq.js";export{C as CancelModal,j as DURATION_OPTIONS,g as DeleteModal,e as DurationErrorsSection,D as DynamicField,N as NOISY_PERCENTAGE_OPTIONS,h as OdigosLogoTextByTier,O as OperationSection,a as PERCENTAGE_OPTIONS,f as PercentageSection,P as PresetWithCustomInput,R as RuleInfoSection,d as RuleTypeSection,b as SamplingPreviewSection,S as SignalsCheckboxList,c as SourceScopeSection,U as UpgradeModal,i as WIDE_DRAWER_WIDTH,W as WideDrawer,Y as YamlSectionCard}from"../chunks/index-CA2MiIDy.js";export{C as ColoredSpan,x as ColoredSpanVariant}from"../chunks/helpers-D-CznSVG.js";import"react/jsx-runtime";import"styled-components";import"../icons.js";import"zustand";import"react";import"javascript-time-ago";import"../chunks/vendor-Be0cOokr.js";import"prism-react-renderer";import"react-error-boundary";import"react-dom";import"virtua";
|
package/lib/snippets.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import{jsx as e,jsxs as o,Fragment as
|
|
1
|
+
import{jsx as e,jsxs as o,Fragment as t}from"react/jsx-runtime";import{memo as r,useRef as i,useEffect as n}from"react";import"./chunks/vendor-Be0cOokr.js";import d,{useTheme as s}from"styled-components";import{ac as a,R as l,eF as c,h as p,S as m,dg as u,db as h,k as g,N as b}from"./chunks/ui-components-CFTFbtTq.js";import{Handle as x,Position as f,ReactFlowProvider as v,ReactFlow as y,Controls as w,ControlButton as N,useReactFlow as k}from"@xyflow/react";import{RefreshIcon as $}from"./icons.js";import"javascript-time-ago";import"zustand";import"prism-react-renderer";import"react-error-boundary";import"react-dom";import"virtua";const C=d(l)`
|
|
2
2
|
max-width: 300px;
|
|
3
3
|
padding: 12px;
|
|
4
4
|
border-radius: 12px;
|
|
5
5
|
background-color: ${({theme:e})=>e.colors.dropdown_bg};
|
|
6
6
|
justify-content: center;
|
|
7
|
-
`,
|
|
7
|
+
`,E=r(({id:o,data:t})=>{const{title:r,subTitle:i}=t;return e(C,{"data-id":o,children:e(a,{title:r,subTitle:i})})});E.displayName=E.name;const V=d.div`
|
|
8
8
|
padding: 6px;
|
|
9
9
|
border-radius: 12px;
|
|
10
10
|
background-color: ${({theme:e})=>e.colors.dropdown_bg};
|
|
11
11
|
cursor: pointer;
|
|
12
12
|
${({$isVirtual:e,theme:o})=>e&&`\n border: 1px dashed ${o.colors.border};\n opacity: 0.8;\n `}
|
|
13
|
-
`,V=d.div`
|
|
14
|
-
position: relative;
|
|
15
13
|
`,_=d.div`
|
|
14
|
+
position: relative;
|
|
15
|
+
`,j=d.div`
|
|
16
16
|
position: absolute;
|
|
17
17
|
top: 100%;
|
|
18
18
|
margin-top: 4px;
|
|
@@ -24,7 +24,7 @@ import{jsx as e,jsxs as o,Fragment as r}from"react/jsx-runtime";import{memo as t
|
|
|
24
24
|
gap: 2px;
|
|
25
25
|
width: 140px;
|
|
26
26
|
text-align: center;
|
|
27
|
-
`,z=
|
|
27
|
+
`,z=r(({id:r,data:i})=>{const{id:n,status:d,title:a,icons:l,isVirtual:h}=i,g=s(),b=h||d!==m.Error?null:u(d,g);return o(t,{children:[e(x,{type:"source",position:f.Right,style:{visibility:"hidden"}}),e(x,{type:"target",position:f.Left,style:{visibility:"hidden"}}),o(_,{"data-id":r,children:[e(V,{$isVirtual:h,children:e(c,{id:n,icons:l,status:h?void 0:d})}),o(j,{children:[b&&e(b,{}),e(p,{size:12,style:{textAlign:"center",wordBreak:"break-word",lineHeight:"1.3"},children:a})]})]})]})});z.displayName=z.name;const M={duration:300,padding:.1,includeHiddenNodes:!0},T=d.div`
|
|
28
28
|
height: 100%;
|
|
29
29
|
.react-flow__attribution {
|
|
30
30
|
visibility: hidden;
|
|
@@ -46,4 +46,4 @@ import{jsx as e,jsxs as o,Fragment as r}from"react/jsx-runtime";import{memo as t
|
|
|
46
46
|
transform: scale(1.4);
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
`,F={[b.MapItem]:z,[b.NoData]:
|
|
49
|
+
`,F={[b.MapItem]:z,[b.NoData]:E},I=({trigger:e})=>{const{fitView:o}=k(),t=i(!0);return n(()=>{t.current?t.current=!1:e>0&&requestAnimationFrame(()=>o(M))},[e,o]),null},L=({nodes:t,edges:r,onNodesChange:i,onEdgesChange:n,fitViewTrigger:d=0,zoomOnScroll:s=!1,onEdgeClick:a,onNodeMouseEnter:l,onNodeMouseLeave:c,onRefresh:p})=>{const{onClickNode:m}=h(),{setActiveNodeType:u,setActiveNodeId:b}=g();return o(y,{zoomOnScroll:s,nodes:t,nodeTypes:F,edges:r,onNodeClick:m,onEdgeClick:a,onNodeMouseEnter:l,onNodeMouseLeave:c,onNodesChange:i,onEdgesChange:n,onBlur:()=>{u(null),b(null)},children:[e(I,{trigger:d}),e(A,{children:e(w,{position:"bottom-right",orientation:"horizontal",showInteractive:!1,showZoom:!0,showFitView:!0,fitViewOptions:M,children:p&&e(N,{onClick:p,children:e($,{size:20})})})})]})},O=o=>e(T,{children:e(v,{children:e(L,{...o})})});export{O as Flow,z as MapItemNode,E as NoDataNode};
|
package/lib/store.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{aM as ProgressKeys,k as useActiveNodeStore,fJ as useDarkMode,w as useDataStreamStore,bd as useDrawerStore,j as useEntityStore,d6 as useFilterStore,bS as useModalStore,l as useNotificationStore,aL as useProgressStore,df as useSelectedStore,dn as useSetupStore}from"./chunks/ui-components-CFTFbtTq.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-Be0cOokr.js";import"prism-react-renderer";import"react-error-boundary";import"react-dom";import"virtua";
|
package/lib/theme.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{fS as Provider,fT as animations,fU as opacity,fV as palettes}from"./chunks/ui-components-
|
|
1
|
+
export{fS as Provider,fT as animations,fU as opacity,fV as palettes}from"./chunks/ui-components-CFTFbtTq.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-Be0cOokr.js";import"prism-react-renderer";import"react-error-boundary";import"react-dom";import"virtua";
|
|
@@ -1,21 +1,13 @@
|
|
|
1
1
|
import { SignalType } from '../signals';
|
|
2
2
|
import type { Condition, SVG } from '../common';
|
|
3
|
-
export declare enum ActionCategory {
|
|
4
|
-
Attributes = "attributes",
|
|
5
|
-
Samplers = "samplers"
|
|
6
|
-
}
|
|
7
3
|
export declare enum ActionType {
|
|
8
4
|
K8sAttributes = "K8sAttributesResolver",
|
|
9
5
|
AddClusterInfo = "AddClusterInfo",
|
|
10
6
|
DeleteAttributes = "DeleteAttribute",
|
|
11
7
|
RenameAttributes = "RenameAttribute",
|
|
12
8
|
PiiMasking = "PiiMasking",
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
LatencySampler = "LatencySampler",
|
|
16
|
-
ServiceNameSampler = "ServiceNameSampler",
|
|
17
|
-
SpanAttributeSampler = "SpanAttributeSampler",
|
|
18
|
-
URLTemplatization = "URLTemplatization"
|
|
9
|
+
URLTemplatization = "URLTemplatization",
|
|
10
|
+
ExtractAttribute = "ExtractAttribute"
|
|
19
11
|
}
|
|
20
12
|
export declare enum ActionKeyTypes {
|
|
21
13
|
CollectContainerAttributes = "collectContainerAttributes",
|
|
@@ -29,12 +21,8 @@ export declare enum ActionKeyTypes {
|
|
|
29
21
|
AttributeNamesToDelete = "attributeNamesToDelete",
|
|
30
22
|
Renames = "renames",
|
|
31
23
|
PiiCategories = "piiCategories",
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
EndpointsFilters = "endpointsFilters",
|
|
35
|
-
ServicesNameFilters = "servicesNameFilters",
|
|
36
|
-
AttributeFilters = "attributeFilters",
|
|
37
|
-
UrlTemplatizationRulesGroups = "urlTemplatizationRulesGroups"
|
|
24
|
+
UrlTemplatizationRulesGroups = "urlTemplatizationRulesGroups",
|
|
25
|
+
Extractions = "extractions"
|
|
38
26
|
}
|
|
39
27
|
export interface ActionOption {
|
|
40
28
|
type?: ActionType;
|
|
@@ -77,12 +65,8 @@ export interface ActionFields {
|
|
|
77
65
|
[oldKey: string]: string;
|
|
78
66
|
} | null;
|
|
79
67
|
[ActionKeyTypes.PiiCategories]?: string[] | null;
|
|
80
|
-
[ActionKeyTypes.FallbackSamplingRatio]?: number | null;
|
|
81
|
-
[ActionKeyTypes.SamplingPercentage]?: number | null;
|
|
82
|
-
[ActionKeyTypes.EndpointsFilters]?: EndpointsFilters[] | null;
|
|
83
|
-
[ActionKeyTypes.ServicesNameFilters]?: ServicesNameFilters[] | null;
|
|
84
|
-
[ActionKeyTypes.AttributeFilters]?: AttributeFilters[] | null;
|
|
85
68
|
[ActionKeyTypes.UrlTemplatizationRulesGroups]?: UrlTemplatizationRulesGroup[] | null;
|
|
69
|
+
[ActionKeyTypes.Extractions]?: Extraction[] | null;
|
|
86
70
|
}
|
|
87
71
|
export declare enum K8sAttributesFrom {
|
|
88
72
|
Pod = "pod",
|
|
@@ -185,6 +169,17 @@ export interface TemplatizationWorkloadFilter {
|
|
|
185
169
|
kind?: WorkloadKind;
|
|
186
170
|
name?: string;
|
|
187
171
|
}
|
|
172
|
+
export declare enum ExtractionDataFormat {
|
|
173
|
+
JSON = "json",
|
|
174
|
+
SQL = "sql",
|
|
175
|
+
ResourcePath = "resource_path"
|
|
176
|
+
}
|
|
177
|
+
export interface Extraction {
|
|
178
|
+
targetAttributeName: string;
|
|
179
|
+
lookupKey?: string;
|
|
180
|
+
dataFormat?: ExtractionDataFormat | '';
|
|
181
|
+
regex?: string;
|
|
182
|
+
}
|
|
188
183
|
export interface UrlTemplatizationRulesGroup {
|
|
189
184
|
filterK8sNamespace?: string;
|
|
190
185
|
/** @deprecated Use workloadFilters instead. Kept for backward compatibility with existing CRs. */
|
package/lib/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{q as ActionKeyTypes,r as ActionType,eG as AddNodeTypes,eH as AgentInjectedReason,eI as BooleanOperation,aj as CodeAttributesKeyTypes,eJ as ConditionType,eK as Crud,K as CustomInstrumentationsKeyTypes,b2 as DesiredStateProgress,eL as DestinationTypes,eM as EdgeTypes,E as EntityTypes,a7 as ExtractionDataFormat,H as FieldTypes,L as GolangCustomProbe,J as HeadersCollectionKeyTypes,dQ as InputTypes,eN as InstallationMethod,O as InstrumentationRuleType,eO as IntrumentationStatus,M as JavaCustomProbe,eP as JsonOperation,Y as K8sAttributesFrom,Q as K8sResourceKind,eQ as K8sWorkloadContainerAgentConfigTracesHeadSamplingCheckConditionOperator,eR as ListDirection,N as NodeTypes,eS as NumberOperation,eT as OtelDistroName,eU as OtherEntityTypes,b7 as OtherStatus,aI as OtherStatusType,al as PayloadCollectionKeyTypes,P as PlatformType,eV as PodContainerLifecycleStatus,eW as PodContainerStatus,eX as PodPhase,eY as Profile,br as ProgrammingLanguages,eZ as SIGNAL_KEY_TO_TYPE,e_ as SIGNAL_TYPE_TO_KEY,e$ as SignalKey,B as SignalType,f0 as SortDirection,S as StatusType,f1 as StringOperation,T as Tier,f2 as WorkloadRolloutReason,dt as WorkloadRolloutStatus}from"./chunks/ui-components-CFTFbtTq.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-Be0cOokr.js";import"prism-react-renderer";import"react-error-boundary";import"react-dom";import"virtua";
|
package/lib/visuals.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{f3 as VISUAL_ODIGOS_LOGO_HEIGHT,f4 as VISUAL_ODIGOS_LOGO_WIDTH,eD as VisualGreenRings,f5 as VisualOdigosLogo,
|
|
1
|
+
export{f3 as VISUAL_ODIGOS_LOGO_HEIGHT,f4 as VISUAL_ODIGOS_LOGO_WIDTH,eD as VisualGreenRings,f5 as VisualOdigosLogo,c1 as VisualPurpleRings}from"./chunks/ui-components-CFTFbtTq.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-Be0cOokr.js";import"prism-react-renderer";import"react-error-boundary";import"react-dom";import"virtua";
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{useState as t,useCallback as a,useMemo as n,useContext as r,createContext as s,useRef as o,useEffect as i}from"react";import{v as l,w as d,A as c,x as m,y as u,z as p,B as h,G as f,H as g,J as v,q as b,K as y,L as S,M as D,O as E,Q as k,R as F,U as C,V as I,W as N,X as A,Y as w,Z as R,_ as P,T,E as x}from"./ui-components-D8ipj0yK.js";import{b as O,a as L,d as U,v as M,g as _,u as j}from"./helpers-DlRedD4d.js";const V={type:"",disabled:!1,name:"",notes:"",signals:[],fields:{}},K=s(null),G="All row fields are required",H="At least one row is required",q=h.LATENCY_HTTP_ROUTE,z=e=>"string"==typeof e?!e.trim():f(e),Q=(e,t)=>!!e&&t.every(t=>{const a=e[t];return Array.isArray(a)?a.length>0:!z(a)}),W=({children:r})=>{const[s,o]=t(null),i=l(V),g=a(e=>{i.resetFormData(),i.handleErrorChange(void 0,void 0,{}),e?.type&&i.handleFormChange("type",e.type),o(e)},[]),v=a(e=>{var t;i.resetFormData((({type:e,name:t,notes:a,disabled:n,signals:r,fields:s})=>({type:e,name:t||"",notes:a||"",disabled:!!n,signals:r??[],fields:s??{}}))(e)),i.handleErrorChange(void 0,void 0,{}),o((t=e.type,c.find(e=>e.type===t)??m.find(e=>e.type===t)??null))},[]),b=a(()=>{if(!s)return{errorMessage:"No action type selected",preparedFormData:d(V)};const e=(e=>{const t=d(e),a=t.fields||{},n=a[u.UrlTemplatizationRulesGroups];n?.length&&(a[u.UrlTemplatizationRulesGroups]=n.map(e=>({...e,templatizationRules:(e.templatizationRules||[]).filter(e=>!!e.template?.trim())})));const r=a[u.AttributeNamesToDelete];r?.length&&(a[u.AttributeNamesToDelete]=r.filter(e=>!!e?.trim()));const s=a[u.Renames];return s&&(a[u.Renames]=Object.fromEntries(Object.entries(s).filter(([e,t])=>!!e?.trim()&&!!t?.trim()))),t.fields=a,t})(i.formData),t={};f(e.signals)&&(t.signals=h.FIELD_IS_REQUIRED),s.type&&Object.assign(t,((e,t,a)=>{const n={},r=t.fields||{},s=a.fields||{};switch(e){case p.K8sAttributes:{const e=!(r[u.CollectContainerAttributes]||r[u.CollectReplicaSetAttributes]||r[u.CollectWorkloadId]||r[u.CollectClusterId]),t=!r[u.LabelsAttributes]?.length,a=!r[u.AnnotationsAttributes]?.length;e&&t&&a&&(n[u.CollectContainerAttributes]="Enable at least one option or add a label/annotation row");const s=r[u.LabelsAttributes];s?.some(e=>!Q(e,["labelKey","attributeKey","fromSources"]))&&(n[u.LabelsAttributes]=G);const o=r[u.AnnotationsAttributes];o?.some(e=>!Q(e,["annotationKey","attributeKey","fromSources"]))&&(n[u.AnnotationsAttributes]=G);break}case p.AddClusterInfo:{const e=r[u.ClusterAttributes];e?.length?e.some(e=>!Q(e,["attributeName","attributeStringValue"]))&&(n[u.ClusterAttributes]=G):n[u.ClusterAttributes]=H;break}case p.DeleteAttributes:{const e=s[u.AttributeNamesToDelete]||[],t=r[u.AttributeNamesToDelete]||[];t.length?e.length>t.length&&(n[u.AttributeNamesToDelete]=G):n[u.AttributeNamesToDelete]=e.length?G:H;break}case p.RenameAttributes:{const e=Object.entries(s[u.Renames]||{}),t=Object.entries(r[u.Renames]||{}),a=e.some(([e,t])=>!e?.trim()||!t?.trim());t.length?a&&(n[u.Renames]=G):n[u.Renames]=e.length?G:H;break}case p.PiiMasking:{const e=r[u.PiiCategories];e?.length||(n[u.PiiCategories]="Select at least one attribute to mask");break}case p.ErrorSampler:z(r[u.FallbackSamplingRatio])&&(n[u.FallbackSamplingRatio]=h.FIELD_IS_REQUIRED);break;case p.ProbabilisticSampler:z(r[u.SamplingPercentage])&&(n[u.SamplingPercentage]=h.FIELD_IS_REQUIRED);break;case p.LatencySampler:{const e=r[u.EndpointsFilters];e?.length?e.some(e=>!Q(e,["serviceName","httpRoute","minimumLatencyThreshold","fallbackSamplingRatio"]))?n[u.EndpointsFilters]=G:e.some(e=>!!e.httpRoute&&!e.httpRoute.startsWith("/"))&&(n[u.EndpointsFilters]=q):n[u.EndpointsFilters]=H;break}case p.ServiceNameSampler:{const e=r[u.ServicesNameFilters];e?.length?e.some(e=>!Q(e,["serviceName","samplingRatio","fallbackSamplingRatio"]))&&(n[u.ServicesNameFilters]=G):n[u.ServicesNameFilters]=H;break}case p.SpanAttributeSampler:{const e=r[u.AttributeFilters],t=["stringCondition","numberCondition","booleanCondition","jsonCondition"],a=new Set(["exists","is_valid_json","is_invalid_json","jsonpath_exists"]);e?.length?e.some(e=>{if(!Q(e,["serviceName","attributeKey","fallbackSamplingRatio"]))return!0;const n=e.condition||{},r=t.find(e=>!!n[e]);if(!r)return!0;const s=n[r]||{},o=s.operation;return!o||!(a.has(o)||!z(s.expectedValue))})&&(n[u.AttributeFilters]=G):n[u.AttributeFilters]=H;break}case p.URLTemplatization:{const e=r[u.UrlTemplatizationRulesGroups];(!e?.length||e.some(e=>!e.templatizationRules?.length))&&(n[u.UrlTemplatizationRulesGroups]="Each rule group needs at least one non-blank template");break}}return n})(s.type,e,i.formData)),i.handleErrorChange(void 0,void 0,t);return{errorMessage:Object.keys(t).length>0?"Invalid form values":void 0,preparedFormData:e}},[i,s]),y=n(()=>({selectedOption:s,onSelectOption:g,loadAction:v,genericForm:i,validateFormData:b}),[s,g,v,i,b]);return e(K.Provider,{value:y,children:r})},J=()=>{const e=r(K);if(!e)throw new Error("useActionFormContext must be used within an ActionFormContextProvider");return e},$={name:""},B=s(null),X=({children:r,defaultExcludeName:s=""})=>{const{dataStreams:i}=g(),[c,m]=t(void 0),[u,p]=t(s),[f,b]=t(void 0),[y,S]=t(null),D=o(null),E=l($),k=a(e=>{E.resetFormData({name:e}),E.handleErrorChange(void 0,void 0,{}),m(void 0),p(e),b(e),S(null),D.current=null},[]),F=a(()=>{const e=d(E.formData),t=(e=>{const t={};return e.name?v(e.name)||(t.name=h.ILLEGAL_K8S_LABEL):t.name=h.FIELD_IS_REQUIRED,t})(e);E.handleErrorChange(void 0,void 0,t);const a=Object.keys(t).length>0?h.REQUIRED_FIELDS:void 0;return m(a),{errorMessage:a,preparedFormData:e}},[E]),C=a(async e=>{const{errorMessage:t,preparedFormData:a}=F();if(t)return;const n=i.find(e=>e.name===a.name&&e.name!==u);if(n)return D.current=e,void S({preparedFormData:a,existingName:n.name,editingName:f});await e(a)},[F,i,u,f]),I=a(async()=>{const e=D.current,t=y?.preparedFormData;D.current=null,S(null),e&&t&&await e(t)},[y]),N=a(()=>{D.current=null,S(null)},[]),A=n(()=>({genericForm:E,loadDataStream:k,editingName:f,validateFormData:F,requestSubmit:C,pendingMerge:y,confirmMerge:I,cancelMerge:N,errorMessage:c,excludeName:u,setExcludeName:p}),[E,k,f,F,C,y,I,N,c,u]);return e(B.Provider,{value:A,children:r})},Y=()=>{const e=r(B);if(!e)throw new Error("useDataStreamFormContext must be used within a DataStreamFormContextProvider");return e},Z={type:"",name:"",currentStreamName:"",disabled:!1,exportedSignals:{logs:!1,metrics:!1,traces:!1,profiles:!1},fields:[]},ee={activeForm:null,onChangeActiveForm:()=>{},loadDestination:()=>{},genericForm:void 0,validateFormData:()=>({isOk:!1,preparedFormData:d(Z)}),unsavedDestinations:[],thisUnsavedDestination:void 0,setUnsavedDestinations:()=>{},addUnsavedDestination:()=>{},updateUnsavedDestination:()=>{},deleteUnsavedDestination:()=>{}},te=s(ee),ae=e=>e.filter(e=>!!e).map(e=>{const{name:t,componentType:a,componentProperties:n,displayName:r,initialValue:s,renderCondition:o}=e,i=a===F.Dropdown,l=E(n,{});return{componentType:a,renderCondition:o,name:t,title:r,value:s,placeholder:l.placeholder||(i?"Select an option":void 0),options:i&&Array.isArray(l.values)?l.values.map(e=>({id:e,label:e})):void 0,...l}}),ne=({children:r})=>{const{selectedStreamName:s}=g(),o=b(e=>e.destinations),[c,m]=t(null),[u,p]=t(ee.unsavedDestinations),v=n(()=>"number"==typeof c?.unsavedIdx?u[c.unsavedIdx]:void 0,[c,u]),F=a((e,t)=>{c&&(p(t=>[...t,{...e,option:c.option}]),m(t?e=>e?{...e,listType:y.UNSAVED,unsavedIdx:u.length}:null:null))},[c,u.length]),C=a((e,t,a)=>{c&&(p(a=>a.map((a,n)=>n===e?{...a,...t,option:c.option}:a)),m(a?e=>e?{...e,listType:y.UNSAVED}:null:null))},[c]),I=a(e=>{p(t=>t.filter((t,a)=>a!==e)),m(null)},[]),N=l({...Z,currentStreamName:s});i(()=>{if(!c)return;if(v)return void N.resetFormData({...v.formData});if(c.listType===y.EXISTS&&c.option.id){const e=o.find(e=>e.id===c.option.id);if(e)return void N.resetFormData({type:e.destinationType.type,name:e.name||e.destinationType.displayName,currentStreamName:s,disabled:!!e.disabled,exportedSignals:{logs:!!e.exportedSignals?.logs,metrics:!!e.exportedSignals?.metrics,traces:!!e.exportedSignals?.traces,profiles:!!e.exportedSignals?.profiles},fields:c.dynamicFields.map(e=>({key:e.name,value:e.value}))})}const e=S(c.option.supportedSignals);N.resetFormData({type:c.option.type,name:c.option.displayName,currentStreamName:s,disabled:!1,exportedSignals:{logs:e.includes(D.Logs),metrics:e.includes(D.Metrics),traces:e.includes(D.Traces),profiles:e.includes(D.Profiles)},fields:c.dynamicFields.map(e=>({key:e.name,value:e.value}))})},[c,v]);const A=a(e=>{N.resetFormData(),N.handleErrorChange(void 0,void 0,{}),m(e?{...e,dynamicFields:e.option?.fields?ae(e.option.fields):[]}:null)},[]),w=a((e,t)=>{let a;for(const n of t){const t=n.items.find(t=>t.type===e.destinationType.type);if(t){a=t;break}}const n=E(e.fields,{}),r={id:e.id,type:e.destinationType.type,displayName:e.name||e.destinationType.displayName,selected:!0,testConnectionSupported:a?.testConnectionSupported??!1,supportedSignals:e.destinationType.supportedSignals,fields:a?a.fields.map(e=>({...e,initialValue:n[e.name]??e.initialValue})):[]},s=ae(r.fields);m({listType:y.EXISTS,option:r,dynamicFields:s})},[]),R=a(()=>{const e=d(N.formData),t={};c?.dynamicFields.forEach(({name:a,required:n})=>{if(n){const n=e.fields.find(e=>e.key===a)?.value;f(n)&&(t[a]=h.FIELD_IS_REQUIRED)}});return k(e.exportedSignals).length||(t.exportedSignals=h.FIELD_IS_REQUIRED),N.handleErrorChange(void 0,void 0,t),{errorMessage:0===Object.keys(t).length?void 0:"Invalid form values",preparedFormData:e}},[N,c]);return e(te.Provider,{value:{activeForm:c,onChangeActiveForm:A,loadDestination:w,genericForm:N,validateFormData:R,unsavedDestinations:u,thisUnsavedDestination:v,setUnsavedDestinations:p,addUnsavedDestination:F,updateUnsavedDestination:C,deleteUnsavedDestination:I},children:r})},re=()=>r(te),se={disabled:!1,ruleName:"",notes:"",workloads:null,instrumentationLibraries:null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:null},oe=s(null),ie=({children:r})=>{const[s,o]=t(null),i=l(se),c=a(e=>{i.resetFormData(),i.handleErrorChange(void 0,void 0,{}),o(e)},[]),m=a(e=>{var t;i.resetFormData((({ruleName:e,notes:t,disabled:a,workloads:n,instrumentationLibraries:r,payloadCollection:s,codeAttributes:o,headersCollection:i,customInstrumentations:l})=>({ruleName:e||"",notes:t||"",disabled:!!a,workloads:n??null,instrumentationLibraries:r??null,payloadCollection:s??null,codeAttributes:o??null,headersCollection:i??null,customInstrumentations:l??null}))(e)),i.handleErrorChange(void 0,void 0,{}),o((t=e.type,C.find(e=>e.type===t)??null))},[]),u=a(()=>{if(!s)return{errorMessage:"No rule type selected",preparedFormData:d(se)};const e=(e=>{const t=d(e);return t.headersCollection?.[I.HeaderKeys]?.length&&(t.headersCollection[I.HeaderKeys]=t.headersCollection[I.HeaderKeys].map(e=>e.trim()).filter(e=>e)),t.customInstrumentations?.[N.Golang]?.length&&(t.customInstrumentations[N.Golang]=t.customInstrumentations[N.Golang].map(e=>new A(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)).filter(e=>{return t=e,!!(t.packageName?.trim()||t.functionName?.trim()||t.receiverName?.trim()||t.receiverMethodName?.trim());var t})),t.customInstrumentations?.[N.Java]?.length&&(t.customInstrumentations[N.Java]=t.customInstrumentations[N.Java].map(e=>new w(e.className,e.methodName)).filter(e=>{return t=e,!(!t.className?.trim()&&!t.methodName?.trim());var t})),t})(i.formData),t=((e,t)=>{const a={};switch(e){case R.CodeAttributes:Object.values(t.codeAttributes||{}).some(e=>null!=e)||(a.codeAttributes="Code attributes are required");break;case R.PayloadCollection:Object.values(t.payloadCollection||{}).some(e=>null!=e)||(a.payloadCollection="Payload collection are required");break;case R.HeadersCollection:t.headersCollection?.[I.HeaderKeys]?.length||(a.headersCollection="Header keys are required");break;case R.CustomInstrumentation:{const e=t.customInstrumentations?.[N.Golang]||[],n=t.customInstrumentations?.[N.Java]||[];if(!e.length&&!n.length){a.customInstrumentations="Custom instrumentation are required";break}const r=e.findIndex(e=>!new A(e.packageName,e.functionName,e.receiverName,e.receiverMethodName).Verify());if(-1!==r){a.customInstrumentations=`Golang probe #${r+1} is invalid: provide a package name plus either a function name OR both a receiver name and receiver method name`;break}const s=n.findIndex(e=>!new w(e.className,e.methodName).Verify());if(-1!==s){a.customInstrumentations=`Java probe #${s+1} is invalid: both class name and method name are required`;break}break}}return a})(s.type,e);return i.handleErrorChange(void 0,void 0,t),{errorMessage:Object.keys(t).length>0?"Invalid form values":void 0,preparedFormData:e}},[i,s]),p=n(()=>({selectedOption:s,onSelectOption:c,loadRule:m,genericForm:i,validateFormData:u}),[s,c,m,i,u]);return e(oe.Provider,{value:p,children:r})},le=()=>{const e=r(oe);if(!e)throw new Error("useRuleFormContext must be used within a RuleFormContextProvider");return e};var de;!function(e){e.Create="create",e.View="view",e.EditAutoNoisy="edit-auto-noisy",e.EditAutoCostReduction="edit-auto-cost-reduction",e.EditAutoHighlyRelevant="edit-auto-highly-relevant"}(de||(de={}));const ce=s(null),me=["50","25","10","1"];function ue(e){const t=String(e);return me.includes(t)?t:"custom"}const pe=({category:r,sourceOptions:s=[],namespaceOptions:o=[],children:d})=>{const{formData:c,handleFormChange:m,resetFormData:u}=l(_(r)),[p,h]=t(null);i(()=>{u(_(r)),h(null)},[r]);const f=a(e=>{h(null),m(void 0,void 0,{...c,...e})},[c,m]),g=a(()=>{u(_(r)),h(null)},[r,u]),v=n(()=>({formType:de.Create,category:r,formData:c,handleChange:f,resetForm:g,duplicateWarning:p,setDuplicateWarning:h,sourceOptions:s,namespaceOptions:o}),[r,c,f,g,p,s,o]);return e(ce.Provider,{value:v,children:d})},he=({data:r,defaultEditMode:s,sourceOptions:d=[],namespaceOptions:c=[],children:m})=>{const[u,p]=t(!1),{formData:h,handleFormChange:f,resetFormData:g}=l(void 0),v=o(null),[b,y]=t(null);i(()=>{r!==v.current&&(v.current=r,r&&s?(g(M(r)),y(null),p(!0)):(p(!1),y(null)))},[r,s]);const S=a(e=>{y(null),f(void 0,void 0,{...h,...e})},[h,f]),D=a(()=>{r&&(g(M(r)),y(null),p(!0))},[r,g]),E=a(()=>{p(!1),y(null)},[]),k=n(()=>({formType:de.View,data:r,isEditing:u,formData:h,handleChange:S,handleEdit:D,handleCancelEdit:E,duplicateWarning:b,setDuplicateWarning:y,sourceOptions:d,namespaceOptions:c}),[r,u,h,S,D,E,b,d,c]);return e(ce.Provider,{value:k,children:m})};function fe(e){const[a,r]=t(()=>0===e?"all":"sample"),[s,o]=t(()=>ue(e)),[l,d]=t(()=>"custom"===ue(e)?String(e):"");i(()=>{r(0===e?"all":"sample");const t=ue(e);o(t),d("custom"===t?String(e):"")},[e]);const c=n(()=>"all"===a?0:"custom"===s?Number(l)||0:Number(s),[a,s,l]);return{percentageMode:a,setPercentageMode:r,percentagePreset:s,setPercentagePreset:o,customPercentage:l,setCustomPercentage:d,resolvedPercentage:c}}const ge=({enabled:a,keepPercentage:r,children:s})=>{const[o,l]=t(a),d=fe(r);i(()=>{l(a)},[a]);const c=n(()=>U({enabled:o,keepPercentage:d.resolvedPercentage}),[o,d.resolvedPercentage]),m=n(()=>({formType:de.EditAutoNoisy,localEnabled:o,setLocalEnabled:l,...d,summary:c}),[o,d,c]);return e(ce.Provider,{value:m,children:s})},ve=({enabled:a,dropPercentage:r,children:s})=>{const[o,l]=t(a),d=fe(r);i(()=>{l(a)},[a]);const c=n(()=>L(o?{disabled:!1,percentageAtMost:d.resolvedPercentage}:null),[o,d.resolvedPercentage]),m=n(()=>({formType:de.EditAutoCostReduction,localEnabled:o,setLocalEnabled:l,...d,summary:c}),[o,d,c]);return e(ce.Provider,{value:m,children:s})},be=({enabled:a,children:r})=>{const[s,o]=t(a);i(()=>{o(a)},[a]);const l=n(()=>O(s?{disabled:!1}:null),[s]),d=n(()=>({formType:de.EditAutoHighlyRelevant,localEnabled:s,setLocalEnabled:o,summary:l}),[s,l]);return e(ce.Provider,{value:d,children:r})},ye=t=>{switch(t.formType){case de.Create:return e(pe,{...t});case de.View:return e(he,{...t});case de.EditAutoNoisy:return e(ge,{...t});case de.EditAutoCostReduction:return e(ve,{...t});case de.EditAutoHighlyRelevant:return e(be,{...t})}};function Se(e){const t=r(ce);if(!t)throw new Error("useSamplingRulesFormContext must be used within a SamplingRulesFormProvider");if(e&&t.formType!==e)throw new Error(`Expected formType "${e}" but found "${t.formType}"`);return t}const De={otelServiceName:"",currentStreamName:""},Ee=s(null),ke=({children:r})=>{const[s,o]=t(void 0),i=l(De),c=a(e=>{i.resetFormData((({serviceName:e,id:t})=>({otelServiceName:e||t.name||"",currentStreamName:""}))(e)),i.handleErrorChange(void 0,void 0,{}),o(void 0)},[]),m=a(()=>{const e=d(i.formData);return i.handleErrorChange(void 0,void 0,{}),o(void 0),{errorMessage:void 0,preparedFormData:e}},[i]),u=n(()=>({loadSource:c,genericForm:i,validateFormData:m,errorMessage:s}),[c,i,m,s]);return e(Ee.Provider,{value:u,children:r})},Fe=()=>{const e=r(Ee);if(!e)throw new Error("useSourceEditFormContext must be used within a SourceEditFormContextProvider");return e},Ce=new Set([P.StaticPod]),Ie=e=>{const t=e.workloads.filter(({selected:e})=>e).length,a=e.workloads.length;return{selectedCount:t,isAllSourced:t>0&&t===a,isSomeSourced:t>0&&t<a,isFutureApps:e.selected||!1}},Ne=(e,t,a)=>{if(t&&!e.name.toLowerCase().includes(t.toLowerCase()))return!1;if(a.showOnlySelected){const{isAllSourced:t,isSomeSourced:a,isFutureApps:n}=Ie(e);return t||a||n}return!0},Ae=(e,t,a)=>!(t&&!e.name.toLowerCase().includes(t.toLowerCase()))&&(!a.showOnlySelected||e.selected),we=s({snapshots:null,setSnapshots:()=>{},isFetching:!1,setIsFetching:()=>{},formData:[],handleSourceChange:()=>{},handleSelectAll:()=>{},formDiff:{},isFormDirty:!1}),Re=({children:r,selectedConnectionIds:s,initialInputs:o})=>{const{tier:l}=j(),c=l===T.Onprem,{selectedStreamName:m}=g(),[u,p]=t(!1),[h,f]=t(null),[v,b]=t([]);i(()=>{h&&b(e=>{const t=((e,t)=>d(((e,t)=>e.clusters.filter(({clusterId:e})=>!t||t.includes(e)))(e,t)))(h,s);return t.map(t=>{const a=e?.find(e=>e.clusterId===t.clusterId),n=a??t;if(o?.[t.clusterId]){const e=o[t.clusterId],a=d(n);return e.forEach(e=>{const t=a.namespaces.find(t=>t.name===e.namespace);if(t)if(e.name&&e.kind){const a=t.workloads.find(t=>t.name===e.name&&t.kind===e.kind);a&&(a.selected=e.selected)}else t.selected=e.selected,e.selected&&t.workloads.forEach(e=>{Ce.has(e.kind)&&!c||(e.selected=!0)})}),a}return n})})},[h,s,o]);const{formDiff:y,isFormDirty:S}=n(()=>{const e=((e,t,a)=>{const n={};return e.forEach(e=>{e.namespaces.forEach(r=>{const s=t.find(t=>t.clusterId===e.clusterId)?.namespaces.find(e=>e.name===r.name),o=r.selected||!1;if(o!==s?.selected)n[e.clusterId]||(n[e.clusterId]=[]),n[e.clusterId].push({namespace:r.name,selected:o,currentStreamName:a}),o?n[e.clusterId]=n[e.clusterId].filter(e=>e.namespace!==r.name||e.namespace===r.name&&(!e.name||!e.kind)):r.workloads.forEach(t=>{t.selected&&n[e.clusterId].push({namespace:r.name,name:t.name,kind:t.kind,selected:!0,currentStreamName:a})});else{const t=((e,t,a)=>{const n=[];return t.workloads.forEach(r=>{const s=e?.workloads.find(e=>e.name===r.name&&e.kind===r.kind);r.selected!==s?.selected&&n.push({namespace:t.name,name:r.name,kind:r.kind,selected:r.selected||!1,currentStreamName:a})}),n})(s,r,a);t.length>0&&(n[e.clusterId]||(n[e.clusterId]=[]),n[e.clusterId].push(...t))}})}),n})(v,h?.clusters||[],m);return{formDiff:e,isFormDirty:Object.keys(e).length>0}},[v,h,m]),D=a(e=>!c&&Ce.has(e),[c]),E=a(({clusterId:e,workloadId:t,selected:a,auto:n})=>{b(r=>{const s=d(r),o=s.findIndex(t=>t.clusterId===e);if(-1===o)return s;const i=s[o].namespaces.findIndex(e=>e.name===t.namespace);if(-1===i)return s;if(t.kind&&t.name){const e=s[o].namespaces[i].workloads.findIndex(e=>e.name===t.name&&e.kind===t.kind);if(-1===e)return s;const n="boolean"==typeof a?a:!s[o].namespaces[i].workloads[e].selected;if(s[o].namespaces[i].workloads[e].selected=n,n){s[o].namespaces[i].workloads.filter(e=>!D(e.kind)).every(e=>e.selected)&&(s[o].namespaces[i].selected=!0)}else s[o].namespaces[i].selected=!1}else{const e="boolean"==typeof n?n:!s[o].namespaces[i].selected;s[o].namespaces[i].selected=e,e?s[o].namespaces[i].workloads.forEach(e=>{D(e.kind)||(e.selected=!0)}):"boolean"!=typeof a||a||s[o].namespaces[i].workloads.forEach(e=>{e.selected=!1})}return s})},[D]),k=a(({clusterId:e,namespaceName:t,boolean:a,searchText:n="",searchBy:r="",filters:s})=>{b(o=>{const i=d(o),l=r===x.Namespace?n:"",c=r===x.Source?n:"",m=!!l||!!c||!!s?.showOnlySelected;return i.forEach((n,r)=>{e&&n.clusterId!==e||n.namespaces.forEach(({name:e,workloads:n},o)=>{if(!t||e===t)if(m)if(t){n.forEach((e,t)=>{a&&D(e.kind)||Ae(e,c,s||{showOnlySelected:!1})&&(i[r].namespaces[o].workloads[t].selected=a)});const e=i[r].namespaces[o].workloads.filter(e=>!D(e.kind)).every(e=>e.selected);i[r].namespaces[o].selected=e}else{if(!Ne(i[r].namespaces[o],l,s||{showOnlySelected:!1}))return;i[r].namespaces[o].selected=a,n.forEach((e,t)=>{a&&D(e.kind)||(i[r].namespaces[o].workloads[t].selected=a)})}else i[r].namespaces[o].selected=a,n.forEach((e,t)=>{a&&D(e.kind)||(i[r].namespaces[o].workloads[t].selected=a)})})}),i})},[D]);return e(we.Provider,{value:{snapshots:h,setSnapshots:f,isFetching:u,setIsFetching:p,formData:v,handleSourceChange:E,handleSelectAll:k,formDiff:y,isFormDirty:S},children:r})},Pe=()=>r(we);export{W as A,X as D,Ce as E,ie as R,de as S,ne as a,ye as b,ke as c,Re as d,Y as e,re as f,le as g,Se as h,Fe as i,Pe as j,Ae as k,Ne as l,Ie as m,J as u};
|