@kong-ui-public/analytics-chart 10.6.3 → 10.6.4-pr.2541.dab248c2d.0
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThresholdPlugin.d.ts","sourceRoot":"","sources":["../../../../src/components/chart-plugins/ThresholdPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAA;AAE9E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,KAAK,OAAO,MAAM,uBAAuB,CAAA;AAOhD,UAAU,gBAAgB;IACxB,SAAS,EAAE,MAAM,CAAC,mBAAmB,EAAE,SAAS,EAAE,CAAC,GAAG,SAAS,CAAA;CAChE;AAED,KAAK,cAAc,GAAG,SAAS,GAAG;IAChC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG;IAClC,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,aAAa,CAAA;CACpB,CAAA;AAcD,eAAO,MAAM,yBAAyB,GAAI,OAAO,KAAK,EAAE,YAAY,SAAS,EAAE,KAAG,qBAAqB,
|
|
1
|
+
{"version":3,"file":"ThresholdPlugin.d.ts","sourceRoot":"","sources":["../../../../src/components/chart-plugins/ThresholdPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAA;AAE9E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,KAAK,OAAO,MAAM,uBAAuB,CAAA;AAOhD,UAAU,gBAAgB;IACxB,SAAS,EAAE,MAAM,CAAC,mBAAmB,EAAE,SAAS,EAAE,CAAC,GAAG,SAAS,CAAA;CAChE;AAED,KAAK,cAAc,GAAG,SAAS,GAAG;IAChC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG;IAClC,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,aAAa,CAAA;CACpB,CAAA;AAcD,eAAO,MAAM,yBAAyB,GAAI,OAAO,KAAK,EAAE,YAAY,SAAS,EAAE,KAAG,qBAAqB,EA4DtG,CAAA;AAED,eAAO,MAAM,2BAA2B,GAAI,eAAe,qBAAqB,EAAE,KAAG,qBAAqB,EAmBzG,CAAA;AAED,qBAAa,eAAgB,YAAW,MAAM;IAKhC,OAAO,CAAC,IAAI;IAJxB,EAAE,SAAoB;IACtB,OAAO,CAAC,WAAW,CAAC,CAA+C;IACnE,OAAO,CAAC,iBAAiB,CAAC,CAA+B;gBAErC,IAAI,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,OAAO,OAAO,CAAC,CAAC;IAEvE,OAAO,CAAC,eAAe;IAoBvB,IAAI,UAAU,4mBAEb;IAGD,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,aAAa,EAAE,gBAAgB,GAAG,IAAI;IAKzE,UAAU,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,aAAa,EAAE,gBAAgB,GAAG,IAAI;IA4BvE,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,GAAG,IAAI;IAmE7C,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;CAKlC"}
|
package/dist/vitals-chart.es.js
CHANGED
|
@@ -19773,7 +19773,7 @@ const UP = [
|
|
|
19773
19773
|
ts: c.x,
|
|
19774
19774
|
aboveThreshold: c.y >= a.value
|
|
19775
19775
|
}));
|
|
19776
|
-
let l;
|
|
19776
|
+
let l = o[0].aboveThreshold ? r[0].x : void 0;
|
|
19777
19777
|
for (let c = 1; c < o.length; c++)
|
|
19778
19778
|
!o[c - 1].aboveThreshold && o[c].aboveThreshold ? l = Th(
|
|
19779
19779
|
r[c - 1],
|
package/dist/vitals-chart.umd.js
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
* https://www.chartjs.org
|
|
26
26
|
* (c) 2022 chartjs-adapter-date-fns Contributors
|
|
27
27
|
* Released under the MIT license
|
|
28
|
-
*/const xD={datetime:"MMM d, yyyy, h:mm:ss aaaa",millisecond:"h:mm:ss.SSS aaaa",second:"h:mm:ss aaaa",minute:"h:mm aaaa",hour:"ha",day:"MMM d",week:"PP",month:"MMM yyyy",quarter:"qqq - yyyy",year:"yyyy"};wu._date.override({_id:"date-fns",formats:function(){return xD},parse:function(n,t){if(n===null||typeof n>"u")return null;const e=typeof n;return e==="number"||n instanceof Date?n=dt(n):e==="string"&&(typeof t=="string"?n=ew(n,t,new Date,this.options):n=sh(n,this.options)),ka(n)?n.getTime():null},format:function(n,t){return Ir(n,t,this.options)},add:function(n,t,e){switch(e){case"millisecond":return va(n,t);case"second":return K0(n,t);case"minute":return X0(n,t);case"hour":return $0(n,t);case"day":return Ar(n,t);case"week":return Z0(n,t);case"month":return wa(n,t);case"quarter":return G0(n,t);case"year":return Q0(n,t);default:return n}},diff:function(n,t,e){switch(e){case"millisecond":return Sa(n,t);case"second":return o_(n,t);case"minute":return i_(n,t);case"hour":return n_(n,t);case"day":return Fd(n,t);case"week":return a_(n,t);case"month":return Wd(n,t);case"quarter":return r_(n,t);case"year":return l_(n,t);default:return 0}},startOf:function(n,t,e){switch(t){case"second":return rw(n);case"minute":return sw(n);case"hour":return iw(n);case"day":return Ma(n);case"week":return je(n);case"isoWeek":return je(n,{weekStartsOn:+e});case"month":return u_(n);case"quarter":return c_(n);case"year":return Vd(n);default:return n}},endOf:function(n,t){switch(t){case"second":return p_(n);case"minute":return m_(n);case"hour":return h_(n);case"day":return Bd(n);case"week":return f_(n);case"month":return Hd(n);case"quarter":return g_(n);case"year":return d_(n);default:return n}}});const bm={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},wD={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...bm,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},vD=d.version[0]==="2"?(n,t)=>Object.assign(n,{attrs:t}):(n,t)=>Object.assign(n,t);function Ei(n){return d.isProxy(n)?d.toRaw(n):n}function MD(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n;return d.isProxy(t)?new Proxy(n,{}):n}function kD(n,t){const e=n.options;e&&t&&Object.assign(e,t)}function _m(n,t){n.labels=t}function xm(n,t,e){const i=[];n.datasets=t.map(s=>{const r=n.datasets.find(o=>o[e]===s[e]);return!r||!s.data||i.includes(r)?{...s}:(i.push(r),Object.assign(r,s),r)})}function SD(n,t){const e={labels:[],datasets:[]};return _m(e,n.labels),xm(e,n.datasets,t),e}const DD=d.defineComponent({props:wD,setup(n,t){let{expose:e,slots:i}=t;const s=d.ref(null),r=d.shallowRef(null);e({chart:r});const o=()=>{if(!s.value)return;const{type:c,data:u,options:h,plugins:f,datasetIdKey:m}=n,g=SD(u,m),b=MD(g,u);r.value=new Ce(s.value,{type:c,data:b,options:{...h},plugins:f})},a=()=>{const c=d.toRaw(r.value);c&&(n.destroyDelay>0?setTimeout(()=>{c.destroy(),r.value=null},n.destroyDelay):(c.destroy(),r.value=null))},l=c=>{c.update(n.updateMode)};return d.onMounted(o),d.onUnmounted(a),d.watch([()=>n.options,()=>n.data],(c,u)=>{let[h,f]=c,[m,g]=u;const b=d.toRaw(r.value);if(!b)return;let x=!1;if(h){const k=Ei(h),M=Ei(m);k&&k!==M&&(kD(b,k),x=!0)}if(f){const k=Ei(f.labels),M=Ei(g.labels),T=Ei(f.datasets),v=Ei(g.datasets);k!==M&&(_m(b.config.data,k),x=!0),T&&T!==v&&(xm(b.config.data,T,n.datasetIdKey),x=!0)}x&&d.nextTick(()=>{l(b)})},{deep:!0}),()=>d.h("canvas",{role:"img",ariaLabel:n.ariaLabel,ariaDescribedby:n.ariaDescribedby,ref:s},[d.h("p",{},[i.default?i.default():""])])}});function Ol(n,t){return Ce.register(t),d.defineComponent({props:bm,setup(e,i){let{expose:s}=i;const r=d.shallowRef(null),o=a=>{r.value=a==null?void 0:a.chart};return s({chart:r}),()=>d.h(DD,vD({ref:o},{type:n,...e}))}})}const wm=Ol("bar",es),vm=Ol("doughnut",en),Mm=Ol("line",ns),TD={class:"chart-container"},CD=d.defineComponent({__name:"DonutChart",props:{chartData:{},tooltipTitle:{},metricUnit:{default:""},legendPosition:{default:Nt.Right},legendValues:{default:void 0},syntheticsDataKey:{default:""},datasetColors:{default:()=>sn},tooltipDimensionDisplay:{default:""},tooltipMetricDisplay:{default:""}},setup(n){const t=n,{translateUnit:e}=bt.useTranslatedUnits(),i=crypto.randomUUID(),s=crypto.randomUUID(),r=d.ref([]),o=d.useTemplateRef("chartParent"),a=d.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:t.tooltipMetricDisplay,dimensionDisplay:t.tooltipDimensionDisplay,tooltipSeries:[],left:"",top:"",units:d.toRef(t,"metricUnit"),translateUnit:e,offsetX:0,offsetY:0,width:0,height:0,chartID:s,chartType:"donut",interactionMode:"idle"}),{tooltipAbsoluteLeft:l,tooltipAbsoluteTop:c}=bt.useTooltipAbsolutePosition(o,a),u={id:i,afterUpdate(M){r.value=M.options.plugins.legend.labels.generateLabels(M).map(T=>({...T,value:t.legendValues&&t.legendValues[T.text],hidden:!1}))}},h=d.computed(()=>[u]),f=d.computed(()=>[t.chartData.datasets.reduce((T,v)=>(T.labels.push(v.label),T.backgroundColor.push(v.backgroundColor),T.borderColor.push(mh(v.backgroundColor,50)),T.data.push(v.data.reduce((S,E)=>S+E,0)),T),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),m=d.computed(()=>({...t.chartData,datasets:f.value}));bt.useReportChartDataForSynthetics(d.toRef(t,"chartData"),d.toRef(t,"syntheticsDataKey"));const{options:g}=bt.useDonutChartOptions({tooltipState:a,legendID:i}),b=d.ref(),x=M=>({[Nt.Right]:"legend-row",[Nt.Bottom]:"column",[Nt.Hidden]:"hidden"})[M],k=({width:M,height:T})=>{a.width=M,a.height=T};return(M,T)=>(d.openBlock(),d.createElementBlock("div",{ref:"chartParent",class:d.normalizeClass(["chart-parent",x(M.legendPosition)]),"data-testid":"donut-chart-parent"},[d.createElementVNode("div",TD,[d.createVNode(d.unref(vm),{ref_key:"chartInstance",ref:b,"chart-id":d.unref(s),data:m.value,options:d.unref(g),plugins:h.value},null,8,["chart-id","data","options","plugins"]),(d.openBlock(),d.createBlock(d.Teleport,{to:"body"},[d.createVNode(ao,{"absolute-left":d.unref(l),"absolute-top":d.unref(c),state:a,"tooltip-title":M.tooltipTitle,unit:M.metricUnit,onDimensions:k},null,8,["absolute-left","absolute-top","state","tooltip-title","unit"])]))]),d.createVNode(Cl,{id:d.unref(i),"chart-instance":b.value,items:r.value,position:M.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),PD=Se(CD,[["__scopeId","data-v-f3942f91"]]),km=(n,t,e,i)=>{n.save(),n.beginPath(),n.moveTo(t,e),n.lineTo(t,i),n.lineWidth=1,n.strokeStyle="#0275d8",n.stroke(),n.restore()};class Sm{constructor(){O(this,"id","verticalLinePlugin");O(this,"_clickedSegment");O(this,"_pause",!1)}afterDatasetsDraw(t){if(!this._pause&&t.tooltip&&t.tooltip.getActiveElements()&&t.tooltip.getActiveElements().length&&!this.clickedSegment){const{x:e}=t.tooltip.dataPoints[0].element,i=t.ctx;km(i,e,t.scales.y.top,t.scales.y.bottom)}if(!this._pause&&this._clickedSegment){const{x:e}=this._clickedSegment.element,i=t.ctx;km(i,e,t.scales.y.top,t.scales.y.bottom)}}pause(){this._pause=!0}resume(){this._pause=!1}get isPaused(){return this._pause}set clickedSegment(t){this._clickedSegment=t}get clickedSegment(){return this._clickedSegment}destroyClickedSegment(){delete this._clickedSegment}beforeDestroy(){this._clickedSegment&&this.destroyClickedSegment()}}const OD=(n,t,e)=>{const i=n.ctx;i.save(),i.strokeStyle="rgba(95, 154, 255, 1)",i.lineWidth=2,i.beginPath(),i.moveTo(t,n.chartArea.top),i.lineTo(t,n.chartArea.bottom),i.moveTo(e,n.chartArea.top),i.lineTo(e,n.chartArea.bottom),i.stroke(),i.restore()},ED=(n,t,e)=>{const i=n.ctx;i.save(),i.fillStyle="rgba(143, 193, 255, 0.3)",i.fillRect(t,n.chartArea.top,e-t,n.chartArea.bottom-n.chartArea.top),i.restore()},Dm=(n,t,e)=>{const i=t.scales.x.getValueForPixel(e.startX),s=t.scales.x.getValueForPixel(e.endX);i&&s&&t.canvas.dispatchEvent(new CustomEvent(n,{detail:{xStart:Math.min(i,s),xEnd:Math.max(i,s)}}))};class AD{constructor(){O(this,"id","dragSelectPlugin");O(this,"_isDragging",!1);O(this,"_startX",0);O(this,"_endX",0);O(this,"_dragTimeout");O(this,"_clearSelectionArea",!0);O(this,"_chart",null);O(this,"_dragSelectHandlers")}get startX(){return this._startX}get endX(){return this._endX}beforeInit(t){this._chart=t;const e=t.canvas;let i=!1;const s=a=>{this._dragTimeout=window.setTimeout(()=>{const l=e.getBoundingClientRect();this._isDragging=!0,this._clearSelectionArea=!1,i=!0,this._startX=a.clientX-l.left},150)},r=a=>{const l=e.getBoundingClientRect();i&&this._isDragging&&(this._endX=a.clientX-l.left,Dm("dragSelectMove",t,this))},o=a=>{const l=e.getBoundingClientRect();clearTimeout(this._dragTimeout),i&&this._isDragging&&(this._endX=a.clientX-l.left,Dm("dragSelect",t,this),i=!1,this._isDragging=!1)};e.addEventListener("mousedown",s),e.addEventListener("mousemove",r),e.addEventListener("mouseup",o),this._dragSelectHandlers={onMouseDown:s,onMouseMove:r,onMouseUp:o}}beforeDestroy(t){const e=t.canvas;if(this._dragSelectHandlers){const{onMouseDown:i,onMouseMove:s,onMouseUp:r}=this._dragSelectHandlers;e.removeEventListener("mousedown",i),e.removeEventListener("mousemove",s),e.removeEventListener("mouseup",r)}this._isDragging=!1,this._dragTimeout&&clearTimeout(this._dragTimeout)}afterDatasetsDraw(t){(this._isDragging||!this._clearSelectionArea)&&(ED(t,this._startX,this._endX),OD(t,this._startX,this._endX))}clearSelectionArea(){this._clearSelectionArea=!0,this._chart&&this._chart.update()}}const RD=["hidden","single","full"];var ei=(n=>(n.String="string",n.Number="number",n.Boolean="boolean",n.Object="object",n.Undefined="undefined",n))(ei||{});const ID=["donut","horizontal_bar","vertical_bar","timeseries_line","timeseries_bar"],LD=["gauge","top_n","single_value"],ND=20,FD="rgba(255, 171, 171, 0.4)",zD="rgba(255, 196, 0, 0.2)",Tm=(n,t,e)=>{const i=t.y-n.y;if(i===0)return t.x;const s=(e-n.y)/i;return n.x+s*(t.x-n.x)},BD=(n,t)=>{const e=[];return n.data.datasets.forEach(i=>{if(!n.getDatasetMeta(n.data.datasets.indexOf(i)).visible)return;const r=i.data;r!=null&&r.length&&t.filter(o=>o.highlightIntersections).forEach(o=>{const a=r.map(c=>({ts:c.x,aboveThreshold:c.y>=o.value}));let l;for(let c=1;c<a.length;c++)!a[c-1].aboveThreshold&&a[c].aboveThreshold?l=Tm(r[c-1],r[c],o.value):a[c-1].aboveThreshold&&!a[c].aboveThreshold&&l!==void 0&&(e.push({start:l,end:Tm(r[c-1],r[c],o.value),type:o.type}),l=void 0);l!==void 0&&e.push({start:l,end:a[a.length-1].ts,type:o.type})})}),e},HD=n=>{if(!n.length)return[];n.sort((e,i)=>e.type.localeCompare(i.type)||e.start-i.start);const t=[];for(const e of n){const i=t.findLast(({type:s})=>s===e.type);i&&e.start<=i.end?i.end=Math.max(i.end,e.end):t.push({...e})}return t};class WD{constructor(t){O(this,"id","thresholdPlugin");O(this,"_thresholds");O(this,"_mouseMoveHandler");this.i18n=t}_syncThresholds(t){var e,i;for(const s of Object.keys(t.threshold||{})){const r=(e=t.threshold)==null?void 0:e[s];r&&(this._thresholds={...this._thresholds,[s]:r.map(o=>({...o,hovered:!1}))})}if(this._thresholds)for(const s of Object.keys(this._thresholds))(i=t.threshold)!=null&&i[s]||delete this._thresholds[s]}get thresholds(){return this._thresholds}beforeUpdate(t,e,i){this._syncThresholds(i)}beforeInit(t,e,i){const s=t.canvas;this._syncThresholds(i);const r=o=>{var a;if(t){const l=o.clientY,c=t.scales.y,u=s.getBoundingClientRect(),h=c.getValueForPixel(l-u.top);if(h)for(const f of Object.keys(this._thresholds||{})){const m=(a=this._thresholds)==null?void 0:a[f];m&&m.forEach(g=>{g.hovered=Math.abs(g.value-h)<ND})}}};s.addEventListener("mousemove",r),this._mouseMoveHandler=r}afterDatasetsDraw(t,e){var s;const i=t.ctx;for(const r of Object.keys(this._thresholds||{})){const o=(s=this._thresholds)==null?void 0:s[r];if(o){o.forEach(c=>{const h=t.scales.y.getPixelForValue(c.value);i.save(),i.beginPath(),i.moveTo(t.chartArea.left,h),i.lineTo(t.chartArea.right,h),i.lineWidth=1,i.strokeStyle=Hr(c.type),i.setLineDash([5,5]),i.stroke(),i.restore();let f="";c.label?f=`${c.label}: ${c.value}`:c.type==="warning"?f=this.i18n.t("chartLabels.threshold-warning",{value:c.value}):c.type==="error"?f=this.i18n.t("chartLabels.threshold-error",{value:c.value}):f=this.i18n.t("chartLabels.thatreshold-neutral",{value:c.value}),c.hovered&&(i.save(),i.fillStyle=Hr(c.type),i.font=Rw,i.fillText(f,t.chartArea.left,h-4),i.restore())});const a=BD(t,o);HD(a).forEach(c=>{const u=t.scales.x.getPixelForValue(c.start),h=t.scales.x.getPixelForValue(c.end);i.save(),i.fillStyle=c.type==="error"?FD:zD,i.fillRect(u,t.chartArea.top,h-u,t.chartArea.bottom-t.chartArea.top),i.restore(),i.save(),i.beginPath(),i.moveTo(u,t.chartArea.bottom),i.lineTo(h,t.chartArea.bottom),i.lineWidth=2,i.strokeStyle=Hr(c.type),i.stroke(),i.restore()})}}}beforeDestroy(t){this._mouseMoveHandler&&t.canvas.removeEventListener("mousemove",this._mouseMoveHandler)}}const VD=Se(d.defineComponent({__name:"TimeSeriesChart",props:{chartData:{default:void 0},type:{default:"timeseries_line"},fill:{type:Boolean,default:!1},tooltipTitle:{},metricUnit:{default:""},timeRangeMs:{default:void 0},granularity:{},stacked:{type:Boolean,default:!0},legendValues:{default:void 0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,default:(n,t)=>t.rawValue-n.rawValue},brush:{type:Boolean,default:!1},zoomActionItems:{default:void 0},tooltipMetricDisplay:{default:""},threshold:{default:void 0}},emits:["zoom-time-range","select-chart-range"],setup(n,{emit:t}){const e=n,i=t,{i18n:s}=bt.useI18n(),r=new Sm,o=new gm,a=new AD,l=new WD(s),{translateUnit:c}=bt.useTranslatedUnits(),u=d.ref(),h=crypto.randomUUID(),f=crypto.randomUUID(),m=d.ref([]),g=d.ref(),b=d.inject("legendPosition",Nt.Right),x=d.useTemplateRef("chartParent"),k=d.ref(void 0),M=d.ref(!1),T=d.inject(yf),v=T==null?void 0:T.evaluateFeatureFlagFn("analytics-chart-zoom-actions",!1),S=d.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:e.tooltipMetricDisplay,tooltipSeries:[],left:"",top:"",units:e.metricUnit,translateUnit:c,offsetX:0,offsetY:0,width:0,height:0,chartType:e.type,chartID:f,chartTooltipSortFn:e.chartTooltipSortFn,interactionMode:"idle"}),{tooltipAbsoluteLeft:E,tooltipAbsoluteTop:P}=bt.useTooltipAbsolutePosition(x,S),y={id:h,afterUpdate($){m.value=lh($,e.legendValues,e.chartLegendSortFn)}},_=d.computed(()=>[y,o,...e.brush?[a]:[],...e.type==="timeseries_line"?[r]:[],...e.threshold?[l]:[]]),C=d.computed(()=>`line-${_.value.map($=>$.id).join("-")}`),R=d.computed(()=>`bar-${_.value.map($=>$.id).join("-")}`),L=d.computed(()=>e.chartData&&Sw(e.chartData)),I=d.computed(()=>v?!1:M.value),{options:B}=bt.useLineChartOptions({tooltipState:S,timeRangeMs:d.toRef(e,"timeRangeMs"),granularity:d.toRef(e,"granularity"),legendID:h,stacked:d.toRef(e,"stacked"),metricAxesTitle:d.toRef(e,"metricAxesTitle"),dimensionAxesTitle:d.toRef(e,"dimensionAxesTitle"),pointsWithoutHover:L,threshold:d.toRef(e,"threshold")});bt.useReportChartDataForSynthetics(d.toRef(e,"chartData"),d.toRef(e,"syntheticsDataKey"));const q=$=>({[Nt.Right]:"legend-row",[Nt.Bottom]:"column",[Nt.Hidden]:"hidden"})[$],tt=({width:$,height:K})=>{S.width=$,S.height=K},V=($=!0)=>{S.interactionMode="idle",S.showTooltip=!1,a.clearSelectionArea(),o.isPaused&&o.resume($),r.isPaused&&r.resume()},ct=()=>{S.interactionMode="interactive"},U=()=>{var $,K;!u.value||!((K=($=u.value.chart.tooltip)==null?void 0:$.dataPoints)!=null&&K.length)||(S.interactionMode==="interactive"?r.clickedSegment=u.value.chart.tooltip.dataPoints[0]:r.destroyClickedSegment())},J=()=>{if(M.value){M.value=!1;return}S.interactionMode!=="idle"?V():ct(),U()};d.watch(()=>e.type,()=>{S.interactionMode="idle",S.showTooltip=!1,r.destroyClickedSegment()});const et=$=>{$.preventDefault(),$.stopPropagation();const{xStart:K,xEnd:_t}=$.detail;K&&_t&&(k.value={start:new Date(K),end:new Date(_t),type:"absolute"},v?S.interactionMode="zoom-interactive":(i("zoom-time-range",{start:new Date(K),end:new Date(_t),type:"absolute"}),V()),i("select-chart-range",k.value))},X=$=>{v&&(S.interactionMode="selecting-chart-area"),M.value=!0,r.pause(),o.pause();const{xStart:K,xEnd:_t}=$.detail;K&&_t&&(k.value={start:new Date(K),end:new Date(_t),type:"absolute"})},j=$=>{if(!x.value||S.interactionMode==="idle")return;const K=$.target;K&&x.value.contains(K)||M.value||V(!1)};return d.watch(()=>{var $;return($=u.value)==null?void 0:$.chart},()=>{var $;($=u.value)!=null&&$.chart&&(u.value.chart.canvas.removeEventListener("dragSelect",et),u.value.chart.canvas.removeEventListener("dragSelectMove",X),u.value.chart.canvas.addEventListener("dragSelect",et),u.value.chart.canvas.addEventListener("dragSelectMove",X))}),d.onMounted(()=>{document.addEventListener("click",j,!0)}),d.onUnmounted(()=>{var $;($=u.value)!=null&&$.chart&&(u.value.chart.canvas.removeEventListener("dragSelect",et),u.value.chart.canvas.removeEventListener("dragSelectMove",X)),document.removeEventListener("click",j,!0)}),($,K)=>(d.openBlock(),d.createElementBlock("div",{ref:"chartParent",class:d.normalizeClass(["chart-parent",q(d.unref(b))]),"data-testid":"line-chart-parent"},[d.createElementVNode("div",{class:"chart-container",onClick:K[0]||(K[0]=_t=>J())},[$.type==="timeseries_line"?(d.openBlock(),d.createBlock(d.unref(Mm),{key:C.value,ref_key:"chartInstance",ref:u,"chart-id":d.unref(f),class:"chart-canvas",data:$.chartData,"data-testid":"time-series-line-chart",options:d.unref(B),plugins:_.value},null,8,["chart-id","data","options","plugins"])):$.type==="timeseries_bar"?(d.openBlock(),d.createBlock(d.unref(wm),{key:R.value,ref_key:"chartInstance",ref:u,"chart-id":d.unref(f),class:"chart-canvas",data:$.chartData,"data-testid":"time-series-bar-chart",options:d.unref(B),plugins:_.value},null,8,["chart-id","data","options","plugins"])):d.createCommentVNode("",!0)]),I.value?d.createCommentVNode("",!0):(d.openBlock(),d.createBlock(ao,{key:0,ref_key:"tooltipElement",ref:g,"absolute-left":d.unref(E),"absolute-top":d.unref(P),"data-testid":"tooltip",granularity:$.granularity,state:S,"tooltip-title":$.tooltipTitle,"zoom-action-items":$.zoomActionItems,"zoom-time-range":k.value,onDimensions:tt,onOnAction:K[1]||(K[1]=()=>V(!1))},null,8,["absolute-left","absolute-top","granularity","state","tooltip-title","zoom-action-items","zoom-time-range"])),d.createVNode(Cl,{id:d.unref(h),"chart-instance":u.value,"data-testid":"legend",items:m.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-3a82636b"]]),YD={class:"analytics-chart-shell"},jD={key:0,class:"chart-header"},$D={class:"tooltip-content"},UD={key:2,class:"analytics-chart-parent"},qD=d.defineComponent({__name:"AnalyticsChart",props:{chartData:{},chartOptions:{},tooltipTitle:{default:""},emptyStateTitle:{default:""},emptyStateDescription:{default:""},legendPosition:{default:Nt.Right},syntheticsDataKey:{default:""},showLegendValues:{type:Boolean,default:!0},showAnnotations:{type:Boolean,default:!0},timeseriesZoom:{type:Boolean,default:!1},requestsLink:{default:void 0},exploreLink:{default:void 0}},emits:["zoom-time-range","select-chart-range"],setup(n,{emit:t}){const e=t,i=n,{i18n:s}=bt.useI18n(),r=d.computed(()=>b.value?bt.useExploreResultToTimeDataset({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Wr},d.toRef(i,"chartData")).value:bt.useExploreResultToDatasets({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Wr},d.toRef(i,"chartData")).value),o=d.computed(()=>i.timeseriesZoom||!!i.exploreLink||!!i.requestsLink),a=d.computed(()=>{var I;return(I=i.chartData)!=null&&I.meta?"start_ms"in i.chartData.meta?i.chartData.meta.end_ms-i.chartData.meta.start_ms:void 0:0}),l=d.computed(()=>{var I;return(I=i.chartData.meta)!=null&&I.metric_units?Object.values(i.chartData.meta.metric_units)[0]:""}),c=d.computed(()=>i.showLegendValues&&i.legendPosition!==Nt.Bottom),{legendValues:u}=bt.useChartLegendValues(r,i.chartOptions.type,l),h=d.computed(()=>{var I,B,q;return((q=(B=(I=i.chartData)==null?void 0:I.meta)==null?void 0:B.limit)==null?void 0:q.toString())||null}),f=d.computed(()=>{var I,B;return((B=(I=i.chartData)==null?void 0:I.meta)==null?void 0:B.truncated)||!1}),m=s.t("limitedResultsShown",{maxReturned:h.value}),g=d.computed(()=>["vertical_bar","horizontal_bar"].includes(i.chartOptions.type)),b=d.computed(()=>["timeseries_bar","timeseries_line"].some(I=>I===i.chartOptions.type)),x=d.computed(()=>i.chartOptions.type==="donut"),k=d.computed(()=>i.chartOptions.type.includes("vertical")?"vertical":"horizontal"),M=d.computed(()=>{var q,tt;if(!((q=i.chartData)!=null&&q.meta.metric_names)||!((tt=i.chartData)!=null&&tt.meta.metric_units))return;const I=i.chartData.meta.metric_names[0],B=i.chartData.meta.metric_units[I];if(i.chartData.meta.metric_names.length>1){if(I.includes("latency"))return s.t("metricAxisTitles.latency_in",{unit:s.t(`chartUnits.${B}`,{plural:"s"})});if(I.includes("size"))return s.t("metricAxisTitles.size_in",{unit:s.t(`chartUnits.${B}`,{plural:"s"})})}if(I)return s.te(`chartLabels.${I}`)?s.t(`chartLabels.${I}`):I}),T=d.computed(()=>{var q,tt,V,ct;if((q=i.chartOptions)!=null&&q.metricAxesTitle)return(tt=i.chartOptions)==null?void 0:tt.metricAxesTitle;if(!((V=i.chartData)!=null&&V.meta.metric_names)||!((ct=i.chartData)!=null&&ct.meta.metric_units))return;const I=i.chartData.meta.metric_names[0],B=i.chartData.meta.metric_units[I];if(i.chartData.meta.metric_names.length>1){if(I.includes("latency"))return s.t("metricAxisTitles.latency_in",{unit:s.t(`chartUnits.${B}`,{plural:"s"})});if(I.includes("size"))return s.t("metricAxisTitles.size_in",{unit:s.t(`chartUnits.${B}`,{plural:"s"})})}return s.te(`metricAxisTitles.${I}`)&&s.te(`chartUnits.${B}`)?s.t(`metricAxisTitles.${I}`,{unit:s.t(`chartUnits.${B}`,{plural:"s"})})||void 0:I||void 0}),v=d.computed(()=>{var B;if((B=i.chartOptions)!=null&&B.dimensionAxesTitle)return i.chartOptions.dimensionAxesTitle;const I=b.value?"Time":Object.keys(i.chartData.meta.display||i.chartData.meta.metric_names)[0];if(I)return s.te(`chartLabels.${I}`)?s.t(`chartLabels.${I}`):I}),S=d.computed(()=>{const I=ul(Number(i.chartData.meta.granularity_ms));if(I)return s.te(`granularityAxisTitles.${I}`)?s.t(`granularityAxisTitles.${I}`):I}),E=d.computed(()=>i.emptyStateTitle||s.t("noDataAvailableTitle")),P=d.computed(()=>i.emptyStateDescription||s.t("noDataAvailableDescription")),y=d.computed(()=>b.value?Dw(r.value):i.chartData&&i.chartData.meta&&i.chartData.data.length),_=d.computed(()=>i.chartData.meta.granularity_ms?ul(i.chartData.meta.granularity_ms)||"hourly":ul(new Date(i.chartData.data[1].timestamp).getTime()-new Date(i.chartData.data[0].timestamp).getTime())||"hourly"),C=d.computed(()=>i.chartOptions.chartLegendSortFn?i.chartOptions.chartLegendSortFn:(I,B)=>I.text===s.t("chartLabels.____OTHER____")?1:B.text===s.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(I.text,10))&&!isNaN(parseInt(B.text,10))?I.text<B.text?-1:1:I.value&&B.value?B.value.raw-I.value.raw:0),R=d.computed(()=>i.chartOptions.chartTooltipSortFn?i.chartOptions.chartTooltipSortFn:(I,B)=>I.label===s.t("chartLabels.____OTHER____")?1:B.label===s.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(I.label,10))&&!isNaN(parseInt(B.label,10))?I.label<B.label?-1:1:I.value&&B.value?B.rawValue-I.rawValue:0),L=d.computed(()=>[...i.timeseriesZoom?[{label:s.t("zoom_action_items.zoom"),key:"zoom-in",action:I=>e("zoom-time-range",I)}]:[],...i.exploreLink?[{label:s.t("zoom_action_items.explore"),key:"explore",href:i.exploreLink.href}]:[],...i.requestsLink?[{label:s.t("zoom_action_items.view_requests"),key:"view-requests",href:i.requestsLink.href}]:[]]);return d.provide("showLegendValues",c),d.provide("legendPosition",d.toRef(i,"legendPosition")),(I,B)=>{const q=d.resolveComponent("KTooltip"),tt=d.resolveComponent("KEmptyState");return d.openBlock(),d.createElementBlock("div",YD,[y.value&&f.value&&h.value?(d.openBlock(),d.createElementBlock("div",jD,[d.createVNode(q,{class:"tooltip","max-width":"500",placement:"right"},{content:d.withCtx(()=>[d.createElementVNode("div",$D,d.toDisplayString(d.unref(m)),1)]),default:d.withCtx(()=>[d.createVNode(d.unref(Gs.WarningIcon),{color:`var(--kui-color-text-warning, ${d.unref(Ow)})`,size:d.unref(Aw)},null,8,["color","size"])]),_:1})])):d.createCommentVNode("",!0),y.value?(d.openBlock(),d.createElementBlock("div",UD,[b.value?(d.openBlock(),d.createBlock(VD,{key:0,brush:o.value,"chart-data":r.value,"chart-legend-sort-fn":C.value,"chart-tooltip-sort-fn":R.value,"dimension-axes-title":S.value,fill:I.chartOptions.stacked,granularity:_.value,"legend-values":d.unref(u),"metric-axes-title":T.value,"metric-unit":l.value,stacked:I.chartOptions.stacked,"synthetics-data-key":I.syntheticsDataKey,threshold:I.chartOptions.threshold,"time-range-ms":a.value,"tooltip-metric-display":M.value,"tooltip-title":I.tooltipTitle,type:I.chartOptions.type,"zoom-action-items":L.value,onSelectChartRange:B[0]||(B[0]=V=>e("select-chart-range",V)),onZoomTimeRange:B[1]||(B[1]=V=>e("zoom-time-range",V))},null,8,["brush","chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","fill","granularity","legend-values","metric-axes-title","metric-unit","stacked","synthetics-data-key","threshold","time-range-ms","tooltip-metric-display","tooltip-title","type","zoom-action-items"])):g.value?(d.openBlock(),d.createBlock(_D,{key:1,annotations:I.showAnnotations,"chart-data":r.value,"chart-legend-sort-fn":C.value,"chart-tooltip-sort-fn":R.value,"data-testid":"bar-chart-container","dimension-axes-title":v.value,"legend-values":d.unref(u),"metric-axes-title":T.value,"metric-unit":l.value,orientation:k.value,stacked:I.chartOptions.stacked,"synthetics-data-key":I.syntheticsDataKey,"tooltip-metric-display":M.value,"tooltip-title":I.tooltipTitle},null,8,["annotations","chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","legend-values","metric-axes-title","metric-unit","orientation","stacked","synthetics-data-key","tooltip-metric-display","tooltip-title"])):x.value?(d.openBlock(),d.createBlock(PD,{key:2,"chart-data":r.value,"dataset-colors":I.chartOptions.chartDatasetColors||d.unref(Wr),"legend-position":I.legendPosition,"legend-values":d.unref(u),"metric-unit":l.value,"synthetics-data-key":I.syntheticsDataKey,"tooltip-dimension-display":v.value,"tooltip-metric-display":M.value,"tooltip-title":I.tooltipTitle},null,8,["chart-data","dataset-colors","legend-position","legend-values","metric-unit","synthetics-data-key","tooltip-dimension-display","tooltip-metric-display","tooltip-title"])):d.createCommentVNode("",!0)])):(d.openBlock(),d.createBlock(tt,{key:1,"action-button-visible":!1,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(E.value),1)]),default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(P.value),1)]),_:1}))])}}}),XD=Se(qD,[["__scopeId","data-v-01aae525"]]),GD={class:"chart-parent","data-testid":"gauge-chart-parent"},KD={class:"chart-totals-flex"},ZD={key:1,class:"metric-small","data-testid":"gauge-chart-total"},QD=Se(d.defineComponent({__name:"GaugeChart",props:{chartData:{type:Object,required:!1,default:null},metricDisplay:{type:String,required:!1,default:"hidden"},numerator:{type:Number,required:!1,default:0},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:sn},height:{type:String,required:!1,default:"400px",validator:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)}},setup(n){const t=n,{i18n:e}=bt.useI18n(),i=d.ref(lo()),s=d.computed(()=>[t.chartData.datasets.reduce((g,b)=>(g.labels.push(b.label),g.borderColor.push(b.backgroundColor),g.backgroundColor.push(b.backgroundColor),g.data.push(b.data.reduce((x,k)=>x+k,0)),g),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),r=d.computed(()=>({...t.chartData,datasets:s.value}));bt.useReportChartDataForSynthetics(d.toRef(t,"chartData"),d.toRef(t,"syntheticsDataKey"));const o={responsive:!0,maintainAspectRatio:!0,cutout:"78%",circumference:"200",rotation:"260",plugins:{legend:{display:!1}}},a=d.ref(),l=d.computed(()=>{var m;return Ss((m=s==null?void 0:s.value[0])==null?void 0:m.data[t.numerator],{capital:!0})}),c=d.computed(()=>{var m,g;return Ss(((m=s==null?void 0:s.value[0])==null?void 0:m.data[0])+((g=s==null?void 0:s.value[0])==null?void 0:g.data[1]),{capital:!0})}),u=d.computed(()=>{var m;return`color: ${(m=s==null?void 0:s.value[0])==null?void 0:m.backgroundColor[t.numerator]}`}),h=d.computed(()=>["full","single"].includes(t.metricDisplay)),f=d.computed(()=>t.metricDisplay==="full");return(m,g)=>(d.openBlock(),d.createElementBlock("div",GD,[d.createElementVNode("div",KD,[h.value?(d.openBlock(),d.createElementBlock("div",{key:0,class:"metric-large","data-testid":"gauge-chart-metric",style:d.normalizeStyle(u.value)},d.toDisplayString(l.value),5)):d.createCommentVNode("",!0),f.value?(d.openBlock(),d.createElementBlock("div",ZD,d.toDisplayString(d.unref(e).t("total"))+": "+d.toDisplayString(c.value),1)):d.createCommentVNode("",!0)]),d.createElementVNode("div",{class:"chart-container",style:d.normalizeStyle({height:n.height,width:n.width})},[d.createVNode(d.unref(vm),{ref_key:"chartInstance",ref:a,"chart-id":i.value,data:r.value,options:o},null,8,["chart-id","data","options"])],4)]))}}),[["__scopeId","data-v-32e7f9e0"]]),JD={class:"chart-parent","data-testid":"single-value-parent"},tT={key:1,class:"single-value-wrapper"},eT={class:"single-value","data-testid":"single-value-chart"},nT={key:0,class:"single-value-unit"},iT=Se(d.defineComponent({__name:"SingleValue",props:{data:{type:Object,required:!0},decimalPoints:{type:Number,default:bf}},setup(n){const{i18n:{t}}=bt.useI18n(),e=n,i=d.computed(()=>e.data.data[0]),s=d.computed(()=>{var c,u;return(u=(c=e.data.meta)==null?void 0:c.metric_names)==null?void 0:u[0]}),r=d.computed(()=>{var u,h;const c=s.value?(h=(u=e.data.meta)==null?void 0:u.metric_units)==null?void 0:h[s.value]:void 0;if(c)return t(`chartUnits.${c}`,{plural:""})}),o=d.computed(()=>{var c;return s.value==="request_per_minute"||!!((c=s.value)!=null&&c.includes("_latency_"))}),a=d.computed(()=>!i.value||!s.value||typeof i.value.event[s.value]!="number"?null:i.value.event[s.value]),l=d.computed(()=>{var h;const c=a.value;if(c===null)return"";if((h=s.value)!=null&&h.includes("_size_"))return Yr(c);if(c>=1e9){const f=(c/1e9).toFixed(1);return f.endsWith(".0")?`${Math.floor(c/1e9)}B`:`${f}B`}if(c>=1e7){const f=(c/1e6).toFixed(1);return f.endsWith(".0")?`${Math.floor(c/1e6)}M`:`${f}M`}const u=e.decimalPoints&&typeof e.decimalPoints=="number"?e.decimalPoints:bf;return c.toLocaleString("en-US",{maximumFractionDigits:u})});return d.onMounted(()=>{var c,u;((u=(c=e.data)==null?void 0:c.data)==null?void 0:u.length)>1&&console.warn("SingleValue chart should only be used with a single data point. Data length:",e.data.data.length)}),(c,u)=>{const h=d.resolveComponent("KEmptyState");return d.openBlock(),d.createElementBlock("div",JD,[a.value===null?(d.openBlock(),d.createBlock(h,{key:0,class:"single-value-error","data-testid":"single-value-error","icon-variant":"error",title:d.unref(t)("singleValue.valueError")},null,8,["title"])):(d.openBlock(),d.createElementBlock("div",tT,[d.createElementVNode("span",eT,d.toDisplayString(l.value),1),o.value?(d.openBlock(),d.createElementBlock("span",nT," "+d.toDisplayString(r.value),1)):d.createCommentVNode("",!0)]))])}}}),[["__scopeId","data-v-c25764ee"]]),sT={class:"simple-chart-shell"},rT={key:1,class:"analytics-chart-parent"},oT=Se(d.defineComponent({__name:"SimpleChart",props:{chartData:{type:Object,required:!0},chartOptions:{type:Object,required:!0},emptyStateTitle:{type:String,required:!1,default:""},syntheticsDataKey:{type:String,required:!1,default:""},height:{type:String,required:!1,default:"400px",validator:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)}},setup(n){const t=n,{i18n:e}=bt.useI18n(),i=d.computed(()=>{var u;const c=bt.useExploreResultToDatasets({colorPalette:t.chartOptions.chartDatasetColors||sn},d.toRef(t,"chartData")).value;return(u=t.chartOptions)!=null&&u.reverseDataset&&(c==null||c.datasets.reverse()),c}),s=d.computed(()=>{var c;return(c=t.chartData.meta)!=null&&c.metric_units?Object.values(t.chartData.meta.metric_units)[0]:""}),r=d.computed(()=>t.chartOptions.type==="gauge"),o=d.computed(()=>t.chartOptions.type==="single_value"),a=d.computed(()=>t.emptyStateTitle||e.t("noDataAvailableTitle")),l=d.computed(()=>{var u,h;const c=t.chartData&&t.chartData.meta&&t.chartData.data.length;if(o.value){const f=(h=(u=t.chartData.meta)==null?void 0:u.metric_names)==null?void 0:h[0];return c&&t.chartData.data[0].event[f]!==null}return c});return(c,u)=>{const h=d.resolveComponent("KEmptyState");return d.openBlock(),d.createElementBlock("div",sT,[l.value?(d.openBlock(),d.createElementBlock("div",rT,[r.value?(d.openBlock(),d.createBlock(QD,{key:0,"chart-data":i.value,"dataset-colors":n.chartOptions.chartDatasetColors,"is-simple":"","metric-display":n.chartOptions.metricDisplay,"metric-unit":s.value,numerator:n.chartOptions.numerator,"synthetics-data-key":n.syntheticsDataKey,width:n.width},null,8,["chart-data","dataset-colors","metric-display","metric-unit","numerator","synthetics-data-key","width"])):d.createCommentVNode("",!0),o.value?(d.openBlock(),d.createBlock(iT,{key:1,data:n.chartData,"decimal-points":n.chartOptions.decimalPoints},null,8,["data","decimal-points"])):d.createCommentVNode("",!0)])):(d.openBlock(),d.createBlock(h,{key:0,"action-button-visible":!0,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(a.value),1)]),_:1}))])}}}),[["__scopeId","data-v-471652c8"]]),aT={class:"top-n-card-title","data-testid":"top-n-card-title"},lT={class:"top-n-card-description","data-testid":"top-n-card-description"},cT={key:3,class:"top-n-table","data-testid":"top-n-table"},uT={class:"table-headings"},dT={class:"table-row"},hT={class:"column-1"},fT={class:"column-2"},mT={class:"table-body","data-testid":"top-n-data"},gT=["data-testid"],pT={class:"column-1"},yT={class:"column-2"},bT=Se(d.defineComponent({__name:"TopNTable",props:{title:{default:""},description:{default:""},data:{},emptyStateTitle:{default:""},isLoading:{type:Boolean,default:!1},titleTag:{default:"h2"}},setup(n){const t=n,{i18n:e}=bt.useI18n(),i=d.computed(()=>t.data.data),s=d.computed(()=>{var g;return!!((g=i.value)!=null&&g.length)}),r=d.computed(()=>{var g,b;return(g=t.data.meta)!=null&&g.display&&((b=Object.keys(t.data.meta.display))==null?void 0:b[0])||""}),o=d.computed(()=>r.value?t.data.meta.display[r.value]:{}),a=d.computed(()=>{var g,b;return(b=(g=t.data.meta)==null?void 0:g.metric_names)!=null&&b.length?t.data.meta.metric_names[0]:""}),l=d.computed(()=>a.value?e.t(`chartLabels.${a.value}`)||a.value:""),c=d.computed(()=>{if(!s.value)return"";if(t.data.meta){if(o.value&&!Object.keys(o.value).length)return e.t("topNTable.errors.display");if(!a.value)return e.t("topNTable.errors.metricNames")}else return e.t("topNTable.errors.meta");return""}),u=g=>{const b=g.event;return String(b[r.value])},h=g=>{const b=u(g),x=o.value&&o.value[b];return x?x.name:"-"},f=g=>{const b=u(g),x=o.value&&o.value[b];return x?!!x.deleted:!1},m=g=>{if(!a.value)return"–";const x=g.event[a.value];return x?Ss(x,{capital:!0,round:!0}):"–"};return(g,b)=>{const x=d.resolveComponent("KEmptyState"),k=d.resolveComponent("KSkeleton"),M=d.resolveComponent("KCard");return d.openBlock(),d.createBlock(M,{class:"kong-ui-public-top-n-table","title-tag":g.titleTag},d.createSlots({default:d.withCtx(()=>[c.value?(d.openBlock(),d.createBlock(x,{key:0,"action-button-visible":!1,"data-testid":"top-n-error-state","icon-variant":"error"},{title:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(d.unref(e).t("topNTable.defaultErrorStateTitle")),1)]),default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(c.value),1)]),_:1})):g.isLoading?(d.openBlock(),d.createBlock(k,{key:1,"table-columns":2,type:"table"})):s.value?(d.openBlock(),d.createElementBlock("div",cT,[d.createElementVNode("div",uT,[d.createElementVNode("div",dT,[d.createElementVNode("div",hT,d.toDisplayString(d.unref(e).t("topNTable.nameLabel")),1),d.createElementVNode("div",fT,d.toDisplayString(l.value),1)])]),d.createElementVNode("div",mT,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(i.value,(T,v)=>(d.openBlock(),d.createElementBlock("div",{key:`entry-${v}`,class:"table-row","data-testid":`row-${u(T)}`},[d.createElementVNode("div",pT,[d.renderSlot(g.$slots,"name",{record:{id:u(T),name:h(T),deleted:f(T),dimension:r.value}},()=>[d.createTextVNode(d.toDisplayString(h(T)),1)],!0)]),d.createElementVNode("div",yT," "+d.toDisplayString(m(T)),1)],8,gT))),128))])])):(d.openBlock(),d.createBlock(x,{key:2,"action-button-visible":!1,"data-testid":"top-n-empty-state"},{title:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(g.emptyStateTitle||d.unref(e).t("topNTable.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[g.title?{name:"title",fn:d.withCtx(()=>[d.createElementVNode("span",aT,d.toDisplayString(g.title),1)]),key:"0"}:void 0,g.description?{name:"actions",fn:d.withCtx(()=>[d.createElementVNode("div",lT,d.toDisplayString(g.description),1)]),key:"1"}:void 0]),1032,["title-tag"])}}}),[["__scopeId","data-v-665e7735"]]);var co={exports:{}};co.exports,function(n,t){var e=200,i="Expected a function",s="__lodash_hash_undefined__",r=1,o=2,a=9007199254740991,l="[object Arguments]",c="[object Array]",u="[object Boolean]",h="[object Date]",f="[object Error]",m="[object Function]",g="[object GeneratorFunction]",b="[object Map]",x="[object Number]",k="[object Object]",M="[object Promise]",T="[object RegExp]",v="[object Set]",S="[object String]",E="[object Symbol]",P="[object WeakMap]",y="[object ArrayBuffer]",_="[object DataView]",C="[object Float32Array]",R="[object Float64Array]",L="[object Int8Array]",I="[object Int16Array]",B="[object Int32Array]",q="[object Uint8Array]",tt="[object Uint8ClampedArray]",V="[object Uint16Array]",ct="[object Uint32Array]",U=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,J=/^\w*$/,et=/^\./,X=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,j=/[\\^$.*+?()[\]{}|]/g,$=/\\(\\)?/g,K=/^\[object .+?Constructor\]$/,_t=/^(?:0|[1-9]\d*)$/,gt={};gt[C]=gt[R]=gt[L]=gt[I]=gt[B]=gt[q]=gt[tt]=gt[V]=gt[ct]=!0,gt[l]=gt[c]=gt[y]=gt[u]=gt[_]=gt[h]=gt[f]=gt[m]=gt[b]=gt[x]=gt[k]=gt[T]=gt[v]=gt[S]=gt[P]=!1;var pt=typeof be=="object"&&be&&be.Object===Object&&be,z=typeof self=="object"&&self&&self.Object===Object&&self,Y=pt||z||Function("return this")(),W=t&&!t.nodeType&&t,Q=W&&!0&&n&&!n.nodeType&&n,nt=Q&&Q.exports===W,it=nt&&pt.process,rt=function(){try{return it&&it.binding("util")}catch{}}(),st=rt&&rt.isTypedArray;function wt(p,D){for(var N=-1,H=p?p.length:0;++N<H;)if(D(p[N],N,p))return!0;return!1}function ut(p){return function(D){return D==null?void 0:D[p]}}function Pt(p,D){for(var N=-1,H=Array(p);++N<p;)H[N]=D(N);return H}function te(p){return function(D){return p(D)}}function ae(p,D){return p==null?void 0:p[D]}function qt(p){var D=!1;if(p!=null&&typeof p.toString!="function")try{D=!!(p+"")}catch{}return D}function Ee(p){var D=-1,N=Array(p.size);return p.forEach(function(H,ft){N[++D]=[ft,H]}),N}function Mt(p,D){return function(N){return p(D(N))}}function Xt(p){var D=-1,N=Array(p.size);return p.forEach(function(H){N[++D]=H}),N}var Bt=Array.prototype,Gt=Function.prototype,ie=Object.prototype,qe=Y["__core-js_shared__"],ni=function(){var p=/[^.]+$/.exec(qe&&qe.keys&&qe.keys.IE_PROTO||"");return p?"Symbol(src)_1."+p:""}(),Fe=Gt.toString,Ht=ie.hasOwnProperty,_e=ie.toString,ii=RegExp("^"+Fe.call(Ht).replace(j,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),uo=Y.Symbol,ho=Y.Uint8Array,zs=ie.propertyIsEnumerable,si=Bt.splice,Bs=Mt(Object.keys,Object),ri=dn(Y,"DataView"),an=dn(Y,"Map"),ln=dn(Y,"Promise"),Hs=dn(Y,"Set"),Ws=dn(Y,"WeakMap"),oi=dn(Object,"create"),Rl=fn(ri),Il=fn(an),fo=fn(ln),mo=fn(Hs),cn=fn(Ws),Ai=uo?uo.prototype:void 0,Vs=Ai?Ai.valueOf:void 0,go=Ai?Ai.toString:void 0;function un(p){var D=-1,N=p?p.length:0;for(this.clear();++D<N;){var H=p[D];this.set(H[0],H[1])}}function Ll(){this.__data__=oi?oi(null):{}}function ze(p){return this.has(p)&&delete this.__data__[p]}function Nl(p){var D=this.__data__;if(oi){var N=D[p];return N===s?void 0:N}return Ht.call(D,p)?D[p]:void 0}function Fl(p){var D=this.__data__;return oi?D[p]!==void 0:Ht.call(D,p)}function zl(p,D){var N=this.__data__;return N[p]=oi&&D===void 0?s:D,this}un.prototype.clear=Ll,un.prototype.delete=ze,un.prototype.get=Nl,un.prototype.has=Fl,un.prototype.set=zl;function Be(p){var D=-1,N=p?p.length:0;for(this.clear();++D<N;){var H=p[D];this.set(H[0],H[1])}}function Bl(){this.__data__=[]}function An(p){var D=this.__data__,N=Li(D,p);if(N<0)return!1;var H=D.length-1;return N==H?D.pop():si.call(D,N,1),!0}function Hl(p){var D=this.__data__,N=Li(D,p);return N<0?void 0:D[N][1]}function Wl(p){return Li(this.__data__,p)>-1}function Vl(p,D){var N=this.__data__,H=Li(N,p);return H<0?N.push([p,D]):N[H][1]=D,this}Be.prototype.clear=Bl,Be.prototype.delete=An,Be.prototype.get=Hl,Be.prototype.has=Wl,Be.prototype.set=Vl;function He(p){var D=-1,N=p?p.length:0;for(this.clear();++D<N;){var H=p[D];this.set(H[0],H[1])}}function Yl(){this.__data__={hash:new un,map:new(an||Be),string:new un}}function Rn(p){return zi(this,p).delete(p)}function jl(p){return zi(this,p).get(p)}function $l(p){return zi(this,p).has(p)}function Ul(p,D){return zi(this,p).set(p,D),this}He.prototype.clear=Yl,He.prototype.delete=Rn,He.prototype.get=jl,He.prototype.has=$l,He.prototype.set=Ul;function Ri(p){var D=-1,N=p?p.length:0;for(this.__data__=new He;++D<N;)this.add(p[D])}function ql(p){return this.__data__.set(p,s),this}function Xl(p){return this.__data__.has(p)}Ri.prototype.add=Ri.prototype.push=ql,Ri.prototype.has=Xl;function Ae(p){this.__data__=new Be(p)}function Ii(){this.__data__=new Be}function Gl(p){return this.__data__.delete(p)}function Ys(p){return this.__data__.get(p)}function Kl(p){return this.__data__.has(p)}function Zl(p,D){var N=this.__data__;if(N instanceof Be){var H=N.__data__;if(!an||H.length<e-1)return H.push([p,D]),this;N=this.__data__=new He(H)}return N.set(p,D),this}Ae.prototype.clear=Ii,Ae.prototype.delete=Gl,Ae.prototype.get=Ys,Ae.prototype.has=Kl,Ae.prototype.set=Zl;function Ql(p,D){var N=w(p)||vo(p)?Pt(p.length,String):[],H=N.length,ft=!!H;for(var Z in p)Ht.call(p,Z)&&!(ft&&(Z=="length"||$s(Z,H)))&&N.push(Z);return N}function Li(p,D){for(var N=p.length;N--;)if(wo(p[N][0],D))return N;return-1}var Jl=cc();function tc(p,D){return p&&Jl(p,D,li)}function Ni(p,D){D=Bi(D,p)?[D]:Xe(D);for(var N=0,H=D.length;p!=null&&N<H;)p=p[hn(D[N++])];return N&&N==H?p:void 0}function ec(p){return _e.call(p)}function nc(p,D){return p!=null&&D in Object(p)}function js(p,D,N,H,ft){return p===D?!0:p==null||D==null||!Kt(p)&&!xe(D)?p!==p&&D!==D:ic(p,D,js,N,H,ft)}function ic(p,D,N,H,ft,Z){var xt=w(p),Zt=w(D),Wt=c,ce=c;xt||(Wt=le(p),Wt=Wt==l?k:Wt),Zt||(ce=le(D),ce=ce==l?k:ce);var we=Wt==k&&!qt(p),ve=ce==k&&!qt(D),fe=Wt==ce;if(fe&&!we)return Z||(Z=new Ae),xt||Mo(p)?bo(p,D,N,H,ft,Z):uc(p,D,Wt,N,H,ft,Z);if(!(ft&o)){var Re=we&&Ht.call(p,"__wrapped__"),Ie=ve&&Ht.call(D,"__wrapped__");if(Re||Ie){var Nn=Re?p.value():p,mn=Ie?D.value():D;return Z||(Z=new Ae),N(Nn,mn,H,ft,Z)}}return fe?(Z||(Z=new Ae),dc(p,D,N,H,ft,Z)):!1}function sc(p,D,N,H){var ft=N.length,Z=ft;if(p==null)return!Z;for(p=Object(p);ft--;){var xt=N[ft];if(xt[2]?xt[1]!==p[xt[0]]:!(xt[0]in p))return!1}for(;++ft<Z;){xt=N[ft];var Zt=xt[0],Wt=p[Zt],ce=xt[1];if(xt[2]){if(Wt===void 0&&!(Zt in p))return!1}else{var we=new Ae,ve;if(!(ve===void 0?js(ce,Wt,H,r|o,we):ve))return!1}}return!0}function rc(p){if(!Kt(p)||_o(p))return!1;var D=G(p)||qt(p)?ii:K;return D.test(fn(p))}function oc(p){return xe(p)&&jt(p.length)&&!!gt[_e.call(p)]}function po(p){return typeof p=="function"?p:p==null?Hi:typeof p=="object"?w(p)?Fi(p[0],p[1]):lc(p):dC(p)}function ac(p){if(!mc(p))return Bs(p);var D=[];for(var N in Object(p))Ht.call(p,N)&&N!="constructor"&&D.push(N);return D}function lc(p){var D=hc(p);return D.length==1&&D[0][2]?qs(D[0][0],D[0][1]):function(N){return N===p||sc(N,p,D)}}function Fi(p,D){return Bi(p)&&xo(D)?qs(hn(p),D):function(N){var H=ko(N,p);return H===void 0&&H===D?So(N,p):js(D,H,void 0,r|o)}}function In(p){return function(D){return Ni(D,p)}}function yo(p){if(typeof p=="string")return p;if(ee(p))return go?go.call(p):"";var D=p+"";return D=="0"&&1/p==-1/0?"-0":D}function Xe(p){return w(p)?p:gc(p)}function cc(p){return function(D,N,H){for(var ft=-1,Z=Object(D),xt=H(D),Zt=xt.length;Zt--;){var Wt=xt[++ft];if(N(Z[Wt],Wt,Z)===!1)break}return D}}function bo(p,D,N,H,ft,Z){var xt=ft&o,Zt=p.length,Wt=D.length;if(Zt!=Wt&&!(xt&&Wt>Zt))return!1;var ce=Z.get(p);if(ce&&Z.get(D))return ce==D;var we=-1,ve=!0,fe=ft&r?new Ri:void 0;for(Z.set(p,D),Z.set(D,p);++we<Zt;){var Re=p[we],Ie=D[we];if(H)var Nn=xt?H(Ie,Re,we,D,p,Z):H(Re,Ie,we,p,D,Z);if(Nn!==void 0){if(Nn)continue;ve=!1;break}if(fe){if(!wt(D,function(mn,ci){if(!fe.has(ci)&&(Re===mn||N(Re,mn,H,ft,Z)))return fe.add(ci)})){ve=!1;break}}else if(!(Re===Ie||N(Re,Ie,H,ft,Z))){ve=!1;break}}return Z.delete(p),Z.delete(D),ve}function uc(p,D,N,H,ft,Z,xt){switch(N){case _:if(p.byteLength!=D.byteLength||p.byteOffset!=D.byteOffset)return!1;p=p.buffer,D=D.buffer;case y:return!(p.byteLength!=D.byteLength||!H(new ho(p),new ho(D)));case u:case h:case x:return wo(+p,+D);case f:return p.name==D.name&&p.message==D.message;case T:case S:return p==D+"";case b:var Zt=Ee;case v:var Wt=Z&o;if(Zt||(Zt=Xt),p.size!=D.size&&!Wt)return!1;var ce=xt.get(p);if(ce)return ce==D;Z|=r,xt.set(p,D);var we=bo(Zt(p),Zt(D),H,ft,Z,xt);return xt.delete(p),we;case E:if(Vs)return Vs.call(p)==Vs.call(D)}return!1}function dc(p,D,N,H,ft,Z){var xt=ft&o,Zt=li(p),Wt=Zt.length,ce=li(D),we=ce.length;if(Wt!=we&&!xt)return!1;for(var ve=Wt;ve--;){var fe=Zt[ve];if(!(xt?fe in D:Ht.call(D,fe)))return!1}var Re=Z.get(p);if(Re&&Z.get(D))return Re==D;var Ie=!0;Z.set(p,D),Z.set(D,p);for(var Nn=xt;++ve<Wt;){fe=Zt[ve];var mn=p[fe],ci=D[fe];if(H)var Nm=xt?H(ci,mn,fe,D,p,Z):H(mn,ci,fe,p,D,Z);if(!(Nm===void 0?mn===ci||N(mn,ci,H,ft,Z):Nm)){Ie=!1;break}Nn||(Nn=fe=="constructor")}if(Ie&&!Nn){var Do=p.constructor,To=D.constructor;Do!=To&&"constructor"in p&&"constructor"in D&&!(typeof Do=="function"&&Do instanceof Do&&typeof To=="function"&&To instanceof To)&&(Ie=!1)}return Z.delete(p),Z.delete(D),Ie}function zi(p,D){var N=p.__data__;return Us(D)?N[typeof D=="string"?"string":"hash"]:N.map}function hc(p){for(var D=li(p),N=D.length;N--;){var H=D[N],ft=p[H];D[N]=[H,ft,xo(ft)]}return D}function dn(p,D){var N=ae(p,D);return rc(N)?N:void 0}var le=ec;(ri&&le(new ri(new ArrayBuffer(1)))!=_||an&&le(new an)!=b||ln&&le(ln.resolve())!=M||Hs&&le(new Hs)!=v||Ws&&le(new Ws)!=P)&&(le=function(p){var D=_e.call(p),N=D==k?p.constructor:void 0,H=N?fn(N):void 0;if(H)switch(H){case Rl:return _;case Il:return b;case fo:return M;case mo:return v;case cn:return P}return D});function fc(p,D,N){D=Bi(D,p)?[D]:Xe(D);for(var H,ft=-1,xt=D.length;++ft<xt;){var Z=hn(D[ft]);if(!(H=p!=null&&N(p,Z)))break;p=p[Z]}if(H)return H;var xt=p?p.length:0;return!!xt&&jt(xt)&&$s(Z,xt)&&(w(p)||vo(p))}function $s(p,D){return D=D??a,!!D&&(typeof p=="number"||_t.test(p))&&p>-1&&p%1==0&&p<D}function Bi(p,D){if(w(p))return!1;var N=typeof p;return N=="number"||N=="symbol"||N=="boolean"||p==null||ee(p)?!0:J.test(p)||!U.test(p)||D!=null&&p in Object(D)}function Us(p){var D=typeof p;return D=="string"||D=="number"||D=="symbol"||D=="boolean"?p!=="__proto__":p===null}function _o(p){return!!ni&&ni in p}function mc(p){var D=p&&p.constructor,N=typeof D=="function"&&D.prototype||ie;return p===N}function xo(p){return p===p&&!Kt(p)}function qs(p,D){return function(N){return N==null?!1:N[p]===D&&(D!==void 0||p in Object(N))}}var gc=ai(function(p){p=Ln(p);var D=[];return et.test(p)&&D.push(""),p.replace(X,function(N,H,ft,Z){D.push(ft?Z.replace($,"$1"):H||N)}),D});function hn(p){if(typeof p=="string"||ee(p))return p;var D=p+"";return D=="0"&&1/p==-1/0?"-0":D}function fn(p){if(p!=null){try{return Fe.call(p)}catch{}try{return p+""}catch{}}return""}function ai(p,D){if(typeof p!="function"||D&&typeof D!="function")throw new TypeError(i);var N=function(){var H=arguments,ft=D?D.apply(this,H):H[0],Z=N.cache;if(Z.has(ft))return Z.get(ft);var xt=p.apply(this,H);return N.cache=Z.set(ft,xt),xt};return N.cache=new(ai.Cache||He),N}ai.Cache=He;function wo(p,D){return p===D||p!==p&&D!==D}function vo(p){return F(p)&&Ht.call(p,"callee")&&(!zs.call(p,"callee")||_e.call(p)==l)}var w=Array.isArray;function A(p){return p!=null&&jt(p.length)&&!G(p)}function F(p){return xe(p)&&A(p)}function G(p){var D=Kt(p)?_e.call(p):"";return D==m||D==g}function jt(p){return typeof p=="number"&&p>-1&&p%1==0&&p<=a}function Kt(p){var D=typeof p;return!!p&&(D=="object"||D=="function")}function xe(p){return!!p&&typeof p=="object"}function ee(p){return typeof p=="symbol"||xe(p)&&_e.call(p)==E}var Mo=st?te(st):oc;function Ln(p){return p==null?"":yo(p)}function ko(p,D,N){var H=p==null?void 0:Ni(p,D);return H===void 0?N:H}function So(p,D){return p!=null&&fc(p,D,nc)}function li(p){return A(p)?Ql(p):ac(p)}function Xs(p,D){var N={};return D=po(D),tc(p,function(H,ft,Z){N[D(H,ft,Z)]=H}),N}function Hi(p){return p}function dC(p){return Bi(p)?ut(hn(p)):In(p)}n.exports=Xs}(co,co.exports);var _T=co.exports;const xT=tl(_T);var wT=9007199254740991,vT="[object Arguments]",MT="[object Function]",kT="[object GeneratorFunction]",ST="[object Symbol]",DT=typeof be=="object"&&be&&be.Object===Object&&be,TT=typeof self=="object"&&self&&self.Object===Object&&self,CT=DT||TT||Function("return this")();function PT(n,t,e){switch(e.length){case 0:return n.call(t);case 1:return n.call(t,e[0]);case 2:return n.call(t,e[0],e[1]);case 3:return n.call(t,e[0],e[1],e[2])}return n.apply(t,e)}function OT(n,t){for(var e=-1,i=n?n.length:0,s=Array(i);++e<i;)s[e]=t(n[e],e,n);return s}function ET(n,t){for(var e=-1,i=t.length,s=n.length;++e<i;)n[s+e]=t[e];return n}var El=Object.prototype,AT=El.hasOwnProperty,Al=El.toString,Cm=CT.Symbol,RT=El.propertyIsEnumerable,Pm=Cm?Cm.isConcatSpreadable:void 0,Om=Math.max;function IT(n,t,e,i,s){var r=-1,o=n.length;for(e||(e=zT),s||(s=[]);++r<o;){var a=n[r];e(a)?ET(s,a):s[s.length]=a}return s}function LT(n,t){return n=Object(n),NT(n,t,function(e,i){return i in n})}function NT(n,t,e){for(var i=-1,s=t.length,r={};++i<s;){var o=t[i],a=n[o];e(a,o)&&(r[o]=a)}return r}function FT(n,t){return t=Om(t===void 0?n.length-1:t,0),function(){for(var e=arguments,i=-1,s=Om(e.length-t,0),r=Array(s);++i<s;)r[i]=e[t+i];i=-1;for(var o=Array(t+1);++i<t;)o[i]=e[i];return o[t]=r,PT(n,this,o)}}function zT(n){return WT(n)||HT(n)||!!(Pm&&n&&n[Pm])}function BT(n){if(typeof n=="string"||qT(n))return n;var t=n+"";return t=="0"&&1/n==-1/0?"-0":t}function HT(n){return YT(n)&&AT.call(n,"callee")&&(!RT.call(n,"callee")||Al.call(n)==vT)}var WT=Array.isArray;function VT(n){return n!=null&&$T(n.length)&&!jT(n)}function YT(n){return Em(n)&&VT(n)}function jT(n){var t=UT(n)?Al.call(n):"";return t==MT||t==kT}function $T(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=wT}function UT(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}function Em(n){return!!n&&typeof n=="object"}function qT(n){return typeof n=="symbol"||Em(n)&&Al.call(n)==ST}var XT=FT(function(n,t){return n==null?{}:LT(n,OT(IT(t),BT))}),GT=XT;const KT=tl(GT);var Am={exports:{}};(function(n,t){(function(e,i){i()})(be,function(){function e(c,u){return typeof u>"u"?u={autoBom:!1}:typeof u!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),u={autoBom:!u}),u.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type)?new Blob(["\uFEFF",c],{type:c.type}):c}function i(c,u,h){var f=new XMLHttpRequest;f.open("GET",c),f.responseType="blob",f.onload=function(){l(f.response,u,h)},f.onerror=function(){console.error("could not download file")},f.send()}function s(c){var u=new XMLHttpRequest;u.open("HEAD",c,!1);try{u.send()}catch{}return 200<=u.status&&299>=u.status}function r(c){try{c.dispatchEvent(new MouseEvent("click"))}catch{var u=document.createEvent("MouseEvents");u.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),c.dispatchEvent(u)}}var o=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof be=="object"&&be.global===be?be:void 0,a=o.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=o.saveAs||(typeof window!="object"||window!==o?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(c,u,h){var f=o.URL||o.webkitURL,m=document.createElement("a");u=u||c.name||"download",m.download=u,m.rel="noopener",typeof c=="string"?(m.href=c,m.origin===location.origin?r(m):s(m.href)?i(c,u,h):r(m,m.target="_blank")):(m.href=f.createObjectURL(c),setTimeout(function(){f.revokeObjectURL(m.href)},4e4),setTimeout(function(){r(m)},0))}:"msSaveOrOpenBlob"in navigator?function(c,u,h){if(u=u||c.name||"download",typeof c!="string")navigator.msSaveOrOpenBlob(e(c,h),u);else if(s(c))i(c,u,h);else{var f=document.createElement("a");f.href=c,f.target="_blank",setTimeout(function(){r(f)})}}:function(c,u,h,f){if(f=f||open("","_blank"),f&&(f.document.title=f.document.body.innerText="downloading..."),typeof c=="string")return i(c,u,h);var m=c.type==="application/octet-stream",g=/constructor/i.test(o.HTMLElement)||o.safari,b=/CriOS\/[\d]+/.test(navigator.userAgent);if((b||m&&g||a)&&typeof FileReader<"u"){var x=new FileReader;x.onloadend=function(){var T=x.result;T=b?T:T.replace(/^data:[^;]*;/,"data:attachment/file;"),f?f.location.href=T:location=T,f=null},x.readAsDataURL(c)}else{var k=o.URL||o.webkitURL,M=k.createObjectURL(c);f?f.location=M:location.href=M,f=null,setTimeout(function(){k.revokeObjectURL(M)},4e4)}});o.saveAs=l.saveAs=l,n.exports=l})})(Am);var ZT=Am.exports,Rm={exports:{}};/* @license
|
|
28
|
+
*/const xD={datetime:"MMM d, yyyy, h:mm:ss aaaa",millisecond:"h:mm:ss.SSS aaaa",second:"h:mm:ss aaaa",minute:"h:mm aaaa",hour:"ha",day:"MMM d",week:"PP",month:"MMM yyyy",quarter:"qqq - yyyy",year:"yyyy"};wu._date.override({_id:"date-fns",formats:function(){return xD},parse:function(n,t){if(n===null||typeof n>"u")return null;const e=typeof n;return e==="number"||n instanceof Date?n=dt(n):e==="string"&&(typeof t=="string"?n=ew(n,t,new Date,this.options):n=sh(n,this.options)),ka(n)?n.getTime():null},format:function(n,t){return Ir(n,t,this.options)},add:function(n,t,e){switch(e){case"millisecond":return va(n,t);case"second":return K0(n,t);case"minute":return X0(n,t);case"hour":return $0(n,t);case"day":return Ar(n,t);case"week":return Z0(n,t);case"month":return wa(n,t);case"quarter":return G0(n,t);case"year":return Q0(n,t);default:return n}},diff:function(n,t,e){switch(e){case"millisecond":return Sa(n,t);case"second":return o_(n,t);case"minute":return i_(n,t);case"hour":return n_(n,t);case"day":return Fd(n,t);case"week":return a_(n,t);case"month":return Wd(n,t);case"quarter":return r_(n,t);case"year":return l_(n,t);default:return 0}},startOf:function(n,t,e){switch(t){case"second":return rw(n);case"minute":return sw(n);case"hour":return iw(n);case"day":return Ma(n);case"week":return je(n);case"isoWeek":return je(n,{weekStartsOn:+e});case"month":return u_(n);case"quarter":return c_(n);case"year":return Vd(n);default:return n}},endOf:function(n,t){switch(t){case"second":return p_(n);case"minute":return m_(n);case"hour":return h_(n);case"day":return Bd(n);case"week":return f_(n);case"month":return Hd(n);case"quarter":return g_(n);case"year":return d_(n);default:return n}}});const bm={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},wD={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...bm,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},vD=d.version[0]==="2"?(n,t)=>Object.assign(n,{attrs:t}):(n,t)=>Object.assign(n,t);function Ei(n){return d.isProxy(n)?d.toRaw(n):n}function MD(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n;return d.isProxy(t)?new Proxy(n,{}):n}function kD(n,t){const e=n.options;e&&t&&Object.assign(e,t)}function _m(n,t){n.labels=t}function xm(n,t,e){const i=[];n.datasets=t.map(s=>{const r=n.datasets.find(o=>o[e]===s[e]);return!r||!s.data||i.includes(r)?{...s}:(i.push(r),Object.assign(r,s),r)})}function SD(n,t){const e={labels:[],datasets:[]};return _m(e,n.labels),xm(e,n.datasets,t),e}const DD=d.defineComponent({props:wD,setup(n,t){let{expose:e,slots:i}=t;const s=d.ref(null),r=d.shallowRef(null);e({chart:r});const o=()=>{if(!s.value)return;const{type:c,data:u,options:h,plugins:f,datasetIdKey:m}=n,g=SD(u,m),b=MD(g,u);r.value=new Ce(s.value,{type:c,data:b,options:{...h},plugins:f})},a=()=>{const c=d.toRaw(r.value);c&&(n.destroyDelay>0?setTimeout(()=>{c.destroy(),r.value=null},n.destroyDelay):(c.destroy(),r.value=null))},l=c=>{c.update(n.updateMode)};return d.onMounted(o),d.onUnmounted(a),d.watch([()=>n.options,()=>n.data],(c,u)=>{let[h,f]=c,[m,g]=u;const b=d.toRaw(r.value);if(!b)return;let x=!1;if(h){const k=Ei(h),M=Ei(m);k&&k!==M&&(kD(b,k),x=!0)}if(f){const k=Ei(f.labels),M=Ei(g.labels),T=Ei(f.datasets),v=Ei(g.datasets);k!==M&&(_m(b.config.data,k),x=!0),T&&T!==v&&(xm(b.config.data,T,n.datasetIdKey),x=!0)}x&&d.nextTick(()=>{l(b)})},{deep:!0}),()=>d.h("canvas",{role:"img",ariaLabel:n.ariaLabel,ariaDescribedby:n.ariaDescribedby,ref:s},[d.h("p",{},[i.default?i.default():""])])}});function Ol(n,t){return Ce.register(t),d.defineComponent({props:bm,setup(e,i){let{expose:s}=i;const r=d.shallowRef(null),o=a=>{r.value=a==null?void 0:a.chart};return s({chart:r}),()=>d.h(DD,vD({ref:o},{type:n,...e}))}})}const wm=Ol("bar",es),vm=Ol("doughnut",en),Mm=Ol("line",ns),TD={class:"chart-container"},CD=d.defineComponent({__name:"DonutChart",props:{chartData:{},tooltipTitle:{},metricUnit:{default:""},legendPosition:{default:Nt.Right},legendValues:{default:void 0},syntheticsDataKey:{default:""},datasetColors:{default:()=>sn},tooltipDimensionDisplay:{default:""},tooltipMetricDisplay:{default:""}},setup(n){const t=n,{translateUnit:e}=bt.useTranslatedUnits(),i=crypto.randomUUID(),s=crypto.randomUUID(),r=d.ref([]),o=d.useTemplateRef("chartParent"),a=d.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:t.tooltipMetricDisplay,dimensionDisplay:t.tooltipDimensionDisplay,tooltipSeries:[],left:"",top:"",units:d.toRef(t,"metricUnit"),translateUnit:e,offsetX:0,offsetY:0,width:0,height:0,chartID:s,chartType:"donut",interactionMode:"idle"}),{tooltipAbsoluteLeft:l,tooltipAbsoluteTop:c}=bt.useTooltipAbsolutePosition(o,a),u={id:i,afterUpdate(M){r.value=M.options.plugins.legend.labels.generateLabels(M).map(T=>({...T,value:t.legendValues&&t.legendValues[T.text],hidden:!1}))}},h=d.computed(()=>[u]),f=d.computed(()=>[t.chartData.datasets.reduce((T,v)=>(T.labels.push(v.label),T.backgroundColor.push(v.backgroundColor),T.borderColor.push(mh(v.backgroundColor,50)),T.data.push(v.data.reduce((S,E)=>S+E,0)),T),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),m=d.computed(()=>({...t.chartData,datasets:f.value}));bt.useReportChartDataForSynthetics(d.toRef(t,"chartData"),d.toRef(t,"syntheticsDataKey"));const{options:g}=bt.useDonutChartOptions({tooltipState:a,legendID:i}),b=d.ref(),x=M=>({[Nt.Right]:"legend-row",[Nt.Bottom]:"column",[Nt.Hidden]:"hidden"})[M],k=({width:M,height:T})=>{a.width=M,a.height=T};return(M,T)=>(d.openBlock(),d.createElementBlock("div",{ref:"chartParent",class:d.normalizeClass(["chart-parent",x(M.legendPosition)]),"data-testid":"donut-chart-parent"},[d.createElementVNode("div",TD,[d.createVNode(d.unref(vm),{ref_key:"chartInstance",ref:b,"chart-id":d.unref(s),data:m.value,options:d.unref(g),plugins:h.value},null,8,["chart-id","data","options","plugins"]),(d.openBlock(),d.createBlock(d.Teleport,{to:"body"},[d.createVNode(ao,{"absolute-left":d.unref(l),"absolute-top":d.unref(c),state:a,"tooltip-title":M.tooltipTitle,unit:M.metricUnit,onDimensions:k},null,8,["absolute-left","absolute-top","state","tooltip-title","unit"])]))]),d.createVNode(Cl,{id:d.unref(i),"chart-instance":b.value,items:r.value,position:M.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),PD=Se(CD,[["__scopeId","data-v-f3942f91"]]),km=(n,t,e,i)=>{n.save(),n.beginPath(),n.moveTo(t,e),n.lineTo(t,i),n.lineWidth=1,n.strokeStyle="#0275d8",n.stroke(),n.restore()};class Sm{constructor(){O(this,"id","verticalLinePlugin");O(this,"_clickedSegment");O(this,"_pause",!1)}afterDatasetsDraw(t){if(!this._pause&&t.tooltip&&t.tooltip.getActiveElements()&&t.tooltip.getActiveElements().length&&!this.clickedSegment){const{x:e}=t.tooltip.dataPoints[0].element,i=t.ctx;km(i,e,t.scales.y.top,t.scales.y.bottom)}if(!this._pause&&this._clickedSegment){const{x:e}=this._clickedSegment.element,i=t.ctx;km(i,e,t.scales.y.top,t.scales.y.bottom)}}pause(){this._pause=!0}resume(){this._pause=!1}get isPaused(){return this._pause}set clickedSegment(t){this._clickedSegment=t}get clickedSegment(){return this._clickedSegment}destroyClickedSegment(){delete this._clickedSegment}beforeDestroy(){this._clickedSegment&&this.destroyClickedSegment()}}const OD=(n,t,e)=>{const i=n.ctx;i.save(),i.strokeStyle="rgba(95, 154, 255, 1)",i.lineWidth=2,i.beginPath(),i.moveTo(t,n.chartArea.top),i.lineTo(t,n.chartArea.bottom),i.moveTo(e,n.chartArea.top),i.lineTo(e,n.chartArea.bottom),i.stroke(),i.restore()},ED=(n,t,e)=>{const i=n.ctx;i.save(),i.fillStyle="rgba(143, 193, 255, 0.3)",i.fillRect(t,n.chartArea.top,e-t,n.chartArea.bottom-n.chartArea.top),i.restore()},Dm=(n,t,e)=>{const i=t.scales.x.getValueForPixel(e.startX),s=t.scales.x.getValueForPixel(e.endX);i&&s&&t.canvas.dispatchEvent(new CustomEvent(n,{detail:{xStart:Math.min(i,s),xEnd:Math.max(i,s)}}))};class AD{constructor(){O(this,"id","dragSelectPlugin");O(this,"_isDragging",!1);O(this,"_startX",0);O(this,"_endX",0);O(this,"_dragTimeout");O(this,"_clearSelectionArea",!0);O(this,"_chart",null);O(this,"_dragSelectHandlers")}get startX(){return this._startX}get endX(){return this._endX}beforeInit(t){this._chart=t;const e=t.canvas;let i=!1;const s=a=>{this._dragTimeout=window.setTimeout(()=>{const l=e.getBoundingClientRect();this._isDragging=!0,this._clearSelectionArea=!1,i=!0,this._startX=a.clientX-l.left},150)},r=a=>{const l=e.getBoundingClientRect();i&&this._isDragging&&(this._endX=a.clientX-l.left,Dm("dragSelectMove",t,this))},o=a=>{const l=e.getBoundingClientRect();clearTimeout(this._dragTimeout),i&&this._isDragging&&(this._endX=a.clientX-l.left,Dm("dragSelect",t,this),i=!1,this._isDragging=!1)};e.addEventListener("mousedown",s),e.addEventListener("mousemove",r),e.addEventListener("mouseup",o),this._dragSelectHandlers={onMouseDown:s,onMouseMove:r,onMouseUp:o}}beforeDestroy(t){const e=t.canvas;if(this._dragSelectHandlers){const{onMouseDown:i,onMouseMove:s,onMouseUp:r}=this._dragSelectHandlers;e.removeEventListener("mousedown",i),e.removeEventListener("mousemove",s),e.removeEventListener("mouseup",r)}this._isDragging=!1,this._dragTimeout&&clearTimeout(this._dragTimeout)}afterDatasetsDraw(t){(this._isDragging||!this._clearSelectionArea)&&(ED(t,this._startX,this._endX),OD(t,this._startX,this._endX))}clearSelectionArea(){this._clearSelectionArea=!0,this._chart&&this._chart.update()}}const RD=["hidden","single","full"];var ei=(n=>(n.String="string",n.Number="number",n.Boolean="boolean",n.Object="object",n.Undefined="undefined",n))(ei||{});const ID=["donut","horizontal_bar","vertical_bar","timeseries_line","timeseries_bar"],LD=["gauge","top_n","single_value"],ND=20,FD="rgba(255, 171, 171, 0.4)",zD="rgba(255, 196, 0, 0.2)",Tm=(n,t,e)=>{const i=t.y-n.y;if(i===0)return t.x;const s=(e-n.y)/i;return n.x+s*(t.x-n.x)},BD=(n,t)=>{const e=[];return n.data.datasets.forEach(i=>{if(!n.getDatasetMeta(n.data.datasets.indexOf(i)).visible)return;const r=i.data;r!=null&&r.length&&t.filter(o=>o.highlightIntersections).forEach(o=>{const a=r.map(c=>({ts:c.x,aboveThreshold:c.y>=o.value}));let l=a[0].aboveThreshold?r[0].x:void 0;for(let c=1;c<a.length;c++)!a[c-1].aboveThreshold&&a[c].aboveThreshold?l=Tm(r[c-1],r[c],o.value):a[c-1].aboveThreshold&&!a[c].aboveThreshold&&l!==void 0&&(e.push({start:l,end:Tm(r[c-1],r[c],o.value),type:o.type}),l=void 0);l!==void 0&&e.push({start:l,end:a[a.length-1].ts,type:o.type})})}),e},HD=n=>{if(!n.length)return[];n.sort((e,i)=>e.type.localeCompare(i.type)||e.start-i.start);const t=[];for(const e of n){const i=t.findLast(({type:s})=>s===e.type);i&&e.start<=i.end?i.end=Math.max(i.end,e.end):t.push({...e})}return t};class WD{constructor(t){O(this,"id","thresholdPlugin");O(this,"_thresholds");O(this,"_mouseMoveHandler");this.i18n=t}_syncThresholds(t){var e,i;for(const s of Object.keys(t.threshold||{})){const r=(e=t.threshold)==null?void 0:e[s];r&&(this._thresholds={...this._thresholds,[s]:r.map(o=>({...o,hovered:!1}))})}if(this._thresholds)for(const s of Object.keys(this._thresholds))(i=t.threshold)!=null&&i[s]||delete this._thresholds[s]}get thresholds(){return this._thresholds}beforeUpdate(t,e,i){this._syncThresholds(i)}beforeInit(t,e,i){const s=t.canvas;this._syncThresholds(i);const r=o=>{var a;if(t){const l=o.clientY,c=t.scales.y,u=s.getBoundingClientRect(),h=c.getValueForPixel(l-u.top);if(h)for(const f of Object.keys(this._thresholds||{})){const m=(a=this._thresholds)==null?void 0:a[f];m&&m.forEach(g=>{g.hovered=Math.abs(g.value-h)<ND})}}};s.addEventListener("mousemove",r),this._mouseMoveHandler=r}afterDatasetsDraw(t,e){var s;const i=t.ctx;for(const r of Object.keys(this._thresholds||{})){const o=(s=this._thresholds)==null?void 0:s[r];if(o){o.forEach(c=>{const h=t.scales.y.getPixelForValue(c.value);i.save(),i.beginPath(),i.moveTo(t.chartArea.left,h),i.lineTo(t.chartArea.right,h),i.lineWidth=1,i.strokeStyle=Hr(c.type),i.setLineDash([5,5]),i.stroke(),i.restore();let f="";c.label?f=`${c.label}: ${c.value}`:c.type==="warning"?f=this.i18n.t("chartLabels.threshold-warning",{value:c.value}):c.type==="error"?f=this.i18n.t("chartLabels.threshold-error",{value:c.value}):f=this.i18n.t("chartLabels.thatreshold-neutral",{value:c.value}),c.hovered&&(i.save(),i.fillStyle=Hr(c.type),i.font=Rw,i.fillText(f,t.chartArea.left,h-4),i.restore())});const a=BD(t,o);HD(a).forEach(c=>{const u=t.scales.x.getPixelForValue(c.start),h=t.scales.x.getPixelForValue(c.end);i.save(),i.fillStyle=c.type==="error"?FD:zD,i.fillRect(u,t.chartArea.top,h-u,t.chartArea.bottom-t.chartArea.top),i.restore(),i.save(),i.beginPath(),i.moveTo(u,t.chartArea.bottom),i.lineTo(h,t.chartArea.bottom),i.lineWidth=2,i.strokeStyle=Hr(c.type),i.stroke(),i.restore()})}}}beforeDestroy(t){this._mouseMoveHandler&&t.canvas.removeEventListener("mousemove",this._mouseMoveHandler)}}const VD=Se(d.defineComponent({__name:"TimeSeriesChart",props:{chartData:{default:void 0},type:{default:"timeseries_line"},fill:{type:Boolean,default:!1},tooltipTitle:{},metricUnit:{default:""},timeRangeMs:{default:void 0},granularity:{},stacked:{type:Boolean,default:!0},legendValues:{default:void 0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,default:(n,t)=>t.rawValue-n.rawValue},brush:{type:Boolean,default:!1},zoomActionItems:{default:void 0},tooltipMetricDisplay:{default:""},threshold:{default:void 0}},emits:["zoom-time-range","select-chart-range"],setup(n,{emit:t}){const e=n,i=t,{i18n:s}=bt.useI18n(),r=new Sm,o=new gm,a=new AD,l=new WD(s),{translateUnit:c}=bt.useTranslatedUnits(),u=d.ref(),h=crypto.randomUUID(),f=crypto.randomUUID(),m=d.ref([]),g=d.ref(),b=d.inject("legendPosition",Nt.Right),x=d.useTemplateRef("chartParent"),k=d.ref(void 0),M=d.ref(!1),T=d.inject(yf),v=T==null?void 0:T.evaluateFeatureFlagFn("analytics-chart-zoom-actions",!1),S=d.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:e.tooltipMetricDisplay,tooltipSeries:[],left:"",top:"",units:e.metricUnit,translateUnit:c,offsetX:0,offsetY:0,width:0,height:0,chartType:e.type,chartID:f,chartTooltipSortFn:e.chartTooltipSortFn,interactionMode:"idle"}),{tooltipAbsoluteLeft:E,tooltipAbsoluteTop:P}=bt.useTooltipAbsolutePosition(x,S),y={id:h,afterUpdate($){m.value=lh($,e.legendValues,e.chartLegendSortFn)}},_=d.computed(()=>[y,o,...e.brush?[a]:[],...e.type==="timeseries_line"?[r]:[],...e.threshold?[l]:[]]),C=d.computed(()=>`line-${_.value.map($=>$.id).join("-")}`),R=d.computed(()=>`bar-${_.value.map($=>$.id).join("-")}`),L=d.computed(()=>e.chartData&&Sw(e.chartData)),I=d.computed(()=>v?!1:M.value),{options:B}=bt.useLineChartOptions({tooltipState:S,timeRangeMs:d.toRef(e,"timeRangeMs"),granularity:d.toRef(e,"granularity"),legendID:h,stacked:d.toRef(e,"stacked"),metricAxesTitle:d.toRef(e,"metricAxesTitle"),dimensionAxesTitle:d.toRef(e,"dimensionAxesTitle"),pointsWithoutHover:L,threshold:d.toRef(e,"threshold")});bt.useReportChartDataForSynthetics(d.toRef(e,"chartData"),d.toRef(e,"syntheticsDataKey"));const q=$=>({[Nt.Right]:"legend-row",[Nt.Bottom]:"column",[Nt.Hidden]:"hidden"})[$],tt=({width:$,height:K})=>{S.width=$,S.height=K},V=($=!0)=>{S.interactionMode="idle",S.showTooltip=!1,a.clearSelectionArea(),o.isPaused&&o.resume($),r.isPaused&&r.resume()},ct=()=>{S.interactionMode="interactive"},U=()=>{var $,K;!u.value||!((K=($=u.value.chart.tooltip)==null?void 0:$.dataPoints)!=null&&K.length)||(S.interactionMode==="interactive"?r.clickedSegment=u.value.chart.tooltip.dataPoints[0]:r.destroyClickedSegment())},J=()=>{if(M.value){M.value=!1;return}S.interactionMode!=="idle"?V():ct(),U()};d.watch(()=>e.type,()=>{S.interactionMode="idle",S.showTooltip=!1,r.destroyClickedSegment()});const et=$=>{$.preventDefault(),$.stopPropagation();const{xStart:K,xEnd:_t}=$.detail;K&&_t&&(k.value={start:new Date(K),end:new Date(_t),type:"absolute"},v?S.interactionMode="zoom-interactive":(i("zoom-time-range",{start:new Date(K),end:new Date(_t),type:"absolute"}),V()),i("select-chart-range",k.value))},X=$=>{v&&(S.interactionMode="selecting-chart-area"),M.value=!0,r.pause(),o.pause();const{xStart:K,xEnd:_t}=$.detail;K&&_t&&(k.value={start:new Date(K),end:new Date(_t),type:"absolute"})},j=$=>{if(!x.value||S.interactionMode==="idle")return;const K=$.target;K&&x.value.contains(K)||M.value||V(!1)};return d.watch(()=>{var $;return($=u.value)==null?void 0:$.chart},()=>{var $;($=u.value)!=null&&$.chart&&(u.value.chart.canvas.removeEventListener("dragSelect",et),u.value.chart.canvas.removeEventListener("dragSelectMove",X),u.value.chart.canvas.addEventListener("dragSelect",et),u.value.chart.canvas.addEventListener("dragSelectMove",X))}),d.onMounted(()=>{document.addEventListener("click",j,!0)}),d.onUnmounted(()=>{var $;($=u.value)!=null&&$.chart&&(u.value.chart.canvas.removeEventListener("dragSelect",et),u.value.chart.canvas.removeEventListener("dragSelectMove",X)),document.removeEventListener("click",j,!0)}),($,K)=>(d.openBlock(),d.createElementBlock("div",{ref:"chartParent",class:d.normalizeClass(["chart-parent",q(d.unref(b))]),"data-testid":"line-chart-parent"},[d.createElementVNode("div",{class:"chart-container",onClick:K[0]||(K[0]=_t=>J())},[$.type==="timeseries_line"?(d.openBlock(),d.createBlock(d.unref(Mm),{key:C.value,ref_key:"chartInstance",ref:u,"chart-id":d.unref(f),class:"chart-canvas",data:$.chartData,"data-testid":"time-series-line-chart",options:d.unref(B),plugins:_.value},null,8,["chart-id","data","options","plugins"])):$.type==="timeseries_bar"?(d.openBlock(),d.createBlock(d.unref(wm),{key:R.value,ref_key:"chartInstance",ref:u,"chart-id":d.unref(f),class:"chart-canvas",data:$.chartData,"data-testid":"time-series-bar-chart",options:d.unref(B),plugins:_.value},null,8,["chart-id","data","options","plugins"])):d.createCommentVNode("",!0)]),I.value?d.createCommentVNode("",!0):(d.openBlock(),d.createBlock(ao,{key:0,ref_key:"tooltipElement",ref:g,"absolute-left":d.unref(E),"absolute-top":d.unref(P),"data-testid":"tooltip",granularity:$.granularity,state:S,"tooltip-title":$.tooltipTitle,"zoom-action-items":$.zoomActionItems,"zoom-time-range":k.value,onDimensions:tt,onOnAction:K[1]||(K[1]=()=>V(!1))},null,8,["absolute-left","absolute-top","granularity","state","tooltip-title","zoom-action-items","zoom-time-range"])),d.createVNode(Cl,{id:d.unref(h),"chart-instance":u.value,"data-testid":"legend",items:m.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-3a82636b"]]),YD={class:"analytics-chart-shell"},jD={key:0,class:"chart-header"},$D={class:"tooltip-content"},UD={key:2,class:"analytics-chart-parent"},qD=d.defineComponent({__name:"AnalyticsChart",props:{chartData:{},chartOptions:{},tooltipTitle:{default:""},emptyStateTitle:{default:""},emptyStateDescription:{default:""},legendPosition:{default:Nt.Right},syntheticsDataKey:{default:""},showLegendValues:{type:Boolean,default:!0},showAnnotations:{type:Boolean,default:!0},timeseriesZoom:{type:Boolean,default:!1},requestsLink:{default:void 0},exploreLink:{default:void 0}},emits:["zoom-time-range","select-chart-range"],setup(n,{emit:t}){const e=t,i=n,{i18n:s}=bt.useI18n(),r=d.computed(()=>b.value?bt.useExploreResultToTimeDataset({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Wr},d.toRef(i,"chartData")).value:bt.useExploreResultToDatasets({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Wr},d.toRef(i,"chartData")).value),o=d.computed(()=>i.timeseriesZoom||!!i.exploreLink||!!i.requestsLink),a=d.computed(()=>{var I;return(I=i.chartData)!=null&&I.meta?"start_ms"in i.chartData.meta?i.chartData.meta.end_ms-i.chartData.meta.start_ms:void 0:0}),l=d.computed(()=>{var I;return(I=i.chartData.meta)!=null&&I.metric_units?Object.values(i.chartData.meta.metric_units)[0]:""}),c=d.computed(()=>i.showLegendValues&&i.legendPosition!==Nt.Bottom),{legendValues:u}=bt.useChartLegendValues(r,i.chartOptions.type,l),h=d.computed(()=>{var I,B,q;return((q=(B=(I=i.chartData)==null?void 0:I.meta)==null?void 0:B.limit)==null?void 0:q.toString())||null}),f=d.computed(()=>{var I,B;return((B=(I=i.chartData)==null?void 0:I.meta)==null?void 0:B.truncated)||!1}),m=s.t("limitedResultsShown",{maxReturned:h.value}),g=d.computed(()=>["vertical_bar","horizontal_bar"].includes(i.chartOptions.type)),b=d.computed(()=>["timeseries_bar","timeseries_line"].some(I=>I===i.chartOptions.type)),x=d.computed(()=>i.chartOptions.type==="donut"),k=d.computed(()=>i.chartOptions.type.includes("vertical")?"vertical":"horizontal"),M=d.computed(()=>{var q,tt;if(!((q=i.chartData)!=null&&q.meta.metric_names)||!((tt=i.chartData)!=null&&tt.meta.metric_units))return;const I=i.chartData.meta.metric_names[0],B=i.chartData.meta.metric_units[I];if(i.chartData.meta.metric_names.length>1){if(I.includes("latency"))return s.t("metricAxisTitles.latency_in",{unit:s.t(`chartUnits.${B}`,{plural:"s"})});if(I.includes("size"))return s.t("metricAxisTitles.size_in",{unit:s.t(`chartUnits.${B}`,{plural:"s"})})}if(I)return s.te(`chartLabels.${I}`)?s.t(`chartLabels.${I}`):I}),T=d.computed(()=>{var q,tt,V,ct;if((q=i.chartOptions)!=null&&q.metricAxesTitle)return(tt=i.chartOptions)==null?void 0:tt.metricAxesTitle;if(!((V=i.chartData)!=null&&V.meta.metric_names)||!((ct=i.chartData)!=null&&ct.meta.metric_units))return;const I=i.chartData.meta.metric_names[0],B=i.chartData.meta.metric_units[I];if(i.chartData.meta.metric_names.length>1){if(I.includes("latency"))return s.t("metricAxisTitles.latency_in",{unit:s.t(`chartUnits.${B}`,{plural:"s"})});if(I.includes("size"))return s.t("metricAxisTitles.size_in",{unit:s.t(`chartUnits.${B}`,{plural:"s"})})}return s.te(`metricAxisTitles.${I}`)&&s.te(`chartUnits.${B}`)?s.t(`metricAxisTitles.${I}`,{unit:s.t(`chartUnits.${B}`,{plural:"s"})})||void 0:I||void 0}),v=d.computed(()=>{var B;if((B=i.chartOptions)!=null&&B.dimensionAxesTitle)return i.chartOptions.dimensionAxesTitle;const I=b.value?"Time":Object.keys(i.chartData.meta.display||i.chartData.meta.metric_names)[0];if(I)return s.te(`chartLabels.${I}`)?s.t(`chartLabels.${I}`):I}),S=d.computed(()=>{const I=ul(Number(i.chartData.meta.granularity_ms));if(I)return s.te(`granularityAxisTitles.${I}`)?s.t(`granularityAxisTitles.${I}`):I}),E=d.computed(()=>i.emptyStateTitle||s.t("noDataAvailableTitle")),P=d.computed(()=>i.emptyStateDescription||s.t("noDataAvailableDescription")),y=d.computed(()=>b.value?Dw(r.value):i.chartData&&i.chartData.meta&&i.chartData.data.length),_=d.computed(()=>i.chartData.meta.granularity_ms?ul(i.chartData.meta.granularity_ms)||"hourly":ul(new Date(i.chartData.data[1].timestamp).getTime()-new Date(i.chartData.data[0].timestamp).getTime())||"hourly"),C=d.computed(()=>i.chartOptions.chartLegendSortFn?i.chartOptions.chartLegendSortFn:(I,B)=>I.text===s.t("chartLabels.____OTHER____")?1:B.text===s.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(I.text,10))&&!isNaN(parseInt(B.text,10))?I.text<B.text?-1:1:I.value&&B.value?B.value.raw-I.value.raw:0),R=d.computed(()=>i.chartOptions.chartTooltipSortFn?i.chartOptions.chartTooltipSortFn:(I,B)=>I.label===s.t("chartLabels.____OTHER____")?1:B.label===s.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(I.label,10))&&!isNaN(parseInt(B.label,10))?I.label<B.label?-1:1:I.value&&B.value?B.rawValue-I.rawValue:0),L=d.computed(()=>[...i.timeseriesZoom?[{label:s.t("zoom_action_items.zoom"),key:"zoom-in",action:I=>e("zoom-time-range",I)}]:[],...i.exploreLink?[{label:s.t("zoom_action_items.explore"),key:"explore",href:i.exploreLink.href}]:[],...i.requestsLink?[{label:s.t("zoom_action_items.view_requests"),key:"view-requests",href:i.requestsLink.href}]:[]]);return d.provide("showLegendValues",c),d.provide("legendPosition",d.toRef(i,"legendPosition")),(I,B)=>{const q=d.resolveComponent("KTooltip"),tt=d.resolveComponent("KEmptyState");return d.openBlock(),d.createElementBlock("div",YD,[y.value&&f.value&&h.value?(d.openBlock(),d.createElementBlock("div",jD,[d.createVNode(q,{class:"tooltip","max-width":"500",placement:"right"},{content:d.withCtx(()=>[d.createElementVNode("div",$D,d.toDisplayString(d.unref(m)),1)]),default:d.withCtx(()=>[d.createVNode(d.unref(Gs.WarningIcon),{color:`var(--kui-color-text-warning, ${d.unref(Ow)})`,size:d.unref(Aw)},null,8,["color","size"])]),_:1})])):d.createCommentVNode("",!0),y.value?(d.openBlock(),d.createElementBlock("div",UD,[b.value?(d.openBlock(),d.createBlock(VD,{key:0,brush:o.value,"chart-data":r.value,"chart-legend-sort-fn":C.value,"chart-tooltip-sort-fn":R.value,"dimension-axes-title":S.value,fill:I.chartOptions.stacked,granularity:_.value,"legend-values":d.unref(u),"metric-axes-title":T.value,"metric-unit":l.value,stacked:I.chartOptions.stacked,"synthetics-data-key":I.syntheticsDataKey,threshold:I.chartOptions.threshold,"time-range-ms":a.value,"tooltip-metric-display":M.value,"tooltip-title":I.tooltipTitle,type:I.chartOptions.type,"zoom-action-items":L.value,onSelectChartRange:B[0]||(B[0]=V=>e("select-chart-range",V)),onZoomTimeRange:B[1]||(B[1]=V=>e("zoom-time-range",V))},null,8,["brush","chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","fill","granularity","legend-values","metric-axes-title","metric-unit","stacked","synthetics-data-key","threshold","time-range-ms","tooltip-metric-display","tooltip-title","type","zoom-action-items"])):g.value?(d.openBlock(),d.createBlock(_D,{key:1,annotations:I.showAnnotations,"chart-data":r.value,"chart-legend-sort-fn":C.value,"chart-tooltip-sort-fn":R.value,"data-testid":"bar-chart-container","dimension-axes-title":v.value,"legend-values":d.unref(u),"metric-axes-title":T.value,"metric-unit":l.value,orientation:k.value,stacked:I.chartOptions.stacked,"synthetics-data-key":I.syntheticsDataKey,"tooltip-metric-display":M.value,"tooltip-title":I.tooltipTitle},null,8,["annotations","chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","legend-values","metric-axes-title","metric-unit","orientation","stacked","synthetics-data-key","tooltip-metric-display","tooltip-title"])):x.value?(d.openBlock(),d.createBlock(PD,{key:2,"chart-data":r.value,"dataset-colors":I.chartOptions.chartDatasetColors||d.unref(Wr),"legend-position":I.legendPosition,"legend-values":d.unref(u),"metric-unit":l.value,"synthetics-data-key":I.syntheticsDataKey,"tooltip-dimension-display":v.value,"tooltip-metric-display":M.value,"tooltip-title":I.tooltipTitle},null,8,["chart-data","dataset-colors","legend-position","legend-values","metric-unit","synthetics-data-key","tooltip-dimension-display","tooltip-metric-display","tooltip-title"])):d.createCommentVNode("",!0)])):(d.openBlock(),d.createBlock(tt,{key:1,"action-button-visible":!1,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(E.value),1)]),default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(P.value),1)]),_:1}))])}}}),XD=Se(qD,[["__scopeId","data-v-01aae525"]]),GD={class:"chart-parent","data-testid":"gauge-chart-parent"},KD={class:"chart-totals-flex"},ZD={key:1,class:"metric-small","data-testid":"gauge-chart-total"},QD=Se(d.defineComponent({__name:"GaugeChart",props:{chartData:{type:Object,required:!1,default:null},metricDisplay:{type:String,required:!1,default:"hidden"},numerator:{type:Number,required:!1,default:0},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:sn},height:{type:String,required:!1,default:"400px",validator:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)}},setup(n){const t=n,{i18n:e}=bt.useI18n(),i=d.ref(lo()),s=d.computed(()=>[t.chartData.datasets.reduce((g,b)=>(g.labels.push(b.label),g.borderColor.push(b.backgroundColor),g.backgroundColor.push(b.backgroundColor),g.data.push(b.data.reduce((x,k)=>x+k,0)),g),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),r=d.computed(()=>({...t.chartData,datasets:s.value}));bt.useReportChartDataForSynthetics(d.toRef(t,"chartData"),d.toRef(t,"syntheticsDataKey"));const o={responsive:!0,maintainAspectRatio:!0,cutout:"78%",circumference:"200",rotation:"260",plugins:{legend:{display:!1}}},a=d.ref(),l=d.computed(()=>{var m;return Ss((m=s==null?void 0:s.value[0])==null?void 0:m.data[t.numerator],{capital:!0})}),c=d.computed(()=>{var m,g;return Ss(((m=s==null?void 0:s.value[0])==null?void 0:m.data[0])+((g=s==null?void 0:s.value[0])==null?void 0:g.data[1]),{capital:!0})}),u=d.computed(()=>{var m;return`color: ${(m=s==null?void 0:s.value[0])==null?void 0:m.backgroundColor[t.numerator]}`}),h=d.computed(()=>["full","single"].includes(t.metricDisplay)),f=d.computed(()=>t.metricDisplay==="full");return(m,g)=>(d.openBlock(),d.createElementBlock("div",GD,[d.createElementVNode("div",KD,[h.value?(d.openBlock(),d.createElementBlock("div",{key:0,class:"metric-large","data-testid":"gauge-chart-metric",style:d.normalizeStyle(u.value)},d.toDisplayString(l.value),5)):d.createCommentVNode("",!0),f.value?(d.openBlock(),d.createElementBlock("div",ZD,d.toDisplayString(d.unref(e).t("total"))+": "+d.toDisplayString(c.value),1)):d.createCommentVNode("",!0)]),d.createElementVNode("div",{class:"chart-container",style:d.normalizeStyle({height:n.height,width:n.width})},[d.createVNode(d.unref(vm),{ref_key:"chartInstance",ref:a,"chart-id":i.value,data:r.value,options:o},null,8,["chart-id","data","options"])],4)]))}}),[["__scopeId","data-v-32e7f9e0"]]),JD={class:"chart-parent","data-testid":"single-value-parent"},tT={key:1,class:"single-value-wrapper"},eT={class:"single-value","data-testid":"single-value-chart"},nT={key:0,class:"single-value-unit"},iT=Se(d.defineComponent({__name:"SingleValue",props:{data:{type:Object,required:!0},decimalPoints:{type:Number,default:bf}},setup(n){const{i18n:{t}}=bt.useI18n(),e=n,i=d.computed(()=>e.data.data[0]),s=d.computed(()=>{var c,u;return(u=(c=e.data.meta)==null?void 0:c.metric_names)==null?void 0:u[0]}),r=d.computed(()=>{var u,h;const c=s.value?(h=(u=e.data.meta)==null?void 0:u.metric_units)==null?void 0:h[s.value]:void 0;if(c)return t(`chartUnits.${c}`,{plural:""})}),o=d.computed(()=>{var c;return s.value==="request_per_minute"||!!((c=s.value)!=null&&c.includes("_latency_"))}),a=d.computed(()=>!i.value||!s.value||typeof i.value.event[s.value]!="number"?null:i.value.event[s.value]),l=d.computed(()=>{var h;const c=a.value;if(c===null)return"";if((h=s.value)!=null&&h.includes("_size_"))return Yr(c);if(c>=1e9){const f=(c/1e9).toFixed(1);return f.endsWith(".0")?`${Math.floor(c/1e9)}B`:`${f}B`}if(c>=1e7){const f=(c/1e6).toFixed(1);return f.endsWith(".0")?`${Math.floor(c/1e6)}M`:`${f}M`}const u=e.decimalPoints&&typeof e.decimalPoints=="number"?e.decimalPoints:bf;return c.toLocaleString("en-US",{maximumFractionDigits:u})});return d.onMounted(()=>{var c,u;((u=(c=e.data)==null?void 0:c.data)==null?void 0:u.length)>1&&console.warn("SingleValue chart should only be used with a single data point. Data length:",e.data.data.length)}),(c,u)=>{const h=d.resolveComponent("KEmptyState");return d.openBlock(),d.createElementBlock("div",JD,[a.value===null?(d.openBlock(),d.createBlock(h,{key:0,class:"single-value-error","data-testid":"single-value-error","icon-variant":"error",title:d.unref(t)("singleValue.valueError")},null,8,["title"])):(d.openBlock(),d.createElementBlock("div",tT,[d.createElementVNode("span",eT,d.toDisplayString(l.value),1),o.value?(d.openBlock(),d.createElementBlock("span",nT," "+d.toDisplayString(r.value),1)):d.createCommentVNode("",!0)]))])}}}),[["__scopeId","data-v-c25764ee"]]),sT={class:"simple-chart-shell"},rT={key:1,class:"analytics-chart-parent"},oT=Se(d.defineComponent({__name:"SimpleChart",props:{chartData:{type:Object,required:!0},chartOptions:{type:Object,required:!0},emptyStateTitle:{type:String,required:!1,default:""},syntheticsDataKey:{type:String,required:!1,default:""},height:{type:String,required:!1,default:"400px",validator:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)}},setup(n){const t=n,{i18n:e}=bt.useI18n(),i=d.computed(()=>{var u;const c=bt.useExploreResultToDatasets({colorPalette:t.chartOptions.chartDatasetColors||sn},d.toRef(t,"chartData")).value;return(u=t.chartOptions)!=null&&u.reverseDataset&&(c==null||c.datasets.reverse()),c}),s=d.computed(()=>{var c;return(c=t.chartData.meta)!=null&&c.metric_units?Object.values(t.chartData.meta.metric_units)[0]:""}),r=d.computed(()=>t.chartOptions.type==="gauge"),o=d.computed(()=>t.chartOptions.type==="single_value"),a=d.computed(()=>t.emptyStateTitle||e.t("noDataAvailableTitle")),l=d.computed(()=>{var u,h;const c=t.chartData&&t.chartData.meta&&t.chartData.data.length;if(o.value){const f=(h=(u=t.chartData.meta)==null?void 0:u.metric_names)==null?void 0:h[0];return c&&t.chartData.data[0].event[f]!==null}return c});return(c,u)=>{const h=d.resolveComponent("KEmptyState");return d.openBlock(),d.createElementBlock("div",sT,[l.value?(d.openBlock(),d.createElementBlock("div",rT,[r.value?(d.openBlock(),d.createBlock(QD,{key:0,"chart-data":i.value,"dataset-colors":n.chartOptions.chartDatasetColors,"is-simple":"","metric-display":n.chartOptions.metricDisplay,"metric-unit":s.value,numerator:n.chartOptions.numerator,"synthetics-data-key":n.syntheticsDataKey,width:n.width},null,8,["chart-data","dataset-colors","metric-display","metric-unit","numerator","synthetics-data-key","width"])):d.createCommentVNode("",!0),o.value?(d.openBlock(),d.createBlock(iT,{key:1,data:n.chartData,"decimal-points":n.chartOptions.decimalPoints},null,8,["data","decimal-points"])):d.createCommentVNode("",!0)])):(d.openBlock(),d.createBlock(h,{key:0,"action-button-visible":!0,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(a.value),1)]),_:1}))])}}}),[["__scopeId","data-v-471652c8"]]),aT={class:"top-n-card-title","data-testid":"top-n-card-title"},lT={class:"top-n-card-description","data-testid":"top-n-card-description"},cT={key:3,class:"top-n-table","data-testid":"top-n-table"},uT={class:"table-headings"},dT={class:"table-row"},hT={class:"column-1"},fT={class:"column-2"},mT={class:"table-body","data-testid":"top-n-data"},gT=["data-testid"],pT={class:"column-1"},yT={class:"column-2"},bT=Se(d.defineComponent({__name:"TopNTable",props:{title:{default:""},description:{default:""},data:{},emptyStateTitle:{default:""},isLoading:{type:Boolean,default:!1},titleTag:{default:"h2"}},setup(n){const t=n,{i18n:e}=bt.useI18n(),i=d.computed(()=>t.data.data),s=d.computed(()=>{var g;return!!((g=i.value)!=null&&g.length)}),r=d.computed(()=>{var g,b;return(g=t.data.meta)!=null&&g.display&&((b=Object.keys(t.data.meta.display))==null?void 0:b[0])||""}),o=d.computed(()=>r.value?t.data.meta.display[r.value]:{}),a=d.computed(()=>{var g,b;return(b=(g=t.data.meta)==null?void 0:g.metric_names)!=null&&b.length?t.data.meta.metric_names[0]:""}),l=d.computed(()=>a.value?e.t(`chartLabels.${a.value}`)||a.value:""),c=d.computed(()=>{if(!s.value)return"";if(t.data.meta){if(o.value&&!Object.keys(o.value).length)return e.t("topNTable.errors.display");if(!a.value)return e.t("topNTable.errors.metricNames")}else return e.t("topNTable.errors.meta");return""}),u=g=>{const b=g.event;return String(b[r.value])},h=g=>{const b=u(g),x=o.value&&o.value[b];return x?x.name:"-"},f=g=>{const b=u(g),x=o.value&&o.value[b];return x?!!x.deleted:!1},m=g=>{if(!a.value)return"–";const x=g.event[a.value];return x?Ss(x,{capital:!0,round:!0}):"–"};return(g,b)=>{const x=d.resolveComponent("KEmptyState"),k=d.resolveComponent("KSkeleton"),M=d.resolveComponent("KCard");return d.openBlock(),d.createBlock(M,{class:"kong-ui-public-top-n-table","title-tag":g.titleTag},d.createSlots({default:d.withCtx(()=>[c.value?(d.openBlock(),d.createBlock(x,{key:0,"action-button-visible":!1,"data-testid":"top-n-error-state","icon-variant":"error"},{title:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(d.unref(e).t("topNTable.defaultErrorStateTitle")),1)]),default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(c.value),1)]),_:1})):g.isLoading?(d.openBlock(),d.createBlock(k,{key:1,"table-columns":2,type:"table"})):s.value?(d.openBlock(),d.createElementBlock("div",cT,[d.createElementVNode("div",uT,[d.createElementVNode("div",dT,[d.createElementVNode("div",hT,d.toDisplayString(d.unref(e).t("topNTable.nameLabel")),1),d.createElementVNode("div",fT,d.toDisplayString(l.value),1)])]),d.createElementVNode("div",mT,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(i.value,(T,v)=>(d.openBlock(),d.createElementBlock("div",{key:`entry-${v}`,class:"table-row","data-testid":`row-${u(T)}`},[d.createElementVNode("div",pT,[d.renderSlot(g.$slots,"name",{record:{id:u(T),name:h(T),deleted:f(T),dimension:r.value}},()=>[d.createTextVNode(d.toDisplayString(h(T)),1)],!0)]),d.createElementVNode("div",yT," "+d.toDisplayString(m(T)),1)],8,gT))),128))])])):(d.openBlock(),d.createBlock(x,{key:2,"action-button-visible":!1,"data-testid":"top-n-empty-state"},{title:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(g.emptyStateTitle||d.unref(e).t("topNTable.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[g.title?{name:"title",fn:d.withCtx(()=>[d.createElementVNode("span",aT,d.toDisplayString(g.title),1)]),key:"0"}:void 0,g.description?{name:"actions",fn:d.withCtx(()=>[d.createElementVNode("div",lT,d.toDisplayString(g.description),1)]),key:"1"}:void 0]),1032,["title-tag"])}}}),[["__scopeId","data-v-665e7735"]]);var co={exports:{}};co.exports,function(n,t){var e=200,i="Expected a function",s="__lodash_hash_undefined__",r=1,o=2,a=9007199254740991,l="[object Arguments]",c="[object Array]",u="[object Boolean]",h="[object Date]",f="[object Error]",m="[object Function]",g="[object GeneratorFunction]",b="[object Map]",x="[object Number]",k="[object Object]",M="[object Promise]",T="[object RegExp]",v="[object Set]",S="[object String]",E="[object Symbol]",P="[object WeakMap]",y="[object ArrayBuffer]",_="[object DataView]",C="[object Float32Array]",R="[object Float64Array]",L="[object Int8Array]",I="[object Int16Array]",B="[object Int32Array]",q="[object Uint8Array]",tt="[object Uint8ClampedArray]",V="[object Uint16Array]",ct="[object Uint32Array]",U=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,J=/^\w*$/,et=/^\./,X=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,j=/[\\^$.*+?()[\]{}|]/g,$=/\\(\\)?/g,K=/^\[object .+?Constructor\]$/,_t=/^(?:0|[1-9]\d*)$/,gt={};gt[C]=gt[R]=gt[L]=gt[I]=gt[B]=gt[q]=gt[tt]=gt[V]=gt[ct]=!0,gt[l]=gt[c]=gt[y]=gt[u]=gt[_]=gt[h]=gt[f]=gt[m]=gt[b]=gt[x]=gt[k]=gt[T]=gt[v]=gt[S]=gt[P]=!1;var pt=typeof be=="object"&&be&&be.Object===Object&&be,z=typeof self=="object"&&self&&self.Object===Object&&self,Y=pt||z||Function("return this")(),W=t&&!t.nodeType&&t,Q=W&&!0&&n&&!n.nodeType&&n,nt=Q&&Q.exports===W,it=nt&&pt.process,rt=function(){try{return it&&it.binding("util")}catch{}}(),st=rt&&rt.isTypedArray;function wt(p,D){for(var N=-1,H=p?p.length:0;++N<H;)if(D(p[N],N,p))return!0;return!1}function ut(p){return function(D){return D==null?void 0:D[p]}}function Pt(p,D){for(var N=-1,H=Array(p);++N<p;)H[N]=D(N);return H}function te(p){return function(D){return p(D)}}function ae(p,D){return p==null?void 0:p[D]}function qt(p){var D=!1;if(p!=null&&typeof p.toString!="function")try{D=!!(p+"")}catch{}return D}function Ee(p){var D=-1,N=Array(p.size);return p.forEach(function(H,ft){N[++D]=[ft,H]}),N}function Mt(p,D){return function(N){return p(D(N))}}function Xt(p){var D=-1,N=Array(p.size);return p.forEach(function(H){N[++D]=H}),N}var Bt=Array.prototype,Gt=Function.prototype,ie=Object.prototype,qe=Y["__core-js_shared__"],ni=function(){var p=/[^.]+$/.exec(qe&&qe.keys&&qe.keys.IE_PROTO||"");return p?"Symbol(src)_1."+p:""}(),Fe=Gt.toString,Ht=ie.hasOwnProperty,_e=ie.toString,ii=RegExp("^"+Fe.call(Ht).replace(j,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),uo=Y.Symbol,ho=Y.Uint8Array,zs=ie.propertyIsEnumerable,si=Bt.splice,Bs=Mt(Object.keys,Object),ri=dn(Y,"DataView"),an=dn(Y,"Map"),ln=dn(Y,"Promise"),Hs=dn(Y,"Set"),Ws=dn(Y,"WeakMap"),oi=dn(Object,"create"),Rl=fn(ri),Il=fn(an),fo=fn(ln),mo=fn(Hs),cn=fn(Ws),Ai=uo?uo.prototype:void 0,Vs=Ai?Ai.valueOf:void 0,go=Ai?Ai.toString:void 0;function un(p){var D=-1,N=p?p.length:0;for(this.clear();++D<N;){var H=p[D];this.set(H[0],H[1])}}function Ll(){this.__data__=oi?oi(null):{}}function ze(p){return this.has(p)&&delete this.__data__[p]}function Nl(p){var D=this.__data__;if(oi){var N=D[p];return N===s?void 0:N}return Ht.call(D,p)?D[p]:void 0}function Fl(p){var D=this.__data__;return oi?D[p]!==void 0:Ht.call(D,p)}function zl(p,D){var N=this.__data__;return N[p]=oi&&D===void 0?s:D,this}un.prototype.clear=Ll,un.prototype.delete=ze,un.prototype.get=Nl,un.prototype.has=Fl,un.prototype.set=zl;function Be(p){var D=-1,N=p?p.length:0;for(this.clear();++D<N;){var H=p[D];this.set(H[0],H[1])}}function Bl(){this.__data__=[]}function An(p){var D=this.__data__,N=Li(D,p);if(N<0)return!1;var H=D.length-1;return N==H?D.pop():si.call(D,N,1),!0}function Hl(p){var D=this.__data__,N=Li(D,p);return N<0?void 0:D[N][1]}function Wl(p){return Li(this.__data__,p)>-1}function Vl(p,D){var N=this.__data__,H=Li(N,p);return H<0?N.push([p,D]):N[H][1]=D,this}Be.prototype.clear=Bl,Be.prototype.delete=An,Be.prototype.get=Hl,Be.prototype.has=Wl,Be.prototype.set=Vl;function He(p){var D=-1,N=p?p.length:0;for(this.clear();++D<N;){var H=p[D];this.set(H[0],H[1])}}function Yl(){this.__data__={hash:new un,map:new(an||Be),string:new un}}function Rn(p){return zi(this,p).delete(p)}function jl(p){return zi(this,p).get(p)}function $l(p){return zi(this,p).has(p)}function Ul(p,D){return zi(this,p).set(p,D),this}He.prototype.clear=Yl,He.prototype.delete=Rn,He.prototype.get=jl,He.prototype.has=$l,He.prototype.set=Ul;function Ri(p){var D=-1,N=p?p.length:0;for(this.__data__=new He;++D<N;)this.add(p[D])}function ql(p){return this.__data__.set(p,s),this}function Xl(p){return this.__data__.has(p)}Ri.prototype.add=Ri.prototype.push=ql,Ri.prototype.has=Xl;function Ae(p){this.__data__=new Be(p)}function Ii(){this.__data__=new Be}function Gl(p){return this.__data__.delete(p)}function Ys(p){return this.__data__.get(p)}function Kl(p){return this.__data__.has(p)}function Zl(p,D){var N=this.__data__;if(N instanceof Be){var H=N.__data__;if(!an||H.length<e-1)return H.push([p,D]),this;N=this.__data__=new He(H)}return N.set(p,D),this}Ae.prototype.clear=Ii,Ae.prototype.delete=Gl,Ae.prototype.get=Ys,Ae.prototype.has=Kl,Ae.prototype.set=Zl;function Ql(p,D){var N=w(p)||vo(p)?Pt(p.length,String):[],H=N.length,ft=!!H;for(var Z in p)Ht.call(p,Z)&&!(ft&&(Z=="length"||$s(Z,H)))&&N.push(Z);return N}function Li(p,D){for(var N=p.length;N--;)if(wo(p[N][0],D))return N;return-1}var Jl=cc();function tc(p,D){return p&&Jl(p,D,li)}function Ni(p,D){D=Bi(D,p)?[D]:Xe(D);for(var N=0,H=D.length;p!=null&&N<H;)p=p[hn(D[N++])];return N&&N==H?p:void 0}function ec(p){return _e.call(p)}function nc(p,D){return p!=null&&D in Object(p)}function js(p,D,N,H,ft){return p===D?!0:p==null||D==null||!Kt(p)&&!xe(D)?p!==p&&D!==D:ic(p,D,js,N,H,ft)}function ic(p,D,N,H,ft,Z){var xt=w(p),Zt=w(D),Wt=c,ce=c;xt||(Wt=le(p),Wt=Wt==l?k:Wt),Zt||(ce=le(D),ce=ce==l?k:ce);var we=Wt==k&&!qt(p),ve=ce==k&&!qt(D),fe=Wt==ce;if(fe&&!we)return Z||(Z=new Ae),xt||Mo(p)?bo(p,D,N,H,ft,Z):uc(p,D,Wt,N,H,ft,Z);if(!(ft&o)){var Re=we&&Ht.call(p,"__wrapped__"),Ie=ve&&Ht.call(D,"__wrapped__");if(Re||Ie){var Nn=Re?p.value():p,mn=Ie?D.value():D;return Z||(Z=new Ae),N(Nn,mn,H,ft,Z)}}return fe?(Z||(Z=new Ae),dc(p,D,N,H,ft,Z)):!1}function sc(p,D,N,H){var ft=N.length,Z=ft;if(p==null)return!Z;for(p=Object(p);ft--;){var xt=N[ft];if(xt[2]?xt[1]!==p[xt[0]]:!(xt[0]in p))return!1}for(;++ft<Z;){xt=N[ft];var Zt=xt[0],Wt=p[Zt],ce=xt[1];if(xt[2]){if(Wt===void 0&&!(Zt in p))return!1}else{var we=new Ae,ve;if(!(ve===void 0?js(ce,Wt,H,r|o,we):ve))return!1}}return!0}function rc(p){if(!Kt(p)||_o(p))return!1;var D=G(p)||qt(p)?ii:K;return D.test(fn(p))}function oc(p){return xe(p)&&jt(p.length)&&!!gt[_e.call(p)]}function po(p){return typeof p=="function"?p:p==null?Hi:typeof p=="object"?w(p)?Fi(p[0],p[1]):lc(p):dC(p)}function ac(p){if(!mc(p))return Bs(p);var D=[];for(var N in Object(p))Ht.call(p,N)&&N!="constructor"&&D.push(N);return D}function lc(p){var D=hc(p);return D.length==1&&D[0][2]?qs(D[0][0],D[0][1]):function(N){return N===p||sc(N,p,D)}}function Fi(p,D){return Bi(p)&&xo(D)?qs(hn(p),D):function(N){var H=ko(N,p);return H===void 0&&H===D?So(N,p):js(D,H,void 0,r|o)}}function In(p){return function(D){return Ni(D,p)}}function yo(p){if(typeof p=="string")return p;if(ee(p))return go?go.call(p):"";var D=p+"";return D=="0"&&1/p==-1/0?"-0":D}function Xe(p){return w(p)?p:gc(p)}function cc(p){return function(D,N,H){for(var ft=-1,Z=Object(D),xt=H(D),Zt=xt.length;Zt--;){var Wt=xt[++ft];if(N(Z[Wt],Wt,Z)===!1)break}return D}}function bo(p,D,N,H,ft,Z){var xt=ft&o,Zt=p.length,Wt=D.length;if(Zt!=Wt&&!(xt&&Wt>Zt))return!1;var ce=Z.get(p);if(ce&&Z.get(D))return ce==D;var we=-1,ve=!0,fe=ft&r?new Ri:void 0;for(Z.set(p,D),Z.set(D,p);++we<Zt;){var Re=p[we],Ie=D[we];if(H)var Nn=xt?H(Ie,Re,we,D,p,Z):H(Re,Ie,we,p,D,Z);if(Nn!==void 0){if(Nn)continue;ve=!1;break}if(fe){if(!wt(D,function(mn,ci){if(!fe.has(ci)&&(Re===mn||N(Re,mn,H,ft,Z)))return fe.add(ci)})){ve=!1;break}}else if(!(Re===Ie||N(Re,Ie,H,ft,Z))){ve=!1;break}}return Z.delete(p),Z.delete(D),ve}function uc(p,D,N,H,ft,Z,xt){switch(N){case _:if(p.byteLength!=D.byteLength||p.byteOffset!=D.byteOffset)return!1;p=p.buffer,D=D.buffer;case y:return!(p.byteLength!=D.byteLength||!H(new ho(p),new ho(D)));case u:case h:case x:return wo(+p,+D);case f:return p.name==D.name&&p.message==D.message;case T:case S:return p==D+"";case b:var Zt=Ee;case v:var Wt=Z&o;if(Zt||(Zt=Xt),p.size!=D.size&&!Wt)return!1;var ce=xt.get(p);if(ce)return ce==D;Z|=r,xt.set(p,D);var we=bo(Zt(p),Zt(D),H,ft,Z,xt);return xt.delete(p),we;case E:if(Vs)return Vs.call(p)==Vs.call(D)}return!1}function dc(p,D,N,H,ft,Z){var xt=ft&o,Zt=li(p),Wt=Zt.length,ce=li(D),we=ce.length;if(Wt!=we&&!xt)return!1;for(var ve=Wt;ve--;){var fe=Zt[ve];if(!(xt?fe in D:Ht.call(D,fe)))return!1}var Re=Z.get(p);if(Re&&Z.get(D))return Re==D;var Ie=!0;Z.set(p,D),Z.set(D,p);for(var Nn=xt;++ve<Wt;){fe=Zt[ve];var mn=p[fe],ci=D[fe];if(H)var Nm=xt?H(ci,mn,fe,D,p,Z):H(mn,ci,fe,p,D,Z);if(!(Nm===void 0?mn===ci||N(mn,ci,H,ft,Z):Nm)){Ie=!1;break}Nn||(Nn=fe=="constructor")}if(Ie&&!Nn){var Do=p.constructor,To=D.constructor;Do!=To&&"constructor"in p&&"constructor"in D&&!(typeof Do=="function"&&Do instanceof Do&&typeof To=="function"&&To instanceof To)&&(Ie=!1)}return Z.delete(p),Z.delete(D),Ie}function zi(p,D){var N=p.__data__;return Us(D)?N[typeof D=="string"?"string":"hash"]:N.map}function hc(p){for(var D=li(p),N=D.length;N--;){var H=D[N],ft=p[H];D[N]=[H,ft,xo(ft)]}return D}function dn(p,D){var N=ae(p,D);return rc(N)?N:void 0}var le=ec;(ri&&le(new ri(new ArrayBuffer(1)))!=_||an&&le(new an)!=b||ln&&le(ln.resolve())!=M||Hs&&le(new Hs)!=v||Ws&&le(new Ws)!=P)&&(le=function(p){var D=_e.call(p),N=D==k?p.constructor:void 0,H=N?fn(N):void 0;if(H)switch(H){case Rl:return _;case Il:return b;case fo:return M;case mo:return v;case cn:return P}return D});function fc(p,D,N){D=Bi(D,p)?[D]:Xe(D);for(var H,ft=-1,xt=D.length;++ft<xt;){var Z=hn(D[ft]);if(!(H=p!=null&&N(p,Z)))break;p=p[Z]}if(H)return H;var xt=p?p.length:0;return!!xt&&jt(xt)&&$s(Z,xt)&&(w(p)||vo(p))}function $s(p,D){return D=D??a,!!D&&(typeof p=="number"||_t.test(p))&&p>-1&&p%1==0&&p<D}function Bi(p,D){if(w(p))return!1;var N=typeof p;return N=="number"||N=="symbol"||N=="boolean"||p==null||ee(p)?!0:J.test(p)||!U.test(p)||D!=null&&p in Object(D)}function Us(p){var D=typeof p;return D=="string"||D=="number"||D=="symbol"||D=="boolean"?p!=="__proto__":p===null}function _o(p){return!!ni&&ni in p}function mc(p){var D=p&&p.constructor,N=typeof D=="function"&&D.prototype||ie;return p===N}function xo(p){return p===p&&!Kt(p)}function qs(p,D){return function(N){return N==null?!1:N[p]===D&&(D!==void 0||p in Object(N))}}var gc=ai(function(p){p=Ln(p);var D=[];return et.test(p)&&D.push(""),p.replace(X,function(N,H,ft,Z){D.push(ft?Z.replace($,"$1"):H||N)}),D});function hn(p){if(typeof p=="string"||ee(p))return p;var D=p+"";return D=="0"&&1/p==-1/0?"-0":D}function fn(p){if(p!=null){try{return Fe.call(p)}catch{}try{return p+""}catch{}}return""}function ai(p,D){if(typeof p!="function"||D&&typeof D!="function")throw new TypeError(i);var N=function(){var H=arguments,ft=D?D.apply(this,H):H[0],Z=N.cache;if(Z.has(ft))return Z.get(ft);var xt=p.apply(this,H);return N.cache=Z.set(ft,xt),xt};return N.cache=new(ai.Cache||He),N}ai.Cache=He;function wo(p,D){return p===D||p!==p&&D!==D}function vo(p){return F(p)&&Ht.call(p,"callee")&&(!zs.call(p,"callee")||_e.call(p)==l)}var w=Array.isArray;function A(p){return p!=null&&jt(p.length)&&!G(p)}function F(p){return xe(p)&&A(p)}function G(p){var D=Kt(p)?_e.call(p):"";return D==m||D==g}function jt(p){return typeof p=="number"&&p>-1&&p%1==0&&p<=a}function Kt(p){var D=typeof p;return!!p&&(D=="object"||D=="function")}function xe(p){return!!p&&typeof p=="object"}function ee(p){return typeof p=="symbol"||xe(p)&&_e.call(p)==E}var Mo=st?te(st):oc;function Ln(p){return p==null?"":yo(p)}function ko(p,D,N){var H=p==null?void 0:Ni(p,D);return H===void 0?N:H}function So(p,D){return p!=null&&fc(p,D,nc)}function li(p){return A(p)?Ql(p):ac(p)}function Xs(p,D){var N={};return D=po(D),tc(p,function(H,ft,Z){N[D(H,ft,Z)]=H}),N}function Hi(p){return p}function dC(p){return Bi(p)?ut(hn(p)):In(p)}n.exports=Xs}(co,co.exports);var _T=co.exports;const xT=tl(_T);var wT=9007199254740991,vT="[object Arguments]",MT="[object Function]",kT="[object GeneratorFunction]",ST="[object Symbol]",DT=typeof be=="object"&&be&&be.Object===Object&&be,TT=typeof self=="object"&&self&&self.Object===Object&&self,CT=DT||TT||Function("return this")();function PT(n,t,e){switch(e.length){case 0:return n.call(t);case 1:return n.call(t,e[0]);case 2:return n.call(t,e[0],e[1]);case 3:return n.call(t,e[0],e[1],e[2])}return n.apply(t,e)}function OT(n,t){for(var e=-1,i=n?n.length:0,s=Array(i);++e<i;)s[e]=t(n[e],e,n);return s}function ET(n,t){for(var e=-1,i=t.length,s=n.length;++e<i;)n[s+e]=t[e];return n}var El=Object.prototype,AT=El.hasOwnProperty,Al=El.toString,Cm=CT.Symbol,RT=El.propertyIsEnumerable,Pm=Cm?Cm.isConcatSpreadable:void 0,Om=Math.max;function IT(n,t,e,i,s){var r=-1,o=n.length;for(e||(e=zT),s||(s=[]);++r<o;){var a=n[r];e(a)?ET(s,a):s[s.length]=a}return s}function LT(n,t){return n=Object(n),NT(n,t,function(e,i){return i in n})}function NT(n,t,e){for(var i=-1,s=t.length,r={};++i<s;){var o=t[i],a=n[o];e(a,o)&&(r[o]=a)}return r}function FT(n,t){return t=Om(t===void 0?n.length-1:t,0),function(){for(var e=arguments,i=-1,s=Om(e.length-t,0),r=Array(s);++i<s;)r[i]=e[t+i];i=-1;for(var o=Array(t+1);++i<t;)o[i]=e[i];return o[t]=r,PT(n,this,o)}}function zT(n){return WT(n)||HT(n)||!!(Pm&&n&&n[Pm])}function BT(n){if(typeof n=="string"||qT(n))return n;var t=n+"";return t=="0"&&1/n==-1/0?"-0":t}function HT(n){return YT(n)&&AT.call(n,"callee")&&(!RT.call(n,"callee")||Al.call(n)==vT)}var WT=Array.isArray;function VT(n){return n!=null&&$T(n.length)&&!jT(n)}function YT(n){return Em(n)&&VT(n)}function jT(n){var t=UT(n)?Al.call(n):"";return t==MT||t==kT}function $T(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=wT}function UT(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}function Em(n){return!!n&&typeof n=="object"}function qT(n){return typeof n=="symbol"||Em(n)&&Al.call(n)==ST}var XT=FT(function(n,t){return n==null?{}:LT(n,OT(IT(t),BT))}),GT=XT;const KT=tl(GT);var Am={exports:{}};(function(n,t){(function(e,i){i()})(be,function(){function e(c,u){return typeof u>"u"?u={autoBom:!1}:typeof u!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),u={autoBom:!u}),u.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type)?new Blob(["\uFEFF",c],{type:c.type}):c}function i(c,u,h){var f=new XMLHttpRequest;f.open("GET",c),f.responseType="blob",f.onload=function(){l(f.response,u,h)},f.onerror=function(){console.error("could not download file")},f.send()}function s(c){var u=new XMLHttpRequest;u.open("HEAD",c,!1);try{u.send()}catch{}return 200<=u.status&&299>=u.status}function r(c){try{c.dispatchEvent(new MouseEvent("click"))}catch{var u=document.createEvent("MouseEvents");u.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),c.dispatchEvent(u)}}var o=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof be=="object"&&be.global===be?be:void 0,a=o.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=o.saveAs||(typeof window!="object"||window!==o?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(c,u,h){var f=o.URL||o.webkitURL,m=document.createElement("a");u=u||c.name||"download",m.download=u,m.rel="noopener",typeof c=="string"?(m.href=c,m.origin===location.origin?r(m):s(m.href)?i(c,u,h):r(m,m.target="_blank")):(m.href=f.createObjectURL(c),setTimeout(function(){f.revokeObjectURL(m.href)},4e4),setTimeout(function(){r(m)},0))}:"msSaveOrOpenBlob"in navigator?function(c,u,h){if(u=u||c.name||"download",typeof c!="string")navigator.msSaveOrOpenBlob(e(c,h),u);else if(s(c))i(c,u,h);else{var f=document.createElement("a");f.href=c,f.target="_blank",setTimeout(function(){r(f)})}}:function(c,u,h,f){if(f=f||open("","_blank"),f&&(f.document.title=f.document.body.innerText="downloading..."),typeof c=="string")return i(c,u,h);var m=c.type==="application/octet-stream",g=/constructor/i.test(o.HTMLElement)||o.safari,b=/CriOS\/[\d]+/.test(navigator.userAgent);if((b||m&&g||a)&&typeof FileReader<"u"){var x=new FileReader;x.onloadend=function(){var T=x.result;T=b?T:T.replace(/^data:[^;]*;/,"data:attachment/file;"),f?f.location.href=T:location=T,f=null},x.readAsDataURL(c)}else{var k=o.URL||o.webkitURL,M=k.createObjectURL(c);f?f.location=M:location.href=M,f=null,setTimeout(function(){k.revokeObjectURL(M)},4e4)}});o.saveAs=l.saveAs=l,n.exports=l})})(Am);var ZT=Am.exports,Rm={exports:{}};/* @license
|
|
29
29
|
Papa Parse
|
|
30
30
|
v5.5.3
|
|
31
31
|
https://github.com/mholt/PapaParse
|