@odigos/ui-kit 0.0.274 → 0.0.275
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 +9 -0
- package/docs/api-context.md +6 -2
- package/lib/chunks/{helpers-9QRquBS1.js → helpers-BkaWRtR9.js} +1 -1
- package/lib/chunks/{index-BesD_mee.js → index-D3cEk2g_.js} +1 -1
- package/lib/chunks/source-instrument-form-context-B40tRNcP.js +5 -0
- package/lib/chunks/{ui-components-i5FUYiX9.js → ui-components-BUMZXMZ4.js} +1 -1
- package/lib/components.js +1 -1
- package/lib/constants/strings/index.d.ts +0 -1
- package/lib/constants.js +1 -1
- package/lib/containers.js +4 -4
- package/lib/contexts/odigos-api/hooks/use-namespace-api.d.ts +16 -1
- package/lib/contexts/odigos-api/hooks/use-snapshots-api.d.ts +17 -2
- package/lib/contexts/odigos-api/use-api-query.d.ts +3 -1
- package/lib/contexts.js +1 -1
- package/lib/functions.js +1 -1
- package/lib/hooks.js +1 -1
- package/lib/snippets.js +1 -1
- package/lib/store.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/types.js +1 -1
- package/lib/visuals.js +1 -1
- package/package.json +1 -1
- package/lib/chunks/source-instrument-form-context-fYKmw6ZG.js +0 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.275](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.274...ui-kit-v0.0.275) (2026-07-28)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **add-source-drawer:** skip GetNamespacesWithWorkloads when a cluster snapshot is available ([#1132](https://github.com/odigos-io/ui-kit/issues/1132)) ([b347c42](https://github.com/odigos-io/ui-kit/commit/b347c42a9d3bf9491dfa76fe5d3148dcf3a0b2fe))
|
|
9
|
+
* remove No Crashloop badge from container status (PLAT-1323) ([#1133](https://github.com/odigos-io/ui-kit/issues/1133)) ([2f665f3](https://github.com/odigos-io/ui-kit/commit/2f665f3188cfea7dfd11ddf61cc3059df976ccb6))
|
|
10
|
+
* show connections table skeleton on initial load (PLAT-1297) ([#1134](https://github.com/odigos-io/ui-kit/issues/1134)) ([cca9fc5](https://github.com/odigos-io/ui-kit/commit/cca9fc5d569d158fa4ea74d5b1eb611a02023cbe))
|
|
11
|
+
|
|
3
12
|
## [0.0.274](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.273...ui-kit-v0.0.274) (2026-07-28)
|
|
4
13
|
|
|
5
14
|
|
package/docs/api-context.md
CHANGED
|
@@ -396,6 +396,10 @@ export const Columns: FC = () => {
|
|
|
396
396
|
|
|
397
397
|
Symptoms of forgetting to call the sub-hook: empty lists in the UI, `loading` permanently `false`, no auto-refresh on SSE. The fix is always to call the missing `use…()` sub-hook. Containers that only call imperative methods (create / update / delete / fetchAll) never call the sub-hook — the domain still exposes those methods, just without any auto-fetch.
|
|
398
398
|
|
|
399
|
+
Calling a sub-hook is an unconditional hook call, but it doesn't have to be an unconditional _request_: pass `{ skip }` to gate one read behind another. The `<AddSourceDrawer>` does this (PLAT-1345). It prefers `useSnapshots()`, and `useNamespaces()` is only its fallback for contexts without a snapshot — the single-cluster webapp (no snapshot op at all), a proxy the host blocks via `canRun` (central-ui's < v1.20 or VM proxies), or a modern proxy whose snapshot isn't in Redis yet. Since `GET_NAMESPACES_WITH_WORKLOADS` is a cluster-wide workload inventory travelling over the proxy WebSocket, firing it alongside the snapshot would mean paying for both round-trips and saving nothing — the exact cost the snapshot path was introduced to avoid (PLAT-1302).
|
|
400
|
+
|
|
401
|
+
The gate is `{ skip: snapshotsPending || !!snapshotsData }`. `pending` (not `loading`) is what makes it work: it's `true` only while the snapshot outcome is still unknown, so a blocked or absent snapshot op reports `pending: false` on the very first render and the fallback fires immediately, while a healthy snapshot suppresses the fallback for good. Gating on `!snapshotsData` alone would fire the fallback on the first render, before the snapshot had any chance to land.
|
|
402
|
+
|
|
399
403
|
| Container | Reactive sub-hooks called |
|
|
400
404
|
| --------------------------------------- | ------------------------------------------------------------------------------- |
|
|
401
405
|
| `_v2/overview/columns` | `useSources()`, `useDestinations()`, `useActions()`, `useRules()` |
|
|
@@ -407,7 +411,7 @@ Symptoms of forgetting to call the sub-hook: empty lists in the UI, `loading` pe
|
|
|
407
411
|
| `service-map` | `useSources()` |
|
|
408
412
|
| `_v2/_drawers/edit-source-drawer/peers` | `useSources()` |
|
|
409
413
|
| `_v2/_drawers/system-drawer/diagnose` | `useNamespaces()` |
|
|
410
|
-
| `_v2/_drawers/add-source-drawer` | `useSnapshots()`, `useNamespaces()`
|
|
414
|
+
| `_v2/_drawers/add-source-drawer` | `useSnapshots()`, `useNamespaces()` (gated — see below) |
|
|
411
415
|
| `_v2/_drawers/add-destination-drawer` | `useDestinations()`, `useDestinationCategories()`, `usePotentialDestinations()` |
|
|
412
416
|
| `contexts/destination-form-context` | `useDestinations()` |
|
|
413
417
|
|
|
@@ -475,7 +479,7 @@ graph LR
|
|
|
475
479
|
|
|
476
480
|
**Reset.** Central-ui bumps `ApolloConfig.clientKey` (via an `apolloCacheEpoch` on the proxy store) when switching proxies and on every out-of-proxy navigation. That recreates the ApolloClient with an empty cache and orphans any in-flight writes onto the discarded client — the reliable hard boundary for multi-proxy caching. Soft alternative: `useOdigosApi().resetCache()` → `client.cache.reset()`, which does **not** abort in-flight queries (avoids Apollo error #42) but also cannot stop those responses from writing the previous proxy's data back into the cleared cache. Prefer `clientKey` for proxy switches; use `resetCache` when you only need to drop entities without tearing down the client.
|
|
477
481
|
|
|
478
|
-
**Precondition guards (`Operation.canRun`).** An `Operation` may declare `canRun?(ctx): boolean`. When it returns `false`, `useApiQuery` / `useApiLazyQuery` / `useApiMutation` skip the dispatch (no network request, no Apollo observer) and the imperative `runQuery` / `runMutation` short-circuit to `{ data: undefined }` with no error (so domain hooks don't toast). central-ui sets `canRun: (ctx) => !!ctx.proxyID && !!getVersionedQuery(...)` on every `REMOTE_FETCH`-backed op: out-of-proxy pages have no selected proxy, so without the guard the kit would fire an empty `RemoteFetch($proxyID, $query, $variables)` with both required vars missing. The multi-cluster fan-out path (`runMulti` / `transformVariablesMulti`) is scoped by explicit `proxyIDs` and intentionally bypasses `canRun`, so connections-scope bulk drawers keep working even though `ctx.proxyID` is empty there.
|
|
482
|
+
**Precondition guards (`Operation.canRun`).** An `Operation` may declare `canRun?(ctx): boolean`. When it returns `false`, `useApiQuery` / `useApiLazyQuery` / `useApiMutation` skip the dispatch (no network request, no Apollo observer) and the imperative `runQuery` / `runMutation` short-circuit to `{ data: undefined }` with no error (so domain hooks don't toast). `useApiQuery`'s `refetch` honors the same gates — `options.skip`, a missing slot, and `canRun` alike. Apollo's own `refetch` does fire a request against a skipped (standby) query, so without that guard a "refresh on open" effect would smuggle a request past a `canRun` guard and then discard the response, since `data` is gated on `!skip`. central-ui sets `canRun: (ctx) => !!ctx.proxyID && !!getVersionedQuery(...)` on every `REMOTE_FETCH`-backed op: out-of-proxy pages have no selected proxy, so without the guard the kit would fire an empty `RemoteFetch($proxyID, $query, $variables)` with both required vars missing. The multi-cluster fan-out path (`runMulti` / `transformVariablesMulti`) is scoped by explicit `proxyIDs` and intentionally bypasses `canRun`, so connections-scope bulk drawers keep working even though `ctx.proxyID` is empty there.
|
|
479
483
|
|
|
480
484
|
> **Optimistic instrument-on-form-submit lag.** The previous version of `prepareSourcePayloads` accepted Zustand mutators and patched the entity store optimistically before the mutation resolved. That path is gone — the mutation now fires, then `await fetchAll()` refreshes (~200–500ms total). Per-adapter `cache.modify` plumbing would reinstate optimism, but central-ui's opaque `REMOTE_FETCH` envelope makes it more code than it's worth. The 5s SSE debounce that previously masked the optimistic pattern is no longer the critical path either — the post-mutation refetch arrives well before SSE.
|
|
481
485
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as e,Fragment as t,jsxs as r}from"react/jsx-runtime";import{Fragment as n,useMemo as o,useContext as a,createContext as s}from"react";import{T as i,t as u,b as l,P as c}from"./ui-components-
|
|
1
|
+
import{jsx as e,Fragment as t,jsxs as r}from"react/jsx-runtime";import{Fragment as n,useMemo as o,useContext as a,createContext as s}from"react";import{T as i,t as u,b as l,P as c}from"./ui-components-BUMZXMZ4.js";import p from"styled-components";var d;(e=>{e.Default="default",e.Action="action",e.Endpoint="endpoint",e.Scope="scope",e.Duration="duration"})(d||(d={}));const f=[d.Action,d.Endpoint,d.Scope,d.Duration],h=p.span`
|
|
2
2
|
font-family: ${({theme:e,$isMono:t})=>t?e.font_family.secondary:e.font_family.primary};
|
|
3
3
|
font-size: ${({theme:e})=>e.v2.text.size.xxs}px;
|
|
4
4
|
line-height: 20px;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as e,jsxs as a,Fragment as t}from"react/jsx-runtime";import{D as l,c as r,F as n,d as i,e as o,f as s,g as c,h as d,B as u,i as p,j as h,k as g,W as m,l as v,m as b,V as f,n as y,o as x,p as k,q as C,r as S,C as T,s as $,u as w,I as M,v as A,w as O,x as L,y as P,z as E,N as I,E as R,S as N,G as V,H as z,U as D,J as X,K as H,L as _,M as q,O as B,Q as j,X as K,Y as U,Z as G,_ as F,$ as W,a0 as J,a1 as Y,a2 as Z,a3 as Q,a4 as ee,T as ae,a5 as te,a6 as le,a7 as re,a8 as ne,a9 as ie,aa as oe,ab as se,ac as ce,ad as de,ae as ue,af as pe,ag as he,b as ge,ah as me,ai as ve,aj as be,ak as fe,al as ye,am as xe,an as ke,ao as Ce,ap as Se,aq as Te,ar as $e,as as we,at as Me,au as Ae,av as Oe,aw as Le,ax as Pe,ay as Ee,az as Ie,aA as Re,aB as Ne,aC as Ve,aD as ze,aE as De,aF as Xe,aG as He,aH as _e,aI as qe,aJ as Be,aK as je,aL as Ke,aM as Ue,aN as Ge,aO as Fe,aP as We,aQ as Je,aR as Ye,aS as Ze,aT as Qe,aU as ea,aV as aa,aW as ta,aX as la,aY as ra,aZ as na,a_ as ia,a$ as oa,b0 as sa,b1 as ca,R as da,b2 as ua,b3 as pa,A as ha,b4 as ga,b5 as ma}from"./ui-components-
|
|
1
|
+
import{jsx as e,jsxs as a,Fragment as t}from"react/jsx-runtime";import{D as l,c as r,F as n,d as i,e as o,f as s,g as c,h as d,B as u,i as p,j as h,k as g,W as m,l as v,m as b,V as f,n as y,o as x,p as k,q as C,r as S,C as T,s as $,u as w,I as M,v as A,w as O,x as L,y as P,z as E,N as I,E as R,S as N,G as V,H as z,U as D,J as X,K as H,L as _,M as q,O as B,Q as j,X as K,Y as U,Z as G,_ as F,$ as W,a0 as J,a1 as Y,a2 as Z,a3 as Q,a4 as ee,T as ae,a5 as te,a6 as le,a7 as re,a8 as ne,a9 as ie,aa as oe,ab as se,ac as ce,ad as de,ae as ue,af as pe,ag as he,b as ge,ah as me,ai as ve,aj as be,ak as fe,al as ye,am as xe,an as ke,ao as Ce,ap as Se,aq as Te,ar as $e,as as we,at as Me,au as Ae,av as Oe,aw as Le,ax as Pe,ay as Ee,az as Ie,aA as Re,aB as Ne,aC as Ve,aD as ze,aE as De,aF as Xe,aG as He,aH as _e,aI as qe,aJ as Be,aK as je,aL as Ke,aM as Ue,aN as Ge,aO as Fe,aP as We,aQ as Je,aR as Ye,aS as Ze,aT as Qe,aU as ea,aV as aa,aW as ta,aX as la,aY as ra,aZ as na,a_ as ia,a$ as oa,b0 as sa,b1 as ca,R as da,b2 as ua,b3 as pa,A as ha,b4 as ga,b5 as ma}from"./ui-components-BUMZXMZ4.js";import{VIcon as va,TrashIcon as ba,PlusIcon as fa,EditIcon as ya,OdigosLogoTextCentral as xa,OdigosLogoTextEnterprise as ka,OdigosLogoTextCommunity as Ca,OdigosLogoTextColoredCentral as Sa,OdigosLogoTextColoredEnterprise as Ta,OdigosLogoTextColoredCommunity as $a,ArrowLeftIcon as wa,ArrowRightIcon as Ma,VSquareIcon as Aa,CopyIcon as Oa,YamlIcon as La}from"../icons.js";import Pa,{useMemo as Ea,useRef as Ia,useCallback as Ra,useState as Na,useEffect as Va,Fragment as za,forwardRef as Da,useImperativeHandle as Xa}from"react";import Ha,{css as _a,useTheme as qa}from"styled-components";import{i as Ba,m as ja,u as Ka,n as Ua,a as Ga,C as Fa,b as Wa,d as Ja,e as Ya,f as Za,g as Qa,h as et,j as at,k as tt}from"./helpers-BkaWRtR9.js";const lt=/^[a-zA-Z]$/,rt=new Set(["*","+","?"]),nt=new Set(["^","$"]),it={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"},ot=Ha.div`
|
|
2
2
|
padding: 8px 16px;
|
|
3
3
|
border-radius: 6px;
|
|
4
4
|
border: 1px solid ${({theme:e})=>e.v2.colors.silver[500]};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{useMemo as t,useContext as r,createContext as a,useCallback as n,useState as o,useEffect as s,useRef as i}from"react";import{b6 as c,b7 as l,m as d,S as u,b8 as m,b9 as p,ba as f,P as E,bb as y,bc as h,bd as S,be as T,bf as g,bg as _,bh as I,bi as A,bj as v,bk as R,bl as C,aY as N,bm as O,bn as D,n as w,bo as b,bp as P,bq as L,br as k,bs as F,bt as G,v as U,bu as M,bv as x,ad as H,a9 as K,ab as V,aa as W,ac as Y,a8 as $,bw as j,b as q}from"./ui-components-BUMZXMZ4.js";import{i as B,n as Q,m as z,l as J,o as X,p as Z,v as ee,q as te,u as re}from"./helpers-BkaWRtR9.js";import{ApolloProvider as ae,useLazyQuery as ne,useApolloClient as oe,useQuery as se}from"@apollo/client/react";import{ErrorLink as ie}from"@apollo/client/link/error";import{SetContextLink as ce}from"@apollo/client/link/context";import{getMainDefinition as le}from"@apollo/client/utilities";import{CombinedGraphQLErrors as de,ServerError as ue}from"@apollo/client/errors";import{HttpLink as me,ApolloLink as pe,ApolloClient as fe,InMemoryCache as Ee,gql as ye}from"@apollo/client";const he=e=>{if(!e)return!1;const t=e.toLowerCase();return t.includes("authentication required")||t.includes("authentication expired")||t.includes("http 401")},Se=a(null),Te=()=>{const e=r(Se);if(!e)throw new Error("[ui-kit] useOdigosApi() / useXxxApi() called outside of <OdigosApiProvider>. Make sure the host app mounts the provider at its layout level.");return e},ge=({apolloConfig:r,operations:a,context:n,children:o})=>{const s=t(()=>(e=>{const t=new me({uri:e.httpUrl,credentials:e.credentials??"same-origin"}),r=new ie(({error:t})=>{de.is(t)?t.errors.some(e=>he(e.message))&&e.onAuthError?.():(ue.is(t)&&401===t.statusCode||he(t.message))&&e.onAuthError?.()}),a=new ce(async t=>{const r={...t.headers};if(e.authHeader){const t=await e.authHeader();Object.assign(r,t)}return e.csrfHeader&&Object.assign(r,e.csrfHeader()),{headers:r}}),n=[];e.additionalLinks?.length&&n.push(...e.additionalLinks),n.push(a,r,t);let o=pe.from(n);e.wsLink&&(o=pe.split(({query:e})=>{const t=le(e);return"OperationDefinition"===t.kind&&"subscription"===t.operation},e.wsLink,o));const s=e.defaultFetchPolicies;return new fe({link:o,cache:new Ee({typePolicies:e.cacheTypePolicies}),defaultOptions:{watchQuery:{fetchPolicy:s?.watchQuery??"cache-and-network"},query:{fetchPolicy:s?.query??"cache-first"},mutate:{fetchPolicy:s?.mutate??"network-only"}}})})(r),[r.httpUrl,r.wsLink,r.credentials,r.clientKey]),i=t(()=>({operations:a,context:n,apolloConfig:r}),[a,n,r]);return e(ae,{client:s,children:e(Se.Provider,{value:i,children:o})})},_e=Se,Ie=({connectionIds:r,children:a})=>{const n=Te(),o=t(()=>({operations:n.operations,context:{...n.context,connectionIds:r},apolloConfig:n.apolloConfig}),[n.operations,n.context,n.apolloConfig,r.join(",")]);return e(_e.Provider,{value:o,children:a})},Ae=(e,t)=>{if(e)return"string"==typeof e?e:m(e,t)},ve=e=>{const{addNotification:t}=c(),r=(r,a,n,o,s)=>t({type:r,title:a,message:n,crdType:e,target:Ae(o,e),hideFromHistory:s});return{notify:r,notifyError:(e,t,a)=>r(u.Error,e,t,a),notifySuccess:(e,t,a)=>r(u.Success,e,t,a),notifyPending:(e,t)=>r(u.Default,"Pending",e,t,!0),notifyReadonly:()=>{t({type:u.Warning,title:d.READONLY,message:l.READONLY_WARNING,hideFromHistory:!0})}}},Re=e=>{e({type:u.Warning,title:d.READONLY,message:l.READONLY_WARNING,hideFromHistory:!0})},Ce=e=>({error:e,results:[],allSucceeded:!1,anySucceeded:!1,successCount:0,failureCount:0}),Ne=(e,t)=>{if(e)return"function"==typeof e?e(t):e},Oe=e=>{if(!e)return"Unknown error";if(e instanceof Error)return e.cause instanceof Error?e.cause.message:e.message;if("object"==typeof e){const t=e;return t.cause?.message||t.message||String(e)}return String(e)},De=(e,t)=>e.client??t,we=async(e,t,r,a,n)=>{if(!t)return{error:"Query operation not configured"};if(t.canRun&&!t.canRun(a))return{data:void 0};if(t.run)try{return await t.run(De(t,e),r,a)}catch(e){return{error:Oe(e)}}const o=Ne(t.document,a);if(!o)return{error:"Query operation not supported in this context"};const s=t.transformVariables?t.transformVariables(r,a):r,i=De(t,e);try{const e=await i.query({query:o,variables:s,fetchPolicy:n??"network-only"});return{data:t.transformResult?t.transformResult(e.data,a):e.data,error:e.error?Oe(e.error):void 0}}catch(e){return{error:Oe(e)}}},be=async(e,t,r,a)=>{if(!t)return{error:"Mutation operation not configured"};if(t.canRun&&!t.canRun(a))return{data:void 0};if(t.run)try{return await t.run(De(t,e),r,a)}catch(e){return{error:Oe(e)}}const n=Ne(t.document,a);if(!n)return{error:"Mutation operation not supported in this context"};const o=t.transformVariables?t.transformVariables(r,a):r,s=De(t,e);try{const e=await s.mutate({mutation:n,variables:o});return{data:t.transformResult?t.transformResult(e.data,a):e.data,error:void 0}}catch(e){return{error:Oe(e)}}},Pe=async(e,t,r,a,n)=>{if(!t)return Ce("Multi fetch operation not configured");if(!r.length)return Ce("No proxy ids supplied for multi fetch");const o=De(t,e);if(t.transformVariablesMulti&&(t.documentMulti||t.document)){const e=t.transformVariablesMulti(r,a,n),s=[];for(const r of e)try{const e=await o.query({query:r.document,variables:r.variables,fetchPolicy:"network-only"});t.transformMultiResult?t.transformMultiResult(e.data,n).forEach(e=>s.push(e)):r.proxyIDs.forEach(t=>{s.push({proxyID:t,success:!e.error,data:e.data,error:e.error?.message})})}catch(e){const t=Oe(e);r.proxyIDs.forEach(e=>s.push({proxyID:e,success:!1,error:t}))}const i=s.filter(e=>e.success).length,c=s.length-i,l=Array.from(new Set(s.filter(e=>!!e.error).map(e=>e.error)));return{results:s,allSucceeded:0===c,anySucceeded:i>0,successCount:i,failureCount:c,error:l.length?l.join(", "):void 0}}const s=await Promise.all(r.map(async r=>{const o={...n,proxyID:r},s=await we(e,t,a,o);return{proxyID:r,success:!s.error,data:s.data,error:s.error}})),i=s.filter(e=>e.success).length,c=s.length-i,l=Array.from(new Set(s.filter(e=>!!e.error).map(e=>e.error)));return{results:s,allSucceeded:0===c,anySucceeded:i>0,successCount:i,failureCount:c,error:l.length?l.join(", "):void 0}},Le=ye`
|
|
2
|
+
query OdigosApiNoop {
|
|
3
|
+
__typename
|
|
4
|
+
}
|
|
5
|
+
`,ke=(e,t)=>{if(e)return"function"==typeof e?e(t):e},Fe=(e,t)=>e[t],Ge=(e,t,r)=>{if(void 0!==t)return e?.transformResult?e.transformResult(t,r):t},Ue=(e,t,r)=>{if(!e)return;const a=e.transformVariables;return a?a(t,r):t},Me=(e,r,a)=>{const{operations:o,context:i}=Te(),c=Fe(o,e),l=t(()=>ke(c?.document,i),[c,i]),d=t(()=>Ue(c,r,i),[c,r,i]),u=!c||!l,m=!!c?.canRun&&!c.canRun(i),p=a?.skip||u||m,f=se(l??Le,{variables:d,skip:p,pollInterval:a?.pollInterval,fetchPolicy:a?.fetchPolicy??"cache-and-network",notifyOnNetworkStatusChange:a?.notifyOnNetworkStatusChange,client:c?.client}),E=t(()=>{if(!p)return Ge(c,f.data,i)},[c,i,f.data,p]);s(()=>{p||void 0===E||a?.onCompleted?.(E)},[p,E,a?.onCompleted]),s(()=>{f.error&&a?.onError?.(f.error)},[f.error,a?.onError]);const y=n(async()=>{if(p)return{data:void 0};const e=await f.refetch();return{data:Ge(c,e.data,i)}},[c,i,f,p]);return{data:E,loading:!p&&f.loading,error:f.error,refetch:y,unsupported:u}},xe=(e,r)=>{const{operations:a,context:o}=Te(),s=Fe(a,e),i=t(()=>ke(s?.document,o),[s,o]),c=!s||!i,[l,d]=ne(i??Le,{fetchPolicy:r?.fetchPolicy??"network-only",notifyOnNetworkStatusChange:r?.notifyOnNetworkStatusChange,client:s?.client});return{execute:n(async e=>{if(c)return{error:void 0};if(s?.canRun&&!s.canRun(o))return{data:void 0};const t=Ue(s,e,o),r=await l({variables:t});return r.error?{error:r.error}:{data:Ge(s,r.data,o)}},[s,o,l,c]),data:t(()=>Ge(s,d.data,o),[s,o,d.data]),loading:d.loading,error:d.error,called:d.called,unsupported:c}},He=(e,r)=>{const{operations:a,context:s}=Te(),i=oe(),c=Fe(a,e),l=t(()=>ke(c?.document,s),[c,s]),d=!c||!l,[u,m]=o({loading:!1,called:!1}),p=n(()=>m({loading:!1,called:!1}),[]);return[n(async e=>{if(d||!l)return{error:void 0};if(c?.canRun&&!c.canRun(s))return{data:void 0};const t=Ue(c,e,s),a=c?.client??i;m(e=>({...e,loading:!0,called:!0}));try{const e=await a.mutate({mutation:l,variables:t}),n=Ge(c,e.data,s);if(m({data:n,loading:!1,error:void 0,called:!0}),r?.refetchQueries){const e=a.refetchQueries({include:r.refetchQueries});r?.awaitRefetchQueries&&await e}return void 0!==n&&r?.onCompleted?.(n),{data:n}}catch(e){const t=e;return m({data:void 0,loading:!1,error:t,called:!0}),r?.onError?.(t),{error:t}}},[c,s,i,l,d,r]),{data:u.data,loading:u.loading,error:u.error,called:u.called,unsupported:d,reset:p}]},Ke=[],Ve=(e,t,r,a)=>{let n=!0;const o={sources:[]};for(const[s,i]of Object.entries(e)){if(!i.length)continue;n=!1;const e=i.map(({id:e,selected:t,currentStreamName:a})=>({namespace:e.namespace,name:e.name,kind:e.kind,selected:void 0!==t&&t,currentStreamName:a||r}));let c=0,l=0;for(const r of e){const e=t.find(e=>e.id.namespace===s&&e.id.name===r.name&&e.id.kind===r.kind),a=e?.dataStreamNames||[];r.selected&&!e?c++:!r.selected&&e&&a.length<=1&&l++}a(c,l),o.sources.push(...e)}return{payload:o,isEmpty:n}},We=(e,t)=>{let r=!0;const a={namespaces:[]};for(const[n,{selected:o,currentStreamName:s}]of Object.entries(e))"boolean"==typeof o&&(r=!1,a.namespaces.push({namespace:n,selected:o,currentStreamName:s||t}));return{payload:a,isEmpty:r}},Ye={filter:{markedForInstrumentation:!0}},$e=[],je=[],qe=[],Be=[],Qe=[],ze=e=>{if(e)return{clusters:[e],totalNamespaces:e.namespaces?.length??0,totalWorkloads:(e.namespaces??[]).reduce((e,t)=>e+(t.workloads?.length??0),0),lastUpdated:e.timestamp}},Je=[],Xe=[],Ze=(e,t)=>({...e,fields:e.fields.filter(({value:e})=>void 0!==e),currentStreamName:t}),et=[],tt=()=>{const{operations:e,context:r}=Te(),a=oe(),o=((e,t)=>{const r=oe(),{notifyError:a,notifySuccess:o,notifyPending:s,notifyReadonly:i}=ve(f.Source),{selectedStreamName:c}=y(),{setProgress:l,resetProgress:d}=h(),{setConfiguredSources:u,setConfiguredFutureApps:m}=S(),E=(e,t)=>{const{progress:r}=h.getState();e>0&&l(T.Instrumenting,{total:(r[T.Instrumenting]?.total||0)+e,current:r[T.Instrumenting]?.current||0}),t>0&&l(T.Uninstrumenting,{total:(r[T.Uninstrumenting]?.total||0)+t,current:r[T.Uninstrumenting]?.current||0})},_=n(async()=>{const{error:n}=await we(r,e.GET_WORKLOADS,Ye,t);n&&a(p.Read,n)},[r,e.GET_WORKLOADS,t,a]);return{useSources:()=>{const e=Me("GET_WORKLOADS",Ye,{fetchPolicy:"cache-first"});return{items:e.data?.workloads??$e,loading:e.loading,refetch:_}},fetchAll:_,fetchByTargets:async(n,o)=>{const s=!!o?.slim,i=n.map(e=>g(e,f.Source)).filter(e=>e.namespace&&e.name&&e.kind);if(0===i.length)return;if(i.length>50)return void await _();const c=s&&e.GET_WORKLOADS_BY_IDS_SLIM?e.GET_WORKLOADS_BY_IDS_SLIM:e.GET_WORKLOADS_BY_IDS,{error:l}=await we(r,c,{ids:i.map(({namespace:e,kind:t,name:r,region:a})=>({namespace:e,kind:t,name:r,region:a||void 0}))},t);l?a(p.Read,l):await _()},fetchById:async n=>{const{data:o,error:s}=await we(r,e.GET_WORKLOADS_BY_IDS,{ids:[{namespace:n.namespace,kind:n.kind,name:n.name,...n.region?{region:n.region}:{}}]},t);if(!s)return o?.workloadsByIds?.find(e=>e.id.namespace===n.namespace&&e.id.kind===n.kind&&e.id.name===n.name&&(e.id.region??"")===(n.region??""));a(p.Read,s)},fetchLibraries:async a=>we(r,e.GET_SOURCE_LIBRARIES,a,t),fetchPeerSources:async a=>we(r,e.GET_PEER_SOURCES,{serviceName:a},t),usePeerSources:(e,t)=>Me("GET_PEER_SOURCES",e,t),persist:async(n,o)=>{if(t.isReadonly)return i();const{data:l}=await we(r,e.GET_WORKLOADS,Ye,t,"cache-first"),f=l?.workloads??$e,{payload:y,isEmpty:h}=Ve(n,f,c,E),{payload:S,isEmpty:g}=We(o,c);let _=!1;h||(_=!0,s("Persisting sources...")),g||_||s("Persisting namespaces...");const{error:I}=await be(r,e.PERSIST_SOURCES,y,t);if(I&&(d(T.Instrumenting),d(T.Uninstrumenting),a(p.Update,I)),e.PERSIST_NAMESPACES){const{error:n}=await be(r,e.PERSIST_NAMESPACES,S,t);n&&a(p.Update,n)}u({}),m({})},persistV2:async a=>{if(t.isReadonly)return i(),{error:"readonly"};const n=[];for(const[,o]of Object.entries(a)){const a={sources:[]},s={namespaces:[]};for(const e of o)e.name&&e.kind?a.sources.push(e):s.namespaces.push(e);if(s.namespaces.length>0&&e.PERSIST_NAMESPACES){const{error:a}=await be(r,e.PERSIST_NAMESPACES,s,t);a&&n.push(a)}if(a.sources.length>0){const{error:o}=await be(r,e.PERSIST_SOURCES,a,t);o&&n.push(o)}}return n.length?{error:n.join(", ")}:void 0},update:async(n,l)=>{if(t.isReadonly)return i();s("Updating source...");const d={sourceId:n,patchSourceRequest:{...l,currentStreamName:c}},{data:u,error:m}=await be(r,e.UPDATE_SOURCE,d,t);m?a(p.Update,m,n):u?.updateK8sActualSource&&o(p.Update,`Successfully updated "${n.name}" source`,n)},restartWorkloads:async n=>{if(t.isReadonly)return i();s("Restarting sources...");const{data:c,error:l}=await be(r,e.RESTART_WORKLOADS,{sourceIds:n},t);l?a(p.Update,l):c?.restartWorkloads&&o(p.Update,`Successfully restarted ${n.length} sources`)},restartPod:async(n,c)=>{if(t.isReadonly)return i();s("Restarting pod...");const{data:l,error:d}=await be(r,e.RESTART_POD,{namespace:n,name:c},t);d?a(p.Update,d):l?.restartPod&&o(p.Update,`Successfully restarted pod ${n}/${c}`)},recoverFromRollback:async n=>{if(t.isReadonly)return i();s("Recovering from rollback...");const{data:c,error:l}=await be(r,e.RECOVER_FROM_ROLLBACK,{sourceId:n},t);l?a(p.Update,l,n):c?.recoverFromRollbackForWorkload&&o(p.Update,"Successfully triggered recovery from rollback")}}})(e,r),i=((e,t)=>{const r=oe(),{notifyError:a,notifySuccess:n,notifyReadonly:o}=ve(f.Destination),{selectedStreamName:s}=y(),i=async()=>{const{error:n}=await we(r,e.GET_DESTINATIONS,void 0,t);n&&a(p.Read,n)};return{useDestinations:()=>{const e=Me("GET_DESTINATIONS",void 0,{fetchPolicy:"cache-first"});return{items:e.data?.computePlatform?.destinations??e.data?.destinations??Xe,loading:e.loading,refetch:i}},useDestinationCategories:()=>{const e=Me("GET_DESTINATION_CATEGORIES",void 0);return{data:e.data,loading:e.loading}},usePotentialDestinations:()=>{const e=Me("GET_POTENTIAL_DESTINATIONS",void 0);return{data:e.data,loading:e.loading}},fetchAll:i,testConnection:async a=>{const{data:n}=await be(r,e.TEST_DESTINATION_CONNECTION,{destination:Ze(a,s)},t);return n},create:async c=>{if(t.isReadonly)return o();const{error:l}=await be(r,e.CREATE_DESTINATION,{destination:Ze(c,s)},t);l?a(p.Create,l):(n(p.Create,`Successfully created "${c.type}" destination`),await i())},update:async(c,l)=>{if(t.isReadonly)return o();const{data:d,error:u}=await be(r,e.UPDATE_DESTINATION,{id:c,destination:Ze(l,s)},t);u?a(p.Update,u,c):d?.updateDestination&&(n(p.Update,`Successfully updated "${l.type}" destination`,c),await i())},remove:async c=>{if(t.isReadonly)return o();const{data:l}=await we(r,e.GET_DESTINATIONS,void 0,t,"cache-first"),d=l?.computePlatform?.destinations??l?.destinations??Xe,u=d.find(e=>I(e)===c)?.destinationType?.type,{error:m}=await be(r,e.DELETE_DESTINATION,{id:c,currentStreamName:s},t);m?a(p.Delete,m,c):(n(p.Delete,`Successfully deleted "${u??c}" destination`,c),await i())}}})(e,r),l=((e,r)=>{const a=oe(),{notifyError:n,notifySuccess:o,notifyReadonly:s}=ve(f.Action),i=async()=>{const{error:t}=await we(a,e.GET_ACTIONS,void 0,r);t&&n(p.Read,t)};return{useActions:()=>{const e=Me("GET_ACTIONS",void 0,{fetchPolicy:"cache-first"});return{items:e.data?.computePlatform?.actions??e.data?.actions??je,loading:e.loading,refetch:i}},useActionTypes:()=>{const e=Me("GET_ACTION_TYPES",void 0,{fetchPolicy:"cache-first"});return{options:t(()=>_(e.data)||qe,[e.data]),loading:e.loading}},fetchAll:i,create:async t=>{if(r.isReadonly)return s();if(!e.CREATE_ACTION)return;const{error:c}=await be(a,e.CREATE_ACTION,{action:t},r);c?n(p.Create,c):(o(p.Create,`Successfully created "${t.type}" action`),await i())},update:async(t,c)=>{if(r.isReadonly)return s();if(!e.UPDATE_ACTION)return;const{error:l}=await be(a,e.UPDATE_ACTION,{id:t,action:c},r);l?n(p.Update,l,t):(o(p.Update,`Successfully updated "${c.type}" action`,t),await i())},remove:async(t,c)=>{if(r.isReadonly)return s();if(!e.DELETE_ACTION)return;const{error:l}=await be(a,e.DELETE_ACTION,{id:t,actionType:c},r);l?n(p.Delete,l,t):(o(p.Delete,`Successfully deleted "${c}" action`,t),await i())}}})(e,r),d=((e,r)=>{const a=oe(),{notifyError:n,notifySuccess:o,notifyReadonly:s}=ve(f.InstrumentationRule),i=async()=>{const{error:t}=await we(a,e.GET_INSTRUMENTATION_RULES,void 0,r);t&&n(p.Read,t)};return{useRules:()=>{const e=Me("GET_INSTRUMENTATION_RULES",void 0,{fetchPolicy:"cache-first"});return{items:t(()=>(e.data?.computePlatform?.instrumentationRules??e.data?.instrumentationRules??[]).map(R),[e.data]),loading:e.loading,refetch:i}},useRuleTypes:()=>{const e=Me("GET_INSTRUMENTATION_RULE_TYPES",void 0,{fetchPolicy:"cache-first"});return{options:t(()=>v(e.data)||et,[e.data]),loading:e.loading}},fetchAll:i,create:async(t,c)=>{if(r.isReadonly)return s();if(!e.CREATE_INSTRUMENTATION_RULE)return;const{error:l}=await be(a,e.CREATE_INSTRUMENTATION_RULE,{instrumentationRule:A(t)},r);l?n(p.Create,l):(o(p.Create,`Successfully created${c?` "${c}"`:""} rule`),await i())},update:async(t,c,l)=>{if(r.isReadonly)return s();if(!e.UPDATE_INSTRUMENTATION_RULE)return;const{error:d}=await be(a,e.UPDATE_INSTRUMENTATION_RULE,{ruleId:t,instrumentationRule:A(c)},r);d?n(p.Update,d,t):(o(p.Update,`Successfully updated${l?` "${l}"`:""} rule`,t),await i())},remove:async(t,c)=>{if(r.isReadonly)return s();if(!e.DELETE_INSTRUMENTATION_RULE)return;const{error:l}=await be(a,e.DELETE_INSTRUMENTATION_RULE,{ruleId:t},r);l?n(p.Delete,l,t):(o(p.Delete,`Successfully deleted${c?` "${c}"`:""} rule`,t),await i())}}})(e,r),m=((e,t)=>{const r=oe(),{addNotification:a}=c(),{setDataStreams:n}=y(),o=(e,t)=>a({type:u.Error,title:e,message:t}),i=async()=>{const{data:a,error:s}=await we(r,e.GET_DATA_STREAMS,void 0,t);if(s)o(p.Read,s);else if(a){const e=a.computePlatform?.dataStreams??a.dataStreams??[];n(e)}},l=e.CREATE_DATA_STREAM?async n=>{if(t.isReadonly)return Re(a);const{error:s}=await be(r,e.CREATE_DATA_STREAM,{stream:n},t);s?o(p.Create,s):await i()}:void 0;return{useDataStreams:()=>{const e=Me("GET_DATA_STREAMS",void 0,{fetchPolicy:"cache-first"}),t=e.data?.computePlatform?.dataStreams??e.data?.dataStreams??Je;return s(()=>{n(t)},[JSON.stringify(t.map(e=>e.name))]),{items:t,loading:e.loading,refetch:i}},fetchAll:i,create:l,update:async(n,s)=>{if(t.isReadonly)return Re(a);const{error:c}=await be(r,e.UPDATE_DATA_STREAM,{id:n,dataStream:s},t);c?o(p.Update,c):await i()},remove:async n=>{if(t.isReadonly)return Re(a);const{error:s}=await be(r,e.DELETE_DATA_STREAM,{id:n},t);s?o(p.Delete,s):await i()}}})(e,r),C=((e,t)=>{const r=oe(),{notifyError:a,notifyReadonly:n}=ve(f.Namespace),o=async()=>{const n=await we(r,e.GET_NAMESPACES_WITH_WORKLOADS,void 0,t);return n.error&&a(p.Read,n.error),n};return{useNamespaces:e=>{const t=Me("GET_NAMESPACES_WITH_WORKLOADS",void 0,{fetchPolicy:"cache-and-network",skip:e?.skip});return{items:t.data?.namespaces??Qe,loading:t.loading,refetch:o}},fetchAll:o,persist:async o=>{if(t.isReadonly)return n();const{error:s}=await be(r,e.PERSIST_NAMESPACES,o,t);return s&&a(p.Update,s),s?{error:s}:void 0}}})(e,r),N=((e,t)=>{const r=oe(),{notifyError:a}=ve(f.Source);return{fetch:async n=>{const o=await we(r,e.GET_K8S_MANIFEST,n,t);return o.error&&a(p.Read,o.error),o}}})(e,r),O=((e,t)=>{const r=oe(),{notifyError:a,notifySuccess:n,notifyReadonly:o}=ve(f.Source);return{useEffectiveConfig:(e,t)=>Me("GET_EFFECTIVE_CONFIG",e,t),useConfigYamls:e=>Me("GET_CONFIG_YAMLS",void 0,e),getEffectiveConfig:async a=>e.GET_EFFECTIVE_CONFIG?we(r,e.GET_EFFECTIVE_CONFIG,{id:a},t):{error:"GET_EFFECTIVE_CONFIG not configured"},applyConfigurations:e.UPDATE_REMOTE_CONFIG?async(n,s)=>{if(t.isReadonly)return o();const{error:i}=await be(r,e.UPDATE_REMOTE_CONFIG,{formData:n,connectionIds:s},t);return i&&a(p.Update,i),i?{error:i}:void 0}:void 0,getConfigYamls:e.GET_CONFIG_YAMLS?async()=>we(r,e.GET_CONFIG_YAMLS,void 0,t):void 0,updateLocalUiConfig:e.UPDATE_LOCAL_UI_CONFIG?async s=>{if(t.isReadonly)return o();const{error:i}=await be(r,e.UPDATE_LOCAL_UI_CONFIG,{config:s},t);return i?a(p.Update,i):n(p.Update,"Local UI configuration updated successfully"),i?{error:i}:void 0}:void 0,resetLocalUiConfigToDefaults:e.RESET_LOCAL_UI_CONFIG_TO_FACTORY_DEFAULTS?async()=>{if(t.isReadonly)return o();const{error:s}=await be(r,e.RESET_LOCAL_UI_CONFIG_TO_FACTORY_DEFAULTS,void 0,t);return s?a(p.Update,s):n(p.Update,"Local UI configuration reset to factory defaults"),s?{error:s}:void 0}:void 0}})(e,r),D=((e,t)=>{const r=oe(),{apolloConfig:a}=Te();return{fetchDescribeOdigos:e.GET_DESCRIBE_ODIGOS?async()=>we(r,e.GET_DESCRIBE_ODIGOS,void 0,t):void 0,fetchDescribeSource:e.GET_DESCRIBE_SOURCE?async a=>we(r,e.GET_DESCRIBE_SOURCE,a,t):void 0,downloadDiagnose:e.GET_DIAGNOSE?async(n,o)=>{const s=await we(r,e.GET_DIAGNOSE,{input:n,dryRun:o?.dryRun??!1},t),i=s?.data?.stats?.fileCount??0;return!s.error&&i>0&&!o?.dryRun&&await(async e=>{const t=(e=>{try{return new URL("/diagnose/download",e).toString()}catch{return null}})(e.httpUrl);if(t)try{const[r,a]=await Promise.all([Promise.resolve(e.authHeader?.()??{}),Promise.resolve(e.csrfHeader?.()??{})]),n=await fetch(t,{credentials:e.credentials??"same-origin",headers:{...r,...a}});if(!n.ok)throw new Error(`Failed to download diagnose archive: ${n.status} ${n.statusText}`);((e,t)=>{if("undefined"==typeof document)return;const r=URL.createObjectURL(e),a=document.createElement("a");a.href=r,a.download=t,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(r)})(await n.blob(),`odigos-diagnose-${Date.now()}.tar.gz`)}catch(e){}})(a),s}:void 0}})(e,r),w=((e,t)=>{const r=oe(),{notifyError:a,notifyReadonly:n}=ve(f.Source),o=async()=>{e.GET_TOKENS&&await we(r,e.GET_TOKENS,void 0,t)};return{useTokens:()=>{const e=Me("GET_TOKENS",void 0,{fetchPolicy:"cache-first"});return{items:e.data??Ke,loading:e.loading,refetch:o}},updateToken:e.UPDATE_TOKEN?async o=>{if(t.isReadonly)return n();const{error:s}=await be(r,e.UPDATE_TOKEN,{token:o},t);return s&&a(p.Update,s),s?{error:s}:void 0}:void 0}})(e,r),b=((e,t)=>{const r=oe();return{useMetrics:e=>Me("GET_METRICS",void 0,e),fetch:async()=>we(r,e.GET_METRICS,void 0,t)}})(e,r),P=((e,t)=>{const r=oe();return{useServiceMap:e=>Me("GET_SERVICE_MAP",void 0,e),fetch:e.GET_SERVICE_MAP?async()=>we(r,e.GET_SERVICE_MAP,void 0,t):void 0}})(e,r),L=((e,t)=>{const r=oe();return{useSlots:e=>Me("GET_PROFILING_SLOTS",void 0,e),useSourceProfiling:(e,t)=>Me("GET_SOURCE_PROFILING",e,t),fetchSlots:e.GET_PROFILING_SLOTS?async()=>we(r,e.GET_PROFILING_SLOTS,void 0,t):void 0,fetchSourceProfiling:e.GET_SOURCE_PROFILING?async a=>we(r,e.GET_SOURCE_PROFILING,a,t):void 0,enableProfiling:e.ENABLE_SOURCE_PROFILING?async a=>be(r,e.ENABLE_SOURCE_PROFILING,a,t):void 0}})(e,r),k=((e,t)=>{const r=oe();return{useGatewayInfo:e=>Me("GET_GATEWAY_INFO",void 0,e),useGatewayPods:e=>Me("GET_GATEWAY_PODS",void 0,e),useNodeCollectorInfo:e=>Me("GET_NODE_COLLECTOR_INFO",void 0,e),useNodeCollectorPods:e=>Me("GET_NODE_COLLECTOR_PODS",void 0,e),usePodInfo:(e,t)=>Me("GET_COLLECTOR_POD_INFO",e,t),getGatewayInfo:e.GET_GATEWAY_INFO?async()=>we(r,e.GET_GATEWAY_INFO,void 0,t):void 0,getGatewayPods:e.GET_GATEWAY_PODS?async()=>we(r,e.GET_GATEWAY_PODS,void 0,t):void 0,getNodeCollectorInfo:e.GET_NODE_COLLECTOR_INFO?async()=>we(r,e.GET_NODE_COLLECTOR_INFO,void 0,t):void 0,getNodeCollectorPods:e.GET_NODE_COLLECTOR_PODS?async()=>we(r,e.GET_NODE_COLLECTOR_PODS,void 0,t):void 0,getExtendedPodInfo:e.GET_COLLECTOR_POD_INFO?async(a,n)=>we(r,e.GET_COLLECTOR_POD_INFO,{namespace:a,name:n},t):void 0}})(e,r),F=((e,t)=>{const r=oe(),{notifyError:a,notifySuccess:n,notifyReadonly:o}=ve(f.SamplingRule),s=async()=>{e.GET_SAMPLING_RULES&&await we(r,e.GET_SAMPLING_RULES,void 0,t)},i=(e,i)=>e?async c=>{if(t.isReadonly)return o();const{error:l}=await be(r,e,c,t);return l?a(i,l):(n(p.Create,"Successfully created sampling rule"),await s()),l?{error:l}:void 0}:void 0,c=(e,i)=>e?async(c,l)=>{if(t.isReadonly)return o();const{error:d}=await be(r,e,{samplingId:l.samplingId,ruleId:c,rule:l.rule},t);return d?a(i,d):(n(p.Update,"Successfully updated sampling rule"),await s()),d?{error:d}:void 0}:void 0,l=e=>e?async(i,c)=>{if(t.isReadonly)return o();const{error:l}=await be(r,e,{samplingId:c,ruleId:i},t);return l?a(p.Delete,l):(n(p.Delete,"Successfully deleted sampling rule"),await s()),l?{error:l}:void 0}:void 0;return{useSamplingRules:()=>{const e=Me("GET_SAMPLING_RULES",void 0,{fetchPolicy:"cache-first"});return{items:e.data?.computePlatform?.samplingRules??e.data?.samplingRules??Be,k8sHealthProbesConfig:e.data?.computePlatform?.k8sHealthProbesConfig??e.data?.k8sHealthProbesConfig??null,loading:e.loading,refetch:s}},fetchAll:e.GET_SAMPLING_RULES?async()=>we(r,e.GET_SAMPLING_RULES,void 0,t):void 0,createNoisy:i(e.CREATE_NOISY_OPERATION_RULE,p.Create),updateNoisy:c(e.UPDATE_NOISY_OPERATION_RULE,p.Update),deleteNoisy:l(e.DELETE_NOISY_OPERATION_RULE),createHighlyRelevant:i(e.CREATE_HIGHLY_RELEVANT_OPERATION_RULE,p.Create),updateHighlyRelevant:c(e.UPDATE_HIGHLY_RELEVANT_OPERATION_RULE,p.Update),deleteHighlyRelevant:l(e.DELETE_HIGHLY_RELEVANT_OPERATION_RULE),createCostReduction:i(e.CREATE_COST_REDUCTION_RULE,p.Create),updateCostReduction:c(e.UPDATE_COST_REDUCTION_RULE,p.Update),deleteCostReduction:l(e.DELETE_COST_REDUCTION_RULE),updateK8sHealthProbesConfig:e.UPDATE_LOCAL_UI_SAMPLING_CONFIG?async n=>{if(t.isReadonly)return o();const{error:i}=await be(r,e.UPDATE_LOCAL_UI_SAMPLING_CONFIG,{config:{k8sHealthProbesSampling:n}},t);return i?a(p.Update,i):await s(),i?{error:i}:void 0}:void 0}})(e,r),G=((e,r)=>{const a=oe();return{useSnapshots:()=>{const e=r.proxyID,a=!!e,o=Me("GET_ALL_CLUSTER_SNAPSHOTS",void 0,{fetchPolicy:"cache-and-network",skip:a}),s=Me("GET_CLUSTER_SNAPSHOT",e?{clusterId:e}:void 0,{fetchPolicy:"cache-and-network",skip:!a}),i=t(()=>a?ze(s.data):o.data,[a,s.data,o.data]),c=a?s.loading:o.loading,l=n(async()=>{if(!a)return o.refetch();const{data:e}=await s.refetch();return{data:ze(e)}},[a,o.refetch,s.refetch]);return{data:i,loading:c,pending:c&&!i,unsupported:a?s.unsupported:o.unsupported,refetch:l}},getAllClusterSnapshots:e.GET_ALL_CLUSTER_SNAPSHOTS?async()=>we(a,e.GET_ALL_CLUSTER_SNAPSHOTS,void 0,r):void 0,getClusterSnapshot:e.GET_CLUSTER_SNAPSHOT?async t=>we(a,e.GET_CLUSTER_SNAPSHOT,{clusterId:t},r):void 0}})(e,r);return{sourcesApi:o,destinationsApi:i,actionsApi:l,instrumentationRulesApi:d,dataStreamsApi:m,namespacesApi:C,k8sManifestApi:N,configApi:O,describeApi:D,tokensApi:w,metricsApi:b,serviceMapApi:P,profilingApi:L,collectorsApi:k,samplingApi:F,snapshotsApi:G,capabilities:t(()=>((e,t)=>{const r=t.platformType===E.K8s,a=r,n=r,o=!(t.platformType===E.Vm);return{canBulkPersistSources:o&&!!e.PERSIST_SOURCES,canInstrumentNamespaces:n&&!!e.PERSIST_NAMESPACES,canFetchSnapshots:a&&!!e.GET_ALL_CLUSTER_SNAPSHOTS,canRecoverFromRollback:a&&!!e.RECOVER_FROM_ROLLBACK,canRestartWorkloads:a&&!!e.RESTART_WORKLOADS,canFetchPeerSources:!!e.GET_PEER_SOURCES,canFetchSourceLibraries:!!e.GET_SOURCE_LIBRARIES,canFetchK8sManifest:a&&!!e.GET_K8S_MANIFEST,canCreateDestination:!!e.CREATE_DESTINATION,canTestConnection:o&&!!e.TEST_DESTINATION_CONNECTION,canFetchDestinationCategories:!!e.GET_DESTINATION_CATEGORIES,canFetchPotentialDestinations:o&&!!e.GET_POTENTIAL_DESTINATIONS,canCreateAction:!!e.CREATE_ACTION,canFetchActionTypes:!!e.GET_ACTION_TYPES,canCreateInstrumentationRule:!!e.CREATE_INSTRUMENTATION_RULE,canFetchInstrumentationRuleTypes:!!e.GET_INSTRUMENTATION_RULE_TYPES,canApplyEffectiveConfig:o&&!!e.UPDATE_REMOTE_CONFIG&&!!e.GET_EFFECTIVE_CONFIG,canFetchEffectiveConfig:!!e.GET_EFFECTIVE_CONFIG,canFetchConfigYamls:!!e.GET_CONFIG_YAMLS,canFetchProfiling:a&&!!e.GET_PROFILING_SLOTS,canFetchCollectorInfo:a&&!!e.GET_GATEWAY_INFO,canManageSamplingRules:!!e.GET_SAMPLING_RULES}})(e,r),[e,r]),resetCache:n(async()=>{await a.cache.reset()},[a])}},rt={type:"",disabled:!1,name:"",notes:"",signals:[],fields:{}},at=a(null),nt=(e,t)=>{const r=N(e??{}),a=r[D.ExtractAttribute];a?.extractions?.length&&(a.extractions=a.extractions.map(e=>{const t=e;return{...t,method:t.method||(t.regex?.trim()?"regex":"preset")}}));const n=new Set((t?.fields||[]).filter(e=>e.componentType===w.SourceScopes).map(e=>e.name));return void 0!==r[D.Scopes]&&n.add(D.Scopes),n.forEach(e=>{const t=e;r[t]=Q(r[t])}),r},ot="All row fields are required",st="At least one row is required",it=(e,t)=>!!e&&t.every(t=>{const r=e[t];return Array.isArray(r)?r.length>0:!("string"==typeof(a=r)?!a.trim():P(a));var a}),ct=({children:r,sourceOptions:a=[],namespaceOptions:s=[]})=>{const[i,c]=o(null),d=C(rt),u=n(e=>{d.resetFormData(),d.handleErrorChange(void 0,void 0,{}),e?.type&&d.handleFormChange("type",e.type),c(e)},[]),m=n((e,t)=>{const r=t??(a=e.type,O.find(e=>e.type===a)??null);var a;d.resetFormData((({type:e,name:t,notes:r,disabled:a,signals:n,fields:o},s)=>({type:e,name:t||"",notes:r||"",disabled:!!a,signals:n??[],fields:nt(o,s)}))(e,r)),d.handleErrorChange(void 0,void 0,{}),c(r)},[]),p=n(()=>{if(!i)return{errorMessage:"No action type selected",preparedFormData:N(rt)};const e=((e,t)=>{const r=N(e),a=r.fields||{},n=a[D.UrlTemplatizationRulesGroups];n?.length&&(a[D.UrlTemplatizationRulesGroups]=n.map(e=>({...e,templatizationRules:(e.templatizationRules||[]).filter(e=>!!e.template?.trim())})));const o=a[D.AttributeNamesToDelete];o?.length&&(a[D.AttributeNamesToDelete]=o.filter(e=>!!e?.trim()));const s=a[D.Renames];if(s){const e=Array.isArray(s)?s.map(e=>[e?.key??"",e?.value??""]):Object.entries(s);a[D.Renames]=Object.fromEntries(e.filter(([e,t])=>!!e?.trim()&&!!t?.trim()))}const i=new Set((t?.fields||[]).filter(e=>e.componentType===w.SourceScopes).map(e=>e.name));void 0!==a[D.Scopes]&&i.add(D.Scopes),i.forEach(e=>{const t=a[e];void 0!==t&&(a[e]=B(t)?null:t)});const c=a[D.ExtractAttribute];return c?.extractions?.length&&(a[D.ExtractAttribute]={extractions:c.extractions.map(e=>{const t=e,r=t.method||(t.regex?.trim()?"regex":"preset"),a=t.targetAttributeName?.trim()||"";if("regex"===r)return{targetAttributeName:a,lookupKey:"",regex:t.regex?.trim()||""};const n={targetAttributeName:a,lookupKey:t.lookupKey?.trim()||"",regex:""};return t.dataFormat&&(n.dataFormat=t.dataFormat),n}).filter(e=>!!(e.targetAttributeName||e.lookupKey||e.dataFormat||e.regex))}),r.fields=a,r})(d.formData,i),t={};return P(e.signals)&&(t.signals=l.FIELD_IS_REQUIRED),i.type&&Object.assign(t,((e,t,r)=>{const a={},n=t.fields||{},o=r.fields||{};switch(e){case b.K8sAttributes:{const e=!(n[D.CollectContainerAttributes]||n[D.CollectReplicaSetAttributes]||n[D.CollectWorkloadId]||n[D.CollectClusterId]),t=!n[D.LabelsAttributes]?.length,r=!n[D.AnnotationsAttributes]?.length;e&&t&&r&&(a[D.CollectContainerAttributes]="Enable at least one option or add a label/annotation row");const o=n[D.LabelsAttributes];o?.some(e=>!it(e,["labelKey","attributeKey","fromSources"]))&&(a[D.LabelsAttributes]=ot);const s=n[D.AnnotationsAttributes];s?.some(e=>!it(e,["annotationKey","attributeKey","fromSources"]))&&(a[D.AnnotationsAttributes]=ot);break}case b.AddClusterInfo:{const e=n[D.ClusterAttributes];e?.length?e.some(e=>!it(e,["attributeName","attributeStringValue"]))&&(a[D.ClusterAttributes]=ot):a[D.ClusterAttributes]=st;break}case b.DeleteAttributes:{const e=o[D.AttributeNamesToDelete]||[],t=n[D.AttributeNamesToDelete]||[];t.length?e.length>t.length&&(a[D.AttributeNamesToDelete]=ot):a[D.AttributeNamesToDelete]=e.length?ot:st;break}case b.RenameAttributes:{const e=Object.entries(o[D.Renames]||{}),t=Object.entries(n[D.Renames]||{}),r=e.some(([e,t])=>!e?.trim()||!t?.trim());t.length?r&&(a[D.Renames]=ot):a[D.Renames]=e.length?ot:st;break}case b.PiiMasking:{const e=n[D.PiiCategories];e?.length||(a[D.PiiCategories]="Select at least one attribute to mask");break}case b.URLTemplatization:{const e=n[D.UrlTemplatizationRulesGroups];(!e?.length||e.some(e=>!e.templatizationRules?.length))&&(a[D.UrlTemplatizationRulesGroups]="Each rule group needs at least one non-blank template");break}case b.ExtractAttribute:{const e=n[D.ExtractAttribute]?.extractions||[],t=o[D.ExtractAttribute]?.extractions||[];if(e.length)if(e.some(e=>{if(!e.targetAttributeName?.trim())return!0;const t=!!e.regex?.trim(),r=!!e.lookupKey?.trim();return r!==!!e.dataFormat||t===r}))a[D.ExtractAttribute]="Each row needs a target attribute name and either a regex or both lookup key and data format";else{const t=new Set;e.some(e=>{const r=e.targetAttributeName?.trim()||"";return!!t.has(r)||(t.add(r),!1)})&&(a[D.ExtractAttribute]="Each new span attribute name must be unique")}else a[D.ExtractAttribute]=t.length?ot:st;break}}return a})(i.type,e,d.formData)),d.handleErrorChange(void 0,void 0,t),{errorMessage:Object.keys(t).length>0?"Invalid form values":void 0,preparedFormData:e}},[d,i]),f=t(()=>({selectedOption:i,onSelectOption:u,loadAction:m,genericForm:d,validateFormData:p,sourceOptions:a,namespaceOptions:s}),[i,u,m,d,p,a,s]);return e(at.Provider,{value:f,children:r})},lt=()=>{const e=r(at);if(!e)throw new Error("useActionFormContext must be used within an ActionFormContextProvider");return e},dt={provider:"",permission:"",customCapabilities:{},authMethod:"",setupMethod:"",awsAccountId:"",credentials:{},accessToken:"",secretId:"",name:""},ut=a(null),mt=({children:r,providers:a=[]})=>{const o=C(dt),s=n(()=>{const e=N(o.formData);return e.provider?e.permission?{errorMessage:void 0,preparedFormData:e}:{errorMessage:"Please select a permission level",preparedFormData:e}:{errorMessage:"Please select a provider",preparedFormData:e}},[o]),i=t(()=>({providers:a,genericForm:o,validateFormData:s}),[a,o,s]);return e(ut.Provider,{value:i,children:r})},pt=()=>{const e=r(ut);if(!e)throw new Error("useCloudConnectorFormContext must be used within a CloudConnectorFormContextProvider");return e},ft={name:""},Et=a(null),yt=({children:r,defaultExcludeName:a=""})=>{const{dataStreams:s}=y(),[c,d]=o(void 0),[u,m]=o(a),[p,f]=o(void 0),[E,h]=o(null),S=i(null),T=C(ft),g=n(e=>{T.resetFormData({name:e}),T.handleErrorChange(void 0,void 0,{}),d(void 0),m(e),f(e),h(null),S.current=null},[]),_=n(()=>{const e=N(T.formData),t=(e=>{const t={};return e.name?L(e.name)||(t.name=l.ILLEGAL_K8S_LABEL):t.name=l.FIELD_IS_REQUIRED,t})(e);T.handleErrorChange(void 0,void 0,t);const r=Object.keys(t).length>0?l.REQUIRED_FIELDS:void 0;return d(r),{errorMessage:r,preparedFormData:e}},[T]),I=n(async e=>{const{errorMessage:t,preparedFormData:r}=_();if(t)return;const a=s.find(e=>e.name===r.name&&e.name!==u);if(a)return S.current=e,void h({preparedFormData:r,existingName:a.name,editingName:p});await e(r)},[_,s,u,p]),A=n(async()=>{const e=S.current,t=E?.preparedFormData;S.current=null,h(null),e&&t&&await e(t)},[E]),v=n(()=>{S.current=null,h(null)},[]),R=t(()=>({genericForm:T,loadDataStream:g,editingName:p,validateFormData:_,requestSubmit:I,pendingMerge:E,confirmMerge:A,cancelMerge:v,errorMessage:c,excludeName:u,setExcludeName:m}),[T,g,p,_,I,E,A,v,c,u]);return e(Et.Provider,{value:R,children:r})},ht=()=>{const e=r(Et);if(!e)throw new Error("useDataStreamFormContext must be used within a DataStreamFormContextProvider");return e},St={type:"",name:"",currentStreamName:"",disabled:!1,exportedSignals:{logs:!1,metrics:!1,traces:!1,profiles:!1},fields:[]},Tt={activeForm:null,onChangeActiveForm:()=>{},loadDestination:()=>{},genericForm:void 0,validateFormData:()=>({isOk:!1,preparedFormData:N(St)}),unsavedDestinations:[],thisUnsavedDestination:void 0,setUnsavedDestinations:()=>{},addUnsavedDestination:()=>{},updateUnsavedDestination:()=>{},deleteUnsavedDestination:()=>{}},gt=a(Tt),_t=e=>e.filter(e=>!!e).map(e=>{const{name:t,componentType:r,componentProperties:a,displayName:n,initialValue:o,renderCondition:s}=e,i=r===w.Dropdown,c=U(a,{});return{componentType:r,renderCondition:s,name:t,title:n,value:o,placeholder:c.placeholder||(i?"Select an option":void 0),options:i&&Array.isArray(c.values)?c.values.map(e=>({id:e,label:e})):void 0,...c}}),It=({children:r})=>{const{selectedStreamName:a}=y(),{items:i}=tt().destinationsApi.useDestinations(),[c,d]=o(null),[u,m]=o(Tt.unsavedDestinations),p=t(()=>"number"==typeof c?.unsavedIdx?u[c.unsavedIdx]:void 0,[c,u]),f=n((e,t)=>{c&&(m(t=>[...t,{...e,option:c.option}]),d(t?e=>e?{...e,listType:k.UNSAVED,unsavedIdx:u.length}:null:null))},[c,u.length]),E=n((e,t,r)=>{c&&(m(r=>r.map((r,a)=>a===e?{...r,...t,option:c.option}:r)),d(r?e=>e?{...e,listType:k.UNSAVED}:null:null))},[c]),h=n(e=>{m(t=>t.filter((t,r)=>r!==e)),d(null)},[]),S=C({...St,currentStreamName:a});s(()=>{if(!c)return;if(p)return void S.resetFormData({...p.formData});if(c.listType===k.EXISTS&&c.option.id){const e=i.find(e=>e.id===c.option.id);if(e)return void S.resetFormData({type:e.destinationType.type,name:e.name||e.destinationType.displayName,currentStreamName:a,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=F(c.option.supportedSignals);S.resetFormData({type:c.option.type,name:c.option.displayName,currentStreamName:a,disabled:!1,exportedSignals:{logs:e.includes(G.Logs),metrics:e.includes(G.Metrics),traces:e.includes(G.Traces),profiles:e.includes(G.Profiles)},fields:c.dynamicFields.map(e=>({key:e.name,value:e.value}))})},[c,p]);const T=n(e=>{S.resetFormData(),S.handleErrorChange(void 0,void 0,{}),d(e?{...e,dynamicFields:e.option?.fields?_t(e.option.fields):[]}:null)},[]),g=n((e,t)=>{let r;for(const a of t){const t=a.items.find(t=>t.type===e.destinationType.type);if(t){r=t;break}}const a=U(e.fields,{}),n={id:e.id,type:e.destinationType.type,displayName:e.name||e.destinationType.displayName,selected:!0,testConnectionSupported:r?.testConnectionSupported??!1,supportedSignals:e.destinationType.supportedSignals,fields:r?r.fields.map(e=>({...e,initialValue:a[e.name]??e.initialValue})):[]},o=_t(n.fields);d({listType:k.EXISTS,option:n,dynamicFields:o})},[]),_=n(()=>{const e=N(S.formData),t={};return c?.dynamicFields.forEach(({name:r,required:a})=>{if(a){const a=e.fields.find(e=>e.key===r)?.value;P(a)&&(t[r]=l.FIELD_IS_REQUIRED)}}),M(e.exportedSignals).length||(t.exportedSignals=l.FIELD_IS_REQUIRED),S.handleErrorChange(void 0,void 0,t),{errorMessage:0===Object.keys(t).length?void 0:"Invalid form values",preparedFormData:e}},[S,c]);return e(gt.Provider,{value:{activeForm:c,onChangeActiveForm:T,loadDestination:g,genericForm:S,validateFormData:_,unsavedDestinations:u,thisUnsavedDestination:p,setUnsavedDestinations:m,addUnsavedDestination:f,updateUnsavedDestination:E,deleteUnsavedDestination:h},children:r})},At=()=>r(gt),vt={disabled:!1,ruleName:"",notes:"",sourceScopes:z(),workloads:null,instrumentationLibraries:null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:null,networkMetrics:null},Rt=a(null),Ct=({children:r,sourceOptions:a=[],namespaceOptions:s=[]})=>{const[i,c]=o(null),l=C(vt),d=n(e=>{l.resetFormData(),l.handleErrorChange(void 0,void 0,{}),c(e)},[]),u=n((e,t)=>{var r;l.resetFormData((({ruleName:e,notes:t,disabled:r,sourceScopes:a,instrumentationLibraries:n,payloadCollection:o,codeAttributes:s,headersCollection:i,customInstrumentations:c,networkMetrics:l})=>({ruleName:e||"",notes:t||"",disabled:!!r,sourceScopes:Q(a),workloads:null,instrumentationLibraries:n??null,payloadCollection:o??null,codeAttributes:s??null,headersCollection:i??null,customInstrumentations:c??null,networkMetrics:l??null}))(e)),l.handleErrorChange(void 0,void 0,{}),c(t??(r=e.type,x.find(e=>e.type===r)??null))},[]),m=n(()=>{if(!i)return{errorMessage:"No rule type selected",preparedFormData:N(vt)};const e=(e=>{const t=N(e),r={...t,sourceScopes:B(t.sourceScopes)?null:t.sourceScopes,workloads:null};return r.headersCollection?.[H.HeaderKeys]?.length&&(r.headersCollection[H.HeaderKeys]=r.headersCollection[H.HeaderKeys].map(e=>e.trim()).filter(e=>e)),r.customInstrumentations?.[K.Golang]?.length&&(r.customInstrumentations[K.Golang]=r.customInstrumentations[K.Golang].map(e=>new V(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})),r.customInstrumentations?.[K.Java]?.length&&(r.customInstrumentations[K.Java]=r.customInstrumentations[K.Java].map(e=>new W(e.className,e.methodName)).filter(e=>{return t=e,!(!t.className?.trim()&&!t.methodName?.trim());var t})),r.customInstrumentations?.[K.Php]?.length&&(r.customInstrumentations[K.Php]=r.customInstrumentations[K.Php].map(e=>new Y(e.className,e.functionName)).filter(e=>{return t=e,!(!t.className?.trim()&&!t.functionName?.trim());var t})),r})(l.formData),t=((e,t)=>{const r={};switch(e){case $.CodeAttributes:Object.values(t.codeAttributes||{}).some(e=>null!=e)||(r.codeAttributes="Code attributes are required");break;case $.PayloadCollection:Object.values(t.payloadCollection||{}).some(e=>null!=e)||(r.payloadCollection="Payload collection are required");break;case $.HeadersCollection:t.headersCollection?.[H.HeaderKeys]?.length||(r.headersCollection="Header keys are required");break;case $.CustomInstrumentation:{const e=t.customInstrumentations?.[K.Golang]||[],a=t.customInstrumentations?.[K.Java]||[],n=t.customInstrumentations?.[K.Php]||[];if(!e.length&&!a.length&&!n.length){r.customInstrumentations="Custom instrumentation are required";break}const o=e.findIndex(e=>!new V(e.packageName,e.functionName,e.receiverName,e.receiverMethodName).Verify());if(-1!==o){r.customInstrumentations=`Golang probe #${o+1} is invalid: provide a package name plus either a function name OR both a receiver name and receiver method name`;break}const s=a.findIndex(e=>!new W(e.className,e.methodName).Verify());if(-1!==s){r.customInstrumentations=`Java probe #${s+1} is invalid: both class name and method name are required`;break}const i=n.findIndex(e=>!new Y(e.className,e.functionName).Verify());if(-1!==i){r.customInstrumentations=`PHP probe #${i+1} is invalid: function name is required`;break}break}}return r})(i.type,e);return l.handleErrorChange(void 0,void 0,t),{errorMessage:Object.keys(t).length>0?"Invalid form values":void 0,preparedFormData:e}},[l,i]),p=t(()=>({selectedOption:i,onSelectOption:d,loadRule:u,genericForm:l,validateFormData:m,sourceOptions:a,namespaceOptions:s}),[i,d,u,l,m,a,s]);return e(Rt.Provider,{value:p,children:r})},Nt=()=>{const e=r(Rt);if(!e)throw new Error("useRuleFormContext must be used within a RuleFormContextProvider");return e};var Ot;(e=>{e.Create="create",e.View="view",e.EditAutoNoisy="edit-auto-noisy",e.EditAutoCostReduction="edit-auto-cost-reduction",e.EditAutoHighlyRelevant="edit-auto-highly-relevant"})(Ot||(Ot={}));const Dt=a(null),wt=["50","25","10","1"];function bt(e){const t=String(e);return wt.includes(t)?t:"custom"}const Pt=({category:r,sourceOptions:a=[],namespaceOptions:i=[],children:c})=>{const{formData:l,handleFormChange:d,resetFormData:u}=C(te(r)),[m,p]=o(null);s(()=>{u(te(r)),p(null)},[r]);const f=n(e=>{p(null),d(void 0,void 0,{...l,...e})},[l,d]),E=n(()=>{u(te(r)),p(null)},[r,u]),y=t(()=>({formType:Ot.Create,category:r,formData:l,handleChange:f,resetForm:E,duplicateWarning:m,setDuplicateWarning:p,sourceOptions:a,namespaceOptions:i}),[r,l,f,E,m,a,i]);return e(Dt.Provider,{value:y,children:c})},Lt=({data:r,defaultEditMode:a,sourceOptions:c=[],namespaceOptions:l=[],children:d})=>{const[u,m]=o(!1),{formData:p,handleFormChange:f,resetFormData:E}=C(void 0),y=i(null),[h,S]=o(null);s(()=>{r!==y.current&&(y.current=r,r&&a?(E(ee(r)),S(null),m(!0)):(m(!1),S(null)))},[r,a]);const T=n(e=>{S(null),f(void 0,void 0,{...p,...e})},[p,f]),g=n(()=>{r&&(E(ee(r)),S(null),m(!0))},[r,E]),_=n(()=>{m(!1),S(null)},[]),I=t(()=>({formType:Ot.View,data:r,isEditing:u,formData:p,handleChange:T,handleEdit:g,handleCancelEdit:_,duplicateWarning:h,setDuplicateWarning:S,sourceOptions:c,namespaceOptions:l}),[r,u,p,T,g,_,h,c,l]);return e(Dt.Provider,{value:I,children:d})};function kt(e){const[r,a]=o(()=>0===e?"all":"sample"),[n,i]=o(()=>bt(e)),[c,l]=o(()=>"custom"===bt(e)?String(e):"");s(()=>{a(0===e?"all":"sample");const t=bt(e);i(t),l("custom"===t?String(e):"")},[e]);const d=t(()=>"all"===r?0:"custom"===n?Number(c)||0:Number(n),[r,n,c]);return{percentageMode:r,setPercentageMode:a,percentagePreset:n,setPercentagePreset:i,customPercentage:c,setCustomPercentage:l,resolvedPercentage:d}}const Ft=({enabled:r,keepPercentage:a,children:n})=>{const[i,c]=o(r),l=kt(a);s(()=>{c(r)},[r]);const d=t(()=>Z({enabled:i,keepPercentage:l.resolvedPercentage}),[i,l.resolvedPercentage]),u=t(()=>({formType:Ot.EditAutoNoisy,localEnabled:i,setLocalEnabled:c,...l,summary:d}),[i,l,d]);return e(Dt.Provider,{value:u,children:n})},Gt=({enabled:r,dropPercentage:a,children:n})=>{const[i,c]=o(r),l=kt(a);s(()=>{c(r)},[r]);const d=t(()=>X(i?{disabled:!1,percentageAtMost:l.resolvedPercentage}:null),[i,l.resolvedPercentage]),u=t(()=>({formType:Ot.EditAutoCostReduction,localEnabled:i,setLocalEnabled:c,...l,summary:d}),[i,l,d]);return e(Dt.Provider,{value:u,children:n})},Ut=({enabled:r,children:a})=>{const[n,i]=o(r);s(()=>{i(r)},[r]);const c=t(()=>J(n?{disabled:!1}:null),[n]),l=t(()=>({formType:Ot.EditAutoHighlyRelevant,localEnabled:n,setLocalEnabled:i,summary:c}),[n,c]);return e(Dt.Provider,{value:l,children:a})},Mt=t=>{switch(t.formType){case Ot.Create:return e(Pt,{...t});case Ot.View:return e(Lt,{...t});case Ot.EditAutoNoisy:return e(Ft,{...t});case Ot.EditAutoCostReduction:return e(Gt,{...t});case Ot.EditAutoHighlyRelevant:return e(Ut,{...t})}};function xt(e){const t=r(Dt);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 Ht={otelServiceName:"",currentStreamName:""},Kt=a(null),Vt=({children:r})=>{const[a,s]=o(void 0),i=C(Ht),c=n(e=>{i.resetFormData((({serviceName:e,id:t})=>({otelServiceName:e||t.name||"",currentStreamName:""}))(e)),i.handleErrorChange(void 0,void 0,{}),s(void 0)},[]),l=n(()=>{const e=N(i.formData);return i.handleErrorChange(void 0,void 0,{}),s(void 0),{errorMessage:void 0,preparedFormData:e}},[i]),d=t(()=>({loadSource:c,genericForm:i,validateFormData:l,errorMessage:a}),[c,i,l,a]);return e(Kt.Provider,{value:d,children:r})},Wt=()=>{const e=r(Kt);if(!e)throw new Error("useSourceEditFormContext must be used within a SourceEditFormContextProvider");return e},Yt=new Set([j.StaticPod]),$t=e=>{const t=e.workloads.filter(({selected:e})=>e).length,r=e.workloads.length;return{selectedCount:t,isAllSourced:t>0&&t===r,isSomeSourced:t>0&&t<r,isFutureApps:e.selected||!1}},jt=(e,t,r)=>{if(t&&!e.name.toLowerCase().includes(t.toLowerCase()))return!1;if(r.showOnlySelected){const{isAllSourced:t,isSomeSourced:r,isFutureApps:a}=$t(e);return t||r||a}return!0},qt=(e,t,r)=>!(t&&!e.name.toLowerCase().includes(t.toLowerCase()))&&(!r.showOnlySelected||e.selected),Bt=a({snapshots:null,setSnapshots:()=>{},isFetching:!1,setIsFetching:()=>{},formData:[],handleSourceChange:()=>{},handleSelectAll:()=>{},formDiff:{},isFormDirty:!1}),Qt=(e,t)=>`${e}\0${t}`,zt=(e,t,r,a)=>`${e}\0${t}\0${r}/${a}`,Jt=(e,t)=>e.name===t.name&&e.kind===t.kind&&(e.region??"")===(t.region??""),Xt=(e,t,r)=>{const a=[];return t.workloads.forEach(n=>{const o=e?.workloads.find(e=>Jt(e,n));n.selected!==o?.selected&&a.push({namespace:t.name,name:n.name,kind:n.kind,region:n.region||void 0,selected:n.selected||!1,currentStreamName:r})}),a},Zt=({children:r,selectedConnectionIds:a,initialInputs:c})=>{const{tier:l}=re(),d=l===q.Onprem,{capabilities:u}=tt(),m=u.canInstrumentNamespaces,{selectedStreamName:p}=y(),[E,h]=o(!1),[S,T]=o(null),[g,_]=o([]),I=i(new Set),A=n((e,t)=>{t.forEach(t=>{const r=e.find(e=>e.clusterId===t.clusterId);r&&t.namespaces.forEach(e=>{const a=r.namespaces.find(t=>t.name===e.name);a&&(a.selected!==e.selected&&I.current.add(Qt(t.clusterId,e.name)),e.workloads.forEach(r=>{const n=a.workloads.find(e=>e.name===r.name&&e.kind===r.kind);n&&n.selected!==r.selected&&I.current.add(zt(t.clusterId,e.name,r.kind,r.name))}))})})},[]);s(()=>{S&&_(e=>{const t=((e,t)=>N(((e,t)=>e.clusters.filter(({clusterId:e})=>!t||t.includes(e)))(e,t)))(S,a);return t.map(t=>{const r=e?.find(e=>e.clusterId===t.clusterId),a=((e,t,r)=>{if(!t)return e;const a=new Map(t.namespaces.map(e=>[e.name,e]));return{...e,namespaces:e.namespaces.map(t=>{const n=a.get(t.name);if(!n)return t;const o=new Map(n.workloads.map(e=>[`${e.kind}/${e.name}`,e])),s=r.has(Qt(e.clusterId,t.name));return{...t,selected:s?n.selected:t.selected,workloads:t.workloads.map(a=>{const n=o.get(`${a.kind}/${a.name}`),s=r.has(zt(e.clusterId,t.name,a.kind,a.name));return n&&s?{...a,selected:n.selected}:a})}})}})(t,r,I.current);if(c?.[t.clusterId]){const e=c[t.clusterId],r=N(a);return e.forEach(e=>{const t=r.namespaces.find(t=>t.name===e.namespace);if(t)if(e.name&&e.kind){const r=t.workloads.find(t=>t.name===e.name&&t.kind===e.kind);r&&(r.selected=e.selected)}else t.selected=e.selected,e.selected&&t.workloads.forEach(e=>{Yt.has(e.kind)&&!d||(e.selected=!0)})}),r}return a})})},[S,a,c]);const{formDiff:v,isFormDirty:R}=t(()=>{const e=((e,t,r,a)=>{const n={};return e.forEach(e=>{e.namespaces.forEach(o=>{const s=t.find(t=>t.clusterId===e.clusterId)?.namespaces.find(e=>e.name===o.name);if(!a){const t=Xt(s,o,r);return void(t.length>0&&(n[e.clusterId]||(n[e.clusterId]=[]),n[e.clusterId].push(...t)))}const i=o.selected||!1;if(i!==s?.selected)n[e.clusterId]||(n[e.clusterId]=[]),n[e.clusterId].push({namespace:o.name,selected:i,currentStreamName:r}),i?n[e.clusterId]=n[e.clusterId].filter(e=>e.namespace!==o.name||e.namespace===o.name&&(!e.name||!e.kind)):o.workloads.forEach(t=>{t.selected&&n[e.clusterId].push({namespace:o.name,name:t.name,kind:t.kind,region:t.region||void 0,selected:!0,currentStreamName:r})});else{const t=Xt(s,o,r);t.length>0&&(n[e.clusterId]||(n[e.clusterId]=[]),n[e.clusterId].push(...t))}})}),n})(g,S?.clusters||[],p,m);return{formDiff:e,isFormDirty:Object.keys(e).length>0}},[g,S,p,m]),C=n(e=>!d&&Yt.has(e),[d]),O=n(({clusterId:e,workloadId:t,selected:r,auto:a})=>{_(n=>{const o=N(n),s=o.findIndex(t=>t.clusterId===e);if(-1===s)return o;const i=o[s].namespaces.findIndex(e=>e.name===t.namespace);if(-1===i)return o;if(t.kind&&t.name){const e=o[s].namespaces[i].workloads.findIndex(e=>Jt(e,{name:t.name,kind:t.kind,region:t.region}));if(-1===e)return o;const a="boolean"==typeof r?r:!o[s].namespaces[i].workloads[e].selected;o[s].namespaces[i].workloads[e].selected=a,m&&(a?o[s].namespaces[i].workloads.filter(e=>!C(e.kind)).every(e=>e.selected)&&(o[s].namespaces[i].selected=!0):o[s].namespaces[i].selected=!1)}else if(m){const e="boolean"==typeof a?a:!o[s].namespaces[i].selected;o[s].namespaces[i].selected=e,e?o[s].namespaces[i].workloads.forEach(e=>{C(e.kind)||(e.selected=!0)}):"boolean"!=typeof r||r||o[s].namespaces[i].workloads.forEach(e=>{e.selected=!1})}else{const e="boolean"==typeof r?r:"boolean"!=typeof a||a;o[s].namespaces[i].workloads.forEach(t=>{e&&C(t.kind)||(t.selected=e)})}return A(n,o),o})},[C,m,A]),D=n(({clusterId:e,namespaceName:t,boolean:r,searchText:a="",searchBy:n="",filters:o})=>{_(s=>{const i=N(s),c=n===f.Namespace?a:"",l=n===f.Source?a:"",d=!!c||!!l||!!o?.showOnlySelected;return i.forEach((a,n)=>{e&&a.clusterId!==e||a.namespaces.forEach(({name:e,workloads:a},s)=>{if(!t||e===t)if(d)if(t){if(a.forEach((e,t)=>{r&&C(e.kind)||qt(e,l,o||{showOnlySelected:!1})&&(i[n].namespaces[s].workloads[t].selected=r)}),m){const e=i[n].namespaces[s].workloads.filter(e=>!C(e.kind)).every(e=>e.selected);i[n].namespaces[s].selected=e}}else{if(!jt(i[n].namespaces[s],c,o||{showOnlySelected:!1}))return;m&&(i[n].namespaces[s].selected=r),a.forEach((e,t)=>{r&&C(e.kind)||(i[n].namespaces[s].workloads[t].selected=r)})}else m&&(i[n].namespaces[s].selected=r),a.forEach((e,t)=>{r&&C(e.kind)||(i[n].namespaces[s].workloads[t].selected=r)})})}),A(s,i),i})},[C,m,A]);return e(Bt.Provider,{value:{snapshots:S,setSnapshots:T,isFetching:E,setIsFetching:h,formData:g,handleSourceChange:O,handleSelectAll:D,formDiff:v,isFormDirty:R},children:r})},er=()=>r(Bt);export{ct as A,mt as C,yt as D,Yt as E,Ie as O,Ct as R,Ot as S,Pe as a,It as b,ge as c,Mt as d,Vt as e,Zt as f,Ve as g,lt as h,xe as i,He as j,Me as k,pt as l,ht as m,At as n,tt as o,We as p,Nt as q,be as r,xt as s,Wt as t,Te as u,er as v,qt as w,jt as x,$t as y};
|
|
@@ -38,7 +38,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{css as
|
|
|
38
38
|
text-decoration: underline;
|
|
39
39
|
}
|
|
40
40
|
`}
|
|
41
|
-
`,vo=Mt(({children:n,variant:o=ho.P,color:r,size:i=go.S,weight:a=400,opacity:s=1,align:l="left",lineHeight:c,transform:d,nowrap:u,underline:p,onClick:h,disabled:g,maxLines:m,...f},y)=>{const b="string"==typeof n?n.split("\n").map((n,o,r)=>e(Ut,{children:[n,o!==r.length-1&&t("br",{})]},`typography-${o}-${n}`)):n;return t(bo,{ref:y,as:o,$color:r,$size:i,$weight:a,$opacity:s,$align:l,$lineHeight:c,$transform:d,$nowrap:u,$underline:p,$maxLines:m,$withClick:!!h&&!g,onClick:g?void 0:h,...f,children:b})});vo.displayName="Typography";const Eo="https://docs.odigos.io",So="default",$o="this-cluster",Co="This Cluster",xo={SELECTED_DATA_STREAM:"SELECTED_DATA_STREAM",SELECTED_DATA_STREAM_WITH_PROXY:e=>`SELECTED_DATA_STREAM_${e}`,OVERVIEW_FILTERS:"OVERVIEW_FILTERS",DARK_MODE:"DARK_MODE"},wo={REQUIRED_FIELDS:"Required fields are missing",FIELD_IS_REQUIRED:"This field is required",FORBIDDEN:"Forbidden",ENTERPRISE_ONLY:(e="This")=>`${e} is an Enterprise feature. Please upgrade your plan.`,DEFINED_FOR_ALL_STREAMS:e=>`${e} are defined for all Data Streams.`,CANNOT_EDIT_RULE:"Cannot edit a system-managed instrumentation rule",CANNOT_DELETE_RULE:"Cannot delete a system-managed instrumentation rule",LATENCY_HTTP_ROUTE:'HTTP route must start with a forward slash "/"',READONLY_WARNING:"You're not allowed to create/update/delete in readonly mode",ILLEGAL_K8S_LABEL:'Must be 63 characters or less, must consist of alphanumeric characters, "-", "_", or ".", and must start & end with an alphanumeric character (e.g., my-name, 123.abc).',INVALID_VERSION:'Invalid version format, must be in the format of "major.minor.patch" (e.g. 1.0.0)',PHP_CUSTOM_INSTRUMENTATION_RESTART:"PHP custom instrumentation is applied via environment variables. After creating or updating this rule, please rollout restart your PHP workloads for the probes to take effect."},To={NAMESPACE:"Namespace",NAME:"Name",KIND:"Kind",REGION:"Region",SERVICE_NAME:"Service Name",CONNECTION:"Connection",CONNECTIONS:"Connections",NO_CONNECTIONS:"No connections",CLOUD_CONNECTOR:"Cloud Connector",CREATE_CLOUD_CONNECTOR:"Create Cloud Connector",CLOUD_CONNECTOR_SELECT_PROVIDER_TITLE:"Connect a cloud or SaaS account to Odigos Central",CLOUD_CONNECTOR_SELECT_PROVIDER_SUBTITLE:"Choose a provider and decide how much access Odigos should have in your account.",CLOUD_CONNECTOR_PERMISSIONS_NOTE:"Cloud connectors require a platform account with cross-account IAM trust and scoped permissions for Odigos Central (e.g. sts:AssumeRole plus discovery/instrumentation policies). Organizations without these privileges cannot complete this workflow.",CLOUD_CONNECTOR_PERMISSION_DISCOVERY_ONLY_TITLE:"Discovery only",CLOUD_CONNECTOR_PERMISSION_DISCOVERY_ONLY_DESC:"Odigos detects workloads in your account but can't change them. Pick this to evaluate before granting write access.",CLOUD_CONNECTOR_PERMISSION_DISCOVERY_INSTRUMENTATION_TITLE:"Discovery + instrumentation",CLOUD_CONNECTOR_PERMISSION_DISCOVERY_INSTRUMENTATION_DESC:"Odigos detects workloads and applies instrumentation automatically — the fastest way to start collecting telemetry.",CLOUD_CONNECTOR_PERMISSION_CUSTOM_TITLE:"Custom",CLOUD_CONNECTOR_PERMISSION_CUSTOM_DESC:"Choose exactly which resource types Odigos can discover and instrument.",CLOUD_CONNECTOR_POLICY_PREVIEW:"Policy preview",CLOUD_CONNECTOR_POLICY_NOTE:"The IAM policy below grants the permissions required to discover and instrument supported workloads.",CLOUD_CONNECTOR_POLICY_NOTE_CUSTOM:"The IAM policy below is generated from the resource types you selected.",CLOUD_CONNECTOR_CUSTOM_COL_TYPE:"Type",CLOUD_CONNECTOR_CUSTOM_COL_DISCOVERY:"Discovery",CLOUD_CONNECTOR_CUSTOM_COL_INSTRUMENTATION:"Instrumentation",CLOUD_CONNECTOR_SETUP_CREDENTIALS_TITLE:"Setup credentials",CLOUD_CONNECTOR_SETUP_CREDENTIALS_SUBTITLE:"Apply the selected IAM policy in AWS account.",CLOUD_CONNECTOR_AUTH_TITLE:"Choose Authentication method",CLOUD_CONNECTOR_AUTH_SUBTITLE:"Decide how Odigos authenticates with your AWS account.",CLOUD_CONNECTOR_AUTH_ASSUME_ROLE:"Assume Role",CLOUD_CONNECTOR_AUTH_STATIC_KEYS:"Static keys",CLOUD_CONNECTOR_AUTH_ASSUME_ROLE_NOTE:"Odigos assumes a scoped IAM role. No long-lived secrets are stored.",CLOUD_CONNECTOR_AUTH_STATIC_KEYS_NOTE:"Odigos uses long-lived access keys you provide. Rotate them regularly to keep your account secure.",CLOUD_CONNECTOR_SETUP_METHOD_TITLE:"Choose setup method",CLOUD_CONNECTOR_SETUP_METHOD_SUBTITLE:"Use the tool that best fits your workflow. The result is the same IAM role either way.",CLOUD_CONNECTOR_SETUP_METHOD_CLOUDFORMATION:"CloudFormation",CLOUD_CONNECTOR_SETUP_METHOD_TERRAFORM:"Terraform",CLOUD_CONNECTOR_SETUP_METHOD_AWS_CLI:"AWS CLI",CLOUD_CONNECTOR_SETUP_METHOD_MANUAL:"Manual",CLOUD_CONNECTOR_CREATE_ROLE_TITLE:"Create IAM role",CLOUD_CONNECTOR_CREATE_ROLE_STEPS_HEADING:"Follow these steps to create the role:",CLOUD_CONNECTOR_ENTER_ARN_TITLE:"Enter Role ARN",CLOUD_CONNECTOR_ENTER_ARN_SUBTITLE:"Paste the generated Role ARN into Odigos.",CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_LABEL:"AWS Account ID",CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_PLACEHOLDER:"Insert AWS account ID",CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_HELP:"The 12-digit account ID where the IAM role or user lives.",CLOUD_CONNECTOR_FIELD_ACCESS_TOKEN_LABEL:"Access token",CLOUD_CONNECTOR_FIELD_ACCESS_TOKEN_PLACEHOLDER:"Insert access token",CLOUD_CONNECTOR_FIELD_ACCESS_TOKEN_HELP:"Paste the ARN of the IAM role you created.",CLOUD_CONNECTOR_FIELD_SECRET_ID_LABEL:"Secret ID",CLOUD_CONNECTOR_FIELD_SECRET_ID_PLACEHOLDER:"Insert secret ID",CLOUD_CONNECTOR_FIELD_SECRET_ID_HELP:"Paste the ARN of the IAM role you created.",CLOUD_CONNECTOR_VALIDATE_TITLE:"Validate connection",CLOUD_CONNECTOR_VALIDATE_SUBTITLE:"Odigos ran read-only checks against your AWS account.",CLOUD_CONNECTOR_VALIDATE_SUCCESS:"All checks passed. Your connection is ready.",CLOUD_CONNECTOR_VALIDATE_FAILURE:"Some checks failed. Review the details below and go back to fix your credentials or permissions.",CLOUD_CONNECTOR_VALIDATE_EMPTY:"No validation results yet.",CLOUD_CONNECTOR_VALIDATE_ACCOUNT:"Account",CLOUD_CONNECTOR_VALIDATE_IDENTITY:"Identity",CLOUD_CONNECTOR_TESTING_TITLE:"Verifying & creating connector...",CLOUD_CONNECTOR_CONNECTION_FAILED_TITLE:"Connection Failed",CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT:"Odigos could not validate the connection. Review the error details below and retry.",CLOUD_CONNECTOR_CREATED_SUCCESS:"Connector created. It will appear in your connections list.",CLOUD_CONNECTOR_CREATED_MODAL_TITLE:"Connector created successfully!",CLOUD_CONNECTOR_CREATED_MODAL_DESC:"Your connector has been created and is now ready to start discovering workloads.",DATA_STREAM:"Data Stream",DATA_STREAMS:"Data Streams",STREAM_NAME:"Data Stream name",NAME_YOUR_STREAM:"Name your Data Stream",NAME_YOUR_STREAM_PLACEHOLDER:"e.g. Highest priority",STREAM_DESCRIPTION:"Provide a clear and descriptive name for your pipeline to ensure its purpose is easily understood by you and your team.",STREAM_CONFIRM:"Confirm your new Data Stream",RENAME_STREAM:e=>`Rename "${e}"`,DATA_STREAM_EXISTS_WARNING:(e,t)=>`A Data Stream with this name already exists, you can still rename the current "${e}", but it will merge into the existing "${t}".`,DATA_STREAM_MERGE_WARNING:(e,t)=>e?`A Data Stream named "${t}" already exists. Saving will merge "${e}" into "${t}" - both streams will share the same configuration going forward.`:`A Data Stream named "${t}" already exists. Saving will merge into "${t}" - the new stream will share the existing configuration going forward.`,ACTION:"Action",ACTIONS:"Actions",ADD_ACTION:"Add Action",ACTION_DETAILS:"Action Details",INSTRUMENTATION_RULE:"Instrumentation Rule",INSTRUMENTATION_RULES:"Instrumentation Rules",ADD_INSTRUMENTATION_RULE:"Add Instrumentation Rule",INSTRUMENTATION_RULE_DETAILS:"Instrumentation Rule Details",DESTINATION:"Destination",DESTINATIONS:"Destinations",ADD_DESTINATION:"Add Destination",ADD_DESTINATIONS:"Add Destinations",ADD_DESTINATION_DESCRIPTION:"Add a destination to send your telemetry data to. You can add multiple destinations.",DESTINATION_DETAILS:"Destination Details",SELECTED_DESTINATIONS:"Selected Destinations",SOURCE:"Source",SOURCES:"Sources",ADD_SOURCE:"Add Source",SOURCE_DETAILS:"Source Details",SELECT_SOURCES:"Select Sources",SELECTED_SOURCES:"Selected Sources",SELECT_SOURCES_DESCRIPTION:"Choose which sources to monitor in your pipeline.",NO_SOURCES:"No sources",NO_SOURCES_GO_BACK:"No sources selected. Please go back to select sources.",PLEASE_ADD_SOURCE:"Please add a source",NO_SOURCES_NAMESPACE:"No sources available in this namespace",TRY_SEARCH_OR_OTHER_NAMESPACE:"Try searching again or select another namespace.",PLEASE_MAKE_SURE_UNIGNORED_NAMESPACES:"Please make sure your cluster has unignored namespaces",INSTALLATION:"Installation",SOURCES_SETUP:"Sources setup",DESTINATIONS_SETUP:"Destinations setup",SUMMARY:"Summary",REVIEW_SETUP:"Review your setup and confirm your choices.",NO_SOURCES_SELECTED:"No sources selected",ADD_SOURCE_PROMPT:"Add at least one source to start collecting data",NO_DESTINATIONS_SELECTED:"No destinations selected",ADD_DESTINATION_PROMPT:"Add destination so your data has somewhere to go",GET_STARTED_WITH:"Get started with",GET_STARTED_DESCRIPTION:"First, select the sources you want Odigos to monitor. Next, choose where your data should be sent by configuring destinations.",TYPE:"Type",NOTES:"Notes",STATUS:"Status",INSTRUMENTATION_STATUS:"Instrumentation Status",INSTRUMENTATION:"Instrumentation",INSTRUMENTATION_DESCRIPTION:"Detected runtime and instrumentation applied to this source.",PROGRESS:"Progress",RUNTIME:"Runtime",LAST_UPDATED:"Last updated",ISSUES:"Issues",WAITING_FOR:"Waiting for",READONLY:"Readonly",LANGUAGE:"Language",VERSION:"Version",RUNTIME_VERSION:"Runtime Version",VERSION_PLACEHOLDER:"1.0.0",MONITORS:"Monitors",SIGNALS_FOR_PROCESSING:"Signals for Processing",MANAGED_BY_PROFILE:"Managed by Profile",TIER:"Tier",ENTERPRISE:"Enterprise",ENTERPRISE_TIER:"Enterprise Tier",COMMUNITY:"Community",COMMUNITY_TIER:"Community Tier",API_TOKEN:"API Token",API_TOKENS:"API Tokens",DESCRIBE_ODIGOS:"Describe Odigos",DESCRIBE_SOURCE:"Describe Source",OVERVIEW:"Overview",LIBRARIES:"Libraries",STANDARD_LIBRARY:"Standard Library",STANDARD:"Standard",PEER_SOURCES:"Peer Sources",PROFILING:"Profiling",INBOUND:"Inbound",OUTBOUND:"Outbound",INBOUND_DESCRIPTION:e=>`Services that send requests to ${e}`,OUTBOUND_DESCRIPTION:e=>`Services that ${e} sends requests to`,NO_INBOUND_CONNECTIONS_DESCRIPTION:"No services are currently sending requests to this source.",NO_OUTBOUND_CONNECTIONS_DESCRIPTION:"This source hasn't sent requests to other services yet.",NO_INBOUND_CONNECTIONS:"No inbound connections",NO_OUTBOUND_CONNECTIONS:"No outbound connections",COULD_NOT_FETCH_PEER_SOURCES:"Could not fetch peer sources",VIRTUAL:"Virtual",VIRTUAL_TOOLTIP:"This service is not instrumented/injected with Odigos, but we can still see it in the service map because it is connected to other services.",NO_RESULTS:"No results",NO_RESULTS_FOR_FILTER:e=>`No results matched the filter '${e}'`,POD:"Pod",PODS:"Pods",PODS_HEALTHY:"Pods are healthy",PODS_NOT_HEALTHY:"Pods are not healthy",NO_RUNNING_PODS:"No running pods",NO_RUNNING_PODS_SUBTITLE:"Check if you have any running pods and try again",AGENT_INJECTED:"Agent injected",AGENT_NOT_INJECTED:"Agent not injected",KUBERNETES_HEALTHY:"Kubernetes healthy",ODIGOS_HEALTHY:"Odigos healthy",HEALTHY:"Healthy",UNHEALTHY:"Unhealthy",NOT_HEALTHY:"Not Healthy",NODE:"Node",AGE:"Age",RUNNING_TIME:"Running Time",RUNNING_TIME_TOOLTIP:"Time elapsed since the container was last started and entered the Running state",NOT_RUNNING:"Not Running",RESTARTS:"Restarts",LATEST_REVISION:"Latest Revision",OLD_REVISION:"Old Revision",READY:"Ready",NOT_READY:"Not Ready",STARTED:"Started",NOT_STARTED:"Not Started",CRASHLOOP:"Crashloop",NO_CRASHLOOP:"No Crashloop",CRASHLOOP_BACKOFF:"Crashloop backoff",CANNOT_POOL_IMAGE:"Cannot pool image",DEVICE_NAME:"Device Name",INSTRUMENTED:"Instrumented",UNINSTRUMENTED:"Uninstrumented",INSTRUMENTED_WITH_DISTRO:e=>`Instrumented | ${e}`,DEBUG_COMMANDS:"Debug Commands",YAML:"YAML",YAML_FILES:"YAML Files",GET_POD_YAML:"Get Pod YAML",GET_POD_LOGS:"Get Pod Logs",DESCRIBE_POD:"Describe Pod",CONTAINER:"Container",CONTAINERS:"Containers",DETECTED_CONTAINERS:"Detected Containers",DETECTED_CONTAINERS_DESCRIPTION:"The system automatically instruments the containers it detects with a supported programming language.",NO_CONTAINERS_DETECTED:"No containers detected",DETECTED_PROCESSES:"Detected Processes",DETECTED_PROCESSES_DESCRIPTION:"The system automatically instruments the processes it detects with a supported programming language.",NO_PROCESSES_DETECTED:"No processes detected",CONTAINER_NAME:"Container Name",PROCESS:"Process",PROCESSES:"Processes",PROCESS_FALLBACK_NAME:"process",PROCESS_PID:"PID",EXECUTABLE:"Executable",COMMAND:"Command",OPEN_IN_POD_TAB:"Open in 'Pod' tab",OPEN_IN_SAMPLING_PAGE:"Open in 'Sampling' page",ALL_CONTAINERS_HEALTHY:e=>`All ${e} containers are healthy`,ALL_PROCESSES_HEALTHY:e=>`All ${e} processes are healthy`,PID:e=>`#${e}`,IDENTIFYING_ATTRIBUTES:"Identifying Attributes",INSTRUMENTATION_LIBRARIES:"Instrumentation Libraries",INSTRUMENTED_LIBRARIES:"Instrumented Libraries",FILTERED_COUNT_TOOLTIP:"Represents filtered amount, out of total amount",SEARCH_NAMESPACES:"Search Namespaces",SEARCH_SOURCES:"Search Sources",SELECT_ALL:"Select all",UNSELECT_ALL:"Unselect all",ONLY_SELECTED:"Only selected",ONLY_RUNNING_INSTANCES:"Only running instances",TO_COLLECT_OTEL_DATA:"To collect OpenTelemetry data",TO_MONITOR_OTEL_DATA:"To monitor OpenTelemetry data",TO_MODIFY_OTEL_DATA:"To modify OpenTelemetry data",NO_DATA_INSTRUMENTATION_RULES:"To configure how telemetry is collected",NO_DATA_SOURCES:"To start collecting telemetry from a Kubernetes workload",NO_DATA_ACTIONS:"To process telemetry before export",NO_DATA_DESTINATIONS:"To send telemetry to an observability backend",QUICK_BACK_TO_SUMMARY:"When you finish editing you can quickly go back to the summary.",GO_TO_SUMMARY:"Go to summary",FUTURE_APPS_TITLE:"Instrument entire namespace",FUTURE_APPS_DESCRIPTION:"When enabled, all applications in the namespace and new applications will be instrumented automatically and included in the current data stream using a Namespace Source.",OVERIDE:"Override",OVERIDDEN:"Overridden",OVERRIDE_RUNTIME_DETAILS:"Override Runtime Details",OVERRIDE_RUNTIME_DETAILS_SUBTITLE:"Use when multiple languages exist in the same container or when Odigos is unable to detect the application language",OVERRIDE_RUNTIME_WARNING:"This is an advanced configuration. If the selected programming language is incorrect, data collection may be incomplete or may not occur at all.",OVERRIDE_OTEL_DISTRO_NAME:"Override OpenTelemetry distro name",OVERRIDE_OTEL_DISTRO_NAME_SUBTITLE:"Use to set a specific Odigos OpenTelemetry distribution",OVERRIDE_OTEL_DISTRO_NAME_WARNING:"This is an advanced configuration. If the selected OpenTelemetry distro name is incorrect, data collection may be incomplete or may not occur at all.",OVERRIDE_OTEL_DISTRO_NAME_SAVE_TOOLTIP:"Use the provided OpenTelemetry distro name to instrument this container",OVERRIDE_OTEL_DISTRO_NAME_DELETE_TOOLTIP:"Remove manual override of OpenTelemetry distro name, and use Odigos automatic detection OpenTelemetry distro name for instrumentation",OVERRIDE_RUNTIME_DETAILS_SAVE_TOOLTIP:"Use the provided runtime details to instrument this container",OVERRIDE_RUNTIME_DETAILS_DELETE_TOOLTIP:"Remove manual override of runtime details, and use Odigos automatic detection runtime details for instrumentation",OTEL_DISTRO_NAME:"OpenTelemetry distro name",WAITING_FOR_RUNTIME_DETECTION:"Waiting for runtime detection...",DETECTING_RUNTIME_INFO:"Detecting runtime info",NO_AVAILABLE_AGENT:"No available agent",ACTIVE:"Active",INACTIVE:"Inactive",ENABLED:"Enabled",DISABLED:"Disabled",NO_TRACES_FOUND:"No traces found",ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC:"Are your services instrumented & producing traffic?",JAVA_CUSTOM_PROBES:"Java Custom Probes",GOLANG_CUSTOM_PROBES:"Golang Custom Probes",PHP_CUSTOM_PROBES:"PHP Custom Probes",ROLLOUT:"Rollout",ROLLOUT_RESTART:"Rollout Restart",ROLLOUT_RESTART_WORKLOADS_DESCRIPTION:"Are you sure you want to rollout restart these workloads?",ROLLOUT_NOT_REQUIRED:"Rollout Not Required",ROLLOUT_NOT_REQUIRED_MESSAGE:"This source is instrumented with eBPF and does not require a restart.",ROLLOUT_FAILED:"Rollout Failed",ROLLOUT_PREVIOUS_ONGOING:"Previous Rollout Ongoing",ROLLOUT_PREVIOUS_ONGOING_MESSAGE:"A previous rollout is ongoing. Please wait for it to finish before triggering a new one.",ROLLOUT_AUTO_DISABLED:"Auto Rollout Disabled",ROLLOUT_AUTO_DISABLED_MESSAGE:"Trigger a manual rollout to inject the agent.",ROLLOUT_FINISHED:"Rollout Finished",ROLLOUT_FINISHED_MESSAGE:"All pods have been updated and are healthy.",ROLLBACK:"Rollback",ROLLBACK_OCCURRED:"Rollback Occurred",ROLLBACK_OCCURRED_MESSAGE:"Odigos detected a crash and rolled back instrumentation to protect your workload.",ROLLBACK_SUCCESS:"Rollback Success",ROLLBACK_RECOVER:"Recover",FETCHING_NAMESPACES:"Fetching namespaces",FETCHING_NAMESPACES_SUBTITLE:"Please wait while we fetch the namespaces",ADD_SOURCES_DESCRIPTION:"Choose which sources to monitor in your pipeline.",CREATING_SOURCES:"Creating Sources...",CREATING_SOURCES_SUBTITLE:"This may take a few moments while sources are being created.",SELECT_NAMESPACE:"Select namespace from the list",SELECT_NAMESPACE_SUBTITLE:"Add namespace so you can select workloads from it.",CREATING_ACTION:"Creating action",CREATING_ACTION_SUBTITLE:"Please wait while we create the action",ADD_ACTION_DESCRIPTION:"Select an action to modify telemetry data before it's sent to destinations. Choose an action type and configure its details.",CREATING_INSTRUMENTATION_RULE:"Creating instrumentation rule",CREATING_INSTRUMENTATION_RULE_SUBTITLE:"Please wait while we create the instrumentation rule",ADD_INSTRUMENTATION_RULE_DESCRIPTION:"Define how telemetry is recorded from your application. Choose a rule type and configure the details.",CREATING_DESTINATION:"Creating destination",CREATING_DESTINATION_SUBTITLE:"Please wait while we create the destination",ADD_DESTINATION_DRAWER_DESCRIPTION:"Add backend destination you want to connect with Odigos.",THROUGHPUT_LAST_10_SECONDS:"Throughput (last 10 seconds)",DELETE_POD_TO_RESTART:"Delete Pod to Restart",DEBUG:"Debug",SAMPLING:"Sampling",HEAD_SAMPLING:"Head Sampling",TAIL_SAMPLING:"Tail Sampling",NOISY_OPERATIONS:"Noisy Operations",HIGHLY_RELEVANT_OPERATIONS:"Highly Relevant Operations",COST_REDUCTION_OPERATIONS:"Cost Reduction Operations"},Oo={GET_STARTED:"Get started",ADD:"Add",ADD_NEW:"Add New",CREATE_NEW:"Create new",NEW:"New",SELECT:"Select",CREATE:"Create",UPDATE:"Update",EDIT:"Edit",DELETE:"Delete",RESTART:"Restart",RESTART_POD:"Restart pod",REFRESH:"Refresh",CANCEL:"Cancel",CLOSE:"Close",DONE:"Done",SAVE:"Save",BACK:"Back",CONFIRM:"Confirm",NEXT:"Next",VERIFY:"Verify",VERIFY_AND_CREATE_CONNECTOR:"Verify & Create Connector",STAY_ON_CONNECTIONS:"Stay on connections page",GO_TO_CONNECTOR_OVERVIEW:"Go to connector overview",RETRY:"Retry",TEST:"Test",TEST_CONNECTION:"Test Connection",INSTRUMENT:"Instrument",UNINSTRUMENT:"Uninstrument"},No=(e,t)=>e===Tn.Success?To.HEALTHY:e===Tn.Error?To.NOT_HEALTHY:po(t),Ao=e=>{if(!e)return null;switch(e){case Pn.Irrelevant:return null;case Pn.Failure:case Pn.Error:return Tn.Error;case Pn.Notice:return Tn.Warning;case Pn.Pending:case Pn.Waiting:return Tn.Loading;case Pn.Unsupported:case Pn.Disabled:return Tn.Disabled;case Pn.Success:return Tn.Success;case Pn.Unknown:default:return Tn.Info}},Io=(e,t,n="reason",o)=>{const r=Ao(e?.status);return r?{key:`desired-status-${e?.name}`,status:r,leftIcon:t||(r===Tn.Success?y:b),label:o||("reason"===n?po(e?.reasonEnum):No(r,e?.reasonEnum)),tooltip:e?.message,textSize:go.XXXS,invertColors:!0,useSecondaryTone:!0}:null};var _o;(e=>{e.SIGNALS="SIGNALS"})(_o||(_o={}));const Ro=(e,t,n)=>{if(!e||!e.length)return!0;if(1===e.length)return"true"==e[0];const[o,r,i]=e;if(o===_o.SIGNALS)switch(r){case"INCLUDES":return t?.includes(i);case"EXCLUDES":return!t?.includes(i);default:return!0}const a=n.find(e=>e.name===o||e.key===o);if(!a)return!1;const s=null==a.value?"":String(a.value);switch(r){case"===":case"==":return s===i;case"!==":case"!=":return s!==i;case">":return Number(s)>Number(i);case"<":return Number(s)<Number(i);case">=":return Number(s)>=Number(i);case"<=":return Number(s)<=Number(i);default:return!0}};function Do(e,t){if(!e)return t;if("object"==typeof e)return e;try{return JSON.parse(e)}catch(e){return t}}const ko=e=>({status:e?Tn.Success:Tn.Unknown,label:e?"True":"False",invertColors:!0}),Lo=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),Po=e=>null==e||""===e?"-":"boolean"==typeof e?e?"True":"False":"number"==typeof e?String(e):"string"==typeof e?e||"-":JSON.stringify(e),Mo=e=>"string"==typeof e?{id:e,label:e}:e??{},Uo=(e,t)=>e.label||e.displayName||t,Fo=(e,t,n={})=>{const o=[],r=n.signals||[],i=new Set(n.skipComponentTypes||[]),a=Object.entries(e).map(([e,t])=>({name:e,key:e,value:t}));return t.forEach((t,n)=>{if(!t?.name||i.has(t.componentType))return;if(t.renderCondition?.length&&!Ro(t.renderCondition,r,a))return;const s=t.displayName||t.name,l=`${t.name}-${n}`,c=e[t.name],d=Do(t.componentProperties,{});switch(t.componentType){case xn.Toggle:case xn.Checkbox:return void o.push({id:l,title:s,badge:ko(!!c)});case xn.CheckboxList:{const t=d.valueMode||"object";if("array"===t){const e=Array.isArray(c)?c.map(String):[];return void o.push({id:l,title:s,label:e.length?e.join(", "):"-"})}if("flatFields"===t)return void(Array.isArray(d.options)?d.options:[]).forEach((t,n)=>{const r=Mo(t),i=String(r.id??"");i&&o.push({id:`${l}-${n}-${i}`,title:Uo(r,i),badge:ko(!0===e[i])})});const n=Lo(c)?c:{},r=Array.isArray(d.options)?d.options:[];if(r.length){const e=r.map(e=>{const t=Mo(e),o=String(t.id??"");return o&&n[o]?Uo(t,o):null}).filter(Boolean);return void o.push({id:l,title:s,label:e.length?e.join(", "):"-"})}const i=Object.entries(n).filter(([,e])=>!!e).map(([e])=>e);return void o.push({id:l,title:s,label:i.length?i.join(", "):"-"})}case xn.MultiInput:{const e=d.wrapKey,t=d.itemWrapperKey,n=e&&Lo(c)?c[e]:c;if(Array.isArray(n)&&n.length){const e=n.map(e=>t&&Lo(e)?String(e[t]??""):String(e??""));return void o.push({id:l,title:s,label:e.filter(Boolean).join(", ")||"-"})}return void o.push({id:l,title:s,label:"-"})}case xn.KeyValuePair:return Lo(c)&&Object.keys(c).length?void Object.entries(c).forEach(([e,t],n)=>{o.push({id:`${l}-${n}`,title:e,label:String(t??"")})}):Array.isArray(c)&&c.length?void c.forEach((e,t)=>{const n=Lo(e)?e:{};o.push({id:`${l}-${t}`,title:String(n.key??""),label:String(n.value??"")})}):void o.push({id:l,title:s,label:"-"});case xn.MultiTabledInput:{const e=d.wrapKey,t=Array.isArray(e&&Lo(c)?c[e]:c)?e&&Lo(c)?c[e]:c:[],n=Array.isArray(d.columns)?d.columns:[],r=e=>{const t=n.find(t=>Lo(t)&&t.keyName===e);return t?.label||e};return t.length?void t.forEach((e,n)=>{const i=t.length>1?`${s} #${n+1} `:`${s} `;Object.entries(e||{}).forEach(([e,t])=>{null!=t&&""!==t&&o.push({id:`${l}-${n}-${e}`,title:`${i}${r(e)}`,label:Po(t)})})}):void o.push({id:l,title:s,label:"-"})}case xn.FieldGroup:{const e=Array.isArray(c)?c:[];return e.length?void e.forEach((t,n)=>{const r=e.length>1?`${s} #${n+1} `:`${s} `;Object.entries(t||{}).forEach(([e,t])=>{null!=t&&""!==t&&o.push({id:`${l}-${n}-${e}`,title:`${r}${e}`,label:Po(t)})})}):void o.push({id:l,title:s,label:"-"})}default:o.push({id:l,title:s,label:Po(c)})}}),o},zo=e=>e.charAt(0).toUpperCase()+e.slice(1),Bo=e=>{const t=e=>e.filter(e=>"object"==typeof e&&null!==e?""!==e.key&&""!==e.value:""!==e),n=e=>Object.fromEntries(Object.entries(e).filter(([e,t])=>""!==e&&""!==t).map(([e,o])=>Array.isArray(o)?[e,t(o)]:"object"==typeof o&&null!==o?[e,n(o)]:[e,o]));return Object.entries(e).reduce((e,[o,r])=>{try{const i=JSON.parse(r);Array.isArray(i)?e[o]=JSON.stringify(t(i)):e[o]="object"==typeof i&&null!==i?JSON.stringify(n(i)):r}catch(i){"object"==typeof r&&null!==r?Array.isArray(r)?e[o]=JSON.stringify(t(r)):e[o]=JSON.stringify(n(r)):e[o]=r}return e},{})},Ho=e=>JSON.parse(JSON.stringify(e)),jo=(e,t)=>t.split(".").reduce((e,t)=>e?.[t],e),Wo=(e,t,n)=>{const o=t.split(".");let r=e;for(let e=0;e<o.length-1;e++)o[e]in r&&"object"==typeof r[o[e]]||(r[o[e]]={}),r=r[o[e]];r[o[o.length-1]]=n},Go=(e,t)=>{let n=[...e];return t.monitors?.length&&(n=n.filter(e=>!!t.monitors?.find(t=>e.signals?.find(e=>e.toLowerCase()===t.id)))),n},Xo=(e,t)=>{let n=[...e];return t.monitors?.length&&(n=n.filter(e=>!!t.monitors?.find(t=>e.exportedSignals[t.id]))),n},Vo=(e,t)=>t?e.filter(e=>e.dataStreamNames.includes(t)||!e.dataStreamNames.length):[],Ko=(e,t)=>{let n=e;if(t.namespaces?.length){const e=new Set(t.namespaces.map(({id:e})=>e));n=n.filter(({id:t})=>e.has(t.namespace))}if(t.regions?.length){const e=new Set(t.regions.map(({id:e})=>e));n=n.filter(({id:t})=>!!t.region&&e.has(t.region))}if(t.kinds?.length){const e=new Set(t.kinds.map(({id:e})=>e));n=n.filter(({id:t})=>e.has(t.kind))}if(t.languages?.length){const e=new Set(t.languages.map(({id:e})=>e));n=n.filter(({runtimeInfo:t,containers:n})=>t?.detectedLanguages?.some(t=>e.has(t))||n?.some(t=>{const n=t.overrides?.runtimeInfo?.language??t.runtimeInfo?.language;return!!n&&e.has(n)}))}if(t.podsAgentInjectionStatus?.length){const e=new Set(t.podsAgentInjectionStatus.map(({id:e})=>e));n=n.filter(({podsAgentInjectionStatus:t})=>e.has(t?.reasonEnum??"")||e.has(t?.message??""))}if(t.statuses?.length){const e=new Set(t.statuses.map(({id:e})=>e));n=n.filter(({instrumentationReport:t})=>{const n=t?.state||t?.progressStage;return!!n&&e.has(n)})}return t.onlyErrors&&(n=n.filter(e=>Ao(e.workloadOdigosHealthStatus?.status)===Tn.Error)),n},Yo=(e,t)=>t?e.filter(e=>e.dataStreamNames?.includes(t)||t===So&&!e.dataStreamNames?.length):[],Jo=(e,t="",n={})=>{for(const o in e)if(e.hasOwnProperty(o)){const r=e[o],i=t?`${t}.${o}`:o;null===r||"object"!=typeof r||Array.isArray(r)?Array.isArray(r)?r.forEach((e,t)=>{const o=`${i}[${t}]`;null!==e&&"object"==typeof e?Jo(e,o,n):n[o]=e}):n[i]=r:Jo(r,i,n)}return n},qo=e=>{if(!e)return"0 KB/s";const t=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,t)).toFixed(0===t?0:1)} ${["Bytes/s","KB/s","MB/s","GB/s","TB/s"][t]}`},Qo=e=>{if(!e)return"0 ns";if(e<1e3)return`${e.toFixed(0)} ns`;if(e<1e6){const t=e/1e3;return`${t.toFixed(t<10?2:0)} μs`}if(e<1e9){const t=e/1e6;return`${t.toFixed(t<10?2:0)} ms`}if(e<6e10){const t=e/1e9;return`${t.toFixed(t<10?2:0)} s`}if(e<36e11){const t=e/6e10;return`${t.toFixed(t<10?2:0)} m`}if(e<864e11){const t=e/36e11;return`${t.toFixed(t<10?2:0)} h`}{const t=e/864e11;return`${t.toFixed(t<10?2:0)} d`}},Zo=()=>{const e=crypto.getRandomValues(new Uint8Array(16));let t=0;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,n=>{const o=e[t%16];return t++,("1"===n?o:"0"===n?63&o|128:15&o|64).toString(16)})},er=e=>e?e.reduce((e,t)=>{if(null!=t){const n=Ao(t.status);n&&e.push({status:n,type:t.name??"",reason:t.reasonEnum??null,message:t.message??null})}return e},[]):[],tr=e=>Array.isArray(e?.statuses)?er(e.statuses):e?.conditions??[],nr=e=>e?Array.isArray(e)?or(e):or(er(Object.values(e))):or([]),or=e=>{const t=e?.filter(({status:e})=>e===Tn.Error),n=e?.filter(({status:e})=>e===Tn.Warning),o=e?.filter(({status:e})=>e===Tn.Disabled),r=e?.filter(({status:e})=>e===Tn.Loading),i=t.length>0,a=n.length>0,s=o.length>0;return{errors:t,hasErrors:i,warnings:n,hasWarnings:a,disableds:o,hasDisableds:s,loadings:r,hasLoadings:r.length>0,priorotizedStatus:i?Tn.Error:a?Tn.Warning:s?Tn.Info:void 0}},rr=e=>{const t=e?.reduce((e,t)=>t.agentEnabled?.agentEnabled?e+1:e,0);return`${t}/${e?.length||0} instrumented`},ir=e=>({[En.Java]:L,[En.Go]:k,[En.JavaScript]:D,[En.Python]:R,[En.DotNet]:_,[En.CSharp]:I,[En.CPlusPlus]:A,[En.Php]:N,[En.Ruby]:O,[En.Rust]:T,[En.Swift]:w,[En.Elixir]:x,[En.MySql]:C,[En.Nginx]:$,[En.Postgres]:S,[En.Redis]:E,[En.Kafka]:v,[En.Ignored]:p,[En.Unknown]:p,[En.Processing]:p,[En.NoContainers]:p,[En.NoRunningPods]:p}[e]||p),ar=e=>e?e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??En.Unknown:En.Unknown,sr=e=>e?e.overrides?.runtimeInfo?.runtimeVersion??e.runtimeInfo?.runtimeVersion??null:null,lr=e=>e?.map(e=>ir(ar(e)))||[],cr=e=>e?.map(e=>ir(e))||[],dr=e=>e.runtimeInfo?.detectedLanguages?.length?cr(e.runtimeInfo?.detectedLanguages):lr(e.containers),ur=(e,t)=>{const n={[Dn.Alauda]:ze,[Dn.AlibabaCloud]:Fe,[Dn.AppDynamics]:Ue,[Dn.Axiom]:Me,[Dn.AzureBlob]:Pe,[Dn.AzureMonitor]:Le,[Dn.BetterStack]:ke,[Dn.Bonree]:De,[Dn.Causely]:Re,[Dn.Checkly]:_e,[Dn.Chronosphere]:Ie,[Dn.ClickHouse]:Ae,[Dn.CloudWatch]:Ne,[Dn.Coralogix]:Oe,[Dn.Dash0]:Te,[Dn.Datadog]:we,[Dn.Dynamic]:Z,[Dn.Dynatrace]:xe,[Dn.ElasticApm]:Ce,[Dn.ElasticSearch]:$e,[Dn.GoogleCloud]:Se,[Dn.GoogleCloudOTLP]:Se,[Dn.GrafanaCloudLoki]:Ee,[Dn.GrafanaCloudPrometheus]:Ee,[Dn.GrafanaCloudTempo]:Ee,[Dn.Greptime]:ve,[Dn.Groundcover]:be,[Dn.Honeycomb]:ye,[Dn.HyperDX]:fe,[Dn.Instana]:me,[Dn.Jaeger]:ge,[Dn.Kafka]:v,[Dn.Kloudmate]:he,[Dn.Last9]:pe,[Dn.Lightstep]:ue,[Dn.LogzIo]:de,[Dn.Loki]:ce,[Dn.Lumigo]:le,[Dn.Middleware]:se,[Dn.NewRelic]:ae,[Dn.Observe]:ie,[Dn.Odigos]:re,[Dn.OneUptime]:oe,[Dn.OpenObserve]:ne,[Dn.Opsverse]:te,[Dn.Oracle]:ee,[Dn.OTLP]:Z,[Dn.OTLPHttp]:Z,[Dn.Prometheus]:Q,[Dn.Qryn]:q,[Dn.QrynOss]:J,[Dn.Quickwit]:Y,[Dn.S3]:K,[Dn.Seq]:V,[Dn.Signalfx]:G,[Dn.Signoz]:X,[Dn.Splunk]:G,[Dn.SplunkSapm]:G,[Dn.SplunkOtlp]:G,[Dn.SumoLogic]:W,[Dn.TelemetryHub]:j,[Dn.Tempo]:H,[Dn.Tingyun]:B,[Dn.Traceloop]:z,[Dn.Uptrace]:F,[Dn.VictoriaMetrics]:U,[Dn.VictoriaMetricsCloud]:U,[Dn.XRay]:M,[Dn.Pyroscope]:P}[e];return n&&!t?{icon:n}:{iconSrc:`https://d15jtxgb40qetw.cloudfront.net/${e}.svg`}},pr=e=>({[$n.Namespace]:Ge,[$n.Source]:We,[$n.Destination]:je,[$n.Action]:u,[$n.InstrumentationRule]:He,[$n.SamplingRule]:Be}[e]),hr=e=>"ruleId"in e&&e.ruleId?e.ruleId:"id"in e&&"string"==typeof e.id&&e.id||"id"in e&&"object"==typeof e.id&&e.id.namespace&&e.id.kind&&e.id.name?e.id:"namespace"in e&&e.namespace&&"kind"in e&&e.kind&&"name"in e&&e.name?{namespace:e.namespace,name:e.name,kind:e.kind,..."region"in e&&e.region?{region:e.region}:{}}:"name"in e&&e.name?e.name:void 0,gr=e=>{if(!e)return"";if("string"==typeof e)return e;const t=`${e.namespace}/${e.kind}/${e.name}`;return e.region?`${t}/${e.region}`:t},mr=e=>gr(hr(e)),fr=(e,t,n)=>{const{extended:o,prioritizeDisplayName:r}=n||{};let i="",a="";switch(t){case $n.InstrumentationRule:const t=e;i=t.type,a=t.ruleName;break;case $n.Source:const n=e;i=n.id.name,a=n.serviceName||"";break;case $n.Action:const o=e;i=o.type,a=o.name||"";break;case $n.Destination:const r=e;i=r.destinationType.displayName,a=r.name;break;case $n.Namespace:const s=e;i=s.name,a=s.name}return o?i+(a&&a!==i?` (${a})`:""):r&&a||i},yr=(e,t)=>{if(t===$n.Source){const t={namespace:"",name:"",kind:""};return e.split("&").forEach(e=>{const[n,o]=e.split("=");t[n]=o}),t}return e},br=e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??En.Unknown,vr=e=>{const{numberOfInstances:t,containers:n}=e;if(!n)return t&&t>0?En.Processing:En.NoRunningPods;const o=n?.filter(e=>br(e)!==En.Ignored);if(!o.length)return En.NoContainers;const r=o.find(e=>br(e)!==En.Unknown);return r?br(r):En.Unknown},Er=(e,t,n)=>(t===$n.Source?e?.sources.find(e=>e.kind===n.kind&&e.name===n.name&&e.namespace===n.namespace):e?.destinations.find(e=>e.id===n))||{throughput:0},Sr=e=>({[Xn.Logs]:Ke,[Xn.Metrics]:Ve,[Xn.Traces]:Xe,[Xn.Profiles]:re}[e]),$r=(e,t)=>Object.values(go).reduce((n,o)=>Math.abs(t[o]-e)<Math.abs(t[n]-e)?o:n),Cr=e=>e&&{[yn.K8s]:Qe,[yn.Vm]:qe,[yn.Connector]:Je,[yn.AwsEcs]:Ye}[e]||re,xr=e=>e?{[yn.K8s]:"Kubernetes Cluster",[yn.Vm]:"Virtual Machine",[yn.Connector]:"Cloud Connector",[yn.AwsEcs]:"AWS ECS"}[e]:"Unknown",wr=(e,t,n)=>{const o=e[t];return o?o.flatMap(e=>{const o=e[n],r=[];return void 0!==o&&(Array.isArray(o)?r.push(...o):r.push(o)),r.push(...wr(e,t,n)),r}):[]},Tr={"aws.lambda":"AWS Lambda","aws.fargate-task":"ECS Fargate Task","aws.fargate-cluster":"ECS Fargate Cluster","aws.ecs-cluster":"ECS Cluster","aws.eks":"Amazon EKS","aws.ec2":"Amazon EC2"},Or=e=>{if(!e)return"";if(Tr[e])return Tr[e];if(e.includes(".")){return e.slice(e.indexOf(".")+1).split(/[-_]/).map(e=>e?e[0].toUpperCase()+e.slice(1):e).join(" ")}return e},Nr=(e,t)=>{if(t===$n.Source){let t="";return Object.entries(e).forEach(([e,n])=>{t+=`${e}=${n}&`}),t.slice(0,-1),t}return e},Ar=(e,t,n)=>{switch(n=n??"500",t){case Tn.Default:return e.v2.colors.purple[n];case Tn.Info:return e.v2.colors.blue[n];case Tn.Error:return e.v2.colors.red[n];case Tn.Warning:return e.v2.colors.yellow[n];case Tn.Success:return e.v2.colors.green[n];case Tn.Loading:case Tn.Disabled:case Tn.Unknown:return e.v2.colors.silver[n];default:return e.v2.colors.white[500]}},Ir=e=>{switch(e){case Hn.Updating:case jn.Pending:case Wn.ContainerCreating:case Gn.Waiting:return Tn.Info;case Hn.Healthy:case jn.Succeeded:case jn.Running:case Wn.Running:case Gn.Running:return Tn.Success;case Hn.Degraded:return Tn.Warning;case Hn.Failed:case jn.Failed:case Wn.Error:case Wn.CrashLoopBackOff:case Wn.CreateContainerError:case Wn.CreateContainerConfigError:case Wn.ErrImagePull:case Wn.ErrImageNeverPull:case Wn.ImagePullBackOff:case Wn.InvalidImageName:case Wn.RegistryUnavailable:case Wn.NetworkNotReady:case Wn.OOMKilled:case Wn.ContainerCannotRun:case Gn.Terminated:case Wn.DeadlineExceeded:case Wn.StartError:return Tn.Error;case Hn.Down:case Wn.Completed:return Tn.Disabled;case Hn.Unknown:case jn.Unknown:default:return Tn.Unknown}},_r=o.div`
|
|
41
|
+
`,vo=Mt(({children:n,variant:o=ho.P,color:r,size:i=go.S,weight:a=400,opacity:s=1,align:l="left",lineHeight:c,transform:d,nowrap:u,underline:p,onClick:h,disabled:g,maxLines:m,...f},y)=>{const b="string"==typeof n?n.split("\n").map((n,o,r)=>e(Ut,{children:[n,o!==r.length-1&&t("br",{})]},`typography-${o}-${n}`)):n;return t(bo,{ref:y,as:o,$color:r,$size:i,$weight:a,$opacity:s,$align:l,$lineHeight:c,$transform:d,$nowrap:u,$underline:p,$maxLines:m,$withClick:!!h&&!g,onClick:g?void 0:h,...f,children:b})});vo.displayName="Typography";const Eo="https://docs.odigos.io",So="default",$o="this-cluster",Co="This Cluster",xo={SELECTED_DATA_STREAM:"SELECTED_DATA_STREAM",SELECTED_DATA_STREAM_WITH_PROXY:e=>`SELECTED_DATA_STREAM_${e}`,OVERVIEW_FILTERS:"OVERVIEW_FILTERS",DARK_MODE:"DARK_MODE"},wo={REQUIRED_FIELDS:"Required fields are missing",FIELD_IS_REQUIRED:"This field is required",FORBIDDEN:"Forbidden",ENTERPRISE_ONLY:(e="This")=>`${e} is an Enterprise feature. Please upgrade your plan.`,DEFINED_FOR_ALL_STREAMS:e=>`${e} are defined for all Data Streams.`,CANNOT_EDIT_RULE:"Cannot edit a system-managed instrumentation rule",CANNOT_DELETE_RULE:"Cannot delete a system-managed instrumentation rule",LATENCY_HTTP_ROUTE:'HTTP route must start with a forward slash "/"',READONLY_WARNING:"You're not allowed to create/update/delete in readonly mode",ILLEGAL_K8S_LABEL:'Must be 63 characters or less, must consist of alphanumeric characters, "-", "_", or ".", and must start & end with an alphanumeric character (e.g., my-name, 123.abc).',INVALID_VERSION:'Invalid version format, must be in the format of "major.minor.patch" (e.g. 1.0.0)',PHP_CUSTOM_INSTRUMENTATION_RESTART:"PHP custom instrumentation is applied via environment variables. After creating or updating this rule, please rollout restart your PHP workloads for the probes to take effect."},To={NAMESPACE:"Namespace",NAME:"Name",KIND:"Kind",REGION:"Region",SERVICE_NAME:"Service Name",CONNECTION:"Connection",CONNECTIONS:"Connections",NO_CONNECTIONS:"No connections",CLOUD_CONNECTOR:"Cloud Connector",CREATE_CLOUD_CONNECTOR:"Create Cloud Connector",CLOUD_CONNECTOR_SELECT_PROVIDER_TITLE:"Connect a cloud or SaaS account to Odigos Central",CLOUD_CONNECTOR_SELECT_PROVIDER_SUBTITLE:"Choose a provider and decide how much access Odigos should have in your account.",CLOUD_CONNECTOR_PERMISSIONS_NOTE:"Cloud connectors require a platform account with cross-account IAM trust and scoped permissions for Odigos Central (e.g. sts:AssumeRole plus discovery/instrumentation policies). Organizations without these privileges cannot complete this workflow.",CLOUD_CONNECTOR_PERMISSION_DISCOVERY_ONLY_TITLE:"Discovery only",CLOUD_CONNECTOR_PERMISSION_DISCOVERY_ONLY_DESC:"Odigos detects workloads in your account but can't change them. Pick this to evaluate before granting write access.",CLOUD_CONNECTOR_PERMISSION_DISCOVERY_INSTRUMENTATION_TITLE:"Discovery + instrumentation",CLOUD_CONNECTOR_PERMISSION_DISCOVERY_INSTRUMENTATION_DESC:"Odigos detects workloads and applies instrumentation automatically — the fastest way to start collecting telemetry.",CLOUD_CONNECTOR_PERMISSION_CUSTOM_TITLE:"Custom",CLOUD_CONNECTOR_PERMISSION_CUSTOM_DESC:"Choose exactly which resource types Odigos can discover and instrument.",CLOUD_CONNECTOR_POLICY_PREVIEW:"Policy preview",CLOUD_CONNECTOR_POLICY_NOTE:"The IAM policy below grants the permissions required to discover and instrument supported workloads.",CLOUD_CONNECTOR_POLICY_NOTE_CUSTOM:"The IAM policy below is generated from the resource types you selected.",CLOUD_CONNECTOR_CUSTOM_COL_TYPE:"Type",CLOUD_CONNECTOR_CUSTOM_COL_DISCOVERY:"Discovery",CLOUD_CONNECTOR_CUSTOM_COL_INSTRUMENTATION:"Instrumentation",CLOUD_CONNECTOR_SETUP_CREDENTIALS_TITLE:"Setup credentials",CLOUD_CONNECTOR_SETUP_CREDENTIALS_SUBTITLE:"Apply the selected IAM policy in AWS account.",CLOUD_CONNECTOR_AUTH_TITLE:"Choose Authentication method",CLOUD_CONNECTOR_AUTH_SUBTITLE:"Decide how Odigos authenticates with your AWS account.",CLOUD_CONNECTOR_AUTH_ASSUME_ROLE:"Assume Role",CLOUD_CONNECTOR_AUTH_STATIC_KEYS:"Static keys",CLOUD_CONNECTOR_AUTH_ASSUME_ROLE_NOTE:"Odigos assumes a scoped IAM role. No long-lived secrets are stored.",CLOUD_CONNECTOR_AUTH_STATIC_KEYS_NOTE:"Odigos uses long-lived access keys you provide. Rotate them regularly to keep your account secure.",CLOUD_CONNECTOR_SETUP_METHOD_TITLE:"Choose setup method",CLOUD_CONNECTOR_SETUP_METHOD_SUBTITLE:"Use the tool that best fits your workflow. The result is the same IAM role either way.",CLOUD_CONNECTOR_SETUP_METHOD_CLOUDFORMATION:"CloudFormation",CLOUD_CONNECTOR_SETUP_METHOD_TERRAFORM:"Terraform",CLOUD_CONNECTOR_SETUP_METHOD_AWS_CLI:"AWS CLI",CLOUD_CONNECTOR_SETUP_METHOD_MANUAL:"Manual",CLOUD_CONNECTOR_CREATE_ROLE_TITLE:"Create IAM role",CLOUD_CONNECTOR_CREATE_ROLE_STEPS_HEADING:"Follow these steps to create the role:",CLOUD_CONNECTOR_ENTER_ARN_TITLE:"Enter Role ARN",CLOUD_CONNECTOR_ENTER_ARN_SUBTITLE:"Paste the generated Role ARN into Odigos.",CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_LABEL:"AWS Account ID",CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_PLACEHOLDER:"Insert AWS account ID",CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_HELP:"The 12-digit account ID where the IAM role or user lives.",CLOUD_CONNECTOR_FIELD_ACCESS_TOKEN_LABEL:"Access token",CLOUD_CONNECTOR_FIELD_ACCESS_TOKEN_PLACEHOLDER:"Insert access token",CLOUD_CONNECTOR_FIELD_ACCESS_TOKEN_HELP:"Paste the ARN of the IAM role you created.",CLOUD_CONNECTOR_FIELD_SECRET_ID_LABEL:"Secret ID",CLOUD_CONNECTOR_FIELD_SECRET_ID_PLACEHOLDER:"Insert secret ID",CLOUD_CONNECTOR_FIELD_SECRET_ID_HELP:"Paste the ARN of the IAM role you created.",CLOUD_CONNECTOR_VALIDATE_TITLE:"Validate connection",CLOUD_CONNECTOR_VALIDATE_SUBTITLE:"Odigos ran read-only checks against your AWS account.",CLOUD_CONNECTOR_VALIDATE_SUCCESS:"All checks passed. Your connection is ready.",CLOUD_CONNECTOR_VALIDATE_FAILURE:"Some checks failed. Review the details below and go back to fix your credentials or permissions.",CLOUD_CONNECTOR_VALIDATE_EMPTY:"No validation results yet.",CLOUD_CONNECTOR_VALIDATE_ACCOUNT:"Account",CLOUD_CONNECTOR_VALIDATE_IDENTITY:"Identity",CLOUD_CONNECTOR_TESTING_TITLE:"Verifying & creating connector...",CLOUD_CONNECTOR_CONNECTION_FAILED_TITLE:"Connection Failed",CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT:"Odigos could not validate the connection. Review the error details below and retry.",CLOUD_CONNECTOR_CREATED_SUCCESS:"Connector created. It will appear in your connections list.",CLOUD_CONNECTOR_CREATED_MODAL_TITLE:"Connector created successfully!",CLOUD_CONNECTOR_CREATED_MODAL_DESC:"Your connector has been created and is now ready to start discovering workloads.",DATA_STREAM:"Data Stream",DATA_STREAMS:"Data Streams",STREAM_NAME:"Data Stream name",NAME_YOUR_STREAM:"Name your Data Stream",NAME_YOUR_STREAM_PLACEHOLDER:"e.g. Highest priority",STREAM_DESCRIPTION:"Provide a clear and descriptive name for your pipeline to ensure its purpose is easily understood by you and your team.",STREAM_CONFIRM:"Confirm your new Data Stream",RENAME_STREAM:e=>`Rename "${e}"`,DATA_STREAM_EXISTS_WARNING:(e,t)=>`A Data Stream with this name already exists, you can still rename the current "${e}", but it will merge into the existing "${t}".`,DATA_STREAM_MERGE_WARNING:(e,t)=>e?`A Data Stream named "${t}" already exists. Saving will merge "${e}" into "${t}" - both streams will share the same configuration going forward.`:`A Data Stream named "${t}" already exists. Saving will merge into "${t}" - the new stream will share the existing configuration going forward.`,ACTION:"Action",ACTIONS:"Actions",ADD_ACTION:"Add Action",ACTION_DETAILS:"Action Details",INSTRUMENTATION_RULE:"Instrumentation Rule",INSTRUMENTATION_RULES:"Instrumentation Rules",ADD_INSTRUMENTATION_RULE:"Add Instrumentation Rule",INSTRUMENTATION_RULE_DETAILS:"Instrumentation Rule Details",DESTINATION:"Destination",DESTINATIONS:"Destinations",ADD_DESTINATION:"Add Destination",ADD_DESTINATIONS:"Add Destinations",ADD_DESTINATION_DESCRIPTION:"Add a destination to send your telemetry data to. You can add multiple destinations.",DESTINATION_DETAILS:"Destination Details",SELECTED_DESTINATIONS:"Selected Destinations",SOURCE:"Source",SOURCES:"Sources",ADD_SOURCE:"Add Source",SOURCE_DETAILS:"Source Details",SELECT_SOURCES:"Select Sources",SELECTED_SOURCES:"Selected Sources",SELECT_SOURCES_DESCRIPTION:"Choose which sources to monitor in your pipeline.",NO_SOURCES:"No sources",NO_SOURCES_GO_BACK:"No sources selected. Please go back to select sources.",PLEASE_ADD_SOURCE:"Please add a source",NO_SOURCES_NAMESPACE:"No sources available in this namespace",TRY_SEARCH_OR_OTHER_NAMESPACE:"Try searching again or select another namespace.",PLEASE_MAKE_SURE_UNIGNORED_NAMESPACES:"Please make sure your cluster has unignored namespaces",INSTALLATION:"Installation",SOURCES_SETUP:"Sources setup",DESTINATIONS_SETUP:"Destinations setup",SUMMARY:"Summary",REVIEW_SETUP:"Review your setup and confirm your choices.",NO_SOURCES_SELECTED:"No sources selected",ADD_SOURCE_PROMPT:"Add at least one source to start collecting data",NO_DESTINATIONS_SELECTED:"No destinations selected",ADD_DESTINATION_PROMPT:"Add destination so your data has somewhere to go",GET_STARTED_WITH:"Get started with",GET_STARTED_DESCRIPTION:"First, select the sources you want Odigos to monitor. Next, choose where your data should be sent by configuring destinations.",TYPE:"Type",NOTES:"Notes",STATUS:"Status",INSTRUMENTATION_STATUS:"Instrumentation Status",INSTRUMENTATION:"Instrumentation",INSTRUMENTATION_DESCRIPTION:"Detected runtime and instrumentation applied to this source.",PROGRESS:"Progress",RUNTIME:"Runtime",LAST_UPDATED:"Last updated",ISSUES:"Issues",WAITING_FOR:"Waiting for",READONLY:"Readonly",LANGUAGE:"Language",VERSION:"Version",RUNTIME_VERSION:"Runtime Version",VERSION_PLACEHOLDER:"1.0.0",MONITORS:"Monitors",SIGNALS_FOR_PROCESSING:"Signals for Processing",MANAGED_BY_PROFILE:"Managed by Profile",TIER:"Tier",ENTERPRISE:"Enterprise",ENTERPRISE_TIER:"Enterprise Tier",COMMUNITY:"Community",COMMUNITY_TIER:"Community Tier",API_TOKEN:"API Token",API_TOKENS:"API Tokens",DESCRIBE_ODIGOS:"Describe Odigos",DESCRIBE_SOURCE:"Describe Source",OVERVIEW:"Overview",LIBRARIES:"Libraries",STANDARD_LIBRARY:"Standard Library",STANDARD:"Standard",PEER_SOURCES:"Peer Sources",PROFILING:"Profiling",INBOUND:"Inbound",OUTBOUND:"Outbound",INBOUND_DESCRIPTION:e=>`Services that send requests to ${e}`,OUTBOUND_DESCRIPTION:e=>`Services that ${e} sends requests to`,NO_INBOUND_CONNECTIONS_DESCRIPTION:"No services are currently sending requests to this source.",NO_OUTBOUND_CONNECTIONS_DESCRIPTION:"This source hasn't sent requests to other services yet.",NO_INBOUND_CONNECTIONS:"No inbound connections",NO_OUTBOUND_CONNECTIONS:"No outbound connections",COULD_NOT_FETCH_PEER_SOURCES:"Could not fetch peer sources",VIRTUAL:"Virtual",VIRTUAL_TOOLTIP:"This service is not instrumented/injected with Odigos, but we can still see it in the service map because it is connected to other services.",NO_RESULTS:"No results",NO_RESULTS_FOR_FILTER:e=>`No results matched the filter '${e}'`,POD:"Pod",PODS:"Pods",PODS_HEALTHY:"Pods are healthy",PODS_NOT_HEALTHY:"Pods are not healthy",NO_RUNNING_PODS:"No running pods",NO_RUNNING_PODS_SUBTITLE:"Check if you have any running pods and try again",AGENT_INJECTED:"Agent injected",AGENT_NOT_INJECTED:"Agent not injected",KUBERNETES_HEALTHY:"Kubernetes healthy",ODIGOS_HEALTHY:"Odigos healthy",HEALTHY:"Healthy",UNHEALTHY:"Unhealthy",NOT_HEALTHY:"Not Healthy",NODE:"Node",AGE:"Age",RUNNING_TIME:"Running Time",RUNNING_TIME_TOOLTIP:"Time elapsed since the container was last started and entered the Running state",NOT_RUNNING:"Not Running",RESTARTS:"Restarts",LATEST_REVISION:"Latest Revision",OLD_REVISION:"Old Revision",READY:"Ready",NOT_READY:"Not Ready",STARTED:"Started",NOT_STARTED:"Not Started",CRASHLOOP:"Crashloop",CRASHLOOP_BACKOFF:"Crashloop backoff",CANNOT_POOL_IMAGE:"Cannot pool image",DEVICE_NAME:"Device Name",INSTRUMENTED:"Instrumented",UNINSTRUMENTED:"Uninstrumented",INSTRUMENTED_WITH_DISTRO:e=>`Instrumented | ${e}`,DEBUG_COMMANDS:"Debug Commands",YAML:"YAML",YAML_FILES:"YAML Files",GET_POD_YAML:"Get Pod YAML",GET_POD_LOGS:"Get Pod Logs",DESCRIBE_POD:"Describe Pod",CONTAINER:"Container",CONTAINERS:"Containers",DETECTED_CONTAINERS:"Detected Containers",DETECTED_CONTAINERS_DESCRIPTION:"The system automatically instruments the containers it detects with a supported programming language.",NO_CONTAINERS_DETECTED:"No containers detected",DETECTED_PROCESSES:"Detected Processes",DETECTED_PROCESSES_DESCRIPTION:"The system automatically instruments the processes it detects with a supported programming language.",NO_PROCESSES_DETECTED:"No processes detected",CONTAINER_NAME:"Container Name",PROCESS:"Process",PROCESSES:"Processes",PROCESS_FALLBACK_NAME:"process",PROCESS_PID:"PID",EXECUTABLE:"Executable",COMMAND:"Command",OPEN_IN_POD_TAB:"Open in 'Pod' tab",OPEN_IN_SAMPLING_PAGE:"Open in 'Sampling' page",ALL_CONTAINERS_HEALTHY:e=>`All ${e} containers are healthy`,ALL_PROCESSES_HEALTHY:e=>`All ${e} processes are healthy`,PID:e=>`#${e}`,IDENTIFYING_ATTRIBUTES:"Identifying Attributes",INSTRUMENTATION_LIBRARIES:"Instrumentation Libraries",INSTRUMENTED_LIBRARIES:"Instrumented Libraries",FILTERED_COUNT_TOOLTIP:"Represents filtered amount, out of total amount",SEARCH_NAMESPACES:"Search Namespaces",SEARCH_SOURCES:"Search Sources",SELECT_ALL:"Select all",UNSELECT_ALL:"Unselect all",ONLY_SELECTED:"Only selected",ONLY_RUNNING_INSTANCES:"Only running instances",TO_COLLECT_OTEL_DATA:"To collect OpenTelemetry data",TO_MONITOR_OTEL_DATA:"To monitor OpenTelemetry data",TO_MODIFY_OTEL_DATA:"To modify OpenTelemetry data",NO_DATA_INSTRUMENTATION_RULES:"To configure how telemetry is collected",NO_DATA_SOURCES:"To start collecting telemetry from a Kubernetes workload",NO_DATA_ACTIONS:"To process telemetry before export",NO_DATA_DESTINATIONS:"To send telemetry to an observability backend",QUICK_BACK_TO_SUMMARY:"When you finish editing you can quickly go back to the summary.",GO_TO_SUMMARY:"Go to summary",FUTURE_APPS_TITLE:"Instrument entire namespace",FUTURE_APPS_DESCRIPTION:"When enabled, all applications in the namespace and new applications will be instrumented automatically and included in the current data stream using a Namespace Source.",OVERIDE:"Override",OVERIDDEN:"Overridden",OVERRIDE_RUNTIME_DETAILS:"Override Runtime Details",OVERRIDE_RUNTIME_DETAILS_SUBTITLE:"Use when multiple languages exist in the same container or when Odigos is unable to detect the application language",OVERRIDE_RUNTIME_WARNING:"This is an advanced configuration. If the selected programming language is incorrect, data collection may be incomplete or may not occur at all.",OVERRIDE_OTEL_DISTRO_NAME:"Override OpenTelemetry distro name",OVERRIDE_OTEL_DISTRO_NAME_SUBTITLE:"Use to set a specific Odigos OpenTelemetry distribution",OVERRIDE_OTEL_DISTRO_NAME_WARNING:"This is an advanced configuration. If the selected OpenTelemetry distro name is incorrect, data collection may be incomplete or may not occur at all.",OVERRIDE_OTEL_DISTRO_NAME_SAVE_TOOLTIP:"Use the provided OpenTelemetry distro name to instrument this container",OVERRIDE_OTEL_DISTRO_NAME_DELETE_TOOLTIP:"Remove manual override of OpenTelemetry distro name, and use Odigos automatic detection OpenTelemetry distro name for instrumentation",OVERRIDE_RUNTIME_DETAILS_SAVE_TOOLTIP:"Use the provided runtime details to instrument this container",OVERRIDE_RUNTIME_DETAILS_DELETE_TOOLTIP:"Remove manual override of runtime details, and use Odigos automatic detection runtime details for instrumentation",OTEL_DISTRO_NAME:"OpenTelemetry distro name",WAITING_FOR_RUNTIME_DETECTION:"Waiting for runtime detection...",DETECTING_RUNTIME_INFO:"Detecting runtime info",NO_AVAILABLE_AGENT:"No available agent",ACTIVE:"Active",INACTIVE:"Inactive",ENABLED:"Enabled",DISABLED:"Disabled",NO_TRACES_FOUND:"No traces found",ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC:"Are your services instrumented & producing traffic?",JAVA_CUSTOM_PROBES:"Java Custom Probes",GOLANG_CUSTOM_PROBES:"Golang Custom Probes",PHP_CUSTOM_PROBES:"PHP Custom Probes",ROLLOUT:"Rollout",ROLLOUT_RESTART:"Rollout Restart",ROLLOUT_RESTART_WORKLOADS_DESCRIPTION:"Are you sure you want to rollout restart these workloads?",ROLLOUT_NOT_REQUIRED:"Rollout Not Required",ROLLOUT_NOT_REQUIRED_MESSAGE:"This source is instrumented with eBPF and does not require a restart.",ROLLOUT_FAILED:"Rollout Failed",ROLLOUT_PREVIOUS_ONGOING:"Previous Rollout Ongoing",ROLLOUT_PREVIOUS_ONGOING_MESSAGE:"A previous rollout is ongoing. Please wait for it to finish before triggering a new one.",ROLLOUT_AUTO_DISABLED:"Auto Rollout Disabled",ROLLOUT_AUTO_DISABLED_MESSAGE:"Trigger a manual rollout to inject the agent.",ROLLOUT_FINISHED:"Rollout Finished",ROLLOUT_FINISHED_MESSAGE:"All pods have been updated and are healthy.",ROLLBACK:"Rollback",ROLLBACK_OCCURRED:"Rollback Occurred",ROLLBACK_OCCURRED_MESSAGE:"Odigos detected a crash and rolled back instrumentation to protect your workload.",ROLLBACK_SUCCESS:"Rollback Success",ROLLBACK_RECOVER:"Recover",FETCHING_NAMESPACES:"Fetching namespaces",FETCHING_NAMESPACES_SUBTITLE:"Please wait while we fetch the namespaces",ADD_SOURCES_DESCRIPTION:"Choose which sources to monitor in your pipeline.",CREATING_SOURCES:"Creating Sources...",CREATING_SOURCES_SUBTITLE:"This may take a few moments while sources are being created.",SELECT_NAMESPACE:"Select namespace from the list",SELECT_NAMESPACE_SUBTITLE:"Add namespace so you can select workloads from it.",CREATING_ACTION:"Creating action",CREATING_ACTION_SUBTITLE:"Please wait while we create the action",ADD_ACTION_DESCRIPTION:"Select an action to modify telemetry data before it's sent to destinations. Choose an action type and configure its details.",CREATING_INSTRUMENTATION_RULE:"Creating instrumentation rule",CREATING_INSTRUMENTATION_RULE_SUBTITLE:"Please wait while we create the instrumentation rule",ADD_INSTRUMENTATION_RULE_DESCRIPTION:"Define how telemetry is recorded from your application. Choose a rule type and configure the details.",CREATING_DESTINATION:"Creating destination",CREATING_DESTINATION_SUBTITLE:"Please wait while we create the destination",ADD_DESTINATION_DRAWER_DESCRIPTION:"Add backend destination you want to connect with Odigos.",THROUGHPUT_LAST_10_SECONDS:"Throughput (last 10 seconds)",DELETE_POD_TO_RESTART:"Delete Pod to Restart",DEBUG:"Debug",SAMPLING:"Sampling",HEAD_SAMPLING:"Head Sampling",TAIL_SAMPLING:"Tail Sampling",NOISY_OPERATIONS:"Noisy Operations",HIGHLY_RELEVANT_OPERATIONS:"Highly Relevant Operations",COST_REDUCTION_OPERATIONS:"Cost Reduction Operations"},Oo={GET_STARTED:"Get started",ADD:"Add",ADD_NEW:"Add New",CREATE_NEW:"Create new",NEW:"New",SELECT:"Select",CREATE:"Create",UPDATE:"Update",EDIT:"Edit",DELETE:"Delete",RESTART:"Restart",RESTART_POD:"Restart pod",REFRESH:"Refresh",CANCEL:"Cancel",CLOSE:"Close",DONE:"Done",SAVE:"Save",BACK:"Back",CONFIRM:"Confirm",NEXT:"Next",VERIFY:"Verify",VERIFY_AND_CREATE_CONNECTOR:"Verify & Create Connector",STAY_ON_CONNECTIONS:"Stay on connections page",GO_TO_CONNECTOR_OVERVIEW:"Go to connector overview",RETRY:"Retry",TEST:"Test",TEST_CONNECTION:"Test Connection",INSTRUMENT:"Instrument",UNINSTRUMENT:"Uninstrument"},No=(e,t)=>e===Tn.Success?To.HEALTHY:e===Tn.Error?To.NOT_HEALTHY:po(t),Ao=e=>{if(!e)return null;switch(e){case Pn.Irrelevant:return null;case Pn.Failure:case Pn.Error:return Tn.Error;case Pn.Notice:return Tn.Warning;case Pn.Pending:case Pn.Waiting:return Tn.Loading;case Pn.Unsupported:case Pn.Disabled:return Tn.Disabled;case Pn.Success:return Tn.Success;case Pn.Unknown:default:return Tn.Info}},Io=(e,t,n="reason",o)=>{const r=Ao(e?.status);return r?{key:`desired-status-${e?.name}`,status:r,leftIcon:t||(r===Tn.Success?y:b),label:o||("reason"===n?po(e?.reasonEnum):No(r,e?.reasonEnum)),tooltip:e?.message,textSize:go.XXXS,invertColors:!0,useSecondaryTone:!0}:null};var _o;(e=>{e.SIGNALS="SIGNALS"})(_o||(_o={}));const Ro=(e,t,n)=>{if(!e||!e.length)return!0;if(1===e.length)return"true"==e[0];const[o,r,i]=e;if(o===_o.SIGNALS)switch(r){case"INCLUDES":return t?.includes(i);case"EXCLUDES":return!t?.includes(i);default:return!0}const a=n.find(e=>e.name===o||e.key===o);if(!a)return!1;const s=null==a.value?"":String(a.value);switch(r){case"===":case"==":return s===i;case"!==":case"!=":return s!==i;case">":return Number(s)>Number(i);case"<":return Number(s)<Number(i);case">=":return Number(s)>=Number(i);case"<=":return Number(s)<=Number(i);default:return!0}};function Do(e,t){if(!e)return t;if("object"==typeof e)return e;try{return JSON.parse(e)}catch(e){return t}}const ko=e=>({status:e?Tn.Success:Tn.Unknown,label:e?"True":"False",invertColors:!0}),Lo=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),Po=e=>null==e||""===e?"-":"boolean"==typeof e?e?"True":"False":"number"==typeof e?String(e):"string"==typeof e?e||"-":JSON.stringify(e),Mo=e=>"string"==typeof e?{id:e,label:e}:e??{},Uo=(e,t)=>e.label||e.displayName||t,Fo=(e,t,n={})=>{const o=[],r=n.signals||[],i=new Set(n.skipComponentTypes||[]),a=Object.entries(e).map(([e,t])=>({name:e,key:e,value:t}));return t.forEach((t,n)=>{if(!t?.name||i.has(t.componentType))return;if(t.renderCondition?.length&&!Ro(t.renderCondition,r,a))return;const s=t.displayName||t.name,l=`${t.name}-${n}`,c=e[t.name],d=Do(t.componentProperties,{});switch(t.componentType){case xn.Toggle:case xn.Checkbox:return void o.push({id:l,title:s,badge:ko(!!c)});case xn.CheckboxList:{const t=d.valueMode||"object";if("array"===t){const e=Array.isArray(c)?c.map(String):[];return void o.push({id:l,title:s,label:e.length?e.join(", "):"-"})}if("flatFields"===t)return void(Array.isArray(d.options)?d.options:[]).forEach((t,n)=>{const r=Mo(t),i=String(r.id??"");i&&o.push({id:`${l}-${n}-${i}`,title:Uo(r,i),badge:ko(!0===e[i])})});const n=Lo(c)?c:{},r=Array.isArray(d.options)?d.options:[];if(r.length){const e=r.map(e=>{const t=Mo(e),o=String(t.id??"");return o&&n[o]?Uo(t,o):null}).filter(Boolean);return void o.push({id:l,title:s,label:e.length?e.join(", "):"-"})}const i=Object.entries(n).filter(([,e])=>!!e).map(([e])=>e);return void o.push({id:l,title:s,label:i.length?i.join(", "):"-"})}case xn.MultiInput:{const e=d.wrapKey,t=d.itemWrapperKey,n=e&&Lo(c)?c[e]:c;if(Array.isArray(n)&&n.length){const e=n.map(e=>t&&Lo(e)?String(e[t]??""):String(e??""));return void o.push({id:l,title:s,label:e.filter(Boolean).join(", ")||"-"})}return void o.push({id:l,title:s,label:"-"})}case xn.KeyValuePair:return Lo(c)&&Object.keys(c).length?void Object.entries(c).forEach(([e,t],n)=>{o.push({id:`${l}-${n}`,title:e,label:String(t??"")})}):Array.isArray(c)&&c.length?void c.forEach((e,t)=>{const n=Lo(e)?e:{};o.push({id:`${l}-${t}`,title:String(n.key??""),label:String(n.value??"")})}):void o.push({id:l,title:s,label:"-"});case xn.MultiTabledInput:{const e=d.wrapKey,t=Array.isArray(e&&Lo(c)?c[e]:c)?e&&Lo(c)?c[e]:c:[],n=Array.isArray(d.columns)?d.columns:[],r=e=>{const t=n.find(t=>Lo(t)&&t.keyName===e);return t?.label||e};return t.length?void t.forEach((e,n)=>{const i=t.length>1?`${s} #${n+1} `:`${s} `;Object.entries(e||{}).forEach(([e,t])=>{null!=t&&""!==t&&o.push({id:`${l}-${n}-${e}`,title:`${i}${r(e)}`,label:Po(t)})})}):void o.push({id:l,title:s,label:"-"})}case xn.FieldGroup:{const e=Array.isArray(c)?c:[];return e.length?void e.forEach((t,n)=>{const r=e.length>1?`${s} #${n+1} `:`${s} `;Object.entries(t||{}).forEach(([e,t])=>{null!=t&&""!==t&&o.push({id:`${l}-${n}-${e}`,title:`${r}${e}`,label:Po(t)})})}):void o.push({id:l,title:s,label:"-"})}default:o.push({id:l,title:s,label:Po(c)})}}),o},zo=e=>e.charAt(0).toUpperCase()+e.slice(1),Bo=e=>{const t=e=>e.filter(e=>"object"==typeof e&&null!==e?""!==e.key&&""!==e.value:""!==e),n=e=>Object.fromEntries(Object.entries(e).filter(([e,t])=>""!==e&&""!==t).map(([e,o])=>Array.isArray(o)?[e,t(o)]:"object"==typeof o&&null!==o?[e,n(o)]:[e,o]));return Object.entries(e).reduce((e,[o,r])=>{try{const i=JSON.parse(r);Array.isArray(i)?e[o]=JSON.stringify(t(i)):e[o]="object"==typeof i&&null!==i?JSON.stringify(n(i)):r}catch(i){"object"==typeof r&&null!==r?Array.isArray(r)?e[o]=JSON.stringify(t(r)):e[o]=JSON.stringify(n(r)):e[o]=r}return e},{})},Ho=e=>JSON.parse(JSON.stringify(e)),jo=(e,t)=>t.split(".").reduce((e,t)=>e?.[t],e),Wo=(e,t,n)=>{const o=t.split(".");let r=e;for(let e=0;e<o.length-1;e++)o[e]in r&&"object"==typeof r[o[e]]||(r[o[e]]={}),r=r[o[e]];r[o[o.length-1]]=n},Go=(e,t)=>{let n=[...e];return t.monitors?.length&&(n=n.filter(e=>!!t.monitors?.find(t=>e.signals?.find(e=>e.toLowerCase()===t.id)))),n},Xo=(e,t)=>{let n=[...e];return t.monitors?.length&&(n=n.filter(e=>!!t.monitors?.find(t=>e.exportedSignals[t.id]))),n},Vo=(e,t)=>t?e.filter(e=>e.dataStreamNames.includes(t)||!e.dataStreamNames.length):[],Ko=(e,t)=>{let n=e;if(t.namespaces?.length){const e=new Set(t.namespaces.map(({id:e})=>e));n=n.filter(({id:t})=>e.has(t.namespace))}if(t.regions?.length){const e=new Set(t.regions.map(({id:e})=>e));n=n.filter(({id:t})=>!!t.region&&e.has(t.region))}if(t.kinds?.length){const e=new Set(t.kinds.map(({id:e})=>e));n=n.filter(({id:t})=>e.has(t.kind))}if(t.languages?.length){const e=new Set(t.languages.map(({id:e})=>e));n=n.filter(({runtimeInfo:t,containers:n})=>t?.detectedLanguages?.some(t=>e.has(t))||n?.some(t=>{const n=t.overrides?.runtimeInfo?.language??t.runtimeInfo?.language;return!!n&&e.has(n)}))}if(t.podsAgentInjectionStatus?.length){const e=new Set(t.podsAgentInjectionStatus.map(({id:e})=>e));n=n.filter(({podsAgentInjectionStatus:t})=>e.has(t?.reasonEnum??"")||e.has(t?.message??""))}if(t.statuses?.length){const e=new Set(t.statuses.map(({id:e})=>e));n=n.filter(({instrumentationReport:t})=>{const n=t?.state||t?.progressStage;return!!n&&e.has(n)})}return t.onlyErrors&&(n=n.filter(e=>Ao(e.workloadOdigosHealthStatus?.status)===Tn.Error)),n},Yo=(e,t)=>t?e.filter(e=>e.dataStreamNames?.includes(t)||t===So&&!e.dataStreamNames?.length):[],Jo=(e,t="",n={})=>{for(const o in e)if(e.hasOwnProperty(o)){const r=e[o],i=t?`${t}.${o}`:o;null===r||"object"!=typeof r||Array.isArray(r)?Array.isArray(r)?r.forEach((e,t)=>{const o=`${i}[${t}]`;null!==e&&"object"==typeof e?Jo(e,o,n):n[o]=e}):n[i]=r:Jo(r,i,n)}return n},qo=e=>{if(!e)return"0 KB/s";const t=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,t)).toFixed(0===t?0:1)} ${["Bytes/s","KB/s","MB/s","GB/s","TB/s"][t]}`},Qo=e=>{if(!e)return"0 ns";if(e<1e3)return`${e.toFixed(0)} ns`;if(e<1e6){const t=e/1e3;return`${t.toFixed(t<10?2:0)} μs`}if(e<1e9){const t=e/1e6;return`${t.toFixed(t<10?2:0)} ms`}if(e<6e10){const t=e/1e9;return`${t.toFixed(t<10?2:0)} s`}if(e<36e11){const t=e/6e10;return`${t.toFixed(t<10?2:0)} m`}if(e<864e11){const t=e/36e11;return`${t.toFixed(t<10?2:0)} h`}{const t=e/864e11;return`${t.toFixed(t<10?2:0)} d`}},Zo=()=>{const e=crypto.getRandomValues(new Uint8Array(16));let t=0;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,n=>{const o=e[t%16];return t++,("1"===n?o:"0"===n?63&o|128:15&o|64).toString(16)})},er=e=>e?e.reduce((e,t)=>{if(null!=t){const n=Ao(t.status);n&&e.push({status:n,type:t.name??"",reason:t.reasonEnum??null,message:t.message??null})}return e},[]):[],tr=e=>Array.isArray(e?.statuses)?er(e.statuses):e?.conditions??[],nr=e=>e?Array.isArray(e)?or(e):or(er(Object.values(e))):or([]),or=e=>{const t=e?.filter(({status:e})=>e===Tn.Error),n=e?.filter(({status:e})=>e===Tn.Warning),o=e?.filter(({status:e})=>e===Tn.Disabled),r=e?.filter(({status:e})=>e===Tn.Loading),i=t.length>0,a=n.length>0,s=o.length>0;return{errors:t,hasErrors:i,warnings:n,hasWarnings:a,disableds:o,hasDisableds:s,loadings:r,hasLoadings:r.length>0,priorotizedStatus:i?Tn.Error:a?Tn.Warning:s?Tn.Info:void 0}},rr=e=>{const t=e?.reduce((e,t)=>t.agentEnabled?.agentEnabled?e+1:e,0);return`${t}/${e?.length||0} instrumented`},ir=e=>({[En.Java]:L,[En.Go]:k,[En.JavaScript]:D,[En.Python]:R,[En.DotNet]:_,[En.CSharp]:I,[En.CPlusPlus]:A,[En.Php]:N,[En.Ruby]:O,[En.Rust]:T,[En.Swift]:w,[En.Elixir]:x,[En.MySql]:C,[En.Nginx]:$,[En.Postgres]:S,[En.Redis]:E,[En.Kafka]:v,[En.Ignored]:p,[En.Unknown]:p,[En.Processing]:p,[En.NoContainers]:p,[En.NoRunningPods]:p}[e]||p),ar=e=>e?e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??En.Unknown:En.Unknown,sr=e=>e?e.overrides?.runtimeInfo?.runtimeVersion??e.runtimeInfo?.runtimeVersion??null:null,lr=e=>e?.map(e=>ir(ar(e)))||[],cr=e=>e?.map(e=>ir(e))||[],dr=e=>e.runtimeInfo?.detectedLanguages?.length?cr(e.runtimeInfo?.detectedLanguages):lr(e.containers),ur=(e,t)=>{const n={[Dn.Alauda]:ze,[Dn.AlibabaCloud]:Fe,[Dn.AppDynamics]:Ue,[Dn.Axiom]:Me,[Dn.AzureBlob]:Pe,[Dn.AzureMonitor]:Le,[Dn.BetterStack]:ke,[Dn.Bonree]:De,[Dn.Causely]:Re,[Dn.Checkly]:_e,[Dn.Chronosphere]:Ie,[Dn.ClickHouse]:Ae,[Dn.CloudWatch]:Ne,[Dn.Coralogix]:Oe,[Dn.Dash0]:Te,[Dn.Datadog]:we,[Dn.Dynamic]:Z,[Dn.Dynatrace]:xe,[Dn.ElasticApm]:Ce,[Dn.ElasticSearch]:$e,[Dn.GoogleCloud]:Se,[Dn.GoogleCloudOTLP]:Se,[Dn.GrafanaCloudLoki]:Ee,[Dn.GrafanaCloudPrometheus]:Ee,[Dn.GrafanaCloudTempo]:Ee,[Dn.Greptime]:ve,[Dn.Groundcover]:be,[Dn.Honeycomb]:ye,[Dn.HyperDX]:fe,[Dn.Instana]:me,[Dn.Jaeger]:ge,[Dn.Kafka]:v,[Dn.Kloudmate]:he,[Dn.Last9]:pe,[Dn.Lightstep]:ue,[Dn.LogzIo]:de,[Dn.Loki]:ce,[Dn.Lumigo]:le,[Dn.Middleware]:se,[Dn.NewRelic]:ae,[Dn.Observe]:ie,[Dn.Odigos]:re,[Dn.OneUptime]:oe,[Dn.OpenObserve]:ne,[Dn.Opsverse]:te,[Dn.Oracle]:ee,[Dn.OTLP]:Z,[Dn.OTLPHttp]:Z,[Dn.Prometheus]:Q,[Dn.Qryn]:q,[Dn.QrynOss]:J,[Dn.Quickwit]:Y,[Dn.S3]:K,[Dn.Seq]:V,[Dn.Signalfx]:G,[Dn.Signoz]:X,[Dn.Splunk]:G,[Dn.SplunkSapm]:G,[Dn.SplunkOtlp]:G,[Dn.SumoLogic]:W,[Dn.TelemetryHub]:j,[Dn.Tempo]:H,[Dn.Tingyun]:B,[Dn.Traceloop]:z,[Dn.Uptrace]:F,[Dn.VictoriaMetrics]:U,[Dn.VictoriaMetricsCloud]:U,[Dn.XRay]:M,[Dn.Pyroscope]:P}[e];return n&&!t?{icon:n}:{iconSrc:`https://d15jtxgb40qetw.cloudfront.net/${e}.svg`}},pr=e=>({[$n.Namespace]:Ge,[$n.Source]:We,[$n.Destination]:je,[$n.Action]:u,[$n.InstrumentationRule]:He,[$n.SamplingRule]:Be}[e]),hr=e=>"ruleId"in e&&e.ruleId?e.ruleId:"id"in e&&"string"==typeof e.id&&e.id||"id"in e&&"object"==typeof e.id&&e.id.namespace&&e.id.kind&&e.id.name?e.id:"namespace"in e&&e.namespace&&"kind"in e&&e.kind&&"name"in e&&e.name?{namespace:e.namespace,name:e.name,kind:e.kind,..."region"in e&&e.region?{region:e.region}:{}}:"name"in e&&e.name?e.name:void 0,gr=e=>{if(!e)return"";if("string"==typeof e)return e;const t=`${e.namespace}/${e.kind}/${e.name}`;return e.region?`${t}/${e.region}`:t},mr=e=>gr(hr(e)),fr=(e,t,n)=>{const{extended:o,prioritizeDisplayName:r}=n||{};let i="",a="";switch(t){case $n.InstrumentationRule:const t=e;i=t.type,a=t.ruleName;break;case $n.Source:const n=e;i=n.id.name,a=n.serviceName||"";break;case $n.Action:const o=e;i=o.type,a=o.name||"";break;case $n.Destination:const r=e;i=r.destinationType.displayName,a=r.name;break;case $n.Namespace:const s=e;i=s.name,a=s.name}return o?i+(a&&a!==i?` (${a})`:""):r&&a||i},yr=(e,t)=>{if(t===$n.Source){const t={namespace:"",name:"",kind:""};return e.split("&").forEach(e=>{const[n,o]=e.split("=");t[n]=o}),t}return e},br=e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??En.Unknown,vr=e=>{const{numberOfInstances:t,containers:n}=e;if(!n)return t&&t>0?En.Processing:En.NoRunningPods;const o=n?.filter(e=>br(e)!==En.Ignored);if(!o.length)return En.NoContainers;const r=o.find(e=>br(e)!==En.Unknown);return r?br(r):En.Unknown},Er=(e,t,n)=>(t===$n.Source?e?.sources.find(e=>e.kind===n.kind&&e.name===n.name&&e.namespace===n.namespace):e?.destinations.find(e=>e.id===n))||{throughput:0},Sr=e=>({[Xn.Logs]:Ke,[Xn.Metrics]:Ve,[Xn.Traces]:Xe,[Xn.Profiles]:re}[e]),$r=(e,t)=>Object.values(go).reduce((n,o)=>Math.abs(t[o]-e)<Math.abs(t[n]-e)?o:n),Cr=e=>e&&{[yn.K8s]:Qe,[yn.Vm]:qe,[yn.Connector]:Je,[yn.AwsEcs]:Ye}[e]||re,xr=e=>e?{[yn.K8s]:"Kubernetes Cluster",[yn.Vm]:"Virtual Machine",[yn.Connector]:"Cloud Connector",[yn.AwsEcs]:"AWS ECS"}[e]:"Unknown",wr=(e,t,n)=>{const o=e[t];return o?o.flatMap(e=>{const o=e[n],r=[];return void 0!==o&&(Array.isArray(o)?r.push(...o):r.push(o)),r.push(...wr(e,t,n)),r}):[]},Tr={"aws.lambda":"AWS Lambda","aws.fargate-task":"ECS Fargate Task","aws.fargate-cluster":"ECS Fargate Cluster","aws.ecs-cluster":"ECS Cluster","aws.eks":"Amazon EKS","aws.ec2":"Amazon EC2"},Or=e=>{if(!e)return"";if(Tr[e])return Tr[e];if(e.includes(".")){return e.slice(e.indexOf(".")+1).split(/[-_]/).map(e=>e?e[0].toUpperCase()+e.slice(1):e).join(" ")}return e},Nr=(e,t)=>{if(t===$n.Source){let t="";return Object.entries(e).forEach(([e,n])=>{t+=`${e}=${n}&`}),t.slice(0,-1),t}return e},Ar=(e,t,n)=>{switch(n=n??"500",t){case Tn.Default:return e.v2.colors.purple[n];case Tn.Info:return e.v2.colors.blue[n];case Tn.Error:return e.v2.colors.red[n];case Tn.Warning:return e.v2.colors.yellow[n];case Tn.Success:return e.v2.colors.green[n];case Tn.Loading:case Tn.Disabled:case Tn.Unknown:return e.v2.colors.silver[n];default:return e.v2.colors.white[500]}},Ir=e=>{switch(e){case Hn.Updating:case jn.Pending:case Wn.ContainerCreating:case Gn.Waiting:return Tn.Info;case Hn.Healthy:case jn.Succeeded:case jn.Running:case Wn.Running:case Gn.Running:return Tn.Success;case Hn.Degraded:return Tn.Warning;case Hn.Failed:case jn.Failed:case Wn.Error:case Wn.CrashLoopBackOff:case Wn.CreateContainerError:case Wn.CreateContainerConfigError:case Wn.ErrImagePull:case Wn.ErrImageNeverPull:case Wn.ImagePullBackOff:case Wn.InvalidImageName:case Wn.RegistryUnavailable:case Wn.NetworkNotReady:case Wn.OOMKilled:case Wn.ContainerCannotRun:case Gn.Terminated:case Wn.DeadlineExceeded:case Wn.StartError:return Tn.Error;case Hn.Down:case Wn.Completed:return Tn.Disabled;case Hn.Unknown:case jn.Unknown:default:return Tn.Unknown}},_r=o.div`
|
|
42
42
|
border-radius: 100%;
|
|
43
43
|
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
44
44
|
position: relative;
|
package/lib/components.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{Z as Autocomplete,bB as Badge,B as Button,i as ButtonSize,gm as ButtonTab,gn as ButtonTabList,j as ButtonVariants,a$ as CenterThis,C as Checkbox,go as CheckboxList,$ as CheckboxSize,co as CliCommand,b5 as Code,c8 as Condition,ca as Conditions,gp as DEFAULT_TIME_UNITS,z as DataCard,a4 as Divider,D as Drawer,ax as DropData,d7 as DropDataAlignX,d6 as DropDataAlignY,s as DropDown,gq as ErrorBoundary,k as FieldMessage,d as FieldTitle,F as FlexColumn,h as FlexRow,eK as GaugeChart,gr as GaugeChartVariant,gs as Header,gt as HoverActions,b_ as IconButton,b$ as IconButtonSize,ct as IconGroup,x as Input,a5 as InputCardTable,w as InputList,I as InputTable,cI as Island,b1 as Loader,d8 as Modal,gu as ModalBody,gv as Navbar,b0 as NoData,N as Note,gw as Overlay,by as Padding,en as PageContent,ar as Radio,c6 as RadioCard,gx as RadioGroup,bG as RadioSize,a_ as ScrollY,b2 as Search,Q as SectionCard,gy as SectionCardSize,Y as Segment,bI as SegmentSize,cF as SegmentVariant,bz as SkeletonLoader,eJ as StatusCard,eo as Stepper,cG as Table,gz as TableContainer,gA as TableTitleWrap,cH as TableVariant,gB as TableWrap,H as Tag,cn as TagVariants,u as TextArea,eL as TextCard,r as TimeInput,o as Toggle,gC as ToggleCodeComponent,p as ToggleLabelAlign,gD as ToggleList,q as ToggleSize,gE as ToggleVariant,T as Tooltip,bH as TruncatableTypography,e as Typography,f as TypographyColor,g as TypographySize,c2 as TypographyVariants,eM as UpgradeRequiredWrapper,gF as VerticalScroll,W as WarningModal,gG as resolveTypographyColor}from"./chunks/ui-components-
|
|
1
|
+
export{Z as Autocomplete,bB as Badge,B as Button,i as ButtonSize,gm as ButtonTab,gn as ButtonTabList,j as ButtonVariants,a$ as CenterThis,C as Checkbox,go as CheckboxList,$ as CheckboxSize,co as CliCommand,b5 as Code,c8 as Condition,ca as Conditions,gp as DEFAULT_TIME_UNITS,z as DataCard,a4 as Divider,D as Drawer,ax as DropData,d7 as DropDataAlignX,d6 as DropDataAlignY,s as DropDown,gq as ErrorBoundary,k as FieldMessage,d as FieldTitle,F as FlexColumn,h as FlexRow,eK as GaugeChart,gr as GaugeChartVariant,gs as Header,gt as HoverActions,b_ as IconButton,b$ as IconButtonSize,ct as IconGroup,x as Input,a5 as InputCardTable,w as InputList,I as InputTable,cI as Island,b1 as Loader,d8 as Modal,gu as ModalBody,gv as Navbar,b0 as NoData,N as Note,gw as Overlay,by as Padding,en as PageContent,ar as Radio,c6 as RadioCard,gx as RadioGroup,bG as RadioSize,a_ as ScrollY,b2 as Search,Q as SectionCard,gy as SectionCardSize,Y as Segment,bI as SegmentSize,cF as SegmentVariant,bz as SkeletonLoader,eJ as StatusCard,eo as Stepper,cG as Table,gz as TableContainer,gA as TableTitleWrap,cH as TableVariant,gB as TableWrap,H as Tag,cn as TagVariants,u as TextArea,eL as TextCard,r as TimeInput,o as Toggle,gC as ToggleCodeComponent,p as ToggleLabelAlign,gD as ToggleList,q as ToggleSize,gE as ToggleVariant,T as Tooltip,bH as TruncatableTypography,e as Typography,f as TypographyColor,g as TypographySize,c2 as TypographyVariants,eM as UpgradeRequiredWrapper,gF as VerticalScroll,W as WarningModal,gG as resolveTypographyColor}from"./chunks/ui-components-BUMZXMZ4.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";
|
package/lib/constants.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{bA as ACTION_CATEGORIES,bm as ACTION_OPTIONS,fV as ACTION_TYPE_TO_CATEGORY,fW as ALL_LANGUAGES_WILDCARD,fX as ALL_SOURCES,cN as BTN_CANCEL,cU as BTN_CONTINUE_EDITING,eP as BTN_CREATE_FIRST_RULE,cK as BTN_CREATE_RULE,cQ as BTN_DELETE_RULE,a6 as BTN_EDIT_AUTO_RULE,cP as BTN_EDIT_RULE,d2 as BTN_SAVE,cO as BTN_SAVE_RULE,l as BUTTON_TEXTS,cR as CATEGORY_DESCRIPTIONS,aV as CATEGORY_LABELS,cT as CATEGORY_TITLES,fY as CREATE_COST_REDUCTION_AUTO_RULE_DRAWER_TITLE,fZ as CREATE_HIGHLY_RELEVANT_AUTO_RULE_DRAWER_TITLE,f_ as CREATE_NOISY_AUTO_RULE_DRAWER_TITLE,c4 as DEFAULT_CLUSTER_ID,c3 as DEFAULT_CLUSTER_NAME,eG as DEFAULT_DATA_STREAM_NAME,al as DESC_DURATION,f$ as DESC_ERRORS,ao as DESC_OPERATION,g0 as DESC_PERCENTAGE_HIGHLY_RELEVANT,bT as DESC_PERCENTAGE_NOISY,aW as DESC_RULE_TYPE,X as DESC_SOURCE_SCOPE,c0 as DESTINATION_CATEGORIES,es as DISPLAY_LANGUAGES,m as DISPLAY_TITLES,bJ as DOCS_BASE_URL,br as DestinationCategoryTypes,c_ as EDIT_COST_REDUCTION_AUTO_RULE_DRAWER_SUBTITLE,c$ as EDIT_COST_REDUCTION_AUTO_RULE_DRAWER_TITLE,cY as EDIT_HIGHLY_RELEVANT_AUTO_RULE_DRAWER_SUBTITLE,cZ as EDIT_HIGHLY_RELEVANT_AUTO_RULE_DRAWER_TITLE,d0 as EDIT_NOISY_AUTO_RULE_DRAWER_SUBTITLE,d1 as EDIT_NOISY_AUTO_RULE_DRAWER_TITLE,cS as EDIT_TITLES,aC as EMPTY_VALUE,bF as EXTRACTION_FORMAT_COPY,bD as EXTRACT_ATTRIBUTE_FORM,eN as FILTER_TYPE_ALL,b7 as FORM_ALERTS,bv as INSTRUMENTATION_RULE_OPTIONS,am as LABEL_CUSTOM_DURATION,bX as LABEL_CUSTOM_PERCENTAGE,bW as LABEL_DISABLED,cJ as LABEL_DISABLED_RULE,aM as LABEL_DROP_ALL,bQ as LABEL_DROP_AT_MOST,bV as LABEL_ENABLED,au as LABEL_HTTP_ROUTE,aw as LABEL_HTTP_ROUTE_PREFIX,az as LABEL_KAFKA_TOPIC,aN as LABEL_KEEP_ALL,aJ as LABEL_KEEP_AT_LEAST,aK as LABEL_KEEP_AT_MOST,aI as LABEL_KEEP_PERCENTAGE,ak as LABEL_KEEP_TRACES_DURATION,ai as LABEL_KEEP_TRACES_ERRORS,ay as LABEL_METHOD,aR as LABEL_NOTE,a7 as LABEL_NO_PREVIEW,aB as LABEL_OPERATION_TYPE,g1 as LABEL_RULE_DISABLED,g2 as LABEL_RULE_ENABLED,aP as LABEL_RULE_NAME,aQ as LABEL_RULE_TYPE,aL as LABEL_SAMPLE,aq as LABEL_SERVER_ADDRESS,at as LABEL_TEMPLATED_PATH,av as LABEL_TEMPLATED_PATH_PREFIX,cA as LANGUAGE_OPTIONS,aZ as MONITORS_OPTIONS,E as NOTE_ENTIRE_CLUSTER,L as NOTE_SOURCE_SCOPE_LOGIC,g3 as OPENTELEMETRY_EBPF_DISTRO_OPTION,aE as OPERATION_ALL,aD as OPERATION_HTTP_CLIENT,aA as OPERATION_HTTP_SERVER,aF as OPERATION_KAFKA_CONSUMER,aG as OPERATION_KAFKA_PRODUCER,cz as OTEL_DISTRO_NAME_OPTIONS,aH as PERCENTAGE_SECTION_DESCRIPTIONS,aT as PLACEHOLDER_NOTE,as as PLACEHOLDER_ROUTE,aS as PLACEHOLDER_RULE_NAME,_ as PLACEHOLDER_SEARCH_SOURCE,ap as PLACEHOLDER_SERVER_ADDRESS,cl as PROCESS_ATTRIBUTE_NAMES,c as REGEX_TESTER_DRAWER,bU as SAMPLING_AUTO_RULE_TITLE,eV as SAMPLING_BTN_CREATE_RULE,eT as SAMPLING_BTN_DOCS,eU as SAMPLING_BTN_REFRESH,bS as SAMPLING_COST_REDUCTION_AUTO_RULE_TITLE,cV as SAMPLING_DEFAULT_CONFIRM_DESCRIPTION,cX as SAMPLING_DEFAULT_CONFIRM_PREVIEW_LABEL,cW as SAMPLING_DEFAULT_CONFIRM_TITLE,eY as SAMPLING_DELETE_MODAL_APPROVE,eZ as SAMPLING_DELETE_MODAL_CANCEL,e_ as SAMPLING_DELETE_MODAL_DESCRIPTION,e$ as SAMPLING_DELETE_MODAL_TITLE,d3 as SAMPLING_DRAWER_WIDTH,eS as SAMPLING_DUPLICATE_RULE_WARNING,bP as SAMPLING_HIGHLY_RELEVANT_AUTO_RULE_TITLE,dV as SAMPLING_ONBOARDING_ADVANCED_LEFT_BULLET_1,dW as SAMPLING_ONBOARDING_ADVANCED_LEFT_BULLET_2,dX as SAMPLING_ONBOARDING_ADVANCED_LEFT_BULLET_3,dY as SAMPLING_ONBOARDING_ADVANCED_LEFT_TITLE,dZ as SAMPLING_ONBOARDING_ADVANCED_RIGHT_BULLET_1,d_ as SAMPLING_ONBOARDING_ADVANCED_RIGHT_BULLET_2,d$ as SAMPLING_ONBOARDING_ADVANCED_RIGHT_BULLET_3,e0 as SAMPLING_ONBOARDING_ADVANCED_RIGHT_BULLET_4,e1 as SAMPLING_ONBOARDING_ADVANCED_RIGHT_BULLET_5,e2 as SAMPLING_ONBOARDING_ADVANCED_RIGHT_TITLE,e4 as SAMPLING_ONBOARDING_ADVANCED_SUBTITLE,e3 as SAMPLING_ONBOARDING_ADVANCED_TITLE,el as SAMPLING_ONBOARDING_AMBIENT_LABEL,dr as SAMPLING_ONBOARDING_BTN_GO_TO,db as SAMPLING_ONBOARDING_BTN_NEXT,dU as SAMPLING_ONBOARDING_BTN_READ_MORE,dC as SAMPLING_ONBOARDING_BTN_SKIP,dD as SAMPLING_ONBOARDING_BTN_START,e5 as SAMPLING_ONBOARDING_COMMON_BANNER,ek as SAMPLING_ONBOARDING_COMMON_RULES_SECTION,e8 as SAMPLING_ONBOARDING_DROP_DESCRIPTION,e7 as SAMPLING_ONBOARDING_DROP_SUBTITLE,e6 as SAMPLING_ONBOARDING_DROP_TITLE,eb as SAMPLING_ONBOARDING_ERROR_PRESET_NAME,ea as SAMPLING_ONBOARDING_ERROR_PRESET_TOGGLE_LABEL,ee as SAMPLING_ONBOARDING_KEEP_DESCRIPTION,ed as SAMPLING_ONBOARDING_KEEP_SUBTITLE,ec as SAMPLING_ONBOARDING_KEEP_TITLE,ef as SAMPLING_ONBOARDING_KEEP_USE_CASE_1,eg as SAMPLING_ONBOARDING_KEEP_USE_CASE_2,eh as SAMPLING_ONBOARDING_KEEP_USE_CASE_3,ei as SAMPLING_ONBOARDING_KEEP_USE_CASE_4,ej as SAMPLING_ONBOARDING_KEEP_USE_CASE_5,di as SAMPLING_ONBOARDING_NOISY_BANNER,de as SAMPLING_ONBOARDING_NOISY_DESCRIPTION,dh as SAMPLING_ONBOARDING_NOISY_PRESET_NAME,df as SAMPLING_ONBOARDING_NOISY_PRESET_SECTION,dg as SAMPLING_ONBOARDING_NOISY_PRESET_TOGGLE_LABEL,dd as SAMPLING_ONBOARDING_NOISY_SUBTITLE,dc as SAMPLING_ONBOARDING_NOISY_TITLE,e9 as SAMPLING_ONBOARDING_PRESET_RULES_SECTION,da as SAMPLING_ONBOARDING_RECOMMENDED_BADGE,dR as SAMPLING_ONBOARDING_STRATEGY_ADVANCED_BADGE,dS as SAMPLING_ONBOARDING_STRATEGY_ADVANCED_DESC,dT as SAMPLING_ONBOARDING_STRATEGY_ADVANCED_NAME,dO as SAMPLING_ONBOARDING_STRATEGY_DROP_BADGE,dM as SAMPLING_ONBOARDING_STRATEGY_DROP_BULLET_1,dN as SAMPLING_ONBOARDING_STRATEGY_DROP_BULLET_2,dP as SAMPLING_ONBOARDING_STRATEGY_DROP_DESC,dQ as SAMPLING_ONBOARDING_STRATEGY_DROP_NAME,dJ as SAMPLING_ONBOARDING_STRATEGY_KEEP_BADGE,dH as SAMPLING_ONBOARDING_STRATEGY_KEEP_BULLET_1,dI as SAMPLING_ONBOARDING_STRATEGY_KEEP_BULLET_2,dK as SAMPLING_ONBOARDING_STRATEGY_KEEP_DESC,dL as SAMPLING_ONBOARDING_STRATEGY_KEEP_NAME,dG as SAMPLING_ONBOARDING_STRATEGY_KEEP_WARNING,dF as SAMPLING_ONBOARDING_STRATEGY_SUBTITLE,dE as SAMPLING_ONBOARDING_STRATEGY_TITLE,dn as SAMPLING_ONBOARDING_SUCCESS_BULLET_1,dp as SAMPLING_ONBOARDING_SUCCESS_BULLET_2,dq as SAMPLING_ONBOARDING_SUCCESS_BULLET_3,dm as SAMPLING_ONBOARDING_SUCCESS_INTRO,dl as SAMPLING_ONBOARDING_SUCCESS_SUBTITLE,dk as SAMPLING_ONBOARDING_SUCCESS_TITLE,dB as SAMPLING_ONBOARDING_WELCOME_BANNER,du as SAMPLING_ONBOARDING_WELCOME_INTRO,dv as SAMPLING_ONBOARDING_WELCOME_STAGE_1_DESC,dw as SAMPLING_ONBOARDING_WELCOME_STAGE_1_TITLE,dx as SAMPLING_ONBOARDING_WELCOME_STAGE_2_DESC,dy as SAMPLING_ONBOARDING_WELCOME_STAGE_2_TITLE,dz as SAMPLING_ONBOARDING_WELCOME_STAGE_3_DESC,dA as SAMPLING_ONBOARDING_WELCOME_STAGE_3_TITLE,dt as SAMPLING_ONBOARDING_WELCOME_SUBTITLE,ds as SAMPLING_ONBOARDING_WELCOME_TITLE,eW as SAMPLING_PAGE_DESCRIPTION,eX as SAMPLING_PAGE_TITLE,a1 as SCOPE_AND_LABEL,a0 as SCOPE_GROUP_ANY_OF_HINT,K as SCOPE_GROUP_LANGUAGES_TITLE,J as SCOPE_GROUP_NAMESPACES_TITLE,G as SCOPE_GROUP_SOURCES_TITLE,aj as SECTION_DURATION,ah as SECTION_ERRORS,bR as SECTION_KEEP_PERCENTAGE,an as SECTION_OPERATION,aX as SECTION_SAMPLING_PREVIEW,a2 as SECTION_SOURCE_SCOPE,er as STORAGE_KEYS,eO as TITLE_NO_RESULTS,eQ as TITLE_NO_RULES,g4 as TOKEN_ABOUT_TO_EXPIRE,aU as TOOLTIP_NOTE,U as UNKNOWN_SOURCE_LABEL,aO as UNNAMED_RULE,eR as getNoResultsSubTitle,bY as getSupportedActionOptions,bN as getSupportedLanguageIcon,bO as getSupportedLanguageLabel,g5 as isActionSupportedOnPlatform,g6 as isActionSupportedOnVersion,bg as mapActionTypesToOptions,bj as mapRuleTypesToOptions,bL as normalizeSupportedLanguagesForDisplay,g7 as supportsAllLanguages,bM as toScopeSupportedLanguages}from"./chunks/ui-components-
|
|
1
|
+
export{bA as ACTION_CATEGORIES,bm as ACTION_OPTIONS,fV as ACTION_TYPE_TO_CATEGORY,fW as ALL_LANGUAGES_WILDCARD,fX as ALL_SOURCES,cN as BTN_CANCEL,cU as BTN_CONTINUE_EDITING,eP as BTN_CREATE_FIRST_RULE,cK as BTN_CREATE_RULE,cQ as BTN_DELETE_RULE,a6 as BTN_EDIT_AUTO_RULE,cP as BTN_EDIT_RULE,d2 as BTN_SAVE,cO as BTN_SAVE_RULE,l as BUTTON_TEXTS,cR as CATEGORY_DESCRIPTIONS,aV as CATEGORY_LABELS,cT as CATEGORY_TITLES,fY as CREATE_COST_REDUCTION_AUTO_RULE_DRAWER_TITLE,fZ as CREATE_HIGHLY_RELEVANT_AUTO_RULE_DRAWER_TITLE,f_ as CREATE_NOISY_AUTO_RULE_DRAWER_TITLE,c4 as DEFAULT_CLUSTER_ID,c3 as DEFAULT_CLUSTER_NAME,eG as DEFAULT_DATA_STREAM_NAME,al as DESC_DURATION,f$ as DESC_ERRORS,ao as DESC_OPERATION,g0 as DESC_PERCENTAGE_HIGHLY_RELEVANT,bT as DESC_PERCENTAGE_NOISY,aW as DESC_RULE_TYPE,X as DESC_SOURCE_SCOPE,c0 as DESTINATION_CATEGORIES,es as DISPLAY_LANGUAGES,m as DISPLAY_TITLES,bJ as DOCS_BASE_URL,br as DestinationCategoryTypes,c_ as EDIT_COST_REDUCTION_AUTO_RULE_DRAWER_SUBTITLE,c$ as EDIT_COST_REDUCTION_AUTO_RULE_DRAWER_TITLE,cY as EDIT_HIGHLY_RELEVANT_AUTO_RULE_DRAWER_SUBTITLE,cZ as EDIT_HIGHLY_RELEVANT_AUTO_RULE_DRAWER_TITLE,d0 as EDIT_NOISY_AUTO_RULE_DRAWER_SUBTITLE,d1 as EDIT_NOISY_AUTO_RULE_DRAWER_TITLE,cS as EDIT_TITLES,aC as EMPTY_VALUE,bF as EXTRACTION_FORMAT_COPY,bD as EXTRACT_ATTRIBUTE_FORM,eN as FILTER_TYPE_ALL,b7 as FORM_ALERTS,bv as INSTRUMENTATION_RULE_OPTIONS,am as LABEL_CUSTOM_DURATION,bX as LABEL_CUSTOM_PERCENTAGE,bW as LABEL_DISABLED,cJ as LABEL_DISABLED_RULE,aM as LABEL_DROP_ALL,bQ as LABEL_DROP_AT_MOST,bV as LABEL_ENABLED,au as LABEL_HTTP_ROUTE,aw as LABEL_HTTP_ROUTE_PREFIX,az as LABEL_KAFKA_TOPIC,aN as LABEL_KEEP_ALL,aJ as LABEL_KEEP_AT_LEAST,aK as LABEL_KEEP_AT_MOST,aI as LABEL_KEEP_PERCENTAGE,ak as LABEL_KEEP_TRACES_DURATION,ai as LABEL_KEEP_TRACES_ERRORS,ay as LABEL_METHOD,aR as LABEL_NOTE,a7 as LABEL_NO_PREVIEW,aB as LABEL_OPERATION_TYPE,g1 as LABEL_RULE_DISABLED,g2 as LABEL_RULE_ENABLED,aP as LABEL_RULE_NAME,aQ as LABEL_RULE_TYPE,aL as LABEL_SAMPLE,aq as LABEL_SERVER_ADDRESS,at as LABEL_TEMPLATED_PATH,av as LABEL_TEMPLATED_PATH_PREFIX,cA as LANGUAGE_OPTIONS,aZ as MONITORS_OPTIONS,E as NOTE_ENTIRE_CLUSTER,L as NOTE_SOURCE_SCOPE_LOGIC,g3 as OPENTELEMETRY_EBPF_DISTRO_OPTION,aE as OPERATION_ALL,aD as OPERATION_HTTP_CLIENT,aA as OPERATION_HTTP_SERVER,aF as OPERATION_KAFKA_CONSUMER,aG as OPERATION_KAFKA_PRODUCER,cz as OTEL_DISTRO_NAME_OPTIONS,aH as PERCENTAGE_SECTION_DESCRIPTIONS,aT as PLACEHOLDER_NOTE,as as PLACEHOLDER_ROUTE,aS as PLACEHOLDER_RULE_NAME,_ as PLACEHOLDER_SEARCH_SOURCE,ap as PLACEHOLDER_SERVER_ADDRESS,cl as PROCESS_ATTRIBUTE_NAMES,c as REGEX_TESTER_DRAWER,bU as SAMPLING_AUTO_RULE_TITLE,eV as SAMPLING_BTN_CREATE_RULE,eT as SAMPLING_BTN_DOCS,eU as SAMPLING_BTN_REFRESH,bS as SAMPLING_COST_REDUCTION_AUTO_RULE_TITLE,cV as SAMPLING_DEFAULT_CONFIRM_DESCRIPTION,cX as SAMPLING_DEFAULT_CONFIRM_PREVIEW_LABEL,cW as SAMPLING_DEFAULT_CONFIRM_TITLE,eY as SAMPLING_DELETE_MODAL_APPROVE,eZ as SAMPLING_DELETE_MODAL_CANCEL,e_ as SAMPLING_DELETE_MODAL_DESCRIPTION,e$ as SAMPLING_DELETE_MODAL_TITLE,d3 as SAMPLING_DRAWER_WIDTH,eS as SAMPLING_DUPLICATE_RULE_WARNING,bP as SAMPLING_HIGHLY_RELEVANT_AUTO_RULE_TITLE,dV as SAMPLING_ONBOARDING_ADVANCED_LEFT_BULLET_1,dW as SAMPLING_ONBOARDING_ADVANCED_LEFT_BULLET_2,dX as SAMPLING_ONBOARDING_ADVANCED_LEFT_BULLET_3,dY as SAMPLING_ONBOARDING_ADVANCED_LEFT_TITLE,dZ as SAMPLING_ONBOARDING_ADVANCED_RIGHT_BULLET_1,d_ as SAMPLING_ONBOARDING_ADVANCED_RIGHT_BULLET_2,d$ as SAMPLING_ONBOARDING_ADVANCED_RIGHT_BULLET_3,e0 as SAMPLING_ONBOARDING_ADVANCED_RIGHT_BULLET_4,e1 as SAMPLING_ONBOARDING_ADVANCED_RIGHT_BULLET_5,e2 as SAMPLING_ONBOARDING_ADVANCED_RIGHT_TITLE,e4 as SAMPLING_ONBOARDING_ADVANCED_SUBTITLE,e3 as SAMPLING_ONBOARDING_ADVANCED_TITLE,el as SAMPLING_ONBOARDING_AMBIENT_LABEL,dr as SAMPLING_ONBOARDING_BTN_GO_TO,db as SAMPLING_ONBOARDING_BTN_NEXT,dU as SAMPLING_ONBOARDING_BTN_READ_MORE,dC as SAMPLING_ONBOARDING_BTN_SKIP,dD as SAMPLING_ONBOARDING_BTN_START,e5 as SAMPLING_ONBOARDING_COMMON_BANNER,ek as SAMPLING_ONBOARDING_COMMON_RULES_SECTION,e8 as SAMPLING_ONBOARDING_DROP_DESCRIPTION,e7 as SAMPLING_ONBOARDING_DROP_SUBTITLE,e6 as SAMPLING_ONBOARDING_DROP_TITLE,eb as SAMPLING_ONBOARDING_ERROR_PRESET_NAME,ea as SAMPLING_ONBOARDING_ERROR_PRESET_TOGGLE_LABEL,ee as SAMPLING_ONBOARDING_KEEP_DESCRIPTION,ed as SAMPLING_ONBOARDING_KEEP_SUBTITLE,ec as SAMPLING_ONBOARDING_KEEP_TITLE,ef as SAMPLING_ONBOARDING_KEEP_USE_CASE_1,eg as SAMPLING_ONBOARDING_KEEP_USE_CASE_2,eh as SAMPLING_ONBOARDING_KEEP_USE_CASE_3,ei as SAMPLING_ONBOARDING_KEEP_USE_CASE_4,ej as SAMPLING_ONBOARDING_KEEP_USE_CASE_5,di as SAMPLING_ONBOARDING_NOISY_BANNER,de as SAMPLING_ONBOARDING_NOISY_DESCRIPTION,dh as SAMPLING_ONBOARDING_NOISY_PRESET_NAME,df as SAMPLING_ONBOARDING_NOISY_PRESET_SECTION,dg as SAMPLING_ONBOARDING_NOISY_PRESET_TOGGLE_LABEL,dd as SAMPLING_ONBOARDING_NOISY_SUBTITLE,dc as SAMPLING_ONBOARDING_NOISY_TITLE,e9 as SAMPLING_ONBOARDING_PRESET_RULES_SECTION,da as SAMPLING_ONBOARDING_RECOMMENDED_BADGE,dR as SAMPLING_ONBOARDING_STRATEGY_ADVANCED_BADGE,dS as SAMPLING_ONBOARDING_STRATEGY_ADVANCED_DESC,dT as SAMPLING_ONBOARDING_STRATEGY_ADVANCED_NAME,dO as SAMPLING_ONBOARDING_STRATEGY_DROP_BADGE,dM as SAMPLING_ONBOARDING_STRATEGY_DROP_BULLET_1,dN as SAMPLING_ONBOARDING_STRATEGY_DROP_BULLET_2,dP as SAMPLING_ONBOARDING_STRATEGY_DROP_DESC,dQ as SAMPLING_ONBOARDING_STRATEGY_DROP_NAME,dJ as SAMPLING_ONBOARDING_STRATEGY_KEEP_BADGE,dH as SAMPLING_ONBOARDING_STRATEGY_KEEP_BULLET_1,dI as SAMPLING_ONBOARDING_STRATEGY_KEEP_BULLET_2,dK as SAMPLING_ONBOARDING_STRATEGY_KEEP_DESC,dL as SAMPLING_ONBOARDING_STRATEGY_KEEP_NAME,dG as SAMPLING_ONBOARDING_STRATEGY_KEEP_WARNING,dF as SAMPLING_ONBOARDING_STRATEGY_SUBTITLE,dE as SAMPLING_ONBOARDING_STRATEGY_TITLE,dn as SAMPLING_ONBOARDING_SUCCESS_BULLET_1,dp as SAMPLING_ONBOARDING_SUCCESS_BULLET_2,dq as SAMPLING_ONBOARDING_SUCCESS_BULLET_3,dm as SAMPLING_ONBOARDING_SUCCESS_INTRO,dl as SAMPLING_ONBOARDING_SUCCESS_SUBTITLE,dk as SAMPLING_ONBOARDING_SUCCESS_TITLE,dB as SAMPLING_ONBOARDING_WELCOME_BANNER,du as SAMPLING_ONBOARDING_WELCOME_INTRO,dv as SAMPLING_ONBOARDING_WELCOME_STAGE_1_DESC,dw as SAMPLING_ONBOARDING_WELCOME_STAGE_1_TITLE,dx as SAMPLING_ONBOARDING_WELCOME_STAGE_2_DESC,dy as SAMPLING_ONBOARDING_WELCOME_STAGE_2_TITLE,dz as SAMPLING_ONBOARDING_WELCOME_STAGE_3_DESC,dA as SAMPLING_ONBOARDING_WELCOME_STAGE_3_TITLE,dt as SAMPLING_ONBOARDING_WELCOME_SUBTITLE,ds as SAMPLING_ONBOARDING_WELCOME_TITLE,eW as SAMPLING_PAGE_DESCRIPTION,eX as SAMPLING_PAGE_TITLE,a1 as SCOPE_AND_LABEL,a0 as SCOPE_GROUP_ANY_OF_HINT,K as SCOPE_GROUP_LANGUAGES_TITLE,J as SCOPE_GROUP_NAMESPACES_TITLE,G as SCOPE_GROUP_SOURCES_TITLE,aj as SECTION_DURATION,ah as SECTION_ERRORS,bR as SECTION_KEEP_PERCENTAGE,an as SECTION_OPERATION,aX as SECTION_SAMPLING_PREVIEW,a2 as SECTION_SOURCE_SCOPE,er as STORAGE_KEYS,eO as TITLE_NO_RESULTS,eQ as TITLE_NO_RULES,g4 as TOKEN_ABOUT_TO_EXPIRE,aU as TOOLTIP_NOTE,U as UNKNOWN_SOURCE_LABEL,aO as UNNAMED_RULE,eR as getNoResultsSubTitle,bY as getSupportedActionOptions,bN as getSupportedLanguageIcon,bO as getSupportedLanguageLabel,g5 as isActionSupportedOnPlatform,g6 as isActionSupportedOnVersion,bg as mapActionTypesToOptions,bj as mapRuleTypesToOptions,bL as normalizeSupportedLanguagesForDisplay,g7 as supportsAllLanguages,bM as toScopeSupportedLanguages}from"./chunks/ui-components-BUMZXMZ4.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";
|
package/lib/containers.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMemo as i,useEffect as a,useState as l,Fragment as r,forwardRef as s,useImperativeHandle as c,useCallback as d,useRef as p,Children as u,createContext as h,useContext as m,useLayoutEffect as g,memo as f}from"react";import b,{useTheme as v,css as y,keyframes as C}from"styled-components";import{u as S,n as x,C as w,g as T,f as k,e as I,q as N,h as E,j as O,k as $,p as A,l as R,c as D,r as _,S as P,s as L,R as F,t as M,w as z,o as B,x as X,y as U,z as V,A as H,B as j,D as G,E as W,F as K,G as Y,H as J,I as q,J as Z}from"./chunks/helpers-
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMemo as i,useEffect as a,useState as l,Fragment as r,forwardRef as s,useImperativeHandle as c,useCallback as d,useRef as p,Children as u,createContext as h,useContext as m,useLayoutEffect as g,memo as f}from"react";import b,{useTheme as v,css as y,keyframes as C}from"styled-components";import{u as S,n as x,C as w,g as T,f as k,e as I,q as N,h as E,j as O,k as $,p as A,l as R,c as D,r as _,S as P,s as L,R as F,t as M,w as z,o as B,x as X,y as U,z as V,A as H,B as j,D as G,E as W,F as K,G as Y,H as J,I as q,J as Z}from"./chunks/helpers-BkaWRtR9.js";import{C as Q,e as ee,g as te,f as ne,h as oe,bx as ie,F as ae,by as le,bz as re,bA as se,bB as ce,bn as de,d as pe,k as ue,I as he,bC as me,o as ge,p as fe,w as be,Y as ve,bD as ye,bE as Ce,ar as Se,bF as xe,bG as we,B as Te,i as ke,j as Ie,x as Ne,a4 as Ee,bo as Oe,b0 as $e,bH as Ae,bI as Re,u as De,N as _e,S as Pe,bJ as Le,bt as Fe,bu as Me,bs as ze,bK as Be,af as Xe,T as Ue,ad as Ve,ae as He,ab as je,aa as Ge,ac as We,a9 as Ke,b7 as Ye,a8 as Je,bL as qe,bM as Ze,bN as Qe,bO as et,W as tt,m as nt,bb as ot,bP as it,bQ as at,bR as lt,bS as rt,bT as st,bU as ct,bV as dt,bW as pt,Q as ut,bX as ht,bY as mt,bZ as gt,a$ as ft,br as bt,s as vt,b_ as yt,b$ as Ct,b1 as St,c0 as xt,c1 as wt,aY as Tt,v as kt,bv as It,ba as Nt,q as Et,c2 as Ot,bc as $t,c3 as At,c4 as Rt,be as Dt,c5 as _t,b3 as Pt,c6 as Lt,l as Ft,y as Mt,D as zt,c7 as Bt,ag as Xt,c8 as Ut,c9 as Vt,n as Ht,bh as jt,bm as Gt,z as Wt,ca as Kt,cb as Yt,bl as Jt,cc as qt,a3 as Zt,cd as Qt,ce as en,b6 as tn,H as nn,cf as on,cg as an,ch as ln,ci as rn,cj as sn,ck as cn,cl as dn,cm as pn,O as un,cn as hn,co as mn,A as gn,b2 as fn,a_ as bn,cp as vn,cq as yn,cr as Cn,cs as Sn,ct as xn,cu as wn,bw as Tn,cv as kn,cw as In,cx as Nn,cy as En,cz as On,b as $n,cA as An,cB as Rn,M as Dn,cC as _n,cD as Pn,cE as Ln,cF as Fn,cG as Mn,cH as zn,cI as Bn,cJ as Xn,cK as Un,cL as Vn,cM as Hn,cN as jn,cO as Gn,cP as Wn,cQ as Kn,cR as Yn,cS as Jn,aO as qn,cT as Zn,cU as Qn,cV as eo,cW as to,cX as no,cY as oo,cZ as io,c_ as ao,c$ as lo,d0 as ro,d1 as so,d2 as co,d3 as po,d4 as uo,d5 as ho,ax as mo,d6 as go,d7 as fo,b4 as bo,d8 as vo,d9 as yo,da as Co,db as So,dc as xo,dd as wo,de as To,df as ko,dg as Io,dh as No,di as Eo,dj as Oo,dk as $o,dl as Ao,dm as Ro,dn as Do,dp as _o,dq as Po,dr as Lo,ds as Fo,dt as Mo,du as zo,dv as Bo,dw as Xo,dx as Uo,dy as Vo,dz as Ho,dA as jo,dB as Go,dC as Wo,dD as Ko,dE as Yo,dF as Jo,dG as qo,dH as Zo,dI as Qo,dJ as ei,dK as ti,dL as ni,dM as oi,dN as ii,dO as ai,dP as li,dQ as ri,dR as si,dS as ci,dT as di,dU as pi,dV as ui,dW as hi,dX as mi,dY as gi,dZ as fi,d_ as bi,d$ as vi,e0 as yi,e1 as Ci,e2 as Si,e3 as xi,e4 as wi,e5 as Ti,e6 as ki,e7 as Ii,e8 as Ni,e9 as Ei,ea as Oi,eb as $i,ec as Ai,ed as Ri,ee as Di,ef as _i,eg as Pi,eh as Li,ei as Fi,ej as Mi,ek as zi,el as Bi,P as Xi,em as Ui,en as Vi,eo as Hi,ep as ji,eq as Gi,er as Wi,es as Ki,aZ as Yi,et as Ji,$ as qi,eu as Zi,ev as Qi,ew as ea,ex as ta,ey as na,ez as oa,eA as ia,eB as aa,eC as la,eD as ra,eE as sa,eF as ca,bd as da,eG as pa,R as ua,a as ha,eH as ma,eI as ga,eJ as fa,eK as ba,eL as va,eM as ya,eN as Ca,eO as Sa,eP as xa,eQ as wa,eR as Ta,eS as ka,eT as Ia,eU as Na,eV as Ea,eW as Oa,eX as $a,eY as Aa,eZ as Ra,e_ as Da,e$ as _a,f0 as Pa}from"./chunks/ui-components-BUMZXMZ4.js";import{ChevronRightIcon as La,ActionIcon as Fa,TrashIcon as Ma,PlusIcon as za,ArrowRightIcon as Ba,VSquareIcon as Xa,XSquareIcon as Ua,BookIcon as Va,DeleteIcon as Ha,EditIcon as ja,GoLogo as Ga,JavaLogo as Wa,PhpLogo as Ka,DestinationIcon as Ya,ChevronUpIcon as Ja,ChevronDownIcon as qa,VIcon as Za,XIcon as Qa,InstrumentationRuleIcon as el,SourceIcon as tl,NamespacesIcon as nl,AzureIcon as ol,GoogleCloudPlatformLogo as il,AwsLogo as al,CloudConnectorIcon as ll,EyeOpenIcon as rl,OdigosLogo as sl,ArrowLeftIcon as cl,ISquareIcon as dl,RefreshIcon as pl,SettingsIcon as ul,PodIcon as hl,K8sLogo as ml,ExclamationCircleIcon as gl,QuestionCircleIcon as fl,InboundIcon as bl,OutboundIcon as vl,UserIcon as yl,TerminalIcon as Cl,RefreshLeftArrowIcon as Sl,MinusIcon as xl,SearchIcon as wl,ExpandIcon as Tl,CopyIcon as kl,DotIcon as Il,ArrowDownIcon as Nl,DownloadIcon as El,SamplingIcon as Ol,ExclamationTriangleIcon as $l,KeyIcon as Al,DiagnoseIcon as Rl,StarIcon as Dl,ArrowIcon as _l,ConnectionsIcon as Pl,FilterIcon as Ll,DataStreamIcon as Fl,PipelineCollectorIcon as Ml,ArrowDownSquareIcon as zl,ArrowUpSquareIcon as Bl,GatewayIcon as Xl,YamlIcon as Ul,ImageErrorIcon as Vl,LockIcon as Hl}from"./icons.js";import{h as jl,o as Gl,n as Wl,q as Kl,m as Yl,t as Jl,s as ql,S as Zl,w as Ql,E as er,x as tr,y as nr,v as or,l as ir,d as ar,O as lr,f as rr,b as sr,A as cr,R as dr,C as pr,e as ur,D as hr}from"./chunks/source-instrument-form-context-B40tRNcP.js";import{n as mr,f as gr,k as fr,I as br,l as vr,A as yr,i as Cr,P as Sr,S as xr,R as wr,g as Tr,j as kr,c as Ir,h as Nr,m as Er,W as Or,C as $r,b as Ar,Y as Rr,O as Dr,a as _r,U as Pr,e as Lr}from"./chunks/index-D3cEk2g_.js";import{createPortal as Fr}from"react-dom";import{MarkerType as Mr,useNodesState as zr,useEdgesState as Br,Handle as Xr,Position as Ur,getSmoothStepPath as Vr,BaseEdge as Hr,EdgeLabelRenderer as jr,ReactFlowProvider as Gr,ReactFlow as Wr,Background as Kr,Controls as Yr,ControlButton as Jr,useReactFlow as qr}from"@xyflow/react";import Zr from"elkjs/lib/elk.bundled.js";import"@xyflow/react/dist/style.css";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";import"@apollo/client/react";import"@apollo/client/link/error";import"@apollo/client/link/context";import"@apollo/client/utilities";import"@apollo/client/errors";import"@apollo/client";const Qr=b.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
justify-content: space-between;
|
|
@@ -119,7 +119,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
119
119
|
justify-content: flex-end;
|
|
120
120
|
align-items: center;
|
|
121
121
|
min-width: 0;
|
|
122
|
-
`,xc=({clusterId:n,namespaceName:o,checkbox:i,isFutureApps:a,selectedCounts:l,isActive:r,onActive:s,handleSourceChange:c})=>{const{capabilities:d}=Gl(),p=d.canInstrumentNamespaces,u=e=>{s(),c({clusterId:n,workloadId:{namespace:o},auto:e.auto,selected:e.all})};return t(vc,{children:t(is,{dataId:`namespace-${o}`,withCarret:!0,title:o,isSelected:r,onClick:s,isPartiallyChecked:i.partial,isChecked:i.all,onCheckboxChange:e=>u({auto:e,all:e}),children:e(yc,{$withAuto:p,children:[p&&t(Cc,{$visible:r||a,children:t(Ue,{text:"Automatically instrument all workloads currently in the namespace, and all workloads that will be deployed to this namespace in the future",children:t(ge,{label:"Auto",labelAlign:fe.Left,size:Et.S,value:a,onChange:e=>u({auto:e,all:e||void 0})})})}),e(Sc,{children:[t(ee,{variant:Ot.Span,size:te.XXXS,color:ne.Secondary,align:"right",nowrap:!0,children:mc}),t(ce,{label:`${l.sourced}/${l.total}`,status:r?Pe.Default:Pe.Unknown,minWidth:"42px"})]})]})})})},wc=({withCollapse:e,clusterId:n,clusterName:o,namespaces:a,selectedArea:l,setSelectedArea:r,handleSourceChange:s})=>{const c=i(()=>a.map(({name:e,totalWorkloads:i,selectedCount:a,isAllSourced:c,isSomeSourced:d,isFutureApps:p})=>t(xc,{clusterId:n,namespaceName:e,isFutureApps:p,checkbox:{all:c||p,partial:d},selectedCounts:{sourced:a,total:i},isActive:l.clusterId===n&&l.namespaceName===e,onActive:()=>r({clusterId:n,clusterName:o,namespaceName:e}),handleSourceChange:s},`${n}#${e}`)),[n,o,a,l]);return e?t(tc,{title:o,list:c,noBgColor:!0}):c},Tc=({onClose:n,onBack:o,onNext:r,selectedConnectionIds:s,setSelectedConnectionIds:c,withOverlay:d,disableAnimation:p})=>{const{isK8s:u}=S(),{sourcesApi:h,snapshotsApi:m,namespacesApi:g}=Gl(),{data:f,loading:b,refetch:
|
|
122
|
+
`,xc=({clusterId:n,namespaceName:o,checkbox:i,isFutureApps:a,selectedCounts:l,isActive:r,onActive:s,handleSourceChange:c})=>{const{capabilities:d}=Gl(),p=d.canInstrumentNamespaces,u=e=>{s(),c({clusterId:n,workloadId:{namespace:o},auto:e.auto,selected:e.all})};return t(vc,{children:t(is,{dataId:`namespace-${o}`,withCarret:!0,title:o,isSelected:r,onClick:s,isPartiallyChecked:i.partial,isChecked:i.all,onCheckboxChange:e=>u({auto:e,all:e}),children:e(yc,{$withAuto:p,children:[p&&t(Cc,{$visible:r||a,children:t(Ue,{text:"Automatically instrument all workloads currently in the namespace, and all workloads that will be deployed to this namespace in the future",children:t(ge,{label:"Auto",labelAlign:fe.Left,size:Et.S,value:a,onChange:e=>u({auto:e,all:e||void 0})})})}),e(Sc,{children:[t(ee,{variant:Ot.Span,size:te.XXXS,color:ne.Secondary,align:"right",nowrap:!0,children:mc}),t(ce,{label:`${l.sourced}/${l.total}`,status:r?Pe.Default:Pe.Unknown,minWidth:"42px"})]})]})})})},wc=({withCollapse:e,clusterId:n,clusterName:o,namespaces:a,selectedArea:l,setSelectedArea:r,handleSourceChange:s})=>{const c=i(()=>a.map(({name:e,totalWorkloads:i,selectedCount:a,isAllSourced:c,isSomeSourced:d,isFutureApps:p})=>t(xc,{clusterId:n,namespaceName:e,isFutureApps:p,checkbox:{all:c||p,partial:d},selectedCounts:{sourced:a,total:i},isActive:l.clusterId===n&&l.namespaceName===e,onActive:()=>r({clusterId:n,clusterName:o,namespaceName:e}),handleSourceChange:s},`${n}#${e}`)),[n,o,a,l]);return e?t(tc,{title:o,list:c,noBgColor:!0}):c},Tc=({onClose:n,onBack:o,onNext:r,selectedConnectionIds:s,setSelectedConnectionIds:c,withOverlay:d,disableAnimation:p})=>{const{isK8s:u}=S(),{sourcesApi:h,snapshotsApi:m,namespacesApi:g}=Gl(),{data:f,loading:b,pending:v,refetch:y}=m.useSnapshots(),{items:C,loading:x}=g.useNamespaces({skip:v||!!f}),w=pc(!u),{selectedStreamName:T}=ot(),{progress:k,resetProgress:I}=$t(),{isFetching:N,setIsFetching:E,setSnapshots:O,formData:$,handleSourceChange:A,handleSelectAll:R,formDiff:D,isFormDirty:_}=or();a(()=>{y()},[]);const P=i(()=>{if(f)return f;const e=C;return e.length?{clusters:[{clusterId:Rt,clusterName:At,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,region:e.id.region,selected:(e.markedForInstrumentation?.markedForInstrumentation??!1)&&(e.dataStreamNames?.includes(T)??!1)}))||[]}))}]}:null},[f,C,T]);a(()=>{E(b||x),P&&O(P)},[P,b,x,E,O]);const[L,F]=l(""),[M,z]=l(Nt.Namespace),[B,X]=l({showOnlySelected:!1}),[U,V]=l({clusterId:"",clusterName:"",namespaceName:""}),H=(({isFetching:n,formData:o,handleSourceChange:a,handleSelectAll:l,selectedArea:r,setSelectedArea:s,searchText:c,searchBy:d,filters:p})=>{const{isK8s:u}=S(),h=pc(!u),m=i(()=>o.map(e=>{const t=[...e.namespaces].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>tr(e,c,p)).map(e=>({name:e.name,totalWorkloads:e.workloads.length,...nr(e)}));return{clusterId:e.clusterId,clusterName:e.clusterName,visibleNamespaces:t}}),[o,c,p]),g=i(()=>{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:y}=i(()=>{const e=m.map(({clusterId:e,clusterName:n,visibleNamespaces:o})=>o.length?t(wc,{withCollapse:m.length>1,clusterId:e,clusterName:n,namespaces:o,selectedArea:r,setSelectedArea:s,handleSourceChange:a},e):null).filter(e=>null!==e),n=m.reduce((e,{visibleNamespaces:t})=>e+t.length,0),i=o.reduce((e,{namespaces:t})=>e+t.length,0);return{list:e,withFilterCount:n!==i,filteredCount:n,totalCount:i}},[m,o,r]);return{width:"60%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(ee,{size:te.XS,nowrap:!0,children:h.groupColumnHeader}),t(Ue,{text:b?nt.FILTERED_COUNT_TOOLTIP:void 0,children:t(ce,{label:`${b?`${v} / ${y}`:y}`,status:Pe.Unknown})})]}),t(ee,{"data-id":"namespaces-select-all",onClick:()=>l({boolean:!g,searchText:c,searchBy:d,filters:p}),disabled:!f.length,size:te.XS,children:hc(g)})]}),list:f.length?f:n?[t(ft,{$height:"100%",children:t(St,{title:h.fetchingGroups.title,subTitle:h.fetchingGroups.subTitle,withSpinner:!0})},"loading")]:[t(ft,{$height:"100%",children:t($e,c?{icon:nl,title:uc,subTitle:h.noGroupMatchedFilter(c)}:{icon:nl,title:h.noGroups.title,subTitle:h.noGroups.subTitle})},"no-data")]}})({isFetching:N,formData:$,handleSourceChange:A,handleSelectAll:R,selectedArea:U,setSelectedArea:V,searchText:M===Nt.Namespace?L:"",searchBy:M,filters:B}),j=(({formData:n,handleSourceChange:o,handleSelectAll:a,selectedArea:l,searchText:r,searchBy:s,filters:c})=>{const{isK8s:d,isEnterprise:p}=S(),u=pc(!d),h=i(()=>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]),m=i(()=>h?[...h.workloads].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Ql(e,r,c)):[],[h,r,c]),g=i(()=>!!m.length&&m.every(({selected:e})=>e),[m]),f=i(()=>{if(!h)return[];const{clusterId:e}=l.value,{name:n}=h;return m.map(({name:i,selected:a,kind:l,region:r})=>{const s=d&&!p&&er.has(l);return t(bc,{workloadName:i,workloadKind:l,isChecked:!s&&(a||!1),onToggle:()=>o({clusterId:e,workloadId:{namespace:n,name:i,kind:l,region:r}}),disabled:s},`${e}#${n}#${i}#${l}#${r??""}`)})},[m,h,l.value.clusterId,o,d,p]),{withFilterCount:b,filteredCount:v,totalCount:y}=i(()=>{const e=h?.workloads.length??0;return{withFilterCount:m.length!==e,filteredCount:m.length,totalCount:e}},[m,h]);return{width:"40%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(ee,{size:te.XS,nowrap:!0,children:l.value.namespaceName?`${l.value.namespaceName} > ${u.itemColumnHeader}`:u.itemColumnHeader}),t(Ue,{text:b?nt.FILTERED_COUNT_TOOLTIP:void 0,children:t(ce,{label:`${b?`${v} / ${y}`:y}`,status:Pe.Unknown})})]}),t(ee,{"data-id":"workloads-select-all",onClick:()=>a({clusterId:l.value.clusterId,namespaceName:l.value.namespaceName,boolean:!g,searchText:r,searchBy:s,filters:c}),disabled:!f.length,size:te.XS,children:hc(g)})]}),list:f.length?f:[t(ft,{$height:"100%",children:t($e,h?r?{icon:tl,title:uc,subTitle:(C=r,`No sources matched the filter '${C}'`)}:{icon:tl,title:"No sources",subTitle:u.noItemsInGroupSubTitle}:{icon:tl,title:u.selectGroupPrompt.title,subTitle:u.selectGroupPrompt.subTitle})},"no-data")]};var C})({formData:$,handleSourceChange:A,handleSelectAll:R,selectedArea:{value:U},searchText:M===Nt.Source?L:"",searchBy:M,filters:B});return t(Er,{isOpen:!0,withOverlay:d,disableAnimation:p,onClose:n?()=>{I(Dt.BulkInstrumenting),n()}:void 0,onBack:o?()=>o(D):void 0,onNext:r?()=>r(D):void 0,nextIsSkip:!_,onSave:()=>h.persistV2(D),header:{icon:tl,title:nt.ADD_SOURCE,subTitle:nt.ADD_SOURCES_DESCRIPTION},connectionIds:s&&c?{value:s,setValue:c}:void 0,search:{value:L,onChange:e=>{F(e),M===Nt.Namespace&&V({clusterId:"",clusterName:"",namespaceName:""})},placeholder:w.searchPlaceholder(M),segment:{options:[{label:w.groupSegmentLabel,value:Nt.Namespace},{label:w.itemSegmentLabel,value:Nt.Source}],selected:M,setSelected:z}},filters:e(oe,{$gap:8,children:[t(ee,{size:te.XXXS,color:ne.Secondary,nowrap:!0,children:"Show only:"}),t(ge,{name:"filter-selected",size:Et.S,label:mc,value:B.showOnlySelected,onChange:e=>X(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:_,isFetching:N,progress:{title:nt.CREATING_SOURCES,subTitle:nt.CREATING_SOURCES_SUBTITLE,percentage:k[Dt.BulkInstrumenting]?.percentage||0},leftColumn:H,rightColumn:j})},kc={aws:al,gcp:il,azure:ol},Ic={lambda:"Lambda","fargate-task":"ECS","fargate-cluster":"ECS","ecs-cluster":"ECS",eks:"EKS",ec2:"EC2"},Nc=e=>e.split(/[-_]/).map(e=>e?e[0].toUpperCase()+e.slice(1):e).join(" "),Ec=e=>e.provider.toUpperCase(),Oc=b.div`
|
|
123
123
|
display: flex;
|
|
124
124
|
flex-direction: column;
|
|
125
125
|
gap: 8px;
|
|
@@ -577,7 +577,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
577
577
|
padding: 8px 12px;
|
|
578
578
|
border-radius: 8px;
|
|
579
579
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
580
|
-
`,Dp=({language:n,containerName:o,otelDistroName:a,runningStartedTime:l,started:r,ready:s,restartCount:c,isCrashLoop:d,waitingReasonEnum:p,waitingMessage:u,odigosHealthStatus:h,k8sHealthStatus:m,processes:g,jumpToTarget:f})=>{const b=!!f,v=b&&!f?.processPid,{formatDurationAgo:y}=an(),C=ln(v),S=i(()=>({title:o,icon:n?un(n):fl,iconWithWrapper:!0}),[o,n]),x=i(()=>{const e=[],t=rn({status:a?sn.Success:sn.Disabled,reasonEnum:a?nt.INSTRUMENTED_WITH_DISTRO(a):nt.UNINSTRUMENTED,message:""});t&&e.push(t);const n=rn(h,sl,"health");n&&e.push(n);const o=rn(m,ml,"health");return o&&e.push(o),e},[m,h,a]),w=i(()=>[{id:"runningTime",title:nt.RUNNING_TIME,label:l?y(l,{style:"short"}):nt.NOT_RUNNING,labelTooltip:`${nt.RUNNING_TIME_TOOLTIP}. (${l})`},{id:"blank",spacer:!0},{id:"started",badge:{status:r?Pe.Success:Pe.Disabled,leftIcon:r?Xa:Ua,label:r?nt.STARTED:nt.NOT_STARTED,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"ready",badge:{status:s?Pe.Success:Pe.Disabled,leftIcon:s?Xa:Ua,label:s?nt.READY:nt.NOT_READY,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}}
|
|
580
|
+
`,Dp=({language:n,containerName:o,otelDistroName:a,runningStartedTime:l,started:r,ready:s,restartCount:c,isCrashLoop:d,waitingReasonEnum:p,waitingMessage:u,odigosHealthStatus:h,k8sHealthStatus:m,processes:g,jumpToTarget:f})=>{const b=!!f,v=b&&!f?.processPid,{formatDurationAgo:y}=an(),C=ln(v),S=i(()=>({title:o,icon:n?un(n):fl,iconWithWrapper:!0}),[o,n]),x=i(()=>{const e=[],t=rn({status:a?sn.Success:sn.Disabled,reasonEnum:a?nt.INSTRUMENTED_WITH_DISTRO(a):nt.UNINSTRUMENTED,message:""});t&&e.push(t);const n=rn(h,sl,"health");n&&e.push(n);const o=rn(m,ml,"health");return o&&e.push(o),e},[m,h,a]),w=i(()=>{const e=[{id:"runningTime",title:nt.RUNNING_TIME,label:l?y(l,{style:"short"}):nt.NOT_RUNNING,labelTooltip:`${nt.RUNNING_TIME_TOOLTIP}. (${l})`},{id:"blank",spacer:!0},{id:"started",badge:{status:r?Pe.Success:Pe.Disabled,leftIcon:r?Xa:Ua,label:r?nt.STARTED:nt.NOT_STARTED,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"ready",badge:{status:s?Pe.Success:Pe.Disabled,leftIcon:s?Xa:Ua,label:s?nt.READY:nt.NOT_READY,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}}];return d&&e.push({id:"isCrashLoop",badge:{status:Pe.Error,leftIcon:Ua,label:nt.CRASHLOOP,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}}),e.push({id:"restartCount",title:nt.RESTARTS,badge:{status:c?Pe.Error:void 0,label:c||0,textSize:te.XXXS}}),e},[l,y,r,s,d,c]),T=i(()=>u?Xt(p):"",[u,p]);return t("div",{ref:C,children:e(Wt,{bgTint:"750",richTitle:S,badges:x,items:w,withCollapse:!0,collapseIsDefaultOpen:b,children:[u&&t(Rp,{children:e(oe,{$gap:10,$alignItems:"center",children:[t(nn,{variant:hn.Pink,leftIcon:ml,label:T}),t(ee,{size:te.XXXS,color:ne.Error,children:u})]})}),(g??[]).map((e,n)=>{const i=n+1,a=b&&(l=f,r=e,!!l?.processPid&&Sp({identifyingAttributes:r.identifyingAttributes})===l.processPid);var l,r;return t(wp,{...e,overrideProcessNum:i,isJumpToTarget:a},`pod-container-${o}-process-${i}`)})]})})},_p=({podName:e,namespace:n,hasRestarted:o})=>{const a=i(()=>({title:nt.DEBUG_COMMANDS,titleSize:te.XS}),[]),l=i(()=>[{label:nt.GET_POD_YAML,value:`kubectl get pod ${e} -n ${n} -o yaml`},{label:nt.DESCRIBE_POD,value:`kubectl describe pod ${e} -n ${n}`},{label:nt.GET_POD_LOGS,value:`kubectl logs ${e} -n ${n}${o?" -p":""}`}],[e,n,o]);return t(Wt,{bgTint:"800",richTitle:a,withCollapse:!0,children:l.map(({label:e,value:n})=>t(mn,{bgTint:"700",label:e,value:n},e))})},Pp=({source:o,onClickRestartPod:a})=>{const{jumpToTarget:l}=(()=>{const e=m(Op);if(!e)throw new Error("useJumpToTargetContext must be used within a JumpToTargetContextProvider");return e})(),r=l?.tab===gp.Pods?l:null,s=o?.pods??[],c=s.length>0,d=i(()=>s.some(e=>e.containers?.some(e=>e.restartCount&&e.restartCount>0)),[s]),p=i(()=>({title:nt.PODS,badge:{label:s.length}}),[s.length]);return t(ae,{$gap:12,children:c?e(n,{children:[t(vp,{podsOdigosHealthStatus:o.podsOdigosHealthStatus,pods:s}),t(Wt,{bgTint:"1000",richTitle:p,children:s.map(n=>{const i=r?.podName===n.podName,l=i&&!r?.containerName;return e(fp,{...n,namespace:o.id.namespace,onClickRestartPod:a,collapseIsDefaultOpen:i,isJumpToTarget:l,children:[t(_p,{podName:n.podName,namespace:o.id.namespace,hasRestarted:d}),t(Ap,{podContainers:n.containers,sourceContainers:o.containers,jumpToTarget:i?r:null})]},`pod-${n.podName}`)})})]}):t(ft,{$height:"70vh",children:t($e,{title:nt.NO_RUNNING_PODS,subTitle:nt.NO_RUNNING_PODS_SUBTITLE})})})},Lp="user",Fp=({source:n})=>{const o=i(()=>n.serviceName||n.id.name,[n]),{sourcesApi:a}=Gl(),{data:l,loading:r,refetch:s}=a.usePeerSources({serviceName:o},{fetchPolicy:"network-only"}),c=l?.peerSources??null;return!c||r?t(ft,r?{$height:"70vh",children:t(St,{withSpinner:!0})}:{$height:"70vh",children:t($e,{subTitle:nt.COULD_NOT_FETCH_PEER_SOURCES})}):e(oe,{$gap:16,$alignItems:"flex-start",children:[t(Mp,{icon:bl,title:nt.INBOUND,subTitle:nt.INBOUND_DESCRIPTION(o),onRefresh:s,items:c?.inbound??[]}),t(Mp,{icon:vl,title:nt.OUTBOUND,subTitle:nt.OUTBOUND_DESCRIPTION(o),onRefresh:s,items:c?.outbound??[]})]})},Mp=({icon:n,title:o,subTitle:a,onRefresh:r,items:s})=>{const[c,d]=l(""),p=i(()=>s.filter(e=>e.serviceName.toLowerCase().includes(c.toLowerCase())),[s,c]);return e(Wt,{bgTint:"1000",richTitle:{icon:n,title:o,titleSize:te.XS,subTitle:a,subTitleSize:te.XXXS,badge:{label:s.length}},actions:[{id:"refresh",type:gn.Button,buttonProps:{variant:Ie.Secondary,size:ke.S,leftIcon:pl,onClick:r}}],children:[t(fn,{value:c,onChange:d,width:"100%"}),t(bn,{height:"calc(100vh - 284px)",gap:4,elements:p.length||c?!p.length&&c?[t(ft,{$height:"50vh",children:t($e,{icon:n,title:nt.NO_RESULTS,subTitle:nt.NO_RESULTS_FOR_FILTER(c)})},"no-results")]:p.map(e=>t(Bp,{...e},`${o}-${e.serviceName}`)):[t(ft,{$height:"50vh",children:t($e,{icon:n,title:`No ${o} connections yet`,subTitle:o===nt.INBOUND?nt.NO_INBOUND_CONNECTIONS_DESCRIPTION:nt.NO_OUTBOUND_CONNECTIONS_DESCRIPTION})},"no-data")]})]})},zp=b.div`
|
|
581
581
|
display: flex;
|
|
582
582
|
align-items: center;
|
|
583
583
|
justify-content: space-between;
|
|
@@ -973,7 +973,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
973
973
|
white-space: pre-line;
|
|
974
974
|
`,tg=b.div`
|
|
975
975
|
width: fit-content;
|
|
976
|
-
`,ng=["50","25","10","1","0.1"],og=({value:n,onChange:o,label:a})=>{const l=v(),r=i(()=>ng.map(e=>({value:e,label:`${e}%`,selectedBgColor:l.v2.colors.purple[900],selectedBorderColor:l.v2.colors.purple[400]})),[l]);return e(ae,{$gap:8,children:[t(ee,{size:te.XS,color:l.v2.colors.white[500],children:a}),t(tg,{children:t(ve,{"data-id":"sampling-onboarding-ambient",options:r,selected:n,setSelected:o})})]})},ig=({errorPresetEnabled:o,onErrorPresetChange:a,ambientPercentage:l,onAmbientPercentageChange:r,onBack:s,onNext:c,submitting:d})=>{const p=v(),u=i(()=>R(o?{disabled:!1}:null),[o]);return e(n,{children:[t(xm,{title:Ai,onBack:s}),e(vm,{$width:854,children:[t(Dm,{children:Ri}),e(ae,{$gap:8,$width:"100%",children:[e(Tm,{children:[t(eg,{children:t(ee,{size:te.XXS,color:p.v2.colors.silver[200],children:Di})}),t(Nm,{items:[_i,Pi,Li,Fi,Mi]}),t(Om,{message:Ti})]}),e($m,{children:[e(Am,{children:[t(ee,{size:te.S,weight:500,color:p.v2.colors.white[500],children:zi}),t(fl,{size:16,fill:p.v2.colors.silver[200]})]}),t(Rm,{children:t(mm,{name:$i,recommended:!0,toggleLabel:Oi,enabled:o,onEnabledChange:a,summary:u,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(Rm,{children:t(og,{value:l,onChange:r,label:Bi})})]})]})]}),t(Cm,{onNext:c,nextLoading:d})]})},ag=({isOpen:e,onClose:n,k8sHealthProbesConfig:o,samplingId:i,docsUrl:r})=>{const{samplingApi:s}=Gl(),[c,p]=l("welcome"),[u,h]=l(!0),[m,g]=l("keep-list"),[f,b]=l(!0),[v,y]=l("25"),[C,S]=l(!1);a(()=>{e&&(p("welcome"),h(o?.enabled??!0),g("keep-list"),b(!0),y("25"),S(!1))},[e,o?.enabled]);const x=d(async()=>{const e=i??"default",t=[];if(u!==(o?.enabled??!1)){const e=s.updateK8sHealthProbesConfig;e&&t.push(e({enabled:u,keepPercentage:o?.keepPercentage??0}))}if("advanced"!==m&&f){const n=s.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=s.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),p("success")}catch{}finally{S(!1)}},[i,s,u,o?.enabled,o?.keepPercentage,m,f,v]);let w=null;switch(c){case"welcome":w=t(Bm,{onSkip:n,onNext:()=>p("noisy")});break;case"noisy":w=t(Pm,{enabled:u,onEnabledChange:h,onBack:()=>p("welcome"),onNext:()=>p("strategy")});break;case"strategy":w=t(Jm,{strategy:m,onStrategyChange:g,onBack:()=>p("noisy"),onNext:()=>{p("keep-list"===m?"keep-list":"drop-list"===m?"drop-list":"advanced")},docsUrl:r});break;case"keep-list":w=t(ig,{errorPresetEnabled:f,onErrorPresetChange:b,ambientPercentage:v,onAmbientPercentageChange:y,onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"drop-list":w=t(Qm,{errorPresetEnabled:f,onErrorPresetChange:b,onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"advanced":w=t(qm,{onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"success":w=t(Fm,{onClose:n})}return t(vo,{isOpen:e,onClose:n,children:w})};var lg,rg;(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"})(lg||(lg={})),(e=>{e.K8s="k8s",e.VmAgent="vm-agent",e.CloudConnector="cloud-connector",e.AwsEcsAgent="aws-ecs-agent"})(rg||(rg={}));const sg=[{id:rg.CloudConnector,label:"Cloud Connector"}];var cg;(e=>{e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"})(cg||(cg={}));const dg=[{key:cg.Name,label:"Name"},{key:cg.Type,label:"Type"},{key:cg.Status,label:"Status"},{key:cg.OdigosVersion,label:"Odigos Version"},{key:cg.ConnectedSince,label:"Connected Since"},{key:cg.LastActivity,label:"Last Activity"}],pg=(e,t)=>{const n=e.find(e=>e.key===cg.Id)?.rawValue;return t(n?.toString()||"")},ug={[Pe.Success]:"Connected",[Pe.Warning]:"Degraded",[Pe.Error]:"Error",[Pe.Disabled]:"Disabled",[Pe.Info]:"Pending"},hg={[Xi.K8s]:hn.Purple,[Xi.Vm]:hn.Blue,[Xi.Connector]:hn.Green,[Xi.AwsEcs]:hn.Yellow},mg=({connections:n,getConnections:o,onClickConnection:r,deleteConnection:s,onCreateNew:c,cloudConnectorProviders:p,onCreateCloudConnector:u,configMinSupportedVersion:h=0,snapshotMinSupportedVersion:m=0})=>{const g=v(),{formatTimeAgo:f}=an(),{capabilities:b}=Gl(),[y,C]=l(!1),[S,x]=l(n||[]),w=d(async()=>{try{C(!0),x(await o()??[])}catch(e){}finally{C(!1)}},[]);a(()=>{S.length||w()},[]);const[T,k]=l(""),[I,N]=l(null),[E,O]=l([]),[$,A]=l(!1),[R,P]=l(!1),L=d(()=>{A(!1),P(!0),w()},[w]),F=d(e=>{e===rg.CloudConnector?A(!0):c?.(e)},[c]),M=i(()=>I===lg.BulkConfig?h:I===lg.BulkSource?m:0,[I,h,m]),{supportedConnections:z,supportedConnectionIds:B}=i(()=>{const e=((e,t)=>e.filter(e=>{const n=e.status===Pe.Success,o=D(e.odigosVersion,t,e.type);return n&&o}))(S,M);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[S,M]);a(()=>{if(!I||I===lg.Delete)return;const e=E.filter(e=>!B.includes(e));e.length&&O(t=>t.filter(t=>!e.includes(t)))},[I,E.length,B.length]);const X=i(()=>S.filter(e=>!T||e.name.toLowerCase().includes(T.toLowerCase())).map(e=>({cells:[{key:cg.Id,rawValue:e.id},{key:cg.Name,rawValue:e.name},{key:cg.Type,rawValue:e.type,component:()=>t(nn,{variant:hg[e.type]??hn.Default,label:Ui(e.type),leftIcon:Vn(e.type)})},{key:cg.Status,rawValue:e.status,component:()=>(e=>{if(e.type===Xi.Connector){const n=ug[e.status]??"Pending",o=e.status===Pe.Success?Za:e.status===Pe.Error?Qa:void 0;return t(ce,{status:e.status,label:n,leftIcon:o})}const n=e.status===Pe.Success?"Connection live":"Connection lost",o=e.status===Pe.Success?Za:Qa;return t(ce,{status:e.status,label:n,leftIcon:o})})(e)},{key:cg.OdigosVersion,rawValue:e.odigosVersion},{key:cg.ConnectedSince,rawValue:e.connectedAt?f(e.connectedAt):"-"},{key:cg.LastActivity,rawValue:e.lastSeenAt?f(e.lastSeenAt):"-"}],onClick:e.status!==Pe.Success||I?void 0:()=>r(e),isSelected:E.includes(e.id),onSelect:()=>O(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>O(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==Pe.Success||I===lg.BulkConfig&&!D(e.odigosVersion,h,e.type)||I===lg.BulkSource&&!D(e.odigosVersion,m,e.type)})),[S,E,T,I,h,m,f,r]),U=i(()=>S.length>0&&S.every(e=>e.type===Xi.K8s),[S]),V=i(()=>{const e=(e,t)=>{O([e]),N(t)};return(e=>{const{connections:t,configMinSupportedVersion:n,snapshotMinSupportedVersion:o,onDelete:i,onAddSource:a,onAddDestination:l,onAddAction:r,onAddInstrumentationRule:s,onEditConfiguration:c}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===cg.Status)?.rawValue===Pe.Success)(e))return[{id:bo(),label:"Delete Connection",rightIcon:Ha,onClick:()=>pg(e,i)}];const d=pg(e,e=>t.find(t=>t.id===e));if(d?.type!==Xi.K8s)return[];const p=!!d&&D(d.odigosVersion,n,d.type),u=!!d&&D(d.odigosVersion,o,d.type),h=_(n,d?.type),m=_(o,d?.type),g=[];return a&&g.push({id:bo(),tooltip:u?nt.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${m} or later.`,rightIcon:tl,disabled:!u,onClick:()=>pg(e,a)}),l&&g.push({id:bo(),tooltip:nt.ADD_DESTINATION,rightIcon:Ya,onClick:()=>pg(e,l)}),r&&g.push({id:bo(),tooltip:nt.ADD_ACTION,rightIcon:Fa,onClick:()=>pg(e,r)}),s&&g.push({id:bo(),tooltip:nt.ADD_INSTRUMENTATION_RULE,rightIcon:el,onClick:()=>pg(e,s)}),c&&g.push({id:bo(),tooltip:p?"Edit Configuration":`To use this feature, please upgrade to Odigos v${h} or later.`,rightIcon:ul,disabled:!p,onClick:()=>pg(e,c)}),g}})({connections:S,configMinSupportedVersion:h,snapshotMinSupportedVersion:m,onDelete:t=>e(t,lg.Delete),onAddSource:b.canFetchSnapshots&&b.canBulkPersistSources?t=>e(t,lg.BulkSource):void 0,onAddDestination:b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canCreateDestination?t=>e(t,lg.BulkDestination):void 0,onAddAction:b.canCreateAction?t=>e(t,lg.BulkAction):void 0,onAddInstrumentationRule:b.canCreateInstrumentationRule?t=>e(t,lg.BulkInstrumentationRule):void 0,onEditConfiguration:b.canApplyEffectiveConfig?t=>e(t,lg.BulkConfig):void 0})},[S,h,m,b]),H=i(()=>(e=>{const{onCancel:t,onAddSource:n,onAddDestination:o,onAddAction:i,onAddInstrumentationRule:a,onManageConfigurations:l}=e,r=[];n&&r.push({id:bo(),type:gn.Button,buttonProps:{variant:Ie.Primary,size:ke.S,label:"Add Sources",rightIcon:tl,onClick:n}});const s=[o?{id:lg.BulkDestination,label:nt.ADD_DESTINATION,icon:Ya}:null,i?{id:lg.BulkAction,label:nt.ADD_ACTION,icon:Fa}:null,a?{id:lg.BulkInstrumentationRule,label:nt.ADD_INSTRUMENTATION_RULE,icon:el}:null,l?{id:lg.BulkConfig,label:"Manage Configurations",icon:ul}:null];return s.some(Boolean)&&r.push({id:bo(),type:gn.ButtonDropData,buttonProps:{variant:Ie.Secondary,size:ke.S,label:"Bulk Operations",onClick:e=>{e===lg.BulkSource?n?.():e===lg.BulkDestination?o?.():e===lg.BulkAction?i?.():e===lg.BulkInstrumentationRule?a?.():e===lg.BulkConfig&&l?.()}},dropDataProps:{alignX:fo.Left,items:s}}),r.push({id:bo(),type:gn.Button,buttonProps:{variant:Ie.Text,size:ke.S,label:Ft.CANCEL,onClick:t}}),r})({onCancel:()=>O([]),onAddSource:b.canFetchSnapshots&&b.canBulkPersistSources?()=>N(lg.BulkSource):void 0,onAddDestination:b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canCreateDestination?()=>N(lg.BulkDestination):void 0,onAddAction:b.canCreateAction?()=>N(lg.BulkAction):void 0,onAddInstrumentationRule:b.canCreateInstrumentationRule?()=>N(lg.BulkInstrumentationRule):void 0,onManageConfigurations:b.canApplyEffectiveConfig?()=>N(lg.BulkConfig):void 0}),[b]),j=i(()=>t(mo,{items:sg,withMultiSelect:!1,selectedIds:[],setSelectedIds:e=>F(e[0]),buttonProps:{variant:Ie.Primary,size:ke.S,label:Ft.CREATE_NEW}}),[F]),G=i(()=>T.trim()&&S.length>0?{hideIcon:!0,title:nt.NO_RESULTS,subTitle:nt.NO_RESULTS_FOR_FILTER(T)}:{icon:Pl,title:nt.NO_CONNECTIONS,action:j},[T,S.length,j]);return t(Vi,{children:e(ut,{fullHeight:!0,richTitle:{icon:Pl,title:nt.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:gn.Button,buttonProps:{variant:Ie.Secondary,size:ke.S,leftIcon:pl,onClick:w,disabled:y}},{id:"connections-create-new",type:gn.ButtonDropData,buttonProps:{variant:Ie.Primary,size:ke.S,label:Ft.CREATE_NEW,onClick:e=>F(e)},dropDataProps:{alignX:fo.Right,items:sg}}],children:[t(Mn,{variant:zn.Pretty,headerBackgroundColor:g.v2.colors.silver[1e3],isLoading:y,withCheckboxes:U,columns:dg,rows:X,noDataProps:G,rowActionsPushRightPosition:I?`calc(${Or} - 24px)`:void 0,getRowActions:V}),I===lg.BulkConfig&&b.canApplyEffectiveConfig&&t(lr,{connectionIds:E,children:t(dp,{onClose:()=>N(null),connections:z,selectedConnectionIds:E,setSelectedConnectionIds:O})}),I===lg.BulkSource&&b.canFetchSnapshots&&b.canBulkPersistSources&&t(lr,{connectionIds:E,children:t(rr,{selectedConnectionIds:E,children:t(Tc,{onClose:()=>N(null),selectedConnectionIds:E,setSelectedConnectionIds:O})})}),I===lg.BulkDestination&&b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canTestConnection&&b.canCreateDestination&&t(lr,{connectionIds:E,children:t(sr,{children:t(rc,{onClose:()=>N(null),selectedConnectionIds:E,setSelectedConnectionIds:O})})}),I===lg.BulkAction&&b.canCreateAction&&t(lr,{connectionIds:E,children:t(cr,{children:t(qs,{onClose:()=>N(null),selectedConnectionIds:E,setSelectedConnectionIds:O})})}),I===lg.BulkInstrumentationRule&&b.canCreateInstrumentationRule&&t(lr,{connectionIds:E,children:t(dr,{children:t(sc,{onClose:()=>N(null),selectedConnectionIds:E,setSelectedConnectionIds:O})})}),$&&t(pr,{providers:p,children:t(lp,{onClose:()=>A(!1),withOverlay:!0,onCreateCloudConnector:u,onCreated:L})}),t(_r,{isOpen:R,onClose:()=>P(!1)}),t(Ar,{target:"connection",isOpen:I===lg.Delete,onClose:()=>{O([]),N(null)},onApprove:async()=>{const e=E[0];e&&(await s(e),await w())}}),t(Bn,{isOpen:!!E.length&&!I,richTitle:{icon:Xa,title:"Selected Clusters",badge:{label:E.length}},actions:H})]})})},gg=b.div`
|
|
976
|
+
`,ng=["50","25","10","1","0.1"],og=({value:n,onChange:o,label:a})=>{const l=v(),r=i(()=>ng.map(e=>({value:e,label:`${e}%`,selectedBgColor:l.v2.colors.purple[900],selectedBorderColor:l.v2.colors.purple[400]})),[l]);return e(ae,{$gap:8,children:[t(ee,{size:te.XS,color:l.v2.colors.white[500],children:a}),t(tg,{children:t(ve,{"data-id":"sampling-onboarding-ambient",options:r,selected:n,setSelected:o})})]})},ig=({errorPresetEnabled:o,onErrorPresetChange:a,ambientPercentage:l,onAmbientPercentageChange:r,onBack:s,onNext:c,submitting:d})=>{const p=v(),u=i(()=>R(o?{disabled:!1}:null),[o]);return e(n,{children:[t(xm,{title:Ai,onBack:s}),e(vm,{$width:854,children:[t(Dm,{children:Ri}),e(ae,{$gap:8,$width:"100%",children:[e(Tm,{children:[t(eg,{children:t(ee,{size:te.XXS,color:p.v2.colors.silver[200],children:Di})}),t(Nm,{items:[_i,Pi,Li,Fi,Mi]}),t(Om,{message:Ti})]}),e($m,{children:[e(Am,{children:[t(ee,{size:te.S,weight:500,color:p.v2.colors.white[500],children:zi}),t(fl,{size:16,fill:p.v2.colors.silver[200]})]}),t(Rm,{children:t(mm,{name:$i,recommended:!0,toggleLabel:Oi,enabled:o,onEnabledChange:a,summary:u,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(Rm,{children:t(og,{value:l,onChange:r,label:Bi})})]})]})]}),t(Cm,{onNext:c,nextLoading:d})]})},ag=({isOpen:e,onClose:n,k8sHealthProbesConfig:o,samplingId:i,docsUrl:r})=>{const{samplingApi:s}=Gl(),[c,p]=l("welcome"),[u,h]=l(!0),[m,g]=l("keep-list"),[f,b]=l(!0),[v,y]=l("25"),[C,S]=l(!1);a(()=>{e&&(p("welcome"),h(o?.enabled??!0),g("keep-list"),b(!0),y("25"),S(!1))},[e,o?.enabled]);const x=d(async()=>{const e=i??"default",t=[];if(u!==(o?.enabled??!1)){const e=s.updateK8sHealthProbesConfig;e&&t.push(e({enabled:u,keepPercentage:o?.keepPercentage??0}))}if("advanced"!==m&&f){const n=s.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=s.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),p("success")}catch{}finally{S(!1)}},[i,s,u,o?.enabled,o?.keepPercentage,m,f,v]);let w=null;switch(c){case"welcome":w=t(Bm,{onSkip:n,onNext:()=>p("noisy")});break;case"noisy":w=t(Pm,{enabled:u,onEnabledChange:h,onBack:()=>p("welcome"),onNext:()=>p("strategy")});break;case"strategy":w=t(Jm,{strategy:m,onStrategyChange:g,onBack:()=>p("noisy"),onNext:()=>{p("keep-list"===m?"keep-list":"drop-list"===m?"drop-list":"advanced")},docsUrl:r});break;case"keep-list":w=t(ig,{errorPresetEnabled:f,onErrorPresetChange:b,ambientPercentage:v,onAmbientPercentageChange:y,onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"drop-list":w=t(Qm,{errorPresetEnabled:f,onErrorPresetChange:b,onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"advanced":w=t(qm,{onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"success":w=t(Fm,{onClose:n})}return t(vo,{isOpen:e,onClose:n,children:w})};var lg,rg;(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"})(lg||(lg={})),(e=>{e.K8s="k8s",e.VmAgent="vm-agent",e.CloudConnector="cloud-connector",e.AwsEcsAgent="aws-ecs-agent"})(rg||(rg={}));const sg=[{id:rg.CloudConnector,label:"Cloud Connector"}];var cg;(e=>{e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"})(cg||(cg={}));const dg=[{key:cg.Name,label:"Name"},{key:cg.Type,label:"Type"},{key:cg.Status,label:"Status"},{key:cg.OdigosVersion,label:"Odigos Version"},{key:cg.ConnectedSince,label:"Connected Since"},{key:cg.LastActivity,label:"Last Activity"}],pg=(e,t)=>{const n=e.find(e=>e.key===cg.Id)?.rawValue;return t(n?.toString()||"")},ug={[Pe.Success]:"Connected",[Pe.Warning]:"Degraded",[Pe.Error]:"Error",[Pe.Disabled]:"Disabled",[Pe.Info]:"Pending"},hg={[Xi.K8s]:hn.Purple,[Xi.Vm]:hn.Blue,[Xi.Connector]:hn.Green,[Xi.AwsEcs]:hn.Yellow},mg=({connections:n,getConnections:o,onClickConnection:r,deleteConnection:s,onCreateNew:c,cloudConnectorProviders:p,onCreateCloudConnector:u,configMinSupportedVersion:h=0,snapshotMinSupportedVersion:m=0})=>{const g=v(),{formatTimeAgo:f}=an(),{capabilities:b}=Gl(),[y,C]=l(!n?.length),[S,x]=l(n||[]),w=d(async()=>{try{C(!0),x(await o()??[])}catch(e){}finally{C(!1)}},[]);a(()=>{S.length||w()},[]);const[T,k]=l(""),[I,N]=l(null),[E,O]=l([]),[$,A]=l(!1),[R,P]=l(!1),L=d(()=>{A(!1),P(!0),w()},[w]),F=d(e=>{e===rg.CloudConnector?A(!0):c?.(e)},[c]),M=i(()=>I===lg.BulkConfig?h:I===lg.BulkSource?m:0,[I,h,m]),{supportedConnections:z,supportedConnectionIds:B}=i(()=>{const e=((e,t)=>e.filter(e=>{const n=e.status===Pe.Success,o=D(e.odigosVersion,t,e.type);return n&&o}))(S,M);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[S,M]);a(()=>{if(!I||I===lg.Delete)return;const e=E.filter(e=>!B.includes(e));e.length&&O(t=>t.filter(t=>!e.includes(t)))},[I,E.length,B.length]);const X=i(()=>S.filter(e=>!T||e.name.toLowerCase().includes(T.toLowerCase())).map(e=>({cells:[{key:cg.Id,rawValue:e.id},{key:cg.Name,rawValue:e.name},{key:cg.Type,rawValue:e.type,component:()=>t(nn,{variant:hg[e.type]??hn.Default,label:Ui(e.type),leftIcon:Vn(e.type)})},{key:cg.Status,rawValue:e.status,component:()=>(e=>{if(e.type===Xi.Connector){const n=ug[e.status]??"Pending",o=e.status===Pe.Success?Za:e.status===Pe.Error?Qa:void 0;return t(ce,{status:e.status,label:n,leftIcon:o})}const n=e.status===Pe.Success?"Connection live":"Connection lost",o=e.status===Pe.Success?Za:Qa;return t(ce,{status:e.status,label:n,leftIcon:o})})(e)},{key:cg.OdigosVersion,rawValue:e.odigosVersion},{key:cg.ConnectedSince,rawValue:e.connectedAt?f(e.connectedAt):"-"},{key:cg.LastActivity,rawValue:e.lastSeenAt?f(e.lastSeenAt):"-"}],onClick:e.status!==Pe.Success||I?void 0:()=>r(e),isSelected:E.includes(e.id),onSelect:()=>O(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>O(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==Pe.Success||I===lg.BulkConfig&&!D(e.odigosVersion,h,e.type)||I===lg.BulkSource&&!D(e.odigosVersion,m,e.type)})),[S,E,T,I,h,m,f,r]),U=i(()=>S.length>0&&S.every(e=>e.type===Xi.K8s),[S]),V=i(()=>{const e=(e,t)=>{O([e]),N(t)};return(e=>{const{connections:t,configMinSupportedVersion:n,snapshotMinSupportedVersion:o,onDelete:i,onAddSource:a,onAddDestination:l,onAddAction:r,onAddInstrumentationRule:s,onEditConfiguration:c}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===cg.Status)?.rawValue===Pe.Success)(e))return[{id:bo(),label:"Delete Connection",rightIcon:Ha,onClick:()=>pg(e,i)}];const d=pg(e,e=>t.find(t=>t.id===e));if(d?.type!==Xi.K8s)return[];const p=!!d&&D(d.odigosVersion,n,d.type),u=!!d&&D(d.odigosVersion,o,d.type),h=_(n,d?.type),m=_(o,d?.type),g=[];return a&&g.push({id:bo(),tooltip:u?nt.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${m} or later.`,rightIcon:tl,disabled:!u,onClick:()=>pg(e,a)}),l&&g.push({id:bo(),tooltip:nt.ADD_DESTINATION,rightIcon:Ya,onClick:()=>pg(e,l)}),r&&g.push({id:bo(),tooltip:nt.ADD_ACTION,rightIcon:Fa,onClick:()=>pg(e,r)}),s&&g.push({id:bo(),tooltip:nt.ADD_INSTRUMENTATION_RULE,rightIcon:el,onClick:()=>pg(e,s)}),c&&g.push({id:bo(),tooltip:p?"Edit Configuration":`To use this feature, please upgrade to Odigos v${h} or later.`,rightIcon:ul,disabled:!p,onClick:()=>pg(e,c)}),g}})({connections:S,configMinSupportedVersion:h,snapshotMinSupportedVersion:m,onDelete:t=>e(t,lg.Delete),onAddSource:b.canFetchSnapshots&&b.canBulkPersistSources?t=>e(t,lg.BulkSource):void 0,onAddDestination:b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canCreateDestination?t=>e(t,lg.BulkDestination):void 0,onAddAction:b.canCreateAction?t=>e(t,lg.BulkAction):void 0,onAddInstrumentationRule:b.canCreateInstrumentationRule?t=>e(t,lg.BulkInstrumentationRule):void 0,onEditConfiguration:b.canApplyEffectiveConfig?t=>e(t,lg.BulkConfig):void 0})},[S,h,m,b]),H=i(()=>(e=>{const{onCancel:t,onAddSource:n,onAddDestination:o,onAddAction:i,onAddInstrumentationRule:a,onManageConfigurations:l}=e,r=[];n&&r.push({id:bo(),type:gn.Button,buttonProps:{variant:Ie.Primary,size:ke.S,label:"Add Sources",rightIcon:tl,onClick:n}});const s=[o?{id:lg.BulkDestination,label:nt.ADD_DESTINATION,icon:Ya}:null,i?{id:lg.BulkAction,label:nt.ADD_ACTION,icon:Fa}:null,a?{id:lg.BulkInstrumentationRule,label:nt.ADD_INSTRUMENTATION_RULE,icon:el}:null,l?{id:lg.BulkConfig,label:"Manage Configurations",icon:ul}:null];return s.some(Boolean)&&r.push({id:bo(),type:gn.ButtonDropData,buttonProps:{variant:Ie.Secondary,size:ke.S,label:"Bulk Operations",onClick:e=>{e===lg.BulkSource?n?.():e===lg.BulkDestination?o?.():e===lg.BulkAction?i?.():e===lg.BulkInstrumentationRule?a?.():e===lg.BulkConfig&&l?.()}},dropDataProps:{alignX:fo.Left,items:s}}),r.push({id:bo(),type:gn.Button,buttonProps:{variant:Ie.Text,size:ke.S,label:Ft.CANCEL,onClick:t}}),r})({onCancel:()=>O([]),onAddSource:b.canFetchSnapshots&&b.canBulkPersistSources?()=>N(lg.BulkSource):void 0,onAddDestination:b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canCreateDestination?()=>N(lg.BulkDestination):void 0,onAddAction:b.canCreateAction?()=>N(lg.BulkAction):void 0,onAddInstrumentationRule:b.canCreateInstrumentationRule?()=>N(lg.BulkInstrumentationRule):void 0,onManageConfigurations:b.canApplyEffectiveConfig?()=>N(lg.BulkConfig):void 0}),[b]),j=i(()=>t(mo,{items:sg,withMultiSelect:!1,selectedIds:[],setSelectedIds:e=>F(e[0]),buttonProps:{variant:Ie.Primary,size:ke.S,label:Ft.CREATE_NEW}}),[F]),G=i(()=>T.trim()&&S.length>0?{hideIcon:!0,title:nt.NO_RESULTS,subTitle:nt.NO_RESULTS_FOR_FILTER(T)}:{icon:Pl,title:nt.NO_CONNECTIONS,action:j},[T,S.length,j]);return t(Vi,{children:e(ut,{fullHeight:!0,richTitle:{icon:Pl,title:nt.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:gn.Button,buttonProps:{variant:Ie.Secondary,size:ke.S,leftIcon:pl,onClick:w,disabled:y}},{id:"connections-create-new",type:gn.ButtonDropData,buttonProps:{variant:Ie.Primary,size:ke.S,label:Ft.CREATE_NEW,onClick:e=>F(e)},dropDataProps:{alignX:fo.Right,items:sg}}],children:[t(Mn,{variant:zn.Pretty,headerBackgroundColor:g.v2.colors.silver[1e3],isLoading:y,withCheckboxes:U,columns:dg,rows:X,noDataProps:G,rowActionsPushRightPosition:I?`calc(${Or} - 24px)`:void 0,getRowActions:V}),I===lg.BulkConfig&&b.canApplyEffectiveConfig&&t(lr,{connectionIds:E,children:t(dp,{onClose:()=>N(null),connections:z,selectedConnectionIds:E,setSelectedConnectionIds:O})}),I===lg.BulkSource&&b.canFetchSnapshots&&b.canBulkPersistSources&&t(lr,{connectionIds:E,children:t(rr,{selectedConnectionIds:E,children:t(Tc,{onClose:()=>N(null),selectedConnectionIds:E,setSelectedConnectionIds:O})})}),I===lg.BulkDestination&&b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canTestConnection&&b.canCreateDestination&&t(lr,{connectionIds:E,children:t(sr,{children:t(rc,{onClose:()=>N(null),selectedConnectionIds:E,setSelectedConnectionIds:O})})}),I===lg.BulkAction&&b.canCreateAction&&t(lr,{connectionIds:E,children:t(cr,{children:t(qs,{onClose:()=>N(null),selectedConnectionIds:E,setSelectedConnectionIds:O})})}),I===lg.BulkInstrumentationRule&&b.canCreateInstrumentationRule&&t(lr,{connectionIds:E,children:t(dr,{children:t(sc,{onClose:()=>N(null),selectedConnectionIds:E,setSelectedConnectionIds:O})})}),$&&t(pr,{providers:p,children:t(lp,{onClose:()=>A(!1),withOverlay:!0,onCreateCloudConnector:u,onCreated:L})}),t(_r,{isOpen:R,onClose:()=>P(!1)}),t(Ar,{target:"connection",isOpen:I===lg.Delete,onClose:()=>{O([]),N(null)},onApprove:async()=>{const e=E[0];e&&(await s(e),await w())}}),t(Bn,{isOpen:!!E.length&&!I,richTitle:{icon:Xa,title:"Selected Clusters",badge:{label:E.length}},actions:H})]})})},gg=b.div`
|
|
977
977
|
display: flex;
|
|
978
978
|
align-items: center;
|
|
979
979
|
justify-content: space-between;
|
|
@@ -6,6 +6,11 @@
|
|
|
6
6
|
* concurrent consumers and shares the cached list, so the
|
|
7
7
|
* `<AddSourceDrawer>` and `<DiagnoseTab>` (and any other consumer)
|
|
8
8
|
* see the same data once any of them has triggered the fetch.
|
|
9
|
+
*
|
|
10
|
+
* `useNamespaces({ skip })` lets a consumer opt out of triggering that
|
|
11
|
+
* fetch. The query is a full cluster-wide workload inventory, so a
|
|
12
|
+
* consumer that has a cheaper source for the same data should gate it
|
|
13
|
+
* rather than pay for both round-trips (PLAT-1345).
|
|
9
14
|
*/
|
|
10
15
|
import { type Namespace } from '../../../types';
|
|
11
16
|
import type { OperationContext, OdigosApiOperations } from '../types';
|
|
@@ -21,13 +26,23 @@ export interface UseNamespacesResult {
|
|
|
21
26
|
error?: string;
|
|
22
27
|
}>;
|
|
23
28
|
}
|
|
29
|
+
export interface UseNamespacesOptions {
|
|
30
|
+
/**
|
|
31
|
+
* Skip the query entirely: no request is sent, `items` stays the stable
|
|
32
|
+
* empty array and `loading` stays `false`. `GET_NAMESPACES_WITH_WORKLOADS`
|
|
33
|
+
* is a cluster-wide workload inventory, so a container that can source the
|
|
34
|
+
* same data more cheaply should gate it — the `<AddSourceDrawer>` only
|
|
35
|
+
* needs it when no cluster snapshot is available (PLAT-1345).
|
|
36
|
+
*/
|
|
37
|
+
skip?: boolean;
|
|
38
|
+
}
|
|
24
39
|
export interface NamespaceApi {
|
|
25
40
|
/**
|
|
26
41
|
* Subscribe to the namespaces (with workloads) list. Owns a
|
|
27
42
|
* `useApiQuery('GET_NAMESPACES_WITH_WORKLOADS')` — call at the top level of a
|
|
28
43
|
* container. Returns the reactive `{ items, loading, refetch }`.
|
|
29
44
|
*/
|
|
30
|
-
useNamespaces: () => UseNamespacesResult;
|
|
45
|
+
useNamespaces: (options?: UseNamespacesOptions) => UseNamespacesResult;
|
|
31
46
|
fetchAll: () => Promise<{
|
|
32
47
|
data?: NamespacesEnvelope;
|
|
33
48
|
error?: string;
|
|
@@ -14,8 +14,10 @@
|
|
|
14
14
|
* blocks the op for the active context (e.g. central-ui can't snapshot a
|
|
15
15
|
* < v1.20 proxy, or a VM proxy) the query is skipped and `data` stays
|
|
16
16
|
* `undefined` — consumers treat that as the signal to fall back to the
|
|
17
|
-
* per-proxy `namespacesApi` path.
|
|
18
|
-
*
|
|
17
|
+
* per-proxy `namespacesApi` path. `pending` tells them WHEN that signal is
|
|
18
|
+
* trustworthy, so a consumer can gate its fallback request instead of firing
|
|
19
|
+
* it speculatively alongside the snapshot. Imperative `getAllClusterSnapshots`
|
|
20
|
+
* / `getClusterSnapshot` remain for fire-and-forget reads.
|
|
19
21
|
*/
|
|
20
22
|
import type { AllClusterSnapshots, ClusterSnapshot } from '../../../types';
|
|
21
23
|
import type { OperationContext, OdigosApiOperations } from '../types';
|
|
@@ -23,6 +25,19 @@ export interface UseSnapshotsResult {
|
|
|
23
25
|
/** All-cluster snapshot for the active context (undefined while loading, skipped, or blocked by the op's guard). */
|
|
24
26
|
data?: AllClusterSnapshots;
|
|
25
27
|
loading: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* True while the snapshot outcome is still unknown — a request is in flight
|
|
30
|
+
* and nothing has landed yet. Once this is `false`, `data === undefined`
|
|
31
|
+
* definitively means "no snapshot for this context" (the op is missing, its
|
|
32
|
+
* `canRun` guard blocked it, or the backend returned none), which is the
|
|
33
|
+
* signal to fall back to the per-proxy namespaces path.
|
|
34
|
+
*
|
|
35
|
+
* Distinct from `loading`, which is also `true` while `cache-and-network`
|
|
36
|
+
* revalidates a snapshot that's already rendered. Consumers gating a
|
|
37
|
+
* fallback request need `pending`: gating on `!data` alone fires the
|
|
38
|
+
* fallback on the first render, before the snapshot had a chance to arrive.
|
|
39
|
+
*/
|
|
40
|
+
pending: boolean;
|
|
26
41
|
/** True when the host adapter doesn't expose `GET_ALL_CLUSTER_SNAPSHOTS` at all. */
|
|
27
42
|
unsupported: boolean;
|
|
28
43
|
refetch: () => Promise<{
|
|
@@ -67,7 +67,9 @@ export interface UseApiQueryResult<TData> {
|
|
|
67
67
|
/**
|
|
68
68
|
* Re-execute the query with the same variables, returning the
|
|
69
69
|
* transformed data. Wraps Apollo's `refetch` so callers don't see
|
|
70
|
-
* the raw envelope.
|
|
70
|
+
* the raw envelope. No-ops to `{ data: undefined }` while the query is
|
|
71
|
+
* skipped — by `options.skip`, a missing slot, or the op's `canRun` guard —
|
|
72
|
+
* so a "refresh on open" effect can't smuggle a request past those gates.
|
|
71
73
|
*/
|
|
72
74
|
refetch: () => Promise<{
|
|
73
75
|
data: TData | undefined;
|
package/lib/contexts.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as a,r as x,a as y}from"./chunks/source-instrument-form-context-
|
|
1
|
+
import{u as a,r as x,a as y}from"./chunks/source-instrument-form-context-B40tRNcP.js";export{A as ActionFormContextProvider,C as CloudConnectorFormContextProvider,D as DataStreamFormContextProvider,b as DestinationFormContextProvider,O as OdigosApiConnectionsScope,c as OdigosApiProvider,R as RuleFormContextProvider,S as SamplingRuleFormType,d as SamplingRulesFormProvider,e as SourceEditFormContextProvider,f as SourceInstrumentFormContextProvider,p as prepareNamespacePayloads,g as prepareSourcePayloads,h as useActionFormContext,i as useApiLazyQuery,j as useApiMutation,k as useApiQuery,l as useCloudConnectorFormContext,m as useDataStreamFormContext,n as useDestinationFormContext,o as useOdigosApi,q as useRuleFormContext,s as useSamplingRulesFormContext,t as useSourceEditFormContext,v as useSourceInstrumentFormContext}from"./chunks/source-instrument-form-context-B40tRNcP.js";export{O as OdigosProvider,c as checkVersionSupport,r as resolveMinSupportedVersion,u as useOdigos}from"./chunks/helpers-BkaWRtR9.js";import{jsx as F}from"react/jsx-runtime";import{useMemo as P,useContext as E,createContext as T}from"react";import{P as I,t as _}from"./chunks/ui-components-BUMZXMZ4.js";import{useApolloClient as M}from"@apollo/client/react";import"@apollo/client/link/error";import"@apollo/client/link/context";import"@apollo/client/utilities";import"@apollo/client/errors";import"@apollo/client";import"styled-components";import"./icons.js";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";const V=()=>{const o=M(),{operations:r,context:e}=a();return{multiFetch:async(t,s,n)=>{const i=r[t];return i?y(o,i,s,n,e):{results:[],allSucceeded:!1,anySucceeded:!1,successCount:0,failureCount:s.length,error:`Operation ${String(t)} not configured`}},bulkPersistSources:async(t,s)=>{const n=[];for(const i of t){const t={...e,proxyID:i},{error:a}=await x(o,r.PERSIST_SOURCES,s,t);a&&n.push(`${i}: ${a}`)}return n.length?{error:n.join(", ")}:void 0},applyConfigurations:async(t,s)=>{if(!r.UPDATE_REMOTE_CONFIG)return{error:"UPDATE_REMOTE_CONFIG not configured"};const{error:n}=await x(o,r.UPDATE_REMOTE_CONFIG,{formData:s,connectionIds:t},e);return n?{error:n}:void 0}}},w=(o,r)=>o.platformType===I.K8s?r.K8s:[I.Vm,I.Connector,I.AwsEcs].includes(o.platformType)?r.Vm:void 0,N=o=>r=>{const e=o[r.platformType];if(!e)return;const t=Object.keys(e);if(0===t.length)return;const s=_(r.schemaVersion??r.version),n=[...t].sort((o,r)=>_(r)-_(o)).find(o=>s>=_(o));return n?e[n]:void 0},U=(o,r)=>{const e={};for(const t of Object.keys(o))e[t]=r(o[t]);return e},z=T({formType:void 0}),G=({children:o,formType:r})=>{const e=P(()=>({formType:r}),[r]);return F(z.Provider,{value:e,children:o})},$=()=>E(z);export{G as StorybookProvider,w as pickByPlatform,V as useApiForConnections,$ as useStorybook,N as versionedDocument,U as vmDialectMap};
|
package/lib/functions.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{bk as adaptInstrumentationRuleFromWire,bi as adaptInstrumentationRuleInputForWire,ci as buildBadgeForDesiredStatus,c9 as buildCatalogFieldsDataCard,fs as capitalizeFirstLetter,ft as cleanObjectEmptyStringsValues,a3 as compareCondition,fu as decimalsOnly,aY as deepClone,eA as entityIdKey,eF as filterActions,eE as filterDestinations,cd as filterDestinationsByStream,eD as filterSources,eq as filterSourcesByStream,fv as flattenObjectKeys,cw as formatBytes,fw as formatDuration,b4 as generateId,ex as getActionConditions,cb as getActionIcon,ey as getConditionsBooleans,cM as getContainersIcons,fx as getContainersInstrumentedCount,fy as getDeepValue,c1 as getDestinationIcon,fz as getDetectedLanguageIcons,cm as getEffectiveLanguage,cE as getEffectiveRuntimeVersion,eB as getEntityIcon,bh as getEntityId,ew as getEntityIdKey,ez as getEntityLabel,fA as getHealthBadgeLabel,bf as getIdFromSseTarget,cf as getInstrumentationRuleIcon,fB as getMainContainerLanguage,fC as getMetricForEntity,fD as getMonitorIcon,fE as getNearestTypographySize,cL as getPlatformIcon,em as getPlatformLabel,O as getProgrammingLanguageIcon,fF as getRecursiveValues,cv as getSourceKindLabel,cs as getSourceLanguageIcons,b8 as getSseTargetFromId,cC as getStatusColor,eH as getStatusFromPodStatus,cD as getStatusIcon,cx as getStatusTypeFromOdigosHealth,fG as getValueForRange,cr as getVirtualServiceIcon,cq as getWorkloadId,ce as getYamlFieldsForDestination,fH as hasUnhealthyInstances,fI as instrumentationRuleSourceScopesFromWire,fJ as instrumentationRuleSourceScopesToWire,bp as isEmpty,bq as isLegalK8sLabel,d5 as isOverTime,fK as isStringABoolean,fL as isTimeElapsed,cB as isValidVersion,fM as mapConditions,ck as mapDesiredStatusToConditionStatus,c7 as mapDesiredStatusesToConditions,cc as mapDestinationFieldsForDisplay,bu as mapExportedSignals,bs as mapSupportedSignals,fN as numbersOnly,fO as parseBooleanFromString,fP as parseJsonStringToPrettyString,bK as prepareDestinationFormData,fQ as removeEmptyValuesFromObject,v as safeJsonParse,fR as safeJsonStringify,fS as setDeepValue,fT as sleep,ag as splitCamelString,fU as stringifyNonStringValues,t as trimVersion}from"./chunks/ui-components-
|
|
1
|
+
export{bk as adaptInstrumentationRuleFromWire,bi as adaptInstrumentationRuleInputForWire,ci as buildBadgeForDesiredStatus,c9 as buildCatalogFieldsDataCard,fs as capitalizeFirstLetter,ft as cleanObjectEmptyStringsValues,a3 as compareCondition,fu as decimalsOnly,aY as deepClone,eA as entityIdKey,eF as filterActions,eE as filterDestinations,cd as filterDestinationsByStream,eD as filterSources,eq as filterSourcesByStream,fv as flattenObjectKeys,cw as formatBytes,fw as formatDuration,b4 as generateId,ex as getActionConditions,cb as getActionIcon,ey as getConditionsBooleans,cM as getContainersIcons,fx as getContainersInstrumentedCount,fy as getDeepValue,c1 as getDestinationIcon,fz as getDetectedLanguageIcons,cm as getEffectiveLanguage,cE as getEffectiveRuntimeVersion,eB as getEntityIcon,bh as getEntityId,ew as getEntityIdKey,ez as getEntityLabel,fA as getHealthBadgeLabel,bf as getIdFromSseTarget,cf as getInstrumentationRuleIcon,fB as getMainContainerLanguage,fC as getMetricForEntity,fD as getMonitorIcon,fE as getNearestTypographySize,cL as getPlatformIcon,em as getPlatformLabel,O as getProgrammingLanguageIcon,fF as getRecursiveValues,cv as getSourceKindLabel,cs as getSourceLanguageIcons,b8 as getSseTargetFromId,cC as getStatusColor,eH as getStatusFromPodStatus,cD as getStatusIcon,cx as getStatusTypeFromOdigosHealth,fG as getValueForRange,cr as getVirtualServiceIcon,cq as getWorkloadId,ce as getYamlFieldsForDestination,fH as hasUnhealthyInstances,fI as instrumentationRuleSourceScopesFromWire,fJ as instrumentationRuleSourceScopesToWire,bp as isEmpty,bq as isLegalK8sLabel,d5 as isOverTime,fK as isStringABoolean,fL as isTimeElapsed,cB as isValidVersion,fM as mapConditions,ck as mapDesiredStatusToConditionStatus,c7 as mapDesiredStatusesToConditions,cc as mapDestinationFieldsForDisplay,bu as mapExportedSignals,bs as mapSupportedSignals,fN as numbersOnly,fO as parseBooleanFromString,fP as parseJsonStringToPrettyString,bK as prepareDestinationFormData,fQ as removeEmptyValuesFromObject,v as safeJsonParse,fR as safeJsonStringify,fS as setDeepValue,fT as sleep,ag as splitCamelString,fU as stringifyNonStringValues,t as trimVersion}from"./chunks/ui-components-BUMZXMZ4.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";
|
package/lib/hooks.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{g9 as IGNORE_OUTSIDE_CLICK_ATTR,ga as useActionFormData,gb as useBodyScroll,eC as useContainerSize,b3 as useCopy,gc as useDataStreamFormData,gd as useDestinationFormData,bl as useGenericForm,ge as useInstrumentationRuleFormData,d4 as useKeyDown,cy as useOnClickOutside,gf as useOverflow,gg as usePopup,ch as useScrollIntoViewWhen,f0 as useScrollTo,et as useSessionStorage,gh as useSourceFormData,cg as useTimeAgo}from"./chunks/ui-components-
|
|
1
|
+
export{g9 as IGNORE_OUTSIDE_CLICK_ATTR,ga as useActionFormData,gb as useBodyScroll,eC as useContainerSize,b3 as useCopy,gc as useDataStreamFormData,gd as useDestinationFormData,bl as useGenericForm,ge as useInstrumentationRuleFormData,d4 as useKeyDown,cy as useOnClickOutside,gf as useOverflow,gg as usePopup,ch as useScrollIntoViewWhen,f0 as useScrollTo,et as useSessionStorage,gh as useSourceFormData,cg as useTimeAgo}from"./chunks/ui-components-BUMZXMZ4.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";
|
package/lib/snippets.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{A as ActionType,a as Actions,R as RichTitle}from"./chunks/ui-components-
|
|
1
|
+
export{A as ActionType,a as Actions,R as RichTitle}from"./chunks/ui-components-BUMZXMZ4.js";export{C as CancelModal,a as ConnectorCreatedModal,D as DURATION_OPTIONS,b as DeleteModal,c as DurationErrorsSection,d as DynamicActionFields,e as DynamicField,f as DynamicFields,I as InstrumentationPreviewSection,N as NOISY_PERCENTAGE_OPTIONS,O as OdigosLogoTextByTier,g as OperationSection,P as PERCENTAGE_OPTIONS,h as PercentageSection,i as PresetWithCustomInput,R as RuleInfoSection,j as RuleTypeSection,S as SamplingPreviewSection,k as SignalsCheckboxList,l as SourceScopeSection,U as UpgradeModal,W as WIDE_DRAWER_WIDTH,m as WideDrawer,Y as YamlSectionCard}from"./chunks/index-D3cEk2g_.js";export{C as ColoredSpan,a as ColoredSpanVariant}from"./chunks/helpers-BkaWRtR9.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";
|
package/lib/store.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{d9 as DrawerType,be as ProgressKeys,eu as getDrawerTypeForAdd,cu as getDrawerTypeForEdit,g8 as useDarkMode,bb as useDataStreamStore,cp as useDrawerStore,ep as useFilterStore,b6 as useNotificationStore,bc as useProgressStore,ev as useSelectedStore,bd as useSetupStore}from"./chunks/ui-components-
|
|
1
|
+
export{d9 as DrawerType,be as ProgressKeys,eu as getDrawerTypeForAdd,cu as getDrawerTypeForEdit,g8 as useDarkMode,bb as useDataStreamStore,cp as useDrawerStore,ep as useFilterStore,b6 as useNotificationStore,bc as useProgressStore,ev as useSelectedStore,bd as useSetupStore}from"./chunks/ui-components-BUMZXMZ4.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";
|
package/lib/theme.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{gi as Provider,gj as animations,gk as opacity,gl as palettes}from"./chunks/ui-components-
|
|
1
|
+
export{gi as Provider,gj as animations,gk as opacity,gl as palettes}from"./chunks/ui-components-BUMZXMZ4.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";
|
package/lib/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{bZ as ActionCategoryTypes,bn as ActionKeyTypes,bo as ActionType,f1 as AgentInjectedReason,f2 as BooleanOperation,c5 as CloudConnectorFeatureKey,af as CodeAttributesKeyTypes,f3 as ConditionType,b9 as Crud,a9 as CustomInstrumentationsKeyTypes,f4 as DesiredConditionActionItemType,cj as DesiredStateProgress,f5 as DestinationTypes,ba as EntityTypes,bE as ExtractionDataFormat,n as FieldTypes,ab as GolangCustomProbe,ad as HeadersCollectionKeyTypes,y as InputTypes,f6 as InstallationMethod,f7 as InstallationStatus,a8 as InstrumentationRuleType,f8 as IntrumentationStatus,aa as JavaCustomProbe,f9 as JsonOperation,bC as K8sAttributesFrom,bw as K8sResourceKind,fa as K8sWorkloadContainerAgentConfigTracesHeadSamplingSpanMetricsMode,fb as ListDirection,fc as NumberOperation,fd as OtelDistroName,fe as OtherEntityTypes,ae as PayloadCollectionKeyTypes,ac as PhpCustomProbe,P as PlatformType,ff as PodContainerLifecycleStatus,fg as PodContainerStatus,fh as PodPhase,fi as Profile,M as ProgrammingLanguages,fj as SIGNAL_KEY_TO_TYPE,fk as SIGNAL_TYPE_TO_KEY,fl as SignalKey,bt as SignalType,fm as SortDirection,S as StatusType,fn as StringOperation,b as Tier,fo as WorkloadRolloutReason,eI as WorkloadRolloutStatus}from"./chunks/ui-components-
|
|
1
|
+
export{bZ as ActionCategoryTypes,bn as ActionKeyTypes,bo as ActionType,f1 as AgentInjectedReason,f2 as BooleanOperation,c5 as CloudConnectorFeatureKey,af as CodeAttributesKeyTypes,f3 as ConditionType,b9 as Crud,a9 as CustomInstrumentationsKeyTypes,f4 as DesiredConditionActionItemType,cj as DesiredStateProgress,f5 as DestinationTypes,ba as EntityTypes,bE as ExtractionDataFormat,n as FieldTypes,ab as GolangCustomProbe,ad as HeadersCollectionKeyTypes,y as InputTypes,f6 as InstallationMethod,f7 as InstallationStatus,a8 as InstrumentationRuleType,f8 as IntrumentationStatus,aa as JavaCustomProbe,f9 as JsonOperation,bC as K8sAttributesFrom,bw as K8sResourceKind,fa as K8sWorkloadContainerAgentConfigTracesHeadSamplingSpanMetricsMode,fb as ListDirection,fc as NumberOperation,fd as OtelDistroName,fe as OtherEntityTypes,ae as PayloadCollectionKeyTypes,ac as PhpCustomProbe,P as PlatformType,ff as PodContainerLifecycleStatus,fg as PodContainerStatus,fh as PodPhase,fi as Profile,M as ProgrammingLanguages,fj as SIGNAL_KEY_TO_TYPE,fk as SIGNAL_TYPE_TO_KEY,fl as SignalKey,bt as SignalType,fm as SortDirection,S as StatusType,fn as StringOperation,b as Tier,fo as WorkloadRolloutReason,eI as WorkloadRolloutStatus}from"./chunks/ui-components-BUMZXMZ4.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";
|
package/lib/visuals.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{fp as VISUAL_ODIGOS_LOGO_HEIGHT,fq as VISUAL_ODIGOS_LOGO_WIDTH,V as VisualGreenRings,fr as VisualOdigosLogo,dj as VisualPurpleRings}from"./chunks/ui-components-
|
|
1
|
+
export{fp as VISUAL_ODIGOS_LOGO_HEIGHT,fq as VISUAL_ODIGOS_LOGO_WIDTH,V as VisualGreenRings,fr as VisualOdigosLogo,dj as VisualPurpleRings}from"./chunks/ui-components-BUMZXMZ4.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";
|
package/package.json
CHANGED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{useMemo as t,useContext as r,createContext as a,useCallback as n,useState as o,useEffect as s,useRef as i}from"react";import{b6 as c,b7 as l,m as d,S as u,b8 as m,b9 as p,ba as f,P as E,bb as y,bc as h,bd as S,be as T,bf as g,bg as _,bh as I,bi as A,bj as v,bk as R,bl as C,aY as N,bm as O,bn as D,n as w,bo as b,bp as P,bq as L,br as k,bs as F,bt as G,v as U,bu as M,bv as x,ad as H,a9 as K,ab as V,aa as W,ac as Y,a8 as $,bw as j,b as q}from"./ui-components-i5FUYiX9.js";import{i as B,n as Q,m as z,l as J,o as X,p as Z,v as ee,q as te,u as re}from"./helpers-9QRquBS1.js";import{ApolloProvider as ae,useLazyQuery as ne,useApolloClient as oe,useQuery as se}from"@apollo/client/react";import{ErrorLink as ie}from"@apollo/client/link/error";import{SetContextLink as ce}from"@apollo/client/link/context";import{getMainDefinition as le}from"@apollo/client/utilities";import{CombinedGraphQLErrors as de,ServerError as ue}from"@apollo/client/errors";import{HttpLink as me,ApolloLink as pe,ApolloClient as fe,InMemoryCache as Ee,gql as ye}from"@apollo/client";const he=e=>{if(!e)return!1;const t=e.toLowerCase();return t.includes("authentication required")||t.includes("authentication expired")||t.includes("http 401")},Se=a(null),Te=()=>{const e=r(Se);if(!e)throw new Error("[ui-kit] useOdigosApi() / useXxxApi() called outside of <OdigosApiProvider>. Make sure the host app mounts the provider at its layout level.");return e},ge=({apolloConfig:r,operations:a,context:n,children:o})=>{const s=t(()=>(e=>{const t=new me({uri:e.httpUrl,credentials:e.credentials??"same-origin"}),r=new ie(({error:t})=>{de.is(t)?t.errors.some(e=>he(e.message))&&e.onAuthError?.():(ue.is(t)&&401===t.statusCode||he(t.message))&&e.onAuthError?.()}),a=new ce(async t=>{const r={...t.headers};if(e.authHeader){const t=await e.authHeader();Object.assign(r,t)}return e.csrfHeader&&Object.assign(r,e.csrfHeader()),{headers:r}}),n=[];e.additionalLinks?.length&&n.push(...e.additionalLinks),n.push(a,r,t);let o=pe.from(n);e.wsLink&&(o=pe.split(({query:e})=>{const t=le(e);return"OperationDefinition"===t.kind&&"subscription"===t.operation},e.wsLink,o));const s=e.defaultFetchPolicies;return new fe({link:o,cache:new Ee({typePolicies:e.cacheTypePolicies}),defaultOptions:{watchQuery:{fetchPolicy:s?.watchQuery??"cache-and-network"},query:{fetchPolicy:s?.query??"cache-first"},mutate:{fetchPolicy:s?.mutate??"network-only"}}})})(r),[r.httpUrl,r.wsLink,r.credentials,r.clientKey]),i=t(()=>({operations:a,context:n,apolloConfig:r}),[a,n,r]);return e(ae,{client:s,children:e(Se.Provider,{value:i,children:o})})},_e=Se,Ie=({connectionIds:r,children:a})=>{const n=Te(),o=t(()=>({operations:n.operations,context:{...n.context,connectionIds:r},apolloConfig:n.apolloConfig}),[n.operations,n.context,n.apolloConfig,r.join(",")]);return e(_e.Provider,{value:o,children:a})},Ae=(e,t)=>{if(e)return"string"==typeof e?e:m(e,t)},ve=e=>{const{addNotification:t}=c(),r=(r,a,n,o,s)=>t({type:r,title:a,message:n,crdType:e,target:Ae(o,e),hideFromHistory:s});return{notify:r,notifyError:(e,t,a)=>r(u.Error,e,t,a),notifySuccess:(e,t,a)=>r(u.Success,e,t,a),notifyPending:(e,t)=>r(u.Default,"Pending",e,t,!0),notifyReadonly:()=>{t({type:u.Warning,title:d.READONLY,message:l.READONLY_WARNING,hideFromHistory:!0})}}},Re=e=>{e({type:u.Warning,title:d.READONLY,message:l.READONLY_WARNING,hideFromHistory:!0})},Ce=e=>({error:e,results:[],allSucceeded:!1,anySucceeded:!1,successCount:0,failureCount:0}),Ne=(e,t)=>{if(e)return"function"==typeof e?e(t):e},Oe=e=>{if(!e)return"Unknown error";if(e instanceof Error)return e.cause instanceof Error?e.cause.message:e.message;if("object"==typeof e){const t=e;return t.cause?.message||t.message||String(e)}return String(e)},De=(e,t)=>e.client??t,we=async(e,t,r,a,n)=>{if(!t)return{error:"Query operation not configured"};if(t.canRun&&!t.canRun(a))return{data:void 0};if(t.run)try{return await t.run(De(t,e),r,a)}catch(e){return{error:Oe(e)}}const o=Ne(t.document,a);if(!o)return{error:"Query operation not supported in this context"};const s=t.transformVariables?t.transformVariables(r,a):r,i=De(t,e);try{const e=await i.query({query:o,variables:s,fetchPolicy:n??"network-only"});return{data:t.transformResult?t.transformResult(e.data,a):e.data,error:e.error?Oe(e.error):void 0}}catch(e){return{error:Oe(e)}}},be=async(e,t,r,a)=>{if(!t)return{error:"Mutation operation not configured"};if(t.canRun&&!t.canRun(a))return{data:void 0};if(t.run)try{return await t.run(De(t,e),r,a)}catch(e){return{error:Oe(e)}}const n=Ne(t.document,a);if(!n)return{error:"Mutation operation not supported in this context"};const o=t.transformVariables?t.transformVariables(r,a):r,s=De(t,e);try{const e=await s.mutate({mutation:n,variables:o});return{data:t.transformResult?t.transformResult(e.data,a):e.data,error:void 0}}catch(e){return{error:Oe(e)}}},Pe=async(e,t,r,a,n)=>{if(!t)return Ce("Multi fetch operation not configured");if(!r.length)return Ce("No proxy ids supplied for multi fetch");const o=De(t,e);if(t.transformVariablesMulti&&(t.documentMulti||t.document)){const e=t.transformVariablesMulti(r,a,n),s=[];for(const r of e)try{const e=await o.query({query:r.document,variables:r.variables,fetchPolicy:"network-only"});t.transformMultiResult?t.transformMultiResult(e.data,n).forEach(e=>s.push(e)):r.proxyIDs.forEach(t=>{s.push({proxyID:t,success:!e.error,data:e.data,error:e.error?.message})})}catch(e){const t=Oe(e);r.proxyIDs.forEach(e=>s.push({proxyID:e,success:!1,error:t}))}const i=s.filter(e=>e.success).length,c=s.length-i,l=Array.from(new Set(s.filter(e=>!!e.error).map(e=>e.error)));return{results:s,allSucceeded:0===c,anySucceeded:i>0,successCount:i,failureCount:c,error:l.length?l.join(", "):void 0}}const s=await Promise.all(r.map(async r=>{const o={...n,proxyID:r},s=await we(e,t,a,o);return{proxyID:r,success:!s.error,data:s.data,error:s.error}})),i=s.filter(e=>e.success).length,c=s.length-i,l=Array.from(new Set(s.filter(e=>!!e.error).map(e=>e.error)));return{results:s,allSucceeded:0===c,anySucceeded:i>0,successCount:i,failureCount:c,error:l.length?l.join(", "):void 0}},Le=ye`
|
|
2
|
-
query OdigosApiNoop {
|
|
3
|
-
__typename
|
|
4
|
-
}
|
|
5
|
-
`,ke=(e,t)=>{if(e)return"function"==typeof e?e(t):e},Fe=(e,t)=>e[t],Ge=(e,t,r)=>{if(void 0!==t)return e?.transformResult?e.transformResult(t,r):t},Ue=(e,t,r)=>{if(!e)return;const a=e.transformVariables;return a?a(t,r):t},Me=(e,r,a)=>{const{operations:o,context:i}=Te(),c=Fe(o,e),l=t(()=>ke(c?.document,i),[c,i]),d=t(()=>Ue(c,r,i),[c,r,i]),u=!c||!l,m=!!c?.canRun&&!c.canRun(i),p=a?.skip||u||m,f=se(l??Le,{variables:d,skip:p,pollInterval:a?.pollInterval,fetchPolicy:a?.fetchPolicy??"cache-and-network",notifyOnNetworkStatusChange:a?.notifyOnNetworkStatusChange,client:c?.client}),E=t(()=>{if(!p)return Ge(c,f.data,i)},[c,i,f.data,p]);s(()=>{p||void 0===E||a?.onCompleted?.(E)},[p,E,a?.onCompleted]),s(()=>{f.error&&a?.onError?.(f.error)},[f.error,a?.onError]);const y=n(async()=>{if(u)return{data:void 0};const e=await f.refetch();return{data:Ge(c,e.data,i)}},[c,i,f,u]);return{data:E,loading:!p&&f.loading,error:f.error,refetch:y,unsupported:u}},xe=(e,r)=>{const{operations:a,context:o}=Te(),s=Fe(a,e),i=t(()=>ke(s?.document,o),[s,o]),c=!s||!i,[l,d]=ne(i??Le,{fetchPolicy:r?.fetchPolicy??"network-only",notifyOnNetworkStatusChange:r?.notifyOnNetworkStatusChange,client:s?.client});return{execute:n(async e=>{if(c)return{error:void 0};if(s?.canRun&&!s.canRun(o))return{data:void 0};const t=Ue(s,e,o),r=await l({variables:t});return r.error?{error:r.error}:{data:Ge(s,r.data,o)}},[s,o,l,c]),data:t(()=>Ge(s,d.data,o),[s,o,d.data]),loading:d.loading,error:d.error,called:d.called,unsupported:c}},He=(e,r)=>{const{operations:a,context:s}=Te(),i=oe(),c=Fe(a,e),l=t(()=>ke(c?.document,s),[c,s]),d=!c||!l,[u,m]=o({loading:!1,called:!1}),p=n(()=>m({loading:!1,called:!1}),[]);return[n(async e=>{if(d||!l)return{error:void 0};if(c?.canRun&&!c.canRun(s))return{data:void 0};const t=Ue(c,e,s),a=c?.client??i;m(e=>({...e,loading:!0,called:!0}));try{const e=await a.mutate({mutation:l,variables:t}),n=Ge(c,e.data,s);if(m({data:n,loading:!1,error:void 0,called:!0}),r?.refetchQueries){const e=a.refetchQueries({include:r.refetchQueries});r?.awaitRefetchQueries&&await e}return void 0!==n&&r?.onCompleted?.(n),{data:n}}catch(e){const t=e;return m({data:void 0,loading:!1,error:t,called:!0}),r?.onError?.(t),{error:t}}},[c,s,i,l,d,r]),{data:u.data,loading:u.loading,error:u.error,called:u.called,unsupported:d,reset:p}]},Ke=[],Ve=(e,t,r,a)=>{let n=!0;const o={sources:[]};for(const[s,i]of Object.entries(e)){if(!i.length)continue;n=!1;const e=i.map(({id:e,selected:t,currentStreamName:a})=>({namespace:e.namespace,name:e.name,kind:e.kind,selected:void 0!==t&&t,currentStreamName:a||r}));let c=0,l=0;for(const r of e){const e=t.find(e=>e.id.namespace===s&&e.id.name===r.name&&e.id.kind===r.kind),a=e?.dataStreamNames||[];r.selected&&!e?c++:!r.selected&&e&&a.length<=1&&l++}a(c,l),o.sources.push(...e)}return{payload:o,isEmpty:n}},We=(e,t)=>{let r=!0;const a={namespaces:[]};for(const[n,{selected:o,currentStreamName:s}]of Object.entries(e))"boolean"==typeof o&&(r=!1,a.namespaces.push({namespace:n,selected:o,currentStreamName:s||t}));return{payload:a,isEmpty:r}},Ye={filter:{markedForInstrumentation:!0}},$e=[],je=[],qe=[],Be=[],Qe=[],ze=e=>{if(e)return{clusters:[e],totalNamespaces:e.namespaces?.length??0,totalWorkloads:(e.namespaces??[]).reduce((e,t)=>e+(t.workloads?.length??0),0),lastUpdated:e.timestamp}},Je=[],Xe=[],Ze=(e,t)=>({...e,fields:e.fields.filter(({value:e})=>void 0!==e),currentStreamName:t}),et=[],tt=()=>{const{operations:e,context:r}=Te(),a=oe(),o=((e,t)=>{const r=oe(),{notifyError:a,notifySuccess:o,notifyPending:s,notifyReadonly:i}=ve(f.Source),{selectedStreamName:c}=y(),{setProgress:l,resetProgress:d}=h(),{setConfiguredSources:u,setConfiguredFutureApps:m}=S(),E=(e,t)=>{const{progress:r}=h.getState();e>0&&l(T.Instrumenting,{total:(r[T.Instrumenting]?.total||0)+e,current:r[T.Instrumenting]?.current||0}),t>0&&l(T.Uninstrumenting,{total:(r[T.Uninstrumenting]?.total||0)+t,current:r[T.Uninstrumenting]?.current||0})},_=n(async()=>{const{error:n}=await we(r,e.GET_WORKLOADS,Ye,t);n&&a(p.Read,n)},[r,e.GET_WORKLOADS,t,a]);return{useSources:()=>{const e=Me("GET_WORKLOADS",Ye,{fetchPolicy:"cache-first"});return{items:e.data?.workloads??$e,loading:e.loading,refetch:_}},fetchAll:_,fetchByTargets:async(n,o)=>{const s=!!o?.slim,i=n.map(e=>g(e,f.Source)).filter(e=>e.namespace&&e.name&&e.kind);if(0===i.length)return;if(i.length>50)return void await _();const c=s&&e.GET_WORKLOADS_BY_IDS_SLIM?e.GET_WORKLOADS_BY_IDS_SLIM:e.GET_WORKLOADS_BY_IDS,{error:l}=await we(r,c,{ids:i.map(({namespace:e,kind:t,name:r,region:a})=>({namespace:e,kind:t,name:r,region:a||void 0}))},t);l?a(p.Read,l):await _()},fetchById:async n=>{const{data:o,error:s}=await we(r,e.GET_WORKLOADS_BY_IDS,{ids:[{namespace:n.namespace,kind:n.kind,name:n.name,...n.region?{region:n.region}:{}}]},t);if(!s)return o?.workloadsByIds?.find(e=>e.id.namespace===n.namespace&&e.id.kind===n.kind&&e.id.name===n.name&&(e.id.region??"")===(n.region??""));a(p.Read,s)},fetchLibraries:async a=>we(r,e.GET_SOURCE_LIBRARIES,a,t),fetchPeerSources:async a=>we(r,e.GET_PEER_SOURCES,{serviceName:a},t),usePeerSources:(e,t)=>Me("GET_PEER_SOURCES",e,t),persist:async(n,o)=>{if(t.isReadonly)return i();const{data:l}=await we(r,e.GET_WORKLOADS,Ye,t,"cache-first"),f=l?.workloads??$e,{payload:y,isEmpty:h}=Ve(n,f,c,E),{payload:S,isEmpty:g}=We(o,c);let _=!1;h||(_=!0,s("Persisting sources...")),g||_||s("Persisting namespaces...");const{error:I}=await be(r,e.PERSIST_SOURCES,y,t);if(I&&(d(T.Instrumenting),d(T.Uninstrumenting),a(p.Update,I)),e.PERSIST_NAMESPACES){const{error:n}=await be(r,e.PERSIST_NAMESPACES,S,t);n&&a(p.Update,n)}u({}),m({})},persistV2:async a=>{if(t.isReadonly)return i(),{error:"readonly"};const n=[];for(const[,o]of Object.entries(a)){const a={sources:[]},s={namespaces:[]};for(const e of o)e.name&&e.kind?a.sources.push(e):s.namespaces.push(e);if(s.namespaces.length>0&&e.PERSIST_NAMESPACES){const{error:a}=await be(r,e.PERSIST_NAMESPACES,s,t);a&&n.push(a)}if(a.sources.length>0){const{error:o}=await be(r,e.PERSIST_SOURCES,a,t);o&&n.push(o)}}return n.length?{error:n.join(", ")}:void 0},update:async(n,l)=>{if(t.isReadonly)return i();s("Updating source...");const d={sourceId:n,patchSourceRequest:{...l,currentStreamName:c}},{data:u,error:m}=await be(r,e.UPDATE_SOURCE,d,t);m?a(p.Update,m,n):u?.updateK8sActualSource&&o(p.Update,`Successfully updated "${n.name}" source`,n)},restartWorkloads:async n=>{if(t.isReadonly)return i();s("Restarting sources...");const{data:c,error:l}=await be(r,e.RESTART_WORKLOADS,{sourceIds:n},t);l?a(p.Update,l):c?.restartWorkloads&&o(p.Update,`Successfully restarted ${n.length} sources`)},restartPod:async(n,c)=>{if(t.isReadonly)return i();s("Restarting pod...");const{data:l,error:d}=await be(r,e.RESTART_POD,{namespace:n,name:c},t);d?a(p.Update,d):l?.restartPod&&o(p.Update,`Successfully restarted pod ${n}/${c}`)},recoverFromRollback:async n=>{if(t.isReadonly)return i();s("Recovering from rollback...");const{data:c,error:l}=await be(r,e.RECOVER_FROM_ROLLBACK,{sourceId:n},t);l?a(p.Update,l,n):c?.recoverFromRollbackForWorkload&&o(p.Update,"Successfully triggered recovery from rollback")}}})(e,r),i=((e,t)=>{const r=oe(),{notifyError:a,notifySuccess:n,notifyReadonly:o}=ve(f.Destination),{selectedStreamName:s}=y(),i=async()=>{const{error:n}=await we(r,e.GET_DESTINATIONS,void 0,t);n&&a(p.Read,n)};return{useDestinations:()=>{const e=Me("GET_DESTINATIONS",void 0,{fetchPolicy:"cache-first"});return{items:e.data?.computePlatform?.destinations??e.data?.destinations??Xe,loading:e.loading,refetch:i}},useDestinationCategories:()=>{const e=Me("GET_DESTINATION_CATEGORIES",void 0);return{data:e.data,loading:e.loading}},usePotentialDestinations:()=>{const e=Me("GET_POTENTIAL_DESTINATIONS",void 0);return{data:e.data,loading:e.loading}},fetchAll:i,testConnection:async a=>{const{data:n}=await be(r,e.TEST_DESTINATION_CONNECTION,{destination:Ze(a,s)},t);return n},create:async c=>{if(t.isReadonly)return o();const{error:l}=await be(r,e.CREATE_DESTINATION,{destination:Ze(c,s)},t);l?a(p.Create,l):(n(p.Create,`Successfully created "${c.type}" destination`),await i())},update:async(c,l)=>{if(t.isReadonly)return o();const{data:d,error:u}=await be(r,e.UPDATE_DESTINATION,{id:c,destination:Ze(l,s)},t);u?a(p.Update,u,c):d?.updateDestination&&(n(p.Update,`Successfully updated "${l.type}" destination`,c),await i())},remove:async c=>{if(t.isReadonly)return o();const{data:l}=await we(r,e.GET_DESTINATIONS,void 0,t,"cache-first"),d=l?.computePlatform?.destinations??l?.destinations??Xe,u=d.find(e=>I(e)===c)?.destinationType?.type,{error:m}=await be(r,e.DELETE_DESTINATION,{id:c,currentStreamName:s},t);m?a(p.Delete,m,c):(n(p.Delete,`Successfully deleted "${u??c}" destination`,c),await i())}}})(e,r),l=((e,r)=>{const a=oe(),{notifyError:n,notifySuccess:o,notifyReadonly:s}=ve(f.Action),i=async()=>{const{error:t}=await we(a,e.GET_ACTIONS,void 0,r);t&&n(p.Read,t)};return{useActions:()=>{const e=Me("GET_ACTIONS",void 0,{fetchPolicy:"cache-first"});return{items:e.data?.computePlatform?.actions??e.data?.actions??je,loading:e.loading,refetch:i}},useActionTypes:()=>{const e=Me("GET_ACTION_TYPES",void 0,{fetchPolicy:"cache-first"});return{options:t(()=>_(e.data)||qe,[e.data]),loading:e.loading}},fetchAll:i,create:async t=>{if(r.isReadonly)return s();if(!e.CREATE_ACTION)return;const{error:c}=await be(a,e.CREATE_ACTION,{action:t},r);c?n(p.Create,c):(o(p.Create,`Successfully created "${t.type}" action`),await i())},update:async(t,c)=>{if(r.isReadonly)return s();if(!e.UPDATE_ACTION)return;const{error:l}=await be(a,e.UPDATE_ACTION,{id:t,action:c},r);l?n(p.Update,l,t):(o(p.Update,`Successfully updated "${c.type}" action`,t),await i())},remove:async(t,c)=>{if(r.isReadonly)return s();if(!e.DELETE_ACTION)return;const{error:l}=await be(a,e.DELETE_ACTION,{id:t,actionType:c},r);l?n(p.Delete,l,t):(o(p.Delete,`Successfully deleted "${c}" action`,t),await i())}}})(e,r),d=((e,r)=>{const a=oe(),{notifyError:n,notifySuccess:o,notifyReadonly:s}=ve(f.InstrumentationRule),i=async()=>{const{error:t}=await we(a,e.GET_INSTRUMENTATION_RULES,void 0,r);t&&n(p.Read,t)};return{useRules:()=>{const e=Me("GET_INSTRUMENTATION_RULES",void 0,{fetchPolicy:"cache-first"});return{items:t(()=>(e.data?.computePlatform?.instrumentationRules??e.data?.instrumentationRules??[]).map(R),[e.data]),loading:e.loading,refetch:i}},useRuleTypes:()=>{const e=Me("GET_INSTRUMENTATION_RULE_TYPES",void 0,{fetchPolicy:"cache-first"});return{options:t(()=>v(e.data)||et,[e.data]),loading:e.loading}},fetchAll:i,create:async(t,c)=>{if(r.isReadonly)return s();if(!e.CREATE_INSTRUMENTATION_RULE)return;const{error:l}=await be(a,e.CREATE_INSTRUMENTATION_RULE,{instrumentationRule:A(t)},r);l?n(p.Create,l):(o(p.Create,`Successfully created${c?` "${c}"`:""} rule`),await i())},update:async(t,c,l)=>{if(r.isReadonly)return s();if(!e.UPDATE_INSTRUMENTATION_RULE)return;const{error:d}=await be(a,e.UPDATE_INSTRUMENTATION_RULE,{ruleId:t,instrumentationRule:A(c)},r);d?n(p.Update,d,t):(o(p.Update,`Successfully updated${l?` "${l}"`:""} rule`,t),await i())},remove:async(t,c)=>{if(r.isReadonly)return s();if(!e.DELETE_INSTRUMENTATION_RULE)return;const{error:l}=await be(a,e.DELETE_INSTRUMENTATION_RULE,{ruleId:t},r);l?n(p.Delete,l,t):(o(p.Delete,`Successfully deleted${c?` "${c}"`:""} rule`,t),await i())}}})(e,r),m=((e,t)=>{const r=oe(),{addNotification:a}=c(),{setDataStreams:n}=y(),o=(e,t)=>a({type:u.Error,title:e,message:t}),i=async()=>{const{data:a,error:s}=await we(r,e.GET_DATA_STREAMS,void 0,t);if(s)o(p.Read,s);else if(a){const e=a.computePlatform?.dataStreams??a.dataStreams??[];n(e)}},l=e.CREATE_DATA_STREAM?async n=>{if(t.isReadonly)return Re(a);const{error:s}=await be(r,e.CREATE_DATA_STREAM,{stream:n},t);s?o(p.Create,s):await i()}:void 0;return{useDataStreams:()=>{const e=Me("GET_DATA_STREAMS",void 0,{fetchPolicy:"cache-first"}),t=e.data?.computePlatform?.dataStreams??e.data?.dataStreams??Je;return s(()=>{n(t)},[JSON.stringify(t.map(e=>e.name))]),{items:t,loading:e.loading,refetch:i}},fetchAll:i,create:l,update:async(n,s)=>{if(t.isReadonly)return Re(a);const{error:c}=await be(r,e.UPDATE_DATA_STREAM,{id:n,dataStream:s},t);c?o(p.Update,c):await i()},remove:async n=>{if(t.isReadonly)return Re(a);const{error:s}=await be(r,e.DELETE_DATA_STREAM,{id:n},t);s?o(p.Delete,s):await i()}}})(e,r),C=((e,t)=>{const r=oe(),{notifyError:a,notifyReadonly:n}=ve(f.Namespace),o=async()=>{const n=await we(r,e.GET_NAMESPACES_WITH_WORKLOADS,void 0,t);return n.error&&a(p.Read,n.error),n};return{useNamespaces:()=>{const e=Me("GET_NAMESPACES_WITH_WORKLOADS",void 0,{fetchPolicy:"cache-and-network"});return{items:e.data?.namespaces??Qe,loading:e.loading,refetch:o}},fetchAll:o,persist:async o=>{if(t.isReadonly)return n();const{error:s}=await be(r,e.PERSIST_NAMESPACES,o,t);return s&&a(p.Update,s),s?{error:s}:void 0}}})(e,r),N=((e,t)=>{const r=oe(),{notifyError:a}=ve(f.Source);return{fetch:async n=>{const o=await we(r,e.GET_K8S_MANIFEST,n,t);return o.error&&a(p.Read,o.error),o}}})(e,r),O=((e,t)=>{const r=oe(),{notifyError:a,notifySuccess:n,notifyReadonly:o}=ve(f.Source);return{useEffectiveConfig:(e,t)=>Me("GET_EFFECTIVE_CONFIG",e,t),useConfigYamls:e=>Me("GET_CONFIG_YAMLS",void 0,e),getEffectiveConfig:async a=>e.GET_EFFECTIVE_CONFIG?we(r,e.GET_EFFECTIVE_CONFIG,{id:a},t):{error:"GET_EFFECTIVE_CONFIG not configured"},applyConfigurations:e.UPDATE_REMOTE_CONFIG?async(n,s)=>{if(t.isReadonly)return o();const{error:i}=await be(r,e.UPDATE_REMOTE_CONFIG,{formData:n,connectionIds:s},t);return i&&a(p.Update,i),i?{error:i}:void 0}:void 0,getConfigYamls:e.GET_CONFIG_YAMLS?async()=>we(r,e.GET_CONFIG_YAMLS,void 0,t):void 0,updateLocalUiConfig:e.UPDATE_LOCAL_UI_CONFIG?async s=>{if(t.isReadonly)return o();const{error:i}=await be(r,e.UPDATE_LOCAL_UI_CONFIG,{config:s},t);return i?a(p.Update,i):n(p.Update,"Local UI configuration updated successfully"),i?{error:i}:void 0}:void 0,resetLocalUiConfigToDefaults:e.RESET_LOCAL_UI_CONFIG_TO_FACTORY_DEFAULTS?async()=>{if(t.isReadonly)return o();const{error:s}=await be(r,e.RESET_LOCAL_UI_CONFIG_TO_FACTORY_DEFAULTS,void 0,t);return s?a(p.Update,s):n(p.Update,"Local UI configuration reset to factory defaults"),s?{error:s}:void 0}:void 0}})(e,r),D=((e,t)=>{const r=oe(),{apolloConfig:a}=Te();return{fetchDescribeOdigos:e.GET_DESCRIBE_ODIGOS?async()=>we(r,e.GET_DESCRIBE_ODIGOS,void 0,t):void 0,fetchDescribeSource:e.GET_DESCRIBE_SOURCE?async a=>we(r,e.GET_DESCRIBE_SOURCE,a,t):void 0,downloadDiagnose:e.GET_DIAGNOSE?async(n,o)=>{const s=await we(r,e.GET_DIAGNOSE,{input:n,dryRun:o?.dryRun??!1},t),i=s?.data?.stats?.fileCount??0;return!s.error&&i>0&&!o?.dryRun&&await(async e=>{const t=(e=>{try{return new URL("/diagnose/download",e).toString()}catch{return null}})(e.httpUrl);if(t)try{const[r,a]=await Promise.all([Promise.resolve(e.authHeader?.()??{}),Promise.resolve(e.csrfHeader?.()??{})]),n=await fetch(t,{credentials:e.credentials??"same-origin",headers:{...r,...a}});if(!n.ok)throw new Error(`Failed to download diagnose archive: ${n.status} ${n.statusText}`);((e,t)=>{if("undefined"==typeof document)return;const r=URL.createObjectURL(e),a=document.createElement("a");a.href=r,a.download=t,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(r)})(await n.blob(),`odigos-diagnose-${Date.now()}.tar.gz`)}catch(e){}})(a),s}:void 0}})(e,r),w=((e,t)=>{const r=oe(),{notifyError:a,notifyReadonly:n}=ve(f.Source),o=async()=>{e.GET_TOKENS&&await we(r,e.GET_TOKENS,void 0,t)};return{useTokens:()=>{const e=Me("GET_TOKENS",void 0,{fetchPolicy:"cache-first"});return{items:e.data??Ke,loading:e.loading,refetch:o}},updateToken:e.UPDATE_TOKEN?async o=>{if(t.isReadonly)return n();const{error:s}=await be(r,e.UPDATE_TOKEN,{token:o},t);return s&&a(p.Update,s),s?{error:s}:void 0}:void 0}})(e,r),b=((e,t)=>{const r=oe();return{useMetrics:e=>Me("GET_METRICS",void 0,e),fetch:async()=>we(r,e.GET_METRICS,void 0,t)}})(e,r),P=((e,t)=>{const r=oe();return{useServiceMap:e=>Me("GET_SERVICE_MAP",void 0,e),fetch:e.GET_SERVICE_MAP?async()=>we(r,e.GET_SERVICE_MAP,void 0,t):void 0}})(e,r),L=((e,t)=>{const r=oe();return{useSlots:e=>Me("GET_PROFILING_SLOTS",void 0,e),useSourceProfiling:(e,t)=>Me("GET_SOURCE_PROFILING",e,t),fetchSlots:e.GET_PROFILING_SLOTS?async()=>we(r,e.GET_PROFILING_SLOTS,void 0,t):void 0,fetchSourceProfiling:e.GET_SOURCE_PROFILING?async a=>we(r,e.GET_SOURCE_PROFILING,a,t):void 0,enableProfiling:e.ENABLE_SOURCE_PROFILING?async a=>be(r,e.ENABLE_SOURCE_PROFILING,a,t):void 0}})(e,r),k=((e,t)=>{const r=oe();return{useGatewayInfo:e=>Me("GET_GATEWAY_INFO",void 0,e),useGatewayPods:e=>Me("GET_GATEWAY_PODS",void 0,e),useNodeCollectorInfo:e=>Me("GET_NODE_COLLECTOR_INFO",void 0,e),useNodeCollectorPods:e=>Me("GET_NODE_COLLECTOR_PODS",void 0,e),usePodInfo:(e,t)=>Me("GET_COLLECTOR_POD_INFO",e,t),getGatewayInfo:e.GET_GATEWAY_INFO?async()=>we(r,e.GET_GATEWAY_INFO,void 0,t):void 0,getGatewayPods:e.GET_GATEWAY_PODS?async()=>we(r,e.GET_GATEWAY_PODS,void 0,t):void 0,getNodeCollectorInfo:e.GET_NODE_COLLECTOR_INFO?async()=>we(r,e.GET_NODE_COLLECTOR_INFO,void 0,t):void 0,getNodeCollectorPods:e.GET_NODE_COLLECTOR_PODS?async()=>we(r,e.GET_NODE_COLLECTOR_PODS,void 0,t):void 0,getExtendedPodInfo:e.GET_COLLECTOR_POD_INFO?async(a,n)=>we(r,e.GET_COLLECTOR_POD_INFO,{namespace:a,name:n},t):void 0}})(e,r),F=((e,t)=>{const r=oe(),{notifyError:a,notifySuccess:n,notifyReadonly:o}=ve(f.SamplingRule),s=async()=>{e.GET_SAMPLING_RULES&&await we(r,e.GET_SAMPLING_RULES,void 0,t)},i=(e,i)=>e?async c=>{if(t.isReadonly)return o();const{error:l}=await be(r,e,c,t);return l?a(i,l):(n(p.Create,"Successfully created sampling rule"),await s()),l?{error:l}:void 0}:void 0,c=(e,i)=>e?async(c,l)=>{if(t.isReadonly)return o();const{error:d}=await be(r,e,{samplingId:l.samplingId,ruleId:c,rule:l.rule},t);return d?a(i,d):(n(p.Update,"Successfully updated sampling rule"),await s()),d?{error:d}:void 0}:void 0,l=e=>e?async(i,c)=>{if(t.isReadonly)return o();const{error:l}=await be(r,e,{samplingId:c,ruleId:i},t);return l?a(p.Delete,l):(n(p.Delete,"Successfully deleted sampling rule"),await s()),l?{error:l}:void 0}:void 0;return{useSamplingRules:()=>{const e=Me("GET_SAMPLING_RULES",void 0,{fetchPolicy:"cache-first"});return{items:e.data?.computePlatform?.samplingRules??e.data?.samplingRules??Be,k8sHealthProbesConfig:e.data?.computePlatform?.k8sHealthProbesConfig??e.data?.k8sHealthProbesConfig??null,loading:e.loading,refetch:s}},fetchAll:e.GET_SAMPLING_RULES?async()=>we(r,e.GET_SAMPLING_RULES,void 0,t):void 0,createNoisy:i(e.CREATE_NOISY_OPERATION_RULE,p.Create),updateNoisy:c(e.UPDATE_NOISY_OPERATION_RULE,p.Update),deleteNoisy:l(e.DELETE_NOISY_OPERATION_RULE),createHighlyRelevant:i(e.CREATE_HIGHLY_RELEVANT_OPERATION_RULE,p.Create),updateHighlyRelevant:c(e.UPDATE_HIGHLY_RELEVANT_OPERATION_RULE,p.Update),deleteHighlyRelevant:l(e.DELETE_HIGHLY_RELEVANT_OPERATION_RULE),createCostReduction:i(e.CREATE_COST_REDUCTION_RULE,p.Create),updateCostReduction:c(e.UPDATE_COST_REDUCTION_RULE,p.Update),deleteCostReduction:l(e.DELETE_COST_REDUCTION_RULE),updateK8sHealthProbesConfig:e.UPDATE_LOCAL_UI_SAMPLING_CONFIG?async n=>{if(t.isReadonly)return o();const{error:i}=await be(r,e.UPDATE_LOCAL_UI_SAMPLING_CONFIG,{config:{k8sHealthProbesSampling:n}},t);return i?a(p.Update,i):await s(),i?{error:i}:void 0}:void 0}})(e,r),G=((e,r)=>{const a=oe();return{useSnapshots:()=>{const e=r.proxyID,a=!!e,o=Me("GET_ALL_CLUSTER_SNAPSHOTS",void 0,{fetchPolicy:"cache-and-network",skip:a}),s=Me("GET_CLUSTER_SNAPSHOT",e?{clusterId:e}:void 0,{fetchPolicy:"cache-and-network",skip:!a}),i=t(()=>a?ze(s.data):o.data,[a,s.data,o.data]),c=n(async()=>{if(!a)return o.refetch();const{data:e}=await s.refetch();return{data:ze(e)}},[a,o.refetch,s.refetch]);return{data:i,loading:a?s.loading:o.loading,unsupported:a?s.unsupported:o.unsupported,refetch:c}},getAllClusterSnapshots:e.GET_ALL_CLUSTER_SNAPSHOTS?async()=>we(a,e.GET_ALL_CLUSTER_SNAPSHOTS,void 0,r):void 0,getClusterSnapshot:e.GET_CLUSTER_SNAPSHOT?async t=>we(a,e.GET_CLUSTER_SNAPSHOT,{clusterId:t},r):void 0}})(e,r);return{sourcesApi:o,destinationsApi:i,actionsApi:l,instrumentationRulesApi:d,dataStreamsApi:m,namespacesApi:C,k8sManifestApi:N,configApi:O,describeApi:D,tokensApi:w,metricsApi:b,serviceMapApi:P,profilingApi:L,collectorsApi:k,samplingApi:F,snapshotsApi:G,capabilities:t(()=>((e,t)=>{const r=t.platformType===E.K8s,a=r,n=r,o=!(t.platformType===E.Vm);return{canBulkPersistSources:o&&!!e.PERSIST_SOURCES,canInstrumentNamespaces:n&&!!e.PERSIST_NAMESPACES,canFetchSnapshots:a&&!!e.GET_ALL_CLUSTER_SNAPSHOTS,canRecoverFromRollback:a&&!!e.RECOVER_FROM_ROLLBACK,canRestartWorkloads:a&&!!e.RESTART_WORKLOADS,canFetchPeerSources:!!e.GET_PEER_SOURCES,canFetchSourceLibraries:!!e.GET_SOURCE_LIBRARIES,canFetchK8sManifest:a&&!!e.GET_K8S_MANIFEST,canCreateDestination:!!e.CREATE_DESTINATION,canTestConnection:o&&!!e.TEST_DESTINATION_CONNECTION,canFetchDestinationCategories:!!e.GET_DESTINATION_CATEGORIES,canFetchPotentialDestinations:o&&!!e.GET_POTENTIAL_DESTINATIONS,canCreateAction:!!e.CREATE_ACTION,canFetchActionTypes:!!e.GET_ACTION_TYPES,canCreateInstrumentationRule:!!e.CREATE_INSTRUMENTATION_RULE,canFetchInstrumentationRuleTypes:!!e.GET_INSTRUMENTATION_RULE_TYPES,canApplyEffectiveConfig:o&&!!e.UPDATE_REMOTE_CONFIG&&!!e.GET_EFFECTIVE_CONFIG,canFetchEffectiveConfig:!!e.GET_EFFECTIVE_CONFIG,canFetchConfigYamls:!!e.GET_CONFIG_YAMLS,canFetchProfiling:a&&!!e.GET_PROFILING_SLOTS,canFetchCollectorInfo:a&&!!e.GET_GATEWAY_INFO,canManageSamplingRules:!!e.GET_SAMPLING_RULES}})(e,r),[e,r]),resetCache:n(async()=>{await a.cache.reset()},[a])}},rt={type:"",disabled:!1,name:"",notes:"",signals:[],fields:{}},at=a(null),nt=(e,t)=>{const r=N(e??{}),a=r[D.ExtractAttribute];a?.extractions?.length&&(a.extractions=a.extractions.map(e=>{const t=e;return{...t,method:t.method||(t.regex?.trim()?"regex":"preset")}}));const n=new Set((t?.fields||[]).filter(e=>e.componentType===w.SourceScopes).map(e=>e.name));return void 0!==r[D.Scopes]&&n.add(D.Scopes),n.forEach(e=>{const t=e;r[t]=Q(r[t])}),r},ot="All row fields are required",st="At least one row is required",it=(e,t)=>!!e&&t.every(t=>{const r=e[t];return Array.isArray(r)?r.length>0:!("string"==typeof(a=r)?!a.trim():P(a));var a}),ct=({children:r,sourceOptions:a=[],namespaceOptions:s=[]})=>{const[i,c]=o(null),d=C(rt),u=n(e=>{d.resetFormData(),d.handleErrorChange(void 0,void 0,{}),e?.type&&d.handleFormChange("type",e.type),c(e)},[]),m=n((e,t)=>{const r=t??(a=e.type,O.find(e=>e.type===a)??null);var a;d.resetFormData((({type:e,name:t,notes:r,disabled:a,signals:n,fields:o},s)=>({type:e,name:t||"",notes:r||"",disabled:!!a,signals:n??[],fields:nt(o,s)}))(e,r)),d.handleErrorChange(void 0,void 0,{}),c(r)},[]),p=n(()=>{if(!i)return{errorMessage:"No action type selected",preparedFormData:N(rt)};const e=((e,t)=>{const r=N(e),a=r.fields||{},n=a[D.UrlTemplatizationRulesGroups];n?.length&&(a[D.UrlTemplatizationRulesGroups]=n.map(e=>({...e,templatizationRules:(e.templatizationRules||[]).filter(e=>!!e.template?.trim())})));const o=a[D.AttributeNamesToDelete];o?.length&&(a[D.AttributeNamesToDelete]=o.filter(e=>!!e?.trim()));const s=a[D.Renames];if(s){const e=Array.isArray(s)?s.map(e=>[e?.key??"",e?.value??""]):Object.entries(s);a[D.Renames]=Object.fromEntries(e.filter(([e,t])=>!!e?.trim()&&!!t?.trim()))}const i=new Set((t?.fields||[]).filter(e=>e.componentType===w.SourceScopes).map(e=>e.name));void 0!==a[D.Scopes]&&i.add(D.Scopes),i.forEach(e=>{const t=a[e];void 0!==t&&(a[e]=B(t)?null:t)});const c=a[D.ExtractAttribute];return c?.extractions?.length&&(a[D.ExtractAttribute]={extractions:c.extractions.map(e=>{const t=e,r=t.method||(t.regex?.trim()?"regex":"preset"),a=t.targetAttributeName?.trim()||"";if("regex"===r)return{targetAttributeName:a,lookupKey:"",regex:t.regex?.trim()||""};const n={targetAttributeName:a,lookupKey:t.lookupKey?.trim()||"",regex:""};return t.dataFormat&&(n.dataFormat=t.dataFormat),n}).filter(e=>!!(e.targetAttributeName||e.lookupKey||e.dataFormat||e.regex))}),r.fields=a,r})(d.formData,i),t={};return P(e.signals)&&(t.signals=l.FIELD_IS_REQUIRED),i.type&&Object.assign(t,((e,t,r)=>{const a={},n=t.fields||{},o=r.fields||{};switch(e){case b.K8sAttributes:{const e=!(n[D.CollectContainerAttributes]||n[D.CollectReplicaSetAttributes]||n[D.CollectWorkloadId]||n[D.CollectClusterId]),t=!n[D.LabelsAttributes]?.length,r=!n[D.AnnotationsAttributes]?.length;e&&t&&r&&(a[D.CollectContainerAttributes]="Enable at least one option or add a label/annotation row");const o=n[D.LabelsAttributes];o?.some(e=>!it(e,["labelKey","attributeKey","fromSources"]))&&(a[D.LabelsAttributes]=ot);const s=n[D.AnnotationsAttributes];s?.some(e=>!it(e,["annotationKey","attributeKey","fromSources"]))&&(a[D.AnnotationsAttributes]=ot);break}case b.AddClusterInfo:{const e=n[D.ClusterAttributes];e?.length?e.some(e=>!it(e,["attributeName","attributeStringValue"]))&&(a[D.ClusterAttributes]=ot):a[D.ClusterAttributes]=st;break}case b.DeleteAttributes:{const e=o[D.AttributeNamesToDelete]||[],t=n[D.AttributeNamesToDelete]||[];t.length?e.length>t.length&&(a[D.AttributeNamesToDelete]=ot):a[D.AttributeNamesToDelete]=e.length?ot:st;break}case b.RenameAttributes:{const e=Object.entries(o[D.Renames]||{}),t=Object.entries(n[D.Renames]||{}),r=e.some(([e,t])=>!e?.trim()||!t?.trim());t.length?r&&(a[D.Renames]=ot):a[D.Renames]=e.length?ot:st;break}case b.PiiMasking:{const e=n[D.PiiCategories];e?.length||(a[D.PiiCategories]="Select at least one attribute to mask");break}case b.URLTemplatization:{const e=n[D.UrlTemplatizationRulesGroups];(!e?.length||e.some(e=>!e.templatizationRules?.length))&&(a[D.UrlTemplatizationRulesGroups]="Each rule group needs at least one non-blank template");break}case b.ExtractAttribute:{const e=n[D.ExtractAttribute]?.extractions||[],t=o[D.ExtractAttribute]?.extractions||[];if(e.length)if(e.some(e=>{if(!e.targetAttributeName?.trim())return!0;const t=!!e.regex?.trim(),r=!!e.lookupKey?.trim();return r!==!!e.dataFormat||t===r}))a[D.ExtractAttribute]="Each row needs a target attribute name and either a regex or both lookup key and data format";else{const t=new Set;e.some(e=>{const r=e.targetAttributeName?.trim()||"";return!!t.has(r)||(t.add(r),!1)})&&(a[D.ExtractAttribute]="Each new span attribute name must be unique")}else a[D.ExtractAttribute]=t.length?ot:st;break}}return a})(i.type,e,d.formData)),d.handleErrorChange(void 0,void 0,t),{errorMessage:Object.keys(t).length>0?"Invalid form values":void 0,preparedFormData:e}},[d,i]),f=t(()=>({selectedOption:i,onSelectOption:u,loadAction:m,genericForm:d,validateFormData:p,sourceOptions:a,namespaceOptions:s}),[i,u,m,d,p,a,s]);return e(at.Provider,{value:f,children:r})},lt=()=>{const e=r(at);if(!e)throw new Error("useActionFormContext must be used within an ActionFormContextProvider");return e},dt={provider:"",permission:"",customCapabilities:{},authMethod:"",setupMethod:"",awsAccountId:"",credentials:{},accessToken:"",secretId:"",name:""},ut=a(null),mt=({children:r,providers:a=[]})=>{const o=C(dt),s=n(()=>{const e=N(o.formData);return e.provider?e.permission?{errorMessage:void 0,preparedFormData:e}:{errorMessage:"Please select a permission level",preparedFormData:e}:{errorMessage:"Please select a provider",preparedFormData:e}},[o]),i=t(()=>({providers:a,genericForm:o,validateFormData:s}),[a,o,s]);return e(ut.Provider,{value:i,children:r})},pt=()=>{const e=r(ut);if(!e)throw new Error("useCloudConnectorFormContext must be used within a CloudConnectorFormContextProvider");return e},ft={name:""},Et=a(null),yt=({children:r,defaultExcludeName:a=""})=>{const{dataStreams:s}=y(),[c,d]=o(void 0),[u,m]=o(a),[p,f]=o(void 0),[E,h]=o(null),S=i(null),T=C(ft),g=n(e=>{T.resetFormData({name:e}),T.handleErrorChange(void 0,void 0,{}),d(void 0),m(e),f(e),h(null),S.current=null},[]),_=n(()=>{const e=N(T.formData),t=(e=>{const t={};return e.name?L(e.name)||(t.name=l.ILLEGAL_K8S_LABEL):t.name=l.FIELD_IS_REQUIRED,t})(e);T.handleErrorChange(void 0,void 0,t);const r=Object.keys(t).length>0?l.REQUIRED_FIELDS:void 0;return d(r),{errorMessage:r,preparedFormData:e}},[T]),I=n(async e=>{const{errorMessage:t,preparedFormData:r}=_();if(t)return;const a=s.find(e=>e.name===r.name&&e.name!==u);if(a)return S.current=e,void h({preparedFormData:r,existingName:a.name,editingName:p});await e(r)},[_,s,u,p]),A=n(async()=>{const e=S.current,t=E?.preparedFormData;S.current=null,h(null),e&&t&&await e(t)},[E]),v=n(()=>{S.current=null,h(null)},[]),R=t(()=>({genericForm:T,loadDataStream:g,editingName:p,validateFormData:_,requestSubmit:I,pendingMerge:E,confirmMerge:A,cancelMerge:v,errorMessage:c,excludeName:u,setExcludeName:m}),[T,g,p,_,I,E,A,v,c,u]);return e(Et.Provider,{value:R,children:r})},ht=()=>{const e=r(Et);if(!e)throw new Error("useDataStreamFormContext must be used within a DataStreamFormContextProvider");return e},St={type:"",name:"",currentStreamName:"",disabled:!1,exportedSignals:{logs:!1,metrics:!1,traces:!1,profiles:!1},fields:[]},Tt={activeForm:null,onChangeActiveForm:()=>{},loadDestination:()=>{},genericForm:void 0,validateFormData:()=>({isOk:!1,preparedFormData:N(St)}),unsavedDestinations:[],thisUnsavedDestination:void 0,setUnsavedDestinations:()=>{},addUnsavedDestination:()=>{},updateUnsavedDestination:()=>{},deleteUnsavedDestination:()=>{}},gt=a(Tt),_t=e=>e.filter(e=>!!e).map(e=>{const{name:t,componentType:r,componentProperties:a,displayName:n,initialValue:o,renderCondition:s}=e,i=r===w.Dropdown,c=U(a,{});return{componentType:r,renderCondition:s,name:t,title:n,value:o,placeholder:c.placeholder||(i?"Select an option":void 0),options:i&&Array.isArray(c.values)?c.values.map(e=>({id:e,label:e})):void 0,...c}}),It=({children:r})=>{const{selectedStreamName:a}=y(),{items:i}=tt().destinationsApi.useDestinations(),[c,d]=o(null),[u,m]=o(Tt.unsavedDestinations),p=t(()=>"number"==typeof c?.unsavedIdx?u[c.unsavedIdx]:void 0,[c,u]),f=n((e,t)=>{c&&(m(t=>[...t,{...e,option:c.option}]),d(t?e=>e?{...e,listType:k.UNSAVED,unsavedIdx:u.length}:null:null))},[c,u.length]),E=n((e,t,r)=>{c&&(m(r=>r.map((r,a)=>a===e?{...r,...t,option:c.option}:r)),d(r?e=>e?{...e,listType:k.UNSAVED}:null:null))},[c]),h=n(e=>{m(t=>t.filter((t,r)=>r!==e)),d(null)},[]),S=C({...St,currentStreamName:a});s(()=>{if(!c)return;if(p)return void S.resetFormData({...p.formData});if(c.listType===k.EXISTS&&c.option.id){const e=i.find(e=>e.id===c.option.id);if(e)return void S.resetFormData({type:e.destinationType.type,name:e.name||e.destinationType.displayName,currentStreamName:a,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=F(c.option.supportedSignals);S.resetFormData({type:c.option.type,name:c.option.displayName,currentStreamName:a,disabled:!1,exportedSignals:{logs:e.includes(G.Logs),metrics:e.includes(G.Metrics),traces:e.includes(G.Traces),profiles:e.includes(G.Profiles)},fields:c.dynamicFields.map(e=>({key:e.name,value:e.value}))})},[c,p]);const T=n(e=>{S.resetFormData(),S.handleErrorChange(void 0,void 0,{}),d(e?{...e,dynamicFields:e.option?.fields?_t(e.option.fields):[]}:null)},[]),g=n((e,t)=>{let r;for(const a of t){const t=a.items.find(t=>t.type===e.destinationType.type);if(t){r=t;break}}const a=U(e.fields,{}),n={id:e.id,type:e.destinationType.type,displayName:e.name||e.destinationType.displayName,selected:!0,testConnectionSupported:r?.testConnectionSupported??!1,supportedSignals:e.destinationType.supportedSignals,fields:r?r.fields.map(e=>({...e,initialValue:a[e.name]??e.initialValue})):[]},o=_t(n.fields);d({listType:k.EXISTS,option:n,dynamicFields:o})},[]),_=n(()=>{const e=N(S.formData),t={};return c?.dynamicFields.forEach(({name:r,required:a})=>{if(a){const a=e.fields.find(e=>e.key===r)?.value;P(a)&&(t[r]=l.FIELD_IS_REQUIRED)}}),M(e.exportedSignals).length||(t.exportedSignals=l.FIELD_IS_REQUIRED),S.handleErrorChange(void 0,void 0,t),{errorMessage:0===Object.keys(t).length?void 0:"Invalid form values",preparedFormData:e}},[S,c]);return e(gt.Provider,{value:{activeForm:c,onChangeActiveForm:T,loadDestination:g,genericForm:S,validateFormData:_,unsavedDestinations:u,thisUnsavedDestination:p,setUnsavedDestinations:m,addUnsavedDestination:f,updateUnsavedDestination:E,deleteUnsavedDestination:h},children:r})},At=()=>r(gt),vt={disabled:!1,ruleName:"",notes:"",sourceScopes:z(),workloads:null,instrumentationLibraries:null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:null,networkMetrics:null},Rt=a(null),Ct=({children:r,sourceOptions:a=[],namespaceOptions:s=[]})=>{const[i,c]=o(null),l=C(vt),d=n(e=>{l.resetFormData(),l.handleErrorChange(void 0,void 0,{}),c(e)},[]),u=n((e,t)=>{var r;l.resetFormData((({ruleName:e,notes:t,disabled:r,sourceScopes:a,instrumentationLibraries:n,payloadCollection:o,codeAttributes:s,headersCollection:i,customInstrumentations:c,networkMetrics:l})=>({ruleName:e||"",notes:t||"",disabled:!!r,sourceScopes:Q(a),workloads:null,instrumentationLibraries:n??null,payloadCollection:o??null,codeAttributes:s??null,headersCollection:i??null,customInstrumentations:c??null,networkMetrics:l??null}))(e)),l.handleErrorChange(void 0,void 0,{}),c(t??(r=e.type,x.find(e=>e.type===r)??null))},[]),m=n(()=>{if(!i)return{errorMessage:"No rule type selected",preparedFormData:N(vt)};const e=(e=>{const t=N(e),r={...t,sourceScopes:B(t.sourceScopes)?null:t.sourceScopes,workloads:null};return r.headersCollection?.[H.HeaderKeys]?.length&&(r.headersCollection[H.HeaderKeys]=r.headersCollection[H.HeaderKeys].map(e=>e.trim()).filter(e=>e)),r.customInstrumentations?.[K.Golang]?.length&&(r.customInstrumentations[K.Golang]=r.customInstrumentations[K.Golang].map(e=>new V(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})),r.customInstrumentations?.[K.Java]?.length&&(r.customInstrumentations[K.Java]=r.customInstrumentations[K.Java].map(e=>new W(e.className,e.methodName)).filter(e=>{return t=e,!(!t.className?.trim()&&!t.methodName?.trim());var t})),r.customInstrumentations?.[K.Php]?.length&&(r.customInstrumentations[K.Php]=r.customInstrumentations[K.Php].map(e=>new Y(e.className,e.functionName)).filter(e=>{return t=e,!(!t.className?.trim()&&!t.functionName?.trim());var t})),r})(l.formData),t=((e,t)=>{const r={};switch(e){case $.CodeAttributes:Object.values(t.codeAttributes||{}).some(e=>null!=e)||(r.codeAttributes="Code attributes are required");break;case $.PayloadCollection:Object.values(t.payloadCollection||{}).some(e=>null!=e)||(r.payloadCollection="Payload collection are required");break;case $.HeadersCollection:t.headersCollection?.[H.HeaderKeys]?.length||(r.headersCollection="Header keys are required");break;case $.CustomInstrumentation:{const e=t.customInstrumentations?.[K.Golang]||[],a=t.customInstrumentations?.[K.Java]||[],n=t.customInstrumentations?.[K.Php]||[];if(!e.length&&!a.length&&!n.length){r.customInstrumentations="Custom instrumentation are required";break}const o=e.findIndex(e=>!new V(e.packageName,e.functionName,e.receiverName,e.receiverMethodName).Verify());if(-1!==o){r.customInstrumentations=`Golang probe #${o+1} is invalid: provide a package name plus either a function name OR both a receiver name and receiver method name`;break}const s=a.findIndex(e=>!new W(e.className,e.methodName).Verify());if(-1!==s){r.customInstrumentations=`Java probe #${s+1} is invalid: both class name and method name are required`;break}const i=n.findIndex(e=>!new Y(e.className,e.functionName).Verify());if(-1!==i){r.customInstrumentations=`PHP probe #${i+1} is invalid: function name is required`;break}break}}return r})(i.type,e);return l.handleErrorChange(void 0,void 0,t),{errorMessage:Object.keys(t).length>0?"Invalid form values":void 0,preparedFormData:e}},[l,i]),p=t(()=>({selectedOption:i,onSelectOption:d,loadRule:u,genericForm:l,validateFormData:m,sourceOptions:a,namespaceOptions:s}),[i,d,u,l,m,a,s]);return e(Rt.Provider,{value:p,children:r})},Nt=()=>{const e=r(Rt);if(!e)throw new Error("useRuleFormContext must be used within a RuleFormContextProvider");return e};var Ot;(e=>{e.Create="create",e.View="view",e.EditAutoNoisy="edit-auto-noisy",e.EditAutoCostReduction="edit-auto-cost-reduction",e.EditAutoHighlyRelevant="edit-auto-highly-relevant"})(Ot||(Ot={}));const Dt=a(null),wt=["50","25","10","1"];function bt(e){const t=String(e);return wt.includes(t)?t:"custom"}const Pt=({category:r,sourceOptions:a=[],namespaceOptions:i=[],children:c})=>{const{formData:l,handleFormChange:d,resetFormData:u}=C(te(r)),[m,p]=o(null);s(()=>{u(te(r)),p(null)},[r]);const f=n(e=>{p(null),d(void 0,void 0,{...l,...e})},[l,d]),E=n(()=>{u(te(r)),p(null)},[r,u]),y=t(()=>({formType:Ot.Create,category:r,formData:l,handleChange:f,resetForm:E,duplicateWarning:m,setDuplicateWarning:p,sourceOptions:a,namespaceOptions:i}),[r,l,f,E,m,a,i]);return e(Dt.Provider,{value:y,children:c})},Lt=({data:r,defaultEditMode:a,sourceOptions:c=[],namespaceOptions:l=[],children:d})=>{const[u,m]=o(!1),{formData:p,handleFormChange:f,resetFormData:E}=C(void 0),y=i(null),[h,S]=o(null);s(()=>{r!==y.current&&(y.current=r,r&&a?(E(ee(r)),S(null),m(!0)):(m(!1),S(null)))},[r,a]);const T=n(e=>{S(null),f(void 0,void 0,{...p,...e})},[p,f]),g=n(()=>{r&&(E(ee(r)),S(null),m(!0))},[r,E]),_=n(()=>{m(!1),S(null)},[]),I=t(()=>({formType:Ot.View,data:r,isEditing:u,formData:p,handleChange:T,handleEdit:g,handleCancelEdit:_,duplicateWarning:h,setDuplicateWarning:S,sourceOptions:c,namespaceOptions:l}),[r,u,p,T,g,_,h,c,l]);return e(Dt.Provider,{value:I,children:d})};function kt(e){const[r,a]=o(()=>0===e?"all":"sample"),[n,i]=o(()=>bt(e)),[c,l]=o(()=>"custom"===bt(e)?String(e):"");s(()=>{a(0===e?"all":"sample");const t=bt(e);i(t),l("custom"===t?String(e):"")},[e]);const d=t(()=>"all"===r?0:"custom"===n?Number(c)||0:Number(n),[r,n,c]);return{percentageMode:r,setPercentageMode:a,percentagePreset:n,setPercentagePreset:i,customPercentage:c,setCustomPercentage:l,resolvedPercentage:d}}const Ft=({enabled:r,keepPercentage:a,children:n})=>{const[i,c]=o(r),l=kt(a);s(()=>{c(r)},[r]);const d=t(()=>Z({enabled:i,keepPercentage:l.resolvedPercentage}),[i,l.resolvedPercentage]),u=t(()=>({formType:Ot.EditAutoNoisy,localEnabled:i,setLocalEnabled:c,...l,summary:d}),[i,l,d]);return e(Dt.Provider,{value:u,children:n})},Gt=({enabled:r,dropPercentage:a,children:n})=>{const[i,c]=o(r),l=kt(a);s(()=>{c(r)},[r]);const d=t(()=>X(i?{disabled:!1,percentageAtMost:l.resolvedPercentage}:null),[i,l.resolvedPercentage]),u=t(()=>({formType:Ot.EditAutoCostReduction,localEnabled:i,setLocalEnabled:c,...l,summary:d}),[i,l,d]);return e(Dt.Provider,{value:u,children:n})},Ut=({enabled:r,children:a})=>{const[n,i]=o(r);s(()=>{i(r)},[r]);const c=t(()=>J(n?{disabled:!1}:null),[n]),l=t(()=>({formType:Ot.EditAutoHighlyRelevant,localEnabled:n,setLocalEnabled:i,summary:c}),[n,c]);return e(Dt.Provider,{value:l,children:a})},Mt=t=>{switch(t.formType){case Ot.Create:return e(Pt,{...t});case Ot.View:return e(Lt,{...t});case Ot.EditAutoNoisy:return e(Ft,{...t});case Ot.EditAutoCostReduction:return e(Gt,{...t});case Ot.EditAutoHighlyRelevant:return e(Ut,{...t})}};function xt(e){const t=r(Dt);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 Ht={otelServiceName:"",currentStreamName:""},Kt=a(null),Vt=({children:r})=>{const[a,s]=o(void 0),i=C(Ht),c=n(e=>{i.resetFormData((({serviceName:e,id:t})=>({otelServiceName:e||t.name||"",currentStreamName:""}))(e)),i.handleErrorChange(void 0,void 0,{}),s(void 0)},[]),l=n(()=>{const e=N(i.formData);return i.handleErrorChange(void 0,void 0,{}),s(void 0),{errorMessage:void 0,preparedFormData:e}},[i]),d=t(()=>({loadSource:c,genericForm:i,validateFormData:l,errorMessage:a}),[c,i,l,a]);return e(Kt.Provider,{value:d,children:r})},Wt=()=>{const e=r(Kt);if(!e)throw new Error("useSourceEditFormContext must be used within a SourceEditFormContextProvider");return e},Yt=new Set([j.StaticPod]),$t=e=>{const t=e.workloads.filter(({selected:e})=>e).length,r=e.workloads.length;return{selectedCount:t,isAllSourced:t>0&&t===r,isSomeSourced:t>0&&t<r,isFutureApps:e.selected||!1}},jt=(e,t,r)=>{if(t&&!e.name.toLowerCase().includes(t.toLowerCase()))return!1;if(r.showOnlySelected){const{isAllSourced:t,isSomeSourced:r,isFutureApps:a}=$t(e);return t||r||a}return!0},qt=(e,t,r)=>!(t&&!e.name.toLowerCase().includes(t.toLowerCase()))&&(!r.showOnlySelected||e.selected),Bt=a({snapshots:null,setSnapshots:()=>{},isFetching:!1,setIsFetching:()=>{},formData:[],handleSourceChange:()=>{},handleSelectAll:()=>{},formDiff:{},isFormDirty:!1}),Qt=(e,t)=>`${e}\0${t}`,zt=(e,t,r,a)=>`${e}\0${t}\0${r}/${a}`,Jt=(e,t)=>e.name===t.name&&e.kind===t.kind&&(e.region??"")===(t.region??""),Xt=(e,t,r)=>{const a=[];return t.workloads.forEach(n=>{const o=e?.workloads.find(e=>Jt(e,n));n.selected!==o?.selected&&a.push({namespace:t.name,name:n.name,kind:n.kind,region:n.region||void 0,selected:n.selected||!1,currentStreamName:r})}),a},Zt=({children:r,selectedConnectionIds:a,initialInputs:c})=>{const{tier:l}=re(),d=l===q.Onprem,{capabilities:u}=tt(),m=u.canInstrumentNamespaces,{selectedStreamName:p}=y(),[E,h]=o(!1),[S,T]=o(null),[g,_]=o([]),I=i(new Set),A=n((e,t)=>{t.forEach(t=>{const r=e.find(e=>e.clusterId===t.clusterId);r&&t.namespaces.forEach(e=>{const a=r.namespaces.find(t=>t.name===e.name);a&&(a.selected!==e.selected&&I.current.add(Qt(t.clusterId,e.name)),e.workloads.forEach(r=>{const n=a.workloads.find(e=>e.name===r.name&&e.kind===r.kind);n&&n.selected!==r.selected&&I.current.add(zt(t.clusterId,e.name,r.kind,r.name))}))})})},[]);s(()=>{S&&_(e=>{const t=((e,t)=>N(((e,t)=>e.clusters.filter(({clusterId:e})=>!t||t.includes(e)))(e,t)))(S,a);return t.map(t=>{const r=e?.find(e=>e.clusterId===t.clusterId),a=((e,t,r)=>{if(!t)return e;const a=new Map(t.namespaces.map(e=>[e.name,e]));return{...e,namespaces:e.namespaces.map(t=>{const n=a.get(t.name);if(!n)return t;const o=new Map(n.workloads.map(e=>[`${e.kind}/${e.name}`,e])),s=r.has(Qt(e.clusterId,t.name));return{...t,selected:s?n.selected:t.selected,workloads:t.workloads.map(a=>{const n=o.get(`${a.kind}/${a.name}`),s=r.has(zt(e.clusterId,t.name,a.kind,a.name));return n&&s?{...a,selected:n.selected}:a})}})}})(t,r,I.current);if(c?.[t.clusterId]){const e=c[t.clusterId],r=N(a);return e.forEach(e=>{const t=r.namespaces.find(t=>t.name===e.namespace);if(t)if(e.name&&e.kind){const r=t.workloads.find(t=>t.name===e.name&&t.kind===e.kind);r&&(r.selected=e.selected)}else t.selected=e.selected,e.selected&&t.workloads.forEach(e=>{Yt.has(e.kind)&&!d||(e.selected=!0)})}),r}return a})})},[S,a,c]);const{formDiff:v,isFormDirty:R}=t(()=>{const e=((e,t,r,a)=>{const n={};return e.forEach(e=>{e.namespaces.forEach(o=>{const s=t.find(t=>t.clusterId===e.clusterId)?.namespaces.find(e=>e.name===o.name);if(!a){const t=Xt(s,o,r);return void(t.length>0&&(n[e.clusterId]||(n[e.clusterId]=[]),n[e.clusterId].push(...t)))}const i=o.selected||!1;if(i!==s?.selected)n[e.clusterId]||(n[e.clusterId]=[]),n[e.clusterId].push({namespace:o.name,selected:i,currentStreamName:r}),i?n[e.clusterId]=n[e.clusterId].filter(e=>e.namespace!==o.name||e.namespace===o.name&&(!e.name||!e.kind)):o.workloads.forEach(t=>{t.selected&&n[e.clusterId].push({namespace:o.name,name:t.name,kind:t.kind,region:t.region||void 0,selected:!0,currentStreamName:r})});else{const t=Xt(s,o,r);t.length>0&&(n[e.clusterId]||(n[e.clusterId]=[]),n[e.clusterId].push(...t))}})}),n})(g,S?.clusters||[],p,m);return{formDiff:e,isFormDirty:Object.keys(e).length>0}},[g,S,p,m]),C=n(e=>!d&&Yt.has(e),[d]),O=n(({clusterId:e,workloadId:t,selected:r,auto:a})=>{_(n=>{const o=N(n),s=o.findIndex(t=>t.clusterId===e);if(-1===s)return o;const i=o[s].namespaces.findIndex(e=>e.name===t.namespace);if(-1===i)return o;if(t.kind&&t.name){const e=o[s].namespaces[i].workloads.findIndex(e=>Jt(e,{name:t.name,kind:t.kind,region:t.region}));if(-1===e)return o;const a="boolean"==typeof r?r:!o[s].namespaces[i].workloads[e].selected;o[s].namespaces[i].workloads[e].selected=a,m&&(a?o[s].namespaces[i].workloads.filter(e=>!C(e.kind)).every(e=>e.selected)&&(o[s].namespaces[i].selected=!0):o[s].namespaces[i].selected=!1)}else if(m){const e="boolean"==typeof a?a:!o[s].namespaces[i].selected;o[s].namespaces[i].selected=e,e?o[s].namespaces[i].workloads.forEach(e=>{C(e.kind)||(e.selected=!0)}):"boolean"!=typeof r||r||o[s].namespaces[i].workloads.forEach(e=>{e.selected=!1})}else{const e="boolean"==typeof r?r:"boolean"!=typeof a||a;o[s].namespaces[i].workloads.forEach(t=>{e&&C(t.kind)||(t.selected=e)})}return A(n,o),o})},[C,m,A]),D=n(({clusterId:e,namespaceName:t,boolean:r,searchText:a="",searchBy:n="",filters:o})=>{_(s=>{const i=N(s),c=n===f.Namespace?a:"",l=n===f.Source?a:"",d=!!c||!!l||!!o?.showOnlySelected;return i.forEach((a,n)=>{e&&a.clusterId!==e||a.namespaces.forEach(({name:e,workloads:a},s)=>{if(!t||e===t)if(d)if(t){if(a.forEach((e,t)=>{r&&C(e.kind)||qt(e,l,o||{showOnlySelected:!1})&&(i[n].namespaces[s].workloads[t].selected=r)}),m){const e=i[n].namespaces[s].workloads.filter(e=>!C(e.kind)).every(e=>e.selected);i[n].namespaces[s].selected=e}}else{if(!jt(i[n].namespaces[s],c,o||{showOnlySelected:!1}))return;m&&(i[n].namespaces[s].selected=r),a.forEach((e,t)=>{r&&C(e.kind)||(i[n].namespaces[s].workloads[t].selected=r)})}else m&&(i[n].namespaces[s].selected=r),a.forEach((e,t)=>{r&&C(e.kind)||(i[n].namespaces[s].workloads[t].selected=r)})})}),A(s,i),i})},[C,m,A]);return e(Bt.Provider,{value:{snapshots:S,setSnapshots:T,isFetching:E,setIsFetching:h,formData:g,handleSourceChange:O,handleSelectAll:D,formDiff:v,isFormDirty:R},children:r})},er=()=>r(Bt);export{ct as A,mt as C,yt as D,Yt as E,Ie as O,Ct as R,Ot as S,Pe as a,It as b,ge as c,Mt as d,Vt as e,Zt as f,Ve as g,lt as h,xe as i,He as j,Me as k,pt as l,ht as m,At as n,tt as o,We as p,Nt as q,be as r,xt as s,Wt as t,Te as u,er as v,qt as w,jt as x,$t as y};
|