@odigos/ui-kit 0.0.232 → 0.0.234

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/lib/chunks/{index-Bbukn13F.js → index-Coer-PRZ.js} +1 -1
  3. package/lib/chunks/{index-D7sjsMOG.js → index-EPaudVws.js} +11 -11
  4. package/lib/chunks/{index-Cw4LkdaE.js → index-eOSrP07c.js} +1 -1
  5. package/lib/chunks/ui-components-BogDd0Qc.js +2696 -0
  6. package/lib/components/_v2/modal/index.d.ts +6 -0
  7. package/lib/components/v2.js +1 -1
  8. package/lib/components.js +1 -1
  9. package/lib/constants/sampling/index.d.ts +74 -0
  10. package/lib/constants.js +1 -1
  11. package/lib/containers/_v2/_modals/add-data-stream-modal/index.d.ts +7 -0
  12. package/lib/containers/_v2/_modals/edit-data-stream-modal/index.d.ts +7 -0
  13. package/lib/containers/_v2/_modals/index.d.ts +1 -0
  14. package/lib/containers/_v2/_modals/sampling-onboarding-modal/common/chrome.d.ts +8 -0
  15. package/lib/containers/_v2/_modals/sampling-onboarding-modal/common/footer.d.ts +13 -0
  16. package/lib/containers/_v2/_modals/sampling-onboarding-modal/common/header.d.ts +6 -0
  17. package/lib/containers/_v2/_modals/sampling-onboarding-modal/common/index.d.ts +8 -0
  18. package/lib/containers/_v2/_modals/sampling-onboarding-modal/common/info-card.d.ts +7 -0
  19. package/lib/containers/_v2/_modals/sampling-onboarding-modal/common/lists.d.ts +11 -0
  20. package/lib/containers/_v2/_modals/sampling-onboarding-modal/common/primary-banner.d.ts +4 -0
  21. package/lib/containers/_v2/_modals/sampling-onboarding-modal/common/section.d.ts +3 -0
  22. package/lib/containers/_v2/_modals/sampling-onboarding-modal/common/sub-title.d.ts +4 -0
  23. package/lib/containers/_v2/_modals/sampling-onboarding-modal/index.d.ts +4 -0
  24. package/lib/containers/_v2/_modals/sampling-onboarding-modal/preset-row.d.ts +19 -0
  25. package/lib/containers/_v2/_modals/sampling-onboarding-modal/steps/step-advanced.d.ts +7 -0
  26. package/lib/containers/_v2/_modals/sampling-onboarding-modal/steps/step-drop-list.d.ts +9 -0
  27. package/lib/containers/_v2/_modals/sampling-onboarding-modal/steps/step-keep-list.d.ts +19 -0
  28. package/lib/containers/_v2/_modals/sampling-onboarding-modal/steps/step-noisy.d.ts +8 -0
  29. package/lib/containers/_v2/_modals/sampling-onboarding-modal/steps/step-strategy.d.ts +10 -0
  30. package/lib/containers/_v2/_modals/sampling-onboarding-modal/steps/step-success.d.ts +5 -0
  31. package/lib/containers/_v2/_modals/sampling-onboarding-modal/steps/step-welcome.d.ts +6 -0
  32. package/lib/containers/_v2/_modals/sampling-onboarding-modal/types.d.ts +29 -0
  33. package/lib/containers/_v2/sampling-rules/types.d.ts +8 -8
  34. package/lib/containers/v2.js +228 -70
  35. package/lib/containers.js +22 -22
  36. package/lib/contexts.js +1 -1
  37. package/lib/functions.js +1 -1
  38. package/lib/hooks.js +1 -1
  39. package/lib/icons/destinations/index.d.ts +1 -0
  40. package/lib/icons/destinations/pyroscope-logo/index.d.ts +2 -0
  41. package/lib/icons.js +1 -1
  42. package/lib/snippets/v2.js +1 -1
  43. package/lib/snippets.js +1 -1
  44. package/lib/store.js +1 -1
  45. package/lib/theme.js +1 -1
  46. package/lib/types/destinations/index.d.ts +6 -1
  47. package/lib/types/signals/index.d.ts +4 -2
  48. package/lib/types.js +1 -1
  49. package/lib/visuals.js +1 -1
  50. package/package.json +1 -1
  51. package/lib/chunks/ui-components-of0mjGMv.js +0 -2671
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.0.234](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.233...ui-kit-v0.0.234) (2026-05-11)
4
+
5
+
6
+ ### Features
7
+
8
+ * add support for Profiles signal and update destination form to include Pyroscope integration ([#876](https://github.com/odigos-io/ui-kit/issues/876)) ([6289b64](https://github.com/odigos-io/ui-kit/commit/6289b64aa823b9488ae710551121056c462170b6))
9
+
10
+ ## [0.0.233](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.232...ui-kit-v0.0.233) (2026-05-10)
11
+
12
+
13
+ ### Features
14
+
15
+ * add close animation for add/edit data-stream modals ([#868](https://github.com/odigos-io/ui-kit/issues/868)) ([7388525](https://github.com/odigos-io/ui-kit/commit/73885254d8f10d79daeaa8ecb8186ee04b98848c))
16
+ * add sampling onboarding modal ([#865](https://github.com/odigos-io/ui-kit/issues/865)) ([ba668d0](https://github.com/odigos-io/ui-kit/commit/ba668d0186f3df907ea8bdd46c968e8390ef9149))
17
+
3
18
  ## [0.0.232](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.231...ui-kit-v0.0.232) (2026-05-10)
4
19
 
5
20
 
@@ -1,4 +1,4 @@
1
- import{jsxs as e,Fragment as t,jsx as n}from"react/jsx-runtime";import{forwardRef as i,useState as o,useRef as l,useImperativeHandle as r,useEffect as a,useLayoutEffect as s,useMemo as c,useCallback as d,Fragment as u,Children as h}from"react";import f,{useTheme as m}from"styled-components";import{c as p,d as g,T as v,e as y,f as b,h as x,i as w,E as S,I as k,F as $,j as C,k as T,l as z,m as I,B as N,a as F,n as P,o as E,p as O,q as R,S as L,r as D,s as M,P as A,t as B,v as W,b as X,L as V,w as Y,N as j,x as H,y as _,z as U,G as J,H as K,J as Z,O as G,K as q,M as Q,Q as ee,R as te,U as ne,V as ie,W as oe,X as le,Y as re,Z as ae,_ as se,g as ce,$ as de,a0 as ue,a1 as he,a2 as fe,a3 as me,a4 as pe,a5 as ge,a6 as ve,a7 as ye,a8 as be,a9 as xe,aa as we,ab as Se,ac as ke,ad as $e}from"./ui-components-of0mjGMv.js";import{EditIcon as Ce,TrashIcon as Te,SearchIcon as ze,MinusIcon as Ie,PlusIcon as Ne,XIcon as Fe,ExpandIcon as Pe,CopyIcon as Ee,DotIcon as Oe,DownloadIcon as Re,RefreshIcon as Le,RefreshLeftArrowIcon as De}from"../icons.js";import{Y as Me}from"./index-Cw4LkdaE.js";const Ae=i(({children:i,width:a=640,title:s,titleTooltip:c,hideEditTitleFromEdit:d,icons:u,iconSrcs:h,isEdit:f=!1,isFormDirty:k=!1,isLastItem:$=!1,onClose:C,onEdit:T,onSave:z,onDelete:I,onCancel:N,tabs:F,headerActionButtons:P},E)=>{const O=m(),{drawerType:R,setDrawerType:L,setDrawerEntityId:D}=p();g({key:"Enter",active:f},()=>J());const[M,A]=o(!1),[B,W]=o(!1),X=l(null),V=R===S.Source,Y=()=>{A(!1),W(!1)},j=()=>{Y(),T&&T(!1),L(null),D(null),C?.()};r(E,()=>({closeDrawer:j}));const H=()=>{X.current?.clearTitle(),N&&N(),Y()},_=()=>{const e=X.current?.isTitleDirty();k||e?W(!0):H()},U=()=>{A(!0)},J=()=>{z&&z(X.current?.getTitle()||"")},K=P||[];return T&&!f&&K.push({"data-id":"drawer-edit",variant:"tertiary",onClick:()=>T(!0),children:e(t,{children:[n(Ce,{}),n(v,{size:14,family:"secondary",decoration:"underline",children:"Edit"})]})}),I&&!f&&K.push({"data-id":"drawer-delete",variant:"tertiary",onClick:U,children:e(t,{children:[n(Te,{}),n(v,{color:O.text.error,size:14,family:"secondary",decoration:"underline",children:V?y.UNINSTRUMENT:y.DELETE})]})}),e(t,{children:[n(b,{isOpen:!0,onClose:f?_:j,closeOnEscape:!M&&!B,width:"number"==typeof a?`${a+64}px`:a,header:{icons:u,iconSrcs:h,title:s,titleTooltip:c,replaceTitleWith:!d&&f?n(Be,{ref:X,title:s}):void 0,actionButtons:K,tabs:F},footer:{isOpen:f,leftButtons:[{"data-id":"drawer-save",variant:"primary",onClick:J,children:y.SAVE},{"data-id":"drawer-cancel",variant:"secondary",onClick:_,children:y.CANCEL}],rightButtons:I?[{"data-id":"drawer-delete",variant:"tertiary",onClick:U,children:e(t,{children:[n(Te,{}),n(v,{size:14,color:O.text.error,family:"secondary",decoration:"underline",children:y.DELETE})]})}]:[]},children:i}),n(x,{isOpen:M,noOverlay:!0,name:`${R}${s?` (${s})`:""}`,type:R,isLastItem:$,onApprove:()=>{I&&I(),Y()},onDeny:Y}),n(w,{isOpen:B,noOverlay:!0,name:"edit mode",onApprove:H,onDeny:Y})]})}),Be=i(({title:e},t)=>{const[i,l]=o(e);return a(()=>{l(e)},[e]),r(t,()=>({getTitle:()=>i||e,isTitleDirty:()=>i!==e,clearTitle:()=>l(e)})),n(k,{"data-id":"title",value:i,onChange:e=>l(e.target.value)})});function We(e,t){const n=e.names[t];if(null==n)return"";if("string"==typeof n)return n;if("object"==typeof n&&"name"in n){const e=n.name;if("string"==typeof e)return e}return"number"==typeof n||"boolean"==typeof n?String(n):""}function Xe(e){const t=Math.abs(e);return t>=1e9?`${Ve(e/1e9)}s`:t>=1e6?`${Ve(e/1e6)}ms`:t>=1e3?`${Ve(e/1e3)}μs`:String(Math.round(e))}function Ve(e){return e.toFixed(2).replace(/\.?0+$/,"")}function Ye(e){const t=[];for(let n=0;n<e.levels.length;n++){const i=e.levels[n];let o=0;for(let e=0;e+3<i.length;e+=4){const l=i[e],r=i[e+1],a=i[e+2],s=i[e+3],c=o+l;t.push({level:n,offset:c,size:r,self:a,nameIndex:s}),o=c+r}}return t}function je(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function He(e,t){const n=t.trim().toLowerCase();return!n||e.toLowerCase().includes(n)}function _e(e,t,n,i,o,l={}){if(0===e.levels.length||t<2||n<2)return null;const{zoomRoot:r=null,shouldKeepName:a,collapseRecursive:s=!1}=l,c=Ye(e);let d=r?function(e,t){const n=e.reduce((e,t)=>Math.max(e,t.level),t.level),i=new Map;for(const t of e){const e=i.get(t.level);e?e.push(t):i.set(t.level,[t])}const o=[t];for(let e=t.level+1;e<=n;e++){const t=o.filter(t=>t.level===e-1);if(0===t.length)break;const n=i.get(e);if(n?.length)for(const e of n)for(const n of t)if(e.offset>=n.offset&&e.offset+e.size<=n.offset+n.size){o.push(e);break}}return o}(c,r):c;if(0===d.length)return null;if(a&&(d=d.filter(t=>a(We(e,t.nameIndex))),0===d.length))return null;if(s&&(d=function(e,t){if(0===t.length)return t;const n=[...t].sort((e,t)=>e.level-t.level||e.offset-t.offset),i=new Map;for(const e of n){const t=i.get(e.level);t?t.push(e):i.set(e.level,[e])}const o=new Set;for(const t of n){const n=i.get(t.level+1);if(!n)continue;const l=n.filter(e=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);if(1!==l.length)continue;const r=l[0];r.size===t.size&&We(e,r.nameIndex)===We(e,t.nameIndex)&&o.add(je(r))}if(0===o.size)return n;const l=[];for(const e of n){if(o.has(je(e)))continue;let t=0;for(let n=0;n<e.level;n++){const l=i.get(n);if(!l)continue;const r=l.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);r&&o.has(je(r))&&t++}l.push({...e,level:e.level-t})}return l}(e,d),0===d.length))return null;const u=r?.level??0,h=r?.offset??0,f=r?.size??e.numTicks;if(f<=0)return null;const m=d.reduce((e,t)=>Math.max(e,t.level-u),0)+1,p=i??Number.POSITIVE_INFINITY,g=Math.max(1,Math.min(n/m,p)),v=o.trim(),y=g>8?1:0;return d.map(n=>{const i=n.level-u,o=(n.offset-h)/f*t,l=Math.max(n.size/f*t,1),r=i*g,a=Math.max(g-y,1),s=We(e,n.nameIndex);return{...n,x:o,y:r,w:l,h:a,name:s,matchesSearch:He(s,v)}})}function Ue(e,t){let n=0;for(let t=0;t<e.length;t++)n=31*n+e.charCodeAt(t)>>>0;const i=t.v2.colors.black[500],o=[{fill:t.v2.colors.purple[300],text:i},{fill:t.v2.colors.green[300],text:i},{fill:t.v2.colors.red[300],text:i},{fill:t.v2.colors.blue[300],text:i},{fill:t.v2.colors.yellow[300],text:i}];return o[n%o.length]}Be.displayName=Be.name,Ae.displayName=Ae.name;var Je,Ke;!function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(Je||(Je={})),function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(Ke||(Ke={}));function Ze(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function Ge(e,t,n){for(const i of n)if(e>=i.x&&e<i.x+i.w&&t>=i.y&&t<i.y+i.h)return i;return null}function qe(e){return e>=1073741824?`${(e/1073741824).toFixed(1)} GiB`:e>=1048576?`${(e/1048576).toFixed(1)} MiB`:e>=1024?`${(e/1024).toFixed(1)} KiB`:`${e} B`}const Qe=({flamebearer:t,maxRowPx:i,searchQuery:r="",shouldKeepName:u,minHostHeight:h=200,onFullscreenChange:f,profilingSlots:p})=>{const g=m(),v=l(null),y=l(null),b=l({x:0,y:0}),x=l(t.numTicks),[w,S]=o({w:0,h:0}),[k,A]=o(""),[B,W]=o(null),[X,V]=o([]),[Y,j]=o(!1),[H,_]=o(Je.Fit),[U,J]=o(Ke.Fit),[K,Z]=o(!1),G=Math.max(1,Math.min(Math.floor(w.w*H),8192)),q=Math.max(1,Math.min(Math.floor(w.h*U),8192)),Q=X.length>0?X[X.length-1]:null,ee=Q?.size??t.numTicks;a(()=>{x.current!==t.numTicks&&(x.current=t.numTicks,V([]))},[t.numTicks]),s(()=>{const e=v.current;if(!e)return;const t=new ResizeObserver(()=>{const t=e.getBoundingClientRect();S({w:Math.floor(t.width),h:Math.floor(t.height)})});return t.observe(e),()=>t.disconnect()},[]),a(()=>{if(!Y)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[Y]),a(()=>(f?.(Y),()=>{Y&&f?.(!1)}),[Y,f]);const te=c(()=>_e(t,G,q,i,r,{zoomRoot:Q,shouldKeepName:u,collapseRecursive:K}),[t,i,r,q,G,Q,u,K]),ne=c(()=>function(e){return[...e].sort((e,t)=>t.level-e.level)}(te?.length?r.trim()?te.filter(e=>e.matchesSearch):te:[]),[te,r]),ie=d(e=>{if(G<2||q<2)return;const n=e.currentTarget.getBoundingClientRect();if(n.width<1||n.height<1)return;const i=Ge((e.clientX-n.left)/n.width*G,(e.clientY-n.top)/n.height*q,ne);if(i){const e=je(i);W(e);const n=ee>0?(100*i.size/ee).toFixed(1):"0",o=t.numTicks>0?(100*i.size/t.numTicks).toFixed(1):"0";A(`${i.name}\ntotal ${Xe(i.size)} (${n}% of view, ${o}% of profile) · self ${Xe(i.self)}`)}else W(null),A("")},[ne,t.numTicks,q,G,ee]),oe=d(e=>{ie(e)},[ie]),le=d(()=>{W(null),A("")},[]),re=d(e=>{b.current={x:e.clientX,y:e.clientY}},[]),ae=d(e=>{const{x:t,y:n}=b.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-n)>3)return;if(G<2||q<2)return;const i=e.currentTarget.getBoundingClientRect();if(i.width<1||i.height<1)return;const o=Ge((e.clientX-i.left)/i.width*G,(e.clientY-i.top)/i.height*q,ne);if(!o)return;const l=function(e){return{level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}}(o);V(e=>{const t=e.length>0?e[e.length-1]:null;return t&&function(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}(l,t)?e.slice(0,-1):[...e,l]})},[ne,q,G]);s(()=>{const e=y.current;if(!e||G<2||q<2)return;const n="undefined"!=typeof window&&window.devicePixelRatio||1,i=Math.max(G,q),o=Math.min(n,16384/i);e.width=Math.floor(G*o),e.height=Math.floor(q*o),e.style.width=`${G}px`,e.style.height=`${q}px`;const l=e.getContext("2d");l&&(l.setTransform(o,0,0,o,0,0),l.clearRect(0,0,G,q),te?.length?function(e,t,n,i,o,l,r,a){const s=l.v2.colors.silver[900];e.fillStyle=s,e.fillRect(0,0,t,n);const c=o.trim().length>0;e.textRendering="optimizeLegibility";for(const t of i){const{x:n,y:i,w:o,h:r,name:s,size:d,matchesSearch:u}=t;if(c&&!u)continue;const{fill:h,text:f}=Ue(s,l);e.fillStyle=h,e.fillRect(n,i,o,r),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(n+.5,i+.5),e.lineTo(n+o-.5,i+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(n+.5,i+.5,Math.max(o-1,0),Math.max(r-1,0));const m=Ze(d,a),p=`${s} (${Xe(d)}, ${m}%)`,g=l.v2.text.size.xs,v=8,y=5,b=26,x=Math.min(g,Math.floor(r-2));if(o>=b&&x>=v){e.font=`${x}px ${l.font_family.primary}, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`,e.textBaseline="middle",e.textAlign="left";let t=p;for(;t.length>2&&e.measureText(t).width>o-2*y;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=o-2*y&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,n+y,i+r/2),e.fillStyle=f,e.fillText(t,n+y,i+r/2))}}if(r)for(const t of i){if(je(t)!==r)continue;if(c&&!t.matchesSearch)continue;const{x:n,y:i,w:o,h:l}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(n+1,i+1,Math.max(o-2,0),Math.max(l-2,0));break}}(l,G,q,te,r,g,B,t.numTicks):(l.fillStyle=g.v2.colors.silver[900],l.fillRect(0,0,G,q)))},[te,t.numTicks,B,r,q,G,g]);const se=d(()=>j(e=>!e),[]),ce=t.numTicks>0?Math.max(0,Math.min(100,Math.round(ee/t.numTicks*100))):100,de=c(()=>function(e,t){const n=Ye(e),i=t?.offset??0,o=i+(t?.size??e.numTicks),l=(t?.level??-1)+1,r=t?.size??e.numTicks;let a=null;for(const e of n)e.level<l||e.offset<i||e.offset+e.size>o||e.size>=r||(!a||e.size>a.size||e.size===a.size&&e.level<a.level)&&(a=e);return a}(t,Q),[t,Q]),ue=null!==de,he=X.length>0,fe=Q?We(t,Q.nameIndex):"",me=d(()=>V([]),[]),pe=d(()=>V(e=>e.slice(0,-1)),[]),ge=d(()=>{de&&V(e=>[...e,de])},[de]);return e("div",{style:Y?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:g.v2.colors.silver[900]}:{flex:1,minHeight:h,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e($,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[n(C,{label:"Collapse recursive",tooltip:"Collapse straight-line recursion (parent → single same-name child of equal width) into a single bar. Helps deep recursive call chains fit on screen.",labelAlign:z.Left,size:T.S,value:K,onChange:Z}),e($,{$gap:8,children:[e($,{children:[n(I,{variant:F.Secondary,size:N.S,label:"Reset zoom",leftIcon:ze,onClick:me,disabled:!X.length}),n(I,{variant:F.Secondary,size:N.S,iconSize:20,leftIcon:Ie,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!he,onClick:pe}),n("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:n(P,{size:O.XXS,color:E.Secondary,nowrap:!0,align:"center",children:`${ce}%`})}),n(I,{variant:F.Secondary,size:N.S,iconSize:20,leftIcon:Ne,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!ue,onClick:ge})]}),e($,{children:[n(R,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:n(L,{size:M.S,variant:D.Filled,options:[{value:Je.Fit,label:"W: Fit"},{value:Je.X10,label:"10x"}],selected:H,setSelected:_})}),n(R,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:n(L,{size:M.S,variant:D.Filled,options:[{value:Ke.Fit,label:"H: Fit"},{value:Ke.X10,label:"10x"}],selected:U,setSelected:J})})]}),n(I,{variant:F.Secondary,size:N.S,iconSize:24,leftIcon:Y?Fe:Pe,tooltip:Y?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:se})]})]}),n(R,{fullWidth:!0,keepAlive:!0,text:k,children:n("div",{ref:v,style:{flex:1,minWidth:0,width:"100%",height:Y?"calc(100vh - 80px)":"calc(100vh - 370px)",position:"relative",overflowX:H>1?"auto":"hidden",overflowY:U>1?"auto":"hidden"},children:n("div",{style:{width:G||"100%",height:q||"100%",position:"relative"},children:n("canvas",{ref:y,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:B?"pointer":"default"},onPointerDown:re,onPointerMove:oe,onPointerLeave:le,onClick:ae})})})}),e($,{$justifyContent:"space-between",children:[n(P,Q?{size:O.XXXS,color:g.v2.colors.silver[300],children:`Zoomed: ${fe} • ${Xe(ee)} samples in view`}:{size:O.XXXS,color:g.v2.colors.silver[300],children:"Click a frame to zoom into its subtree (pprof-style)."}),p&&n(P,{size:O.XXXS,color:g.v2.colors.silver[300],children:`${p.activeKeys.length} / ${p.maxSlots} profiling slots · ${qe(p.totalBytesUsed)} / ${qe(p.maxTotalBytesBudget)} budget · TTL ${p.slotTtlSeconds}s`})]})]})};var et,tt;!function(e){e.Symbol="symbol",e.Self="self",e.Total="total"}(et||(et={})),function(e){e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"}(tt||(tt={}));const nt=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function it(e,t){const n=function(e){return e.split(" ")[0]??""}(e);if(t.includes(tt.FilterOutVoid)&&"void"===n)return!1;if(t.includes(tt.OnlyWithReturnValues)){if(!(e.includes(" ")&&"void"!==n&&nt.test(n)))return!1}return!0}const ot={options:[{id:tt.FilterOutVoid,label:"Filter out void symbols"},{id:tt.OnlyWithReturnValues,label:"Only show functions with return values"}],filterRow:(e,t)=>it(e.cells.find(e=>e.key===et.Symbol)?.rawValue?.toString()??"",t)},lt=({rows:e,languages:t,filters:i,onFiltersChange:o})=>{const l=c(()=>[{key:et.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:t?.includes(A.Java)?ot:void 0,noFilter:!t?.includes(A.Java)},{key:et.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:et.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[t]),r=c(()=>e.map(e=>({cells:[{key:et.Symbol,rawValue:e.name},{key:et.Self,rawValue:Xe(e.self)},{key:et.Total,rawValue:Xe(e.total)}]})),[e]);return n(B,{variant:W.Data,maxHeight:"calc(100vh - 306px)",columns:l,rows:r,filters:i,onFiltersChange:o,rowActionsPushLeftPosition:"12px",getRowActions:e=>[{id:`copy-${e.cells[0].rawValue}`,label:"",rightIcon:Ee,onClick:()=>{navigator.clipboard.writeText(e.cells[0].rawValue)}}]})};var rt;!function(e){e.Table="table",e.Flame="flame",e.Both="both"}(rt||(rt={}));const at=f(_)`
1
+ import{jsxs as e,Fragment as t,jsx as n}from"react/jsx-runtime";import{forwardRef as i,useState as o,useRef as l,useImperativeHandle as r,useEffect as a,useLayoutEffect as s,useMemo as c,useCallback as d,Fragment as u,Children as h}from"react";import f,{useTheme as m}from"styled-components";import{c as p,d as g,T as v,e as y,f as b,h as x,i as w,E as S,I as k,F as $,j as C,k as T,l as z,m as I,B as N,a as F,n as P,o as E,p as O,q as R,S as L,r as D,s as M,P as A,t as B,v as W,b as X,L as V,w as Y,N as j,x as H,y as _,z as U,G as J,H as K,J as Z,O as G,K as q,M as Q,Q as ee,R as te,U as ne,V as ie,W as oe,X as le,Y as re,Z as ae,_ as se,g as ce,$ as de,a0 as ue,a1 as he,a2 as fe,a3 as me,a4 as pe,a5 as ge,a6 as ve,a7 as ye,a8 as be,a9 as xe,aa as we,ab as Se,ac as ke,ad as $e}from"./ui-components-BogDd0Qc.js";import{EditIcon as Ce,TrashIcon as Te,SearchIcon as ze,MinusIcon as Ie,PlusIcon as Ne,XIcon as Fe,ExpandIcon as Pe,CopyIcon as Ee,DotIcon as Oe,DownloadIcon as Re,RefreshIcon as Le,RefreshLeftArrowIcon as De}from"../icons.js";import{Y as Me}from"./index-eOSrP07c.js";const Ae=i(({children:i,width:a=640,title:s,titleTooltip:c,hideEditTitleFromEdit:d,icons:u,iconSrcs:h,isEdit:f=!1,isFormDirty:k=!1,isLastItem:$=!1,onClose:C,onEdit:T,onSave:z,onDelete:I,onCancel:N,tabs:F,headerActionButtons:P},E)=>{const O=m(),{drawerType:R,setDrawerType:L,setDrawerEntityId:D}=p();g({key:"Enter",active:f},()=>J());const[M,A]=o(!1),[B,W]=o(!1),X=l(null),V=R===S.Source,Y=()=>{A(!1),W(!1)},j=()=>{Y(),T&&T(!1),L(null),D(null),C?.()};r(E,()=>({closeDrawer:j}));const H=()=>{X.current?.clearTitle(),N&&N(),Y()},_=()=>{const e=X.current?.isTitleDirty();k||e?W(!0):H()},U=()=>{A(!0)},J=()=>{z&&z(X.current?.getTitle()||"")},K=P||[];return T&&!f&&K.push({"data-id":"drawer-edit",variant:"tertiary",onClick:()=>T(!0),children:e(t,{children:[n(Ce,{}),n(v,{size:14,family:"secondary",decoration:"underline",children:"Edit"})]})}),I&&!f&&K.push({"data-id":"drawer-delete",variant:"tertiary",onClick:U,children:e(t,{children:[n(Te,{}),n(v,{color:O.text.error,size:14,family:"secondary",decoration:"underline",children:V?y.UNINSTRUMENT:y.DELETE})]})}),e(t,{children:[n(b,{isOpen:!0,onClose:f?_:j,closeOnEscape:!M&&!B,width:"number"==typeof a?`${a+64}px`:a,header:{icons:u,iconSrcs:h,title:s,titleTooltip:c,replaceTitleWith:!d&&f?n(Be,{ref:X,title:s}):void 0,actionButtons:K,tabs:F},footer:{isOpen:f,leftButtons:[{"data-id":"drawer-save",variant:"primary",onClick:J,children:y.SAVE},{"data-id":"drawer-cancel",variant:"secondary",onClick:_,children:y.CANCEL}],rightButtons:I?[{"data-id":"drawer-delete",variant:"tertiary",onClick:U,children:e(t,{children:[n(Te,{}),n(v,{size:14,color:O.text.error,family:"secondary",decoration:"underline",children:y.DELETE})]})}]:[]},children:i}),n(x,{isOpen:M,noOverlay:!0,name:`${R}${s?` (${s})`:""}`,type:R,isLastItem:$,onApprove:()=>{I&&I(),Y()},onDeny:Y}),n(w,{isOpen:B,noOverlay:!0,name:"edit mode",onApprove:H,onDeny:Y})]})}),Be=i(({title:e},t)=>{const[i,l]=o(e);return a(()=>{l(e)},[e]),r(t,()=>({getTitle:()=>i||e,isTitleDirty:()=>i!==e,clearTitle:()=>l(e)})),n(k,{"data-id":"title",value:i,onChange:e=>l(e.target.value)})});function We(e,t){const n=e.names[t];if(null==n)return"";if("string"==typeof n)return n;if("object"==typeof n&&"name"in n){const e=n.name;if("string"==typeof e)return e}return"number"==typeof n||"boolean"==typeof n?String(n):""}function Xe(e){const t=Math.abs(e);return t>=1e9?`${Ve(e/1e9)}s`:t>=1e6?`${Ve(e/1e6)}ms`:t>=1e3?`${Ve(e/1e3)}μs`:String(Math.round(e))}function Ve(e){return e.toFixed(2).replace(/\.?0+$/,"")}function Ye(e){const t=[];for(let n=0;n<e.levels.length;n++){const i=e.levels[n];let o=0;for(let e=0;e+3<i.length;e+=4){const l=i[e],r=i[e+1],a=i[e+2],s=i[e+3],c=o+l;t.push({level:n,offset:c,size:r,self:a,nameIndex:s}),o=c+r}}return t}function je(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function He(e,t){const n=t.trim().toLowerCase();return!n||e.toLowerCase().includes(n)}function _e(e,t,n,i,o,l={}){if(0===e.levels.length||t<2||n<2)return null;const{zoomRoot:r=null,shouldKeepName:a,collapseRecursive:s=!1}=l,c=Ye(e);let d=r?function(e,t){const n=e.reduce((e,t)=>Math.max(e,t.level),t.level),i=new Map;for(const t of e){const e=i.get(t.level);e?e.push(t):i.set(t.level,[t])}const o=[t];for(let e=t.level+1;e<=n;e++){const t=o.filter(t=>t.level===e-1);if(0===t.length)break;const n=i.get(e);if(n?.length)for(const e of n)for(const n of t)if(e.offset>=n.offset&&e.offset+e.size<=n.offset+n.size){o.push(e);break}}return o}(c,r):c;if(0===d.length)return null;if(a&&(d=d.filter(t=>a(We(e,t.nameIndex))),0===d.length))return null;if(s&&(d=function(e,t){if(0===t.length)return t;const n=[...t].sort((e,t)=>e.level-t.level||e.offset-t.offset),i=new Map;for(const e of n){const t=i.get(e.level);t?t.push(e):i.set(e.level,[e])}const o=new Set;for(const t of n){const n=i.get(t.level+1);if(!n)continue;const l=n.filter(e=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);if(1!==l.length)continue;const r=l[0];r.size===t.size&&We(e,r.nameIndex)===We(e,t.nameIndex)&&o.add(je(r))}if(0===o.size)return n;const l=[];for(const e of n){if(o.has(je(e)))continue;let t=0;for(let n=0;n<e.level;n++){const l=i.get(n);if(!l)continue;const r=l.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);r&&o.has(je(r))&&t++}l.push({...e,level:e.level-t})}return l}(e,d),0===d.length))return null;const u=r?.level??0,h=r?.offset??0,f=r?.size??e.numTicks;if(f<=0)return null;const m=d.reduce((e,t)=>Math.max(e,t.level-u),0)+1,p=i??Number.POSITIVE_INFINITY,g=Math.max(1,Math.min(n/m,p)),v=o.trim(),y=g>8?1:0;return d.map(n=>{const i=n.level-u,o=(n.offset-h)/f*t,l=Math.max(n.size/f*t,1),r=i*g,a=Math.max(g-y,1),s=We(e,n.nameIndex);return{...n,x:o,y:r,w:l,h:a,name:s,matchesSearch:He(s,v)}})}function Ue(e,t){let n=0;for(let t=0;t<e.length;t++)n=31*n+e.charCodeAt(t)>>>0;const i=t.v2.colors.black[500],o=[{fill:t.v2.colors.purple[300],text:i},{fill:t.v2.colors.green[300],text:i},{fill:t.v2.colors.red[300],text:i},{fill:t.v2.colors.blue[300],text:i},{fill:t.v2.colors.yellow[300],text:i}];return o[n%o.length]}Be.displayName=Be.name,Ae.displayName=Ae.name;var Je,Ke;!function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(Je||(Je={})),function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(Ke||(Ke={}));function Ze(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function Ge(e,t,n){for(const i of n)if(e>=i.x&&e<i.x+i.w&&t>=i.y&&t<i.y+i.h)return i;return null}function qe(e){return e>=1073741824?`${(e/1073741824).toFixed(1)} GiB`:e>=1048576?`${(e/1048576).toFixed(1)} MiB`:e>=1024?`${(e/1024).toFixed(1)} KiB`:`${e} B`}const Qe=({flamebearer:t,maxRowPx:i,searchQuery:r="",shouldKeepName:u,minHostHeight:h=200,onFullscreenChange:f,profilingSlots:p})=>{const g=m(),v=l(null),y=l(null),b=l({x:0,y:0}),x=l(t.numTicks),[w,S]=o({w:0,h:0}),[k,A]=o(""),[B,W]=o(null),[X,V]=o([]),[Y,j]=o(!1),[H,_]=o(Je.Fit),[U,J]=o(Ke.Fit),[K,Z]=o(!1),G=Math.max(1,Math.min(Math.floor(w.w*H),8192)),q=Math.max(1,Math.min(Math.floor(w.h*U),8192)),Q=X.length>0?X[X.length-1]:null,ee=Q?.size??t.numTicks;a(()=>{x.current!==t.numTicks&&(x.current=t.numTicks,V([]))},[t.numTicks]),s(()=>{const e=v.current;if(!e)return;const t=new ResizeObserver(()=>{const t=e.getBoundingClientRect();S({w:Math.floor(t.width),h:Math.floor(t.height)})});return t.observe(e),()=>t.disconnect()},[]),a(()=>{if(!Y)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[Y]),a(()=>(f?.(Y),()=>{Y&&f?.(!1)}),[Y,f]);const te=c(()=>_e(t,G,q,i,r,{zoomRoot:Q,shouldKeepName:u,collapseRecursive:K}),[t,i,r,q,G,Q,u,K]),ne=c(()=>function(e){return[...e].sort((e,t)=>t.level-e.level)}(te?.length?r.trim()?te.filter(e=>e.matchesSearch):te:[]),[te,r]),ie=d(e=>{if(G<2||q<2)return;const n=e.currentTarget.getBoundingClientRect();if(n.width<1||n.height<1)return;const i=Ge((e.clientX-n.left)/n.width*G,(e.clientY-n.top)/n.height*q,ne);if(i){const e=je(i);W(e);const n=ee>0?(100*i.size/ee).toFixed(1):"0",o=t.numTicks>0?(100*i.size/t.numTicks).toFixed(1):"0";A(`${i.name}\ntotal ${Xe(i.size)} (${n}% of view, ${o}% of profile) · self ${Xe(i.self)}`)}else W(null),A("")},[ne,t.numTicks,q,G,ee]),oe=d(e=>{ie(e)},[ie]),le=d(()=>{W(null),A("")},[]),re=d(e=>{b.current={x:e.clientX,y:e.clientY}},[]),ae=d(e=>{const{x:t,y:n}=b.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-n)>3)return;if(G<2||q<2)return;const i=e.currentTarget.getBoundingClientRect();if(i.width<1||i.height<1)return;const o=Ge((e.clientX-i.left)/i.width*G,(e.clientY-i.top)/i.height*q,ne);if(!o)return;const l=function(e){return{level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}}(o);V(e=>{const t=e.length>0?e[e.length-1]:null;return t&&function(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}(l,t)?e.slice(0,-1):[...e,l]})},[ne,q,G]);s(()=>{const e=y.current;if(!e||G<2||q<2)return;const n="undefined"!=typeof window&&window.devicePixelRatio||1,i=Math.max(G,q),o=Math.min(n,16384/i);e.width=Math.floor(G*o),e.height=Math.floor(q*o),e.style.width=`${G}px`,e.style.height=`${q}px`;const l=e.getContext("2d");l&&(l.setTransform(o,0,0,o,0,0),l.clearRect(0,0,G,q),te?.length?function(e,t,n,i,o,l,r,a){const s=l.v2.colors.silver[900];e.fillStyle=s,e.fillRect(0,0,t,n);const c=o.trim().length>0;e.textRendering="optimizeLegibility";for(const t of i){const{x:n,y:i,w:o,h:r,name:s,size:d,matchesSearch:u}=t;if(c&&!u)continue;const{fill:h,text:f}=Ue(s,l);e.fillStyle=h,e.fillRect(n,i,o,r),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(n+.5,i+.5),e.lineTo(n+o-.5,i+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(n+.5,i+.5,Math.max(o-1,0),Math.max(r-1,0));const m=Ze(d,a),p=`${s} (${Xe(d)}, ${m}%)`,g=l.v2.text.size.xs,v=8,y=5,b=26,x=Math.min(g,Math.floor(r-2));if(o>=b&&x>=v){e.font=`${x}px ${l.font_family.primary}, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`,e.textBaseline="middle",e.textAlign="left";let t=p;for(;t.length>2&&e.measureText(t).width>o-2*y;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=o-2*y&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,n+y,i+r/2),e.fillStyle=f,e.fillText(t,n+y,i+r/2))}}if(r)for(const t of i){if(je(t)!==r)continue;if(c&&!t.matchesSearch)continue;const{x:n,y:i,w:o,h:l}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(n+1,i+1,Math.max(o-2,0),Math.max(l-2,0));break}}(l,G,q,te,r,g,B,t.numTicks):(l.fillStyle=g.v2.colors.silver[900],l.fillRect(0,0,G,q)))},[te,t.numTicks,B,r,q,G,g]);const se=d(()=>j(e=>!e),[]),ce=t.numTicks>0?Math.max(0,Math.min(100,Math.round(ee/t.numTicks*100))):100,de=c(()=>function(e,t){const n=Ye(e),i=t?.offset??0,o=i+(t?.size??e.numTicks),l=(t?.level??-1)+1,r=t?.size??e.numTicks;let a=null;for(const e of n)e.level<l||e.offset<i||e.offset+e.size>o||e.size>=r||(!a||e.size>a.size||e.size===a.size&&e.level<a.level)&&(a=e);return a}(t,Q),[t,Q]),ue=null!==de,he=X.length>0,fe=Q?We(t,Q.nameIndex):"",me=d(()=>V([]),[]),pe=d(()=>V(e=>e.slice(0,-1)),[]),ge=d(()=>{de&&V(e=>[...e,de])},[de]);return e("div",{style:Y?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:g.v2.colors.silver[900]}:{flex:1,minHeight:h,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e($,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[n(C,{label:"Collapse recursive",tooltip:"Collapse straight-line recursion (parent → single same-name child of equal width) into a single bar. Helps deep recursive call chains fit on screen.",labelAlign:z.Left,size:T.S,value:K,onChange:Z}),e($,{$gap:8,children:[e($,{children:[n(I,{variant:F.Secondary,size:N.S,label:"Reset zoom",leftIcon:ze,onClick:me,disabled:!X.length}),n(I,{variant:F.Secondary,size:N.S,iconSize:20,leftIcon:Ie,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!he,onClick:pe}),n("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:n(P,{size:O.XXS,color:E.Secondary,nowrap:!0,align:"center",children:`${ce}%`})}),n(I,{variant:F.Secondary,size:N.S,iconSize:20,leftIcon:Ne,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!ue,onClick:ge})]}),e($,{children:[n(R,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:n(L,{size:M.S,variant:D.Filled,options:[{value:Je.Fit,label:"W: Fit"},{value:Je.X10,label:"10x"}],selected:H,setSelected:_})}),n(R,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:n(L,{size:M.S,variant:D.Filled,options:[{value:Ke.Fit,label:"H: Fit"},{value:Ke.X10,label:"10x"}],selected:U,setSelected:J})})]}),n(I,{variant:F.Secondary,size:N.S,iconSize:24,leftIcon:Y?Fe:Pe,tooltip:Y?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:se})]})]}),n(R,{fullWidth:!0,keepAlive:!0,text:k,children:n("div",{ref:v,style:{flex:1,minWidth:0,width:"100%",height:Y?"calc(100vh - 80px)":"calc(100vh - 370px)",position:"relative",overflowX:H>1?"auto":"hidden",overflowY:U>1?"auto":"hidden"},children:n("div",{style:{width:G||"100%",height:q||"100%",position:"relative"},children:n("canvas",{ref:y,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:B?"pointer":"default"},onPointerDown:re,onPointerMove:oe,onPointerLeave:le,onClick:ae})})})}),e($,{$justifyContent:"space-between",children:[n(P,Q?{size:O.XXXS,color:g.v2.colors.silver[300],children:`Zoomed: ${fe} • ${Xe(ee)} samples in view`}:{size:O.XXXS,color:g.v2.colors.silver[300],children:"Click a frame to zoom into its subtree (pprof-style)."}),p&&n(P,{size:O.XXXS,color:g.v2.colors.silver[300],children:`${p.activeKeys.length} / ${p.maxSlots} profiling slots · ${qe(p.totalBytesUsed)} / ${qe(p.maxTotalBytesBudget)} budget · TTL ${p.slotTtlSeconds}s`})]})]})};var et,tt;!function(e){e.Symbol="symbol",e.Self="self",e.Total="total"}(et||(et={})),function(e){e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"}(tt||(tt={}));const nt=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function it(e,t){const n=function(e){return e.split(" ")[0]??""}(e);if(t.includes(tt.FilterOutVoid)&&"void"===n)return!1;if(t.includes(tt.OnlyWithReturnValues)){if(!(e.includes(" ")&&"void"!==n&&nt.test(n)))return!1}return!0}const ot={options:[{id:tt.FilterOutVoid,label:"Filter out void symbols"},{id:tt.OnlyWithReturnValues,label:"Only show functions with return values"}],filterRow:(e,t)=>it(e.cells.find(e=>e.key===et.Symbol)?.rawValue?.toString()??"",t)},lt=({rows:e,languages:t,filters:i,onFiltersChange:o})=>{const l=c(()=>[{key:et.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:t?.includes(A.Java)?ot:void 0,noFilter:!t?.includes(A.Java)},{key:et.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:et.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[t]),r=c(()=>e.map(e=>({cells:[{key:et.Symbol,rawValue:e.name},{key:et.Self,rawValue:Xe(e.self)},{key:et.Total,rawValue:Xe(e.total)}]})),[e]);return n(B,{variant:W.Data,maxHeight:"calc(100vh - 306px)",columns:l,rows:r,filters:i,onFiltersChange:o,rowActionsPushLeftPosition:"12px",getRowActions:e=>[{id:`copy-${e.cells[0].rawValue}`,label:"",rightIcon:Ee,onClick:()=>{navigator.clipboard.writeText(e.cells[0].rawValue)}}]})};var rt;!function(e){e.Table="table",e.Flame="flame",e.Both="both"}(rt||(rt={}));const at=f(_)`
2
2
  width: 100%;
3
3
  min-height: 0;
4
4
  flex: 1;
@@ -1,4 +1,4 @@
1
- import{aL as e,a,ao as t,j as l,l as r,ee as o,ag as s,b0 as i,as as n,al as d,b5 as c,an as p,ai as u,aj as h,a4 as g,ba as m,F as v,y as f,af as b,S as y,s as S,aW as x,ef as k,eg as C,k as w,eh as T,n as $,ei as P,o as L,p as A,ej as M,ek as O,el as N,em as z,en as X,eo as D,ep as R,eq as I,er as E,es as H,et as B,eu as V,ev as j,bQ as K,B as U,ew as q,ex as G,ey as J,ez as W,eA as F,eB as Q,eC as Z,eD as Y,eE as _,eF as ee,aQ as ae,eG as te,eH as le,aX as re,eI as oe,eJ as se,eK as ie,eL as ne,eM as de,bD as ce,eN as pe,eO as ue,eP as he,eQ as ge,eR as me,eS as ve,eT as fe,eU as be,eV as ye,cA as Se,m as xe,eW as ke,eX as Ce,eY as we,eZ as Te,e_ as $e,e$ as Pe,f0 as Le,f1 as Ae,f2 as Me,f3 as Oe,av as Ne,f4 as ze,R as Xe,f5 as De,f6 as Re,f7 as Ie,f8 as Ee,c8 as He,P as Be,aJ as Ve,$ as je,c2 as Ke,ah as Ue,f9 as qe,ce as Ge,b as Je,N as We,bk as Fe,L as Qe,cr as Ze,w as Ye}from"./ui-components-of0mjGMv.js";import{jsx as _e,jsxs as ea,Fragment as aa}from"react/jsx-runtime";import{OdigosLogoTextEnterprise as ta,OdigosLogoTextCommunity as la,EditIcon as ra,ArrowLeftIcon as oa,ArrowRightIcon as sa,VSquareIcon as ia}from"../icons.js";import{useCallback as na,useMemo as da,useState as ca,useRef as pa,useEffect as ua,forwardRef as ha,useImperativeHandle as ga}from"react";import ma from"styled-components";import"./index-Cw4LkdaE.js";const va=({isOpen:t,onClose:l,onDeny:r,onApprove:o})=>_e(e,{title:"Discard changes?",description:"You have unsaved changes.\nIf you cancel now, your changes won't be saved.",isOpen:t,onClose:l,denyButton:{label:"Keep editing",variant:a.Secondary,onClick:()=>{r?.(),l()}},approveButton:{label:"Discard changes",variant:a.Primary,onClick:()=>{o?.(),l()}}}),fa=({isOpen:t,onClose:l,onDeny:r,onApprove:o,action:s="delete",target:i})=>{const n=s.charAt(0).toUpperCase()+s.substring(1),d=i?.endsWith("s")?"these":"this";return _e(e,{title:`${n}${i?` ${i}`:""}?`,description:`Are you sure you want to ${s}${i?` ${d} ${i}`:""}?`,isOpen:t,onClose:l,denyButton:{label:"Go back",variant:a.Secondary,onClick:()=>{r?.(),l()}},approveButton:{label:n,variant:a.Primary,onClick:()=>{o?.(),l()}}})},ba=({componentType:e,inputType:a,name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:S,value:x,setValue:k,errorMessage:C,warnMessage:w,helpMessage:T,dropdownOptions:$,dropdownNoSearch:P,dropdownNoCheckbox:L,timeUnits:A,timeDefaultUnit:M})=>{switch(e){case t.Input:return _e(u,{name:g,type:a,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:S,value:x??"",onChange:e=>{const t=e.target.value;k(a===h.Number?""===t?null:Number(t):t)},errorMessage:C,warnMessage:w,helpMessage:T},g);case t.MultiInput:return _e(p,{name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:S,values:Array.isArray(x)?x:c(x,[]),setValues:e=>k(e),errorMessage:C,warnMessage:w,helpMessage:T},g);case t.KeyValuePair:return _e(d,{name:g,label:m,tooltip:v,badge:f,required:y,disabled:S,limitFieldsPerRow:2,columns:[{keyName:"key",label:"Key"},{keyName:"value",label:"Value"}],values:Array.isArray(x)?x:c(x,[]),setValues:e=>k(e),errorMessage:C,warnMessage:w,helpMessage:T},g);case t.TextArea:return _e(n,{name:g,label:m,tooltip:v,badge:f,required:y,disabled:S,placeholder:b,value:x??"",onChange:e=>k(e.target.value),errorMessage:C,warnMessage:w,helpMessage:T},g);case t.Dropdown:return _e(i,{name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:S,withSearch:!P,options:$?.map(e=>({id:e.id||"",label:e.value||"",withCheckbox:!L}))||[],values:x?[String(x)]:[],setValues:e=>k(e[0]),errorMessage:C,warnMessage:w,helpMessage:T},g);case t.Checkbox:return _e(s,{name:g,label:m,tooltip:v,badge:f,value:!0===x||"true"===x,onChange:e=>k(e),disabled:S,errorMessage:C,warnMessage:w,helpMessage:T},g);case t.Time:return _e(o,{name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:S,value:x??"",setValue:e=>k(e),units:A,defaultUnit:M,errorMessage:C,warnMessage:w,helpMessage:T},g);case t.Toggle:return _e(l,{name:g,labelAlign:r.Right,label:m,tooltip:v,badge:f,value:!0===x||"true"===x,onChange:e=>k(e),disabled:S,errorMessage:C,warnMessage:w,helpMessage:T},g);default:return null}},ya=({size:e=200})=>{const{tier:a}=g();return a===m.Onprem?_e(ta,{size:e}):_e(la,{size:e})},Sa=[{value:"50",label:"50%"},{value:"25",label:"25%"},{value:"10",label:"10%"},{value:"1",label:"1%"},{value:"custom",label:"Custom"}],xa=[{value:"10",label:"10%"},{value:"1",label:"1%"},{value:"0.5",label:"0.5%"},{value:"0.1",label:"0.1%"},{value:"custom",label:"Custom"}],ka=[{value:"5000",label:"5s"},{value:"1000",label:"1s"},{value:"500",label:"500ms"},{value:"100",label:"100ms"},{value:"50",label:"50ms"},{value:"custom",label:"Custom"}],Ca=({description:e,options:a,selected:t,onSelect:l,customName:r,customLabel:o,customPlaceholder:s,customValue:i,onCustomChange:n})=>ea(v,{$gap:16,$alignItems:"flex-end",children:[ea(f,{$gap:6,children:[_e(b,{label:e}),_e(y,{size:S.S,options:a,selected:t,setSelected:l})]}),"custom"===t&&_e(u,{name:r,label:o,placeholder:s,type:h.Number,value:i,onChange:n,width:160})]}),wa=()=>{},Ta=e=>e.readOnly?_e($a,{rule:e.rule}):_e(Pa,{ruleType:e.ruleType,formState:e.formState,onChange:e.onChange}),$a=({rule:e})=>{const a=null!=e.durationAtLeastMs;return e.error?_e(x,{richTitle:{title:k},children:_e(l,{name:"sampling-view-toggle-keep-errors",onChange:wa,value:!0,size:w.S,label:C,labelAlign:r.Right})}):a?_e(x,{richTitle:{title:T},children:ea("div",{children:[_e($,{size:A.XXXS,color:L.Secondary,children:P}),_e($,{size:A.XS,children:`${e.durationAtLeastMs}ms`})]})}):null},Pa=({ruleType:e,formState:a,onChange:t})=>{const o=na(e=>t({durationPreset:e}),[t]),s=na(e=>t({customDurationMs:e.target.value}),[t]);return"Error"===e?_e(x,{richTitle:{title:k,subTitle:M},children:_e(l,{name:"sampling-toggle-keep-errors",value:!0,onChange:wa,size:w.S,label:C,labelAlign:r.Right})}):"Duration"===e?_e(x,{richTitle:{title:T,subTitle:O},children:_e(Ca,{description:P,options:ka,selected:a.durationPreset,onSelect:o,customName:"sampling-input-custom-duration",customLabel:N,customPlaceholder:"200ms",customValue:a.customDurationMs,onCustomChange:s})}):null},La=ma.div`
1
+ import{cA as e,a,as as t,j as l,l as r,fs as i,cn as o,cP as s,cu as n,cq as d,bC as c,cr as p,cp as u,ak as h,a4 as g,b_ as m,F as v,y as f,cm as b,S as y,s as S,cL as x,ft as k,fu as C,k as w,fv as T,n as $,fw as P,o as L,p as A,fx as M,fy as O,fz as N,fA as z,fB as R,fC as X,fD as D,e5 as I,fE as E,fF as H,fG as B,fH as V,fI as K,di as j,B as U,fJ as q,fK as G,fL as J,fM as W,fN as F,fO as Z,fP as Y,fQ as _,fR as Q,fS as ee,cF as ae,fT as te,fU as le,cM as re,fV as ie,fW as oe,fX as se,fY as ne,fZ as de,d7 as ce,f_ as pe,f$ as ue,g0 as he,g1 as ge,g2 as me,g3 as ve,g4 as fe,g5 as be,g6 as ye,dm as Se,m as xe,g7 as ke,g8 as Ce,g9 as we,ga as Te,gb as $e,gc as Pe,gd as Le,ge as Ae,gf as Me,gg as Oe,cw as Ne,gh as ze,R as Re,gi as Xe,gj as De,gk as Ie,gl as Ee,eL as He,P as Be,bW as Ve,$ as Ke,br as je,co as Ue,gm as qe,b6 as Ge,b as Je,N as We,c4 as Fe,L as Ze,eO as Ye,w as _e}from"./ui-components-BogDd0Qc.js";import{jsx as Qe,jsxs as ea,Fragment as aa}from"react/jsx-runtime";import{OdigosLogoTextEnterprise as ta,OdigosLogoTextCommunity as la,EditIcon as ra,ArrowLeftIcon as ia,ArrowRightIcon as oa,VSquareIcon as sa}from"../icons.js";import{useCallback as na,useMemo as da,useState as ca,useRef as pa,useEffect as ua,forwardRef as ha,useImperativeHandle as ga}from"react";import ma from"styled-components";import"./index-eOSrP07c.js";const va=({isOpen:t,onClose:l,onDeny:r,onApprove:i})=>Qe(e,{title:"Discard changes?",description:"You have unsaved changes.\nIf you cancel now, your changes won't be saved.",isOpen:t,onClose:l,denyButton:{label:"Keep editing",variant:a.Secondary,onClick:()=>{r?.(),l()}},approveButton:{label:"Discard changes",variant:a.Primary,onClick:()=>{i?.(),l()}}}),fa=({isOpen:t,onClose:l,onDeny:r,onApprove:i,action:o="delete",target:s})=>{const n=o.charAt(0).toUpperCase()+o.substring(1),d=s?.endsWith("s")?"these":"this";return Qe(e,{title:`${n}${s?` ${s}`:""}?`,description:`Are you sure you want to ${o}${s?` ${d} ${s}`:""}?`,isOpen:t,onClose:l,denyButton:{label:"Go back",variant:a.Secondary,onClick:()=>{r?.(),l()}},approveButton:{label:n,variant:a.Primary,onClick:()=>{i?.(),l()}}})},ba=({componentType:e,inputType:a,name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:S,value:x,setValue:k,errorMessage:C,warnMessage:w,helpMessage:T,dropdownOptions:$,dropdownNoSearch:P,dropdownNoCheckbox:L,timeUnits:A,timeDefaultUnit:M})=>{switch(e){case t.Input:return Qe(u,{name:g,type:a,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:S,value:x??"",onChange:e=>{const t=e.target.value;k(a===h.Number?""===t?null:Number(t):t)},errorMessage:C,warnMessage:w,helpMessage:T},g);case t.MultiInput:return Qe(p,{name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:S,values:Array.isArray(x)?x:c(x,[]),setValues:e=>k(e),errorMessage:C,warnMessage:w,helpMessage:T},g);case t.KeyValuePair:return Qe(d,{name:g,label:m,tooltip:v,badge:f,required:y,disabled:S,limitFieldsPerRow:2,columns:[{keyName:"key",label:"Key"},{keyName:"value",label:"Value"}],values:Array.isArray(x)?x:c(x,[]),setValues:e=>k(e),errorMessage:C,warnMessage:w,helpMessage:T},g);case t.TextArea:return Qe(n,{name:g,label:m,tooltip:v,badge:f,required:y,disabled:S,placeholder:b,value:x??"",onChange:e=>k(e.target.value),errorMessage:C,warnMessage:w,helpMessage:T},g);case t.Dropdown:return Qe(s,{name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:S,withSearch:!P,options:$?.map(e=>({id:e.id||"",label:e.value||"",withCheckbox:!L}))||[],values:x?[String(x)]:[],setValues:e=>k(e[0]),errorMessage:C,warnMessage:w,helpMessage:T},g);case t.Checkbox:return Qe(o,{name:g,label:m,tooltip:v,badge:f,value:!0===x||"true"===x,onChange:e=>k(e),disabled:S,errorMessage:C,warnMessage:w,helpMessage:T},g);case t.Time:return Qe(i,{name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:S,value:x??"",setValue:e=>k(e),units:A,defaultUnit:M,errorMessage:C,warnMessage:w,helpMessage:T},g);case t.Toggle:return Qe(l,{name:g,labelAlign:r.Right,label:m,tooltip:v,badge:f,value:!0===x||"true"===x,onChange:e=>k(e),disabled:S,errorMessage:C,warnMessage:w,helpMessage:T},g);default:return null}},ya=({size:e=200})=>{const{tier:a}=g();return a===m.Onprem?Qe(ta,{size:e}):Qe(la,{size:e})},Sa=[{value:"50",label:"50%"},{value:"25",label:"25%"},{value:"10",label:"10%"},{value:"1",label:"1%"},{value:"custom",label:"Custom"}],xa=[{value:"10",label:"10%"},{value:"1",label:"1%"},{value:"0.5",label:"0.5%"},{value:"0.1",label:"0.1%"},{value:"custom",label:"Custom"}],ka=[{value:"5000",label:"5s"},{value:"1000",label:"1s"},{value:"500",label:"500ms"},{value:"100",label:"100ms"},{value:"50",label:"50ms"},{value:"custom",label:"Custom"}],Ca=({description:e,options:a,selected:t,onSelect:l,customName:r,customLabel:i,customPlaceholder:o,customValue:s,onCustomChange:n})=>ea(v,{$gap:16,$alignItems:"flex-end",children:[ea(f,{$gap:6,children:[Qe(b,{label:e}),Qe(y,{size:S.S,options:a,selected:t,setSelected:l})]}),"custom"===t&&Qe(u,{name:r,label:i,placeholder:o,type:h.Number,value:s,onChange:n,width:160})]}),wa=()=>{},Ta=e=>e.readOnly?Qe($a,{rule:e.rule}):Qe(Pa,{ruleType:e.ruleType,formState:e.formState,onChange:e.onChange}),$a=({rule:e})=>{const a=null!=e.durationAtLeastMs;return e.error?Qe(x,{richTitle:{title:k},children:Qe(l,{name:"sampling-view-toggle-keep-errors",onChange:wa,value:!0,size:w.S,label:C,labelAlign:r.Right})}):a?Qe(x,{richTitle:{title:T},children:ea("div",{children:[Qe($,{size:A.XXXS,color:L.Secondary,children:P}),Qe($,{size:A.XS,children:`${e.durationAtLeastMs}ms`})]})}):null},Pa=({ruleType:e,formState:a,onChange:t})=>{const i=na(e=>t({durationPreset:e}),[t]),o=na(e=>t({customDurationMs:e.target.value}),[t]);return"Error"===e?Qe(x,{richTitle:{title:k,subTitle:M},children:Qe(l,{name:"sampling-toggle-keep-errors",value:!0,onChange:wa,size:w.S,label:C,labelAlign:r.Right})}):"Duration"===e?Qe(x,{richTitle:{title:T,subTitle:O},children:Qe(Ca,{description:P,options:ka,selected:a.durationPreset,onSelect:i,customName:"sampling-input-custom-duration",customLabel:N,customPlaceholder:"200ms",customValue:a.customDurationMs,onCustomChange:o})}):null},La=ma.div`
2
2
  display: flex;
3
3
  gap: 32px;
4
4
  `,Aa=ma.div`
@@ -26,34 +26,34 @@ import{aL as e,a,ao as t,j as l,l as r,ee as o,ag as s,b0 as i,as as n,al as d,b
26
26
  display: flex;
27
27
  align-items: center;
28
28
  height: 32px;
29
- `,Xa=ma.div`
29
+ `,Ra=ma.div`
30
30
  display: flex;
31
31
  align-items: flex-end;
32
32
  gap: 16px;
33
33
  margin-bottom: 12px;
34
- `,Da="Any",Ra="Kafka topic",Ia=()=>_e("div",{style:{marginBottom:"8px"},children:_e($,{size:A.XS,weight:500,children:"And"})}),Ea=[{value:"all",label:"All Operations"},{value:"httpServer",label:"HTTP Server"},{value:"httpClient",label:"HTTP Client"}],Ha=[{value:"all",label:"All Operations"},{value:"httpServer",label:"HTTP Server"},{value:"kafkaConsumer",label:"Kafka Consumer"},{value:"kafkaProducer",label:"Kafka Producer"}],Ba=[{id:"",label:Da},{id:"GET",label:"GET"},{id:"POST",label:"POST"},{id:"PUT",label:"PUT"},{id:"DELETE",label:"DELETE"},{id:"PATCH",label:"PATCH"}];const Va=e=>e.readOnly?_e(ja,{data:e.data}):_e(Ka,{category:e.category,formState:e.formState,onChange:e.onChange}),ja=({data:e})=>{const a=da(()=>function(e){if("noisy"===e.category){const a=e.rule.operation;if(a?.httpServer)return[{id:"type",title:W,value:J},{id:"route",title:B,value:a.httpServer.route||a.httpServer.routePrefix||F},{id:"method",title:q,value:a.httpServer.method||Da}];if(a?.httpClient){const e=[{id:"type",title:W,value:Q}];return a.httpClient.serverAddress&&e.push({id:"serverAddress",title:"Server address",value:a.httpClient.serverAddress}),e.push({id:"route",title:B,value:a.httpClient.templatedPath||a.httpClient.templatedPathPrefix||F}),e.push({id:"method",title:q,value:a.httpClient.method||Da}),e}return[{id:"type",title:W,value:Z}]}const a=e.rule.operation;return a?.httpServer?[{id:"type",title:W,value:J},{id:"route",title:B,value:a.httpServer.route||a.httpServer.routePrefix||F},{id:"method",title:q,value:a.httpServer.method||Da}]:a?.kafkaConsumer?[{id:"type",title:W,value:Y},{id:"topic",title:Ra,value:a.kafkaConsumer.kafkaTopic||F}]:a?.kafkaProducer?[{id:"type",title:W,value:_},{id:"topic",title:Ra,value:a.kafkaProducer.kafkaTopic||F}]:[{id:"type",title:W,value:Z}]}(e),[e]);return _e(x,{richTitle:{title:z},children:_e(La,{children:a.map(({id:e,title:a,value:t})=>ea(Aa,{children:[_e($,{size:A.XXXS,color:L.Secondary,nowrap:!0,children:a}),_e($,{size:A.XS,nowrap:!0,children:t})]},e))})})},Ka=({category:e,formState:t,onChange:l})=>{const r=da(()=>"noisy"===e?Ea:Ha,[e]),o=na(e=>l({operationType:e,route:"",serverAddress:"",method:"",kafkaTopic:""}),[l]),s=na(e=>a=>{a&&l({routeType:e,route:""})},[l]),i=na(e=>l({route:e.target.value}),[l]),n=na(e=>l({serverAddress:e.target.value}),[l]),d=na(e=>l({method:e[0]||""}),[l]),c=na(e=>l({kafkaTopic:e.target.value}),[l]),p="httpServer"===t.operationType||"httpClient"===t.operationType,h="kafkaConsumer"===t.operationType||"kafkaProducer"===t.operationType,g="httpClient"===t.operationType?H:B,m="httpClient"===t.operationType?V:j;return ea(x,{richTitle:{title:`2. ${z}`,subTitle:X},children:[_e(f,{$alignItems:"flex-start",children:_e(y,{size:S.S,options:r,selected:t.operationType,setSelected:o})}),p&&ea(Ma,{children:["httpClient"===t.operationType&&ea(Xa,{children:[_e(u,{name:"sampling-input-server-address",label:R,placeholder:D,value:t.serverAddress,onChange:n}),_e(Ia,{})]}),ea(Oa,{children:[ea(Na,{children:[_e(za,{children:_e(I,{"data-id":"sampling-radio-route",value:"route"===t.routeType,onChange:s("route")})}),_e(u,{name:"sampling-input-route",label:g,placeholder:E,value:"route"===t.routeType?t.route:"",onChange:i,disabled:"route"!==t.routeType})]}),ea(Na,{children:[_e(za,{children:_e(I,{"data-id":"sampling-radio-route-prefix",value:"routePrefix"===t.routeType,onChange:s("routePrefix")})}),_e(u,{name:"sampling-input-route-prefix",label:m,placeholder:E,value:"routePrefix"===t.routeType?t.route:"",onChange:i,disabled:"routePrefix"!==t.routeType})]})]}),ea(Xa,{children:[_e(Ia,{}),_e(K,{label:q,items:Ba,selectedIds:[t.method||""],setSelectedIds:e=>d(e),buttonProps:{"data-id":"sampling-btn-method",label:Ba.find(e=>e.id===t.method)?.label||Da,size:U.S,variant:a.Secondary}})]})]}),h&&_e(u,{name:"sampling-input-kafka-topic",label:G,placeholder:"Type kafka topic",value:t.kafkaTopic,onChange:c,width:"320px"})]})},Ua=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],qa=[{value:"all",label:"Keep All"},{value:"sample",label:"Sample"}];const Ga=e=>e.readOnly?_e(Ja,{data:e.data}):_e(Wa,{category:e.category,formState:e.formState,onChange:e.onChange}),Ja=({data:e})=>{const a=da(()=>function(e){switch(e.category){case"highlyRelevant":return null!=e.rule.percentageAtLeast?{title:te,method:ie,description:oe,value:`${e.rule.percentageAtLeast}%`}:{title:te,method:de,description:null,value:null};case"noisy":return null!=e.rule.percentageAtMost?{title:le,method:ie,description:se,value:`${e.rule.percentageAtMost}%`}:{title:le,method:ne,description:null,value:null};case"costReduction":return{title:le,method:ie,description:se,value:`${e.rule.percentageAtMost}%`}}}(e),[e]),t=[{id:"method",title:q,value:a.method},...null!=a.description?[{id:"value",title:a.description,value:a.value}]:[]];return _e(x,{richTitle:{title:a.title},children:_e(La,{children:t.map(({id:e,title:a,value:t})=>ea(Aa,{children:[_e($,{size:A.XXXS,color:L.Secondary,nowrap:!0,children:a}),_e($,{size:A.XS,nowrap:!0,children:t})]},e))})})},Wa=({category:e,formState:a,onChange:t})=>{const l="highlyRelevant"===e,r=l?qa:Ua,o=`${l?4:3}. ${l?te:le}`,s=l?ee:ae,i=l?oe:se,n="noisy"===e?xa:Sa,d=na(e=>t({percentageMode:e}),[t]),c=na(e=>t({percentagePreset:e}),[t]),p=na(e=>t({customPercentage:e.target.value}),[t]);return ea(x,{richTitle:{title:o,subTitle:s},children:["costReduction"!==e&&_e(f,{$alignItems:"flex-start",children:_e(y,{size:S.S,options:r,selected:a.percentageMode,setSelected:d})}),("costReduction"===e||"sample"===a.percentageMode)&&_e(Ca,{description:i,options:n,selected:a.percentagePreset,onSelect:c,customName:"sampling-input-custom-percentage",customLabel:re,customPlaceholder:"5%",customValue:a.customPercentage,onCustomChange:p})]})},Fa=ma.div`
34
+ `,Xa="Any",Da="Kafka topic",Ia=()=>Qe("div",{style:{marginBottom:"8px"},children:Qe($,{size:A.XS,weight:500,children:"And"})}),Ea=[{value:"all",label:"All Operations"},{value:"httpServer",label:"HTTP Server"},{value:"httpClient",label:"HTTP Client"}],Ha=[{value:"all",label:"All Operations"},{value:"httpServer",label:"HTTP Server"},{value:"kafkaConsumer",label:"Kafka Consumer"},{value:"kafkaProducer",label:"Kafka Producer"}],Ba=[{id:"",label:Xa},{id:"GET",label:"GET"},{id:"POST",label:"POST"},{id:"PUT",label:"PUT"},{id:"DELETE",label:"DELETE"},{id:"PATCH",label:"PATCH"}];const Va=e=>e.readOnly?Qe(Ka,{data:e.data}):Qe(ja,{category:e.category,formState:e.formState,onChange:e.onChange}),Ka=({data:e})=>{const a=da(()=>function(e){if("noisy"===e.category){const a=e.rule.operation;if(a?.httpServer)return[{id:"type",title:W,value:J},{id:"route",title:B,value:a.httpServer.route||a.httpServer.routePrefix||F},{id:"method",title:q,value:a.httpServer.method||Xa}];if(a?.httpClient){const e=[{id:"type",title:W,value:Z}];return a.httpClient.serverAddress&&e.push({id:"serverAddress",title:"Server address",value:a.httpClient.serverAddress}),e.push({id:"route",title:B,value:a.httpClient.templatedPath||a.httpClient.templatedPathPrefix||F}),e.push({id:"method",title:q,value:a.httpClient.method||Xa}),e}return[{id:"type",title:W,value:Y}]}const a=e.rule.operation;return a?.httpServer?[{id:"type",title:W,value:J},{id:"route",title:B,value:a.httpServer.route||a.httpServer.routePrefix||F},{id:"method",title:q,value:a.httpServer.method||Xa}]:a?.kafkaConsumer?[{id:"type",title:W,value:_},{id:"topic",title:Da,value:a.kafkaConsumer.kafkaTopic||F}]:a?.kafkaProducer?[{id:"type",title:W,value:Q},{id:"topic",title:Da,value:a.kafkaProducer.kafkaTopic||F}]:[{id:"type",title:W,value:Y}]}(e),[e]);return Qe(x,{richTitle:{title:z},children:Qe(La,{children:a.map(({id:e,title:a,value:t})=>ea(Aa,{children:[Qe($,{size:A.XXXS,color:L.Secondary,nowrap:!0,children:a}),Qe($,{size:A.XS,nowrap:!0,children:t})]},e))})})},ja=({category:e,formState:t,onChange:l})=>{const r=da(()=>"noisy"===e?Ea:Ha,[e]),i=na(e=>l({operationType:e,route:"",serverAddress:"",method:"",kafkaTopic:""}),[l]),o=na(e=>a=>{a&&l({routeType:e,route:""})},[l]),s=na(e=>l({route:e.target.value}),[l]),n=na(e=>l({serverAddress:e.target.value}),[l]),d=na(e=>l({method:e[0]||""}),[l]),c=na(e=>l({kafkaTopic:e.target.value}),[l]),p="httpServer"===t.operationType||"httpClient"===t.operationType,h="kafkaConsumer"===t.operationType||"kafkaProducer"===t.operationType,g="httpClient"===t.operationType?H:B,m="httpClient"===t.operationType?V:K;return ea(x,{richTitle:{title:`2. ${z}`,subTitle:R},children:[Qe(f,{$alignItems:"flex-start",children:Qe(y,{size:S.S,options:r,selected:t.operationType,setSelected:i})}),p&&ea(Ma,{children:["httpClient"===t.operationType&&ea(Ra,{children:[Qe(u,{name:"sampling-input-server-address",label:D,placeholder:X,value:t.serverAddress,onChange:n}),Qe(Ia,{})]}),ea(Oa,{children:[ea(Na,{children:[Qe(za,{children:Qe(I,{"data-id":"sampling-radio-route",value:"route"===t.routeType,onChange:o("route")})}),Qe(u,{name:"sampling-input-route",label:g,placeholder:E,value:"route"===t.routeType?t.route:"",onChange:s,disabled:"route"!==t.routeType})]}),ea(Na,{children:[Qe(za,{children:Qe(I,{"data-id":"sampling-radio-route-prefix",value:"routePrefix"===t.routeType,onChange:o("routePrefix")})}),Qe(u,{name:"sampling-input-route-prefix",label:m,placeholder:E,value:"routePrefix"===t.routeType?t.route:"",onChange:s,disabled:"routePrefix"!==t.routeType})]})]}),ea(Ra,{children:[Qe(Ia,{}),Qe(j,{label:q,items:Ba,selectedIds:[t.method||""],setSelectedIds:e=>d(e),buttonProps:{"data-id":"sampling-btn-method",label:Ba.find(e=>e.id===t.method)?.label||Xa,size:U.S,variant:a.Secondary}})]})]}),h&&Qe(u,{name:"sampling-input-kafka-topic",label:G,placeholder:"Type kafka topic",value:t.kafkaTopic,onChange:c,width:"320px"})]})},Ua=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],qa=[{value:"all",label:"Keep All"},{value:"sample",label:"Sample"}];const Ga=e=>e.readOnly?Qe(Ja,{data:e.data}):Qe(Wa,{category:e.category,formState:e.formState,onChange:e.onChange}),Ja=({data:e})=>{const a=da(()=>function(e){switch(e.category){case"highlyRelevant":return null!=e.rule.percentageAtLeast?{title:te,method:se,description:ie,value:`${e.rule.percentageAtLeast}%`}:{title:te,method:de,description:null,value:null};case"noisy":return null!=e.rule.percentageAtMost?{title:le,method:se,description:oe,value:`${e.rule.percentageAtMost}%`}:{title:le,method:ne,description:null,value:null};case"costReduction":return{title:le,method:se,description:oe,value:`${e.rule.percentageAtMost}%`}}}(e),[e]),t=[{id:"method",title:q,value:a.method},...null!=a.description?[{id:"value",title:a.description,value:a.value}]:[]];return Qe(x,{richTitle:{title:a.title},children:Qe(La,{children:t.map(({id:e,title:a,value:t})=>ea(Aa,{children:[Qe($,{size:A.XXXS,color:L.Secondary,nowrap:!0,children:a}),Qe($,{size:A.XS,nowrap:!0,children:t})]},e))})})},Wa=({category:e,formState:a,onChange:t})=>{const l="highlyRelevant"===e,r=l?qa:Ua,i=`${l?4:3}. ${l?te:le}`,o=l?ee:ae,s=l?ie:oe,n="noisy"===e?xa:Sa,d=na(e=>t({percentageMode:e}),[t]),c=na(e=>t({percentagePreset:e}),[t]),p=na(e=>t({customPercentage:e.target.value}),[t]);return ea(x,{richTitle:{title:i,subTitle:o},children:["costReduction"!==e&&Qe(f,{$alignItems:"flex-start",children:Qe(y,{size:S.S,options:r,selected:a.percentageMode,setSelected:d})}),("costReduction"===e||"sample"===a.percentageMode)&&Qe(Ca,{description:s,options:n,selected:a.percentagePreset,onSelect:c,customName:"sampling-input-custom-percentage",customLabel:re,customPlaceholder:"5%",customValue:a.customPercentage,onCustomChange:p})]})},Fa=ma.div`
35
35
  display: flex;
36
36
  align-items: flex-end;
37
37
  gap: 16px;
38
- `,Qa=ma.div`
38
+ `,Za=ma.div`
39
39
  width: 280px;
40
40
  flex-shrink: 0;
41
- `,Za=ma.div`
41
+ `,Ya=ma.div`
42
42
  flex: 1;
43
43
  min-width: 0;
44
- `;function Ya(e){return"highlyRelevant"===e.category?e.rule.error?"Error":null!=e.rule.durationAtLeastMs?"Duration":"Relevance":fe[e.category]}const _a=e=>e.readOnly?_e(et,{data:e.data}):_e(at,{formState:e.formState,onChange:e.onChange}),et=({data:e})=>{const a=da(()=>[{id:"name",title:pe,value:e.rule.name||ce},{id:"type",title:ue,value:Ya(e)}],[e]),t=e.rule.notes||F;return ea(x,{children:[_e(La,{children:a.map(({id:e,title:a,value:t})=>ea(Aa,{children:[_e($,{size:A.XXXS,color:L.Secondary,nowrap:!0,children:a}),_e($,{size:A.XS,nowrap:!0,children:t})]},e))}),ea(Aa,{children:[_e($,{size:A.XXXS,color:L.Secondary,children:he}),_e($,{size:A.XS,children:t})]})]})},at=({formState:e,onChange:a})=>{const t=na(e=>a({name:e.target.value}),[a]),l=na(e=>a({notes:e.target.value}),[a]);return _e(x,{children:ea(Fa,{children:[_e(Qa,{children:_e(u,{name:"sampling-input-rule-name",label:pe,tooltip:"Optional. Give this rule a name for easier identification.",placeholder:ge,value:e.name,onChange:t})}),_e(Za,{children:_e(u,{name:"sampling-input-note",label:he,tooltip:ve,placeholder:me,value:e.notes,onChange:l})})]})})},tt=[{value:"Relevance",label:"Relevance"},{value:"Error",label:"Error"},{value:"Duration",label:"Duration"}],lt=({formState:e,onChange:a})=>{const t=na(e=>a({ruleType:e,keepErrors:"Error"===e}),[a]);return _e(x,{richTitle:{title:`3. ${ue}`,subTitle:be},children:_e(f,{$alignItems:"flex-start",children:_e(y,{size:S.S,options:tt,selected:e.ruleType,setSelected:t})})})},rt=ma.div`
44
+ `;function _a(e){return"highlyRelevant"===e.category?e.rule.error?"Error":null!=e.rule.durationAtLeastMs?"Duration":"Relevance":fe[e.category]}const Qa=e=>e.readOnly?Qe(et,{data:e.data}):Qe(at,{formState:e.formState,onChange:e.onChange}),et=({data:e})=>{const a=da(()=>[{id:"name",title:pe,value:e.rule.name||ce},{id:"type",title:ue,value:_a(e)}],[e]),t=e.rule.notes||F;return ea(x,{children:[Qe(La,{children:a.map(({id:e,title:a,value:t})=>ea(Aa,{children:[Qe($,{size:A.XXXS,color:L.Secondary,nowrap:!0,children:a}),Qe($,{size:A.XS,nowrap:!0,children:t})]},e))}),ea(Aa,{children:[Qe($,{size:A.XXXS,color:L.Secondary,children:he}),Qe($,{size:A.XS,children:t})]})]})},at=({formState:e,onChange:a})=>{const t=na(e=>a({name:e.target.value}),[a]),l=na(e=>a({notes:e.target.value}),[a]);return Qe(x,{children:ea(Fa,{children:[Qe(Za,{children:Qe(u,{name:"sampling-input-rule-name",label:pe,tooltip:"Optional. Give this rule a name for easier identification.",placeholder:ge,value:e.name,onChange:t})}),Qe(Ya,{children:Qe(u,{name:"sampling-input-note",label:he,tooltip:ve,placeholder:me,value:e.notes,onChange:l})})]})})},tt=[{value:"Relevance",label:"Relevance"},{value:"Error",label:"Error"},{value:"Duration",label:"Duration"}],lt=({formState:e,onChange:a})=>{const t=na(e=>a({ruleType:e,keepErrors:"Error"===e}),[a]);return Qe(x,{richTitle:{title:`3. ${ue}`,subTitle:be},children:Qe(f,{$alignItems:"flex-start",children:Qe(y,{size:S.S,options:tt,selected:e.ruleType,setSelected:t})})})},rt=ma.div`
45
45
  display: flex;
46
46
  align-items: center;
47
47
  gap: 24px;
48
48
  padding: 8px 16px;
49
49
  border-radius: 12px;
50
50
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
51
- `,ot=ma.div`
51
+ `,it=ma.div`
52
52
  flex: 1;
53
53
  min-width: 0;
54
54
  white-space: pre;
55
55
  overflow-x: auto;
56
- `,st=({title:e,summary:t,onEdit:l,renderAction:r})=>{const o=da(()=>{const a=[];return e&&(a.push({text:e,variant:ye.Default}),a.push({text:" - ",variant:ye.Default})),a.push(...t),a},[e,t]);return ea(rt,{children:[_e(ot,{children:_e(Se,{parts:o})}),r&&r(),l&&_e(xe,{"data-id":"sampling-btn-edit-auto-rule",label:ke,rightIcon:ra,variant:a.Text,size:U.S,onClick:l})]})},it=e=>{const a=da(()=>{if(e.readOnly)return e.summary;switch(e.category){case"noisy":return Pe(Le(e.formState));case"highlyRelevant":return Te($e(e.formState));case"costReduction":return Ce(we(e.formState))}},[e]);if(e.readOnly)return _e(st,{title:Ae,summary:a,renderAction:e.renderAction});const t=1===a.length&&"default"===a[0].variant;return _e(st,{title:t?Me:Ae,summary:t?[]:a,renderAction:e.renderAction})},nt=ma.div`
56
+ `,ot=({title:e,summary:t,onEdit:l,renderAction:r})=>{const i=da(()=>{const a=[];return e&&(a.push({text:e,variant:ye.Default}),a.push({text:" - ",variant:ye.Default})),a.push(...t),a},[e,t]);return ea(rt,{children:[Qe(it,{children:Qe(Se,{parts:i})}),r&&r(),l&&Qe(xe,{"data-id":"sampling-btn-edit-auto-rule",label:ke,rightIcon:ra,variant:a.Text,size:U.S,onClick:l})]})},st=e=>{const a=da(()=>{if(e.readOnly)return e.summary;switch(e.category){case"noisy":return Pe(Le(e.formState));case"highlyRelevant":return Te($e(e.formState));case"costReduction":return Ce(we(e.formState))}},[e]);if(e.readOnly)return Qe(ot,{title:Ae,summary:a,renderAction:e.renderAction});const t=1===a.length&&"default"===a[0].variant;return Qe(ot,{title:t?Me:Ae,summary:t?[]:a,renderAction:e.renderAction})},nt=ma.div`
57
57
  display: flex;
58
58
  flex-wrap: wrap;
59
59
  gap: 8px;
@@ -95,7 +95,7 @@ import{aL as e,a,ao as t,j as l,l as r,ee as o,ag as s,b0 as i,as as n,al as d,b
95
95
  justify-content: center;
96
96
  align-items: center;
97
97
  flex-shrink: 0;
98
- `,gt={[Be.JavaScript]:"Node.js",[Be.DotNet]:".NET",[Be.Php]:"PHP",[Be.Java]:"Java",[Be.Go]:"Go",[Be.Python]:"Python",[Be.Ruby]:"Ruby",[Be.Rust]:"Rust"},mt=[Be.Python,Be.Java,Be.JavaScript,Be.DotNet,Be.Php,Be.Ruby,Be.Go].map(e=>({id:e,label:gt[e]??e.charAt(0).toUpperCase()+e.slice(1),Icon:Ve(e)})),vt=[{value:"all",label:"Entire Cluster"},{value:"source",label:"Specific Source"},{value:"namespace",label:"Specific Namespace"},{value:"language",label:"Specific Programming Language"}];function ft(e){const a=gt[e];return a||e.charAt(0).toUpperCase()+e.slice(1)}const bt=e=>e.readOnly?_e(yt,{scopes:e.scopes}):_e(St,{formState:e.formState,onChange:e.onChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions}),yt=({scopes:e})=>_e(x,{richTitle:{title:Oe},children:e.length?_e(pt,{children:e.map((e,a)=>((e,a)=>{if(e.workloadLanguage){const t=Ve(e.workloadLanguage);return ea(ut,{children:[t&&_e(ht,{children:_e(t,{size:18})}),_e($,{size:A.XS,color:L.Primary,children:ft(e.workloadLanguage)})]},a)}const t=[e.workloadNamespace,e.workloadKind,e.workloadName].filter(Boolean),l=t.length?t.join(" / "):"Unknown scope";return _e(ut,{children:_e($,{size:A.XS,color:L.Primary,children:l})},a)})(e,a))}):_e(Ne,{status:Xe.Default,message:ze,fullWidth:!0})}),St=({formState:e,onChange:a,sourceOptions:t=[],namespaceOptions:l=[]})=>{const[r,o]=ca("all"),i=e.sourceScopes.length>0,n=da(()=>vt.map(e=>({...e,disabled:"all"===e.value&&i})),[i]),d=da(()=>e.sourceScopes.filter(e=>"source"===e.scopeType).map(e=>{return a=e.workloadNamespace,t=e.workloadKind,l=e.workloadName,`${a}/${t}/${l}`;var a,t,l}),[e.sourceScopes]),c=da(()=>e.sourceScopes.filter(e=>"namespace"===e.scopeType).map(e=>e.workloadNamespace),[e.sourceScopes]),p=da(()=>new Set(e.sourceScopes.filter(e=>"language"===e.scopeType).map(e=>e.workloadLanguage)),[e.sourceScopes]),u=na(e=>{o(e)},[]),h=na(t=>{const l=e.sourceScopes.filter(e=>"source"!==e.scopeType),r=t.map(e=>function(e){const a=e.split("/");return 3!==a.length?null:{namespace:a[0],kind:a[1],name:a[2]}}(e)).filter(e=>null!==e).map(e=>({scopeType:"source",workloadName:e.name,workloadKind:e.kind,workloadNamespace:e.namespace,workloadLanguage:""}));a({sourceScopes:[...l,...r]})},[e.sourceScopes,a]),g=na(t=>{const l=e.sourceScopes.filter(e=>"namespace"!==e.scopeType),r=t.map(e=>({scopeType:"namespace",workloadName:"",workloadKind:"",workloadNamespace:e,workloadLanguage:""}));a({sourceScopes:[...l,...r]})},[e.sourceScopes,a]),m=na(t=>{if(e.sourceScopes.some(e=>"language"===e.scopeType&&e.workloadLanguage===t))a({sourceScopes:e.sourceScopes.filter(e=>!("language"===e.scopeType&&e.workloadLanguage===t))});else{const l={scopeType:"language",workloadName:"",workloadKind:"",workloadNamespace:"",workloadLanguage:t};a({sourceScopes:[...e.sourceScopes,l]})}},[e.sourceScopes,a]);return ea(x,{richTitle:{title:`1. ${Oe}`,subTitle:De},children:[_e(Ne,!i&&"all"===r?{status:Xe.Default,message:ze,fullWidth:!0,smallIcon:!0}:{status:Xe.Info,message:Re,fullWidth:!0,smallIcon:!0}),_e(f,{$alignItems:"flex-start",children:_e(y,{size:S.S,options:n,selected:r,setSelected:u})}),"source"===r&&_e(Ie,{multiple:!0,"data-id":"sampling-autocomplete-source",options:t,value:d,onSelect:h,placeholder:Ee}),"namespace"===r&&_e(Ie,{multiple:!0,"data-id":"sampling-autocomplete-namespace",options:l,value:c,onSelect:g,placeholder:"Search namespace"}),"language"===r&&_e(nt,{children:mt.map(({id:e,label:a,Icon:t})=>{const l=p.has(e);return ea(dt,{$selected:l,onClick:()=>m(e),children:[_e(s,{name:`sampling-scope-lang-${e}`,size:He.S,value:l,onChange:()=>m(e)}),_e(ct,{children:_e(t,{size:20})}),_e($,{size:A.XS,nowrap:!0,children:a})]},e)})})]})},xt=(e,a)=>!a?.length||!!a?.find(a=>a===e),kt=({title:e="Signals",required:a,errorMessage:t,allowedSignals:l,selectedSignals:r,setSelectedSignals:o,disabled:i})=>{const[n,d]=ca(1===r.length),c=pa(JSON.stringify(r));ua(()=>{const e=je(r);e.length||Ke.forEach(({id:a})=>{xt(a,l)&&e.push(a)});const a=JSON.stringify(e);c.current!==a&&(c.current=a,o(e),d(1===e.length))},[l,r]);return ea(f,{$gap:12,children:[_e(b,{label:e,required:a}),_e(v,{$gap:12,children:Ke.map(e=>{const a=xt(e.id,l),t=((e,a)=>!!a?.find(a=>a===e))(e.id,r);return a?_e(s,{label:e.value,disabled:i||!a||n&&t,value:t,onChange:a=>((e,a)=>{const t=e,l=a?[...r,t]:r.filter(e=>e!==t);o(l),d(1===l.length)})(e.id,a)},e.id):null})}),_e(Ue,{errorMessage:t})]})},Ct=({minSupportedVersion:a,currentVersion:t})=>_e(e,{isOpen:!0,onClose:()=>{},relativeToParent:!0,visual:()=>_e(qe,{scale:2.4,icon:()=>_e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"21",viewBox:"0 0 22 21",fill:"none",children:_e("path",{fill:"#151618",d:"M9.4844 0.730003C9.99694 -0.243259 11.4076 -0.24341 11.92 0.730003L11.9685 0.831353L14.3039 6.22012L20.153 6.77755C21.3553 6.89211 21.841 8.38683 20.9358 9.18621L16.5314 13.0731L17.8091 18.8079C18.0716 19.9868 16.8005 20.9109 15.7605 20.2969L10.7017 17.3093L5.64282 20.2969C4.60289 20.9104 3.33173 19.9866 3.59427 18.8079L4.87192 13.0741L0.468608 9.18621C-0.43662 8.38693 0.0482932 6.8924 1.25029 6.77755L7.09837 6.22012L9.43588 0.831353L9.4844 0.730003ZM8.55284 7.02876C8.35287 7.48992 7.9179 7.80589 7.41751 7.85357L2.03952 8.36571L6.09027 11.941C6.46691 12.2737 6.63296 12.7852 6.5237 13.2758L5.34956 18.5459L10.0008 15.8009L10.1669 15.7179C10.5087 15.574 10.8945 15.5741 11.2364 15.7179L11.4036 15.8009L16.0538 18.5459L14.8807 13.2758C14.7714 12.7851 14.9374 12.2737 15.3141 11.941L19.3627 8.36571L13.9858 7.85357C13.4855 7.80587 13.0505 7.4899 12.8505 7.02876L10.7017 2.07342L8.55284 7.02876Z"})})}),title:"Upgrade Required",description:`To use this feature, please upgrade to Odigos v${a} or later.\nCurrent version: ${t}.`}),wt=ma.div`
98
+ `,gt={[Be.JavaScript]:"Node.js",[Be.DotNet]:".NET",[Be.Php]:"PHP",[Be.Java]:"Java",[Be.Go]:"Go",[Be.Python]:"Python",[Be.Ruby]:"Ruby",[Be.Rust]:"Rust"},mt=[Be.Python,Be.Java,Be.JavaScript,Be.DotNet,Be.Php,Be.Ruby,Be.Go].map(e=>({id:e,label:gt[e]??e.charAt(0).toUpperCase()+e.slice(1),Icon:Ve(e)})),vt=[{value:"all",label:"Entire Cluster"},{value:"source",label:"Specific Source"},{value:"namespace",label:"Specific Namespace"},{value:"language",label:"Specific Programming Language"}];function ft(e){const a=gt[e];return a||e.charAt(0).toUpperCase()+e.slice(1)}const bt=e=>e.readOnly?Qe(yt,{scopes:e.scopes}):Qe(St,{formState:e.formState,onChange:e.onChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions}),yt=({scopes:e})=>Qe(x,{richTitle:{title:Oe},children:e.length?Qe(pt,{children:e.map((e,a)=>((e,a)=>{if(e.workloadLanguage){const t=Ve(e.workloadLanguage);return ea(ut,{children:[t&&Qe(ht,{children:Qe(t,{size:18})}),Qe($,{size:A.XS,color:L.Primary,children:ft(e.workloadLanguage)})]},a)}const t=[e.workloadNamespace,e.workloadKind,e.workloadName].filter(Boolean),l=t.length?t.join(" / "):"Unknown scope";return Qe(ut,{children:Qe($,{size:A.XS,color:L.Primary,children:l})},a)})(e,a))}):Qe(Ne,{status:Re.Default,message:ze,fullWidth:!0})}),St=({formState:e,onChange:a,sourceOptions:t=[],namespaceOptions:l=[]})=>{const[r,i]=ca("all"),s=e.sourceScopes.length>0,n=da(()=>vt.map(e=>({...e,disabled:"all"===e.value&&s})),[s]),d=da(()=>e.sourceScopes.filter(e=>"source"===e.scopeType).map(e=>{return a=e.workloadNamespace,t=e.workloadKind,l=e.workloadName,`${a}/${t}/${l}`;var a,t,l}),[e.sourceScopes]),c=da(()=>e.sourceScopes.filter(e=>"namespace"===e.scopeType).map(e=>e.workloadNamespace),[e.sourceScopes]),p=da(()=>new Set(e.sourceScopes.filter(e=>"language"===e.scopeType).map(e=>e.workloadLanguage)),[e.sourceScopes]),u=na(e=>{i(e)},[]),h=na(t=>{const l=e.sourceScopes.filter(e=>"source"!==e.scopeType),r=t.map(e=>function(e){const a=e.split("/");return 3!==a.length?null:{namespace:a[0],kind:a[1],name:a[2]}}(e)).filter(e=>null!==e).map(e=>({scopeType:"source",workloadName:e.name,workloadKind:e.kind,workloadNamespace:e.namespace,workloadLanguage:""}));a({sourceScopes:[...l,...r]})},[e.sourceScopes,a]),g=na(t=>{const l=e.sourceScopes.filter(e=>"namespace"!==e.scopeType),r=t.map(e=>({scopeType:"namespace",workloadName:"",workloadKind:"",workloadNamespace:e,workloadLanguage:""}));a({sourceScopes:[...l,...r]})},[e.sourceScopes,a]),m=na(t=>{if(e.sourceScopes.some(e=>"language"===e.scopeType&&e.workloadLanguage===t))a({sourceScopes:e.sourceScopes.filter(e=>!("language"===e.scopeType&&e.workloadLanguage===t))});else{const l={scopeType:"language",workloadName:"",workloadKind:"",workloadNamespace:"",workloadLanguage:t};a({sourceScopes:[...e.sourceScopes,l]})}},[e.sourceScopes,a]);return ea(x,{richTitle:{title:`1. ${Oe}`,subTitle:Xe},children:[Qe(Ne,!s&&"all"===r?{status:Re.Default,message:ze,fullWidth:!0,smallIcon:!0}:{status:Re.Info,message:De,fullWidth:!0,smallIcon:!0}),Qe(f,{$alignItems:"flex-start",children:Qe(y,{size:S.S,options:n,selected:r,setSelected:u})}),"source"===r&&Qe(Ie,{multiple:!0,"data-id":"sampling-autocomplete-source",options:t,value:d,onSelect:h,placeholder:Ee}),"namespace"===r&&Qe(Ie,{multiple:!0,"data-id":"sampling-autocomplete-namespace",options:l,value:c,onSelect:g,placeholder:"Search namespace"}),"language"===r&&Qe(nt,{children:mt.map(({id:e,label:a,Icon:t})=>{const l=p.has(e);return ea(dt,{$selected:l,onClick:()=>m(e),children:[Qe(o,{name:`sampling-scope-lang-${e}`,size:He.S,value:l,onChange:()=>m(e)}),Qe(ct,{children:Qe(t,{size:20})}),Qe($,{size:A.XS,nowrap:!0,children:a})]},e)})})]})},xt=(e,a)=>!a?.length||!!a?.find(a=>a===e),kt=({title:e="Signals",required:a,errorMessage:t,allowedSignals:l,selectedSignals:r,setSelectedSignals:i,disabled:s})=>{const[n,d]=ca(1===r.length),c=pa(JSON.stringify(r));ua(()=>{let e=Ke(r).filter(e=>xt(e,l));e.length||(e=je.filter(({id:e})=>xt(e,l)).map(({id:e})=>e));const a=JSON.stringify(e);c.current!==a&&(c.current=a,i(e),d(1===e.length))},[l,r]);return ea(f,{$gap:12,children:[Qe(b,{label:e,required:a}),Qe(v,{$gap:12,children:je.map(e=>{const a=xt(e.id,l),t=((e,a)=>!!a?.find(a=>a===e))(e.id,r);return a?Qe(o,{label:e.value,disabled:s||!a||n&&t,value:t,onChange:a=>((e,a)=>{const t=e,l=a?[...r,t]:r.filter(e=>e!==t);i(l),d(1===l.length)})(e.id,a)},e.id):null})}),Qe(Ue,{errorMessage:t})]})},Ct=({minSupportedVersion:a,currentVersion:t})=>Qe(e,{isOpen:!0,onClose:()=>{},relativeToParent:!0,visual:()=>Qe(qe,{scale:2.4,icon:()=>Qe("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"21",viewBox:"0 0 22 21",fill:"none",children:Qe("path",{fill:"#151618",d:"M9.4844 0.730003C9.99694 -0.243259 11.4076 -0.24341 11.92 0.730003L11.9685 0.831353L14.3039 6.22012L20.153 6.77755C21.3553 6.89211 21.841 8.38683 20.9358 9.18621L16.5314 13.0731L17.8091 18.8079C18.0716 19.9868 16.8005 20.9109 15.7605 20.2969L10.7017 17.3093L5.64282 20.2969C4.60289 20.9104 3.33173 19.9866 3.59427 18.8079L4.87192 13.0741L0.468608 9.18621C-0.43662 8.38693 0.0482932 6.8924 1.25029 6.77755L7.09837 6.22012L9.43588 0.831353L9.4844 0.730003ZM8.55284 7.02876C8.35287 7.48992 7.9179 7.80589 7.41751 7.85357L2.03952 8.36571L6.09027 11.941C6.46691 12.2737 6.63296 12.7852 6.5237 13.2758L5.34956 18.5459L10.0008 15.8009L10.1669 15.7179C10.5087 15.574 10.8945 15.5741 11.2364 15.7179L11.4036 15.8009L16.0538 18.5459L14.8807 13.2758C14.7714 12.7851 14.9374 12.2737 15.3141 11.941L19.3627 8.36571L13.9858 7.85357C13.4855 7.80587 13.0505 7.4899 12.8505 7.02876L10.7017 2.07342L8.55284 7.02876Z"})})}),title:"Upgrade Required",description:`To use this feature, please upgrade to Odigos v${a} or later.\nCurrent version: ${t}.`}),wt=ma.div`
99
99
  display: flex;
100
100
  flex-direction: column;
101
101
  justify-content: flex-end;
@@ -119,7 +119,7 @@ import{aL as e,a,ao as t,j as l,l as r,ee as o,ag as s,b0 as i,as as n,al as d,b
119
119
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
120
120
  overflow-y: auto;
121
121
  overflow-x: hidden;
122
- `,Pt=({isLeft:e,isRight:a,heightOffset:t=0,width:l,header:r,list:o})=>ea(wt,{$width:l,$columnHasHeader:!!r,children:[r&&_e(Tt,{children:r}),_e($t,{$gap:8,$isLeft:e,$isRight:a,$heightOffset:t,$columnHasHeader:!!r,children:o.length?o.length>1?_e(Ge,{gap:8,elements:o}):_e(aa,{children:o[0]}):_e(Je,{$height:"100%",children:_e(We,{})})})]}),Lt="75vw",At=ma.div`
122
+ `,Pt=({isLeft:e,isRight:a,heightOffset:t=0,width:l,header:r,list:i})=>ea(wt,{$width:l,$columnHasHeader:!!r,children:[r&&Qe(Tt,{children:r}),Qe($t,{$gap:8,$isLeft:e,$isRight:a,$heightOffset:t,$columnHasHeader:!!r,children:i.length?i.length>1?Qe(Ge,{gap:8,elements:i}):Qe(aa,{children:i[0]}):Qe(Je,{$height:"100%",children:Qe(We,{})})})]}),Lt="75vw",At=ma.div`
123
123
  display: flex;
124
124
  flex-direction: column;
125
125
  border-radius: 16px;
@@ -142,4 +142,4 @@ import{aL as e,a,ao as t,j as l,l as r,ee as o,ag as s,b0 as i,as as n,al as d,b
142
142
  padding: 5vh 10vw;
143
143
  border-radius: 12px;
144
144
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
145
- `,Xt=ha(({isOpen:t,withOverlay:l,disableAnimation:r,onClose:o,onBack:s,onNext:i,nextIsSkip:n,onSave:d,disableSave:c,connectionIds:p,header:u,subHeader:h,leftColumn:g,rightColumn:m,search:v,filters:f,errorMessage:b,isFormDirty:y,hideDirtyNote:S,isFetching:x,progress:k},C)=>{const[w,T]=ca(!1),[$,P]=ca(!1),[L,M]=ca(void 0);ga(C,()=>({clearErrors:()=>M(void 0)}));const O=$,N=na(()=>{y&&!w?T(!0):(T(!1),o?.())},[y,w,o]),z=c||$||"boolean"==typeof y&&!y,X=na(async()=>{P(!0);const e=await d();P(!1),e?.error?M(e.error):(p?.setValue([]),o?.())},[d,p,o]),D=!!v||!!p||!!f,R=!!h,I=(D?48:0)+(R?50:0),E=da(()=>x?{status:Xe.Info,message:"Fetching Data..."}:$&&!k?{status:Xe.Info,message:"Saving Changes..."}:L||b?{status:Xe.Error,message:L||b}:"boolean"==typeof y&&y&&!S?{status:Xe.Info,message:'The values don\'t reflect the current configurations of the selected clusters.\n"Save" will override the current configurations.'}:"boolean"!=typeof y||y||S?void 0:{status:Xe.Success,message:"The values reflect the current configuration of the selected cluster."},[x,$,k,L,b,y,S]),H=da(()=>s?{label:"Back",leftIcon:oa,variant:a.Secondary,onClick:s}:{label:"Cancel",variant:a.Secondary,onClick:N,disabled:O},[s,N,O]),[B,V]=ca(!1),j=da(()=>i?n?{"data-id":"wide-drawer-skip",label:"Skip",rightIcon:sa,variant:a.Secondary,onClick:()=>V(!0)}:{"data-id":"wide-drawer-next",label:"Next",rightIcon:sa,variant:a.Primary,onClick:i}:{"data-id":"wide-drawer-save",label:"Save",variant:a.Primary,onClick:X,disabled:z},[i,n,X,z]);return ea(Fe,{width:Lt,isOpen:t,disableAnimation:r,hideOverlay:!$&&!l,header:{...u,onClose:o?N:void 0,onCloseDisabled:O},footer:{note:E,actions:[H,j]},children:[$?_e(Je,{$height:"calc(100vh - 136px)",children:_e(zt,{children:_e(Qe,{titleSize:A.S,subTitleSize:A.XXXS,withGradient:!0,withSpinner:!0,...k})})}):ea(At,{children:[D&&ea(Mt,{children:[p&&_e(Ze,{icon:ia,title:"Selected Clusters",badge:{label:p.value.length}}),v&&_e(Ye,{width:"100%",...v}),f]}),R&&_e(Ot,{children:_e(Ze,{icon:h.icon,title:h.title,subTitle:h.description,badge:h.badge})}),ea(Nt,{children:[_e(Pt,{isLeft:!0,heightOffset:I,...g}),_e(Pt,{isRight:!0,heightOffset:I,...m})]})]}),_e(va,{isOpen:w,onClose:()=>T(!1),onApprove:N}),_e(e,{title:"Skip setup?",description:"Without completing setup, Odigos won't be able to collect and send your telemetry data. This may interrupt your data flow and limit the platform's ability to provide value.",isOpen:B,onClose:()=>V(!1),denyButton:{label:"Go Back",variant:a.Secondary,onClick:()=>V(!1)},approveButton:{label:"Skip",variant:a.Primary,onClick:()=>{i?.(),V(!1)}}})]})});Xt.displayName=Xt.name;export{st as A,va as C,ba as D,xa as N,Va as O,Ca as P,_a as R,kt as S,Ct as U,Xt as W,Sa as a,it as b,bt as c,lt as d,Ta as e,Ga as f,fa as g,Lt as h,ya as i,ka as j};
145
+ `,Rt=ha(({isOpen:t,withOverlay:l,disableAnimation:r,onClose:i,onBack:o,onNext:s,nextIsSkip:n,onSave:d,disableSave:c,connectionIds:p,header:u,subHeader:h,leftColumn:g,rightColumn:m,search:v,filters:f,errorMessage:b,isFormDirty:y,hideDirtyNote:S,isFetching:x,progress:k},C)=>{const[w,T]=ca(!1),[$,P]=ca(!1),[L,M]=ca(void 0);ga(C,()=>({clearErrors:()=>M(void 0)}));const O=$,N=na(()=>{y&&!w?T(!0):(T(!1),i?.())},[y,w,i]),z=c||$||"boolean"==typeof y&&!y,R=na(async()=>{P(!0);const e=await d();P(!1),e?.error?M(e.error):(p?.setValue([]),i?.())},[d,p,i]),X=!!v||!!p||!!f,D=!!h,I=(X?48:0)+(D?50:0),E=da(()=>x?{status:Re.Info,message:"Fetching Data..."}:$&&!k?{status:Re.Info,message:"Saving Changes..."}:L||b?{status:Re.Error,message:L||b}:"boolean"==typeof y&&y&&!S?{status:Re.Info,message:'The values don\'t reflect the current configurations of the selected clusters.\n"Save" will override the current configurations.'}:"boolean"!=typeof y||y||S?void 0:{status:Re.Success,message:"The values reflect the current configuration of the selected cluster."},[x,$,k,L,b,y,S]),H=da(()=>o?{label:"Back",leftIcon:ia,variant:a.Secondary,onClick:o}:{label:"Cancel",variant:a.Secondary,onClick:N,disabled:O},[o,N,O]),[B,V]=ca(!1),K=da(()=>s?n?{"data-id":"wide-drawer-skip",label:"Skip",rightIcon:oa,variant:a.Secondary,onClick:()=>V(!0)}:{"data-id":"wide-drawer-next",label:"Next",rightIcon:oa,variant:a.Primary,onClick:s}:{"data-id":"wide-drawer-save",label:"Save",variant:a.Primary,onClick:R,disabled:z},[s,n,R,z]);return ea(Fe,{width:Lt,isOpen:t,disableAnimation:r,hideOverlay:!$&&!l,header:{...u,onClose:i?N:void 0,onCloseDisabled:O},footer:{note:E,actions:[H,K]},children:[$?Qe(Je,{$height:"calc(100vh - 136px)",children:Qe(zt,{children:Qe(Ze,{titleSize:A.S,subTitleSize:A.XXXS,withGradient:!0,withSpinner:!0,...k})})}):ea(At,{children:[X&&ea(Mt,{children:[p&&Qe(Ye,{icon:sa,title:"Selected Clusters",badge:{label:p.value.length}}),v&&Qe(_e,{width:"100%",...v}),f]}),D&&Qe(Ot,{children:Qe(Ye,{icon:h.icon,title:h.title,subTitle:h.description,badge:h.badge})}),ea(Nt,{children:[Qe(Pt,{isLeft:!0,heightOffset:I,...g}),Qe(Pt,{isRight:!0,heightOffset:I,...m})]})]}),Qe(va,{isOpen:w,onClose:()=>T(!1),onApprove:N}),Qe(e,{title:"Skip setup?",description:"Without completing setup, Odigos won't be able to collect and send your telemetry data. This may interrupt your data flow and limit the platform's ability to provide value.",isOpen:B,onClose:()=>V(!1),denyButton:{label:"Go Back",variant:a.Secondary,onClick:()=>V(!1)},approveButton:{label:"Skip",variant:a.Primary,onClick:()=>{s?.(),V(!1)}}})]})});Rt.displayName=Rt.name;export{ot as A,va as C,ba as D,xa as N,Va as O,Ca as P,Qa as R,kt as S,Ct as U,Rt as W,Sa as a,st as b,bt as c,lt as d,Ta as e,Ga as f,fa as g,Lt as h,ya as i,ka as j};
@@ -1,3 +1,3 @@
1
- import{jsx as t}from"react/jsx-runtime";import{useMemo as e}from"react";import i from"styled-components";import{u as o,B as s,a,A as n,g as l,D as r,C as c,b as p,N as m}from"./ui-components-of0mjGMv.js";import{VIcon as d,CopyIcon as u,YamlIcon as f}from"../icons.js";const h=i.div`
1
+ import{jsx as t}from"react/jsx-runtime";import{useMemo as e}from"react";import i from"styled-components";import{u as o,B as s,a,A as n,g as l,D as r,C as c,b as p,N as m}from"./ui-components-BogDd0Qc.js";import{VIcon as d,CopyIcon as u,YamlIcon as f}from"../icons.js";const h=i.div`
2
2
  padding: 0 12px;
3
3
  `,g=({title:i="YAML",yaml:g,defaultOpen:b,fullHeight:T,bgTint:y="1000"})=>{const{clickCopy:C,isCopied:x}=o(),A=e(()=>g?[{id:l(),type:n.Button,buttonProps:{variant:a.Text,size:s.S,leftIcon:x?d:u,onClick:()=>C(g||""),disabled:x}}]:[],[g,x]);return t(r,{bgTint:y,richTitle:{icon:f,title:i},actions:A,withCollapse:!0,collapseIsDefaultOpen:b,fullHeight:T,children:t(h,{children:g?t(c,{code:g,language:"yaml",theme:"duotoneDark"}):t(p,{children:t(m,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})})})};export{g as Y};