"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[4301],{50446(L,c,t){t.r(c),t.d(c,{plugin:()=>D});var p=t(16207),r=t(92745),d=t(88862),a=t(74848),i=t(96540),h=t(46395),m=t(8575),u=t(88535);const S=({value:e,onChange:s,context:o})=>{const n=(0,i.useMemo)(()=>(0,u.L)(o.data[0]),[o.data]);(0,i.useEffect)(()=>{e.adhocFilters||s({...e,adhocFilters:[]})},[s,e]);const l=(0,m.Z)(n,e,s);return!n||!l?null:(0,a.jsx)(h.N,{controller:l})};var v=t(22803),F=t(16817),g=t(78282),y=t(88527);const f={wrapper:(0,v.css)({height:"100%",overflow:"scroll"})},j=({data:e,options:s,replaceVariables:o})=>{const n=(0,i.useRef)(null),l=(0,i.useMemo)(()=>(0,u.L)(e.series[0]),[e.series]),H=(0,F.A)(async()=>await(0,g.l)().get(e.request?.targets[0].datasource?.uid));return!e||!e.series.length||!l?(0,a.jsx)("div",{className:"panel-empty",children:(0,a.jsx)("p",{children:(0,a.jsx)(r.x6,{i18nKey:"traces.traces-panel.no-data-found-in-response",children:"No data found in response"})})}):(0,a.jsxs)("div",{className:f.wrapper,children:[(0,a.jsx)("div",{ref:n}),(0,a.jsx)(y.V,{dataFrames:e.series,scrollElementClass:f.wrapper,traceProp:l,datasource:H.value,topOfViewRef:n,createSpanLink:s.createSpanLink,focusedSpanId:s.focusedSpanId,createFocusSpanLink:s.createFocusSpanLink,spanFilters:(0,d.Qh)(o,s.spanFilters),timeRange:e.timeRange,hideHeaderDetails:s.hideHeaderDetails})]})};var x=t(2543);const P=e=>(0,x.defaultsDeep)(e,{cardOptions:{previewModifier:s=>{s.options=s.options??{},s.options.hideHeaderDetails=!0}}}),V=e=>{if(e.hasPreferredVisualisationType("trace"))return[P({})]},D=new p.m(j).setMigrationHandler(e=>e.options?.spanFilters?{spanFilters:(0,d.D)(e.options.spanFilters)}:e.options).setPanelOptions(e=>{const s=[(0,r.t)("traces.category-span-filters","Span filters")];e.addCustomEditor({id:"filters",name:(0,r.t)("traces.name-filters","Filters"),path:"spanFilters",category:s,editor:S,defaultValue:void 0}),e.addBooleanSwitch({path:"spanFilters.matchesOnly",name:(0,r.t)("traces.name-show-matches-only","Show matches only"),defaultValue:!1,category:s}).addBooleanSwitch({path:"spanFilters.criticalPathOnly",name:(0,r.t)("traces.name-critical-path-only","Select critical path"),defaultValue:!1,category:s})}).setSuggestionsSupplier(V)}}]);

//# sourceMappingURL=tracesPanel.548aac71b7f2be549cb3.js.map